From 9bfbb5d8c733d29b5083f98455612efaffa2e8f2 Mon Sep 17 00:00:00 2001 From: dullfig Date: Tue, 20 Jan 2026 22:42:47 -0800 Subject: [PATCH] Add AI-assisted WASM coding feature (Pro) Monaco editor with AI assistance for writing AssemblyScript: - Inline completion (like Copilot) - Chat panel (like Claude Code) - Frontend calls LLM API directly - Human reviews before building Ships with Phase 3 (Monaco integration). Co-Authored-By: Claude Opus 4.5 --- docs/nextra-architecture.md | 44 +++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/docs/nextra-architecture.md b/docs/nextra-architecture.md index a666e8e..cac2b31 100644 --- a/docs/nextra-architecture.md +++ b/docs/nextra-architecture.md @@ -169,6 +169,50 @@ User writes code in Monaco (TypeScript mode) - Eliminates $7+/month infrastructure cost - Zero cold-start latency (runs in browser) +#### AI-Assisted WASM Coding (Pro) + +The Monaco editor includes AI assistance for writing AssemblyScript — like Claude Code, +but for WASM tools. + +``` +┌─────────────────────────────────────────────────────────────────┐ +│ Monaco Editor (Pro WASM Tab) │ +├─────────────────────────────────────────────────────────────────┤ +│ │ +│ // User types or asks: │ +│ // "Help me write a function that parses CSV" │ +│ │ +│ export function parseCSV(input: string): string[][] { │ +│ █ │ +│ ← AI suggests completion here │ +│ } │ +│ │ +├─────────────────────────────────────────────────────────────────┤ +│ [💬 Ask AI] [▶ Build] [Save] │ +└─────────────────────────────────────────────────────────────────┘ +``` + +**Two modes:** + +| Mode | UX | Like | +|------|-----|------| +| Inline completion | Tab to accept suggestions | GitHub Copilot | +| Chat panel | "Write a JSON validator" → generates code | Claude Code | + +**Implementation:** +- Frontend calls Claude/GPT API directly (no backend round-trip needed) +- Context includes: AssemblyScript types, WIT interface, user's code +- Suggestions inserted into Monaco editor + +**Why AI-assisted (not autonomous):** +- Human reviews code before building +- User learns AssemblyScript over time +- Debugging is tractable +- No surprise compute costs +- WASM sandbox is safe, but user oversight builds trust + +Ships with Phase 3 (Monaco integration) — just an API call from the browser. + #### Key Pages | Route | Purpose |