How moffycream/kiro-chat works
Kiro Chat is a VS Code sidebar extension for chatting with the Kiro CLI agent. The principal workflow sends a user message and selected or attached workspace context from the webview through the provider and session to Kiro over ACP, then displays the reply and usage data. Other documented capabilities include session history and rewind, model and account usage controls, project memory and instructions, setup, and reviewed file edits. Some subsystem paths and wiring are inferred only from the tree and README, so uncertain links are omitted.
Main entry points: chatViewProvider.ts Chat provider · kiroSession.ts Session manager · chat.js Chat webview · acpClient.ts ACP client
Components 21
Chat interface
- Chat webview
media/chat.js
Extension orchestration
- Chat provider
src/chatViewProvider.ts - Extension activation
src/extension.ts - CLI setup detection
src/setupWatcher.ts
Kiro sessions
- Session manager
src/kiroSession.ts - ACP client
src/acpClient.ts - Session history
src/history.ts - Usage and models
src/usage.ts - Saved context reading
src/savedContext.ts - Session lock checks
src/sessionLocks.ts - Kiro session files
Context and edits
- Workspace context
src/context.ts - Active file context
src/activeFile.ts - Prompt blocks
src/promptBlocks.ts - Chat and edit modes
src/chatModes.ts - User instructions
src/instructions.ts - Project memory
src/memory.ts - Change review
src/changeReviewer.ts - Review diff
src/lineDiff.ts
Other components
- VS Code user
- Kiro CLI
Connections 25
- VS Code user → Chat webview: uses
- Chat webview → Chat provider: sends actions
- Chat provider → Chat webview: posts updates
- Extension activation → Chat provider: registers view
- Chat provider → Session manager: sends turns
- Chat provider → Workspace context: collects context
- Chat provider → Active file context: adds active file
- Chat provider → Prompt blocks: builds message blocks
- Chat provider → Chat and edit modes: reads mode options
- Chat provider → User instructions: reads instructions
- Chat provider → Project memory: manages memory
- Chat provider → Session history: manages history
- Session manager → ACP client: sends RPC
- ACP client → Kiro CLI: spawns and communicates
- Kiro CLI → ACP client: returns RPC events
- Session manager → Change review: tracks turn edits
- Change review → Review diff: builds and applies diffs
- Chat provider → Usage and models: parses usage reports
- Session manager → Usage and models: parses model details
- Session manager → Saved context reading: reads saved context
- Saved context reading → Kiro session files: reads session metadata
- Session manager → Session lock checks: checks stale locks
- Session lock checks → Kiro session files: reads lock files
- Chat provider → CLI setup detection: checks CLI readiness
- CLI setup detection → Kiro CLI: probes CLI