@caupulican/pi-adaptative 0.80.97 → 0.80.98

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.
Files changed (60) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/core/agent-session.d.ts +19 -2
  3. package/dist/core/agent-session.d.ts.map +1 -1
  4. package/dist/core/agent-session.js +185 -6
  5. package/dist/core/agent-session.js.map +1 -1
  6. package/dist/core/autonomy/envelope-enforcement.d.ts +17 -0
  7. package/dist/core/autonomy/envelope-enforcement.d.ts.map +1 -0
  8. package/dist/core/autonomy/envelope-enforcement.js +80 -0
  9. package/dist/core/autonomy/envelope-enforcement.js.map +1 -0
  10. package/dist/core/context/brain-curator.d.ts +7 -0
  11. package/dist/core/context/brain-curator.d.ts.map +1 -1
  12. package/dist/core/context/brain-curator.js +6 -0
  13. package/dist/core/context/brain-curator.js.map +1 -1
  14. package/dist/core/context/context-composition.d.ts.map +1 -1
  15. package/dist/core/context/context-composition.js +1 -1
  16. package/dist/core/context/context-composition.js.map +1 -1
  17. package/dist/core/delegation/session-worker-result.d.ts +8 -2
  18. package/dist/core/delegation/session-worker-result.d.ts.map +1 -1
  19. package/dist/core/delegation/session-worker-result.js +18 -1
  20. package/dist/core/delegation/session-worker-result.js.map +1 -1
  21. package/dist/core/learning/observation-store.d.ts +20 -0
  22. package/dist/core/learning/observation-store.d.ts.map +1 -0
  23. package/dist/core/learning/observation-store.js +101 -0
  24. package/dist/core/learning/observation-store.js.map +1 -0
  25. package/dist/core/model-router/executor-route.d.ts +8 -0
  26. package/dist/core/model-router/executor-route.d.ts.map +1 -0
  27. package/dist/core/model-router/executor-route.js +33 -0
  28. package/dist/core/model-router/executor-route.js.map +1 -0
  29. package/dist/core/model-router/tool-escalation.d.ts +2 -0
  30. package/dist/core/model-router/tool-escalation.d.ts.map +1 -1
  31. package/dist/core/model-router/tool-escalation.js +6 -0
  32. package/dist/core/model-router/tool-escalation.js.map +1 -1
  33. package/dist/core/research/research-runner.d.ts +8 -1
  34. package/dist/core/research/research-runner.d.ts.map +1 -1
  35. package/dist/core/research/research-runner.js +13 -1
  36. package/dist/core/research/research-runner.js.map +1 -1
  37. package/dist/core/research/workspace-collector.d.ts +25 -0
  38. package/dist/core/research/workspace-collector.d.ts.map +1 -0
  39. package/dist/core/research/workspace-collector.js +286 -0
  40. package/dist/core/research/workspace-collector.js.map +1 -0
  41. package/dist/core/settings-manager.d.ts +2 -0
  42. package/dist/core/settings-manager.d.ts.map +1 -1
  43. package/dist/core/settings-manager.js +3 -0
  44. package/dist/core/settings-manager.js.map +1 -1
  45. package/dist/modes/interactive/components/fitness-role-selector.d.ts +1 -1
  46. package/dist/modes/interactive/components/fitness-role-selector.d.ts.map +1 -1
  47. package/dist/modes/interactive/components/fitness-role-selector.js +5 -0
  48. package/dist/modes/interactive/components/fitness-role-selector.js.map +1 -1
  49. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  50. package/dist/modes/interactive/interactive-mode.js +9 -0
  51. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  52. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  53. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  54. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  55. package/examples/extensions/sandbox/package-lock.json +2 -2
  56. package/examples/extensions/sandbox/package.json +1 -1
  57. package/examples/extensions/with-deps/package-lock.json +2 -2
  58. package/examples/extensions/with-deps/package.json +1 -1
  59. package/npm-shrinkwrap.json +12 -12
  60. package/package.json +4 -4
@@ -1,6 +1,6 @@
1
1
  import { Container } from "@caupulican/pi-tui";
