@bastani/atomic 0.9.5-alpha.6 → 0.9.5-alpha.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/builtin/cursor/package.json +2 -2
- 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/package.json +1 -1
- package/dist/bun/split-loader.d.ts +2 -0
- package/dist/bun/split-loader.d.ts.map +1 -0
- package/dist/bun/split-loader.js +37 -0
- package/dist/bun/split-loader.js.map +1 -0
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +6 -4
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session-auto-compaction.d.ts +5 -4
- package/dist/core/agent-session-auto-compaction.d.ts.map +1 -1
- package/dist/core/agent-session-auto-compaction.js +15 -9
- package/dist/core/agent-session-auto-compaction.js.map +1 -1
- package/dist/core/agent-session-extension-bindings.d.ts.map +1 -1
- package/dist/core/agent-session-extension-bindings.js +1 -1
- package/dist/core/agent-session-extension-bindings.js.map +1 -1
- package/dist/core/agent-session-methods.d.ts +1 -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/builtin-packages.d.ts.map +1 -1
- package/dist/core/builtin-packages.js +8 -4
- package/dist/core/builtin-packages.js.map +1 -1
- package/dist/core/copilot-model-catalog.d.ts.map +1 -1
- package/dist/core/copilot-model-catalog.js +3 -2
- package/dist/core/copilot-model-catalog.js.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.d.ts.map +1 -1
- package/dist/core/extensions/loader-virtual-modules.js +8 -3
- package/dist/core/extensions/loader-virtual-modules.js.map +1 -1
- package/dist/core/openai-responses-payload-sanitizer.d.ts +6 -0
- package/dist/core/openai-responses-payload-sanitizer.d.ts.map +1 -0
- package/dist/core/openai-responses-payload-sanitizer.js +59 -0
- package/dist/core/openai-responses-payload-sanitizer.js.map +1 -0
- package/dist/core/package-manager-auto-resources.d.ts +2 -2
- package/dist/core/package-manager-auto-resources.d.ts.map +1 -1
- package/dist/core/package-manager-auto-resources.js +32 -52
- package/dist/core/package-manager-auto-resources.js.map +1 -1
- package/dist/core/package-manager-resolver.d.ts.map +1 -1
- package/dist/core/package-manager-resolver.js +23 -14
- package/dist/core/package-manager-resolver.js.map +1 -1
- package/dist/core/package-manager-resource-collector.d.ts +3 -3
- package/dist/core/package-manager-resource-collector.d.ts.map +1 -1
- package/dist/core/package-manager-resource-collector.js +76 -73
- package/dist/core/package-manager-resource-collector.js.map +1 -1
- package/dist/core/package-manager-resource-files.d.ts +9 -8
- package/dist/core/package-manager-resource-files.d.ts.map +1 -1
- package/dist/core/package-manager-resource-files.js +92 -81
- package/dist/core/package-manager-resource-files.js.map +1 -1
- package/dist/core/prompt-templates-async.d.ts +3 -0
- package/dist/core/prompt-templates-async.d.ts.map +1 -0
- package/dist/core/prompt-templates-async.js +118 -0
- package/dist/core/prompt-templates-async.js.map +1 -0
- package/dist/core/provider-context-usage.d.ts +11 -0
- package/dist/core/provider-context-usage.d.ts.map +1 -0
- package/dist/core/provider-context-usage.js +58 -0
- package/dist/core/provider-context-usage.js.map +1 -0
- package/dist/core/resource-loader-assets.d.ts +3 -3
- package/dist/core/resource-loader-assets.d.ts.map +1 -1
- package/dist/core/resource-loader-assets.js +66 -83
- package/dist/core/resource-loader-assets.js.map +1 -1
- package/dist/core/resource-loader-core.d.ts +1 -1
- package/dist/core/resource-loader-core.d.ts.map +1 -1
- package/dist/core/resource-loader-core.js +5 -5
- package/dist/core/resource-loader-core.js.map +1 -1
- package/dist/core/resource-loader-reload.d.ts.map +1 -1
- package/dist/core/resource-loader-reload.js +43 -7
- package/dist/core/resource-loader-reload.js.map +1 -1
- package/dist/core/resource-loader-types.d.ts +7 -1
- package/dist/core/resource-loader-types.d.ts.map +1 -1
- package/dist/core/resource-loader-types.js.map +1 -1
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +6 -4
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/skills-async.d.ts +3 -0
- package/dist/core/skills-async.d.ts.map +1 -0
- package/dist/core/skills-async.js +269 -0
- package/dist/core/skills-async.js.map +1 -0
- package/dist/main-deferred-startup.d.ts +2 -0
- package/dist/main-deferred-startup.d.ts.map +1 -1
- package/dist/main-deferred-startup.js +2 -0
- package/dist/main-deferred-startup.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-agent-events.js +10 -1
- package/dist/modes/interactive/interactive-agent-events.js.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.d.ts +6 -0
- package/dist/modes/interactive/interactive-deferred-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-deferred-startup.js +27 -13
- package/dist/modes/interactive/interactive-deferred-startup.js.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-editor-actions.js +13 -13
- package/dist/modes/interactive/interactive-editor-actions.js.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-extension-runtime.js +16 -0
- package/dist/modes/interactive/interactive-extension-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-input-handling.js +48 -0
- package/dist/modes/interactive/interactive-input-handling.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode-base.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-base.js +5 -0
- package/dist/modes/interactive/interactive-mode-base.js.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.d.ts +18 -6
- package/dist/modes/interactive/interactive-mode-surface.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode-surface.js.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-model-routing.js +3 -3
- package/dist/modes/interactive/interactive-model-routing.js.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-onboarding.js +1 -0
- package/dist/modes/interactive/interactive-onboarding.js.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-process-lifecycle.js +43 -6
- package/dist/modes/interactive/interactive-process-lifecycle.js.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-render-chat.js +57 -0
- package/dist/modes/interactive/interactive-render-chat.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-disclosure.js +3 -2
- package/dist/modes/interactive/interactive-resource-disclosure.js.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-resource-rendering.js +10 -8
- package/dist/modes/interactive/interactive-resource-rendering.js.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js +1 -1
- package/dist/modes/interactive/interactive-session-runtime.js.map +1 -1
- package/dist/modes/interactive/interactive-startup.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-startup.js +59 -52
- package/dist/modes/interactive/interactive-startup.js.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.d.ts +1 -0
- package/dist/modes/interactive/theme/theme-loading.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme-loading.js +3 -0
- package/dist/modes/interactive/theme/theme-loading.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +1 -1
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +1 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/utils/module-require.d.ts +11 -0
- package/dist/utils/module-require.d.ts.map +1 -1
- package/dist/utils/module-require.js +14 -1
- package/dist/utils/module-require.js.map +1 -1
- package/dist/utils/split-launcher.d.ts +38 -0
- package/dist/utils/split-launcher.d.ts.map +1 -0
- package/dist/utils/split-launcher.js +63 -0
- package/dist/utils/split-launcher.js.map +1 -0
- package/docs/compaction.md +3 -0
- package/docs/keybindings.md +2 -2
- package/docs/providers.md +1 -1
- package/docs/settings.md +2 -2
- package/docs/usage.md +1 -1
- package/npm-shrinkwrap.json +23 -23
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interactive-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAsB,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,uBAAuB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACpiB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,mBAAmB,CAAC,SAAS,CAAC,0BAA0B,GAAG;IACvD,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,I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, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n const changelogMarkdown = this.changelogMarkdown;\n if (!changelogMarkdown && !this.firstRunNoticeVisible) {\n return;\n }\n\n if (changelogMarkdown) {\n if (this.chatContainer.children.length > 0) {\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n this.chatContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n this.chatContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n this.chatContainer.addChild(new Spacer(1));\n this.chatContainer.addChild(\n new Markdown(\n changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n this.chatContainer.addChild(new Spacer(1));\n }\n this.chatContainer.addChild(new DynamicBorder());\n }\n\n if (this.firstRunNoticeVisible) {\n this.firstRunOnboardingNoticeComponents = [];\n if (this.chatContainer.children.length > 0) {\n this.firstRunOnboardingNoticeComponents.push(new Spacer(1));\n }\n this.firstRunOnboardingNoticeComponents.push(\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n );\n for (const component of this.firstRunOnboardingNoticeComponents) {\n this.chatContainer.addChild(component);\n }\n // Mark completion only after queueing the notice in the chat canvas so\n // launches that skip rendering retry the first-run notice next time.\n this.settingsManager.setOnboardedVersion(this.version);\n }\n\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n this.initializeFirstRunOnboardingMarkers();\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunNoticeVisible = this.isFirstRunOnboardingEligible();\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // Initialize extensions first so resources are shown before messages\n await this.rebindCurrentSession();\n\n // Render initial messages AFTER showing loaded resources\n this.renderInitialMessages();\n\n // Extensions were skipped before first paint; finish loading them in the background.\n if (this.deferredStartupPending) {\n this.deferredStartupPromise = this.completeDeferredStartup();\n }\n\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n // Load GitHub Copilot context-window tiers from CAPI early (gated on the Copilot provider) so\n // the footer and /model picker reflect GitHub's real windows. Best-effort, never blocks startup.\n void this.refreshCopilotModelCatalog();\n\n // Start version check asynchronously\n checkForNewPiVersion(this.version).then((newVersion) => {\n if (newVersion) {\n this.showNewVersionNotification(newVersion);\n }\n });\n\n // Start package update check asynchronously\n this.checkForPackageUpdates().then((updates) => {\n if (updates.length > 0) {\n this.showPackageUpdateNotification(updates);\n }\n });\n\n // Check tmux keyboard setup asynchronously\n this.checkTmuxKeyboardSetup().then((warning) => {\n if (warning) {\n this.showWarning(warning);\n }\n });\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage && !this.deferredStartupPromise) {\n // With a deferred extension load, model restore is retried once extension\n // providers register; completeDeferredStartup shows the warning if it still fails.\n this.showWarning(modelFallbackMessage);\n }\n\n void this.maybeWarnAboutAnthropicSubscriptionAuth();\n\n // Prompts need extension tools; wait for the background load before sending any.\n if (this.deferredStartupPromise) {\n await this.deferredStartupPromise;\n }\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n try {\n await this.session.prompt(userInput);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
|
|
1
|
+
{"version":3,"file":"interactive-startup.js","sourceRoot":"","sources":["../../../src/modes/interactive/interactive-startup.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AACjE,OAAO,EAAsC,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,6BAA6B,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,yBAAyB,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,aAAa,EAAE,uBAAuB,EAAE,cAAc,EAAE,kBAAkB,EAAE,cAAc,EAAE,oBAAoB,EAAE,UAAU,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,aAAa,EAAE,gBAAgB,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,4BAA4B,CAAC;AACpjB,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAE9D,mBAAmB,CAAC,SAAS,CAAC,0BAA0B,GAAG,UAAoC,eAAe,GAAc,IAAI,CAAC,aAAa;IAC1I,IAAI,IAAI,CAAC,mBAAmB,EAAE,CAAC;QAC7B,OAAO;IACT,CAAC;IACD,IAAI,CAAC,mBAAmB,GAAG,IAAI,CAAC;IAEhC,MAAM,iBAAiB,GAAG,IAAI,CAAC,iBAAiB,CAAC;IACjD,IAAI,CAAC,iBAAiB,IAAI,CAAC,IAAI,CAAC,q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AwB,GAAG;IACrD,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,IAAI,CAAC,kBAAkB,CAAC;AACzD,CAAC,CAAC","sourcesContent":["import { InteractiveModeBase } from \"./interactive-mode-base.ts\";\nimport { type Container, type MarkdownTheme, os, path, Markdown, Spacer, Text, spawn, APP_NAME, APP_TITLE, ENV_OFFLINE, getEnvValue, getAgentDir, VERSION, formatCodexFastModeModelLabel, shouldApplyCodexFastMode, DefaultPackageManager, isInstallTelemetryEnabled, getChangelogPath, getEntriesForVersion, getNewEntries, normalizeChangelogLinks, parseChangelog, getCwdRelativePath, getPiUserAgent, recordTimeSinceReset, ensureTool, checkForNewPiVersion, renderAtomicAnsiBanner, DynamicBorder, getMarkdownTheme, onThemeChange, theme } from \"./interactive-mode-deps.ts\";\nimport { ExpandableText } from \"./interactive-mode-helpers.ts\";\nimport { ONBOARDING_COPY } from \"./interactive-onboarding.ts\";\n\nInteractiveModeBase.prototype.showStartupNoticesIfNeeded = function(this: InteractiveModeBase, targetContainer: Container = this.chatContainer): void {\n if (this.startupNoticesShown) {\n return;\n }\n this.startupNoticesShown = true;\n\n const changelogMarkdown = this.changelogMarkdown;\n if (!changelogMarkdown && !this.firstRunNoticeVisible) {\n return;\n }\n\n if (changelogMarkdown) {\n if (targetContainer.children.length > 0) {\n targetContainer.addChild(new Spacer(1));\n }\n targetContainer.addChild(new DynamicBorder());\n if (this.settingsManager.getCollapseChangelog()) {\n const versionMatch = changelogMarkdown.match(\n /##\\s+\\[?((?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)\\.(?:0|[1-9]\\d*)(?:-(?:alpha\\.)?(?:0|[1-9]\\d*))?)\\]?/,\n );\n const latestVersion = versionMatch ? versionMatch[1] : this.version;\n const condensedText = `Updated to v${latestVersion}. Use ${theme.bold(\"/changelog\")} to view full changelog.`;\n targetContainer.addChild(new Text(condensedText, 1, 0));\n } else {\n targetContainer.addChild(\n new Text(theme.bold(theme.fg(\"accent\", \"What's New\")), 1, 0),\n );\n targetContainer.addChild(new Spacer(1));\n targetContainer.addChild(\n new Markdown(\n changelogMarkdown.trim(),\n 1,\n 0,\n this.getMarkdownThemeWithSettings(),\n ),\n );\n targetContainer.addChild(new Spacer(1));\n }\n targetContainer.addChild(new DynamicBorder());\n }\n\n if (this.firstRunNoticeVisible) {\n this.firstRunOnboardingNoticeComponents = [];\n if (targetContainer.children.length > 0) {\n this.firstRunOnboardingNoticeComponents.push(new Spacer(1));\n }\n this.firstRunOnboardingNoticeComponents.push(\n new DynamicBorder(),\n new Text(ONBOARDING_COPY, 1, 0),\n new DynamicBorder(),\n new Spacer(1),\n );\n for (const component of this.firstRunOnboardingNoticeComponents) {\n targetContainer.addChild(component);\n }\n // Mark completion only after queueing the notice in the chat canvas so\n // launches that skip rendering retry the first-run notice next time.\n this.settingsManager.setOnboardedVersion(this.version);\n }\n\n this.ui.requestRender();\n };\n\nInteractiveModeBase.prototype.init = async function(this: InteractiveModeBase): Promise<void> {\n if (this.isInitialized) return;\n\n this.registerSignalHandlers();\n\n // Load changelog (only show new entries, skip for resumed sessions)\n this.hadLastChangelogVersionAtStartup = Boolean(this.settingsManager.getLastChangelogVersion());\n this.changelogMarkdown = this.getChangelogForDisplay();\n this.initializeFirstRunOnboardingMarkers();\n\n // Add header container as first child. Populate it after theme initialization.\n this.ui.addChild(this.headerContainer);\n\n this.ui.addChild(this.chatContainer);\n this.ui.addChild(this.pendingMessagesContainer);\n this.ui.addChild(this.statusContainer);\n this.renderWidgets(); // Initialize with default spacer\n this.ui.addChild(this.widgetContainerAbove);\n this.ui.addChild(this.usageMeter);\n this.ui.addChild(this.editorContainer);\n // Footer (persistent model + cwd identity) stays pinned directly under the\n // editor; below-editor widgets render after it, at the very bottom. This\n // keeps the session identity line attached to the input and places\n // transient run status (e.g. the workflow companion counter) beneath it.\n // Rendering below-editor widgets last also keeps a live widget at the\n // absolute bottom of the buffer (always within the viewport), so its\n // per-tick updates never sit above the fold — preserving the #1109\n // resize-flicker fix.\n this.ui.addChild(this.footer);\n this.ui.addChild(this.widgetContainerBelow);\n this.ui.setFocus(this.editor);\n\n this.setupKeyHandlers();\n this.setupEditorSubmitHandler();\n\n this.firstRunNoticeVisible = this.isFirstRunOnboardingEligible();\n\n // Start the UI before initializing extensions so session_start handlers can use interactive dialogs.\n // fd/rg readiness is intentionally checked after first paint because ensureTool may spawn\n // or download tools on cold machines.\n this.ui.start();\n recordTimeSinceReset(\"time-to-first-frame\");\n this.isInitialized = true;\n\n await this.themeController.applyFromSettings();\n\n // Add the quiet startup identity (unless silenced). Resource details are\n // disclosed separately in the chat canvas via the tools/resources toggle.\n if (this.options.verbose || !this.settingsManager.getQuietStartup()) {\n this.builtInHeader = new ExpandableText(\n () => this.getStartupIdentityText(),\n () => this.getStartupIdentityText(),\n this.getStartupExpansionState(),\n 1,\n 0,\n );\n\n this.headerContainer.addChild(new Spacer(1));\n this.headerContainer.addChild(this.builtInHeader);\n this.headerContainer.addChild(new Spacer(1));\n } else {\n // Minimal header when silenced\n this.builtInHeader = new Text(\"\", 0, 0);\n this.headerContainer.addChild(this.builtInHeader);\n }\n this.ui.requestRender();\n\n void Promise.all([ensureTool(\"fd\"), ensureTool(\"rg\")])\n .then(([fdPath]) => {\n this.fdPath = fdPath;\n this.setupAutocompleteProvider();\n })\n .catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Tool readiness check failed: ${message}`);\n });\n\n // When startup resources are deferred, keep the already-painted editor responsive.\n // Extension UI bindings are installed at the deferred reload boundary, not here,\n // so no post-paint resource work can block visible typing.\n if (this.deferredStartupPending) {\n this.applyRuntimeSettings();\n this.subscribeToAgent();\n this.updateEditorBorderColor();\n this.updateTerminalTitle();\n } else {\n await this.rebindCurrentSession();\n }\n\n this.attachStartupNoticesContainer();\n // Render initial messages AFTER the initial session binding is in place.\n this.renderInitialMessages();\n\tif (this.deferredStartupPending) {\n\t\tsetTimeout(() => {\n\t\t\tif (!this.deferredStartupPending || this.deferredStartupPromise) return;\n\t\t\tvoid this.ensureDeferredStartupComplete();\n\t\t}, 2000);\n\t}\n // Set up theme file watcher\n onThemeChange(() => {\n this.ui.invalidate();\n this.updateEditorBorderColor();\n this.ui.requestRender();\n });\n\n // Set up git branch watcher (uses provider instead of footer)\n this.footerDataProvider.onBranchChange(() => {\n this.ui.requestRender();\n });\n\n // Initialize available provider count for footer display without delaying first-frame startup.\n void this.updateAvailableProviderCount().catch((error) => {\n const message = error instanceof Error ? error.message : String(error);\n console.error(`Failed to update provider count: ${message}`);\n });\n };\n\nInteractiveModeBase.prototype.updateTerminalTitle = function(this: InteractiveModeBase): void {\n const cwdBasename = path.basename(this.sessionManager.getCwd());\n const sessionName = this.sessionManager.getSessionName();\n if (sessionName) {\n this.ui.terminal.setTitle(\n `${APP_TITLE} - ${sessionName} - ${cwdBasename}`,\n );\n } else {\n this.ui.terminal.setTitle(`${APP_TITLE} - ${cwdBasename}`);\n }\n };\n\nInteractiveModeBase.prototype.run = async function(this: InteractiveModeBase): Promise<void> {\n await this.init();\n\n\tsetTimeout(() => {\n\t\tvoid this.refreshCopilotModelCatalog();\n const startupNoticesContainer = this.startupNoticesContainer;\n\t\tcheckForNewPiVersion(this.version).then((newVersion) => {\n\t\t\tif (newVersion) this.showNewVersionNotification(newVersion, startupNoticesContainer);\n\t\t});\n\t\tthis.checkForPackageUpdates().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// When startup is deferred, the RESOURCES disclosure renders after the\n\t\t// deferred extension load; hold the subscription warning until then so\n\t\t// the disclosure always appears first.\n\t\tif (!this.deferredStartupPending && !this.deferredStartupPromise && !this.pendingLoadedResourcesDisclosure) {\n\t\t\tvoid this.maybeWarnAboutAnthropicSubscriptionAuth(undefined, startupNoticesContainer);\n\t\t}\n\t}, 500);\n\n // Show startup warnings\n const {\n migratedProviders,\n modelFallbackMessage,\n initialMessage,\n initialImages,\n initialMessages,\n } = this.options;\n\n if (migratedProviders && migratedProviders.length > 0) {\n this.showWarning(\n `Migrated credentials to auth.json: ${migratedProviders.join(\", \")}`,\n );\n }\n\n const modelsJsonError = this.session.modelRegistry.getError();\n if (modelsJsonError) {\n this.showError(`models.json error: ${modelsJsonError}`);\n }\n\n if (modelFallbackMessage && !this.deferredStartupPending) {\n this.showWarning(modelFallbackMessage, this.startupNoticesContainer);\n }\n\n // CLI-provided startup prompts need extension tools/resources; wait before sending them,\n // but do not block the normal no-prompt input loop from becoming ready.\n if (this.deferredStartupPending && (initialMessage || (initialMessages && initialMessages.length > 0))) {\n await this.ensureDeferredStartupComplete();\n }\n\n // Process initial messages\n if (initialMessage) {\n try {\n await this.session.prompt(initialMessage, { images: initialImages });\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n\n if (initialMessages) {\n for (const message of initialMessages) {\n try {\n await this.session.prompt(message);\n } catch (error: unknown) {\n const errorMessage =\n error instanceof Error ? error.message : \"Unknown error occurred\";\n this.showError(errorMessage);\n }\n }\n }\n\n // Main interactive loop\n while (true) {\n const userInput = await this.getUserInput();\n await this.runUserPromptTurn(userInput);\n }\n };\n\nInteractiveModeBase.prototype.checkForPackageUpdates = async function(this: InteractiveModeBase): Promise<string[]> {\n if (getEnvValue(ENV_OFFLINE)) {\n return [];\n }\n\n try {\n const packageManager = new DefaultPackageManager({\n cwd: this.sessionManager.getCwd(),\n agentDir: getAgentDir(),\n settingsManager: this.settingsManager,\n });\n const updates = await packageManager.checkForAvailableUpdates();\n return updates.map((update) => update.displayName);\n } catch {\n return [];\n }\n };\n\nInteractiveModeBase.prototype.checkTmuxKeyboardSetup = async function(this: InteractiveModeBase): Promise<string | undefined> {\n if (!process.env.TMUX) return undefined;\n\n const runTmuxShow = (option: string): Promise<string | undefined> => {\n return new Promise((resolve) => {\n const proc = spawn(\"tmux\", [\"show\", \"-gv\", option], {\n stdio: [\"ignore\", \"pipe\", \"ignore\"],\n });\n let stdout = \"\";\n const timer = setTimeout(() => {\n proc.kill();\n resolve(undefined);\n }, 2000);\n\n proc.stdout?.on(\"data\", (data) => {\n stdout += data.toString();\n });\n proc.on(\"error\", () => {\n clearTimeout(timer);\n resolve(undefined);\n });\n proc.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve(code === 0 ? stdout.trim() : undefined);\n });\n });\n };\n\n const [extendedKeys, extendedKeysFormat] = await Promise.all([\n runTmuxShow(\"extended-keys\"),\n runTmuxShow(\"extended-keys-format\"),\n ]);\n\n // If we couldn't query tmux (timeout, sandbox, etc.), don't warn\n if (extendedKeys === undefined) return undefined;\n\n if (extendedKeys !== \"on\" && extendedKeys !== \"always\") {\n return \"tmux extended-keys is off. Modified enter keys may not work. Add `set -g extended-keys on` to ~/.tmux.conf and restart tmux.\";\n }\n\n if (extendedKeysFormat === \"xterm\") {\n return \"tmux extended-keys-format is xterm. Pi works best with csi-u. Add `set -g extended-keys-format csi-u` to ~/.tmux.conf and restart tmux.\";\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.getChangelogForDisplay = function(this: InteractiveModeBase): string | undefined {\n // Skip changelog for resumed/continued sessions (already have messages)\n if (this.session.state.messages.length > 0) {\n return undefined;\n }\n\n const lastVersion = this.settingsManager.getLastChangelogVersion();\n const changelogPath = getChangelogPath();\n const entries = parseChangelog(changelogPath);\n\n if (!lastVersion) {\n // Fresh install - record the version, send telemetry, don't show changelog\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return undefined;\n }\n\n const newEntries = getNewEntries(entries, lastVersion, VERSION);\n const currentEntries = getEntriesForVersion(newEntries, VERSION);\n if (currentEntries.length > 0) {\n this.settingsManager.setLastChangelogVersion(VERSION);\n this.reportInstallTelemetry(VERSION);\n return currentEntries.map((e) => normalizeChangelogLinks(e.content, e)).join(\"\\n\\n\");\n }\n\n return undefined;\n };\n\nInteractiveModeBase.prototype.reportInstallTelemetry = function(this: InteractiveModeBase, version: string): void {\n if (getEnvValue(ENV_OFFLINE)) {\n return;\n }\n\n if (!isInstallTelemetryEnabled(this.settingsManager)) {\n return;\n }\n\n void fetch(\n `https://pi.dev/api/report-install?version=${encodeURIComponent(version)}`,\n {\n headers: {\n \"User-Agent\": getPiUserAgent(version),\n },\n signal: AbortSignal.timeout(5000),\n },\n )\n .then(() => undefined)\n .catch(() => undefined);\n };\n\nInteractiveModeBase.prototype.getMarkdownThemeWithSettings = function(this: InteractiveModeBase): MarkdownTheme {\n return {\n ...getMarkdownTheme(),\n codeBlockIndent: this.settingsManager.getCodeBlockIndent(),\n };\n };\n\nInteractiveModeBase.prototype.formatDisplayPath = function(this: InteractiveModeBase, p: string): string {\n const home = os.homedir();\n let result = p;\n\n // Replace home directory with ~\n if (result.startsWith(home)) {\n result = `~${result.slice(home.length)}`;\n }\n\n return result;\n };\n\nInteractiveModeBase.prototype.formatExtensionDisplayPath = function(this: InteractiveModeBase, path: string): string {\n let result = this.formatDisplayPath(path);\n result = result.replace(/\\/index\\.ts$/, \"\").replace(/\\/index\\.js$/, \"\");\n return result;\n };\n\nInteractiveModeBase.prototype.formatContextPath = function(this: InteractiveModeBase, p: string): string {\n const cwd = path.resolve(this.sessionManager.getCwd());\n const absolutePath = path.isAbsolute(p)\n ? path.resolve(p)\n : path.resolve(cwd, p);\n const relativePath = getCwdRelativePath(absolutePath, cwd);\n if (relativePath !== undefined) {\n return relativePath;\n }\n\n return this.formatDisplayPath(absolutePath);\n };\n\nInteractiveModeBase.prototype.getStartupModelLabel = function(this: InteractiveModeBase): string {\n const model = this.session.state.model;\n let modelLabel = model?.id ?? \"no-model\";\n\n if (model?.reasoning) {\n modelLabel = `${modelLabel} ${this.session.thinkingLevel || \"off\"}`;\n }\n\n if (!model) {\n return modelLabel;\n }\n\n const fastModeEnabled = shouldApplyCodexFastMode(\n model,\n this.session.settingsManager.getCodexFastModeSettings(),\n this.session.orchestrationContext,\n );\n return formatCodexFastModeModelLabel(modelLabel, fastModeEnabled);\n };\n\nInteractiveModeBase.prototype.getStartupIdentityText = function(this: InteractiveModeBase): string {\n const appLabel = APP_NAME.length > 0\n ? `${APP_NAME[0]!.toUpperCase()}${APP_NAME.slice(1)}`\n : \"Atomic\";\n const title = `${theme.bold(theme.fg(\"text\", appLabel))} ${theme.fg(\"muted\", `v${this.version}`)}`;\n const model = this.session.state.model;\n const provider = model ? theme.fg(\"dim\", `(${model.provider})`) : theme.fg(\"dim\", \"(no-provider)\");\n const modelLine = `${provider} ${theme.fg(\"muted\", this.getStartupModelLabel())}`;\n const cwd = theme.fg(\"muted\", this.formatDisplayPath(this.sessionManager.getCwd()));\n const metaLines = [title, modelLine, cwd];\n const markLines = this.getAtomicAnsiMarkLines();\n\n return markLines\n .map((line, index) => `${line} ${metaLines[index] ?? \"\"}`.trimEnd())\n .join(\"\\n\");\n };\n\nInteractiveModeBase.prototype.getAtomicAnsiMarkLines = function(this: InteractiveModeBase): string[] {\n return renderAtomicAnsiBanner(theme, this.session.thinkingLevel || \"off\");\n };\n\nInteractiveModeBase.prototype.getStartupExpansionState = function(this: InteractiveModeBase): boolean {\n return this.options.verbose || this.toolOutputExpanded;\n };\n"]}
|
|
@@ -10,6 +10,7 @@ export declare function getAvailableThemes(): string[];
|
|
|
10
10
|
export declare function getAvailableThemesWithPaths(): ThemeInfo[];
|
|
11
11
|
export declare function loadThemeJson(name: string): ThemeJson;
|
|
12
12
|
export declare function loadThemeFromPath(themePath: string, mode?: ColorMode): Theme;
|
|
13
|
+
export declare function loadThemeFromContent(themePath: string, content: string, mode?: ColorMode): Theme;
|
|
13
14
|
export declare function loadTheme(name: string, mode?: ColorMode): Theme;
|
|
14
15
|
export declare function getThemeByName(name: string): Theme | undefined;
|
|
15
16
|
export declare function setRegisteredThemes(themes: Theme[]): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-loading.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-loading.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAiC,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAe5D;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED,wBAAgB,2BAA2B,IAAI,SAAS,EAAE,CAyBzD;AA2BD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAoBrD;AA4BD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,
|
|
1
|
+
{"version":3,"file":"theme-loading.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-loading.ts"],"names":[],"mappings":"AAGA,OAAO,EAAmB,KAAK,SAAS,EAAsB,MAAM,kBAAkB,CAAC;AAEvF,OAAO,EAAE,KAAK,EAAiC,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAKnD,MAAM,WAAW,SAAS;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CACzB;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAe5D;AAED,wBAAgB,kBAAkB,IAAI,MAAM,EAAE,CAE7C;AAED,wBAAgB,2BAA2B,IAAI,SAAS,EAAE,CAyBzD;AA2BD,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAoBrD;AA4BD,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAG5E;AAED,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAGhG;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,SAAS,GAAG,KAAK,CAO/D;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAM9D;AAED,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,KAAK,EAAE,GAAG,IAAI,CAQzD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAEnE","sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { getCustomThemesDir, getThemesDir } from \"../../../config.ts\";\nimport { detectColorMode, type ColorMode, resolveThemeColors } from \"./color-utils.ts\";\nimport { assertThemeNameIsValid, parseThemeJsonContent } from \"./theme-parse.ts\";\nimport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nimport type { ThemeJson } from \"./theme-schema.ts\";\n\nlet BUILTIN_THEMES: Record<string, ThemeJson> | undefined;\nconst registeredThemes = new Map<string, Theme>();\n\nexport interface ThemeInfo {\n\tname: string;\n\tpath: string | undefined;\n}\n\nexport function getBuiltinThemes(): Record<string, ThemeJson> {\n\tif (!BUILTIN_THEMES) {\n\t\tconst themesDir = getThemesDir();\n\t\tconst themes: Record<string, ThemeJson> = {};\n\t\tfor (const file of fs.readdirSync(themesDir).sort()) {\n\t\t\tif (!file.endsWith(\".json\") || file === \"theme-schema.json\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst themePath = path.join(themesDir, file);\n\t\t\tconst themeJson = parseThemeJsonContent(themePath, fs.readFileSync(themePath, \"utf-8\"));\n\t\t\tthemes[themeJson.name] = themeJson;\n\t\t}\n\t\tBUILTIN_THEMES = themes;\n\t}\n\treturn BUILTIN_THEMES;\n}\n\nexport function getAvailableThemes(): string[] {\n\treturn getAvailableThemesWithPaths().map(({ name }) => name);\n}\n\nexport function getAvailableThemesWithPaths(): ThemeInfo[] {\n\tconst themesDir = getThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tconst seen = new Set<string>();\n\tconst addTheme = (info: ThemeInfo) => {\n\t\tif (seen.has(info.name)) return;\n\t\tseen.add(info.name);\n\t\tresult.push(info);\n\t};\n\n\t// Built-in themes\n\tfor (const name of Object.keys(getBuiltinThemes())) {\n\t\taddTheme({ name, path: path.join(themesDir, `${name}.json`) });\n\t}\n\n\t// Custom themes\n\tfor (const info of getCustomThemeInfos()) {\n\t\taddTheme(info);\n\t}\n\n\tfor (const [name, theme] of registeredThemes.entries()) {\n\t\taddTheme({ name, path: theme.sourcePath });\n\t}\n\n\treturn result.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nfunction getCustomThemeInfos(): ThemeInfo[] {\n\tconst customThemesDir = getCustomThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tif (!fs.existsSync(customThemesDir)) {\n\t\treturn result;\n\t}\n\n\tfor (const file of fs.readdirSync(customThemesDir)) {\n\t\tif (!file.endsWith(\".json\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst themePath = path.join(customThemesDir, file);\n\t\ttry {\n\t\t\tconst customTheme = loadThemeFromPath(themePath);\n\t\t\tif (customTheme.name) {\n\t\t\t\tresult.push({ name: customTheme.name, path: themePath });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Invalid themes are ignored here; the resource loader reports them\n\t\t\t// during normal startup/reload.\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function loadThemeJson(name: string): ThemeJson {\n\tconst builtinThemes = getBuiltinThemes();\n\tif (name in builtinThemes) {\n\t\treturn builtinThemes[name];\n\t}\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme?.sourcePath) {\n\t\tconst content = fs.readFileSync(registeredTheme.sourcePath, \"utf-8\");\n\t\treturn parseThemeJsonContent(registeredTheme.sourcePath, content);\n\t}\n\tif (registeredTheme) {\n\t\tthrow new Error(`Theme \"${name}\" does not have a source path for export`);\n\t}\n\tconst customThemesDir = getCustomThemesDir();\n\tconst themePath = path.join(customThemesDir, `${name}.json`);\n\tif (!fs.existsSync(themePath)) {\n\t\tthrow new Error(`Theme not found: ${name}`);\n\t}\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn parseThemeJsonContent(name, content);\n}\n\nfunction createTheme(themeJson: ThemeJson, mode?: ColorMode, sourcePath?: string): Theme {\n\tconst colorMode = mode ?? detectColorMode();\n\tconst resolvedColors = resolveThemeColors(themeJson.colors, themeJson.vars);\n\tconst fgColors: Record<ThemeColor, string | number> = {} as Record<ThemeColor, string | number>;\n\tconst bgColors: Record<ThemeBg, string | number> = {} as Record<ThemeBg, string | number>;\n\tconst bgColorKeys: Set<string> = new Set([\n\t\t\"selectedBg\",\n\t\t\"userMessageBg\",\n\t\t\"customMessageBg\",\n\t\t\"toolPendingBg\",\n\t\t\"toolSuccessBg\",\n\t\t\"toolErrorBg\",\n\t]);\n\tfor (const [key, value] of Object.entries(resolvedColors)) {\n\t\tif (bgColorKeys.has(key)) {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn new Theme(fgColors, bgColors, colorMode, {\n\t\tname: themeJson.name,\n\t\tsourcePath,\n\t});\n}\n\nexport function loadThemeFromPath(themePath: string, mode?: ColorMode): Theme {\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn loadThemeFromContent(themePath, content, mode);\n}\n\nexport function loadThemeFromContent(themePath: string, content: string, mode?: ColorMode): Theme {\n\tconst themeJson = parseThemeJsonContent(themePath, content);\n\treturn createTheme(themeJson, mode, themePath);\n}\n\nexport function loadTheme(name: string, mode?: ColorMode): Theme {\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme) {\n\t\treturn registeredTheme;\n\t}\n\tconst themeJson = loadThemeJson(name);\n\treturn createTheme(themeJson, mode);\n}\n\nexport function getThemeByName(name: string): Theme | undefined {\n\ttry {\n\t\treturn loadTheme(name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function setRegisteredThemes(themes: Theme[]): void {\n\tregisteredThemes.clear();\n\tfor (const theme of themes) {\n\t\tif (theme.name) {\n\t\t\tassertThemeNameIsValid(theme.name);\n\t\t\tregisteredThemes.set(theme.name, theme);\n\t\t}\n\t}\n}\n\nexport function setRegisteredTheme(name: string, theme: Theme): void {\n\tregisteredThemes.set(name, theme);\n}\n"]}
|
|
@@ -121,6 +121,9 @@ function createTheme(themeJson, mode, sourcePath) {
|
|
|
121
121
|
}
|
|
122
122
|
export function loadThemeFromPath(themePath, mode) {
|
|
123
123
|
const content = fs.readFileSync(themePath, "utf-8");
|
|
124
|
+
return loadThemeFromContent(themePath, content, mode);
|
|
125
|
+
}
|
|
126
|
+
export function loadThemeFromContent(themePath, content, mode) {
|
|
124
127
|
const themeJson = parseThemeJsonContent(themePath, content);
|
|
125
128
|
return createTheme(themeJson, mode, themePath);
|
|
126
129
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme-loading.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAkB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AACjF,O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,OAAO,CAAC,CAAC;IAC5D,OAAO,WAAW,CAAC,SAAS,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;AAChD,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,IAAY,EAAE,IAAgB;IACvD,MAAM,eAAe,GAAG,gBAAgB,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IACnD,IAAI,eAAe,EAAE,CAAC;QACrB,OAAO,eAAe,CAAC;IACxB,CAAC;IACD,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC;IACtC,OAAO,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,CAAC;AACrC,CAAC;AAED,MAAM,UAAU,cAAc,CAAC,IAAY;IAC1C,IAAI,CAAC;QACJ,OAAO,SAAS,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;IAAC,MAAM,CAAC;QACR,OAAO,SAAS,CAAC;IAClB,CAAC;AACF,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,MAAe;IAClD,gBAAgB,CAAC,KAAK,EAAE,CAAC;IACzB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,EAAE,CAAC;YAChB,sBAAsB,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;YACnC,gBAAgB,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;QACzC,CAAC;IACF,CAAC;AACF,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAY,EAAE,KAAY;IAC5D,gBAAgB,CAAC,GAAG,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;AACnC,CAAC","sourcesContent":["import * as fs from \"node:fs\";\nimport * as path from \"node:path\";\nimport { getCustomThemesDir, getThemesDir } from \"../../../config.ts\";\nimport { detectColorMode, type ColorMode, resolveThemeColors } from \"./color-utils.ts\";\nimport { assertThemeNameIsValid, parseThemeJsonContent } from \"./theme-parse.ts\";\nimport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nimport type { ThemeJson } from \"./theme-schema.ts\";\n\nlet BUILTIN_THEMES: Record<string, ThemeJson> | undefined;\nconst registeredThemes = new Map<string, Theme>();\n\nexport interface ThemeInfo {\n\tname: string;\n\tpath: string | undefined;\n}\n\nexport function getBuiltinThemes(): Record<string, ThemeJson> {\n\tif (!BUILTIN_THEMES) {\n\t\tconst themesDir = getThemesDir();\n\t\tconst themes: Record<string, ThemeJson> = {};\n\t\tfor (const file of fs.readdirSync(themesDir).sort()) {\n\t\t\tif (!file.endsWith(\".json\") || file === \"theme-schema.json\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst themePath = path.join(themesDir, file);\n\t\t\tconst themeJson = parseThemeJsonContent(themePath, fs.readFileSync(themePath, \"utf-8\"));\n\t\t\tthemes[themeJson.name] = themeJson;\n\t\t}\n\t\tBUILTIN_THEMES = themes;\n\t}\n\treturn BUILTIN_THEMES;\n}\n\nexport function getAvailableThemes(): string[] {\n\treturn getAvailableThemesWithPaths().map(({ name }) => name);\n}\n\nexport function getAvailableThemesWithPaths(): ThemeInfo[] {\n\tconst themesDir = getThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tconst seen = new Set<string>();\n\tconst addTheme = (info: ThemeInfo) => {\n\t\tif (seen.has(info.name)) return;\n\t\tseen.add(info.name);\n\t\tresult.push(info);\n\t};\n\n\t// Built-in themes\n\tfor (const name of Object.keys(getBuiltinThemes())) {\n\t\taddTheme({ name, path: path.join(themesDir, `${name}.json`) });\n\t}\n\n\t// Custom themes\n\tfor (const info of getCustomThemeInfos()) {\n\t\taddTheme(info);\n\t}\n\n\tfor (const [name, theme] of registeredThemes.entries()) {\n\t\taddTheme({ name, path: theme.sourcePath });\n\t}\n\n\treturn result.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nfunction getCustomThemeInfos(): ThemeInfo[] {\n\tconst customThemesDir = getCustomThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tif (!fs.existsSync(customThemesDir)) {\n\t\treturn result;\n\t}\n\n\tfor (const file of fs.readdirSync(customThemesDir)) {\n\t\tif (!file.endsWith(\".json\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst themePath = path.join(customThemesDir, file);\n\t\ttry {\n\t\t\tconst customTheme = loadThemeFromPath(themePath);\n\t\t\tif (customTheme.name) {\n\t\t\t\tresult.push({ name: customTheme.name, path: themePath });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Invalid themes are ignored here; the resource loader reports them\n\t\t\t// during normal startup/reload.\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function loadThemeJson(name: string): ThemeJson {\n\tconst builtinThemes = getBuiltinThemes();\n\tif (name in builtinThemes) {\n\t\treturn builtinThemes[name];\n\t}\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme?.sourcePath) {\n\t\tconst content = fs.readFileSync(registeredTheme.sourcePath, \"utf-8\");\n\t\treturn parseThemeJsonContent(registeredTheme.sourcePath, content);\n\t}\n\tif (registeredTheme) {\n\t\tthrow new Error(`Theme \"${name}\" does not have a source path for export`);\n\t}\n\tconst customThemesDir = getCustomThemesDir();\n\tconst themePath = path.join(customThemesDir, `${name}.json`);\n\tif (!fs.existsSync(themePath)) {\n\t\tthrow new Error(`Theme not found: ${name}`);\n\t}\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn parseThemeJsonContent(name, content);\n}\n\nfunction createTheme(themeJson: ThemeJson, mode?: ColorMode, sourcePath?: string): Theme {\n\tconst colorMode = mode ?? detectColorMode();\n\tconst resolvedColors = resolveThemeColors(themeJson.colors, themeJson.vars);\n\tconst fgColors: Record<ThemeColor, string | number> = {} as Record<ThemeColor, string | number>;\n\tconst bgColors: Record<ThemeBg, string | number> = {} as Record<ThemeBg, string | number>;\n\tconst bgColorKeys: Set<string> = new Set([\n\t\t\"selectedBg\",\n\t\t\"userMessageBg\",\n\t\t\"customMessageBg\",\n\t\t\"toolPendingBg\",\n\t\t\"toolSuccessBg\",\n\t\t\"toolErrorBg\",\n\t]);\n\tfor (const [key, value] of Object.entries(resolvedColors)) {\n\t\tif (bgColorKeys.has(key)) {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn new Theme(fgColors, bgColors, colorMode, {\n\t\tname: themeJson.name,\n\t\tsourcePath,\n\t});\n}\n\nexport function loadThemeFromPath(themePath: string, mode?: ColorMode): Theme {\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\tconst themeJson = parseThemeJsonContent(themePath, content);\n\treturn createTheme(themeJson, mode, themePath);\n}\n\nexport function loadTheme(name: string, mode?: ColorMode): Theme {\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme) {\n\t\treturn registeredTheme;\n\t}\n\tconst themeJson = loadThemeJson(name);\n\treturn createTheme(themeJson, mode);\n}\n\nexport function getThemeByName(name: string): Theme | undefined {\n\ttry {\n\t\treturn loadTheme(name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function setRegisteredThemes(themes: Theme[]): void {\n\tregisteredThemes.clear();\n\tfor (const theme of themes) {\n\t\tif (theme.name) {\n\t\t\tassertThemeNameIsValid(theme.name);\n\t\t\tregisteredThemes.set(theme.name, theme);\n\t\t}\n\t}\n}\n\nexport function setRegisteredTheme(name: string, theme: Theme): void {\n\tregisteredThemes.set(name, theme);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"theme-loading.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme-loading.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,eAAe,EAAkB,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACvF,OAAO,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MA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node:path\";\nimport { getCustomThemesDir, getThemesDir } from \"../../../config.ts\";\nimport { detectColorMode, type ColorMode, resolveThemeColors } from \"./color-utils.ts\";\nimport { assertThemeNameIsValid, parseThemeJsonContent } from \"./theme-parse.ts\";\nimport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nimport type { ThemeJson } from \"./theme-schema.ts\";\n\nlet BUILTIN_THEMES: Record<string, ThemeJson> | undefined;\nconst registeredThemes = new Map<string, Theme>();\n\nexport interface ThemeInfo {\n\tname: string;\n\tpath: string | undefined;\n}\n\nexport function getBuiltinThemes(): Record<string, ThemeJson> {\n\tif (!BUILTIN_THEMES) {\n\t\tconst themesDir = getThemesDir();\n\t\tconst themes: Record<string, ThemeJson> = {};\n\t\tfor (const file of fs.readdirSync(themesDir).sort()) {\n\t\t\tif (!file.endsWith(\".json\") || file === \"theme-schema.json\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tconst themePath = path.join(themesDir, file);\n\t\t\tconst themeJson = parseThemeJsonContent(themePath, fs.readFileSync(themePath, \"utf-8\"));\n\t\t\tthemes[themeJson.name] = themeJson;\n\t\t}\n\t\tBUILTIN_THEMES = themes;\n\t}\n\treturn BUILTIN_THEMES;\n}\n\nexport function getAvailableThemes(): string[] {\n\treturn getAvailableThemesWithPaths().map(({ name }) => name);\n}\n\nexport function getAvailableThemesWithPaths(): ThemeInfo[] {\n\tconst themesDir = getThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tconst seen = new Set<string>();\n\tconst addTheme = (info: ThemeInfo) => {\n\t\tif (seen.has(info.name)) return;\n\t\tseen.add(info.name);\n\t\tresult.push(info);\n\t};\n\n\t// Built-in themes\n\tfor (const name of Object.keys(getBuiltinThemes())) {\n\t\taddTheme({ name, path: path.join(themesDir, `${name}.json`) });\n\t}\n\n\t// Custom themes\n\tfor (const info of getCustomThemeInfos()) {\n\t\taddTheme(info);\n\t}\n\n\tfor (const [name, theme] of registeredThemes.entries()) {\n\t\taddTheme({ name, path: theme.sourcePath });\n\t}\n\n\treturn result.sort((a, b) => a.name.localeCompare(b.name));\n}\n\nfunction getCustomThemeInfos(): ThemeInfo[] {\n\tconst customThemesDir = getCustomThemesDir();\n\tconst result: ThemeInfo[] = [];\n\tif (!fs.existsSync(customThemesDir)) {\n\t\treturn result;\n\t}\n\n\tfor (const file of fs.readdirSync(customThemesDir)) {\n\t\tif (!file.endsWith(\".json\")) {\n\t\t\tcontinue;\n\t\t}\n\t\tconst themePath = path.join(customThemesDir, file);\n\t\ttry {\n\t\t\tconst customTheme = loadThemeFromPath(themePath);\n\t\t\tif (customTheme.name) {\n\t\t\t\tresult.push({ name: customTheme.name, path: themePath });\n\t\t\t}\n\t\t} catch {\n\t\t\t// Invalid themes are ignored here; the resource loader reports them\n\t\t\t// during normal startup/reload.\n\t\t}\n\t}\n\treturn result;\n}\n\nexport function loadThemeJson(name: string): ThemeJson {\n\tconst builtinThemes = getBuiltinThemes();\n\tif (name in builtinThemes) {\n\t\treturn builtinThemes[name];\n\t}\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme?.sourcePath) {\n\t\tconst content = fs.readFileSync(registeredTheme.sourcePath, \"utf-8\");\n\t\treturn parseThemeJsonContent(registeredTheme.sourcePath, content);\n\t}\n\tif (registeredTheme) {\n\t\tthrow new Error(`Theme \"${name}\" does not have a source path for export`);\n\t}\n\tconst customThemesDir = getCustomThemesDir();\n\tconst themePath = path.join(customThemesDir, `${name}.json`);\n\tif (!fs.existsSync(themePath)) {\n\t\tthrow new Error(`Theme not found: ${name}`);\n\t}\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn parseThemeJsonContent(name, content);\n}\n\nfunction createTheme(themeJson: ThemeJson, mode?: ColorMode, sourcePath?: string): Theme {\n\tconst colorMode = mode ?? detectColorMode();\n\tconst resolvedColors = resolveThemeColors(themeJson.colors, themeJson.vars);\n\tconst fgColors: Record<ThemeColor, string | number> = {} as Record<ThemeColor, string | number>;\n\tconst bgColors: Record<ThemeBg, string | number> = {} as Record<ThemeBg, string | number>;\n\tconst bgColorKeys: Set<string> = new Set([\n\t\t\"selectedBg\",\n\t\t\"userMessageBg\",\n\t\t\"customMessageBg\",\n\t\t\"toolPendingBg\",\n\t\t\"toolSuccessBg\",\n\t\t\"toolErrorBg\",\n\t]);\n\tfor (const [key, value] of Object.entries(resolvedColors)) {\n\t\tif (bgColorKeys.has(key)) {\n\t\t\tbgColors[key as ThemeBg] = value;\n\t\t} else {\n\t\t\tfgColors[key as ThemeColor] = value;\n\t\t}\n\t}\n\treturn new Theme(fgColors, bgColors, colorMode, {\n\t\tname: themeJson.name,\n\t\tsourcePath,\n\t});\n}\n\nexport function loadThemeFromPath(themePath: string, mode?: ColorMode): Theme {\n\tconst content = fs.readFileSync(themePath, \"utf-8\");\n\treturn loadThemeFromContent(themePath, content, mode);\n}\n\nexport function loadThemeFromContent(themePath: string, content: string, mode?: ColorMode): Theme {\n\tconst themeJson = parseThemeJsonContent(themePath, content);\n\treturn createTheme(themeJson, mode, themePath);\n}\n\nexport function loadTheme(name: string, mode?: ColorMode): Theme {\n\tconst registeredTheme = registeredThemes.get(name);\n\tif (registeredTheme) {\n\t\treturn registeredTheme;\n\t}\n\tconst themeJson = loadThemeJson(name);\n\treturn createTheme(themeJson, mode);\n}\n\nexport function getThemeByName(name: string): Theme | undefined {\n\ttry {\n\t\treturn loadTheme(name);\n\t} catch {\n\t\treturn undefined;\n\t}\n}\n\nexport function setRegisteredThemes(themes: Theme[]): void {\n\tregisteredThemes.clear();\n\tfor (const theme of themes) {\n\t\tif (theme.name) {\n\t\t\tassertThemeNameIsValid(theme.name);\n\t\t\tregisteredThemes.set(theme.name, theme);\n\t\t}\n\t}\n}\n\nexport function setRegisteredTheme(name: string, theme: Theme): void {\n\tregisteredThemes.set(name, theme);\n}\n"]}
|
|
@@ -2,6 +2,6 @@ export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from "./ex
|
|
|
2
2
|
export { initTheme, onThemeChange, setTheme, setThemeInstance, stopThemeWatcher, theme, } from "./global-theme.ts";
|
|
3
3
|
export { detectTerminalBackgroundFromEnv, detectTerminalBackgroundTheme, getDefaultTheme, getThemeForRgbColor, parseAutoThemeSetting, resolveThemeSetting, type TerminalBackgroundThemeDetectionOptions, type TerminalBackgroundThemeDetector, type TerminalTheme, type TerminalThemeDetection, type TerminalThemeDetectionOptions, } from "./terminal-detection.ts";
|
|
4
4
|
export { Theme, type ThemeBg, type ThemeColor } from "./theme-class.ts";
|
|
5
|
-
export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, loadThemeFromPath, setRegisteredThemes, type ThemeInfo, } from "./theme-loading.ts";
|
|
5
|
+
export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, loadThemeFromPath, loadThemeFromContent, setRegisteredThemes, type ThemeInfo, } from "./theme-loading.ts";
|
|
6
6
|
export { getEditorTheme, getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, } from "./tui-theme.ts";
|
|
7
7
|
//# sourceMappingURL=theme.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,uCAAuC,EAC5C,KAAK,+BAA+B,EACpC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GAClC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,mBAAmB,EACnB,KAAK,SAAS,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACb,MAAM,gBAAgB,CAAC","sourcesContent":["export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from \"./export-colors.ts\";\nexport {\n\tinitTheme,\n\tonThemeChange,\n\tsetTheme,\n\tsetThemeInstance,\n\tstopThemeWatcher,\n\ttheme,\n} from \"./global-theme.ts\";\nexport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalBackgroundTheme,\n\tgetDefaultTheme,\n\tgetThemeForRgbColor,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\ttype TerminalBackgroundThemeDetectionOptions,\n\ttype TerminalBackgroundThemeDetector,\n\ttype TerminalTheme,\n\ttype TerminalThemeDetection,\n\ttype TerminalThemeDetectionOptions,\n} from \"./terminal-detection.ts\";\nexport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nexport {\n\tgetAvailableThemes,\n\tgetAvailableThemesWithPaths,\n\tgetThemeByName,\n\tloadThemeFromPath,\n\tsetRegisteredThemes,\n\ttype ThemeInfo,\n} from \"./theme-loading.ts\";\nexport {\n\tgetEditorTheme,\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n} from \"./tui-theme.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"theme.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,uCAAuC,EAC5C,KAAK,+BAA+B,EACpC,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,GAClC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,KAAK,SAAS,GACd,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACb,MAAM,gBAAgB,CAAC","sourcesContent":["export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from \"./export-colors.ts\";\nexport {\n\tinitTheme,\n\tonThemeChange,\n\tsetTheme,\n\tsetThemeInstance,\n\tstopThemeWatcher,\n\ttheme,\n} from \"./global-theme.ts\";\nexport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalBackgroundTheme,\n\tgetDefaultTheme,\n\tgetThemeForRgbColor,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\ttype TerminalBackgroundThemeDetectionOptions,\n\ttype TerminalBackgroundThemeDetector,\n\ttype TerminalTheme,\n\ttype TerminalThemeDetection,\n\ttype TerminalThemeDetectionOptions,\n} from \"./terminal-detection.ts\";\nexport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nexport {\n\tgetAvailableThemes,\n\tgetAvailableThemesWithPaths,\n\tgetThemeByName,\n\tloadThemeFromPath,\n\tloadThemeFromContent,\n\tsetRegisteredThemes,\n\ttype ThemeInfo,\n} from \"./theme-loading.ts\";\nexport {\n\tgetEditorTheme,\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n} from \"./tui-theme.ts\";\n"]}
|
|
@@ -2,6 +2,6 @@ export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from "./ex
|
|
|
2
2
|
export { initTheme, onThemeChange, setTheme, setThemeInstance, stopThemeWatcher, theme, } from "./global-theme.js";
|
|
3
3
|
export { detectTerminalBackgroundFromEnv, detectTerminalBackgroundTheme, getDefaultTheme, getThemeForRgbColor, parseAutoThemeSetting, resolveThemeSetting, } from "./terminal-detection.js";
|
|
4
4
|
export { Theme } from "./theme-class.js";
|
|
5
|
-
export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, loadThemeFromPath, setRegisteredThemes, } from "./theme-loading.js";
|
|
5
|
+
export { getAvailableThemes, getAvailableThemesWithPaths, getThemeByName, loadThemeFromPath, loadThemeFromContent, setRegisteredThemes, } from "./theme-loading.js";
|
|
6
6
|
export { getEditorTheme, getLanguageFromPath, getMarkdownTheme, getSelectListTheme, getSettingsListTheme, highlightCode, } from "./tui-theme.js";
|
|
7
7
|
//# sourceMappingURL=theme.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GAMnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAiC,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,mBAAmB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACb,MAAM,gBAAgB,CAAC","sourcesContent":["export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from \"./export-colors.ts\";\nexport {\n\tinitTheme,\n\tonThemeChange,\n\tsetTheme,\n\tsetThemeInstance,\n\tstopThemeWatcher,\n\ttheme,\n} from \"./global-theme.ts\";\nexport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalBackgroundTheme,\n\tgetDefaultTheme,\n\tgetThemeForRgbColor,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\ttype TerminalBackgroundThemeDetectionOptions,\n\ttype TerminalBackgroundThemeDetector,\n\ttype TerminalTheme,\n\ttype TerminalThemeDetection,\n\ttype TerminalThemeDetectionOptions,\n} from \"./terminal-detection.ts\";\nexport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nexport {\n\tgetAvailableThemes,\n\tgetAvailableThemesWithPaths,\n\tgetThemeByName,\n\tloadThemeFromPath,\n\tsetRegisteredThemes,\n\ttype ThemeInfo,\n} from \"./theme-loading.ts\";\nexport {\n\tgetEditorTheme,\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n} from \"./tui-theme.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"theme.js","sourceRoot":"","sources":["../../../../src/modes/interactive/theme/theme.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,sBAAsB,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAChG,OAAO,EACN,SAAS,EACT,aAAa,EACb,QAAQ,EACR,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,GACL,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACN,+BAA+B,EAC/B,6BAA6B,EAC7B,eAAe,EACf,mBAAmB,EACnB,qBAAqB,EACrB,mBAAmB,GAMnB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,KAAK,EAAiC,MAAM,kBAAkB,CAAC;AACxE,OAAO,EACN,kBAAkB,EAClB,2BAA2B,EAC3B,cAAc,EACd,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,GAEnB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACN,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,GACb,MAAM,gBAAgB,CAAC","sourcesContent":["export { getThemeExportColors, getResolvedThemeColors, isLightTheme } from \"./export-colors.ts\";\nexport {\n\tinitTheme,\n\tonThemeChange,\n\tsetTheme,\n\tsetThemeInstance,\n\tstopThemeWatcher,\n\ttheme,\n} from \"./global-theme.ts\";\nexport {\n\tdetectTerminalBackgroundFromEnv,\n\tdetectTerminalBackgroundTheme,\n\tgetDefaultTheme,\n\tgetThemeForRgbColor,\n\tparseAutoThemeSetting,\n\tresolveThemeSetting,\n\ttype TerminalBackgroundThemeDetectionOptions,\n\ttype TerminalBackgroundThemeDetector,\n\ttype TerminalTheme,\n\ttype TerminalThemeDetection,\n\ttype TerminalThemeDetectionOptions,\n} from \"./terminal-detection.ts\";\nexport { Theme, type ThemeBg, type ThemeColor } from \"./theme-class.ts\";\nexport {\n\tgetAvailableThemes,\n\tgetAvailableThemesWithPaths,\n\tgetThemeByName,\n\tloadThemeFromPath,\n\tloadThemeFromContent,\n\tsetRegisteredThemes,\n\ttype ThemeInfo,\n} from \"./theme-loading.ts\";\nexport {\n\tgetEditorTheme,\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n} from \"./tui-theme.ts\";\n"]}
|
|
@@ -8,4 +8,15 @@
|
|
|
8
8
|
* shipped next to the binary.
|
|
9
9
|
*/
|
|
10
10
|
export declare function createModuleRequire(moduleUrl: string): NodeJS.Require;
|
|
11
|
+
/**
|
|
12
|
+
* A resolution base URL safe for the current runtime.
|
|
13
|
+
*
|
|
14
|
+
* In compiled binaries (monolithic bun or the Atomic split launcher) the
|
|
15
|
+
* bundled `import.meta.url` is the build machine's source URL — a foreign-OS
|
|
16
|
+
* `file://` URL that `fileURLToPath` rejects on other platforms (notably a
|
|
17
|
+
* macOS `file:///Users/...` URL on Windows). Any API that decodes the base
|
|
18
|
+
* (`createRequire`, jiti's `createJiti`) then throws `ERR_INVALID_FILE_URL_PATH`.
|
|
19
|
+
* Anchor to the executable instead, which is always a valid local file URL.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolutionBaseUrl(moduleUrl: string): string;
|
|
11
22
|
//# sourceMappingURL=module-require.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-require.d.ts","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAErE","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl
|
|
1
|
+
{"version":3,"file":"module-require.d.ts","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAIA;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC,OAAO,CAErE;AAED;;;;;;;;;GASG;AACH,wBAAgB,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,MAAM,CAE3D","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(resolutionBaseUrl(moduleUrl));\n}\n\n/**\n * A resolution base URL safe for the current runtime.\n *\n * In compiled binaries (monolithic bun or the Atomic split launcher) the\n * bundled `import.meta.url` is the build machine's source URL — a foreign-OS\n * `file://` URL that `fileURLToPath` rejects on other platforms (notably a\n * macOS `file:///Users/...` URL on Windows). Any API that decodes the base\n * (`createRequire`, jiti's `createJiti`) then throws `ERR_INVALID_FILE_URL_PATH`.\n * Anchor to the executable instead, which is always a valid local file URL.\n */\nexport function resolutionBaseUrl(moduleUrl: string): string {\n\treturn isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl;\n}\n"]}
|
|
@@ -11,6 +11,19 @@ import { isBunBinary } from "../config.js";
|
|
|
11
11
|
* shipped next to the binary.
|
|
12
12
|
*/
|
|
13
13
|
export function createModuleRequire(moduleUrl) {
|
|
14
|
-
return createRequire(
|
|
14
|
+
return createRequire(resolutionBaseUrl(moduleUrl));
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* A resolution base URL safe for the current runtime.
|
|
18
|
+
*
|
|
19
|
+
* In compiled binaries (monolithic bun or the Atomic split launcher) the
|
|
20
|
+
* bundled `import.meta.url` is the build machine's source URL — a foreign-OS
|
|
21
|
+
* `file://` URL that `fileURLToPath` rejects on other platforms (notably a
|
|
22
|
+
* macOS `file:///Users/...` URL on Windows). Any API that decodes the base
|
|
23
|
+
* (`createRequire`, jiti's `createJiti`) then throws `ERR_INVALID_FILE_URL_PATH`.
|
|
24
|
+
* Anchor to the executable instead, which is always a valid local file URL.
|
|
25
|
+
*/
|
|
26
|
+
export function resolutionBaseUrl(moduleUrl) {
|
|
27
|
+
return isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl;
|
|
15
28
|
}
|
|
16
29
|
//# sourceMappingURL=module-require.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-require.js","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,aAAa,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC
|
|
1
|
+
{"version":3,"file":"module-require.js","sourceRoot":"","sources":["../../src/utils/module-require.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,SAAiB;IACpD,OAAO,aAAa,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CAAC;AACpD,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IAClD,OAAO,WAAW,CAAC,CAAC,CAAC,aAAa,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,SAAS,CAAC;AACvE,CAAC","sourcesContent":["import { createRequire } from \"node:module\";\nimport { pathToFileURL } from \"node:url\";\nimport { isBunBinary } from \"../config.ts\";\n\n/**\n * createRequire anchored so bare-specifier resolution works in every runtime.\n *\n * In the compiled binary the bundle is CJS (bytecode), where import.meta.url\n * is rewritten to the original build-machine source path; requiring through it\n * would resolve node_modules against paths that do not exist on user machines.\n * Anchor to the executable instead so resolution walks from the node_modules\n * shipped next to the binary.\n */\nexport function createModuleRequire(moduleUrl: string): NodeJS.Require {\n\treturn createRequire(resolutionBaseUrl(moduleUrl));\n}\n\n/**\n * A resolution base URL safe for the current runtime.\n *\n * In compiled binaries (monolithic bun or the Atomic split launcher) the\n * bundled `import.meta.url` is the build machine's source URL — a foreign-OS\n * `file://` URL that `fileURLToPath` rejects on other platforms (notably a\n * macOS `file:///Users/...` URL on Windows). Any API that decodes the base\n * (`createRequire`, jiti's `createJiti`) then throws `ERR_INVALID_FILE_URL_PATH`.\n * Anchor to the executable instead, which is always a valid local file URL.\n */\nexport function resolutionBaseUrl(moduleUrl: string): string {\n\treturn isBunBinary ? pathToFileURL(process.execPath).href : moduleUrl;\n}\n"]}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Split-launcher / foreign-build `import.meta.url` handling.
|
|
3
|
+
*
|
|
4
|
+
* Atomic's release binaries use a split launcher: a tiny compiled `atomic` /
|
|
5
|
+
* `atomic.exe` executable sets `ATOMIC_CODING_AGENT=true` and then dynamically
|
|
6
|
+
* imports the bundled sidecar `app.js` (plus raw-TS built-in extensions) from
|
|
7
|
+
* disk next to the executable.
|
|
8
|
+
*
|
|
9
|
+
* Unlike pi's single monolithic `bun --compile` binary — where `import.meta.url`
|
|
10
|
+
* is always a `$bunfs://` virtual-FS URL — the split sidecar bundle carries the
|
|
11
|
+
* build machine's source path baked in at bundle time (e.g. a macOS
|
|
12
|
+
* `file:///Users/.../app.js` URL). On Windows, `fileURLToPath()` rejects that
|
|
13
|
+
* URL with `ERR_INVALID_FILE_URL_PATH` ("File URL path must be an absolute
|
|
14
|
+
* path") because `/Users/...` has no drive letter, so every site that decodes
|
|
15
|
+
* `import.meta.url` to a filesystem path must tolerate it.
|
|
16
|
+
*
|
|
17
|
+
* These helpers centralize that tolerance: decode normally, and only when the
|
|
18
|
+
* decode fails under the split launcher fall back to a path resolved relative to
|
|
19
|
+
* the launcher executable (where the sidecar bundle and its assets actually
|
|
20
|
+
* live). This mirrors pi's convention of a single detection point rather than
|
|
21
|
+
* scattered ad-hoc guards.
|
|
22
|
+
*/
|
|
23
|
+
export declare function isSplitLauncherRuntime(): boolean;
|
|
24
|
+
/** Directory containing the launcher executable and its sidecar bundle/assets. */
|
|
25
|
+
export declare function splitLauncherDir(): string;
|
|
26
|
+
/**
|
|
27
|
+
* Resolve a module's directory from its `import.meta.url`, tolerating the
|
|
28
|
+
* split-launcher case where the bundled URL is a foreign-OS build path.
|
|
29
|
+
* `execRelativeSegments` locate the equivalent directory next to the launcher.
|
|
30
|
+
*/
|
|
31
|
+
export declare function moduleDirFromMetaUrl(metaUrl: string, ...execRelativeSegments: string[]): string;
|
|
32
|
+
/**
|
|
33
|
+
* Resolve a module's filename from its `import.meta.url`, tolerating the
|
|
34
|
+
* split-launcher case. `execRelativeFile` locates the equivalent file next to
|
|
35
|
+
* the launcher (used as a stable resolution base, e.g. for `createRequire`).
|
|
36
|
+
*/
|
|
37
|
+
export declare function moduleFileFromMetaUrl(metaUrl: string, execRelativeFile: string): string;
|
|
38
|
+
//# sourceMappingURL=split-launcher.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-launcher.d.ts","sourceRoot":"","sources":["../../src/utils/split-launcher.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,sBAAsB,IAAI,OAAO,CAKhD;AAED,kFAAkF;AAClF,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED;;;;GAIG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,oBAAoB,EAAE,MAAM,EAAE,GAAG,MAAM,CAO/F;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAOvF","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Split-launcher / foreign-build `import.meta.url` handling.\n *\n * Atomic's release binaries use a split launcher: a tiny compiled `atomic` /\n * `atomic.exe` executable sets `ATOMIC_CODING_AGENT=true` and then dynamically\n * imports the bundled sidecar `app.js` (plus raw-TS built-in extensions) from\n * disk next to the executable.\n *\n * Unlike pi's single monolithic `bun --compile` binary — where `import.meta.url`\n * is always a `$bunfs://` virtual-FS URL — the split sidecar bundle carries the\n * build machine's source path baked in at bundle time (e.g. a macOS\n * `file:///Users/.../app.js` URL). On Windows, `fileURLToPath()` rejects that\n * URL with `ERR_INVALID_FILE_URL_PATH` (\"File URL path must be an absolute\n * path\") because `/Users/...` has no drive letter, so every site that decodes\n * `import.meta.url` to a filesystem path must tolerate it.\n *\n * These helpers centralize that tolerance: decode normally, and only when the\n * decode fails under the split launcher fall back to a path resolved relative to\n * the launcher executable (where the sidecar bundle and its assets actually\n * live). This mirrors pi's convention of a single detection point rather than\n * scattered ad-hoc guards.\n */\nexport function isSplitLauncherRuntime(): boolean {\n\treturn (\n\t\tprocess.env.ATOMIC_CODING_AGENT === \"true\" &&\n\t\t/(?:^|[\\\\/])atomic(?:\\.exe)?$/i.test(process.execPath)\n\t);\n}\n\n/** Directory containing the launcher executable and its sidecar bundle/assets. */\nexport function splitLauncherDir(): string {\n\treturn dirname(process.execPath);\n}\n\n/**\n * Resolve a module's directory from its `import.meta.url`, tolerating the\n * split-launcher case where the bundled URL is a foreign-OS build path.\n * `execRelativeSegments` locate the equivalent directory next to the launcher.\n */\nexport function moduleDirFromMetaUrl(metaUrl: string, ...execRelativeSegments: string[]): string {\n\ttry {\n\t\treturn dirname(fileURLToPath(metaUrl));\n\t} catch (error) {\n\t\tif (isSplitLauncherRuntime()) return join(splitLauncherDir(), ...execRelativeSegments);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Resolve a module's filename from its `import.meta.url`, tolerating the\n * split-launcher case. `execRelativeFile` locates the equivalent file next to\n * the launcher (used as a stable resolution base, e.g. for `createRequire`).\n */\nexport function moduleFileFromMetaUrl(metaUrl: string, execRelativeFile: string): string {\n\ttry {\n\t\treturn fileURLToPath(metaUrl);\n\t} catch (error) {\n\t\tif (isSplitLauncherRuntime()) return join(splitLauncherDir(), execRelativeFile);\n\t\tthrow error;\n\t}\n}\n"]}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { dirname, join } from "node:path";
|
|
2
|
+
import { fileURLToPath } from "node:url";
|
|
3
|
+
/**
|
|
4
|
+
* Split-launcher / foreign-build `import.meta.url` handling.
|
|
5
|
+
*
|
|
6
|
+
* Atomic's release binaries use a split launcher: a tiny compiled `atomic` /
|
|
7
|
+
* `atomic.exe` executable sets `ATOMIC_CODING_AGENT=true` and then dynamically
|
|
8
|
+
* imports the bundled sidecar `app.js` (plus raw-TS built-in extensions) from
|
|
9
|
+
* disk next to the executable.
|
|
10
|
+
*
|
|
11
|
+
* Unlike pi's single monolithic `bun --compile` binary — where `import.meta.url`
|
|
12
|
+
* is always a `$bunfs://` virtual-FS URL — the split sidecar bundle carries the
|
|
13
|
+
* build machine's source path baked in at bundle time (e.g. a macOS
|
|
14
|
+
* `file:///Users/.../app.js` URL). On Windows, `fileURLToPath()` rejects that
|
|
15
|
+
* URL with `ERR_INVALID_FILE_URL_PATH` ("File URL path must be an absolute
|
|
16
|
+
* path") because `/Users/...` has no drive letter, so every site that decodes
|
|
17
|
+
* `import.meta.url` to a filesystem path must tolerate it.
|
|
18
|
+
*
|
|
19
|
+
* These helpers centralize that tolerance: decode normally, and only when the
|
|
20
|
+
* decode fails under the split launcher fall back to a path resolved relative to
|
|
21
|
+
* the launcher executable (where the sidecar bundle and its assets actually
|
|
22
|
+
* live). This mirrors pi's convention of a single detection point rather than
|
|
23
|
+
* scattered ad-hoc guards.
|
|
24
|
+
*/
|
|
25
|
+
export function isSplitLauncherRuntime() {
|
|
26
|
+
return (process.env.ATOMIC_CODING_AGENT === "true" &&
|
|
27
|
+
/(?:^|[\\/])atomic(?:\.exe)?$/i.test(process.execPath));
|
|
28
|
+
}
|
|
29
|
+
/** Directory containing the launcher executable and its sidecar bundle/assets. */
|
|
30
|
+
export function splitLauncherDir() {
|
|
31
|
+
return dirname(process.execPath);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Resolve a module's directory from its `import.meta.url`, tolerating the
|
|
35
|
+
* split-launcher case where the bundled URL is a foreign-OS build path.
|
|
36
|
+
* `execRelativeSegments` locate the equivalent directory next to the launcher.
|
|
37
|
+
*/
|
|
38
|
+
export function moduleDirFromMetaUrl(metaUrl, ...execRelativeSegments) {
|
|
39
|
+
try {
|
|
40
|
+
return dirname(fileURLToPath(metaUrl));
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
if (isSplitLauncherRuntime())
|
|
44
|
+
return join(splitLauncherDir(), ...execRelativeSegments);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Resolve a module's filename from its `import.meta.url`, tolerating the
|
|
50
|
+
* split-launcher case. `execRelativeFile` locates the equivalent file next to
|
|
51
|
+
* the launcher (used as a stable resolution base, e.g. for `createRequire`).
|
|
52
|
+
*/
|
|
53
|
+
export function moduleFileFromMetaUrl(metaUrl, execRelativeFile) {
|
|
54
|
+
try {
|
|
55
|
+
return fileURLToPath(metaUrl);
|
|
56
|
+
}
|
|
57
|
+
catch (error) {
|
|
58
|
+
if (isSplitLauncherRuntime())
|
|
59
|
+
return join(splitLauncherDir(), execRelativeFile);
|
|
60
|
+
throw error;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=split-launcher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"split-launcher.js","sourceRoot":"","sources":["../../src/utils/split-launcher.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,sBAAsB;IACrC,OAAO,CACN,OAAO,CAAC,GAAG,CAAC,mBAAmB,KAAK,MAAM;QAC1C,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,CACtD,CAAC;AACH,CAAC;AAED,kFAAkF;AAClF,MAAM,UAAU,gBAAgB;IAC/B,OAAO,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AAClC,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAe,EAAE,GAAG,oBAA8B;IACtF,IAAI,CAAC;QACJ,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC,CAAC;IACxC,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,sBAAsB,EAAE;YAAE,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,GAAG,oBAAoB,CAAC,CAAC;QACvF,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe,EAAE,gBAAwB;IAC9E,IAAI,CAAC;QACJ,OAAO,aAAa,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QAChB,IAAI,sBAAsB,EAAE;YAAE,OAAO,IAAI,CAAC,gBAAgB,EAAE,EAAE,gBAAgB,CAAC,CAAC;QAChF,MAAM,KAAK,CAAC;IACb,CAAC;AACF,CAAC","sourcesContent":["import { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\n/**\n * Split-launcher / foreign-build `import.meta.url` handling.\n *\n * Atomic's release binaries use a split launcher: a tiny compiled `atomic` /\n * `atomic.exe` executable sets `ATOMIC_CODING_AGENT=true` and then dynamically\n * imports the bundled sidecar `app.js` (plus raw-TS built-in extensions) from\n * disk next to the executable.\n *\n * Unlike pi's single monolithic `bun --compile` binary — where `import.meta.url`\n * is always a `$bunfs://` virtual-FS URL — the split sidecar bundle carries the\n * build machine's source path baked in at bundle time (e.g. a macOS\n * `file:///Users/.../app.js` URL). On Windows, `fileURLToPath()` rejects that\n * URL with `ERR_INVALID_FILE_URL_PATH` (\"File URL path must be an absolute\n * path\") because `/Users/...` has no drive letter, so every site that decodes\n * `import.meta.url` to a filesystem path must tolerate it.\n *\n * These helpers centralize that tolerance: decode normally, and only when the\n * decode fails under the split launcher fall back to a path resolved relative to\n * the launcher executable (where the sidecar bundle and its assets actually\n * live). This mirrors pi's convention of a single detection point rather than\n * scattered ad-hoc guards.\n */\nexport function isSplitLauncherRuntime(): boolean {\n\treturn (\n\t\tprocess.env.ATOMIC_CODING_AGENT === \"true\" &&\n\t\t/(?:^|[\\\\/])atomic(?:\\.exe)?$/i.test(process.execPath)\n\t);\n}\n\n/** Directory containing the launcher executable and its sidecar bundle/assets. */\nexport function splitLauncherDir(): string {\n\treturn dirname(process.execPath);\n}\n\n/**\n * Resolve a module's directory from its `import.meta.url`, tolerating the\n * split-launcher case where the bundled URL is a foreign-OS build path.\n * `execRelativeSegments` locate the equivalent directory next to the launcher.\n */\nexport function moduleDirFromMetaUrl(metaUrl: string, ...execRelativeSegments: string[]): string {\n\ttry {\n\t\treturn dirname(fileURLToPath(metaUrl));\n\t} catch (error) {\n\t\tif (isSplitLauncherRuntime()) return join(splitLauncherDir(), ...execRelativeSegments);\n\t\tthrow error;\n\t}\n}\n\n/**\n * Resolve a module's filename from its `import.meta.url`, tolerating the\n * split-launcher case. `execRelativeFile` locates the equivalent file next to\n * the launcher (used as a stable resolution base, e.g. for `createRequire`).\n */\nexport function moduleFileFromMetaUrl(metaUrl: string, execRelativeFile: string): string {\n\ttry {\n\t\treturn fileURLToPath(metaUrl);\n\t} catch (error) {\n\t\tif (isSplitLauncherRuntime()) return join(splitLauncherDir(), execRelativeFile);\n\t\tthrow error;\n\t}\n}\n"]}
|
package/docs/compaction.md
CHANGED
|
@@ -13,6 +13,7 @@ Atomic's compaction design and terminology are informed by Morph's Context Compa
|
|
|
13
13
|
- [`packages/coding-agent/src/core/compaction/branch-summarization.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/branch-summarization.ts) - Branch summarization
|
|
14
14
|
- [`packages/coding-agent/src/core/compaction/utils.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/compaction/utils.ts) - Shared utilities (file tracking, serialization)
|
|
15
15
|
- [`packages/coding-agent/src/core/session-manager.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/session-manager.ts) - Entry types (`ContextCompactionEntry`, `BranchSummaryEntry`) and active-context rebuild logic
|
|
16
|
+
- [`packages/coding-agent/src/core/provider-context-usage.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/provider-context-usage.ts) - Provider-bound usage scrub that keeps post-compaction token budgeting based on the compacted prompt
|
|
16
17
|
- [`packages/coding-agent/src/core/extensions/session-events.ts`](https://github.com/bastani-inc/atomic/blob/main/packages/coding-agent/src/core/extensions/session-events.ts) - Compaction extension event payloads
|
|
17
18
|
|
|
18
19
|
For TypeScript definitions in your project, inspect `node_modules/@bastani/atomic/dist/`.
|
|
@@ -69,6 +70,8 @@ Atomic records those targets in an append-only `context_compaction` entry. When
|
|
|
69
70
|
|
|
70
71
|
The raw session JSONL remains append-only. Deleted objects stay available in the stored session file and backup snapshot; they are only omitted from future active LLM context on that branch.
|
|
71
72
|
|
|
73
|
+
Provider-bound context is cloned one more time before each LLM request. Retained assistant messages from before the latest `context_compaction` keep their historical usage in the durable session JSONL, but Atomic zeroes that usage in the request-only clone so provider token-budget estimators do not treat the compacted context as if it still contained the old, larger prompt. The first assistant response after compaction then supplies fresh usage for subsequent turns.
|
|
74
|
+
|
|
72
75
|
### Compaction Parameters
|
|
73
76
|
|
|
74
77
|
Atomic uses three effective parameters for each context-compaction run. They are available to extension hooks as `event.parameters`, copied into `event.preparation.parameters`, and returned on `event.result.parameters` after a successful compaction.
|
package/docs/keybindings.md
CHANGED
|
@@ -82,8 +82,8 @@ Modifier combinations: `ctrl+shift+x`, `alt+ctrl+x`, `ctrl+shift+alt+x`, `ctrl+1
|
|
|
82
82
|
|
|
83
83
|
| Keybinding id | Default | Description |
|
|
84
84
|
|--------|---------|-------------|
|
|
85
|
-
| `app.interrupt` | `escape` | Cancel / abort |
|
|
86
|
-
| `app.clear` | `ctrl+c` |
|
|
85
|
+
| `app.interrupt` | `escape` | Cancel / abort the running agent, bash command, compaction, or retry |
|
|
86
|
+
| `app.clear` | `ctrl+c` | Interrupt the running agent when busy; otherwise clear the editor (press twice to exit) |
|
|
87
87
|
| `app.exit` | `ctrl+d` | Exit (when editor empty) |
|
|
88
88
|
| `app.suspend` | `ctrl+z` (none on Windows) | Suspend to background |
|
|
89
89
|
| `app.editor.external` | `ctrl+g` | Open in external editor (`$VISUAL` or `$EDITOR`) |
|
package/docs/providers.md
CHANGED
|
@@ -38,7 +38,7 @@ Anthropic subscription auth is active for Claude Pro/Max accounts. Third-party h
|
|
|
38
38
|
### GitHub Copilot
|
|
39
39
|
|
|
40
40
|
- Press Enter for github.com, or enter your GitHub Enterprise Server domain
|
|
41
|
-
- When using `COPILOT_GITHUB_TOKEN` instead of `/login`, Atomic uses the token's `proxy-ep` when present, honors `COPILOT_API_TARGET` or `GITHUB_COPILOT_BASE_URL` overrides, derives
|
|
41
|
+
- When using `COPILOT_GITHUB_TOKEN` instead of `/login`, Atomic uses the token's `proxy-ep` when present, honors `COPILOT_API_TARGET` or `GITHUB_COPILOT_BASE_URL` overrides, derives the tenant-specific GHE routing host from `GITHUB_SERVER_URL=*.ghe.com`, derives `https://api.enterprise.githubcopilot.com` from other non-`github.com` server URLs, and otherwise falls back to the public Copilot routing hub `https://api.githubcopilot.com` instead of the account-specific individual endpoint.
|
|
42
42
|
- If you get "model not supported", enable it in VS Code: Copilot Chat → model selector → select model → "Enable"
|
|
43
43
|
- GitHub Copilot models are populated dynamically from Copilot's live CAPI `/models` catalog when Copilot auth is available. Atomic synthesizes only picker-enabled, non-disabled `chat` entries with plain ids (for example `github-copilot/claude-sonnet-5` and `github-copilot/mai-code-1-flash-picker`); namespaced enterprise deployments containing `/` are skipped rather than exposed as `github-copilot/*` models. Models that advertise long-context limits, such as `github-copilot/gpt-5.5`, `github-copilot/claude-opus-4.8`, and `github-copilot/gemini-3.1-pro-preview`, expose an opt-in long-context choice through `--context-window`, the `/model` selection flow, per-model `defaultContextWindows`, SDK, and RPC controls. The long-context option advertises the model's full context window (for example `1m` or `1.05m` — GitHub's `max_context_window_tokens`), matching how the native `openai/*` and `anthropic/*` providers report these models and what the chat footer shows. GitHub's lower server-side prompt cap (`max_prompt_tokens`, for example `936k` or `922k`) is retained internally as the effective input budget that drives compaction thresholds and overflow recovery, and GitHub's live output cap (`max_output_tokens`) replaces Atomic's bundled `maxTokens` fallback for provider requests. If CAPI advertises `capabilities.supports.reasoning_effort` as an array, Atomic also gates `/model` and thinking-level cycling to only those live levels for both dynamic Copilot models and bundled `pi-ai` Copilot models; budget-only or boolean-only reasoning metadata leaves the existing thinking map untouched. Active interactive sessions refresh from this metadata as soon as the catalog is applied, so a startup fallback model does not keep stale reasoning levels until restart. This lets Atomic display the branded context window, request the catalog-advertised output budget, and avoid offering unsupported Copilot reasoning levels.
|
|
44
44
|
- Selecting long context sets Atomic's displayed window to the model's full capacity while compaction triggers against the effective prompt-token budget, and makes Copilot requests include `X-GitHub-Api-Version: 2026-06-01`. Atomic does not send a body field, `contextTier`, or model-id variant; GitHub automatically applies the server-side `long_context` tier when prompt tokens exceed the default budget.
|
package/docs/settings.md
CHANGED
|
@@ -21,7 +21,7 @@ If no extension or saved decision applies, `defaultProjectTrust` controls the fa
|
|
|
21
21
|
|
|
22
22
|
Use `/trust` in interactive mode to save a project trust decision for future sessions, including trust for the immediate parent folder. It writes `~/.atomic/agent/trust.json` only; the current session is not reloaded, so restart Atomic for changes to take effect.
|
|
23
23
|
|
|
24
|
-
If a bare directory starts without trust-gated inputs, Atomic may run the interactive session as implicitly trusted. Inert state directories such as `.atomic/todos/` and `.atomic/sessions/` do not require trust and do not disable deferred
|
|
24
|
+
If a bare directory starts without trust-gated inputs, Atomic may run the interactive session as implicitly trusted. Inert state directories such as `.atomic/todos/` and `.atomic/sessions/` do not require trust and do not disable deferred resource startup. On the normal interactive TTY fast path, Atomic paints the shell and makes the input editor responsive before scanning bundled extension packages, skills, prompts, themes, context files, and system-prompt files. Deferred loading uses async filesystem discovery and async file reads with cooperative yields, so visible typing, Enter, Ctrl+C, rendering, and the normal prompt spinner remain responsive when a submitted prompt needs extension-dependent tools and prompt templates. Startup does not show a resource-loading spinner before the user submits a prompt. When resources finish loading, Atomic shows the normal resources disclosure so newly added skills, prompts, themes, and extensions are visible. If trust-requiring config appears later, Atomic prompts again on the next launch until you explicitly save a persistent trust decision; the only automatic persistence of implicit startup trust is the existing `/reload` flow after reload discovers trust-requiring resources in an already-trusted session.
|
|
25
25
|
|
|
26
26
|
Settings and trust JSON files may start with a UTF-8 BOM, as commonly written by older Windows tools; Atomic strips that leading marker before parsing.
|
|
27
27
|
|
|
@@ -244,7 +244,7 @@ When multiple sources specify a session directory, precedence is `--session-dir`
|
|
|
244
244
|
|
|
245
245
|
| Setting | Type | Default | Description |
|
|
246
246
|
|---------|------|---------|-------------|
|
|
247
|
-
| `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag). In interactive
|
|
247
|
+
| `enabledModels` | string[] | - | Model patterns for CTRL+P cycling (same format as `--models` CLI flag). In interactive TTY startup, these patterns are resolved again after deferred extension/resource loading so extension-provided providers can match without blocking first paint. |
|
|
248
248
|
| `defaultContextWindow` | number \| string | model default | Optional global fallback context window for models that expose selectable context windows. Accepts raw token counts or compact labels such as `400k` and `1m`. Unsupported values are ignored for models that do not support them. |
|
|
249
249
|
| `defaultContextWindows` | object | `{}` | Per-model preferred context windows keyed as `provider/modelId`. The interactive `/model` context picker writes this setting so a Copilot-specific prompt cap such as `936k` does not leak into Anthropic, Cursor, or other providers. |
|
|
250
250
|
|
package/docs/usage.md
CHANGED
|
@@ -64,7 +64,7 @@ You can submit messages while the agent is still working:
|
|
|
64
64
|
|
|
65
65
|
- **Enter** queues a steering message, delivered after the current assistant turn finishes executing its tool calls.
|
|
66
66
|
- **ALT+Enter** queues a follow-up message, delivered after the agent finishes all work.
|
|
67
|
-
- **Escape** aborts and restores queued messages to the editor.
|
|
67
|
+
- **Escape** or **Ctrl+C** aborts the running agent and restores queued messages to the editor. When idle, Ctrl+C clears the editor (press twice to exit).
|
|
68
68
|
- **ALT+Up** retrieves queued messages back to the editor.
|
|
69
69
|
|
|
70
70
|
On Windows Terminal, ALT+Enter is fullscreen by default. Remap it as described in [Terminal setup](/terminal-setup) if you want Atomic to receive the shortcut.
|