@hyperspaceng/neural-coding-agent 0.62.1 → 0.63.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 +72 -0
- package/README.md +10 -0
- package/dist/bun/register-bedrock.d.ts.map +1 -1
- package/dist/bun/register-bedrock.js +2 -2
- package/dist/bun/register-bedrock.js.map +1 -1
- package/dist/cli/args.d.ts +1 -1
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/config-selector.d.ts.map +1 -1
- package/dist/cli/config-selector.js +1 -1
- package/dist/cli/config-selector.js.map +1 -1
- package/dist/cli/file-processor.d.ts +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +4 -0
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/cli/initial-message.d.ts +1 -1
- package/dist/cli/initial-message.d.ts.map +1 -1
- package/dist/cli/initial-message.js.map +1 -1
- package/dist/cli/list-models.d.ts.map +1 -1
- package/dist/cli/list-models.js +1 -1
- package/dist/cli/list-models.js.map +1 -1
- package/dist/cli/session-picker.d.ts.map +1 -1
- package/dist/cli/session-picker.js +1 -1
- package/dist/cli/session-picker.js.map +1 -1
- package/dist/core/agent-session.d.ts +12 -5
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +61 -47
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts +2 -2
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +2 -2
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts +2 -2
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +1 -1
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +2 -2
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +1 -1
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction/utils.d.ts +2 -2
- package/dist/core/compaction/utils.d.ts.map +1 -1
- package/dist/core/compaction/utils.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -1
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/export-html/index.d.ts +3 -3
- package/dist/core/export-html/index.d.ts.map +1 -1
- package/dist/core/export-html/index.js +2 -2
- package/dist/core/export-html/index.js.map +1 -1
- package/dist/core/export-html/tool-renderer.d.ts +2 -2
- package/dist/core/export-html/tool-renderer.d.ts.map +1 -1
- package/dist/core/export-html/tool-renderer.js +41 -16
- package/dist/core/export-html/tool-renderer.js.map +1 -1
- package/dist/core/extensions/index.d.ts +3 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js.map +1 -1
- package/dist/core/extensions/loader.d.ts.map +1 -1
- package/dist/core/extensions/loader.js +27 -17
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/runner.d.ts +7 -10
- package/dist/core/extensions/runner.d.ts.map +1 -1
- package/dist/core/extensions/runner.js +27 -38
- package/dist/core/extensions/runner.js.map +1 -1
- package/dist/core/extensions/types.d.ts +49 -14
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/extensions/wrapper.d.ts +1 -1
- package/dist/core/extensions/wrapper.d.ts.map +1 -1
- package/dist/core/extensions/wrapper.js +2 -8
- package/dist/core/extensions/wrapper.js.map +1 -1
- package/dist/core/index.d.ts +2 -1
- package/dist/core/index.d.ts.map +1 -1
- package/dist/core/index.js +1 -0
- package/dist/core/index.js.map +1 -1
- package/dist/core/keybindings.d.ts +2 -2
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +1 -1
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/messages.d.ts +3 -3
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/model-registry.d.ts +1 -1
- package/dist/core/model-registry.d.ts.map +1 -1
- package/dist/core/model-registry.js +2 -2
- package/dist/core/model-registry.js.map +1 -1
- package/dist/core/model-resolver.d.ts +2 -2
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +1 -1
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/output-guard.d.ts +6 -0
- package/dist/core/output-guard.d.ts.map +1 -0
- package/dist/core/output-guard.js +59 -0
- package/dist/core/output-guard.js.map +1 -0
- package/dist/core/package-manager.d.ts +3 -0
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +69 -9
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/prompt-templates.d.ts +2 -1
- package/dist/core/prompt-templates.d.ts.map +1 -1
- package/dist/core/prompt-templates.js +30 -32
- package/dist/core/prompt-templates.js.map +1 -1
- package/dist/core/resource-loader.d.ts +6 -5
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +136 -108
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +4 -4
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +2 -2
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-manager.d.ts +2 -2
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-manager.d.ts +1 -1
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts +2 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +25 -1
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts +2 -3
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/source-info.d.ts +18 -0
- package/dist/core/source-info.d.ts.map +1 -0
- package/dist/core/source-info.js +19 -0
- package/dist/core/source-info.js.map +1 -0
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +3 -38
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +20 -10
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +151 -59
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit.d.ts +15 -3
- package/dist/core/tools/edit.d.ts.map +1 -1
- package/dist/core/tools/edit.js +92 -21
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/find.d.ts +12 -5
- package/dist/core/tools/find.d.ts.map +1 -1
- package/dist/core/tools/find.js +76 -27
- package/dist/core/tools/find.js.map +1 -1
- package/dist/core/tools/grep.d.ts +16 -5
- package/dist/core/tools/grep.d.ts.map +1 -1
- package/dist/core/tools/grep.js +83 -29
- package/dist/core/tools/grep.js.map +1 -1
- package/dist/core/tools/index.d.ts +58 -20
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +50 -26
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/ls.d.ts +10 -4
- package/dist/core/tools/ls.d.ts.map +1 -1
- package/dist/core/tools/ls.js +67 -13
- package/dist/core/tools/ls.js.map +1 -1
- package/dist/core/tools/read.d.ts +11 -4
- package/dist/core/tools/read.d.ts.map +1 -1
- package/dist/core/tools/read.js +110 -51
- package/dist/core/tools/read.js.map +1 -1
- package/dist/core/tools/render-utils.d.ts +21 -0
- package/dist/core/tools/render-utils.d.ts.map +1 -0
- package/dist/core/tools/render-utils.js +49 -0
- package/dist/core/tools/render-utils.js.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts +14 -0
- package/dist/core/tools/tool-definition-wrapper.d.ts.map +1 -0
- package/dist/core/tools/tool-definition-wrapper.js +30 -0
- package/dist/core/tools/tool-definition-wrapper.js.map +1 -0
- package/dist/core/tools/write.d.ts +10 -4
- package/dist/core/tools/write.d.ts.map +1 -1
- package/dist/core/tools/write.js +162 -27
- package/dist/core/tools/write.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +30 -10
- package/dist/main.js.map +1 -1
- package/dist/modes/interactive/components/armin.d.ts +1 -1
- package/dist/modes/interactive/components/armin.d.ts.map +1 -1
- package/dist/modes/interactive/components/armin.js.map +1 -1
- package/dist/modes/interactive/components/assistant-message.d.ts +2 -2
- package/dist/modes/interactive/components/assistant-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/assistant-message.js +1 -1
- package/dist/modes/interactive/components/assistant-message.js.map +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts +1 -1
- package/dist/modes/interactive/components/bash-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/bash-execution.js +1 -1
- package/dist/modes/interactive/components/bash-execution.js.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts +1 -1
- package/dist/modes/interactive/components/bordered-loader.d.ts.map +1 -1
- package/dist/modes/interactive/components/bordered-loader.js +1 -1
- package/dist/modes/interactive/components/bordered-loader.js.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/branch-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js +1 -1
- package/dist/modes/interactive/components/branch-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js +1 -1
- package/dist/modes/interactive/components/compaction-summary-message.js.map +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts +1 -1
- package/dist/modes/interactive/components/config-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/config-selector.js +1 -1
- package/dist/modes/interactive/components/config-selector.js.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts +1 -1
- package/dist/modes/interactive/components/countdown-timer.d.ts.map +1 -1
- package/dist/modes/interactive/components/countdown-timer.js.map +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts +1 -1
- package/dist/modes/interactive/components/custom-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-editor.js +1 -1
- package/dist/modes/interactive/components/custom-editor.js.map +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts +1 -1
- package/dist/modes/interactive/components/custom-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/custom-message.js +1 -1
- package/dist/modes/interactive/components/custom-message.js.map +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts +1 -1
- package/dist/modes/interactive/components/daxnuts.d.ts.map +1 -1
- package/dist/modes/interactive/components/daxnuts.js.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts +1 -1
- package/dist/modes/interactive/components/dynamic-border.d.ts.map +1 -1
- package/dist/modes/interactive/components/dynamic-border.js.map +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts +1 -1
- package/dist/modes/interactive/components/extension-editor.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-editor.js +1 -1
- package/dist/modes/interactive/components/extension-editor.js.map +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts +1 -1
- package/dist/modes/interactive/components/extension-input.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-input.js +1 -1
- package/dist/modes/interactive/components/extension-input.js.map +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts +1 -1
- package/dist/modes/interactive/components/extension-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/extension-selector.js +1 -1
- package/dist/modes/interactive/components/extension-selector.js.map +1 -1
- package/dist/modes/interactive/components/footer.d.ts +1 -1
- package/dist/modes/interactive/components/footer.d.ts.map +1 -1
- package/dist/modes/interactive/components/footer.js +1 -1
- package/dist/modes/interactive/components/footer.js.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts +1 -1
- package/dist/modes/interactive/components/keybinding-hints.d.ts.map +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js +1 -1
- package/dist/modes/interactive/components/keybinding-hints.js.map +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts +1 -1
- package/dist/modes/interactive/components/login-dialog.d.ts.map +1 -1
- package/dist/modes/interactive/components/login-dialog.js +2 -2
- package/dist/modes/interactive/components/login-dialog.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +2 -2
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +2 -2
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts +1 -1
- package/dist/modes/interactive/components/oauth-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/oauth-selector.js +2 -2
- package/dist/modes/interactive/components/oauth-selector.js.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.d.ts +2 -2
- package/dist/modes/interactive/components/scoped-models-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js +1 -1
- package/dist/modes/interactive/components/scoped-models-selector.js.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector-search.js +1 -1
- package/dist/modes/interactive/components/session-selector-search.js.map +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts +1 -1
- package/dist/modes/interactive/components/session-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/session-selector.js +1 -1
- package/dist/modes/interactive/components/session-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +3 -3
- package/dist/modes/interactive/components/settings-selector.d.ts.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/show-images-selector.d.ts +1 -1
- package/dist/modes/interactive/components/show-images-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/show-images-selector.js +1 -1
- package/dist/modes/interactive/components/show-images-selector.js.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js +1 -1
- package/dist/modes/interactive/components/skill-invocation-message.js.map +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts +1 -1
- package/dist/modes/interactive/components/theme-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/theme-selector.js +1 -1
- package/dist/modes/interactive/components/theme-selector.js.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.d.ts +2 -2
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +1 -1
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/components/tool-execution.d.ts +16 -41
- package/dist/modes/interactive/components/tool-execution.d.ts.map +1 -1
- package/dist/modes/interactive/components/tool-execution.js +126 -679
- package/dist/modes/interactive/components/tool-execution.js.map +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts +1 -1
- package/dist/modes/interactive/components/tree-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/tree-selector.js +1 -1
- package/dist/modes/interactive/components/tree-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts +1 -1
- package/dist/modes/interactive/components/user-message-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message-selector.js +1 -1
- package/dist/modes/interactive/components/user-message-selector.js.map +1 -1
- package/dist/modes/interactive/components/user-message.d.ts +1 -1
- package/dist/modes/interactive/components/user-message.d.ts.map +1 -1
- package/dist/modes/interactive/components/user-message.js +1 -1
- package/dist/modes/interactive/components/user-message.js.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.d.ts.map +1 -1
- package/dist/modes/interactive/components/visual-truncate.js +1 -1
- package/dist/modes/interactive/components/visual-truncate.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -12
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +147 -95
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/theme/theme.d.ts +5 -2
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +15 -1
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/print-mode.d.ts +1 -1
- package/dist/modes/print-mode.d.ts.map +1 -1
- package/dist/modes/print-mode.js +5 -11
- package/dist/modes/print-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-client.d.ts +2 -2
- package/dist/modes/rpc/rpc-client.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-client.js.map +1 -1
- package/dist/modes/rpc/rpc-mode.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-mode.js +27 -20
- package/dist/modes/rpc/rpc-mode.js.map +1 -1
- package/dist/modes/rpc/rpc-types.d.ts +5 -6
- package/dist/modes/rpc/rpc-types.d.ts.map +1 -1
- package/dist/modes/rpc/rpc-types.js.map +1 -1
- package/dist/utils/image-resize.d.ts +6 -6
- package/dist/utils/image-resize.d.ts.map +1 -1
- package/dist/utils/image-resize.js +45 -94
- package/dist/utils/image-resize.js.map +1 -1
- package/docs/extensions.md +72 -32
- package/docs/tui.md +2 -2
- package/examples/extensions/built-in-tool-renderer.ts +8 -8
- package/examples/extensions/commands.ts +3 -3
- package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
- package/examples/extensions/custom-provider-anthropic/package.json +17 -17
- package/examples/extensions/custom-provider-gitlab-duo/package.json +14 -14
- package/examples/extensions/custom-provider-qwen-cli/package.json +14 -14
- package/examples/extensions/minimal-mode.ts +14 -14
- package/examples/extensions/question.ts +2 -2
- package/examples/extensions/questionnaire.ts +2 -2
- package/examples/extensions/subagent/index.ts +23 -3
- package/examples/extensions/todo.ts +2 -2
- package/examples/extensions/truncated-tool.ts +2 -2
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +20 -20
- package/examples/sdk/04-skills.ts +8 -2
- package/examples/sdk/08-prompt-templates.ts +2 -1
- package/examples/sdk/12-full-control.ts +0 -1
- package/package.json +4 -4
|
@@ -6,7 +6,7 @@ import * as crypto from "node:crypto";
|
|
|
6
6
|
import * as fs from "node:fs";
|
|
7
7
|
import * as os from "node:os";
|
|
8
8
|
import * as path from "node:path";
|
|
9
|
-
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@
|
|
9
|
+
import { CombinedAutocompleteProvider, Container, fuzzyFilter, Loader, Markdown, matchesKey, ProcessTerminal, Spacer, setKeybindings, Text, TruncatedText, TUI, visibleWidth, } from "@hyperspaceng/neural-tui";
|
|
10
10
|
import { spawn, spawnSync } from "child_process";
|
|
11
11
|
import { APP_NAME, getAgentDir, getAuthPath, getDebugLogPath, getShareViewerUrl, getUpdateInstruction, VERSION, } from "../../config.js";
|
|
12
12
|
import { parseSkillBlock } from "../../core/agent-session.js";
|
|
@@ -20,6 +20,7 @@ import { BUILTIN_SLASH_COMMANDS } from "../../core/slash-commands.js";
|
|
|
20
20
|
import { getChangelogPath, getNewEntries, parseChangelog } from "../../utils/changelog.js";
|
|
21
21
|
import { copyToClipboard } from "../../utils/clipboard.js";
|
|
22
22
|
import { extensionForImageMimeType, readClipboardImage } from "../../utils/clipboard-image.js";
|
|
23
|
+
import { parseGitUrl } from "../../utils/git.js";
|
|
23
24
|
import { ensureTool } from "../../utils/tools-manager.js";
|
|
24
25
|
import { ArminComponent } from "./components/armin.js";
|
|
25
26
|
import { AssistantMessageComponent } from "./components/assistant-message.js";
|
|
@@ -168,6 +169,48 @@ export class InteractiveMode {
|
|
|
168
169
|
setRegisteredThemes(this.session.resourceLoader.getThemes().themes);
|
|
169
170
|
initTheme(this.settingsManager.getTheme(), true);
|
|
170
171
|
}
|
|
172
|
+
getAutocompleteSourceTag(sourceInfo) {
|
|
173
|
+
if (!sourceInfo) {
|
|
174
|
+
return undefined;
|
|
175
|
+
}
|
|
176
|
+
const scopePrefix = sourceInfo.scope === "user" ? "u" : sourceInfo.scope === "project" ? "p" : "t";
|
|
177
|
+
const source = sourceInfo.source.trim();
|
|
178
|
+
if (source === "auto" || source === "local" || source === "cli") {
|
|
179
|
+
return scopePrefix;
|
|
180
|
+
}
|
|
181
|
+
if (source.startsWith("npm:")) {
|
|
182
|
+
return `${scopePrefix}:${source}`;
|
|
183
|
+
}
|
|
184
|
+
const gitSource = parseGitUrl(source);
|
|
185
|
+
if (gitSource) {
|
|
186
|
+
const ref = gitSource.ref ? `@${gitSource.ref}` : "";
|
|
187
|
+
return `${scopePrefix}:git:${gitSource.host}/${gitSource.path}${ref}`;
|
|
188
|
+
}
|
|
189
|
+
return scopePrefix;
|
|
190
|
+
}
|
|
191
|
+
prefixAutocompleteDescription(description, sourceInfo) {
|
|
192
|
+
const sourceTag = this.getAutocompleteSourceTag(sourceInfo);
|
|
193
|
+
if (!sourceTag) {
|
|
194
|
+
return description;
|
|
195
|
+
}
|
|
196
|
+
return description ? `[${sourceTag}] ${description}` : `[${sourceTag}]`;
|
|
197
|
+
}
|
|
198
|
+
getBuiltInCommandConflictDiagnostics(extensionRunner) {
|
|
199
|
+
if (!extensionRunner) {
|
|
200
|
+
return [];
|
|
201
|
+
}
|
|
202
|
+
const builtinNames = new Set(BUILTIN_SLASH_COMMANDS.map((command) => command.name));
|
|
203
|
+
return extensionRunner
|
|
204
|
+
.getRegisteredCommands()
|
|
205
|
+
.filter((command) => builtinNames.has(command.name))
|
|
206
|
+
.map((command) => ({
|
|
207
|
+
type: "warning",
|
|
208
|
+
message: command.invocationName === command.name
|
|
209
|
+
? `Extension command '/${command.name}' conflicts with built-in interactive command. Skipping in autocomplete.`
|
|
210
|
+
: `Extension command '/${command.name}' conflicts with built-in interactive command. Available as '/${command.invocationName}'.`,
|
|
211
|
+
path: command.sourceInfo.path,
|
|
212
|
+
}));
|
|
213
|
+
}
|
|
171
214
|
setupAutocomplete(fdPath) {
|
|
172
215
|
// Define commands for autocomplete
|
|
173
216
|
const slashCommands = BUILTIN_SLASH_COMMANDS.map((command) => ({
|
|
@@ -203,13 +246,13 @@ export class InteractiveMode {
|
|
|
203
246
|
// Convert prompt templates to SlashCommand format for autocomplete
|
|
204
247
|
const templateCommands = this.session.promptTemplates.map((cmd) => ({
|
|
205
248
|
name: cmd.name,
|
|
206
|
-
description: cmd.description,
|
|
249
|
+
description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
|
|
207
250
|
}));
|
|
208
251
|
// Convert extension commands to SlashCommand format
|
|
209
252
|
const builtinCommandNames = new Set(slashCommands.map((c) => c.name));
|
|
210
|
-
const extensionCommands = (this.session.extensionRunner?.getRegisteredCommands(builtinCommandNames) ?? []).map((cmd) => ({
|
|
211
|
-
name: cmd.
|
|
212
|
-
description: cmd.description
|
|
253
|
+
const extensionCommands = (this.session.extensionRunner?.getRegisteredCommands().filter((cmd) => !builtinCommandNames.has(cmd.name)) ?? []).map((cmd) => ({
|
|
254
|
+
name: cmd.invocationName,
|
|
255
|
+
description: this.prefixAutocompleteDescription(cmd.description, cmd.sourceInfo),
|
|
213
256
|
getArgumentCompletions: cmd.getArgumentCompletions,
|
|
214
257
|
}));
|
|
215
258
|
// Build skill commands from session.skills (if enabled)
|
|
@@ -219,7 +262,10 @@ export class InteractiveMode {
|
|
|
219
262
|
for (const skill of this.session.resourceLoader.getSkills().skills) {
|
|
220
263
|
const commandName = `skill:${skill.name}`;
|
|
221
264
|
this.skillCommands.set(commandName, skill.filePath);
|
|
222
|
-
skillCommandList.push({
|
|
265
|
+
skillCommandList.push({
|
|
266
|
+
name: commandName,
|
|
267
|
+
description: this.prefixAutocompleteDescription(skill.description, skill.sourceInfo),
|
|
268
|
+
});
|
|
223
269
|
}
|
|
224
270
|
}
|
|
225
271
|
// Setup autocomplete
|
|
@@ -426,7 +472,7 @@ export class InteractiveMode {
|
|
|
426
472
|
if (process.env.PI_SKIP_VERSION_CHECK || process.env.PI_OFFLINE)
|
|
427
473
|
return undefined;
|
|
428
474
|
try {
|
|
429
|
-
const response = await fetch("https://registry.npmjs.org/@
|
|
475
|
+
const response = await fetch("https://registry.npmjs.org/@hyperspaceng/neural-coding-agent/latest", {
|
|
430
476
|
signal: AbortSignal.timeout(10000),
|
|
431
477
|
});
|
|
432
478
|
if (!response.ok)
|
|
@@ -547,21 +593,21 @@ export class InteractiveMode {
|
|
|
547
593
|
/**
|
|
548
594
|
* Get a short path relative to the package root for display.
|
|
549
595
|
*/
|
|
550
|
-
getShortPath(fullPath,
|
|
551
|
-
|
|
596
|
+
getShortPath(fullPath, sourceInfo) {
|
|
597
|
+
const source = sourceInfo?.source ?? "";
|
|
552
598
|
const npmMatch = fullPath.match(/node_modules\/(@?[^/]+(?:\/[^/]+)?)\/(.*)/);
|
|
553
599
|
if (npmMatch && source.startsWith("npm:")) {
|
|
554
600
|
return npmMatch[2];
|
|
555
601
|
}
|
|
556
|
-
// For git packages, show path relative to repo root
|
|
557
602
|
const gitMatch = fullPath.match(/git\/[^/]+\/[^/]+\/(.*)/);
|
|
558
603
|
if (gitMatch && source.startsWith("git:")) {
|
|
559
604
|
return gitMatch[1];
|
|
560
605
|
}
|
|
561
|
-
// For local/auto, just use formatDisplayPath
|
|
562
606
|
return this.formatDisplayPath(fullPath);
|
|
563
607
|
}
|
|
564
|
-
getDisplaySourceInfo(
|
|
608
|
+
getDisplaySourceInfo(sourceInfo) {
|
|
609
|
+
const source = sourceInfo?.source ?? "local";
|
|
610
|
+
const scope = sourceInfo?.scope ?? "project";
|
|
565
611
|
if (source === "local") {
|
|
566
612
|
if (scope === "user") {
|
|
567
613
|
return { label: "user", color: "muted" };
|
|
@@ -580,7 +626,9 @@ export class InteractiveMode {
|
|
|
580
626
|
const scopeLabel = scope === "user" ? "user" : scope === "project" ? "project" : scope === "temporary" ? "temp" : undefined;
|
|
581
627
|
return { label: source, scopeLabel, color: "accent" };
|
|
582
628
|
}
|
|
583
|
-
getScopeGroup(
|
|
629
|
+
getScopeGroup(sourceInfo) {
|
|
630
|
+
const source = sourceInfo?.source ?? "local";
|
|
631
|
+
const scope = sourceInfo?.scope ?? "project";
|
|
584
632
|
if (source === "cli" || scope === "temporary")
|
|
585
633
|
return "path";
|
|
586
634
|
if (scope === "user")
|
|
@@ -589,28 +637,27 @@ export class InteractiveMode {
|
|
|
589
637
|
return "project";
|
|
590
638
|
return "path";
|
|
591
639
|
}
|
|
592
|
-
isPackageSource(
|
|
640
|
+
isPackageSource(sourceInfo) {
|
|
641
|
+
const source = sourceInfo?.source ?? "";
|
|
593
642
|
return source.startsWith("npm:") || source.startsWith("git:");
|
|
594
643
|
}
|
|
595
|
-
buildScopeGroups(
|
|
644
|
+
buildScopeGroups(items) {
|
|
596
645
|
const groups = {
|
|
597
646
|
user: { scope: "user", paths: [], packages: new Map() },
|
|
598
647
|
project: { scope: "project", paths: [], packages: new Map() },
|
|
599
648
|
path: { scope: "path", paths: [], packages: new Map() },
|
|
600
649
|
};
|
|
601
|
-
for (const
|
|
602
|
-
const
|
|
603
|
-
const source = meta?.source ?? "local";
|
|
604
|
-
const scope = meta?.scope ?? "project";
|
|
605
|
-
const groupKey = this.getScopeGroup(source, scope);
|
|
650
|
+
for (const item of items) {
|
|
651
|
+
const groupKey = this.getScopeGroup(item.sourceInfo);
|
|
606
652
|
const group = groups[groupKey];
|
|
607
|
-
|
|
653
|
+
const source = item.sourceInfo?.source ?? "local";
|
|
654
|
+
if (this.isPackageSource(item.sourceInfo)) {
|
|
608
655
|
const list = group.packages.get(source) ?? [];
|
|
609
|
-
list.push(
|
|
656
|
+
list.push(item);
|
|
610
657
|
group.packages.set(source, list);
|
|
611
658
|
}
|
|
612
659
|
else {
|
|
613
|
-
group.paths.push(
|
|
660
|
+
group.paths.push(item);
|
|
614
661
|
}
|
|
615
662
|
}
|
|
616
663
|
return [groups.project, groups.user, groups.path].filter((group) => group.paths.length > 0 || group.packages.size > 0);
|
|
@@ -619,57 +666,44 @@ export class InteractiveMode {
|
|
|
619
666
|
const lines = [];
|
|
620
667
|
for (const group of groups) {
|
|
621
668
|
lines.push(` ${theme.fg("accent", group.scope)}`);
|
|
622
|
-
const sortedPaths = [...group.paths].sort((a, b) => a.localeCompare(b));
|
|
623
|
-
for (const
|
|
624
|
-
lines.push(theme.fg("dim", ` ${options.formatPath(
|
|
669
|
+
const sortedPaths = [...group.paths].sort((a, b) => a.path.localeCompare(b.path));
|
|
670
|
+
for (const item of sortedPaths) {
|
|
671
|
+
lines.push(theme.fg("dim", ` ${options.formatPath(item)}`));
|
|
625
672
|
}
|
|
626
673
|
const sortedPackages = Array.from(group.packages.entries()).sort(([a], [b]) => a.localeCompare(b));
|
|
627
|
-
for (const [source,
|
|
674
|
+
for (const [source, items] of sortedPackages) {
|
|
628
675
|
lines.push(` ${theme.fg("mdLink", source)}`);
|
|
629
|
-
const sortedPackagePaths = [...
|
|
630
|
-
for (const
|
|
631
|
-
lines.push(theme.fg("dim", ` ${options.formatPackagePath(
|
|
676
|
+
const sortedPackagePaths = [...items].sort((a, b) => a.path.localeCompare(b.path));
|
|
677
|
+
for (const item of sortedPackagePaths) {
|
|
678
|
+
lines.push(theme.fg("dim", ` ${options.formatPackagePath(item, source)}`));
|
|
632
679
|
}
|
|
633
680
|
}
|
|
634
681
|
}
|
|
635
682
|
return lines.join("\n");
|
|
636
683
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
* Package manager stores metadata for directories, but we display file paths.
|
|
640
|
-
*/
|
|
641
|
-
findMetadata(p, metadata) {
|
|
642
|
-
// Try exact match first
|
|
643
|
-
const exact = metadata.get(p);
|
|
684
|
+
findSourceInfoForPath(p, sourceInfos) {
|
|
685
|
+
const exact = sourceInfos.get(p);
|
|
644
686
|
if (exact)
|
|
645
687
|
return exact;
|
|
646
|
-
// Try parent directories (package manager stores directory paths)
|
|
647
688
|
let current = p;
|
|
648
689
|
while (current.includes("/")) {
|
|
649
690
|
current = current.substring(0, current.lastIndexOf("/"));
|
|
650
|
-
const parent =
|
|
691
|
+
const parent = sourceInfos.get(current);
|
|
651
692
|
if (parent)
|
|
652
693
|
return parent;
|
|
653
694
|
}
|
|
654
695
|
return undefined;
|
|
655
696
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
const meta = this.findMetadata(p, metadata);
|
|
661
|
-
if (meta) {
|
|
662
|
-
const shortPath = this.getShortPath(p, meta.source);
|
|
663
|
-
const { label, scopeLabel } = this.getDisplaySourceInfo(meta.source, meta.scope);
|
|
697
|
+
formatPathWithSource(p, sourceInfo) {
|
|
698
|
+
if (sourceInfo) {
|
|
699
|
+
const shortPath = this.getShortPath(p, sourceInfo);
|
|
700
|
+
const { label, scopeLabel } = this.getDisplaySourceInfo(sourceInfo);
|
|
664
701
|
const labelText = scopeLabel ? `${label} (${scopeLabel})` : label;
|
|
665
702
|
return `${labelText} ${shortPath}`;
|
|
666
703
|
}
|
|
667
704
|
return this.formatDisplayPath(p);
|
|
668
705
|
}
|
|
669
|
-
|
|
670
|
-
* Format resource diagnostics with nice collision display using metadata.
|
|
671
|
-
*/
|
|
672
|
-
formatDiagnostics(diagnostics, metadata) {
|
|
706
|
+
formatDiagnostics(diagnostics, sourceInfos) {
|
|
673
707
|
const lines = [];
|
|
674
708
|
// Group collision diagnostics by name
|
|
675
709
|
const collisions = new Map();
|
|
@@ -690,21 +724,17 @@ export class InteractiveMode {
|
|
|
690
724
|
if (!first)
|
|
691
725
|
continue;
|
|
692
726
|
lines.push(theme.fg("warning", ` "${name}" collision:`));
|
|
693
|
-
|
|
694
|
-
lines.push(theme.fg("dim", ` ${theme.fg("success", "✓")} ${this.formatPathWithSource(first.winnerPath, metadata)}`));
|
|
695
|
-
// Show all losers
|
|
727
|
+
lines.push(theme.fg("dim", ` ${theme.fg("success", "✓")} ${this.formatPathWithSource(first.winnerPath, this.findSourceInfoForPath(first.winnerPath, sourceInfos))}`));
|
|
696
728
|
for (const d of collisionList) {
|
|
697
729
|
if (d.collision) {
|
|
698
|
-
lines.push(theme.fg("dim", ` ${theme.fg("warning", "✗")} ${this.formatPathWithSource(d.collision.loserPath,
|
|
730
|
+
lines.push(theme.fg("dim", ` ${theme.fg("warning", "✗")} ${this.formatPathWithSource(d.collision.loserPath, this.findSourceInfoForPath(d.collision.loserPath, sourceInfos))} (skipped)`));
|
|
699
731
|
}
|
|
700
732
|
}
|
|
701
733
|
}
|
|
702
|
-
// Format other diagnostics (skill name collisions, parse errors, etc.)
|
|
703
734
|
for (const d of otherDiagnostics) {
|
|
704
735
|
if (d.path) {
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${sourceInfo}`));
|
|
736
|
+
const formattedPath = this.formatPathWithSource(d.path, this.findSourceInfoForPath(d.path, sourceInfos));
|
|
737
|
+
lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${formattedPath}`));
|
|
708
738
|
lines.push(theme.fg(d.type === "error" ? "error" : "warning", ` ${d.message}`));
|
|
709
739
|
}
|
|
710
740
|
else {
|
|
@@ -719,11 +749,36 @@ export class InteractiveMode {
|
|
|
719
749
|
if (!showListing && !showDiagnostics) {
|
|
720
750
|
return;
|
|
721
751
|
}
|
|
722
|
-
const metadata = this.session.resourceLoader.getPathMetadata();
|
|
723
752
|
const sectionHeader = (name, color = "mdHeading") => theme.fg(color, `[${name}]`);
|
|
724
753
|
const skillsResult = this.session.resourceLoader.getSkills();
|
|
725
754
|
const promptsResult = this.session.resourceLoader.getPrompts();
|
|
726
755
|
const themesResult = this.session.resourceLoader.getThemes();
|
|
756
|
+
const extensions = options?.extensions ??
|
|
757
|
+
this.session.resourceLoader.getExtensions().extensions.map((extension) => ({
|
|
758
|
+
path: extension.path,
|
|
759
|
+
sourceInfo: extension.sourceInfo,
|
|
760
|
+
}));
|
|
761
|
+
const sourceInfos = new Map();
|
|
762
|
+
for (const extension of extensions) {
|
|
763
|
+
if (extension.sourceInfo) {
|
|
764
|
+
sourceInfos.set(extension.path, extension.sourceInfo);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
767
|
+
for (const skill of skillsResult.skills) {
|
|
768
|
+
if (skill.sourceInfo) {
|
|
769
|
+
sourceInfos.set(skill.filePath, skill.sourceInfo);
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
for (const prompt of promptsResult.prompts) {
|
|
773
|
+
if (prompt.sourceInfo) {
|
|
774
|
+
sourceInfos.set(prompt.filePath, prompt.sourceInfo);
|
|
775
|
+
}
|
|
776
|
+
}
|
|
777
|
+
for (const loadedTheme of themesResult.themes) {
|
|
778
|
+
if (loadedTheme.sourcePath && loadedTheme.sourceInfo) {
|
|
779
|
+
sourceInfos.set(loadedTheme.sourcePath, loadedTheme.sourceInfo);
|
|
780
|
+
}
|
|
781
|
+
}
|
|
727
782
|
if (showListing) {
|
|
728
783
|
const contextFiles = this.session.resourceLoader.getAgentsFiles().agentsFiles;
|
|
729
784
|
if (contextFiles.length > 0) {
|
|
@@ -736,39 +791,36 @@ export class InteractiveMode {
|
|
|
736
791
|
}
|
|
737
792
|
const skills = skillsResult.skills;
|
|
738
793
|
if (skills.length > 0) {
|
|
739
|
-
const
|
|
740
|
-
const groups = this.buildScopeGroups(skillPaths, metadata);
|
|
794
|
+
const groups = this.buildScopeGroups(skills.map((skill) => ({ path: skill.filePath, sourceInfo: skill.sourceInfo })));
|
|
741
795
|
const skillList = this.formatScopeGroups(groups, {
|
|
742
|
-
formatPath: (
|
|
743
|
-
formatPackagePath: (
|
|
796
|
+
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
797
|
+
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
744
798
|
});
|
|
745
799
|
this.chatContainer.addChild(new Text(`${sectionHeader("Skills")}\n${skillList}`, 0, 0));
|
|
746
800
|
this.chatContainer.addChild(new Spacer(1));
|
|
747
801
|
}
|
|
748
802
|
const templates = this.session.promptTemplates;
|
|
749
803
|
if (templates.length > 0) {
|
|
750
|
-
const
|
|
751
|
-
const groups = this.buildScopeGroups(templatePaths, metadata);
|
|
804
|
+
const groups = this.buildScopeGroups(templates.map((template) => ({ path: template.filePath, sourceInfo: template.sourceInfo })));
|
|
752
805
|
const templateByPath = new Map(templates.map((t) => [t.filePath, t]));
|
|
753
806
|
const templateList = this.formatScopeGroups(groups, {
|
|
754
|
-
formatPath: (
|
|
755
|
-
const template = templateByPath.get(
|
|
756
|
-
return template ? `/${template.name}` : this.formatDisplayPath(
|
|
807
|
+
formatPath: (item) => {
|
|
808
|
+
const template = templateByPath.get(item.path);
|
|
809
|
+
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
757
810
|
},
|
|
758
|
-
formatPackagePath: (
|
|
759
|
-
const template = templateByPath.get(
|
|
760
|
-
return template ? `/${template.name}` : this.formatDisplayPath(
|
|
811
|
+
formatPackagePath: (item) => {
|
|
812
|
+
const template = templateByPath.get(item.path);
|
|
813
|
+
return template ? `/${template.name}` : this.formatDisplayPath(item.path);
|
|
761
814
|
},
|
|
762
815
|
});
|
|
763
816
|
this.chatContainer.addChild(new Text(`${sectionHeader("Prompts")}\n${templateList}`, 0, 0));
|
|
764
817
|
this.chatContainer.addChild(new Spacer(1));
|
|
765
818
|
}
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
const groups = this.buildScopeGroups(extensionPaths, metadata);
|
|
819
|
+
if (extensions.length > 0) {
|
|
820
|
+
const groups = this.buildScopeGroups(extensions);
|
|
769
821
|
const extList = this.formatScopeGroups(groups, {
|
|
770
|
-
formatPath: (
|
|
771
|
-
formatPackagePath: (
|
|
822
|
+
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
823
|
+
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
772
824
|
});
|
|
773
825
|
this.chatContainer.addChild(new Text(`${sectionHeader("Extensions", "mdHeading")}\n${extList}`, 0, 0));
|
|
774
826
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -777,11 +829,13 @@ export class InteractiveMode {
|
|
|
777
829
|
const loadedThemes = themesResult.themes;
|
|
778
830
|
const customThemes = loadedThemes.filter((t) => t.sourcePath);
|
|
779
831
|
if (customThemes.length > 0) {
|
|
780
|
-
const
|
|
781
|
-
|
|
832
|
+
const groups = this.buildScopeGroups(customThemes.map((loadedTheme) => ({
|
|
833
|
+
path: loadedTheme.sourcePath,
|
|
834
|
+
sourceInfo: loadedTheme.sourceInfo,
|
|
835
|
+
})));
|
|
782
836
|
const themeList = this.formatScopeGroups(groups, {
|
|
783
|
-
formatPath: (
|
|
784
|
-
formatPackagePath: (
|
|
837
|
+
formatPath: (item) => this.formatDisplayPath(item.path),
|
|
838
|
+
formatPackagePath: (item) => this.getShortPath(item.path, item.sourceInfo),
|
|
785
839
|
});
|
|
786
840
|
this.chatContainer.addChild(new Text(`${sectionHeader("Themes")}\n${themeList}`, 0, 0));
|
|
787
841
|
this.chatContainer.addChild(new Spacer(1));
|
|
@@ -790,13 +844,13 @@ export class InteractiveMode {
|
|
|
790
844
|
if (showDiagnostics) {
|
|
791
845
|
const skillDiagnostics = skillsResult.diagnostics;
|
|
792
846
|
if (skillDiagnostics.length > 0) {
|
|
793
|
-
const warningLines = this.formatDiagnostics(skillDiagnostics,
|
|
847
|
+
const warningLines = this.formatDiagnostics(skillDiagnostics, sourceInfos);
|
|
794
848
|
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Skill conflicts]")}\n${warningLines}`, 0, 0));
|
|
795
849
|
this.chatContainer.addChild(new Spacer(1));
|
|
796
850
|
}
|
|
797
851
|
const promptDiagnostics = promptsResult.diagnostics;
|
|
798
852
|
if (promptDiagnostics.length > 0) {
|
|
799
|
-
const warningLines = this.formatDiagnostics(promptDiagnostics,
|
|
853
|
+
const warningLines = this.formatDiagnostics(promptDiagnostics, sourceInfos);
|
|
800
854
|
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Prompt conflicts]")}\n${warningLines}`, 0, 0));
|
|
801
855
|
this.chatContainer.addChild(new Spacer(1));
|
|
802
856
|
}
|
|
@@ -809,16 +863,17 @@ export class InteractiveMode {
|
|
|
809
863
|
}
|
|
810
864
|
const commandDiagnostics = this.session.extensionRunner?.getCommandDiagnostics() ?? [];
|
|
811
865
|
extensionDiagnostics.push(...commandDiagnostics);
|
|
866
|
+
extensionDiagnostics.push(...this.getBuiltInCommandConflictDiagnostics(this.session.extensionRunner));
|
|
812
867
|
const shortcutDiagnostics = this.session.extensionRunner?.getShortcutDiagnostics() ?? [];
|
|
813
868
|
extensionDiagnostics.push(...shortcutDiagnostics);
|
|
814
869
|
if (extensionDiagnostics.length > 0) {
|
|
815
|
-
const warningLines = this.formatDiagnostics(extensionDiagnostics,
|
|
870
|
+
const warningLines = this.formatDiagnostics(extensionDiagnostics, sourceInfos);
|
|
816
871
|
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Extension issues]")}\n${warningLines}`, 0, 0));
|
|
817
872
|
this.chatContainer.addChild(new Spacer(1));
|
|
818
873
|
}
|
|
819
874
|
const themeDiagnostics = themesResult.diagnostics;
|
|
820
875
|
if (themeDiagnostics.length > 0) {
|
|
821
|
-
const warningLines = this.formatDiagnostics(themeDiagnostics,
|
|
876
|
+
const warningLines = this.formatDiagnostics(themeDiagnostics, sourceInfos);
|
|
822
877
|
this.chatContainer.addChild(new Text(`${theme.fg("warning", "[Theme conflicts]")}\n${warningLines}`, 0, 0));
|
|
823
878
|
this.chatContainer.addChild(new Spacer(1));
|
|
824
879
|
}
|
|
@@ -907,19 +962,17 @@ export class InteractiveMode {
|
|
|
907
962
|
this.setupAutocomplete(this.fdPath);
|
|
908
963
|
const extensionRunner = this.session.extensionRunner;
|
|
909
964
|
if (!extensionRunner) {
|
|
910
|
-
this.showLoadedResources({
|
|
965
|
+
this.showLoadedResources({ extensions: [], force: false });
|
|
911
966
|
return;
|
|
912
967
|
}
|
|
913
968
|
this.setupExtensionShortcuts(extensionRunner);
|
|
914
|
-
this.showLoadedResources({
|
|
969
|
+
this.showLoadedResources({ force: false });
|
|
915
970
|
}
|
|
916
971
|
/**
|
|
917
972
|
* Get a registered tool definition by name (for custom rendering).
|
|
918
973
|
*/
|
|
919
974
|
getRegisteredToolDefinition(toolName) {
|
|
920
|
-
|
|
921
|
-
const registeredTool = tools.find((t) => t.definition.name === toolName);
|
|
922
|
-
return registeredTool?.definition;
|
|
975
|
+
return this.session.getToolDefinition(toolName);
|
|
923
976
|
}
|
|
924
977
|
/**
|
|
925
978
|
* Set up keyboard shortcuts registered by extensions.
|
|
@@ -1809,7 +1862,7 @@ export class InteractiveMode {
|
|
|
1809
1862
|
for (const content of this.streamingMessage.content) {
|
|
1810
1863
|
if (content.type === "toolCall") {
|
|
1811
1864
|
if (!this.pendingTools.has(content.id)) {
|
|
1812
|
-
const component = new ToolExecutionComponent(content.name, content.arguments, {
|
|
1865
|
+
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, {
|
|
1813
1866
|
showImages: this.settingsManager.getShowImages(),
|
|
1814
1867
|
}, this.getRegisteredToolDefinition(content.name), this.ui);
|
|
1815
1868
|
component.setExpanded(this.toolOutputExpanded);
|
|
@@ -1869,7 +1922,7 @@ export class InteractiveMode {
|
|
|
1869
1922
|
case "tool_execution_start": {
|
|
1870
1923
|
let component = this.pendingTools.get(event.toolCallId);
|
|
1871
1924
|
if (!component) {
|
|
1872
|
-
component = new ToolExecutionComponent(event.toolName, event.args, {
|
|
1925
|
+
component = new ToolExecutionComponent(event.toolName, event.toolCallId, event.args, {
|
|
1873
1926
|
showImages: this.settingsManager.getShowImages(),
|
|
1874
1927
|
}, this.getRegisteredToolDefinition(event.toolName), this.ui);
|
|
1875
1928
|
component.setExpanded(this.toolOutputExpanded);
|
|
@@ -2125,7 +2178,7 @@ export class InteractiveMode {
|
|
|
2125
2178
|
// Render tool call components
|
|
2126
2179
|
for (const content of message.content) {
|
|
2127
2180
|
if (content.type === "toolCall") {
|
|
2128
|
-
const component = new ToolExecutionComponent(content.name, content.arguments, { showImages: this.settingsManager.getShowImages() }, this.getRegisteredToolDefinition(content.name), this.ui);
|
|
2181
|
+
const component = new ToolExecutionComponent(content.name, content.id, content.arguments, { showImages: this.settingsManager.getShowImages() }, this.getRegisteredToolDefinition(content.name), this.ui);
|
|
2129
2182
|
component.setExpanded(this.toolOutputExpanded);
|
|
2130
2183
|
this.chatContainer.addChild(component);
|
|
2131
2184
|
if (message.stopReason === "aborted" || message.stopReason === "error") {
|
|
@@ -2434,7 +2487,7 @@ export class InteractiveMode {
|
|
|
2434
2487
|
this.ui.requestRender();
|
|
2435
2488
|
}
|
|
2436
2489
|
showNewVersionNotification(newVersion) {
|
|
2437
|
-
const action = theme.fg("accent", getUpdateInstruction("@
|
|
2490
|
+
const action = theme.fg("accent", getUpdateInstruction("@hyperspaceng/neural-coding-agent"));
|
|
2438
2491
|
const updateInstruction = theme.fg("muted", `New version ${newVersion} is available. `) + action;
|
|
2439
2492
|
const changelogUrl = theme.fg("accent", "https://github.com/badlogic/pi-mono/blob/main/packages/coding-agent/CHANGELOG.md");
|
|
2440
2493
|
const changelogLine = theme.fg("muted", "Changelog: ") + changelogUrl;
|
|
@@ -3286,7 +3339,6 @@ export class InteractiveMode {
|
|
|
3286
3339
|
this.rebuildChatFromMessages();
|
|
3287
3340
|
dismissLoader(this.editor);
|
|
3288
3341
|
this.showLoadedResources({
|
|
3289
|
-
extensionPaths: runner?.getExtensionPaths() ?? [],
|
|
3290
3342
|
force: false,
|
|
3291
3343
|
showDiagnosticsWhenQuiet: true,
|
|
3292
3344
|
});
|