@ai-agent-forge/agent-forge 0.88.5 → 0.88.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/bundled-plugins/agent-loop-policy/agent-forge.json +1 -1
- package/bundled-plugins/agent-loop-policy/plugin.json +1 -1
- package/bundled-plugins/alignment/agent-forge.json +19 -0
- package/bundled-plugins/alignment/dist/baseline.d.ts +12 -0
- package/bundled-plugins/alignment/dist/baseline.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/baseline.js +68 -0
- package/bundled-plugins/alignment/dist/baseline.js.map +1 -0
- package/bundled-plugins/alignment/dist/engine.d.ts +102 -0
- package/bundled-plugins/alignment/dist/engine.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/engine.js +654 -0
- package/bundled-plugins/alignment/dist/engine.js.map +1 -0
- package/bundled-plugins/alignment/dist/entry.d.ts +14 -0
- package/bundled-plugins/alignment/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/entry.js +23 -0
- package/bundled-plugins/alignment/dist/entry.js.map +1 -0
- package/bundled-plugins/alignment/dist/export.d.ts +15 -0
- package/bundled-plugins/alignment/dist/export.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/export.js +122 -0
- package/bundled-plugins/alignment/dist/export.js.map +1 -0
- package/bundled-plugins/alignment/dist/http-server.d.ts +33 -0
- package/bundled-plugins/alignment/dist/http-server.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/http-server.js +119 -0
- package/bundled-plugins/alignment/dist/http-server.js.map +1 -0
- package/bundled-plugins/alignment/dist/index.d.ts +24 -0
- package/bundled-plugins/alignment/dist/index.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/index.js +719 -0
- package/bundled-plugins/alignment/dist/index.js.map +1 -0
- package/bundled-plugins/alignment/dist/page.d.ts +15 -0
- package/bundled-plugins/alignment/dist/page.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/page.js +857 -0
- package/bundled-plugins/alignment/dist/page.js.map +1 -0
- package/bundled-plugins/alignment/dist/render.d.ts +40 -0
- package/bundled-plugins/alignment/dist/render.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/render.js +194 -0
- package/bundled-plugins/alignment/dist/render.js.map +1 -0
- package/bundled-plugins/alignment/dist/types.d.ts +217 -0
- package/bundled-plugins/alignment/dist/types.d.ts.map +1 -0
- package/bundled-plugins/alignment/dist/types.js +30 -0
- package/bundled-plugins/alignment/dist/types.js.map +1 -0
- package/bundled-plugins/alignment/plugin.json +12 -0
- package/bundled-plugins/browser-playwright/MANUAL.md +60 -0
- package/bundled-plugins/browser-playwright/agent-forge.json +25 -0
- package/bundled-plugins/browser-playwright/dist/capability.d.ts +25 -0
- package/bundled-plugins/browser-playwright/dist/capability.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/capability.js +612 -0
- package/bundled-plugins/browser-playwright/dist/capability.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/entry.d.ts +13 -0
- package/bundled-plugins/browser-playwright/dist/entry.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/entry.js +14 -0
- package/bundled-plugins/browser-playwright/dist/entry.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/index.d.ts +7 -0
- package/bundled-plugins/browser-playwright/dist/index.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/index.js +5 -0
- package/bundled-plugins/browser-playwright/dist/index.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/operations.d.ts +69 -0
- package/bundled-plugins/browser-playwright/dist/operations.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/operations.js +149 -0
- package/bundled-plugins/browser-playwright/dist/operations.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/playwright-driver.d.ts +275 -0
- package/bundled-plugins/browser-playwright/dist/playwright-driver.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/playwright-driver.js +953 -0
- package/bundled-plugins/browser-playwright/dist/playwright-driver.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/setup.d.ts +88 -0
- package/bundled-plugins/browser-playwright/dist/setup.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/setup.js +252 -0
- package/bundled-plugins/browser-playwright/dist/setup.js.map +1 -0
- package/bundled-plugins/browser-playwright/dist/types.d.ts +270 -0
- package/bundled-plugins/browser-playwright/dist/types.d.ts.map +1 -0
- package/bundled-plugins/browser-playwright/dist/types.js +2 -0
- package/bundled-plugins/browser-playwright/dist/types.js.map +1 -0
- package/bundled-plugins/browser-playwright/plugin.json +20 -0
- package/bundled-plugins/coding-tools/agent-forge.json +1 -1
- package/bundled-plugins/coding-tools/dist/bash.d.ts +2 -7
- package/bundled-plugins/coding-tools/dist/bash.d.ts.map +1 -1
- package/bundled-plugins/coding-tools/dist/bash.js +2 -34
- package/bundled-plugins/coding-tools/dist/bash.js.map +1 -1
- package/bundled-plugins/coding-tools/dist/read.d.ts +2 -0
- package/bundled-plugins/coding-tools/dist/read.d.ts.map +1 -1
- package/bundled-plugins/coding-tools/dist/read.js +11 -0
- package/bundled-plugins/coding-tools/dist/read.js.map +1 -1
- package/bundled-plugins/coding-tools/plugin.json +1 -1
- package/bundled-plugins/compaction-policy/agent-forge.json +1 -1
- package/bundled-plugins/compaction-policy/plugin.json +1 -1
- package/bundled-plugins/mcp-http/dist/mcp-http.d.ts.map +1 -1
- package/bundled-plugins/mcp-http/dist/mcp-http.js +84 -31
- package/bundled-plugins/mcp-http/dist/mcp-http.js.map +1 -1
- package/bundled-plugins/overflow-policy/agent-forge.json +1 -1
- package/bundled-plugins/overflow-policy/plugin.json +1 -1
- package/bundled-plugins/provider-failover/agent-forge.json +1 -1
- package/bundled-plugins/provider-failover/plugin.json +1 -1
- package/bundled-plugins/retry-policy/agent-forge.json +1 -1
- package/bundled-plugins/retry-policy/plugin.json +1 -1
- package/dist/bundle/.build-manifest.json +60 -58
- package/dist/bundle/chunks/{anthropic-messages-3FJHRAJL.js → anthropic-messages-NL4Y6WPB.js} +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-GCL47IDS.js → azure-openai-responses-CPXC42HO.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +1 -1
- package/dist/bundle/chunks/chunk-5LRQFZFE.js +2 -0
- package/dist/bundle/chunks/{chunk-HTEVUY7F.js → chunk-7HSJPQKN.js} +1 -1
- package/dist/bundle/chunks/{chunk-AC2FIS4G.js → chunk-EDO7Q6XR.js} +1 -1
- package/dist/bundle/chunks/{chunk-755VNWIF.js → chunk-ISLHFRER.js} +6 -6
- package/dist/bundle/chunks/{chunk-HV64ASMT.js → chunk-K3S6GTL7.js} +1 -1
- package/dist/bundle/chunks/{chunk-HEL6TAWE.js → chunk-L2SXIPI5.js} +37 -36
- package/dist/bundle/chunks/{chunk-V3ACW7VD.js → chunk-WJSKB3FC.js} +1 -1
- package/dist/bundle/chunks/{chunk-32YDZI4J.js → chunk-ZS5JEI76.js} +1 -1
- package/dist/bundle/chunks/{google-generative-ai-6BMXWA44.js → google-generative-ai-UMZ53EFA.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-6H7NLRTK.js → google-vertex-ZNR5NS6H.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{mistral-conversations-IXUHSFSJ.js → mistral-conversations-IT66WUNN.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-YHUAEVCM.js → openai-codex-responses-FOVCVG6I.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-ULQCFC72.js → openai-completions-FLQ7CBOL.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-NLLAJDPS.js → openai-responses-ABGYHS2T.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-EJTI2EJ3.js → pi-messages-6K5W6LUN.js} +1 -1
- package/dist/bundle/chunks/{virtual-modules-TQWEGNNZ.js → virtual-modules-2QGILFV7.js} +1 -1
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/client.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/client/remote-session.d.ts.map +1 -1
- package/dist/client/remote-session.js +65 -6
- package/dist/client/remote-session.js.map +1 -1
- package/dist/core/agent-session-store.d.ts.map +1 -1
- package/dist/core/agent-session-store.js +20 -3
- package/dist/core/agent-session-store.js.map +1 -1
- package/dist/core/extensions/agent-composition.d.ts.map +1 -1
- package/dist/core/extensions/agent-composition.js +20 -1
- package/dist/core/extensions/agent-composition.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/core-errors.js +1 -0
- package/dist/core/i18n/locales/zh-cn/core-errors.js.map +1 -1
- package/dist/core/i18n/locales/zh-cn/interactive-mode.d.ts.map +1 -1
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js +10 -3
- package/dist/core/i18n/locales/zh-cn/interactive-mode.js.map +1 -1
- package/dist/core/keybindings.d.ts +35 -0
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +34 -0
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +62 -15
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +11 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +2 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/capability-mount.d.ts.map +1 -1
- package/dist/core/tools/capability-mount.js +4 -21
- package/dist/core/tools/capability-mount.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +2 -2
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +2 -0
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +25 -0
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/changelog-pager.d.ts +53 -0
- package/dist/modes/interactive/components/changelog-pager.d.ts.map +1 -0
- package/dist/modes/interactive/components/changelog-pager.js +239 -0
- package/dist/modes/interactive/components/changelog-pager.js.map +1 -0
- package/dist/modes/interactive/components/tool-execution.d.ts +6 -0
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +12 -0
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tool-run-group.d.ts +41 -11
- package/dist/modes/interactive/components/tool-run-group.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-run-group.js +126 -14
- package/dist/modes/interactive/components/tool-run-group.js.map +1 -1
- package/dist/modes/interactive/interactive-commands.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-commands.js +23 -13
- package/dist/modes/interactive/interactive-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-events.d.ts +14 -4
- package/dist/modes/interactive/interactive-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-events.js +94 -12
- package/dist/modes/interactive/interactive-events.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +6 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +21 -5
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/plugins/ecosystem/node-local-package-source.d.ts +2 -1
- package/dist/plugins/ecosystem/node-local-package-source.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-local-package-source.js +110 -4
- package/dist/plugins/ecosystem/node-local-package-source.js.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-package-install-host.js +106 -39
- package/dist/plugins/ecosystem/node-package-install-host.js.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.d.ts.map +1 -1
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js +85 -2
- package/dist/plugins/ecosystem/node-plugin-bootstrap.js.map +1 -1
- package/dist/suites/builtin-suites.d.ts.map +1 -1
- package/dist/suites/builtin-suites.js +2 -2
- package/dist/suites/builtin-suites.js.map +1 -1
- package/dist/utils/changelog.d.ts +27 -0
- package/dist/utils/changelog.d.ts.map +1 -1
- package/dist/utils/changelog.js +110 -0
- package/dist/utils/changelog.js.map +1 -1
- package/docs/keybindings.md +14 -0
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/extensions/with-deps/plugin.json +1 -1
- package/package.json +1 -1
- package/dist/bundle/chunks/chunk-A3JYRWB6.js +0 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-events.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-events.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAEhD,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAkB,kBAAkB,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAC;AAE9G,OAAO,EAAE,CAAC,EAAE,MAAM,0BAA0B,CAAC;AAC7C,OAAO,EAAE,8BAA8B,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAqB,6BAA6B,EAAE,MAAM,+BAA+B,CAAC;AAGjG,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAC7C,OAAO,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAC;AAC9E,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,6BAA6B,EAAE,MAAM,wCAAwC,CAAC;AACvF,OAAO,EAAE,iCAAiC,EAAE,MAAM,4CAA4C,CAAC;AAE/F,OAAO,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AACx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A,CAC3D;AAED,MAAM,UAAU,2BAA2B,CAAC,IAAgB,EAAE,QAAgB,EAAE;IAC/E,OAAO,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAAA,CAC/C;AAED,MAAM,UAAU,uBAAuB,CAAC,IAAgB,EAAyB;IAChF,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,CAAC;AAAA,CACzC;AAED;;;;;GAKG;AACH,MAAM,UAAU,iBAAiB,CAAC,IAAgB,EAAE,SAAiC,EAAQ;IAC5F,IAAI,CAAC,IAAI,CAAC,kBAAkB,EAAE,CAAC;QAC9B,IAAI,CAAC,kBAAkB,GAAG,IAAI,qBAAqB,EAAE,CAAC;QACtD,IAAI,CAAC,kBAAkB,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC7D,IAAI,CAAC,aAAa,CAAC,QAAQ,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;IACtD,CAAC;IACD,IAAI,CAAC,kBAAkB,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAAA,CAC3C;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,IAAgB,EAAE,OAAgB,EAAQ;IACxF,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AAAA,CAC7C;AAED,MAAM,UAAU,8BAA8B,CAAC,IAAgB,EAAQ;IACtE,IAAI,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC;AAAA,CAC3C","sourcesContent":["/**\n * Agent event bridge and transcript rendering for interactive mode (拆分\n * slice 5, docs/plans/interactive-mode拆分计划.md): the session subscription,\n * the handleEvent dispatch (every session event the TUI reacts to), the\n * transcript renderers (addMessageToChat / renderSessionItems /\n * renderSessionEntries / renderInitialMessages / rebuildChatFromMessages),\n * and the cache-miss / thinking-drop / compaction-cost notices.\n *\n * InteractiveMode implements EventsHost and keeps same-name delegate methods so\n * prototype-level tests and the rebind/subscribe flow keep working; the\n * functions below receive the mode through EventsHost. Cross-family faces go\n * through host methods only (checkShutdownRequested → ./interactive-lifecycle.ts,\n * flushCompactionQueue / updatePendingMessagesDisplay →\n * ./interactive-queues.ts); no sibling module is imported here.\n *\n * Internal collaboration interface (same pattern as AuthUiHost): not a plugin\n * API and not exported from the package root.\n */\nimport type { AgentMessage } from \"@agent-forge/agent-core\";\nimport type { AssistantMessage, Message, Usage } from \"@agent-forge/ai/compat\";\nimport type { Container, EditorComponent, MarkdownTheme, TUI } from \"@agent-forge/tui\";\nimport { Spacer, Text } from \"@agent-forge/tui\";\nimport type { AgentSessionEvent } from \"../../core/agent-session.ts\";\nimport { parseSkillBlock } from \"../../core/agent-session.ts\";\nimport { CACHE_TTL_MS, type CacheMiss, collectCacheMisses, detectCacheMiss } from \"../../core/cache-stats.ts\";\nimport type { CodingAgentFacadeV1 } from \"../../core/facade/index.ts\";\nimport { t } from \"../../core/i18n/index.ts\";\nimport { createCompactionSummaryMessage } from \"../../core/messages.ts\";\nimport { type SessionEntry, sessionEntryToContextMessages } from \"../../core/session-manager.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport type { TruncationResult } from \"../../core/tools/truncate.ts\";\nimport { theme } from \"../../theme/theme.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { BashExecutionComponent } from \"./components/bash-execution.ts\";\nimport { BranchSummaryMessageComponent } from \"./components/branch-summary-message.ts\";\nimport { CompactionSummaryMessageComponent } from \"./components/compaction-summary-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport { CustomMessageComponent } from \"./components/custom-message.ts\";\nimport { type FooterComponent, formatTokens } from \"./components/footer.ts\";\nimport type { MarkdownTransformer } from \"./components/render-types.ts\";\nimport { SkillInvocationMessageComponent } from \"./components/skill-invocation-message.ts\";\nimport {\n\tBranchSummaryStatusIndicator,\n\tCompactionStatusIndicator,\n\tRetryStatusIndicator,\n\ttype StatusIndicator,\n} from \"./components/status-indicator.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolRunGroupComponent } from \"./components/tool-run-group.ts\";\nimport { UserMessageComponent } from \"./components/user-message.ts\";\n\nexport type CompactionCostNotice = {\n\ttype: \"compaction_cost\";\n\tkind: \"compaction\" | \"branch_summary\";\n\tusage: Usage;\n};\n\nexport type RenderSessionItem = AgentMessage | Extract<SessionEntry, { type: \"custom\" }> | CompactionCostNotice;\n\nfunction isCustomSessionEntry(item: RenderSessionItem): item is Extract<SessionEntry, { type: \"custom\" }> {\n\treturn \"type\" in item && item.type === \"custom\";\n}\n\nfunction isCompactionCostNotice(item: RenderSessionItem): item is CompactionCostNotice {\n\treturn \"type\" in item && item.type === \"compaction_cost\";\n}\n\n/**\n * Host surface InteractiveMode exposes to this module: the event bridge and\n * transcript renderers (which stay on the mode for prototype-level tests and\n * the rebind flow), the streaming/transcript state they drive, and the\n * cross-family faces they call (lifecycle shutdown gate, compaction queue\n * flush, pending-messages display).\n *\n * Internal collaboration interface (same pattern as AuthUiHost): not a plugin\n * API and not exported from the package root.\n */\nexport interface EventsHost {\n\tui: TUI;\n\t/** Stable facade (阶段 1 slice 1). */\n\tfacade: CodingAgentFacadeV1;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tchatContainer: Container;\n\teditor: EditorComponent;\n\t/** Default editor instance; compaction/retry escape handlers swap onEscape. */\n\tdefaultEditor: CustomEditor;\n\t/** Agent subscription unsubscribe function (assigned by subscribeToAgent). */\n\tunsubscribe?: (() => void) | undefined;\n\tisInitialized: boolean;\n\t/** Per-second failover countdown ticker; handleEvent refreshes it. */\n\tfailoverTicker: { refresh(): void } | undefined;\n\tpendingTools: Map<string, ToolExecutionComponent>;\n\tretryEscapeHandler?: (() => void) | undefined;\n\tautoCompactionEscapeHandler?: (() => void) | undefined;\n\tworkingVisible: boolean;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\tactiveToolRunGroup: ToolRunGroupComponent | undefined;\n\tactiveStatusIndicator: StatusIndicator | undefined;\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\toutputPad: number;\n\ttoolOutputExpanded: boolean;\n\tmermaidMarkdownTransformer: MarkdownTransformer;\n\n\tinit(): Promise<void>;\n\tshowWorkingStatusIndicator(): void;\n\tclearStatusIndicator(kind?: StatusIndicator[\"kind\"]): void;\n\tshowStatusIndicator(indicator: StatusIndicator): void;\n\tshowStatus(message: string): void;\n\tshowError(message: string): void;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\tupdateEditorBorderColor(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tgetMarkdownTransformers(): MarkdownTransformer[];\n\tgetRegisteredToolDefinition(toolName: string): ReturnType<CodingAgentFacadeV1[\"getToolDefinition\"]>;\n\thandleEvent(event: AgentSessionEvent): Promise<void>;\n\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\tgetUserMessageText(message: Message): string;\n\trenderSessionEntries(entries: SessionEntry[], options?: { updateFooter?: boolean; populateHistory?: boolean }): void;\n\trenderSessionItems(\n\t\titems: readonly RenderSessionItem[],\n\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t): void;\n\taddCompactionCostNotice(notice: CompactionCostNotice): void;\n\tmaybeShowThinkingDropNotice(message: AssistantMessage): void;\n\tmaybeShowCacheMissNotice(message: AssistantMessage): void;\n\taddCacheMissNotice(miss: CacheMiss): void;\n\taddToolToRunGroup(component: ToolExecutionComponent): void;\n\tnoteResultInActiveToolRunGroup(isError: boolean): void;\n\tmarkActiveToolRunGroupComplete(): void;\n\t/** Lifecycle face (./interactive-lifecycle.ts): agent_settled exit gate. */\n\tcheckShutdownRequested(): Promise<void>;\n\t/** Queue face (./interactive-queues.ts): compaction_end queue flush. */\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nexport function subscribeToAgent(host: EventsHost): void {\n\thost.unsubscribe = host.facade.subscribe(async (event) => {\n\t\tawait host.handleEvent(event);\n\t});\n}\n\nexport async function handleEvent(host: EventsHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) {\n\t\tawait host.init();\n\t}\n\n\thost.footer.invalidate();\n\t// Failover snapshots land as entry_appended events; the ticker decides here\n\t// whether the per-second countdown re-render is needed (§4.7 Phase 3).\n\thost.failoverTicker?.refresh();\n\n\tswitch (event.type) {\n\t\tcase \"agent_start\":\n\t\t\thost.pendingTools.clear();\n\t\t\t// Restore main escape handler if retry handler is still active\n\t\t\t// (retry success event fires later, but we need main handler now)\n\t\t\tif (host.retryEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\t\t\thost.retryEscapeHandler = undefined;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"turn_start\":\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(true);\n\t\t\t}\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.activeStatusIndicator?.kind !== \"working\") {\n\t\t\t\t\thost.showWorkingStatusIndicator();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thost.clearStatusIndicator();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"entry_appended\":\n\t\t\t// Custom entries have no renderer source since the legacy extension\n\t\t\t// surface was removed; nothing to append to the chat.\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\t// D-083: a new assistant turn closes the previous turn's\n\t\t\t\t// tool-run group (tools executed between the turns) and\n\t\t\t\t// starts a fresh one on its first toolCall.\n\t\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\t\thost.activeToolRunGroup = undefined;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\t\thost.outputPad,\n\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t);\n\t\t\t\t// D-083: components created after a ctrl+o toggle inherit the\n\t\t\t\t// current expansion so detail mode holds across turns.\n\t\t\t\tif (host.toolOutputExpanded) {\n\t\t\t\t\thost.streamingComponent.setExpanded(true);\n\t\t\t\t}\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, true);\n\n\t\t\t\tfor (const content of host.streamingMessage.content) {\n\t\t\t\t\tif (content.type === \"toolCall\") {\n\t\t\t\t\t\tif (!host.pendingTools.has(content.id)) {\n\t\t\t\t\t\t\tconst component = new ToolExecutionComponent(\n\t\t\t\t\t\t\t\tcontent.name,\n\t\t\t\t\t\t\t\tcontent.id,\n\t\t\t\t\t\t\t\tcontent.arguments,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\thost.getRegisteredToolDefinition(content.name),\n\t\t\t\t\t\t\t\thost.ui,\n\t\t\t\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\t\t\thost.addToolToRunGroup(component);\n\t\t\t\t\t\t\thost.pendingTools.set(content.id, component);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst component = host.pendingTools.get(content.id);\n\t\t\t\t\t\t\t// v8 ignore next -- has() 已确认键存在,get() 恒返回组件\n\t\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\t\tcomponent.updateArgs(content.arguments);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.facade.getRetryAttempt();\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? retryAttempt === 1\n\t\t\t\t\t\t\t\t? t(\"Aborted after {count} retry attempt\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t: t(\"Aborted after {count} retry attempts\", { count: retryAttempt })\n\t\t\t\t\t\t\t: t(\"Operation aborted\");\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, false);\n\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\tif (!errorMessage) {\n\t\t\t\t\t\terrorMessage = host.streamingMessage.errorMessage || t(\"Error\");\n\t\t\t\t\t}\n\t\t\t\t\tfor (const [, component] of host.pendingTools.entries()) {\n\t\t\t\t\t\tcomponent.updateResult({\n\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: errorMessage }],\n\t\t\t\t\t\t\tisError: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t\thost.activeToolRunGroup?.noteResult(true);\n\t\t\t\t\t}\n\t\t\t\t\t// No tool execution follows an aborted/errored message:\n\t\t\t\t\t// finalize the group marker here.\n\t\t\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\t\t\thost.pendingTools.clear();\n\t\t\t\t} else {\n\t\t\t\t\t// Args are now complete - trigger diff computation for edit tools\n\t\t\t\t\tfor (const [, component] of host.pendingTools.entries()) {\n\t\t\t\t\t\tcomponent.setArgsComplete();\n\t\t\t\t\t}\n\t\t\t\t\thost.maybeShowThinkingDropNotice(host.streamingMessage);\n\t\t\t\t\thost.maybeShowCacheMissNotice(host.streamingMessage);\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\t// D-083: a toolUse stop reason is followed by tool execution\n\t\t\t\t// events (start/end arrive after message_end — the session\n\t\t\t\t// executes tools once the streamed message completes), so the\n\t\t\t\t// group stays open for setActiveTool/noteResult here and is\n\t\t\t\t// finalized at agent_end / the next message_start.\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"bash_execution_update\":\n\t\t\t// The bash execution callback handles TUI output rendering.\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\tlet component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = new ToolExecutionComponent(\n\t\t\t\t\tevent.toolName,\n\t\t\t\t\tevent.toolCallId,\n\t\t\t\t\tevent.args,\n\t\t\t\t\t{\n\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t},\n\t\t\t\t\thost.getRegisteredToolDefinition(event.toolName),\n\t\t\t\t\thost.ui,\n\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t);\n\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\thost.addToolToRunGroup(component);\n\t\t\t\thost.pendingTools.set(event.toolCallId, component);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted();\n\t\t\thost.activeToolRunGroup?.setActiveTool(event.toolName);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.activeToolRunGroup?.noteResult(event.isError);\n\t\t\t\thost.pendingTools.delete(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"capability_command_result\": {\n\t\t\tconst links = event.result.links?.map((link) => `${link.label}: ${link.url}`) ?? [];\n\t\t\tconst message = [event.result.message, ...links].filter(Boolean).join(\"\\n\");\n\t\t\tif (event.result.status === \"error\") host.showError(message);\n\t\t\telse host.showStatus(message);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\":\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(false);\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"working\");\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.pendingTools.clear();\n\t\t\t// D-083: the whole agent turn (messages + tool executions) is\n\t\t\t// over — finalize the last group's marker (count/sole-tool name\n\t\t\t// + failure count). Completed groups stay in the transcript.\n\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\thost.activeToolRunGroup = undefined;\n\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_settled\":\n\t\t\tawait host.checkShutdownRequested();\n\t\t\tbreak;\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(true);\n\t\t\t}\n\t\t\t// Keep editor active; submissions are queued during compaction.\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => {\n\t\t\t\thost.facade.abortCompaction();\n\t\t\t};\n\t\t\thost.showStatusIndicator(new CompactionStatusIndicator(host.ui, event.reason));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(false);\n\t\t\t}\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"compaction\");\n\t\t\tif (event.aborted) {\n\t\t\t\tif (event.reason === \"manual\") {\n\t\t\t\t\thost.showError(t(\"Compaction cancelled\"));\n\t\t\t\t} else {\n\t\t\t\t\thost.showStatus(t(\"Auto-compaction cancelled\"));\n\t\t\t\t}\n\t\t\t} else if (event.result) {\n\t\t\t\tconst entries = host.facade.getContextEntries();\n\t\t\t\tif (entries[0]?.type !== \"compaction\") {\n\t\t\t\t\tthrow new Error(t(\"Completed compaction is missing from the session context\"));\n\t\t\t\t}\n\t\t\t\thost.chatContainer.clear();\n\t\t\t\t// The latest compaction is prepended for model context; append it below at its chronological position.\n\t\t\t\thost.renderSessionEntries(entries.slice(1));\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tif (event.result.usage) {\n\t\t\t\t\thost.addCompactionCostNotice({\n\t\t\t\t\t\ttype: \"compaction_cost\",\n\t\t\t\t\t\tkind: \"compaction\",\n\t\t\t\t\t\tusage: event.result.usage,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\tif (event.reason === \"manual\") {\n\t\t\t\t\thost.showError(event.errorMessage);\n\t\t\t\t} else {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_skipped\": {\n\t\t\thost.showStatus(t(\"Auto-compaction skipped: nothing to compact\"));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\t// Set up escape to abort retry\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => {\n\t\t\t\thost.facade.abortRetry();\n\t\t\t};\n\t\t\thost.showStatusIndicator(new RetryStatusIndicator(host.ui, event.attempt, event.maxAttempts, event.delayMs));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\": {\n\t\t\t// Restore escape handler\n\t\t\tif (host.retryEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\t\t\thost.retryEscapeHandler = undefined;\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\t// Show error only on final failure (success shows normal response)\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(\n\t\t\t\t\tt(\"Retry failed after {count} attempts: {error}\", {\n\t\t\t\t\t\tcount: event.attempt,\n\t\t\t\t\t\terror: event.finalError || t(\"Unknown error\"),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_scheduled\": {\n\t\t\thost.showError(event.errorMessage);\n\t\t\thost.showStatusIndicator(new RetryStatusIndicator(host.ui, event.attempt, event.maxAttempts, event.delayMs));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_attempt_start\": {\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\tif (event.source === \"branchSummary\") {\n\t\t\t\thost.showStatusIndicator(new BranchSummaryStatusIndicator(host.ui));\n\t\t\t} else {\n\t\t\t\thost.showStatusIndicator(new CompactionStatusIndicator(host.ui, event.reason));\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_finished\": {\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/** Extract text content from a user message */\nexport function getUserMessageText(message: Message): string {\n\tif (message.role !== \"user\") return \"\";\n\tconst textBlocks =\n\t\ttypeof message.content === \"string\"\n\t\t\t? [{ type: \"text\", text: message.content }]\n\t\t\t: message.content.filter((c: { type: string }) => c.type === \"text\");\n\treturn textBlocks.map((c) => (c as { text: string }).text).join(\"\");\n}\n\nexport function addMessageToChat(\n\thost: EventsHost,\n\tmessage: AgentMessage,\n\toptions?: { populateHistory?: boolean },\n): void {\n\tswitch (message.role) {\n\t\tcase \"bashExecution\": {\n\t\t\tconst component = new BashExecutionComponent(message.command, host.ui, message.excludeFromContext);\n\t\t\tif (message.output) {\n\t\t\t\tcomponent.appendOutput(message.output);\n\t\t\t}\n\t\t\tcomponent.setComplete(\n\t\t\t\tmessage.exitCode,\n\t\t\t\tmessage.cancelled,\n\t\t\t\tmessage.truncated ? ({ truncated: true } as TruncationResult) : undefined,\n\t\t\t\tmessage.fullOutputPath,\n\t\t\t);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom\": {\n\t\t\tif (message.display) {\n\t\t\t\tconst renderer = undefined;\n\t\t\t\tconst component = new CustomMessageComponent(\n\t\t\t\t\tmessage,\n\t\t\t\t\trenderer,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.outputPad,\n\t\t\t\t);\n\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\thost.chatContainer.addChild(component);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compactionSummary\": {\n\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\tconst component = new CompactionSummaryMessageComponent(message, host.getMarkdownThemeWithSettings());\n\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"branchSummary\": {\n\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\tconst component = new BranchSummaryMessageComponent(message, host.getMarkdownThemeWithSettings());\n\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"user\": {\n\t\t\tconst textContent = host.getUserMessageText(message);\n\t\t\tif (textContent) {\n\t\t\t\tif (host.chatContainer.children.length > 0) {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t}\n\t\t\t\tconst skillBlock = parseSkillBlock(textContent);\n\t\t\t\tif (skillBlock) {\n\t\t\t\t\t// Render skill block (collapsible)\n\t\t\t\t\tconst component = new SkillInvocationMessageComponent(skillBlock, host.getMarkdownThemeWithSettings());\n\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\thost.chatContainer.addChild(component);\n\t\t\t\t\t// Render user message separately if present\n\t\t\t\t\tif (skillBlock.userMessage) {\n\t\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\t\tconst userComponent = new UserMessageComponent(\n\t\t\t\t\t\t\tskillBlock.userMessage,\n\t\t\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\t\t\thost.outputPad,\n\t\t\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t\t\t);\n\t\t\t\t\t\thost.chatContainer.addChild(userComponent);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst userComponent = new UserMessageComponent(\n\t\t\t\t\t\ttextContent,\n\t\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\t\thost.outputPad,\n\t\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t\t);\n\t\t\t\t\thost.chatContainer.addChild(userComponent);\n\t\t\t\t}\n\t\t\t\tif (options?.populateHistory) {\n\t\t\t\t\thost.editor.addToHistory?.(textContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"assistant\": {\n\t\t\tconst assistantComponent = new AssistantMessageComponent(\n\t\t\t\tmessage,\n\t\t\t\thost.hideThinkingBlock,\n\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\thost.outputPad,\n\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t);\n\t\t\t// D-083: restored/finished-turn thinking must follow detail mode\n\t\t\t// (ctrl+o) — the setToolsExpanded loop only reaches children on\n\t\t\t// toggle, not components created while already expanded.\n\t\t\tif (host.toolOutputExpanded) {\n\t\t\t\tassistantComponent.setExpanded(true);\n\t\t\t}\n\t\t\thost.chatContainer.addChild(assistantComponent);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"toolResult\": {\n\t\t\t// Tool results are rendered inline with tool calls, handled separately\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\t// v8 ignore next -- exhaustive over AgentMessage roles\n\t\t\tconst _exhaustive: never = message;\n\t\t}\n\t}\n}\n\nexport function renderSessionItems(\n\thost: EventsHost,\n\titems: readonly RenderSessionItem[],\n\toptions: { updateFooter?: boolean; populateHistory?: boolean } = {},\n): void {\n\thost.pendingTools.clear();\n\tconst renderedPendingTools = new Map<string, ToolExecutionComponent>();\n\t// Cache-miss notices are not persisted; re-derive them from the full entry\n\t// list and re-inject them after the assistant messages that paid for them.\n\tconst cacheMisses = host.settingsManager.getShowCacheMissNotices()\n\t\t? collectCacheMisses(host.facade.getEntries(), host.facade.getModelPriceSource())\n\t\t: new Map<AssistantMessage, CacheMiss>();\n\n\tif (options.updateFooter) {\n\t\thost.footer.invalidate();\n\t\thost.updateEditorBorderColor();\n\t}\n\n\tfor (const item of items) {\n\t\tif (isCustomSessionEntry(item)) {\n\t\t\t// No entry renderer source since the legacy extension surface was\n\t\t\t// removed; previously renderer-less entries were skipped as well.\n\t\t\tcontinue;\n\t\t}\n\t\tif (isCompactionCostNotice(item)) {\n\t\t\thost.addCompactionCostNotice(item);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst message = item;\n\t\t// Assistant messages need special handling for tool calls\n\t\tif (message.role === \"assistant\") {\n\t\t\thost.addMessageToChat(message);\n\t\t\t// No message_start on the restore path: reset the group pointer\n\t\t\t// so each assistant message forms its own tool-run group (D-083).\n\t\t\thost.activeToolRunGroup = undefined;\n\t\t\t// Render tool call components\n\t\t\tfor (const content of message.content) {\n\t\t\t\tif (content.type === \"toolCall\") {\n\t\t\t\t\tconst component = new ToolExecutionComponent(\n\t\t\t\t\t\tcontent.name,\n\t\t\t\t\t\tcontent.id,\n\t\t\t\t\t\tcontent.arguments,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t\t},\n\t\t\t\t\t\thost.getRegisteredToolDefinition(content.name),\n\t\t\t\t\t\thost.ui,\n\t\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t\t);\n\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\thost.addToolToRunGroup(component);\n\n\t\t\t\t\tif (message.stopReason === \"aborted\" || message.stopReason === \"error\") {\n\t\t\t\t\t\tlet errorMessage: string;\n\t\t\t\t\t\tif (message.stopReason === \"aborted\") {\n\t\t\t\t\t\t\tconst retryAttempt = host.facade.getRetryAttempt();\n\t\t\t\t\t\t\terrorMessage =\n\t\t\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t\t\t? retryAttempt === 1\n\t\t\t\t\t\t\t\t\t\t? t(\"Aborted after {count} retry attempt\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t\t\t: t(\"Aborted after {count} retry attempts\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t\t: t(\"Operation aborted\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terrorMessage = message.errorMessage || t(\"Error\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t\thost.noteResultInActiveToolRunGroup(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderedPendingTools.set(content.id, component);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.markActiveToolRunGroupComplete();\n\t\t\tif (message.stopReason !== \"aborted\" && message.stopReason !== \"error\") {\n\t\t\t\tconst miss = cacheMisses.get(message);\n\t\t\t\tif (miss) host.addCacheMissNotice(miss);\n\t\t\t}\n\t\t} else if (message.role === \"toolResult\") {\n\t\t\t// Match tool results to pending tool components\n\t\t\tconst component = renderedPendingTools.get(message.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult(message);\n\t\t\t\t// Failure never goes silent (D-083): count it on the group\n\t\t\t\t// the restored tool call belongs to.\n\t\t\t\thost.noteResultInActiveToolRunGroup(message.isError);\n\t\t\t\trenderedPendingTools.delete(message.toolCallId);\n\t\t\t}\n\t\t} else {\n\t\t\t// All other messages use standard rendering\n\t\t\thost.addMessageToChat(message, options);\n\t\t}\n\t}\n\n\tfor (const [toolCallId, component] of renderedPendingTools) {\n\t\thost.pendingTools.set(toolCallId, component);\n\t}\n\t// Groups stay in the transcript; reset the pointer so a live turn\n\t// starts a fresh group (D-083).\n\thost.activeToolRunGroup = undefined;\n\thost.ui.requestRender();\n}\n\n/**\n * Render session entries to chat. Used for initial load and rebuild after compaction.\n * @param entries Compaction-aware session entries to render\n * @param options.updateFooter Update footer state\n * @param options.populateHistory Add user messages to editor history\n */\nexport function renderSessionEntries(\n\thost: EventsHost,\n\tentries: SessionEntry[],\n\toptions: { updateFooter?: boolean; populateHistory?: boolean } = {},\n): void {\n\tconst items = entries.flatMap((entry): RenderSessionItem[] => {\n\t\tif (entry.type === \"custom\") {\n\t\t\treturn [entry];\n\t\t}\n\t\tconst messages = sessionEntryToContextMessages(entry);\n\t\tif ((entry.type === \"compaction\" || entry.type === \"branch_summary\") && entry.usage && messages.length > 0) {\n\t\t\treturn [...messages, { type: \"compaction_cost\", kind: entry.type, usage: entry.usage }];\n\t\t}\n\t\treturn messages;\n\t});\n\thost.renderSessionItems(items, options);\n}\n\n/**\n * Render billing usage for a compaction or branch summary. The notice is derived\n * from persisted summary usage and is not stored as a separate session entry.\n */\nexport function addCompactionCostNotice(host: EventsHost, notice: CompactionCostNotice): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\tconst { usage } = notice;\n\tconst tokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n\tconst cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : \"\";\n\tconst label = notice.kind === \"compaction\" ? t(\"Compaction\") : t(\"Branch summary\");\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(\n\t\t\ttheme.fg(\"warning\", `${label}: ${t(\"{tokens} tokens billed{cost}\", { tokens: formatTokens(tokens), cost })}`),\n\t\t\t1,\n\t\t\t0,\n\t\t),\n\t);\n}\n\nfunction countDroppedThinkingBlocks(message: AssistantMessage): number {\n\tlet count = 0;\n\tfor (const diagnostic of message.diagnostics ?? []) {\n\t\tif (diagnostic.type !== \"anthropic_input_transformations\") continue;\n\t\tconst transformations = diagnostic.details?.transformations;\n\t\tif (!Array.isArray(transformations)) continue;\n\t\tcount += transformations.filter(\n\t\t\t(transformation) =>\n\t\t\t\ttypeof transformation === \"object\" &&\n\t\t\t\ttransformation !== null &&\n\t\t\t\t(transformation as Record<string, unknown>).type === \"thinking_dropped\",\n\t\t).length;\n\t}\n\treturn count;\n}\n\nexport function maybeShowThinkingDropNotice(host: EventsHost, message: AssistantMessage): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\tconst droppedCount = countDroppedThinkingBlocks(message);\n\tif (droppedCount === 0) return;\n\n\tlet previousDroppedCount = 0;\n\t// message_end reaches the UI before the current message is persisted,\n\t// so the branch's last assistant message is the previous response.\n\tconst entries = host.facade.getEntries();\n\tfor (let i = entries.length - 1; i >= 0; i--) {\n\t\tconst entry = entries[i];\n\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tpreviousDroppedCount = countDroppedThinkingBlocks(entry.message);\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (droppedCount <= previousDroppedCount) return;\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(\n\t\t\ttheme.fg(\n\t\t\t\t\"warning\",\n\t\t\t\tt(\"Anthropic dropped {count} thinking blocks (details in session)\", { count: droppedCount }),\n\t\t\t),\n\t\t\t1,\n\t\t\t0,\n\t\t),\n\t);\n}\n\n/**\n * Show a transcript notice when a completed assistant message paid for a\n * significant cache miss. Only states observable facts: the miss itself,\n * a model switch, or an idle gap past the cache TTL.\n */\nexport function maybeShowCacheMissNotice(host: EventsHost, message: AssistantMessage): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\t// Entries don't contain `message` yet: message_end fires before persistence.\n\tconst miss = detectCacheMiss(host.facade.getEntries(), message, host.facade.getModelPriceSource());\n\tif (miss) host.addCacheMissNotice(miss);\n}\n\nexport function addCacheMissNotice(host: EventsHost, miss: CacheMiss): void {\n\tif (miss.missedTokens < 20_000 && miss.missedCost < 0.1) return;\n\n\tconst cost = miss.missedCost >= 0.01 ? ` (~$${miss.missedCost.toFixed(2)})` : \"\";\n\tconst reBilled = t(\"{tokens} tokens re-billed{cost}\", { tokens: formatTokens(miss.missedTokens), cost });\n\tlet label = t(\"Cache miss\");\n\tif (miss.modelChanged) {\n\t\tlabel = t(\"Cache miss after model switch\");\n\t} else if (miss.idleMs >= CACHE_TTL_MS) {\n\t\tlabel = t(\"Cache miss after {minutes}m idle\", { minutes: Math.round(miss.idleMs / 60_000) });\n\t}\n\tconst text = theme.fg(\"warning\", `${label}: ${reBilled}`);\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Text(text, 1, 0));\n}\n\nexport function renderInitialMessages(host: EventsHost): void {\n\tconst entries = host.facade.getContextEntries();\n\thost.renderSessionEntries(entries, {\n\t\tupdateFooter: true,\n\t\tpopulateHistory: true,\n\t});\n\t// Show compaction info if session was compacted\n\tconst allEntries = host.facade.getEntries();\n\tconst compactionCount = allEntries.filter((e) => e.type === \"compaction\").length;\n\tif (compactionCount > 0) {\n\t\thost.showStatus(\n\t\t\tcompactionCount === 1\n\t\t\t\t? t(\"Session compacted {count} time\", { count: compactionCount })\n\t\t\t\t: t(\"Session compacted {count} times\", { count: compactionCount }),\n\t\t);\n\t}\n}\n\nexport function rebuildChatFromMessages(host: EventsHost): void {\n\thost.chatContainer.clear();\n\thost.renderSessionEntries(host.facade.getContextEntries());\n}\n\nexport function getRegisteredToolDefinition(host: EventsHost, toolName: string) {\n\treturn host.facade.getToolDefinition(toolName);\n}\n\nexport function getMarkdownTransformers(host: EventsHost): MarkdownTransformer[] {\n\treturn [host.mermaidMarkdownTransformer];\n}\n\n/**\n * D-083 quiet transcript: mount a tool component into the current\n * assistant turn's tool-run group (creating the group on first tool of\n * the turn) instead of the chat container directly. Collapsed groups\n * render one dim marker line for the whole turn.\n */\nexport function addToolToRunGroup(host: EventsHost, component: ToolExecutionComponent): void {\n\tif (!host.activeToolRunGroup) {\n\t\thost.activeToolRunGroup = new ToolRunGroupComponent();\n\t\thost.activeToolRunGroup.setExpanded(host.toolOutputExpanded);\n\t\thost.chatContainer.addChild(host.activeToolRunGroup);\n\t}\n\thost.activeToolRunGroup.addTool(component);\n}\n\n/**\n * Narrowing-safe faces for the active group inside renderSessionItems:\n * addToolToRunGroup may (re)assign host.activeToolRunGroup behind the\n * compiler's back, so group reads go through methods instead of the\n * narrowed property reference.\n */\nexport function noteResultInActiveToolRunGroup(host: EventsHost, isError: boolean): void {\n\thost.activeToolRunGroup?.noteResult(isError);\n}\n\nexport function markActiveToolRunGroupComplete(host: EventsHost): void {\n\thost.activeToolRunGroup?.markRunComplete();\n}\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-events.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-events.ts"],"names":[],"mappings":"AAqBA,OAAO,EAAE,MAAM,EAAE,IA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AI,EAAE,KAAK,EAAE,CAAC,CAAC;AAAA,CAC5F;AAED,kFAAkF;AAClF,SAAS,iCAAiC,CAAC,OAAyB,EAAW;IAC9E,OAAO,OAAO,CAAC,OAAO,CAAC,IAAI,CAC1B,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,KAAK,MAAM,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,EAAE,CAAC,CAC3F,CAAC;AAAA,CACF;AAED;;;;;GAKG;AACH,MAAM,UAAU,8BAA8B,CAAC,IAAgB,EAAE,OAAgB,EAAQ;IACxF,IAAI,CAAC,kBAAkB,EAAE,UAAU,CAAC,OAAO,CAAC,CAAC;AAAA,CAC7C;AAED,MAAM,UAAU,8BAA8B,CAAC,IAAgB,EAAQ;IACtE,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC,kBAAkB,CAAC;IACzD,IAAI,CAAC,kBAAkB,EAAE,eAAe,EAAE,CAAC;AAAA,CAC3C","sourcesContent":["/**\n * Agent event bridge and transcript rendering for interactive mode (拆分\n * slice 5, docs/plans/interactive-mode拆分计划.md): the session subscription,\n * the handleEvent dispatch (every session event the TUI reacts to), the\n * transcript renderers (addMessageToChat / renderSessionItems /\n * renderSessionEntries / renderInitialMessages / rebuildChatFromMessages),\n * and the cache-miss / thinking-drop / compaction-cost notices.\n *\n * InteractiveMode implements EventsHost and keeps same-name delegate methods so\n * prototype-level tests and the rebind/subscribe flow keep working; the\n * functions below receive the mode through EventsHost. Cross-family faces go\n * through host methods only (checkShutdownRequested → ./interactive-lifecycle.ts,\n * flushCompactionQueue / updatePendingMessagesDisplay →\n * ./interactive-queues.ts); no sibling module is imported here.\n *\n * Internal collaboration interface (same pattern as AuthUiHost): not a plugin\n * API and not exported from the package root.\n */\nimport type { AgentMessage } from \"@agent-forge/agent-core\";\nimport type { AssistantMessage, Message, Usage } from \"@agent-forge/ai/compat\";\nimport type { Component, Container, EditorComponent, MarkdownTheme, TUI } from \"@agent-forge/tui\";\nimport { Spacer, Text } from \"@agent-forge/tui\";\nimport type { AgentSessionEvent } from \"../../core/agent-session.ts\";\nimport { parseSkillBlock } from \"../../core/agent-session.ts\";\nimport { CACHE_TTL_MS, type CacheMiss, collectCacheMisses, detectCacheMiss } from \"../../core/cache-stats.ts\";\nimport type { CodingAgentFacadeV1 } from \"../../core/facade/index.ts\";\nimport { t } from \"../../core/i18n/index.ts\";\nimport { createCompactionSummaryMessage } from \"../../core/messages.ts\";\nimport { type SessionEntry, sessionEntryToContextMessages } from \"../../core/session-manager.ts\";\nimport type { SettingsManager } from \"../../core/settings-manager.ts\";\nimport type { TruncationResult } from \"../../core/tools/truncate.ts\";\nimport { theme } from \"../../theme/theme.ts\";\nimport { AssistantMessageComponent } from \"./components/assistant-message.ts\";\nimport { BashExecutionComponent } from \"./components/bash-execution.ts\";\nimport { BranchSummaryMessageComponent } from \"./components/branch-summary-message.ts\";\nimport { CompactionSummaryMessageComponent } from \"./components/compaction-summary-message.ts\";\nimport type { CustomEditor } from \"./components/custom-editor.ts\";\nimport { CustomMessageComponent } from \"./components/custom-message.ts\";\nimport { type FooterComponent, formatTokens } from \"./components/footer.ts\";\nimport type { MarkdownTransformer } from \"./components/render-types.ts\";\nimport { SkillInvocationMessageComponent } from \"./components/skill-invocation-message.ts\";\nimport {\n\tBranchSummaryStatusIndicator,\n\tCompactionStatusIndicator,\n\tRetryStatusIndicator,\n\ttype StatusIndicator,\n} from \"./components/status-indicator.ts\";\nimport { ToolExecutionComponent } from \"./components/tool-execution.ts\";\nimport { ToolRunGroupComponent } from \"./components/tool-run-group.ts\";\nimport { UserMessageComponent } from \"./components/user-message.ts\";\n\nexport type CompactionCostNotice = {\n\ttype: \"compaction_cost\";\n\tkind: \"compaction\" | \"branch_summary\";\n\tusage: Usage;\n};\n\nexport type RenderSessionItem = AgentMessage | Extract<SessionEntry, { type: \"custom\" }> | CompactionCostNotice;\n\nfunction isCustomSessionEntry(item: RenderSessionItem): item is Extract<SessionEntry, { type: \"custom\" }> {\n\treturn \"type\" in item && item.type === \"custom\";\n}\n\nfunction isCompactionCostNotice(item: RenderSessionItem): item is CompactionCostNotice {\n\treturn \"type\" in item && item.type === \"compaction_cost\";\n}\n\n/**\n * Host surface InteractiveMode exposes to this module: the event bridge and\n * transcript renderers (which stay on the mode for prototype-level tests and\n * the rebind flow), the streaming/transcript state they drive, and the\n * cross-family faces they call (lifecycle shutdown gate, compaction queue\n * flush, pending-messages display).\n *\n * Internal collaboration interface (same pattern as AuthUiHost): not a plugin\n * API and not exported from the package root.\n */\nexport interface EventsHost {\n\tui: TUI;\n\t/** Stable facade (阶段 1 slice 1). */\n\tfacade: CodingAgentFacadeV1;\n\tsettingsManager: SettingsManager;\n\tfooter: FooterComponent;\n\tchatContainer: Container;\n\teditor: EditorComponent;\n\t/** Default editor instance; compaction/retry escape handlers swap onEscape. */\n\tdefaultEditor: CustomEditor;\n\t/** Agent subscription unsubscribe function (assigned by subscribeToAgent). */\n\tunsubscribe?: (() => void) | undefined;\n\tisInitialized: boolean;\n\t/** Per-second failover countdown ticker; handleEvent refreshes it. */\n\tfailoverTicker: { refresh(): void } | undefined;\n\tpendingTools: Map<string, ToolExecutionComponent>;\n\tretryEscapeHandler?: (() => void) | undefined;\n\tautoCompactionEscapeHandler?: (() => void) | undefined;\n\tworkingVisible: boolean;\n\tstreamingComponent: AssistantMessageComponent | undefined;\n\tstreamingMessage: AssistantMessage | undefined;\n\tactiveToolRunGroup: ToolRunGroupComponent | undefined;\n\t/** Last sealed group; an adjacent run with no visible content between may merge back into it (D-083 跨回合合并). */\n\tlastCompletedToolRunGroup: ToolRunGroupComponent | undefined;\n\tactiveStatusIndicator: StatusIndicator | undefined;\n\thideThinkingBlock: boolean;\n\thiddenThinkingLabel: string;\n\toutputPad: number;\n\ttoolOutputExpanded: boolean;\n\tmermaidMarkdownTransformer: MarkdownTransformer;\n\n\tinit(): Promise<void>;\n\tshowWorkingStatusIndicator(): void;\n\tclearStatusIndicator(kind?: StatusIndicator[\"kind\"]): void;\n\tshowStatusIndicator(indicator: StatusIndicator): void;\n\tshowStatus(message: string): void;\n\tshowError(message: string): void;\n\tupdatePendingMessagesDisplay(): void;\n\tupdateTerminalTitle(): void;\n\tupdateEditorBorderColor(): void;\n\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\tgetMarkdownTransformers(): MarkdownTransformer[];\n\tgetRegisteredToolDefinition(toolName: string): ReturnType<CodingAgentFacadeV1[\"getToolDefinition\"]>;\n\thandleEvent(event: AgentSessionEvent): Promise<void>;\n\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\tgetUserMessageText(message: Message): string;\n\trenderSessionEntries(entries: SessionEntry[], options?: { updateFooter?: boolean; populateHistory?: boolean }): void;\n\trenderSessionItems(\n\t\titems: readonly RenderSessionItem[],\n\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t): void;\n\taddCompactionCostNotice(notice: CompactionCostNotice): void;\n\tmaybeShowThinkingDropNotice(message: AssistantMessage): void;\n\tmaybeShowCacheMissNotice(message: AssistantMessage): void;\n\taddCacheMissNotice(miss: CacheMiss): void;\n\taddToolToRunGroup(\n\t\tcomponent: ToolExecutionComponent,\n\t\tctx?: { messageComponent?: Component; message?: AssistantMessage },\n\t): void;\n\tnoteResultInActiveToolRunGroup(isError: boolean): void;\n\tmarkActiveToolRunGroupComplete(): void;\n\t/** Lifecycle face (./interactive-lifecycle.ts): agent_settled exit gate. */\n\tcheckShutdownRequested(): Promise<void>;\n\t/** Queue face (./interactive-queues.ts): compaction_end queue flush. */\n\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n}\n\nexport function subscribeToAgent(host: EventsHost): void {\n\thost.unsubscribe = host.facade.subscribe(async (event) => {\n\t\tawait host.handleEvent(event);\n\t});\n}\n\nexport async function handleEvent(host: EventsHost, event: AgentSessionEvent): Promise<void> {\n\tif (!host.isInitialized) {\n\t\tawait host.init();\n\t}\n\n\thost.footer.invalidate();\n\t// Failover snapshots land as entry_appended events; the ticker decides here\n\t// whether the per-second countdown re-render is needed (§4.7 Phase 3).\n\thost.failoverTicker?.refresh();\n\n\tswitch (event.type) {\n\t\tcase \"agent_start\":\n\t\t\thost.pendingTools.clear();\n\t\t\t// Restore main escape handler if retry handler is still active\n\t\t\t// (retry success event fires later, but we need main handler now)\n\t\t\tif (host.retryEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\t\t\thost.retryEscapeHandler = undefined;\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"turn_start\":\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(true);\n\t\t\t}\n\t\t\tif (host.workingVisible) {\n\t\t\t\tif (host.activeStatusIndicator?.kind !== \"working\") {\n\t\t\t\t\thost.showWorkingStatusIndicator();\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\thost.clearStatusIndicator();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"queue_update\":\n\t\t\thost.updatePendingMessagesDisplay();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"entry_appended\":\n\t\t\t// Custom entries have no renderer source since the legacy extension\n\t\t\t// surface was removed; nothing to append to the chat.\n\t\t\tbreak;\n\n\t\tcase \"session_info_changed\":\n\t\t\thost.updateTerminalTitle();\n\t\t\thost.footer.invalidate();\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"thinking_level_changed\":\n\t\t\thost.footer.invalidate();\n\t\t\thost.updateEditorBorderColor();\n\t\t\tbreak;\n\n\t\tcase \"message_start\":\n\t\t\tif (event.message.role === \"custom\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"user\") {\n\t\t\t\thost.addMessageToChat(event.message);\n\t\t\t\thost.updatePendingMessagesDisplay();\n\t\t\t\thost.ui.requestRender();\n\t\t\t} else if (event.message.role === \"assistant\") {\n\t\t\t\t// D-083: a new assistant turn closes the previous turn's\n\t\t\t\t// tool-run group (tools executed between the turns) and\n\t\t\t\t// starts a fresh one on its first toolCall. The sealed group\n\t\t\t\t// stays mergeable for the adjacent-run case (跨回合合并).\n\t\t\t\thost.lastCompletedToolRunGroup = host.activeToolRunGroup;\n\t\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\t\thost.activeToolRunGroup = undefined;\n\t\t\t\thost.streamingComponent = new AssistantMessageComponent(\n\t\t\t\t\tundefined,\n\t\t\t\t\thost.hideThinkingBlock,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\t\thost.outputPad,\n\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t);\n\t\t\t\t// D-083: components created after a ctrl+o toggle inherit the\n\t\t\t\t// current expansion so detail mode holds across turns.\n\t\t\t\tif (host.toolOutputExpanded) {\n\t\t\t\t\thost.streamingComponent.setExpanded(true);\n\t\t\t\t}\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.chatContainer.addChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_update\":\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, true);\n\n\t\t\t\tfor (const content of host.streamingMessage.content) {\n\t\t\t\t\tif (content.type === \"toolCall\") {\n\t\t\t\t\t\tif (!host.pendingTools.has(content.id)) {\n\t\t\t\t\t\t\tconst component = new ToolExecutionComponent(\n\t\t\t\t\t\t\t\tcontent.name,\n\t\t\t\t\t\t\t\tcontent.id,\n\t\t\t\t\t\t\t\tcontent.arguments,\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\thost.getRegisteredToolDefinition(content.name),\n\t\t\t\t\t\t\t\thost.ui,\n\t\t\t\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\t\t\thost.addToolToRunGroup(component, {\n\t\t\t\t\t\t\t\tmessageComponent: host.streamingComponent,\n\t\t\t\t\t\t\t\tmessage: host.streamingMessage,\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t\thost.pendingTools.set(content.id, component);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tconst component = host.pendingTools.get(content.id);\n\t\t\t\t\t\t\t// v8 ignore next -- has() 已确认键存在,get() 恒返回组件\n\t\t\t\t\t\t\tif (component) {\n\t\t\t\t\t\t\t\tcomponent.updateArgs(content.arguments);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"message_end\":\n\t\t\tif (event.message.role === \"user\") break;\n\t\t\tif (host.streamingComponent && event.message.role === \"assistant\") {\n\t\t\t\thost.streamingMessage = event.message;\n\t\t\t\tlet errorMessage: string | undefined;\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\") {\n\t\t\t\t\tconst retryAttempt = host.facade.getRetryAttempt();\n\t\t\t\t\terrorMessage =\n\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t? retryAttempt === 1\n\t\t\t\t\t\t\t\t? t(\"Aborted after {count} retry attempt\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t: t(\"Aborted after {count} retry attempts\", { count: retryAttempt })\n\t\t\t\t\t\t\t: t(\"Operation aborted\");\n\t\t\t\t\thost.streamingMessage.errorMessage = errorMessage;\n\t\t\t\t}\n\t\t\t\thost.streamingComponent.updateContent(host.streamingMessage, false);\n\n\t\t\t\tif (host.streamingMessage.stopReason === \"aborted\" || host.streamingMessage.stopReason === \"error\") {\n\t\t\t\t\tif (!errorMessage) {\n\t\t\t\t\t\terrorMessage = host.streamingMessage.errorMessage || t(\"Error\");\n\t\t\t\t\t}\n\t\t\t\t\tfor (const [, component] of host.pendingTools.entries()) {\n\t\t\t\t\t\tcomponent.updateResult({\n\t\t\t\t\t\t\tcontent: [{ type: \"text\", text: errorMessage }],\n\t\t\t\t\t\t\tisError: true,\n\t\t\t\t\t\t});\n\t\t\t\t\t\thost.activeToolRunGroup?.noteResult(true);\n\t\t\t\t\t}\n\t\t\t\t\t// No tool execution follows an aborted/errored message:\n\t\t\t\t\t// finalize the group marker here.\n\t\t\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\t\t\thost.pendingTools.clear();\n\t\t\t\t} else {\n\t\t\t\t\t// Args are now complete - trigger diff computation for edit tools\n\t\t\t\t\tfor (const [, component] of host.pendingTools.entries()) {\n\t\t\t\t\t\tcomponent.setArgsComplete();\n\t\t\t\t\t}\n\t\t\t\t\thost.maybeShowThinkingDropNotice(host.streamingMessage);\n\t\t\t\t\thost.maybeShowCacheMissNotice(host.streamingMessage);\n\t\t\t\t}\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t\t// D-083: a toolUse stop reason is followed by tool execution\n\t\t\t\t// events (start/end arrive after message_end — the session\n\t\t\t\t// executes tools once the streamed message completes), so the\n\t\t\t\t// group stays open for setActiveTool/noteResult here and is\n\t\t\t\t// finalized at agent_end / the next message_start.\n\t\t\t\thost.footer.invalidate();\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"bash_execution_update\":\n\t\t\t// The bash execution callback handles TUI output rendering.\n\t\t\tbreak;\n\n\t\tcase \"tool_execution_start\": {\n\t\t\tlet component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (!component) {\n\t\t\t\tcomponent = new ToolExecutionComponent(\n\t\t\t\t\tevent.toolName,\n\t\t\t\t\tevent.toolCallId,\n\t\t\t\t\tevent.args,\n\t\t\t\t\t{\n\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t},\n\t\t\t\t\thost.getRegisteredToolDefinition(event.toolName),\n\t\t\t\t\thost.ui,\n\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t);\n\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\thost.addToolToRunGroup(component, {\n\t\t\t\t\tmessageComponent: host.streamingComponent,\n\t\t\t\t\tmessage: host.streamingMessage,\n\t\t\t\t});\n\t\t\t\thost.pendingTools.set(event.toolCallId, component);\n\t\t\t}\n\t\t\tcomponent.markExecutionStarted();\n\t\t\thost.activeToolRunGroup?.startClock();\n\t\t\thost.activeToolRunGroup?.setActiveTool(event.toolName, component);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_update\": {\n\t\t\tconst component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.partialResult, isError: false }, true);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"tool_execution_end\": {\n\t\t\tconst component = host.pendingTools.get(event.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult({ ...event.result, isError: event.isError });\n\t\t\t\thost.activeToolRunGroup?.noteResult(event.isError);\n\t\t\t\thost.pendingTools.delete(event.toolCallId);\n\t\t\t\thost.ui.requestRender();\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"capability_command_result\": {\n\t\t\tconst links = event.result.links?.map((link) => `${link.label}: ${link.url}`) ?? [];\n\t\t\tconst message = [event.result.message, ...links].filter(Boolean).join(\"\\n\");\n\t\t\tif (event.result.status === \"error\") host.showError(message);\n\t\t\telse host.showStatus(message);\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"agent_end\":\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(false);\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"working\");\n\t\t\tif (host.streamingComponent) {\n\t\t\t\thost.chatContainer.removeChild(host.streamingComponent);\n\t\t\t\thost.streamingComponent = undefined;\n\t\t\t\thost.streamingMessage = undefined;\n\t\t\t}\n\t\t\thost.pendingTools.clear();\n\t\t\t// D-083: the whole agent turn (messages + tool executions) is\n\t\t\t// over — finalize the last group's marker (count/sole-tool name\n\t\t\t// + failure count + wall-clock duration). Completed groups stay\n\t\t\t// in the transcript and stay mergeable for an adjacent next run.\n\t\t\thost.lastCompletedToolRunGroup = host.activeToolRunGroup;\n\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\thost.activeToolRunGroup = undefined;\n\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\n\t\tcase \"agent_settled\":\n\t\t\tawait host.checkShutdownRequested();\n\t\t\tbreak;\n\n\t\tcase \"compaction_start\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(true);\n\t\t\t}\n\t\t\t// Keep editor active; submissions are queued during compaction.\n\t\t\thost.autoCompactionEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => {\n\t\t\t\thost.facade.abortCompaction();\n\t\t\t};\n\t\t\thost.showStatusIndicator(new CompactionStatusIndicator(host.ui, event.reason));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_end\": {\n\t\t\tif (host.settingsManager.getShowTerminalProgress()) {\n\t\t\t\thost.ui.terminal.setProgress(false);\n\t\t\t}\n\t\t\tif (host.autoCompactionEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.autoCompactionEscapeHandler;\n\t\t\t\thost.autoCompactionEscapeHandler = undefined;\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"compaction\");\n\t\t\tif (event.aborted) {\n\t\t\t\tif (event.reason === \"manual\") {\n\t\t\t\t\thost.showError(t(\"Compaction cancelled\"));\n\t\t\t\t} else {\n\t\t\t\t\thost.showStatus(t(\"Auto-compaction cancelled\"));\n\t\t\t\t}\n\t\t\t} else if (event.result) {\n\t\t\t\tconst entries = host.facade.getContextEntries();\n\t\t\t\tif (entries[0]?.type !== \"compaction\") {\n\t\t\t\t\tthrow new Error(t(\"Completed compaction is missing from the session context\"));\n\t\t\t\t}\n\t\t\t\thost.chatContainer.clear();\n\t\t\t\t// The latest compaction is prepended for model context; append it below at its chronological position.\n\t\t\t\thost.renderSessionEntries(entries.slice(1));\n\t\t\t\thost.addMessageToChat(\n\t\t\t\t\tcreateCompactionSummaryMessage(\n\t\t\t\t\t\tevent.result.summary,\n\t\t\t\t\t\tevent.result.tokensBefore,\n\t\t\t\t\t\tnew Date().toISOString(),\n\t\t\t\t\t),\n\t\t\t\t);\n\t\t\t\tif (event.result.usage) {\n\t\t\t\t\thost.addCompactionCostNotice({\n\t\t\t\t\t\ttype: \"compaction_cost\",\n\t\t\t\t\t\tkind: \"compaction\",\n\t\t\t\t\t\tusage: event.result.usage,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t\thost.footer.invalidate();\n\t\t\t} else if (event.errorMessage) {\n\t\t\t\tif (event.reason === \"manual\") {\n\t\t\t\t\thost.showError(event.errorMessage);\n\t\t\t\t} else {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\thost.chatContainer.addChild(new Text(theme.fg(\"error\", event.errorMessage), 1, 0));\n\t\t\t\t}\n\t\t\t}\n\t\t\tvoid host.flushCompactionQueue({ willRetry: event.willRetry });\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"compaction_skipped\": {\n\t\t\thost.showStatus(t(\"Auto-compaction skipped: nothing to compact\"));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_start\": {\n\t\t\t// Set up escape to abort retry\n\t\t\thost.retryEscapeHandler = host.defaultEditor.onEscape;\n\t\t\thost.defaultEditor.onEscape = () => {\n\t\t\t\thost.facade.abortRetry();\n\t\t\t};\n\t\t\thost.showStatusIndicator(new RetryStatusIndicator(host.ui, event.attempt, event.maxAttempts, event.delayMs));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"auto_retry_end\": {\n\t\t\t// Restore escape handler\n\t\t\tif (host.retryEscapeHandler) {\n\t\t\t\thost.defaultEditor.onEscape = host.retryEscapeHandler;\n\t\t\t\thost.retryEscapeHandler = undefined;\n\t\t\t}\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\t// Show error only on final failure (success shows normal response)\n\t\t\tif (!event.success) {\n\t\t\t\thost.showError(\n\t\t\t\t\tt(\"Retry failed after {count} attempts: {error}\", {\n\t\t\t\t\t\tcount: event.attempt,\n\t\t\t\t\t\terror: event.finalError || t(\"Unknown error\"),\n\t\t\t\t\t}),\n\t\t\t\t);\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_scheduled\": {\n\t\t\thost.showError(event.errorMessage);\n\t\t\thost.showStatusIndicator(new RetryStatusIndicator(host.ui, event.attempt, event.maxAttempts, event.delayMs));\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_attempt_start\": {\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\tif (event.source === \"branchSummary\") {\n\t\t\t\thost.showStatusIndicator(new BranchSummaryStatusIndicator(host.ui));\n\t\t\t} else {\n\t\t\t\thost.showStatusIndicator(new CompactionStatusIndicator(host.ui, event.reason));\n\t\t\t}\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\n\t\tcase \"summarization_retry_finished\": {\n\t\t\thost.clearStatusIndicator(\"retry\");\n\t\t\thost.ui.requestRender();\n\t\t\tbreak;\n\t\t}\n\t}\n}\n\n/** Extract text content from a user message */\nexport function getUserMessageText(message: Message): string {\n\tif (message.role !== \"user\") return \"\";\n\tconst textBlocks =\n\t\ttypeof message.content === \"string\"\n\t\t\t? [{ type: \"text\", text: message.content }]\n\t\t\t: message.content.filter((c: { type: string }) => c.type === \"text\");\n\treturn textBlocks.map((c) => (c as { text: string }).text).join(\"\");\n}\n\nexport function addMessageToChat(\n\thost: EventsHost,\n\tmessage: AgentMessage,\n\toptions?: { populateHistory?: boolean },\n): void {\n\tswitch (message.role) {\n\t\tcase \"bashExecution\": {\n\t\t\tconst component = new BashExecutionComponent(message.command, host.ui, message.excludeFromContext);\n\t\t\tif (message.output) {\n\t\t\t\tcomponent.appendOutput(message.output);\n\t\t\t}\n\t\t\tcomponent.setComplete(\n\t\t\t\tmessage.exitCode,\n\t\t\t\tmessage.cancelled,\n\t\t\t\tmessage.truncated ? ({ truncated: true } as TruncationResult) : undefined,\n\t\t\t\tmessage.fullOutputPath,\n\t\t\t);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"custom\": {\n\t\t\tif (message.display) {\n\t\t\t\tconst renderer = undefined;\n\t\t\t\tconst component = new CustomMessageComponent(\n\t\t\t\t\tmessage,\n\t\t\t\t\trenderer,\n\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\thost.outputPad,\n\t\t\t\t);\n\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\thost.chatContainer.addChild(component);\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"compactionSummary\": {\n\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\tconst component = new CompactionSummaryMessageComponent(message, host.getMarkdownThemeWithSettings());\n\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"branchSummary\": {\n\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\tconst component = new BranchSummaryMessageComponent(message, host.getMarkdownThemeWithSettings());\n\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\thost.chatContainer.addChild(component);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"user\": {\n\t\t\tconst textContent = host.getUserMessageText(message);\n\t\t\tif (textContent) {\n\t\t\t\tif (host.chatContainer.children.length > 0) {\n\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t}\n\t\t\t\tconst skillBlock = parseSkillBlock(textContent);\n\t\t\t\tif (skillBlock) {\n\t\t\t\t\t// Render skill block (collapsible)\n\t\t\t\t\tconst component = new SkillInvocationMessageComponent(skillBlock, host.getMarkdownThemeWithSettings());\n\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\thost.chatContainer.addChild(component);\n\t\t\t\t\t// Render user message separately if present\n\t\t\t\t\tif (skillBlock.userMessage) {\n\t\t\t\t\t\thost.chatContainer.addChild(new Spacer(1));\n\t\t\t\t\t\tconst userComponent = new UserMessageComponent(\n\t\t\t\t\t\t\tskillBlock.userMessage,\n\t\t\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\t\t\thost.outputPad,\n\t\t\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t\t\t);\n\t\t\t\t\t\thost.chatContainer.addChild(userComponent);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tconst userComponent = new UserMessageComponent(\n\t\t\t\t\t\ttextContent,\n\t\t\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\t\t\thost.outputPad,\n\t\t\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t\t\t);\n\t\t\t\t\thost.chatContainer.addChild(userComponent);\n\t\t\t\t}\n\t\t\t\tif (options?.populateHistory) {\n\t\t\t\t\thost.editor.addToHistory?.(textContent);\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t}\n\t\tcase \"assistant\": {\n\t\t\tconst assistantComponent = new AssistantMessageComponent(\n\t\t\t\tmessage,\n\t\t\t\thost.hideThinkingBlock,\n\t\t\t\thost.getMarkdownThemeWithSettings(),\n\t\t\t\thost.hiddenThinkingLabel,\n\t\t\t\thost.outputPad,\n\t\t\t\thost.getMarkdownTransformers(),\n\t\t\t);\n\t\t\t// D-083: restored/finished-turn thinking must follow detail mode\n\t\t\t// (ctrl+o) — the setToolsExpanded loop only reaches children on\n\t\t\t// toggle, not components created while already expanded.\n\t\t\tif (host.toolOutputExpanded) {\n\t\t\t\tassistantComponent.setExpanded(true);\n\t\t\t}\n\t\t\thost.chatContainer.addChild(assistantComponent);\n\t\t\tbreak;\n\t\t}\n\t\tcase \"toolResult\": {\n\t\t\t// Tool results are rendered inline with tool calls, handled separately\n\t\t\tbreak;\n\t\t}\n\t\tdefault: {\n\t\t\t// v8 ignore next -- exhaustive over AgentMessage roles\n\t\t\tconst _exhaustive: never = message;\n\t\t}\n\t}\n}\n\nexport function renderSessionItems(\n\thost: EventsHost,\n\titems: readonly RenderSessionItem[],\n\toptions: { updateFooter?: boolean; populateHistory?: boolean } = {},\n): void {\n\thost.pendingTools.clear();\n\tconst renderedPendingTools = new Map<string, ToolExecutionComponent>();\n\t// Cache-miss notices are not persisted; re-derive them from the full entry\n\t// list and re-inject them after the assistant messages that paid for them.\n\tconst cacheMisses = host.settingsManager.getShowCacheMissNotices()\n\t\t? collectCacheMisses(host.facade.getEntries(), host.facade.getModelPriceSource())\n\t\t: new Map<AssistantMessage, CacheMiss>();\n\n\tif (options.updateFooter) {\n\t\thost.footer.invalidate();\n\t\thost.updateEditorBorderColor();\n\t}\n\n\tfor (const item of items) {\n\t\tif (isCustomSessionEntry(item)) {\n\t\t\t// No entry renderer source since the legacy extension surface was\n\t\t\t// removed; previously renderer-less entries were skipped as well.\n\t\t\tcontinue;\n\t\t}\n\t\tif (isCompactionCostNotice(item)) {\n\t\t\thost.addCompactionCostNotice(item);\n\t\t\tcontinue;\n\t\t}\n\n\t\tconst message = item;\n\t\t// Assistant messages need special handling for tool calls\n\t\tif (message.role === \"assistant\") {\n\t\t\thost.addMessageToChat(message);\n\t\t\t// The assistant face of addMessageToChat mounts exactly one\n\t\t\t// component: the message the merge tail check (跨回合合并) compares\n\t\t\t// against the previous group's neighbor slot.\n\t\t\tconst messageComponent = host.chatContainer.children[host.chatContainer.children.length - 1];\n\t\t\t// No message_start on the restore path: reset the group pointer\n\t\t\t// so each assistant message forms its own tool-run group (D-083).\n\t\t\t// Seal first: a mid-run rebuild (settings dialog / branch switch)\n\t\t\t// drops the old transcript, and an unsealed group would keep its\n\t\t\t// spinner interval spinning with no render path left.\n\t\t\thost.lastCompletedToolRunGroup = host.activeToolRunGroup;\n\t\t\thost.activeToolRunGroup?.markRunComplete();\n\t\t\thost.activeToolRunGroup = undefined;\n\t\t\t// Render tool call components\n\t\t\tfor (const content of message.content) {\n\t\t\t\tif (content.type === \"toolCall\") {\n\t\t\t\t\tconst component = new ToolExecutionComponent(\n\t\t\t\t\t\tcontent.name,\n\t\t\t\t\t\tcontent.id,\n\t\t\t\t\t\tcontent.arguments,\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tshowImages: host.settingsManager.getShowImages(),\n\t\t\t\t\t\t\timageWidthCells: host.settingsManager.getImageWidthCells(),\n\t\t\t\t\t\t},\n\t\t\t\t\t\thost.getRegisteredToolDefinition(content.name),\n\t\t\t\t\t\thost.ui,\n\t\t\t\t\t\thost.facade.getCwd(),\n\t\t\t\t\t);\n\t\t\t\t\tcomponent.setExpanded(host.toolOutputExpanded);\n\t\t\t\t\thost.addToolToRunGroup(component, { messageComponent, message });\n\n\t\t\t\t\tif (message.stopReason === \"aborted\" || message.stopReason === \"error\") {\n\t\t\t\t\t\tlet errorMessage: string;\n\t\t\t\t\t\tif (message.stopReason === \"aborted\") {\n\t\t\t\t\t\t\tconst retryAttempt = host.facade.getRetryAttempt();\n\t\t\t\t\t\t\terrorMessage =\n\t\t\t\t\t\t\t\tretryAttempt > 0\n\t\t\t\t\t\t\t\t\t? retryAttempt === 1\n\t\t\t\t\t\t\t\t\t\t? t(\"Aborted after {count} retry attempt\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t\t\t: t(\"Aborted after {count} retry attempts\", { count: retryAttempt })\n\t\t\t\t\t\t\t\t\t: t(\"Operation aborted\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\terrorMessage = message.errorMessage || t(\"Error\");\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcomponent.updateResult({ content: [{ type: \"text\", text: errorMessage }], isError: true });\n\t\t\t\t\t\thost.noteResultInActiveToolRunGroup(true);\n\t\t\t\t\t} else {\n\t\t\t\t\t\trenderedPendingTools.set(content.id, component);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\thost.markActiveToolRunGroupComplete();\n\t\t\tif (message.stopReason !== \"aborted\" && message.stopReason !== \"error\") {\n\t\t\t\tconst miss = cacheMisses.get(message);\n\t\t\t\tif (miss) host.addCacheMissNotice(miss);\n\t\t\t}\n\t\t} else if (message.role === \"toolResult\") {\n\t\t\t// Match tool results to pending tool components\n\t\t\tconst component = renderedPendingTools.get(message.toolCallId);\n\t\t\tif (component) {\n\t\t\t\tcomponent.updateResult(message);\n\t\t\t\t// Failure never goes silent (D-083): count it on the group\n\t\t\t\t// the restored tool call belongs to.\n\t\t\t\thost.noteResultInActiveToolRunGroup(message.isError);\n\t\t\t\trenderedPendingTools.delete(message.toolCallId);\n\t\t\t}\n\t\t} else {\n\t\t\t// All other messages use standard rendering\n\t\t\thost.addMessageToChat(message, options);\n\t\t}\n\t}\n\n\tfor (const [toolCallId, component] of renderedPendingTools) {\n\t\thost.pendingTools.set(toolCallId, component);\n\t}\n\t// Groups stay in the transcript; reset the pointer so a live turn\n\t// starts a fresh group (D-083). The sealed last group stays mergeable;\n\t// sealing first also stops any spinner interval left mid-run.\n\thost.lastCompletedToolRunGroup = host.activeToolRunGroup;\n\thost.activeToolRunGroup?.markRunComplete();\n\thost.activeToolRunGroup = undefined;\n\thost.ui.requestRender();\n}\n\n/**\n * Render session entries to chat. Used for initial load and rebuild after compaction.\n * @param entries Compaction-aware session entries to render\n * @param options.updateFooter Update footer state\n * @param options.populateHistory Add user messages to editor history\n */\nexport function renderSessionEntries(\n\thost: EventsHost,\n\tentries: SessionEntry[],\n\toptions: { updateFooter?: boolean; populateHistory?: boolean } = {},\n): void {\n\tconst items = entries.flatMap((entry): RenderSessionItem[] => {\n\t\tif (entry.type === \"custom\") {\n\t\t\treturn [entry];\n\t\t}\n\t\tconst messages = sessionEntryToContextMessages(entry);\n\t\tif ((entry.type === \"compaction\" || entry.type === \"branch_summary\") && entry.usage && messages.length > 0) {\n\t\t\treturn [...messages, { type: \"compaction_cost\", kind: entry.type, usage: entry.usage }];\n\t\t}\n\t\treturn messages;\n\t});\n\thost.renderSessionItems(items, options);\n}\n\n/**\n * Render billing usage for a compaction or branch summary. The notice is derived\n * from persisted summary usage and is not stored as a separate session entry.\n */\nexport function addCompactionCostNotice(host: EventsHost, notice: CompactionCostNotice): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\tconst { usage } = notice;\n\tconst tokens = usage.input + usage.output + usage.cacheRead + usage.cacheWrite;\n\tconst cost = usage.cost.total >= 0.01 ? ` (~$${usage.cost.total.toFixed(2)})` : \"\";\n\tconst label = notice.kind === \"compaction\" ? t(\"Compaction\") : t(\"Branch summary\");\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(\n\t\t\ttheme.fg(\"warning\", `${label}: ${t(\"{tokens} tokens billed{cost}\", { tokens: formatTokens(tokens), cost })}`),\n\t\t\t1,\n\t\t\t0,\n\t\t),\n\t);\n}\n\nfunction countDroppedThinkingBlocks(message: AssistantMessage): number {\n\tlet count = 0;\n\tfor (const diagnostic of message.diagnostics ?? []) {\n\t\tif (diagnostic.type !== \"anthropic_input_transformations\") continue;\n\t\tconst transformations = diagnostic.details?.transformations;\n\t\tif (!Array.isArray(transformations)) continue;\n\t\tcount += transformations.filter(\n\t\t\t(transformation) =>\n\t\t\t\ttypeof transformation === \"object\" &&\n\t\t\t\ttransformation !== null &&\n\t\t\t\t(transformation as Record<string, unknown>).type === \"thinking_dropped\",\n\t\t).length;\n\t}\n\treturn count;\n}\n\nexport function maybeShowThinkingDropNotice(host: EventsHost, message: AssistantMessage): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\tconst droppedCount = countDroppedThinkingBlocks(message);\n\tif (droppedCount === 0) return;\n\n\tlet previousDroppedCount = 0;\n\t// message_end reaches the UI before the current message is persisted,\n\t// so the branch's last assistant message is the previous response.\n\tconst entries = host.facade.getEntries();\n\tfor (let i = entries.length - 1; i >= 0; i--) {\n\t\tconst entry = entries[i];\n\t\tif (entry.type === \"message\" && entry.message.role === \"assistant\") {\n\t\t\tpreviousDroppedCount = countDroppedThinkingBlocks(entry.message);\n\t\t\tbreak;\n\t\t}\n\t}\n\tif (droppedCount <= previousDroppedCount) return;\n\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(\n\t\tnew Text(\n\t\t\ttheme.fg(\n\t\t\t\t\"warning\",\n\t\t\t\tt(\"Anthropic dropped {count} thinking blocks (details in session)\", { count: droppedCount }),\n\t\t\t),\n\t\t\t1,\n\t\t\t0,\n\t\t),\n\t);\n}\n\n/**\n * Show a transcript notice when a completed assistant message paid for a\n * significant cache miss. Only states observable facts: the miss itself,\n * a model switch, or an idle gap past the cache TTL.\n */\nexport function maybeShowCacheMissNotice(host: EventsHost, message: AssistantMessage): void {\n\tif (!host.settingsManager.getShowCacheMissNotices()) return;\n\n\t// Entries don't contain `message` yet: message_end fires before persistence.\n\tconst miss = detectCacheMiss(host.facade.getEntries(), message, host.facade.getModelPriceSource());\n\tif (miss) host.addCacheMissNotice(miss);\n}\n\nexport function addCacheMissNotice(host: EventsHost, miss: CacheMiss): void {\n\tif (miss.missedTokens < 20_000 && miss.missedCost < 0.1) return;\n\n\tconst cost = miss.missedCost >= 0.01 ? ` (~$${miss.missedCost.toFixed(2)})` : \"\";\n\tconst reBilled = t(\"{tokens} tokens re-billed{cost}\", { tokens: formatTokens(miss.missedTokens), cost });\n\tlet label = t(\"Cache miss\");\n\tif (miss.modelChanged) {\n\t\tlabel = t(\"Cache miss after model switch\");\n\t} else if (miss.idleMs >= CACHE_TTL_MS) {\n\t\tlabel = t(\"Cache miss after {minutes}m idle\", { minutes: Math.round(miss.idleMs / 60_000) });\n\t}\n\tconst text = theme.fg(\"warning\", `${label}: ${reBilled}`);\n\thost.chatContainer.addChild(new Spacer(1));\n\thost.chatContainer.addChild(new Text(text, 1, 0));\n}\n\nexport function renderInitialMessages(host: EventsHost): void {\n\tconst entries = host.facade.getContextEntries();\n\thost.renderSessionEntries(entries, {\n\t\tupdateFooter: true,\n\t\tpopulateHistory: true,\n\t});\n\t// Show compaction info if session was compacted\n\tconst allEntries = host.facade.getEntries();\n\tconst compactionCount = allEntries.filter((e) => e.type === \"compaction\").length;\n\tif (compactionCount > 0) {\n\t\thost.showStatus(\n\t\t\tcompactionCount === 1\n\t\t\t\t? t(\"Session compacted {count} time\", { count: compactionCount })\n\t\t\t\t: t(\"Session compacted {count} times\", { count: compactionCount }),\n\t\t);\n\t}\n}\n\nexport function rebuildChatFromMessages(host: EventsHost): void {\n\thost.chatContainer.clear();\n\thost.renderSessionEntries(host.facade.getContextEntries());\n}\n\nexport function getRegisteredToolDefinition(host: EventsHost, toolName: string) {\n\treturn host.facade.getToolDefinition(toolName);\n}\n\nexport function getMarkdownTransformers(host: EventsHost): MarkdownTransformer[] {\n\treturn [host.mermaidMarkdownTransformer];\n}\n\n/**\n * D-083 quiet transcript: mount a tool component into the current\n * assistant turn's tool-run group (creating the group on first tool of\n * the turn) instead of the chat container directly. Collapsed groups\n * render one dim marker line for the whole turn. When the previous run's\n * group sits directly ahead of this message with no visible content in\n * between, the run merges into it (跨回合合并) instead of opening a new group.\n */\nexport function addToolToRunGroup(\n\thost: EventsHost,\n\tcomponent: ToolExecutionComponent,\n\tctx?: { messageComponent?: Component; message?: AssistantMessage },\n): void {\n\tif (!host.activeToolRunGroup) {\n\t\tconst merged = tryMergeIntoPreviousGroup(host, ctx?.messageComponent, ctx?.message);\n\t\tif (merged) {\n\t\t\thost.activeToolRunGroup = merged;\n\t\t} else {\n\t\t\thost.activeToolRunGroup = new ToolRunGroupComponent(host.ui);\n\t\t\thost.activeToolRunGroup.setExpanded(host.toolOutputExpanded);\n\t\t\thost.chatContainer.addChild(host.activeToolRunGroup);\n\t\t}\n\t}\n\thost.activeToolRunGroup.addTool(component);\n}\n\n/**\n * D-083 跨回合合并: a sealed group reopens for the next run while every\n * component inserted after it is visually empty — leftover tool-only\n * assistant message components render zero lines, so a chain of merged runs\n * accumulates them between the group and the current message component.\n * Scanning back over empty renderers keeps the merge working for consecutive\n * tool-only turns while any visible insertion (user message, status line,\n * notice) still fails it. A message that already carries visible\n * text/thinking never merges: its own group must stay visually separated\n * from the previous run.\n */\nfunction tryMergeIntoPreviousGroup(\n\thost: EventsHost,\n\tmessageComponent: Component | undefined,\n\tmessage: AssistantMessage | undefined,\n): ToolRunGroupComponent | undefined {\n\tconst previous = host.lastCompletedToolRunGroup;\n\tif (!previous) {\n\t\treturn undefined;\n\t}\n\tconst children = host.chatContainer.children;\n\tif (messageComponent === undefined || children[children.length - 1] !== messageComponent) {\n\t\treturn undefined;\n\t}\n\tif (message !== undefined && assistantMessageHasVisibleContent(message)) {\n\t\treturn undefined;\n\t}\n\tfor (let i = children.length - 2; i >= 0; i--) {\n\t\tconst child = children[i];\n\t\tif (child === previous) {\n\t\t\tprevious.reopen();\n\t\t\treturn previous;\n\t\t}\n\t\tif (!componentRendersVisuallyEmpty(child)) {\n\t\t\treturn undefined;\n\t\t}\n\t}\n\treturn undefined;\n}\n\n/**\n * Merge-scan face for \"nothing the user can see\": a component whose render is\n * empty or whitespace/ANSI-only contributes no visible transcript content.\n * Width only affects wrapping, never emptiness, so a fixed probe width is\n * sufficient. Container render is a pure projection (cached per width), so\n * probing mid-event is side-effect free.\n */\nfunction componentRendersVisuallyEmpty(component: Component): boolean {\n\tconst ansiColorCodes = /\\x1b\\[[0-9;]*m/g;\n\treturn component.render(80).every((line) => line.replace(ansiColorCodes, \"\").trim() === \"\");\n}\n\n/** Same visible-content judgment as AssistantMessageComponent (text/thinking). */\nfunction assistantMessageHasVisibleContent(message: AssistantMessage): boolean {\n\treturn message.content.some(\n\t\t(c) => (c.type === \"text\" && c.text.trim()) || (c.type === \"thinking\" && c.thinking.trim()),\n\t);\n}\n\n/**\n * Narrowing-safe faces for the active group inside renderSessionItems:\n * addToolToRunGroup may (re)assign host.activeToolRunGroup behind the\n * compiler's back, so group reads go through methods instead of the\n * narrowed property reference.\n */\nexport function noteResultInActiveToolRunGroup(host: EventsHost, isError: boolean): void {\n\thost.activeToolRunGroup?.noteResult(isError);\n}\n\nexport function markActiveToolRunGroupComplete(host: EventsHost): void {\n\thost.lastCompletedToolRunGroup = host.activeToolRunGroup;\n\thost.activeToolRunGroup?.markRunComplete();\n}\n"]}
|
|
@@ -221,6 +221,8 @@ export declare class InteractiveMode implements DialogUiHost, authFlow.AuthUiHos
|
|
|
221
221
|
pendingTools: Map<string, ToolExecutionComponent>;
|
|
222
222
|
/** Host-visible for ./interactive-events.ts (拆分 slice 5). */
|
|
223
223
|
activeToolRunGroup: ToolRunGroupComponent | undefined;
|
|
224
|
+
/** Host-visible for ./interactive-events.ts (拆分 slice 5). */
|
|
225
|
+
lastCompletedToolRunGroup: ToolRunGroupComponent | undefined;
|
|
224
226
|
/** Host-visible for ./interactive-dialog-ui.ts (S5 slice 2). */
|
|
225
227
|
toolOutputExpanded: boolean;
|
|
226
228
|
/** Host-visible for ./interactive-commands.ts (拆分 slice 1). */
|
|
@@ -554,7 +556,10 @@ export declare class InteractiveMode implements DialogUiHost, authFlow.AuthUiHos
|
|
|
554
556
|
* Host-visible for ./interactive-events.ts (拆分 slice 5); implementation in
|
|
555
557
|
* ./interactive-events.ts.
|
|
556
558
|
*/
|
|
557
|
-
addToolToRunGroup(component: ToolExecutionComponent
|
|
559
|
+
addToolToRunGroup(component: ToolExecutionComponent, ctx?: {
|
|
560
|
+
messageComponent?: Component;
|
|
561
|
+
message?: AssistantMessage;
|
|
562
|
+
}): void;
|
|
558
563
|
/**
|
|
559
564
|
* Narrowing-safe faces for the active group inside renderSessionItems:
|
|
560
565
|
* addToolToRunGroup may (re)assign this.activeToolRunGroup behind the
|