Skip to content

Commit ee596b1

Browse files
feat(examples): add Antigravity Chat UI (leptos_ssr_axum) and agent_server SSE proxy
agent_server/src/main.rs - Full Axum HTTP server that proxies the Antigravity SDK over SSE - Endpoints: POST /chat/stream (SSE), POST /confirm, POST /halt, POST /answer, GET|POST /workspace, GET /sessions, POST /sessions/rename - ConfirmHook: per-session tool-approval gate; supports once / allow-for-session - Auto-approves read-only tools (VIEW_FILE, LIST_DIRECTORY) immediately - Concurrent confirm-task runs alongside step-stream loop so confirmations never block token delivery - SSE keepalive (15 s ping) + 2 048-slot channel buffer prevent connection drops during long-running agent turns - Per-session workspace isolation; WORKSPACE_ROOT env override supported agent_server/Cargo.toml - Added axum, tokio, serde, tracing, anyhow, gloo dependencies agent_server/rust_async_learning/ - Generated Rust async learning workspace produced by the agent during a live teaching session (compiler-driven development demo) leptos_ssr_axum/src/app.rs - Full chat UI built on Leptos 0.7 + WASM hydration - SSE EventSource client: token / thought / tool_start / tool_result / confirm / usage / idle / done / error named events - Floating permission panel above input for tool confirmations; Deny now also calls POST /halt to stop the agent immediately - AssistantMessage blocks rendered with markdown + syntax highlighting - Thinking blocks (collapsible THOUGHT PROCESS chip) - ToolCall / ToolResult cards with status badges and output accordion - Usage summary badges per agent turn - Sidebar session list with rename (persisted to KV, merge strategy prevents server list refresh from clobbering local renames) - Dark/light theme toggle persisted to localStorage - Auto-scroll with user-scroll-up detection - Session-scoped stream_completed flag prevents double-finalisation leptos_ssr_axum/src/server.rs - Spin KV backed session persistence: save_turn_blocks, list_sessions, rename_session, get_session_blocks server functions leptos_ssr_axum/src/types.rs - MessageBlock, SessionMeta, PendingConfirm, SSE event structs leptos_ssr_axum/src/main.rs + Cargo.toml + input.css - Spin/WASM entry point, dependency manifest, Tailwind input stylesheet leptos_axum/src/lib.rs - Minor fixes to the simpler leptos_axum example
1 parent 359ddb1 commit ee596b1

11 files changed

Lines changed: 4283 additions & 767 deletions

File tree

examples/agent_server/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,4 @@ tracing = "0.1"
1919
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
2020
dotenvy = "0.15"
2121
futures-util = "0.3"
22+
anyhow = "1"
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[package]
2+
name = "rust_async_learning"
3+
version = "0.1.0"
4+
edition = "2024"
5+
6+
[dependencies]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
fn main() {
2+
println!("Hello, world!");
3+
}

0 commit comments

Comments
 (0)