Fully Automated - 100% Backpressure - Pipeline runner ๐Ÿƒ for AI workflows. ๐Ÿš€

Commit 2dedda7b

2dedda7bddf1Merged

Scott Nixon <[email protected]> ยท 9 months ago ยท 2 files ยท ~2 modified

Description

[attractor-e8i] Register projects module and ensure server fn registration

  • Move projects module declaration outside SSR gate so Leptos can generate client stubs
  • Add conditional imports and type definitions for client-side compilation
  • Define Project and CachedDoc types twice: once re-exported from db (SSR), once as local stubs (client)
  • Ensures server functions are callable from WASM frontend via RPC
  • Both SSR and client modes now compile successfully

Details

Commit
2dedda7bddf1
Parent
97d8e9ddaa9d

crates/attractor-web/src/server/mod.rsmodifiedView file

@@ -1,0 +1,28 @@
1+pub mod execute;
2+
3+// Leptos server functions: available to both SSR and WASM (for RPC stubs)
4+pub mod projects;
5+
6+// SSR-only modules (no client stubs needed)
7+#[cfg(feature = "ssr")]
8+pub mod db;
9+#[cfg(feature = "ssr")]
10+pub mod documents;
11+#[cfg(feature = "ssr")]
12+pub mod stream;
13+#[cfg(feature = "ssr")]
14+pub mod terminal;
15+
16+#[cfg(feature = "ssr")]
17+use std::collections::HashMap;
18+#[cfg(feature = "ssr")]
19+use std::sync::{Arc, Mutex};
20+
21+/// Shared application state accessible from Axum routes.
22+#[cfg(feature = "ssr")]
23+#[derive(Clone)]
24+pub struct AppState {
25+ pub db: sqlx::SqlitePool,
26+ pub watchers: Arc<Mutex<HashMap<i64, Arc<documents::DocumentWatcher>>>>,
27+ pub terminal_sessions: terminal::TerminalSessions,
28+}