@systemfsoftware/agent 0.0.0-bootstrap.0 → 0.1.0-beta.192
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Admin-BfolLkHj.d.mts +5678 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/Agent-DSVEpq4e.d.mts +219 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-Dg53p6du.mjs +14 -0
- package/dist/AgentRegistration-Dg53p6du.mjs.map +1 -0
- package/dist/AgentRuntime-CoGy_5dm.d.mts +751 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs +5249 -0
- package/dist/AgentRuntime-CzP4I4RB.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-C9vict2M.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/CommittedActivity-LWOKXqdi.d.mts +62 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-917r7gpv.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs +8432 -0
- package/dist/DurableAgentRuntime-BHXo8GPJ.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/EventSource-C0TCBeIf.d.mts +52 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-4CRzkPBD.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-Dh6GZBt_.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DhM-APnP.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-CubWeYKN.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/Output-SbOdlBFL.d.mts +22 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-BrtZ0g2j.d.mts +14 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PreparedInputAdmission-Ci18uY4s.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-BVAHoYlN.d.mts +127 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-CjVP48I8.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/Scheduling-DYTM29s9.d.mts +57 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-CSIRUgUo.mjs +1315 -0
- package/dist/Subagent-CSIRUgUo.mjs.map +1 -0
- package/dist/Subagent-CXEI5YZ8.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentHost-CKhz1vbH.d.mts +167 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/Subscription-CC--_OnU.d.mts +815 -0
- package/dist/SubscriptionInput-BEeB0Cj8.d.mts +42 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs +53 -0
- package/dist/SubscriptionInput-Xcd4JjEs.mjs.map +1 -0
- package/dist/SubscriptionTransition-CWt9UVH0.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-4K_qu_2f.mjs +638 -0
- package/dist/Subscriptions-4K_qu_2f.mjs.map +1 -0
- package/dist/Subscriptions-BF3aSf8X.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-lTZ8Ftq1.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadImport-DaSmrlRi.d.mts +843 -0
- package/dist/ThreadInvariants-DyPhMeo-.d.mts +23 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadProjectionMaintenance-DjUy7kCa.d.mts +51 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-BM02cbOo.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-VjamzX3q.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-C4-HsMCp.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-CD0V--qh.d.mts +18 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs +162 -0
- package/dist/WorkerAdmission-BhFjx86s.mjs.map +1 -0
- package/dist/WorkerAdmission-BnRuXLWF.d.mts +171 -0
- package/dist/WorkerHost-DtYzi54D.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-CNs2twrr.mjs +262 -0
- package/dist/agent-registration-CNs2twrr.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-CHox63hg.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +489 -5
- package/src/InMemory.ts +79 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/BrowserUse.ts +212 -0
- package/src/capabilities/Budget.ts +544 -0
- package/src/capabilities/CodeMode.ts +1129 -0
- package/src/capabilities/ContextTools.ts +131 -0
- package/src/capabilities/MemoryNotes.ts +177 -0
- package/src/capabilities/Messaging.ts +260 -0
- package/src/capabilities/Redaction.ts +163 -0
- package/src/capabilities/RunHooks.ts +116 -0
- package/src/capabilities/SemanticMemory.ts +402 -0
- package/src/capabilities/Subagent.ts +2343 -0
- package/src/capabilities/SubagentReservations.ts +807 -0
- package/src/capabilities/ToolDiscovery.ts +291 -0
- package/src/capabilities/ToolResults.ts +50 -0
- package/src/capabilities/WebCapture.ts +64 -0
- package/src/capabilities/WebSearch.ts +45 -0
- package/src/capabilities/internal/subagent-background.ts +1137 -0
- package/src/capabilities/internal/subagent-contract.ts +92 -0
- package/src/capabilities/internal/subagent-policy.ts +205 -0
- package/src/capabilities/internal/subagent-reporting.ts +152 -0
- package/src/core/Agent.ts +528 -0
- package/src/core/AgentError.ts +189 -0
- package/src/core/AgentPolicy.ts +194 -0
- package/src/core/AgentUpdates.ts +104 -0
- package/src/core/FailureDiagnostic.ts +392 -0
- package/src/core/IdGenerator.ts +42 -0
- package/src/core/Identifiers.ts +64 -0
- package/src/core/Memory.ts +283 -0
- package/src/core/MemoryNamespace.ts +202 -0
- package/src/core/MemoryReference.ts +120 -0
- package/src/core/MemoryRevalidation.ts +151 -0
- package/src/core/MemoryStore.ts +371 -0
- package/src/core/Messaging.ts +72 -0
- package/src/core/ProvisionalText.ts +53 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +22 -0
- package/src/core/RunEvent.ts +345 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +259 -0
- package/src/core/SemanticMemoryRevalidation.ts +220 -0
- package/src/core/SubagentContract.ts +263 -0
- package/src/core/Thread.ts +447 -0
- package/src/core/ToolExposure.ts +75 -0
- package/src/core/ToolResult.ts +204 -0
- package/src/core/ToolResultStorage.ts +56 -0
- package/src/core/Usage.ts +562 -0
- package/src/core/Worker.ts +236 -0
- package/src/core/internal/agent-updates.ts +42 -0
- package/src/core/internal/completion.ts +33 -0
- package/src/core/internal/json.ts +17 -0
- package/src/core/internal/memory-document.ts +39 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/tool-execution.ts +33 -0
- package/src/core/internal/utf8.ts +32 -0
- package/src/durable/ActivityStore.ts +131 -0
- package/src/durable/Admin.ts +504 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/CommittedActivity.ts +262 -0
- package/src/durable/Digest.ts +57 -0
- package/src/durable/DurableAgentRuntime.ts +12758 -0
- package/src/durable/DurableFailpoint.ts +108 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +179 -0
- package/src/durable/LifecyclePublication.ts +343 -0
- package/src/durable/MessageDelivery.ts +949 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
- package/src/durable/OperationAuthorizer.ts +89 -0
- package/src/durable/PersistentHistory.ts +322 -0
- package/src/durable/PreparedInputAdmission.ts +128 -0
- package/src/durable/RecordFormat.ts +113 -0
- package/src/durable/Records.ts +1396 -0
- package/src/durable/Recovery.ts +1022 -0
- package/src/durable/RunContinuation.ts +1946 -0
- package/src/durable/RunJournal.ts +1926 -0
- package/src/durable/RunStorage.ts +533 -0
- package/src/durable/Schedule.ts +445 -0
- package/src/durable/ScheduleStoreConformance.ts +642 -0
- package/src/durable/ScheduleTransition.ts +267 -0
- package/src/durable/Scheduling.ts +1031 -0
- package/src/durable/SettlementPublisher.ts +172 -0
- package/src/durable/SqlMemoryStore.ts +1042 -0
- package/src/durable/SqlStorageOwner.ts +25 -0
- package/src/durable/SubmissionLedger.ts +1247 -0
- package/src/durable/SubmissionLedgerConformance.ts +4695 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +527 -0
- package/src/durable/SubscriptionInput.ts +145 -0
- package/src/durable/SubscriptionStoreConformance.ts +1275 -0
- package/src/durable/SubscriptionTransition.ts +330 -0
- package/src/durable/Subscriptions.ts +1245 -0
- package/src/durable/ThreadArchiveRange.ts +91 -0
- package/src/durable/ThreadContextHistory.ts +338 -0
- package/src/durable/ThreadContextHistoryProjection.ts +219 -0
- package/src/durable/ThreadImport.ts +1199 -0
- package/src/durable/ThreadInvariants.ts +312 -0
- package/src/durable/ThreadProjectionMaintenance.ts +72 -0
- package/src/durable/ThreadReader.ts +21 -0
- package/src/durable/ThreadStore.ts +1258 -0
- package/src/durable/ThreadStoreConformance.ts +877 -0
- package/src/durable/ThreadTransfer.ts +263 -0
- package/src/durable/ThreadWork.ts +713 -0
- package/src/durable/ToolReconciler.ts +112 -0
- package/src/durable/WakeScheduler.ts +125 -0
- package/src/durable/WorkerAdmission.ts +98 -0
- package/src/durable/WorkerHost.ts +204 -0
- package/src/durable/internal/StorageOwner.ts +181 -0
- package/src/durable/internal/agent-registration.ts +713 -0
- package/src/durable/internal/agent-updates.ts +338 -0
- package/src/durable/internal/canonical-json.ts +110 -0
- package/src/durable/internal/evidence.ts +29 -0
- package/src/durable/internal/foreign-diagnostic.ts +48 -0
- package/src/durable/internal/history-prompt.ts +87 -0
- package/src/durable/internal/initial-context.ts +215 -0
- package/src/durable/internal/journal-metadata.ts +188 -0
- package/src/durable/internal/message-status.ts +18 -0
- package/src/durable/internal/messaging-host.ts +615 -0
- package/src/durable/internal/prompt-footprint.ts +47 -0
- package/src/durable/internal/prompt-history-cache.ts +604 -0
- package/src/durable/internal/record-encoding.ts +258 -0
- package/src/durable/internal/record-ownership.ts +68 -0
- package/src/durable/internal/run-context-reader.ts +51 -0
- package/src/durable/internal/run-context.ts +211 -0
- package/src/durable/internal/schedule-time.ts +304 -0
- package/src/durable/internal/thread-import-reader.ts +85 -0
- package/src/durable/internal/thread-initialization.ts +181 -0
- package/src/durable/internal/thread-transfer-source.ts +7 -0
- package/src/durable/internal/tool-operations.ts +138 -0
- package/src/durable/internal/transfer-dependencies.ts +40 -0
- package/src/durable/internal/usage-totals.ts +36 -0
- package/src/durable/internal/worker-host.ts +4041 -0
- package/src/durable/internal/worker-runtime.ts +10 -0
- package/src/engine/AgentRuntime.ts +100 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +302 -0
- package/src/engine/ContextHistory.ts +75 -0
- package/src/engine/ContextWindow.ts +81 -0
- package/src/engine/DurableStep.ts +115 -0
- package/src/engine/MessagingHost.ts +118 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +124 -0
- package/src/engine/RunOptions.ts +664 -0
- package/src/engine/SubagentHost.ts +231 -0
- package/src/engine/ThreadHistory.ts +125 -0
- package/src/engine/ToolBroker.ts +159 -0
- package/src/engine/ToolExposure.ts +49 -0
- package/src/engine/internal/agent-runtime.ts +11137 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,877 @@
|
|
|
1
|
+
import * as DateTime from 'effect/DateTime'
|
|
2
|
+
import * as Effect from 'effect/Effect'
|
|
3
|
+
import * as Option from 'effect/Option'
|
|
4
|
+
import * as Schema from 'effect/Schema'
|
|
5
|
+
import * as Stream from 'effect/Stream'
|
|
6
|
+
|
|
7
|
+
import { AgentPolicy } from '../core/AgentPolicy'
|
|
8
|
+
import { AgentId, DelegationId, ReceiptId, RunId, SettlementId, SubmissionId, ThreadId } from '../core/Identifiers'
|
|
9
|
+
import { IdempotencyKey } from '../core/Receipt'
|
|
10
|
+
import { SubagentDelegationCaps, SubagentGrant, SubagentReservationAmounts } from '../core/SubagentContract'
|
|
11
|
+
import {
|
|
12
|
+
BatchId,
|
|
13
|
+
CanonicalBatch,
|
|
14
|
+
type CanonicalRecordEnvelope,
|
|
15
|
+
CanonicalSequence,
|
|
16
|
+
DeploymentId,
|
|
17
|
+
Digest,
|
|
18
|
+
ProducerId,
|
|
19
|
+
RecordEnvelope,
|
|
20
|
+
RecordId,
|
|
21
|
+
SubtreeBudgetReserved,
|
|
22
|
+
UserInputRecorded,
|
|
23
|
+
WorkerInputCompleted,
|
|
24
|
+
WorkerInputRequested,
|
|
25
|
+
WorkerOriginRecorded,
|
|
26
|
+
WorkerStopRequested,
|
|
27
|
+
} from './Records'
|
|
28
|
+
import { canonicalRecordBytes } from './RunContinuation'
|
|
29
|
+
import { subagentLineageRecordId, workerOriginRecordId } from './RunJournal'
|
|
30
|
+
import {
|
|
31
|
+
AppendConflict,
|
|
32
|
+
AppendRequest,
|
|
33
|
+
type AppendResult,
|
|
34
|
+
getRecord,
|
|
35
|
+
getRunInput,
|
|
36
|
+
readWorkerState,
|
|
37
|
+
type ThreadExportRejected,
|
|
38
|
+
ThreadExportRequest,
|
|
39
|
+
ThreadIdentityRequest,
|
|
40
|
+
ThreadMaterialization,
|
|
41
|
+
ThreadNotMaterialized,
|
|
42
|
+
ThreadObservation,
|
|
43
|
+
ThreadRead,
|
|
44
|
+
ThreadReader,
|
|
45
|
+
ThreadStore,
|
|
46
|
+
ThreadStoreError,
|
|
47
|
+
type ThreadStoreFailure,
|
|
48
|
+
ThreadTailRequest,
|
|
49
|
+
} from './ThreadStore'
|
|
50
|
+
|
|
51
|
+
/** A ThreadStore contract invariant that an adapter under test violated. */
|
|
52
|
+
export class ThreadStoreConformanceViolation extends Schema.TaggedError<ThreadStoreConformanceViolation>()(
|
|
53
|
+
'ThreadStoreConformanceViolation',
|
|
54
|
+
{
|
|
55
|
+
caseName: Schema.String,
|
|
56
|
+
message: Schema.String,
|
|
57
|
+
},
|
|
58
|
+
) {}
|
|
59
|
+
|
|
60
|
+
export type ThreadStoreConformanceFailure =
|
|
61
|
+
| ThreadStoreFailure
|
|
62
|
+
| ThreadExportRejected
|
|
63
|
+
| ThreadStoreConformanceViolation
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* One adapter-neutral ThreadStore contract case. Each case owns disjoint
|
|
67
|
+
* Thread identities, so a suite may run every case against one shared store
|
|
68
|
+
* instance or against a fresh store per case.
|
|
69
|
+
*/
|
|
70
|
+
export interface ThreadStoreConformanceCase {
|
|
71
|
+
readonly name: string
|
|
72
|
+
readonly run: Effect.Effect<void, ThreadStoreConformanceFailure, ThreadStore>
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Inspect a small test fixture through its captured tail, up to 16,384 records and 32 MiB.
|
|
76
|
+
* Transfer tests use streamExport so every wire page and independent fact section is exercised. */
|
|
77
|
+
export const readTestThread = Effect.fnUntraced(function*(
|
|
78
|
+
store: Pick<ThreadStore['Service'], 'read' | 'inspectTail'>,
|
|
79
|
+
request: Pick<ThreadExportRequest, 'threadId'>,
|
|
80
|
+
) {
|
|
81
|
+
const tail = yield* store.inspectTail(ThreadTailRequest.make({ threadId: request.threadId }))
|
|
82
|
+
|
|
83
|
+
const invalid = (message: string) => ThreadStoreError.make({ operation: 'test fixture history', message })
|
|
84
|
+
|
|
85
|
+
if (tail.tailSequence > 16_384) return yield* invalid('Fixture exceeds 16,384 canonical records')
|
|
86
|
+
const records: Array<CanonicalRecordEnvelope> = []
|
|
87
|
+
let bytes = 0
|
|
88
|
+
|
|
89
|
+
while (records.length < tail.tailSequence) {
|
|
90
|
+
const page = yield* store
|
|
91
|
+
.read(
|
|
92
|
+
ThreadRead.make({
|
|
93
|
+
threadId: request.threadId,
|
|
94
|
+
afterSequence: CanonicalSequence.make(records.length),
|
|
95
|
+
limit: 8,
|
|
96
|
+
}),
|
|
97
|
+
)
|
|
98
|
+
.pipe(Stream.take(9), Stream.runCollect)
|
|
99
|
+
|
|
100
|
+
if (page.length === 0 || page.length > 8) return yield* invalid('Invalid fixture history page')
|
|
101
|
+
for (const entry of page) {
|
|
102
|
+
if (entry.sequence > tail.tailSequence) break
|
|
103
|
+
if (entry.sequence !== records.length + 1 || entry.threadId !== request.threadId) {
|
|
104
|
+
return yield* invalid('Fixture history is not contiguous')
|
|
105
|
+
}
|
|
106
|
+
bytes += canonicalRecordBytes(entry.record)
|
|
107
|
+
if (bytes > 32 * 1024 * 1024) return yield* invalid('Fixture exceeds 32 MiB')
|
|
108
|
+
records.push(entry)
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
return {
|
|
113
|
+
threadId: tail.threadId,
|
|
114
|
+
tailSequence: tail.tailSequence,
|
|
115
|
+
|
|
116
|
+
records,
|
|
117
|
+
}
|
|
118
|
+
})
|
|
119
|
+
|
|
120
|
+
const decodeThreadId = Schema.decodeSync(ThreadId)
|
|
121
|
+
const decodeRecordId = Schema.decodeSync(RecordId)
|
|
122
|
+
const decodeBatchId = Schema.decodeSync(BatchId)
|
|
123
|
+
const decodeSequence = Schema.decodeSync(CanonicalSequence)
|
|
124
|
+
|
|
125
|
+
const CONFORMANCE_DEPLOYMENT = Schema.decodeSync(DeploymentId)('deployment-conformance')
|
|
126
|
+
const CONFORMANCE_PRODUCER = Schema.decodeSync(ProducerId)('producer-conformance')
|
|
127
|
+
const CONFORMANCE_SUBMISSION = Schema.decodeSync(SubmissionId)('submission-conformance')
|
|
128
|
+
const CONFORMANCE_RUN = Schema.decodeSync(RunId)('run-conformance')
|
|
129
|
+
const CONFORMANCE_CREATED_AT = DateTime.toUtc(DateTime.makeUnsafe(1))
|
|
130
|
+
|
|
131
|
+
const ZERO_SEQUENCE = decodeSequence(0)
|
|
132
|
+
const DEFINITION_DIGEST = Digest.make('0'.repeat(64))
|
|
133
|
+
|
|
134
|
+
const EMPTY_TAIL = { lastSequence: ZERO_SEQUENCE } as const
|
|
135
|
+
const isAppendConflict = Schema.is(AppendConflict)
|
|
136
|
+
const isThreadNotMaterialized = Schema.is(ThreadNotMaterialized)
|
|
137
|
+
|
|
138
|
+
const record = (recordId: string, input: string): RecordEnvelope =>
|
|
139
|
+
RecordEnvelope.make({
|
|
140
|
+
recordId: decodeRecordId(recordId),
|
|
141
|
+
family: 'thread',
|
|
142
|
+
schemaVersion: 1,
|
|
143
|
+
createdAt: CONFORMANCE_CREATED_AT,
|
|
144
|
+
deploymentId: CONFORMANCE_DEPLOYMENT,
|
|
145
|
+
payload: UserInputRecorded.make({
|
|
146
|
+
submissionId: CONFORMANCE_SUBMISSION,
|
|
147
|
+
kind: 'user',
|
|
148
|
+
runId: CONFORMANCE_RUN,
|
|
149
|
+
input,
|
|
150
|
+
}),
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
const batch = (
|
|
154
|
+
batchId: string,
|
|
155
|
+
records: readonly [RecordEnvelope, ...Array<RecordEnvelope>],
|
|
156
|
+
): CanonicalBatch =>
|
|
157
|
+
CanonicalBatch.make({
|
|
158
|
+
batchId: decodeBatchId(batchId),
|
|
159
|
+
producerId: CONFORMANCE_PRODUCER,
|
|
160
|
+
records,
|
|
161
|
+
})
|
|
162
|
+
|
|
163
|
+
const materialize = Effect.fn('ThreadStoreConformance.materialize')(function*(threadId: ThreadId) {
|
|
164
|
+
const store = yield* ThreadStore
|
|
165
|
+
|
|
166
|
+
yield* store.materialize(ThreadMaterialization.make({ threadId }))
|
|
167
|
+
})
|
|
168
|
+
|
|
169
|
+
const append = Effect.fn('ThreadStoreConformance.append')(function*(
|
|
170
|
+
threadId: ThreadId,
|
|
171
|
+
canonicalBatch: CanonicalBatch,
|
|
172
|
+
tail: Pick<AppendResult, 'lastSequence'> = EMPTY_TAIL,
|
|
173
|
+
) {
|
|
174
|
+
const store = yield* ThreadStore
|
|
175
|
+
|
|
176
|
+
return yield* store.append(
|
|
177
|
+
AppendRequest.make({
|
|
178
|
+
threadId,
|
|
179
|
+
batch: canonicalBatch,
|
|
180
|
+
expectedTailSequence: tail.lastSequence,
|
|
181
|
+
}),
|
|
182
|
+
)
|
|
183
|
+
})
|
|
184
|
+
|
|
185
|
+
const readAll = Effect.fn('ThreadStoreConformance.readAll')(function*(threadId: ThreadId) {
|
|
186
|
+
const store = yield* ThreadStore
|
|
187
|
+
|
|
188
|
+
return yield* store.read(ThreadRead.make({ threadId, limit: 1_024 })).pipe(Stream.runCollect)
|
|
189
|
+
})
|
|
190
|
+
|
|
191
|
+
const conformanceCase = (
|
|
192
|
+
name: string,
|
|
193
|
+
build: (assert: {
|
|
194
|
+
readonly ensure: (
|
|
195
|
+
condition: boolean,
|
|
196
|
+
message: string,
|
|
197
|
+
) => Effect.Effect<void, ThreadStoreConformanceViolation>
|
|
198
|
+
readonly expectFailure: <A, E, R>(
|
|
199
|
+
description: string,
|
|
200
|
+
effect: Effect.Effect<A, E, R>,
|
|
201
|
+
) => Effect.Effect<E, ThreadStoreConformanceViolation, R>
|
|
202
|
+
}) => Effect.Effect<void, ThreadStoreConformanceFailure, ThreadStore | ThreadReader>,
|
|
203
|
+
): ThreadStoreConformanceCase => ({
|
|
204
|
+
name,
|
|
205
|
+
run: build({
|
|
206
|
+
ensure: (condition, message) =>
|
|
207
|
+
condition
|
|
208
|
+
? Effect.void
|
|
209
|
+
: Effect.fail(ThreadStoreConformanceViolation.make({ caseName: name, message })),
|
|
210
|
+
expectFailure: (description, effect) =>
|
|
211
|
+
Effect.flip(effect).pipe(
|
|
212
|
+
Effect.mapError(() =>
|
|
213
|
+
ThreadStoreConformanceViolation.make({
|
|
214
|
+
caseName: name,
|
|
215
|
+
message: `Expected failure but the operation succeeded: ${description}`,
|
|
216
|
+
})
|
|
217
|
+
),
|
|
218
|
+
),
|
|
219
|
+
}).pipe(Effect.provide(ThreadReader.layer()), Effect.withSpan(`ThreadStoreConformance.${name}`)),
|
|
220
|
+
})
|
|
221
|
+
|
|
222
|
+
const atomicBatchVisibility = conformanceCase(
|
|
223
|
+
'commits batches atomically with no partial reader visibility',
|
|
224
|
+
({ ensure, expectFailure }) =>
|
|
225
|
+
Effect.gen(function*() {
|
|
226
|
+
const threadId = decodeThreadId('conformance-atomic')
|
|
227
|
+
const store = yield* ThreadStore
|
|
228
|
+
|
|
229
|
+
yield* materialize(threadId)
|
|
230
|
+
|
|
231
|
+
const committed = yield* append(
|
|
232
|
+
threadId,
|
|
233
|
+
batch('atomic-batch-1', [
|
|
234
|
+
record('atomic-record-1', 'first'),
|
|
235
|
+
record('atomic-record-2', 'second'),
|
|
236
|
+
record('atomic-record-3', 'third'),
|
|
237
|
+
]),
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
yield* ensure(
|
|
241
|
+
committed.firstSequence === 1 && committed.lastSequence === 3,
|
|
242
|
+
'A three-record batch must commit sequences 1 through 3',
|
|
243
|
+
)
|
|
244
|
+
|
|
245
|
+
const read = yield* readAll(threadId)
|
|
246
|
+
|
|
247
|
+
yield* ensure(read.length === 3, 'Readers must observe the full committed batch')
|
|
248
|
+
yield* ensure(
|
|
249
|
+
read.every((envelope, index) => envelope.sequence === index + 1),
|
|
250
|
+
'Committed records must be gap-free in declaration order',
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
const observed = yield* store
|
|
254
|
+
.observe(ThreadObservation.make({ threadId }))
|
|
255
|
+
.pipe(Stream.take(3), Stream.runCollect)
|
|
256
|
+
|
|
257
|
+
yield* ensure(
|
|
258
|
+
observed.map((envelope) => envelope.record.recordId).join(',') ===
|
|
259
|
+
read.map((envelope) => envelope.record.recordId).join(','),
|
|
260
|
+
'Observers must see exactly the committed batch records in order',
|
|
261
|
+
)
|
|
262
|
+
|
|
263
|
+
const duplicate = record('atomic-record-4', 'duplicate')
|
|
264
|
+
|
|
265
|
+
const intraBatch = yield* expectFailure(
|
|
266
|
+
'a batch containing one record ID twice',
|
|
267
|
+
append(threadId, batch('atomic-batch-2', [duplicate, duplicate]), committed),
|
|
268
|
+
)
|
|
269
|
+
|
|
270
|
+
yield* ensure(
|
|
271
|
+
isAppendConflict(intraBatch) && intraBatch.reason === 'record-identity',
|
|
272
|
+
'A duplicated record ID inside one batch must conflict with reason record-identity',
|
|
273
|
+
)
|
|
274
|
+
|
|
275
|
+
const crossBatch = yield* expectFailure(
|
|
276
|
+
'a batch reusing an already-committed record ID',
|
|
277
|
+
append(threadId, batch('atomic-batch-3', [record('atomic-record-1', 'reused')]), committed),
|
|
278
|
+
)
|
|
279
|
+
|
|
280
|
+
yield* ensure(
|
|
281
|
+
isAppendConflict(crossBatch) && crossBatch.reason === 'record-identity',
|
|
282
|
+
'A record ID reused across batches must conflict with reason record-identity',
|
|
283
|
+
)
|
|
284
|
+
|
|
285
|
+
const retained = yield* readTestThread(store, { threadId })
|
|
286
|
+
|
|
287
|
+
yield* ensure(
|
|
288
|
+
retained.records.length === 3 && retained.tailSequence === committed.lastSequence,
|
|
289
|
+
'A conflicting batch must leave no partial prefix behind',
|
|
290
|
+
)
|
|
291
|
+
}),
|
|
292
|
+
)
|
|
293
|
+
|
|
294
|
+
const idempotentReplay = conformanceCase(
|
|
295
|
+
'replays an identical batch idempotently and rejects altered content',
|
|
296
|
+
({ ensure, expectFailure }) =>
|
|
297
|
+
Effect.gen(function*() {
|
|
298
|
+
const threadId = decodeThreadId('conformance-replay')
|
|
299
|
+
|
|
300
|
+
yield* materialize(threadId)
|
|
301
|
+
|
|
302
|
+
const original = batch('replay-batch-1', [
|
|
303
|
+
record('replay-record-1', 'Lisbon'),
|
|
304
|
+
record('replay-record-2', 'Porto'),
|
|
305
|
+
])
|
|
306
|
+
|
|
307
|
+
const first = yield* append(threadId, original)
|
|
308
|
+
|
|
309
|
+
yield* ensure(!first.replayed, 'The first append of a batch must not report replayed')
|
|
310
|
+
|
|
311
|
+
const replayed = yield* append(threadId, original)
|
|
312
|
+
|
|
313
|
+
yield* ensure(
|
|
314
|
+
replayed.replayed &&
|
|
315
|
+
replayed.firstSequence === first.firstSequence &&
|
|
316
|
+
replayed.lastSequence === first.lastSequence,
|
|
317
|
+
'Replaying an identical batch must return the original result with replayed set',
|
|
318
|
+
)
|
|
319
|
+
|
|
320
|
+
const altered = yield* expectFailure(
|
|
321
|
+
'replaying a batch ID with different canonical content',
|
|
322
|
+
append(threadId, batch('replay-batch-1', [record('replay-record-3', 'Faro')])),
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
yield* ensure(
|
|
326
|
+
isAppendConflict(altered) && altered.reason === 'batch-content',
|
|
327
|
+
'A batch ID replayed with different content must conflict with reason batch-content',
|
|
328
|
+
)
|
|
329
|
+
|
|
330
|
+
const read = yield* readAll(threadId)
|
|
331
|
+
|
|
332
|
+
yield* ensure(read.length === 2, 'Replay and conflict must not duplicate committed records')
|
|
333
|
+
}),
|
|
334
|
+
)
|
|
335
|
+
|
|
336
|
+
const tailConflict = conformanceCase(
|
|
337
|
+
'rejects stale expected tails and reports the actual tail',
|
|
338
|
+
({ ensure, expectFailure }) =>
|
|
339
|
+
Effect.gen(function*() {
|
|
340
|
+
const threadId = decodeThreadId('conformance-tail')
|
|
341
|
+
|
|
342
|
+
yield* materialize(threadId)
|
|
343
|
+
|
|
344
|
+
const first = yield* append(
|
|
345
|
+
threadId,
|
|
346
|
+
batch('tail-batch-1', [record('tail-record-1', 'first')]),
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
const staleSequence = yield* expectFailure(
|
|
350
|
+
'an append declaring the pre-append tail sequence',
|
|
351
|
+
append(threadId, batch('tail-batch-2', [record('tail-record-2', 'second')])),
|
|
352
|
+
)
|
|
353
|
+
|
|
354
|
+
yield* ensure(
|
|
355
|
+
isAppendConflict(staleSequence) && staleSequence.reason === 'tail',
|
|
356
|
+
'A stale expected tail sequence must conflict with reason tail',
|
|
357
|
+
)
|
|
358
|
+
yield* ensure(
|
|
359
|
+
isAppendConflict(staleSequence) && staleSequence.actualTailSequence === first.lastSequence,
|
|
360
|
+
'A tail conflict must carry the actual committed tail as a resume hint',
|
|
361
|
+
)
|
|
362
|
+
|
|
363
|
+
const recovered = yield* append(
|
|
364
|
+
threadId,
|
|
365
|
+
batch('tail-batch-2', [record('tail-record-2', 'second')]),
|
|
366
|
+
first,
|
|
367
|
+
)
|
|
368
|
+
|
|
369
|
+
yield* ensure(
|
|
370
|
+
recovered.firstSequence === first.lastSequence + 1,
|
|
371
|
+
'An append declaring the true tail must commit after a tail conflict',
|
|
372
|
+
)
|
|
373
|
+
}),
|
|
374
|
+
)
|
|
375
|
+
|
|
376
|
+
const offsetResumability = conformanceCase(
|
|
377
|
+
'resumes observation from a saved offset with exactly the suffix',
|
|
378
|
+
({ ensure }) =>
|
|
379
|
+
Effect.gen(function*() {
|
|
380
|
+
const threadId = decodeThreadId('conformance-offsets')
|
|
381
|
+
const store = yield* ThreadStore
|
|
382
|
+
|
|
383
|
+
yield* materialize(threadId)
|
|
384
|
+
|
|
385
|
+
const first = yield* append(
|
|
386
|
+
threadId,
|
|
387
|
+
batch('offset-batch-1', [
|
|
388
|
+
record('offset-record-1', 'first'),
|
|
389
|
+
record('offset-record-2', 'second'),
|
|
390
|
+
]),
|
|
391
|
+
)
|
|
392
|
+
|
|
393
|
+
const second = yield* append(
|
|
394
|
+
threadId,
|
|
395
|
+
batch('offset-batch-2', [record('offset-record-3', 'third')]),
|
|
396
|
+
first,
|
|
397
|
+
)
|
|
398
|
+
|
|
399
|
+
yield* append(
|
|
400
|
+
threadId,
|
|
401
|
+
batch('offset-batch-3', [record('offset-record-4', 'fourth')]),
|
|
402
|
+
second,
|
|
403
|
+
)
|
|
404
|
+
|
|
405
|
+
const committed = yield* readAll(threadId)
|
|
406
|
+
|
|
407
|
+
yield* ensure(committed.length === 4, 'All committed records must be readable')
|
|
408
|
+
const savedOffset = committed[1]?.offset
|
|
409
|
+
|
|
410
|
+
yield* ensure(savedOffset !== undefined, 'Committed records must carry observation offsets')
|
|
411
|
+
if (savedOffset === undefined) return
|
|
412
|
+
|
|
413
|
+
const resumed = yield* store
|
|
414
|
+
.observe(ThreadObservation.make({ threadId, afterOffset: savedOffset }))
|
|
415
|
+
.pipe(Stream.take(2), Stream.runCollect)
|
|
416
|
+
|
|
417
|
+
yield* ensure(
|
|
418
|
+
resumed.map((envelope) => envelope.record.recordId).join(',') ===
|
|
419
|
+
committed
|
|
420
|
+
.slice(2)
|
|
421
|
+
.map((envelope) => envelope.record.recordId)
|
|
422
|
+
.join(','),
|
|
423
|
+
'Observation from a saved offset must deliver exactly the suffix in order',
|
|
424
|
+
)
|
|
425
|
+
|
|
426
|
+
const fromStart = yield* store
|
|
427
|
+
.observe(ThreadObservation.make({ threadId }))
|
|
428
|
+
.pipe(Stream.take(4), Stream.runCollect)
|
|
429
|
+
|
|
430
|
+
yield* ensure(
|
|
431
|
+
fromStart.map((envelope) => envelope.record.recordId).join(',') ===
|
|
432
|
+
committed.map((envelope) => envelope.record.recordId).join(','),
|
|
433
|
+
'Observation without an offset must deliver the full log in order',
|
|
434
|
+
)
|
|
435
|
+
}),
|
|
436
|
+
)
|
|
437
|
+
|
|
438
|
+
const tailInspection = conformanceCase(
|
|
439
|
+
'inspects the canonical tail so a resuming producer can compose its next append',
|
|
440
|
+
({ ensure, expectFailure }) =>
|
|
441
|
+
Effect.gen(function*() {
|
|
442
|
+
const threadId = decodeThreadId('conformance-tail-inspection')
|
|
443
|
+
const store = yield* ThreadStore
|
|
444
|
+
|
|
445
|
+
const missing = yield* expectFailure(
|
|
446
|
+
'inspecting the tail of an unmaterialized Thread',
|
|
447
|
+
store.inspectTail(ThreadTailRequest.make({ threadId })),
|
|
448
|
+
)
|
|
449
|
+
|
|
450
|
+
yield* ensure(
|
|
451
|
+
isThreadNotMaterialized(missing) && missing.threadId === threadId,
|
|
452
|
+
'Tail inspection of an unmaterialized Thread must fail as not materialized',
|
|
453
|
+
)
|
|
454
|
+
|
|
455
|
+
yield* materialize(threadId)
|
|
456
|
+
const empty = yield* store.inspectTail(ThreadTailRequest.make({ threadId }))
|
|
457
|
+
|
|
458
|
+
yield* ensure(
|
|
459
|
+
empty.tailSequence === ZERO_SEQUENCE,
|
|
460
|
+
'An empty Thread must report the zero tail without ownership metadata',
|
|
461
|
+
)
|
|
462
|
+
const emptyIdentity = yield* store.readIdentity(ThreadIdentityRequest.make({ threadId }))
|
|
463
|
+
|
|
464
|
+
yield* ensure(
|
|
465
|
+
emptyIdentity.tailSequence === ZERO_SEQUENCE &&
|
|
466
|
+
emptyIdentity.records.length === 0 &&
|
|
467
|
+
emptyIdentity.hasAdmissions === false,
|
|
468
|
+
'A materialized empty identity has no admissions and remains distinct from a missing Thread',
|
|
469
|
+
)
|
|
470
|
+
|
|
471
|
+
const first = yield* append(
|
|
472
|
+
threadId,
|
|
473
|
+
batch('inspect-batch-1', [record(workerOriginRecordId(threadId), 'first')]),
|
|
474
|
+
)
|
|
475
|
+
|
|
476
|
+
const afterAppend = yield* store.inspectTail(ThreadTailRequest.make({ threadId }))
|
|
477
|
+
|
|
478
|
+
yield* ensure(
|
|
479
|
+
afterAppend.tailSequence === first.lastSequence,
|
|
480
|
+
'Tail inspection must match the latest AppendResult',
|
|
481
|
+
)
|
|
482
|
+
// Regression: https://github.com/yielded-dev/agent/commit/6a4f4f870
|
|
483
|
+
const identity = yield* store.readIdentity(ThreadIdentityRequest.make({ threadId }))
|
|
484
|
+
|
|
485
|
+
yield* ensure(
|
|
486
|
+
identity.threadId === threadId &&
|
|
487
|
+
identity.tailSequence === first.lastSequence &&
|
|
488
|
+
identity.records.length === 1 &&
|
|
489
|
+
identity.records[0]?.record.recordId === workerOriginRecordId(threadId),
|
|
490
|
+
'Identity captures the canonical tail and deduplicates a first record at the origin locator',
|
|
491
|
+
)
|
|
492
|
+
|
|
493
|
+
const resumed = yield* append(
|
|
494
|
+
threadId,
|
|
495
|
+
batch('inspect-batch-2', [record('inspect-record-2', 'second')]),
|
|
496
|
+
{ lastSequence: afterAppend.tailSequence },
|
|
497
|
+
)
|
|
498
|
+
|
|
499
|
+
yield* ensure(
|
|
500
|
+
resumed.firstSequence === afterAppend.tailSequence + 1,
|
|
501
|
+
'An append composed from the inspected tail must commit without exporting the log',
|
|
502
|
+
)
|
|
503
|
+
|
|
504
|
+
const staleIdentity = yield* expectFailure(
|
|
505
|
+
'appending from an identity snapshot after a tail advance',
|
|
506
|
+
append(threadId, batch('inspect-stale-identity', [record('inspect-record-3', 'third')]), {
|
|
507
|
+
lastSequence: identity.tailSequence,
|
|
508
|
+
}),
|
|
509
|
+
)
|
|
510
|
+
|
|
511
|
+
yield* ensure(
|
|
512
|
+
isAppendConflict(staleIdentity) && staleIdentity.reason === 'tail',
|
|
513
|
+
'Identity reads do not bypass the canonical append tail fence',
|
|
514
|
+
)
|
|
515
|
+
const currentIdentity = yield* store.readIdentity(ThreadIdentityRequest.make({ threadId }))
|
|
516
|
+
|
|
517
|
+
const retried = yield* append(
|
|
518
|
+
threadId,
|
|
519
|
+
batch('inspect-retry-identity', [record('inspect-record-3', 'third')]),
|
|
520
|
+
{
|
|
521
|
+
lastSequence: currentIdentity.tailSequence,
|
|
522
|
+
},
|
|
523
|
+
)
|
|
524
|
+
|
|
525
|
+
yield* ensure(
|
|
526
|
+
currentIdentity.tailSequence === resumed.lastSequence &&
|
|
527
|
+
currentIdentity.records.length === 1 &&
|
|
528
|
+
retried.lastSequence === resumed.lastSequence + 1,
|
|
529
|
+
'Rereading identity retains the bounded facts and allows append at the current tail',
|
|
530
|
+
)
|
|
531
|
+
}),
|
|
532
|
+
)
|
|
533
|
+
|
|
534
|
+
const notMaterializedOperations = conformanceCase(
|
|
535
|
+
'fails every read and write against an unmaterialized Thread',
|
|
536
|
+
({ ensure, expectFailure }) =>
|
|
537
|
+
Effect.gen(function*() {
|
|
538
|
+
const threadId = decodeThreadId('conformance-not-materialized')
|
|
539
|
+
const store = yield* ThreadStore
|
|
540
|
+
|
|
541
|
+
const failures = [
|
|
542
|
+
yield* expectFailure(
|
|
543
|
+
'appending to an unmaterialized Thread',
|
|
544
|
+
append(threadId, batch('missing-batch-1', [record('missing-record-1', 'first')])),
|
|
545
|
+
),
|
|
546
|
+
yield* expectFailure('reading an unmaterialized Thread', readAll(threadId)),
|
|
547
|
+
yield* expectFailure(
|
|
548
|
+
'observing an unmaterialized Thread',
|
|
549
|
+
store
|
|
550
|
+
.observe(ThreadObservation.make({ threadId }))
|
|
551
|
+
.pipe(Stream.take(1), Stream.runCollect),
|
|
552
|
+
),
|
|
553
|
+
yield* expectFailure(
|
|
554
|
+
'exporting an unmaterialized Thread',
|
|
555
|
+
store.export(ThreadExportRequest.make({ threadId })),
|
|
556
|
+
),
|
|
557
|
+
yield* expectFailure(
|
|
558
|
+
'inspecting the tail of an unmaterialized Thread',
|
|
559
|
+
store.inspectTail(ThreadTailRequest.make({ threadId })),
|
|
560
|
+
),
|
|
561
|
+
yield* expectFailure(
|
|
562
|
+
'reading the identity of an unmaterialized Thread',
|
|
563
|
+
store.readIdentity(ThreadIdentityRequest.make({ threadId })),
|
|
564
|
+
),
|
|
565
|
+
]
|
|
566
|
+
|
|
567
|
+
yield* Effect.forEach(
|
|
568
|
+
failures,
|
|
569
|
+
(failure) =>
|
|
570
|
+
ensure(
|
|
571
|
+
isThreadNotMaterialized(failure) && failure.threadId === threadId,
|
|
572
|
+
'Operations against an unmaterialized Thread must fail as not materialized',
|
|
573
|
+
),
|
|
574
|
+
{ discard: true },
|
|
575
|
+
)
|
|
576
|
+
}),
|
|
577
|
+
)
|
|
578
|
+
|
|
579
|
+
const nativeAmbiguousOwnership = conformanceCase(
|
|
580
|
+
'native Run input lookup fails closed on ambiguous original input',
|
|
581
|
+
({ expectFailure }) =>
|
|
582
|
+
Effect.gen(function*() {
|
|
583
|
+
const threadId = decodeThreadId('ambiguous-native-run')
|
|
584
|
+
|
|
585
|
+
yield* materialize(threadId)
|
|
586
|
+
yield* append(
|
|
587
|
+
threadId,
|
|
588
|
+
batch('inputs', [record('input-1', 'first'), record('input-2', 'second')]),
|
|
589
|
+
)
|
|
590
|
+
yield* expectFailure(
|
|
591
|
+
'ambiguous original Run input',
|
|
592
|
+
getRunInput({ threadId, runId: CONFORMANCE_RUN }),
|
|
593
|
+
)
|
|
594
|
+
}),
|
|
595
|
+
)
|
|
596
|
+
|
|
597
|
+
const nativeWorkerAccounting = conformanceCase(
|
|
598
|
+
'native worker accounting retains lifetime reservations without conversation history',
|
|
599
|
+
({ ensure, expectFailure }) =>
|
|
600
|
+
Effect.gen(function*() {
|
|
601
|
+
const threadId = decodeThreadId('native-worker-accounting')
|
|
602
|
+
const store = yield* ThreadStore
|
|
603
|
+
|
|
604
|
+
yield* materialize(threadId)
|
|
605
|
+
const workerThreadId = decodeThreadId('worker')
|
|
606
|
+
const agentId = yield* Schema.decodeEffect(AgentId)('agent').pipe(Effect.orDie)
|
|
607
|
+
|
|
608
|
+
const origin = {
|
|
609
|
+
worker: {
|
|
610
|
+
schemaVersion: 1 as const,
|
|
611
|
+
delegationId: yield* Schema.decodeEffect(DelegationId)('child').pipe(Effect.orDie),
|
|
612
|
+
targetAgentId: agentId,
|
|
613
|
+
threadId: workerThreadId,
|
|
614
|
+
},
|
|
615
|
+
source: { _tag: 'programmatic' as const, agentId, threadId },
|
|
616
|
+
budgetScope: 'worker-run' as const,
|
|
617
|
+
targetDigests: {
|
|
618
|
+
agent: DEFINITION_DIGEST,
|
|
619
|
+
model: DEFINITION_DIGEST,
|
|
620
|
+
tools: DEFINITION_DIGEST,
|
|
621
|
+
},
|
|
622
|
+
policy: AgentPolicy.make({
|
|
623
|
+
maxTurns: 1,
|
|
624
|
+
maxToolCalls: 1,
|
|
625
|
+
maxDuration: '1 second',
|
|
626
|
+
toolConcurrency: 1,
|
|
627
|
+
}),
|
|
628
|
+
budget: {
|
|
629
|
+
caps: SubagentDelegationCaps.make({}),
|
|
630
|
+
allocation: SubagentReservationAmounts.make({
|
|
631
|
+
turns: 1,
|
|
632
|
+
toolCalls: 1,
|
|
633
|
+
durationMillis: 1000,
|
|
634
|
+
inputTokens: 0,
|
|
635
|
+
outputTokens: 0,
|
|
636
|
+
costMicrousd: 0,
|
|
637
|
+
resultBytes: 0,
|
|
638
|
+
}),
|
|
639
|
+
},
|
|
640
|
+
grant: SubagentGrant.make({ allowedToolNames: [], maxDepth: 1 }),
|
|
641
|
+
depth: 1,
|
|
642
|
+
firstMessageId: yield* Schema.decodeEffect(IdempotencyKey)('message-0').pipe(Effect.orDie),
|
|
643
|
+
createdAtMillis: 0,
|
|
644
|
+
expiresAtMillis: 1000,
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
const envelope = (id: string, payload: RecordEnvelope['payload']) =>
|
|
648
|
+
RecordEnvelope.make({ ...record(id, 'unused'), payload })
|
|
649
|
+
|
|
650
|
+
const completed = (messageId: IdempotencyKey, verified: boolean) =>
|
|
651
|
+
WorkerInputCompleted.make({
|
|
652
|
+
messageId,
|
|
653
|
+
workerThreadId,
|
|
654
|
+
submissionId: CONFORMANCE_SUBMISSION,
|
|
655
|
+
receiptId: Schema.decodeSync(ReceiptId)('receipt'),
|
|
656
|
+
settlementId: Schema.decodeSync(SettlementId)('settlement'),
|
|
657
|
+
completedAtMillis: 1,
|
|
658
|
+
...(verified ? { effectsResolved: true as const } : {}),
|
|
659
|
+
})
|
|
660
|
+
|
|
661
|
+
const requested = WorkerInputRequested.make({
|
|
662
|
+
admission: {
|
|
663
|
+
origin,
|
|
664
|
+
executionRunId: null,
|
|
665
|
+
messageId: origin.firstMessageId,
|
|
666
|
+
parameters: {},
|
|
667
|
+
createdAtMillis: 0,
|
|
668
|
+
},
|
|
669
|
+
inputDigest: DEFINITION_DIGEST,
|
|
670
|
+
})
|
|
671
|
+
|
|
672
|
+
let tail = yield* append(
|
|
673
|
+
threadId,
|
|
674
|
+
batch('legacy', [
|
|
675
|
+
envelope('requested', requested),
|
|
676
|
+
envelope('legacy-completion', completed(origin.firstMessageId, false)),
|
|
677
|
+
]),
|
|
678
|
+
)
|
|
679
|
+
|
|
680
|
+
tail = yield* append(
|
|
681
|
+
threadId,
|
|
682
|
+
batch('verified', [envelope('verified', completed(origin.firstMessageId, true))]),
|
|
683
|
+
tail,
|
|
684
|
+
)
|
|
685
|
+
yield* ensure(
|
|
686
|
+
Option.isSome(yield* getRecord({ threadId, recordId: decodeRecordId('requested') })),
|
|
687
|
+
'Proven completion retains its canonical reservation',
|
|
688
|
+
)
|
|
689
|
+
// Regression: https://github.com/yielded-dev/agent/commit/6a4f4f870
|
|
690
|
+
// Payloads do not select identity: the exact lineage locator precedes the
|
|
691
|
+
// exact origin locator in the log, while replies retain first/origin/lineage order.
|
|
692
|
+
tail = yield* append(
|
|
693
|
+
threadId,
|
|
694
|
+
batch('identity-lineage', [record(subagentLineageRecordId(threadId), 'lineage')]),
|
|
695
|
+
tail,
|
|
696
|
+
)
|
|
697
|
+
// Cross the recovery horizon with irrelevant conversation records. Native worker
|
|
698
|
+
// accounting must return the same families and scope, while capturing the full CAS tail.
|
|
699
|
+
for (let base = 0; base < 4097; base += 256) {
|
|
700
|
+
const makeInput = (n: number) =>
|
|
701
|
+
envelope(
|
|
702
|
+
`history-${n}`,
|
|
703
|
+
UserInputRecorded.make({ kind: 'steering', input: `message-${n}` }),
|
|
704
|
+
)
|
|
705
|
+
|
|
706
|
+
tail = yield* append(
|
|
707
|
+
threadId,
|
|
708
|
+
batch(`history-${base}`, [
|
|
709
|
+
makeInput(base),
|
|
710
|
+
...Array.from({ length: Math.min(255, 4096 - base) }, (_, offset) => makeInput(base + offset + 1)),
|
|
711
|
+
]),
|
|
712
|
+
tail,
|
|
713
|
+
)
|
|
714
|
+
}
|
|
715
|
+
tail = yield* append(
|
|
716
|
+
threadId,
|
|
717
|
+
batch('identity-origin', [record(workerOriginRecordId(threadId), 'origin')]),
|
|
718
|
+
tail,
|
|
719
|
+
)
|
|
720
|
+
const identity = yield* store.readIdentity(ThreadIdentityRequest.make({ threadId }))
|
|
721
|
+
|
|
722
|
+
yield* ensure(
|
|
723
|
+
identity.threadId === threadId &&
|
|
724
|
+
identity.tailSequence === tail.lastSequence &&
|
|
725
|
+
identity.records.length === 3 &&
|
|
726
|
+
identity.records.map(({ record }) => record.recordId).join() ===
|
|
727
|
+
[
|
|
728
|
+
'requested',
|
|
729
|
+
workerOriginRecordId(threadId),
|
|
730
|
+
subagentLineageRecordId(threadId),
|
|
731
|
+
].join() &&
|
|
732
|
+
identity.records.every(
|
|
733
|
+
(entry) => entry.threadId === threadId && entry.sequence <= identity.tailSequence,
|
|
734
|
+
),
|
|
735
|
+
'Identity selects the exact canonical locators in semantic order beyond the recovery horizon',
|
|
736
|
+
)
|
|
737
|
+
|
|
738
|
+
const budgetRow = (id: string, sourceSubmissionId: SubmissionId) =>
|
|
739
|
+
envelope(
|
|
740
|
+
id,
|
|
741
|
+
SubtreeBudgetReserved.make({
|
|
742
|
+
reservationId: id,
|
|
743
|
+
executionRunId: null,
|
|
744
|
+
sourceSubmissionId,
|
|
745
|
+
childThreadId: workerThreadId,
|
|
746
|
+
lifetime: 'background',
|
|
747
|
+
depth: 1,
|
|
748
|
+
policy: origin.policy,
|
|
749
|
+
budget: origin.budget,
|
|
750
|
+
grant: origin.grant,
|
|
751
|
+
}),
|
|
752
|
+
)
|
|
753
|
+
|
|
754
|
+
tail = yield* append(
|
|
755
|
+
threadId,
|
|
756
|
+
batch('scoped-budgets', [
|
|
757
|
+
budgetRow('selected', CONFORMANCE_SUBMISSION),
|
|
758
|
+
budgetRow('selected-second', CONFORMANCE_SUBMISSION),
|
|
759
|
+
budgetRow(
|
|
760
|
+
'old-run',
|
|
761
|
+
yield* Schema.decodeEffect(SubmissionId)('old-run').pipe(Effect.orDie),
|
|
762
|
+
),
|
|
763
|
+
]),
|
|
764
|
+
tail,
|
|
765
|
+
)
|
|
766
|
+
yield* expectFailure(
|
|
767
|
+
'Worker accounting cannot return a partial authorization snapshot',
|
|
768
|
+
readWorkerState({ threadId, sourceSubmissionId: CONFORMANCE_SUBMISSION, limit: 1 }),
|
|
769
|
+
)
|
|
770
|
+
|
|
771
|
+
const accounting = yield* readWorkerState({
|
|
772
|
+
threadId,
|
|
773
|
+
sourceSubmissionId: CONFORMANCE_SUBMISSION,
|
|
774
|
+
limit: 2,
|
|
775
|
+
})
|
|
776
|
+
|
|
777
|
+
yield* ensure(
|
|
778
|
+
accounting.records.length === 2 &&
|
|
779
|
+
accounting.records
|
|
780
|
+
.filter(({ record }) => record.payload._tag === 'SubtreeBudgetReserved')
|
|
781
|
+
.map(({ record }) => record.recordId)
|
|
782
|
+
.join() === 'selected,selected-second',
|
|
783
|
+
"Worker state excludes conversation and another Run's accounting, retaining completed lifetime reservations",
|
|
784
|
+
)
|
|
785
|
+
yield* ensure(
|
|
786
|
+
accounting.tailSequence === tail.lastSequence,
|
|
787
|
+
'The accounting snapshot carries the full canonical CAS tail',
|
|
788
|
+
)
|
|
789
|
+
// Regression: https://github.com/yielded-dev/agent/blob/c721a292205e06185f0136c3ed05dcf53e29ca66/packages/effect-agent/src/durable/SqlThreadNativeReads.ts#L195-L214
|
|
790
|
+
tail = yield* append(
|
|
791
|
+
threadId,
|
|
792
|
+
batch('stop-worker', [
|
|
793
|
+
envelope(
|
|
794
|
+
'stop-worker',
|
|
795
|
+
WorkerStopRequested.make({
|
|
796
|
+
principal: yield* Schema.decodeEffect(WorkerStopRequested.fields.principal)(
|
|
797
|
+
'owner',
|
|
798
|
+
).pipe(Effect.orDie),
|
|
799
|
+
command: {
|
|
800
|
+
worker: origin.worker,
|
|
801
|
+
idempotencyKey: yield* Schema.decodeEffect(IdempotencyKey)('stop-worker').pipe(
|
|
802
|
+
Effect.orDie,
|
|
803
|
+
),
|
|
804
|
+
},
|
|
805
|
+
}),
|
|
806
|
+
),
|
|
807
|
+
]),
|
|
808
|
+
tail,
|
|
809
|
+
)
|
|
810
|
+
|
|
811
|
+
const stopped = yield* Stream.runCollect(
|
|
812
|
+
store.read({
|
|
813
|
+
threadId,
|
|
814
|
+
selection: {
|
|
815
|
+
_tag: 'WorkerStop',
|
|
816
|
+
workerThreadId,
|
|
817
|
+
throughSequence: tail.lastSequence,
|
|
818
|
+
},
|
|
819
|
+
page: { limit: 1 },
|
|
820
|
+
}),
|
|
821
|
+
)
|
|
822
|
+
|
|
823
|
+
yield* ensure(
|
|
824
|
+
stopped.some(({ record }) => record.payload._tag === 'WorkerStopRequested'),
|
|
825
|
+
'The exact worker stop selection retains intent after assignment completion',
|
|
826
|
+
)
|
|
827
|
+
|
|
828
|
+
yield* materialize(workerThreadId)
|
|
829
|
+
|
|
830
|
+
const workerTail = yield* append(
|
|
831
|
+
workerThreadId,
|
|
832
|
+
batch('worker-execution', [
|
|
833
|
+
envelope('worker-origin', WorkerOriginRecorded.make({ origin })),
|
|
834
|
+
envelope(
|
|
835
|
+
'worker-run-input',
|
|
836
|
+
UserInputRecorded.make({ kind: 'user', input: 'run', runId: CONFORMANCE_RUN }),
|
|
837
|
+
),
|
|
838
|
+
envelope('worker-steering', UserInputRecorded.make({ kind: 'steering', input: 'note' })),
|
|
839
|
+
]),
|
|
840
|
+
)
|
|
841
|
+
|
|
842
|
+
const selectedExecution = store
|
|
843
|
+
.read({
|
|
844
|
+
threadId: workerThreadId,
|
|
845
|
+
selection: { _tag: 'WorkerExecution', expectedTailSequence: workerTail.lastSequence },
|
|
846
|
+
page: { limit: 2 },
|
|
847
|
+
})
|
|
848
|
+
.pipe(Stream.runCollect)
|
|
849
|
+
|
|
850
|
+
const retainsRunInput = (entries: ReadonlyArray<CanonicalRecordEnvelope>) =>
|
|
851
|
+
ensure(
|
|
852
|
+
entries.length === 1 && entries[0]?.record.recordId === 'worker-run-input',
|
|
853
|
+
'Worker recovery retains its latest Run input across unrelated steering inputs',
|
|
854
|
+
)
|
|
855
|
+
|
|
856
|
+
yield* retainsRunInput(yield* selectedExecution)
|
|
857
|
+
if (store.work !== undefined) {
|
|
858
|
+
yield* store.work.rebuild({ threadId: workerThreadId, restart: true }).pipe(Effect.orDie)
|
|
859
|
+
yield* retainsRunInput(yield* selectedExecution)
|
|
860
|
+
}
|
|
861
|
+
}),
|
|
862
|
+
)
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* The shared, adapter-parameterized ThreadStore contract suite (STORE-010). Every
|
|
866
|
+
* durable adapter test suite must execute each case against its own store provisioning.
|
|
867
|
+
*/
|
|
868
|
+
export const threadStoreConformanceCases: ReadonlyArray<ThreadStoreConformanceCase> = [
|
|
869
|
+
nativeAmbiguousOwnership,
|
|
870
|
+
nativeWorkerAccounting,
|
|
871
|
+
atomicBatchVisibility,
|
|
872
|
+
idempotentReplay,
|
|
873
|
+
tailConflict,
|
|
874
|
+
offsetResumability,
|
|
875
|
+
tailInspection,
|
|
876
|
+
notMaterializedOperations,
|
|
877
|
+
]
|