@systemfsoftware/agent 0.0.0-bootstrap.0 → 0.1.0-beta.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Admin-BfolLkHj.d.mts +5678 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/Agent-DSVEpq4e.d.mts +219 -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-Dg53p6du.mjs +14 -0
- package/dist/AgentRegistration-Dg53p6du.mjs.map +1 -0
- package/dist/AgentRuntime-CoGy_5dm.d.mts +751 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs +5249 -0
- package/dist/AgentRuntime-CzP4I4RB.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-C9vict2M.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-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/CommittedActivity-LWOKXqdi.d.mts +62 -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-917r7gpv.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-BHXo8GPJ.mjs +8432 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.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-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/EventSource-C0TCBeIf.d.mts +52 -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-4CRzkPBD.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-Dh6GZBt_.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-DhM-APnP.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-CubWeYKN.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-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/Output-SbOdlBFL.d.mts +22 -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-BrtZ0g2j.d.mts +14 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PreparedInputAdmission-Ci18uY4s.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-BVAHoYlN.d.mts +127 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -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-CjVP48I8.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/Scheduling-DYTM29s9.d.mts +57 -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-CSIRUgUo.mjs +1315 -0
- package/dist/Subagent-CSIRUgUo.mjs.map +1 -0
- package/dist/Subagent-CXEI5YZ8.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-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentHost-CKhz1vbH.d.mts +167 -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-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/Subscription-CC--_OnU.d.mts +815 -0
- package/dist/SubscriptionInput-BEeB0Cj8.d.mts +42 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs +53 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs.map +1 -0
- package/dist/SubscriptionTransition-CWt9UVH0.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-4K_qu_2f.mjs +638 -0
- package/dist/Subscriptions-4K_qu_2f.mjs.map +1 -0
- package/dist/Subscriptions-BF3aSf8X.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-lTZ8Ftq1.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-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadImport-DaSmrlRi.d.mts +843 -0
- package/dist/ThreadInvariants-DyPhMeo-.d.mts +23 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-DjUy7kCa.d.mts +51 -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-BM02cbOo.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-VjamzX3q.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-C4-HsMCp.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-CD0V--qh.d.mts +18 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -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-BhFjx86s.mjs +162 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs.map +1 -0
- package/dist/WorkerAdmission-BnRuXLWF.d.mts +171 -0
- package/dist/WorkerHost-DtYzi54D.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-CNs2twrr.mjs +262 -0
- package/dist/agent-registration-CNs2twrr.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-CHox63hg.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 +489 -5
- 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 +11137 -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,167 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Effect from "effect/Effect";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import { r as AnyDefinition } from "./Agent-DSVEpq4e.mjs";
|
|
6
|
+
import { t as AgentPolicy } from "./AgentPolicy-D-GmZQex.mjs";
|
|
7
|
+
import { r as Update } from "./AgentUpdates-7xT0It_R.mjs";
|
|
8
|
+
import { i as Failure } from "./FailureDiagnostic-DpzYNI8f.mjs";
|
|
9
|
+
import { c as SettlementId, r as DelegationId, s as RunId, u as ThreadId } from "./Identifiers-qafW4EP0.mjs";
|
|
10
|
+
import { c as MessageRef, l as MessageStatus } from "./Messaging-BqWHYf93.mjs";
|
|
11
|
+
import { a as Receipt, n as JoinedToHost, t as IdempotencyKey } from "./Receipt-B4feBxMY.mjs";
|
|
12
|
+
import { d as SubagentPolicy, i as SubagentBudgetReservation } from "./SubagentContract-B7vQPueI.mjs";
|
|
13
|
+
import { _ as WorkerStop, a as WorkerBudgetScope, c as WorkerError, d as WorkerPage, f as WorkerRef, g as WorkerStarted, h as WorkerSource, l as WorkerHistoryEntry, o as WorkerCompletion, s as WorkerContext, v as WorkerStopped, y as WorkerSummary } from "./Worker-xxucY_0b.mjs";
|
|
14
|
+
declare namespace SubagentHost_d_exports {
|
|
15
|
+
export { DeferredFollowUpWorkerRequest, DeferredStartWorkerRequest, FollowUpWorkerRequest, StartWorkerRequest, SubagentHost, WorkerMessageRequest, WorkerObservation, WorkerReceiptRequest, WorkerReportPreparationFailure, WorkerReporting, WorkerRunReport };
|
|
16
|
+
}
|
|
17
|
+
/** Prepared values cross this port only to be Schema-decoded before durable storage. */
|
|
18
|
+
interface StartWorkerRequest {
|
|
19
|
+
readonly delegationId: DelegationId;
|
|
20
|
+
/** Start a distinct assignment using verified completed predecessor authority. */
|
|
21
|
+
readonly continuationOf?: WorkerRef;
|
|
22
|
+
readonly target: AnyDefinition;
|
|
23
|
+
readonly idempotencyKey: IdempotencyKey;
|
|
24
|
+
readonly encodedInput: unknown;
|
|
25
|
+
readonly encodedParameters: unknown;
|
|
26
|
+
readonly policy: AgentPolicy;
|
|
27
|
+
readonly budget: SubagentBudgetReservation;
|
|
28
|
+
readonly encodedGrant: unknown;
|
|
29
|
+
readonly toolCallAllowance?: number;
|
|
30
|
+
/** Author-owned request; the durable host must separately authorize worker-run funding. */
|
|
31
|
+
readonly budgetScope?: WorkerBudgetScope;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* First-admission preparation stays lazy until the owner authorizes the caller and checks the
|
|
35
|
+
* retained command. Replays compare declared parameters/options and reuse the original capture.
|
|
36
|
+
* Prepared policy, budget, and allowance are frozen first-admission configuration, not replay
|
|
37
|
+
* arguments; changing them requires a new command key. Current caller authorization still applies.
|
|
38
|
+
* Preparation must be free of external effects: concurrent first admissions can prepare before
|
|
39
|
+
* the retained delivery chooses its first writer.
|
|
40
|
+
*/
|
|
41
|
+
interface DeferredStartWorkerRequest<E = never, R = never> extends Pick<StartWorkerRequest, 'delegationId' | 'continuationOf' | 'target' | 'idempotencyKey' | 'encodedParameters' | 'encodedGrant' | 'budgetScope'> {
|
|
42
|
+
/** Declaration ceilings; the host resolves effective policy and reserves the funded budget. */
|
|
43
|
+
readonly declarationPolicy?: SubagentPolicy;
|
|
44
|
+
readonly prepare: Effect.Effect<Pick<StartWorkerRequest, 'encodedInput'>, E, R>;
|
|
45
|
+
}
|
|
46
|
+
interface FollowUpWorkerRequest {
|
|
47
|
+
readonly worker: WorkerRef;
|
|
48
|
+
readonly target: AnyDefinition;
|
|
49
|
+
readonly idempotencyKey: IdempotencyKey;
|
|
50
|
+
readonly encodedInput: unknown;
|
|
51
|
+
readonly encodedParameters: unknown;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Like deferred starts, follow-ups prepare only after current authorization and retained-command
|
|
55
|
+
* lookup. Replays compare declared parameters and reuse the original input and worker authority.
|
|
56
|
+
* Preparation must be free of external effects because concurrent first admissions can prepare.
|
|
57
|
+
*/
|
|
58
|
+
interface DeferredFollowUpWorkerRequest<E = never, R = never> extends Omit<FollowUpWorkerRequest, 'encodedInput'> {
|
|
59
|
+
readonly prepare: Effect.Effect<Pick<FollowUpWorkerRequest, 'encodedInput'>, E, R>;
|
|
60
|
+
}
|
|
61
|
+
interface WorkerReceiptRequest {
|
|
62
|
+
readonly worker: WorkerRef;
|
|
63
|
+
readonly target: AnyDefinition;
|
|
64
|
+
readonly receipt: Receipt;
|
|
65
|
+
}
|
|
66
|
+
interface WorkerMessageRequest {
|
|
67
|
+
readonly worker: WorkerRef;
|
|
68
|
+
readonly target: AnyDefinition;
|
|
69
|
+
readonly message: MessageRef;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Canonical terminal values remain encoded until the capability decodes the saved parameters
|
|
73
|
+
* and target output and applies its declared result projection. Child E does not survive settlement.
|
|
74
|
+
*/
|
|
75
|
+
type WorkerObservation = {
|
|
76
|
+
readonly _tag: 'Pending';
|
|
77
|
+
readonly receipt: Receipt;
|
|
78
|
+
} | {
|
|
79
|
+
readonly _tag: 'Settled';
|
|
80
|
+
readonly receipt: Receipt;
|
|
81
|
+
/** Absent when an input failed or was cancelled before any Run started. */
|
|
82
|
+
readonly runId?: RunId;
|
|
83
|
+
readonly settlementId: SettlementId;
|
|
84
|
+
readonly outcome: 'completed' | 'failed' | 'aborted';
|
|
85
|
+
readonly encodedParameters: unknown;
|
|
86
|
+
readonly encodedResult: unknown;
|
|
87
|
+
/** Operator-private failed-settlement evidence; never part of a model Tool result. */
|
|
88
|
+
readonly diagnostic?: Failure;
|
|
89
|
+
readonly budgetExhausted: boolean;
|
|
90
|
+
};
|
|
91
|
+
/** One actual canonical Run, independent of how many input Receipts joined it. */
|
|
92
|
+
interface WorkerRunReport {
|
|
93
|
+
readonly worker: WorkerRef;
|
|
94
|
+
readonly context: WorkerContext;
|
|
95
|
+
readonly observation: Extract<WorkerObservation, {
|
|
96
|
+
readonly _tag: 'Settled';
|
|
97
|
+
}> & {
|
|
98
|
+
readonly runId: RunId;
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
declare const WorkerReportPreparationFailure_base: Schema.Class<WorkerReportPreparationFailure, Schema.TaggedStruct<"WorkerReportPreparationFailure", {
|
|
102
|
+
readonly stage: Schema.Literals<readonly ["projection", "input", "preparation"]>;
|
|
103
|
+
}>, import("effect/Cause").YieldableError>;
|
|
104
|
+
/** A bounded projection failure; raw application errors never enter durable report records. */
|
|
105
|
+
declare class WorkerReportPreparationFailure extends WorkerReportPreparationFailure_base {}
|
|
106
|
+
/**
|
|
107
|
+
* Source-owned standard projection supplied explicitly at durable registration.
|
|
108
|
+
* The concrete descriptor retains its E/R; durable registration captures R and records
|
|
109
|
+
* bounded preparation failure rather than serializing arbitrary application errors.
|
|
110
|
+
*/
|
|
111
|
+
interface WorkerReporting<E = never, R = never> {
|
|
112
|
+
readonly delegationId: DelegationId;
|
|
113
|
+
readonly target: AnyDefinition;
|
|
114
|
+
/** Pure first-emission selection. False retains the canonical update without parent delivery. */
|
|
115
|
+
readonly reportUpdate?: (update: Update) => boolean;
|
|
116
|
+
/** False retains a filtered report receipt without waking the parent. */
|
|
117
|
+
readonly reportCompletion?: (report: WorkerRunReport) => boolean;
|
|
118
|
+
readonly prepare: (report: WorkerRunReport) => Effect.Effect<{
|
|
119
|
+
readonly message: WorkerCompletion;
|
|
120
|
+
}, E | WorkerReportPreparationFailure, R>;
|
|
121
|
+
}
|
|
122
|
+
declare const SubagentHost_base: Context.ServiceClass<SubagentHost, "@effect-agent/engine/SubagentHost", {
|
|
123
|
+
readonly context: Effect.Effect<WorkerContext, WorkerError>;
|
|
124
|
+
/** Prepared callers retain strict input/policy conflicts; deferred callers replay the saved capture. */
|
|
125
|
+
readonly start: <E = never, R = never>(request: StartWorkerRequest | DeferredStartWorkerRequest<E, R>) => Effect.Effect<WorkerStarted, WorkerError | E, R>;
|
|
126
|
+
/** Prepared callers retain strict input conflicts; deferred callers replay the saved capture. */
|
|
127
|
+
readonly followUp: <E = never, R = never>(request: FollowUpWorkerRequest | DeferredFollowUpWorkerRequest<E, R>) => Effect.Effect<MessageStatus, WorkerError | E, R>;
|
|
128
|
+
readonly inspect: (request: WorkerReceiptRequest | WorkerMessageRequest) => Effect.Effect<WorkerObservation | MessageStatus, WorkerError>;
|
|
129
|
+
/** Inspect the continuing worker using the same summary contract as discovery. */
|
|
130
|
+
readonly summary: (request: {
|
|
131
|
+
readonly worker: WorkerRef;
|
|
132
|
+
readonly target: AnyDefinition;
|
|
133
|
+
}) => Effect.Effect<WorkerSummary, WorkerError>;
|
|
134
|
+
/** A finite snapshot through the captured tail; resume with the last sequence as `after`. */
|
|
135
|
+
readonly observe: (request: {
|
|
136
|
+
readonly worker: WorkerRef;
|
|
137
|
+
readonly target: AnyDefinition;
|
|
138
|
+
readonly after?: number;
|
|
139
|
+
}) => Stream.Stream<WorkerHistoryEntry, WorkerError>;
|
|
140
|
+
/** Interrupting this wait never requests cancellation of accepted work. */
|
|
141
|
+
readonly await: (request: WorkerReceiptRequest) => Effect.Effect<WorkerObservation, WorkerError>;
|
|
142
|
+
readonly list: (request: {
|
|
143
|
+
readonly delegationId: DelegationId;
|
|
144
|
+
readonly target: AnyDefinition;
|
|
145
|
+
readonly limit: number;
|
|
146
|
+
readonly after?: ThreadId;
|
|
147
|
+
}) => Effect.Effect<WorkerPage, WorkerError>;
|
|
148
|
+
/** Seal the whole worker; retries reconcile the same command, including a lost acknowledgement. */
|
|
149
|
+
readonly stop: (request: WorkerStop & {
|
|
150
|
+
readonly target: AnyDefinition;
|
|
151
|
+
}) => Effect.Effect<WorkerStopped, WorkerError>;
|
|
152
|
+
/** Cancel exactly this Receipt; preserve JoinedToHost without broadening its target. */
|
|
153
|
+
readonly cancel: (request: WorkerReceiptRequest) => Effect.Effect<void, WorkerError | JoinedToHost>;
|
|
154
|
+
}>;
|
|
155
|
+
/**
|
|
156
|
+
* Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;
|
|
157
|
+
* programmatic callers acquire a separately authorized Thread facet. Request values cannot
|
|
158
|
+
* choose the source identity, replace worker provenance or expand its authority and budgets.
|
|
159
|
+
*/
|
|
160
|
+
declare class SubagentHost extends SubagentHost_base {
|
|
161
|
+
static readonly unavailable: SubagentHost['Service'];
|
|
162
|
+
/** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */
|
|
163
|
+
static readonly forTool: Context.Reference<(source: Extract<WorkerSource, {
|
|
164
|
+
readonly _tag: 'tool';
|
|
165
|
+
}>) => SubagentHost['Service']>;
|
|
166
|
+
}
|
|
167
|
+
export { SubagentHost as a, WorkerObservation as c, WorkerReporting as d, WorkerRunReport as f, StartWorkerRequest as i, WorkerReceiptRequest as l, DeferredStartWorkerRequest as n, SubagentHost_d_exports as o, FollowUpWorkerRequest as r, WorkerMessageRequest as s, DeferredFollowUpWorkerRequest as t, WorkerReportPreparationFailure as u };
|
|
@@ -0,0 +1,465 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Layer from "effect/Layer";
|
|
5
|
+
import * as Ref from "effect/Ref";
|
|
6
|
+
import * as Schema from "effect/Schema";
|
|
7
|
+
import * as Semaphore from "effect/Semaphore";
|
|
8
|
+
import { d as ToolCallId, s as RunId } from "./Identifiers-LWd4837I.mjs";
|
|
9
|
+
import { f as SubagentReservationAmounts, o as SubagentDelegationCaps } from "./SubagentContract-C-7AxTm_.mjs";
|
|
10
|
+
// src/capabilities/SubagentReservations.ts
|
|
11
|
+
var SubagentReservations_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
BudgetReservationId: () => BudgetReservationId,
|
|
13
|
+
SubagentAvailableAmounts: () => SubagentAvailableAmounts,
|
|
14
|
+
SubagentBudgetDimension: () => SubagentBudgetDimension,
|
|
15
|
+
SubagentBudgetExhausted: () => SubagentBudgetExhausted,
|
|
16
|
+
SubagentObservedUsage: () => SubagentObservedUsage,
|
|
17
|
+
SubagentParentBudgetActive: () => SubagentParentBudgetActive,
|
|
18
|
+
SubagentParentBudgetConflict: () => SubagentParentBudgetConflict,
|
|
19
|
+
SubagentParentBudgetUnknown: () => SubagentParentBudgetUnknown,
|
|
20
|
+
SubagentParentBudgetView: () => SubagentParentBudgetView,
|
|
21
|
+
SubagentReservationConflict: () => SubagentReservationConflict,
|
|
22
|
+
SubagentReservationRequest: () => SubagentReservationRequest,
|
|
23
|
+
SubagentReservationStatus: () => SubagentReservationStatus,
|
|
24
|
+
SubagentReservationUnknown: () => SubagentReservationUnknown,
|
|
25
|
+
SubagentReservationView: () => SubagentReservationView,
|
|
26
|
+
SubagentReservations: () => SubagentReservations,
|
|
27
|
+
SubagentReservationsMemoryLive: () => SubagentReservationsMemoryLive,
|
|
28
|
+
makeBudgetReservationId: () => makeBudgetReservationId
|
|
29
|
+
});
|
|
30
|
+
const Natural = Schema.Natural;
|
|
31
|
+
/**
|
|
32
|
+
* Stable identity of one parent-owned Subagent budget reservation.
|
|
33
|
+
*
|
|
34
|
+
* Derivation rule (see {@link makeBudgetReservationId}):
|
|
35
|
+
* `encodeURIComponent(parentRunId) + ":" + encodeURIComponent(parentToolCallId)`.
|
|
36
|
+
* Component encoding escapes `:`; the mapping is injective for every
|
|
37
|
+
* `(parentRunId, parentToolCallId)` pair.
|
|
38
|
+
*/
|
|
39
|
+
const BudgetReservationId = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/capabilities/BudgetReservationId"));
|
|
40
|
+
const decodeBudgetReservationId = Schema.decodeSync(BudgetReservationId);
|
|
41
|
+
/** Derive the stable reservation identity of one Subagent Invocation. */
|
|
42
|
+
const makeBudgetReservationId = (parentRunId, parentToolCallId) => decodeBudgetReservationId(`${encodeURIComponent(parentRunId)}:${encodeURIComponent(parentToolCallId)}`);
|
|
43
|
+
/** One enforced hierarchical delegation budget dimension. */
|
|
44
|
+
const SubagentBudgetDimension = Schema.Literals([
|
|
45
|
+
"total-child-invocations",
|
|
46
|
+
"concurrent-children",
|
|
47
|
+
"turns",
|
|
48
|
+
"tool-calls",
|
|
49
|
+
"duration",
|
|
50
|
+
"input-tokens",
|
|
51
|
+
"output-tokens",
|
|
52
|
+
"cost",
|
|
53
|
+
"result-bytes"
|
|
54
|
+
]);
|
|
55
|
+
SubagentReservationAmounts.fields;
|
|
56
|
+
const OptionalAmountFields = {
|
|
57
|
+
turns: Schema.optionalKey(Natural),
|
|
58
|
+
toolCalls: Schema.optionalKey(Natural),
|
|
59
|
+
durationMillis: Schema.optionalKey(Natural),
|
|
60
|
+
inputTokens: Schema.optionalKey(Natural),
|
|
61
|
+
outputTokens: Schema.optionalKey(Natural),
|
|
62
|
+
costMicrousd: Schema.optionalKey(Natural),
|
|
63
|
+
resultBytes: Schema.optionalKey(Natural)
|
|
64
|
+
};
|
|
65
|
+
/** Observed child usage. An absent dimension was never reported and settles conservatively. */
|
|
66
|
+
var SubagentObservedUsage = class extends Schema.Class("@effect-agent/capabilities/SubagentObservedUsage")(OptionalAmountFields) {};
|
|
67
|
+
/** Remaining delegable allocation per configured dimension. Absent means not configured. */
|
|
68
|
+
var SubagentAvailableAmounts = class extends Schema.Class("@effect-agent/capabilities/SubagentAvailableAmounts")(OptionalAmountFields) {};
|
|
69
|
+
/** In-process release freezes accounting and refunds unused allocation atomically. */
|
|
70
|
+
const SubagentReservationStatus = Schema.Literals(["reserved", "released"]);
|
|
71
|
+
/** All-or-nothing allocation request for one Subagent Invocation. */
|
|
72
|
+
var SubagentReservationRequest = class extends Schema.Class("@effect-agent/capabilities/SubagentReservationRequest")({
|
|
73
|
+
parentRunId: RunId,
|
|
74
|
+
parentToolCallId: ToolCallId,
|
|
75
|
+
allocation: SubagentReservationAmounts,
|
|
76
|
+
/** Additional invocation slots held for this child's entire subtree. */
|
|
77
|
+
descendantInvocations: Schema.optionalKey(Natural)
|
|
78
|
+
}) {};
|
|
79
|
+
/** Accounting snapshot of one reservation: allocated, observed, covered, released, and overrun. */
|
|
80
|
+
var SubagentReservationView = class extends Schema.Class("@effect-agent/capabilities/SubagentReservationView")({
|
|
81
|
+
reservationId: BudgetReservationId,
|
|
82
|
+
parentRunId: RunId,
|
|
83
|
+
parentToolCallId: ToolCallId,
|
|
84
|
+
status: SubagentReservationStatus,
|
|
85
|
+
allocated: SubagentReservationAmounts,
|
|
86
|
+
observedConsumed: SubagentObservedUsage,
|
|
87
|
+
coveredConsumed: SubagentReservationAmounts,
|
|
88
|
+
released: SubagentReservationAmounts,
|
|
89
|
+
overrun: SubagentReservationAmounts
|
|
90
|
+
}) {};
|
|
91
|
+
/** Aggregate parent delegation budget snapshot including every reservation it owns. */
|
|
92
|
+
var SubagentParentBudgetView = class extends Schema.Class("@effect-agent/capabilities/SubagentParentBudgetView")({
|
|
93
|
+
parentRunId: RunId,
|
|
94
|
+
caps: SubagentDelegationCaps,
|
|
95
|
+
totalChildInvocations: Natural,
|
|
96
|
+
available: SubagentAvailableAmounts,
|
|
97
|
+
cumulativeOverrun: SubagentReservationAmounts,
|
|
98
|
+
reservations: Schema.Array(SubagentReservationView)
|
|
99
|
+
}) {};
|
|
100
|
+
/**
|
|
101
|
+
* Delegation admission or execution exhausted a bound. A child refused at the
|
|
102
|
+
* in-process parent's reserved finish window reports zero duration limit and usage.
|
|
103
|
+
*/
|
|
104
|
+
var SubagentBudgetExhausted = class extends Schema.TaggedError()("SubagentBudgetExhausted", {
|
|
105
|
+
parentRunId: RunId,
|
|
106
|
+
dimension: SubagentBudgetDimension,
|
|
107
|
+
limitValue: Natural,
|
|
108
|
+
observedValue: Natural
|
|
109
|
+
}) {};
|
|
110
|
+
/** The stable key is already reserved with a different allocation; neither request may win silently. */
|
|
111
|
+
var SubagentReservationConflict = class extends Schema.TaggedError()("SubagentReservationConflict", {
|
|
112
|
+
reservationId: BudgetReservationId,
|
|
113
|
+
existingAllocation: SubagentReservationAmounts,
|
|
114
|
+
requestedAllocation: SubagentReservationAmounts
|
|
115
|
+
}) {};
|
|
116
|
+
/** No reservation exists for this identity. */
|
|
117
|
+
var SubagentReservationUnknown = class extends Schema.TaggedError()("SubagentReservationUnknown", { reservationId: BudgetReservationId }) {};
|
|
118
|
+
/** No delegation budget was registered for this parent Run. */
|
|
119
|
+
var SubagentParentBudgetUnknown = class extends Schema.TaggedError()("SubagentParentBudgetUnknown", { parentRunId: RunId }) {};
|
|
120
|
+
/** The parent Run is already registered with different caps; neither set may win silently. */
|
|
121
|
+
var SubagentParentBudgetConflict = class extends Schema.TaggedError()("SubagentParentBudgetConflict", { parentRunId: RunId }) {};
|
|
122
|
+
/** A parent budget cannot retire while one of its child reservations is unsettled. */
|
|
123
|
+
var SubagentParentBudgetActive = class extends Schema.TaggedError()("SubagentParentBudgetActive", {
|
|
124
|
+
parentRunId: RunId,
|
|
125
|
+
openReservations: Natural
|
|
126
|
+
}) {};
|
|
127
|
+
/**
|
|
128
|
+
* Parent-owned hierarchical Subagent budget reservation authority.
|
|
129
|
+
*
|
|
130
|
+
* Every transition is a single atomic `Ref` update, so parallel children can
|
|
131
|
+
* never observe and spend the same remainder. The post-response usage hook in
|
|
132
|
+
* `budget.ts` is deliberately not reused here: it accounts after the fact and
|
|
133
|
+
* is not a reservation service.
|
|
134
|
+
*/
|
|
135
|
+
var SubagentReservations = class extends Context.Service()("@effect-agent/capabilities/SubagentReservations") {};
|
|
136
|
+
const dimensionSpecs = [
|
|
137
|
+
{
|
|
138
|
+
key: "turns",
|
|
139
|
+
dimension: "turns",
|
|
140
|
+
cap: (caps) => caps.maxTurns
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
key: "toolCalls",
|
|
144
|
+
dimension: "tool-calls",
|
|
145
|
+
cap: (caps) => caps.maxToolCalls
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
key: "durationMillis",
|
|
149
|
+
dimension: "duration",
|
|
150
|
+
cap: (caps) => caps.maxDurationMillis
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
key: "inputTokens",
|
|
154
|
+
dimension: "input-tokens",
|
|
155
|
+
cap: (caps) => caps.maxInputTokens
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
key: "outputTokens",
|
|
159
|
+
dimension: "output-tokens",
|
|
160
|
+
cap: (caps) => caps.maxOutputTokens
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
key: "costMicrousd",
|
|
164
|
+
dimension: "cost",
|
|
165
|
+
cap: (caps) => caps.maxCostMicrousd
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
key: "resultBytes",
|
|
169
|
+
dimension: "result-bytes",
|
|
170
|
+
cap: (caps) => caps.maxResultBytes
|
|
171
|
+
}
|
|
172
|
+
];
|
|
173
|
+
const zeroAmounts = {
|
|
174
|
+
turns: 0,
|
|
175
|
+
toolCalls: 0,
|
|
176
|
+
durationMillis: 0,
|
|
177
|
+
inputTokens: 0,
|
|
178
|
+
outputTokens: 0,
|
|
179
|
+
costMicrousd: 0,
|
|
180
|
+
resultBytes: 0
|
|
181
|
+
};
|
|
182
|
+
const ok = (value) => ({
|
|
183
|
+
_tag: "ok",
|
|
184
|
+
value
|
|
185
|
+
});
|
|
186
|
+
const fail = (error) => ({
|
|
187
|
+
_tag: "error",
|
|
188
|
+
error
|
|
189
|
+
});
|
|
190
|
+
/** Corrupt internal accounting is a defect, never an expected reservation failure. */
|
|
191
|
+
var ReservationLedgerCorrupt = class extends Schema.TaggedError()("ReservationLedgerCorrupt", { message: Schema.String }) {};
|
|
192
|
+
const resolve = (result) => {
|
|
193
|
+
switch (result._tag) {
|
|
194
|
+
case "ok": return Effect.succeed(result.value);
|
|
195
|
+
case "error": return Effect.fail(result.error);
|
|
196
|
+
case "corrupt": return Effect.die(ReservationLedgerCorrupt.make({ message: result.message }));
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
const sameCaps = (a, b) => a.maxTotalChildInvocations === b.maxTotalChildInvocations && a.maxConcurrentChildren === b.maxConcurrentChildren && a.maxTurns === b.maxTurns && a.maxToolCalls === b.maxToolCalls && a.maxDurationMillis === b.maxDurationMillis && a.maxInputTokens === b.maxInputTokens && a.maxOutputTokens === b.maxOutputTokens && a.maxCostMicrousd === b.maxCostMicrousd && a.maxResultBytes === b.maxResultBytes;
|
|
200
|
+
const sameAmounts = (a, b) => dimensionSpecs.every((spec) => a[spec.key] === b[spec.key]);
|
|
201
|
+
const optionalAmounts = (partial) => {
|
|
202
|
+
const out = {};
|
|
203
|
+
for (const spec of dimensionSpecs) {
|
|
204
|
+
const value = partial[spec.key];
|
|
205
|
+
if (value !== void 0) out[spec.key] = value;
|
|
206
|
+
}
|
|
207
|
+
return out;
|
|
208
|
+
};
|
|
209
|
+
/** Covered usage freezes at settlement, so the unused allocation remains stable afterward. */
|
|
210
|
+
const unusedAllocation = (reservation) => {
|
|
211
|
+
const unused = { ...zeroAmounts };
|
|
212
|
+
for (const spec of dimensionSpecs) unused[spec.key] = reservation.allocated[spec.key] - reservation.covered[spec.key];
|
|
213
|
+
return unused;
|
|
214
|
+
};
|
|
215
|
+
const reservationView = (reservationId, state) => SubagentReservationView.make({
|
|
216
|
+
reservationId,
|
|
217
|
+
parentRunId: state.parentRunId,
|
|
218
|
+
parentToolCallId: state.parentToolCallId,
|
|
219
|
+
status: state.status,
|
|
220
|
+
allocated: SubagentReservationAmounts.make(state.allocated),
|
|
221
|
+
observedConsumed: SubagentObservedUsage.make(optionalAmounts(state.observed)),
|
|
222
|
+
coveredConsumed: SubagentReservationAmounts.make(state.covered),
|
|
223
|
+
released: SubagentReservationAmounts.make(state.status === "released" ? unusedAllocation(state) : zeroAmounts),
|
|
224
|
+
overrun: SubagentReservationAmounts.make(state.overrun)
|
|
225
|
+
});
|
|
226
|
+
const parentView = (ledger, parent) => {
|
|
227
|
+
const reservations = [];
|
|
228
|
+
for (const [reservationId, reservation] of ledger.reservations) if (reservation.parentRunId === parent.parentRunId) reservations.push(reservationView(reservationId, reservation));
|
|
229
|
+
return SubagentParentBudgetView.make({
|
|
230
|
+
parentRunId: parent.parentRunId,
|
|
231
|
+
caps: parent.caps,
|
|
232
|
+
totalChildInvocations: parent.totalChildInvocations,
|
|
233
|
+
available: SubagentAvailableAmounts.make(optionalAmounts(parent.available)),
|
|
234
|
+
cumulativeOverrun: SubagentReservationAmounts.make(parent.cumulativeOverrun),
|
|
235
|
+
reservations
|
|
236
|
+
});
|
|
237
|
+
};
|
|
238
|
+
const corruptParent = (parentRunId) => ({
|
|
239
|
+
_tag: "corrupt",
|
|
240
|
+
message: `SubagentReservations ledger invariant violated: reservation references unregistered parent Run ${parentRunId}`
|
|
241
|
+
});
|
|
242
|
+
const registerTransition = (ledger, parentRunId, caps, gate) => {
|
|
243
|
+
const existing = ledger.parents.get(parentRunId);
|
|
244
|
+
if (existing !== void 0) return sameCaps(existing.caps, caps) ? [ok(parentView(ledger, existing)), ledger] : [fail(SubagentParentBudgetConflict.make({ parentRunId })), ledger];
|
|
245
|
+
const available = {};
|
|
246
|
+
for (const spec of dimensionSpecs) {
|
|
247
|
+
const cap = spec.cap(caps);
|
|
248
|
+
if (cap !== void 0) available[spec.key] = cap;
|
|
249
|
+
}
|
|
250
|
+
const parent = {
|
|
251
|
+
parentRunId,
|
|
252
|
+
caps,
|
|
253
|
+
gate,
|
|
254
|
+
totalChildInvocations: 0,
|
|
255
|
+
available,
|
|
256
|
+
cumulativeOverrun: zeroAmounts
|
|
257
|
+
};
|
|
258
|
+
const next = {
|
|
259
|
+
parents: new Map(ledger.parents).set(parentRunId, parent),
|
|
260
|
+
reservations: ledger.reservations
|
|
261
|
+
};
|
|
262
|
+
return [ok(parentView(next, parent)), next];
|
|
263
|
+
};
|
|
264
|
+
const reserveTransition = (ledger, request) => {
|
|
265
|
+
const parent = ledger.parents.get(request.parentRunId);
|
|
266
|
+
if (parent === void 0) return [fail(SubagentParentBudgetUnknown.make({ parentRunId: request.parentRunId })), ledger];
|
|
267
|
+
const reservationId = makeBudgetReservationId(request.parentRunId, request.parentToolCallId);
|
|
268
|
+
const existing = ledger.reservations.get(reservationId);
|
|
269
|
+
if (existing !== void 0) return sameAmounts(existing.allocated, request.allocation) && existing.descendantInvocations === (request.descendantInvocations ?? 0) ? [ok(reservationView(reservationId, existing)), ledger] : [fail(SubagentReservationConflict.make({
|
|
270
|
+
reservationId,
|
|
271
|
+
existingAllocation: SubagentReservationAmounts.make(existing.allocated),
|
|
272
|
+
requestedAllocation: request.allocation
|
|
273
|
+
})), ledger];
|
|
274
|
+
const maxInvocations = parent.caps.maxTotalChildInvocations;
|
|
275
|
+
const slots = 1 + (request.descendantInvocations ?? 0);
|
|
276
|
+
if (maxInvocations !== void 0 && parent.totalChildInvocations + slots > maxInvocations) return [fail(SubagentBudgetExhausted.make({
|
|
277
|
+
parentRunId: request.parentRunId,
|
|
278
|
+
dimension: "total-child-invocations",
|
|
279
|
+
limitValue: maxInvocations,
|
|
280
|
+
observedValue: parent.totalChildInvocations + slots
|
|
281
|
+
})), ledger];
|
|
282
|
+
for (const spec of dimensionSpecs) {
|
|
283
|
+
const cap = spec.cap(parent.caps);
|
|
284
|
+
if (cap === void 0) continue;
|
|
285
|
+
const headroom = (parent.available[spec.key] ?? 0) - parent.cumulativeOverrun[spec.key];
|
|
286
|
+
const requested = request.allocation[spec.key];
|
|
287
|
+
if (requested > headroom) return [fail(SubagentBudgetExhausted.make({
|
|
288
|
+
parentRunId: request.parentRunId,
|
|
289
|
+
dimension: spec.dimension,
|
|
290
|
+
limitValue: cap,
|
|
291
|
+
observedValue: cap - headroom + requested
|
|
292
|
+
})), ledger];
|
|
293
|
+
}
|
|
294
|
+
const nextAvailable = { ...parent.available };
|
|
295
|
+
for (const spec of dimensionSpecs) {
|
|
296
|
+
const available = parent.available[spec.key];
|
|
297
|
+
if (available !== void 0) nextAvailable[spec.key] = available - request.allocation[spec.key];
|
|
298
|
+
}
|
|
299
|
+
const reservation = {
|
|
300
|
+
parentRunId: request.parentRunId,
|
|
301
|
+
parentToolCallId: request.parentToolCallId,
|
|
302
|
+
descendantInvocations: request.descendantInvocations ?? 0,
|
|
303
|
+
status: "reserved",
|
|
304
|
+
allocated: request.allocation,
|
|
305
|
+
observed: {},
|
|
306
|
+
covered: zeroAmounts,
|
|
307
|
+
overrun: zeroAmounts
|
|
308
|
+
};
|
|
309
|
+
const next = {
|
|
310
|
+
parents: new Map(ledger.parents).set(request.parentRunId, {
|
|
311
|
+
...parent,
|
|
312
|
+
totalChildInvocations: parent.totalChildInvocations + slots,
|
|
313
|
+
available: nextAvailable
|
|
314
|
+
}),
|
|
315
|
+
reservations: new Map(ledger.reservations).set(reservationId, reservation)
|
|
316
|
+
};
|
|
317
|
+
return [ok(reservationView(reservationId, reservation)), next];
|
|
318
|
+
};
|
|
319
|
+
const observeTransition = (ledger, reservationId, usage) => {
|
|
320
|
+
const reservation = ledger.reservations.get(reservationId);
|
|
321
|
+
if (reservation === void 0) return [fail(SubagentReservationUnknown.make({ reservationId })), ledger];
|
|
322
|
+
const parent = ledger.parents.get(reservation.parentRunId);
|
|
323
|
+
if (parent === void 0) return [corruptParent(reservation.parentRunId), ledger];
|
|
324
|
+
const observed = { ...reservation.observed };
|
|
325
|
+
const covered = { ...reservation.covered };
|
|
326
|
+
const overrun = { ...reservation.overrun };
|
|
327
|
+
const cumulativeOverrun = { ...parent.cumulativeOverrun };
|
|
328
|
+
for (const spec of dimensionSpecs) {
|
|
329
|
+
const delta = usage[spec.key];
|
|
330
|
+
if (delta === void 0) continue;
|
|
331
|
+
observed[spec.key] = (observed[spec.key] ?? 0) + delta;
|
|
332
|
+
const coverable = reservation.status === "reserved" ? Math.min(delta, reservation.allocated[spec.key] - covered[spec.key]) : 0;
|
|
333
|
+
covered[spec.key] += coverable;
|
|
334
|
+
const overrunDelta = delta - coverable;
|
|
335
|
+
overrun[spec.key] += overrunDelta;
|
|
336
|
+
cumulativeOverrun[spec.key] += overrunDelta;
|
|
337
|
+
}
|
|
338
|
+
const nextReservation = {
|
|
339
|
+
...reservation,
|
|
340
|
+
observed,
|
|
341
|
+
covered,
|
|
342
|
+
overrun
|
|
343
|
+
};
|
|
344
|
+
const next = {
|
|
345
|
+
parents: new Map(ledger.parents).set(parent.parentRunId, {
|
|
346
|
+
...parent,
|
|
347
|
+
cumulativeOverrun
|
|
348
|
+
}),
|
|
349
|
+
reservations: new Map(ledger.reservations).set(reservationId, nextReservation)
|
|
350
|
+
};
|
|
351
|
+
return [ok(reservationView(reservationId, nextReservation)), next];
|
|
352
|
+
};
|
|
353
|
+
/**
|
|
354
|
+
* Freeze the settlement decision. A dimension that was never observed
|
|
355
|
+
* conservatively consumes its full reserved amount.
|
|
356
|
+
*/
|
|
357
|
+
const settleReservation = (reservation) => {
|
|
358
|
+
const observed = { ...reservation.observed };
|
|
359
|
+
const covered = { ...reservation.covered };
|
|
360
|
+
for (const spec of dimensionSpecs) if (observed[spec.key] === void 0) {
|
|
361
|
+
observed[spec.key] = reservation.allocated[spec.key];
|
|
362
|
+
covered[spec.key] = reservation.allocated[spec.key];
|
|
363
|
+
}
|
|
364
|
+
return {
|
|
365
|
+
...reservation,
|
|
366
|
+
status: "released",
|
|
367
|
+
observed,
|
|
368
|
+
covered
|
|
369
|
+
};
|
|
370
|
+
};
|
|
371
|
+
const releaseTransition = (ledger, reservationId) => {
|
|
372
|
+
const reservation = ledger.reservations.get(reservationId);
|
|
373
|
+
if (reservation === void 0) return [fail(SubagentReservationUnknown.make({ reservationId })), ledger];
|
|
374
|
+
if (reservation.status === "released") return [ok(reservationView(reservationId, reservation)), ledger];
|
|
375
|
+
const parent = ledger.parents.get(reservation.parentRunId);
|
|
376
|
+
if (parent === void 0) return [corruptParent(reservation.parentRunId), ledger];
|
|
377
|
+
const settled = settleReservation(reservation);
|
|
378
|
+
const unused = unusedAllocation(settled);
|
|
379
|
+
const nextAvailable = { ...parent.available };
|
|
380
|
+
for (const spec of dimensionSpecs) {
|
|
381
|
+
const available = parent.available[spec.key];
|
|
382
|
+
if (available !== void 0) nextAvailable[spec.key] = available + unused[spec.key];
|
|
383
|
+
}
|
|
384
|
+
const next = {
|
|
385
|
+
parents: new Map(ledger.parents).set(parent.parentRunId, {
|
|
386
|
+
...parent,
|
|
387
|
+
available: nextAvailable
|
|
388
|
+
}),
|
|
389
|
+
reservations: new Map(ledger.reservations).set(reservationId, settled)
|
|
390
|
+
};
|
|
391
|
+
return [ok(reservationView(reservationId, settled)), next];
|
|
392
|
+
};
|
|
393
|
+
const retireParentTransition = (ledger, parentRunId) => {
|
|
394
|
+
if (!ledger.parents.has(parentRunId)) return [ok(void 0), ledger];
|
|
395
|
+
let openReservations = 0;
|
|
396
|
+
for (const reservation of ledger.reservations.values()) if (reservation.parentRunId === parentRunId && reservation.status !== "released") openReservations += 1;
|
|
397
|
+
if (openReservations > 0) return [fail(SubagentParentBudgetActive.make({
|
|
398
|
+
parentRunId,
|
|
399
|
+
openReservations
|
|
400
|
+
})), ledger];
|
|
401
|
+
const parents = new Map(ledger.parents);
|
|
402
|
+
parents.delete(parentRunId);
|
|
403
|
+
const reservations = new Map(ledger.reservations);
|
|
404
|
+
for (const [reservationId, reservation] of reservations) if (reservation.parentRunId === parentRunId) reservations.delete(reservationId);
|
|
405
|
+
return [ok(void 0), {
|
|
406
|
+
parents,
|
|
407
|
+
reservations
|
|
408
|
+
}];
|
|
409
|
+
};
|
|
410
|
+
/**
|
|
411
|
+
* In-memory reservation ledger. All state lives in one `Ref` owned by the
|
|
412
|
+
* Layer's Scope; every transition is a single atomic `Ref.modify`.
|
|
413
|
+
*/
|
|
414
|
+
const SubagentReservationsMemoryLive = Layer.effect(SubagentReservations, Effect.gen(function* () {
|
|
415
|
+
const state = yield* Ref.make({
|
|
416
|
+
parents: /* @__PURE__ */ new Map(),
|
|
417
|
+
reservations: /* @__PURE__ */ new Map()
|
|
418
|
+
});
|
|
419
|
+
return SubagentReservations.of({
|
|
420
|
+
registerParent: Effect.fnUntraced(function* (parentRunId, caps) {
|
|
421
|
+
const gate = caps.maxConcurrentChildren !== void 0 && caps.maxConcurrentChildren > 0 ? yield* Semaphore.make(caps.maxConcurrentChildren) : void 0;
|
|
422
|
+
const result = yield* Ref.modify(state, (ledger) => registerTransition(ledger, parentRunId, caps, gate));
|
|
423
|
+
return yield* resolve(result);
|
|
424
|
+
}),
|
|
425
|
+
reserve: Effect.fnUntraced(function* (request) {
|
|
426
|
+
const result = yield* Ref.modify(state, (ledger) => reserveTransition(ledger, request));
|
|
427
|
+
return yield* resolve(result);
|
|
428
|
+
}),
|
|
429
|
+
observe: Effect.fnUntraced(function* (reservationId, usage) {
|
|
430
|
+
const result = yield* Ref.modify(state, (ledger) => observeTransition(ledger, reservationId, usage));
|
|
431
|
+
return yield* resolve(result);
|
|
432
|
+
}),
|
|
433
|
+
release: Effect.fnUntraced(function* (reservationId) {
|
|
434
|
+
const result = yield* Ref.modify(state, (ledger) => releaseTransition(ledger, reservationId));
|
|
435
|
+
return yield* resolve(result);
|
|
436
|
+
}),
|
|
437
|
+
acquireChildSlot: Effect.fnUntraced(function* (parentRunId, slots = 1) {
|
|
438
|
+
const parent = (yield* Ref.get(state)).parents.get(parentRunId);
|
|
439
|
+
if (parent === void 0) return yield* SubagentParentBudgetUnknown.make({ parentRunId });
|
|
440
|
+
const cap = parent.caps.maxConcurrentChildren;
|
|
441
|
+
if (cap === void 0) return;
|
|
442
|
+
if (!Number.isSafeInteger(slots) || slots < 1 || slots > cap || parent.gate === void 0) return yield* SubagentBudgetExhausted.make({
|
|
443
|
+
parentRunId,
|
|
444
|
+
dimension: "concurrent-children",
|
|
445
|
+
limitValue: cap,
|
|
446
|
+
observedValue: Number.isSafeInteger(slots) && slots > 0 ? slots : 0
|
|
447
|
+
});
|
|
448
|
+
const gate = parent.gate;
|
|
449
|
+
yield* Effect.acquireRelease(gate.take(slots), (permits) => gate.release(permits).pipe(Effect.asVoid), { interruptible: true });
|
|
450
|
+
}),
|
|
451
|
+
retireParent: Effect.fnUntraced(function* (parentRunId) {
|
|
452
|
+
const result = yield* Ref.modify(state, (ledger) => retireParentTransition(ledger, parentRunId));
|
|
453
|
+
return yield* resolve(result);
|
|
454
|
+
}),
|
|
455
|
+
parentSnapshot: Effect.fnUntraced(function* (parentRunId) {
|
|
456
|
+
const ledger = yield* Ref.get(state);
|
|
457
|
+
const parent = ledger.parents.get(parentRunId);
|
|
458
|
+
if (parent === void 0) return yield* SubagentParentBudgetUnknown.make({ parentRunId });
|
|
459
|
+
return parentView(ledger, parent);
|
|
460
|
+
})
|
|
461
|
+
});
|
|
462
|
+
}));
|
|
463
|
+
export { SubagentReservations_exports as _, SubagentObservedUsage as a, SubagentParentBudgetUnknown as c, SubagentReservationRequest as d, SubagentReservationStatus as f, SubagentReservationsMemoryLive as g, SubagentReservations as h, SubagentBudgetExhausted as i, SubagentParentBudgetView as l, SubagentReservationView as m, SubagentAvailableAmounts as n, SubagentParentBudgetActive as o, SubagentReservationUnknown as p, SubagentBudgetDimension as r, SubagentParentBudgetConflict as s, BudgetReservationId as t, SubagentReservationConflict as u, makeBudgetReservationId as v };
|
|
464
|
+
|
|
465
|
+
//# sourceMappingURL=SubagentReservations-BYNAHPpm.mjs.map
|