effect-agent 0.1.0-beta.12 → 0.1.0-beta.121

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 (553) hide show
  1. package/dist/Agent-1DMSO_Fl.mjs +86 -0
  2. package/dist/Agent-1DMSO_Fl.mjs.map +1 -0
  3. package/dist/Agent-D9cXqfF3.d.mts +252 -0
  4. package/dist/AgentError-Bn1ytXRD.d.mts +117 -0
  5. package/dist/AgentPolicy-BqDoSXO6.d.mts +96 -0
  6. package/dist/AgentRuntime-BUxDdLpw.d.mts +346 -0
  7. package/dist/AgentRuntime-Cp1hAb-W.mjs +4739 -0
  8. package/dist/AgentRuntime-Cp1hAb-W.mjs.map +1 -0
  9. package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
  10. package/dist/ContextCompactor-WwSIG_Z2.d.mts +161 -0
  11. package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
  12. package/dist/DurableAgentRuntime-B-9w7jDt.mjs +7061 -0
  13. package/dist/DurableAgentRuntime-B-9w7jDt.mjs.map +1 -0
  14. package/dist/DurableFailpoint-Cnr3wx1L.d.mts +41 -0
  15. package/dist/DurableStep-Cry_iol4.d.mts +103 -0
  16. package/dist/EventSource-CnlZ3Kma.d.mts +51 -0
  17. package/dist/FailureDiagnostic-BElLOoED.mjs +274 -0
  18. package/dist/FailureDiagnostic-BElLOoED.mjs.map +1 -0
  19. package/dist/FailureDiagnostic-CaAkzGHL.d.mts +223 -0
  20. package/dist/Identifiers-CN2s30fF.d.mts +40 -0
  21. package/dist/InMemory.d.mts +24 -0
  22. package/dist/InMemory.mjs +24 -0
  23. package/dist/InMemory.mjs.map +1 -0
  24. package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
  25. package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
  26. package/dist/Messaging-Dkg87ebg.d.mts +221 -0
  27. package/dist/Messaging-JYYN3oYS.d.mts +1067 -0
  28. package/dist/MessagingHost-CqzpxbGz.d.mts +74 -0
  29. package/dist/MessagingHost-DfsbMPvq.mjs +110 -0
  30. package/dist/MessagingHost-DfsbMPvq.mjs.map +1 -0
  31. package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
  32. package/dist/Output-V-6YL1_Z.d.mts +25 -0
  33. package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
  34. package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
  35. package/dist/PreparedInputAdmission-BQLGldl-.d.mts +42 -0
  36. package/dist/Receipt-BAHyigAF.d.mts +33 -0
  37. package/dist/Records-D88mgvyS.d.mts +4214 -0
  38. package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
  39. package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
  40. package/dist/RunJournal-BXrq0VIK.mjs +931 -0
  41. package/dist/RunJournal-BXrq0VIK.mjs.map +1 -0
  42. package/dist/RunOptions-CSBsSj0X.d.mts +935 -0
  43. package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
  44. package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
  45. package/dist/Schedule-BIOHA6RR.d.mts +847 -0
  46. package/dist/Scheduling-DPb2QyAK.mjs +691 -0
  47. package/dist/Scheduling-DPb2QyAK.mjs.map +1 -0
  48. package/dist/Subagent-CNik9RiA.d.mts +1635 -0
  49. package/dist/Subagent-DCrB7an7.mjs +1498 -0
  50. package/dist/Subagent-DCrB7an7.mjs.map +1 -0
  51. package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
  52. package/dist/SubagentHost-4WB8Hj0C.d.mts +164 -0
  53. package/dist/Subscription-CRteOKRf.d.mts +948 -0
  54. package/dist/SubscriptionInput-oNcwTPti.d.mts +41 -0
  55. package/dist/Thread-DOBQ0QUY.d.mts +96 -0
  56. package/dist/ThreadHistory-tS1KwxHR.d.mts +60 -0
  57. package/dist/ToolBroker-DWs4tZra.d.mts +133 -0
  58. package/dist/ToolExposure-9uF_Yo0T.mjs +10 -0
  59. package/dist/ToolExposure-9uF_Yo0T.mjs.map +1 -0
  60. package/dist/ToolExposure-C93U1sPu.mjs +30 -0
  61. package/dist/ToolExposure-C93U1sPu.mjs.map +1 -0
  62. package/dist/ToolExposure-UCN12eCd.d.mts +39 -0
  63. package/dist/ToolExposure-r2eOWk4F.d.mts +46 -0
  64. package/dist/ToolExposure.d.mts +8 -0
  65. package/dist/ToolExposure.mjs +21 -0
  66. package/dist/ToolExposure.mjs.map +1 -0
  67. package/dist/ToolReconciler-BmVRAHKs.d.mts +80 -0
  68. package/dist/ToolResult-BKdqWRff.d.mts +78 -0
  69. package/dist/Usage-Dx0aknfk.d.mts +121 -0
  70. package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
  71. package/dist/Worker-CfwzMZEK.mjs +271 -0
  72. package/dist/Worker-CfwzMZEK.mjs.map +1 -0
  73. package/dist/Worker-fwWkBg12.d.mts +472 -0
  74. package/dist/agent-registration-CKNsrpwo.mjs +201 -0
  75. package/dist/agent-registration-CKNsrpwo.mjs.map +1 -0
  76. package/dist/capabilities/Approval.d.mts +114 -0
  77. package/dist/capabilities/Approval.mjs +226 -0
  78. package/dist/capabilities/Approval.mjs.map +1 -0
  79. package/dist/capabilities/Budget.d.mts +112 -0
  80. package/dist/capabilities/Budget.mjs +346 -0
  81. package/dist/capabilities/Budget.mjs.map +1 -0
  82. package/dist/capabilities/CodeMode.d.mts +157 -0
  83. package/dist/capabilities/CodeMode.mjs +522 -0
  84. package/dist/capabilities/CodeMode.mjs.map +1 -0
  85. package/dist/capabilities/Commands.d.mts +55 -0
  86. package/dist/capabilities/Commands.mjs +57 -0
  87. package/dist/capabilities/Commands.mjs.map +1 -0
  88. package/dist/capabilities/ContextTools.d.mts +321 -0
  89. package/dist/capabilities/ContextTools.mjs +126 -0
  90. package/dist/capabilities/ContextTools.mjs.map +1 -0
  91. package/dist/capabilities/Mcp.d.mts +108 -0
  92. package/dist/capabilities/Mcp.mjs +259 -0
  93. package/dist/capabilities/Mcp.mjs.map +1 -0
  94. package/dist/capabilities/McpClient.d.mts +115 -0
  95. package/dist/capabilities/McpClient.mjs +506 -0
  96. package/dist/capabilities/McpClient.mjs.map +1 -0
  97. package/dist/capabilities/MemoryNotes.d.mts +424 -0
  98. package/dist/capabilities/MemoryNotes.mjs +128 -0
  99. package/dist/capabilities/MemoryNotes.mjs.map +1 -0
  100. package/dist/capabilities/Messaging.d.mts +3 -0
  101. package/dist/capabilities/Messaging.mjs +152 -0
  102. package/dist/capabilities/Messaging.mjs.map +1 -0
  103. package/dist/capabilities/ModelContext.d.mts +89 -0
  104. package/dist/capabilities/ModelContext.mjs +168 -0
  105. package/dist/capabilities/ModelContext.mjs.map +1 -0
  106. package/dist/capabilities/Redaction.d.mts +37 -0
  107. package/dist/capabilities/Redaction.mjs +104 -0
  108. package/dist/capabilities/Redaction.mjs.map +1 -0
  109. package/dist/capabilities/Remembering.d.mts +434 -0
  110. package/dist/capabilities/Remembering.mjs +290 -0
  111. package/dist/capabilities/Remembering.mjs.map +1 -0
  112. package/dist/capabilities/RunHooks.d.mts +82 -0
  113. package/dist/capabilities/RunHooks.mjs +144 -0
  114. package/dist/capabilities/RunHooks.mjs.map +1 -0
  115. package/dist/capabilities/SemanticMemory.d.mts +431 -0
  116. package/dist/capabilities/SemanticMemory.mjs +315 -0
  117. package/dist/capabilities/SemanticMemory.mjs.map +1 -0
  118. package/dist/capabilities/Subagent.d.mts +4 -0
  119. package/dist/capabilities/Subagent.mjs +5 -0
  120. package/dist/capabilities/SubagentReservations.d.mts +186 -0
  121. package/dist/capabilities/SubagentReservations.mjs +479 -0
  122. package/dist/capabilities/SubagentReservations.mjs.map +1 -0
  123. package/dist/capabilities/ToolDiscovery.d.mts +124 -0
  124. package/dist/capabilities/ToolDiscovery.mjs +230 -0
  125. package/dist/capabilities/ToolDiscovery.mjs.map +1 -0
  126. package/dist/capabilities/WebCapture.d.mts +163 -0
  127. package/dist/capabilities/WebCapture.mjs +335 -0
  128. package/dist/capabilities/WebCapture.mjs.map +1 -0
  129. package/dist/capabilities/WebSearch.d.mts +71 -0
  130. package/dist/capabilities/WebSearch.mjs +115 -0
  131. package/dist/capabilities/WebSearch.mjs.map +1 -0
  132. package/dist/compaction-C2OTceKw.mjs +505 -0
  133. package/dist/compaction-C2OTceKw.mjs.map +1 -0
  134. package/dist/core/Agent.d.mts +2 -0
  135. package/dist/core/Agent.mjs +2 -0
  136. package/dist/core/AgentError.d.mts +2 -0
  137. package/dist/core/AgentError.mjs +134 -0
  138. package/dist/core/AgentError.mjs.map +1 -0
  139. package/dist/core/AgentPolicy.d.mts +2 -0
  140. package/dist/core/AgentPolicy.mjs +94 -0
  141. package/dist/core/AgentPolicy.mjs.map +1 -0
  142. package/dist/core/AgentUpdates.d.mts +2 -0
  143. package/dist/core/AgentUpdates.mjs +63 -0
  144. package/dist/core/AgentUpdates.mjs.map +1 -0
  145. package/dist/core/FailureDiagnostic.d.mts +2 -0
  146. package/dist/core/FailureDiagnostic.mjs +2 -0
  147. package/dist/core/IdGenerator.d.mts +26 -0
  148. package/dist/core/IdGenerator.mjs +27 -0
  149. package/dist/core/IdGenerator.mjs.map +1 -0
  150. package/dist/core/Identifiers.d.mts +2 -0
  151. package/dist/core/Identifiers.mjs +43 -0
  152. package/dist/core/Identifiers.mjs.map +1 -0
  153. package/dist/core/Memory.d.mts +57 -0
  154. package/dist/core/Memory.mjs +203 -0
  155. package/dist/core/Memory.mjs.map +1 -0
  156. package/dist/core/MemoryNamespace.d.mts +2 -0
  157. package/dist/core/MemoryNamespace.mjs +116 -0
  158. package/dist/core/MemoryNamespace.mjs.map +1 -0
  159. package/dist/core/MemoryReference.d.mts +2 -0
  160. package/dist/core/MemoryReference.mjs +109 -0
  161. package/dist/core/MemoryReference.mjs.map +1 -0
  162. package/dist/core/MemoryRevalidation.d.mts +65 -0
  163. package/dist/core/MemoryRevalidation.mjs +126 -0
  164. package/dist/core/MemoryRevalidation.mjs.map +1 -0
  165. package/dist/core/MemoryStore.d.mts +186 -0
  166. package/dist/core/MemoryStore.mjs +243 -0
  167. package/dist/core/MemoryStore.mjs.map +1 -0
  168. package/dist/core/Receipt.d.mts +2 -0
  169. package/dist/core/Receipt.mjs +36 -0
  170. package/dist/core/Receipt.mjs.map +1 -0
  171. package/dist/core/RememberingStore.d.mts +1562 -0
  172. package/dist/core/RememberingStore.mjs +190 -0
  173. package/dist/core/RememberingStore.mjs.map +1 -0
  174. package/dist/core/RunEvent.d.mts +2 -0
  175. package/dist/core/RunEvent.mjs +337 -0
  176. package/dist/core/RunEvent.mjs.map +1 -0
  177. package/dist/core/RunPolicyUsage.d.mts +2 -0
  178. package/dist/core/RunPolicyUsage.mjs +21 -0
  179. package/dist/core/RunPolicyUsage.mjs.map +1 -0
  180. package/dist/core/SemanticMemoryIndex.d.mts +826 -0
  181. package/dist/core/SemanticMemoryIndex.mjs +185 -0
  182. package/dist/core/SemanticMemoryIndex.mjs.map +1 -0
  183. package/dist/core/SemanticMemoryRevalidation.d.mts +45 -0
  184. package/dist/core/SemanticMemoryRevalidation.mjs +191 -0
  185. package/dist/core/SemanticMemoryRevalidation.mjs.map +1 -0
  186. package/dist/core/SubagentContract.d.mts +2 -0
  187. package/dist/core/SubagentContract.mjs +148 -0
  188. package/dist/core/SubagentContract.mjs.map +1 -0
  189. package/dist/core/Thread.d.mts +2 -0
  190. package/dist/core/Thread.mjs +250 -0
  191. package/dist/core/Thread.mjs.map +1 -0
  192. package/dist/core/ToolResult.d.mts +2 -0
  193. package/dist/core/ToolResult.mjs +156 -0
  194. package/dist/core/ToolResult.mjs.map +1 -0
  195. package/dist/core/Usage.d.mts +2 -0
  196. package/dist/core/Usage.mjs +319 -0
  197. package/dist/core/Usage.mjs.map +1 -0
  198. package/dist/core/Worker.d.mts +3 -0
  199. package/dist/core/Worker.mjs +3 -0
  200. package/dist/durable/ActivityStore.d.mts +116 -0
  201. package/dist/durable/ActivityStore.mjs +131 -0
  202. package/dist/durable/ActivityStore.mjs.map +1 -0
  203. package/dist/durable/Admin.d.mts +2 -0
  204. package/dist/durable/Admin.mjs +330 -0
  205. package/dist/durable/Admin.mjs.map +1 -0
  206. package/dist/durable/AgentRegistration.d.mts +2 -0
  207. package/dist/durable/AgentRegistration.mjs +14 -0
  208. package/dist/durable/AgentRegistration.mjs.map +1 -0
  209. package/dist/durable/Certification.d.mts +110 -0
  210. package/dist/durable/Certification.mjs +159 -0
  211. package/dist/durable/Certification.mjs.map +1 -0
  212. package/dist/durable/CommittedActivity.d.mts +62 -0
  213. package/dist/durable/CommittedActivity.mjs +159 -0
  214. package/dist/durable/CommittedActivity.mjs.map +1 -0
  215. package/dist/durable/Digest.d.mts +2 -0
  216. package/dist/durable/Digest.mjs +50 -0
  217. package/dist/durable/Digest.mjs.map +1 -0
  218. package/dist/durable/DurableAgentRuntime.d.mts +3 -0
  219. package/dist/durable/DurableAgentRuntime.mjs +3 -0
  220. package/dist/durable/DurableFailpoint.d.mts +2 -0
  221. package/dist/durable/DurableFailpoint.mjs +102 -0
  222. package/dist/durable/DurableFailpoint.mjs.map +1 -0
  223. package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
  224. package/dist/durable/DurableFailpointTestControl.mjs +19 -0
  225. package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
  226. package/dist/durable/EventSource.d.mts +2 -0
  227. package/dist/durable/EventSource.mjs +65 -0
  228. package/dist/durable/EventSource.mjs.map +1 -0
  229. package/dist/durable/GitHubWorkflowSource.d.mts +185 -0
  230. package/dist/durable/GitHubWorkflowSource.mjs +209 -0
  231. package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
  232. package/dist/durable/MessageDelivery.d.mts +893 -0
  233. package/dist/durable/MessageDelivery.mjs +557 -0
  234. package/dist/durable/MessageDelivery.mjs.map +1 -0
  235. package/dist/durable/MessageDeliveryStoreConformance.d.mts +378 -0
  236. package/dist/durable/MessageDeliveryStoreConformance.mjs +270 -0
  237. package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
  238. package/dist/durable/OperationAuthorizer.d.mts +2 -0
  239. package/dist/durable/OperationAuthorizer.mjs +70 -0
  240. package/dist/durable/OperationAuthorizer.mjs.map +1 -0
  241. package/dist/durable/PersistentHistory.d.mts +16 -0
  242. package/dist/durable/PersistentHistory.mjs +125 -0
  243. package/dist/durable/PersistentHistory.mjs.map +1 -0
  244. package/dist/durable/PreparedInputAdmission.d.mts +2 -0
  245. package/dist/durable/PreparedInputAdmission.mjs +38 -0
  246. package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
  247. package/dist/durable/Records.d.mts +2 -0
  248. package/dist/durable/Records.mjs +848 -0
  249. package/dist/durable/Records.mjs.map +1 -0
  250. package/dist/durable/Recovery.d.mts +2 -0
  251. package/dist/durable/Recovery.mjs +739 -0
  252. package/dist/durable/Recovery.mjs.map +1 -0
  253. package/dist/durable/RunJournal.d.mts +2 -0
  254. package/dist/durable/RunJournal.mjs +2 -0
  255. package/dist/durable/Schedule.d.mts +2 -0
  256. package/dist/durable/Schedule.mjs +391 -0
  257. package/dist/durable/Schedule.mjs.map +1 -0
  258. package/dist/durable/ScheduleStoreConformance.d.mts +17 -0
  259. package/dist/durable/ScheduleStoreConformance.mjs +420 -0
  260. package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
  261. package/dist/durable/ScheduleTransition.d.mts +24 -0
  262. package/dist/durable/ScheduleTransition.mjs +180 -0
  263. package/dist/durable/ScheduleTransition.mjs.map +1 -0
  264. package/dist/durable/Scheduling.d.mts +54 -0
  265. package/dist/durable/Scheduling.mjs +2 -0
  266. package/dist/durable/SqlMemoryStore.d.mts +29 -0
  267. package/dist/durable/SqlMemoryStore.mjs +436 -0
  268. package/dist/durable/SqlMemoryStore.mjs.map +1 -0
  269. package/dist/durable/SqlMessageDeliveryStore.d.mts +42 -0
  270. package/dist/durable/SqlMessageDeliveryStore.mjs +179 -0
  271. package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
  272. package/dist/durable/SqlStorageV2Upgrade.d.mts +21 -0
  273. package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
  274. package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
  275. package/dist/durable/SqlSubscriptionStore.d.mts +62 -0
  276. package/dist/durable/SqlSubscriptionStore.mjs +751 -0
  277. package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
  278. package/dist/durable/SqlThreadNativeReads.d.mts +53 -0
  279. package/dist/durable/SqlThreadNativeReads.mjs +159 -0
  280. package/dist/durable/SqlThreadNativeReads.mjs.map +1 -0
  281. package/dist/durable/SubmissionLedger.d.mts +3 -0
  282. package/dist/durable/SubmissionLedger.mjs +959 -0
  283. package/dist/durable/SubmissionLedger.mjs.map +1 -0
  284. package/dist/durable/SubmissionLedgerConformance.d.mts +29 -0
  285. package/dist/durable/SubmissionLedgerConformance.mjs +2187 -0
  286. package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
  287. package/dist/durable/SubmissionStatus.d.mts +2 -0
  288. package/dist/durable/SubmissionStatus.mjs +18 -0
  289. package/dist/durable/SubmissionStatus.mjs.map +1 -0
  290. package/dist/durable/Subscription.d.mts +2 -0
  291. package/dist/durable/Subscription.mjs +360 -0
  292. package/dist/durable/Subscription.mjs.map +1 -0
  293. package/dist/durable/SubscriptionInput.d.mts +2 -0
  294. package/dist/durable/SubscriptionInput.mjs +52 -0
  295. package/dist/durable/SubscriptionInput.mjs.map +1 -0
  296. package/dist/durable/SubscriptionStoreConformance.d.mts +16 -0
  297. package/dist/durable/SubscriptionStoreConformance.mjs +625 -0
  298. package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
  299. package/dist/durable/SubscriptionTools.d.mts +273 -0
  300. package/dist/durable/SubscriptionTools.mjs +190 -0
  301. package/dist/durable/SubscriptionTools.mjs.map +1 -0
  302. package/dist/durable/SubscriptionTransition.d.mts +21 -0
  303. package/dist/durable/SubscriptionTransition.mjs +148 -0
  304. package/dist/durable/SubscriptionTransition.mjs.map +1 -0
  305. package/dist/durable/Subscriptions.d.mts +73 -0
  306. package/dist/durable/Subscriptions.mjs +627 -0
  307. package/dist/durable/Subscriptions.mjs.map +1 -0
  308. package/dist/durable/ThreadContextHistory.d.mts +32 -0
  309. package/dist/durable/ThreadContextHistory.mjs +152 -0
  310. package/dist/durable/ThreadContextHistory.mjs.map +1 -0
  311. package/dist/durable/ThreadContextHistoryProjection.d.mts +60 -0
  312. package/dist/durable/ThreadContextHistoryProjection.mjs +149 -0
  313. package/dist/durable/ThreadContextHistoryProjection.mjs.map +1 -0
  314. package/dist/durable/ThreadInvariants.d.mts +76 -0
  315. package/dist/durable/ThreadInvariants.mjs +246 -0
  316. package/dist/durable/ThreadInvariants.mjs.map +1 -0
  317. package/dist/durable/ThreadProjection.d.mts +78 -0
  318. package/dist/durable/ThreadProjection.mjs +158 -0
  319. package/dist/durable/ThreadProjection.mjs.map +1 -0
  320. package/dist/durable/ThreadProjectionMaintenance.d.mts +49 -0
  321. package/dist/durable/ThreadProjectionMaintenance.mjs +33 -0
  322. package/dist/durable/ThreadProjectionMaintenance.mjs.map +1 -0
  323. package/dist/durable/ThreadStore.d.mts +2 -0
  324. package/dist/durable/ThreadStore.mjs +355 -0
  325. package/dist/durable/ThreadStore.mjs.map +1 -0
  326. package/dist/durable/ThreadStoreConformance.d.mts +28 -0
  327. package/dist/durable/ThreadStoreConformance.mjs +503 -0
  328. package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
  329. package/dist/durable/ToolReconciler.d.mts +2 -0
  330. package/dist/durable/ToolReconciler.mjs +85 -0
  331. package/dist/durable/ToolReconciler.mjs.map +1 -0
  332. package/dist/durable/WakeScheduler.d.mts +2 -0
  333. package/dist/durable/WakeScheduler.mjs +85 -0
  334. package/dist/durable/WakeScheduler.mjs.map +1 -0
  335. package/dist/durable/WorkerHost.d.mts +129 -0
  336. package/dist/durable/WorkerHost.mjs +77 -0
  337. package/dist/durable/WorkerHost.mjs.map +1 -0
  338. package/dist/engine/AgentRuntime.d.mts +2 -0
  339. package/dist/engine/AgentRuntime.mjs +2 -0
  340. package/dist/engine/Compaction.d.mts +7 -0
  341. package/dist/engine/Compaction.mjs +16 -0
  342. package/dist/engine/Compaction.mjs.map +1 -0
  343. package/dist/engine/ContextCompactor.d.mts +2 -0
  344. package/dist/engine/ContextCompactor.mjs +119 -0
  345. package/dist/engine/ContextCompactor.mjs.map +1 -0
  346. package/dist/engine/ContextHistory.d.mts +65 -0
  347. package/dist/engine/ContextHistory.mjs +76 -0
  348. package/dist/engine/ContextHistory.mjs.map +1 -0
  349. package/dist/engine/ContextWindow.d.mts +2 -0
  350. package/dist/engine/ContextWindow.mjs +59 -0
  351. package/dist/engine/ContextWindow.mjs.map +1 -0
  352. package/dist/engine/DurableStep.d.mts +2 -0
  353. package/dist/engine/DurableStep.mjs +62 -0
  354. package/dist/engine/DurableStep.mjs.map +1 -0
  355. package/dist/engine/MessagingHost.d.mts +2 -0
  356. package/dist/engine/MessagingHost.mjs +2 -0
  357. package/dist/engine/Output.d.mts +2 -0
  358. package/dist/engine/Output.mjs +8 -0
  359. package/dist/engine/Output.mjs.map +1 -0
  360. package/dist/engine/RunEventSink.d.mts +2 -0
  361. package/dist/engine/RunEventSink.mjs +22 -0
  362. package/dist/engine/RunEventSink.mjs.map +1 -0
  363. package/dist/engine/RunOptions.d.mts +2 -0
  364. package/dist/engine/RunOptions.mjs +124 -0
  365. package/dist/engine/RunOptions.mjs.map +1 -0
  366. package/dist/engine/SubagentHost.d.mts +2 -0
  367. package/dist/engine/SubagentHost.mjs +76 -0
  368. package/dist/engine/SubagentHost.mjs.map +1 -0
  369. package/dist/engine/ThreadHistory.d.mts +2 -0
  370. package/dist/engine/ThreadHistory.mjs +67 -0
  371. package/dist/engine/ThreadHistory.mjs.map +1 -0
  372. package/dist/engine/ToolBroker.d.mts +2 -0
  373. package/dist/engine/ToolBroker.mjs +42 -0
  374. package/dist/engine/ToolBroker.mjs.map +1 -0
  375. package/dist/foreign-diagnostic-DBQ1XHKh.mjs +37 -0
  376. package/dist/foreign-diagnostic-DBQ1XHKh.mjs.map +1 -0
  377. package/dist/index.d.mts +91 -6
  378. package/dist/index.mjs +100 -6
  379. package/dist/output-contract-BC7tjlGw.mjs +84 -0
  380. package/dist/output-contract-BC7tjlGw.mjs.map +1 -0
  381. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  382. package/dist/sandbox/CodeExecutor.d.mts +194 -0
  383. package/dist/sandbox/CodeExecutor.mjs +278 -0
  384. package/dist/sandbox/CodeExecutor.mjs.map +1 -0
  385. package/dist/sandbox/InteractiveBrowser.d.mts +257 -0
  386. package/dist/sandbox/InteractiveBrowser.mjs +236 -0
  387. package/dist/sandbox/InteractiveBrowser.mjs.map +1 -0
  388. package/dist/sandbox/PageCapture.d.mts +2 -0
  389. package/dist/sandbox/PageCapture.mjs +450 -0
  390. package/dist/sandbox/PageCapture.mjs.map +1 -0
  391. package/dist/sandbox/PageCrawl.d.mts +88 -0
  392. package/dist/sandbox/PageCrawl.mjs +124 -0
  393. package/dist/sandbox/PageCrawl.mjs.map +1 -0
  394. package/dist/sandbox/PageScreenshot.d.mts +2 -0
  395. package/dist/sandbox/PageScreenshot.mjs +53 -0
  396. package/dist/sandbox/PageScreenshot.mjs.map +1 -0
  397. package/dist/sandbox/ProtectedBrowser.d.mts +283 -0
  398. package/dist/sandbox/ProtectedBrowser.mjs +298 -0
  399. package/dist/sandbox/ProtectedBrowser.mjs.map +1 -0
  400. package/dist/sandbox/Sandbox.d.mts +2 -0
  401. package/dist/sandbox/Sandbox.mjs +208 -0
  402. package/dist/sandbox/Sandbox.mjs.map +1 -0
  403. package/dist/utf8-BYfhEkcj.mjs +11 -0
  404. package/dist/utf8-BYfhEkcj.mjs.map +1 -0
  405. package/dist/utf8-DchGZRBd.mjs +23 -0
  406. package/dist/utf8-DchGZRBd.mjs.map +1 -0
  407. package/package.json +1 -40
  408. package/src/InMemory.ts +19 -0
  409. package/src/ToolExposure.ts +2 -0
  410. package/src/capabilities/Approval.ts +352 -0
  411. package/src/capabilities/Budget.ts +536 -0
  412. package/src/capabilities/CodeMode.ts +1090 -0
  413. package/src/capabilities/Commands.ts +86 -0
  414. package/src/capabilities/ContextTools.ts +184 -0
  415. package/src/capabilities/Mcp.ts +426 -0
  416. package/src/capabilities/McpClient.ts +967 -0
  417. package/src/capabilities/MemoryNotes.ts +174 -0
  418. package/src/capabilities/Messaging.ts +261 -0
  419. package/src/capabilities/ModelContext.ts +354 -0
  420. package/src/capabilities/Redaction.ts +157 -0
  421. package/src/capabilities/Remembering.ts +550 -0
  422. package/src/capabilities/RunHooks.ts +280 -0
  423. package/src/capabilities/SemanticMemory.ts +447 -0
  424. package/src/capabilities/Subagent.ts +2489 -0
  425. package/src/capabilities/SubagentReservations.ts +850 -0
  426. package/src/capabilities/ToolDiscovery.ts +369 -0
  427. package/src/capabilities/WebCapture.ts +722 -0
  428. package/src/capabilities/WebSearch.ts +190 -0
  429. package/src/capabilities/internal/subagent-background.ts +1273 -0
  430. package/src/capabilities/internal/subagent-contract.ts +146 -0
  431. package/src/capabilities/internal/subagent-policy.ts +235 -0
  432. package/src/capabilities/internal/subagent-reporting.ts +136 -0
  433. package/src/capabilities/internal/utf8.ts +10 -0
  434. package/src/core/Agent.ts +602 -0
  435. package/src/core/AgentError.ts +172 -0
  436. package/src/core/AgentPolicy.ts +153 -0
  437. package/src/core/AgentUpdates.ts +100 -0
  438. package/src/core/FailureDiagnostic.ts +343 -0
  439. package/src/core/IdGenerator.ts +39 -0
  440. package/src/core/Identifiers.ts +48 -0
  441. package/src/core/Memory.ts +290 -0
  442. package/src/core/MemoryNamespace.ts +196 -0
  443. package/src/core/MemoryReference.ts +121 -0
  444. package/src/core/MemoryRevalidation.ts +185 -0
  445. package/src/core/MemoryStore.ts +368 -0
  446. package/src/core/Messaging.ts +72 -0
  447. package/src/core/Receipt.ts +42 -0
  448. package/src/core/RememberingStore.ts +300 -0
  449. package/src/core/RunEvent.ts +366 -0
  450. package/src/core/RunPolicyUsage.ts +17 -0
  451. package/src/core/SemanticMemoryIndex.ts +250 -0
  452. package/src/core/SemanticMemoryRevalidation.ts +254 -0
  453. package/src/core/SubagentContract.ts +196 -0
  454. package/src/core/Thread.ts +371 -0
  455. package/src/core/ToolExposure.ts +74 -0
  456. package/src/core/ToolResult.ts +190 -0
  457. package/src/core/Usage.ts +529 -0
  458. package/src/core/Worker.ts +240 -0
  459. package/src/core/internal/agent-updates.ts +34 -0
  460. package/src/core/internal/message-status.ts +60 -0
  461. package/src/core/internal/strict-schema.ts +14 -0
  462. package/src/core/internal/utf8.ts +23 -0
  463. package/src/durable/ActivityStore.ts +160 -0
  464. package/src/durable/Admin.ts +505 -0
  465. package/src/durable/AgentRegistration.ts +14 -0
  466. package/src/durable/Certification.ts +210 -0
  467. package/src/durable/CommittedActivity.ts +296 -0
  468. package/src/durable/Digest.ts +87 -0
  469. package/src/durable/DurableAgentRuntime.ts +11275 -0
  470. package/src/durable/DurableFailpoint.ts +111 -0
  471. package/src/durable/DurableFailpointTestControl.ts +39 -0
  472. package/src/durable/EventSource.ts +172 -0
  473. package/src/durable/GitHubWorkflowSource.ts +447 -0
  474. package/src/durable/MessageDelivery.ts +832 -0
  475. package/src/durable/MessageDeliveryStoreConformance.ts +410 -0
  476. package/src/durable/OperationAuthorizer.ts +85 -0
  477. package/src/durable/PersistentHistory.ts +260 -0
  478. package/src/durable/PreparedInputAdmission.ts +57 -0
  479. package/src/durable/Records.ts +1075 -0
  480. package/src/durable/Recovery.ts +1018 -0
  481. package/src/durable/RunJournal.ts +1631 -0
  482. package/src/durable/Schedule.ts +513 -0
  483. package/src/durable/ScheduleStoreConformance.ts +638 -0
  484. package/src/durable/ScheduleTransition.ts +265 -0
  485. package/src/durable/Scheduling.ts +1077 -0
  486. package/src/durable/SqlMemoryStore.ts +778 -0
  487. package/src/durable/SqlMessageDeliveryStore.ts +335 -0
  488. package/src/durable/SqlStorageV2Upgrade.ts +500 -0
  489. package/src/durable/SqlSubscriptionStore.ts +1440 -0
  490. package/src/durable/SqlThreadNativeReads.ts +270 -0
  491. package/src/durable/SubmissionLedger.ts +1265 -0
  492. package/src/durable/SubmissionLedgerConformance.ts +4820 -0
  493. package/src/durable/SubmissionStatus.ts +14 -0
  494. package/src/durable/Subscription.ts +544 -0
  495. package/src/durable/SubscriptionInput.ts +144 -0
  496. package/src/durable/SubscriptionStoreConformance.ts +945 -0
  497. package/src/durable/SubscriptionTools.ts +327 -0
  498. package/src/durable/SubscriptionTransition.ts +302 -0
  499. package/src/durable/Subscriptions.ts +1210 -0
  500. package/src/durable/ThreadContextHistory.ts +227 -0
  501. package/src/durable/ThreadContextHistoryProjection.ts +216 -0
  502. package/src/durable/ThreadInvariants.ts +507 -0
  503. package/src/durable/ThreadProjection.ts +269 -0
  504. package/src/durable/ThreadProjectionMaintenance.ts +67 -0
  505. package/src/durable/ThreadStore.ts +573 -0
  506. package/src/durable/ThreadStoreConformance.ts +1156 -0
  507. package/src/durable/ToolReconciler.ts +109 -0
  508. package/src/durable/WakeScheduler.ts +134 -0
  509. package/src/durable/WorkerHost.ts +171 -0
  510. package/src/durable/internal/agent-registration.ts +587 -0
  511. package/src/durable/internal/agent-updates.ts +302 -0
  512. package/src/durable/internal/foreign-diagnostic.ts +47 -0
  513. package/src/durable/internal/journal-checkpoint.ts +104 -0
  514. package/src/durable/internal/journal-metadata.ts +117 -0
  515. package/src/durable/internal/message-status.ts +20 -0
  516. package/src/durable/internal/messaging-host.ts +637 -0
  517. package/src/durable/internal/schedule-time.ts +303 -0
  518. package/src/durable/internal/storage-v2-layout.ts +163 -0
  519. package/src/durable/internal/storage-v2.ts +73 -0
  520. package/src/durable/internal/worker-host.ts +2885 -0
  521. package/src/durable/internal/worker-runtime.ts +9 -0
  522. package/src/engine/AgentRuntime.ts +37 -0
  523. package/src/engine/Compaction.ts +11 -0
  524. package/src/engine/ContextCompactor.ts +277 -0
  525. package/src/engine/ContextHistory.ts +73 -0
  526. package/src/engine/ContextWindow.ts +72 -0
  527. package/src/engine/DurableStep.ts +132 -0
  528. package/src/engine/MessagingHost.ts +110 -0
  529. package/src/engine/Output.ts +2 -0
  530. package/src/engine/RunEventSink.ts +132 -0
  531. package/src/engine/RunOptions.ts +1101 -0
  532. package/src/engine/SubagentHost.ts +230 -0
  533. package/src/engine/ThreadHistory.ts +120 -0
  534. package/src/engine/ToolBroker.ts +157 -0
  535. package/src/engine/ToolExposure.ts +48 -0
  536. package/src/engine/internal/agent-runtime.ts +10500 -0
  537. package/src/engine/internal/bounded-value.ts +315 -0
  538. package/src/engine/internal/compaction.ts +678 -0
  539. package/src/engine/internal/error-diagnostic.ts +39 -0
  540. package/src/engine/internal/output-contract.ts +173 -0
  541. package/src/engine/internal/primitive-delta.ts +80 -0
  542. package/src/engine/internal/provider-result-staging.ts +211 -0
  543. package/src/engine/internal/tool-derivative.ts +106 -0
  544. package/src/engine/internal/tool-exposure.ts +224 -0
  545. package/src/engine/internal/tool-telemetry.ts +484 -0
  546. package/src/index.ts +99 -21
  547. package/src/sandbox/CodeExecutor.ts +352 -0
  548. package/src/sandbox/InteractiveBrowser.ts +339 -0
  549. package/src/sandbox/PageCapture.ts +691 -0
  550. package/src/sandbox/PageCrawl.ts +148 -0
  551. package/src/sandbox/PageScreenshot.ts +81 -0
  552. package/src/sandbox/ProtectedBrowser.ts +452 -0
  553. package/src/sandbox/Sandbox.ts +241 -0
