Skip to content

feat(chat): render KB pages & hosted apps inline in the chat window (v0.221.0)#369

Merged
vikasprogrammer merged 1 commit into
mainfrom
feat/chat-inline-apps-kb
Jul 16, 2026
Merged

feat(chat): render KB pages & hosted apps inline in the chat window (v0.221.0)#369
vikasprogrammer merged 1 commit into
mainfrom
feat/chat-inline-apps-kb

Conversation

@vikasprogrammer

Copy link
Copy Markdown
Owner

What

Follow-up to #365. Extends the inline-deliverable cards in the plain-language Chat window beyond Library artifacts to the other two things agents produce mid-conversation:

  • kb_write → a titled KB tile deep-linking to #/kb/<section>/<slug>
  • app_create / app_update → a hosted-app tile deep-linking to #/apps/<id>, plus an Open link to the live app when it's published (a proposed app only links for review — it isn't routable yet)

So a non-technical teammate sees "here's the page I wrote / the app I built" right in the thread, one click from opening it.

How

  • src/edge/conversation.ts — unlike artifact ids (minted server-side, parsed from the tool result), the KB section/slug and app id live in the tool input, so they're captured directly at tool_use time via refsFromInput() and attached to the activity card. A failed tool_result (is_error) clears them, so a broken write never renders a card. New ChatKbRef/ChatAppRef types + clearer labels ("Updated the knowledge base", "Built an app", "Updated an app").
  • src/server.tsGET /api/sessions/:id/conversation resolves the refs via os.kb.read(tenant, …) / os.apps.get(id) into viewer-safe cards. KB pages and hosted apps are tenant-wide surfaces every member can already browse, so no per-viewer gate beyond the existing canViewSession; an unknown/deleted ref is dropped.
  • web/src/App.tsxKbCard + AppCard render inline under the activity, alongside the existing ArtifactCard.

Verification

  • npm run typecheck ✓ · cd web && npm run build ✓ · npm run test:governance → 68/68 ✓
  • Unit-drove readConversation on a synthetic transcript: a nested-section kb_write (section preserved), an app_create (id normalized Mini-CRMmini-crm), and a failed kb_write (refs correctly dropped).

Deploy note: touches src/server.ts (the /conversation route), so making it live needs a build + server restart plus a fresh web build.

🤖 Generated with Claude Code

…v0.221.0)

Extends the inline-deliverable cards (v0.220.0) beyond Library artifacts.
When an agent writes a Knowledge Base page (kb_write) or builds/changes a
hosted app (app_create/app_update) mid-conversation, the Chat window shows
a titled tile: the KB tile deep-links to #/kb/<section>/<slug>, the app tile
to #/apps/<id> plus an Open link to the live app when published.

- src/edge/conversation.ts: capture KB section/slug and app id from the tool
  INPUT (not the result), attached optimistically at tool_use and dropped on
  an error tool_result; ChatKbRef/ChatAppRef types; clearer labels.
- src/server.ts: /api/sessions/:id/conversation resolves those refs via
  os.kb.read / os.apps.get into viewer-safe cards.
- web: KbCard + AppCard rendered inline under the activity.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@vikasprogrammer
vikasprogrammer force-pushed the feat/chat-inline-apps-kb branch from b334211 to 3272dfb Compare July 16, 2026 09:09
@vikasprogrammer
vikasprogrammer merged commit 6393bc7 into main Jul 16, 2026
1 check passed
@vikasprogrammer
vikasprogrammer deleted the feat/chat-inline-apps-kb branch July 16, 2026 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant