@framers/agentos 0.10.23 → 0.10.25

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 (155) hide show
  1. package/dist/api/AgentOS.d.ts.map +1 -1
  2. package/dist/api/AgentOS.js +3 -2
  3. package/dist/api/AgentOS.js.map +1 -1
  4. package/dist/api/agent.d.ts.map +1 -1
  5. package/dist/api/agent.js +25 -10
  6. package/dist/api/agent.js.map +1 -1
  7. package/dist/api/embedText.d.ts.map +1 -1
  8. package/dist/api/embedText.js +53 -17
  9. package/dist/api/embedText.js.map +1 -1
  10. package/dist/api/generateImage.d.ts.map +1 -1
  11. package/dist/api/generateImage.js +51 -7
  12. package/dist/api/generateImage.js.map +1 -1
  13. package/dist/api/generateText.d.ts +36 -6
  14. package/dist/api/generateText.d.ts.map +1 -1
  15. package/dist/api/generateText.js +102 -17
  16. package/dist/api/generateText.js.map +1 -1
  17. package/dist/api/model.d.ts.map +1 -1
  18. package/dist/api/model.js +11 -4
  19. package/dist/api/model.js.map +1 -1
  20. package/dist/api/runtime/SelfImprovementSessionManager.d.ts +34 -2
  21. package/dist/api/runtime/SelfImprovementSessionManager.d.ts.map +1 -1
  22. package/dist/api/runtime/SelfImprovementSessionManager.js +119 -33
  23. package/dist/api/runtime/SelfImprovementSessionManager.js.map +1 -1
  24. package/dist/api/runtime/provider-defaults.d.ts.map +1 -1
  25. package/dist/api/runtime/provider-defaults.js +5 -2
  26. package/dist/api/runtime/provider-defaults.js.map +1 -1
  27. package/dist/api/streamText.d.ts.map +1 -1
  28. package/dist/api/streamText.js +116 -34
  29. package/dist/api/streamText.js.map +1 -1
  30. package/dist/api/types/AgentOSInput.d.ts +11 -0
  31. package/dist/api/types/AgentOSInput.d.ts.map +1 -1
  32. package/dist/api/types.d.ts +14 -6
  33. package/dist/api/types.d.ts.map +1 -1
  34. package/dist/api/types.js.map +1 -1
  35. package/dist/cognition/emergent/AdaptPersonalityTool.d.ts +13 -4
  36. package/dist/cognition/emergent/AdaptPersonalityTool.d.ts.map +1 -1
  37. package/dist/cognition/emergent/AdaptPersonalityTool.js +32 -23
  38. package/dist/cognition/emergent/AdaptPersonalityTool.js.map +1 -1
  39. package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts +18 -6
  40. package/dist/cognition/emergent/EmergentCapabilityEngine.d.ts.map +1 -1
  41. package/dist/cognition/emergent/EmergentCapabilityEngine.js.map +1 -1
  42. package/dist/cognition/emergent/SelfEvaluateTool.d.ts +10 -3
  43. package/dist/cognition/emergent/SelfEvaluateTool.d.ts.map +1 -1
  44. package/dist/cognition/emergent/SelfEvaluateTool.js +3 -2
  45. package/dist/cognition/emergent/SelfEvaluateTool.js.map +1 -1
  46. package/dist/cognition/substrate/CognitiveMemoryBridge.d.ts +51 -2
  47. package/dist/cognition/substrate/CognitiveMemoryBridge.d.ts.map +1 -1
  48. package/dist/cognition/substrate/CognitiveMemoryBridge.js +84 -2
  49. package/dist/cognition/substrate/CognitiveMemoryBridge.js.map +1 -1
  50. package/dist/cognition/substrate/ConversationHistoryManager.d.ts +8 -4
  51. package/dist/cognition/substrate/ConversationHistoryManager.d.ts.map +1 -1
  52. package/dist/cognition/substrate/ConversationHistoryManager.js +17 -5
  53. package/dist/cognition/substrate/ConversationHistoryManager.js.map +1 -1
  54. package/dist/cognition/substrate/GMI.d.ts +92 -5
  55. package/dist/cognition/substrate/GMI.d.ts.map +1 -1
  56. package/dist/cognition/substrate/GMI.js +291 -65
  57. package/dist/cognition/substrate/GMI.js.map +1 -1
  58. package/dist/cognition/substrate/GMIManager.d.ts +12 -0
  59. package/dist/cognition/substrate/GMIManager.d.ts.map +1 -1
  60. package/dist/cognition/substrate/GMIManager.js +22 -16
  61. package/dist/cognition/substrate/GMIManager.js.map +1 -1
  62. package/dist/cognition/substrate/IGMI.d.ts +23 -0
  63. package/dist/cognition/substrate/IGMI.d.ts.map +1 -1
  64. package/dist/cognition/substrate/IGMI.js.map +1 -1
  65. package/dist/cognition/substrate/MetapromptExecutor.d.ts +183 -28
  66. package/dist/cognition/substrate/MetapromptExecutor.d.ts.map +1 -1
  67. package/dist/cognition/substrate/MetapromptExecutor.js +431 -108
  68. package/dist/cognition/substrate/MetapromptExecutor.js.map +1 -1
  69. package/dist/cognition/substrate/personas/IPersonaDefinition.d.ts +5 -0
  70. package/dist/cognition/substrate/personas/IPersonaDefinition.d.ts.map +1 -1
  71. package/dist/cognition/substrate/personas/PersonaValidation.d.ts.map +1 -1
  72. package/dist/cognition/substrate/personas/PersonaValidation.js +30 -0
  73. package/dist/cognition/substrate/personas/PersonaValidation.js.map +1 -1
  74. package/dist/cognition/substrate/personas/SoulLoader.d.ts +14 -1
  75. package/dist/cognition/substrate/personas/SoulLoader.d.ts.map +1 -1
  76. package/dist/cognition/substrate/personas/SoulLoader.js +45 -12
  77. package/dist/cognition/substrate/personas/SoulLoader.js.map +1 -1
  78. package/dist/cognition/substrate/personas/definitions/default_assistant_persona.json +3 -35
  79. package/dist/cognition/substrate/personas/hexaco.d.ts +34 -0
  80. package/dist/cognition/substrate/personas/hexaco.d.ts.map +1 -0
  81. package/dist/cognition/substrate/personas/hexaco.js +66 -0
  82. package/dist/cognition/substrate/personas/hexaco.js.map +1 -0
  83. package/dist/cognition/substrate/userFeedback.d.ts +69 -0
  84. package/dist/cognition/substrate/userFeedback.d.ts.map +1 -0
  85. package/dist/cognition/substrate/userFeedback.js +107 -0
  86. package/dist/cognition/substrate/userFeedback.js.map +1 -0
  87. package/dist/core/conversation/ConversationMessage.d.ts +9 -0
  88. package/dist/core/conversation/ConversationMessage.d.ts.map +1 -1
  89. package/dist/core/conversation/ConversationMessage.js.map +1 -1
  90. package/dist/core/llm/IPromptEngine.d.ts +9 -0
  91. package/dist/core/llm/IPromptEngine.d.ts.map +1 -1
  92. package/dist/core/llm/IPromptEngine.js.map +1 -1
  93. package/dist/core/llm/PromptEngine.d.ts +30 -1
  94. package/dist/core/llm/PromptEngine.d.ts.map +1 -1
  95. package/dist/core/llm/PromptEngine.js +229 -92
  96. package/dist/core/llm/PromptEngine.js.map +1 -1
  97. package/dist/core/llm/providers/IProvider.d.ts +28 -8
  98. package/dist/core/llm/providers/IProvider.d.ts.map +1 -1
  99. package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts +135 -49
  100. package/dist/core/llm/providers/implementations/AnthropicProvider.d.ts.map +1 -1
  101. package/dist/core/llm/providers/implementations/AnthropicProvider.js +294 -110
  102. package/dist/core/llm/providers/implementations/AnthropicProvider.js.map +1 -1
  103. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.d.ts.map +1 -1
  104. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js +15 -1
  105. package/dist/core/llm/providers/implementations/ClaudeCodeProvider.js.map +1 -1
  106. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts +1 -1
  107. package/dist/core/llm/providers/implementations/GeminiCLIProvider.d.ts.map +1 -1
  108. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js +51 -24
  109. package/dist/core/llm/providers/implementations/GeminiCLIProvider.js.map +1 -1
  110. package/dist/core/llm/providers/implementations/GeminiProvider.d.ts +19 -6
  111. package/dist/core/llm/providers/implementations/GeminiProvider.d.ts.map +1 -1
  112. package/dist/core/llm/providers/implementations/GeminiProvider.js +62 -24
  113. package/dist/core/llm/providers/implementations/GeminiProvider.js.map +1 -1
  114. package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts +255 -70
  115. package/dist/core/llm/providers/implementations/OpenAIProvider.d.ts.map +1 -1
  116. package/dist/core/llm/providers/implementations/OpenAIProvider.js +943 -214
  117. package/dist/core/llm/providers/implementations/OpenAIProvider.js.map +1 -1
  118. package/dist/core/llm/providers/implementations/cacheLeakDetector.d.ts +15 -7
  119. package/dist/core/llm/providers/implementations/cacheLeakDetector.d.ts.map +1 -1
  120. package/dist/core/llm/providers/implementations/cacheLeakDetector.js +12 -7
  121. package/dist/core/llm/providers/implementations/cacheLeakDetector.js.map +1 -1
  122. package/dist/core/llm/providers/implementations/openai-response-format-guard.d.ts +17 -0
  123. package/dist/core/llm/providers/implementations/openai-response-format-guard.d.ts.map +1 -1
  124. package/dist/core/llm/providers/implementations/openai-response-format-guard.js +31 -0
  125. package/dist/core/llm/providers/implementations/openai-response-format-guard.js.map +1 -1
  126. package/dist/core/llm/providers/model-cache-capabilities.d.ts +24 -9
  127. package/dist/core/llm/providers/model-cache-capabilities.d.ts.map +1 -1
  128. package/dist/core/llm/providers/model-cache-capabilities.js +59 -44
  129. package/dist/core/llm/providers/model-cache-capabilities.js.map +1 -1
  130. package/dist/core/llm/providers/model-effort.d.ts +21 -0
  131. package/dist/core/llm/providers/model-effort.d.ts.map +1 -1
  132. package/dist/core/llm/providers/model-effort.js +38 -2
  133. package/dist/core/llm/providers/model-effort.js.map +1 -1
  134. package/dist/core/llm/providers/model-forced-tool-choice.d.ts +13 -6
  135. package/dist/core/llm/providers/model-forced-tool-choice.d.ts.map +1 -1
  136. package/dist/core/llm/providers/model-forced-tool-choice.js +14 -7
  137. package/dist/core/llm/providers/model-forced-tool-choice.js.map +1 -1
  138. package/dist/core/llm/providers/model-thinking.d.ts +64 -13
  139. package/dist/core/llm/providers/model-thinking.d.ts.map +1 -1
  140. package/dist/core/llm/providers/model-thinking.js +52 -12
  141. package/dist/core/llm/providers/model-thinking.js.map +1 -1
  142. package/dist/core/llm/streaming/StreamingBatcher.d.ts +4 -3
  143. package/dist/core/llm/streaming/StreamingBatcher.d.ts.map +1 -1
  144. package/dist/core/llm/streaming/StreamingBatcher.js +8 -3
  145. package/dist/core/llm/streaming/StreamingBatcher.js.map +1 -1
  146. package/dist/core/safety/LLMProviderHealthRegistry.d.ts +4 -0
  147. package/dist/core/safety/LLMProviderHealthRegistry.d.ts.map +1 -1
  148. package/dist/core/safety/LLMProviderHealthRegistry.js +26 -0
  149. package/dist/core/safety/LLMProviderHealthRegistry.js.map +1 -1
  150. package/dist/core/utils/sha256.d.ts +19 -0
  151. package/dist/core/utils/sha256.d.ts.map +1 -0
  152. package/dist/core/utils/sha256.js +101 -0
  153. package/dist/core/utils/sha256.js.map +1 -0
  154. package/dist/orchestration/pipeline/query/types.js +1 -1
  155. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"model-cache-capabilities.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAgBH,MAAM,YAAY,GAAG,IAAI,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,UAAU,wBAAwB,CAAC,OAAe;IACtD,MAAM,EAAE,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IAEjC,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACvB,iEAAiE;QACjE,mEAAmE;QACnE,OAAO;YACL,qBAAqB,EAAE,KAAK;YAC5B,wBAAwB,EAAE,YAAY;YACtC,6BAA6B,EAAE,KAAK;SACrC,CAAC;IACJ,CAAC;IAED,qEAAqE;IACrE,IAAI,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC;IAC/G,CAAC;IACD,IAAI,iCAAiC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC/C,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC;IAC/G,CAAC;IAED,uDAAuD;IACvD,IAAI,wBAAwB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC;IAC9G,CAAC;IAED,0EAA0E;IAC1E,yEAAyE;IACzE,6EAA6E;IAC7E,IAAI,eAAe,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC7B,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC;IAC9G,CAAC;IAED,mBAAmB;IACnB,IAAI,yBAAyB,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACvC,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC;IAC9G,CAAC;IACD,IAAI,6BAA6B,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QAC3C,sEAAsE;QACtE,0DAA0D;QAC1D,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC;IAC/G,CAAC;IAED,iBAAiB;IACjB,IAAI,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACjD,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,IAAI,EAAE,CAAC;IAC9G,CAAC;IACD,IAAI,qEAAqE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnF,OAAO,EAAE,qBAAqB,EAAE,IAAI,EAAE,wBAAwB,EAAE,IAAI,EAAE,6BAA6B,EAAE,KAAK,EAAE,CAAC;IAC/G,CAAC;IAED,uEAAuE;IACvE,mEAAmE;IACnE,OAAO;QACL,qBAAqB,EAAE,IAAI;QAC3B,wBAAwB,EAAE,YAAY;QACtC,6BAA6B,EAAE,IAAI;KACpC,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"model-cache-capabilities.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-cache-capabilities.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACxD,IAAI,qBAAqB,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC5D,gDAAgD;IAChD,IAAI,6BAA6B,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAErE,iBAAiB;IACjB,IAAI,mCAAmC,CAAC,IAAI,CAAC,EAAE,CAAC;QAAE,OAAO,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAC1E,IAAI,qEAAqE,CAAC,IAAI,CAAC,EAAE,CAAC,EAAE,CAAC;QACnF,OAAO,IAAI,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC;IAC3B,CAAC;IAED,0EAA0E;IAC1E,+CAA+C;IAC/C,OAAO,IAAI,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;AAClC,CAAC"}
