agent-nuvira 3.3.10 → 3.3.12

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 (234) hide show
  1. package/README.md +32 -1
  2. package/dist/agents/orchestrator.d.ts.map +1 -1
  3. package/dist/agents/orchestrator.js +34 -12
  4. package/dist/agents/orchestrator.js.map +1 -1
  5. package/dist/cli/chat.d.ts +36 -0
  6. package/dist/cli/chat.d.ts.map +1 -1
  7. package/dist/cli/chat.js +440 -44
  8. package/dist/cli/chat.js.map +1 -1
  9. package/dist/cli/config.d.ts +28 -0
  10. package/dist/cli/config.d.ts.map +1 -1
  11. package/dist/cli/config.js +169 -1
  12. package/dist/cli/config.js.map +1 -1
  13. package/dist/cli/eval.d.ts +8 -0
  14. package/dist/cli/eval.d.ts.map +1 -1
  15. package/dist/cli/eval.js +64 -0
  16. package/dist/cli/eval.js.map +1 -1
  17. package/dist/cli/execute.d.ts.map +1 -1
  18. package/dist/cli/execute.js +8 -0
  19. package/dist/cli/execute.js.map +1 -1
  20. package/dist/cli/loop-executor.d.ts +13 -0
  21. package/dist/cli/loop-executor.d.ts.map +1 -1
  22. package/dist/cli/loop-executor.js +27 -18
  23. package/dist/cli/loop-executor.js.map +1 -1
  24. package/dist/cli/tool-install-prompt.d.ts +58 -0
  25. package/dist/cli/tool-install-prompt.d.ts.map +1 -1
  26. package/dist/cli/tool-install-prompt.js +137 -0
  27. package/dist/cli/tool-install-prompt.js.map +1 -1
  28. package/dist/cli/weak-model-prompt.d.ts +16 -7
  29. package/dist/cli/weak-model-prompt.d.ts.map +1 -1
  30. package/dist/cli/weak-model-prompt.js +24 -8
  31. package/dist/cli/weak-model-prompt.js.map +1 -1
  32. package/dist/config/capability-mode.d.ts +122 -0
  33. package/dist/config/capability-mode.d.ts.map +1 -0
  34. package/dist/config/capability-mode.js +132 -0
  35. package/dist/config/capability-mode.js.map +1 -0
  36. package/dist/config/limits.d.ts +47 -0
  37. package/dist/config/limits.d.ts.map +1 -0
  38. package/dist/config/limits.js +64 -0
  39. package/dist/config/limits.js.map +1 -0
  40. package/dist/config/process-env.d.ts.map +1 -1
  41. package/dist/config/process-env.js +44 -0
  42. package/dist/config/process-env.js.map +1 -1
  43. package/dist/config/types.d.ts +113 -0
  44. package/dist/config/types.d.ts.map +1 -1
  45. package/dist/config/work-digest.d.ts +46 -0
  46. package/dist/config/work-digest.d.ts.map +1 -0
  47. package/dist/config/work-digest.js +80 -0
  48. package/dist/config/work-digest.js.map +1 -0
  49. package/dist/context/cache.d.ts +35 -1
  50. package/dist/context/cache.d.ts.map +1 -1
  51. package/dist/context/cache.js +31 -2
  52. package/dist/context/cache.js.map +1 -1
  53. package/dist/gateway/inbound-media.d.ts +18 -0
  54. package/dist/gateway/inbound-media.d.ts.map +1 -1
  55. package/dist/gateway/inbound-media.js +96 -2
  56. package/dist/gateway/inbound-media.js.map +1 -1
  57. package/dist/inference/anthropic-adapter.d.ts +6 -0
  58. package/dist/inference/anthropic-adapter.d.ts.map +1 -1
  59. package/dist/inference/anthropic-adapter.js +79 -8
  60. package/dist/inference/anthropic-adapter.js.map +1 -1
  61. package/dist/inference/gemini-adapter.d.ts +6 -0
  62. package/dist/inference/gemini-adapter.d.ts.map +1 -1
  63. package/dist/inference/gemini-adapter.js +73 -8
  64. package/dist/inference/gemini-adapter.js.map +1 -1
  65. package/dist/inference/groq-adapter.d.ts +3 -0
  66. package/dist/inference/groq-adapter.d.ts.map +1 -1
  67. package/dist/inference/groq-adapter.js +83 -40
  68. package/dist/inference/groq-adapter.js.map +1 -1
  69. package/dist/inference/interface.d.ts +7 -0
  70. package/dist/inference/interface.d.ts.map +1 -1
  71. package/dist/inference/model-catalog.d.ts +17 -0
  72. package/dist/inference/model-catalog.d.ts.map +1 -1
  73. package/dist/inference/model-catalog.js +42 -7
  74. package/dist/inference/model-catalog.js.map +1 -1
  75. package/dist/inference/model-probe.d.ts +17 -0
  76. package/dist/inference/model-probe.d.ts.map +1 -1
  77. package/dist/inference/model-probe.js +58 -1
  78. package/dist/inference/model-probe.js.map +1 -1
  79. package/dist/inference/model-validator.d.ts +16 -1
  80. package/dist/inference/model-validator.d.ts.map +1 -1
  81. package/dist/inference/model-validator.js +83 -2
  82. package/dist/inference/model-validator.js.map +1 -1
  83. package/dist/inference/nim-adapter.js +4 -4
  84. package/dist/inference/nim-adapter.js.map +1 -1
  85. package/dist/inference/openai-compat-adapter.d.ts +9 -0
  86. package/dist/inference/openai-compat-adapter.d.ts.map +1 -1
  87. package/dist/inference/openai-compat-adapter.js +101 -51
  88. package/dist/inference/openai-compat-adapter.js.map +1 -1
  89. package/dist/inference/openrouter-adapter.d.ts +3 -0
  90. package/dist/inference/openrouter-adapter.d.ts.map +1 -1
  91. package/dist/inference/openrouter-adapter.js +134 -57
  92. package/dist/inference/openrouter-adapter.js.map +1 -1
  93. package/dist/inference/reasoning-effort.d.ts +130 -0
  94. package/dist/inference/reasoning-effort.d.ts.map +1 -0
  95. package/dist/inference/reasoning-effort.js +237 -0
  96. package/dist/inference/reasoning-effort.js.map +1 -0
  97. package/dist/inference/route-resolver.d.ts +7 -0
  98. package/dist/inference/route-resolver.d.ts.map +1 -1
  99. package/dist/inference/route-resolver.js +2 -1
  100. package/dist/inference/route-resolver.js.map +1 -1
  101. package/dist/inference/sse.d.ts +6 -0
  102. package/dist/inference/sse.d.ts.map +1 -1
  103. package/dist/inference/sse.js +1 -0
  104. package/dist/inference/sse.js.map +1 -1
  105. package/dist/inference/tool-call-utils.d.ts +4 -3
  106. package/dist/inference/tool-call-utils.d.ts.map +1 -1
  107. package/dist/inference/tool-call-utils.js +16 -4
  108. package/dist/inference/tool-call-utils.js.map +1 -1
  109. package/dist/inference/tools.d.ts +13 -0
  110. package/dist/inference/tools.d.ts.map +1 -1
  111. package/dist/inference/tools.js +20 -2
  112. package/dist/inference/tools.js.map +1 -1
  113. package/dist/learning/agentic-route-gate.d.ts +104 -0
  114. package/dist/learning/agentic-route-gate.d.ts.map +1 -0
  115. package/dist/learning/agentic-route-gate.js +125 -0
  116. package/dist/learning/agentic-route-gate.js.map +1 -0
  117. package/dist/learning/auto-router.d.ts +36 -0
  118. package/dist/learning/auto-router.d.ts.map +1 -1
  119. package/dist/learning/auto-router.js +115 -8
  120. package/dist/learning/auto-router.js.map +1 -1
  121. package/dist/learning/autonomy-policy.d.ts +8 -0
  122. package/dist/learning/autonomy-policy.d.ts.map +1 -1
  123. package/dist/learning/autonomy-policy.js +34 -0
  124. package/dist/learning/autonomy-policy.js.map +1 -1
  125. package/dist/learning/build-prerequisites.d.ts +68 -0
  126. package/dist/learning/build-prerequisites.d.ts.map +1 -0
  127. package/dist/learning/build-prerequisites.js +267 -0
  128. package/dist/learning/build-prerequisites.js.map +1 -0
  129. package/dist/learning/capability-parity.d.ts +108 -0
  130. package/dist/learning/capability-parity.d.ts.map +1 -0
  131. package/dist/learning/capability-parity.js +154 -0
  132. package/dist/learning/capability-parity.js.map +1 -0
  133. package/dist/learning/continuation-intent.d.ts +43 -0
  134. package/dist/learning/continuation-intent.d.ts.map +1 -0
  135. package/dist/learning/continuation-intent.js +82 -0
  136. package/dist/learning/continuation-intent.js.map +1 -0
  137. package/dist/learning/cost-tracker.d.ts +28 -4
  138. package/dist/learning/cost-tracker.d.ts.map +1 -1
  139. package/dist/learning/cost-tracker.js +58 -8
  140. package/dist/learning/cost-tracker.js.map +1 -1
  141. package/dist/learning/eval-framework.d.ts +17 -0
  142. package/dist/learning/eval-framework.d.ts.map +1 -1
  143. package/dist/learning/eval-framework.js +63 -2
  144. package/dist/learning/eval-framework.js.map +1 -1
  145. package/dist/learning/model-capability.d.ts +94 -0
  146. package/dist/learning/model-capability.d.ts.map +1 -0
  147. package/dist/learning/model-capability.js +172 -0
  148. package/dist/learning/model-capability.js.map +1 -0
  149. package/dist/learning/model-harness.d.ts +19 -0
  150. package/dist/learning/model-harness.d.ts.map +1 -1
  151. package/dist/learning/model-harness.js +27 -0
  152. package/dist/learning/model-harness.js.map +1 -1
  153. package/dist/learning/model-registry.d.ts +33 -0
  154. package/dist/learning/model-registry.d.ts.map +1 -1
  155. package/dist/learning/model-registry.js +79 -0
  156. package/dist/learning/model-registry.js.map +1 -1
  157. package/dist/learning/prompt-budget.d.ts +91 -0
  158. package/dist/learning/prompt-budget.d.ts.map +1 -0
  159. package/dist/learning/prompt-budget.js +99 -0
  160. package/dist/learning/prompt-budget.js.map +1 -0
  161. package/dist/learning/reasoning-trace.d.ts +55 -2
  162. package/dist/learning/reasoning-trace.d.ts.map +1 -1
  163. package/dist/learning/reasoning-trace.js +48 -0
  164. package/dist/learning/reasoning-trace.js.map +1 -1
  165. package/dist/learning/resilient-call.d.ts.map +1 -1
  166. package/dist/learning/resilient-call.js +16 -3
  167. package/dist/learning/resilient-call.js.map +1 -1
  168. package/dist/learning/resolve-options.d.ts.map +1 -1
  169. package/dist/learning/resolve-options.js +16 -3
  170. package/dist/learning/resolve-options.js.map +1 -1
  171. package/dist/learning/routing-history.d.ts +13 -0
  172. package/dist/learning/routing-history.d.ts.map +1 -1
  173. package/dist/learning/routing-history.js.map +1 -1
  174. package/dist/learning/run-trace.d.ts +68 -0
  175. package/dist/learning/run-trace.d.ts.map +1 -1
  176. package/dist/learning/run-trace.js +101 -0
  177. package/dist/learning/run-trace.js.map +1 -1
  178. package/dist/learning/turn-report.d.ts +78 -0
  179. package/dist/learning/turn-report.d.ts.map +1 -0
  180. package/dist/learning/turn-report.js +140 -0
  181. package/dist/learning/turn-report.js.map +1 -0
  182. package/dist/tools/edit-verification.d.ts +2 -11
  183. package/dist/tools/edit-verification.d.ts.map +1 -1
  184. package/dist/tools/edit-verification.js +33 -1
  185. package/dist/tools/edit-verification.js.map +1 -1
  186. package/dist/tools/loop-skill-hint.d.ts +78 -0
  187. package/dist/tools/loop-skill-hint.d.ts.map +1 -1
  188. package/dist/tools/loop-skill-hint.js +274 -5
  189. package/dist/tools/loop-skill-hint.js.map +1 -1
  190. package/dist/tools/plan-store.d.ts +104 -3
  191. package/dist/tools/plan-store.d.ts.map +1 -1
  192. package/dist/tools/plan-store.js +250 -6
  193. package/dist/tools/plan-store.js.map +1 -1
  194. package/dist/tools/read-extract.d.ts +9 -3
  195. package/dist/tools/read-extract.d.ts.map +1 -1
  196. package/dist/tools/read-extract.js +70 -25
  197. package/dist/tools/read-extract.js.map +1 -1
  198. package/dist/tools/registry.d.ts +20 -1
  199. package/dist/tools/registry.d.ts.map +1 -1
  200. package/dist/tools/registry.js +17 -4
  201. package/dist/tools/registry.js.map +1 -1
  202. package/dist/tools/run-terminal.d.ts.map +1 -1
  203. package/dist/tools/run-terminal.js +34 -0
  204. package/dist/tools/run-terminal.js.map +1 -1
  205. package/dist/tools/tool-loop.d.ts +149 -0
  206. package/dist/tools/tool-loop.d.ts.map +1 -1
  207. package/dist/tools/tool-loop.js +706 -13
  208. package/dist/tools/tool-loop.js.map +1 -1
  209. package/dist/utils/effect-verification.js +1 -1
  210. package/dist/utils/effect-verification.js.map +1 -1
  211. package/dist/web-dashboard/attachment-extract.d.ts +8 -1
  212. package/dist/web-dashboard/attachment-extract.d.ts.map +1 -1
  213. package/dist/web-dashboard/attachment-extract.js +14 -3
  214. package/dist/web-dashboard/attachment-extract.js.map +1 -1
  215. package/dist/web-dashboard/chat-console.d.ts +21 -1
  216. package/dist/web-dashboard/chat-console.d.ts.map +1 -1
  217. package/dist/web-dashboard/chat-console.js +33 -5
  218. package/dist/web-dashboard/chat-console.js.map +1 -1
  219. package/dist/web-dashboard/server.d.ts.map +1 -1
  220. package/dist/web-dashboard/server.js +198 -21
  221. package/dist/web-dashboard/server.js.map +1 -1
  222. package/dist/web-dashboard/src/types.d.ts +97 -0
  223. package/dist/web-dashboard/src/types.d.ts.map +1 -1
  224. package/dist/web-dashboard/workspace-guard.d.ts.map +1 -1
  225. package/dist/web-dashboard/workspace-guard.js +44 -4
  226. package/dist/web-dashboard/workspace-guard.js.map +1 -1
  227. package/package.json +4 -1
  228. package/src/web-dashboard/public/assets/index-BrZcYhy6.js +207 -0
  229. package/src/web-dashboard/public/assets/index-BrZcYhy6.js.map +1 -0
  230. package/src/web-dashboard/public/assets/index-DsWczTa6.css +1 -0
  231. package/src/web-dashboard/public/index.html +2 -2
  232. package/src/web-dashboard/public/assets/index-Beportyl.js +0 -207
  233. package/src/web-dashboard/public/assets/index-Beportyl.js.map +0 -1
  234. package/src/web-dashboard/public/assets/index-gtQyg9nm.css +0 -1
