agentfootprint 18.2.0 → 19.0.0

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 (295) hide show
  1. package/CAPABILITIES.md +3 -0
  2. package/dist/adapters/llm/AnthropicProvider.js +4 -0
  3. package/dist/adapters/llm/AnthropicProvider.js.map +1 -1
  4. package/dist/adapters/llm/BrowserAnthropicProvider.js +4 -0
  5. package/dist/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
  6. package/dist/adapters/llm/InvokeModelGatewayProvider.js +18 -21
  7. package/dist/adapters/llm/InvokeModelGatewayProvider.js.map +1 -1
  8. package/dist/adapters/llm/anthropicModels.js +72 -4
  9. package/dist/adapters/llm/anthropicModels.js.map +1 -1
  10. package/dist/adapters/observability/auditShapes/events/decisions.js +19 -0
  11. package/dist/adapters/observability/auditShapes/events/decisions.js.map +1 -1
  12. package/dist/core/agent/contextBinding/check.js +141 -0
  13. package/dist/core/agent/contextBinding/check.js.map +1 -0
  14. package/dist/core/agent/contextBinding/compare.js +84 -0
  15. package/dist/core/agent/contextBinding/compare.js.map +1 -0
  16. package/dist/core/agent/contextBinding/composition.js +87 -0
  17. package/dist/core/agent/contextBinding/composition.js.map +1 -0
  18. package/dist/core/agent/contextBinding/forCall.js +41 -0
  19. package/dist/core/agent/contextBinding/forCall.js.map +1 -0
  20. package/dist/core/agent/runValues.js +1 -0
  21. package/dist/core/agent/runValues.js.map +1 -1
  22. package/dist/core/agent/runtime/configuration/configure.js +6 -0
  23. package/dist/core/agent/runtime/configuration/configure.js.map +1 -1
  24. package/dist/core/agent/runtime/configuration/values.js.map +1 -1
  25. package/dist/core/agent/runtime/native/initialize.js +1 -0
  26. package/dist/core/agent/runtime/native/initialize.js.map +1 -1
  27. package/dist/core/agent/runtime/request/factory.js +1 -0
  28. package/dist/core/agent/runtime/request/factory.js.map +1 -1
  29. package/dist/core/agent/stages/callLLM/prepareCall.js +13 -0
  30. package/dist/core/agent/stages/callLLM/prepareCall.js.map +1 -1
  31. package/dist/core/agent/stages/callLLM.js +2 -0
  32. package/dist/core/agent/stages/callLLM.js.map +1 -1
  33. package/dist/esm/adapters/llm/AnthropicProvider.d.ts +16 -0
  34. package/dist/esm/adapters/llm/AnthropicProvider.js +5 -1
  35. package/dist/esm/adapters/llm/AnthropicProvider.js.map +1 -1
  36. package/dist/esm/adapters/llm/BrowserAnthropicProvider.d.ts +9 -0
  37. package/dist/esm/adapters/llm/BrowserAnthropicProvider.js +5 -1
  38. package/dist/esm/adapters/llm/BrowserAnthropicProvider.js.map +1 -1
  39. package/dist/esm/adapters/llm/InvokeModelGatewayProvider.d.ts +10 -8
  40. package/dist/esm/adapters/llm/InvokeModelGatewayProvider.js +19 -22
  41. package/dist/esm/adapters/llm/InvokeModelGatewayProvider.js.map +1 -1
  42. package/dist/esm/adapters/llm/anthropicModels.d.ts +37 -0
  43. package/dist/esm/adapters/llm/anthropicModels.js +70 -3
  44. package/dist/esm/adapters/llm/anthropicModels.js.map +1 -1
  45. package/dist/esm/adapters/observability/auditShapes/events/decisions.js +19 -0
  46. package/dist/esm/adapters/observability/auditShapes/events/decisions.js.map +1 -1
  47. package/dist/esm/core/agent/contextBinding/check.d.ts +68 -0
  48. package/dist/esm/core/agent/contextBinding/check.js +135 -0
  49. package/dist/esm/core/agent/contextBinding/check.js.map +1 -0
  50. package/dist/esm/core/agent/contextBinding/compare.d.ts +13 -0
  51. package/dist/esm/core/agent/contextBinding/compare.js +80 -0
  52. package/dist/esm/core/agent/contextBinding/compare.js.map +1 -0
  53. package/dist/esm/core/agent/contextBinding/composition.d.ts +54 -0
  54. package/dist/esm/core/agent/contextBinding/composition.js +79 -0
  55. package/dist/esm/core/agent/contextBinding/composition.js.map +1 -0
  56. package/dist/esm/core/agent/contextBinding/forCall.d.ts +23 -0
  57. package/dist/esm/core/agent/contextBinding/forCall.js +36 -0
  58. package/dist/esm/core/agent/contextBinding/forCall.js.map +1 -0
  59. package/dist/esm/core/agent/runValues.d.ts +3 -0
  60. package/dist/esm/core/agent/runValues.js +1 -0
  61. package/dist/esm/core/agent/runValues.js.map +1 -1
  62. package/dist/esm/core/agent/runtime/configuration/configure.js +6 -0
  63. package/dist/esm/core/agent/runtime/configuration/configure.js.map +1 -1
  64. package/dist/esm/core/agent/runtime/configuration/types.d.ts +5 -1
  65. package/dist/esm/core/agent/runtime/configuration/values.d.ts +1 -0
  66. package/dist/esm/core/agent/runtime/configuration/values.js.map +1 -1
  67. package/dist/esm/core/agent/runtime/native/initialize.js +1 -0
  68. package/dist/esm/core/agent/runtime/native/initialize.js.map +1 -1
  69. package/dist/esm/core/agent/runtime/request/factory.js +1 -0
  70. package/dist/esm/core/agent/runtime/request/factory.js.map +1 -1
  71. package/dist/esm/core/agent/stages/callLLM/prepareCall.d.ts +1 -0
  72. package/dist/esm/core/agent/stages/callLLM/prepareCall.js +13 -0
  73. package/dist/esm/core/agent/stages/callLLM/prepareCall.js.map +1 -1
  74. package/dist/esm/core/agent/stages/callLLM/types.d.ts +6 -0
  75. package/dist/esm/core/agent/stages/callLLM.js +2 -0
  76. package/dist/esm/core/agent/stages/callLLM.js.map +1 -1
  77. package/dist/esm/core/agent/types/observation.d.ts +34 -1
  78. package/dist/esm/events/payloads/contextChange.d.ts +68 -0
  79. package/dist/esm/events/payloads/contextChange.js +2 -0
  80. package/dist/esm/events/payloads/contextChange.js.map +1 -0
  81. package/dist/esm/events/payloads/stream.d.ts +13 -0
  82. package/dist/esm/events/payloads.d.ts +1 -0
  83. package/dist/esm/hosting/durability.d.ts +10 -0
  84. package/dist/esm/hosting/durability.js +54 -30
  85. package/dist/esm/hosting/durability.js.map +1 -1
  86. package/dist/esm/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
  87. package/dist/esm/hosting/standingAgent/artifacts/accountParts.js +9 -4
  88. package/dist/esm/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
  89. package/dist/esm/index.d.ts +1 -0
  90. package/dist/esm/observe.d.ts +1 -1
  91. package/dist/esm/observe.js.map +1 -1
  92. package/dist/esm/provider-contract/requestRefusal.js +3 -1
  93. package/dist/esm/provider-contract/requestRefusal.js.map +1 -1
  94. package/dist/esm/provider-contract/thinkingBinding.d.ts +20 -0
  95. package/dist/esm/provider-contract/thinkingBinding.js +27 -0
  96. package/dist/esm/provider-contract/thinkingBinding.js.map +1 -0
  97. package/dist/esm/provider-contract/types/provider.d.ts +43 -0
  98. package/dist/esm/provider-contract/types.d.ts +1 -1
  99. package/dist/esm/provider-contract/types.js.map +1 -1
  100. package/dist/esm/providers.d.ts +2 -0
  101. package/dist/esm/providers.js +2 -0
  102. package/dist/esm/providers.js.map +1 -1
  103. package/dist/esm/recorders/observability/FlowchartRecorder.d.ts +8 -120
  104. package/dist/esm/recorders/observability/FlowchartRecorder.js +16 -0
  105. package/dist/esm/recorders/observability/FlowchartRecorder.js.map +1 -1
  106. package/dist/esm/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
  107. package/dist/esm/recorders/observability/recordingParts/format.d.ts +87 -12
  108. package/dist/esm/recorders/observability/recordingParts/format.js +136 -17
  109. package/dist/esm/recorders/observability/recordingParts/format.js.map +1 -1
  110. package/dist/esm/recorders/observability/recordingParts/open.d.ts +41 -7
  111. package/dist/esm/recorders/observability/recordingParts/open.js +32 -6
  112. package/dist/esm/recorders/observability/recordingParts/open.js.map +1 -1
  113. package/dist/esm/recorders/observability/recordingParts/partReader.d.ts +25 -2
  114. package/dist/esm/recorders/observability/recordingParts/partReader.js +183 -15
  115. package/dist/esm/recorders/observability/recordingParts/partReader.js.map +1 -1
  116. package/dist/esm/recorders/observability/recordingParts/split.d.ts +13 -0
  117. package/dist/esm/recorders/observability/recordingParts/split.js +135 -26
  118. package/dist/esm/recorders/observability/recordingParts/split.js.map +1 -1
  119. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.d.ts +124 -0
  120. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js +389 -0
  121. package/dist/esm/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
  122. package/dist/esm/recorders/observability/stepGraphTypes.d.ts +139 -0
  123. package/dist/esm/recorders/observability/stepGraphTypes.js +10 -0
  124. package/dist/esm/recorders/observability/stepGraphTypes.js.map +1 -0
  125. package/dist/esm/redaction/knownStrings/fields-0.d.ts +5 -5
  126. package/dist/esm/redaction/knownStrings/fields-0.js +5 -5
  127. package/dist/esm/redaction/knownStrings/fields-0.js.map +1 -1
  128. package/dist/esm/redaction/knownStrings/fields-1.d.ts +7 -7
  129. package/dist/esm/redaction/knownStrings/fields-1.js +7 -7
  130. package/dist/esm/redaction/knownStrings/fields-1.js.map +1 -1
  131. package/dist/esm/redaction/knownStrings/fields-2.d.ts +7 -0
  132. package/dist/esm/redaction/knownStrings/fields-2.js +7 -0
  133. package/dist/esm/redaction/knownStrings/fields-2.js.map +1 -1
  134. package/dist/esm/redaction/knownStrings/words-0.d.ts +4 -4
  135. package/dist/esm/redaction/knownStrings/words-0.js +4 -4
  136. package/dist/esm/redaction/knownStrings/words-0.js.map +1 -1
  137. package/dist/esm/redaction/knownStrings/words-1.d.ts +5 -5
  138. package/dist/esm/redaction/knownStrings/words-1.js +5 -5
  139. package/dist/esm/redaction/knownStrings/words-1.js.map +1 -1
  140. package/dist/esm/redaction/knownStrings/words-2.d.ts +6 -0
  141. package/dist/esm/redaction/knownStrings/words-2.js +6 -0
  142. package/dist/esm/redaction/knownStrings/words-2.js.map +1 -1
  143. package/dist/esm/resilience/withCircuitBreaker.js +1 -0
  144. package/dist/esm/resilience/withCircuitBreaker.js.map +1 -1
  145. package/dist/esm/resilience/withFallback.js +4 -0
  146. package/dist/esm/resilience/withFallback.js.map +1 -1
  147. package/dist/esm/resilience/withRetry.js +1 -0
  148. package/dist/esm/resilience/withRetry.js.map +1 -1
  149. package/dist/esm/thinking/contextChange.d.ts +53 -0
  150. package/dist/esm/thinking/contextChange.js +101 -0
  151. package/dist/esm/thinking/contextChange.js.map +1 -0
  152. package/dist/esm/time-travel/servedView/recordReads.js +12 -0
  153. package/dist/esm/time-travel/servedView/recordReads.js.map +1 -1
  154. package/dist/esm/time-travel/servedView.d.ts +4 -1
  155. package/dist/esm/time-travel/servedView.js.map +1 -1
  156. package/dist/events/payloads/contextChange.js +3 -0
  157. package/dist/events/payloads/contextChange.js.map +1 -0
  158. package/dist/hosting/durability.js +54 -30
  159. package/dist/hosting/durability.js.map +1 -1
  160. package/dist/hosting/standingAgent/artifacts/accountParts.js +9 -4
  161. package/dist/hosting/standingAgent/artifacts/accountParts.js.map +1 -1
  162. package/dist/observe.js.map +1 -1
  163. package/dist/provider-contract/requestRefusal.js +3 -1
  164. package/dist/provider-contract/requestRefusal.js.map +1 -1
  165. package/dist/provider-contract/thinkingBinding.js +31 -0
  166. package/dist/provider-contract/thinkingBinding.js.map +1 -0
  167. package/dist/provider-contract/types.js.map +1 -1
  168. package/dist/providers.js +5 -1
  169. package/dist/providers.js.map +1 -1
  170. package/dist/recorders/observability/FlowchartRecorder.js +16 -0
  171. package/dist/recorders/observability/FlowchartRecorder.js.map +1 -1
  172. package/dist/recorders/observability/recordingParts/format.js +139 -18
  173. package/dist/recorders/observability/recordingParts/format.js.map +1 -1
  174. package/dist/recorders/observability/recordingParts/open.js +30 -4
  175. package/dist/recorders/observability/recordingParts/open.js.map +1 -1
  176. package/dist/recorders/observability/recordingParts/partReader.js +182 -14
  177. package/dist/recorders/observability/recordingParts/partReader.js.map +1 -1
  178. package/dist/recorders/observability/recordingParts/split.js +134 -25
  179. package/dist/recorders/observability/recordingParts/split.js.map +1 -1
  180. package/dist/recorders/observability/recordingParts/subflowPayloads.js +396 -0
  181. package/dist/recorders/observability/recordingParts/subflowPayloads.js.map +1 -0
  182. package/dist/recorders/observability/stepGraphTypes.js +11 -0
  183. package/dist/recorders/observability/stepGraphTypes.js.map +1 -0
  184. package/dist/redaction/knownStrings/fields-0.js +5 -5
  185. package/dist/redaction/knownStrings/fields-0.js.map +1 -1
  186. package/dist/redaction/knownStrings/fields-1.js +7 -7
  187. package/dist/redaction/knownStrings/fields-1.js.map +1 -1
  188. package/dist/redaction/knownStrings/fields-2.js +7 -0
  189. package/dist/redaction/knownStrings/fields-2.js.map +1 -1
  190. package/dist/redaction/knownStrings/words-0.js +4 -4
  191. package/dist/redaction/knownStrings/words-0.js.map +1 -1
  192. package/dist/redaction/knownStrings/words-1.js +5 -5
  193. package/dist/redaction/knownStrings/words-1.js.map +1 -1
  194. package/dist/redaction/knownStrings/words-2.js +6 -0
  195. package/dist/redaction/knownStrings/words-2.js.map +1 -1
  196. package/dist/resilience/withCircuitBreaker.js +1 -0
  197. package/dist/resilience/withCircuitBreaker.js.map +1 -1
  198. package/dist/resilience/withFallback.js +4 -0
  199. package/dist/resilience/withFallback.js.map +1 -1
  200. package/dist/resilience/withRetry.js +1 -0
  201. package/dist/resilience/withRetry.js.map +1 -1
  202. package/dist/thinking/contextChange.js +107 -0
  203. package/dist/thinking/contextChange.js.map +1 -0
  204. package/dist/time-travel/servedView/recordReads.js +12 -0
  205. package/dist/time-travel/servedView/recordReads.js.map +1 -1
  206. package/dist/time-travel/servedView.js.map +1 -1
  207. package/dist/types/adapters/llm/AnthropicProvider.d.ts +16 -0
  208. package/dist/types/adapters/llm/AnthropicProvider.d.ts.map +1 -1
  209. package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts +9 -0
  210. package/dist/types/adapters/llm/BrowserAnthropicProvider.d.ts.map +1 -1
  211. package/dist/types/adapters/llm/InvokeModelGatewayProvider.d.ts +10 -8
  212. package/dist/types/adapters/llm/InvokeModelGatewayProvider.d.ts.map +1 -1
  213. package/dist/types/adapters/llm/anthropicModels.d.ts +37 -0
  214. package/dist/types/adapters/llm/anthropicModels.d.ts.map +1 -1
  215. package/dist/types/adapters/observability/auditShapes/events/decisions.d.ts.map +1 -1
  216. package/dist/types/core/agent/contextBinding/check.d.ts +69 -0
  217. package/dist/types/core/agent/contextBinding/check.d.ts.map +1 -0
  218. package/dist/types/core/agent/contextBinding/compare.d.ts +14 -0
  219. package/dist/types/core/agent/contextBinding/compare.d.ts.map +1 -0
  220. package/dist/types/core/agent/contextBinding/composition.d.ts +55 -0
  221. package/dist/types/core/agent/contextBinding/composition.d.ts.map +1 -0
  222. package/dist/types/core/agent/contextBinding/forCall.d.ts +24 -0
  223. package/dist/types/core/agent/contextBinding/forCall.d.ts.map +1 -0
  224. package/dist/types/core/agent/runValues.d.ts +3 -0
  225. package/dist/types/core/agent/runValues.d.ts.map +1 -1
  226. package/dist/types/core/agent/runtime/configuration/configure.d.ts.map +1 -1
  227. package/dist/types/core/agent/runtime/configuration/types.d.ts +5 -1
  228. package/dist/types/core/agent/runtime/configuration/types.d.ts.map +1 -1
  229. package/dist/types/core/agent/runtime/configuration/values.d.ts +1 -0
  230. package/dist/types/core/agent/runtime/configuration/values.d.ts.map +1 -1
  231. package/dist/types/core/agent/runtime/native/initialize.d.ts.map +1 -1
  232. package/dist/types/core/agent/runtime/request/factory.d.ts.map +1 -1
  233. package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts +1 -0
  234. package/dist/types/core/agent/stages/callLLM/prepareCall.d.ts.map +1 -1
  235. package/dist/types/core/agent/stages/callLLM/types.d.ts +6 -0
  236. package/dist/types/core/agent/stages/callLLM/types.d.ts.map +1 -1
  237. package/dist/types/core/agent/stages/callLLM.d.ts.map +1 -1
  238. package/dist/types/core/agent/types/observation.d.ts +34 -1
  239. package/dist/types/core/agent/types/observation.d.ts.map +1 -1
  240. package/dist/types/events/payloads/contextChange.d.ts +69 -0
  241. package/dist/types/events/payloads/contextChange.d.ts.map +1 -0
  242. package/dist/types/events/payloads/stream.d.ts +13 -0
  243. package/dist/types/events/payloads/stream.d.ts.map +1 -1
  244. package/dist/types/events/payloads.d.ts +1 -0
  245. package/dist/types/events/payloads.d.ts.map +1 -1
  246. package/dist/types/hosting/durability.d.ts +10 -0
  247. package/dist/types/hosting/durability.d.ts.map +1 -1
  248. package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts +3 -2
  249. package/dist/types/hosting/standingAgent/artifacts/accountParts.d.ts.map +1 -1
  250. package/dist/types/index.d.ts +1 -0
  251. package/dist/types/index.d.ts.map +1 -1
  252. package/dist/types/observe.d.ts +1 -1
  253. package/dist/types/observe.d.ts.map +1 -1
  254. package/dist/types/provider-contract/requestRefusal.d.ts.map +1 -1
  255. package/dist/types/provider-contract/thinkingBinding.d.ts +21 -0
  256. package/dist/types/provider-contract/thinkingBinding.d.ts.map +1 -0
  257. package/dist/types/provider-contract/types/provider.d.ts +43 -0
  258. package/dist/types/provider-contract/types/provider.d.ts.map +1 -1
  259. package/dist/types/provider-contract/types.d.ts +1 -1
  260. package/dist/types/provider-contract/types.d.ts.map +1 -1
  261. package/dist/types/providers.d.ts +2 -0
  262. package/dist/types/providers.d.ts.map +1 -1
  263. package/dist/types/recorders/observability/FlowchartRecorder.d.ts +8 -120
  264. package/dist/types/recorders/observability/FlowchartRecorder.d.ts.map +1 -1
  265. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts +9 -0
  266. package/dist/types/recorders/observability/boundaryRecorder/domainEvents.d.ts.map +1 -1
  267. package/dist/types/recorders/observability/recordingParts/format.d.ts +87 -12
  268. package/dist/types/recorders/observability/recordingParts/format.d.ts.map +1 -1
  269. package/dist/types/recorders/observability/recordingParts/open.d.ts +41 -7
  270. package/dist/types/recorders/observability/recordingParts/open.d.ts.map +1 -1
  271. package/dist/types/recorders/observability/recordingParts/partReader.d.ts +25 -2
  272. package/dist/types/recorders/observability/recordingParts/partReader.d.ts.map +1 -1
  273. package/dist/types/recorders/observability/recordingParts/split.d.ts +13 -0
  274. package/dist/types/recorders/observability/recordingParts/split.d.ts.map +1 -1
  275. package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts +125 -0
  276. package/dist/types/recorders/observability/recordingParts/subflowPayloads.d.ts.map +1 -0
  277. package/dist/types/recorders/observability/stepGraphTypes.d.ts +140 -0
  278. package/dist/types/recorders/observability/stepGraphTypes.d.ts.map +1 -0
  279. package/dist/types/redaction/knownStrings/fields-0.d.ts +5 -5
  280. package/dist/types/redaction/knownStrings/fields-1.d.ts +7 -7
  281. package/dist/types/redaction/knownStrings/fields-2.d.ts +7 -0
  282. package/dist/types/redaction/knownStrings/fields-2.d.ts.map +1 -1
  283. package/dist/types/redaction/knownStrings/words-0.d.ts +4 -4
  284. package/dist/types/redaction/knownStrings/words-1.d.ts +5 -5
  285. package/dist/types/redaction/knownStrings/words-2.d.ts +6 -0
  286. package/dist/types/redaction/knownStrings/words-2.d.ts.map +1 -1
  287. package/dist/types/resilience/withCircuitBreaker.d.ts.map +1 -1
  288. package/dist/types/resilience/withFallback.d.ts.map +1 -1
  289. package/dist/types/resilience/withRetry.d.ts.map +1 -1
  290. package/dist/types/thinking/contextChange.d.ts +54 -0
  291. package/dist/types/thinking/contextChange.d.ts.map +1 -0
  292. package/dist/types/time-travel/servedView/recordReads.d.ts.map +1 -1
  293. package/dist/types/time-travel/servedView.d.ts +4 -1
  294. package/dist/types/time-travel/servedView.d.ts.map +1 -1
  295. package/package.json +1 -1
