kilocode icon indicating copy to clipboard operation
kilocode copied to clipboard

[FEATURE]: agent-authored interactive canvases (enhanced plan views)

Open ehudc opened this issue 4 months ago • 1 comments

Feature hasn't been suggested before.

  • [x] I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Summary

Many AI coding tools now have a feature for interactive, agent-authored interactive planning canvases beside the chat. This is separate from static markdown plan files. ChatGPT and Cursor both call it Canvas; Claude calls its version Artifacts. Kilo has no equivalent.

The agent builds a small interactive view — stat tiles, tables, callouts, checklists, buttons — that updates as it works, remembers what the user toggled, and can fire a host action like opening a file.

Can store canvases under Global.Path.data (~/.local/share/kilo/canvases/), where plans already live.

Design thought: declarative, not executable

The model calls a canvas tool that emits a JSON schema over a fixed component allowlist (Stack/Grid, Card, Table, Callout, Stat, Pill, Checkbox, CollapsibleSection, Button) plus an actions vocabulary (e.g. openFile).

The webview renders that schema with existing components, and state and actions round-trip over the postMessage channel the chat already uses. It's just data, the agent never ships code the editor runs, so there's nothing to sandbox.

canvas.upsert({
  id: "migration-plan",
  title: "Cursor → Kilo transition",
  body: [
    { type: "stat", value: "18", label: "MCP servers" },
    { type: "table", headers: ["Area","Status"], rows: [...] },
    { type: "checkbox", id: "mcp", label: "Port MCP servers" },
    { type: "button", label: "Open kilo.jsonc",
      action: { type: "openFile", path: "~/.config/kilo/kilo.jsonc" } }
  ]
})

Why this is a bounded, additive lift

Every primitive already exists in the codebase as of bdb9070a9e on 7/23:

  • Tool pattern — packages/opencode/src/tool/todo.ts already defines a tool that returns a structured view in its metadata.
  • Renderer registry — ToolRegistry (@kilocode/kilo-ui/message-part), the same seam the todos / background-process renderers register through.
  • Component kit — packages/ui/src/components/ already ships card, checkbox, collapsible, button, tag; table/callout/stat are simple compositions.
  • Interactive state + read-back — the todos renderer already persists and reverts per-turn state (context/todo-revert.ts).
  • Bridge, theming, openFile — already power the chat UI.
  • Dev harness — tool-call-lab.stories.tsx builds a tool renderer in isolation.

So the new work is a canvas tool + one ToolRegistry renderer that composes existing components, plus wiring openFile and checkbox state through the existing bridge. No changes to existing behavior.

Theoretical Phased scope

Phase Feature
MVP canvas tool + renderer + host bridge (render beside chat)
2 canvas list, reusing the /sessions list pattern
3 static export → self-contained HTML/PNG

ehudc avatar Jul 23 '26 23:07 ehudc

To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please reopen it or create a fresh new one.

github-actions[bot] avatar Sep 22 '26 06:09 github-actions[bot]