@systemfsoftware/agent 0.0.0-stage → 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/dist/ActivityStore-CEy3oY41.mjs +90 -0
- package/dist/ActivityStore-CEy3oY41.mjs.map +1 -0
- package/dist/ActivityStore-CPXWRHGz.d.mts +91 -0
- package/dist/Admin-26pelcl9.d.mts +5678 -0
- package/dist/Admin-BcQDrWKY.mjs +329 -0
- package/dist/Admin-BcQDrWKY.mjs.map +1 -0
- package/dist/Agent-BH_R6LOI.d.mts +219 -0
- package/dist/Agent-Bn3zMhDH.mjs +60 -0
- package/dist/Agent-Bn3zMhDH.mjs.map +1 -0
- package/dist/AgentError-RkUaetX8.d.mts +128 -0
- package/dist/AgentError-yFdnS9bl.mjs +141 -0
- package/dist/AgentError-yFdnS9bl.mjs.map +1 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs +116 -0
- package/dist/AgentPolicy-CI7LRBQa.mjs.map +1 -0
- package/dist/AgentPolicy-D-GmZQex.d.mts +128 -0
- package/dist/AgentRegistration-h07X1mZM.mjs +14 -0
- package/dist/AgentRegistration-h07X1mZM.mjs.map +1 -0
- package/dist/AgentRuntime-C3GQPdrv.d.mts +751 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs +5224 -0
- package/dist/AgentRuntime-CrYYV9RF.mjs.map +1 -0
- package/dist/AgentUpdates-7xT0It_R.d.mts +54 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs +66 -0
- package/dist/AgentUpdates-BS_6gR5K.mjs.map +1 -0
- package/dist/BrowserUse-DgCEbTwW.d.mts +196 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs +156 -0
- package/dist/BrowserUse-DjEyFDLZ.mjs.map +1 -0
- package/dist/Budget-CXh_ChFJ.d.mts +112 -0
- package/dist/Budget-j1UkthgY.mjs +351 -0
- package/dist/Budget-j1UkthgY.mjs.map +1 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs +281 -0
- package/dist/CodeExecutor-B_Vt1Ghy.mjs.map +1 -0
- package/dist/CodeExecutor-D5-Rda75.d.mts +198 -0
- package/dist/CodeMode-B7JvfKAD.d.mts +159 -0
- package/dist/CodeMode-BI7WhUkr.mjs +555 -0
- package/dist/CodeMode-BI7WhUkr.mjs.map +1 -0
- package/dist/CommittedActivity-DMfj2beT.d.mts +62 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs +146 -0
- package/dist/CommittedActivity-DXyCKCtX.mjs.map +1 -0
- package/dist/Compaction-C0hWAmOG.mjs +15 -0
- package/dist/Compaction-C0hWAmOG.mjs.map +1 -0
- package/dist/Compaction-e5cNeFmY.d.mts +5 -0
- package/dist/ContextCompactor-Chm9BLrD.d.mts +165 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs +134 -0
- package/dist/ContextCompactor-DV4NOQvg.mjs.map +1 -0
- package/dist/ContextHistory-C80rW5M7.mjs +76 -0
- package/dist/ContextHistory-C80rW5M7.mjs.map +1 -0
- package/dist/ContextHistory-akQ1Td7a.d.mts +65 -0
- package/dist/ContextTools-D5jrWNNH.d.mts +186 -0
- package/dist/ContextTools-p8JDPo-W.mjs +88 -0
- package/dist/ContextTools-p8JDPo-W.mjs.map +1 -0
- package/dist/ContextWindow-BJZI4MMt.d.mts +61 -0
- package/dist/ContextWindow-kbFcs1IF.mjs +63 -0
- package/dist/ContextWindow-kbFcs1IF.mjs.map +1 -0
- package/dist/Digest-BDToAbaX.d.mts +25 -0
- package/dist/Digest-CU6IWj-2.mjs +106 -0
- package/dist/Digest-CU6IWj-2.mjs.map +1 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs +8432 -0
- package/dist/DurableAgentRuntime-D3UTrNQg.mjs.map +1 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs +98 -0
- package/dist/DurableFailpoint-BD5nowNl.mjs.map +1 -0
- package/dist/DurableFailpoint-Cqi5tyof.d.mts +42 -0
- package/dist/DurableStep-CzVIho7y.mjs +54 -0
- package/dist/DurableStep-CzVIho7y.mjs.map +1 -0
- package/dist/DurableStep-cI_Ho_rU.d.mts +109 -0
- package/dist/EventSource-BWY08cyT.d.mts +52 -0
- package/dist/EventSource-BwZVkEQi.mjs +66 -0
- package/dist/EventSource-BwZVkEQi.mjs.map +1 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs +304 -0
- package/dist/FailureDiagnostic-DdHV2eFs.mjs.map +1 -0
- package/dist/FailureDiagnostic-DpzYNI8f.d.mts +232 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs +29 -0
- package/dist/IdGenerator-BCzwV0ZI.mjs.map +1 -0
- package/dist/IdGenerator-BY8NH74o.d.mts +26 -0
- package/dist/Identifiers-LWd4837I.mjs +41 -0
- package/dist/Identifiers-LWd4837I.mjs.map +1 -0
- package/dist/Identifiers-qafW4EP0.d.mts +38 -0
- package/dist/InMemory-BrTm6XEO.mjs +57 -0
- package/dist/InMemory-BrTm6XEO.mjs.map +1 -0
- package/dist/InMemory-C3qXFT5k.d.mts +46 -0
- package/dist/InMemory.d.mts +2 -0
- package/dist/InMemory.mjs +1 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs +237 -0
- package/dist/InteractiveBrowser-B-hlNJy5.mjs.map +1 -0
- package/dist/InteractiveBrowser-nnML0r7w.d.mts +258 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs +204 -0
- package/dist/LifecyclePublication-BDc_ug5v.mjs.map +1 -0
- package/dist/Memory-CT5bDZqi.d.mts +57 -0
- package/dist/Memory-Dl9ecPpm.mjs +204 -0
- package/dist/Memory-Dl9ecPpm.mjs.map +1 -0
- package/dist/MemoryNamespace-BtnlH_E6.d.mts +35 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs +116 -0
- package/dist/MemoryNamespace-DZSpjLj9.mjs.map +1 -0
- package/dist/MemoryNotes-CPvcb5OX.d.mts +425 -0
- package/dist/MemoryNotes-i41TsH11.mjs +132 -0
- package/dist/MemoryNotes-i41TsH11.mjs.map +1 -0
- package/dist/MemoryReference-Dd3KSMa7.d.mts +77 -0
- package/dist/MemoryReference-RFU0HQJG.mjs +108 -0
- package/dist/MemoryReference-RFU0HQJG.mjs.map +1 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs +136 -0
- package/dist/MemoryRevalidation--aAh_Pfq.mjs.map +1 -0
- package/dist/MemoryRevalidation-FsJ8E61W.d.mts +64 -0
- package/dist/MemoryStore-Bg5RunTk.d.mts +187 -0
- package/dist/MemoryStore-E0J99hb2.mjs +245 -0
- package/dist/MemoryStore-E0J99hb2.mjs.map +1 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs +615 -0
- package/dist/MessageDelivery-BE2Yf3FC.mjs.map +1 -0
- package/dist/MessageDelivery-C0S-Cakt.d.mts +1129 -0
- package/dist/Messaging-BqWHYf93.d.mts +216 -0
- package/dist/Messaging-DgSiv4f4.mjs +154 -0
- package/dist/Messaging-DgSiv4f4.mjs.map +1 -0
- package/dist/Messaging-DnnpWe-H.d.mts +1074 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs +117 -0
- package/dist/MessagingHost-Bm5e-kAX.mjs.map +1 -0
- package/dist/MessagingHost-DPPHTLdT.d.mts +80 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs +72 -0
- package/dist/OperationAuthorizer-VSiHCC2S.mjs.map +1 -0
- package/dist/OperationAuthorizer-y-F-Ox_Q.d.mts +62 -0
- package/dist/Output-CafxF31F.d.mts +22 -0
- package/dist/Output-DQ8mWcgf.mjs +7 -0
- package/dist/Output-DQ8mWcgf.mjs.map +1 -0
- package/dist/PageCapture-BfRURUOA.mjs +275 -0
- package/dist/PageCapture-BfRURUOA.mjs.map +1 -0
- package/dist/PageCapture-C_mE72Sd.d.mts +216 -0
- package/dist/PageScreenshot-BJTASs4o.mjs +53 -0
- package/dist/PageScreenshot-BJTASs4o.mjs.map +1 -0
- package/dist/PageScreenshot-CaoaH7mc.d.mts +48 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs +147 -0
- package/dist/PersistentHistory-CTAVhHKH.mjs.map +1 -0
- package/dist/PersistentHistory-h-C7avqL.d.mts +14 -0
- package/dist/PreparedInputAdmission-DYugcCHR.d.mts +973 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs +95 -0
- package/dist/PreparedInputAdmission-adqVJJa6.mjs.map +1 -0
- package/dist/ProvisionalText-BcKpPYKQ.d.mts +70 -0
- package/dist/ProvisionalText-DXddTK4c.mjs +47 -0
- package/dist/ProvisionalText-DXddTK4c.mjs.map +1 -0
- package/dist/Receipt-B-FlCaNH.mjs +35 -0
- package/dist/Receipt-B-FlCaNH.mjs.map +1 -0
- package/dist/Receipt-B4feBxMY.d.mts +31 -0
- package/dist/RecordFormat-DoNh-AFe.mjs +79 -0
- package/dist/RecordFormat-DoNh-AFe.mjs.map +1 -0
- package/dist/RecordFormat-ZMus8Dx8.d.mts +52 -0
- package/dist/Records-C645aQks.mjs +1145 -0
- package/dist/Records-C645aQks.mjs.map +1 -0
- package/dist/Records-C9I1nCL9.d.mts +1423 -0
- package/dist/Recovery-zWy_kmZq.mjs +736 -0
- package/dist/Recovery-zWy_kmZq.mjs.map +1 -0
- package/dist/Redaction-C0zLBAn6.d.mts +28 -0
- package/dist/Redaction-CtyCBMEj.mjs +116 -0
- package/dist/Redaction-CtyCBMEj.mjs.map +1 -0
- package/dist/RememberingStore-BO-OnCgP.mjs +23 -0
- package/dist/RememberingStore-BO-OnCgP.mjs.map +1 -0
- package/dist/RememberingStore-DgqXmILx.d.mts +14 -0
- package/dist/RunContinuation-Bpfp087i.mjs +1060 -0
- package/dist/RunContinuation-Bpfp087i.mjs.map +1 -0
- package/dist/RunContinuation-Cy2W8ASl.d.mts +127 -0
- package/dist/RunEvent-CwgDzXcH.d.mts +465 -0
- package/dist/RunEvent-DJxENnJi.mjs +345 -0
- package/dist/RunEvent-DJxENnJi.mjs.map +1 -0
- package/dist/RunEventSink-B8uM8bw2.mjs +22 -0
- package/dist/RunEventSink-B8uM8bw2.mjs.map +1 -0
- package/dist/RunEventSink-f-T4jbNB.d.mts +105 -0
- package/dist/RunHooks-Bob22Bcj.d.mts +40 -0
- package/dist/RunHooks-DWuLBVdU.mjs +60 -0
- package/dist/RunHooks-DWuLBVdU.mjs.map +1 -0
- package/dist/RunJournal-C_1eqQdr.mjs +1107 -0
- package/dist/RunJournal-C_1eqQdr.mjs.map +1 -0
- package/dist/RunOptions-BVSa3BO2.d.mts +560 -0
- package/dist/RunOptions-COEUCrx4.mjs +61 -0
- package/dist/RunOptions-COEUCrx4.mjs.map +1 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs +25 -0
- package/dist/RunPolicyUsage-B-JXRZYO.mjs.map +1 -0
- package/dist/RunPolicyUsage-jvJo0vJp.d.mts +21 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs +304 -0
- package/dist/RunStorage-CsQQ0Y5u.mjs.map +1 -0
- package/dist/Sandbox-37vXP0BV.d.mts +24 -0
- package/dist/Sandbox-Bze6pHYc.mjs +30 -0
- package/dist/Sandbox-Bze6pHYc.mjs.map +1 -0
- package/dist/Schedule-BY0lzbij.mjs +336 -0
- package/dist/Schedule-BY0lzbij.mjs.map +1 -0
- package/dist/ScheduleTransition-DcqokgFt.d.mts +22 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs +180 -0
- package/dist/ScheduleTransition-DtNzlN9k.mjs.map +1 -0
- package/dist/Scheduling-BaJXJIVt.d.mts +57 -0
- package/dist/Scheduling-BpJN9E1j.mjs +699 -0
- package/dist/Scheduling-BpJN9E1j.mjs.map +1 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs +300 -0
- package/dist/SemanticMemory-BRV0cuWg.mjs.map +1 -0
- package/dist/SemanticMemory-rgWlhW87.d.mts +431 -0
- package/dist/SemanticMemoryIndex-D7yNEWpt.d.mts +826 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs +186 -0
- package/dist/SemanticMemoryIndex-godQDjNx.mjs.map +1 -0
- package/dist/SemanticMemoryRevalidation-Bm3_pfsI.d.mts +44 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs +179 -0
- package/dist/SemanticMemoryRevalidation-D8VV-eU6.mjs.map +1 -0
- package/dist/Subagent-BJJN6n0E.mjs +1315 -0
- package/dist/Subagent-BJJN6n0E.mjs.map +1 -0
- package/dist/Subagent-GXU32fQt.d.mts +2368 -0
- package/dist/SubagentContract-B7vQPueI.d.mts +176 -0
- package/dist/SubagentContract-C-7AxTm_.mjs +187 -0
- package/dist/SubagentContract-C-7AxTm_.mjs.map +1 -0
- package/dist/SubagentHost-BC9B9dNT.d.mts +167 -0
- package/dist/SubagentHost-BEnICu7g.mjs +70 -0
- package/dist/SubagentHost-BEnICu7g.mjs.map +1 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs +465 -0
- package/dist/SubagentReservations-BYNAHPpm.mjs.map +1 -0
- package/dist/SubagentReservations-WrmIVzO5.d.mts +185 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs +921 -0
- package/dist/SubmissionLedger-WG0beEyt.mjs.map +1 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs +17 -0
- package/dist/SubmissionStatus-CPZsOM5a.mjs.map +1 -0
- package/dist/Subscription-BJ0TtZwM.d.mts +815 -0
- package/dist/Subscription-BhQbmUD-.mjs +340 -0
- package/dist/Subscription-BhQbmUD-.mjs.map +1 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs +53 -0
- package/dist/SubscriptionInput-BbV69oX_.mjs.map +1 -0
- package/dist/SubscriptionInput-D6Okd6-z.d.mts +42 -0
- package/dist/SubscriptionTransition-Da9DmAr_.d.mts +23 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs +154 -0
- package/dist/SubscriptionTransition-lrf733c8.mjs.map +1 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs +638 -0
- package/dist/Subscriptions-BS3AXmQ0.mjs.map +1 -0
- package/dist/Subscriptions-DgjahL6V.d.mts +75 -0
- package/dist/Thread-B8JApGHa.mjs +283 -0
- package/dist/Thread-B8JApGHa.mjs.map +1 -0
- package/dist/Thread-BnAtkJl4.d.mts +116 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs +64 -0
- package/dist/ThreadArchiveRange-1PMdjpdJ.mjs.map +1 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs +211 -0
- package/dist/ThreadContextHistory-BSStMOLX.mjs.map +1 -0
- package/dist/ThreadContextHistory-BVTD96Pe.d.mts +33 -0
- package/dist/ThreadContextHistoryProjection-Cp7_RR6V.d.mts +59 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs +149 -0
- package/dist/ThreadContextHistoryProjection-_8uNz-h1.mjs.map +1 -0
- package/dist/ThreadHistory-BkyGfv5E.d.mts +76 -0
- package/dist/ThreadHistory-Blt_W31N.mjs +69 -0
- package/dist/ThreadHistory-Blt_W31N.mjs.map +1 -0
- package/dist/ThreadImport-BQDW9E_Y.d.mts +843 -0
- package/dist/ThreadImport-C8Tqiezd.mjs +491 -0
- package/dist/ThreadImport-C8Tqiezd.mjs.map +1 -0
- package/dist/ThreadInvariants-fniroLRY.mjs +154 -0
- package/dist/ThreadInvariants-fniroLRY.mjs.map +1 -0
- package/dist/ThreadInvariants-w53c67YS.d.mts +23 -0
- package/dist/ThreadProjectionMaintenance-4ccU1auU.d.mts +51 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs +37 -0
- package/dist/ThreadProjectionMaintenance-D6fBjr1q.mjs.map +1 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs +937 -0
- package/dist/ThreadStore-BMUAp5Ta.mjs.map +1 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs +154 -0
- package/dist/ThreadTransfer-B3NkyO_y.mjs.map +1 -0
- package/dist/ThreadTransfer-D0KsqkSR.d.mts +63 -0
- package/dist/ThreadWork-C-xa2Boi.mjs +484 -0
- package/dist/ThreadWork-C-xa2Boi.mjs.map +1 -0
- package/dist/ToolBroker-DkoVyx6T.mjs +42 -0
- package/dist/ToolBroker-DkoVyx6T.mjs.map +1 -0
- package/dist/ToolBroker-Dy2xM6ht.d.mts +134 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs +211 -0
- package/dist/ToolDiscovery-DHySvLQd.mjs.map +1 -0
- package/dist/ToolDiscovery-DvcfbTBk.d.mts +119 -0
- package/dist/ToolExposure-Cn7xETn5.d.mts +6 -0
- package/dist/ToolExposure-D7id9Gt5.d.mts +37 -0
- package/dist/ToolExposure-DCvQWFIa.mjs +9 -0
- package/dist/ToolExposure-DCvQWFIa.mjs.map +1 -0
- package/dist/ToolExposure-DNME8BkG.d.mts +44 -0
- package/dist/ToolExposure-DPnq8Won.mjs +30 -0
- package/dist/ToolExposure-DPnq8Won.mjs.map +1 -0
- package/dist/ToolExposure-DaGaF5tj.mjs +20 -0
- package/dist/ToolExposure-DaGaF5tj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +4 -0
- package/dist/ToolExposure.mjs +4 -0
- package/dist/ToolReconciler-6bb7xlip.d.mts +81 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs +87 -0
- package/dist/ToolReconciler-DJQd3SZA.mjs.map +1 -0
- package/dist/ToolResult-By5KAje4.d.mts +79 -0
- package/dist/ToolResult-DwZxjlHw.mjs +160 -0
- package/dist/ToolResult-DwZxjlHw.mjs.map +1 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs +46 -0
- package/dist/ToolResultStorage-BmoRewhh.mjs.map +1 -0
- package/dist/ToolResultStorage-Bp5fm0do.d.mts +49 -0
- package/dist/ToolResults-NUk_x837.d.mts +33 -0
- package/dist/ToolResults-nCgBlTp2.mjs +45 -0
- package/dist/ToolResults-nCgBlTp2.mjs.map +1 -0
- package/dist/Usage-B0xgME5f.mjs +340 -0
- package/dist/Usage-B0xgME5f.mjs.map +1 -0
- package/dist/Usage-Bc-jXe_9.d.mts +128 -0
- package/dist/WakeScheduler-DVYj66C-.mjs +74 -0
- package/dist/WakeScheduler-DVYj66C-.mjs.map +1 -0
- package/dist/WakeScheduler-SFqj67Sk.d.mts +74 -0
- package/dist/WebCapture-CA4ZarW2.mjs +64 -0
- package/dist/WebCapture-CA4ZarW2.mjs.map +1 -0
- package/dist/WebCapture-pzIeUJ5W.d.mts +49 -0
- package/dist/WebSearch-DnbOzRL_.mjs +30 -0
- package/dist/WebSearch-DnbOzRL_.mjs.map +1 -0
- package/dist/WebSearch-RBUUOfT8.d.mts +18 -0
- package/dist/Worker-CQu8Qp1j.mjs +267 -0
- package/dist/Worker-CQu8Qp1j.mjs.map +1 -0
- package/dist/Worker-xxucY_0b.d.mts +468 -0
- package/dist/WorkerAdmission-CubQgpsl.d.mts +171 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs +162 -0
- package/dist/WorkerAdmission-D8tw_OmT.mjs.map +1 -0
- package/dist/WorkerHost-BciHCzHq.d.mts +150 -0
- package/dist/WorkerHost-DuQug9Bq.mjs +73 -0
- package/dist/WorkerHost-DuQug9Bq.mjs.map +1 -0
- package/dist/agent-registration-D9ofkoBa.mjs +262 -0
- package/dist/agent-registration-D9ofkoBa.mjs.map +1 -0
- package/dist/capabilities/BrowserUse.d.mts +2 -0
- package/dist/capabilities/BrowserUse.mjs +1 -0
- package/dist/capabilities/Budget.d.mts +2 -0
- package/dist/capabilities/Budget.mjs +1 -0
- package/dist/capabilities/CodeMode.d.mts +2 -0
- package/dist/capabilities/CodeMode.mjs +1 -0
- package/dist/capabilities/ContextTools.d.mts +2 -0
- package/dist/capabilities/ContextTools.mjs +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +2 -0
- package/dist/capabilities/MemoryNotes.mjs +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +4 -0
- package/dist/capabilities/Redaction.d.mts +2 -0
- package/dist/capabilities/Redaction.mjs +1 -0
- package/dist/capabilities/RunHooks.d.mts +2 -0
- package/dist/capabilities/RunHooks.mjs +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +2 -0
- package/dist/capabilities/SemanticMemory.mjs +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +6 -0
- package/dist/capabilities/SubagentReservations.d.mts +2 -0
- package/dist/capabilities/SubagentReservations.mjs +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +2 -0
- package/dist/capabilities/ToolDiscovery.mjs +1 -0
- package/dist/capabilities/ToolResults.d.mts +2 -0
- package/dist/capabilities/ToolResults.mjs +1 -0
- package/dist/capabilities/WebCapture.d.mts +2 -0
- package/dist/capabilities/WebCapture.mjs +1 -0
- package/dist/capabilities/WebSearch.d.mts +2 -0
- package/dist/capabilities/WebSearch.mjs +1 -0
- package/dist/compaction-C3hXuO4Z.mjs +539 -0
- package/dist/compaction-C3hXuO4Z.mjs.map +1 -0
- package/dist/completion-B_WDnSg-.d.mts +11 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +1 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +1 -0
- package/dist/core/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +1 -0
- package/dist/core/IdGenerator.d.mts +2 -0
- package/dist/core/IdGenerator.mjs +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +1 -0
- package/dist/core/Memory.d.mts +2 -0
- package/dist/core/Memory.mjs +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +1 -0
- package/dist/core/MemoryRevalidation.d.mts +2 -0
- package/dist/core/MemoryRevalidation.mjs +1 -0
- package/dist/core/MemoryStore.d.mts +2 -0
- package/dist/core/MemoryStore.mjs +1 -0
- package/dist/core/ProvisionalText.d.mts +2 -0
- package/dist/core/ProvisionalText.mjs +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +1 -0
- package/dist/core/RememberingStore.d.mts +2 -0
- package/dist/core/RememberingStore.mjs +1 -0
- package/dist/core/RunEvent.d.mts +3 -0
- package/dist/core/RunEvent.mjs +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +2 -0
- package/dist/core/SemanticMemoryIndex.mjs +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +2 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +1 -0
- package/dist/core/ToolResultStorage.d.mts +2 -0
- package/dist/core/ToolResultStorage.mjs +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -0
- package/dist/durable/ActivityStore.d.mts +2 -0
- package/dist/durable/ActivityStore.mjs +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +1 -0
- package/dist/durable/AgentRegistration.d.mts +3 -0
- package/dist/durable/AgentRegistration.mjs +2 -0
- package/dist/durable/CommittedActivity.d.mts +2 -0
- package/dist/durable/CommittedActivity.mjs +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +3 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -0
- package/dist/durable/DurableFailpointTestControl.mjs +21 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +1 -0
- package/dist/durable/MessageDelivery.d.mts +2 -0
- package/dist/durable/MessageDelivery.mjs +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +401 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +273 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +1 -0
- package/dist/durable/PersistentHistory.d.mts +2 -0
- package/dist/durable/PersistentHistory.mjs +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +1 -0
- package/dist/durable/RecordFormat.d.mts +2 -0
- package/dist/durable/RecordFormat.mjs +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +1 -0
- package/dist/durable/RunContinuation.d.mts +4 -0
- package/dist/durable/RunContinuation.mjs +4 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +1 -0
- package/dist/durable/RunStorage.d.mts +2 -0
- package/dist/durable/RunStorage.mjs +1 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +16 -0
- package/dist/durable/ScheduleStoreConformance.mjs +421 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +2 -0
- package/dist/durable/ScheduleTransition.mjs +1 -0
- package/dist/durable/Scheduling.d.mts +2 -0
- package/dist/durable/Scheduling.mjs +1 -0
- package/dist/durable/SettlementPublisher.d.mts +2 -0
- package/dist/durable/SettlementPublisher.mjs +99 -0
- package/dist/durable/SettlementPublisher.mjs.map +1 -0
- package/dist/durable/SqlMemoryStore.d.mts +729 -0
- package/dist/durable/SqlMemoryStore.mjs +626 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageOwner.d.mts +18 -0
- package/dist/durable/SqlStorageOwner.mjs +6 -0
- package/dist/durable/SqlStorageOwner.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +3 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +31 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2090 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +15 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +816 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +2 -0
- package/dist/durable/SubscriptionTransition.mjs +1 -0
- package/dist/durable/Subscriptions.d.mts +2 -0
- package/dist/durable/Subscriptions.mjs +1 -0
- package/dist/durable/ThreadArchiveRange.d.mts +2 -0
- package/dist/durable/ThreadArchiveRange.mjs +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +2 -0
- package/dist/durable/ThreadContextHistory.mjs +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +2 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +1 -0
- package/dist/durable/ThreadImport.d.mts +2 -0
- package/dist/durable/ThreadImport.mjs +1 -0
- package/dist/durable/ThreadInvariants.d.mts +2 -0
- package/dist/durable/ThreadInvariants.mjs +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +2 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +1 -0
- package/dist/durable/ThreadReader.d.mts +2 -0
- package/dist/durable/ThreadReader.mjs +1 -0
- package/dist/durable/ThreadStore.d.mts +3 -0
- package/dist/durable/ThreadStore.mjs +3 -0
- package/dist/durable/ThreadStoreConformance.d.mts +53 -0
- package/dist/durable/ThreadStoreConformance.mjs +402 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ThreadTransfer.d.mts +2 -0
- package/dist/durable/ThreadTransfer.mjs +1 -0
- package/dist/durable/ThreadWork.d.mts +2 -0
- package/dist/durable/ThreadWork.mjs +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +1 -0
- package/dist/durable/WorkerAdmission.d.mts +2 -0
- package/dist/durable/WorkerAdmission.mjs +1 -0
- package/dist/durable/WorkerHost.d.mts +2 -0
- package/dist/durable/WorkerHost.mjs +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +1 -0
- package/dist/engine/Compaction.d.mts +4 -0
- package/dist/engine/Compaction.mjs +2 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +1 -0
- package/dist/engine/ContextHistory.d.mts +2 -0
- package/dist/engine/ContextHistory.mjs +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +3 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +1 -0
- package/dist/engine/Output.d.mts +3 -0
- package/dist/engine/Output.mjs +2 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +1 -0
- package/dist/index.d.mts +90 -0
- package/dist/index.mjs +101 -0
- package/dist/output-contract-CYA4oBhe.mjs +128 -0
- package/dist/output-contract-CYA4oBhe.mjs.map +1 -0
- package/dist/rolldown-runtime-D3KUYPsf.mjs +12 -0
- package/dist/run-context-reader-D1Tx1G6V.d.mts +17 -0
- package/dist/sandbox/CodeExecutor.d.mts +2 -0
- package/dist/sandbox/CodeExecutor.mjs +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +2 -0
- package/dist/sandbox/InteractiveBrowser.mjs +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +1 -0
- package/dist/subagent-policy-xRJhrc0a.mjs +133 -0
- package/dist/subagent-policy-xRJhrc0a.mjs.map +1 -0
- package/dist/tool-execution-Cl7v8fXU.mjs +16 -0
- package/dist/tool-execution-Cl7v8fXU.mjs.map +1 -0
- package/dist/tool-operations-CauPonM8.mjs +84 -0
- package/dist/tool-operations-CauPonM8.mjs.map +1 -0
- package/dist/utf8-Bl0ZhhGe.mjs +27 -0
- package/dist/utf8-Bl0ZhhGe.mjs.map +1 -0
- package/package.json +491 -3
- package/src/InMemory.ts +79 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/BrowserUse.ts +212 -0
- package/src/capabilities/Budget.ts +544 -0
- package/src/capabilities/CodeMode.ts +1129 -0
- package/src/capabilities/ContextTools.ts +131 -0
- package/src/capabilities/MemoryNotes.ts +177 -0
- package/src/capabilities/Messaging.ts +260 -0
- package/src/capabilities/Redaction.ts +163 -0
- package/src/capabilities/RunHooks.ts +116 -0
- package/src/capabilities/SemanticMemory.ts +402 -0
- package/src/capabilities/Subagent.ts +2343 -0
- package/src/capabilities/SubagentReservations.ts +807 -0
- package/src/capabilities/ToolDiscovery.ts +291 -0
- package/src/capabilities/ToolResults.ts +50 -0
- package/src/capabilities/WebCapture.ts +64 -0
- package/src/capabilities/WebSearch.ts +45 -0
- package/src/capabilities/internal/subagent-background.ts +1137 -0
- package/src/capabilities/internal/subagent-contract.ts +92 -0
- package/src/capabilities/internal/subagent-policy.ts +205 -0
- package/src/capabilities/internal/subagent-reporting.ts +152 -0
- package/src/core/Agent.ts +528 -0
- package/src/core/AgentError.ts +189 -0
- package/src/core/AgentPolicy.ts +194 -0
- package/src/core/AgentUpdates.ts +104 -0
- package/src/core/FailureDiagnostic.ts +392 -0
- package/src/core/IdGenerator.ts +42 -0
- package/src/core/Identifiers.ts +64 -0
- package/src/core/Memory.ts +283 -0
- package/src/core/MemoryNamespace.ts +202 -0
- package/src/core/MemoryReference.ts +120 -0
- package/src/core/MemoryRevalidation.ts +151 -0
- package/src/core/MemoryStore.ts +371 -0
- package/src/core/Messaging.ts +72 -0
- package/src/core/ProvisionalText.ts +53 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +22 -0
- package/src/core/RunEvent.ts +345 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +259 -0
- package/src/core/SemanticMemoryRevalidation.ts +220 -0
- package/src/core/SubagentContract.ts +263 -0
- package/src/core/Thread.ts +447 -0
- package/src/core/ToolExposure.ts +75 -0
- package/src/core/ToolResult.ts +204 -0
- package/src/core/ToolResultStorage.ts +56 -0
- package/src/core/Usage.ts +562 -0
- package/src/core/Worker.ts +236 -0
- package/src/core/internal/agent-updates.ts +42 -0
- package/src/core/internal/completion.ts +33 -0
- package/src/core/internal/json.ts +17 -0
- package/src/core/internal/memory-document.ts +39 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/tool-execution.ts +33 -0
- package/src/core/internal/utf8.ts +32 -0
- package/src/durable/ActivityStore.ts +131 -0
- package/src/durable/Admin.ts +504 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/CommittedActivity.ts +262 -0
- package/src/durable/Digest.ts +57 -0
- package/src/durable/DurableAgentRuntime.ts +12758 -0
- package/src/durable/DurableFailpoint.ts +108 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +179 -0
- package/src/durable/LifecyclePublication.ts +343 -0
- package/src/durable/MessageDelivery.ts +949 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +407 -0
- package/src/durable/OperationAuthorizer.ts +89 -0
- package/src/durable/PersistentHistory.ts +322 -0
- package/src/durable/PreparedInputAdmission.ts +128 -0
- package/src/durable/RecordFormat.ts +113 -0
- package/src/durable/Records.ts +1396 -0
- package/src/durable/Recovery.ts +1022 -0
- package/src/durable/RunContinuation.ts +1946 -0
- package/src/durable/RunJournal.ts +1926 -0
- package/src/durable/RunStorage.ts +533 -0
- package/src/durable/Schedule.ts +445 -0
- package/src/durable/ScheduleStoreConformance.ts +642 -0
- package/src/durable/ScheduleTransition.ts +267 -0
- package/src/durable/Scheduling.ts +1031 -0
- package/src/durable/SettlementPublisher.ts +172 -0
- package/src/durable/SqlMemoryStore.ts +1042 -0
- package/src/durable/SqlStorageOwner.ts +25 -0
- package/src/durable/SubmissionLedger.ts +1247 -0
- package/src/durable/SubmissionLedgerConformance.ts +4695 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +527 -0
- package/src/durable/SubscriptionInput.ts +145 -0
- package/src/durable/SubscriptionStoreConformance.ts +1275 -0
- package/src/durable/SubscriptionTransition.ts +330 -0
- package/src/durable/Subscriptions.ts +1245 -0
- package/src/durable/ThreadArchiveRange.ts +91 -0
- package/src/durable/ThreadContextHistory.ts +338 -0
- package/src/durable/ThreadContextHistoryProjection.ts +219 -0
- package/src/durable/ThreadImport.ts +1199 -0
- package/src/durable/ThreadInvariants.ts +312 -0
- package/src/durable/ThreadProjectionMaintenance.ts +72 -0
- package/src/durable/ThreadReader.ts +21 -0
- package/src/durable/ThreadStore.ts +1258 -0
- package/src/durable/ThreadStoreConformance.ts +877 -0
- package/src/durable/ThreadTransfer.ts +263 -0
- package/src/durable/ThreadWork.ts +713 -0
- package/src/durable/ToolReconciler.ts +112 -0
- package/src/durable/WakeScheduler.ts +125 -0
- package/src/durable/WorkerAdmission.ts +98 -0
- package/src/durable/WorkerHost.ts +204 -0
- package/src/durable/internal/StorageOwner.ts +181 -0
- package/src/durable/internal/agent-registration.ts +713 -0
- package/src/durable/internal/agent-updates.ts +338 -0
- package/src/durable/internal/canonical-json.ts +110 -0
- package/src/durable/internal/evidence.ts +29 -0
- package/src/durable/internal/foreign-diagnostic.ts +48 -0
- package/src/durable/internal/history-prompt.ts +87 -0
- package/src/durable/internal/initial-context.ts +215 -0
- package/src/durable/internal/journal-metadata.ts +188 -0
- package/src/durable/internal/message-status.ts +18 -0
- package/src/durable/internal/messaging-host.ts +615 -0
- package/src/durable/internal/prompt-footprint.ts +47 -0
- package/src/durable/internal/prompt-history-cache.ts +604 -0
- package/src/durable/internal/record-encoding.ts +258 -0
- package/src/durable/internal/record-ownership.ts +68 -0
- package/src/durable/internal/run-context-reader.ts +51 -0
- package/src/durable/internal/run-context.ts +211 -0
- package/src/durable/internal/schedule-time.ts +304 -0
- package/src/durable/internal/thread-import-reader.ts +85 -0
- package/src/durable/internal/thread-initialization.ts +181 -0
- package/src/durable/internal/thread-transfer-source.ts +7 -0
- package/src/durable/internal/tool-operations.ts +138 -0
- package/src/durable/internal/transfer-dependencies.ts +40 -0
- package/src/durable/internal/usage-totals.ts +36 -0
- package/src/durable/internal/worker-host.ts +4041 -0
- package/src/durable/internal/worker-runtime.ts +10 -0
- package/src/engine/AgentRuntime.ts +100 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +302 -0
- package/src/engine/ContextHistory.ts +75 -0
- package/src/engine/ContextWindow.ts +81 -0
- package/src/engine/DurableStep.ts +115 -0
- package/src/engine/MessagingHost.ts +118 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +124 -0
- package/src/engine/RunOptions.ts +664 -0
- package/src/engine/SubagentHost.ts +231 -0
- package/src/engine/ThreadHistory.ts +125 -0
- package/src/engine/ToolBroker.ts +159 -0
- package/src/engine/ToolExposure.ts +49 -0
- package/src/engine/internal/agent-runtime.ts +11083 -0
- package/src/engine/internal/bounded-value.ts +312 -0
- package/src/engine/internal/compaction.ts +673 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/image-tokens.ts +61 -0
- package/src/engine/internal/interpreter-options.ts +569 -0
- package/src/engine/internal/output-contract.ts +226 -0
- package/src/engine/internal/primitive-delta.ts +103 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/provisional-text.ts +107 -0
- package/src/engine/internal/tool-derivative.ts +47 -0
- package/src/engine/internal/tool-exposure.ts +228 -0
- package/src/engine/internal/tool-telemetry.ts +488 -0
- package/src/index.ts +100 -0
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +343 -0
- package/src/sandbox/PageCapture.ts +391 -0
- package/src/sandbox/PageScreenshot.ts +83 -0
- package/src/sandbox/Sandbox.ts +29 -0
- package/README.md +0 -3
|
@@ -0,0 +1,528 @@
|
|
|
1
|
+
import type * as AiError from 'effect/ai/AiError'
|
|
2
|
+
import type * as LanguageModel from 'effect/ai/LanguageModel'
|
|
3
|
+
import type * as Model from 'effect/ai/Model'
|
|
4
|
+
import type * as Prompt from 'effect/ai/Prompt'
|
|
5
|
+
import * as Tool from 'effect/ai/Tool'
|
|
6
|
+
import * as Toolkit from 'effect/ai/Toolkit'
|
|
7
|
+
import type * as Effect from 'effect/Effect'
|
|
8
|
+
import type * as Layer from 'effect/Layer'
|
|
9
|
+
import type * as Schema from 'effect/Schema'
|
|
10
|
+
import * as S from 'effect/Schema'
|
|
11
|
+
|
|
12
|
+
import type { AgentInputDecodeError, AgentInputError, AgentOutputError, AgentRunDispositionError } from './AgentError'
|
|
13
|
+
import { AgentPolicy, type AgentPolicyInput } from './AgentPolicy'
|
|
14
|
+
import { AgentId } from './Identifiers'
|
|
15
|
+
import { type UpdateToolkit, withUpdateTool } from './internal/agent-updates'
|
|
16
|
+
import type { Configuration } from './ToolExposure'
|
|
17
|
+
|
|
18
|
+
/** Prompt input produced directly or by an Effect that preserves its failure and requirements. */
|
|
19
|
+
export type InstructionResult<E = never, R = never> =
|
|
20
|
+
| Prompt.RawInput
|
|
21
|
+
| Effect.Effect<Prompt.RawInput, E, R>
|
|
22
|
+
|
|
23
|
+
/** Static prompt input or an input-dependent source evaluated once while preparing a run. */
|
|
24
|
+
export type InstructionSource<Input, E = never, R = never> =
|
|
25
|
+
| Prompt.RawInput
|
|
26
|
+
| ((input: Input) => InstructionResult<E, R>)
|
|
27
|
+
|
|
28
|
+
/** Definition-owned projection from decoded Agent input to model-visible prompt content. */
|
|
29
|
+
export type InputPromptSource<Input, E = never, R = never> = (
|
|
30
|
+
input: Input,
|
|
31
|
+
) => InstructionResult<E, R>
|
|
32
|
+
|
|
33
|
+
/** Native services needed to execute and identify model calls. */
|
|
34
|
+
export type ModelServices = LanguageModel.LanguageModel | Model.ProviderName | Model.ModelName
|
|
35
|
+
|
|
36
|
+
/** Accepts native model Layers that provide generation and model identity. */
|
|
37
|
+
export type NativeModel<ModelValue> = ModelValue extends Layer.Layer<infer Provides, never, infer _Requires>
|
|
38
|
+
? ModelServices extends Provides ? ModelValue
|
|
39
|
+
: never
|
|
40
|
+
: never
|
|
41
|
+
|
|
42
|
+
/** Definition-owned boundary for selecting and validating an application run disposition. */
|
|
43
|
+
export interface RunDispositionDeclaration<Output, DispositionSchema extends Schema.Top> {
|
|
44
|
+
/**
|
|
45
|
+
* Opt background workers into one retained assignment. The encoded disposition must be
|
|
46
|
+
* Worker.AssignmentDisposition: completed seals the worker, waiting leaves it steerable.
|
|
47
|
+
* Failures and exhausted Runs seal as failed; aborting an active Run seals as cancelled.
|
|
48
|
+
* The worker origin retains this choice. Omission preserves reusable workers.
|
|
49
|
+
*/
|
|
50
|
+
readonly workerLifecycle?: 'assignment' | undefined
|
|
51
|
+
/** Canonical Schema used to validate and encode the selected disposition. */
|
|
52
|
+
readonly schema: DispositionSchema
|
|
53
|
+
/** Pure selection from decoded output. `undefined` declares none, except for assignments. */
|
|
54
|
+
readonly fromOutput: (output: Output) => unknown
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Values available to a Definition-owned completion Tool projector after canonical decoding. */
|
|
58
|
+
export interface CompletionProjectionInput<Parameters = unknown, Result = unknown> {
|
|
59
|
+
readonly parameters: Parameters
|
|
60
|
+
readonly result: Result
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* The required final Tool whenever configured. Every model Turn must use Tools, and only this
|
|
65
|
+
* Tool's successful result can complete the Agent when it is the sole application call.
|
|
66
|
+
* Provider-executed calls may accompany it only with terminal results, outside grace finalization.
|
|
67
|
+
* Mixed, wholly unexecuted application batches are rejected with failed Tool results so the
|
|
68
|
+
* model can correct them within ordinary Run budgets; completed provider results are retained.
|
|
69
|
+
* Missing provider results and invalid pending resumed batches fail closed. The completion
|
|
70
|
+
* designation never permits side-effect replay.
|
|
71
|
+
*/
|
|
72
|
+
export interface CompletionToolDeclaration<
|
|
73
|
+
Parameters = unknown,
|
|
74
|
+
Result = unknown,
|
|
75
|
+
Output = unknown,
|
|
76
|
+
> {
|
|
77
|
+
readonly tool: string
|
|
78
|
+
/**
|
|
79
|
+
* Pure, deterministic projection: recovery may reevaluate a recorded Tool result before
|
|
80
|
+
* RunCompleted commits. Once committed, that stored output wins across later code changes.
|
|
81
|
+
*/
|
|
82
|
+
readonly project: (input: CompletionProjectionInput<Parameters, Result>) => Output
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
type CompletionToolFor<ToolkitValue extends Toolkit.Any, Output> = {
|
|
86
|
+
readonly [Name in keyof ToolkitValue['tools'] & string]:
|
|
87
|
+
& CompletionToolDeclaration<
|
|
88
|
+
Tool.Parameters<ToolkitValue['tools'][Name]>,
|
|
89
|
+
Tool.Success<ToolkitValue['tools'][Name]>,
|
|
90
|
+
Output
|
|
91
|
+
>
|
|
92
|
+
& { readonly tool: Name }
|
|
93
|
+
}[keyof ToolkitValue['tools'] & string]
|
|
94
|
+
|
|
95
|
+
/** Immutable, model-agnostic schemas, behavior, tools, and bounds for an agent. */
|
|
96
|
+
export interface Definition<
|
|
97
|
+
InputSchema extends Schema.Top,
|
|
98
|
+
OutputSchema extends Schema.Top,
|
|
99
|
+
Instructions,
|
|
100
|
+
ToolkitValue extends Toolkit.Any,
|
|
101
|
+
RunDispositionValue = undefined,
|
|
102
|
+
InputPromptValue = undefined,
|
|
103
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
104
|
+
> {
|
|
105
|
+
/** Stable agent identity; changing it creates a distinct definition identity. */
|
|
106
|
+
readonly id: AgentId
|
|
107
|
+
/** Canonical Schema for intermediate updates emitted by this Agent. */
|
|
108
|
+
readonly updates?: UpdatesSchema
|
|
109
|
+
/** Canonical schema used to decode and encode run input. */
|
|
110
|
+
readonly input: InputSchema
|
|
111
|
+
/** Canonical schema used to decode the final model output. */
|
|
112
|
+
readonly output: OutputSchema
|
|
113
|
+
/**
|
|
114
|
+
* Evaluated once while preparing each Run. OpenAI, xAI and native adapters advertising support
|
|
115
|
+
* preserve chronological system messages, omitting exact repeats only when no distinct system
|
|
116
|
+
* instruction intervenes. The actual selected model determines support on each call. Other
|
|
117
|
+
* adapters group systems first and keep the last exact repeat, including provider options;
|
|
118
|
+
* Anthropic requires an upstream adapter with mid-conversation system-message support.
|
|
119
|
+
* Stored history is unchanged.
|
|
120
|
+
*/
|
|
121
|
+
readonly instructions: Instructions
|
|
122
|
+
/**
|
|
123
|
+
* Optional projection from decoded input to model-visible native Effect AI prompt content.
|
|
124
|
+
* This controls disclosure only: durable admission retains the complete input and Tool
|
|
125
|
+
* authorization receives it. A projection failure never falls back to sending full input.
|
|
126
|
+
*/
|
|
127
|
+
readonly inputPrompt?: InputPromptValue | undefined
|
|
128
|
+
/** Native Effect AI toolkit whose failures and requirements remain visible. */
|
|
129
|
+
readonly toolkit: ToolkitValue
|
|
130
|
+
readonly toolExposure?: Configuration | undefined
|
|
131
|
+
/** Finite execution bounds enforced by the runtime. */
|
|
132
|
+
readonly policy: AgentPolicy
|
|
133
|
+
/** Explicit policy fields, retained so delegated runs can inherit omitted fields. */
|
|
134
|
+
readonly policyOverrides?: Partial<AgentPolicyInput> | undefined
|
|
135
|
+
/** When configured, this Tool must succeed to produce final output; ordinary text cannot settle. */
|
|
136
|
+
readonly completion?: CompletionToolDeclaration | undefined
|
|
137
|
+
readonly runDisposition?: RunDispositionValue | undefined
|
|
138
|
+
readonly description?: string | undefined
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/** Options for a model-agnostic agent definition. */
|
|
142
|
+
export interface DefinitionOptions<
|
|
143
|
+
InputSchema extends Schema.Top,
|
|
144
|
+
OutputSchema extends Schema.Top,
|
|
145
|
+
Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>,
|
|
146
|
+
ToolkitValue extends Toolkit.Any,
|
|
147
|
+
RunDispositionValue extends
|
|
148
|
+
| RunDispositionDeclaration<OutputSchema['Type'], Schema.Top>
|
|
149
|
+
| undefined = undefined,
|
|
150
|
+
InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined = undefined,
|
|
151
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
152
|
+
> {
|
|
153
|
+
readonly updates?: UpdatesSchema
|
|
154
|
+
readonly input: InputSchema
|
|
155
|
+
readonly output: OutputSchema
|
|
156
|
+
readonly instructions: Instructions
|
|
157
|
+
readonly inputPrompt?: InputPromptValue | undefined
|
|
158
|
+
readonly toolkit: ToolkitValue
|
|
159
|
+
readonly toolExposure?: Configuration | undefined
|
|
160
|
+
readonly policy?: Partial<AgentPolicyInput> | undefined
|
|
161
|
+
readonly completion?: CompletionToolFor<ToolkitValue, OutputSchema['Type']> | undefined
|
|
162
|
+
readonly runDisposition?: RunDispositionValue | undefined
|
|
163
|
+
readonly description?: string | undefined
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
type AnyDefinitionShape = Definition<
|
|
167
|
+
Schema.Top,
|
|
168
|
+
Schema.Top,
|
|
169
|
+
unknown,
|
|
170
|
+
Toolkit.Any,
|
|
171
|
+
RunDispositionDeclaration<never, Schema.Top> | undefined,
|
|
172
|
+
unknown,
|
|
173
|
+
Schema.Top | undefined
|
|
174
|
+
>
|
|
175
|
+
|
|
176
|
+
/** Immutable pairing of an agent definition with a native model Layer. */
|
|
177
|
+
export interface Binding<DefinitionValue extends AnyDefinitionShape, ModelValue> {
|
|
178
|
+
readonly definition: DefinitionValue
|
|
179
|
+
readonly model: NativeModel<ModelValue>
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
type InstructionEffect<Instructions, Input> = Instructions extends (input: Input) => infer Result ? Result
|
|
183
|
+
: Instructions
|
|
184
|
+
|
|
185
|
+
type InputPromptEffect<InputPrompt, Input> = InputPrompt extends (input: Input) => infer Result ? Result
|
|
186
|
+
: never
|
|
187
|
+
|
|
188
|
+
type EffectError<Value> = Value extends Effect.Effect<infer _Success, infer Error, infer _Services> ? Error : never
|
|
189
|
+
|
|
190
|
+
type EffectServices<Value> = Value extends Effect.Effect<infer _Success, infer _Error, infer Services> ? Services
|
|
191
|
+
: never
|
|
192
|
+
|
|
193
|
+
type ModelRequirements<Value> = Value extends Layer.Layer<infer _Provides, infer _Error, infer Services> ? Services
|
|
194
|
+
: never
|
|
195
|
+
|
|
196
|
+
/** Constructors and type projections for definitions and runnable model bindings. */
|
|
197
|
+
|
|
198
|
+
/** Type-erased definition used at generic framework boundaries. */
|
|
199
|
+
export type AnyDefinition = AnyDefinitionShape
|
|
200
|
+
|
|
201
|
+
/** Read-only interpreter program or binding used at inspection and projection boundaries. */
|
|
202
|
+
export interface Any {
|
|
203
|
+
readonly definition: AnyDefinition
|
|
204
|
+
readonly model?: unknown
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
type DefinitionOf<AgentValue extends AnyDefinition | Any> = AgentValue extends {
|
|
208
|
+
readonly definition: infer DefinitionValue extends AnyDefinition
|
|
209
|
+
} ? DefinitionValue
|
|
210
|
+
: AgentValue
|
|
211
|
+
|
|
212
|
+
type RunDispositionSchemaOf<DefinitionValue extends AnyDefinition> = [
|
|
213
|
+
Exclude<DefinitionValue['runDisposition'], undefined>,
|
|
214
|
+
] extends [never] ? never
|
|
215
|
+
: Exclude<DefinitionValue['runDisposition'], undefined> extends RunDispositionDeclaration<
|
|
216
|
+
never,
|
|
217
|
+
infer DispositionSchema
|
|
218
|
+
> ? DispositionSchema
|
|
219
|
+
: never
|
|
220
|
+
|
|
221
|
+
/** Literal Agent ID, retained by Agent.make. */
|
|
222
|
+
export type Name<A extends AnyDefinition | Any> = DefinitionOf<A>['id'] extends
|
|
223
|
+
& AgentId
|
|
224
|
+
& (infer N extends string) ? N
|
|
225
|
+
: string
|
|
226
|
+
|
|
227
|
+
/** Declared update Schema, or never for Agents without updates. */
|
|
228
|
+
export type UpdatesSchema<A extends AnyDefinition | Any> = Exclude<
|
|
229
|
+
DefinitionOf<A>['updates'],
|
|
230
|
+
undefined
|
|
231
|
+
>
|
|
232
|
+
|
|
233
|
+
/** Decoded intermediate update value. */
|
|
234
|
+
export type Update<A extends AnyDefinition | Any> = UpdatesSchema<A>['Type']
|
|
235
|
+
|
|
236
|
+
/** Decoded input type of a definition or binding. */
|
|
237
|
+
export type Input<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input']['Type']
|
|
238
|
+
|
|
239
|
+
/** Encoded input accepted by the primary execution operations. */
|
|
240
|
+
export type EncodedInput<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input']['Encoded']
|
|
241
|
+
|
|
242
|
+
/** Decoded output type of a definition or binding. */
|
|
243
|
+
export type Output<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['output']['Type']
|
|
244
|
+
|
|
245
|
+
/** Input Schema carried by a definition or binding. */
|
|
246
|
+
export type InputSchema<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['input']
|
|
247
|
+
|
|
248
|
+
/** Output Schema carried by a definition or binding. */
|
|
249
|
+
export type OutputSchema<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>['output']
|
|
250
|
+
|
|
251
|
+
/** Application run-disposition Schema carried by a definition or binding, or `never`. */
|
|
252
|
+
export type RunDispositionSchema<AgentValue extends AnyDefinition | Any> = RunDispositionSchemaOf<
|
|
253
|
+
DefinitionOf<AgentValue>
|
|
254
|
+
>
|
|
255
|
+
|
|
256
|
+
/** Decoded application run disposition declared by a definition or binding. */
|
|
257
|
+
export type RunDisposition<AgentValue extends AnyDefinition | Any> = [
|
|
258
|
+
RunDispositionSchema<AgentValue>,
|
|
259
|
+
] extends [never] ? never
|
|
260
|
+
: RunDispositionSchema<AgentValue>['Type']
|
|
261
|
+
|
|
262
|
+
/** Validation failure admitted only by definitions that declare a run disposition. */
|
|
263
|
+
export type RunDispositionFailure<AgentValue extends AnyDefinition | Any> = [
|
|
264
|
+
RunDispositionSchemaOf<DefinitionOf<AgentValue>>,
|
|
265
|
+
] extends [never] ? never
|
|
266
|
+
: AgentRunDispositionError
|
|
267
|
+
|
|
268
|
+
/** Effect AI tool map carried by a definition or binding. */
|
|
269
|
+
export type Tools<AgentValue extends AnyDefinition | Any> = Toolkit.Tools<
|
|
270
|
+
DefinitionOf<AgentValue>['toolkit']
|
|
271
|
+
>
|
|
272
|
+
|
|
273
|
+
type ApplicationTools<A extends AnyDefinition> = [UpdatesSchema<A>] extends [never] ? Tools<A>
|
|
274
|
+
: Omit<Tools<A>, 'emit_update'>
|
|
275
|
+
|
|
276
|
+
type ToolMapValues<ToolMap extends Record<string, Tool.Any>> = ToolMap extends unknown ? ToolMap[keyof ToolMap]
|
|
277
|
+
: never
|
|
278
|
+
|
|
279
|
+
/** All possible tools, including keys present in only one definition or binding branch. */
|
|
280
|
+
export type ToolUnion<AgentValue extends AnyDefinition | Any> = ToolMapValues<Tools<AgentValue>>
|
|
281
|
+
|
|
282
|
+
/** Instruction, tool-handler, and Schema services required before a Model is bound. */
|
|
283
|
+
export type DefinitionRequirements<DefinitionValue extends AnyDefinition> = DefinitionValue extends unknown ?
|
|
284
|
+
| EffectServices<InstructionEffect<DefinitionValue['instructions'], Input<DefinitionValue>>>
|
|
285
|
+
| EffectServices<InputPromptEffect<DefinitionValue['inputPrompt'], Input<DefinitionValue>>>
|
|
286
|
+
| Tool.HandlersFor<ApplicationTools<DefinitionValue>>
|
|
287
|
+
| Tool.HandlerServices<ToolMapValues<ApplicationTools<DefinitionValue>>>
|
|
288
|
+
// The interpreter canonically re-encodes decoded Tool parameters before recording them.
|
|
289
|
+
| Tool.ParametersSchema<ToolUnion<DefinitionValue>>['EncodingServices']
|
|
290
|
+
| Tool.SuccessSchema<ToolUnion<DefinitionValue>>['DecodingServices']
|
|
291
|
+
| DefinitionValue['input']['DecodingServices']
|
|
292
|
+
| DefinitionValue['input']['EncodingServices']
|
|
293
|
+
| DefinitionValue['output']['DecodingServices']
|
|
294
|
+
| DefinitionValue['output']['EncodingServices']
|
|
295
|
+
| UpdatesSchema<DefinitionValue>['DecodingServices']
|
|
296
|
+
| UpdatesSchema<DefinitionValue>['EncodingServices']
|
|
297
|
+
| RunDispositionSchemaOf<DefinitionValue>['DecodingServices']
|
|
298
|
+
| RunDispositionSchemaOf<DefinitionValue>['EncodingServices']
|
|
299
|
+
: never
|
|
300
|
+
|
|
301
|
+
/** Definition services plus native model services, or a binding's model Layer requirements. */
|
|
302
|
+
export type Requirements<AgentValue extends AnyDefinition | Any> =
|
|
303
|
+
| DefinitionRequirements<DefinitionOf<AgentValue>>
|
|
304
|
+
| (AgentValue extends { readonly model: infer ModelValue } ? ModelRequirements<ModelValue>
|
|
305
|
+
: ModelServices)
|
|
306
|
+
|
|
307
|
+
// Distribute after unwrapping bindings too: withModel may itself contain a definition union.
|
|
308
|
+
type DefinitionFailure<DefinitionValue extends AnyDefinition> = DefinitionValue extends unknown ?
|
|
309
|
+
| EffectError<InstructionEffect<DefinitionValue['instructions'], Input<DefinitionValue>>>
|
|
310
|
+
| EffectError<InputPromptEffect<DefinitionValue['inputPrompt'], Input<DefinitionValue>>>
|
|
311
|
+
| Tool.HandlerError<ToolUnion<DefinitionValue>>
|
|
312
|
+
: never
|
|
313
|
+
|
|
314
|
+
/** Failures from every possible definition, preserving each branch's instruction input type. */
|
|
315
|
+
export type Failure<AgentValue extends AnyDefinition | Any> =
|
|
316
|
+
| DefinitionFailure<DefinitionOf<AgentValue>>
|
|
317
|
+
| AiError.AiError
|
|
318
|
+
| AgentInputDecodeError
|
|
319
|
+
| AgentInputError
|
|
320
|
+
| AgentOutputError
|
|
321
|
+
| RunDispositionFailure<AgentValue>
|
|
322
|
+
|
|
323
|
+
/** Validate an agent ID and return a shallowly frozen, model-agnostic definition. */
|
|
324
|
+
export function make<
|
|
325
|
+
const Name extends string,
|
|
326
|
+
InputSchema extends Schema.Top,
|
|
327
|
+
OutputSchema extends Schema.Top,
|
|
328
|
+
Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>,
|
|
329
|
+
ToolkitValue extends Toolkit.Any,
|
|
330
|
+
DispositionSchema extends Schema.Top,
|
|
331
|
+
InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined,
|
|
332
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
333
|
+
>(
|
|
334
|
+
id: Name,
|
|
335
|
+
options:
|
|
336
|
+
& DefinitionOptions<
|
|
337
|
+
InputSchema,
|
|
338
|
+
OutputSchema,
|
|
339
|
+
Instructions,
|
|
340
|
+
ToolkitValue,
|
|
341
|
+
RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>,
|
|
342
|
+
InputPromptValue,
|
|
343
|
+
UpdatesSchema
|
|
344
|
+
>
|
|
345
|
+
& {
|
|
346
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>
|
|
347
|
+
readonly inputPrompt: InputPromptValue
|
|
348
|
+
},
|
|
349
|
+
):
|
|
350
|
+
& Definition<
|
|
351
|
+
InputSchema,
|
|
352
|
+
OutputSchema,
|
|
353
|
+
Instructions,
|
|
354
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
355
|
+
RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>,
|
|
356
|
+
InputPromptValue,
|
|
357
|
+
NoInfer<UpdatesSchema>
|
|
358
|
+
>
|
|
359
|
+
& { readonly id: AgentId & Name }
|
|
360
|
+
|
|
361
|
+
export function make<
|
|
362
|
+
const Name extends string,
|
|
363
|
+
InputSchema extends Schema.Top,
|
|
364
|
+
OutputSchema extends Schema.Top,
|
|
365
|
+
Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>,
|
|
366
|
+
ToolkitValue extends Toolkit.Any,
|
|
367
|
+
DispositionSchema extends Schema.Top,
|
|
368
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
369
|
+
>(
|
|
370
|
+
id: Name,
|
|
371
|
+
options:
|
|
372
|
+
& DefinitionOptions<
|
|
373
|
+
InputSchema,
|
|
374
|
+
OutputSchema,
|
|
375
|
+
Instructions,
|
|
376
|
+
ToolkitValue,
|
|
377
|
+
RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>,
|
|
378
|
+
undefined,
|
|
379
|
+
UpdatesSchema
|
|
380
|
+
>
|
|
381
|
+
& {
|
|
382
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>
|
|
383
|
+
readonly inputPrompt?: undefined
|
|
384
|
+
},
|
|
385
|
+
):
|
|
386
|
+
& Definition<
|
|
387
|
+
InputSchema,
|
|
388
|
+
OutputSchema,
|
|
389
|
+
Instructions,
|
|
390
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
391
|
+
RunDispositionDeclaration<OutputSchema['Type'], DispositionSchema>,
|
|
392
|
+
undefined,
|
|
393
|
+
NoInfer<UpdatesSchema>
|
|
394
|
+
>
|
|
395
|
+
& { readonly id: AgentId & Name }
|
|
396
|
+
|
|
397
|
+
export function make<
|
|
398
|
+
const Name extends string,
|
|
399
|
+
InputSchema extends Schema.Top,
|
|
400
|
+
OutputSchema extends Schema.Top,
|
|
401
|
+
Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>,
|
|
402
|
+
ToolkitValue extends Toolkit.Any,
|
|
403
|
+
InputPromptValue extends InputPromptSource<InputSchema['Type'], unknown, unknown> | undefined,
|
|
404
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
405
|
+
>(
|
|
406
|
+
id: Name,
|
|
407
|
+
options:
|
|
408
|
+
& DefinitionOptions<
|
|
409
|
+
InputSchema,
|
|
410
|
+
OutputSchema,
|
|
411
|
+
Instructions,
|
|
412
|
+
ToolkitValue,
|
|
413
|
+
undefined,
|
|
414
|
+
InputPromptValue,
|
|
415
|
+
UpdatesSchema
|
|
416
|
+
>
|
|
417
|
+
& {
|
|
418
|
+
readonly inputPrompt: InputPromptValue
|
|
419
|
+
readonly runDisposition?: undefined
|
|
420
|
+
},
|
|
421
|
+
):
|
|
422
|
+
& Definition<
|
|
423
|
+
InputSchema,
|
|
424
|
+
OutputSchema,
|
|
425
|
+
Instructions,
|
|
426
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
427
|
+
undefined,
|
|
428
|
+
InputPromptValue,
|
|
429
|
+
NoInfer<UpdatesSchema>
|
|
430
|
+
>
|
|
431
|
+
& { readonly id: AgentId & Name }
|
|
432
|
+
|
|
433
|
+
export function make<
|
|
434
|
+
const Name extends string,
|
|
435
|
+
InputSchema extends Schema.Top,
|
|
436
|
+
OutputSchema extends Schema.Top,
|
|
437
|
+
Instructions extends InstructionSource<InputSchema['Type'], unknown, unknown>,
|
|
438
|
+
ToolkitValue extends Toolkit.Any,
|
|
439
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
440
|
+
>(
|
|
441
|
+
id: Name,
|
|
442
|
+
options:
|
|
443
|
+
& DefinitionOptions<
|
|
444
|
+
InputSchema,
|
|
445
|
+
OutputSchema,
|
|
446
|
+
Instructions,
|
|
447
|
+
ToolkitValue,
|
|
448
|
+
undefined,
|
|
449
|
+
undefined,
|
|
450
|
+
UpdatesSchema
|
|
451
|
+
>
|
|
452
|
+
& {
|
|
453
|
+
readonly inputPrompt?: undefined
|
|
454
|
+
readonly runDisposition?: undefined
|
|
455
|
+
},
|
|
456
|
+
):
|
|
457
|
+
& Definition<
|
|
458
|
+
InputSchema,
|
|
459
|
+
OutputSchema,
|
|
460
|
+
Instructions,
|
|
461
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
462
|
+
undefined,
|
|
463
|
+
undefined,
|
|
464
|
+
NoInfer<UpdatesSchema>
|
|
465
|
+
>
|
|
466
|
+
& { readonly id: AgentId & Name }
|
|
467
|
+
|
|
468
|
+
export function make(
|
|
469
|
+
id: string,
|
|
470
|
+
options: {
|
|
471
|
+
readonly updates?: Schema.Top | undefined
|
|
472
|
+
readonly input: Schema.Top
|
|
473
|
+
readonly output: Schema.Top
|
|
474
|
+
readonly instructions: unknown
|
|
475
|
+
readonly inputPrompt?: unknown
|
|
476
|
+
readonly toolkit: Toolkit.Any
|
|
477
|
+
readonly toolExposure?: Configuration | undefined
|
|
478
|
+
readonly policy?: Partial<AgentPolicyInput> | undefined
|
|
479
|
+
readonly completion?: CompletionToolDeclaration | undefined
|
|
480
|
+
readonly runDisposition?: RunDispositionDeclaration<never, Schema.Top> | undefined
|
|
481
|
+
readonly description?: string | undefined
|
|
482
|
+
},
|
|
483
|
+
): AnyDefinition {
|
|
484
|
+
const tools = Object.values(options.toolkit.tools)
|
|
485
|
+
|
|
486
|
+
const readonlyTools = tools.map((tool) =>
|
|
487
|
+
Tool.isProviderDefined(tool) &&
|
|
488
|
+
!tool.requiresHandler &&
|
|
489
|
+
['web_search', 'web_search_preview', 'file_search'].includes(tool.providerName)
|
|
490
|
+
? tool.annotate(Tool.Readonly, true)
|
|
491
|
+
: tool
|
|
492
|
+
)
|
|
493
|
+
|
|
494
|
+
const toolkit = readonlyTools.some((tool, index) => tool !== tools[index])
|
|
495
|
+
? Toolkit.make(...readonlyTools)
|
|
496
|
+
: options.toolkit
|
|
497
|
+
|
|
498
|
+
return Object.freeze({
|
|
499
|
+
...options,
|
|
500
|
+
toolkit: withUpdateTool(toolkit, options.updates),
|
|
501
|
+
policy: AgentPolicy.resolve(options.policy),
|
|
502
|
+
policyOverrides: Object.freeze({ ...options.policy }),
|
|
503
|
+
toolExposure: options.toolExposure === undefined
|
|
504
|
+
? undefined
|
|
505
|
+
: Object.freeze({
|
|
506
|
+
...options.toolExposure,
|
|
507
|
+
initialToolNames: Object.freeze([...(options.toolExposure.initialToolNames ?? [])]),
|
|
508
|
+
}),
|
|
509
|
+
id: S.decodeSync(AgentId)(id),
|
|
510
|
+
completion: options.completion === undefined ? undefined : Object.freeze({ ...options.completion }),
|
|
511
|
+
runDisposition: options.runDisposition === undefined
|
|
512
|
+
? undefined
|
|
513
|
+
: Object.freeze({ ...options.runDisposition }),
|
|
514
|
+
})
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
/** Bind a native model Layer without acquiring or hiding its requirements. */
|
|
518
|
+
export function withModel<DefinitionValue extends AnyDefinition, ModelValue>(
|
|
519
|
+
definition: DefinitionValue,
|
|
520
|
+
model: NativeModel<ModelValue>,
|
|
521
|
+
): Binding<DefinitionValue, ModelValue>
|
|
522
|
+
|
|
523
|
+
export function withModel<DefinitionValue extends AnyDefinition, ModelValue>(
|
|
524
|
+
definition: DefinitionValue,
|
|
525
|
+
model: ModelValue,
|
|
526
|
+
) {
|
|
527
|
+
return Object.freeze({ definition, model })
|
|
528
|
+
}
|