@@ -0,0 +1,68 @@
1
+ /**
2
+ * What differs between a model request and the request the newest signed
3
+ * reasoning in its history was written under — by NAME, never by value.
4
+ *
5
+ * Carried on `agentfootprint.stream.llm_start` (`contextChange`) and on
6
+ * `ContextChangedError`. Present only on a model whose provider answers
7
+ * `thinkingBinding` with `bound` or `unknown`, and only when signed reasoning
8
+ * is in the history.
9
+ */
10
+ import type { ContextSource } from '../types.js';
11
+ import type { ToolNameChannel } from './toolCatalog.js';
12
+ /** One named difference. Which fields are set depends on `slot`. */
13
+ export interface ContextChange {
14
+ /** The part of the request that differs. */
15
+ readonly slot: 'system-prompt' | 'tools' | 'messages';
16
+ /**
17
+ * `added` / `removed` / `changed`. For `messages`, `removed` means a message
18
+ * the reasoning was written after is no longer in the request, and `changed`
19
+ * that it differs.
20
+ */
21
+ readonly change: 'added' | 'removed' | 'changed';
22
+ /** `system-prompt`: the piece's source (`skill`, `instructions`, …). */
23
+ readonly source?: ContextSource;
24
+ /** `system-prompt`: the piece's own id (a skill id, an injection id), when it has one. */
25
+ readonly id?: string;
26
+ /** `tools`: the tool's name. */
27
+ readonly tool?: string;
28
+ /** `tools`: who put the tool forward, when the run recorded it. */
29
+ readonly party?: {
30
+ readonly channel: ToolNameChannel;
31
+ readonly id?: string;
32
+ };
33
+ /** `messages`: the message's position in the conversation. */
34
+ readonly position?: number;
35
+ /** `messages`: the message's role. */
36
+ readonly role?: string;
37
+ }
38
+ /** The comparison one request received. */
39
+ export interface ContextChangeCheck {
40
+ /**
41
+ * `compared`: this request was compared with the request the newest signed
42
+ * reasoning on its wire was written under. `unchecked`: that reasoning came
43
+ * from a response this run did not record (a conversation continued or
44
+ * restored from storage), so nothing could be compared; said once per such
45
+ * response, on the first request that carries it.
46
+ */
47
+ readonly check: 'compared' | 'unchecked';
48
+ /**
49
+ * True when the reasoning belongs to an unfinished tool turn on a `bound`
50
+ * model: the request is not sent. Never true on an `unknown` one.
51
+ */
52
+ readonly refused: boolean;
53
+ /**
54
+ * The model's binding as the provider (or the app, through the adapter's
55
+ * `thinkingBinding` option) answered it. `unknown`: an id the adapter cannot
56
+ * place — the change is recorded and the request is sent; the provider
57
+ * decides.
58
+ */
59
+ readonly binding: 'bound' | 'unknown';
60
+ /** Who stated the binding: the provider's own knowledge, or the app. */
61
+ readonly by: 'provider' | 'app';
62
+ /** The app's `thinkingBinding` statement for this id threw or answered something unusable, so it was not used. */
63
+ readonly appStatement?: 'failed';
64
+ /** The named differences, at most 16. Empty when unchecked. */
65
+ readonly changes: readonly ContextChange[];
66
+ /** Differences beyond the cap, counted. Absent when none were left out. */
67
+ readonly omittedChanges?: number;
68
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=contextChange.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contextChange.js","sourceRoot":"","sources":["../../../../src/events/payloads/contextChange.ts"],"names":[],"mappings":""}
@@ -50,6 +50,19 @@ export interface LLMStartPayload {
50
50
  readonly via: 'skill' | 'escalation';
51
51
  readonly skillId?: string;
52
52
  };
53
+ /**
54
+ * On a model whose thinking is bound to its context, or whose binding the
55
+ * provider cannot tell (`thinkingBinding` answers `bound` or `unknown`): what
56
+ * this request changes under the newest signed reasoning on its wire, by
57
+ * name, when that reasoning was written by a model of the same family.
58
+ * `refused: true` means the call stops here with `ContextChangedError`
59
+ * (bound models only). A row with `check: 'unchecked'` appears ONCE per
60
+ * signed response this run did not record (a continued or restored
61
+ * conversation): nothing could be compared for it.
62
+ * ABSENT otherwise: when nothing changed, when no such reasoning is on the
63
+ * wire, and on every unbound model — those runs keep their exact prior bytes.
64
+ */
65
+ readonly contextChange?: import('./contextChange.js').ContextChangeCheck;
53
66
  }