@@ -0,0 +1,122 @@
1
+ /**
2
+ * Capability mode — the one switch that decides how much the agent spends on
3
+ * REASONING versus how much it saves.
4
+ *
5
+ * The product decision behind it: an agent is judged on whether it DELIVERS on
6
+ * the ask, with depth, and navigates its own failures — and a single bad
7
+ * experience is enough to lose a user. Cost-saving that produces a weak, nagging
8
+ * agent is a false economy. But cost is real, so the user owns the trade:
9
+ *
10
+ * - `balanced` (DEFAULT) — the agent uses the best model available for
11
+ * COMPLEX/CRITICAL work, cheaper models for simple/moderate work, and
12
+ * escalates when it detects a real stall. This is the recommended default:
13
+ * ~most of the reliability at a fraction of the cost.
14
+ * - `max` — cost is not a concern. Every turn routes to the strongest
15
+ * available model, paid models are always allowed, cost ceilings are lifted,
16
+ * and the loop is given the longest reasoning budget. This is "let the agent
17
+ * act with full depth, whatever it costs."
18
+ *
19
+ * What it deliberately does NOT change: every deterministic SAFETY invariant
20
+ * (deny-first commands, the workspace boundary, the git gates, effect
21
+ * verification). A model must never decide what is destructive, in either mode —
22
+ * so this switch can widen AUTONOMY and MODEL QUALITY, never the safety surface.
23
+ *
24
+ * Resolution order (highest wins): the process environment (`NUVIRA_CAPABILITY_MODE`
25
+ * or the legacy `BUFF_CAPABILITY_MODE`), then `routing.capabilityMode` in the
26
+ * config file, then the default. Read fresh on every turn, so a change applies to
27
+ * the next turn without a restart — the same rule the size limits follow.
28
+ */
29
+ import type { ConfigManager } from './manager.js';
30
+ import type { ReasoningEffort } from './types.js';
31
+ /** The two modes. `balanced` is the default; `max` ignores cost. */
32
+ export type CapabilityMode = 'balanced' | 'max';
33
+ /**
34
+ * `max` mode's model-level REASONING floor — the difference between "prefer
35
+ * strong" (a scoring nudge that a cheap-but-strong-enough model can still win)
36
+ * and "require strong" (a hard eligibility gate). This is what makes the max
37
+ * promise checkable: candidates whose SERVED model scores below it are
38
+ * eliminated.
39
+ *
40
+ * 0.7 is the same calibration the router already trusts for the asks that must
41
+ * not be served by a weak model (effect-observing `verification`/`debugging`,
42
+ * and `planning`): it drops stacked fast-lite ids (`…-flash-lite` ≈ 0.65) and
43
+ * small models, while keeping a 70B id (≈ 0.80), a single `-flash` id (≈ 0.75)
44
+ * and frontier-family ids. It is NEVER a dead-end — the router's benign
45
+ * fallback restores the full ranking when the floor would eliminate everyone,
46
+ * so a deployment whose only credentialed provider is weak still gets served.
47
+ */
48
+ export declare const MAX_CAPABILITY_MIN_REASONING = 0.7;
49
+ /**
50
+ * The reasoning depth `max` requests from a routed model, when that model is
51
+ * verified to accept a reasoning-effort parameter. `high` is the strongest
52
+ * value the OpenAI-compatible family accepts, and the largest thinking budget
53
+ * for the native families — i.e. "as much as this model will give."
54
+ */
55
+ export declare const MAX_CAPABILITY_REASONING_EFFORT: ReasoningEffort;
56
+ /** The default when nothing is configured. */
57
+ export declare const DEFAULT_CAPABILITY_MODE: CapabilityMode;
58
+ /**
59
+ * Parse a raw value into a mode. Accepts the two canonical names plus the
60
+ * intuitive synonyms a user might type, so a typo cannot silently leave the
61
+ * agent on the cheaper mode when the user asked for maximum depth:
62
+ * - `max` / `maximum` / `unlimited` / `performance` / `performance-first` → 'max'
63
+ * - `balanced` / `balance` / `default` → 'balanced'
64
+ * Returns null for anything unrecognized (the caller then falls through to the
65
+ * next source rather than guessing).
66
+ */
67
+ export declare function parseCapabilityMode(raw: string | undefined | null): CapabilityMode | null;
68
+ /**
69
+ * The effective capability mode for this process.
70
+ *
71
+ * Reads the environment first (a shell export wins over the file, exactly like
72
+ * every other process switch), then the config file, then the default. Pure and
73
+ * never throws — a config read failure falls back to the default rather than
74
+ * breaking a turn.
75
+ */
76
+ export declare function resolveCapabilityMode(cm?: ConfigManager): CapabilityMode;
77
+ /** True when the user has asked for maximum capability (cost is not a concern). */
78
+ export declare function isMaxCapability(cm?: ConfigManager): boolean;
79
+ /**
80
+ * The routing knobs a capability mode implies — the SINGLE mapping consumed by
81
+ * the resolve-options assembly, so every entry point (chat, execute, orchestrator)
82
+ * reads the mode the same way and no surface gets a degraded routing experience.
83
+ *
84
+ * `balanced` leaves every knob untouched (`undefined` = "use the configured
85
+ * value"), so the existing behaviour is byte-identical when the mode is default.
86
+ * `max` applies the cost-relaxing overrides:
87
+ * - `preferenceMode: 'performance-first'` — the router stops preferring cheap
88
+ * candidates and scores on capability;
89
+ * - `allowPaid: true` — paid/high-capacity models are always eligible, even
90
+ * for simple tasks;
91
+ * - `maxCostUsd: undefined` — no per-call cost ceiling;
92
+ * - `minReasoning: MAX_CAPABILITY_MIN_REASONING` — require a strong served
93
+ * model (see the constant), so "max" cannot be satisfied by a cheap, weak
94
+ * model that merely happens to be allowed.
95
+ */
96
+ export interface CapabilityRoutingPolicy {
97
+ preferenceMode?: 'balanced' | 'performance-first';
98
+ allowPaid?: boolean;
99
+ maxCostUsd?: number;
100
+ /** Served-model reasoning floor (0–1); candidates below it are eliminated. */
101
+ minReasoning?: number;
102
+ /**
103
+ * Provider-neutral request for more reasoning depth, applied at the adapter
104
+ * boundary ONLY when the routed provider × model has been verified to accept
105
+ * the corresponding parameter (default-deny; see reasoning-effort.ts).
106
+ * `balanced` leaves this undefined (no request-side change at all); `max`
107
+ * asks for the strongest reasoning a model supports. This is the ceiling the
108
+ * routing floor alone cannot raise: a floor PICKS a strong model, this asks
109
+ * that model to THINK harder.
110
+ */
111
+ reasoningEffort?: ReasoningEffort;
112
+ }
113
+ /**
114
+ * The reasoning depth the current capability mode asks for, or `undefined`
115
+ * when the mode does not request one (`balanced`). Convenience over
116
+ * `capabilityRoutingPolicy(resolveCapabilityMode(cm))` for call sites that
117
+ * only need this one knob. Reading it is cheap and never throws.
118
+ */
119
+ export declare function capabilityReasoningEffort(cm?: ConfigManager): ReasoningEffort | undefined;
120
+ /** The routing policy for a mode. `balanced` returns an empty object (no overrides). */
121
+ export declare function capabilityRoutingPolicy(mode: CapabilityMode): CapabilityRoutingPolicy;
122
+ //# sourceMappingURL=capability-mode.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-mode.d.ts","sourceRoot":"","sources":["../../src/config/capability-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAEH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElD,oEAAoE;AACpE,MAAM,MAAM,cAAc,GAAG,UAAU,GAAG,KAAK,CAAC;AAEhD;;;;;;;;;;;;;;GAcG;AACH,eAAO,MAAM,4BAA4B,MAAM,CAAC;AAEhD;;;;;GAKG;AACH,eAAO,MAAM,+BAA+B,EAAE,eAAwB,CAAC;AAEvE,8CAA8C;AAC9C,eAAO,MAAM,uBAAuB,EAAE,cAA2B,CAAC;AAKlE;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,cAAc,GAAG,IAAI,CAQzF;AAED;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,CAAC,EAAE,aAAa,GAAG,cAAc,CAaxE;AAED,mFAAmF;AACnF,wBAAgB,eAAe,CAAC,EAAE,CAAC,EAAE,aAAa,GAAG,OAAO,CAE3D;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,WAAW,uBAAuB;IACtC,cAAc,CAAC,EAAE,UAAU,GAAG,mBAAmB,CAAC;IAClD,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,8EAA8E;IAC9E,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;;;;;;;OAQG;IACH,eAAe,CAAC,EAAE,eAAe,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,EAAE,CAAC,EAAE,aAAa,GAAG,eAAe,GAAG,SAAS,CAEzF;AAED,wFAAwF;AACxF,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,cAAc,GAAG,uBAAuB,CAgBrF"}
@@ -0,0 +1,132 @@
1
+ /**
2
+ * Capability mode — the one switch that decides how much the agent spends on
3
+ * REASONING versus how much it saves.
4
+ *
5
+ * The product decision behind it: an agent is judged on whether it DELIVERS on
6
+ * the ask, with depth, and navigates its own failures — and a single bad
7
+ * experience is enough to lose a user. Cost-saving that produces a weak, nagging
8
+ * agent is a false economy. But cost is real, so the user owns the trade:
9
+ *
10
+ * - `balanced` (DEFAULT) — the agent uses the best model available for
11
+ * COMPLEX/CRITICAL work, cheaper models for simple/moderate work, and
12
+ * escalates when it detects a real stall. This is the recommended default:
13
+ * ~most of the reliability at a fraction of the cost.
14
+ * - `max` — cost is not a concern. Every turn routes to the strongest
15
+ * available model, paid models are always allowed, cost ceilings are lifted,
16
+ * and the loop is given the longest reasoning budget. This is "let the agent
17
+ * act with full depth, whatever it costs."
18
+ *
19
+ * What it deliberately does NOT change: every deterministic SAFETY invariant
20
+ * (deny-first commands, the workspace boundary, the git gates, effect
21
+ * verification). A model must never decide what is destructive, in either mode —
22
+ * so this switch can widen AUTONOMY and MODEL QUALITY, never the safety surface.
23
+ *
24
+ * Resolution order (highest wins): the process environment (`NUVIRA_CAPABILITY_MODE`
25
+ * or the legacy `BUFF_CAPABILITY_MODE`), then `routing.capabilityMode` in the
26
+ * config file, then the default. Read fresh on every turn, so a change applies to
27
+ * the next turn without a restart — the same rule the size limits follow.
28
+ */
29
+ /**
30
+ * `max` mode's model-level REASONING floor — the difference between "prefer
31
+ * strong" (a scoring nudge that a cheap-but-strong-enough model can still win)
32
+ * and "require strong" (a hard eligibility gate). This is what makes the max
33
+ * promise checkable: candidates whose SERVED model scores below it are
34
+ * eliminated.
35
+ *
36
+ * 0.7 is the same calibration the router already trusts for the asks that must
37
+ * not be served by a weak model (effect-observing `verification`/`debugging`,
38
+ * and `planning`): it drops stacked fast-lite ids (`…-flash-lite` ≈ 0.65) and
39
+ * small models, while keeping a 70B id (≈ 0.80), a single `-flash` id (≈ 0.75)
40
+ * and frontier-family ids. It is NEVER a dead-end — the router's benign
41
+ * fallback restores the full ranking when the floor would eliminate everyone,
42
+ * so a deployment whose only credentialed provider is weak still gets served.
43
+ */
44
+ export const MAX_CAPABILITY_MIN_REASONING = 0.7;
45
+ /**
46
+ * The reasoning depth `max` requests from a routed model, when that model is
47
+ * verified to accept a reasoning-effort parameter. `high` is the strongest
48
+ * value the OpenAI-compatible family accepts, and the largest thinking budget
49
+ * for the native families — i.e. "as much as this model will give."
50
+ */
51
+ export const MAX_CAPABILITY_REASONING_EFFORT = 'high';
52
+ /** The default when nothing is configured. */
53
+ export const DEFAULT_CAPABILITY_MODE = 'balanced';
54
+ /** Env names, `NUVIRA_*` first with the legacy `BUFF_*` alias accepted. */
55
+ const ENV_NAMES = ['NUVIRA_CAPABILITY_MODE', 'BUFF_CAPABILITY_MODE'];
56
+ /**
57
+ * Parse a raw value into a mode. Accepts the two canonical names plus the
58
+ * intuitive synonyms a user might type, so a typo cannot silently leave the
59
+ * agent on the cheaper mode when the user asked for maximum depth:
60
+ * - `max` / `maximum` / `unlimited` / `performance` / `performance-first` → 'max'
61
+ * - `balanced` / `balance` / `default` → 'balanced'
62
+ * Returns null for anything unrecognized (the caller then falls through to the
63
+ * next source rather than guessing).
64
+ */
65
+ export function parseCapabilityMode(raw) {
66
+ const v = String(raw ?? '').trim().toLowerCase();
67
+ if (!v)
68
+ return null;
69
+ if (v === 'max' || v === 'maximum' || v === 'unlimited' || v === 'performance' || v === 'performance-first') {
70
+ return 'max';
71
+ }
72
+ if (v === 'balanced' || v === 'balance' || v === 'default')
73
+ return 'balanced';
74
+ return null;
75
+ }
76
+ /**
77
+ * The effective capability mode for this process.
78
+ *
79
+ * Reads the environment first (a shell export wins over the file, exactly like
80
+ * every other process switch), then the config file, then the default. Pure and
81
+ * never throws — a config read failure falls back to the default rather than
82
+ * breaking a turn.
83
+ */
84
+ export function resolveCapabilityMode(cm) {
85
+ for (const name of ENV_NAMES) {
86
+ const parsed = parseCapabilityMode(process.env[name]);
87
+ if (parsed)
88
+ return parsed;
89
+ }
90
+ try {
91
+ const routing = cm?.getAll?.()?.routing;
92
+ const parsed = parseCapabilityMode(typeof routing?.capabilityMode === 'string' ? routing.capabilityMode : undefined);
93
+ if (parsed)
94
+ return parsed;
95
+ }
96
+ catch {
97
+ // Best-effort — a config failure must not break routing.
98
+ }
99
+ return DEFAULT_CAPABILITY_MODE;
100
+ }
101
+ /** True when the user has asked for maximum capability (cost is not a concern). */
102
+ export function isMaxCapability(cm) {
103
+ return resolveCapabilityMode(cm) === 'max';
104
+ }
105
+ /**
106
+ * The reasoning depth the current capability mode asks for, or `undefined`
107
+ * when the mode does not request one (`balanced`). Convenience over
108
+ * `capabilityRoutingPolicy(resolveCapabilityMode(cm))` for call sites that
109
+ * only need this one knob. Reading it is cheap and never throws.
110
+ */
111
+ export function capabilityReasoningEffort(cm) {
112
+ return capabilityRoutingPolicy(resolveCapabilityMode(cm)).reasoningEffort;
113
+ }
114
+ /** The routing policy for a mode. `balanced` returns an empty object (no overrides). */
115
+ export function capabilityRoutingPolicy(mode) {
116
+ if (mode === 'max') {
117
+ return {
118
+ preferenceMode: 'performance-first',
119
+ allowPaid: true,
120
+ maxCostUsd: undefined,
121
+ // Not just "prefer capability" — require it. A paid-but-weak model must
122
+ // not satisfy a mode whose whole promise is "the strongest model."
123
+ minReasoning: MAX_CAPABILITY_MIN_REASONING,
124
+ // And having PICKED a strong model, ask it to reason deeply. Gated
125
+ // per-model (default-deny) so this can never break a model that lacks the
126
+ // parameter. See reasoning-effort.ts.
127
+ reasoningEffort: MAX_CAPABILITY_REASONING_EFFORT,
128
+ };
129
+ }
130
+ return {};
131
+ }
132
+ //# sourceMappingURL=capability-mode.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"capability-mode.js","sourceRoot":"","sources":["../../src/config/capability-mode.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAQH;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,GAAG,CAAC;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,MAAM,+BAA+B,GAAoB,MAAM,CAAC;AAEvE,8CAA8C;AAC9C,MAAM,CAAC,MAAM,uBAAuB,GAAmB,UAAU,CAAC;AAElE,2EAA2E;AAC3E,MAAM,SAAS,GAAG,CAAC,wBAAwB,EAAE,sBAAsB,CAAC,CAAC;AAErE;;;;;;;;GAQG;AACH,MAAM,UAAU,mBAAmB,CAAC,GAA8B;IAChE,MAAM,CAAC,GAAG,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACjD,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC,KAAK,KAAK,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,WAAW,IAAI,CAAC,KAAK,aAAa,IAAI,CAAC,KAAK,mBAAmB,EAAE,CAAC;QAC5G,OAAO,KAAK,CAAC;IACf,CAAC;IACD,IAAI,CAAC,KAAK,UAAU,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;QAAE,OAAO,UAAU,CAAC;IAC9E,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,qBAAqB,CAAC,EAAkB;IACtD,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;QACtD,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAmD,CAAC;QACpF,MAAM,MAAM,GAAG,mBAAmB,CAAC,OAAO,OAAO,EAAE,cAAc,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;QACrH,IAAI,MAAM;YAAE,OAAO,MAAM,CAAC;IAC5B,CAAC;IAAC,MAAM,CAAC;QACP,yDAAyD;IAC3D,CAAC;IACD,OAAO,uBAAuB,CAAC;AACjC,CAAC;AAED,mFAAmF;AACnF,MAAM,UAAU,eAAe,CAAC,EAAkB;IAChD,OAAO,qBAAqB,CAAC,EAAE,CAAC,KAAK,KAAK,CAAC;AAC7C,CAAC;AAqCD;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB,CAAC,EAAkB;IAC1D,OAAO,uBAAuB,CAAC,qBAAqB,CAAC,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC;AAC5E,CAAC;AAED,wFAAwF;AACxF,MAAM,UAAU,uBAAuB,CAAC,IAAoB;IAC1D,IAAI,IAAI,KAAK,KAAK,EAAE,CAAC;QACnB,OAAO;YACL,cAAc,EAAE,mBAAmB;YACnC,SAAS,EAAE,IAAI;YACf,UAAU,EAAE,SAAS;YACrB,wEAAwE;YACxE,mEAAmE;YACnE,YAAY,EAAE,4BAA4B;YAC1C,mEAAmE;YACnE,0EAA0E;YAC1E,sCAAsC;YACtC,eAAe,EAAE,+BAA+B;SACjD,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC"}
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Configurable size limits — how much text one read may carry into a turn.
3
+ *
4
+ * Two limits used to be hardcoded constants that a user could not move:
5
+ *
6
+ * - `read_extract` capped one extraction at 40,000 characters. A 66,021-char
7
+ * lab report was therefore read only in part, and — worse — the truncation
8
+ * was reported in `metadata.truncated` but NOT in the text, so the model
9
+ * could (and did) assess half a document as if it were the whole one.
10
+ * - the dashboard composer refused any attachment over 300 KB. A project file
11
+ * larger than that had no route in at all.
12
+ *
13
+ * Both are now read from the environment on every call (so a change takes effect
14
+ * on the NEXT turn, and a value exported in a shell wins over the file, exactly
15
+ * like every other process switch), with the historical values as the defaults.
16
+ * The readers are pure and never throw: a malformed value falls back to the
17
+ * default rather than breaking a read.
18
+ *
19
+ * Names are `NUVIRA_*`; the `BUFF_*` aliases are accepted for compatibility.
20
+ */
21
+ /** The historical `read_extract` cap, in characters. */
22
+ export declare const DEFAULT_EXTRACT_MAX_CHARS = 40000;
23
+ /** The historical dashboard attachment cap, in bytes (~300 KB). */
24
+ export declare const DEFAULT_ATTACHMENT_MAX_BYTES = 300000;
25
+ /**
26
+ * A sane upper bound, so a typo cannot ask for a gigabyte of extraction text and
27
+ * take the process out. 8M characters is ~2M tokens — already far past any
28
+ * model's window, so this only ever bites a mistake.
29
+ */
30
+ export declare const MAX_EXTRACT_MAX_CHARS_CEILING = 8000000;
31
+ /** Ceiling on the attachment cap, in bytes (256 MB). */
32
+ export declare const MAX_ATTACHMENT_MAX_BYTES_CEILING: number;
33
+ /**
34
+ * The character budget for one `read_extract` call.
35
+ *
36
+ * Read fresh on every call, so setting the env var (from the dashboard's Process
37
+ * Environment page, the CLI, or a shell export) applies to the next read without
38
+ * a restart.
39
+ */
40
+ export declare function resolveExtractMaxChars(): number;
41
+ /**
42
+ * The size cap for one composer attachment, in bytes.
43
+ *
44
+ * Read fresh on every hydration, so raising it takes effect on the next turn.
45
+ */
46
+ export declare function resolveAttachmentMaxBytes(): number;
47
+ //# sourceMappingURL=limits.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.d.ts","sourceRoot":"","sources":["../../src/config/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,wDAAwD;AACxD,eAAO,MAAM,yBAAyB,QAAS,CAAC;AAEhD,mEAAmE;AACnE,eAAO,MAAM,4BAA4B,SAAU,CAAC;AAEpD;;;;GAIG;AACH,eAAO,MAAM,6BAA6B,UAAY,CAAC;AAEvD,wDAAwD;AACxD,eAAO,MAAM,gCAAgC,QAAoB,CAAC;AAclE;;;;;;GAMG;AACH,wBAAgB,sBAAsB,IAAI,MAAM,CAO/C;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAOlD"}
@@ -0,0 +1,64 @@
1
+ /**
2
+ * Configurable size limits — how much text one read may carry into a turn.
3
+ *
4
+ * Two limits used to be hardcoded constants that a user could not move:
5
+ *
6
+ * - `read_extract` capped one extraction at 40,000 characters. A 66,021-char
7
+ * lab report was therefore read only in part, and — worse — the truncation
8
+ * was reported in `metadata.truncated` but NOT in the text, so the model
9
+ * could (and did) assess half a document as if it were the whole one.
10
+ * - the dashboard composer refused any attachment over 300 KB. A project file
11
+ * larger than that had no route in at all.
12
+ *
13
+ * Both are now read from the environment on every call (so a change takes effect
14
+ * on the NEXT turn, and a value exported in a shell wins over the file, exactly
15
+ * like every other process switch), with the historical values as the defaults.
16
+ * The readers are pure and never throw: a malformed value falls back to the
17
+ * default rather than breaking a read.
18
+ *
19
+ * Names are `NUVIRA_*`; the `BUFF_*` aliases are accepted for compatibility.
20
+ */
21
+ /** The historical `read_extract` cap, in characters. */
22
+ export const DEFAULT_EXTRACT_MAX_CHARS = 40_000;
23
+ /** The historical dashboard attachment cap, in bytes (~300 KB). */
24
+ export const DEFAULT_ATTACHMENT_MAX_BYTES = 300_000;
25
+ /**
26
+ * A sane upper bound, so a typo cannot ask for a gigabyte of extraction text and
27
+ * take the process out. 8M characters is ~2M tokens — already far past any
28
+ * model's window, so this only ever bites a mistake.
29
+ */
30
+ export const MAX_EXTRACT_MAX_CHARS_CEILING = 8_000_000;
31
+ /** Ceiling on the attachment cap, in bytes (256 MB). */
32
+ export const MAX_ATTACHMENT_MAX_BYTES_CEILING = 256 * 1024 * 1024;
33
+ /** Read an integer from the environment, falling back to `fallback` on anything invalid. */
34
+ function intFromEnv(names, fallback, min, max) {
35
+ for (const name of names) {
36
+ const raw = process.env[name];
37
+ if (raw === undefined || raw.trim() === '')
38
+ continue;
39
+ const n = Number(raw.trim());
40
+ if (!Number.isFinite(n) || !Number.isInteger(n) || n < min)
41
+ continue;
42
+ return Math.min(n, max);
43
+ }
44
+ return fallback;
45
+ }
46
+ /**
47
+ * The character budget for one `read_extract` call.
48
+ *
49
+ * Read fresh on every call, so setting the env var (from the dashboard's Process
50
+ * Environment page, the CLI, or a shell export) applies to the next read without
51
+ * a restart.
52
+ */
53
+ export function resolveExtractMaxChars() {
54
+ return intFromEnv(['NUVIRA_EXTRACT_MAX_CHARS', 'BUFF_EXTRACT_MAX_CHARS'], DEFAULT_EXTRACT_MAX_CHARS, 1, MAX_EXTRACT_MAX_CHARS_CEILING);
55
+ }
56
+ /**
57
+ * The size cap for one composer attachment, in bytes.
58
+ *
59
+ * Read fresh on every hydration, so raising it takes effect on the next turn.
60
+ */
61
+ export function resolveAttachmentMaxBytes() {
62
+ return intFromEnv(['NUVIRA_ATTACHMENT_MAX_BYTES', 'BUFF_ATTACHMENT_MAX_BYTES'], DEFAULT_ATTACHMENT_MAX_BYTES, 1, MAX_ATTACHMENT_MAX_BYTES_CEILING);
63
+ }
64
+ //# sourceMappingURL=limits.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"limits.js","sourceRoot":"","sources":["../../src/config/limits.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,wDAAwD;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAEhD,mEAAmE;AACnE,MAAM,CAAC,MAAM,4BAA4B,GAAG,OAAO,CAAC;AAEpD;;;;GAIG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAG,SAAS,CAAC;AAEvD,wDAAwD;AACxD,MAAM,CAAC,MAAM,gCAAgC,GAAG,GAAG,GAAG,IAAI,GAAG,IAAI,CAAC;AAElE,4FA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AAS,iBAAiB,EAwKxD,CAAC;AAEF,wCAAwC;AACxC,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,GAAG,iBAAiB,GAAG,SAAS,CAE7E;AAED;;;;;;GAMG;AACH,wBAAgB,sBAAsB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE5D;AAMD,wEAAwE;AACxE,MAAM,MAAM,oBAAoB,GAAG,cAAc,GAAG,OAAO,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,CAAC;AAEtG,0EAA0E;AAC1E,eAAO,MAAM,2BAA2B,MAAM,CAAC;AAE/C;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,GACV;IAAE,EAAE,EAAE,IAAI,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,EAAE,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,oBAAoB,CAAA;CAAE,CAoB3E;AAED;;;;;;GAMG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,kBAAkB,GAAG,SAAS,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAkBtG"}
@@ -84,6 +84,50 @@ export const PROCESS_ENV_VARS = [
84
84
  unsetMeans: 'Semantic recall is ON (the default). This switch turns it off.',
85
85
  cliEquivalent: 'nuvira execute --no-session-recall · memory.sessionRecall in buffconfig.json',
86
86
  },
