@bastani/atomic 0.9.26-alpha.6 → 0.9.27-alpha.1

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 (82) hide show
  1. package/CHANGELOG.md +75 -0
  2. package/dist/builtin/intercom/CHANGELOG.md +12 -0
  3. package/dist/builtin/intercom/index.bundle.mjs +21 -6
  4. package/dist/builtin/intercom/package.json +1 -1
  5. package/dist/builtin/mcp/package.json +1 -1
  6. package/dist/builtin/subagents/CHANGELOG.md +8 -0
  7. package/dist/builtin/subagents/package.json +1 -1
  8. package/dist/builtin/subagents/src/extension/index.bundle.mjs +693 -642
  9. package/dist/builtin/web-access/package.json +1 -1
  10. package/dist/builtin/workflows/CHANGELOG.md +22 -0
  11. package/dist/builtin/workflows/package.json +1 -1
  12. package/dist/builtin/workflows/src/extension/index.bundle.mjs +71 -20
  13. package/dist/builtin/workflows/src/index.js +31 -10
  14. package/dist/codemode-worker.js +3309 -0
  15. package/dist/config.d.ts +7 -1
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +38 -12
  18. package/dist/config.js.map +1 -1
  19. package/dist/core/agent-session-custom-message-commit.d.ts.map +1 -1
  20. package/dist/core/agent-session-custom-message-commit.js +6 -0
  21. package/dist/core/agent-session-custom-message-commit.js.map +1 -1
  22. package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
  23. package/dist/core/agent-session-extension-bindings.js +22 -6
  24. package/dist/core/agent-session-extension-bindings.js.map +1 -1
  25. package/dist/core/agent-session-services.d.ts.map +1 -1
  26. package/dist/core/agent-session-services.js +3 -1
  27. package/dist/core/agent-session-services.js.map +1 -1
  28. package/dist/core/agent-session-tasks.js +9 -4
  29. package/dist/core/agent-session-tasks.js.map +1 -1
  30. package/dist/core/auth-storage-backends.d.ts +3 -0
  31. package/dist/core/auth-storage-backends.d.ts.map +1 -1
  32. package/dist/core/auth-storage-backends.js +45 -1
  33. package/dist/core/auth-storage-backends.js.map +1 -1
  34. package/dist/core/auth-storage.d.ts.map +1 -1
  35. package/dist/core/auth-storage.js +14 -0
  36. package/dist/core/auth-storage.js.map +1 -1
  37. package/dist/core/extensions/provider-types.d.ts +3 -2
  38. package/dist/core/extensions/provider-types.d.ts.map +1 -1
  39. package/dist/core/extensions/provider-types.js.map +1 -1
  40. package/dist/core/extensions/runner-events.d.ts.map +1 -1
  41. package/dist/core/extensions/runner-events.js +10 -1
  42. package/dist/core/extensions/runner-events.js.map +1 -1
  43. package/dist/extensions/codemode/execute.d.ts.map +1 -1
  44. package/dist/extensions/codemode/execute.js +40 -6
  45. package/dist/extensions/codemode/execute.js.map +1 -1
  46. package/dist/extensions/codemode/tool.d.ts.map +1 -1
  47. package/dist/extensions/codemode/tool.js +1 -0
  48. package/dist/extensions/codemode/tool.js.map +1 -1
  49. package/dist/extensions/mcp/tools.d.ts.map +1 -1
  50. package/dist/extensions/mcp/tools.js +4 -9
  51. package/dist/extensions/mcp/tools.js.map +1 -1
  52. package/dist/index.d.ts +1 -0
  53. package/dist/index.d.ts.map +1 -1
  54. package/dist/index.js +1 -0
  55. package/dist/index.js.map +1 -1
  56. package/dist/modes/interactive/interactive-agent-events.js +21 -0
  57. package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
  58. package/dist/modes/interactive/interactive-mode-base.d.ts +1 -0
  59. package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
  60. package/dist/modes/interactive/interactive-mode-base.js +1 -0
  61. package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
  62. package/dist/modes/interactive/interactive-mode-helpers.js +1 -1
  63. package/dist/modes/interactive/interactive-mode-helpers.js.map +1 -1
  64. package/dist/modes/interactive/interactive-mode-surface.d.ts +1 -0
  65. package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
  66. package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
  67. package/dist/modes/interactive/interactive-process-lifecycle.js +7 -4
  68. package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
  69. package/dist/utils/output-files.d.ts +7 -0
  70. package/dist/utils/output-files.d.ts.map +1 -0
  71. package/dist/utils/output-files.js +20 -0
  72. package/dist/utils/output-files.js.map +1 -0
  73. package/docs/codemode.md +3 -3
  74. package/docs/extensions/api-reference.md +3 -1
  75. package/docs/extensions.md +2 -0
  76. package/docs/sdk.md +2 -0
  77. package/docs/settings.md +2 -0
  78. package/docs/subagents.md +4 -0
  79. package/docs/workflows/api-reference.md +6 -2
  80. package/docs/workflows/operations.md +10 -10
  81. package/npm-shrinkwrap.json +32 -32
  82. package/package.json +6 -6
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode-surface.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,4EAA4E;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,kBAAkB,EAClB,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AAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;KACxD;CACD"}
1
+ {"version":3,"file":"interactive-mode-surface.d.ts","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,4EAA4E;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AACzF,OAAO,KAAK,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC/E,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,gCAAgC,CAAC;AAC3E,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uCAAuC,CAAC;AACjF,OAAO,KAAK,EACX,YAAY,EACZ,iBAAiB,EACjB,GAAG,EACH,aAAa,EACb,oBAAoB,EACpB,oBAAoB,EACpB,gBAAgB,EAChB,wBAAwB,EACxB,SAAS,EACT,SAAS,EACT,aAAa,EACb,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,eAAe,EACf,0BAA0B,EAC1B,kBAAkB,EAClB,wBAAwB,EACxB,sBAAsB,EACtB,iBAAiB,EACjB,yBAAyB,EACzB,UAAU,EACV,kBAAkB,EAClB,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,OAAO,EACP,sBAAsB,EACtB,KAAK,EACL,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,0BAA0B,EAC1B,kBAAkB,EAClB,cAAc,EACd,YAAY,E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AAI,CAAC,CAAC;QACrC,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,sBAAsB,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAAC;QACzF,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QACjD,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACpC,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACnC,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;QACtC,oBAAoB,IAAI,IAAI,CAAC;QAC7B,sBAAsB,IAAI,IAAI,CAAC;QAC/B,gBAAgB,CAAC,MAAM,EAAE,aAAa,GAAG,MAAM,CAAC;QAChD,mBAAmB,CAAC,MAAM,EAAE,UAAU,GAAG,MAAM,CAAC;QAChD,mBAAmB,IAAI,IAAI,CAAC;QAC5B,yBAAyB,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;QAClD,oBAAoB,IAAI,IAAI,CAAC;QAC7B,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACpC,kBAAkB,IAAI,IAAI,CAAC;QAC3B,iBAAiB,IAAI,IAAI,CAAC;QAC1B,oBAAoB,IAAI,IAAI,CAAC;QAC7B,iBAAiB,CAAC,OAAO,EAAE,MAAM,EAAE,kBAAkB,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;QAChF,oBAAoB,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;QACtC,IAAI,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,GAAG,IAAI,CAAC;KACxD;CACD"}
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-mode-surface.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { AssistantMessage, Usage } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\n/** Method surface installed onto InteractiveModeBase by sibling modules. */\n\nimport type { MarkdownTransformer, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport type { CustomEntry, SessionEntry } from \"../../core/session-manager.ts\";\nimport type { FullscreenExitOutput } from \"../../core/settings-manager.ts\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport type {\n\tAgentMessage,\n\tAgentSessionEvent,\n\tApi,\n\tAppKeybinding,\n\tAuthSelectorProvider,\n\tAutocompleteProvider,\n\tChatMessageEntry,\n\tChatMessageRenderOptions,\n\tComponent,\n\tContainer,\n\tEditorFactory,\n\tExtensionCommandContext,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionRunner,\n\tExtensionSelectorComponent,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tHostCustomUiState,\n\tHostCustomUiStateListener,\n\tKeybinding,\n\tKeybindingsManager,\n\tLoaderIndicatorOptions,\n\tLoginDialogComponent,\n\tMarkdownTheme,\n\tMessage,\n\tMissingSessionCwdError,\n\tModel,\n\tOAuthSelectPrompt,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProjectTrustContext,\n\tReadonlyFooterDataProvider,\n\tResourceDiagnostic,\n\tSessionContext,\n\tSlashCommand,\n\tSourceInfo,\n\tTheme,\n\tTUI,\n\tVerbatimCompactionResult,\n} from \"./interactive-mode-deps.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\n\ndeclare module \"./interactive-mode-base.ts\" {\n\tinterface InteractiveModeBase {\n\t\tgetAutocompleteSourceTag(sourceInfo?: SourceInfo): string | undefined;\n\t\tprefixAutocompleteDescription(description: string | undefined, sourceInfo?: SourceInfo): string | undefined;\n\t\tgetBuiltInCommandConflictDiagnostics(extensionRunner: ExtensionRunner): ResourceDiagnostic[];\n\t\tcreateBaseAutocompleteProvider(): AutocompleteProvider;\n\t\tbuildRemoteSlashCommands(localCommands: SlashCommand[]): SlashCommand[];\n\t\tsetupAutocompleteProvider(): void;\n\t\tshowStartupNoticesIfNeeded(targetContainer?: Container): void;\n\t\treportModelCatalogWarning(targetContainer?: Container): void;\n\t\treportedModelCatalogWarning: string | undefined;\n\t\thadLastChangelogVersionAtStartup: boolean;\n\t\tfirstRunNoticeVisible: boolean;\n\t\tfirstRunOnboardingNoticeComponents: Component[];\n\t\tinitializeFirstRunOnboardingMarkers(): void;\n\t\tisFirstRunOnboardingEligible(): boolean;\n\t\tclearFirstRunOnboardingUi(): void;\n\t\tinit(): Promise<void>;\n\t\tcompleteDeferredStartup(): Promise<void>;\n\t\tretryDeferredModelRestore(targetContainer?: Container): Promise<void>;\n\t\tupdateTerminalTitle(): void;\n\t\trun(): Promise<void>;\n\t\tcheckForPackageUpdates(): Promise<string[]>;\n\t\tcheckTmuxKeyboardSetup(): Promise<string | undefined>;\n\t\tgetChangelogForDisplay(): string | undefined;\n\t\treportInstallTelemetry(version: string): void;\n\t\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\t\tgetMarkdownTransformers(): MarkdownTransformer[];\n\t\tformatDisplayPath(p: string): string;\n\t\tformatExtensionDisplayPath(path: string): string;\n\t\tformatContextPath(p: string): string;\n\t\tgetStartupModelLabel(): string;\n\t\tgetStartupIdentityText(maxWidth?: number, gap?: number, manifestoPhase?: number): string;\n\t\tgetAtomicAnsiMarkLines(gap?: number): string[];\n\t\tgetStartupExpansionState(): boolean;\n\t\tshouldShowStartupHeader(): boolean;\n\t\tshouldShowStartupDetails(): boolean;\n\t\tgetShortPath(fullPath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPathLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPackageSourceLabel(sourceInfo?: SourceInfo): string;\n\t\tgetCompactExtensionLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactDisplayPathSegments(resourcePath: string): string[];\n\t\tgetCompactNonPackageExtensionLabel(\n\t\t\tresourcePath: string,\n\t\t\tindex: number,\n\t\t\tallPaths: Array<{ path: string; segments: string[] }>,\n\t\t): string;\n\t\tgetCompactExtensionLabels(extensions: Array<{ path: string; sourceInfo?: SourceInfo }>): string[];\n\t\tgetDisplaySourceInfo(sourceInfo?: SourceInfo): {\n\t\t\tlabel: string;\n\t\t\tscopeLabel?: string;\n\t\t\tcolor: \"accent\" | \"muted\";\n\t\t};\n\t\tgetScopeGroup(sourceInfo?: SourceInfo): \"user\" | \"project\" | \"path\";\n\t\tisPackageSource(sourceInfo?: SourceInfo): boolean;\n\t\tbuildScopeGroups(items: Array<{ path: string; sourceInfo?: SourceInfo }>): Array<{\n\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t}>;\n\t\tformatScopeGroups(\n\t\t\tgroups: Array<{\n\t\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t\t}>,\n\t\t\toptions: {\n\t\t\t\tformatPath: (item: { path: string; sourceInfo?: SourceInfo }) => string;\n\t\t\t\tformatPackagePath: (item: { path: string; sourceInfo?: SourceInfo }, source: string) => string;\n\t\t\t},\n\t\t): string;\n\t\tfindSourceInfoForPath(p: string, sourceInfos: Map<string, SourceInfo>): SourceInfo | undefined;\n\t\tformatPathWithSource(p: string, sourceInfo?: SourceInfo): string;\n\t\tformatDiagnostics(diagnostics: readonly ResourceDiagnostic[], sourceInfos: Map<string, SourceInfo>): string;\n\t\taddResourceDisclosure(options: {\n\t\t\tcontextFiles: ReadonlyArray<{ path: string }>;\n\t\t\tskills: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\tprompts: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\textensions: ReadonlyArray<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\texpandedSections: {\n\t\t\t\tcontext?: string;\n\t\t\t\tskills?: string;\n\t\t\t\tprompts?: string;\n\t\t\t\textensions?: string;\n\t\t\t};\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tshowLoadedResources(options?: {\n\t\t\textensions?: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tforce?: boolean;\n\t\t\tshowDiagnosticsWhenQuiet?: boolean;\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tbindCurrentSessionExtensions(): Promise<void>;\n\t\tapplyRuntimeSettings(): void;\n\t\trebindCurrentSession(): Promise<void>;\n\t\thandleFatalRuntimeError(prefix: string, error: unknown): Promise<never>;\n\t\trenderCurrentSessionState(): void;\n\t\tgetRegisteredToolDefinition(toolName: string): ToolRenderers | undefined;\n\t\tsetupExtensionShortcuts(extensionRunner: ExtensionRunner): void;\n\t\tsetExtensionStatus(key: string, text: string | undefined): void;\n\t\tgetWorkingLoaderMessage(): string;\n\t\tcreateWorkingLoader(): AtomicWorkingLoader;\n\t\tclearWorkingLoader(): void;\n\t\tstopWorkingLoader(): void;\n\t\tshowWorkingLoaderNow(): void;\n\t\tsetWorkingVisible(visible: boolean): void;\n\t\tsetWorkingIndicator(options?: LoaderIndicatorOptions): void;\n\t\tsetHiddenThinkingLabel(label?: string): void;\n\t\tsetExtensionWidget(\n\t\t\tkey: string,\n\t\t\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\t\t\toptions?: ExtensionWidgetOptions,\n\t\t): void;\n\t\tclearExtensionWidgets(): void;\n\t\tresetExtensionUI(): void;\n\t\trenderWidgets(): void;\n\t\trenderWidgetContainer(\n\t\t\tcontainer: Container,\n\t\t\twidgets: Map<string, Component & { dispose?(): void }>,\n\t\t\tspacerWhenEmpty: boolean,\n\t\t\tleadingSpacer: boolean,\n\t\t): void;\n\t\tsetExtensionFooter(\n\t\t\tfactory:\n\t\t\t\t| ((tui: TUI, thm: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t\t| undefined,\n\t\t): void;\n\t\tsetExtensionHeader(factory: ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined): void;\n\t\taddExtensionTerminalInputListener(\n\t\t\thandler: (data: string) => { consume?: boolean; data?: string } | undefined,\n\t\t): () => void;\n\t\tclearExtensionTerminalInputListeners(): void;\n\t\tgetHostCustomUiState(): HostCustomUiState;\n\t\tnotifyHostCustomUiStateListeners(): void;\n\t\tbeginHostInlineCustomUi(purpose?: \"prompt\" | \"navigation\"): () => void;\n\t\tbeginInlineCustomUiFocusDeferral(): () => void;\n\t\tshouldDeferInlineCustomUiFocus(): boolean;\n\t\tfocusHostInlineCustomUi(): boolean;\n\t\tonHostCustomUiStateChange(listener: HostCustomUiStateListener): () => void;\n\t\tonExtensionWidgetRelease(key: string, listener: () => void): () => void;\n\t\tnotifyExtensionWidgetRelease(key: string): void;\n\t\tcreateProjectTrustContext(cwd: string): ProjectTrustContext;\n\t\tcreateExtensionUIContext(): ExtensionUIContext;\n\t\tshowExtensionSelector(\n\t\t\ttitle: string,\n\t\t\toptions: string[],\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionSelector(instance?: ExtensionSelectorComponent): void;\n\t\tshowExtensionConfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\t\tpromptForMissingSessionCwd(error: MissingSessionCwdError): Promise<string | undefined>;\n\t\tshowExtensionInput(\n\t\t\ttitle: string,\n\t\t\tplaceholder?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionInput(instance?: ExtensionInputComponent): void;\n\t\tshowExtensionEditor(\n\t\t\ttitle: string,\n\t\t\tprefill?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionEditor(instance?: ExtensionEditorComponent): void;\n\t\tsetCustomEditorComponent(factory: EditorFactory | undefined): void;\n\t\tshowExtensionNotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\t\tshowExtensionCustom<T>(\n\t\t\tfactory: (\n\t\t\t\ttui: TUI,\n\t\t\t\ttheme: Theme,\n\t\t\t\tkeybindings: KeybindingsManager,\n\t\t\t\tdone: (result: T) => void,\n\t\t\t) => (Component & { dispose?(): void }) | Promise<Component & { dispose?(): void }>,\n\t\t\toptions?: {\n\t\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\t\toverlay?: boolean;\n\t\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t\t/** Overlay-only: bound the overlay and reserve transcript scroll extent. */\n\t\t\t\treserveTranscriptRows?: boolean;\n\t\t\t\tsignal?: AbortSignal;\n\t\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t},\n\t\t): Promise<T>;\n\t\tshowExtensionError(extensionPath: string, error: string, stack?: string): void;\n\t\tsetupKeyHandlers(): void;\n\t\thandleClipboardImagePaste(): Promise<void>;\n\t\tsetupEditorSubmitHandler(): void;\n\t\tdeliverStartupReplayPrompt(text: string): void;\n\t\trecoverCookedStartupInput(): boolean;\n\t\tdrainStartupReplayCommands(): Promise<void>;\n\t\tadvanceStartupInputReplay(submittedText: string): void;\n\t\tsubscribeToAgent(): void;\n\t\thandleEvent(event: AgentSessionEvent | JsonAgentSessionEvent): Promise<void>;\n\t\tgetUserMessageText(message: Message): string;\n\t\tshowStatus(message: string, persist?: boolean): void;\n\t\t/** Report a managed-tool (fd/rg) readiness update inside the transcript. */\n\t\tshowManagedToolStatus(status: ToolStatus): void;\n\t\t/** Bring fd/rg to readiness after first paint; progress lands in the transcript. */\n\t\tensureManagedToolsReady(): Promise<void>;\n\t\tchatMessageRenderOptions(): ChatMessageRenderOptions;\n\t\taddRenderedChatEntry(entry: ChatMessageEntry): Component;\n\t\taddCompactionBoundaryToChat(result: VerbatimCompactionResult): void;\n\t\taddCompactionCostNotice(kind: \"compaction\" | \"branch_summary\", usage: Usage): void;\n\t\tmaybeShowAssistantDiagnostics(message: AssistantMessage): void;\n\t\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\t\taddCustomEntryToChat(entry: CustomEntry): void;\n\t\trenderSessionContext(\n\t\t\tsessionContext: SessionContext,\n\t\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t\t): void;\n\t\trenderSessionEntries(\n\t\t\tentries: SessionEntry[],\n\t\t\toptions?: {\n\t\t\t\tupdateFooter?: boolean;\n\t\t\t\tpopulateHistory?: boolean;\n\t\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\t},\n\t\t): void;\n\t\trenderInitialMessages(): void;\n\t\tattachStartupNoticesContainer(options?: { resetDetached?: boolean }): void;\n\t\tgetUserInput(): Promise<InteractiveSubmission>;\n\t\trunUserPromptTurn(submission: InteractiveSubmission | string): Promise<void>;\n\t\trenderDeferredUserInput(text: string): void;\n\t\tconsumeDeferredRenderedUserInput(text: string): boolean;\n\t\tdiscardDeferredRenderedUserInput(text: string): void;\n\t\tensureDeferredStartupComplete(): Promise<void>;\n\t\trebuildChatFromMessages(options?: {\n\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\tresetStartupDisclosure?: boolean;\n\t\t}): void;\n\t\thandleCtrlC(): void;\n\t\tinterruptActiveOperation(): boolean;\n\t\thandleCtrlD(): void;\n\t\tshutdown(options?: { fromSignal?: boolean }): Promise<void>;\n\t\temergencyTerminalExit(): never;\n\t\tuncaughtCrash(error: Error): never;\n\t\tgetCrashExtensionHint(error: unknown): string | undefined;\n\t\tcheckShutdownRequested(): Promise<void>;\n\t\tregisterSignalHandlers(): void;\n\t\tunregisterSignalHandlers(): void;\n\t\thandleCtrlZ(): void;\n\t\thandleFollowUp(): Promise<void>;\n\t\thandleDequeue(): void;\n\t\trefreshBuiltInHeader(): void;\n\t\tupdateEditorBorderColor(): void;\n\t\tcycleThinkingLevel(): void;\n\t\tcycleModel(direction: \"forward\" | \"backward\"): Promise<void>;\n\t\ttoggleToolOutputExpansion(): void;\n\t\tsetToolsExpanded(expanded: boolean): void;\n\t\ttoggleThinkingBlockVisibility(): void;\n\t\tupdateThinkingBlockVisibility(): void;\n\t\topenExternalEditor(): Promise<void>;\n\t\tclearEditor(): void;\n\t\tshowError(errorMessage: string): void;\n\t\tshowWarning(warningMessage: string, targetContainer?: Container): void;\n\t\tshowNewVersionNotification(newVersion: string, targetContainer?: Container): void;\n\t\tshowPackageUpdateNotification(packages: string[], targetContainer?: Container): void;\n\t\tgetAllQueuedMessages(): { steering: string[]; followUp: string[] };\n\t\tclearAllQueues(options?: { preserveUnprotectedCustomMessages?: boolean }): {\n\t\t\tsteering: string[];\n\t\t\tfollowUp: string[];\n\t\t};\n\t\tupdatePendingMessagesDisplay(): void;\n\t\trestoreQueuedMessagesToEditor(options?: {\n\t\t\tabort?: boolean;\n\t\t\tcurrentText?: string;\n\t\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t\t}): number;\n\t\tqueueCompactionMessage(text: string, mode: \"steer\" | \"followUp\"): void;\n\t\tisExtensionCommand(text: string): boolean;\n\t\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n\t\tflushPendingBashComponents(): void;\n\t\tshowSelector(\n\t\t\tcreate: (done: () => void) => { component: Component; focus: Component; dispose?: () => void },\n\t\t): void;\n\t\tshowSettingsSelector(): void;\n\t\thandleModelCommand(searchTerm?: string): Promise<void>;\n\t\thandleThinkingCommand(searchTerm?: string): void;\n\t\tselectThinkingLevel(level: ThinkingLevel): void;\n\t\tshowThinkingSelector(): void;\n\t\tfindExactModelMatch(searchTerm: string): Promise<Model<Api> | undefined>;\n\t\tgetModelCandidates(): Promise<Model<Api>[]>;\n\t\tupdateAvailableProviderCount(): Promise<void>;\n\t\tmaybeWarnAboutAnthropicSubscriptionAuth(\n\t\t\tmodel?: Model<Api> | undefined,\n\t\t\ttargetContainer?: Container,\n\t\t): Promise<void>;\n\t\tshowModelSelector(initialSearchInput?: string): void;\n\t\tshowModelsSelector(): void;\n\t\tshowUserMessageSelector(): Promise<void>;\n\t\thandleCloneCommand(): Promise<void>;\n\t\tmaybeSaveImplicitProjectTrustAfterReload(): boolean;\n\t\tshowTrustSelector(): void;\n\t\tshowTreeSelector(initialSelectedId?: string): Promise<void>;\n\t\tshowSessionSelector(): void;\n\t\thandleResumeSession(\n\t\t\tsessionPath: string,\n\t\t\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\t\t): Promise<{ cancelled: boolean }>;\n\t\tgetLoginProviderOptions(authType?: \"oauth\" | \"api_key\"): AuthSelectorProvider[];\n\t\tgetLogoutProviderOptions(): AuthSelectorProvider[];\n\t\thandleLoginCommand(providerRef?: string): Promise<void>;\n\t\tstartProviderLogin(providerOption: AuthSelectorProvider, onBack?: () => void): Promise<void>;\n\t\tshowLoginAuthTypeSelector(providerOptions?: AuthSelectorProvider[]): void;\n\t\tshowLoginProviderSelector(authType?: \"oauth\" | \"api_key\", initialSearchInput?: string): void;\n\t\tshowOAuthSelector(mode: \"login\" | \"logout\", initialSearchInput?: string): Promise<void>;\n\t\tcompleteProviderAuthentication(\n\t\t\tproviderId: string,\n\t\t\tproviderName: string,\n\t\t\tauthType: \"oauth\" | \"api_key\",\n\t\t\tpreviousModel: Model<Api> | undefined,\n\t\t\toptions?: { modelsRefreshed?: boolean },\n\t\t): Promise<void>;\n\t\tshowBedrockSetupDialog(providerId: string, providerName: string, onBack?: () => void): void;\n\t\tshowApiKeyLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\tshowOAuthLoginSelect(dialog: LoginDialogComponent, prompt: OAuthSelectPrompt): Promise<string | undefined>;\n\t\tshowLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\thandleReloadCommand(): Promise<void>;\n\t\thandleExportCommand(text: string): Promise<void>;\n\t\tgetPathCommandArgument(text: string, command: \"/export\" | \"/import\"): string | undefined;\n\t\thandleImportCommand(text: string): Promise<void>;\n\t\thandleShareCommand(): Promise<void>;\n\t\thandleCopyCommand(): Promise<void>;\n\t\thandleNameCommand(text: string): void;\n\t\thandleSessionCommand(): void;\n\t\thandleChangelogCommand(): void;\n\t\tgetAppKeyDisplay(action: AppKeybinding): string;\n\t\tgetEditorKeyDisplay(action: Keybinding): string;\n\t\tjumpToTranscriptEnd(): void;\n\t\tsetFullscreenCopyOnSelect(enabled: boolean): void;\n\t\thandleHotkeysCommand(): void;\n\t\thandleClearCommand(): Promise<void>;\n\t\thandleDebugCommand(): void;\n\t\thandleArminSaysHi(): void;\n\t\thandleDementedDelves(): void;\n\t\thandleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;\n\t\thandleCompactCommand(): Promise<void>;\n\t\tstop(fullscreenExitOutput?: FullscreenExitOutput): void;\n\t}\n}\n"]}
1
+ {"version":3,"file":"interactive-mode-surface.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-mode-surface.ts"],"names":[],"mappings":"","sourcesContent":["import type { AssistantMessage, Usage } from \"@bastani/pi-ai/compat\";\nimport type { ThinkingLevel } from \"@earendil-works/pi-agent-core\";\n/** Method surface installed onto InteractiveModeBase by sibling modules. */\n\nimport type { MarkdownTransformer, ToolRenderers } from \"../../core/extensions/types.ts\";\nimport type { CustomEntry, SessionEntry } from \"../../core/session-manager.ts\";\nimport type { FullscreenExitOutput } from \"../../core/settings-manager.ts\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport type { JsonAgentSessionEvent } from \"../json-event.ts\";\nimport type { AtomicWorkingLoader } from \"./components/atomic-working-status.ts\";\nimport type {\n\tAgentMessage,\n\tAgentSessionEvent,\n\tApi,\n\tAppKeybinding,\n\tAuthSelectorProvider,\n\tAutocompleteProvider,\n\tChatMessageEntry,\n\tChatMessageRenderOptions,\n\tComponent,\n\tContainer,\n\tEditorFactory,\n\tExtensionCommandContext,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionRunner,\n\tExtensionSelectorComponent,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tHostCustomUiState,\n\tHostCustomUiStateListener,\n\tKeybinding,\n\tKeybindingsManager,\n\tLoaderIndicatorOptions,\n\tLoginDialogComponent,\n\tMarkdownTheme,\n\tMessage,\n\tMissingSessionCwdError,\n\tModel,\n\tOAuthSelectPrompt,\n\tOverlayHandle,\n\tOverlayOptions,\n\tProjectTrustContext,\n\tReadonlyFooterDataProvider,\n\tResourceDiagnostic,\n\tSessionContext,\n\tSlashCommand,\n\tSourceInfo,\n\tTheme,\n\tTUI,\n\tVerbatimCompactionResult,\n} from \"./interactive-mode-deps.ts\";\nimport type { InteractiveSubmission } from \"./interactive-submission.ts\";\n\ndeclare module \"./interactive-mode-base.ts\" {\n\tinterface InteractiveModeBase {\n\t\tgetAutocompleteSourceTag(sourceInfo?: SourceInfo): string | undefined;\n\t\tprefixAutocompleteDescription(description: string | undefined, sourceInfo?: SourceInfo): string | undefined;\n\t\tgetBuiltInCommandConflictDiagnostics(extensionRunner: ExtensionRunner): ResourceDiagnostic[];\n\t\tcreateBaseAutocompleteProvider(): AutocompleteProvider;\n\t\tbuildRemoteSlashCommands(localCommands: SlashCommand[]): SlashCommand[];\n\t\tsetupAutocompleteProvider(): void;\n\t\tshowStartupNoticesIfNeeded(targetContainer?: Container): void;\n\t\treportModelCatalogWarning(targetContainer?: Container): void;\n\t\treportedModelCatalogWarning: string | undefined;\n\t\thadLastChangelogVersionAtStartup: boolean;\n\t\tfirstRunNoticeVisible: boolean;\n\t\tfirstRunOnboardingNoticeComponents: Component[];\n\t\tinitializeFirstRunOnboardingMarkers(): void;\n\t\tisFirstRunOnboardingEligible(): boolean;\n\t\tclearFirstRunOnboardingUi(): void;\n\t\tinit(): Promise<void>;\n\t\tcompleteDeferredStartup(): Promise<void>;\n\t\tretryDeferredModelRestore(targetContainer?: Container): Promise<void>;\n\t\tupdateTerminalTitle(): void;\n\t\trun(): Promise<void>;\n\t\tcheckForPackageUpdates(): Promise<string[]>;\n\t\tcheckTmuxKeyboardSetup(): Promise<string | undefined>;\n\t\tgetChangelogForDisplay(): string | undefined;\n\t\treportInstallTelemetry(version: string): void;\n\t\tgetMarkdownThemeWithSettings(): MarkdownTheme;\n\t\tgetMarkdownTransformers(): MarkdownTransformer[];\n\t\tformatDisplayPath(p: string): string;\n\t\tformatExtensionDisplayPath(path: string): string;\n\t\tformatContextPath(p: string): string;\n\t\tgetStartupModelLabel(): string;\n\t\tgetStartupIdentityText(maxWidth?: number, gap?: number, manifestoPhase?: number): string;\n\t\tgetAtomicAnsiMarkLines(gap?: number): string[];\n\t\tgetStartupExpansionState(): boolean;\n\t\tshouldShowStartupHeader(): boolean;\n\t\tshouldShowStartupDetails(): boolean;\n\t\tgetShortPath(fullPath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPathLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactPackageSourceLabel(sourceInfo?: SourceInfo): string;\n\t\tgetCompactExtensionLabel(resourcePath: string, sourceInfo?: SourceInfo): string;\n\t\tgetCompactDisplayPathSegments(resourcePath: string): string[];\n\t\tgetCompactNonPackageExtensionLabel(\n\t\t\tresourcePath: string,\n\t\t\tindex: number,\n\t\t\tallPaths: Array<{ path: string; segments: string[] }>,\n\t\t): string;\n\t\tgetCompactExtensionLabels(extensions: Array<{ path: string; sourceInfo?: SourceInfo }>): string[];\n\t\tgetDisplaySourceInfo(sourceInfo?: SourceInfo): {\n\t\t\tlabel: string;\n\t\t\tscopeLabel?: string;\n\t\t\tcolor: \"accent\" | \"muted\";\n\t\t};\n\t\tgetScopeGroup(sourceInfo?: SourceInfo): \"user\" | \"project\" | \"path\";\n\t\tisPackageSource(sourceInfo?: SourceInfo): boolean;\n\t\tbuildScopeGroups(items: Array<{ path: string; sourceInfo?: SourceInfo }>): Array<{\n\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t}>;\n\t\tformatScopeGroups(\n\t\t\tgroups: Array<{\n\t\t\t\tscope: \"user\" | \"project\" | \"path\";\n\t\t\t\tpaths: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\t\tpackages: Map<string, Array<{ path: string; sourceInfo?: SourceInfo }>>;\n\t\t\t}>,\n\t\t\toptions: {\n\t\t\t\tformatPath: (item: { path: string; sourceInfo?: SourceInfo }) => string;\n\t\t\t\tformatPackagePath: (item: { path: string; sourceInfo?: SourceInfo }, source: string) => string;\n\t\t\t},\n\t\t): string;\n\t\tfindSourceInfoForPath(p: string, sourceInfos: Map<string, SourceInfo>): SourceInfo | undefined;\n\t\tformatPathWithSource(p: string, sourceInfo?: SourceInfo): string;\n\t\tformatDiagnostics(diagnostics: readonly ResourceDiagnostic[], sourceInfos: Map<string, SourceInfo>): string;\n\t\taddResourceDisclosure(options: {\n\t\t\tcontextFiles: ReadonlyArray<{ path: string }>;\n\t\t\tskills: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\tprompts: ReadonlyArray<{ filePath: string; name: string }>;\n\t\t\textensions: ReadonlyArray<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\texpandedSections: {\n\t\t\t\tcontext?: string;\n\t\t\t\tskills?: string;\n\t\t\t\tprompts?: string;\n\t\t\t\textensions?: string;\n\t\t\t};\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tshowLoadedResources(options?: {\n\t\t\textensions?: Array<{ path: string; sourceInfo?: SourceInfo }>;\n\t\t\tforce?: boolean;\n\t\t\tshowDiagnosticsWhenQuiet?: boolean;\n\t\t\ttargetContainer?: Container;\n\t\t}): void;\n\t\tbindCurrentSessionExtensions(): Promise<void>;\n\t\tapplyRuntimeSettings(): void;\n\t\trebindCurrentSession(): Promise<void>;\n\t\thandleFatalRuntimeError(prefix: string, error: unknown): Promise<never>;\n\t\trenderCurrentSessionState(): void;\n\t\tgetRegisteredToolDefinition(toolName: string): ToolRenderers | undefined;\n\t\tsetupExtensionShortcuts(extensionRunner: ExtensionRunner): void;\n\t\tsetExtensionStatus(key: string, text: string | undefined): void;\n\t\tgetWorkingLoaderMessage(): string;\n\t\tcreateWorkingLoader(): AtomicWorkingLoader;\n\t\tclearWorkingLoader(): void;\n\t\tstopWorkingLoader(): void;\n\t\tshowWorkingLoaderNow(): void;\n\t\tsetWorkingVisible(visible: boolean): void;\n\t\tsetWorkingIndicator(options?: LoaderIndicatorOptions): void;\n\t\tsetHiddenThinkingLabel(label?: string): void;\n\t\tsetExtensionWidget(\n\t\t\tkey: string,\n\t\t\tcontent: string[] | ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined,\n\t\t\toptions?: ExtensionWidgetOptions,\n\t\t): void;\n\t\tclearExtensionWidgets(): void;\n\t\tresetExtensionUI(): void;\n\t\trenderWidgets(): void;\n\t\trenderWidgetContainer(\n\t\t\tcontainer: Container,\n\t\t\twidgets: Map<string, Component & { dispose?(): void }>,\n\t\t\tspacerWhenEmpty: boolean,\n\t\t\tleadingSpacer: boolean,\n\t\t): void;\n\t\tsetExtensionFooter(\n\t\t\tfactory:\n\t\t\t\t| ((tui: TUI, thm: Theme, footerData: ReadonlyFooterDataProvider) => Component & { dispose?(): void })\n\t\t\t\t| undefined,\n\t\t): void;\n\t\tsetExtensionHeader(factory: ((tui: TUI, thm: Theme) => Component & { dispose?(): void }) | undefined): void;\n\t\taddExtensionTerminalInputListener(\n\t\t\thandler: (data: string) => { consume?: boolean; data?: string } | undefined,\n\t\t): () => void;\n\t\tclearExtensionTerminalInputListeners(): void;\n\t\tgetHostCustomUiState(): HostCustomUiState;\n\t\tnotifyHostCustomUiStateListeners(): void;\n\t\tbeginHostInlineCustomUi(purpose?: \"prompt\" | \"navigation\"): () => void;\n\t\tbeginInlineCustomUiFocusDeferral(): () => void;\n\t\tshouldDeferInlineCustomUiFocus(): boolean;\n\t\tfocusHostInlineCustomUi(): boolean;\n\t\tonHostCustomUiStateChange(listener: HostCustomUiStateListener): () => void;\n\t\tonExtensionWidgetRelease(key: string, listener: () => void): () => void;\n\t\tnotifyExtensionWidgetRelease(key: string): void;\n\t\tcreateProjectTrustContext(cwd: string): ProjectTrustContext;\n\t\tcreateExtensionUIContext(): ExtensionUIContext;\n\t\tshowExtensionSelector(\n\t\t\ttitle: string,\n\t\t\toptions: string[],\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionSelector(instance?: ExtensionSelectorComponent): void;\n\t\tshowExtensionConfirm(title: string, message: string, opts?: ExtensionUIDialogOptions): Promise<boolean>;\n\t\tpromptForMissingSessionCwd(error: MissingSessionCwdError): Promise<string | undefined>;\n\t\tshowExtensionInput(\n\t\t\ttitle: string,\n\t\t\tplaceholder?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionInput(instance?: ExtensionInputComponent): void;\n\t\tshowExtensionEditor(\n\t\t\ttitle: string,\n\t\t\tprefill?: string,\n\t\t\topts?: ExtensionUIDialogOptions,\n\t\t): Promise<string | undefined>;\n\t\thideExtensionEditor(instance?: ExtensionEditorComponent): void;\n\t\tsetCustomEditorComponent(factory: EditorFactory | undefined): void;\n\t\tshowExtensionNotify(message: string, type?: \"info\" | \"warning\" | \"error\"): void;\n\t\tshowExtensionCustom<T>(\n\t\t\tfactory: (\n\t\t\t\ttui: TUI,\n\t\t\t\ttheme: Theme,\n\t\t\t\tkeybindings: KeybindingsManager,\n\t\t\t\tdone: (result: T) => void,\n\t\t\t) => (Component & { dispose?(): void }) | Promise<Component & { dispose?(): void }>,\n\t\t\toptions?: {\n\t\t\t\tpurpose?: \"prompt\" | \"navigation\";\n\t\t\t\toverlay?: boolean;\n\t\t\t\tdeferInlineCustomUiFocus?: boolean;\n\t\t\t\thandlesInternalUiAction?: boolean;\n\t\t\t\t/** Overlay-only: bound the overlay and reserve transcript scroll extent. */\n\t\t\t\treserveTranscriptRows?: boolean;\n\t\t\t\tsignal?: AbortSignal;\n\t\t\t\toverlayOptions?: OverlayOptions | (() => OverlayOptions);\n\t\t\t\tonHandle?: (handle: OverlayHandle) => void;\n\t\t\t},\n\t\t): Promise<T>;\n\t\tshowExtensionError(extensionPath: string, error: string, stack?: string): void;\n\t\tsetupKeyHandlers(): void;\n\t\thandleClipboardImagePaste(): Promise<void>;\n\t\tsetupEditorSubmitHandler(): void;\n\t\tdeliverStartupReplayPrompt(text: string): void;\n\t\trecoverCookedStartupInput(): boolean;\n\t\tdrainStartupReplayCommands(): Promise<void>;\n\t\tadvanceStartupInputReplay(submittedText: string): void;\n\t\tsubscribeToAgent(): void;\n\t\thandleEvent(event: AgentSessionEvent | JsonAgentSessionEvent): Promise<void>;\n\t\tgetUserMessageText(message: Message): string;\n\t\tshowStatus(message: string, persist?: boolean): void;\n\t\t/** Report a managed-tool (fd/rg) readiness update inside the transcript. */\n\t\tshowManagedToolStatus(status: ToolStatus): void;\n\t\t/** Bring fd/rg to readiness after first paint; progress lands in the transcript. */\n\t\tensureManagedToolsReady(): Promise<void>;\n\t\tchatMessageRenderOptions(): ChatMessageRenderOptions;\n\t\taddRenderedChatEntry(entry: ChatMessageEntry): Component;\n\t\taddCompactionBoundaryToChat(result: VerbatimCompactionResult): void;\n\t\taddCompactionCostNotice(kind: \"compaction\" | \"branch_summary\", usage: Usage): void;\n\t\tmaybeShowAssistantDiagnostics(message: AssistantMessage): void;\n\t\tmaybeShowInstallChangeWarning(): boolean;\n\t\taddMessageToChat(message: AgentMessage, options?: { populateHistory?: boolean }): void;\n\t\taddCustomEntryToChat(entry: CustomEntry): void;\n\t\trenderSessionContext(\n\t\t\tsessionContext: SessionContext,\n\t\t\toptions?: { updateFooter?: boolean; populateHistory?: boolean },\n\t\t): void;\n\t\trenderSessionEntries(\n\t\t\tentries: SessionEntry[],\n\t\t\toptions?: {\n\t\t\t\tupdateFooter?: boolean;\n\t\t\t\tpopulateHistory?: boolean;\n\t\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\t},\n\t\t): void;\n\t\trenderInitialMessages(): void;\n\t\tattachStartupNoticesContainer(options?: { resetDetached?: boolean }): void;\n\t\tgetUserInput(): Promise<InteractiveSubmission>;\n\t\trunUserPromptTurn(submission: InteractiveSubmission | string): Promise<void>;\n\t\trenderDeferredUserInput(text: string): void;\n\t\tconsumeDeferredRenderedUserInput(text: string): boolean;\n\t\tdiscardDeferredRenderedUserInput(text: string): void;\n\t\tensureDeferredStartupComplete(): Promise<void>;\n\t\trebuildChatFromMessages(options?: {\n\t\t\tsuppressCompactionBoundary?: VerbatimCompactionResult;\n\t\t\tresetStartupDisclosure?: boolean;\n\t\t}): void;\n\t\thandleCtrlC(): void;\n\t\tinterruptActiveOperation(): boolean;\n\t\thandleCtrlD(): void;\n\t\tshutdown(options?: { fromSignal?: boolean }): Promise<void>;\n\t\temergencyTerminalExit(): never;\n\t\tuncaughtCrash(error: Error): never;\n\t\tgetCrashExtensionHint(error: unknown): string | undefined;\n\t\tcheckShutdownRequested(): Promise<void>;\n\t\tregisterSignalHandlers(): void;\n\t\tunregisterSignalHandlers(): void;\n\t\thandleCtrlZ(): void;\n\t\thandleFollowUp(): Promise<void>;\n\t\thandleDequeue(): void;\n\t\trefreshBuiltInHeader(): void;\n\t\tupdateEditorBorderColor(): void;\n\t\tcycleThinkingLevel(): void;\n\t\tcycleModel(direction: \"forward\" | \"backward\"): Promise<void>;\n\t\ttoggleToolOutputExpansion(): void;\n\t\tsetToolsExpanded(expanded: boolean): void;\n\t\ttoggleThinkingBlockVisibility(): void;\n\t\tupdateThinkingBlockVisibility(): void;\n\t\topenExternalEditor(): Promise<void>;\n\t\tclearEditor(): void;\n\t\tshowError(errorMessage: string): void;\n\t\tshowWarning(warningMessage: string, targetContainer?: Container): void;\n\t\tshowNewVersionNotification(newVersion: string, targetContainer?: Container): void;\n\t\tshowPackageUpdateNotification(packages: string[], targetContainer?: Container): void;\n\t\tgetAllQueuedMessages(): { steering: string[]; followUp: string[] };\n\t\tclearAllQueues(options?: { preserveUnprotectedCustomMessages?: boolean }): {\n\t\t\tsteering: string[];\n\t\t\tfollowUp: string[];\n\t\t};\n\t\tupdatePendingMessagesDisplay(): void;\n\t\trestoreQueuedMessagesToEditor(options?: {\n\t\t\tabort?: boolean;\n\t\t\tcurrentText?: string;\n\t\t\tpreserveUnprotectedCustomMessages?: boolean;\n\t\t}): number;\n\t\tqueueCompactionMessage(text: string, mode: \"steer\" | \"followUp\"): void;\n\t\tisExtensionCommand(text: string): boolean;\n\t\tflushCompactionQueue(options?: { willRetry?: boolean }): Promise<void>;\n\t\tflushPendingBashComponents(): void;\n\t\tshowSelector(\n\t\t\tcreate: (done: () => void) => { component: Component; focus: Component; dispose?: () => void },\n\t\t): void;\n\t\tshowSettingsSelector(): void;\n\t\thandleModelCommand(searchTerm?: string): Promise<void>;\n\t\thandleThinkingCommand(searchTerm?: string): void;\n\t\tselectThinkingLevel(level: ThinkingLevel): void;\n\t\tshowThinkingSelector(): void;\n\t\tfindExactModelMatch(searchTerm: string): Promise<Model<Api> | undefined>;\n\t\tgetModelCandidates(): Promise<Model<Api>[]>;\n\t\tupdateAvailableProviderCount(): Promise<void>;\n\t\tmaybeWarnAboutAnthropicSubscriptionAuth(\n\t\t\tmodel?: Model<Api> | undefined,\n\t\t\ttargetContainer?: Container,\n\t\t): Promise<void>;\n\t\tshowModelSelector(initialSearchInput?: string): void;\n\t\tshowModelsSelector(): void;\n\t\tshowUserMessageSelector(): Promise<void>;\n\t\thandleCloneCommand(): Promise<void>;\n\t\tmaybeSaveImplicitProjectTrustAfterReload(): boolean;\n\t\tshowTrustSelector(): void;\n\t\tshowTreeSelector(initialSelectedId?: string): Promise<void>;\n\t\tshowSessionSelector(): void;\n\t\thandleResumeSession(\n\t\t\tsessionPath: string,\n\t\t\toptions?: Parameters<ExtensionCommandContext[\"switchSession\"]>[1],\n\t\t): Promise<{ cancelled: boolean }>;\n\t\tgetLoginProviderOptions(authType?: \"oauth\" | \"api_key\"): AuthSelectorProvider[];\n\t\tgetLogoutProviderOptions(): AuthSelectorProvider[];\n\t\thandleLoginCommand(providerRef?: string): Promise<void>;\n\t\tstartProviderLogin(providerOption: AuthSelectorProvider, onBack?: () => void): Promise<void>;\n\t\tshowLoginAuthTypeSelector(providerOptions?: AuthSelectorProvider[]): void;\n\t\tshowLoginProviderSelector(authType?: \"oauth\" | \"api_key\", initialSearchInput?: string): void;\n\t\tshowOAuthSelector(mode: \"login\" | \"logout\", initialSearchInput?: string): Promise<void>;\n\t\tcompleteProviderAuthentication(\n\t\t\tproviderId: string,\n\t\t\tproviderName: string,\n\t\t\tauthType: \"oauth\" | \"api_key\",\n\t\t\tpreviousModel: Model<Api> | undefined,\n\t\t\toptions?: { modelsRefreshed?: boolean },\n\t\t): Promise<void>;\n\t\tshowBedrockSetupDialog(providerId: string, providerName: string, onBack?: () => void): void;\n\t\tshowApiKeyLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\tshowOAuthLoginSelect(dialog: LoginDialogComponent, prompt: OAuthSelectPrompt): Promise<string | undefined>;\n\t\tshowLoginDialog(providerId: string, providerName: string, onBack?: () => void): Promise<void>;\n\t\thandleReloadCommand(): Promise<void>;\n\t\thandleExportCommand(text: string): Promise<void>;\n\t\tgetPathCommandArgument(text: string, command: \"/export\" | \"/import\"): string | undefined;\n\t\thandleImportCommand(text: string): Promise<void>;\n\t\thandleShareCommand(): Promise<void>;\n\t\thandleCopyCommand(): Promise<void>;\n\t\thandleNameCommand(text: string): void;\n\t\thandleSessionCommand(): void;\n\t\thandleChangelogCommand(): void;\n\t\tgetAppKeyDisplay(action: AppKeybinding): string;\n\t\tgetEditorKeyDisplay(action: Keybinding): string;\n\t\tjumpToTranscriptEnd(): void;\n\t\tsetFullscreenCopyOnSelect(enabled: boolean): void;\n\t\thandleHotkeysCommand(): void;\n\t\thandleClearCommand(): Promise<void>;\n\t\thandleDebugCommand(): void;\n\t\thandleArminSaysHi(): void;\n\t\thandleDementedDelves(): void;\n\t\thandleBashCommand(command: string, excludeFromContext?: boolean): Promise<void>;\n\t\thandleCompactCommand(): Promise<void>;\n\t\tstop(fullscreenExitOutput?: FullscreenExitOutput): void;\n\t}\n}\n"]}
@@ -100,6 +100,9 @@ InteractiveModeBase.prototype.emergencyTerminalExit = function () {
100
100
  process.exit(129);
101
101
  };