54
67
  export interface LLMEndPayload {
55
68
  readonly iteration: number;
@@ -10,6 +10,7 @@
10
10
  export type { CompositionEnterPayload, CompositionExitPayload, ParallelForkStartPayload, ParallelBranchCompletePayload, ParallelMergeEndPayload, ConditionalRouteDecidedPayload, LoopIterationStartPayload, LoopIterationExitPayload, } from './payloads/flow.js';
11
11
  export type { AgentTurnStartPayload, AgentTurnEndPayload, AgentBudgetExhaustedPayload, AgentIterationStartPayload, AgentIterationEndPayload, FixedRouteRationale, FixedPauseReason, AgentRouteDecidedPayload, AgentHandoffPayload, AgentAroundTurnFailedPayload, } from './payloads/agent.js';
12
12
  export type { LLMStartPayload, LLMEndPayload, LLMTokenPayload, ToolStartPayload, ToolProgressPayload, ToolEndPayload, } from './payloads/stream.js';
13
+ export type { ContextChange, ContextChangeCheck } from './payloads/contextChange.js';
13
14
  export type { ContextInjectedPayload, ContextEvictedPayload, ContextSlotComposedPayload, ContextBudgetPressurePayload, SkillGuardValueRecord, SkillGuardEvaluationRecord, ContextEvaluatedPayload, } from './payloads/context.js';
14
15
  export type { ContextRecordedPayload, ContextRecordedPiece } from './payloads/contextRecorded.js';
15
16
  export type { ErrorFatalPayload, PauseRequestPayload, PauseResumePayload, CheckInRequestPayload, CheckInDecisionPayload, MiddlewareDecisionPayload, } from './payloads/consent.js';
@@ -28,6 +28,16 @@
28
28
  * "this commit wrote `history`", which is not an optimisation but the honest
29
29
  * reading of the question: the conversation moved iff `history` moved.
30
30
  *
31
+ * "This commit wrote `history`" is learned from the WRITES, not from the commit
32
+ * event's `mutations`: every `onWrite` of `history` marks its stage (by
33
+ * `runtimeStageId`), and that stage's `onCommit` acts on the mark. `mutations`
34
+ * is the snapshot's write view, which the run's `writeTracking` dial governs:
35
+ * under `'off'` it is empty, and a durability promise must not depend on an
36
+ * observability dial. `onWrite` fires for every write in every mode. A
37
+ * retried stage's discarded attempt drops its mark (`onStageRetry`), as the
38
+ * engine drops its staged writes, so the commits that trigger are exactly the
39
+ * ones whose write view holds `history` under `'full'` or `'summary'`.
40
+ *
31
41
  * ── What a commit boundary actually guarantees, and what it does not ─────────
