@bastani/atomic 0.9.19-alpha.8 → 0.9.19

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.
Files changed (111) hide show
  1. package/CHANGELOG.md +105 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +38 -0
  3. package/dist/builtin/intercom/README.md +7 -7
  4. package/dist/builtin/intercom/broker/client.ts +4 -0
  5. package/dist/builtin/intercom/broker/send-handler.ts +18 -1
  6. package/dist/builtin/intercom/index.bundle.mjs +20 -17
  7. package/dist/builtin/intercom/package.json +1 -1
  8. package/dist/builtin/intercom/skills/intercom/SKILL.md +3 -3
  9. package/dist/builtin/intercom/types.ts +1 -1
  10. package/dist/builtin/mcp/CHANGELOG.md +8 -0
  11. package/dist/builtin/mcp/package.json +1 -1
  12. package/dist/builtin/subagents/CHANGELOG.md +30 -0
  13. package/dist/builtin/subagents/package.json +1 -1
  14. package/dist/builtin/web-access/CHANGELOG.md +20 -0
  15. package/dist/builtin/web-access/index.bundle.mjs +19 -17
  16. package/dist/builtin/web-access/package.json +1 -1
  17. package/dist/builtin/workflows/CHANGELOG.md +66 -0
  18. package/dist/builtin/workflows/package.json +1 -1
  19. package/dist/builtin/workflows/src/extension/index.bundle.mjs +324 -40
  20. package/dist/builtin/workflows/src/index.js +97 -18
  21. package/dist/core/extensions/api-types.d.ts +2 -0
  22. package/dist/core/extensions/api-types.d.ts.map +1 -1
  23. package/dist/core/extensions/api-types.js.map +1 -1
  24. package/dist/core/extensions/index.d.ts +1 -1
  25. package/dist/core/extensions/index.d.ts.map +1 -1
  26. package/dist/core/extensions/index.js.map +1 -1
  27. package/dist/core/extensions/loader-api.d.ts.map +1 -1
  28. package/dist/core/extensions/loader-api.js.map +1 -1
  29. package/dist/core/extensions/loader-host-modules.d.ts.map +1 -1
  30. package/dist/core/extensions/loader-host-modules.js +3 -1
  31. package/dist/core/extensions/loader-host-modules.js.map +1 -1
  32. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  33. package/dist/core/extensions/loader-virtual-modules.js +2 -0
  34. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  35. package/dist/core/extensions/reactive-widget.d.ts +6 -0
  36. package/dist/core/extensions/reactive-widget.d.ts.map +1 -1
  37. package/dist/core/extensions/reactive-widget.js +7 -1
  38. package/dist/core/extensions/reactive-widget.js.map +1 -1
  39. package/dist/core/extensions/runner-shortcuts.d.ts.map +1 -1
  40. package/dist/core/extensions/runner-shortcuts.js +32 -3
  41. package/dist/core/extensions/runner-shortcuts.js.map +1 -1
  42. package/dist/core/extensions/runtime-types.d.ts +4 -0
  43. package/dist/core/extensions/runtime-types.d.ts.map +1 -1
  44. package/dist/core/extensions/runtime-types.js.map +1 -1
  45. package/dist/core/extensions/ui-types.d.ts +20 -0
  46. package/dist/core/extensions/ui-types.d.ts.map +1 -1
  47. package/dist/core/extensions/ui-types.js.map +1 -1
  48. package/dist/core/keybinding-identity.d.ts +4 -0
  49. package/dist/core/keybinding-identity.d.ts.map +1 -0
  50. package/dist/core/keybinding-identity.js +10 -0
  51. package/dist/core/keybinding-identity.js.map +1 -0
  52. package/dist/core/keybindings.d.ts +10 -0
  53. package/dist/core/keybindings.d.ts.map +1 -1
  54. package/dist/core/keybindings.js +2 -0
  55. package/dist/core/keybindings.js.map +1 -1
  56. package/dist/core/tools/bash.d.ts.map +1 -1
  57. package/dist/core/tools/bash.js +7 -1
  58. package/dist/core/tools/bash.js.map +1 -1
  59. package/dist/index-extensions.d.ts +1 -1
  60. package/dist/index-extensions.d.ts.map +1 -1
  61. package/dist/index-extensions.js.map +1 -1
  62. package/dist/index.d.ts +1 -0
  63. package/dist/index.d.ts.map +1 -1
  64. package/dist/index.js +1 -0
  65. package/dist/index.js.map +1 -1
  66. package/dist/modes/interactive/components/scroll-widget.d.ts +23 -0
  67. package/dist/modes/interactive/components/scroll-widget.d.ts.map +1 -0
  68. package/dist/modes/interactive/components/scroll-widget.js +61 -0
  69. package/dist/modes/interactive/components/scroll-widget.js.map +1 -0
  70. package/dist/modes/interactive/interactive-extension-runtime.js +10 -3
  71. package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
  72. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  73. package/dist/modes/interactive/interactive-mode-base.js +3 -2
  74. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  75. package/dist/modes/interactive-engine/engine-custom-ui.d.ts +4 -1
  76. package/dist/modes/interactive-engine/engine-custom-ui.d.ts.map +1 -1
  77. package/dist/modes/interactive-engine/engine-custom-ui.js +15 -7
  78. package/dist/modes/interactive-engine/engine-custom-ui.js.map +1 -1
  79. package/dist/modes/interactive-engine/engine-dialog-host.d.ts.map +1 -1
  80. package/dist/modes/interactive-engine/engine-dialog-host.js +4 -1
  81. package/dist/modes/interactive-engine/engine-dialog-host.js.map +1 -1
  82. package/dist/modes/interactive-engine/extension-ui-bridge.d.ts.map +1 -1
  83. package/dist/modes/interactive-engine/extension-ui-bridge.js +1 -1
  84. package/dist/modes/interactive-engine/extension-ui-bridge.js.map +1 -1
  85. package/dist/modes/interactive-engine/protocol.d.ts +12 -1
  86. package/dist/modes/interactive-engine/protocol.d.ts.map +1 -1
  87. package/dist/modes/interactive-engine/protocol.js +45 -2
  88. package/dist/modes/interactive-engine/protocol.js.map +1 -1
  89. package/dist/modes/interactive-engine/remote-component.d.ts.map +1 -1
  90. package/dist/modes/interactive-engine/remote-component.js +18 -8
  91. package/dist/modes/interactive-engine/remote-component.js.map +1 -1
  92. package/dist/modes/rpc/rpc-extension-ui.d.ts.map +1 -1
  93. package/dist/modes/rpc/rpc-extension-ui.js +2 -1
  94. package/dist/modes/rpc/rpc-extension-ui.js.map +1 -1
  95. package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
  96. package/dist/modes/rpc/rpc-mode.js +1 -0
  97. package/dist/modes/rpc/rpc-mode.js.map +1 -1
  98. package/dist/modes/rpc/rpc-types.d.ts +4 -0
  99. package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
  100. package/dist/modes/rpc/rpc-types.js.map +1 -1
  101. package/docs/extensions/api-reference.md +2 -0
  102. package/docs/extensions/authoring.md +2 -0
  103. package/docs/intercom/reference.md +4 -0
  104. package/docs/intercom.md +4 -4
  105. package/docs/keybindings.md +17 -0
  106. package/docs/tui.md +34 -0
  107. package/docs/web-access.md +10 -0
  108. package/docs/workflows/api-reference.md +2 -0
  109. package/docs/workflows/operations.md +8 -0
  110. package/npm-shrinkwrap.json +32 -32
  111. package/package.json +3 -3
@@ -0,0 +1,61 @@
1
+ import { Container, ScrollView, VStack } from "@earendil-works/pi-tui";
2
+ import { LAYOUT_NODE } from "@earendil-works/pi-tui/dist/layout-node.js";
3
+ /** A native layout node, so the dock's final allocation also owns mouse bounds. */
4
+ export class ScrollWidget extends ScrollView {
5
+ get maxHeight() {
6
+ return this.heightCap();
7
+ }
8
+ constructor(widget, maxHeight, heightCap = () => maxHeight) {
9
+ super(widget, { overscroll: "contain", scrollbar: "auto" });
10
+ this.widget = widget;
11
+ this.heightCap = heightCap;
12
+ }
13
+ scrollBy(lines) {
14
+ super.scrollBy(lines);
15
+ // Native wheel routing forwards unused delta to the transcript even with contain.
16
+ // This opt-in viewport consumes it after native hit-testing and clamping.
17
+ return 0;
18
+ }
19
+ get isScrollbarVisible() {
20
+ return this.viewportHeight > 0 && (this.lastState?.contentHeight ?? 0) > this.viewportHeight;
21
+ }
22
+ updateLayout(contentHeight, viewportHeight, requestRender) {
23
+ super.updateLayout(contentHeight, viewportHeight, requestRender);
24
+ const request = this.widget.getScrollRequest?.();
25
+ if (request && (this.requestVersion === undefined || request.version > this.requestVersion)) {
26
+ this.requestVersion = request.version;
27
+ this.scrollTo(request.scrollTop);
28
+ }
29
+ const state = { scrollTop: this.scrollTop, viewportHeight: this.viewportHeight, contentHeight };
30
+ if (state.scrollTop !== this.lastState?.scrollTop ||
31
+ state.viewportHeight !== this.lastState?.viewportHeight ||
32
+ state.contentHeight !== this.lastState?.contentHeight) {
33
+ this.lastState = state;
34
+ this.widget.onScroll?.(state);
35
+ }
36
+ }
37
+ dispose() {
38
+ this.setScrollbar("hidden");
39
+ this.widget.dispose?.();
40
+ }
41
+ }
42
+ /** Leave legacy widgets opaque; opt-in children expose native dock layout. */
43
+ export class WidgetContainer extends Container {
44
+ scrollStack() {
45
+ if (!this.children.some((child) => child instanceof ScrollWidget))
46
+ return undefined;
47
+ return new VStack(this.children.map((component) => ({
48
+ component,
49
+ ...(component instanceof ScrollWidget
50
+ ? { maxSize: component.maxHeight, shrink: 1, minSize: 0 }
51
+ : { shrink: 0 }),
52
+ })));
53
+ }
54
+ [LAYOUT_NODE]() {
55
+ return this.scrollStack()?.[LAYOUT_NODE]();
56
+ }
57
+ render(width) {
58
+ return this.scrollStack()?.render(width) ?? super.render(width);
59
+ }
60
+ }
61
+ //# sourceMappingURL=scroll-widget.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"scroll-widget.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/scroll-widget.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AACvE,OAAO,EAAE,WAAW,EAAwB,MAAM,4CAA4C,CAAC;AAG/F,mFAAmF;AACnF,MAAM,OAAO,YAAa,SAAQ,UAAU;IAM3C,IAAI,SAAS;QACZ,OAAO,IAAI,CAAC,SAAS,EAAE,CAAC;IACzB,CAAC;IAED,YAAY,MAAiC,EAAE,SAAiB,EAAE,SAAS,GAAiB,GAAG,EAAE,CAAC,SAAS;QAC1G,KAAK,CAAC,MAAM,EAAE,EAAE,UAAU,EAAE,SAAS,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC,CAAC;QAC5D,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC5B,CAAC;IAEQ,QAAQ,CAAC,KAAa;QAC9B,KAAK,CAAC,QAAQ,CAAC,KAA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AM,CAAC,OAAO,EAAE,EAAE,CAAC;IACzB,CAAC;CACD;AAED,8EAA8E;AAC9E,MAAM,OAAO,eAAgB,SAAQ,SAAS;IACrC,WAAW;QAClB,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,YAAY,YAAY,CAAC;YAAE,OAAO,SAAS,CAAC;QACpF,OAAO,IAAI,MAAM,CAChB,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;YACjC,SAAS;YACT,GAAG,CAAC,SAAS,YAAY,YAAY;gBACpC,CAAC,CAAC,EAAE,OAAO,EAAE,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,CAAC,EAAE,OAAO,EAAE,CAAC,EAAE;gBACzD,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC;SACjB,CAAC,CAAC,CACH,CAAC;IACH,CAAC;IAED,CAAC,WAAW,CAAC;QACZ,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,CAAC,WAAW,CAAC,EAAE,CAAC;IAC5C,CAAC;IAEQ,MAAM,CAAC,KAAa;QAC5B,OAAO,IAAI,CAAC,WAAW,EAAE,EAAE,MAAM,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjE,CAAC;CACD","sourcesContent":["import { Container, ScrollView, VStack } from \"@earendil-works/pi-tui\";\nimport { LAYOUT_NODE, type StackLayoutNode } from \"@earendil-works/pi-tui/dist/layout-node.js\";\nimport type { ScrollableWidgetComponent, WidgetScrollState } from \"../../../core/extensions/ui-types.ts\";\n\n/** A native layout node, so the dock's final allocation also owns mouse bounds. */\nexport class ScrollWidget extends ScrollView {\n\tprivate lastState: WidgetScrollState | undefined;\n\tprivate requestVersion: number | undefined;\n\n\tprivate readonly widget: ScrollableWidgetComponent;\n\tprivate readonly heightCap: () => number;\n\tget maxHeight(): number {\n\t\treturn this.heightCap();\n\t}\n\n\tconstructor(widget: ScrollableWidgetComponent, maxHeight: number, heightCap: () => number = () => maxHeight) {\n\t\tsuper(widget, { overscroll: \"contain\", scrollbar: \"auto\" });\n\t\tthis.widget = widget;\n\t\tthis.heightCap = heightCap;\n\t}\n\n\toverride scrollBy(lines: number): number {\n\t\tsuper.scrollBy(lines);\n\t\t// Native wheel routing forwards unused delta to the transcript even with contain.\n\t\t// This opt-in viewport consumes it after native hit-testing and clamping.\n\t\treturn 0;\n\t}\n\n\toverride get isScrollbarVisible(): boolean {\n\t\treturn this.viewportHeight > 0 && (this.lastState?.contentHeight ?? 0) > this.viewportHeight;\n\t}\n\n\toverride updateLayout(contentHeight: number, viewportHeight: number, requestRender: () => void): void {\n\t\tsuper.updateLayout(contentHeight, viewportHeight, requestRender);\n\t\tconst request = this.widget.getScrollRequest?.();\n\t\tif (request && (this.requestVersion === undefined || request.version > this.requestVersion)) {\n\t\t\tthis.requestVersion = request.version;\n\t\t\tthis.scrollTo(request.scrollTop);\n\t\t}\n\t\tconst state = { scrollTop: this.scrollTop, viewportHeight: this.viewportHeight, contentHeight };\n\t\tif (\n\t\t\tstate.scrollTop !== this.lastState?.scrollTop ||\n\t\t\tstate.viewportHeight !== this.lastState?.viewportHeight ||\n\t\t\tstate.contentHeight !== this.lastState?.contentHeight\n\t\t) {\n\t\t\tthis.lastState = state;\n\t\t\tthis.widget.onScroll?.(state);\n\t\t}\n\t}\n\n\tdispose(): void {\n\t\tthis.setScrollbar(\"hidden\");\n\t\tthis.widget.dispose?.();\n\t}\n}\n\n/** Leave legacy widgets opaque; opt-in children expose native dock layout. */\nexport class WidgetContainer extends Container {\n\tprivate scrollStack(): VStack | undefined {\n\t\tif (!this.children.some((child) => child instanceof ScrollWidget)) return undefined;\n\t\treturn new VStack(\n\t\t\tthis.children.map((component) => ({\n\t\t\t\tcomponent,\n\t\t\t\t...(component instanceof ScrollWidget\n\t\t\t\t\t? { maxSize: component.maxHeight, shrink: 1, minSize: 0 }\n\t\t\t\t\t: { shrink: 0 }),\n\t\t\t})),\n\t\t);\n\t}\n\n\t[LAYOUT_NODE](): StackLayoutNode | undefined {\n\t\treturn this.scrollStack()?.[LAYOUT_NODE]();\n\t}\n\n\toverride render(width: number): string[] {\n\t\treturn this.scrollStack()?.render(width) ?? super.render(width);\n\t}\n}\n"]}
@@ -2,6 +2,7 @@ import { copyScopedModels } from "../../core/extensions/runner-context.js";
2
2
  import { ModelRegistry } from "../../core/model-registry.js";
