feat(a2ui,tools): add whiteboard, render_ui, charts, reactivity, and surface management - #107
feat(a2ui,tools): add whiteboard, render_ui, charts, reactivity, and surface management#107bizzkoot wants to merge 9 commits into
Conversation
|
@iwangbowen & @jraylan , its my first take for this features. It's not perfect, but at least, it does work (agent -> user -> agent). Feel free to test & comments on this. Thanks! |
|
Thanks for the work here, but I think this implementation may have missed the original intent. What I had in mind were two specific scenarios:
The current implementation essentially defines a new text-based protocol for visual communication — serializing canvas state into structured JSON for the LLM to interpret. I'd argue that use case is already better served by Mermaid diagrams, which are purpose-built for text-based diagram generation. More importantly, modern LLMs already have native image understanding. We don't need an intermediate text layer to describe visual content — we should just pass the image directly. That's the cleaner, more natural integration. |
|
Hey, have you guys seem the A2UI? I think it's the right tool for this feature. |
|
Update : will do another pass for this A2UI implementation in tool call Its updated now with A2UI 'implementation' as 1 tool call, The brainstorming for this A2UI tool is done with Opus, and implementation with GPT-5.4. For Hope this answer the remarks. |
|
I primarily use AI to compose the frontend. For me, getting the AI to create the UI the way I imagined it is the hardest part, so yes, I see potential in this, specially for planing. |
|
I have enhanced both #openWhiteboard & #renderUI . Looking forward to hearing your feedback @jraylan & @iwangbowen . By the way, I'm not an expert for the UI, so any suggestions is highly appreciated. Thanks! |
|
I think it looks great👍 |
e06b7c3 to
e5daaf4
Compare
…view integration This commit adds comprehensive whiteboard functionality: Core Features: - Implement openWhiteboard tool with seeded canvas support - Add Fabric.js integration for canvas rendering - Implement scene summary generation for text-based model compatibility Components Added: - WhiteboardPanel webview with HTML/CSS/TS integration - Canvas state management (canvasState.ts) - Fabric registry for shape management (fabricRegistry.ts) - Seeded canvas support with coordinate-first contract (seededCanvas.ts) - Circle path implementation for shape rendering (circlePath.ts) Testing: - Comprehensive test coverage for all new components - Unit tests for canvas, scene summary, and webview functionality - Integration tests for whiteboard tool workflow Infrastructure: - Update MCP server integration for tool support - Enhance storage with chat history improvements - Update package dependencies and localization files - Modify webview provider for whiteboard support Files changed: 41 files, 12026 insertions(+), 97 deletions(-)
…t contract - Add A2UI surface rendering system with layout, content, and form components - Add render_ui tool for flat component list with parentId adjacency - Refactor open_whiteboard to image-first contract, removing seedElements - Add importImages for preloading images onto canvas for annotation - Simplify whiteboard result to return only exported PNG images - Remove coordinate-based seeding and sceneSummary serialization - Add inline whiteboard button to ask_user attachments - Update MCP server and tool registrations for new tools
…ols, and full render_ui audit - Add BarChart, LineChart, PieChart components with full rendering pipeline - Add reactive data binding system (reactivity.ts) with JSON Pointer resolution - Introduce append_ui, update_ui, close_ui, list_surfaces tools for surface lifecycle management - Overhaul renderer: Table uses key/label column objects, Badge supports variant classes (info/success/warning/danger), HTML gains css/sandbox props, TextField/Select gain helperText, ProgressBar gains showValue flag - Extend MCP server with new tool registrations and schema improvements - Add webview badge logic, interaction list refinements, and whiteboard enhancements - Fix .vscodeignore to exclude dev artifacts from packaged VSIX - Add comprehensive test coverage across all new modules (429 tests, 0 failures)
Fixes "Cannot find module 'zod/v3'" in standalone dist/seamless-agent-mcp.js
by restricting the esbuild CLI bundle externals to ['vscode'] only, ensuring
zod and all subpaths are inlined into the binary (no node_modules required).
bin/seamless-agent-mcp.js:
- Switch require('zod') to require('zod/v3') for MCP SDK 1.25.2 compat
(routes schema conversion via zod-to-json-schema, not z4mini.toJSONSchema)
- Add ECONNREFUSED recovery: reads ~/.antigravity/seamless-agent-state.json
to refresh port/token when the VS Code extension restarts
- Register 6 new MCP tools: open_whiteboard, render_ui, update_ui,
append_ui, close_ui, list_surfaces
src/mcp/apiService.ts:
- Add HTTP endpoints: /open_whiteboard, /render_ui, /update_ui,
/append_ui, /close_ui, /list_surfaces
- Call writeStateFile() on startup for CLI state recovery
src/extension.antigravity.ts:
- Register seamless-agent.showLogs command
package.json:
- Add list_surfaces to languageModelTools contributions
- Add @cfworker/json-schema dependency
src/mcp/zodV3Compat.test.ts (new):
- 7 regression tests covering zod/v3 subpath resolution,
MCP SDK isZ4Schema detection boundary, and schema validation
.vscodeignore:
- Remove stale debug file pattern exclusions
…d calc() support Security fixes (audit-validation-report-2026-03-14): - [P0] sanitizeHTML: block data:image/svg+xml, data:text/* and vbscript: URLs to prevent XSS via crafted data URIs; allow safe image/* MIME types only - [P1] parseDeclarativeStyle: sanitize CSS values to block expression(), url(javascript|vbscript|data:text) and @import injection vectors Reliability and DoS protection: - [P1] Add CHART_LIMITS (OPTIMAL=2K, WARNING=5K, SOFT_LIMIT=10K, HARD_LIMIT=25K) and guard all chart renderers against unbounded data arrays that freeze the UI - [P2] Wrap ask_user, plan_review, walkthrough_review, open_whiteboard MCP handlers in try-catch-finally for structured error responses and guaranteed token cleanup - [P2] Dispose CancellationTokenSource in finally blocks for all old MCP handlers - [P2] Add globalStorageUri null guard in whiteboardPanel (submit + cancel paths) API contract fixes: - [P2] Add droppedStyles to UpdateUIToolResult schema and collect it in updateUI.ts, consistent with renderUI and appendUI result shapes - [P3] Table renderer now returns an error element when all columns lack a valid key - [P4] Badge variant uses VALID_BADGE_VARIANTS Set whitelist; invalid -> 'default' - [P4] disabled prop uses strict === true (not truthy) across all components - [P4] BarChart negative values: proper minValue/maxValue/range calculation - [P4] Chart color props validated via isValidCssColor(); invalid -> default color - [P5] listSurfaces: rename unused params -> _params per TypeScript convention Features: - LineChart smooth prop: generateSmoothPath() renders cubic bezier <path> when smooth:true; falls back to <polyline> when smooth:false (default) - SAFE_CALC_RE: calc() dimension values now pass validation when they contain only safe characters; blocks semicolons, braces, quotes, angle brackets Test update: - mcpServer.test.ts: update 'rejects invalid imported-image' assertion from assert.rejects to checking structured error response (correct MCP protocol behavior) All 436 tests pass. TypeScript checks clean.
… history replay
- apiService.ts: each instance registers with UUID in shared registry file.
Window focus events update lastActive for accurate routing. dispose()
removes instance entry on shutdown.
- bin/seamless-agent-mcp.js: callExtensionApi re-reads registry before
every call, routes to most-recently focused window. Startup port/token
args are optional. Backward-compatible with old flat {port,token} format.
- media/a2ui.html: added unsafe-eval to script-src CSP so Mermaid v11
JISON parsers can run; without it diagrams silently fell back to raw text.
- renderer.ts: auto-upgrade CodeBlock[language=mermaid] and Markdown
mermaid fenced blocks to proper MermaidDiagram rendering so AI agents
that use markdown patterns still get rendered diagrams. Fix CodeBlock
prop-name mismatch (code vs content).
- schemas.ts: add auto-upgrade hints to Markdown and CodeBlock descriptions.
- renderer.test.ts: add 3 tests covering CodeBlock/Markdown mermaid upgrade.
- main.ts + types.ts: add renderUI branch to history click handlers so
clicking a render_ui history entry dispatches openRenderUIPanel.
- webviewProvider.ts: implement _handleOpenRenderUIPanel() to reload stored
components/dataModel and reopen the A2UIPanel, mirroring whiteboard history.
…structure Major changes: - Refactor storage operations from sync to async (chatHistoryStorage.ts) - Lazy-load vscode module in logging.ts for better testability - Add imageCleanup utility for canvas export sanitization - Fix fs mocking in tests to support real file operations in temp directories - Update openWhiteboard tool to properly await storage updates - Add index to exported canvas filenames to prevent millisecond collisions Testing fixes: - Fix imageCleanup tests for cross-platform compatibility (case-sensitivity) - Fix whiteboardPanel tests with proper fs mock implementations - All 451 tests passing Code quality improvements: - Remove debug console.log statements from exportSubmittedWhiteboardCanvases - Fix type safety: change canvas type from 'any' to NormalizedWhiteboardCanvasSubmission - Improve error context in whiteboardPanel error handling
e5daaf4 to
ffab38f
Compare
There was a problem hiding this comment.
Yeah, sorry for this. Is there any other point to be fix? So I could combine it into 1 commit. Thanks!
|
Since a lot of file was created/modified, I'll take a few days to fully review this within my routine tasks. But it looks great. |
Closes #93
This PR is still work in progress, any comment & suggestion is highly appreciated. Until this is stabilised, I will keep this PR open & in
draft. Feel free to pull this PR then build it locally to test the featuresSummary
This branch delivers a complete visual interaction layer for Seamless Agent, built across eight commits:
feat(tools): implement whiteboard tool— freeform canvas for sketching, annotation, and visual review.feat(tools): add render_ui and refactor whiteboard to image-first contract— structured A2UI panels for forms, dashboards, and guided interactions.feat(a2ui,tools): introduce charts, reactivity, surface management tools, and full render_ui audit— chart components, reactive data binding, surface lifecycle tools, and a complete render_ui capability audit.feat(antigravity): add UI tools to MCP CLI and fix zod/v3 bundling(cde6d0e) — registers all new tools (render_ui, update_ui, append_ui, close_ui, list_surfaces) in the Antigravity MCP CLI; fixesMODULE_NOT_FOUND: zod/v3error by bundling zod fully into the standalone CLI instead of marking it as an external dependency.fix(a2ui,mcp,tools): resolve 14 audit findings + add smooth curves and calc() support(9f7b74b) — addresses all 15 real issues fromdocs/audit-validation-report-2026-03-14.mdincluding XSS/data-URL security hardening, DoS protection via chart data limits, MCP handler reliability, and API contract fixes; also implements thesmoothbezier curve prop for LineChart andcalc()support in CSS dimension validation.fix(mcp,a2ui,webview): multi-instance routing, Mermaid rendering, and history replay(e5daaf4) — fixes three runtime bugs discovered after deployment:render_uialways targeted the first opened IDE window instead of the focused one; Mermaid diagrams rendered as raw text due to a missing CSPunsafe-evaldirective and agent confusion over component type; clicking a render_ui history entry had no reopen handler and showed a static text detail instead of re-rendering the panel.fix(mcp): resolve rebase conflicts(5ee5440) — minor cleanup to resolve merge conflicts during rebase.fix(storage,tools,webview): complete async refactoring and test infrastructure(ffab38f) — completes async migration of storage layer, lazy-loads vscode module for better testability, adds imageCleanup utility for canvas export path sanitization, fixes fs mocking to support real file operations in temp directories, updates openWhiteboard tool to properly await storage updates, adds filename indexing to prevent export collisions, removes debug logs, fixes type safety, and improves error context. All 451 tests passing.Together these give the agent two distinct visual modes plus a rich component catalog:
The branch also tightens the whiteboard contract around image-first outputs, restores seeded starter-canvas support for agent-authored boards, improves debug coverage, and hardens the tool metadata/schema so the tools register and validate correctly.
Why
This work addresses three related product needs:
Agents need a freeform visual collaboration surface.
Whiteboard covers sketching, markup, screenshots, and iterative visual feedback.
Agents also need a structured visual surface.
Not every interaction should be a drawing canvas. Some flows need forms, content blocks, buttons, Mermaid diagrams, and validation. That is what
render_uiprovides.Structured surfaces need richer data expression.
Static panels are not enough. Charts communicate quantitative data. Reactive bindings let agents update panels without full re-renders. Surface management tools (
append_ui,update_ui,close_ui) let agents build progressive UIs. A full capability audit ensures the LLM schema matches what the renderer actually supports.The result is a cleaner split of responsibilities:
open_whiteboardhandles visual sketching and annotation.render_uihandles structured A2UI interactions.Branch Benefit
open_whiteboardpanel, canvas persistence, review flowinitialCanvases,seedElements,fabricState,importImagesrender_uitool and A2UI renderer/panelreactivity.tswith JSON Pointer resolutionappend_ui,update_ui,close_ui,list_surfacestoolsask_userreply box with image attachmentdroppedStyles, enhancement reportsMODULE_NOT_FOUND: zod/v3)droppedStylesinupdate_uiresultUpdateUIToolResultnow surfaces which CSS properties were droppedsmooth: truerenders cubic bezier path instead of polylinecalc()CSS dimension supportcalc(100% - 20px)and similar values pass dimension validationlastActive; every tool call routes to the most-recently focused IDE windowrender_uinow targets the active window when multiple IDE instances are openunsafe-evalfor Mermaid v11 JISON parsers;CodeBlock[language=mermaid]and Markdown fenced blocks auto-upgrade toMermaidDiagramrenderingCodeBlockprop-name fixprops.code ?? props.contentmatching the documented schemaTool Choice
open_whiteboardopen_whiteboardwithimportImagesask_userrender_uirender_uiwith BarChart/LineChart/PieChartrender_uiappend_ui/update_uiclose_uiTool Call Flows
Visual collaboration flow
sequenceDiagram participant A as Agent participant T as open_whiteboard participant U as User A->>T: Open board Note over A,T: blankCanvas or initialCanvases or importImages T->>U: Show whiteboard U->>T: Draw / annotate / review T->>A: Return exported whiteboard images Note over T,A: approved | recreateWithChanges | cancelledStructured interaction flow
sequenceDiagram participant A as Agent participant T as render_ui participant U as User A->>T: Render A2UI surface Note over A,T: components + optional dataModel + A2UI processing T->>U: Show structured panel U->>T: View or submit action T->>A: Return rendered state and optional userActionProgressive surface flow (new)
sequenceDiagram participant A as Agent participant S as render_ui / append_ui / update_ui A->>S: render_ui — initial components S->>A: surfaceId A->>S: append_ui — add more components A->>S: update_ui — push new dataModel values A->>S: close_ui — dismiss when doneInline whiteboard flow (ask_user integration)
sequenceDiagram participant A as Agent participant U as User participant W as Inline Whiteboard A->>U: ask_user with question U->>U: Click whiteboard button W->>U: Show inline whiteboard panel U->>W: Sketch / annotate W->>U: Submit whiteboard W->>U: Attach exported image(s) to response U->>A: Send response with attached whiteboard image(s)Capability map
What Was Added
1.
open_whiteboardThis branch delivers a standalone whiteboard tool with:
approved,recreateWithChanges, andcancelled,Important behavior:
blankCanvas: trueis the explicit blank-board path.initialCanvasessupports agent-provided starter canvases.seedElementsprovides coordinate-first starter content for simple agent-authored boards.fabricStatesupports advanced reopen/reseed flows.importImagessupports screenshot/image annotation workflows.2.
render_uiThis branch also adds a new A2UI-based render path with:
enableA2UIanda2uiLevel,This makes
render_uithe better fit for structured interactions that should not be modeled as freeform drawing.3. Chart components (new)
Three new chart components rendering via Chart.js inside the A2UI webview:
BarChartdata: {label,value}[],title?,color?,horizontal?,showValues?,style?LineChartdata: {label,value}[],title?,color?,showPoints?,smooth?,style?PieChartdata: {label,value,color?}[],title?,doughnut?,showLegend?,style?Default height 300px, overridable with
style: { height: "200px" }.4. Reactive data binding (new)
reactivity.tsintroduces JSON Pointer-based data binding for A2UI:dataModelwith{ "path": "/key/subkey" }syntax.update_uipushes newdataModelvalues to a live surface, triggering a re-render.5. Surface lifecycle tools (new)
append_uisurfaceIdupdate_uidataModelto a live surface (triggers reactive re-render)close_uisurfaceIdlist_surfaces6. render_ui capability audit (new)
A complete audit of the LLM-facing schema vs. the renderer was performed. The following gaps were closed:
Tablecolumnschanged fromstring[]toArray<{key,label}>,rowschanged todata: Array<Record<string,string|number>>. Key maps to property name in each row.Badgea2ui-badge-{variant}class; CSS rules added forinfo,success,warning,dangervariants.TextFieldhelperText?: stringdocumented — shows a small hint below the input.Selectplaceholder?: stringandhelperText?: stringdocumented.ProgressBarshowValue?: booleandocumented — controls the XX% percentage display.HTMLcss?: string(scoped CSS alongside HTML) andsandbox?: boolean(iframe isolation) documented.7. Integration and operability improvements
Beyond the tools themselves, the branch includes:
resources/debug/whiteboard/,.vscodeignoreto exclude dev artifacts from the packaged VSIX,8. Inline whiteboard integration
The branch also adds whiteboard access directly within the
ask_userworkflow:UX behavior note: When the whiteboard opens, the sidebar initially shows the pending requests list (VS Code default focus behavior). However, once the whiteboard is submitted, the ask_user question is automatically restored with the attached whiteboard images, maintaining conversation context without requiring manual navigation.
Key Files
Core tool files:
src/tools/openWhiteboard.tssrc/tools/renderUI.tssrc/tools/appendUI.tssrc/tools/updateUI.tssrc/tools/closeUI.tssrc/tools/listSurfaces.tssrc/tools/schemas.tssrc/tools/index.tsWhiteboard implementation:
src/webview/whiteboardPanel.tssrc/webview/whiteboard.tssrc/whiteboard/seededCanvas.tssrc/storage/chatHistoryStorage.tsA2UI implementation:
src/a2ui/catalog.tssrc/a2ui/engine.tssrc/a2ui/panel.tssrc/a2ui/reactivity.tssrc/a2ui/renderer.tssrc/a2ui/webview.tsmedia/a2ui.htmlmedia/a2ui.cssInline whiteboard integration:
media/webview.html- ask_user reply box with whiteboard buttonmedia/main.css- stacked button layout stylingmedia/whiteboard.css- aspect-ratio-preserving canvas sizingsrc/webview/webviewProvider.ts- inline whiteboard message handling and render_ui history replaysrc/webview/uiIntegration.test.ts- inline whiteboard integration testsMulti-instance routing and history replay:
src/mcp/apiService.ts- UUID-keyed instance registry, focus tracking, dynamic port/tokenbin/seamless-agent-mcp.js- dynamic registry reads, optional startup argssrc/webview/main.ts- renderUI branch in history click handlerssrc/webview/types.ts- openRenderUIPanel message type9. Antigravity / OVSx MCP CLI fix (
cde6d0e)Registers all new surface tools in the MCP CLI server and resolves the
MODULE_NOT_FOUND: zod/v3startup crash introduced by@modelcontextprotocol/sdkv1.25.2.Root cause: The old esbuild config marked
zod,zod/v3,zod/v4,zod/v4-minias external for the CLI bundle. The CLI is a standalone self-contained binary deployed inside the extension directory — there is nonode_modulesalongside it at runtime, so Node.js cannot resolve these external paths. The SDK internally callsrequire('zod/v3')through itszod-compat.jsmodule, triggering the crash.Fix: Changed the CLI bundle's
externallist to['vscode']only. Zod is now fully bundled intodist/seamless-agent-mcp.js(1.3 MB self-contained). Verified:grep -c "require(\"zod/v3\")"on the built bundle returns 0.10. Security hardening and audit fixes (
9f7b74b)Addresses all 15 confirmed real issues (parallel tri-agent audit). 451 tests pass.
data:URL bypass insanitizeHTMLdata:image/svg+xml,data:text/*,vbscript:in all URL attributes; allow safe image MIME typesparseDeclarativeStylesanitizeCssValue()blocksexpression(),url(javascript|vbscript|data:text),@importCHART_LIMITSconstant; hard limit 25K points returns error element; soft limit 10K adds warningask_user,plan_review,walkthrough_review,open_whiteboardwrapped in try-catch-finallyfinallyblocks in all 4 old handlersdroppedStylesmissing fromupdate_uiresultUpdateUIToolResultschema; collected and returned inupdateUI.tsglobalStorageUriunguarded inwhiteboardPanel<div class="a2ui-error">when all columns lack a validkeystringVALID_BADGE_VARIANTSSet whitelist; invalid →defaultdisabledprop truthy coercion bug=== truecheck in all componentsminValue/maxValue/rangespread calculationisValidCssColor()validates hex, rgb, hsl, named colorslistSurfacesunusedparams_paramsper TypeScript conventionAlso implements two previously deferred features:
smoothprop — LineChart renders cubic bezier<path>viagenerateSmoothPath()whensmooth: truecalc()support —SAFE_CALC_REvalidatescalc()expressions blocking dangerous characters11. Runtime bug fixes — multi-instance routing, Mermaid, and history replay (
e5daaf4)Three bugs discovered after the initial deployment of the Antigravity extension are resolved in this commit.
Bug 1:
render_uialways targeted the first opened IDE windowRoot cause:
apiService.tswrote a single{port, token}entry to~/.antigravity/seamless-agent-state.json, overwriting the previous instance. The CLI process held the initial window's port/token in memory and only re-read the file onECONNREFUSED. With two windows open, the first window was always the target because it never closed.Fix:
{ [instanceId]: { port, token, lastActive, startedAt } }.vscode.window.onDidChangeWindowStateupdateslastActivewhenever the window gains focus.dispose()removes the instance entry on shutdown.registerWithAntigravity()no longer bakes--port/--tokenintomcp_config.jsonargs; the CLI reads them dynamically from the registry.callExtensionApi()call and routes to the entry with the highestlastActive. Backward-compatible with the old flat{port, token}state file format.Bug 2: Mermaid diagrams rendered as raw text
Root cause (layer 1 — CSP):
media/a2ui.htmlhadscript-src 'nonce-{{nonce}}'without'unsafe-eval'. Mermaid v11 uses JISON-based parsers that callnew Function()internally. The CSP violation silently causedmermaid.render()to throw, the catch block opened the<details>fallback, and the raw diagram source became visible as plain text.Root cause (layer 2 — component choice): The AI agent (Gemini) uses Mermaid as a "code fence" pattern from training, so it calls
render_uiwith{type:"CodeBlock", language:"mermaid", code:"graph TD..."}instead of{type:"MermaidDiagram", definition:"..."}. The renderer also had a prop-name mismatch: the schema sayscodebut the renderer was readingprops.content, so CodeBlock content silently dropped.Fix:
media/a2ui.html:'unsafe-eval'added toscript-srcCSP.renderer.ts,CodeBlockcase: readsprops.code ?? props.content(fixes prop-name mismatch); auto-upgrades toa2ui-mermaidstructure whenlanguage === 'mermaid'.renderer.ts,Markdowncase: post-processes rendered HTML to convert<pre><code class="language-mermaid">…</code></pre>to the propera2ui-mermaidstructure, so```mermaidfenced blocks inside Markdown also render as diagrams.schemas.ts:MarkdownandCodeBlockdescriptions note the auto-upgrade behavior and direct agents towardMermaidDiagramfor standalone diagrams.CodeBlockwithcodeprop,CodeBlock[language=mermaid]auto-upgrade, Markdown fenced block auto-upgrade.Bug 3: Clicking a render_ui history entry showed static text instead of reopening the panel
Root cause: The history-item click handlers in
src/webview/main.tshad explicit branches forplan_review(→openPlanReviewPanel) andwhiteboard(→openWhiteboardPanel) but no branch forrenderUI, so it fell through toselectInteraction._handleSelectInteraction()only sends ashowInteractionDetailmessage back with a static text summary — it never reopens the A2UIPanel.Fix:
src/webview/main.ts: addedelse if (type === 'renderUI')branch in both the View-button handler and the normal item-click handler, dispatchingopenRenderUIPanel.src/webview/types.ts: addedopenRenderUIPanelto theFromWebviewMessageunion.src/webview/webviewProvider.ts: addedcase 'openRenderUIPanel'and implemented_handleOpenRenderUIPanel()— loads the storedrenderUISession(components + dataModel) fromchatHistoryStorageand callsA2UIPanel.showSurface(), mirroring the existing_handleOpenWhiteboardPanel()pattern.12. Rebase conflict resolution (
5ee5440)Minor cleanup to resolve merge conflicts during rebase with upstream/main.
Changes:
src/mcp/mcpServer.ts: Resolved merge conflicts in MCP server implementation.13. Async refactoring and test infrastructure (
ffab38f)Completes the async migration of the storage layer and improves test infrastructure across storage, tools, and webview components.
Key changes:
Storage layer (async migration):
src/storage/chatHistoryStorage.ts: Converted all sync storage operations to asyncsrc/storage/chatHistoryStorage.test.ts: Updated tests for async operationsTest infrastructure improvements:
src/logging.ts: Lazy-load vscode module for better testability (tests can now run without vscode available)src/webview/whiteboardPanel.test.ts: Fixed fs mock to use real fs for operations in tempRoot, enabling proper export testingNew utilities:
src/whiteboard/imageCleanup.ts: New utility for canvas export path sanitizationsrc/whiteboard/imageCleanup.test.ts: Comprehensive tests for image cleanup including cross-platform compatibility (case-sensitivity)src/whiteboard/constants.ts: Added constants for image cleanupTool fixes:
src/tools/openWhiteboard.ts: Updated to properly await storage update promises (fixes dismissal hang issue)src/tools/planReview.ts: Updated for async storage operationsCode quality improvements:
src/webview/whiteboardPanel.ts: Removed debug console.log statements, added index to exported canvas filenames to prevent millisecond collisions, improved type safety (changed canvas type from 'any' to NormalizedWhiteboardCanvasSubmission), improved error contextTest coverage:
Verification
Validated with 451 tests, 0 failures across:
render_ui/ A2UI tool, panel, renderer, and webview tests,append_ui,update_ui,close_ui,list_surfacestool tests,open_whiteboard.seedElements.itemsschema,require('zod/v3')),Reviewer Guidance
If you want the fastest review path, read these files first:
src/tools/schemas.ts— all tool and component contractssrc/tools/openWhiteboard.tssrc/tools/renderUI.tssrc/tools/appendUI.ts,updateUI.ts,closeUI.ts,listSurfaces.tssrc/a2ui/reactivity.tssrc/a2ui/engine.tssrc/a2ui/panel.tssrc/a2ui/renderer.tssrc/webview/webviewProvider.ts📸 Visual Changes & Implementations
ask_userReply PanelIncludes the new
#openWhiteboardbutton.Attached image flowing from
#openWhiteboardback to theask_userreply panel.First implementation of A2UI in
seamless-agentutilizing the#renderUItool call.