@@ -25,6 +25,20 @@ export type EffortLevel = (typeof EFFORT_LEVELS)[number];
25
25
  export declare function modelSupportsEffort(modelId: string): boolean;
26
26
  /** Whether a value is a valid effort level. */
27
27
  export declare function isEffortLevel(v: unknown): v is EffortLevel;
28
+ /**
29
+ * The `output_config.effort` to send to a Claude model, or undefined to omit
30
+ * it. Each model accepts its own ladder (Anthropic's model docs): Opus 4.5
31
+ * takes low, medium and high; Opus 4.6 and Sonnet 4.6 add max but not xhigh,
32
+ * which arrived with Opus 4.7; Opus 4.7 and later, Sonnet 5 and later, Fable
33
+ * and Mythos take all five. A level the model does not take is sent as
34
+ * `high` instead of returning 400. Matches bare and provider-prefixed ids,
35
+ * like {@link modelSupportsEffort}.
36
+ *
37
+ * @param modelId Anthropic-side model id.
38
+ * @param effort Caller-supplied effort value.
39
+ * @returns The level to send, or undefined for an unsupported model or value.
40
+ */
41
+ export declare function resolveAnthropicEffort(modelId: string, effort: unknown): EffortLevel | undefined;
28
42
  export declare function mapEffortToOpenAiReasoningEffort(effort: unknown): string | undefined;
