@caupulican/pi-adaptative 0.80.94 → 0.80.95
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +18 -0
- package/dist/core/models/fitness-store.d.ts +2 -0
- package/dist/core/models/fitness-store.d.ts.map +1 -1
- package/dist/core/models/fitness-store.js +10 -0
- package/dist/core/models/fitness-store.js.map +1 -1
- package/dist/core/models/local-registration.d.ts +18 -0
- package/dist/core/models/local-registration.d.ts.map +1 -0
- package/dist/core/models/local-registration.js +83 -0
- package/dist/core/models/local-registration.js.map +1 -0
- package/dist/core/models/local-runtime.d.ts +84 -0
- package/dist/core/models/local-runtime.d.ts.map +1 -0
- package/dist/core/models/local-runtime.js +219 -0
- package/dist/core/models/local-runtime.js.map +1 -0
- package/dist/core/models/model-ref.d.ts +19 -0
- package/dist/core/models/model-ref.d.ts.map +1 -0
- package/dist/core/models/model-ref.js +61 -0
- package/dist/core/models/model-ref.js.map +1 -0
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +4 -0
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +7 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +175 -0
- package/dist/modes/interactive/interactive-mode.js.map +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/sandbox/package-lock.json +2 -2
- package/examples/extensions/sandbox/package.json +1 -1
- package/examples/extensions/with-deps/package-lock.json +2 -2
- package/examples/extensions/with-deps/package.json +1 -1
- package/npm-shrinkwrap.json +12 -12
- package/package.json +4 -4
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model source normalizer (local-model-lifecycle-design.md, "one panel, three types"):
|
|
3
|
+
* everything a user can paste — an ollama tag, an hf.co GGUF ref, a full HuggingFace URL, a
|
|
4
|
+
* copied `ollama pull ...` install command, or an API `provider/model` name — normalizes to ONE
|
|
5
|
+
* typed source. Pure string work: pasted install commands are PARSED for their reference and
|
|
6
|
+
* NEVER executed as shell; unknown forms are rejected with the reason.
|
|
7
|
+
*/
|
|
8
|
+
export type ModelSource = {
|
|
9
|
+
type: "api";
|
|
10
|
+
ref: string;
|
|
11
|
+
} | {
|
|
12
|
+
type: "local";
|
|
13
|
+
pullRef: string;
|
|
14
|
+
} | {
|
|
15
|
+
type: "rejected";
|
|
16
|
+
reason: string;
|
|
17
|
+
};
|
|
18
|
+
export declare function normalizeModelSource(rawInput: string): ModelSource;
|
|
19
|
+
//# sourceMappingURL=model-ref.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-ref.d.ts","sourceRoot":"","sources":["../../../src/core/models/model-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,WAAW,GACpB;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,GAAG,EAAE,MAAM,CAAA;CAAE,GAC5B;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAClC;IAAE,IAAI,EAAE,UAAU,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAOxC,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,GAAG,WAAW,CAqDlE","sourcesContent":["/**\n * Model source normalizer (local-model-lifecycle-design.md, \"one panel, three types\"):\n * everything a user can paste — an ollama tag, an hf.co GGUF ref, a full HuggingFace URL, a\n * copied `ollama pull ...` install command, or an API `provider/model` name — normalizes to ONE\n * typed source. Pure string work: pasted install commands are PARSED for their reference and\n * NEVER executed as shell; unknown forms are rejected with the reason.\n */\n\nexport type ModelSource =\n\t| { type: \"api\"; ref: string }\n\t| { type: \"local\"; pullRef: string }\n\t| { type: \"rejected\"; reason: string };\n\nconst OLLAMA_TAG = /^[a-z0-9][a-z0-9._-]*(?::[A-Za-z0-9._-]+)?$/;\nconst HF_REF = /^hf\\.co\\/([\\w.-]+)\\/([\\w.-]+)(?::([\\w.-]+))?$/i;\nconst HF_URL = /^https?:\\/\\/(?:www\\.)?huggingface\\.co\\/([\\w.-]+)\\/([\\w.-]+)(?:\\/.*)?$/i;\nconst SHELL_METACHARS = /[;&|`$<>(){}\\\\]/;\n\nexport function normalizeModelSource(rawInput: string): ModelSource {\n\tconst input = rawInput.trim();\n\tif (input.length === 0) return { type: \"rejected\", reason: \"empty input\" };\n\tif (input.length > 500) return { type: \"rejected\", reason: \"input too long to be a model reference\" };\n\n\t// Pasted install command: extract the reference, never execute anything.\n\tconst installCommand = /^ollama\\s+(?:pull|run)\\s+(.+)$/i.exec(input);\n\tif (installCommand) {\n\t\tconst argument = installCommand[1]!.trim().split(/\\s+/)[0] ?? \"\";\n\t\tif (SHELL_METACHARS.test(argument)) {\n\t\t\treturn { type: \"rejected\", reason: \"install command argument contains shell metacharacters\" };\n\t\t}\n\t\tconst inner = normalizeModelSource(argument);\n\t\tif (inner.type === \"local\") return inner;\n\t\treturn { type: \"rejected\", reason: `could not extract a model reference from the install command` };\n\t}\n\n\tif (SHELL_METACHARS.test(input) || /\\s/.test(input)) {\n\t\treturn { type: \"rejected\", reason: \"not a recognized model reference (contains spaces or shell characters)\" };\n\t}\n\n\t// Full HuggingFace URL -> hf.co pull ref (org/repo; a :quant suffix must be given explicitly).\n\tconst hfUrl = HF_URL.exec(input);\n\tif (hfUrl) {\n\t\treturn { type: \"local\", pullRef: `hf.co/${hfUrl[1]}/${hfUrl[2]}` };\n\t}\n\n\t// hf.co/org/repo[:quant]\n\tconst hfRef = HF_REF.exec(input);\n\tif (hfRef) {\n\t\treturn { type: \"local\", pullRef: `hf.co/${hfRef[1]}/${hfRef[2]}${hfRef[3] ? `:${hfRef[3]}` : \"\"}` };\n\t}\n\n\tif (input.includes(\"://\")) {\n\t\treturn { type: \"rejected\", reason: \"only huggingface.co URLs are recognized as local model links\" };\n\t}\n\n\t// provider/model -> API-registered model (nothing to install; auth + selection only).\n\tif (input.includes(\"/\")) {\n\t\tconst [provider, ...rest] = input.split(\"/\");\n\t\tconst model = rest.join(\"/\");\n\t\tif (provider && model && !model.includes(\"/\")) {\n\t\t\treturn { type: \"api\", ref: `${provider}/${model}` };\n\t\t}\n\t\treturn { type: \"rejected\", reason: \"expected provider/model or hf.co/org/repo[:quant]\" };\n\t}\n\n\t// Bare ollama tag (\"qwen3:1.7b\", \"pi-lifter:latest\", \"llama3\").\n\tif (OLLAMA_TAG.test(input)) {\n\t\treturn { type: \"local\", pullRef: input };\n\t}\n\n\treturn { type: \"rejected\", reason: \"not a recognized model reference\" };\n}\n"]}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Model source normalizer (local-model-lifecycle-design.md, "one panel, three types"):
|
|
3
|
+
* everything a user can paste — an ollama tag, an hf.co GGUF ref, a full HuggingFace URL, a
|
|
4
|
+
* copied `ollama pull ...` install command, or an API `provider/model` name — normalizes to ONE
|
|
5
|
+
* typed source. Pure string work: pasted install commands are PARSED for their reference and
|
|
6
|
+
* NEVER executed as shell; unknown forms are rejected with the reason.
|
|
7
|
+
*/
|
|
8
|
+
const OLLAMA_TAG = /^[a-z0-9][a-z0-9._-]*(?::[A-Za-z0-9._-]+)?$/;
|
|
9
|
+
const HF_REF = /^hf\.co\/([\w.-]+)\/([\w.-]+)(?::([\w.-]+))?$/i;
|
|
10
|
+
const HF_URL = /^https?:\/\/(?:www\.)?huggingface\.co\/([\w.-]+)\/([\w.-]+)(?:\/.*)?$/i;
|
|
11
|
+
const SHELL_METACHARS = /[;&|`$<>(){}\\]/;
|
|
12
|
+
export function normalizeModelSource(rawInput) {
|
|
13
|
+
const input = rawInput.trim();
|
|
14
|
+
if (input.length === 0)
|
|
15
|
+
return { type: "rejected", reason: "empty input" };
|
|
16
|
+
if (input.length > 500)
|
|
17
|
+
return { type: "rejected", reason: "input too long to be a model reference" };
|
|
18
|
+
// Pasted install command: extract the reference, never execute anything.
|
|
19
|
+
const installCommand = /^ollama\s+(?:pull|run)\s+(.+)$/i.exec(input);
|
|
20
|
+
if (installCommand) {
|
|
21
|
+
const argument = installCommand[1].trim().split(/\s+/)[0] ?? "";
|
|
22
|
+
if (SHELL_METACHARS.test(argument)) {
|
|
23
|
+
return { type: "rejected", reason: "install command argument contains shell metacharacters" };
|
|
24
|
+
}
|
|
25
|
+
const inner = normalizeModelSource(argument);
|
|
26
|
+
if (inner.type === "local")
|
|
27
|
+
return inner;
|
|
28
|
+
return { type: "rejected", reason: `could not extract a model reference from the install command` };
|
|
29
|
+
}
|
|
30
|
+
if (SHELL_METACHARS.test(input) || /\s/.test(input)) {
|
|
31
|
+
return { type: "rejected", reason: "not a recognized model reference (contains spaces or shell characters)" };
|
|
32
|
+
}
|
|
33
|
+
// Full HuggingFace URL -> hf.co pull ref (org/repo; a :quant suffix must be given explicitly).
|
|
34
|
+
const hfUrl = HF_URL.exec(input);
|
|
35
|
+
if (hfUrl) {
|
|
36
|
+
return { type: "local", pullRef: `hf.co/${hfUrl[1]}/${hfUrl[2]}` };
|
|
37
|
+
}
|
|
38
|
+
// hf.co/org/repo[:quant]
|
|
39
|
+
const hfRef = HF_REF.exec(input);
|
|
40
|
+
if (hfRef) {
|
|
41
|
+
return { type: "local", pullRef: `hf.co/${hfRef[1]}/${hfRef[2]}${hfRef[3] ? `:${hfRef[3]}` : ""}` };
|
|
42
|
+
}
|
|
43
|
+
if (input.includes("://")) {
|
|
44
|
+
return { type: "rejected", reason: "only huggingface.co URLs are recognized as local model links" };
|
|
45
|
+
}
|
|
46
|
+
// provider/model -> API-registered model (nothing to install; auth + selection only).
|
|
47
|
+
if (input.includes("/")) {
|
|
48
|
+
const [provider, ...rest] = input.split("/");
|
|
49
|
+
const model = rest.join("/");
|
|
50
|
+
if (provider && model && !model.includes("/")) {
|
|
51
|
+
return { type: "api", ref: `${provider}/${model}` };
|
|
52
|
+
}
|
|
53
|
+
return { type: "rejected", reason: "expected provider/model or hf.co/org/repo[:quant]" };
|
|
54
|
+
}
|
|
55
|
+
// Bare ollama tag ("qwen3:1.7b", "pi-lifter:latest", "llama3").
|
|
56
|
+
if (OLLAMA_TAG.test(input)) {
|
|
57
|
+
return { type: "local", pullRef: input };
|
|
58
|
+
}
|
|
59
|
+
return { type: "rejected", reason: "not a recognized model reference" };
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=model-ref.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"model-ref.js","sourceRoot":"","sources":["../../../src/core/models/model-ref.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAOH,MAAM,UAAU,GAAG,6CAA6C,CAAC;AACjE,MAAM,MAAM,GAAG,gDAAgD,CAAC;AAChE,MAAM,MAAM,GAAG,wEAAwE,CAAC;AACxF,MAAM,eAAe,GAAG,iBAAiB,CAAC;AAE1C,MAAM,UAAU,oBAAoB,CAAC,QAAgB,EAAe;IACnE,MAAM,KAAK,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC;IAC9B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,aAAa,EAAE,CAAC;IAC3E,IAAI,KAAK,CAAC,MAAM,GAAG,GAAG;QAAE,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,wCAAwC,EAAE,CAAC;IAEtG,yEAAyE;IACzE,MAAM,cAAc,GAAG,iCAAiC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACrE,IAAI,cAAc,EAAE,CAAC;QACpB,MAAM,QAAQ,GAAG,cAAc,CAAC,CAAC,CAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC;QACjE,IAAI,eAAe,CAAC,IAAI,CAAC,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AAM,EAAE,8DAA8D,EAAE,CAAC;IACrG,CAAC;IAED,sFAAsF;IACtF,IAAI,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QACzB,MAAM,CAAC,QAAQ,EAAE,GAAG,IAAI,CAAC,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC7C,MAAM,KAAK,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,QAAQ,IAAI,KAAK,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;YAC/C,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,QAAQ,IAAI,KAAK,EAAE,EAAE,CAAC;QACrD,CAAC;QACD,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,mDAAmD,EAAE,CAAC;IAC1F,CAAC;IAED,gEAAgE;IAChE,IAAI,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QAC5B,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IAC1C,CAAC;IAED,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,kCAAkC,EAAE,CAAC;AAAA,CACxE","sourcesContent":["/**\n * Model source normalizer (local-model-lifecycle-design.md, \"one panel, three types\"):\n * everything a user can paste — an ollama tag, an hf.co GGUF ref, a full HuggingFace URL, a\n * copied `ollama pull ...` install command, or an API `provider/model` name — normalizes to ONE\n * typed source. Pure string work: pasted install commands are PARSED for their reference and\n * NEVER executed as shell; unknown forms are rejected with the reason.\n */\n\nexport type ModelSource =\n\t| { type: \"api\"; ref: string }\n\t| { type: \"local\"; pullRef: string }\n\t| { type: \"rejected\"; reason: string };\n\nconst OLLAMA_TAG = /^[a-z0-9][a-z0-9._-]*(?::[A-Za-z0-9._-]+)?$/;\nconst HF_REF = /^hf\\.co\\/([\\w.-]+)\\/([\\w.-]+)(?::([\\w.-]+))?$/i;\nconst HF_URL = /^https?:\\/\\/(?:www\\.)?huggingface\\.co\\/([\\w.-]+)\\/([\\w.-]+)(?:\\/.*)?$/i;\nconst SHELL_METACHARS = /[;&|`$<>(){}\\\\]/;\n\nexport function normalizeModelSource(rawInput: string): ModelSource {\n\tconst input = rawInput.trim();\n\tif (input.length === 0) return { type: \"rejected\", reason: \"empty input\" };\n\tif (input.length > 500) return { type: \"rejected\", reason: \"input too long to be a model reference\" };\n\n\t// Pasted install command: extract the reference, never execute anything.\n\tconst installCommand = /^ollama\\s+(?:pull|run)\\s+(.+)$/i.exec(input);\n\tif (installCommand) {\n\t\tconst argument = installCommand[1]!.trim().split(/\\s+/)[0] ?? \"\";\n\t\tif (SHELL_METACHARS.test(argument)) {\n\t\t\treturn { type: \"rejected\", reason: \"install command argument contains shell metacharacters\" };\n\t\t}\n\t\tconst inner = normalizeModelSource(argument);\n\t\tif (inner.type === \"local\") return inner;\n\t\treturn { type: \"rejected\", reason: `could not extract a model reference from the install command` };\n\t}\n\n\tif (SHELL_METACHARS.test(input) || /\\s/.test(input)) {\n\t\treturn { type: \"rejected\", reason: \"not a recognized model reference (contains spaces or shell characters)\" };\n\t}\n\n\t// Full HuggingFace URL -> hf.co pull ref (org/repo; a :quant suffix must be given explicitly).\n\tconst hfUrl = HF_URL.exec(input);\n\tif (hfUrl) {\n\t\treturn { type: \"local\", pullRef: `hf.co/${hfUrl[1]}/${hfUrl[2]}` };\n\t}\n\n\t// hf.co/org/repo[:quant]\n\tconst hfRef = HF_REF.exec(input);\n\tif (hfRef) {\n\t\treturn { type: \"local\", pullRef: `hf.co/${hfRef[1]}/${hfRef[2]}${hfRef[3] ? `:${hfRef[3]}` : \"\"}` };\n\t}\n\n\tif (input.includes(\"://\")) {\n\t\treturn { type: \"rejected\", reason: \"only huggingface.co URLs are recognized as local model links\" };\n\t}\n\n\t// provider/model -> API-registered model (nothing to install; auth + selection only).\n\tif (input.includes(\"/\")) {\n\t\tconst [provider, ...rest] = input.split(\"/\");\n\t\tconst model = rest.join(\"/\");\n\t\tif (provider && model && !model.includes(\"/\")) {\n\t\t\treturn { type: \"api\", ref: `${provider}/${model}` };\n\t\t}\n\t\treturn { type: \"rejected\", reason: \"expected provider/model or hf.co/org/repo[:quant]\" };\n\t}\n\n\t// Bare ollama tag (\"qwen3:1.7b\", \"pi-lifter:latest\", \"llama3\").\n\tif (OLLAMA_TAG.test(input)) {\n\t\treturn { type: \"local\", pullRef: input };\n\t}\n\n\treturn { type: \"rejected\", reason: \"not a recognized model reference\" };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,
|
|
1
|
+
{"version":3,"file":"slash-commands.d.ts","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,QAAQ,GAAG,OAAO,CAAC;AAElE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,MAAM,EAAE,kBAAkB,CAAC;IAC3B,UAAU,EAAE,UAAU,CAAC;CACvB;AAED,MAAM,WAAW,mBAAmB;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,sBAAsB,EAAE,aAAa,CAAC,mBAAmB,CA0DrE,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"autonomy\", description: \"Autonomy mode, diagnostics, research, fitness (/autonomy status)\" },\n\t{\n\t\tname: \"models\",\n\t\tdescription: \"Local model lifecycle: /models [list|add <ref-or-link>|remove <ref> confirm|stop]\",\n\t},\n\t{\n\t\tname: \"fitness\",\n\t\tdescription: \"Pick and probe a model for local/heavy-lifter roles, then assign it (/fitness [model] [trials])\",\n\t},\n\t{ name: \"context\", description: \"Context composition dashboard: what rides on every request\" },\n\t{ name: \"auto-learn\", description: \"Show Auto Learn/reflection status or run now (/auto-learn run)\" },\n\t{\n\t\tname: \"goal-continue\",\n\t\tdescription: \"Continue the current goal loop explicitly (/goal-continue [turns] [stalls])\",\n\t},\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"profiles\", description: \"Select a runtime profile for this session\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"usage\", description: \"Show tokens, cost, and optimization controls\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message (optional name: /fork <name>)\" },\n\t{\n\t\tname: \"clone\",\n\t\tdescription: \"Duplicate the current session at the current position (optional name: /clone <name>)\",\n\t},\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Trust or untrust this project folder\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session (optional name: /new <name>)\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"curate\", description: \"Review/archive stale or overlapping reflection-promoted skills\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Quit ${APP_NAME}` },\n\t{\n\t\tname: \"install-resources\",\n\t\tdescription:\n\t\t\t\"Copy resources from a trusted directory to user local settings (/install-resources <dir> [--force])\",\n\t},\n\t{\n\t\tname: \"config-backup\",\n\t\tdescription: \"Backup profiles and resource settings to a JSON file (/config-backup [file])\",\n\t},\n\t{\n\t\tname: \"config-restore\",\n\t\tdescription: \"Restore profiles and resource settings from a JSON file (/config-restore <file>)\",\n\t},\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
@@ -2,6 +2,10 @@ import { APP_NAME } from "../config.js";
|
|
|
2
2
|
export const BUILTIN_SLASH_COMMANDS = [
|
|
3
3
|
{ name: "settings", description: "Open settings menu" },
|
|
4
4
|
{ name: "autonomy", description: "Autonomy mode, diagnostics, research, fitness (/autonomy status)" },
|
|
5
|
+
{
|
|
6
|
+
name: "models",
|
|
7
|
+
description: "Local model lifecycle: /models [list|add <ref-or-link>|remove <ref> confirm|stop]",
|
|
8
|
+
},
|
|
5
9
|
{
|
|
6
10
|
name: "fitness",
|
|
7
11
|
description: "Pick and probe a model for local/heavy-lifter roles, then assign it (/fitness [model] [trials])",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAiBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kEAAkE,EAAE;IACrG;QACC,IAAI,EAAE,SAAS;QACf,WAAW,EAAE,iGAAiG;KAC9G;IACD,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,4DAA4D,EAAE;IAC9F,EAAE,IAAI,EAAE,YAAY,EAAE,WAAW,EAAE,gEAAgE,EAAE;IACrG;QACC,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,6EAA6E;KAC1F;IACD,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,kCAAkC,EAAE;IAClE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,2CAA2C,EAAE;IAC9E,EAAE,IAAI,EAAE,eAAe,EAAE,WAAW,EAAE,0CAA0C,EAAE;IAClF,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8DAA8D,EAAE;IAC/F,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+CAA+C,EAAE;IAChF,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,uCAAuC,EAAE;IACvE,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,sCAAsC,EAAE;IAC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AgB;QACtB,WAAW,EAAE,kFAAkF;KAC/F;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"autonomy\", description: \"Autonomy mode, diagnostics, research, fitness (/autonomy status)\" },\n\t{\n\t\tname: \"fitness\",\n\t\tdescription: \"Pick and probe a model for local/heavy-lifter roles, then assign it (/fitness [model] [trials])\",\n\t},\n\t{ name: \"context\", description: \"Context composition dashboard: what rides on every request\" },\n\t{ name: \"auto-learn\", description: \"Show Auto Learn/reflection status or run now (/auto-learn run)\" },\n\t{\n\t\tname: \"goal-continue\",\n\t\tdescription: \"Continue the current goal loop explicitly (/goal-continue [turns] [stalls])\",\n\t},\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"profiles\", description: \"Select a runtime profile for this session\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"usage\", description: \"Show tokens, cost, and optimization controls\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message (optional name: /fork <name>)\" },\n\t{\n\t\tname: \"clone\",\n\t\tdescription: \"Duplicate the current session at the current position (optional name: /clone <name>)\",\n\t},\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Trust or untrust this project folder\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session (optional name: /new <name>)\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"curate\", description: \"Review/archive stale or overlapping reflection-promoted skills\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Quit ${APP_NAME}` },\n\t{\n\t\tname: \"install-resources\",\n\t\tdescription:\n\t\t\t\"Copy resources from a trusted directory to user local settings (/install-resources <dir> [--force])\",\n\t},\n\t{\n\t\tname: \"config-backup\",\n\t\tdescription: \"Backup profiles and resource settings to a JSON file (/config-backup [file])\",\n\t},\n\t{\n\t\tname: \"config-restore\",\n\t\tdescription: \"Restore profiles and resource settings from a JSON file (/config-restore <file>)\",\n\t},\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
1
|
+
{"version":3,"file":"slash-commands.js","sourceRoot":"","sources":["../../src/core/slash-commands.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAiBxC,MAAM,CAAC,MAAM,sBAAsB,GAAuC;IACzE,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,oBAAoB,EAAE;IACvD,EAAE,IAAI,EAAE,UAAU,EAAE,WAAW,EAAE,kEAAkE,EAAE;IACrG;QACC,IAAI,EAAE,QAAQ;QACd,WAAW,EAAE,mFAAmF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AE,WAAW,EAAE,sCAAsC,EAAE;IACtE,EAAE,IAAI,EAAE,OAAO,EAAE,WAAW,EAAE,mCAAmC,EAAE;IACnE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gCAAgC,EAAE;IACjE,EAAE,IAAI,EAAE,KAAK,EAAE,WAAW,EAAE,kDAAkD,EAAE;IAChF,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE,sCAAsC,EAAE;IACxE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,gEAAgE,EAAE;IACjG,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,4BAA4B,EAAE;IAC7D,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6DAA6D,EAAE;IAC9F,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;IACjD;QACC,IAAI,EAAE,mBAAmB;QACzB,WAAW,EACV,qGAAqG;KACtG;IACD;QACC,IAAI,EAAE,eAAe;QACrB,WAAW,EAAE,8EAA8E;KAC3F;IACD;QACC,IAAI,EAAE,gBAAgB;QACtB,WAAW,EAAE,kFAAkF;KAC/F;IACD,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,QAAQ,EAAE,EAAE;CACjD,CAAC","sourcesContent":["import { APP_NAME } from \"../config.ts\";\nimport type { SourceInfo } from \"./source-info.ts\";\n\nexport type SlashCommandSource = \"extension\" | \"prompt\" | \"skill\";\n\nexport interface SlashCommandInfo {\n\tname: string;\n\tdescription?: string;\n\tsource: SlashCommandSource;\n\tsourceInfo: SourceInfo;\n}\n\nexport interface BuiltinSlashCommand {\n\tname: string;\n\tdescription: string;\n}\n\nexport const BUILTIN_SLASH_COMMANDS: ReadonlyArray<BuiltinSlashCommand> = [\n\t{ name: \"settings\", description: \"Open settings menu\" },\n\t{ name: \"autonomy\", description: \"Autonomy mode, diagnostics, research, fitness (/autonomy status)\" },\n\t{\n\t\tname: \"models\",\n\t\tdescription: \"Local model lifecycle: /models [list|add <ref-or-link>|remove <ref> confirm|stop]\",\n\t},\n\t{\n\t\tname: \"fitness\",\n\t\tdescription: \"Pick and probe a model for local/heavy-lifter roles, then assign it (/fitness [model] [trials])\",\n\t},\n\t{ name: \"context\", description: \"Context composition dashboard: what rides on every request\" },\n\t{ name: \"auto-learn\", description: \"Show Auto Learn/reflection status or run now (/auto-learn run)\" },\n\t{\n\t\tname: \"goal-continue\",\n\t\tdescription: \"Continue the current goal loop explicitly (/goal-continue [turns] [stalls])\",\n\t},\n\t{ name: \"model\", description: \"Select model (opens selector UI)\" },\n\t{ name: \"profiles\", description: \"Select a runtime profile for this session\" },\n\t{ name: \"scoped-models\", description: \"Enable/disable models for Ctrl+P cycling\" },\n\t{ name: \"export\", description: \"Export session (HTML default, or specify path: .html/.jsonl)\" },\n\t{ name: \"import\", description: \"Import and resume a session from a JSONL file\" },\n\t{ name: \"share\", description: \"Share session as a secret GitHub gist\" },\n\t{ name: \"copy\", description: \"Copy last agent message to clipboard\" },\n\t{ name: \"name\", description: \"Set session display name\" },\n\t{ name: \"session\", description: \"Show session info and stats\" },\n\t{ name: \"usage\", description: \"Show tokens, cost, and optimization controls\" },\n\t{ name: \"changelog\", description: \"Show changelog entries\" },\n\t{ name: \"hotkeys\", description: \"Show all keyboard shortcuts\" },\n\t{ name: \"fork\", description: \"Create a new fork from a previous user message (optional name: /fork <name>)\" },\n\t{\n\t\tname: \"clone\",\n\t\tdescription: \"Duplicate the current session at the current position (optional name: /clone <name>)\",\n\t},\n\t{ name: \"tree\", description: \"Navigate session tree (switch branches)\" },\n\t{ name: \"trust\", description: \"Trust or untrust this project folder\" },\n\t{ name: \"login\", description: \"Configure provider authentication\" },\n\t{ name: \"logout\", description: \"Remove provider authentication\" },\n\t{ name: \"new\", description: \"Start a new session (optional name: /new <name>)\" },\n\t{ name: \"compact\", description: \"Manually compact the session context\" },\n\t{ name: \"curate\", description: \"Review/archive stale or overlapping reflection-promoted skills\" },\n\t{ name: \"resume\", description: \"Resume a different session\" },\n\t{ name: \"reload\", description: \"Reload keybindings, extensions, skills, prompts, and themes\" },\n\t{ name: \"exit\", description: `Quit ${APP_NAME}` },\n\t{\n\t\tname: \"install-resources\",\n\t\tdescription:\n\t\t\t\"Copy resources from a trusted directory to user local settings (/install-resources <dir> [--force])\",\n\t},\n\t{\n\t\tname: \"config-backup\",\n\t\tdescription: \"Backup profiles and resource settings to a JSON file (/config-backup [file])\",\n\t},\n\t{\n\t\tname: \"config-restore\",\n\t\tdescription: \"Restore profiles and resource settings from a JSON file (/config-restore <file>)\",\n\t},\n\t{ name: \"quit\", description: `Quit ${APP_NAME}` },\n];\n"]}
|
|
@@ -470,6 +470,13 @@ export declare class InteractiveMode {
|
|
|
470
470
|
private formatAutoLearnStatus;
|
|
471
471
|
private formatAutonomyStatus;
|
|
472
472
|
private applyAutonomyMode;
|
|
473
|
+
private _localRuntime;
|
|
474
|
+
private get localRuntime();
|
|
475
|
+
private handleModelsCommand;
|
|
476
|
+
private ensureLocalServer;
|
|
477
|
+
private listLocalModels;
|
|
478
|
+
private addLocalModel;
|
|
479
|
+
private removeLocalModel;
|
|
473
480
|
/** /fitness with no args: pick a model from the configured registry, probe it, assign a role. */
|
|
474
481
|
private showFitnessModelSelector;
|
|
475
482
|
private runFitnessAndAssign;
|