@bastani/atomic 0.9.4-alpha.8 → 0.9.4

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 (166) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/dist/builtin/cursor/CHANGELOG.md +6 -0
  3. package/dist/builtin/cursor/package.json +2 -2
  4. package/dist/builtin/intercom/CHANGELOG.md +6 -0
  5. package/dist/builtin/intercom/package.json +1 -1
  6. package/dist/builtin/mcp/CHANGELOG.md +6 -0
  7. package/dist/builtin/mcp/package.json +1 -1
  8. package/dist/builtin/subagents/CHANGELOG.md +34 -0
  9. package/dist/builtin/subagents/agents/code-simplifier.md +2 -2
  10. package/dist/builtin/subagents/agents/codebase-analyzer.md +2 -2
  11. package/dist/builtin/subagents/agents/codebase-locator.md +2 -2
  12. package/dist/builtin/subagents/agents/codebase-online-researcher.md +2 -2
  13. package/dist/builtin/subagents/agents/codebase-pattern-finder.md +2 -2
  14. package/dist/builtin/subagents/agents/codebase-research-analyzer.md +2 -2
  15. package/dist/builtin/subagents/agents/codebase-research-locator.md +2 -2
  16. package/dist/builtin/subagents/agents/debugger.md +1 -1
  17. package/dist/builtin/subagents/agents/worker.md +2 -2
  18. package/dist/builtin/subagents/package.json +1 -1
  19. package/dist/builtin/subagents/src/slash/slash-commands.ts +2 -2
  20. package/dist/builtin/subagents/src/tui/render-result-compact.ts +3 -2
  21. package/dist/builtin/subagents/src/tui/render-result.ts +3 -3
  22. package/dist/builtin/subagents/src/tui/render-widget-graph.ts +4 -3
  23. package/dist/builtin/subagents/src/tui/render-widget.ts +10 -4
  24. package/dist/builtin/web-access/CHANGELOG.md +6 -0
  25. package/dist/builtin/web-access/package.json +1 -1
  26. package/dist/builtin/workflows/CHANGELOG.md +30 -0
  27. package/dist/builtin/workflows/builtin/deep-research-codebase-utils.ts +24 -29
  28. package/dist/builtin/workflows/builtin/goal-runner.ts +13 -37
  29. package/dist/builtin/workflows/builtin/open-claude-design-runner.ts +6 -9
  30. package/dist/builtin/workflows/builtin/ralph-models.ts +58 -115
  31. package/dist/builtin/workflows/package.json +1 -1
  32. package/dist/builtin/workflows/src/tui/keybindings-adapter.ts +4 -0
  33. package/dist/builtin/workflows/src/tui/overlay-adapter.ts +4 -0
  34. package/dist/builtin/workflows/src/tui/stage-chat-view-input.ts +12 -1
  35. package/dist/builtin/workflows/src/tui/stage-chat-view-state.ts +2 -0
  36. package/dist/builtin/workflows/src/tui/stage-chat-view-types.ts +6 -0
  37. package/dist/builtin/workflows/src/tui/stage-chat-view.ts +4 -0
  38. package/dist/builtin/workflows/src/tui/workflow-attach-pane-types.ts +4 -0
  39. package/dist/builtin/workflows/src/tui/workflow-attach-pane.ts +8 -9
  40. package/dist/bun/cli.d.ts.map +1 -1
  41. package/dist/bun/cli.js +3 -2
  42. package/dist/bun/cli.js.map +1 -1
  43. package/dist/cli.d.ts.map +1 -1
  44. package/dist/cli.js +15 -5
  45. package/dist/cli.js.map +1 -1
  46. package/dist/config.d.ts +10 -3
  47. package/dist/config.d.ts.map +1 -1
  48. package/dist/config.js +18 -1
  49. package/dist/config.js.map +1 -1
  50. package/dist/core/agent-session-events.d.ts.map +1 -1
  51. package/dist/core/agent-session-events.js +16 -8
  52. package/dist/core/agent-session-events.js.map +1 -1
  53. package/dist/core/agent-session-export.d.ts.map +1 -1
  54. package/dist/core/agent-session-export.js +4 -2
  55. package/dist/core/agent-session-export.js.map +1 -1
  56. package/dist/core/agent-session-extension-bindings.d.ts +3 -1
  57. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  58. package/dist/core/agent-session-extension-bindings.js +7 -4
  59. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  60. package/dist/core/agent-session-methods.d.ts +8 -2
  61. package/dist/core/agent-session-methods.d.ts.map +1 -1
  62. package/dist/core/agent-session-methods.js.map +1 -1
  63. package/dist/core/agent-session-retry.d.ts +2 -0
  64. package/dist/core/agent-session-retry.d.ts.map +1 -1
  65. package/dist/core/agent-session-retry.js +66 -7
  66. package/dist/core/agent-session-retry.js.map +1 -1
  67. package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
  68. package/dist/core/agent-session-tool-registry.js +4 -0
  69. package/dist/core/agent-session-tool-registry.js.map +1 -1
  70. package/dist/core/agent-session.d.ts +4 -1
  71. package/dist/core/agent-session.d.ts.map +1 -1
  72. package/dist/core/agent-session.js +4 -0
  73. package/dist/core/agent-session.js.map +1 -1
  74. package/dist/core/async/format.d.ts +3 -0
  75. package/dist/core/async/format.d.ts.map +1 -0
  76. package/dist/core/async/format.js +50 -0
  77. package/dist/core/async/format.js.map +1 -0
  78. package/dist/core/async/job-manager.d.ts +39 -0
  79. package/dist/core/async/job-manager.d.ts.map +1 -0
  80. package/dist/core/async/job-manager.js +254 -0
  81. package/dist/core/async/job-manager.js.map +1 -0
  82. package/dist/core/async/session-manager.d.ts +18 -0
  83. package/dist/core/async/session-manager.d.ts.map +1 -0
  84. package/dist/core/async/session-manager.js +61 -0
  85. package/dist/core/async/session-manager.js.map +1 -0
  86. package/dist/core/async/types.d.ts +23 -0
  87. package/dist/core/async/types.d.ts.map +1 -0
  88. package/dist/core/async/types.js +2 -0
  89. package/dist/core/async/types.js.map +1 -0
  90. package/dist/core/copilot-model-static-fallbacks.d.ts +43 -0
  91. package/dist/core/copilot-model-static-fallbacks.d.ts.map +1 -0
  92. package/dist/core/copilot-model-static-fallbacks.js +50 -0
  93. package/dist/core/copilot-model-static-fallbacks.js.map +1 -0
  94. package/dist/core/extensions/loader-virtual-modules.d.ts +11 -0
  95. package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
  96. package/dist/core/extensions/loader-virtual-modules.js +79 -11
  97. package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
  98. package/dist/core/model-registry-builtins.d.ts.map +1 -1
  99. package/dist/core/model-registry-builtins.js +9 -1
  100. package/dist/core/model-registry-builtins.js.map +1 -1
  101. package/dist/core/resource-loader-reload.d.ts.map +1 -1
  102. package/dist/core/resource-loader-reload.js +4 -2
  103. package/dist/core/resource-loader-reload.js.map +1 -1
  104. package/dist/core/resource-loader-types.d.ts +6 -0
  105. package/dist/core/resource-loader-types.d.ts.map +1 -1
  106. package/dist/core/resource-loader-types.js.map +1 -1
  107. package/dist/core/tools/bash-async-execution.d.ts +25 -0
  108. package/dist/core/tools/bash-async-execution.d.ts.map +1 -0
  109. package/dist/core/tools/bash-async-execution.js +71 -0
  110. package/dist/core/tools/bash-async-execution.js.map +1 -0
  111. package/dist/core/tools/bash-async-jobs.d.ts +10 -0
  112. package/dist/core/tools/bash-async-jobs.d.ts.map +1 -1
  113. package/dist/core/tools/bash-async-jobs.js +18 -2
  114. package/dist/core/tools/bash-async-jobs.js.map +1 -1
  115. package/dist/core/tools/bash-async-output.d.ts +3 -1
  116. package/dist/core/tools/bash-async-output.d.ts.map +1 -1
  117. package/dist/core/tools/bash-async-output.js +4 -1
  118. package/dist/core/tools/bash-async-output.js.map +1 -1
  119. package/dist/core/tools/bash-pty-native.d.ts.map +1 -1
  120. package/dist/core/tools/bash-pty-native.js +2 -2
  121. package/dist/core/tools/bash-pty-native.js.map +1 -1
  122. package/dist/core/tools/bash.d.ts +10 -4
  123. package/dist/core/tools/bash.d.ts.map +1 -1
  124. package/dist/core/tools/bash.js +20 -38
  125. package/dist/core/tools/bash.js.map +1 -1
  126. package/dist/core/tools/search-native.d.ts.map +1 -1
  127. package/dist/core/tools/search-native.js +2 -2
  128. package/dist/core/tools/search-native.js.map +1 -1
  129. package/dist/main.d.ts.map +1 -1
  130. package/dist/main.js +56 -32
  131. package/dist/main.js.map +1 -1
  132. package/dist/modes/interactive/interactive-deferred-startup.d.ts +2 -0
  133. package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -0
  134. package/dist/modes/interactive/interactive-deferred-startup.js +59 -0
  135. package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -0
  136. package/dist/modes/interactive/interactive-mode-base.d.ts +2 -0
  137. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  138. package/dist/modes/interactive/interactive-mode-base.js +4 -0
  139. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  140. package/dist/modes/interactive/interactive-mode-deps.d.ts +1 -1
  141. package/dist/modes/interactive/interactive-mode-deps.d.ts.map +1 -1
  142. package/dist/modes/interactive/interactive-mode-deps.js +1 -1
  143. package/dist/modes/interactive/interactive-mode-deps.js.map +1 -1
  144. package/dist/modes/interactive/interactive-mode-surface.d.ts +2 -0
  145. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  146. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  147. package/dist/modes/interactive/interactive-mode-types.d.ts +2 -0
  148. package/dist/modes/interactive/interactive-mode-types.d.ts.map +1 -1
  149. package/dist/modes/interactive/interactive-mode-types.js.map +1 -1
  150. package/dist/modes/interactive/interactive-mode.d.ts +1 -0
  151. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  152. package/dist/modes/interactive/interactive-mode.js +1 -0
  153. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  154. package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
  155. package/dist/modes/interactive/interactive-session-runtime.js +4 -2
  156. package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
  157. package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
  158. package/dist/modes/interactive/interactive-startup.js +11 -1
  159. package/dist/modes/interactive/interactive-startup.js.map +1 -1
  160. package/dist/utils/module-require.d.ts +11 -0
  161. package/dist/utils/module-require.d.ts.map +1 -0
  162. package/dist/utils/module-require.js +16 -0
  163. package/dist/utils/module-require.js.map +1 -0
  164. package/docs/tools.md +4 -2
  165. package/npm-shrinkwrap.json +23 -23
  166. package/package.json +5 -3