102
102
  InteractiveModeBase.prototype.uncaughtCrash = function (error) {
103
+ if (isDeadTerminalError(error) && error.syscall === "setRawMode") {
104
+ this.emergencyTerminalExit();
105
+ }
103
106
  if (this.isShuttingDown) {
104
107
  process.exit(1);
105
108
  }
@@ -161,10 +164,10 @@ InteractiveModeBase.prototype.registerSignalHandlers = function () {
161
164
  }
162
165
  throw error;
163
166
  };
164
- process.stdout.on("error", terminalErrorHandler);
165
- process.stderr.on("error", terminalErrorHandler);
166
- this.signalCleanupHandlers.push(() => process.stdout.off("error", terminalErrorHandler));
167
- this.signalCleanupHandlers.push(() => process.stderr.off("error", terminalErrorHandler));
167
+ for (const stream of [process.stdin, process.stdout, process.stderr]) {
168
+ stream.on("error", terminalErrorHandler);
169
+ this.signalCleanupHandlers.push(() => stream.off("error", terminalErrorHandler));
170
+ }
168
171
  // Restore the terminal before the process dies on any uncaught throw.
169
172
  // Without this, an unhandled exception from extension code (or anywhere
170
173
  // in pi) leaves the terminal in raw mode with no cursor.
