@astralyn/pi 0.84.9 → 0.84.11
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 +17 -2
- package/README.md +3 -2
- package/dist/cli/args.d.ts +1 -0
- package/dist/cli/args.d.ts.map +1 -1
- package/dist/cli/args.js +29 -9
- package/dist/cli/args.js.map +1 -1
- package/dist/cli/file-processor.d.ts.map +1 -1
- package/dist/cli/file-processor.js +2 -1
- package/dist/cli/file-processor.js.map +1 -1
- package/dist/config.d.ts +4 -3
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +22 -14
- package/dist/config.js.map +1 -1
- package/dist/core/agent-session.d.ts +26 -7
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +83 -64
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/auth-storage.d.ts.map +1 -1
- package/dist/core/auth-storage.js +6 -7
- package/dist/core/auth-storage.js.map +1 -1
- package/dist/core/compaction/branch-summarization.d.ts.map +1 -1
- package/dist/core/compaction/branch-summarization.js +3 -0
- package/dist/core/compaction/branch-summarization.js.map +1 -1
- package/dist/core/compaction/compaction.d.ts +4 -3
- package/dist/core/compaction/compaction.d.ts.map +1 -1
- package/dist/core/compaction/compaction.js +41 -32
- package/dist/core/compaction/compaction.js.map +1 -1
- package/dist/core/compaction-controller.d.ts +2 -1
- package/dist/core/compaction-controller.d.ts.map +1 -1
- package/dist/core/compaction-controller.js +64 -21
- package/dist/core/compaction-controller.js.map +1 -1
- package/dist/core/defaults.d.ts +1 -0
- package/dist/core/defaults.d.ts.map +1 -1
- package/dist/core/defaults.js +9 -0
- package/dist/core/defaults.js.map +1 -1
- package/dist/core/extensions/index.d.ts +2 -2
- package/dist/core/extensions/index.d.ts.map +1 -1
- package/dist/core/extensions/index.js +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 +115 -48
- package/dist/core/extensions/loader.js.map +1 -1
- package/dist/core/extensions/types.d.ts +38 -9
- package/dist/core/extensions/types.d.ts.map +1 -1
- package/dist/core/extensions/types.js +3 -0
- package/dist/core/extensions/types.js.map +1 -1
- package/dist/core/footer-data-provider.d.ts +1 -1
- package/dist/core/footer-data-provider.js +1 -1
- package/dist/core/footer-data-provider.js.map +1 -1
- package/dist/core/keybindings.d.ts +20 -19
- package/dist/core/keybindings.d.ts.map +1 -1
- package/dist/core/keybindings.js +26 -5
- package/dist/core/keybindings.js.map +1 -1
- package/dist/core/model-config.d.ts +5 -0
- package/dist/core/model-config.d.ts.map +1 -1
- package/dist/core/model-config.js +3 -1
- package/dist/core/model-config.js.map +1 -1
- package/dist/core/model-resolver.d.ts +1 -0
- package/dist/core/model-resolver.d.ts.map +1 -1
- package/dist/core/model-resolver.js +14 -8
- package/dist/core/model-resolver.js.map +1 -1
- package/dist/core/models-store.d.ts.map +1 -1
- package/dist/core/models-store.js +2 -1
- package/dist/core/models-store.js.map +1 -1
- package/dist/core/package-manager.d.ts.map +1 -1
- package/dist/core/package-manager.js +22 -14
- package/dist/core/package-manager.js.map +1 -1
- package/dist/core/pi-manifest.d.ts.map +1 -1
- package/dist/core/pi-manifest.js +2 -1
- package/dist/core/pi-manifest.js.map +1 -1
- package/dist/core/remote-catalog-provider.d.ts.map +1 -1
- package/dist/core/remote-catalog-provider.js +2 -1
- package/dist/core/remote-catalog-provider.js.map +1 -1
- package/dist/core/resource-loader.d.ts.map +1 -1
- package/dist/core/resource-loader.js +3 -2
- package/dist/core/resource-loader.js.map +1 -1
- package/dist/core/sdk.d.ts +2 -2
- package/dist/core/sdk.d.ts.map +1 -1
- package/dist/core/sdk.js +10 -3
- package/dist/core/sdk.js.map +1 -1
- package/dist/core/session-export.d.ts +4 -0
- package/dist/core/session-export.d.ts.map +1 -0
- package/dist/core/session-export.js +32 -0
- package/dist/core/session-export.js.map +1 -0
- package/dist/core/session-manager.d.ts.map +1 -1
- package/dist/core/session-manager.js +4 -3
- package/dist/core/session-manager.js.map +1 -1
- package/dist/core/settings-diagnostics.d.ts +9 -0
- package/dist/core/settings-diagnostics.d.ts.map +1 -0
- package/dist/core/settings-diagnostics.js +21 -0
- package/dist/core/settings-diagnostics.js.map +1 -0
- package/dist/core/settings-manager.d.ts +9 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +51 -10
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/skills.d.ts.map +1 -1
- package/dist/core/skills.js +51 -33
- package/dist/core/skills.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +2 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/core/system-prompt.d.ts.map +1 -1
- package/dist/core/system-prompt.js +11 -2
- package/dist/core/system-prompt.js.map +1 -1
- package/dist/core/tools/bash.d.ts +19 -1
- package/dist/core/tools/bash.d.ts.map +1 -1
- package/dist/core/tools/bash.js +59 -37
- package/dist/core/tools/bash.js.map +1 -1
- package/dist/core/tools/edit-diff.d.ts +0 -5
- package/dist/core/tools/edit-diff.d.ts.map +1 -1
- package/dist/core/tools/edit-diff.js +2 -5
- 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 +20 -4
- package/dist/core/tools/edit.js.map +1 -1
- package/dist/core/tools/index.d.ts +4 -1
- package/dist/core/tools/index.d.ts.map +1 -1
- package/dist/core/tools/index.js +18 -1
- package/dist/core/tools/index.js.map +1 -1
- package/dist/core/tools/powershell.d.ts +16 -0
- package/dist/core/tools/powershell.d.ts.map +1 -0
- package/dist/core/tools/powershell.js +39 -0
- package/dist/core/tools/powershell.js.map +1 -0
- package/dist/core/trust-manager.d.ts.map +1 -1
- package/dist/core/trust-manager.js +2 -1
- package/dist/core/trust-manager.js.map +1 -1
- package/dist/extensions/background/registry.d.ts +2 -3
- package/dist/extensions/background/registry.d.ts.map +1 -1
- package/dist/extensions/background/registry.js +2 -6
- package/dist/extensions/background/registry.js.map +1 -1
- package/dist/extensions/llama/index.d.ts.map +1 -1
- package/dist/extensions/llama/index.js +2 -0
- package/dist/extensions/llama/index.js.map +1 -1
- package/dist/extensions/llama/provider.d.ts.map +1 -1
- package/dist/extensions/llama/provider.js +6 -2
- package/dist/extensions/llama/provider.js.map +1 -1
- package/dist/extensions/question/types.d.ts +0 -1
- package/dist/extensions/question/types.d.ts.map +1 -1
- package/dist/extensions/question/types.js +1 -1
- package/dist/extensions/question/types.js.map +1 -1
- package/dist/extensions/router/register.d.ts +0 -1
- package/dist/extensions/router/register.d.ts.map +1 -1
- package/dist/extensions/router/register.js +0 -3
- package/dist/extensions/router/register.js.map +1 -1
- package/dist/extensions/router/stream.d.ts +0 -2
- package/dist/extensions/router/stream.d.ts.map +1 -1
- package/dist/extensions/router/stream.js +1 -12
- package/dist/extensions/router/stream.js.map +1 -1
- package/dist/extensions/subagent/constants.d.ts +1 -1
- package/dist/extensions/subagent/constants.js +1 -1
- package/dist/extensions/subagent/constants.js.map +1 -1
- package/dist/extensions/subagent/index.js +2 -2
- package/dist/extensions/subagent/index.js.map +1 -1
- package/dist/extensions/subagent/render.d.ts +5 -5
- package/dist/extensions/subagent/render.d.ts.map +1 -1
- package/dist/extensions/subagent/render.js +92 -36
- package/dist/extensions/subagent/render.js.map +1 -1
- package/dist/extensions/subagent/text.d.ts +0 -1
- package/dist/extensions/subagent/text.d.ts.map +1 -1
- package/dist/extensions/subagent/text.js +1 -30
- package/dist/extensions/subagent/text.js.map +1 -1
- package/dist/extensions/subagent/ui/model-list.d.ts +0 -3
- package/dist/extensions/subagent/ui/model-list.d.ts.map +1 -1
- package/dist/extensions/subagent/ui/model-list.js +1 -10
- package/dist/extensions/subagent/ui/model-list.js.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/main.d.ts +4 -0
- package/dist/main.d.ts.map +1 -1
- package/dist/main.js +18 -15
- package/dist/main.js.map +1 -1
- package/dist/migrations.js +5 -5
- package/dist/migrations.js.map +1 -1
- package/dist/modes/interactive/components/index.d.ts +0 -1
- package/dist/modes/interactive/components/index.d.ts.map +1 -1
- package/dist/modes/interactive/components/index.js +0 -1
- package/dist/modes/interactive/components/index.js.map +1 -1
- package/dist/modes/interactive/components/model-selector.d.ts +9 -3
- package/dist/modes/interactive/components/model-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/model-selector.js +54 -11
- package/dist/modes/interactive/components/model-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-selector.d.ts +7 -2
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +118 -55
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/components/settings-submenu.d.ts +72 -0
- package/dist/modes/interactive/components/settings-submenu.d.ts.map +1 -0
- package/dist/modes/interactive/components/settings-submenu.js +151 -0
- package/dist/modes/interactive/components/settings-submenu.js.map +1 -0
- package/dist/modes/interactive/components/thinking-selector.d.ts +15 -3
- package/dist/modes/interactive/components/thinking-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/thinking-selector.js +68 -17
- package/dist/modes/interactive/components/thinking-selector.js.map +1 -1
- package/dist/modes/interactive/external-editor.d.ts.map +1 -1
- package/dist/modes/interactive/external-editor.js +2 -1
- package/dist/modes/interactive/external-editor.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +11 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +167 -105
- package/dist/modes/interactive/interactive-mode.js.map +1 -1
- package/dist/modes/interactive/session-share.d.ts +16 -0
- package/dist/modes/interactive/session-share.d.ts.map +1 -0
- package/dist/modes/interactive/session-share.js +188 -0
- package/dist/modes/interactive/session-share.js.map +1 -0
- package/dist/modes/interactive/theme/theme.d.ts.map +1 -1
- package/dist/modes/interactive/theme/theme.js +3 -2
- package/dist/modes/interactive/theme/theme.js.map +1 -1
- package/dist/modes/json-event.d.ts +16 -13
- package/dist/modes/json-event.d.ts.map +1 -1
- package/dist/modes/json-event.js +20 -6
- package/dist/modes/json-event.js.map +1 -1
- package/dist/package-manager-cli.d.ts +1 -0
- package/dist/package-manager-cli.d.ts.map +1 -1
- package/dist/package-manager-cli.js +186 -2
- package/dist/package-manager-cli.js.map +1 -1
- package/dist/utils/frontmatter.d.ts.map +1 -1
- package/dist/utils/frontmatter.js +2 -1
- package/dist/utils/frontmatter.js.map +1 -1
- package/dist/utils/management-http.d.ts +5 -3
- package/dist/utils/management-http.d.ts.map +1 -1
- package/dist/utils/management-http.js +14 -10
- package/dist/utils/management-http.js.map +1 -1
- package/dist/utils/paths.d.ts +0 -5
- package/dist/utils/paths.d.ts.map +1 -1
- package/dist/utils/paths.js +0 -7
- package/dist/utils/paths.js.map +1 -1
- package/dist/utils/shell.d.ts +3 -0
- package/dist/utils/shell.d.ts.map +1 -1
- package/dist/utils/shell.js +17 -5
- package/dist/utils/shell.js.map +1 -1
- package/dist/utils/text.d.ts +8 -0
- package/dist/utils/text.d.ts.map +1 -0
- package/dist/utils/text.js +9 -0
- package/dist/utils/text.js.map +1 -0
- package/docs/bundled/extensions/subagent.md +1 -1
- package/docs/compaction.md +19 -2
- package/docs/custom-provider.md +5 -2
- package/docs/environment-variables.md +8 -8
- package/docs/extensions.md +22 -10
- package/docs/json.md +7 -2
- package/docs/keybindings.md +10 -8
- package/docs/llama-cpp.md +6 -4
- package/docs/models.md +10 -3
- package/docs/packages.md +2 -1
- package/docs/rpc.md +9 -3
- package/docs/sdk.md +12 -2
- package/docs/settings.md +16 -5
- package/docs/skills.md +5 -4
- package/docs/terminal-setup.md +11 -9
- package/docs/usage.md +6 -2
- package/docs/windows.md +24 -2
- package/examples/extensions/border-status-editor.ts +1 -1
- 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/doom-overlay/doom/build/doom.wasm +0 -0
- package/examples/extensions/doom-overlay/doom/build.sh +0 -0
- package/examples/extensions/git-checkpoint.ts +2 -2
- package/examples/extensions/gondolin/package-lock.json +2 -2
- package/examples/extensions/gondolin/package.json +1 -1
- package/examples/extensions/notify.ts +3 -1
- package/examples/extensions/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/titlebar-spinner.ts +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/examples/rpc-extension-ui.ts +1 -1
- package/examples/sdk/06-extensions.ts +1 -1
- package/examples/sdk/README.md +1 -1
- package/npm-shrinkwrap.json +196 -257
- package/package.json +6 -8
|
@@ -16,7 +16,7 @@ export function firstPlainLine(text) {
|
|
|
16
16
|
.find(Boolean) ?? "");
|
|
17
17
|
}
|
|
18
18
|
// Truncates by code points (never splitting a surrogate pair) and appends an
|
|
19
|
-
// ellipsis; for UTF-8 byte budgets use boundText
|
|
19
|
+
// ellipsis; for UTF-8 byte budgets use boundText instead.
|
|
20
20
|
export function truncate(text, limit) {
|
|
21
21
|
const characters = [...text];
|
|
22
22
|
return characters.length <= limit ? text : `${characters.slice(0, Math.max(0, limit - 1)).join("")}…`;
|
|
@@ -38,22 +38,6 @@ export function utf8Prefix(text, maxBytes) {
|
|
|
38
38
|
}
|
|
39
39
|
return output;
|
|
40
40
|
}
|
|
41
|
-
function utf8Suffix(text, maxBytes) {
|
|
42
|
-
if (maxBytes <= 0)
|
|
43
|
-
return "";
|
|
44
|
-
if (Buffer.byteLength(text, "utf8") <= maxBytes)
|
|
45
|
-
return text;
|
|
46
|
-
const characters = [];
|
|
47
|
-
let bytes = 0;
|
|
48
|
-
for (const character of Array.from(text).reverse()) {
|
|
49
|
-
const characterBytes = Buffer.byteLength(character, "utf8");
|
|
50
|
-
if (bytes + characterBytes > maxBytes)
|
|
51
|
-
break;
|
|
52
|
-
characters.push(character);
|
|
53
|
-
bytes += characterBytes;
|
|
54
|
-
}
|
|
55
|
-
return characters.reverse().join("");
|
|
56
|
-
}
|
|
57
41
|
export function boundText(text, maxBytes) {
|
|
58
42
|
if (maxBytes <= 0)
|
|
59
43
|
return "";
|
|
@@ -75,17 +59,4 @@ export function boundText(text, maxBytes) {
|
|
|
75
59
|
const notice = `\n\n[Output truncated: ${omitted} bytes omitted.]`;
|
|
76
60
|
return `${utf8Prefix(output, Math.max(0, maxBytes - Buffer.byteLength(notice, "utf8")))}${notice}`;
|
|
77
61
|
}
|
|
78
|
-
export function tailText(text, maxBytes) {
|
|
79
|
-
if (maxBytes <= 0)
|
|
80
|
-
return "";
|
|
81
|
-
if (Buffer.byteLength(text, "utf8") <= maxBytes)
|
|
82
|
-
return text;
|
|
83
|
-
const noticeText = "[Earlier output omitted.]";
|
|
84
|
-
const notice = `${noticeText}\n`;
|
|
85
|
-
const available = maxBytes - Buffer.byteLength(notice, "utf8");
|
|
86
|
-
if (available <= 0)
|
|
87
|
-
return utf8Prefix(noticeText, maxBytes);
|
|
88
|
-
const output = utf8Suffix(text, available);
|
|
89
|
-
return output ? `${notice}${output}` : utf8Prefix(noticeText, maxBytes);
|
|
90
|
-
}
|
|
91
62
|
//# sourceMappingURL=text.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"text.js","sourceRoot":"","sources":["../../../src/extensions/subagent/text.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,8DAA8D;AAE9D,MAAM,UAAU,SAAS,CAAC,IAAY;IACrC,OAAO,IAAI;SACT,OAAO,CAAC,gBAAgB,EAAE,EAAE,CAAC;SAC7B,OAAO,CAAC,aAAa,EAAE,IAAI,CAAC;SAC5B,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC;SAClC,OAAO,CAAC,yBAAyB,EAAE,IAAI,CAAC;SACxC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC;SACrB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,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;QAC/D,IAAI,SAAS,IAAI,CAAC;YAAE,OAAO,UAAU,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;QACvE,MAAM,IAAI,GAAG,UAAU,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC;QACzC,IAAI,IAAI,KAAK,MAAM;YAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;QACjD,MAAM,GAAG,IAAI,CAAC;IACf,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,EAAE,MAAM,CAAC,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpF,MAAM,MAAM,GAAG,0BAA0B,OAAO,kBAAkB,CAAC;IACnE,OAAO,GAAG,UAAU,CAAC,MAAM,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAAC,UAAU,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC;AACpG,CAAC","sourcesContent":["// Text utilities shared across the subagent extension: plain-text\n// projection, UTF-8 byte bounding, and code-point truncation.\n\nexport function plainLine(text: string): string {\n\treturn text\n\t\t.replace(/^\\s*#{1,6}\\s+/u, \"\")\n\t\t.replace(/`([^`]*)`/gu, \"$1\")\n\t\t.replace(/\\*\\*([^*]+)\\*\\*/gu, \"$1\")\n\t\t.replace(/\\[([^\\]]+)\\]\\([^)]*\\)/gu, \"$1\")\n\t\t.replace(/\\s+/gu, \" \")\n\t\t.trim();\n}\n\nexport function firstPlainLine(text: string): string {\n\treturn (\n\t\ttext\n\t\t\t.split(\"\\n\")\n\t\t\t.map((line) => plainLine(line))\n\t\t\t.find(Boolean) ?? \"\"\n\t);\n}\n\n// Truncates by code points (never splitting a surrogate pair) and appends an\n// ellipsis; for UTF-8 byte budgets use boundText instead.\nexport function truncate(text: string, limit: number): string {\n\tconst characters = [...text];\n\treturn characters.length <= limit ? text : `${characters.slice(0, Math.max(0, limit - 1)).join(\"\")}…`;\n}\n\n// Iterates code points so a surrogate pair is never split in half.\nexport function utf8Prefix(text: string, maxBytes: number): string {\n\tif (maxBytes <= 0) return \"\";\n\tif (Buffer.byteLength(text, \"utf8\") <= maxBytes) return text;\n\tlet output = \"\";\n\tlet bytes = 0;\n\tfor (const character of text) {\n\t\tconst characterBytes = Buffer.byteLength(character, \"utf8\");\n\t\tif (bytes + characterBytes > maxBytes) break;\n\t\toutput += character;\n\t\tbytes += characterBytes;\n\t}\n\treturn output;\n}\n\nexport function boundText(text: string, maxBytes: number): string {\n\tif (maxBytes <= 0) return \"\";\n\tif (Buffer.byteLength(text, \"utf8\") <= maxBytes) return text;\n\tlet output = utf8Prefix(text, maxBytes);\n\tfor (let attempt = 0; attempt < 8; attempt++) {\n\t\tconst omitted = Buffer.byteLength(text, \"utf8\") - Buffer.byteLength(output, \"utf8\");\n\t\tconst notice = `\\n\\n[Output truncated: ${omitted} bytes omitted.]`;\n\t\tconst available = maxBytes - Buffer.byteLength(notice, \"utf8\");\n\t\tif (available <= 0) return utf8Prefix(\"[Output truncated.]\", maxBytes);\n\t\tconst next = utf8Prefix(text, available);\n\t\tif (next === output) return `${output}${notice}`;\n\t\toutput = next;\n\t}\n\tconst omitted = Buffer.byteLength(text, \"utf8\") - Buffer.byteLength(output, \"utf8\");\n\tconst notice = `\\n\\n[Output truncated: ${omitted} bytes omitted.]`;\n\treturn `${utf8Prefix(output, Math.max(0, maxBytes - Buffer.byteLength(notice, \"utf8\")))}${notice}`;\n}\n"]}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Api, Model } from "@earendil-works/pi-ai";
|
|
2
2
|
import { Container, type Focusable, type KeybindingsManager } from "@earendil-works/pi-tui";
|
|
3
3
|
import type { Theme } from "../../../modes/interactive/theme/theme.ts";
|
|
4
|
-
type ModelScope = "all" | "scoped";
|
|
5
4
|
type StatusTone = "muted" | "success" | "error";
|
|
6
5
|
export interface ProfileModelChoice {
|
|
7
6
|
/** Undefined represents inheriting the current session model. */
|
|
@@ -58,8 +57,6 @@ export declare class ProfileModelListComponent extends Container implements Focu
|
|
|
58
57
|
private moveSelection;
|
|
59
58
|
private toggleScope;
|
|
60
59
|
getSelectedChoice(): ProfileModelChoice | undefined;
|
|
61
|
-
getScope(): ModelScope;
|
|
62
|
-
getSearchValue(): string;
|
|
63
60
|
updateModels(models: readonly Model<Api>[]): void;
|
|
64
61
|
setStatus(message: string | undefined, tone?: StatusTone): void;
|
|
65
62
|
invalidate(): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-list.d.ts","sourceRoot":"","sources":["../../../../src/extensions/subagent/ui/model-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACN,SAAS,EACT,KAAK,SAAS,EAGd,KAAK,kBAAkB,EAIvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;
|
|
1
|
+
{"version":3,"file":"model-list.d.ts","sourceRoot":"","sources":["../../../../src/extensions/subagent/ui/model-list.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EACN,SAAS,EACT,KAAK,SAAS,EAGd,KAAK,kBAAkB,EAIvB,MAAM,wBAAwB,CAAC;AAChC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2CAA2C,CAAC;AAOvE,KAAK,UAAU,GAAG,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC;AAEhD,MAAM,WAAW,kBAAkB;IAClC,iEAAiE;IACjE,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;IAC5B,oFAAoF;IACpF,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC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AO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,QAAQ,CAAS;IAEzB,IAAI,OAAO,IAAI,OAAO,CAErB;IAED,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;gBAEW,OAAO,EAAE,uBAAuB;IAsB5C,OAAO,CAAC,iBAAiB;IAYzB,OAAO,CAAC,eAAe;IAYvB,OAAO,CAAC,qBAAqB;IAa7B,OAAO,CAAC,YAAY;IAcpB,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,WAAW;IAanB,OAAO,CAAC,eAAe;IAqBvB,OAAO,CAAC,WAAW;IAYnB,OAAO,CAAC,UAAU;IA8ClB,OAAO,CAAC,aAAa;IAMrB,OAAO,CAAC,WAAW;IASnB,iBAAiB,IAAI,kBAAkB,GAAG,SAAS;IAMnD,YAAY,CAAC,MAAM,EAAE,SAAS,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,IAAI;IAMjD,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,GAAE,UAAoB,GAAG,IAAI;IAM/D,UAAU,IAAI,IAAI;IAM3B,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI;CAiB/B"}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { Container, fuzzyFilter, Input, Spacer, Text, TruncatedText, } from "@earendil-works/pi-tui";
|
|
2
2
|
import { modelId, parseModelSpec } from "../model-selection.js";
|
|
3
|
+
import { compareModels } from "./choices.js";
|
|
3
4
|
const MAX_VISIBLE_MODELS = 10;
|
|
4
|
-
function compareModels(left, right) {
|
|
5
|
-
const provider = left.provider.localeCompare(right.provider);
|
|
6
|
-
return provider !== 0 ? provider : left.id.localeCompare(right.id);
|
|
7
|
-
}
|
|
8
5
|
function modelSearchText(item) {
|
|
9
6
|
if (item.modelId === undefined) {
|
|
10
7
|
const inherited = item.model ? ` ${modelId(item.model)} ${item.model.name}` : "";
|
|
@@ -197,12 +194,6 @@ export class ProfileModelListComponent extends Container {
|
|
|
197
194
|
return undefined;
|
|
198
195
|
return { modelId: selected.modelId, model: selected.model, unavailable: selected.unavailable };
|
|
199
196
|
}
|
|
200
|
-
getScope() {
|
|
201
|
-
return this.scope;
|
|
202
|
-
}
|
|
203
|
-
getSearchValue() {
|
|
204
|
-
return this.searchInput.getValue();
|
|
205
|
-
}
|
|
206
197
|
updateModels(models) {
|
|
207
198
|
const selectedKey = this.filteredChoices[this.selectedIndex]?.key;
|
|
208
199
|
this.models = [...models];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-list.js","sourceRoot":"","sources":["../../../../src/extensions/subagent/ui/model-list.ts"],"names":[],"mappings":"AACA,OAAO,EACN,SAAS,EAET,WAAW,EACX,KAAK,EAEL,MAAM,EACN,IAAI,EACJ,aAAa,GACb,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAEhE,MAAM,kBAAkB,GAAG,EAAE,CAAC;AA+B9B,SAAS,aAAa,CAAC,IAAgB,EAAE,KAAiB;IACzD,MAAM,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC,aAAa,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC7D,OAAO,QAAQ,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;AACpE,CAAC;AAED,SAAS,eAAe,CAAC,IAAqB;IAC7C,IAAI,IAAI,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;QAChC,MAAM,SAAS,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACjF,OAAO,UAAU,SAAS,EAAE,CAAC;IAC9B,CAAC;IACD,M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AO,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,CAAC;YAC9D,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE,CAAC;YACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC1C,IAAI,QAAQ;gBAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport {\n\tContainer,\n\ttype Focusable,\n\tfuzzyFilter,\n\tInput,\n\ttype KeybindingsManager,\n\tSpacer,\n\tText,\n\tTruncatedText,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport { modelId, parseModelSpec } from \"../model-selection.ts\";\n\nconst MAX_VISIBLE_MODELS = 10;\n\ntype ModelScope = \"all\" | \"scoped\";\ntype StatusTone = \"muted\" | \"success\" | \"error\";\n\nexport interface ProfileModelChoice {\n\t/** Undefined represents inheriting the current session model. */\n\tmodelId: string | undefined;\n\t/** Effective model for capability checks; unavailable saved overrides have none. */\n\tmodel: Model<Api> | undefined;\n\tunavailable: boolean;\n}\n\nexport interface ProfileModelListOptions {\n\ttheme: Theme;\n\tkeybindings: KeybindingsManager;\n\tmodels: readonly Model<Api>[];\n\tscopedModels: readonly { model: Model<Api> }[];\n\tcurrentSessionModel: Model<Api> | undefined;\n\tsavedModelId: string | undefined;\n\t/** Reports the confirmed choice; undefined means the picker was dismissed. */\n\tonDone: (choice: ProfileModelChoice | undefined) => void;\n}\n\ninterface ModelChoiceItem extends ProfileModelChoice {\n\tkey: string;\n\tprovider: string;\n\tid: string;\n\tname: string | undefined;\n}\n\nfunction compareModels(left: Model<Api>, right: Model<Api>): number {\n\tconst provider = left.provider.localeCompare(right.provider);\n\treturn provider !== 0 ? provider : left.id.localeCompare(right.id);\n}\n\nfunction modelSearchText(item: ModelChoiceItem): string {\n\tif (item.modelId === undefined) {\n\t\tconst inherited = item.model ? ` ${modelId(item.model)} ${item.model.name}` : \"\";\n\t\treturn `inherit${inherited}`;\n\t}\n\tconst name = item.name ? ` ${item.name}` : \"\";\n\treturn `${item.provider} ${item.provider}/${item.id} ${item.provider} ${item.id}${name}`;\n}\n\n/** Searchable /model-style model picker used by /agents; confirm reports the selected choice. */\nexport class ProfileModelListComponent extends Container implements Focusable {\n\tprivate readonly theme: Theme;\n\tprivate readonly keybindings: KeybindingsManager;\n\tprivate readonly currentSessionModel: Model<Api> | undefined;\n\tprivate readonly savedModelId: string | undefined;\n\tprivate readonly scopedModelKeys: Set<string>;\n\tprivate readonly onDone: (choice: ProfileModelChoice | undefined) => void;\n\tprivate readonly searchInput: Input;\n\tprivate readonly scopeContainer: Container;\n\tprivate readonly listContainer: Container;\n\tprivate models: Model<Api>[];\n\tprivate allChoices: ModelChoiceItem[] = [];\n\tprivate scopedChoices: ModelChoiceItem[] = [];\n\tprivate activeChoices: ModelChoiceItem[] = [];\n\tprivate filteredChoices: ModelChoiceItem[] = [];\n\tprivate selectedIndex = 0;\n\tprivate scope: ModelScope;\n\tprivate statusMessage: string | undefined;\n\tprivate statusTone: StatusTone = \"muted\";\n\tprivate _focused = false;\n\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\n\tconstructor(options: ProfileModelListOptions) {\n\t\tsuper();\n\t\tthis.theme = options.theme;\n\t\tthis.keybindings = options.keybindings;\n\t\tthis.models = [...options.models];\n\t\tthis.currentSessionModel = options.currentSessionModel;\n\t\tthis.savedModelId = options.savedModelId;\n\t\tthis.scopedModelKeys = new Set(options.scopedModels.map(({ model }) => modelId(model)));\n\t\tthis.scope = this.scopedModelKeys.size > 0 ? \"scoped\" : \"all\";\n\t\tthis.onDone = options.onDone;\n\n\t\tthis.scopeContainer = new Container();\n\t\tthis.addChild(this.scopeContainer);\n\t\tthis.searchInput = new Input();\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\tthis.rebuildChoices(this.savedModelId ?? \"\");\n\t}\n\n\tprivate makeInheritChoice(): ModelChoiceItem {\n\t\treturn {\n\t\t\tkey: \"\",\n\t\t\tmodelId: undefined,\n\t\t\tmodel: this.currentSessionModel,\n\t\t\tunavailable: false,\n\t\t\tprovider: this.currentSessionModel?.provider ?? \"\",\n\t\t\tid: \"inherit\",\n\t\t\tname: this.currentSessionModel?.name,\n\t\t};\n\t}\n\n\tprivate makeModelChoice(model: Model<Api>): ModelChoiceItem {\n\t\treturn {\n\t\t\tkey: modelId(model),\n\t\t\tmodelId: modelId(model),\n\t\t\tmodel,\n\t\t\tunavailable: false,\n\t\t\tprovider: model.provider,\n\t\t\tid: model.id,\n\t\t\tname: model.name,\n\t\t};\n\t}\n\n\tprivate makeUnavailableChoice(modelId: string): ModelChoiceItem {\n\t\tconst parsed = parseModelSpec(modelId);\n\t\treturn {\n\t\t\tkey: modelId,\n\t\t\tmodelId,\n\t\t\tmodel: undefined,\n\t\t\tunavailable: true,\n\t\t\tprovider: parsed.provider,\n\t\t\tid: parsed.id,\n\t\t\tname: undefined,\n\t\t};\n\t}\n\n\tprivate buildChoices(models: readonly Model<Api>[]): ModelChoiceItem[] {\n\t\tconst sorted = [...models].sort(compareModels);\n\t\tconst availableById = new Map(this.models.map((model) => [modelId(model), model]));\n\t\tconst choices: ModelChoiceItem[] = [this.makeInheritChoice()];\n\t\tif (this.savedModelId) {\n\t\t\tconst saved = availableById.get(this.savedModelId);\n\t\t\tchoices.push(saved ? this.makeModelChoice(saved) : this.makeUnavailableChoice(this.savedModelId));\n\t\t}\n\t\tfor (const model of sorted) {\n\t\t\tif (modelId(model) !== this.savedModelId) choices.push(this.makeModelChoice(model));\n\t\t}\n\t\treturn choices;\n\t}\n\n\tprivate rebuildChoices(preferredKey?: string): void {\n\t\tconst currentKey = preferredKey ?? this.filteredChoices[this.selectedIndex]?.key ?? this.savedModelId ?? \"\";\n\t\tthis.allChoices = this.buildChoices(this.models);\n\t\tconst scopedModels = this.models.filter((model) => this.scopedModelKeys.has(modelId(model)));\n\t\tthis.scopedChoices = this.buildChoices(scopedModels);\n\t\tthis.activeChoices = this.scope === \"scoped\" ? this.scopedChoices : this.allChoices;\n\t\tthis.applyFilter(this.searchInput.getValue(), currentKey, false);\n\t\tthis.updateScopeView();\n\t}\n\n\tprivate applyFilter(query: string, preferredKey?: string, resetSelection = true): void {\n\t\tthis.filteredChoices = query ? fuzzyFilter(this.activeChoices, query, modelSearchText) : this.activeChoices;\n\t\tif (preferredKey !== undefined) {\n\t\t\tconst preferredIndex = this.filteredChoices.findIndex((choice) => choice.key === preferredKey);\n\t\t\tthis.selectedIndex = preferredIndex >= 0 ? preferredIndex : 0;\n\t\t} else if (query && resetSelection) {\n\t\t\tthis.selectedIndex = 0;\n\t\t} else {\n\t\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredChoices.length - 1));\n\t\t}\n\t\tthis.updateList();\n\t}\n\n\tprivate updateScopeView(): void {\n\t\tthis.scopeContainer.clear();\n\t\tif (this.scopedModelKeys.size === 0) {\n\t\t\tthis.scopeContainer.addChild(\n\t\t\t\tnew Text(\n\t\t\t\t\tthis.theme.fg(\"warning\", \"Only showing models from configured providers. Use /login to add providers.\"),\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t\tthis.scopeContainer.addChild(new Spacer(1));\n\t\t\treturn;\n\t\t}\n\t\tconst all = this.scope === \"all\" ? this.theme.fg(\"accent\", \"all\") : this.theme.fg(\"muted\", \"all\");\n\t\tconst scoped = this.scope === \"scoped\" ? this.theme.fg(\"accent\", \"scoped\") : this.theme.fg(\"muted\", \"scoped\");\n\t\tthis.scopeContainer.addChild(\n\t\t\tnew Text(`${this.theme.fg(\"muted\", \"Scope: \")}${all}${this.theme.fg(\"muted\", \" | \")}${scoped}`, 0, 0),\n\t\t);\n\t\tthis.scopeContainer.addChild(new Spacer(1));\n\t}\n\n\tprivate choiceLabel(choice: ModelChoiceItem): string {\n\t\tif (choice.modelId === undefined) {\n\t\t\tconst inherited = choice.model ? modelId(choice.model) : \"none\";\n\t\t\treturn `inherit ${this.theme.fg(\"muted\", `(${inherited})`)}`;\n\t\t}\n\t\tif (choice.unavailable) {\n\t\t\tconst badge = choice.provider ? `${choice.provider} · unavailable` : \"unavailable\";\n\t\t\treturn `${choice.id} ${this.theme.fg(\"warning\", `[${badge}]`)}`;\n\t\t}\n\t\treturn `${choice.id} ${this.theme.fg(\"muted\", `[${choice.provider}]`)}`;\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\tthis.selectedIndex - Math.floor(MAX_VISIBLE_MODELS / 2),\n\t\t\t\tthis.filteredChoices.length - MAX_VISIBLE_MODELS,\n\t\t\t),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + MAX_VISIBLE_MODELS, this.filteredChoices.length);\n\t\tfor (let index = startIndex; index < endIndex; index++) {\n\t\t\tconst choice = this.filteredChoices[index];\n\t\t\tif (!choice) continue;\n\t\t\tconst selected = index === this.selectedIndex;\n\t\t\tconst saved = choice.modelId === this.savedModelId;\n\t\t\tconst prefix = selected ? this.theme.fg(\"accent\", \"→ \") : \" \";\n\t\t\tconst label = this.choiceLabel(choice);\n\t\t\tconst styledLabel = selected ? this.theme.fg(\"accent\", label) : label;\n\t\t\tconst checkmark = saved ? this.theme.fg(\"success\", \" ✓\") : \"\";\n\t\t\tthis.listContainer.addChild(new TruncatedText(`${prefix}${styledLabel}${checkmark}`, 0, 0));\n\t\t}\n\n\t\tif (startIndex > 0 || endIndex < this.filteredChoices.length) {\n\t\t\tthis.listContainer.addChild(\n\t\t\t\tnew TruncatedText(\n\t\t\t\t\tthis.theme.fg(\"muted\", ` (${this.selectedIndex + 1}/${this.filteredChoices.length})`),\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tif (this.filteredChoices.length === 0) {\n\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(\"muted\", \" No matching models\"), 0, 0));\n\t\t} else {\n\t\t\tconst selected = this.filteredChoices[this.selectedIndex];\n\t\t\tif (selected?.model?.name) {\n\t\t\t\tthis.listContainer.addChild(new Spacer(1));\n\t\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(\"muted\", ` Model Name: ${selected.model.name}`), 0, 0));\n\t\t\t}\n\t\t}\n\t\tif (this.statusMessage) {\n\t\t\tthis.listContainer.addChild(new Spacer(1));\n\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(this.statusTone, ` ${this.statusMessage}`), 0, 0));\n\t\t}\n\t}\n\n\tprivate moveSelection(offset: -1 | 1): void {\n\t\tif (this.filteredChoices.length === 0) return;\n\t\tthis.selectedIndex = (this.selectedIndex + offset + this.filteredChoices.length) % this.filteredChoices.length;\n\t\tthis.updateList();\n\t}\n\n\tprivate toggleScope(): void {\n\t\tif (this.scopedModelKeys.size === 0) return;\n\t\tconst currentKey = this.filteredChoices[this.selectedIndex]?.key;\n\t\tthis.scope = this.scope === \"all\" ? \"scoped\" : \"all\";\n\t\tthis.activeChoices = this.scope === \"scoped\" ? this.scopedChoices : this.allChoices;\n\t\tthis.applyFilter(this.searchInput.getValue(), currentKey, false);\n\t\tthis.updateScopeView();\n\t}\n\n\tgetSelectedChoice(): ProfileModelChoice | undefined {\n\t\tconst selected = this.filteredChoices[this.selectedIndex];\n\t\tif (!selected) return undefined;\n\t\treturn { modelId: selected.modelId, model: selected.model, unavailable: selected.unavailable };\n\t}\n\n\tgetScope(): ModelScope {\n\t\treturn this.scope;\n\t}\n\n\tgetSearchValue(): string {\n\t\treturn this.searchInput.getValue();\n\t}\n\n\tupdateModels(models: readonly Model<Api>[]): void {\n\t\tconst selectedKey = this.filteredChoices[this.selectedIndex]?.key;\n\t\tthis.models = [...models];\n\t\tthis.rebuildChoices(selectedKey);\n\t}\n\n\tsetStatus(message: string | undefined, tone: StatusTone = \"muted\"): void {\n\t\tthis.statusMessage = message;\n\t\tthis.statusTone = tone;\n\t\tthis.updateList();\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.updateScopeView();\n\t\tthis.updateList();\n\t\tsuper.invalidate();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (this.keybindings.matches(data, \"tui.input.tab\")) {\n\t\t\tthis.toggleScope();\n\t\t} else if (this.keybindings.matches(data, \"tui.select.up\")) {\n\t\t\tthis.moveSelection(-1);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.down\")) {\n\t\t\tthis.moveSelection(1);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.confirm\")) {\n\t\t\tconst selected = this.getSelectedChoice();\n\t\t\tif (selected) this.onDone(selected);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onDone(undefined);\n\t\t} else {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"model-list.js","sourceRoot":"","sources":["../../../../src/extensions/subagent/ui/model-list.ts"],"names":[],"mappings":"AACA,OAAO,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vB,IAAI,CAAC,UAAU,EAAE,CAAC;QAClB,KAAK,CAAC,UAAU,EAAE,CAAC;IACpB,CAAC;IAED,WAAW,CAAC,IAAY;QACvB,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,CAAC;YACrD,IAAI,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,eAAe,CAAC,EAAE,CAAC;YAC5D,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CAAC;QACxB,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,iBAAiB,CAAC,EAAE,CAAC;YAC9D,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC;QACvB,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,oBAAoB,CAAC,EAAE,CAAC;YACjE,MAAM,QAAQ,GAAG,IAAI,CAAC,iBAAiB,EAAE,CAAC;YAC1C,IAAI,QAAQ;gBAAE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;aAAM,IAAI,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,IAAI,EAAE,mBAAmB,CAAC,EAAE,CAAC;YAChE,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACxB,CAAC;aAAM,CAAC;YACP,IAAI,CAAC,WAAW,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,WAAW,CAAC,QAAQ,EAAE,CAAC,CAAC;QAC/C,CAAC;IACF,CAAC;CACD","sourcesContent":["import type { Api, Model } from \"@earendil-works/pi-ai\";\nimport {\n\tContainer,\n\ttype Focusable,\n\tfuzzyFilter,\n\tInput,\n\ttype KeybindingsManager,\n\tSpacer,\n\tText,\n\tTruncatedText,\n} from \"@earendil-works/pi-tui\";\nimport type { Theme } from \"../../../modes/interactive/theme/theme.ts\";\nimport { modelId, parseModelSpec } from \"../model-selection.ts\";\nimport { compareModels } from \"./choices.ts\";\n\nconst MAX_VISIBLE_MODELS = 10;\n\ntype ModelScope = \"all\" | \"scoped\";\ntype StatusTone = \"muted\" | \"success\" | \"error\";\n\nexport interface ProfileModelChoice {\n\t/** Undefined represents inheriting the current session model. */\n\tmodelId: string | undefined;\n\t/** Effective model for capability checks; unavailable saved overrides have none. */\n\tmodel: Model<Api> | undefined;\n\tunavailable: boolean;\n}\n\nexport interface ProfileModelListOptions {\n\ttheme: Theme;\n\tkeybindings: KeybindingsManager;\n\tmodels: readonly Model<Api>[];\n\tscopedModels: readonly { model: Model<Api> }[];\n\tcurrentSessionModel: Model<Api> | undefined;\n\tsavedModelId: string | undefined;\n\t/** Reports the confirmed choice; undefined means the picker was dismissed. */\n\tonDone: (choice: ProfileModelChoice | undefined) => void;\n}\n\ninterface ModelChoiceItem extends ProfileModelChoice {\n\tkey: string;\n\tprovider: string;\n\tid: string;\n\tname: string | undefined;\n}\n\nfunction modelSearchText(item: ModelChoiceItem): string {\n\tif (item.modelId === undefined) {\n\t\tconst inherited = item.model ? ` ${modelId(item.model)} ${item.model.name}` : \"\";\n\t\treturn `inherit${inherited}`;\n\t}\n\tconst name = item.name ? ` ${item.name}` : \"\";\n\treturn `${item.provider} ${item.provider}/${item.id} ${item.provider} ${item.id}${name}`;\n}\n\n/** Searchable /model-style model picker used by /agents; confirm reports the selected choice. */\nexport class ProfileModelListComponent extends Container implements Focusable {\n\tprivate readonly theme: Theme;\n\tprivate readonly keybindings: KeybindingsManager;\n\tprivate readonly currentSessionModel: Model<Api> | undefined;\n\tprivate readonly savedModelId: string | undefined;\n\tprivate readonly scopedModelKeys: Set<string>;\n\tprivate readonly onDone: (choice: ProfileModelChoice | undefined) => void;\n\tprivate readonly searchInput: Input;\n\tprivate readonly scopeContainer: Container;\n\tprivate readonly listContainer: Container;\n\tprivate models: Model<Api>[];\n\tprivate allChoices: ModelChoiceItem[] = [];\n\tprivate scopedChoices: ModelChoiceItem[] = [];\n\tprivate activeChoices: ModelChoiceItem[] = [];\n\tprivate filteredChoices: ModelChoiceItem[] = [];\n\tprivate selectedIndex = 0;\n\tprivate scope: ModelScope;\n\tprivate statusMessage: string | undefined;\n\tprivate statusTone: StatusTone = \"muted\";\n\tprivate _focused = false;\n\n\tget focused(): boolean {\n\t\treturn this._focused;\n\t}\n\n\tset focused(value: boolean) {\n\t\tthis._focused = value;\n\t\tthis.searchInput.focused = value;\n\t}\n\n\tconstructor(options: ProfileModelListOptions) {\n\t\tsuper();\n\t\tthis.theme = options.theme;\n\t\tthis.keybindings = options.keybindings;\n\t\tthis.models = [...options.models];\n\t\tthis.currentSessionModel = options.currentSessionModel;\n\t\tthis.savedModelId = options.savedModelId;\n\t\tthis.scopedModelKeys = new Set(options.scopedModels.map(({ model }) => modelId(model)));\n\t\tthis.scope = this.scopedModelKeys.size > 0 ? \"scoped\" : \"all\";\n\t\tthis.onDone = options.onDone;\n\n\t\tthis.scopeContainer = new Container();\n\t\tthis.addChild(this.scopeContainer);\n\t\tthis.searchInput = new Input();\n\t\tthis.addChild(this.searchInput);\n\t\tthis.addChild(new Spacer(1));\n\t\tthis.listContainer = new Container();\n\t\tthis.addChild(this.listContainer);\n\n\t\tthis.rebuildChoices(this.savedModelId ?? \"\");\n\t}\n\n\tprivate makeInheritChoice(): ModelChoiceItem {\n\t\treturn {\n\t\t\tkey: \"\",\n\t\t\tmodelId: undefined,\n\t\t\tmodel: this.currentSessionModel,\n\t\t\tunavailable: false,\n\t\t\tprovider: this.currentSessionModel?.provider ?? \"\",\n\t\t\tid: \"inherit\",\n\t\t\tname: this.currentSessionModel?.name,\n\t\t};\n\t}\n\n\tprivate makeModelChoice(model: Model<Api>): ModelChoiceItem {\n\t\treturn {\n\t\t\tkey: modelId(model),\n\t\t\tmodelId: modelId(model),\n\t\t\tmodel,\n\t\t\tunavailable: false,\n\t\t\tprovider: model.provider,\n\t\t\tid: model.id,\n\t\t\tname: model.name,\n\t\t};\n\t}\n\n\tprivate makeUnavailableChoice(modelId: string): ModelChoiceItem {\n\t\tconst parsed = parseModelSpec(modelId);\n\t\treturn {\n\t\t\tkey: modelId,\n\t\t\tmodelId,\n\t\t\tmodel: undefined,\n\t\t\tunavailable: true,\n\t\t\tprovider: parsed.provider,\n\t\t\tid: parsed.id,\n\t\t\tname: undefined,\n\t\t};\n\t}\n\n\tprivate buildChoices(models: readonly Model<Api>[]): ModelChoiceItem[] {\n\t\tconst sorted = [...models].sort(compareModels);\n\t\tconst availableById = new Map(this.models.map((model) => [modelId(model), model]));\n\t\tconst choices: ModelChoiceItem[] = [this.makeInheritChoice()];\n\t\tif (this.savedModelId) {\n\t\t\tconst saved = availableById.get(this.savedModelId);\n\t\t\tchoices.push(saved ? this.makeModelChoice(saved) : this.makeUnavailableChoice(this.savedModelId));\n\t\t}\n\t\tfor (const model of sorted) {\n\t\t\tif (modelId(model) !== this.savedModelId) choices.push(this.makeModelChoice(model));\n\t\t}\n\t\treturn choices;\n\t}\n\n\tprivate rebuildChoices(preferredKey?: string): void {\n\t\tconst currentKey = preferredKey ?? this.filteredChoices[this.selectedIndex]?.key ?? this.savedModelId ?? \"\";\n\t\tthis.allChoices = this.buildChoices(this.models);\n\t\tconst scopedModels = this.models.filter((model) => this.scopedModelKeys.has(modelId(model)));\n\t\tthis.scopedChoices = this.buildChoices(scopedModels);\n\t\tthis.activeChoices = this.scope === \"scoped\" ? this.scopedChoices : this.allChoices;\n\t\tthis.applyFilter(this.searchInput.getValue(), currentKey, false);\n\t\tthis.updateScopeView();\n\t}\n\n\tprivate applyFilter(query: string, preferredKey?: string, resetSelection = true): void {\n\t\tthis.filteredChoices = query ? fuzzyFilter(this.activeChoices, query, modelSearchText) : this.activeChoices;\n\t\tif (preferredKey !== undefined) {\n\t\t\tconst preferredIndex = this.filteredChoices.findIndex((choice) => choice.key === preferredKey);\n\t\t\tthis.selectedIndex = preferredIndex >= 0 ? preferredIndex : 0;\n\t\t} else if (query && resetSelection) {\n\t\t\tthis.selectedIndex = 0;\n\t\t} else {\n\t\t\tthis.selectedIndex = Math.min(this.selectedIndex, Math.max(0, this.filteredChoices.length - 1));\n\t\t}\n\t\tthis.updateList();\n\t}\n\n\tprivate updateScopeView(): void {\n\t\tthis.scopeContainer.clear();\n\t\tif (this.scopedModelKeys.size === 0) {\n\t\t\tthis.scopeContainer.addChild(\n\t\t\t\tnew Text(\n\t\t\t\t\tthis.theme.fg(\"warning\", \"Only showing models from configured providers. Use /login to add providers.\"),\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t\tthis.scopeContainer.addChild(new Spacer(1));\n\t\t\treturn;\n\t\t}\n\t\tconst all = this.scope === \"all\" ? this.theme.fg(\"accent\", \"all\") : this.theme.fg(\"muted\", \"all\");\n\t\tconst scoped = this.scope === \"scoped\" ? this.theme.fg(\"accent\", \"scoped\") : this.theme.fg(\"muted\", \"scoped\");\n\t\tthis.scopeContainer.addChild(\n\t\t\tnew Text(`${this.theme.fg(\"muted\", \"Scope: \")}${all}${this.theme.fg(\"muted\", \" | \")}${scoped}`, 0, 0),\n\t\t);\n\t\tthis.scopeContainer.addChild(new Spacer(1));\n\t}\n\n\tprivate choiceLabel(choice: ModelChoiceItem): string {\n\t\tif (choice.modelId === undefined) {\n\t\t\tconst inherited = choice.model ? modelId(choice.model) : \"none\";\n\t\t\treturn `inherit ${this.theme.fg(\"muted\", `(${inherited})`)}`;\n\t\t}\n\t\tif (choice.unavailable) {\n\t\t\tconst badge = choice.provider ? `${choice.provider} · unavailable` : \"unavailable\";\n\t\t\treturn `${choice.id} ${this.theme.fg(\"warning\", `[${badge}]`)}`;\n\t\t}\n\t\treturn `${choice.id} ${this.theme.fg(\"muted\", `[${choice.provider}]`)}`;\n\t}\n\n\tprivate updateList(): void {\n\t\tthis.listContainer.clear();\n\t\tconst startIndex = Math.max(\n\t\t\t0,\n\t\t\tMath.min(\n\t\t\t\tthis.selectedIndex - Math.floor(MAX_VISIBLE_MODELS / 2),\n\t\t\t\tthis.filteredChoices.length - MAX_VISIBLE_MODELS,\n\t\t\t),\n\t\t);\n\t\tconst endIndex = Math.min(startIndex + MAX_VISIBLE_MODELS, this.filteredChoices.length);\n\t\tfor (let index = startIndex; index < endIndex; index++) {\n\t\t\tconst choice = this.filteredChoices[index];\n\t\t\tif (!choice) continue;\n\t\t\tconst selected = index === this.selectedIndex;\n\t\t\tconst saved = choice.modelId === this.savedModelId;\n\t\t\tconst prefix = selected ? this.theme.fg(\"accent\", \"→ \") : \" \";\n\t\t\tconst label = this.choiceLabel(choice);\n\t\t\tconst styledLabel = selected ? this.theme.fg(\"accent\", label) : label;\n\t\t\tconst checkmark = saved ? this.theme.fg(\"success\", \" ✓\") : \"\";\n\t\t\tthis.listContainer.addChild(new TruncatedText(`${prefix}${styledLabel}${checkmark}`, 0, 0));\n\t\t}\n\n\t\tif (startIndex > 0 || endIndex < this.filteredChoices.length) {\n\t\t\tthis.listContainer.addChild(\n\t\t\t\tnew TruncatedText(\n\t\t\t\t\tthis.theme.fg(\"muted\", ` (${this.selectedIndex + 1}/${this.filteredChoices.length})`),\n\t\t\t\t\t0,\n\t\t\t\t\t0,\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\t\tif (this.filteredChoices.length === 0) {\n\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(\"muted\", \" No matching models\"), 0, 0));\n\t\t} else {\n\t\t\tconst selected = this.filteredChoices[this.selectedIndex];\n\t\t\tif (selected?.model?.name) {\n\t\t\t\tthis.listContainer.addChild(new Spacer(1));\n\t\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(\"muted\", ` Model Name: ${selected.model.name}`), 0, 0));\n\t\t\t}\n\t\t}\n\t\tif (this.statusMessage) {\n\t\t\tthis.listContainer.addChild(new Spacer(1));\n\t\t\tthis.listContainer.addChild(new Text(this.theme.fg(this.statusTone, ` ${this.statusMessage}`), 0, 0));\n\t\t}\n\t}\n\n\tprivate moveSelection(offset: -1 | 1): void {\n\t\tif (this.filteredChoices.length === 0) return;\n\t\tthis.selectedIndex = (this.selectedIndex + offset + this.filteredChoices.length) % this.filteredChoices.length;\n\t\tthis.updateList();\n\t}\n\n\tprivate toggleScope(): void {\n\t\tif (this.scopedModelKeys.size === 0) return;\n\t\tconst currentKey = this.filteredChoices[this.selectedIndex]?.key;\n\t\tthis.scope = this.scope === \"all\" ? \"scoped\" : \"all\";\n\t\tthis.activeChoices = this.scope === \"scoped\" ? this.scopedChoices : this.allChoices;\n\t\tthis.applyFilter(this.searchInput.getValue(), currentKey, false);\n\t\tthis.updateScopeView();\n\t}\n\n\tgetSelectedChoice(): ProfileModelChoice | undefined {\n\t\tconst selected = this.filteredChoices[this.selectedIndex];\n\t\tif (!selected) return undefined;\n\t\treturn { modelId: selected.modelId, model: selected.model, unavailable: selected.unavailable };\n\t}\n\n\tupdateModels(models: readonly Model<Api>[]): void {\n\t\tconst selectedKey = this.filteredChoices[this.selectedIndex]?.key;\n\t\tthis.models = [...models];\n\t\tthis.rebuildChoices(selectedKey);\n\t}\n\n\tsetStatus(message: string | undefined, tone: StatusTone = \"muted\"): void {\n\t\tthis.statusMessage = message;\n\t\tthis.statusTone = tone;\n\t\tthis.updateList();\n\t}\n\n\toverride invalidate(): void {\n\t\tthis.updateScopeView();\n\t\tthis.updateList();\n\t\tsuper.invalidate();\n\t}\n\n\thandleInput(data: string): void {\n\t\tif (this.keybindings.matches(data, \"tui.input.tab\")) {\n\t\t\tthis.toggleScope();\n\t\t} else if (this.keybindings.matches(data, \"tui.select.up\")) {\n\t\t\tthis.moveSelection(-1);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.down\")) {\n\t\t\tthis.moveSelection(1);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.confirm\")) {\n\t\t\tconst selected = this.getSelectedChoice();\n\t\t\tif (selected) this.onDone(selected);\n\t\t} else if (this.keybindings.matches(data, \"tui.select.cancel\")) {\n\t\t\tthis.onDone(undefined);\n\t\t} else {\n\t\t\tthis.searchInput.handleInput(data);\n\t\t\tthis.applyFilter(this.searchInput.getValue());\n\t\t}\n\t}\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ export { AgentSession, type AgentSessionConfig, type AgentSessionEvent, type Age
|
|
|
4
4
|
export { readStoredCredential } from "./core/auth-storage.ts";
|
|
5
5
|
export { type BranchPreparation, type BranchSummaryResult, type CollectEntriesResult, type CompactionResult, type CutPointResult, calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, type FileOperations, findCutPoint, findTurnStartIndex, type GenerateBranchSummaryOptions, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.ts";
|
|
6
6
|
export { createEventBus, type EventBus, type EventBusController } from "./core/event-bus.ts";
|
|
7
|
-
export type { AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextUsage, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownTransformContext, MarkdownTransformer, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, ShellSettings, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
8
|
-
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
7
|
+
export type { AgentEndEvent, AgentSettledEvent, AgentStartEvent, AgentToolResult, AgentToolUpdateCallback, AppKeybinding, AutocompleteProviderFactory, BashToolCallEvent, BeforeAgentStartEvent, BeforeAgentStartEventResult, BeforeProviderHeadersEvent, BeforeProviderRequestEvent, BeforeProviderRequestEventResult, BuildSystemPromptOptions, CompactOptions, ContextEvent, ContextUsage, CustomToolCallEvent, EditToolCallEvent, EntryRenderer, EntryRenderOptions, ExecOptions, ExecResult, Extension, ExtensionActions, ExtensionAPI, ExtensionCommandContext, ExtensionCommandContextActions, ExtensionContext, ExtensionContextActions, ExtensionError, ExtensionEvent, ExtensionFactory, ExtensionFlag, ExtensionHandler, ExtensionRuntime, ExtensionShortcut, ExtensionUIContext, ExtensionUIDialogOptions, ExtensionWidgetOptions, FindToolCallEvent, GrepToolCallEvent, InlineExtension, InputEvent, InputEventResult, InputSource, KeybindingsManager, LoadExtensionsResult, LsToolCallEvent, MarkdownTransformContext, MarkdownTransformer, MessageEndEvent, MessageRenderer, MessageRenderOptions, MessageStartEvent, MessageUpdateEvent, PowerShellToolCallEvent, ProjectTrustContext, ProjectTrustEvent, ProjectTrustEventDecision, ProjectTrustEventResult, ProjectTrustHandler, ProviderConfig, ProviderModelConfig, ReadToolCallEvent, RegisteredCommand, RegisteredTool, ResolvedCommand, SessionBeforeCompactEvent, SessionBeforeForkEvent, SessionBeforeSwitchEvent, SessionBeforeTreeEvent, SessionCompactEvent, SessionInfoChangedEvent, SessionShutdownEvent, SessionStartEvent, SessionTreeEvent, ShellSettings, SlashCommandInfo, SlashCommandSource, SourceInfo, TerminalInputHandler, ToolCallEvent, ToolCallEventResult, ToolDefinition, ToolExecutionEndEvent, ToolExecutionMode, ToolExecutionStartEvent, ToolExecutionUpdateEvent, ToolInfo, ToolRenderResultOptions, ToolResultEvent, TurnEndEvent, TurnStartEvent, UserBashEvent, UserBashEventResult, WidgetPlacement, WorkingIndicatorOptions, WriteToolCallEvent, } from "./core/extensions/index.ts";
|
|
8
|
+
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.ts";
|
|
9
9
|
export type { ReadonlyFooterDataProvider } from "./core/footer-data-provider.ts";
|
|
10
10
|
export { convertToLlm } from "./core/messages.ts";
|
|
11
11
|
export { ModelRegistry } from "./core/model-registry.ts";
|
|
@@ -15,13 +15,13 @@ export type { PackageManager, PathMetadata, ProgressCallback, ProgressEvent, Res
|
|
|
15
15
|
export { DefaultPackageManager } from "./core/package-manager.ts";
|
|
16
16
|
export type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from "./core/resource-loader.ts";
|
|
17
17
|
export { DefaultResourceLoader, loadProjectContextFiles } from "./core/resource-loader.ts";
|
|
18
|
-
export { AgentSessionRuntime, type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionOptions, type CreateAgentSessionResult, type CreateAgentSessionRuntimeFactory, type CreateAgentSessionRuntimeResult, type CreateAgentSessionServicesOptions, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, type PromptTemplate, } from "./core/sdk.ts";
|
|
18
|
+
export { AgentSessionRuntime, type AgentSessionRuntimeDiagnostic, type AgentSessionServices, type CreateAgentSessionFromServicesOptions, type CreateAgentSessionOptions, type CreateAgentSessionResult, type CreateAgentSessionRuntimeFactory, type CreateAgentSessionRuntimeResult, type CreateAgentSessionServicesOptions, createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool, createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createPowerShellTool, createReadOnlyTools, createReadTool, createWriteTool, type PromptTemplate, } from "./core/sdk.ts";
|
|
19
19
|
export { type BranchSummaryEntry, buildContextEntries, buildSessionContext, type CompactionEntry, CURRENT_SESSION_VERSION, type CustomEntry, type CustomMessageEntry, type FileEntry, getLatestCompactionEntry, type ModelChangeEntry, migrateSessionEntries, type NewSessionOptions, parseSessionEntries, type SessionContext, type SessionEntry, type SessionEntryBase, type SessionHeader, type SessionInfo, type SessionInfoEntry, SessionManager, type SessionMessageEntry, type SessionTreeNode, sessionEntryToContextMessages, type ThinkingLevelChangeEntry, } from "./core/session-manager.ts";
|
|
20
20
|
export { type CompactionSettings, type DefaultProjectTrust, type FullscreenExitOutput, type ImageSettings, type PackageSource, type RetrySettings, SettingsManager, type SettingsManagerCreateOptions, type TuiMode, } from "./core/settings-manager.ts";
|
|
21
21
|
export { formatSkillsForPrompt, type LoadSkillsFromDirOptions, type LoadSkillsResult, loadSkills, loadSkillsFromDir, type Skill, type SkillFrontmatter, } from "./core/skills.ts";
|
|
22
22
|
export { createSyntheticSourceInfo } from "./core/source-info.ts";
|
|
23
23
|
export { type EditDiffResult, generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.ts";
|
|
24
|
-
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
24
|
+
export { type BashOperations, type BashSpawnContext, type BashSpawnHook, type BashToolDetails, type BashToolInput, type BashToolOptions, createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, type EditOperations, type EditToolDetails, type EditToolInput, type EditToolOptions, type FindOperations, type FindToolDetails, type FindToolInput, type FindToolOptions, formatSize, type GrepOperations, type GrepToolDetails, type GrepToolInput, type GrepToolOptions, type LsOperations, type LsToolDetails, type LsToolInput, type LsToolOptions, type PowerShellOperations, type PowerShellSpawnContext, type PowerShellSpawnHook, type PowerShellToolDetails, type PowerShellToolInput, type PowerShellToolOptions, type ReadOperations, type ReadToolDetails, type ReadToolInput, type ReadToolOptions, type ToolsOptions, type TruncationOptions, type TruncationResult, truncateHead, truncateLine, truncateTail, type WriteOperations, type WriteToolInput, type WriteToolOptions, withFileMutationQueue, } from "./core/tools/index.ts";
|
|
25
25
|
export { hasTrustRequiringProjectResources, type ProjectTrustDecision, ProjectTrustStore, type ProjectTrustStoreEntry, type ProjectTrustUpdate, } from "./core/trust-manager.ts";
|
|
26
26
|
export { type MainOptions, main } from "./main.ts";
|
|
27
27
|
export { InteractiveMode, type InteractiveModeOptions, type JsonAgentSessionEvent, type ModelInfo, type PrintModeOptions, RpcClient, type RpcClientOptions, type RpcCommand, type RpcEventListener, type RpcExtensionUIRequest, type RpcExtensionUIResponse, type RpcResponse, type RpcSessionState, runPrintMode, runRpcMode, } from "./modes/index.ts";
|
|
@@ -31,5 +31,5 @@ export { copyToClipboard } from "./utils/clipboard.ts";
|
|
|
31
31
|
export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.ts";
|
|
32
32
|
export { convertToPng } from "./utils/image-convert.ts";
|
|
33
33
|
export { formatDimensionNote, type ResizedImage, resizeImage } from "./utils/image-resize.ts";
|
|
34
|
-
export { getShellConfig } from "./utils/shell.ts";
|
|
34
|
+
export { getPowerShellConfig, getShellConfig } from "./utils/shell.ts";
|
|
35
35
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,IAAI,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAGrD,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EACZ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AoC,CAAC;AAE5C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAE,KAAK,YAAY,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE9F,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ export { readStoredCredential } from "./core/auth-storage.js";
|
|
|
7
7
|
// Compaction
|
|
8
8
|
export { calculateContextTokens, collectEntriesForBranchSummary, compact, DEFAULT_COMPACTION_SETTINGS, estimateTokens, findCutPoint, findTurnStartIndex, generateBranchSummary, generateSummary, generateSummaryWithUsage, getLastAssistantUsage, prepareBranchEntries, serializeConversation, shouldCompact, } from "./core/compaction/index.js";
|
|
9
9
|
export { createEventBus } from "./core/event-bus.js";
|
|
10
|
-
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.js";
|
|
10
|
+
export { createExtensionRuntime, defineTool, discoverAndLoadExtensions, ExtensionRunner, isBashToolResult, isEditToolResult, isFindToolResult, isGrepToolResult, isLsToolResult, isPowerShellToolResult, isReadToolResult, isToolCallEventType, isWriteToolResult, wrapRegisteredTool, wrapRegisteredTools, } from "./core/extensions/index.js";
|
|
11
11
|
export { convertToLlm } from "./core/messages.js";
|
|
12
12
|
export { ModelRegistry } from "./core/model-registry.js";
|
|
13
13
|
export { resolveCliModel, resolveModelScopeWithDiagnostics, } from "./core/model-resolver.js";
|
|
@@ -19,7 +19,7 @@ export { AgentSessionRuntime,
|
|
|
19
19
|
// Factory
|
|
20
20
|
createAgentSession, createAgentSessionFromServices, createAgentSessionRuntime, createAgentSessionServices, createBashTool,
|
|
21
21
|
// Tool factories (for custom cwd)
|
|
22
|
-
createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createReadOnlyTools, createReadTool, createWriteTool, } from "./core/sdk.js";
|
|
22
|
+
createCodingTools, createEditTool, createFindTool, createGrepTool, createLsTool, createPowerShellTool, createReadOnlyTools, createReadTool, createWriteTool, } from "./core/sdk.js";
|
|
23
23
|
export { buildContextEntries, buildSessionContext, CURRENT_SESSION_VERSION, getLatestCompactionEntry, migrateSessionEntries, parseSessionEntries, SessionManager, sessionEntryToContextMessages, } from "./core/session-manager.js";
|
|
24
24
|
export { SettingsManager, } from "./core/settings-manager.js";
|
|
25
25
|
// Skills
|
|
@@ -27,7 +27,7 @@ export { formatSkillsForPrompt, loadSkills, loadSkillsFromDir, } from "./core/sk
|
|
|
27
27
|
export { createSyntheticSourceInfo } from "./core/source-info.js";
|
|
28
28
|
export { generateDiffString, generateUnifiedPatch } from "./core/tools/edit-diff.js";
|
|
29
29
|
// Tools
|
|
30
|
-
export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLsToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
30
|
+
export { createBashToolDefinition, createEditToolDefinition, createFindToolDefinition, createGrepToolDefinition, createLocalBashOperations, createLocalPowerShellOperations, createLsToolDefinition, createPowerShellToolDefinition, createReadToolDefinition, createWriteToolDefinition, DEFAULT_MAX_BYTES, DEFAULT_MAX_LINES, formatSize, truncateHead, truncateLine, truncateTail, withFileMutationQueue, } from "./core/tools/index.js";
|
|
31
31
|
export { hasTrustRequiringProjectResources, ProjectTrustStore, } from "./core/trust-manager.js";
|
|
32
32
|
// Main entry point
|
|
33
33
|
export { main } from "./main.js";
|
|
@@ -43,5 +43,5 @@ export { parseFrontmatter, stripFrontmatter } from "./utils/frontmatter.js";
|
|
|
43
43
|
export { convertToPng } from "./utils/image-convert.js";
|
|
44
44
|
export { formatDimensionNote, resizeImage } from "./utils/image-resize.js";
|
|
45
45
|
// Shell utilities
|
|
46
|
-
export { getShellConfig } from "./utils/shell.js";
|
|
46
|
+
export { getPowerShellConfig, getShellConfig } from "./utils/shell.js";
|
|
47
47
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAErD,eAAe;AACf,OAAO,EACN,eAAe,EACf,WAAW,EACX,WAAW,EACX,eAAe,EACf,aAAa,EACb,aAAa,EACb,OAAO,GACP,MAAM,aAAa,CAAC;AACrB,OAAO,EACN,YAAY,EAOZ,eAAe,GAEf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC9D,aAAa;AACb,OAAO,EAMN,sBAAsB,EACtB,8BAA8B,EAC9B,OAAO,EACP,2BAA2B,EAC3B,cAAc,EAEd,YAAY,EACZ,kBAAkB,EAElB,qBAAqB,EACrB,eAAe,EACf,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,aAAa,GACb,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,cAAc,EAA0C,MAAM,qBAAqB,CAAC;AAsG7F,OAAO,EACN,sBAAsB,EACtB,UAAU,EACV,yBAAyB,EACzB,eAAe,EACf,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,cAAc,EACd,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,GACnB,MAAM,4BAA4B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B,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tShellSettings,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLsToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getShellConfig } from \"./utils/shell.ts\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,0BAA0B;AAE1B,OAAO,EAAa,SAAS,EAAE,MAAM,eAAe,CAAC;AAEr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,sBAAsB,EACtB,aAAa,EACb,wBAAwB,EACxB,uBAAuB,EACvB,0BAA0B,EAC1B,eAAe,EACf,OAAO,EACP,OAAO,EACP,oBAAoB,EACpB,sBAAsB,EACtB,sBAAsB,EAEtB,UAAU,EACV,UAAU,EACV,wBAAwB,EAGxB,yBAAyB,EACzB,2BAA2B,EAC3B,+BAA+B,EAC/B,sBAAsB,EACtB,yBAAyB,EACzB,sBAAsB,EAEtB,qBAAqB,EACrB,qBAAqB,EACrB,oBAAoB,EACpB,4BAA4B,GAE5B,MAAM,yCAAyC,CAAC;AACjD,kDAAkD;AAClD,OAAO,EACN,mBAAmB,EACnB,gBAAgB,EAChB,kBAAkB,EAClB,oBAAoB,EACpB,aAAa,EACb,SAAS,EACT,KAAK,GAEL,MAAM,oCAAoC,CAAC;AAC5C,sBAAsB;AACtB,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC5E,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,mBAAmB,EAAqB,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC9F,kBAAkB;AAClB,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC","sourcesContent":["// Core session management\n\nexport { type Args, parseArgs } from \"./cli/args.ts\";\n\n// Config paths\nexport {\n\tCONFIG_DIR_NAME,\n\tgetAgentDir,\n\tgetDocsPath,\n\tgetExamplesPath,\n\tgetPackageDir,\n\tgetReadmePath,\n\tVERSION,\n} from \"./config.ts\";\nexport {\n\tAgentSession,\n\ttype AgentSessionConfig,\n\ttype AgentSessionEvent,\n\ttype AgentSessionEventListener,\n\ttype ModelCycleResult,\n\ttype ParsedSkillBlock,\n\ttype PromptOptions,\n\tparseSkillBlock,\n\ttype SessionStats,\n} from \"./core/agent-session.ts\";\nexport { readStoredCredential } from \"./core/auth-storage.ts\";\n// Compaction\nexport {\n\ttype BranchPreparation,\n\ttype BranchSummaryResult,\n\ttype CollectEntriesResult,\n\ttype CompactionResult,\n\ttype CutPointResult,\n\tcalculateContextTokens,\n\tcollectEntriesForBranchSummary,\n\tcompact,\n\tDEFAULT_COMPACTION_SETTINGS,\n\testimateTokens,\n\ttype FileOperations,\n\tfindCutPoint,\n\tfindTurnStartIndex,\n\ttype GenerateBranchSummaryOptions,\n\tgenerateBranchSummary,\n\tgenerateSummary,\n\tgenerateSummaryWithUsage,\n\tgetLastAssistantUsage,\n\tprepareBranchEntries,\n\tserializeConversation,\n\tshouldCompact,\n} from \"./core/compaction/index.ts\";\nexport { createEventBus, type EventBus, type EventBusController } from \"./core/event-bus.ts\";\n// Extension system\nexport type {\n\tAgentEndEvent,\n\tAgentSettledEvent,\n\tAgentStartEvent,\n\tAgentToolResult,\n\tAgentToolUpdateCallback,\n\tAppKeybinding,\n\tAutocompleteProviderFactory,\n\tBashToolCallEvent,\n\tBeforeAgentStartEvent,\n\tBeforeAgentStartEventResult,\n\tBeforeProviderHeadersEvent,\n\tBeforeProviderRequestEvent,\n\tBeforeProviderRequestEventResult,\n\tBuildSystemPromptOptions,\n\tCompactOptions,\n\tContextEvent,\n\tContextUsage,\n\tCustomToolCallEvent,\n\tEditToolCallEvent,\n\tEntryRenderer,\n\tEntryRenderOptions,\n\tExecOptions,\n\tExecResult,\n\tExtension,\n\tExtensionActions,\n\tExtensionAPI,\n\tExtensionCommandContext,\n\tExtensionCommandContextActions,\n\tExtensionContext,\n\tExtensionContextActions,\n\tExtensionError,\n\tExtensionEvent,\n\tExtensionFactory,\n\tExtensionFlag,\n\tExtensionHandler,\n\tExtensionRuntime,\n\tExtensionShortcut,\n\tExtensionUIContext,\n\tExtensionUIDialogOptions,\n\tExtensionWidgetOptions,\n\tFindToolCallEvent,\n\tGrepToolCallEvent,\n\tInlineExtension,\n\tInputEvent,\n\tInputEventResult,\n\tInputSource,\n\tKeybindingsManager,\n\tLoadExtensionsResult,\n\tLsToolCallEvent,\n\tMarkdownTransformContext,\n\tMarkdownTransformer,\n\tMessageEndEvent,\n\tMessageRenderer,\n\tMessageRenderOptions,\n\tMessageStartEvent,\n\tMessageUpdateEvent,\n\tPowerShellToolCallEvent,\n\tProjectTrustContext,\n\tProjectTrustEvent,\n\tProjectTrustEventDecision,\n\tProjectTrustEventResult,\n\tProjectTrustHandler,\n\tProviderConfig,\n\tProviderModelConfig,\n\tReadToolCallEvent,\n\tRegisteredCommand,\n\tRegisteredTool,\n\tResolvedCommand,\n\tSessionBeforeCompactEvent,\n\tSessionBeforeForkEvent,\n\tSessionBeforeSwitchEvent,\n\tSessionBeforeTreeEvent,\n\tSessionCompactEvent,\n\tSessionInfoChangedEvent,\n\tSessionShutdownEvent,\n\tSessionStartEvent,\n\tSessionTreeEvent,\n\tShellSettings,\n\tSlashCommandInfo,\n\tSlashCommandSource,\n\tSourceInfo,\n\tTerminalInputHandler,\n\tToolCallEvent,\n\tToolCallEventResult,\n\tToolDefinition,\n\tToolExecutionEndEvent,\n\tToolExecutionMode,\n\tToolExecutionStartEvent,\n\tToolExecutionUpdateEvent,\n\tToolInfo,\n\tToolRenderResultOptions,\n\tToolResultEvent,\n\tTurnEndEvent,\n\tTurnStartEvent,\n\tUserBashEvent,\n\tUserBashEventResult,\n\tWidgetPlacement,\n\tWorkingIndicatorOptions,\n\tWriteToolCallEvent,\n} from \"./core/extensions/index.ts\";\nexport {\n\tcreateExtensionRuntime,\n\tdefineTool,\n\tdiscoverAndLoadExtensions,\n\tExtensionRunner,\n\tisBashToolResult,\n\tisEditToolResult,\n\tisFindToolResult,\n\tisGrepToolResult,\n\tisLsToolResult,\n\tisPowerShellToolResult,\n\tisReadToolResult,\n\tisToolCallEventType,\n\tisWriteToolResult,\n\twrapRegisteredTool,\n\twrapRegisteredTools,\n} from \"./core/extensions/index.ts\";\n// Footer data provider (git branch + extension statuses - data not otherwise available to extensions)\nexport type { ReadonlyFooterDataProvider } from \"./core/footer-data-provider.ts\";\nexport { convertToLlm } from \"./core/messages.ts\";\nexport { ModelRegistry } from \"./core/model-registry.ts\";\nexport {\n\ttype ModelScopeDiagnostic,\n\ttype ResolveCliModelResult,\n\ttype ResolveModelScopeResult,\n\tresolveCliModel,\n\tresolveModelScopeWithDiagnostics,\n\ttype ScopedModel,\n} from \"./core/model-resolver.ts\";\nexport {\n\ttype CreateModelRuntimeOptions,\n\tCredentialSynchronizationError,\n\ttype CredentialSynchronizationOperation,\n\tModelRuntime,\n\ttype ModelRuntimeAuthOverrides,\n} from \"./core/model-runtime.ts\";\nexport type {\n\tPackageManager,\n\tPathMetadata,\n\tProgressCallback,\n\tProgressEvent,\n\tResolvedPaths,\n\tResolvedResource,\n} from \"./core/package-manager.ts\";\nexport { DefaultPackageManager } from \"./core/package-manager.ts\";\nexport type { ResourceCollision, ResourceDiagnostic, ResourceLoader } from \"./core/resource-loader.ts\";\nexport { DefaultResourceLoader, loadProjectContextFiles } from \"./core/resource-loader.ts\";\n// SDK for programmatic usage\nexport {\n\tAgentSessionRuntime,\n\ttype AgentSessionRuntimeDiagnostic,\n\ttype AgentSessionServices,\n\ttype CreateAgentSessionFromServicesOptions,\n\ttype CreateAgentSessionOptions,\n\ttype CreateAgentSessionResult,\n\ttype CreateAgentSessionRuntimeFactory,\n\ttype CreateAgentSessionRuntimeResult,\n\ttype CreateAgentSessionServicesOptions,\n\t// Factory\n\tcreateAgentSession,\n\tcreateAgentSessionFromServices,\n\tcreateAgentSessionRuntime,\n\tcreateAgentSessionServices,\n\tcreateBashTool,\n\t// Tool factories (for custom cwd)\n\tcreateCodingTools,\n\tcreateEditTool,\n\tcreateFindTool,\n\tcreateGrepTool,\n\tcreateLsTool,\n\tcreatePowerShellTool,\n\tcreateReadOnlyTools,\n\tcreateReadTool,\n\tcreateWriteTool,\n\ttype PromptTemplate,\n} from \"./core/sdk.ts\";\nexport {\n\ttype BranchSummaryEntry,\n\tbuildContextEntries,\n\tbuildSessionContext,\n\ttype CompactionEntry,\n\tCURRENT_SESSION_VERSION,\n\ttype CustomEntry,\n\ttype CustomMessageEntry,\n\ttype FileEntry,\n\tgetLatestCompactionEntry,\n\ttype ModelChangeEntry,\n\tmigrateSessionEntries,\n\ttype NewSessionOptions,\n\tparseSessionEntries,\n\ttype SessionContext,\n\ttype SessionEntry,\n\ttype SessionEntryBase,\n\ttype SessionHeader,\n\ttype SessionInfo,\n\ttype SessionInfoEntry,\n\tSessionManager,\n\ttype SessionMessageEntry,\n\ttype SessionTreeNode,\n\tsessionEntryToContextMessages,\n\ttype ThinkingLevelChangeEntry,\n} from \"./core/session-manager.ts\";\nexport {\n\ttype CompactionSettings,\n\ttype DefaultProjectTrust,\n\ttype FullscreenExitOutput,\n\ttype ImageSettings,\n\ttype PackageSource,\n\ttype RetrySettings,\n\tSettingsManager,\n\ttype SettingsManagerCreateOptions,\n\ttype TuiMode,\n} from \"./core/settings-manager.ts\";\n// Skills\nexport {\n\tformatSkillsForPrompt,\n\ttype LoadSkillsFromDirOptions,\n\ttype LoadSkillsResult,\n\tloadSkills,\n\tloadSkillsFromDir,\n\ttype Skill,\n\ttype SkillFrontmatter,\n} from \"./core/skills.ts\";\nexport { createSyntheticSourceInfo } from \"./core/source-info.ts\";\nexport { type EditDiffResult, generateDiffString, generateUnifiedPatch } from \"./core/tools/edit-diff.ts\";\n// Tools\nexport {\n\ttype BashOperations,\n\ttype BashSpawnContext,\n\ttype BashSpawnHook,\n\ttype BashToolDetails,\n\ttype BashToolInput,\n\ttype BashToolOptions,\n\tcreateBashToolDefinition,\n\tcreateEditToolDefinition,\n\tcreateFindToolDefinition,\n\tcreateGrepToolDefinition,\n\tcreateLocalBashOperations,\n\tcreateLocalPowerShellOperations,\n\tcreateLsToolDefinition,\n\tcreatePowerShellToolDefinition,\n\tcreateReadToolDefinition,\n\tcreateWriteToolDefinition,\n\tDEFAULT_MAX_BYTES,\n\tDEFAULT_MAX_LINES,\n\ttype EditOperations,\n\ttype EditToolDetails,\n\ttype EditToolInput,\n\ttype EditToolOptions,\n\ttype FindOperations,\n\ttype FindToolDetails,\n\ttype FindToolInput,\n\ttype FindToolOptions,\n\tformatSize,\n\ttype GrepOperations,\n\ttype GrepToolDetails,\n\ttype GrepToolInput,\n\ttype GrepToolOptions,\n\ttype LsOperations,\n\ttype LsToolDetails,\n\ttype LsToolInput,\n\ttype LsToolOptions,\n\ttype PowerShellOperations,\n\ttype PowerShellSpawnContext,\n\ttype PowerShellSpawnHook,\n\ttype PowerShellToolDetails,\n\ttype PowerShellToolInput,\n\ttype PowerShellToolOptions,\n\ttype ReadOperations,\n\ttype ReadToolDetails,\n\ttype ReadToolInput,\n\ttype ReadToolOptions,\n\ttype ToolsOptions,\n\ttype TruncationOptions,\n\ttype TruncationResult,\n\ttruncateHead,\n\ttruncateLine,\n\ttruncateTail,\n\ttype WriteOperations,\n\ttype WriteToolInput,\n\ttype WriteToolOptions,\n\twithFileMutationQueue,\n} from \"./core/tools/index.ts\";\nexport {\n\thasTrustRequiringProjectResources,\n\ttype ProjectTrustDecision,\n\tProjectTrustStore,\n\ttype ProjectTrustStoreEntry,\n\ttype ProjectTrustUpdate,\n} from \"./core/trust-manager.ts\";\n// Main entry point\nexport { type MainOptions, main } from \"./main.ts\";\n// Run modes for programmatic SDK usage\nexport {\n\tInteractiveMode,\n\ttype InteractiveModeOptions,\n\ttype JsonAgentSessionEvent,\n\ttype ModelInfo,\n\ttype PrintModeOptions,\n\tRpcClient,\n\ttype RpcClientOptions,\n\ttype RpcCommand,\n\ttype RpcEventListener,\n\ttype RpcExtensionUIRequest,\n\ttype RpcExtensionUIResponse,\n\ttype RpcResponse,\n\ttype RpcSessionState,\n\trunPrintMode,\n\trunRpcMode,\n} from \"./modes/index.ts\";\n// UI components for extensions\nexport {\n\tArminComponent,\n\tAssistantMessageComponent,\n\tBashExecutionComponent,\n\tBorderedLoader,\n\tBranchSummaryMessageComponent,\n\tCompactionSummaryMessageComponent,\n\tCustomEditor,\n\tCustomMessageComponent,\n\tDynamicBorder,\n\tExtensionEditorComponent,\n\tExtensionInputComponent,\n\tExtensionSelectorComponent,\n\tFooterComponent,\n\tkeyHint,\n\tkeyText,\n\tLoginDialogComponent,\n\tModelSelectorComponent,\n\tOAuthSelectorComponent,\n\ttype RenderDiffOptions,\n\trawKeyHint,\n\trenderDiff,\n\tSessionSelectorComponent,\n\ttype SettingsCallbacks,\n\ttype SettingsConfig,\n\tSettingsSelectorComponent,\n\tShowImagesSelectorComponent,\n\tSkillInvocationMessageComponent,\n\tThemeSelectorComponent,\n\tThinkingSelectorComponent,\n\tToolExecutionComponent,\n\ttype ToolExecutionOptions,\n\tTreeSelectorComponent,\n\ttruncateToVisualLines,\n\tUserMessageComponent,\n\tUserMessageSelectorComponent,\n\ttype VisualTruncateResult,\n} from \"./modes/interactive/components/index.ts\";\n// Theme utilities for custom tools and extensions\nexport {\n\tgetLanguageFromPath,\n\tgetMarkdownTheme,\n\tgetSelectListTheme,\n\tgetSettingsListTheme,\n\thighlightCode,\n\tinitTheme,\n\tTheme,\n\ttype ThemeColor,\n} from \"./modes/interactive/theme/theme.ts\";\n// Clipboard utilities\nexport { copyToClipboard } from \"./utils/clipboard.ts\";\nexport { parseFrontmatter, stripFrontmatter } from \"./utils/frontmatter.ts\";\nexport { convertToPng } from \"./utils/image-convert.ts\";\nexport { formatDimensionNote, type ResizedImage, resizeImage } from \"./utils/image-resize.ts\";\n// Shell utilities\nexport { getPowerShellConfig, getShellConfig } from \"./utils/shell.ts\";\n"]}
|
package/dist/main.d.ts
CHANGED
|
@@ -4,7 +4,11 @@
|
|
|
4
4
|
* This file handles CLI argument parsing and translates them into
|
|
5
5
|
* createAgentSession() options. The SDK does the heavy lifting.
|
|
6
6
|
*/
|
|
7
|
+
import { type Args } from "./cli/args.ts";
|
|
7
8
|
import type { InlineExtension } from "./core/extensions/types.ts";
|
|
9
|
+
import { SessionManager } from "./core/session-manager.ts";
|
|
10
|
+
import { SettingsManager } from "./core/settings-manager.ts";
|
|
11
|
+
export declare function createSessionManager(parsed: Args, cwd: string, sessionDir: string | undefined, settingsManager: SettingsManager): Promise<SessionManager>;
|
|
8
12
|
export interface MainOptions {
|
|
9
13
|
extensionFactories?: InlineExtension[];
|
|
10
14
|
}
|
package/dist/main.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../src/main.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAE,KAAK,IAAI,EAAyD,MAAM,eAAe,CAAC;AAkCjG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAalE,OAAO,EAAwB,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAEjF,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAmS7D,wBAAsB,oBAAoB,CACzC,MAAM,EAAE,IAAI,EACZ,GAAG,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,GAAG,SAAS,EAC9B,eAAe,EAAE,eAAe,GAC9B,OAAO,CAAC,cAAc,CAAC,CAsFzB;AAkHD,MAAM,WAAW,WAAW;IAC3B,kBAAkB,CAAC,EAAE,eAAe,EAAE,CAAC;CACvC;AAED,wBAAsB,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,WAAW,iBAga/D"}
|
package/dist/main.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { createInterface } from "node:readline";
|
|
8
8
|
import { modelsAreEqual } from "@earendil-works/pi-ai";
|
|
9
9
|
import chalk from "chalk";
|
|
10
|
-
import { parseArgs, printHelp } from "./cli/args.js";
|
|
10
|
+
import { normalizeSessionName, parseArgs, printHelp } from "./cli/args.js";
|
|
11
11
|
import { checkProviderAuth, createAuthCheckModelRuntime, getProviderCredential, } from "./cli/auth-check.js";
|
|
12
12
|
import { AuthCommandError, getAuthCommandName, getAuthCommandUsage, isAuthCommandHelp, parseAuthCommand, printAuthCommandHelp, validateAuthCommandArgs, } from "./cli/auth-command.js";
|
|
13
13
|
import { resolveCredentialForPrint } from "./cli/credential-print.js";
|
|
@@ -30,6 +30,7 @@ import { restoreStdout, takeOverStdout } from "./core/output-guard.js";
|
|
|
30
30
|
import { resolveProjectTrusted } from "./core/project-trust.js";
|
|
31
31
|
import { formatMissingSessionCwdPrompt, getMissingSessionCwdIssue, MissingSessionCwdError, } from "./core/session-cwd.js";
|
|
32
32
|
import { assertValidSessionId, SessionManager } from "./core/session-manager.js";
|
|
33
|
+
import { collectSettingsDiagnostics, deduplicateDiagnostics } from "./core/settings-diagnostics.js";
|
|
33
34
|
import { SettingsManager } from "./core/settings-manager.js";
|
|
34
35
|
import { printTimings, resetTimings, time } from "./core/timings.js";
|
|
35
36
|
import { hasTrustRequiringProjectResources, ProjectTrustStore } from "./core/trust-manager.js";
|
|
@@ -37,7 +38,7 @@ import { builtInExtensions } from "./extensions/index.js";
|
|
|
37
38
|
import { runMigrations, showDeprecationWarnings } from "./migrations.js";
|
|
38
39
|
import { InteractiveMode, runPrintMode, runRpcMode } from "./modes/index.js";
|
|
39
40
|
import { initTheme, stopThemeWatcher } from "./modes/interactive/theme/theme.js";
|
|
40
|
-
import { handleConfigCommand, handlePackageCommand } from "./package-manager-cli.js";
|
|
41
|
+
import { cleanupManagedInstall, handleConfigCommand, handlePackageCommand } from "./package-manager-cli.js";
|
|
41
42
|
import { isLocalPath, normalizePath, resolvePath } from "./utils/paths.js";
|
|
42
43
|
import { cleanupWindowsSelfUpdateQuarantine } from "./utils/windows-self-update.js";
|
|
43
44
|
const EXTENSION_LOAD_FAILURE_HINT = `Hint: Start without extensions using "${APP_NAME} -ne".`;
|
|
@@ -62,12 +63,6 @@ async function readPipedStdin() {
|
|
|
62
63
|
process.stdin.resume();
|
|
63
64
|
});
|
|
64
65
|
}
|
|
65
|
-
function collectSettingsDiagnostics(settingsManager, context) {
|
|
66
|
-
return settingsManager.drainErrors().map(({ scope, error }) => ({
|
|
67
|
-
type: "warning",
|
|
68
|
-
message: `(${context}, ${scope} settings) ${error.message}`,
|
|
69
|
-
}));
|
|
70
|
-
}
|
|
71
66
|
function reportDiagnostics(diagnostics) {
|
|
72
67
|
for (const diagnostic of diagnostics) {
|
|
73
68
|
const color = diagnostic.type === "error" ? chalk.red : diagnostic.type === "warning" ? chalk.yellow : chalk.dim;
|
|
@@ -279,7 +274,7 @@ function forkSessionOrExit(sourcePath, cwd, sessionDir, sessionId) {
|
|
|
279
274
|
process.exit(1);
|
|
280
275
|
}
|
|
281
276
|
}
|
|
282
|
-
async function createSessionManager(parsed, cwd, sessionDir, settingsManager) {
|
|
277
|
+
export async function createSessionManager(parsed, cwd, sessionDir, settingsManager) {
|
|
283
278
|
if (parsed.noSession || parsed.help || parsed.listModels !== undefined) {
|
|
284
279
|
return SessionManager.inMemory(cwd, parsed.sessionId !== undefined ? { id: parsed.sessionId } : undefined);
|
|
285
280
|
}
|
|
@@ -451,6 +446,7 @@ export async function main(args, options) {
|
|
|
451
446
|
if (process.platform === "win32") {
|
|
452
447
|
cleanupWindowsSelfUpdateQuarantine(getPackageDir());
|
|
453
448
|
}
|
|
449
|
+
cleanupManagedInstall();
|
|
454
450
|
const cwd = process.cwd();
|
|
455
451
|
const agentDir = getAgentDir();
|
|
456
452
|
const bootstrapSettingsManager = SettingsManager.create(cwd, agentDir, { projectTrusted: false });
|
|
@@ -515,7 +511,7 @@ export async function main(args, options) {
|
|
|
515
511
|
const { migratedAuthProviders: migratedProviders, deprecationWarnings } = runMigrations(cwd);
|
|
516
512
|
time("runMigrations");
|
|
517
513
|
const startupSettingsManager = SettingsManager.create(cwd, agentDir);
|
|
518
|
-
|
|
514
|
+
const startupSettingsDiagnostics = collectSettingsDiagnostics(startupSettingsManager);
|
|
519
515
|
// Experimental first-time setup: theme choice and analytics opt-in.
|
|
520
516
|
// Runs before any runtime services are created so the chosen settings apply everywhere.
|
|
521
517
|
if (appMode === "interactive" && !parsed.help && parsed.listModels === undefined && shouldRunFirstTimeSetup()) {
|
|
@@ -550,8 +546,8 @@ export async function main(args, options) {
|
|
|
550
546
|
}
|
|
551
547
|
}
|
|
552
548
|
if (parsed.name !== undefined) {
|
|
553
|
-
const name = parsed.name
|
|
554
|
-
if (
|
|
549
|
+
const name = normalizeSessionName(parsed.name);
|
|
550
|
+
if (name === undefined) {
|
|
555
551
|
console.error(chalk.red("Error: --name requires a non-empty value"));
|
|
556
552
|
process.exit(1);
|
|
557
553
|
}
|
|
@@ -629,7 +625,7 @@ export async function main(args, options) {
|
|
|
629
625
|
const diagnostics = [
|
|
630
626
|
...projectTrustDiagnostics,
|
|
631
627
|
...services.diagnostics,
|
|
632
|
-
...collectSettingsDiagnostics(settingsManager
|
|
628
|
+
...collectSettingsDiagnostics(settingsManager),
|
|
633
629
|
...resourceLoader.getExtensions().errors.map(({ path, error }) => ({
|
|
634
630
|
type: "error",
|
|
635
631
|
message: `Failed to load extension "${path}": ${error}`,
|
|
@@ -686,6 +682,7 @@ export async function main(args, options) {
|
|
|
686
682
|
applyHttpProxySettings(settingsManager.getGlobalSettings().httpProxy);
|
|
687
683
|
configureHttpDispatcher(settingsManager.getHttpIdleTimeoutMs());
|
|
688
684
|
if (parsed.help) {
|
|
685
|
+
reportDiagnostics(startupSettingsDiagnostics);
|
|
689
686
|
const extensionFlags = resourceLoader
|
|
690
687
|
.getExtensions()
|
|
691
688
|
.extensions.flatMap((extension) => Array.from(extension.flags.values()));
|
|
@@ -693,6 +690,7 @@ export async function main(args, options) {
|
|
|
693
690
|
process.exit(0);
|
|
694
691
|
}
|
|
695
692
|
if (parsed.listModels !== undefined) {
|
|
693
|
+
reportDiagnostics(startupSettingsDiagnostics);
|
|
696
694
|
const searchPattern = typeof parsed.listModels === "string" ? parsed.listModels : undefined;
|
|
697
695
|
await listModels(modelRuntime, searchPattern, AbortSignal.timeout(15_000));
|
|
698
696
|
process.exit(0);
|
|
@@ -715,8 +713,12 @@ export async function main(args, options) {
|
|
|
715
713
|
await showDeprecationWarnings(deprecationWarnings);
|
|
716
714
|
}
|
|
717
715
|
time("resolveModelScope");
|
|
718
|
-
|
|
719
|
-
|
|
716
|
+
const startupDiagnostics = deduplicateDiagnostics([...startupSettingsDiagnostics, ...runtime.diagnostics]);
|
|
717
|
+
const hasRuntimeErrors = runtime.diagnostics.some((diagnostic) => diagnostic.type === "error");
|
|
718
|
+
if (appMode !== "interactive" || hasRuntimeErrors) {
|
|
719
|
+
reportDiagnostics(startupDiagnostics);
|
|
720
|
+
}
|
|
721
|
+
if (hasRuntimeErrors) {
|
|
720
722
|
if (runtime.diagnostics.some((diagnostic) => diagnostic.message.includes("Failed to load extension"))) {
|
|
721
723
|
console.error(chalk.yellow(EXTENSION_LOAD_FAILURE_HINT));
|
|
722
724
|
}
|
|
@@ -748,6 +750,7 @@ export async function main(args, options) {
|
|
|
748
750
|
else if (appMode === "interactive") {
|
|
749
751
|
const interactiveMode = new InteractiveMode(runtime, {
|
|
750
752
|
migratedProviders,
|
|
753
|
+
startupDiagnostics,
|
|
751
754
|
modelFallbackMessage,
|
|
752
755
|
autoTrustOnReloadCwd,
|
|
753
756
|
initialMessage,
|