336 lines
18 KiB
Rust
336 lines
18 KiB
Rust
// file: kb-app-demo-desktop/src/lib.rs
|
|
// version: 26
|
|
|
|
//! Tauri desktop demo application for `khadhroony-bot3`.
|
|
|
|
#![forbid(unsafe_code)]
|
|
#![deny(unreachable_pub)]
|
|
#![warn(missing_docs)]
|
|
|
|
mod app_state;
|
|
mod constants;
|
|
mod demo_backfill;
|
|
mod demo_config;
|
|
mod demo_core_extraction;
|
|
mod demo_decode_replay;
|
|
mod demo_devnet_common;
|
|
mod demo_execution_metadata;
|
|
mod demo_execution_solana_core;
|
|
mod demo_execution_spl;
|
|
mod demo_http;
|
|
mod demo_spl_ata;
|
|
mod demo_spl_token;
|
|
mod demo_spl_token_2022;
|
|
mod demo_sql_common;
|
|
mod demo_sql_diag;
|
|
mod demo_sql_pg_core;
|
|
mod demo_sql_pg_raw;
|
|
mod demo_sql_replay_candidates;
|
|
mod demo_ws;
|
|
mod frontend_log;
|
|
mod main_window;
|
|
mod splash;
|
|
mod tauri;
|
|
|
|
/// Runs the desktop demo application.
|
|
pub use self::tauri::run;
|
|
|
|
/// Shared application state managed by Tauri.
|
|
pub(crate) use self::app_state::AppState;
|
|
/// Canonical tracing target for the desktop demo application.
|
|
pub(crate) use self::constants::TRACING_TARGET;
|
|
/// Backfill observer forwarding pipeline progress to the Tauri window.
|
|
pub(crate) use self::demo_backfill::DemoBackfillObserver;
|
|
/// Initial options shown by the backfill window.
|
|
pub(crate) use self::demo_backfill::DemoBackfillOptionsPayload;
|
|
/// One known program suggested by the backfill Program ID autocomplete.
|
|
pub(crate) use self::demo_backfill::DemoBackfillProgramOption;
|
|
/// One progress event emitted to the backfill window.
|
|
pub(crate) use self::demo_backfill::DemoBackfillProgressPayload;
|
|
/// UI request for one bounded backfill campaign.
|
|
pub(crate) use self::demo_backfill::DemoBackfillRequest;
|
|
/// One endpoint role selectable by the backfill window.
|
|
pub(crate) use self::demo_backfill::DemoBackfillRoleOption;
|
|
/// Guard restoring the single-campaign flag.
|
|
pub(crate) use self::demo_backfill::DemoBackfillRunGuard;
|
|
/// Final UI-safe summary for one backfill campaign.
|
|
pub(crate) use self::demo_backfill::DemoBackfillSummaryPayload;
|
|
/// Requests cooperative cancellation of the active backfill campaign.
|
|
pub(crate) use self::demo_backfill::demo_backfill_cancel;
|
|
/// Executes one bounded backfill campaign and emits progress events.
|
|
pub(crate) use self::demo_backfill::demo_backfill_execute;
|
|
/// Returns endpoint roles, known programs and conservative backfill defaults.
|
|
pub(crate) use self::demo_backfill::demo_backfill_options;
|
|
/// Configuration payload shown by the configuration window.
|
|
pub(crate) use self::demo_config::DemoConfigPayload;
|
|
/// Builds the configuration payload from shared application state.
|
|
pub(crate) use self::demo_config::demo_config_payload;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionObserver;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionOptionsPayload;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionProgramOption;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionProgressPayload;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionRequest;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionRunGuard;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::DemoCoreExtractionSummaryPayload;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::demo_core_extraction_cancel;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::demo_core_extraction_execute;
|
|
/// Internal demo core extraction item.
|
|
pub(crate) use self::demo_core_extraction::demo_core_extraction_options_payload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeCoverageSummaryPayload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeDiagnosticsPayload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeProcessorSummaryPayload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayDecoderOption;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayObserver;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayOptionsPayload;
|
|
/// Internal demo decode replay program option.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayProgramOption;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayProgressPayload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayRequest;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplayRunGuard;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoDecodeReplaySummaryPayload;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoTransactionAnnotationRequest;
|
|
/// Internal demo decode replay item.
|
|
pub(crate) use self::demo_decode_replay::DemoTransactionAnnotationRow;
|
|
/// Loads bounded materialized transaction annotations for the replay diagnostics panel.
|
|
pub(crate) use self::demo_decode_replay::demo_decode_replay_annotations;
|
|
/// Requests cooperative cancellation of the active decode replay campaign.
|
|
pub(crate) use self::demo_decode_replay::demo_decode_replay_cancel;
|
|
/// Loads aggregate diagnostics for the decode replay panel.
|
|
pub(crate) use self::demo_decode_replay::demo_decode_replay_diagnostics;
|
|
/// Executes one bounded contextual decode replay campaign.
|
|
pub(crate) use self::demo_decode_replay::demo_decode_replay_execute;
|
|
/// Returns available decoders and default replay bounds.
|
|
pub(crate) use self::demo_decode_replay::demo_decode_replay_options;
|
|
/// Readiness report for one Devnet profile PostgreSQL store.
|
|
pub(crate) use self::demo_devnet_common::DemoExecutionDevnetStoreReadinessPayload;
|
|
/// Converts the reusable scenario readiness report to the desktop TS-RS payload.
|
|
pub(crate) use self::demo_devnet_common::devnet_store_readiness_payload;
|
|
/// Serializes a diagnostic value to indented JSON without panicking.
|
|
pub(crate) use self::demo_devnet_common::pretty_json;
|
|
/// UI-safe Metaplex scenario row.
|
|
pub(crate) use self::demo_execution_metadata::DemoExecutionMetadataScenarioPayload;
|
|
/// Returns the canonical Metaplex scenario inventory for the desktop panel.
|
|
pub(crate) use self::demo_execution_metadata::demo_execution_metadata_scenarios;
|
|
/// Request sent by the Memo v4 Devnet execution panel.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionMemoRequest;
|
|
/// UI-safe result of one Memo v4 Devnet execution orchestration.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionMemoSummaryPayload;
|
|
/// Public key generated for a disposable Devnet recipient.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreGeneratedRecipientPayload;
|
|
/// Bridges reusable execution progress to desktop events.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreObserver;
|
|
/// Initial options shown by the Solana Core execution demo.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreOptionsPayload;
|
|
/// One Devnet execution profile exposed to the demo window.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreProfileOption;
|
|
/// Progress event emitted during execution and post-validation.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreProgressPayload;
|
|
/// Request sent by the execution demo.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreRequest;
|
|
/// Restores the single-execution state flag when a run finishes.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreRunGuard;
|
|
/// UI-safe result of one execution orchestration.
|
|
pub(crate) use self::demo_execution_solana_core::DemoExecutionSolanaCoreSummaryPayload;
|
|
/// Maps a confirmation status to its stable UI code.
|
|
pub(crate) use self::demo_execution_solana_core::confirmation_status_code;
|
|
/// Returns compatible Devnet profiles and conservative defaults.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_devnet_prepare_profile;
|
|
/// Requests cooperative cancellation before the next execution stage.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_solana_core_cancel;
|
|
/// Executes one bounded System transfer simulation or Devnet submission.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_solana_core_execute;
|
|
/// Generates a disposable recipient public key without exposing its private key.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_solana_core_generate_recipient;
|
|
/// Returns compatible Devnet profiles and conservative defaults.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_solana_core_options;
|
|
/// Executes one Memo v4 simulation or explicitly authorized Devnet submission.
|
|
pub(crate) use self::demo_execution_solana_core::demo_execution_spl_memo_execute;
|
|
/// Maps an execution cluster to its stable UI code.
|
|
pub(crate) use self::demo_execution_solana_core::execution_cluster_code;
|
|
/// Selects and validates one Devnet profile by name.
|
|
pub(crate) use self::demo_execution_solana_core::select_devnet_profile;
|
|
/// Frontend payload for one independent Devnet SPL validation scenario.
|
|
pub(crate) use self::demo_execution_spl::DevnetSplValidationScenarioPayload;
|
|
/// Returns the complete ordered Devnet SPL validation inventory for milestone 0.4.6.
|
|
pub(crate) use self::demo_execution_spl::demo_execution_spl_validation_scenarios;
|
|
/// HTTP demo response payload.
|
|
pub(crate) use self::demo_http::DemoHttpExecutionPayload;
|
|
/// One selectable HTTP JSON-RPC method.
|
|
pub(crate) use self::demo_http::DemoHttpMethodOption;
|
|
/// HTTP demo options payload.
|
|
pub(crate) use self::demo_http::DemoHttpOptionsPayload;
|
|
/// HTTP demo request payload.
|
|
pub(crate) use self::demo_http::DemoHttpRequest;
|
|
/// One selectable HTTP endpoint role.
|
|
pub(crate) use self::demo_http::DemoHttpRoleOption;
|
|
/// Executes one raw HTTP JSON-RPC request.
|
|
pub(crate) use self::demo_http::demo_http_execute_request;
|
|
/// Returns the configured HTTP pool client snapshots.
|
|
pub(crate) use self::demo_http::demo_http_list_pool_clients;
|
|
/// Returns HTTP roles, methods and conservative defaults.
|
|
pub(crate) use self::demo_http::demo_http_options;
|
|
/// Request for one representative ATA creation on Devnet.
|
|
pub(crate) use self::demo_spl_ata::DemoExecutionSplAtaRequest;
|
|
/// UI-safe ATA execution result.
|
|
pub(crate) use self::demo_spl_ata::DemoExecutionSplAtaSummaryPayload;
|
|
/// Readonly payer, wallet, Token Program and derived ATA values.
|
|
pub(crate) use self::demo_spl_ata::DemoSplAtaDerivationPayload;
|
|
/// Request used to derive the representative wallet ATA before execution.
|
|
pub(crate) use self::demo_spl_ata::DemoSplAtaDerivationRequest;
|
|
/// Bounded ATA lifecycle journal request.
|
|
pub(crate) use self::demo_spl_ata::DemoSplAtaJournalRequest;
|
|
/// One UI-safe ATA lifecycle journal row.
|
|
pub(crate) use self::demo_spl_ata::DemoSplAtaJournalRow;
|
|
/// Executes one representative Create or CreateIdempotent ATA flow.
|
|
pub(crate) use self::demo_spl_ata::demo_execution_spl_ata_execute;
|
|
/// Derives the representative profile wallet ATA without exposing private key material.
|
|
pub(crate) use self::demo_spl_ata::demo_spl_ata_derive;
|
|
/// Loads a bounded journal of ATA-owned lifecycle facts.
|
|
pub(crate) use self::demo_spl_ata::demo_spl_ata_journal;
|
|
/// Request for one checked classic SPL Token transfer on Devnet.
|
|
pub(crate) use self::demo_spl_token::DemoExecutionSplTokenRequest;
|
|
/// UI-safe result of one checked SPL Token transfer orchestration.
|
|
pub(crate) use self::demo_spl_token::DemoExecutionSplTokenSummaryPayload;
|
|
/// Bounded exact filters for the classic SPL Token materialized journal.
|
|
pub(crate) use self::demo_spl_token::DemoSplTokenJournalRequest;
|
|
/// UI-safe materialized classic SPL Token journal row.
|
|
pub(crate) use self::demo_spl_token::DemoSplTokenJournalRow;
|
|
/// Executes one checked SPL Token simulation or explicitly authorized Devnet submission.
|
|
pub(crate) use self::demo_spl_token::demo_execution_spl_token_execute;
|
|
/// Loads a bounded, typed journal of committed classic SPL Token projections.
|
|
pub(crate) use self::demo_spl_token::demo_spl_token_journal;
|
|
/// Request for one independent public Token-2022 Devnet scenario.
|
|
pub(crate) use self::demo_spl_token_2022::DemoExecutionSplToken2022Request;
|
|
/// UI-safe result of one public Token-2022 Devnet orchestration.
|
|
pub(crate) use self::demo_spl_token_2022::DemoExecutionSplToken2022SummaryPayload;
|
|
/// Public values loaded from one persisted Token-2022 validation fixture.
|
|
pub(crate) use self::demo_spl_token_2022::DemoSplToken2022FixturePayload;
|
|
/// Executes one public Token-2022 simulation or explicitly authorized Devnet submission.
|
|
pub(crate) use self::demo_spl_token_2022::demo_execution_spl_token_2022_execute;
|
|
/// Loads public Token-2022 fixture values without reading private key bytes.
|
|
pub(crate) use self::demo_spl_token_2022::demo_spl_token_2022_fixture;
|
|
/// UI-safe SQL table diagnostic snapshot.
|
|
pub(crate) use self::demo_sql_common::DemoSqlTableSnapshot;
|
|
/// Connects to the configured PostgreSQL store.
|
|
pub(crate) use self::demo_sql_common::connect_postgres_store;
|
|
/// Formats diagnostic statuses.
|
|
pub(crate) use self::demo_sql_common::debug_status;
|
|
/// Initializes the PostgreSQL schema during startup.
|
|
pub(crate) use self::demo_sql_common::initialize_postgres_schema_for_startup;
|
|
/// Builds PostgreSQL options from the active profile.
|
|
pub(crate) use self::demo_sql_common::postgres_store_options_from_profile;
|
|
/// Converts one PostgreSQL table diagnostic.
|
|
pub(crate) use self::demo_sql_common::table_snapshot_from_pg;
|
|
/// Converts PostgreSQL table diagnostics.
|
|
pub(crate) use self::demo_sql_common::table_snapshots_from_pg;
|
|
/// SQL diagnostic payload.
|
|
pub(crate) use self::demo_sql_diag::DemoSqlDiagPayload;
|
|
/// Loads read-only SQL diagnostics from the active profile.
|
|
pub(crate) use self::demo_sql_diag::load_demo_sql_diag;
|
|
/// PostgreSQL core-table payload.
|
|
pub(crate) use self::demo_sql_pg_core::DemoSqlPgCorePayload;
|
|
/// Loads read-only core table diagnostics from PostgreSQL.
|
|
pub(crate) use self::demo_sql_pg_core::load_demo_sql_pg_core;
|
|
/// PostgreSQL raw-table payload.
|
|
pub(crate) use self::demo_sql_pg_raw::DemoSqlPgRawPayload;
|
|
/// Loads read-only raw table diagnostics from PostgreSQL.
|
|
pub(crate) use self::demo_sql_pg_raw::load_demo_sql_pg_raw;
|
|
/// SQL replay entity request.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayEntityRequest;
|
|
/// SQL replay entity row.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayEntityRow;
|
|
/// Known program option.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayKnownProgramOption;
|
|
/// SQL replay options payload.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayOptionsPayload;
|
|
/// SQL replay program request.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayProgramRequest;
|
|
/// SQL replay program row.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayProgramRow;
|
|
/// SQL replay transaction request.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayTransactionRequest;
|
|
/// SQL replay transaction row.
|
|
pub(crate) use self::demo_sql_replay_candidates::DemoSqlReplayTransactionRow;
|
|
/// Loads static browser options from the active PostgreSQL profile.
|
|
pub(crate) use self::demo_sql_replay_candidates::demo_sql_replay_options;
|
|
/// Writes a bounded replay-candidate CSV file into `./data/exports_csv/`.
|
|
pub(crate) use self::demo_sql_replay_candidates::export_demo_sql_replay_csv;
|
|
/// Loads bounded mint, owner or account-key summaries from PostgreSQL core tables.
|
|
pub(crate) use self::demo_sql_replay_candidates::load_demo_sql_replay_entities;
|
|
/// Loads bounded program summaries from PostgreSQL.
|
|
pub(crate) use self::demo_sql_replay_candidates::load_demo_sql_replay_programs;
|
|
/// Loads bounded transaction replay candidates from PostgreSQL.
|
|
pub(crate) use self::demo_sql_replay_candidates::load_demo_sql_replay_transactions;
|
|
/// WebSocket execution response payload.
|
|
pub(crate) use self::demo_ws::DemoWsExecutionPayload;
|
|
/// WebSocket message emitted to the frontend.
|
|
pub(crate) use self::demo_ws::DemoWsMessagePayload;
|
|
/// One selectable WebSocket method.
|
|
pub(crate) use self::demo_ws::DemoWsMethodOption;
|
|
/// WebSocket demo options payload.
|
|
pub(crate) use self::demo_ws::DemoWsOptionsPayload;
|
|
/// WebSocket subscription request.
|
|
pub(crate) use self::demo_ws::DemoWsRequest;
|
|
/// One selectable WebSocket role.
|
|
pub(crate) use self::demo_ws::DemoWsRoleOption;
|
|
/// Current WebSocket session status.
|
|
pub(crate) use self::demo_ws::DemoWsStatusPayload;
|
|
/// One active WebSocket subscription status.
|
|
pub(crate) use self::demo_ws::DemoWsSubscriptionStatusPayload;
|
|
/// WebSocket unsubscribe request.
|
|
pub(crate) use self::demo_ws::DemoWsUnsubscribeRequest;
|
|
/// Connects and subscribes through the persistent WebSocket session.
|
|
pub(crate) use self::demo_ws::demo_ws_connect;
|
|
/// Disconnects the persistent WebSocket session.
|
|
pub(crate) use self::demo_ws::demo_ws_disconnect;
|
|
/// Lists WebSocket endpoints available through the configured pool.
|
|
pub(crate) use self::demo_ws::demo_ws_list_pool_clients;
|
|
/// Lists selectable WebSocket roles and methods for the demo UI.
|
|
pub(crate) use self::demo_ws::demo_ws_options;
|
|
/// Returns the current WebSocket session status.
|
|
pub(crate) use self::demo_ws::demo_ws_status;
|
|
/// Unsubscribes one active WebSocket subscription.
|
|
pub(crate) use self::demo_ws::demo_ws_unsubscribe;
|
|
/// Disconnects the persistent WebSocket session during application shutdown.
|
|
pub(crate) use self::demo_ws::disconnect_demo_ws_app_state;
|
|
/// Frontend logging payload.
|
|
pub(crate) use self::frontend_log::FrontendLogPayload;
|
|
/// Emits one normalized frontend log event.
|
|
pub(crate) use self::frontend_log::emit_frontend_log;
|
|
/// Loads the project README for the main window.
|
|
pub(crate) use self::main_window::load_project_readme;
|
|
/// Returns the workspace root directory.
|
|
pub(crate) use self::main_window::workspace_root_dir;
|
|
/// Delay after fade-out before destroying the splash window.
|
|
pub(crate) use self::splash::SPLASH_CLOSE_WAIT_MS;
|
|
/// Splash fade duration.
|
|
pub(crate) use self::splash::SPLASH_FADE_MS;
|
|
/// Minimum startup splash duration before fade-out begins.
|
|
pub(crate) use self::splash::SPLASH_MINIMUM_MS;
|
|
/// Command sent from Rust to the splash frontend.
|
|
pub(crate) use self::splash::SplashOrder;
|
|
/// Emits one order to the splash frontend.
|
|
pub(crate) use self::splash::emit_splash_order;
|
|
/// Runs the startup sequence after the splash frontend is ready.
|
|
pub(crate) use self::splash::splash_frontend_ready;
|