29
43
  /**
30
44
  * Whether an OpenAI model accepts `reasoning.effort: 'xhigh'` on the
@@ -39,6 +53,13 @@ export declare function mapEffortToOpenAiReasoningEffort(effort: unknown): strin
39
53
  * `gpt-6-astra` with `reasoning:{effort:'xhigh'}` → HTTP 200 (status:
40
54
  * completed) — GPT-6 joins the allow-list. Widen further only after
41
55
  * probing the new id.
56
+ *
57
+ * Live-probed 2026-09-30: `POST /v1/responses` with function tools and
58
+ * `reasoning: {effort: 'xhigh'}` returned HTTP 200 with a `function_call`
59
+ * output on `gpt-6-sol`, `gpt-6-luna` and `gpt-6-astra`. OpenAI's 2026-09-29
60
+ * changelog lists reasoning effort `low` through `max` for `gpt-6.1-sol` on
61
+ * `/v1/responses` and says it rejects `none` and `minimal`, which the agentos
62
+ * effort scale never produces.
42
63
  */
43
64
  export declare function modelAcceptsXhighResponsesEffort(modelId: string): boolean;
44
65
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"model-effort.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;AACvF,eAAO,MAAM,aAAa,oDAAqD,CAAC;AAChF,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAEzD;;;;;;;;GAQG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE5D;AAED,+CAA+C;AAC/C,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,WAAW,CAE1D;AAmBD,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAEpF;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEzE;AA6BD;;;;;;GAMG;AACH,wBAAg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;AACH,wBAAgB,wCAAwC,CACtD,MAAM,EAAE,OAAO,EACf,OAAO,EAAE,MAAM,GACd,MAAM,GAAG,SAAS,CAUpB"}
@@ -28,6 +28,28 @@ export function modelSupportsEffort(modelId) {
28
28
  export function isEffortLevel(v) {
29
29
  return typeof v === 'string' && EFFORT_LEVELS.includes(v);
30
30
  }
31
+ /**
32
+ * The `output_config.effort` to send to a Claude model, or undefined to omit
33
+ * it. Each model accepts its own ladder (Anthropic's model docs): Opus 4.5
34
+ * takes low, medium and high; Opus 4.6 and Sonnet 4.6 add max but not xhigh,
35
+ * which arrived with Opus 4.7; Opus 4.7 and later, Sonnet 5 and later, Fable
36
+ * and Mythos take all five. A level the model does not take is sent as
37
+ * `high` instead of returning 400. Matches bare and provider-prefixed ids,
38
+ * like {@link modelSupportsEffort}.
39
+ *
40
+ * @param modelId Anthropic-side model id.
41
+ * @param effort Caller-supplied effort value.
42
+ * @returns The level to send, or undefined for an unsupported model or value.
43
+ */
44
+ export function resolveAnthropicEffort(modelId, effort) {
45
+ if (!isEffortLevel(effort) || !modelSupportsEffort(modelId))
46
+ return undefined;
47
+ if (/claude-opus-4-5/i.test(modelId) && (effort === 'xhigh' || effort === 'max'))
48
+ return 'high';
49
+ if (/claude-(opus|sonnet)-4-6/i.test(modelId) && effort === 'xhigh')
50
+ return 'high';
51
+ return effort;
52
+ }
31
53
  /**
32
54
  * OpenAI reasoning models (o-series, GPT-5 and GPT-6 families) take
33
55
  * `reasoning_effort` (none|low|medium|high|xhigh) — the OpenAI analogue of
@@ -61,9 +83,16 @@ export function mapEffortToOpenAiReasoningEffort(effort) {
61
83
  * `gpt-6-astra` with `reasoning:{effort:'xhigh'}` → HTTP 200 (status:
62
84
  * completed) — GPT-6 joins the allow-list. Widen further only after
63
85
  * probing the new id.
86
+ *
87
+ * Live-probed 2026-09-30: `POST /v1/responses` with function tools and
88
+ * `reasoning: {effort: 'xhigh'}` returned HTTP 200 with a `function_call`
89
+ * output on `gpt-6-sol`, `gpt-6-luna` and `gpt-6-astra`. OpenAI's 2026-09-29
90
+ * changelog lists reasoning effort `low` through `max` for `gpt-6.1-sol` on
91
+ * `/v1/responses` and says it rejects `none` and `minimal`, which the agentos
92
+ * effort scale never produces.
64
93
  */
65
94
  export function modelAcceptsXhighResponsesEffort(modelId) {
66
- return /^(gpt-5\.[56]|gpt-6-astra)/i.test(modelId);
95
+ return /^(gpt-5\.[56]|gpt-6-(astra|sol|luna)|gpt-6\.1-sol)/i.test(modelId);
67
96
  }
68
97
  /**
69
98
  * Responses-API models whose `reasoning.effort` accepts `'max'` — the tier
@@ -87,9 +116,16 @@ export function modelAcceptsXhighResponsesEffort(modelId) {
87
116
  * that the 2026-08-06 sweep never probed. All three join the list. Note the
88
117
  * asymmetry this preserves: the same ids reject `'max'` on chat.completions
89
118
  * (see {@link CHAT_MAX_EFFORT_MODELS}), so `max` stays a Responses-only tier.
119
+ *
120
+ * 2026-09-30 probe (POST /v1/responses with function tools,
121
+ * `reasoning: {effort: 'max'}`): HTTP 200 with a `function_call` output on
122
+ * `gpt-6-sol`, `gpt-6-luna` and `gpt-6-astra`, so Sol and Luna join Astra.
123
+ * `gpt-6.1-sol` joins on OpenAI's 2026-09-29 changelog, which lists `max`
124
+ * among its `/v1/responses` efforts.
90
125
  */
91
126
  const RESPONSES_MAX_EFFORT_MODELS = new Set([
92
- 'gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna', 'gpt-6-astra',
127
+ 'gpt-5.6', 'gpt-5.6-sol', 'gpt-5.6-terra', 'gpt-5.6-luna',
128
+ 'gpt-6-astra', 'gpt-6-sol', 'gpt-6-luna', 'gpt-6.1-sol',
93
129
  ]);
94
130
  /**
95
131
  * Whether `modelId` is on the probe-verified Responses `max` allow-list.
@@ -1 +1 @@
1
- {"version":3,"file":"model-effort.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-effort.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,uFAAuF;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,UAAU,8BAA8B,CAAC,OAAe;IAC5D,OAAO,2BAA2B,CAAC,GAAG,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,CAAC;AAChE,CAAC;AAED;;;;;;;;;GASG;AACH,MAAM,UAAU,gCAAgC,CAC9C,OAAe,EACf,MAAe;IAEf,IAAI,MAAM,KAAK,KAAK,IAAI,8BAA8B,CAAC,OAAO,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9E,MAAM,IAAI,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;IACtD,IAAI,IAAI,KAAK,SAAS;QAAE,OAAO,SAAS,CAAC;IACzC,OAAO,IAAI,KAAK,OAAO,IAAI,CAAC,gCAAgC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC;AACxF,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,MAAM,sBAAsB,GAAsB,EAAE,CAAC;AAErD;;;;GAIG;AACH,MAAM,UAAU,wCAAwC,CACtD,MAAe,EACf,OAAe;IAEf,MAAM,IAAI,GAAG,gCAAgC,CAAC,MAAM,CAAC,CAAC;IACtD,IACE,MAAM,KAAK,KAAK;WACb,IAAI,KAAK,OAAO;WAChB,sBAAsB,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,EAC1E,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -5,9 +5,10 @@
5
5
  * Anthropic structured output and `toolChoice: 'required'` both resolve to a
6
6
  * FORCED `tool_choice` on the Messages API (`{ type: 'tool', name }` or
7
7
  * `{ type: 'any' }`). Most Claude models accept this, and it is the most
8
- * reliable way to constrain output. Claude Fable 5 / 5.1 and Claude Opus 5.5
9
- * reject a forced `tool_choice` at the API level with a 400. Those models can
10
- * still call tools under `{ type: 'auto' }`; they only refuse to be forced.
8
+ * reliable way to constrain output. Claude Fable 5 / 5.1, Claude Mythos 5.1,
9
+ * Claude Opus 5.5 and Claude Sonnet 5.5 reject a forced `tool_choice` at the
10
+ * API level with a 400. Those models can still call tools under
11
+ * `{ type: 'auto' }`; they only refuse to be forced.
11
12
  *
12
13
  * Two consumers read this:
13
14
  * - {@link AnthropicProvider} clamps any resolved forced `tool_choice` to
@@ -26,22 +27,28 @@
26
27
  * Whether Anthropic will accept a forced `tool_choice` (`{ type: 'tool' }` or
27
28
  * `{ type: 'any' }`) for the given Claude model id.
28
29
  *
29
- * Deny-by-explicit-model. Two families reject forced tool use, and every other
30
- * current Claude model (Sonnet, Opus 5 and earlier, Haiku) accepts it:
30
+ * Deny-by-explicit-model. These models reject forced tool use, and every
31
+ * other current Claude model (Sonnet 5 and earlier, Opus 5 and earlier,
32
+ * Haiku) accepts it:
31
33
  *
32
34
  * - Claude Fable 5 and 5.1, including dated variants such as
33
35
  * `claude-fable-5-20260601`. The `fable-5` alternative also matches
34
36
  * `claude-fable-5-1` because `\b` matches at the hyphen, which is intended
35
37
  * since 5.1 is the same family under the same constraint.
38
+ * - Claude Mythos 5.1 (`claude-mythos-5-1`), per Anthropic's model docs.
36
39
  * - Claude Opus 5.5 (`claude-opus-5-5`). Claude Opus 5 accepts forced tool
37
40
  * use, so the pattern names the full `opus-5-5` id. A bare `opus-5` prefix
38
41
  * would deny Opus 5 as well.
42
+ * - Claude Sonnet 5.5 (`claude-sonnet-5-5`). Claude Sonnet 5 accepts forced
43
+ * tool use, so the pattern names the full `sonnet-5-5` id for the same
44
+ * reason.
39
45
  *
40
46
  * Live-probed 2026-09-29 on the Messages API. `{type:'tool'}` and
41
47
  * `{type:'any'}` both return HTTP 400 on `claude-opus-5-5` and
42
48
  * `claude-fable-5-1`, with the message `tool_choice: type "tool" and "any" are
43
49
  * not supported for this model.` The same two requests return 200 on
44
- * `claude-opus-5`.
50
+ * `claude-opus-5`. Both return HTTP 400 on `claude-sonnet-5-5` (probed
51
+ * 2026-09-30).
45
52
  *
46
53
  * `AnthropicProvider` clamps an unsupported forced choice to `{ type: 'auto' }`
47
54
  * and logs a warning. An extra entry here therefore costs guaranteed tool
@@ -1 +1 @@
1
- {"version":3,"file":"model-forced-tool-choice.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE"}
1
+ {"version":3,"file":"model-forced-tool-choice.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE"}
@@ -5,9 +5,10 @@
5
5
  * Anthropic structured output and `toolChoice: 'required'` both resolve to a
6
6
  * FORCED `tool_choice` on the Messages API (`{ type: 'tool', name }` or
7
7
  * `{ type: 'any' }`). Most Claude models accept this, and it is the most
8
- * reliable way to constrain output. Claude Fable 5 / 5.1 and Claude Opus 5.5
9
- * reject a forced `tool_choice` at the API level with a 400. Those models can
10
- * still call tools under `{ type: 'auto' }`; they only refuse to be forced.
8
+ * reliable way to constrain output. Claude Fable 5 / 5.1, Claude Mythos 5.1,
9
+ * Claude Opus 5.5 and Claude Sonnet 5.5 reject a forced `tool_choice` at the
10
+ * API level with a 400. Those models can still call tools under
11
+ * `{ type: 'auto' }`; they only refuse to be forced.
11
12
  *
12
13
  * Two consumers read this:
13
14
  * - {@link AnthropicProvider} clamps any resolved forced `tool_choice` to
@@ -26,22 +27,28 @@
26
27
  * Whether Anthropic will accept a forced `tool_choice` (`{ type: 'tool' }` or
27
28
  * `{ type: 'any' }`) for the given Claude model id.
28
29
  *
29
- * Deny-by-explicit-model. Two families reject forced tool use, and every other
30
- * current Claude model (Sonnet, Opus 5 and earlier, Haiku) accepts it:
30
+ * Deny-by-explicit-model. These models reject forced tool use, and every
31
+ * other current Claude model (Sonnet 5 and earlier, Opus 5 and earlier,
32
+ * Haiku) accepts it:
31
33
  *
32
34
  * - Claude Fable 5 and 5.1, including dated variants such as
33
35
  * `claude-fable-5-20260601`. The `fable-5` alternative also matches
34
36
  * `claude-fable-5-1` because `\b` matches at the hyphen, which is intended
35
37
  * since 5.1 is the same family under the same constraint.
38
+ * - Claude Mythos 5.1 (`claude-mythos-5-1`), per Anthropic's model docs.
36
39
  * - Claude Opus 5.5 (`claude-opus-5-5`). Claude Opus 5 accepts forced tool
37
40
  * use, so the pattern names the full `opus-5-5` id. A bare `opus-5` prefix
38
41
  * would deny Opus 5 as well.
42
+ * - Claude Sonnet 5.5 (`claude-sonnet-5-5`). Claude Sonnet 5 accepts forced
43
+ * tool use, so the pattern names the full `sonnet-5-5` id for the same
44
+ * reason.
39
45
  *
40
46
  * Live-probed 2026-09-29 on the Messages API. `{type:'tool'}` and
41
47
  * `{type:'any'}` both return HTTP 400 on `claude-opus-5-5` and
42
48
  * `claude-fable-5-1`, with the message `tool_choice: type "tool" and "any" are
43
49
  * not supported for this model.` The same two requests return 200 on
44
- * `claude-opus-5`.
50
+ * `claude-opus-5`. Both return HTTP 400 on `claude-sonnet-5-5` (probed
51
+ * 2026-09-30).
45
52
  *
46
53
  * `AnthropicProvider` clamps an unsupported forced choice to `{ type: 'auto' }`
47
54
  * and logs a warning. An extra entry here therefore costs guaranteed tool
@@ -55,6 +62,6 @@
55
62
  * model, `true` otherwise.
56
63
  */
57
64
  export function modelSupportsForcedToolChoice(modelId) {
58
- return !/^claude-(fable-5|opus-5-5)\b/i.test(modelId);
65
+ return !/^claude-(fable-5|mythos-5-1|opus-5-5|sonnet-5-5)\b/i.test(modelId);
59
66
  }
60
67
  //# sourceMappingURL=model-forced-tool-choice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-forced-tool-choice.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,UAAU,6BAA6B,CAAC,OAAe;IAC3D,OAAO,CAAC,+BAA+B,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AACxD,CAAC"}
1
+ {"version":3,"file":"model-forced-tool-choice.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-forced-tool-choice.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,MAAM,UAAU,6BAA6B,CAAC,OAAe;IAC3D,OAAO,CAAC,qDAAqD,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC9E,CAAC"}
@@ -2,20 +2,23 @@
2
2
  * @fileoverview Extended-thinking helpers for the Anthropic
3
3
  * reasoning-default Claude models.
4
4
  *
5
- * The Opus 4.7 / 4.8 family and Fable 5 reason by default and accept ONLY
6
- * the adaptive thinking form on the Messages API: `thinking: { type:
7
- * 'adaptive' }`. The older manual form `thinking: { type: 'enabled',
8
- * budget_tokens }` is removed on this family and returns a 400
9
- * ('"thinking.type.enabled" is not supported for this model'). Fable 5 adds
10
- * one more constraint — an explicit `thinking: { type: 'disabled' }` also
11
- * 400s — but the provider only ever emits the adaptive form (or nothing),
12
- * never `disabled`, so that path is never hit. Depth is
5
+ * Turning thinking on: the Opus 4.7 / 4.8 family, Opus 5.x, Sonnet 5.x and
6
+ * Fable 5.x take ONLY the adaptive form as the on-switch on the Messages API:
7
+ * `thinking: { type: 'adaptive' }`. The older manual form `thinking: { type:
8
+ * 'enabled', budget_tokens }` is removed on this family and returns a 400
9
+ * ('"thinking.type.enabled" is not supported for this model'). Depth is
13
10
  * controlled by `output_config.effort`, not a token budget, so the
14
11
  * caller-facing `{ budgetTokens }` option acts as the on-switch and the
15
12
  * number itself is not sent. {@link AnthropicProvider} sends the block
16
13
  * through {@link resolveThinkingPayload} when a caller passes a thinking
17
14
  * budget AND the model supports it.
18
15
  *
16
+ * Turning thinking off (`thinking: false`): leaving the field out keeps the
17
+ * model's default, which is thinking ON for Opus 5, Sonnet 5 and Sonnet 5.5,
18
+ * and always on for Opus 5.5, Fable and Mythos. The models that can turn it
19
+ * off each take their own shape, and some only at a capped effort;
20
+ * {@link resolveThinkingOff} maps a model id to it.
21
+ *
19
22
  * This is the thinking-capability sibling of `modelSupportsTemperature`
20
23
  * in AnthropicProvider.ts — the same reasoning-default family that
21
24
  * REJECTS `temperature` is the family that ACCEPTS `thinking`. Kept in
@@ -27,10 +30,13 @@
27
30
  * `thinking` parameter.
28
31
  *
29
32
  * Allow-by-explicit-family: only the reasoning-default Opus 4.7 / 4.8
30
- * line, Sonnet 5, and Fable 5 (and their dated variants like
33
+ * line, Opus 5, Sonnet 5, and Fable 5 (and their dated variants like
31
34
  * `claude-opus-4-8-20260501`) accept it; every other Claude model ignores
32
- * or rejects it. Future reasoning-first siblings get added to the regex as
33
- * Anthropic releases them, in lockstep with `modelSupportsTemperature`.
35
+ * or rejects it. Opus 5.5, Sonnet 5.5 and Fable 5.1 match the `opus-5`,
36
+ * `sonnet-5` and `fable-5` alternatives on purpose, because `\b` matches at
37
+ * the hyphen before their trailing version digit. Future reasoning-first
38
+ * siblings get added to the regex as Anthropic releases them, in lockstep
39
+ * with `modelSupportsTemperature`.
34
40
  *
35
41
  * @param modelId Anthropic-side model id.
36
42
  * @returns `true` when Anthropic accepts a `thinking` block for this model.
@@ -58,10 +64,55 @@ export interface ResolvedThinkingPayload {
58
64
  * max_tokens change).
59
65
  *
60
66
  * @param modelId Anthropic-side model id.
61
- * @param thinking Caller-supplied `{ budgetTokens }`, or `undefined`.
67
+ * @param thinking Caller-supplied `{ budgetTokens }`; `false` (thinking
68
+ * off, see {@link resolveThinkingOff}) and `undefined` return `null`.
62
69
  * @param requestedMaxTokens The max_tokens already resolved for the request.
63
70
  */
64
71
  export declare function resolveThinkingPayload(modelId: string, thinking: {
65
72
  budgetTokens: number;
66
- } | undefined, requestedMaxTokens: number | undefined): ResolvedThinkingPayload | null;
73
+ } | false | undefined, requestedMaxTokens: number | undefined): ResolvedThinkingPayload | null;
74
+ /**
75
+ * How one model takes a request to turn thinking off.
76
+ *
77
+ * - `omit`: the model does not think unless asked, so leaving `thinking` out
78
+ * is off.
79
+ * - `send`: the model thinks by default and turns it off only for this
80
+ * `thinking` value. `maxEffort` is the highest `output_config.effort` the
81
+ * value is accepted with; absent means any effort.
82
+ * - `always_on`: the model always thinks and rejects every off shape.
83
+ */
84
+ export type ThinkingOffShape = {
85
+ kind: 'omit';
86
+ } | {
87
+ kind: 'send';
88
+ thinking: {
89
+ type: 'disabled';
90
+ } | {
91
+ type: 'between_tools';
92
+ };
93
+ maxEffort?: 'high';
94
+ } | {
95
+ kind: 'always_on';
96
+ };
97
+ /**
98
+ * The request shape that turns thinking off on a Claude model, for a caller
99
+ * passing `thinking: false`.
100
+ *
101
+ * | Model | Off shape | Source |
102
+ * | --- | --- | --- |
103
+ * | Sonnet 5.5 | `{ type: 'between_tools' }` at effort high or below | probed 2026-09-30: `disabled` returns 400, `between_tools` 200 |
104
+ * | Opus 5 | `{ type: 'disabled' }` at effort high or below | probed 2026-09-30: `disabled` 200, `between_tools` 400 |
105
+ * | Sonnet 5 | `{ type: 'disabled' }` | Anthropic's model docs |
106
+ * | Opus 5.5, Fable 5.x, Mythos 5.x | none: always on | probed 2026-09-30 on Opus 5.5 and Fable 5.1: both shapes return 400 |
107
+ * | everything else | omit the field | thinks only when asked |
108
+ *
109
+ * The 5.5 checks run first because `opus-5\b` and `sonnet-5\b` also match
110
+ * the 5.5 ids. An unknown id gets `omit`, which never sends a shape that
111
+ * could return 400. Anchored like {@link modelSupportsThinking}, so the id
112
+ * is the bare Anthropic-side one.
113
+ *
114
+ * @param modelId Anthropic-side model id, bare or dated.
115
+ * @returns The off shape for the model.
116
+ */
117
+ export declare function resolveThinkingOff(modelId: string): ThinkingOffShape;
67
118
  //# sourceMappingURL=model-thinking.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-thinking.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-thinking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;GAYG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EAC9C,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,uBAAuB,GAAG,IAAI,CAGhC"}
