feat(chat): render KB pages & hosted apps inline in the chat window (v0.221.0)#369
Merged
Merged
Conversation
…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
force-pushed
the
feat/chat-inline-apps-kb
branch
from
July 16, 2026 09:09
b334211 to
3272dfb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 KBsection/slugand appidlive in the tool input, so they're captured directly attool_usetime viarefsFromInput()and attached to the activity card. A failedtool_result(is_error) clears them, so a broken write never renders a card. NewChatKbRef/ChatAppReftypes + clearer labels ("Updated the knowledge base", "Built an app", "Updated an app").src/server.ts—GET /api/sessions/:id/conversationresolves the refs viaos.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 existingcanViewSession; an unknown/deleted ref is dropped.web/src/App.tsx—KbCard+AppCardrender inline under the activity, alongside the existingArtifactCard.Verification
npm run typecheck✓ ·cd web && npm run build✓ ·npm run test:governance→ 68/68 ✓readConversationon a synthetic transcript: a nested-sectionkb_write(section preserved), anapp_create(id normalizedMini-CRM→mini-crm), and a failedkb_write(refs correctly dropped).Deploy note: touches
src/server.ts(the/conversationroute), so making it live needs a build + server restart plus a fresh web build.🤖 Generated with Claude Code