@@ -5,6 +5,7 @@
5
5
  import "./interactive-autocomplete.js";
6
6
  import "./interactive-onboarding.js";
7
7
  import "./interactive-startup.js";
8
+ import "./interactive-deferred-startup.js";
8
9
  import "./interactive-resource-paths.js";
9
10
  import "./interactive-resource-disclosure.js";
10
11
  import "./interactive-resource-rendering.js";
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,iCAAiC,CAAC;AACzC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,iCAAiC,CAAC;AACzC,OAAO,+BAA+B,CAAC;AACvC,OAAO,8BAA8B,CAAC;AACtC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,4BAA4B,CAAC;AACpC,OAAO,gCAAgC,CAAC;AACxC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,iCAAiC,CAAC;AACzC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3F,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;CAAG","sourcesContent":["/**\n * Interactive mode for the coding agent.\n * Public entrypoint preserved while responsibilities live in sibling modules.\n */\n\nimport \"./interactive-autocomplete.ts\";\nimport \"./interactive-onboarding.ts\";\nimport \"./interactive-startup.ts\";\nimport \"./interactive-resource-paths.ts\";\nimport \"./interactive-resource-disclosure.ts\";\nimport \"./interactive-resource-rendering.ts\";\nimport \"./interactive-session-runtime.ts\";\nimport \"./interactive-extension-runtime.ts\";\nimport \"./interactive-extension-widgets.ts\";\nimport \"./interactive-extension-context.ts\";\nimport \"./interactive-extension-dialogs.ts\";\nimport \"./interactive-extension-custom-ui.ts\";\nimport \"./interactive-input-handling.ts\";\nimport \"./interactive-agent-events.ts\";\nimport \"./interactive-render-chat.ts\";\nimport \"./interactive-process-lifecycle.ts\";\nimport \"./interactive-editor-actions.ts\";\nimport \"./interactive-queueing.ts\";\nimport \"./interactive-selectors.ts\";\nimport \"./interactive-model-routing.ts\";\nimport \"./interactive-session-routing.ts\";\nimport \"./interactive-auth-routing.ts\";\nimport \"./interactive-auth-login.ts\";\nimport \"./interactive-slash-commands.ts\";\nimport \"./interactive-hotkeys-debug.ts\";\nimport \"./interactive-bash-compact.ts\";\n\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\n\nexport { formatResumeCommand, isApiKeyLoginProvider } from \"./interactive-mode-helpers.ts\";\nexport type { InteractiveModeOptions } from \"./interactive-mode-types.ts\";\n\nexport class InteractiveMode extends InteractiveModeBase {}\n"]}
1
+ {"version":3,"file":"interactive-mode.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,0BAA0B,CAAC;AAClC,OAAO,mCAAmC,CAAC;AAC3C,OAAO,iCAAiC,CAAC;AACzC,OAAO,sCAAsC,CAAC;AAC9C,OAAO,qCAAqC,CAAC;AAC7C,OAAO,kCAAkC,CAAC;AAC1C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,oCAAoC,CAAC;AAC5C,OAAO,sCAAsC,CAAC;AAC9C,OAAO,iCAAiC,CAAC;AACzC,OAAO,+BAA+B,CAAC;AACvC,OAAO,8BAA8B,CAAC;AACtC,OAAO,oCAAoC,CAAC;AAC5C,OAAO,iCAAiC,CAAC;AACzC,OAAO,2BAA2B,CAAC;AACnC,OAAO,4BAA4B,CAAC;AACpC,OAAO,gCAAgC,CAAC;AACxC,OAAO,kCAAkC,CAAC;AAC1C,OAAO,+BAA+B,CAAC;AACvC,OAAO,6BAA6B,CAAC;AACrC,OAAO,iCAAiC,CAAC;AACzC,OAAO,gCAAgC,CAAC;AACxC,OAAO,+BAA+B,CAAC;AAEvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAEjE,OAAO,EAAE,mBAAmB,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAG3F,MAAM,OAAO,eAAgB,SAAQ,mBAAmB;CAAG","sourcesContent":["/**\n * Interactive mode for the coding agent.\n * Public entrypoint preserved while responsibilities live in sibling modules.\n */\n\nimport \"./interactive-autocomplete.ts\";\nimport \"./interactive-onboarding.ts\";\nimport \"./interactive-startup.ts\";\nimport \"./interactive-deferred-startup.ts\";\nimport \"./interactive-resource-paths.ts\";\nimport \"./interactive-resource-disclosure.ts\";\nimport \"./interactive-resource-rendering.ts\";\nimport \"./interactive-session-runtime.ts\";\nimport \"./interactive-extension-runtime.ts\";\nimport \"./interactive-extension-widgets.ts\";\nimport \"./interactive-extension-context.ts\";\nimport \"./interactive-extension-dialogs.ts\";\nimport \"./interactive-extension-custom-ui.ts\";\nimport \"./interactive-input-handling.ts\";\nimport \"./interactive-agent-events.ts\";\nimport \"./interactive-render-chat.ts\";\nimport \"./interactive-process-lifecycle.ts\";\nimport \"./interactive-editor-actions.ts\";\nimport \"./interactive-queueing.ts\";\nimport \"./interactive-selectors.ts\";\nimport \"./interactive-model-routing.ts\";\nimport \"./interactive-session-routing.ts\";\nimport \"./interactive-auth-routing.ts\";\nimport \"./interactive-auth-login.ts\";\nimport \"./interactive-slash-commands.ts\";\nimport \"./interactive-hotkeys-debug.ts\";\nimport \"./interactive-bash-compact.ts\";\n\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\n\nexport { formatResumeCommand, isApiKeyLoginProvider } from \"./interactive-mode-helpers.ts\";\nexport type { InteractiveModeOptions } from \"./interactive-mode-types.ts\";\n\nexport class InteractiveMode extends InteractiveModeBase {}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type AgentSession, setRegisteredThemes, stopThemeWatcher } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function(this: InteractiveModeBase): Promise<void> {\n const uiContext = this.createExtensionUIContext();\n await this.session.bindExtensions({\n uiContext,\n mode: \"tui\",\n commandContextActions: {\n waitForIdle: () => this.session.agent.waitForIdle(),\n newSession: async (options) => {\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n }\n this.statusContainer.clear();\n try {\n const result = await this.runtimeHost.newSession(options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.ui.requestRender();\n }\n return result;\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to create session\",\n error,\n );\n }\n },\n fork: async (entryId, options) => {\n try {\n const result = await this.runtimeHost.fork(entryId, options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.editor.setText(result.selectedText ?? \"\");\n this.showStatus(\"Forked to new session\");\n }\n return { cancelled: result.cancelled };\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to fork session\",\n error,\n );\n }\n },\n navigateTree: async (targetId, options) => {\n const result = await this.session.navigateTree(targetId, {\n summarize: options?.summarize,\n customInstructions: options?.customInstructions,\n replaceInstructions: options?.replaceInstructions,\n label: options?.label,\n });\n if (result.cancelled) {\n return { cancelled: true };\n }\n\n this.chatContainer.clear();\n this.renderInitialMessages();\n if (result.editorText && !this.editor.getText().trim()) {\n this.editor.setText(result.editorText);\n }\n this.showStatus(\"Navigated to selected point\");\n void this.flushCompactionQueue({ willRetry: false });\n return { cancelled: false };\n },\n switchSession: async (sessionPath, options) => {\n return this.handleResumeSession(sessionPath, options);\n },\n reload: async () => {\n await this.handleReloadCommand();\n },\n },\n shutdownHandler: () => {\n this.shutdownRequested = true;\n if (!this.session.isStreaming) {\n void this.shutdown();\n }\n },\n onError: (error) => {\n this.showExtensionError(error.extensionPath, error.error, error.stack);\n },\n });\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n this.setupAutocompleteProvider();\n\n const extensionRunner = this.session.extensionRunner;\n this.setupExtensionShortcuts(extensionRunner);\n this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });\n this.showStartupNoticesIfNeeded();\n };\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function(this: InteractiveModeBase): void {\n this.footer.setSession(this.session);\n this.usageMeter.setSession(this.session);\n this.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n this.footerDataProvider.setCwd(this.sessionManager.getCwd());\n this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n this.outputPad = this.settingsManager.getOutputPad();\n this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n const editorPaddingX = this.settingsManager.getEditorPaddingX();\n const autocompleteMaxVisible =\n this.settingsManager.getAutocompleteMaxVisible();\n this.defaultEditor.setPaddingX(editorPaddingX);\n this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n if (this.editor !== this.defaultEditor) {\n this.editor.setPaddingX?.(editorPaddingX);\n this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n }\n };\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function(this: InteractiveModeBase): Promise<void> {\n this.unsubscribe?.();\n this.unsubscribe = undefined;\n this.applyRuntimeSettings();\n await this.bindCurrentSessionExtensions();\n this.subscribeToAgent();\n await this.updateAvailableProviderCount();\n this.updateEditorBorderColor();\n this.updateTerminalTitle();\n };\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function(this: InteractiveModeBase, prefix: string, error: unknown): Promise<never> {\n const message = error instanceof Error ? error.message : String(error);\n this.showError(`${prefix}: ${message}`);\n stopThemeWatcher();\n this.stop();\n process.exit(1);\n };\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function(this: InteractiveModeBase): void {\n this.chatContainer.clear();\n this.pendingMessagesContainer.clear();\n this.compactionQueuedMessages = [];\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n this.pendingTools.clear();\n this.renderInitialMessages();\n };\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function(this: InteractiveModeBase, toolName: string): ReturnType<AgentSession[\"getToolDefinition\"]> {\n return this.session.getToolDefinition(toolName);\n };\n"]}
1
+ {"version":3,"file":"interactive-session-runtime.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type AgentSession, setRegisteredThemes, stopThemeWatcher } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function(this: InteractiveModeBase): Promise<void> {\n const uiContext = this.createExtensionUIContext();\n await this.session.bindExtensions({\n uiContext,\n mode: \"tui\",\n commandContextActions: {\n waitForIdle: () => this.session.agent.waitForIdle(),\n newSession: async (options) => {\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n }\n this.statusContainer.clear();\n try {\n const result = await this.runtimeHost.newSession(options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.ui.requestRender();\n }\n return result;\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to create session\",\n error,\n );\n }\n },\n fork: async (entryId, options) => {\n try {\n const result = await this.runtimeHost.fork(entryId, options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.editor.setText(result.selectedText ?? \"\");\n this.showStatus(\"Forked to new session\");\n }\n return { cancelled: result.cancelled };\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to fork session\",\n error,\n );\n }\n },\n navigateTree: async (targetId, options) => {\n const result = await this.session.navigateTree(targetId, {\n summarize: options?.summarize,\n customInstructions: options?.customInstructions,\n replaceInstructions: options?.replaceInstructions,\n label: options?.label,\n });\n if (result.cancelled) {\n return { cancelled: true };\n }\n\n this.chatContainer.clear();\n this.renderInitialMessages();\n if (result.editorText && !this.editor.getText().trim()) {\n this.editor.setText(result.editorText);\n }\n this.showStatus(\"Navigated to selected point\");\n void this.flushCompactionQueue({ willRetry: false });\n return { cancelled: false };\n },\n switchSession: async (sessionPath, options) => {\n return this.handleResumeSession(sessionPath, options);\n },\n reload: async () => {\n await this.handleReloadCommand();\n },\n },\n shutdownHandler: () => {\n this.shutdownRequested = true;\n if (!this.session.isStreaming) {\n void this.shutdown();\n }\n },\n onError: (error) => {\n this.showExtensionError(error.extensionPath, error.error, error.stack);\n },\n });\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n this.setupAutocompleteProvider();\n\n const extensionRunner = this.session.extensionRunner;\n this.setupExtensionShortcuts(extensionRunner);\n if (!this.deferredStartupPending) {\n this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });\n this.showStartupNoticesIfNeeded();\n }\n };\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function(this: InteractiveModeBase): void {\n this.footer.setSession(this.session);\n this.usageMeter.setSession(this.session);\n this.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n this.footerDataProvider.setCwd(this.sessionManager.getCwd());\n this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n this.outputPad = this.settingsManager.getOutputPad();\n this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n const editorPaddingX = this.settingsManager.getEditorPaddingX();\n const autocompleteMaxVisible =\n this.settingsManager.getAutocompleteMaxVisible();\n this.defaultEditor.setPaddingX(editorPaddingX);\n this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n if (this.editor !== this.defaultEditor) {\n this.editor.setPaddingX?.(editorPaddingX);\n this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n }\n };\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function(this: InteractiveModeBase): Promise<void> {\n this.unsubscribe?.();\n this.unsubscribe = undefined;\n this.applyRuntimeSettings();\n await this.bindCurrentSessionExtensions();\n this.subscribeToAgent();\n await this.updateAvailableProviderCount();\n this.updateEditorBorderColor();\n this.updateTerminalTitle();\n };\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function(this: InteractiveModeBase, prefix: string, error: unknown): Promise<never> {\n const message = error instanceof Error ? error.message : String(error);\n this.showError(`${prefix}: ${message}`);\n stopThemeWatcher();\n this.stop();\n process.exit(1);\n };\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function(this: InteractiveModeBase): void {\n this.chatContainer.clear();\n this.pendingMessagesContainer.clear();\n this.compactionQueuedMessages = [];\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n this.pendingTools.clear();\n this.renderInitialMessages();\n };\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function(this: InteractiveModeBase, toolName: string): ReturnType<AgentSession[\"getToolDefinition\"]> {\n return this.session.getToolDefinition(toolName);\n };\n"]}
@@ -79,8 +79,10 @@ InteractiveModeBase.prototype.bindCurrentSessionExtensions = async function () {
79
79
  this.setupAutocompleteProvider();
80
80
  const extensionRunner = this.session.extensionRunner;
81
81
  this.setupExtensionShortcuts(extensionRunner);
82
- this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });
83
- this.showStartupNoticesIfNeeded();
82
+ if (!this.deferredStartupPending) {
83
+ this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });
84
+ this.showStartupNoticesIfNeeded();
85
+ }
84
86
  };
