@draht/coding-agent 2026.11.5 → 2026.11.14
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 +66 -0
- package/dist/bundle/chunks/anthropic-messages-FKSSTO6N.js +6 -0
- package/dist/bundle/chunks/{azure-openai-responses-5YLWRJ4E.js → azure-openai-responses-AHIW4IRP.js} +1 -1
- package/dist/bundle/chunks/bedrock-converse-stream.js +2 -2
- package/dist/bundle/chunks/chunk-2CHTECAU.js +2 -0
- package/dist/bundle/chunks/{chunk-SPVE2GM7.js → chunk-46NQOOTO.js} +1 -1
- package/dist/bundle/chunks/{chunk-MKVW4KK2.js → chunk-4ALYWMDD.js} +1 -1
- package/dist/bundle/chunks/{chunk-EXZUXBS5.js → chunk-5K3TBDND.js} +12 -15
- package/dist/bundle/chunks/{chunk-PRT3JHOZ.js → chunk-DFFQ5ETM.js} +1 -1
- package/dist/bundle/chunks/chunk-EBTEI43G.js +20 -0
- package/dist/bundle/chunks/{chunk-LJ3SEGWI.js → chunk-G7DJ6PIU.js} +5 -1
- package/dist/bundle/chunks/{chunk-3LFBXSCO.js → chunk-GR3JEDCL.js} +1 -1
- package/dist/bundle/chunks/{chunk-JAT7HEFU.js → chunk-HIL6BIBX.js} +2 -2
- package/dist/bundle/chunks/{chunk-PZKD35UB.js → chunk-MXA4WY3C.js} +1 -1
- package/dist/bundle/chunks/chunk-NJDELBDB.js +82 -0
- package/dist/bundle/chunks/{chunk-CLNF6E5P.js → chunk-NLVN7RG3.js} +1 -1
- package/dist/bundle/chunks/chunk-NLYBRJ3F.js +9 -0
- package/dist/bundle/chunks/{chunk-UQSONZLL.js → chunk-OPLOTJXH.js} +3 -1
- package/dist/bundle/chunks/{chunk-YUBUKEPQ.js → chunk-PPJRJAR3.js} +169 -130
- package/dist/bundle/chunks/chunk-RIPTEKPX.js +44 -0
- package/dist/bundle/chunks/chunk-ROB5AWV5.js +30 -0
- package/dist/bundle/chunks/chunk-WNZ64GW3.js +2 -0
- package/dist/bundle/chunks/{chunk-ABW2JATG.js → chunk-XEVRP72T.js} +1 -1
- package/dist/bundle/chunks/{chunk-SKQFE2GA.js → chunk-XY64T2H6.js} +1 -1
- package/dist/bundle/chunks/chunk-ZZAOELWU.js +2 -0
- package/dist/bundle/chunks/{cli-7AMCJ2UG.js → cli-JDGPEN7N.js} +3 -3
- package/dist/bundle/chunks/{cloudflare-workers-ai-system-one-QBCV2OWJ.js → cloudflare-workers-ai-system-one-ZPDQKK4H.js} +1 -1
- package/dist/bundle/chunks/codemode-worker.js +2 -0
- package/dist/bundle/chunks/{execute-VOIPQMCI.js → execute-YOMYOVUT.js} +2 -2
- package/dist/bundle/chunks/github-copilot.js +1 -1
- package/dist/bundle/chunks/google-generative-ai-EEDLVZAQ.js +2 -0
- package/dist/bundle/chunks/google-vertex-YQDP6U25.js +2 -0
- package/dist/bundle/chunks/{llama-cpp-classify-WGVYEPG2.js → llama-cpp-classify-SRUYBPZS.js} +1 -1
- package/dist/bundle/chunks/{mistral-conversations-PV6RDK65.js → mistral-conversations-QKVAIF57.js} +1 -1
- package/dist/bundle/chunks/{openai-codex-responses-SEOL3EDF.js → openai-codex-responses-2FIT2Z3L.js} +1 -1
- package/dist/bundle/chunks/{openai-completions-U32QPS37.js → openai-completions-42OND4EW.js} +3 -3
- package/dist/bundle/chunks/{openai-decisions-ULSYFV2A.js → openai-decisions-FAP6LRGH.js} +1 -1
- package/dist/bundle/chunks/{openai-responses-5MYZJYPK.js → openai-responses-BGC7WCIQ.js} +1 -1
- package/dist/bundle/chunks/{openrouter-images-SGOP5SDW.js → openrouter-images-EAWW57ZG.js} +1 -1
- package/dist/bundle/chunks/{pi-messages-QALFE2BD.js → pi-messages-JM6JDMH5.js} +1 -1
- package/dist/bundle/chunks/{runtime-GDH3ZURV.js → runtime-F63NCS5Y.js} +1 -1
- package/dist/bundle/chunks/{runtime-Z74VFUDD.js → runtime-S5WBSLTE.js} +1 -1
- package/dist/bundle/chunks/{settings-manager-T6UJFO2F.js → settings-manager-H3QEOPQ3.js} +1 -1
- package/dist/bundle/chunks/{typesafe-system-one-GTGS5MG6.js → typesafe-system-one-QOA2PTJR.js} +1 -1
- package/dist/bundle/chunks/virtual-modules-2BURZRW7.js +2 -0
- package/dist/bundle/cli-runtime.js +1 -1
- package/dist/bundle/index.js +1 -1
- package/dist/bundle/rpc-entry.js +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +5 -3
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/auth-command.d.ts.map +1 -1
- package/dist/cli/auth-command.js +30 -6
- package/dist/cli/auth-command.js.map +1 -1
- package/dist/cli/auth-login.d.ts +15 -0
- package/dist/cli/auth-login.d.ts.map +1 -0
- package/dist/cli/auth-login.js +232 -0
- package/dist/cli/auth-login.js.map +1 -0
- package/dist/cli/auth-logout.d.ts +14 -0
- package/dist/cli/auth-logout.d.ts.map +1 -0
- package/dist/cli/auth-logout.js +57 -0
- package/dist/cli/auth-logout.js.map +1 -0
- package/dist/cli/auth-terminal.d.ts +17 -0
- package/dist/cli/auth-terminal.d.ts.map +1 -0
- package/dist/cli/auth-terminal.js +63 -0
- package/dist/cli/auth-terminal.js.map +1 -0
- package/dist/core/agent-session-runtime.d.ts +5 -0
- package/dist/core/agent-session-runtime.d.ts.map +1 -1
- package/dist/core/agent-session-runtime.js +16 -2
- package/dist/core/agent-session-runtime.js.map +1 -1
- package/dist/core/agent-session.d.ts +20 -9
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +71 -29
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/ai-schemas.d.ts +1 -0
- package/dist/core/ai-schemas.d.ts.map +1 -1
- package/dist/core/builtins/budgets.d.ts.map +1 -1
- package/dist/core/builtins/budgets.js +6 -3
- package/dist/core/builtins/budgets.js.map +1 -1
- package/dist/core/cache-warmer.d.ts +4 -37
- package/dist/core/cache-warmer.d.ts.map +1 -1
- package/dist/core/cache-warmer.js +11 -91
- package/dist/core/cache-warmer.js.map +1 -1
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js +2 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/exec.d.ts +1 -0
- package/dist/core/exec.d.ts.map +1 -1
- package/dist/core/exec.js +4 -1
- package/dist/core/exec.js.map +1 -1
- package/dist/core/export-html/ansi-to-html.d.ts +5 -0
- package/dist/core/export-html/ansi-to-html.d.ts.map +1 -1
- package/dist/core/export-html/ansi-to-html.js +57 -20
- package/dist/core/export-html/ansi-to-html.js.map +1 -1
- package/dist/core/export-html/template.js +1 -1
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +2 -3
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/types.d.ts +3 -2
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/model-config.d.ts +13 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-resolver.d.ts +0 -1
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +17 -24
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/model-runtime.d.ts +5 -0
- package/dist/core/model-runtime.d.ts.map +1 -1
- package/dist/core/model-runtime.js +7 -0
- package/dist/core/model-runtime.js.map +1 -1
- package/dist/core/polyphase/render/format.d.ts +2 -0
- package/dist/core/polyphase/render/format.d.ts.map +1 -1
- package/dist/core/polyphase/render/format.js +6 -0
- package/dist/core/polyphase/render/format.js.map +1 -1
- package/dist/core/polyphase/render/run-block.d.ts +4 -0
- package/dist/core/polyphase/render/run-block.d.ts.map +1 -1
- package/dist/core/polyphase/render/run-block.js +71 -12
- package/dist/core/polyphase/render/run-block.js.map +1 -1
- package/dist/core/polyphase/render/snapshot.d.ts +1 -1
- package/dist/core/polyphase/render/snapshot.d.ts.map +1 -1
- package/dist/core/polyphase/render/snapshot.js +22 -7
- package/dist/core/polyphase/render/snapshot.js.map +1 -1
- package/dist/core/polyphase/ui/dock.d.ts.map +1 -1
- package/dist/core/polyphase/ui/dock.js +34 -2
- package/dist/core/polyphase/ui/dock.js.map +1 -1
- package/dist/core/polyphase/ui/inspector.d.ts +18 -6
- package/dist/core/polyphase/ui/inspector.d.ts.map +1 -1
- package/dist/core/polyphase/ui/inspector.js +125 -44
- package/dist/core/polyphase/ui/inspector.js.map +1 -1
- package/dist/core/polyphase/ui/transcript-layout.d.ts.map +1 -1
- package/dist/core/polyphase/ui/transcript-layout.js +5 -1
- package/dist/core/polyphase/ui/transcript-layout.js.map +1 -1
- package/dist/core/preferred-providers.d.ts +17 -0
- package/dist/core/preferred-providers.d.ts.map +1 -0
- package/dist/core/preferred-providers.js +24 -0
- package/dist/core/preferred-providers.js.map +1 -0
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +18 -2
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/provider-composer.d.ts.map +1 -1
- package/dist/core/provider-composer.js +2 -0
- package/dist/core/provider-composer.js.map +1 -1
- package/dist/core/provider-matching.d.ts +6 -0
- package/dist/core/provider-matching.d.ts.map +1 -0
- package/dist/core/provider-matching.js +8 -0
- package/dist/core/provider-matching.js.map +1 -0
- package/dist/core/radius-mcp.d.ts +13 -0
- package/dist/core/radius-mcp.d.ts.map +1 -0
- package/dist/core/radius-mcp.js +29 -0
- package/dist/core/radius-mcp.js.map +1 -0
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -0
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/runtime-credentials.d.ts +8 -0
- package/dist/core/runtime-credentials.d.ts.map +1 -1
- package/dist/core/runtime-credentials.js +15 -1
- package/dist/core/runtime-credentials.js.map +1 -1
- package/dist/core/session-cwd.d.ts +7 -0
- package/dist/core/session-cwd.d.ts.map +1 -1
- package/dist/core/session-cwd.js +9 -1
- package/dist/core/session-cwd.js.map +1 -1
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +45 -36
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-defaults.d.ts +1 -1
- package/dist/core/settings-defaults.d.ts.map +1 -1
- package/dist/core/settings-defaults.js +1 -1
- package/dist/core/settings-defaults.js.map +1 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +35 -5
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +23 -14
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +182 -41
- package/dist/core/tools/edit-diff.js.map +1 -1
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +8 -7
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +57 -16
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +4 -0
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +20 -8
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/output-accumulator.d.ts.map +1 -1
- package/dist/core/tools/output-accumulator.js +4 -1
- package/dist/core/tools/output-accumulator.js.map +1 -1
- package/dist/core/tools/powershell.d.ts.map +1 -1
- package/dist/core/tools/powershell.js +15 -2
- package/dist/core/tools/powershell.js.map +1 -1
- package/dist/core/tools/read.d.ts +13 -0
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +146 -35
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/renderers/read.d.ts.map +1 -1
- package/dist/core/tools/renderers/read.js +6 -2
- package/dist/core/tools/renderers/read.js.map +1 -1
- package/dist/core/tools/truncate.d.ts +4 -0
- package/dist/core/tools/truncate.d.ts.map +1 -1
- package/dist/core/tools/truncate.js +24 -1
- package/dist/core/tools/truncate.js.map +1 -1
- package/dist/extensions/codemode/execute.js +4 -4
- package/dist/extensions/codemode/execute.js.map +1 -1
- package/dist/extensions/codemode/tool.d.ts.map +1 -1
- package/dist/extensions/codemode/tool.js +34 -12
- package/dist/extensions/codemode/tool.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts +1 -1
- package/dist/extensions/llama/provider.js +1 -1
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/llama/ui.d.ts.map +1 -1
- package/dist/extensions/llama/ui.js +15 -3
- package/dist/extensions/llama/ui.js.map +1 -1
- package/dist/extensions/mcp/cli.js +5 -8
- 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 +2 -1
- package/dist/extensions/mcp/index.js.map +1 -1
- package/dist/extensions/mcp/runtime.d.ts.map +1 -1
- package/dist/extensions/mcp/runtime.js +3 -2
- package/dist/extensions/mcp/runtime.js.map +1 -1
- package/dist/extensions/tool-search/tool.d.ts.map +1 -1
- package/dist/extensions/tool-search/tool.js +18 -6
- package/dist/extensions/tool-search/tool.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +67 -15
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +2 -19
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +14 -6
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +10 -3
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +32 -5
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/provider-brand.d.ts +14 -0
- package/dist/modes/interactive/components/provider-brand.d.ts.map +1 -0
- package/dist/modes/interactive/components/provider-brand.js +66 -0
- package/dist/modes/interactive/components/provider-brand.js.map +1 -0
- package/dist/modes/interactive/components/radius-login-selector.d.ts +1 -2
- package/dist/modes/interactive/components/radius-login-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/radius-login-selector.js +6 -37
- package/dist/modes/interactive/components/radius-login-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +6 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +23 -5
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +3 -1
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -1
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +133 -78
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.js +2 -0
- package/dist/modes/interactive/session-share.js.map +1 -1
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +27 -4
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/prompts/commands/test-audit.md +84 -0
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +3 -1
- package/dist/utils/image-resize.js.map +1 -1
- package/dist/utils/terminal-question.d.ts +8 -0
- package/dist/utils/terminal-question.d.ts.map +1 -0
- package/dist/utils/terminal-question.js +24 -0
- package/dist/utils/terminal-question.js.map +1 -0
- package/dist/utils/web-url.d.ts +12 -0
- package/dist/utils/web-url.d.ts.map +1 -0
- package/dist/utils/web-url.js +20 -0
- package/dist/utils/web-url.js.map +1 -0
- package/docs/cli.md +14 -1
- package/docs/extensions.md +6 -4
- package/docs/llama-cpp.md +5 -5
- package/docs/models-configuration.md +2 -1
- package/docs/nvidia-rtx-llama-cpp.md +5 -5
- package/docs/polyphase.md +13 -1
- package/docs/prompt-templates.md +1 -1
- package/docs/providers.md +4 -2
- package/docs/quickstart.md +1 -1
- package/docs/rpc-commands.md +1 -1
- package/docs/rpc.md +1 -1
- package/docs/sessions.md +7 -1
- package/docs/settings.md +1 -1
- package/docs/tui.md +1 -1
- package/examples/extensions/gondolin/index.ts +4 -7
- package/examples/extensions/subagent/index.ts +5 -1
- package/package.json +10 -10
- package/prompts/commands/test-audit.md +84 -0
- package/schemas/models.schema.json +5 -1
- package/schemas/settings.schema.json +1 -1
- package/dist/bundle/chunks/anthropic-messages-TXQXPH4S.js +0 -6
- package/dist/bundle/chunks/chunk-AOCWORXE.js +0 -2
- package/dist/bundle/chunks/chunk-DQ4G4IS4.js +0 -20
- package/dist/bundle/chunks/chunk-J7QTCDIN.js +0 -2
- package/dist/bundle/chunks/chunk-NNYZSIKR.js +0 -9
- package/dist/bundle/chunks/chunk-SUVMF4W5.js +0 -2
- package/dist/bundle/chunks/chunk-THDNEOXP.js +0 -44
- package/dist/bundle/chunks/chunk-TK3LS5QZ.js +0 -82
- package/dist/bundle/chunks/chunk-TYAEYYRA.js +0 -30
- package/dist/bundle/chunks/google-generative-ai-NC5KHHW3.js +0 -2
- package/dist/bundle/chunks/google-vertex-GAPUJEF7.js +0 -2
- package/dist/bundle/chunks/virtual-modules-ZUI2T3XR.js +0 -2
|
@@ -28,8 +28,11 @@ import { createCompactionSummaryMessage, createCustomMessage } from "../../core/
|
|
|
28
28
|
import { defaultModelPerProvider, findExactModelReferenceMatch, resolveModelScopeFromModels, } from "../../core/model-resolver.js";
|
|
29
29
|
import { CredentialSynchronizationError } from "../../core/model-runtime.js";
|
|
30
30
|
import { DefaultPackageManager } from "../../core/package-manager.js";
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
31
|
+
import { compareProviders } from "../../core/preferred-providers.js";
|
|
32
|
+
import { findMatchingProviders } from "../../core/provider-matching.js";
|
|
33
|
+
import { RADIUS_PROVIDER_ID } from "../../core/radius.js";
|
|
34
|
+
import { planRadiusMcpServer } from "../../core/radius-mcp.js";
|
|
35
|
+
import { formatMissingSessionCwdPrompt, getMissingSessionCwdOptions, MissingSessionCwdError, } from "../../core/session-cwd.js";
|
|
33
36
|
import { SessionManager, sessionEntryToContextMessages, } from "../../core/session-manager.js";
|
|
34
37
|
import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
35
38
|
import { boundedSafeText } from "../../core/socket-server/safe-text.js";
|
|
@@ -37,7 +40,7 @@ import { getSourcePackageKey } from "../../core/source-info.js";
|
|
|
37
40
|
import { withBuiltInRenderers } from "../../core/tools/renderers/index.js";
|
|
38
41
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "../../core/trust-manager.js";
|
|
39
42
|
import { getUsageCostBreakdown } from "../../core/usage-totals.js";
|
|
40
|
-
import { addMcpServerConfig
|
|
43
|
+
import { addMcpServerConfig } from "../../extensions/mcp/config.js";
|
|
41
44
|
import { getChangelogPath, getNewEntries, normalizeChangelogLinks, parseChangelog } from "../../utils/changelog.js";
|
|
42
45
|
import { copyToClipboard, readClipboardFilePaths, readClipboardText } from "../../utils/clipboard.js";
|
|
43
46
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
@@ -213,7 +216,7 @@ function getLoginProviderCompletionOptions(providerOptions) {
|
|
|
213
216
|
subscription: provider.subscription,
|
|
214
217
|
});
|
|
215
218
|
}
|
|
216
|
-
return Array.from(byId.values()).sort(
|
|
219
|
+
return Array.from(byId.values()).sort(compareProviders);
|
|
217
220
|
}
|
|
218
221
|
function getLoginProviderSearchText(provider) {
|
|
219
222
|
const authTypes = provider.authTypes
|
|
@@ -271,6 +274,8 @@ export class InteractiveMode {
|
|
|
271
274
|
changelogMarkdown = undefined;
|
|
272
275
|
extensionChangelogUpdates = [];
|
|
273
276
|
startupNoticesShown = false;
|
|
277
|
+
/** Last cache-warming notice, extended in place while it is the last chat line. */
|
|
278
|
+
cacheWarmingNotice;
|
|
274
279
|
anthropicSubscriptionWarningShown = false;
|
|
275
280
|
// Status line tracking (for mutating immediately-sequential status updates)
|
|
276
281
|
lastStatusSpacer = undefined;
|
|
@@ -332,6 +337,13 @@ export class InteractiveMode {
|
|
|
332
337
|
extensionDialogs = [];
|
|
333
338
|
/** Label of the surface that decided the open ask elsewhere, pending a one-line notice. */
|
|
334
339
|
extensionDialogDecidedBy = undefined;
|
|
340
|
+
/** Numbers the program status sources of blocking overlays, so closing one keeps the others. */
|
|
341
|
+
nextBlockingOverlayId = 0;
|
|
342
|
+
/**
|
|
343
|
+
* Open extension overlays (custom with overlay: true) and the function that removes each, in opening
|
|
344
|
+
* order. Reset removes only these, not draht's own overlays.
|
|
345
|
+
*/
|
|
346
|
+
extensionOverlays = new Map();
|
|
335
347
|
extensionTerminalInputSubscriptions = new Set();
|
|
336
348
|
// Extension widgets (components rendered above/below the editor)
|
|
337
349
|
extensionWidgetsAbove = new Map();
|
|
@@ -1782,6 +1794,7 @@ export class InteractiveMode {
|
|
|
1782
1794
|
this.loadedResourcesContainer.clear();
|
|
1783
1795
|
this.chatContainer.clear();
|
|
1784
1796
|
this.pendingMessagesContainer.clear();
|
|
1797
|
+
this.pendingBashComponents = [];
|
|
1785
1798
|
this.compactionQueuedMessages = [];
|
|
1786
1799
|
this.streamingComponent = undefined;
|
|
1787
1800
|
this.streamingMessage = undefined;
|
|
@@ -1996,7 +2009,10 @@ export class InteractiveMode {
|
|
|
1996
2009
|
}
|
|
1997
2010
|
resetExtensionUI() {
|
|
1998
2011
|
this.closeAllExtensionDialogs();
|
|
1999
|
-
|
|
2012
|
+
// Reload and session switches replace every extension without calling done(): remove their overlays,
|
|
2013
|
+
// newest first, the same way done() does, but leave the promises pending as for inline dialogs.
|
|
2014
|
+
for (const removeOverlay of [...this.extensionOverlays.values()].reverse())
|
|
2015
|
+
removeOverlay();
|
|
2000
2016
|
this.clearExtensionTerminalInputListeners();
|
|
2001
2017
|
this.setExtensionFooter(undefined);
|
|
2002
2018
|
this.setExtensionHeader(undefined);
|
|
@@ -2394,8 +2410,9 @@ export class InteractiveMode {
|
|
|
2394
2410
|
return [...summaryRows, ...labeledRows];
|
|
2395
2411
|
}
|
|
2396
2412
|
async promptForMissingSessionCwd(error) {
|
|
2397
|
-
const
|
|
2398
|
-
|
|
2413
|
+
const options = getMissingSessionCwdOptions(error.issue);
|
|
2414
|
+
const label = await this.showExtensionSelector(formatMissingSessionCwdPrompt(error.issue), options.map((option) => option.label));
|
|
2415
|
+
return options.find((option) => option.label === label)?.value;
|
|
2399
2416
|
}
|
|
2400
2417
|
/**
|
|
2401
2418
|
* Show a text input for extensions.
|
|
@@ -2547,6 +2564,8 @@ export class InteractiveMode {
|
|
|
2547
2564
|
return new Promise((resolve, reject) => {
|
|
2548
2565
|
let component;
|
|
2549
2566
|
let overlayHandle;
|
|
2567
|
+
// An overlay stays blocked until its interaction ends, also while setHidden() hides it.
|
|
2568
|
+
const overlayStatusSource = isOverlay && options?.blocked ? `extension-overlay:${this.nextBlockingOverlayId++}` : undefined;
|
|
2550
2569
|
let closed = false;
|
|
2551
2570
|
const restoreEditor = () => {
|
|
2552
2571
|
if (component)
|
|
@@ -2554,17 +2573,7 @@ export class InteractiveMode {
|
|
|
2554
2573
|
this.editor.setText(savedText);
|
|
2555
2574
|
this.ui.requestRender();
|
|
2556
2575
|
};
|
|
2557
|
-
const
|
|
2558
|
-
if (closed)
|
|
2559
|
-
return;
|
|
2560
|
-
closed = true;
|
|
2561
|
-
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2562
|
-
if (isOverlay)
|
|
2563
|
-
overlayHandle?.hide();
|
|
2564
|
-
else
|
|
2565
|
-
restoreEditor();
|
|
2566
|
-
// Note: both branches above already call requestRender
|
|
2567
|
-
resolve(result);
|
|
2576
|
+
const disposeComponent = () => {
|
|
2568
2577
|
try {
|
|
2569
2578
|
component?.dispose?.();
|
|
2570
2579
|
}
|
|
@@ -2572,6 +2581,30 @@ export class InteractiveMode {
|
|
|
2572
2581
|
/* ignore dispose errors */
|
|
2573
2582
|
}
|
|
2574
2583
|
};
|
|
2584
|
+
// Shared by done() and resetExtensionUI(). Removing the map entry first makes a second call a no-op.
|
|
2585
|
+
const removeOverlay = () => {
|
|
2586
|
+
if (!overlayHandle || !this.extensionOverlays.delete(overlayHandle))
|
|
2587
|
+
return;
|
|
2588
|
+
// Remove this overlay, not the topmost one: another overlay may have opened above it.
|
|
2589
|
+
overlayHandle.hide();
|
|
2590
|
+
if (overlayStatusSource)
|
|
2591
|
+
this.programStatus.setBlocked(overlayStatusSource, undefined);
|
|
2592
|
+
disposeComponent();
|
|
2593
|
+
};
|
|
2594
|
+
const close = (result) => {
|
|
2595
|
+
if (closed)
|
|
2596
|
+
return;
|
|
2597
|
+
closed = true;
|
|
2598
|
+
if (isOverlay) {
|
|
2599
|
+
removeOverlay();
|
|
2600
|
+
resolve(result);
|
|
2601
|
+
}
|
|
2602
|
+
else {
|
|
2603
|
+
restoreEditor();
|
|
2604
|
+
resolve(result);
|
|
2605
|
+
disposeComponent();
|
|
2606
|
+
}
|
|
2607
|
+
};
|
|
2575
2608
|
Promise.resolve(factory(this.ui, theme, this.keybindings, close))
|
|
2576
2609
|
.then((c) => {
|
|
2577
2610
|
if (closed)
|
|
@@ -2591,6 +2624,9 @@ export class InteractiveMode {
|
|
|
2591
2624
|
return w ? { width: w } : undefined;
|
|
2592
2625
|
};
|
|
2593
2626
|
overlayHandle = this.ui.showOverlay(c, resolveOptions());
|
|
2627
|
+
this.extensionOverlays.set(overlayHandle, removeOverlay);
|
|
2628
|
+
if (overlayStatusSource)
|
|
2629
|
+
this.programStatus.setBlocked(overlayStatusSource, options?.blocked);
|
|
2594
2630
|
// Expose handle to caller for visibility control
|
|
2595
2631
|
options?.onHandle?.(overlayHandle);
|
|
2596
2632
|
}
|
|
@@ -3219,6 +3255,9 @@ export class InteractiveMode {
|
|
|
3219
3255
|
this.ui.requestRender();
|
|
3220
3256
|
break;
|
|
3221
3257
|
case "agent_settled":
|
|
3258
|
+
// The session records deferred user bash results when the run settles; show them there too.
|
|
3259
|
+
this.flushPendingBashComponents();
|
|
3260
|
+
this.ui.requestRender();
|
|
3222
3261
|
await this.checkShutdownRequested();
|
|
3223
3262
|
break;
|
|
3224
3263
|
case "compaction_start": {
|
|
@@ -3602,9 +3641,18 @@ export class InteractiveMode {
|
|
|
3602
3641
|
addCacheWarmingUsage(entry) {
|
|
3603
3642
|
if (!this.settingsManager.getShowCacheMissNotices())
|
|
3604
3643
|
return;
|
|
3644
|
+
// Back-to-back warms collapse into one line with the cumulative cost.
|
|
3645
|
+
const previous = this.cacheWarmingNotice;
|
|
3646
|
+
if (previous && this.chatContainer.children.at(-1) === previous.component && previous.note === entry.note) {
|
|
3647
|
+
previous.total.cost += entry.usage.cost.total;
|
|
3648
|
+
previous.component.invalidate();
|
|
3649
|
+
return;
|
|
3650
|
+
}
|
|
3651
|
+
const total = { cost: entry.usage.cost.total };
|
|
3652
|
+
const component = new ThemedText(() => theme.fg("dim", formatCacheWarmingUsage(total.cost, entry.note)), 1, 0);
|
|
3653
|
+
this.cacheWarmingNotice = { component, total, note: entry.note };
|
|
3605
3654
|
this.chatContainer.addChild(new Spacer(1));
|
|
3606
|
-
|
|
3607
|
-
this.chatContainer.addChild(new ThemedText(() => theme.fg("dim", usage), 1, 0));
|
|
3655
|
+
this.chatContainer.addChild(component);
|
|
3608
3656
|
}
|
|
3609
3657
|
/**
|
|
3610
3658
|
* Render billing usage for a compaction or branch summary. The notice is derived
|
|
@@ -4060,7 +4108,7 @@ export class InteractiveMode {
|
|
|
4060
4108
|
if (isExpandable(activeHeader)) {
|
|
4061
4109
|
activeHeader.setExpanded(expanded);
|
|
4062
4110
|
}
|
|
4063
|
-
for (const container of [this.loadedResourcesContainer, this.chatContainer]) {
|
|
4111
|
+
for (const container of [this.loadedResourcesContainer, this.chatContainer, this.pendingMessagesContainer]) {
|
|
4064
4112
|
for (const child of container.children) {
|
|
4065
4113
|
if (isExpandable(child)) {
|
|
4066
4114
|
child.setExpanded(expanded);
|
|
@@ -4185,6 +4233,10 @@ export class InteractiveMode {
|
|
|
4185
4233
|
}
|
|
4186
4234
|
updatePendingMessagesDisplay() {
|
|
4187
4235
|
this.pendingMessagesContainer.clear();
|
|
4236
|
+
// User bash output shown while the agent works lives here until it moves to the chat.
|
|
4237
|
+
for (const component of this.pendingBashComponents) {
|
|
4238
|
+
this.pendingMessagesContainer.addChild(component);
|
|
4239
|
+
}
|
|
4188
4240
|
const { steering: steeringMessages, followUp: followUpMessages } = this.getAllQueuedMessages();
|
|
4189
4241
|
if (steeringMessages.length > 0 || followUpMessages.length > 0) {
|
|
4190
4242
|
this.pendingMessagesContainer.addChild(new Spacer(1));
|
|
@@ -5243,25 +5295,43 @@ export class InteractiveMode {
|
|
|
5243
5295
|
}
|
|
5244
5296
|
catch (error) {
|
|
5245
5297
|
if (error instanceof MissingSessionCwdError) {
|
|
5246
|
-
|
|
5247
|
-
|
|
5248
|
-
|
|
5249
|
-
|
|
5250
|
-
|
|
5251
|
-
|
|
5252
|
-
|
|
5253
|
-
|
|
5254
|
-
|
|
5255
|
-
|
|
5256
|
-
|
|
5257
|
-
|
|
5298
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
5299
|
+
case "continue": {
|
|
5300
|
+
const result = await this.runtimeHost.switchSession(sessionPath, {
|
|
5301
|
+
cwdOverride: error.issue.fallbackCwd,
|
|
5302
|
+
withSession: options?.withSession,
|
|
5303
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
5304
|
+
});
|
|
5305
|
+
if (!result.cancelled)
|
|
5306
|
+
this.showStatus(`Resumed session in ${error.issue.fallbackCwd}`);
|
|
5307
|
+
return result;
|
|
5308
|
+
}
|
|
5309
|
+
case "fork":
|
|
5310
|
+
return this.switchToForkedSession(sessionPath, error.issue.fallbackCwd, options);
|
|
5311
|
+
case undefined:
|
|
5312
|
+
this.showStatus("Resume cancelled");
|
|
5313
|
+
return { cancelled: true };
|
|
5258
5314
|
}
|
|
5259
|
-
this.showStatus("Resumed session in current cwd");
|
|
5260
|
-
return result;
|
|
5261
5315
|
}
|
|
5262
5316
|
return this.handleFatalRuntimeError("Failed to resume session", error);
|
|
5263
5317
|
}
|
|
5264
5318
|
}
|
|
5319
|
+
/** Fork a session whose stored cwd is gone into `cwd` and switch to the fork, like `--session <id>` from another project (#11060). */
|
|
5320
|
+
async switchToForkedSession(sourcePath, cwd, options) {
|
|
5321
|
+
const fork = SessionManager.forkFrom(sourcePath, cwd, this.sessionManager.getSessionDir());
|
|
5322
|
+
const forkPath = fork.getSessionFile();
|
|
5323
|
+
const result = await this.runtimeHost.switchSession(forkPath, {
|
|
5324
|
+
withSession: options?.withSession,
|
|
5325
|
+
projectTrustContextFactory: (cwd) => this.createProjectTrustContext(cwd),
|
|
5326
|
+
});
|
|
5327
|
+
if (result.cancelled) {
|
|
5328
|
+
// An extension vetoed the switch; drop the fork so cancelling leaves no copy behind.
|
|
5329
|
+
fs.rmSync(forkPath, { force: true });
|
|
5330
|
+
return result;
|
|
5331
|
+
}
|
|
5332
|
+
this.showStatus(`Forked into new session ${fork.getSessionId()} in ${cwd}`);
|
|
5333
|
+
return result;
|
|
5334
|
+
}
|
|
5265
5335
|
getLoginProviderOptions(authType) {
|
|
5266
5336
|
const options = [];
|
|
5267
5337
|
for (const provider of this.session.modelRuntime.getProviders()) {
|
|
@@ -5294,7 +5364,8 @@ export class InteractiveMode {
|
|
|
5294
5364
|
});
|
|
5295
5365
|
}
|
|
5296
5366
|
}
|
|
5297
|
-
|
|
5367
|
+
// The sort is stable, so a provider's account option stays above its API key option.
|
|
5368
|
+
return options.sort(compareProviders);
|
|
5298
5369
|
}
|
|
5299
5370
|
async getLogoutProviderOptions() {
|
|
5300
5371
|
return (await this.session.modelRuntime.listCredentials({ signal: AbortSignal.timeout(15_000) }))
|
|
@@ -5308,22 +5379,14 @@ export class InteractiveMode {
|
|
|
5308
5379
|
subscription: provider?.auth.oauth?.isSubscription === true,
|
|
5309
5380
|
};
|
|
5310
5381
|
})
|
|
5311
|
-
.sort(
|
|
5312
|
-
}
|
|
5313
|
-
findLoginProviderOptions(providerRef) {
|
|
5314
|
-
const normalizedProviderRef = providerRef.trim().toLowerCase();
|
|
5315
|
-
if (!normalizedProviderRef) {
|
|
5316
|
-
return [];
|
|
5317
|
-
}
|
|
5318
|
-
return this.getLoginProviderOptions().filter((provider) => provider.id.toLowerCase() === normalizedProviderRef ||
|
|
5319
|
-
provider.name.toLowerCase() === normalizedProviderRef);
|
|
5382
|
+
.sort(compareProviders);
|
|
5320
5383
|
}
|
|
5321
5384
|
async handleLoginCommand(providerRef) {
|
|
5322
5385
|
if (!providerRef) {
|
|
5323
5386
|
this.showLoginAuthTypeSelector();
|
|
5324
5387
|
return;
|
|
5325
5388
|
}
|
|
5326
|
-
const providerOptions = this.
|
|
5389
|
+
const providerOptions = findMatchingProviders(this.getLoginProviderOptions(), providerRef);
|
|
5327
5390
|
if (providerOptions.length === 1) {
|
|
5328
5391
|
await this.startProviderLogin(providerOptions[0]);
|
|
5329
5392
|
return;
|
|
@@ -5440,8 +5503,8 @@ export class InteractiveMode {
|
|
|
5440
5503
|
else {
|
|
5441
5504
|
this.ui.requestRender();
|
|
5442
5505
|
}
|
|
5443
|
-
}, initialSearchInput);
|
|
5444
|
-
return { component: selector, focus: selector };
|
|
5506
|
+
}, initialSearchInput, this.ui);
|
|
5507
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5445
5508
|
});
|
|
5446
5509
|
}
|
|
5447
5510
|
async showOAuthSelector(mode) {
|
|
@@ -5487,8 +5550,8 @@ export class InteractiveMode {
|
|
|
5487
5550
|
}, () => {
|
|
5488
5551
|
done();
|
|
5489
5552
|
this.ui.requestRender();
|
|
5490
|
-
});
|
|
5491
|
-
return { component: selector, focus: selector };
|
|
5553
|
+
}, undefined, this.ui);
|
|
5554
|
+
return { component: selector, focus: selector, dispose: () => selector.dispose() };
|
|
5492
5555
|
});
|
|
5493
5556
|
}
|
|
5494
5557
|
async completeProviderAuthentication(providerId, providerName, authType, previousModel) {
|
|
@@ -5765,24 +5828,10 @@ export class InteractiveMode {
|
|
|
5765
5828
|
* when missing. Nothing is asked when a global server already uses this login.
|
|
5766
5829
|
*/
|
|
5767
5830
|
offerRadiusMcpServer(providerId, providerName) {
|
|
5768
|
-
const
|
|
5769
|
-
|
|
5770
|
-
const { servers } = loadMcpConfig({
|
|
5771
|
-
agentDir: getAgentDir(),
|
|
5772
|
-
cwd: this.sessionManager.getCwd(),
|
|
5773
|
-
projectTrusted: false,
|
|
5774
|
-
});
|
|
5775
|
-
const existing = servers.find((server) => "url" in server.config && normalizeUrl(server.config.url) === normalizeUrl(RADIUS_MCP_URL));
|
|
5776
|
-
if (existing && "url" in existing.config && existing.config.auth?.provider === providerId)
|
|
5831
|
+
const plan = planRadiusMcpServer(providerId, getAgentDir(), this.sessionManager.getCwd());
|
|
5832
|
+
if (!plan)
|
|
5777
5833
|
return;
|
|
5778
|
-
|
|
5779
|
-
if (!existing && servers.some((server) => server.name === name))
|
|
5780
|
-
name = "radius-mcp";
|
|
5781
|
-
const config = existing && "url" in existing.config
|
|
5782
|
-
? { ...existing.config, auth: { provider: providerId } }
|
|
5783
|
-
: { url: RADIUS_MCP_URL, auth: { provider: providerId } };
|
|
5784
|
-
// `auth` replaces the MCP OAuth sign-in.
|
|
5785
|
-
delete config.oauth;
|
|
5834
|
+
const { mcpPath, name, config } = plan;
|
|
5786
5835
|
this.showSelector((done) => {
|
|
5787
5836
|
const selector = new ExtensionSelectorComponent(`Configure ${providerName} MCP in ${mcpPath}?`, ["Yes", "No"], (option) => {
|
|
5788
5837
|
done();
|
|
@@ -5948,18 +5997,22 @@ export class InteractiveMode {
|
|
|
5948
5997
|
}
|
|
5949
5998
|
catch (error) {
|
|
5950
5999
|
if (error instanceof MissingSessionCwdError) {
|
|
5951
|
-
|
|
5952
|
-
|
|
5953
|
-
|
|
5954
|
-
|
|
5955
|
-
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
|
|
5959
|
-
|
|
6000
|
+
switch (await this.promptForMissingSessionCwd(error)) {
|
|
6001
|
+
case "continue": {
|
|
6002
|
+
const result = await this.runtimeHost.importFromJsonl(inputPath, error.issue.fallbackCwd);
|
|
6003
|
+
this.showStatus(result.cancelled ? "Import cancelled" : `Session imported from: ${inputPath}`);
|
|
6004
|
+
return;
|
|
6005
|
+
}
|
|
6006
|
+
case "fork": {
|
|
6007
|
+
const result = await this.switchToForkedSession(inputPath, error.issue.fallbackCwd);
|
|
6008
|
+
if (result.cancelled)
|
|
6009
|
+
this.showStatus("Import cancelled");
|
|
6010
|
+
return;
|
|
6011
|
+
}
|
|
6012
|
+
case undefined:
|
|
6013
|
+
this.showStatus("Import cancelled");
|
|
6014
|
+
return;
|
|
5960
6015
|
}
|
|
5961
|
-
this.showStatus(`Session imported from: ${inputPath}`);
|
|
5962
|
-
return;
|
|
5963
6016
|
}
|
|
5964
6017
|
if (error instanceof SessionImportFileNotFoundError) {
|
|
5965
6018
|
this.showError(`Failed to import session: ${error.message}`);
|
|
@@ -6341,6 +6394,7 @@ ${cycleContextWindow ? `| \`${cycleContextWindow}\` | Cycle context window |\n`
|
|
|
6341
6394
|
const result = eventResult.result;
|
|
6342
6395
|
// Create UI component for display
|
|
6343
6396
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6397
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6344
6398
|
if (this.session.isStreaming) {
|
|
6345
6399
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|
|
6346
6400
|
this.pendingBashComponents.push(this.bashComponent);
|
|
@@ -6362,6 +6416,7 @@ ${cycleContextWindow ? `| \`${cycleContextWindow}\` | Cycle context window |\n`
|
|
|
6362
6416
|
// Normal execution path (possibly with custom operations)
|
|
6363
6417
|
const isDeferred = this.session.isStreaming;
|
|
6364
6418
|
this.bashComponent = new BashExecutionComponent(command, this.ui, excludeFromContext, this.outputPad);
|
|
6419
|
+
this.bashComponent.setExpanded(this.toolOutputExpanded);
|
|
6365
6420
|
if (isDeferred) {
|
|
6366
6421
|
// Show in pending area when agent is streaming
|
|
6367
6422
|
this.pendingMessagesContainer.addChild(this.bashComponent);
|