@caupulican/pi-adaptative 0.80.88 → 0.80.89
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 +29 -0
- package/dist/core/agent-session.d.ts +35 -0
- package/dist/core/agent-session.d.ts.map +1 -1
- package/dist/core/agent-session.js +262 -0
- package/dist/core/agent-session.js.map +1 -1
- package/dist/core/context/brain-curator.d.ts +88 -0
- package/dist/core/context/brain-curator.d.ts.map +1 -0
- package/dist/core/context/brain-curator.js +192 -0
- package/dist/core/context/brain-curator.js.map +1 -0
- package/dist/core/context/context-composition.d.ts +122 -0
- package/dist/core/context/context-composition.d.ts.map +1 -0
- package/dist/core/context/context-composition.js +163 -0
- package/dist/core/context/context-composition.js.map +1 -0
- package/dist/core/context/context-prompt-enforcement.d.ts +13 -0
- package/dist/core/context/context-prompt-enforcement.d.ts.map +1 -1
- package/dist/core/context/context-prompt-enforcement.js +17 -2
- package/dist/core/context/context-prompt-enforcement.js.map +1 -1
- package/dist/core/context-gc.d.ts +13 -0
- package/dist/core/context-gc.d.ts.map +1 -1
- package/dist/core/context-gc.js +6 -0
- package/dist/core/context-gc.js.map +1 -1
- package/dist/core/research/model-fitness.d.ts +3 -0
- package/dist/core/research/model-fitness.d.ts.map +1 -1
- package/dist/core/research/model-fitness.js +54 -3
- package/dist/core/research/model-fitness.js.map +1 -1
- package/dist/core/settings-manager.d.ts +13 -0
- package/dist/core/settings-manager.d.ts.map +1 -1
- package/dist/core/settings-manager.js +19 -0
- package/dist/core/settings-manager.js.map +1 -1
- package/dist/core/slash-commands.d.ts.map +1 -1
- package/dist/core/slash-commands.js +6 -1
- package/dist/core/slash-commands.js.map +1 -1
- package/dist/modes/interactive/components/fitness-role-selector.d.ts +13 -0
- package/dist/modes/interactive/components/fitness-role-selector.d.ts.map +1 -0
- package/dist/modes/interactive/components/fitness-role-selector.js +65 -0
- package/dist/modes/interactive/components/fitness-role-selector.js.map +1 -0
- package/dist/modes/interactive/components/settings-selector.d.ts +4 -1
- package/dist/modes/interactive/components/settings-selector.d.ts.map +1 -1
- package/dist/modes/interactive/components/settings-selector.js +84 -0
- package/dist/modes/interactive/components/settings-selector.js.map +1 -1
- package/dist/modes/interactive/interactive-mode.d.ts +5 -0
- package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
- package/dist/modes/interactive/interactive-mode.js +91 -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
|
@@ -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,CAsDrE,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,7 +1,12 @@
|
|
|
1
1
|
import { APP_NAME } from "../config.js";
|
|
2
2
|
export const BUILTIN_SLASH_COMMANDS = [
|
|
3
3
|
{ name: "settings", description: "Open settings menu" },
|
|
4
|
-
{ name: "autonomy", description: "
|
|
4
|
+
{ name: "autonomy", description: "Autonomy mode, diagnostics, research, fitness (/autonomy status)" },
|
|
5
|
+
{
|
|
6
|
+
name: "fitness",
|
|
7
|
+
description: "Pick and probe a model for local/heavy-lifter roles, then assign it (/fitness [model] [trials])",
|
|
8
|
+
},
|
|
9
|
+
{ name: "context", description: "Context composition dashboard: what rides on every request" },
|
|
5
10
|
{ name: "auto-learn", description: "Show Auto Learn/reflection status or run now (/auto-learn run)" },
|
|
6
11
|
{
|
|
7
12
|
name: "goal-continue",
|
|
@@ -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,
|
|
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,WAA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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: \"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"]}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Container } from "@caupulican/pi-tui";
|
|
2
|
+
/** Roles a freshly probed model can be assigned to, mapped to their settings by the caller. */
|
|
3
|
+
export type FitnessRole = "curator" | "router-cheap" | "router-medium" | "router-expensive" | "judge" | "learning" | "none";
|
|
4
|
+
/**
|
|
5
|
+
* Post-probe role assignment: after /fitness measures a model, this selector turns the result
|
|
6
|
+
* into configuration in one step instead of sending the user to hand-edit settings JSON.
|
|
7
|
+
*/
|
|
8
|
+
export declare class FitnessRoleSelectorComponent extends Container {
|
|
9
|
+
private selectList;
|
|
10
|
+
constructor(modelRef: string, onSelect: (role: FitnessRole) => void, onCancel: () => void);
|
|
11
|
+
handleInput(data: string): void;
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=fitness-role-selector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitness-role-selector.d.ts","sourceRoot":"","sources":["../../../../src/modes/interactive/components/fitness-role-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmE,MAAM,oBAAoB,CAAC;AAShH,+FAA+F;AAC/F,MAAM,MAAM,WAAW,GACpB,SAAS,GACT,cAAc,GACd,eAAe,GACf,kBAAkB,GAClB,OAAO,GACP,UAAU,GACV,MAAM,CAAC;AAEV;;;GAGG;AACH,qBAAa,4BAA6B,SAAQ,SAAS;IAC1D,OAAO,CAAC,UAAU,CAAa;IAE/B,YAAY,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,IAAI,EAAE,QAAQ,EAAE,MAAM,IAAI,EAgDxF;IAED,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAE9B;CACD","sourcesContent":["import { Container, type SelectItem, SelectList, type SelectListLayoutOptions, Text } from \"@caupulican/pi-tui\";\nimport { getSelectListTheme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\n\nconst FITNESS_ROLE_SELECT_LIST_LAYOUT: SelectListLayoutOptions = {\n\tminPrimaryColumnWidth: 18,\n\tmaxPrimaryColumnWidth: 34,\n};\n\n/** Roles a freshly probed model can be assigned to, mapped to their settings by the caller. */\nexport type FitnessRole =\n\t| \"curator\"\n\t| \"router-cheap\"\n\t| \"router-medium\"\n\t| \"router-expensive\"\n\t| \"judge\"\n\t| \"learning\"\n\t| \"none\";\n\n/**\n * Post-probe role assignment: after /fitness measures a model, this selector turns the result\n * into configuration in one step instead of sending the user to hand-edit settings JSON.\n */\nexport class FitnessRoleSelectorComponent extends Container {\n\tprivate selectList: SelectList;\n\n\tconstructor(modelRef: string, onSelect: (role: FitnessRole) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SelectItem[] = [\n\t\t\t{\n\t\t\t\tvalue: \"curator\",\n\t\t\t\tlabel: \"Context curator\",\n\t\t\t\tdescription: \"Local brain: digests GC-packed stubs, scores stale-chunk relevance (enables curation)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-cheap\",\n\t\t\t\tlabel: \"Router: cheap tier\",\n\t\t\t\tdescription: \"Handles trivial/read-only routed turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-medium\",\n\t\t\t\tlabel: \"Router: medium tier\",\n\t\t\t\tdescription: \"Handles normal implementation turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-expensive\",\n\t\t\t\tlabel: \"Router: expensive tier\",\n\t\t\t\tdescription: \"Handles high-impact/architecture turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"judge\",\n\t\t\t\tlabel: \"Routing judge\",\n\t\t\t\tdescription: \"Routing-only tier verdicts; needs strong instruction following\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"learning\",\n\t\t\t\tlabel: \"Learning / reflection\",\n\t\t\t\tdescription: \"Background reflection and learning passes\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"none\",\n\t\t\t\tlabel: \"No role for now\",\n\t\t\t\tdescription: \"Keep the result in the fitness store only (assign later from /settings)\",\n\t\t\t},\n\t\t];\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Text(`Assign a role for ${modelRef}:`, 1, 0));\n\t\tthis.selectList = new SelectList(items, 8, getSelectListTheme(), FITNESS_ROLE_SELECT_LIST_LAYOUT);\n\t\tthis.selectList.onSelect = (item) => onSelect(item.value as FitnessRole);\n\t\tthis.selectList.onCancel = () => onCancel();\n\t\tthis.addChild(this.selectList);\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.selectList.handleInput(data);\n\t}\n}\n"]}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { Container, SelectList, Text } from "@caupulican/pi-tui";
|
|
2
|
+
import { getSelectListTheme } from "../theme/theme.js";
|
|
3
|
+
import { DynamicBorder } from "./dynamic-border.js";
|
|
4
|
+
const FITNESS_ROLE_SELECT_LIST_LAYOUT = {
|
|
5
|
+
minPrimaryColumnWidth: 18,
|
|
6
|
+
maxPrimaryColumnWidth: 34,
|
|
7
|
+
};
|
|
8
|
+
/**
|
|
9
|
+
* Post-probe role assignment: after /fitness measures a model, this selector turns the result
|
|
10
|
+
* into configuration in one step instead of sending the user to hand-edit settings JSON.
|
|
11
|
+
*/
|
|
12
|
+
export class FitnessRoleSelectorComponent extends Container {
|
|
13
|
+
selectList;
|
|
14
|
+
constructor(modelRef, onSelect, onCancel) {
|
|
15
|
+
super();
|
|
16
|
+
const items = [
|
|
17
|
+
{
|
|
18
|
+
value: "curator",
|
|
19
|
+
label: "Context curator",
|
|
20
|
+
description: "Local brain: digests GC-packed stubs, scores stale-chunk relevance (enables curation)",
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
value: "router-cheap",
|
|
24
|
+
label: "Router: cheap tier",
|
|
25
|
+
description: "Handles trivial/read-only routed turns (model router settings)",
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
value: "router-medium",
|
|
29
|
+
label: "Router: medium tier",
|
|
30
|
+
description: "Handles normal implementation turns (model router settings)",
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
value: "router-expensive",
|
|
34
|
+
label: "Router: expensive tier",
|
|
35
|
+
description: "Handles high-impact/architecture turns (model router settings)",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
value: "judge",
|
|
39
|
+
label: "Routing judge",
|
|
40
|
+
description: "Routing-only tier verdicts; needs strong instruction following",
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
value: "learning",
|
|
44
|
+
label: "Learning / reflection",
|
|
45
|
+
description: "Background reflection and learning passes",
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
value: "none",
|
|
49
|
+
label: "No role for now",
|
|
50
|
+
description: "Keep the result in the fitness store only (assign later from /settings)",
|
|
51
|
+
},
|
|
52
|
+
];
|
|
53
|
+
this.addChild(new DynamicBorder());
|
|
54
|
+
this.addChild(new Text(`Assign a role for ${modelRef}:`, 1, 0));
|
|
55
|
+
this.selectList = new SelectList(items, 8, getSelectListTheme(), FITNESS_ROLE_SELECT_LIST_LAYOUT);
|
|
56
|
+
this.selectList.onSelect = (item) => onSelect(item.value);
|
|
57
|
+
this.selectList.onCancel = () => onCancel();
|
|
58
|
+
this.addChild(this.selectList);
|
|
59
|
+
this.addChild(new DynamicBorder());
|
|
60
|
+
}
|
|
61
|
+
handleInput(data) {
|
|
62
|
+
this.selectList.handleInput(data);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=fitness-role-selector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fitness-role-selector.js","sourceRoot":"","sources":["../../../../src/modes/interact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IAAI,CAAC,qBAAqB,QAAQ,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,GAAG,IAAI,UAAU,CAAC,KAAK,EAAE,CAAC,EAAE,kBAAkB,EAAE,EAAE,+BAA+B,CAAC,CAAC;QAClG,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,CAAC,IAAI,EAAE,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,KAAoB,CAAC,CAAC;QACzE,IAAI,CAAC,UAAU,CAAC,QAAQ,GAAG,GAAG,EAAE,CAAC,QAAQ,EAAE,CAAC;QAC5C,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;QAC/B,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;IAAA,CACnC;IAED,WAAW,CAAC,IAAY,EAAQ;QAC/B,IAAI,CAAC,UAAU,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAAA,CAClC;CACD","sourcesContent":["import { Container, type SelectItem, SelectList, type SelectListLayoutOptions, Text } from \"@caupulican/pi-tui\";\nimport { getSelectListTheme } from \"../theme/theme.ts\";\nimport { DynamicBorder } from \"./dynamic-border.ts\";\n\nconst FITNESS_ROLE_SELECT_LIST_LAYOUT: SelectListLayoutOptions = {\n\tminPrimaryColumnWidth: 18,\n\tmaxPrimaryColumnWidth: 34,\n};\n\n/** Roles a freshly probed model can be assigned to, mapped to their settings by the caller. */\nexport type FitnessRole =\n\t| \"curator\"\n\t| \"router-cheap\"\n\t| \"router-medium\"\n\t| \"router-expensive\"\n\t| \"judge\"\n\t| \"learning\"\n\t| \"none\";\n\n/**\n * Post-probe role assignment: after /fitness measures a model, this selector turns the result\n * into configuration in one step instead of sending the user to hand-edit settings JSON.\n */\nexport class FitnessRoleSelectorComponent extends Container {\n\tprivate selectList: SelectList;\n\n\tconstructor(modelRef: string, onSelect: (role: FitnessRole) => void, onCancel: () => void) {\n\t\tsuper();\n\n\t\tconst items: SelectItem[] = [\n\t\t\t{\n\t\t\t\tvalue: \"curator\",\n\t\t\t\tlabel: \"Context curator\",\n\t\t\t\tdescription: \"Local brain: digests GC-packed stubs, scores stale-chunk relevance (enables curation)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-cheap\",\n\t\t\t\tlabel: \"Router: cheap tier\",\n\t\t\t\tdescription: \"Handles trivial/read-only routed turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-medium\",\n\t\t\t\tlabel: \"Router: medium tier\",\n\t\t\t\tdescription: \"Handles normal implementation turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"router-expensive\",\n\t\t\t\tlabel: \"Router: expensive tier\",\n\t\t\t\tdescription: \"Handles high-impact/architecture turns (model router settings)\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"judge\",\n\t\t\t\tlabel: \"Routing judge\",\n\t\t\t\tdescription: \"Routing-only tier verdicts; needs strong instruction following\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"learning\",\n\t\t\t\tlabel: \"Learning / reflection\",\n\t\t\t\tdescription: \"Background reflection and learning passes\",\n\t\t\t},\n\t\t\t{\n\t\t\t\tvalue: \"none\",\n\t\t\t\tlabel: \"No role for now\",\n\t\t\t\tdescription: \"Keep the result in the fitness store only (assign later from /settings)\",\n\t\t\t},\n\t\t];\n\n\t\tthis.addChild(new DynamicBorder());\n\t\tthis.addChild(new Text(`Assign a role for ${modelRef}:`, 1, 0));\n\t\tthis.selectList = new SelectList(items, 8, getSelectListTheme(), FITNESS_ROLE_SELECT_LIST_LAYOUT);\n\t\tthis.selectList.onSelect = (item) => onSelect(item.value as FitnessRole);\n\t\tthis.selectList.onCancel = () => onCancel();\n\t\tthis.addChild(this.selectList);\n\t\tthis.addChild(new DynamicBorder());\n\t}\n\n\thandleInput(data: string): void {\n\t\tthis.selectList.handleInput(data);\n\t}\n}\n"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ThinkingLevel } from "@caupulican/pi-agent-core";
|
|
2
2
|
import type { Transport } from "@caupulican/pi-ai";
|
|
3
3
|
import { Container, type SelectItem, SelectList, SettingsList } from "@caupulican/pi-tui";
|
|
4
|
-
import type { AutoLearnSettings, AutonomySettings, ContextPromptEnforcementSettings, MemoryRetrievalSettings, ModelRouterSettings, ResearchLaneSettings, SelfModificationSettings, SettingsScope, WarningSettings, WorkerDelegationSettings } from "../../../core/settings-manager.ts";
|
|
4
|
+
import type { AutoLearnSettings, AutonomySettings, ContextCurationSettings, ContextPromptEnforcementSettings, MemoryRetrievalSettings, ModelRouterSettings, ResearchLaneSettings, SelfModificationSettings, SettingsScope, WarningSettings, WorkerDelegationSettings } from "../../../core/settings-manager.ts";
|
|
5
5
|
export interface SettingsConfig {
|
|
6
6
|
autoCompact: boolean;
|
|
7
7
|
showImages: boolean;
|
|
@@ -40,6 +40,8 @@ export interface SettingsConfig {
|
|
|
40
40
|
researchLane: ResearchLaneSettings;
|
|
41
41
|
researchLaneScope?: SettingsScope;
|
|
42
42
|
workerDelegation: WorkerDelegationSettings;
|
|
43
|
+
contextCuration: ContextCurationSettings;
|
|
44
|
+
contextCurationScope?: SettingsScope;
|
|
43
45
|
workerDelegationScope?: SettingsScope;
|
|
44
46
|
modelRouter: ModelRouterSettings;
|
|
45
47
|
modelRouterScope?: SettingsScope;
|
|
@@ -86,6 +88,7 @@ export interface SettingsCallbacks {
|
|
|
86
88
|
onAutonomyChange: (settings: AutonomySettings, scope: SettingsScope) => void;
|
|
87
89
|
onResearchLaneChange: (settings: ResearchLaneSettings, scope: SettingsScope) => void;
|
|
88
90
|
onWorkerDelegationChange: (settings: WorkerDelegationSettings, scope: SettingsScope) => void;
|
|
91
|
+
onContextCurationChange: (settings: ContextCurationSettings, scope: SettingsScope) => void;
|
|
89
92
|
onModelRouterChange: (settings: ModelRouterSettings, scope: SettingsScope) => void;
|
|
90
93
|
onAutoLearnChange: (settings: AutoLearnSettings, scope: SettingsScope) => void;
|
|
91
94
|
onContextPolicyEnforcementChange: (settings: ContextPromptEnforcementSettings, scope: SettingsScope) => void;
|