87
+ {
88
+ name: 'NUVIRA_EXTRACT_MAX_CHARS',
89
+ label: 'Document extraction budget',
90
+ group: 'turn',
91
+ kind: 'text',
92
+ placeholder: '40000',
93
+ valueLabel: 'Save',
94
+ description: 'How many characters one read_extract call may return. A document larger than this is read only in part, and the truncation is stated in the returned text. Raise it to read a large report in one pass (up to 8,000,000).',
95
+ unsetMeans: '40,000 characters — about 10,000 words.',
96
+ cliEquivalent: 'nuvira config limit set extract-max-chars <n> · NUVIRA_EXTRACT_MAX_CHARS',
97
+ },
98
+ {
99
+ name: 'NUVIRA_ATTACHMENT_MAX_BYTES',
100
+ label: 'Attachment size cap (bytes)',
101
+ group: 'turn',
102
+ kind: 'text',
103
+ placeholder: '300000',
104
+ valueLabel: 'Save',
105
+ description: 'The largest single file the dashboard composer will accept, in bytes. A file over this cap is refused before it is sent. Raise it for a project file larger than ~300 KB (up to 268435456 = 256 MB).',
106
+ unsetMeans: '300,000 bytes (~293 KB) per attachment, 10 attachments per turn.',
107
+ cliEquivalent: 'nuvira config limit set attachment-max-kb <n> · NUVIRA_ATTACHMENT_MAX_BYTES',
108
+ },
109
+ {
110
+ name: 'NUVIRA_CAPABILITY_MODE',
111
+ label: 'Capability mode',
112
+ group: 'turn',
113
+ kind: 'text',
114
+ placeholder: 'balanced',
115
+ valueLabel: 'Save',
116
+ description: 'How much the agent spends on REASONING versus how much it saves. balanced (default): the best model for complex/critical work, cheaper models for simple work, and escalation when a stall is detected. max: cost is not a concern — every turn routes to the strongest model (a reasoning floor requires a strong served model, not merely a paid one), paid models are always allowed, cost ceilings are lifted, and the loop gets its longest reasoning budget.',
117
+ unsetMeans: 'balanced — the recommended default.',
118
+ cliEquivalent: 'nuvira config capability set <balanced|max> · NUVIRA_CAPABILITY_MODE',
119
+ },
120
+ {
121
+ name: 'NUVIRA_WORK_DIGEST',
122
+ label: 'Work digest scope',
123
+ group: 'turn',
124
+ kind: 'text',
125
+ placeholder: 'all',
126
+ valueLabel: 'Save',
127
+ description: 'When the loop compacts a long turn\'s context, it can keep a short digest of what the turn has done (files changed, commands and whether they passed, tools used). all (default): always keep the digest. max: only under the max capability mode. off: never.',
128
+ unsetMeans: 'all — the digest is kept in every mode.',
129
+ cliEquivalent: 'NUVIRA_WORK_DIGEST=all|max|off',
130
+ },
87
131
  {
88
132
  name: 'NUVIRA_STRICT_MODEL',
89
133
  label: 'Refuse model substitution',
@@ -1 +1 @@
1
- {"version":3,"file":"process-env.js","sourceRoot":"","sources":["../../src/config/process-env.ts"],"names":[],"mappings":"AAAA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E,uEAAuE;YACvE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC"}
@@ -445,6 +445,51 @@ export interface RoutingConfig {
445
445
  * served across a mode switch.
446
446
  */
447
447
  preferenceMode?: 'balanced' | 'performance-first' | 'cost-first' | 'privacy-first';
448
+ /**
449
+ * Capability mode — how much the agent spends on REASONING versus how much it
450
+ * saves. 'balanced' (default): the best model for complex/critical work,
451
+ * cheaper models for simple work, escalation on a detected stall. 'max': cost
452
+ * is not a concern — every turn routes to the strongest available model, paid
453
+ * models are always allowed, and cost ceilings are lifted. Set via
454
+ * `nuvira config capability <balanced|max>` or `NUVIRA_CAPABILITY_MODE`. The
455
+ * mode only ever widens MODEL QUALITY and AUTONOMY; every deterministic safety
456
+ * invariant (deny-first commands, workspace boundary, git gates) is unchanged.
457
+ * Resolution: env var, then this config value, then the default ('balanced').
458
+ */
459
+ capabilityMode?: 'balanced' | 'max';
460
+ /**
461
+ * When the loop's within-turn WORK DIGEST is injected on thread compaction.
462
+ * 'all' (default) — always keep a digest of what the turn did; 'max' — only
463
+ * under the `max` capability mode; 'off' — never. Set via
464
+ * `NUVIRA_WORK_DIGEST` or this value. Resolution: env, then config, then
465
+ * 'all'. See `src/config/work-digest.ts`.
466
+ */
467
+ workDigest?: 'all' | 'max' | 'off';
468
+ /**
469
+ * Weak-model consent for surfaces that CANNOT ask (gateway channels,
470
+ * headless/CI). The explicit per-session ask is the primary mechanism on
471
+ * every interactive surface; this value only governs the non-interactive
472
+ * fallback. 'ask' (default) — never silently use a weak model: fail over to
473
+ * a capable one or abort honestly. 'auto-allow' — proceed on the weak model
474
+ * and record the verdict. 'deny' — never use a weak model. Set via
475
+ * `NUVIRA_WEAK_MODEL_POLICY` or this value. Resolution: env, then config,
476
+ * then 'ask'. See `src/learning/agentic-route-gate.ts`.
477
+ */
478
+ weakModelPolicy?: 'ask' | 'auto-allow' | 'deny';
479
+ /**
480
+ * Outbound CONTEXT budget (chars): measurement thresholds + hard ceiling for
481
+ * the assembled prompt. Overrides `DEFAULT_CONTEXT_BUDGET` in
482
+ * `src/learning/context-budget.ts` per key. When the total exceeds the
483
+ * ceiling, optional contributors are dropped lowest-value-first (skill hint →
484
+ * work digest → recall → …); the identity/tool contract is never trimmed.
485
+ */
486
+ promptBudget?: {
487
+ noteTotal?: number;
488
+ warnTotal?: number;
489
+ maxTotal?: number;
490
+ noteSystem?: number;
491
+ warnSystem?: number;
492
+ };
448
493
  }
449
494
  /**
450
495
  * Full configuration schema for .nuviraconfig.json
@@ -567,6 +612,17 @@ export interface SkillsConfig {
567
612
  * override (or the built-in default) is used.
568
613
  */
569
614
  registries?: string[];
615
+ /**
616
+ * Which skill hint the chat/execute system prompt carries. See
617
+ * `resolveSkillHintMode` in `src/tools/loop-skill-hint.ts`.
618
+ * - `match` (DEFAULT) — the small keyword-matched hint: ONE skill, only when
619
+ * the goal actually matches, else nothing. 3.3.10 behaviour.
620
+ * - `catalog` — the full name+description catalog (opt-in; ~24K chars).
621
+ * - `names` — the catalog WITHOUT descriptions (names only; a fraction of
622
+ * `catalog`; the model can still load one by name).
623
+ * - `off` — never inject a skill hint.
624
+ */
625
+ catalogHint?: string;
570
626
  }