@@ -1 +1 @@
1
- {"version":3,"file":"interactive-process-lifecycle.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-process-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,M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C/B,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,aAAa,GAAG;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC","sourcesContent":["import { findExtensionStackMatches } from \"../../core/crash-log.ts\";\nimport { terminateInteractiveEngine } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { APP_TITLE, chalk, killTrackedDetachedChildren } from \"./interactive-mode-deps.ts\";\nimport { formatCrashExtensionHint, formatResumeCommand, isDeadTerminalError } from \"./interactive-mode-helpers.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft } from \"./interactive-prompt-restore.ts\";\nimport { isWindowsSubshellActive, openWindowsSubshell } from \"./interactive-windows-subshell.ts\";\n\nconst SHUTDOWN_INPUT_DRAIN_MAX_MS = 250;\nconst SHUTDOWN_INPUT_DRAIN_IDLE_MS = 50;\n\nInteractiveModeBase.prototype.handleCtrlC = function (this: InteractiveModeBase): void {\n\tif (isWindowsSubshellActive(this)) return;\n\t// When the agent is doing work, Ctrl+C interrupts it (matching Escape and\n\t// common CLI muscle memory) instead of clearing/exiting the editor. Only\n\t// fall back to the clear / double-press-exit behavior when idle.\n\tif (this.interruptActiveOperation()) {\n\t\t// Reset the double-press window so a follow-up Ctrl+C after the abort\n\t\t// does not immediately exit.\n\t\tthis.lastSigintTime = 0;\n\t\treturn;\n\t}\n\tconst now = Date.now();\n\tif (now - this.lastSigintTime < 500) {\n\t\tvoid this.shutdown();\n\t} else {\n\t\tthis.clearEditor();\n\t\tthis.lastSigintTime = now;\n\t}\n};\n\nInteractiveModeBase.prototype.interruptActiveOperation = function (this: InteractiveModeBase): boolean {\n\t// Mirror the Escape interrupt paths so Ctrl+C aborts whichever operation is\n\t// currently running. Returns true when something was aborted.\n\t//\n\t// Escalate first when the interactive engine owes a cooperative abort or the\n\t// heartbeat watchdog calls it unresponsive: that is the explicit termination\n\t// the watchdog advertises with \"Esc interrupt · Ctrl+C terminate\". Every\n\t// cooperative route below would otherwise queue another request for a child\n\t// that cannot answer.\n\tif (terminateInteractiveEngine(this.runtimeHost)) {\n\t\treturn true;\n\t}\n\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages()) {\n\t\tpauseAndAbortInteractiveSession(this);\n\t\treturn true;\n\t}\n\tif (this.session.isBashRunning) {\n\t\tthis.session.abortBash();\n\t\treturn true;\n\t}\n\tif (this.session.isCompacting) {\n\t\tthis.session.abortCompaction();\n\t\treturn true;\n\t}\n\tif (this.session.isRetrying) {\n\t\tthis.session.abortRetry();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nInteractiveModeBase.prototype.handleCtrlD = function (this: InteractiveModeBase): void {\n\t// Only called when editor is empty (enforced by CustomEditor)\n\tvoid this.shutdown();\n};\n\nInteractiveModeBase.prototype.shutdown = async function (\n\tthis: InteractiveModeBase,\n\toptions?: { fromSignal?: boolean },\n): Promise<void> {\n\tif (this.isShuttingDown) return;\n\tthis.isShuttingDown = true;\n\t// Keep signal handlers registered until terminal cleanup has completed.\n\t// `signal-exit` checks the listener list during the same SIGTERM/SIGHUP\n\t// dispatch and re-sends the signal if only its own listeners remain.\n\n\tif (options?.fromSignal) {\n\t\tawait this.runtimeHost.dispose();\n\t\tthis.themeController.disableAutoSync();\n\t\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\t\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\t\tthis.stop();\n\t\tprocess.exit(0);\n\t}\n\n\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\tthis.themeController.disableAutoSync();\n\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\n\tthis.stop();\n\tawait this.runtimeHost.dispose();\n\tconst resumeCommand = formatResumeCommand(this.sessionManager);\n\tif (resumeCommand) {\n\t\tprocess.stdout.write(`${chalk.dim(\"To resume this session:\")} ${resumeCommand}\\n`);\n\t}\n\tprocess.exit(0);\n};\n\nInteractiveModeBase.prototype.emergencyTerminalExit = function (this: InteractiveModeBase): never {\n\tthis.isShuttingDown = true;\n\tthis.unregisterSignalHandlers();\n\tkillTrackedDetachedChildren();\n\t// The terminal is gone. Do not run normal shutdown because TUI and\n\t// extension cleanup can write restore sequences and re-trigger EIO.\n\tprocess.exit(129);\n};\n\nInteractiveModeBase.prototype.uncaughtCrash = function (this: InteractiveModeBase, error: Error): never {\n\tif (this.isShuttingDown) {\n\t\tprocess.exit(1);\n\t}\n\tthis.isShuttingDown = true;\n\ttry {\n\t\tthis.unregisterSignalHandlers();\n\t} catch {}\n\ttry {\n\t\tkillTrackedDetachedChildren();\n\t} catch {}\n\ttry {\n\t\tthis.ui.stop();\n\t} catch {}\n\tconsole.error(`${APP_TITLE} exiting due to uncaughtException:`);\n\tconsole.error(error);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) console.error(`\\n${extensionHint}`);\n\tprocess.exit(1);\n};\n\nInteractiveModeBase.prototype.getCrashExtensionHint = function (\n\tthis: InteractiveModeBase,\n\terror: unknown,\n): string | undefined {\n\ttry {\n\t\treturn formatCrashExtensionHint(\n\t\t\tfindExtensionStackMatches(\n\t\t\t\terror instanceof Error ? error.stack : undefined,\n\t\t\t\tthis.session.resourceLoader.getExtensions().extensions,\n\t\t\t),\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nInteractiveModeBase.prototype.checkShutdownRequested = async function (this: InteractiveModeBase): Promise<void> {\n\tif (!this.shutdownRequested) return;\n\tawait this.shutdown();\n};\n\nInteractiveModeBase.prototype.registerSignalHandlers = function (this: InteractiveModeBase): void {\n\tthis.unregisterSignalHandlers();\n\n\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\tif (process.platform !== \"win32\") {\n\t\tsignals.push(\"SIGHUP\");\n\t}\n\n\tfor (const signal of signals) {\n\t\tconst handler = () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid this.shutdown({ fromSignal: true });\n\t\t};\n\t\tprocess.prependListener(signal, handler);\n\t\tthis.signalCleanupHandlers.push(() => process.off(signal, handler));\n\t}\n\n\tconst sigintHandler = () => {\n\t\tthis.handleCtrlC();\n\t};\n\tprocess.prependListener(\"SIGINT\", sigintHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"SIGINT\", sigintHandler));\n\n\tconst terminalErrorHandler = (error: Error) => {\n\t\tif (isDeadTerminalError(error)) {\n\t\t\tthis.emergencyTerminalExit();\n\t\t}\n\t\tthrow error;\n\t};\n\tprocess.stdout.on(\"error\", terminalErrorHandler);\n\tprocess.stderr.on(\"error\", terminalErrorHandler);\n\tthis.signalCleanupHandlers.push(() => process.stdout.off(\"error\", terminalErrorHandler));\n\tthis.signalCleanupHandlers.push(() => process.stderr.off(\"error\", terminalErrorHandler));\n\n\t// Restore the terminal before the process dies on any uncaught throw.\n\t// Without this, an unhandled exception from extension code (or anywhere\n\t// in pi) leaves the terminal in raw mode with no cursor.\n\tconst uncaughtExceptionHandler = (error: Error) => this.uncaughtCrash(error);\n\tprocess.prependListener(\"uncaughtException\", uncaughtExceptionHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"uncaughtException\", uncaughtExceptionHandler));\n};\n\nInteractiveModeBase.prototype.unregisterSignalHandlers = function (this: InteractiveModeBase): void {\n\tfor (const cleanup of this.signalCleanupHandlers) {\n\t\tcleanup();\n\t}\n\tthis.signalCleanupHandlers = [];\n};\n\nInteractiveModeBase.prototype.handleCtrlZ = function (this: InteractiveModeBase): void {\n\tif (process.platform === \"win32\") {\n\t\tvoid openWindowsSubshell(this).catch((error: Error) =>\n\t\t\tthis.showStatus(`PowerShell subshell failed: ${error.message}`),\n\t\t);\n\t\treturn;\n\t}\n\n\t// Keep the event loop alive while suspended. Without this, stopping the TUI\n\t// can leave Node with no ref'ed handles, causing the process to exit on fg\n\t// before the SIGCONT handler gets a chance to restore the terminal.\n\tconst suspendKeepAlive = setInterval(() => {}, 2 ** 30);\n\n\t// Ignore SIGINT while suspended so Ctrl+C in the terminal does not\n\t// kill the backgrounded process. The handler is removed on resume.\n\tconst ignoreSigint = () => {};\n\tprocess.on(\"SIGINT\", ignoreSigint);\n\n\t// Set up handler to restore TUI when resumed\n\tprocess.once(\"SIGCONT\", () => {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthis.ui.start();\n\t\tthis.ui.requestRender(true);\n\t});\n\n\ttry {\n\t\t// Stop the TUI (restore terminal to normal mode)\n\t\tthis.ui.stop();\n\n\t\t// Send SIGTSTP to process group (pid=0 means all processes in group)\n\t\tprocess.kill(0, \"SIGTSTP\");\n\t} catch (error) {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthrow error;\n\t}\n};\n\nInteractiveModeBase.prototype.handleFollowUp = async function (this: InteractiveModeBase): Promise<void> {\n\tconst rawText = this.editor.getExpandedText?.() ?? this.editor.getText();\n\tconst text = rawText.trim();\n\tif (!text) return;\n\n\t// Alt+Enter dispatches straight to the engine, exactly like the direct\n\t// branches of the Enter handler, so it needs the same send-failure restore:\n\t// otherwise a queued follow-up submitted while the engine is gone is lost.\n\tconst dispatch = async (send: () => Promise<void>): Promise<void> => {\n\t\ttry {\n\t\t\tawait send();\n\t\t} catch (error) {\n\t\t\tif (!restoreFailedSubmissionDraft(this, error, rawText)) throw error;\n\t\t}\n\t};\n\n\t// Queue input during compaction (extension commands execute immediately)\n\tif (this.compactionActive) {\n\t\tif (this.isExtensionCommand(text)) {\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\tawait dispatch(() => this.session.prompt(text));\n\t\t} else {\n\t\t\tthis.queueCompactionMessage(text, \"followUp\");\n\t\t}\n\t\treturn;\n\t}\n\n\t// Alt+Enter queues a follow-up message (waits until agent finishes)\n\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\tif (this.session.isStreaming) {\n\t\tthis.editor.addToHistory?.(text);\n\t\tthis.editor.setText(\"\");\n\t\tawait dispatch(async () => {\n\t\t\tawait this.session.prompt(text, { streamingBehavior: \"followUp\" });\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t});\n\t}\n\t// If not streaming, Alt+Enter acts like regular Enter (trigger onSubmit).\n\t// Hand over the raw expanded buffer, not the trimmed text: Alt+Enter is an\n\t// app action, so CustomEditor returns before its own pre-trim snapshot runs\n\t// and the submit handler's only draft is this argument. It trims the value\n\t// itself for delivery, so the agent still receives the normalized prompt.\n\telse if (this.editor.onSubmit) {\n\t\tthis.editor.setText(\"\");\n\t\tthis.editor.onSubmit(rawText);\n\t}\n};\n\nInteractiveModeBase.prototype.handleDequeue = function (this: InteractiveModeBase): void {\n\tconst restored = this.restoreQueuedMessagesToEditor();\n\tif (restored === 0) {\n\t\tthis.showStatus(\"No queued messages to restore\");\n\t}\n};\n"]}
1
+ {"version":3,"file":"interactive-process-lifecycle.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-process-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC1F,OA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AAC,CAAC;QACxB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;AACF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,aAAa,GAAG;IAC7C,MAAM,QAAQ,GAAG,IAAI,CAAC,6BAA6B,EAAE,CAAC;IACtD,IAAI,QAAQ,KAAK,CAAC,EAAE,CAAC;QACpB,IAAI,CAAC,UAAU,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;AACF,CAAC,CAAC","sourcesContent":["import { findExtensionStackMatches } from \"../../core/crash-log.ts\";\nimport { terminateInteractiveEngine } from \"../interactive-engine/extension-ui-bridge.ts\";\nimport { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { APP_TITLE, chalk, killTrackedDetachedChildren } from \"./interactive-mode-deps.ts\";\nimport { formatCrashExtensionHint, formatResumeCommand, isDeadTerminalError } from \"./interactive-mode-helpers.ts\";\nimport { pauseAndAbortInteractiveSession } from \"./interactive-pause.ts\";\nimport { restoreFailedSubmissionDraft } from \"./interactive-prompt-restore.ts\";\nimport { isWindowsSubshellActive, openWindowsSubshell } from \"./interactive-windows-subshell.ts\";\n\nconst SHUTDOWN_INPUT_DRAIN_MAX_MS = 250;\nconst SHUTDOWN_INPUT_DRAIN_IDLE_MS = 50;\n\nInteractiveModeBase.prototype.handleCtrlC = function (this: InteractiveModeBase): void {\n\tif (isWindowsSubshellActive(this)) return;\n\t// When the agent is doing work, Ctrl+C interrupts it (matching Escape and\n\t// common CLI muscle memory) instead of clearing/exiting the editor. Only\n\t// fall back to the clear / double-press-exit behavior when idle.\n\tif (this.interruptActiveOperation()) {\n\t\t// Reset the double-press window so a follow-up Ctrl+C after the abort\n\t\t// does not immediately exit.\n\t\tthis.lastSigintTime = 0;\n\t\treturn;\n\t}\n\tconst now = Date.now();\n\tif (now - this.lastSigintTime < 500) {\n\t\tvoid this.shutdown();\n\t} else {\n\t\tthis.clearEditor();\n\t\tthis.lastSigintTime = now;\n\t}\n};\n\nInteractiveModeBase.prototype.interruptActiveOperation = function (this: InteractiveModeBase): boolean {\n\t// Mirror the Escape interrupt paths so Ctrl+C aborts whichever operation is\n\t// currently running. Returns true when something was aborted.\n\t//\n\t// Escalate first when the interactive engine owes a cooperative abort or the\n\t// heartbeat watchdog calls it unresponsive: that is the explicit termination\n\t// the watchdog advertises with \"Esc interrupt · Ctrl+C terminate\". Every\n\t// cooperative route below would otherwise queue another request for a child\n\t// that cannot answer.\n\tif (terminateInteractiveEngine(this.runtimeHost)) {\n\t\treturn true;\n\t}\n\tif (this.session.isStreaming || this.session.agent.hasQueuedMessages()) {\n\t\tpauseAndAbortInteractiveSession(this);\n\t\treturn true;\n\t}\n\tif (this.session.isBashRunning) {\n\t\tthis.session.abortBash();\n\t\treturn true;\n\t}\n\tif (this.session.isCompacting) {\n\t\tthis.session.abortCompaction();\n\t\treturn true;\n\t}\n\tif (this.session.isRetrying) {\n\t\tthis.session.abortRetry();\n\t\treturn true;\n\t}\n\treturn false;\n};\n\nInteractiveModeBase.prototype.handleCtrlD = function (this: InteractiveModeBase): void {\n\t// Only called when editor is empty (enforced by CustomEditor)\n\tvoid this.shutdown();\n};\n\nInteractiveModeBase.prototype.shutdown = async function (\n\tthis: InteractiveModeBase,\n\toptions?: { fromSignal?: boolean },\n): Promise<void> {\n\tif (this.isShuttingDown) return;\n\tthis.isShuttingDown = true;\n\t// Keep signal handlers registered until terminal cleanup has completed.\n\t// `signal-exit` checks the listener list during the same SIGTERM/SIGHUP\n\t// dispatch and re-sends the signal if only its own listeners remain.\n\n\tif (options?.fromSignal) {\n\t\tawait this.runtimeHost.dispose();\n\t\tthis.themeController.disableAutoSync();\n\t\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\t\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\t\tthis.stop();\n\t\tprocess.exit(0);\n\t}\n\n\t// Drain any in-flight Kitty key release events briefly before stopping.\n\t// Keep this bounded so Ctrl+C exits do not feel stalled on Windows.\n\tthis.themeController.disableAutoSync();\n\tawait this.ui.terminal.drainInput(SHUTDOWN_INPUT_DRAIN_MAX_MS, SHUTDOWN_INPUT_DRAIN_IDLE_MS);\n\n\tthis.stop();\n\tawait this.runtimeHost.dispose();\n\tconst resumeCommand = formatResumeCommand(this.sessionManager);\n\tif (resumeCommand) {\n\t\tprocess.stdout.write(`${chalk.dim(\"To resume this session:\")} ${resumeCommand}\\n`);\n\t}\n\tprocess.exit(0);\n};\n\nInteractiveModeBase.prototype.emergencyTerminalExit = function (this: InteractiveModeBase): never {\n\tthis.isShuttingDown = true;\n\tthis.unregisterSignalHandlers();\n\tkillTrackedDetachedChildren();\n\t// The terminal is gone. Do not run normal shutdown because TUI and\n\t// extension cleanup can write restore sequences and re-trigger EIO.\n\tprocess.exit(129);\n};\n\nInteractiveModeBase.prototype.uncaughtCrash = function (this: InteractiveModeBase, error: Error): never {\n\tif (isDeadTerminalError(error) && (error as NodeJS.ErrnoException).syscall === \"setRawMode\") {\n\t\tthis.emergencyTerminalExit();\n\t}\n\tif (this.isShuttingDown) {\n\t\tprocess.exit(1);\n\t}\n\tthis.isShuttingDown = true;\n\ttry {\n\t\tthis.unregisterSignalHandlers();\n\t} catch {}\n\ttry {\n\t\tkillTrackedDetachedChildren();\n\t} catch {}\n\ttry {\n\t\tthis.ui.stop();\n\t} catch {}\n\tconsole.error(`${APP_TITLE} exiting due to uncaughtException:`);\n\tconsole.error(error);\n\tconst extensionHint = this.getCrashExtensionHint(error);\n\tif (extensionHint) console.error(`\\n${extensionHint}`);\n\tprocess.exit(1);\n};\n\nInteractiveModeBase.prototype.getCrashExtensionHint = function (\n\tthis: InteractiveModeBase,\n\terror: unknown,\n): string | undefined {\n\ttry {\n\t\treturn formatCrashExtensionHint(\n\t\t\tfindExtensionStackMatches(\n\t\t\t\terror instanceof Error ? error.stack : undefined,\n\t\t\t\tthis.session.resourceLoader.getExtensions().extensions,\n\t\t\t),\n\t\t);\n\t} catch {\n\t\treturn undefined;\n\t}\n};\n\nInteractiveModeBase.prototype.checkShutdownRequested = async function (this: InteractiveModeBase): Promise<void> {\n\tif (!this.shutdownRequested) return;\n\tawait this.shutdown();\n};\n\nInteractiveModeBase.prototype.registerSignalHandlers = function (this: InteractiveModeBase): void {\n\tthis.unregisterSignalHandlers();\n\n\tconst signals: NodeJS.Signals[] = [\"SIGTERM\"];\n\tif (process.platform !== \"win32\") {\n\t\tsignals.push(\"SIGHUP\");\n\t}\n\n\tfor (const signal of signals) {\n\t\tconst handler = () => {\n\t\t\tkillTrackedDetachedChildren();\n\t\t\tvoid this.shutdown({ fromSignal: true });\n\t\t};\n\t\tprocess.prependListener(signal, handler);\n\t\tthis.signalCleanupHandlers.push(() => process.off(signal, handler));\n\t}\n\n\tconst sigintHandler = () => {\n\t\tthis.handleCtrlC();\n\t};\n\tprocess.prependListener(\"SIGINT\", sigintHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"SIGINT\", sigintHandler));\n\n\tconst terminalErrorHandler = (error: Error) => {\n\t\tif (isDeadTerminalError(error)) {\n\t\t\tthis.emergencyTerminalExit();\n\t\t}\n\t\tthrow error;\n\t};\n\tfor (const stream of [process.stdin, process.stdout, process.stderr]) {\n\t\tstream.on(\"error\", terminalErrorHandler);\n\t\tthis.signalCleanupHandlers.push(() => stream.off(\"error\", terminalErrorHandler));\n\t}\n\n\t// Restore the terminal before the process dies on any uncaught throw.\n\t// Without this, an unhandled exception from extension code (or anywhere\n\t// in pi) leaves the terminal in raw mode with no cursor.\n\tconst uncaughtExceptionHandler = (error: Error) => this.uncaughtCrash(error);\n\tprocess.prependListener(\"uncaughtException\", uncaughtExceptionHandler);\n\tthis.signalCleanupHandlers.push(() => process.off(\"uncaughtException\", uncaughtExceptionHandler));\n};\n\nInteractiveModeBase.prototype.unregisterSignalHandlers = function (this: InteractiveModeBase): void {\n\tfor (const cleanup of this.signalCleanupHandlers) {\n\t\tcleanup();\n\t}\n\tthis.signalCleanupHandlers = [];\n};\n\nInteractiveModeBase.prototype.handleCtrlZ = function (this: InteractiveModeBase): void {\n\tif (process.platform === \"win32\") {\n\t\tvoid openWindowsSubshell(this).catch((error: Error) =>\n\t\t\tthis.showStatus(`PowerShell subshell failed: ${error.message}`),\n\t\t);\n\t\treturn;\n\t}\n\n\t// Keep the event loop alive while suspended. Without this, stopping the TUI\n\t// can leave Node with no ref'ed handles, causing the process to exit on fg\n\t// before the SIGCONT handler gets a chance to restore the terminal.\n\tconst suspendKeepAlive = setInterval(() => {}, 2 ** 30);\n\n\t// Ignore SIGINT while suspended so Ctrl+C in the terminal does not\n\t// kill the backgrounded process. The handler is removed on resume.\n\tconst ignoreSigint = () => {};\n\tprocess.on(\"SIGINT\", ignoreSigint);\n\n\t// Set up handler to restore TUI when resumed\n\tprocess.once(\"SIGCONT\", () => {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthis.ui.start();\n\t\tthis.ui.requestRender(true);\n\t});\n\n\ttry {\n\t\t// Stop the TUI (restore terminal to normal mode)\n\t\tthis.ui.stop();\n\n\t\t// Send SIGTSTP to process group (pid=0 means all processes in group)\n\t\tprocess.kill(0, \"SIGTSTP\");\n\t} catch (error) {\n\t\tclearInterval(suspendKeepAlive);\n\t\tprocess.removeListener(\"SIGINT\", ignoreSigint);\n\t\tthrow error;\n\t}\n};\n\nInteractiveModeBase.prototype.handleFollowUp = async function (this: InteractiveModeBase): Promise<void> {\n\tconst rawText = this.editor.getExpandedText?.() ?? this.editor.getText();\n\tconst text = rawText.trim();\n\tif (!text) return;\n\n\t// Alt+Enter dispatches straight to the engine, exactly like the direct\n\t// branches of the Enter handler, so it needs the same send-failure restore:\n\t// otherwise a queued follow-up submitted while the engine is gone is lost.\n\tconst dispatch = async (send: () => Promise<void>): Promise<void> => {\n\t\ttry {\n\t\t\tawait send();\n\t\t} catch (error) {\n\t\t\tif (!restoreFailedSubmissionDraft(this, error, rawText)) throw error;\n\t\t}\n\t};\n\n\t// Queue input during compaction (extension commands execute immediately)\n\tif (this.compactionActive) {\n\t\tif (this.isExtensionCommand(text)) {\n\t\t\tthis.editor.addToHistory?.(text);\n\t\t\tthis.editor.setText(\"\");\n\t\t\tawait dispatch(() => this.session.prompt(text));\n\t\t} else {\n\t\t\tthis.queueCompactionMessage(text, \"followUp\");\n\t\t}\n\t\treturn;\n\t}\n\n\t// Alt+Enter queues a follow-up message (waits until agent finishes)\n\t// This handles extension commands (execute immediately), prompt template expansion, and queueing\n\tif (this.session.isStreaming) {\n\t\tthis.editor.addToHistory?.(text);\n\t\tthis.editor.setText(\"\");\n\t\tawait dispatch(async () => {\n\t\t\tawait this.session.prompt(text, { streamingBehavior: \"followUp\" });\n\t\t\tthis.updatePendingMessagesDisplay();\n\t\t\tthis.ui.requestRender();\n\t\t});\n\t}\n\t// If not streaming, Alt+Enter acts like regular Enter (trigger onSubmit).\n\t// Hand over the raw expanded buffer, not the trimmed text: Alt+Enter is an\n\t// app action, so CustomEditor returns before its own pre-trim snapshot runs\n\t// and the submit handler's only draft is this argument. It trims the value\n\t// itself for delivery, so the agent still receives the normalized prompt.\n\telse if (this.editor.onSubmit) {\n\t\tthis.editor.setText(\"\");\n\t\tthis.editor.onSubmit(rawText);\n\t}\n};\n\nInteractiveModeBase.prototype.handleDequeue = function (this: InteractiveModeBase): void {\n\tconst restored = this.restoreQueuedMessagesToEditor();\n\tif (restored === 0) {\n\t\tthis.showStatus(\"No queued messages to restore\");\n\t}\n};\n"]}
@@ -0,0 +1,7 @@
1
+ import { type WriteStream } from "node:fs";
2
+ export declare function writeOutputFile(prefix: string, extension: string, data: string | Uint8Array): Promise<string>;
3
+ export declare function createOutputFileStream(prefix: string, extension: string): {
4
+ path: string;
5
+ stream: WriteStream;
6
+ };
7
+ //# sourceMappingURL=output-files.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-files.d.ts","sourceRoot":"","sources":["../../src/utils/output-files.ts"],"names":[],"mappings":"AAEA,OAAO,EAAqB,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAW9D,wBAAsB,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAInH;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,WAAW,CAAA;CAAE,CAG/G"}
@@ -0,0 +1,20 @@
1
+ /** Private, exclusively created tool output files in the OS temp directory. */
2
+ import { randomBytes } from "node:crypto";
3
+ import { createWriteStream } from "node:fs";
4
+ import { writeFile } from "node:fs/promises";
5
+ import { tmpdir } from "node:os";
6
+ import { join } from "node:path";
7
+ const OUTPUT_FILE_MODE = 0o600;
8
+ function createOutputFilePath(prefix, extension) {
9
+ return join(tmpdir(), `${prefix}-${randomBytes(8).toString("hex")}${extension}`);
10
+ }
11
+ export async function writeOutputFile(prefix, extension, data) {
12
+ const path = createOutputFilePath(prefix, extension);
13
+ await writeFile(path, data, { mode: OUTPUT_FILE_MODE, flag: "wx" });
14
+ return path;
15
+ }
16
+ export function createOutputFileStream(prefix, extension) {
17
+ const path = createOutputFilePath(prefix, extension);
18
+ return { path, stream: createWriteStream(path, { mode: OUTPUT_FILE_MODE, flags: "wx" }) };
19
+ }
20
+ //# sourceMappingURL=output-files.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output-files.js","sourceRoot":"","sources":["../../src/utils/output-files.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAoB,MAAM,SAAS,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,gBAAgB,GAAG,KAAK,CAAC;AAE/B,SAAS,oBAAoB,CAAC,MAAc,EAAE,SAAiB;IAC9D,OAAO,IAAI,CAAC,MAAM,EAAE,EAAE,GAAG,MAAM,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,SAAS,EAAE,CAAC,CAAC;AAClF,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CAAC,MAAc,EAAE,SAAiB,EAAE,IAAyB;IACjG,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrD,MAAM,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC;IACpE,OAAO,IAAI,CAAC;AACb,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAAc,EAAE,SAAiB;IACvE,MAAM,IAAI,GAAG,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;IACrD,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,iBAAiB,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;AAC3F,CAAC","sourcesContent":["/** Private, exclusively created tool output files in the OS temp directory. */\nimport { randomBytes } from \"node:crypto\";\nimport { createWriteStream, type WriteStream } from \"node:fs\";\nimport { writeFile } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n\nconst OUTPUT_FILE_MODE = 0o600;\n\nfunction createOutputFilePath(prefix: string, extension: string): string {\n\treturn join(tmpdir(), `${prefix}-${randomBytes(8).toString(\"hex\")}${extension}`);\n}\n\nexport async function writeOutputFile(prefix: string, extension: string, data: string | Uint8Array): Promise<string> {\n\tconst path = createOutputFilePath(prefix, extension);\n\tawait writeFile(path, data, { mode: OUTPUT_FILE_MODE, flag: \"wx\" });\n\treturn path;\n}\n\nexport function createOutputFileStream(prefix: string, extension: string): { path: string; stream: WriteStream } {\n\tconst path = createOutputFilePath(prefix, extension);\n\treturn { path, stream: createWriteStream(path, { mode: OUTPUT_FILE_MODE, flags: \"wx\" }) };\n}\n"]}
package/docs/codemode.md CHANGED
@@ -28,7 +28,7 @@ The result starts with `Script completed` or `Script failed`, the wall time, and
28
28
  |---|---|
