@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,176 @@
|
|
|
1
|
+
import * as Context from "effect/Context";
|
|
2
|
+
import * as Duration from "effect/Duration";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
declare namespace SubagentContract_d_exports {
|
|
5
|
+
export { BackgroundSpawnTool, DelegationDepth, DelegationTool, SubagentBudgetReservation, SubagentDelegationCaps, SubagentExecutionFailure, SubagentExecutionFailureClassification, SubagentGrant, SubagentParentLink, SubagentPolicy, SubagentPolicyInput, SubagentReservationAmounts, ToolExecutionKind, WorkerOperationTool, getToolExecutionKind, isSubagentToolAllowed, maxErrorTagLength, narrowSubagentGrant };
|
|
6
|
+
}
|
|
7
|
+
declare const SubagentPolicyFields: Schema.Struct<{
|
|
8
|
+
/** Total invocation slots, including reserved descendants, available through this delegation budget. */
|
|
9
|
+
readonly maxChildren: Schema.Int;
|
|
10
|
+
/** Concurrently executing children per parent Run. */
|
|
11
|
+
readonly maxConcurrency: Schema.Int;
|
|
12
|
+
/** Invocation slots held for the entire descendant subtree; omitted reserves zero. */
|
|
13
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
14
|
+
/** Model turns reserved for each child invocation. */
|
|
15
|
+
readonly maxTurns: Schema.Int;
|
|
16
|
+
/** Tool Calls reserved for each child invocation. */
|
|
17
|
+
readonly maxToolCalls: Schema.Int;
|
|
18
|
+
/** Wall-clock duration reserved for each child invocation. */
|
|
19
|
+
readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
|
|
20
|
+
/**
|
|
21
|
+
* Time held back before the in-process parent's deadline; omitted reserves zero.
|
|
22
|
+
* Does not apply to durable attached children or background workers.
|
|
23
|
+
*/
|
|
24
|
+
readonly parentReserveDuration: Schema.optionalKey<Schema.refine<Duration.Duration, Schema.Duration>>;
|
|
25
|
+
readonly maxInputTokens: Schema.optionalKey<Schema.Int>;
|
|
26
|
+
readonly maxOutputTokens: Schema.optionalKey<Schema.Int>;
|
|
27
|
+
readonly maxCostMicrousd: Schema.optionalKey<Schema.Natural>;
|
|
28
|
+
readonly maxResultBytes: Schema.optionalKey<Schema.Int>;
|
|
29
|
+
}>;
|
|
30
|
+
type SubagentPolicyFields = typeof SubagentPolicyFields.Type;
|
|
31
|
+
/** Inputs normalized and validated by `SubagentPolicy.make`. */
|
|
32
|
+
type SubagentPolicyInput = Readonly<Omit<SubagentPolicyFields, 'maxDuration' | 'parentReserveDuration'> & {
|
|
33
|
+
/** Finite, positive wall-clock duration accepted in any Effect Duration input form. */
|
|
34
|
+
readonly maxDuration: Duration.Input;
|
|
35
|
+
/** Finite, nonnegative time reserved for the in-process parent to finish. */
|
|
36
|
+
readonly parentReserveDuration?: Duration.Input;
|
|
37
|
+
}>;
|
|
38
|
+
declare const SubagentPolicy_base: Schema.Class<SubagentPolicy, Schema.Struct<{
|
|
39
|
+
/** Total invocation slots, including reserved descendants, available through this delegation budget. */
|
|
40
|
+
readonly maxChildren: Schema.Int;
|
|
41
|
+
/** Concurrently executing children per parent Run. */
|
|
42
|
+
readonly maxConcurrency: Schema.Int;
|
|
43
|
+
/** Invocation slots held for the entire descendant subtree; omitted reserves zero. */
|
|
44
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
45
|
+
/** Model turns reserved for each child invocation. */
|
|
46
|
+
readonly maxTurns: Schema.Int;
|
|
47
|
+
/** Tool Calls reserved for each child invocation. */
|
|
48
|
+
readonly maxToolCalls: Schema.Int;
|
|
49
|
+
/** Wall-clock duration reserved for each child invocation. */
|
|
50
|
+
readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
|
|
51
|
+
/**
|
|
52
|
+
* Time held back before the in-process parent's deadline; omitted reserves zero.
|
|
53
|
+
* Does not apply to durable attached children or background workers.
|
|
54
|
+
*/
|
|
55
|
+
readonly parentReserveDuration: Schema.optionalKey<Schema.refine<Duration.Duration, Schema.Duration>>;
|
|
56
|
+
readonly maxInputTokens: Schema.optionalKey<Schema.Int>;
|
|
57
|
+
readonly maxOutputTokens: Schema.optionalKey<Schema.Int>;
|
|
58
|
+
readonly maxCostMicrousd: Schema.optionalKey<Schema.Natural>;
|
|
59
|
+
readonly maxResultBytes: Schema.optionalKey<Schema.Int>;
|
|
60
|
+
}>, {}>;
|
|
61
|
+
/**
|
|
62
|
+
* Finite delegation bounds declared by one Subagent capability.
|
|
63
|
+
* Structural limits are hard limits; token
|
|
64
|
+
* and cost caps are optional and enforced only as honestly as provider
|
|
65
|
+
* reporting allows.
|
|
66
|
+
*/
|
|
67
|
+
declare class SubagentPolicy extends SubagentPolicy_base {
|
|
68
|
+
/** Normalize and validate finite delegation bounds, throwing on invalid input. */
|
|
69
|
+
static make(input: SubagentPolicyInput): SubagentPolicy;
|
|
70
|
+
}
|
|
71
|
+
declare const SubagentGrant_base: Schema.Class<SubagentGrant, Schema.Struct<{
|
|
72
|
+
readonly allowedToolNames: Schema.$Array<Schema.NonEmptyString>;
|
|
73
|
+
readonly maxDepth: Schema.Int;
|
|
74
|
+
/** Omitted permits either lifetime within the depth and reserved subtree budgets. */
|
|
75
|
+
readonly childLifetimes: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["attached", "background"]>>>;
|
|
76
|
+
}>, {}>;
|
|
77
|
+
/** Tree authority ceiling. Each child exposes only its own Toolkit's permitted names. */
|
|
78
|
+
declare class SubagentGrant extends SubagentGrant_base {}
|
|
79
|
+
/** Intersect inherited authority; another delegation can never restore a removed capability. */
|
|
80
|
+
declare const narrowSubagentGrant: (declared: SubagentGrant, inherited?: SubagentGrant) => SubagentGrant;
|
|
81
|
+
declare const SubagentDelegationCaps_base: Schema.Class<SubagentDelegationCaps, Schema.Struct<{
|
|
82
|
+
readonly maxTotalChildInvocations: Schema.optionalKey<Schema.Natural>;
|
|
83
|
+
readonly maxConcurrentChildren: Schema.optionalKey<Schema.Natural>;
|
|
84
|
+
readonly maxTurns: Schema.optionalKey<Schema.Natural>;
|
|
85
|
+
readonly maxToolCalls: Schema.optionalKey<Schema.Natural>;
|
|
86
|
+
readonly maxDurationMillis: Schema.optionalKey<Schema.Natural>;
|
|
87
|
+
readonly maxInputTokens: Schema.optionalKey<Schema.Natural>;
|
|
88
|
+
readonly maxOutputTokens: Schema.optionalKey<Schema.Natural>;
|
|
89
|
+
readonly maxCostMicrousd: Schema.optionalKey<Schema.Natural>;
|
|
90
|
+
readonly maxResultBytes: Schema.optionalKey<Schema.Natural>;
|
|
91
|
+
}>, {}>;
|
|
92
|
+
/** Finite delegable caps for one parent Run. Absent means not configured; present values are finite. */
|
|
93
|
+
declare class SubagentDelegationCaps extends SubagentDelegationCaps_base {}
|
|
94
|
+
declare const SubagentReservationAmounts_base: Schema.Class<SubagentReservationAmounts, Schema.Struct<{
|
|
95
|
+
readonly turns: Schema.Natural;
|
|
96
|
+
readonly toolCalls: Schema.Natural;
|
|
97
|
+
readonly durationMillis: Schema.Natural;
|
|
98
|
+
readonly inputTokens: Schema.Natural;
|
|
99
|
+
readonly outputTokens: Schema.Natural;
|
|
100
|
+
readonly costMicrousd: Schema.Natural;
|
|
101
|
+
readonly resultBytes: Schema.Natural;
|
|
102
|
+
}>, {}>;
|
|
103
|
+
/** Exact amounts across every reservable delegation dimension. */
|
|
104
|
+
declare class SubagentReservationAmounts extends SubagentReservationAmounts_base {}
|
|
105
|
+
/** One child reservation against the parent Run's shared delegation pool. */
|
|
106
|
+
declare const SubagentBudgetReservation: Schema.Struct<{
|
|
107
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
108
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
109
|
+
/** Slots reserved for every descendant input beneath this input; absent reserves none. */
|
|
110
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
111
|
+
}>;
|
|
112
|
+
type SubagentBudgetReservation = typeof SubagentBudgetReservation.Type;
|
|
113
|
+
/** Root-relative delegation depth; the direct child of a top-level run has depth 1. */
|
|
114
|
+
declare const DelegationDepth: Schema.Int;
|
|
115
|
+
type DelegationDepth = typeof DelegationDepth.Type;
|
|
116
|
+
/** Marks a Tool implementing the idempotent Subagent establishment protocol. */
|
|
117
|
+
declare const DelegationTool: Context.Reference<boolean>;
|
|
118
|
+
/** Marks a host-managed idempotent worker operation, independently of its Tool name. */
|
|
119
|
+
declare const WorkerOperationTool: Context.Reference<boolean>;
|
|
120
|
+
/** Identifies the background launch operation within a generated management Toolkit. */
|
|
121
|
+
declare const BackgroundSpawnTool: Context.Reference<boolean>;
|
|
122
|
+
/** Declaration metadata and inherited authority determine the effective visible Tool set. */
|
|
123
|
+
declare const isSubagentToolAllowed: (grant: SubagentGrant | undefined, depth: number, name: string, annotations: Context.Context<never>) => boolean;
|
|
124
|
+
/** Persisted preparation classification, checked against the resolved Tool before replay. */
|
|
125
|
+
declare const ToolExecutionKind: Schema.Literals<readonly ["ordinary", "delegation", "orchestration"]>;
|
|
126
|
+
type ToolExecutionKind = typeof ToolExecutionKind.Type;
|
|
127
|
+
/** Resolve only trusted declaration metadata; names never authorize automatic replay. */
|
|
128
|
+
declare const getToolExecutionKind: (annotations: Context.Context<never>) => ToolExecutionKind;
|
|
129
|
+
declare const SubagentParentLink_base: Schema.Class<SubagentParentLink, Schema.Struct<{
|
|
130
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
131
|
+
readonly parentAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
132
|
+
readonly parentThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
133
|
+
readonly parentRunId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
134
|
+
readonly parentToolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
135
|
+
readonly depth: Schema.Int;
|
|
136
|
+
}>, {}>;
|
|
137
|
+
/** Immutable lineage from a child Thread to the parent identity that established it. */
|
|
138
|
+
declare class SubagentParentLink extends SubagentParentLink_base {}
|
|
139
|
+
/**
|
|
140
|
+
* Classification of one bounded durable delegation failure.
|
|
141
|
+
* `"child-failed"` and `"child-aborted"` project the
|
|
142
|
+
* child's canonical failed/aborted Settlement; `"child-compatibility"`
|
|
143
|
+
* projects the framework's `ChildCompatibilityFailure` child Settlement (the
|
|
144
|
+
* stored child Binding digest was unavailable — recovery never substituted
|
|
145
|
+
* current code); `"establishment-denied"` is a fail-closed coordinator
|
|
146
|
+
* refusal (lineage/digest verification, divergent replay); and
|
|
147
|
+
* `"declaration-unavailable"` is retained for decoding failures recorded by
|
|
148
|
+
* versions that required an explicit durable digest declaration.
|
|
149
|
+
*/
|
|
150
|
+
declare const SubagentExecutionFailureClassification: Schema.Literals<readonly ["child-failed", "child-aborted", "child-compatibility", "establishment-denied", "declaration-unavailable"]>;
|
|
151
|
+
type SubagentExecutionFailureClassification = typeof SubagentExecutionFailureClassification.Type;
|
|
152
|
+
declare const maxErrorTagLength = 256;
|
|
153
|
+
declare const SubagentExecutionFailure_base: Schema.Class<SubagentExecutionFailure, Schema.TaggedStruct<"SubagentExecutionFailure", {
|
|
154
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
155
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
156
|
+
readonly classification: Schema.Literals<readonly ["child-failed", "child-aborted", "child-compatibility", "establishment-denied", "declaration-unavailable"]>;
|
|
157
|
+
/** Child references, present once establishment reached a child identity. */
|
|
158
|
+
readonly childThreadId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">>;
|
|
159
|
+
readonly childSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
160
|
+
readonly childRunId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">>;
|
|
161
|
+
readonly errorTag: Schema.NonEmptyString;
|
|
162
|
+
readonly message: Schema.String;
|
|
163
|
+
}>, import("effect/Cause").YieldableError>;
|
|
164
|
+
/**
|
|
165
|
+
* Bounded framework projection of a durable child failure, shared by attached joins and reports.
|
|
166
|
+
* A failed or aborted durable child
|
|
167
|
+
* joins its parent Tool Call as exactly this typed failure: a classification,
|
|
168
|
+
* the child references, and the coordinator's bounded `{errorTag, message}`
|
|
169
|
+
* projection — never a raw Cause, stack, provider response, secret, or child
|
|
170
|
+
* payload. The typed child failure union does not survive a durable
|
|
171
|
+
* Settlement, so `mapChildFailure` remains the ephemeral-path contract;
|
|
172
|
+
* Schema-declared durable domain-failure mapping is a recorded later
|
|
173
|
+
* extension.
|
|
174
|
+
*/
|
|
175
|
+
declare class SubagentExecutionFailure extends SubagentExecutionFailure_base {}
|
|
176
|
+
export { isSubagentToolAllowed as _, SubagentContract_d_exports as a, SubagentExecutionFailureClassification as c, SubagentPolicy as d, SubagentPolicyInput as f, getToolExecutionKind as g, WorkerOperationTool as h, SubagentBudgetReservation as i, SubagentGrant as l, ToolExecutionKind as m, DelegationDepth as n, SubagentDelegationCaps as o, SubagentReservationAmounts as p, DelegationTool as r, SubagentExecutionFailure as s, BackgroundSpawnTool as t, SubagentParentLink as u, maxErrorTagLength as v, narrowSubagentGrant as y };
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Duration from "effect/Duration";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { d as ToolCallId, l as SubmissionId, r as DelegationId, s as RunId, t as AgentId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
|
|
6
|
+
// src/core/SubagentContract.ts
|
|
7
|
+
var SubagentContract_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
BackgroundSpawnTool: () => BackgroundSpawnTool,
|
|
9
|
+
DelegationDepth: () => DelegationDepth,
|
|
10
|
+
DelegationTool: () => DelegationTool,
|
|
11
|
+
SubagentBudgetReservation: () => SubagentBudgetReservation,
|
|
12
|
+
SubagentDelegationCaps: () => SubagentDelegationCaps,
|
|
13
|
+
SubagentExecutionFailure: () => SubagentExecutionFailure,
|
|
14
|
+
SubagentExecutionFailureClassification: () => SubagentExecutionFailureClassification,
|
|
15
|
+
SubagentGrant: () => SubagentGrant,
|
|
16
|
+
SubagentParentLink: () => SubagentParentLink,
|
|
17
|
+
SubagentPolicy: () => SubagentPolicy,
|
|
18
|
+
SubagentReservationAmounts: () => SubagentReservationAmounts,
|
|
19
|
+
ToolExecutionKind: () => ToolExecutionKind,
|
|
20
|
+
WorkerOperationTool: () => WorkerOperationTool,
|
|
21
|
+
getToolExecutionKind: () => getToolExecutionKind,
|
|
22
|
+
isSubagentToolAllowed: () => isSubagentToolAllowed,
|
|
23
|
+
maxErrorTagLength: () => 256,
|
|
24
|
+
narrowSubagentGrant: () => narrowSubagentGrant
|
|
25
|
+
});
|
|
26
|
+
const Natural = Schema.Natural;
|
|
27
|
+
const PositiveInt = Schema.Int.check(Schema.isGreaterThan(0));
|
|
28
|
+
const FinitePositiveDuration = Schema.Duration.pipe(Schema.refine((duration) => Duration.isFinite(duration) && Duration.isPositive(duration), { expected: "a finite positive duration" }));
|
|
29
|
+
const FiniteNonNegativeDuration = Schema.Duration.pipe(Schema.refine((duration) => Duration.isFinite(duration) && !Duration.isNegative(duration), { expected: "a finite nonnegative duration" }));
|
|
30
|
+
const SubagentPolicyFields = Schema.Struct({
|
|
31
|
+
/** Total invocation slots, including reserved descendants, available through this delegation budget. */
|
|
32
|
+
maxChildren: PositiveInt,
|
|
33
|
+
/** Concurrently executing children per parent Run. */
|
|
34
|
+
maxConcurrency: PositiveInt,
|
|
35
|
+
/** Invocation slots held for the entire descendant subtree; omitted reserves zero. */
|
|
36
|
+
descendantInvocations: Schema.optionalKey(Natural),
|
|
37
|
+
/** Model turns reserved for each child invocation. */
|
|
38
|
+
maxTurns: PositiveInt,
|
|
39
|
+
/** Tool Calls reserved for each child invocation. */
|
|
40
|
+
maxToolCalls: PositiveInt,
|
|
41
|
+
/** Wall-clock duration reserved for each child invocation. */
|
|
42
|
+
maxDuration: FinitePositiveDuration,
|
|
43
|
+
/**
|
|
44
|
+
* Time held back before the in-process parent's deadline; omitted reserves zero.
|
|
45
|
+
* Does not apply to durable attached children or background workers.
|
|
46
|
+
*/
|
|
47
|
+
parentReserveDuration: Schema.optionalKey(FiniteNonNegativeDuration),
|
|
48
|
+
maxInputTokens: Schema.optionalKey(PositiveInt),
|
|
49
|
+
maxOutputTokens: Schema.optionalKey(PositiveInt),
|
|
50
|
+
maxCostMicrousd: Schema.optionalKey(Natural),
|
|
51
|
+
maxResultBytes: Schema.optionalKey(PositiveInt)
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Finite delegation bounds declared by one Subagent capability.
|
|
55
|
+
* Structural limits are hard limits; token
|
|
56
|
+
* and cost caps are optional and enforced only as honestly as provider
|
|
57
|
+
* reporting allows.
|
|
58
|
+
*/
|
|
59
|
+
var SubagentPolicy = class extends Schema.Class("@effect-agent/capabilities/SubagentPolicy")(SubagentPolicyFields) {
|
|
60
|
+
/** Normalize and validate finite delegation bounds, throwing on invalid input. */
|
|
61
|
+
static make(input) {
|
|
62
|
+
const { maxDuration, parentReserveDuration, ...bounds } = input;
|
|
63
|
+
return super.make({
|
|
64
|
+
...bounds,
|
|
65
|
+
maxDuration: Duration.fromInputUnsafe(maxDuration),
|
|
66
|
+
...parentReserveDuration === void 0 ? {} : { parentReserveDuration: Duration.fromInputUnsafe(parentReserveDuration) }
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
};
|
|
70
|
+
/** Tree authority ceiling. Each child exposes only its own Toolkit's permitted names. */
|
|
71
|
+
var SubagentGrant = class extends Schema.Class("@effect-agent/capabilities/SubagentGrant")({
|
|
72
|
+
allowedToolNames: Schema.Array(Schema.NonEmptyString).check(Schema.isMaxLength(128)),
|
|
73
|
+
maxDepth: Schema.Int.check(Schema.isBetween({
|
|
74
|
+
minimum: 1,
|
|
75
|
+
maximum: 16
|
|
76
|
+
})),
|
|
77
|
+
/** Omitted permits either lifetime within the depth and reserved subtree budgets. */
|
|
78
|
+
childLifetimes: Schema.optionalKey(Schema.Array(Schema.Literals(["attached", "background"])).check(Schema.isMaxLength(2)))
|
|
79
|
+
}) {};
|
|
80
|
+
/** Intersect inherited authority; another delegation can never restore a removed capability. */
|
|
81
|
+
const narrowSubagentGrant = (declared, inherited) => inherited === void 0 ? declared : SubagentGrant.make({
|
|
82
|
+
allowedToolNames: declared.allowedToolNames.filter((name) => inherited.allowedToolNames.includes(name)),
|
|
83
|
+
maxDepth: Math.min(declared.maxDepth, inherited.maxDepth),
|
|
84
|
+
childLifetimes: (declared.childLifetimes ?? ["attached", "background"]).filter((lifetime) => (inherited.childLifetimes ?? ["attached", "background"]).includes(lifetime))
|
|
85
|
+
});
|
|
86
|
+
/** Finite delegable caps for one parent Run. Absent means not configured; present values are finite. */
|
|
87
|
+
var SubagentDelegationCaps = class extends Schema.Class("@effect-agent/capabilities/SubagentDelegationCaps")({
|
|
88
|
+
maxTotalChildInvocations: Schema.optionalKey(Natural),
|
|
89
|
+
maxConcurrentChildren: Schema.optionalKey(Natural),
|
|
90
|
+
maxTurns: Schema.optionalKey(Natural),
|
|
91
|
+
maxToolCalls: Schema.optionalKey(Natural),
|
|
92
|
+
maxDurationMillis: Schema.optionalKey(Natural),
|
|
93
|
+
maxInputTokens: Schema.optionalKey(Natural),
|
|
94
|
+
maxOutputTokens: Schema.optionalKey(Natural),
|
|
95
|
+
maxCostMicrousd: Schema.optionalKey(Natural),
|
|
96
|
+
maxResultBytes: Schema.optionalKey(Natural)
|
|
97
|
+
}) {};
|
|
98
|
+
const AmountFields = {
|
|
99
|
+
turns: Natural,
|
|
100
|
+
toolCalls: Natural,
|
|
101
|
+
durationMillis: Natural,
|
|
102
|
+
inputTokens: Natural,
|
|
103
|
+
outputTokens: Natural,
|
|
104
|
+
costMicrousd: Natural,
|
|
105
|
+
resultBytes: Natural
|
|
106
|
+
};
|
|
107
|
+
/** Exact amounts across every reservable delegation dimension. */
|
|
108
|
+
var SubagentReservationAmounts = class extends Schema.Class("@effect-agent/capabilities/SubagentReservationAmounts")(AmountFields) {};
|
|
109
|
+
/** One child reservation against the parent Run's shared delegation pool. */
|
|
110
|
+
const SubagentBudgetReservation = Schema.Struct({
|
|
111
|
+
caps: SubagentDelegationCaps,
|
|
112
|
+
allocation: SubagentReservationAmounts,
|
|
113
|
+
/** Slots reserved for every descendant input beneath this input; absent reserves none. */
|
|
114
|
+
descendantInvocations: Schema.optionalKey(Natural)
|
|
115
|
+
});
|
|
116
|
+
/** Root-relative delegation depth; the direct child of a top-level run has depth 1. */
|
|
117
|
+
const DelegationDepth = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1));
|
|
118
|
+
/** Marks a Tool implementing the idempotent Subagent establishment protocol. */
|
|
119
|
+
const DelegationTool = Context.Reference("@effect-agent/core/DelegationTool", { defaultValue: () => false });
|
|
120
|
+
/** Marks a host-managed idempotent worker operation, independently of its Tool name. */
|
|
121
|
+
const WorkerOperationTool = Context.Reference("@effect-agent/core/WorkerOperationTool", { defaultValue: () => false });
|
|
122
|
+
/** Identifies the background launch operation within a generated management Toolkit. */
|
|
123
|
+
const BackgroundSpawnTool = Context.Reference("@effect-agent/core/BackgroundSpawnTool", { defaultValue: () => false });
|
|
124
|
+
/** Declaration metadata and inherited authority determine the effective visible Tool set. */
|
|
125
|
+
const isSubagentToolAllowed = (grant, depth, name, annotations) => grant === void 0 || grant.allowedToolNames.includes(name) && (Context.get(annotations, BackgroundSpawnTool) ? depth < grant.maxDepth && (grant.childLifetimes ?? ["attached", "background"]).includes("background") : Context.get(annotations, DelegationTool) ? depth < grant.maxDepth && (grant.childLifetimes ?? ["attached", "background"]).includes("attached") : true);
|
|
126
|
+
/** Persisted preparation classification, checked against the resolved Tool before replay. */
|
|
127
|
+
const ToolExecutionKind = Schema.Literals([
|
|
128
|
+
"ordinary",
|
|
129
|
+
"delegation",
|
|
130
|
+
"orchestration"
|
|
131
|
+
]);
|
|
132
|
+
/** Resolve only trusted declaration metadata; names never authorize automatic replay. */
|
|
133
|
+
const getToolExecutionKind = (annotations) => Context.get(annotations, WorkerOperationTool) ? "orchestration" : Context.get(annotations, DelegationTool) ? "delegation" : "ordinary";
|
|
134
|
+
/** Immutable lineage from a child Thread to the parent identity that established it. */
|
|
135
|
+
var SubagentParentLink = class extends Schema.Class("SubagentParentLink")({
|
|
136
|
+
delegationId: DelegationId,
|
|
137
|
+
parentAgentId: AgentId,
|
|
138
|
+
parentThreadId: ThreadId,
|
|
139
|
+
parentRunId: RunId,
|
|
140
|
+
parentToolCallId: ToolCallId,
|
|
141
|
+
depth: DelegationDepth
|
|
142
|
+
}) {};
|
|
143
|
+
/**
|
|
144
|
+
* Classification of one bounded durable delegation failure.
|
|
145
|
+
* `"child-failed"` and `"child-aborted"` project the
|
|
146
|
+
* child's canonical failed/aborted Settlement; `"child-compatibility"`
|
|
147
|
+
* projects the framework's `ChildCompatibilityFailure` child Settlement (the
|
|
148
|
+
* stored child Binding digest was unavailable — recovery never substituted
|
|
149
|
+
* current code); `"establishment-denied"` is a fail-closed coordinator
|
|
150
|
+
* refusal (lineage/digest verification, divergent replay); and
|
|
151
|
+
* `"declaration-unavailable"` is retained for decoding failures recorded by
|
|
152
|
+
* versions that required an explicit durable digest declaration.
|
|
153
|
+
*/
|
|
154
|
+
const SubagentExecutionFailureClassification = Schema.Literals([
|
|
155
|
+
"child-failed",
|
|
156
|
+
"child-aborted",
|
|
157
|
+
"child-compatibility",
|
|
158
|
+
"establishment-denied",
|
|
159
|
+
"declaration-unavailable"
|
|
160
|
+
]);
|
|
161
|
+
const maxErrorTagLength = 256;
|
|
162
|
+
const BoundedErrorTag = Schema.NonEmptyString.check(Schema.isMaxLength(256));
|
|
163
|
+
/**
|
|
164
|
+
* Bounded framework projection of a durable child failure, shared by attached joins and reports.
|
|
165
|
+
* A failed or aborted durable child
|
|
166
|
+
* joins its parent Tool Call as exactly this typed failure: a classification,
|
|
167
|
+
* the child references, and the coordinator's bounded `{errorTag, message}`
|
|
168
|
+
* projection — never a raw Cause, stack, provider response, secret, or child
|
|
169
|
+
* payload. The typed child failure union does not survive a durable
|
|
170
|
+
* Settlement, so `mapChildFailure` remains the ephemeral-path contract;
|
|
171
|
+
* Schema-declared durable domain-failure mapping is a recorded later
|
|
172
|
+
* extension.
|
|
173
|
+
*/
|
|
174
|
+
var SubagentExecutionFailure = class extends Schema.TaggedError()("SubagentExecutionFailure", {
|
|
175
|
+
delegationId: DelegationId,
|
|
176
|
+
targetAgentId: AgentId,
|
|
177
|
+
classification: SubagentExecutionFailureClassification,
|
|
178
|
+
/** Child references, present once establishment reached a child identity. */
|
|
179
|
+
childThreadId: Schema.optionalKey(ThreadId),
|
|
180
|
+
childSubmissionId: Schema.optionalKey(SubmissionId),
|
|
181
|
+
childRunId: Schema.optionalKey(RunId),
|
|
182
|
+
errorTag: BoundedErrorTag,
|
|
183
|
+
message: Schema.String.check(Schema.isMaxLength(4096))
|
|
184
|
+
}) {};
|
|
185
|
+
export { maxErrorTagLength as _, SubagentContract_exports as a, SubagentExecutionFailureClassification as c, SubagentPolicy as d, SubagentReservationAmounts as f, isSubagentToolAllowed as g, getToolExecutionKind as h, SubagentBudgetReservation as i, SubagentGrant as l, WorkerOperationTool as m, DelegationDepth as n, SubagentDelegationCaps as o, ToolExecutionKind as p, DelegationTool as r, SubagentExecutionFailure as s, BackgroundSpawnTool as t, SubagentParentLink as u, narrowSubagentGrant as v };
|
|
186
|
+
|
|
187
|
+
//# sourceMappingURL=SubagentContract-C-7AxTm_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentContract-C-7AxTm_.mjs","names":[],"sources":["../src/core/SubagentContract.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport * as Duration from 'effect/Duration'\nimport * as Schema from 'effect/Schema'\n\nimport { AgentId, DelegationId, RunId, SubmissionId, ThreadId, ToolCallId } from './Identifiers'\n\nconst Natural = Schema.Natural\n\nconst PositiveInt = Schema.Int.check(Schema.isGreaterThan(0))\n\nconst FinitePositiveDuration = Schema.Duration.pipe(\n Schema.refine(\n (duration): duration is Duration.Duration => Duration.isFinite(duration) && Duration.isPositive(duration),\n { expected: 'a finite positive duration' },\n ),\n)\n\nconst FiniteNonNegativeDuration = Schema.Duration.pipe(\n Schema.refine(\n (duration): duration is Duration.Duration => Duration.isFinite(duration) && !Duration.isNegative(duration),\n { expected: 'a finite nonnegative duration' },\n ),\n)\n\nconst SubagentPolicyFields = Schema.Struct({\n /** Total invocation slots, including reserved descendants, available through this delegation budget. */\n maxChildren: PositiveInt,\n /** Concurrently executing children per parent Run. */\n maxConcurrency: PositiveInt,\n /** Invocation slots held for the entire descendant subtree; omitted reserves zero. */\n descendantInvocations: Schema.optionalKey(Natural),\n /** Model turns reserved for each child invocation. */\n maxTurns: PositiveInt,\n /** Tool Calls reserved for each child invocation. */\n maxToolCalls: PositiveInt,\n /** Wall-clock duration reserved for each child invocation. */\n maxDuration: FinitePositiveDuration,\n /**\n * Time held back before the in-process parent's deadline; omitted reserves zero.\n * Does not apply to durable attached children or background workers.\n */\n parentReserveDuration: Schema.optionalKey(FiniteNonNegativeDuration),\n maxInputTokens: Schema.optionalKey(PositiveInt),\n maxOutputTokens: Schema.optionalKey(PositiveInt),\n maxCostMicrousd: Schema.optionalKey(Natural),\n maxResultBytes: Schema.optionalKey(PositiveInt),\n})\n\ntype SubagentPolicyFields = typeof SubagentPolicyFields.Type\n\n/** Inputs normalized and validated by `SubagentPolicy.make`. */\nexport type SubagentPolicyInput = Readonly<\n Omit<SubagentPolicyFields, 'maxDuration' | 'parentReserveDuration'> & {\n /** Finite, positive wall-clock duration accepted in any Effect Duration input form. */\n readonly maxDuration: Duration.Input\n /** Finite, nonnegative time reserved for the in-process parent to finish. */\n readonly parentReserveDuration?: Duration.Input\n }\n>\n\n/**\n * Finite delegation bounds declared by one Subagent capability.\n * Structural limits are hard limits; token\n * and cost caps are optional and enforced only as honestly as provider\n * reporting allows.\n */\nexport class SubagentPolicy extends Schema.Class<SubagentPolicy>(\n '@effect-agent/capabilities/SubagentPolicy',\n)(SubagentPolicyFields) {\n /** Normalize and validate finite delegation bounds, throwing on invalid input. */\n static override make(input: SubagentPolicyInput): SubagentPolicy {\n const { maxDuration, parentReserveDuration, ...bounds } = input\n\n return super.make({\n ...bounds,\n maxDuration: Duration.fromInputUnsafe(maxDuration),\n ...(parentReserveDuration === undefined\n ? {}\n : { parentReserveDuration: Duration.fromInputUnsafe(parentReserveDuration) }),\n })\n }\n}\n\n/** Tree authority ceiling. Each child exposes only its own Toolkit's permitted names. */\nexport class SubagentGrant extends Schema.Class<SubagentGrant>(\n '@effect-agent/capabilities/SubagentGrant',\n)({\n allowedToolNames: Schema.Array(Schema.NonEmptyString).check(Schema.isMaxLength(128)),\n maxDepth: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 16 })),\n /** Omitted permits either lifetime within the depth and reserved subtree budgets. */\n childLifetimes: Schema.optionalKey(\n Schema.Array(Schema.Literals(['attached', 'background'])).check(Schema.isMaxLength(2)),\n ),\n}) {}\n\n/** Intersect inherited authority; another delegation can never restore a removed capability. */\nexport const narrowSubagentGrant = (\n declared: SubagentGrant,\n inherited?: SubagentGrant,\n): SubagentGrant =>\n inherited === undefined\n ? declared\n : SubagentGrant.make({\n allowedToolNames: declared.allowedToolNames.filter((name) => inherited.allowedToolNames.includes(name)),\n maxDepth: Math.min(declared.maxDepth, inherited.maxDepth),\n childLifetimes: (declared.childLifetimes ?? ['attached', 'background']).filter((lifetime) =>\n (inherited.childLifetimes ?? ['attached', 'background']).includes(lifetime)\n ),\n })\n\n/** Finite delegable caps for one parent Run. Absent means not configured; present values are finite. */\nexport class SubagentDelegationCaps extends Schema.Class<SubagentDelegationCaps>(\n '@effect-agent/capabilities/SubagentDelegationCaps',\n)({\n maxTotalChildInvocations: Schema.optionalKey(Natural),\n maxConcurrentChildren: Schema.optionalKey(Natural),\n maxTurns: Schema.optionalKey(Natural),\n maxToolCalls: Schema.optionalKey(Natural),\n maxDurationMillis: Schema.optionalKey(Natural),\n maxInputTokens: Schema.optionalKey(Natural),\n maxOutputTokens: Schema.optionalKey(Natural),\n maxCostMicrousd: Schema.optionalKey(Natural),\n maxResultBytes: Schema.optionalKey(Natural),\n}) {}\n\nconst AmountFields = {\n turns: Natural,\n toolCalls: Natural,\n durationMillis: Natural,\n inputTokens: Natural,\n outputTokens: Natural,\n costMicrousd: Natural,\n resultBytes: Natural,\n} as const\n\n/** Exact amounts across every reservable delegation dimension. */\nexport class SubagentReservationAmounts extends Schema.Class<SubagentReservationAmounts>(\n '@effect-agent/capabilities/SubagentReservationAmounts',\n)(AmountFields) {}\n\n/** One child reservation against the parent Run's shared delegation pool. */\nexport const SubagentBudgetReservation = Schema.Struct({\n caps: SubagentDelegationCaps,\n allocation: SubagentReservationAmounts,\n /** Slots reserved for every descendant input beneath this input; absent reserves none. */\n descendantInvocations: Schema.optionalKey(Natural),\n})\n\nexport type SubagentBudgetReservation = typeof SubagentBudgetReservation.Type\n\n/** Root-relative delegation depth; the direct child of a top-level run has depth 1. */\nexport const DelegationDepth = Schema.Int.check(Schema.isGreaterThanOrEqualTo(1))\nexport type DelegationDepth = typeof DelegationDepth.Type\n\n/** Marks a Tool implementing the idempotent Subagent establishment protocol. */\nexport const DelegationTool = Context.Reference<boolean>('@effect-agent/core/DelegationTool', {\n defaultValue: () => false,\n})\n\n/** Marks a host-managed idempotent worker operation, independently of its Tool name. */\nexport const WorkerOperationTool = Context.Reference<boolean>(\n '@effect-agent/core/WorkerOperationTool',\n {\n defaultValue: () => false,\n },\n)\n\n/** Identifies the background launch operation within a generated management Toolkit. */\nexport const BackgroundSpawnTool = Context.Reference<boolean>(\n '@effect-agent/core/BackgroundSpawnTool',\n {\n defaultValue: () => false,\n },\n)\n\n/** Declaration metadata and inherited authority determine the effective visible Tool set. */\nexport const isSubagentToolAllowed = (\n grant: SubagentGrant | undefined,\n depth: number,\n name: string,\n annotations: Context.Context<never>,\n): boolean =>\n grant === undefined ||\n (grant.allowedToolNames.includes(name) &&\n (Context.get(annotations, BackgroundSpawnTool)\n ? depth < grant.maxDepth &&\n (grant.childLifetimes ?? ['attached', 'background']).includes('background')\n : Context.get(annotations, DelegationTool)\n ? depth < grant.maxDepth &&\n (grant.childLifetimes ?? ['attached', 'background']).includes('attached')\n : true))\n\n/** Persisted preparation classification, checked against the resolved Tool before replay. */\nexport const ToolExecutionKind = Schema.Literals(['ordinary', 'delegation', 'orchestration'])\nexport type ToolExecutionKind = typeof ToolExecutionKind.Type\n\n/** Resolve only trusted declaration metadata; names never authorize automatic replay. */\nexport const getToolExecutionKind = (annotations: Context.Context<never>): ToolExecutionKind =>\n Context.get(annotations, WorkerOperationTool)\n ? 'orchestration'\n : Context.get(annotations, DelegationTool)\n ? 'delegation'\n : 'ordinary'\n\n/** Immutable lineage from a child Thread to the parent identity that established it. */\nexport class SubagentParentLink extends Schema.Class<SubagentParentLink>('SubagentParentLink')({\n delegationId: DelegationId,\n parentAgentId: AgentId,\n parentThreadId: ThreadId,\n parentRunId: RunId,\n parentToolCallId: ToolCallId,\n depth: DelegationDepth,\n}) {}\n\n/**\n * Classification of one bounded durable delegation failure.\n * `\"child-failed\"` and `\"child-aborted\"` project the\n * child's canonical failed/aborted Settlement; `\"child-compatibility\"`\n * projects the framework's `ChildCompatibilityFailure` child Settlement (the\n * stored child Binding digest was unavailable — recovery never substituted\n * current code); `\"establishment-denied\"` is a fail-closed coordinator\n * refusal (lineage/digest verification, divergent replay); and\n * `\"declaration-unavailable\"` is retained for decoding failures recorded by\n * versions that required an explicit durable digest declaration.\n */\nexport const SubagentExecutionFailureClassification = Schema.Literals([\n 'child-failed',\n 'child-aborted',\n 'child-compatibility',\n 'establishment-denied',\n 'declaration-unavailable',\n])\n\nexport type SubagentExecutionFailureClassification = typeof SubagentExecutionFailureClassification.Type\n\nexport const maxErrorTagLength = 256\nconst BoundedErrorTag = Schema.NonEmptyString.check(Schema.isMaxLength(maxErrorTagLength))\n\n/**\n * Bounded framework projection of a durable child failure, shared by attached joins and reports.\n * A failed or aborted durable child\n * joins its parent Tool Call as exactly this typed failure: a classification,\n * the child references, and the coordinator's bounded `{errorTag, message}`\n * projection — never a raw Cause, stack, provider response, secret, or child\n * payload. The typed child failure union does not survive a durable\n * Settlement, so `mapChildFailure` remains the ephemeral-path contract;\n * Schema-declared durable domain-failure mapping is a recorded later\n * extension.\n */\nexport class SubagentExecutionFailure extends Schema.TaggedError<SubagentExecutionFailure>()(\n 'SubagentExecutionFailure',\n {\n delegationId: DelegationId,\n targetAgentId: AgentId,\n classification: SubagentExecutionFailureClassification,\n /** Child references, present once establishment reached a child identity. */\n childThreadId: Schema.optionalKey(ThreadId),\n childSubmissionId: Schema.optionalKey(SubmissionId),\n childRunId: Schema.optionalKey(RunId),\n errorTag: BoundedErrorTag,\n message: Schema.String.check(Schema.isMaxLength(4 * 1024)),\n },\n) {}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAMA,MAAM,UAAU,OAAO;AAEvB,MAAM,cAAc,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;AAE5D,MAAM,yBAAyB,OAAO,SAAS,KAC7C,OAAO,QACJ,aAA4C,SAAS,SAAS,QAAQ,KAAK,SAAS,WAAW,QAAQ,GACxG,EAAE,UAAU,6BAA6B,CAC3C,CACF;AAEA,MAAM,4BAA4B,OAAO,SAAS,KAChD,OAAO,QACJ,aAA4C,SAAS,SAAS,QAAQ,KAAK,CAAC,SAAS,WAAW,QAAQ,GACzG,EAAE,UAAU,gCAAgC,CAC9C,CACF;AAEA,MAAM,uBAAuB,OAAO,OAAO;;CAEzC,aAAa;;CAEb,gBAAgB;;CAEhB,uBAAuB,OAAO,YAAY,OAAO;;CAEjD,UAAU;;CAEV,cAAc;;CAEd,aAAa;;;;;CAKb,uBAAuB,OAAO,YAAY,yBAAyB;CACnE,gBAAgB,OAAO,YAAY,WAAW;CAC9C,iBAAiB,OAAO,YAAY,WAAW;CAC/C,iBAAiB,OAAO,YAAY,OAAO;CAC3C,gBAAgB,OAAO,YAAY,WAAW;AAChD,CAAC;;;;;;;AAoBD,IAAa,iBAAb,cAAoC,OAAO,MACzC,2CACF,CAAC,CAAC,oBAAoB,CAAC,CAAC;;CAEtB,OAAgB,KAAK,OAA4C;EAC/D,MAAM,EAAE,aAAa,uBAAuB,GAAG,WAAW;EAE1D,OAAO,MAAM,KAAK;GAChB,GAAG;GACH,aAAa,SAAS,gBAAgB,WAAW;GACjD,GAAI,0BAA0B,KAAA,IAC1B,CAAC,IACD,EAAE,uBAAuB,SAAS,gBAAgB,qBAAqB,EAAE;EAC/E,CAAC;CACH;AACF;;AAGA,IAAa,gBAAb,cAAmC,OAAO,MACxC,0CACF,CAAC,CAAC;CACA,kBAAkB,OAAO,MAAM,OAAO,cAAc,CAAC,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC;CACnF,UAAU,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAG,CAAC,CAAC;;CAExE,gBAAgB,OAAO,YACrB,OAAO,MAAM,OAAO,SAAS,CAAC,YAAY,YAAY,CAAC,CAAC,CAAC,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC,CACvF;AACF,CAAC,CAAC,CAAC,CAAC;;AAGJ,MAAa,uBACX,UACA,cAEA,cAAc,KAAA,IACV,WACA,cAAc,KAAK;CACnB,kBAAkB,SAAS,iBAAiB,QAAQ,SAAS,UAAU,iBAAiB,SAAS,IAAI,CAAC;CACtG,UAAU,KAAK,IAAI,SAAS,UAAU,UAAU,QAAQ;CACxD,iBAAiB,SAAS,kBAAkB,CAAC,YAAY,YAAY,EAAA,CAAG,QAAQ,cAC7E,UAAU,kBAAkB,CAAC,YAAY,YAAY,EAAA,CAAG,SAAS,QAAQ,CAC5E;AACF,CAAC;;AAGL,IAAa,yBAAb,cAA4C,OAAO,MACjD,mDACF,CAAC,CAAC;CACA,0BAA0B,OAAO,YAAY,OAAO;CACpD,uBAAuB,OAAO,YAAY,OAAO;CACjD,UAAU,OAAO,YAAY,OAAO;CACpC,cAAc,OAAO,YAAY,OAAO;CACxC,mBAAmB,OAAO,YAAY,OAAO;CAC7C,gBAAgB,OAAO,YAAY,OAAO;CAC1C,iBAAiB,OAAO,YAAY,OAAO;CAC3C,iBAAiB,OAAO,YAAY,OAAO;CAC3C,gBAAgB,OAAO,YAAY,OAAO;AAC5C,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAM,eAAe;CACnB,OAAO;CACP,WAAW;CACX,gBAAgB;CAChB,aAAa;CACb,cAAc;CACd,cAAc;CACd,aAAa;AACf;;AAGA,IAAa,6BAAb,cAAgD,OAAO,MACrD,uDACF,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC;;AAGjB,MAAa,4BAA4B,OAAO,OAAO;CACrD,MAAM;CACN,YAAY;;CAEZ,uBAAuB,OAAO,YAAY,OAAO;AACnD,CAAC;;AAKD,MAAa,kBAAkB,OAAO,IAAI,MAAM,OAAO,uBAAuB,CAAC,CAAC;;AAIhF,MAAa,iBAAiB,QAAQ,UAAmB,qCAAqC,EAC5F,oBAAoB,MACtB,CAAC;;AAGD,MAAa,sBAAsB,QAAQ,UACzC,0CACA,EACE,oBAAoB,MACtB,CACF;;AAGA,MAAa,sBAAsB,QAAQ,UACzC,0CACA,EACE,oBAAoB,MACtB,CACF;;AAGA,MAAa,yBACX,OACA,OACA,MACA,gBAEA,UAAU,KAAA,KACT,MAAM,iBAAiB,SAAS,IAAI,MAClC,QAAQ,IAAI,aAAa,mBAAmB,IACzC,QAAQ,MAAM,aACb,MAAM,kBAAkB,CAAC,YAAY,YAAY,EAAA,CAAG,SAAS,YAAY,IAC1E,QAAQ,IAAI,aAAa,cAAc,IACvC,QAAQ,MAAM,aACb,MAAM,kBAAkB,CAAC,YAAY,YAAY,EAAA,CAAG,SAAS,UAAU,IACxE;;AAGR,MAAa,oBAAoB,OAAO,SAAS;CAAC;CAAY;CAAc;AAAe,CAAC;;AAI5F,MAAa,wBAAwB,gBACnC,QAAQ,IAAI,aAAa,mBAAmB,IACxC,kBACA,QAAQ,IAAI,aAAa,cAAc,IACvC,eACA;;AAGN,IAAa,qBAAb,cAAwC,OAAO,MAA0B,oBAAoB,CAAC,CAAC;CAC7F,cAAc;CACd,eAAe;CACf,gBAAgB;CAChB,aAAa;CACb,kBAAkB;CAClB,OAAO;AACT,CAAC,CAAC,CAAC,CAAC;;;;;;;;;;;;AAaJ,MAAa,yCAAyC,OAAO,SAAS;CACpE;CACA;CACA;CACA;CACA;AACF,CAAC;AAID,MAAa,oBAAoB;AACjC,MAAM,kBAAkB,OAAO,eAAe,MAAM,OAAO,YAAA,GAA6B,CAAC;;;;;;;;;;;;AAazF,IAAa,2BAAb,cAA8C,OAAO,YAAsC,CAAC,CAC1F,4BACA;CACE,cAAc;CACd,eAAe;CACf,gBAAgB;;CAEhB,eAAe,OAAO,YAAY,QAAQ;CAC1C,mBAAmB,OAAO,YAAY,YAAY;CAClD,YAAY,OAAO,YAAY,KAAK;CACpC,UAAU;CACV,SAAS,OAAO,OAAO,MAAM,OAAO,YAAY,IAAQ,CAAC;AAC3D,CACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Context from "effect/Context";
|
|
3
|
+
import * as Schema from "effect/Schema";
|
|
4
|
+
import * as Stream from "effect/Stream";
|
|
5
|
+
import { c as WorkerError } from "./Worker-CQu8Qp1j.mjs";
|
|
6
|
+
// src/engine/SubagentHost.ts
|
|
7
|
+
var SubagentHost_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
SubagentHost: () => SubagentHost,
|
|
9
|
+
WorkerReportPreparationFailure: () => WorkerReportPreparationFailure
|
|
10
|
+
});
|
|
11
|
+
/** A bounded projection failure; raw application errors never enter durable report records. */
|
|
12
|
+
var WorkerReportPreparationFailure = class extends Schema.TaggedError()("WorkerReportPreparationFailure", { stage: Schema.Literals([
|
|
13
|
+
"projection",
|
|
14
|
+
"input",
|
|
15
|
+
"preparation"
|
|
16
|
+
]) }) {};
|
|
17
|
+
/**
|
|
18
|
+
* Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;
|
|
19
|
+
* programmatic callers acquire a separately authorized Thread facet. Request values cannot
|
|
20
|
+
* choose the source identity, replace worker provenance or expand its authority and budgets.
|
|
21
|
+
*/
|
|
22
|
+
var SubagentHost = class SubagentHost extends Context.Service()("@effect-agent/engine/SubagentHost") {
|
|
23
|
+
static unavailable = {
|
|
24
|
+
context: WorkerError.make({
|
|
25
|
+
operation: "context",
|
|
26
|
+
reason: "unavailable"
|
|
27
|
+
}),
|
|
28
|
+
start: () => WorkerError.make({
|
|
29
|
+
operation: "start",
|
|
30
|
+
reason: "unavailable"
|
|
31
|
+
}),
|
|
32
|
+
followUp: () => WorkerError.make({
|
|
33
|
+
operation: "followUp",
|
|
34
|
+
reason: "unavailable"
|
|
35
|
+
}),
|
|
36
|
+
inspect: () => WorkerError.make({
|
|
37
|
+
operation: "inspect",
|
|
38
|
+
reason: "unavailable"
|
|
39
|
+
}),
|
|
40
|
+
summary: () => WorkerError.make({
|
|
41
|
+
operation: "inspect",
|
|
42
|
+
reason: "unavailable"
|
|
43
|
+
}),
|
|
44
|
+
observe: () => Stream.fail(WorkerError.make({
|
|
45
|
+
operation: "observe",
|
|
46
|
+
reason: "unavailable"
|
|
47
|
+
})),
|
|
48
|
+
await: () => WorkerError.make({
|
|
49
|
+
operation: "await",
|
|
50
|
+
reason: "unavailable"
|
|
51
|
+
}),
|
|
52
|
+
list: () => WorkerError.make({
|
|
53
|
+
operation: "list",
|
|
54
|
+
reason: "unavailable"
|
|
55
|
+
}),
|
|
56
|
+
stop: () => WorkerError.make({
|
|
57
|
+
operation: "stop",
|
|
58
|
+
reason: "unavailable"
|
|
59
|
+
}),
|
|
60
|
+
cancel: () => WorkerError.make({
|
|
61
|
+
operation: "cancel",
|
|
62
|
+
reason: "unavailable"
|
|
63
|
+
})
|
|
64
|
+
};
|
|
65
|
+
/** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */
|
|
66
|
+
static forTool = Context.Reference("@effect-agent/engine/SubagentHost/forTool", { defaultValue: () => () => SubagentHost.unavailable });
|
|
67
|
+
};
|
|
68
|
+
export { SubagentHost_exports as n, WorkerReportPreparationFailure as r, SubagentHost as t };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=SubagentHost-BEnICu7g.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentHost-BEnICu7g.mjs","names":[],"sources":["../src/engine/SubagentHost.ts"],"sourcesContent":["import * as Context from 'effect/Context'\nimport type * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\nimport * as Stream from 'effect/Stream'\n\nimport type * as Agent from '../core/Agent'\nimport type { AgentPolicy } from '../core/AgentPolicy'\nimport type { Update } from '../core/AgentUpdates'\nimport type * as FailureDiagnostic from '../core/FailureDiagnostic'\nimport type { DelegationId, RunId, SettlementId, ThreadId } from '../core/Identifiers'\nimport type { MessageRef, MessageStatus } from '../core/Messaging'\nimport { type IdempotencyKey, type JoinedToHost, type Receipt } from '../core/Receipt'\nimport type { SubagentBudgetReservation, SubagentPolicy } from '../core/SubagentContract'\nimport {\n type WorkerBudgetScope,\n type WorkerCompletion,\n type WorkerContext,\n WorkerError,\n type WorkerHistoryEntry,\n type WorkerPage,\n type WorkerRef,\n type WorkerSource,\n type WorkerStarted,\n type WorkerStop,\n type WorkerStopped,\n type WorkerSummary,\n} from '../core/Worker'\n\n/** Prepared values cross this port only to be Schema-decoded before durable storage. */\nexport interface StartWorkerRequest {\n readonly delegationId: DelegationId\n /** Start a distinct assignment using verified completed predecessor authority. */\n readonly continuationOf?: WorkerRef\n readonly target: Agent.AnyDefinition\n readonly idempotencyKey: IdempotencyKey\n readonly encodedInput: unknown\n readonly encodedParameters: unknown\n readonly policy: AgentPolicy\n readonly budget: SubagentBudgetReservation\n readonly encodedGrant: unknown\n readonly toolCallAllowance?: number\n /** Author-owned request; the durable host must separately authorize worker-run funding. */\n readonly budgetScope?: WorkerBudgetScope\n}\n\n/**\n * First-admission preparation stays lazy until the owner authorizes the caller and checks the\n * retained command. Replays compare declared parameters/options and reuse the original capture.\n * Prepared policy, budget, and allowance are frozen first-admission configuration, not replay\n * arguments; changing them requires a new command key. Current caller authorization still applies.\n * Preparation must be free of external effects: concurrent first admissions can prepare before\n * the retained delivery chooses its first writer.\n */\nexport interface DeferredStartWorkerRequest<E = never, R = never> extends\n Pick<\n StartWorkerRequest,\n | 'delegationId'\n | 'continuationOf'\n | 'target'\n | 'idempotencyKey'\n | 'encodedParameters'\n | 'encodedGrant'\n | 'budgetScope'\n >\n{\n /** Declaration ceilings; the host resolves effective policy and reserves the funded budget. */\n readonly declarationPolicy?: SubagentPolicy\n readonly prepare: Effect.Effect<Pick<StartWorkerRequest, 'encodedInput'>, E, R>\n}\n\nexport interface FollowUpWorkerRequest {\n readonly worker: WorkerRef\n readonly target: Agent.AnyDefinition\n readonly idempotencyKey: IdempotencyKey\n readonly encodedInput: unknown\n readonly encodedParameters: unknown\n}\n\n/**\n * Like deferred starts, follow-ups prepare only after current authorization and retained-command\n * lookup. Replays compare declared parameters and reuse the original input and worker authority.\n * Preparation must be free of external effects because concurrent first admissions can prepare.\n */\nexport interface DeferredFollowUpWorkerRequest<E = never, R = never> extends\n Omit<\n FollowUpWorkerRequest,\n 'encodedInput'\n >\n{\n readonly prepare: Effect.Effect<Pick<FollowUpWorkerRequest, 'encodedInput'>, E, R>\n}\n\nexport interface WorkerReceiptRequest {\n readonly worker: WorkerRef\n readonly target: Agent.AnyDefinition\n readonly receipt: Receipt\n}\n\nexport interface WorkerMessageRequest {\n readonly worker: WorkerRef\n readonly target: Agent.AnyDefinition\n readonly message: MessageRef\n}\n\n/**\n * Canonical terminal values remain encoded until the capability decodes the saved parameters\n * and target output and applies its declared result projection. Child E does not survive settlement.\n */\nexport type WorkerObservation =\n | { readonly _tag: 'Pending'; readonly receipt: Receipt }\n | {\n readonly _tag: 'Settled'\n readonly receipt: Receipt\n /** Absent when an input failed or was cancelled before any Run started. */\n readonly runId?: RunId\n readonly settlementId: SettlementId\n readonly outcome: 'completed' | 'failed' | 'aborted'\n readonly encodedParameters: unknown\n readonly encodedResult: unknown\n /** Operator-private failed-settlement evidence; never part of a model Tool result. */\n readonly diagnostic?: FailureDiagnostic.Failure\n readonly budgetExhausted: boolean\n }\n\n/** One actual canonical Run, independent of how many input Receipts joined it. */\nexport interface WorkerRunReport {\n readonly worker: WorkerRef\n readonly context: WorkerContext\n readonly observation: Extract<WorkerObservation, { readonly _tag: 'Settled' }> & {\n readonly runId: RunId\n }\n}\n\n/** A bounded projection failure; raw application errors never enter durable report records. */\nexport class WorkerReportPreparationFailure extends Schema.TaggedError<WorkerReportPreparationFailure>()(\n 'WorkerReportPreparationFailure',\n { stage: Schema.Literals(['projection', 'input', 'preparation']) },\n) {}\n\n/**\n * Source-owned standard projection supplied explicitly at durable registration.\n * The concrete descriptor retains its E/R; durable registration captures R and records\n * bounded preparation failure rather than serializing arbitrary application errors.\n */\nexport interface WorkerReporting<E = never, R = never> {\n readonly delegationId: DelegationId\n readonly target: Agent.AnyDefinition\n /** Pure first-emission selection. False retains the canonical update without parent delivery. */\n readonly reportUpdate?: (update: Update) => boolean\n /** False retains a filtered report receipt without waking the parent. */\n readonly reportCompletion?: (report: WorkerRunReport) => boolean\n readonly prepare: (report: WorkerRunReport) => Effect.Effect<\n {\n readonly message: WorkerCompletion\n },\n E | WorkerReportPreparationFailure,\n R\n >\n}\n\n/**\n * Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;\n * programmatic callers acquire a separately authorized Thread facet. Request values cannot\n * choose the source identity, replace worker provenance or expand its authority and budgets.\n */\nexport class SubagentHost extends Context.Service<\n SubagentHost,\n {\n readonly context: Effect.Effect<WorkerContext, WorkerError>\n /** Prepared callers retain strict input/policy conflicts; deferred callers replay the saved capture. */\n readonly start: <E = never, R = never>(\n request: StartWorkerRequest | DeferredStartWorkerRequest<E, R>,\n ) => Effect.Effect<WorkerStarted, WorkerError | E, R>\n /** Prepared callers retain strict input conflicts; deferred callers replay the saved capture. */\n readonly followUp: <E = never, R = never>(\n request: FollowUpWorkerRequest | DeferredFollowUpWorkerRequest<E, R>,\n ) => Effect.Effect<MessageStatus, WorkerError | E, R>\n readonly inspect: (\n request: WorkerReceiptRequest | WorkerMessageRequest,\n ) => Effect.Effect<WorkerObservation | MessageStatus, WorkerError>\n /** Inspect the continuing worker using the same summary contract as discovery. */\n readonly summary: (request: {\n readonly worker: WorkerRef\n readonly target: Agent.AnyDefinition\n }) => Effect.Effect<WorkerSummary, WorkerError>\n /** A finite snapshot through the captured tail; resume with the last sequence as `after`. */\n readonly observe: (request: {\n readonly worker: WorkerRef\n readonly target: Agent.AnyDefinition\n readonly after?: number\n }) => Stream.Stream<WorkerHistoryEntry, WorkerError>\n /** Interrupting this wait never requests cancellation of accepted work. */\n readonly await: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<WorkerObservation, WorkerError>\n readonly list: (request: {\n readonly delegationId: DelegationId\n readonly target: Agent.AnyDefinition\n readonly limit: number\n readonly after?: ThreadId\n }) => Effect.Effect<WorkerPage, WorkerError>\n /** Seal the whole worker; retries reconcile the same command, including a lost acknowledgement. */\n readonly stop: (\n request: WorkerStop & { readonly target: Agent.AnyDefinition },\n ) => Effect.Effect<WorkerStopped, WorkerError>\n /** Cancel exactly this Receipt; preserve JoinedToHost without broadening its target. */\n readonly cancel: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<void, WorkerError | JoinedToHost>\n }\n>()('@effect-agent/engine/SubagentHost') {\n static readonly unavailable: SubagentHost['Service'] = {\n context: WorkerError.make({ operation: 'context', reason: 'unavailable' }),\n start: () => WorkerError.make({ operation: 'start', reason: 'unavailable' }),\n followUp: () => WorkerError.make({ operation: 'followUp', reason: 'unavailable' }),\n inspect: () => WorkerError.make({ operation: 'inspect', reason: 'unavailable' }),\n summary: () => WorkerError.make({ operation: 'inspect', reason: 'unavailable' }),\n observe: () => Stream.fail(WorkerError.make({ operation: 'observe', reason: 'unavailable' })),\n await: () => WorkerError.make({ operation: 'await', reason: 'unavailable' }),\n list: () => WorkerError.make({ operation: 'list', reason: 'unavailable' }),\n stop: () => WorkerError.make({ operation: 'stop', reason: 'unavailable' }),\n cancel: () => WorkerError.make({ operation: 'cancel', reason: 'unavailable' }),\n }\n\n /** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */\n static readonly forTool = Context.Reference<\n (source: Extract<WorkerSource, { readonly _tag: 'tool' }>) => SubagentHost['Service']\n >('@effect-agent/engine/SubagentHost/forTool', {\n defaultValue: () => () => SubagentHost.unavailable,\n })\n}\n"],"mappings":";;;;;;;;;;;AAsIA,IAAa,iCAAb,cAAoD,OAAO,YAA4C,CAAC,CACtG,kCACA,EAAE,OAAO,OAAO,SAAS;CAAC;CAAc;CAAS;AAAa,CAAC,EAAE,CACnE,CAAC,CAAC,CAAC;;;;;;AA4BH,IAAa,eAAb,MAAa,qBAAqB,QAAQ,QA6CxC,CAAC,CAAC,mCAAmC,CAAC,CAAC;CACvC,OAAgB,cAAuC;EACrD,SAAS,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EACzE,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,gBAAgB,YAAY,KAAK;GAAE,WAAW;GAAY,QAAQ;EAAc,CAAC;EACjF,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,OAAO,KAAK,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC,CAAC;EAC5F,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,YAAY,YAAY,KAAK;GAAE,WAAW;GAAQ,QAAQ;EAAc,CAAC;EACzE,YAAY,YAAY,KAAK;GAAE,WAAW;GAAQ,QAAQ;EAAc,CAAC;EACzE,cAAc,YAAY,KAAK;GAAE,WAAW;GAAU,QAAQ;EAAc,CAAC;CAC/E;;CAGA,OAAgB,UAAU,QAAQ,UAEhC,6CAA6C,EAC7C,0BAA0B,aAAa,YACzC,CAAC;AACH"}
|