@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Daniel van der Merwe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,90 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as Context from "effect/Context";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Layer from "effect/Layer";
5
+ import * as Schema from "effect/Schema";
6
+ import { u as ThreadId } from "./Identifiers-LWd4837I.mjs";
7
+ import { U as PersistedJson, Z as RecordId, b as Digest, f as CanonicalSequence } from "./Records-C645aQks.mjs";
8
+ // src/durable/ActivityStore.ts
9
+ var ActivityStore_exports = /* @__PURE__ */ __exportAll({
10
+ ActivityBusy: () => ActivityBusy,
11
+ ActivityMutationFailpoint: () => ActivityMutationFailpoint,
12
+ ActivityMutationFailure: () => ActivityMutationFailure,
13
+ ActivityMutationPoint: () => ActivityMutationPoint,
14
+ ActivityOwnershipLost: () => ActivityOwnershipLost,
15
+ ActivityProcessorKey: () => ActivityProcessorKey,
16
+ ActivityProcessorStore: () => ActivityProcessorStore,
17
+ ActivityProgress: () => ActivityProgress,
18
+ ActivityStoreError: () => ActivityStoreError,
19
+ ActivityWorkConflict: () => ActivityWorkConflict,
20
+ PreparedActivity: () => PreparedActivity
21
+ });
22
+ const Identity = Schema.NonEmptyString.check(Schema.isMaxLength(256));
23
+ const Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
24
+ /** Application-owned processor identity. Changing the version starts independent progress. */
25
+ var ActivityProcessorKey = class extends Schema.Class("@effect-agent/thread/ActivityProcessorKey")({
26
+ processorId: Identity,
27
+ processorVersion: Identity,
28
+ threadId: ThreadId.check(Schema.isMaxLength(1024))
29
+ }) {};
30
+ /** Durable extraction output, pinned before any external application of that output. */
31
+ var PreparedActivity = class extends Schema.Class("@effect-agent/thread/PreparedActivity")({
32
+ version: Schema.Literal(1),
33
+ key: ActivityProcessorKey,
34
+ sequence: CanonicalSequence.check(Schema.isGreaterThan(0)),
35
+ workId: Digest,
36
+ recordId: RecordId,
37
+ output: PersistedJson
38
+ }) {};
39
+ /** Durable cursor and exact pending output; local authority is never stored here. */
40
+ var ActivityProgress = class extends Schema.Class("@effect-agent/thread/ActivityProgress")({
41
+ version: Schema.Literal(2),
42
+ key: ActivityProcessorKey,
43
+ throughSequence: CanonicalSequence,
44
+ pending: Schema.NullOr(PreparedActivity),
45
+ /** Time of the last cursor advance, not the activity time or a global freshness clock. */
46
+ advancedAt: Schema.NullOr(Timestamp)
47
+ }) {};
48
+ var ActivityStoreError = class extends Schema.TaggedError()("ActivityStoreError", {
49
+ operation: Schema.NonEmptyString,
50
+ reason: Schema.Literals([
51
+ "invalid-input",
52
+ "unavailable",
53
+ "corrupt",
54
+ "incompatible"
55
+ ])
56
+ }) {};
57
+ var ActivityBusy = class extends Schema.TaggedError()("ActivityBusy", { key: ActivityProcessorKey }) {};
58
+ var ActivityOwnershipLost = class extends Schema.TaggedError()("ActivityOwnershipLost", { key: ActivityProcessorKey }) {};
59
+ var ActivityWorkConflict = class extends Schema.TaggedError()("ActivityWorkConflict", {
60
+ key: ActivityProcessorKey,
61
+ workId: Digest
62
+ }) {};
63
+ const ActivityMutationPoint = Schema.Literals([
64
+ "activity:initialize:before",
65
+ "activity:initialize:after",
66
+ "activity:prepare:before",
67
+ "activity:prepare:after-state",
68
+ "activity:prepare:after",
69
+ "activity:advance:before",
70
+ "activity:advance:after-state",
71
+ "activity:advance:after"
72
+ ]);
73
+ var ActivityMutationFailure = class extends Schema.TaggedError()("ActivityMutationFailure", { point: ActivityMutationPoint }) {};
74
+ var ActivityMutationFailpoint = class extends Context.Service()("@effect-agent/thread/ActivityMutationFailpoint") {
75
+ static layer = Layer.succeed(this, { hit: () => Effect.void });
76
+ };
77
+ /**
78
+ * Optional durable progress for finite committed-activity passes. One process owns each
79
+ * processor/version/Thread key; all live facets over that storage share a local owner.
80
+ * acquire is scoped and read-only: elapsed time never grants another session. Closing the
81
+ * caller or store Scope rejects its late mutations without writing a release record.
82
+ *
83
+ * prepare pins one exact next output; advance requires that output's workId and atomically
84
+ * advances the cursor while clearing pending. Neither operation grants canonical Thread
85
+ * ownership. External application remains conditional/idempotent across lost acknowledgements.
86
+ */
87
+ var ActivityProcessorStore = class extends Context.Service()("@effect-agent/thread/ActivityProcessorStore") {};
88
+ export { ActivityOwnershipLost as a, ActivityProgress as c, ActivityWorkConflict as d, PreparedActivity as f, ActivityMutationPoint as i, ActivityStoreError as l, ActivityMutationFailpoint as n, ActivityProcessorKey as o, ActivityMutationFailure as r, ActivityProcessorStore as s, ActivityBusy as t, ActivityStore_exports as u };
89
+
90
+ //# sourceMappingURL=ActivityStore-CEy3oY41.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ActivityStore-CEy3oY41.mjs","names":[],"sources":["../src/durable/ActivityStore.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Layer from 'effect/Layer'\nimport * as Schema from 'effect/Schema'\nimport type * as Scope from 'effect/Scope'\n\nimport { ThreadId } from '../core/Identifiers'\nimport { CanonicalSequence, Digest, PersistedJson, RecordId } from './Records'\n\nconst Identity = Schema.NonEmptyString.check(Schema.isMaxLength(256))\nconst Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0))\n\n/** Application-owned processor identity. Changing the version starts independent progress. */\nexport class ActivityProcessorKey extends Schema.Class<ActivityProcessorKey>(\n '@effect-agent/thread/ActivityProcessorKey',\n)({\n processorId: Identity,\n processorVersion: Identity,\n threadId: ThreadId.check(Schema.isMaxLength(1_024)),\n}) {}\n\n/** Durable extraction output, pinned before any external application of that output. */\nexport class PreparedActivity extends Schema.Class<PreparedActivity>(\n '@effect-agent/thread/PreparedActivity',\n)({\n version: Schema.Literal(1),\n key: ActivityProcessorKey,\n sequence: CanonicalSequence.check(Schema.isGreaterThan(0)),\n workId: Digest,\n recordId: RecordId,\n output: PersistedJson,\n}) {}\n\n/** Durable cursor and exact pending output; local authority is never stored here. */\nexport class ActivityProgress extends Schema.Class<ActivityProgress>(\n '@effect-agent/thread/ActivityProgress',\n)({\n version: Schema.Literal(2),\n key: ActivityProcessorKey,\n throughSequence: CanonicalSequence,\n pending: Schema.NullOr(PreparedActivity),\n /** Time of the last cursor advance, not the activity time or a global freshness clock. */\n advancedAt: Schema.NullOr(Timestamp),\n}) {}\n\nexport class ActivityStoreError extends Schema.TaggedError<ActivityStoreError>()(\n 'ActivityStoreError',\n {\n operation: Schema.NonEmptyString,\n reason: Schema.Literals(['invalid-input', 'unavailable', 'corrupt', 'incompatible']),\n },\n) {}\n\nexport class ActivityBusy extends Schema.TaggedError<ActivityBusy>()('ActivityBusy', {\n key: ActivityProcessorKey,\n}) {}\n\nexport class ActivityOwnershipLost extends Schema.TaggedError<ActivityOwnershipLost>()(\n 'ActivityOwnershipLost',\n { key: ActivityProcessorKey },\n) {}\n\nexport class ActivityWorkConflict extends Schema.TaggedError<ActivityWorkConflict>()(\n 'ActivityWorkConflict',\n { key: ActivityProcessorKey, workId: Digest },\n) {}\n\nexport const ActivityMutationPoint = Schema.Literals([\n 'activity:initialize:before',\n 'activity:initialize:after',\n 'activity:prepare:before',\n 'activity:prepare:after-state',\n 'activity:prepare:after',\n 'activity:advance:before',\n 'activity:advance:after-state',\n 'activity:advance:after',\n])\n\nexport type ActivityMutationPoint = typeof ActivityMutationPoint.Type\n\nexport class ActivityMutationFailure extends Schema.TaggedError<ActivityMutationFailure>()(\n 'ActivityMutationFailure',\n { point: ActivityMutationPoint },\n) {}\n\nexport class ActivityMutationFailpoint extends Context.Service<\n ActivityMutationFailpoint,\n { readonly hit: (point: ActivityMutationPoint) => Effect.Effect<void, ActivityMutationFailure> }\n>()('@effect-agent/thread/ActivityMutationFailpoint') {\n static readonly layer = Layer.succeed(this, { hit: () => Effect.void })\n}\n\nexport type ActivityStoreFailure =\n | ActivityStoreError\n | ActivityBusy\n | ActivityOwnershipLost\n | ActivityWorkConflict\n | ActivityMutationFailure\n\n/** A local consumer capability. It cannot be encoded or restored from durable progress. */\nexport interface ActivitySession {\n /** Progress captured under the owner's gate at acquisition. */\n readonly progress: ActivityProgress\n readonly checkActive: Effect.Effect<void, ActivityOwnershipLost>\n readonly prepare: (\n work: PreparedActivity,\n ) => Effect.Effect<PreparedActivity, ActivityStoreFailure>\n readonly advance: (workId: Digest) => Effect.Effect<ActivityProgress, ActivityStoreFailure>\n}\n\n/**\n * Optional durable progress for finite committed-activity passes. One process owns each\n * processor/version/Thread key; all live facets over that storage share a local owner.\n * acquire is scoped and read-only: elapsed time never grants another session. Closing the\n * caller or store Scope rejects its late mutations without writing a release record.\n *\n * prepare pins one exact next output; advance requires that output's workId and atomically\n * advances the cursor while clearing pending. Neither operation grants canonical Thread\n * ownership. External application remains conditional/idempotent across lost acknowledgements.\n */\nexport class ActivityProcessorStore extends Context.Service<\n ActivityProcessorStore,\n {\n readonly inspect: (\n key: ActivityProcessorKey,\n ) => Effect.Effect<ActivityProgress | null, ActivityStoreError>\n readonly acquire: (\n key: ActivityProcessorKey,\n ) => Effect.Effect<ActivitySession, ActivityStoreFailure, Scope.Scope>\n }\n>()('@effect-agent/thread/ActivityProcessorStore') {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AASA,MAAM,WAAW,OAAO,eAAe,MAAM,OAAO,YAAY,GAAG,CAAC;AACpE,MAAM,YAAY,OAAO,OAAO,MAAM,OAAO,uBAAuB,CAAC,CAAC;;AAGtE,IAAa,uBAAb,cAA0C,OAAO,MAC/C,2CACF,CAAC,CAAC;CACA,aAAa;CACb,kBAAkB;CAClB,UAAU,SAAS,MAAM,OAAO,YAAY,IAAK,CAAC;AACpD,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,mBAAb,cAAsC,OAAO,MAC3C,uCACF,CAAC,CAAC;CACA,SAAS,OAAO,QAAQ,CAAC;CACzB,KAAK;CACL,UAAU,kBAAkB,MAAM,OAAO,cAAc,CAAC,CAAC;CACzD,QAAQ;CACR,UAAU;CACV,QAAQ;AACV,CAAC,CAAC,CAAC,CAAC;;AAGJ,IAAa,mBAAb,cAAsC,OAAO,MAC3C,uCACF,CAAC,CAAC;CACA,SAAS,OAAO,QAAQ,CAAC;CACzB,KAAK;CACL,iBAAiB;CACjB,SAAS,OAAO,OAAO,gBAAgB;;CAEvC,YAAY,OAAO,OAAO,SAAS;AACrC,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,WAAW,OAAO;CAClB,QAAQ,OAAO,SAAS;EAAC;EAAiB;EAAe;EAAW;CAAc,CAAC;AACrF,CACF,CAAC,CAAC,CAAC;AAEH,IAAa,eAAb,cAAkC,OAAO,YAA0B,CAAC,CAAC,gBAAgB,EACnF,KAAK,qBACP,CAAC,CAAC,CAAC,CAAC;AAEJ,IAAa,wBAAb,cAA2C,OAAO,YAAmC,CAAC,CACpF,yBACA,EAAE,KAAK,qBAAqB,CAC9B,CAAC,CAAC,CAAC;AAEH,IAAa,uBAAb,cAA0C,OAAO,YAAkC,CAAC,CAClF,wBACA;CAAE,KAAK;CAAsB,QAAQ;AAAO,CAC9C,CAAC,CAAC,CAAC;AAEH,MAAa,wBAAwB,OAAO,SAAS;CACnD;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAID,IAAa,0BAAb,cAA6C,OAAO,YAAqC,CAAC,CACxF,2BACA,EAAE,OAAO,sBAAsB,CACjC,CAAC,CAAC,CAAC;AAEH,IAAa,4BAAb,cAA+C,QAAQ,QAGrD,CAAC,CAAC,gDAAgD,CAAC,CAAC;CACpD,OAAgB,QAAQ,MAAM,QAAQ,MAAM,EAAE,WAAW,OAAO,KAAK,CAAC;AACxE;;;;;;;;;;;AA8BA,IAAa,yBAAb,cAA4C,QAAQ,QAUlD,CAAC,CAAC,6CAA6C,CAAC,CAAC,CAAC"}
@@ -0,0 +1,91 @@
1
+ import * as Context from "effect/Context";
2
+ import * as Effect from "effect/Effect";
3
+ import * as Layer from "effect/Layer";
4
+ import * as Schema from "effect/Schema";
5
+ import * as Scope from "effect/Scope";
6
+ import { S as Digest } from "./Records-C9I1nCL9.mjs";
7
+ declare namespace ActivityStore_d_exports {
8
+ export { ActivityBusy, ActivityMutationFailpoint, ActivityMutationFailure, ActivityMutationPoint, ActivityOwnershipLost, ActivityProcessorKey, ActivityProcessorStore, ActivityProgress, ActivitySession, ActivityStoreError, ActivityStoreFailure, ActivityWorkConflict, PreparedActivity };
9
+ }
10
+ declare const ActivityProcessorKey_base: Schema.Class<ActivityProcessorKey, Schema.Struct<{
11
+ readonly processorId: Schema.NonEmptyString;
12
+ readonly processorVersion: Schema.NonEmptyString;
13
+ readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
14
+ }>, {}>;
15
+ /** Application-owned processor identity. Changing the version starts independent progress. */
16
+ declare class ActivityProcessorKey extends ActivityProcessorKey_base {}
17
+ declare const PreparedActivity_base: Schema.Class<PreparedActivity, Schema.Struct<{
18
+ readonly version: Schema.Literal<1>;
19
+ readonly key: typeof ActivityProcessorKey;
20
+ readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
21
+ readonly workId: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
22
+ readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
23
+ readonly output: Schema.declare<Schema.Json, Schema.Json>;
24
+ }>, {}>;
25
+ /** Durable extraction output, pinned before any external application of that output. */
26
+ declare class PreparedActivity extends PreparedActivity_base {}
27
+ declare const ActivityProgress_base: Schema.Class<ActivityProgress, Schema.Struct<{
28
+ readonly version: Schema.Literal<2>;
29
+ readonly key: typeof ActivityProcessorKey;
30
+ readonly throughSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
31
+ readonly pending: Schema.NullOr<typeof PreparedActivity>;
32
+ /** Time of the last cursor advance, not the activity time or a global freshness clock. */
33
+ readonly advancedAt: Schema.NullOr<Schema.Finite>;
34
+ }>, {}>;
35
+ /** Durable cursor and exact pending output; local authority is never stored here. */
36
+ declare class ActivityProgress extends ActivityProgress_base {}
37
+ declare const ActivityStoreError_base: Schema.Class<ActivityStoreError, Schema.TaggedStruct<"ActivityStoreError", {
38
+ readonly operation: Schema.NonEmptyString;
39
+ readonly reason: Schema.Literals<readonly ["invalid-input", "unavailable", "corrupt", "incompatible"]>;
40
+ }>, import("effect/Cause").YieldableError>;
41
+ declare class ActivityStoreError extends ActivityStoreError_base {}
42
+ declare const ActivityBusy_base: Schema.Class<ActivityBusy, Schema.TaggedStruct<"ActivityBusy", {
43
+ readonly key: typeof ActivityProcessorKey;
44
+ }>, import("effect/Cause").YieldableError>;
45
+ declare class ActivityBusy extends ActivityBusy_base {}
46
+ declare const ActivityOwnershipLost_base: Schema.Class<ActivityOwnershipLost, Schema.TaggedStruct<"ActivityOwnershipLost", {
47
+ readonly key: typeof ActivityProcessorKey;
48
+ }>, import("effect/Cause").YieldableError>;
49
+ declare class ActivityOwnershipLost extends ActivityOwnershipLost_base {}
50
+ declare const ActivityWorkConflict_base: Schema.Class<ActivityWorkConflict, Schema.TaggedStruct<"ActivityWorkConflict", {
51
+ readonly key: typeof ActivityProcessorKey;
52
+ readonly workId: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
53
+ }>, import("effect/Cause").YieldableError>;
54
+ declare class ActivityWorkConflict extends ActivityWorkConflict_base {}
55
+ declare const ActivityMutationPoint: Schema.Literals<readonly ["activity:initialize:before", "activity:initialize:after", "activity:prepare:before", "activity:prepare:after-state", "activity:prepare:after", "activity:advance:before", "activity:advance:after-state", "activity:advance:after"]>;
56
+ type ActivityMutationPoint = typeof ActivityMutationPoint.Type;
57
+ declare const ActivityMutationFailure_base: Schema.Class<ActivityMutationFailure, Schema.TaggedStruct<"ActivityMutationFailure", {
58
+ readonly point: Schema.Literals<readonly ["activity:initialize:before", "activity:initialize:after", "activity:prepare:before", "activity:prepare:after-state", "activity:prepare:after", "activity:advance:before", "activity:advance:after-state", "activity:advance:after"]>;
59
+ }>, import("effect/Cause").YieldableError>;
60
+ declare class ActivityMutationFailure extends ActivityMutationFailure_base {}
61
+ declare const ActivityMutationFailpoint_base: Context.ServiceClass<ActivityMutationFailpoint, "@effect-agent/thread/ActivityMutationFailpoint", {
62
+ readonly hit: (point: ActivityMutationPoint) => Effect.Effect<void, ActivityMutationFailure>;
63
+ }>;
64
+ declare class ActivityMutationFailpoint extends ActivityMutationFailpoint_base {
65
+ static readonly layer: Layer.Layer<ActivityMutationFailpoint, never, never>;
66
+ }
67
+ type ActivityStoreFailure = ActivityStoreError | ActivityBusy | ActivityOwnershipLost | ActivityWorkConflict | ActivityMutationFailure;
68
+ /** A local consumer capability. It cannot be encoded or restored from durable progress. */
69
+ interface ActivitySession {
70
+ /** Progress captured under the owner's gate at acquisition. */
71
+ readonly progress: ActivityProgress;
72
+ readonly checkActive: Effect.Effect<void, ActivityOwnershipLost>;
73
+ readonly prepare: (work: PreparedActivity) => Effect.Effect<PreparedActivity, ActivityStoreFailure>;
74
+ readonly advance: (workId: Digest) => Effect.Effect<ActivityProgress, ActivityStoreFailure>;
75
+ }
76
+ declare const ActivityProcessorStore_base: Context.ServiceClass<ActivityProcessorStore, "@effect-agent/thread/ActivityProcessorStore", {
77
+ readonly inspect: (key: ActivityProcessorKey) => Effect.Effect<ActivityProgress | null, ActivityStoreError>;
78
+ readonly acquire: (key: ActivityProcessorKey) => Effect.Effect<ActivitySession, ActivityStoreFailure, Scope.Scope>;
79
+ }>;
80
+ /**
81
+ * Optional durable progress for finite committed-activity passes. One process owns each
82
+ * processor/version/Thread key; all live facets over that storage share a local owner.
83
+ * acquire is scoped and read-only: elapsed time never grants another session. Closing the
84
+ * caller or store Scope rejects its late mutations without writing a release record.
85
+ *
86
+ * prepare pins one exact next output; advance requires that output's workId and atomically
87
+ * advances the cursor while clearing pending. Neither operation grants canonical Thread
88
+ * ownership. External application remains conditional/idempotent across lost acknowledgements.
89
+ */
90
+ declare class ActivityProcessorStore extends ActivityProcessorStore_base {}
91
+ export { ActivityOwnershipLost as a, ActivityProgress as c, ActivityStoreFailure as d, ActivityStore_d_exports as f, ActivityMutationPoint as i, ActivitySession as l, PreparedActivity as m, ActivityMutationFailpoint as n, ActivityProcessorKey as o, ActivityWorkConflict as p, ActivityMutationFailure as r, ActivityProcessorStore as s, ActivityBusy as t, ActivityStoreError as u };
@@ -0,0 +1,329 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
2
+ import * as DateTime from "effect/DateTime";
3
+ import * as Effect from "effect/Effect";
4
+ import * as Schema from "effect/Schema";
5
+ import { d as ToolCallId, l as SubmissionId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
6
+ import { i as QueueSequence } from "./Receipt-B-FlCaNH.mjs";
7
+ import { Tt as ToolCallUnknown, dt as SettlementOutcome, f as CanonicalSequence, g as DeclaredToolCall } from "./Records-C645aQks.mjs";
8
+ import { S as RecoveryDecision, b as PendingApprovalEvidence, v as OpenDelegationCallEvidence, y as OpenToolCallEvidence } from "./Recovery-zWy_kmZq.mjs";
9
+ import { F as JoinSnapshot, W as ParentLinkage, b as ChildAttachmentSnapshot, bt as UnknownResolutionIntent, dt as SubmissionState, g as ApprovalDecisionIntent, gt as SuspensionSnapshot, n as AbortIntent, t as AbortCommand } from "./SubmissionLedger-WG0beEyt.mjs";
10
+ // src/durable/Admin.ts
11
+ var Admin_exports = /* @__PURE__ */ __exportAll({
12
+ ExplainedEvidence: () => ExplainedEvidence,
13
+ ExplainedSubmission: () => ExplainedSubmission,
14
+ ExplainedUnknownCall: () => ExplainedUnknownCall,
15
+ IntegrityCheck: () => IntegrityCheck,
16
+ IntegrityCheckName: () => IntegrityCheckName,
17
+ IntegrityCheckStatus: () => IntegrityCheckStatus,
18
+ IntegrityReport: () => IntegrityReport,
19
+ ObligationBlockedOn: () => ObligationBlockedOn,
20
+ ObligationEntry: () => ObligationEntry,
21
+ ObligationReport: () => ObligationReport,
22
+ ObligationSeverity: () => ObligationSeverity,
23
+ ObligationThresholds: () => ObligationThresholds,
24
+ RECOVERY_DECISION_MEANINGS: () => RECOVERY_DECISION_MEANINGS,
25
+ RecoveryDisposition: () => RecoveryDisposition,
26
+ RecoveryExplanation: () => RecoveryExplanation,
27
+ RetryCommand: () => RetryCommand,
28
+ RetryRefusalReason: () => RetryRefusalReason,
29
+ RetryRefused: () => RetryRefused,
30
+ obligationSeverityOf: () => obligationSeverityOf,
31
+ predictRecoveryDisposition: () => predictRecoveryDisposition,
32
+ recoveryDecisionMeaning: () => recoveryDecisionMeaning,
33
+ renderRecoveryExplanation: () => renderRecoveryExplanation
34
+ });
35
+ /**
36
+ * Pure report logic for the P7 administrative operations (plan §3): the Schema classes carried
37
+ * by `DurableAgentRuntime.explain`/`verify`/`scanObligations`, the operator meaning table for
38
+ * every recovery decision tag, and the text renderer. Everything here is pure — no port access,
39
+ * no clocks, no writes — so hosts, CLIs, and wire envelopes share one report vocabulary.
40
+ */
41
+ const BoundedDetail = Schema.String.check(Schema.isMaxLength(4096));
42
+ /** Non-negative whole seconds derived from the Effect Clock. */
43
+ const AgeSeconds = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
44
+ /**
45
+ * The disposition family of `RecoveryReport`, reused verbatim so an explanation predicts exactly
46
+ * what `runRecovery`/`retry` would report for the same decision.
47
+ */
48
+ const RecoveryDisposition = Schema.Literals([
49
+ "repaired",
50
+ "deferred",
51
+ "none",
52
+ "unknown"
53
+ ]);
54
+ /** Submission identity, lane position, and Clock-derived ages (DUR-017 obligation visibility). */
55
+ var ExplainedSubmission = class extends Schema.Class("@effect-agent/thread/ExplainedSubmission")({
56
+ submissionId: SubmissionId,
57
+ threadId: ThreadId,
58
+ state: SubmissionState,
59
+ queueSequence: QueueSequence,
60
+ createdAt: Schema.DateTimeUtcFromString,
61
+ readyAt: Schema.optionalKey(Schema.DateTimeUtcFromString),
62
+ /** Whole seconds since admission (`createdAt`). */
63
+ ageSeconds: AgeSeconds,
64
+ /** Whole seconds since readiness, present exactly when `readyAt` is recorded. */
65
+ readyAgeSeconds: Schema.optionalKey(AgeSeconds),
66
+ parentLinkage: Schema.optionalKey(ParentLinkage)
67
+ }) {};
68
+ /** One durable Unknown Outcome and whether its result is canonical (DUR-017). */
69
+ var ExplainedUnknownCall = class extends Schema.Class("@effect-agent/thread/ExplainedUnknownCall")({
70
+ toolCallId: ToolCallId,
71
+ toolName: ToolCallUnknown.fields.toolName,
72
+ reason: ToolCallUnknown.fields.reason,
73
+ recordedAt: Schema.DateTimeUtcFromString,
74
+ /** A real canonical ToolCallSettled closes this call; an intent alone is not an outcome. */
75
+ resolved: Schema.Boolean
76
+ }) {};
77
+ /**
78
+ * The evidence summary of one explanation: the classifier's canonical-history inputs plus the
79
+ * durable intents and subagent attachments the ledger snapshot carries. Everything is read-only
80
+ * observation — assembling this value performs zero writes.
81
+ */
82
+ var ExplainedEvidence = class extends Schema.Class("@effect-agent/thread/ExplainedEvidence")({
83
+ threadMaterialized: Schema.Boolean,
84
+ inputRecorded: Schema.Boolean,
85
+ abortRecorded: Schema.Boolean,
86
+ recordedSettlementOutcome: Schema.optionalKey(SettlementOutcome),
87
+ /** Declared ordinary Tool Calls without a canonical outcome (DUR-009). */
88
+ openToolCalls: Schema.Array(OpenToolCallEvidence),
89
+ /** Original declared operation identities, arguments and recovery contracts; settled calls are excluded. */
90
+ pendingOperations: Schema.Array(DeclaredToolCall).pipe(Schema.withConstructorDefault(Effect.succeed([]))),
91
+ /** Delegation Tool Calls with an open parent-side obligation. */
92
+ openDelegationCalls: Schema.Array(OpenDelegationCallEvidence),
93
+ /** Canonically requested approvals without a canonical decision. */
94
+ approvalsPending: Schema.Array(PendingApprovalEvidence),
95
+ /** Durable Unknown Outcomes with their resolution coverage (DUR-017). */
96
+ unknownCalls: Schema.Array(ExplainedUnknownCall),
97
+ /** Durable approval decisions recorded against this Submission. */
98
+ approvalDecisions: Schema.Array(ApprovalDecisionIntent),
99
+ /** Durable unknown-outcome resolutions recorded against this Submission. */
100
+ unknownResolutions: Schema.Array(UnknownResolutionIntent),
101
+ /** Parent-side child attachments. */
102
+ childAttachments: Schema.Array(ChildAttachmentSnapshot),
103
+ /** Host-side joined/joining members of this Submission's Run (DUR-016). */
104
+ joins: Schema.Array(JoinSnapshot),
105
+ /** Joined-side host identity, when this Submission is joined to a host Run. */
106
+ hostSubmissionId: Schema.optionalKey(SubmissionId),
107
+ suspension: Schema.optionalKey(SuspensionSnapshot),
108
+ abortIntent: Schema.optionalKey(AbortIntent)
109
+ }) {};
110
+ /**
111
+ * The read-only recovery explanation of one Submission (P7 exit gate "operators can explain
112
+ * recovery state without editing storage"): the submission summary, the evidence the pure
113
+ * classifier consumed, the exact `RecoveryDecision` it selected, that decision's operator
114
+ * meaning, and the disposition the recovery pass would report for it.
115
+ */
116
+ var RecoveryExplanation = class extends Schema.Class("@effect-agent/thread/RecoveryExplanation")({
117
+ submission: ExplainedSubmission,
118
+ evidence: ExplainedEvidence,
119
+ decision: RecoveryDecision,
120
+ /** Static operator meaning of `decision._tag` (see `RECOVERY_DECISION_MEANINGS`). */
121
+ decisionMeaning: BoundedDetail,
122
+ /**
123
+ * The disposition `runRecovery` would report when this decision executes without claim
124
+ * contention (see `predictRecoveryDisposition`): `repaired` = the recovery pass itself fixes
125
+ * it; `deferred` = a claiming worker must finish it; `unknown` = durably blocked on the
126
+ * authorized DUR-017 resolution path; `none` = settled, nothing owed.
127
+ */
128
+ disposition: RecoveryDisposition,
129
+ explainedAt: Schema.DateTimeUtcFromString
130
+ }) {};
131
+ /**
132
+ * Operator meaning of every recovery decision tag, matching the classifier docstrings in
133
+ * `recovery.ts` (the classifier remains the semantic authority; this table is its operator
134
+ * rendering). Exhaustive over `RecoveryDecision` — adding a decision without a meaning is a
135
+ * compile error here.
136
+ */
137
+ const RECOVERY_DECISION_MEANINGS = {
138
+ CompleteMaterialization: "Ledger admission committed but the Thread is not durable: recovery finishes materialization, appends ThreadCreated, and marks readiness.",
139
+ RepairReadiness: "The Thread is durable but the readiness marker is missing: recovery replays the idempotent markReady.",
140
+ ApplyInput: "No canonical input record exists yet: recovery appends the deterministic UserInputRecorded record and marks it applied.",
141
+ RepairInputMarker: "The canonical input record exists but the ledger marker was lost: recovery repairs the marker from history, never the reverse (DUR-015).",
142
+ ResumeFromTurnBoundary: "Input is applied and no terminal outcome is canonical: a claiming worker resumes the Run from the last committed Turn boundary; the model may be re-invoked and any duplicate cost is observable (durability §9).",
143
+ FinalizeLedgerFromHistory: "The canonical settlement record exists: recovery rebuilds/finalizes the ledger from history and never rewrites history from the cached ledger status (DUR-011, DUR-015).",
144
+ SettleAborted: "A durable abort intent exists with no canonical terminal outcome and no open attached-child obligation: recovery settles aborted, first recording ToolCallUnknown audits for open ordinary calls — abort never asserts external rollback (durability §13).",
145
+ MarkUnknown: "Declared ordinary Tool Calls have no canonical outcome: recovery reconciles each open call and marks the remainder Unknown — never an automatic replay (DUR-009/DUR-017).",
146
+ ResumePendingToolBatch: "A committed tool-declaring response has unfinished calls whose original operation contracts permit replay: a claiming worker resumes those calls without model re-invocation; unresolved ordinary mutating calls require reconciliation.",
147
+ AwaitApprovalDecision: "Canonically requested approvals lack decisions: the lane waits durably for the authorized resolveApproval path (recovery repairs a lost suspend transition from history).",
148
+ ResumeSuspended: "Every pending approval has a durable decision: a claiming worker resumes the declared batch, appending the canonical ToolApprovalDecided records first.",
149
+ AwaitUnknownResolution: "Unknown Outcomes lack covering resolutions: this Submission stays parked awaiting the authorized DUR-017 resolveUnknown path; later eligible input may run, and the original obligation stays visible.",
150
+ ApplyUnknownResolutions: "Durable resolution intents cover every open call: recovery wakes the original Submission when required retry contracts are supported; its next claim applies canonical outcomes.",
151
+ RevertJoining: "The Submission is joining without a canonical input record: recovery reverts it to ready — the input was never consumed and will be delivered exactly once later (DUR-016).",
152
+ RepairJoinMarker: "The canonical joined input exists but the joined marker was lost: recovery repairs the marker only; the input reattaches, never duplicates (DUR-015/DUR-016).",
153
+ SettleJoinedWithHost: "The host Run settled canonically: recovery settles this joined Submission with the host outcome — each joined Submission is owed its own settlement (DUR-002).",
154
+ AwaitHostSettlement: "The Submission is joined and its host Run is still live: nothing to repair — the input reattaches through the host's resume and the Submission settles with the host.",
155
+ CompleteChildAdmission: "A canonical SubagentRequested exists and the authoritative lookup proved not-admitted: recovery idempotently admits the intended child from the canonical request payload alone.",
156
+ AwaitChildAdmissionResolution: "The authoritative child-admission lookup answered indeterminate (or was not performed): recovery waits and retries the authoritative owner; a second admission never occurs (SUB-031).",
157
+ RepairSubagentStartLink: "The child is admitted but the parent's SubagentStarted link (or reservation attachment) is missing: recovery resolves the SAME child by its deterministic key and appends the exact link (SUB-016/SUB-017).",
158
+ EnsureWaitingForChild: "Children are established and at least one is nonterminal while the parent lane is not durably suspended: recovery restores the waitingForChild suspension; it reattaches the one existing child and never spawns a replacement (SUB-018/SUB-030).",
159
+ AwaitChildSettlement: "The parent is durably suspended waitingForChild and a listed child is not yet provably settled: the lane stays dormant, consumes no worker permit, and the child's Settlement wakes it durably (SUB-021/SUB-030).",
160
+ ResumeWaitingParent: "Every relevant child is provably settled but the parent has not joined: recovery replays the idempotent wake so a claiming worker resumes the declared batch and joins each child's canonical Settlement.",
161
+ ApplyJoinAccounting: "The canonical SubagentJoined record exists but the reservation release is incomplete: recovery replays the accounting decision FROM the canonical record — budget stays unavailable until repair, never available twice (DUR-015).",
162
+ PropagateChildAbort: "Parent abort is canonical while attached children are nonterminal: recovery idempotently issues each child's durable abort command and keeps the parent waiting for the joins — request-abort-and-join is the only close behavior.",
163
+ ReleaseOrphanChildReservation: "A child budget reservation can no longer bind a child: recovery freezes the deterministic zero-consumed accounting decision and releases the unused allocation exactly once.",
164
+ AwaitParentEstablishment: "The Submission is a parent-linked child whose Thread lacks the canonical lineage record: the child lane defers its own readiness repair — the parent's idempotent establishment completes it, so a child never runs a Turn before its lineage is canonical (P7 §7(a), SUB-016).",
165
+ NoAction: "The Submission is settled; nothing is owed."
166
+ };
167
+ /** The operator meaning of one recovery decision tag. */
168
+ const recoveryDecisionMeaning = (tag) => RECOVERY_DECISION_MEANINGS[tag];
169
+ /**
170
+ * The disposition the recovery executor reports for a decision when its repair executes without
171
+ * claim contention (pure prediction; `executeRecoveryDecision` in the coordinator remains the
172
+ * execution authority — a lane concurrently claimed by a worker can always defer instead).
173
+ * `AwaitApprovalDecision` depends on the snapshot: an already-suspended lane waits (`deferred`),
174
+ * while a claimable lane with a lost suspend transition is repaired.
175
+ */
176
+ const predictRecoveryDisposition = (decision, snapshot) => {
177
+ switch (decision._tag) {
178
+ case "NoAction": return "none";
179
+ case "AwaitUnknownResolution":
180
+ case "MarkUnknown": return "unknown";
181
+ case "ResumeFromTurnBoundary":
182
+ case "ResumePendingToolBatch":
183
+ case "ResumeSuspended":
184
+ case "AwaitHostSettlement":
185
+ case "AwaitChildAdmissionResolution":
186
+ case "AwaitChildSettlement":
187
+ case "AwaitParentEstablishment": return "deferred";
188
+ case "AwaitApprovalDecision": return snapshot.submission.state === "suspended" ? "deferred" : "repaired";
189
+ default: return "repaired";
190
+ }
191
+ };
192
+ const formatUtc = (value) => DateTime.formatIso(value);
193
+ /** Pure operator text for one explanation (the CLI's `explain` output body). */
194
+ const renderRecoveryExplanation = (explanation) => {
195
+ const submission = explanation.submission;
196
+ const evidence = explanation.evidence;
197
+ const lines = [
198
+ `Submission ${submission.submissionId} (thread ${submission.threadId})`,
199
+ ` state: ${submission.state} queue: ${submission.queueSequence} age: ${submission.ageSeconds}s`,
200
+ ` admitted: ${formatUtc(submission.createdAt)}${submission.readyAt === void 0 ? "" : ` ready: ${formatUtc(submission.readyAt)}`}`
201
+ ];
202
+ if (submission.parentLinkage !== void 0) lines.push(` attached child of ${submission.parentLinkage.parentSubmissionId} (tool call ${submission.parentLinkage.parentToolCallId})`);
203
+ lines.push(` evidence: input=${evidence.inputRecorded ? "recorded" : "missing"} settlement=${evidence.recordedSettlementOutcome ?? "none"} abort=${evidence.abortRecorded ? "recorded" : "none"} materialized=${evidence.threadMaterialized ? "yes" : "no"}`);
204
+ if (evidence.openToolCalls.length > 0) lines.push(` open ordinary tool calls: ${evidence.openToolCalls.map((call) => `${call.toolName}#${call.toolCallId}`).join(", ")}`);
205
+ if (evidence.openDelegationCalls.length > 0) lines.push(` open delegation calls: ${evidence.openDelegationCalls.map((call) => `${call.toolName}#${call.toolCallId}(requested=${call.requested} started=${call.started} joined=${call.joined})`).join(", ")}`);
206
+ if (evidence.approvalsPending.length > 0) lines.push(` approvals pending: ${evidence.approvalsPending.map((pending) => pending.toolCallId).join(", ")}`);
207
+ for (const unknown of evidence.unknownCalls) lines.push(` unknown outcome: ${unknown.toolName}#${unknown.toolCallId} recorded ${formatUtc(unknown.recordedAt)} ${unknown.resolved ? "(resolution intent recorded)" : "(awaiting resolveUnknown)"}`);
208
+ if (evidence.childAttachments.length > 0) lines.push(` attached children: ${evidence.childAttachments.map((child) => `${child.childSubmissionId}(${child.childState})`).join(", ")}`);
209
+ if (evidence.joins.length > 0) lines.push(` joined members: ${evidence.joins.map((join) => `${join.submissionId}(${join.state})`).join(", ")}`);
210
+ if (evidence.hostSubmissionId !== void 0) lines.push(` joined to host: ${evidence.hostSubmissionId}`);
211
+ if (evidence.suspension !== void 0) lines.push(` suspended (${evidence.suspension.reason._tag}) since ${formatUtc(evidence.suspension.suspendedAt)}`);
212
+ if (evidence.abortIntent !== void 0) lines.push(` abort intent by ${evidence.abortIntent.author} at ${formatUtc(evidence.abortIntent.requestedAt)}`);
213
+ lines.push(` decision: ${explanation.decision._tag} → disposition ${explanation.disposition}`, ` meaning: ${explanation.decisionMeaning}`);
214
+ return lines.join("\n");
215
+ };
216
+ /** The named integrity checks `verifyThreadInvariants` performs. */
217
+ const IntegrityCheckName = Schema.Literals([
218
+ "schema-round-trip",
219
+ "record-identity",
220
+ "sequence-contiguity",
221
+ "continuation-evidence",
222
+ "fifo-input-order",
223
+ "input-before-settlement",
224
+ "terminal-uniqueness",
225
+ "ledger-canonical-agreement",
226
+ "all-settled"
227
+ ]);
228
+ const IntegrityCheckStatus = Schema.Literals([
229
+ "passed",
230
+ "failed",
231
+ "skipped"
232
+ ]);
233
+ /** One typed check result; `detail` explains a failure or the honest reason for a skip. */
234
+ var IntegrityCheck = class extends Schema.Class("@effect-agent/thread/IntegrityCheck")({
235
+ name: IntegrityCheckName,
236
+ status: IntegrityCheckStatus,
237
+ detail: Schema.optionalKey(BoundedDetail)
238
+ }) {};
239
+ /**
240
+ * The read-only integrity verdict for one Thread (plan §3 `verify`): typed per-check
241
+ * results, never a repair. `ok` is true exactly when no check failed — skipped checks are
242
+ * honest scope statements, not silent passes.
243
+ */
244
+ var IntegrityReport = class extends Schema.Class("@effect-agent/thread/IntegrityReport")({
245
+ threadId: ThreadId,
246
+ tailSequence: CanonicalSequence,
247
+ recordCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
248
+ submissionCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
249
+ checks: Schema.Array(IntegrityCheck),
250
+ ok: Schema.Boolean
251
+ }) {};
252
+ /**
253
+ * What one nonterminal Submission is visibly blocked on (DUR-017 operator surface; OPS-001).
254
+ * `ready-aged`/`running-aged` are not blocks — they are accepted work whose settlement age is
255
+ * measurable and alertable.
256
+ */
257
+ const ObligationBlockedOn = Schema.Literals([
258
+ "unknown",
259
+ "approval",
260
+ "waitingForChild",
261
+ "ready-aged",
262
+ "running-aged"
263
+ ]);
264
+ const ObligationSeverity = Schema.Literals([
265
+ "ok",
266
+ "aging",
267
+ "overdue"
268
+ ]);
269
+ /** Host-supplied age thresholds; the framework deliberately does not own the alert loop. */
270
+ var ObligationThresholds = class extends Schema.Class("@effect-agent/thread/ObligationThresholds")({
271
+ /** Age (whole seconds) at which an obligation is reported `aging`. */
272
+ agingSeconds: AgeSeconds,
273
+ /** Age (whole seconds) at which an obligation is reported `overdue`. */
274
+ overdueSeconds: AgeSeconds
275
+ }) {};
276
+ /** One nonterminal accepted-work obligation with its age and severity. */
277
+ var ObligationEntry = class extends Schema.Class("@effect-agent/thread/ObligationEntry")({
278
+ submissionId: SubmissionId,
279
+ threadId: ThreadId,
280
+ state: SubmissionState,
281
+ blockedOn: ObligationBlockedOn,
282
+ ageSeconds: AgeSeconds,
283
+ severity: ObligationSeverity
284
+ }) {};
285
+ /**
286
+ * The scan-based DUR-017/OPS-001 operator surface (plan §3): a fold of the ledger's nonterminal
287
+ * scan into aged, severity-classified rows. Scan-based, never a daemon — hosts run it
288
+ * periodically and export logs/metrics; ages need no storage-version bump because every source
289
+ * timestamp already exists (`createdAt`/`readyAt`, `suspendedAt`, the canonical
290
+ * `ToolCallUnknown` record's `createdAt`).
291
+ */
292
+ var ObligationReport = class extends Schema.Class("@effect-agent/thread/ObligationReport")({
293
+ thresholds: ObligationThresholds,
294
+ entries: Schema.Array(ObligationEntry),
295
+ generatedAt: Schema.DateTimeUtcFromString
296
+ }) {};
297
+ /** Severity of one obligation age under the supplied thresholds. */
298
+ const obligationSeverityOf = (ageSeconds, thresholds) => ageSeconds >= thresholds.overdueSeconds ? "overdue" : ageSeconds >= thresholds.agingSeconds ? "aging" : "ok";
299
+ /**
300
+ * The mandatory-audit retry command (SEC-011): `author`/`reason` carry the same bounds as the
301
+ * canonical abort command so every mutating administrative operation stays attributable. The
302
+ * operator and decision are logged. A repair with a claim also appends a best-effort
303
+ * `RepairAnnotated` attempt using that claim's epoch; state-only repairs do not append audits.
304
+ */
305
+ var RetryCommand = class extends Schema.Class("@effect-agent/thread/RetryCommand")({
306
+ submissionId: SubmissionId,
307
+ author: AbortCommand.fields.author,
308
+ reason: AbortCommand.fields.reason
309
+ }) {};
310
+ /** Why a retry was refused without executing anything. */
311
+ const RetryRefusalReason = Schema.Literals([
312
+ "settled",
313
+ "await-unknown-resolution",
314
+ "await-approval-decision"
315
+ ]);
316
+ /**
317
+ * Typed refusal of `retry` (plan §3): Submissions waiting on `AwaitUnknownResolution` or
318
+ * `AwaitApprovalDecision` have their own authorized operations, and settled work is never
319
+ * re-driven. The refusal names the classifier decision so the operator sees WHY.
320
+ */
321
+ var RetryRefused = class extends Schema.TaggedError()("RetryRefused", {
322
+ submissionId: SubmissionId,
323
+ refusal: RetryRefusalReason,
324
+ decisionTag: Schema.String.check(Schema.isMaxLength(256)),
325
+ message: Schema.String.check(Schema.isMaxLength(4096))
326
+ }) {};
327
+ export { renderRecoveryExplanation as C, recoveryDecisionMeaning as S, RetryCommand as _, IntegrityCheck as a, obligationSeverityOf as b, IntegrityReport as c, ObligationReport as d, ObligationSeverity as f, RecoveryExplanation as g, RecoveryDisposition as h, ExplainedUnknownCall as i, ObligationBlockedOn as l, RECOVERY_DECISION_MEANINGS as m, ExplainedEvidence as n, IntegrityCheckName as o, ObligationThresholds as p, ExplainedSubmission as r, IntegrityCheckStatus as s, Admin_exports as t, ObligationEntry as u, RetryRefusalReason as v, predictRecoveryDisposition as x, RetryRefused as y };
328
+
329
+ //# sourceMappingURL=Admin-BcQDrWKY.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Admin-BcQDrWKY.mjs","names":[],"sources":["../src/durable/Admin.ts"],"sourcesContent":["import * as DateTime from 'effect/DateTime'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport { SubmissionId, ThreadId, ToolCallId } from '../core/Identifiers'\nimport { CanonicalSequence, DeclaredToolCall, SettlementOutcome, ToolCallUnknown } from './Records'\nimport { OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, RecoveryDecision } from './Recovery'\nimport {\n AbortCommand,\n AbortIntent,\n ApprovalDecisionIntent,\n ChildAttachmentSnapshot,\n JoinSnapshot,\n ParentLinkage,\n QueueSequence,\n type RecoverySnapshot,\n SubmissionState,\n SuspensionSnapshot,\n UnknownResolutionIntent,\n} from './SubmissionLedger'\n\n/**\n * Pure report logic for the P7 administrative operations (plan §3): the Schema classes carried\n * by `DurableAgentRuntime.explain`/`verify`/`scanObligations`, the operator meaning table for\n * every recovery decision tag, and the text renderer. Everything here is pure — no port access,\n * no clocks, no writes — so hosts, CLIs, and wire envelopes share one report vocabulary.\n */\n\nconst BoundedDetail = Schema.String.check(Schema.isMaxLength(4_096))\n\n/** Non-negative whole seconds derived from the Effect Clock. */\nconst AgeSeconds = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\n\n// ---------------------------------------------------------------------------\n// explain — RecoveryExplanation\n// ---------------------------------------------------------------------------\n\n/**\n * The disposition family of `RecoveryReport`, reused verbatim so an explanation predicts exactly\n * what `runRecovery`/`retry` would report for the same decision.\n */\nexport const RecoveryDisposition = Schema.Literals(['repaired', 'deferred', 'none', 'unknown'])\nexport type RecoveryDisposition = typeof RecoveryDisposition.Type\n\n/** Submission identity, lane position, and Clock-derived ages (DUR-017 obligation visibility). */\nexport class ExplainedSubmission extends Schema.Class<ExplainedSubmission>(\n '@effect-agent/thread/ExplainedSubmission',\n)({\n submissionId: SubmissionId,\n threadId: ThreadId,\n state: SubmissionState,\n queueSequence: QueueSequence,\n createdAt: Schema.DateTimeUtcFromString,\n readyAt: Schema.optionalKey(Schema.DateTimeUtcFromString),\n /** Whole seconds since admission (`createdAt`). */\n ageSeconds: AgeSeconds,\n /** Whole seconds since readiness, present exactly when `readyAt` is recorded. */\n readyAgeSeconds: Schema.optionalKey(AgeSeconds),\n parentLinkage: Schema.optionalKey(ParentLinkage),\n}) {}\n\n/** One durable Unknown Outcome and whether its result is canonical (DUR-017). */\nexport class ExplainedUnknownCall extends Schema.Class<ExplainedUnknownCall>(\n '@effect-agent/thread/ExplainedUnknownCall',\n)({\n toolCallId: ToolCallId,\n toolName: ToolCallUnknown.fields.toolName,\n reason: ToolCallUnknown.fields.reason,\n recordedAt: Schema.DateTimeUtcFromString,\n /** A real canonical ToolCallSettled closes this call; an intent alone is not an outcome. */\n resolved: Schema.Boolean,\n}) {}\n\n/**\n * The evidence summary of one explanation: the classifier's canonical-history inputs plus the\n * durable intents and subagent attachments the ledger snapshot carries. Everything is read-only\n * observation — assembling this value performs zero writes.\n */\nexport class ExplainedEvidence extends Schema.Class<ExplainedEvidence>(\n '@effect-agent/thread/ExplainedEvidence',\n)({\n threadMaterialized: Schema.Boolean,\n inputRecorded: Schema.Boolean,\n abortRecorded: Schema.Boolean,\n recordedSettlementOutcome: Schema.optionalKey(SettlementOutcome),\n /** Declared ordinary Tool Calls without a canonical outcome (DUR-009). */\n openToolCalls: Schema.Array(OpenToolCallEvidence),\n /** Original declared operation identities, arguments and recovery contracts; settled calls are excluded. */\n pendingOperations: Schema.Array(DeclaredToolCall).pipe(\n Schema.withConstructorDefault(Effect.succeed([])),\n ),\n /** Delegation Tool Calls with an open parent-side obligation. */\n openDelegationCalls: Schema.Array(OpenDelegationCallEvidence),\n /** Canonically requested approvals without a canonical decision. */\n approvalsPending: Schema.Array(PendingApprovalEvidence),\n /** Durable Unknown Outcomes with their resolution coverage (DUR-017). */\n unknownCalls: Schema.Array(ExplainedUnknownCall),\n /** Durable approval decisions recorded against this Submission. */\n approvalDecisions: Schema.Array(ApprovalDecisionIntent),\n /** Durable unknown-outcome resolutions recorded against this Submission. */\n unknownResolutions: Schema.Array(UnknownResolutionIntent),\n /** Parent-side child attachments. */\n childAttachments: Schema.Array(ChildAttachmentSnapshot),\n /** Host-side joined/joining members of this Submission's Run (DUR-016). */\n joins: Schema.Array(JoinSnapshot),\n /** Joined-side host identity, when this Submission is joined to a host Run. */\n hostSubmissionId: Schema.optionalKey(SubmissionId),\n suspension: Schema.optionalKey(SuspensionSnapshot),\n abortIntent: Schema.optionalKey(AbortIntent),\n}) {}\n\n/**\n * The read-only recovery explanation of one Submission (P7 exit gate \"operators can explain\n * recovery state without editing storage\"): the submission summary, the evidence the pure\n * classifier consumed, the exact `RecoveryDecision` it selected, that decision's operator\n * meaning, and the disposition the recovery pass would report for it.\n */\nexport class RecoveryExplanation extends Schema.Class<RecoveryExplanation>(\n '@effect-agent/thread/RecoveryExplanation',\n)({\n submission: ExplainedSubmission,\n evidence: ExplainedEvidence,\n decision: RecoveryDecision,\n /** Static operator meaning of `decision._tag` (see `RECOVERY_DECISION_MEANINGS`). */\n decisionMeaning: BoundedDetail,\n /**\n * The disposition `runRecovery` would report when this decision executes without claim\n * contention (see `predictRecoveryDisposition`): `repaired` = the recovery pass itself fixes\n * it; `deferred` = a claiming worker must finish it; `unknown` = durably blocked on the\n * authorized DUR-017 resolution path; `none` = settled, nothing owed.\n */\n disposition: RecoveryDisposition,\n explainedAt: Schema.DateTimeUtcFromString,\n}) {}\n\n/**\n * Operator meaning of every recovery decision tag, matching the classifier docstrings in\n * `recovery.ts` (the classifier remains the semantic authority; this table is its operator\n * rendering). Exhaustive over `RecoveryDecision` — adding a decision without a meaning is a\n * compile error here.\n */\nexport const RECOVERY_DECISION_MEANINGS: Readonly<Record<RecoveryDecision['_tag'], string>> = {\n CompleteMaterialization:\n 'Ledger admission committed but the Thread is not durable: recovery finishes materialization, appends ThreadCreated, and marks readiness.',\n RepairReadiness:\n 'The Thread is durable but the readiness marker is missing: recovery replays the idempotent markReady.',\n ApplyInput:\n 'No canonical input record exists yet: recovery appends the deterministic UserInputRecorded record and marks it applied.',\n RepairInputMarker:\n 'The canonical input record exists but the ledger marker was lost: recovery repairs the marker from history, never the reverse (DUR-015).',\n ResumeFromTurnBoundary:\n 'Input is applied and no terminal outcome is canonical: a claiming worker resumes the Run from the last committed Turn boundary; the model may be re-invoked and any duplicate cost is observable (durability §9).',\n FinalizeLedgerFromHistory:\n 'The canonical settlement record exists: recovery rebuilds/finalizes the ledger from history and never rewrites history from the cached ledger status (DUR-011, DUR-015).',\n SettleAborted:\n 'A durable abort intent exists with no canonical terminal outcome and no open attached-child obligation: recovery settles aborted, first recording ToolCallUnknown audits for open ordinary calls — abort never asserts external rollback (durability §13).',\n MarkUnknown:\n 'Declared ordinary Tool Calls have no canonical outcome: recovery reconciles each open call and marks the remainder Unknown — never an automatic replay (DUR-009/DUR-017).',\n ResumePendingToolBatch:\n 'A committed tool-declaring response has unfinished calls whose original operation contracts permit replay: a claiming worker resumes those calls without model re-invocation; unresolved ordinary mutating calls require reconciliation.',\n AwaitApprovalDecision:\n 'Canonically requested approvals lack decisions: the lane waits durably for the authorized resolveApproval path (recovery repairs a lost suspend transition from history).',\n ResumeSuspended:\n 'Every pending approval has a durable decision: a claiming worker resumes the declared batch, appending the canonical ToolApprovalDecided records first.',\n AwaitUnknownResolution:\n 'Unknown Outcomes lack covering resolutions: this Submission stays parked awaiting the authorized DUR-017 resolveUnknown path; later eligible input may run, and the original obligation stays visible.',\n ApplyUnknownResolutions:\n 'Durable resolution intents cover every open call: recovery wakes the original Submission when required retry contracts are supported; its next claim applies canonical outcomes.',\n RevertJoining:\n 'The Submission is joining without a canonical input record: recovery reverts it to ready — the input was never consumed and will be delivered exactly once later (DUR-016).',\n RepairJoinMarker:\n 'The canonical joined input exists but the joined marker was lost: recovery repairs the marker only; the input reattaches, never duplicates (DUR-015/DUR-016).',\n SettleJoinedWithHost:\n 'The host Run settled canonically: recovery settles this joined Submission with the host outcome — each joined Submission is owed its own settlement (DUR-002).',\n AwaitHostSettlement:\n \"The Submission is joined and its host Run is still live: nothing to repair — the input reattaches through the host's resume and the Submission settles with the host.\",\n CompleteChildAdmission:\n 'A canonical SubagentRequested exists and the authoritative lookup proved not-admitted: recovery idempotently admits the intended child from the canonical request payload alone.',\n AwaitChildAdmissionResolution:\n 'The authoritative child-admission lookup answered indeterminate (or was not performed): recovery waits and retries the authoritative owner; a second admission never occurs (SUB-031).',\n RepairSubagentStartLink:\n \"The child is admitted but the parent's SubagentStarted link (or reservation attachment) is missing: recovery resolves the SAME child by its deterministic key and appends the exact link (SUB-016/SUB-017).\",\n EnsureWaitingForChild:\n 'Children are established and at least one is nonterminal while the parent lane is not durably suspended: recovery restores the waitingForChild suspension; it reattaches the one existing child and never spawns a replacement (SUB-018/SUB-030).',\n AwaitChildSettlement:\n \"The parent is durably suspended waitingForChild and a listed child is not yet provably settled: the lane stays dormant, consumes no worker permit, and the child's Settlement wakes it durably (SUB-021/SUB-030).\",\n ResumeWaitingParent:\n \"Every relevant child is provably settled but the parent has not joined: recovery replays the idempotent wake so a claiming worker resumes the declared batch and joins each child's canonical Settlement.\",\n ApplyJoinAccounting:\n 'The canonical SubagentJoined record exists but the reservation release is incomplete: recovery replays the accounting decision FROM the canonical record — budget stays unavailable until repair, never available twice (DUR-015).',\n PropagateChildAbort:\n \"Parent abort is canonical while attached children are nonterminal: recovery idempotently issues each child's durable abort command and keeps the parent waiting for the joins — request-abort-and-join is the only close behavior.\",\n ReleaseOrphanChildReservation:\n 'A child budget reservation can no longer bind a child: recovery freezes the deterministic zero-consumed accounting decision and releases the unused allocation exactly once.',\n AwaitParentEstablishment:\n \"The Submission is a parent-linked child whose Thread lacks the canonical lineage record: the child lane defers its own readiness repair — the parent's idempotent establishment completes it, so a child never runs a Turn before its lineage is canonical (P7 §7(a), SUB-016).\",\n NoAction: 'The Submission is settled; nothing is owed.',\n}\n\n/** The operator meaning of one recovery decision tag. */\nexport const recoveryDecisionMeaning = (tag: RecoveryDecision['_tag']): string => RECOVERY_DECISION_MEANINGS[tag]\n\n/**\n * The disposition the recovery executor reports for a decision when its repair executes without\n * claim contention (pure prediction; `executeRecoveryDecision` in the coordinator remains the\n * execution authority — a lane concurrently claimed by a worker can always defer instead).\n * `AwaitApprovalDecision` depends on the snapshot: an already-suspended lane waits (`deferred`),\n * while a claimable lane with a lost suspend transition is repaired.\n */\nexport const predictRecoveryDisposition = (\n decision: RecoveryDecision,\n snapshot: RecoverySnapshot,\n): RecoveryDisposition => {\n switch (decision._tag) {\n case 'NoAction':\n return 'none'\n case 'AwaitUnknownResolution':\n case 'MarkUnknown':\n return 'unknown'\n case 'ResumeFromTurnBoundary':\n case 'ResumePendingToolBatch':\n case 'ResumeSuspended':\n case 'AwaitHostSettlement':\n case 'AwaitChildAdmissionResolution':\n case 'AwaitChildSettlement':\n case 'AwaitParentEstablishment':\n return 'deferred'\n case 'AwaitApprovalDecision':\n return snapshot.submission.state === 'suspended' ? 'deferred' : 'repaired'\n default:\n return 'repaired'\n }\n}\n\nconst formatUtc = (value: DateTime.Utc): string => DateTime.formatIso(value)\n\n/** Pure operator text for one explanation (the CLI's `explain` output body). */\nexport const renderRecoveryExplanation = (explanation: RecoveryExplanation): string => {\n const submission = explanation.submission\n const evidence = explanation.evidence\n\n const lines: Array<string> = [\n `Submission ${submission.submissionId} (thread ${submission.threadId})`,\n ` state: ${submission.state} queue: ${submission.queueSequence} age: ${submission.ageSeconds}s`,\n ` admitted: ${formatUtc(submission.createdAt)}${\n submission.readyAt === undefined ? '' : ` ready: ${formatUtc(submission.readyAt)}`\n }`,\n ]\n\n if (submission.parentLinkage !== undefined) {\n lines.push(\n ` attached child of ${submission.parentLinkage.parentSubmissionId} (tool call ${submission.parentLinkage.parentToolCallId})`,\n )\n }\n lines.push(\n ` evidence: input=${evidence.inputRecorded ? 'recorded' : 'missing'}` +\n ` settlement=${evidence.recordedSettlementOutcome ?? 'none'}` +\n ` abort=${evidence.abortRecorded ? 'recorded' : 'none'}` +\n ` materialized=${evidence.threadMaterialized ? 'yes' : 'no'}`,\n )\n if (evidence.openToolCalls.length > 0) {\n lines.push(\n ` open ordinary tool calls: ${\n evidence.openToolCalls\n .map((call) => `${call.toolName}#${call.toolCallId}`)\n .join(', ')\n }`,\n )\n }\n if (evidence.openDelegationCalls.length > 0) {\n lines.push(\n ` open delegation calls: ${\n evidence.openDelegationCalls\n .map(\n (call) =>\n `${call.toolName}#${call.toolCallId}(requested=${call.requested} started=${call.started} joined=${call.joined})`,\n )\n .join(', ')\n }`,\n )\n }\n if (evidence.approvalsPending.length > 0) {\n lines.push(\n ` approvals pending: ${\n evidence.approvalsPending\n .map((pending) => pending.toolCallId)\n .join(', ')\n }`,\n )\n }\n for (const unknown of evidence.unknownCalls) {\n lines.push(\n ` unknown outcome: ${unknown.toolName}#${unknown.toolCallId} recorded ${formatUtc(unknown.recordedAt)} ${\n unknown.resolved ? '(resolution intent recorded)' : '(awaiting resolveUnknown)'\n }`,\n )\n }\n if (evidence.childAttachments.length > 0) {\n lines.push(\n ` attached children: ${\n evidence.childAttachments\n .map((child) => `${child.childSubmissionId}(${child.childState})`)\n .join(', ')\n }`,\n )\n }\n if (evidence.joins.length > 0) {\n lines.push(\n ` joined members: ${\n evidence.joins\n .map((join) => `${join.submissionId}(${join.state})`)\n .join(', ')\n }`,\n )\n }\n if (evidence.hostSubmissionId !== undefined) {\n lines.push(` joined to host: ${evidence.hostSubmissionId}`)\n }\n if (evidence.suspension !== undefined) {\n lines.push(\n ` suspended (${evidence.suspension.reason._tag}) since ${formatUtc(evidence.suspension.suspendedAt)}`,\n )\n }\n if (evidence.abortIntent !== undefined) {\n lines.push(\n ` abort intent by ${evidence.abortIntent.author} at ${formatUtc(evidence.abortIntent.requestedAt)}`,\n )\n }\n lines.push(\n ` decision: ${explanation.decision._tag} → disposition ${explanation.disposition}`,\n ` meaning: ${explanation.decisionMeaning}`,\n )\n\n return lines.join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// verify — IntegrityReport\n// ---------------------------------------------------------------------------\n\n/** The named integrity checks `verifyThreadInvariants` performs. */\nexport const IntegrityCheckName = Schema.Literals([\n /** Every exported envelope round-trips its canonical Schema. */\n 'schema-round-trip',\n /** No canonical record identity appears twice (DUR-007). */\n 'record-identity',\n /** Canonical sequences are gap-free from 1 through the exported tail. */\n 'sequence-contiguity',\n /** Every retained Run fact is addressable independently of the disposable Run directory.\n * Current execution references and original context must agree with retained history;\n * discarded checkpoint revisions and their historical counters are not reconstructed. */\n 'continuation-evidence',\n /** Canonical `input:{sid}` records follow the admitted FIFO order (DUR-004). */\n 'fifo-input-order',\n /** Canonical settlement records follow the admitted FIFO order (DUR-004); aborted\n * settlements of never-run work are exempt by design (P7 §7(c)). */\n 'input-before-settlement',\n /** At most one canonical terminal record per Submission; exactly one per settled row (DUR-002). */\n 'terminal-uniqueness',\n /** Ledger terminal state agrees with the canonical settlement record (DUR-015). */\n 'ledger-canonical-agreement',\n /** Convergence mode only: every known Submission is settled. */\n 'all-settled',\n])\n\nexport type IntegrityCheckName = typeof IntegrityCheckName.Type\n\nexport const IntegrityCheckStatus = Schema.Literals(['passed', 'failed', 'skipped'])\nexport type IntegrityCheckStatus = typeof IntegrityCheckStatus.Type\n\n/** One typed check result; `detail` explains a failure or the honest reason for a skip. */\nexport class IntegrityCheck extends Schema.Class<IntegrityCheck>(\n '@effect-agent/thread/IntegrityCheck',\n)({\n name: IntegrityCheckName,\n status: IntegrityCheckStatus,\n detail: Schema.optionalKey(BoundedDetail),\n}) {}\n\n/**\n * The read-only integrity verdict for one Thread (plan §3 `verify`): typed per-check\n * results, never a repair. `ok` is true exactly when no check failed — skipped checks are\n * honest scope statements, not silent passes.\n */\nexport class IntegrityReport extends Schema.Class<IntegrityReport>(\n '@effect-agent/thread/IntegrityReport',\n)({\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n recordCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n submissionCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n checks: Schema.Array(IntegrityCheck),\n ok: Schema.Boolean,\n}) {}\n\n// ---------------------------------------------------------------------------\n// scanObligations — ObligationReport\n// ---------------------------------------------------------------------------\n\n/**\n * What one nonterminal Submission is visibly blocked on (DUR-017 operator surface; OPS-001).\n * `ready-aged`/`running-aged` are not blocks — they are accepted work whose settlement age is\n * measurable and alertable.\n */\nexport const ObligationBlockedOn = Schema.Literals([\n 'unknown',\n 'approval',\n 'waitingForChild',\n 'ready-aged',\n 'running-aged',\n])\n\nexport type ObligationBlockedOn = typeof ObligationBlockedOn.Type\n\nexport const ObligationSeverity = Schema.Literals(['ok', 'aging', 'overdue'])\nexport type ObligationSeverity = typeof ObligationSeverity.Type\n\n/** Host-supplied age thresholds; the framework deliberately does not own the alert loop. */\nexport class ObligationThresholds extends Schema.Class<ObligationThresholds>(\n '@effect-agent/thread/ObligationThresholds',\n)({\n /** Age (whole seconds) at which an obligation is reported `aging`. */\n agingSeconds: AgeSeconds,\n /** Age (whole seconds) at which an obligation is reported `overdue`. */\n overdueSeconds: AgeSeconds,\n}) {}\n\n/** One nonterminal accepted-work obligation with its age and severity. */\nexport class ObligationEntry extends Schema.Class<ObligationEntry>(\n '@effect-agent/thread/ObligationEntry',\n)({\n submissionId: SubmissionId,\n threadId: ThreadId,\n state: SubmissionState,\n blockedOn: ObligationBlockedOn,\n ageSeconds: AgeSeconds,\n severity: ObligationSeverity,\n}) {}\n\n/**\n * The scan-based DUR-017/OPS-001 operator surface (plan §3): a fold of the ledger's nonterminal\n * scan into aged, severity-classified rows. Scan-based, never a daemon — hosts run it\n * periodically and export logs/metrics; ages need no storage-version bump because every source\n * timestamp already exists (`createdAt`/`readyAt`, `suspendedAt`, the canonical\n * `ToolCallUnknown` record's `createdAt`).\n */\nexport class ObligationReport extends Schema.Class<ObligationReport>(\n '@effect-agent/thread/ObligationReport',\n)({\n thresholds: ObligationThresholds,\n entries: Schema.Array(ObligationEntry),\n generatedAt: Schema.DateTimeUtcFromString,\n}) {}\n\n/** Severity of one obligation age under the supplied thresholds. */\nexport const obligationSeverityOf = (\n ageSeconds: number,\n thresholds: ObligationThresholds,\n): ObligationSeverity =>\n ageSeconds >= thresholds.overdueSeconds\n ? 'overdue'\n : ageSeconds >= thresholds.agingSeconds\n ? 'aging'\n : 'ok'\n\n// ---------------------------------------------------------------------------\n// retry — typed command and refusals\n// ---------------------------------------------------------------------------\n\n/**\n * The mandatory-audit retry command (SEC-011): `author`/`reason` carry the same bounds as the\n * canonical abort command so every mutating administrative operation stays attributable. The\n * operator and decision are logged. A repair with a claim also appends a best-effort\n * `RepairAnnotated` attempt using that claim's epoch; state-only repairs do not append audits.\n */\nexport class RetryCommand extends Schema.Class<RetryCommand>('@effect-agent/thread/RetryCommand')({\n submissionId: SubmissionId,\n author: AbortCommand.fields.author,\n reason: AbortCommand.fields.reason,\n}) {}\n\n/** Why a retry was refused without executing anything. */\nexport const RetryRefusalReason = Schema.Literals([\n /** The Submission is settled; terminal outcomes are never revisited (DUR-002). */\n 'settled',\n /** The Submission is parked on Unknown Outcomes; use `resolveUnknown` (DUR-017). */\n 'await-unknown-resolution',\n /** The lane is durably waiting for approval decisions; use `resolveApproval`. */\n 'await-approval-decision',\n])\n\nexport type RetryRefusalReason = typeof RetryRefusalReason.Type\n\n/**\n * Typed refusal of `retry` (plan §3): Submissions waiting on `AwaitUnknownResolution` or\n * `AwaitApprovalDecision` have their own authorized operations, and settled work is never\n * re-driven. The refusal names the classifier decision so the operator sees WHY.\n */\nexport class RetryRefused extends Schema.TaggedError<RetryRefused>()('RetryRefused', {\n submissionId: SubmissionId,\n refusal: RetryRefusalReason,\n decisionTag: Schema.String.check(Schema.isMaxLength(256)),\n message: Schema.String.check(Schema.isMaxLength(4_096)),\n}) {}\n"],"mappings":"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"}