1
+ {"version":3,"file":"model-thinking.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-thinking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,0EAA0E;AAC1E,MAAM,WAAW,uBAAuB;IACtC,QAAQ,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,CAAC;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,sBAAsB,CACpC,OAAO,EAAE,MAAM,EACf,QAAQ,EAAE;IAAE,YAAY,EAAE,MAAM,CAAA;CAAE,GAAG,KAAK,GAAG,SAAS,EACtD,kBAAkB,EAAE,MAAM,GAAG,SAAS,GACrC,uBAAuB,GAAG,IAAI,CAGhC;AAED;;;;;;;;;GASG;AACH,MAAM,MAAM,gBAAgB,GACxB;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,GAChB;IACE,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE;QAAE,IAAI,EAAE,UAAU,CAAA;KAAE,GAAG;QAAE,IAAI,EAAE,eAAe,CAAA;KAAE,CAAC;IAC3D,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,GACD;IAAE,IAAI,EAAE,WAAW,CAAA;CAAE,CAAC;AAE1B;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAUpE"}
@@ -2,20 +2,23 @@
2
2
  * @fileoverview Extended-thinking helpers for the Anthropic
3
3
  * reasoning-default Claude models.
4
4
  *
5
- * The Opus 4.7 / 4.8 family and Fable 5 reason by default and accept ONLY
6
- * the adaptive thinking form on the Messages API: `thinking: { type:
7
- * 'adaptive' }`. The older manual form `thinking: { type: 'enabled',
8
- * budget_tokens }` is removed on this family and returns a 400
9
- * ('"thinking.type.enabled" is not supported for this model'). Fable 5 adds
10
- * one more constraint — an explicit `thinking: { type: 'disabled' }` also
11
- * 400s — but the provider only ever emits the adaptive form (or nothing),
12
- * never `disabled`, so that path is never hit. Depth is
5
+ * Turning thinking on: the Opus 4.7 / 4.8 family, Opus 5.x, Sonnet 5.x and
6
+ * Fable 5.x take ONLY the adaptive form as the on-switch on the Messages API:
7
+ * `thinking: { type: 'adaptive' }`. The older manual form `thinking: { type:
8
+ * 'enabled', budget_tokens }` is removed on this family and returns a 400
9
+ * ('"thinking.type.enabled" is not supported for this model'). Depth is
13
10
  * controlled by `output_config.effort`, not a token budget, so the