29
29
  | `tools.<name>(args)` | Call a tool. See [Call tools](#call-tools). |
30
30
  | `text(value)` | Add a text item to the output. Strings are added as is, other values as JSON. |
31
- | `image(value)` | Add an image to the output: a base64 `data:` URL, an `{ image_url }` object, or an image block `{ type: "image", data, mimeType }` such as those returned by MCP tools and `models.generateImages()`. Remote URLs are not supported. PNG, JPEG, GIF, and WebP are accepted. |
31
+ | `image(value)` | Add an image to the output: a base64 `data:` URL, an `{ image_url }` object, or an image block `{ type: "image", data, mimeType }` such as those returned by MCP tools and `models.generateImages()`. Remote URLs are not supported. PNG, JPEG, GIF, and WebP are accepted. Each image is also saved to a temp file, and the result names the path before the image. |
32
32
  | `console.log(...)` | Like `text()`; `info`, `warn`, `error`, and `debug` do the same. |
33
33
  | `return value` | A top-level `return` adds the value like `text()`. |
34
34
  | `exit()` | End the script successfully. |
@@ -59,7 +59,7 @@ While `codemode` is active, `codemode.mode` in [settings](/settings#tools) decid
59
59
 
60
60
  `store(key, value)` keeps a JSON value under a string key for later `codemode` calls; storing `undefined` deletes the key. `load(key)` returns the value, or `undefined`. Writes are kept only when the script succeeds: each successful script that stores values appends a `codemode-store` custom entry to the session, so resumed sessions keep the values and each branch sees only the values written on its path.
61
61
 
62
- The store is for small state such as IDs, cursors, or summaries. One value may have at most 262144 characters of JSON and all values together at most 1048576. Do not store image data; show images with `image()` or write them to a file with a tool.
62
+ The store is for small state such as IDs, cursors, or summaries. One value may have at most 262144 characters of JSON and all values together at most 1048576. Do not store image data; show images with `image()`, which also saves them to a temp file.
63
63
 
64
64
  ## Models
65
65
 
@@ -190,7 +190,7 @@ type TextBlock = { type: "text"; text: string };
190
190
  type ImageBlock = { type: "image"; data: string; mimeType: string };
191
191
  ```
192
192
 
193
- Show generated images with `image(block)`. Do not print `data` with `text()`, `console`, or `return`: it is large and the model cannot read it as text. A script that generates images without showing any gets a note saying so. Generated images are not saved to disk; to keep one, write it to a file with a tool.
193
+ Show generated images with `image(block)`. Do not print `data` with `text()`, `console`, or `return`: it is large and the model cannot read it as text. A script that generates images without showing any gets a note saying so. `image()` also saves each image to a private temp file and puts its path in the result, so a later turn can copy or move the file.
194
194
 
195
195
  ```js
196
196
  // @options: {"timeout_ms": 300000}
@@ -947,7 +947,7 @@ pi.registerProvider("corporate-ai", {
947
947
  return { refresh: code, access: code, expires: Date.now() + 3600000 };
948
948
  },
949
949
  async refreshToken(credentials, signal) {
950
- // Forward signal to the refresh request.
950
+ // Forward the rotation timeout signal, not the caller's cancellation signal.
951
951
  signal.throwIfAborted();
952
952
  return credentials;
953
953
  },
@@ -977,6 +977,8 @@ pi.registerProvider("local-server", {
977
977
  });
978
978
  ```
979
979
 
980
+ OAuth `refreshToken` receives a 60-second rotation timeout signal. Forward it to your network request. Cancelling a request or model refresh stops that caller's wait, but an already started token rotation continues so Atomic can persist the updated credentials. Return the rotated credentials promptly and do not discard them because the initiating caller cancelled.
981
+
980
982
  **Config options:**
981
983
  - `name` - Display name for the provider in UI such as `/login`.
982
984
  - `baseUrl` - API endpoint URL. Required when defining models.
@@ -6,6 +6,8 @@ Extensions are TypeScript modules that extend Atomic's behavior. They can subscr
6
6
 
7
7
  > **Placement for /reload:** Put extensions in `~/.atomic/agent/extensions/` (global) or `.atomic/extensions/` (project-local) for auto-discovery; legacy `.pi` paths remain supported. Use `atomic -e ./path.ts` only for quick tests. Extensions in auto-discovered locations can be hot-reloaded with `/reload`.
8
8
 
9
+ If `/reload` reports `Reload retiring cleanup failed`, its error includes the extension cleanup cause. The replacement extensions and updated settings remain active, and running workflows and joined Intercom groups stay available. Fix the reported extension cleanup error before reloading again.
10
+
9
11
  **Key capabilities:**
10
12
  - **Custom tools** - Register tools the LLM can call via `pi.registerTool()`
11
13
  - **Event interception** - Block or modify tool calls, inject context, observe/cancel deletion-only compaction, and customize branch summaries
package/docs/sdk.md CHANGED
@@ -65,6 +65,8 @@ const { session } = await createAgentSession({
65
65
 
66
66
  `ModelRuntime.create()` accepts custom `authPath`, `modelsPath`, credential storage, and runtime auth overrides, plus the model-catalog options `allowModelNetwork`, `modelRefreshTimeoutMs`, `modelsStorePath`, and `modelsStore` (see [Model catalog persistence and refresh](/sdk/reference#model-catalog-persistence-and-refresh)). `ModelRegistry` and `AuthStorage` remain available as Atomic's synchronous compatibility facades. Use `readStoredCredential(provider, authPath?)` for a lightweight read of one stored provider credential.
67
67
 
68
+ Use `await resolveRestoredModelReference(provider, modelId, modelRuntime)` to resolve a saved model without selecting a settings default. It returns the authenticated exact model, reconstructs eligible custom or dynamic IDs, or returns `undefined` when restoration is unavailable. Import it from `@bastani/atomic` and check the result before creating a session when restoration must not fall back to another model.
69
+
68
70
  Extensions supplied directly to SDK sessions can use the exported `InlineExtension` type. Extension APIs and event types include native `registerProvider(Provider)`, `registerEntryRenderer`, `entry_appended`, `before_provider_headers`, and `agent_settled`.
69
71
 
70
72
  The package root also exports `buildContextEntries`, `sessionEntryToContextMessages`, and `CompactionEntry` for converting durable session branches into model context. The equivalent active-session operation is `sessionManager.buildContextEntries()`.
package/docs/settings.md CHANGED
@@ -135,6 +135,8 @@ If `retry.enabled` is `false`, Atomic skips same-model retries and moves directl
135
135
 
136
136
  The fallback model and its thinking level remain active for later turns in the same main-chat session. Choose another model explicitly with `/model` or model cycle to change them.
137
137
 
138
+ Workflow stages that set their own `model` or `fallbackModels` never use this list; they advance only the chain they declare. See [`fallbackModels` / `fallbackThinkingLevels`](/workflows/api-reference#fallbackmodels-/-fallbackthinkinglevels).
139
+
138
140
  A failure that another request to the same model cannot repair — a rejected credential, an unavailable model, a request that model cannot serve — takes that model out of the chain for the rest of the turn at **every** reasoning level, so a candidate that differs only by its `:low`/`:high` suffix is skipped rather than spent. Transient rate-limit and transport failures keep those reasoning variants, because retrying them can succeed.
139
141
 
140
142
  Context overflow keeps its normal recovery order: compaction runs first, and a compactable overflow costs no fallback candidate. Only once compaction is disabled, fails, or reports the overflow unresolved does Atomic advance to the next configured candidate, which is how a larger-context model gets a chance at the turn.
package/docs/subagents.md CHANGED
@@ -74,6 +74,10 @@ Runtime-created session contexts bind single launches to their actual session or
74
74
  - `wait: {kind: "background"}` uses reason `explicit`.
75
75
  - `wait: {kind: "foreground", budgetMs: 30000}` opts into foreground-first observation. The omitted foreground budget is 30000 ms.
76
76
 
77
+ When you issue several single-agent calls in one turn, each keeps its own `wait` policy and returns only its own task result. Background completions appear as visible notices and notify the parent agent, including in workflow-stage chats receiving other messages.
78
+
79
+ These calls share the `concurrency` limit, or the configured subagent parallel limit when omitted, even when their wait policies differ. A background receipt or an expired foreground observation does not free a running child's slot; queued children start when execution capacity becomes available.
80
+
77
81
  Use `subagent({action: "wait", id: taskId})` to observe an existing task in the same owner without restarting it. It uses the owner's observation budget unless explicitly overridden.
78
82
 
79
83
  When a task has settled, the launch result, `action: "wait"`, and `action: "status"` show its output after the task record: up to 16 KB of text, a `Full output:` path to a private copy of the complete result, and a `Requested output:` line naming the `output` file you asked for (background runs included). The private copies live in a temporary directory readable only by you and are removed when Atomic exits. With `outputMode: "file-only"` the text is only the saved-file reference, and the private copy holds the file's contents. A child that stops to ask a question through `contact_supervisor` settles with the question and a ready-to-run follow-up call in this output.
@@ -558,7 +558,7 @@ readonly fallbackModels?: readonly string[];
558
558
  readonly fallbackThinkingLevels?: readonly string[];
559
559
  ```
560
560
 
561
- `fallbackModels` tries the primary, each fallback in order, then the current Atomic-selected model when available. The chain advances for:
561
+ `fallbackModels` tries the primary and each declared fallback in order. If all fail, the stage fails; the current Atomic-selected model is not appended implicitly. To use it as a final fallback, include it explicitly. The chain advances for:
562
562
 
563
563
  - Rate limits and quota or usage-limit exhaustion, including `The usage limit has been reached`, `usage_limit_reached`, and `insufficient_quota`.
564
564
  - Auth/provider outages, unavailable models, network timeouts, generic transport errors such as `Connection error.` or `fetch failed`, and 5xx responses.
@@ -567,9 +567,13 @@ Before advancing, Atomic retries a thrown failure on the same candidate when ano
567
567
 
568
568
  Rejected credentials, unavailable models, and incompatible requests advance immediately, as in main chat. Retrying the same candidate cannot repair these failures.
569
569
 
570
+ A stage that sets `model` or `fallbackModels` uses only the chain it declares. The `fallbackModels` list in `settings.json` and the chain of the session that launched the workflow never apply to it, so a provider failure cannot move the stage to a model or reasoning level outside the chain you declared. A stage that sets neither runs on the session's current model and keeps that session's fallback behavior.
571
+
572
+ Explicit stage models can use numbered account providers such as `openai-1/gpt-5-mini:low` with credentials saved under `openai-1` in `auth.json`. They use the source provider's catalog and endpoint, but the account's own credentials; no alias entry in `models.json` or provider-registration extension is needed. The source provider and requested model must exist. `modelRouting.allowedProviders`, `modelRouting.excludedProviders`, and `routerModel` apply to `model: "auto"`, not to these pinned primary or fallback models.
573
+
570
574
  A same-candidate retry resumes the existing turn when the transcript ends in a message the agent can continue from. Otherwise, it re-sends the stage prompt. In either case, Atomic removes the failed provider error from the live transcript and delivers the prompt exactly once.
571
575
 
572
- Request/context incompatibility also advances it, including HTTP 400/413/422 bad, unprocessable, or payload-too-large requests; unsupported tools or parameters; context-length or context-window overflow; and `too large`, `invalid_request`, or `bad_request` errors. This lets the chain reach the current selected user model when no configured candidate can serve the request.
576
+ Request/context incompatibility also advances it, including HTTP 400/413/422 bad, unprocessable, or payload-too-large requests; unsupported tools or parameters; context-length or context-window overflow; and `too large`, `invalid_request`, or `bad_request` errors.
573
577
 
574
578
  If extension initialization fails and its session cannot be cleaned up, the stage stops without trying another model. Later prompts or attachment attempts on that stage also fail. Inspect both the initialization and cleanup errors and resolve the extension failure before starting a new run; changing fallback models does not fix a cleanup failure.
575
579
 
@@ -108,7 +108,7 @@ The workflow tool action surface is:
108
108
  - prompt response: `answer`; run control: `pause`, `quit`, `resume`; free-form stage communication: ordinary Intercom `send`/live `ask` to `workflow:<rootRunId>/<segment>[/<segment>...]` path targets, including `*` and `**` globs
109
109
  - rediscovery: `reload`
110
110
 
111
- Every registered `workflow` tool call has one hard two-minute wall-clock deadline at the shared public tool boundary. The deadline covers request handling through the returned result; for background `run` and `resume`, it therefore covers startup/resume admission and acknowledgement only, not the workflow execution that continues after acknowledgement. A deadline returns one structured result:
111
+ Every registered `workflow` tool call has one hard 150-second wall-clock deadline at the shared public tool boundary, leaving startup and acknowledgement headroom beyond the two-minute database admission budget. The deadline covers request handling through the returned result; for background `run` and `resume`, it therefore covers startup/resume admission and acknowledgement only, not the workflow execution that continues after acknowledgement. A deadline returns one structured result:
112
112
 
113
113
  ```json
114
114
  {
@@ -116,8 +116,8 @@ Every registered `workflow` tool call has one hard two-minute wall-clock deadlin
116
116
  "runId": "339e05a4-2289-408e-9076-d1a348f582ae",
117
117
  "status": "failed",
118
118
  "code": "WORKFLOW_TIMEOUT",
119
- "timeoutMs": 120000,
120
- "error": "Workflow run request timed out after 120000ms. The outcome is unknown. Inspect workflow status before retrying."
119
+ "timeoutMs": 150000,
120
+ "error": "Workflow run request timed out after 150000ms. The outcome is unknown. Inspect workflow status before retrying."
121
121
  }
122
122
  ```
123
123
 
@@ -127,7 +127,7 @@ Explicit user interruption is different from the request deadline. Before startu
127
127
 
128
128
  Cancellation does not undo mutations that already happened. If registration metadata may already have reached PostgreSQL, Atomic makes a separate bounded attempt to persist cancellation. If that attempt fails, a warning says that cancellation is local and database state is unknown. Inspect status and external effects before retrying an interrupted mutation. Request timeout retains its unknown-outcome behavior and does not cancel an accepted detached launch.
129
129
 
130
- Run-level `quit` is different from interrupting the startup request: it preserves a paused run rather than cancelling its durable record. During database admission, `quit` acknowledges the local stop immediately, without waiting for registration. Registration continues under its existing 10-second deadline, and the database pause is saved after registration succeeds. The acknowledgement is not confirmation that the database saved the pause. If settlement fails, inspect `/workflow status <run-id>` for the original error; the local run stays paused and any saved durable progress remains resumable. Without usable durable progress, the run is nonresumable. Restore database availability and inspect status before retrying or starting a new run.
130
+ Run-level `quit` is different from interrupting the startup request: it preserves a paused run rather than cancelling its durable record. During database admission, `quit` acknowledges the local stop immediately, without waiting for registration. Registration continues under its two-minute deadline, and the database pause is saved after registration succeeds. The acknowledgement is not confirmation that the database saved the pause. If settlement fails, inspect `/workflow status <run-id>` for the original error; the local run stays paused and any saved durable progress remains resumable. Without usable durable progress, the run is nonresumable. Restore database availability and inspect status before retrying or starting a new run.
131
131
 
132
132
  From interactive chat, named workflow launches run in the background so the parent chat stays available. Run `/workflow connect <run>` to see agents working and chat with and steer each stage. Inspection, prompt-response, and control calls (`status`, `stages`, `stage`, `transcript`, `answer`, `pause`, `resume`, `quit`) remain available while work runs.
133
133
 
@@ -462,25 +462,25 @@ Atomic workflows use **DBOS/Postgres as their sole persistent workflow backend**
462
462
 
463
463
  SDK callers can choose the backend and database for each `run()` call, and require durable state so a run fails fast instead of using the in-memory fallback; see [Choosing the durable backend](/workflows/api-reference#choosing-the-durable-backend).
464
464
 
465
- Root database registration has a 10-second deadline. First-time database provisioning and DBOS initialization are outside that deadline and can take longer. If registration fails or is cancelled, that attempt cannot start workflow code later when PostgreSQL returns. For an outage, restore the database before retrying; do not delete its data to bypass the failure. Authentication and schema errors keep their original diagnostics so you can correct the reported problem. A failed admission can remain a local same-ID retry target, but it is not confirmation that the run was saved for cross-session resume. A previously initialized durable backend does not fall back to in-memory execution after losing its connection.
465
+ Root database registration has a two-minute deadline. First-time database provisioning and DBOS initialization are outside that deadline and can take longer. If registration fails or is cancelled, that attempt cannot start workflow code later when PostgreSQL returns. For an outage, restore the database before retrying; do not delete its data to bypass the failure. Authentication and schema errors keep their original diagnostics so you can correct the reported problem. A failed admission can remain a local same-ID retry target, but it is not confirmation that the run was saved for cross-session resume. A previously initialized durable backend does not fall back to in-memory execution after losing its connection.
466
466
 
467
- Pausing during startup acknowledges the local pause immediately and retains the live executor for resume, without waiting for database admission. Workflow code stays held until explicit resume. Registration continues under its existing 10-second deadline; inspect `/workflow status <run-id>` for a later persistence error. Do not start a replacement run or delete database records to bypass the error.
467
+ Pausing during startup acknowledges the local pause immediately and retains the live executor for resume, without waiting for database admission. Workflow code stays held until explicit resume. Registration continues under its two-minute deadline; inspect `/workflow status <run-id>` for a later persistence error. Do not start a replacement run or delete database records to bypass the error.
468
468
 
469
469
  For a PostgreSQL `permission denied` admission error, check the configured database user's grants on the named schema or table, not the model-provider credentials. Authentication failures require correcting the database credentials. When Atomic can verify that rejected registration saved no durable records or identity, it removes the local startup entry. If that verification fails, cleanup reports an error without deleting database records; retain the full run ID and correct the database problem before retrying.
470
470
 
471
- If the result says `startup cleanup skipped: database admission unavailable`, Atomic has kept the failed run in the current session and has not attempted to delete its PostgreSQL identity. This also applies when PostgreSQL stops answering rather than refusing connections: cleanup does not extend the admission failure to the two-minute request timeout. Keep the full run ID and restore PostgreSQL before retrying. Current-session `status` can show the local failure, but it does not prove what was saved in PostgreSQL or that cross-session resume is available.
471
+ If the result says `startup cleanup skipped: database admission unavailable`, Atomic has kept the failed run in the current session and has not attempted to delete its PostgreSQL identity. This also applies when PostgreSQL stops answering rather than refusing connections: cleanup does not extend the admission failure to the 150-second request timeout. Keep the full run ID and restore PostgreSQL before retrying. Current-session `status` can show the local failure, but it does not prove what was saved in PostgreSQL or that cross-session resume is available.
472
472
 
473
473
  If a resume continuation reports `cleanup skipped: database admission unavailable`, the source run stays resumable and no database cleanup is attempted for the failed continuation. Restore PostgreSQL before retrying resume on the source run ID.
474
474
 
475
475
  While root registration is pending, status shows `pending` with phase `starting`, not healthy execution. Status listing and exact-run detail include `phase`, `phaseAgeMs`, `dependencyError`, and `lastProgressAt`. Last progress records admission or a tracked node starting/settling, not polling or a heartbeat. Database failures report `blocked_dependency`; a paused run still reports `paused`. Starting and dependency-blocked runs do not emit "still running" heartbeats.
476
476
 
477
- For an admitted live executor with no active stage or tool, pause installs a local barrier immediately and acknowledges within 500ms of starting database settlement. The acknowledgement and status distinguish `observed` from `durable` control persistence. If confirmation is still pending at acknowledgement, settlement continues in the background for up to 10 seconds total. Status becomes `durable` on success; only a settlement failure or deadline reports `blocked_dependency`. `observed` is not proof of a saved pause and does not guarantee cross-process resume. During registration, pause acknowledges immediately while database settlement continues in the background. After registration, resume allows up to 10 seconds for database confirmation before releasing the barrier, and a resume requested while the pause's confirmation is still pending waits for it within that same 10 seconds instead of cancelling it. A failed resume leaves the executor paused; restore database availability and retry the same run. These limits do not cover stage cancellation or arbitrary external I/O.
477
+ For an admitted live executor with no active stage or tool, pause installs a local barrier immediately and acknowledges within 500ms of starting database settlement. The acknowledgement and status distinguish `observed` from `durable` control persistence. If confirmation is still pending at acknowledgement, settlement continues in the background for up to two minutes total. Status becomes `durable` on success; only a settlement failure or deadline reports `blocked_dependency`. `observed` is not proof of a saved pause and does not guarantee cross-process resume. During registration, pause acknowledges immediately while database settlement continues in the background. After registration, resume allows up to two minutes for database confirmation before releasing the barrier, and a resume requested while the pause's confirmation is still pending waits for it within that same two minutes instead of cancelling it. A failed resume leaves the executor paused; restore database availability and retry the same run. These limits do not cover stage cancellation or arbitrary external I/O.
478
478
 
479
479
  If registration times out or reports an unavailable database while the run is paused, restore the existing database without resetting data, then resume that same run in the same Atomic process. Resume retries registration with the original identity and releases the existing executor once; repeated concurrent resume requests share the retry and do not start another executor. If the run was not paused, admission failure ends the attempt. A non-retryable admission rejection, such as a permission error, is reported on resume instead of retrying the live executor. Retain the full run ID and inspect it before retrying. Completed checkpoints remain reusable, but an external side effect whose checkpoint was never confirmed can still repeat after a crash; make such operations idempotent.
480
480
 
481
481
  Cancellation or the deadline can leave a stored run identity without valid admission metadata, even when PostgreSQL is healthy but slow. After an unavailable-database failure, keep the original Atomic process open, restore PostgreSQL, and explicitly resume the same full run ID. Atomic can reconcile its retained pre-execution identity with the database before admission, without running workflow code during reconciliation. Missing records are repaired only for that known failed admission; conflicting, deleted, or malformed records are refused. A fresh process without valid admission metadata still cannot safely reconstruct the invocation. Keep the ID and report that failure rather than deleting or resetting records. Cancelled and explicitly nonresumable runs are not revived.
482
482
 
483
- Awaited checkpoint writes also have a 10-second database deadline. If a checkpoint fails because PostgreSQL is unavailable, the run keeps its local failure without waiting on another database write to finalize it. Restore PostgreSQL and explicitly resume the same ID; Atomic reads saved receipts before executing unfinished work. A committed checkpoint is reused even if its acknowledgement was lost. If no receipt was saved, the external operation's outcome remains unknown and its callback may run again. Reconcile external outcomes or use idempotency keys before resuming operations that must not repeat. Inspection alone never repairs records or starts execution.
483
+ Awaited checkpoint writes also have a two-minute database deadline, including time waiting behind earlier writes for the same run. If a checkpoint fails because PostgreSQL is unavailable, the run keeps its local failure without waiting on another database write to finalize it. Restore PostgreSQL and explicitly resume the same ID; Atomic reads saved receipts before executing unfinished work. A committed checkpoint is reused even if its acknowledgement was lost. If no receipt was saved, the external operation's outcome remains unknown and its callback may run again. Reconcile external outcomes or use idempotency keys before resuming operations that must not repeat. Inspection alone never repairs records or starts execution.
484
484
 
485
485
  If recovery reports `Workflow definition not found`, restore the matching workflow definition and run `/workflow reload`, then retry resume with the same full run ID. A failed resume preparation does not discard the recovery target or saved receipts. Do not start a new run to bypass the missing definition.
486
486
 
@@ -530,7 +530,7 @@ cannot be verified, automatic restart is refused; preserve the data,
530
530
  of deleting files or starting another server. Identity mismatches and database
531
531
  corruption require investigation, not a package reinstall.
532
532
  New admission keeps its
533
- 10-second deadline even if shared recovery takes longer. Restoring the
533
+ two-minute deadline even if shared recovery takes longer. Restoring the
534
534
  connection does not automatically resume a paused run or prove that an
535
535
  interrupted write or external side effect committed. Inspect the original run
536
536
  before retrying. External database URLs receive no managed recovery; restore