@systemfsoftware/agent 0.0.0-stage → 0.1.0-beta.192

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 (717) hide show
  1. package/LICENSE +21 -0
  2. package/dist/ActivityStore-CEy3oY41.mjs +90 -0
  3. package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
  4. package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
  5. package/dist/Admin-BcQDrWKY.mjs +329 -0
  6. package/dist/Admin-BcQDrWKY.mjs.map +1 -0
  7. package/dist/Admin-BfolLkHj.d.mts +5678 -0
  8. package/dist/Agent-Bn3zMhDH.mjs +60 -0
  9. package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
  10. package/dist/Agent-DSVEpq4e.d.mts +219 -0
  11. package/dist/AgentError-RkUaetX8.d.mts +128 -0
  12. package/dist/AgentError-yFdnS9bl.mjs +141 -0
  13. package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
  14. package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
  15. package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
  16. package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
  17. package/dist/AgentRegistration-Dg53p6du.mjs +14 -0
  18. package/dist/AgentRegistration-Dg53p6du.mjs.map +1 -0
  19. package/dist/AgentRuntime-CoGy_5dm.d.mts +751 -0
  20. package/dist/AgentRuntime-CzP4I4RB.mjs +5249 -0
  21. package/dist/AgentRuntime-CzP4I4RB.mjs.map +1 -0
  22. package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
  23. package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
  24. package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
  25. package/dist/BrowserUse-C9vict2M.d.mts +196 -0
  26. package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
  27. package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
  28. package/dist/Budget-CXh_ChFJ.d.mts +112 -0
  29. package/dist/Budget-j1UkthgY.mjs +351 -0
  30. package/dist/Budget-j1UkthgY.mjs.map +1 -0
  31. package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
  32. package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
  33. package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
  34. package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
  35. package/dist/CodeMode-BI7WhUkr.mjs +555 -0
  36. package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
  37. package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
  38. package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
  39. package/dist/CommittedActivity-LWOKXqdi.d.mts +62 -0
  40. package/dist/Compaction-C0hWAmOG.mjs +15 -0
  41. package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
  42. package/dist/Compaction-e5cNeFmY.d.mts +5 -0
  43. package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
  44. package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
  45. package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
  46. package/dist/ContextHistory-C80rW5M7.mjs +76 -0
  47. package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
  48. package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
  49. package/dist/ContextTools-917r7gpv.d.mts +186 -0
  50. package/dist/ContextTools-p8JDPo-W.mjs +88 -0
  51. package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
  52. package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
  53. package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
  54. package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
  55. package/dist/Digest-BDToAbaX.d.mts +25 -0
  56. package/dist/Digest-CU6IWj-2.mjs +106 -0
  57. package/dist/Digest-CU6IWj-2.mjs.map +1 -0
  58. package/dist/DurableAgentRuntime-BHXo8GPJ.mjs +8432 -0
  59. package/dist/DurableAgentRuntime-BHXo8GPJ.mjs.map +1 -0
  60. package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
  61. package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
  62. package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
  63. package/dist/DurableStep-CzVIho7y.mjs +54 -0
  64. package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
  65. package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
  66. package/dist/EventSource-BwZVkEQi.mjs +66 -0
  67. package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
  68. package/dist/EventSource-C0TCBeIf.d.mts +52 -0
  69. package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
  70. package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
  71. package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
  72. package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
  73. package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
  74. package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
  75. package/dist/Identifiers-LWd4837I.mjs +41 -0
  76. package/dist/Identifiers-LWd4837I.mjs.map +1 -0
  77. package/dist/Identifiers-qafW4EP0.d.mts +38 -0
  78. package/dist/InMemory-BrTm6XEO.mjs +57 -0
  79. package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
  80. package/dist/InMemory-C3qXFT5k.d.mts +46 -0
  81. package/dist/InMemory.d.mts +2 -0
  82. package/dist/InMemory.mjs +1 -0
  83. package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
  84. package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
  85. package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
  86. package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
  87. package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
  88. package/dist/Memory-CT5bDZqi.d.mts +57 -0
  89. package/dist/Memory-Dl9ecPpm.mjs +204 -0
  90. package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
  91. package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
  92. package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
  93. package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
  94. package/dist/MemoryNotes-4CRzkPBD.d.mts +425 -0
  95. package/dist/MemoryNotes-i41TsH11.mjs +132 -0
  96. package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
  97. package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
  98. package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
  99. package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
  100. package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
  101. package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
  102. package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
  103. package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
  104. package/dist/MemoryStore-E0J99hb2.mjs +245 -0
  105. package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
  106. package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
  107. package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
  108. package/dist/MessageDelivery-Dh6GZBt_.d.mts +1129 -0
  109. package/dist/Messaging-BqWHYf93.d.mts +216 -0
  110. package/dist/Messaging-DgSiv4f4.mjs +154 -0
  111. package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
  112. package/dist/Messaging-DhM-APnP.d.mts +1074 -0
  113. package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
  114. package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
  115. package/dist/MessagingHost-CubWeYKN.d.mts +80 -0
  116. package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
  117. package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
  118. package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
  119. package/dist/Output-DQ8mWcgf.mjs +7 -0
  120. package/dist/Output-DQ8mWcgf.mjs.map +1 -0
  121. package/dist/Output-SbOdlBFL.d.mts +22 -0
  122. package/dist/PageCapture-BfRURUOA.mjs +275 -0
  123. package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
  124. package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
  125. package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
  126. package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
  127. package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
  128. package/dist/PersistentHistory-BrtZ0g2j.d.mts +14 -0
  129. package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
  130. package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
  131. package/dist/PreparedInputAdmission-Ci18uY4s.d.mts +973 -0
  132. package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
  133. package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
  134. package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
  135. package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
  136. package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
  137. package/dist/Receipt-B-FlCaNH.mjs +35 -0
  138. package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
  139. package/dist/Receipt-B4feBxMY.d.mts +31 -0
  140. package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
  141. package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
  142. package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
  143. package/dist/Records-C645aQks.mjs +1145 -0
  144. package/dist/Records-C645aQks.mjs.map +1 -0
  145. package/dist/Records-C9I1nCL9.d.mts +1423 -0
  146. package/dist/Recovery-zWy_kmZq.mjs +736 -0
  147. package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
  148. package/dist/Redaction-C0zLBAn6.d.mts +28 -0
  149. package/dist/Redaction-CtyCBMEj.mjs +116 -0
  150. package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
  151. package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
  152. package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
  153. package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
  154. package/dist/RunContinuation-BVAHoYlN.d.mts +127 -0
  155. package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
  156. package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
  157. package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
  158. package/dist/RunEvent-DJxENnJi.mjs +345 -0
  159. package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
  160. package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
  161. package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
  162. package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
  163. package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
  164. package/dist/RunHooks-DWuLBVdU.mjs +60 -0
  165. package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
  166. package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
  167. package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
  168. package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
  169. package/dist/RunOptions-COEUCrx4.mjs +61 -0
  170. package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
  171. package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
  172. package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
  173. package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
  174. package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
  175. package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
  176. package/dist/Sandbox-37vXP0BV.d.mts +24 -0
  177. package/dist/Sandbox-Bze6pHYc.mjs +30 -0
  178. package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
  179. package/dist/Schedule-BY0lzbij.mjs +336 -0
  180. package/dist/Schedule-BY0lzbij.mjs.map +1 -0
  181. package/dist/ScheduleTransition-CjVP48I8.d.mts +22 -0
  182. package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
  183. package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
  184. package/dist/Scheduling-BpJN9E1j.mjs +699 -0
  185. package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
  186. package/dist/Scheduling-DYTM29s9.d.mts +57 -0
  187. package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
  188. package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
  189. package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
  190. package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
  191. package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
  192. package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
  193. package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
  194. package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
  195. package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
  196. package/dist/Subagent-CSIRUgUo.mjs +1315 -0
  197. package/dist/Subagent-CSIRUgUo.mjs.map +1 -0
  198. package/dist/Subagent-CXEI5YZ8.d.mts +2368 -0
  199. package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
  200. package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
  201. package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
  202. package/dist/SubagentHost-BEnICu7g.mjs +70 -0
  203. package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
  204. package/dist/SubagentHost-CKhz1vbH.d.mts +167 -0
  205. package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
  206. package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
  207. package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
  208. package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
  209. package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
  210. package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
  211. package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
  212. package/dist/Subscription-BhQbmUD-.mjs +340 -0
  213. package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
  214. package/dist/Subscription-CC--_OnU.d.mts +815 -0
  215. package/dist/SubscriptionInput-BEeB0Cj8.d.mts +42 -0
  216. package/dist/SubscriptionInput-Xcd4JjEs.mjs +53 -0
  217. package/dist/SubscriptionInput-Xcd4JjEs.mjs.map +1 -0
  218. package/dist/SubscriptionTransition-CWt9UVH0.d.mts +23 -0
  219. package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
  220. package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
  221. package/dist/Subscriptions-4K_qu_2f.mjs +638 -0
  222. package/dist/Subscriptions-4K_qu_2f.mjs.map +1 -0
  223. package/dist/Subscriptions-BF3aSf8X.d.mts +75 -0
  224. package/dist/Thread-B8JApGHa.mjs +283 -0
  225. package/dist/Thread-B8JApGHa.mjs.map +1 -0
  226. package/dist/Thread-BnAtkJl4.d.mts +116 -0
  227. package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
  228. package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
  229. package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
  230. package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
  231. package/dist/ThreadContextHistory-lTZ8Ftq1.d.mts +33 -0
  232. package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
  233. package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
  234. package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
  235. package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
  236. package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
  237. package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
  238. package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
  239. package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
  240. package/dist/ThreadImport-DaSmrlRi.d.mts +843 -0
  241. package/dist/ThreadInvariants-DyPhMeo-.d.mts +23 -0
  242. package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
  243. package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
  244. package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
  245. package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
  246. package/dist/ThreadProjectionMaintenance-DjUy7kCa.d.mts +51 -0
  247. package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
  248. package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
  249. package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
  250. package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
  251. package/dist/ThreadTransfer-BM02cbOo.d.mts +63 -0
  252. package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
  253. package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
  254. package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
  255. package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
  256. package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
  257. package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
  258. package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
  259. package/dist/ToolDiscovery-VjamzX3q.d.mts +119 -0
  260. package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
  261. package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
  262. package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
  263. package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
  264. package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
  265. package/dist/ToolExposure-DPnq8Won.mjs +30 -0
  266. package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
  267. package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
  268. package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
  269. package/dist/ToolExposure.d.mts +4 -0
  270. package/dist/ToolExposure.mjs +4 -0
  271. package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
  272. package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
  273. package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
  274. package/dist/ToolResult-By5KAje4.d.mts +79 -0
  275. package/dist/ToolResult-DwZxjlHw.mjs +160 -0
  276. package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
  277. package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
  278. package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
  279. package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
  280. package/dist/ToolResults-C4-HsMCp.d.mts +33 -0
  281. package/dist/ToolResults-nCgBlTp2.mjs +45 -0
  282. package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
  283. package/dist/Usage-B0xgME5f.mjs +340 -0
  284. package/dist/Usage-B0xgME5f.mjs.map +1 -0
  285. package/dist/Usage-Bc-jXe_9.d.mts +128 -0
  286. package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
  287. package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
  288. package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
  289. package/dist/WebCapture-CA4ZarW2.mjs +64 -0
  290. package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
  291. package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
  292. package/dist/WebSearch-CD0V--qh.d.mts +18 -0
  293. package/dist/WebSearch-DnbOzRL_.mjs +30 -0
  294. package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
  295. package/dist/Worker-CQu8Qp1j.mjs +267 -0
  296. package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
  297. package/dist/Worker-xxucY_0b.d.mts +468 -0
  298. package/dist/WorkerAdmission-BhFjx86s.mjs +162 -0
  299. package/dist/WorkerAdmission-BhFjx86s.mjs.map +1 -0
  300. package/dist/WorkerAdmission-BnRuXLWF.d.mts +171 -0
  301. package/dist/WorkerHost-DtYzi54D.d.mts +150 -0
  302. package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
  303. package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
  304. package/dist/agent-registration-CNs2twrr.mjs +262 -0
  305. package/dist/agent-registration-CNs2twrr.mjs.map +1 -0
  306. package/dist/capabilities/BrowserUse.d.mts +2 -0
  307. package/dist/capabilities/BrowserUse.mjs +1 -0
  308. package/dist/capabilities/Budget.d.mts +2 -0
  309. package/dist/capabilities/Budget.mjs +1 -0
  310. package/dist/capabilities/CodeMode.d.mts +2 -0
  311. package/dist/capabilities/CodeMode.mjs +1 -0
  312. package/dist/capabilities/ContextTools.d.mts +2 -0
  313. package/dist/capabilities/ContextTools.mjs +1 -0
  314. package/dist/capabilities/MemoryNotes.d.mts +2 -0
  315. package/dist/capabilities/MemoryNotes.mjs +1 -0
  316. package/dist/capabilities/Messaging.d.mts +3 -0
  317. package/dist/capabilities/Messaging.mjs +4 -0
  318. package/dist/capabilities/Redaction.d.mts +2 -0
  319. package/dist/capabilities/Redaction.mjs +1 -0
  320. package/dist/capabilities/RunHooks.d.mts +2 -0
  321. package/dist/capabilities/RunHooks.mjs +1 -0
  322. package/dist/capabilities/SemanticMemory.d.mts +2 -0
  323. package/dist/capabilities/SemanticMemory.mjs +1 -0
  324. package/dist/capabilities/Subagent.d.mts +4 -0
  325. package/dist/capabilities/Subagent.mjs +6 -0
  326. package/dist/capabilities/SubagentReservations.d.mts +2 -0
  327. package/dist/capabilities/SubagentReservations.mjs +1 -0
  328. package/dist/capabilities/ToolDiscovery.d.mts +2 -0
  329. package/dist/capabilities/ToolDiscovery.mjs +1 -0
  330. package/dist/capabilities/ToolResults.d.mts +2 -0
  331. package/dist/capabilities/ToolResults.mjs +1 -0
  332. package/dist/capabilities/WebCapture.d.mts +2 -0
  333. package/dist/capabilities/WebCapture.mjs +1 -0
  334. package/dist/capabilities/WebSearch.d.mts +2 -0
  335. package/dist/capabilities/WebSearch.mjs +1 -0
  336. package/dist/compaction-C3hXuO4Z.mjs +539 -0
  337. package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
  338. package/dist/completion-B_WDnSg-.d.mts +11 -0
  339. package/dist/core/Agent.d.mts +2 -0
  340. package/dist/core/Agent.mjs +1 -0
  341. package/dist/core/AgentError.d.mts +2 -0
  342. package/dist/core/AgentError.mjs +1 -0
  343. package/dist/core/AgentPolicy.d.mts +2 -0
  344. package/dist/core/AgentPolicy.mjs +1 -0
  345. package/dist/core/AgentUpdates.d.mts +2 -0
  346. package/dist/core/AgentUpdates.mjs +1 -0
  347. package/dist/core/FailureDiagnostic.d.mts +2 -0
  348. package/dist/core/FailureDiagnostic.mjs +1 -0
  349. package/dist/core/IdGenerator.d.mts +2 -0
  350. package/dist/core/IdGenerator.mjs +1 -0
  351. package/dist/core/Identifiers.d.mts +2 -0
  352. package/dist/core/Identifiers.mjs +1 -0
  353. package/dist/core/Memory.d.mts +2 -0
  354. package/dist/core/Memory.mjs +1 -0
  355. package/dist/core/MemoryNamespace.d.mts +2 -0
  356. package/dist/core/MemoryNamespace.mjs +1 -0
  357. package/dist/core/MemoryReference.d.mts +2 -0
  358. package/dist/core/MemoryReference.mjs +1 -0
  359. package/dist/core/MemoryRevalidation.d.mts +2 -0
  360. package/dist/core/MemoryRevalidation.mjs +1 -0
  361. package/dist/core/MemoryStore.d.mts +2 -0
  362. package/dist/core/MemoryStore.mjs +1 -0
  363. package/dist/core/ProvisionalText.d.mts +2 -0
  364. package/dist/core/ProvisionalText.mjs +1 -0
  365. package/dist/core/Receipt.d.mts +2 -0
  366. package/dist/core/Receipt.mjs +1 -0
  367. package/dist/core/RememberingStore.d.mts +2 -0
  368. package/dist/core/RememberingStore.mjs +1 -0
  369. package/dist/core/RunEvent.d.mts +3 -0
  370. package/dist/core/RunEvent.mjs +1 -0
  371. package/dist/core/RunPolicyUsage.d.mts +2 -0
  372. package/dist/core/RunPolicyUsage.mjs +1 -0
  373. package/dist/core/SemanticMemoryIndex.d.mts +2 -0
  374. package/dist/core/SemanticMemoryIndex.mjs +1 -0
  375. package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
  376. package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
  377. package/dist/core/SubagentContract.d.mts +2 -0
  378. package/dist/core/SubagentContract.mjs +1 -0
  379. package/dist/core/Thread.d.mts +2 -0
  380. package/dist/core/Thread.mjs +1 -0
  381. package/dist/core/ToolResult.d.mts +2 -0
  382. package/dist/core/ToolResult.mjs +1 -0
  383. package/dist/core/ToolResultStorage.d.mts +2 -0
  384. package/dist/core/ToolResultStorage.mjs +1 -0
  385. package/dist/core/Usage.d.mts +2 -0
  386. package/dist/core/Usage.mjs +1 -0
  387. package/dist/core/Worker.d.mts +3 -0
  388. package/dist/core/Worker.mjs +3 -0
  389. package/dist/durable/ActivityStore.d.mts +2 -0
  390. package/dist/durable/ActivityStore.mjs +1 -0
  391. package/dist/durable/Admin.d.mts +2 -0
  392. package/dist/durable/Admin.mjs +1 -0
  393. package/dist/durable/AgentRegistration.d.mts +3 -0
  394. package/dist/durable/AgentRegistration.mjs +2 -0
  395. package/dist/durable/CommittedActivity.d.mts +2 -0
  396. package/dist/durable/CommittedActivity.mjs +1 -0
  397. package/dist/durable/Digest.d.mts +2 -0
  398. package/dist/durable/Digest.mjs +3 -0
  399. package/dist/durable/DurableAgentRuntime.d.mts +3 -0
  400. package/dist/durable/DurableAgentRuntime.mjs +4 -0
  401. package/dist/durable/DurableFailpoint.d.mts +2 -0
  402. package/dist/durable/DurableFailpoint.mjs +1 -0
  403. package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
  404. package/dist/durable/DurableFailpointTestControl.mjs +21 -0
  405. package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
  406. package/dist/durable/EventSource.d.mts +2 -0
  407. package/dist/durable/EventSource.mjs +1 -0
  408. package/dist/durable/LifecyclePublication.d.mts +2 -0
  409. package/dist/durable/LifecyclePublication.mjs +1 -0
  410. package/dist/durable/MessageDelivery.d.mts +2 -0
  411. package/dist/durable/MessageDelivery.mjs +1 -0
  412. package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
  413. package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
  414. package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
  415. package/dist/durable/OperationAuthorizer.d.mts +2 -0
  416. package/dist/durable/OperationAuthorizer.mjs +1 -0
  417. package/dist/durable/PersistentHistory.d.mts +2 -0
  418. package/dist/durable/PersistentHistory.mjs +1 -0
  419. package/dist/durable/PreparedInputAdmission.d.mts +2 -0
  420. package/dist/durable/PreparedInputAdmission.mjs +1 -0
  421. package/dist/durable/RecordFormat.d.mts +2 -0
  422. package/dist/durable/RecordFormat.mjs +1 -0
  423. package/dist/durable/Records.d.mts +2 -0
  424. package/dist/durable/Records.mjs +1 -0
  425. package/dist/durable/Recovery.d.mts +2 -0
  426. package/dist/durable/Recovery.mjs +1 -0
  427. package/dist/durable/RunContinuation.d.mts +4 -0
  428. package/dist/durable/RunContinuation.mjs +4 -0
  429. package/dist/durable/RunJournal.d.mts +2 -0
  430. package/dist/durable/RunJournal.mjs +1 -0
  431. package/dist/durable/RunStorage.d.mts +2 -0
  432. package/dist/durable/RunStorage.mjs +1 -0
  433. package/dist/durable/Schedule.d.mts +2 -0
  434. package/dist/durable/Schedule.mjs +1 -0
  435. package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
  436. package/dist/durable/ScheduleStoreConformance.mjs +421 -0
  437. package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
  438. package/dist/durable/ScheduleTransition.d.mts +2 -0
  439. package/dist/durable/ScheduleTransition.mjs +1 -0
  440. package/dist/durable/Scheduling.d.mts +2 -0
  441. package/dist/durable/Scheduling.mjs +1 -0
  442. package/dist/durable/SettlementPublisher.d.mts +2 -0
  443. package/dist/durable/SettlementPublisher.mjs +99 -0
  444. package/dist/durable/SettlementPublisher.mjs.map +1 -0
  445. package/dist/durable/SqlMemoryStore.d.mts +729 -0
  446. package/dist/durable/SqlMemoryStore.mjs +626 -0
  447. package/dist/durable/SqlMemoryStore.mjs.map +1 -0
  448. package/dist/durable/SqlStorageOwner.d.mts +18 -0
  449. package/dist/durable/SqlStorageOwner.mjs +6 -0
  450. package/dist/durable/SqlStorageOwner.mjs.map +1 -0
  451. package/dist/durable/SubmissionLedger.d.mts +3 -0
  452. package/dist/durable/SubmissionLedger.mjs +3 -0
  453. package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
  454. package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
  455. package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
  456. package/dist/durable/SubmissionStatus.d.mts +2 -0
  457. package/dist/durable/SubmissionStatus.mjs +1 -0
  458. package/dist/durable/Subscription.d.mts +2 -0
  459. package/dist/durable/Subscription.mjs +1 -0
  460. package/dist/durable/SubscriptionInput.d.mts +2 -0
  461. package/dist/durable/SubscriptionInput.mjs +1 -0
  462. package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
  463. package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
  464. package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
  465. package/dist/durable/SubscriptionTransition.d.mts +2 -0
  466. package/dist/durable/SubscriptionTransition.mjs +1 -0
  467. package/dist/durable/Subscriptions.d.mts +2 -0
  468. package/dist/durable/Subscriptions.mjs +1 -0
  469. package/dist/durable/ThreadArchiveRange.d.mts +2 -0
  470. package/dist/durable/ThreadArchiveRange.mjs +1 -0
  471. package/dist/durable/ThreadContextHistory.d.mts +2 -0
  472. package/dist/durable/ThreadContextHistory.mjs +1 -0
  473. package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
  474. package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
  475. package/dist/durable/ThreadImport.d.mts +2 -0
  476. package/dist/durable/ThreadImport.mjs +1 -0
  477. package/dist/durable/ThreadInvariants.d.mts +2 -0
  478. package/dist/durable/ThreadInvariants.mjs +1 -0
  479. package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
  480. package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
  481. package/dist/durable/ThreadReader.d.mts +2 -0
  482. package/dist/durable/ThreadReader.mjs +1 -0
  483. package/dist/durable/ThreadStore.d.mts +3 -0
  484. package/dist/durable/ThreadStore.mjs +3 -0
  485. package/dist/durable/ThreadStoreConformance.d.mts +53 -0
  486. package/dist/durable/ThreadStoreConformance.mjs +402 -0
  487. package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
  488. package/dist/durable/ThreadTransfer.d.mts +2 -0
  489. package/dist/durable/ThreadTransfer.mjs +1 -0
  490. package/dist/durable/ThreadWork.d.mts +2 -0
  491. package/dist/durable/ThreadWork.mjs +1 -0
  492. package/dist/durable/ToolReconciler.d.mts +2 -0
  493. package/dist/durable/ToolReconciler.mjs +1 -0
  494. package/dist/durable/WakeScheduler.d.mts +2 -0
  495. package/dist/durable/WakeScheduler.mjs +1 -0
  496. package/dist/durable/WorkerAdmission.d.mts +2 -0
  497. package/dist/durable/WorkerAdmission.mjs +1 -0
  498. package/dist/durable/WorkerHost.d.mts +2 -0
  499. package/dist/durable/WorkerHost.mjs +1 -0
  500. package/dist/engine/AgentRuntime.d.mts +2 -0
  501. package/dist/engine/AgentRuntime.mjs +1 -0
  502. package/dist/engine/Compaction.d.mts +4 -0
  503. package/dist/engine/Compaction.mjs +2 -0
  504. package/dist/engine/ContextCompactor.d.mts +2 -0
  505. package/dist/engine/ContextCompactor.mjs +1 -0
  506. package/dist/engine/ContextHistory.d.mts +2 -0
  507. package/dist/engine/ContextHistory.mjs +1 -0
  508. package/dist/engine/ContextWindow.d.mts +2 -0
  509. package/dist/engine/ContextWindow.mjs +1 -0
  510. package/dist/engine/DurableStep.d.mts +2 -0
  511. package/dist/engine/DurableStep.mjs +3 -0
  512. package/dist/engine/MessagingHost.d.mts +2 -0
  513. package/dist/engine/MessagingHost.mjs +1 -0
  514. package/dist/engine/Output.d.mts +3 -0
  515. package/dist/engine/Output.mjs +2 -0
  516. package/dist/engine/RunEventSink.d.mts +2 -0
  517. package/dist/engine/RunEventSink.mjs +1 -0
  518. package/dist/engine/RunOptions.d.mts +2 -0
  519. package/dist/engine/RunOptions.mjs +1 -0
  520. package/dist/engine/SubagentHost.d.mts +2 -0
  521. package/dist/engine/SubagentHost.mjs +1 -0
  522. package/dist/engine/ThreadHistory.d.mts +2 -0
  523. package/dist/engine/ThreadHistory.mjs +1 -0
  524. package/dist/engine/ToolBroker.d.mts +2 -0
  525. package/dist/engine/ToolBroker.mjs +1 -0
  526. package/dist/index.d.mts +90 -0
  527. package/dist/index.mjs +101 -0
  528. package/dist/output-contract-CYA4oBhe.mjs +128 -0
  529. package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
  530. package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
  531. package/dist/run-context-reader-CHox63hg.d.mts +17 -0
  532. package/dist/sandbox/CodeExecutor.d.mts +2 -0
  533. package/dist/sandbox/CodeExecutor.mjs +1 -0
  534. package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
  535. package/dist/sandbox/InteractiveBrowser.mjs +1 -0
  536. package/dist/sandbox/PageCapture.d.mts +2 -0
  537. package/dist/sandbox/PageCapture.mjs +1 -0
  538. package/dist/sandbox/PageScreenshot.d.mts +2 -0
  539. package/dist/sandbox/PageScreenshot.mjs +1 -0
  540. package/dist/sandbox/Sandbox.d.mts +2 -0
  541. package/dist/sandbox/Sandbox.mjs +1 -0
  542. package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
  543. package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
  544. package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
  545. package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
  546. package/dist/tool-operations-CauPonM8.mjs +84 -0
  547. package/dist/tool-operations-CauPonM8.mjs.map +1 -0
  548. package/dist/utf8-Bl0ZhhGe.mjs +27 -0
  549. package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
  550. package/package.json +491 -3
  551. package/src/InMemory.ts +79 -0
  552. package/src/ToolExposure.ts +2 -0
  553. package/src/capabilities/BrowserUse.ts +212 -0
  554. package/src/capabilities/Budget.ts +544 -0
  555. package/src/capabilities/CodeMode.ts +1129 -0
  556. package/src/capabilities/ContextTools.ts +131 -0
  557. package/src/capabilities/MemoryNotes.ts +177 -0
  558. package/src/capabilities/Messaging.ts +260 -0
  559. package/src/capabilities/Redaction.ts +163 -0
  560. package/src/capabilities/RunHooks.ts +116 -0
  561. package/src/capabilities/SemanticMemory.ts +402 -0
  562. package/src/capabilities/Subagent.ts +2343 -0
  563. package/src/capabilities/SubagentReservations.ts +807 -0
  564. package/src/capabilities/ToolDiscovery.ts +291 -0
  565. package/src/capabilities/ToolResults.ts +50 -0
  566. package/src/capabilities/WebCapture.ts +64 -0
  567. package/src/capabilities/WebSearch.ts +45 -0
  568. package/src/capabilities/internal/subagent-background.ts +1137 -0
  569. package/src/capabilities/internal/subagent-contract.ts +92 -0
  570. package/src/capabilities/internal/subagent-policy.ts +205 -0
  571. package/src/capabilities/internal/subagent-reporting.ts +152 -0
  572. package/src/core/Agent.ts +528 -0
  573. package/src/core/AgentError.ts +189 -0
  574. package/src/core/AgentPolicy.ts +194 -0
  575. package/src/core/AgentUpdates.ts +104 -0
  576. package/src/core/FailureDiagnostic.ts +392 -0
  577. package/src/core/IdGenerator.ts +42 -0
  578. package/src/core/Identifiers.ts +64 -0
  579. package/src/core/Memory.ts +283 -0
  580. package/src/core/MemoryNamespace.ts +202 -0
  581. package/src/core/MemoryReference.ts +120 -0
  582. package/src/core/MemoryRevalidation.ts +151 -0
  583. package/src/core/MemoryStore.ts +371 -0
  584. package/src/core/Messaging.ts +72 -0
  585. package/src/core/ProvisionalText.ts +53 -0
  586. package/src/core/Receipt.ts +42 -0
  587. package/src/core/RememberingStore.ts +22 -0
  588. package/src/core/RunEvent.ts +345 -0
  589. package/src/core/RunPolicyUsage.ts +19 -0
  590. package/src/core/SemanticMemoryIndex.ts +259 -0
  591. package/src/core/SemanticMemoryRevalidation.ts +220 -0
  592. package/src/core/SubagentContract.ts +263 -0
  593. package/src/core/Thread.ts +447 -0
  594. package/src/core/ToolExposure.ts +75 -0
  595. package/src/core/ToolResult.ts +204 -0
  596. package/src/core/ToolResultStorage.ts +56 -0
  597. package/src/core/Usage.ts +562 -0
  598. package/src/core/Worker.ts +236 -0
  599. package/src/core/internal/agent-updates.ts +42 -0
  600. package/src/core/internal/completion.ts +33 -0
  601. package/src/core/internal/json.ts +17 -0
  602. package/src/core/internal/memory-document.ts +39 -0
  603. package/src/core/internal/message-status.ts +60 -0
  604. package/src/core/internal/strict-schema.ts +14 -0
  605. package/src/core/internal/tool-execution.ts +33 -0
  606. package/src/core/internal/utf8.ts +32 -0
  607. package/src/durable/ActivityStore.ts +131 -0
  608. package/src/durable/Admin.ts +504 -0
  609. package/src/durable/AgentRegistration.ts +16 -0
  610. package/src/durable/CommittedActivity.ts +262 -0
  611. package/src/durable/Digest.ts +57 -0
  612. package/src/durable/DurableAgentRuntime.ts +12758 -0
  613. package/src/durable/DurableFailpoint.ts +108 -0
  614. package/src/durable/DurableFailpointTestControl.ts +39 -0
  615. package/src/durable/EventSource.ts +179 -0
  616. package/src/durable/LifecyclePublication.ts +343 -0
  617. package/src/durable/MessageDelivery.ts +949 -0
  618. package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
  619. package/src/durable/OperationAuthorizer.ts +89 -0
  620. package/src/durable/PersistentHistory.ts +322 -0
  621. package/src/durable/PreparedInputAdmission.ts +128 -0
  622. package/src/durable/RecordFormat.ts +113 -0
  623. package/src/durable/Records.ts +1396 -0
  624. package/src/durable/Recovery.ts +1022 -0
  625. package/src/durable/RunContinuation.ts +1946 -0
  626. package/src/durable/RunJournal.ts +1926 -0
  627. package/src/durable/RunStorage.ts +533 -0
  628. package/src/durable/Schedule.ts +445 -0
  629. package/src/durable/ScheduleStoreConformance.ts +642 -0
  630. package/src/durable/ScheduleTransition.ts +267 -0
  631. package/src/durable/Scheduling.ts +1031 -0
  632. package/src/durable/SettlementPublisher.ts +172 -0
  633. package/src/durable/SqlMemoryStore.ts +1042 -0
  634. package/src/durable/SqlStorageOwner.ts +25 -0
  635. package/src/durable/SubmissionLedger.ts +1247 -0
  636. package/src/durable/SubmissionLedgerConformance.ts +4695 -0
  637. package/src/durable/SubmissionStatus.ts +14 -0
  638. package/src/durable/Subscription.ts +527 -0
  639. package/src/durable/SubscriptionInput.ts +145 -0
  640. package/src/durable/SubscriptionStoreConformance.ts +1275 -0
  641. package/src/durable/SubscriptionTransition.ts +330 -0
  642. package/src/durable/Subscriptions.ts +1245 -0
  643. package/src/durable/ThreadArchiveRange.ts +91 -0
  644. package/src/durable/ThreadContextHistory.ts +338 -0
  645. package/src/durable/ThreadContextHistoryProjection.ts +219 -0
  646. package/src/durable/ThreadImport.ts +1199 -0
  647. package/src/durable/ThreadInvariants.ts +312 -0
  648. package/src/durable/ThreadProjectionMaintenance.ts +72 -0
  649. package/src/durable/ThreadReader.ts +21 -0
  650. package/src/durable/ThreadStore.ts +1258 -0
  651. package/src/durable/ThreadStoreConformance.ts +877 -0
  652. package/src/durable/ThreadTransfer.ts +263 -0
  653. package/src/durable/ThreadWork.ts +713 -0
  654. package/src/durable/ToolReconciler.ts +112 -0
  655. package/src/durable/WakeScheduler.ts +125 -0
  656. package/src/durable/WorkerAdmission.ts +98 -0
  657. package/src/durable/WorkerHost.ts +204 -0
  658. package/src/durable/internal/StorageOwner.ts +181 -0
  659. package/src/durable/internal/agent-registration.ts +713 -0
  660. package/src/durable/internal/agent-updates.ts +338 -0
  661. package/src/durable/internal/canonical-json.ts +110 -0
  662. package/src/durable/internal/evidence.ts +29 -0
  663. package/src/durable/internal/foreign-diagnostic.ts +48 -0
  664. package/src/durable/internal/history-prompt.ts +87 -0
  665. package/src/durable/internal/initial-context.ts +215 -0
  666. package/src/durable/internal/journal-metadata.ts +188 -0
  667. package/src/durable/internal/message-status.ts +18 -0
  668. package/src/durable/internal/messaging-host.ts +615 -0
  669. package/src/durable/internal/prompt-footprint.ts +47 -0
  670. package/src/durable/internal/prompt-history-cache.ts +604 -0
  671. package/src/durable/internal/record-encoding.ts +258 -0
  672. package/src/durable/internal/record-ownership.ts +68 -0
  673. package/src/durable/internal/run-context-reader.ts +51 -0
  674. package/src/durable/internal/run-context.ts +211 -0
  675. package/src/durable/internal/schedule-time.ts +304 -0
  676. package/src/durable/internal/thread-import-reader.ts +85 -0
  677. package/src/durable/internal/thread-initialization.ts +181 -0
  678. package/src/durable/internal/thread-transfer-source.ts +7 -0
  679. package/src/durable/internal/tool-operations.ts +138 -0
  680. package/src/durable/internal/transfer-dependencies.ts +40 -0
  681. package/src/durable/internal/usage-totals.ts +36 -0
  682. package/src/durable/internal/worker-host.ts +4041 -0
  683. package/src/durable/internal/worker-runtime.ts +10 -0
  684. package/src/engine/AgentRuntime.ts +100 -0
  685. package/src/engine/Compaction.ts +11 -0
  686. package/src/engine/ContextCompactor.ts +302 -0
  687. package/src/engine/ContextHistory.ts +75 -0
  688. package/src/engine/ContextWindow.ts +81 -0
  689. package/src/engine/DurableStep.ts +115 -0
  690. package/src/engine/MessagingHost.ts +118 -0
  691. package/src/engine/Output.ts +2 -0
  692. package/src/engine/RunEventSink.ts +124 -0
  693. package/src/engine/RunOptions.ts +664 -0
  694. package/src/engine/SubagentHost.ts +231 -0
  695. package/src/engine/ThreadHistory.ts +125 -0
  696. package/src/engine/ToolBroker.ts +159 -0
  697. package/src/engine/ToolExposure.ts +49 -0
  698. package/src/engine/internal/agent-runtime.ts +11137 -0
  699. package/src/engine/internal/bounded-value.ts +312 -0
  700. package/src/engine/internal/compaction.ts +673 -0
  701. package/src/engine/internal/error-diagnostic.ts +39 -0
  702. package/src/engine/internal/image-tokens.ts +61 -0
  703. package/src/engine/internal/interpreter-options.ts +569 -0
  704. package/src/engine/internal/output-contract.ts +226 -0
  705. package/src/engine/internal/primitive-delta.ts +103 -0
  706. package/src/engine/internal/provider-result-staging.ts +211 -0
  707. package/src/engine/internal/provisional-text.ts +107 -0
  708. package/src/engine/internal/tool-derivative.ts +47 -0
  709. package/src/engine/internal/tool-exposure.ts +228 -0
  710. package/src/engine/internal/tool-telemetry.ts +488 -0
  711. package/src/index.ts +100 -0
  712. package/src/sandbox/CodeExecutor.ts +352 -0
  713. package/src/sandbox/InteractiveBrowser.ts +343 -0
  714. package/src/sandbox/PageCapture.ts +391 -0
  715. package/src/sandbox/PageScreenshot.ts +83 -0
  716. package/src/sandbox/Sandbox.ts +29 -0
  717. package/README.md +0 -3