32
42
  * It guarantees the whole stage. The agent dispatches ALL of one iteration's
33
43
  * tool calls inside one stage body, so a crash part-way through that body stores
@@ -28,6 +28,16 @@
28
28
  * "this commit wrote `history`", which is not an optimisation but the honest
29
29
  * reading of the question: the conversation moved iff `history` moved.
30
30
  *
31
+ * "This commit wrote `history`" is learned from the WRITES, not from the commit
32
+ * event's `mutations`: every `onWrite` of `history` marks its stage (by
33
+ * `runtimeStageId`), and that stage's `onCommit` acts on the mark. `mutations`
34
+ * is the snapshot's write view, which the run's `writeTracking` dial governs:
35
+ * under `'off'` it is empty, and a durability promise must not depend on an
36
+ * observability dial. `onWrite` fires for every write in every mode. A
37
+ * retried stage's discarded attempt drops its mark (`onStageRetry`), as the
38
+ * engine drops its staged writes, so the commits that trigger are exactly the
39
+ * ones whose write view holds `history` under `'full'` or `'summary'`.
40
+ *
31
41
  * ── What a commit boundary actually guarantees, and what it does not ─────────
32
42
  * It guarantees the whole stage. The agent dispatches ALL of one iteration's
33
43
  * tool calls inside one stage body, so a crash part-way through that body stores
