effect-agent 0.1.0-beta.85 → 0.1.0-beta.87

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 (751) hide show
  1. package/dist/Agent-CN0EWRsR.d.mts +226 -0
  2. package/dist/Agent-RklVROrm.mjs +83 -0
  3. package/dist/Agent-RklVROrm.mjs.map +1 -0
  4. package/dist/AgentError-CggcAQ7V.d.mts +101 -0
  5. package/dist/AgentPolicy-CetmQrf3.d.mts +96 -0
  6. package/dist/AgentRuntime-BLyETCPo.mjs +4562 -0
  7. package/dist/AgentRuntime-BLyETCPo.mjs.map +1 -0
  8. package/dist/AgentRuntime-uxR_a4VM.d.mts +346 -0
  9. package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
  10. package/dist/ContextCompactor-Dxu5zhOL.d.mts +161 -0
  11. package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
  12. package/dist/DurableAgentRuntime-uggeJpv3.mjs +6368 -0
  13. package/dist/DurableAgentRuntime-uggeJpv3.mjs.map +1 -0
  14. package/dist/DurableFailpoint-Oinuuedm.d.mts +41 -0
  15. package/dist/DurableStep-Cry_iol4.d.mts +103 -0
  16. package/dist/Ephemeral.d.mts +22 -0
  17. package/dist/Ephemeral.mjs +22 -0
  18. package/dist/Ephemeral.mjs.map +1 -0
  19. package/dist/EventSource-OqS_P9ug.d.mts +51 -0
  20. package/dist/Identifiers-CN2s30fF.d.mts +40 -0
  21. package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
  22. package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
  23. package/dist/Messaging-CkcIdt4I.d.mts +490 -0
  24. package/dist/MessagingHost-CRk0kXzT.d.mts +246 -0
  25. package/dist/MessagingHost-CWi_PP3g.mjs +137 -0
  26. package/dist/MessagingHost-CWi_PP3g.mjs.map +1 -0
  27. package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
  28. package/dist/Output-D6SkedVx.d.mts +25 -0
  29. package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
  30. package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
  31. package/dist/PreparedInputAdmission-C4HbjHgl.d.mts +38 -0
  32. package/dist/Receipt-BAHyigAF.d.mts +33 -0
  33. package/dist/Records-BAGkekt8.d.mts +3570 -0
  34. package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
  35. package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
  36. package/dist/RunJournal-Cgg1kNvc.mjs +825 -0
  37. package/dist/RunJournal-Cgg1kNvc.mjs.map +1 -0
  38. package/dist/RunOptions-g1aigcKI.d.mts +915 -0
  39. package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
  40. package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
  41. package/dist/Schedule-H3SEYX9g.d.mts +842 -0
  42. package/dist/Scheduling-C9aIP8zT.mjs +691 -0
  43. package/dist/Scheduling-C9aIP8zT.mjs.map +1 -0
  44. package/dist/Subagent-Cy_hU1tv.mjs +1469 -0
  45. package/dist/Subagent-Cy_hU1tv.mjs.map +1 -0
  46. package/dist/Subagent-DyfzHNdv.d.mts +826 -0
  47. package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
  48. package/dist/SubagentHost-CJUBQlcc.d.mts +140 -0
  49. package/dist/Subscription-BEP8oQO5.d.mts +921 -0
  50. package/dist/SubscriptionInput-vAAOBrK7.d.mts +41 -0
  51. package/dist/Thread-DOBQ0QUY.d.mts +96 -0
  52. package/dist/ThreadHistory-tS1KwxHR.d.mts +60 -0
  53. package/dist/ToolBroker-DWs4tZra.d.mts +133 -0
  54. package/dist/ToolExposure-9uF_Yo0T.mjs +10 -0
  55. package/dist/ToolExposure-9uF_Yo0T.mjs.map +1 -0
  56. package/dist/ToolExposure-C93U1sPu.mjs +30 -0
  57. package/dist/ToolExposure-C93U1sPu.mjs.map +1 -0
  58. package/dist/ToolExposure-UCN12eCd.d.mts +39 -0
  59. package/dist/ToolExposure-r2eOWk4F.d.mts +46 -0
  60. package/dist/ToolExposure.d.mts +6 -5
  61. package/dist/ToolExposure.mjs +17 -9
  62. package/dist/ToolExposure.mjs.map +1 -1
  63. package/dist/ToolReconciler-DQVaJfpE.d.mts +76 -0
  64. package/dist/ToolResult-DmmgoChv.d.mts +61 -0
  65. package/dist/Usage-Dx0aknfk.d.mts +121 -0
  66. package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
  67. package/dist/Worker-CaPYykpe.d.mts +228 -0
  68. package/dist/agent-registration-CWDMOAZA.mjs +172 -0
  69. package/dist/agent-registration-CWDMOAZA.mjs.map +1 -0
  70. package/dist/capabilities/Approval.d.mts +114 -0
  71. package/dist/capabilities/Approval.mjs +226 -0
  72. package/dist/capabilities/Approval.mjs.map +1 -0
  73. package/dist/capabilities/Budget.d.mts +112 -0
  74. package/dist/capabilities/Budget.mjs +346 -0
  75. package/dist/capabilities/Budget.mjs.map +1 -0
  76. package/dist/capabilities/CodeMode.d.mts +157 -0
  77. package/dist/capabilities/CodeMode.mjs +522 -0
  78. package/dist/capabilities/CodeMode.mjs.map +1 -0
  79. package/dist/capabilities/Commands.d.mts +55 -0
  80. package/dist/capabilities/Commands.mjs +57 -0
  81. package/dist/capabilities/Commands.mjs.map +1 -0
  82. package/dist/capabilities/ContextTools.d.mts +321 -0
  83. package/dist/capabilities/ContextTools.mjs +126 -0
  84. package/dist/capabilities/ContextTools.mjs.map +1 -0
  85. package/dist/capabilities/Mcp.d.mts +108 -0
  86. package/dist/capabilities/Mcp.mjs +260 -0
  87. package/dist/capabilities/Mcp.mjs.map +1 -0
  88. package/dist/capabilities/McpClient.d.mts +115 -0
  89. package/dist/capabilities/McpClient.mjs +506 -0
  90. package/dist/capabilities/McpClient.mjs.map +1 -0
  91. package/dist/capabilities/MemoryNotes.d.mts +424 -0
  92. package/dist/capabilities/MemoryNotes.mjs +128 -0
  93. package/dist/capabilities/MemoryNotes.mjs.map +1 -0
  94. package/dist/capabilities/Messaging.d.mts +3 -0
  95. package/dist/capabilities/Messaging.mjs +151 -0
  96. package/dist/capabilities/Messaging.mjs.map +1 -0
  97. package/dist/capabilities/ModelContext.d.mts +89 -0
  98. package/dist/capabilities/ModelContext.mjs +168 -0
  99. package/dist/capabilities/ModelContext.mjs.map +1 -0
  100. package/dist/capabilities/Redaction.d.mts +37 -0
  101. package/dist/capabilities/Redaction.mjs +104 -0
  102. package/dist/capabilities/Redaction.mjs.map +1 -0
  103. package/dist/capabilities/Remembering.d.mts +434 -0
  104. package/dist/capabilities/Remembering.mjs +290 -0
  105. package/dist/capabilities/Remembering.mjs.map +1 -0
  106. package/dist/capabilities/RunHooks.d.mts +82 -0
  107. package/dist/capabilities/RunHooks.mjs +144 -0
  108. package/dist/capabilities/RunHooks.mjs.map +1 -0
  109. package/dist/capabilities/SemanticMemory.d.mts +431 -0
  110. package/dist/capabilities/SemanticMemory.mjs +315 -0
  111. package/dist/capabilities/SemanticMemory.mjs.map +1 -0
  112. package/dist/capabilities/Subagent.d.mts +4 -0
  113. package/dist/capabilities/Subagent.mjs +5 -0
  114. package/dist/capabilities/SubagentReservations.d.mts +186 -0
  115. package/dist/capabilities/SubagentReservations.mjs +479 -0
  116. package/dist/capabilities/SubagentReservations.mjs.map +1 -0
  117. package/dist/capabilities/ToolDiscovery.d.mts +109 -0
  118. package/dist/capabilities/ToolDiscovery.mjs +211 -0
  119. package/dist/capabilities/ToolDiscovery.mjs.map +1 -0
  120. package/dist/capabilities/WebCapture.d.mts +163 -0
  121. package/dist/capabilities/WebCapture.mjs +335 -0
  122. package/dist/capabilities/WebCapture.mjs.map +1 -0
  123. package/dist/capabilities/WebSearch.d.mts +71 -0
  124. package/dist/capabilities/WebSearch.mjs +112 -0
  125. package/dist/capabilities/WebSearch.mjs.map +1 -0
  126. package/dist/compaction-C2OTceKw.mjs +505 -0
  127. package/dist/compaction-C2OTceKw.mjs.map +1 -0
  128. package/dist/core/Agent.d.mts +2 -0
  129. package/dist/core/Agent.mjs +2 -0
  130. package/dist/core/AgentError.d.mts +2 -0
  131. package/dist/core/AgentError.mjs +117 -0
  132. package/dist/core/AgentError.mjs.map +1 -0
  133. package/dist/core/AgentPolicy.d.mts +2 -0
  134. package/dist/core/AgentPolicy.mjs +94 -0
  135. package/dist/core/AgentPolicy.mjs.map +1 -0
  136. package/dist/core/AgentUpdates.d.mts +2 -0
  137. package/dist/core/AgentUpdates.mjs +63 -0
  138. package/dist/core/AgentUpdates.mjs.map +1 -0
  139. package/dist/core/IdGenerator.d.mts +26 -0
  140. package/dist/core/IdGenerator.mjs +27 -0
  141. package/dist/core/IdGenerator.mjs.map +1 -0
  142. package/dist/core/Identifiers.d.mts +2 -0
  143. package/dist/core/Identifiers.mjs +43 -0
  144. package/dist/core/Identifiers.mjs.map +1 -0
  145. package/dist/core/Memory.d.mts +57 -0
  146. package/dist/core/Memory.mjs +203 -0
  147. package/dist/core/Memory.mjs.map +1 -0
  148. package/dist/core/MemoryNamespace.d.mts +2 -0
  149. package/dist/core/MemoryNamespace.mjs +116 -0
  150. package/dist/core/MemoryNamespace.mjs.map +1 -0
  151. package/dist/core/MemoryReference.d.mts +2 -0
  152. package/dist/core/MemoryReference.mjs +109 -0
  153. package/dist/core/MemoryReference.mjs.map +1 -0
  154. package/dist/core/MemoryRevalidation.d.mts +65 -0
  155. package/dist/core/MemoryRevalidation.mjs +126 -0
  156. package/dist/core/MemoryRevalidation.mjs.map +1 -0
  157. package/dist/core/MemoryStore.d.mts +186 -0
  158. package/dist/core/MemoryStore.mjs +243 -0
  159. package/dist/core/MemoryStore.mjs.map +1 -0
  160. package/dist/core/Receipt.d.mts +2 -0
  161. package/dist/core/Receipt.mjs +36 -0
  162. package/dist/core/Receipt.mjs.map +1 -0
  163. package/dist/core/RememberingStore.d.mts +1562 -0
  164. package/dist/core/RememberingStore.mjs +190 -0
  165. package/dist/core/RememberingStore.mjs.map +1 -0
  166. package/dist/core/RunEvent.d.mts +2 -0
  167. package/dist/core/RunEvent.mjs +337 -0
  168. package/dist/core/RunEvent.mjs.map +1 -0
  169. package/dist/core/RunPolicyUsage.d.mts +2 -0
  170. package/dist/core/RunPolicyUsage.mjs +21 -0
  171. package/dist/core/RunPolicyUsage.mjs.map +1 -0
  172. package/dist/core/SemanticMemoryIndex.d.mts +826 -0
  173. package/dist/core/SemanticMemoryIndex.mjs +185 -0
  174. package/dist/core/SemanticMemoryIndex.mjs.map +1 -0
  175. package/dist/core/SemanticMemoryRevalidation.d.mts +45 -0
  176. package/dist/core/SemanticMemoryRevalidation.mjs +191 -0
  177. package/dist/core/SemanticMemoryRevalidation.mjs.map +1 -0
  178. package/dist/core/SubagentContract.d.mts +2 -0
  179. package/dist/core/SubagentContract.mjs +148 -0
  180. package/dist/core/SubagentContract.mjs.map +1 -0
  181. package/dist/core/Thread.d.mts +2 -0
  182. package/dist/core/Thread.mjs +250 -0
  183. package/dist/core/Thread.mjs.map +1 -0
  184. package/dist/core/ToolResult.d.mts +2 -0
  185. package/dist/core/ToolResult.mjs +140 -0
  186. package/dist/core/ToolResult.mjs.map +1 -0
  187. package/dist/core/Usage.d.mts +2 -0
  188. package/dist/core/Usage.mjs +319 -0
  189. package/dist/core/Usage.mjs.map +1 -0
  190. package/dist/core/Worker.d.mts +3 -0
  191. package/dist/core/Worker.mjs +147 -0
  192. package/dist/core/Worker.mjs.map +1 -0
  193. package/dist/durable/ActivityStore.d.mts +116 -0
  194. package/dist/durable/ActivityStore.mjs +131 -0
  195. package/dist/durable/ActivityStore.mjs.map +1 -0
  196. package/dist/durable/Admin.d.mts +2 -0
  197. package/dist/durable/Admin.mjs +328 -0
  198. package/dist/durable/Admin.mjs.map +1 -0
  199. package/dist/durable/AgentRegistration.d.mts +2 -0
  200. package/dist/durable/AgentRegistration.mjs +14 -0
  201. package/dist/durable/AgentRegistration.mjs.map +1 -0
  202. package/dist/durable/Certification.d.mts +111 -0
  203. package/dist/durable/Certification.mjs +159 -0
  204. package/dist/durable/Certification.mjs.map +1 -0
  205. package/dist/durable/CommittedActivity.d.mts +62 -0
  206. package/dist/durable/CommittedActivity.mjs +159 -0
  207. package/dist/durable/CommittedActivity.mjs.map +1 -0
  208. package/dist/durable/Digest.d.mts +2 -0
  209. package/dist/durable/Digest.mjs +50 -0
  210. package/dist/durable/Digest.mjs.map +1 -0
  211. package/dist/durable/DurableAgentRuntime.d.mts +3 -0
  212. package/dist/durable/DurableAgentRuntime.mjs +3 -0
  213. package/dist/durable/DurableFailpoint.d.mts +2 -0
  214. package/dist/durable/DurableFailpoint.mjs +94 -0
  215. package/dist/durable/DurableFailpoint.mjs.map +1 -0
  216. package/dist/durable/DurableFailpointTestControl.d.mts +15 -0
  217. package/dist/durable/DurableFailpointTestControl.mjs +19 -0
  218. package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
  219. package/dist/durable/EventSource.d.mts +2 -0
  220. package/dist/durable/EventSource.mjs +65 -0
  221. package/dist/durable/EventSource.mjs.map +1 -0
  222. package/dist/durable/GitHubWorkflowSource.d.mts +144 -0
  223. package/dist/durable/GitHubWorkflowSource.mjs +209 -0
  224. package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
  225. package/dist/durable/MessageDelivery.d.mts +492 -0
  226. package/dist/durable/MessageDelivery.mjs +495 -0
  227. package/dist/durable/MessageDelivery.mjs.map +1 -0
  228. package/dist/durable/MessageDeliveryStoreConformance.d.mts +358 -0
  229. package/dist/durable/MessageDeliveryStoreConformance.mjs +243 -0
  230. package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
  231. package/dist/durable/OperationAuthorizer.d.mts +2 -0
  232. package/dist/durable/OperationAuthorizer.mjs +70 -0
  233. package/dist/durable/OperationAuthorizer.mjs.map +1 -0
  234. package/dist/durable/PersistentHistory.d.mts +16 -0
  235. package/dist/durable/PersistentHistory.mjs +125 -0
  236. package/dist/durable/PersistentHistory.mjs.map +1 -0
  237. package/dist/durable/PreparedInputAdmission.d.mts +2 -0
  238. package/dist/durable/PreparedInputAdmission.mjs +34 -0
  239. package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
  240. package/dist/durable/Records.d.mts +2 -0
  241. package/dist/durable/Records.mjs +795 -0
  242. package/dist/durable/Records.mjs.map +1 -0
  243. package/dist/durable/Recovery.d.mts +2 -0
  244. package/dist/durable/Recovery.mjs +739 -0
  245. package/dist/durable/Recovery.mjs.map +1 -0
  246. package/dist/durable/RunJournal.d.mts +2 -0
  247. package/dist/durable/RunJournal.mjs +2 -0
  248. package/dist/durable/Schedule.d.mts +2 -0
  249. package/dist/durable/Schedule.mjs +382 -0
  250. package/dist/durable/Schedule.mjs.map +1 -0
  251. package/dist/durable/ScheduleStoreConformance.d.mts +18 -0
  252. package/dist/durable/ScheduleStoreConformance.mjs +420 -0
  253. package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
  254. package/dist/durable/ScheduleTransition.d.mts +24 -0
  255. package/dist/durable/ScheduleTransition.mjs +180 -0
  256. package/dist/durable/ScheduleTransition.mjs.map +1 -0
  257. package/dist/durable/Scheduling.d.mts +54 -0
  258. package/dist/durable/Scheduling.mjs +2 -0
  259. package/dist/durable/SqlMemoryStore.d.mts +30 -0
  260. package/dist/durable/SqlMemoryStore.mjs +435 -0
  261. package/dist/durable/SqlMemoryStore.mjs.map +1 -0
  262. package/dist/durable/SqlMessageDeliveryStore.d.mts +40 -0
  263. package/dist/durable/SqlMessageDeliveryStore.mjs +167 -0
  264. package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
  265. package/dist/durable/SqlStorageV2Upgrade.d.mts +22 -0
  266. package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
  267. package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
  268. package/dist/durable/SqlSubscriptionStore.d.mts +63 -0
  269. package/dist/durable/SqlSubscriptionStore.mjs +751 -0
  270. package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
  271. package/dist/durable/SubmissionLedger.d.mts +3 -0
  272. package/dist/durable/SubmissionLedger.mjs +914 -0
  273. package/dist/durable/SubmissionLedger.mjs.map +1 -0
  274. package/dist/durable/SubmissionLedgerConformance.d.mts +30 -0
  275. package/dist/durable/SubmissionLedgerConformance.mjs +1986 -0
  276. package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
  277. package/dist/durable/SubmissionStatus.d.mts +2 -0
  278. package/dist/durable/SubmissionStatus.mjs +18 -0
  279. package/dist/durable/SubmissionStatus.mjs.map +1 -0
  280. package/dist/durable/Subscription.d.mts +2 -0
  281. package/dist/durable/Subscription.mjs +360 -0
  282. package/dist/durable/Subscription.mjs.map +1 -0
  283. package/dist/durable/SubscriptionInput.d.mts +2 -0
  284. package/dist/durable/SubscriptionInput.mjs +52 -0
  285. package/dist/durable/SubscriptionInput.mjs.map +1 -0
  286. package/dist/durable/SubscriptionStoreConformance.d.mts +17 -0
  287. package/dist/durable/SubscriptionStoreConformance.mjs +625 -0
  288. package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
  289. package/dist/durable/SubscriptionTools.d.mts +273 -0
  290. package/dist/durable/SubscriptionTools.mjs +190 -0
  291. package/dist/durable/SubscriptionTools.mjs.map +1 -0
  292. package/dist/durable/SubscriptionTransition.d.mts +21 -0
  293. package/dist/durable/SubscriptionTransition.mjs +148 -0
  294. package/dist/durable/SubscriptionTransition.mjs.map +1 -0
  295. package/dist/durable/Subscriptions.d.mts +73 -0
  296. package/dist/durable/Subscriptions.mjs +627 -0
  297. package/dist/durable/Subscriptions.mjs.map +1 -0
  298. package/dist/durable/ThreadContextHistory.d.mts +32 -0
  299. package/dist/durable/ThreadContextHistory.mjs +152 -0
  300. package/dist/durable/ThreadContextHistory.mjs.map +1 -0
  301. package/dist/durable/ThreadContextHistoryProjection.d.mts +60 -0
  302. package/dist/durable/ThreadContextHistoryProjection.mjs +149 -0
  303. package/dist/durable/ThreadContextHistoryProjection.mjs.map +1 -0
  304. package/dist/durable/ThreadInvariants.d.mts +74 -0
  305. package/dist/durable/ThreadInvariants.mjs +200 -0
  306. package/dist/durable/ThreadInvariants.mjs.map +1 -0
  307. package/dist/durable/ThreadProjection.d.mts +78 -0
  308. package/dist/durable/ThreadProjection.mjs +158 -0
  309. package/dist/durable/ThreadProjection.mjs.map +1 -0
  310. package/dist/durable/ThreadProjectionMaintenance.d.mts +49 -0
  311. package/dist/durable/ThreadProjectionMaintenance.mjs +33 -0
  312. package/dist/durable/ThreadProjectionMaintenance.mjs.map +1 -0
  313. package/dist/durable/ThreadStore.d.mts +2 -0
  314. package/dist/durable/ThreadStore.mjs +147 -0
  315. package/dist/durable/ThreadStore.mjs.map +1 -0
  316. package/dist/durable/ThreadStoreConformance.d.mts +29 -0
  317. package/dist/durable/ThreadStoreConformance.mjs +248 -0
  318. package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
  319. package/dist/durable/ToolReconciler.d.mts +2 -0
  320. package/dist/durable/ToolReconciler.mjs +81 -0
  321. package/dist/durable/ToolReconciler.mjs.map +1 -0
  322. package/dist/durable/WakeScheduler.d.mts +2 -0
  323. package/dist/durable/WakeScheduler.mjs +85 -0
  324. package/dist/durable/WakeScheduler.mjs.map +1 -0
  325. package/dist/durable/WorkerHost.d.mts +129 -0
  326. package/dist/durable/WorkerHost.mjs +77 -0
  327. package/dist/durable/WorkerHost.mjs.map +1 -0
  328. package/dist/engine/AgentRuntime.d.mts +2 -0
  329. package/dist/engine/AgentRuntime.mjs +2 -0
  330. package/dist/engine/Compaction.d.mts +7 -0
  331. package/dist/engine/Compaction.mjs +16 -0
  332. package/dist/engine/Compaction.mjs.map +1 -0
  333. package/dist/engine/ContextCompactor.d.mts +2 -0
  334. package/dist/engine/ContextCompactor.mjs +119 -0
  335. package/dist/engine/ContextCompactor.mjs.map +1 -0
  336. package/dist/engine/ContextHistory.d.mts +65 -0
  337. package/dist/engine/ContextHistory.mjs +76 -0
  338. package/dist/engine/ContextHistory.mjs.map +1 -0
  339. package/dist/engine/ContextWindow.d.mts +2 -0
  340. package/dist/engine/ContextWindow.mjs +59 -0
  341. package/dist/engine/ContextWindow.mjs.map +1 -0
  342. package/dist/engine/DurableStep.d.mts +2 -0
  343. package/dist/engine/DurableStep.mjs +62 -0
  344. package/dist/engine/DurableStep.mjs.map +1 -0
  345. package/dist/engine/MessagingHost.d.mts +2 -0
  346. package/dist/engine/MessagingHost.mjs +2 -0
  347. package/dist/engine/Output.d.mts +2 -0
  348. package/dist/engine/Output.mjs +8 -0
  349. package/dist/engine/Output.mjs.map +1 -0
  350. package/dist/engine/RunEventSink.d.mts +2 -0
  351. package/dist/engine/RunEventSink.mjs +22 -0
  352. package/dist/engine/RunEventSink.mjs.map +1 -0
  353. package/dist/engine/RunOptions.d.mts +2 -0
  354. package/dist/engine/RunOptions.mjs +122 -0
  355. package/dist/engine/RunOptions.mjs.map +1 -0
  356. package/dist/engine/SubagentHost.d.mts +2 -0
  357. package/dist/engine/SubagentHost.mjs +72 -0
  358. package/dist/engine/SubagentHost.mjs.map +1 -0
  359. package/dist/engine/ThreadHistory.d.mts +2 -0
  360. package/dist/engine/ThreadHistory.mjs +67 -0
  361. package/dist/engine/ThreadHistory.mjs.map +1 -0
  362. package/dist/engine/ToolBroker.d.mts +2 -0
  363. package/dist/engine/ToolBroker.mjs +42 -0
  364. package/dist/engine/ToolBroker.mjs.map +1 -0
  365. package/dist/foreign-diagnostic-DBQ1XHKh.mjs +37 -0
  366. package/dist/foreign-diagnostic-DBQ1XHKh.mjs.map +1 -0
  367. package/dist/index.d.mts +88 -54
  368. package/dist/index.mjs +97 -54
  369. package/dist/output-contract-BC7tjlGw.mjs +84 -0
  370. package/dist/output-contract-BC7tjlGw.mjs.map +1 -0
  371. package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
  372. package/dist/sandbox/CodeExecutor.d.mts +194 -0
  373. package/dist/sandbox/CodeExecutor.mjs +278 -0
  374. package/dist/sandbox/CodeExecutor.mjs.map +1 -0
  375. package/dist/sandbox/InteractiveBrowser.d.mts +142 -0
  376. package/dist/sandbox/InteractiveBrowser.mjs +165 -0
  377. package/dist/sandbox/InteractiveBrowser.mjs.map +1 -0
  378. package/dist/sandbox/PageCapture.d.mts +2 -0
  379. package/dist/sandbox/PageCapture.mjs +450 -0
  380. package/dist/sandbox/PageCapture.mjs.map +1 -0
  381. package/dist/sandbox/PageCrawl.d.mts +88 -0
  382. package/dist/sandbox/PageCrawl.mjs +124 -0
  383. package/dist/sandbox/PageCrawl.mjs.map +1 -0
  384. package/dist/sandbox/PageScreenshot.d.mts +2 -0
  385. package/dist/sandbox/PageScreenshot.mjs +53 -0
  386. package/dist/sandbox/PageScreenshot.mjs.map +1 -0
  387. package/dist/sandbox/ProtectedBrowser.d.mts +252 -0
  388. package/dist/sandbox/ProtectedBrowser.mjs +270 -0
  389. package/dist/sandbox/ProtectedBrowser.mjs.map +1 -0
  390. package/dist/sandbox/Sandbox.d.mts +2 -0
  391. package/dist/sandbox/Sandbox.mjs +208 -0
  392. package/dist/sandbox/Sandbox.mjs.map +1 -0
  393. package/dist/utf8-BYfhEkcj.mjs +11 -0
  394. package/dist/utf8-BYfhEkcj.mjs.map +1 -0
  395. package/dist/utf8-DchGZRBd.mjs +23 -0
  396. package/dist/utf8-DchGZRBd.mjs.map +1 -0
  397. package/package.json +1 -1
  398. package/src/Ephemeral.ts +17 -0
  399. package/src/ToolExposure.ts +2 -2
  400. package/src/capabilities/Approval.ts +352 -0
  401. package/src/capabilities/Budget.ts +536 -0
  402. package/src/capabilities/CodeMode.ts +1090 -0
  403. package/src/capabilities/Commands.ts +86 -0
  404. package/src/capabilities/ContextTools.ts +184 -0
  405. package/src/capabilities/Mcp.ts +427 -0
  406. package/src/capabilities/McpClient.ts +967 -0
  407. package/src/capabilities/MemoryNotes.ts +174 -0
  408. package/src/capabilities/Messaging.ts +261 -0
  409. package/src/capabilities/ModelContext.ts +354 -0
  410. package/src/capabilities/Redaction.ts +157 -0
  411. package/src/capabilities/Remembering.ts +550 -0
  412. package/src/capabilities/RunHooks.ts +280 -0
  413. package/src/capabilities/SemanticMemory.ts +447 -0
  414. package/src/capabilities/Subagent.ts +2277 -0
  415. package/src/capabilities/SubagentReservations.ts +850 -0
  416. package/src/capabilities/ToolDiscovery.ts +339 -0
  417. package/src/capabilities/WebCapture.ts +722 -0
  418. package/src/capabilities/WebSearch.ts +184 -0
  419. package/src/capabilities/internal/subagent-background.ts +1106 -0
  420. package/src/capabilities/internal/subagent-contract.ts +142 -0
  421. package/src/capabilities/internal/subagent-policy.ts +235 -0
  422. package/src/capabilities/internal/subagent-reporting.ts +261 -0
  423. package/src/capabilities/internal/utf8.ts +10 -0
  424. package/src/core/Agent.ts +575 -0
  425. package/src/core/AgentError.ts +152 -0
  426. package/src/core/AgentPolicy.ts +153 -0
  427. package/src/core/AgentUpdates.ts +100 -0
  428. package/src/core/IdGenerator.ts +39 -0
  429. package/src/core/Identifiers.ts +48 -0
  430. package/src/core/Memory.ts +290 -0
  431. package/src/core/MemoryNamespace.ts +196 -0
  432. package/src/core/MemoryReference.ts +121 -0
  433. package/src/core/MemoryRevalidation.ts +185 -0
  434. package/src/core/MemoryStore.ts +368 -0
  435. package/src/core/Messaging.ts +90 -0
  436. package/src/core/Receipt.ts +42 -0
  437. package/src/core/RememberingStore.ts +300 -0
  438. package/src/core/RunEvent.ts +366 -0
  439. package/src/core/RunPolicyUsage.ts +17 -0
  440. package/src/core/SemanticMemoryIndex.ts +250 -0
  441. package/src/core/SemanticMemoryRevalidation.ts +254 -0
  442. package/src/core/SubagentContract.ts +196 -0
  443. package/src/core/Thread.ts +371 -0
  444. package/src/core/ToolExposure.ts +74 -0
  445. package/src/core/ToolResult.ts +170 -0
  446. package/src/core/Usage.ts +529 -0
  447. package/src/core/Worker.ts +173 -0
  448. package/src/core/internal/agent-updates.ts +32 -0
  449. package/src/core/internal/utf8.ts +23 -0
  450. package/src/durable/ActivityStore.ts +160 -0
  451. package/src/durable/Admin.ts +496 -0
  452. package/src/durable/AgentRegistration.ts +13 -0
  453. package/src/durable/Certification.ts +210 -0
  454. package/src/durable/CommittedActivity.ts +296 -0
  455. package/src/durable/Digest.ts +93 -0
  456. package/src/durable/DurableAgentRuntime.ts +10340 -0
  457. package/src/durable/DurableFailpoint.ts +103 -0
  458. package/src/durable/DurableFailpointTestControl.ts +39 -0
  459. package/src/durable/EventSource.ts +172 -0
  460. package/src/durable/GitHubWorkflowSource.ts +453 -0
  461. package/src/durable/MessageDelivery.ts +708 -0
  462. package/src/durable/MessageDeliveryStoreConformance.ts +363 -0
  463. package/src/durable/OperationAuthorizer.ts +85 -0
  464. package/src/durable/PersistentHistory.ts +260 -0
  465. package/src/durable/PreparedInputAdmission.ts +44 -0
  466. package/src/durable/Records.ts +1010 -0
  467. package/src/durable/Recovery.ts +1018 -0
  468. package/src/durable/RunJournal.ts +1479 -0
  469. package/src/durable/Schedule.ts +504 -0
  470. package/src/durable/ScheduleStoreConformance.ts +638 -0
  471. package/src/durable/ScheduleTransition.ts +265 -0
  472. package/src/durable/Scheduling.ts +1077 -0
  473. package/src/durable/SqlMemoryStore.ts +774 -0
  474. package/src/durable/SqlMessageDeliveryStore.ts +302 -0
  475. package/src/durable/SqlStorageV2Upgrade.ts +500 -0
  476. package/src/durable/SqlSubscriptionStore.ts +1440 -0
  477. package/src/durable/SubmissionLedger.ts +1201 -0
  478. package/src/durable/SubmissionLedgerConformance.ts +4579 -0
  479. package/src/durable/SubmissionStatus.ts +14 -0
  480. package/src/durable/Subscription.ts +544 -0
  481. package/src/durable/SubscriptionInput.ts +144 -0
  482. package/src/durable/SubscriptionStoreConformance.ts +945 -0
  483. package/src/durable/SubscriptionTools.ts +327 -0
  484. package/src/durable/SubscriptionTransition.ts +302 -0
  485. package/src/durable/Subscriptions.ts +1210 -0
  486. package/src/durable/ThreadContextHistory.ts +227 -0
  487. package/src/durable/ThreadContextHistoryProjection.ts +216 -0
  488. package/src/durable/ThreadInvariants.ts +442 -0
  489. package/src/durable/ThreadProjection.ts +269 -0
  490. package/src/durable/ThreadProjectionMaintenance.ts +67 -0
  491. package/src/durable/ThreadStore.ts +242 -0
  492. package/src/durable/ThreadStoreConformance.ts +710 -0
  493. package/src/durable/ToolReconciler.ts +105 -0
  494. package/src/durable/WakeScheduler.ts +134 -0
  495. package/src/durable/WorkerHost.ts +171 -0
  496. package/src/durable/internal/agent-registration.ts +525 -0
  497. package/src/durable/internal/agent-updates.ts +302 -0
  498. package/src/durable/internal/foreign-diagnostic.ts +47 -0
  499. package/src/durable/internal/journal-checkpoint.ts +104 -0
  500. package/src/durable/internal/journal-metadata.ts +107 -0
  501. package/src/durable/internal/messaging-host.ts +608 -0
  502. package/src/durable/internal/schedule-time.ts +303 -0
  503. package/src/durable/internal/storage-v2-layout.ts +163 -0
  504. package/src/durable/internal/storage-v2.ts +73 -0
  505. package/src/durable/internal/worker-host.ts +2467 -0
  506. package/src/durable/internal/worker-runtime.ts +9 -0
  507. package/src/engine/AgentRuntime.ts +37 -0
  508. package/src/engine/Compaction.ts +11 -0
  509. package/src/engine/ContextCompactor.ts +277 -0
  510. package/src/engine/ContextHistory.ts +73 -0
  511. package/src/engine/ContextWindow.ts +72 -0
  512. package/src/engine/DurableStep.ts +132 -0
  513. package/src/engine/MessagingHost.ts +110 -0
  514. package/src/engine/Output.ts +2 -0
  515. package/src/engine/RunEventSink.ts +132 -0
  516. package/src/engine/RunOptions.ts +1077 -0
  517. package/src/engine/SubagentHost.ts +181 -0
  518. package/src/engine/ThreadHistory.ts +120 -0
  519. package/src/engine/ToolBroker.ts +157 -0
  520. package/src/engine/ToolExposure.ts +48 -0
  521. package/src/engine/internal/agent-runtime.ts +10117 -0
  522. package/src/engine/internal/bounded-value.ts +315 -0
  523. package/src/engine/internal/compaction.ts +678 -0
  524. package/src/engine/internal/error-diagnostic.ts +39 -0
  525. package/src/engine/internal/output-contract.ts +173 -0
  526. package/src/engine/internal/primitive-delta.ts +80 -0
  527. package/src/engine/internal/provider-result-staging.ts +211 -0
  528. package/src/engine/internal/tool-derivative.ts +106 -0
  529. package/src/engine/internal/tool-exposure.ts +224 -0
  530. package/src/engine/internal/tool-telemetry.ts +484 -0
  531. package/src/index.ts +96 -53
  532. package/src/sandbox/CodeExecutor.ts +352 -0
  533. package/src/sandbox/InteractiveBrowser.ts +257 -0
  534. package/src/sandbox/PageCapture.ts +692 -0
  535. package/src/sandbox/PageCrawl.ts +148 -0
  536. package/src/sandbox/PageScreenshot.ts +81 -0
  537. package/src/sandbox/ProtectedBrowser.ts +413 -0
  538. package/src/sandbox/Sandbox.ts +241 -0
  539. package/dist/Agent.d.mts +0 -5
  540. package/dist/Agent.mjs +0 -10
  541. package/dist/Agent.mjs.map +0 -1
  542. package/dist/AgentError.d.mts +0 -5
  543. package/dist/AgentError.mjs +0 -10
  544. package/dist/AgentError.mjs.map +0 -1
  545. package/dist/AgentPolicy.d.mts +0 -5
  546. package/dist/AgentPolicy.mjs +0 -10
  547. package/dist/AgentPolicy.mjs.map +0 -1
  548. package/dist/AgentRuntime.d.mts +0 -5
  549. package/dist/AgentRuntime.mjs +0 -10
  550. package/dist/AgentRuntime.mjs.map +0 -1
  551. package/dist/AgentUpdates.d.mts +0 -5
  552. package/dist/AgentUpdates.mjs +0 -10
  553. package/dist/AgentUpdates.mjs.map +0 -1
  554. package/dist/Approval.d.mts +0 -5
  555. package/dist/Approval.mjs +0 -10
  556. package/dist/Approval.mjs.map +0 -1
  557. package/dist/Budget.d.mts +0 -5
  558. package/dist/Budget.mjs +0 -10
  559. package/dist/Budget.mjs.map +0 -1
  560. package/dist/CodeMode.d.mts +0 -5
  561. package/dist/CodeMode.mjs +0 -10
  562. package/dist/CodeMode.mjs.map +0 -1
  563. package/dist/Commands.d.mts +0 -5
  564. package/dist/Commands.mjs +0 -10
  565. package/dist/Commands.mjs.map +0 -1
  566. package/dist/Compaction.d.mts +0 -5
  567. package/dist/Compaction.mjs +0 -10
  568. package/dist/Compaction.mjs.map +0 -1
  569. package/dist/ContextCompactor.d.mts +0 -5
  570. package/dist/ContextCompactor.mjs +0 -10
  571. package/dist/ContextCompactor.mjs.map +0 -1
  572. package/dist/ContextHistory.d.mts +0 -5
  573. package/dist/ContextHistory.mjs +0 -10
  574. package/dist/ContextHistory.mjs.map +0 -1
  575. package/dist/ContextTools.d.mts +0 -5
  576. package/dist/ContextTools.mjs +0 -10
  577. package/dist/ContextTools.mjs.map +0 -1
  578. package/dist/ContextWindow.d.mts +0 -5
  579. package/dist/ContextWindow.mjs +0 -10
  580. package/dist/ContextWindow.mjs.map +0 -1
  581. package/dist/DurableStep.d.mts +0 -5
  582. package/dist/DurableStep.mjs +0 -10
  583. package/dist/DurableStep.mjs.map +0 -1
  584. package/dist/EphemeralThreads.d.mts +0 -5
  585. package/dist/EphemeralThreads.mjs +0 -10
  586. package/dist/EphemeralThreads.mjs.map +0 -1
  587. package/dist/IdGenerator.d.mts +0 -5
  588. package/dist/IdGenerator.mjs +0 -10
  589. package/dist/IdGenerator.mjs.map +0 -1
  590. package/dist/Identifiers.d.mts +0 -5
  591. package/dist/Identifiers.mjs +0 -10
  592. package/dist/Identifiers.mjs.map +0 -1
  593. package/dist/Mcp.d.mts +0 -5
  594. package/dist/Mcp.mjs +0 -10
  595. package/dist/Mcp.mjs.map +0 -1
  596. package/dist/McpClient.d.mts +0 -5
  597. package/dist/McpClient.mjs +0 -10
  598. package/dist/McpClient.mjs.map +0 -1
  599. package/dist/Memory.d.mts +0 -5
  600. package/dist/Memory.mjs +0 -10
  601. package/dist/Memory.mjs.map +0 -1
  602. package/dist/MemoryNamespace.d.mts +0 -5
  603. package/dist/MemoryNamespace.mjs +0 -10
  604. package/dist/MemoryNamespace.mjs.map +0 -1
  605. package/dist/MemoryNotes.d.mts +0 -5
  606. package/dist/MemoryNotes.mjs +0 -10
  607. package/dist/MemoryNotes.mjs.map +0 -1
  608. package/dist/MemoryReference.d.mts +0 -5
  609. package/dist/MemoryReference.mjs +0 -10
  610. package/dist/MemoryReference.mjs.map +0 -1
  611. package/dist/MemoryRevalidation.d.mts +0 -5
  612. package/dist/MemoryRevalidation.mjs +0 -10
  613. package/dist/MemoryRevalidation.mjs.map +0 -1
  614. package/dist/MemoryStore.d.mts +0 -5
  615. package/dist/MemoryStore.mjs +0 -10
  616. package/dist/MemoryStore.mjs.map +0 -1
  617. package/dist/Messaging.d.mts +0 -5
  618. package/dist/Messaging.mjs +0 -10
  619. package/dist/Messaging.mjs.map +0 -1
  620. package/dist/MessagingHost.d.mts +0 -5
  621. package/dist/MessagingHost.mjs +0 -10
  622. package/dist/MessagingHost.mjs.map +0 -1
  623. package/dist/ModelContext.d.mts +0 -5
  624. package/dist/ModelContext.mjs +0 -10
  625. package/dist/ModelContext.mjs.map +0 -1
  626. package/dist/Receipt.d.mts +0 -5
  627. package/dist/Receipt.mjs +0 -10
  628. package/dist/Receipt.mjs.map +0 -1
  629. package/dist/Redaction.d.mts +0 -5
  630. package/dist/Redaction.mjs +0 -10
  631. package/dist/Redaction.mjs.map +0 -1
  632. package/dist/Remembering.d.mts +0 -5
  633. package/dist/Remembering.mjs +0 -10
  634. package/dist/Remembering.mjs.map +0 -1
  635. package/dist/RememberingStore.d.mts +0 -5
  636. package/dist/RememberingStore.mjs +0 -10
  637. package/dist/RememberingStore.mjs.map +0 -1
  638. package/dist/RunEvent.d.mts +0 -5
  639. package/dist/RunEvent.mjs +0 -10
  640. package/dist/RunEvent.mjs.map +0 -1
  641. package/dist/RunEventSink.d.mts +0 -5
  642. package/dist/RunEventSink.mjs +0 -10
  643. package/dist/RunEventSink.mjs.map +0 -1
  644. package/dist/RunHooks.d.mts +0 -5
  645. package/dist/RunHooks.mjs +0 -10
  646. package/dist/RunHooks.mjs.map +0 -1
  647. package/dist/RunOptions.d.mts +0 -5
  648. package/dist/RunOptions.mjs +0 -10
  649. package/dist/RunOptions.mjs.map +0 -1
  650. package/dist/RunPolicyUsage.d.mts +0 -5
  651. package/dist/RunPolicyUsage.mjs +0 -10
  652. package/dist/RunPolicyUsage.mjs.map +0 -1
  653. package/dist/SemanticMemory.d.mts +0 -5
  654. package/dist/SemanticMemory.mjs +0 -10
  655. package/dist/SemanticMemory.mjs.map +0 -1
  656. package/dist/SemanticMemoryIndex.d.mts +0 -5
  657. package/dist/SemanticMemoryIndex.mjs +0 -10
  658. package/dist/SemanticMemoryIndex.mjs.map +0 -1
  659. package/dist/SemanticMemoryRevalidation.d.mts +0 -5
  660. package/dist/SemanticMemoryRevalidation.mjs +0 -10
  661. package/dist/SemanticMemoryRevalidation.mjs.map +0 -1
  662. package/dist/Subagent.d.mts +0 -5
  663. package/dist/Subagent.mjs +0 -10
  664. package/dist/Subagent.mjs.map +0 -1
  665. package/dist/SubagentContract.d.mts +0 -5
  666. package/dist/SubagentContract.mjs +0 -10
  667. package/dist/SubagentContract.mjs.map +0 -1
  668. package/dist/SubagentHost.d.mts +0 -5
  669. package/dist/SubagentHost.mjs +0 -10
  670. package/dist/SubagentHost.mjs.map +0 -1
  671. package/dist/SubagentReservations.d.mts +0 -5
  672. package/dist/SubagentReservations.mjs +0 -10
  673. package/dist/SubagentReservations.mjs.map +0 -1
  674. package/dist/ThreadHistory.d.mts +0 -5
  675. package/dist/ThreadHistory.mjs +0 -10
  676. package/dist/ThreadHistory.mjs.map +0 -1
  677. package/dist/ToolBroker.d.mts +0 -5
  678. package/dist/ToolBroker.mjs +0 -10
  679. package/dist/ToolBroker.mjs.map +0 -1
  680. package/dist/ToolDiscovery.d.mts +0 -5
  681. package/dist/ToolDiscovery.mjs +0 -10
  682. package/dist/ToolDiscovery.mjs.map +0 -1
  683. package/dist/ToolResult.d.mts +0 -5
  684. package/dist/ToolResult.mjs +0 -10
  685. package/dist/ToolResult.mjs.map +0 -1
  686. package/dist/Usage.d.mts +0 -5
  687. package/dist/Usage.mjs +0 -10
  688. package/dist/Usage.mjs.map +0 -1
  689. package/dist/WebCapture.d.mts +0 -5
  690. package/dist/WebCapture.mjs +0 -10
  691. package/dist/WebCapture.mjs.map +0 -1
  692. package/dist/WebSearch.d.mts +0 -5
  693. package/dist/WebSearch.mjs +0 -10
  694. package/dist/WebSearch.mjs.map +0 -1
  695. package/dist/Worker.d.mts +0 -5
  696. package/dist/Worker.mjs +0 -10
  697. package/dist/Worker.mjs.map +0 -1
  698. package/dist/rolldown-runtime-BBjsoOtd.mjs +0 -27
  699. package/src/Agent.ts +0 -1
  700. package/src/AgentError.ts +0 -1
  701. package/src/AgentPolicy.ts +0 -1
  702. package/src/AgentRuntime.ts +0 -1
  703. package/src/AgentUpdates.ts +0 -1
  704. package/src/Approval.ts +0 -1
  705. package/src/Budget.ts +0 -1
  706. package/src/CodeMode.ts +0 -1
  707. package/src/Commands.ts +0 -1
  708. package/src/Compaction.ts +0 -1
  709. package/src/ContextCompactor.ts +0 -1
  710. package/src/ContextHistory.ts +0 -1
  711. package/src/ContextTools.ts +0 -1
  712. package/src/ContextWindow.ts +0 -1
  713. package/src/DurableStep.ts +0 -1
  714. package/src/EphemeralThreads.ts +0 -1
  715. package/src/IdGenerator.ts +0 -1
  716. package/src/Identifiers.ts +0 -1
  717. package/src/Mcp.ts +0 -1
  718. package/src/McpClient.ts +0 -1
  719. package/src/Memory.ts +0 -1
  720. package/src/MemoryNamespace.ts +0 -1
  721. package/src/MemoryNotes.ts +0 -1
  722. package/src/MemoryReference.ts +0 -1
  723. package/src/MemoryRevalidation.ts +0 -1
  724. package/src/MemoryStore.ts +0 -1
  725. package/src/Messaging.ts +0 -1
  726. package/src/MessagingHost.ts +0 -1
  727. package/src/ModelContext.ts +0 -1
  728. package/src/Receipt.ts +0 -1
  729. package/src/Redaction.ts +0 -1
  730. package/src/Remembering.ts +0 -1
  731. package/src/RememberingStore.ts +0 -1
  732. package/src/RunEvent.ts +0 -1
  733. package/src/RunEventSink.ts +0 -1
  734. package/src/RunHooks.ts +0 -1
  735. package/src/RunOptions.ts +0 -1
  736. package/src/RunPolicyUsage.ts +0 -1
  737. package/src/SemanticMemory.ts +0 -1
  738. package/src/SemanticMemoryIndex.ts +0 -1
  739. package/src/SemanticMemoryRevalidation.ts +0 -1
  740. package/src/Subagent.ts +0 -1
  741. package/src/SubagentContract.ts +0 -1
  742. package/src/SubagentHost.ts +0 -1
  743. package/src/SubagentReservations.ts +0 -1
  744. package/src/ThreadHistory.ts +0 -1
  745. package/src/ToolBroker.ts +0 -1
  746. package/src/ToolDiscovery.ts +0 -1
  747. package/src/ToolResult.ts +0 -1
  748. package/src/Usage.ts +0 -1
  749. package/src/WebCapture.ts +0 -1
  750. package/src/WebSearch.ts +0 -1
  751. package/src/Worker.ts +0 -1