14
11
  * caller-facing `{ budgetTokens }` option acts as the on-switch and the
15
12
  * number itself is not sent. {@link AnthropicProvider} sends the block
16
13
  * through {@link resolveThinkingPayload} when a caller passes a thinking
17
14
  * budget AND the model supports it.
18
15
  *
16
+ * Turning thinking off (`thinking: false`): leaving the field out keeps the
17
+ * model's default, which is thinking ON for Opus 5, Sonnet 5 and Sonnet 5.5,
18
+ * and always on for Opus 5.5, Fable and Mythos. The models that can turn it
19
+ * off each take their own shape, and some only at a capped effort;
20
+ * {@link resolveThinkingOff} maps a model id to it.
21
+ *
19
22
  * This is the thinking-capability sibling of `modelSupportsTemperature`
20
23
  * in AnthropicProvider.ts — the same reasoning-default family that
21
24
  * REJECTS `temperature` is the family that ACCEPTS `thinking`. Kept in
@@ -27,10 +30,13 @@
27
30
  * `thinking` parameter.
28
31
  *
29
32
  * Allow-by-explicit-family: only the reasoning-default Opus 4.7 / 4.8
30
- * line, Sonnet 5, and Fable 5 (and their dated variants like
33
+ * line, Opus 5, Sonnet 5, and Fable 5 (and their dated variants like
31
34
  * `claude-opus-4-8-20260501`) accept it; every other Claude model ignores
32
- * or rejects it. Future reasoning-first siblings get added to the regex as
33
- * Anthropic releases them, in lockstep with `modelSupportsTemperature`.
35
+ * or rejects it. Opus 5.5, Sonnet 5.5 and Fable 5.1 match the `opus-5`,
36
+ * `sonnet-5` and `fable-5` alternatives on purpose, because `\b` matches at
37
+ * the hyphen before their trailing version digit. Future reasoning-first
38
+ * siblings get added to the regex as Anthropic releases them, in lockstep
39
+ * with `modelSupportsTemperature`.
34
40
  *
35
41
  * @param modelId Anthropic-side model id.
36
42
  * @returns `true` when Anthropic accepts a `thinking` block for this model.
@@ -53,7 +59,8 @@ export function modelSupportsThinking(modelId) {
53
59
  * max_tokens change).
54
60
  *
55
61
  * @param modelId Anthropic-side model id.
56
- * @param thinking Caller-supplied `{ budgetTokens }`, or `undefined`.
62
+ * @param thinking Caller-supplied `{ budgetTokens }`; `false` (thinking
63
+ * off, see {@link resolveThinkingOff}) and `undefined` return `null`.
57
64
  * @param requestedMaxTokens The max_tokens already resolved for the request.
58
65
  */
59
66
  export function resolveThinkingPayload(modelId, thinking, requestedMaxTokens) {
@@ -61,4 +68,37 @@ export function resolveThinkingPayload(modelId, thinking, requestedMaxTokens) {
61
68
  return null;
62
69
  return { thinking: { type: 'adaptive' }, maxTokens: requestedMaxTokens ?? 0 };
63
70
  }
71
+ /**
72
+ * The request shape that turns thinking off on a Claude model, for a caller
73
+ * passing `thinking: false`.
74
+ *
75
+ * | Model | Off shape | Source |
76
+ * | --- | --- | --- |
77
+ * | Sonnet 5.5 | `{ type: 'between_tools' }` at effort high or below | probed 2026-09-30: `disabled` returns 400, `between_tools` 200 |
78
+ * | Opus 5 | `{ type: 'disabled' }` at effort high or below | probed 2026-09-30: `disabled` 200, `between_tools` 400 |
79
+ * | Sonnet 5 | `{ type: 'disabled' }` | Anthropic's model docs |
80
+ * | Opus 5.5, Fable 5.x, Mythos 5.x | none: always on | probed 2026-09-30 on Opus 5.5 and Fable 5.1: both shapes return 400 |
81
+ * | everything else | omit the field | thinks only when asked |
82
+ *
83
+ * The 5.5 checks run first because `opus-5\b` and `sonnet-5\b` also match
84
+ * the 5.5 ids. An unknown id gets `omit`, which never sends a shape that
85
+ * could return 400. Anchored like {@link modelSupportsThinking}, so the id
86
+ * is the bare Anthropic-side one.
87
+ *
88
+ * @param modelId Anthropic-side model id, bare or dated.
89
+ * @returns The off shape for the model.
90
+ */
91
+ export function resolveThinkingOff(modelId) {
92
+ if (/^claude-sonnet-5-5\b/i.test(modelId)) {
93
+ return { kind: 'send', thinking: { type: 'between_tools' }, maxEffort: 'high' };
94
+ }
95
+ if (/^claude-(opus-5-5|fable-5|mythos-5)\b/i.test(modelId))
96
+ return { kind: 'always_on' };
97
+ if (/^claude-opus-5\b/i.test(modelId)) {
98
+ return { kind: 'send', thinking: { type: 'disabled' }, maxEffort: 'high' };
99
+ }
100
+ if (/^claude-sonnet-5\b/i.test(modelId))
101
+ return { kind: 'send', thinking: { type: 'disabled' } };
102
+ return { kind: 'omit' };
103
+ }
64
104
  //# sourceMappingURL=model-thinking.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"model-thinking.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-thinking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,mDAAmD,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC;AAQD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,QAA8C,EAC9C,kBAAsC;IAEtC,IAAI,CAAC,QAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,kBAAkB,IAAI,CAAC,EAAE,CAAC;AAChF,CAAC"}
1
+ {"version":3,"file":"model-thinking.js","sourceRoot":"","sources":["../../../../src/core/llm/providers/model-thinking.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAM,UAAU,qBAAqB,CAAC,OAAe;IACnD,OAAO,mDAAmD,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;AAC3E,CAAC;AAQD;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,sBAAsB,CACpC,OAAe,EACf,QAAsD,EACtD,kBAAsC;IAEtC,IAAI,CAAC,QAAQ,IAAI,CAAC,qBAAqB,CAAC,OAAO,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,kBAAkB,IAAI,CAAC,EAAE,CAAC;AAChF,CAAC;AAqBD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,kBAAkB,CAAC,OAAe;IAChD,IAAI,uBAAuB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAClF,CAAC;IACD,IAAI,wCAAwC,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,CAAC;IACzF,IAAI,mBAAmB,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC;QACtC,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,CAAC;IAC7E,CAAC;IACD,IAAI,qBAAqB,CAAC,IAAI,CAAC,OAAO,CAAC;QAAE,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,EAAE,CAAC;IACjG,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1B,CAAC"}
@@ -2,14 +2,15 @@
2
2
  * @fileoverview Backpressure batching wrapper for provider streaming chunks (`ModelCompletionResponse`).
3
3
  * Combines small, high-frequency deltas into larger aggregated chunks to reduce downstream
4
4
  * dispatch overhead (websocket emissions, DOM updates, etc.) while preserving core invariants:
5
- * - Text remains append-only (merged into a single `responseTextDelta` per batch).
5
+ * - Text remains append-only (merged into a single `responseTextDelta` per batch), and so does
6
+ * reasoning-summary text (`reasoningTextDelta`), kept apart from it.
6
7
  * - Tool/function argument deltas merged per (choiceIndex, toolCallId) into single consolidated delta.
7
8
  * - Exactly one terminal chunk with `isFinal: true` (forwarded from original final chunk).
8
9
  * - Usage & error surfaced only when FINAL chunk encountered (or if intermediate provider error semantics change).
9
10
  *
10
11
  * Flush Triggers (any):
11
12
  * 1. Latency: maxLatencyMs elapsed since first unflushed chunk arrival.
12
- * 2. Size: accumulated text delta length >= maxTextDeltaChars.
13
+ * 2. Size: accumulated text and reasoning delta length >= maxTextDeltaChars.
13
14
  * 3. Chunk Count: buffer size >= maxChunksPerBatch.
14
15
  * 4. Explicit final provider chunk.
15
16
  * 5. Manual tool argument size threshold (maxToolArgumentChars) exceeded.
@@ -28,7 +29,7 @@ import { ModelCompletionResponse } from '../providers/IProvider';
28
29
  export interface StreamingBatcherOptions {
29
30
  /** Max wall-clock latency before forcing a flush (milliseconds). */
30
31
  maxLatencyMs?: number;
31
- /** Max accumulated text delta characters before flush. */
32
+ /** Max accumulated text delta characters (answer and reasoning text together) before flush. */
32
33
  maxTextDeltaChars?: number;
33
34
  /** Max accumulated tool argument characters (combined per tool call) before flush. */
34
35
  maxToolArgumentChars?: number;
@@ -1 +1 @@
1
- {"version":3,"file":"StreamingBatcher.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/streaming/StreamingBatcher.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAuGD;;;;;GAKG;AACH,wBAAuB,WAAW,CAChC,MAAM,EAAE,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC,EAChE,OAAO,GAAE,uBAA4B,GACpC,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC,CA0E1D;AAED,sFAAsF;AACtF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoC;gBACpC,OAAO,GAAE,uBAA4B;IAGjD,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC;CAGvE;AAED,eAAe,gBAAgB,CAAC"}
1
+ {"version":3,"file":"StreamingBatcher.d.ts","sourceRoot":"","sources":["../../../../src/core/llm/streaming/StreamingBatcher.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,uBAAuB,EAAE,MAAM,wBAAwB,CAAC;AAEjE,kDAAkD;AAClD,MAAM,WAAW,uBAAuB;IACtC,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,+FAA+F;IAC/F,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,sFAAsF;IACtF,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,gEAAgE;IAChE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,8EAA8E;IAC9E,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AA2GD;;;;;GAKG;AACH,wBAAuB,WAAW,CAChC,MAAM,EAAE,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC,EAChE,OAAO,GAAE,uBAA4B,GACpC,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC,CA2E1D;AAED,sFAAsF;AACtF,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,IAAI,CAAoC;gBACpC,OAAO,GAAE,uBAA4B;IAGjD,KAAK,CAAC,MAAM,EAAE,cAAc,CAAC,uBAAuB,EAAE,IAAI,EAAE,SAAS,CAAC;CAGvE;AAED,eAAe,gBAAgB,CAAC"}
@@ -10,6 +10,8 @@ function accumulate(state, chunk) {
10
10
  state.chunks.push(chunk);
11
11
  if (chunk.responseTextDelta)
12
12
  state.textBuffer += chunk.responseTextDelta;
13
+ if (chunk.reasoningTextDelta)
14
+ state.reasoningBuffer += chunk.reasoningTextDelta;
13
15
  if (chunk.toolCallsDeltas) {
14
16
  for (const d of chunk.toolCallsDeltas) {
15
17
  const key = `${d.index}|${d.id || '_'}`;
@@ -53,6 +55,7 @@ function buildBatch(state, batchSequence, isFinalOverride = false) {
53
55
  modelId: first.modelId,
54
56
  choices: first.choices, // assume stable choice metadata
55
57
  responseTextDelta: state.textBuffer.length > 0 ? state.textBuffer : undefined,
58
+ reasoningTextDelta: state.reasoningBuffer.length > 0 ? state.reasoningBuffer : undefined,
56
59
  toolCallsDeltas: mergedToolCalls.length > 0 ? mergedToolCalls : undefined,
57
60
  // Only propagate usage/error when final provider chunk present.
58
61
  usage: finalProviderChunk?.usage,
@@ -66,6 +69,7 @@ function buildBatch(state, batchSequence, isFinalOverride = false) {
66
69
  // Reset state for next batch
67
70
  state.chunks = [];
68
71
  state.textBuffer = '';
72
+ state.reasoningBuffer = '';
69
73
  state.toolBuffers = {};
70
74
  state.firstChunkAt = 0;
71
75
  return batched;
@@ -77,7 +81,7 @@ function shouldFlush(state, opts) {
77
81
  const now = Date.now();
78
82
  if (state.firstChunkAt && (now - state.firstChunkAt) >= opts.maxLatencyMs)
79
83
  return true;
80
- if (state.textBuffer.length >= opts.maxTextDeltaChars)
84
+ if (state.textBuffer.length + state.reasoningBuffer.length >= opts.maxTextDeltaChars)
81
85
  return true;
82
86
  if (state.chunks.length >= opts.maxChunksPerBatch)
83
87
  return true;
@@ -96,7 +100,7 @@ function shouldFlush(state, opts) {
96
100
  export async function* batchStream(stream, options = {}) {
97
101
  const opts = { ...DEFAULT_BATCHER_OPTIONS, ...options };
98
102
  let batchSequence = 0;
99
- const state = { chunks: [], textBuffer: '', toolBuffers: {}, firstChunkAt: 0 };
103
+ const state = { chunks: [], textBuffer: '', reasoningBuffer: '', toolBuffers: {}, firstChunkAt: 0 };
100
104
  const flush = (isFinal = false) => {
101
105
  const chunk = buildBatch(state, batchSequence++, isFinal);
102
106
  if (chunk && !opts.annotateBatches) {
@@ -137,11 +141,12 @@ export async function* batchStream(stream, options = {}) {
137
141
  }
138
142
  // Flush buffered chunks first, then emit final chunk.
139
143
  let preFinal = flush(false);
140
- if (!preFinal && state.textBuffer) {
144
+ if (!preFinal && (state.textBuffer || state.reasoningBuffer)) {
141
145
  preFinal = {
142
146
  ...state.chunks[0],
143
147
  id: `${state.chunks[0]?.id || 'chunk'}-batch-${batchSequence++}`,
144
148
  responseTextDelta: state.textBuffer || undefined,
149
+ reasoningTextDelta: state.reasoningBuffer || undefined,
145
150
  isFinal: false,
146
151
  };
147
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"StreamingBatcher.js","sourceRoot":"","sources":["../../../../src/core/llm/streaming/StreamingBatcher.ts"],"names":[],"mappings":"AA0CA,MAAM,uBAAuB,GAAsC;IACjE,YAAY,EAAE,GAAG;IACjB,iBAAiB,EAAE,GAAG;IACtB,oBAAoB,EAAE,IAAI;IAC1B,iBAAiB,EAAE,EAAE;IACrB,eAAe,EAAE,IAAI;CACtB,CAAC;AAiBF,iEAAiE;AACjE,SAAS,UAAU,CAAC,KAAuB,EAAE,KAA8B;IACzE,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IACzB,IAAI,KAAK,CAAC,iBAAiB;QAAE,KAAK,CAAC,UAAU,IAAI,KAAK,CAAC,iBAAiB,CAAC;IACzE,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;QAC1B,KAAK,MAAM,CAAC,IAAI,KAAK,CAAC,eAAe,EAAE,CAAC;YACtC,MAAM,GAAG,GAAG,GAAG,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,EAAE,IAAI,GAAG,EAAE,CAAC;YACxC,MAAM,GAAG,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,EAAE,EAAE,EAAE,CAAC;YAClD,IAAI,CAAC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EzB,8BAA8B;QAC9B,IAAI,WAAW,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,CAAC;YAC7B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC;YAC3B,IAAI,KAAK,EAAE,CAAC;gBACV,MAAM,KAAK,CAAC;YACd,CAAC;QACH,CAAC;IACH,CAAC;AACH,CAAC;AAED,sFAAsF;AACtF,MAAM,OAAO,gBAAgB;IAE3B,YAAY,UAAmC,EAAE;QAC/C,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,uBAAuB,EAAE,GAAG,OAAO,EAAE,CAAC;IACzD,CAAC;IACD,KAAK,CAAC,MAAgE;QACpE,OAAO,WAAW,CAAC,MAAM,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;CACF;AAED,eAAe,gBAAgB,CAAC"}
@@ -159,6 +159,10 @@ export declare class LLMProviderHealthRegistry {
159
159
  * Safe to call regardless of whether the breaker is already open:
160
160
  * a repeat failure on an open breaker just refreshes the
161
161
  * cooldown for the new error class.
162
+ *
163
+ * A content-policy decline is ignored entirely (see
164
+ * {@link isContentPolicyDecline}): it neither trips the breaker nor
165
+ * counts toward a streak.
162
166
  */
163
167
  recordFailure(providerId: string, error: unknown): void;
164
168
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"LLMProviderHealthRegistry.d.ts","sourceRoot":"","sources":["../../../src/core/safety/LLMProviderHealthRegistry.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgFG;AAEH,uDAAuD;AACvD,MAAM,WAAW,sBAAsB;IACrC,2CAA2C;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,6CAA6C;IAC7C,KAAK,EAAE,QAAQ,GAAG,MAAM,CAAC;IACzB,0EAA0E;IAC1E,mBAAmB,EAAE,MAAM,CAAC;IAC5B,+DAA+D;IAC/D,YAAY,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