85
87
  InteractiveModeBase.prototype.applyRuntimeSettings = function () {
86
88
  this.footer.setSession(this.session);
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-session-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAqB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEtG,mBAAmB,CAAC,SAAS,CAAC,4BAA4B,GAAG,KAAK;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClD,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAChC,SAAS;QACT,IAAI,EAAE,KAAK;QACX,qBAAqB,EAAE;YACrB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE;YACnD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC5B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;oBAC7B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;gBACpC,CAAC;gBACD,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;gBAC7B,IAAI,CAAC;oBACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;oBAC1D,IAAI,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;wBACtB,IAAI,CAAC,yBAAyB,EAAE,CAAC;wBACjC,IAAI,CAAC,EAAE,CAAC,aAAa,EAAE,CAAC;oBAC1B,CAAC;oBACD,OAAO,MAAM,CAAC;gBAChB,CAAC;gBAAC,OAAO,KAAc,EAAE,CAAC;oBACxB,OAAO,IAAI,CAAC,uBAAuB,CACjC,0BAA0B,EAC1B,KAAK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CAAC,KAAK,EAAE,CAAC;IAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,2BAA2B,GAAG,UAAoC,QAAgB;IAC5G,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type AgentSession, setRegisteredThemes, stopThemeWatcher } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function(this: InteractiveModeBase): Promise<void> {\n const uiContext = this.createExtensionUIContext();\n await this.session.bindExtensions({\n uiContext,\n mode: \"tui\",\n commandContextActions: {\n waitForIdle: () => this.session.agent.waitForIdle(),\n newSession: async (options) => {\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n }\n this.statusContainer.clear();\n try {\n const result = await this.runtimeHost.newSession(options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.ui.requestRender();\n }\n return result;\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to create session\",\n error,\n );\n }\n },\n fork: async (entryId, options) => {\n try {\n const result = await this.runtimeHost.fork(entryId, options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.editor.setText(result.selectedText ?? \"\");\n this.showStatus(\"Forked to new session\");\n }\n return { cancelled: result.cancelled };\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to fork session\",\n error,\n );\n }\n },\n navigateTree: async (targetId, options) => {\n const result = await this.session.navigateTree(targetId, {\n summarize: options?.summarize,\n customInstructions: options?.customInstructions,\n replaceInstructions: options?.replaceInstructions,\n label: options?.label,\n });\n if (result.cancelled) {\n return { cancelled: true };\n }\n\n this.chatContainer.clear();\n this.renderInitialMessages();\n if (result.editorText && !this.editor.getText().trim()) {\n this.editor.setText(result.editorText);\n }\n this.showStatus(\"Navigated to selected point\");\n void this.flushCompactionQueue({ willRetry: false });\n return { cancelled: false };\n },\n switchSession: async (sessionPath, options) => {\n return this.handleResumeSession(sessionPath, options);\n },\n reload: async () => {\n await this.handleReloadCommand();\n },\n },\n shutdownHandler: () => {\n this.shutdownRequested = true;\n if (!this.session.isStreaming) {\n void this.shutdown();\n }\n },\n onError: (error) => {\n this.showExtensionError(error.extensionPath, error.error, error.stack);\n },\n });\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n this.setupAutocompleteProvider();\n\n const extensionRunner = this.session.extensionRunner;\n this.setupExtensionShortcuts(extensionRunner);\n this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });\n this.showStartupNoticesIfNeeded();\n };\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function(this: InteractiveModeBase): void {\n this.footer.setSession(this.session);\n this.usageMeter.setSession(this.session);\n this.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n this.footerDataProvider.setCwd(this.sessionManager.getCwd());\n this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n this.outputPad = this.settingsManager.getOutputPad();\n this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n const editorPaddingX = this.settingsManager.getEditorPaddingX();\n const autocompleteMaxVisible =\n this.settingsManager.getAutocompleteMaxVisible();\n this.defaultEditor.setPaddingX(editorPaddingX);\n this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n if (this.editor !== this.defaultEditor) {\n this.editor.setPaddingX?.(editorPaddingX);\n this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n }\n };\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function(this: InteractiveModeBase): Promise<void> {\n this.unsubscribe?.();\n this.unsubscribe = undefined;\n this.applyRuntimeSettings();\n await this.bindCurrentSessionExtensions();\n this.subscribeToAgent();\n await this.updateAvailableProviderCount();\n this.updateEditorBorderColor();\n this.updateTerminalTitle();\n };\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function(this: InteractiveModeBase, prefix: string, error: unknown): Promise<never> {\n const message = error instanceof Error ? error.message : String(error);\n this.showError(`${prefix}: ${message}`);\n stopThemeWatcher();\n this.stop();\n process.exit(1);\n };\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function(this: InteractiveModeBase): void {\n this.chatContainer.clear();\n this.pendingMessagesContainer.clear();\n this.compactionQueuedMessages = [];\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n this.pendingTools.clear();\n this.renderInitialMessages();\n };\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function(this: InteractiveModeBase, toolName: string): ReturnType<AgentSession[\"getToolDefinition\"]> {\n return this.session.getToolDefinition(toolName);\n };\n"]}
1
+ {"version":3,"file":"interactive-session-runtime.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-session-runtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAqB,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAEtG,mBAAmB,CAAC,SAAS,CAAC,4BAA4B,GAAG,KAAK;IAC9D,MAAM,SAAS,GAAG,IAAI,CAAC,wBAAwB,EAAE,CAAC;IAClD,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAChC,SAAS;QACT,IAAI,EAAE,KAAK;QACX,qBAAqB,EAAE;YACrB,WAAW,EAAE,GAAG,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,WAAW,EAAE;YACnD,UAAU,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE;gBAC5B,IAAI,IAAI,CAAC,gBAAgB,EAAE,CAAC;oBAC1B,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC;oBAC7B,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;gBACpC,CAAC;gBACD,IAAI,CAAC,eAAe,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G,MAAM,KAAK,OAAO,EAAE,CAAC,CAAC;IACxC,gBAAgB,EAAE,CAAC;IACnB,IAAI,CAAC,IAAI,EAAE,CAAC;IACZ,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,yBAAyB,GAAG;IACtD,IAAI,CAAC,aAAa,CAAC,KAAK,EAAE,CAAC;IAC3B,IAAI,CAAC,wBAAwB,CAAC,KAAK,EAAE,CAAC;IACtC,IAAI,CAAC,wBAAwB,GAAG,EAAE,CAAC;IACnC,IAAI,CAAC,kBAAkB,GAAG,SAAS,CAAC;IACpC,IAAI,CAAC,gBAAgB,GAAG,SAAS,CAAC;IAClC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,CAAC;IAC1B,IAAI,CAAC,qBAAqB,EAAE,CAAC;AAC/B,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,2BAA2B,GAAG,UAAoC,QAAgB;IAC5G,OAAO,IAAI,CAAC,OAAO,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAC;AAClD,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type AgentSession, setRegisteredThemes, stopThemeWatcher } from \"./interactive-mode-deps.ts\";\n\nInteractiveModeBase.prototype.bindCurrentSessionExtensions = async function(this: InteractiveModeBase): Promise<void> {\n const uiContext = this.createExtensionUIContext();\n await this.session.bindExtensions({\n uiContext,\n mode: \"tui\",\n commandContextActions: {\n waitForIdle: () => this.session.agent.waitForIdle(),\n newSession: async (options) => {\n if (this.loadingAnimation) {\n this.loadingAnimation.stop();\n this.loadingAnimation = undefined;\n }\n this.statusContainer.clear();\n try {\n const result = await this.runtimeHost.newSession(options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.ui.requestRender();\n }\n return result;\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to create session\",\n error,\n );\n }\n },\n fork: async (entryId, options) => {\n try {\n const result = await this.runtimeHost.fork(entryId, options);\n if (!result.cancelled) {\n this.renderCurrentSessionState();\n this.editor.setText(result.selectedText ?? \"\");\n this.showStatus(\"Forked to new session\");\n }\n return { cancelled: result.cancelled };\n } catch (error: unknown) {\n return this.handleFatalRuntimeError(\n \"Failed to fork session\",\n error,\n );\n }\n },\n navigateTree: async (targetId, options) => {\n const result = await this.session.navigateTree(targetId, {\n summarize: options?.summarize,\n customInstructions: options?.customInstructions,\n replaceInstructions: options?.replaceInstructions,\n label: options?.label,\n });\n if (result.cancelled) {\n return { cancelled: true };\n }\n\n this.chatContainer.clear();\n this.renderInitialMessages();\n if (result.editorText && !this.editor.getText().trim()) {\n this.editor.setText(result.editorText);\n }\n this.showStatus(\"Navigated to selected point\");\n void this.flushCompactionQueue({ willRetry: false });\n return { cancelled: false };\n },\n switchSession: async (sessionPath, options) => {\n return this.handleResumeSession(sessionPath, options);\n },\n reload: async () => {\n await this.handleReloadCommand();\n },\n },\n shutdownHandler: () => {\n this.shutdownRequested = true;\n if (!this.session.isStreaming) {\n void this.shutdown();\n }\n },\n onError: (error) => {\n this.showExtensionError(error.extensionPath, error.error, error.stack);\n },\n });\n\n setRegisteredThemes(this.session.resourceLoader.getThemes().themes);\n this.setupAutocompleteProvider();\n\n const extensionRunner = this.session.extensionRunner;\n this.setupExtensionShortcuts(extensionRunner);\n if (!this.deferredStartupPending) {\n this.showLoadedResources({ force: false, showDiagnosticsWhenQuiet: true });\n this.showStartupNoticesIfNeeded();\n }\n };\n\nInteractiveModeBase.prototype.applyRuntimeSettings = function(this: InteractiveModeBase): void {\n this.footer.setSession(this.session);\n this.usageMeter.setSession(this.session);\n this.usageMeter.setAutoCompactEnabled(this.session.autoCompactionEnabled);\n this.footerDataProvider.setCwd(this.sessionManager.getCwd());\n this.hideThinkingBlock = this.settingsManager.getHideThinkingBlock();\n this.outputPad = this.settingsManager.getOutputPad();\n this.ui.setShowHardwareCursor(this.settingsManager.getShowHardwareCursor());\n this.ui.setClearOnShrink(this.settingsManager.getClearOnShrink());\n const editorPaddingX = this.settingsManager.getEditorPaddingX();\n const autocompleteMaxVisible =\n this.settingsManager.getAutocompleteMaxVisible();\n this.defaultEditor.setPaddingX(editorPaddingX);\n this.defaultEditor.setAutocompleteMaxVisible(autocompleteMaxVisible);\n if (this.editor !== this.defaultEditor) {\n this.editor.setPaddingX?.(editorPaddingX);\n this.editor.setAutocompleteMaxVisible?.(autocompleteMaxVisible);\n }\n };\n\nInteractiveModeBase.prototype.rebindCurrentSession = async function(this: InteractiveModeBase): Promise<void> {\n this.unsubscribe?.();\n this.unsubscribe = undefined;\n this.applyRuntimeSettings();\n await this.bindCurrentSessionExtensions();\n this.subscribeToAgent();\n await this.updateAvailableProviderCount();\n this.updateEditorBorderColor();\n this.updateTerminalTitle();\n };\n\nInteractiveModeBase.prototype.handleFatalRuntimeError = async function(this: InteractiveModeBase, prefix: string, error: unknown): Promise<never> {\n const message = error instanceof Error ? error.message : String(error);\n this.showError(`${prefix}: ${message}`);\n stopThemeWatcher();\n this.stop();\n process.exit(1);\n };\n\nInteractiveModeBase.prototype.renderCurrentSessionState = function(this: InteractiveModeBase): void {\n this.chatContainer.clear();\n this.pendingMessagesContainer.clear();\n this.compactionQueuedMessages = [];\n this.streamingComponent = undefined;\n this.streamingMessage = undefined;\n this.pendingTools.clear();\n this.renderInitialMessages();\n };\n\nInteractiveModeBase.prototype.getRegisteredToolDefinition = function(this: InteractiveModeBase, toolName: string): ReturnType<AgentSession[\"getToolDefinition\"]> {\n return this.session.getToolDefinition(toolName);\n };\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-startup.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type MarkdownTheme, os, path, Markdown, Spacer, Text, spawn, APP_NAME, APP_TITLE, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY, ONBOARDING_PLACEHOLDER } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n if (!this.changelogMarkdown) {\n return;\n }\n\n if (this.chatContainer.children.length > 0) {\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = this.changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n this.chatContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(\n this.changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n const hadFirstRunOnboardingStarted = Boolean(this.settingsManager.getFirstRunOnboardingStartedVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n if (\n this.session.state.messages.length === 0\n && !hadFirstRunOnboardingStarted\n && !this.settingsManager.getOnboardedVersion()\n ) {\n if (this.hadLastChangelogVersionAtStartup) {\n this.settingsManager.setOnboardedVersion(this.version);\n } else {\n this.settingsManager.setFirstRunOnboardingStartedVersion(this.version);\n }\n }\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunOnboardingActive = this.isFirstRunOnboardingEligible();\n if (this.firstRunOnboardingActive) {\n this.defaultEditor.setPlaceholder(ONBOARDING_PLACEHOLDER);\n }\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n if (this.firstRunOnboardingActive) {\n this.firstRunOnboardingHeaderComponents = [\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n ];\n for (const component of this.firstRunOnboardingHeaderComponents) {\n this.headerContainer.addChild(component);\n }\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // Initialize extensions first so resources are shown before messages\n await this.rebindCurrentSession();\n\n // Render initial messages AFTER showing loaded resources\n this.renderInitialMessages();\n\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n // Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so\n // the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.\n void this.refreshCopilotModelCatalog();\n\n // Start version check asynchronously\n checkForNewPiVersion(this.version).then((newVersion) => {\n if (newVersion) {\n this.showNewVersionNotification(newVersion);\n }\n });\n\n // Start package update check asynchronously\n this.checkForPackageUpdates().then((updates) => {\n if (updates.length > 0) {\n this.showPackageUpdateNotification(updates);\n }\n });\n\n // Check tmux keyboard setup asynchronously\n this.checkTmuxKeyboardSetup().then((warning) => {\n if (warning) {\n this.showWarning(warning);\n }\n });\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage) {\n this.showWarning(modelFallbackMessage);\n }\n\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n try {\n await this.session.prompt(userInput);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
1
+ {"version":3,"file":"interactive-startup.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type MarkdownTheme, os, path, Markdown, Spacer, Text, spawn, APP_NAME, APP_TITLE, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY, ONBOARDING_PLACEHOLDER } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n if (!this.changelogMarkdown) {\n return;\n }\n\n if (this.chatContainer.children.length > 0) {\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = this.changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n this.chatContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(\n this.changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n const hadFirstRunOnboardingStarted = Boolean(this.settingsManager.getFirstRunOnboardingStartedVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n if (\n this.session.state.messages.length === 0\n && !hadFirstRunOnboardingStarted\n && !this.settingsManager.getOnboardedVersion()\n ) {\n if (this.hadLastChangelogVersionAtStartup) {\n this.settingsManager.setOnboardedVersion(this.version);\n } else {\n this.settingsManager.setFirstRunOnboardingStartedVersion(this.version);\n }\n }\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunOnboardingActive = this.isFirstRunOnboardingEligible();\n if (this.firstRunOnboardingActive) {\n this.defaultEditor.setPlaceholder(ONBOARDING_PLACEHOLDER);\n }\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n if (this.firstRunOnboardingActive) {\n this.firstRunOnboardingHeaderComponents = [\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n ];\n for (const component of this.firstRunOnboardingHeaderComponents) {\n this.headerContainer.addChild(component);\n }\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // Initialize extensions first so resources are shown before messages\n await this.rebindCurrentSession();\n\n // Render initial messages AFTER showing loaded resources\n this.renderInitialMessages();\n\n // Extensions were skipped before first paint; finish loading them in the background.\n if (this.deferredStartupPending) {\n this.deferredStartupPromise = this.completeDeferredStartup();\n }\n\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n // Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so\n // the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.\n void this.refreshCopilotModelCatalog();\n\n // Start version check asynchronously\n checkForNewPiVersion(this.version).then((newVersion) => {\n if (newVersion) {\n this.showNewVersionNotification(newVersion);\n }\n });\n\n // Start package update check asynchronously\n this.checkForPackageUpdates().then((updates) => {\n if (updates.length > 0) {\n this.showPackageUpdateNotification(updates);\n }\n });\n\n // Check tmux keyboard setup asynchronously\n this.checkTmuxKeyboardSetup().then((warning) => {\n if (warning) {\n this.showWarning(warning);\n }\n });\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage && !this.deferredStartupPromise) {\n // With a deferred extension load, model restore is retried once extension\n // providers register; completeDeferredStartup shows the warning if it still fails.\n this.showWarning(modelFallbackMessage);\n }\n\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n\n // Prompts need extension tools; wait for the background load before sending any.\n if (this.deferredStartupPromise) {\n await this.deferredStartupPromise;\n }\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n try {\n await this.session.prompt(userInput);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
@@ -117,6 +117,10 @@ InteractiveModeBase.prototype.init = async function () {
117
117
  await this.rebindCurrentSession();
118
118
  // Render initial messages AFTER showing loaded resources
119
119
  this.renderInitialMessages();
120
+ // Extensions were skipped before first paint; finish loading them in the background.
121
+ if (this.deferredStartupPending) {
122
+ this.deferredStartupPromise = this.completeDeferredStartup();
123
+ }
120
124
  // Set up theme file watcher
121
125
  onThemeChange(() => {
122
126
  this.ui.invalidate();
@@ -175,10 +179,16 @@ InteractiveModeBase.prototype.run = async function () {
175
179
  if (modelsJsonError) {
176
180
  this.showError(`models.json error: ${modelsJsonError}`);
177
181
  }
178
- if (modelFallbackMessage) {
182
+ if (modelFallbackMessage && !this.deferredStartupPromise) {
183
+ // With a deferred extension load, model restore is retried once extension
184
+ // providers register; completeDeferredStartup shows the warning if it still fails.
179
185
  this.showWarning(modelFallbackMessage);
180
186
  }
181
187
  void this.maybeWarnAboutAnthropicSubscriptionAuth();
188
+ // Prompts need extension tools; wait for the background load before sending any.
189
+ if (this.deferredStartupPromise) {
190
+ await this.deferredStartupPromise;
191
+ }
182
192
  // Process initial messages
183
193
  if (initialMessage) {
184
194
  try {
@@ -1 +1 @@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SAAS;SACb,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,GAAG,IAAI,KAAK,SAAS,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,EAAE,CAAC;SACpE,IAAI,CAAC,IAAI,CAAC,CAAC;AAChB,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,sBAAsB,GAAG;IACnD,OAAO,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACrD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type MarkdownTheme, os, path, Markdown, Spacer, Text, spawn, APP_NAME, APP_TITLE, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY, ONBOARDING_PLACEHOLDER } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n if (!this.changelogMarkdown) {\n return;\n }\n\n if (this.chatContainer.children.length > 0) {\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = this.changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n this.chatContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(\n this.changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n const hadFirstRunOnboardingStarted = Boolean(this.settingsManager.getFirstRunOnboardingStartedVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n if (\n this.session.state.messages.length === 0\n && !hadFirstRunOnboardingStarted\n && !this.settingsManager.getOnboardedVersion()\n ) {\n if (this.hadLastChangelogVersionAtStartup) {\n this.settingsManager.setOnboardedVersion(this.version);\n } else {\n this.settingsManager.setFirstRunOnboardingStartedVersion(this.version);\n }\n }\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunOnboardingActive = this.isFirstRunOnboardingEligible();\n if (this.firstRunOnboardingActive) {\n this.defaultEditor.setPlaceholder(ONBOARDING_PLACEHOLDER);\n }\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n if (this.firstRunOnboardingActive) {\n this.firstRunOnboardingHeaderComponents = [\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n ];\n for (const component of this.firstRunOnboardingHeaderComponents) {\n this.headerContainer.addChild(component);\n }\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // Initialize extensions first so resources are shown before messages\n await this.rebindCurrentSession();\n\n // Render initial messages AFTER showing loaded resources\n this.renderInitialMessages();\n\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n // Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so\n // the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.\n void this.refreshCopilotModelCatalog();\n\n // Start version check asynchronously\n checkForNewPiVersion(this.version).then((newVersion) => {\n if (newVersion) {\n this.showNewVersionNotification(newVersion);\n }\n });\n\n // Start package update check asynchronously\n this.checkForPackageUpdates().then((updates) => {\n if (updates.length > 0) {\n this.showPackageUpdateNotification(updates);\n }\n });\n\n // Check tmux keyboard setup asynchronously\n this.checkTmuxKeyboardSetup().then((warning) => {\n if (warning) {\n this.showWarning(warning);\n }\n });\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage) {\n this.showWarning(modelFallbackMessage);\n }\n\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n try {\n await this.session.prompt(userInput);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
1
+ {"version":3,"file":"interactive-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,uBAAuB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,EAAE,M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D,OAAO,sBAAsB,CAAC,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC;AAC5E,CAAC,CAAC;AAEJ,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACrD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type MarkdownTheme, os, path, Markdown, Spacer, Text, spawn, APP_NAME, APP_TITLE, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY, ONBOARDING_PLACEHOLDER } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n if (!this.changelogMarkdown) {\n return;\n }\n\n if (this.chatContainer.children.length > 0) {\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = this.changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n this.chatContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(\n this.changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n const hadFirstRunOnboardingStarted = Boolean(this.settingsManager.getFirstRunOnboardingStartedVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n if (\n this.session.state.messages.length === 0\n && !hadFirstRunOnboardingStarted\n && !this.settingsManager.getOnboardedVersion()\n ) {\n if (this.hadLastChangelogVersionAtStartup) {\n this.settingsManager.setOnboardedVersion(this.version);\n } else {\n this.settingsManager.setFirstRunOnboardingStartedVersion(this.version);\n }\n }\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunOnboardingActive = this.isFirstRunOnboardingEligible();\n if (this.firstRunOnboardingActive) {\n this.defaultEditor.setPlaceholder(ONBOARDING_PLACEHOLDER);\n }\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n if (this.firstRunOnboardingActive) {\n this.firstRunOnboardingHeaderComponents = [\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n ];\n for (const component of this.firstRunOnboardingHeaderComponents) {\n this.headerContainer.addChild(component);\n }\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // Initialize extensions first so resources are shown before messages\n await this.rebindCurrentSession();\n\n // Render initial messages AFTER showing loaded resources\n this.renderInitialMessages();\n\n // Extensions were skipped before first paint; finish loading them in the background.\n if (this.deferredStartupPending) {\n this.deferredStartupPromise = this.completeDeferredStartup();\n }\n\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n // Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so\n // the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.\n void this.refreshCopilotModelCatalog();\n\n // Start version check asynchronously\n checkForNewPiVersion(this.version).then((newVersion) => {\n if (newVersion) {\n this.showNewVersionNotification(newVersion);\n }\n });\n\n // Start package update check asynchronously\n this.checkForPackageUpdates().then((updates) => {\n if (updates.length > 0) {\n this.showPackageUpdateNotification(updates);\n }\n });\n\n // Check tmux keyboard setup asynchronously\n this.checkTmuxKeyboardSetup().then((warning) => {\n if (warning) {\n this.showWarning(warning);\n }\n });\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage && !this.deferredStartupPromise) {\n // With a deferred extension load, model restore is retried once extension\n // providers register; completeDeferredStartup shows the warning if it still fails.\n this.showWarning(modelFallbackMessage);\n }\n\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n\n // Prompts need extension tools; wait for the background load before sending any.\n if (this.deferredStartupPromise) {\n await this.deferredStartupPromise;\n }\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n try {\n await this.session.prompt(userInput);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * createRequire anchored so bare-specifier resolution works in every runtime.
3
+ *
4
+ * In the compiled binary the bundle is CJS (bytecode), where import.meta.url
5
+ * is rewritten to the original build-machine source path; requiring through it
6
+ * would resolve node_modules against paths that do not exist on user machines.
7
+ * Anchor to the executable instead so resolution walks from the node_modules
8
+ * shipped next to the binary.
9
+ */
10
+ export declare function createModuleRequire(moduleUrl: string): NodeJS.Require;
11
+ //# sourceMappingURL=module-require.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-require.d.ts","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAErE","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);\n}\n"]}
@@ -0,0 +1,16 @@
1
+ import { createRequire } from "node:module";
2
+ import { pathToFileURL } from "node:url";
3
+ import { isBunBinary } from "../config.js";
4
+ /**
5
+ * createRequire anchored so bare-specifier resolution works in every runtime.
6
+ *
7
+ * In the compiled binary the bundle is CJS (bytecode), where import.meta.url
8
+ * is rewritten to the original build-machine source path; requiring through it
9
+ * would resolve node_modules against paths that do not exist on user machines.
10
+ * Anchor to the executable instead so resolution walks from the node_modules
11
+ * shipped next to the binary.
12
+ */
13
+ export function createModuleRequire(moduleUrl) {
14
+ return createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);
15
+ }
16
+ //# sourceMappingURL=module-require.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"module-require.js","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;AACtF,CAAC","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl);\n}\n"]}
package/docs/tools.md CHANGED
@@ -28,9 +28,11 @@ Before writing, Atomic verifies the current file against the tagged snapshot. If
28
28
 
29
29
  ## `bash` and `bashInterceptor`
30
30
 
31
- The `bash` tool executes shell commands in the session workspace, with optional PTY or background-job handling. When `pty: true` is requested, local execution uses the bundled Rust-backed PTY session so commands see a real terminal, including headless/tool-only and async job calls; if the native PTY package is unavailable, Atomic degrades to normal pipe execution. Set `PI_NO_PTY=1` or `ATOMIC_NO_PTY=1` to force normal pipe execution. Completed foreground results include oh-my-pi-style `timeoutSeconds`, `requestedTimeoutSeconds`, `wallTimeMs`, and non-zero `exitCode` metadata; background jobs use `details.async: { state, jobId, type: "bash" }`, can be polled with `bash({"command":"__atomic_bash_job <id>"})`, can be cancelled with `bash({"command":"__atomic_bash_job_cancel <id>"})`, and preserve overflow output in a temporary `fullOutputPath` when polling output is truncated. `bashInterceptor.enabled` defaults to `false`; interception is not auto-enabled.
31
+ The `bash` tool executes shell commands in the session workspace, with optional PTY or background-job handling. When `pty: true` is requested, local execution uses the bundled Rust-backed PTY session so commands see a real terminal, including headless/tool-only and async job calls; if the native PTY package is unavailable, Atomic degrades to normal pipe execution. Set `PI_NO_PTY=1` or `ATOMIC_NO_PTY=1` to force normal pipe execution. Completed foreground results include oh-my-pi-style `timeoutSeconds`, `requestedTimeoutSeconds`, `wallTimeMs`, and non-zero `exitCode` metadata; background jobs use `details.async: { state, jobId, type: "bash" }`, can be polled with `bash({"command":"__atomic_bash_job <id>"})`, can be cancelled with `bash({"command":"__atomic_bash_job_cancel <id>"})`, and preserve overflow output in a temporary `fullOutputPath` when polling output is truncated.
32
32
 
33
- When explicitly enabled in settings, built-in bash interceptor rules block common shell substitutes for first-class tools (`cat`/`grep`/`find`/in-place `sed`/redirection, etc.) only when the corresponding tool is available. Enabled bash tool calls are also offered to `user_bash` extension handlers before local execution. Atomic checks the original command, the internal-URL-expanded command, configured-prefix forms, `spawnHook`-rewritten commands, and a leading `cd path && command` or `cd path; command`-stripped form only when structured `cwd` was omitted, so interceptors can route commands by effective working directory without overriding explicit `cwd`. The bash schema accepts `cwd`, `env`, `timeout`, `pty`, and `async`; `cwd` and `env` are honored by the local executor, `timeout` defaults to 300s and is clamped to 1..3600s, and normal sessions enable tracked async jobs with bounded retention.
33
+ When a session-managed background bash job completes or fails, Atomic sends an `async-job-result` custom follow-up into the conversation automatically (`display: true`, delivered as a follow-up turn). Small results are inlined, and results whose raw output stays below the persistence threshold remain fully inline even if the formatted follow-up header pushes the message over the preview limit; persisted large results include a preview plus the retained `fullOutputPath` (persisted before the normal polling truncation limit so 12KB–50KB outputs remain recoverable). If the model explicitly polls a completed job with `__atomic_bash_job <id>` before the queued follow-up is delivered, or cancels a job with `__atomic_bash_job_cancel <id>`, Atomic acknowledges the result and suppresses duplicate auto-delivery while keeping the job pollable until normal bounded retention/TTL cleanup. Suppression is tied to the retained job rather than a short timer, so disposed-session jobs cannot later fall back into another session after a long-running command completes. Session delivery attempts are non-blocking across sessions: a live streaming session can defer its own follow-up until the stream boundary without delaying unrelated completed jobs. Session disposal removes that session's pending async delivery handlers; a shared manager remains alive while other live sessions still own active jobs, then cleans up when the last session is disposed. Direct SDK/tool-factory uses only get automatic delivery when they provide an async job manager/delivery handler; otherwise async jobs remain manually pollable.
34
+
35
+ When explicitly enabled in settings, built-in bash interceptor rules block common shell substitutes for first-class tools (`cat`/`grep`/`find`/in-place `sed`/redirection, etc.) only when the corresponding tool is available. Enabled bash tool calls are also offered to `user_bash` extension handlers before local execution. Atomic checks the original command, the internal-URL-expanded command, configured-prefix forms, `spawnHook`-rewritten commands, and a leading `cd path && command` or `cd path; command`-stripped form only when structured `cwd` was omitted, so interceptors can route commands by effective working directory without overriding explicit `cwd`. The bash schema accepts `cwd`, `env`, `timeout`, `pty`, and `async`; `cwd` and `env` are honored by the local executor, `timeout` defaults to 300s and is clamped to 1..3600s, and normal sessions enable tracked async jobs with bounded retention. `bashInterceptor.enabled` defaults to `false`; interception is not auto-enabled.
34
36
 
35
37
  ```json
36
38
  {
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@bastani/atomic",
3
- "version": "0.9.4-alpha.8",
3
+ "version": "0.9.4",
4
4
  "lockfileVersion": 3,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "@bastani/atomic",
9
- "version": "0.9.4-alpha.8",
9
+ "version": "0.9.4",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
- "@bastani/atomic-natives": "0.9.4-alpha.8",
12
+ "@bastani/atomic-natives": "0.9.4",
13
13
  "@bufbuild/protobuf": "^2.12.1",
14
14
  "@earendil-works/pi-agent-core": "^0.80.3",
15
15
  "@earendil-works/pi-ai": "^0.80.3",
@@ -514,16 +514,16 @@
514
514
  }
515
515
  },
516
516
  "node_modules/@bastani/atomic-natives": {
517
- "version": "0.9.4-alpha.8",
518
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.4-alpha.8.tgz",
517
+ "version": "0.9.4",
518
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives/-/atomic-natives-0.9.4.tgz",
519
519
  "license": "MIT",
520
520
  "optionalDependencies": {
521
- "@bastani/atomic-natives-darwin-arm64": "0.9.4-alpha.8",
522
- "@bastani/atomic-natives-darwin-x64": "0.9.4-alpha.8",
523
- "@bastani/atomic-natives-linux-arm64-gnu": "0.9.4-alpha.8",
524
- "@bastani/atomic-natives-linux-x64-gnu": "0.9.4-alpha.8",
525
- "@bastani/atomic-natives-win32-arm64-msvc": "0.9.4-alpha.8",
526
- "@bastani/atomic-natives-win32-x64-msvc": "0.9.4-alpha.8"
521
+ "@bastani/atomic-natives-darwin-arm64": "0.9.4",
522
+ "@bastani/atomic-natives-darwin-x64": "0.9.4",
523
+ "@bastani/atomic-natives-linux-arm64-gnu": "0.9.4",
524
+ "@bastani/atomic-natives-linux-x64-gnu": "0.9.4",
525
+ "@bastani/atomic-natives-win32-arm64-msvc": "0.9.4",
526
+ "@bastani/atomic-natives-win32-x64-msvc": "0.9.4"
527
527
  },
528
528
  "engines": {
529
529
  "bun": ">=1.3.14",
@@ -531,8 +531,8 @@
531
531
  }
532
532
  },
533
533
  "node_modules/@bastani/atomic-natives-darwin-arm64": {
534
- "version": "0.9.4-alpha.8",
535
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.4-alpha.8.tgz",
534
+ "version": "0.9.4",
535
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-arm64/-/atomic-natives-darwin-arm64-0.9.4.tgz",
536
536
  "license": "MIT",
537
537
  "os": [
538
538
  "darwin"
@@ -543,8 +543,8 @@
543
543
  "optional": true
544
544
  },
545
545
  "node_modules/@bastani/atomic-natives-darwin-x64": {
546
- "version": "0.9.4-alpha.8",
547
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.4-alpha.8.tgz",
546
+ "version": "0.9.4",
547
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-darwin-x64/-/atomic-natives-darwin-x64-0.9.4.tgz",
548
548
  "license": "MIT",
549
549
  "os": [
550
550
  "darwin"
@@ -555,8 +555,8 @@
555
555
  "optional": true
556
556
  },
557
557
  "node_modules/@bastani/atomic-natives-linux-arm64-gnu": {
558
- "version": "0.9.4-alpha.8",
559
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.4-alpha.8.tgz",
558
+ "version": "0.9.4",
559
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-arm64-gnu/-/atomic-natives-linux-arm64-gnu-0.9.4.tgz",
560
560
  "license": "MIT",
561
561
  "os": [
562
562
  "linux"
@@ -570,8 +570,8 @@
570
570
  "optional": true
571
571
  },
572
572
  "node_modules/@bastani/atomic-natives-linux-x64-gnu": {
573
- "version": "0.9.4-alpha.8",
574
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.4-alpha.8.tgz",
573
+ "version": "0.9.4",
574
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-linux-x64-gnu/-/atomic-natives-linux-x64-gnu-0.9.4.tgz",
575
575
  "license": "MIT",
576
576
  "os": [
577
577
  "linux"
@@ -585,8 +585,8 @@
585
585
  "optional": true
586
586
  },
587
587
  "node_modules/@bastani/atomic-natives-win32-arm64-msvc": {
588
- "version": "0.9.4-alpha.8",
589
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.4-alpha.8.tgz",
588
+ "version": "0.9.4",
589
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-arm64-msvc/-/atomic-natives-win32-arm64-msvc-0.9.4.tgz",
590
590
  "license": "MIT",
591
591
  "os": [
592
592
  "win32"
@@ -597,8 +597,8 @@
597
597
  "optional": true
598
598
  },
599
599
  "node_modules/@bastani/atomic-natives-win32-x64-msvc": {
600
- "version": "0.9.4-alpha.8",
601
- "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.4-alpha.8.tgz",
600
+ "version": "0.9.4",
601
+ "resolved": "https://registry.npmjs.org/@bastani/atomic-natives-win32-x64-msvc/-/atomic-natives-win32-x64-msvc-0.9.4.tgz",
602
602
  "license": "MIT",
603
603
  "os": [
604
604
  "win32"