effect-agent 0.1.0-beta.85 → 0.1.0-beta.87
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/dist/Agent-CN0EWRsR.d.mts +226 -0
- package/dist/Agent-RklVROrm.mjs +83 -0
- package/dist/Agent-RklVROrm.mjs.map +1 -0
- package/dist/AgentError-CggcAQ7V.d.mts +101 -0
- package/dist/AgentPolicy-CetmQrf3.d.mts +96 -0
- package/dist/AgentRuntime-BLyETCPo.mjs +4562 -0
- package/dist/AgentRuntime-BLyETCPo.mjs.map +1 -0
- package/dist/AgentRuntime-uxR_a4VM.d.mts +346 -0
- package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
- package/dist/ContextCompactor-Dxu5zhOL.d.mts +161 -0
- package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
- package/dist/DurableAgentRuntime-uggeJpv3.mjs +6368 -0
- package/dist/DurableAgentRuntime-uggeJpv3.mjs.map +1 -0
- package/dist/DurableFailpoint-Oinuuedm.d.mts +41 -0
- package/dist/DurableStep-Cry_iol4.d.mts +103 -0
- package/dist/Ephemeral.d.mts +22 -0
- package/dist/Ephemeral.mjs +22 -0
- package/dist/Ephemeral.mjs.map +1 -0
- package/dist/EventSource-OqS_P9ug.d.mts +51 -0
- package/dist/Identifiers-CN2s30fF.d.mts +40 -0
- package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
- package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
- package/dist/Messaging-CkcIdt4I.d.mts +490 -0
- package/dist/MessagingHost-CRk0kXzT.d.mts +246 -0
- package/dist/MessagingHost-CWi_PP3g.mjs +137 -0
- package/dist/MessagingHost-CWi_PP3g.mjs.map +1 -0
- package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
- package/dist/Output-D6SkedVx.d.mts +25 -0
- package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
- package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
- package/dist/PreparedInputAdmission-C4HbjHgl.d.mts +38 -0
- package/dist/Receipt-BAHyigAF.d.mts +33 -0
- package/dist/Records-BAGkekt8.d.mts +3570 -0
- package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
- package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
- package/dist/RunJournal-Cgg1kNvc.mjs +825 -0
- package/dist/RunJournal-Cgg1kNvc.mjs.map +1 -0
- package/dist/RunOptions-g1aigcKI.d.mts +915 -0
- package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
- package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
- package/dist/Schedule-H3SEYX9g.d.mts +842 -0
- package/dist/Scheduling-C9aIP8zT.mjs +691 -0
- package/dist/Scheduling-C9aIP8zT.mjs.map +1 -0
- package/dist/Subagent-Cy_hU1tv.mjs +1469 -0
- package/dist/Subagent-Cy_hU1tv.mjs.map +1 -0
- package/dist/Subagent-DyfzHNdv.d.mts +826 -0
- package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
- package/dist/SubagentHost-CJUBQlcc.d.mts +140 -0
- package/dist/Subscription-BEP8oQO5.d.mts +921 -0
- package/dist/SubscriptionInput-vAAOBrK7.d.mts +41 -0
- package/dist/Thread-DOBQ0QUY.d.mts +96 -0
- package/dist/ThreadHistory-tS1KwxHR.d.mts +60 -0
- package/dist/ToolBroker-DWs4tZra.d.mts +133 -0
- package/dist/ToolExposure-9uF_Yo0T.mjs +10 -0
- package/dist/ToolExposure-9uF_Yo0T.mjs.map +1 -0
- package/dist/ToolExposure-C93U1sPu.mjs +30 -0
- package/dist/ToolExposure-C93U1sPu.mjs.map +1 -0
- package/dist/ToolExposure-UCN12eCd.d.mts +39 -0
- package/dist/ToolExposure-r2eOWk4F.d.mts +46 -0
- package/dist/ToolExposure.d.mts +6 -5
- package/dist/ToolExposure.mjs +17 -9
- package/dist/ToolExposure.mjs.map +1 -1
- package/dist/ToolReconciler-DQVaJfpE.d.mts +76 -0
- package/dist/ToolResult-DmmgoChv.d.mts +61 -0
- package/dist/Usage-Dx0aknfk.d.mts +121 -0
- package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
- package/dist/Worker-CaPYykpe.d.mts +228 -0
- package/dist/agent-registration-CWDMOAZA.mjs +172 -0
- package/dist/agent-registration-CWDMOAZA.mjs.map +1 -0
- package/dist/capabilities/Approval.d.mts +114 -0
- package/dist/capabilities/Approval.mjs +226 -0
- package/dist/capabilities/Approval.mjs.map +1 -0
- package/dist/capabilities/Budget.d.mts +112 -0
- package/dist/capabilities/Budget.mjs +346 -0
- package/dist/capabilities/Budget.mjs.map +1 -0
- package/dist/capabilities/CodeMode.d.mts +157 -0
- package/dist/capabilities/CodeMode.mjs +522 -0
- package/dist/capabilities/CodeMode.mjs.map +1 -0
- package/dist/capabilities/Commands.d.mts +55 -0
- package/dist/capabilities/Commands.mjs +57 -0
- package/dist/capabilities/Commands.mjs.map +1 -0
- package/dist/capabilities/ContextTools.d.mts +321 -0
- package/dist/capabilities/ContextTools.mjs +126 -0
- package/dist/capabilities/ContextTools.mjs.map +1 -0
- package/dist/capabilities/Mcp.d.mts +108 -0
- package/dist/capabilities/Mcp.mjs +260 -0
- package/dist/capabilities/Mcp.mjs.map +1 -0
- package/dist/capabilities/McpClient.d.mts +115 -0
- package/dist/capabilities/McpClient.mjs +506 -0
- package/dist/capabilities/McpClient.mjs.map +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +424 -0
- package/dist/capabilities/MemoryNotes.mjs +128 -0
- package/dist/capabilities/MemoryNotes.mjs.map +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +151 -0
- package/dist/capabilities/Messaging.mjs.map +1 -0
- package/dist/capabilities/ModelContext.d.mts +89 -0
- package/dist/capabilities/ModelContext.mjs +168 -0
- package/dist/capabilities/ModelContext.mjs.map +1 -0
- package/dist/capabilities/Redaction.d.mts +37 -0
- package/dist/capabilities/Redaction.mjs +104 -0
- package/dist/capabilities/Redaction.mjs.map +1 -0
- package/dist/capabilities/Remembering.d.mts +434 -0
- package/dist/capabilities/Remembering.mjs +290 -0
- package/dist/capabilities/Remembering.mjs.map +1 -0
- package/dist/capabilities/RunHooks.d.mts +82 -0
- package/dist/capabilities/RunHooks.mjs +144 -0
- package/dist/capabilities/RunHooks.mjs.map +1 -0
- package/dist/capabilities/SemanticMemory.d.mts +431 -0
- package/dist/capabilities/SemanticMemory.mjs +315 -0
- package/dist/capabilities/SemanticMemory.mjs.map +1 -0
- package/dist/capabilities/Subagent.d.mts +4 -0
- package/dist/capabilities/Subagent.mjs +5 -0
- package/dist/capabilities/SubagentReservations.d.mts +186 -0
- package/dist/capabilities/SubagentReservations.mjs +479 -0
- package/dist/capabilities/SubagentReservations.mjs.map +1 -0
- package/dist/capabilities/ToolDiscovery.d.mts +109 -0
- package/dist/capabilities/ToolDiscovery.mjs +211 -0
- package/dist/capabilities/ToolDiscovery.mjs.map +1 -0
- package/dist/capabilities/WebCapture.d.mts +163 -0
- package/dist/capabilities/WebCapture.mjs +335 -0
- package/dist/capabilities/WebCapture.mjs.map +1 -0
- package/dist/capabilities/WebSearch.d.mts +71 -0
- package/dist/capabilities/WebSearch.mjs +112 -0
- package/dist/capabilities/WebSearch.mjs.map +1 -0
- package/dist/compaction-C2OTceKw.mjs +505 -0
- package/dist/compaction-C2OTceKw.mjs.map +1 -0
- package/dist/core/Agent.d.mts +2 -0
- package/dist/core/Agent.mjs +2 -0
- package/dist/core/AgentError.d.mts +2 -0
- package/dist/core/AgentError.mjs +117 -0
- package/dist/core/AgentError.mjs.map +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +94 -0
- package/dist/core/AgentPolicy.mjs.map +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +63 -0
- package/dist/core/AgentUpdates.mjs.map +1 -0
- package/dist/core/IdGenerator.d.mts +26 -0
- package/dist/core/IdGenerator.mjs +27 -0
- package/dist/core/IdGenerator.mjs.map +1 -0
- package/dist/core/Identifiers.d.mts +2 -0
- package/dist/core/Identifiers.mjs +43 -0
- package/dist/core/Identifiers.mjs.map +1 -0
- package/dist/core/Memory.d.mts +57 -0
- package/dist/core/Memory.mjs +203 -0
- package/dist/core/Memory.mjs.map +1 -0
- package/dist/core/MemoryNamespace.d.mts +2 -0
- package/dist/core/MemoryNamespace.mjs +116 -0
- package/dist/core/MemoryNamespace.mjs.map +1 -0
- package/dist/core/MemoryReference.d.mts +2 -0
- package/dist/core/MemoryReference.mjs +109 -0
- package/dist/core/MemoryReference.mjs.map +1 -0
- package/dist/core/MemoryRevalidation.d.mts +65 -0
- package/dist/core/MemoryRevalidation.mjs +126 -0
- package/dist/core/MemoryRevalidation.mjs.map +1 -0
- package/dist/core/MemoryStore.d.mts +186 -0
- package/dist/core/MemoryStore.mjs +243 -0
- package/dist/core/MemoryStore.mjs.map +1 -0
- package/dist/core/Receipt.d.mts +2 -0
- package/dist/core/Receipt.mjs +36 -0
- package/dist/core/Receipt.mjs.map +1 -0
- package/dist/core/RememberingStore.d.mts +1562 -0
- package/dist/core/RememberingStore.mjs +190 -0
- package/dist/core/RememberingStore.mjs.map +1 -0
- package/dist/core/RunEvent.d.mts +2 -0
- package/dist/core/RunEvent.mjs +337 -0
- package/dist/core/RunEvent.mjs.map +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +21 -0
- package/dist/core/RunPolicyUsage.mjs.map +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +826 -0
- package/dist/core/SemanticMemoryIndex.mjs +185 -0
- package/dist/core/SemanticMemoryIndex.mjs.map +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +45 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +191 -0
- package/dist/core/SemanticMemoryRevalidation.mjs.map +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +148 -0
- package/dist/core/SubagentContract.mjs.map +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +250 -0
- package/dist/core/Thread.mjs.map +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +140 -0
- package/dist/core/ToolResult.mjs.map +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +319 -0
- package/dist/core/Usage.mjs.map +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +147 -0
- package/dist/core/Worker.mjs.map +1 -0
- package/dist/durable/ActivityStore.d.mts +116 -0
- package/dist/durable/ActivityStore.mjs +131 -0
- package/dist/durable/ActivityStore.mjs.map +1 -0
- package/dist/durable/Admin.d.mts +2 -0
- package/dist/durable/Admin.mjs +328 -0
- package/dist/durable/Admin.mjs.map +1 -0
- package/dist/durable/AgentRegistration.d.mts +2 -0
- package/dist/durable/AgentRegistration.mjs +14 -0
- package/dist/durable/AgentRegistration.mjs.map +1 -0
- package/dist/durable/Certification.d.mts +111 -0
- package/dist/durable/Certification.mjs +159 -0
- package/dist/durable/Certification.mjs.map +1 -0
- package/dist/durable/CommittedActivity.d.mts +62 -0
- package/dist/durable/CommittedActivity.mjs +159 -0
- package/dist/durable/CommittedActivity.mjs.map +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +50 -0
- package/dist/durable/Digest.mjs.map +1 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +3 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +94 -0
- package/dist/durable/DurableFailpoint.mjs.map +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +15 -0
- package/dist/durable/DurableFailpointTestControl.mjs +19 -0
- package/dist/durable/DurableFailpointTestControl.mjs.map +1 -0
- package/dist/durable/EventSource.d.mts +2 -0
- package/dist/durable/EventSource.mjs +65 -0
- package/dist/durable/EventSource.mjs.map +1 -0
- package/dist/durable/GitHubWorkflowSource.d.mts +144 -0
- package/dist/durable/GitHubWorkflowSource.mjs +209 -0
- package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
- package/dist/durable/MessageDelivery.d.mts +492 -0
- package/dist/durable/MessageDelivery.mjs +495 -0
- package/dist/durable/MessageDelivery.mjs.map +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +358 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +243 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs.map +1 -0
- package/dist/durable/OperationAuthorizer.d.mts +2 -0
- package/dist/durable/OperationAuthorizer.mjs +70 -0
- package/dist/durable/OperationAuthorizer.mjs.map +1 -0
- package/dist/durable/PersistentHistory.d.mts +16 -0
- package/dist/durable/PersistentHistory.mjs +125 -0
- package/dist/durable/PersistentHistory.mjs.map +1 -0
- package/dist/durable/PreparedInputAdmission.d.mts +2 -0
- package/dist/durable/PreparedInputAdmission.mjs +34 -0
- package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +795 -0
- package/dist/durable/Records.mjs.map +1 -0
- package/dist/durable/Recovery.d.mts +2 -0
- package/dist/durable/Recovery.mjs +739 -0
- package/dist/durable/Recovery.mjs.map +1 -0
- package/dist/durable/RunJournal.d.mts +2 -0
- package/dist/durable/RunJournal.mjs +2 -0
- package/dist/durable/Schedule.d.mts +2 -0
- package/dist/durable/Schedule.mjs +382 -0
- package/dist/durable/Schedule.mjs.map +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +18 -0
- package/dist/durable/ScheduleStoreConformance.mjs +420 -0
- package/dist/durable/ScheduleStoreConformance.mjs.map +1 -0
- package/dist/durable/ScheduleTransition.d.mts +24 -0
- package/dist/durable/ScheduleTransition.mjs +180 -0
- package/dist/durable/ScheduleTransition.mjs.map +1 -0
- package/dist/durable/Scheduling.d.mts +54 -0
- package/dist/durable/Scheduling.mjs +2 -0
- package/dist/durable/SqlMemoryStore.d.mts +30 -0
- package/dist/durable/SqlMemoryStore.mjs +435 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlMessageDeliveryStore.d.mts +40 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs +167 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageV2Upgrade.d.mts +22 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
- package/dist/durable/SqlSubscriptionStore.d.mts +63 -0
- package/dist/durable/SqlSubscriptionStore.mjs +751 -0
- package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +914 -0
- package/dist/durable/SubmissionLedger.mjs.map +1 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +30 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +1986 -0
- package/dist/durable/SubmissionLedgerConformance.mjs.map +1 -0
- package/dist/durable/SubmissionStatus.d.mts +2 -0
- package/dist/durable/SubmissionStatus.mjs +18 -0
- package/dist/durable/SubmissionStatus.mjs.map +1 -0
- package/dist/durable/Subscription.d.mts +2 -0
- package/dist/durable/Subscription.mjs +360 -0
- package/dist/durable/Subscription.mjs.map +1 -0
- package/dist/durable/SubscriptionInput.d.mts +2 -0
- package/dist/durable/SubscriptionInput.mjs +52 -0
- package/dist/durable/SubscriptionInput.mjs.map +1 -0
- package/dist/durable/SubscriptionStoreConformance.d.mts +17 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +625 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTools.d.mts +273 -0
- package/dist/durable/SubscriptionTools.mjs +190 -0
- package/dist/durable/SubscriptionTools.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +21 -0
- package/dist/durable/SubscriptionTransition.mjs +148 -0
- package/dist/durable/SubscriptionTransition.mjs.map +1 -0
- package/dist/durable/Subscriptions.d.mts +73 -0
- package/dist/durable/Subscriptions.mjs +627 -0
- package/dist/durable/Subscriptions.mjs.map +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +32 -0
- package/dist/durable/ThreadContextHistory.mjs +152 -0
- package/dist/durable/ThreadContextHistory.mjs.map +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +60 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +149 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs.map +1 -0
- package/dist/durable/ThreadInvariants.d.mts +74 -0
- package/dist/durable/ThreadInvariants.mjs +200 -0
- package/dist/durable/ThreadInvariants.mjs.map +1 -0
- package/dist/durable/ThreadProjection.d.mts +78 -0
- package/dist/durable/ThreadProjection.mjs +158 -0
- package/dist/durable/ThreadProjection.mjs.map +1 -0
- package/dist/durable/ThreadProjectionMaintenance.d.mts +49 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs +33 -0
- package/dist/durable/ThreadProjectionMaintenance.mjs.map +1 -0
- package/dist/durable/ThreadStore.d.mts +2 -0
- package/dist/durable/ThreadStore.mjs +147 -0
- package/dist/durable/ThreadStore.mjs.map +1 -0
- package/dist/durable/ThreadStoreConformance.d.mts +29 -0
- package/dist/durable/ThreadStoreConformance.mjs +248 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +81 -0
- package/dist/durable/ToolReconciler.mjs.map +1 -0
- package/dist/durable/WakeScheduler.d.mts +2 -0
- package/dist/durable/WakeScheduler.mjs +85 -0
- package/dist/durable/WakeScheduler.mjs.map +1 -0
- package/dist/durable/WorkerHost.d.mts +129 -0
- package/dist/durable/WorkerHost.mjs +77 -0
- package/dist/durable/WorkerHost.mjs.map +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +2 -0
- package/dist/engine/Compaction.d.mts +7 -0
- package/dist/engine/Compaction.mjs +16 -0
- package/dist/engine/Compaction.mjs.map +1 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +119 -0
- package/dist/engine/ContextCompactor.mjs.map +1 -0
- package/dist/engine/ContextHistory.d.mts +65 -0
- package/dist/engine/ContextHistory.mjs +76 -0
- package/dist/engine/ContextHistory.mjs.map +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +59 -0
- package/dist/engine/ContextWindow.mjs.map +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +62 -0
- package/dist/engine/DurableStep.mjs.map +1 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +2 -0
- package/dist/engine/Output.d.mts +2 -0
- package/dist/engine/Output.mjs +8 -0
- package/dist/engine/Output.mjs.map +1 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +22 -0
- package/dist/engine/RunEventSink.mjs.map +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +122 -0
- package/dist/engine/RunOptions.mjs.map +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +72 -0
- package/dist/engine/SubagentHost.mjs.map +1 -0
- package/dist/engine/ThreadHistory.d.mts +2 -0
- package/dist/engine/ThreadHistory.mjs +67 -0
- package/dist/engine/ThreadHistory.mjs.map +1 -0
- package/dist/engine/ToolBroker.d.mts +2 -0
- package/dist/engine/ToolBroker.mjs +42 -0
- package/dist/engine/ToolBroker.mjs.map +1 -0
- package/dist/foreign-diagnostic-DBQ1XHKh.mjs +37 -0
- package/dist/foreign-diagnostic-DBQ1XHKh.mjs.map +1 -0
- package/dist/index.d.mts +88 -54
- package/dist/index.mjs +97 -54
- package/dist/output-contract-BC7tjlGw.mjs +84 -0
- package/dist/output-contract-BC7tjlGw.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/sandbox/CodeExecutor.d.mts +194 -0
- package/dist/sandbox/CodeExecutor.mjs +278 -0
- package/dist/sandbox/CodeExecutor.mjs.map +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +142 -0
- package/dist/sandbox/InteractiveBrowser.mjs +165 -0
- package/dist/sandbox/InteractiveBrowser.mjs.map +1 -0
- package/dist/sandbox/PageCapture.d.mts +2 -0
- package/dist/sandbox/PageCapture.mjs +450 -0
- package/dist/sandbox/PageCapture.mjs.map +1 -0
- package/dist/sandbox/PageCrawl.d.mts +88 -0
- package/dist/sandbox/PageCrawl.mjs +124 -0
- package/dist/sandbox/PageCrawl.mjs.map +1 -0
- package/dist/sandbox/PageScreenshot.d.mts +2 -0
- package/dist/sandbox/PageScreenshot.mjs +53 -0
- package/dist/sandbox/PageScreenshot.mjs.map +1 -0
- package/dist/sandbox/ProtectedBrowser.d.mts +252 -0
- package/dist/sandbox/ProtectedBrowser.mjs +270 -0
- package/dist/sandbox/ProtectedBrowser.mjs.map +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +208 -0
- package/dist/sandbox/Sandbox.mjs.map +1 -0
- package/dist/utf8-BYfhEkcj.mjs +11 -0
- package/dist/utf8-BYfhEkcj.mjs.map +1 -0
- package/dist/utf8-DchGZRBd.mjs +23 -0
- package/dist/utf8-DchGZRBd.mjs.map +1 -0
- package/package.json +1 -1
- package/src/Ephemeral.ts +17 -0
- package/src/ToolExposure.ts +2 -2
- package/src/capabilities/Approval.ts +352 -0
- package/src/capabilities/Budget.ts +536 -0
- package/src/capabilities/CodeMode.ts +1090 -0
- package/src/capabilities/Commands.ts +86 -0
- package/src/capabilities/ContextTools.ts +184 -0
- package/src/capabilities/Mcp.ts +427 -0
- package/src/capabilities/McpClient.ts +967 -0
- package/src/capabilities/MemoryNotes.ts +174 -0
- package/src/capabilities/Messaging.ts +261 -0
- package/src/capabilities/ModelContext.ts +354 -0
- package/src/capabilities/Redaction.ts +157 -0
- package/src/capabilities/Remembering.ts +550 -0
- package/src/capabilities/RunHooks.ts +280 -0
- package/src/capabilities/SemanticMemory.ts +447 -0
- package/src/capabilities/Subagent.ts +2277 -0
- package/src/capabilities/SubagentReservations.ts +850 -0
- package/src/capabilities/ToolDiscovery.ts +339 -0
- package/src/capabilities/WebCapture.ts +722 -0
- package/src/capabilities/WebSearch.ts +184 -0
- package/src/capabilities/internal/subagent-background.ts +1106 -0
- package/src/capabilities/internal/subagent-contract.ts +142 -0
- package/src/capabilities/internal/subagent-policy.ts +235 -0
- package/src/capabilities/internal/subagent-reporting.ts +261 -0
- package/src/capabilities/internal/utf8.ts +10 -0
- package/src/core/Agent.ts +575 -0
- package/src/core/AgentError.ts +152 -0
- package/src/core/AgentPolicy.ts +153 -0
- package/src/core/AgentUpdates.ts +100 -0
- package/src/core/IdGenerator.ts +39 -0
- package/src/core/Identifiers.ts +48 -0
- package/src/core/Memory.ts +290 -0
- package/src/core/MemoryNamespace.ts +196 -0
- package/src/core/MemoryReference.ts +121 -0
- package/src/core/MemoryRevalidation.ts +185 -0
- package/src/core/MemoryStore.ts +368 -0
- package/src/core/Messaging.ts +90 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +300 -0
- package/src/core/RunEvent.ts +366 -0
- package/src/core/RunPolicyUsage.ts +17 -0
- package/src/core/SemanticMemoryIndex.ts +250 -0
- package/src/core/SemanticMemoryRevalidation.ts +254 -0
- package/src/core/SubagentContract.ts +196 -0
- package/src/core/Thread.ts +371 -0
- package/src/core/ToolExposure.ts +74 -0
- package/src/core/ToolResult.ts +170 -0
- package/src/core/Usage.ts +529 -0
- package/src/core/Worker.ts +173 -0
- package/src/core/internal/agent-updates.ts +32 -0
- package/src/core/internal/utf8.ts +23 -0
- package/src/durable/ActivityStore.ts +160 -0
- package/src/durable/Admin.ts +496 -0
- package/src/durable/AgentRegistration.ts +13 -0
- package/src/durable/Certification.ts +210 -0
- package/src/durable/CommittedActivity.ts +296 -0
- package/src/durable/Digest.ts +93 -0
- package/src/durable/DurableAgentRuntime.ts +10340 -0
- package/src/durable/DurableFailpoint.ts +103 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +172 -0
- package/src/durable/GitHubWorkflowSource.ts +453 -0
- package/src/durable/MessageDelivery.ts +708 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +363 -0
- package/src/durable/OperationAuthorizer.ts +85 -0
- package/src/durable/PersistentHistory.ts +260 -0
- package/src/durable/PreparedInputAdmission.ts +44 -0
- package/src/durable/Records.ts +1010 -0
- package/src/durable/Recovery.ts +1018 -0
- package/src/durable/RunJournal.ts +1479 -0
- package/src/durable/Schedule.ts +504 -0
- package/src/durable/ScheduleStoreConformance.ts +638 -0
- package/src/durable/ScheduleTransition.ts +265 -0
- package/src/durable/Scheduling.ts +1077 -0
- package/src/durable/SqlMemoryStore.ts +774 -0
- package/src/durable/SqlMessageDeliveryStore.ts +302 -0
- package/src/durable/SqlStorageV2Upgrade.ts +500 -0
- package/src/durable/SqlSubscriptionStore.ts +1440 -0
- package/src/durable/SubmissionLedger.ts +1201 -0
- package/src/durable/SubmissionLedgerConformance.ts +4579 -0
- package/src/durable/SubmissionStatus.ts +14 -0
- package/src/durable/Subscription.ts +544 -0
- package/src/durable/SubscriptionInput.ts +144 -0
- package/src/durable/SubscriptionStoreConformance.ts +945 -0
- package/src/durable/SubscriptionTools.ts +327 -0
- package/src/durable/SubscriptionTransition.ts +302 -0
- package/src/durable/Subscriptions.ts +1210 -0
- package/src/durable/ThreadContextHistory.ts +227 -0
- package/src/durable/ThreadContextHistoryProjection.ts +216 -0
- package/src/durable/ThreadInvariants.ts +442 -0
- package/src/durable/ThreadProjection.ts +269 -0
- package/src/durable/ThreadProjectionMaintenance.ts +67 -0
- package/src/durable/ThreadStore.ts +242 -0
- package/src/durable/ThreadStoreConformance.ts +710 -0
- package/src/durable/ToolReconciler.ts +105 -0
- package/src/durable/WakeScheduler.ts +134 -0
- package/src/durable/WorkerHost.ts +171 -0
- package/src/durable/internal/agent-registration.ts +525 -0
- package/src/durable/internal/agent-updates.ts +302 -0
- package/src/durable/internal/foreign-diagnostic.ts +47 -0
- package/src/durable/internal/journal-checkpoint.ts +104 -0
- package/src/durable/internal/journal-metadata.ts +107 -0
- package/src/durable/internal/messaging-host.ts +608 -0
- package/src/durable/internal/schedule-time.ts +303 -0
- package/src/durable/internal/storage-v2-layout.ts +163 -0
- package/src/durable/internal/storage-v2.ts +73 -0
- package/src/durable/internal/worker-host.ts +2467 -0
- package/src/durable/internal/worker-runtime.ts +9 -0
- package/src/engine/AgentRuntime.ts +37 -0
- package/src/engine/Compaction.ts +11 -0
- package/src/engine/ContextCompactor.ts +277 -0
- package/src/engine/ContextHistory.ts +73 -0
- package/src/engine/ContextWindow.ts +72 -0
- package/src/engine/DurableStep.ts +132 -0
- package/src/engine/MessagingHost.ts +110 -0
- package/src/engine/Output.ts +2 -0
- package/src/engine/RunEventSink.ts +132 -0
- package/src/engine/RunOptions.ts +1077 -0
- package/src/engine/SubagentHost.ts +181 -0
- package/src/engine/ThreadHistory.ts +120 -0
- package/src/engine/ToolBroker.ts +157 -0
- package/src/engine/ToolExposure.ts +48 -0
- package/src/engine/internal/agent-runtime.ts +10117 -0
- package/src/engine/internal/bounded-value.ts +315 -0
- package/src/engine/internal/compaction.ts +678 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/output-contract.ts +173 -0
- package/src/engine/internal/primitive-delta.ts +80 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/tool-derivative.ts +106 -0
- package/src/engine/internal/tool-exposure.ts +224 -0
- package/src/engine/internal/tool-telemetry.ts +484 -0
- package/src/index.ts +96 -53
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +257 -0
- package/src/sandbox/PageCapture.ts +692 -0
- package/src/sandbox/PageCrawl.ts +148 -0
- package/src/sandbox/PageScreenshot.ts +81 -0
- package/src/sandbox/ProtectedBrowser.ts +413 -0
- package/src/sandbox/Sandbox.ts +241 -0
- package/dist/Agent.d.mts +0 -5
- package/dist/Agent.mjs +0 -10
- package/dist/Agent.mjs.map +0 -1
- package/dist/AgentError.d.mts +0 -5
- package/dist/AgentError.mjs +0 -10
- package/dist/AgentError.mjs.map +0 -1
- package/dist/AgentPolicy.d.mts +0 -5
- package/dist/AgentPolicy.mjs +0 -10
- package/dist/AgentPolicy.mjs.map +0 -1
- package/dist/AgentRuntime.d.mts +0 -5
- package/dist/AgentRuntime.mjs +0 -10
- package/dist/AgentRuntime.mjs.map +0 -1
- package/dist/AgentUpdates.d.mts +0 -5
- package/dist/AgentUpdates.mjs +0 -10
- package/dist/AgentUpdates.mjs.map +0 -1
- package/dist/Approval.d.mts +0 -5
- package/dist/Approval.mjs +0 -10
- package/dist/Approval.mjs.map +0 -1
- package/dist/Budget.d.mts +0 -5
- package/dist/Budget.mjs +0 -10
- package/dist/Budget.mjs.map +0 -1
- package/dist/CodeMode.d.mts +0 -5
- package/dist/CodeMode.mjs +0 -10
- package/dist/CodeMode.mjs.map +0 -1
- package/dist/Commands.d.mts +0 -5
- package/dist/Commands.mjs +0 -10
- package/dist/Commands.mjs.map +0 -1
- package/dist/Compaction.d.mts +0 -5
- package/dist/Compaction.mjs +0 -10
- package/dist/Compaction.mjs.map +0 -1
- package/dist/ContextCompactor.d.mts +0 -5
- package/dist/ContextCompactor.mjs +0 -10
- package/dist/ContextCompactor.mjs.map +0 -1
- package/dist/ContextHistory.d.mts +0 -5
- package/dist/ContextHistory.mjs +0 -10
- package/dist/ContextHistory.mjs.map +0 -1
- package/dist/ContextTools.d.mts +0 -5
- package/dist/ContextTools.mjs +0 -10
- package/dist/ContextTools.mjs.map +0 -1
- package/dist/ContextWindow.d.mts +0 -5
- package/dist/ContextWindow.mjs +0 -10
- package/dist/ContextWindow.mjs.map +0 -1
- package/dist/DurableStep.d.mts +0 -5
- package/dist/DurableStep.mjs +0 -10
- package/dist/DurableStep.mjs.map +0 -1
- package/dist/EphemeralThreads.d.mts +0 -5
- package/dist/EphemeralThreads.mjs +0 -10
- package/dist/EphemeralThreads.mjs.map +0 -1
- package/dist/IdGenerator.d.mts +0 -5
- package/dist/IdGenerator.mjs +0 -10
- package/dist/IdGenerator.mjs.map +0 -1
- package/dist/Identifiers.d.mts +0 -5
- package/dist/Identifiers.mjs +0 -10
- package/dist/Identifiers.mjs.map +0 -1
- package/dist/Mcp.d.mts +0 -5
- package/dist/Mcp.mjs +0 -10
- package/dist/Mcp.mjs.map +0 -1
- package/dist/McpClient.d.mts +0 -5
- package/dist/McpClient.mjs +0 -10
- package/dist/McpClient.mjs.map +0 -1
- package/dist/Memory.d.mts +0 -5
- package/dist/Memory.mjs +0 -10
- package/dist/Memory.mjs.map +0 -1
- package/dist/MemoryNamespace.d.mts +0 -5
- package/dist/MemoryNamespace.mjs +0 -10
- package/dist/MemoryNamespace.mjs.map +0 -1
- package/dist/MemoryNotes.d.mts +0 -5
- package/dist/MemoryNotes.mjs +0 -10
- package/dist/MemoryNotes.mjs.map +0 -1
- package/dist/MemoryReference.d.mts +0 -5
- package/dist/MemoryReference.mjs +0 -10
- package/dist/MemoryReference.mjs.map +0 -1
- package/dist/MemoryRevalidation.d.mts +0 -5
- package/dist/MemoryRevalidation.mjs +0 -10
- package/dist/MemoryRevalidation.mjs.map +0 -1
- package/dist/MemoryStore.d.mts +0 -5
- package/dist/MemoryStore.mjs +0 -10
- package/dist/MemoryStore.mjs.map +0 -1
- package/dist/Messaging.d.mts +0 -5
- package/dist/Messaging.mjs +0 -10
- package/dist/Messaging.mjs.map +0 -1
- package/dist/MessagingHost.d.mts +0 -5
- package/dist/MessagingHost.mjs +0 -10
- package/dist/MessagingHost.mjs.map +0 -1
- package/dist/ModelContext.d.mts +0 -5
- package/dist/ModelContext.mjs +0 -10
- package/dist/ModelContext.mjs.map +0 -1
- package/dist/Receipt.d.mts +0 -5
- package/dist/Receipt.mjs +0 -10
- package/dist/Receipt.mjs.map +0 -1
- package/dist/Redaction.d.mts +0 -5
- package/dist/Redaction.mjs +0 -10
- package/dist/Redaction.mjs.map +0 -1
- package/dist/Remembering.d.mts +0 -5
- package/dist/Remembering.mjs +0 -10
- package/dist/Remembering.mjs.map +0 -1
- package/dist/RememberingStore.d.mts +0 -5
- package/dist/RememberingStore.mjs +0 -10
- package/dist/RememberingStore.mjs.map +0 -1
- package/dist/RunEvent.d.mts +0 -5
- package/dist/RunEvent.mjs +0 -10
- package/dist/RunEvent.mjs.map +0 -1
- package/dist/RunEventSink.d.mts +0 -5
- package/dist/RunEventSink.mjs +0 -10
- package/dist/RunEventSink.mjs.map +0 -1
- package/dist/RunHooks.d.mts +0 -5
- package/dist/RunHooks.mjs +0 -10
- package/dist/RunHooks.mjs.map +0 -1
- package/dist/RunOptions.d.mts +0 -5
- package/dist/RunOptions.mjs +0 -10
- package/dist/RunOptions.mjs.map +0 -1
- package/dist/RunPolicyUsage.d.mts +0 -5
- package/dist/RunPolicyUsage.mjs +0 -10
- package/dist/RunPolicyUsage.mjs.map +0 -1
- package/dist/SemanticMemory.d.mts +0 -5
- package/dist/SemanticMemory.mjs +0 -10
- package/dist/SemanticMemory.mjs.map +0 -1
- package/dist/SemanticMemoryIndex.d.mts +0 -5
- package/dist/SemanticMemoryIndex.mjs +0 -10
- package/dist/SemanticMemoryIndex.mjs.map +0 -1
- package/dist/SemanticMemoryRevalidation.d.mts +0 -5
- package/dist/SemanticMemoryRevalidation.mjs +0 -10
- package/dist/SemanticMemoryRevalidation.mjs.map +0 -1
- package/dist/Subagent.d.mts +0 -5
- package/dist/Subagent.mjs +0 -10
- package/dist/Subagent.mjs.map +0 -1
- package/dist/SubagentContract.d.mts +0 -5
- package/dist/SubagentContract.mjs +0 -10
- package/dist/SubagentContract.mjs.map +0 -1
- package/dist/SubagentHost.d.mts +0 -5
- package/dist/SubagentHost.mjs +0 -10
- package/dist/SubagentHost.mjs.map +0 -1
- package/dist/SubagentReservations.d.mts +0 -5
- package/dist/SubagentReservations.mjs +0 -10
- package/dist/SubagentReservations.mjs.map +0 -1
- package/dist/ThreadHistory.d.mts +0 -5
- package/dist/ThreadHistory.mjs +0 -10
- package/dist/ThreadHistory.mjs.map +0 -1
- package/dist/ToolBroker.d.mts +0 -5
- package/dist/ToolBroker.mjs +0 -10
- package/dist/ToolBroker.mjs.map +0 -1
- package/dist/ToolDiscovery.d.mts +0 -5
- package/dist/ToolDiscovery.mjs +0 -10
- package/dist/ToolDiscovery.mjs.map +0 -1
- package/dist/ToolResult.d.mts +0 -5
- package/dist/ToolResult.mjs +0 -10
- package/dist/ToolResult.mjs.map +0 -1
- package/dist/Usage.d.mts +0 -5
- package/dist/Usage.mjs +0 -10
- package/dist/Usage.mjs.map +0 -1
- package/dist/WebCapture.d.mts +0 -5
- package/dist/WebCapture.mjs +0 -10
- package/dist/WebCapture.mjs.map +0 -1
- package/dist/WebSearch.d.mts +0 -5
- package/dist/WebSearch.mjs +0 -10
- package/dist/WebSearch.mjs.map +0 -1
- package/dist/Worker.d.mts +0 -5
- package/dist/Worker.mjs +0 -10
- package/dist/Worker.mjs.map +0 -1
- package/dist/rolldown-runtime-BBjsoOtd.mjs +0 -27
- package/src/Agent.ts +0 -1
- package/src/AgentError.ts +0 -1
- package/src/AgentPolicy.ts +0 -1
- package/src/AgentRuntime.ts +0 -1
- package/src/AgentUpdates.ts +0 -1
- package/src/Approval.ts +0 -1
- package/src/Budget.ts +0 -1
- package/src/CodeMode.ts +0 -1
- package/src/Commands.ts +0 -1
- package/src/Compaction.ts +0 -1
- package/src/ContextCompactor.ts +0 -1
- package/src/ContextHistory.ts +0 -1
- package/src/ContextTools.ts +0 -1
- package/src/ContextWindow.ts +0 -1
- package/src/DurableStep.ts +0 -1
- package/src/EphemeralThreads.ts +0 -1
- package/src/IdGenerator.ts +0 -1
- package/src/Identifiers.ts +0 -1
- package/src/Mcp.ts +0 -1
- package/src/McpClient.ts +0 -1
- package/src/Memory.ts +0 -1
- package/src/MemoryNamespace.ts +0 -1
- package/src/MemoryNotes.ts +0 -1
- package/src/MemoryReference.ts +0 -1
- package/src/MemoryRevalidation.ts +0 -1
- package/src/MemoryStore.ts +0 -1
- package/src/Messaging.ts +0 -1
- package/src/MessagingHost.ts +0 -1
- package/src/ModelContext.ts +0 -1
- package/src/Receipt.ts +0 -1
- package/src/Redaction.ts +0 -1
- package/src/Remembering.ts +0 -1
- package/src/RememberingStore.ts +0 -1
- package/src/RunEvent.ts +0 -1
- package/src/RunEventSink.ts +0 -1
- package/src/RunHooks.ts +0 -1
- package/src/RunOptions.ts +0 -1
- package/src/RunPolicyUsage.ts +0 -1
- package/src/SemanticMemory.ts +0 -1
- package/src/SemanticMemoryIndex.ts +0 -1
- package/src/SemanticMemoryRevalidation.ts +0 -1
- package/src/Subagent.ts +0 -1
- package/src/SubagentContract.ts +0 -1
- package/src/SubagentHost.ts +0 -1
- package/src/SubagentReservations.ts +0 -1
- package/src/ThreadHistory.ts +0 -1
- package/src/ToolBroker.ts +0 -1
- package/src/ToolDiscovery.ts +0 -1
- package/src/ToolResult.ts +0 -1
- package/src/Usage.ts +0 -1
- package/src/WebCapture.ts +0 -1
- package/src/WebSearch.ts +0 -1
- package/src/Worker.ts +0 -1
|
@@ -0,0 +1,575 @@
|
|
|
1
|
+
import type { Effect, Layer, Option, Schema } from "effect";
|
|
2
|
+
import * as S from "effect/Schema";
|
|
3
|
+
import {
|
|
4
|
+
type AiError,
|
|
5
|
+
type LanguageModel,
|
|
6
|
+
type Model,
|
|
7
|
+
type Prompt,
|
|
8
|
+
Tool,
|
|
9
|
+
type Toolkit,
|
|
10
|
+
} from "effect/unstable/ai";
|
|
11
|
+
|
|
12
|
+
import type { AgentInputError, AgentOutputError, AgentRunDispositionError } from "./AgentError.ts";
|
|
13
|
+
import { AgentPolicy, type AgentPolicyInput } from "./AgentPolicy.ts";
|
|
14
|
+
import { AgentId } from "./Identifiers.ts";
|
|
15
|
+
import { type UpdateToolkit, withUpdateTool } from "./internal/agent-updates.ts";
|
|
16
|
+
import type { Configuration } from "./ToolExposure.ts";
|
|
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 Layers providing the native model and both identity services. */
|
|
37
|
+
export type NativeModel<ModelValue> =
|
|
38
|
+
ModelValue extends Layer.Layer<infer Provides, never, infer _Requires>
|
|
39
|
+
? ModelServices extends Provides
|
|
40
|
+
? ModelValue
|
|
41
|
+
: never
|
|
42
|
+
: never;
|
|
43
|
+
|
|
44
|
+
/** Definition-owned boundary for selecting and validating an application run disposition. */
|
|
45
|
+
export interface RunDispositionDeclaration<Output, DispositionSchema extends Schema.Top> {
|
|
46
|
+
/** Canonical Schema used to validate and encode the selected disposition. */
|
|
47
|
+
readonly schema: DispositionSchema;
|
|
48
|
+
/** Pure selection from decoded output; `undefined` means this ordinary Run declares none. */
|
|
49
|
+
readonly fromOutput: (output: Output) => unknown;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Values available to a Definition-owned completion Tool projector after canonical decoding. */
|
|
53
|
+
export interface CompletionProjectionInput<Parameters = unknown, Result = unknown> {
|
|
54
|
+
readonly parameters: Parameters;
|
|
55
|
+
readonly result: Result;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* One application Tool whose successful result can complete its owning Agent when it is the
|
|
60
|
+
* only application call. Provider-executed calls may accompany it only with terminal results.
|
|
61
|
+
* Mixed, wholly unexecuted application batches are rejected with failed Tool results so the
|
|
62
|
+
* model can correct them within ordinary Run budgets; completed provider results are retained.
|
|
63
|
+
* Missing provider results and invalid pending resumed batches fail closed. The completion
|
|
64
|
+
* designation never permits side-effect replay.
|
|
65
|
+
*/
|
|
66
|
+
export interface CompletionToolDeclaration<
|
|
67
|
+
Parameters = unknown,
|
|
68
|
+
Result = unknown,
|
|
69
|
+
Output = unknown,
|
|
70
|
+
> {
|
|
71
|
+
readonly tool: string;
|
|
72
|
+
/** Require native Tool use on every model Turn and this Tool for final completion. */
|
|
73
|
+
readonly required?: boolean | undefined;
|
|
74
|
+
readonly project: (input: CompletionProjectionInput<Parameters, Result>) => Output;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
type CompletionToolFor<ToolkitValue extends Toolkit.Any, Output> = {
|
|
78
|
+
readonly [Name in keyof ToolkitValue["tools"] & string]: CompletionToolDeclaration<
|
|
79
|
+
Tool.Parameters<ToolkitValue["tools"][Name]>,
|
|
80
|
+
Tool.Success<ToolkitValue["tools"][Name]>,
|
|
81
|
+
Output
|
|
82
|
+
> & { readonly tool: Name };
|
|
83
|
+
}[keyof ToolkitValue["tools"] & string];
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* An ordinary action Tool whose canonical success may satisfy the whole request.
|
|
87
|
+
* Projectors must be pure and deterministic: recovery re-evaluates them. None preserves
|
|
88
|
+
* ordinary continuation; Some is validated as the Agent output. These Tools must be the sole
|
|
89
|
+
* application call; terminal provider results may accompany them. They never receive the
|
|
90
|
+
* required completion Tool's exhaustion allowance.
|
|
91
|
+
*/
|
|
92
|
+
export interface CompletionFromToolDeclaration<
|
|
93
|
+
Parameters = unknown,
|
|
94
|
+
Result = unknown,
|
|
95
|
+
Output = unknown,
|
|
96
|
+
> {
|
|
97
|
+
readonly tool: string;
|
|
98
|
+
readonly project: (input: CompletionProjectionInput<Parameters, Result>) => Option.Option<Output>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
type CompletionFromToolFor<ToolkitValue extends Toolkit.Any, Output> = {
|
|
102
|
+
readonly [Name in keyof ToolkitValue["tools"] & string]: CompletionFromToolDeclaration<
|
|
103
|
+
Tool.Parameters<ToolkitValue["tools"][Name]>,
|
|
104
|
+
Tool.Success<ToolkitValue["tools"][Name]>,
|
|
105
|
+
Output
|
|
106
|
+
> & { readonly tool: Name };
|
|
107
|
+
}[keyof ToolkitValue["tools"] & string];
|
|
108
|
+
|
|
109
|
+
/** Immutable, model-agnostic schemas, behavior, tools, and bounds for an agent. */
|
|
110
|
+
export interface Definition<
|
|
111
|
+
InputSchema extends Schema.Top,
|
|
112
|
+
OutputSchema extends Schema.Top,
|
|
113
|
+
Instructions,
|
|
114
|
+
ToolkitValue extends Toolkit.Any,
|
|
115
|
+
RunDispositionValue = undefined,
|
|
116
|
+
InputPromptValue = undefined,
|
|
117
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
118
|
+
> {
|
|
119
|
+
/** Stable agent identity; changing it creates a distinct definition identity. */
|
|
120
|
+
readonly id: AgentId;
|
|
121
|
+
/** Canonical Schema for intermediate updates emitted by this Agent. */
|
|
122
|
+
readonly updates?: UpdatesSchema;
|
|
123
|
+
/** Canonical schema used to decode and encode run input. */
|
|
124
|
+
readonly input: InputSchema;
|
|
125
|
+
/** Canonical schema used to decode the final model output. */
|
|
126
|
+
readonly output: OutputSchema;
|
|
127
|
+
/** Instructions evaluated once while preparing each run. */
|
|
128
|
+
readonly instructions: Instructions;
|
|
129
|
+
/** Optional projection from decoded input to model-visible native Effect AI prompt content. */
|
|
130
|
+
readonly inputPrompt?: InputPromptValue | undefined;
|
|
131
|
+
/** Native Effect AI toolkit whose failures and requirements remain visible. */
|
|
132
|
+
readonly toolkit: ToolkitValue;
|
|
133
|
+
readonly toolExposure?: Configuration | undefined;
|
|
134
|
+
/** Finite execution bounds enforced by the runtime. */
|
|
135
|
+
readonly policy: AgentPolicy;
|
|
136
|
+
/** Explicit policy fields, retained so delegated runs can inherit omitted fields. */
|
|
137
|
+
readonly policyOverrides?: Partial<AgentPolicyInput> | undefined;
|
|
138
|
+
/** Optional successful Tool result that projects directly to the Agent output and settles. */
|
|
139
|
+
readonly completion?: CompletionToolDeclaration | undefined;
|
|
140
|
+
readonly completionFromTools?: ReadonlyArray<CompletionFromToolDeclaration> | undefined;
|
|
141
|
+
readonly runDisposition?: RunDispositionValue | undefined;
|
|
142
|
+
readonly description?: string | undefined;
|
|
143
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/** Options for a model-agnostic agent definition. */
|
|
147
|
+
export interface DefinitionOptions<
|
|
148
|
+
InputSchema extends Schema.Top,
|
|
149
|
+
OutputSchema extends Schema.Top,
|
|
150
|
+
Instructions extends InstructionSource<InputSchema["Type"], unknown, unknown>,
|
|
151
|
+
ToolkitValue extends Toolkit.Any,
|
|
152
|
+
RunDispositionValue extends
|
|
153
|
+
| RunDispositionDeclaration<OutputSchema["Type"], Schema.Top>
|
|
154
|
+
| undefined = undefined,
|
|
155
|
+
InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined =
|
|
156
|
+
undefined,
|
|
157
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
158
|
+
> {
|
|
159
|
+
readonly updates?: UpdatesSchema;
|
|
160
|
+
readonly input: InputSchema;
|
|
161
|
+
readonly output: OutputSchema;
|
|
162
|
+
readonly instructions: Instructions;
|
|
163
|
+
readonly inputPrompt?: InputPromptValue | undefined;
|
|
164
|
+
readonly toolkit: ToolkitValue;
|
|
165
|
+
readonly toolExposure?: Configuration | undefined;
|
|
166
|
+
readonly policy?: Partial<AgentPolicyInput> | undefined;
|
|
167
|
+
readonly completion?: CompletionToolFor<ToolkitValue, OutputSchema["Type"]> | undefined;
|
|
168
|
+
readonly completionFromTools?:
|
|
169
|
+
| ReadonlyArray<CompletionFromToolFor<ToolkitValue, OutputSchema["Type"]>>
|
|
170
|
+
| undefined;
|
|
171
|
+
readonly runDisposition?: RunDispositionValue | undefined;
|
|
172
|
+
readonly description?: string | undefined;
|
|
173
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
type AnyDefinitionShape = Definition<
|
|
177
|
+
Schema.Top,
|
|
178
|
+
Schema.Top,
|
|
179
|
+
unknown,
|
|
180
|
+
Toolkit.Any,
|
|
181
|
+
RunDispositionDeclaration<never, Schema.Top> | undefined,
|
|
182
|
+
unknown,
|
|
183
|
+
Schema.Top | undefined
|
|
184
|
+
>;
|
|
185
|
+
|
|
186
|
+
/** Immutable pairing of an agent definition with its native model Layer. */
|
|
187
|
+
export interface Binding<DefinitionValue extends AnyDefinitionShape, ModelValue> {
|
|
188
|
+
readonly definition: DefinitionValue;
|
|
189
|
+
readonly model: NativeModel<ModelValue>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
type InstructionEffect<Instructions, Input> = Instructions extends (input: Input) => infer Result
|
|
193
|
+
? Result
|
|
194
|
+
: Instructions;
|
|
195
|
+
|
|
196
|
+
type InputPromptEffect<InputPrompt, Input> = InputPrompt extends (input: Input) => infer Result
|
|
197
|
+
? Result
|
|
198
|
+
: never;
|
|
199
|
+
|
|
200
|
+
type EffectError<Value> =
|
|
201
|
+
Value extends Effect.Effect<infer _Success, infer Error, infer _Services> ? Error : never;
|
|
202
|
+
|
|
203
|
+
type EffectServices<Value> =
|
|
204
|
+
Value extends Effect.Effect<infer _Success, infer _Error, infer Services> ? Services : never;
|
|
205
|
+
|
|
206
|
+
type ModelRequirements<Value> =
|
|
207
|
+
Value extends Layer.Layer<infer _Provides, infer _Error, infer Services> ? Services : never;
|
|
208
|
+
|
|
209
|
+
/** Constructors and type projections for definitions and runnable model bindings. */
|
|
210
|
+
|
|
211
|
+
/** Type-erased definition used at generic framework boundaries. */
|
|
212
|
+
export type AnyDefinition = AnyDefinitionShape;
|
|
213
|
+
|
|
214
|
+
/** Read-only interpreter program or binding used at inspection and projection boundaries. */
|
|
215
|
+
export interface Any {
|
|
216
|
+
readonly definition: AnyDefinition;
|
|
217
|
+
readonly model?: unknown;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/** Native Tool configuration for inspection; it does not predict an invocation's outcome. */
|
|
221
|
+
export const ToolInspection = S.Struct({
|
|
222
|
+
name: S.String,
|
|
223
|
+
failureMode: S.Literals(["error", "return"]),
|
|
224
|
+
/** False for provider-executed Tools, whose results do not pass through local handlers. */
|
|
225
|
+
requiresHandler: S.Boolean,
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
export type ToolInspection = typeof ToolInspection.Type;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Inspect registered native Tools in declaration order without acquiring handlers or a Model.
|
|
232
|
+
* This is the full Definition toolkit, before run-specific visibility or exposure filtering.
|
|
233
|
+
* `failureMode` is Effect AI's configured mode, including its `"error"` default. Handler-level
|
|
234
|
+
* recovery, programmatic invocation and Subagent containment can change where failures go;
|
|
235
|
+
* consult execution diagnostics for the actual route. No arguments, results or services are read.
|
|
236
|
+
*/
|
|
237
|
+
export const inspectTools = (agent: AnyDefinition | Any): ReadonlyArray<ToolInspection> => {
|
|
238
|
+
const definition = "definition" in agent ? agent.definition : agent;
|
|
239
|
+
|
|
240
|
+
return Object.values(definition.toolkit.tools).map((tool) =>
|
|
241
|
+
ToolInspection.make({
|
|
242
|
+
name: tool.name,
|
|
243
|
+
failureMode: tool.failureMode,
|
|
244
|
+
requiresHandler: !Tool.isProviderDefined(tool) || tool.requiresHandler,
|
|
245
|
+
}),
|
|
246
|
+
);
|
|
247
|
+
};
|
|
248
|
+
|
|
249
|
+
type DefinitionOf<AgentValue extends AnyDefinition | Any> = AgentValue extends {
|
|
250
|
+
readonly definition: infer DefinitionValue extends AnyDefinition;
|
|
251
|
+
}
|
|
252
|
+
? DefinitionValue
|
|
253
|
+
: AgentValue;
|
|
254
|
+
|
|
255
|
+
type RunDispositionSchemaOf<DefinitionValue extends AnyDefinition> = [
|
|
256
|
+
Exclude<DefinitionValue["runDisposition"], undefined>,
|
|
257
|
+
] extends [never]
|
|
258
|
+
? never
|
|
259
|
+
: Exclude<DefinitionValue["runDisposition"], undefined> extends RunDispositionDeclaration<
|
|
260
|
+
never,
|
|
261
|
+
infer DispositionSchema
|
|
262
|
+
>
|
|
263
|
+
? DispositionSchema
|
|
264
|
+
: never;
|
|
265
|
+
|
|
266
|
+
/** Literal Agent ID, retained by Agent.make. */
|
|
267
|
+
export type Name<A extends AnyDefinition | Any> = DefinitionOf<A>["id"] extends AgentId &
|
|
268
|
+
(infer N extends string)
|
|
269
|
+
? N
|
|
270
|
+
: string;
|
|
271
|
+
|
|
272
|
+
/** Declared update Schema, or never for Agents without updates. */
|
|
273
|
+
export type UpdatesSchema<A extends AnyDefinition | Any> = Exclude<
|
|
274
|
+
DefinitionOf<A>["updates"],
|
|
275
|
+
undefined
|
|
276
|
+
>;
|
|
277
|
+
|
|
278
|
+
/** Decoded intermediate update value. */
|
|
279
|
+
export type Update<A extends AnyDefinition | Any> = UpdatesSchema<A>["Type"];
|
|
280
|
+
|
|
281
|
+
/** Decoded input type of a definition or binding. */
|
|
282
|
+
export type Input<AgentValue extends AnyDefinition | Any> =
|
|
283
|
+
DefinitionOf<AgentValue>["input"]["Type"];
|
|
284
|
+
|
|
285
|
+
/** Encoded input accepted by the primary execution operations. */
|
|
286
|
+
export type EncodedInput<AgentValue extends AnyDefinition | Any> =
|
|
287
|
+
DefinitionOf<AgentValue>["input"]["Encoded"];
|
|
288
|
+
|
|
289
|
+
/** Decoded output type of a definition or binding. */
|
|
290
|
+
export type Output<AgentValue extends AnyDefinition | Any> =
|
|
291
|
+
DefinitionOf<AgentValue>["output"]["Type"];
|
|
292
|
+
|
|
293
|
+
/** Input Schema carried by a definition or binding. */
|
|
294
|
+
export type InputSchema<AgentValue extends AnyDefinition | Any> = DefinitionOf<AgentValue>["input"];
|
|
295
|
+
|
|
296
|
+
/** Output Schema carried by a definition or binding. */
|
|
297
|
+
export type OutputSchema<AgentValue extends AnyDefinition | Any> =
|
|
298
|
+
DefinitionOf<AgentValue>["output"];
|
|
299
|
+
|
|
300
|
+
/** Application run-disposition Schema carried by a definition or binding, or `never`. */
|
|
301
|
+
export type RunDispositionSchema<AgentValue extends AnyDefinition | Any> = RunDispositionSchemaOf<
|
|
302
|
+
DefinitionOf<AgentValue>
|
|
303
|
+
>;
|
|
304
|
+
|
|
305
|
+
/** Decoded application run disposition declared by a definition or binding. */
|
|
306
|
+
export type RunDisposition<AgentValue extends AnyDefinition | Any> = [
|
|
307
|
+
RunDispositionSchema<AgentValue>,
|
|
308
|
+
] extends [never]
|
|
309
|
+
? never
|
|
310
|
+
: RunDispositionSchema<AgentValue>["Type"];
|
|
311
|
+
|
|
312
|
+
/** Validation failure admitted only by definitions that declare a run disposition. */
|
|
313
|
+
export type RunDispositionFailure<AgentValue extends AnyDefinition | Any> = [
|
|
314
|
+
RunDispositionSchemaOf<DefinitionOf<AgentValue>>,
|
|
315
|
+
] extends [never]
|
|
316
|
+
? never
|
|
317
|
+
: AgentRunDispositionError;
|
|
318
|
+
|
|
319
|
+
/** Effect AI tool map carried by a definition or binding. */
|
|
320
|
+
export type Tools<AgentValue extends AnyDefinition | Any> = Toolkit.Tools<
|
|
321
|
+
DefinitionOf<AgentValue>["toolkit"]
|
|
322
|
+
>;
|
|
323
|
+
|
|
324
|
+
type ApplicationTools<A extends AnyDefinition> = [UpdatesSchema<A>] extends [never]
|
|
325
|
+
? Tools<A>
|
|
326
|
+
: Omit<Tools<A>, "emit_update">;
|
|
327
|
+
|
|
328
|
+
type ToolMapValues<ToolMap extends Record<string, Tool.Any>> = ToolMap extends unknown
|
|
329
|
+
? ToolMap[keyof ToolMap]
|
|
330
|
+
: never;
|
|
331
|
+
|
|
332
|
+
/** All possible tools, including keys present in only one definition or binding branch. */
|
|
333
|
+
export type ToolUnion<AgentValue extends AnyDefinition | Any> = ToolMapValues<Tools<AgentValue>>;
|
|
334
|
+
|
|
335
|
+
/** Instruction, tool-handler, and Schema services required before a Model is bound. */
|
|
336
|
+
export type DefinitionRequirements<DefinitionValue extends AnyDefinition> =
|
|
337
|
+
DefinitionValue extends unknown
|
|
338
|
+
?
|
|
339
|
+
| EffectServices<InstructionEffect<DefinitionValue["instructions"], Input<DefinitionValue>>>
|
|
340
|
+
| EffectServices<InputPromptEffect<DefinitionValue["inputPrompt"], Input<DefinitionValue>>>
|
|
341
|
+
| Tool.HandlersFor<ApplicationTools<DefinitionValue>>
|
|
342
|
+
| Tool.HandlerServices<ToolMapValues<ApplicationTools<DefinitionValue>>>
|
|
343
|
+
// The interpreter canonically re-encodes decoded Tool parameters before recording them.
|
|
344
|
+
| Tool.ParametersSchema<ToolUnion<DefinitionValue>>["EncodingServices"]
|
|
345
|
+
| Tool.SuccessSchema<ToolUnion<DefinitionValue>>["DecodingServices"]
|
|
346
|
+
| DefinitionValue["input"]["DecodingServices"]
|
|
347
|
+
| DefinitionValue["input"]["EncodingServices"]
|
|
348
|
+
| DefinitionValue["output"]["DecodingServices"]
|
|
349
|
+
| DefinitionValue["output"]["EncodingServices"]
|
|
350
|
+
| UpdatesSchema<DefinitionValue>["DecodingServices"]
|
|
351
|
+
| UpdatesSchema<DefinitionValue>["EncodingServices"]
|
|
352
|
+
| RunDispositionSchemaOf<DefinitionValue>["DecodingServices"]
|
|
353
|
+
| RunDispositionSchemaOf<DefinitionValue>["EncodingServices"]
|
|
354
|
+
: never;
|
|
355
|
+
|
|
356
|
+
/** Definition services plus native model services, or a binding's model Layer requirements. */
|
|
357
|
+
export type Requirements<AgentValue extends AnyDefinition | Any> =
|
|
358
|
+
| DefinitionRequirements<DefinitionOf<AgentValue>>
|
|
359
|
+
| (AgentValue extends { readonly model: infer ModelValue }
|
|
360
|
+
? ModelRequirements<ModelValue>
|
|
361
|
+
: ModelServices);
|
|
362
|
+
|
|
363
|
+
// Distribute after unwrapping bindings too: withModel may itself contain a definition union.
|
|
364
|
+
type DefinitionFailure<DefinitionValue extends AnyDefinition> = DefinitionValue extends unknown
|
|
365
|
+
?
|
|
366
|
+
| EffectError<InstructionEffect<DefinitionValue["instructions"], Input<DefinitionValue>>>
|
|
367
|
+
| EffectError<InputPromptEffect<DefinitionValue["inputPrompt"], Input<DefinitionValue>>>
|
|
368
|
+
| Tool.HandlerError<ToolUnion<DefinitionValue>>
|
|
369
|
+
: never;
|
|
370
|
+
|
|
371
|
+
/** Failures from every possible definition, preserving each branch's instruction input type. */
|
|
372
|
+
export type Failure<AgentValue extends AnyDefinition | Any> =
|
|
373
|
+
| DefinitionFailure<DefinitionOf<AgentValue>>
|
|
374
|
+
| AiError.AiError
|
|
375
|
+
| AgentInputError
|
|
376
|
+
| AgentOutputError
|
|
377
|
+
| RunDispositionFailure<AgentValue>;
|
|
378
|
+
|
|
379
|
+
/** Validate an agent ID and return a shallowly frozen, model-agnostic definition. */
|
|
380
|
+
export function make<
|
|
381
|
+
const Name extends string,
|
|
382
|
+
InputSchema extends Schema.Top,
|
|
383
|
+
OutputSchema extends Schema.Top,
|
|
384
|
+
Instructions extends InstructionSource<InputSchema["Type"], unknown, unknown>,
|
|
385
|
+
ToolkitValue extends Toolkit.Any,
|
|
386
|
+
DispositionSchema extends Schema.Top,
|
|
387
|
+
InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined,
|
|
388
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
389
|
+
>(
|
|
390
|
+
id: Name,
|
|
391
|
+
options: DefinitionOptions<
|
|
392
|
+
InputSchema,
|
|
393
|
+
OutputSchema,
|
|
394
|
+
Instructions,
|
|
395
|
+
ToolkitValue,
|
|
396
|
+
RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>,
|
|
397
|
+
InputPromptValue,
|
|
398
|
+
UpdatesSchema
|
|
399
|
+
> & {
|
|
400
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>;
|
|
401
|
+
readonly inputPrompt: InputPromptValue;
|
|
402
|
+
},
|
|
403
|
+
): Definition<
|
|
404
|
+
InputSchema,
|
|
405
|
+
OutputSchema,
|
|
406
|
+
Instructions,
|
|
407
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
408
|
+
RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>,
|
|
409
|
+
InputPromptValue,
|
|
410
|
+
NoInfer<UpdatesSchema>
|
|
411
|
+
> & { readonly id: AgentId & Name };
|
|
412
|
+
|
|
413
|
+
export function make<
|
|
414
|
+
const Name extends string,
|
|
415
|
+
InputSchema extends Schema.Top,
|
|
416
|
+
OutputSchema extends Schema.Top,
|
|
417
|
+
Instructions extends InstructionSource<InputSchema["Type"], unknown, unknown>,
|
|
418
|
+
ToolkitValue extends Toolkit.Any,
|
|
419
|
+
DispositionSchema extends Schema.Top,
|
|
420
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
421
|
+
>(
|
|
422
|
+
id: Name,
|
|
423
|
+
options: DefinitionOptions<
|
|
424
|
+
InputSchema,
|
|
425
|
+
OutputSchema,
|
|
426
|
+
Instructions,
|
|
427
|
+
ToolkitValue,
|
|
428
|
+
RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>,
|
|
429
|
+
undefined,
|
|
430
|
+
UpdatesSchema
|
|
431
|
+
> & {
|
|
432
|
+
readonly runDisposition: RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>;
|
|
433
|
+
readonly inputPrompt?: undefined;
|
|
434
|
+
},
|
|
435
|
+
): Definition<
|
|
436
|
+
InputSchema,
|
|
437
|
+
OutputSchema,
|
|
438
|
+
Instructions,
|
|
439
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
440
|
+
RunDispositionDeclaration<OutputSchema["Type"], DispositionSchema>,
|
|
441
|
+
undefined,
|
|
442
|
+
NoInfer<UpdatesSchema>
|
|
443
|
+
> & { readonly id: AgentId & Name };
|
|
444
|
+
|
|
445
|
+
export function make<
|
|
446
|
+
const Name extends string,
|
|
447
|
+
InputSchema extends Schema.Top,
|
|
448
|
+
OutputSchema extends Schema.Top,
|
|
449
|
+
Instructions extends InstructionSource<InputSchema["Type"], unknown, unknown>,
|
|
450
|
+
ToolkitValue extends Toolkit.Any,
|
|
451
|
+
InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined,
|
|
452
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
453
|
+
>(
|
|
454
|
+
id: Name,
|
|
455
|
+
options: DefinitionOptions<
|
|
456
|
+
InputSchema,
|
|
457
|
+
OutputSchema,
|
|
458
|
+
Instructions,
|
|
459
|
+
ToolkitValue,
|
|
460
|
+
undefined,
|
|
461
|
+
InputPromptValue,
|
|
462
|
+
UpdatesSchema
|
|
463
|
+
> & {
|
|
464
|
+
readonly inputPrompt: InputPromptValue;
|
|
465
|
+
readonly runDisposition?: undefined;
|
|
466
|
+
},
|
|
467
|
+
): Definition<
|
|
468
|
+
InputSchema,
|
|
469
|
+
OutputSchema,
|
|
470
|
+
Instructions,
|
|
471
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
472
|
+
undefined,
|
|
473
|
+
InputPromptValue,
|
|
474
|
+
NoInfer<UpdatesSchema>
|
|
475
|
+
> & { readonly id: AgentId & Name };
|
|
476
|
+
|
|
477
|
+
export function make<
|
|
478
|
+
const Name extends string,
|
|
479
|
+
InputSchema extends Schema.Top,
|
|
480
|
+
OutputSchema extends Schema.Top,
|
|
481
|
+
Instructions extends InstructionSource<InputSchema["Type"], unknown, unknown>,
|
|
482
|
+
ToolkitValue extends Toolkit.Any,
|
|
483
|
+
UpdatesSchema extends Schema.Top | undefined = undefined,
|
|
484
|
+
>(
|
|
485
|
+
id: Name,
|
|
486
|
+
options: DefinitionOptions<
|
|
487
|
+
InputSchema,
|
|
488
|
+
OutputSchema,
|
|
489
|
+
Instructions,
|
|
490
|
+
ToolkitValue,
|
|
491
|
+
undefined,
|
|
492
|
+
undefined,
|
|
493
|
+
UpdatesSchema
|
|
494
|
+
> & {
|
|
495
|
+
readonly inputPrompt?: undefined;
|
|
496
|
+
readonly runDisposition?: undefined;
|
|
497
|
+
},
|
|
498
|
+
): Definition<
|
|
499
|
+
InputSchema,
|
|
500
|
+
OutputSchema,
|
|
501
|
+
Instructions,
|
|
502
|
+
UpdateToolkit<ToolkitValue, NoInfer<UpdatesSchema>>,
|
|
503
|
+
undefined,
|
|
504
|
+
undefined,
|
|
505
|
+
NoInfer<UpdatesSchema>
|
|
506
|
+
> & { readonly id: AgentId & Name };
|
|
507
|
+
|
|
508
|
+
export function make(
|
|
509
|
+
id: string,
|
|
510
|
+
options: {
|
|
511
|
+
readonly updates?: Schema.Top | undefined;
|
|
512
|
+
readonly input: Schema.Top;
|
|
513
|
+
readonly output: Schema.Top;
|
|
514
|
+
readonly instructions: unknown;
|
|
515
|
+
readonly inputPrompt?: unknown;
|
|
516
|
+
readonly toolkit: Toolkit.Any;
|
|
517
|
+
readonly toolExposure?: Configuration | undefined;
|
|
518
|
+
readonly policy?: Partial<AgentPolicyInput> | undefined;
|
|
519
|
+
readonly completion?: CompletionToolDeclaration | undefined;
|
|
520
|
+
readonly completionFromTools?: ReadonlyArray<CompletionFromToolDeclaration> | undefined;
|
|
521
|
+
readonly runDisposition?: RunDispositionDeclaration<never, Schema.Top> | undefined;
|
|
522
|
+
readonly description?: string | undefined;
|
|
523
|
+
readonly metadata?: Readonly<Record<string, string>> | undefined;
|
|
524
|
+
},
|
|
525
|
+
): AnyDefinition {
|
|
526
|
+
const completionNames = new Set<string>();
|
|
527
|
+
|
|
528
|
+
for (const declaration of options.completionFromTools ?? []) {
|
|
529
|
+
if (declaration.tool === options.completion?.tool || completionNames.has(declaration.tool)) {
|
|
530
|
+
throw new Error(`Tool ${declaration.tool} has more than one completion declaration`);
|
|
531
|
+
}
|
|
532
|
+
if (!Object.hasOwn(options.toolkit.tools, declaration.tool)) {
|
|
533
|
+
throw new Error(`Unknown completion Tool ${declaration.tool}`);
|
|
534
|
+
}
|
|
535
|
+
completionNames.add(declaration.tool);
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
return Object.freeze({
|
|
539
|
+
...options,
|
|
540
|
+
toolkit: withUpdateTool(options.toolkit, options.updates),
|
|
541
|
+
policy: AgentPolicy.resolve(options.policy),
|
|
542
|
+
policyOverrides: Object.freeze({ ...options.policy }),
|
|
543
|
+
toolExposure:
|
|
544
|
+
options.toolExposure === undefined
|
|
545
|
+
? undefined
|
|
546
|
+
: Object.freeze({
|
|
547
|
+
...options.toolExposure,
|
|
548
|
+
initialToolNames: Object.freeze([...(options.toolExposure.initialToolNames ?? [])]),
|
|
549
|
+
}),
|
|
550
|
+
id: S.decodeSync(AgentId)(id),
|
|
551
|
+
metadata: options.metadata === undefined ? undefined : Object.freeze({ ...options.metadata }),
|
|
552
|
+
completion:
|
|
553
|
+
options.completion === undefined ? undefined : Object.freeze({ ...options.completion }),
|
|
554
|
+
completionFromTools:
|
|
555
|
+
options.completionFromTools === undefined
|
|
556
|
+
? undefined
|
|
557
|
+
: Object.freeze(
|
|
558
|
+
options.completionFromTools.map((declaration) => Object.freeze({ ...declaration })),
|
|
559
|
+
),
|
|
560
|
+
runDisposition:
|
|
561
|
+
options.runDisposition === undefined
|
|
562
|
+
? undefined
|
|
563
|
+
: Object.freeze({ ...options.runDisposition }),
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
/** Fix a model Layer for registration or delegation without acquiring or hiding its requirements. */
|
|
568
|
+
export const withModel = <DefinitionValue extends AnyDefinition, ModelValue>(
|
|
569
|
+
definition: DefinitionValue,
|
|
570
|
+
model: NativeModel<ModelValue>,
|
|
571
|
+
): Binding<DefinitionValue, ModelValue> =>
|
|
572
|
+
Object.freeze({
|
|
573
|
+
definition,
|
|
574
|
+
model,
|
|
575
|
+
});
|