@bastani/atomic 0.9.28-alpha.1 → 0.9.28-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +33 -0
- package/dist/builtin/intercom/package.json +1 -1
- package/dist/builtin/mcp/package.json +1 -1
- package/dist/builtin/subagents/package.json +1 -1
- package/dist/builtin/web-access/package.json +1 -1
- package/dist/builtin/workflows/CHANGELOG.md +23 -0
- package/dist/builtin/workflows/builtin/{chunk-wz8v67bn.js → chunk-aqv8ny38.js} +257 -259
- package/dist/builtin/workflows/builtin/{chunk-f61w0hpm.js → chunk-br4ac9a3.js} +1 -1
- package/dist/builtin/workflows/builtin/{chunk-tecnpe8j.js → chunk-p3xmajmj.js} +438 -39
- package/dist/builtin/workflows/builtin/chunk-p6jagvyf.js +8 -0
- package/dist/builtin/workflows/builtin/goal.js +2 -2
- package/dist/builtin/workflows/builtin/index.js +4 -4
- package/dist/builtin/workflows/builtin/ralph.js +2 -2
- package/dist/builtin/workflows/package.json +1 -1
- package/dist/builtin/workflows/src/authoring.d.ts +14 -0
- package/dist/builtin/workflows/src/extension/index.bundle.mjs +107577 -106722
- package/dist/builtin/workflows/src/index.js +42284 -41141
- package/dist/builtin/workflows/src/shared/authoring-contract-stage.d.ts +16 -11
- package/dist/builtin/workflows/src/shared/authoring-contract-ui.d.ts +16 -1
- package/dist/cli/credential-print.d.ts +1 -1
- package/dist/cli/credential-print.d.ts.map +1 -1
- package/dist/cli/credential-print.js +2 -56
- package/dist/cli/credential-print.js.map +1 -1
- package/dist/core/agent-session-accessors.d.ts.map +1 -1
- package/dist/core/agent-session-accessors.js +6 -1
- package/dist/core/agent-session-accessors.js.map +1 -1
- package/dist/core/agent-session-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-compaction.js +20 -3
- package/dist/core/agent-session-compaction.js.map +1 -1
- package/dist/core/agent-session-events.d.ts.map +1 -1
- package/dist/core/agent-session-events.js +2 -1
- package/dist/core/agent-session-events.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts +6 -0
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +87 -7
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +2 -1
- package/dist/core/agent-session-methods.d.ts.map +1 -1
- package/dist/core/agent-session-methods.js.map +1 -1
- package/dist/core/agent-session-prompt.d.ts.map +1 -1
- package/dist/core/agent-session-prompt.js +14 -1
- package/dist/core/agent-session-prompt.js.map +1 -1
- package/dist/core/agent-session-tool-registry.d.ts.map +1 -1
- package/dist/core/agent-session-tool-registry.js +1 -0
- package/dist/core/agent-session-tool-registry.js.map +1 -1
- package/dist/core/agent-session-types.d.ts +1 -0
- package/dist/core/agent-session-types.d.ts.map +1 -1
- package/dist/core/agent-session-types.js.map +1 -1
- package/dist/core/compaction/classifier-compaction.d.ts +13 -0
- package/dist/core/compaction/classifier-compaction.d.ts.map +1 -0
- package/dist/core/compaction/classifier-compaction.js +110 -0
- package/dist/core/compaction/classifier-compaction.js.map +1 -0
- package/dist/core/compaction/compaction-boundary.d.ts.map +1 -1
- package/dist/core/compaction/compaction-boundary.js +2 -6
- package/dist/core/compaction/compaction-boundary.js.map +1 -1
- package/dist/core/compaction/compaction-runner.d.ts +16 -1
- package/dist/core/compaction/compaction-runner.d.ts.map +1 -1
- package/dist/core/compaction/compaction-runner.js +97 -12
- package/dist/core/compaction/compaction-runner.js.map +1 -1
- package/dist/core/compaction/compaction-types.d.ts +18 -1
- package/dist/core/compaction/compaction-types.d.ts.map +1 -1
- package/dist/core/compaction/compaction-types.js +1 -1
- package/dist/core/compaction/compaction-types.js.map +1 -1
- package/dist/core/compaction/fallback-planner.d.ts +1 -0
- package/dist/core/compaction/fallback-planner.d.ts.map +1 -1
- package/dist/core/compaction/fallback-planner.js +2 -0
- package/dist/core/compaction/fallback-planner.js.map +1 -1
- package/dist/core/compaction/index.d.ts +3 -0
- package/dist/core/compaction/index.d.ts.map +1 -1
- package/dist/core/compaction/index.js +3 -0
- package/dist/core/compaction/index.js.map +1 -1
- package/dist/core/compaction/model-resolver.d.ts +16 -0
- package/dist/core/compaction/model-resolver.d.ts.map +1 -0
- package/dist/core/compaction/model-resolver.js +18 -0
- package/dist/core/compaction/model-resolver.js.map +1 -0
- package/dist/core/compaction/morph-compaction.d.ts +14 -0
- package/dist/core/compaction/morph-compaction.d.ts.map +1 -0
- package/dist/core/compaction/morph-compaction.js +99 -0
- package/dist/core/compaction/morph-compaction.js.map +1 -0
- package/dist/core/compaction/pi-summary-fallback.d.ts +34 -0
- package/dist/core/compaction/pi-summary-fallback.d.ts.map +1 -0
- package/dist/core/compaction/pi-summary-fallback.js +357 -0
- package/dist/core/compaction/pi-summary-fallback.js.map +1 -0
- package/dist/core/compaction/planner-outcome.d.ts +10 -6
- package/dist/core/compaction/planner-outcome.d.ts.map +1 -1
- package/dist/core/compaction/planner-outcome.js +11 -4
- package/dist/core/compaction/planner-outcome.js.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts +3 -1
- package/dist/core/compaction/range-planner-diagnostics.d.ts.map +1 -1
- package/dist/core/compaction/range-planner-diagnostics.js +11 -0
- package/dist/core/compaction/range-planner-diagnostics.js.map +1 -1
- package/dist/core/compaction/range-planner.d.ts +3 -3
- package/dist/core/compaction/range-planner.d.ts.map +1 -1
- package/dist/core/compaction/range-planner.js +59 -28
- package/dist/core/compaction/range-planner.js.map +1 -1
- package/dist/core/compaction/region-trimming.d.ts.map +1 -1
- package/dist/core/compaction/region-trimming.js +7 -0
- package/dist/core/compaction/region-trimming.js.map +1 -1
- package/dist/core/compaction/structured-compaction-input.d.ts +19 -0
- package/dist/core/compaction/structured-compaction-input.d.ts.map +1 -0
- package/dist/core/compaction/structured-compaction-input.js +70 -0
- package/dist/core/compaction/structured-compaction-input.js.map +1 -0
- package/dist/core/compaction/transcript-serialization.d.ts +1 -0
- package/dist/core/compaction/transcript-serialization.d.ts.map +1 -1
- package/dist/core/compaction/transcript-serialization.js +26 -0
- package/dist/core/compaction/transcript-serialization.js.map +1 -1
- package/dist/core/extensions/api-types.d.ts +2 -2
- package/dist/core/extensions/api-types.d.ts.map +1 -1
- package/dist/core/extensions/api-types.js.map +1 -1
- package/dist/core/extensions/context-types.d.ts +1 -0
- package/dist/core/extensions/context-types.d.ts.map +1 -1
- package/dist/core/extensions/context-types.js.map +1 -1
- package/dist/core/extensions/loader-api.js.map +1 -1
- package/dist/core/extensions/runner-context.d.ts +10 -4
- package/dist/core/extensions/runner-context.d.ts.map +1 -1
- package/dist/core/extensions/runner-context.js +47 -3
- package/dist/core/extensions/runner-context.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +10 -3
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +31 -7
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/workflow-events.d.ts +49 -0
- package/dist/core/extensions/workflow-events.d.ts.map +1 -1
- package/dist/core/extensions/workflow-events.js.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.d.ts +16 -4
- package/dist/core/extensions/workflow-run-control-hub.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control-hub.js +72 -1
- package/dist/core/extensions/workflow-run-control-hub.js.map +1 -1
- package/dist/core/extensions/workflow-run-control.d.ts +11 -3
- package/dist/core/extensions/workflow-run-control.d.ts.map +1 -1
- package/dist/core/extensions/workflow-run-control.js.map +1 -1
- package/dist/core/messages.d.ts +1 -0
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +5 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +3 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/session-manager-history.d.ts.map +1 -1
- package/dist/core/session-manager-history.js +4 -2
- package/dist/core/session-manager-history.js.map +1 -1
- package/dist/core/settings-manager-basic-accessors.d.ts +2 -0
- package/dist/core/settings-manager-basic-accessors.d.ts.map +1 -1
- package/dist/core/settings-manager-basic-accessors.js +29 -0
- package/dist/core/settings-manager-basic-accessors.js.map +1 -1
- package/dist/core/settings-types.d.ts +1 -0
- package/dist/core/settings-types.d.ts.map +1 -1
- package/dist/core/settings-types.js.map +1 -1
- package/dist/core/transcript.d.ts +58 -0
- package/dist/core/transcript.d.ts.map +1 -0
- package/dist/core/transcript.js +185 -0
- package/dist/core/transcript.js.map +1 -0
- package/dist/extensions/herdr/index.d.ts.map +1 -1
- package/dist/extensions/herdr/index.js +15 -10
- package/dist/extensions/herdr/index.js.map +1 -1
- package/dist/extensions/herdr/pane-owner.d.ts +6 -2
- package/dist/extensions/herdr/pane-owner.d.ts.map +1 -1
- package/dist/extensions/herdr/pane-owner.js +19 -4
- package/dist/extensions/herdr/pane-owner.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts +2 -0
- package/dist/modes/interactive/components/compaction-boundary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-boundary-message.js +15 -3
- package/dist/modes/interactive/components/compaction-boundary-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-items.js +43 -0
- package/dist/modes/interactive/components/settings-selector-items.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.d.ts +6 -0
- package/dist/modes/interactive/components/settings-selector-types.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector-types.js.map +1 -1
- package/dist/modes/interactive/interactive-prompt-turn.js +6 -4
- package/dist/modes/interactive/interactive-prompt-turn.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +13 -1
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-selectors.js +8 -0
- package/dist/modes/interactive/interactive-selectors.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +2 -0
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +1 -1
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/utils/credential-redaction.d.ts +2 -0
- package/dist/utils/credential-redaction.d.ts.map +1 -0
- package/dist/utils/credential-redaction.js +20 -0
- package/dist/utils/credential-redaction.js.map +1 -0
- package/docs/compaction/reference.md +10 -4
- package/docs/compaction.md +40 -8
- package/docs/docs.json +1 -0
- package/docs/extensions/api-reference.md +4 -0
- package/docs/extensions/events.md +2 -2
- package/docs/providers.md +12 -1
- package/docs/sdk/reference.md +16 -1
- package/docs/sdk/web-server.md +325 -0
- package/docs/sdk.md +83 -1
- package/docs/security.md +1 -1
- package/docs/workflows/api-reference.md +71 -3
- package/docs/workflows/builtins.md +4 -0
- package/docs/workflows/operations.md +12 -4
- package/npm-shrinkwrap.json +32 -32
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,6BAA6B,EAAE,MAAM,8BAA8B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,uBAAuB,EAAE,MAAM,uBAAuB,CAAC;AAEhE,OAAO,EAAE,sBAAsB,EAAE,MAAM,iDAAiD,CAAC;AACzF,OAAO,EACN,wCAAwC,EACxC,4CAA4C,EAC5C,sCAAsC,EACtC,6BAA6B,GAC7B,MAAM,8CAA8C,CAAC;AACtD,OAAO,EACN,cAAc,EACd,0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G,OAAO,0BAA0B,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC;AACpF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB,CAAC;AACxD,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,uBAAuB,GAAG;IACvD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC;AACzF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,KAAK,KAAK,CAAC;AAC1F,CAAC,CAAC","sourcesContent":["import { ScrollView, VStack } from \"@earendil-works/pi-tui\";\nimport { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { isOfflineModeEnabled } from \"../../core/package-manager-env.ts\";\nimport { createChildProcessEnvironment } from \"../../utils/child-process.ts\";\nimport { ensurePngTranscoder } from \"../../utils/image-convert.ts\";\nimport { setMarkitDiagnosticSink } from \"../../utils/markit.js\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport { renderDiagnosticStatus } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport {\n\tonInteractiveEngineRemoteCommandsChanged,\n\tonInteractiveEngineResourceExtensionsChanged,\n\tonInteractiveEngineSessionStatsChanged,\n\twaitForInteractiveEngineBound,\n} from \"../interactive-engine/extension-ui-bridge.ts\";\nimport {\n\tatomicWordmark,\n\trenderAtomicAssemblyBanner,\n\trenderStartupManifesto,\n\tsupportsAtomicBanner,\n} from \"./components/atomic-banner.ts\";\nimport { StartupIdentityComponent } from \"./components/startup-identity.ts\";\nimport { ThemedText } from \"./components/themed-text.js\";\nimport { bindInitialEagerSession } from \"./interactive-initial-session-binding.ts\";\nimport { InteractiveModeBase, seedStartupInput } from \"./interactive-mode-base.ts\";\nimport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\ttype Container,\n\tcheckForNewPiVersion,\n\tcomposeStartupIdentity,\n\tDefaultPackageManager,\n\tDynamicBorder,\n\tENV_OFFLINE,\n\tensureTool,\n\tgetAgentDir,\n\tgetChangelogPath,\n\tgetCwdRelativePath,\n\tgetEntriesForVersion,\n\tgetEnvValue,\n\tgetMarkdownTheme,\n\tgetNewEntries,\n\tgetPiUserAgent,\n\tisInstallTelemetryEnabled,\n\tMarkdown,\n\ttype MarkdownTheme,\n\tnormalizeChangelogLinks,\n\tonThemeChange,\n\tos,\n\tparseChangelog,\n\tpath,\n\trecordTimeSinceReset,\n\tSpacer,\n\tspawn,\n\tText,\n\ttheme,\n\tVERSION,\n\tVERSION_ADOPTION_ENDPOINT,\n\tvisibleWidth,\n} from \"./interactive-mode-deps.ts\";\nimport {\n\trefreshCatalogsAfterTuiStartup,\n\tupdateProviderCountFromSnapshot,\n} from \"./interactive-model-catalog-startup.ts\";\nimport { ONBOARDING_COPY } from \"./interactive-onboarding.ts\";\nimport { restoreTerminalTitleAfterPackageCheck } from \"./interactive-terminal-title.ts\";\n\nexport const shouldRefreshCatalogsOnStartup = (): boolean => !isOfflineModeEnabled();\n\nfunction prepareStartupNotices(mode: InteractiveModeBase): void {\n\tif (mode.startupNoticesPrepared) return;\n\tmode.startupNoticesPrepared = true;\n\tmode.hadLastChangelogVersionAtStartup = Boolean(mode.settingsManager.getLastChangelogVersion?.());\n\tif (mode.changelogMarkdown === undefined) {\n\t\tmode.changelogMarkdown = mode.getChangelogForDisplay?.();\n\t}\n\tmode.initializeFirstRunOnboardingMarkers?.();\n\tif (!mode.firstRunNoticeVisible) {\n\t\tmode.firstRunNoticeVisible = mode.isFirstRunOnboardingEligible?.() ?? false;\n\t}\n}\n\n/**\n * Show non-fatal model-catalog warnings — today, a derived `-fast` variant suppressed because\n * something already owns that exact model ID.\n *\n * Called unconditionally at startup and again after deferred extension loading, because an extension\n * provider can introduce a collision that did not exist at startup. The last reported text is kept so\n * the second read only speaks when the diagnostic set actually changed.\n */\nInteractiveModeBase.prototype.reportModelCatalogWarning = function (\n\tthis: InteractiveModeBase,\n\ttargetContainer: Container = this.chatContainer,\n): void {\n\tconst warning = this.session.modelRuntime.getWarning?.();\n\tif (!warning || warning === this.reportedModelCatalogWarning) {\n\t\treturn;\n\t}\n\tthis.reportedModelCatalogWarning = warning;\n\tthis.showWarning(warning, targetContainer);\n};\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function (\n\tthis: InteractiveModeBase,\n\ttargetContainer: Container = this.chatContainer,\n): void {\n\tif (this.startupNoticesShown) {\n\t\treturn;\n\t}\n\tprepareStartupNotices(this);\n\tthis.startupNoticesShown = true;\n\n\tconst changelogMarkdown = this.changelogMarkdown;\n\tif (!changelogMarkdown && !this.firstRunNoticeVisible) {\n\t\treturn;\n\t}\n\n\tif (changelogMarkdown) {\n\t\tif (targetContainer.children.length > 0) {\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t}\n\t\ttargetContainer.addChild(new DynamicBorder());\n\t\tif (this.settingsManager.getCollapseChangelog()) {\n\t\t\tconst versionMatch = changelogMarkdown.match(\n\t\t\t\t/##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n\t\t\t);\n\t\t\tconst latestVersion = versionMatch ? versionMatch[1] : this.version;\n\t\t\tconst condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n\t\t\ttargetContainer.addChild(new Text(condensedText, 1, 0));\n\t\t} else {\n\t\t\ttargetContainer.addChild(new ThemedText(() => theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0));\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t\ttargetContainer.addChild(new Markdown(changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t}\n\t\ttargetContainer.addChild(new DynamicBorder());\n\t}\n\n\tif (this.firstRunNoticeVisible) {\n\t\tthis.firstRunOnboardingNoticeComponents = [];\n\t\tif (targetContainer.children.length > 0) {\n\t\t\tthis.firstRunOnboardingNoticeComponents.push(new Spacer(1));\n\t\t}\n\t\tthis.firstRunOnboardingNoticeComponents.push(\n\t\t\tnew DynamicBorder(),\n\t\t\tnew Text(ONBOARDING_COPY, 1, 0),\n\t\t\tnew DynamicBorder(),\n\t\t\tnew Spacer(1),\n\t\t);\n\t\tfor (const component of this.firstRunOnboardingNoticeComponents) {\n\t\t\ttargetContainer.addChild(component);\n\t\t}\n\t\t// Mark completion only after queueing the notice in the chat canvas so\n\t\t// launches that skip rendering retry the first-run notice next time.\n\t\tthis.settingsManager.setOnboardedVersion(this.version);\n\t}\n\n\tthis.ui.requestRender();\n};\n\n/** Bring fd and rg to readiness, reporting progress into the transcript. */\nInteractiveModeBase.prototype.ensureManagedToolsReady = function (this: InteractiveModeBase): Promise<void> {\n\tconst statusGeneration = ++this.managedToolStatusGeneration;\n\tconst reportStatus = (status: ToolStatus): void => {\n\t\tif (this.managedToolStatusGeneration === statusGeneration) this.showManagedToolStatus(status);\n\t};\n\treturn Promise.all([ensureTool(\"fd\", reportStatus), ensureTool(\"rg\", reportStatus)])\n\t\t.then(([fdPath]) => {\n\t\t\tthis.fdPath = fdPath;\n\t\t\tthis.setupAutocompleteProvider();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treportStatus({ type: \"warning\", message: `Tool readiness check failed: ${message}` });\n\t\t});\n};\n\n/** Show a managed-tool status update in the chat, never on the console. */\nInteractiveModeBase.prototype.showManagedToolStatus = function (this: InteractiveModeBase, status: ToolStatus): void {\n\tif (!this.managedToolStatusStarted) {\n\t\tthis.chatContainer.addChild(new Spacer(1));\n\t\tthis.managedToolStatusStarted = true;\n\t}\n\tconst message = status.type === \"warning\" ? `Warning: ${status.message}` : status.message;\n\tconst color = status.type === \"warning\" ? \"warning\" : \"dim\";\n\tthis.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));\n\tthis.lastStatusSpacer = undefined;\n\tthis.lastStatusText = undefined;\n\tthis.ui.requestRender();\n};\n\nexport function attachInteractiveEngineResourceExtensionRefresh(mode: InteractiveModeBase): () => void {\n\treturn onInteractiveEngineResourceExtensionsChanged(mode.runtimeHost, () => {\n\t\tif (mode.resourceDisclosureContainer.children.length === 0) return;\n\t\tmode.showLoadedResources({\n\t\t\tforce: true,\n\t\t\tshowDiagnosticsWhenQuiet: true,\n\t\t\ttargetContainer: mode.resourceDisclosureContainer,\n\t\t});\n\t\tmode.ui.requestRender();\n\t});\n}\n\nInteractiveModeBase.prototype.init = async function (this: InteractiveModeBase): Promise<void> {\n\tif (this.isInitialized) return;\n\n\tthis.registerSignalHandlers();\n\n\t// Keep the transcript in its own viewport and reserve the bottom chrome in a\n\t// fixed dock for the fullscreen renderer. The same components also feed the\n\t// internal main-screen fallback used for guarded terminal paths.\n\tthis.renderWidgets(); // Initialize with default spacer\n\tthis.transcriptScrollView = new ScrollView(this.documentContainer, {\n\t\tfollow: \"end\",\n\t\tprimary: true,\n\t\toverscroll: \"chain\",\n\t\tscrollbar: this.settingsManager.getFullscreenScrollbar(),\n\t\tscrollbarThumbStyle: (text) => theme.bg(\"scrollbarThumb\", text),\n\t});\n\tconst dock = new VStack([\n\t\t{ component: this.pendingMessagesContainer, shrink: 1, minSize: 0 },\n\t\t{ component: this.statusContainer, shrink: 1, minSize: 0 },\n\t\t{ component: this.widgetContainerAbove, shrink: 1, minSize: 0 },\n\t\t{ component: this.usageMeter, shrink: 1, minSize: 1 },\n\t\t{ component: this.editorContainer, shrink: 1, minSize: 3 },\n\t\t{ component: this.footerContainer, shrink: 1, minSize: 1 },\n\t\t// Keep widgetContainerBelow after the footer for #1109's stable dock order.\n\t\t{ component: this.widgetContainerBelow, shrink: 1, minSize: 0 },\n\t]);\n\tthis.fullscreenLayoutRoot = new VStack([\n\t\t{ component: this.transcriptScrollView, basis: 0, grow: 1, shrink: 1, minSize: 1 },\n\t\t{ component: dock, basis: \"auto\", grow: 0, shrink: 1, minSize: 1 },\n\t]);\n\tthis.mountInteractiveTui(this.ui, [\n\t\tthis.documentContainer,\n\t\tthis.pendingMessagesContainer,\n\t\tthis.statusContainer,\n\t\tthis.widgetContainerAbove,\n\t\tthis.usageMeter,\n\t\tthis.editorContainer,\n\t\tthis.footerContainer,\n\t\tthis.widgetContainerBelow,\n\t]);\n\tthis.ui.setFocus(this.editor);\n\n\tthis.setupKeyHandlers();\n\tthis.setupEditorSubmitHandler();\n\t// Rebuild autocomplete whenever the engine child's command catalog arrives or\n\t// changes (initial bind, engine restart, reload, new/resume/fork). Subscribed\n\t// before bind so the first async catalog fetch can never be missed. No-op when\n\t// the host is not isolated.\n\tonInteractiveEngineRemoteCommandsChanged(this.runtimeHost, () => {\n\t\tthis.setupAutocompleteProvider();\n\t});\n\tattachInteractiveEngineResourceExtensionRefresh(this);\n\t// Engine stats can land after the last event of a run; repaint so the idle footer shows them.\n\tonInteractiveEngineSessionStatsChanged(this.runtimeHost, () => {\n\t\tthis.ui.requestRender();\n\t});\n\n\tseedStartupInput(\n\t\tthis.pendingUserInputs,\n\t\tthis.defaultEditor,\n\t\tthis.options.startupInputCapture?.consume(),\n\t\tthis.startupReplayInputs,\n\t\t(text) => {\n\t\t\tthis.startupDraftText = text;\n\t\t},\n\t\t(text) => {\n\t\t\tthis.startupReplayActiveInput = text;\n\t\t},\n\t);\n\n\t// Start and paint the host-owned TUI before waiting for the isolated engine.\n\t// The editor remains local and responsive; session binding and provider work\n\t// still stay behind the engine-bound gate below.\n\tmarkLifecycleTiming(\"tui-start\");\n\tthis.ui.start();\n\tensurePngTranscoder(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.ui.requestRender();\n\t});\n\tthis.disposeMarkitDiagnosticSink = setMarkitDiagnosticSink((message) => renderDiagnosticStatus(message, this));\n\tthis.footerDataProvider.onBranchChange(() => {\n\t\tthis.ui.requestRender();\n\t});\n\n\tawait this.themeController.applyFromSettings();\n\n\t// Add the quiet startup identity unless silenced.\n\tif (this.shouldShowStartupHeader()) {\n\t\tthis.builtInHeader = new StartupIdentityComponent(this.ui, (width, state) =>\n\t\t\tthis.getStartupIdentityText(width, state.gap, state.manifestoPhase),\n\t\t);\n\n\t\tthis.headerContainer.addChild(new Spacer(1));\n\t\tthis.headerContainer.addChild(this.builtInHeader);\n\t\tthis.headerContainer.addChild(new Spacer(1));\n\t} else {\n\t\t// Minimal header when silenced\n\t\tthis.builtInHeader = new Text(\"\", 0, 0);\n\t\tthis.headerContainer.addChild(this.builtInHeader);\n\t}\n\tmarkLifecycleTiming(\"header-mounted\");\n\tthis.ui.requestRender();\n\t// This legacy mark now means the first requested identity frame. The settled\n\t// animation frame remains the external benchmark's startup-complete mark.\n\trecordTimeSinceReset(\"time-to-first-frame\");\n\n\tawait waitForInteractiveEngineBound(this.runtimeHost);\n\tif (this.isShuttingDown) return;\n\tthis.isInitialized = true;\n\t// The isolated engine may have replaced the preliminary model/provider view.\n\tthis.ui.requestRender();\n\n\t// fd/rg readiness runs after first paint so slow downloads never make\n\t// startup appear frozen. Progress reports land in the transcript: a console\n\t// write here lands in the alternate screen and corrupts the frame.\n\tvoid this.ensureManagedToolsReady();\n\n\t// When startup resources are deferred, keep the already-painted editor responsive.\n\t// Extension UI bindings are installed at the deferred reload boundary, not here,\n\t// so no post-paint resource work can block visible typing.\n\tif (this.deferredStartupPending) {\n\t\tthis.applyRuntimeSettings();\n\t\tthis.subscribeToAgent();\n\t\tthis.updateEditorBorderColor();\n\t\tthis.updateTerminalTitle();\n\t} else {\n\t\tawait bindInitialEagerSession(this);\n\t}\n\n\tthis.attachStartupNoticesContainer();\n\t// Render initial messages AFTER the initial session binding is in place.\n\tthis.renderInitialMessages();\n\t// Set up theme file watcher\n\tonThemeChange(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.updateEditorBorderColor();\n\t\tthis.ui.requestRender();\n\t});\n\n\tupdateProviderCountFromSnapshot(this);\n};\n\nInteractiveModeBase.prototype.updateTerminalTitle = function (this: InteractiveModeBase): void {\n\tconst cwdBasename = path.basename(this.sessionManager.getCwd());\n\tconst sessionName = this.sessionManager.getSessionName();\n\tif (sessionName) {\n\t\tthis.ui.terminal.setTitle(`${APP_TITLE} - ${sessionName} - ${cwdBasename}`);\n\t} else {\n\t\tthis.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n\t}\n};\n\nInteractiveModeBase.prototype.run = async function (this: InteractiveModeBase): Promise<void> {\n\tawait this.init();\n\tif (this.isShuttingDown) return;\n\n\tif (shouldRefreshCatalogsOnStartup()) void refreshCatalogsAfterTuiStartup(this);\n\n\tsetTimeout(() => {\n\t\tconst startupNoticesContainer = this.startupNoticesContainer;\n\t\tcheckForNewPiVersion(this.version).then((newVersion) => {\n\t\t\tif (newVersion) this.showNewVersionNotification(newVersion, startupNoticesContainer);\n\t\t});\n\t\trestoreTerminalTitleAfterPackageCheck(this.checkForPackageUpdates(), {\n\t\t\tinitialized: () => this.isInitialized,\n\t\t\trestore: () => this.updateTerminalTitle(),\n\t\t}).then((updates) => {\n\t\t\tif (updates.length > 0) this.showPackageUpdateNotification(updates, startupNoticesContainer);\n\t\t});\n\t\tthis.checkTmuxKeyboardSetup().then((warning) => {\n\t\t\tif (warning) this.showWarning(warning, startupNoticesContainer);\n\t\t});\n\t\t// Deferred startup releases chat output immediately after rendering the\n\t\t// disclosure, so wait only while that startup work remains in flight.\n\t\tif (!this.deferredStartupPending && !this.deferredStartupPromise) {\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, startupNoticesContainer);\n\t\t}\n\t}, 500);\n\n\t// Show startup warnings\n\tconst { migratedProviders, startupDiagnostics, initialMessage, initialImages, initialMessages } = this.options;\n\n\tfor (const diagnostic of startupDiagnostics ?? []) {\n\t\tif (diagnostic.type === \"error\") this.showError(diagnostic.message);\n\t\telse if (diagnostic.type === \"warning\") this.showWarning(diagnostic.message);\n\t\telse this.showStatus(diagnostic.message);\n\t}\n\n\tif (migratedProviders && migratedProviders.length > 0) {\n\t\tthis.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`);\n\t}\n\n\tconst modelsJsonError = this.session.modelRuntime.getError();\n\tif (modelsJsonError) {\n\t\tthis.showError(`models.json error: ${modelsJsonError}`);\n\t}\n\n\tconst modelFallbackMessage = this.runtimeHost.modelFallbackMessage;\n\tif (modelFallbackMessage && !this.deferredStartupPending) {\n\t\tthis.showWarning(modelFallbackMessage, this.startupNoticesContainer);\n\t}\n\n\t// CLI-provided startup prompts need extension tools/resources; wait before sending them,\n\t// but do not block the normal no-prompt input loop from becoming ready.\n\tif (this.deferredStartupPending && (initialMessage || (initialMessages && initialMessages.length > 0))) {\n\t\tawait this.ensureDeferredStartupComplete();\n\t}\n\n\t// Process initial messages\n\tif (initialMessage) {\n\t\ttry {\n\t\t\tawait this.session.prompt(initialMessage, { images: initialImages });\n\t\t} catch (error: unknown) {\n\t\t\tconst errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n\t\t\tthis.showError(errorMessage);\n\t\t}\n\t}\n\n\tif (initialMessages) {\n\t\tfor (const message of initialMessages) {\n\t\t\ttry {\n\t\t\t\tawait this.session.prompt(message);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n\t\t\t\tthis.showError(errorMessage);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Main interactive loop\n\twhile (true) {\n\t\tconst userInput = await this.getUserInput();\n\t\tawait this.runUserPromptTurn(userInput);\n\t}\n};\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function (this: InteractiveModeBase): Promise<string[]> {\n\tif (getEnvValue(ENV_OFFLINE)) {\n\t\treturn [];\n\t}\n\n\ttry {\n\t\tconst packageManager = new DefaultPackageManager({\n\t\t\tcwd: this.sessionManager.getCwd(),\n\t\t\tagentDir: getAgentDir(),\n\t\t\tsettingsManager: this.settingsManager,\n\t\t});\n\t\tconst updates = await packageManager.checkForAvailableUpdates();\n\t\treturn updates.map((update) => update.displayName);\n\t} catch {\n\t\treturn [];\n\t}\n};\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function (\n\tthis: InteractiveModeBase,\n): Promise<string | undefined> {\n\tif (!process.env.TMUX) return undefined;\n\n\tconst runTmuxShow = (option: string): Promise<string | undefined> => {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t\t\tenv: createChildProcessEnvironment(),\n\t\t\t});\n\t\t\tlet stdout = \"\";\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tproc.kill();\n\t\t\t\tresolve(undefined);\n\t\t\t}, 2000);\n\n\t\t\tproc.stdout?.on(\"data\", (data) => {\n\t\t\t\tstdout += data.toString();\n\t\t\t});\n\t\t\tproc.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(undefined);\n\t\t\t});\n\t\t\tproc.on(\"close\", (code) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(code === 0 ? stdout.trim() : undefined);\n\t\t\t});\n\t\t});\n\t};\n\n\tconst [extendedKeys, extendedKeysFormat] = await Promise.all([\n\t\trunTmuxShow(\"extended-keys\"),\n\t\trunTmuxShow(\"extended-keys-format\"),\n\t]);\n\n\t// If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n\tif (extendedKeys === undefined) return undefined;\n\n\tif (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n\t\treturn \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n\t}\n\n\tif (extendedKeysFormat === \"xterm\") {\n\t\treturn `tmux extended-keys-format is xterm. ${APP_TITLE} works best with csi-u. Add \\`set -g extended-keys-format csi-u\\` to ~/.tmux.conf and restart tmux.`;\n\t}\n\n\treturn undefined;\n};\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function (this: InteractiveModeBase): string | undefined {\n\t// Skip changelog for resumed/continued sessions (already have messages)\n\tif (this.session.state.messages.length > 0) {\n\t\treturn undefined;\n\t}\n\n\tconst lastVersion = this.settingsManager.getLastChangelogVersion();\n\tconst changelogPath = getChangelogPath();\n\tconst entries = parseChangelog(changelogPath);\n\n\tif (!lastVersion) {\n\t\t// Fresh install - record the version, send telemetry, don't show changelog\n\t\tthis.settingsManager.setLastChangelogVersion(VERSION);\n\t\tthis.reportInstallTelemetry(VERSION);\n\t\treturn undefined;\n\t}\n\n\tconst newEntries = getNewEntries(entries, lastVersion, VERSION);\n\tconst currentEntries = getEntriesForVersion(newEntries, VERSION);\n\tif (currentEntries.length > 0) {\n\t\tthis.settingsManager.setLastChangelogVersion(VERSION);\n\t\tthis.reportInstallTelemetry(VERSION);\n\t\treturn currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n\t}\n\n\treturn undefined;\n};\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function (this: InteractiveModeBase, version: string): void {\n\tif (getEnvValue(ENV_OFFLINE)) {\n\t\treturn;\n\t}\n\n\tif (!isInstallTelemetryEnabled(this.settingsManager)) {\n\t\treturn;\n\t}\n\n\tvoid fetch(`${VERSION_ADOPTION_ENDPOINT}?version=${encodeURIComponent(version)}`, {\n\t\theaders: {\n\t\t\t\"User-Agent\": getPiUserAgent(version),\n\t\t},\n\t\tsignal: AbortSignal.timeout(5000),\n\t})\n\t\t.then(() => undefined)\n\t\t.catch(() => undefined);\n};\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function (this: InteractiveModeBase): MarkdownTheme {\n\treturn {\n\t\t...getMarkdownTheme(),\n\t\tcodeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n\t};\n};\n\nInteractiveModeBase.prototype.formatDisplayPath = function (this: InteractiveModeBase, p: string): string {\n\tconst home = os.homedir();\n\tlet result = p;\n\n\t// Replace home directory with ~\n\tif (result.startsWith(home)) {\n\t\tresult = `~${result.slice(home.length)}`;\n\t}\n\n\treturn result;\n};\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function (this: InteractiveModeBase, path: string): string {\n\treturn this.formatDisplayPath(path).replace(/[\\\\/]index\\.(?:ts|js)$/, \"\");\n};\n\nInteractiveModeBase.prototype.formatContextPath = function (this: InteractiveModeBase, p: string): string {\n\tconst cwd = path.resolve(this.sessionManager.getCwd());\n\tconst absolutePath = path.isAbsolute(p) ? path.resolve(p) : path.resolve(cwd, p);\n\tconst relativePath = getCwdRelativePath(absolutePath, cwd);\n\tif (relativePath !== undefined) {\n\t\treturn relativePath;\n\t}\n\n\treturn this.formatDisplayPath(absolutePath);\n};\n\nInteractiveModeBase.prototype.getStartupModelLabel = function (this: InteractiveModeBase): string {\n\tconst model = this.session.state.model;\n\tlet modelLabel = model?.id ?? \"no-model\";\n\n\tif (model?.reasoning) {\n\t\tmodelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n\t}\n\n\treturn modelLabel;\n};\n\nInteractiveModeBase.prototype.getStartupIdentityText = function (\n\tthis: InteractiveModeBase,\n\tmaxWidth?: number,\n\tgap = 0,\n\tmanifestoPhase = 4,\n): string {\n\tconst appLabel = APP_NAME.length > 0 ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}` : \"Atomic\";\n\tconst noColor = process.env.NO_COLOR !== undefined;\n\tconst fg = (role: \"text\" | \"muted\" | \"dim\", text: string): string => (noColor ? text : theme.fg(role, text));\n\tconst showMark = supportsAtomicBanner();\n\tconst wordmark = showMark ? \"\" : `${atomicWordmark()} `;\n\tconst title = `${wordmark}${theme.bold(fg(\"text\", appLabel))} ${fg(\"muted\", `v${this.version}`)}`;\n\tconst model = this.session.state.model;\n\tconst provider = model ? fg(\"dim\", `(${model.provider})`) : fg(\"dim\", \"(no-provider)\");\n\tconst modelLine = `${provider} ${fg(\"muted\", this.getStartupModelLabel())}`;\n\tconst markLines = showMark ? this.getAtomicAnsiMarkLines(gap) : [];\n\tconst markWidth = Math.max(0, ...markLines.map(visibleWidth));\n\tconst showMeta = gap === 0 || (maxWidth !== undefined && maxWidth < markWidth);\n\tconst metaLines = showMeta\n\t\t? [title, modelLine, fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()))]\n\t\t: [];\n\treturn composeStartupIdentity(\n\t\tmarkLines,\n\t\tmetaLines,\n\t\tmaxWidth,\n\t\tgap === 0 ? renderStartupManifesto(manifestoPhase) : [],\n\t);\n};\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function (this: InteractiveModeBase, gap = 0): string[] {\n\treturn renderAtomicAssemblyBanner(gap, theme, this.session.thinkingLevel || \"off\");\n};\n\nInteractiveModeBase.prototype.getStartupExpansionState = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose || this.toolOutputExpanded;\n};\n\nInteractiveModeBase.prototype.shouldShowStartupHeader = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;\n};\n\nInteractiveModeBase.prototype.shouldShowStartupDetails = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose === true || this.settingsManager.getQuietStartup() === false;\n};\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,mBAAmB,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAA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,EAAE,SAAS,EAAE,EAAE,CAAC,OAAO,EAAE,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,cAAc,CAAC,MAAM,EAAE,CAAC,CAAC,CAAC;QACvF,CAAC,CAAC,EAAE,CAAC;IACN,OAAO,sBAAsB,CAC5B,SAAS,EACT,SAAS,EACT,QAAQ,EACR,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,sBAAsB,CAAC,cAAc,CAAC,CAAC,CAAC,CAAC,EAAE,CACvD,CAAC;AACH,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,sBAAsB,GAAG,UAAqC,GAAG,GAAG,CAAC;IAClG,OAAO,0BAA0B,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,OAAO,CAAC,aAAa,IAAI,KAAK,CAAC,CAAC;AACpF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB,CAAC;AACxD,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,uBAAuB,GAAG;IACvD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,KAAK,IAAI,CAAC;AACzF,CAAC,CAAC;AAEF,mBAAmB,CAAC,SAAS,CAAC,wBAAwB,GAAG;IACxD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,KAAK,IAAI,IAAI,IAAI,CAAC,eAAe,CAAC,eAAe,EAAE,KAAK,KAAK,CAAC;AAC1F,CAAC,CAAC","sourcesContent":["import { ScrollView, VStack } from \"@earendil-works/pi-tui\";\nimport { markLifecycleTiming } from \"../../core/lifecycle-timings.ts\";\nimport { isOfflineModeEnabled } from \"../../core/package-manager-env.ts\";\nimport { createChildProcessEnvironment } from \"../../utils/child-process.ts\";\nimport { ensurePngTranscoder } from \"../../utils/image-convert.ts\";\nimport { setMarkitDiagnosticSink } from \"../../utils/markit.js\";\nimport type { ToolStatus } from \"../../utils/tools-manager.ts\";\nimport { renderDiagnosticStatus } from \"../interactive-engine/engine-diagnostic-view.js\";\nimport {\n\tonInteractiveEngineRemoteCommandsChanged,\n\tonInteractiveEngineResourceExtensionsChanged,\n\tonInteractiveEngineSessionStatsChanged,\n\twaitForInteractiveEngineBound,\n} from \"../interactive-engine/extension-ui-bridge.ts\";\nimport {\n\tatomicWordmark,\n\trenderAtomicAssemblyBanner,\n\trenderStartupManifesto,\n\tsupportsAtomicBanner,\n} from \"./components/atomic-banner.ts\";\nimport { StartupIdentityComponent } from \"./components/startup-identity.ts\";\nimport { ThemedText } from \"./components/themed-text.js\";\nimport { bindInitialEagerSession } from \"./interactive-initial-session-binding.ts\";\nimport { InteractiveModeBase, seedStartupInput } from \"./interactive-mode-base.ts\";\nimport {\n\tAPP_NAME,\n\tAPP_TITLE,\n\ttype Container,\n\tcheckForNewPiVersion,\n\tcomposeStartupIdentity,\n\tDefaultPackageManager,\n\tDynamicBorder,\n\tENV_OFFLINE,\n\tensureTool,\n\tgetAgentDir,\n\tgetChangelogPath,\n\tgetCwdRelativePath,\n\tgetEntriesForVersion,\n\tgetEnvValue,\n\tgetMarkdownTheme,\n\tgetNewEntries,\n\tgetPiUserAgent,\n\tisInstallTelemetryEnabled,\n\tMarkdown,\n\ttype MarkdownTheme,\n\tnormalizeChangelogLinks,\n\tonThemeChange,\n\tos,\n\tparseChangelog,\n\tpath,\n\trecordTimeSinceReset,\n\tSpacer,\n\tspawn,\n\tText,\n\ttheme,\n\tVERSION,\n\tVERSION_ADOPTION_ENDPOINT,\n\tvisibleWidth,\n} from \"./interactive-mode-deps.ts\";\nimport {\n\trefreshCatalogsAfterTuiStartup,\n\tupdateProviderCountFromSnapshot,\n} from \"./interactive-model-catalog-startup.ts\";\nimport { ONBOARDING_COPY } from \"./interactive-onboarding.ts\";\nimport { restoreTerminalTitleAfterPackageCheck } from \"./interactive-terminal-title.ts\";\n\nexport const shouldRefreshCatalogsOnStartup = (): boolean => !isOfflineModeEnabled();\n\nfunction prepareStartupNotices(mode: InteractiveModeBase): void {\n\tif (mode.startupNoticesPrepared) return;\n\tmode.startupNoticesPrepared = true;\n\tmode.hadLastChangelogVersionAtStartup = Boolean(mode.settingsManager.getLastChangelogVersion?.());\n\tif (mode.changelogMarkdown === undefined) {\n\t\tmode.changelogMarkdown = mode.getChangelogForDisplay?.();\n\t}\n\tmode.initializeFirstRunOnboardingMarkers?.();\n\tif (!mode.firstRunNoticeVisible) {\n\t\tmode.firstRunNoticeVisible = mode.isFirstRunOnboardingEligible?.() ?? false;\n\t}\n}\n\n/**\n * Show non-fatal model-catalog warnings — today, a derived `-fast` variant suppressed because\n * something already owns that exact model ID.\n *\n * Called unconditionally at startup and again after deferred extension loading, because an extension\n * provider can introduce a collision that did not exist at startup. The last reported text is kept so\n * the second read only speaks when the diagnostic set actually changed.\n */\nInteractiveModeBase.prototype.reportModelCatalogWarning = function (\n\tthis: InteractiveModeBase,\n\ttargetContainer: Container = this.chatContainer,\n): void {\n\tconst warning = this.session.modelRuntime.getWarning?.();\n\tif (!warning || warning === this.reportedModelCatalogWarning) {\n\t\treturn;\n\t}\n\tthis.reportedModelCatalogWarning = warning;\n\tthis.showWarning(warning, targetContainer);\n};\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function (\n\tthis: InteractiveModeBase,\n\ttargetContainer: Container = this.chatContainer,\n): void {\n\tif (this.startupNoticesShown) {\n\t\treturn;\n\t}\n\tprepareStartupNotices(this);\n\tthis.startupNoticesShown = true;\n\n\tconst changelogMarkdown = this.changelogMarkdown;\n\tif (!changelogMarkdown && !this.firstRunNoticeVisible) {\n\t\treturn;\n\t}\n\n\tif (changelogMarkdown) {\n\t\tif (targetContainer.children.length > 0) {\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t}\n\t\ttargetContainer.addChild(new DynamicBorder());\n\t\tif (this.settingsManager.getCollapseChangelog()) {\n\t\t\tconst versionMatch = changelogMarkdown.match(\n\t\t\t\t/##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n\t\t\t);\n\t\t\tconst latestVersion = versionMatch ? versionMatch[1] : this.version;\n\t\t\tconst condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n\t\t\ttargetContainer.addChild(new Text(condensedText, 1, 0));\n\t\t} else {\n\t\t\ttargetContainer.addChild(new ThemedText(() => theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0));\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t\ttargetContainer.addChild(new Markdown(changelogMarkdown.trim(), 1, 0, this.getMarkdownThemeWithSettings()));\n\t\t\ttargetContainer.addChild(new Spacer(1));\n\t\t}\n\t\ttargetContainer.addChild(new DynamicBorder());\n\t}\n\n\tif (this.firstRunNoticeVisible) {\n\t\tthis.firstRunOnboardingNoticeComponents = [];\n\t\tif (targetContainer.children.length > 0) {\n\t\t\tthis.firstRunOnboardingNoticeComponents.push(new Spacer(1));\n\t\t}\n\t\tthis.firstRunOnboardingNoticeComponents.push(\n\t\t\tnew DynamicBorder(),\n\t\t\tnew Text(ONBOARDING_COPY, 1, 0),\n\t\t\tnew DynamicBorder(),\n\t\t\tnew Spacer(1),\n\t\t);\n\t\tfor (const component of this.firstRunOnboardingNoticeComponents) {\n\t\t\ttargetContainer.addChild(component);\n\t\t}\n\t\t// Mark completion only after queueing the notice in the chat canvas so\n\t\t// launches that skip rendering retry the first-run notice next time.\n\t\tthis.settingsManager.setOnboardedVersion(this.version);\n\t}\n\n\tthis.ui.requestRender();\n};\n\n/** Bring fd and rg to readiness, reporting progress into the transcript. */\nInteractiveModeBase.prototype.ensureManagedToolsReady = function (this: InteractiveModeBase): Promise<void> {\n\tconst statusGeneration = ++this.managedToolStatusGeneration;\n\tconst reportStatus = (status: ToolStatus): void => {\n\t\tif (this.managedToolStatusGeneration === statusGeneration) this.showManagedToolStatus(status);\n\t};\n\treturn Promise.all([ensureTool(\"fd\", reportStatus), ensureTool(\"rg\", reportStatus)])\n\t\t.then(([fdPath]) => {\n\t\t\tthis.fdPath = fdPath;\n\t\t\tthis.setupAutocompleteProvider();\n\t\t})\n\t\t.catch((error) => {\n\t\t\tconst message = error instanceof Error ? error.message : String(error);\n\t\t\treportStatus({ type: \"warning\", message: `Tool readiness check failed: ${message}` });\n\t\t});\n};\n\n/** Show a managed-tool status update in the chat, never on the console. */\nInteractiveModeBase.prototype.showManagedToolStatus = function (this: InteractiveModeBase, status: ToolStatus): void {\n\tif (!this.managedToolStatusStarted) {\n\t\tthis.chatContainer.addChild(new Spacer(1));\n\t\tthis.managedToolStatusStarted = true;\n\t}\n\tconst message = status.type === \"warning\" ? `Warning: ${status.message}` : status.message;\n\tconst color = status.type === \"warning\" ? \"warning\" : \"dim\";\n\tthis.chatContainer.addChild(new ThemedText(() => theme.fg(color, message), 1, 0));\n\tthis.lastStatusSpacer = undefined;\n\tthis.lastStatusText = undefined;\n\tthis.ui.requestRender();\n};\n\nexport function attachInteractiveEngineResourceExtensionRefresh(mode: InteractiveModeBase): () => void {\n\treturn onInteractiveEngineResourceExtensionsChanged(mode.runtimeHost, () => {\n\t\tif (mode.resourceDisclosureContainer.children.length === 0) return;\n\t\tmode.showLoadedResources({\n\t\t\tforce: true,\n\t\t\tshowDiagnosticsWhenQuiet: true,\n\t\t\ttargetContainer: mode.resourceDisclosureContainer,\n\t\t});\n\t\tmode.ui.requestRender();\n\t});\n}\n\nInteractiveModeBase.prototype.init = async function (this: InteractiveModeBase): Promise<void> {\n\tif (this.isInitialized) return;\n\n\tthis.registerSignalHandlers();\n\n\t// Keep the transcript in its own viewport and reserve the bottom chrome in a\n\t// fixed dock for the fullscreen renderer. The same components also feed the\n\t// internal main-screen fallback used for guarded terminal paths.\n\tthis.renderWidgets(); // Initialize with default spacer\n\tthis.transcriptScrollView = new ScrollView(this.documentContainer, {\n\t\tfollow: \"end\",\n\t\tprimary: true,\n\t\toverscroll: \"chain\",\n\t\tscrollbar: this.settingsManager.getFullscreenScrollbar(),\n\t\tscrollbarThumbStyle: (text) => theme.bg(\"scrollbarThumb\", text),\n\t});\n\tconst dock = new VStack([\n\t\t{ component: this.pendingMessagesContainer, shrink: 1, minSize: 0 },\n\t\t{ component: this.statusContainer, shrink: 1, minSize: 0 },\n\t\t{ component: this.widgetContainerAbove, shrink: 1, minSize: 0 },\n\t\t{ component: this.usageMeter, shrink: 1, minSize: 1 },\n\t\t{ component: this.editorContainer, shrink: 1, minSize: 3 },\n\t\t{ component: this.footerContainer, shrink: 1, minSize: 1 },\n\t\t// Keep widgetContainerBelow after the footer for #1109's stable dock order.\n\t\t{ component: this.widgetContainerBelow, shrink: 1, minSize: 0 },\n\t]);\n\tthis.fullscreenLayoutRoot = new VStack([\n\t\t{ component: this.transcriptScrollView, basis: 0, grow: 1, shrink: 1, minSize: 1 },\n\t\t{ component: dock, basis: \"auto\", grow: 0, shrink: 1, minSize: 1 },\n\t]);\n\tthis.mountInteractiveTui(this.ui, [\n\t\tthis.documentContainer,\n\t\tthis.pendingMessagesContainer,\n\t\tthis.statusContainer,\n\t\tthis.widgetContainerAbove,\n\t\tthis.usageMeter,\n\t\tthis.editorContainer,\n\t\tthis.footerContainer,\n\t\tthis.widgetContainerBelow,\n\t]);\n\tthis.ui.setFocus(this.extensionSelector ?? this.extensionInput ?? this.extensionEditor ?? this.editor);\n\n\tthis.setupKeyHandlers();\n\tthis.setupEditorSubmitHandler();\n\t// Rebuild autocomplete whenever the engine child's command catalog arrives or\n\t// changes (initial bind, engine restart, reload, new/resume/fork). Subscribed\n\t// before bind so the first async catalog fetch can never be missed. No-op when\n\t// the host is not isolated.\n\tonInteractiveEngineRemoteCommandsChanged(this.runtimeHost, () => {\n\t\tthis.setupAutocompleteProvider();\n\t});\n\tattachInteractiveEngineResourceExtensionRefresh(this);\n\t// Engine stats can land after the last event of a run; repaint so the idle footer shows them.\n\tonInteractiveEngineSessionStatsChanged(this.runtimeHost, () => {\n\t\tthis.ui.requestRender();\n\t});\n\n\tseedStartupInput(\n\t\tthis.pendingUserInputs,\n\t\tthis.defaultEditor,\n\t\tthis.options.startupInputCapture?.consume(),\n\t\tthis.startupReplayInputs,\n\t\t(text) => {\n\t\t\tthis.startupDraftText = text;\n\t\t},\n\t\t(text) => {\n\t\t\tthis.startupReplayActiveInput = text;\n\t\t},\n\t);\n\n\t// Start and paint the host-owned TUI before waiting for the isolated engine.\n\t// The editor remains local and responsive; session binding and provider work\n\t// still stay behind the engine-bound gate below.\n\tmarkLifecycleTiming(\"tui-start\");\n\tthis.ui.start();\n\tensurePngTranscoder(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.ui.requestRender();\n\t});\n\tthis.disposeMarkitDiagnosticSink = setMarkitDiagnosticSink((message) => renderDiagnosticStatus(message, this));\n\tthis.footerDataProvider.onBranchChange(() => {\n\t\tthis.ui.requestRender();\n\t});\n\n\tawait this.themeController.applyFromSettings();\n\n\t// Add the quiet startup identity unless silenced.\n\tif (this.shouldShowStartupHeader()) {\n\t\tthis.builtInHeader = new StartupIdentityComponent(this.ui, (width, state) =>\n\t\t\tthis.getStartupIdentityText(width, state.gap, state.manifestoPhase),\n\t\t);\n\n\t\tthis.headerContainer.addChild(new Spacer(1));\n\t\tthis.headerContainer.addChild(this.builtInHeader);\n\t\tthis.headerContainer.addChild(new Spacer(1));\n\t} else {\n\t\t// Minimal header when silenced\n\t\tthis.builtInHeader = new Text(\"\", 0, 0);\n\t\tthis.headerContainer.addChild(this.builtInHeader);\n\t}\n\tmarkLifecycleTiming(\"header-mounted\");\n\tthis.ui.requestRender();\n\t// This legacy mark now means the first requested identity frame. The settled\n\t// animation frame remains the external benchmark's startup-complete mark.\n\trecordTimeSinceReset(\"time-to-first-frame\");\n\n\tawait waitForInteractiveEngineBound(this.runtimeHost);\n\tif (this.isShuttingDown) return;\n\tthis.isInitialized = true;\n\t// The isolated engine may have replaced the preliminary model/provider view.\n\tthis.ui.requestRender();\n\n\t// fd/rg readiness runs after first paint so slow downloads never make\n\t// startup appear frozen. Progress reports land in the transcript: a console\n\t// write here lands in the alternate screen and corrupts the frame.\n\tvoid this.ensureManagedToolsReady();\n\n\t// When startup resources are deferred, keep the already-painted editor responsive.\n\t// Extension UI bindings are installed at the deferred reload boundary, not here,\n\t// so no post-paint resource work can block visible typing.\n\tif (this.deferredStartupPending) {\n\t\tthis.applyRuntimeSettings();\n\t\tthis.subscribeToAgent();\n\t\tthis.updateEditorBorderColor();\n\t\tthis.updateTerminalTitle();\n\t} else {\n\t\tawait bindInitialEagerSession(this);\n\t}\n\n\tthis.attachStartupNoticesContainer();\n\t// Render initial messages AFTER the initial session binding is in place.\n\tthis.renderInitialMessages();\n\t// Set up theme file watcher\n\tonThemeChange(() => {\n\t\tthis.ui.invalidate();\n\t\tthis.updateEditorBorderColor();\n\t\tthis.ui.requestRender();\n\t});\n\n\tupdateProviderCountFromSnapshot(this);\n};\n\nInteractiveModeBase.prototype.updateTerminalTitle = function (this: InteractiveModeBase): void {\n\tconst cwdBasename = path.basename(this.sessionManager.getCwd());\n\tconst sessionName = this.sessionManager.getSessionName();\n\tif (sessionName) {\n\t\tthis.ui.terminal.setTitle(`${APP_TITLE} - ${sessionName} - ${cwdBasename}`);\n\t} else {\n\t\tthis.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n\t}\n};\n\nInteractiveModeBase.prototype.run = async function (this: InteractiveModeBase): Promise<void> {\n\tawait this.init();\n\tif (this.isShuttingDown) return;\n\n\tif (shouldRefreshCatalogsOnStartup()) void refreshCatalogsAfterTuiStartup(this);\n\n\tsetTimeout(() => {\n\t\tconst startupNoticesContainer = this.startupNoticesContainer;\n\t\tcheckForNewPiVersion(this.version).then((newVersion) => {\n\t\t\tif (newVersion) this.showNewVersionNotification(newVersion, startupNoticesContainer);\n\t\t});\n\t\trestoreTerminalTitleAfterPackageCheck(this.checkForPackageUpdates(), {\n\t\t\tinitialized: () => this.isInitialized,\n\t\t\trestore: () => this.updateTerminalTitle(),\n\t\t}).then((updates) => {\n\t\t\tif (updates.length > 0) this.showPackageUpdateNotification(updates, startupNoticesContainer);\n\t\t});\n\t\tthis.checkTmuxKeyboardSetup().then((warning) => {\n\t\t\tif (warning) this.showWarning(warning, startupNoticesContainer);\n\t\t});\n\t\t// Deferred startup releases chat output immediately after rendering the\n\t\t// disclosure, so wait only while that startup work remains in flight.\n\t\tif (!this.deferredStartupPending && !this.deferredStartupPromise) {\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, startupNoticesContainer);\n\t\t}\n\t}, 500);\n\n\t// Show startup warnings\n\tconst { migratedProviders, startupDiagnostics, initialMessage, initialImages, initialMessages } = this.options;\n\n\tfor (const diagnostic of startupDiagnostics ?? []) {\n\t\tif (diagnostic.type === \"error\") this.showError(diagnostic.message);\n\t\telse if (diagnostic.type === \"warning\") this.showWarning(diagnostic.message);\n\t\telse this.showStatus(diagnostic.message);\n\t}\n\n\tif (migratedProviders && migratedProviders.length > 0) {\n\t\tthis.showWarning(`Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`);\n\t}\n\n\tconst modelsJsonError = this.session.modelRuntime.getError();\n\tif (modelsJsonError) {\n\t\tthis.showError(`models.json error: ${modelsJsonError}`);\n\t}\n\n\tconst modelFallbackMessage = this.runtimeHost.modelFallbackMessage;\n\tif (modelFallbackMessage && !this.deferredStartupPending) {\n\t\tthis.showWarning(modelFallbackMessage, this.startupNoticesContainer);\n\t}\n\n\t// CLI-provided startup prompts need extension tools/resources; wait before sending them,\n\t// but do not block the normal no-prompt input loop from becoming ready.\n\tif (this.deferredStartupPending && (initialMessage || (initialMessages && initialMessages.length > 0))) {\n\t\tawait this.ensureDeferredStartupComplete();\n\t}\n\n\t// Process initial messages\n\tif (initialMessage) {\n\t\ttry {\n\t\t\tawait this.session.prompt(initialMessage, { images: initialImages });\n\t\t} catch (error: unknown) {\n\t\t\tconst errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n\t\t\tthis.showError(errorMessage);\n\t\t}\n\t}\n\n\tif (initialMessages) {\n\t\tfor (const message of initialMessages) {\n\t\t\ttry {\n\t\t\t\tawait this.session.prompt(message);\n\t\t\t} catch (error: unknown) {\n\t\t\t\tconst errorMessage = error instanceof Error ? error.message : \"Unknown error occurred\";\n\t\t\t\tthis.showError(errorMessage);\n\t\t\t}\n\t\t}\n\t}\n\n\t// Main interactive loop\n\twhile (true) {\n\t\tconst userInput = await this.getUserInput();\n\t\tawait this.runUserPromptTurn(userInput);\n\t}\n};\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function (this: InteractiveModeBase): Promise<string[]> {\n\tif (getEnvValue(ENV_OFFLINE)) {\n\t\treturn [];\n\t}\n\n\ttry {\n\t\tconst packageManager = new DefaultPackageManager({\n\t\t\tcwd: this.sessionManager.getCwd(),\n\t\t\tagentDir: getAgentDir(),\n\t\t\tsettingsManager: this.settingsManager,\n\t\t});\n\t\tconst updates = await packageManager.checkForAvailableUpdates();\n\t\treturn updates.map((update) => update.displayName);\n\t} catch {\n\t\treturn [];\n\t}\n};\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function (\n\tthis: InteractiveModeBase,\n): Promise<string | undefined> {\n\tif (!process.env.TMUX) return undefined;\n\n\tconst runTmuxShow = (option: string): Promise<string | undefined> => {\n\t\treturn new Promise((resolve) => {\n\t\t\tconst proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n\t\t\t\tstdio: [\"ignore\", \"pipe\", \"ignore\"],\n\t\t\t\tenv: createChildProcessEnvironment(),\n\t\t\t});\n\t\t\tlet stdout = \"\";\n\t\t\tconst timer = setTimeout(() => {\n\t\t\t\tproc.kill();\n\t\t\t\tresolve(undefined);\n\t\t\t}, 2000);\n\n\t\t\tproc.stdout?.on(\"data\", (data) => {\n\t\t\t\tstdout += data.toString();\n\t\t\t});\n\t\t\tproc.on(\"error\", () => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(undefined);\n\t\t\t});\n\t\t\tproc.on(\"close\", (code) => {\n\t\t\t\tclearTimeout(timer);\n\t\t\t\tresolve(code === 0 ? stdout.trim() : undefined);\n\t\t\t});\n\t\t});\n\t};\n\n\tconst [extendedKeys, extendedKeysFormat] = await Promise.all([\n\t\trunTmuxShow(\"extended-keys\"),\n\t\trunTmuxShow(\"extended-keys-format\"),\n\t]);\n\n\t// If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n\tif (extendedKeys === undefined) return undefined;\n\n\tif (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n\t\treturn \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n\t}\n\n\tif (extendedKeysFormat === \"xterm\") {\n\t\treturn `tmux extended-keys-format is xterm. ${APP_TITLE} works best with csi-u. Add \\`set -g extended-keys-format csi-u\\` to ~/.tmux.conf and restart tmux.`;\n\t}\n\n\treturn undefined;\n};\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function (this: InteractiveModeBase): string | undefined {\n\t// Skip changelog for resumed/continued sessions (already have messages)\n\tif (this.session.state.messages.length > 0) {\n\t\treturn undefined;\n\t}\n\n\tconst lastVersion = this.settingsManager.getLastChangelogVersion();\n\tconst changelogPath = getChangelogPath();\n\tconst entries = parseChangelog(changelogPath);\n\n\tif (!lastVersion) {\n\t\t// Fresh install - record the version, send telemetry, don't show changelog\n\t\tthis.settingsManager.setLastChangelogVersion(VERSION);\n\t\tthis.reportInstallTelemetry(VERSION);\n\t\treturn undefined;\n\t}\n\n\tconst newEntries = getNewEntries(entries, lastVersion, VERSION);\n\tconst currentEntries = getEntriesForVersion(newEntries, VERSION);\n\tif (currentEntries.length > 0) {\n\t\tthis.settingsManager.setLastChangelogVersion(VERSION);\n\t\tthis.reportInstallTelemetry(VERSION);\n\t\treturn currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n\t}\n\n\treturn undefined;\n};\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function (this: InteractiveModeBase, version: string): void {\n\tif (getEnvValue(ENV_OFFLINE)) {\n\t\treturn;\n\t}\n\n\tif (!isInstallTelemetryEnabled(this.settingsManager)) {\n\t\treturn;\n\t}\n\n\tvoid fetch(`${VERSION_ADOPTION_ENDPOINT}?version=${encodeURIComponent(version)}`, {\n\t\theaders: {\n\t\t\t\"User-Agent\": getPiUserAgent(version),\n\t\t},\n\t\tsignal: AbortSignal.timeout(5000),\n\t})\n\t\t.then(() => undefined)\n\t\t.catch(() => undefined);\n};\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function (this: InteractiveModeBase): MarkdownTheme {\n\treturn {\n\t\t...getMarkdownTheme(),\n\t\tcodeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n\t};\n};\n\nInteractiveModeBase.prototype.formatDisplayPath = function (this: InteractiveModeBase, p: string): string {\n\tconst home = os.homedir();\n\tlet result = p;\n\n\t// Replace home directory with ~\n\tif (result.startsWith(home)) {\n\t\tresult = `~${result.slice(home.length)}`;\n\t}\n\n\treturn result;\n};\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function (this: InteractiveModeBase, path: string): string {\n\treturn this.formatDisplayPath(path).replace(/[\\\\/]index\\.(?:ts|js)$/, \"\");\n};\n\nInteractiveModeBase.prototype.formatContextPath = function (this: InteractiveModeBase, p: string): string {\n\tconst cwd = path.resolve(this.sessionManager.getCwd());\n\tconst absolutePath = path.isAbsolute(p) ? path.resolve(p) : path.resolve(cwd, p);\n\tconst relativePath = getCwdRelativePath(absolutePath, cwd);\n\tif (relativePath !== undefined) {\n\t\treturn relativePath;\n\t}\n\n\treturn this.formatDisplayPath(absolutePath);\n};\n\nInteractiveModeBase.prototype.getStartupModelLabel = function (this: InteractiveModeBase): string {\n\tconst model = this.session.state.model;\n\tlet modelLabel = model?.id ?? \"no-model\";\n\n\tif (model?.reasoning) {\n\t\tmodelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n\t}\n\n\treturn modelLabel;\n};\n\nInteractiveModeBase.prototype.getStartupIdentityText = function (\n\tthis: InteractiveModeBase,\n\tmaxWidth?: number,\n\tgap = 0,\n\tmanifestoPhase = 4,\n): string {\n\tconst appLabel = APP_NAME.length > 0 ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}` : \"Atomic\";\n\tconst noColor = process.env.NO_COLOR !== undefined;\n\tconst fg = (role: \"text\" | \"muted\" | \"dim\", text: string): string => (noColor ? text : theme.fg(role, text));\n\tconst showMark = supportsAtomicBanner();\n\tconst wordmark = showMark ? \"\" : `${atomicWordmark()} `;\n\tconst title = `${wordmark}${theme.bold(fg(\"text\", appLabel))} ${fg(\"muted\", `v${this.version}`)}`;\n\tconst model = this.session.state.model;\n\tconst provider = model ? fg(\"dim\", `(${model.provider})`) : fg(\"dim\", \"(no-provider)\");\n\tconst modelLine = `${provider} ${fg(\"muted\", this.getStartupModelLabel())}`;\n\tconst markLines = showMark ? this.getAtomicAnsiMarkLines(gap) : [];\n\tconst markWidth = Math.max(0, ...markLines.map(visibleWidth));\n\tconst showMeta = gap === 0 || (maxWidth !== undefined && maxWidth < markWidth);\n\tconst metaLines = showMeta\n\t\t? [title, modelLine, fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()))]\n\t\t: [];\n\treturn composeStartupIdentity(\n\t\tmarkLines,\n\t\tmetaLines,\n\t\tmaxWidth,\n\t\tgap === 0 ? renderStartupManifesto(manifestoPhase) : [],\n\t);\n};\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function (this: InteractiveModeBase, gap = 0): string[] {\n\treturn renderAtomicAssemblyBanner(gap, theme, this.session.thinkingLevel || \"off\");\n};\n\nInteractiveModeBase.prototype.getStartupExpansionState = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose || this.toolOutputExpanded;\n};\n\nInteractiveModeBase.prototype.shouldShowStartupHeader = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose === true || this.settingsManager.getQuietStartup() !== true;\n};\n\nInteractiveModeBase.prototype.shouldShowStartupDetails = function (this: InteractiveModeBase): boolean {\n\treturn this.options.verbose === true || this.settingsManager.getQuietStartup() === false;\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-redaction.d.ts","sourceRoot":"","sources":["../../src/utils/credential-redaction.ts"],"names":[],"mappings":"AAgBA,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAU3D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
const CREDENTIAL_SHAPES = [
|
|
2
|
+
/\bBearer\s+[\w.~+/-]+=*/giu,
|
|
3
|
+
/\beyJ[\w-]{8,}\.[\w-]{8,}\.[\w-]+/gu,
|
|
4
|
+
/\b(?:sk|pk|rk|api|key|tok|token|secret)[-_][\w-]{12,}/giu,
|
|
5
|
+
];
|
|
6
|
+
const CREDENTIAL_FIELD_NAME = "(?:x-)?(?:api[-_]?key|apikey|auth(?:orization)?|access[-_]?token|refresh[-_]?token|id[-_]?token|client[-_]?secret|secret[-_]?key|private[-_]?key|session[-_]?key|password|passwd|token|secret|key)";
|
|
7
|
+
const CREDENTIAL_AUTH_SCHEME = "(?:Bearer|Basic|Digest|Token|ApiKey|OAuth)";
|
|
8
|
+
const CREDENTIAL_CONTEXTS = [
|
|
9
|
+
new RegExp(String.raw `\b${CREDENTIAL_FIELD_NAME}\s*:\s*(?:${CREDENTIAL_AUTH_SCHEME}\s+)?[^\s,;}"']+`, "giu"),
|
|
10
|
+
new RegExp(String.raw `(["']?)${CREDENTIAL_FIELD_NAME}\1\s*:\s*(["'])(?:(?!\2).)*\2`, "giu"),
|
|
11
|
+
new RegExp(String.raw `\b${CREDENTIAL_FIELD_NAME}\s*=\s*[^\s&,;}"']+`, "giu"),
|
|
12
|
+
];
|
|
13
|
+
export function redactCredentialShapes(text) {
|
|
14
|
+
const byContext = CREDENTIAL_CONTEXTS.reduce((masked, context) => masked.replace(context, (match) => {
|
|
15
|
+
const separator = /[:=]/u.exec(match);
|
|
16
|
+
return separator ? `${match.slice(0, separator.index + 1)} [redacted]` : "[redacted]";
|
|
17
|
+
}), text);
|
|
18
|
+
return CREDENTIAL_SHAPES.reduce((masked, shape) => masked.replace(shape, "[redacted]"), byContext);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=credential-redaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-redaction.js","sourceRoot":"","sources":["../../src/utils/credential-redaction.ts"],"names":[],"mappings":"AAAA,MAAM,iBAAiB,GAAsB;IAC5C,4BAA4B;IAC5B,qCAAqC;IACrC,0DAA0D;CAC1D,CAAC;AAEF,MAAM,qBAAqB,GAC1B,oMAAoM,CAAC;AACtM,MAAM,sBAAsB,GAAG,4CAA4C,CAAC;AAE5E,MAAM,mBAAmB,GAAsB;IAC9C,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,KAAK,qBAAqB,aAAa,sBAAsB,kBAAkB,EAAE,KAAK,CAAC;IAC5G,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,UAAU,qBAAqB,+BAA+B,EAAE,KAAK,CAAC;IAC3F,IAAI,MAAM,CAAC,MAAM,CAAC,GAAG,CAAA,KAAK,qBAAqB,qBAAqB,EAAE,KAAK,CAAC;CAC5E,CAAC;AAEF,MAAM,UAAU,sBAAsB,CAAC,IAAY;IAClD,MAAM,SAAS,GAAG,mBAAmB,CAAC,MAAM,CAC3C,CAAC,MAAM,EAAE,OAAO,EAAE,EAAE,CACnB,MAAM,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACjC,MAAM,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,SAAS,CAAC,CAAC,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,SAAS,CAAC,KAAK,GAAG,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IACvF,CAAC,CAAC,EACH,IAAI,CACJ,CAAC;IACF,OAAO,iBAAiB,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,SAAS,CAAC,CAAC;AACpG,CAAC","sourcesContent":["const CREDENTIAL_SHAPES: readonly RegExp[] = [\n\t/\\bBearer\\s+[\\w.~+/-]+=*/giu,\n\t/\\beyJ[\\w-]{8,}\\.[\\w-]{8,}\\.[\\w-]+/gu,\n\t/\\b(?:sk|pk|rk|api|key|tok|token|secret)[-_][\\w-]{12,}/giu,\n];\n\nconst CREDENTIAL_FIELD_NAME =\n\t\"(?:x-)?(?:api[-_]?key|apikey|auth(?:orization)?|access[-_]?token|refresh[-_]?token|id[-_]?token|client[-_]?secret|secret[-_]?key|private[-_]?key|session[-_]?key|password|passwd|token|secret|key)\";\nconst CREDENTIAL_AUTH_SCHEME = \"(?:Bearer|Basic|Digest|Token|ApiKey|OAuth)\";\n\nconst CREDENTIAL_CONTEXTS: readonly RegExp[] = [\n\tnew RegExp(String.raw`\\b${CREDENTIAL_FIELD_NAME}\\s*:\\s*(?:${CREDENTIAL_AUTH_SCHEME}\\s+)?[^\\s,;}\"']+`, \"giu\"),\n\tnew RegExp(String.raw`([\"']?)${CREDENTIAL_FIELD_NAME}\\1\\s*:\\s*([\"'])(?:(?!\\2).)*\\2`, \"giu\"),\n\tnew RegExp(String.raw`\\b${CREDENTIAL_FIELD_NAME}\\s*=\\s*[^\\s&,;}\"']+`, \"giu\"),\n];\n\nexport function redactCredentialShapes(text: string): string {\n\tconst byContext = CREDENTIAL_CONTEXTS.reduce(\n\t\t(masked, context) =>\n\t\t\tmasked.replace(context, (match) => {\n\t\t\t\tconst separator = /[:=]/u.exec(match);\n\t\t\t\treturn separator ? `${match.slice(0, separator.index + 1)} [redacted]` : \"[redacted]\";\n\t\t\t}),\n\t\ttext,\n\t);\n\treturn CREDENTIAL_SHAPES.reduce((masked, shape) => masked.replace(shape, \"[redacted]\"), byContext);\n}\n"]}
|
|
@@ -20,6 +20,8 @@ The effective parameters appear in extension events and successful results:
|
|
|
20
20
|
|
|
21
21
|
Atomic carries the recent tail with the compaction boundary rather than replaying it as separate assistant and tool-result messages. Tail text, tool calls, and tool results remain lossless; images remain image blocks. If `query` is absent, Atomic uses the last visible user message.
|
|
22
22
|
|
|
23
|
+
The policy-refusal summary fallback instead keeps a token-based recent tail, replayed as separate messages. Its checkpoint is lossy rather than a verbatim transcript.
|
|
24
|
+
|
|
23
25
|
Compaction resets Claude's signed reasoning chain: `thinking` and `redacted_thinking` blocks do not survive the boundary. See [Preserved thinking and model switches](/models/reference#preserved-thinking-and-model-switches) for behavior between boundaries.
|
|
24
26
|
|
|
25
27
|
The query is never truncated. An oversized planner request reports overflow rather than silently dropping part of it. Use `keepContext` tags, not a longer query, to guarantee protection.
|
|
@@ -75,8 +77,10 @@ A successful run appends the existing pi-style `type:"compaction"` entry shape:
|
|
|
75
77
|
"tokensBefore": 51234,
|
|
76
78
|
"details": {
|
|
77
79
|
"strategy": "verbatim-lines",
|
|
78
|
-
"promptVersion":
|
|
80
|
+
"promptVersion": 4,
|
|
79
81
|
"rung": "planned",
|
|
82
|
+
"backend": "planner",
|
|
83
|
+
"model": "openai-codex/gpt-6.1-sol",
|
|
80
84
|
"parameters": {"compression_ratio": 0.5, "preserve_recent": 2, "query": "fix the failing test"},
|
|
81
85
|
"stats": {"linesBefore": 812, "linesDeleted": 417, "linesKept": 395, "rangeCount": 63, "tokensBefore": 51234, "tokensAfter": 24980, "percentReduction": 51.2}
|
|
82
86
|
}
|
|
@@ -85,12 +89,12 @@ A successful run appends the existing pi-style `type:"compaction"` entry shape:
|
|
|
85
89
|
|
|
86
90
|
The entry's `tokensBefore` is the provider-aware whole-context count used for budgeting and the Compacted from display. `details.stats.tokensBefore`, `tokensAfter`, and `percentReduction` are heuristic estimates of the compactable region plus the kept tail. Those stats can differ from the entry count, and `percentReduction` is negative when the reconstructed estimate is larger. The display count is not stored again under `details.tokensBefore`.
|
|
87
91
|
|
|
88
|
-
`details.rung` is
|
|
92
|
+
`details.rung` is `"planned"` for successful model compaction, `"extension"` for a `session_before_compact` override, or `"fresh"` when older context was discarded. `details.backend` and `details.model` identify the successful compactor. A policy-refusal fallback records `backend: "summary"`, the same model that refused, and file lists in `details.summary`. Its card says `summary (pi fallback)`. `details.plannerModel` identifies a borrowed chat planner:
|
|
89
93
|
|
|
90
94
|
```json
|
|
91
95
|
"details": {
|
|
92
96
|
"strategy": "verbatim-lines",
|
|
93
|
-
"promptVersion":
|
|
97
|
+
"promptVersion": 4,
|
|
94
98
|
"rung": "planned",
|
|
95
99
|
"plannerModel": {"provider": "openai", "id": "gpt-5.1", "thinkingLevel": "high"}
|
|
96
100
|
}
|
|
@@ -255,7 +259,9 @@ Configure compaction in `~/.atomic/agent/settings.json` or `<project-dir>/.atomi
|
|
|
255
259
|
| `enabled` | `true` | Enable automatic Verbatim Compaction. |
|
|
256
260
|
| `reserveTokens` | `16384` | Tokens to reserve for the next LLM response; threshold auto-compaction starts when completed-response usage or a prospective post-tool context exceeds the model's effective input budget minus this reserve. It is an **input-side** reserve only and never caps planner output. |
|
|
257
261
|
|
|
258
|
-
|
|
262
|
+
The top-level `compactionModel` setting defaults to `"auto"`, using the session model. An exact registered chat-model, classifier, or compactor ID selects a separate compactor. Project settings may not select `morph/*`. See [Compaction model](/compaction#compaction-model).
|
|
263
|
+
|
|
264
|
+
Fallback borrowing reuses `settings.fallbackModels`, the same ordered `provider/model[:thinkingLevel]` list used for chat fallback. It skips entries equal to the selected compaction model. A policy refusal from any chat compaction model, including `auto`, explicit chat-model IDs, and borrowed fallback entries, first tries pi's summary compaction on the same model. Classifier and Morph refusals skip summary fallback and advance directly to the next configured model. Other failures and failed summaries also advance to the next configured model. Only load-bearing recovery may clear older context after all attempts fail.
|
|
259
265
|
|
|
260
266
|
Disable auto-compaction with `"enabled": false`. You can still compact manually with `/compact`.
|
|
261
267
|
|
package/docs/compaction.md
CHANGED
|
@@ -7,9 +7,9 @@ description: "Verbatim line compaction, when it runs, planning rungs, and branch
|
|
|
7
7
|
|
|
8
8
|
LLMs have finite context windows. Atomic reduces older transcript context with **verbatim line compaction** while preserving a configured count of recent context-visible messages. Branch summarization is a separate, lossy feature used when navigating away from a branch.
|
|
9
9
|
|
|
10
|
-
Compaction
|
|
10
|
+
Compaction normally uses the model selected by `compactionModel`. If it fails, Atomic borrows the next model from your configured `fallbackModels` for that request. A chat model's policy refusal first triggers pi's summary compaction on the same model, whether selected by `auto`, an explicit chat-model ID, or a `fallbackModels` entry. If that also fails, Atomic continues through the fallback models. Classifier and Morph failures go straight to the fallback models.
|
|
11
11
|
|
|
12
|
-
**
|
|
12
|
+
**The selected compaction model and configured fallback models may receive the compaction transcript**, using their own credentials. Borrowing never changes the session's model or thinking level. Line planners select deletions, and Atomic reconstructs surviving lines without rewriting them. The policy-refusal summary fallback is lossy and appears as `summary (pi fallback)`.
|
|
13
13
|
|
|
14
14
|
## On this page and its reference
|
|
15
15
|
|
|
@@ -19,8 +19,9 @@ This page covers the concepts and normal use of compaction and branch summarizat
|
|
|
19
19
|
|
|
20
20
|
| Mechanism | Trigger | Model output | Durable result |
|
|
21
21
|
|---|---|---|---|
|
|
22
|
-
| Verbatim compaction | `/compact`, RPC `compact`, or automatic threshold/overflow recovery |
|
|
23
|
-
| Planner fallback borrowing |
|
|
22
|
+
| Verbatim compaction | `/compact`, RPC `compact`, or automatic threshold/overflow recovery | Per-message `id:start,end` deletion records | Retained transcript text reconstructed from the originals |
|
|
23
|
+
| Planner fallback borrowing | A failed selected compaction model | Same deletion records, from a configured `fallbackModels` entry | Retained text with the borrowed model recorded |
|
|
24
|
+
| Policy-refusal summary fallback | A chat provider refuses compaction under its policy | Pi's summary compaction on the same model | A summary boundary labeled `summary (pi fallback)` |
|
|
24
25
|
| Fresh context window | Load-bearing compaction after every configured model failed | *(none — no model call)* | A `CompactionEntry` with `details.rung: "fresh"` |
|
|
25
26
|
| Branch summarization | Optional `/tree` navigation | Generated summary prose | A `BranchSummaryEntry` |
|
|
26
27
|
|
|
@@ -43,10 +44,10 @@ Atomic serializes the compactable part of the conversation into role-tagged line
|
|
|
43
44
|
[Assistant]: The off-by-one error is fixed.
|
|
44
45
|
```
|
|
45
46
|
|
|
46
|
-
The planner
|
|
47
|
+
The planner receives messages with their role and an array of lines. It returns inclusive per-message deletion ranges. For example, this deletes lines 2 through 5 of message 1:
|
|
47
48
|
|
|
48
49
|
```text
|
|
49
|
-
2,5
|
|
50
|
+
1:2,5
|
|
50
51
|
```
|
|
51
52
|
|
|
52
53
|
The model selects lines to delete; it does not rewrite retained text. Retained non-marker lines stay byte-identical and in their original order.
|
|
@@ -86,6 +87,37 @@ Protection includes the tags and survives repeated compaction, even if the plann
|
|
|
86
87
|
|
|
87
88
|
Results report protected ranges as `keptRanges`.
|
|
88
89
|
|
|
90
|
+
## Compaction model
|
|
91
|
+
|
|
92
|
+
Use `/settings` → **Compaction model** to choose Auto, a chat model, a registered classifier, or Morph without changing your chat model. Auto uses the current session model. The selector saves to project settings when a project override already exists; otherwise it saves globally.
|
|
93
|
+
|
|
94
|
+
You can also set `compactionModel` in `~/.atomic/agent/settings.json` or a trusted project's `.atomic/settings.json`:
|
|
95
|
+
|
|
96
|
+
```json
|
|
97
|
+
{
|
|
98
|
+
"compactionModel": "auto",
|
|
99
|
+
"fallbackModels": ["openai-codex/gpt-6.1-sol"]
|
|
100
|
+
}
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The default, `auto`, or an empty value uses the current session model, including Anthropic models. An exact registered chat-model ID selects that model just for compaction. Registered classifiers and Morph compactors are also selectable. Project settings cannot select `morph/*`; choose Morph globally instead.
|
|
104
|
+
|
|
105
|
+
An explicit compaction model can send the compactable transcript to a different provider, using that provider's credentials. Choose only providers permitted to receive your conversation. Changing `compactionModel` does not affect branch summaries.
|
|
106
|
+
|
|
107
|
+
For classifier compaction, log in with `/login typesafe`, then set `"compactionModel": "typesafe/jev-latest"`. The classifier scores groups of transcript lines; Atomic removes lower-scored groups without rewriting the rest. Protected lines and the recent tail are not sent for scoring. If scoring fails, Atomic tries your fallback models. Group boundaries can make the retained fraction differ from the requested compression ratio.
|
|
108
|
+
|
|
109
|
+
For Morph compaction, use `/login morph` or set `MORPH_API_KEY`, then choose `morph/morph-compactor` in the global selector or settings file. Without a credential, the selector marks Morph as `requires /login morph`. Morph receives the compactable transcript, including serialized thinking, but not the recent tail. Atomic reconstructs surviving lines from the originals and preserves `<keepContext>` spans. Morph is not a chat-model choice.
|
|
110
|
+
|
|
111
|
+
The compaction card shows the backend and model that produced the result, such as `classifier · typesafe/jev-latest` or `morph · morph/morph-compactor`. A policy-refusal summary appears as `summary (pi fallback)`.
|
|
112
|
+
|
|
113
|
+
### Troubleshooting policy refusals
|
|
114
|
+
|
|
115
|
+
If you see "This request was blocked as it seems to violate Anthropic's Terms of Service", or a refusal about reverse engineering or duplicating model outputs, the provider refused that compaction request. Atomic does not retry policy refusals as transient errors. For any chat compaction model, including `auto`, it tries pi's summary compaction on the same model. That summary retries recoverable rate-limit, server, overload, and transport errors according to `settings.retry`, just like the planner. If the summary also fails or is refused, Atomic continues through `fallbackModels`.
|
|
116
|
+
|
|
117
|
+
Classifier and Morph refusals skip the summary fallback and go directly to the next configured model. Anthropic remains a supported compactor. To keep verbatim compaction when a model refuses deletion planning, choose another `compactionModel`, such as a chat model, classifier, or Morph. Adding a `fallbackModels` entry gives Atomic another verbatim planner if the same-model summary fails.
|
|
118
|
+
|
|
119
|
+
If every attempt fails, manual `/compact` leaves your context unchanged. Overflow recovery and post-tool preflight may instead clear older context as described below.
|
|
120
|
+
|
|
89
121
|
## Parameters
|
|
90
122
|
|
|
91
123
|
Moved to [Compaction reference](/compaction/reference#parameters).
|
|
@@ -117,7 +149,7 @@ Threshold decisions and recovery use the canonical session projection. When Atom
|
|
|
117
149
|
|
|
118
150
|
Atomic uses the session's reasoning level unless a fallback entry specifies its own level. The provider controls the planner's output limit.
|
|
119
151
|
|
|
120
|
-
`settings.retry` controls retries within one model. If
|
|
152
|
+
`settings.retry` controls recoverable-error retries within one chat model, including a policy-refusal summary fallback. Policy refusals are not retried. If compaction fails, Atomic tries configured `settings.fallbackModels` in order, using each model's own credentials and skipping the selected compaction model if listed again. Unavailable credentials do not prevent trying later models. Borrowing does not change the chat model, thinking level, or model-selection events.
|
|
121
153
|
|
|
122
154
|
When every configured model is exhausted, what happens depends on how much the caller can afford to lose:
|
|
123
155
|
|
|
@@ -262,7 +294,7 @@ When prompted, choose one of:
|
|
|
262
294
|
2. summarize with the default prompt
|
|
263
295
|
3. summarize with custom focus instructions
|
|
264
296
|
|
|
265
|
-
Branch summaries are separate from `/compact`: branch navigation
|
|
297
|
+
Branch summaries are separate from `/compact`: branch navigation generates summary prose, while normal verbatim compaction selects per-message line ranges and reconstructs retained text mechanically. A chat compaction policy refusal can trigger pi's summary compaction as described above.
|
|
266
298
|
|
|
267
299
|
Use the [Compaction reference](/compaction/reference) for extension hooks and saved formats.
|
|
268
300
|
|
package/docs/docs.json
CHANGED
|
@@ -18,6 +18,10 @@ UI methods for user interaction. See [Custom UI](/extensions/ui#custom-ui) for f
|
|
|
18
18
|
|
|
19
19
|
`false` in print mode (`-p`) and JSON mode. `true` in interactive and RPC mode. In RPC mode, dialog methods (`select`, `confirm`, `input`, `editor`) work via the extension UI sub-protocol, and fire-and-forget methods (`notify`, `setStatus`, `setWidget`, `setTitle`, `setEditorText`) emit requests to the client. Some TUI-specific methods are no-ops or return defaults (see [RPC mode](/rpc/extension-ui#extension-ui-protocol)).
|
|
20
20
|
|
|
21
|
+
### ctx.isPresentationOnly
|
|
22
|
+
|
|
23
|
+
`true` in the local presentation host when the isolated interactive engine owns execution. Keep UI registration active, but skip background execution and durable recovery in lifecycle hooks in this context to avoid starting the same work in both processes. Normal SDK, print, RPC, and engine contexts leave this flag false or unset.
|
|
24
|
+
|
|
21
25
|
### ctx.cwd
|
|
22
26
|
|
|
23
27
|
Current working directory.
|
|
@@ -849,9 +849,9 @@ export default function (pi: ExtensionAPI) {
|
|
|
849
849
|
}
|
|
850
850
|
```
|
|
851
851
|
|
|
852
|
-
Frames are ordinary objects with a `{ epoch: string, revision: number }` cursor. Revisions increase within an epoch; lifecycle publication may leave gaps between activity revisions. A new publisher starts a new epoch and an `unavailable` snapshot. Never compare revision numbers across epochs. A `ready` snapshot has a `roots` array, including an empty array when known empty. `recovering` and `unavailable` snapshots omit `roots`. Subsequent snapshots replace all prior knowledge. Changes replace a complete root, not increment counters. Removals contain `rootRunId`. Root summaries include `state`, `reason`, execution/wait counts, and `needsAttention`.
|
|
852
|
+
Frames are ordinary objects with a `{ epoch: string, revision: number }` cursor. Revisions increase within an epoch; lifecycle publication may leave gaps between activity revisions. A new publisher starts a new epoch and an `unavailable` snapshot. Never compare revision numbers across epochs. A `ready` snapshot has a `roots` array, including an empty array when known empty. `recovering` and `unavailable` snapshots omit `roots`. Subsequent snapshots replace all prior knowledge. Changes replace a complete root, not increment counters. Removals contain `rootRunId`. Root summaries include `state`, `reason`, execution/wait counts, and `needsAttention`. Roots published by the workflows extension also carry an optional `graph: { nodes }`. It holds the root's expanded workflow graph, including the nodes of nested child workflows. Each node is a `stage` or `tool` node with `id`, `runId`, `nodeId`, `name`, `status`, `parentIds`, `depth`, and `executionOrder` when it is known. Tool nodes add their `ordinal`. Stages waiting on a prompt add `pendingPrompt` (`id`, `kind`, `message`, `choices`, `createdAt`). Prompts raised by a run rather than a stage appear in `graph.runPrompts`, each with the same fields plus its `runId`. A node status change publishes a `changed` frame. Treat `graph` as optional, because other publishers may omit it.
|
|
853
853
|
|
|
854
|
-
The workflows extension also calls `pi.registerWorkflowRunControl(control)` to back `session.workflows`, the typed pause, quit, and resume API for SDK hosts (see [Workflow run control](/sdk#workflow-run-control)). The registration is released with the extension generation, and only the most recent registration is active.
|
|
854
|
+
The workflows extension also calls `pi.registerWorkflowRunControl(control)` with a `WorkflowRunControl` to back `session.workflows`, the typed pause, quit, and resume API for SDK hosts (see [Workflow run control](/sdk#workflow-run-control)). SDK hosts follow this same activity stream through `session.workflows.observe(observer)`. The registration is released with the extension generation, and only the most recent registration is active.
|
|
855
855
|
|
|
856
856
|
Providers call `pi.registerWorkflowActivityPublisher()` and retain its returned `WorkflowActivityPublisher`. Its methods are `publishSnapshot({ availability: "ready", roots })`, `publishSnapshot({ availability: "recovering" | "unavailable" })`, `publishChanged(root)`, `publishRemoved(rootRunId)`, `publishLifecycle(event)`, `publishHeartbeat(event)`, and `dispose()`. Lifecycle input includes `type: "workflow_lifecycle"` and the envelope except `cursor`, which the host supplies. Heartbeat input includes `type: "workflow_heartbeat"`. IDs, names, timestamps, zero counts and optional attribution are preserved. Roots are keyed by `rootRunId`; duplicate snapshot IDs use the last value at the first insertion position. Removing an absent ID is permitted. Changes do not turn an unknown source into `ready`; publish a snapshot to establish readiness.
|
|
857
857
|
|
package/docs/providers.md
CHANGED
|
@@ -14,6 +14,8 @@ This page is provider setup: subscriptions, API keys, provider-specific configur
|
|
|
14
14
|
- [Auth File](#auth-file)
|
|
15
15
|
- [Provider Specific Config](#provider-specific-config)
|
|
16
16
|
- [llama.cpp](#llama-cpp)
|
|
17
|
+
- [TypeSafe Jev](#typesafe-jev)
|
|
18
|
+
- [Morph compaction](#morph-compaction)
|
|
17
19
|
- [Stop Reasons](/providers/reference#stop-reasons)
|
|
18
20
|
- [Resolution Order](/providers/reference#resolution-order)
|
|
19
21
|
- [Custom Providers](#custom-providers)
|
|
@@ -230,6 +232,7 @@ Catalog failures preserve the last usable models for each provider. See [catalog
|
|
|
230
232
|
| Radius | `RADIUS_API_KEY` | `radius` |
|
|
231
233
|
| Hugging Face | `HF_TOKEN` | `huggingface` |
|
|
232
234
|
| TypeSafe Jev | `TYPESAFE_API_KEY` | `typesafe` |
|
|
235
|
+
| Morph | `MORPH_API_KEY` | `morph` |
|
|
233
236
|
| Fireworks | `FIREWORKS_API_KEY` | `fireworks` |
|
|
234
237
|
| Together AI | `TOGETHER_API_KEY` | `together` |
|
|
235
238
|
| Baseten | `BASETEN_API_KEY` | `baseten` |
|
|
@@ -570,7 +573,7 @@ For router-mode discovery, load/unload management, and Hugging Face downloads wi
|
|
|
570
573
|
|
|
571
574
|
## TypeSafe Jev
|
|
572
575
|
|
|
573
|
-
`typesafe/jev-latest` is the built-in TypeSafe classifier. Name it explicitly in `routerModel`, `structured_output`, or `generateStructuredOutput()` when you want it. An unset or `auto` router uses the current chat model; saved credentials do not select a classifier. Jev is never an execution `auto` candidate, chat `--model`, or `/model` choice. Any other classifier works the same way only when the current model registry lists it. A models.dev listing does not register a classifier.
|
|
576
|
+
`typesafe/jev-latest` is the built-in TypeSafe classifier. Name it explicitly in `compactionModel`, `routerModel`, `structured_output`, or `generateStructuredOutput()` when you want it. An unset or `auto` compaction model or router uses the current chat model; saved credentials do not select a classifier. Jev is never an execution `auto` candidate, chat `--model`, or `/model` choice. Any other classifier works the same way only when the current model registry lists it. A models.dev listing does not register a classifier. See [Compaction model](/compaction#compaction-model) for verbatim classifier compaction.
|
|
574
577
|
|
|
575
578
|
Use `/login typesafe` to save an API key under `typesafe` in `auth.json`, or set `TYPESAFE_API_KEY` in Atomic's process environment. Stored credentials take precedence over the environment key. `/logout typesafe` removes the saved TypeSafe credential; an environment key remains active until you unset it. Jev appears in `/login` but not `/model`, because it only makes structured decisions. Do not put the key in prompts, decision state, or `settings.json`.
|
|
576
579
|
|
|
@@ -582,6 +585,14 @@ Routers send one classify request for a registered classifier and can repair a m
|
|
|
582
585
|
|
|
583
586
|
HTTP 401 means check the key saved through `/login typesafe` or `TYPESAFE_API_KEY`, 422 means check the question/state contract, and 429 or 529 means wait before retrying explicitly. Configured credentials do not verify access or quota. See [TypeSafe's API](https://docs.typesafe.ai/api.md) and [Choice reference](https://docs.typesafe.ai/primitives/choice.md).
|
|
584
587
|
|
|
588
|
+
## Morph compaction
|
|
589
|
+
|
|
590
|
+
Use `/login morph` to save a Morph API key under `morph` in `~/.atomic/agent/auth.json`, or set `MORPH_API_KEY` in Atomic's process environment. Stored credentials take precedence over the environment key. Do not put the key in prompts or `settings.json`.
|
|
591
|
+
|
|
592
|
+
Then choose `morph/morph-compactor` through `/settings` → **Compaction model**, or set `"compactionModel": "morph/morph-compactor"` in global settings. Without credentials, the selector marks it as `requires /login morph`. Morph receives the compactable transcript, including serialized thinking; the preserved recent tail is not sent. Atomic retains the original surviving lines and enforces `<keepContext>` protection. Choose Morph only if it is permitted to receive your transcript.
|
|
593
|
+
|
|
594
|
+
Morph is a compactor, not a chat model. It does not appear in `/model` or automatic model routing. Project settings cannot select `morph/*`. Missing credentials, HTTP errors, policy refusals, or unusable results advance directly to your configured fallback models without a Morph summary request. `/logout morph` removes the saved credential; an environment key remains active until you unset it. See [Compaction model](/compaction#compaction-model).
|
|
595
|
+
|
|
585
596
|
## Custom Providers
|
|
586
597
|
|
|
587
598
|
**Via models.json:** Add Ollama, LM Studio, vLLM, or any provider that speaks a supported API (OpenAI Completions, OpenAI Responses, Anthropic Messages, Google Generative AI). See [Custom models](/models).
|
package/docs/sdk/reference.md
CHANGED
|
@@ -845,12 +845,27 @@ generateDiffString
|
|
|
845
845
|
generateUnifiedPatch
|
|
846
846
|
type EditDiffResult
|
|
847
847
|
|
|
848
|
+
// Session output
|
|
849
|
+
createTranscript
|
|
850
|
+
type Transcript
|
|
851
|
+
type TranscriptOptions
|
|
852
|
+
type TranscriptPart
|
|
853
|
+
|
|
848
854
|
// Session management
|
|
849
855
|
SessionManager
|
|
850
856
|
SettingsManager
|
|
851
857
|
|
|
852
|
-
// Workflow run control (session.workflows)
|
|
858
|
+
// Workflow run control and observation (session.workflows)
|
|
853
859
|
type SessionWorkflows
|
|
860
|
+
type WorkflowRunControl
|
|
861
|
+
type WorkflowActivityFrame
|
|
862
|
+
type WorkflowActivityObserver
|
|
863
|
+
type WorkflowActivitySubscription
|
|
864
|
+
type WorkflowRootActivity
|
|
865
|
+
type WorkflowRootGraph
|
|
866
|
+
type WorkflowGraphNode
|
|
867
|
+
type WorkflowGraphNodePrompt
|
|
868
|
+
type WorkflowGraphRunPrompt
|
|
854
869
|
type WorkflowRunSummary
|
|
855
870
|
type WorkflowRunDetail
|
|
856
871
|
type WorkflowRunControlOutcome
|