@@ -112,36 +122,50 @@ export function durableWriter(options) {
112
122
  };
113
123
  pump();
114
124
  }
115
- const capture = ({ sessionId, runId, identity, state }) => ({
116
- id: 'af-hosting-durability',
117
- // INLINE, always. A write delivered one beat behind is a write that can be
118
- // lost by the very crash it exists to survive — and under `'sync'` the
119
- // barrier would be waiting on a snapshot the queue had not handed over yet.
120
- // The causal-evidence bridge and the compaction meter are inline for the
121
- // same class of reason.
122
- delivery: 'inline',
123
- // The conversation moved iff this commit wrote `history`. The commit event
124
- // says WHICH keys moved — a key's NAME is never redacted — and the run's
125
- // live state says what they now hold: real values, the conversation the
126
- // next turn resumes from. The event's own values are the record's form,
127
- // which an agent's `redact` may have turned into placeholders.
128
- onCommit(event) {
129
- if (!event.mutations.some((mutation) => mutation.key === 'history'))
130
- return;
131
- if (sessionId === undefined)
132
- return;
133
- const origin = runId();
134
- if (origin === undefined)
135
- return;
136
- const live = state();
137
- const history = live?.['history'];
138
- if (!Array.isArray(history))
139
- return;
140
- const userMessage = live?.['userMessage'];
141
- const iteration = live?.['iteration'];
142
- enqueue(sessionId, origin, history, typeof userMessage === 'string' ? userMessage : '', typeof iteration === 'number' ? iteration : 0, identity());
143
- },
144
- });
125
+ const capture = ({ sessionId, runId, identity, state }) => {
126
+ /** The stages (by `runtimeStageId`) that wrote `history` and have not committed yet. */
127
+ const wroteHistory = new Set();
128
+ return {
129
+ id: 'af-hosting-durability',
130
+ // INLINE, always. A write delivered one beat behind is a write that can be
131
+ // lost by the very crash it exists to survive — and under `'sync'` the
132
+ // barrier would be waiting on a snapshot the queue had not handed over yet.
133
+ // The causal-evidence bridge and the compaction meter are inline for the
134
+ // same class of reason.
135
+ delivery: 'inline',
136
+ // The conversation moved iff this stage wrote `history`. The write says
137
+ // WHICH key moved — a key's NAME is never redacted — and the run's live
138
+ // state, read at the commit, says what it now holds: real values, the
139
+ // conversation the next turn resumes from. A write's own value is the
140
+ // record's form, which an agent's `redact` may have turned into a placeholder.
141
+ onWrite(event) {
142
+ if (event.key === 'history')
143
+ wroteHistory.add(event.runtimeStageId);
144
+ },
145
+ // A failed attempt's writes are discarded before the next one runs.
146
+ onStageRetry(event) {
147
+ const stage = event.traversalContext?.runtimeStageId;
148
+ if (stage !== undefined)
149
+ wroteHistory.delete(stage);
150
+ },
151
+ onCommit(event) {
152
+ if (!wroteHistory.delete(event.runtimeStageId))
153
+ return;
154
+ if (sessionId === undefined)
155
+ return;
156
+ const origin = runId();
157
+ if (origin === undefined)
158
+ return;
159
+ const live = state();
160
+ const history = live?.['history'];
161
+ if (!Array.isArray(history))
162
+ return;
163
+ const userMessage = live?.['userMessage'];
164
+ const iteration = live?.['iteration'];
165
+ enqueue(sessionId, origin, history, typeof userMessage === 'string' ? userMessage : '', typeof iteration === 'number' ? iteration : 0, identity());
166
+ },
167
+ };
168
+ };
145
169
  const settle = async () => {
146
170
  // Loop rather than await once: a write that completes may release a queued
147
171
  // successor, and "settled" has to mean nothing is left.
@@ -1 +1 @@
1
- {"version":3,"file":"durability.js","sourceRoot":"","sources":["../../../src/hosting/durability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AAIH,OAAO,EAAE,wBAAwB,EAAE,MAAM,8BAA8B,CAAC;AACxE,OAAO,EAAE,oBAAoB,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAC;AAmElF;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,OAA6B;IACzD,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,OAAO,CAAC;IAEhC,uEAAuE;IACvE,IAAI,QAAmC,CAAC;IACxC;;;;OAIG;IACH,IAAI,MAA2E,CAAC;IAChF;;;;;OAKG;IACH,IAAI,OAA0B,CAAC;IAE/B,SAAS,IAAI;QACX,IAAI,QAAQ,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS;YAAE,OAAO;QAC3D,MAAM,IAAI,GAAG,MAAM,CAAC;QACpB,MAAM,GAAG,SAAS,CAAC;QACnB,QAAQ,GAAG,KAAK,CAAC,IAAI,CAAC,SAAS,EAAE,IAAI,CAAC,YAA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AAC,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC;oBAAE,OAAO;gBACpC,MAAM,WAAW,GAAG,IAAI,EAAE,CAAC,aAAa,CAAC,CAAC;gBAC1C,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC,WAAW,CAAC,CAAC;gBACtC,OAAO,CACL,SAAS,EACT,MAAM,EACN,OAAgC,EAChC,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,EAClD,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,EAC7C,QAAQ,EAAE,CACX,CAAC;YACJ,CAAC;SACF,CAAC;IACJ,CAAC,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,IAAmB,EAAE;QACvC,2EAA2E;QAC3E,wDAAwD;QACxD,OAAO,QAAQ,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACtD,IAAI,EAAE,CAAC;YACP,MAAM,QAAQ,CAAC;QACjB,CAAC;QACD,IAAI,OAAO;YAAE,MAAM,OAAO,CAAC;IAC7B,CAAC,CAAC;IAEF,OAAO;QACL,OAAO;QACP,OAAO,CAAC,KAAa;YACnB,yEAAyE;YACzE,yEAAyE;YACzE,IAAI,IAAI,KAAK,MAAM;gBAAE,OAAO,GAAG,EAAE,CAAC,SAAS,CAAC;YAC5C,OAAO,wBAAwB,CAAC,KAAK,EAAE,GAAG,EAAE;gBAC1C,IAAI,QAAQ,KAAK,SAAS,IAAI,MAAM,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;oBACzE,OAAO,SAAS,CAAC;gBACnB,OAAO,MAAM,EAAE,CAAC;YAClB,CAAC,CAAC,CAAC;QACL,CAAC;QACD,MAAM;KACP,CAAC;AACJ,CAAC"}
@@ -23,8 +23,9 @@
23
23
  * (base included), and no other `get`.
24
24
  * 3. **The ceiling on the whole** — `maxRecordingBytes` bounds the STORED part
25
25
  * bytes (base and invocation parts, each with its small part wrapper;
26
- * proven alias copies are restored by reference and not counted), and a
27
- * packed part by what it expands to. So within a narrow band a parts
26
+ * proven alias copies are restored by reference and not counted) PLUS the
27
+ * sub-flow payloads a whole read restores from results (index format 2,
28
+ * `sizes.restoredBytes`), and a packed part by what it expands to. So within a narrow band a parts
28
29
  * recording is explained where the same run filed whole is over the
29
30
  * ceiling. When the index's stored totals already pass it, the named 413
30
31
  * comes before any part is read; a packed part that would expand past
@@ -23,8 +23,9 @@
23
23
  * (base included), and no other `get`.
24
24
  * 3. **The ceiling on the whole** — `maxRecordingBytes` bounds the STORED part
25
25
  * bytes (base and invocation parts, each with its small part wrapper;
26
- * proven alias copies are restored by reference and not counted), and a
27
- * packed part by what it expands to. So within a narrow band a parts
26
+ * proven alias copies are restored by reference and not counted) PLUS the
27
+ * sub-flow payloads a whole read restores from results (index format 2,
28
+ * `sizes.restoredBytes`), and a packed part by what it expands to. So within a narrow band a parts
28
29
  * recording is explained where the same run filed whole is over the
