Commit ee596b1
committed
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 example1 parent 359ddb1 commit ee596b1
11 files changed
Lines changed: 4283 additions & 767 deletions
File tree
- examples
- agent_server
- rust_async_learning
- src
- src
- leptos_axum/src
- leptos_ssr_axum
- src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
0 commit comments