@@ -0,0 +1,2 @@
1
+ import { A as defaultSubscriptionLimits, C as SubscriptionScanCursors, D as SubscriptionStore, E as SubscriptionSourceError, M as subscriptionKeyString, O as SubscriptionStoreFailure, S as SubscriptionRetentionPolicy, T as SubscriptionSnapshot, _ as SubscriptionKey, a as PreparedInput, b as SubscriptionRecord, c as SubscriptionAuthorizer, d as SubscriptionDelivery, f as SubscriptionDeliveryKey, g as SubscriptionFailpointError, h as SubscriptionFailpoint, i as EventSourceVersion, j as subscriptionDeliveryKeyString, l as SubscriptionChange, m as SubscriptionError, n as DeliveryChange, o as SourcePartition, p as SubscriptionDeliverySnapshot, r as EventAcknowledgement, s as SourceRecovery, t as AcceptedEvent, u as SubscriptionConfiguration, v as SubscriptionLimits, w as SubscriptionScope, x as SubscriptionRefusal, y as SubscriptionName } from "../Subscription-BEP8oQO5.mjs";
2
+ export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, SubscriptionStoreFailure, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString };
@@ -0,0 +1,360 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import { AgentId, ThreadId } from "../core/Identifiers.mjs";
3
+ import { IdempotencyKey, Principal, Receipt } from "../core/Receipt.mjs";
4
+ import { l as InputMessage } from "../MessagingHost-CWi_PP3g.mjs";
5
+ import { DefinitionDigests, Digest, PersistedJson, WorkerAdmission } from "./Records.mjs";
6
+ import { AdmissionFence, AdmissionGroup } from "./SubmissionLedger.mjs";
7
+ import { ScheduleAuthorizationDecision, ScheduleDestination, ScheduleInstant, ScheduleRetry } from "./Schedule.mjs";
8
+ import { Context, Effect, Schema } from "effect";
9
+ //#region src/durable/Subscription.ts
10
+ var Subscription_exports = /* @__PURE__ */ __exportAll({
11
+ AcceptedEvent: () => AcceptedEvent,
12
+ DeliveryChange: () => DeliveryChange,
13
+ EventAcknowledgement: () => EventAcknowledgement,
14
+ EventSourceVersion: () => EventSourceVersion,
15
+ PreparedInput: () => PreparedInput,
16
+ SourcePartition: () => SourcePartition,
17
+ SourceRecovery: () => SourceRecovery,
18
+ SubscriptionAuthorizer: () => SubscriptionAuthorizer,
19
+ SubscriptionChange: () => SubscriptionChange,
20
+ SubscriptionConfiguration: () => SubscriptionConfiguration,
21
+ SubscriptionDelivery: () => SubscriptionDelivery,
22
+ SubscriptionDeliveryKey: () => SubscriptionDeliveryKey,
23
+ SubscriptionDeliverySnapshot: () => SubscriptionDeliverySnapshot,
24
+ SubscriptionError: () => SubscriptionError,
25
+ SubscriptionFailpoint: () => SubscriptionFailpoint,
26
+ SubscriptionFailpointError: () => SubscriptionFailpointError,
27
+ SubscriptionKey: () => SubscriptionKey,
28
+ SubscriptionLimits: () => SubscriptionLimits,
29
+ SubscriptionName: () => SubscriptionName,
30
+ SubscriptionRecord: () => SubscriptionRecord,
31
+ SubscriptionRefusal: () => SubscriptionRefusal,
32
+ SubscriptionRetentionPolicy: () => SubscriptionRetentionPolicy,
33
+ SubscriptionScanCursors: () => SubscriptionScanCursors,
34
+ SubscriptionScope: () => SubscriptionScope,
35
+ SubscriptionSnapshot: () => SubscriptionSnapshot,
36
+ SubscriptionSourceError: () => SubscriptionSourceError,
37
+ SubscriptionStore: () => SubscriptionStore,
38
+ defaultSubscriptionLimits: () => defaultSubscriptionLimits,
39
+ subscriptionDeliveryKeyString: () => subscriptionDeliveryKeyString,
40
+ subscriptionKeyString: () => subscriptionKeyString
41
+ });
42
+ const SubscriptionName = Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[^\p{Surrogate}]*$/u));
43
+ const Positive = Schema.Int.check(Schema.isGreaterThan(0));
44
+ /** Stable storage identity. Deployment and payload values must never change its routing. */
45
+ const SourcePartition = Schema.Struct({
46
+ tenantId: SubscriptionName,
47
+ address: SubscriptionName
48
+ });
49
+ const EventSourceVersion = Schema.Struct({
50
+ name: SubscriptionName,
51
+ version: SubscriptionName
52
+ });
53
+ const SubscriptionKey = Schema.Struct({
54
+ partition: SourcePartition,
55
+ ownerId: SubscriptionName,
56
+ subscriptionId: SubscriptionName
57
+ });
58
+ const SubscriptionScope = Schema.Struct({
59
+ partition: SourcePartition,
60
+ ownerId: SubscriptionName,
61
+ principal: Principal
62
+ });
63
+ const SubscriptionConfiguration = Schema.Struct({
64
+ source: EventSourceVersion,
65
+ matchingKey: SubscriptionName,
66
+ parameters: PersistedJson,
67
+ context: PersistedJson,
68
+ mode: Schema.Literals(["once", "continuous"]),
69
+ /** Null disables time-based expiry; once selection and cancellation still apply. */
70
+ expiresAtMillis: Schema.NullOr(ScheduleInstant),
71
+ destination: ScheduleDestination,
72
+ deliveryPrincipal: Principal,
73
+ admissionGroup: Schema.optionalKey(AdmissionGroup),
74
+ admissionFence: Schema.optionalKey(AdmissionFence),
75
+ agentId: AgentId,
76
+ definitions: DefinitionDigests
77
+ });
78
+ const SourceRecovery = Schema.Struct({
79
+ attempts: Schema.Natural,
80
+ /** Null retains a conclusive source failure without continuing provider polling. */
81
+ nextAttemptAtMillis: Schema.NullOr(ScheduleInstant),
82
+ lastFailure: Schema.NullOr(SubscriptionName)
83
+ }).check(Schema.makeFilter((value) => value.nextAttemptAtMillis !== null || value.lastFailure !== null));
84
+ const SubscriptionRecord = Schema.Struct({
85
+ schemaVersion: Schema.Literal(1),
86
+ key: SubscriptionKey,
87
+ creationFingerprint: Digest,
88
+ configurationRevision: Positive,
89
+ configurationFingerprint: Digest,
90
+ creationConfiguration: SubscriptionConfiguration,
91
+ createdBy: Principal,
92
+ createdAtMillis: ScheduleInstant,
93
+ /** Assigned atomically in the same order as event eligibility cutoffs. */
94
+ ordinal: Schema.Natural,
95
+ configuration: SubscriptionConfiguration,
96
+ state: Schema.Literals([
97
+ "active",
98
+ "paused",
99
+ "consumed",
100
+ "cancelled"
101
+ ]),
102
+ recovery: Schema.NullOr(SourceRecovery)
103
+ }).check(Schema.makeFilter((value) => (value.state !== "consumed" || value.configuration.mode === "once") && (value.recovery === null || value.configuration.mode === "once" && (value.state === "active" || value.state === "paused"))));
104
+ const AcceptedEvent = Schema.Struct({
105
+ schemaVersion: Schema.Literal(1),
106
+ partition: SourcePartition,
107
+ eventId: SubscriptionName,
108
+ source: EventSourceVersion,
109
+ matchingKey: SubscriptionName,
110
+ payload: PersistedJson,
111
+ payloadDigest: Digest,
112
+ acceptedAtMillis: ScheduleInstant,
113
+ occurredAtMillis: Schema.optionalKey(ScheduleInstant),
114
+ /** Deduplication evidence after completed payload/delivery retention ends. */
115
+ tombstone: Schema.optionalKey(Schema.Boolean),
116
+ cutoff: Schema.Natural,
117
+ cursor: Schema.Natural,
118
+ routingComplete: Schema.Boolean,
119
+ routingFailure: Schema.NullOr(SubscriptionName),
120
+ nextAttemptAtMillis: ScheduleInstant
121
+ }).check(Schema.makeFilter((value) => value.cursor <= value.cutoff && (value.tombstone !== true || value.payload === null && value.routingComplete)));
122
+ const EventAcknowledgement = Schema.Struct({
123
+ partition: SourcePartition,
124
+ eventId: SubscriptionName,
125
+ acceptedAtMillis: ScheduleInstant
126
+ });
127
+ /** Common admission data; neither a schedule cursor nor a subscription lifecycle lives here. */
128
+ const PreparedInput = Schema.Struct({
129
+ schemaVersion: Schema.Literal(1),
130
+ threadId: ThreadId,
131
+ deliveryPrincipal: Principal,
132
+ admissionGroup: Schema.optionalKey(AdmissionGroup),
133
+ admissionFence: Schema.optionalKey(AdmissionFence),
134
+ agentId: AgentId,
135
+ definitions: DefinitionDigests,
136
+ input: PersistedJson,
137
+ inputDigest: Digest,
138
+ admissionKey: IdempotencyKey,
139
+ authorization: ScheduleAuthorizationDecision,
140
+ workerAdmission: Schema.optionalKey(WorkerAdmission),
141
+ messageAdmission: Schema.optionalKey(InputMessage)
142
+ });
143
+ const SubscriptionDeliveryKey = Schema.Struct({
144
+ subscription: SubscriptionKey,
145
+ eventId: SubscriptionName
146
+ });
147
+ const SubscriptionRefusal = Schema.Struct({
148
+ phase: Schema.Literals(["preparation", "admission"]),
149
+ code: SubscriptionName
150
+ });
151
+ const SubscriptionDelivery = Schema.Struct({
152
+ schemaVersion: Schema.Literal(1),
153
+ key: SubscriptionDeliveryKey,
154
+ deliveryId: Digest,
155
+ subscriptionFingerprint: Digest,
156
+ configurationRevision: Positive,
157
+ configuration: SubscriptionConfiguration,
158
+ eventDigest: Digest,
159
+ source: EventSourceVersion,
160
+ threadId: ThreadId,
161
+ admissionKey: IdempotencyKey,
162
+ selectedAtMillis: ScheduleInstant,
163
+ observeSettlement: Schema.optionalKey(Schema.Boolean),
164
+ settledAtMillis: Schema.optionalKey(ScheduleInstant),
165
+ completedAtMillis: Schema.optionalKey(ScheduleInstant),
166
+ state: Schema.Literals([
167
+ "selected",
168
+ "prepared",
169
+ "delivered",
170
+ "refused"
171
+ ]),
172
+ envelope: Schema.NullOr(PreparedInput),
173
+ envelopeDigest: Schema.NullOr(Digest),
174
+ retry: ScheduleRetry,
175
+ receipt: Schema.NullOr(Receipt),
176
+ refusal: Schema.NullOr(SubscriptionRefusal)
177
+ }).check(Schema.makeFilter((value) => {
178
+ const hasEnvelope = value.envelope !== null && value.envelopeDigest !== null;
179
+ const noEnvelope = value.envelope === null && value.envelopeDigest === null;
180
+ switch (value.state) {
181
+ case "selected": return noEnvelope && value.receipt === null && value.refusal === null;
182
+ case "prepared": return hasEnvelope && value.receipt === null && value.refusal === null;
183
+ case "delivered": return hasEnvelope && value.receipt !== null && value.refusal === null;
184
+ case "refused": return value.receipt === null && value.refusal !== null && (value.refusal.phase === "preparation" ? noEnvelope : hasEnvelope);
185
+ }
186
+ }));
187
+ /** Management projections intentionally exclude parameters, context, payload, and input. */
188
+ const SubscriptionSnapshot = Schema.Struct({
189
+ key: SubscriptionKey,
190
+ source: EventSourceVersion,
191
+ mode: Schema.Literals(["once", "continuous"]),
192
+ state: Schema.Literals([
193
+ "active",
194
+ "paused",
195
+ "consumed",
196
+ "cancelled",
197
+ "expired"
198
+ ]),
199
+ configurationRevision: Positive,
200
+ configurationFingerprint: Digest,
201
+ admissionGroup: SubscriptionConfiguration.fields.admissionGroup,
202
+ admissionFence: SubscriptionConfiguration.fields.admissionFence,
203
+ createdAtMillis: ScheduleInstant,
204
+ /** Null disables time-based expiry; once selection and cancellation still apply. */
205
+ expiresAtMillis: Schema.NullOr(ScheduleInstant),
206
+ recovery: Schema.NullOr(SourceRecovery)
207
+ });
208
+ const SubscriptionDeliverySnapshot = Schema.Struct({
209
+ key: SubscriptionDeliveryKey,
210
+ state: SubscriptionDelivery.fields.state,
211
+ configurationRevision: Positive,
212
+ observeSettlement: Schema.optionalKey(Schema.Boolean),
213
+ settledAtMillis: Schema.optionalKey(ScheduleInstant),
214
+ retry: ScheduleRetry,
215
+ receipt: Schema.NullOr(Receipt),
216
+ refusal: Schema.NullOr(SubscriptionRefusal)
217
+ });
218
+ var SubscriptionError = class extends Schema.TaggedError()("SubscriptionError", {
219
+ reason: Schema.Literals([
220
+ "validation",
221
+ "conflict",
222
+ "not-found",
223
+ "capacity",
224
+ "unauthorized",
225
+ "unsupported-source",
226
+ "unsupported-binding",
227
+ "storage",
228
+ "corrupt"
229
+ ]),
230
+ code: SubscriptionName,
231
+ cause: Schema.optionalKey(Schema.Defect()),
232
+ currentRevision: Schema.optionalKey(Positive),
233
+ currentState: Schema.optionalKey(Schema.Literals([
234
+ "active",
235
+ "paused",
236
+ "consumed",
237
+ "cancelled"
238
+ ]))
239
+ }) {};
240
+ /** Host source adapters classify expected failures; raw provider diagnostics are never stored. */
241
+ var SubscriptionSourceError = class extends Schema.TaggedError()("SubscriptionSourceError", {
242
+ code: SubscriptionName,
243
+ retryable: Schema.Boolean
244
+ }) {};
245
+ var SubscriptionFailpointError = class extends Schema.TaggedError()("SubscriptionFailpointError", { point: Schema.String }) {};
246
+ const SubscriptionFailpoint = Context.Reference("@effect-agent/thread/SubscriptionFailpoint", { defaultValue: () => ({ hit: () => Effect.void }) });
247
+ const SubscriptionRetentionPolicy = Schema.Struct({
248
+ replayHorizonMillis: Positive,
249
+ completedRetentionMillis: Schema.Natural,
250
+ maxTombstones: Positive.check(Schema.isLessThanOrEqualTo(1e5))
251
+ });
252
+ const SubscriptionLimits = Schema.Struct({
253
+ retention: Schema.optionalKey(SubscriptionRetentionPolicy),
254
+ maxRegistrations: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
255
+ maxRegistrationsPerOwner: Positive.check(Schema.isLessThanOrEqualTo(1e4)),
256
+ maxEvents: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
257
+ maxDeliveries: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
258
+ maxDeliveriesPerOwner: Positive.check(Schema.isLessThanOrEqualTo(1e4)),
259
+ maxPayloadBytes: Positive.check(Schema.isLessThanOrEqualTo(65536)),
260
+ maxContextBytes: Positive.check(Schema.isLessThanOrEqualTo(16384)),
261
+ maxLifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(864e13)),
262
+ batchSize: Positive.check(Schema.isLessThanOrEqualTo(100)),
263
+ concurrency: Positive.check(Schema.isLessThanOrEqualTo(16)),
264
+ retryMillis: Positive.check(Schema.isLessThanOrEqualTo(864e5)),
265
+ maxAutomaticAttempts: Schema.optionalKey(Positive),
266
+ operationTimeoutMillis: Positive.check(Schema.isLessThanOrEqualTo(3e5))
267
+ });
268
+ const defaultSubscriptionLimits = {
269
+ maxRegistrations: 1e4,
270
+ maxRegistrationsPerOwner: 1e3,
271
+ maxEvents: 1e4,
272
+ maxDeliveries: 1e4,
273
+ maxDeliveriesPerOwner: 1e3,
274
+ maxPayloadBytes: 65536,
275
+ maxContextBytes: 16384,
276
+ maxLifetimeMillis: 2592e6,
277
+ batchSize: 16,
278
+ concurrency: 4,
279
+ retryMillis: 3e4,
280
+ operationTimeoutMillis: 3e4,
281
+ maxAutomaticAttempts: 8
282
+ };
283
+ const SubscriptionChange = Schema.Union([
284
+ Schema.Struct({
285
+ _tag: Schema.Literal("Recover"),
286
+ nowMillis: ScheduleInstant
287
+ }),
288
+ Schema.Struct({
289
+ _tag: Schema.Literal("Update"),
290
+ configuration: SubscriptionConfiguration,
291
+ configurationFingerprint: Digest,
292
+ recovery: Schema.NullOr(SourceRecovery)
293
+ }),
294
+ Schema.Struct({ _tag: Schema.Literals(["Pause", "Resume"]) })
295
+ ]);
296
+ const DeliveryChange = Schema.Union([
297
+ Schema.Struct({
298
+ _tag: Schema.Literal("ObserveSettlement"),
299
+ receipt: Receipt,
300
+ settled: Schema.Boolean,
301
+ nowMillis: ScheduleInstant,
302
+ nextAttemptAtMillis: ScheduleInstant
303
+ }),
304
+ Schema.Struct({
305
+ _tag: Schema.Literal("Recover"),
306
+ expectedGeneration: Schema.Natural,
307
+ nowMillis: ScheduleInstant
308
+ }),
309
+ Schema.Struct({
310
+ _tag: Schema.Literal("Prepare"),
311
+ envelope: PreparedInput,
312
+ envelopeDigest: Digest,
313
+ nowMillis: ScheduleInstant
314
+ }),
315
+ Schema.Struct({
316
+ _tag: Schema.Literal("Complete"),
317
+ receipt: Receipt,
318
+ nowMillis: ScheduleInstant
319
+ }),
320
+ Schema.Struct({
321
+ _tag: Schema.Literal("Refuse"),
322
+ refusal: SubscriptionRefusal,
323
+ nowMillis: ScheduleInstant
324
+ }),
325
+ Schema.Struct({
326
+ _tag: Schema.Literal("Retry"),
327
+ retry: ScheduleRetry,
328
+ nowMillis: ScheduleInstant
329
+ })
330
+ ]);
331
+ /** Progress of bounded recovery sweeps, independent of individual work success. */
332
+ const SubscriptionScanCursors = Schema.Struct({
333
+ events: Schema.String,
334
+ deliveries: Schema.String,
335
+ recovery: Schema.Natural
336
+ });
337
+ /**
338
+ * One store instance owns exactly one tenant/source partition. Every mutation is local and
339
+ * atomic, including required Cloudflare wakes. Node has one process owner per database.
340
+ * Records are retained for the partition lifetime; hard quotas reject new retained work.
341
+ * No pruning may discard creation replay, deduplication, or unfinished-work evidence.
342
+ */
343
+ var SubscriptionStore = class extends Context.Service()("@effect-agent/thread/SubscriptionStore") {};
344
+ /** Explicit host policy. Management scope is not inferred from handle possession. */
345
+ var SubscriptionAuthorizer = class extends Context.Service()("@effect-agent/thread/SubscriptionAuthorizer") {};
346
+ const subscriptionKeyString = (key) => JSON.stringify([
347
+ key.partition.tenantId,
348
+ key.partition.address,
349
+ key.ownerId,
350
+ key.subscriptionId
351
+ ]);
352
+ const subscriptionDeliveryKeyString = (key) => JSON.stringify([
353
+ key.subscription.ownerId,
354
+ key.subscription.subscriptionId,
355
+ key.eventId
356
+ ]);
357
+ //#endregion
358
+ export { AcceptedEvent, DeliveryChange, EventAcknowledgement, EventSourceVersion, PreparedInput, SourcePartition, SourceRecovery, SubscriptionAuthorizer, SubscriptionChange, SubscriptionConfiguration, SubscriptionDelivery, SubscriptionDeliveryKey, SubscriptionDeliverySnapshot, SubscriptionError, SubscriptionFailpoint, SubscriptionFailpointError, SubscriptionKey, SubscriptionLimits, SubscriptionName, SubscriptionRecord, SubscriptionRefusal, SubscriptionRetentionPolicy, SubscriptionScanCursors, SubscriptionScope, SubscriptionSnapshot, SubscriptionSourceError, SubscriptionStore, defaultSubscriptionLimits, subscriptionDeliveryKeyString, subscriptionKeyString, Subscription_exports as t };
359
+
360
+ //# sourceMappingURL=Subscription.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Subscription.mjs","names":[],"sources":["../../src/durable/Subscription.ts"],"sourcesContent":["import { Context, Effect, Schema } from \"effect\";\n\nimport { InputMessage } from \"../capabilities/Messaging.ts\";\nimport { AgentId, ThreadId } from \"../core/Identifiers.ts\";\nimport { Receipt } from \"../core/Receipt.ts\";\nimport { DefinitionDigests, Digest, PersistedJson, WorkerAdmission } from \"./Records.ts\";\nimport {\n ScheduleAuthorizationDecision,\n ScheduleDestination,\n ScheduleInstant,\n ScheduleRetry,\n} from \"./Schedule.ts\";\nimport { AdmissionFence, AdmissionGroup, IdempotencyKey, Principal } from \"./SubmissionLedger.ts\";\n\nexport const SubscriptionName = Schema.NonEmptyString.check(\n Schema.isMaxLength(256),\n Schema.isPattern(/^[^\\p{Surrogate}]*$/u),\n);\n\nconst Positive = Schema.Int.check(Schema.isGreaterThan(0));\n\n/** Stable storage identity. Deployment and payload values must never change its routing. */\nexport const SourcePartition = Schema.Struct({\n tenantId: SubscriptionName,\n address: SubscriptionName,\n});\n\nexport type SourcePartition = typeof SourcePartition.Type;\n\nexport const EventSourceVersion = Schema.Struct({\n name: SubscriptionName,\n version: SubscriptionName,\n});\n\nexport type EventSourceVersion = typeof EventSourceVersion.Type;\n\nexport const SubscriptionKey = Schema.Struct({\n partition: SourcePartition,\n ownerId: SubscriptionName,\n subscriptionId: SubscriptionName,\n});\n\nexport type SubscriptionKey = typeof SubscriptionKey.Type;\n\nexport const SubscriptionScope = Schema.Struct({\n partition: SourcePartition,\n ownerId: SubscriptionName,\n principal: Principal,\n});\n\nexport type SubscriptionScope = typeof SubscriptionScope.Type;\n\nexport const SubscriptionConfiguration = Schema.Struct({\n source: EventSourceVersion,\n matchingKey: SubscriptionName,\n parameters: PersistedJson,\n context: PersistedJson,\n mode: Schema.Literals([\"once\", \"continuous\"]),\n /** Null disables time-based expiry; once selection and cancellation still apply. */\n expiresAtMillis: Schema.NullOr(ScheduleInstant),\n destination: ScheduleDestination,\n deliveryPrincipal: Principal,\n admissionGroup: Schema.optionalKey(AdmissionGroup),\n admissionFence: Schema.optionalKey(AdmissionFence),\n agentId: AgentId,\n definitions: DefinitionDigests,\n});\n\nexport type SubscriptionConfiguration = typeof SubscriptionConfiguration.Type;\n\nexport const SourceRecovery = Schema.Struct({\n attempts: Schema.Natural,\n /** Null retains a conclusive source failure without continuing provider polling. */\n nextAttemptAtMillis: Schema.NullOr(ScheduleInstant),\n lastFailure: Schema.NullOr(SubscriptionName),\n}).check(\n Schema.makeFilter((value) => value.nextAttemptAtMillis !== null || value.lastFailure !== null),\n);\n\nexport const SubscriptionRecord = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n key: SubscriptionKey,\n creationFingerprint: Digest,\n configurationRevision: Positive,\n configurationFingerprint: Digest,\n creationConfiguration: SubscriptionConfiguration,\n createdBy: Principal,\n createdAtMillis: ScheduleInstant,\n /** Assigned atomically in the same order as event eligibility cutoffs. */\n ordinal: Schema.Natural,\n configuration: SubscriptionConfiguration,\n state: Schema.Literals([\"active\", \"paused\", \"consumed\", \"cancelled\"]),\n recovery: Schema.NullOr(SourceRecovery),\n}).check(\n Schema.makeFilter(\n (value) =>\n (value.state !== \"consumed\" || value.configuration.mode === \"once\") &&\n (value.recovery === null ||\n (value.configuration.mode === \"once\" &&\n (value.state === \"active\" || value.state === \"paused\"))),\n ),\n);\n\nexport type SubscriptionRecord = typeof SubscriptionRecord.Type;\n\nexport const AcceptedEvent = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n partition: SourcePartition,\n eventId: SubscriptionName,\n source: EventSourceVersion,\n matchingKey: SubscriptionName,\n payload: PersistedJson,\n payloadDigest: Digest,\n acceptedAtMillis: ScheduleInstant,\n occurredAtMillis: Schema.optionalKey(ScheduleInstant),\n /** Deduplication evidence after completed payload/delivery retention ends. */\n tombstone: Schema.optionalKey(Schema.Boolean),\n cutoff: Schema.Natural,\n cursor: Schema.Natural,\n routingComplete: Schema.Boolean,\n routingFailure: Schema.NullOr(SubscriptionName),\n nextAttemptAtMillis: ScheduleInstant,\n}).check(\n Schema.makeFilter(\n (value) =>\n value.cursor <= value.cutoff &&\n (value.tombstone !== true || (value.payload === null && value.routingComplete)),\n ),\n);\n\nexport type AcceptedEvent = typeof AcceptedEvent.Type;\n\nexport const EventAcknowledgement = Schema.Struct({\n partition: SourcePartition,\n eventId: SubscriptionName,\n acceptedAtMillis: ScheduleInstant,\n});\n\nexport type EventAcknowledgement = typeof EventAcknowledgement.Type;\n\n/** Common admission data; neither a schedule cursor nor a subscription lifecycle lives here. */\nexport const PreparedInput = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n threadId: ThreadId,\n deliveryPrincipal: Principal,\n admissionGroup: Schema.optionalKey(AdmissionGroup),\n admissionFence: Schema.optionalKey(AdmissionFence),\n agentId: AgentId,\n definitions: DefinitionDigests,\n input: PersistedJson,\n inputDigest: Digest,\n admissionKey: IdempotencyKey,\n authorization: ScheduleAuthorizationDecision,\n workerAdmission: Schema.optionalKey(WorkerAdmission),\n messageAdmission: Schema.optionalKey(InputMessage),\n});\n\nexport type PreparedInput = typeof PreparedInput.Type;\n\nexport const SubscriptionDeliveryKey = Schema.Struct({\n subscription: SubscriptionKey,\n eventId: SubscriptionName,\n});\n\nexport type SubscriptionDeliveryKey = typeof SubscriptionDeliveryKey.Type;\n\nexport const SubscriptionRefusal = Schema.Struct({\n phase: Schema.Literals([\"preparation\", \"admission\"]),\n code: SubscriptionName,\n});\n\nexport const SubscriptionDelivery = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n key: SubscriptionDeliveryKey,\n deliveryId: Digest,\n subscriptionFingerprint: Digest,\n configurationRevision: Positive,\n configuration: SubscriptionConfiguration,\n eventDigest: Digest,\n source: EventSourceVersion,\n threadId: ThreadId,\n admissionKey: IdempotencyKey,\n selectedAtMillis: ScheduleInstant,\n observeSettlement: Schema.optionalKey(Schema.Boolean),\n settledAtMillis: Schema.optionalKey(ScheduleInstant),\n completedAtMillis: Schema.optionalKey(ScheduleInstant),\n state: Schema.Literals([\"selected\", \"prepared\", \"delivered\", \"refused\"]),\n envelope: Schema.NullOr(PreparedInput),\n envelopeDigest: Schema.NullOr(Digest),\n retry: ScheduleRetry,\n receipt: Schema.NullOr(Receipt),\n refusal: Schema.NullOr(SubscriptionRefusal),\n}).check(\n Schema.makeFilter((value) => {\n const hasEnvelope = value.envelope !== null && value.envelopeDigest !== null;\n const noEnvelope = value.envelope === null && value.envelopeDigest === null;\n\n switch (value.state) {\n case \"selected\":\n return noEnvelope && value.receipt === null && value.refusal === null;\n case \"prepared\":\n return hasEnvelope && value.receipt === null && value.refusal === null;\n case \"delivered\":\n return hasEnvelope && value.receipt !== null && value.refusal === null;\n case \"refused\":\n return (\n value.receipt === null &&\n value.refusal !== null &&\n (value.refusal.phase === \"preparation\" ? noEnvelope : hasEnvelope)\n );\n }\n }),\n);\n\nexport type SubscriptionDelivery = typeof SubscriptionDelivery.Type;\n\n/** Management projections intentionally exclude parameters, context, payload, and input. */\nexport const SubscriptionSnapshot = Schema.Struct({\n key: SubscriptionKey,\n source: EventSourceVersion,\n mode: Schema.Literals([\"once\", \"continuous\"]),\n state: Schema.Literals([\"active\", \"paused\", \"consumed\", \"cancelled\", \"expired\"]),\n configurationRevision: Positive,\n configurationFingerprint: Digest,\n admissionGroup: SubscriptionConfiguration.fields.admissionGroup,\n admissionFence: SubscriptionConfiguration.fields.admissionFence,\n createdAtMillis: ScheduleInstant,\n /** Null disables time-based expiry; once selection and cancellation still apply. */\n expiresAtMillis: Schema.NullOr(ScheduleInstant),\n recovery: Schema.NullOr(SourceRecovery),\n});\n\nexport type SubscriptionSnapshot = typeof SubscriptionSnapshot.Type;\n\nexport const SubscriptionDeliverySnapshot = Schema.Struct({\n key: SubscriptionDeliveryKey,\n state: SubscriptionDelivery.fields.state,\n configurationRevision: Positive,\n observeSettlement: Schema.optionalKey(Schema.Boolean),\n settledAtMillis: Schema.optionalKey(ScheduleInstant),\n retry: ScheduleRetry,\n receipt: Schema.NullOr(Receipt),\n refusal: Schema.NullOr(SubscriptionRefusal),\n});\n\nexport class SubscriptionError extends Schema.TaggedError<SubscriptionError>()(\n \"SubscriptionError\",\n {\n reason: Schema.Literals([\n \"validation\",\n \"conflict\",\n \"not-found\",\n \"capacity\",\n \"unauthorized\",\n \"unsupported-source\",\n \"unsupported-binding\",\n \"storage\",\n \"corrupt\",\n ]),\n code: SubscriptionName,\n cause: Schema.optionalKey(Schema.Defect()),\n currentRevision: Schema.optionalKey(Positive),\n currentState: Schema.optionalKey(\n Schema.Literals([\"active\", \"paused\", \"consumed\", \"cancelled\"]),\n ),\n },\n) {}\n\n/** Host source adapters classify expected failures; raw provider diagnostics are never stored. */\nexport class SubscriptionSourceError extends Schema.TaggedError<SubscriptionSourceError>()(\n \"SubscriptionSourceError\",\n {\n code: SubscriptionName,\n retryable: Schema.Boolean,\n },\n) {}\n\nexport class SubscriptionFailpointError extends Schema.TaggedError<SubscriptionFailpointError>()(\n \"SubscriptionFailpointError\",\n { point: Schema.String },\n) {}\n\nexport type SubscriptionStoreFailure = SubscriptionError | SubscriptionFailpointError;\n\nexport const SubscriptionFailpoint = Context.Reference<{\n readonly hit: (point: string) => Effect.Effect<void, SubscriptionFailpointError>;\n}>(\"@effect-agent/thread/SubscriptionFailpoint\", {\n defaultValue: () => ({ hit: () => Effect.void }),\n});\n\nexport const SubscriptionRetentionPolicy = Schema.Struct({\n replayHorizonMillis: Positive,\n completedRetentionMillis: Schema.Natural,\n maxTombstones: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n});\n\nexport type SubscriptionRetentionPolicy = typeof SubscriptionRetentionPolicy.Type;\n\nexport const SubscriptionLimits = Schema.Struct({\n retention: Schema.optionalKey(SubscriptionRetentionPolicy),\n maxRegistrations: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n maxRegistrationsPerOwner: Positive.check(Schema.isLessThanOrEqualTo(10_000)),\n maxEvents: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n maxDeliveries: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n maxDeliveriesPerOwner: Positive.check(Schema.isLessThanOrEqualTo(10_000)),\n maxPayloadBytes: Positive.check(Schema.isLessThanOrEqualTo(65_536)),\n maxContextBytes: Positive.check(Schema.isLessThanOrEqualTo(16_384)),\n maxLifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(8_640_000_000_000_000)),\n batchSize: Positive.check(Schema.isLessThanOrEqualTo(100)),\n concurrency: Positive.check(Schema.isLessThanOrEqualTo(16)),\n retryMillis: Positive.check(Schema.isLessThanOrEqualTo(86_400_000)),\n maxAutomaticAttempts: Schema.optionalKey(Positive),\n operationTimeoutMillis: Positive.check(Schema.isLessThanOrEqualTo(300_000)),\n});\n\nexport type SubscriptionLimits = typeof SubscriptionLimits.Type;\n\nexport const defaultSubscriptionLimits: SubscriptionLimits = {\n maxRegistrations: 10_000,\n maxRegistrationsPerOwner: 1_000,\n maxEvents: 10_000,\n maxDeliveries: 10_000,\n maxDeliveriesPerOwner: 1_000,\n maxPayloadBytes: 65_536,\n maxContextBytes: 16_384,\n maxLifetimeMillis: 30 * 86_400_000,\n batchSize: 16,\n concurrency: 4,\n retryMillis: 30_000,\n operationTimeoutMillis: 30_000,\n maxAutomaticAttempts: 8,\n};\n\nexport const SubscriptionChange = Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"Recover\"), nowMillis: ScheduleInstant }),\n Schema.Struct({\n _tag: Schema.Literal(\"Update\"),\n configuration: SubscriptionConfiguration,\n configurationFingerprint: Digest,\n recovery: Schema.NullOr(SourceRecovery),\n }),\n Schema.Struct({ _tag: Schema.Literals([\"Pause\", \"Resume\"]) }),\n]);\n\nexport type SubscriptionChange = typeof SubscriptionChange.Type;\n\nexport const DeliveryChange = Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal(\"ObserveSettlement\"),\n receipt: Receipt,\n settled: Schema.Boolean,\n nowMillis: ScheduleInstant,\n nextAttemptAtMillis: ScheduleInstant,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"Recover\"),\n expectedGeneration: Schema.Natural,\n nowMillis: ScheduleInstant,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"Prepare\"),\n envelope: PreparedInput,\n envelopeDigest: Digest,\n nowMillis: ScheduleInstant,\n }),\n Schema.Struct({ _tag: Schema.Literal(\"Complete\"), receipt: Receipt, nowMillis: ScheduleInstant }),\n Schema.Struct({\n _tag: Schema.Literal(\"Refuse\"),\n refusal: SubscriptionRefusal,\n nowMillis: ScheduleInstant,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"Retry\"),\n retry: ScheduleRetry,\n nowMillis: ScheduleInstant,\n }),\n]);\n\nexport type DeliveryChange = typeof DeliveryChange.Type;\n\n/** Progress of bounded recovery sweeps, independent of individual work success. */\nexport const SubscriptionScanCursors = Schema.Struct({\n events: Schema.String,\n deliveries: Schema.String,\n recovery: Schema.Natural,\n});\n\nexport type SubscriptionScanCursors = typeof SubscriptionScanCursors.Type;\n\n/**\n * One store instance owns exactly one tenant/source partition. Every mutation is local and\n * atomic, including required Cloudflare wakes. Node has one process owner per database.\n * Records are retained for the partition lifetime; hard quotas reject new retained work.\n * No pruning may discard creation replay, deduplication, or unfinished-work evidence.\n */\nexport class SubscriptionStore extends Context.Service<\n SubscriptionStore,\n {\n readonly partition: SourcePartition;\n readonly compact: (\n nowMillis: number,\n policy: SubscriptionRetentionPolicy,\n limit: number,\n ) => Effect.Effect<number, SubscriptionStoreFailure>;\n readonly readScanCursors: Effect.Effect<SubscriptionScanCursors, SubscriptionError>;\n readonly advanceScanCursors: (\n cursors: SubscriptionScanCursors,\n ) => Effect.Effect<void, SubscriptionStoreFailure>;\n readonly register: (\n record: SubscriptionRecord,\n limits: SubscriptionLimits,\n ) => Effect.Effect<SubscriptionRecord, SubscriptionStoreFailure>;\n readonly get: (\n key: SubscriptionKey,\n ) => Effect.Effect<SubscriptionRecord | null, SubscriptionError>;\n readonly list: (\n ownerId: string,\n after: number,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<SubscriptionRecord>, SubscriptionError>;\n readonly change: (\n key: SubscriptionKey,\n expectedRevision: number,\n change: SubscriptionChange,\n ) => Effect.Effect<SubscriptionRecord, SubscriptionStoreFailure>;\n readonly cancel: (\n key: SubscriptionKey,\n expectedRevision?: number,\n ) => Effect.Effect<SubscriptionRecord, SubscriptionStoreFailure>;\n /** Duplicate identity returns the original cutoff and routing progress; payload/version conflicts fail. */\n readonly accept: (\n event: AcceptedEvent,\n limits: SubscriptionLimits,\n ) => Effect.Effect<AcceptedEvent, SubscriptionStoreFailure>;\n readonly event: (eventId: string) => Effect.Effect<AcceptedEvent | null, SubscriptionError>;\n readonly pendingEvents: (\n nowMillis: number,\n after: string,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<string>, SubscriptionError>;\n /** Indexed by partition, source/version, matchingKey, ordinal; never scan arbitrary parameters. */\n readonly candidates: (\n event: AcceptedEvent,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<SubscriptionRecord>, SubscriptionError>;\n /** Recheck cursor, eligibility, lifecycle and expiry; consume once + insert obligations + cursor together. */\n readonly select: (\n event: AcceptedEvent,\n deliveries: ReadonlyArray<SubscriptionDelivery>,\n cursor: number,\n complete: boolean,\n nowMillis: number,\n limits: SubscriptionLimits,\n ) => Effect.Effect<void, SubscriptionStoreFailure>;\n /** Only the explicitly reconciled watch may bypass cutoff, never reopen ordinary routing. */\n readonly catchUp: (\n event: AcceptedEvent,\n delivery: SubscriptionDelivery,\n nowMillis: number,\n limits: SubscriptionLimits,\n ) => Effect.Effect<void, SubscriptionStoreFailure>;\n readonly deferEvent: (\n eventId: string,\n nextAttemptAtMillis: number,\n code?: string,\n ) => Effect.Effect<void, SubscriptionStoreFailure>;\n readonly delivery: (\n key: SubscriptionDeliveryKey,\n ) => Effect.Effect<SubscriptionDelivery | null, SubscriptionError>;\n readonly pendingDeliveries: (\n nowMillis: number,\n after: string,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<SubscriptionDeliveryKey>, SubscriptionError>;\n readonly listDeliveries: (\n key: SubscriptionKey,\n after: string,\n limit: number,\n ) => Effect.Effect<ReadonlyArray<SubscriptionDelivery>, SubscriptionError>;\n /**\n * A matching deliveryId fences stale outcomes. Prepare rechecks cancellation and expiry atomically.\n * Retry advances only with a higher attempt count and a nondecreasing next-attempt time.\n */\n readonly changeDelivery: (\n key: SubscriptionDeliveryKey,\n deliveryId: Digest,\n change: DeliveryChange,\n ) => Effect.Effect<SubscriptionDelivery, SubscriptionStoreFailure>;\n readonly recovering: (\n nowMillis: number,\n after: number,\n limit: number,\n ) => Effect.Effect<\n ReadonlyArray<{ readonly key: SubscriptionKey; readonly ordinal: number }>,\n SubscriptionError\n >;\n readonly deferRecovery: (\n key: SubscriptionKey,\n expectedRevision: number,\n recovery: typeof SourceRecovery.Type | null,\n ) => Effect.Effect<void, SubscriptionStoreFailure>;\n readonly nextDeadline: Effect.Effect<number | null, SubscriptionError>;\n }\n>()(\"@effect-agent/thread/SubscriptionStore\") {}\n\n/** Explicit host policy. Management scope is not inferred from handle possession. */\nexport class SubscriptionAuthorizer extends Context.Service<\n SubscriptionAuthorizer,\n {\n readonly manage: (\n operation:\n | \"get\"\n | \"subscribe\"\n | \"update\"\n | \"pause\"\n | \"resume\"\n | \"recover\"\n | \"list\"\n | \"cancel\"\n | \"deliveries\",\n scope: SubscriptionScope,\n configuration?: SubscriptionConfiguration,\n ) => Effect.Effect<void, SubscriptionError>;\n readonly intake: (\n partition: SourcePartition,\n source: EventSourceVersion,\n principal: Principal,\n ) => Effect.Effect<void, SubscriptionError>;\n /** Host recovery authority, independent of the principal who registered the watch. */\n readonly reconcile: (\n subscription: SubscriptionRecord,\n ) => Effect.Effect<void, SubscriptionError>;\n readonly prepare: (\n subscription: SubscriptionRecord,\n event: AcceptedEvent,\n ) => Effect.Effect<typeof ScheduleAuthorizationDecision.Type, SubscriptionError>;\n }\n>()(\"@effect-agent/thread/SubscriptionAuthorizer\") {}\n\nexport const subscriptionKeyString = (key: SubscriptionKey): string =>\n JSON.stringify([key.partition.tenantId, key.partition.address, key.ownerId, key.subscriptionId]);\n\nexport const subscriptionDeliveryKeyString = (key: SubscriptionDeliveryKey): string =>\n JSON.stringify([key.subscription.ownerId, key.subscription.subscriptionId, key.eventId]);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,MAAa,mBAAmB,OAAO,eAAe,MACpD,OAAO,YAAY,GAAG,GACtB,OAAO,UAAU,sBAAsB,CACzC;AAEA,MAAM,WAAW,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;;AAGzD,MAAa,kBAAkB,OAAO,OAAO;CAC3C,UAAU;CACV,SAAS;AACX,CAAC;AAID,MAAa,qBAAqB,OAAO,OAAO;CAC9C,MAAM;CACN,SAAS;AACX,CAAC;AAID,MAAa,kBAAkB,OAAO,OAAO;CAC3C,WAAW;CACX,SAAS;CACT,gBAAgB;AAClB,CAAC;AAID,MAAa,oBAAoB,OAAO,OAAO;CAC7C,WAAW;CACX,SAAS;CACT,WAAW;AACb,CAAC;AAID,MAAa,4BAA4B,OAAO,OAAO;CACrD,QAAQ;CACR,aAAa;CACb,YAAY;CACZ,SAAS;CACT,MAAM,OAAO,SAAS,CAAC,QAAQ,YAAY,CAAC;;CAE5C,iBAAiB,OAAO,OAAO,eAAe;CAC9C,aAAa;CACb,mBAAmB;CACnB,gBAAgB,OAAO,YAAY,cAAc;CACjD,gBAAgB,OAAO,YAAY,cAAc;CACjD,SAAS;CACT,aAAa;AACf,CAAC;AAID,MAAa,iBAAiB,OAAO,OAAO;CAC1C,UAAU,OAAO;;CAEjB,qBAAqB,OAAO,OAAO,eAAe;CAClD,aAAa,OAAO,OAAO,gBAAgB;AAC7C,CAAC,CAAC,CAAC,MACD,OAAO,YAAY,UAAU,MAAM,wBAAwB,QAAQ,MAAM,gBAAgB,IAAI,CAC/F;AAEA,MAAa,qBAAqB,OAAO,OAAO;CAC9C,eAAe,OAAO,QAAQ,CAAC;CAC/B,K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from "../SubscriptionInput-vAAOBrK7.mjs";
2
+ export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
@@ -0,0 +1,52 @@
1
+ import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
+ import { PersistedJson } from "./Records.mjs";
3
+ import { a as definitionDigestsEqual } from "../agent-registration-CWDMOAZA.mjs";
4
+ import { SubscriptionError, SubscriptionSourceError } from "./Subscription.mjs";
5
+ import { Context, Effect, Schema } from "effect";
6
+ //#region src/durable/SubscriptionInput.ts
7
+ var SubscriptionInput_exports = /* @__PURE__ */ __exportAll({
8
+ SubscriptionInputBindings: () => SubscriptionInputBindings,
9
+ makeSubscriptionInputBinding: () => makeSubscriptionInputBinding,
10
+ resolveSubscriptionInput: () => resolveSubscriptionInput
11
+ });
12
+ var SubscriptionInputBindings = class extends Context.Service()("@effect-agent/thread/SubscriptionInputBindings") {};
13
+ /** Missing or ambiguous code stays pending. Never substitute a newer destination definition. */
14
+ const resolveSubscriptionInput = (bindings, configuration) => {
15
+ const found = bindings.filter((binding) => binding.source.name === configuration.source.name && binding.source.version === configuration.source.version && binding.agentId === configuration.agentId && definitionDigestsEqual(binding.definitions, configuration.definitions));
16
+ const binding = found[0];
17
+ return found.length === 1 && binding !== void 0 ? Effect.succeed(binding) : Effect.fail(SubscriptionError.make({
18
+ reason: "unsupported-binding",
19
+ code: "input-binding"
20
+ }));
21
+ };
22
+ /**
23
+ * Capture explicit dependencies at host assembly. Pass the destination definition's input Schema.
24
+ * Include the context Schema and mapper in its retained definition version; changing either
25
+ * requires new definition digests. Preparation may repeat until its envelope is committed.
26
+ * Each operation owns a fresh Scope for its callbacks and codecs; captured host services
27
+ * retain their host lifetime. Operation resources finalize on success, failure, or interruption.
28
+ */
29
+ const makeSubscriptionInputBinding = Effect.fn("Thread.makeSubscriptionInputBinding")(function* (options) {
30
+ const services = yield* Effect.context();
31
+ const invalid = () => SubscriptionSourceError.make({
32
+ code: "input-binding-schema",
33
+ retryable: false
34
+ });
35
+ const encode = (schema, value) => Schema.encodeEffect(schema)(value).pipe(Effect.flatMap(Schema.decodeUnknownEffect(PersistedJson)), Effect.mapError(invalid));
36
+ return {
37
+ source: options.source,
38
+ agentId: options.agentId,
39
+ definitions: options.definitions,
40
+ context: (value) => Schema.decodeUnknownEffect(PersistedJson)(value).pipe(Effect.flatMap(Schema.decodeUnknownEffect(options.context)), Effect.mapError(invalid), Effect.flatMap((decoded) => encode(options.context, decoded)), Effect.scoped, Effect.provideContext(services)),
41
+ prepare: (event, subscription) => Effect.gen(function* () {
42
+ const e = yield* Schema.decodeEffect(options.event)(event.payload).pipe(Effect.mapError(invalid));
43
+ const p = yield* Schema.decodeEffect(options.parameters)(subscription.configuration.parameters).pipe(Effect.mapError(invalid));
44
+ const c = yield* Schema.decodeEffect(options.context)(subscription.configuration.context).pipe(Effect.mapError(invalid));
45
+ return yield* encode(options.input, yield* options.prepare(e, p, c));
46
+ }).pipe(Effect.scoped, Effect.provideContext(services))
47
+ };
48
+ });
49
+ //#endregion
50
+ export { SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput, SubscriptionInput_exports as t };
51
+
52
+ //# sourceMappingURL=SubscriptionInput.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SubscriptionInput.mjs","names":[],"sources":["../../src/durable/SubscriptionInput.ts"],"sourcesContent":["import { Context, Effect, Schema, type Scope } from \"effect\";\n\nimport { type AgentId } from \"../core/Identifiers.ts\";\nimport { definitionDigestsEqual } from \"./internal/agent-registration.ts\";\nimport { type DefinitionDigests, PersistedJson } from \"./Records.ts\";\nimport {\n type AcceptedEvent,\n type EventSourceVersion,\n type SubscriptionConfiguration,\n type SubscriptionRecord,\n SubscriptionError,\n SubscriptionSourceError,\n} from \"./Subscription.ts\";\n\n/** Host-retained preparation code for one source and exact destination Agent definition. */\nexport interface SubscriptionInputBinding {\n readonly source: EventSourceVersion;\n readonly agentId: AgentId;\n readonly definitions: DefinitionDigests;\n readonly context: (value: unknown) => Effect.Effect<PersistedJson, SubscriptionSourceError>;\n readonly prepare: (\n event: AcceptedEvent,\n subscription: SubscriptionRecord,\n ) => Effect.Effect<PersistedJson, SubscriptionSourceError>;\n}\n\nexport class SubscriptionInputBindings extends Context.Service<\n SubscriptionInputBindings,\n { readonly bindings: ReadonlyArray<SubscriptionInputBinding> }\n>()(\"@effect-agent/thread/SubscriptionInputBindings\") {}\n\n/** Missing or ambiguous code stays pending. Never substitute a newer destination definition. */\nexport const resolveSubscriptionInput = (\n bindings: ReadonlyArray<SubscriptionInputBinding>,\n configuration: Pick<SubscriptionConfiguration, \"source\" | \"agentId\" | \"definitions\">,\n): Effect.Effect<SubscriptionInputBinding, SubscriptionError> => {\n const found = bindings.filter(\n (binding) =>\n binding.source.name === configuration.source.name &&\n binding.source.version === configuration.source.version &&\n binding.agentId === configuration.agentId &&\n definitionDigestsEqual(binding.definitions, configuration.definitions),\n );\n\n const binding = found[0];\n\n return found.length === 1 && binding !== undefined\n ? Effect.succeed(binding)\n : Effect.fail(SubscriptionError.make({ reason: \"unsupported-binding\", code: \"input-binding\" }));\n};\n\n/**\n * Capture explicit dependencies at host assembly. Pass the destination definition's input Schema.\n * Include the context Schema and mapper in its retained definition version; changing either\n * requires new definition digests. Preparation may repeat until its envelope is committed.\n * Each operation owns a fresh Scope for its callbacks and codecs; captured host services\n * retain their host lifetime. Operation resources finalize on success, failure, or interruption.\n */\nexport const makeSubscriptionInputBinding = Effect.fn(\"Thread.makeSubscriptionInputBinding\")(\n function* <\n Event extends Schema.Top,\n Parameters extends Schema.Top,\n Continuation extends Schema.Top,\n Input extends Schema.Top,\n R,\n >(options: {\n readonly source: EventSourceVersion;\n readonly agentId: AgentId;\n readonly definitions: DefinitionDigests;\n readonly event: Event;\n readonly parameters: Parameters;\n readonly context: Continuation;\n readonly input: Input;\n readonly prepare: (\n event: Event[\"Type\"],\n parameters: Parameters[\"Type\"],\n context: Continuation[\"Type\"],\n ) => Effect.Effect<Input[\"Type\"], SubscriptionSourceError, R>;\n }): Effect.fn.Return<\n SubscriptionInputBinding,\n never,\n Exclude<\n | R\n | Event[\"DecodingServices\"]\n | Parameters[\"DecodingServices\"]\n | Continuation[\"DecodingServices\"]\n | Continuation[\"EncodingServices\"]\n | Input[\"EncodingServices\"],\n Scope.Scope\n >\n > {\n const services =\n yield* Effect.context<\n Exclude<\n | R\n | Event[\"DecodingServices\"]\n | Parameters[\"DecodingServices\"]\n | Continuation[\"DecodingServices\"]\n | Continuation[\"EncodingServices\"]\n | Input[\"EncodingServices\"],\n Scope.Scope\n >\n >();\n\n const invalid = () =>\n SubscriptionSourceError.make({ code: \"input-binding-schema\", retryable: false });\n\n const encode = <S extends Schema.Top>(schema: S, value: S[\"Type\"]) =>\n Schema.encodeEffect(schema)(value).pipe(\n Effect.flatMap(Schema.decodeUnknownEffect(PersistedJson)),\n Effect.mapError(invalid),\n );\n\n return {\n source: options.source,\n agentId: options.agentId,\n definitions: options.definitions,\n context: (value) =>\n Schema.decodeUnknownEffect(PersistedJson)(value).pipe(\n Effect.flatMap(Schema.decodeUnknownEffect(options.context)),\n Effect.mapError(invalid),\n Effect.flatMap((decoded) => encode(options.context, decoded)),\n Effect.scoped,\n Effect.provideContext(services),\n ),\n prepare: (event, subscription) =>\n Effect.gen(function* () {\n const e = yield* Schema.decodeEffect(options.event)(event.payload).pipe(\n Effect.mapError(invalid),\n );\n\n const p = yield* Schema.decodeEffect(options.parameters)(\n subscription.configuration.parameters,\n ).pipe(Effect.mapError(invalid));\n\n const c = yield* Schema.decodeEffect(options.context)(\n subscription.configuration.context,\n ).pipe(Effect.mapError(invalid));\n\n return yield* encode(options.input, yield* options.prepare(e, p, c));\n }).pipe(Effect.scoped, Effect.provideContext(services)),\n };\n },\n);\n"],"mappings":";;;;;;;;;;;AA0BA,IAAa,4BAAb,cAA+C,QAAQ,QAGrD,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC;;AAGvD,MAAa,4BACX,UACA,k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D,aAAa,cAAc,UAC7B,CAAC,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC;GAE/B,MAAM,IAAI,OAAO,OAAO,aAAa,QAAQ,OAAO,CAAC,CACnD,aAAa,cAAc,OAC7B,CAAC,CAAC,KAAK,OAAO,SAAS,OAAO,CAAC;GAE/B,OAAO,OAAO,OAAO,QAAQ,OAAO,OAAO,QAAQ,QAAQ,GAAG,GAAG,CAAC,CAAC;EACrE,CAAC,CAAC,CAAC,KAAK,OAAO,QAAQ,OAAO,eAAe,QAAQ,CAAC;CAC1D;AACF,CACF"}
@@ -0,0 +1,17 @@
1
+ import { D as SubscriptionStore, O as SubscriptionStoreFailure, o as SourcePartition } from "../Subscription-BEP8oQO5.mjs";
2
+ import { Effect, Schema } from "effect";
3
+ //#region src/durable/SubscriptionStoreConformance.d.ts
4
+ declare const SubscriptionStoreConformanceViolation_base: Schema.Class<SubscriptionStoreConformanceViolation, Schema.TaggedStruct<"SubscriptionStoreConformanceViolation", {
5
+ readonly caseName: Schema.String;
6
+ readonly message: Schema.String;
7
+ }>, import("effect/Cause").YieldableError>;
8
+ declare class SubscriptionStoreConformanceViolation extends SubscriptionStoreConformanceViolation_base {}
9
+ interface SubscriptionStoreConformanceCase {
10
+ readonly name: string;
11
+ readonly run: Effect.Effect<void, SubscriptionStoreFailure | SubscriptionStoreConformanceViolation, SubscriptionStore>;
12
+ }
13
+ declare const subscriptionConformancePartition: SourcePartition;
14
+ declare const subscriptionStoreConformanceCases: ReadonlyArray<SubscriptionStoreConformanceCase>;
15
+ //#endregion
16
+ export { SubscriptionStoreConformanceCase, SubscriptionStoreConformanceViolation, subscriptionConformancePartition, subscriptionStoreConformanceCases };
17
+ //# sourceMappingURL=SubscriptionStoreConformance.d.mts.map