@systemfsoftware/agent 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-26pelcl9.d.mts +5678 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Agent-BH_R6LOI.d.mts +219 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-h07X1mZM.mjs +14 -0
- package/dist/AgentRegistration-h07X1mZM.mjs.map +1 -0
- package/dist/AgentRuntime-C3GQPdrv.d.mts +751 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs +5224 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-DgCEbTwW.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DMfj2beT.d.mts +62 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-D5jrWNNH.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs +8432 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BWY08cyT.d.mts +52 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-CPvcb5OX.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-C0S-Cakt.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DnnpWe-H.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-DPPHTLdT.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-CafxF31F.d.mts +22 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PersistentHistory-h-C7avqL.d.mts +14 -0
- package/dist/PreparedInputAdmission-DYugcCHR.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunContinuation-Cy2W8ASl.d.mts +127 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-DcqokgFt.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BaJXJIVt.d.mts +57 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-BJJN6n0E.mjs +1315 -0
- package/dist/Subagent-BJJN6n0E.mjs.map +1 -0
- package/dist/Subagent-GXU32fQt.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BC9B9dNT.d.mts +167 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BJ0TtZwM.d.mts +815 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs +53 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs.map +1 -0
- package/dist/SubscriptionInput-D6Okd6-z.d.mts +42 -0
- package/dist/SubscriptionTransition-Da9DmAr_.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs +638 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs.map +1 -0
- package/dist/Subscriptions-DgjahL6V.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-BVTD96Pe.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-BQDW9E_Y.d.mts +843 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadInvariants-w53c67YS.d.mts +23 -0
- package/dist/ThreadProjectionMaintenance-4ccU1auU.d.mts +51 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-D0KsqkSR.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-DvcfbTBk.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-NUk_x837.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/WebSearch-RBUUOfT8.d.mts +18 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-CubQgpsl.d.mts +171 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs +162 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs.map +1 -0
- package/dist/WorkerHost-BciHCzHq.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-D9ofkoBa.mjs +262 -0
- package/dist/agent-registration-D9ofkoBa.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-D1Tx1G6V.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +491 -3
- package/src/InMemory.ts +79 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/BrowserUse.ts +212 -0
- package/src/capabilities/Budget.ts +544 -0
- package/src/capabilities/CodeMode.ts +1129 -0
- package/src/capabilities/ContextTools.ts +131 -0
- package/src/capabilities/MemoryNotes.ts +177 -0
- package/src/capabilities/Messaging.ts +260 -0
- package/src/capabilities/Redaction.ts +163 -0
- package/src/capabilities/RunHooks.ts +116 -0
- package/src/capabilities/SemanticMemory.ts +402 -0
- package/src/capabilities/Subagent.ts +2343 -0
- package/src/capabilities/SubagentReservations.ts +807 -0
- package/src/capabilities/ToolDiscovery.ts +291 -0
- package/src/capabilities/ToolResults.ts +50 -0
- package/src/capabilities/WebCapture.ts +64 -0
- package/src/capabilities/WebSearch.ts +45 -0
- package/src/capabilities/internal/subagent-background.ts +1137 -0
- package/src/capabilities/internal/subagent-contract.ts +92 -0
- package/src/capabilities/internal/subagent-policy.ts +205 -0
- package/src/capabilities/internal/subagent-reporting.ts +152 -0
- package/src/core/Agent.ts +528 -0
- package/src/core/AgentError.ts +189 -0
- package/src/core/AgentPolicy.ts +194 -0
- package/src/core/AgentUpdates.ts +104 -0
- package/src/core/FailureDiagnostic.ts +392 -0
- package/src/core/IdGenerator.ts +42 -0
- package/src/core/Identifiers.ts +64 -0
- package/src/core/Memory.ts +283 -0
- package/src/core/MemoryNamespace.ts +202 -0
- package/src/core/MemoryReference.ts +120 -0
- package/src/core/MemoryRevalidation.ts +151 -0
- package/src/core/MemoryStore.ts +371 -0
- package/src/core/Messaging.ts +72 -0
- package/src/core/ProvisionalText.ts +53 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +22 -0
- package/src/core/RunEvent.ts +345 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +259 -0
- package/src/core/SemanticMemoryRevalidation.ts +220 -0
- package/src/core/SubagentContract.ts +263 -0
- package/src/core/Thread.ts +447 -0
- package/src/core/ToolExposure.ts +75 -0
- package/src/core/ToolResult.ts +204 -0
- package/src/core/ToolResultStorage.ts +56 -0
- package/src/core/Usage.ts +562 -0
- package/src/core/Worker.ts +236 -0
- package/src/core/internal/agent-updates.ts +42 -0
- package/src/core/internal/completion.ts +33 -0
- package/src/core/internal/json.ts +17 -0
- package/src/core/internal/memory-document.ts +39 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/tool-execution.ts +33 -0
- package/src/core/internal/utf8.ts +32 -0
- package/src/durable/ActivityStore.ts +131 -0
- package/src/durable/Admin.ts +504 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/CommittedActivity.ts +262 -0
- package/src/durable/Digest.ts +57 -0
- package/src/durable/DurableAgentRuntime.ts +12758 -0
- package/src/durable/DurableFailpoint.ts +108 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +179 -0
- package/src/durable/LifecyclePublication.ts +343 -0
- package/src/durable/MessageDelivery.ts +949 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
- package/src/durable/OperationAuthorizer.ts +89 -0
- package/src/durable/PersistentHistory.ts +322 -0
- package/src/durable/PreparedInputAdmission.ts +128 -0
- package/src/durable/RecordFormat.ts +113 -0
- package/src/durable/Records.ts +1396 -0
- package/src/durable/Recovery.ts +1022 -0
- package/src/durable/RunContinuation.ts +1946 -0
- package/src/durable/RunJournal.ts +1926 -0
- package/src/durable/RunStorage.ts +533 -0
- package/src/durable/Schedule.ts +445 -0
- package/src/durable/ScheduleStoreConformance.ts +642 -0
- package/src/durable/ScheduleTransition.ts +267 -0
- package/src/durable/Scheduling.ts +1031 -0
- package/src/durable/SettlementPublisher.ts +172 -0
- package/src/durable/SqlMemoryStore.ts +1042 -0
- package/src/durable/SqlStorageOwner.ts +25 -0
- package/src/durable/SubmissionLedger.ts +1247 -0
- package/src/durable/SubmissionLedgerConformance.ts +4695 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +527 -0
- package/src/durable/SubscriptionInput.ts +145 -0
- package/src/durable/SubscriptionStoreConformance.ts +1275 -0
- package/src/durable/SubscriptionTransition.ts +330 -0
- package/src/durable/Subscriptions.ts +1245 -0
- package/src/durable/ThreadArchiveRange.ts +91 -0
- package/src/durable/ThreadContextHistory.ts +338 -0
- package/src/durable/ThreadContextHistoryProjection.ts +219 -0
- package/src/durable/ThreadImport.ts +1199 -0
- package/src/durable/ThreadInvariants.ts +312 -0
- package/src/durable/ThreadProjectionMaintenance.ts +72 -0
- package/src/durable/ThreadReader.ts +21 -0
- package/src/durable/ThreadStore.ts +1258 -0
- package/src/durable/ThreadStoreConformance.ts +877 -0
- package/src/durable/ThreadTransfer.ts +263 -0
- package/src/durable/ThreadWork.ts +713 -0
- package/src/durable/ToolReconciler.ts +112 -0
- package/src/durable/WakeScheduler.ts +125 -0
- package/src/durable/WorkerAdmission.ts +98 -0
- package/src/durable/WorkerHost.ts +204 -0
- package/src/durable/internal/StorageOwner.ts +181 -0
- package/src/durable/internal/agent-registration.ts +713 -0
- package/src/durable/internal/agent-updates.ts +338 -0
- package/src/durable/internal/canonical-json.ts +110 -0
- package/src/durable/internal/evidence.ts +29 -0
- package/src/durable/internal/foreign-diagnostic.ts +48 -0
- package/src/durable/internal/history-prompt.ts +87 -0
- package/src/durable/internal/initial-context.ts +215 -0
- package/src/durable/internal/journal-metadata.ts +188 -0
- package/src/durable/internal/message-status.ts +18 -0
- package/src/durable/internal/messaging-host.ts +615 -0
- package/src/durable/internal/prompt-footprint.ts +47 -0
- package/src/durable/internal/prompt-history-cache.ts +604 -0
- package/src/durable/internal/record-encoding.ts +258 -0
- package/src/durable/internal/record-ownership.ts +68 -0
- package/src/durable/internal/run-context-reader.ts +51 -0
- package/src/durable/internal/run-context.ts +211 -0
- package/src/durable/internal/schedule-time.ts +304 -0
- package/src/durable/internal/thread-import-reader.ts +85 -0
- package/src/durable/internal/thread-initialization.ts +181 -0
- package/src/durable/internal/thread-transfer-source.ts +7 -0
- package/src/durable/internal/tool-operations.ts +138 -0
- package/src/durable/internal/transfer-dependencies.ts +40 -0
- package/src/durable/internal/usage-totals.ts +36 -0
- package/src/durable/internal/worker-host.ts +4041 -0
- package/src/durable/internal/worker-runtime.ts +10 -0
- package/src/engine/AgentRuntime.ts +100 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +302 -0
- package/src/engine/ContextHistory.ts +75 -0
- package/src/engine/ContextWindow.ts +81 -0
- package/src/engine/DurableStep.ts +115 -0
- package/src/engine/MessagingHost.ts +118 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +124 -0
- package/src/engine/RunOptions.ts +664 -0
- package/src/engine/SubagentHost.ts +231 -0
- package/src/engine/ThreadHistory.ts +125 -0
- package/src/engine/ToolBroker.ts +159 -0
- package/src/engine/ToolExposure.ts +49 -0
- package/src/engine/internal/agent-runtime.ts +11083 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,340 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { t as AgentId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
|
|
6
|
+
import { a as Receipt, r as Principal, t as IdempotencyKey } from "./Receipt-B-FlCaNH.mjs";
|
|
7
|
+
import { t as PreparedInput } from "./PreparedInputAdmission-adqVJJa6.mjs";
|
|
8
|
+
import { U as PersistedJson, b as Digest, v as DefinitionDigests } from "./Records-C645aQks.mjs";
|
|
9
|
+
import { f as ScheduleInstant, s as ScheduleDestination, x as ScheduleRetry } from "./Schedule-BY0lzbij.mjs";
|
|
10
|
+
import { o as AdmissionFence, s as AdmissionGroup } from "./SubmissionLedger-WG0beEyt.mjs";
|
|
11
|
+
// src/durable/Subscription.ts
|
|
12
|
+
var Subscription_exports = /* @__PURE__ */ __exportAll({
|
|
13
|
+
AcceptedEvent: () => AcceptedEvent,
|
|
14
|
+
DeliveryChange: () => DeliveryChange,
|
|
15
|
+
EventAcknowledgement: () => EventAcknowledgement,
|
|
16
|
+
EventSourceVersion: () => EventSourceVersion,
|
|
17
|
+
SourcePartition: () => SourcePartition,
|
|
18
|
+
SourceRecovery: () => SourceRecovery,
|
|
19
|
+
SubscriptionAuthorizer: () => SubscriptionAuthorizer,
|
|
20
|
+
SubscriptionChange: () => SubscriptionChange,
|
|
21
|
+
SubscriptionConfiguration: () => SubscriptionConfiguration,
|
|
22
|
+
SubscriptionDelivery: () => SubscriptionDelivery,
|
|
23
|
+
SubscriptionDeliveryKey: () => SubscriptionDeliveryKey,
|
|
24
|
+
SubscriptionDeliverySnapshot: () => SubscriptionDeliverySnapshot,
|
|
25
|
+
SubscriptionError: () => SubscriptionError,
|
|
26
|
+
SubscriptionFailpoint: () => SubscriptionFailpoint,
|
|
27
|
+
SubscriptionFailpointError: () => SubscriptionFailpointError,
|
|
28
|
+
SubscriptionKey: () => SubscriptionKey,
|
|
29
|
+
SubscriptionLimits: () => SubscriptionLimits,
|
|
30
|
+
SubscriptionName: () => SubscriptionName,
|
|
31
|
+
SubscriptionRecord: () => SubscriptionRecord,
|
|
32
|
+
SubscriptionRefusal: () => SubscriptionRefusal,
|
|
33
|
+
SubscriptionRetentionPolicy: () => SubscriptionRetentionPolicy,
|
|
34
|
+
SubscriptionScanCursors: () => SubscriptionScanCursors,
|
|
35
|
+
SubscriptionScope: () => SubscriptionScope,
|
|
36
|
+
SubscriptionSnapshot: () => SubscriptionSnapshot,
|
|
37
|
+
SubscriptionSourceError: () => SubscriptionSourceError,
|
|
38
|
+
SubscriptionStore: () => SubscriptionStore,
|
|
39
|
+
defaultSubscriptionLimits: () => defaultSubscriptionLimits,
|
|
40
|
+
subscriptionDeliveryKeyString: () => subscriptionDeliveryKeyString,
|
|
41
|
+
subscriptionKeyString: () => subscriptionKeyString
|
|
42
|
+
});
|
|
43
|
+
const SubscriptionName = Schema.NonEmptyString.check(Schema.isMaxLength(256), Schema.isPattern(/^[^\p{Surrogate}]*$/u));
|
|
44
|
+
const Positive = Schema.Int.check(Schema.isGreaterThan(0));
|
|
45
|
+
/** Stable storage identity. Deployment and payload values must never change its routing. */
|
|
46
|
+
const SourcePartition = Schema.Struct({
|
|
47
|
+
tenantId: SubscriptionName,
|
|
48
|
+
address: SubscriptionName
|
|
49
|
+
});
|
|
50
|
+
const EventSourceVersion = Schema.Struct({
|
|
51
|
+
name: SubscriptionName,
|
|
52
|
+
version: SubscriptionName
|
|
53
|
+
});
|
|
54
|
+
const SubscriptionKey = Schema.Struct({
|
|
55
|
+
partition: SourcePartition,
|
|
56
|
+
ownerId: SubscriptionName,
|
|
57
|
+
subscriptionId: SubscriptionName
|
|
58
|
+
});
|
|
59
|
+
const SubscriptionScope = Schema.Struct({
|
|
60
|
+
partition: SourcePartition,
|
|
61
|
+
ownerId: SubscriptionName,
|
|
62
|
+
principal: Principal
|
|
63
|
+
});
|
|
64
|
+
const SubscriptionConfiguration = Schema.Struct({
|
|
65
|
+
source: EventSourceVersion,
|
|
66
|
+
matchingKey: SubscriptionName,
|
|
67
|
+
parameters: PersistedJson,
|
|
68
|
+
context: PersistedJson,
|
|
69
|
+
mode: Schema.Literals(["once", "continuous"]),
|
|
70
|
+
/** Null disables time-based expiry; once selection and cancellation still apply. */
|
|
71
|
+
expiresAtMillis: Schema.NullOr(ScheduleInstant),
|
|
72
|
+
destination: ScheduleDestination,
|
|
73
|
+
deliveryPrincipal: Principal,
|
|
74
|
+
admissionGroup: Schema.optionalKey(AdmissionGroup),
|
|
75
|
+
admissionFence: Schema.optionalKey(AdmissionFence),
|
|
76
|
+
agentId: AgentId,
|
|
77
|
+
definitions: DefinitionDigests
|
|
78
|
+
});
|
|
79
|
+
const SourceRecovery = Schema.Struct({
|
|
80
|
+
attempts: Schema.Natural,
|
|
81
|
+
/** Null retains a conclusive source failure without continuing provider polling. */
|
|
82
|
+
nextAttemptAtMillis: Schema.NullOr(ScheduleInstant),
|
|
83
|
+
lastFailure: Schema.NullOr(SubscriptionName)
|
|
84
|
+
}).check(Schema.makeFilter((value) => value.nextAttemptAtMillis !== null || value.lastFailure !== null));
|
|
85
|
+
const SubscriptionRecord = Schema.Struct({
|
|
86
|
+
schemaVersion: Schema.Literal(1),
|
|
87
|
+
key: SubscriptionKey,
|
|
88
|
+
creationFingerprint: Digest,
|
|
89
|
+
configurationRevision: Positive,
|
|
90
|
+
configurationFingerprint: Digest,
|
|
91
|
+
creationConfiguration: SubscriptionConfiguration,
|
|
92
|
+
createdBy: Principal,
|
|
93
|
+
createdAtMillis: ScheduleInstant,
|
|
94
|
+
/** Assigned atomically in the same order as event eligibility cutoffs. */
|
|
95
|
+
ordinal: Schema.Natural,
|
|
96
|
+
configuration: SubscriptionConfiguration,
|
|
97
|
+
state: Schema.Literals([
|
|
98
|
+
"active",
|
|
99
|
+
"paused",
|
|
100
|
+
"consumed",
|
|
101
|
+
"cancelled"
|
|
102
|
+
]),
|
|
103
|
+
recovery: Schema.NullOr(SourceRecovery)
|
|
104
|
+
}).check(Schema.makeFilter((value) => (value.state !== "consumed" || value.configuration.mode === "once") && (value.recovery === null || value.configuration.mode === "once" && (value.state === "active" || value.state === "paused"))));
|
|
105
|
+
const AcceptedEvent = Schema.Struct({
|
|
106
|
+
schemaVersion: Schema.Literal(1),
|
|
107
|
+
partition: SourcePartition,
|
|
108
|
+
eventId: SubscriptionName,
|
|
109
|
+
source: EventSourceVersion,
|
|
110
|
+
matchingKey: SubscriptionName,
|
|
111
|
+
payload: PersistedJson,
|
|
112
|
+
payloadDigest: Digest,
|
|
113
|
+
acceptedAtMillis: ScheduleInstant,
|
|
114
|
+
occurredAtMillis: Schema.optionalKey(ScheduleInstant),
|
|
115
|
+
/** Deduplication evidence after completed payload/delivery retention ends. */
|
|
116
|
+
tombstone: Schema.optionalKey(Schema.Boolean),
|
|
117
|
+
cutoff: Schema.Natural,
|
|
118
|
+
cursor: Schema.Natural,
|
|
119
|
+
routingComplete: Schema.Boolean,
|
|
120
|
+
routingFailure: Schema.NullOr(SubscriptionName),
|
|
121
|
+
nextAttemptAtMillis: ScheduleInstant
|
|
122
|
+
}).check(Schema.makeFilter((value) => value.cursor <= value.cutoff && (value.tombstone !== true || value.payload === null && value.routingComplete)));
|
|
123
|
+
const EventAcknowledgement = Schema.Struct({
|
|
124
|
+
partition: SourcePartition,
|
|
125
|
+
eventId: SubscriptionName,
|
|
126
|
+
acceptedAtMillis: ScheduleInstant
|
|
127
|
+
});
|
|
128
|
+
const SubscriptionDeliveryKey = Schema.Struct({
|
|
129
|
+
subscription: SubscriptionKey,
|
|
130
|
+
eventId: SubscriptionName
|
|
131
|
+
});
|
|
132
|
+
const SubscriptionRefusal = Schema.Struct({
|
|
133
|
+
phase: Schema.Literals(["preparation", "admission"]),
|
|
134
|
+
code: SubscriptionName
|
|
135
|
+
});
|
|
136
|
+
const SubscriptionDelivery = Schema.Struct({
|
|
137
|
+
schemaVersion: Schema.Literal(1),
|
|
138
|
+
key: SubscriptionDeliveryKey,
|
|
139
|
+
deliveryId: Digest,
|
|
140
|
+
subscriptionFingerprint: Digest,
|
|
141
|
+
configurationRevision: Positive,
|
|
142
|
+
configuration: SubscriptionConfiguration,
|
|
143
|
+
eventDigest: Digest,
|
|
144
|
+
source: EventSourceVersion,
|
|
145
|
+
threadId: ThreadId,
|
|
146
|
+
admissionKey: IdempotencyKey,
|
|
147
|
+
selectedAtMillis: ScheduleInstant,
|
|
148
|
+
observeSettlement: Schema.optionalKey(Schema.Boolean),
|
|
149
|
+
settledAtMillis: Schema.optionalKey(ScheduleInstant),
|
|
150
|
+
completedAtMillis: Schema.optionalKey(ScheduleInstant),
|
|
151
|
+
state: Schema.Literals([
|
|
152
|
+
"selected",
|
|
153
|
+
"prepared",
|
|
154
|
+
"delivered",
|
|
155
|
+
"refused"
|
|
156
|
+
]),
|
|
157
|
+
envelope: Schema.NullOr(PreparedInput),
|
|
158
|
+
envelopeDigest: Schema.NullOr(Digest),
|
|
159
|
+
retry: ScheduleRetry,
|
|
160
|
+
receipt: Schema.NullOr(Receipt),
|
|
161
|
+
refusal: Schema.NullOr(SubscriptionRefusal)
|
|
162
|
+
}).check(Schema.makeFilter((value) => {
|
|
163
|
+
const hasEnvelope = value.envelope !== null && value.envelopeDigest !== null;
|
|
164
|
+
const noEnvelope = value.envelope === null && value.envelopeDigest === null;
|
|
165
|
+
switch (value.state) {
|
|
166
|
+
case "selected": return noEnvelope && value.receipt === null && value.refusal === null;
|
|
167
|
+
case "prepared": return hasEnvelope && value.receipt === null && value.refusal === null;
|
|
168
|
+
case "delivered": return hasEnvelope && value.receipt !== null && value.refusal === null;
|
|
169
|
+
case "refused": return value.receipt === null && value.refusal !== null && (value.refusal.phase === "preparation" ? noEnvelope : hasEnvelope);
|
|
170
|
+
}
|
|
171
|
+
}));
|
|
172
|
+
/** Management projections intentionally exclude parameters, context, payload, and input. */
|
|
173
|
+
const SubscriptionSnapshot = Schema.Struct({
|
|
174
|
+
key: SubscriptionKey,
|
|
175
|
+
source: EventSourceVersion,
|
|
176
|
+
mode: Schema.Literals(["once", "continuous"]),
|
|
177
|
+
state: Schema.Literals([
|
|
178
|
+
"active",
|
|
179
|
+
"paused",
|
|
180
|
+
"consumed",
|
|
181
|
+
"cancelled",
|
|
182
|
+
"expired"
|
|
183
|
+
]),
|
|
184
|
+
configurationRevision: Positive,
|
|
185
|
+
configurationFingerprint: Digest,
|
|
186
|
+
admissionGroup: SubscriptionConfiguration.fields.admissionGroup,
|
|
187
|
+
admissionFence: SubscriptionConfiguration.fields.admissionFence,
|
|
188
|
+
createdAtMillis: ScheduleInstant,
|
|
189
|
+
/** Null disables time-based expiry; once selection and cancellation still apply. */
|
|
190
|
+
expiresAtMillis: Schema.NullOr(ScheduleInstant),
|
|
191
|
+
recovery: Schema.NullOr(SourceRecovery)
|
|
192
|
+
});
|
|
193
|
+
const SubscriptionDeliverySnapshot = Schema.Struct({
|
|
194
|
+
key: SubscriptionDeliveryKey,
|
|
195
|
+
state: SubscriptionDelivery.fields.state,
|
|
196
|
+
configurationRevision: Positive,
|
|
197
|
+
observeSettlement: Schema.optionalKey(Schema.Boolean),
|
|
198
|
+
settledAtMillis: Schema.optionalKey(ScheduleInstant),
|
|
199
|
+
retry: ScheduleRetry,
|
|
200
|
+
receipt: Schema.NullOr(Receipt),
|
|
201
|
+
refusal: Schema.NullOr(SubscriptionRefusal)
|
|
202
|
+
});
|
|
203
|
+
var SubscriptionError = class extends Schema.TaggedError()("SubscriptionError", {
|
|
204
|
+
reason: Schema.Literals([
|
|
205
|
+
"validation",
|
|
206
|
+
"conflict",
|
|
207
|
+
"not-found",
|
|
208
|
+
"capacity",
|
|
209
|
+
"unauthorized",
|
|
210
|
+
"unsupported-source",
|
|
211
|
+
"unsupported-binding",
|
|
212
|
+
"storage",
|
|
213
|
+
"corrupt"
|
|
214
|
+
]),
|
|
215
|
+
code: SubscriptionName,
|
|
216
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
217
|
+
currentRevision: Schema.optionalKey(Positive),
|
|
218
|
+
currentState: Schema.optionalKey(Schema.Literals([
|
|
219
|
+
"active",
|
|
220
|
+
"paused",
|
|
221
|
+
"consumed",
|
|
222
|
+
"cancelled"
|
|
223
|
+
]))
|
|
224
|
+
}) {};
|
|
225
|
+
/** Host source adapters classify expected failures; raw provider diagnostics are never stored. */
|
|
226
|
+
var SubscriptionSourceError = class extends Schema.TaggedError()("SubscriptionSourceError", {
|
|
227
|
+
code: SubscriptionName,
|
|
228
|
+
retryable: Schema.Boolean
|
|
229
|
+
}) {};
|
|
230
|
+
var SubscriptionFailpointError = class extends Schema.TaggedError()("SubscriptionFailpointError", { point: Schema.String }) {};
|
|
231
|
+
const SubscriptionFailpoint = Context.Reference("@effect-agent/thread/SubscriptionFailpoint", { defaultValue: () => ({ hit: () => Effect.void }) });
|
|
232
|
+
const SubscriptionRetentionPolicy = Schema.Struct({
|
|
233
|
+
replayHorizonMillis: Positive,
|
|
234
|
+
completedRetentionMillis: Schema.Natural,
|
|
235
|
+
maxTombstones: Positive.check(Schema.isLessThanOrEqualTo(1e5))
|
|
236
|
+
});
|
|
237
|
+
const SubscriptionLimits = Schema.Struct({
|
|
238
|
+
retention: Schema.optionalKey(SubscriptionRetentionPolicy),
|
|
239
|
+
/** Partition-wide active/paused, unexpired registration capacity. */
|
|
240
|
+
maxRegistrations: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
|
|
241
|
+
/** Active and paused registrations whose expiry has not passed. */
|
|
242
|
+
maxRegistrationsPerOwner: Positive.check(Schema.isLessThanOrEqualTo(1e4)),
|
|
243
|
+
/** Partition-wide unfinished routing capacity; selected deliveries have their own limits. */
|
|
244
|
+
maxEvents: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
|
|
245
|
+
/** Partition-wide selected/prepared work and observed unsettled admission capacity. */
|
|
246
|
+
maxDeliveries: Positive.check(Schema.isLessThanOrEqualTo(1e5)),
|
|
247
|
+
/** Selected/prepared work, including parked retries, and observed unsettled admissions. */
|
|
248
|
+
maxDeliveriesPerOwner: Positive.check(Schema.isLessThanOrEqualTo(1e4)),
|
|
249
|
+
maxPayloadBytes: Positive.check(Schema.isLessThanOrEqualTo(65536)),
|
|
250
|
+
maxContextBytes: Positive.check(Schema.isLessThanOrEqualTo(16384)),
|
|
251
|
+
maxLifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(864e13)),
|
|
252
|
+
batchSize: Positive.check(Schema.isLessThanOrEqualTo(100)),
|
|
253
|
+
concurrency: Positive.check(Schema.isLessThanOrEqualTo(16)),
|
|
254
|
+
retryMillis: Positive.check(Schema.isLessThanOrEqualTo(864e5)),
|
|
255
|
+
maxAutomaticAttempts: Schema.optionalKey(Positive),
|
|
256
|
+
operationTimeoutMillis: Positive.check(Schema.isLessThanOrEqualTo(3e5))
|
|
257
|
+
});
|
|
258
|
+
const defaultSubscriptionLimits = {
|
|
259
|
+
maxRegistrations: 1e4,
|
|
260
|
+
maxRegistrationsPerOwner: 1e3,
|
|
261
|
+
maxEvents: 1e4,
|
|
262
|
+
maxDeliveries: 1e4,
|
|
263
|
+
maxDeliveriesPerOwner: 1e3,
|
|
264
|
+
maxPayloadBytes: 65536,
|
|
265
|
+
maxContextBytes: 16384,
|
|
266
|
+
maxLifetimeMillis: 2592e6,
|
|
267
|
+
batchSize: 16,
|
|
268
|
+
concurrency: 4,
|
|
269
|
+
retryMillis: 3e4,
|
|
270
|
+
operationTimeoutMillis: 3e4,
|
|
271
|
+
maxAutomaticAttempts: 8
|
|
272
|
+
};
|
|
273
|
+
const SubscriptionChange = Schema.Union([
|
|
274
|
+
Schema.TaggedStruct("Recover", { nowMillis: ScheduleInstant }),
|
|
275
|
+
Schema.TaggedStruct("Update", {
|
|
276
|
+
configuration: SubscriptionConfiguration,
|
|
277
|
+
configurationFingerprint: Digest,
|
|
278
|
+
recovery: Schema.NullOr(SourceRecovery)
|
|
279
|
+
}),
|
|
280
|
+
Schema.Struct({ _tag: Schema.Literals(["Pause", "Resume"]) })
|
|
281
|
+
]);
|
|
282
|
+
const DeliveryChange = Schema.Union([
|
|
283
|
+
Schema.TaggedStruct("ObserveSettlement", {
|
|
284
|
+
receipt: Receipt,
|
|
285
|
+
settled: Schema.Boolean,
|
|
286
|
+
nowMillis: ScheduleInstant,
|
|
287
|
+
nextAttemptAtMillis: ScheduleInstant
|
|
288
|
+
}),
|
|
289
|
+
Schema.TaggedStruct("Recover", {
|
|
290
|
+
expectedGeneration: Schema.Natural,
|
|
291
|
+
nowMillis: ScheduleInstant
|
|
292
|
+
}),
|
|
293
|
+
Schema.TaggedStruct("Prepare", {
|
|
294
|
+
envelope: PreparedInput,
|
|
295
|
+
envelopeDigest: Digest,
|
|
296
|
+
nowMillis: ScheduleInstant
|
|
297
|
+
}),
|
|
298
|
+
Schema.TaggedStruct("Complete", {
|
|
299
|
+
receipt: Receipt,
|
|
300
|
+
nowMillis: ScheduleInstant
|
|
301
|
+
}),
|
|
302
|
+
Schema.TaggedStruct("Refuse", {
|
|
303
|
+
refusal: SubscriptionRefusal,
|
|
304
|
+
nowMillis: ScheduleInstant
|
|
305
|
+
}),
|
|
306
|
+
Schema.TaggedStruct("Retry", {
|
|
307
|
+
retry: ScheduleRetry,
|
|
308
|
+
nowMillis: ScheduleInstant
|
|
309
|
+
})
|
|
310
|
+
]);
|
|
311
|
+
/** Progress of bounded recovery sweeps, independent of individual work success. */
|
|
312
|
+
const SubscriptionScanCursors = Schema.Struct({
|
|
313
|
+
events: Schema.String,
|
|
314
|
+
deliveries: Schema.String,
|
|
315
|
+
recovery: Schema.Natural
|
|
316
|
+
});
|
|
317
|
+
/**
|
|
318
|
+
* One store instance owns exactly one tenant/source partition. Every mutation is local and
|
|
319
|
+
* atomic, including required Cloudflare wakes. Node has one process owner per database.
|
|
320
|
+
* Without retention, records remain for the partition lifetime. Partition-wide and per-owner
|
|
321
|
+
* quotas bound live work, never completed replay history. Retention controls evidence reclamation.
|
|
322
|
+
* No pruning may discard creation replay, deduplication, or unfinished-work evidence.
|
|
323
|
+
*/
|
|
324
|
+
var SubscriptionStore = class extends Context.Service()("@effect-agent/thread/SubscriptionStore") {};
|
|
325
|
+
/** Explicit host policy. Management scope is not inferred from handle possession. */
|
|
326
|
+
var SubscriptionAuthorizer = class extends Context.Service()("@effect-agent/thread/SubscriptionAuthorizer") {};
|
|
327
|
+
const subscriptionKeyString = (key) => JSON.stringify([
|
|
328
|
+
key.partition.tenantId,
|
|
329
|
+
key.partition.address,
|
|
330
|
+
key.ownerId,
|
|
331
|
+
key.subscriptionId
|
|
332
|
+
]);
|
|
333
|
+
const subscriptionDeliveryKeyString = (key) => JSON.stringify([
|
|
334
|
+
key.subscription.ownerId,
|
|
335
|
+
key.subscription.subscriptionId,
|
|
336
|
+
key.eventId
|
|
337
|
+
]);
|
|
338
|
+
export { subscriptionKeyString as A, SubscriptionScope as C, Subscription_exports as D, SubscriptionStore as E, defaultSubscriptionLimits as O, SubscriptionScanCursors as S, SubscriptionSourceError as T, SubscriptionLimits as _, SourcePartition as a, SubscriptionRefusal as b, SubscriptionChange as c, SubscriptionDeliveryKey as d, SubscriptionDeliverySnapshot as f, SubscriptionKey as g, SubscriptionFailpointError as h, EventSourceVersion as i, subscriptionDeliveryKeyString as k, SubscriptionConfiguration as l, SubscriptionFailpoint as m, DeliveryChange as n, SourceRecovery as o, SubscriptionError as p, EventAcknowledgement as r, SubscriptionAuthorizer as s, AcceptedEvent as t, SubscriptionDelivery as u, SubscriptionName as v, SubscriptionSnapshot as w, SubscriptionRetentionPolicy as x, SubscriptionRecord as y };
|
|
339
|
+
|
|
340
|
+
//# sourceMappingURL=Subscription-BhQbmUD-.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Subscription-BhQbmUD-.mjs","names":[],"sources":["../src/durable/Subscription.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport { AgentId, ThreadId } from '../core/Identifiers'\nimport { Receipt } from '../core/Receipt'\nimport type { PreparedInputAuthorizationDecision } from './PreparedInputAdmission'\nimport { PreparedInput } from './PreparedInputAdmission'\nimport { DefinitionDigests, Digest, PersistedJson } from './Records'\nimport { ScheduleDestination, ScheduleInstant, ScheduleRetry } from './Schedule'\nimport { AdmissionFence, AdmissionGroup, IdempotencyKey, Principal } from './SubmissionLedger'\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\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 /** Partition-wide active/paused, unexpired registration capacity. */\n maxRegistrations: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n /** Active and paused registrations whose expiry has not passed. */\n maxRegistrationsPerOwner: Positive.check(Schema.isLessThanOrEqualTo(10_000)),\n /** Partition-wide unfinished routing capacity; selected deliveries have their own limits. */\n maxEvents: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n /** Partition-wide selected/prepared work and observed unsettled admission capacity. */\n maxDeliveries: Positive.check(Schema.isLessThanOrEqualTo(100_000)),\n /** Selected/prepared work, including parked retries, and observed unsettled admissions. */\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.TaggedStruct('Recover', { nowMillis: ScheduleInstant }),\n Schema.TaggedStruct('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.TaggedStruct('ObserveSettlement', {\n receipt: Receipt,\n settled: Schema.Boolean,\n nowMillis: ScheduleInstant,\n nextAttemptAtMillis: ScheduleInstant,\n }),\n Schema.TaggedStruct('Recover', {\n expectedGeneration: Schema.Natural,\n nowMillis: ScheduleInstant,\n }),\n Schema.TaggedStruct('Prepare', {\n envelope: PreparedInput,\n envelopeDigest: Digest,\n nowMillis: ScheduleInstant,\n }),\n Schema.TaggedStruct('Complete', { receipt: Receipt, nowMillis: ScheduleInstant }),\n Schema.TaggedStruct('Refuse', {\n refusal: SubscriptionRefusal,\n nowMillis: ScheduleInstant,\n }),\n Schema.TaggedStruct('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 * Without retention, records remain for the partition lifetime. Partition-wide and per-owner\n * quotas bound live work, never completed replay history. Retention controls evidence reclamation.\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 /** Reopening expired work reserves capacity; defaults to defaultSubscriptionLimits. */\n limits?: SubscriptionLimits,\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 /** Distinct delivery keys only. Recheck eligibility and consume once + insert obligations + cursor atomically. */\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 * Starting settlement observation reserves capacity using the supplied or default limits.\n */\n readonly changeDelivery: (\n key: SubscriptionDeliveryKey,\n deliveryId: Digest,\n change: DeliveryChange,\n limits?: SubscriptionLimits,\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<PreparedInputAuthorizationDecision, 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":"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"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { o as definitionDigestsEqual } from "./agent-registration-D9ofkoBa.mjs";
|
|
6
|
+
import { U as PersistedJson } from "./Records-C645aQks.mjs";
|
|
7
|
+
import { T as SubscriptionSourceError, p as SubscriptionError } from "./Subscription-BhQbmUD-.mjs";
|
|
8
|
+
// src/durable/SubscriptionInput.ts
|
|
9
|
+
var SubscriptionInput_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
SubscriptionInputBindings: () => SubscriptionInputBindings,
|
|
11
|
+
makeSubscriptionInputBinding: () => makeSubscriptionInputBinding,
|
|
12
|
+
resolveSubscriptionInput: () => resolveSubscriptionInput
|
|
13
|
+
});
|
|
14
|
+
var SubscriptionInputBindings = class extends Context.Service()("@effect-agent/thread/SubscriptionInputBindings") {};
|
|
15
|
+
/** Missing or ambiguous code stays pending. Never substitute a newer destination definition. */
|
|
16
|
+
const resolveSubscriptionInput = (bindings, configuration) => {
|
|
17
|
+
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));
|
|
18
|
+
const binding = found[0];
|
|
19
|
+
return found.length === 1 && binding !== void 0 ? Effect.succeed(binding) : Effect.fail(SubscriptionError.make({
|
|
20
|
+
reason: "unsupported-binding",
|
|
21
|
+
code: "input-binding"
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Capture explicit dependencies at host assembly. Pass the destination definition's input Schema.
|
|
26
|
+
* Include the context Schema and mapper in its retained definition version; changing either
|
|
27
|
+
* requires new definition digests. Preparation may repeat until its envelope is committed.
|
|
28
|
+
* Each operation owns a fresh Scope for its callbacks and codecs; captured host services
|
|
29
|
+
* retain their host lifetime. Operation resources finalize on success, failure, or interruption.
|
|
30
|
+
*/
|
|
31
|
+
const makeSubscriptionInputBinding = Effect.fnUntraced(function* (options) {
|
|
32
|
+
const services = yield* Effect.context();
|
|
33
|
+
const invalid = () => SubscriptionSourceError.make({
|
|
34
|
+
code: "input-binding-schema",
|
|
35
|
+
retryable: false
|
|
36
|
+
});
|
|
37
|
+
const encode = (schema, value) => Schema.encodeEffect(schema)(value).pipe(Effect.flatMap(Schema.decodeUnknownEffect(PersistedJson)), Effect.mapError(invalid));
|
|
38
|
+
return {
|
|
39
|
+
source: options.source,
|
|
40
|
+
agentId: options.agentId,
|
|
41
|
+
definitions: options.definitions,
|
|
42
|
+
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)),
|
|
43
|
+
prepare: Effect.fnUntraced(function* (event, subscription) {
|
|
44
|
+
const e = yield* Schema.decodeEffect(options.event)(event.payload).pipe(Effect.mapError(invalid));
|
|
45
|
+
const p = yield* Schema.decodeEffect(options.parameters)(subscription.configuration.parameters).pipe(Effect.mapError(invalid));
|
|
46
|
+
const c = yield* Schema.decodeEffect(options.context)(subscription.configuration.context).pipe(Effect.mapError(invalid));
|
|
47
|
+
return yield* encode(options.input, yield* options.prepare(e, p, c));
|
|
48
|
+
}, (effect) => effect.pipe(Effect.scoped, Effect.provideContext(services)))
|
|
49
|
+
};
|
|
50
|
+
});
|
|
51
|
+
export { resolveSubscriptionInput as i, SubscriptionInput_exports as n, makeSubscriptionInputBinding as r, SubscriptionInputBindings as t };
|
|
52
|
+
|
|
53
|
+
//# sourceMappingURL=SubscriptionInput-BbV69oX_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubscriptionInput-BbV69oX_.mjs","names":[],"sources":["../src/durable/SubscriptionInput.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\nimport type * as Scope from 'effect/Scope'\n\nimport { type AgentId } from '../core/Identifiers'\nimport { definitionDigestsEqual } from './internal/agent-registration'\nimport { type DefinitionDigests, PersistedJson } from './Records'\nimport {\n type AcceptedEvent,\n type EventSourceVersion,\n type SubscriptionConfiguration,\n SubscriptionError,\n type SubscriptionRecord,\n SubscriptionSourceError,\n} from './Subscription'\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.fnUntraced(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 = 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 = () => 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: Effect.fnUntraced(\n function*(event, subscription) {\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 },\n (effect) => effect.pipe(Effect.scoped, Effect.provideContext(services)),\n ),\n }\n})\n"],"mappings":";;;;;;;;;;;;;AA6BA,IAAa,4BAAb,cAA+C,QAAQ,QAGrD,CAAC,CAAC,gDAAgD,CAAC,CAAC,CAAC;;AAGvD,MAAa,4BACX,UACA,kBAC+D;CAC/D,MAAM,QAAQ,SAAS,QACpB,YACC,QAAQ,OAAO,SAAS,cAAc,OAAO,QAC7C,QAAQ,OAAO,YAAY,cAAc,OAAO,WAChD,QAAQ,YAAY,cAAc,WAClC,uBAAuB,QAAQ,aAAa,cAAc,WAAW,CACzE;CAEA,MAAM,UAAU,MAAM;CAEtB,OAAO,MAAM,WAAW,KAAK,YAAY,KAAA,IACrC,OAAO,QAAQ,OAAO,IACtB,OAAO,KAAK,kBAAkB,KAAK;EAAE,QAAQ;EAAuB,MAAM;CAAgB,CAAC,CAAC;AAClG;;;;;;;;AASA,MAAa,+BAA+B,OAAO,WAAW,WAM5D,SAyBA;CACA,MAAM,WAAW,OAAO,OAAO,QAU7B;CAEF,MAAM,gBAAgB,wBAAwB,KAAK;EAAE,MAAM;EAAwB,WAAW;CAAM,CAAC;CAErG,MAAM,UAAgC,QAAW,UAC/C,OAAO,aAAa,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KACjC,OAAO,QAAQ,OAAO,oBAAoB,aAAa,CAAC,GACxD,OAAO,SAAS,OAAO,CACzB;CAEF,OAAO;EACL,QAAQ,QAAQ;EAChB,SAAS,QAAQ;EACjB,aAAa,QAAQ;EACrB,UAAU,UACR,OAAO,oBAAoB,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,KAC/C,OAAO,QAAQ,OAAO,oBAAoB,QAAQ,OAAO,CAAC,GAC1D,OAAO,SAAS,OAAO,GACvB,OAAO,SAAS,YAAY,OAAO,QAAQ,SAAS,OAAO,CAAC,GAC5D,OAAO,QACP,OAAO,eAAe,QAAQ,CAChC;EACF,SAAS,OAAO,WACd,WAAU,OAAO,cAAc;GAC7B,MAAM,IAAI,OAAO,OAAO,aAAa,QAAQ,KAAK,CAAC,CAAC,MAAM,OAAO,CAAC,CAAC,KACjE,OAAO,SAAS,OAAO,CACzB;GAEA,MAAM,IAAI,OAAO,OAAO,aAAa,QAAQ,UAAU,CAAC,CACtD,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,IACC,WAAW,OAAO,KAAK,OAAO,QAAQ,OAAO,eAAe,QAAQ,CAAC,CACxE;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Scope from "effect/Scope";
|
|
5
|
+
import { t as AgentId } from "./Identifiers-qafW4EP0.mjs";
|
|
6
|
+
import { K as PersistedJson, b as DefinitionDigests } from "./Records-C9I1nCL9.mjs";
|
|
7
|
+
import { T as SubscriptionSourceError, i as EventSourceVersion, l as SubscriptionConfiguration, p as SubscriptionError, t as AcceptedEvent, y as SubscriptionRecord } from "./Subscription-BJ0TtZwM.mjs";
|
|
8
|
+
declare namespace SubscriptionInput_d_exports {
|
|
9
|
+
export { SubscriptionInputBinding, SubscriptionInputBindings, makeSubscriptionInputBinding, resolveSubscriptionInput };
|
|
10
|
+
}
|
|
11
|
+
/** Host-retained preparation code for one source and exact destination Agent definition. */
|
|
12
|
+
interface SubscriptionInputBinding {
|
|
13
|
+
readonly source: EventSourceVersion;
|
|
14
|
+
readonly agentId: AgentId;
|
|
15
|
+
readonly definitions: DefinitionDigests;
|
|
16
|
+
readonly context: (value: unknown) => Effect.Effect<PersistedJson, SubscriptionSourceError>;
|
|
17
|
+
readonly prepare: (event: AcceptedEvent, subscription: SubscriptionRecord) => Effect.Effect<PersistedJson, SubscriptionSourceError>;
|
|
18
|
+
}
|
|
19
|
+
declare const SubscriptionInputBindings_base: Context.ServiceClass<SubscriptionInputBindings, "@effect-agent/thread/SubscriptionInputBindings", {
|
|
20
|
+
readonly bindings: ReadonlyArray<SubscriptionInputBinding>;
|
|
21
|
+
}>;
|
|
22
|
+
declare class SubscriptionInputBindings extends SubscriptionInputBindings_base {}
|
|
23
|
+
/** Missing or ambiguous code stays pending. Never substitute a newer destination definition. */
|
|
24
|
+
declare const resolveSubscriptionInput: (bindings: ReadonlyArray<SubscriptionInputBinding>, configuration: Pick<SubscriptionConfiguration, 'source' | 'agentId' | 'definitions'>) => Effect.Effect<SubscriptionInputBinding, SubscriptionError>;
|
|
25
|
+
/**
|
|
26
|
+
* Capture explicit dependencies at host assembly. Pass the destination definition's input Schema.
|
|
27
|
+
* Include the context Schema and mapper in its retained definition version; changing either
|
|
28
|
+
* requires new definition digests. Preparation may repeat until its envelope is committed.
|
|
29
|
+
* Each operation owns a fresh Scope for its callbacks and codecs; captured host services
|
|
30
|
+
* retain their host lifetime. Operation resources finalize on success, failure, or interruption.
|
|
31
|
+
*/
|
|
32
|
+
declare const makeSubscriptionInputBinding: <Event extends Schema.Top, Parameters extends Schema.Top, Continuation extends Schema.Top, Input extends Schema.Top, R>(options: {
|
|
33
|
+
readonly source: EventSourceVersion;
|
|
34
|
+
readonly agentId: AgentId;
|
|
35
|
+
readonly definitions: DefinitionDigests;
|
|
36
|
+
readonly event: Event;
|
|
37
|
+
readonly parameters: Parameters;
|
|
38
|
+
readonly context: Continuation;
|
|
39
|
+
readonly input: Input;
|
|
40
|
+
readonly prepare: (event: Event['Type'], parameters: Parameters['Type'], context: Continuation['Type']) => Effect.Effect<Input['Type'], SubscriptionSourceError, R>;
|
|
41
|
+
}) => Effect.Effect<SubscriptionInputBinding, never, Exclude<R, Scope.Scope> | Exclude<Continuation["DecodingServices"], Scope.Scope> | Exclude<Continuation["EncodingServices"], Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Input["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope>>;
|
|
42
|
+
export { resolveSubscriptionInput as a, makeSubscriptionInputBinding as i, SubscriptionInputBindings as n, SubscriptionInput_d_exports as r, SubscriptionInputBinding as t };
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as Result from "effect/Result";
|
|
2
|
+
import { _ as SubscriptionLimits, a as SourcePartition, c as SubscriptionChange, n as DeliveryChange, p as SubscriptionError, t as AcceptedEvent, u as SubscriptionDelivery, y as SubscriptionRecord } from "./Subscription-BJ0TtZwM.mjs";
|
|
3
|
+
declare namespace SubscriptionTransition_d_exports {
|
|
4
|
+
export { applySubscriptionChange, applySubscriptionDeliveryChange, sameAcceptedEventIdentity, sameSourcePartition, sameSubscriptionDelivery, subscriptionCanSelect, subscriptionDeliveryCanSelect, subscriptionDeliveryUsesCapacity, subscriptionMatchesEvent, subscriptionUsesCapacity, validateEventRetention };
|
|
5
|
+
}
|
|
6
|
+
declare const sameSourcePartition: (left: SourcePartition, right: SourcePartition) => boolean;
|
|
7
|
+
/** The retained event is authoritative. An absent historical occurrence stays unknown on replay. */
|
|
8
|
+
declare const sameAcceptedEventIdentity: (left: AcceptedEvent, right: AcceptedEvent) => boolean;
|
|
9
|
+
declare const subscriptionMatchesEvent: (subscription: SubscriptionRecord, event: AcceptedEvent) => boolean;
|
|
10
|
+
/** Paused registrations reserve capacity; terminal and expired replay evidence does not. */
|
|
11
|
+
declare const subscriptionUsesCapacity: (subscription: SubscriptionRecord, nowMillis: number) => boolean;
|
|
12
|
+
/** Parked work still owns a slot. A receipt releases it unless settlement is being observed. */
|
|
13
|
+
declare const subscriptionDeliveryUsesCapacity: (delivery: SubscriptionDelivery) => boolean;
|
|
14
|
+
declare const subscriptionCanSelect: (subscription: SubscriptionRecord, event: AcceptedEvent, nowMillis: number, bypassCutoff: boolean) => boolean;
|
|
15
|
+
declare const subscriptionDeliveryCanSelect: (delivery: SubscriptionDelivery, subscription: SubscriptionRecord, event: AcceptedEvent) => boolean;
|
|
16
|
+
declare const sameSubscriptionDelivery: (left: SubscriptionDelivery, right: SubscriptionDelivery) => boolean;
|
|
17
|
+
/** Pure lifecycle transition used inside each adapter's local atomic mutation. */
|
|
18
|
+
declare const applySubscriptionDeliveryChange: (existing: SubscriptionDelivery, subscription: SubscriptionRecord, deliveryId: string, change: DeliveryChange) => Result.Result<SubscriptionDelivery, SubscriptionError>;
|
|
19
|
+
/** CAS management never mutates a selected or prepared delivery. */
|
|
20
|
+
declare const applySubscriptionChange: (existing: SubscriptionRecord, expectedRevision: number, change: SubscriptionChange) => Result.Result<SubscriptionRecord, SubscriptionError>;
|
|
21
|
+
/** Called only after retained identity lookup: unfinished work remains replayable past the horizon. */
|
|
22
|
+
declare const validateEventRetention: (event: AcceptedEvent, limits: SubscriptionLimits, nowMillis: number) => Result.Result<void, SubscriptionError>;
|
|
23
|
+
export { sameSourcePartition as a, subscriptionDeliveryCanSelect as c, subscriptionUsesCapacity as d, validateEventRetention as f, sameAcceptedEventIdentity as i, subscriptionDeliveryUsesCapacity as l, applySubscriptionChange as n, sameSubscriptionDelivery as o, applySubscriptionDeliveryChange as r, subscriptionCanSelect as s, SubscriptionTransition_d_exports as t, subscriptionMatchesEvent as u };
|