@astralyn/pi 1.0.5 → 1.1.0
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 +37 -0
- package/dist/bundle/chunks/{anthropic-messages-YIOJIMVL.js → anthropic-messages-3K3DWVY6.js} +1 -1
- package/dist/bundle/chunks/anthropic.js +1 -1
- package/dist/bundle/chunks/{azure-openai-responses-LDW4FGAQ.js → azure-openai-responses-CH74HGP4.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/{chunk-UCXU7KLO.js → chunk-3MMB5I7J.js} +1 -1
- package/dist/bundle/chunks/{chunk-GIG5IHES.js → chunk-5KJH3GGH.js} +1 -1
- package/dist/bundle/chunks/chunk-6VYRLG5F.js +2 -0
- package/dist/bundle/chunks/{chunk-HDHRZ7GT.js → chunk-C2ARIVS3.js} +1 -1
- package/dist/bundle/chunks/{chunk-IE3Z7ESB.js → chunk-D3XW5X3Z.js} +371 -246
- package/dist/bundle/chunks/{chunk-IFELM7MW.js → chunk-EJEOEBSJ.js} +1 -1
- package/dist/bundle/chunks/chunk-H35KWBT5.js +11 -0
- package/dist/bundle/chunks/chunk-KAC2YPTW.js +2 -0
- package/dist/bundle/chunks/chunk-MAC4N3BW.js +2 -0
- package/dist/bundle/chunks/chunk-QLU3LESZ.js +2 -0
- package/dist/bundle/chunks/{chunk-A6ALEEY5.js → chunk-TEAAYBTS.js} +1 -1
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-XO45ZT3V.js +2 -0
- package/dist/bundle/chunks/codemode-worker.js +2 -2
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/{google-generative-ai-S5A5IBU4.js → google-generative-ai-VVO64ZRQ.js} +1 -1
- package/dist/bundle/chunks/{google-vertex-UBRQFDB4.js → google-vertex-LKS5NUHA.js} +1 -1
- package/dist/bundle/chunks/image-resize-worker.js +1 -1
- package/dist/bundle/chunks/{llama-cpp-classify-R7DQLTQN.js → llama-cpp-classify-H3IZDR5O.js} +2 -2
- package/dist/bundle/chunks/{mistral-conversations-A2N5FSOV.js → mistral-conversations-NJUOG4ET.js} +2 -2
- package/dist/bundle/chunks/openai-chatgpt.js +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-Q6JHCWLE.js → openai-codex-responses-TZWBTTYM.js} +2 -2
- package/dist/bundle/chunks/openai-codex.js +1 -1
- package/dist/bundle/chunks/{openai-completions-H4VMO7AU.js → openai-completions-7HTTU6FH.js} +1 -1
- package/dist/bundle/chunks/openai-decisions-776H4VDZ.js +5 -0
- package/dist/bundle/chunks/{openai-responses-G4PGNM2H.js → openai-responses-7A6BAQ5X.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-YP3YVB54.js → openrouter-images-TDLJV5N4.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-HZZ7GEEW.js → pi-messages-ZXNERWJG.js} +1 -1
- package/dist/bundle/chunks/typesafe-system-one-2DQLG4R2.js +2 -0
- package/dist/bundle/chunks/{virtual-modules-46MSJGKO.js → virtual-modules-2NHGQRS6.js} +1 -1
- package/dist/bundle/cli.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +13 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/core/agent-session.d.ts +12 -6
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +146 -174
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/bash-executor.d.ts.map +1 -1
- package/dist/core/bash-executor.js +40 -45
- package/dist/core/bash-executor.js.map +1 -1
- package/dist/core/context-snapshot.d.ts +4 -1
- package/dist/core/context-snapshot.d.ts.map +1 -1
- package/dist/core/context-snapshot.js +45 -0
- package/dist/core/context-snapshot.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -0
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/types.d.ts +11 -0
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +2 -1
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/nested-tool-calls.d.ts +1 -0
- package/dist/core/nested-tool-calls.d.ts.map +1 -1
- package/dist/core/nested-tool-calls.js +1 -0
- package/dist/core/nested-tool-calls.js.map +1 -1
- package/dist/core/sdk.d.ts +4 -0
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +17 -5
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +37 -13
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/tasks/session.d.ts +9 -0
- package/dist/core/tasks/session.d.ts.map +1 -1
- package/dist/core/tasks/session.js +21 -0
- package/dist/core/tasks/session.js.map +1 -1
- package/dist/core/tools/renderers/bash.d.ts.map +1 -1
- package/dist/core/tools/renderers/bash.js +8 -3
- package/dist/core/tools/renderers/bash.js.map +1 -1
- package/dist/core/tools/renderers/edit.js +1 -1
- package/dist/core/tools/renderers/edit.js.map +1 -1
- package/dist/extensions/codemode/execute.d.ts.map +1 -1
- package/dist/extensions/codemode/execute.js +63 -7
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.js +2 -2
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/index.js +2 -2
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +34 -11
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/mcp/cli.js +17 -23
- package/dist/extensions/mcp/cli.js.map +1 -1
- package/dist/extensions/mcp/index.d.ts.map +1 -1
- package/dist/extensions/mcp/index.js +165 -64
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/oauth.d.ts +5 -3
- package/dist/extensions/mcp/oauth.d.ts.map +1 -1
- package/dist/extensions/mcp/oauth.js +36 -10
- package/dist/extensions/mcp/oauth.js.map +1 -1
- package/dist/extensions/mcp/ui.d.ts +3 -3
- package/dist/extensions/mcp/ui.d.ts.map +1 -1
- package/dist/extensions/mcp/ui.js +10 -2
- package/dist/extensions/mcp/ui.js.map +1 -1
- package/dist/extensions/search/code-search.d.ts +29 -0
- package/dist/extensions/search/code-search.d.ts.map +1 -0
- package/dist/extensions/search/code-search.js +120 -0
- package/dist/extensions/search/code-search.js.map +1 -0
- package/dist/extensions/search/command.d.ts +5 -0
- package/dist/extensions/search/command.d.ts.map +1 -0
- package/dist/extensions/search/command.js +69 -0
- package/dist/extensions/search/command.js.map +1 -0
- package/dist/extensions/search/credential.d.ts +25 -0
- package/dist/extensions/search/credential.d.ts.map +1 -0
- package/dist/extensions/search/credential.js +117 -0
- package/dist/extensions/search/credential.js.map +1 -0
- package/dist/extensions/search/devin.d.ts +34 -0
- package/dist/extensions/search/devin.d.ts.map +1 -0
- package/dist/extensions/search/devin.js +210 -0
- package/dist/extensions/search/devin.js.map +1 -0
- package/dist/extensions/search/index.d.ts +5 -0
- package/dist/extensions/search/index.d.ts.map +1 -0
- package/dist/extensions/search/index.js +110 -0
- package/dist/extensions/search/index.js.map +1 -0
- package/dist/extensions/search/panel.d.ts +53 -0
- package/dist/extensions/search/panel.d.ts.map +1 -0
- package/dist/extensions/search/panel.js +157 -0
- package/dist/extensions/search/panel.js.map +1 -0
- package/dist/extensions/search/prompt.d.ts +14 -0
- package/dist/extensions/search/prompt.d.ts.map +1 -0
- package/dist/extensions/search/prompt.js +221 -0
- package/dist/extensions/search/prompt.js.map +1 -0
- package/dist/extensions/search/render.d.ts +28 -0
- package/dist/extensions/search/render.d.ts.map +1 -0
- package/dist/extensions/search/render.js +86 -0
- package/dist/extensions/search/render.js.map +1 -0
- package/dist/extensions/search/workspace.d.ts +38 -0
- package/dist/extensions/search/workspace.d.ts.map +1 -0
- package/dist/extensions/search/workspace.js +245 -0
- package/dist/extensions/search/workspace.js.map +1 -0
- package/dist/modes/interactive/components/bash-execution.d.ts +5 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +14 -14
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +5 -2
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +2 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +5 -2
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/custom-entry.d.ts +3 -1
- package/dist/modes/interactive/components/custom-entry.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-entry.js +7 -2
- package/dist/modes/interactive/components/custom-entry.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -0
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +1 -1
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +2 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +5 -2
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +2 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +52 -59
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/program-status-reporter.d.ts +34 -0
- package/dist/modes/interactive/program-status-reporter.d.ts.map +1 -0
- package/dist/modes/interactive/program-status-reporter.js +107 -0
- package/dist/modes/interactive/program-status-reporter.js.map +1 -0
- package/dist/modes/interactive/tasks/host-hooks.d.ts +14 -0
- package/dist/modes/interactive/tasks/host-hooks.d.ts.map +1 -0
- package/dist/modes/interactive/tasks/host-hooks.js +31 -0
- package/dist/modes/interactive/tasks/host-hooks.js.map +1 -0
- package/dist/modes/interactive/tool-view/tool-execution.d.ts +5 -0
- package/dist/modes/interactive/tool-view/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/tool-view/tool-execution.js +7 -0
- package/dist/modes/interactive/tool-view/tool-execution.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +24 -0
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/ansi.d.ts +8 -0
- package/dist/utils/ansi.d.ts.map +1 -1
- package/dist/utils/ansi.js +30 -11
- package/dist/utils/ansi.js.map +1 -1
- package/dist/utils/clipboard.d.ts.map +1 -1
- package/dist/utils/clipboard.js +12 -11
- package/dist/utils/clipboard.js.map +1 -1
- package/dist/utils/image-resize-core.d.ts +12 -0
- package/dist/utils/image-resize-core.d.ts.map +1 -1
- package/dist/utils/image-resize-core.js +5 -0
- package/dist/utils/image-resize-core.js.map +1 -1
- package/dist/utils/image-resize-worker.js +3 -2
- package/dist/utils/image-resize-worker.js.map +1 -1
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +9 -10
- package/dist/utils/image-resize.js.map +1 -1
- package/docs/bundled/README.md +1 -1
- package/docs/bundled/extensions/provider.md +1 -1
- package/docs/bundled/extensions/question.md +1 -1
- package/docs/bundled/extensions/search.md +50 -0
- package/docs/bundled/extensions/statusline.md +15 -41
- package/docs/codemode.md +23 -3
- package/docs/docs.json +0 -4
- package/docs/environment-variables.md +1 -0
- package/docs/extensions.md +5 -1
- package/docs/json.md +2 -2
- package/docs/llama-cpp.md +8 -1
- package/docs/models.md +4 -1
- package/docs/providers.md +17 -0
- package/docs/rpc.md +6 -3
- package/docs/session-format.md +1 -0
- package/docs/settings.md +3 -3
- package/docs/terminal-setup.md +14 -0
- package/docs/usage.md +5 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +1 -1
- package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +54 -54
- package/package.json +13 -11
- package/dist/bundle/chunks/chunk-57XI7YJH.js +0 -2
- package/dist/bundle/chunks/chunk-JI4WGISU.js +0 -2
- package/dist/bundle/chunks/chunk-TCQ4HHQD.js +0 -2
- package/dist/bundle/chunks/chunk-TXJO4AJ7.js +0 -11
- package/dist/bundle/chunks/cloudflare-workers-ai-system-one-OWU5SM6J.js +0 -2
- package/dist/bundle/chunks/typesafe-system-one-KYKKNU3E.js +0 -2
- package/dist/extensions/web-search/auth.d.ts +0 -12
- package/dist/extensions/web-search/auth.d.ts.map +0 -1
- package/dist/extensions/web-search/auth.js +0 -90
- package/dist/extensions/web-search/auth.js.map +0 -1
- package/dist/extensions/web-search/constants.d.ts +0 -13
- package/dist/extensions/web-search/constants.d.ts.map +0 -1
- package/dist/extensions/web-search/constants.js +0 -26
- package/dist/extensions/web-search/constants.js.map +0 -1
- package/dist/extensions/web-search/execute.d.ts +0 -9
- package/dist/extensions/web-search/execute.d.ts.map +0 -1
- package/dist/extensions/web-search/execute.js +0 -96
- package/dist/extensions/web-search/execute.js.map +0 -1
- package/dist/extensions/web-search/format.d.ts +0 -21
- package/dist/extensions/web-search/format.d.ts.map +0 -1
- package/dist/extensions/web-search/format.js +0 -117
- package/dist/extensions/web-search/format.js.map +0 -1
- package/dist/extensions/web-search/index.d.ts +0 -6
- package/dist/extensions/web-search/index.d.ts.map +0 -1
- package/dist/extensions/web-search/index.js +0 -50
- package/dist/extensions/web-search/index.js.map +0 -1
- package/dist/extensions/web-search/providers/deepseek.d.ts +0 -13
- package/dist/extensions/web-search/providers/deepseek.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/deepseek.js +0 -110
- package/dist/extensions/web-search/providers/deepseek.js.map +0 -1
- package/dist/extensions/web-search/providers/http.d.ts +0 -4
- package/dist/extensions/web-search/providers/http.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/http.js +0 -42
- package/dist/extensions/web-search/providers/http.js.map +0 -1
- package/dist/extensions/web-search/providers/minimax.d.ts +0 -12
- package/dist/extensions/web-search/providers/minimax.d.ts.map +0 -1
- package/dist/extensions/web-search/providers/minimax.js +0 -61
- package/dist/extensions/web-search/providers/minimax.js.map +0 -1
- package/dist/extensions/web-search/render.d.ts +0 -15
- package/dist/extensions/web-search/render.d.ts.map +0 -1
- package/dist/extensions/web-search/render.js +0 -142
- package/dist/extensions/web-search/render.js.map +0 -1
- package/dist/extensions/web-search/results.d.ts +0 -35
- package/dist/extensions/web-search/results.d.ts.map +0 -1
- package/dist/extensions/web-search/results.js +0 -167
- package/dist/extensions/web-search/results.js.map +0 -1
- package/dist/extensions/web-search/schema.d.ts +0 -10
- package/dist/extensions/web-search/schema.d.ts.map +0 -1
- package/dist/extensions/web-search/schema.js +0 -36
- package/dist/extensions/web-search/schema.js.map +0 -1
- package/dist/extensions/web-search/types.d.ts +0 -51
- package/dist/extensions/web-search/types.d.ts.map +0 -1
- package/dist/extensions/web-search/types.js +0 -5
- package/dist/extensions/web-search/types.js.map +0 -1
- package/docs/bundled/extensions/web-search.md +0 -46
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { confirmStopBranchTasks, hotkeysTaskSection } from "./tasks/host-hooks.js";
|
|
1
2
|
import { bindTasksUI } from "./tasks/index.js";
|
|
2
|
-
import { cleanTaskText, firstCommandLine } from "./tasks/text.js";
|
|
3
3
|
/**
|
|
4
4
|
* Interactive mode for the coding agent.
|
|
5
5
|
* Handles TUI rendering and user interaction, delegating business logic to AgentSession.
|
|
@@ -22,7 +22,7 @@ import { findExtensionStackMatches, recordCrash, takeUnnotifiedCrash } from "../
|
|
|
22
22
|
import { DEFAULT_THINKING_LEVEL, THINKING_LEVEL_OPTIONS } from "../../core/defaults.js";
|
|
23
23
|
import { FooterDataProvider } from "../../core/footer-data-provider.js";
|
|
24
24
|
import { configureHttpDispatcher, formatHttpIdleTimeoutMs } from "../../core/http-dispatcher.js";
|
|
25
|
-
import {
|
|
25
|
+
import { KeybindingsManager } from "../../core/keybindings.js";
|
|
26
26
|
import { createCompactionSummaryMessage, createCustomMessage } from "../../core/messages.js";
|
|
27
27
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
|
|
28
28
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
@@ -86,6 +86,7 @@ import { InteractiveEditorHost } from "./editor-host.js";
|
|
|
86
86
|
import { editInExternalEditor } from "./external-editor.js";
|
|
87
87
|
import { refreshModelCatalogs } from "./model-catalog-refresh.js";
|
|
88
88
|
import { getModelSearchText } from "./model-search.js";
|
|
89
|
+
import { ProgramStatusReporter } from "./program-status-reporter.js";
|
|
89
90
|
import { shareSession } from "./session-share.js";
|
|
90
91
|
import { getAvailableThemes, getAvailableThemesWithPaths, getEditorTheme, getMarkdownTheme, getThemeByName, onThemeChange, SYSTEM_THEME_NAME, setRegisteredThemes, stopThemeWatcher, Theme, theme, } from "./theme/theme.js";
|
|
91
92
|
import { InteractiveThemeController } from "./theme/theme-controller.js";
|
|
@@ -131,22 +132,6 @@ function isCompactionCostNotice(item) {
|
|
|
131
132
|
function isUsageSessionEntry(item) {
|
|
132
133
|
return "type" in item && item.type === "usage";
|
|
133
134
|
}
|
|
134
|
-
/**
|
|
135
|
-
* Task rows for `/hotkeys`. Task keybindings act outside the editor, so they never showed up in
|
|
136
|
-
* the editor-driven sections; labels come from KEYBINDINGS so the table cannot drift from the
|
|
137
|
-
* binding registry.
|
|
138
|
-
*/
|
|
139
|
-
function hotkeysTaskSection(display) {
|
|
140
|
-
const detach = KEYBINDINGS["app.tasks.detach"];
|
|
141
|
-
const detachSelected = KEYBINDINGS["app.tasks.detachSelected"];
|
|
142
|
-
return `
|
|
143
|
-
**Tasks**
|
|
144
|
-
| Key | Action |
|
|
145
|
-
|-----|--------|
|
|
146
|
-
| \`${display("app.tasks.detach")}\` | ${detach.description} |
|
|
147
|
-
| \`${display("app.tasks.detachSelected")}\` | ${detachSelected.description} (while /tasks is open) |
|
|
148
|
-
`;
|
|
149
|
-
}
|
|
150
135
|
// EIO: tty reads/ioctls from an orphaned background process group, or writes after hangup.
|
|
151
136
|
// ENOTTY: the tty was revoked (macOS) and stdin is no longer a terminal.
|
|
152
137
|
const DEAD_TERMINAL_ERROR_CODES = new Set(["EIO", "EPIPE", "ENOTCONN", "ENOTTY"]);
|
|
@@ -326,6 +311,8 @@ export class InteractiveMode {
|
|
|
326
311
|
this.compactionQueuedMessages = [];
|
|
327
312
|
// Shutdown state
|
|
328
313
|
this.shutdownRequested = false;
|
|
314
|
+
/** Reports working, blocked, done, and error states to terminals that support OSC 7501. */
|
|
315
|
+
this.programStatus = new ProgramStatusReporter(() => this.ui.terminal, () => this.sessionManager.getSessionName());
|
|
329
316
|
/** The `/bug` hint is shown at most once per session so error output stays readable. */
|
|
330
317
|
this.bugReportHintShown = false;
|
|
331
318
|
this.installChangeWarningShown = false;
|
|
@@ -700,6 +687,7 @@ export class InteractiveMode {
|
|
|
700
687
|
// Start the UI before initializing extensions so session_start handlers can use interactive dialogs
|
|
701
688
|
this.ui.start();
|
|
702
689
|
this.isInitialized = true;
|
|
690
|
+
this.programStatus.report();
|
|
703
691
|
this.ensurePngTranscoder();
|
|
704
692
|
this.themeController.applyFromSettings();
|
|
705
693
|
// The header and startup notices bake theme colors into their text, so build them once the terminal
|
|
@@ -1588,6 +1576,7 @@ export class InteractiveMode {
|
|
|
1588
1576
|
const session = this.session;
|
|
1589
1577
|
this.unsubscribe?.();
|
|
1590
1578
|
this.unsubscribe = undefined;
|
|
1579
|
+
this.programStatus.reset();
|
|
1591
1580
|
this.applyRuntimeSettings();
|
|
1592
1581
|
if (options.renderBeforeBind) {
|
|
1593
1582
|
this.renderCurrentSessionState();
|
|
@@ -2070,7 +2059,7 @@ export class InteractiveMode {
|
|
|
2070
2059
|
/**
|
|
2071
2060
|
* Show a selector for extensions.
|
|
2072
2061
|
*/
|
|
2073
|
-
showExtensionSelector(title, options, opts) {
|
|
2062
|
+
showExtensionSelector(title, options, opts, blocked = { kind: "question", message: title }) {
|
|
2074
2063
|
return new Promise((resolve) => {
|
|
2075
2064
|
if (opts?.signal?.aborted) {
|
|
2076
2065
|
resolve(undefined);
|
|
@@ -2099,6 +2088,8 @@ export class InteractiveMode {
|
|
|
2099
2088
|
this.editorContainer.clear();
|
|
2100
2089
|
this.editorContainer.addChild(this.extensionSelector);
|
|
2101
2090
|
this.ui.setFocus(this.extensionSelector);
|
|
2091
|
+
// Extension dialogs share the editor slot: opening one replaces the status of a displaced one.
|
|
2092
|
+
this.programStatus.setBlocked("extension-dialog", blocked);
|
|
2102
2093
|
this.ui.requestRender();
|
|
2103
2094
|
});
|
|
2104
2095
|
}
|
|
@@ -2110,6 +2101,7 @@ export class InteractiveMode {
|
|
|
2110
2101
|
this.editorContainer.clear();
|
|
2111
2102
|
this.editorContainer.addChild(this.editor);
|
|
2112
2103
|
this.extensionSelector = undefined;
|
|
2104
|
+
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2113
2105
|
this.ui.setFocus(this.editor);
|
|
2114
2106
|
this.ui.requestRender();
|
|
2115
2107
|
}
|
|
@@ -2119,7 +2111,7 @@ export class InteractiveMode {
|
|
|
2119
2111
|
async showExtensionConfirm(title, message, opts) {
|
|
2120
2112
|
// The message is context, not a heading: render it as the selector's
|
|
2121
2113
|
// description instead of folding it into the accent-bold title.
|
|
2122
|
-
const result = await this.showExtensionSelector(title, ["Yes", "No"], { ...opts, description: message });
|
|
2114
|
+
const result = await this.showExtensionSelector(title, ["Yes", "No"], { ...opts, description: message }, { kind: "permission", message: title });
|
|
2123
2115
|
return result === "Yes";
|
|
2124
2116
|
}
|
|
2125
2117
|
async promptForMissingSessionCwd(error) {
|
|
@@ -2153,6 +2145,7 @@ export class InteractiveMode {
|
|
|
2153
2145
|
this.editorContainer.clear();
|
|
2154
2146
|
this.editorContainer.addChild(this.extensionInput);
|
|
2155
2147
|
this.ui.setFocus(this.extensionInput);
|
|
2148
|
+
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2156
2149
|
this.ui.requestRender();
|
|
2157
2150
|
});
|
|
2158
2151
|
}
|
|
@@ -2164,6 +2157,7 @@ export class InteractiveMode {
|
|
|
2164
2157
|
this.editorContainer.clear();
|
|
2165
2158
|
this.editorContainer.addChild(this.editor);
|
|
2166
2159
|
this.extensionInput = undefined;
|
|
2160
|
+
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2167
2161
|
this.ui.setFocus(this.editor);
|
|
2168
2162
|
this.ui.requestRender();
|
|
2169
2163
|
}
|
|
@@ -2183,6 +2177,7 @@ export class InteractiveMode {
|
|
|
2183
2177
|
this.editorContainer.clear();
|
|
2184
2178
|
this.editorContainer.addChild(this.extensionEditor);
|
|
2185
2179
|
this.ui.setFocus(this.extensionEditor);
|
|
2180
|
+
this.programStatus.setBlocked("extension-dialog", { kind: "question", message: title });
|
|
2186
2181
|
this.ui.requestRender();
|
|
2187
2182
|
});
|
|
2188
2183
|
}
|
|
@@ -2193,6 +2188,7 @@ export class InteractiveMode {
|
|
|
2193
2188
|
this.editorContainer.clear();
|
|
2194
2189
|
this.editorContainer.addChild(this.editor);
|
|
2195
2190
|
this.extensionEditor = undefined;
|
|
2191
|
+
this.programStatus.setBlocked("extension-dialog", undefined);
|
|
2196
2192
|
this.ui.setFocus(this.editor);
|
|
2197
2193
|
this.ui.requestRender();
|
|
2198
2194
|
}
|
|
@@ -2712,6 +2708,7 @@ export class InteractiveMode {
|
|
|
2712
2708
|
await this.init();
|
|
2713
2709
|
}
|
|
2714
2710
|
this.footer.invalidate();
|
|
2711
|
+
this.programStatus.handleEvent(event);
|
|
2715
2712
|
switch (event.type) {
|
|
2716
2713
|
case "agent_start":
|
|
2717
2714
|
this.pendingTools.clear();
|
|
@@ -2817,6 +2814,7 @@ export class InteractiveMode {
|
|
|
2817
2814
|
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
2818
2815
|
showImages: this.settingsManager.getShowImages(),
|
|
2819
2816
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
2817
|
+
outputPad: this.outputPad,
|
|
2820
2818
|
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
2821
2819
|
component.setExpanded(this.toolOutputExpanded);
|
|
2822
2820
|
this.chatContainer.addChild(component);
|
|
@@ -2887,6 +2885,7 @@ export class InteractiveMode {
|
|
|
2887
2885
|
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
2888
2886
|
showImages: this.settingsManager.getShowImages(),
|
|
2889
2887
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
2888
|
+
outputPad: this.outputPad,
|
|
2890
2889
|
}, this.getRegisteredToolDefinition(event.toolName), this.ui, this.sessionManager.getCwd());
|
|
2891
2890
|
component.setExpanded(this.toolOutputExpanded);
|
|
2892
2891
|
this.chatContainer.addChild(component);
|
|
@@ -2909,7 +2908,7 @@ export class InteractiveMode {
|
|
|
2909
2908
|
this.maybeShowInstallChangeWarning();
|
|
2910
2909
|
const component = this.pendingTools.get(event.toolCallId);
|
|
2911
2910
|
if (component) {
|
|
2912
|
-
component.updateResult({ ...event.result, isError: event.isError });
|
|
2911
|
+
component.updateResult({ ...event.result, isError: event.isError, durationMs: event.durationMs });
|
|
2913
2912
|
this.pendingTools.delete(event.toolCallId);
|
|
2914
2913
|
this.ui.requestRender();
|
|
2915
2914
|
}
|
|
@@ -3093,7 +3092,7 @@ export class InteractiveMode {
|
|
|
3093
3092
|
if (!renderer) {
|
|
3094
3093
|
return;
|
|
3095
3094
|
}
|
|
3096
|
-
const component = new CustomEntryComponent(entry, renderer);
|
|
3095
|
+
const component = new CustomEntryComponent(entry, renderer, this.outputPad);
|
|
3097
3096
|
component.setExpanded(this.toolOutputExpanded);
|
|
3098
3097
|
if (!component.hasContent()) {
|
|
3099
3098
|
return;
|
|
@@ -3110,7 +3109,7 @@ export class InteractiveMode {
|
|
|
3110
3109
|
addMessageToChat(message, options) {
|
|
3111
3110
|
switch (message.role) {
|
|
3112
3111
|
case "bashExecution": {
|
|
3113
|
-
const component = new BashExecutionComponent(message.command, this.ui, message.excludeFromContext);
|
|
3112
|
+
const component = new BashExecutionComponent(message.command, this.ui, message.excludeFromContext, this.outputPad);
|
|
3114
3113
|
if (message.output) {
|
|
3115
3114
|
component.appendOutput(message.output);
|
|
3116
3115
|
}
|
|
@@ -3129,14 +3128,14 @@ export class InteractiveMode {
|
|
|
3129
3128
|
}
|
|
3130
3129
|
case "compactionSummary": {
|
|
3131
3130
|
this.chatContainer.addChild(new Spacer(1));
|
|
3132
|
-
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings());
|
|
3131
|
+
const component = new CompactionSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3133
3132
|
component.setExpanded(this.toolOutputExpanded);
|
|
3134
3133
|
this.chatContainer.addChild(component);
|
|
3135
3134
|
break;
|
|
3136
3135
|
}
|
|
3137
3136
|
case "branchSummary": {
|
|
3138
3137
|
this.chatContainer.addChild(new Spacer(1));
|
|
3139
|
-
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings());
|
|
3138
|
+
const component = new BranchSummaryMessageComponent(message, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3140
3139
|
component.setExpanded(this.toolOutputExpanded);
|
|
3141
3140
|
this.chatContainer.addChild(component);
|
|
3142
3141
|
break;
|
|
@@ -3152,7 +3151,7 @@ export class InteractiveMode {
|
|
|
3152
3151
|
const skillBlock = parseSkillBlock(textContent);
|
|
3153
3152
|
if (skillBlock) {
|
|
3154
3153
|
// Render skill block (collapsible)
|
|
3155
|
-
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings());
|
|
3154
|
+
const component = new SkillInvocationMessageComponent(skillBlock, this.getMarkdownThemeWithSettings(), this.outputPad);
|
|
3156
3155
|
component.setExpanded(this.toolOutputExpanded);
|
|
3157
3156
|
this.chatContainer.addChild(component);
|
|
3158
3157
|
// Render user message separately if present
|
|
@@ -3221,6 +3220,7 @@ export class InteractiveMode {
|
|
|
3221
3220
|
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
3222
3221
|
showImages: this.settingsManager.getShowImages(),
|
|
3223
3222
|
imageWidthCells: this.settingsManager.getImageWidthCells(),
|
|
3223
|
+
outputPad: this.outputPad,
|
|
3224
3224
|
}, this.getRegisteredToolDefinition(content.name), this.ui, this.sessionManager.getCwd());
|
|
3225
3225
|
component.setExpanded(this.toolOutputExpanded);
|
|
3226
3226
|
this.chatContainer.addChild(component);
|
|
@@ -3274,6 +3274,9 @@ export class InteractiveMode {
|
|
|
3274
3274
|
* @param options.populateHistory Add user messages to editor history
|
|
3275
3275
|
*/
|
|
3276
3276
|
renderSessionEntries(entries, options = {}) {
|
|
3277
|
+
// Selection coordinates point into the transcript being replaced (#9311).
|
|
3278
|
+
if (this.renderer instanceof TuiAltScreen)
|
|
3279
|
+
this.renderer.resetTextSelection();
|
|
3277
3280
|
const items = entries.flatMap((entry) => {
|
|
3278
3281
|
if (entry.type === "custom" || (entry.type === "usage" && entry.kind === "cache_warm")) {
|
|
3279
3282
|
return [entry];
|
|
@@ -4170,21 +4173,14 @@ export class InteractiveMode {
|
|
|
4170
4173
|
onOutputPadChange: (padding) => {
|
|
4171
4174
|
this.settingsManager.setOutputPad(padding);
|
|
4172
4175
|
this.outputPad = padding;
|
|
4173
|
-
|
|
4174
|
-
for (const child of
|
|
4175
|
-
if (child
|
|
4176
|
-
child instanceof CustomMessageComponent ||
|
|
4177
|
-
child instanceof UserMessageComponent) {
|
|
4176
|
+
for (const container of [this.chatContainer, this.pendingMessagesContainer]) {
|
|
4177
|
+
for (const child of container.children) {
|
|
4178
|
+
if ("setOutputPad" in child && typeof child.setOutputPad === "function") {
|
|
4178
4179
|
child.setOutputPad(padding);
|
|
4179
4180
|
}
|
|
4180
4181
|
}
|
|
4181
|
-
if (this.streamingComponent) {
|
|
4182
|
-
this.streamingComponent.setOutputPad(padding);
|
|
4183
|
-
}
|
|
4184
|
-
this.ui.requestRender();
|
|
4185
|
-
return;
|
|
4186
4182
|
}
|
|
4187
|
-
this.
|
|
4183
|
+
this.ui.requestRender();
|
|
4188
4184
|
},
|
|
4189
4185
|
onAutocompleteMaxVisibleChange: (maxVisible) => {
|
|
4190
4186
|
this.settingsManager.setAutocompleteMaxVisible(maxVisible);
|
|
@@ -4619,19 +4615,10 @@ export class InteractiveMode {
|
|
|
4619
4615
|
}
|
|
4620
4616
|
// Ask about summarization
|
|
4621
4617
|
done(); // Close selector first
|
|
4622
|
-
// Results are saved on their launch branch, so leaving it stops its running tasks.
|
|
4623
4618
|
const stopped = this.session.tasksStoppedByTreeNavigation(entryId);
|
|
4624
|
-
if (stopped
|
|
4625
|
-
|
|
4626
|
-
|
|
4627
|
-
.map((task) => ` ${cleanTaskText(firstCommandLine(task.command ?? task.title))}`);
|
|
4628
|
-
if (stopped.length > shown.length)
|
|
4629
|
-
shown.push(` …and ${stopped.length - shown.length} more`);
|
|
4630
|
-
const confirmed = await this.showExtensionConfirm(`Stop ${stopped.length} running task${stopped.length === 1 ? "" : "s"}?`, `They were started on the branch you are leaving and will be cancelled:\n${shown.join("\n")}`);
|
|
4631
|
-
if (!confirmed) {
|
|
4632
|
-
this.showTreeSelector(entryId);
|
|
4633
|
-
return;
|
|
4634
|
-
}
|
|
4619
|
+
if (!(await confirmStopBranchTasks(stopped, (title, message) => this.showExtensionConfirm(title, message)))) {
|
|
4620
|
+
this.showTreeSelector(entryId);
|
|
4621
|
+
return;
|
|
4635
4622
|
}
|
|
4636
4623
|
// Loop until user makes a complete choice or cancels to tree
|
|
4637
4624
|
let wantsSummary = false;
|
|
@@ -5161,7 +5148,7 @@ export class InteractiveMode {
|
|
|
5161
5148
|
this.ui.requestRender();
|
|
5162
5149
|
};
|
|
5163
5150
|
try {
|
|
5164
|
-
await this.loginProvider(dialog, providerId, "api_key");
|
|
5151
|
+
await this.loginProvider(dialog, providerId, providerName, "api_key");
|
|
5165
5152
|
restoreEditor();
|
|
5166
5153
|
await this.completeProviderAuthentication(providerId, providerName, "api_key", previousModel);
|
|
5167
5154
|
}
|
|
@@ -5249,12 +5236,18 @@ export class InteractiveMode {
|
|
|
5249
5236
|
dialog.showProgress(event.message);
|
|
5250
5237
|
}
|
|
5251
5238
|
}
|
|
5252
|
-
async loginProvider(dialog, providerId, method) {
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5239
|
+
async loginProvider(dialog, providerId, providerName, method) {
|
|
5240
|
+
this.programStatus.setBlocked("login", { kind: "auth", message: `Log in to ${providerName}` });
|
|
5241
|
+
try {
|
|
5242
|
+
await this.session.modelRuntime.login(providerId, method, {
|
|
5243
|
+
signal: dialog.signal,
|
|
5244
|
+
prompt: (prompt) => this.showAuthPrompt(dialog, prompt, providerId),
|
|
5245
|
+
notify: (event) => this.notifyAuthDialog(dialog, event),
|
|
5246
|
+
}, { getDeviceId: () => this.settingsManager.getOrCreateDeviceId() });
|
|
5247
|
+
}
|
|
5248
|
+
finally {
|
|
5249
|
+
this.programStatus.setBlocked("login", undefined);
|
|
5250
|
+
}
|
|
5258
5251
|
}
|
|
5259
5252
|
async showLoginDialog(providerId, providerName, onBack) {
|
|
5260
5253
|
const previousModel = this.session.model;
|
|
@@ -5270,7 +5263,7 @@ export class InteractiveMode {
|
|
|
5270
5263
|
this.ui.requestRender();
|
|
5271
5264
|
};
|
|
5272
5265
|
try {
|
|
5273
|
-
await this.loginProvider(dialog, providerId, "oauth");
|
|
5266
|
+
await this.loginProvider(dialog, providerId, providerName, "oauth");
|
|
5274
5267
|
restoreEditor();
|
|
5275
5268
|
await this.completeProviderAuthentication(providerId, providerName, "oauth", previousModel);
|
|
5276
5269
|
if (providerId === RADIUS_PROVIDER_ID)
|
|
@@ -5861,7 +5854,7 @@ export class InteractiveMode {
|
|
|
5861
5854
|
if (eventResult?.result) {
|
|
5862
5855
|
const result = eventResult.result;
|
|
5863
5856
|
// Create UI component for display
|
|
5864
|
-
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
|
|
5857
|
+
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
5865
5858
|
if (this.session.isStreaming) {
|
|
5866
5859
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|
|
5867
5860
|
this.pendingBashComponents.push(this.bashComponent);
|
|
@@ -5882,7 +5875,7 @@ export class InteractiveMode {
|
|
|
5882
5875
|
}
|
|
5883
5876
|
// Normal execution path (possibly with custom operations)
|
|
5884
5877
|
const isDeferred = this.session.isStreaming;
|
|
5885
|
-
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext);
|
|
5878
|
+
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
5886
5879
|
if (isDeferred) {
|
|
5887
5880
|
// Show in pending area when agent is streaming
|
|
5888
5881
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|