@systemfsoftware/agent 0.0.0-stage → 0.1.0-beta.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Admin-BfolLkHj.d.mts +5678 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/Agent-DSVEpq4e.d.mts +219 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-Dg53p6du.mjs +14 -0
- package/dist/AgentRegistration-Dg53p6du.mjs.map +1 -0
- package/dist/AgentRuntime-CoGy_5dm.d.mts +751 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs +5249 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-C9vict2M.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/CommittedActivity-LWOKXqdi.d.mts +62 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-917r7gpv.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs +8432 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/EventSource-C0TCBeIf.d.mts +52 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-4CRzkPBD.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-Dh6GZBt_.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DhM-APnP.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-CubWeYKN.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/Output-SbOdlBFL.d.mts +22 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-BrtZ0g2j.d.mts +14 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PreparedInputAdmission-Ci18uY4s.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-BVAHoYlN.d.mts +127 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-CjVP48I8.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/Scheduling-DYTM29s9.d.mts +57 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-CSIRUgUo.mjs +1315 -0
- package/dist/Subagent-CSIRUgUo.mjs.map +1 -0
- package/dist/Subagent-CXEI5YZ8.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentHost-CKhz1vbH.d.mts +167 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/Subscription-CC--_OnU.d.mts +815 -0
- package/dist/SubscriptionInput-BEeB0Cj8.d.mts +42 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs +53 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs.map +1 -0
- package/dist/SubscriptionTransition-CWt9UVH0.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-4K_qu_2f.mjs +638 -0
- package/dist/Subscriptions-4K_qu_2f.mjs.map +1 -0
- package/dist/Subscriptions-BF3aSf8X.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-lTZ8Ftq1.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadImport-DaSmrlRi.d.mts +843 -0
- package/dist/ThreadInvariants-DyPhMeo-.d.mts +23 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-DjUy7kCa.d.mts +51 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-BM02cbOo.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-VjamzX3q.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-C4-HsMCp.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-CD0V--qh.d.mts +18 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs +162 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs.map +1 -0
- package/dist/WorkerAdmission-BnRuXLWF.d.mts +171 -0
- package/dist/WorkerHost-DtYzi54D.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-CNs2twrr.mjs +262 -0
- package/dist/agent-registration-CNs2twrr.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-CHox63hg.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +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 +11137 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,1145 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D3KUYPsf.mjs";
|
|
2
|
+
import * as Prompt from "effect/ai/Prompt";
|
|
3
|
+
import * as Option from "effect/Option";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Struct from "effect/Struct";
|
|
6
|
+
import { l as InputMessage } from "./MessagingHost-Bm5e-kAX.mjs";
|
|
7
|
+
import { _ as PolicyLimit } from "./AgentError-yFdnS9bl.mjs";
|
|
8
|
+
import { t as AgentPolicy } from "./AgentPolicy-CI7LRBQa.mjs";
|
|
9
|
+
import { r as Update } from "./AgentUpdates-BS_6gR5K.mjs";
|
|
10
|
+
import { i as Failure } from "./FailureDiagnostic-DdHV2eFs.mjs";
|
|
11
|
+
import { c as SettlementId, d as ToolCallId, f as TurnId, l as SubmissionId, o as ReceiptId, r as DelegationId, s as RunId, t as AgentId, u as ThreadId } from "./Identifiers-LWd4837I.mjs";
|
|
12
|
+
import { n as utf8ByteLength } from "./utf8-Bl0ZhhGe.mjs";
|
|
13
|
+
import { a as Receipt, r as Principal, t as IdempotencyKey } from "./Receipt-B-FlCaNH.mjs";
|
|
14
|
+
import { M as ExhaustedLimit } from "./RunEvent-DJxENnJi.mjs";
|
|
15
|
+
import { t as RunPolicyUsage } from "./RunPolicyUsage-B-JXRZYO.mjs";
|
|
16
|
+
import { i as SubagentBudgetReservation, l as SubagentGrant, n as DelegationDepth, p as ToolExecutionKind, u as SubagentParentLink } from "./SubagentContract-C-7AxTm_.mjs";
|
|
17
|
+
import { o as Selection, s as Snapshot } from "./ToolExposure-DPnq8Won.mjs";
|
|
18
|
+
import { t as ToolParameterRejection } from "./ToolResult-DwZxjlHw.mjs";
|
|
19
|
+
import { l as RunUsageSummary, r as ModelCallUsage, s as RunTotals } from "./Usage-B0xgME5f.mjs";
|
|
20
|
+
import { _ as WorkerStop, a as WorkerBudgetScope, f as WorkerRef, h as WorkerSource } from "./Worker-CQu8Qp1j.mjs";
|
|
21
|
+
import { t as ContextHandoff } from "./ContextWindow-kbFcs1IF.mjs";
|
|
22
|
+
import * as Effect from "effect/Effect";
|
|
23
|
+
import * as SchemaParser from "effect/SchemaParser";
|
|
24
|
+
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
25
|
+
// src/durable/internal/history-prompt.ts
|
|
26
|
+
const restoreFilePart = Schema.decodeSync(Prompt.FilePart);
|
|
27
|
+
function restorePart(part) {
|
|
28
|
+
switch (part.type) {
|
|
29
|
+
case "text": return Prompt.textPart(part);
|
|
30
|
+
case "reasoning": return Prompt.reasoningPart(part);
|
|
31
|
+
case "file": return restoreFilePart(part);
|
|
32
|
+
case "tool-call": return Prompt.toolCallPart({
|
|
33
|
+
...part,
|
|
34
|
+
providerExecuted: part.providerExecuted ?? false
|
|
35
|
+
});
|
|
36
|
+
case "tool-result": {
|
|
37
|
+
const { modelOutput, ...fields } = part;
|
|
38
|
+
return Prompt.toolResultPart({
|
|
39
|
+
...fields,
|
|
40
|
+
providerExecuted: part.providerExecuted ?? false,
|
|
41
|
+
...modelOutput === void 0 ? {} : { modelOutput: modelOutput.map((output) => output.type === "file" ? restoreFilePart(output) : Prompt.textPart(output)) }
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
case "tool-approval-request": return Prompt.toolApprovalRequestPart(part);
|
|
45
|
+
case "tool-approval-response": return Prompt.toolApprovalResponsePart(part);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const restoreHistoryMessage = (message) => {
|
|
49
|
+
switch (message.role) {
|
|
50
|
+
case "system": return Prompt.makeMessage("system", message);
|
|
51
|
+
case "user": return Prompt.makeMessage("user", {
|
|
52
|
+
...message,
|
|
53
|
+
content: typeof message.content === "string" ? [Prompt.textPart({ text: message.content })] : message.content.map((part) => restorePart(part))
|
|
54
|
+
});
|
|
55
|
+
case "assistant": return Prompt.makeMessage("assistant", {
|
|
56
|
+
...message,
|
|
57
|
+
content: typeof message.content === "string" ? [Prompt.textPart({ text: message.content })] : message.content.map((part) => restorePart(part))
|
|
58
|
+
});
|
|
59
|
+
case "tool": return Prompt.makeMessage("tool", {
|
|
60
|
+
...message,
|
|
61
|
+
content: message.content.map((part) => restorePart(part))
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
};
|
|
65
|
+
/**
|
|
66
|
+
* Share the upstream encoded-message boundary between canonical history and checkpoint reads.
|
|
67
|
+
* The canonical codec remains authoritative at append, import, recovery and explicit verification.
|
|
68
|
+
*/
|
|
69
|
+
const HistoryMessage = Schema.toEncoded(Prompt.Message);
|
|
70
|
+
const HistoryPrompt = Schema.Struct({ content: Schema.Array(HistoryMessage) }).pipe(Schema.decodeTo(Schema.toType(Prompt.Prompt), SchemaTransformation.transformEffect({
|
|
71
|
+
decode: (input) => Effect.succeed(Prompt.fromMessages(input.content.map(restoreHistoryMessage))),
|
|
72
|
+
encode: SchemaParser.encodeEffect(Prompt.Prompt)
|
|
73
|
+
})));
|
|
74
|
+
// src/durable/Records.ts
|
|
75
|
+
var Records_exports = /* @__PURE__ */ __exportAll({
|
|
76
|
+
AbortRequested: () => AbortRequested,
|
|
77
|
+
AgentUpdateEmitted: () => AgentUpdateEmitted,
|
|
78
|
+
ApprovalDecision: () => ApprovalDecision,
|
|
79
|
+
BatchId: () => BatchId,
|
|
80
|
+
CURRENT_CANONICAL_SCHEMA_VERSION: () => 1,
|
|
81
|
+
CURRENT_RECORD_FORMAT: () => CURRENT_RECORD_FORMAT,
|
|
82
|
+
CURRENT_RECORD_VERSION: () => 6,
|
|
83
|
+
CanonicalBatch: () => CanonicalBatch,
|
|
84
|
+
CanonicalRecord: () => CanonicalRecord,
|
|
85
|
+
CanonicalRecordEnvelope: () => CanonicalRecordEnvelope,
|
|
86
|
+
CanonicalRecordPayload: () => CanonicalRecordPayload,
|
|
87
|
+
CanonicalSequence: () => CanonicalSequence,
|
|
88
|
+
CompactionCreated: () => CompactionCreated,
|
|
89
|
+
ContextEvidenceReference: () => ContextEvidenceReference,
|
|
90
|
+
ContinuationAccounting: () => ContinuationAccounting,
|
|
91
|
+
DeclaredToolCall: () => DeclaredToolCall,
|
|
92
|
+
DefinitionDigestInput: () => DefinitionDigestInput,
|
|
93
|
+
DefinitionDigests: () => DefinitionDigests,
|
|
94
|
+
DeploymentId: () => DeploymentId,
|
|
95
|
+
Digest: () => Digest,
|
|
96
|
+
EvidenceReference: () => EvidenceReference,
|
|
97
|
+
KnownRecordPayload: () => KnownRecordPayload,
|
|
98
|
+
MAX_CANONICAL_RECORD_BYTES: () => MAX_CANONICAL_RECORD_BYTES,
|
|
99
|
+
MAX_PERSISTED_JSON_BYTES: () => MAX_PERSISTED_JSON_BYTES,
|
|
100
|
+
MAX_PERSISTED_JSON_COLLECTION_LENGTH: () => MAX_PERSISTED_JSON_COLLECTION_LENGTH,
|
|
101
|
+
MAX_PERSISTED_JSON_DEPTH: () => 64,
|
|
102
|
+
MAX_PERSISTED_JSON_NODES: () => MAX_PERSISTED_JSON_NODES,
|
|
103
|
+
MAX_RUN_CONTINUATION_BYTES: () => MAX_RUN_CONTINUATION_BYTES,
|
|
104
|
+
MAX_RUN_EVIDENCE_BYTES: () => MAX_RUN_EVIDENCE_BYTES,
|
|
105
|
+
MAX_RUN_EVIDENCE_RECORDS: () => MAX_RUN_EVIDENCE_RECORDS,
|
|
106
|
+
MAX_RUN_RECOVERY_SUFFIX_BYTES: () => MAX_RUN_RECOVERY_SUFFIX_BYTES,
|
|
107
|
+
MAX_RUN_RECOVERY_SUFFIX_RECORDS: () => 64,
|
|
108
|
+
MAX_RUN_TERMINAL_BYTES: () => MAX_RUN_TERMINAL_BYTES,
|
|
109
|
+
MAX_RUN_TOOL_CALL_IDENTITIES: () => MAX_RUN_TOOL_CALL_IDENTITIES,
|
|
110
|
+
MAX_TURN_CANONICAL_BYTES: () => MAX_TURN_CANONICAL_BYTES,
|
|
111
|
+
ModelCallAborted: () => ModelCallAborted,
|
|
112
|
+
ModelCompleted: () => ModelCompleted,
|
|
113
|
+
ModelResponseInterrupted: () => ModelResponseInterrupted,
|
|
114
|
+
ModelResponseRecorded: () => ModelResponseRecorded,
|
|
115
|
+
ObservationOffset: () => ObservationOffset,
|
|
116
|
+
PROMPT_EVIDENCE_TAGS: () => PROMPT_EVIDENCE_TAGS,
|
|
117
|
+
PeerMessagePrepared: () => PeerMessagePrepared,
|
|
118
|
+
PersistedJson: () => PersistedJson,
|
|
119
|
+
ProducerId: () => ProducerId,
|
|
120
|
+
PromptRecord: () => PromptRecord,
|
|
121
|
+
PromptRecordEnvelope: () => PromptRecordEnvelope,
|
|
122
|
+
PromptRecordPayload: () => PromptRecordPayload,
|
|
123
|
+
RUN_TERMINAL_RESERVE_BYTES: () => RUN_TERMINAL_RESERVE_BYTES,
|
|
124
|
+
RUN_TERMINAL_RESERVE_RECORDS: () => 4,
|
|
125
|
+
RecordEnvelope: () => RecordEnvelope,
|
|
126
|
+
RecordId: () => RecordId,
|
|
127
|
+
RecordJson: () => RecordJson,
|
|
128
|
+
RepairAnnotated: () => RepairAnnotated,
|
|
129
|
+
ReplayContract: () => ReplayContract,
|
|
130
|
+
RunCompleted: () => RunCompleted,
|
|
131
|
+
RunContextRecorded: () => RunContextRecorded,
|
|
132
|
+
RunContinuation: () => RunContinuation,
|
|
133
|
+
RunDurationExhausted: () => RunDurationExhausted,
|
|
134
|
+
RunFailed: () => RunFailed,
|
|
135
|
+
RunPolicyUsageReserved: () => RunPolicyUsageReserved,
|
|
136
|
+
RunPosition: () => RunPosition,
|
|
137
|
+
RunStartedRecord: () => RunStartedRecord,
|
|
138
|
+
SettlementFailureDiagnostic: () => SettlementFailureDiagnostic,
|
|
139
|
+
SettlementOutcome: () => SettlementOutcome,
|
|
140
|
+
SubagentJoined: () => SubagentJoined,
|
|
141
|
+
SubagentLineageRecorded: () => SubagentLineageRecorded,
|
|
142
|
+
SubagentRequested: () => SubagentRequested,
|
|
143
|
+
SubagentStarted: () => SubagentStarted,
|
|
144
|
+
SubmissionSettled: () => SubmissionSettled,
|
|
145
|
+
SubmissionSettledRecord: () => SubmissionSettledRecord,
|
|
146
|
+
SubtreeBudgetReserved: () => SubtreeBudgetReserved,
|
|
147
|
+
ThreadCreated: () => ThreadCreated,
|
|
148
|
+
ToolApprovalDecided: () => ToolApprovalDecided,
|
|
149
|
+
ToolApprovalRequested: () => ToolApprovalRequested,
|
|
150
|
+
ToolCallResolution: () => ToolCallResolution,
|
|
151
|
+
ToolCallResolved: () => ToolCallResolved,
|
|
152
|
+
ToolCallSettled: () => ToolCallSettled,
|
|
153
|
+
ToolCallUnknown: () => ToolCallUnknown,
|
|
154
|
+
ToolOperation: () => ToolOperation,
|
|
155
|
+
ToolStepSettled: () => ToolStepSettled,
|
|
156
|
+
ToolUnavailable: () => ToolUnavailable,
|
|
157
|
+
UserInputRecorded: () => UserInputRecorded,
|
|
158
|
+
WorkHandoffCompleted: () => WorkHandoffCompleted,
|
|
159
|
+
WorkerAdmission: () => WorkerAdmission,
|
|
160
|
+
WorkerContinuation: () => WorkerContinuation,
|
|
161
|
+
WorkerInputCompleted: () => WorkerInputCompleted,
|
|
162
|
+
WorkerInputRefused: () => WorkerInputRefused,
|
|
163
|
+
WorkerInputRequested: () => WorkerInputRequested,
|
|
164
|
+
WorkerOrigin: () => WorkerOrigin,
|
|
165
|
+
WorkerOriginRecorded: () => WorkerOriginRecorded,
|
|
166
|
+
WorkerReportPrepared: () => WorkerReportPrepared,
|
|
167
|
+
WorkerReportRefused: () => WorkerReportRefused,
|
|
168
|
+
WorkerReportingIntent: () => WorkerReportingIntent,
|
|
169
|
+
WorkerStopRequested: () => WorkerStopRequested
|
|
170
|
+
});
|
|
171
|
+
/** Stable identity of one canonical record. */
|
|
172
|
+
const RecordId = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/thread/RecordId"));
|
|
173
|
+
/** Stable idempotency identity of one atomic append. */
|
|
174
|
+
const BatchId = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/thread/BatchId"));
|
|
175
|
+
/** Identity of the deployment that produced a record. */
|
|
176
|
+
const DeploymentId = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/thread/DeploymentId"));
|
|
177
|
+
/** Identity of a canonical-log producer. */
|
|
178
|
+
const ProducerId = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/thread/ProducerId"));
|
|
179
|
+
/** SHA-256 digest encoded as lowercase hexadecimal text. */
|
|
180
|
+
const Digest = Schema.String.check(Schema.isPattern(/^[a-f0-9]{64}$/)).pipe(Schema.brand("@effect-agent/thread/Digest"));
|
|
181
|
+
/** Adapter-owned resume cursor. Callers must not parse or synthesize it. */
|
|
182
|
+
const ObservationOffset = Schema.NonEmptyString.pipe(Schema.brand("@effect-agent/thread/ObservationOffset"));
|
|
183
|
+
/** Gap-free position in one Thread's canonical sequence. */
|
|
184
|
+
const CanonicalSequence = Schema.Natural.pipe(Schema.brand("@effect-agent/thread/CanonicalSequence"));
|
|
185
|
+
const BoundedText = Schema.String.check(Schema.isMaxLength(65536));
|
|
186
|
+
const BoundedName = Schema.NonEmptyString.check(Schema.isMaxLength(256));
|
|
187
|
+
/**
|
|
188
|
+
* Private failed-Settlement evidence. The summary remains the safe public projection; diagnostic
|
|
189
|
+
* and context preserve structured causal evidence for authorized operators, never model context.
|
|
190
|
+
* Optional fields allow reading supported Settlements written before causal capture was available.
|
|
191
|
+
*/
|
|
192
|
+
const SettlementFailureDiagnostic = Failure.pipe(Schema.annotate({ identifier: "@effect-agent/thread/SettlementFailureDiagnostic" }));
|
|
193
|
+
/** Positive canonical (Run-relative, Attempt-independent) Turn number. */
|
|
194
|
+
const TurnNumber = Schema.Int.check(Schema.isGreaterThan(0));
|
|
195
|
+
const MAX_PERSISTED_JSON_DEPTH = 64;
|
|
196
|
+
const MAX_PERSISTED_JSON_COLLECTION_LENGTH = 4096;
|
|
197
|
+
const MAX_PERSISTED_JSON_NODES = 65536;
|
|
198
|
+
const MAX_PERSISTED_JSON_BYTES = 1048576;
|
|
199
|
+
/** Whole record wire includes bounded payloads and their canonical envelope. */
|
|
200
|
+
const MAX_CANONICAL_RECORD_BYTES = 4194304;
|
|
201
|
+
/**
|
|
202
|
+
* Iteratively preflights an unknown value before Schema's recursive JSON validation. This is the
|
|
203
|
+
* one narrow `Schema.declare` exception in the persistence model: Effect v4's `Unknown.decodeTo`
|
|
204
|
+
* preserves `unknown` as the encoded type, which would leak through every nested record codec.
|
|
205
|
+
* Schema.Json still owns the accepted value shape after this resource preflight succeeds.
|
|
206
|
+
*/
|
|
207
|
+
const isJson = Schema.is(Schema.Json);
|
|
208
|
+
const nonAscii = /[\u0080-\uFFFF]/;
|
|
209
|
+
const boundedJson = (limits) => (input) => {
|
|
210
|
+
const pending = [{
|
|
211
|
+
_tag: "visit",
|
|
212
|
+
value: input,
|
|
213
|
+
depth: 0
|
|
214
|
+
}];
|
|
215
|
+
const ancestors = /* @__PURE__ */ new WeakSet();
|
|
216
|
+
let nodes = 0;
|
|
217
|
+
let textUnits = 0;
|
|
218
|
+
try {
|
|
219
|
+
while (pending.length > 0) {
|
|
220
|
+
const current = pending.pop();
|
|
221
|
+
if (current === void 0) return false;
|
|
222
|
+
if (current._tag === "leave") {
|
|
223
|
+
ancestors.delete(current.value);
|
|
224
|
+
continue;
|
|
225
|
+
}
|
|
226
|
+
if (current.depth > limits.depth || ++nodes > limits.nodes) return false;
|
|
227
|
+
const value = current.value;
|
|
228
|
+
if (value === null || typeof value === "boolean") continue;
|
|
229
|
+
if (typeof value === "number") {
|
|
230
|
+
if (!Number.isFinite(value)) return false;
|
|
231
|
+
continue;
|
|
232
|
+
}
|
|
233
|
+
if (typeof value === "string") {
|
|
234
|
+
textUnits += value.length;
|
|
235
|
+
if (textUnits > limits.bytes) return false;
|
|
236
|
+
continue;
|
|
237
|
+
}
|
|
238
|
+
if (typeof value !== "object" || ancestors.has(value)) return false;
|
|
239
|
+
ancestors.add(value);
|
|
240
|
+
pending.push({
|
|
241
|
+
_tag: "leave",
|
|
242
|
+
value
|
|
243
|
+
});
|
|
244
|
+
const entries = Array.isArray(value) ? Array.from(value, (entry, index) => [index, entry]) : Object.entries(value);
|
|
245
|
+
if (entries.length > 4096) return false;
|
|
246
|
+
for (const [key, entry] of entries) {
|
|
247
|
+
textUnits += typeof key === "string" ? key.length : 0;
|
|
248
|
+
if (textUnits > limits.bytes) return false;
|
|
249
|
+
pending.push({
|
|
250
|
+
_tag: "visit",
|
|
251
|
+
value: entry,
|
|
252
|
+
depth: current.depth + 1
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
if (!isJson(input)) return false;
|
|
257
|
+
const encoded = JSON.stringify(input);
|
|
258
|
+
return encoded !== void 0 && encoded.length <= limits.bytes && (encoded.length <= limits.bytes / 3 || !nonAscii.test(encoded) || utf8ByteLength(encoded) <= limits.bytes);
|
|
259
|
+
} catch {
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
};
|
|
263
|
+
const isPersistedJson = boundedJson({
|
|
264
|
+
depth: 64,
|
|
265
|
+
nodes: MAX_PERSISTED_JSON_NODES,
|
|
266
|
+
bytes: MAX_PERSISTED_JSON_BYTES
|
|
267
|
+
});
|
|
268
|
+
/** Canonical JSON admitted to persisted records and checkpoints under explicit resource limits. */
|
|
269
|
+
const PersistedJson = Schema.declare(isPersistedJson, {
|
|
270
|
+
identifier: "@effect-agent/thread/PersistedJson",
|
|
271
|
+
description: "JSON bounded by canonical persistence depth, collection, node, and byte limits"
|
|
272
|
+
});
|
|
273
|
+
/** Whole record wire reserves room for the payload's envelope and additional bounded fields. */
|
|
274
|
+
const RecordJson = Schema.declare(boundedJson({
|
|
275
|
+
depth: 68,
|
|
276
|
+
nodes: MAX_PERSISTED_JSON_NODES * 4,
|
|
277
|
+
bytes: MAX_CANONICAL_RECORD_BYTES
|
|
278
|
+
}), {
|
|
279
|
+
identifier: "@effect-agent/thread/RecordJson",
|
|
280
|
+
description: "Canonical record JSON bounded by depth, collection, node, and 4 MiB byte limits"
|
|
281
|
+
});
|
|
282
|
+
/** Schema-owned replay inputs whose individual definitions are incorporated into digests. */
|
|
283
|
+
var DefinitionDigestInput = class extends Schema.Class("@effect-agent/thread/DefinitionDigestInput")({
|
|
284
|
+
agent: PersistedJson,
|
|
285
|
+
model: PersistedJson,
|
|
286
|
+
tools: PersistedJson
|
|
287
|
+
}) {};
|
|
288
|
+
/** Admission-time operation fingerprints. Agent fingerprints remain immutable evidence only. */
|
|
289
|
+
var ReplayContract = class extends Schema.Class("@effect-agent/thread/ReplayContract")({
|
|
290
|
+
agent: Digest,
|
|
291
|
+
/** Retained for reading earlier admissions; never selects executable code. */
|
|
292
|
+
agentBehavior: Schema.optionalKey(Digest),
|
|
293
|
+
tools: Schema.Record(Schema.String, Digest)
|
|
294
|
+
}) {};
|
|
295
|
+
/** Digests identify admission exactly; only an unfinished operation needs replay compatibility. */
|
|
296
|
+
var DefinitionDigests = class extends Schema.Class("@effect-agent/thread/DefinitionDigests")({
|
|
297
|
+
agent: Digest,
|
|
298
|
+
model: Digest,
|
|
299
|
+
tools: Digest,
|
|
300
|
+
replay: Schema.optionalKey(ReplayContract)
|
|
301
|
+
}) {};
|
|
302
|
+
var ThreadCreated = class extends Schema.TaggedClass("@effect-agent/thread/ThreadCreated")("ThreadCreated", {
|
|
303
|
+
agentId: AgentId,
|
|
304
|
+
definitions: DefinitionDigests
|
|
305
|
+
}) {};
|
|
306
|
+
/**
|
|
307
|
+
* One recorded Thread input. `submissionId` is present only for durably accepted work;
|
|
308
|
+
* retained history has no admission or settlement obligation. `kind` identifies the input seam.
|
|
309
|
+
*/
|
|
310
|
+
var UserInputRecorded = class extends Schema.TaggedClass("@effect-agent/thread/UserInputRecorded")("UserInputRecorded", {
|
|
311
|
+
submissionId: Schema.optionalKey(SubmissionId),
|
|
312
|
+
kind: Schema.Literals([
|
|
313
|
+
"user",
|
|
314
|
+
"steering",
|
|
315
|
+
"follow-up"
|
|
316
|
+
]),
|
|
317
|
+
runId: Schema.optionalKey(RunId),
|
|
318
|
+
input: PersistedJson,
|
|
319
|
+
messageAdmission: Schema.optionalKey(InputMessage)
|
|
320
|
+
}) {};
|
|
321
|
+
/** Immutable Run start and per-Attempt duration allowance, before any agent execution. */
|
|
322
|
+
var RunStartedRecord = class extends Schema.TaggedClass("@effect-agent/thread/RunStartedRecord")("RunStarted", {
|
|
323
|
+
runId: RunId,
|
|
324
|
+
/** Older private histories cannot prove programmatic accounting and must be reset. */
|
|
325
|
+
policyAccountingVersion: Schema.Literal(1),
|
|
326
|
+
maxDurationMillis: Schema.Finite.check(Schema.isGreaterThan(0))
|
|
327
|
+
}) {};
|
|
328
|
+
/** An active Attempt exhausted its execution allowance; downtime alone never writes this. */
|
|
329
|
+
var RunDurationExhausted = class extends Schema.TaggedClass("@effect-agent/thread/RunDurationExhausted")("RunDurationExhausted", { runId: RunId }) {};
|
|
330
|
+
const PersistedPromptMessages = Schema.toEncoded(Prompt.Prompt);
|
|
331
|
+
const isPersistedPromptMessages = Schema.is(PersistedPromptMessages);
|
|
332
|
+
const PersistedResponseMessages = PersistedJson.pipe(Schema.refine((input) => isPersistedPromptMessages(input), {
|
|
333
|
+
identifier: "@effect-agent/thread/PersistedJson",
|
|
334
|
+
expected: "persisted Effect AI Prompt messages"
|
|
335
|
+
}));
|
|
336
|
+
/**
|
|
337
|
+
* Final model output. Immediate history records the successful Run's source messages for
|
|
338
|
+
* recall and a full retained model-context snapshot for the next Run. Durable execution
|
|
339
|
+
* instead journals individual ModelResponseRecorded Turns and exact context references.
|
|
340
|
+
*/
|
|
341
|
+
var ModelCompleted = class extends Schema.TaggedClass("@effect-agent/thread/ModelCompleted")("ModelCompleted", Schema.Struct({
|
|
342
|
+
runId: RunId,
|
|
343
|
+
output: PersistedJson,
|
|
344
|
+
messages: Schema.optionalKey(PersistedJson),
|
|
345
|
+
history: Schema.optionalKey(PersistedJson)
|
|
346
|
+
}).check(Schema.makeFilter((record) => record.messages === void 0 && record.history === void 0 || record.messages !== void 0 && record.history !== void 0 && isPersistedPromptMessages(record.messages) && isPersistedPromptMessages(record.history), { title: "Retained source messages and model context are paired encoded Effect AI Prompts" }))) {};
|
|
347
|
+
var ToolCallSettled = class extends Schema.TaggedClass("@effect-agent/thread/ToolCallSettled")("ToolCallSettled", {
|
|
348
|
+
toolSelection: Schema.optionalKey(Selection),
|
|
349
|
+
runId: RunId,
|
|
350
|
+
toolCallId: ToolCallId,
|
|
351
|
+
toolName: BoundedName,
|
|
352
|
+
result: PersistedJson,
|
|
353
|
+
isFailure: Schema.Boolean,
|
|
354
|
+
/** Explicit engine evidence, never inferred from Tool result data. */
|
|
355
|
+
budgetRejected: Schema.optionalKey(Schema.Literal(true))
|
|
356
|
+
}) {};
|
|
357
|
+
/** Compact execution evidence committed with a declaration, before any handler can start. */
|
|
358
|
+
var ToolOperation = class extends Schema.Class("@effect-agent/thread/ToolOperation")({
|
|
359
|
+
toolCallId: ToolCallId,
|
|
360
|
+
toolName: BoundedName,
|
|
361
|
+
executionClass: Schema.Literals([
|
|
362
|
+
"readonly",
|
|
363
|
+
"idempotent",
|
|
364
|
+
"uncertain"
|
|
365
|
+
]),
|
|
366
|
+
executionKind: ToolExecutionKind,
|
|
367
|
+
replay: Digest
|
|
368
|
+
}) {};
|
|
369
|
+
/** Derived recovery input from one committed response; never a separate canonical record. */
|
|
370
|
+
var DeclaredToolCall = class extends Schema.Class("@effect-agent/thread/DeclaredToolCall")({
|
|
371
|
+
...ToolOperation.fields,
|
|
372
|
+
runId: RunId,
|
|
373
|
+
turnId: TurnId,
|
|
374
|
+
turn: TurnNumber,
|
|
375
|
+
parameters: PersistedJson,
|
|
376
|
+
parametersDigest: Digest
|
|
377
|
+
}) {};
|
|
378
|
+
/** A retired call's runtime result. Unavailable readonly work may already have been observed. */
|
|
379
|
+
var ToolUnavailable = class extends Schema.TaggedClass()("ToolUnavailable", {
|
|
380
|
+
toolName: BoundedName,
|
|
381
|
+
execution: Schema.Literals(["not-executed", "unavailable"]),
|
|
382
|
+
message: BoundedText
|
|
383
|
+
}) {};
|
|
384
|
+
/**
|
|
385
|
+
* One committed model Turn. `messages` carries the Schema-encoded Effect AI Prompt messages this
|
|
386
|
+
* Turn appended (assistant response plus any tool-call declarations), committed atomically at the
|
|
387
|
+
* Turn boundary so a recovering Attempt can rebuild the next Prompt from canonical records alone.
|
|
388
|
+
*/
|
|
389
|
+
const ModelResponseRecordedFields = Schema.Struct({
|
|
390
|
+
/** Original bound for each application result; replacement Bindings cannot enlarge it. */
|
|
391
|
+
toolResultMaxBytes: Schema.Int.check(Schema.isBetween({
|
|
392
|
+
minimum: 256,
|
|
393
|
+
maximum: MAX_PERSISTED_JSON_BYTES
|
|
394
|
+
})),
|
|
395
|
+
/** Maximum encoded selection metadata from the native catalog at declaration time. */
|
|
396
|
+
toolSelectionMaxBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(MAX_CANONICAL_RECORD_BYTES)),
|
|
397
|
+
/** Exactly one entry per application call, including rejected calls; none for provider execution. */
|
|
398
|
+
toolOperations: Schema.Array(ToolOperation),
|
|
399
|
+
/** Explicit pre-execution failures, committed with the original arguments before any approval. */
|
|
400
|
+
toolParameterRejections: Schema.optionalKey(Schema.Array(ToolParameterRejection)),
|
|
401
|
+
toolExposure: Schema.optionalKey(Snapshot),
|
|
402
|
+
runId: RunId,
|
|
403
|
+
turnId: TurnId,
|
|
404
|
+
turn: TurnNumber,
|
|
405
|
+
messages: PersistedResponseMessages,
|
|
406
|
+
/**
|
|
407
|
+
* Number of leading messages that belong only to this Run's evaluated instructions and wake
|
|
408
|
+
* input. They remain canonical. An unfinished Run retains this exact evaluated prefix;
|
|
409
|
+
* subsequent Runs retain its original user intent in conversation history.
|
|
410
|
+
*/
|
|
411
|
+
runScopedPrefixLength: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
412
|
+
/**
|
|
413
|
+
* Exact normalized usage for every model call staged into this Turn. A
|
|
414
|
+
* summarizer and the Turn response are distinct entries. Unmetered responses can omit it.
|
|
415
|
+
*/
|
|
416
|
+
modelUsage: Schema.optionalKey(Schema.Array(ModelCallUsage)),
|
|
417
|
+
/** Observed invocations without retained accounting before this Turn committed. */
|
|
418
|
+
unobservedModelCalls: Schema.optionalKey(Schema.Natural),
|
|
419
|
+
/** Aggregate observed usage when per-call accounting is unavailable. */
|
|
420
|
+
inputTokens: Schema.optionalKey(Schema.Natural),
|
|
421
|
+
outputTokens: Schema.optionalKey(Schema.Natural),
|
|
422
|
+
/** Estimated spend staged with the usage; recovery re-seeds the cost budget (RUN-023). */
|
|
423
|
+
costMicrousd: Schema.optionalKey(Schema.Natural)
|
|
424
|
+
}).check(Schema.makeFilter((response) => {
|
|
425
|
+
const declarations = response.messages.content.flatMap((message) => message.role === "assistant" && typeof message.content !== "string" ? message.content.filter((part) => part.type === "tool-call" && part.providerExecuted !== true) : []);
|
|
426
|
+
if (declarations.length !== response.toolOperations.length) return false;
|
|
427
|
+
const seen = /* @__PURE__ */ new Set();
|
|
428
|
+
for (const operation of response.toolOperations) {
|
|
429
|
+
if (seen.has(operation.toolCallId) || !declarations.some((call) => call.type === "tool-call" && call.id === operation.toolCallId && call.name === operation.toolName)) return false;
|
|
430
|
+
seen.add(operation.toolCallId);
|
|
431
|
+
}
|
|
432
|
+
return response.runScopedPrefixLength === void 0 || response.runScopedPrefixLength <= response.messages.content.length && response.messages.content.slice(0, response.runScopedPrefixLength).every((message) => message.role === "system" || message.role === "user");
|
|
433
|
+
}, { title: "Model response has unique original Tool operation evidence and a valid instruction/wake prefix" }));
|
|
434
|
+
var ModelResponseRecorded = class extends Schema.TaggedClass("@effect-agent/thread/ModelResponseRecorded")("ModelResponseRecorded", ModelResponseRecordedFields) {};
|
|
435
|
+
/** Monotonic reservations charged before programmatic execution or grace finalization. */
|
|
436
|
+
var RunPolicyUsageReserved = class extends Schema.TaggedClass()("RunPolicyUsageReserved", {
|
|
437
|
+
runId: RunId,
|
|
438
|
+
programmaticToolCalls: RunPolicyUsage.fields.programmaticToolCalls,
|
|
439
|
+
finalizationUsed: RunPolicyUsage.fields.finalizationUsed
|
|
440
|
+
}) {};
|
|
441
|
+
/**
|
|
442
|
+
* A durable Unknown Outcome: the external effect of one declared ordinary Tool Call may have
|
|
443
|
+
* happened but was not confirmed canonically (DUR-009/DUR-017). It is neither success nor
|
|
444
|
+
* ordinary failure; automatic continuation stops until an authorized resolution arrives.
|
|
445
|
+
*/
|
|
446
|
+
var ToolCallUnknown = class extends Schema.TaggedClass("@effect-agent/thread/ToolCallUnknown")("ToolCallUnknown", {
|
|
447
|
+
runId: RunId,
|
|
448
|
+
turn: TurnNumber,
|
|
449
|
+
toolCallId: ToolCallId,
|
|
450
|
+
toolName: BoundedName,
|
|
451
|
+
reason: BoundedText
|
|
452
|
+
}) {};
|
|
453
|
+
/** How one open/unknown Tool Call was authoritatively closed (DUR-017 resolution audit). */
|
|
454
|
+
const ToolCallResolution = Schema.Literals([
|
|
455
|
+
"completed-with-result",
|
|
456
|
+
"failed-with-error",
|
|
457
|
+
"never-started",
|
|
458
|
+
"safe-retry"
|
|
459
|
+
]);
|
|
460
|
+
/**
|
|
461
|
+
* The canonical audit record closing one open or unknown Tool Call: reconciler-recovered supplier
|
|
462
|
+
* truth or an authorized `resolveUnknown` command. `author`/`reason` make every resolution an
|
|
463
|
+
* attributable decision (DUR-017); a `completed-with-result` resolution is accompanied by the
|
|
464
|
+
* per-call `ToolCallSettled` record carrying the recovered result.
|
|
465
|
+
*/
|
|
466
|
+
var ToolCallResolved = class extends Schema.TaggedClass("@effect-agent/thread/ToolCallResolved")("ToolCallResolved", {
|
|
467
|
+
runId: RunId,
|
|
468
|
+
toolCallId: ToolCallId,
|
|
469
|
+
resolution: ToolCallResolution,
|
|
470
|
+
author: BoundedName,
|
|
471
|
+
reason: BoundedText
|
|
472
|
+
}) {};
|
|
473
|
+
/**
|
|
474
|
+
* One accepted Durable Step result (durability §11): exactly-once-recorded while the Step's
|
|
475
|
+
* external side effect stays honestly at-least-once-executed. Only success is recorded — a failing
|
|
476
|
+
* Step body fails into the handler's error channel and re-executes on re-entry. `output` is the
|
|
477
|
+
* Schema-encoded Step output; `outputDigest` pins it for replay-divergence detection.
|
|
478
|
+
*/
|
|
479
|
+
var ToolStepSettled = class extends Schema.TaggedClass("@effect-agent/thread/ToolStepSettled")("ToolStepSettled", {
|
|
480
|
+
runId: RunId,
|
|
481
|
+
toolCallId: ToolCallId,
|
|
482
|
+
stepName: BoundedName,
|
|
483
|
+
output: PersistedJson,
|
|
484
|
+
outputDigest: Digest
|
|
485
|
+
}) {};
|
|
486
|
+
/**
|
|
487
|
+
* A canonical approval request for one declared Tool Call (CAP-006, durability §8): with this
|
|
488
|
+
* record durable, "waiting for explicit approval" is a safe suspension boundary — the resumed
|
|
489
|
+
* Attempt replays the declared batch instead of re-invoking the model.
|
|
490
|
+
*/
|
|
491
|
+
var ToolApprovalRequested = class extends Schema.TaggedClass("@effect-agent/thread/ToolApprovalRequested")("ToolApprovalRequested", {
|
|
492
|
+
runId: RunId,
|
|
493
|
+
turnId: TurnId,
|
|
494
|
+
turn: TurnNumber,
|
|
495
|
+
toolCallId: ToolCallId,
|
|
496
|
+
toolName: BoundedName,
|
|
497
|
+
parametersDigest: Digest,
|
|
498
|
+
/** This request preceded every possible dispatch of the original response. */
|
|
499
|
+
blocksInitialDispatch: Schema.Boolean
|
|
500
|
+
}) {};
|
|
501
|
+
/** The two-valued approval decision family shared by canonical records and ledger intents. */
|
|
502
|
+
const ApprovalDecision = Schema.Literals(["approved", "denied"]);
|
|
503
|
+
/**
|
|
504
|
+
* The canonical decision for one requested approval. Appended by the deciding Attempt (policy
|
|
505
|
+
* auto-decisions) or by the resuming Attempt after a durable `resolveApproval` intent; it is the
|
|
506
|
+
* deterministic decision authority for every later Attempt of the same Run.
|
|
507
|
+
*/
|
|
508
|
+
var ToolApprovalDecided = class extends Schema.TaggedClass("@effect-agent/thread/ToolApprovalDecided")("ToolApprovalDecided", {
|
|
509
|
+
runId: RunId,
|
|
510
|
+
turn: TurnNumber,
|
|
511
|
+
toolCallId: ToolCallId,
|
|
512
|
+
decision: ApprovalDecision,
|
|
513
|
+
resolver: BoundedName,
|
|
514
|
+
reason: BoundedText
|
|
515
|
+
}) {};
|
|
516
|
+
/**
|
|
517
|
+
* A Run resumed inference without a retained response. One marker makes usage coverage
|
|
518
|
+
* incomplete; it does not count missing provider calls or retain Attempt history.
|
|
519
|
+
*/
|
|
520
|
+
var ModelResponseInterrupted = class extends Schema.TaggedClass("@effect-agent/thread/ModelResponseInterrupted")("ModelResponseInterrupted", { runId: RunId }) {};
|
|
521
|
+
/** Disposable call cancellation: no response or Tool declaration is canonical. */
|
|
522
|
+
var ModelCallAborted = class extends Schema.TaggedClass()("ModelCallAborted", {
|
|
523
|
+
runId: RunId,
|
|
524
|
+
turnId: TurnId,
|
|
525
|
+
turn: TurnNumber,
|
|
526
|
+
restart: Schema.Int.check(Schema.isBetween({
|
|
527
|
+
minimum: 1,
|
|
528
|
+
maximum: 2
|
|
529
|
+
})),
|
|
530
|
+
reason: Schema.Literal("joined-input"),
|
|
531
|
+
modelUsage: Schema.Array(ModelCallUsage),
|
|
532
|
+
unobservedModelCalls: Schema.Natural
|
|
533
|
+
}) {};
|
|
534
|
+
/**
|
|
535
|
+
* One engine-native compaction committed before the pre-Turn view changes (RUN-026).
|
|
536
|
+
* `coversThrough` is a Thread record sequence: the projection
|
|
537
|
+
* renders records at or below it as a summary (`summarize`), a fresh window (`rollover`), or with
|
|
538
|
+
* cleared tool results (kind `clear-tool-results`), never erasing source
|
|
539
|
+
* history. The record carries no digest by decision: it is appended by the
|
|
540
|
+
* fenced owner into the very log it covers, and re-verifying a digest would
|
|
541
|
+
* re-read the covered range on every wake — the O(history) work compaction
|
|
542
|
+
* exists to remove. Host-supplied ContextCompactor decisions use this same commit path.
|
|
543
|
+
* Summaries exceeding BoundedText are rejected before append, never truncated.
|
|
544
|
+
* `summary` is present exactly for `summarize` records; the projection
|
|
545
|
+
* treats a summarize record without one as invalid and ignores it fail-safe.
|
|
546
|
+
*/
|
|
547
|
+
var CompactionCreated = class extends Schema.TaggedClass("@effect-agent/thread/CompactionCreated")("CompactionCreated", {
|
|
548
|
+
runId: RunId,
|
|
549
|
+
turn: TurnNumber,
|
|
550
|
+
kind: Schema.Literals([
|
|
551
|
+
"clear-tool-results",
|
|
552
|
+
"summarize",
|
|
553
|
+
"rollover"
|
|
554
|
+
]),
|
|
555
|
+
coversThrough: CanonicalSequence,
|
|
556
|
+
summary: Schema.optionalKey(BoundedText),
|
|
557
|
+
handoff: Schema.optionalKey(ContextHandoff)
|
|
558
|
+
}) {};
|
|
559
|
+
var RunFailed = class extends Schema.TaggedClass("@effect-agent/thread/RunFailed")("RunFailed", {
|
|
560
|
+
runId: RunId,
|
|
561
|
+
failure: PersistedJson
|
|
562
|
+
}) {};
|
|
563
|
+
const RunCompletedFields = Schema.Struct({
|
|
564
|
+
runId: RunId,
|
|
565
|
+
output: PersistedJson,
|
|
566
|
+
/** Integrity of validated terminal values, independent of future application codecs. */
|
|
567
|
+
/** Application disposition captured with an ordinary completion. */
|
|
568
|
+
runDisposition: Schema.optionalKey(PersistedJson),
|
|
569
|
+
/** Honest soft-landing marker, present exactly when `exhausted` is present. */
|
|
570
|
+
finishReason: Schema.optionalKey(Schema.Literal("budget-exhausted")),
|
|
571
|
+
/** Budget dimension paired with `finishReason` on a soft landing. */
|
|
572
|
+
exhausted: Schema.optionalKey(ExhaustedLimit)
|
|
573
|
+
}).check(Schema.makeFilter((completed) => completed.finishReason === void 0 === (completed.exhausted === void 0) && (completed.runDisposition === void 0 || completed.finishReason === void 0), { title: "Run completion metadata matches its terminal family" }));
|
|
574
|
+
var RunCompleted = class extends Schema.TaggedClass("@effect-agent/thread/RunCompleted")("RunCompleted", RunCompletedFields) {};
|
|
575
|
+
var RepairAnnotated = class extends Schema.TaggedClass("@effect-agent/thread/RepairAnnotated")("RepairAnnotated", {
|
|
576
|
+
reason: BoundedText,
|
|
577
|
+
details: PersistedJson
|
|
578
|
+
}) {};
|
|
579
|
+
/** Terminal outcome family for one accepted Submission (DUR-002). */
|
|
580
|
+
const SettlementOutcome = Schema.Literals([
|
|
581
|
+
"completed",
|
|
582
|
+
"failed",
|
|
583
|
+
"aborted"
|
|
584
|
+
]);
|
|
585
|
+
/**
|
|
586
|
+
* A durable abort command made canonical before the active worker is interrupted (DUR-012).
|
|
587
|
+
* Repeating the same abort command is idempotent; abort never rewrites a prior terminal outcome.
|
|
588
|
+
*/
|
|
589
|
+
var AbortRequested = class extends Schema.TaggedClass("@effect-agent/thread/AbortRequested")("AbortRequested", {
|
|
590
|
+
submissionId: SubmissionId,
|
|
591
|
+
author: BoundedName,
|
|
592
|
+
reason: BoundedText
|
|
593
|
+
}) {};
|
|
594
|
+
/**
|
|
595
|
+
* The single canonical settlement record owed to one accepted Submission (DUR-002, DUR-011).
|
|
596
|
+
* Canonical history is the outcome authority: the ledger row is finalized from this record and
|
|
597
|
+
* never the other way around (DUR-015).
|
|
598
|
+
*/
|
|
599
|
+
const RawSubmissionSettled = Schema.Struct({
|
|
600
|
+
submissionId: SubmissionId,
|
|
601
|
+
settlementId: SettlementId,
|
|
602
|
+
receiptId: ReceiptId,
|
|
603
|
+
outcome: SettlementOutcome,
|
|
604
|
+
runId: Schema.optionalKey(RunId),
|
|
605
|
+
/** Number of retained owning facts through this terminal commit, excluding mutable progress. */
|
|
606
|
+
historyRecordCount: Schema.optionalKey(Schema.Natural),
|
|
607
|
+
result: Schema.optionalKey(PersistedJson),
|
|
608
|
+
/**
|
|
609
|
+
* Application-defined, Schema-encoded disposition for an ordinary completed
|
|
610
|
+
* Run. Absent for budget exhaustion and every non-completed or run-less
|
|
611
|
+
* settlement; consumers decode it with the application definition's Schema.
|
|
612
|
+
*/
|
|
613
|
+
runDisposition: Schema.optionalKey(PersistedJson),
|
|
614
|
+
/**
|
|
615
|
+
* Present only when a `completed` Run settled through the final-answer
|
|
616
|
+
* exhaustion resolution (RUN-011, RUN-018): the durable log must be able to
|
|
617
|
+
* distinguish honest-exhaustion completion from ordinary completion without
|
|
618
|
+
* the live event stream. Absent for every ordinary settlement, keeping
|
|
619
|
+
* existing histories and goldens byte-stable (additive, schemaVersion 1).
|
|
620
|
+
*/
|
|
621
|
+
finishReason: Schema.optionalKey(Schema.Literal("budget-exhausted")),
|
|
622
|
+
/**
|
|
623
|
+
* The dimension that bound a budget-exhausted completion (RUN-011,
|
|
624
|
+
* RUN-025), carried verbatim from the live `RunCompleted` event so
|
|
625
|
+
* consumers never reconstruct it from message text. Valid only alongside
|
|
626
|
+
* `finishReason: "budget-exhausted"`; absent on histories persisted before
|
|
627
|
+
* the dimension became durable (additive, schemaVersion 1).
|
|
628
|
+
*/
|
|
629
|
+
exhausted: Schema.optionalKey(ExhaustedLimit),
|
|
630
|
+
/**
|
|
631
|
+
* The typed `AgentPolicyError.limit` of a `failed` hard-rail settlement
|
|
632
|
+
* (RUN-011): which finite policy dimension failed the Run, preserved
|
|
633
|
+
* alongside the bounded `{errorTag, message}` failure projection in
|
|
634
|
+
* `result`. Absent for every non-policy failure and on histories persisted
|
|
635
|
+
* before the limit became durable (additive, schemaVersion 1).
|
|
636
|
+
*/
|
|
637
|
+
policyLimit: Schema.optionalKey(PolicyLimit),
|
|
638
|
+
/** Canonical aggregate of all priced model calls made by this Run. */
|
|
639
|
+
usageSummary: Schema.optionalKey(RunUsageSummary),
|
|
640
|
+
/** Calls included in usageSummary but not in any ModelResponseRecorded, retained on failure. */
|
|
641
|
+
uncommittedModelUsage: Schema.optionalKey(Schema.Array(ModelCallUsage))
|
|
642
|
+
});
|
|
643
|
+
const isPolicyFailureProjection = Schema.is(Schema.Struct({ errorTag: Schema.Literal("AgentPolicyError") }));
|
|
644
|
+
const decodeSettlementFailureDiagnostic = Schema.decodeUnknownOption(SettlementFailureDiagnostic, { onExcessProperty: "error" });
|
|
645
|
+
const hasValidSettlementFamily = (settled) => (settled.finishReason === void 0 || settled.outcome === "completed") && settled.finishReason === void 0 === (settled.exhausted === void 0) && (settled.usageSummary === void 0 || settled.runId !== void 0) && (settled.uncommittedModelUsage === void 0 || settled.runId !== void 0 && settled.usageSummary !== void 0) && (settled.runDisposition === void 0 || settled.outcome === "completed" && settled.finishReason === void 0 && settled.runId !== void 0 && settled.result !== void 0) && (settled.outcome !== "failed" || Option.isSome(decodeSettlementFailureDiagnostic(settled.result))) && (settled.outcome !== "aborted" || settled.result === void 0) && (settled.policyLimit === void 0 || settled.outcome === "failed" && isPolicyFailureProjection(settled.result));
|
|
646
|
+
const SubmissionSettledFields = RawSubmissionSettled.check(Schema.makeFilter(hasValidSettlementFamily, { title: "failed settlements require a bounded diagnostic; aborted settlements carry no result; budget metadata must match its settlement family" }));
|
|
647
|
+
var SubmissionSettled = class extends Schema.TaggedClass("@effect-agent/thread/SubmissionSettled")("SubmissionSettled", SubmissionSettledFields) {};
|
|
648
|
+
/**
|
|
649
|
+
* Canonical-boundary view of `SubmissionSettled`: `finishReason` is valid
|
|
650
|
+
* only on a `completed` outcome, `exhausted` only alongside
|
|
651
|
+
* `finishReason: "budget-exhausted"`, every `failed` outcome requires the exact bounded
|
|
652
|
+
* `SettlementFailureDiagnostic`, aborted outcomes carry no result, and `policyLimit` only occurs
|
|
653
|
+
* on a `failed` outcome whose diagnostic carries the `AgentPolicyError` tag. `runDisposition`
|
|
654
|
+
* occurs only on an ordinary completed settlement with a Run —
|
|
655
|
+
* so a malformed persisted combination such as
|
|
656
|
+
* `{ outcome: "failed", finishReason: "budget-exhausted" }` or a
|
|
657
|
+
* `policyLimit` contradicting `result.errorTag` fails closed at decode
|
|
658
|
+
* instead of becoming trusted audit history (STORE-006, RUN-011).
|
|
659
|
+
*/
|
|
660
|
+
const SubmissionSettledRecord = SubmissionSettled.pipe(Schema.refine((settled) => hasValidSettlementFamily(settled), { expected: "failed settlements require a bounded diagnostic, aborted settlements carry no result, finishReason only occurs on completed settlements, exhausted only occurs with finishReason budget-exhausted, runDisposition only occurs on an ordinary completed settlement with a Run result, and policyLimit only occurs on a failed AgentPolicyError settlement" }));
|
|
661
|
+
/**
|
|
662
|
+
* PARENT-log record of one durable child establishment request:
|
|
663
|
+
* the exact parent Tool Call, delegation and target identity, the digests that pin the child's
|
|
664
|
+
* Binding/input/grant, the fenced budget reservation, and the INTENDED child identity derived
|
|
665
|
+
* deterministically from the parent Run and Tool Call pair (D4). `childInput` carries the
|
|
666
|
+
* prepared child input in encoded form (D3) so recovery can complete child admission from this
|
|
667
|
+
* record alone — no live delegation handler is required. `childPrincipal`/`childIdempotencyKey`
|
|
668
|
+
* carry the ledger admission scope with the ledger's exact bounds; the layering keeps their
|
|
669
|
+
* branded Schemas in the ledger port.
|
|
670
|
+
*/
|
|
671
|
+
var SubagentRequested = class extends Schema.TaggedClass("@effect-agent/thread/SubagentRequested")("SubagentRequested", {
|
|
672
|
+
runId: RunId,
|
|
673
|
+
turnId: TurnId,
|
|
674
|
+
turn: TurnNumber,
|
|
675
|
+
toolCallId: ToolCallId,
|
|
676
|
+
delegationId: DelegationId,
|
|
677
|
+
targetAgentId: AgentId,
|
|
678
|
+
targetDigests: DefinitionDigests,
|
|
679
|
+
childInput: PersistedJson,
|
|
680
|
+
childInputDigest: Digest,
|
|
681
|
+
grantDigest: Digest,
|
|
682
|
+
reservationId: BoundedName,
|
|
683
|
+
reservationDigest: Digest,
|
|
684
|
+
childThreadId: ThreadId,
|
|
685
|
+
childPrincipal: BoundedName,
|
|
686
|
+
childIdempotencyKey: BoundedName,
|
|
687
|
+
/** Effective invocation bound, already clamped to the delegation and child Definition. */
|
|
688
|
+
toolCallAllowance: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
689
|
+
policy: Schema.optionalKey(Schema.toCodecJson(AgentPolicy)),
|
|
690
|
+
budget: Schema.optionalKey(SubagentBudgetReservation),
|
|
691
|
+
grant: Schema.optionalKey(SubagentGrant),
|
|
692
|
+
depth: Schema.optionalKey(DelegationDepth)
|
|
693
|
+
}) {};
|
|
694
|
+
/**
|
|
695
|
+
* PARENT-log record that the intended child exists as accepted work:
|
|
696
|
+
* the full established child identity. It is appended only after the child Receipt
|
|
697
|
+
* exists — SUB-017 holds by construction because `childReceiptId` is a required field.
|
|
698
|
+
*/
|
|
699
|
+
var SubagentStarted = class extends Schema.TaggedClass("@effect-agent/thread/SubagentStarted")("SubagentStarted", {
|
|
700
|
+
runId: RunId,
|
|
701
|
+
toolCallId: ToolCallId,
|
|
702
|
+
childThreadId: ThreadId,
|
|
703
|
+
childSubmissionId: SubmissionId,
|
|
704
|
+
childReceiptId: ReceiptId,
|
|
705
|
+
childRunId: RunId
|
|
706
|
+
}) {};
|
|
707
|
+
/**
|
|
708
|
+
* PARENT-log record of one verified child settlement join:
|
|
709
|
+
* the child's canonical Settlement identity and outcome, the child usage summary, and the FINAL
|
|
710
|
+
* consumed/released accounting decision for the reservation. It commits in ONE atomic batch with
|
|
711
|
+
* the parent `ToolCallSettled` record (SUB-019); `beginChildBudgetRelease` replays
|
|
712
|
+
* `finalAccounting` from this record, so canonical history authorizes the release (DUR-015).
|
|
713
|
+
*/
|
|
714
|
+
var SubagentJoined = class extends Schema.TaggedClass("@effect-agent/thread/SubagentJoined")("SubagentJoined", {
|
|
715
|
+
runId: RunId,
|
|
716
|
+
toolCallId: ToolCallId,
|
|
717
|
+
childSubmissionId: SubmissionId,
|
|
718
|
+
childSettlementId: SettlementId,
|
|
719
|
+
childOutcome: SettlementOutcome,
|
|
720
|
+
usageSummary: PersistedJson,
|
|
721
|
+
usage: Schema.optionalKey(RunTotals),
|
|
722
|
+
delegatedUsage: Schema.optionalKey(RunTotals),
|
|
723
|
+
reservationId: BoundedName,
|
|
724
|
+
finalAccounting: PersistedJson
|
|
725
|
+
}) {};
|
|
726
|
+
/**
|
|
727
|
+
* CHILD-log immutable lineage: the Parent Link plus the digests that pin
|
|
728
|
+
* the child's definition, input, and authority grant. It is the first record after the child's
|
|
729
|
+
* `ThreadCreated` (its own single-record batch, so the generic `thread-created:{cid}`
|
|
730
|
+
* batch identity is never contradicted) and the join path verifies it fail-closed — a fabricated
|
|
731
|
+
* child or parent identity fails Parent Link verification (SUB-004, D10).
|
|
732
|
+
*/
|
|
733
|
+
var SubagentLineageRecorded = class extends Schema.TaggedClass("@effect-agent/thread/SubagentLineageRecorded")("SubagentLineageRecorded", {
|
|
734
|
+
parentLink: SubagentParentLink,
|
|
735
|
+
parentSubmissionId: SubmissionId,
|
|
736
|
+
childDefinitionDigests: DefinitionDigests,
|
|
737
|
+
childInputDigest: Digest,
|
|
738
|
+
grantDigest: Digest,
|
|
739
|
+
/** Copied from the canonical request before readiness; restored for every child Attempt. */
|
|
740
|
+
toolCallAllowance: SubagentRequested.fields.toolCallAllowance,
|
|
741
|
+
policy: SubagentRequested.fields.policy,
|
|
742
|
+
budget: SubagentRequested.fields.budget,
|
|
743
|
+
grant: SubagentRequested.fields.grant
|
|
744
|
+
}) {};
|
|
745
|
+
const WorkerReportingIntent = Schema.Struct({
|
|
746
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
747
|
+
mode: Schema.optionalKey(Schema.Literal("standard")),
|
|
748
|
+
sourceDigests: DefinitionDigests,
|
|
749
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
750
|
+
destinationDelegationId: Schema.optionalKey(DelegationId),
|
|
751
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
752
|
+
returnAddress: Schema.optionalKey(Schema.Struct({
|
|
753
|
+
input: PersistedJson,
|
|
754
|
+
principal: Principal,
|
|
755
|
+
policy: Schema.toCodecJson(AgentPolicy),
|
|
756
|
+
depth: Schema.Natural,
|
|
757
|
+
grant: Schema.optionalKey(SubagentGrant),
|
|
758
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
759
|
+
workerAdmission: Schema.optionalKey(PersistedJson)
|
|
760
|
+
}))
|
|
761
|
+
}).check(Schema.makeFilter((value) => value.mode === "standard" === (value.returnAddress !== void 0)));
|
|
762
|
+
/** Exact successful predecessor evidence; a locator alone grants no authority. */
|
|
763
|
+
const WorkerContinuation = Schema.Struct({
|
|
764
|
+
worker: WorkerRef,
|
|
765
|
+
receipt: Receipt,
|
|
766
|
+
settlementId: SettlementId
|
|
767
|
+
}).check(Schema.makeFilter((value) => value.worker.threadId === value.receipt.threadId));
|
|
768
|
+
/** Immutable worker Thread origin. Each input has its own digest and parameters separately. */
|
|
769
|
+
const WorkerOrigin = Schema.Struct({
|
|
770
|
+
worker: WorkerRef,
|
|
771
|
+
source: WorkerSource,
|
|
772
|
+
/** A new assignment may continue this completed, immutable predecessor. */
|
|
773
|
+
continuationOf: Schema.optionalKey(WorkerContinuation),
|
|
774
|
+
/** Frozen funding owner; worker-run renews only for a new native Run. */
|
|
775
|
+
budgetScope: WorkerBudgetScope,
|
|
776
|
+
/** Frozen at worker creation; older origins remain reusable. */
|
|
777
|
+
lifecycle: Schema.optionalKey(Schema.Literal("assignment")),
|
|
778
|
+
targetDigests: DefinitionDigests,
|
|
779
|
+
policy: Schema.toCodecJson(AgentPolicy),
|
|
780
|
+
budget: SubagentBudgetReservation,
|
|
781
|
+
grant: SubagentGrant,
|
|
782
|
+
depth: DelegationDepth,
|
|
783
|
+
toolCallAllowance: Schema.optionalKey(Schema.Int.check(Schema.isGreaterThan(0))),
|
|
784
|
+
firstMessageId: IdempotencyKey,
|
|
785
|
+
createdAtMillis: Schema.Natural,
|
|
786
|
+
expiresAtMillis: Schema.Natural,
|
|
787
|
+
/** Exact source registration owns projection; absence means reporting was not declared. */
|
|
788
|
+
reporting: Schema.optionalKey(WorkerReportingIntent)
|
|
789
|
+
}).check(Schema.makeFilter((value) => value.expiresAtMillis > value.createdAtMillis));
|
|
790
|
+
/** Frozen per-input metadata; it grants no attached-child or parent-abort semantics. */
|
|
791
|
+
const WorkerAdmission = Schema.Struct({
|
|
792
|
+
origin: WorkerOrigin,
|
|
793
|
+
/** Run executing this handoff, independently of immutable lineage and subtree funding. */
|
|
794
|
+
executionRunId: Schema.NullOr(RunId),
|
|
795
|
+
messageId: IdempotencyKey,
|
|
796
|
+
parameters: PersistedJson,
|
|
797
|
+
createdAtMillis: Schema.Natural,
|
|
798
|
+
/** Host-bound source input whose subtree funds this input; never chosen by a model. */
|
|
799
|
+
sourceSubmissionId: Schema.optionalKey(SubmissionId),
|
|
800
|
+
/** Enables routed receipt lookup when the delivery is owned by a reporting child. */
|
|
801
|
+
deliveryPrincipal: Schema.optionalKey(Principal),
|
|
802
|
+
/** Proven framework updates use a separate bounded input-capacity partition. */
|
|
803
|
+
reportKind: Schema.optionalKey(Schema.Literal("update"))
|
|
804
|
+
});
|
|
805
|
+
/** Owner command retained before the destination inbox is sealed. */
|
|
806
|
+
var WorkerStopRequested = class extends Schema.TaggedClass()("WorkerStopRequested", {
|
|
807
|
+
command: WorkerStop,
|
|
808
|
+
principal: Principal,
|
|
809
|
+
sourceSubmissionId: Schema.optionalKey(SubmissionId)
|
|
810
|
+
}) {};
|
|
811
|
+
/** The named canonical obligation closed only after its owning state durably completes. */
|
|
812
|
+
var WorkHandoffCompleted = class extends Schema.TaggedClass()("WorkHandoffCompleted", {
|
|
813
|
+
preparationId: RecordId,
|
|
814
|
+
ownerId: Schema.NonEmptyString.check(Schema.isMaxLength(4096))
|
|
815
|
+
}) {};
|
|
816
|
+
/** Source-log capacity reservation, retained independently of the source Run's settlement. */
|
|
817
|
+
var WorkerInputRequested = class extends Schema.TaggedClass()("WorkerInputRequested", {
|
|
818
|
+
admission: WorkerAdmission,
|
|
819
|
+
inputDigest: Digest
|
|
820
|
+
}) {};
|
|
821
|
+
/** Child-log origin, reconstructed from a retained delivery before the child becomes ready. */
|
|
822
|
+
var WorkerOriginRecorded = class extends Schema.TaggedClass()("WorkerOriginRecorded", { origin: WorkerOrigin }) {};
|
|
823
|
+
/** Canonical child completion acknowledgement releases only this input's active capacity. */
|
|
824
|
+
var WorkerInputCompleted = class extends Schema.TaggedClass()("WorkerInputCompleted", {
|
|
825
|
+
messageId: IdempotencyKey,
|
|
826
|
+
workerThreadId: ThreadId,
|
|
827
|
+
submissionId: SubmissionId,
|
|
828
|
+
receiptId: ReceiptId,
|
|
829
|
+
settlementId: SettlementId,
|
|
830
|
+
completedAtMillis: Schema.Natural,
|
|
831
|
+
/** New acknowledgements prove that this input's external effects are resolved. */
|
|
832
|
+
effectsResolved: Schema.optionalKey(Schema.Literal(true))
|
|
833
|
+
}) {};
|
|
834
|
+
/**
|
|
835
|
+
* Frozen report decision for one actual Run, shared by every joined Receipt. The envelope is
|
|
836
|
+
* a Schema-encoded PreparedInput, committed atomically with its initial delivery row.
|
|
837
|
+
* Keeping the encoded value here avoids a Records/PreparedInput schema dependency cycle.
|
|
838
|
+
*/
|
|
839
|
+
var WorkerReportPrepared = class extends Schema.TaggedClass()("WorkerReportPrepared", {
|
|
840
|
+
runId: RunId,
|
|
841
|
+
messageId: IdempotencyKey,
|
|
842
|
+
envelope: PersistedJson,
|
|
843
|
+
createdAtMillis: Schema.Natural,
|
|
844
|
+
deadlineAtMillis: Schema.Natural,
|
|
845
|
+
predecessor: Schema.optionalKey(IdempotencyKey)
|
|
846
|
+
}) {};
|
|
847
|
+
/** Accepted update and its optional parent outbox row commit with this canonical fact. */
|
|
848
|
+
var AgentUpdateEmitted = class extends Schema.TaggedClass()("AgentUpdateEmitted", {
|
|
849
|
+
update: Update,
|
|
850
|
+
definitions: DefinitionDigests,
|
|
851
|
+
delivery: Schema.optionalKey(Schema.Struct({
|
|
852
|
+
messageId: IdempotencyKey,
|
|
853
|
+
envelope: PersistedJson,
|
|
854
|
+
createdAtMillis: Schema.Natural,
|
|
855
|
+
deadlineAtMillis: Schema.Natural,
|
|
856
|
+
predecessor: Schema.optionalKey(IdempotencyKey)
|
|
857
|
+
}))
|
|
858
|
+
}) {};
|
|
859
|
+
/** Permanent bounded report refusal. Application errors and raw Run dispositions stay private. */
|
|
860
|
+
var WorkerReportRefused = class extends Schema.TaggedClass()("WorkerReportRefused", {
|
|
861
|
+
runId: RunId,
|
|
862
|
+
messageId: IdempotencyKey,
|
|
863
|
+
reason: Schema.Literals([
|
|
864
|
+
"filtered",
|
|
865
|
+
"declaration-unavailable",
|
|
866
|
+
"destination",
|
|
867
|
+
"projection",
|
|
868
|
+
"input",
|
|
869
|
+
"preparation",
|
|
870
|
+
"timeout",
|
|
871
|
+
"defect",
|
|
872
|
+
"expired",
|
|
873
|
+
"denied",
|
|
874
|
+
"capacity"
|
|
875
|
+
])
|
|
876
|
+
}) {};
|
|
877
|
+
/** Frozen peer provenance, committed with its outbox row and readable through routed storage. */
|
|
878
|
+
var PeerMessagePrepared = class extends Schema.TaggedClass()("PeerMessagePrepared", {
|
|
879
|
+
messageId: IdempotencyKey,
|
|
880
|
+
source: WorkerSource,
|
|
881
|
+
sourcePrincipal: Principal,
|
|
882
|
+
operation: Schema.Literals(["send", "reply"]),
|
|
883
|
+
deadlineAtMillis: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
884
|
+
encodedEnvelope: PersistedJson
|
|
885
|
+
}) {};
|
|
886
|
+
/**
|
|
887
|
+
* One disjoint subtree slice shared by attached and background children of a source input.
|
|
888
|
+
* The source keeps its own execution ceiling; descendants spend only the remaining allocation.
|
|
889
|
+
* Reservations include future descendant slots and never refund, including after interruption.
|
|
890
|
+
* resultBytes reserves the terminal/projection result, not cumulative Tool output bytes.
|
|
891
|
+
*/
|
|
892
|
+
var SubtreeBudgetReserved = class extends Schema.TaggedClass()("SubtreeBudgetReserved", {
|
|
893
|
+
reservationId: BoundedName,
|
|
894
|
+
/** Run executing this reservation; null for host-owned follow-ups. Grants no authority. */
|
|
895
|
+
executionRunId: Schema.NullOr(RunId),
|
|
896
|
+
sourceSubmissionId: Schema.optionalKey(SubmissionId),
|
|
897
|
+
childThreadId: ThreadId,
|
|
898
|
+
lifetime: Schema.Literals(["attached", "background"]),
|
|
899
|
+
depth: DelegationDepth,
|
|
900
|
+
policy: Schema.toCodecJson(AgentPolicy),
|
|
901
|
+
grant: SubagentGrant,
|
|
902
|
+
budget: SubagentBudgetReservation
|
|
903
|
+
}) {};
|
|
904
|
+
/** Fact identity; active-only references resolve inside their Run checkpoint. */
|
|
905
|
+
const EvidenceReference = Schema.Struct({ recordId: RecordId });
|
|
906
|
+
/**
|
|
907
|
+
* Receipt-free factual closure. The receiver's irreversible inbox seal precedes its exact-key
|
|
908
|
+
* NotAdmitted observation; a refusal or an absent lookup alone cannot close reserved work.
|
|
909
|
+
* Invocation and allocation charges remain with the original funding Run.
|
|
910
|
+
*/
|
|
911
|
+
var WorkerInputRefused = class extends Schema.TaggedClass()("WorkerInputRefused", Schema.Struct({
|
|
912
|
+
messageId: IdempotencyKey,
|
|
913
|
+
workerThreadId: ThreadId,
|
|
914
|
+
reservation: EvidenceReference,
|
|
915
|
+
stop: EvidenceReference,
|
|
916
|
+
deliveryVersion: Schema.Int.check(Schema.isGreaterThan(0)),
|
|
917
|
+
envelopeDigest: Digest,
|
|
918
|
+
receiver: Schema.Struct({
|
|
919
|
+
threadId: ThreadId,
|
|
920
|
+
principal: Principal,
|
|
921
|
+
idempotencyKey: IdempotencyKey,
|
|
922
|
+
inputDigest: Digest,
|
|
923
|
+
stopped: Schema.Literal(true),
|
|
924
|
+
resolution: Schema.Literal("NotAdmitted")
|
|
925
|
+
})
|
|
926
|
+
}).check(Schema.makeFilter((value) => value.receiver.threadId === value.workerThreadId))) {};
|
|
927
|
+
const MAX_RUN_CONTINUATION_BYTES = 8192;
|
|
928
|
+
/** Incremental record JSON per Turn, including progress and the first Turn's initial context. */
|
|
929
|
+
const MAX_TURN_CANONICAL_BYTES = MAX_CANONICAL_RECORD_BYTES;
|
|
930
|
+
/** Room retained for a bounded terminal failure and its atomic progress publication. */
|
|
931
|
+
const RUN_TERMINAL_RESERVE_BYTES = 262144;
|
|
932
|
+
/** Bounded closing facts remain publishable even after dispatch capacity is exhausted. */
|
|
933
|
+
const MAX_RUN_TERMINAL_BYTES = 8650752;
|
|
934
|
+
const RUN_TERMINAL_RESERVE_RECORDS = 4;
|
|
935
|
+
const MAX_RUN_EVIDENCE_RECORDS = 16384;
|
|
936
|
+
const MAX_RUN_EVIDENCE_BYTES = 33554432;
|
|
937
|
+
const MAX_RUN_RECOVERY_SUFFIX_RECORDS = 64;
|
|
938
|
+
const MAX_RUN_RECOVERY_SUFFIX_BYTES = 2097152;
|
|
939
|
+
const MAX_RUN_TOOL_CALL_IDENTITIES = 4096;
|
|
940
|
+
const ContextEvidenceReference = Schema.Struct({
|
|
941
|
+
...EvidenceReference.fields,
|
|
942
|
+
sequence: CanonicalSequence
|
|
943
|
+
});
|
|
944
|
+
var RunContextRecorded = class extends Schema.TaggedClass()("RunContextRecorded", Schema.Struct({
|
|
945
|
+
version: Schema.Literal(1),
|
|
946
|
+
runId: RunId,
|
|
947
|
+
/** Only evaluated instructions and this Run's input; prior history remains in its facts. */
|
|
948
|
+
runScopedInput: PersistedJson,
|
|
949
|
+
/** Inclusive range; historyThrough + 1 denotes an empty range. */
|
|
950
|
+
historyFrom: CanonicalSequence.check(Schema.isGreaterThan(0)),
|
|
951
|
+
/** Fixed prior-history boundary, immediately before the original accepted input. */
|
|
952
|
+
historyThrough: CanonicalSequence,
|
|
953
|
+
/** Facts below historyFrom still needed after summarize or rollover coverage. */
|
|
954
|
+
retained: Schema.Array(ContextEvidenceReference).check(Schema.isMaxLength(4096)),
|
|
955
|
+
/** Pins the projected prior Prompt, not a second copy or a per-record manifest. */
|
|
956
|
+
historyDigest: Digest,
|
|
957
|
+
priorHistoryLength: Schema.Natural,
|
|
958
|
+
contextWindowId: Schema.optionalKey(BoundedName)
|
|
959
|
+
}).check(Schema.makeFilter((context) => context.historyFrom <= context.historyThrough + 1 && context.retained.every((ref, index) => ref.sequence > (context.retained[index - 1]?.sequence ?? 0) && ref.sequence < context.historyFrom), { title: "Saved context retains an ordered prefix below its original history range" }))) {};
|
|
960
|
+
/** Accumulated charges; replacement Attempts never replenish or charge these again. */
|
|
961
|
+
const ContinuationAccounting = Schema.Struct({
|
|
962
|
+
...RunPolicyUsage.fields,
|
|
963
|
+
modelRestarts: Schema.Int.check(Schema.isBetween({
|
|
964
|
+
minimum: 0,
|
|
965
|
+
maximum: 2
|
|
966
|
+
})),
|
|
967
|
+
modelCalls: Schema.Natural,
|
|
968
|
+
unobservedModelCalls: Schema.Natural,
|
|
969
|
+
inputTokens: Schema.Natural,
|
|
970
|
+
outputTokens: Schema.Natural,
|
|
971
|
+
lastInputTokens: Schema.Natural,
|
|
972
|
+
lastOutputTokens: Schema.Natural,
|
|
973
|
+
costMicrousd: Schema.Natural,
|
|
974
|
+
/** The last complete operation batch whose declaration-ordered failure streak was charged. */
|
|
975
|
+
accountedToolTurn: Schema.Natural
|
|
976
|
+
});
|
|
977
|
+
/** Semantic execution boundaries, never engine stacks, fibers, or program counters. */
|
|
978
|
+
const RunPosition = Schema.Literals([
|
|
979
|
+
"starting",
|
|
980
|
+
"awaiting-model",
|
|
981
|
+
"processing-operations",
|
|
982
|
+
"waiting-approval",
|
|
983
|
+
"waiting-dependency",
|
|
984
|
+
"unknown",
|
|
985
|
+
"settling",
|
|
986
|
+
"settled"
|
|
987
|
+
]);
|
|
988
|
+
/**
|
|
989
|
+
* Current interpreter progress, replaced atomically with lastFact under the Thread fence.
|
|
990
|
+
* lastFact is the exact accounted frontier of the same commit. References resolve within this
|
|
991
|
+
* Thread's history or its authoritative active checkpoint. Results, operation declarations,
|
|
992
|
+
* approvals and delivery obligations remain canonical; evaluated context and validated completion
|
|
993
|
+
* belong to active state. Neither the checkpoint nor its revision grants execution authority.
|
|
994
|
+
* Retired intermediate revisions are not historical verification evidence.
|
|
995
|
+
*/
|
|
996
|
+
var RunContinuation = class extends Schema.TaggedClass()("RunContinuation", Schema.Struct({
|
|
997
|
+
version: Schema.Literal(1),
|
|
998
|
+
runId: RunId,
|
|
999
|
+
submissionId: SubmissionId,
|
|
1000
|
+
revision: Schema.Natural.check(Schema.isGreaterThan(0)),
|
|
1001
|
+
/** Number of this Run's non-continuation facts accounted for at the frontier. */
|
|
1002
|
+
recordCount: Schema.Natural.check(Schema.isLessThanOrEqualTo(16388)),
|
|
1003
|
+
/** Cumulative committed owning fact bytes, excluding progress; deletion never refunds them. */
|
|
1004
|
+
recordBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(42205184)),
|
|
1005
|
+
/** Logical Turn whose incremental durable commit bytes are currently being charged. */
|
|
1006
|
+
turn: Schema.Natural,
|
|
1007
|
+
turnBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(0xc40000)),
|
|
1008
|
+
/** Closing facts consume the terminal reserve, rather than reserving it again. */
|
|
1009
|
+
terminalBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(MAX_RUN_TERMINAL_BYTES)),
|
|
1010
|
+
terminalRecords: Schema.Natural.check(Schema.isLessThanOrEqualTo(4)),
|
|
1011
|
+
/** Conservative room for terminal usage grouping; derived only from canonical model usage. */
|
|
1012
|
+
terminalUsageBytes: Schema.Natural.check(Schema.isLessThanOrEqualTo(MAX_RUN_EVIDENCE_BYTES)),
|
|
1013
|
+
originalInput: EvidenceReference,
|
|
1014
|
+
savedContext: Schema.optionalKey(EvidenceReference),
|
|
1015
|
+
latestResponse: Schema.optionalKey(EvidenceReference),
|
|
1016
|
+
terminal: Schema.optionalKey(EvidenceReference),
|
|
1017
|
+
lastFact: EvidenceReference,
|
|
1018
|
+
position: RunPosition,
|
|
1019
|
+
accounting: ContinuationAccounting
|
|
1020
|
+
})) {};
|
|
1021
|
+
/** Bump only when the meaning of an existing record changes, independently of SQL layout. */
|
|
1022
|
+
const CURRENT_RECORD_VERSION = 6;
|
|
1023
|
+
const CURRENT_RECORD_FORMAT = "effect-agent/thread@6";
|
|
1024
|
+
/** Durable fact and execution-command schemas. Unsupported controls fail before execution. */
|
|
1025
|
+
const KnownRecordPayload = Schema.Union([
|
|
1026
|
+
ThreadCreated,
|
|
1027
|
+
UserInputRecorded,
|
|
1028
|
+
RunStartedRecord,
|
|
1029
|
+
RunDurationExhausted,
|
|
1030
|
+
RunPolicyUsageReserved,
|
|
1031
|
+
ModelCompleted,
|
|
1032
|
+
ModelResponseRecorded,
|
|
1033
|
+
ToolCallSettled,
|
|
1034
|
+
ToolCallUnknown,
|
|
1035
|
+
ToolCallResolved,
|
|
1036
|
+
ToolStepSettled,
|
|
1037
|
+
ToolApprovalRequested,
|
|
1038
|
+
ToolApprovalDecided,
|
|
1039
|
+
ModelResponseInterrupted,
|
|
1040
|
+
ModelCallAborted,
|
|
1041
|
+
CompactionCreated,
|
|
1042
|
+
RunFailed,
|
|
1043
|
+
RunCompleted,
|
|
1044
|
+
AbortRequested,
|
|
1045
|
+
SubmissionSettledRecord,
|
|
1046
|
+
SubagentRequested,
|
|
1047
|
+
SubagentStarted,
|
|
1048
|
+
SubagentJoined,
|
|
1049
|
+
SubagentLineageRecorded,
|
|
1050
|
+
WorkerInputRequested,
|
|
1051
|
+
WorkerStopRequested,
|
|
1052
|
+
WorkHandoffCompleted,
|
|
1053
|
+
WorkerOriginRecorded,
|
|
1054
|
+
WorkerInputCompleted,
|
|
1055
|
+
WorkerInputRefused,
|
|
1056
|
+
WorkerReportPrepared,
|
|
1057
|
+
AgentUpdateEmitted,
|
|
1058
|
+
WorkerReportRefused,
|
|
1059
|
+
PeerMessagePrepared,
|
|
1060
|
+
SubtreeBudgetReserved,
|
|
1061
|
+
RepairAnnotated,
|
|
1062
|
+
RunContextRecorded,
|
|
1063
|
+
RunContinuation
|
|
1064
|
+
]);
|
|
1065
|
+
/** This format accepts only understood facts; unknown control cannot grant permission. */
|
|
1066
|
+
const CanonicalRecordPayload = KnownRecordPayload;
|
|
1067
|
+
/**
|
|
1068
|
+
* Versioned durable fact. Retained history acquires Thread ordering at its atomic commit;
|
|
1069
|
+
* active operational facts keep their identities without a canonical sequence.
|
|
1070
|
+
*/
|
|
1071
|
+
var RecordEnvelope = class extends Schema.Class("@effect-agent/thread/RecordEnvelope")({
|
|
1072
|
+
recordId: RecordId,
|
|
1073
|
+
family: Schema.Literal("thread"),
|
|
1074
|
+
schemaVersion: Schema.Literal(1),
|
|
1075
|
+
createdAt: Schema.DateTimeUtcFromString,
|
|
1076
|
+
deploymentId: DeploymentId,
|
|
1077
|
+
payload: CanonicalRecordPayload
|
|
1078
|
+
}) {};
|
|
1079
|
+
/** Backward-compatible domain name for a canonical record. */
|
|
1080
|
+
const CanonicalRecord = RecordEnvelope;
|
|
1081
|
+
/** One non-empty, bounded, idempotent atomic append unit. */
|
|
1082
|
+
var CanonicalBatch = class extends Schema.Class("@effect-agent/thread/CanonicalBatch")({
|
|
1083
|
+
batchId: BatchId,
|
|
1084
|
+
producerId: ProducerId,
|
|
1085
|
+
records: Schema.NonEmptyArray(RecordEnvelope).check(Schema.isMaxLength(256))
|
|
1086
|
+
}) {};
|
|
1087
|
+
/**
|
|
1088
|
+
* A committed record with its Thread ordering and opaque resumable observation cursor.
|
|
1089
|
+
*/
|
|
1090
|
+
var CanonicalRecordEnvelope = class extends Schema.Class("@effect-agent/thread/CanonicalRecordEnvelope")({
|
|
1091
|
+
threadId: ThreadId,
|
|
1092
|
+
batchId: BatchId,
|
|
1093
|
+
sequence: CanonicalSequence,
|
|
1094
|
+
offset: ObservationOffset,
|
|
1095
|
+
record: RecordEnvelope
|
|
1096
|
+
}) {};
|
|
1097
|
+
/** Read-only history of validated facts. Original inputs establish Run view boundaries. */
|
|
1098
|
+
const PromptRecordPayload = Schema.TaggedUnion({
|
|
1099
|
+
UserInputRecorded: {
|
|
1100
|
+
runId: UserInputRecorded.fields.runId,
|
|
1101
|
+
kind: UserInputRecorded.fields.kind,
|
|
1102
|
+
submissionId: UserInputRecorded.fields.submissionId
|
|
1103
|
+
},
|
|
1104
|
+
ModelCompleted: {
|
|
1105
|
+
runId: RunId,
|
|
1106
|
+
history: Schema.optionalKey(HistoryPrompt)
|
|
1107
|
+
},
|
|
1108
|
+
ModelResponseRecorded: {
|
|
1109
|
+
runId: RunId,
|
|
1110
|
+
turn: TurnNumber,
|
|
1111
|
+
messages: HistoryPrompt,
|
|
1112
|
+
runScopedPrefixLength: ModelResponseRecorded.fields.runScopedPrefixLength
|
|
1113
|
+
},
|
|
1114
|
+
ToolCallSettled: {
|
|
1115
|
+
runId: RunId,
|
|
1116
|
+
toolCallId: ToolCallId,
|
|
1117
|
+
toolName: BoundedName,
|
|
1118
|
+
result: Schema.Json,
|
|
1119
|
+
isFailure: Schema.Boolean
|
|
1120
|
+
},
|
|
1121
|
+
CompactionCreated: CompactionCreated.fields,
|
|
1122
|
+
RunCompleted: { runId: RunId },
|
|
1123
|
+
RunFailed: { runId: RunId },
|
|
1124
|
+
SubmissionSettled: {
|
|
1125
|
+
runId: Schema.optionalKey(RunId),
|
|
1126
|
+
submissionId: SubmissionId,
|
|
1127
|
+
outcome: SettlementOutcome
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
/** Native selections and the projection decoder share this single list of supported facts. */
|
|
1131
|
+
const PROMPT_EVIDENCE_TAGS = Struct.keys(PromptRecordPayload.cases);
|
|
1132
|
+
const PromptRecord = Schema.Struct({
|
|
1133
|
+
recordId: RecordId,
|
|
1134
|
+
payload: PromptRecordPayload
|
|
1135
|
+
});
|
|
1136
|
+
/** Not integrity evidence: omitted canonical wire must be read through the full record port. */
|
|
1137
|
+
const PromptRecordEnvelope = Schema.Struct({
|
|
1138
|
+
threadId: ThreadId,
|
|
1139
|
+
sequence: CanonicalSequence,
|
|
1140
|
+
record: PromptRecord
|
|
1141
|
+
});
|
|
1142
|
+
const CURRENT_CANONICAL_SCHEMA_VERSION = 1;
|
|
1143
|
+
export { Records_exports as $, MAX_RUN_EVIDENCE_RECORDS as A, WorkHandoffCompleted as At, ObservationOffset as B, WorkerReportingIntent as Bt, MAX_CANONICAL_RECORD_BYTES as C, ToolCallResolved as Ct, MAX_PERSISTED_JSON_NODES as D, ToolStepSettled as Dt, MAX_PERSISTED_JSON_DEPTH as E, ToolOperation as Et, MAX_TURN_CANONICAL_BYTES as F, WorkerInputRequested as Ft, PromptRecord as G, PeerMessagePrepared as H, HistoryMessage as Ht, ModelCallAborted as I, WorkerOrigin as It, RUN_TERMINAL_RESERVE_BYTES as J, PromptRecordEnvelope as K, ModelCompleted as L, WorkerOriginRecorded as Lt, MAX_RUN_RECOVERY_SUFFIX_RECORDS as M, WorkerContinuation as Mt, MAX_RUN_TERMINAL_BYTES as N, WorkerInputCompleted as Nt, MAX_RUN_CONTINUATION_BYTES as O, ToolUnavailable as Ot, MAX_RUN_TOOL_CALL_IDENTITIES as P, WorkerInputRefused as Pt, RecordJson as Q, ModelResponseInterrupted as R, WorkerReportPrepared as Rt, KnownRecordPayload as S, ToolCallResolution as St, MAX_PERSISTED_JSON_COLLECTION_LENGTH as T, ToolCallUnknown as Tt, PersistedJson as U, restoreHistoryMessage as Ut, PROMPT_EVIDENCE_TAGS as V, WorkerStopRequested as Vt, ProducerId as W, RecordEnvelope as X, RUN_TERMINAL_RESERVE_RECORDS as Y, RecordId as Z, DefinitionDigestInput as _, SubmissionSettledRecord as _t, CURRENT_CANONICAL_SCHEMA_VERSION as a, RunDurationExhausted as at, Digest as b, ToolApprovalDecided as bt, CanonicalBatch as c, RunPosition as ct, CanonicalRecordPayload as d, SettlementOutcome as dt, RepairAnnotated as et, CanonicalSequence as f, SubagentJoined as ft, DeclaredToolCall as g, SubmissionSettled as gt, ContinuationAccounting as h, SubagentStarted as ht, BatchId as i, RunContinuation as it, MAX_RUN_RECOVERY_SUFFIX_BYTES as j, WorkerAdmission as jt, MAX_RUN_EVIDENCE_BYTES as k, UserInputRecorded as kt, CanonicalRecord as l, RunStartedRecord as lt, ContextEvidenceReference as m, SubagentRequested as mt, AgentUpdateEmitted as n, RunCompleted as nt, CURRENT_RECORD_FORMAT as o, RunFailed as ot, CompactionCreated as p, SubagentLineageRecorded as pt, PromptRecordPayload as q, ApprovalDecision as r, RunContextRecorded as rt, CURRENT_RECORD_VERSION as s, RunPolicyUsageReserved as st, AbortRequested as t, ReplayContract as tt, CanonicalRecordEnvelope as u, SettlementFailureDiagnostic as ut, DefinitionDigests as v, SubtreeBudgetReserved as vt, MAX_PERSISTED_JSON_BYTES as w, ToolCallSettled as wt, EvidenceReference as x, ToolApprovalRequested as xt, DeploymentId as y, ThreadCreated as yt, ModelResponseRecorded as z, WorkerReportRefused as zt };
|
|
1144
|
+
|
|
1145
|
+
//# sourceMappingURL=Records-C645aQks.mjs.map
|