3
3
  import { AtomicWorkingLoader } from "./components/atomic-working-status.js";
4
4
  import { mountIdleStatus } from "./components/idle-status.js";
5
+ import { ScrollWidget } from "./components/scroll-widget.js";
5
6
  import { InteractiveModeBase } from "./interactive-mode-base.js";
6
7
  import { AssistantMessageComponent, Container, keyText, matchesKey, Text, theme, } from "./interactive-mode-deps.js";
7
8
  InteractiveModeBase.prototype.setupExtensionShortcuts = function (extensionRunner) {
@@ -49,7 +50,7 @@ InteractiveModeBase.prototype.setupExtensionShortcuts = function (extensionRunne
49
50
  this.defaultEditor.onExtensionShortcut = (data) => {
50
51
  for (const [shortcutStr, shortcut] of shortcuts) {
51
52
  // Cast to KeyId - extension shortcuts use the same format
52
- if (matchesKey(data, shortcutStr)) {
53
+ if (matchesKey(data, shortcutStr) && !shortcut.editorKeys?.some((key) => matchesKey(data, key))) {
53
54
  // Run handler async, don't block input
54
55
  Promise.resolve(shortcut.handler(createContext())).catch((err) => {
55
56
  this.showError(`Shortcut handler error: ${err instanceof Error ? err.message : String(err)}`);
@@ -155,10 +156,10 @@ InteractiveModeBase.prototype.setExtensionWidget = function (key, content, optio
155
156
  if (Array.isArray(content)) {
156
157
  // Wrap string array in a Container with Text components
157
158
  const container = new Container();
158
- for (const line of content.slice(0, InteractiveModeBase.MAX_WIDGET_LINES)) {
159
+ for (const line of options?.scroll ? content : content.slice(0, InteractiveModeBase.MAX_WIDGET_LINES)) {
159
160
  container.addChild(new Text(line, 1, 0));
160
161
  }
161
- if (content.length > InteractiveModeBase.MAX_WIDGET_LINES) {
162
+ if (!options?.scroll && content.length > InteractiveModeBase.MAX_WIDGET_LINES) {
162
163
  container.addChild(new Text(theme.fg("muted", "... (widget truncated)"), 1, 0));
163
164
  }
164
165
  component = container;
@@ -167,6 +168,12 @@ InteractiveModeBase.prototype.setExtensionWidget = function (key, content, optio
167
168
  // Factory function - create component
168
169
  component = content(this.ui, theme);
169
170
  }
171
+ if (options?.scroll) {
172
+ const { maxHeight, maxHeightFraction } = options.scroll;
173
+ component = new ScrollWidget(component, maxHeight, () => maxHeightFraction === undefined
174
+ ? maxHeight
175
+ : Math.min(maxHeight, Math.max(1, Math.floor(this.ui.terminal.rows * maxHeightFraction))));
176
+ }
170
177
  const targetMap = placement === "belowEditor" ? this.extensionWidgetsBelow : this.extensionWidgetsAbove;
171
178
  targetMap.set(key, component);
172
179
  this.renderWidgets();
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-extension-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EACN,yBAAyB,EAEzB,SAAS,EAKT,OAAO,EAEP,UAAU,EACV,IAAI,EAGJ,KAAK,GACL,MAAM,4BAA4B,CAAC;AAEpC,mBAAmB,CAAC,SAAS,CAAC,uBAAuB,GAAG,UAEvD,eAAgC;IAEhC,MAAM,SAAS,GAAG,eAAe,CAAC,YAAY,CAAC,IAAI,CAAC,WAAW,CAAC,kBAAkB,EAAE,CAAC,CAAC;IACtF,IAAI,SAAS,CAAC,IAAI,KAAK,CAAC;QAA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,CAAC;IACtB,IAAI,CAAC,oCAAoC,EAAE,CAAC;IAC5C,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,kBAAkB,CAAC,SAAS,CAAC,CAAC;IACnC,IAAI,CAAC,qBAAqB,EAAE,CAAC;IAC7B,IAAI,CAAC,kBAAkB,CAAC,sBAAsB,EAAE,CAAC;IACjD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACzB,IAAI,CAAC,4BAA4B,GAAG,EAAE,CAAC;IACvC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACjC,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,IAAI,CAAC,gCAAgC,CAAC;IAC/E,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC3B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC3B,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAC3G,CAAC;IACD,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["import { copyScopedModels } from \"../../core/extensions/runner-context.ts\";\nimport { ModelRegistry } from \"../../core/model-registry.ts\";\nimport { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport { mountIdleStatus } from \"./components/idle-status.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\tAssistantMessageComponent,\n\ttype Component,\n\tContainer,\n\ttype ExtensionContext,\n\ttype ExtensionRunner,\n\ttype ExtensionWidgetOptions,\n\ttype KeyId,\n\tkeyText,\n\ttype LoaderIndicatorOptions,\n\tmatchesKey,\n\tText,\n\ttype Theme,\n\ttype TUI,\n\ttheme,\n} from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.setupExtensionShortcuts = function (\n\tthis: InteractiveModeBase,\n\textensionRunner: ExtensionRunner,\n): void {\n\tconst shortcuts = extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());\n\tif (shortcuts.size === 0) return;\n\n\t// Create a context for shortcut handlers\n\tconst createContext = (): ExtensionContext => ({\n\t\tobserveWorkflowActivity: (observer) => extensionRunner.createContext().observeWorkflowActivity(observer),\n\t\tui: extensionRunner.getUIContext(),\n\t\tmode: \"tui\",\n\t\thasUI: true,\n\t\tcwd: this.sessionManager.getCwd(),\n\t\tsessionManager: this.sessionManager,\n\t\tmodelRegistry: new ModelRegistry(this.session.modelRuntime),\n\t\tmodel: this.session.model,\n\t\t// Copied through the same helper `createExtensionContext` uses: this\n\t\t// hand-built context reaches the same shortcut handlers, so it owes them\n\t\t// the same guarantee, entries included.\n\t\tscopedModels: copyScopedModels(this.session.scopedModels),\n\t\tisIdle: () => !this.session.isStreaming,\n\t\tisProjectTrusted: () => this.session.settingsManager.isProjectTrusted(),\n\t\tsignal: this.session.agent.signal,\n\t\tabort: () => this.session.abort(),\n\t\thasPendingMessages: () => this.session.pendingMessageCount > 0,\n\t\tshutdown: () => {\n\t\t\tthis.shutdownRequested = true;\n\t\t},\n\t\tgetContextUsage: () => this.session.getContextUsage(),\n\t\tcompact: (options) => {\n\t\t\tvoid (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.session.compact();\n\t\t\t\t\toptions?.onComplete?.(result);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst err = error instanceof Error ? error : new Error(String(error));\n\t\t\t\t\toptions?.onError?.(err);\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tgetSystemPrompt: () => this.session.systemPrompt,\n\t});\n\n\t// Set up the extension shortcut handler on the default editor\n\tthis.defaultEditor.onExtensionShortcut = (data: string) => {\n\t\tfor (const [shortcutStr, shortcut] of shortcuts) {\n\t\t\t// Cast to KeyId - extension shortcuts use the same format\n\t\t\tif (matchesKey(data, shortcutStr as KeyId)) {\n\t\t\t\t// Run handler async, don't block input\n\t\t\t\tPromise.resolve(shortcut.handler(createContext())).catch((err) => {\n\t\t\t\t\tthis.showError(`Shortcut handler error: ${err instanceof Error ? err.message : String(err)}`);\n\t\t\t\t});\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n};\n\nInteractiveModeBase.prototype.setExtensionStatus = function (\n\tthis: InteractiveModeBase,\n\tkey: string,\n\ttext: string | undefined,\n): void {\n\tthis.footerDataProvider.setExtensionStatus(key, text);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.getWorkingLoaderMessage = function (this: InteractiveModeBase): string {\n\treturn this.workingMessage ?? this.defaultWorkingMessage;\n};\n\nInteractiveModeBase.prototype.createWorkingLoader = function (this: InteractiveModeBase): AtomicWorkingLoader {\n\treturn new AtomicWorkingLoader(\n\t\tthis.ui,\n\t\tundefined,\n\t\t(text) => theme.fg(\"muted\", text),\n\t\tthis.getWorkingLoaderMessage(),\n\t\tthis.workingIndicatorOptions,\n\t);\n};\n\nInteractiveModeBase.prototype.clearWorkingLoader = function (this: InteractiveModeBase): void {\n\tthis.loadingAnimation?.stop();\n\tthis.loadingAnimation = undefined;\n\tthis.workingIndicatorEmbedded = false;\n\tthis.setEditorWorkingStatusIndicator?.(undefined);\n\tthis.statusContainer.clear();\n};\n\nInteractiveModeBase.prototype.stopWorkingLoader = function (this: InteractiveModeBase): void {\n\tconst hadLoader = this.loadingAnimation !== undefined;\n\tconst wasEmbedded = this.workingIndicatorEmbedded;\n\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\tif (hadLoader && !wasEmbedded) mountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n};\n\nInteractiveModeBase.prototype.showWorkingLoaderNow = function (this: InteractiveModeBase): void {\n\t// Mount the working spinner immediately, regardless of streaming state, so\n\t// there is no visible gap between submitting a prompt and the agent turn\n\t// actually starting. Prompt preflight (extension input hooks, template/skill\n\t// expansion, auth and compaction checks, deferred startup) runs before the\n\t// agent emits `agent_start`, which is otherwise the only place the loader is\n\t// created. Respect `workingVisible` so extensions can still suppress it.\n\tif (!this.workingVisible || this.loadingAnimation) {\n\t\tthis.ui.requestRender();\n\t\treturn;\n\t}\n\tthis.statusContainer.clear();\n\tconst loader = this.createWorkingLoader();\n\tthis.loadingAnimation = loader;\n\tthis.workingIndicatorEmbedded = this.setEditorWorkingStatusIndicator?.(loader) ?? false;\n\tif (!this.workingIndicatorEmbedded) this.statusContainer.addChild(loader);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setWorkingVisible = function (this: InteractiveModeBase, visible: boolean): void {\n\tthis.workingVisible = visible;\n\tif (!visible) {\n\t\tthis.stopWorkingLoader();\n\t\tthis.ui.requestRender();\n\t\treturn;\n\t}\n\tif (this.session.isStreaming && !this.loadingAnimation) {\n\t\tthis.statusContainer.clear();\n\t\tconst loader = this.createWorkingLoader();\n\t\tthis.loadingAnimation = loader;\n\t\tthis.workingIndicatorEmbedded = this.setEditorWorkingStatusIndicator?.(loader) ?? false;\n\t\tif (!this.workingIndicatorEmbedded) this.statusContainer.addChild(loader);\n\t}\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setWorkingIndicator = function (\n\tthis: InteractiveModeBase,\n\toptions?: LoaderIndicatorOptions,\n): void {\n\tthis.workingIndicatorOptions = options;\n\tthis.loadingAnimation?.setIndicator(options);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setHiddenThinkingLabel = function (this: InteractiveModeBase, label?: string): void {\n\tthis.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;\n\tfor (const child of this.chatContainer.children) {\n\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\tchild.setHiddenThinkingLabel(this.hiddenThinkingLabel);\n\t\t}\n\t}\n\tif (this.streamingComponent) {\n\t\tthis.streamingComponent.setHiddenThinkingLabel(this.hiddenThinkingLabel);\n\t}\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setExtensionWidget = function (\n\tthis: InteractiveModeBase,\n\tkey: string,\n\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\toptions?: ExtensionWidgetOptions,\n): void {\n\tconst placement = options?.placement ?? \"aboveEditor\";\n\tconst removeExisting = (map: Map<string, Component & { dispose?(): void }>) => {\n\t\tconst existing = map.get(key);\n\t\tif (existing?.dispose) existing.dispose();\n\t\tmap.delete(key);\n\t};\n\n\tremoveExisting(this.extensionWidgetsAbove);\n\tremoveExisting(this.extensionWidgetsBelow);\n\n\tif (content === undefined) {\n\t\tthis.renderWidgets();\n\t\treturn;\n\t}\n\n\tlet component: Component & { dispose?(): void };\n\n\tif (Array.isArray(content)) {\n\t\t// Wrap string array in a Container with Text components\n\t\tconst container = new Container();\n\t\tfor (const line of content.slice(0, InteractiveModeBase.MAX_WIDGET_LINES)) {\n\t\t\tcontainer.addChild(new Text(line, 1, 0));\n\t\t}\n\t\tif (content.length > InteractiveModeBase.MAX_WIDGET_LINES) {\n\t\t\tcontainer.addChild(new Text(theme.fg(\"muted\", \"... (widget truncated)\"), 1, 0));\n\t\t}\n\t\tcomponent = container;\n\t} else {\n\t\t// Factory function - create component\n\t\tcomponent = content(this.ui, theme);\n\t}\n\n\tconst targetMap = placement === \"belowEditor\" ? this.extensionWidgetsBelow : this.extensionWidgetsAbove;\n\ttargetMap.set(key, component);\n\tthis.renderWidgets();\n};\n\nInteractiveModeBase.prototype.clearExtensionWidgets = function (this: InteractiveModeBase): void {\n\tconst releasedKeys = new Set<string>();\n\tfor (const [key, widget] of this.extensionWidgetsAbove) {\n\t\twidget.dispose?.();\n\t\treleasedKeys.add(key);\n\t}\n\tfor (const [key, widget] of this.extensionWidgetsBelow) {\n\t\twidget.dispose?.();\n\t\treleasedKeys.add(key);\n\t}\n\tthis.extensionWidgetsAbove.clear();\n\tthis.extensionWidgetsBelow.clear();\n\tthis.renderWidgets();\n\tfor (const key of releasedKeys) this.notifyExtensionWidgetRelease(key);\n};\n\nInteractiveModeBase.prototype.resetExtensionUI = function (this: InteractiveModeBase): void {\n\tif (this.extensionSelector) {\n\t\tthis.hideExtensionSelector();\n\t}\n\tif (this.extensionInput) {\n\t\tthis.hideExtensionInput();\n\t}\n\tif (this.extensionEditor) {\n\t\tthis.hideExtensionEditor();\n\t}\n\tthis.ui.hideOverlay();\n\tthis.clearExtensionTerminalInputListeners();\n\tthis.setExtensionFooter(undefined);\n\tthis.setExtensionHeader(undefined);\n\tthis.clearExtensionWidgets();\n\tthis.footerDataProvider.clearExtensionStatuses();\n\tthis.footer.invalidate();\n\tthis.autocompleteProviderWrappers = [];\n\tthis.setCustomEditorComponent(undefined);\n\tthis.setupAutocompleteProvider();\n\tthis.defaultEditor.onExtensionShortcut = this.interactiveEngineShortcutHandler;\n\tthis.updateTerminalTitle();\n\tthis.workingMessage = undefined;\n\tthis.workingVisible = true;\n\tthis.setWorkingIndicator();\n\tif (this.loadingAnimation) {\n\t\tthis.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText(\"app.interrupt\")} Interrupt)`);\n\t}\n\tthis.setHiddenThinkingLabel();\n};\n"]}
1
+ {"version":3,"file":"interactive-extension-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-extension-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,yCAAyC,CAAC;AAC3E,OAAO,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA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;IACjD,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IACzB,IAAI,CAAC,4BAA4B,GAAG,EAAE,CAAC;IACvC,IAAI,CAAC,wBAAwB,CAAC,SAAS,CAAC,CAAC;IACzC,IAAI,CAAC,yBAAyB,EAAE,CAAC;IACjC,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,IAAI,CAAC,gCAAgC,CAAC;IAC/E,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC3B,IAAI,CAAC,cAAc,GAAG,SAAS,CAAC;IAChC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;IAC3B,IAAI,CAAC,mBAAmB,EAAE,CAAC;IAC3B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAC3B,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC,qBAAqB,KAAK,OAAO,CAAC,eAAe,CAAC,aAAa,CAAC,CAAC;IAC3G,CAAC;IACD,IAAI,CAAC,sBAAsB,EAAE,CAAC;AAC/B,CAAC,CAAC","sourcesContent":["import { copyScopedModels } from \"../../core/extensions/runner-context.ts\";\nimport { ModelRegistry } from \"../../core/model-registry.ts\";\nimport { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport { mountIdleStatus } from \"./components/idle-status.ts\";\nimport { ScrollWidget } from \"./components/scroll-widget.js\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport {\n\tAssistantMessageComponent,\n\ttype Component,\n\tContainer,\n\ttype ExtensionContext,\n\ttype ExtensionRunner,\n\ttype ExtensionWidgetOptions,\n\ttype KeyId,\n\tkeyText,\n\ttype LoaderIndicatorOptions,\n\tmatchesKey,\n\tText,\n\ttype Theme,\n\ttype TUI,\n\ttheme,\n} from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.setupExtensionShortcuts = function (\n\tthis: InteractiveModeBase,\n\textensionRunner: ExtensionRunner,\n): void {\n\tconst shortcuts = extensionRunner.getShortcuts(this.keybindings.getEffectiveConfig());\n\tif (shortcuts.size === 0) return;\n\n\t// Create a context for shortcut handlers\n\tconst createContext = (): ExtensionContext => ({\n\t\tobserveWorkflowActivity: (observer) => extensionRunner.createContext().observeWorkflowActivity(observer),\n\t\tui: extensionRunner.getUIContext(),\n\t\tmode: \"tui\",\n\t\thasUI: true,\n\t\tcwd: this.sessionManager.getCwd(),\n\t\tsessionManager: this.sessionManager,\n\t\tmodelRegistry: new ModelRegistry(this.session.modelRuntime),\n\t\tmodel: this.session.model,\n\t\t// Copied through the same helper `createExtensionContext` uses: this\n\t\t// hand-built context reaches the same shortcut handlers, so it owes them\n\t\t// the same guarantee, entries included.\n\t\tscopedModels: copyScopedModels(this.session.scopedModels),\n\t\tisIdle: () => !this.session.isStreaming,\n\t\tisProjectTrusted: () => this.session.settingsManager.isProjectTrusted(),\n\t\tsignal: this.session.agent.signal,\n\t\tabort: () => this.session.abort(),\n\t\thasPendingMessages: () => this.session.pendingMessageCount > 0,\n\t\tshutdown: () => {\n\t\t\tthis.shutdownRequested = true;\n\t\t},\n\t\tgetContextUsage: () => this.session.getContextUsage(),\n\t\tcompact: (options) => {\n\t\t\tvoid (async () => {\n\t\t\t\ttry {\n\t\t\t\t\tconst result = await this.session.compact();\n\t\t\t\t\toptions?.onComplete?.(result);\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconst err = error instanceof Error ? error : new Error(String(error));\n\t\t\t\t\toptions?.onError?.(err);\n\t\t\t\t}\n\t\t\t})();\n\t\t},\n\t\tgetSystemPrompt: () => this.session.systemPrompt,\n\t});\n\n\t// Set up the extension shortcut handler on the default editor\n\tthis.defaultEditor.onExtensionShortcut = (data: string) => {\n\t\tfor (const [shortcutStr, shortcut] of shortcuts) {\n\t\t\t// Cast to KeyId - extension shortcuts use the same format\n\t\t\tif (matchesKey(data, shortcutStr as KeyId) && !shortcut.editorKeys?.some((key) => matchesKey(data, key))) {\n\t\t\t\t// Run handler async, don't block input\n\t\t\t\tPromise.resolve(shortcut.handler(createContext())).catch((err) => {\n\t\t\t\t\tthis.showError(`Shortcut handler error: ${err instanceof Error ? err.message : String(err)}`);\n\t\t\t\t});\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t};\n};\n\nInteractiveModeBase.prototype.setExtensionStatus = function (\n\tthis: InteractiveModeBase,\n\tkey: string,\n\ttext: string | undefined,\n): void {\n\tthis.footerDataProvider.setExtensionStatus(key, text);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.getWorkingLoaderMessage = function (this: InteractiveModeBase): string {\n\treturn this.workingMessage ?? this.defaultWorkingMessage;\n};\n\nInteractiveModeBase.prototype.createWorkingLoader = function (this: InteractiveModeBase): AtomicWorkingLoader {\n\treturn new AtomicWorkingLoader(\n\t\tthis.ui,\n\t\tundefined,\n\t\t(text) => theme.fg(\"muted\", text),\n\t\tthis.getWorkingLoaderMessage(),\n\t\tthis.workingIndicatorOptions,\n\t);\n};\n\nInteractiveModeBase.prototype.clearWorkingLoader = function (this: InteractiveModeBase): void {\n\tthis.loadingAnimation?.stop();\n\tthis.loadingAnimation = undefined;\n\tthis.workingIndicatorEmbedded = false;\n\tthis.setEditorWorkingStatusIndicator?.(undefined);\n\tthis.statusContainer.clear();\n};\n\nInteractiveModeBase.prototype.stopWorkingLoader = function (this: InteractiveModeBase): void {\n\tconst hadLoader = this.loadingAnimation !== undefined;\n\tconst wasEmbedded = this.workingIndicatorEmbedded;\n\tInteractiveModeBase.prototype.clearWorkingLoader.call(this);\n\tif (hadLoader && !wasEmbedded) mountIdleStatus(this.statusContainer, this.settingsManager.getClearOnShrink());\n};\n\nInteractiveModeBase.prototype.showWorkingLoaderNow = function (this: InteractiveModeBase): void {\n\t// Mount the working spinner immediately, regardless of streaming state, so\n\t// there is no visible gap between submitting a prompt and the agent turn\n\t// actually starting. Prompt preflight (extension input hooks, template/skill\n\t// expansion, auth and compaction checks, deferred startup) runs before the\n\t// agent emits `agent_start`, which is otherwise the only place the loader is\n\t// created. Respect `workingVisible` so extensions can still suppress it.\n\tif (!this.workingVisible || this.loadingAnimation) {\n\t\tthis.ui.requestRender();\n\t\treturn;\n\t}\n\tthis.statusContainer.clear();\n\tconst loader = this.createWorkingLoader();\n\tthis.loadingAnimation = loader;\n\tthis.workingIndicatorEmbedded = this.setEditorWorkingStatusIndicator?.(loader) ?? false;\n\tif (!this.workingIndicatorEmbedded) this.statusContainer.addChild(loader);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setWorkingVisible = function (this: InteractiveModeBase, visible: boolean): void {\n\tthis.workingVisible = visible;\n\tif (!visible) {\n\t\tthis.stopWorkingLoader();\n\t\tthis.ui.requestRender();\n\t\treturn;\n\t}\n\tif (this.session.isStreaming && !this.loadingAnimation) {\n\t\tthis.statusContainer.clear();\n\t\tconst loader = this.createWorkingLoader();\n\t\tthis.loadingAnimation = loader;\n\t\tthis.workingIndicatorEmbedded = this.setEditorWorkingStatusIndicator?.(loader) ?? false;\n\t\tif (!this.workingIndicatorEmbedded) this.statusContainer.addChild(loader);\n\t}\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setWorkingIndicator = function (\n\tthis: InteractiveModeBase,\n\toptions?: LoaderIndicatorOptions,\n): void {\n\tthis.workingIndicatorOptions = options;\n\tthis.loadingAnimation?.setIndicator(options);\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setHiddenThinkingLabel = function (this: InteractiveModeBase, label?: string): void {\n\tthis.hiddenThinkingLabel = label ?? this.defaultHiddenThinkingLabel;\n\tfor (const child of this.chatContainer.children) {\n\t\tif (child instanceof AssistantMessageComponent) {\n\t\t\tchild.setHiddenThinkingLabel(this.hiddenThinkingLabel);\n\t\t}\n\t}\n\tif (this.streamingComponent) {\n\t\tthis.streamingComponent.setHiddenThinkingLabel(this.hiddenThinkingLabel);\n\t}\n\tthis.ui.requestRender();\n};\n\nInteractiveModeBase.prototype.setExtensionWidget = function (\n\tthis: InteractiveModeBase,\n\tkey: string,\n\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\toptions?: ExtensionWidgetOptions,\n): void {\n\tconst placement = options?.placement ?? \"aboveEditor\";\n\tconst removeExisting = (map: Map<string, Component & { dispose?(): void }>) => {\n\t\tconst existing = map.get(key);\n\t\tif (existing?.dispose) existing.dispose();\n\t\tmap.delete(key);\n\t};\n\n\tremoveExisting(this.extensionWidgetsAbove);\n\tremoveExisting(this.extensionWidgetsBelow);\n\n\tif (content === undefined) {\n\t\tthis.renderWidgets();\n\t\treturn;\n\t}\n\n\tlet component: Component & { dispose?(): void };\n\n\tif (Array.isArray(content)) {\n\t\t// Wrap string array in a Container with Text components\n\t\tconst container = new Container();\n\t\tfor (const line of options?.scroll ? content : content.slice(0, InteractiveModeBase.MAX_WIDGET_LINES)) {\n\t\t\tcontainer.addChild(new Text(line, 1, 0));\n\t\t}\n\t\tif (!options?.scroll && content.length > InteractiveModeBase.MAX_WIDGET_LINES) {\n\t\t\tcontainer.addChild(new Text(theme.fg(\"muted\", \"... (widget truncated)\"), 1, 0));\n\t\t}\n\t\tcomponent = container;\n\t} else {\n\t\t// Factory function - create component\n\t\tcomponent = content(this.ui, theme);\n\t}\n\tif (options?.scroll) {\n\t\tconst { maxHeight, maxHeightFraction } = options.scroll;\n\t\tcomponent = new ScrollWidget(component, maxHeight, () =>\n\t\t\tmaxHeightFraction === undefined\n\t\t\t\t? maxHeight\n\t\t\t\t: Math.min(maxHeight, Math.max(1, Math.floor(this.ui.terminal.rows * maxHeightFraction))),\n\t\t);\n\t}\n\n\tconst targetMap = placement === \"belowEditor\" ? this.extensionWidgetsBelow : this.extensionWidgetsAbove;\n\ttargetMap.set(key, component);\n\tthis.renderWidgets();\n};\n\nInteractiveModeBase.prototype.clearExtensionWidgets = function (this: InteractiveModeBase): void {\n\tconst releasedKeys = new Set<string>();\n\tfor (const [key, widget] of this.extensionWidgetsAbove) {\n\t\twidget.dispose?.();\n\t\treleasedKeys.add(key);\n\t}\n\tfor (const [key, widget] of this.extensionWidgetsBelow) {\n\t\twidget.dispose?.();\n\t\treleasedKeys.add(key);\n\t}\n\tthis.extensionWidgetsAbove.clear();\n\tthis.extensionWidgetsBelow.clear();\n\tthis.renderWidgets();\n\tfor (const key of releasedKeys) this.notifyExtensionWidgetRelease(key);\n};\n\nInteractiveModeBase.prototype.resetExtensionUI = function (this: InteractiveModeBase): void {\n\tif (this.extensionSelector) {\n\t\tthis.hideExtensionSelector();\n\t}\n\tif (this.extensionInput) {\n\t\tthis.hideExtensionInput();\n\t}\n\tif (this.extensionEditor) {\n\t\tthis.hideExtensionEditor();\n\t}\n\tthis.ui.hideOverlay();\n\tthis.clearExtensionTerminalInputListeners();\n\tthis.setExtensionFooter(undefined);\n\tthis.setExtensionHeader(undefined);\n\tthis.clearExtensionWidgets();\n\tthis.footerDataProvider.clearExtensionStatuses();\n\tthis.footer.invalidate();\n\tthis.autocompleteProviderWrappers = [];\n\tthis.setCustomEditorComponent(undefined);\n\tthis.setupAutocompleteProvider();\n\tthis.defaultEditor.onExtensionShortcut = this.interactiveEngineShortcutHandler;\n\tthis.updateTerminalTitle();\n\tthis.workingMessage = undefined;\n\tthis.workingVisible = true;\n\tthis.setWorkingIndicator();\n\tif (this.loadingAnimation) {\n\t\tthis.loadingAnimation.setMessage(`${this.defaultWorkingMessage} (${keyText(\"app.interrupt\")} Interrupt)`);\n\t}\n\tthis.setHiddenThinkingLabel();\n};\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode-base.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,K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M,CAAC,QAAQ,CAAC,gBAAgB,MAAM;IAEtC;;;;OAIG;IACH,cAAc,UAAS;CACvB"}
1
+ {"version":3,"file":"interactive-mode-base.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EAGN,KAAK,UAAU,EAEf,KAAK,gBAAgB,EACrB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,qCAAqC,CAAC;AACzF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AAC1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AACjG,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAIpE,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,0CAA0C,CAAC;AAC7F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AAEjF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,yCAAyC,CAAC;AAExF,OAAO,EACN,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAC3B,KAAK,SAAS,EACd,SAAS,EACT,KAAK,cAAc,EACnB,YAAY,EACZ,KAAK,eAAe,EACpB,KAAK,aAAa,EAClB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,eAAe,EACf,kBAAkB,EAElB,KAAK,yBAAyB,EAC9B,0BAA0B,EAC1B,kBAAkB,EAClB,KAAK,MAAM,EACX,KAAK,sBAAsB,EAC3B,KAAK,MAAM,EAGX,KAAK,IAAI,EACT,KAAK,sBAAsB,EA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AE,MAAM,IAAI,GAAG,MAAM,IAAI,CAGpD;IAED,mBAAmB,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,SAAS,SAAS,EAAE,GAAG,IAAI,CAMpE;YAEa,qBAAqB;IAcnC,kBAAkB,CAAC,oBAAoB,EAAE,oBAAoB,GAAG,IAAI,CAiBnE;IAEO,OAAO,EAAE,sBAAsB,CAAC;IAExC,+BAA+B,CAAC,SAAS,EAAE,mBAAmB,GAAG,SAAS,GAAG,OAAO,CAKnF;IAED,YAAY,WAAW,EAAE,mBAAmB,EAAE,OAAO,GAAE,sBAA2B,EA6GjF;IAGD,MAAM,CAAC,QAAQ,CAAC,gBAAgB,MAAM;IAEtC;;;;OAIG;IACH,cAAc,UAAS;CACvB"}
@@ -8,6 +8,7 @@ import { renderEngineDiagnostic } from "../interactive-engine/engine-diagnostic-
8
8
  import { attachInteractiveEngineHost } from "../interactive-engine/extension-ui-bridge.js";
9
9
  import { KeybindingsReloadCoordinator } from "../rpc/rpc-keybindings-reload.js";
10
10
  import { createMermaidMarkdownTransformer } from "./components/mermaid.js";
11
+ import { WidgetContainer } from "./components/scroll-widget.js";
11
12
  import { Container, CustomEditor, FooterComponent, FooterDataProvider, getEditorTheme, InteractiveThemeController, KeybindingsManager, setKeybindings, setRegisteredThemes, theme, UsageMeterComponent, VERSION, } from "./interactive-mode-deps.js";
12
13
  import { StartupChatContainer } from "./interactive-startup-chat-container.js";
13
14
  import { createInteractiveTui, createInteractiveTuiReference, handleFocusedOverlayInternalUiAction, } from "./interactive-tui.js";
@@ -398,8 +399,8 @@ export class InteractiveModeBase {
398
399
  this.chatContainer.addChild(this.startupNoticesContainer);
399
400
  this.pendingMessagesContainer = new Container();
400
401
  this.statusContainer = new Container();
401
- this.widgetContainerAbove = new Container();
402
- this.widgetContainerBelow = new Container();
402
+ this.widgetContainerAbove = new WidgetContainer();
403
+ this.widgetContainerBelow = new WidgetContainer();
403
404
  this.keybindings = KeybindingsManager.create(runtimeHost.services.agentDir);
404
405
  this.reloadCoordinator = new KeybindingsReloadCoordinator(this.keybindings);
405
406
  setKeybindings(this.keybindings);
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode-base.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,YAAY,EACZ,aAAa,EAEb,sBAAsB,GAEtB,MAAM,wBAAwB,CAAC;AAMhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EASN,SAAS,EAET,YAAY,EAMZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EAEd,0BAA0B,EAC1B,kBAAkB,EAIlB,cAAc,EACd,mBAAmB,EAInB,KAAK,EACL,mBAAmB,EACnB,OAAO,GACP,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EACN,oBAAoB,EACpB,6BAA6B,EAC7B,oCAAoC,GAGpC,MAAM,sBAAsB,CAAC;AAE9B,kFAAkF;AAClF,MAAM,oCAAoC,GAAG;IAC5C,sBAAsB;IACtB,wBAAwB;IACxB,0BAA0B;IAC1B,4BAA4B;IAC5B,sBAAsB;IACtB,wBAAwB;IACxB,8BAA8B;IAC9B,0BAA0B;IAC1B,mBAAmB;IACnB,sBAAsB;CACb,CAAC;AAEX,MAAM,2BAA2B,GAAG,oCAAoC,CAAC;AAEzE,MAAM,UAAU,0BAA0B,CAAC,IAAY,EAAE,WAA+B;IACvF,OAAO,2BAA2B,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE,C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,GAAG,OAAO,CAAC;YAChD,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,OAAO,CAAC;YACjD,OAAO,GAAG,EAAE;gBACX,IAAI,IAAI,CAAC,gCAAgC,KAAK,OAAO;oBAAE,IAAI,CAAC,gCAAgC,GAAG,SAAS,CAAC;gBACzG,IAAI,IAAI,CAAC,aAAa,CAAC,mBAAmB,KAAK,OAAO;oBACrD,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrD,CAAC,CAAC;QACH,CAAC,EACD,IAAI,CAAC,WAAW,CAChB,CAAC;IACH,CAAC;IAED,0DAA0D;aAC1C,qBAAgB,GAAG,EAAE,AAAL,CAAM;CAQtC","sourcesContent":["/**\n * Shared state and constructor wiring for interactive mode.\n * Responsibility-specific behavior is installed by sibling modules.\n */\nimport {\n\tisKeyRelease,\n\tisViewportTUI,\n\ttype ScrollView,\n\tsetCapabilityOverrides,\n\ttype TuiInputListener,\n} from \"@earendil-works/pi-tui\";\n\nimport type { AgentSessionQueuePauseControl } from \"../../core/agent-session-methods.ts\";\nimport type { MarkdownTransformer } from \"../../core/extensions/types.ts\";\nimport type { FullscreenExitOutput, MermaidRenderingMode } from \"../../core/settings-manager.ts\";\nimport type { EarlyInputSnapshot } from \"../../main-early-input.ts\";\nimport { readClipboardText } from \"../../utils/clipboard.ts\";\nimport { renderEngineDiagnostic } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport { attachInteractiveEngineHost } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport type { RemoteToolExecutionComponent } from \"../interactive-engine/remote-renderer.ts\";\nimport { KeybindingsReloadCoordinator } from \"../rpc/rpc-keybindings-reload.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport { createMermaidMarkdownTransformer } from \"./components/mermaid.ts\";\nimport type { TranscriptOverlayReserve } from \"./components/reserved-bottom-overlay.ts\";\nimport {\n\ttype AgentSession,\n\ttype AgentSessionRuntime,\n\ttype AssistantMessage,\n\ttype AssistantMessageComponent,\n\ttype AutocompleteProvider,\n\ttype AutocompleteProviderFactory,\n\ttype BashExecutionComponent,\n\ttype Component,\n\tContainer,\n\ttype CountdownTimer,\n\tCustomEditor,\n\ttype EditorComponent,\n\ttype EditorFactory,\n\ttype ExtensionEditorComponent,\n\ttype ExtensionInputComponent,\n\ttype ExtensionSelectorComponent,\n\tFooterComponent,\n\tFooterDataProvider,\n\tgetEditorTheme,\n\ttype HostCustomUiStateListener,\n\tInteractiveThemeController,\n\tKeybindingsManager,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype Spacer,\n\tsetKeybindings,\n\tsetRegisteredThemes,\n\ttype Text,\n\ttype ToolExecutionComponent,\n\ttype TUI,\n\ttheme,\n\tUsageMeterComponent,\n\tVERSION,\n} from \"./interactive-mode-deps.ts\";\nimport type {} from \"./interactive-mode-surface.ts\";\nimport type { CompactionQueuedMessage, InteractiveModeOptions } from \"./interactive-mode-types.ts\";\nimport { StartupChatContainer } from \"./interactive-startup-chat-container.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\nimport {\n\tcreateInteractiveTui,\n\tcreateInteractiveTuiReference,\n\thandleFocusedOverlayInternalUiAction,\n\ttype InteractiveTui,\n\ttype InternalUiActionResult,\n} from \"./interactive-tui.ts\";\n\n/** Move the transcript and nothing else: what a reserving overlay may release. */\nconst FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS = [\n\t\"tui.altScreen.pageUp\",\n\t\"tui.altScreen.pageDown\",\n\t\"tui.altScreen.halfPageUp\",\n\t\"tui.altScreen.halfPageDown\",\n\t\"tui.altScreen.lineUp\",\n\t\"tui.altScreen.lineDown\",\n\t\"tui.altScreen.previousPrompt\",\n\t\"tui.altScreen.nextPrompt\",\n\t\"tui.altScreen.top\",\n\t\"tui.altScreen.bottom\",\n] as const;\n\nconst FULLSCREEN_VIEWPORT_ACTIONS = FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS;\n\nexport function isFullscreenViewportAction(data: string, keybindings: KeybindingsManager): boolean {\n\treturn FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));\n}\n\n/**\n * Whether a key scrolls the transcript. A reserving overlay — the\n * `ask_user_question` dialog, an extension component with\n * `reserveTranscriptRows` — declines these so the strip above it still pages\n * and jumps (#2378), and keeps everything else.\n */\nexport function isFullscreenTranscriptScrollAction(data: string, keybindings: KeybindingsManager): boolean {\n\treturn FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS.some((action) => keybindings.matches(data, action));\n}\n\n/**\n * Decide whether the fullscreen viewport should run before the focused\n * component. `isMouseInput` is classified by pi-tui's own mouse predicate in\n * `AtomicTuiAltScreen`, so this policy does not duplicate terminal grammars.\n * Mouse deferral is limited to actual overlays so inline components do not\n * disable pi-tui's application-owned transcript selection path.\n *\n * **Who owns viewport keys while an overlay is focused.** pi-tui 0.84.2 added\n * `shouldDeferViewportInputToOverlay()` (upstream #7894) and answers \"the\n * overlay\". Atomic answers \"the overlay first, the transcript with whatever it\n * declines\" (#2378 / PR #2381): the actions in `FULLSCREEN_VIEWPORT_ACTIONS`\n * and wheel reports are offered to the focused overlay, and\n * `AtomicTuiAltScreen` replays what it does not consume into pi-tui's viewport\n * listener. Atomic's answer stands, because a mounted dialog that keeps its\n * selection keys must not also freeze the transcript behind it.\n *\n * **The list covers every `tui.altScreen.*` scroll action pi-tui defines.**\n * An action a focused overlay declines still reaches the transcript, so the\n * shortcut is never simply lost.\n *\n * **A focused overlay with no `handleInput` is still an overlay.** The handler\n * is optional — `ExtensionCustomComponent` marks it `handleInput?` and\n * `docs/tui.md` documents it as optional — and a component that cannot answer\n * declines by definition. Answering \"the viewport owns it\" for that shape\n * would hand the key to pi-tui, whose native deferral then drops it because an\n * overlay holds focus, so the transcript would freeze behind a component that\n * never asked for the key. A handler-less overlay therefore takes the same\n * route as one that returns `false`: nothing to offer, then replay. Only a\n * focused component that is *not* an overlay keeps the shortcut, because\n * pi-tui defers nothing to it.\n */\nexport function shouldHandleFullscreenViewportInput(\n\tfocused: Component | null,\n\teditor: Component,\n\tdata: string,\n\tisMouseInput: boolean,\n\tfocusedIsOverlay: boolean,\n\tkeybindings: KeybindingsManager,\n\t_focusedIsViewportSearch = false,\n): boolean {\n\tif (focused === editor || !focused) return true;\n\tif (!focused.handleInput && !focusedIsOverlay) return true;\n\tif (isMouseInput) return !focusedIsOverlay;\n\tif (focusedIsOverlay && keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\treturn !isFullscreenViewportAction(data, keybindings);\n}\n\nfunction isCommandLikeStartupInput(text: string): boolean {\n\tconst trimmed = text.trimStart();\n\treturn trimmed.startsWith(\"/\") || trimmed.startsWith(\"!\");\n}\n\nexport function seedStartupInput(\n\tpendingUserInputs: InteractiveSubmission[],\n\teditor: { setText(text: string): void },\n\tstartupInput: EarlyInputSnapshot | undefined,\n\tstartupReplayInputs: string[] = [],\n\tsetStartupDraftText?: (text: string) => void,\n\tsetStartupReplayActiveInput?: (text: string) => void,\n): void {\n\tif (!startupInput) return;\n\tlet commandReplayStarted = false;\n\tfor (const submission of startupInput.submissions) {\n\t\tif (commandReplayStarted) {\n\t\t\tstartupReplayInputs.push(submission);\n\t\t} else if (isCommandLikeStartupInput(submission)) {\n\t\t\tconst commandText = submission.trim();\n\t\t\tcommandReplayStarted = true;\n\t\t\teditor.setText(commandText);\n\t\t\tsetStartupReplayActiveInput?.(commandText);\n\t\t} else {\n\t\t\tpendingUserInputs.push({ text: submission, draft: submission });\n\t\t}\n\t}\n\tif (startupInput.text.length === 0) return;\n\tif (commandReplayStarted) {\n\t\tsetStartupDraftText?.(startupInput.text);\n\t} else {\n\t\teditor.setText(startupInput.text);\n\t}\n}\n\nexport interface InteractiveTuiInputSubscription {\n\thandler: TuiInputListener;\n\tunsubscribe: () => void;\n}\n\ninterface WorkingStatusEditor extends EditorComponent {\n\treadonly embedWorkingStatus: boolean;\n\tsetWorkingStatusIndicator(indicator: AtomicWorkingLoader | undefined): void;\n}\n\nfunction isWorkingStatusEditor(editor: EditorComponent): editor is WorkingStatusEditor {\n\treturn (\n\t\t\"embedWorkingStatus\" in editor &&\n\t\teditor.embedWorkingStatus === true &&\n\t\t\"setWorkingStatusIndicator\" in editor &&\n\t\ttypeof editor.setWorkingStatusIndicator === \"function\"\n\t);\n}\n\nexport class InteractiveModeBase {\n\truntimeHost: AgentSessionRuntime;\n\n\tui: TUI;\n\tprivate renderer: InteractiveTui;\n\n\tprivate readonly shouldHandleViewportInput = (\n\t\tdata: string,\n\t\tisMouseInput: boolean,\n\t\tfocusedIsOverlay: boolean,\n\t\tfocusedIsViewportSearch: boolean,\n\t): boolean => {\n\t\treturn shouldHandleFullscreenViewportInput(\n\t\t\tthis.renderer.getFocusedComponent(),\n\t\t\tthis.editor,\n\t\t\tdata,\n\t\t\tisMouseInput,\n\t\t\tfocusedIsOverlay,\n\t\t\tthis.keybindings,\n\t\t\tfocusedIsViewportSearch,\n\t\t);\n\t};\n\tprivate readonly onOverlayUnhandledInput = (data: string): boolean => this.handleOverlayUnhandledInput(data);\n\tprivate readonly onOverlayInternalUiAction = (url: string): InternalUiActionResult =>\n\t\thandleFocusedOverlayInternalUiAction(this.renderer, url);\n\n\t/** Dispatch the host thinking action after a focused workflow overlay declines input. */\n\thandleOverlayUnhandledInput(data: string): boolean {\n\t\tif (isKeyRelease(data) || !this.keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\t\t// Reuse the default editor's action dispatcher even while a workflow\n\t\t// overlay owns focus. This keeps the host binding and its user remap as\n\t\t// the source of truth instead of calling the implementation directly.\n\t\treturn this.defaultEditor.handleInput(data);\n\t}\n\n\tsetFullscreenCopyOnSelect(enabled: boolean): void {\n\t\tif (this.renderer.mode === \"fullscreen\") this.renderer.setCopyOnSelect(enabled);\n\t}\n\n\tprivate readonly onRightClickPaste = (): void => {\n\t\tvoid this.handleRightClickPaste();\n\t};\n\n\tchatContainer: Container;\n\tdocumentContainer: Container;\n\n\ttranscriptScrollView: ScrollView | undefined;\n\n\tfullscreenLayoutRoot: Component | undefined;\n\n\tresourceDisclosureContainer: Container;\n\tstartupNoticesContainer: Container;\n\tpendingMessagesContainer: Container;\n\n\tstatusContainer: Container;\n\n\tdefaultEditor: CustomEditor;\n\n\teditor: EditorComponent;\n\n\teditorComponentFactory: EditorFactory | undefined;\n\n\tautocompleteProvider: AutocompleteProvider | undefined;\n\n\tautocompleteProviderWrappers: AutocompleteProviderFactory[] = [];\n\n\tfdPath: string | undefined;\n\n\teditorContainer: Container;\n\n\tactiveSelectorToken: object | undefined;\n\n\tactiveSelectorDispose: (() => void) | undefined;\n\n\tfooter: FooterComponent;\n\tfooterContainer: Container;\n\n\tusageMeter: UsageMeterComponent;\n\n\tfooterDataProvider: FooterDataProvider;\n\n\t// Stored so the same manager can be injected into custom editors, selectors, and extension UI.\n\tkeybindings: KeybindingsManager;\n\n\treloadCoordinator: KeybindingsReloadCoordinator;\n\n\tinteractiveEngineShortcutHandler: ((data: string) => boolean) | undefined;\n\n\tdisposeInteractiveEngineHost: () => void = () => {};\n\tdisposeMarkitDiagnosticSink: () => void = () => {};\n\n\tversion: string;\n\n\tisInitialized = false;\n\n\tonInputCallback?: (submission: InteractiveSubmission) => void;\n\n\tpendingUserInputs: InteractiveSubmission[] = [];\n\n\tstartupReplayInputs: string[] = [];\n\n\tstartupReplayActiveInput: string | undefined = undefined;\n\n\tstartupDraftText: string | undefined = undefined;\n\tworkingIndicatorEmbedded = false;\n\n\tstartupCookedInputRecovered = false;\n\n\tdeferredRenderedUserInputs: string[] = [];\n\n\tdeferredRenderedUserInputComponents = new Map<string, Component[][]>();\n\n\tloadingAnimation: Loader | AtomicWorkingLoader | undefined = undefined;\n\n\tworkingMessage: string | undefined = undefined;\n\n\tworkingVisible = true;\n\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined = undefined;\n\n\treadonly defaultWorkingMessage = \"Working\";\n\n\treadonly defaultHiddenThinkingLabel = \"Thinking...\";\n\n\thiddenThinkingLabel = this.defaultHiddenThinkingLabel;\n\n\tlastSigintTime = 0;\n\n\tlastEscapeTime = 0;\n\n\tchangelogMarkdown: string | undefined = undefined;\n\n\tstartupNoticesShown = false;\n\t/** Last model-catalog warning already shown, so the deferred re-read only speaks on a change. */\n\treportedModelCatalogWarning: string | undefined;\n\tstartupNoticesPrepared = false;\n\n\tanthropicSubscriptionWarningShown = false;\n\n\tfirstRunNoticeVisible = false;\n\n\thadLastChangelogVersionAtStartup = false;\n\n\tfirstRunOnboardingNoticeComponents: Component[] = [];\n\n\tautoTrustOnReloadCwd: string | undefined;\n\n\t// Status line tracking (for mutating immediately-sequential status updates)\n\tlastStatusSpacer: Spacer | undefined = undefined;\n\n\tlastStatusText: Text | undefined = undefined;\n\n\t/** Leading spacer added once for the managed-tool startup status block. */\n\tmanagedToolStatusStarted = false;\n\t/** Invalidates readiness callbacks after the transcript is rebuilt for another session. */\n\tmanagedToolStatusGeneration = 0;\n\n\t// Streaming message tracking\n\tstreamingComponent: AssistantMessageComponent | undefined = undefined;\n\n\tstreamingMessage: AssistantMessage | undefined = undefined;\n\n\t// Tool execution tracking: toolCallId -> component\n\tpendingTools = new Map<string, ToolExecutionComponent | RemoteToolExecutionComponent>();\n\n\t// Tool output expansion state\n\ttoolOutputExpanded = false;\n\n\t// Thinking block visibility state\n\thideThinkingBlock = false;\n\toutputPad: 0 | 1 = 1;\n\n\tmermaidMarkdownTransformer: MarkdownTransformer = createMermaidMarkdownTransformer({\n\t\tgetMode: () => this.settingsManager.getMermaidRenderingMode(),\n\t\ttheme,\n\t});\n\tmermaidMarkdownTransformerMode: MermaidRenderingMode | undefined;\n\n\t// Skill commands: command name -> skill file path\n\tskillCommands = new Map<string, string>();\n\n\t// Agent subscription unsubscribe function\n\tunsubscribe?: () => void;\n\n\tsignalCleanupHandlers: Array<() => void> = [];\n\n\t// Track if editor is in bash mode (text starts with !)\n\tisBashMode = false;\n\n\t// Track current bash execution component\n\tbashComponent: BashExecutionComponent | undefined = undefined;\n\n\t// Track pending bash components (shown in pending area, moved to chat on submit)\n\tpendingBashComponents: BashExecutionComponent[] = [];\n\n\t// Auto-compaction state\n\tautoCompactionLoader: AtomicWorkingLoader | undefined = undefined;\n\n\tautoCompactionEscapeHandler?: () => void;\n\n\t/** True once the pre-compaction Escape handler has been captured for restore. */\n\tautoCompactionEscapeHandlerSaved = false;\n\n\t/** True while `runUserPromptTurn()` owns the working loader. */\n\tpromptTurnWorkingLoaderActive = false;\n\n\t// Auto-retry state\n\tretryLoader: AtomicWorkingLoader | undefined = undefined;\n\tfallbackLoader: Loader | undefined = undefined;\n\n\tretryCountdown: CountdownTimer | undefined = undefined;\n\n\tretryEscapeHandler?: () => void;\n\n\t// Messages queued while compaction is running\n\tcompactionQueuedMessages: CompactionQueuedMessage[] = [];\n\n\t/** Keeps input queued while automatic compaction hands off to a manual request. */\n\tmanualCompactionTakeoverPending = false;\n\n\t// Deferred extension load state (first paint happens before extensions load)\n\tdeferredStartupPending = false;\n\tinitialStartupBinding = false;\n\tdeferredStartupPromise: Promise<void> | undefined = undefined;\n\n\tinputHandlerReadyRecorded = false;\n\n\tfirstSubmitRecorded = false;\n\n\t// Shutdown state\n\tshutdownRequested = false;\n\n\t// Extension UI state\n\textensionSelector: ExtensionSelectorComponent | undefined = undefined;\n\n\textensionInput: ExtensionInputComponent | undefined = undefined;\n\n\textensionEditor: ExtensionEditorComponent | undefined = undefined;\n\n\ttuiInputSubscriptions = new Set<InteractiveTuiInputSubscription>();\n\n\textensionTerminalInputSubscriptions = new Set<InteractiveTuiInputSubscription>();\n\n\ttuiRendererChangeListeners = new Set<() => void>();\n\n\tblockingInlineCustomUiDepth = 0;\n\n\tnavigationInlineCustomUiDepth = 0;\n\n\tdeferredInlineCustomUiFocusDepth = 0;\n\n\tpendingInlineCustomUiFocus: Component | undefined = undefined;\n\n\t/** Pending inline mounts in display order, oldest first. */\n\tinlineCustomUiStack: { component: Component }[] = [];\n\n\thostCustomUiStateListeners = new Set<HostCustomUiStateListener>();\n\n\twidgetReleaseListeners = new Map<string, Set<() => void>>();\n\n\ttranscriptOverlayReserve: TranscriptOverlayReserve | undefined = undefined;\n\n\tthemeController: InteractiveThemeController;\n\n\t// Extension widgets (components rendered above/below the editor)\n\textensionWidgetsAbove = new Map<string, Component & { dispose?(): void }>();\n\n\textensionWidgetsBelow = new Map<string, Component & { dispose?(): void }>();\n\n\twidgetContainerAbove!: Container;\n\n\twidgetContainerBelow!: Container;\n\n\t// Custom footer from extension (undefined = use built-in footer)\n\tcustomFooter: (Component & { dispose?(): void }) | undefined = undefined;\n\n\t// Header container that holds the built-in or custom header\n\theaderContainer: Container;\n\n\t// Built-in header (logo + keybinding hints + changelog)\n\tbuiltInHeader: Component | undefined = undefined;\n\n\t// Custom header from extension (undefined = use built-in header)\n\tcustomHeader: (Component & { dispose?(): void }) | undefined = undefined;\n\n\t// Convenience accessors\n\tget session(): AgentSession & AgentSessionQueuePauseControl {\n\t\treturn this.runtimeHost.session as AgentSession & AgentSessionQueuePauseControl;\n\t}\n\n\t/** Includes the short handoff window that an isolated engine cannot mirror. */\n\tget compactionActive(): boolean {\n\t\treturn this.session.isCompacting || this.manualCompactionTakeoverPending;\n\t}\n\n\tget agent() {\n\t\treturn this.session.agent;\n\t}\n\n\tget sessionManager() {\n\t\treturn this.session.sessionManager;\n\t}\n\n\tget settingsManager() {\n\t\treturn this.session.settingsManager;\n\t}\n\n\t/**\n\t * Tears down the selector that owns `editorContainer`, including in-flight\n\t * work such as a model catalog refresh.\n\t *\n\t * This lives on the base class so behavior modules can dispose a selector\n\t * without relying on `interactive-selectors.ts` load order.\n\t */\n\tdisposeActiveSelector(): void {\n\t\tconst dispose = this.activeSelectorDispose;\n\t\tthis.activeSelectorToken = undefined;\n\t\tthis.activeSelectorDispose = undefined;\n\t\tdispose?.();\n\t}\n\n\taddTuiInputListener(handler: TuiInputListener): () => void {\n\t\tconst subscription: InteractiveTuiInputSubscription = {\n\t\t\thandler,\n\t\t\tunsubscribe: this.ui.addInputListener(handler),\n\t\t};\n\t\tthis.tuiInputSubscriptions.add(subscription);\n\t\treturn () => {\n\t\t\tsubscription.unsubscribe();\n\t\t\tthis.tuiInputSubscriptions.delete(subscription);\n\t\t};\n\t}\n\n\trebindTuiInputListeners(): void {\n\t\tfor (const subscription of this.tuiInputSubscriptions) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription.unsubscribe = this.ui.addInputListener(subscription.handler);\n\t\t}\n\t}\n\n\tonTuiRendererChange(listener: () => void): () => void {\n\t\tthis.tuiRendererChangeListeners.add(listener);\n\t\treturn () => this.tuiRendererChangeListeners.delete(listener);\n\t}\n\n\tmountInteractiveTui(tui: TUI, components: readonly Component[]): void {\n\t\tfor (const component of components) tui.addChild(component);\n\t\tif (isViewportTUI(tui)) {\n\t\t\tif (!this.fullscreenLayoutRoot) throw new Error(\"Fullscreen layout is not initialized\");\n\t\t\ttui.setLayoutRoot(this.fullscreenLayoutRoot);\n\t\t}\n\t}\n\n\tprivate async handleRightClickPaste(): Promise<void> {\n\t\tconst target = this.renderer.getFocusedComponent();\n\t\tconst handleInput = target?.handleInput;\n\t\tif (!target || !handleInput) return;\n\t\ttry {\n\t\t\tconst text = await readClipboardText();\n\t\t\tif (!text || this.renderer.getFocusedComponent() !== target) return;\n\t\t\thandleInput.call(target, `\\x1b[200~${text}\\x1b[201~`);\n\t\t\tthis.ui.requestRender();\n\t\t} catch {\n\t\t\t// Clipboard paste is best-effort; permission and native-module failures are common.\n\t\t}\n\t}\n\n\tstopInteractiveTui(fullscreenExitOutput: FullscreenExitOutput): void {\n\t\tconst isFullscreen = this.renderer.mode === \"fullscreen\";\n\t\tif (isFullscreen && fullscreenExitOutput === \"transcript\") {\n\t\t\t// Atomic has no regular renderer to switch into, so pi-tui's own\n\t\t\t// exit paint is the only painter: its stop renders the layout root\n\t\t\t// at natural height onto the main screen. The docked fullscreen\n\t\t\t// layout squeezes its scroll view to `basis` (one row) at natural\n\t\t\t// height, so hand it the document container directly — the exit\n\t\t\t// paint then carries the whole transcript. Drop overlays first so\n\t\t\t// what gets painted is the transcript, not the focused dialog.\n\t\t\twhile (this.renderer.hasOverlayEntries) this.renderer.hideOverlay();\n\t\t\tif (isViewportTUI(this.renderer)) this.renderer.setLayoutRoot(this.documentContainer);\n\t\t}\n\t\t// `resume-hint` keeps whatever the alternate screen held: the prior\n\t\t// shell contents reappear and shutdown prints only the resume line.\n\t\tthis.ui.stop({ preserveScreen: isFullscreen && fullscreenExitOutput === \"resume-hint\" });\n\t\tthis.disposeMarkitDiagnosticSink();\n\t}\n\n\tdeclare options: InteractiveModeOptions;\n\n\tsetEditorWorkingStatusIndicator(indicator: AtomicWorkingLoader | undefined): boolean {\n\t\tthis.defaultEditor.setWorkingStatusIndicator(undefined);\n\t\tif (!isWorkingStatusEditor(this.editor)) return false;\n\t\tthis.editor.setWorkingStatusIndicator(indicator);\n\t\treturn true;\n\t}\n\n\tconstructor(runtimeHost: AgentSessionRuntime, options: InteractiveModeOptions = {}) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.options = options;\n\t\tthis.deferredStartupPending = Boolean(options.deferredExtensionLoad);\n\t\tthis.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;\n\t\tthis.runtimeHost.setBeforeSessionInvalidate(() => {\n\t\t\tthis.resetExtensionUI();\n\t\t});\n\t\tthis.runtimeHost.setRebindSession(async () => {\n\t\t\tawait this.rebindCurrentSession();\n\t\t\t// A rebound session can carry a different settings manager; re-apply\n\t\t\t// the theme so the live selection tracks the session that is current.\n\t\t\tawait this.themeController.applyFromSettings();\n\t\t});\n\t\tsetCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());\n\t\tthis.version = VERSION;\n\t\tthis.renderer = createInteractiveTui({\n\t\t\tshowHardwareCursor: this.settingsManager.getShowHardwareCursor(),\n\t\t\tlogDirectory: runtimeHost.services.agentDir,\n\t\t\tterminal: options.terminal,\n\t\t\tcopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),\n\t\t\tonRightClickPaste: this.onRightClickPaste,\n\t\t\tshouldHandleViewportInput: this.shouldHandleViewportInput,\n\t\t\tonOverlayUnhandledInput: this.onOverlayUnhandledInput,\n\t\t\tonOverlayInternalUiAction: this.onOverlayInternalUiAction,\n\t\t\tonInternalUiAction: () => {\n\t\t\t\tthis.jumpToTranscriptEnd();\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t});\n\t\tthis.ui = createInteractiveTuiReference(() => this.renderer);\n\t\tthis.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n\t\tthis.headerContainer = new Container();\n\t\tthis.documentContainer = new Container();\n\t\tthis.documentContainer.addChild(this.headerContainer);\n\t\tthis.chatContainer = new StartupChatContainer();\n\t\tthis.documentContainer.addChild(this.chatContainer);\n\t\tthis.resourceDisclosureContainer = new Container();\n\t\tthis.startupNoticesContainer = new Container();\n\t\t// The isolated engine can emit session_start UI requests as soon as its\n\t\t// bridge attaches below, before init() mounts chat in the TUI. Reserve the\n\t\t// ordering slots now so those messages can never precede RESOURCES.\n\t\tthis.chatContainer.addChild(this.resourceDisclosureContainer);\n\t\tthis.chatContainer.addChild(this.startupNoticesContainer);\n\t\tthis.pendingMessagesContainer = new Container();\n\t\tthis.statusContainer = new Container();\n\t\tthis.widgetContainerAbove = new Container();\n\t\tthis.widgetContainerBelow = new Container();\n\t\tthis.keybindings = KeybindingsManager.create(runtimeHost.services.agentDir);\n\t\tthis.reloadCoordinator = new KeybindingsReloadCoordinator(this.keybindings);\n\t\tsetKeybindings(this.keybindings);\n\t\tconst editorPaddingX = this.settingsManager.getEditorPaddingX();\n\t\tconst autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();\n\t\tthis.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {\n\t\t\tpaddingX: editorPaddingX,\n\t\t\tautocompleteMaxVisible,\n\t\t});\n\n\t\tthis.editor = this.defaultEditor;\n\t\tthis.editorContainer = new Container();\n\t\tthis.editorContainer.addChild(this.editor as Component);\n\t\tthis.footerDataProvider = new FooterDataProvider(this.sessionManager.getCwd());\n\t\tthis.footer = new FooterComponent(\n\t\t\tthis.session,\n\t\t\tthis.footerDataProvider,\n\t\t\tundefined,\n\t\t\t() => this.navigationInlineCustomUiDepth > 0,\n\t\t);\n\t\tthis.footerContainer = new Container();\n\t\tthis.footerContainer.addChild(this.footer);\n\t\tthis.usageMeter = new UsageMeterComponent(this.session);\n\t\tthis.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n\n\t\t// Load hide thinking block setting\n\t\tthis.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n\t\tthis.outputPad = this.settingsManager.getOutputPad();\n\n\t\t// Register themes from resource loader and initialize\n\t\tsetRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n\t\tthis.themeController = new InteractiveThemeController(this.ui, {\n\t\t\tgetSettingsManager: () => this.settingsManager,\n\t\t\tshowError: (message) => this.showError(message),\n\t\t\tonChanged: () => this.updateEditorBorderColor(),\n\t\t\tinitialThemeSetting: options.initialThemeSetting,\n\t\t});\n\t\tthis.disposeInteractiveEngineHost = attachInteractiveEngineHost(\n\t\t\truntimeHost,\n\t\t\tthis.createExtensionUIContext(),\n\t\t\t(diagnostic) =>\n\t\t\t\trenderEngineDiagnostic(diagnostic, {\n\t\t\t\t\tstopWorkingLoader: () => this.stopWorkingLoader(),\n\t\t\t\t\tshowStatus: (message, persist) => this.showStatus(message, persist),\n\t\t\t\t\tshowError: (message) => this.showError(message),\n\t\t\t\t}),\n\t\t\t{\n\t\t\t\tisFullscreen: () => this.renderer.mode === \"fullscreen\",\n\t\t\t\tonRendererReplaced: (listener) => this.onTuiRendererChange(listener),\n\t\t\t},\n\t\t\t(handler) => {\n\t\t\t\tthis.interactiveEngineShortcutHandler = handler;\n\t\t\t\tthis.defaultEditor.onExtensionShortcut = handler;\n\t\t\t\treturn () => {\n\t\t\t\t\tif (this.interactiveEngineShortcutHandler === handler) this.interactiveEngineShortcutHandler = undefined;\n\t\t\t\t\tif (this.defaultEditor.onExtensionShortcut === handler)\n\t\t\t\t\t\tthis.defaultEditor.onExtensionShortcut = undefined;\n\t\t\t\t};\n\t\t\t},\n\t\t\tthis.keybindings,\n\t\t);\n\t}\n\n\t// Maximum total widget lines to prevent viewport overflow\n\tstatic readonly MAX_WIDGET_LINES = 10;\n\n\t/**\n\t * Gracefully shutdown the agent.\n\t * Stops the TUI before emitting shutdown events so extension UI cleanup cannot\n\t * repaint the final frame while the process is exiting.\n\t */\n\tisShuttingDown = false;\n}\n"]}
1
+ {"version":3,"file":"interactive-mode-base.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-base.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,OAAO,EACN,YAAY,EACZ,aAAa,EAEb,sBAAsB,GAEtB,MAAM,wBAAwB,CAAC;AAKhC,OAAO,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAC7D,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAC;AAE3F,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EAAE,gCAAgC,EAAE,MAAM,yBAAyB,CAAC;AAE3E,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EASN,SAAS,EAET,YAAY,EAMZ,eAAe,EACf,kBAAkB,EAClB,cAAc,EAEd,0BAA0B,EAC1B,kBAAkB,EAIlB,cAAc,EACd,mBAAmB,EAInB,KAAK,EACL,mBAAmB,EACnB,OAAO,GACP,MAAM,4BAA4B,CAAC;AAGpC,OAAO,EAAE,oBAAoB,EAAE,MAAM,yCAAyC,CAAC;AAE/E,OAAO,EACN,oBAAoB,EACpB,6BAA6B,EAC7B,oCAAoC,GAGpC,MAAM,sBAAsB,CAAC;AAE9B,kFAAkF;AAClF,MAAM,oCAAoC,GAAG;IAC5C,sBAAsB;IACtB,wBAAwB;IACx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IAAI,CAAC,SAAS,CAAC,OAAO,CAAC;SAC/C,CAAC,EACH;YACC,YAAY,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,YAAY;YACvD,kBAAkB,EAAE,CAAC,QAAQ,EAAE,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,CAAC;SACpE,EACD,CAAC,OAAO,EAAE,EAAE;YACX,IAAI,CAAC,gCAAgC,GAAG,OAAO,CAAC;YAChD,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,OAAO,CAAC;YACjD,OAAO,GAAG,EAAE;gBACX,IAAI,IAAI,CAAC,gCAAgC,KAAK,OAAO;oBAAE,IAAI,CAAC,gCAAgC,GAAG,SAAS,CAAC;gBACzG,IAAI,IAAI,CAAC,aAAa,CAAC,mBAAmB,KAAK,OAAO;oBACrD,IAAI,CAAC,aAAa,CAAC,mBAAmB,GAAG,SAAS,CAAC;YACrD,CAAC,CAAC;QACH,CAAC,EACD,IAAI,CAAC,WAAW,CAChB,CAAC;IACH,CAAC;IAED,0DAA0D;aAC1C,qBAAgB,GAAG,EAAE,AAAL,CAAM;CAQtC","sourcesContent":["/**\n * Shared state and constructor wiring for interactive mode.\n * Responsibility-specific behavior is installed by sibling modules.\n */\nimport {\n\tisKeyRelease,\n\tisViewportTUI,\n\ttype ScrollView,\n\tsetCapabilityOverrides,\n\ttype TuiInputListener,\n} from \"@earendil-works/pi-tui\";\nimport type { AgentSessionQueuePauseControl } from \"../../core/agent-session-methods.ts\";\nimport type { MarkdownTransformer } from \"../../core/extensions/types.ts\";\nimport type { FullscreenExitOutput, MermaidRenderingMode } from \"../../core/settings-manager.ts\";\nimport type { EarlyInputSnapshot } from \"../../main-early-input.ts\";\nimport { readClipboardText } from \"../../utils/clipboard.ts\";\nimport { renderEngineDiagnostic } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport { attachInteractiveEngineHost } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport type { RemoteToolExecutionComponent } from \"../interactive-engine/remote-renderer.ts\";\nimport { KeybindingsReloadCoordinator } from \"../rpc/rpc-keybindings-reload.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport { createMermaidMarkdownTransformer } from \"./components/mermaid.ts\";\nimport type { TranscriptOverlayReserve } from \"./components/reserved-bottom-overlay.ts\";\nimport { WidgetContainer } from \"./components/scroll-widget.js\";\nimport {\n\ttype AgentSession,\n\ttype AgentSessionRuntime,\n\ttype AssistantMessage,\n\ttype AssistantMessageComponent,\n\ttype AutocompleteProvider,\n\ttype AutocompleteProviderFactory,\n\ttype BashExecutionComponent,\n\ttype Component,\n\tContainer,\n\ttype CountdownTimer,\n\tCustomEditor,\n\ttype EditorComponent,\n\ttype EditorFactory,\n\ttype ExtensionEditorComponent,\n\ttype ExtensionInputComponent,\n\ttype ExtensionSelectorComponent,\n\tFooterComponent,\n\tFooterDataProvider,\n\tgetEditorTheme,\n\ttype HostCustomUiStateListener,\n\tInteractiveThemeController,\n\tKeybindingsManager,\n\ttype Loader,\n\ttype LoaderIndicatorOptions,\n\ttype Spacer,\n\tsetKeybindings,\n\tsetRegisteredThemes,\n\ttype Text,\n\ttype ToolExecutionComponent,\n\ttype TUI,\n\ttheme,\n\tUsageMeterComponent,\n\tVERSION,\n} from \"./interactive-mode-deps.ts\";\nimport type {} from \"./interactive-mode-surface.ts\";\nimport type { CompactionQueuedMessage, InteractiveModeOptions } from \"./interactive-mode-types.ts\";\nimport { StartupChatContainer } from \"./interactive-startup-chat-container.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\nimport {\n\tcreateInteractiveTui,\n\tcreateInteractiveTuiReference,\n\thandleFocusedOverlayInternalUiAction,\n\ttype InteractiveTui,\n\ttype InternalUiActionResult,\n} from \"./interactive-tui.ts\";\n\n/** Move the transcript and nothing else: what a reserving overlay may release. */\nconst FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS = [\n\t\"tui.altScreen.pageUp\",\n\t\"tui.altScreen.pageDown\",\n\t\"tui.altScreen.halfPageUp\",\n\t\"tui.altScreen.halfPageDown\",\n\t\"tui.altScreen.lineUp\",\n\t\"tui.altScreen.lineDown\",\n\t\"tui.altScreen.previousPrompt\",\n\t\"tui.altScreen.nextPrompt\",\n\t\"tui.altScreen.top\",\n\t\"tui.altScreen.bottom\",\n] as const;\n\nconst FULLSCREEN_VIEWPORT_ACTIONS = FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS;\n\nexport function isFullscreenViewportAction(data: string, keybindings: KeybindingsManager): boolean {\n\treturn FULLSCREEN_VIEWPORT_ACTIONS.some((action) => keybindings.matches(data, action));\n}\n\n/**\n * Whether a key scrolls the transcript. A reserving overlay — the\n * `ask_user_question` dialog, an extension component with\n * `reserveTranscriptRows` — declines these so the strip above it still pages\n * and jumps (#2378), and keeps everything else.\n */\nexport function isFullscreenTranscriptScrollAction(data: string, keybindings: KeybindingsManager): boolean {\n\treturn FULLSCREEN_TRANSCRIPT_SCROLL_ACTIONS.some((action) => keybindings.matches(data, action));\n}\n\n/**\n * Decide whether the fullscreen viewport should run before the focused\n * component. `isMouseInput` is classified by pi-tui's own mouse predicate in\n * `AtomicTuiAltScreen`, so this policy does not duplicate terminal grammars.\n * Mouse deferral is limited to actual overlays so inline components do not\n * disable pi-tui's application-owned transcript selection path.\n *\n * **Who owns viewport keys while an overlay is focused.** pi-tui 0.84.2 added\n * `shouldDeferViewportInputToOverlay()` (upstream #7894) and answers \"the\n * overlay\". Atomic answers \"the overlay first, the transcript with whatever it\n * declines\" (#2378 / PR #2381): the actions in `FULLSCREEN_VIEWPORT_ACTIONS`\n * and wheel reports are offered to the focused overlay, and\n * `AtomicTuiAltScreen` replays what it does not consume into pi-tui's viewport\n * listener. Atomic's answer stands, because a mounted dialog that keeps its\n * selection keys must not also freeze the transcript behind it.\n *\n * **The list covers every `tui.altScreen.*` scroll action pi-tui defines.**\n * An action a focused overlay declines still reaches the transcript, so the\n * shortcut is never simply lost.\n *\n * **A focused overlay with no `handleInput` is still an overlay.** The handler\n * is optional — `ExtensionCustomComponent` marks it `handleInput?` and\n * `docs/tui.md` documents it as optional — and a component that cannot answer\n * declines by definition. Answering \"the viewport owns it\" for that shape\n * would hand the key to pi-tui, whose native deferral then drops it because an\n * overlay holds focus, so the transcript would freeze behind a component that\n * never asked for the key. A handler-less overlay therefore takes the same\n * route as one that returns `false`: nothing to offer, then replay. Only a\n * focused component that is *not* an overlay keeps the shortcut, because\n * pi-tui defers nothing to it.\n */\nexport function shouldHandleFullscreenViewportInput(\n\tfocused: Component | null,\n\teditor: Component,\n\tdata: string,\n\tisMouseInput: boolean,\n\tfocusedIsOverlay: boolean,\n\tkeybindings: KeybindingsManager,\n\t_focusedIsViewportSearch = false,\n): boolean {\n\tif (focused === editor || !focused) return true;\n\tif (!focused.handleInput && !focusedIsOverlay) return true;\n\tif (isMouseInput) return !focusedIsOverlay;\n\tif (focusedIsOverlay && keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\treturn !isFullscreenViewportAction(data, keybindings);\n}\n\nfunction isCommandLikeStartupInput(text: string): boolean {\n\tconst trimmed = text.trimStart();\n\treturn trimmed.startsWith(\"/\") || trimmed.startsWith(\"!\");\n}\n\nexport function seedStartupInput(\n\tpendingUserInputs: InteractiveSubmission[],\n\teditor: { setText(text: string): void },\n\tstartupInput: EarlyInputSnapshot | undefined,\n\tstartupReplayInputs: string[] = [],\n\tsetStartupDraftText?: (text: string) => void,\n\tsetStartupReplayActiveInput?: (text: string) => void,\n): void {\n\tif (!startupInput) return;\n\tlet commandReplayStarted = false;\n\tfor (const submission of startupInput.submissions) {\n\t\tif (commandReplayStarted) {\n\t\t\tstartupReplayInputs.push(submission);\n\t\t} else if (isCommandLikeStartupInput(submission)) {\n\t\t\tconst commandText = submission.trim();\n\t\t\tcommandReplayStarted = true;\n\t\t\teditor.setText(commandText);\n\t\t\tsetStartupReplayActiveInput?.(commandText);\n\t\t} else {\n\t\t\tpendingUserInputs.push({ text: submission, draft: submission });\n\t\t}\n\t}\n\tif (startupInput.text.length === 0) return;\n\tif (commandReplayStarted) {\n\t\tsetStartupDraftText?.(startupInput.text);\n\t} else {\n\t\teditor.setText(startupInput.text);\n\t}\n}\n\nexport interface InteractiveTuiInputSubscription {\n\thandler: TuiInputListener;\n\tunsubscribe: () => void;\n}\n\ninterface WorkingStatusEditor extends EditorComponent {\n\treadonly embedWorkingStatus: boolean;\n\tsetWorkingStatusIndicator(indicator: AtomicWorkingLoader | undefined): void;\n}\n\nfunction isWorkingStatusEditor(editor: EditorComponent): editor is WorkingStatusEditor {\n\treturn (\n\t\t\"embedWorkingStatus\" in editor &&\n\t\teditor.embedWorkingStatus === true &&\n\t\t\"setWorkingStatusIndicator\" in editor &&\n\t\ttypeof editor.setWorkingStatusIndicator === \"function\"\n\t);\n}\n\nexport class InteractiveModeBase {\n\truntimeHost: AgentSessionRuntime;\n\n\tui: TUI;\n\tprivate renderer: InteractiveTui;\n\n\tprivate readonly shouldHandleViewportInput = (\n\t\tdata: string,\n\t\tisMouseInput: boolean,\n\t\tfocusedIsOverlay: boolean,\n\t\tfocusedIsViewportSearch: boolean,\n\t): boolean => {\n\t\treturn shouldHandleFullscreenViewportInput(\n\t\t\tthis.renderer.getFocusedComponent(),\n\t\t\tthis.editor,\n\t\t\tdata,\n\t\t\tisMouseInput,\n\t\t\tfocusedIsOverlay,\n\t\t\tthis.keybindings,\n\t\t\tfocusedIsViewportSearch,\n\t\t);\n\t};\n\tprivate readonly onOverlayUnhandledInput = (data: string): boolean => this.handleOverlayUnhandledInput(data);\n\tprivate readonly onOverlayInternalUiAction = (url: string): InternalUiActionResult =>\n\t\thandleFocusedOverlayInternalUiAction(this.renderer, url);\n\n\t/** Dispatch the host thinking action after a focused workflow overlay declines input. */\n\thandleOverlayUnhandledInput(data: string): boolean {\n\t\tif (isKeyRelease(data) || !this.keybindings.matches(data, \"app.thinking.toggle\")) return false;\n\t\t// Reuse the default editor's action dispatcher even while a workflow\n\t\t// overlay owns focus. This keeps the host binding and its user remap as\n\t\t// the source of truth instead of calling the implementation directly.\n\t\treturn this.defaultEditor.handleInput(data);\n\t}\n\n\tsetFullscreenCopyOnSelect(enabled: boolean): void {\n\t\tif (this.renderer.mode === \"fullscreen\") this.renderer.setCopyOnSelect(enabled);\n\t}\n\n\tprivate readonly onRightClickPaste = (): void => {\n\t\tvoid this.handleRightClickPaste();\n\t};\n\n\tchatContainer: Container;\n\tdocumentContainer: Container;\n\n\ttranscriptScrollView: ScrollView | undefined;\n\n\tfullscreenLayoutRoot: Component | undefined;\n\n\tresourceDisclosureContainer: Container;\n\tstartupNoticesContainer: Container;\n\tpendingMessagesContainer: Container;\n\n\tstatusContainer: Container;\n\n\tdefaultEditor: CustomEditor;\n\n\teditor: EditorComponent;\n\n\teditorComponentFactory: EditorFactory | undefined;\n\n\tautocompleteProvider: AutocompleteProvider | undefined;\n\n\tautocompleteProviderWrappers: AutocompleteProviderFactory[] = [];\n\n\tfdPath: string | undefined;\n\n\teditorContainer: Container;\n\n\tactiveSelectorToken: object | undefined;\n\n\tactiveSelectorDispose: (() => void) | undefined;\n\n\tfooter: FooterComponent;\n\tfooterContainer: Container;\n\n\tusageMeter: UsageMeterComponent;\n\n\tfooterDataProvider: FooterDataProvider;\n\n\t// Stored so the same manager can be injected into custom editors, selectors, and extension UI.\n\tkeybindings: KeybindingsManager;\n\n\treloadCoordinator: KeybindingsReloadCoordinator;\n\n\tinteractiveEngineShortcutHandler: ((data: string) => boolean) | undefined;\n\n\tdisposeInteractiveEngineHost: () => void = () => {};\n\tdisposeMarkitDiagnosticSink: () => void = () => {};\n\n\tversion: string;\n\n\tisInitialized = false;\n\n\tonInputCallback?: (submission: InteractiveSubmission) => void;\n\n\tpendingUserInputs: InteractiveSubmission[] = [];\n\n\tstartupReplayInputs: string[] = [];\n\n\tstartupReplayActiveInput: string | undefined = undefined;\n\n\tstartupDraftText: string | undefined = undefined;\n\tworkingIndicatorEmbedded = false;\n\n\tstartupCookedInputRecovered = false;\n\n\tdeferredRenderedUserInputs: string[] = [];\n\n\tdeferredRenderedUserInputComponents = new Map<string, Component[][]>();\n\n\tloadingAnimation: Loader | AtomicWorkingLoader | undefined = undefined;\n\n\tworkingMessage: string | undefined = undefined;\n\n\tworkingVisible = true;\n\n\tworkingIndicatorOptions: LoaderIndicatorOptions | undefined = undefined;\n\n\treadonly defaultWorkingMessage = \"Working\";\n\n\treadonly defaultHiddenThinkingLabel = \"Thinking...\";\n\n\thiddenThinkingLabel = this.defaultHiddenThinkingLabel;\n\n\tlastSigintTime = 0;\n\n\tlastEscapeTime = 0;\n\n\tchangelogMarkdown: string | undefined = undefined;\n\n\tstartupNoticesShown = false;\n\t/** Last model-catalog warning already shown, so the deferred re-read only speaks on a change. */\n\treportedModelCatalogWarning: string | undefined;\n\tstartupNoticesPrepared = false;\n\n\tanthropicSubscriptionWarningShown = false;\n\n\tfirstRunNoticeVisible = false;\n\n\thadLastChangelogVersionAtStartup = false;\n\n\tfirstRunOnboardingNoticeComponents: Component[] = [];\n\n\tautoTrustOnReloadCwd: string | undefined;\n\n\t// Status line tracking (for mutating immediately-sequential status updates)\n\tlastStatusSpacer: Spacer | undefined = undefined;\n\n\tlastStatusText: Text | undefined = undefined;\n\n\t/** Leading spacer added once for the managed-tool startup status block. */\n\tmanagedToolStatusStarted = false;\n\t/** Invalidates readiness callbacks after the transcript is rebuilt for another session. */\n\tmanagedToolStatusGeneration = 0;\n\n\t// Streaming message tracking\n\tstreamingComponent: AssistantMessageComponent | undefined = undefined;\n\n\tstreamingMessage: AssistantMessage | undefined = undefined;\n\n\t// Tool execution tracking: toolCallId -> component\n\tpendingTools = new Map<string, ToolExecutionComponent | RemoteToolExecutionComponent>();\n\n\t// Tool output expansion state\n\ttoolOutputExpanded = false;\n\n\t// Thinking block visibility state\n\thideThinkingBlock = false;\n\toutputPad: 0 | 1 = 1;\n\n\tmermaidMarkdownTransformer: MarkdownTransformer = createMermaidMarkdownTransformer({\n\t\tgetMode: () => this.settingsManager.getMermaidRenderingMode(),\n\t\ttheme,\n\t});\n\tmermaidMarkdownTransformerMode: MermaidRenderingMode | undefined;\n\n\t// Skill commands: command name -> skill file path\n\tskillCommands = new Map<string, string>();\n\n\t// Agent subscription unsubscribe function\n\tunsubscribe?: () => void;\n\n\tsignalCleanupHandlers: Array<() => void> = [];\n\n\t// Track if editor is in bash mode (text starts with !)\n\tisBashMode = false;\n\n\t// Track current bash execution component\n\tbashComponent: BashExecutionComponent | undefined = undefined;\n\n\t// Track pending bash components (shown in pending area, moved to chat on submit)\n\tpendingBashComponents: BashExecutionComponent[] = [];\n\n\t// Auto-compaction state\n\tautoCompactionLoader: AtomicWorkingLoader | undefined = undefined;\n\n\tautoCompactionEscapeHandler?: () => void;\n\n\t/** True once the pre-compaction Escape handler has been captured for restore. */\n\tautoCompactionEscapeHandlerSaved = false;\n\n\t/** True while `runUserPromptTurn()` owns the working loader. */\n\tpromptTurnWorkingLoaderActive = false;\n\n\t// Auto-retry state\n\tretryLoader: AtomicWorkingLoader | undefined = undefined;\n\tfallbackLoader: Loader | undefined = undefined;\n\n\tretryCountdown: CountdownTimer | undefined = undefined;\n\n\tretryEscapeHandler?: () => void;\n\n\t// Messages queued while compaction is running\n\tcompactionQueuedMessages: CompactionQueuedMessage[] = [];\n\n\t/** Keeps input queued while automatic compaction hands off to a manual request. */\n\tmanualCompactionTakeoverPending = false;\n\n\t// Deferred extension load state (first paint happens before extensions load)\n\tdeferredStartupPending = false;\n\tinitialStartupBinding = false;\n\tdeferredStartupPromise: Promise<void> | undefined = undefined;\n\n\tinputHandlerReadyRecorded = false;\n\n\tfirstSubmitRecorded = false;\n\n\t// Shutdown state\n\tshutdownRequested = false;\n\n\t// Extension UI state\n\textensionSelector: ExtensionSelectorComponent | undefined = undefined;\n\n\textensionInput: ExtensionInputComponent | undefined = undefined;\n\n\textensionEditor: ExtensionEditorComponent | undefined = undefined;\n\n\ttuiInputSubscriptions = new Set<InteractiveTuiInputSubscription>();\n\n\textensionTerminalInputSubscriptions = new Set<InteractiveTuiInputSubscription>();\n\n\ttuiRendererChangeListeners = new Set<() => void>();\n\n\tblockingInlineCustomUiDepth = 0;\n\n\tnavigationInlineCustomUiDepth = 0;\n\n\tdeferredInlineCustomUiFocusDepth = 0;\n\n\tpendingInlineCustomUiFocus: Component | undefined = undefined;\n\n\t/** Pending inline mounts in display order, oldest first. */\n\tinlineCustomUiStack: { component: Component }[] = [];\n\n\thostCustomUiStateListeners = new Set<HostCustomUiStateListener>();\n\n\twidgetReleaseListeners = new Map<string, Set<() => void>>();\n\n\ttranscriptOverlayReserve: TranscriptOverlayReserve | undefined = undefined;\n\n\tthemeController: InteractiveThemeController;\n\n\t// Extension widgets (components rendered above/below the editor)\n\textensionWidgetsAbove = new Map<string, Component & { dispose?(): void }>();\n\n\textensionWidgetsBelow = new Map<string, Component & { dispose?(): void }>();\n\n\twidgetContainerAbove!: Container;\n\n\twidgetContainerBelow!: Container;\n\n\t// Custom footer from extension (undefined = use built-in footer)\n\tcustomFooter: (Component & { dispose?(): void }) | undefined = undefined;\n\n\t// Header container that holds the built-in or custom header\n\theaderContainer: Container;\n\n\t// Built-in header (logo + keybinding hints + changelog)\n\tbuiltInHeader: Component | undefined = undefined;\n\n\t// Custom header from extension (undefined = use built-in header)\n\tcustomHeader: (Component & { dispose?(): void }) | undefined = undefined;\n\n\t// Convenience accessors\n\tget session(): AgentSession & AgentSessionQueuePauseControl {\n\t\treturn this.runtimeHost.session as AgentSession & AgentSessionQueuePauseControl;\n\t}\n\n\t/** Includes the short handoff window that an isolated engine cannot mirror. */\n\tget compactionActive(): boolean {\n\t\treturn this.session.isCompacting || this.manualCompactionTakeoverPending;\n\t}\n\n\tget agent() {\n\t\treturn this.session.agent;\n\t}\n\n\tget sessionManager() {\n\t\treturn this.session.sessionManager;\n\t}\n\n\tget settingsManager() {\n\t\treturn this.session.settingsManager;\n\t}\n\n\t/**\n\t * Tears down the selector that owns `editorContainer`, including in-flight\n\t * work such as a model catalog refresh.\n\t *\n\t * This lives on the base class so behavior modules can dispose a selector\n\t * without relying on `interactive-selectors.ts` load order.\n\t */\n\tdisposeActiveSelector(): void {\n\t\tconst dispose = this.activeSelectorDispose;\n\t\tthis.activeSelectorToken = undefined;\n\t\tthis.activeSelectorDispose = undefined;\n\t\tdispose?.();\n\t}\n\n\taddTuiInputListener(handler: TuiInputListener): () => void {\n\t\tconst subscription: InteractiveTuiInputSubscription = {\n\t\t\thandler,\n\t\t\tunsubscribe: this.ui.addInputListener(handler),\n\t\t};\n\t\tthis.tuiInputSubscriptions.add(subscription);\n\t\treturn () => {\n\t\t\tsubscription.unsubscribe();\n\t\t\tthis.tuiInputSubscriptions.delete(subscription);\n\t\t};\n\t}\n\n\trebindTuiInputListeners(): void {\n\t\tfor (const subscription of this.tuiInputSubscriptions) {\n\t\t\tsubscription.unsubscribe();\n\t\t\tsubscription.unsubscribe = this.ui.addInputListener(subscription.handler);\n\t\t}\n\t}\n\n\tonTuiRendererChange(listener: () => void): () => void {\n\t\tthis.tuiRendererChangeListeners.add(listener);\n\t\treturn () => this.tuiRendererChangeListeners.delete(listener);\n\t}\n\n\tmountInteractiveTui(tui: TUI, components: readonly Component[]): void {\n\t\tfor (const component of components) tui.addChild(component);\n\t\tif (isViewportTUI(tui)) {\n\t\t\tif (!this.fullscreenLayoutRoot) throw new Error(\"Fullscreen layout is not initialized\");\n\t\t\ttui.setLayoutRoot(this.fullscreenLayoutRoot);\n\t\t}\n\t}\n\n\tprivate async handleRightClickPaste(): Promise<void> {\n\t\tconst target = this.renderer.getFocusedComponent();\n\t\tconst handleInput = target?.handleInput;\n\t\tif (!target || !handleInput) return;\n\t\ttry {\n\t\t\tconst text = await readClipboardText();\n\t\t\tif (!text || this.renderer.getFocusedComponent() !== target) return;\n\t\t\thandleInput.call(target, `\\x1b[200~${text}\\x1b[201~`);\n\t\t\tthis.ui.requestRender();\n\t\t} catch {\n\t\t\t// Clipboard paste is best-effort; permission and native-module failures are common.\n\t\t}\n\t}\n\n\tstopInteractiveTui(fullscreenExitOutput: FullscreenExitOutput): void {\n\t\tconst isFullscreen = this.renderer.mode === \"fullscreen\";\n\t\tif (isFullscreen && fullscreenExitOutput === \"transcript\") {\n\t\t\t// Atomic has no regular renderer to switch into, so pi-tui's own\n\t\t\t// exit paint is the only painter: its stop renders the layout root\n\t\t\t// at natural height onto the main screen. The docked fullscreen\n\t\t\t// layout squeezes its scroll view to `basis` (one row) at natural\n\t\t\t// height, so hand it the document container directly — the exit\n\t\t\t// paint then carries the whole transcript. Drop overlays first so\n\t\t\t// what gets painted is the transcript, not the focused dialog.\n\t\t\twhile (this.renderer.hasOverlayEntries) this.renderer.hideOverlay();\n\t\t\tif (isViewportTUI(this.renderer)) this.renderer.setLayoutRoot(this.documentContainer);\n\t\t}\n\t\t// `resume-hint` keeps whatever the alternate screen held: the prior\n\t\t// shell contents reappear and shutdown prints only the resume line.\n\t\tthis.ui.stop({ preserveScreen: isFullscreen && fullscreenExitOutput === \"resume-hint\" });\n\t\tthis.disposeMarkitDiagnosticSink();\n\t}\n\n\tdeclare options: InteractiveModeOptions;\n\n\tsetEditorWorkingStatusIndicator(indicator: AtomicWorkingLoader | undefined): boolean {\n\t\tthis.defaultEditor.setWorkingStatusIndicator(undefined);\n\t\tif (!isWorkingStatusEditor(this.editor)) return false;\n\t\tthis.editor.setWorkingStatusIndicator(indicator);\n\t\treturn true;\n\t}\n\n\tconstructor(runtimeHost: AgentSessionRuntime, options: InteractiveModeOptions = {}) {\n\t\tthis.runtimeHost = runtimeHost;\n\t\tthis.options = options;\n\t\tthis.deferredStartupPending = Boolean(options.deferredExtensionLoad);\n\t\tthis.autoTrustOnReloadCwd = options.autoTrustOnReloadCwd;\n\t\tthis.runtimeHost.setBeforeSessionInvalidate(() => {\n\t\t\tthis.resetExtensionUI();\n\t\t});\n\t\tthis.runtimeHost.setRebindSession(async () => {\n\t\t\tawait this.rebindCurrentSession();\n\t\t\t// A rebound session can carry a different settings manager; re-apply\n\t\t\t// the theme so the live selection tracks the session that is current.\n\t\t\tawait this.themeController.applyFromSettings();\n\t\t});\n\t\tsetCapabilityOverrides(this.settingsManager.getTerminalCapabilityOverrides());\n\t\tthis.version = VERSION;\n\t\tthis.renderer = createInteractiveTui({\n\t\t\tshowHardwareCursor: this.settingsManager.getShowHardwareCursor(),\n\t\t\tlogDirectory: runtimeHost.services.agentDir,\n\t\t\tterminal: options.terminal,\n\t\t\tcopyOnSelect: this.settingsManager.getFullscreenCopyOnSelect(),\n\t\t\tonRightClickPaste: this.onRightClickPaste,\n\t\t\tshouldHandleViewportInput: this.shouldHandleViewportInput,\n\t\t\tonOverlayUnhandledInput: this.onOverlayUnhandledInput,\n\t\t\tonOverlayInternalUiAction: this.onOverlayInternalUiAction,\n\t\t\tonInternalUiAction: () => {\n\t\t\t\tthis.jumpToTranscriptEnd();\n\t\t\t\treturn undefined;\n\t\t\t},\n\t\t});\n\t\tthis.ui = createInteractiveTuiReference(() => this.renderer);\n\t\tthis.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n\t\tthis.headerContainer = new Container();\n\t\tthis.documentContainer = new Container();\n\t\tthis.documentContainer.addChild(this.headerContainer);\n\t\tthis.chatContainer = new StartupChatContainer();\n\t\tthis.documentContainer.addChild(this.chatContainer);\n\t\tthis.resourceDisclosureContainer = new Container();\n\t\tthis.startupNoticesContainer = new Container();\n\t\t// The isolated engine can emit session_start UI requests as soon as its\n\t\t// bridge attaches below, before init() mounts chat in the TUI. Reserve the\n\t\t// ordering slots now so those messages can never precede RESOURCES.\n\t\tthis.chatContainer.addChild(this.resourceDisclosureContainer);\n\t\tthis.chatContainer.addChild(this.startupNoticesContainer);\n\t\tthis.pendingMessagesContainer = new Container();\n\t\tthis.statusContainer = new Container();\n\t\tthis.widgetContainerAbove = new WidgetContainer();\n\t\tthis.widgetContainerBelow = new WidgetContainer();\n\t\tthis.keybindings = KeybindingsManager.create(runtimeHost.services.agentDir);\n\t\tthis.reloadCoordinator = new KeybindingsReloadCoordinator(this.keybindings);\n\t\tsetKeybindings(this.keybindings);\n\t\tconst editorPaddingX = this.settingsManager.getEditorPaddingX();\n\t\tconst autocompleteMaxVisible = this.settingsManager.getAutocompleteMaxVisible();\n\t\tthis.defaultEditor = new CustomEditor(this.ui, getEditorTheme(), this.keybindings, {\n\t\t\tpaddingX: editorPaddingX,\n\t\t\tautocompleteMaxVisible,\n\t\t});\n\n\t\tthis.editor = this.defaultEditor;\n\t\tthis.editorContainer = new Container();\n\t\tthis.editorContainer.addChild(this.editor as Component);\n\t\tthis.footerDataProvider = new FooterDataProvider(this.sessionManager.getCwd());\n\t\tthis.footer = new FooterComponent(\n\t\t\tthis.session,\n\t\t\tthis.footerDataProvider,\n\t\t\tundefined,\n\t\t\t() => this.navigationInlineCustomUiDepth > 0,\n\t\t);\n\t\tthis.footerContainer = new Container();\n\t\tthis.footerContainer.addChild(this.footer);\n\t\tthis.usageMeter = new UsageMeterComponent(this.session);\n\t\tthis.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n\n\t\t// Load hide thinking block setting\n\t\tthis.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n\t\tthis.outputPad = this.settingsManager.getOutputPad();\n\n\t\t// Register themes from resource loader and initialize\n\t\tsetRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n\t\tthis.themeController = new InteractiveThemeController(this.ui, {\n\t\t\tgetSettingsManager: () => this.settingsManager,\n\t\t\tshowError: (message) => this.showError(message),\n\t\t\tonChanged: () => this.updateEditorBorderColor(),\n\t\t\tinitialThemeSetting: options.initialThemeSetting,\n\t\t});\n\t\tthis.disposeInteractiveEngineHost = attachInteractiveEngineHost(\n\t\t\truntimeHost,\n\t\t\tthis.createExtensionUIContext(),\n\t\t\t(diagnostic) =>\n\t\t\t\trenderEngineDiagnostic(diagnostic, {\n\t\t\t\t\tstopWorkingLoader: () => this.stopWorkingLoader(),\n\t\t\t\t\tshowStatus: (message, persist) => this.showStatus(message, persist),\n\t\t\t\t\tshowError: (message) => this.showError(message),\n\t\t\t\t}),\n\t\t\t{\n\t\t\t\tisFullscreen: () => this.renderer.mode === \"fullscreen\",\n\t\t\t\tonRendererReplaced: (listener) => this.onTuiRendererChange(listener),\n\t\t\t},\n\t\t\t(handler) => {\n\t\t\t\tthis.interactiveEngineShortcutHandler = handler;\n\t\t\t\tthis.defaultEditor.onExtensionShortcut = handler;\n\t\t\t\treturn () => {\n\t\t\t\t\tif (this.interactiveEngineShortcutHandler === handler) this.interactiveEngineShortcutHandler = undefined;\n\t\t\t\t\tif (this.defaultEditor.onExtensionShortcut === handler)\n\t\t\t\t\t\tthis.defaultEditor.onExtensionShortcut = undefined;\n\t\t\t\t};\n\t\t\t},\n\t\t\tthis.keybindings,\n\t\t);\n\t}\n\n\t// Maximum total widget lines to prevent viewport overflow\n\tstatic readonly MAX_WIDGET_LINES = 10;\n\n\t/**\n\t * Gracefully shutdown the agent.\n\t * Stops the TUI before emitting shutdown events so extension UI cleanup cannot\n\t * repaint the final frame while the process is exiting.\n\t */\n\tisShuttingDown = false;\n}\n"]}
@@ -26,7 +26,10 @@ export declare class EngineCustomUiService {
26
26
  private readonly widgetReleaseListeners;
27
27
  setWidget(key: string, factory: ((tui: TUI, theme: Theme) => Component & {
28
28
  dispose?(): void;
29
- }) | undefined, placement?: "aboveEditor" | "belowEditor"): void;
29
+ }) | undefined, placement?: "aboveEditor" | "belowEditor", scroll?: {
30
+ maxHeight: number;
31
+ maxHeightFraction?: number;
32
+ }): void;
30
33
  constructor(write: (line: string) => void, keybindings: KeybindingsManager);
31
34
  custom<T>(factory: (tui: TUI, theme: Theme, keybindings: KeybindingsManager, done: (result: T) => void) => (Component & {
32
35
  dispose?(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"engine-custom-ui.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive-engine/engine-custom-ui.ts"],"names":[],"mappings":"AAAA,OAAO,EACN,KAAK,SAAS,EAEd,KAAK,aAAa,EAClB,KAAK,cAAc,EAEnB,KAAK,G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AC,EAAE;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,iBAAiB,CAAC,EAAE,MAAM,CAAA;KAAE,GACxD,IAAI,CAyCN;IACD,YAAY,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,EAAE,WAAW,EAAE,kBAAkB,EAGzE;IAEK,MAAM,CAAC,CAAC,EACb,OAAO,EAAE,CACR,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,kBAAkB,EAC/B,IAAI,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,IAAI,KACrB,CAAC,SAAS,GAAG;QAAE,OAAO,CAAC,IAAI,IAAI,CAAA;KAAE,CAAC,GAAG,OAAO,CAAC,SAAS,GAAG;QAAE,OAAO,CAAC,IAAI,IAAI,CAAA;KAAE,CAAC,EACnF,OAAO,CAAC,EAAE,eAAe,GACvB,OAAO,CAAC,CAAC,CAAC,CAyDZ;IACD,oBAAoB,IAAI,iBAAiB,CAQxC;IAED,yBAAyB,CAAC,QAAQ,EAAE,yBAAyB,GAAG,MAAM,IAAI,CAGzE;IACD,eAAe,CAAC,GAAG,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAQ7D;IAED,uBAAuB,IAAI,OAAO,CAEjC;IAED,aAAa,IAAI,IAAI,CAKpB;IAED,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAwEhC;IAED,OAAO,IAAI,IAAI,CAEd;IACD,OAAO,CAAC,gBAAgB;IAexB,OAAO,CAAC,mBAAmB;IAS3B,OAAO,CAAC,WAAW;IAKnB,OAAO,CAAC,YAAY;IA6BpB,OAAO,CAAC,QAAQ;IAQhB,OAAO,CAAC,IAAI;CAGZ"}
@@ -49,7 +49,7 @@ function jsonResult(value) {
49
49
  return decoded;
50
50
  }
51
51
  export class EngineCustomUiService {
52
- setWidget(key, factory, placement) {
52
+ setWidget(key, factory, placement, scroll) {
53
53
  const previous = this.widgetIds.get(key);
54
54
  if (previous)
55
55
  this.disposeComponent(previous, false, false);
@@ -80,6 +80,7 @@ export class EngineCustomUiService {
80
80
  overlay: false,
81
81
  widgetKey: key,
82
82
  widgetPlacement: placement,
83
+ ...(scroll ? { widgetScroll: scroll } : {}),
83
84
  });
84
85
  })
85
86
  .catch((error) => {
@@ -213,16 +214,23 @@ export class EngineCustomUiService {
213
214
  return true;
214
215
  }
215
216
  switch (command.type) {
217
+ case "engine_custom_scroll":
218
+ record.component.onScroll?.(command.state);
219
+ break;
216
220
  case "engine_custom_render":
217
221
  record.terminal.columns = Math.max(1, command.width);
218
222
  record.terminal.rows = Math.max(1, command.rows);
219
223
  void runCallback({ kind: "renderer", name: command.componentId }, () => record.component.render(record.terminal.columns))
220
- .then((lines) => this.send({
221
- type: "engine_custom_frame",
222
- componentId: command.componentId,
223
- requestId: command.requestId,
224
- lines,
225
- }))
224
+ .then((lines) => {
225
+ const scrollRequest = record.component.getScrollRequest?.();
226
+ this.send({
227
+ type: "engine_custom_frame",
228
+ componentId: command.componentId,
229
+ requestId: command.requestId,
230
+ lines,
231
+ ...(scrollRequest ? { scrollRequest } : {}),
232
+ });
233
+ })
226
234
  .catch((error) => this.send({
227
235
  type: "engine_custom_frame",
228
236
  componentId: command.componentId,