29
30
  * ceiling. When the index's stored totals already pass it, the named 413
30
31
  * comes before any part is read; a packed part that would expand past
@@ -64,8 +65,12 @@ export async function explainPartsRecording(service, store, scope, ref, bound) {
64
65
  service.drop(key);
65
66
  return { status: 'not-found' };
66
67
  }
67
- // Provable from the index alone: the stored parts already pass the ceiling.
68
- if (opened.sizes.storedBytes - (opened.sizes.index ?? 0) > ceiling)
68
+ // Decided from the index alone: the stored parts, with the payloads a whole
69
+ // read restores from results, already pass the ceiling. The restored share is
70
+ // the index's claim, so this only refuses early: a pass is provisional, and
71
+ // `readWhole` measures what it restores against the same ceiling (a figure
72
+ // that does not match is `part-changed`, the op's one not-found).
73
+ if (opened.sizes.restoredBytes - (opened.sizes.index ?? 0) > ceiling)
69
74
  return { status: 'too-large' };
70
75
  const answer = service.cached(key) ??
71
76
  (await service.compute(key, async () => {
@@ -1 +1 @@
1
- {"version":3,"file":"accountParts.js","sourceRoot":"","sources":["../../../../../src/hosting/standingAgent/artifacts/accountParts.ts"],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G,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,CAAC,GAAG,OAAO;QAClE,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;IAEjC,MAAM,MAAM,GACV,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC;QACnB,CAAC,MAAM,OAAO,CAAC,OAAO,CAAC,GAAG,EAAE,KAAK,IAAI,EAAE;YACrC,OAAO,GAAG,KAAK,CAAC;YAChB,MAAM,KAAK,GAAG,MAAM,MAAM,CAAC,SAAS,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,CAAC,CAAC;YAC5D,IAAI,KAAK,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBAC7B,OAAO;oBACL,IAAI,EAAE,KAAK,CAAC,SAAS;oBACrB,GAAG,CAAC,MAAM,CAAC,KAAK,KAAK,SAAS,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;iBAC3D,CAAC;YACJ,CAAC;YACD,wEAAwE;YACxE,uDAAuD;YACvD,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW;gBAAE,MAAM,IAAI,gCAAgC,CAAC,OAAO,CAAC,CAAC;YACtF,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC,CAAC;IACN,OAAO,MAAM,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAC,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC;AACpF,CAAC"}
@@ -38,6 +38,7 @@ export type { ObserverDrainResult, ObserverStats } from 'footprintjs';
38
38
  export type { ToolArgValidationMode } from './tools/toolArgsValidation.js';
39
39
  export { isTruncatedToolResult, type TruncatedToolResult } from './core/agent/toolResultCap.js';
40
40
  export type { ReadSummaryMarker, ReadTrackingMode } from 'footprintjs';
41
+ export type { WriteSummaryMarker, WriteTrackingMode } from 'footprintjs';
41
42
  export type { WriteProvenanceMode } from './core/agent/types.js';
42
43
  export type { ExternalGroundsProvider } from './core/agent/types.js';
43
44
  export type { ExternalGround, ExternalGrounding } from './integrity/unsupported-argument/check.js';
@@ -40,7 +40,7 @@ export { RunStepRecorder, runStepRecorder, type RunStep, type RunStepKind, type
40
40
  export { attachFlowchart, buildStepGraph, buildStepGraphFromEvents, type StepGraph, type StepNode, type StepEdge, type SlotBoundary, type ContextInjection, type FlowchartOptions, type FlowchartHandle, } from './recorders/observability/FlowchartRecorder.js';
41
41
  export { recordRun, type Recording, type RecordRunOptions, type RunRecorder, } from './recorders/observability/recordRun.js';
42
42
  export { recordingSizeReport, type RecordingSizeFields, type RecordingSizeMount, type RecordingSizeReport, type RecordingSizeRow, } from './recorders/observability/recordingSizeReport.js';
43
- export { openSavedRecording, type OpenSavedRecordingOptions, type SavedInvocation, type SavedRecording, type SavedRecordingArtifacts, type SavedRecordingPartUnavailable, type SavedRecordingReadOptions, type SavedRecordingSizes, type SavedRecordingUnavailable, type SavedRecordingWholeOptions, } from './recorders/observability/recordingParts/open.js';
43
+ export { openSavedRecording, type OpenSavedRecordingOptions, type SavedInvocation, type SavedInvocationPayloads, type SavedPayloadSlot, type SavedRecording, type SavedRecordingArtifacts, type SavedRecordingPartUnavailable, type SavedRecordingReadOptions, type SavedRecordingSizes, type SavedRecordingUnavailable, type SavedRecordingWholeOptions, } from './recorders/observability/recordingParts/open.js';
44
44
  export { contextShapeAt, type RecordedContextShape, } from './recorders/observability/contextShapes/read.js';
45
45
  export type { ContextShapeIndex, ContextShapeOptions, ShapeEntry, } from './recorders/observability/contextShapes.js';
46
46
  export { recordContextRun, readContextRecording, applyContextChange, contextCallCommentary, ContextRecordingError, type ContextRunRecorder, type RecordContextRunOptions, type ContextCallChange, type ContextValueWriter, type ContextValueReader, type ContextValueRecording, type OpenContextValues, type ReadContextRecording, } from './recorders/observability/contextRecording.js';
@@ -1 +1 @@
1
- {"version":3,"file":"observe.js","sourceRoot":"","sources":["../../src/observe.ts"],"names":[],"mappings":"AAAA;;;;;;;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AO,EACL,mBAAmB,GAMpB,MAAM,kDAAkD,CAAC;AAC1D,gFAAgF;AAChF,gFAAgF;AAChF,OAAO,EACL,kBAAkB,GAQnB,MAAM,yDAAyD,CAAC;AAEjE,uDAAuD;AACvD,OAAO,EAAE,SAAS,EAAE,MAAM,+BAA+B,CAAC;AAE1D,kEAAkE;AAClE,uEAAuE;AACvE,0EAA0E;AAC1E,4EAA4E;AAC5E,6EAA6E;AAC7E,yDAAyD;AACzD,cAAc,YAAY,CAAC;AAC3B,sEAAsE;AACtE,uEAAuE;AACvE,qEAAqE;AACrE,oEAAoE;AACpE,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAOnB,MAAM,iDAAiD,CAAC;AAEzD,OAAO,EACL,aAAa,EACb,cAAc,GAOf,MAAM,4CAA4C,CAAC;AAEpD,sEAAsE;AACtE,4EAA4E;AAC5E,2CAA2C;AAC3C,OAAO,EACL,aAAa,EACb,cAAc,EACd,iBAAiB,EACjB,WAAW,GACZ,MAAM,2BAA2B,CAAC"}
@@ -3,6 +3,7 @@ import { UnsupportedToolChoiceError } from './forcedToolChoice.js';
3
3
  import { UnsupportedNativeOutputError } from './nativeOutputSchema.js';
4
4
  import { UnsupportedThinkingError } from '../thinking/errors.js';
5
5
  import { UnsafeThinkingReplayError } from '../thinking/replay.js';
6
+ import { ContextChangedError } from '../thinking/contextChange.js';
6
7
  import { isProviderInterventionError } from './intervention.js';
7
8
  /** Deliberately narrow: unrelated application errors keep their existing policy. */
8
9
  export function isRequestRefusal(error) {
@@ -10,6 +11,7 @@ export function isRequestRefusal(error) {
10
11
  error instanceof UnsupportedToolChoiceError ||
11
12
  error instanceof UnsupportedNativeOutputError ||
12
13
  error instanceof UnsupportedThinkingError ||
13
- error instanceof UnsafeThinkingReplayError);
14
+ error instanceof UnsafeThinkingReplayError ||
15
+ error instanceof ContextChangedError);
14
16
  }
15
17
  //# sourceMappingURL=requestRefusal.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"requestRefusal.js","sourceRoot":"","sources":["../../../src/provider-contract/requestRefusal.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,KAAK,YAAY,0BAA0B;QAC3C,KAAK,YAAY,4BAA4B;QAC7C,KAAK,YAAY,wBAAwB;QACzC,KAAK,YAAY,yBAAyB,CAC3C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"requestRefusal.js","sourceRoot":"","sources":["../../../src/provider-contract/requestRefusal.ts"],"names":[],"mappings":"AAAA,kFAAkF;AAClF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,yBAAyB,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;AACnE,OAAO,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAC;AAEhE,oFAAoF;AACpF,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,OAAO,CACL,2BAA2B,CAAC,KAAK,CAAC;QAClC,KAAK,YAAY,0BAA0B;QAC3C,KAAK,YAAY,4BAA4B;QAC7C,KAAK,YAAY,wBAAwB;QACzC,KAAK,YAAY,yBAAyB;QAC1C,KAAK,YAAY,mBAAmB,CACrC,CAAC;AACJ,CAAC"}
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Whether a model's thinking is bound to the context it was written under —
3
+ * `bound`, `unbound` or `unknown` — and who said so. The one reader of
4
+ * {@link LLMProvider.thinkingBinding}.
5
+ *
6
+ * Absence means unbound, so every provider that never heard of the capability
7
+ * (OpenAI-family, Gemini, Ollama, a hand-written mock) keeps its exact
8
+ * request path. The Anthropic-wire adapters answer per model from their table,
9
+ * `unknown` for an id the table cannot place, and take an app's statement for
10
+ * such an id through their `thinkingBinding` option (`by: 'app'`). A
11
+ * declaration that throws or answers something else reads as `unknown`.
12
+ *
13
+ * @example
14
+ * thinkingBindingOf(anthropic(), 'claude-haiku-5-5'); // { binding: 'bound', by: 'provider' }
15
+ * thinkingBindingOf(anthropic(), 'claude-opus-6'); // { binding: 'unknown', by: 'provider' }
16
+ * thinkingBindingOf(openai(), 'gpt-5'); // { binding: 'unbound', by: 'provider' }
17
+ */
18
+ import type { LLMProvider, ThinkingBinding } from './types.js';
19
+ export type { ThinkingBinding } from './types.js';
20
+ export declare function thinkingBindingOf(provider: Pick<LLMProvider, 'thinkingBinding'>, model: string): ThinkingBinding;
@@ -0,0 +1,27 @@
1
+ const UNBOUND = Object.freeze({ binding: 'unbound', by: 'provider' });
2
+ const UNKNOWN = Object.freeze({ binding: 'unknown', by: 'provider' });
3
+ export function thinkingBindingOf(provider, model) {
4
+ if (provider.thinkingBinding === undefined)
5
+ return UNBOUND;
6
+ let answer;
7
+ try {
8
+ answer = provider.thinkingBinding(model);
9
+ }
10
+ catch {
11
+ // A declaration that throws is not evidence either way: unknown, which
12
+ // records and never refuses. The run itself is not failed by it.
13
+ return UNKNOWN;
14
+ }
15
+ const binding = answer?.binding;
16
+ // A malformed answer is not evidence either way: unknown.
17
+ if (binding !== 'bound' && binding !== 'unbound' && binding !== 'unknown')
18
+ return UNKNOWN;
19
+ return {
20
+ binding,
21
+ by: answer?.by === 'app' ? 'app' : 'provider',
22
+ ...(typeof answer?.family === 'string' && { family: answer.family }),
23
+ ...(typeof answer?.model === 'string' && { model: answer.model }),
24
+ ...(answer?.appStatement === 'failed' && { appStatement: 'failed' }),
25
+ };
26
+ }
27
+ //# sourceMappingURL=thinkingBinding.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"thinkingBinding.js","sourceRoot":"","sources":["../../../src/provider-contract/thinkingBinding.ts"],"names":[],"mappings":"AAqBA,MAAM,OAAO,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AACvF,MAAM,OAAO,GAAoB,MAAM,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,UAAU,EAAE,CAAC,CAAC;AAEvF,MAAM,UAAU,iBAAiB,CAC/B,QAA8C,EAC9C,KAAa;IAEb,IAAI,QAAQ,CAAC,eAAe,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC3D,IAAI,MAA4C,CAAC;IACjD,IAAI,CAAC;QACH,MAAM,GAAG,QAAQ,CAAC,eAAe,CAAC,KAAK,CAAyC,CAAC;IACnF,CAAC;IAAC,MAAM,CAAC;QACP,uEAAuE;QACvE,iEAAiE;QACjE,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,CAAC;IAChC,0DAA0D;IAC1D,IAAI,OAAO,KAAK,OAAO,IAAI,OAAO,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS;QAAE,OAAO,OAAO,CAAC;IAC1F,OAAO;QACL,OAAO;QACP,EAAE,EAAE,MAAM,EAAE,EAAE,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,UAAU;QAC7C,GAAG,CAAC,OAAO,MAAM,EAAE,MAAM,KAAK,QAAQ,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,CAAC;QACpE,GAAG,CAAC,OAAO,MAAM,EAAE,KAAK,KAAK,QAAQ,IAAI,EAAE,KAAK,EAAE,MAAM,CAAC,KAAK,EAAE,CAAC;QACjE,GAAG,CAAC,MAAM,EAAE,YAAY,KAAK,QAAQ,IAAI,EAAE,YAAY,EAAE,QAAiB,EAAE,CAAC;KAC9E,CAAC;AACJ,CAAC"}
@@ -165,6 +165,24 @@ export interface LLMProvider {
165
165
  * `withFallback` answers for its pair.
166
166
  */
167
167
  readonly thinkingMode?: (model: string) => import('../../thinking/types.js').ThinkingMode;
168
+ /**
169
+ * Whether a thinking block this model returns stays valid only under the
170
+ * system prompt, tool list and earlier messages it was written under
171
+ * (Anthropic's preserved thinking: the API refuses or drops a block replayed
172
+ * after any of them changed) — `bound`, `unbound` or `unknown`, and who said
173
+ * so. Read with `thinkingBindingOf(provider, model)`. On a `bound` model the
174
+ * agent refuses by name a tool turn whose context changed under its signed
175
+ * reasoning (`ContextChangedError`); on an `unknown` one it sends the request
176
+ * and records the change.
177
+ *
178
+ * A plain function of the model id (no `this`). **Absence means unbound.**
179
+ * The Anthropic-wire adapters answer from their model table, `unknown` for an
180
+ * id the table cannot place, and take the app's statement for such an id
181
+ * (`thinkingBinding` option, `by: 'app'`). A WRAPPER must forward it;
182
+ * `withFallback` forwards its primary's answer, the side every call goes to
183
+ * first (a fallback's own adapter checks the calls it serves).
184
+ */
185
+ readonly thinkingBinding?: (model: string) => ThinkingBinding;
168
186
  /**
169
187
  * v7.21 — which roles this provider carries INSIDE the `messages` array.
170
188
  *
@@ -259,3 +277,28 @@ export interface LLMProvider {
259
277
  complete(req: LLMRequest, hooks?: LLMCallHooks): Promise<LLMResponse>;
260
278
  stream?(req: LLMRequest, hooks?: LLMCallHooks): AsyncIterable<LLMChunk>;
261
279
  }
280
+ /** A provider's answer to `thinkingBinding`: the fact, and who stated it. */
281
+ export interface ThinkingBinding {
282
+ /**
283
+ * `bound`: a thinking block is valid only under the system prompt, tool list
284
+ * and earlier messages it was written under. `unbound`: it is not. `unknown`:
285
+ * the provider cannot tell for this model id (an id its table cannot place).
286
+ */
287
+ readonly binding: 'bound' | 'unbound' | 'unknown';
288
+ /** `provider`: the adapter's own knowledge. `app`: the application stated it. */
289
+ readonly by: 'provider' | 'app';
290
+ /**
291
+ * The model family the provider resolved the id to, when it knows it. Two
292
+ * ids of one family read each other's reasoning bindings (a dated id and its
293
+ * alias); a block written by another family is not checked against this one.
294
+ */
295
+ readonly family?: string;
296
+ /**
297
+ * The model id the provider resolved the asked id to — an adapter's
298
+ * shorthand (`'anthropic'`) becomes the id it actually sends. Absent: the
299
+ * asked id is the one sent.
300
+ */
301
+ readonly model?: string;
302
+ /** The app's statement for this id was asked and could not be used (it threw or answered something else). */
303
+ readonly appStatement?: 'failed';
304
+ }
@@ -17,7 +17,7 @@ export { DEFAULT_CARRIES_IN_MESSAGES, type WireRole } from './wireRole.js';
17
17
  export type { LLMMessage } from './types/message.js';
18
18
  export type { LLMRequest } from './types/request.js';
19
19
  export type { LLMResponse, WireToolManifest, LLMChunk } from './types/response.js';
20
- export type { ResilienceReport, LLMCallHooks, LLMProvider } from './types/provider.js';
20
+ export type { ResilienceReport, LLMCallHooks, LLMProvider, ThinkingBinding, } from './types/provider.js';
21
21
  export { STAGED_INPUTS_ENV, canStageCodeInputs, canReadCodeFiles, canRunCodeCommands, type BrowserShot, type BrowserDriver, type BrowserRunner, type BrowserSession, type CodeRunner, type CodeInput, type StagedCodeInput, type CodeSession, type CodeReadOptions, type CodeFile, type CodeCommandOptions, type CodeCommandResult, type CodeTruncation, type CodeResult, } from './types/code.js';
22
22
  export interface LLMToolSchema {
23
23
  readonly name: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/provider-contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAE,2BAA2B,EAAiB,MAAM,eAAe,CAAC;AAM3E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GAenB,MAAM,iBAAiB,CAAC;AAiLzB;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAsC,EACtC,UAAgC;IAEhC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,UAAU,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;AACtF,CAAC"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/provider-contract/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAOH,OAAO,EAAE,2BAA2B,EAAiB,MAAM,eAAe,CAAC;AAW3E,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,EAChB,kBAAkB,GAenB,MAAM,iBAAiB,CAAC;AAiLzB;;GAEG;AACH,MAAM,UAAU,cAAc,CAC5B,OAAsC,EACtC,UAAgC;IAEhC,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,OAAO,UAAU,KAAK,WAAW,IAAI,OAAO,CAAC,OAAO,EAAE,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;AACtF,CAAC"}
@@ -36,6 +36,8 @@
36
36
  export { forcedToolChoiceFor, UnsupportedToolChoiceError, } from './provider-contract/forcedToolChoice.js';
37
37
  export { nativeOutputSchemaFor, UnsupportedNativeOutputError, } from './provider-contract/nativeOutputSchema.js';
38
38
  export { UnsafeThinkingReplayError } from './thinking/replay.js';
39
+ export { ContextChangedError, type ContextChange } from './thinking/contextChange.js';
40
+ export { thinkingBindingOf, type ThinkingBinding } from './provider-contract/thinkingBinding.js';
39
41
  export { ProviderBlockedError, ProviderInterventionUnknownError, ProviderGuardrailLimitError, type ProviderIntervention, } from './provider-contract/intervention.js';
40
42
  export type { MessageReplay, ReplayPart, ReplayPreparation, ThinkingReplayOmission, ThinkingReplayReason, } from './thinking/replay.js';
41
43
  export { MockProvider, mock, type MockProviderOptions, type MockReply, type LatencyMs, } from './adapters/llm/MockProvider.js';
@@ -36,6 +36,8 @@
36
36
  export { forcedToolChoiceFor, UnsupportedToolChoiceError, } from './provider-contract/forcedToolChoice.js';
37
37
  export { nativeOutputSchemaFor, UnsupportedNativeOutputError, } from './provider-contract/nativeOutputSchema.js';
38
38
  export { UnsafeThinkingReplayError } from './thinking/replay.js';
39
+ export { ContextChangedError } from './thinking/contextChange.js';
40
+ export { thinkingBindingOf } from './provider-contract/thinkingBinding.js';
39
41
  export { ProviderBlockedError, ProviderInterventionUnknownError, ProviderGuardrailLimitError, } from './provider-contract/intervention.js';
40
42
  export { MockProvider, mock, } from './adapters/llm/MockProvider.js';
41
43
  export { anthropic, AnthropicProvider, } from './adapters/llm/AnthropicProvider.js';
@@ -1 +1 @@
1
- {"version":3,"file":"providers.js","sourceRoot":"","sources":["../../src/providers.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EACL,mBAAmB,EACnB,0BAA0B,GAC3B,MAAM,yCAAyC,CAAC;AACjD,OAAO,EACL,qBAAqB,EACrB,4BAA4B,GAC7B,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,EACL,oBAAoB,EACpB,gCAAgC,EAChC,2BAA2B,GAE5B,MAAM,qCAAqC,CAAC;AAS7C,OAAO,EACL,YAAY,EACZ,IAAI,GAIL,MAAM,gCAAgC,CAAC;AAExC,OAAO,EACL,SAAS,EACT,iBAAiB,GAElB,MAAM,qCAAqC,CAAC;AAE7C,OAAO,EACL,MAAM,EACN,cAAc,EACd,WAAW,GAGZ,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EACL,MAAM,EACN,cAAc,EACd,sBAAsB,GAGvB,MAAM,kCAAkC,CAAC;AAE1C,uEAAuE;AACvE,sEAAsE;AACtE,6DAA6D;AAC7D,sEAAsE;AACtE,0EAA0E;AAC1E,6DAA6D;AAC7D,qDAAqD;AACrD,OAAO,EACL,OAA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