effect-agent 0.1.0-beta.12 → 0.1.0-beta.121
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-1DMSO_Fl.mjs +86 -0
- package/dist/Agent-1DMSO_Fl.mjs.map +1 -0
- package/dist/Agent-D9cXqfF3.d.mts +252 -0
- package/dist/AgentError-Bn1ytXRD.d.mts +117 -0
- package/dist/AgentPolicy-BqDoSXO6.d.mts +96 -0
- package/dist/AgentRuntime-BUxDdLpw.d.mts +346 -0
- package/dist/AgentRuntime-Cp1hAb-W.mjs +4739 -0
- package/dist/AgentRuntime-Cp1hAb-W.mjs.map +1 -0
- package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
- package/dist/ContextCompactor-WwSIG_Z2.d.mts +161 -0
- package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
- package/dist/DurableAgentRuntime-B-9w7jDt.mjs +7061 -0
- package/dist/DurableAgentRuntime-B-9w7jDt.mjs.map +1 -0
- package/dist/DurableFailpoint-Cnr3wx1L.d.mts +41 -0
- package/dist/DurableStep-Cry_iol4.d.mts +103 -0
- package/dist/EventSource-CnlZ3Kma.d.mts +51 -0
- package/dist/FailureDiagnostic-BElLOoED.mjs +274 -0
- package/dist/FailureDiagnostic-BElLOoED.mjs.map +1 -0
- package/dist/FailureDiagnostic-CaAkzGHL.d.mts +223 -0
- package/dist/Identifiers-CN2s30fF.d.mts +40 -0
- package/dist/InMemory.d.mts +24 -0
- package/dist/InMemory.mjs +24 -0
- package/dist/InMemory.mjs.map +1 -0
- package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
- package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
- package/dist/Messaging-Dkg87ebg.d.mts +221 -0
- package/dist/Messaging-JYYN3oYS.d.mts +1067 -0
- package/dist/MessagingHost-CqzpxbGz.d.mts +74 -0
- package/dist/MessagingHost-DfsbMPvq.mjs +110 -0
- package/dist/MessagingHost-DfsbMPvq.mjs.map +1 -0
- package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
- package/dist/Output-V-6YL1_Z.d.mts +25 -0
- package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
- package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
- package/dist/PreparedInputAdmission-BQLGldl-.d.mts +42 -0
- package/dist/Receipt-BAHyigAF.d.mts +33 -0
- package/dist/Records-D88mgvyS.d.mts +4214 -0
- package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
- package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
- package/dist/RunJournal-BXrq0VIK.mjs +931 -0
- package/dist/RunJournal-BXrq0VIK.mjs.map +1 -0
- package/dist/RunOptions-CSBsSj0X.d.mts +935 -0
- package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
- package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
- package/dist/Schedule-BIOHA6RR.d.mts +847 -0
- package/dist/Scheduling-DPb2QyAK.mjs +691 -0
- package/dist/Scheduling-DPb2QyAK.mjs.map +1 -0
- package/dist/Subagent-CNik9RiA.d.mts +1635 -0
- package/dist/Subagent-DCrB7an7.mjs +1498 -0
- package/dist/Subagent-DCrB7an7.mjs.map +1 -0
- package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
- package/dist/SubagentHost-4WB8Hj0C.d.mts +164 -0
- package/dist/Subscription-CRteOKRf.d.mts +948 -0
- package/dist/SubscriptionInput-oNcwTPti.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 +8 -0
- package/dist/ToolExposure.mjs +21 -0
- package/dist/ToolExposure.mjs.map +1 -0
- package/dist/ToolReconciler-BmVRAHKs.d.mts +80 -0
- package/dist/ToolResult-BKdqWRff.d.mts +78 -0
- package/dist/Usage-Dx0aknfk.d.mts +121 -0
- package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
- package/dist/Worker-CfwzMZEK.mjs +271 -0
- package/dist/Worker-CfwzMZEK.mjs.map +1 -0
- package/dist/Worker-fwWkBg12.d.mts +472 -0
- package/dist/agent-registration-CKNsrpwo.mjs +201 -0
- package/dist/agent-registration-CKNsrpwo.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 +259 -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 +152 -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 +124 -0
- package/dist/capabilities/ToolDiscovery.mjs +230 -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 +115 -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 +134 -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/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +2 -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 +156 -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 +3 -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 +330 -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 +110 -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 +102 -0
- package/dist/durable/DurableFailpoint.mjs.map +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -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 +185 -0
- package/dist/durable/GitHubWorkflowSource.mjs +209 -0
- package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
- package/dist/durable/MessageDelivery.d.mts +893 -0
- package/dist/durable/MessageDelivery.mjs +557 -0
- package/dist/durable/MessageDelivery.mjs.map +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +378 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +270 -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 +38 -0
- package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +848 -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 +391 -0
- package/dist/durable/Schedule.mjs.map +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +17 -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 +29 -0
- package/dist/durable/SqlMemoryStore.mjs +436 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlMessageDeliveryStore.d.mts +42 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs +179 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageV2Upgrade.d.mts +21 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
- package/dist/durable/SqlSubscriptionStore.d.mts +62 -0
- package/dist/durable/SqlSubscriptionStore.mjs +751 -0
- package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
- package/dist/durable/SqlThreadNativeReads.d.mts +53 -0
- package/dist/durable/SqlThreadNativeReads.mjs +159 -0
- package/dist/durable/SqlThreadNativeReads.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +959 -0
- package/dist/durable/SubmissionLedger.mjs.map +1 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +29 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2187 -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 +16 -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 +76 -0
- package/dist/durable/ThreadInvariants.mjs +246 -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 +355 -0
- package/dist/durable/ThreadStore.mjs.map +1 -0
- package/dist/durable/ThreadStoreConformance.d.mts +28 -0
- package/dist/durable/ThreadStoreConformance.mjs +503 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +85 -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 +124 -0
- package/dist/engine/RunOptions.mjs.map +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +76 -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 +91 -6
- package/dist/index.mjs +100 -6
- 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 +257 -0
- package/dist/sandbox/InteractiveBrowser.mjs +236 -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 +283 -0
- package/dist/sandbox/ProtectedBrowser.mjs +298 -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 -40
- package/src/InMemory.ts +19 -0
- package/src/ToolExposure.ts +2 -0
- 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 +426 -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 +2489 -0
- package/src/capabilities/SubagentReservations.ts +850 -0
- package/src/capabilities/ToolDiscovery.ts +369 -0
- package/src/capabilities/WebCapture.ts +722 -0
- package/src/capabilities/WebSearch.ts +190 -0
- package/src/capabilities/internal/subagent-background.ts +1273 -0
- package/src/capabilities/internal/subagent-contract.ts +146 -0
- package/src/capabilities/internal/subagent-policy.ts +235 -0
- package/src/capabilities/internal/subagent-reporting.ts +136 -0
- package/src/capabilities/internal/utf8.ts +10 -0
- package/src/core/Agent.ts +602 -0
- package/src/core/AgentError.ts +172 -0
- package/src/core/AgentPolicy.ts +153 -0
- package/src/core/AgentUpdates.ts +100 -0
- package/src/core/FailureDiagnostic.ts +343 -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 +72 -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 +190 -0
- package/src/core/Usage.ts +529 -0
- package/src/core/Worker.ts +240 -0
- package/src/core/internal/agent-updates.ts +34 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/utf8.ts +23 -0
- package/src/durable/ActivityStore.ts +160 -0
- package/src/durable/Admin.ts +505 -0
- package/src/durable/AgentRegistration.ts +14 -0
- package/src/durable/Certification.ts +210 -0
- package/src/durable/CommittedActivity.ts +296 -0
- package/src/durable/Digest.ts +87 -0
- package/src/durable/DurableAgentRuntime.ts +11275 -0
- package/src/durable/DurableFailpoint.ts +111 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +172 -0
- package/src/durable/GitHubWorkflowSource.ts +447 -0
- package/src/durable/MessageDelivery.ts +832 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +410 -0
- package/src/durable/OperationAuthorizer.ts +85 -0
- package/src/durable/PersistentHistory.ts +260 -0
- package/src/durable/PreparedInputAdmission.ts +57 -0
- package/src/durable/Records.ts +1075 -0
- package/src/durable/Recovery.ts +1018 -0
- package/src/durable/RunJournal.ts +1631 -0
- package/src/durable/Schedule.ts +513 -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 +778 -0
- package/src/durable/SqlMessageDeliveryStore.ts +335 -0
- package/src/durable/SqlStorageV2Upgrade.ts +500 -0
- package/src/durable/SqlSubscriptionStore.ts +1440 -0
- package/src/durable/SqlThreadNativeReads.ts +270 -0
- package/src/durable/SubmissionLedger.ts +1265 -0
- package/src/durable/SubmissionLedgerConformance.ts +4820 -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 +507 -0
- package/src/durable/ThreadProjection.ts +269 -0
- package/src/durable/ThreadProjectionMaintenance.ts +67 -0
- package/src/durable/ThreadStore.ts +573 -0
- package/src/durable/ThreadStoreConformance.ts +1156 -0
- package/src/durable/ToolReconciler.ts +109 -0
- package/src/durable/WakeScheduler.ts +134 -0
- package/src/durable/WorkerHost.ts +171 -0
- package/src/durable/internal/agent-registration.ts +587 -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 +117 -0
- package/src/durable/internal/message-status.ts +20 -0
- package/src/durable/internal/messaging-host.ts +637 -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 +2885 -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 +1101 -0
- package/src/engine/SubagentHost.ts +230 -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 +10500 -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 +99 -21
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +339 -0
- package/src/sandbox/PageCapture.ts +691 -0
- package/src/sandbox/PageCrawl.ts +148 -0
- package/src/sandbox/PageScreenshot.ts +81 -0
- package/src/sandbox/ProtectedBrowser.ts +452 -0
- package/src/sandbox/Sandbox.ts +241 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { n as ToolResultBounds } from "./ToolResult-BKdqWRff.mjs";
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as Duration from "effect/Duration";
|
|
4
|
+
declare namespace AgentPolicy_d_exports {
|
|
5
|
+
export { AgentPolicy, AgentPolicyInput, CompactionPolicy, CompactionPolicyInput };
|
|
6
|
+
}
|
|
7
|
+
declare const CompactionMode: Schema.Literals<readonly ["prune", "summarize", "prune-then-summarize"]>;
|
|
8
|
+
/** Inputs normalized and validated by `CompactionPolicy.make`. */
|
|
9
|
+
type CompactionPolicyInput = Readonly<{
|
|
10
|
+
/** Estimated tokens of recent history preserved verbatim across a compaction; defaults to `20_000`. */
|
|
11
|
+
readonly keepRecentTokens?: number;
|
|
12
|
+
/** Compaction strategy order; defaults to `"prune-then-summarize"`. */
|
|
13
|
+
readonly mode?: typeof CompactionMode.Type;
|
|
14
|
+
}>;
|
|
15
|
+
declare const CompactionPolicy_base: Schema.Class<CompactionPolicy, Schema.Struct<{
|
|
16
|
+
readonly keepRecentTokens: Schema.Int;
|
|
17
|
+
readonly mode: Schema.Literals<readonly ["prune", "summarize", "prune-then-summarize"]>;
|
|
18
|
+
}>, {}>;
|
|
19
|
+
/** How the engine reduces model context when `contextTokenLimit` is crossed. */
|
|
20
|
+
declare class CompactionPolicy extends CompactionPolicy_base {
|
|
21
|
+
/** Normalize and validate compaction bounds, filling documented defaults. */
|
|
22
|
+
static make(input?: CompactionPolicyInput): CompactionPolicy;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Resolution when `maxTurns`, `maxToolCalls`, or `tokenBudget` is exhausted:
|
|
26
|
+
* `"final-answer"` gives the model one constrained opportunity to settle with
|
|
27
|
+
* output (the Run completes with `finishReason: "budget-exhausted"` and the
|
|
28
|
+
* exhausted-dimension marker), while `"fail"` fails the Run typed. Turn and
|
|
29
|
+
* Tool Call bounds resolve per RUN-018/RUN-019; the token dimension
|
|
30
|
+
* participates per RUN-025 with a one-shot bound (at most one grace call).
|
|
31
|
+
* Duration, cost, and repeated-failure bounds are hard rails regardless of
|
|
32
|
+
* this setting.
|
|
33
|
+
*/
|
|
34
|
+
declare const OnExhaustion: Schema.Literals<readonly ["final-answer", "fail"]>;
|
|
35
|
+
declare const AgentPolicyFields: Schema.Struct<{
|
|
36
|
+
readonly maxTurns: Schema.Int;
|
|
37
|
+
readonly maxToolCalls: Schema.Int;
|
|
38
|
+
readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
|
|
39
|
+
readonly toolConcurrency: Schema.Int;
|
|
40
|
+
readonly repeatedFailureLimit: Schema.Int;
|
|
41
|
+
readonly onExhaustion: Schema.Literals<readonly ["final-answer", "fail"]>;
|
|
42
|
+
readonly tokenBudget: Schema.optionalKey<Schema.Int>;
|
|
43
|
+
/** Tokens withheld from research calls so one final delivery call remains admissible. */
|
|
44
|
+
readonly completionReserveTokens: Schema.Int;
|
|
45
|
+
readonly costBudgetMicrousd: Schema.optionalKey<Schema.Int>;
|
|
46
|
+
/** Per-model-call live-context bound; crossing it triggers compaction rather than failure. */
|
|
47
|
+
readonly contextTokenLimit: Schema.optionalKey<Schema.Int>;
|
|
48
|
+
readonly toolResultBounds: typeof ToolResultBounds;
|
|
49
|
+
readonly runStatus: Schema.Literals<readonly ["appended", "off"]>;
|
|
50
|
+
readonly compaction: typeof CompactionPolicy;
|
|
51
|
+
}>;
|
|
52
|
+
type AgentPolicyFields = typeof AgentPolicyFields.Type;
|
|
53
|
+
/** Inputs normalized and validated by `AgentPolicy.make`. */
|
|
54
|
+
type AgentPolicyInput = Readonly<Omit<AgentPolicyFields, "maxDuration" | "repeatedFailureLimit" | "onExhaustion" | "toolResultBounds" | "runStatus" | "compaction" | "completionReserveTokens"> & {
|
|
55
|
+
/** Finite, positive wall-clock duration accepted in any Effect Duration input form. */
|
|
56
|
+
readonly maxDuration: Duration.Input;
|
|
57
|
+
/** Non-negative repeated-failure bound; defaults to `3`. */
|
|
58
|
+
readonly repeatedFailureLimit?: number;
|
|
59
|
+
/** Turn/Tool-Call/token exhaustion resolution; defaults to `"final-answer"`. */
|
|
60
|
+
readonly onExhaustion?: typeof OnExhaustion.Type;
|
|
61
|
+
/** Byte bound for each encoded Tool result; defaults to `50 KiB`. */
|
|
62
|
+
readonly toolResultBounds?: ToolResultBounds;
|
|
63
|
+
/** Whether a derived run-status message is appended to each model call; defaults to `"off"` to preserve retained prompt cache boundaries. */
|
|
64
|
+
readonly runStatus?: AgentPolicyFields["runStatus"];
|
|
65
|
+
/** Tokens reserved for final delivery; defaults to 20% of tokenBudget, capped at 4,096. */
|
|
66
|
+
readonly completionReserveTokens?: number;
|
|
67
|
+
/** Compaction strategy applied when `contextTokenLimit` is crossed; defaults documented on `CompactionPolicy`. */
|
|
68
|
+
readonly compaction?: CompactionPolicy;
|
|
69
|
+
}>;
|
|
70
|
+
declare const AgentPolicy_base: Schema.Class<AgentPolicy, Schema.Struct<{
|
|
71
|
+
readonly maxTurns: Schema.Int;
|
|
72
|
+
readonly maxToolCalls: Schema.Int;
|
|
73
|
+
readonly maxDuration: Schema.refine<Duration.Duration, Schema.Duration>;
|
|
74
|
+
readonly toolConcurrency: Schema.Int;
|
|
75
|
+
readonly repeatedFailureLimit: Schema.Int;
|
|
76
|
+
readonly onExhaustion: Schema.Literals<readonly ["final-answer", "fail"]>;
|
|
77
|
+
readonly tokenBudget: Schema.optionalKey<Schema.Int>;
|
|
78
|
+
/** Tokens withheld from research calls so one final delivery call remains admissible. */
|
|
79
|
+
readonly completionReserveTokens: Schema.Int;
|
|
80
|
+
readonly costBudgetMicrousd: Schema.optionalKey<Schema.Int>;
|
|
81
|
+
/** Per-model-call live-context bound; crossing it triggers compaction rather than failure. */
|
|
82
|
+
readonly contextTokenLimit: Schema.optionalKey<Schema.Int>;
|
|
83
|
+
readonly toolResultBounds: typeof ToolResultBounds;
|
|
84
|
+
readonly runStatus: Schema.Literals<readonly ["appended", "off"]>;
|
|
85
|
+
readonly compaction: typeof CompactionPolicy;
|
|
86
|
+
}>, {}>;
|
|
87
|
+
/** Schema class for finite agent run limits. */
|
|
88
|
+
declare class AgentPolicy extends AgentPolicy_base {
|
|
89
|
+
/** Resolve an optional declaration against finite standalone or parent defaults. */
|
|
90
|
+
static resolve(input?: Partial<AgentPolicyInput>, parent?: AgentPolicy): AgentPolicy;
|
|
91
|
+
/** Normalize and validate finite policy bounds, throwing on invalid input. */
|
|
92
|
+
static make(input: AgentPolicyInput): AgentPolicy;
|
|
93
|
+
}
|
|
94
|
+
//#endregion
|
|
95
|
+
export { CompactionPolicyInput as a, CompactionPolicy as i, AgentPolicyInput as n, AgentPolicy_d_exports as r, AgentPolicy as t };
|
|
96
|
+
//# sourceMappingURL=AgentPolicy-BqDoSXO6.d.mts.map
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
import { d as ToolCallId, r as DelegationId, s as RunId, t as AgentId, u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
+
import { i as SubagentBudgetReservation, l as SubagentGrant, u as SubagentParentLink } from "./SubagentContract-DdT7Cqe6.mjs";
|
|
3
|
+
import { i as UpdateError, n as Emitter } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
4
|
+
import { c as RunUsageReport, s as RunTotals } from "./Usage-Dx0aknfk.mjs";
|
|
5
|
+
import { l as RunEvent } from "./RunEvent-DIrzkjLr.mjs";
|
|
6
|
+
import { n as ThreadHistoryError, t as ThreadHistory } from "./ThreadHistory-tS1KwxHR.mjs";
|
|
7
|
+
import { n as CurrentToolCatalog } from "./ToolExposure-UCN12eCd.mjs";
|
|
8
|
+
import { s as ToolBroker } from "./ToolBroker-DWs4tZra.mjs";
|
|
9
|
+
import { a as AgentInputError, c as AgentPolicyError, d as AgentToolAuthorizationDenied, f as ContextBudgetError, m as ModelProtocolError, n as AgentApprovalPending, p as ContextOverflowError, s as AgentOutputError, t as AgentApprovalDenied, u as AgentToolAuthorizationCheckError } from "./AgentError-Bn1ytXRD.mjs";
|
|
10
|
+
import { t as AgentPolicy } from "./AgentPolicy-BqDoSXO6.mjs";
|
|
11
|
+
import { A as ToolUnion, C as OutputSchema, D as RunDispositionFailure, E as RunDispositionDeclaration, N as UpdatesSchema, O as RunDispositionSchema, S as Output, _ as InstructionSource, a as CompletionFromToolDeclaration, c as Definition, d as EncodedInput, f as Failure, m as InputPromptSource, n as Any, r as AnyDefinition, s as CompletionToolDeclaration, t as Agent_d_exports, w as Requirements } from "./Agent-D9cXqfF3.mjs";
|
|
12
|
+
import { a as WorkerBudgetScope } from "./Worker-fwWkBg12.mjs";
|
|
13
|
+
import { a as ContextWindow } from "./ContextWindow-DRQ5Mbm2.mjs";
|
|
14
|
+
import { n as CompactionError } from "./ContextCompactor-WwSIG_Z2.mjs";
|
|
15
|
+
import { t as DurableStep } from "./DurableStep-Cry_iol4.mjs";
|
|
16
|
+
import { B as RunSubagentChildIdentity, H as RunSubagentEstablishRequest, M as RunOptions, S as RunContextPreparationError, W as RunSubagentJoinRequest, i as ChildEstablishStatus, l as ModelUsageAccounting, t as AgentUpdateAcceptance, x as RunContextPreparation } from "./RunOptions-CSBsSj0X.mjs";
|
|
17
|
+
import { t as MessagingHost } from "./MessagingHost-CqzpxbGz.mjs";
|
|
18
|
+
import { o as SubagentHost } from "./SubagentHost-4WB8Hj0C.mjs";
|
|
19
|
+
import { t as RunEventSink } from "./RunEventSink-D5aVhISG.mjs";
|
|
20
|
+
import { AiError, LanguageModel, Model, Prompt, Tool, Toolkit } from "effect/unstable/ai";
|
|
21
|
+
import { Cause, Context, Effect, Layer, Option, Schema, Scope, Stream, Tracer } from "effect";
|
|
22
|
+
//#region src/engine/internal/tool-telemetry.d.ts
|
|
23
|
+
interface ToolSpanTelemetryService {
|
|
24
|
+
/** Measure one Tool handler attempt while isolating every host span-lifecycle defect. */
|
|
25
|
+
readonly isolateSpanLifecycle: <A, E, R>(stream: Stream.Stream<A, E, R>) => Stream.Stream<A, E, R>;
|
|
26
|
+
/** Effect counterpart used by programmatic Tool handlers nested inside an outer Tool stream. */
|
|
27
|
+
readonly isolateEffectSpanLifecycle: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
28
|
+
/** Keep Effect AI implementation annotations local while preserving host-owned handler spans. */
|
|
29
|
+
readonly isolateToolkitHandle: <A, E, R>(effect: Effect.Effect<A, E, R>) => Effect.Effect<A, E, R>;
|
|
30
|
+
}
|
|
31
|
+
declare const ToolSpanTelemetry_base: Context.ServiceClass<ToolSpanTelemetry, "@effect-agent/engine/ToolSpanTelemetry", ToolSpanTelemetryService>;
|
|
32
|
+
/**
|
|
33
|
+
* @internal Engine-owned span-lifecycle policy. The AgentRuntime composition boundary builds this
|
|
34
|
+
* capability from the host's ambient Tracer; Tool execution consumes it without selecting,
|
|
35
|
+
* decorating, or locally providing a Tracer implementation.
|
|
36
|
+
*/
|
|
37
|
+
declare class ToolSpanTelemetry extends ToolSpanTelemetry_base {
|
|
38
|
+
static readonly layer: Layer.Layer<ToolSpanTelemetry>;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/engine/internal/agent-runtime.d.ts
|
|
42
|
+
type RuntimeProgram<InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, InstructionError = InstructionErrorOf<Instructions, InputSchema["Type"]>, InstructionRequirements = InstructionRequirementsOf<Instructions, InputSchema["Type"]>, RunDispositionValue extends RunDispositionDeclaration<OutputSchema["Type"], Schema.Top> | undefined = undefined, InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined> = {
|
|
43
|
+
readonly definition: Definition<InputSchema, OutputSchema, Instructions, Toolkit.Toolkit<Tools>, RunDispositionValue, InputPromptValue, UpdatesSchema> & {
|
|
44
|
+
readonly instructions: InstructionSource<InputSchema["Type"], NoInfer<InstructionError>, NoInfer<InstructionRequirements>>;
|
|
45
|
+
readonly inputPrompt?: InputPromptValue | undefined;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
/**
|
|
49
|
+
* Structural shape of an Agent Binding accepted by the interpreter and by
|
|
50
|
+
* `AgentSpawner.spawn`: a model-agnostic Definition paired with an explicit
|
|
51
|
+
* native model Layer whose requirements stay visible. The Layer must provide
|
|
52
|
+
* LanguageModel, ProviderName, and ModelName, including after requirement capture.
|
|
53
|
+
*/
|
|
54
|
+
type RuntimeBinding<InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, _Provider, ModelProvides, ModelRequires, InstructionError = InstructionErrorOf<Instructions, InputSchema["Type"]>, InstructionRequirements = InstructionRequirementsOf<Instructions, InputSchema["Type"]>, RunDispositionValue extends RunDispositionDeclaration<OutputSchema["Type"], Schema.Top> | undefined = undefined, InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined> = RuntimeProgram<InputSchema, OutputSchema, Instructions, Tools, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema> & {
|
|
55
|
+
readonly model: Layer.Layer<LanguageModel.LanguageModel | Model.ProviderName | Model.ModelName | ModelProvides, never, ModelRequires>;
|
|
56
|
+
};
|
|
57
|
+
type InstructionResultOf<Instructions, Input> = Instructions extends ((input: Input) => infer Result) ? Result : Instructions;
|
|
58
|
+
type InstructionErrorOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer Error, infer _Requirements> ? Error : never;
|
|
59
|
+
type InstructionRequirementsOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer _Error, infer Requirements> ? Requirements : never;
|
|
60
|
+
type InputPromptErrorOf<InputPromptValue, Input> = InputPromptValue extends ((input: Input) => infer Result) ? Result extends Effect.Effect<infer _Success, infer Error, infer _Requirements> ? Error : never : never;
|
|
61
|
+
type InputPromptRequirementsOf<InputPromptValue, Input> = InputPromptValue extends ((input: Input) => infer Result) ? Result extends Effect.Effect<infer _Success, infer _Error, infer Requirements> ? Requirements : never : never;
|
|
62
|
+
/** Schema factory for the terminal value produced by reducing a completed agent event stream. */
|
|
63
|
+
declare const AgentResultSchema: <Output extends Schema.Top>(output: Output) => Schema.Struct<{
|
|
64
|
+
readonly output: Output;
|
|
65
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
66
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
67
|
+
readonly turns: Schema.Int;
|
|
68
|
+
readonly finishReason: Schema.Literals<readonly ["completed", "model-stop", "budget-exhausted"]>;
|
|
69
|
+
/** Dimension that bound when the Run settled budget-exhausted (RUN-025; the grant-flow marker). */
|
|
70
|
+
readonly exhausted: Schema.optionalKey<Schema.Literals<readonly ["tokens", "tool-calls", "turns"]>>;
|
|
71
|
+
/** Schema-encoded application disposition declared for an ordinary completed Run. */
|
|
72
|
+
readonly runDisposition: Schema.optionalKey<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
73
|
+
/** Cumulative spend for the Run, as reported on its terminal event. */
|
|
74
|
+
readonly usage: Schema.optionalKey<typeof RunTotals>;
|
|
75
|
+
/** Disjoint usage of attached descendants, including nested and failed children. */
|
|
76
|
+
readonly delegatedUsage: Schema.optionalKey<typeof RunTotals>;
|
|
77
|
+
}>;
|
|
78
|
+
/** Decoded terminal value produced by reducing a completed agent event stream. */
|
|
79
|
+
type AgentResult<Output> = ReturnType<typeof AgentResultSchema<Schema.Schema<Output>>>["Type"];
|
|
80
|
+
/** Expected agent, policy, and model-protocol failures exposed by the runtime. */
|
|
81
|
+
type AgentRuntimeFailure<AgentValue extends AnyDefinition | Any, HookError = never, InstructionError = never> = Failure<AgentValue> | ([UpdatesSchema<AgentValue>] extends [never] ? never : UpdateError) | AgentPolicyError | ContextBudgetError | ContextOverflowError | CompactionError | RunContextPreparationError | AgentToolAuthorizationCheckError | ModelProtocolError | AgentApprovalDenied | AgentToolAuthorizationDenied | AgentApprovalPending | AgentChildPending | ThreadHistoryError | HookError | InstructionError;
|
|
82
|
+
/**
|
|
83
|
+
* Services the engine itself provides locally to every Run: `AgentSpawner`
|
|
84
|
+
* bound to the Run's immutable identity and delegation depth, `RunEventSink`
|
|
85
|
+
* and `SubagentDurability` bound to the active Tool batch, `DurableStep`
|
|
86
|
+
* bound to the active Tool Call, and `ToolSpanTelemetry` bound at the Run
|
|
87
|
+
* composition edge. They are excluded from the runtime's public
|
|
88
|
+
* requirements and MUST NOT be satisfied from an application Layer.
|
|
89
|
+
*/
|
|
90
|
+
type EngineProvidedToolServices = Emitter | AgentSpawner | RunEventSink | DurableStep | SubagentDurability | SubagentHost | MessagingHost | ToolBroker | ToolSpanTelemetry | ContextWindow | CurrentToolCatalog;
|
|
91
|
+
/** Schema services needed to reconstruct a completion Tool's canonical Agent output. */
|
|
92
|
+
type AgentCompletionProjectionRequirements<AgentValue extends AnyDefinition | Any> = OutputSchema<AgentValue>["DecodingServices"] | OutputSchema<AgentValue>["EncodingServices"] | Tool.ParametersSchema<ToolUnion<AgentValue>>["DecodingServices"] | Tool.SuccessSchema<ToolUnion<AgentValue>>["DecodingServices"];
|
|
93
|
+
/**
|
|
94
|
+
* Inferred agent services plus the runtime's identity and Thread history authorities.
|
|
95
|
+
* Engine-provided Tool handler services are excluded because the interpreter
|
|
96
|
+
* supplies them itself, bound to the current Run's identity. Tool parameter
|
|
97
|
+
* encoding, output decoding, and completion-projection Schema services stay
|
|
98
|
+
* listed unexcluded: the interpreter records canonical parameters before the
|
|
99
|
+
* handler boundary, `run`/`start` re-decode terminal output, and durable recovery
|
|
100
|
+
* re-decodes canonical completion Tool parameters/results.
|
|
101
|
+
*/
|
|
102
|
+
type AgentRuntimeRequirements<AgentValue extends AnyDefinition | Any, HookRequirements = never, InstructionRequirements = never> = Exclude<Requirements<AgentValue>, EngineProvidedToolServices> | Tool.ParametersSchema<ToolUnion<AgentValue>>["EncodingServices"] | AgentCompletionProjectionRequirements<AgentValue> | OutputSchema<AgentValue>["DecodingServices"] | ThreadHistory | HookRequirements | InstructionRequirements;
|
|
103
|
+
/** Render decoded Agent input for model visibility, preserving the legacy JSON default. */
|
|
104
|
+
declare function renderInputPrompt<Input, InputPromptValue extends InputPromptSource<NoInfer<Input>, unknown, unknown> | undefined>(inputPrompt: InputPromptValue, decodedInput: Input, encodedInput: unknown): Effect.Effect<Prompt.RawInput, AgentInputError | InputPromptErrorOf<InputPromptValue, Input>, InputPromptRequirementsOf<InputPromptValue, Input>>;
|
|
105
|
+
declare const decodeFinalOutput: <AgentValue extends Any>(agent: AgentValue, text: string) => Effect.Effect<{
|
|
106
|
+
readonly encoded: Schema.Json;
|
|
107
|
+
readonly decoded: Output<AgentValue>;
|
|
108
|
+
}, AgentOutputError, OutputSchema<AgentValue>["DecodingServices"]>;
|
|
109
|
+
declare const projectCompletionOutput: <AgentValue extends Any>(agent: AgentValue, declaration: CompletionToolDeclaration<unknown, unknown, unknown>, parameters: unknown, result: unknown) => Effect.Effect<{
|
|
110
|
+
encoded: Schema.Json;
|
|
111
|
+
decoded: unknown;
|
|
112
|
+
}, AgentOutputError | ModelProtocolError, unknown>;
|
|
113
|
+
/** Reconstruct optional action completion identically for live execution and canonical recovery. */
|
|
114
|
+
declare const projectCompletionFromToolOutput: <AgentValue extends Any>(agent: AgentValue, declaration: CompletionFromToolDeclaration<unknown, unknown, unknown>, parameters: unknown, result: unknown) => Effect.Effect<Option.None<{
|
|
115
|
+
encoded: Schema.Json;
|
|
116
|
+
decoded: unknown;
|
|
117
|
+
}> | Option.Some<{
|
|
118
|
+
encoded: Schema.Json;
|
|
119
|
+
decoded: unknown;
|
|
120
|
+
}>, AgentOutputError | ModelProtocolError, unknown>;
|
|
121
|
+
declare function encodeRunDisposition<AgentValue extends Any>(agent: AgentValue, output: Output<AgentValue>): Effect.Effect<Schema.Json | undefined, RunDispositionFailure<AgentValue>, RunDispositionSchema<AgentValue>["EncodingServices"]>;
|
|
122
|
+
/**
|
|
123
|
+
* Scoped detached execution whose observers cannot backpressure Run
|
|
124
|
+
* completion.
|
|
125
|
+
*
|
|
126
|
+
* `observe` is a live multicast subscription: each subscription replays every
|
|
127
|
+
* event the Run has already emitted, follows subsequent events as they occur,
|
|
128
|
+
* and ends once the Run settles. The finite Run event ceiling sizes the replay
|
|
129
|
+
* buffer so events are never dropped for a slow subscriber and publishing
|
|
130
|
+
* never blocks the Run. `events` remains the complete bounded replay,
|
|
131
|
+
* available after settlement. Both belong to the `start` Scope; observing
|
|
132
|
+
* after that Scope closes interrupts the observer.
|
|
133
|
+
*/
|
|
134
|
+
interface DetachedRun<Output, Error> {
|
|
135
|
+
readonly await: Effect.Effect<AgentResult<Output>, Error>;
|
|
136
|
+
readonly events: Effect.Effect<ReadonlyArray<RunEvent>>;
|
|
137
|
+
readonly observe: Stream.Stream<RunEvent>;
|
|
138
|
+
/** Snapshot of observed usage, also available after failure, defect, or interruption. Read after
|
|
139
|
+
* await settles (or the owning Scope closes) for a final report. In-flight work may be unpriced. */
|
|
140
|
+
readonly usageReport: Effect.Effect<RunUsageReport>;
|
|
141
|
+
}
|
|
142
|
+
/** Executable definitions or explicit per-agent model Layers for registration and delegation. */
|
|
143
|
+
type ExecutableDefinition = AnyDefinition & {
|
|
144
|
+
readonly instructions: InstructionSource<never, unknown, unknown>;
|
|
145
|
+
};
|
|
146
|
+
type ExecutableAgent = ExecutableDefinition | {
|
|
147
|
+
readonly definition: ExecutableDefinition;
|
|
148
|
+
readonly model: Layer.Layer<LanguageModel.LanguageModel | Model.ProviderName | Model.ModelName, never, unknown>;
|
|
149
|
+
};
|
|
150
|
+
/** Decode external input before instructions or model execution. */
|
|
151
|
+
declare const streamUnknown: <A extends ExecutableAgent, H = never, R = never>(agent: A, input: unknown, options?: RunOptions<H, R>) => Stream.Stream<RunEvent, AgentRuntimeFailure<A, H>, AgentRuntimeRequirements<A, R>>;
|
|
152
|
+
/**
|
|
153
|
+
* Host interpreter entry point with Attempt-local usage accounting and update acceptance in R.
|
|
154
|
+
* Durable coordinators provide these services alongside their recovery hooks;
|
|
155
|
+
* ordinary callers use streamUnknown's explicit ephemeral composition.
|
|
156
|
+
*/
|
|
157
|
+
declare const streamWithUsageAccountingUnknown: <A extends ExecutableAgent, H = never, R = never>(agent: A, input: unknown, options?: RunOptions<H, R>) => Stream.Stream<RunEvent, AgentRuntimeFailure<A, H>, AgentRuntimeRequirements<A, R> | ModelUsageAccounting | AgentUpdateAcceptance>;
|
|
158
|
+
/** Accept schema-encoded input, retaining runtime validation. Use streamUnknown for external data. */
|
|
159
|
+
declare const stream: <A extends ExecutableAgent, H = never, R = never>(agent: A, input: NoInfer<EncodedInput<A>>, options?: RunOptions<H, R>) => Stream.Stream<RunEvent, AgentRuntimeFailure<A, H>, AgentRuntimeRequirements<A, R>>;
|
|
160
|
+
/** Decode external input before instructions or model execution. */
|
|
161
|
+
declare function runUnknown<A extends ExecutableAgent, H = never, R = never>(agent: A, input: unknown, options?: RunOptions<H, R>): Effect.Effect<AgentResult<Output<A>>, AgentRuntimeFailure<A, H>, AgentRuntimeRequirements<A, R>>;
|
|
162
|
+
/** Accept schema-encoded input, retaining runtime validation. Use runUnknown for external data. */
|
|
163
|
+
declare const run: <A extends ExecutableAgent, H = never, R = never>(agent: A, input: NoInfer<EncodedInput<A>>, options?: RunOptions<H, R>) => Effect.Effect<AgentResult<Output<A>>, AgentRuntimeFailure<A, H>, AgentRuntimeRequirements<A, R>>;
|
|
164
|
+
/** Decode external input before instructions or model execution. */
|
|
165
|
+
declare function startUnknown<A extends ExecutableAgent, H = never, R = never>(agent: A, input: unknown, options?: RunOptions<H, R>): Effect.Effect<DetachedRun<Output<A>, AgentRuntimeFailure<A, H>>, never, AgentRuntimeRequirements<A, R> | Scope.Scope>;
|
|
166
|
+
/** Accept schema-encoded input, retaining runtime validation. Use startUnknown for external data. */
|
|
167
|
+
declare const start: <A extends ExecutableAgent, H = never, R = never>(agent: A, input: NoInfer<EncodedInput<A>>, options?: RunOptions<H, R>) => Effect.Effect<DetachedRun<Output<A>, AgentRuntimeFailure<A, H>>, never, AgentRuntimeRequirements<A, R> | Scope.Scope>;
|
|
168
|
+
/**
|
|
169
|
+
* Immutable parent Run identity carried by the locally provided
|
|
170
|
+
* `AgentSpawner`. It exposes no mutable engine state and no Layer Context.
|
|
171
|
+
*/
|
|
172
|
+
interface AgentSpawnerParent {
|
|
173
|
+
readonly agentId: AgentId;
|
|
174
|
+
readonly threadId: ThreadId;
|
|
175
|
+
readonly runId: RunId;
|
|
176
|
+
}
|
|
177
|
+
declare const ToolCallWaiting_base: Schema.Class<ToolCallWaiting, Schema.TaggedStruct<"ToolCallWaiting", {
|
|
178
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
179
|
+
readonly childThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
180
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
181
|
+
readonly childRunId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
182
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
183
|
+
readonly message: Schema.String;
|
|
184
|
+
}>, Cause.YieldableError>;
|
|
185
|
+
/**
|
|
186
|
+
* Typed engine-owned suspension signal raised by a delegation Tool handler
|
|
187
|
+
* through the per-batch `SubagentDurability` service when its durable child
|
|
188
|
+
* is established but not settled (S2 plan §2). It is NOT a Tool failure: the
|
|
189
|
+
* batch executor treats the raising call as "stays open" — no terminal
|
|
190
|
+
* result, no `ToolCallFailed`, no batch failure policy, no sibling
|
|
191
|
+
* interruption — and terminates the Run with `AgentChildPending` after every
|
|
192
|
+
* non-waiting sibling handler settled.
|
|
193
|
+
*/
|
|
194
|
+
declare class ToolCallWaiting extends ToolCallWaiting_base {}
|
|
195
|
+
declare const AgentChildPending_base: Schema.Class<AgentChildPending, Schema.TaggedStruct<"AgentChildPending", {
|
|
196
|
+
readonly children: Schema.NonEmptyArray<Schema.Struct<{
|
|
197
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
198
|
+
readonly childThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
199
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
200
|
+
readonly childRunId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
201
|
+
}>>;
|
|
202
|
+
readonly message: Schema.String;
|
|
203
|
+
}>, Cause.YieldableError>;
|
|
204
|
+
/**
|
|
205
|
+
* The Run suspended `waitingForChild`: at least one durable delegation call
|
|
206
|
+
* of the last Tool batch is waiting on its attached child.
|
|
207
|
+
* Mirrors `AgentApprovalPending`: the engine emits
|
|
208
|
+
* `RunSuspended` and then fails the Run stream with this error; the durable
|
|
209
|
+
* coordinator catches it and ends the Attempt's ownership period without
|
|
210
|
+
* settling. `children` is listed in declaration order, deterministically.
|
|
211
|
+
*/
|
|
212
|
+
declare class AgentChildPending extends AgentChildPending_base {}
|
|
213
|
+
declare const SubagentDurabilityError_base: Schema.Class<SubagentDurabilityError, Schema.TaggedStruct<"SubagentDurabilityError", {
|
|
214
|
+
readonly operation: Schema.Literals<readonly ["establish", "join", "waiting"]>;
|
|
215
|
+
readonly reason: Schema.Literals<readonly ["hook-failed", "no-active-tool-batch"]>;
|
|
216
|
+
readonly message: Schema.String;
|
|
217
|
+
readonly toolCallId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
218
|
+
/** Diagnostic cause for the live Effect only; Run events retain the fixed public message. */
|
|
219
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
220
|
+
}>, Cause.YieldableError>;
|
|
221
|
+
/**
|
|
222
|
+
* Typed failure of the engine-provided `SubagentDurability` operations.
|
|
223
|
+
* `hook-failed` wraps a coordinator hook failure without leaking the hook's
|
|
224
|
+
* error type into handler signatures (the `DurableStepError` precedent);
|
|
225
|
+
* `no-active-tool-batch` is the fail-closed Run-level default — establishment
|
|
226
|
+
* outside an active Tool batch never silently degrades to ephemeral spawning.
|
|
227
|
+
*/
|
|
228
|
+
declare class SubagentDurabilityError extends SubagentDurabilityError_base {}
|
|
229
|
+
/**
|
|
230
|
+
* Explicit ephemeral mode: no durable coordinator supplied
|
|
231
|
+
* `RunOptions.subagent`, so no durable claim is being made and the delegation
|
|
232
|
+
* handler keeps the S1 in-process spawn semantics honestly.
|
|
233
|
+
*/
|
|
234
|
+
interface SubagentDurabilityEphemeral {
|
|
235
|
+
readonly mode: "ephemeral";
|
|
236
|
+
}
|
|
237
|
+
/**
|
|
238
|
+
* Durable mode: establishment and join run through the coordinator's
|
|
239
|
+
* `RunSubagentHook` under the parent's ownership fence, and `waiting` raises
|
|
240
|
+
* the engine-owned suspension signal for a still-running child.
|
|
241
|
+
*/
|
|
242
|
+
interface SubagentDurabilityDurable {
|
|
243
|
+
readonly mode: "durable";
|
|
244
|
+
/** Idempotent durable child establishment under the parent ownership fence. */
|
|
245
|
+
readonly establish: (request: RunSubagentEstablishRequest) => Effect.Effect<ChildEstablishStatus, SubagentDurabilityError>;
|
|
246
|
+
/** Atomic settlement join: `SubagentJoined` + parent `ToolCallSettled` in one canonical batch (SUB-019). */
|
|
247
|
+
readonly join: (request: RunSubagentJoinRequest) => Effect.Effect<void, SubagentDurabilityError>;
|
|
248
|
+
/**
|
|
249
|
+
* Raise the waiting suspension signal for one delegation call whose
|
|
250
|
+
* established child has not settled. Never returns: the handler ends here,
|
|
251
|
+
* siblings run to completion, the Run suspends, and the resumed batch
|
|
252
|
+
* re-executes the handler idempotently.
|
|
253
|
+
*/
|
|
254
|
+
readonly waiting: (toolCallId: ToolCallId, child: RunSubagentChildIdentity) => Effect.Effect<never, ToolCallWaiting | SubagentDurabilityError>;
|
|
255
|
+
}
|
|
256
|
+
/**
|
|
257
|
+
* Mode-dispatched service value seen by delegation Tool handlers: an explicit
|
|
258
|
+
* ephemeral default when the Run carries no durable coordinator, the durable
|
|
259
|
+
* establish/join/waiting surface otherwise.
|
|
260
|
+
*/
|
|
261
|
+
type SubagentDurabilityService = SubagentDurabilityEphemeral | SubagentDurabilityDurable;
|
|
262
|
+
declare const SubagentDurability_base: Context.ServiceClass<SubagentDurability, "@effect-agent/engine/SubagentDurability", SubagentDurabilityService>;
|
|
263
|
+
/**
|
|
264
|
+
* Engine-owned durable-Subagent seam provided locally to every Tool batch,
|
|
265
|
+
* constructed from `RunOptions.subagent` when present and the explicit
|
|
266
|
+
* ephemeral-mode default when absent. Like the other engine-provided Tool
|
|
267
|
+
* services it is excluded from the runtime's public requirements and MUST NOT
|
|
268
|
+
* be satisfied from an application Layer; handlers resolve it per call (the
|
|
269
|
+
* S1 innermost re-provide pattern) so a Layer built inside another Run's
|
|
270
|
+
* batch never captures a stale mode.
|
|
271
|
+
*/
|
|
272
|
+
declare class SubagentDurability extends SubagentDurability_base {}
|
|
273
|
+
/** Stable delegation identity supplied by the invoking delegation Tool handler. */
|
|
274
|
+
interface SpawnDelegation {
|
|
275
|
+
readonly delegationId: DelegationId;
|
|
276
|
+
readonly parentToolCallId: ToolCallId;
|
|
277
|
+
}
|
|
278
|
+
/**
|
|
279
|
+
* Child Run options accepted by `AgentSpawner.spawn`. Child Thread/Run
|
|
280
|
+
* identity and the Parent Link are spawner-owned and cannot be overridden.
|
|
281
|
+
*/
|
|
282
|
+
interface SpawnRunOptions<HookError = never, HookRequirements = never> extends Omit<RunOptions<HookError, HookRequirements>, "threadId" | "runId" | "parentLink"> {}
|
|
283
|
+
/**
|
|
284
|
+
* Handle to one spawned Attached Child: its preallocated child identity, its
|
|
285
|
+
* immutable Parent Link, and the same observation surface as `DetachedRun`.
|
|
286
|
+
* The child fiber belongs to the Scope the caller provided to `spawn`.
|
|
287
|
+
*/
|
|
288
|
+
interface SpawnedChildRun<Output, Error> extends DetachedRun<Output, Error> {
|
|
289
|
+
readonly threadId: ThreadId;
|
|
290
|
+
readonly runId: RunId;
|
|
291
|
+
readonly parentLink: SubagentParentLink;
|
|
292
|
+
}
|
|
293
|
+
/**
|
|
294
|
+
* Narrow parent execution value visible to Tool handlers. `depth` is the
|
|
295
|
+
* current Run's root-relative delegation depth: `0` for a root Run and
|
|
296
|
+
* `parentLink.depth` for a child, which the delegation preflight uses to
|
|
297
|
+
* enforce inherited nesting ceilings and conserved subtree allocations.
|
|
298
|
+
*/
|
|
299
|
+
interface AgentSpawnerService {
|
|
300
|
+
/** Resolved defaults for this parent Run; never includes its tools or handlers. */
|
|
301
|
+
readonly policy: AgentPolicy;
|
|
302
|
+
readonly depth: number;
|
|
303
|
+
readonly grant?: SubagentGrant;
|
|
304
|
+
readonly budget?: SubagentBudgetReservation;
|
|
305
|
+
readonly budgetScope?: WorkerBudgetScope;
|
|
306
|
+
readonly parent: AgentSpawnerParent;
|
|
307
|
+
readonly spawn: <InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, Provider, ModelProvides, ModelRequires, HookError = never, HookRequirements = never, InstructionError = InstructionErrorOf<Instructions, InputSchema["Type"]>, InstructionRequirements = InstructionRequirementsOf<Instructions, InputSchema["Type"]>, RunDispositionValue extends RunDispositionDeclaration<OutputSchema["Type"], Schema.Top> | undefined = undefined, InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined = undefined, UpdatesSchema extends Schema.Top | undefined = undefined>(binding: RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, input: unknown, delegation: SpawnDelegation, options?: SpawnRunOptions<HookError, HookRequirements>) => Effect.Effect<SpawnedChildRun<OutputSchema["Type"], AgentRuntimeFailure<RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, HookError, InstructionError>>, never, Scope.Scope | Exclude<AgentRuntimeRequirements<RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, HookRequirements, InstructionRequirements>, ThreadHistory | RunContextPreparation>>;
|
|
308
|
+
}
|
|
309
|
+
declare const AgentSpawner_base: Context.ServiceClass<AgentSpawner, "@effect-agent/engine/AgentSpawner", AgentSpawnerService>;
|
|
310
|
+
/**
|
|
311
|
+
* Engine-owned service contract through which a declared delegation Tool
|
|
312
|
+
* runs an Attached Child on the same interpreter.
|
|
313
|
+
*
|
|
314
|
+
* The engine provides this service locally to every Run, bound to the Run's
|
|
315
|
+
* immutable identity and delegation depth; it is never satisfied from an
|
|
316
|
+
* application Layer, is excluded from the runtime's public requirements, and
|
|
317
|
+
* exposes neither the engine's mutable Run state nor any root Layer Context.
|
|
318
|
+
*/
|
|
319
|
+
declare class AgentSpawner extends AgentSpawner_base {}
|
|
320
|
+
/**
|
|
321
|
+
* Opt-in boundary combinator (P7 §7(h), decision point 8): the engine keeps defects as
|
|
322
|
+
* defects — `RunFailed` covers EXPECTED failures only, and a defect still fails the event
|
|
323
|
+
* stream with its full Cause (AGENTS.md: errors are never silently widened, and a defect is
|
|
324
|
+
* never converted into a typed failure by default). A host boundary that forwards Run Events
|
|
325
|
+
* to a UI or transport can wrap the stream with this helper to append ONE bounded terminal
|
|
326
|
+
* `RunFailed { errorTag: "Defect" }` event before the original cause is rethrown, so a viewer
|
|
327
|
+
* always observes a terminal event even when the Run dies.
|
|
328
|
+
*
|
|
329
|
+
* Event contract:
|
|
330
|
+
*
|
|
331
|
+
* - typed failures and interruptions pass through untouched — the engine already emitted
|
|
332
|
+
* their terminal event, so nothing is duplicated;
|
|
333
|
+
* - a cause carrying a defect first emits `RunFailed` with `errorTag: "Defect"` and a
|
|
334
|
+
* bounded string rendering of the defect (never the raw value; hosts owning stricter
|
|
335
|
+
* redaction apply it downstream), then RETHROWS the original cause unchanged;
|
|
336
|
+
* - identity fields come from the last event already streamed (`sequence` advances by one);
|
|
337
|
+
* a defect BEFORE the first event has no Run identity to attribute, so it is rethrown
|
|
338
|
+
* without an event — the helper never fabricates identities.
|
|
339
|
+
*/
|
|
340
|
+
declare const withTerminalDefectEvent: <E, R>(events: Stream.Stream<RunEvent, E, R>) => Stream.Stream<RunEvent, E, R>;
|
|
341
|
+
declare namespace AgentRuntime_d_exports {
|
|
342
|
+
export { AgentChildPending, AgentCompletionProjectionRequirements, AgentResult, AgentResultSchema, AgentRuntimeFailure, AgentRuntimeRequirements, AgentSpawner, AgentSpawnerParent, AgentSpawnerService, DetachedRun, EngineProvidedToolServices, RuntimeBinding, SpawnDelegation, SpawnRunOptions, SpawnedChildRun, SubagentDurability, SubagentDurabilityDurable, SubagentDurabilityEphemeral, SubagentDurabilityError, SubagentDurabilityService, ToolCallWaiting, decodeFinalOutput, encodeRunDisposition, projectCompletionFromToolOutput, projectCompletionOutput, renderInputPrompt, run, runUnknown, start, startUnknown, stream, streamUnknown, streamWithUsageAccountingUnknown, withTerminalDefectEvent };
|
|
343
|
+
}
|
|
344
|
+
//#endregion
|
|
345
|
+
export { start as A, decodeFinalOutput as C, renderInputPrompt as D, projectCompletionOutput as E, withTerminalDefectEvent as F, stream as M, streamUnknown as N, run as O, streamWithUsageAccountingUnknown as P, ToolCallWaiting as S, projectCompletionFromToolOutput as T, SubagentDurability as _, AgentResultSchema as a, SubagentDurabilityError as b, AgentSpawner as c, DetachedRun as d, EngineProvidedToolServices as f, SpawnedChildRun as g, SpawnRunOptions as h, AgentResult as i, startUnknown as j, runUnknown as k, AgentSpawnerParent as l, SpawnDelegation as m, AgentChildPending as n, AgentRuntimeFailure as o, RuntimeBinding as p, AgentCompletionProjectionRequirements as r, AgentRuntimeRequirements as s, AgentRuntime_d_exports as t, AgentSpawnerService as u, SubagentDurabilityDurable as v, encodeRunDisposition as w, SubagentDurabilityService as x, SubagentDurabilityEphemeral as y };
|
|
346
|
+
//# sourceMappingURL=AgentRuntime-BUxDdLpw.d.mts.map
|