2
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";
3
+ export type FitnessRole = "curator" | "executor" | "router-cheap" | "router-medium" | "router-expensive" | "judge" | "learning" | "none";
4
4
  /**
5
5
  * Post-probe role assignment: after /fitness measures a model, this selector turns the result
6
6
  * into configuration in one step instead of sending the user to hand-edit settings JSON.
@@ -1 +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"]}
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,UAAU,GACV,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,EAsDxF;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| \"executor\"\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: \"executor\",\n\t\t\t\tlabel: \"Toolkit executor\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Owns direct toolkit commands end-to-end (Level-0 exact hits route here; needs tool-call fitness)\",\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"]}
@@ -19,6 +19,11 @@ export class FitnessRoleSelectorComponent extends Container {
19
19
  label: "Context curator",
20
20
  description: "Local brain: digests GC-packed stubs, scores stale-chunk relevance (enables curation)",
21
21
  },
22
+ {
23
+ value: "executor",
24
+ label: "Toolkit executor",
25
+ description: "Owns direct toolkit commands end-to-end (Level-0 exact hits route here; needs tool-call fitness)",
26
+ },
22
27
  {
23
28
  value: "router-cheap",
24
29
  label: "Router: cheap tier",
@@ -1 +1 @@
1
- {"version":3,"file":"fitness-role-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/fitness-role-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAgC,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,+BAA+B,GAA4B;IAChE,qBAAqB,EAAE,EAAE;IACzB,qBAAqB,EAAE,EAAE;CACzB,CAAC;AAYF;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,SAAS;IAClD,UAAU,CAAa;IAE/B,YAAY,QAAgB,EAAE,QAAqC,EAAE,QAAoB,EAAE;QAC1F,KAAK,EAAE,CAAC;QAER,MAAM,KAAK,GAAiB;YAC3B;gBACC,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,uFAAuF;aACpG;YACD;gBACC,KAAK,EAAE,cAAc;gBACrB,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,eAAe;gBACtB,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EAAE,6DAA6D;aAC1E;YACD;gBACC,KAAK,EAAE,kBAAkB;gBACzB,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,2CAA2C;aACxD;YACD;gBACC,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,yEAAyE;aACtF;SACD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,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
+ {"version":3,"file":"fitness-role-selector.js","sourceRoot":"","sources":["../../../../src/modes/interactive/components/fitness-role-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAmB,UAAU,EAAgC,IAAI,EAAE,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AAEpD,MAAM,+BAA+B,GAA4B;IAChE,qBAAqB,EAAE,EAAE;IACzB,qBAAqB,EAAE,EAAE;CACzB,CAAC;AAaF;;;GAGG;AACH,MAAM,OAAO,4BAA6B,SAAQ,SAAS;IAClD,UAAU,CAAa;IAE/B,YAAY,QAAgB,EAAE,QAAqC,EAAE,QAAoB,EAAE;QAC1F,KAAK,EAAE,CAAC;QAER,MAAM,KAAK,GAAiB;YAC3B;gBACC,KAAK,EAAE,SAAS;gBAChB,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,uFAAuF;aACpG;YACD;gBACC,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,kBAAkB;gBACzB,WAAW,EACV,kGAAkG;aACnG;YACD;gBACC,KAAK,EAAE,cAAc;gBACrB,KAAK,EAAE,oBAAoB;gBAC3B,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,eAAe;gBACtB,KAAK,EAAE,qBAAqB;gBAC5B,WAAW,EAAE,6DAA6D;aAC1E;YACD;gBACC,KAAK,EAAE,kBAAkB;gBACzB,KAAK,EAAE,wBAAwB;gBAC/B,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,eAAe;gBACtB,WAAW,EAAE,gEAAgE;aAC7E;YACD;gBACC,KAAK,EAAE,UAAU;gBACjB,KAAK,EAAE,uBAAuB;gBAC9B,WAAW,EAAE,2CAA2C;aACxD;YACD;gBACC,KAAK,EAAE,MAAM;gBACb,KAAK,EAAE,iBAAiB;gBACxB,WAAW,EAAE,yEAAyE;aACtF;SACD,CAAC;QAEF,IAAI,CAAC,QAAQ,CAAC,IAAI,aAAa,EAAE,CAAC,CAAC;QACnC,IAAI,CAAC,QAAQ,CAAC,IAAI,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| \"executor\"\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: \"executor\",\n\t\t\t\tlabel: \"Toolkit executor\",\n\t\t\t\tdescription:\n\t\t\t\t\t\"Owns direct toolkit commands end-to-end (Level-0 exact hits route here; needs tool-call fitness)\",\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"]}