@systemfsoftware/agent 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-26pelcl9.d.mts +5678 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Agent-BH_R6LOI.d.mts +219 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-h07X1mZM.mjs +14 -0
- package/dist/AgentRegistration-h07X1mZM.mjs.map +1 -0
- package/dist/AgentRuntime-C3GQPdrv.d.mts +751 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs +5224 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-DgCEbTwW.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DMfj2beT.d.mts +62 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-D5jrWNNH.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs +8432 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BWY08cyT.d.mts +52 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-CPvcb5OX.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-C0S-Cakt.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DnnpWe-H.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-DPPHTLdT.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-CafxF31F.d.mts +22 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PersistentHistory-h-C7avqL.d.mts +14 -0
- package/dist/PreparedInputAdmission-DYugcCHR.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunContinuation-Cy2W8ASl.d.mts +127 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-DcqokgFt.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BaJXJIVt.d.mts +57 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-BJJN6n0E.mjs +1315 -0
- package/dist/Subagent-BJJN6n0E.mjs.map +1 -0
- package/dist/Subagent-GXU32fQt.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BC9B9dNT.d.mts +167 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BJ0TtZwM.d.mts +815 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs +53 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs.map +1 -0
- package/dist/SubscriptionInput-D6Okd6-z.d.mts +42 -0
- package/dist/SubscriptionTransition-Da9DmAr_.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs +638 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs.map +1 -0
- package/dist/Subscriptions-DgjahL6V.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-BVTD96Pe.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-BQDW9E_Y.d.mts +843 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadInvariants-w53c67YS.d.mts +23 -0
- package/dist/ThreadProjectionMaintenance-4ccU1auU.d.mts +51 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-D0KsqkSR.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-DvcfbTBk.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-NUk_x837.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/WebSearch-RBUUOfT8.d.mts +18 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-CubQgpsl.d.mts +171 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs +162 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs.map +1 -0
- package/dist/WorkerHost-BciHCzHq.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-D9ofkoBa.mjs +262 -0
- package/dist/agent-registration-D9ofkoBa.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-D1Tx1G6V.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +491 -3
- package/src/InMemory.ts +79 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/BrowserUse.ts +212 -0
- package/src/capabilities/Budget.ts +544 -0
- package/src/capabilities/CodeMode.ts +1129 -0
- package/src/capabilities/ContextTools.ts +131 -0
- package/src/capabilities/MemoryNotes.ts +177 -0
- package/src/capabilities/Messaging.ts +260 -0
- package/src/capabilities/Redaction.ts +163 -0
- package/src/capabilities/RunHooks.ts +116 -0
- package/src/capabilities/SemanticMemory.ts +402 -0
- package/src/capabilities/Subagent.ts +2343 -0
- package/src/capabilities/SubagentReservations.ts +807 -0
- package/src/capabilities/ToolDiscovery.ts +291 -0
- package/src/capabilities/ToolResults.ts +50 -0
- package/src/capabilities/WebCapture.ts +64 -0
- package/src/capabilities/WebSearch.ts +45 -0
- package/src/capabilities/internal/subagent-background.ts +1137 -0
- package/src/capabilities/internal/subagent-contract.ts +92 -0
- package/src/capabilities/internal/subagent-policy.ts +205 -0
- package/src/capabilities/internal/subagent-reporting.ts +152 -0
- package/src/core/Agent.ts +528 -0
- package/src/core/AgentError.ts +189 -0
- package/src/core/AgentPolicy.ts +194 -0
- package/src/core/AgentUpdates.ts +104 -0
- package/src/core/FailureDiagnostic.ts +392 -0
- package/src/core/IdGenerator.ts +42 -0
- package/src/core/Identifiers.ts +64 -0
- package/src/core/Memory.ts +283 -0
- package/src/core/MemoryNamespace.ts +202 -0
- package/src/core/MemoryReference.ts +120 -0
- package/src/core/MemoryRevalidation.ts +151 -0
- package/src/core/MemoryStore.ts +371 -0
- package/src/core/Messaging.ts +72 -0
- package/src/core/ProvisionalText.ts +53 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +22 -0
- package/src/core/RunEvent.ts +345 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +259 -0
- package/src/core/SemanticMemoryRevalidation.ts +220 -0
- package/src/core/SubagentContract.ts +263 -0
- package/src/core/Thread.ts +447 -0
- package/src/core/ToolExposure.ts +75 -0
- package/src/core/ToolResult.ts +204 -0
- package/src/core/ToolResultStorage.ts +56 -0
- package/src/core/Usage.ts +562 -0
- package/src/core/Worker.ts +236 -0
- package/src/core/internal/agent-updates.ts +42 -0
- package/src/core/internal/completion.ts +33 -0
- package/src/core/internal/json.ts +17 -0
- package/src/core/internal/memory-document.ts +39 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/tool-execution.ts +33 -0
- package/src/core/internal/utf8.ts +32 -0
- package/src/durable/ActivityStore.ts +131 -0
- package/src/durable/Admin.ts +504 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/CommittedActivity.ts +262 -0
- package/src/durable/Digest.ts +57 -0
- package/src/durable/DurableAgentRuntime.ts +12758 -0
- package/src/durable/DurableFailpoint.ts +108 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +179 -0
- package/src/durable/LifecyclePublication.ts +343 -0
- package/src/durable/MessageDelivery.ts +949 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
- package/src/durable/OperationAuthorizer.ts +89 -0
- package/src/durable/PersistentHistory.ts +322 -0
- package/src/durable/PreparedInputAdmission.ts +128 -0
- package/src/durable/RecordFormat.ts +113 -0
- package/src/durable/Records.ts +1396 -0
- package/src/durable/Recovery.ts +1022 -0
- package/src/durable/RunContinuation.ts +1946 -0
- package/src/durable/RunJournal.ts +1926 -0
- package/src/durable/RunStorage.ts +533 -0
- package/src/durable/Schedule.ts +445 -0
- package/src/durable/ScheduleStoreConformance.ts +642 -0
- package/src/durable/ScheduleTransition.ts +267 -0
- package/src/durable/Scheduling.ts +1031 -0
- package/src/durable/SettlementPublisher.ts +172 -0
- package/src/durable/SqlMemoryStore.ts +1042 -0
- package/src/durable/SqlStorageOwner.ts +25 -0
- package/src/durable/SubmissionLedger.ts +1247 -0
- package/src/durable/SubmissionLedgerConformance.ts +4695 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +527 -0
- package/src/durable/SubscriptionInput.ts +145 -0
- package/src/durable/SubscriptionStoreConformance.ts +1275 -0
- package/src/durable/SubscriptionTransition.ts +330 -0
- package/src/durable/Subscriptions.ts +1245 -0
- package/src/durable/ThreadArchiveRange.ts +91 -0
- package/src/durable/ThreadContextHistory.ts +338 -0
- package/src/durable/ThreadContextHistoryProjection.ts +219 -0
- package/src/durable/ThreadImport.ts +1199 -0
- package/src/durable/ThreadInvariants.ts +312 -0
- package/src/durable/ThreadProjectionMaintenance.ts +72 -0
- package/src/durable/ThreadReader.ts +21 -0
- package/src/durable/ThreadStore.ts +1258 -0
- package/src/durable/ThreadStoreConformance.ts +877 -0
- package/src/durable/ThreadTransfer.ts +263 -0
- package/src/durable/ThreadWork.ts +713 -0
- package/src/durable/ToolReconciler.ts +112 -0
- package/src/durable/WakeScheduler.ts +125 -0
- package/src/durable/WorkerAdmission.ts +98 -0
- package/src/durable/WorkerHost.ts +204 -0
- package/src/durable/internal/StorageOwner.ts +181 -0
- package/src/durable/internal/agent-registration.ts +713 -0
- package/src/durable/internal/agent-updates.ts +338 -0
- package/src/durable/internal/canonical-json.ts +110 -0
- package/src/durable/internal/evidence.ts +29 -0
- package/src/durable/internal/foreign-diagnostic.ts +48 -0
- package/src/durable/internal/history-prompt.ts +87 -0
- package/src/durable/internal/initial-context.ts +215 -0
- package/src/durable/internal/journal-metadata.ts +188 -0
- package/src/durable/internal/message-status.ts +18 -0
- package/src/durable/internal/messaging-host.ts +615 -0
- package/src/durable/internal/prompt-footprint.ts +47 -0
- package/src/durable/internal/prompt-history-cache.ts +604 -0
- package/src/durable/internal/record-encoding.ts +258 -0
- package/src/durable/internal/record-ownership.ts +68 -0
- package/src/durable/internal/run-context-reader.ts +51 -0
- package/src/durable/internal/run-context.ts +211 -0
- package/src/durable/internal/schedule-time.ts +304 -0
- package/src/durable/internal/thread-import-reader.ts +85 -0
- package/src/durable/internal/thread-initialization.ts +181 -0
- package/src/durable/internal/thread-transfer-source.ts +7 -0
- package/src/durable/internal/tool-operations.ts +138 -0
- package/src/durable/internal/transfer-dependencies.ts +40 -0
- package/src/durable/internal/usage-totals.ts +36 -0
- package/src/durable/internal/worker-host.ts +4041 -0
- package/src/durable/internal/worker-runtime.ts +10 -0
- package/src/engine/AgentRuntime.ts +100 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +302 -0
- package/src/engine/ContextHistory.ts +75 -0
- package/src/engine/ContextWindow.ts +81 -0
- package/src/engine/DurableStep.ts +115 -0
- package/src/engine/MessagingHost.ts +118 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +124 -0
- package/src/engine/RunOptions.ts +664 -0
- package/src/engine/SubagentHost.ts +231 -0
- package/src/engine/ThreadHistory.ts +125 -0
- package/src/engine/ToolBroker.ts +159 -0
- package/src/engine/ToolExposure.ts +49 -0
- package/src/engine/internal/agent-runtime.ts +11083 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,329 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as DateTime from "effect/DateTime";
|
|
3
|
+
import * as Effect from "effect/Effect";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import { d as ToolCallId, l as SubmissionId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
|
|
6
|
+
import { i as QueueSequence } from "./Receipt-B-FlCaNH.mjs";
|
|
7
|
+
import { Tt as ToolCallUnknown, dt as SettlementOutcome, f as CanonicalSequence, g as DeclaredToolCall } from "./Records-C645aQks.mjs";
|
|
8
|
+
import { S as RecoveryDecision, b as PendingApprovalEvidence, v as OpenDelegationCallEvidence, y as OpenToolCallEvidence } from "./Recovery-zWy_kmZq.mjs";
|
|
9
|
+
import { F as JoinSnapshot, W as ParentLinkage, b as ChildAttachmentSnapshot, bt as UnknownResolutionIntent, dt as SubmissionState, g as ApprovalDecisionIntent, gt as SuspensionSnapshot, n as AbortIntent, t as AbortCommand } from "./SubmissionLedger-WG0beEyt.mjs";
|
|
10
|
+
// src/durable/Admin.ts
|
|
11
|
+
var Admin_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
+
ExplainedEvidence: () => ExplainedEvidence,
|
|
13
|
+
ExplainedSubmission: () => ExplainedSubmission,
|
|
14
|
+
ExplainedUnknownCall: () => ExplainedUnknownCall,
|
|
15
|
+
IntegrityCheck: () => IntegrityCheck,
|
|
16
|
+
IntegrityCheckName: () => IntegrityCheckName,
|
|
17
|
+
IntegrityCheckStatus: () => IntegrityCheckStatus,
|
|
18
|
+
IntegrityReport: () => IntegrityReport,
|
|
19
|
+
ObligationBlockedOn: () => ObligationBlockedOn,
|
|
20
|
+
ObligationEntry: () => ObligationEntry,
|
|
21
|
+
ObligationReport: () => ObligationReport,
|
|
22
|
+
ObligationSeverity: () => ObligationSeverity,
|
|
23
|
+
ObligationThresholds: () => ObligationThresholds,
|
|
24
|
+
RECOVERY_DECISION_MEANINGS: () => RECOVERY_DECISION_MEANINGS,
|
|
25
|
+
RecoveryDisposition: () => RecoveryDisposition,
|
|
26
|
+
RecoveryExplanation: () => RecoveryExplanation,
|
|
27
|
+
RetryCommand: () => RetryCommand,
|
|
28
|
+
RetryRefusalReason: () => RetryRefusalReason,
|
|
29
|
+
RetryRefused: () => RetryRefused,
|
|
30
|
+
obligationSeverityOf: () => obligationSeverityOf,
|
|
31
|
+
predictRecoveryDisposition: () => predictRecoveryDisposition,
|
|
32
|
+
recoveryDecisionMeaning: () => recoveryDecisionMeaning,
|
|
33
|
+
renderRecoveryExplanation: () => renderRecoveryExplanation
|
|
34
|
+
});
|
|
35
|
+
/**
|
|
36
|
+
* Pure report logic for the P7 administrative operations (plan §3): the Schema classes carried
|
|
37
|
+
* by `DurableAgentRuntime.explain`/`verify`/`scanObligations`, the operator meaning table for
|
|
38
|
+
* every recovery decision tag, and the text renderer. Everything here is pure — no port access,
|
|
39
|
+
* no clocks, no writes — so hosts, CLIs, and wire envelopes share one report vocabulary.
|
|
40
|
+
*/
|
|
41
|
+
const BoundedDetail = Schema.String.check(Schema.isMaxLength(4096));
|
|
42
|
+
/** Non-negative whole seconds derived from the Effect Clock. */
|
|
43
|
+
const AgeSeconds = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0));
|
|
44
|
+
/**
|
|
45
|
+
* The disposition family of `RecoveryReport`, reused verbatim so an explanation predicts exactly
|
|
46
|
+
* what `runRecovery`/`retry` would report for the same decision.
|
|
47
|
+
*/
|
|
48
|
+
const RecoveryDisposition = Schema.Literals([
|
|
49
|
+
"repaired",
|
|
50
|
+
"deferred",
|
|
51
|
+
"none",
|
|
52
|
+
"unknown"
|
|
53
|
+
]);
|
|
54
|
+
/** Submission identity, lane position, and Clock-derived ages (DUR-017 obligation visibility). */
|
|
55
|
+
var ExplainedSubmission = class extends Schema.Class("@effect-agent/thread/ExplainedSubmission")({
|
|
56
|
+
submissionId: SubmissionId,
|
|
57
|
+
threadId: ThreadId,
|
|
58
|
+
state: SubmissionState,
|
|
59
|
+
queueSequence: QueueSequence,
|
|
60
|
+
createdAt: Schema.DateTimeUtcFromString,
|
|
61
|
+
readyAt: Schema.optionalKey(Schema.DateTimeUtcFromString),
|
|
62
|
+
/** Whole seconds since admission (`createdAt`). */
|
|
63
|
+
ageSeconds: AgeSeconds,
|
|
64
|
+
/** Whole seconds since readiness, present exactly when `readyAt` is recorded. */
|
|
65
|
+
readyAgeSeconds: Schema.optionalKey(AgeSeconds),
|
|
66
|
+
parentLinkage: Schema.optionalKey(ParentLinkage)
|
|
67
|
+
}) {};
|
|
68
|
+
/** One durable Unknown Outcome and whether its result is canonical (DUR-017). */
|
|
69
|
+
var ExplainedUnknownCall = class extends Schema.Class("@effect-agent/thread/ExplainedUnknownCall")({
|
|
70
|
+
toolCallId: ToolCallId,
|
|
71
|
+
toolName: ToolCallUnknown.fields.toolName,
|
|
72
|
+
reason: ToolCallUnknown.fields.reason,
|
|
73
|
+
recordedAt: Schema.DateTimeUtcFromString,
|
|
74
|
+
/** A real canonical ToolCallSettled closes this call; an intent alone is not an outcome. */
|
|
75
|
+
resolved: Schema.Boolean
|
|
76
|
+
}) {};
|
|
77
|
+
/**
|
|
78
|
+
* The evidence summary of one explanation: the classifier's canonical-history inputs plus the
|
|
79
|
+
* durable intents and subagent attachments the ledger snapshot carries. Everything is read-only
|
|
80
|
+
* observation — assembling this value performs zero writes.
|
|
81
|
+
*/
|
|
82
|
+
var ExplainedEvidence = class extends Schema.Class("@effect-agent/thread/ExplainedEvidence")({
|
|
83
|
+
threadMaterialized: Schema.Boolean,
|
|
84
|
+
inputRecorded: Schema.Boolean,
|
|
85
|
+
abortRecorded: Schema.Boolean,
|
|
86
|
+
recordedSettlementOutcome: Schema.optionalKey(SettlementOutcome),
|
|
87
|
+
/** Declared ordinary Tool Calls without a canonical outcome (DUR-009). */
|
|
88
|
+
openToolCalls: Schema.Array(OpenToolCallEvidence),
|
|
89
|
+
/** Original declared operation identities, arguments and recovery contracts; settled calls are excluded. */
|
|
90
|
+
pendingOperations: Schema.Array(DeclaredToolCall).pipe(Schema.withConstructorDefault(Effect.succeed([]))),
|
|
91
|
+
/** Delegation Tool Calls with an open parent-side obligation. */
|
|
92
|
+
openDelegationCalls: Schema.Array(OpenDelegationCallEvidence),
|
|
93
|
+
/** Canonically requested approvals without a canonical decision. */
|
|
94
|
+
approvalsPending: Schema.Array(PendingApprovalEvidence),
|
|
95
|
+
/** Durable Unknown Outcomes with their resolution coverage (DUR-017). */
|
|
96
|
+
unknownCalls: Schema.Array(ExplainedUnknownCall),
|
|
97
|
+
/** Durable approval decisions recorded against this Submission. */
|
|
98
|
+
approvalDecisions: Schema.Array(ApprovalDecisionIntent),
|
|
99
|
+
/** Durable unknown-outcome resolutions recorded against this Submission. */
|
|
100
|
+
unknownResolutions: Schema.Array(UnknownResolutionIntent),
|
|
101
|
+
/** Parent-side child attachments. */
|
|
102
|
+
childAttachments: Schema.Array(ChildAttachmentSnapshot),
|
|
103
|
+
/** Host-side joined/joining members of this Submission's Run (DUR-016). */
|
|
104
|
+
joins: Schema.Array(JoinSnapshot),
|
|
105
|
+
/** Joined-side host identity, when this Submission is joined to a host Run. */
|
|
106
|
+
hostSubmissionId: Schema.optionalKey(SubmissionId),
|
|
107
|
+
suspension: Schema.optionalKey(SuspensionSnapshot),
|
|
108
|
+
abortIntent: Schema.optionalKey(AbortIntent)
|
|
109
|
+
}) {};
|
|
110
|
+
/**
|
|
111
|
+
* The read-only recovery explanation of one Submission (P7 exit gate "operators can explain
|
|
112
|
+
* recovery state without editing storage"): the submission summary, the evidence the pure
|
|
113
|
+
* classifier consumed, the exact `RecoveryDecision` it selected, that decision's operator
|
|
114
|
+
* meaning, and the disposition the recovery pass would report for it.
|
|
115
|
+
*/
|
|
116
|
+
var RecoveryExplanation = class extends Schema.Class("@effect-agent/thread/RecoveryExplanation")({
|
|
117
|
+
submission: ExplainedSubmission,
|
|
118
|
+
evidence: ExplainedEvidence,
|
|
119
|
+
decision: RecoveryDecision,
|
|
120
|
+
/** Static operator meaning of `decision._tag` (see `RECOVERY_DECISION_MEANINGS`). */
|
|
121
|
+
decisionMeaning: BoundedDetail,
|
|
122
|
+
/**
|
|
123
|
+
* The disposition `runRecovery` would report when this decision executes without claim
|
|
124
|
+
* contention (see `predictRecoveryDisposition`): `repaired` = the recovery pass itself fixes
|
|
125
|
+
* it; `deferred` = a claiming worker must finish it; `unknown` = durably blocked on the
|
|
126
|
+
* authorized DUR-017 resolution path; `none` = settled, nothing owed.
|
|
127
|
+
*/
|
|
128
|
+
disposition: RecoveryDisposition,
|
|
129
|
+
explainedAt: Schema.DateTimeUtcFromString
|
|
130
|
+
}) {};
|
|
131
|
+
/**
|
|
132
|
+
* Operator meaning of every recovery decision tag, matching the classifier docstrings in
|
|
133
|
+
* `recovery.ts` (the classifier remains the semantic authority; this table is its operator
|
|
134
|
+
* rendering). Exhaustive over `RecoveryDecision` — adding a decision without a meaning is a
|
|
135
|
+
* compile error here.
|
|
136
|
+
*/
|
|
137
|
+
const RECOVERY_DECISION_MEANINGS = {
|
|
138
|
+
CompleteMaterialization: "Ledger admission committed but the Thread is not durable: recovery finishes materialization, appends ThreadCreated, and marks readiness.",
|
|
139
|
+
RepairReadiness: "The Thread is durable but the readiness marker is missing: recovery replays the idempotent markReady.",
|
|
140
|
+
ApplyInput: "No canonical input record exists yet: recovery appends the deterministic UserInputRecorded record and marks it applied.",
|
|
141
|
+
RepairInputMarker: "The canonical input record exists but the ledger marker was lost: recovery repairs the marker from history, never the reverse (DUR-015).",
|
|
142
|
+
ResumeFromTurnBoundary: "Input is applied and no terminal outcome is canonical: a claiming worker resumes the Run from the last committed Turn boundary; the model may be re-invoked and any duplicate cost is observable (durability §9).",
|
|
143
|
+
FinalizeLedgerFromHistory: "The canonical settlement record exists: recovery rebuilds/finalizes the ledger from history and never rewrites history from the cached ledger status (DUR-011, DUR-015).",
|
|
144
|
+
SettleAborted: "A durable abort intent exists with no canonical terminal outcome and no open attached-child obligation: recovery settles aborted, first recording ToolCallUnknown audits for open ordinary calls — abort never asserts external rollback (durability §13).",
|
|
145
|
+
MarkUnknown: "Declared ordinary Tool Calls have no canonical outcome: recovery reconciles each open call and marks the remainder Unknown — never an automatic replay (DUR-009/DUR-017).",
|
|
146
|
+
ResumePendingToolBatch: "A committed tool-declaring response has unfinished calls whose original operation contracts permit replay: a claiming worker resumes those calls without model re-invocation; unresolved ordinary mutating calls require reconciliation.",
|
|
147
|
+
AwaitApprovalDecision: "Canonically requested approvals lack decisions: the lane waits durably for the authorized resolveApproval path (recovery repairs a lost suspend transition from history).",
|
|
148
|
+
ResumeSuspended: "Every pending approval has a durable decision: a claiming worker resumes the declared batch, appending the canonical ToolApprovalDecided records first.",
|
|
149
|
+
AwaitUnknownResolution: "Unknown Outcomes lack covering resolutions: this Submission stays parked awaiting the authorized DUR-017 resolveUnknown path; later eligible input may run, and the original obligation stays visible.",
|
|
150
|
+
ApplyUnknownResolutions: "Durable resolution intents cover every open call: recovery wakes the original Submission when required retry contracts are supported; its next claim applies canonical outcomes.",
|
|
151
|
+
RevertJoining: "The Submission is joining without a canonical input record: recovery reverts it to ready — the input was never consumed and will be delivered exactly once later (DUR-016).",
|
|
152
|
+
RepairJoinMarker: "The canonical joined input exists but the joined marker was lost: recovery repairs the marker only; the input reattaches, never duplicates (DUR-015/DUR-016).",
|
|
153
|
+
SettleJoinedWithHost: "The host Run settled canonically: recovery settles this joined Submission with the host outcome — each joined Submission is owed its own settlement (DUR-002).",
|
|
154
|
+
AwaitHostSettlement: "The Submission is joined and its host Run is still live: nothing to repair — the input reattaches through the host's resume and the Submission settles with the host.",
|
|
155
|
+
CompleteChildAdmission: "A canonical SubagentRequested exists and the authoritative lookup proved not-admitted: recovery idempotently admits the intended child from the canonical request payload alone.",
|
|
156
|
+
AwaitChildAdmissionResolution: "The authoritative child-admission lookup answered indeterminate (or was not performed): recovery waits and retries the authoritative owner; a second admission never occurs (SUB-031).",
|
|
157
|
+
RepairSubagentStartLink: "The child is admitted but the parent's SubagentStarted link (or reservation attachment) is missing: recovery resolves the SAME child by its deterministic key and appends the exact link (SUB-016/SUB-017).",
|
|
158
|
+
EnsureWaitingForChild: "Children are established and at least one is nonterminal while the parent lane is not durably suspended: recovery restores the waitingForChild suspension; it reattaches the one existing child and never spawns a replacement (SUB-018/SUB-030).",
|
|
159
|
+
AwaitChildSettlement: "The parent is durably suspended waitingForChild and a listed child is not yet provably settled: the lane stays dormant, consumes no worker permit, and the child's Settlement wakes it durably (SUB-021/SUB-030).",
|
|
160
|
+
ResumeWaitingParent: "Every relevant child is provably settled but the parent has not joined: recovery replays the idempotent wake so a claiming worker resumes the declared batch and joins each child's canonical Settlement.",
|
|
161
|
+
ApplyJoinAccounting: "The canonical SubagentJoined record exists but the reservation release is incomplete: recovery replays the accounting decision FROM the canonical record — budget stays unavailable until repair, never available twice (DUR-015).",
|
|
162
|
+
PropagateChildAbort: "Parent abort is canonical while attached children are nonterminal: recovery idempotently issues each child's durable abort command and keeps the parent waiting for the joins — request-abort-and-join is the only close behavior.",
|
|
163
|
+
ReleaseOrphanChildReservation: "A child budget reservation can no longer bind a child: recovery freezes the deterministic zero-consumed accounting decision and releases the unused allocation exactly once.",
|
|
164
|
+
AwaitParentEstablishment: "The Submission is a parent-linked child whose Thread lacks the canonical lineage record: the child lane defers its own readiness repair — the parent's idempotent establishment completes it, so a child never runs a Turn before its lineage is canonical (P7 §7(a), SUB-016).",
|
|
165
|
+
NoAction: "The Submission is settled; nothing is owed."
|
|
166
|
+
};
|
|
167
|
+
/** The operator meaning of one recovery decision tag. */
|
|
168
|
+
const recoveryDecisionMeaning = (tag) => RECOVERY_DECISION_MEANINGS[tag];
|
|
169
|
+
/**
|
|
170
|
+
* The disposition the recovery executor reports for a decision when its repair executes without
|
|
171
|
+
* claim contention (pure prediction; `executeRecoveryDecision` in the coordinator remains the
|
|
172
|
+
* execution authority — a lane concurrently claimed by a worker can always defer instead).
|
|
173
|
+
* `AwaitApprovalDecision` depends on the snapshot: an already-suspended lane waits (`deferred`),
|
|
174
|
+
* while a claimable lane with a lost suspend transition is repaired.
|
|
175
|
+
*/
|
|
176
|
+
const predictRecoveryDisposition = (decision, snapshot) => {
|
|
177
|
+
switch (decision._tag) {
|
|
178
|
+
case "NoAction": return "none";
|
|
179
|
+
case "AwaitUnknownResolution":
|
|
180
|
+
case "MarkUnknown": return "unknown";
|
|
181
|
+
case "ResumeFromTurnBoundary":
|
|
182
|
+
case "ResumePendingToolBatch":
|
|
183
|
+
case "ResumeSuspended":
|
|
184
|
+
case "AwaitHostSettlement":
|
|
185
|
+
case "AwaitChildAdmissionResolution":
|
|
186
|
+
case "AwaitChildSettlement":
|
|
187
|
+
case "AwaitParentEstablishment": return "deferred";
|
|
188
|
+
case "AwaitApprovalDecision": return snapshot.submission.state === "suspended" ? "deferred" : "repaired";
|
|
189
|
+
default: return "repaired";
|
|
190
|
+
}
|
|
191
|
+
};
|
|
192
|
+
const formatUtc = (value) => DateTime.formatIso(value);
|
|
193
|
+
/** Pure operator text for one explanation (the CLI's `explain` output body). */
|
|
194
|
+
const renderRecoveryExplanation = (explanation) => {
|
|
195
|
+
const submission = explanation.submission;
|
|
196
|
+
const evidence = explanation.evidence;
|
|
197
|
+
const lines = [
|
|
198
|
+
`Submission ${submission.submissionId} (thread ${submission.threadId})`,
|
|
199
|
+
` state: ${submission.state} queue: ${submission.queueSequence} age: ${submission.ageSeconds}s`,
|
|
200
|
+
` admitted: ${formatUtc(submission.createdAt)}${submission.readyAt === void 0 ? "" : ` ready: ${formatUtc(submission.readyAt)}`}`
|
|
201
|
+
];
|
|
202
|
+
if (submission.parentLinkage !== void 0) lines.push(` attached child of ${submission.parentLinkage.parentSubmissionId} (tool call ${submission.parentLinkage.parentToolCallId})`);
|
|
203
|
+
lines.push(` evidence: input=${evidence.inputRecorded ? "recorded" : "missing"} settlement=${evidence.recordedSettlementOutcome ?? "none"} abort=${evidence.abortRecorded ? "recorded" : "none"} materialized=${evidence.threadMaterialized ? "yes" : "no"}`);
|
|
204
|
+
if (evidence.openToolCalls.length > 0) lines.push(` open ordinary tool calls: ${evidence.openToolCalls.map((call) => `${call.toolName}#${call.toolCallId}`).join(", ")}`);
|
|
205
|
+
if (evidence.openDelegationCalls.length > 0) lines.push(` open delegation calls: ${evidence.openDelegationCalls.map((call) => `${call.toolName}#${call.toolCallId}(requested=${call.requested} started=${call.started} joined=${call.joined})`).join(", ")}`);
|
|
206
|
+
if (evidence.approvalsPending.length > 0) lines.push(` approvals pending: ${evidence.approvalsPending.map((pending) => pending.toolCallId).join(", ")}`);
|
|
207
|
+
for (const unknown of evidence.unknownCalls) lines.push(` unknown outcome: ${unknown.toolName}#${unknown.toolCallId} recorded ${formatUtc(unknown.recordedAt)} ${unknown.resolved ? "(resolution intent recorded)" : "(awaiting resolveUnknown)"}`);
|
|
208
|
+
if (evidence.childAttachments.length > 0) lines.push(` attached children: ${evidence.childAttachments.map((child) => `${child.childSubmissionId}(${child.childState})`).join(", ")}`);
|
|
209
|
+
if (evidence.joins.length > 0) lines.push(` joined members: ${evidence.joins.map((join) => `${join.submissionId}(${join.state})`).join(", ")}`);
|
|
210
|
+
if (evidence.hostSubmissionId !== void 0) lines.push(` joined to host: ${evidence.hostSubmissionId}`);
|
|
211
|
+
if (evidence.suspension !== void 0) lines.push(` suspended (${evidence.suspension.reason._tag}) since ${formatUtc(evidence.suspension.suspendedAt)}`);
|
|
212
|
+
if (evidence.abortIntent !== void 0) lines.push(` abort intent by ${evidence.abortIntent.author} at ${formatUtc(evidence.abortIntent.requestedAt)}`);
|
|
213
|
+
lines.push(` decision: ${explanation.decision._tag} → disposition ${explanation.disposition}`, ` meaning: ${explanation.decisionMeaning}`);
|
|
214
|
+
return lines.join("\n");
|
|
215
|
+
};
|
|
216
|
+
/** The named integrity checks `verifyThreadInvariants` performs. */
|
|
217
|
+
const IntegrityCheckName = Schema.Literals([
|
|
218
|
+
"schema-round-trip",
|
|
219
|
+
"record-identity",
|
|
220
|
+
"sequence-contiguity",
|
|
221
|
+
"continuation-evidence",
|
|
222
|
+
"fifo-input-order",
|
|
223
|
+
"input-before-settlement",
|
|
224
|
+
"terminal-uniqueness",
|
|
225
|
+
"ledger-canonical-agreement",
|
|
226
|
+
"all-settled"
|
|
227
|
+
]);
|
|
228
|
+
const IntegrityCheckStatus = Schema.Literals([
|
|
229
|
+
"passed",
|
|
230
|
+
"failed",
|
|
231
|
+
"skipped"
|
|
232
|
+
]);
|
|
233
|
+
/** One typed check result; `detail` explains a failure or the honest reason for a skip. */
|
|
234
|
+
var IntegrityCheck = class extends Schema.Class("@effect-agent/thread/IntegrityCheck")({
|
|
235
|
+
name: IntegrityCheckName,
|
|
236
|
+
status: IntegrityCheckStatus,
|
|
237
|
+
detail: Schema.optionalKey(BoundedDetail)
|
|
238
|
+
}) {};
|
|
239
|
+
/**
|
|
240
|
+
* The read-only integrity verdict for one Thread (plan §3 `verify`): typed per-check
|
|
241
|
+
* results, never a repair. `ok` is true exactly when no check failed — skipped checks are
|
|
242
|
+
* honest scope statements, not silent passes.
|
|
243
|
+
*/
|
|
244
|
+
var IntegrityReport = class extends Schema.Class("@effect-agent/thread/IntegrityReport")({
|
|
245
|
+
threadId: ThreadId,
|
|
246
|
+
tailSequence: CanonicalSequence,
|
|
247
|
+
recordCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
248
|
+
submissionCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
249
|
+
checks: Schema.Array(IntegrityCheck),
|
|
250
|
+
ok: Schema.Boolean
|
|
251
|
+
}) {};
|
|
252
|
+
/**
|
|
253
|
+
* What one nonterminal Submission is visibly blocked on (DUR-017 operator surface; OPS-001).
|
|
254
|
+
* `ready-aged`/`running-aged` are not blocks — they are accepted work whose settlement age is
|
|
255
|
+
* measurable and alertable.
|
|
256
|
+
*/
|
|
257
|
+
const ObligationBlockedOn = Schema.Literals([
|
|
258
|
+
"unknown",
|
|
259
|
+
"approval",
|
|
260
|
+
"waitingForChild",
|
|
261
|
+
"ready-aged",
|
|
262
|
+
"running-aged"
|
|
263
|
+
]);
|
|
264
|
+
const ObligationSeverity = Schema.Literals([
|
|
265
|
+
"ok",
|
|
266
|
+
"aging",
|
|
267
|
+
"overdue"
|
|
268
|
+
]);
|
|
269
|
+
/** Host-supplied age thresholds; the framework deliberately does not own the alert loop. */
|
|
270
|
+
var ObligationThresholds = class extends Schema.Class("@effect-agent/thread/ObligationThresholds")({
|
|
271
|
+
/** Age (whole seconds) at which an obligation is reported `aging`. */
|
|
272
|
+
agingSeconds: AgeSeconds,
|
|
273
|
+
/** Age (whole seconds) at which an obligation is reported `overdue`. */
|
|
274
|
+
overdueSeconds: AgeSeconds
|
|
275
|
+
}) {};
|
|
276
|
+
/** One nonterminal accepted-work obligation with its age and severity. */
|
|
277
|
+
var ObligationEntry = class extends Schema.Class("@effect-agent/thread/ObligationEntry")({
|
|
278
|
+
submissionId: SubmissionId,
|
|
279
|
+
threadId: ThreadId,
|
|
280
|
+
state: SubmissionState,
|
|
281
|
+
blockedOn: ObligationBlockedOn,
|
|
282
|
+
ageSeconds: AgeSeconds,
|
|
283
|
+
severity: ObligationSeverity
|
|
284
|
+
}) {};
|
|
285
|
+
/**
|
|
286
|
+
* The scan-based DUR-017/OPS-001 operator surface (plan §3): a fold of the ledger's nonterminal
|
|
287
|
+
* scan into aged, severity-classified rows. Scan-based, never a daemon — hosts run it
|
|
288
|
+
* periodically and export logs/metrics; ages need no storage-version bump because every source
|
|
289
|
+
* timestamp already exists (`createdAt`/`readyAt`, `suspendedAt`, the canonical
|
|
290
|
+
* `ToolCallUnknown` record's `createdAt`).
|
|
291
|
+
*/
|
|
292
|
+
var ObligationReport = class extends Schema.Class("@effect-agent/thread/ObligationReport")({
|
|
293
|
+
thresholds: ObligationThresholds,
|
|
294
|
+
entries: Schema.Array(ObligationEntry),
|
|
295
|
+
generatedAt: Schema.DateTimeUtcFromString
|
|
296
|
+
}) {};
|
|
297
|
+
/** Severity of one obligation age under the supplied thresholds. */
|
|
298
|
+
const obligationSeverityOf = (ageSeconds, thresholds) => ageSeconds >= thresholds.overdueSeconds ? "overdue" : ageSeconds >= thresholds.agingSeconds ? "aging" : "ok";
|
|
299
|
+
/**
|
|
300
|
+
* The mandatory-audit retry command (SEC-011): `author`/`reason` carry the same bounds as the
|
|
301
|
+
* canonical abort command so every mutating administrative operation stays attributable. The
|
|
302
|
+
* operator and decision are logged. A repair with a claim also appends a best-effort
|
|
303
|
+
* `RepairAnnotated` attempt using that claim's epoch; state-only repairs do not append audits.
|
|
304
|
+
*/
|
|
305
|
+
var RetryCommand = class extends Schema.Class("@effect-agent/thread/RetryCommand")({
|
|
306
|
+
submissionId: SubmissionId,
|
|
307
|
+
author: AbortCommand.fields.author,
|
|
308
|
+
reason: AbortCommand.fields.reason
|
|
309
|
+
}) {};
|
|
310
|
+
/** Why a retry was refused without executing anything. */
|
|
311
|
+
const RetryRefusalReason = Schema.Literals([
|
|
312
|
+
"settled",
|
|
313
|
+
"await-unknown-resolution",
|
|
314
|
+
"await-approval-decision"
|
|
315
|
+
]);
|
|
316
|
+
/**
|
|
317
|
+
* Typed refusal of `retry` (plan §3): Submissions waiting on `AwaitUnknownResolution` or
|
|
318
|
+
* `AwaitApprovalDecision` have their own authorized operations, and settled work is never
|
|
319
|
+
* re-driven. The refusal names the classifier decision so the operator sees WHY.
|
|
320
|
+
*/
|
|
321
|
+
var RetryRefused = class extends Schema.TaggedError()("RetryRefused", {
|
|
322
|
+
submissionId: SubmissionId,
|
|
323
|
+
refusal: RetryRefusalReason,
|
|
324
|
+
decisionTag: Schema.String.check(Schema.isMaxLength(256)),
|
|
325
|
+
message: Schema.String.check(Schema.isMaxLength(4096))
|
|
326
|
+
}) {};
|
|
327
|
+
export { renderRecoveryExplanation as C, recoveryDecisionMeaning as S, RetryCommand as _, IntegrityCheck as a, obligationSeverityOf as b, IntegrityReport as c, ObligationReport as d, ObligationSeverity as f, RecoveryExplanation as g, RecoveryDisposition as h, ExplainedUnknownCall as i, ObligationBlockedOn as l, RECOVERY_DECISION_MEANINGS as m, ExplainedEvidence as n, IntegrityCheckName as o, ObligationThresholds as p, ExplainedSubmission as r, IntegrityCheckStatus as s, Admin_exports as t, ObligationEntry as u, RetryRefusalReason as v, predictRecoveryDisposition as x, RetryRefused as y };
|
|
328
|
+
|
|
329
|
+
//# sourceMappingURL=Admin-BcQDrWKY.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Admin-BcQDrWKY.mjs","names":[],"sources":["../src/durable/Admin.ts"],"sourcesContent":["import * as DateTime from 'effect/DateTime'\nimport * as Effect from 'effect/Effect'\nimport * as Schema from 'effect/Schema'\n\nimport { SubmissionId, ThreadId, ToolCallId } from '../core/Identifiers'\nimport { CanonicalSequence, DeclaredToolCall, SettlementOutcome, ToolCallUnknown } from './Records'\nimport { OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, RecoveryDecision } from './Recovery'\nimport {\n AbortCommand,\n AbortIntent,\n ApprovalDecisionIntent,\n ChildAttachmentSnapshot,\n JoinSnapshot,\n ParentLinkage,\n QueueSequence,\n type RecoverySnapshot,\n SubmissionState,\n SuspensionSnapshot,\n UnknownResolutionIntent,\n} from './SubmissionLedger'\n\n/**\n * Pure report logic for the P7 administrative operations (plan §3): the Schema classes carried\n * by `DurableAgentRuntime.explain`/`verify`/`scanObligations`, the operator meaning table for\n * every recovery decision tag, and the text renderer. Everything here is pure — no port access,\n * no clocks, no writes — so hosts, CLIs, and wire envelopes share one report vocabulary.\n */\n\nconst BoundedDetail = Schema.String.check(Schema.isMaxLength(4_096))\n\n/** Non-negative whole seconds derived from the Effect Clock. */\nconst AgeSeconds = Schema.Int.check(Schema.isGreaterThanOrEqualTo(0))\n\n// ---------------------------------------------------------------------------\n// explain — RecoveryExplanation\n// ---------------------------------------------------------------------------\n\n/**\n * The disposition family of `RecoveryReport`, reused verbatim so an explanation predicts exactly\n * what `runRecovery`/`retry` would report for the same decision.\n */\nexport const RecoveryDisposition = Schema.Literals(['repaired', 'deferred', 'none', 'unknown'])\nexport type RecoveryDisposition = typeof RecoveryDisposition.Type\n\n/** Submission identity, lane position, and Clock-derived ages (DUR-017 obligation visibility). */\nexport class ExplainedSubmission extends Schema.Class<ExplainedSubmission>(\n '@effect-agent/thread/ExplainedSubmission',\n)({\n submissionId: SubmissionId,\n threadId: ThreadId,\n state: SubmissionState,\n queueSequence: QueueSequence,\n createdAt: Schema.DateTimeUtcFromString,\n readyAt: Schema.optionalKey(Schema.DateTimeUtcFromString),\n /** Whole seconds since admission (`createdAt`). */\n ageSeconds: AgeSeconds,\n /** Whole seconds since readiness, present exactly when `readyAt` is recorded. */\n readyAgeSeconds: Schema.optionalKey(AgeSeconds),\n parentLinkage: Schema.optionalKey(ParentLinkage),\n}) {}\n\n/** One durable Unknown Outcome and whether its result is canonical (DUR-017). */\nexport class ExplainedUnknownCall extends Schema.Class<ExplainedUnknownCall>(\n '@effect-agent/thread/ExplainedUnknownCall',\n)({\n toolCallId: ToolCallId,\n toolName: ToolCallUnknown.fields.toolName,\n reason: ToolCallUnknown.fields.reason,\n recordedAt: Schema.DateTimeUtcFromString,\n /** A real canonical ToolCallSettled closes this call; an intent alone is not an outcome. */\n resolved: Schema.Boolean,\n}) {}\n\n/**\n * The evidence summary of one explanation: the classifier's canonical-history inputs plus the\n * durable intents and subagent attachments the ledger snapshot carries. Everything is read-only\n * observation — assembling this value performs zero writes.\n */\nexport class ExplainedEvidence extends Schema.Class<ExplainedEvidence>(\n '@effect-agent/thread/ExplainedEvidence',\n)({\n threadMaterialized: Schema.Boolean,\n inputRecorded: Schema.Boolean,\n abortRecorded: Schema.Boolean,\n recordedSettlementOutcome: Schema.optionalKey(SettlementOutcome),\n /** Declared ordinary Tool Calls without a canonical outcome (DUR-009). */\n openToolCalls: Schema.Array(OpenToolCallEvidence),\n /** Original declared operation identities, arguments and recovery contracts; settled calls are excluded. */\n pendingOperations: Schema.Array(DeclaredToolCall).pipe(\n Schema.withConstructorDefault(Effect.succeed([])),\n ),\n /** Delegation Tool Calls with an open parent-side obligation. */\n openDelegationCalls: Schema.Array(OpenDelegationCallEvidence),\n /** Canonically requested approvals without a canonical decision. */\n approvalsPending: Schema.Array(PendingApprovalEvidence),\n /** Durable Unknown Outcomes with their resolution coverage (DUR-017). */\n unknownCalls: Schema.Array(ExplainedUnknownCall),\n /** Durable approval decisions recorded against this Submission. */\n approvalDecisions: Schema.Array(ApprovalDecisionIntent),\n /** Durable unknown-outcome resolutions recorded against this Submission. */\n unknownResolutions: Schema.Array(UnknownResolutionIntent),\n /** Parent-side child attachments. */\n childAttachments: Schema.Array(ChildAttachmentSnapshot),\n /** Host-side joined/joining members of this Submission's Run (DUR-016). */\n joins: Schema.Array(JoinSnapshot),\n /** Joined-side host identity, when this Submission is joined to a host Run. */\n hostSubmissionId: Schema.optionalKey(SubmissionId),\n suspension: Schema.optionalKey(SuspensionSnapshot),\n abortIntent: Schema.optionalKey(AbortIntent),\n}) {}\n\n/**\n * The read-only recovery explanation of one Submission (P7 exit gate \"operators can explain\n * recovery state without editing storage\"): the submission summary, the evidence the pure\n * classifier consumed, the exact `RecoveryDecision` it selected, that decision's operator\n * meaning, and the disposition the recovery pass would report for it.\n */\nexport class RecoveryExplanation extends Schema.Class<RecoveryExplanation>(\n '@effect-agent/thread/RecoveryExplanation',\n)({\n submission: ExplainedSubmission,\n evidence: ExplainedEvidence,\n decision: RecoveryDecision,\n /** Static operator meaning of `decision._tag` (see `RECOVERY_DECISION_MEANINGS`). */\n decisionMeaning: BoundedDetail,\n /**\n * The disposition `runRecovery` would report when this decision executes without claim\n * contention (see `predictRecoveryDisposition`): `repaired` = the recovery pass itself fixes\n * it; `deferred` = a claiming worker must finish it; `unknown` = durably blocked on the\n * authorized DUR-017 resolution path; `none` = settled, nothing owed.\n */\n disposition: RecoveryDisposition,\n explainedAt: Schema.DateTimeUtcFromString,\n}) {}\n\n/**\n * Operator meaning of every recovery decision tag, matching the classifier docstrings in\n * `recovery.ts` (the classifier remains the semantic authority; this table is its operator\n * rendering). Exhaustive over `RecoveryDecision` — adding a decision without a meaning is a\n * compile error here.\n */\nexport const RECOVERY_DECISION_MEANINGS: Readonly<Record<RecoveryDecision['_tag'], string>> = {\n CompleteMaterialization:\n 'Ledger admission committed but the Thread is not durable: recovery finishes materialization, appends ThreadCreated, and marks readiness.',\n RepairReadiness:\n 'The Thread is durable but the readiness marker is missing: recovery replays the idempotent markReady.',\n ApplyInput:\n 'No canonical input record exists yet: recovery appends the deterministic UserInputRecorded record and marks it applied.',\n RepairInputMarker:\n 'The canonical input record exists but the ledger marker was lost: recovery repairs the marker from history, never the reverse (DUR-015).',\n ResumeFromTurnBoundary:\n 'Input is applied and no terminal outcome is canonical: a claiming worker resumes the Run from the last committed Turn boundary; the model may be re-invoked and any duplicate cost is observable (durability §9).',\n FinalizeLedgerFromHistory:\n 'The canonical settlement record exists: recovery rebuilds/finalizes the ledger from history and never rewrites history from the cached ledger status (DUR-011, DUR-015).',\n SettleAborted:\n 'A durable abort intent exists with no canonical terminal outcome and no open attached-child obligation: recovery settles aborted, first recording ToolCallUnknown audits for open ordinary calls — abort never asserts external rollback (durability §13).',\n MarkUnknown:\n 'Declared ordinary Tool Calls have no canonical outcome: recovery reconciles each open call and marks the remainder Unknown — never an automatic replay (DUR-009/DUR-017).',\n ResumePendingToolBatch:\n 'A committed tool-declaring response has unfinished calls whose original operation contracts permit replay: a claiming worker resumes those calls without model re-invocation; unresolved ordinary mutating calls require reconciliation.',\n AwaitApprovalDecision:\n 'Canonically requested approvals lack decisions: the lane waits durably for the authorized resolveApproval path (recovery repairs a lost suspend transition from history).',\n ResumeSuspended:\n 'Every pending approval has a durable decision: a claiming worker resumes the declared batch, appending the canonical ToolApprovalDecided records first.',\n AwaitUnknownResolution:\n 'Unknown Outcomes lack covering resolutions: this Submission stays parked awaiting the authorized DUR-017 resolveUnknown path; later eligible input may run, and the original obligation stays visible.',\n ApplyUnknownResolutions:\n 'Durable resolution intents cover every open call: recovery wakes the original Submission when required retry contracts are supported; its next claim applies canonical outcomes.',\n RevertJoining:\n 'The Submission is joining without a canonical input record: recovery reverts it to ready — the input was never consumed and will be delivered exactly once later (DUR-016).',\n RepairJoinMarker:\n 'The canonical joined input exists but the joined marker was lost: recovery repairs the marker only; the input reattaches, never duplicates (DUR-015/DUR-016).',\n SettleJoinedWithHost:\n 'The host Run settled canonically: recovery settles this joined Submission with the host outcome — each joined Submission is owed its own settlement (DUR-002).',\n AwaitHostSettlement:\n \"The Submission is joined and its host Run is still live: nothing to repair — the input reattaches through the host's resume and the Submission settles with the host.\",\n CompleteChildAdmission:\n 'A canonical SubagentRequested exists and the authoritative lookup proved not-admitted: recovery idempotently admits the intended child from the canonical request payload alone.',\n AwaitChildAdmissionResolution:\n 'The authoritative child-admission lookup answered indeterminate (or was not performed): recovery waits and retries the authoritative owner; a second admission never occurs (SUB-031).',\n RepairSubagentStartLink:\n \"The child is admitted but the parent's SubagentStarted link (or reservation attachment) is missing: recovery resolves the SAME child by its deterministic key and appends the exact link (SUB-016/SUB-017).\",\n EnsureWaitingForChild:\n 'Children are established and at least one is nonterminal while the parent lane is not durably suspended: recovery restores the waitingForChild suspension; it reattaches the one existing child and never spawns a replacement (SUB-018/SUB-030).',\n AwaitChildSettlement:\n \"The parent is durably suspended waitingForChild and a listed child is not yet provably settled: the lane stays dormant, consumes no worker permit, and the child's Settlement wakes it durably (SUB-021/SUB-030).\",\n ResumeWaitingParent:\n \"Every relevant child is provably settled but the parent has not joined: recovery replays the idempotent wake so a claiming worker resumes the declared batch and joins each child's canonical Settlement.\",\n ApplyJoinAccounting:\n 'The canonical SubagentJoined record exists but the reservation release is incomplete: recovery replays the accounting decision FROM the canonical record — budget stays unavailable until repair, never available twice (DUR-015).',\n PropagateChildAbort:\n \"Parent abort is canonical while attached children are nonterminal: recovery idempotently issues each child's durable abort command and keeps the parent waiting for the joins — request-abort-and-join is the only close behavior.\",\n ReleaseOrphanChildReservation:\n 'A child budget reservation can no longer bind a child: recovery freezes the deterministic zero-consumed accounting decision and releases the unused allocation exactly once.',\n AwaitParentEstablishment:\n \"The Submission is a parent-linked child whose Thread lacks the canonical lineage record: the child lane defers its own readiness repair — the parent's idempotent establishment completes it, so a child never runs a Turn before its lineage is canonical (P7 §7(a), SUB-016).\",\n NoAction: 'The Submission is settled; nothing is owed.',\n}\n\n/** The operator meaning of one recovery decision tag. */\nexport const recoveryDecisionMeaning = (tag: RecoveryDecision['_tag']): string => RECOVERY_DECISION_MEANINGS[tag]\n\n/**\n * The disposition the recovery executor reports for a decision when its repair executes without\n * claim contention (pure prediction; `executeRecoveryDecision` in the coordinator remains the\n * execution authority — a lane concurrently claimed by a worker can always defer instead).\n * `AwaitApprovalDecision` depends on the snapshot: an already-suspended lane waits (`deferred`),\n * while a claimable lane with a lost suspend transition is repaired.\n */\nexport const predictRecoveryDisposition = (\n decision: RecoveryDecision,\n snapshot: RecoverySnapshot,\n): RecoveryDisposition => {\n switch (decision._tag) {\n case 'NoAction':\n return 'none'\n case 'AwaitUnknownResolution':\n case 'MarkUnknown':\n return 'unknown'\n case 'ResumeFromTurnBoundary':\n case 'ResumePendingToolBatch':\n case 'ResumeSuspended':\n case 'AwaitHostSettlement':\n case 'AwaitChildAdmissionResolution':\n case 'AwaitChildSettlement':\n case 'AwaitParentEstablishment':\n return 'deferred'\n case 'AwaitApprovalDecision':\n return snapshot.submission.state === 'suspended' ? 'deferred' : 'repaired'\n default:\n return 'repaired'\n }\n}\n\nconst formatUtc = (value: DateTime.Utc): string => DateTime.formatIso(value)\n\n/** Pure operator text for one explanation (the CLI's `explain` output body). */\nexport const renderRecoveryExplanation = (explanation: RecoveryExplanation): string => {\n const submission = explanation.submission\n const evidence = explanation.evidence\n\n const lines: Array<string> = [\n `Submission ${submission.submissionId} (thread ${submission.threadId})`,\n ` state: ${submission.state} queue: ${submission.queueSequence} age: ${submission.ageSeconds}s`,\n ` admitted: ${formatUtc(submission.createdAt)}${\n submission.readyAt === undefined ? '' : ` ready: ${formatUtc(submission.readyAt)}`\n }`,\n ]\n\n if (submission.parentLinkage !== undefined) {\n lines.push(\n ` attached child of ${submission.parentLinkage.parentSubmissionId} (tool call ${submission.parentLinkage.parentToolCallId})`,\n )\n }\n lines.push(\n ` evidence: input=${evidence.inputRecorded ? 'recorded' : 'missing'}` +\n ` settlement=${evidence.recordedSettlementOutcome ?? 'none'}` +\n ` abort=${evidence.abortRecorded ? 'recorded' : 'none'}` +\n ` materialized=${evidence.threadMaterialized ? 'yes' : 'no'}`,\n )\n if (evidence.openToolCalls.length > 0) {\n lines.push(\n ` open ordinary tool calls: ${\n evidence.openToolCalls\n .map((call) => `${call.toolName}#${call.toolCallId}`)\n .join(', ')\n }`,\n )\n }\n if (evidence.openDelegationCalls.length > 0) {\n lines.push(\n ` open delegation calls: ${\n evidence.openDelegationCalls\n .map(\n (call) =>\n `${call.toolName}#${call.toolCallId}(requested=${call.requested} started=${call.started} joined=${call.joined})`,\n )\n .join(', ')\n }`,\n )\n }\n if (evidence.approvalsPending.length > 0) {\n lines.push(\n ` approvals pending: ${\n evidence.approvalsPending\n .map((pending) => pending.toolCallId)\n .join(', ')\n }`,\n )\n }\n for (const unknown of evidence.unknownCalls) {\n lines.push(\n ` unknown outcome: ${unknown.toolName}#${unknown.toolCallId} recorded ${formatUtc(unknown.recordedAt)} ${\n unknown.resolved ? '(resolution intent recorded)' : '(awaiting resolveUnknown)'\n }`,\n )\n }\n if (evidence.childAttachments.length > 0) {\n lines.push(\n ` attached children: ${\n evidence.childAttachments\n .map((child) => `${child.childSubmissionId}(${child.childState})`)\n .join(', ')\n }`,\n )\n }\n if (evidence.joins.length > 0) {\n lines.push(\n ` joined members: ${\n evidence.joins\n .map((join) => `${join.submissionId}(${join.state})`)\n .join(', ')\n }`,\n )\n }\n if (evidence.hostSubmissionId !== undefined) {\n lines.push(` joined to host: ${evidence.hostSubmissionId}`)\n }\n if (evidence.suspension !== undefined) {\n lines.push(\n ` suspended (${evidence.suspension.reason._tag}) since ${formatUtc(evidence.suspension.suspendedAt)}`,\n )\n }\n if (evidence.abortIntent !== undefined) {\n lines.push(\n ` abort intent by ${evidence.abortIntent.author} at ${formatUtc(evidence.abortIntent.requestedAt)}`,\n )\n }\n lines.push(\n ` decision: ${explanation.decision._tag} → disposition ${explanation.disposition}`,\n ` meaning: ${explanation.decisionMeaning}`,\n )\n\n return lines.join('\\n')\n}\n\n// ---------------------------------------------------------------------------\n// verify — IntegrityReport\n// ---------------------------------------------------------------------------\n\n/** The named integrity checks `verifyThreadInvariants` performs. */\nexport const IntegrityCheckName = Schema.Literals([\n /** Every exported envelope round-trips its canonical Schema. */\n 'schema-round-trip',\n /** No canonical record identity appears twice (DUR-007). */\n 'record-identity',\n /** Canonical sequences are gap-free from 1 through the exported tail. */\n 'sequence-contiguity',\n /** Every retained Run fact is addressable independently of the disposable Run directory.\n * Current execution references and original context must agree with retained history;\n * discarded checkpoint revisions and their historical counters are not reconstructed. */\n 'continuation-evidence',\n /** Canonical `input:{sid}` records follow the admitted FIFO order (DUR-004). */\n 'fifo-input-order',\n /** Canonical settlement records follow the admitted FIFO order (DUR-004); aborted\n * settlements of never-run work are exempt by design (P7 §7(c)). */\n 'input-before-settlement',\n /** At most one canonical terminal record per Submission; exactly one per settled row (DUR-002). */\n 'terminal-uniqueness',\n /** Ledger terminal state agrees with the canonical settlement record (DUR-015). */\n 'ledger-canonical-agreement',\n /** Convergence mode only: every known Submission is settled. */\n 'all-settled',\n])\n\nexport type IntegrityCheckName = typeof IntegrityCheckName.Type\n\nexport const IntegrityCheckStatus = Schema.Literals(['passed', 'failed', 'skipped'])\nexport type IntegrityCheckStatus = typeof IntegrityCheckStatus.Type\n\n/** One typed check result; `detail` explains a failure or the honest reason for a skip. */\nexport class IntegrityCheck extends Schema.Class<IntegrityCheck>(\n '@effect-agent/thread/IntegrityCheck',\n)({\n name: IntegrityCheckName,\n status: IntegrityCheckStatus,\n detail: Schema.optionalKey(BoundedDetail),\n}) {}\n\n/**\n * The read-only integrity verdict for one Thread (plan §3 `verify`): typed per-check\n * results, never a repair. `ok` is true exactly when no check failed — skipped checks are\n * honest scope statements, not silent passes.\n */\nexport class IntegrityReport extends Schema.Class<IntegrityReport>(\n '@effect-agent/thread/IntegrityReport',\n)({\n threadId: ThreadId,\n tailSequence: CanonicalSequence,\n recordCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n submissionCount: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),\n checks: Schema.Array(IntegrityCheck),\n ok: Schema.Boolean,\n}) {}\n\n// ---------------------------------------------------------------------------\n// scanObligations — ObligationReport\n// ---------------------------------------------------------------------------\n\n/**\n * What one nonterminal Submission is visibly blocked on (DUR-017 operator surface; OPS-001).\n * `ready-aged`/`running-aged` are not blocks — they are accepted work whose settlement age is\n * measurable and alertable.\n */\nexport const ObligationBlockedOn = Schema.Literals([\n 'unknown',\n 'approval',\n 'waitingForChild',\n 'ready-aged',\n 'running-aged',\n])\n\nexport type ObligationBlockedOn = typeof ObligationBlockedOn.Type\n\nexport const ObligationSeverity = Schema.Literals(['ok', 'aging', 'overdue'])\nexport type ObligationSeverity = typeof ObligationSeverity.Type\n\n/** Host-supplied age thresholds; the framework deliberately does not own the alert loop. */\nexport class ObligationThresholds extends Schema.Class<ObligationThresholds>(\n '@effect-agent/thread/ObligationThresholds',\n)({\n /** Age (whole seconds) at which an obligation is reported `aging`. */\n agingSeconds: AgeSeconds,\n /** Age (whole seconds) at which an obligation is reported `overdue`. */\n overdueSeconds: AgeSeconds,\n}) {}\n\n/** One nonterminal accepted-work obligation with its age and severity. */\nexport class ObligationEntry extends Schema.Class<ObligationEntry>(\n '@effect-agent/thread/ObligationEntry',\n)({\n submissionId: SubmissionId,\n threadId: ThreadId,\n state: SubmissionState,\n blockedOn: ObligationBlockedOn,\n ageSeconds: AgeSeconds,\n severity: ObligationSeverity,\n}) {}\n\n/**\n * The scan-based DUR-017/OPS-001 operator surface (plan §3): a fold of the ledger's nonterminal\n * scan into aged, severity-classified rows. Scan-based, never a daemon — hosts run it\n * periodically and export logs/metrics; ages need no storage-version bump because every source\n * timestamp already exists (`createdAt`/`readyAt`, `suspendedAt`, the canonical\n * `ToolCallUnknown` record's `createdAt`).\n */\nexport class ObligationReport extends Schema.Class<ObligationReport>(\n '@effect-agent/thread/ObligationReport',\n)({\n thresholds: ObligationThresholds,\n entries: Schema.Array(ObligationEntry),\n generatedAt: Schema.DateTimeUtcFromString,\n}) {}\n\n/** Severity of one obligation age under the supplied thresholds. */\nexport const obligationSeverityOf = (\n ageSeconds: number,\n thresholds: ObligationThresholds,\n): ObligationSeverity =>\n ageSeconds >= thresholds.overdueSeconds\n ? 'overdue'\n : ageSeconds >= thresholds.agingSeconds\n ? 'aging'\n : 'ok'\n\n// ---------------------------------------------------------------------------\n// retry — typed command and refusals\n// ---------------------------------------------------------------------------\n\n/**\n * The mandatory-audit retry command (SEC-011): `author`/`reason` carry the same bounds as the\n * canonical abort command so every mutating administrative operation stays attributable. The\n * operator and decision are logged. A repair with a claim also appends a best-effort\n * `RepairAnnotated` attempt using that claim's epoch; state-only repairs do not append audits.\n */\nexport class RetryCommand extends Schema.Class<RetryCommand>('@effect-agent/thread/RetryCommand')({\n submissionId: SubmissionId,\n author: AbortCommand.fields.author,\n reason: AbortCommand.fields.reason,\n}) {}\n\n/** Why a retry was refused without executing anything. */\nexport const RetryRefusalReason = Schema.Literals([\n /** The Submission is settled; terminal outcomes are never revisited (DUR-002). */\n 'settled',\n /** The Submission is parked on Unknown Outcomes; use `resolveUnknown` (DUR-017). */\n 'await-unknown-resolution',\n /** The lane is durably waiting for approval decisions; use `resolveApproval`. */\n 'await-approval-decision',\n])\n\nexport type RetryRefusalReason = typeof RetryRefusalReason.Type\n\n/**\n * Typed refusal of `retry` (plan §3): Submissions waiting on `AwaitUnknownResolution` or\n * `AwaitApprovalDecision` have their own authorized operations, and settled work is never\n * re-driven. The refusal names the classifier decision so the operator sees WHY.\n */\nexport class RetryRefused extends Schema.TaggedError<RetryRefused>()('RetryRefused', {\n submissionId: SubmissionId,\n refusal: RetryRefusalReason,\n decisionTag: Schema.String.check(Schema.isMaxLength(256)),\n message: Schema.String.check(Schema.isMaxLength(4_096)),\n}) {}\n"],"mappings":"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"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import * as AiError from "effect/ai/AiError";
|
|
2
|
+
import * as LanguageModel from "effect/ai/LanguageModel";
|
|
3
|
+
import * as Model from "effect/ai/Model";
|
|
4
|
+
import * as Prompt from "effect/ai/Prompt";
|
|
5
|
+
import * as Tool from "effect/ai/Tool";
|
|
6
|
+
import * as Toolkit from "effect/ai/Toolkit";
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
9
|
+
import * as Schema from "effect/Schema";
|
|
10
|
+
import { a as AgentInputDecodeError, c as AgentOutputError, d as AgentRunDispositionError, o as AgentInputError } from "./AgentError-RkUaetX8.mjs";
|
|
11
|
+
import { n as AgentPolicyInput, t as AgentPolicy } from "./AgentPolicy-D-GmZQex.mjs";
|
|
12
|
+
import { t as AgentId } from "./Identifiers-qafW4EP0.mjs";
|
|
13
|
+
import { i as UpdateError, n as Emitter } from "./AgentUpdates-7xT0It_R.mjs";
|
|
14
|
+
import { r as Configuration } from "./ToolExposure-DNME8BkG.mjs";
|
|
15
|
+
/** Definition-owned native Tool. Runtime supplies its handler under the same identity. */
|
|
16
|
+
declare const updateTool: <S extends Schema.Top>(schema: S) => Tool.Tool<"emit_update", {
|
|
17
|
+
readonly parameters: Schema.Struct<{
|
|
18
|
+
readonly value: S;
|
|
19
|
+
}>;
|
|
20
|
+
readonly success: Schema.Struct<{
|
|
21
|
+
readonly emitted: Schema.Literal<true>;
|
|
22
|
+
}>;
|
|
23
|
+
readonly failure: typeof UpdateError;
|
|
24
|
+
readonly failureMode: "return";
|
|
25
|
+
}, Emitter, Tool.Execution>;
|
|
26
|
+
type UpdateToolkit<T extends Toolkit.Any, S extends Schema.Top | undefined> = S extends Schema.Top ? Toolkit.Toolkit<T['tools'] & {
|
|
27
|
+
readonly emit_update: ReturnType<typeof updateTool<S>>;
|
|
28
|
+
}> : T;
|
|
29
|
+
declare namespace Agent_d_exports {
|
|
30
|
+
export { Any, AnyDefinition, Binding, CompletionProjectionInput, CompletionToolDeclaration, Definition, DefinitionOptions, DefinitionRequirements, EncodedInput, Failure, Input, InputPromptSource, InputSchema, InstructionResult, InstructionSource, ModelServices, Name, NativeModel, Output, OutputSchema, Requirements, RunDisposition, RunDispositionDeclaration, RunDispositionFailure, RunDispositionSchema, ToolUnion, Tools, Update, UpdatesSchema, make, withModel };
|
|
31
|
+
}
|
|
32
|
+
/** Prompt input produced directly or by an Effect that preserves its failure and requirements. */
|
|
33
|
+
type InstructionResult<E = never, R = never> = Prompt.RawInput | Effect.Effect<Prompt.RawInput, E, R>;
|
|
34
|
+
/** Static prompt input or an input-dependent source evaluated once while preparing a run. */
|
|
35
|
+
type InstructionSource<Input, E = never, R = never> = Prompt.RawInput | ((input: Input) => InstructionResult<E, R>);
|
|
36
|
+
/** Definition-owned projection from decoded Agent input to model-visible prompt content. */
|
|
37
|
+
type InputPromptSource<Input, E = never, R = never> = (input: Input) => InstructionResult<E, R>;
|
|
38
|
+
/** Native services needed to execute and identify model calls. */
|
|
39
|
+
type ModelServices = LanguageModel.LanguageModel | Model.ProviderName | Model.ModelName;
|
|
40
|
+
/** Accepts native model Layers that provide generation and model identity. */
|
|
41
|
+
type NativeModel<ModelValue> = ModelValue extends Layer.Layer<infer Provides, never, infer _Requires> ? ModelServices extends Provides ? ModelValue : never : never;
|
|
42
|
+
/** Definition-owned boundary for selecting and validating an application run disposition. */
|
|
43
|
+
interface RunDispositionDeclaration<Output, DispositionSchema extends Schema.Top> {
|
|
44
|
+
/**
|
|
45
|
+
* Opt background workers into one retained assignment. The encoded disposition must be
|
|
46
|
+
* Worker.AssignmentDisposition: completed seals the worker, waiting leaves it steerable.
|
|
47
|
+
* Failures and exhausted Runs seal as failed; aborting an active Run seals as cancelled.
|
|
48
|
+
* The worker origin retains this choice. Omission preserves reusable workers.
|
|
49
|
+
*/
|
|
50
|
+
readonly workerLifecycle?: 'assignment' | undefined;
|
|
51
|
+
/** Canonical Schema used to validate and encode the selected disposition. */
|
|
52
|
+
readonly schema: DispositionSchema;
|
|
53
|
+
/** Pure selection from decoded output. `undefined` declares none, except for assignments. */
|
|
54
|
+
readonly fromOutput: (output: Output) => unknown;
|
|
55
|
+
}
|
|
56
|
+
/** Values available to a Definition-owned completion Tool projector after canonical decoding. */
|
|
57
|
+
interface CompletionProjectionInput<Parameters = unknown, Result = unknown> {
|
|
58
|
+
readonly parameters: Parameters;
|
|
59
|
+
readonly result: Result;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* The required final Tool whenever configured. Every model Turn must use Tools, and only this
|
|
63
|
+
* Tool's successful result can complete the Agent when it is the sole application call.
|
|
64
|
+
* Provider-executed calls may accompany it only with terminal results, outside grace finalization.
|
|
65
|
+
* Mixed, wholly unexecuted application batches are rejected with failed Tool results so the
|
|
66
|
+
* model can correct them within ordinary Run budgets; completed provider results are retained.
|
|
67
|
+
* Missing provider results and invalid pending resumed batches fail closed. The completion
|
|
68
|
+
* designation never permits side-effect replay.
|
|
69
|
+
*/
|
|
70
|
+
interface CompletionToolDeclaration<Parameters = unknown, Result = unknown, Output = unknown> {
|
|
71
|
+
readonly tool: string;
|
|
72
|
+
/**
|
|
73
|
+
* Pure, deterministic projection: recovery may reevaluate a recorded Tool result before
|
|
74
|
+
* RunCompleted commits. Once committed, that stored output wins across later code changes.
|
|
75
|
+
*/
|
|
76
|
+
readonly project: (input: CompletionProjectionInput<Parameters, Result>) => Output;
|
|
77
|
+
}
|
|
78
|
+
type CompletionToolFor<ToolkitValue extends Toolkit.Any, Output> = { readonly [Name in keyof ToolkitValue['tools'] & string]: CompletionToolDeclaration<Tool.Parameters<ToolkitValue['tools'][Name]>, Tool.Success<ToolkitValue['tools'][Name]>, Output> & {
|
|
79
|
+
readonly tool: Name;
|
|
80
|
+
}; }[keyof ToolkitValue['tools'] & string];
|
|
81
|
+
/** Immutable, model-agnostic schemas, behavior, tools, and bounds for an agent. */
|
|
82
|
+
interface Definition<InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions, ToolkitValue extends Toolkit.Any, RunDispositionValue = undefined, InputPromptValue = undefined, UpdatesSchema extends Schema.Top | undefined = undefined> {
|
|
83
|
+
/** Stable agent identity; changing it creates a distinct definition identity. */
|
|
84
|
+
readonly id: AgentId;
|
|
85
|
+
/** Canonical Schema for intermediate updates emitted by this Agent. */
|
|
86
|
+
readonly updates?: UpdatesSchema;
|
|
87
|
+
/** Canonical schema used to decode and encode run input. */
|
|
88
|
+
readonly input: InputSchema;
|
|
89
|
+
/** Canonical schema used to decode the final model output. */
|
|
90
|
+
readonly output: OutputSchema;
|
|
91
|
+
/**
|
|
92
|
+
* Evaluated once while preparing each Run. OpenAI, xAI and native adapters advertising support
|
|
93
|
+
* preserve chronological system messages, omitting exact repeats only when no distinct system
|
|
94
|
+
* instruction intervenes. The actual selected model determines support on each call. Other
|
|
95
|
+
* adapters group systems first and keep the last exact repeat, including provider options;
|
|
96
|
+
* Anthropic requires an upstream adapter with mid-conversation system-message support.
|
|
97
|
+
* Stored history is unchanged.
|
|
98
|
+
*/
|
|
99
|
+
readonly instructions: Instructions;
|
|
100
|
+
/**
|
|
101
|
+
* Optional projection from decoded input to model-visible native Effect AI prompt content.
|
|
102
|
+
* This controls disclosure only: durable admission retains the complete input and Tool
|
|
103
|
+
* authorization receives it. A projection failure never falls back to sending full input.
|
|
104
|
+
*/
|
|
105
|
+
readonly inputPrompt?: InputPromptValue | undefined;
|
|
106
|
+
/** Native Effect AI toolkit whose failures and requirements remain visible. */
|
|
107
|
+
readonly toolkit: ToolkitValue;
|
|
108
|
+
readonly toolExposure?: Configuration | undefined;
|
|
109
|
+
/** Finite execution bounds enforced by the runtime. */
|
|
110
|
+
readonly policy: AgentPolicy;
|
|
111
|
+
/** Explicit policy fields, retained so delegated runs can inherit omitted fields. */
|
|
112
|
+
readonly policyOverrides?: Partial<AgentPolicyInput> | undefined;
|
|
113
|
+
/** When configured, this Tool must succeed to produce final output; ordinary text cannot settle. */
|
|
114
|
+
readonly completion?: CompletionToolDeclaration | undefined;
|
|
115
|
+
readonly runDisposition?: RunDispositionValue | undefined;
|
|
116
|
+
readonly description?: string | undefined;
|
|
117
|
+
}
|
|
118
|
+
/** Options for a model-agnostic agent definition. */
|
|
119
|
+
interface DefinitionOptions<InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>, ToolkitValue extends Toolkit.Any, RunDispositionValue extends RunDispositionDeclaration<OutputSchema['Type'], Schema.Top> | undefined = undefined, InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined> {
|
|
120
|
+
readonly updates?: UpdatesSchema;
|
|
121
|
+
readonly input: InputSchema;
|
|
122
|
+
readonly output: OutputSchema;
|
|
123
|
+
readonly instructions: Instructions;
|
|
124
|
+
readonly inputPrompt?: InputPromptValue | undefined;
|
|
125
|
+
readonly toolkit: ToolkitValue;
|
|
126
|
+
readonly toolExposure?: Configuration | undefined;
|
|
127
|
+
readonly policy?: Partial<AgentPolicyInput> | undefined;
|
|
128
|
+
readonly completion?: CompletionToolFor<ToolkitValue, OutputSchema['Type']> | undefined;
|
|
129
|
+
readonly runDisposition?: RunDispositionValue | undefined;
|
|
130
|
+
readonly description?: string | undefined;
|
|
131
|
+
}
|
|
132
|
+
type AnyDefinitionShape = Definition<Schema.Top, Schema.Top, unknown, Toolkit.Any, RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined>;
|
|
133
|
+
/** Immutable pairing of an agent definition with a native model Layer. */
|
|
134
|
+
interface Binding<DefinitionValue extends AnyDefinitionShape, ModelValue> {
|
|
135
|
+
readonly definition: DefinitionValue;
|
|
136
|
+
readonly model: NativeModel<ModelValue>;
|
|
137
|
+
}
|
|
138
|
+
type InstructionEffect<Instructions, Input> = Instructions extends ((input: Input) => infer Result) ? Result : Instructions;
|
|
139
|
+
type InputPromptEffect<InputPrompt, Input> = InputPrompt extends ((input: Input) => infer Result) ? Result : never;
|
|
140
|
+
type EffectError<Value> = Value extends Effect.Effect<infer _Success, infer Error, infer _Services> ? Error : never;
|
|
141
|
+
type EffectServices<Value> = Value extends Effect.Effect<infer _Success, infer _Error, infer Services> ? Services : never;
|
|
142
|
+
type ModelRequirements<Value> = Value extends Layer.Layer<infer _Provides, infer _Error, infer Services> ? Services : never;
|
|
143
|
+
/** Constructors and type projections for definitions and runnable model bindings. */
|
|
144
|
+
/** Type-erased definition used at generic framework boundaries. */
|
|
145
|
+
type AnyDefinition = AnyDefinitionShape;
|
|
146
|
+
/** Read-only interpreter program or binding used at inspection and projection boundaries. */
|
|
147
|
+
interface Any {
|
|
148
|
+
readonly definition: AnyDefinition;
|
|
149
|
+
readonly model?: unknown;
|
|
150
|
+
}
|
|
151
|
+
type DefinitionOf<AgentValue extends AnyDefinition | Any> = AgentValue extends {
|
|
152
|
+
readonly definition: infer DefinitionValue extends AnyDefinition;
|
|
153
|
+
} ? DefinitionValue : AgentValue;
|
|
154
|
+
type RunDispositionSchemaOf<DefinitionValue extends AnyDefinition> = [Exclude<DefinitionValue['runDisposition'], undefined>] extends [never] ? never : Exclude<DefinitionValue['runDisposition'], undefined> extends RunDispositionDeclaration<never, infer DispositionSchema> ? DispositionSchema : never;
|
|
155
|
+
/** Literal Agent ID, retained by Agent.make. */
|
|
156
|
+
type Name<A extends AnyDefinition | Any> = DefinitionOf<A>['id'] extends AgentId & (infer N extends string) ? N : string;
|
|
157
|
+
/** Declared update Schema, or never for Agents without updates. */
|
|
158
|
+
type UpdatesSchema<A extends AnyDefinition | Any> = Exclude<DefinitionOf<A>['updates'], undefined>;
|
|
159
|
+
/** Decoded intermediate update value. */
|
|
160
|
+
type Update<A extends AnyDefinition | Any> = UpdatesSchema<A>['Type'];
|
|
161
|
+
/** Decoded input type of a definition or binding. */
|
|
162
|
+
type Input<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input']['Type'];
|
|
163
|
+
/** Encoded input accepted by the primary execution operations. */
|
|
164
|
+
type EncodedInput<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input']['Encoded'];
|
|
165
|
+
/** Decoded output type of a definition or binding. */
|
|
166
|
+
type Output<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['output']['Type'];
|
|
167
|
+
/** Input Schema carried by a definition or binding. */
|
|
168
|
+
type InputSchema<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input'];
|
|
169
|
+
/** Output Schema carried by a definition or binding. */
|
|
170
|
+
type OutputSchema<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['output'];
|
|
171
|
+
/** Application run-disposition Schema carried by a definition or binding, or `never`. */
|
|
172
|
+
type RunDispositionSchema<AgentValue extends AnyDefinition | Any> = RunDispositionSchemaOf<DefinitionOf<AgentValue>>;
|
|
173
|
+
/** Decoded application run disposition declared by a definition or binding. */
|
|
174
|
+
type RunDisposition<AgentValue extends AnyDefinition | Any> = [RunDispositionSchema<AgentValue>] extends [never] ? never : RunDispositionSchema<AgentValue>['Type'];
|
|
175
|
+
/** Validation failure admitted only by definitions that declare a run disposition. */
|
|
176
|
+
type RunDispositionFailure<AgentValue extends AnyDefinition | Any> = [RunDispositionSchemaOf<DefinitionOf<AgentValue>>] extends [never] ? never : AgentRunDispositionError;
|
|
177
|
+
/** Effect AI tool map carried by a definition or binding. */
|
|
178
|
+
type Tools<AgentValue extends AnyDefinition | Any> = Toolkit.Tools<DefinitionOf<AgentValue>['toolkit']>;
|
|
179
|
+
type ApplicationTools<A extends AnyDefinition> = [UpdatesSchema<A>] extends [never] ? Tools<A> : Omit<Tools<A>, 'emit_update'>;
|
|
180
|
+
type ToolMapValues<ToolMap extends Record<string, Tool.Any>> = ToolMap extends unknown ? ToolMap[keyof ToolMap] : never;
|
|
181
|
+
/** All possible tools, including keys present in only one definition or binding branch. */
|
|
182
|
+
type ToolUnion<AgentValue extends AnyDefinition | Any> = ToolMapValues<Tools<AgentValue>>;
|
|
183
|
+
/** Instruction, tool-handler, and Schema services required before a Model is bound. */
|
|
184
|
+
type DefinitionRequirements<DefinitionValue extends AnyDefinition> = DefinitionValue extends unknown ? EffectServices<InstructionEffect<DefinitionValue['instructions'], Input<DefinitionValue>>> | EffectServices<InputPromptEffect<DefinitionValue['inputPrompt'], Input<DefinitionValue>>> | Tool.HandlersFor<ApplicationTools<DefinitionValue>> | Tool.HandlerServices<ToolMapValues<ApplicationTools<DefinitionValue>>> | Tool.ParametersSchema<ToolUnion<DefinitionValue>>['EncodingServices'] | Tool.SuccessSchema<ToolUnion<DefinitionValue>>['DecodingServices'] | DefinitionValue['input']['DecodingServices'] | DefinitionValue['input']['EncodingServices'] | DefinitionValue['output']['DecodingServices'] | DefinitionValue['output']['EncodingServices'] | UpdatesSchema<DefinitionValue>['DecodingServices'] | UpdatesSchema<DefinitionValue>['EncodingServices'] | RunDispositionSchemaOf<DefinitionValue>['DecodingServices'] | RunDispositionSchemaOf<DefinitionValue>['EncodingServices'] : never;
|
|
185
|
+
/** Definition services plus native model services, or a binding's model Layer requirements. */
|
|
186
|
+
type Requirements<AgentValue extends AnyDefinition | Any> = DefinitionRequirements<DefinitionOf<AgentValue>> | (AgentValue extends {
|
|
187
|
+
readonly model: infer ModelValue;
|
|
188
|
+
} ? ModelRequirements<ModelValue> : ModelServices);
|
|
189
|
+
type DefinitionFailure<DefinitionValue extends AnyDefinition> = DefinitionValue extends unknown ? EffectError<InstructionEffect<DefinitionValue['instructions'], Input<DefinitionValue>>> | EffectError<InputPromptEffect<DefinitionValue['inputPrompt'], Input<DefinitionValue>>> | Tool.HandlerError<ToolUnion<DefinitionValue>> : never;
|
|
190
|
+
/** Failures from every possible definition, preserving each branch's instruction input type. */
|
|
191
|
+
type Failure<AgentValue extends AnyDefinition | Any> = DefinitionFailure<DefinitionOf<AgentValue>> | AiError.AiError | AgentInputDecodeError | AgentInputError | AgentOutputError | RunDispositionFailure<AgentValue>;
|
|
192
|
+
/** Validate an agent ID and return a shallowly frozen, model-agnostic definition. */
|
|
193
|
+
declare function make<const Name extends string, InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>, ToolkitValue extends Toolkit.Any, DispositionSchema extends Schema.Top, InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined, UpdatesSchema extends Schema.Top | undefined = undefined>(id: Name, options: DefinitionOptions<InputSchema, OutputSchema, Instructions, ToolkitValue, RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>, InputPromptValue, UpdatesSchema> & {
|
|
194
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>;
|
|
195
|
+
readonly inputPrompt: InputPromptValue;
|
|
196
|
+
}): Definition<InputSchema, OutputSchema, Instructions, UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>, RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>, InputPromptValue, NoInfer<UpdatesSchema>> & {
|
|
197
|
+
readonly id: AgentId & Name;
|
|
198
|
+
};
|
|
199
|
+
declare function make<const Name extends string, InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>, ToolkitValue extends Toolkit.Any, DispositionSchema extends Schema.Top, UpdatesSchema extends Schema.Top | undefined = undefined>(id: Name, options: DefinitionOptions<InputSchema, OutputSchema, Instructions, ToolkitValue, RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>, undefined, UpdatesSchema> & {
|
|
200
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>;
|
|
201
|
+
readonly inputPrompt?: undefined;
|
|
202
|
+
}): Definition<InputSchema, OutputSchema, Instructions, UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>, RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>, undefined, NoInfer<UpdatesSchema>> & {
|
|
203
|
+
readonly id: AgentId & Name;
|
|
204
|
+
};
|
|
205
|
+
declare function make<const Name extends string, InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>, ToolkitValue extends Toolkit.Any, InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined, UpdatesSchema extends Schema.Top | undefined = undefined>(id: Name, options: DefinitionOptions<InputSchema, OutputSchema, Instructions, ToolkitValue, undefined, InputPromptValue, UpdatesSchema> & {
|
|
206
|
+
readonly inputPrompt: InputPromptValue;
|
|
207
|
+
readonly runDisposition?: undefined;
|
|
208
|
+
}): Definition<InputSchema, OutputSchema, Instructions, UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>, undefined, InputPromptValue, NoInfer<UpdatesSchema>> & {
|
|
209
|
+
readonly id: AgentId & Name;
|
|
210
|
+
};
|
|
211
|
+
declare function make<const Name extends string, InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>, ToolkitValue extends Toolkit.Any, UpdatesSchema extends Schema.Top | undefined = undefined>(id: Name, options: DefinitionOptions<InputSchema, OutputSchema, Instructions, ToolkitValue, undefined, undefined, UpdatesSchema> & {
|
|
212
|
+
readonly inputPrompt?: undefined;
|
|
213
|
+
readonly runDisposition?: undefined;
|
|
214
|
+
}): Definition<InputSchema, OutputSchema, Instructions, UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>, undefined, undefined, NoInfer<UpdatesSchema>> & {
|
|
215
|
+
readonly id: AgentId & Name;
|
|
216
|
+
};
|
|
217
|
+
/** Bind a native model Layer without acquiring or hiding its requirements. */
|
|
218
|
+
declare function withModel<DefinitionValue extends AnyDefinition, ModelValue>(definition: DefinitionValue, model: NativeModel<ModelValue>): Binding<DefinitionValue, ModelValue>;
|
|
219
|
+
export { UpdatesSchema as A, RunDisposition as C, ToolUnion as D, RunDispositionSchema as E, withModel as M, Tools as O, Requirements as S, RunDispositionFailure as T, ModelServices as _, CompletionProjectionInput as a, Output as b, DefinitionOptions as c, Failure as d, Input as f, InstructionSource as g, InstructionResult as h, Binding as i, make as j, Update as k, DefinitionRequirements as l, InputSchema as m, Any as n, CompletionToolDeclaration as o, InputPromptSource as p, AnyDefinition as r, Definition as s, Agent_d_exports as t, EncodedInput as u, Name as v, RunDispositionDeclaration as w, OutputSchema as x, NativeModel as y };
|