@@ -0,0 +1,1107 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as Prompt from "effect/ai/Prompt";
3
+ import * as Brand from "effect/Brand";
4
+ import * as Effect from "effect/Effect";
5
+ import * as Predicate from "effect/Predicate";
6
+ import * as Schema from "effect/Schema";
7
+ import * as Stream from "effect/Stream";
8
+ import { d as ToolCallId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
9
+ import { t as RunPolicyUsage } from "./RunPolicyUsage-B-JXRZYO.mjs";
10
+ import { g as summarizeModelUsage } from "./Usage-B0xgME5f.mjs";
11
+ import { f as contextWindowId, n as COMPACTION_SUMMARY_PREFIX, p as contextWindowMessage, t as CLEARED_TOOL_RESULT } from "./compaction-C3hXuO4Z.mjs";
12
+ import { s as digestJson } from "./Digest-CU6IWj-2.mjs";
13
+ import { X as RecordEnvelope, c as CanonicalBatch, f as CanonicalSequence, nt as RunCompleted, wt as ToolCallSettled, z as ModelResponseRecorded } from "./Records-C645aQks.mjs";
14
+ import { t as IdempotencyKey } from "./Receipt-B-FlCaNH.mjs";
15
+ // src/durable/internal/journal-metadata.ts
16
+ const makeRecordId$1 = Brand.nominal();
17
+ /** Deterministic canonical record identity of one Turn's Tool result. */
18
+ const toolCallSettledRecordId = (runId, turn, toolCallId) => makeRecordId$1(`tool-settled:${runId}:${turn}:${toolCallId}`);
19
+ /**
20
+ * Attempt-local metadata collector. Feed every validated record exactly once, in canonical order,
21
+ * including records omitted from the control view. Calling finish transfers its collections;
22
+ * discard the collector afterward. The metadata may only accompany a replay stream bounded at
23
+ * that same captured tail. A later prefix requires a new collector.
24
+ */
25
+ const makeJournalMetadata = (ownerRunId) => {
26
+ const firstSequenceByRun = /* @__PURE__ */ new Map();
27
+ const responseSequencesByRun = /* @__PURE__ */ new Map();
28
+ const declarationsByRun = /* @__PURE__ */ new Map();
29
+ const terminalSequenceByRun = /* @__PURE__ */ new Map();
30
+ const settledSpans = [];
31
+ const settledSequenceById = /* @__PURE__ */ new Map();
32
+ const settledToolCallRecordIds = /* @__PURE__ */ new Set();
33
+ const settledById = /* @__PURE__ */ new Map();
34
+ const compactions = [];
35
+ return {
36
+ add: (envelope) => {
37
+ const payload = envelope.record.payload;
38
+ if ((payload._tag === "RunCompleted" || payload._tag === "RunFailed" || payload._tag === "SubmissionSettled") && payload.runId !== void 0 && !terminalSequenceByRun.has(payload.runId)) terminalSequenceByRun.set(payload.runId, envelope.sequence);
39
+ if (payload._tag === "CompactionCreated") {
40
+ compactions.push({
41
+ payload,
42
+ sequence: envelope.sequence
43
+ });
44
+ return;
45
+ }
46
+ if ("runId" in payload && typeof payload.runId === "string" && !firstSequenceByRun.has(payload.runId)) firstSequenceByRun.set(payload.runId, envelope.sequence);
47
+ if (payload._tag === "ModelResponseRecorded") {
48
+ const sequences = responseSequencesByRun.get(payload.runId) ?? [];
49
+ sequences.push(envelope.sequence);
50
+ responseSequencesByRun.set(payload.runId, sequences);
51
+ const callIds = "toolOperations" in payload ? payload.toolOperations.map((operation) => operation.toolCallId) : payload.messages.content.flatMap((message) => message.role === "assistant" ? message.content.flatMap((part) => part.type === "tool-call" && !part.providerExecuted ? [part.id] : []) : []);
52
+ if (callIds.length > 0) {
53
+ const declarations = declarationsByRun.get(payload.runId) ?? [];
54
+ declarations.push({
55
+ sequence: envelope.sequence,
56
+ turn: payload.turn,
57
+ callIds
58
+ });
59
+ declarationsByRun.set(payload.runId, declarations);
60
+ }
61
+ } else if (payload._tag === "ToolCallSettled") {
62
+ settledToolCallRecordIds.add(envelope.record.recordId);
63
+ settledSequenceById.set(envelope.record.recordId, envelope.sequence);
64
+ if (payload.runId === ownerRunId) settledById.set(envelope.record.recordId, {
65
+ isFailure: payload.isFailure,
66
+ ...!("toolSelection" in payload) || payload.toolSelection === void 0 ? {} : { toolSelection: payload.toolSelection },
67
+ ...!("budgetRejected" in payload) || payload.budgetRejected === void 0 ? {} : { budgetRejected: payload.budgetRejected }
68
+ });
69
+ const from = declarationsByRun.get(payload.runId)?.findLast((declaration) => declaration.callIds.includes(payload.toolCallId) && toolCallSettledRecordId(payload.runId, declaration.turn, payload.toolCallId) === envelope.record.recordId)?.sequence;
70
+ if (from !== void 0 && from < envelope.sequence) settledSpans.push({
71
+ from,
72
+ to: envelope.sequence,
73
+ runId: payload.runId,
74
+ recordId: envelope.record.recordId
75
+ });
76
+ }
77
+ },
78
+ finish: () => {
79
+ responseSequencesByRun.forEach((sequences, runId) => {
80
+ responseSequencesByRun.set(runId, sequences.slice());
81
+ });
82
+ return {
83
+ ownerRunId,
84
+ firstSequenceByRun,
85
+ responseSequencesByRun,
86
+ terminalSequenceByRun,
87
+ settledSpans,
88
+ settledSequenceById,
89
+ settledToolCallRecordIds,
90
+ settledById,
91
+ compactions
92
+ };
93
+ }
94
+ };
95
+ };
96
+ // src/durable/internal/usage-totals.ts
97
+ /** Captured calls are additive and nonnegative; progress does not need attribution groups. */
98
+ const continuationUsage = (calls) => Effect.suspend(() => {
99
+ let inputTokens = 0;
100
+ let outputTokens = 0;
101
+ let costMicrousd = 0;
102
+ let knownWebSearchCalls = 0;
103
+ for (const call of calls) {
104
+ inputTokens += call.inputTokens.total;
105
+ outputTokens += call.outputTokens.total;
106
+ costMicrousd += call.costMicrousd;
107
+ knownWebSearchCalls += call.webSearchCalls ?? 0;
108
+ }
109
+ if (Number.isSafeInteger(inputTokens) && Number.isSafeInteger(outputTokens) && Number.isSafeInteger(costMicrousd) && Number.isSafeInteger(knownWebSearchCalls)) return Effect.succeed({
110
+ modelCalls: calls.length,
111
+ inputTokens,
112
+ outputTokens,
113
+ costMicrousd
114
+ });
115
+ return Effect.map(summarizeModelUsage(calls), (summary) => ({
116
+ modelCalls: summary.modelCalls,
117
+ inputTokens: summary.inputTokens.total,
118
+ outputTokens: summary.outputTokens.total,
119
+ costMicrousd: summary.costMicrousd
120
+ }));
121
+ });
122
+ // src/durable/RunJournal.ts
123
+ var RunJournal_exports = /* @__PURE__ */ __exportAll({
124
+ RunJournalError: () => RunJournalError,
125
+ agentUpdateRecordId: () => agentUpdateRecordId,
126
+ approvalDecisionBatchId: () => approvalDecisionBatchId,
127
+ childIdempotencyKeyFor: () => childIdempotencyKeyFor,
128
+ childThreadIdFor: () => childThreadIdFor,
129
+ compactionBatchId: () => compactionBatchId,
130
+ compactionRecordId: () => compactionRecordId,
131
+ firstWorkerInputRecordId: () => firstWorkerInputRecordId,
132
+ initialRunJournal: () => initialRunJournal,
133
+ markUnknownBatchId: () => markUnknownBatchId,
134
+ modelResponseInterruptedBatchId: () => modelResponseInterruptedBatchId,
135
+ modelResponseInterruptedRecordId: () => modelResponseInterruptedRecordId,
136
+ modelResponseRecordId: () => modelResponseRecordId,
137
+ peerMessageRecordId: () => peerMessageRecordId,
138
+ projectRunJournal: () => projectRunJournal,
139
+ projectRunJournalStream: () => projectRunJournalStream,
140
+ promptFromCanonicalRecords: () => promptFromCanonicalRecords,
141
+ runCompletedRecordId: () => runCompletedRecordId,
142
+ runDurationBatchId: () => runDurationBatchId,
143
+ runDurationRecordId: () => runDurationRecordId,
144
+ runIdForSubmission: () => runIdForSubmission,
145
+ runStartedBatchId: () => runStartedBatchId,
146
+ runStartedRecordId: () => runStartedRecordId,
147
+ subagentJoinBatchId: () => subagentJoinBatchId,
148
+ subagentJoinedRecordId: () => subagentJoinedRecordId,
149
+ subagentLineageBatchId: () => subagentLineageBatchId,
150
+ subagentLineageRecordId: () => subagentLineageRecordId,
151
+ subagentRequestedBatchId: () => subagentRequestedBatchId,
152
+ subagentRequestedRecordId: () => subagentRequestedRecordId,
153
+ subagentStartedBatchId: () => subagentStartedBatchId,
154
+ subagentStartedRecordId: () => subagentStartedRecordId,
155
+ toolApprovalDecisionRecordId: () => toolApprovalDecisionRecordId,
156
+ toolApprovalRequestRecordId: () => toolApprovalRequestRecordId,
157
+ toolCallResolutionBatchId: () => toolCallResolutionBatchId,
158
+ toolCallResolvedRecordId: () => toolCallResolvedRecordId,
159
+ toolCallResultBatchId: () => toolCallResultBatchId,
160
+ toolCallSettledRecordId: () => toolCallSettledRecordId,
161
+ toolCallUnknownRecordId: () => toolCallUnknownRecordId,
162
+ toolStepSettledBatchId: () => toolStepSettledBatchId,
163
+ toolStepSettledRecordId: () => toolStepSettledRecordId,
164
+ turnApprovalsBatchId: () => turnApprovalsBatchId,
165
+ turnBatchId: () => turnBatchId,
166
+ turnCanonicalBatch: () => turnCanonicalBatch,
167
+ turnIdForRun: () => turnIdForRun,
168
+ turnResponseBatch: () => turnResponseBatch,
169
+ turnResponseBatchId: () => turnResponseBatchId,
170
+ turnResultsBatch: () => turnResultsBatch,
171
+ turnResultsBatchId: () => turnResultsBatchId,
172
+ workerInputRecordId: () => workerInputRecordId,
173
+ workerOriginRecordId: () => workerOriginRecordId,
174
+ workerReportRecordId: () => workerReportRecordId
175
+ });
176
+ /** A canonical record could not be projected into Run/Prompt state. */
177
+ var RunJournalError = class extends Schema.TaggedError()("RunJournalError", {
178
+ message: Schema.String,
179
+ cause: Schema.optionalKey(Schema.Defect())
180
+ }) {};
181
+ const journalError = (message, cause) => cause === void 0 ? RunJournalError.make({ message }) : RunJournalError.make({
182
+ message,
183
+ cause
184
+ });
185
+ const makeRunId = Brand.nominal();
186
+ const makeTurnId = Brand.nominal();
187
+ const makeBatchId = Brand.nominal();
188
+ const makeRecordId = Brand.nominal();
189
+ /**
190
+ * Deterministic Run identity pinned per Submission (plan §Coordinator flow). Every Attempt of one
191
+ * Submission shares this Run identity, so canonical per-Turn records from different Attempts
192
+ * belong to one logical Run.
193
+ */
194
+ const runIdForSubmission = (submissionId) => makeRunId(`run:${submissionId}`);
195
+ /** Stable canonical clock identity shared by every Attempt of one Run. */
196
+ const runStartedRecordId = (runId) => makeRecordId(`run-start:${runId}`);
197
+ const runStartedBatchId = (runId) => makeBatchId(`run-start:${runId}`);
198
+ const runDurationRecordId = (runId) => makeRecordId(`run-duration:${runId}`);
199
+ const runDurationBatchId = (runId) => makeBatchId(`run-duration:${runId}`);
200
+ /** Deterministic Turn identity: Attempt-independent for one (Run, canonical turn) pair. */
201
+ const turnIdForRun = (runId, turn) => makeTurnId(`turn:${runId}:${turn}`);
202
+ /** Deterministic batch identity of a response committed atomically with its closed Turn outcomes. */
203
+ const turnBatchId = (runId, turn) => makeBatchId(`turn:${runId}:${turn}`);
204
+ /**
205
+ * Deterministic batch identity of a tool-declaring Turn's RESPONSE commit (plan §2.1 commit 1):
206
+ * the assistant response plus pending steering becomes canonical before approval preflight and
207
+ * dispatch fencing, or when readonly execution first requires a persisted call-scoped capability.
208
+ * Unsettled declarations conservatively record possible execution.
209
+ */
210
+ const turnResponseBatchId = (runId, turn) => makeBatchId(`turn-response:${runId}:${turn}`);
211
+ /**
212
+ * Deterministic batch identity of a tool-declaring Turn's RESULTS commit (plan §2.1 commit 5):
213
+ * every `ToolCallSettled` record of the Turn, in declaration order, model-visible atomically.
214
+ */
215
+ const turnResultsBatchId = (runId, turn) => makeBatchId(`turn-results:${runId}:${turn}`);
216
+ /**
217
+ * Deterministic per-call late-settle batch identity used by the resolution path when one
218
+ * recovered/resolved call settles outside its Turn's results batch. Record identity
219
+ * (`tool-settled:{runId}:{turn}:{toolCallId}`) dedupes double-settles across both paths.
220
+ */
221
+ const toolCallResultBatchId = (runId, turn, toolCallId) => makeBatchId(`turn-results:${runId}:${turn}:${toolCallId}`);
222
+ /**
223
+ * Deterministic identity of one pre-Turn compaction record (RUN-026,
224
+ * RUN-026). Keyed by Run, Turn, and kind — the engine performs at most one
225
+ * threshold compaction per Turn plus at most one overflow-forced summarize,
226
+ * so a superseding Attempt that re-decides the same compaction replays the
227
+ * batch identity instead of duplicating the record.
228
+ */
229
+ const compactionRecordId = (runId, turn, kind) => makeRecordId(`compaction:${runId}:${turn}:${kind}`);
230
+ /** Deterministic batch identity of one compaction append (same string as its record id). */
231
+ const compactionBatchId = (runId, turn, kind) => makeBatchId(`compaction:${runId}:${turn}:${kind}`);
232
+ /** Deterministic canonical record identity of one Turn's `ModelResponseRecorded` record. */
233
+ const modelResponseRecordId = (runId, turn) => makeRecordId(`model-response:${runId}:${turn}`);
234
+ /** Terminal Tool completion marker committed atomically with its settled Tool result. */
235
+ const runCompletedRecordId = (runId) => makeRecordId(`run-completed:${runId}`);
236
+ /** Native source reservation locator, including the first admission of a continuing worker. */
237
+ const workerInputRecordId = (messageId) => makeRecordId(`worker-input:${messageId}`);
238
+ /** Source-owned first reservation; native worker identity is minted from its first message. */
239
+ const firstWorkerInputRecordId = (worker) => makeRecordId(`worker-input:${worker.threadId}`);
240
+ const workerOriginRecordId = (threadId) => makeRecordId(`worker-origin:${threadId}`);
241
+ const workerReportRecordId = (messageId) => makeRecordId(`worker-report:${messageId}`);
242
+ const peerMessageRecordId = (messageId) => makeRecordId(messageId);
243
+ /** Same immutable tuple used by native update admission; callers never parse its hash. */
244
+ const agentUpdateRecordId = Effect.fnUntraced(function* (threadId, runId, updateId) {
245
+ return makeRecordId(`agent-update:${yield* digestJson([
246
+ threadId,
247
+ runId,
248
+ updateId
249
+ ])}`);
250
+ });
251
+ /** Deterministic batch identity of one Turn's `ToolCallUnknown` marking append. */
252
+ const markUnknownBatchId = (submissionId, turn) => makeBatchId(`mark-unknown:${submissionId}:${turn}`);
253
+ /** Deterministic canonical record identity of one Tool Call's `ToolCallUnknown` record. */
254
+ const toolCallUnknownRecordId = (runId, turn, toolCallId) => makeRecordId(`tool-unknown:${runId}:${turn}:${toolCallId}`);
255
+ /** Deterministic batch identity of one Tool Call's resolution append (DUR-017). */
256
+ const toolCallResolutionBatchId = (submissionId, toolCallId) => makeBatchId(`resolve:${submissionId}:${toolCallId}`);
257
+ /** Deterministic canonical record identity of one Tool Call's `ToolCallResolved` record. */
258
+ const toolCallResolvedRecordId = (runId, turn, toolCallId) => makeRecordId(`tool-resolved:${runId}:${turn}:${toolCallId}`);
259
+ /**
260
+ * Deterministic identity of one accepted Durable Step result. The one-record batch reuses the
261
+ * SAME string, so batch idempotency plus the epoch fence realize the durability §11
262
+ * racing-writers rule: only the fenced winner's record commits; the loser replays it.
263
+ * A versioned JSON tuple keeps separator characters in each identity component distinct.
264
+ * Replay derives this key from the structured payload, including records with legacy IDs.
265
+ */
266
+ const toolStepSettledRecordId = (runId, toolCallId, stepName) => makeRecordId(JSON.stringify([
267
+ "step@2",
268
+ runId,
269
+ toolCallId,
270
+ stepName
271
+ ]));
272
+ /** Deterministic batch identity of one Durable Step commit (same string as its record id). */
273
+ const toolStepSettledBatchId = (runId, toolCallId, stepName) => makeBatchId(toolStepSettledRecordId(runId, toolCallId, stepName));
274
+ /** Deterministic batch identity of one Turn's canonical approval-request append (plan §2.6). */
275
+ const turnApprovalsBatchId = (runId, turn) => makeBatchId(`turn-approvals:${runId}:${turn}`);
276
+ /** Deterministic canonical record identity of one Tool Call's `ToolApprovalRequested` record. */
277
+ const toolApprovalRequestRecordId = (runId, turn, toolCallId) => makeRecordId(`approval-request:${runId}:${turn}:${toolCallId}`);
278
+ /** Deterministic batch identity of one Tool Call's canonical approval-decision append. */
279
+ const approvalDecisionBatchId = (submissionId, toolCallId) => makeBatchId(`approval-decision:${submissionId}:${toolCallId}`);
280
+ /** Deterministic canonical record identity of one Tool Call's `ToolApprovalDecided` record. */
281
+ const toolApprovalDecisionRecordId = (runId, turn, toolCallId) => makeRecordId(`approval-decision:${runId}:${turn}:${toolCallId}`);
282
+ /**
283
+ * One conservative incomplete-usage marker per Run, regardless of how often recovery occurs.
284
+ */
285
+ const modelResponseInterruptedRecordId = (runId) => makeRecordId(`interrupted:${runId}`);
286
+ /** Deterministic batch identity of one `ModelResponseInterrupted` append (same string). */
287
+ const modelResponseInterruptedBatchId = (runId) => makeBatchId(`interrupted:${runId}`);
288
+ const decodeThreadId = Schema.decodeSync(ThreadId);
289
+ const decodeIdempotencyKey = Schema.decodeSync(IdempotencyKey);
290
+ /**
291
+ * Deterministic canonical record identity of one parent Tool Call's `SubagentRequested` record.
292
+ * The one-record batch reuses the same string, so batch
293
+ * idempotency plus the parent epoch fence make the request append exactly-once-canonical.
294
+ */
295
+ const subagentRequestedRecordId = (runId, toolCallId) => makeRecordId(`subagent-requested:${runId}:${toolCallId}`);
296
+ /** Deterministic batch identity of one `SubagentRequested` append (same string). */
297
+ const subagentRequestedBatchId = (runId, toolCallId) => makeBatchId(`subagent-requested:${runId}:${toolCallId}`);
298
+ /**
299
+ * Deterministic canonical record identity of one parent Tool Call's `SubagentStarted` record.
300
+ * Recovery's start-link repair appends the EXACT same record
301
+ * under this identity, so a raced repair replays instead of duplicating (SUB-016/SUB-017).
302
+ */
303
+ const subagentStartedRecordId = (runId, toolCallId) => makeRecordId(`subagent-started:${runId}:${toolCallId}`);
304
+ /** Deterministic batch identity of one `SubagentStarted` append (same string). */
305
+ const subagentStartedBatchId = (runId, toolCallId) => makeBatchId(`subagent-started:${runId}:${toolCallId}`);
306
+ /**
307
+ * Deterministic batch identity of one parent Tool Call's atomic settlement join: the
308
+ * `SubagentJoined` record plus the parent's `ToolCallSettled` record (its existing
309
+ * `tool-settled:{runId}:{turn}:{toolCallId}` identity) commit as ONE canonical batch (SUB-019).
310
+ */
311
+ const subagentJoinBatchId = (runId, toolCallId) => makeBatchId(`subagent-join:${runId}:${toolCallId}`);
312
+ /** Deterministic canonical record identity of one parent Tool Call's `SubagentJoined` record. */
313
+ const subagentJoinedRecordId = (runId, toolCallId) => makeRecordId(`subagent-joined:${runId}:${toolCallId}`);
314
+ /**
315
+ * Deterministic identity of one child Thread's `SubagentLineageRecorded` record.
316
+ * Its own single-record batch reuses the same string so the generic
317
+ * `thread-created:{cid}` batch identity is never contradicted.
318
+ */
319
+ const subagentLineageRecordId = (threadId) => makeRecordId(`subagent-lineage:${threadId}`);
320
+ /** Deterministic batch identity of one `SubagentLineageRecorded` append (same string). */
321
+ const subagentLineageBatchId = (threadId) => makeBatchId(`subagent-lineage:${threadId}`);
322
+ /**
323
+ * Deterministic intended child Thread identity: the
324
+ * parent Submission and Tool Call pair addresses exactly one child Thread, so a replayed
325
+ * establishment converges on the one existing child (SUB-016).
326
+ */
327
+ const childThreadIdFor = (parentSubmissionId, toolCallId) => decodeThreadId(`subagent:${parentSubmissionId}:${toolCallId}`);
328
+ /**
329
+ * Deterministic child admission idempotency key: scoped to
330
+ * the parent Run and Tool Call identity, so duplicate admission attempts resolve through the
331
+ * ledger's idempotency contract to one child Receipt (SUB-016, SUB-031). The ledger key is
332
+ * bounded (256); coordinator-minted Run and Tool Call identities stay far below that bound.
333
+ */
334
+ const childIdempotencyKeyFor = (parentRunId, toolCallId) => decodeIdempotencyKey(`subagent:${parentRunId}:${toolCallId}`);
335
+ const decodePersistedPrompt = (messages) => Schema.decodeUnknownEffect(Prompt.Prompt)(messages).pipe(Effect.mapError((cause) => journalError("Canonical messages are not Schema-encoded Prompt messages", cause)));
336
+ const decodedMessages = /* @__PURE__ */ new WeakMap();
337
+ const decodePromptMessages = (messages) => Effect.suspend(() => {
338
+ if (Prompt.isPrompt(messages)) return Effect.succeed(messages);
339
+ if (!Predicate.isObject(messages)) return decodePersistedPrompt(messages);
340
+ const cached = decodedMessages.get(messages);
341
+ return cached === void 0 ? decodePersistedPrompt(messages).pipe(Effect.tap((prompt) => Effect.sync(() => {
342
+ decodedMessages.set(messages, prompt);
343
+ }))) : Effect.succeed(cached);
344
+ });
345
+ const toolMessageFromSettled = (settled) => Effect.try({
346
+ try: () => Prompt.makeMessage("tool", { content: settled.map(({ record, cleared }) => Prompt.makePart("tool-result", {
347
+ id: record.toolCallId,
348
+ name: record.toolName,
349
+ result: cleared ? CLEARED_TOOL_RESULT : record.result,
350
+ isFailure: record.isFailure,
351
+ providerExecuted: false
352
+ })) }),
353
+ catch: (cause) => journalError("Unable to rebuild Tool message from ToolCallSettled", cause)
354
+ });
355
+ const initialPolicyUsage = () => ({
356
+ committedTurns: 0,
357
+ toolCalls: 0,
358
+ programmaticToolCalls: 0,
359
+ consecutiveToolFailures: 0,
360
+ finalizationUsed: false,
361
+ modelRestarts: 0
362
+ });
363
+ const initialUsage = (modelUsage) => ({
364
+ modelCalls: 0,
365
+ inputTokens: 0,
366
+ outputTokens: 0,
367
+ lastInputTokens: 0,
368
+ lastOutputTokens: 0,
369
+ costMicrousd: 0,
370
+ modelUsage
371
+ });
372
+ /** Internal first-Run projection after exact input/checkpoint-absence verification. The
373
+ * new UserInputRecorded contributes no model message; the engine evaluates it later. */
374
+ const initialRunJournal = (history) => ({
375
+ policyUsage: RunPolicyUsage.make(initialPolicyUsage()),
376
+ usage: initialUsage([]),
377
+ prompt: history,
378
+ historyBefore: history,
379
+ historyFrom: CanonicalSequence.make(1),
380
+ committedTurns: 0
381
+ });
382
+ const projectedResponseUsage = (response) => Effect.gen(function* () {
383
+ const calls = response.modelUsage;
384
+ if (calls === void 0) return {
385
+ modelCalls: 1,
386
+ inputTokens: response.inputTokens ?? 0,
387
+ outputTokens: response.outputTokens ?? 0,
388
+ costMicrousd: response.costMicrousd ?? 0,
389
+ modelUsage: []
390
+ };
391
+ if (calls.length === 0) return yield* journalError("A canonical modelUsage list must not be empty");
392
+ const summary = yield* summarizeModelUsage(calls).pipe(Effect.mapError((cause) => journalError("Canonical model usage exceeds accounting bounds", cause)));
393
+ if (response.inputTokens !== void 0 && response.inputTokens !== summary.inputTokens.total || response.outputTokens !== void 0 && response.outputTokens !== summary.outputTokens.total || response.costMicrousd !== void 0 && response.costMicrousd !== summary.costMicrousd) return yield* journalError("Canonical detailed and aggregate model usage disagree");
394
+ return {
395
+ modelCalls: summary.modelCalls,
396
+ inputTokens: summary.inputTokens.total,
397
+ outputTokens: summary.outputTokens.total,
398
+ costMicrousd: summary.costMicrousd,
399
+ modelUsage: calls
400
+ };
401
+ });
402
+ const addProjectedUsage = (field, left, right) => Schema.decodeEffect(Schema.Natural)(left + right).pipe(Effect.mapError((cause) => journalError(`Canonical projected usage exceeds safe-integer bounds at ${field}`, cause)));
403
+ const decodeToolCallId = Schema.decodeSync(ToolCallId);
404
+ const decodeToolCallIdEffect = Schema.decodeEffect(ToolCallId);
405
+ const declaredApplicationToolCallIds = (prompt) => {
406
+ const ids = [];
407
+ for (const message of prompt.content) {
408
+ if (message.role !== "assistant") continue;
409
+ for (const part of message.content) if (part.type === "tool-call" && !part.providerExecuted) ids.push(part.id);
410
+ }
411
+ return ids;
412
+ };
413
+ /**
414
+ * Phase 5 audit tags that are prompt-transparent: they carry durability evidence (approval,
415
+ * unknown marking, resolution, Step results, approvals, interruption) but contribute nothing to
416
+ * the model-visible Prompt, and — unlike the P4 tags — they do NOT split a contiguous
417
+ * `ToolCallSettled` group into separate Tool messages, so a late-settled call's audit records
418
+ * cannot change the replayed prompt shape.
419
+ *
420
+ * The four S2 Subagent lifecycle tags are prompt-transparent for the same reason (spec §5/§11):
421
+ * the parent prompt never carries child transcript or establishment evidence — the joined child
422
+ * result reaches the model exclusively through the paired `ToolCallSettled` record, and the
423
+ * child-log lineage record is not model input.
424
+ */
425
+ const PROMPT_TRANSPARENT_TAGS = /* @__PURE__ */ new Set([
426
+ "RunPolicyUsageReserved",
427
+ "RunStarted",
428
+ "RunContextRecorded",
429
+ "RunContinuation",
430
+ "RunDurationExhausted",
431
+ "ToolCallUnknown",
432
+ "ToolCallResolved",
433
+ "ToolStepSettled",
434
+ "ToolApprovalRequested",
435
+ "ToolApprovalDecided",
436
+ "ModelResponseInterrupted",
437
+ "ModelCallAborted",
438
+ "SubagentRequested",
439
+ "SubagentStarted",
440
+ "SubagentJoined",
441
+ "SubagentLineageRecorded",
442
+ "WorkerInputRequested",
443
+ "WorkerOriginRecorded",
444
+ "WorkerInputCompleted",
445
+ "WorkerInputRefused",
446
+ "WorkerReportPrepared",
447
+ "AgentUpdateEmitted",
448
+ "WorkerReportRefused",
449
+ "PeerMessagePrepared",
450
+ "SubtreeBudgetReserved"
451
+ ]);
452
+ /**
453
+ * Reconstruct a fixed canonical prefix from a re-readable stream. The caller must keep the same
454
+ * records visible on every traversal. The first collects compaction and settlement metadata;
455
+ * rollovers additionally validate covered Tool batches before rebuilding Prompt and usage. Metadata and the
456
+ * live Prompt remain resident; covered historical message/tool payloads do not. An uncompacted Prompt still grows
457
+ * with its conversation, so hosts must configure an appropriate context compaction policy.
458
+ * Prepared metadata must describe exactly this stream through the same fixed tail;
459
+ * it skips only the metadata scan, never covered-Tool validation or the canonical fold.
460
+ * @internal
461
+ */
462
+ const projectRunJournalStream = Effect.fnUntraced(function* (records, ownerRunId, onBoundary, savedContext, preparedMetadata, onEvidence) {
463
+ if (savedContext !== void 0 && savedContext.runId !== ownerRunId) return yield* journalError("Saved original context belongs to another Run");
464
+ const initialContext = savedContext?.prompt;
465
+ if (initialContext !== void 0 && savedContext !== void 0 && savedContext.priorHistoryLength > initialContext.content.length) return yield* journalError("Saved original context has an invalid ownership boundary");
466
+ const historical = initialContext?.content.slice(0, savedContext?.priorHistoryLength) ?? [];
467
+ let state = {
468
+ all: [],
469
+ before: [],
470
+ pendingTools: [],
471
+ pendingToolsForRun: false,
472
+ committedTurns: 0
473
+ };
474
+ if (preparedMetadata !== void 0 && preparedMetadata.ownerRunId !== ownerRunId) return yield* journalError("Prepared journal metadata belongs to another replay");
475
+ let metadata = preparedMetadata;
476
+ if (metadata === void 0) {
477
+ const collected = makeJournalMetadata(ownerRunId);
478
+ yield* Stream.runForEach(records, (envelope) => Effect.sync(() => collected.add(envelope)));
479
+ metadata = collected.finish();
480
+ }
481
+ const { firstSequenceByRun, responseSequencesByRun, terminalSequenceByRun, settledSpans, settledSequenceById, settledToolCallRecordIds, settledById } = metadata;
482
+ const declarationByResultSequence = new Map(settledSpans.map(({ from, to }) => [to, from]));
483
+ const spansByDeclaration = /* @__PURE__ */ new Map();
484
+ for (const span of settledSpans) {
485
+ const spans = spansByDeclaration.get(span.from) ?? [];
486
+ spans.push(span);
487
+ spansByDeclaration.set(span.from, spans);
488
+ }
489
+ const isInRunView = (sequence, payload, runId) => {
490
+ if (runId === void 0 || payload.runId === void 0 || payload.runId === runId) return true;
491
+ const first = firstSequenceByRun.get(runId) ?? Number.POSITIVE_INFINITY;
492
+ return sequence < first || payload._tag === "ToolCallSettled" && (declarationByResultSequence.get(sequence) ?? Number.POSITIVE_INFINITY) < first;
493
+ };
494
+ const compactions = metadata.compactions.filter(({ sequence, payload }) => isInRunView(sequence, payload, ownerRunId));
495
+ const recordsForRun = records.pipe(Stream.filter(({ sequence, record: { payload } }) => isInRunView(sequence, payload, ownerRunId)));
496
+ const isCovered = (envelope, compaction) => envelope.sequence <= compaction.coversThrough && isInRunView(envelope.sequence, envelope.record.payload, compaction.runId);
497
+ const settledCoverage = compactions.reduce((through, { payload }) => payload.kind !== "summarize" ? Math.max(through, payload.coversThrough) : through, 0);
498
+ const isTerminalPriorRun = (candidateRunId, compactionRunId, beforeSequence) => {
499
+ const terminal = terminalSequenceByRun.get(candidateRunId);
500
+ return candidateRunId !== compactionRunId && terminal !== void 0 && terminal < beforeSequence && terminal > (responseSequencesByRun.get(candidateRunId)?.findLast((sequence) => sequence < beforeSequence) ?? 0);
501
+ };
502
+ const incompleteResponseSequences = [];
503
+ let ownerPrefixSequence = firstSequenceByRun.get(ownerRunId ?? "") ?? Number.POSITIVE_INFINITY;
504
+ let protectedContext = initialContext === void 0 ? void 0 : Prompt.fromMessages(initialContext.content.slice(savedContext?.priorHistoryLength));
505
+ if (settledCoverage > 0) yield* Stream.runForEach(recordsForRun, (envelope) => Effect.gen(function* () {
506
+ const payload = envelope.record.payload;
507
+ if (payload._tag !== "ModelResponseRecorded" || envelope.sequence > settledCoverage) return;
508
+ const messages = yield* decodePromptMessages(payload.messages);
509
+ const declared = declaredApplicationToolCallIds(messages);
510
+ let lastSettlementSequence = 0;
511
+ for (const id of declared) {
512
+ const callId = yield* decodeToolCallIdEffect(id).pipe(Effect.mapError((cause) => journalError("Failed to decode a declared Tool Call ID", cause)));
513
+ lastSettlementSequence = Math.max(lastSettlementSequence, settledSequenceById.get(toolCallSettledRecordId(payload.runId, payload.turn, callId)) ?? 1e400);
514
+ }
515
+ if (declared.length > 0) incompleteResponseSequences.push({
516
+ sequence: envelope.sequence,
517
+ runId: payload.runId,
518
+ lastSettlementSequence
519
+ });
520
+ if (payload.runId === ownerRunId && payload.turn === 1 && payload.runScopedPrefixLength !== void 0) {
521
+ ownerPrefixSequence = envelope.sequence;
522
+ protectedContext = Prompt.fromMessages(messages.content.slice(0, payload.runScopedPrefixLength));
523
+ }
524
+ }));
525
+ const boundIsValid = (payload, ownSequence, evidence) => {
526
+ const { runId, coversThrough } = payload;
527
+ if (coversThrough <= 0 || coversThrough >= ownSequence) return false;
528
+ const ownerFirst = firstSequenceByRun.get(runId);
529
+ if (payload.kind === "summarize" && ownerFirst !== void 0 && coversThrough >= ownerFirst) return false;
530
+ if (payload.kind !== "summarize" && savedContext?.boundaries.some((boundary) => boundary.sequence <= coversThrough && boundary.incomplete === true && boundary.terminalPriorRun !== true)) return false;
531
+ if (payload.kind !== "summarize") for (const response of incompleteResponseSequences) {
532
+ if (response.sequence > coversThrough || response.lastSettlementSequence < ownSequence || !isInRunView(response.sequence, {
533
+ _tag: "ModelResponseRecorded",
534
+ runId: response.runId
535
+ }, runId)) continue;
536
+ if (evidence !== void 0) {
537
+ evidence.add(response.sequence);
538
+ const terminal = terminalSequenceByRun.get(response.runId);
539
+ const lastResponse = responseSequencesByRun.get(response.runId)?.findLast((sequence) => sequence < ownSequence);
540
+ if (terminal !== void 0) evidence.add(terminal);
541
+ if (lastResponse !== void 0) evidence.add(lastResponse);
542
+ }
543
+ if (!isTerminalPriorRun(response.runId, runId, ownSequence)) return false;
544
+ }
545
+ for (const span of settledSpans) if (span.from <= coversThrough && coversThrough < span.to && span.to < ownSequence && isInRunView(span.from, {
546
+ _tag: "ModelResponseRecorded",
547
+ runId: span.runId
548
+ }, runId)) {
549
+ evidence?.add(span.from);
550
+ evidence?.add(span.to);
551
+ return false;
552
+ }
553
+ return true;
554
+ };
555
+ let replacements = [];
556
+ let clearings = [];
557
+ const retainCompaction = (views, next) => {
558
+ if (views.some((prior) => prior.payload.coversThrough > next.payload.coversThrough && isInRunView(next.sequence, next.payload, prior.payload.runId))) return views;
559
+ return [...views.filter((prior) => next.payload.coversThrough < prior.payload.coversThrough || !isInRunView(prior.sequence, prior.payload, next.payload.runId)), next];
560
+ };
561
+ let latestWindowId = savedContext?.contextWindowId;
562
+ let latestWindowSequence = -1;
563
+ let latestWindow;
564
+ let rolloverCoveredThrough = 0;
565
+ for (const { payload, sequence } of compactions) {
566
+ if (!boundIsValid(payload, sequence)) continue;
567
+ if (payload.kind === "rollover" && sequence > latestWindowSequence) {
568
+ latestWindowId = contextWindowId(payload.runId, payload.turn);
569
+ latestWindowSequence = sequence;
570
+ latestWindow = {
571
+ payload,
572
+ sequence
573
+ };
574
+ }
575
+ if (payload.kind === "rollover") rolloverCoveredThrough = Math.max(rolloverCoveredThrough, payload.coversThrough);
576
+ if (payload.kind === "summarize" || payload.kind === "rollover") {
577
+ if (payload.kind === "summarize" && payload.summary === void 0) continue;
578
+ replacements = retainCompaction(replacements, {
579
+ payload,
580
+ sequence
581
+ });
582
+ } else clearings = retainCompaction(clearings, {
583
+ payload,
584
+ sequence
585
+ });
586
+ }
587
+ const contextViews = [
588
+ ...replacements,
589
+ ...clearings,
590
+ ...latestWindow === void 0 ? [] : [latestWindow]
591
+ ];
592
+ const contextCompactions = new Set(contextViews.map(({ sequence }) => sequence));
593
+ const historyFrom = CanonicalSequence.make(replacements.reduce((from, { payload }) => Math.max(from, payload.coversThrough + 1), savedContext?.historyFrom ?? 1));
594
+ const contextValidationViews = compactions.filter(({ sequence }) => sequence >= historyFrom || contextCompactions.has(sequence));
595
+ const contextEvidence = new Set(contextValidationViews.flatMap(({ payload }) => {
596
+ const sequence = firstSequenceByRun.get(payload.runId);
597
+ return sequence === void 0 ? [] : [sequence];
598
+ }));
599
+ if (onEvidence !== void 0) for (const { payload, sequence } of contextValidationViews) boundIsValid(payload, sequence, contextEvidence);
600
+ const retainEvidence = (envelope) => {
601
+ if (onEvidence === void 0) return;
602
+ onEvidence(envelope);
603
+ if (envelope.sequence < historyFrom && envelope.record.payload._tag === "ModelResponseRecorded") {
604
+ for (const span of spansByDeclaration.get(envelope.sequence) ?? []) if (span.to < historyFrom) contextEvidence.add(span.to);
605
+ }
606
+ };
607
+ let summaryEmitted = false;
608
+ const retainedPrefix = replacements.some(({ payload }) => payload.kind === "rollover" && payload.runId === ownerRunId && ownerPrefixSequence <= payload.coversThrough) ? protectedContext?.content ?? [] : [];
609
+ const replacementLength = retainedPrefix.length + replacements.length;
610
+ const emitSummary = () => {
611
+ if (summaryEmitted || replacements.length === 0) return;
612
+ summaryEmitted = true;
613
+ state.all.push(...retainedPrefix);
614
+ for (const { payload: replacement } of replacements) {
615
+ const message = replacement.kind === "rollover" ? contextWindowMessage(contextWindowId(replacement.runId, replacement.turn), replacement.handoff) : Prompt.makeMessage("user", { content: [Prompt.makePart("text", { text: `${COMPACTION_SUMMARY_PREFIX}${replacement.summary}` })] });
616
+ state.all.push(message);
617
+ if (replacement.kind !== "rollover" || replacement.runId !== ownerRunId) state.before.push(message);
618
+ onBoundary?.({
619
+ sequence: replacement.coversThrough,
620
+ tag: "CompactionCreated",
621
+ promptLength: state.all.length
622
+ });
623
+ }
624
+ };
625
+ if (savedContext !== void 0) {
626
+ emitSummary();
627
+ for (const [index, message] of historical.entries()) {
628
+ const boundary = savedContext.boundaries.find((entry) => entry.promptLength > index);
629
+ if (boundary === void 0 && replacements.length > 0) return yield* journalError("Saved context lacks its canonical compaction boundary");
630
+ if (boundary !== void 0 && replacements.some(({ payload }) => boundary.sequence <= payload.coversThrough)) continue;
631
+ const visible = message.role === "tool" && boundary !== void 0 && clearings.some(({ payload }) => boundary.sequence <= payload.coversThrough) ? Prompt.makeMessage("tool", { content: message.content.map((part) => part.type === "tool-result" ? Prompt.makePart("tool-result", {
632
+ ...part,
633
+ result: CLEARED_TOOL_RESULT
634
+ }) : part) }) : message;
635
+ state.all.push(visible);
636
+ state.before.push(visible);
637
+ }
638
+ for (const boundary of savedContext.boundaries) {
639
+ const removed = savedContext.boundaries.reduce((length, candidate) => candidate.sequence <= boundary.sequence && replacements.some(({ payload }) => candidate.sequence <= payload.coversThrough) ? Math.max(length, candidate.promptLength) : length, 0);
640
+ onBoundary?.({
641
+ ...boundary,
642
+ promptLength: replacementLength + Math.max(0, boundary.promptLength - removed)
643
+ });
644
+ }
645
+ }
646
+ const modelUsage = [];
647
+ let unobservedModelCalls = 0;
648
+ const usage = initialUsage(modelUsage);
649
+ let toolSelection;
650
+ let usageTurn = 0;
651
+ const incompleteToolTurns = /* @__PURE__ */ new Set();
652
+ const incompleteToolCalls = /* @__PURE__ */ new Set();
653
+ const incompleteContextRuns = /* @__PURE__ */ new Set();
654
+ for (const response of incompleteResponseSequences) if (contextViews.some((view) => view.payload.kind !== "summarize" && response.sequence <= view.payload.coversThrough && response.lastSettlementSequence >= view.sequence)) incompleteContextRuns.add(response.runId);
655
+ let pendingContextToolCallId;
656
+ let ownerTerminated = false;
657
+ const policyUsage = initialPolicyUsage();
658
+ const accountResponse = Effect.fnUntraced(function* (envelope, payload, messages) {
659
+ const record = envelope.record;
660
+ const declared = declaredApplicationToolCallIds(messages);
661
+ const actualResultIds = [];
662
+ let incomplete = false;
663
+ for (const id of declared) {
664
+ const toolCallId = yield* Effect.try({
665
+ try: () => decodeToolCallId(id),
666
+ catch: (cause) => journalError("Failed to decode a declared Tool Call ID", cause)
667
+ });
668
+ const resultId = toolCallSettledRecordId(payload.runId, payload.turn, toolCallId);
669
+ if (settledToolCallRecordIds.has(resultId)) actualResultIds.push(resultId);
670
+ else incomplete = true;
671
+ }
672
+ if (incomplete) {
673
+ incompleteToolTurns.add(envelope.record.recordId);
674
+ incompleteContextRuns.add(payload.runId);
675
+ for (const recordId of actualResultIds) incompleteToolCalls.add(recordId);
676
+ }
677
+ if (payload.runId !== ownerRunId) return;
678
+ if (!("toolOperations" in payload)) return yield* journalError("Owning Run execution requires full canonical evidence");
679
+ if (payload.turn === 1 && payload.runScopedPrefixLength !== void 0) protectedContext = Prompt.fromMessages(messages.content.slice(0, payload.runScopedPrefixLength));
680
+ const responseUsage = yield* projectedResponseUsage(payload);
681
+ unobservedModelCalls = yield* addProjectedUsage("unobservedModelCalls", unobservedModelCalls, payload.unobservedModelCalls ?? 0);
682
+ usage.modelCalls = yield* addProjectedUsage("modelCalls", usage.modelCalls, responseUsage.modelCalls);
683
+ usage.inputTokens = yield* addProjectedUsage("inputTokens", usage.inputTokens, responseUsage.inputTokens);
684
+ usage.outputTokens = yield* addProjectedUsage("outputTokens", usage.outputTokens, responseUsage.outputTokens);
685
+ usage.costMicrousd = yield* addProjectedUsage("costMicrousd", usage.costMicrousd, responseUsage.costMicrousd);
686
+ usage.modelUsage.push(...responseUsage.modelUsage);
687
+ if (payload.turn > usageTurn) {
688
+ usageTurn = payload.turn;
689
+ usage.lastInputTokens = responseUsage.inputTokens;
690
+ usage.lastOutputTokens = responseUsage.outputTokens;
691
+ }
692
+ policyUsage.committedTurns = Math.max(policyUsage.committedTurns, payload.turn);
693
+ const calls = messages.content.flatMap((message) => message.role === "assistant" ? message.content.filter((part) => part.type === "tool-call") : []);
694
+ const candidate = calls.length === 1 ? calls[0] : void 0;
695
+ const candidateResult = candidate === void 0 ? void 0 : settledById.get(`tool-settled:${ownerRunId}:${payload.turn}:${candidate.id}`);
696
+ pendingContextToolCallId = candidate !== void 0 && !candidate.providerExecuted && candidateResult?.isFailure === false && candidateResult.budgetRejected !== true && envelope.sequence > rolloverCoveredThrough ? candidate.id : void 0;
697
+ policyUsage.toolCalls += calls.length;
698
+ if (payload.toolExposure !== void 0) toolSelection = payload.toolExposure.selection;
699
+ if (incompleteToolTurns.has(record.recordId)) return;
700
+ for (const call of calls) {
701
+ const result = call.providerExecuted ? messages.content.flatMap((message) => message.role === "assistant" ? message.content : []).find((part) => part.type === "tool-result" && part.providerExecuted && part.id === call.id) : settledById.get(`tool-settled:${ownerRunId}:${payload.turn}:${call.id}`);
702
+ if (result === void 0 || "budgetRejected" in result && result.budgetRejected === true) continue;
703
+ if (!("isFailure" in result)) continue;
704
+ if (!result.isFailure && "toolSelection" in result && result.toolSelection !== void 0) toolSelection = result.toolSelection;
705
+ policyUsage.consecutiveToolFailures = result.isFailure ? policyUsage.consecutiveToolFailures + 1 : 0;
706
+ }
707
+ });
708
+ const historicalResults = /* @__PURE__ */ new Map();
709
+ const retiredLateCalls = /* @__PURE__ */ new Map();
710
+ let pendingToolOrder = /* @__PURE__ */ new Map();
711
+ const flushTools = Effect.fnUntraced(function* (current) {
712
+ if (current.pendingTools.length === 0) return current;
713
+ const ordered = current.pendingTools.toSorted((left, right) => (pendingToolOrder.get(left.record.toolCallId) ?? Number.MAX_SAFE_INTEGER) - (pendingToolOrder.get(right.record.toolCallId) ?? Number.MAX_SAFE_INTEGER));
714
+ const toolMessage = yield* toolMessageFromSettled(ordered);
715
+ current.all.push(toolMessage);
716
+ if (!current.pendingToolsForRun) current.before.push(toolMessage);
717
+ return {
718
+ ...current,
719
+ pendingTools: [],
720
+ pendingToolsForRun: false
721
+ };
722
+ });
723
+ yield* Stream.runForEach(recordsForRun, (envelope) => Effect.gen(function* () {
724
+ const payload = envelope.record.payload;
725
+ if (contextEvidence.has(envelope.sequence)) retainEvidence(envelope);
726
+ if ((payload._tag === "RunCompleted" || payload._tag === "RunFailed" || payload._tag === "SubmissionSettled") && payload.runId !== void 0 && incompleteContextRuns.has(payload.runId)) retainEvidence(envelope);
727
+ if ((payload._tag === "RunCompleted" || payload._tag === "RunFailed") && payload.runId === ownerRunId || payload._tag === "SubmissionSettled" && runIdForSubmission(payload.submissionId) === ownerRunId) ownerTerminated = true;
728
+ if (payload._tag === "RunPolicyUsageReserved" && payload.runId === ownerRunId) {
729
+ if (payload.programmaticToolCalls < policyUsage.programmaticToolCalls || policyUsage.finalizationUsed && !payload.finalizationUsed) return yield* journalError("Run policy reservations must be monotonic");
730
+ policyUsage.programmaticToolCalls = payload.programmaticToolCalls;
731
+ policyUsage.finalizationUsed = payload.finalizationUsed;
732
+ }
733
+ if (payload._tag === "ModelCallAborted" && payload.runId === ownerRunId) {
734
+ if (payload.restart !== policyUsage.modelRestarts + 1) return yield* journalError("Model restart reservations must advance once");
735
+ policyUsage.modelRestarts = payload.restart;
736
+ const summary = yield* summarizeModelUsage(payload.modelUsage).pipe(Effect.mapError((cause) => journalError("Aborted model usage exceeds accounting bounds", cause)));
737
+ usage.modelCalls = yield* addProjectedUsage("modelCalls", usage.modelCalls, summary.modelCalls);
738
+ usage.inputTokens = yield* addProjectedUsage("inputTokens", usage.inputTokens, summary.inputTokens.total);
739
+ usage.outputTokens = yield* addProjectedUsage("outputTokens", usage.outputTokens, summary.outputTokens.total);
740
+ usage.costMicrousd = yield* addProjectedUsage("costMicrousd", usage.costMicrousd, summary.costMicrousd);
741
+ usage.modelUsage.push(...payload.modelUsage);
742
+ unobservedModelCalls = yield* addProjectedUsage("unobservedModelCalls", unobservedModelCalls, payload.unobservedModelCalls);
743
+ }
744
+ if (PROMPT_TRANSPARENT_TAGS.has(payload._tag)) return;
745
+ if (payload._tag === "CompactionCreated") {
746
+ if (contextCompactions.has(envelope.sequence)) retainEvidence(envelope);
747
+ return;
748
+ }
749
+ if (replacements.some(({ payload }) => isCovered(envelope, payload))) {
750
+ if (payload._tag === "ModelResponseRecorded" && payload.runId !== ownerRunId) {
751
+ const late = (spansByDeclaration.get(envelope.sequence) ?? []).filter((span) => replacements.some((view) => isCovered(envelope, view.payload) && span.to > view.sequence));
752
+ if (late.length > 0) {
753
+ retainEvidence(envelope);
754
+ if (latestWindow !== void 0 && isCovered(envelope, latestWindow.payload)) return;
755
+ const messages = yield* decodePromptMessages(payload.messages);
756
+ for (const message of messages.content) {
757
+ if (message.role !== "assistant") continue;
758
+ for (const call of message.content) {
759
+ if (call.type !== "tool-call" || call.providerExecuted) continue;
760
+ const callId = yield* decodeToolCallIdEffect(call.id).pipe(Effect.mapError((cause) => journalError("Invalid retired Tool Call ID", cause)));
761
+ const id = toolCallSettledRecordId(payload.runId, payload.turn, callId);
762
+ if (late.some((span) => span.recordId === id)) retiredLateCalls.set(id, call);
763
+ }
764
+ }
765
+ }
766
+ }
767
+ if (payload._tag === "ModelResponseRecorded" && payload.runId === ownerRunId) {
768
+ const messages = yield* decodePromptMessages(payload.messages);
769
+ yield* accountResponse(envelope, payload, messages);
770
+ state = {
771
+ ...state,
772
+ committedTurns: Math.max(state.committedTurns, payload.turn)
773
+ };
774
+ }
775
+ return;
776
+ }
777
+ emitSummary();
778
+ if (payload._tag === "ToolCallSettled") {
779
+ const declarationFact = {
780
+ sequence: declarationByResultSequence.get(envelope.sequence) ?? 1e400,
781
+ record: { payload: {
782
+ _tag: "ModelResponseRecorded",
783
+ runId: payload.runId
784
+ } }
785
+ };
786
+ const declarationCovered = (compaction) => declarationFact.sequence <= compaction.coversThrough && isInRunView(declarationFact.sequence, declarationFact.record.payload, compaction.runId);
787
+ if (latestWindow !== void 0 && declarationCovered(latestWindow.payload)) return;
788
+ retainEvidence(envelope);
789
+ if (payload.runId !== ownerRunId) {
790
+ const slot = historicalResults.get(envelope.record.recordId);
791
+ if (slot === void 0) {
792
+ const call = retiredLateCalls.get(envelope.record.recordId);
793
+ if (call === void 0 || call.id !== payload.toolCallId || call.name !== payload.toolName) return yield* journalError("Historical Tool result has no matching declaration");
794
+ const pair = [Prompt.makeMessage("assistant", { content: [call] }), Prompt.makeMessage("tool", { content: [Prompt.makePart("tool-result", {
795
+ id: call.id,
796
+ name: call.name,
797
+ result: clearings.some(({ payload }) => declarationCovered(payload)) ? CLEARED_TOOL_RESULT : payload.result,
798
+ isFailure: payload.isFailure,
799
+ providerExecuted: false
800
+ })] })];
801
+ state.all.push(...pair);
802
+ state.before.push(...pair);
803
+ retiredLateCalls.delete(envelope.record.recordId);
804
+ onBoundary?.({
805
+ sequence: envelope.sequence,
806
+ tag: payload._tag,
807
+ promptLength: state.all.length
808
+ });
809
+ return;
810
+ }
811
+ const declared = slot.parts[slot.partIndex];
812
+ if (declared?.id !== payload.toolCallId || declared.name !== payload.toolName) return yield* journalError("Historical Tool result differs from its declaration");
813
+ slot.parts[slot.partIndex] = Prompt.makePart("tool-result", {
814
+ id: payload.toolCallId,
815
+ name: payload.toolName,
816
+ result: clearings.some(({ payload }) => isCovered(envelope, payload) || declarationCovered(payload)) ? CLEARED_TOOL_RESULT : payload.result,
817
+ isFailure: payload.isFailure,
818
+ providerExecuted: false
819
+ });
820
+ const message = Prompt.makeMessage("tool", { content: [...slot.parts] });
821
+ state.all[slot.allIndex] = message;
822
+ state.before[slot.beforeIndex] = message;
823
+ historicalResults.delete(envelope.record.recordId);
824
+ onBoundary?.({
825
+ sequence: envelope.sequence,
826
+ tag: payload._tag,
827
+ promptLength: state.all.length,
828
+ ...incompleteToolCalls.has(envelope.record.recordId) ? { incomplete: true } : {},
829
+ ...isTerminalPriorRun(payload.runId, ownerRunId, Number.POSITIVE_INFINITY) ? { terminalPriorRun: true } : {}
830
+ });
831
+ return;
832
+ }
833
+ if (state.pendingTools.length > 0 && state.pendingToolsForRun !== (payload.runId === ownerRunId)) state = yield* flushTools(state);
834
+ state.pendingTools.push({
835
+ record: payload,
836
+ cleared: clearings.some(({ payload }) => isCovered(envelope, payload))
837
+ });
838
+ state = {
839
+ ...state,
840
+ pendingToolsForRun: payload.runId === ownerRunId
841
+ };
842
+ onBoundary?.({
843
+ sequence: envelope.sequence,
844
+ tag: payload._tag,
845
+ promptLength: state.all.length + 1,
846
+ ...isTerminalPriorRun(payload.runId, ownerRunId, Number.POSITIVE_INFINITY) ? { terminalPriorRun: true } : {},
847
+ ...incompleteToolCalls.has(envelope.record.recordId) ? { incomplete: true } : {}
848
+ });
849
+ return;
850
+ }
851
+ state = yield* flushTools(state);
852
+ if (payload._tag === "ModelCompleted" && payload.history !== void 0) {
853
+ retainEvidence(envelope);
854
+ const messages = yield* decodePromptMessages(payload.history);
855
+ state.all.length = 0;
856
+ state.before.length = 0;
857
+ historicalResults.clear();
858
+ for (const message of messages.content) {
859
+ state.all.push(message);
860
+ if (payload.runId !== ownerRunId) state.before.push(message);
861
+ }
862
+ onBoundary?.({
863
+ sequence: envelope.sequence,
864
+ tag: payload._tag,
865
+ promptLength: state.all.length
866
+ });
867
+ return;
868
+ }
869
+ if (payload._tag !== "ModelResponseRecorded") return;
870
+ retainEvidence(envelope);
871
+ const messages = yield* decodePromptMessages(payload.messages);
872
+ const forRun = payload.runId === ownerRunId;
873
+ pendingToolOrder = new Map(declaredApplicationToolCallIds(messages).map((id, index) => [id, index]));
874
+ yield* accountResponse(envelope, payload, messages);
875
+ const visibleMessages = forRun ? messages.content : messages.content.filter((message) => message.role !== "system");
876
+ for (const message of visibleMessages) {
877
+ state.all.push(message);
878
+ if (!forRun) state.before.push(message);
879
+ }
880
+ if (!forRun) {
881
+ const calls = messages.content.flatMap((message) => message.role === "assistant" ? message.content.filter((part) => part.type === "tool-call" && !part.providerExecuted) : []);
882
+ if (calls.length > 0) {
883
+ const parts = calls.map((call) => Prompt.makePart("tool-result", {
884
+ id: call.id,
885
+ name: call.name,
886
+ result: {
887
+ _tag: "ToolOutcomeUnknown",
888
+ message: "This earlier operation has no recorded outcome. It may have executed. Do not assume success or retry it; its original operation remains unresolved."
889
+ },
890
+ isFailure: true,
891
+ providerExecuted: false
892
+ }));
893
+ const allIndex = state.all.length;
894
+ const beforeIndex = state.before.length;
895
+ const message = Prompt.makeMessage("tool", { content: parts });
896
+ state.all.push(message);
897
+ state.before.push(message);
898
+ for (const [partIndex, call] of calls.entries()) {
899
+ const callId = yield* decodeToolCallIdEffect(call.id).pipe(Effect.mapError((cause) => journalError("Invalid historical Tool Call ID", cause)));
900
+ const resultId = toolCallSettledRecordId(payload.runId, payload.turn, callId);
901
+ if (!settledToolCallRecordIds.has(resultId)) continue;
902
+ historicalResults.set(resultId, {
903
+ allIndex,
904
+ beforeIndex,
905
+ parts,
906
+ partIndex
907
+ });
908
+ }
909
+ }
910
+ }
911
+ state = {
912
+ ...state,
913
+ committedTurns: forRun ? Math.max(state.committedTurns, payload.turn) : state.committedTurns
914
+ };
915
+ onBoundary?.({
916
+ sequence: envelope.sequence,
917
+ tag: payload._tag,
918
+ promptLength: state.all.length,
919
+ ...isTerminalPriorRun(payload.runId, ownerRunId, Number.POSITIVE_INFINITY) ? { terminalPriorRun: true } : {},
920
+ ...incompleteToolTurns.has(envelope.record.recordId) ? { incomplete: true } : {}
921
+ });
922
+ }));
923
+ emitSummary();
924
+ state = yield* flushTools(state);
925
+ const validatedPolicyUsage = yield* Schema.decodeEffect(RunPolicyUsage)(policyUsage).pipe(Effect.mapError((cause) => journalError("Run policy accounting exceeds its Schema bounds", cause)));
926
+ return {
927
+ ...toolSelection === void 0 ? {} : { toolSelection },
928
+ policyUsage: validatedPolicyUsage,
929
+ prompt: Prompt.fromMessages(state.all),
930
+ historyBefore: Prompt.fromMessages(state.before),
931
+ historyFrom,
932
+ committedTurns: state.committedTurns,
933
+ usage: unobservedModelCalls === 0 ? usage : {
934
+ ...usage,
935
+ unobservedModelCalls
936
+ },
937
+ ...latestWindowId === void 0 ? {} : { contextWindowId: latestWindowId },
938
+ ...protectedContext === void 0 ? {} : { protectedContext },
939
+ ...ownerTerminated || pendingContextToolCallId === void 0 ? {} : { pendingContextToolCallId }
940
+ };
941
+ });
942
+ /** Pure projection of one Run's durable recovery state from canonical records. */
943
+ const projectRunJournal = (records, runId) => projectRunJournalStream(Stream.fromIterable(records), runId);
944
+ /**
945
+ * Pure valid-prompt projection from canonical records: `UserInputRecorded` +
946
+ * `ModelResponseRecorded` + complete `ToolCallSettled` batches → the deterministic model-visible
947
+ * Prompt (plan §Coordinator flow step 3).
948
+ */
949
+ const promptFromCanonicalRecords = (records) => projectRunJournalStream(Stream.fromIterable(records), void 0).pipe(Effect.map((projection) => projection.prompt));
950
+ const decodeModelResponse = Schema.decodeUnknownEffect(ModelResponseRecorded);
951
+ const decodeToolSettled = Schema.decodeUnknownEffect(ToolCallSettled);
952
+ const encodePrompt = Schema.encodeEffect(Prompt.Prompt);
953
+ const requireCanonicalTurn = (turn) => !Number.isInteger(turn) || turn <= 0 ? Effect.fail(journalError(`Canonical turn number must be a positive integer: ${turn}`)) : Effect.void;
954
+ const modelResponseRecord = Effect.fnUntraced(function* (input) {
955
+ const promptMessages = input.responseMessages;
956
+ if (promptMessages.some((message) => message.role === "tool")) return yield* journalError("Application Tool outcomes must be supplied as terminal facts");
957
+ const runScopedPrefixLength = input.runScopedPrefixLength;
958
+ if (runScopedPrefixLength !== void 0 && (input.turn !== 1 || !Number.isSafeInteger(runScopedPrefixLength) || runScopedPrefixLength <= 0 || runScopedPrefixLength > promptMessages.length || promptMessages.slice(0, runScopedPrefixLength).some((message) => message.role !== "system" && message.role !== "user"))) return yield* journalError("Run-scoped Prompt provenance must identify a non-empty system/user prefix of Turn 1 before its assistant response");
959
+ const encodedMessages = yield* encodePrompt(Prompt.fromMessages([...promptMessages])).pipe(Effect.mapErrorEager((cause) => journalError("Turn Prompt messages failed to encode", cause)));
960
+ const modelUsage = input.usage?.modelUsage;
961
+ const payload = yield* decodeModelResponse({
962
+ _tag: "ModelResponseRecorded",
963
+ toolResultMaxBytes: input.toolResultMaxBytes ?? 1048576,
964
+ toolSelectionMaxBytes: input.toolSelectionMaxBytes ?? 0,
965
+ toolOperations: input.toolOperations ?? [],
966
+ ...input.toolParameterRejections === void 0 || input.toolParameterRejections.length === 0 ? {} : { toolParameterRejections: input.toolParameterRejections },
967
+ ...input.toolExposure === void 0 ? {} : { toolExposure: input.toolExposure },
968
+ runId: input.runId,
969
+ turnId: input.turnId,
970
+ turn: input.turn,
971
+ messages: encodedMessages,
972
+ ...runScopedPrefixLength === void 0 ? {} : { runScopedPrefixLength },
973
+ ...modelUsage === void 0 ? {} : { modelUsage },
974
+ ...input.unobservedModelCalls === void 0 || input.unobservedModelCalls === 0 ? {} : { unobservedModelCalls: input.unobservedModelCalls },
975
+ ...input.usage === void 0 ? {} : {
976
+ inputTokens: input.usage.inputTokens,
977
+ outputTokens: input.usage.outputTokens,
978
+ ...input.usage.costMicrousd === void 0 || input.usage.costMicrousd === 0 ? {} : { costMicrousd: input.usage.costMicrousd }
979
+ }
980
+ }).pipe(Effect.mapErrorEager((cause) => journalError("Invalid model response operation evidence", cause)));
981
+ if (payload.modelUsage !== void 0) {
982
+ if (payload.modelUsage.length === 0) return yield* journalError("Turn model usage must contain at least one completed call");
983
+ const summary = yield* continuationUsage(payload.modelUsage).pipe(Effect.mapErrorEager((cause) => journalError("Turn model usage exceeds accounting bounds", cause)));
984
+ if (payload.inputTokens !== summary.inputTokens || payload.outputTokens !== summary.outputTokens || (payload.costMicrousd ?? 0) !== summary.costMicrousd) return yield* journalError("Turn detailed and aggregate model usage disagree");
985
+ }
986
+ return RecordEnvelope.make({
987
+ recordId: modelResponseRecordId(input.runId, input.turn),
988
+ family: "thread",
989
+ schemaVersion: 1,
990
+ createdAt: input.createdAt,
991
+ deploymentId: input.deploymentId,
992
+ payload
993
+ });
994
+ });
995
+ const toolSettledRecords = Effect.fnUntraced(function* (input) {
996
+ const toolRecords = [];
997
+ for (const part of input.toolResults) {
998
+ const payload = yield* decodeToolSettled({
999
+ _tag: "ToolCallSettled",
1000
+ ...part.toolSelection === void 0 ? {} : { toolSelection: part.toolSelection },
1001
+ runId: input.runId,
1002
+ toolCallId: part.toolCallId,
1003
+ toolName: part.toolName,
1004
+ result: part.result,
1005
+ isFailure: part.isFailure,
1006
+ ...part.budgetRejected === true ? { budgetRejected: true } : {}
1007
+ }).pipe(Effect.mapError((cause) => journalError(`Invalid Tool result ${part.toolCallId}`, cause)));
1008
+ toolRecords.push(RecordEnvelope.make({
1009
+ recordId: toolCallSettledRecordId(input.runId, input.turn, payload.toolCallId),
1010
+ family: "thread",
1011
+ schemaVersion: 1,
1012
+ createdAt: input.createdAt,
1013
+ deploymentId: input.deploymentId,
1014
+ payload
1015
+ }));
1016
+ }
1017
+ return toolRecords;
1018
+ });
1019
+ const runCompletionRecord = (input) => {
1020
+ if (input.runCompletion === void 0) return void 0;
1021
+ const completion = {
1022
+ runId: input.runId,
1023
+ ...input.runCompletion
1024
+ };
1025
+ return RecordEnvelope.make({
1026
+ recordId: runCompletedRecordId(input.runId),
1027
+ family: "thread",
1028
+ schemaVersion: 1,
1029
+ createdAt: input.createdAt,
1030
+ deploymentId: input.deploymentId,
1031
+ payload: RunCompleted.make({ ...completion })
1032
+ });
1033
+ };
1034
+ /**
1035
+ * Build a canonical batch from interpreter-validated Turn facts: one
1036
+ * `ModelResponseRecorded` record plus one `ToolCallSettled` record per terminal Tool result, all
1037
+ * under the WP0-style deterministic identities, committed as ONE atomic batch. The same input
1038
+ * always yields byte-identical content, so an in-Attempt append retry is an honest batch replay.
1039
+ *
1040
+ * No-tool Turns and eligible readonly Turns use this shape; a terminal `RunCompleted` marker
1041
+ * joins the response in the same atomic batch. Other application Turns split into
1042
+ * `turnResponseBatch` + `turnResultsBatch` before execution.
1043
+ */
1044
+ const turnCanonicalBatch = Effect.fnUntraced(function* (input) {
1045
+ yield* requireCanonicalTurn(input.turn);
1046
+ const modelResponse = yield* modelResponseRecord(input);
1047
+ const toolRecords = yield* toolSettledRecords(input);
1048
+ const completionRecord = runCompletionRecord(input);
1049
+ return CanonicalBatch.make({
1050
+ batchId: turnBatchId(input.runId, input.turn),
1051
+ producerId: input.producerId,
1052
+ records: completionRecord === void 0 ? [modelResponse, ...toolRecords] : [
1053
+ modelResponse,
1054
+ ...toolRecords,
1055
+ completionRecord
1056
+ ]
1057
+ });
1058
+ });
1059
+ /**
1060
+ * Commit the normalized response and original operation contracts before application Tools
1061
+ * execute, or promote a deferred readonly response before a persisted call-scoped capability.
1062
+ * An unsettled application declaration is conservative uncertainty after ownership
1063
+ * loss; approvals and the dispatch fence remain separate execution requirements. Provider
1064
+ * results stay in assistant content. Application outcomes belong to the results commit.
1065
+ */
1066
+ const turnResponseBatch = Effect.fnUntraced(function* (input) {
1067
+ yield* requireCanonicalTurn(input.turn);
1068
+ const modelResponse = yield* modelResponseRecord(input);
1069
+ return CanonicalBatch.make({
1070
+ batchId: turnResponseBatchId(input.runId, input.turn),
1071
+ producerId: input.producerId,
1072
+ records: [modelResponse]
1073
+ });
1074
+ });
1075
+ /**
1076
+ * Commit 5 of a tool-declaring Turn (plan §2.1): the Turn's `ToolCallSettled` records in
1077
+ * declaration order under batch identity `turn-results:{runId}:{turn}` — the batch becomes
1078
+ * model-visible atomically. A completion after already committed Tool results gets its own
1079
+ * terminal batch; it never rewrites or repeats the earlier Tool outcomes.
1080
+ */
1081
+ const turnResultsBatch = Effect.fnUntraced(function* (input) {
1082
+ yield* requireCanonicalTurn(input.turn);
1083
+ const toolRecords = yield* toolSettledRecords(input);
1084
+ const first = toolRecords[0];
1085
+ const completionRecord = runCompletionRecord(input);
1086
+ if (first === void 0) {
1087
+ if (completionRecord === void 0) return yield* journalError(`Turn ${input.turn} has no terminal Tool results to commit`);
1088
+ return CanonicalBatch.make({
1089
+ batchId: makeBatchId(runCompletedRecordId(input.runId)),
1090
+ producerId: input.producerId,
1091
+ records: [completionRecord]
1092
+ });
1093
+ }
1094
+ if (input.runCompletion !== void 0 && toolRecords.length !== 1) return yield* journalError("A terminal Tool completion requires exactly one settled result");
1095
+ return CanonicalBatch.make({
1096
+ batchId: turnResultsBatchId(input.runId, input.turn),
1097
+ producerId: input.producerId,
1098
+ records: completionRecord === void 0 ? [first, ...toolRecords.slice(1)] : [
1099
+ first,
1100
+ ...toolRecords.slice(1),
1101
+ completionRecord
1102
+ ]
1103
+ });
1104
+ });
1105
+ export { makeJournalMetadata as $, subagentRequestedRecordId as A, toolStepSettledRecordId as B, runStartedBatchId as C, subagentLineageBatchId as D, subagentJoinedRecordId as E, toolCallResolutionBatchId as F, turnResponseBatch as G, turnBatchId as H, toolCallResolvedRecordId as I, turnResultsBatchId as J, turnResponseBatchId as K, toolCallResultBatchId as L, subagentStartedRecordId as M, toolApprovalDecisionRecordId as N, subagentLineageRecordId as O, toolApprovalRequestRecordId as P, continuationUsage as Q, toolCallUnknownRecordId as R, runIdForSubmission as S, subagentJoinBatchId as T, turnCanonicalBatch as U, turnApprovalsBatchId as V, turnIdForRun as W, workerOriginRecordId as X, workerInputRecordId as Y, workerReportRecordId as Z, projectRunJournalStream as _, childIdempotencyKeyFor as a, runDurationBatchId as b, compactionRecordId as c, markUnknownBatchId as d, toolCallSettledRecordId as et, modelResponseInterruptedBatchId as f, projectRunJournal as g, peerMessageRecordId as h, approvalDecisionBatchId as i, subagentStartedBatchId as j, subagentRequestedBatchId as k, firstWorkerInputRecordId as l, modelResponseRecordId as m, RunJournal_exports as n, childThreadIdFor as o, modelResponseInterruptedRecordId as p, turnResultsBatch as q, agentUpdateRecordId as r, compactionBatchId as s, RunJournalError as t, initialRunJournal as u, promptFromCanonicalRecords as v, runStartedRecordId as w, runDurationRecordId as x, runCompletedRecordId as y, toolStepSettledBatchId as z };
1106
+
1107
+ //# sourceMappingURL=RunJournal-C_1eqQdr.mjs.map