571
627
  /**
572
628
  * Modality configuration — backend selection for image generation (and, in
@@ -652,11 +708,68 @@ export interface ToolHookConfig {
652
708
  /** A name for this hook, used in the report when it vetoes or fails. */
653
709
  label?: string;
654
710
  }
711
+ /**
712
+ * How much EXTRA reasoning to ask a model for, in provider-neutral terms.
713
+ *
714
+ * This is INTENT, not a wire value. Each adapter translates it into whatever
715
+ * its provider actually accepts (`reasoning_effort` for the OpenAI-compatible
716
+ * family, an extended-thinking budget for Anthropic, a thinking budget for
717
+ * Gemini). A provider that has no such knob simply ignores it — the value is
718
+ * always optional and never required for a call to succeed.
719
+ *
720
+ * Defined here (the config layer) rather than in the inference layer so both
721
+ * the capability policy and the adapters can name it without an import cycle.
722
+ */
723
+ export type ReasoningEffort = 'low' | 'medium' | 'high';
724
+ /**
725
+ * The family of wire parameter used to request extra reasoning. The shape is a
726
+ * property of the PROVIDER (how it spells the knob), while whether a given
727
+ * MODEL accepts it is a separate, learned fact (see ModelRegistryEntry.
728
+ * reasoningCapability).
729
+ */
730
+ export type ReasoningShape = 'openai-reasoning-effort' | 'anthropic-thinking' | 'gemini-thinking';
731
+ /**
732
+ * What we have LEARNED about whether one provider × model accepts a
733
+ * reasoning-effort parameter. Absent/`supported:false` means "do not send it"
734
+ * (default-deny): the knob is only ever emitted against positive evidence.
735
+ */
736
+ export interface ReasoningCapability {
737
+ supported: boolean;
738
+ /** The exact wire parameter name (e.g. `reasoning_effort`, `thinking`). */
739
+ param: string;
740
+ /** The wire family, so a caller knows how to build the value. */
741
+ shape: ReasoningShape;
742
+ /** Epoch ms the capability was last established. */
743
+ verifiedAt: number;
744
+ /**
745
+ * How we learned it: the provider ADVERTISED it, a PROBE confirmed it, or a
746
+ * rejected request taught us it is NOT supported (`learned-unsupported`).
747
+ */
748
+ source: 'advertised' | 'probed' | 'learned-unsupported';
749
+ }
655
750
  /**
656
751
  * Inference options passed to each generation call
657
752
  * Note: provider is string to allow plugin-based providers
658
753
  */
659
754
  export interface InferenceOptions {
755
+ /**
756
+ * Request additional reasoning depth from the model, in provider-neutral
757
+ * terms. Set by the routing layer when the capability mode calls for it
758
+ * (`max` → `high`); applied by an adapter ONLY when the registry has verified
759
+ * that the provider × model accepts the corresponding parameter, and retried
760
+ * WITHOUT the parameter if the provider rejects it. Absent → never sent, so
761
+ * the default path is byte-identical to before. See
762
+ * `src/inference/reasoning-effort.ts`.
763
+ */
764
+ reasoningEffort?: ReasoningEffort;
765
+ /**
766
+ * INTERNAL — probe mode. When true, the adapter emits its provider's
767
+ * reasoning parameter UNCONDITIONALLY (bypassing the default-deny registry
768
+ * gate) so a probe can establish whether the model accepts it. The registry
769
+ * is updated from the outcome. Never set by routing; only the model probe
770
+ * sets it. See src/inference/model-probe.ts.
771
+ */
772
+ reasoningProbe?: boolean;
660
773
  model?: string;
661
774
  temperature?: number;
662
775
  maxTokens?: number;