@@ -0,0 +1,78 @@
1
+ import * as Schema from "effect/Schema";
2
+ import { AiError } from "effect/unstable/ai";
3
+ declare namespace ToolResult_d_exports {
4
+ export { ToolParameterRejection, ToolResultBounds, TruncatedToolResult, UnserializableToolResult, applyToolResultBounds, unserializableToolResult };
5
+ }
6
+ /**
7
+ * Engine-owned evidence that a fresh model call failed parameter validation.
8
+ * Retain the exact JSON arguments beside the native error so recovery can distinguish
9
+ * a rejected request from damaged executable parameters. This never authorizes execution.
10
+ */
11
+ declare const ToolParameterRejection: Schema.Struct<{
12
+ readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
13
+ readonly parameters: Schema.Codec<Schema.Json, Schema.Json, never, never>;
14
+ readonly error: Schema.toEncoded<Schema.Struct<{
15
+ readonly _tag: Schema.tag<"AiError">;
16
+ readonly module: Schema.String;
17
+ readonly method: Schema.String;
18
+ readonly reason: typeof AiError.ToolParameterValidationError;
19
+ }>>;
20
+ }>;
21
+ type ToolParameterRejection = typeof ToolParameterRejection.Type;
22
+ declare const ToolResultBounds_base: Schema.Class<ToolResultBounds, Schema.Struct<{
23
+ readonly maxBytes: Schema.Int;
24
+ }>, {}>;
25
+ /** Byte bound applied to one encoded application Tool result before it enters history. */
26
+ declare class ToolResultBounds extends ToolResultBounds_base {}
27
+ declare const TruncatedToolResult_base: Schema.Class<TruncatedToolResult, Schema.Struct<{
28
+ readonly truncatedToolResult: Schema.Literal<true>;
29
+ readonly originalBytes: Schema.Natural;
30
+ readonly head: Schema.String;
31
+ readonly tail: Schema.String;
32
+ }>, {}>;
33
+ /**
34
+ * Canonical envelope replacing an encoded Tool result that exceeded its
35
+ * policy bounds. `head` and `tail` are an exact prefix and suffix of the
36
+ * original encoded JSON text; the middle is dropped, never paraphrased.
37
+ */
38
+ declare class TruncatedToolResult extends TruncatedToolResult_base {}
39
+ declare const UnserializableToolResult_base: Schema.Class<UnserializableToolResult, Schema.Struct<{
40
+ readonly unserializableToolResult: Schema.Literal<true>;
41
+ readonly reason: Schema.String;
42
+ }>, {}>;
43
+ /**
44
+ * Canonical fail-closed sentinel replacing an encoded Tool result that could
45
+ * not be JSON-serialized at all (cyclic value, BigInt, `undefined`, throwing
46
+ * `toJSON`). The original value never enters history or durable records —
47
+ * an unserializable value is unbounded by construction, so the bound seam
48
+ * replaces it wholesale rather than passing it through (runtime spec §9).
49
+ */
50
+ declare class UnserializableToolResult extends UnserializableToolResult_base {}
51
+ /**
52
+ * Build the encoded sentinel for a serialization failure. Total by
53
+ * construction — the cause is untrusted (a hostile `toString` or an
54
+ * accessor-backed `Error.message` can itself throw on this last-resort
55
+ * path) — and byte-bound: the complete encoded sentinel stays within the
56
+ * 256-byte `ToolResultBounds` schema floor, so it fits every accepted
57
+ * policy without the caller re-applying bounds.
58
+ */
59
+ declare const unserializableToolResult: (cause: unknown) => typeof UnserializableToolResult.Encoded;
60
+ /**
61
+ * Bound one encoded Tool result to `bounds.maxBytes` UTF-8 bytes.
62
+ *
63
+ * Within bounds the input is returned unchanged. Over bounds the result is
64
+ * the JSON-encoded `TruncatedToolResult` envelope preserving an exact prefix
65
+ * and suffix of the input, split ~50/50 across the byte budget left after
66
+ * the envelope's own overhead and shrunk deterministically until the encoded
67
+ * envelope itself fits. Slicing never splits a UTF-16 surrogate pair, so the
68
+ * envelope always re-encodes as valid JSON.
69
+ *
70
+ * The Schema-level 256-byte floor on `ToolResultBounds.maxBytes` guarantees
71
+ * every accepted bound fits the minimal envelope (at most 81 bytes), so the
72
+ * returned value never exceeds `maxBytes` for a decodable bound. The
73
+ * minimal-envelope fallback below survives purely as defense in depth.
74
+ */
75
+ declare const applyToolResultBounds: (encodedJson: string, bounds: ToolResultBounds) => string;
76
+ //#endregion
77
+ export { UnserializableToolResult as a, TruncatedToolResult as i, ToolResultBounds as n, applyToolResultBounds as o, ToolResult_d_exports as r, unserializableToolResult as s, ToolParameterRejection as t };
78
+ //# sourceMappingURL=ToolResult-BKdqWRff.d.mts.map
@@ -0,0 +1,121 @@
1
+ import { Effect, Schema } from "effect";
2
+ declare namespace Usage_d_exports {
3
+ export { ChildRunUsage, InputTokenUsage, ModelCallUsage, ModelResponseIdentity, ModelUsageGroup, OutputTokenUsage, RunTotals, RunUsageReport, RunUsageSummary, UsageAggregationError, UsageCompleteness, emptyRunTotals, runTotalsFromSummary, sumRunTotals, summarizeModelUsage, unknownRunTotals };
4
+ }
5
+ declare const ModelResponseIdentity_base: Schema.Class<ModelResponseIdentity, Schema.Struct<{
6
+ readonly id: Schema.optionalKey<Schema.NonEmptyString>;
7
+ readonly model: Schema.optionalKey<Schema.NonEmptyString>;
8
+ }>, {}>;
9
+ /** Bounded provider response identity. Request configuration is not response evidence. */
10
+ declare class ModelResponseIdentity extends ModelResponseIdentity_base {}
11
+ /** Missing legacy status means unknown, never a free call or a complete report. */
12
+ declare const UsageCompleteness: Schema.Literals<readonly ["complete", "partial", "unknown"]>;
13
+ declare const InputTokenUsage_base: Schema.Class<InputTokenUsage, Schema.Struct<{
14
+ readonly total: Schema.Natural;
15
+ readonly uncached: Schema.Natural;
16
+ readonly cacheRead: Schema.Natural;
17
+ readonly cacheWrite: Schema.Natural;
18
+ }>, {}>;
19
+ /** Provider-reported input-token components for one completed model call. */
20
+ declare class InputTokenUsage extends InputTokenUsage_base {}
21
+ declare const OutputTokenUsage_base: Schema.Class<OutputTokenUsage, Schema.Struct<{
22
+ readonly total: Schema.Natural;
23
+ readonly text: Schema.Natural;
24
+ readonly reasoning: Schema.Natural;
25
+ }>, {}>;
26
+ /** Provider-reported output-token components for one completed model call. */
27
+ declare class OutputTokenUsage extends OutputTokenUsage_base {}
28
+ declare const ModelCallUsage_base: Schema.Class<ModelCallUsage, Schema.Struct<{
29
+ readonly provider: Schema.NonEmptyString;
30
+ /** Configured binding identity. See response.model for provider-reported identity. */
31
+ readonly model: Schema.NonEmptyString;
32
+ readonly serviceTier: Schema.optionalKey<Schema.NonEmptyString>;
33
+ readonly pricingVersion: Schema.optionalKey<Schema.NonEmptyString>;
34
+ readonly response: Schema.optionalKey<typeof ModelResponseIdentity>;
35
+ readonly purpose: Schema.optionalKey<Schema.Literals<readonly ["turn", "summary"]>>;
36
+ readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
37
+ readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["estimated", "unknown"]>>;
38
+ readonly inputTokens: typeof InputTokenUsage;
39
+ readonly outputTokens: typeof OutputTokenUsage;
40
+ readonly costMicrousd: Schema.Natural;
41
+ }>, {}>;
42
+ /** Canonical, provider-independent accounting for one completed model call. */
43
+ declare class ModelCallUsage extends ModelCallUsage_base {}
44
+ declare const RunTotals_base: Schema.Class<RunTotals, Schema.Struct<{
45
+ readonly modelCalls: Schema.Natural;
46
+ readonly inputTokens: Schema.Natural;
47
+ readonly outputTokens: Schema.Natural;
48
+ readonly costMicrousd: Schema.Natural;
49
+ readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
50
+ readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
51
+ readonly unobservedModelCalls: Schema.optionalKey<Schema.Natural>;
52
+ }>, {}>;
53
+ /**
54
+ * Observed model usage and estimated cost, without per-model attribution.
55
+ * Numeric zero with unknown coverage never establishes free execution. Missing legacy
56
+ * statuses mean unknown. Unobserved calls are excluded from the numeric call/token totals.
57
+ */
58
+ declare class RunTotals extends RunTotals_base {}
59
+ declare const RunUsageReport_base: Schema.Class<RunUsageReport, Schema.Struct<{
60
+ readonly usage: typeof RunTotals;
61
+ readonly delegatedUsage: typeof RunTotals;
62
+ }>, {}>;
63
+ /** Own Run usage and disjoint attached-descendant usage. Add each component once. */
64
+ declare class RunUsageReport extends RunUsageReport_base {}
65
+ declare const ChildRunUsage_base: Schema.Class<ChildRunUsage, Schema.Struct<{
66
+ readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
67
+ readonly report: typeof RunUsageReport;
68
+ }>, {}>;
69
+ /** A verified child report retained across durable parent Attempts. */
70
+ declare class ChildRunUsage extends ChildRunUsage_base {}
71
+ /** Known absence of observed work. */
72
+ declare const emptyRunTotals: () => RunTotals;
73
+ /** No accounting evidence, including legacy child reports. This is not known zero spend. */
74
+ declare const unknownRunTotals: () => RunTotals;
75
+ declare const ModelUsageGroup_base: Schema.Class<ModelUsageGroup, Schema.Struct<{
76
+ readonly provider: Schema.NonEmptyString;
77
+ readonly model: Schema.NonEmptyString;
78
+ /** Actual returned model; absent when only the configured binding is known. */
79
+ readonly responseModel: Schema.optionalKey<Schema.NonEmptyString>;
80
+ readonly serviceTier: Schema.optionalKey<Schema.NonEmptyString>;
81
+ readonly pricingVersion: Schema.optionalKey<Schema.NonEmptyString>;
82
+ readonly modelCalls: Schema.Natural;
83
+ readonly inputTokens: typeof InputTokenUsage;
84
+ readonly outputTokens: typeof OutputTokenUsage;
85
+ readonly costMicrousd: Schema.Natural;
86
+ }>, {}>;
87
+ /** Settlement-sized aggregate for calls sharing one pricing identity. */
88
+ declare class ModelUsageGroup extends ModelUsageGroup_base {}
89
+ declare const RunUsageSummary_base: Schema.Class<RunUsageSummary, Schema.Struct<{
90
+ readonly modelCalls: Schema.Natural;
91
+ readonly inputTokens: typeof InputTokenUsage;
92
+ readonly outputTokens: typeof OutputTokenUsage;
93
+ readonly costMicrousd: Schema.Natural;
94
+ readonly byModel: Schema.$Array<typeof ModelUsageGroup>;
95
+ /** Coverage of recorded calls only; interruptions can make the Run less complete. */
96
+ readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
97
+ readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
98
+ /** Observed invocations without retained accounting, excluded from numeric call/token totals. */
99
+ readonly unobservedModelCalls: Schema.optionalKey<Schema.Natural>;
100
+ }>, {}>;
101
+ /** Settlement aggregate included with a terminal Run settlement. */
102
+ declare class RunUsageSummary extends RunUsageSummary_base {}
103
+ declare const UsageAggregationError_base: Schema.Class<UsageAggregationError, Schema.TaggedStruct<"UsageAggregationError", {
104
+ readonly field: Schema.NonEmptyString;
105
+ readonly message: Schema.String;
106
+ }>, import("effect/Cause").YieldableError>;
107
+ /** Canonical usage could not be aggregated without exceeding safe-integer accounting. */
108
+ declare class UsageAggregationError extends UsageAggregationError_base {}
109
+ /** Combine disjoint totals, retaining uncertainty and rejecting numeric overflow. */
110
+ declare const sumRunTotals: (contributions: readonly RunTotals[]) => Effect.Effect<RunTotals, UsageAggregationError, never>;
111
+ /** Flatten a canonical settlement summary without discarding its coverage markers. */
112
+ declare const runTotalsFromSummary: (summary: RunUsageSummary) => RunTotals;
113
+ /**
114
+ * Deterministically aggregate canonical per-call usage without making cached tokens free.
115
+ * A validated seed retains earlier call totals and pricing groups without retaining those calls.
116
+ * Empty contributions do not change completeness; the seed is never mutated.
117
+ */
118
+ declare const summarizeModelUsage: (calls: readonly ModelCallUsage[], seed?: RunUsageSummary | undefined) => Effect.Effect<RunUsageSummary, UsageAggregationError, never>;
119
+ //#endregion
120
+ export { unknownRunTotals as _, ModelUsageGroup as a, RunUsageReport as c, UsageCompleteness as d, Usage_d_exports as f, summarizeModelUsage as g, sumRunTotals as h, ModelResponseIdentity as i, RunUsageSummary as l, runTotalsFromSummary as m, InputTokenUsage as n, OutputTokenUsage as o, emptyRunTotals as p, ModelCallUsage as r, RunTotals as s, ChildRunUsage as t, UsageAggregationError as u };
121
+ //# sourceMappingURL=Usage-Dx0aknfk.d.mts.map
@@ -0,0 +1,56 @@
1
+ import { u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
2
+ import { Context, Effect, Layer, Scope, Stream } from "effect";
3
+ declare namespace WakeScheduler_d_exports {
4
+ export { WakeScheduler, WakeSubscriptionHub, makeWakeSubscriptionHub };
5
+ }
6
+ /**
7
+ * Incarnation-local, thread-keyed wake registrations. A registration is installed before
8
+ * its returned Effect can be awaited, which lets a caller subscribe, check durable authority,
9
+ * and then park without a lost-wakeup window.
10
+ */
11
+ interface WakeSubscriptionHub {
12
+ /** Register one Scope-owned waiter and return its one-shot wake Effect. */
13
+ readonly subscribe: (threadId: ThreadId) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
14
+ /** Wake every currently registered waiter for exactly this Thread. */
15
+ readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
16
+ }
17
+ /**
18
+ * Build the shared per-incarnation registration primitive used by host WakeSchedulers. The hub
19
+ * contains hints only: eviction may discard it, while a reconnecting caller re-subscribes and
20
+ * rechecks canonical storage. Scope finalizers remove cancelled waiters, and notify broadcasts
21
+ * instead of consuming a signal that belongs to another waiter.
22
+ */
23
+ declare const makeWakeSubscriptionHub: Effect.Effect<WakeSubscriptionHub>;
24
+ declare const WakeScheduler_base: Context.ServiceClass<WakeScheduler, "@effect-agent/thread/WakeScheduler", {
25
+ /** Best-effort hint that `threadId` may have claimable or settled work. Never fails. */
26
+ readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
27
+ /** Scope-owned one-shot registration for exactly one Thread. */
28
+ readonly subscribe: (threadId: ThreadId) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
29
+ /** Scope-owned subscription to wake hints, starting at subscription time. */
30
+ readonly wakes: Stream.Stream<ThreadId>;
31
+ }>;
32
+ /**
33
+ * Liveness hint channel for durable schedulers. `notify` announces that a Thread lane may
34
+ * have claimable, canonical, or settled work; `wakes` is the all-lanes subscription surface for
35
+ * workers, while `subscribe` installs an efficient one-Thread wait registration.
36
+ *
37
+ * Correctness must NEVER depend on delivery: notifications may be dropped, coalesced, duplicated,
38
+ * or observed by no subscriber (a notify before any subscription is simply lost). Every consumer
39
+ * must pair a wake with durable authority: workers use periodic SubmissionLedger scans, while a
40
+ * public progress waiter subscribes before its canonical read and reconnects/rechecks after an
41
+ * incarnation loss (persistence §14).
42
+ *
43
+ * Each run of `wakes` creates its own subscription whose resources live in that run's Scope and
44
+ * are released when the consuming stream ends or is interrupted. Implementations must not spawn
45
+ * daemon fibers.
46
+ */
47
+ declare class WakeScheduler extends WakeScheduler_base {
48
+ /**
49
+ * Discards every notification and never wakes anyone. Valid because WakeScheduler is only a
50
+ * liveness hint: consumers relying on ledger scans stay correct, merely slower.
51
+ */
52
+ static readonly layerNoop: Layer.Layer<WakeScheduler>;
53
+ }
54
+ //#endregion
55
+ export { makeWakeSubscriptionHub as i, WakeScheduler_d_exports as n, WakeSubscriptionHub as r, WakeScheduler as t };
56
+ //# sourceMappingURL=WakeScheduler-EjUF-GhC.d.mts.map
@@ -0,0 +1,271 @@
1
+ import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
2
+ import { AgentId, DelegationId, RunId, SettlementId, ThreadId, ToolCallId } from "./core/Identifiers.mjs";
3
+ import { AgentPolicy } from "./core/AgentPolicy.mjs";
4
+ import { IdempotencyKey, Receipt } from "./core/Receipt.mjs";
5
+ import { Update } from "./core/AgentUpdates.mjs";
6
+ import { o as Value } from "./FailureDiagnostic-BElLOoED.mjs";
7
+ import { SubagentExecutionFailure, SubagentGrant, WorkerOperationTool } from "./core/SubagentContract.mjs";
8
+ import { Schema } from "effect";
9
+ //#region src/core/internal/message-status.ts
10
+ /** A retained outbound delivery identity, not a destination Receipt or access grant. */
11
+ const MessageRef = Schema.Struct({
12
+ ownerThreadId: ThreadId,
13
+ messageId: IdempotencyKey
14
+ });
15
+ const Reason = Schema.NonEmptyString.check(Schema.isMaxLength(256));
16
+ const identity = { message: MessageRef };
17
+ /**
18
+ * Source-owned delivery evidence. Pending confirms retention only; accepted supplies the
19
+ * destination Receipt, and processed supplies its canonical settlement. Neither retention nor
20
+ * acceptance proves execution. Refused is a definite rejection; parked stops automatic retry
21
+ * while retaining the same identity and any acceptance evidence. Inspect instead of resending.
22
+ */
23
+ const MessageStatus = Schema.Union([
24
+ Schema.Struct({
25
+ ...identity,
26
+ status: Schema.Literal("pending"),
27
+ receipt: Schema.Null,
28
+ settlement: Schema.Null,
29
+ reason: Schema.NullOr(Reason)
30
+ }),
31
+ Schema.Struct({
32
+ ...identity,
33
+ status: Schema.Literal("accepted"),
34
+ receipt: Receipt,
35
+ settlement: Schema.Null,
36
+ reason: Schema.NullOr(Reason)
37
+ }),
38
+ Schema.Struct({
39
+ ...identity,
40
+ status: Schema.Literal("processed"),
41
+ receipt: Receipt,
42
+ settlement: Schema.Struct({
43
+ settlementId: SettlementId,
44
+ outcome: Schema.Literals([
45
+ "completed",
46
+ "failed",
47
+ "aborted"
48
+ ])
49
+ }),
50
+ reason: Schema.Null
51
+ }),
52
+ Schema.Struct({
53
+ ...identity,
54
+ status: Schema.Literal("refused"),
55
+ receipt: Schema.Null,
56
+ settlement: Schema.Null,
57
+ reason: Reason
58
+ }),
59
+ Schema.Struct({
60
+ ...identity,
61
+ status: Schema.Literal("parked"),
62
+ receipt: Schema.NullOr(Receipt),
63
+ settlement: Schema.Null,
64
+ reason: Reason
65
+ })
66
+ ]);
67
+ //#endregion
68
+ //#region src/core/Worker.ts
69
+ var Worker_exports = /* @__PURE__ */ __exportAll({
70
+ AssignmentDisposition: () => AssignmentDisposition,
71
+ AssignmentTerminal: () => AssignmentTerminal,
72
+ FrameworkMessage: () => FrameworkMessage,
73
+ WorkerAppliedInput: () => WorkerAppliedInput,
74
+ WorkerBudgetScope: () => WorkerBudgetScope,
75
+ WorkerCompletion: () => WorkerCompletion,
76
+ WorkerContext: () => WorkerContext,
77
+ WorkerError: () => WorkerError,
78
+ WorkerHistoryEntry: () => WorkerHistoryEntry,
79
+ WorkerInput: () => WorkerInput,
80
+ WorkerOperationTool: () => WorkerOperationTool,
81
+ WorkerPage: () => WorkerPage,
82
+ WorkerRef: () => WorkerRef,
83
+ WorkerReport: () => WorkerReport,
84
+ WorkerRun: () => WorkerRun,
85
+ WorkerSource: () => WorkerSource,
86
+ WorkerStarted: () => WorkerStarted,
87
+ WorkerStop: () => WorkerStop,
88
+ WorkerStopped: () => WorkerStopped,
89
+ WorkerSummary: () => WorkerSummary,
90
+ WorkerUpdate: () => WorkerUpdate
91
+ });
92
+ /** Assignment output selected through the Definition's runDisposition declaration. */
93
+ const AssignmentDisposition = Schema.Literals(["completed", "waiting"]);
94
+ /** A permanent destination outcome; an ordinary Run completion does not imply this. */
95
+ const AssignmentTerminal = Schema.Literals([
96
+ "completed",
97
+ "failed",
98
+ "cancelled"
99
+ ]);
100
+ /** A reusable child Thread, correlated with its declaration. This value grants no authority. */
101
+ const WorkerRef = Schema.Struct({
102
+ schemaVersion: Schema.Literal(1),
103
+ delegationId: DelegationId,
104
+ targetAgentId: AgentId,
105
+ threadId: ThreadId
106
+ });
107
+ /** A continuing worker identity and retained first delivery, never an execution handle. */
108
+ const WorkerStarted = Schema.Struct({
109
+ worker: WorkerRef,
110
+ delivery: MessageStatus
111
+ }).check(Schema.makeFilter(({ worker, delivery }) => delivery.receipt === null || worker.threadId === delivery.receipt.threadId));
112
+ /** Stable owner command. Reusing its key for a different worker conflicts. */
113
+ const WorkerStop = Schema.Struct({
114
+ worker: WorkerRef,
115
+ idempotencyKey: IdempotencyKey
116
+ });
117
+ /** The inbox is sealed and active execution has released ownership. External actions are not undone. */
118
+ const WorkerStopped = WorkerStop;
119
+ /** A host-authorized Run allowance is independent of the immutable delegation lineage. */
120
+ const WorkerBudgetScope = Schema.Literals(["source-subtree", "worker-run"]);
121
+ /** Host-bound caller metadata. Programmatic calls never fabricate Run or Tool Call identities. */
122
+ const WorkerSource = Schema.Union([Schema.Struct({
123
+ _tag: Schema.Literal("tool"),
124
+ agentId: AgentId,
125
+ threadId: ThreadId,
126
+ runId: RunId,
127
+ toolCallId: ToolCallId
128
+ }), Schema.Struct({
129
+ _tag: Schema.Literal("programmatic"),
130
+ agentId: AgentId,
131
+ threadId: ThreadId
132
+ })]);
133
+ /** The caller's effective policy and root-relative depth, resolved by its host. */
134
+ const WorkerContext = Schema.Struct({
135
+ source: WorkerSource,
136
+ policy: AgentPolicy,
137
+ depth: Schema.Natural,
138
+ grant: Schema.optionalKey(SubagentGrant)
139
+ });
140
+ /** Admission identity is distinct from canonical input application. */
141
+ const WorkerInput = Schema.Struct({
142
+ receipt: Receipt,
143
+ messageId: IdempotencyKey
144
+ });
145
+ const WorkerAppliedInput = Schema.Struct({
146
+ ...WorkerInput.fields,
147
+ runId: RunId,
148
+ sequence: Schema.Natural
149
+ });
150
+ /** A Run outcome is not assignment completion. Interpret only a Definition's disposition. */
151
+ const WorkerRun = Schema.Struct({
152
+ runId: RunId,
153
+ hostReceipt: Receipt,
154
+ outcome: Schema.NullOr(Schema.Literals([
155
+ "completed",
156
+ "failed",
157
+ "aborted"
158
+ ])),
159
+ disposition: Schema.NullOr(Schema.Json)
160
+ });
161
+ /** Bounded durable listing data; a latest Receipt never substitutes for a requested Receipt. */
162
+ const WorkerSummary = Schema.Struct({
163
+ worker: WorkerRef,
164
+ latestReceipt: Schema.NullOr(Receipt),
165
+ /** stopping/stopped identify an owner-issued worker stop, never an ordinary Receipt abort. */
166
+ state: Schema.Literals([
167
+ "starting",
168
+ "active",
169
+ "idle",
170
+ "stopping",
171
+ "stopped",
172
+ "completed",
173
+ "failed",
174
+ "cancelled"
175
+ ]),
176
+ acceptedInput: Schema.NullOr(WorkerInput),
177
+ appliedInput: Schema.NullOr(WorkerAppliedInput),
178
+ run: Schema.NullOr(WorkerRun),
179
+ /** One retained unadmitted input, if any; its state is independent of destination execution. */
180
+ pendingDelivery: Schema.NullOr(MessageStatus),
181
+ /** Consistent destination facts; pending delivery has its own source-owned version. */
182
+ watermark: Schema.Struct({
183
+ canonicalSequence: Schema.Natural,
184
+ acceptedQueueSequence: Schema.Natural,
185
+ pendingDeliveryVersion: Schema.NullOr(Schema.Natural)
186
+ })
187
+ });
188
+ const WorkerPage = Schema.Struct({
189
+ items: Schema.Array(WorkerSummary).check(Schema.isMaxLength(100)),
190
+ next: Schema.NullOr(ThreadId)
191
+ });
192
+ /** Authorized canonical history, encoded independently of storage-adapter representations. */
193
+ const WorkerHistoryEntry = Schema.Struct({
194
+ sequence: Schema.Natural.check(Schema.isGreaterThan(0)),
195
+ recordId: Schema.NonEmptyString.check(Schema.isMaxLength(1024)),
196
+ record: Schema.Json
197
+ });
198
+ /**
199
+ * Closed host-boundary failures. Original causes stay private and survive diagnostic transport.
200
+ * Retained delivery states are successful MessageStatus values, including pending and refused.
201
+ * After a storage failure, keep the same idempotency key and parameters when reconciling.
202
+ */
203
+ var WorkerError = class extends Schema.TaggedError()("WorkerError", {
204
+ cause: Schema.optionalKey(Value),
205
+ stack: Schema.optionalKey(Schema.String),
206
+ /** Concurrency pressure may clear without changing the request. */
207
+ retryable: Schema.optionalKey(Schema.Literal(true)),
208
+ operation: Schema.Literals([
209
+ "context",
210
+ "start",
211
+ "followUp",
212
+ "inspect",
213
+ "observe",
214
+ "await",
215
+ "list",
216
+ "cancel",
217
+ "stop"
218
+ ]),
219
+ reason: Schema.Literals([
220
+ "denied",
221
+ "declaration-unavailable",
222
+ "worker-mismatch",
223
+ "receipt-mismatch",
224
+ "message-mismatch",
225
+ "idempotency-conflict",
226
+ "capacity",
227
+ "not-found",
228
+ "delivery-pending",
229
+ "storage",
230
+ "corrupt",
231
+ "unavailable"
232
+ ])
233
+ }) {};
234
+ /** One projected canonical Run outcome. Joined receipts share this identity. */
235
+ const WorkerReport = (success) => {
236
+ const identity = {
237
+ _tag: Schema.Literal("Settled"),
238
+ worker: WorkerRef,
239
+ receipt: Receipt,
240
+ runId: RunId,
241
+ settlementId: SettlementId
242
+ };
243
+ return Schema.Union([Schema.Struct({
244
+ ...identity,
245
+ outcome: Schema.Literal("completed"),
246
+ result: Schema.Union([success])
247
+ }), Schema.Struct({
248
+ ...identity,
249
+ outcome: Schema.Literals(["failed", "aborted"]),
250
+ failure: SubagentExecutionFailure
251
+ })]);
252
+ };
253
+ /** Framework message stored separately from the parent's application input. */
254
+ const WorkerCompletion = Schema.Struct({
255
+ _tag: Schema.Literal("WorkerCompletion"),
256
+ budgetExhausted: Schema.Boolean,
257
+ schemaVersion: Schema.Literal(1),
258
+ report: WorkerReport(Schema.Json)
259
+ }).check(Schema.makeFilter(({ report }) => report.worker.threadId === report.receipt.threadId));
260
+ /** Source-worker intermediate output, kept separate from application input. */
261
+ const WorkerUpdate = Schema.Struct({
262
+ _tag: Schema.Literal("WorkerUpdate"),
263
+ schemaVersion: Schema.Literal(1),
264
+ worker: WorkerRef,
265
+ update: Update
266
+ }).check(Schema.makeFilter(({ worker, update }) => worker.threadId === update.threadId && worker.targetAgentId === update.agentId));
267
+ const FrameworkMessage = Schema.Union([WorkerCompletion, WorkerUpdate]);
268
+ //#endregion
269
+ export { MessageStatus as C, MessageRef as S, WorkerStop as _, WorkerBudgetScope as a, WorkerUpdate as b, WorkerError as c, WorkerPage as d, WorkerRef as f, WorkerStarted as g, WorkerSource as h, WorkerAppliedInput as i, WorkerHistoryEntry as l, WorkerRun as m, AssignmentTerminal as n, WorkerCompletion as o, WorkerReport as p, FrameworkMessage as r, WorkerContext as s, AssignmentDisposition as t, WorkerInput as u, WorkerStopped as v, Worker_exports as x, WorkerSummary as y };
270
+
271
+ //# sourceMappingURL=Worker-CfwzMZEK.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Worker-CfwzMZEK.mjs","names":["FailureDiagnostic.Value"],"sources":["../src/core/internal/message-status.ts","../src/core/Worker.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { SettlementId, ThreadId } from \"../Identifiers.ts\";\nimport { IdempotencyKey, Receipt } from \"../Receipt.ts\";\n\n/** A retained outbound delivery identity, not a destination Receipt or access grant. */\nexport const MessageRef = Schema.Struct({ ownerThreadId: ThreadId, messageId: IdempotencyKey });\nexport type MessageRef = typeof MessageRef.Type;\n\nconst Reason = Schema.NonEmptyString.check(Schema.isMaxLength(256));\nconst identity = { message: MessageRef };\n\n/**\n * Source-owned delivery evidence. Pending confirms retention only; accepted supplies the\n * destination Receipt, and processed supplies its canonical settlement. Neither retention nor\n * acceptance proves execution. Refused is a definite rejection; parked stops automatic retry\n * while retaining the same identity and any acceptance evidence. Inspect instead of resending.\n */\nexport const MessageStatus = Schema.Union([\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"pending\"),\n receipt: Schema.Null,\n settlement: Schema.Null,\n reason: Schema.NullOr(Reason),\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"accepted\"),\n receipt: Receipt,\n settlement: Schema.Null,\n reason: Schema.NullOr(Reason),\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"processed\"),\n receipt: Receipt,\n settlement: Schema.Struct({\n settlementId: SettlementId,\n outcome: Schema.Literals([\"completed\", \"failed\", \"aborted\"]),\n }),\n reason: Schema.Null,\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"refused\"),\n receipt: Schema.Null,\n settlement: Schema.Null,\n reason: Reason,\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"parked\"),\n receipt: Schema.NullOr(Receipt),\n settlement: Schema.Null,\n reason: Reason,\n }),\n]);\n\nexport type MessageStatus = typeof MessageStatus.Type;\n","import { Schema } from \"effect\";\n\nimport { AgentPolicy } from \"./AgentPolicy.ts\";\nimport { Update } from \"./AgentUpdates.ts\";\nimport * as FailureDiagnostic from \"./FailureDiagnostic.ts\";\nimport { AgentId, DelegationId, RunId, SettlementId, ThreadId, ToolCallId } from \"./Identifiers.ts\";\nimport { MessageStatus } from \"./internal/message-status.ts\";\nimport { IdempotencyKey, Receipt } from \"./Receipt.ts\";\nimport { SubagentExecutionFailure, SubagentGrant } from \"./SubagentContract.ts\";\n\n/** Assignment output selected through the Definition's runDisposition declaration. */\nexport const AssignmentDisposition = Schema.Literals([\"completed\", \"waiting\"]);\nexport type AssignmentDisposition = typeof AssignmentDisposition.Type;\n\n/** A permanent destination outcome; an ordinary Run completion does not imply this. */\nexport const AssignmentTerminal = Schema.Literals([\"completed\", \"failed\", \"cancelled\"]);\nexport type AssignmentTerminal = typeof AssignmentTerminal.Type;\n\n/** A reusable child Thread, correlated with its declaration. This value grants no authority. */\nexport const WorkerRef = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n delegationId: DelegationId,\n targetAgentId: AgentId,\n threadId: ThreadId,\n});\n\nexport type WorkerRef = typeof WorkerRef.Type;\n\n/** A continuing worker identity and retained first delivery, never an execution handle. */\nexport const WorkerStarted = Schema.Struct({\n worker: WorkerRef,\n delivery: MessageStatus,\n}).check(\n Schema.makeFilter(\n ({ worker, delivery }) =>\n delivery.receipt === null || worker.threadId === delivery.receipt.threadId,\n ),\n);\n\nexport type WorkerStarted = typeof WorkerStarted.Type;\n\n/** Stable owner command. Reusing its key for a different worker conflicts. */\nexport const WorkerStop = Schema.Struct({ worker: WorkerRef, idempotencyKey: IdempotencyKey });\nexport type WorkerStop = typeof WorkerStop.Type;\n\n/** The inbox is sealed and active execution has released ownership. External actions are not undone. */\nexport const WorkerStopped = WorkerStop;\nexport type WorkerStopped = typeof WorkerStopped.Type;\n\n/** A host-authorized Run allowance is independent of the immutable delegation lineage. */\nexport const WorkerBudgetScope = Schema.Literals([\"source-subtree\", \"worker-run\"]);\nexport type WorkerBudgetScope = typeof WorkerBudgetScope.Type;\n\n/** Host-bound caller metadata. Programmatic calls never fabricate Run or Tool Call identities. */\nexport const WorkerSource = Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal(\"tool\"),\n agentId: AgentId,\n threadId: ThreadId,\n runId: RunId,\n toolCallId: ToolCallId,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"programmatic\"),\n agentId: AgentId,\n threadId: ThreadId,\n }),\n]);\n\nexport type WorkerSource = typeof WorkerSource.Type;\n\n/** The caller's effective policy and root-relative depth, resolved by its host. */\nexport const WorkerContext = Schema.Struct({\n source: WorkerSource,\n policy: AgentPolicy,\n depth: Schema.Natural,\n grant: Schema.optionalKey(SubagentGrant),\n});\n\nexport type WorkerContext = typeof WorkerContext.Type;\n\n/** Admission identity is distinct from canonical input application. */\nexport const WorkerInput = Schema.Struct({ receipt: Receipt, messageId: IdempotencyKey });\nexport type WorkerInput = typeof WorkerInput.Type;\n\nexport const WorkerAppliedInput = Schema.Struct({\n ...WorkerInput.fields,\n runId: RunId,\n sequence: Schema.Natural,\n});\n\n/** A Run outcome is not assignment completion. Interpret only a Definition's disposition. */\nexport const WorkerRun = Schema.Struct({\n runId: RunId,\n hostReceipt: Receipt,\n outcome: Schema.NullOr(Schema.Literals([\"completed\", \"failed\", \"aborted\"])),\n disposition: Schema.NullOr(Schema.Json),\n});\n\n/** Bounded durable listing data; a latest Receipt never substitutes for a requested Receipt. */\nexport const WorkerSummary = Schema.Struct({\n worker: WorkerRef,\n latestReceipt: Schema.NullOr(Receipt),\n /** stopping/stopped identify an owner-issued worker stop, never an ordinary Receipt abort. */\n state: Schema.Literals([\n \"starting\",\n \"active\",\n \"idle\",\n \"stopping\",\n \"stopped\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n ]),\n acceptedInput: Schema.NullOr(WorkerInput),\n appliedInput: Schema.NullOr(WorkerAppliedInput),\n run: Schema.NullOr(WorkerRun),\n /** One retained unadmitted input, if any; its state is independent of destination execution. */\n pendingDelivery: Schema.NullOr(MessageStatus),\n /** Consistent destination facts; pending delivery has its own source-owned version. */\n watermark: Schema.Struct({\n canonicalSequence: Schema.Natural,\n acceptedQueueSequence: Schema.Natural,\n pendingDeliveryVersion: Schema.NullOr(Schema.Natural),\n }),\n});\n\nexport type WorkerSummary = typeof WorkerSummary.Type;\n\nexport const WorkerPage = Schema.Struct({\n items: Schema.Array(WorkerSummary).check(Schema.isMaxLength(100)),\n next: Schema.NullOr(ThreadId),\n});\n\nexport type WorkerPage = typeof WorkerPage.Type;\n\n/** Authorized canonical history, encoded independently of storage-adapter representations. */\nexport const WorkerHistoryEntry = Schema.Struct({\n sequence: Schema.Natural.check(Schema.isGreaterThan(0)),\n recordId: Schema.NonEmptyString.check(Schema.isMaxLength(1_024)),\n record: Schema.Json,\n});\n\nexport type WorkerHistoryEntry = typeof WorkerHistoryEntry.Type;\n\n/**\n * Closed host-boundary failures. Original causes stay private and survive diagnostic transport.\n * Retained delivery states are successful MessageStatus values, including pending and refused.\n * After a storage failure, keep the same idempotency key and parameters when reconciling.\n */\nexport class WorkerError extends Schema.TaggedError<WorkerError>()(\"WorkerError\", {\n cause: Schema.optionalKey(FailureDiagnostic.Value),\n stack: Schema.optionalKey(Schema.String),\n /** Concurrency pressure may clear without changing the request. */\n retryable: Schema.optionalKey(Schema.Literal(true)),\n operation: Schema.Literals([\n \"context\",\n \"start\",\n \"followUp\",\n \"inspect\",\n \"observe\",\n \"await\",\n \"list\",\n \"cancel\",\n \"stop\",\n ]),\n reason: Schema.Literals([\n \"denied\",\n \"declaration-unavailable\",\n \"worker-mismatch\",\n \"receipt-mismatch\",\n \"message-mismatch\",\n \"idempotency-conflict\",\n \"capacity\",\n \"not-found\",\n // Decode earlier failures without emitting them for retained deliveries.\n \"delivery-pending\",\n \"storage\",\n \"corrupt\",\n \"unavailable\",\n ]),\n}) {}\n\nexport { WorkerOperationTool } from \"./SubagentContract.ts\";\n\n/** One projected canonical Run outcome. Joined receipts share this identity. */\nexport const WorkerReport = <Success extends Schema.Top>(success: Success) => {\n const identity = {\n _tag: Schema.Literal(\"Settled\"),\n worker: WorkerRef,\n receipt: Receipt,\n runId: RunId,\n settlementId: SettlementId,\n };\n\n return Schema.Union([\n // Union preserves the Success codec while making the result field required.\n Schema.Struct({\n ...identity,\n outcome: Schema.Literal(\"completed\"),\n result: Schema.Union([success]),\n }),\n Schema.Struct({\n ...identity,\n outcome: Schema.Literals([\"failed\", \"aborted\"]),\n failure: SubagentExecutionFailure,\n }),\n ]);\n};\n\nexport type WorkerReport<Success extends Schema.Top> = ReturnType<\n typeof WorkerReport<Success>\n>[\"Type\"];\n\n/** Framework message stored separately from the parent's application input. */\nexport const WorkerCompletion = Schema.Struct({\n _tag: Schema.Literal(\"WorkerCompletion\"),\n budgetExhausted: Schema.Boolean,\n schemaVersion: Schema.Literal(1),\n report: WorkerReport(Schema.Json),\n}).check(Schema.makeFilter(({ report }) => report.worker.threadId === report.receipt.threadId));\n\nexport type WorkerCompletion = typeof WorkerCompletion.Type;\n\n/** Source-worker intermediate output, kept separate from application input. */\nexport const WorkerUpdate = Schema.Struct({\n _tag: Schema.Literal(\"WorkerUpdate\"),\n schemaVersion: Schema.Literal(1),\n worker: WorkerRef,\n update: Update,\n}).check(\n Schema.makeFilter(\n ({ worker, update }) =>\n worker.threadId === update.threadId && worker.targetAgentId === update.agentId,\n ),\n);\n\nexport type WorkerUpdate = typeof WorkerUpdate.Type;\nexport const FrameworkMessage = Schema.Union([WorkerCompletion, WorkerUpdate]);\nexport type FrameworkMessage = typeof FrameworkMessage.Type;\n"],"mappings":"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"}