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,4214 @@
|
|
|
1
|
+
import { c as SettlementId, d as ToolCallId, f as TurnId, l as SubmissionId, s as RunId, t as AgentId, u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
+
import { d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDelegationCaps, s as SubagentExecutionFailure, u as SubagentParentLink } from "./SubagentContract-DdT7Cqe6.mjs";
|
|
3
|
+
import { a as Receipt, i as QueueSequence, n as JoinedToHost, r as Principal, t as IdempotencyKey } from "./Receipt-BAHyigAF.mjs";
|
|
4
|
+
import { r as Update } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
5
|
+
import { c as Selection, l as Snapshot } from "./ToolExposure-r2eOWk4F.mjs";
|
|
6
|
+
import { l as RunUsageSummary, r as ModelCallUsage, s as RunTotals } from "./Usage-Dx0aknfk.mjs";
|
|
7
|
+
import { a as ExhaustedLimit } from "./RunEvent-DIrzkjLr.mjs";
|
|
8
|
+
import { t as ThreadHistory } from "./ThreadHistory-tS1KwxHR.mjs";
|
|
9
|
+
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
10
|
+
import { a as AgentInputError } from "./AgentError-Bn1ytXRD.mjs";
|
|
11
|
+
import { t as ToolParameterRejection } from "./ToolResult-BKdqWRff.mjs";
|
|
12
|
+
import { t as AgentPolicy } from "./AgentPolicy-BqDoSXO6.mjs";
|
|
13
|
+
import { E as RunDispositionDeclaration, _ as InstructionSource, c as Definition, m as InputPromptSource, n as Any, r as AnyDefinition, t as Agent_d_exports, y as ModelServices } from "./Agent-D9cXqfF3.mjs";
|
|
14
|
+
import { t as RunPolicyUsage } from "./RunPolicyUsage-ClZxyR46.mjs";
|
|
15
|
+
import { c as WorkerError, f as WorkerRef, n as AssignmentTerminal } from "./Worker-fwWkBg12.mjs";
|
|
16
|
+
import { G as RunToolAuthorization, O as RunCostEstimator, h as RunApprovalHook, x as RunContextPreparation } from "./RunOptions-CSBsSj0X.mjs";
|
|
17
|
+
import { o as MessagingError, r as InputMessage } from "./Messaging-Dkg87ebg.mjs";
|
|
18
|
+
import { t as MessagingHost } from "./MessagingHost-CqzpxbGz.mjs";
|
|
19
|
+
import "./Messaging-JYYN3oYS.mjs";
|
|
20
|
+
import { d as WorkerReportPreparationFailure, f as WorkerReporting, o as SubagentHost } from "./SubagentHost-4WB8Hj0C.mjs";
|
|
21
|
+
import { p as RuntimeBinding, r as AgentCompletionProjectionRequirements, s as AgentRuntimeRequirements } from "./AgentRuntime-BUxDdLpw.mjs";
|
|
22
|
+
import { n as DurableRuntimeFailpoint, r as DurableRuntimeFailpointError } from "./DurableFailpoint-Cnr3wx1L.mjs";
|
|
23
|
+
import { o as OperationDenied } from "./OperationAuthorizer-TzcQtpX5.mjs";
|
|
24
|
+
import { s as ToolReconciler } from "./ToolReconciler-BmVRAHKs.mjs";
|
|
25
|
+
import { t as WakeScheduler } from "./WakeScheduler-EjUF-GhC.mjs";
|
|
26
|
+
import { Prompt, Tool } from "effect/unstable/ai";
|
|
27
|
+
import { Cause, Context, Crypto, DateTime, Duration, Effect, Layer, Option, Result, Schema, Scope, Stream } from "effect";
|
|
28
|
+
declare namespace SubmissionLedger_d_exports {
|
|
29
|
+
export { AbortCommand, AbortIntent, AbortIntentRequest, AdmissionAdmitted, AdmissionConflict, AdmissionFence, AdmissionGroup, AdmissionIndeterminate, AdmissionNotAdmitted, AdmissionPolicyError, AdmissionRequest, AdmissionResolution, AdmissionResult, ApprovalConflict, ApprovalDecisionCommand, ApprovalDecisionIntent, ApprovalPendingSuspension, AttachChildToReservationRequest, BeginChildBudgetReleaseRequest, ChildAttachmentSnapshot, ChildBudgetReservationRequest, ChildBudgetReservationSnapshot, ChildReservationConflict, ChildReservationId, ChildReservationStatus, ChildSettledNotification, ChildSettledOutcome, Claim, ClaimJoiningRequest, ClaimRequest, DEFAULT_OWNERSHIP_LEASE_DURATION, IdempotencyKey, InputAppliedMarker, JoinSnapshot, JoinedToHost, JoiningClaim, LedgerCapabilities, LedgerError, MarkInputAppliedRequest, MarkJoinedRequest, MarkReadyRequest, MarkUnknownRequest, OwnershipLost, OwnershipRenewal, OwnershipSnapshot, OwnershipToken, ParentLinkage, Principal, QueueSequence, RecoverySnapshot, RecoverySnapshotRequest, ReleaseChildBudgetRequest, ReleaseOwnershipRequest, RenewOwnershipRequest, ReservedChildBudget, ReservedSettlement, ResolutionAbortSubmission, ResolutionCompletedWithResult, ResolutionNeverHappened, ResolutionSafeToRetry, RevertJoiningRequest, Settlement, SettlementConflict, SettlementFinalization, SettlementReservation, SettlementReservationSnapshot, SubmissionAdmissionFence, SubmissionLedger, SubmissionLedgerFailure, SubmissionLookup, SubmissionLookupById, SubmissionLookupByKey, SubmissionSnapshot, SubmissionState, SubmissionWorkItem, SuspendRequest, SuspensionOutcome, SuspensionReason, SuspensionSnapshot, UnknownResolution, UnknownResolutionCommand, UnknownResolutionConflict, UnknownResolutionIntent, WaitingChild, WaitingForChildSuspension, WorkerLedgerState, WorkerStopCommand, settlementFailureFromRecord, submissionAbortBatchId, submissionAbortRecordId, submissionInputBatchId, submissionInputRecordId, submissionSettlementBatchId, submissionSettlementId, submissionSettlementRecordId, workerTerminalFromRecord };
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Opaque proof that one Attempt currently owns a Submission's lane. It authorizes ledger
|
|
33
|
+
* mutations only; canonical-log fencing authority remains the producer epoch (DUR-006).
|
|
34
|
+
*/
|
|
35
|
+
declare const OwnershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
36
|
+
type OwnershipToken = typeof OwnershipToken.Type;
|
|
37
|
+
/**
|
|
38
|
+
* Ledger lifecycle states for one Submission. `settled` is the only terminal state; every other
|
|
39
|
+
* state carries an outstanding accepted-work obligation (Accepted-work Contract, DUR-002).
|
|
40
|
+
*
|
|
41
|
+
* Phase 5 states:
|
|
42
|
+
*
|
|
43
|
+
* - `joining` — a queued Submission claimed by an active host Run, before its canonical
|
|
44
|
+
* `UserInputRecorded` append; recovery reverts it to `ready` (DUR-016).
|
|
45
|
+
* - `joined` — the input is canonical and linked to its host; the Submission settles WITH the
|
|
46
|
+
* host Run's outcome.
|
|
47
|
+
* - `suspended` — durably waiting for explicit approval decisions; the ownership period has
|
|
48
|
+
* ended and the lane consumes no worker permit while the obligation stays owed.
|
|
49
|
+
* - `unknown` — at least one Tool Call has a durable Unknown Outcome; this Submission is
|
|
50
|
+
* parked until an authorized resolution covers every open call or a durable abort intent
|
|
51
|
+
* authorizes cleanup without Tool replay. Later eligible input may run (DUR-012/DUR-017).
|
|
52
|
+
*
|
|
53
|
+
* `claim` never grants or bypasses a `joining`, `joined`, or `suspended` head. It skips unknown
|
|
54
|
+
* work without an abort intent. Any live ownership in the Thread prevents another claim.
|
|
55
|
+
*/
|
|
56
|
+
declare const SubmissionState: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
57
|
+
type SubmissionState = typeof SubmissionState.Type;
|
|
58
|
+
/**
|
|
59
|
+
* Default ownership lease duration (D5). The lease is a liveness hint that makes an abandoned
|
|
60
|
+
* claim reclaimable; correctness never depends on it because every canonical append is fenced by
|
|
61
|
+
* producer epoch. Adapters expose this as configuration and use this value when unconfigured.
|
|
62
|
+
*/
|
|
63
|
+
declare const DEFAULT_OWNERSHIP_LEASE_DURATION: Duration.Duration;
|
|
64
|
+
declare const LedgerCapabilities_base: Schema.Class<LedgerCapabilities, Schema.Struct<{
|
|
65
|
+
readonly durability: Schema.Literals<readonly ["durable-node", "durable-cloudflare", "non-durable"]>;
|
|
66
|
+
}>, {}>;
|
|
67
|
+
/**
|
|
68
|
+
* What a SubmissionLedger adapter claims about itself. `durable-node` asserts single-node
|
|
69
|
+
* process-crash durability (fsync-backed storage); `durable-cloudflare` asserts the same
|
|
70
|
+
* single-serialized-owner crash durability through Durable Object storage output gates;
|
|
71
|
+
* `non-durable` marks reference adapters whose state does not survive the process (in-memory
|
|
72
|
+
* conformance/test adapters). The label is an honest self-description for reports and
|
|
73
|
+
* evidence — no runtime behavior branches on it.
|
|
74
|
+
*/
|
|
75
|
+
declare class LedgerCapabilities extends LedgerCapabilities_base {}
|
|
76
|
+
declare const ParentLinkage_base: Schema.Class<ParentLinkage, Schema.Struct<{
|
|
77
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
78
|
+
readonly parentToolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
79
|
+
}>, {}>;
|
|
80
|
+
/**
|
|
81
|
+
* Immutable lineage from a child Submission to the exact parent Tool Call that established it
|
|
82
|
+
* (spec §12 step 5, SUB-004). Recorded once at admission and never rewritten; it is an
|
|
83
|
+
* identifier, not an authorization capability (D10) — the join path verifies the canonical
|
|
84
|
+
* Parent Link records, never this marker alone.
|
|
85
|
+
*/
|
|
86
|
+
declare class ParentLinkage extends ParentLinkage_base {}
|
|
87
|
+
/** Host-owned policy coordinates, interpreted only by the destination transaction owner. */
|
|
88
|
+
declare const AdmissionFence: Schema.Struct<{
|
|
89
|
+
readonly policyId: Schema.NonEmptyString;
|
|
90
|
+
readonly key: Schema.NonEmptyString;
|
|
91
|
+
readonly revision: Schema.NonEmptyString;
|
|
92
|
+
}>;
|
|
93
|
+
type AdmissionFence = typeof AdmissionFence.Type;
|
|
94
|
+
declare const AdmissionGroup: Schema.NonEmptyString;
|
|
95
|
+
declare const AdmissionPolicyError_base: Schema.Class<AdmissionPolicyError, Schema.TaggedStruct<"AdmissionPolicyError", {
|
|
96
|
+
readonly reason: Schema.Literals<readonly ["refused", "unavailable", "occupied"]>;
|
|
97
|
+
readonly code: Schema.NonEmptyString;
|
|
98
|
+
readonly cause: Schema.optionalKey<Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>>;
|
|
99
|
+
readonly stack: Schema.optionalKey<Schema.String>;
|
|
100
|
+
}>, import("effect/Cause").YieldableError>;
|
|
101
|
+
/** Fresh admission alone may be refused; unavailability never proves non-admission. */
|
|
102
|
+
declare class AdmissionPolicyError extends AdmissionPolicyError_base {}
|
|
103
|
+
declare const AdmissionRequest_base: Schema.Class<AdmissionRequest, Schema.Struct<{
|
|
104
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
105
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
106
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
107
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
108
|
+
readonly agentDigests: typeof DefinitionDigests;
|
|
109
|
+
readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
110
|
+
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
111
|
+
readonly inputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
112
|
+
readonly parentLinkage: Schema.optionalKey<typeof ParentLinkage>;
|
|
113
|
+
readonly workerAdmission: Schema.optionalKey<Schema.Struct<{
|
|
114
|
+
readonly origin: Schema.Struct<{
|
|
115
|
+
readonly worker: Schema.Struct<{
|
|
116
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
117
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
118
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
119
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
120
|
+
}>;
|
|
121
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
122
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
123
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
124
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
125
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
126
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
127
|
+
}>, Schema.Struct<{
|
|
128
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
129
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
130
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
131
|
+
}>]>;
|
|
132
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
133
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
134
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
135
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
136
|
+
readonly budget: Schema.Struct<{
|
|
137
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
138
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
139
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
140
|
+
}>;
|
|
141
|
+
readonly grant: typeof SubagentGrant;
|
|
142
|
+
readonly depth: Schema.Int;
|
|
143
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
144
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
145
|
+
readonly createdAtMillis: Schema.Natural;
|
|
146
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
147
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
148
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
149
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
150
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
151
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
152
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
153
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
154
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
155
|
+
readonly depth: Schema.Natural;
|
|
156
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
157
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
158
|
+
}>>;
|
|
159
|
+
}>>;
|
|
160
|
+
}>;
|
|
161
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
162
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
163
|
+
readonly createdAtMillis: Schema.Natural;
|
|
164
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
165
|
+
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
166
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
167
|
+
}>>;
|
|
168
|
+
readonly messageAdmission: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
169
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
170
|
+
readonly message: Schema.Struct<{
|
|
171
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
172
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
173
|
+
}>;
|
|
174
|
+
readonly peerName: Schema.NonEmptyString;
|
|
175
|
+
readonly sender: Schema.Struct<{
|
|
176
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
177
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
178
|
+
}>;
|
|
179
|
+
readonly returnAddress: Schema.Struct<{
|
|
180
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
181
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
182
|
+
}>;
|
|
183
|
+
readonly inReplyTo: Schema.optionalKey<Schema.Struct<{
|
|
184
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
185
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
186
|
+
}>>;
|
|
187
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
188
|
+
readonly _tag: Schema.Literal<"WorkerCompletion">;
|
|
189
|
+
readonly budgetExhausted: Schema.Boolean;
|
|
190
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
191
|
+
readonly report: Schema.Union<readonly [Schema.Struct<{
|
|
192
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
193
|
+
readonly worker: Schema.Struct<{
|
|
194
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
195
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
196
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
197
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
198
|
+
}>;
|
|
199
|
+
readonly receipt: typeof Receipt;
|
|
200
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
201
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
202
|
+
readonly outcome: Schema.Literal<"completed">;
|
|
203
|
+
readonly result: Schema.Union<readonly [Schema.Codec<Schema.Json, Schema.Json, never, never>]>;
|
|
204
|
+
}>, Schema.Struct<{
|
|
205
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
206
|
+
readonly worker: Schema.Struct<{
|
|
207
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
208
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
209
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
210
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
211
|
+
}>;
|
|
212
|
+
readonly receipt: typeof Receipt;
|
|
213
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
214
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
215
|
+
readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
|
|
216
|
+
readonly failure: typeof SubagentExecutionFailure;
|
|
217
|
+
}>]>;
|
|
218
|
+
}>, Schema.Struct<{
|
|
219
|
+
readonly _tag: Schema.Literal<"WorkerUpdate">;
|
|
220
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
221
|
+
readonly worker: Schema.Struct<{
|
|
222
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
223
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
224
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
225
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
226
|
+
}>;
|
|
227
|
+
readonly update: typeof Update;
|
|
228
|
+
}>]>]>>;
|
|
229
|
+
readonly admissionGroup: Schema.optionalKey<Schema.NonEmptyString>;
|
|
230
|
+
readonly admissionFence: Schema.optionalKey<Schema.Struct<{
|
|
231
|
+
readonly policyId: Schema.NonEmptyString;
|
|
232
|
+
readonly key: Schema.NonEmptyString;
|
|
233
|
+
readonly revision: Schema.NonEmptyString;
|
|
234
|
+
}>>;
|
|
235
|
+
}>, {}>;
|
|
236
|
+
/**
|
|
237
|
+
* Durable admission input. `inputDigest` must be the digest of the canonical JSON encoding of
|
|
238
|
+
* `inputPayload` (see `digestJson`); admission idempotency compares digests, never re-encodes.
|
|
239
|
+
* `agentId`/`agentDigests`/`deploymentId` are persisted so recovery can complete Thread
|
|
240
|
+
* materialization without the submitting client. `parentLinkage` is present exactly when the
|
|
241
|
+
* Submission is a durable attached child (spec §12); an admission replay must repeat the same
|
|
242
|
+
* linkage (or its absence) or fail with `AdmissionConflict`.
|
|
243
|
+
*/
|
|
244
|
+
declare class AdmissionRequest extends AdmissionRequest_base {}
|
|
245
|
+
declare const AdmissionResult_base: Schema.Class<AdmissionResult, Schema.Struct<{
|
|
246
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
247
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
248
|
+
readonly queueSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/QueueSequence">;
|
|
249
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
250
|
+
readonly replayed: Schema.Boolean;
|
|
251
|
+
}>, {}>;
|
|
252
|
+
/**
|
|
253
|
+
* The committed admission row. `replayed` is true when an identical (thread, principal,
|
|
254
|
+
* idempotencyKey, inputDigest) admission already existed; the original identities are returned
|
|
255
|
+
* unchanged so a client retry resumes rather than duplicates (DUR-001).
|
|
256
|
+
*/
|
|
257
|
+
declare class AdmissionResult extends AdmissionResult_base {}
|
|
258
|
+
declare const MarkReadyRequest_base: Schema.Class<MarkReadyRequest, Schema.Struct<{
|
|
259
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
260
|
+
}>, {}>;
|
|
261
|
+
declare class MarkReadyRequest extends MarkReadyRequest_base {}
|
|
262
|
+
declare const SubmissionLookupById_base: Schema.Class<SubmissionLookupById, Schema.TaggedStruct<"SubmissionLookupById", {
|
|
263
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
264
|
+
}>, {}>;
|
|
265
|
+
declare class SubmissionLookupById extends SubmissionLookupById_base {}
|
|
266
|
+
declare const SubmissionLookupByKey_base: Schema.Class<SubmissionLookupByKey, Schema.TaggedStruct<"SubmissionLookupByKey", {
|
|
267
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
268
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
269
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
270
|
+
}>, {}>;
|
|
271
|
+
declare class SubmissionLookupByKey extends SubmissionLookupByKey_base {}
|
|
272
|
+
/** Lookup by Submission identity or by the scoped client idempotency key. */
|
|
273
|
+
declare const SubmissionLookup: Schema.Union<readonly [typeof SubmissionLookupById, typeof SubmissionLookupByKey]>;
|
|
274
|
+
type SubmissionLookup = typeof SubmissionLookup.Type;
|
|
275
|
+
declare const SubmissionWorkItem_base: Schema.Class<SubmissionWorkItem, Schema.Struct<{
|
|
276
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
277
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
278
|
+
readonly queueSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/QueueSequence">;
|
|
279
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
280
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
281
|
+
readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
282
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
283
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
284
|
+
}>, {}>;
|
|
285
|
+
/**
|
|
286
|
+
* Control-only worklist entry. Discovery validates identities, ordering and state without
|
|
287
|
+
* decoding retained execution payloads. Hydrate only the selected Thread through `lookup`
|
|
288
|
+
* or `loadRecoverySnapshot`, inside its recovery failure boundary.
|
|
289
|
+
*/
|
|
290
|
+
declare class SubmissionWorkItem extends SubmissionWorkItem_base {}
|
|
291
|
+
declare const SubmissionSnapshot_base: Schema.Class<SubmissionSnapshot, Schema.Struct<{
|
|
292
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
293
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
294
|
+
readonly queueSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/QueueSequence">;
|
|
295
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
296
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
297
|
+
readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
298
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
299
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
300
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
301
|
+
readonly agentDigests: typeof DefinitionDigests;
|
|
302
|
+
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
303
|
+
readonly inputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
304
|
+
readonly settledOutcome: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "aborted"]>>;
|
|
305
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
306
|
+
readonly readyAt: Schema.optionalKey<Schema.DateTimeUtcFromString>;
|
|
307
|
+
readonly admissionGroup: Schema.optionalKey<Schema.NonEmptyString>;
|
|
308
|
+
readonly admissionFence: Schema.optionalKey<Schema.Struct<{
|
|
309
|
+
readonly policyId: Schema.NonEmptyString;
|
|
310
|
+
readonly key: Schema.NonEmptyString;
|
|
311
|
+
readonly revision: Schema.NonEmptyString;
|
|
312
|
+
}>>;
|
|
313
|
+
readonly parentLinkage: Schema.optionalKey<typeof ParentLinkage>;
|
|
314
|
+
readonly workerAdmission: Schema.optionalKey<Schema.Struct<{
|
|
315
|
+
readonly origin: Schema.Struct<{
|
|
316
|
+
readonly worker: Schema.Struct<{
|
|
317
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
318
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
319
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
320
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
321
|
+
}>;
|
|
322
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
323
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
324
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
325
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
326
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
327
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
328
|
+
}>, Schema.Struct<{
|
|
329
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
330
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
331
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
332
|
+
}>]>;
|
|
333
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
334
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
335
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
336
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
337
|
+
readonly budget: Schema.Struct<{
|
|
338
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
339
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
340
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
341
|
+
}>;
|
|
342
|
+
readonly grant: typeof SubagentGrant;
|
|
343
|
+
readonly depth: Schema.Int;
|
|
344
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
345
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
346
|
+
readonly createdAtMillis: Schema.Natural;
|
|
347
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
348
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
349
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
350
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
351
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
352
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
353
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
354
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
355
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
356
|
+
readonly depth: Schema.Natural;
|
|
357
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
358
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
359
|
+
}>>;
|
|
360
|
+
}>>;
|
|
361
|
+
}>;
|
|
362
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
363
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
364
|
+
readonly createdAtMillis: Schema.Natural;
|
|
365
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
366
|
+
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
367
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
368
|
+
}>>;
|
|
369
|
+
readonly messageAdmission: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
370
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
371
|
+
readonly message: Schema.Struct<{
|
|
372
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
373
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
374
|
+
}>;
|
|
375
|
+
readonly peerName: Schema.NonEmptyString;
|
|
376
|
+
readonly sender: Schema.Struct<{
|
|
377
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
378
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
379
|
+
}>;
|
|
380
|
+
readonly returnAddress: Schema.Struct<{
|
|
381
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
382
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
383
|
+
}>;
|
|
384
|
+
readonly inReplyTo: Schema.optionalKey<Schema.Struct<{
|
|
385
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
386
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
387
|
+
}>>;
|
|
388
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
389
|
+
readonly _tag: Schema.Literal<"WorkerCompletion">;
|
|
390
|
+
readonly budgetExhausted: Schema.Boolean;
|
|
391
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
392
|
+
readonly report: Schema.Union<readonly [Schema.Struct<{
|
|
393
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
394
|
+
readonly worker: Schema.Struct<{
|
|
395
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
396
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
397
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
398
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
399
|
+
}>;
|
|
400
|
+
readonly receipt: typeof Receipt;
|
|
401
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
402
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
403
|
+
readonly outcome: Schema.Literal<"completed">;
|
|
404
|
+
readonly result: Schema.Union<readonly [Schema.Codec<Schema.Json, Schema.Json, never, never>]>;
|
|
405
|
+
}>, Schema.Struct<{
|
|
406
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
407
|
+
readonly worker: Schema.Struct<{
|
|
408
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
409
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
410
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
411
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
412
|
+
}>;
|
|
413
|
+
readonly receipt: typeof Receipt;
|
|
414
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
415
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
416
|
+
readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
|
|
417
|
+
readonly failure: typeof SubagentExecutionFailure;
|
|
418
|
+
}>]>;
|
|
419
|
+
}>, Schema.Struct<{
|
|
420
|
+
readonly _tag: Schema.Literal<"WorkerUpdate">;
|
|
421
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
422
|
+
readonly worker: Schema.Struct<{
|
|
423
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
424
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
425
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
426
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
427
|
+
}>;
|
|
428
|
+
readonly update: typeof Update;
|
|
429
|
+
}>]>]>>;
|
|
430
|
+
}>, {}>;
|
|
431
|
+
/** The full durable ledger view of one Submission. */
|
|
432
|
+
declare class SubmissionSnapshot extends SubmissionSnapshot_base {}
|
|
433
|
+
/** Bounded native control facts. Canonical input/Run records remain ThreadStore-owned. */
|
|
434
|
+
declare const WorkerLedgerState: Schema.Struct<{
|
|
435
|
+
readonly latest: Schema.NullOr<typeof SubmissionSnapshot>;
|
|
436
|
+
readonly active: Schema.NullOr<typeof SubmissionSnapshot>;
|
|
437
|
+
readonly stopped: Schema.Boolean;
|
|
438
|
+
readonly terminal: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "cancelled"]>>;
|
|
439
|
+
}>;
|
|
440
|
+
type WorkerLedgerState = typeof WorkerLedgerState.Type;
|
|
441
|
+
declare const AdmissionNotAdmitted_base: Schema.Class<AdmissionNotAdmitted, Schema.TaggedStruct<"NotAdmitted", {}>, {}>;
|
|
442
|
+
/** The authoritative store proves the scoped idempotency key was never admitted (SUB-031). */
|
|
443
|
+
declare class AdmissionNotAdmitted extends AdmissionNotAdmitted_base {}
|
|
444
|
+
declare const AdmissionAdmitted_base: Schema.Class<AdmissionAdmitted, Schema.TaggedStruct<"Admitted", {
|
|
445
|
+
readonly submission: typeof SubmissionSnapshot;
|
|
446
|
+
}>, {}>;
|
|
447
|
+
/** The scoped idempotency key was admitted; the full Submission snapshot is authoritative. */
|
|
448
|
+
declare class AdmissionAdmitted extends AdmissionAdmitted_base {}
|
|
449
|
+
declare const AdmissionIndeterminate_base: Schema.Class<AdmissionIndeterminate, Schema.TaggedStruct<"Indeterminate", {
|
|
450
|
+
readonly reason: Schema.String;
|
|
451
|
+
}>, {}>;
|
|
452
|
+
/**
|
|
453
|
+
* The adapter cannot currently prove admission or its absence (e.g. the authoritative child
|
|
454
|
+
* owner is unreachable on a partitioned platform). Callers wait and retry; an indeterminate
|
|
455
|
+
* answer NEVER permits a second admission attempt (SUB-031).
|
|
456
|
+
*/
|
|
457
|
+
declare class AdmissionIndeterminate extends AdmissionIndeterminate_base {}
|
|
458
|
+
/**
|
|
459
|
+
* The tri-state answer of `resolveAdmission` (spec §12: "absence from an eventually consistent
|
|
460
|
+
* projection is never proof"). Single strongly consistent stores derive `NotAdmitted`/`Admitted`
|
|
461
|
+
* from a direct lookup; only adapters that can genuinely fail to reach the authoritative owner
|
|
462
|
+
* answer `Indeterminate`.
|
|
463
|
+
*/
|
|
464
|
+
declare const AdmissionResolution: Schema.Union<readonly [typeof AdmissionNotAdmitted, typeof AdmissionAdmitted, typeof AdmissionIndeterminate]>;
|
|
465
|
+
type AdmissionResolution = typeof AdmissionResolution.Type;
|
|
466
|
+
declare const ClaimRequest_base: Schema.Class<ClaimRequest, Schema.Struct<{
|
|
467
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
468
|
+
readonly producerId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ProducerId">;
|
|
469
|
+
}>, {}>;
|
|
470
|
+
declare class ClaimRequest extends ClaimRequest_base {}
|
|
471
|
+
declare const Claim_base: Schema.Class<Claim, Schema.Struct<{
|
|
472
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
473
|
+
readonly attemptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AttemptId">;
|
|
474
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
475
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
476
|
+
readonly leaseExpiresAt: Schema.DateTimeUtcFromString;
|
|
477
|
+
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
478
|
+
}>, {}>;
|
|
479
|
+
/**
|
|
480
|
+
* One granted ownership period. `producerEpoch` is the fencing token for every canonical append
|
|
481
|
+
* this Attempt performs; `leaseExpiresAt` is when the claim becomes reclaimable unless renewed.
|
|
482
|
+
*/
|
|
483
|
+
declare class Claim extends Claim_base {}
|
|
484
|
+
declare const RenewOwnershipRequest_base: Schema.Class<RenewOwnershipRequest, Schema.Struct<{
|
|
485
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
486
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
487
|
+
}>, {}>;
|
|
488
|
+
declare class RenewOwnershipRequest extends RenewOwnershipRequest_base {}
|
|
489
|
+
declare const OwnershipRenewal_base: Schema.Class<OwnershipRenewal, Schema.Struct<{
|
|
490
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
491
|
+
readonly leaseExpiresAt: Schema.DateTimeUtcFromString;
|
|
492
|
+
}>, {}>;
|
|
493
|
+
/**
|
|
494
|
+
* A renewed lease. Adapters MAY rotate the token; callers must use the returned token for every
|
|
495
|
+
* later ledger mutation.
|
|
496
|
+
*/
|
|
497
|
+
declare class OwnershipRenewal extends OwnershipRenewal_base {}
|
|
498
|
+
declare const ReleaseOwnershipRequest_base: Schema.Class<ReleaseOwnershipRequest, Schema.Struct<{
|
|
499
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
500
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
501
|
+
}>, {}>;
|
|
502
|
+
declare class ReleaseOwnershipRequest extends ReleaseOwnershipRequest_base {}
|
|
503
|
+
declare const MarkInputAppliedRequest_base: Schema.Class<MarkInputAppliedRequest, Schema.Struct<{
|
|
504
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
505
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
506
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
507
|
+
readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
508
|
+
}>, {}>;
|
|
509
|
+
/**
|
|
510
|
+
* The canonical position of the applied `UserInputRecorded` record for one Submission.
|
|
511
|
+
*/
|
|
512
|
+
declare class MarkInputAppliedRequest extends MarkInputAppliedRequest_base {}
|
|
513
|
+
declare const InputAppliedMarker_base: Schema.Class<InputAppliedMarker, Schema.Struct<{
|
|
514
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
515
|
+
readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
516
|
+
}>, {}>;
|
|
517
|
+
declare class InputAppliedMarker extends InputAppliedMarker_base {}
|
|
518
|
+
declare const SettlementReservation_base: Schema.Class<SettlementReservation, Schema.Struct<{
|
|
519
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
520
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
521
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
522
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
523
|
+
readonly record: typeof RecordEnvelope;
|
|
524
|
+
readonly recordDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
525
|
+
}>, {}>;
|
|
526
|
+
/**
|
|
527
|
+
* Reservation of the single exact settlement record for one Submission (DUR-011). `record` is
|
|
528
|
+
* the complete canonical envelope that will be appended — including `createdAt` — so a recovering
|
|
529
|
+
* Attempt can re-append byte-identical content without a batch-digest conflict. `recordDigest`
|
|
530
|
+
* must be the digest of the canonical JSON encoding of the Schema-encoded envelope.
|
|
531
|
+
*/
|
|
532
|
+
declare class SettlementReservation extends SettlementReservation_base {}
|
|
533
|
+
declare const ReservedSettlement_base: Schema.Class<ReservedSettlement, Schema.Struct<{
|
|
534
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
535
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
536
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
537
|
+
readonly record: typeof RecordEnvelope;
|
|
538
|
+
readonly recordDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
539
|
+
readonly replayed: Schema.Boolean;
|
|
540
|
+
}>, {}>;
|
|
541
|
+
/**
|
|
542
|
+
* The committed reservation. `replayed` is true when an identical reservation already existed;
|
|
543
|
+
* the stored exact record is returned so recovery appends precisely what was reserved.
|
|
544
|
+
*/
|
|
545
|
+
declare class ReservedSettlement extends ReservedSettlement_base {}
|
|
546
|
+
declare const SettlementFinalization_base: Schema.Class<SettlementFinalization, Schema.Struct<{
|
|
547
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
548
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
549
|
+
}>, {}>;
|
|
550
|
+
declare class SettlementFinalization extends SettlementFinalization_base {}
|
|
551
|
+
declare const Settlement_base: Schema.Class<Settlement, Schema.Struct<{
|
|
552
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
553
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
554
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
555
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
556
|
+
/** Schema-encoded application disposition materialized from the exact canonical reservation. */
|
|
557
|
+
readonly runDisposition: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
558
|
+
/** Canonical aggregate of model usage and estimated spend for this Run. */
|
|
559
|
+
readonly usageSummary: Schema.optionalKey<typeof RunUsageSummary>;
|
|
560
|
+
/** Present exactly for `failed`; its Schema rejects excess keys before canonical projection. */
|
|
561
|
+
readonly failure: Schema.optionalKey<Schema.declareConstructor<{
|
|
562
|
+
readonly errorTag: string;
|
|
563
|
+
readonly message: string;
|
|
564
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
565
|
+
readonly context?: {
|
|
566
|
+
readonly agentId?: string | undefined;
|
|
567
|
+
readonly threadId?: string | undefined;
|
|
568
|
+
readonly runId?: string | undefined;
|
|
569
|
+
readonly submissionId?: string | undefined;
|
|
570
|
+
readonly attemptId?: string | undefined;
|
|
571
|
+
readonly turnId?: string | undefined;
|
|
572
|
+
readonly toolCallId?: string | undefined;
|
|
573
|
+
readonly toolName?: string | undefined;
|
|
574
|
+
readonly callId?: string | undefined;
|
|
575
|
+
readonly check?: string | undefined;
|
|
576
|
+
readonly operation?: string | undefined;
|
|
577
|
+
} | undefined;
|
|
578
|
+
}, {
|
|
579
|
+
readonly errorTag: string;
|
|
580
|
+
readonly message: string;
|
|
581
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
582
|
+
readonly context?: {
|
|
583
|
+
readonly agentId?: string | undefined;
|
|
584
|
+
readonly threadId?: string | undefined;
|
|
585
|
+
readonly runId?: string | undefined;
|
|
586
|
+
readonly submissionId?: string | undefined;
|
|
587
|
+
readonly attemptId?: string | undefined;
|
|
588
|
+
readonly turnId?: string | undefined;
|
|
589
|
+
readonly toolCallId?: string | undefined;
|
|
590
|
+
readonly toolName?: string | undefined;
|
|
591
|
+
readonly callId?: string | undefined;
|
|
592
|
+
readonly check?: string | undefined;
|
|
593
|
+
readonly operation?: string | undefined;
|
|
594
|
+
} | undefined;
|
|
595
|
+
}, readonly [Schema.Struct<{
|
|
596
|
+
readonly errorTag: Schema.NonEmptyString;
|
|
597
|
+
readonly message: Schema.String;
|
|
598
|
+
readonly diagnostic: Schema.optionalKey<Schema.Codec<Diagnostic, Diagnostic, never, never>>;
|
|
599
|
+
readonly context: Schema.optionalKey<Schema.declareConstructor<{
|
|
600
|
+
readonly agentId?: string | undefined;
|
|
601
|
+
readonly threadId?: string | undefined;
|
|
602
|
+
readonly runId?: string | undefined;
|
|
603
|
+
readonly submissionId?: string | undefined;
|
|
604
|
+
readonly attemptId?: string | undefined;
|
|
605
|
+
readonly turnId?: string | undefined;
|
|
606
|
+
readonly toolCallId?: string | undefined;
|
|
607
|
+
readonly toolName?: string | undefined;
|
|
608
|
+
readonly callId?: string | undefined;
|
|
609
|
+
readonly check?: string | undefined;
|
|
610
|
+
readonly operation?: string | undefined;
|
|
611
|
+
}, {
|
|
612
|
+
readonly agentId?: string | undefined;
|
|
613
|
+
readonly threadId?: string | undefined;
|
|
614
|
+
readonly runId?: string | undefined;
|
|
615
|
+
readonly submissionId?: string | undefined;
|
|
616
|
+
readonly attemptId?: string | undefined;
|
|
617
|
+
readonly turnId?: string | undefined;
|
|
618
|
+
readonly toolCallId?: string | undefined;
|
|
619
|
+
readonly toolName?: string | undefined;
|
|
620
|
+
readonly callId?: string | undefined;
|
|
621
|
+
readonly check?: string | undefined;
|
|
622
|
+
readonly operation?: string | undefined;
|
|
623
|
+
}, readonly [Schema.Struct<{
|
|
624
|
+
readonly agentId: Schema.optionalKey<Schema.String>;
|
|
625
|
+
readonly threadId: Schema.optionalKey<Schema.String>;
|
|
626
|
+
readonly runId: Schema.optionalKey<Schema.String>;
|
|
627
|
+
readonly submissionId: Schema.optionalKey<Schema.String>;
|
|
628
|
+
readonly attemptId: Schema.optionalKey<Schema.String>;
|
|
629
|
+
readonly turnId: Schema.optionalKey<Schema.String>;
|
|
630
|
+
readonly toolCallId: Schema.optionalKey<Schema.String>;
|
|
631
|
+
readonly toolName: Schema.optionalKey<Schema.String>;
|
|
632
|
+
readonly callId: Schema.optionalKey<Schema.String>;
|
|
633
|
+
readonly check: Schema.optionalKey<Schema.String>;
|
|
634
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
635
|
+
}>], {
|
|
636
|
+
readonly agentId?: string | undefined;
|
|
637
|
+
readonly threadId?: string | undefined;
|
|
638
|
+
readonly runId?: string | undefined;
|
|
639
|
+
readonly submissionId?: string | undefined;
|
|
640
|
+
readonly attemptId?: string | undefined;
|
|
641
|
+
readonly turnId?: string | undefined;
|
|
642
|
+
readonly toolCallId?: string | undefined;
|
|
643
|
+
readonly toolName?: string | undefined;
|
|
644
|
+
readonly callId?: string | undefined;
|
|
645
|
+
readonly check?: string | undefined;
|
|
646
|
+
readonly operation?: string | undefined;
|
|
647
|
+
}>>;
|
|
648
|
+
}>], {
|
|
649
|
+
readonly errorTag: string;
|
|
650
|
+
readonly message: string;
|
|
651
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
652
|
+
readonly context?: {
|
|
653
|
+
readonly agentId?: string | undefined;
|
|
654
|
+
readonly threadId?: string | undefined;
|
|
655
|
+
readonly runId?: string | undefined;
|
|
656
|
+
readonly submissionId?: string | undefined;
|
|
657
|
+
readonly attemptId?: string | undefined;
|
|
658
|
+
readonly turnId?: string | undefined;
|
|
659
|
+
readonly toolCallId?: string | undefined;
|
|
660
|
+
readonly toolName?: string | undefined;
|
|
661
|
+
readonly callId?: string | undefined;
|
|
662
|
+
readonly check?: string | undefined;
|
|
663
|
+
readonly operation?: string | undefined;
|
|
664
|
+
} | undefined;
|
|
665
|
+
}>>;
|
|
666
|
+
readonly settledAt: Schema.DateTimeUtcFromString;
|
|
667
|
+
}>, {}>;
|
|
668
|
+
/** The single durable terminal outcome recorded for one accepted Submission (DUR-002). */
|
|
669
|
+
declare class Settlement extends Settlement_base {}
|
|
670
|
+
/**
|
|
671
|
+
* Project the bounded failed-settlement diagnostic from an already Schema-validated exact
|
|
672
|
+
* reservation. Storage adapters use this when materializing their operational Settlement value;
|
|
673
|
+
* the canonical record remains the authority.
|
|
674
|
+
*/
|
|
675
|
+
declare const settlementFailureFromRecord: (record: RecordEnvelope) => SettlementFailureDiagnostic | undefined;
|
|
676
|
+
/**
|
|
677
|
+
* Assignment intent derived only from frozen admission and exact settlement evidence.
|
|
678
|
+
* Joined receipts and cancellation before a Run starts do not finish an assignment.
|
|
679
|
+
* Adapters suppress completed intent when newer accepted input remains unapplied, then
|
|
680
|
+
* install the first seal and outstanding abort intents atomically before releasing the lane.
|
|
681
|
+
*/
|
|
682
|
+
declare const workerTerminalFromRecord: (submission: SubmissionSnapshot, record: RecordEnvelope) => AssignmentTerminal | undefined;
|
|
683
|
+
/** Destination-owned permanent inbox seal; recorded atomically with all outstanding abort intents. */
|
|
684
|
+
declare const WorkerStopCommand: Schema.Struct<{
|
|
685
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
686
|
+
readonly author: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
687
|
+
}>;
|
|
688
|
+
type WorkerStopCommand = typeof WorkerStopCommand.Type;
|
|
689
|
+
declare const AbortCommand_base: Schema.Class<AbortCommand, Schema.Struct<{
|
|
690
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
691
|
+
readonly author: Schema.NonEmptyString;
|
|
692
|
+
readonly reason: Schema.String;
|
|
693
|
+
}>, {}>;
|
|
694
|
+
/**
|
|
695
|
+
* A durable abort command (durability §13). Field bounds are exactly those of the canonical
|
|
696
|
+
* `AbortRequested` payload so the intent can become canonical without re-validation.
|
|
697
|
+
*/
|
|
698
|
+
declare class AbortCommand extends AbortCommand_base {}
|
|
699
|
+
declare const AbortIntent_base: Schema.Class<AbortIntent, Schema.Struct<{
|
|
700
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
701
|
+
readonly author: Schema.NonEmptyString;
|
|
702
|
+
readonly reason: Schema.String;
|
|
703
|
+
readonly requestedAt: Schema.DateTimeUtcFromString;
|
|
704
|
+
readonly canonicalRecordId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">>;
|
|
705
|
+
}>, {}>;
|
|
706
|
+
/**
|
|
707
|
+
* The recorded abort intent. `canonicalRecordId` is present once the corresponding canonical
|
|
708
|
+
* `AbortRequested` record has been appended (its identity is deterministic; see
|
|
709
|
+
* `submissionAbortRecordId`).
|
|
710
|
+
*/
|
|
711
|
+
declare class AbortIntent extends AbortIntent_base {}
|
|
712
|
+
declare const AbortIntentRequest_base: Schema.Class<AbortIntentRequest, Schema.Struct<{
|
|
713
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
714
|
+
}>, {}>;
|
|
715
|
+
/** Address one lane-local abort intent without loading unrelated recovery state. */
|
|
716
|
+
declare class AbortIntentRequest extends AbortIntentRequest_base {}
|
|
717
|
+
declare const ClaimJoiningRequest_base: Schema.Class<ClaimJoiningRequest, Schema.Struct<{
|
|
718
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
719
|
+
readonly hostSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
720
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
721
|
+
readonly maxCount: Schema.Int;
|
|
722
|
+
}>, {}>;
|
|
723
|
+
/**
|
|
724
|
+
* Atomic claim of the contiguous ready prefix of strictly-later queued Submissions for joining
|
|
725
|
+
* into the active host Run (plan §2.5). Fenced by the host Attempt's ownership token — no epoch
|
|
726
|
+
* bump, the host already owns the lane. An `admitted`-but-not-`ready` row breaks the prefix;
|
|
727
|
+
* an aborted-settled row is a closed obligation and is skipped as a non-gap (P7 §7(c)).
|
|
728
|
+
*/
|
|
729
|
+
declare class ClaimJoiningRequest extends ClaimJoiningRequest_base {}
|
|
730
|
+
declare const JoiningClaim_base: Schema.Class<JoiningClaim, Schema.Struct<{
|
|
731
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
732
|
+
readonly queueSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/QueueSequence">;
|
|
733
|
+
readonly inputPayload: Schema.declare<Schema.Json, Schema.Json>;
|
|
734
|
+
}>, {}>;
|
|
735
|
+
/** One queued Submission transitioned to `joining` under the host's ownership. */
|
|
736
|
+
declare class JoiningClaim extends JoiningClaim_base {}
|
|
737
|
+
declare const MarkJoinedRequest_base: Schema.Class<MarkJoinedRequest, Schema.Struct<{
|
|
738
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
739
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
740
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
741
|
+
readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
742
|
+
}>, {}>;
|
|
743
|
+
/**
|
|
744
|
+
* The canonical position of one joined Submission's `UserInputRecorded` record (`input:{sid}`).
|
|
745
|
+
* Marking transitions `joining → joined` and records the host linkage established at claim time.
|
|
746
|
+
*/
|
|
747
|
+
declare class MarkJoinedRequest extends MarkJoinedRequest_base {}
|
|
748
|
+
declare const RevertJoiningRequest_base: Schema.Class<RevertJoiningRequest, Schema.Struct<{
|
|
749
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
750
|
+
}>, {}>;
|
|
751
|
+
/**
|
|
752
|
+
* Recovery-only revert of a `joining` Submission whose canonical input append never committed
|
|
753
|
+
* (DUR-016): `joining → ready`, idempotent, a no-op when the Submission already joined.
|
|
754
|
+
*/
|
|
755
|
+
declare class RevertJoiningRequest extends RevertJoiningRequest_base {}
|
|
756
|
+
declare const ApprovalPendingSuspension_base: Schema.Class<ApprovalPendingSuspension, Schema.TaggedStruct<"ApprovalPending", {
|
|
757
|
+
readonly toolCallIds: Schema.NonEmptyArray<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
758
|
+
}>, {}>;
|
|
759
|
+
/**
|
|
760
|
+
* Why one Submission is durably suspended. Approval was the only Phase 5 reason; S2 adds
|
|
761
|
+
* `WaitingForChild` (spec §12 step 10) and the union keeps later suspension families (e.g.
|
|
762
|
+
* operator quarantine) additive.
|
|
763
|
+
*/
|
|
764
|
+
declare class ApprovalPendingSuspension extends ApprovalPendingSuspension_base {}
|
|
765
|
+
declare const WaitingChild_base: Schema.Class<WaitingChild, Schema.Struct<{
|
|
766
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
767
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
768
|
+
}>, {}>;
|
|
769
|
+
/** One attached child a `waitingForChild` parent is durably waiting on (spec §12 step 10). */
|
|
770
|
+
declare class WaitingChild extends WaitingChild_base {}
|
|
771
|
+
declare const WaitingForChildSuspension_base: Schema.Class<WaitingForChildSuspension, Schema.TaggedStruct<"WaitingForChild", {
|
|
772
|
+
readonly children: Schema.NonEmptyArray<typeof WaitingChild>;
|
|
773
|
+
}>, {}>;
|
|
774
|
+
/**
|
|
775
|
+
* The parent Attempt ended without settling because attached durable children must settle and
|
|
776
|
+
* join first (spec §12 step 10, SUB-030). The suspended lane holds no worker permit; each listed
|
|
777
|
+
* child settles on its own Thread lane and `recordChildSettled` wakes the parent once
|
|
778
|
+
* every listed child is settled.
|
|
779
|
+
*/
|
|
780
|
+
declare class WaitingForChildSuspension extends WaitingForChildSuspension_base {}
|
|
781
|
+
declare const SuspensionReason: Schema.Union<readonly [typeof ApprovalPendingSuspension, typeof WaitingForChildSuspension]>;
|
|
782
|
+
type SuspensionReason = typeof SuspensionReason.Type;
|
|
783
|
+
declare const SuspendRequest_base: Schema.Class<SuspendRequest, Schema.Struct<{
|
|
784
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
785
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
786
|
+
readonly reason: Schema.Union<readonly [typeof ApprovalPendingSuspension, typeof WaitingForChildSuspension]>;
|
|
787
|
+
}>, {}>;
|
|
788
|
+
/**
|
|
789
|
+
* Durable suspension of owned work (plan §2.6): `input-applied`/`running` → `suspended`, the
|
|
790
|
+
* ownership period ends, NO settlement occurs — the accepted-work obligation stays owed while
|
|
791
|
+
* the lane consumes no worker permit.
|
|
792
|
+
*/
|
|
793
|
+
declare class SuspendRequest extends SuspendRequest_base {}
|
|
794
|
+
/**
|
|
795
|
+
* `suspended` when the lane is now durably waiting; `resume-immediately` when the suspension
|
|
796
|
+
* reason is already fully covered (a covering decision or child settlement raced ahead of the
|
|
797
|
+
* suspend transaction), so the caller resumes without releasing the lane.
|
|
798
|
+
*/
|
|
799
|
+
declare const SuspensionOutcome: Schema.Literals<readonly ["suspended", "resume-immediately"]>;
|
|
800
|
+
type SuspensionOutcome = typeof SuspensionOutcome.Type;
|
|
801
|
+
declare const ChildSettledNotification_base: Schema.Class<ChildSettledNotification, Schema.Struct<{
|
|
802
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
803
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
804
|
+
}>, {}>;
|
|
805
|
+
/**
|
|
806
|
+
* A durable child-settlement notification for one waitingForChild parent (spec §12 step 10).
|
|
807
|
+
* The child's canonical Settlement is the authority; this command only drives the parent lane's
|
|
808
|
+
* wake transition.
|
|
809
|
+
*/
|
|
810
|
+
declare class ChildSettledNotification extends ChildSettledNotification_base {}
|
|
811
|
+
/**
|
|
812
|
+
* `woken` when this notification completed the waiting set and the parent transitioned
|
|
813
|
+
* `suspended(WaitingForChild) → input-applied`; `still-waiting` while other listed children are
|
|
814
|
+
* unsettled; `not-waiting` when the parent is not (or no longer) suspended waiting on this
|
|
815
|
+
* child — including replays after a wake, so the operation is idempotent.
|
|
816
|
+
*/
|
|
817
|
+
declare const ChildSettledOutcome: Schema.Literals<readonly ["woken", "still-waiting", "not-waiting"]>;
|
|
818
|
+
type ChildSettledOutcome = typeof ChildSettledOutcome.Type;
|
|
819
|
+
/** Parent-owned child budget reservation identity, deterministically derived by the
|
|
820
|
+
* coordinator from the parent Run and Tool Call identity (spec §12 step 2). */
|
|
821
|
+
declare const ChildReservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
822
|
+
type ChildReservationId = typeof ChildReservationId.Type;
|
|
823
|
+
/**
|
|
824
|
+
* The reservation state machine (spec §12 steps 2 and 6): `reserved` while the child may still
|
|
825
|
+
* consume the allocation, `releasePending` once the final accounting decision is frozen, and
|
|
826
|
+
* `released` after the unused allocation returned exactly once.
|
|
827
|
+
*/
|
|
828
|
+
declare const ChildReservationStatus: Schema.Literals<readonly ["reserved", "releasePending", "released"]>;
|
|
829
|
+
type ChildReservationStatus = typeof ChildReservationStatus.Type;
|
|
830
|
+
declare const ChildBudgetReservationRequest_base: Schema.Class<ChildBudgetReservationRequest, Schema.Struct<{
|
|
831
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
832
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
833
|
+
readonly parentToolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
834
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
835
|
+
readonly allocation: Schema.declare<Schema.Json, Schema.Json>;
|
|
836
|
+
readonly allocationDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
837
|
+
}>, {}>;
|
|
838
|
+
/**
|
|
839
|
+
* Creation input for one parent-owned child budget reservation. The allocation is an opaque
|
|
840
|
+
* Schema-encoded budget document (D8: adapters implement transitions only and never interpret
|
|
841
|
+
* budget dimensions); `allocationDigest` must be the digest of its canonical JSON encoding.
|
|
842
|
+
*/
|
|
843
|
+
declare class ChildBudgetReservationRequest extends ChildBudgetReservationRequest_base {}
|
|
844
|
+
declare const ChildBudgetReservationSnapshot_base: Schema.Class<ChildBudgetReservationSnapshot, Schema.Struct<{
|
|
845
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
846
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
847
|
+
readonly parentToolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
848
|
+
readonly childSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
849
|
+
readonly status: Schema.Literals<readonly ["reserved", "releasePending", "released"]>;
|
|
850
|
+
readonly allocation: Schema.declare<Schema.Json, Schema.Json>;
|
|
851
|
+
readonly allocationDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
852
|
+
readonly accounting: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
853
|
+
readonly reservedAt: Schema.DateTimeUtcFromString;
|
|
854
|
+
readonly releaseBeganAt: Schema.optionalKey<Schema.DateTimeUtcFromString>;
|
|
855
|
+
readonly releasedAt: Schema.optionalKey<Schema.DateTimeUtcFromString>;
|
|
856
|
+
}>, {}>;
|
|
857
|
+
/** One child budget reservation row as the port exposes it. */
|
|
858
|
+
declare class ChildBudgetReservationSnapshot extends ChildBudgetReservationSnapshot_base {}
|
|
859
|
+
declare const ReservedChildBudget_base: Schema.Class<ReservedChildBudget, Schema.Struct<{
|
|
860
|
+
readonly reservation: typeof ChildBudgetReservationSnapshot;
|
|
861
|
+
readonly replayed: Schema.Boolean;
|
|
862
|
+
}>, {}>;
|
|
863
|
+
/**
|
|
864
|
+
* The committed reservation. `replayed` is true when an identical reservation already existed;
|
|
865
|
+
* the stored row is returned unchanged so a recovering caller resumes rather than duplicates
|
|
866
|
+
* (SUB-016).
|
|
867
|
+
*/
|
|
868
|
+
declare class ReservedChildBudget extends ReservedChildBudget_base {}
|
|
869
|
+
declare const AttachChildToReservationRequest_base: Schema.Class<AttachChildToReservationRequest, Schema.Struct<{
|
|
870
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
871
|
+
readonly ownershipToken: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/OwnershipToken">;
|
|
872
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
873
|
+
}>, {}>;
|
|
874
|
+
/** Records the admitted child on its reservation row (repairable from `SubagentStarted`). */
|
|
875
|
+
declare class AttachChildToReservationRequest extends AttachChildToReservationRequest_base {}
|
|
876
|
+
declare const BeginChildBudgetReleaseRequest_base: Schema.Class<BeginChildBudgetReleaseRequest, Schema.Struct<{
|
|
877
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
878
|
+
readonly accounting: Schema.declare<Schema.Json, Schema.Json>;
|
|
879
|
+
}>, {}>;
|
|
880
|
+
/**
|
|
881
|
+
* Freezes the final consumed/released accounting decision (spec §12 join step 6). The
|
|
882
|
+
* accounting is an opaque Schema-encoded document replayed from the canonical `SubagentJoined`
|
|
883
|
+
* record (or the deterministic zero-consumed decision for an orphaned reservation), so the
|
|
884
|
+
* decision itself authorizes the transition — no ownership token is consulted (DUR-015).
|
|
885
|
+
*/
|
|
886
|
+
declare class BeginChildBudgetReleaseRequest extends BeginChildBudgetReleaseRequest_base {}
|
|
887
|
+
declare const ReleaseChildBudgetRequest_base: Schema.Class<ReleaseChildBudgetRequest, Schema.Struct<{
|
|
888
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
889
|
+
}>, {}>;
|
|
890
|
+
/** Applies the frozen accounting decision: `releasePending → released`, exactly once. */
|
|
891
|
+
declare class ReleaseChildBudgetRequest extends ReleaseChildBudgetRequest_base {}
|
|
892
|
+
declare const ApprovalDecisionCommand_base: Schema.Class<ApprovalDecisionCommand, Schema.Struct<{
|
|
893
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
894
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
895
|
+
readonly decision: Schema.Literals<readonly ["approved", "denied"]>;
|
|
896
|
+
readonly resolver: Schema.NonEmptyString;
|
|
897
|
+
readonly reason: Schema.String;
|
|
898
|
+
}>, {}>;
|
|
899
|
+
/**
|
|
900
|
+
* A durable approval decision command (plan §2.6, `abort`-shaped). Field bounds are exactly those
|
|
901
|
+
* of the canonical `ToolApprovalDecided` payload so the intent can become canonical without
|
|
902
|
+
* re-validation.
|
|
903
|
+
*/
|
|
904
|
+
declare class ApprovalDecisionCommand extends ApprovalDecisionCommand_base {}
|
|
905
|
+
declare const ApprovalDecisionIntent_base: Schema.Class<ApprovalDecisionIntent, Schema.Struct<{
|
|
906
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
907
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
908
|
+
readonly decision: Schema.Literals<readonly ["approved", "denied"]>;
|
|
909
|
+
readonly resolver: Schema.NonEmptyString;
|
|
910
|
+
readonly reason: Schema.String;
|
|
911
|
+
readonly decidedAt: Schema.DateTimeUtcFromString;
|
|
912
|
+
readonly canonicalRecordId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">>;
|
|
913
|
+
}>, {}>;
|
|
914
|
+
/**
|
|
915
|
+
* The recorded approval-decision intent, idempotent per `(submissionId, toolCallId)`.
|
|
916
|
+
* `canonicalRecordId` is present once the corresponding canonical `ToolApprovalDecided` record
|
|
917
|
+
* has been appended (see `toolApprovalDecisionRecordId`).
|
|
918
|
+
*/
|
|
919
|
+
declare class ApprovalDecisionIntent extends ApprovalDecisionIntent_base {}
|
|
920
|
+
declare const MarkUnknownRequest_base: Schema.Class<MarkUnknownRequest, Schema.Struct<{
|
|
921
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
922
|
+
readonly toolCallIds: Schema.NonEmptyArray<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
923
|
+
readonly reason: Schema.String;
|
|
924
|
+
}>, {}>;
|
|
925
|
+
/**
|
|
926
|
+
* Durable Unknown marking for one Submission's open ordinary Tool Calls (DUR-009): state →
|
|
927
|
+
* `unknown`, parking that Submission without changing ownership or the Thread epoch. Idempotent.
|
|
928
|
+
*/
|
|
929
|
+
declare class MarkUnknownRequest extends MarkUnknownRequest_base {}
|
|
930
|
+
declare const ResolutionCompletedWithResult_base: Schema.Class<ResolutionCompletedWithResult, Schema.TaggedStruct<"CompletedWithResult", {
|
|
931
|
+
readonly result: Schema.declare<Schema.Json, Schema.Json>;
|
|
932
|
+
readonly isFailure: Schema.Boolean;
|
|
933
|
+
}>, {}>;
|
|
934
|
+
/** The recovered supplier truth: the external effect completed with this exact result. */
|
|
935
|
+
declare class ResolutionCompletedWithResult extends ResolutionCompletedWithResult_base {}
|
|
936
|
+
declare const ResolutionNeverHappened_base: Schema.Class<ResolutionNeverHappened, Schema.TaggedStruct<"NeverHappened", {}>, {}>;
|
|
937
|
+
/** The external effect provably never happened; the call may re-execute on resume. */
|
|
938
|
+
declare class ResolutionNeverHappened extends ResolutionNeverHappened_base {}
|
|
939
|
+
declare const ResolutionSafeToRetry_base: Schema.Class<ResolutionSafeToRetry, Schema.TaggedStruct<"SafeToRetry", {}>, {}>;
|
|
940
|
+
/** The call is safe to repeat under the external system's idempotency contract. */
|
|
941
|
+
declare class ResolutionSafeToRetry extends ResolutionSafeToRetry_base {}
|
|
942
|
+
declare const ResolutionAbortSubmission_base: Schema.Class<ResolutionAbortSubmission, Schema.TaggedStruct<"AbortSubmission", {}>, {}>;
|
|
943
|
+
/** Give up on the Submission: route into the abort path (unknown calls stay recorded; abort
|
|
944
|
+
* never claims external rollback, durability §13). */
|
|
945
|
+
declare class ResolutionAbortSubmission extends ResolutionAbortSubmission_base {}
|
|
946
|
+
/** How an authorized resolver closed one Unknown Outcome (DUR-017). */
|
|
947
|
+
declare const UnknownResolution: Schema.Union<readonly [typeof ResolutionCompletedWithResult, typeof ResolutionNeverHappened, typeof ResolutionSafeToRetry, typeof ResolutionAbortSubmission]>;
|
|
948
|
+
type UnknownResolution = typeof UnknownResolution.Type;
|
|
949
|
+
declare const UnknownResolutionCommand_base: Schema.Class<UnknownResolutionCommand, Schema.Struct<{
|
|
950
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
951
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
952
|
+
readonly author: Schema.NonEmptyString;
|
|
953
|
+
readonly reason: Schema.String;
|
|
954
|
+
readonly resolution: Schema.Union<readonly [typeof ResolutionCompletedWithResult, typeof ResolutionNeverHappened, typeof ResolutionSafeToRetry, typeof ResolutionAbortSubmission]>;
|
|
955
|
+
}>, {}>;
|
|
956
|
+
/**
|
|
957
|
+
* A durable Unknown-Outcome resolution command (DUR-017, `abort`-shaped). Possession of the
|
|
958
|
+
* runtime service plus the mandatory `author`/`reason` audit fields is the Phase 5 authorization
|
|
959
|
+
* boundary — identical to `abort`; the authenticated operator surface is a P7 deliverable.
|
|
960
|
+
* Field bounds are exactly those of the canonical `ToolCallResolved` payload.
|
|
961
|
+
*/
|
|
962
|
+
declare class UnknownResolutionCommand extends UnknownResolutionCommand_base {}
|
|
963
|
+
declare const UnknownResolutionIntent_base: Schema.Class<UnknownResolutionIntent, Schema.Struct<{
|
|
964
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
965
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
966
|
+
readonly author: Schema.NonEmptyString;
|
|
967
|
+
readonly reason: Schema.String;
|
|
968
|
+
readonly resolution: Schema.Union<readonly [typeof ResolutionCompletedWithResult, typeof ResolutionNeverHappened, typeof ResolutionSafeToRetry, typeof ResolutionAbortSubmission]>;
|
|
969
|
+
readonly resolvedAt: Schema.DateTimeUtcFromString;
|
|
970
|
+
readonly canonicalRecordId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">>;
|
|
971
|
+
}>, {}>;
|
|
972
|
+
/**
|
|
973
|
+
* The recorded resolution intent, idempotent per `(submissionId, toolCallId)`. The canonical
|
|
974
|
+
* `ToolCallResolved` (+ `ToolCallSettled` for `CompletedWithResult`) is appended by the recovery
|
|
975
|
+
* pass or the next owning Attempt; `canonicalRecordId` is present once it is.
|
|
976
|
+
*/
|
|
977
|
+
declare class UnknownResolutionIntent extends UnknownResolutionIntent_base {}
|
|
978
|
+
declare const OwnershipSnapshot_base: Schema.Class<OwnershipSnapshot, Schema.Struct<{
|
|
979
|
+
readonly attemptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AttemptId">;
|
|
980
|
+
readonly ownerProducerId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ProducerId">;
|
|
981
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
982
|
+
readonly leaseExpiresAt: Schema.DateTimeUtcFromString;
|
|
983
|
+
}>, {}>;
|
|
984
|
+
/** Current ownership as recovery sees it. The live owner's token is never exposed here. */
|
|
985
|
+
declare class OwnershipSnapshot extends OwnershipSnapshot_base {}
|
|
986
|
+
declare const SettlementReservationSnapshot_base: Schema.Class<SettlementReservationSnapshot, Schema.Struct<{
|
|
987
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
988
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
989
|
+
readonly record: typeof RecordEnvelope;
|
|
990
|
+
readonly recordDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
991
|
+
readonly finalized: Schema.Boolean;
|
|
992
|
+
}>, {}>;
|
|
993
|
+
/** A settlement reservation as recovery sees it. */
|
|
994
|
+
declare class SettlementReservationSnapshot extends SettlementReservationSnapshot_base {}
|
|
995
|
+
declare const RecoverySnapshotRequest_base: Schema.Class<RecoverySnapshotRequest, Schema.Struct<{
|
|
996
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
997
|
+
}>, {}>;
|
|
998
|
+
declare class RecoverySnapshotRequest extends RecoverySnapshotRequest_base {}
|
|
999
|
+
declare const JoinSnapshot_base: Schema.Class<JoinSnapshot, Schema.Struct<{
|
|
1000
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1001
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
1002
|
+
readonly hostSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1003
|
+
}>, {}>;
|
|
1004
|
+
/** One joined/joining Submission of a host Run, as the host's recovery sees it. */
|
|
1005
|
+
declare class JoinSnapshot extends JoinSnapshot_base {}
|
|
1006
|
+
declare const SuspensionSnapshot_base: Schema.Class<SuspensionSnapshot, Schema.Struct<{
|
|
1007
|
+
readonly reason: Schema.Union<readonly [typeof ApprovalPendingSuspension, typeof WaitingForChildSuspension]>;
|
|
1008
|
+
readonly suspendedAt: Schema.DateTimeUtcFromString;
|
|
1009
|
+
}>, {}>;
|
|
1010
|
+
/** A durable suspension as recovery sees it. */
|
|
1011
|
+
declare class SuspensionSnapshot extends SuspensionSnapshot_base {}
|
|
1012
|
+
declare const ChildAttachmentSnapshot_base: Schema.Class<ChildAttachmentSnapshot, Schema.Struct<{
|
|
1013
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1014
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1015
|
+
readonly childState: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
1016
|
+
readonly childOutcome: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "aborted"]>>;
|
|
1017
|
+
}>, {}>;
|
|
1018
|
+
/**
|
|
1019
|
+
* One attached child of this parent as its recovery sees it: the reservation's recorded child
|
|
1020
|
+
* plus that child's current lane state. A disposable derived view — the canonical
|
|
1021
|
+
* `SubagentRequested`/`SubagentStarted` records and the child's own canonical Settlement remain
|
|
1022
|
+
* the recovery truth (DUR-015).
|
|
1023
|
+
*/
|
|
1024
|
+
declare class ChildAttachmentSnapshot extends ChildAttachmentSnapshot_base {}
|
|
1025
|
+
declare const RecoverySnapshot_base: Schema.Class<RecoverySnapshot, Schema.Struct<{
|
|
1026
|
+
readonly submission: typeof SubmissionSnapshot;
|
|
1027
|
+
readonly ownership: Schema.optionalKey<typeof OwnershipSnapshot>;
|
|
1028
|
+
readonly inputApplied: Schema.optionalKey<typeof InputAppliedMarker>;
|
|
1029
|
+
readonly reservation: Schema.optionalKey<typeof SettlementReservationSnapshot>;
|
|
1030
|
+
readonly abortIntent: Schema.optionalKey<typeof AbortIntent>;
|
|
1031
|
+
readonly joins: Schema.$Array<typeof JoinSnapshot>;
|
|
1032
|
+
readonly hostSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
1033
|
+
readonly suspension: Schema.optionalKey<typeof SuspensionSnapshot>;
|
|
1034
|
+
readonly approvalDecisions: Schema.$Array<typeof ApprovalDecisionIntent>;
|
|
1035
|
+
readonly unknownResolutions: Schema.$Array<typeof UnknownResolutionIntent>;
|
|
1036
|
+
readonly childReservations: Schema.withConstructorDefault<Schema.$Array<typeof ChildBudgetReservationSnapshot>>;
|
|
1037
|
+
readonly childAttachments: Schema.withConstructorDefault<Schema.$Array<typeof ChildAttachmentSnapshot>>;
|
|
1038
|
+
readonly parentLinkage: Schema.optionalKey<typeof ParentLinkage>;
|
|
1039
|
+
}>, {}>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Everything the pure recovery classifier needs about one Submission, read strongly consistently
|
|
1042
|
+
* (STORE-003). Canonical history still wins over every marker in this snapshot (DUR-015).
|
|
1043
|
+
*
|
|
1044
|
+
* Phase 5 fields: `joins` is the host-side view (every Submission `joining`/`joined` to this
|
|
1045
|
+
* one); `hostSubmissionId` is the joined-side view; `suspension` mirrors the `suspended` state;
|
|
1046
|
+
* `approvalDecisions` and `unknownResolutions` are the durable intents recorded against this
|
|
1047
|
+
* Submission (empty when none exist).
|
|
1048
|
+
*
|
|
1049
|
+
* S2 fields: `childReservations`/`childAttachments` are the parent-side subagent view (ordered
|
|
1050
|
+
* by parent Tool Call id) and `parentLinkage` is the child-side view. They default to
|
|
1051
|
+
* empty/absent at construction so pre-S2 call sites stay valid; adapters always populate them.
|
|
1052
|
+
*/
|
|
1053
|
+
declare class RecoverySnapshot extends RecoverySnapshot_base {}
|
|
1054
|
+
declare const AdmissionConflict_base: Schema.Class<AdmissionConflict, Schema.TaggedStruct<"AdmissionConflict", {
|
|
1055
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
1056
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
1057
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
1058
|
+
readonly existingInputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
1059
|
+
readonly attemptedInputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
1060
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1061
|
+
/** The same idempotency key was admitted with different canonical input content. */
|
|
1062
|
+
declare class AdmissionConflict extends AdmissionConflict_base {}
|
|
1063
|
+
declare const OwnershipLost_base: Schema.Class<OwnershipLost, Schema.TaggedStruct<"OwnershipLost", {
|
|
1064
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1065
|
+
readonly actualEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
1066
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1067
|
+
/**
|
|
1068
|
+
* The presented ownership token no longer owns the Submission's lane. `actualEpoch` is the
|
|
1069
|
+
* thread's current producer epoch so a stale Attempt can prove to itself it was superseded.
|
|
1070
|
+
*/
|
|
1071
|
+
declare class OwnershipLost extends OwnershipLost_base {}
|
|
1072
|
+
declare const SettlementConflict_base: Schema.Class<SettlementConflict, Schema.TaggedStruct<"SettlementConflict", {
|
|
1073
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1074
|
+
readonly existingOutcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
1075
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1076
|
+
/** A conflicting terminal outcome was already reserved or finalized (DUR-002, DUR-012). */
|
|
1077
|
+
declare class SettlementConflict extends SettlementConflict_base {}
|
|
1078
|
+
declare const ApprovalConflict_base: Schema.Class<ApprovalConflict, Schema.TaggedStruct<"ApprovalConflict", {
|
|
1079
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1080
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1081
|
+
readonly existingDecision: Schema.Literals<readonly ["approved", "denied"]>;
|
|
1082
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1083
|
+
/**
|
|
1084
|
+
* A divergent approval re-decision for an already-decided `(submissionId, toolCallId)` pair.
|
|
1085
|
+
* Repeating the SAME decision replays the recorded intent instead (idempotency).
|
|
1086
|
+
*/
|
|
1087
|
+
declare class ApprovalConflict extends ApprovalConflict_base {}
|
|
1088
|
+
declare const UnknownResolutionConflict_base: Schema.Class<UnknownResolutionConflict, Schema.TaggedStruct<"UnknownResolutionConflict", {
|
|
1089
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1090
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1091
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1092
|
+
/**
|
|
1093
|
+
* A divergent unknown-outcome re-resolution for an already-resolved `(submissionId, toolCallId)`
|
|
1094
|
+
* pair (DUR-017). Repeating the SAME resolution replays the recorded intent instead.
|
|
1095
|
+
*/
|
|
1096
|
+
declare class UnknownResolutionConflict extends UnknownResolutionConflict_base {}
|
|
1097
|
+
declare const ChildReservationConflict_base: Schema.Class<ChildReservationConflict, Schema.TaggedStruct<"ChildReservationConflict", {
|
|
1098
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
1099
|
+
readonly status: Schema.Literals<readonly ["reserved", "releasePending", "released"]>;
|
|
1100
|
+
readonly message: Schema.String;
|
|
1101
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1102
|
+
/**
|
|
1103
|
+
* A child budget reservation request contradicts recorded reservation state: a divergent
|
|
1104
|
+
* allocation for the same reservation id, a second reservation id for the same parent Tool
|
|
1105
|
+
* Call, a divergent child attachment, a divergent accounting freeze, or an out-of-order state
|
|
1106
|
+
* transition. `status` reports the existing row's status. Identical replays never conflict.
|
|
1107
|
+
*/
|
|
1108
|
+
declare class ChildReservationConflict extends ChildReservationConflict_base {}
|
|
1109
|
+
declare const LedgerError_base: Schema.Class<LedgerError, Schema.TaggedStruct<"LedgerError", {
|
|
1110
|
+
readonly operation: Schema.String;
|
|
1111
|
+
readonly message: Schema.String;
|
|
1112
|
+
readonly cause: Schema.optionalKey<Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>>;
|
|
1113
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1114
|
+
/** Adapter-level ledger failure (storage unavailable, unknown submission, corrupt row, ...). */
|
|
1115
|
+
declare class LedgerError extends LedgerError_base {}
|
|
1116
|
+
type SubmissionLedgerFailure = AdmissionConflict | OwnershipLost | SettlementConflict | ApprovalConflict | UnknownResolutionConflict | JoinedToHost | ChildReservationConflict | LedgerError | AdmissionPolicyError;
|
|
1117
|
+
declare const SubmissionLedger_base: Context.ServiceClass<SubmissionLedger, "@effect-agent/thread/SubmissionLedger", {
|
|
1118
|
+
readonly capabilities: Effect.Effect<LedgerCapabilities>;
|
|
1119
|
+
readonly admit: (request: AdmissionRequest) => Effect.Effect<AdmissionResult, AdmissionConflict | AdmissionPolicyError | LedgerError>;
|
|
1120
|
+
readonly markReady: (request: MarkReadyRequest) => Effect.Effect<void, LedgerError>;
|
|
1121
|
+
readonly lookup: (request: SubmissionLookup) => Effect.Effect<Option.Option<SubmissionSnapshot>, LedgerError>;
|
|
1122
|
+
readonly resolveAdmission: (request: SubmissionLookupByKey) => Effect.Effect<AdmissionResolution, LedgerError>;
|
|
1123
|
+
readonly claim: (request: ClaimRequest) => Effect.Effect<Option.Option<Claim>, LedgerError>;
|
|
1124
|
+
readonly renewOwnership: (request: RenewOwnershipRequest) => Effect.Effect<OwnershipRenewal, OwnershipLost | LedgerError>;
|
|
1125
|
+
readonly releaseOwnership: (request: ReleaseOwnershipRequest) => Effect.Effect<void, OwnershipLost | LedgerError>;
|
|
1126
|
+
readonly markInputApplied: (request: MarkInputAppliedRequest) => Effect.Effect<void, OwnershipLost | LedgerError>;
|
|
1127
|
+
readonly reserveSettlement: (request: SettlementReservation) => Effect.Effect<ReservedSettlement, SettlementConflict | OwnershipLost | LedgerError>;
|
|
1128
|
+
readonly finalizeSettlement: (request: SettlementFinalization) => Effect.Effect<Settlement, SettlementConflict | LedgerError>;
|
|
1129
|
+
/** Optional for third-party adapters. Remaining ownership must reach zero before stop acknowledgement. */
|
|
1130
|
+
readonly inspectWorker?: (threadId: ThreadId) => Effect.Effect<WorkerLedgerState, LedgerError>;
|
|
1131
|
+
readonly stopWorker?: (request: WorkerStopCommand) => Effect.Effect<number, LedgerError>;
|
|
1132
|
+
readonly requestAbort: (request: AbortCommand) => Effect.Effect<AbortIntent, SettlementConflict | JoinedToHost | LedgerError>;
|
|
1133
|
+
/**
|
|
1134
|
+
* Strongly consistent lane-local read. Unknown Submissions fail with LedgerError. Canonical
|
|
1135
|
+
* proof has the same meaning as in RecoverySnapshot; this read grants no execution authority.
|
|
1136
|
+
*/
|
|
1137
|
+
readonly readAbortIntent: (request: AbortIntentRequest) => Effect.Effect<AbortIntent | undefined, LedgerError>;
|
|
1138
|
+
readonly claimJoining: (request: ClaimJoiningRequest) => Effect.Effect<ReadonlyArray<JoiningClaim>, OwnershipLost | LedgerError>;
|
|
1139
|
+
readonly markJoined: (request: MarkJoinedRequest) => Effect.Effect<void, OwnershipLost | LedgerError>;
|
|
1140
|
+
readonly revertJoining: (request: RevertJoiningRequest) => Effect.Effect<void, LedgerError>;
|
|
1141
|
+
readonly suspend: (request: SuspendRequest) => Effect.Effect<SuspensionOutcome, OwnershipLost | SettlementConflict | LedgerError>;
|
|
1142
|
+
readonly recordApprovalDecision: (command: ApprovalDecisionCommand) => Effect.Effect<ApprovalDecisionIntent, ApprovalConflict | SettlementConflict | LedgerError>;
|
|
1143
|
+
readonly markUnknown: (request: MarkUnknownRequest) => Effect.Effect<void, SettlementConflict | LedgerError>;
|
|
1144
|
+
readonly recordUnknownResolution: (command: UnknownResolutionCommand) => Effect.Effect<UnknownResolutionIntent, UnknownResolutionConflict | SettlementConflict | LedgerError>;
|
|
1145
|
+
readonly recordChildSettled: (request: ChildSettledNotification) => Effect.Effect<ChildSettledOutcome, LedgerError>;
|
|
1146
|
+
readonly reserveChildBudget: (request: ChildBudgetReservationRequest) => Effect.Effect<ReservedChildBudget, ChildReservationConflict | OwnershipLost | LedgerError>;
|
|
1147
|
+
readonly attachChildToReservation: (request: AttachChildToReservationRequest) => Effect.Effect<ChildBudgetReservationSnapshot, ChildReservationConflict | OwnershipLost | LedgerError>;
|
|
1148
|
+
readonly beginChildBudgetRelease: (request: BeginChildBudgetReleaseRequest) => Effect.Effect<ChildBudgetReservationSnapshot, ChildReservationConflict | LedgerError>;
|
|
1149
|
+
readonly releaseChildBudget: (request: ReleaseChildBudgetRequest) => Effect.Effect<ChildBudgetReservationSnapshot, ChildReservationConflict | LedgerError>;
|
|
1150
|
+
readonly scanNonterminal: Stream.Stream<SubmissionWorkItem, LedgerError>;
|
|
1151
|
+
readonly loadRecoverySnapshot: (request: RecoverySnapshotRequest) => Effect.Effect<RecoverySnapshot, LedgerError>;
|
|
1152
|
+
}>;
|
|
1153
|
+
/**
|
|
1154
|
+
* Operational durable state for accepted work: admission, FIFO readiness, ownership, leases,
|
|
1155
|
+
* abort intent, and settlement obligations (STORE-001). The Thread Log remains the
|
|
1156
|
+
* authority for applied input and terminal outcomes; every marker in this ledger can be rebuilt
|
|
1157
|
+
* from canonical history (DUR-015).
|
|
1158
|
+
*
|
|
1159
|
+
* Operation contracts:
|
|
1160
|
+
*
|
|
1161
|
+
* - `admit` — atomic and idempotent by (threadId, principal, idempotencyKey). A replay
|
|
1162
|
+
* with the same `inputDigest` returns the original `AdmissionResult` with `replayed` set; a
|
|
1163
|
+
* replay with a different digest fails with `AdmissionConflict`. Admission allocates the
|
|
1164
|
+
* Submission's `queueSequence` (FIFO position, DUR-004) and mints `submissionId`/`receiptId`.
|
|
1165
|
+
* An optional `parentLinkage` is recorded immutably at first admission (SUB-016); a replay
|
|
1166
|
+
* whose linkage diverges (present vs. absent, or different identities) fails with
|
|
1167
|
+
* `AdmissionConflict` even when the input digest matches.
|
|
1168
|
+
* - `resolveAdmission` — authoritative tri-state admission lookup by scoped idempotency key
|
|
1169
|
+
* (SUB-031): `NotAdmitted` proves absence, `Admitted` carries the full snapshot, and
|
|
1170
|
+
* `Indeterminate` states that the adapter cannot currently prove either. Only `NotAdmitted`
|
|
1171
|
+
* permits an admission attempt. Single strongly consistent stores derive the answer from a
|
|
1172
|
+
* direct lookup and never answer `Indeterminate`.
|
|
1173
|
+
* - `markReady` — idempotent transition admitted → ready after Thread materialization.
|
|
1174
|
+
* Marking an already-ready (or later-state) Submission is a no-op.
|
|
1175
|
+
* - `lookup` — read one Submission by identity or scoped idempotency key; strongly consistent
|
|
1176
|
+
* with prior ledger writes.
|
|
1177
|
+
* - `claim` — claims the lowest unsettled `queueSequence` after skipping only unknown rows
|
|
1178
|
+
* without abort intent. Approval, joining and child-wait barriers remain ordered. Returns
|
|
1179
|
+
* `Option.none` when no eligible work exists or ANY lease in the Thread is live, including
|
|
1180
|
+
* a lease belonging to the same producer. A successful claim atomically bumps the Thread's producer
|
|
1181
|
+
* epoch — fencing every stale Attempt out of canonical appends (DUR-006) — mints a fresh
|
|
1182
|
+
* `attemptId` and `ownershipToken`, and starts the ownership lease (D5: adapters default to
|
|
1183
|
+
* `DEFAULT_OWNERSHIP_LEASE_DURATION`, configurable). An expired lease makes the head
|
|
1184
|
+
* claimable; expiry alone never revokes correctness, only permission to assume liveness.
|
|
1185
|
+
* - `renewOwnership` — extends the lease while the token still owns the lane; fails with
|
|
1186
|
+
* `OwnershipLost` once superseded. Renewal after lease expiry succeeds if no other claim has
|
|
1187
|
+
* taken the lane in between.
|
|
1188
|
+
* - `releaseOwnership` — graceful drain: ends the ownership period without settling, returning
|
|
1189
|
+
* a nonterminal head to claimable state. Fails with `OwnershipLost` once superseded.
|
|
1190
|
+
* - `markInputApplied` — idempotent marker that the deterministic `UserInputRecorded` record is
|
|
1191
|
+
* canonical (state → input-applied). Recovery repairs this marker from history when the append
|
|
1192
|
+
* committed but the marker write was lost.
|
|
1193
|
+
* - `reserveSettlement` — reserves the Submission's single exact settlement record
|
|
1194
|
+
* (state → terminalizing). Idempotent: an identical reservation replays with `replayed` set; a
|
|
1195
|
+
* different outcome or content fails with `SettlementConflict{existingOutcome}` (DUR-011).
|
|
1196
|
+
* For a `joined` Submission the reservation is authorized by its recorded host linkage — a
|
|
1197
|
+
* joined lane is never worker-claimable, so no ownership token can exist for it and the
|
|
1198
|
+
* presented token is not consulted (plan §2.5: joined Submissions settle with the host).
|
|
1199
|
+
* Likewise, an ABORTED reservation for a `ready`/`terminalizing` Submission that carries a
|
|
1200
|
+
* durable abort intent and holds no live ownership is authorized by that intent (P7 §7(c)):
|
|
1201
|
+
* recovery settles aborted never-claimed queued work immediately, without waiting for it to
|
|
1202
|
+
* head the lane. Both exceptions are outcome- and state-narrow; everything else stays fenced.
|
|
1203
|
+
* - `finalizeSettlement` — idempotent terminal transition (state → settled) after the reserved
|
|
1204
|
+
* record is canonical. Native adapters seal opted-in worker assignments atomically before
|
|
1205
|
+
* releasing the lane. Otherwise the next `queueSequence` becomes claimable. It
|
|
1206
|
+
* requires no ownership token: canonical history authorizes finalization (DUR-015). A
|
|
1207
|
+
* finalization that disagrees with the recorded outcome fails with `SettlementConflict`.
|
|
1208
|
+
* - `requestAbort` — durable, idempotent by `submissionId`: repeating returns the recorded
|
|
1209
|
+
* intent unchanged (DUR-012). Fails with `SettlementConflict` once the Submission is settled;
|
|
1210
|
+
* abort never rewrites a terminal outcome. Fails with `JoinedToHost` for a `joined` Submission
|
|
1211
|
+
* — it settles with its host, so the abort target is the host (plan §2.5). Abort of a
|
|
1212
|
+
* `joining` Submission records the intent; it is honored only if the host has not consumed the
|
|
1213
|
+
* input (revert-then-abort).
|
|
1214
|
+
* - `claimJoining` — atomic: transitions the contiguous `ready` prefix of strictly-later
|
|
1215
|
+
* `queueSequence`s (up to `maxCount`) to `joining` under the host's ownership token, recording
|
|
1216
|
+
* the host linkage; no epoch bump (the host Attempt already owns the lane). An
|
|
1217
|
+
* `admitted`-not-`ready` row breaks the prefix; an aborted-settled row is a closed obligation
|
|
1218
|
+
* and is skipped as a non-gap (P7 §7(c)). Fails with `OwnershipLost` once superseded.
|
|
1219
|
+
* - `markJoined` — idempotent `joining → joined` with the canonical input record position;
|
|
1220
|
+
* repairable from history when the append committed but the marker write was lost (DUR-016).
|
|
1221
|
+
* - `revertJoining` — recovery-only, idempotent `joining → ready`; a no-op when already joined.
|
|
1222
|
+
* - `suspend` — `input-applied`/`running` → `suspended`; ends the ownership period WITHOUT
|
|
1223
|
+
* settling (the obligation stays owed, the lane consumes no worker permit). Returns
|
|
1224
|
+
* `resume-immediately` when the reason is already fully covered: for `ApprovalPending`,
|
|
1225
|
+
* recorded decisions cover every pending call; for `WaitingForChild`, every listed child is
|
|
1226
|
+
* already provably settled. Adapters must guarantee that a child settlement reported before
|
|
1227
|
+
* the suspend transaction commits is observed by that suspend (single-store adapters derive
|
|
1228
|
+
* this from the child's own row; cross-store adapters record a durable notification marker).
|
|
1229
|
+
* Fails with `SettlementConflict` once settled.
|
|
1230
|
+
* - `recordApprovalDecision` — durable, idempotent per `(submissionId, toolCallId)`: repeating
|
|
1231
|
+
* the same decision replays the intent; a divergent re-decision fails with `ApprovalConflict`.
|
|
1232
|
+
* Transitions `suspended(ApprovalPending) → input-applied` once every pending call of the
|
|
1233
|
+
* suspension reason is decided, waking the lane. Fails with `SettlementConflict` once settled.
|
|
1234
|
+
* - `recordChildSettled` — idempotent cross-lane wake (spec §12 step 10): transitions
|
|
1235
|
+
* `suspended(WaitingForChild) → input-applied` exactly when EVERY listed child is settled,
|
|
1236
|
+
* answering `woken`; `still-waiting` while any listed child is unsettled; `not-waiting` when
|
|
1237
|
+
* the parent is not suspended waiting on this child (including replays after the wake). The
|
|
1238
|
+
* child's canonical Settlement is the authority. The runtime reports it after the exact
|
|
1239
|
+
* reserved record is appended and before ledger finalization, so same-store adapters accept
|
|
1240
|
+
* `terminalizing` only when its exact reservation exists; an earlier child is an
|
|
1241
|
+
* adapter-checked caller error. It never settles the parent and requires no ownership token:
|
|
1242
|
+
* the canonically recorded child settlement authorizes the wake.
|
|
1243
|
+
* - `reserveChildBudget` — idempotent get-or-create of the parent-owned child budget
|
|
1244
|
+
* reservation (spec §12 step 2), fenced by the parent lane's live `OwnershipToken`. An
|
|
1245
|
+
* identical replay returns the stored row with `replayed` set (unfenced, mirroring
|
|
1246
|
+
* `reserveSettlement`); a divergent allocation for the same id, or a second id for the same
|
|
1247
|
+
* `(parentSubmissionId, parentToolCallId)`, fails with `ChildReservationConflict`.
|
|
1248
|
+
* - `attachChildToReservation` — idempotent: records the admitted child on the reservation row
|
|
1249
|
+
* (repairable from the canonical `SubagentStarted` record). A replay with the recorded child
|
|
1250
|
+
* is a no-op; the first attach is fenced by the parent token and requires status `reserved`;
|
|
1251
|
+
* a divergent child fails with `ChildReservationConflict`.
|
|
1252
|
+
* - `beginChildBudgetRelease` — `reserved → releasePending`: freezes the final accounting
|
|
1253
|
+
* decision exactly once. Replaying the identical accounting (at `releasePending` or
|
|
1254
|
+
* `released`) is a no-op; a divergent accounting fails with `ChildReservationConflict`.
|
|
1255
|
+
* Requires no ownership token: the accounting is replayed from the canonical `SubagentJoined`
|
|
1256
|
+
* record (or is the deterministic zero-consumed decision for an orphaned reservation), so
|
|
1257
|
+
* canonical history authorizes the transition (DUR-015) and the freeze comparison — not a
|
|
1258
|
+
* fence — guarantees one decision.
|
|
1259
|
+
* - `releaseChildBudget` — `releasePending → released`, applied exactly once; replaying returns
|
|
1260
|
+
* the released row unchanged. Releasing a still-`reserved` row (no frozen accounting) fails
|
|
1261
|
+
* with `ChildReservationConflict`. "A crash before release leaves budget unavailable until
|
|
1262
|
+
* repair, never available twice" (spec §12).
|
|
1263
|
+
* - `markUnknown` — idempotent, ownership-free (canonical evidence authorizes it): state →
|
|
1264
|
+
* `unknown`, parking the Submission while its accepted settlement obligation stays visible.
|
|
1265
|
+
* Existing ownership must release or expire before another claim (DUR-009/DUR-017).
|
|
1266
|
+
* Fails with `SettlementConflict` once settled.
|
|
1267
|
+
* - `recordUnknownResolution` — durable, idempotent per `(submissionId, toolCallId)`; a
|
|
1268
|
+
* divergent re-resolution fails with `UnknownResolutionConflict`. Transitions
|
|
1269
|
+
* `unknown → input-applied` once no open call remains, waking the lane. Fails with
|
|
1270
|
+
* `SettlementConflict` once settled.
|
|
1271
|
+
* - `scanNonterminal` — streams control-only entries for every Submission whose state is not
|
|
1272
|
+
* `settled`, ordered by (threadId, queueSequence); recovery's admission-independent worklist
|
|
1273
|
+
* (DUR-014). It must not decode execution payloads. SQL or control-identity corruption fails
|
|
1274
|
+
* the scan; selected-Thread payload hydration belongs inside the caller's isolation boundary.
|
|
1275
|
+
* - `loadRecoverySnapshot` — strongly consistent full snapshot for the pure recovery classifier.
|
|
1276
|
+
*
|
|
1277
|
+
* No operation claims exactly-once external side effects; the ledger records decisions
|
|
1278
|
+
* exactly once (DUR-003).
|
|
1279
|
+
*/
|
|
1280
|
+
declare class SubmissionLedger extends SubmissionLedger_base {}
|
|
1281
|
+
/**
|
|
1282
|
+
* Deterministic identity rules shared by every adapter and the durable coordinator. The batch
|
|
1283
|
+
* carrying one Submission's canonical `UserInputRecorded` record is `submission-input:{sid}` and
|
|
1284
|
+
* the record is `input:{sid}`, so batch idempotency (DUR-007) makes the input append
|
|
1285
|
+
* exactly-once-canonical across Attempts.
|
|
1286
|
+
*/
|
|
1287
|
+
declare const submissionInputBatchId: (submissionId: SubmissionId) => BatchId;
|
|
1288
|
+
/** Deterministic canonical record identity of one Submission's `UserInputRecorded` record. */
|
|
1289
|
+
declare const submissionInputRecordId: (submissionId: SubmissionId) => RecordId;
|
|
1290
|
+
/** Deterministic `SettlementId` for one Submission: `settlement:{sid}`. */
|
|
1291
|
+
declare const submissionSettlementId: (submissionId: SubmissionId) => SettlementId;
|
|
1292
|
+
/** Deterministic batch identity of one Submission's canonical `SubmissionSettled` append. */
|
|
1293
|
+
declare const submissionSettlementBatchId: (submissionId: SubmissionId) => BatchId;
|
|
1294
|
+
/** Deterministic canonical record identity of one Submission's `SubmissionSettled` record. */
|
|
1295
|
+
declare const submissionSettlementRecordId: (submissionId: SubmissionId) => RecordId;
|
|
1296
|
+
/** Deterministic batch identity of one Submission's canonical `AbortRequested` append. */
|
|
1297
|
+
declare const submissionAbortBatchId: (submissionId: SubmissionId) => BatchId;
|
|
1298
|
+
/** Deterministic canonical record identity of one Submission's `AbortRequested` record. */
|
|
1299
|
+
declare const submissionAbortRecordId: (submissionId: SubmissionId) => RecordId;
|
|
1300
|
+
/** Destination policy, captured when the ledger is acquired. It runs inside fresh admission's
|
|
1301
|
+
* serialization after replay lookup. The host must keep it bounded and must not reenter admit.
|
|
1302
|
+
* The callback must read authoritative policy in this SAME local transaction, through the
|
|
1303
|
+
* acquired SqlClient. Memory evaluates the callback synchronously inside its atomic mutation;
|
|
1304
|
+
* an async callback fails with `unavailable/synchronous-memory-policy-required`. Remote reads do not fence remote changes.
|
|
1305
|
+
* All policy writers must use that transaction owner. Do not fork, reenter admission, or retain
|
|
1306
|
+
* transaction resources. Failure/defect/interruption commits no fresh admission.
|
|
1307
|
+
* Current policy never invalidates an exact retained receipt. A supplied fence fails closed
|
|
1308
|
+
* unless the destination installed an interpreter for it. */
|
|
1309
|
+
declare const SubmissionAdmissionFence: Context.Reference<{
|
|
1310
|
+
readonly check: (request: AdmissionRequest) => Effect.Effect<void, AdmissionPolicyError>;
|
|
1311
|
+
}>;
|
|
1312
|
+
declare namespace Recovery_d_exports {
|
|
1313
|
+
export { AppendReservedSettlement, ApplyInput, ApplyJoinAccounting, ApplyUnknownResolutions, AwaitApprovalDecision, AwaitChildAdmissionResolution, AwaitChildSettlement, AwaitHostSettlement, AwaitParentEstablishment, AwaitUnknownResolution, CompleteChildAdmission, CompleteMaterialization, DeclaredPendingBatchEvidence, DelegationAdmissionEvidence, EnsureWaitingForChild, FinalizeLedgerFromHistory, MarkUnknown, NoAction, OpenDelegationCallEvidence, OpenToolCallEvidence, PendingApprovalEvidence, PropagateChildAbort, RecoveryDecision, RecoveryEvidence, ReleaseOrphanChildReservation, RepairInputMarker, RepairJoinMarker, RepairReadiness, RepairSubagentStartLink, ResumeFromTurnBoundary, ResumePendingToolBatch, ResumeSuspended, ResumeWaitingParent, RevertJoining, SettleAborted, SettleJoinedWithHost, classifyRecovery };
|
|
1314
|
+
}
|
|
1315
|
+
declare const OpenToolCallEvidence_base: Schema.Class<OpenToolCallEvidence, Schema.Struct<{
|
|
1316
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1317
|
+
readonly toolName: Schema.NonEmptyString;
|
|
1318
|
+
readonly turn: Schema.Int;
|
|
1319
|
+
}>, {}>;
|
|
1320
|
+
/** One canonical `ToolCallPrepared` without a settling or resolving canonical record (DUR-009). */
|
|
1321
|
+
declare class OpenToolCallEvidence extends OpenToolCallEvidence_base {}
|
|
1322
|
+
declare const DeclaredPendingBatchEvidence_base: Schema.Class<DeclaredPendingBatchEvidence, Schema.Struct<{
|
|
1323
|
+
readonly turn: Schema.Int;
|
|
1324
|
+
readonly callCount: Schema.Int;
|
|
1325
|
+
}>, {}>;
|
|
1326
|
+
/**
|
|
1327
|
+
* A committed tool-declaring response with ZERO prepared and ZERO settled records for its Turn:
|
|
1328
|
+
* the durability §15 batch-resume window. Mutation preparation has not committed; readonly
|
|
1329
|
+
* handlers may already have run. The worker checks each unfinished operation before execution.
|
|
1330
|
+
*/
|
|
1331
|
+
declare class DeclaredPendingBatchEvidence extends DeclaredPendingBatchEvidence_base {}
|
|
1332
|
+
declare const PendingApprovalEvidence_base: Schema.Class<PendingApprovalEvidence, Schema.Struct<{
|
|
1333
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1334
|
+
readonly turn: Schema.Int;
|
|
1335
|
+
}>, {}>;
|
|
1336
|
+
/** One canonical `ToolApprovalRequested` without a canonical `ToolApprovalDecided`. */
|
|
1337
|
+
declare class PendingApprovalEvidence extends PendingApprovalEvidence_base {}
|
|
1338
|
+
/**
|
|
1339
|
+
* The authoritative tri-state admission answer recorded as pure classifier evidence (SUB-031):
|
|
1340
|
+
* the recovery pass queries `resolveAdmission` with the deterministic child idempotency key for
|
|
1341
|
+
* a requested-but-unstarted delegation call and records the result here. Absence of this field
|
|
1342
|
+
* means the lookup was not performed — the classifier treats that exactly like `indeterminate`
|
|
1343
|
+
* (fail-closed: only a proven `not-admitted` ever permits an admission attempt).
|
|
1344
|
+
*/
|
|
1345
|
+
declare const DelegationAdmissionEvidence: Schema.Literals<readonly ["not-admitted", "admitted", "indeterminate"]>;
|
|
1346
|
+
type DelegationAdmissionEvidence = typeof DelegationAdmissionEvidence.Type;
|
|
1347
|
+
declare const OpenDelegationCallEvidence_base: Schema.Class<OpenDelegationCallEvidence, Schema.Struct<{
|
|
1348
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1349
|
+
readonly toolName: Schema.NonEmptyString;
|
|
1350
|
+
readonly turn: Schema.Int;
|
|
1351
|
+
/** The canonical `SubagentRequested` record exists for this call. */
|
|
1352
|
+
readonly requested: Schema.Boolean;
|
|
1353
|
+
/** The canonical `SubagentStarted` record exists for this call. */
|
|
1354
|
+
readonly started: Schema.Boolean;
|
|
1355
|
+
/** The canonical `SubagentJoined` record exists for this call. */
|
|
1356
|
+
readonly joined: Schema.Boolean;
|
|
1357
|
+
readonly childThreadId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">>;
|
|
1358
|
+
readonly childSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
1359
|
+
readonly admission: Schema.optionalKey<Schema.Literals<readonly ["not-admitted", "admitted", "indeterminate"]>>;
|
|
1360
|
+
}>, {}>;
|
|
1361
|
+
/**
|
|
1362
|
+
* One prepared-without-outcome parent Tool Call that IS a delegation (plan §4.1), separated from
|
|
1363
|
+
* `openToolCalls` because its establishment protocol is idempotent by construction and must
|
|
1364
|
+
* NEVER be marked Unknown (spec §13 vs. DUR-009). Delegation detection is durable and
|
|
1365
|
+
* fail-closed: canonical preparation records carry the definition-owned execution kind;
|
|
1366
|
+
* child reservations and request records must agree with that classification. Names never
|
|
1367
|
+
* authorize replay, including in the pre-reservation window. The
|
|
1368
|
+
* `requested`/`started`/`joined` flags come from the parent-log canonical records; the child
|
|
1369
|
+
* identity fields are present exactly when those records (or the reservation attachment) carry
|
|
1370
|
+
* them.
|
|
1371
|
+
*/
|
|
1372
|
+
declare class OpenDelegationCallEvidence extends OpenDelegationCallEvidence_base {}
|
|
1373
|
+
declare const RecoveryEvidence_base: Schema.Class<RecoveryEvidence, Schema.Struct<{
|
|
1374
|
+
/** The Thread exists in the ThreadStore. */
|
|
1375
|
+
readonly threadMaterialized: Schema.Boolean;
|
|
1376
|
+
/** The deterministic canonical `UserInputRecorded` record (`input:{sid}`) is committed. */
|
|
1377
|
+
readonly inputRecorded: Schema.Boolean;
|
|
1378
|
+
/**
|
|
1379
|
+
* The committed canonical `SubmissionSettled` outcome (`settlement:{sid}`). Present exactly
|
|
1380
|
+
* when the canonical settlement record exists, so the flag and the outcome cannot diverge.
|
|
1381
|
+
*/
|
|
1382
|
+
readonly recordedSettlementOutcome: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "aborted"]>>;
|
|
1383
|
+
/** The deterministic canonical `AbortRequested` record (`abort:{sid}`) is committed. */
|
|
1384
|
+
readonly abortRecorded: Schema.Boolean;
|
|
1385
|
+
/** Prepared ordinary Tool Calls without a canonical settled/resolved outcome (DUR-009). */
|
|
1386
|
+
readonly openToolCalls: Schema.$Array<typeof OpenToolCallEvidence>;
|
|
1387
|
+
/**
|
|
1388
|
+
* Delegation Tool Calls with an open parent-side obligation (plan §4.1), removed from
|
|
1389
|
+
* `openToolCalls`. Wire-required; construction alone defaults it so pre-S2 evidence
|
|
1390
|
+
* assemblers stay valid while the classifier's fail-closed detection still protects them.
|
|
1391
|
+
*/
|
|
1392
|
+
readonly openDelegationCalls: Schema.withConstructorDefault<Schema.$Array<typeof OpenDelegationCallEvidence>>;
|
|
1393
|
+
/** Only persisted orchestration classification authorizes idempotent host-operation replay. */
|
|
1394
|
+
readonly openWorkerCalls: Schema.optionalKey<Schema.$Array<typeof OpenToolCallEvidence>>;
|
|
1395
|
+
/** A declared-but-unprepared tool batch: response canonical, zero prepared, zero settled. */
|
|
1396
|
+
readonly declaredPendingBatch: Schema.optionalKey<typeof DeclaredPendingBatchEvidence>;
|
|
1397
|
+
/** Canonically requested approvals without a canonical decision. */
|
|
1398
|
+
readonly approvalsPending: Schema.$Array<typeof PendingApprovalEvidence>;
|
|
1399
|
+
/** Joined-side prompt coverage (plan §2.5); `true` whenever the Submission is not joined. */
|
|
1400
|
+
readonly joinedInputCovered: Schema.Boolean;
|
|
1401
|
+
/** Joined-side view of the host's canonical settlement record, when it exists. */
|
|
1402
|
+
readonly hostSettlementOutcome: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "aborted"]>>;
|
|
1403
|
+
/**
|
|
1404
|
+
* The Thread carries its canonical `SubagentLineageRecorded` record. Only
|
|
1405
|
+
* consulted for a parent-linked Submission: a child whose lineage is not yet canonical defers
|
|
1406
|
+
* its own materialization/readiness repair to the parent's idempotent establishment
|
|
1407
|
+
* (`AwaitParentEstablishment`). Defaults to `false` so an assembler that does not compute it
|
|
1408
|
+
* stays fail-closed: deferring is safe because the parent's establishment completes the child;
|
|
1409
|
+
* running a Turn before lineage is recorded would violate the child establishment ordering.
|
|
1410
|
+
*/
|
|
1411
|
+
readonly subagentLineageRecorded: Schema.withConstructorDefault<Schema.Boolean>;
|
|
1412
|
+
}>, {}>;
|
|
1413
|
+
/**
|
|
1414
|
+
* Canonical-log facts about one Submission, read strongly consistently alongside the ledger
|
|
1415
|
+
* `RecoverySnapshot` (STORE-003). Canonical history wins over every ledger marker (DUR-015), so
|
|
1416
|
+
* the classifier consults these facts before trusting ledger state — with one deliberate Phase 5
|
|
1417
|
+
* inversion: a RECORDED terminal outcome now beats open tool calls, because a canonical
|
|
1418
|
+
* settlement is never revisited (DUR-002/DUR-015); the P4 rule that unknown-beats-settlement is
|
|
1419
|
+
* gone.
|
|
1420
|
+
*
|
|
1421
|
+
* `openToolCalls` is the DUR-009 seam: every `ToolCallPrepared` without a matching
|
|
1422
|
+
* `ToolCallSettled` or `ToolCallResolved`. S2 separates `openDelegationCalls` from it (plan
|
|
1423
|
+
* §4.1): a delegation's prepared-without-outcome state is provably replay-safe, so those calls
|
|
1424
|
+
* route through the Subagent recovery rows and never through `MarkUnknown`. Names and
|
|
1425
|
+
* operational reservation rows cannot upgrade ordinary classification. `joinedInputCovered`
|
|
1426
|
+
* implements the plan §2.5 prompt-coverage rule for the joined side: a joined input is covered
|
|
1427
|
+
* iff a later `ModelResponseRecorded` of the host Run exists after the `input:{sid}` record.
|
|
1428
|
+
* `hostSettlementOutcome` is the joined-side view of the host's canonical `SubmissionSettled`
|
|
1429
|
+
* record, present exactly when that record exists.
|
|
1430
|
+
*/
|
|
1431
|
+
declare class RecoveryEvidence extends RecoveryEvidence_base {}
|
|
1432
|
+
declare const CompleteMaterialization_base: Schema.Class<CompleteMaterialization, Schema.TaggedStruct<"CompleteMaterialization", {
|
|
1433
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1434
|
+
}>, {}>;
|
|
1435
|
+
/** Ledger admission committed but the Thread is not durable: finish materialization,
|
|
1436
|
+
* append `ThreadCreated`, and mark readiness (crash between admit and materialize). */
|
|
1437
|
+
declare class CompleteMaterialization extends CompleteMaterialization_base {}
|
|
1438
|
+
declare const RepairReadiness_base: Schema.Class<RepairReadiness, Schema.TaggedStruct<"RepairReadiness", {
|
|
1439
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1440
|
+
}>, {}>;
|
|
1441
|
+
/** Thread durable but the readiness marker is missing: idempotent `markReady`. */
|
|
1442
|
+
declare class RepairReadiness extends RepairReadiness_base {}
|
|
1443
|
+
declare const ApplyInput_base: Schema.Class<ApplyInput, Schema.TaggedStruct<"ApplyInput", {
|
|
1444
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1445
|
+
}>, {}>;
|
|
1446
|
+
/** No canonical input yet: append the deterministic `UserInputRecorded` record and mark it. */
|
|
1447
|
+
declare class ApplyInput extends ApplyInput_base {}
|
|
1448
|
+
declare const RepairInputMarker_base: Schema.Class<RepairInputMarker, Schema.TaggedStruct<"RepairInputMarker", {
|
|
1449
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1450
|
+
}>, {}>;
|
|
1451
|
+
/** Canonical input exists but the ledger marker was lost: repair the marker only (DUR-015). */
|
|
1452
|
+
declare class RepairInputMarker extends RepairInputMarker_base {}
|
|
1453
|
+
declare const ResumeFromTurnBoundary_base: Schema.Class<ResumeFromTurnBoundary, Schema.TaggedStruct<"ResumeFromTurnBoundary", {
|
|
1454
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1455
|
+
}>, {}>;
|
|
1456
|
+
/** Input applied and no terminal work reserved: a worker resumes the Run from the last committed
|
|
1457
|
+
* Turn boundary (D6; the model may be re-invoked, duplicate cost is observable — the resuming
|
|
1458
|
+
* worker appends `ModelResponseInterrupted` when superseding a prior owner, durability §9). */
|
|
1459
|
+
declare class ResumeFromTurnBoundary extends ResumeFromTurnBoundary_base {}
|
|
1460
|
+
declare const AppendReservedSettlement_base: Schema.Class<AppendReservedSettlement, Schema.TaggedStruct<"AppendReservedSettlement", {
|
|
1461
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1462
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
1463
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
1464
|
+
}>, {}>;
|
|
1465
|
+
/** A settlement is reserved but not canonical: append the EXACT reserved record, then finalize. */
|
|
1466
|
+
declare class AppendReservedSettlement extends AppendReservedSettlement_base {}
|
|
1467
|
+
declare const FinalizeLedgerFromHistory_base: Schema.Class<FinalizeLedgerFromHistory, Schema.TaggedStruct<"FinalizeLedgerFromHistory", {
|
|
1468
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1469
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
1470
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
1471
|
+
}>, {}>;
|
|
1472
|
+
/** The canonical settlement record exists: rebuild/finalize the ledger from history and never
|
|
1473
|
+
* rewrite history from the cached ledger status (DUR-011, DUR-015). */
|
|
1474
|
+
declare class FinalizeLedgerFromHistory extends FinalizeLedgerFromHistory_base {}
|
|
1475
|
+
declare const SettleAborted_base: Schema.Class<SettleAborted, Schema.TaggedStruct<"SettleAborted", {
|
|
1476
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1477
|
+
}>, {}>;
|
|
1478
|
+
/** A durable abort intent exists, no terminal outcome is reserved, and no attached-child
|
|
1479
|
+
* obligation remains open: settle aborted (DUR-012). The executor first appends
|
|
1480
|
+
* `ToolCallUnknown` audit records for any open ordinary calls — abort settles the obligation but
|
|
1481
|
+
* never asserts external rollback (durability §13). */
|
|
1482
|
+
declare class SettleAborted extends SettleAborted_base {}
|
|
1483
|
+
declare const MarkUnknown_base: Schema.Class<MarkUnknown, Schema.TaggedStruct<"MarkUnknown", {
|
|
1484
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1485
|
+
readonly reason: Schema.String;
|
|
1486
|
+
readonly openToolCallIds: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
1487
|
+
}>, {}>;
|
|
1488
|
+
/** Prepared ordinary Tool Calls have no canonical outcome: the executor reconciles each open
|
|
1489
|
+
* call (recovered result / never-started / safe-retry) and marks the remainder Unknown — never
|
|
1490
|
+
* an automatic replay (DUR-009/DUR-017). Delegation calls are excluded: their establishment is
|
|
1491
|
+
* idempotent by construction and routes through the Subagent rows instead (plan §4.3). */
|
|
1492
|
+
declare class MarkUnknown extends MarkUnknown_base {}
|
|
1493
|
+
declare const ResumePendingToolBatch_base: Schema.Class<ResumePendingToolBatch, Schema.TaggedStruct<"ResumePendingToolBatch", {
|
|
1494
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1495
|
+
readonly turn: Schema.Int;
|
|
1496
|
+
}>, {}>;
|
|
1497
|
+
/** A committed tool-declaring response has zero prepared and zero settled records: a worker
|
|
1498
|
+
* checks unfinished contracts and resumes the declared batch without model re-invocation. S2 also
|
|
1499
|
+
* routes an open delegation call WITHOUT establishment evidence here (spec §13 row 1): the
|
|
1500
|
+
* declared batch re-executes and the idempotent establishment converges on one child. */
|
|
1501
|
+
declare class ResumePendingToolBatch extends ResumePendingToolBatch_base {}
|
|
1502
|
+
declare const AwaitApprovalDecision_base: Schema.Class<AwaitApprovalDecision, Schema.TaggedStruct<"AwaitApprovalDecision", {
|
|
1503
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1504
|
+
}>, {}>;
|
|
1505
|
+
/** Canonically requested approvals lack decisions: the lane waits durably (the executor repairs
|
|
1506
|
+
* the ledger suspension from history when the suspend transition itself was lost). */
|
|
1507
|
+
declare class AwaitApprovalDecision extends AwaitApprovalDecision_base {}
|
|
1508
|
+
declare const ResumeSuspended_base: Schema.Class<ResumeSuspended, Schema.TaggedStruct<"ResumeSuspended", {
|
|
1509
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1510
|
+
}>, {}>;
|
|
1511
|
+
/** Every pending approval has a durable decision: a worker resumes the declared batch via the
|
|
1512
|
+
* batch-resume seam, appending the canonical `ToolApprovalDecided` records first. */
|
|
1513
|
+
declare class ResumeSuspended extends ResumeSuspended_base {}
|
|
1514
|
+
declare const AwaitUnknownResolution_base: Schema.Class<AwaitUnknownResolution, Schema.TaggedStruct<"AwaitUnknownResolution", {
|
|
1515
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1516
|
+
}>, {}>;
|
|
1517
|
+
/** Unknown Outcomes lack covering resolutions: this Submission stays parked awaiting the authorized
|
|
1518
|
+
* DUR-017 resolution path; the obligation stays visible, nothing replays. */
|
|
1519
|
+
declare class AwaitUnknownResolution extends AwaitUnknownResolution_base {}
|
|
1520
|
+
declare const ApplyUnknownResolutions_base: Schema.Class<ApplyUnknownResolutions, Schema.TaggedStruct<"ApplyUnknownResolutions", {
|
|
1521
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1522
|
+
}>, {}>;
|
|
1523
|
+
/** Durable resolution intents cover every open call: wake the original Submission when its
|
|
1524
|
+
* required retry contract is supported. Canonical outcomes are applied by the next claim. */
|
|
1525
|
+
declare class ApplyUnknownResolutions extends ApplyUnknownResolutions_base {}
|
|
1526
|
+
declare const RevertJoining_base: Schema.Class<RevertJoining, Schema.TaggedStruct<"RevertJoining", {
|
|
1527
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1528
|
+
}>, {}>;
|
|
1529
|
+
/** `joining` without a canonical `input:{sid}` record: revert to `ready` — the input was never
|
|
1530
|
+
* consumed and will be delivered exactly once later (DUR-016). */
|
|
1531
|
+
declare class RevertJoining extends RevertJoining_base {}
|
|
1532
|
+
declare const RepairJoinMarker_base: Schema.Class<RepairJoinMarker, Schema.TaggedStruct<"RepairJoinMarker", {
|
|
1533
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1534
|
+
}>, {}>;
|
|
1535
|
+
/** The canonical input exists but the `joined` marker was lost: repair the marker only, exactly
|
|
1536
|
+
* like `RepairInputMarker` (DUR-015/DUR-016); the input reattaches, never duplicates. */
|
|
1537
|
+
declare class RepairJoinMarker extends RepairJoinMarker_base {}
|
|
1538
|
+
declare const SettleJoinedWithHost_base: Schema.Class<SettleJoinedWithHost, Schema.TaggedStruct<"SettleJoinedWithHost", {
|
|
1539
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1540
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
1541
|
+
}>, {}>;
|
|
1542
|
+
/** The host Run settled canonically: settle this joined Submission with the host outcome
|
|
1543
|
+
* (each joined Submission is owed its own settlement, DUR-002). */
|
|
1544
|
+
declare class SettleJoinedWithHost extends SettleJoinedWithHost_base {}
|
|
1545
|
+
declare const AwaitHostSettlement_base: Schema.Class<AwaitHostSettlement, Schema.TaggedStruct<"AwaitHostSettlement", {
|
|
1546
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1547
|
+
readonly hostSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
1548
|
+
}>, {}>;
|
|
1549
|
+
/** The Submission is `joined` and its host Run is still live: nothing to repair — the input
|
|
1550
|
+
* reattaches through the host's resume and the Submission settles with the host. */
|
|
1551
|
+
declare class AwaitHostSettlement extends AwaitHostSettlement_base {}
|
|
1552
|
+
declare const CompleteChildAdmission_base: Schema.Class<CompleteChildAdmission, Schema.TaggedStruct<"CompleteChildAdmission", {
|
|
1553
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1554
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1555
|
+
}>, {}>;
|
|
1556
|
+
/** A canonical `SubagentRequested` exists and the authoritative admission lookup proved
|
|
1557
|
+
* `notAdmitted`: idempotently admit the intended child from the canonical request payload — it
|
|
1558
|
+
* carries the encoded child input (D3), the intended child identity, and every digest — then
|
|
1559
|
+
* materialize the child Thread, append its immutable lineage, and mark it ready. No live
|
|
1560
|
+
* delegation handler is required (spec §13, SUB-016/SUB-031). */
|
|
1561
|
+
declare class CompleteChildAdmission extends CompleteChildAdmission_base {}
|
|
1562
|
+
declare const AwaitChildAdmissionResolution_base: Schema.Class<AwaitChildAdmissionResolution, Schema.TaggedStruct<"AwaitChildAdmissionResolution", {
|
|
1563
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1564
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1565
|
+
}>, {}>;
|
|
1566
|
+
/** A canonical `SubagentRequested` exists but the authoritative admission lookup answered
|
|
1567
|
+
* `indeterminate` — or was not (yet) performed: wait and retry the authoritative owner directly.
|
|
1568
|
+
* Absence from a projection is never proof of absence and a second admission NEVER occurs
|
|
1569
|
+
* (spec §12, SUB-031). */
|
|
1570
|
+
declare class AwaitChildAdmissionResolution extends AwaitChildAdmissionResolution_base {}
|
|
1571
|
+
declare const RepairSubagentStartLink_base: Schema.Class<RepairSubagentStartLink, Schema.TaggedStruct<"RepairSubagentStartLink", {
|
|
1572
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1573
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1574
|
+
}>, {}>;
|
|
1575
|
+
/** The child Submission is admitted but the parent's `SubagentStarted` link is missing (or its
|
|
1576
|
+
* reservation attachment was lost): resolve the SAME child by its deterministic idempotency key
|
|
1577
|
+
* and append the exact deterministic start record, then attach the child to its reservation —
|
|
1578
|
+
* the same Receipt on every replay (spec §13, SUB-016/SUB-017). */
|
|
1579
|
+
declare class RepairSubagentStartLink extends RepairSubagentStartLink_base {}
|
|
1580
|
+
declare const EnsureWaitingForChild_base: Schema.Class<EnsureWaitingForChild, Schema.TaggedStruct<"EnsureWaitingForChild", {
|
|
1581
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1582
|
+
readonly children: Schema.NonEmptyArray<typeof WaitingChild>;
|
|
1583
|
+
}>, {}>;
|
|
1584
|
+
/** Children are established and at least one is nonterminal while the parent lane is NOT
|
|
1585
|
+
* durably suspended: restore the `waitingForChild` suspension so the lane holds no worker
|
|
1586
|
+
* permit while each child runs on its own lane. Recovery reattaches the one existing child and
|
|
1587
|
+
* NEVER spawns a replacement (spec §13, SUB-018/SUB-030). */
|
|
1588
|
+
declare class EnsureWaitingForChild extends EnsureWaitingForChild_base {}
|
|
1589
|
+
declare const AwaitChildSettlement_base: Schema.Class<AwaitChildSettlement, Schema.TaggedStruct<"AwaitChildSettlement", {
|
|
1590
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1591
|
+
}>, {}>;
|
|
1592
|
+
/** The parent is durably suspended `WaitingForChild` and at least one listed child is not yet
|
|
1593
|
+
* provably settled: the lane stays dormant and consumes no permit; the child's Settlement wakes
|
|
1594
|
+
* it durably (spec §12 step 10). An unresolved ordinary Tool inside a child keeps the parent
|
|
1595
|
+
* here honestly — the obligation stays visible and aged, nothing is fabricated (SUB-021). */
|
|
1596
|
+
declare class AwaitChildSettlement extends AwaitChildSettlement_base {}
|
|
1597
|
+
declare const ResumeWaitingParent_base: Schema.Class<ResumeWaitingParent, Schema.TaggedStruct<"ResumeWaitingParent", {
|
|
1598
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1599
|
+
readonly children: Schema.NonEmptyArray<typeof WaitingChild>;
|
|
1600
|
+
}>, {}>;
|
|
1601
|
+
/** Every relevant child is provably settled but the parent has not joined (legacy data, or a
|
|
1602
|
+
* canonical settlement whose idempotent wake still needs replay): record/replay the durable wake
|
|
1603
|
+
* so a claiming worker resumes the declared batch and joins each child's canonical Settlement —
|
|
1604
|
+
* the join itself needs the parent Binding and is deferred to that worker (spec §13). */
|
|
1605
|
+
declare class ResumeWaitingParent extends ResumeWaitingParent_base {}
|
|
1606
|
+
declare const ApplyJoinAccounting_base: Schema.Class<ApplyJoinAccounting, Schema.TaggedStruct<"ApplyJoinAccounting", {
|
|
1607
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1608
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1609
|
+
readonly reservationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">;
|
|
1610
|
+
}>, {}>;
|
|
1611
|
+
/** The canonical `SubagentJoined` record exists but the reservation release is incomplete:
|
|
1612
|
+
* replay `beginChildBudgetRelease` with the accounting decision FROM the canonical record, then
|
|
1613
|
+
* apply `releaseChildBudget` — budget stays unavailable until repair, never available twice
|
|
1614
|
+
* (spec §12 join step 6, DUR-015). */
|
|
1615
|
+
declare class ApplyJoinAccounting extends ApplyJoinAccounting_base {}
|
|
1616
|
+
declare const PropagateChildAbort_base: Schema.Class<PropagateChildAbort, Schema.TaggedStruct<"PropagateChildAbort", {
|
|
1617
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1618
|
+
readonly children: Schema.NonEmptyArray<typeof WaitingChild>;
|
|
1619
|
+
}>, {}>;
|
|
1620
|
+
/** Parent abort is canonical while attached children are nonterminal: idempotently issue each
|
|
1621
|
+
* child's durable abort command and keep the parent waiting for the joins —
|
|
1622
|
+
* request-abort-and-join is the ONLY close behavior; the replayed command returns the recorded
|
|
1623
|
+
* child intent unchanged, so the intent row IS the propagation marker (spec §13.1, SUB-022,
|
|
1624
|
+
* DUR-012). */
|
|
1625
|
+
declare class PropagateChildAbort extends PropagateChildAbort_base {}
|
|
1626
|
+
declare const ReleaseOrphanChildReservation_base: Schema.Class<ReleaseOrphanChildReservation, Schema.TaggedStruct<"ReleaseOrphanChildReservation", {
|
|
1627
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1628
|
+
readonly reservationIds: Schema.NonEmptyArray<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ChildReservationId">>;
|
|
1629
|
+
}>, {}>;
|
|
1630
|
+
/** A child budget reservation can no longer bind a child — its request is absent with no
|
|
1631
|
+
* resumable batch, or the parent is aborting and the child provably never admitted: freeze the
|
|
1632
|
+
* deterministic zero-consumed accounting decision and release the unused allocation exactly
|
|
1633
|
+
* once (spec §13/§14: "releases the reservation exactly once"). */
|
|
1634
|
+
declare class ReleaseOrphanChildReservation extends ReleaseOrphanChildReservation_base {}
|
|
1635
|
+
declare const AwaitParentEstablishment_base: Schema.Class<AwaitParentEstablishment, Schema.TaggedStruct<"AwaitParentEstablishment", {
|
|
1636
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1637
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1638
|
+
readonly parentToolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1639
|
+
}>, {}>;
|
|
1640
|
+
/**
|
|
1641
|
+
* A parent-linked `admitted` Submission whose Thread lacks the canonical
|
|
1642
|
+
* `SubagentLineageRecorded` record: the child lane DEFERS its own materialization/readiness
|
|
1643
|
+
* repair — the parent's idempotent establishment (admit → materialize → lineage → ready)
|
|
1644
|
+
* completes it, so a child never runs a Turn before its lineage record is canonical.
|
|
1645
|
+
* This preserves the child establishment ordering. It is ordering/liveness hygiene, not a
|
|
1646
|
+
* safety repair — the join already fails closed without lineage (SUB-019).
|
|
1647
|
+
*/
|
|
1648
|
+
declare class AwaitParentEstablishment extends AwaitParentEstablishment_base {}
|
|
1649
|
+
declare const NoAction_base: Schema.Class<NoAction, Schema.TaggedStruct<"NoAction", {
|
|
1650
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1651
|
+
}>, {}>;
|
|
1652
|
+
/** The Submission is settled; nothing is owed. */
|
|
1653
|
+
declare class NoAction extends NoAction_base {}
|
|
1654
|
+
/** The executable recovery decision table's output alphabet (plan §Recovery classifier). */
|
|
1655
|
+
declare const RecoveryDecision: Schema.Union<readonly [typeof CompleteMaterialization, typeof RepairReadiness, typeof ApplyInput, typeof RepairInputMarker, typeof ResumeFromTurnBoundary, typeof AppendReservedSettlement, typeof FinalizeLedgerFromHistory, typeof SettleAborted, typeof MarkUnknown, typeof ResumePendingToolBatch, typeof AwaitApprovalDecision, typeof ResumeSuspended, typeof AwaitUnknownResolution, typeof ApplyUnknownResolutions, typeof RevertJoining, typeof RepairJoinMarker, typeof SettleJoinedWithHost, typeof AwaitHostSettlement, typeof CompleteChildAdmission, typeof AwaitChildAdmissionResolution, typeof RepairSubagentStartLink, typeof EnsureWaitingForChild, typeof AwaitChildSettlement, typeof ResumeWaitingParent, typeof ApplyJoinAccounting, typeof PropagateChildAbort, typeof ReleaseOrphanChildReservation, typeof AwaitParentEstablishment, typeof NoAction]>;
|
|
1656
|
+
type RecoveryDecision = typeof RecoveryDecision.Type;
|
|
1657
|
+
/**
|
|
1658
|
+
* Pure recovery classifier (durability §14, DUR-013): a finite persisted snapshot plus canonical
|
|
1659
|
+
* evidence deterministically selects exactly one decision. Precedence, most-settled first
|
|
1660
|
+
* (plan §4.2/§4.3 — note the deliberate P5 reorder: canonical settlement and reservation beat
|
|
1661
|
+
* open tool calls, because a recorded terminal outcome is never revisited, DUR-002/DUR-015; and
|
|
1662
|
+
* the three S2 edits: the abort row propagates to nonterminal attached children, delegation
|
|
1663
|
+
* calls never mark Unknown, and the suspended row branches on the suspension reason):
|
|
1664
|
+
*
|
|
1665
|
+
* 1. `settled` → NoAction — terminal outcomes are never revisited (DUR-002).
|
|
1666
|
+
* 2. canonical settlement record → FinalizeLedgerFromHistory — history beats every ledger
|
|
1667
|
+
* marker (DUR-015), including a missing or divergent reservation AND open tool calls.
|
|
1668
|
+
* 3. reservation → FinalizeLedgerFromHistory when finalized, else AppendReservedSettlement —
|
|
1669
|
+
* the reserved record is the single exact outcome owed (DUR-011); it also beats a pending
|
|
1670
|
+
* abort intent (DUR-012).
|
|
1671
|
+
* 4. joined-side states (DUR-016): `joining` without canonical input → RevertJoining; `joining`
|
|
1672
|
+
* with canonical input → RepairJoinMarker (marker lost); `joined` + host settled →
|
|
1673
|
+
* SettleJoinedWithHost; `joined` + host live → AwaitHostSettlement (deferred).
|
|
1674
|
+
* 5. abort intent → the S2 abort rows (spec §13.1 request-abort-and-join): an unproven child
|
|
1675
|
+
* admission waits, an admitted-but-unlinked child repairs its start link, a nonterminal
|
|
1676
|
+
* attached child gets PropagateChildAbort — the parent does NOT settle — terminal children
|
|
1677
|
+
* are joined, incomplete releases applied, provably childless reservations released; ONLY a
|
|
1678
|
+
* parent with no open child obligation reaches SettleAborted, where open ordinary calls
|
|
1679
|
+
* become `ToolCallUnknown` audit records, never a rollback claim (§13). SettleAborted is
|
|
1680
|
+
* position-blind by design (P7 §7(c)): an aborted, never-claimed `ready` Submission earns it
|
|
1681
|
+
* ANYWHERE in the queue — the executor settles it immediately without waiting for it to head
|
|
1682
|
+
* the lane, because settlement order of never-run work is not execution order (DUR-004
|
|
1683
|
+
* bounds execution order; DUR-012 permits settling inactive accepted work without an
|
|
1684
|
+
* Attempt).
|
|
1685
|
+
* 6. ordinary open tool calls (state not yet `unknown`) → MarkUnknown — reconcile-then-mark,
|
|
1686
|
+
* never an automatic replay (DUR-009). Delegation calls are EXCLUDED (plan §4.3's most
|
|
1687
|
+
* important edit): their prepared-without-outcome state is provably replay-safe and routes
|
|
1688
|
+
* through rows 5/8/9 instead. A lane already `unknown` is in the DUR-017 resolution regime
|
|
1689
|
+
* (row 7) and is not re-marked.
|
|
1690
|
+
* 7. state `unknown` → ApplyUnknownResolutions when durable intents cover every open ordinary
|
|
1691
|
+
* call, else AwaitUnknownResolution.
|
|
1692
|
+
* 8. state `suspended` branches on the stored reason: `WaitingForChild` → ResumeWaitingParent
|
|
1693
|
+
* when every listed child is provably settled (replay the idempotent wake), else
|
|
1694
|
+
* AwaitChildSettlement (SUB-030); `ApprovalPending` keeps the P5 behavior — undecided
|
|
1695
|
+
* canonical approval requests → AwaitApprovalDecision (repairing a lost suspend transition
|
|
1696
|
+
* from history), every request decided → ResumeSuspended.
|
|
1697
|
+
* 9. the S2 establishment/join rows for a live parent (spec §13, most-repairing first):
|
|
1698
|
+
* ApplyJoinAccounting → CompleteChildAdmission → RepairSubagentStartLink →
|
|
1699
|
+
* AwaitChildAdmissionResolution → ResumePendingToolBatch (idempotent handler re-entry) →
|
|
1700
|
+
* EnsureWaitingForChild → ResumeWaitingParent → ReleaseOrphanChildReservation.
|
|
1701
|
+
* 10. declared-but-unprepared tool batch → ResumePendingToolBatch — the worker checks original
|
|
1702
|
+
* operation contracts; missing preparation proves no mutation dispatch, not readonly nonexecution (§15).
|
|
1703
|
+
* 11. `admitted` → a parent-linked Submission whose Thread lacks the canonical lineage
|
|
1704
|
+
* record defers (AwaitParentEstablishment: the parent's idempotent establishment
|
|
1705
|
+
* completes it); otherwise
|
|
1706
|
+
* CompleteMaterialization / RepairReadiness by Thread durability.
|
|
1707
|
+
* 12. otherwise → ApplyInput / RepairInputMarker / ResumeFromTurnBoundary by canonical input
|
|
1708
|
+
* evidence, with the ledger marker repaired from history, never the reverse.
|
|
1709
|
+
*
|
|
1710
|
+
* A CHILD Submission (one whose snapshot carries `parentLinkage`) classifies through exactly
|
|
1711
|
+
* the same rows as any Submission — child recovery proceeds under its own ownership token and
|
|
1712
|
+
* epoch (spec §13, SUB-020); nothing here consults the parent's lane.
|
|
1713
|
+
*
|
|
1714
|
+
* Ownership leases are deliberately ignored here: the executor's fenced claim is the only
|
|
1715
|
+
* authority over liveness, and a stale Attempt is fenced by producer epoch regardless (DUR-006).
|
|
1716
|
+
*/
|
|
1717
|
+
declare const classifyRecovery: (snapshot: RecoverySnapshot, evidence: RecoveryEvidence) => RecoveryDecision;
|
|
1718
|
+
declare namespace Digest_d_exports {
|
|
1719
|
+
export { DigestError, EMPTY_TAIL_DIGEST, digestCanonicalBatch, digestDefinition, digestDefinitions, digestJson };
|
|
1720
|
+
}
|
|
1721
|
+
declare const DigestError_base: Schema.Class<DigestError, Schema.TaggedStruct<"DigestError", {
|
|
1722
|
+
readonly message: Schema.String;
|
|
1723
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
1724
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1725
|
+
declare class DigestError extends DigestError_base {}
|
|
1726
|
+
/** Digest a JSON value using a stable, locale-independent object-key ordering (UTF-16 code units, RFC 8785 style). */
|
|
1727
|
+
declare const digestJson: (value: Schema.Json) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">, DigestError, Crypto.Crypto>;
|
|
1728
|
+
/** Digest a canonical batch together with the prior tail to form an append-only hash chain. */
|
|
1729
|
+
declare const digestCanonicalBatch: (previousTailDigest: Digest, batch: CanonicalBatch) => Effect.Effect<Digest, DigestError, Crypto.Crypto>;
|
|
1730
|
+
/** Digest one schema-encoded Agent, Model, or Toolkit definition. */
|
|
1731
|
+
declare const digestDefinition: (definition: Schema.Json) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">, DigestError, Crypto.Crypto>;
|
|
1732
|
+
/** Digest all replay-relevant definitions without hiding which authority changed. */
|
|
1733
|
+
declare const digestDefinitions: (definitions: DefinitionDigestInput) => Effect.Effect<DefinitionDigests, DigestError, Crypto.Crypto>;
|
|
1734
|
+
declare const EMPTY_TAIL_DIGEST: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
1735
|
+
//#endregion
|
|
1736
|
+
//#region src/durable/internal/agent-registration.d.ts
|
|
1737
|
+
declare const BindingUnavailable_base: Schema.Class<BindingUnavailable, Schema.TaggedStruct<"BindingUnavailable", {
|
|
1738
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
1739
|
+
readonly message: Schema.String;
|
|
1740
|
+
}>, import("effect/Cause").YieldableError>;
|
|
1741
|
+
/** No unique current executable is registered for the stable Agent identity. */
|
|
1742
|
+
declare class BindingUnavailable extends BindingUnavailable_base {}
|
|
1743
|
+
type DurableBindingFailure = BindingUnavailable;
|
|
1744
|
+
/** Exact immutable admission, lineage and delivery evidence; never an executable-code gate. */
|
|
1745
|
+
declare const definitionDigestsEqual: (left: DefinitionDigests, right: DefinitionDigests) => boolean;
|
|
1746
|
+
/** Change an operation version when its meaning, durable Steps or idempotency keys change. */
|
|
1747
|
+
interface ReplayVersions {
|
|
1748
|
+
readonly tools: Readonly<Record<string, PersistedJson>>;
|
|
1749
|
+
}
|
|
1750
|
+
/** Compile current metadata without acquiring executable services. */
|
|
1751
|
+
declare const compileBindingContracts: (definition: Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined>, definitions: DefinitionDigestInput, versions?: ReplayVersions | undefined) => Effect.Effect<Pick<ResolvedBinding, "digests">, DigestError, Crypto.Crypto>;
|
|
1752
|
+
type ExecutableDefinition = AnyDefinition & {
|
|
1753
|
+
readonly instructions: InstructionSource<never, unknown, unknown>;
|
|
1754
|
+
readonly inputPrompt?: InputPromptSource<never, unknown, unknown> | undefined;
|
|
1755
|
+
};
|
|
1756
|
+
/** Executable model Binding accepted by durable registration descriptors. */
|
|
1757
|
+
type ExecutableAgentBinding = {
|
|
1758
|
+
readonly definition: ExecutableDefinition;
|
|
1759
|
+
readonly model: Layer.Layer<ModelServices, never, unknown>;
|
|
1760
|
+
};
|
|
1761
|
+
/**
|
|
1762
|
+
* Internal coordinator entry point for one fenced Attempt over an already-granted claim.
|
|
1763
|
+
* The generic signature matches `runAttempt` and is specialized for each captured Agent.
|
|
1764
|
+
*/
|
|
1765
|
+
type ResolvedAttemptDriver = <InputSchema extends Schema.Top, OutputSchema extends Schema.Top, Instructions, Tools extends Record<string, Tool.Any>, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue extends RunDispositionDeclaration<OutputSchema["Type"], Schema.Top> | undefined, InputPromptValue extends InputPromptSource<InputSchema["Type"], unknown, unknown> | undefined, UpdatesSchema extends Schema.Top | undefined>(agent: RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, threadId: ThreadId, claim: Claim) => Effect.Effect<Option.Option<Settlement>, DurableWorkerFailure, DurableWorkerRequirements<RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, InstructionRequirements>>;
|
|
1766
|
+
/**
|
|
1767
|
+
* An Agent with its worker services captured, ready to drive a fenced Attempt.
|
|
1768
|
+
* Concrete Schema and model types stay inside this closure when registrations are collected.
|
|
1769
|
+
*/
|
|
1770
|
+
interface CapturedBinding {
|
|
1771
|
+
readonly agentId: AgentId;
|
|
1772
|
+
/** Exact immutable definition whose codecs and behavior the worker captured. */
|
|
1773
|
+
readonly definition: AnyDefinition;
|
|
1774
|
+
/** Captured independently from per-Attempt services: report preparation has no fenced Claim. */
|
|
1775
|
+
readonly reporting?: ReadonlyArray<WorkerReporting<WorkerReportPreparationFailure>>;
|
|
1776
|
+
readonly attempt: (driver: ResolvedAttemptDriver, threadId: ThreadId, claim: Claim) => Effect.Effect<Option.Option<Settlement>, DurableWorkerFailure>;
|
|
1777
|
+
}
|
|
1778
|
+
/** One exact executable registration used by durable claim-time resolution. */
|
|
1779
|
+
interface ResolvedBinding extends CapturedBinding {
|
|
1780
|
+
readonly digests: DefinitionDigests;
|
|
1781
|
+
}
|
|
1782
|
+
/** Trusted claim identity for resolving per-Attempt application services. Not model input. */
|
|
1783
|
+
interface AgentAttemptContext {
|
|
1784
|
+
readonly threadId: ThreadId;
|
|
1785
|
+
readonly submissionId: Claim["submissionId"];
|
|
1786
|
+
readonly attemptId: Claim["attemptId"];
|
|
1787
|
+
}
|
|
1788
|
+
/**
|
|
1789
|
+
* Build one exact worker registration from an executable Agent Binding and
|
|
1790
|
+
* its already-computed definition digests.
|
|
1791
|
+
*
|
|
1792
|
+
* `make(agent, digests)` captures the binding plus its worker-requirement
|
|
1793
|
+
* Context at Layer/effect construction time. Hosts that start from application
|
|
1794
|
+
* version declarations should use `compileRegistrations`; low-level fixtures
|
|
1795
|
+
* may supply a previously computed digest triple directly.
|
|
1796
|
+
*/
|
|
1797
|
+
declare const DurableWorkerBinding: {
|
|
1798
|
+
readonly make: <A extends ExecutableAgentBinding>(agent: A, digests: DefinitionDigests) => Effect.Effect<ResolvedBinding, never, DurableWorkerRequirements<A>>;
|
|
1799
|
+
};
|
|
1800
|
+
/** Application versions and a model Layer, supplied directly or through an existing Binding. */
|
|
1801
|
+
type AgentRegistration<A extends ExecutableAgentBinding = ExecutableAgentBinding> = ({
|
|
1802
|
+
readonly agent: A;
|
|
1803
|
+
readonly model?: never;
|
|
1804
|
+
readonly definitions: DefinitionDigestInput;
|
|
1805
|
+
} | {
|
|
1806
|
+
readonly agent: A["definition"];
|
|
1807
|
+
readonly model: A["model"];
|
|
1808
|
+
readonly definitions: DefinitionDigestInput;
|
|
1809
|
+
}) & {
|
|
1810
|
+
/** Explicit operation versions let unchanged unfinished handlers survive toolbox changes. */
|
|
1811
|
+
readonly continuity?: {
|
|
1812
|
+
readonly versions: ReplayVersions;
|
|
1813
|
+
};
|
|
1814
|
+
/**
|
|
1815
|
+
* Build fresh services for exactly one fenced Attempt, across all its Tool/model turns.
|
|
1816
|
+
* Finalizes on completion, suspension, failure and interruption. Never reused after eviction.
|
|
1817
|
+
* Resolve invocation authority from the trusted claim identity, not captured caller state.
|
|
1818
|
+
* Keep fallible resource acquisition lazy in typed Tool operations; this Layer cannot fail.
|
|
1819
|
+
* Provide DurableApprovalSuspension here when resources need retention before approval waits.
|
|
1820
|
+
*/
|
|
1821
|
+
readonly attemptLayer?: (context: AgentAttemptContext) => Layer.Layer<never, never, unknown>;
|
|
1822
|
+
};
|
|
1823
|
+
type EntryWorkerRequirements<Entry> = Entry extends {
|
|
1824
|
+
readonly agent: infer A extends ExecutableAgentBinding;
|
|
1825
|
+
} ? DurableWorkerRequirements<A> : Entry extends {
|
|
1826
|
+
readonly agent: infer D extends ExecutableDefinition;
|
|
1827
|
+
readonly model: infer M extends ExecutableAgentBinding["model"];
|
|
1828
|
+
} ? DurableWorkerRequirements<{
|
|
1829
|
+
readonly definition: D;
|
|
1830
|
+
readonly model: M;
|
|
1831
|
+
}> : never;
|
|
1832
|
+
type AttemptLayerRequirements<Requirements, AttemptLayer> = AttemptLayer extends ((context: AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>) ? Exclude<Requirements, Provides> | Requires : Requirements;
|
|
1833
|
+
type EntryRequirements<Entry> = Entry extends unknown ? AttemptLayerRequirements<EntryWorkerRequirements<Entry>, "attemptLayer" extends keyof Entry ? Entry["attemptLayer"] : undefined> : never;
|
|
1834
|
+
type RegistrationRequirements<Entries extends ReadonlyArray<AgentRegistration>> = [Entries[number]] extends [never] ? never : EntryRequirements<Entries[number]>;
|
|
1835
|
+
/** Compile heterogeneous Agent descriptors into exact, dependency-closed worker registrations. */
|
|
1836
|
+
declare const compileRegistrations: <const Entries extends ReadonlyArray<AgentRegistration>>(entries: Entries) => Effect.Effect<ReadonlyArray<ResolvedBinding>, DigestError, Crypto.Crypto | RegistrationRequirements<Entries>>;
|
|
1837
|
+
declare namespace AgentRegistration_d_exports {
|
|
1838
|
+
export { AgentAttemptContext, AgentRegistration, BindingUnavailable, DurableBindingFailure, DurableWorkerBinding, ExecutableAgentBinding, ReplayVersions, ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
|
|
1839
|
+
}
|
|
1840
|
+
declare namespace Admin_d_exports {
|
|
1841
|
+
export { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityCheckName, IntegrityCheckStatus, IntegrityReport, ObligationBlockedOn, ObligationEntry, ObligationReport, ObligationSeverity, ObligationThresholds, RECOVERY_DECISION_MEANINGS, RecoveryDisposition, RecoveryExplanation, RetryCommand, RetryRefusalReason, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning, renderRecoveryExplanation };
|
|
1842
|
+
}
|
|
1843
|
+
/**
|
|
1844
|
+
* The disposition family of `RecoveryReport`, reused verbatim so an explanation predicts exactly
|
|
1845
|
+
* what `runRecovery`/`retry` would report for the same decision.
|
|
1846
|
+
*/
|
|
1847
|
+
declare const RecoveryDisposition: Schema.Literals<readonly ["repaired", "deferred", "none", "unknown"]>;
|
|
1848
|
+
type RecoveryDisposition = typeof RecoveryDisposition.Type;
|
|
1849
|
+
declare const ExplainedSubmission_base: Schema.Class<ExplainedSubmission, Schema.Struct<{
|
|
1850
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1851
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
1852
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
1853
|
+
readonly queueSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/QueueSequence">;
|
|
1854
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
1855
|
+
readonly readyAt: Schema.optionalKey<Schema.DateTimeUtcFromString>;
|
|
1856
|
+
/** Whole seconds since admission (`createdAt`). */
|
|
1857
|
+
readonly ageSeconds: Schema.Int;
|
|
1858
|
+
/** Whole seconds since readiness, present exactly when `readyAt` is recorded. */
|
|
1859
|
+
readonly readyAgeSeconds: Schema.optionalKey<Schema.Int>;
|
|
1860
|
+
readonly parentLinkage: Schema.optionalKey<typeof ParentLinkage>;
|
|
1861
|
+
}>, {}>;
|
|
1862
|
+
/** Submission identity, lane position, and Clock-derived ages (DUR-017 obligation visibility). */
|
|
1863
|
+
declare class ExplainedSubmission extends ExplainedSubmission_base {}
|
|
1864
|
+
declare const ExplainedUnknownCall_base: Schema.Class<ExplainedUnknownCall, Schema.Struct<{
|
|
1865
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
1866
|
+
readonly toolName: Schema.NonEmptyString;
|
|
1867
|
+
readonly reason: Schema.String;
|
|
1868
|
+
readonly recordedAt: Schema.DateTimeUtcFromString;
|
|
1869
|
+
/** A real canonical ToolCallSettled closes this call; an intent alone is not an outcome. */
|
|
1870
|
+
readonly resolved: Schema.Boolean;
|
|
1871
|
+
}>, {}>;
|
|
1872
|
+
/** One durable Unknown Outcome and whether its result is canonical (DUR-017). */
|
|
1873
|
+
declare class ExplainedUnknownCall extends ExplainedUnknownCall_base {}
|
|
1874
|
+
declare const ExplainedEvidence_base: Schema.Class<ExplainedEvidence, Schema.Struct<{
|
|
1875
|
+
readonly threadMaterialized: Schema.Boolean;
|
|
1876
|
+
readonly inputRecorded: Schema.Boolean;
|
|
1877
|
+
readonly abortRecorded: Schema.Boolean;
|
|
1878
|
+
readonly recordedSettlementOutcome: Schema.optionalKey<Schema.Literals<readonly ["completed", "failed", "aborted"]>>;
|
|
1879
|
+
/** Prepared ordinary Tool Calls without a canonical outcome (DUR-009). */
|
|
1880
|
+
readonly openToolCalls: Schema.$Array<typeof OpenToolCallEvidence>;
|
|
1881
|
+
/** Original prepared operation identities, arguments and recovery contracts; settled calls are excluded. */
|
|
1882
|
+
readonly pendingOperations: Schema.withConstructorDefault<Schema.$Array<typeof ToolCallPrepared>>;
|
|
1883
|
+
/** Delegation Tool Calls with an open parent-side obligation. */
|
|
1884
|
+
readonly openDelegationCalls: Schema.$Array<typeof OpenDelegationCallEvidence>;
|
|
1885
|
+
/** Canonically requested approvals without a canonical decision. */
|
|
1886
|
+
readonly approvalsPending: Schema.$Array<typeof PendingApprovalEvidence>;
|
|
1887
|
+
/** Durable Unknown Outcomes with their resolution coverage (DUR-017). */
|
|
1888
|
+
readonly unknownCalls: Schema.$Array<typeof ExplainedUnknownCall>;
|
|
1889
|
+
/** Durable approval decisions recorded against this Submission. */
|
|
1890
|
+
readonly approvalDecisions: Schema.$Array<typeof ApprovalDecisionIntent>;
|
|
1891
|
+
/** Durable unknown-outcome resolutions recorded against this Submission. */
|
|
1892
|
+
readonly unknownResolutions: Schema.$Array<typeof UnknownResolutionIntent>;
|
|
1893
|
+
/** Parent-side child attachments. */
|
|
1894
|
+
readonly childAttachments: Schema.$Array<typeof ChildAttachmentSnapshot>;
|
|
1895
|
+
/** Host-side joined/joining members of this Submission's Run (DUR-016). */
|
|
1896
|
+
readonly joins: Schema.$Array<typeof JoinSnapshot>;
|
|
1897
|
+
/** Joined-side host identity, when this Submission is joined to a host Run. */
|
|
1898
|
+
readonly hostSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
1899
|
+
readonly suspension: Schema.optionalKey<typeof SuspensionSnapshot>;
|
|
1900
|
+
readonly abortIntent: Schema.optionalKey<typeof AbortIntent>;
|
|
1901
|
+
}>, {}>;
|
|
1902
|
+
/**
|
|
1903
|
+
* The evidence summary of one explanation: the classifier's canonical-history inputs plus the
|
|
1904
|
+
* durable intents and subagent attachments the ledger snapshot carries. Everything is read-only
|
|
1905
|
+
* observation — assembling this value performs zero writes.
|
|
1906
|
+
*/
|
|
1907
|
+
declare class ExplainedEvidence extends ExplainedEvidence_base {}
|
|
1908
|
+
declare const RecoveryExplanation_base: Schema.Class<RecoveryExplanation, Schema.Struct<{
|
|
1909
|
+
readonly submission: typeof ExplainedSubmission;
|
|
1910
|
+
readonly evidence: typeof ExplainedEvidence;
|
|
1911
|
+
readonly decision: Schema.Union<readonly [typeof CompleteMaterialization, typeof RepairReadiness, typeof ApplyInput, typeof RepairInputMarker, typeof ResumeFromTurnBoundary, typeof AppendReservedSettlement, typeof FinalizeLedgerFromHistory, typeof SettleAborted, typeof MarkUnknown, typeof ResumePendingToolBatch, typeof AwaitApprovalDecision, typeof ResumeSuspended, typeof AwaitUnknownResolution, typeof ApplyUnknownResolutions, typeof RevertJoining, typeof RepairJoinMarker, typeof SettleJoinedWithHost, typeof AwaitHostSettlement, typeof CompleteChildAdmission, typeof AwaitChildAdmissionResolution, typeof RepairSubagentStartLink, typeof EnsureWaitingForChild, typeof AwaitChildSettlement, typeof ResumeWaitingParent, typeof ApplyJoinAccounting, typeof PropagateChildAbort, typeof ReleaseOrphanChildReservation, typeof AwaitParentEstablishment, typeof NoAction]>;
|
|
1912
|
+
/** Static operator meaning of `decision._tag` (see `RECOVERY_DECISION_MEANINGS`). */
|
|
1913
|
+
readonly decisionMeaning: Schema.String;
|
|
1914
|
+
/**
|
|
1915
|
+
* The disposition `runRecovery` would report when this decision executes without claim
|
|
1916
|
+
* contention (see `predictRecoveryDisposition`): `repaired` = the recovery pass itself fixes
|
|
1917
|
+
* it; `deferred` = a claiming worker must finish it; `unknown` = durably blocked on the
|
|
1918
|
+
* authorized DUR-017 resolution path; `none` = settled, nothing owed.
|
|
1919
|
+
*/
|
|
1920
|
+
readonly disposition: Schema.Literals<readonly ["repaired", "deferred", "none", "unknown"]>;
|
|
1921
|
+
readonly explainedAt: Schema.DateTimeUtcFromString;
|
|
1922
|
+
}>, {}>;
|
|
1923
|
+
/**
|
|
1924
|
+
* The read-only recovery explanation of one Submission (P7 exit gate "operators can explain
|
|
1925
|
+
* recovery state without editing storage"): the submission summary, the evidence the pure
|
|
1926
|
+
* classifier consumed, the exact `RecoveryDecision` it selected, that decision's operator
|
|
1927
|
+
* meaning, and the disposition the recovery pass would report for it.
|
|
1928
|
+
*/
|
|
1929
|
+
declare class RecoveryExplanation extends RecoveryExplanation_base {}
|
|
1930
|
+
/**
|
|
1931
|
+
* Operator meaning of every recovery decision tag, matching the classifier docstrings in
|
|
1932
|
+
* `recovery.ts` (the classifier remains the semantic authority; this table is its operator
|
|
1933
|
+
* rendering). Exhaustive over `RecoveryDecision` — adding a decision without a meaning is a
|
|
1934
|
+
* compile error here.
|
|
1935
|
+
*/
|
|
1936
|
+
declare const RECOVERY_DECISION_MEANINGS: Readonly<Record<RecoveryDecision["_tag"], string>>;
|
|
1937
|
+
/** The operator meaning of one recovery decision tag. */
|
|
1938
|
+
declare const recoveryDecisionMeaning: (tag: RecoveryDecision["_tag"]) => string;
|
|
1939
|
+
/**
|
|
1940
|
+
* The disposition the recovery executor reports for a decision when its repair executes without
|
|
1941
|
+
* claim contention (pure prediction; `executeRecoveryDecision` in the coordinator remains the
|
|
1942
|
+
* execution authority — a lane concurrently claimed by a worker can always defer instead).
|
|
1943
|
+
* `AwaitApprovalDecision` depends on the snapshot: an already-suspended lane waits (`deferred`),
|
|
1944
|
+
* while a claimable lane with a lost suspend transition is repaired.
|
|
1945
|
+
*/
|
|
1946
|
+
declare const predictRecoveryDisposition: (decision: RecoveryDecision, snapshot: RecoverySnapshot) => RecoveryDisposition;
|
|
1947
|
+
/** Pure operator text for one explanation (the CLI's `explain` output body). */
|
|
1948
|
+
declare const renderRecoveryExplanation: (explanation: RecoveryExplanation) => string;
|
|
1949
|
+
/** The named integrity checks `verifyThreadInvariants` performs. */
|
|
1950
|
+
declare const IntegrityCheckName: Schema.Literals<readonly ["schema-round-trip", "record-identity", "sequence-contiguity", "digest-chain", "fifo-input-order", "fifo-settlement-order", "terminal-uniqueness", "ledger-canonical-agreement", "checkpoint-binding", "all-settled"]>;
|
|
1951
|
+
type IntegrityCheckName = typeof IntegrityCheckName.Type;
|
|
1952
|
+
declare const IntegrityCheckStatus: Schema.Literals<readonly ["passed", "failed", "skipped"]>;
|
|
1953
|
+
type IntegrityCheckStatus = typeof IntegrityCheckStatus.Type;
|
|
1954
|
+
declare const IntegrityCheck_base: Schema.Class<IntegrityCheck, Schema.Struct<{
|
|
1955
|
+
readonly name: Schema.Literals<readonly ["schema-round-trip", "record-identity", "sequence-contiguity", "digest-chain", "fifo-input-order", "fifo-settlement-order", "terminal-uniqueness", "ledger-canonical-agreement", "checkpoint-binding", "all-settled"]>;
|
|
1956
|
+
readonly status: Schema.Literals<readonly ["passed", "failed", "skipped"]>;
|
|
1957
|
+
readonly detail: Schema.optionalKey<Schema.String>;
|
|
1958
|
+
}>, {}>;
|
|
1959
|
+
/** One typed check result; `detail` explains a failure or the honest reason for a skip. */
|
|
1960
|
+
declare class IntegrityCheck extends IntegrityCheck_base {}
|
|
1961
|
+
declare const IntegrityReport_base: Schema.Class<IntegrityReport, Schema.Struct<{
|
|
1962
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
1963
|
+
readonly tailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
1964
|
+
readonly recordCount: Schema.Int;
|
|
1965
|
+
readonly submissionCount: Schema.Int;
|
|
1966
|
+
readonly checks: Schema.$Array<typeof IntegrityCheck>;
|
|
1967
|
+
readonly ok: Schema.Boolean;
|
|
1968
|
+
}>, {}>;
|
|
1969
|
+
/**
|
|
1970
|
+
* The read-only integrity verdict for one Thread (plan §3 `verify`): typed per-check
|
|
1971
|
+
* results, never a repair. `ok` is true exactly when no check failed — skipped checks are
|
|
1972
|
+
* honest scope statements, not silent passes.
|
|
1973
|
+
*/
|
|
1974
|
+
declare class IntegrityReport extends IntegrityReport_base {}
|
|
1975
|
+
/**
|
|
1976
|
+
* What one nonterminal Submission is visibly blocked on (DUR-017 operator surface; OPS-001).
|
|
1977
|
+
* `ready-aged`/`running-aged` are not blocks — they are accepted work whose settlement age is
|
|
1978
|
+
* measurable and alertable.
|
|
1979
|
+
*/
|
|
1980
|
+
declare const ObligationBlockedOn: Schema.Literals<readonly ["unknown", "approval", "waitingForChild", "ready-aged", "running-aged"]>;
|
|
1981
|
+
type ObligationBlockedOn = typeof ObligationBlockedOn.Type;
|
|
1982
|
+
declare const ObligationSeverity: Schema.Literals<readonly ["ok", "aging", "overdue"]>;
|
|
1983
|
+
type ObligationSeverity = typeof ObligationSeverity.Type;
|
|
1984
|
+
declare const ObligationThresholds_base: Schema.Class<ObligationThresholds, Schema.Struct<{
|
|
1985
|
+
/** Age (whole seconds) at which an obligation is reported `aging`. */
|
|
1986
|
+
readonly agingSeconds: Schema.Int;
|
|
1987
|
+
/** Age (whole seconds) at which an obligation is reported `overdue`. */
|
|
1988
|
+
readonly overdueSeconds: Schema.Int;
|
|
1989
|
+
}>, {}>;
|
|
1990
|
+
/** Host-supplied age thresholds; the framework deliberately does not own the alert loop. */
|
|
1991
|
+
declare class ObligationThresholds extends ObligationThresholds_base {}
|
|
1992
|
+
declare const ObligationEntry_base: Schema.Class<ObligationEntry, Schema.Struct<{
|
|
1993
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
1994
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
1995
|
+
readonly state: Schema.Literals<readonly ["admitted", "ready", "joining", "joined", "running", "input-applied", "suspended", "unknown", "terminalizing", "settled"]>;
|
|
1996
|
+
readonly blockedOn: Schema.Literals<readonly ["unknown", "approval", "waitingForChild", "ready-aged", "running-aged"]>;
|
|
1997
|
+
readonly ageSeconds: Schema.Int;
|
|
1998
|
+
readonly severity: Schema.Literals<readonly ["ok", "aging", "overdue"]>;
|
|
1999
|
+
}>, {}>;
|
|
2000
|
+
/** One nonterminal accepted-work obligation with its age and severity. */
|
|
2001
|
+
declare class ObligationEntry extends ObligationEntry_base {}
|
|
2002
|
+
declare const ObligationReport_base: Schema.Class<ObligationReport, Schema.Struct<{
|
|
2003
|
+
readonly thresholds: typeof ObligationThresholds;
|
|
2004
|
+
readonly entries: Schema.$Array<typeof ObligationEntry>;
|
|
2005
|
+
readonly generatedAt: Schema.DateTimeUtcFromString;
|
|
2006
|
+
}>, {}>;
|
|
2007
|
+
/**
|
|
2008
|
+
* The scan-based DUR-017/OPS-001 operator surface (plan §3): a fold of the ledger's nonterminal
|
|
2009
|
+
* scan into aged, severity-classified rows. Scan-based, never a daemon — hosts run it
|
|
2010
|
+
* periodically and export logs/metrics; ages need no storage-version bump because every source
|
|
2011
|
+
* timestamp already exists (`createdAt`/`readyAt`, `suspendedAt`, the canonical
|
|
2012
|
+
* `ToolCallUnknown` record's `createdAt`).
|
|
2013
|
+
*/
|
|
2014
|
+
declare class ObligationReport extends ObligationReport_base {}
|
|
2015
|
+
/** Severity of one obligation age under the supplied thresholds. */
|
|
2016
|
+
declare const obligationSeverityOf: (ageSeconds: number, thresholds: ObligationThresholds) => ObligationSeverity;
|
|
2017
|
+
declare const RetryCommand_base: Schema.Class<RetryCommand, Schema.Struct<{
|
|
2018
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
2019
|
+
readonly author: Schema.NonEmptyString;
|
|
2020
|
+
readonly reason: Schema.String;
|
|
2021
|
+
}>, {}>;
|
|
2022
|
+
/**
|
|
2023
|
+
* The mandatory-audit retry command (SEC-011): `author`/`reason` carry the same bounds as the
|
|
2024
|
+
* canonical abort command so every mutating administrative operation stays attributable. The
|
|
2025
|
+
* operator and decision are logged. A repair with a claim also appends a best-effort
|
|
2026
|
+
* `RepairAnnotated` attempt using that claim's epoch; state-only repairs do not append audits.
|
|
2027
|
+
*/
|
|
2028
|
+
declare class RetryCommand extends RetryCommand_base {}
|
|
2029
|
+
/** Why a retry was refused without executing anything. */
|
|
2030
|
+
declare const RetryRefusalReason: Schema.Literals<readonly ["settled", "await-unknown-resolution", "await-approval-decision"]>;
|
|
2031
|
+
type RetryRefusalReason = typeof RetryRefusalReason.Type;
|
|
2032
|
+
declare const RetryRefused_base: Schema.Class<RetryRefused, Schema.TaggedStruct<"RetryRefused", {
|
|
2033
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
2034
|
+
readonly refusal: Schema.Literals<readonly ["settled", "await-unknown-resolution", "await-approval-decision"]>;
|
|
2035
|
+
readonly decisionTag: Schema.String;
|
|
2036
|
+
readonly message: Schema.String;
|
|
2037
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2038
|
+
/**
|
|
2039
|
+
* Typed refusal of `retry` (plan §3): Submissions waiting on `AwaitUnknownResolution` or
|
|
2040
|
+
* `AwaitApprovalDecision` have their own authorized operations, and settled work is never
|
|
2041
|
+
* re-driven. The refusal names the classifier decision so the operator sees WHY.
|
|
2042
|
+
*/
|
|
2043
|
+
declare class RetryRefused extends RetryRefused_base {}
|
|
2044
|
+
//#endregion
|
|
2045
|
+
//#region src/durable/internal/journal-checkpoint.d.ts
|
|
2046
|
+
declare const JournalCheckpointSeed_base: Schema.Class<JournalCheckpointSeed, Schema.Struct<{
|
|
2047
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
2048
|
+
readonly throughSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2049
|
+
readonly firstSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2050
|
+
readonly toolSelection: Schema.optionalKey<typeof Selection>;
|
|
2051
|
+
readonly committedTurns: Schema.Natural;
|
|
2052
|
+
readonly policyUsage: Schema.Struct<{
|
|
2053
|
+
readonly committedTurns: Schema.Natural;
|
|
2054
|
+
readonly toolCalls: Schema.Natural;
|
|
2055
|
+
readonly programmaticToolCalls: Schema.Natural;
|
|
2056
|
+
readonly consecutiveToolFailures: Schema.Natural;
|
|
2057
|
+
readonly finalizationUsed: Schema.Boolean;
|
|
2058
|
+
}>;
|
|
2059
|
+
readonly modelCalls: Schema.Natural;
|
|
2060
|
+
readonly unobservedModelCalls: Schema.Natural;
|
|
2061
|
+
readonly inputTokens: Schema.Natural;
|
|
2062
|
+
readonly outputTokens: Schema.Natural;
|
|
2063
|
+
readonly lastInputTokens: Schema.Natural;
|
|
2064
|
+
readonly lastOutputTokens: Schema.Natural;
|
|
2065
|
+
readonly costMicrousd: Schema.Natural;
|
|
2066
|
+
readonly summarizedModelUsage: typeof RunUsageSummary;
|
|
2067
|
+
readonly protectedContext: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
2068
|
+
readonly contextWindowId: Schema.optionalKey<Schema.String>;
|
|
2069
|
+
readonly frontier: Schema.optionalKey<Schema.Struct<{
|
|
2070
|
+
readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2071
|
+
readonly tag: Schema.Literals<readonly ["ModelResponseRecorded", "ToolCallSettled"]>;
|
|
2072
|
+
}>>;
|
|
2073
|
+
/** Canonical replacement whose covered batches were validated before retirement. */
|
|
2074
|
+
readonly compaction: typeof CanonicalRecordEnvelope;
|
|
2075
|
+
}>, {}>;
|
|
2076
|
+
/** Retired accounting is additive; the latest Tool batch always remains replayable verbatim. */
|
|
2077
|
+
declare class JournalCheckpointSeed extends JournalCheckpointSeed_base {}
|
|
2078
|
+
//#endregion
|
|
2079
|
+
//#region src/durable/internal/journal-metadata.d.ts
|
|
2080
|
+
/** Metadata for one exact canonical prefix, including the same optional checkpoint seed. */
|
|
2081
|
+
interface JournalMetadata {
|
|
2082
|
+
readonly ownerRunId: RunId | undefined;
|
|
2083
|
+
readonly seed: JournalCheckpointSeed | undefined;
|
|
2084
|
+
readonly firstSequenceByRun: ReadonlyMap<string, number>;
|
|
2085
|
+
readonly lastResponseSequenceByRun: ReadonlyMap<string, number>;
|
|
2086
|
+
readonly terminalSequenceByRun: ReadonlyMap<string, number>;
|
|
2087
|
+
readonly settledSpans: ReadonlyArray<{
|
|
2088
|
+
readonly from: number;
|
|
2089
|
+
readonly to: number;
|
|
2090
|
+
}>;
|
|
2091
|
+
readonly toolExecutionEvidence: ReadonlySet<string>;
|
|
2092
|
+
readonly settledToolCallRecordIds: ReadonlySet<string>;
|
|
2093
|
+
readonly settledById: ReadonlyMap<string, Pick<ToolCallSettled, "isFailure" | "budgetRejected" | "toolSelection">>;
|
|
2094
|
+
readonly compactions: ReadonlyArray<{
|
|
2095
|
+
readonly payload: CompactionCreated;
|
|
2096
|
+
readonly sequence: number;
|
|
2097
|
+
}>;
|
|
2098
|
+
}
|
|
2099
|
+
declare namespace RunJournal_d_exports {
|
|
2100
|
+
export { JournalBoundary, RunJournalError, RunJournalProjection, RunJournalUsage, TurnCommitInput, agentUpdateRecordId, approvalDecisionBatchId, childIdempotencyKeyFor, childThreadIdFor, compactionBatchId, compactionRecordId, firstWorkerInputRecordId, markUnknownBatchId, modelResponseInterruptedBatchId, modelResponseInterruptedRecordId, modelResponseRecordId, peerMessageRecordId, projectRunJournal, projectRunJournalStream, promptFromCanonicalRecords, runCompletedRecordId, runCompletionDigest, runDurationBatchId, runDurationRecordId, runIdForSubmission, runStartedBatchId, runStartedRecordId, subagentJoinBatchId, subagentJoinedRecordId, subagentLineageBatchId, subagentLineageRecordId, subagentRequestedBatchId, subagentRequestedRecordId, subagentStartedBatchId, subagentStartedRecordId, toolApprovalDecisionRecordId, toolApprovalRequestRecordId, toolCallPreparedRecordId, toolCallResolutionBatchId, toolCallResolvedRecordId, toolCallResultBatchId, toolCallSettledRecordId, toolCallUnknownRecordId, toolStepSettledBatchId, toolStepSettledRecordId, turnApprovalsBatchId, turnBatchId, turnCanonicalBatch, turnIdForRun, turnPreparedBatchId, turnResponseBatch, turnResponseBatchId, turnResultsBatch, turnResultsBatchId, workerInputRecordId, workerOriginRecordId, workerReportRecordId };
|
|
2101
|
+
}
|
|
2102
|
+
declare const RunJournalError_base: Schema.Class<RunJournalError, Schema.TaggedStruct<"RunJournalError", {
|
|
2103
|
+
readonly message: Schema.String;
|
|
2104
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
2105
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2106
|
+
/** A canonical record could not be projected into Run/Prompt state. */
|
|
2107
|
+
declare class RunJournalError extends RunJournalError_base {}
|
|
2108
|
+
/**
|
|
2109
|
+
* Deterministic Run identity pinned per Submission (plan §Coordinator flow). Every Attempt of one
|
|
2110
|
+
* Submission shares this Run identity, so canonical per-Turn records from different Attempts
|
|
2111
|
+
* belong to one logical Run.
|
|
2112
|
+
*/
|
|
2113
|
+
declare const runIdForSubmission: (submissionId: SubmissionId) => RunId;
|
|
2114
|
+
/** Stable canonical clock identity shared by every Attempt of one Run. */
|
|
2115
|
+
declare const runStartedRecordId: (runId: RunId) => RecordId;
|
|
2116
|
+
declare const runStartedBatchId: (runId: RunId) => BatchId;
|
|
2117
|
+
declare const runDurationRecordId: (runId: RunId) => RecordId;
|
|
2118
|
+
declare const runDurationBatchId: (runId: RunId) => BatchId;
|
|
2119
|
+
/** Deterministic Turn identity: Attempt-independent for one (Run, canonical turn) pair. */
|
|
2120
|
+
declare const turnIdForRun: (runId: RunId, turn: number) => TurnId;
|
|
2121
|
+
/** Deterministic batch identity of one committed canonical no-tool Turn (P4 single-batch shape). */
|
|
2122
|
+
declare const turnBatchId: (runId: RunId, turn: number) => BatchId;
|
|
2123
|
+
/**
|
|
2124
|
+
* Deterministic batch identity of a tool-declaring Turn's RESPONSE commit (plan §2.1 commit 1):
|
|
2125
|
+
* the assistant response plus pending steering becomes canonical BEFORE approval preflight and
|
|
2126
|
+
* tool preparation, creating the durability §15 "resume tool scheduling" window.
|
|
2127
|
+
*/
|
|
2128
|
+
declare const turnResponseBatchId: (runId: RunId, turn: number) => BatchId;
|
|
2129
|
+
/**
|
|
2130
|
+
* Deterministic batch identity of a tool-declaring Turn's RESULTS commit (plan §2.1 commit 5):
|
|
2131
|
+
* every `ToolCallSettled` record of the Turn, in declaration order, model-visible atomically.
|
|
2132
|
+
*/
|
|
2133
|
+
declare const turnResultsBatchId: (runId: RunId, turn: number) => BatchId;
|
|
2134
|
+
/**
|
|
2135
|
+
* Deterministic per-call late-settle batch identity used by the resolution path when one
|
|
2136
|
+
* recovered/resolved call settles outside its Turn's results batch. Record identity
|
|
2137
|
+
* (`tool-settled:{runId}:{turn}:{toolCallId}`) dedupes double-settles across both paths.
|
|
2138
|
+
*/
|
|
2139
|
+
declare const toolCallResultBatchId: (runId: RunId, turn: number, toolCallId: ToolCallId) => BatchId;
|
|
2140
|
+
/** Deterministic batch identity of one Turn's `ToolCallPrepared` commit (plan §2.1 commit 3). */
|
|
2141
|
+
declare const turnPreparedBatchId: (runId: RunId, turn: number) => BatchId;
|
|
2142
|
+
/**
|
|
2143
|
+
* Deterministic identity of one pre-Turn compaction record (RUN-026,
|
|
2144
|
+
* RUN-026). Keyed by Run, Turn, and kind — the engine performs at most one
|
|
2145
|
+
* threshold compaction per Turn plus at most one overflow-forced summarize,
|
|
2146
|
+
* so a superseding Attempt that re-decides the same compaction replays the
|
|
2147
|
+
* batch identity instead of duplicating the record.
|
|
2148
|
+
*/
|
|
2149
|
+
declare const compactionRecordId: (runId: RunId, turn: number, kind: "clear-tool-results" | "summarize" | "rollover") => RecordId;
|
|
2150
|
+
/** Deterministic batch identity of one compaction append (same string as its record id). */
|
|
2151
|
+
declare const compactionBatchId: (runId: RunId, turn: number, kind: "clear-tool-results" | "summarize" | "rollover") => BatchId;
|
|
2152
|
+
/** Deterministic canonical record identity of one Turn's `ModelResponseRecorded` record. */
|
|
2153
|
+
declare const modelResponseRecordId: (runId: RunId, turn: number) => RecordId;
|
|
2154
|
+
/** Terminal Tool completion marker committed atomically with its settled Tool result. */
|
|
2155
|
+
declare const runCompletedRecordId: (runId: RunId) => RecordId;
|
|
2156
|
+
/** Native source reservation locator, including the first admission of a continuing worker. */
|
|
2157
|
+
declare const workerInputRecordId: (messageId: IdempotencyKey) => RecordId;
|
|
2158
|
+
/** Source-owned first reservation; native worker identity is minted from its first message. */
|
|
2159
|
+
declare const firstWorkerInputRecordId: (worker: WorkerRef) => RecordId;
|
|
2160
|
+
declare const workerOriginRecordId: (threadId: ThreadId) => RecordId;
|
|
2161
|
+
declare const workerReportRecordId: (messageId: IdempotencyKey) => RecordId;
|
|
2162
|
+
declare const peerMessageRecordId: (messageId: IdempotencyKey) => RecordId;
|
|
2163
|
+
/** Same immutable tuple used by native update admission; callers never parse its hash. */
|
|
2164
|
+
declare const agentUpdateRecordId: (threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">, runId: string & import("effect/Brand").Brand<"@effect-agent/core/RunId">, updateId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/thread/RecordId">, DigestError, Crypto.Crypto>;
|
|
2165
|
+
/** Deterministic canonical record identity of one Turn's `ToolCallSettled` record. */
|
|
2166
|
+
declare const toolCallSettledRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2167
|
+
/** Deterministic canonical record identity of one Tool Call's `ToolCallPrepared` record. */
|
|
2168
|
+
declare const toolCallPreparedRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2169
|
+
/** Deterministic batch identity of one Turn's `ToolCallUnknown` marking append. */
|
|
2170
|
+
declare const markUnknownBatchId: (submissionId: SubmissionId, turn: number) => BatchId;
|
|
2171
|
+
/** Deterministic canonical record identity of one Tool Call's `ToolCallUnknown` record. */
|
|
2172
|
+
declare const toolCallUnknownRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2173
|
+
/** Deterministic batch identity of one Tool Call's resolution append (DUR-017). */
|
|
2174
|
+
declare const toolCallResolutionBatchId: (submissionId: SubmissionId, toolCallId: ToolCallId) => BatchId;
|
|
2175
|
+
/** Deterministic canonical record identity of one Tool Call's `ToolCallResolved` record. */
|
|
2176
|
+
declare const toolCallResolvedRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2177
|
+
/**
|
|
2178
|
+
* Deterministic identity of one accepted Durable Step result. The one-record batch reuses the
|
|
2179
|
+
* SAME string, so batch idempotency plus the epoch fence realize the durability §11
|
|
2180
|
+
* racing-writers rule: only the fenced winner's record commits; the loser replays it.
|
|
2181
|
+
* A versioned JSON tuple keeps separator characters in each identity component distinct.
|
|
2182
|
+
* Replay derives this key from the structured payload, including records with legacy IDs.
|
|
2183
|
+
*/
|
|
2184
|
+
declare const toolStepSettledRecordId: (runId: RunId, toolCallId: ToolCallId, stepName: string) => RecordId;
|
|
2185
|
+
/** Deterministic batch identity of one Durable Step commit (same string as its record id). */
|
|
2186
|
+
declare const toolStepSettledBatchId: (runId: RunId, toolCallId: ToolCallId, stepName: string) => BatchId;
|
|
2187
|
+
/** Deterministic batch identity of one Turn's canonical approval-request append (plan §2.6). */
|
|
2188
|
+
declare const turnApprovalsBatchId: (runId: RunId, turn: number) => BatchId;
|
|
2189
|
+
/** Deterministic canonical record identity of one Tool Call's `ToolApprovalRequested` record. */
|
|
2190
|
+
declare const toolApprovalRequestRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2191
|
+
/** Deterministic batch identity of one Tool Call's canonical approval-decision append. */
|
|
2192
|
+
declare const approvalDecisionBatchId: (submissionId: SubmissionId, toolCallId: ToolCallId) => BatchId;
|
|
2193
|
+
/** Deterministic canonical record identity of one Tool Call's `ToolApprovalDecided` record. */
|
|
2194
|
+
declare const toolApprovalDecisionRecordId: (runId: RunId, turn: number, toolCallId: ToolCallId) => RecordId;
|
|
2195
|
+
/**
|
|
2196
|
+
* Deterministic identity of one superseded Attempt's `ModelResponseInterrupted` audit record
|
|
2197
|
+
* (durability §9). Keyed by the superseded epoch, so each interrupted ownership period is
|
|
2198
|
+
* recorded at most once; the one-record batch reuses the same string.
|
|
2199
|
+
*/
|
|
2200
|
+
declare const modelResponseInterruptedRecordId: (runId: RunId, supersededEpoch: number) => RecordId;
|
|
2201
|
+
/** Deterministic batch identity of one `ModelResponseInterrupted` append (same string). */
|
|
2202
|
+
declare const modelResponseInterruptedBatchId: (runId: RunId, supersededEpoch: number) => BatchId;
|
|
2203
|
+
/**
|
|
2204
|
+
* Deterministic canonical record identity of one parent Tool Call's `SubagentRequested` record.
|
|
2205
|
+
* The one-record batch reuses the same string, so batch
|
|
2206
|
+
* idempotency plus the parent epoch fence make the request append exactly-once-canonical.
|
|
2207
|
+
*/
|
|
2208
|
+
declare const subagentRequestedRecordId: (runId: RunId, toolCallId: ToolCallId) => RecordId;
|
|
2209
|
+
/** Deterministic batch identity of one `SubagentRequested` append (same string). */
|
|
2210
|
+
declare const subagentRequestedBatchId: (runId: RunId, toolCallId: ToolCallId) => BatchId;
|
|
2211
|
+
/**
|
|
2212
|
+
* Deterministic canonical record identity of one parent Tool Call's `SubagentStarted` record.
|
|
2213
|
+
* Recovery's start-link repair appends the EXACT same record
|
|
2214
|
+
* under this identity, so a raced repair replays instead of duplicating (SUB-016/SUB-017).
|
|
2215
|
+
*/
|
|
2216
|
+
declare const subagentStartedRecordId: (runId: RunId, toolCallId: ToolCallId) => RecordId;
|
|
2217
|
+
/** Deterministic batch identity of one `SubagentStarted` append (same string). */
|
|
2218
|
+
declare const subagentStartedBatchId: (runId: RunId, toolCallId: ToolCallId) => BatchId;
|
|
2219
|
+
/**
|
|
2220
|
+
* Deterministic batch identity of one parent Tool Call's atomic settlement join: the
|
|
2221
|
+
* `SubagentJoined` record plus the parent's `ToolCallSettled` record (its existing
|
|
2222
|
+
* `tool-settled:{runId}:{turn}:{toolCallId}` identity) commit as ONE canonical batch (SUB-019).
|
|
2223
|
+
*/
|
|
2224
|
+
declare const subagentJoinBatchId: (runId: RunId, toolCallId: ToolCallId) => BatchId;
|
|
2225
|
+
/** Deterministic canonical record identity of one parent Tool Call's `SubagentJoined` record. */
|
|
2226
|
+
declare const subagentJoinedRecordId: (runId: RunId, toolCallId: ToolCallId) => RecordId;
|
|
2227
|
+
/**
|
|
2228
|
+
* Deterministic identity of one child Thread's `SubagentLineageRecorded` record.
|
|
2229
|
+
* Its own single-record batch reuses the same string so the generic
|
|
2230
|
+
* `thread-created:{cid}` batch identity is never contradicted.
|
|
2231
|
+
*/
|
|
2232
|
+
declare const subagentLineageRecordId: (threadId: ThreadId) => RecordId;
|
|
2233
|
+
/** Deterministic batch identity of one `SubagentLineageRecorded` append (same string). */
|
|
2234
|
+
declare const subagentLineageBatchId: (threadId: ThreadId) => BatchId;
|
|
2235
|
+
/**
|
|
2236
|
+
* Deterministic intended child Thread identity: the
|
|
2237
|
+
* parent Submission and Tool Call pair addresses exactly one child Thread, so a replayed
|
|
2238
|
+
* establishment converges on the one existing child (SUB-016).
|
|
2239
|
+
*/
|
|
2240
|
+
declare const childThreadIdFor: (parentSubmissionId: SubmissionId, toolCallId: ToolCallId) => ThreadId;
|
|
2241
|
+
/**
|
|
2242
|
+
* Deterministic child admission idempotency key: scoped to
|
|
2243
|
+
* the parent Run and Tool Call identity, so duplicate admission attempts resolve through the
|
|
2244
|
+
* ledger's idempotency contract to one child Receipt (SUB-016, SUB-031). The ledger key is
|
|
2245
|
+
* bounded (256); coordinator-minted Run and Tool Call identities stay far below that bound.
|
|
2246
|
+
*/
|
|
2247
|
+
declare const childIdempotencyKeyFor: (parentRunId: RunId, toolCallId: ToolCallId) => IdempotencyKey;
|
|
2248
|
+
/**
|
|
2249
|
+
* Pure canonical projection of one Run's durable execution state.
|
|
2250
|
+
*
|
|
2251
|
+
* Prompt reconstruction contract (D8):
|
|
2252
|
+
*
|
|
2253
|
+
* - `ModelResponseRecorded.messages` carries the Schema-encoded Prompt messages the Turn appended
|
|
2254
|
+
* to the model-visible prompt — for the Run's FIRST committed Turn that includes the evaluated
|
|
2255
|
+
* instruction and user-input messages, for later Turns only the assistant response messages.
|
|
2256
|
+
* Tool messages are excluded from `messages`.
|
|
2257
|
+
* - `ToolCallSettled` records (committed in the same per-Turn batch, in declaration order)
|
|
2258
|
+
* deterministically rebuild the Turn's single Tool message.
|
|
2259
|
+
* - `UserInputRecorded` records input, with a Submission identity only for durable admission. Its
|
|
2260
|
+
* Prompt-visible form (instructions + user message) becomes canonical inside the owning Run's
|
|
2261
|
+
* first `ModelResponseRecorded`. The projection consumes it only for Run correlation.
|
|
2262
|
+
* - Immediate retained history uses `ModelCompleted.messages` for the successful Run's exact
|
|
2263
|
+
* native Prompt suffix, including any input examples. It has no resumable Turn state.
|
|
2264
|
+
*/
|
|
2265
|
+
/** Cumulative committed usage of the projected Run (RUN-023 resume re-seed). */
|
|
2266
|
+
interface RunJournalUsage {
|
|
2267
|
+
readonly modelCalls: number;
|
|
2268
|
+
/** Known accounting gaps retained across Attempts without changing numeric usage totals. */
|
|
2269
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
2270
|
+
readonly inputTokens: number;
|
|
2271
|
+
readonly outputTokens: number;
|
|
2272
|
+
readonly lastInputTokens: number;
|
|
2273
|
+
readonly lastOutputTokens: number;
|
|
2274
|
+
/** Cumulative persisted spend of the projected Run's committed calls (RUN-023). */
|
|
2275
|
+
readonly costMicrousd: number;
|
|
2276
|
+
/** Canonical per-call detail used for settlement aggregation and recovery. */
|
|
2277
|
+
readonly modelUsage: ReadonlyArray<ModelCallUsage>;
|
|
2278
|
+
/** Detailed usage of retired records, grouped without retaining per-call payloads. */
|
|
2279
|
+
readonly summarizedModelUsage?: RunUsageSummary | undefined;
|
|
2280
|
+
}
|
|
2281
|
+
interface RunJournalProjection {
|
|
2282
|
+
readonly toolSelection?: Selection | undefined;
|
|
2283
|
+
readonly policyUsage: RunPolicyUsage;
|
|
2284
|
+
/** Canonical projection for the requested Run; may end at its resumable Tool declaration. */
|
|
2285
|
+
readonly prompt: Prompt.Prompt;
|
|
2286
|
+
/** Prior-Run history with model-only unknown results closing incomplete application calls. */
|
|
2287
|
+
readonly historyBefore: Prompt.Prompt;
|
|
2288
|
+
/** Number of canonical Turns already committed for the projected Run. */
|
|
2289
|
+
readonly committedTurns: number;
|
|
2290
|
+
/** Summed per-call usage of the projected Run's committed responses; zeros for records predating usage capture. */
|
|
2291
|
+
readonly usage: RunJournalUsage;
|
|
2292
|
+
/** Latest committed context window identity, retained across ownership changes. */
|
|
2293
|
+
readonly contextWindowId?: string | undefined;
|
|
2294
|
+
/** Canonical evaluated instructions and initial input for this Run, independent of the view. */
|
|
2295
|
+
readonly protectedContext?: Prompt.Prompt | undefined;
|
|
2296
|
+
/** Last successful singleton Tool awaiting possible context-control interpretation by the engine. */
|
|
2297
|
+
readonly pendingContextToolCallId?: string | undefined;
|
|
2298
|
+
}
|
|
2299
|
+
/**
|
|
2300
|
+
* Pure projection: rebuild one Run's resume state from canonical records (DUR-015). Canonical
|
|
2301
|
+
* order is authoritative; the fold projects each `ModelResponseRecorded` Turn and the
|
|
2302
|
+
* owning Run's resumable incomplete Tool Turn. It flushes each contiguous group of valid `ToolCallSettled` records into one Tool message,
|
|
2303
|
+
* exactly mirroring the per-Turn commit shape produced by `turnCanonicalBatch` (no-tool Turns) and
|
|
2304
|
+
* by the
|
|
2305
|
+
* `turnResponseBatch`/`turnResultsBatch` split (tool-declaring Turns). The Phase 5 audit tags
|
|
2306
|
+
* are skipped transparently, so split-batch commits replay to the same prompt as P4 single-batch
|
|
2307
|
+
* commits.
|
|
2308
|
+
*
|
|
2309
|
+
* An incomplete application Tool turn remains visible while projecting its owning Run so active
|
|
2310
|
+
* recovery can resume the declared batch. It is not a valid model-visible Turn boundary for a
|
|
2311
|
+
* later Run until model-only unknown results close its missing calls. Those explanatory results
|
|
2312
|
+
* are never canonical settlements or evidence for compaction, recovery or accounting. Real
|
|
2313
|
+
* results replace them at the original declaration, including results appended after another Run.
|
|
2314
|
+
* Prior user intent and assistant text remain visible; prior system instructions do not.
|
|
2315
|
+
*/
|
|
2316
|
+
/** @internal Lightweight canonical boundaries collected without retaining record payloads. */
|
|
2317
|
+
interface JournalBoundary {
|
|
2318
|
+
readonly sequence: CanonicalSequence;
|
|
2319
|
+
readonly tag: "ModelResponseRecorded" | "ToolCallSettled";
|
|
2320
|
+
readonly promptLength: number;
|
|
2321
|
+
/** A declaration without all settled results requires terminal-prior-Run proof for coverage. */
|
|
2322
|
+
readonly incomplete?: true | undefined;
|
|
2323
|
+
/** The Run terminated after its last response and differs from the projection's owner. */
|
|
2324
|
+
readonly terminalPriorRun?: true | undefined;
|
|
2325
|
+
}
|
|
2326
|
+
/**
|
|
2327
|
+
* Reconstruct a fixed canonical prefix from a re-readable stream. The caller must keep the same
|
|
2328
|
+
* records visible on every traversal. The first collects compaction and settlement metadata;
|
|
2329
|
+
* rollovers additionally validate covered Tool batches before rebuilding Prompt and usage. Metadata and the
|
|
2330
|
+
* live Prompt remain resident; covered historical message/tool payloads do not. An uncompacted Prompt still grows
|
|
2331
|
+
* with its conversation, so hosts must configure an appropriate context compaction policy.
|
|
2332
|
+
* Prepared metadata must describe exactly this stream and seed through the same fixed tail;
|
|
2333
|
+
* it skips only the metadata scan, never covered-Tool validation or the canonical fold.
|
|
2334
|
+
* @internal
|
|
2335
|
+
*/
|
|
2336
|
+
declare const projectRunJournalStream: <E, R>(records: Stream.Stream<CanonicalRecordEnvelope, E, R>, ownerRunId: (string & import("effect/Brand").Brand<"@effect-agent/core/RunId">) | undefined, onBoundary?: ((boundary: JournalBoundary) => void) | undefined, seed?: JournalCheckpointSeed | undefined, preparedMetadata?: JournalMetadata | undefined) => Effect.Effect<RunJournalProjection, E | RunJournalError, R>;
|
|
2337
|
+
/** Pure projection of one Run's durable recovery state from canonical records. */
|
|
2338
|
+
declare const projectRunJournal: (records: readonly CanonicalRecordEnvelope[], runId: string & import("effect/Brand").Brand<"@effect-agent/core/RunId">) => Effect.Effect<RunJournalProjection, RunJournalError, never>;
|
|
2339
|
+
/**
|
|
2340
|
+
* Pure valid-prompt projection from canonical records: `UserInputRecorded` +
|
|
2341
|
+
* `ModelResponseRecorded` + complete `ToolCallSettled` batches → the deterministic model-visible
|
|
2342
|
+
* Prompt (plan §Coordinator flow step 3).
|
|
2343
|
+
*/
|
|
2344
|
+
declare const promptFromCanonicalRecords: (records: readonly CanonicalRecordEnvelope[]) => Effect.Effect<Prompt.Prompt, RunJournalError, never>;
|
|
2345
|
+
interface TurnCommitInput {
|
|
2346
|
+
readonly toolOperations?: ModelResponseRecorded["toolOperations"] | undefined;
|
|
2347
|
+
readonly toolParameterRejections?: ReadonlyArray<ToolParameterRejection> | undefined;
|
|
2348
|
+
readonly toolExposure?: Snapshot | undefined;
|
|
2349
|
+
readonly toolSelections?: ReadonlyMap<string, Selection> | undefined;
|
|
2350
|
+
readonly budgetRejectedCalls?: ReadonlySet<string>;
|
|
2351
|
+
readonly runId: RunId;
|
|
2352
|
+
/** Canonical (Run-relative, Attempt-independent) Turn number; must be positive. */
|
|
2353
|
+
readonly turn: number;
|
|
2354
|
+
readonly turnId: TurnId;
|
|
2355
|
+
/**
|
|
2356
|
+
* The Prompt messages this Turn appended to official history, in order, including the Turn's
|
|
2357
|
+
* Tool message when application Tools ran. Tool messages become `ToolCallSettled` records; the
|
|
2358
|
+
* remaining messages become the Turn's `ModelResponseRecorded.messages`.
|
|
2359
|
+
*/
|
|
2360
|
+
readonly appended: ReadonlyArray<Prompt.Message>;
|
|
2361
|
+
readonly producerId: ProducerId;
|
|
2362
|
+
readonly deploymentId: DeploymentId;
|
|
2363
|
+
readonly createdAt: DateTime.Utc;
|
|
2364
|
+
/** Leading instruction/wake messages that stay canonical but are hidden from later Runs. */
|
|
2365
|
+
readonly runScopedPrefixLength?: number | undefined;
|
|
2366
|
+
/** Terminal output committed atomically with this Turn's final canonical batch. */
|
|
2367
|
+
readonly runCompletion?: {
|
|
2368
|
+
readonly output: PersistedJson;
|
|
2369
|
+
readonly runDisposition?: PersistedJson | undefined;
|
|
2370
|
+
readonly finishReason?: "budget-exhausted" | undefined;
|
|
2371
|
+
readonly exhausted?: ExhaustedLimit | undefined;
|
|
2372
|
+
} | undefined;
|
|
2373
|
+
/** Known missing-accounting invocations staged before this canonical response. */
|
|
2374
|
+
readonly unobservedModelCalls?: number | undefined;
|
|
2375
|
+
/** Per-call provider usage staged by the engine's `noteTurnUsage` (RUN-023). */
|
|
2376
|
+
readonly usage?: {
|
|
2377
|
+
readonly inputTokens: number;
|
|
2378
|
+
readonly outputTokens: number;
|
|
2379
|
+
readonly costMicrousd?: number | undefined;
|
|
2380
|
+
readonly modelUsage?: ReadonlyArray<ModelCallUsage> | undefined;
|
|
2381
|
+
} | undefined;
|
|
2382
|
+
}
|
|
2383
|
+
/** Integrity of the original validated terminal values; never a current-code projection. */
|
|
2384
|
+
declare const runCompletionDigest: (completion: Pick<RunCompleted, "runId" | "output" | "runDisposition" | "finishReason" | "exhausted">) => Effect.Effect<string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">, DigestError, Crypto.Crypto>;
|
|
2385
|
+
/**
|
|
2386
|
+
* Pure per-Turn canonical batch builder (TurnCompleted seam fold, D6/D8): one
|
|
2387
|
+
* `ModelResponseRecorded` record plus one `ToolCallSettled` record per terminal Tool result, all
|
|
2388
|
+
* under the WP0-style deterministic identities, committed as ONE atomic batch. The same input
|
|
2389
|
+
* always yields byte-identical content, so an in-Attempt append retry is an honest batch replay.
|
|
2390
|
+
*
|
|
2391
|
+
* Phase 5 keeps this shape for Turns that declare no application Tool calls; their terminal
|
|
2392
|
+
* `RunCompleted` marker joins the response in this same atomic batch. Tool-declaring Turns split
|
|
2393
|
+
* into `turnResponseBatch` + `turnResultsBatch`.
|
|
2394
|
+
*/
|
|
2395
|
+
declare const turnCanonicalBatch: (input: TurnCommitInput) => Effect.Effect<CanonicalBatch, DigestError | RunJournalError, Crypto.Crypto>;
|
|
2396
|
+
/**
|
|
2397
|
+
* Commit 1 of a tool-declaring Turn: the Turn's `ModelResponseRecorded` record, including
|
|
2398
|
+
* provider results retained in assistant content before application Tools execute.
|
|
2399
|
+
* — pending steering plus the assistant response with its declared tool calls — under batch
|
|
2400
|
+
* identity `turn-response:{runId}:{turn}`. Committing the response before preparation creates
|
|
2401
|
+
* the provably-safe durability §15 window ("after model item commit, before tool preparation →
|
|
2402
|
+
* resume tool scheduling"): a crash there resumes the declared batch with no model re-invocation
|
|
2403
|
+
* and no Unknown. Tool messages in `appended` are ignored; the record identity is the same
|
|
2404
|
+
* `model-response:{runId}:{turn}` as the single-batch shape, so record-id assertions and the
|
|
2405
|
+
* prompt projection are unchanged.
|
|
2406
|
+
*/
|
|
2407
|
+
declare const turnResponseBatch: (input: TurnCommitInput) => Effect.Effect<CanonicalBatch, DigestError | RunJournalError, Crypto.Crypto>;
|
|
2408
|
+
/**
|
|
2409
|
+
* Commit 5 of a tool-declaring Turn (plan §2.1): the Turn's `ToolCallSettled` records in
|
|
2410
|
+
* declaration order under batch identity `turn-results:{runId}:{turn}` — the batch becomes
|
|
2411
|
+
* model-visible atomically. Non-tool messages in `appended` are ignored; a Turn without any
|
|
2412
|
+
* terminal Tool result has no results batch and fails typed.
|
|
2413
|
+
*/
|
|
2414
|
+
declare const turnResultsBatch: (input: TurnCommitInput) => Effect.Effect<CanonicalBatch, DigestError | RunJournalError, Crypto.Crypto>;
|
|
2415
|
+
declare namespace SubmissionStatus_d_exports {
|
|
2416
|
+
export { PendingSubmission, SettledSubmission, SubmissionStatus };
|
|
2417
|
+
}
|
|
2418
|
+
declare const PendingSubmission_base: Schema.Class<PendingSubmission, Schema.TaggedStruct<"pending", {}>, {}>;
|
|
2419
|
+
/** A Submission still owes its canonical Settlement, including while suspended. */
|
|
2420
|
+
declare class PendingSubmission extends PendingSubmission_base {}
|
|
2421
|
+
declare const SettledSubmission_base: Schema.Class<SettledSubmission, Schema.TaggedStruct<"settled", {
|
|
2422
|
+
readonly settlement: typeof Settlement;
|
|
2423
|
+
}>, {}>;
|
|
2424
|
+
/** The existing durable Settlement is the only authority for completion. */
|
|
2425
|
+
declare class SettledSubmission extends SettledSubmission_base {}
|
|
2426
|
+
declare const SubmissionStatus: Schema.Union<readonly [typeof PendingSubmission, typeof SettledSubmission]>;
|
|
2427
|
+
type SubmissionStatus = typeof SubmissionStatus.Type;
|
|
2428
|
+
declare namespace ThreadStore_d_exports {
|
|
2429
|
+
export { AppendConflict, AppendResult, CheckpointRejected, FenceRejected, FencedAppendRequest, LoadCheckpointRequest, MAX_THREAD_EXPORT_RECORDS, SaveCheckpointRequest, SaveRecoveryCheckpointRequest, SelectedThreadRead, ThreadCheckpoint, ThreadCheckpoints, ThreadExport, ThreadExportRequest, ThreadMaterialization, ThreadNotMaterialized, ThreadObservation, ThreadOutstanding, ThreadOutstandingRequest, ThreadPeerCountRequest, ThreadRead, ThreadReadRequest, ThreadRecordRequest, ThreadRecoveryCheckpoints, ThreadRunInputRequest, ThreadSelection, ThreadStore, ThreadStoreDiagnostic, ThreadStoreError, ThreadStoreFailure, ThreadTail, ThreadTailRequest, ThreadWorkerStateRequest, getRecord, getRunInput, readOutstanding, readWorkerState };
|
|
2430
|
+
}
|
|
2431
|
+
declare const MAX_THREAD_EXPORT_RECORDS = 131072;
|
|
2432
|
+
/** Exact canonical identity; absence is not proof that an admission was never accepted. */
|
|
2433
|
+
declare const ThreadRecordRequest: Schema.Struct<{
|
|
2434
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2435
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
2436
|
+
}>;
|
|
2437
|
+
type ThreadRecordRequest = typeof ThreadRecordRequest.Type;
|
|
2438
|
+
/** The original user input for a Run, excluding later joined inputs. */
|
|
2439
|
+
declare const ThreadRunInputRequest: Schema.Struct<{
|
|
2440
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2441
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
2442
|
+
}>;
|
|
2443
|
+
type ThreadRunInputRequest = typeof ThreadRunInputRequest.Type;
|
|
2444
|
+
declare const ThreadOutstandingRequest: Schema.Struct<{
|
|
2445
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2446
|
+
/** Exceeding this bound fails; a truncated inventory never grants authority. */
|
|
2447
|
+
readonly limit: Schema.Int;
|
|
2448
|
+
}>;
|
|
2449
|
+
type ThreadOutstandingRequest = typeof ThreadOutstandingRequest.Type;
|
|
2450
|
+
interface ThreadOutstanding {
|
|
2451
|
+
readonly threadId: ThreadId;
|
|
2452
|
+
readonly throughSequence: CanonicalSequence;
|
|
2453
|
+
readonly complete: true;
|
|
2454
|
+
readonly operations: ReadonlyArray<{
|
|
2455
|
+
readonly submissionId: SubmissionId;
|
|
2456
|
+
readonly prepared: ToolCallPrepared;
|
|
2457
|
+
/** Prepared is not an unknown outcome or a grant to execute. */
|
|
2458
|
+
readonly state: "prepared" | "unknown";
|
|
2459
|
+
}>;
|
|
2460
|
+
/** Source reservations without proof that external effects are resolved. */
|
|
2461
|
+
readonly workerInputs: ReadonlyArray<WorkerInputRequested>;
|
|
2462
|
+
}
|
|
2463
|
+
/** Native worker reservation/accounting snapshot at a captured canonical tail. */
|
|
2464
|
+
declare const ThreadWorkerStateRequest: Schema.Struct<{
|
|
2465
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2466
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
2467
|
+
readonly limit: Schema.Int;
|
|
2468
|
+
}>;
|
|
2469
|
+
type ThreadWorkerStateRequest = typeof ThreadWorkerStateRequest.Type;
|
|
2470
|
+
/** Saturating lifetime peer-message count: the result is at most the requested cap. */
|
|
2471
|
+
declare const ThreadPeerCountRequest: Schema.Struct<{
|
|
2472
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2473
|
+
readonly limit: Schema.Int;
|
|
2474
|
+
}>;
|
|
2475
|
+
type ThreadPeerCountRequest = typeof ThreadPeerCountRequest.Type;
|
|
2476
|
+
/** Host-owned read: authenticate the Thread and exact locator before calling. */
|
|
2477
|
+
declare const getRecord: (request: {
|
|
2478
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2479
|
+
readonly recordId: string & import("effect/Brand").Brand<"@effect-agent/thread/RecordId">;
|
|
2480
|
+
}) => Effect.Effect<Option.Option<CanonicalRecordEnvelope>, ThreadNotMaterialized | ThreadStoreError, ThreadStore>;
|
|
2481
|
+
declare const getRunInput: (request: {
|
|
2482
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2483
|
+
readonly runId: string & import("effect/Brand").Brand<"@effect-agent/core/RunId">;
|
|
2484
|
+
}) => Effect.Effect<Option.Option<CanonicalRecordEnvelope>, ThreadNotMaterialized | ThreadStoreError, ThreadStore>;
|
|
2485
|
+
/** A bounded snapshot of native lifetime and source-submission worker accounting. */
|
|
2486
|
+
declare const readWorkerState: (request: {
|
|
2487
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2488
|
+
readonly sourceSubmissionId?: (string & import("effect/Brand").Brand<"@effect-agent/core/SubmissionId">) | undefined;
|
|
2489
|
+
readonly limit: number;
|
|
2490
|
+
}) => Effect.Effect<{
|
|
2491
|
+
threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2492
|
+
tailSequence: number & import("effect/Brand").Brand<"@effect-agent/thread/CanonicalSequence">;
|
|
2493
|
+
tailDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
|
|
2494
|
+
records: CanonicalRecordEnvelope[];
|
|
2495
|
+
}, ThreadNotMaterialized | ThreadStoreError, ThreadStore>;
|
|
2496
|
+
/**
|
|
2497
|
+
* Work is proportional to outstanding records, independent of completed history. Unknown
|
|
2498
|
+
* effects survive abort and resolution intent; only canonical closure removes them. A
|
|
2499
|
+
* preparation from another Run still requires native recovery before it can be treated as
|
|
2500
|
+
* safe. This snapshot grants no execution authority and does not freeze other owners.
|
|
2501
|
+
*/
|
|
2502
|
+
declare const readOutstanding: (request: {
|
|
2503
|
+
readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2504
|
+
readonly limit: number;
|
|
2505
|
+
}) => Effect.Effect<{
|
|
2506
|
+
threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
|
|
2507
|
+
throughSequence: number & import("effect/Brand").Brand<"@effect-agent/thread/CanonicalSequence">;
|
|
2508
|
+
complete: true;
|
|
2509
|
+
operations: {
|
|
2510
|
+
readonly submissionId: SubmissionId;
|
|
2511
|
+
readonly prepared: ToolCallPrepared;
|
|
2512
|
+
/** Prepared is not an unknown outcome or a grant to execute. */
|
|
2513
|
+
readonly state: "prepared" | "unknown";
|
|
2514
|
+
}[];
|
|
2515
|
+
workerInputs: WorkerInputRequested[];
|
|
2516
|
+
}, LedgerError | ThreadNotMaterialized | ThreadStoreError, SubmissionLedger | ThreadStore>;
|
|
2517
|
+
declare const ThreadMaterialization_base: Schema.Class<ThreadMaterialization, Schema.Struct<{
|
|
2518
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2519
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2520
|
+
}>, {}>;
|
|
2521
|
+
declare class ThreadMaterialization extends ThreadMaterialization_base {}
|
|
2522
|
+
declare const FencedAppendRequest_base: Schema.Class<FencedAppendRequest, Schema.Struct<{
|
|
2523
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2524
|
+
readonly batch: typeof CanonicalBatch;
|
|
2525
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2526
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2527
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2528
|
+
}>, {}>;
|
|
2529
|
+
declare class FencedAppendRequest extends FencedAppendRequest_base {}
|
|
2530
|
+
declare const AppendResult_base: Schema.Class<AppendResult, Schema.Struct<{
|
|
2531
|
+
readonly firstSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2532
|
+
readonly lastSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2533
|
+
readonly tailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2534
|
+
readonly replayed: Schema.Boolean;
|
|
2535
|
+
}>, {}>;
|
|
2536
|
+
declare class AppendResult extends AppendResult_base {}
|
|
2537
|
+
declare const ThreadRead_base: Schema.Class<ThreadRead, Schema.Struct<{
|
|
2538
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2539
|
+
readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2540
|
+
readonly limit: Schema.Natural;
|
|
2541
|
+
}>, {}>;
|
|
2542
|
+
declare class ThreadRead extends ThreadRead_base {}
|
|
2543
|
+
/** Closed native selections; mutable metadata is read at this exact canonical tail. */
|
|
2544
|
+
declare const ThreadSelection: Schema.Union<readonly [Schema.Struct<{
|
|
2545
|
+
readonly _tag: Schema.Literal<"RecordId">;
|
|
2546
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
2547
|
+
}>, Schema.Struct<{
|
|
2548
|
+
readonly _tag: Schema.Literal<"RunInput">;
|
|
2549
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
2550
|
+
}>, Schema.Struct<{
|
|
2551
|
+
readonly _tag: Schema.Literal<"Outstanding">;
|
|
2552
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2553
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2554
|
+
}>, Schema.Struct<{
|
|
2555
|
+
readonly _tag: Schema.Literal<"WorkerExecution">;
|
|
2556
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2557
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2558
|
+
}>, Schema.Struct<{
|
|
2559
|
+
readonly _tag: Schema.Literal<"WorkerState">;
|
|
2560
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2561
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2562
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
2563
|
+
}>]>;
|
|
2564
|
+
type ThreadSelection = typeof ThreadSelection.Type;
|
|
2565
|
+
/** Nested page makes an old ThreadRead decoder reject, never strip a selection into history. */
|
|
2566
|
+
declare const SelectedThreadRead: Schema.Struct<{
|
|
2567
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2568
|
+
readonly selection: Schema.Union<readonly [Schema.Struct<{
|
|
2569
|
+
readonly _tag: Schema.Literal<"RecordId">;
|
|
2570
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
2571
|
+
}>, Schema.Struct<{
|
|
2572
|
+
readonly _tag: Schema.Literal<"RunInput">;
|
|
2573
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
2574
|
+
}>, Schema.Struct<{
|
|
2575
|
+
readonly _tag: Schema.Literal<"Outstanding">;
|
|
2576
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2577
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2578
|
+
}>, Schema.Struct<{
|
|
2579
|
+
readonly _tag: Schema.Literal<"WorkerExecution">;
|
|
2580
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2581
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2582
|
+
}>, Schema.Struct<{
|
|
2583
|
+
readonly _tag: Schema.Literal<"WorkerState">;
|
|
2584
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2585
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2586
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
2587
|
+
}>]>;
|
|
2588
|
+
readonly page: Schema.Struct<{
|
|
2589
|
+
readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2590
|
+
readonly limit: Schema.Natural;
|
|
2591
|
+
}>;
|
|
2592
|
+
}>;
|
|
2593
|
+
type SelectedThreadRead = typeof SelectedThreadRead.Type;
|
|
2594
|
+
declare const ThreadReadRequest: Schema.Union<readonly [Schema.Struct<{
|
|
2595
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2596
|
+
readonly selection: Schema.Union<readonly [Schema.Struct<{
|
|
2597
|
+
readonly _tag: Schema.Literal<"RecordId">;
|
|
2598
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
2599
|
+
}>, Schema.Struct<{
|
|
2600
|
+
readonly _tag: Schema.Literal<"RunInput">;
|
|
2601
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
2602
|
+
}>, Schema.Struct<{
|
|
2603
|
+
readonly _tag: Schema.Literal<"Outstanding">;
|
|
2604
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2605
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2606
|
+
}>, Schema.Struct<{
|
|
2607
|
+
readonly _tag: Schema.Literal<"WorkerExecution">;
|
|
2608
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2609
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2610
|
+
}>, Schema.Struct<{
|
|
2611
|
+
readonly _tag: Schema.Literal<"WorkerState">;
|
|
2612
|
+
readonly expectedTailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2613
|
+
readonly expectedTailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2614
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
2615
|
+
}>]>;
|
|
2616
|
+
readonly page: Schema.Struct<{
|
|
2617
|
+
readonly afterSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2618
|
+
readonly limit: Schema.Natural;
|
|
2619
|
+
}>;
|
|
2620
|
+
}>, typeof ThreadRead]>;
|
|
2621
|
+
type ThreadReadRequest = typeof ThreadReadRequest.Type;
|
|
2622
|
+
declare const ThreadObservation_base: Schema.Class<ThreadObservation, Schema.Struct<{
|
|
2623
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2624
|
+
readonly afterOffset: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ObservationOffset">>;
|
|
2625
|
+
}>, {}>;
|
|
2626
|
+
declare class ThreadObservation extends ThreadObservation_base {}
|
|
2627
|
+
declare const ThreadExportRequest_base: Schema.Class<ThreadExportRequest, Schema.Struct<{
|
|
2628
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2629
|
+
}>, {}>;
|
|
2630
|
+
declare class ThreadExportRequest extends ThreadExportRequest_base {}
|
|
2631
|
+
declare const ThreadTailRequest_base: Schema.Class<ThreadTailRequest, Schema.Struct<{
|
|
2632
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2633
|
+
}>, {}>;
|
|
2634
|
+
declare class ThreadTailRequest extends ThreadTailRequest_base {}
|
|
2635
|
+
declare const ThreadTail_base: Schema.Class<ThreadTail, Schema.Struct<{
|
|
2636
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2637
|
+
readonly tailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2638
|
+
readonly tailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2639
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2640
|
+
}>, {}>;
|
|
2641
|
+
/**
|
|
2642
|
+
* The committed tail of one Thread Log. A resuming producer composes its next
|
|
2643
|
+
* FencedAppendRequest from this value instead of exporting the whole log.
|
|
2644
|
+
*/
|
|
2645
|
+
declare class ThreadTail extends ThreadTail_base {}
|
|
2646
|
+
declare const ThreadExport_base: Schema.Class<ThreadExport, Schema.Struct<{
|
|
2647
|
+
readonly format: Schema.Literal<"effect-agent/thread@1">;
|
|
2648
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2649
|
+
readonly tailSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2650
|
+
readonly tailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2651
|
+
readonly records: Schema.$Array<typeof CanonicalRecordEnvelope>;
|
|
2652
|
+
}>, {}>;
|
|
2653
|
+
/** Maximum canonical records represented by one Thread export. */
|
|
2654
|
+
declare class ThreadExport extends ThreadExport_base {}
|
|
2655
|
+
declare const ThreadCheckpoint_base: Schema.Class<ThreadCheckpoint, Schema.Struct<{
|
|
2656
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
2657
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2658
|
+
readonly throughSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
2659
|
+
readonly tailDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
2660
|
+
/** @deprecated For application projections; retained for existing data and runtime recovery. */
|
|
2661
|
+
readonly engineVersion: Schema.optionalKey<Schema.NonEmptyString>;
|
|
2662
|
+
/** @deprecated For application projections; retained for existing data and runtime recovery. */
|
|
2663
|
+
readonly agentDefinitionDigest: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
2664
|
+
/** @deprecated For application projections; retained for existing data and runtime recovery. */
|
|
2665
|
+
readonly modelDigest: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
2666
|
+
/** @deprecated For application projections; retained for existing data and runtime recovery. */
|
|
2667
|
+
readonly toolDigest: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
2668
|
+
readonly state: Schema.declare<Schema.Json, Schema.Json>;
|
|
2669
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
2670
|
+
}>, {}>;
|
|
2671
|
+
/**
|
|
2672
|
+
* A disposable projection snapshot. Adapters bind its sequence and digest to the canonical
|
|
2673
|
+
* log; consumers decode `state` and decide projection compatibility before suffix replay.
|
|
2674
|
+
* Legacy metadata is optional for application projections and preserved when supplied.
|
|
2675
|
+
* Runtime-owned recovery checkpoints populate and compare it before using cached state.
|
|
2676
|
+
*/
|
|
2677
|
+
declare class ThreadCheckpoint extends ThreadCheckpoint_base {}
|
|
2678
|
+
declare const SaveCheckpointRequest_base: Schema.Class<SaveCheckpointRequest, Schema.Struct<{
|
|
2679
|
+
readonly checkpoint: typeof ThreadCheckpoint;
|
|
2680
|
+
}>, {}>;
|
|
2681
|
+
declare class SaveCheckpointRequest extends SaveCheckpointRequest_base {}
|
|
2682
|
+
declare const SaveRecoveryCheckpointRequest_base: Schema.Class<SaveRecoveryCheckpointRequest, Schema.Struct<{
|
|
2683
|
+
readonly checkpoint: typeof ThreadCheckpoint;
|
|
2684
|
+
readonly producerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2685
|
+
}>, {}>;
|
|
2686
|
+
/** Replace the disposable recovery view only under the current canonical producer fence. */
|
|
2687
|
+
declare class SaveRecoveryCheckpointRequest extends SaveRecoveryCheckpointRequest_base {}
|
|
2688
|
+
declare const LoadCheckpointRequest_base: Schema.Class<LoadCheckpointRequest, Schema.Struct<{
|
|
2689
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2690
|
+
readonly atOrBeforeSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2691
|
+
}>, {}>;
|
|
2692
|
+
declare class LoadCheckpointRequest extends LoadCheckpointRequest_base {}
|
|
2693
|
+
declare const ThreadStoreDiagnostic_base: Schema.Class<ThreadStoreDiagnostic, Schema.Struct<{
|
|
2694
|
+
readonly causeTag: Schema.String;
|
|
2695
|
+
readonly operation: Schema.String;
|
|
2696
|
+
readonly decoder: Schema.optionalKey<Schema.String>;
|
|
2697
|
+
readonly issueTag: Schema.optionalKey<Schema.String>;
|
|
2698
|
+
readonly sequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2699
|
+
}>, {}>;
|
|
2700
|
+
/**
|
|
2701
|
+
* Content-free storage provenance constructed by adapters from source-authored labels.
|
|
2702
|
+
* Raw foreign lookalikes are not trusted diagnostics. Never include rejected values, SQL,
|
|
2703
|
+
* or schema messages.
|
|
2704
|
+
*/
|
|
2705
|
+
declare class ThreadStoreDiagnostic extends ThreadStoreDiagnostic_base {}
|
|
2706
|
+
declare const ThreadStoreError_base: Schema.Class<ThreadStoreError, Schema.TaggedStruct<"ThreadStoreError", {
|
|
2707
|
+
readonly operation: Schema.String;
|
|
2708
|
+
readonly message: Schema.String;
|
|
2709
|
+
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
2710
|
+
readonly diagnostic: Schema.optionalKey<typeof ThreadStoreDiagnostic>;
|
|
2711
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2712
|
+
declare class ThreadStoreError extends ThreadStoreError_base {}
|
|
2713
|
+
declare const ThreadNotMaterialized_base: Schema.Class<ThreadNotMaterialized, Schema.TaggedStruct<"ThreadNotMaterialized", {
|
|
2714
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2715
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2716
|
+
declare class ThreadNotMaterialized extends ThreadNotMaterialized_base {}
|
|
2717
|
+
declare const AppendConflict_base: Schema.Class<AppendConflict, Schema.TaggedStruct<"AppendConflict", {
|
|
2718
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2719
|
+
readonly batchId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/BatchId">;
|
|
2720
|
+
readonly reason: Schema.Literals<readonly ["batch-digest", "record-identity", "tail"]>;
|
|
2721
|
+
readonly actualTailSequence: Schema.optionalKey<Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">>;
|
|
2722
|
+
readonly actualTailDigest: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
2723
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2724
|
+
/**
|
|
2725
|
+
* A canonical append that cannot commit: `batch-digest` replays a batch ID with different
|
|
2726
|
+
* content, `record-identity` reuses a canonical record ID, and `tail` declares a stale expected
|
|
2727
|
+
* tail. Tail conflicts carry the actual committed tail as a diagnostic resume hint.
|
|
2728
|
+
*/
|
|
2729
|
+
declare class AppendConflict extends AppendConflict_base {}
|
|
2730
|
+
declare const FenceRejected_base: Schema.Class<FenceRejected, Schema.TaggedStruct<"FenceRejected", {
|
|
2731
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2732
|
+
readonly actualEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2733
|
+
readonly attemptedEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
2734
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2735
|
+
declare class FenceRejected extends FenceRejected_base {}
|
|
2736
|
+
declare const CheckpointRejected_base: Schema.Class<CheckpointRejected, Schema.TaggedStruct<"CheckpointRejected", {
|
|
2737
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2738
|
+
readonly reason: Schema.Literals<readonly ["ahead-of-tail", "digest-mismatch", "unsupported-version", "corrupt"]>;
|
|
2739
|
+
}>, import("effect/Cause").YieldableError>;
|
|
2740
|
+
declare class CheckpointRejected extends CheckpointRejected_base {}
|
|
2741
|
+
type ThreadStoreFailure = ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected;
|
|
2742
|
+
/**
|
|
2743
|
+
* Optional, disposable projection storage. Neither history execution nor durable recovery
|
|
2744
|
+
* requires it. Adapters that offer it must bind every checkpoint to a canonical batch tail.
|
|
2745
|
+
* Application consumers own projection compatibility; this port does not interpret metadata.
|
|
2746
|
+
*/
|
|
2747
|
+
interface ThreadCheckpoints {
|
|
2748
|
+
readonly save: (request: SaveCheckpointRequest) => Effect.Effect<void, ThreadStoreError | ThreadNotMaterialized | CheckpointRejected>;
|
|
2749
|
+
readonly load: (request: LoadCheckpointRequest) => Effect.Effect<Option.Option<ThreadCheckpoint>, ThreadStoreError | ThreadNotMaterialized | CheckpointRejected>;
|
|
2750
|
+
}
|
|
2751
|
+
/**
|
|
2752
|
+
* Optional latest-only recovery cache, independent of application projection checkpoints.
|
|
2753
|
+
* Saves atomically validate the producer epoch and canonical batch tail. An older snapshot
|
|
2754
|
+
* cannot replace a newer one; equal-tail replacement repairs disposable state. Invalid cached
|
|
2755
|
+
* data fails with CheckpointRejected, while infrastructure failures remain ThreadStoreError.
|
|
2756
|
+
* Loading at an earlier tail or outside the adapter's cache locality may return none so callers
|
|
2757
|
+
* can replay canonical records. Canonical records and the ledger remain authority.
|
|
2758
|
+
*/
|
|
2759
|
+
interface ThreadRecoveryCheckpoints {
|
|
2760
|
+
readonly save: (request: SaveRecoveryCheckpointRequest) => Effect.Effect<void, ThreadStoreError | ThreadNotMaterialized | CheckpointRejected | FenceRejected>;
|
|
2761
|
+
readonly load: ThreadCheckpoints["load"];
|
|
2762
|
+
}
|
|
2763
|
+
declare const ThreadStore_base: Context.ServiceClass<ThreadStore, "@effect-agent/thread/ThreadStore", {
|
|
2764
|
+
readonly materialize: (request: ThreadMaterialization) => Effect.Effect<void, ThreadStoreError | FenceRejected>;
|
|
2765
|
+
readonly append: (request: FencedAppendRequest) => Effect.Effect<AppendResult, ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected>;
|
|
2766
|
+
readonly read: (request: ThreadReadRequest) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;
|
|
2767
|
+
readonly observe: (request: ThreadObservation) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized>;
|
|
2768
|
+
readonly export: (request: ThreadExportRequest) => Effect.Effect<ThreadExport, ThreadStoreError | ThreadNotMaterialized>;
|
|
2769
|
+
readonly inspectTail: (request: ThreadTailRequest) => Effect.Effect<ThreadTail, ThreadStoreError | ThreadNotMaterialized>;
|
|
2770
|
+
/** Absent when this adapter does not support disposable checkpoints. */
|
|
2771
|
+
readonly checkpoints?: ThreadCheckpoints | undefined;
|
|
2772
|
+
readonly recoveryCheckpoints?: ThreadRecoveryCheckpoints | undefined;
|
|
2773
|
+
/** Indexed scalar count; unsupported adapters fail closed at the caller. */
|
|
2774
|
+
readonly countPeerMessages?: ((request: ThreadPeerCountRequest) => Effect.Effect<number, ThreadStoreError | ThreadNotMaterialized>) | undefined;
|
|
2775
|
+
}>;
|
|
2776
|
+
declare class ThreadStore extends ThreadStore_base {}
|
|
2777
|
+
declare namespace DurableAgentRuntime_d_exports {
|
|
2778
|
+
export { ApprovalSuspensionError, DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableApprovalSuspension, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepOptions, RecoverySweepResult, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
2779
|
+
}
|
|
2780
|
+
/**
|
|
2781
|
+
* Instruction failure/requirement derivation mirroring the engine's `RuntimeBinding` defaults:
|
|
2782
|
+
* declaring them as generic DEFAULTS (instead of independent inference sites) keeps a plain
|
|
2783
|
+
* string-returning instruction function from widening both parameters to `unknown`.
|
|
2784
|
+
*/
|
|
2785
|
+
type InstructionResultOf<Instructions, Input> = Instructions extends ((input: Input) => infer Result) ? Result : Instructions;
|
|
2786
|
+
type InstructionErrorOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer Error, infer _Requirements> ? Error : never;
|
|
2787
|
+
type InstructionRequirementsOf<Instructions, Input> = InstructionResultOf<Instructions, Input> extends Effect.Effect<infer _Success, infer _Error, infer Requirements> ? Requirements : never;
|
|
2788
|
+
/**
|
|
2789
|
+
* Deterministic parent-owned child budget reservation identity (spec
|
|
2790
|
+
* §12 step 2, D4): one reservation per (parent Run, parent Tool Call) pair,
|
|
2791
|
+
* so a replayed establishment converges on the one existing row (SUB-016).
|
|
2792
|
+
*/
|
|
2793
|
+
declare const childReservationIdFor: (runId: RunId, toolCallId: ToolCallId) => ChildReservationId;
|
|
2794
|
+
/** Deterministic batch identity of one Thread's initial `ThreadCreated` append. */
|
|
2795
|
+
declare const threadCreatedBatchId: (threadId: ThreadId) => BatchId;
|
|
2796
|
+
/** Deterministic record identity of one Thread's `ThreadCreated` record. */
|
|
2797
|
+
declare const threadCreatedRecordId: (threadId: ThreadId) => RecordId;
|
|
2798
|
+
/** Deterministic batch identity of one executed recovery decision's audit append (DUR-013). */
|
|
2799
|
+
declare const recoveryRepairBatchId: (submissionId: SubmissionId, decisionTag: string) => BatchId;
|
|
2800
|
+
/** Deterministic record identity of one executed recovery decision's `RepairAnnotated` record. */
|
|
2801
|
+
declare const recoveryRepairRecordId: (submissionId: SubmissionId, decisionTag: string) => RecordId;
|
|
2802
|
+
declare const RecoveryFailure_base: Schema.Class<RecoveryFailure, Schema.Struct<{
|
|
2803
|
+
readonly phase: Schema.Literals<readonly ["history", "recovery"]>;
|
|
2804
|
+
readonly reason: Schema.Literals<readonly ["failure", "defect", "timeout"]>;
|
|
2805
|
+
readonly errorTag: Schema.String;
|
|
2806
|
+
/** Static operation names only; error messages and payloads are deliberately excluded. */
|
|
2807
|
+
readonly operation: Schema.String;
|
|
2808
|
+
/** Ordered, bounded classifications. Foreign labels, operations and prose stay private. */
|
|
2809
|
+
readonly causes: Schema.$Array<Schema.Struct<{
|
|
2810
|
+
readonly errorTag: Schema.Literals<readonly ["AdmissionPolicyError", "DigestError", "LedgerError", "OwnershipLost", "SettlementConflict", "ThreadStoreError", "ThreadNotMaterialized", "AppendConflict", "FenceRejected", "RunJournalError", "DurableRuntimeFailpointError", "SchemaError", "Error", "TypeError", "RangeError", "ReferenceError", "SyntaxError", "URIError", "EvalError", "AggregateError", "ForeignError", "NonErrorCause"]>;
|
|
2811
|
+
}>>;
|
|
2812
|
+
readonly causesTruncated: Schema.optionalKey<Schema.Literal<true>>;
|
|
2813
|
+
readonly diagnostic: Schema.optionalKey<typeof ThreadStoreDiagnostic>;
|
|
2814
|
+
}>, {}>;
|
|
2815
|
+
/** Recovery could not establish execution authority. This is never a Settlement or replay grant. */
|
|
2816
|
+
declare class RecoveryFailure extends RecoveryFailure_base {}
|
|
2817
|
+
/** @internal One bounded failure boundary for execution history and host recovery control reads. */
|
|
2818
|
+
declare const isolateRecovery: <A, E extends DurableWorkerFailure, R>(body: Effect.Effect<A, E, R>, options: {
|
|
2819
|
+
readonly timeout: Duration.Duration;
|
|
2820
|
+
readonly phase: () => RecoveryFailure["phase"];
|
|
2821
|
+
readonly operation?: string;
|
|
2822
|
+
}) => Effect.Effect<Result.Result<A, RecoveryFailure>, E, Exclude<R, Scope.Scope>>;
|
|
2823
|
+
declare const RecoveryBlocked_base: Schema.Class<RecoveryBlocked, Schema.TaggedStruct<"RecoveryBlocked", {
|
|
2824
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2825
|
+
readonly failure: typeof RecoveryFailure;
|
|
2826
|
+
}>, Cause.YieldableError>;
|
|
2827
|
+
/** One failed Thread remains pending; the host must not claim it before recovery succeeds. */
|
|
2828
|
+
declare class RecoveryBlocked extends RecoveryBlocked_base {}
|
|
2829
|
+
declare const RecoveryReport_base: Schema.Class<RecoveryReport, Schema.Struct<{
|
|
2830
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
2831
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
2832
|
+
readonly decision: Schema.Union<readonly [typeof CompleteMaterialization, typeof RepairReadiness, typeof ApplyInput, typeof RepairInputMarker, typeof ResumeFromTurnBoundary, typeof AppendReservedSettlement, typeof FinalizeLedgerFromHistory, typeof SettleAborted, typeof MarkUnknown, typeof ResumePendingToolBatch, typeof AwaitApprovalDecision, typeof ResumeSuspended, typeof AwaitUnknownResolution, typeof ApplyUnknownResolutions, typeof RevertJoining, typeof RepairJoinMarker, typeof SettleJoinedWithHost, typeof AwaitHostSettlement, typeof CompleteChildAdmission, typeof AwaitChildAdmissionResolution, typeof RepairSubagentStartLink, typeof EnsureWaitingForChild, typeof AwaitChildSettlement, typeof ResumeWaitingParent, typeof ApplyJoinAccounting, typeof PropagateChildAbort, typeof ReleaseOrphanChildReservation, typeof AwaitParentEstablishment, typeof NoAction]>;
|
|
2833
|
+
/**
|
|
2834
|
+
* `repaired` = executed; `deferred` = a claiming worker must finish it; `none` = settled;
|
|
2835
|
+
* `unknown` = this Submission is parked on an Unknown Outcome awaiting the authorized
|
|
2836
|
+
* DUR-017 resolution path — the settlement obligation stays visible while no worker permit
|
|
2837
|
+
* is consumed (durability §16).
|
|
2838
|
+
*/
|
|
2839
|
+
readonly disposition: Schema.Literals<readonly ["repaired", "deferred", "none", "unknown"]>;
|
|
2840
|
+
}>, {}>;
|
|
2841
|
+
/** One executed (or deliberately deferred) recovery decision (durability §14, DUR-013). */
|
|
2842
|
+
declare class RecoveryReport extends RecoveryReport_base {}
|
|
2843
|
+
declare const RecoverySweepResult_base: Schema.Class<RecoverySweepResult, Schema.Struct<{
|
|
2844
|
+
readonly reports: Schema.$Array<typeof RecoveryReport>;
|
|
2845
|
+
/** Exactly one fault per failed Thread, regardless of its queued Submission count. */
|
|
2846
|
+
readonly blocked: Schema.$Array<typeof RecoveryBlocked>;
|
|
2847
|
+
}>, {}>;
|
|
2848
|
+
/** Submission decisions and operational faults have different ownership and settlement semantics. */
|
|
2849
|
+
declare class RecoverySweepResult extends RecoverySweepResult_base {}
|
|
2850
|
+
/** Select one Thread before reading history, or omit to recover every pending Thread. */
|
|
2851
|
+
interface RecoverySweepOptions {
|
|
2852
|
+
readonly threadId?: ThreadId;
|
|
2853
|
+
}
|
|
2854
|
+
/** Per-submission options accepted by `DurableAgentRuntime.submit` (D2). */
|
|
2855
|
+
interface DurableSubmitOptions {
|
|
2856
|
+
readonly threadId: ThreadId;
|
|
2857
|
+
readonly principal: Principal;
|
|
2858
|
+
readonly idempotencyKey: IdempotencyKey;
|
|
2859
|
+
readonly admissionGroup?: string;
|
|
2860
|
+
readonly admissionFence?: AdmissionFence;
|
|
2861
|
+
/** Host-prepared worker input; immutable origin and per-input projection parameters. */
|
|
2862
|
+
readonly workerAdmission?: WorkerAdmission;
|
|
2863
|
+
/** Peer provenance or a worker completion, verified against frozen canonical delivery proof. */
|
|
2864
|
+
readonly messageAdmission?: InputMessage;
|
|
2865
|
+
/** Application-computed digests of the Agent/Model/Toolkit definitions (see `digestDefinitions`). */
|
|
2866
|
+
readonly definitions: DefinitionDigests;
|
|
2867
|
+
}
|
|
2868
|
+
interface DurableObserveOptions {
|
|
2869
|
+
/** Resume the observation after an adapter-owned offset previously returned by `observe`. */
|
|
2870
|
+
readonly after?: CanonicalRecordEnvelope["offset"] | undefined;
|
|
2871
|
+
}
|
|
2872
|
+
/** The structural slice of an Agent Binding that `submit` needs. */
|
|
2873
|
+
interface DurableSubmitAgent<InputSchema extends Schema.Top> {
|
|
2874
|
+
readonly definition: {
|
|
2875
|
+
readonly id: AgentId;
|
|
2876
|
+
readonly input: InputSchema;
|
|
2877
|
+
};
|
|
2878
|
+
}
|
|
2879
|
+
type DurableSubmitFailure = AgentInputError | DigestError | AdmissionConflict | AdmissionPolicyError | LedgerError | ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected | DurableRuntimeFailpointError;
|
|
2880
|
+
declare const ApprovalSuspensionError_base: Schema.Class<ApprovalSuspensionError, Schema.TaggedStruct<"ApprovalSuspensionError", {
|
|
2881
|
+
readonly cause: Schema.Defect;
|
|
2882
|
+
}>, Cause.YieldableError>;
|
|
2883
|
+
/** Attempt resources could not be retained before deliberate approval suspension. */
|
|
2884
|
+
declare class ApprovalSuspensionError extends ApprovalSuspensionError_base {}
|
|
2885
|
+
type DurableWorkerFailure = AdmissionPolicyError | ApprovalSuspensionError | DigestError | LedgerError | OwnershipLost | SettlementConflict | ThreadStoreError | ThreadNotMaterialized | AppendConflict | FenceRejected | RunJournalError | DurableRuntimeFailpointError;
|
|
2886
|
+
type DurableAwaitFailure = LedgerError | SettlementConflict | OperationDenied;
|
|
2887
|
+
/** Typed failures from the public canonical progress boundary. */
|
|
2888
|
+
type DurableProgressFailure = ThreadStoreError | ThreadNotMaterialized | OperationDenied;
|
|
2889
|
+
type DurableAbortFailure = OperationDenied | LedgerError | SettlementConflict | JoinedToHost | DurableRuntimeFailpointError;
|
|
2890
|
+
/**
|
|
2891
|
+
* Failure family of `resolveUnknown` (DUR-017, abort-shaped): the durable intent may conflict
|
|
2892
|
+
* with a divergent prior resolution, the Submission may already be settled, an `AbortSubmission`
|
|
2893
|
+
* resolution routes through the abort path (whose `JoinedToHost` conflict stays visible), and the
|
|
2894
|
+
* failpoint after the intent write is armable like every other durable mutation.
|
|
2895
|
+
*/
|
|
2896
|
+
type DurableResolveFailure = LedgerError | SettlementConflict | UnknownResolutionConflict | JoinedToHost | DurableRuntimeFailpointError;
|
|
2897
|
+
/**
|
|
2898
|
+
* Failure family of `resolveApproval` (plan §2.6, abort-shaped): the durable intent may conflict
|
|
2899
|
+
* with a divergent prior decision, and the Submission may already be settled. The ledger adapter
|
|
2900
|
+
* owns the crash boundaries of the intent write (`ledger:approval-decision:{before,after}`).
|
|
2901
|
+
*/
|
|
2902
|
+
type DurableApprovalFailure = LedgerError | SettlementConflict | ApprovalConflict;
|
|
2903
|
+
/**
|
|
2904
|
+
* Failure family of the read-only `explain`/`explainThread` operations (P7 WP1): pure
|
|
2905
|
+
* observation over the two ports plus the evidence assembler's typed failures, and the
|
|
2906
|
+
* fail-closed `OperationDenied` when a host-supplied authorizer refuses.
|
|
2907
|
+
*/
|
|
2908
|
+
type DurableExplainFailure = LedgerError | ThreadStoreError | RunJournalError | OperationDenied;
|
|
2909
|
+
/**
|
|
2910
|
+
* Failure family of the read-only `verify` operation (P7 WP1). `ThreadNotMaterialized`
|
|
2911
|
+
* stays visible: verifying a Thread that does not exist is a caller error, not an empty
|
|
2912
|
+
* report.
|
|
2913
|
+
*/
|
|
2914
|
+
type DurableVerifyFailure = LedgerError | ThreadStoreError | ThreadNotMaterialized | OperationDenied;
|
|
2915
|
+
/**
|
|
2916
|
+
* Failure family of `retry` (P7 WP1): the scoped recovery execution carries the worker failure
|
|
2917
|
+
* family, refusals are typed (`RetryRefused` — settled work and lanes owned by the
|
|
2918
|
+
* resolveUnknown/resolveApproval paths), and denial is fail-closed.
|
|
2919
|
+
*/
|
|
2920
|
+
type DurableRetryFailure = DurableWorkerFailure | RetryRefused | OperationDenied;
|
|
2921
|
+
/** Failure family of `scanObligations` (P7 WP1): ledger scan + canonical unknown-age reads. */
|
|
2922
|
+
type DurableObligationFailure = LedgerError | ThreadStoreError | OperationDenied;
|
|
2923
|
+
/**
|
|
2924
|
+
* Optional policy-auto approval delegate consulted by the durable approval hook (plan §2.6 step
|
|
2925
|
+
* 2) AFTER the recorded-decision lookup misses. An immediate `approved`/`denied` answer becomes
|
|
2926
|
+
* canonical (`ToolApprovalRequested` + `ToolApprovalDecided`, one atomic batch) before it is
|
|
2927
|
+
* honored; `unresolved` falls through to the durable suspension path. The default (`undefined`)
|
|
2928
|
+
* suspends every undecided approval durably until `resolveApproval` decides it — the fail-closed
|
|
2929
|
+
* posture. Adapt the P2 `ApprovalResolver` capability stack through
|
|
2930
|
+
* `@effect-agent/capabilities`' `toDurableRunApprovalHook`.
|
|
2931
|
+
*/
|
|
2932
|
+
declare const DurableApprovalResolver: Context.Reference<RunApprovalHook<never, never> | undefined>;
|
|
2933
|
+
/**
|
|
2934
|
+
* Optional attempt-local retention before an unresolved approval releases ownership. Supply
|
|
2935
|
+
* this from the Attempt's Layer, capturing its live resources. The canonical approval request
|
|
2936
|
+
* already exists; claim renewal and abort observation remain active while this operation runs.
|
|
2937
|
+
* Return only after retention is confirmed. Failure leaves the accepted work owed and preserves
|
|
2938
|
+
* its cause; interruption keeps normal resource cleanup. No approval-gated Tool runs here.
|
|
2939
|
+
*
|
|
2940
|
+
* A decision racing with successful retention resumes the pending batch in a fresh Attempt,
|
|
2941
|
+
* after the old services and claim finalize. The default leaves existing suspension unchanged.
|
|
2942
|
+
*/
|
|
2943
|
+
declare const DurableApprovalSuspension: Context.Reference<Effect.Effect<void, ApprovalSuspensionError> | undefined>;
|
|
2944
|
+
/**
|
|
2945
|
+
* Services a durable worker needs beyond the runtime's own Layer: the Agent Binding's inferred
|
|
2946
|
+
* requirements minus its supplied identity and history services. The coordinator provides
|
|
2947
|
+
* deterministic Run/Turn identity and journal-owned history because its coordinator owns all
|
|
2948
|
+
* durable reads and commits across Attempts.
|
|
2949
|
+
*/
|
|
2950
|
+
type DurableWorkerRequirements<AgentValue extends Any, InstructionRequirements = never> = Exclude<AgentRuntimeRequirements<AgentValue, never, InstructionRequirements>, ThreadHistory | RunContextPreparation> | AgentCompletionProjectionRequirements<AgentValue>;
|
|
2951
|
+
interface DurableRuntimeConfigOptions {
|
|
2952
|
+
/**
|
|
2953
|
+
* Deployment identity and the conservative operation version for direct execution without
|
|
2954
|
+
* a registered binding. Reuse asserts unchanged handler, Step, and idempotency semantics.
|
|
2955
|
+
*/
|
|
2956
|
+
readonly deploymentId: DeploymentId;
|
|
2957
|
+
readonly producerId: ProducerId;
|
|
2958
|
+
/** `awaitSettlement` ledger re-check cadence when no wake arrives (default 500ms). */
|
|
2959
|
+
readonly settlementPollInterval?: Duration.Duration | undefined;
|
|
2960
|
+
/** Worker ownership-lease renewal cadence (default 10s; D5 lease default is 30s). */
|
|
2961
|
+
readonly leaseRenewalInterval?: Duration.Duration | undefined;
|
|
2962
|
+
/** Active-Run abort-intent poll cadence (default 500ms). */
|
|
2963
|
+
readonly abortPollInterval?: Duration.Duration | undefined;
|
|
2964
|
+
/** Cooperative bound for one Thread's recovery, including child reads (default 30s). */
|
|
2965
|
+
readonly recoveryTimeout?: Duration.Duration | undefined;
|
|
2966
|
+
/** Deployment-owned model pricing authority, captured for every recoverable Run. */
|
|
2967
|
+
readonly estimateCostMicrousd?: RunCostEstimator | undefined;
|
|
2968
|
+
}
|
|
2969
|
+
declare const DurableRuntimeConfig_base: Context.ServiceClass<DurableRuntimeConfig, "@effect-agent/thread/DurableRuntimeConfig", {
|
|
2970
|
+
readonly deploymentId: DeploymentId;
|
|
2971
|
+
readonly producerId: ProducerId;
|
|
2972
|
+
readonly settlementPollInterval: Duration.Duration;
|
|
2973
|
+
readonly leaseRenewalInterval: Duration.Duration;
|
|
2974
|
+
readonly abortPollInterval: Duration.Duration;
|
|
2975
|
+
readonly recoveryTimeout: Duration.Duration;
|
|
2976
|
+
readonly estimateCostMicrousd?: RunCostEstimator | undefined;
|
|
2977
|
+
}>;
|
|
2978
|
+
/** Deployment-scoped identity and liveness cadences for the durable coordinator. */
|
|
2979
|
+
declare class DurableRuntimeConfig extends DurableRuntimeConfig_base {
|
|
2980
|
+
static make(options: DurableRuntimeConfigOptions): (typeof DurableRuntimeConfig)["Service"];
|
|
2981
|
+
static layer(options: DurableRuntimeConfigOptions): Layer.Layer<DurableRuntimeConfig>;
|
|
2982
|
+
}
|
|
2983
|
+
declare const DurableAgentRuntime_base: Context.ServiceClass<DurableAgentRuntime, "@effect-agent/thread/DurableAgentRuntime", {
|
|
2984
|
+
/** Acquire an authenticated source Thread facet; its References confer no authority. */
|
|
2985
|
+
readonly workerHost: (request: {
|
|
2986
|
+
readonly sourceThreadId: ThreadId;
|
|
2987
|
+
readonly principal: Principal;
|
|
2988
|
+
/** Exact retained owner input for captured source policy; never selects the latest input. */
|
|
2989
|
+
readonly sourceSubmissionId?: SubmissionId;
|
|
2990
|
+
}) => Effect.Effect<SubagentHost["Service"], WorkerError>;
|
|
2991
|
+
readonly messagingHost: (request: {
|
|
2992
|
+
readonly sourceThreadId: ThreadId;
|
|
2993
|
+
readonly principal: Principal;
|
|
2994
|
+
}) => Effect.Effect<MessagingHost["Service"], MessagingError>;
|
|
2995
|
+
/** Admit the exact registered Definition instance; reject missing, ambiguous, or different definitions. */
|
|
2996
|
+
readonly submitRegistered: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: Omit<DurableSubmitOptions, "definitions">) => Effect.Effect<Receipt, DurableSubmitFailure | BindingUnavailable, InputSchema["EncodingServices"]>;
|
|
2997
|
+
/** Authorized exact canonical terminal record, including the encoded output. Reject pending work. */
|
|
2998
|
+
readonly settlementRecord: (receipt: Receipt) => Effect.Effect<SubmissionSettledRecord, DurableAwaitFailure>;
|
|
2999
|
+
readonly submit: <InputSchema extends Schema.Top>(agent: DurableSubmitAgent<InputSchema>, input: InputSchema["Type"], options: DurableSubmitOptions) => Effect.Effect<Receipt, DurableSubmitFailure, InputSchema["EncodingServices"]>;
|
|
3000
|
+
readonly awaitSettlement: (receipt: Receipt) => Effect.Effect<Settlement, DurableAwaitFailure>;
|
|
3001
|
+
/** Authorized, nonblocking read. Only the durable Settlement marks work complete. */
|
|
3002
|
+
readonly submissionStatus: (receipt: Receipt) => Effect.Effect<SubmissionStatus, DurableAwaitFailure>;
|
|
3003
|
+
/**
|
|
3004
|
+
* Trusted worker inspection under the same runtime authority as processThread/recoverSubmission.
|
|
3005
|
+
* Caller-facing observations must use submissionStatus or awaitSettlement for authorization.
|
|
3006
|
+
*/
|
|
3007
|
+
readonly inspectSubmissionStatus: (receipt: Receipt) => Effect.Effect<SubmissionStatus, DurableAwaitFailure>;
|
|
3008
|
+
/**
|
|
3009
|
+
* Wait for an already-committed record or one incarnation-local progress hint after
|
|
3010
|
+
* `afterSequence`. Canonical records remain authoritative: callers re-read after return.
|
|
3011
|
+
*/
|
|
3012
|
+
readonly awaitProgress: (threadId: ThreadId, afterSequence: CanonicalSequence) => Effect.Effect<void, DurableProgressFailure>;
|
|
3013
|
+
readonly observe: (receipt: Receipt, options?: DurableObserveOptions) => Stream.Stream<CanonicalRecordEnvelope, ThreadStoreError | ThreadNotMaterialized | OperationDenied>;
|
|
3014
|
+
readonly abort: (command: AbortCommand) => Effect.Effect<AbortIntent, DurableAbortFailure>;
|
|
3015
|
+
readonly resolveUnknown: (command: UnknownResolutionCommand) => Effect.Effect<UnknownResolutionIntent, DurableResolveFailure | OperationDenied>;
|
|
3016
|
+
readonly resolveApproval: (command: ApprovalDecisionCommand) => Effect.Effect<ApprovalDecisionIntent, DurableApprovalFailure | OperationDenied>;
|
|
3017
|
+
/**
|
|
3018
|
+
* Read-only recovery explanation of one Submission (P7 plan §3): snapshot + tolerant
|
|
3019
|
+
* canonical read + the pure classifier, packaged with the decision's operator meaning and
|
|
3020
|
+
* predicted disposition. Performs ZERO writes — the canonical log and every ledger row are
|
|
3021
|
+
* byte-identical before and after.
|
|
3022
|
+
*/
|
|
3023
|
+
readonly explain: (submissionId: SubmissionId) => Effect.Effect<RecoveryExplanation, DurableExplainFailure>;
|
|
3024
|
+
/** `explain` for every nonterminal lane member of one Thread, in queue order. */
|
|
3025
|
+
readonly explainThread: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<RecoveryExplanation>, DurableExplainFailure>;
|
|
3026
|
+
/**
|
|
3027
|
+
* Read-only integrity verification of one Thread (P7 plan §3): Schema round-trips,
|
|
3028
|
+
* record-identity uniqueness, sequence contiguity, FIFO input/settlement order,
|
|
3029
|
+
* ledger-terminal vs canonical-settlement agreement (DUR-015), and checkpoint binding —
|
|
3030
|
+
* typed per-check results, never a repair. The digest-chain check reports `skipped` with
|
|
3031
|
+
* the honest reason: full chain recomputation needs per-batch producer identity, which the
|
|
3032
|
+
* ThreadStore port deliberately does not export (supply it to
|
|
3033
|
+
* `verifyThreadInvariants` directly; adapter-level `verifyOnOpen` is the
|
|
3034
|
+
* storage-side audit).
|
|
3035
|
+
*/
|
|
3036
|
+
readonly verify: (threadId: ThreadId) => Effect.Effect<IntegrityReport, DurableVerifyFailure>;
|
|
3037
|
+
/**
|
|
3038
|
+
* Safe re-drive of one Submission's recovery decision with mandatory author/reason audit
|
|
3039
|
+
* (SEC-011): executes exactly the repair the classifier names; owned repair attempts
|
|
3040
|
+
* append a best-effort `RepairAnnotated` with their actual claim epoch (DUR-013). Typed `RetryRefused`
|
|
3041
|
+
* for settled work and for lanes owned by the resolveUnknown/resolveApproval paths.
|
|
3042
|
+
*/
|
|
3043
|
+
readonly retry: (command: RetryCommand) => Effect.Effect<RecoveryReport, DurableRetryFailure>;
|
|
3044
|
+
/** The documented operator liveness nudge: a droppable wake hint for one lane. */
|
|
3045
|
+
readonly wake: (threadId: ThreadId) => Effect.Effect<void, OperationDenied>;
|
|
3046
|
+
/**
|
|
3047
|
+
* Scan-based DUR-017/OPS-001 obligation report: every nonterminal Submission with what it
|
|
3048
|
+
* is visibly blocked on, its age, and a threshold-classified severity. Never a daemon —
|
|
3049
|
+
* hosts run it periodically and own the alert loop (OPS-002).
|
|
3050
|
+
*/
|
|
3051
|
+
readonly scanObligations: (thresholds: ObligationThresholds) => Effect.Effect<ObligationReport, DurableObligationFailure>;
|
|
3052
|
+
readonly processThread: <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>(agent: RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, threadId: ThreadId) => Effect.Effect<ReadonlyArray<Settlement>, DurableWorkerFailure | DurableBindingFailure, DurableWorkerRequirements<RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, InstructionRequirements>>;
|
|
3053
|
+
readonly processThreadResolved: (threadId: ThreadId) => Effect.Effect<ReadonlyArray<Settlement>, DurableWorkerFailure | DurableBindingFailure>;
|
|
3054
|
+
/**
|
|
3055
|
+
* Advance the FIFO head, closing its Attempt resources before returning. A vacant,
|
|
3056
|
+
* owned, unknown, or suspended head returns None and leaves accepted work pending.
|
|
3057
|
+
* Ready input may join this Run through the existing Turn seams and settle with its head.
|
|
3058
|
+
* Interruption ends only this Attempt; ownership cleanup uses its latest renewed token.
|
|
3059
|
+
* A trusted host may supply `yieldAfter` to return None before the next Turn's context
|
|
3060
|
+
* preparation, committing any completed Turn first. This releases ownership without settling or resetting the durable
|
|
3061
|
+
* Run deadline. It is a cooperative scheduling deadline, not a hard interruption timeout.
|
|
3062
|
+
*/
|
|
3063
|
+
readonly processThreadHead: (threadId: ThreadId, options?: {
|
|
3064
|
+
readonly yieldAfter?: DateTime.Utc;
|
|
3065
|
+
}) => Effect.Effect<Option.Option<Settlement>, DurableWorkerFailure | DurableBindingFailure>;
|
|
3066
|
+
readonly runWorker: <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>(agent: RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>) => Effect.Effect<void, DurableWorkerFailure | DurableBindingFailure, DurableWorkerRequirements<RuntimeBinding<InputSchema, OutputSchema, Instructions, Tools, Provider, ModelProvides, ModelRequires, InstructionError, InstructionRequirements, RunDispositionValue, InputPromptValue, UpdatesSchema>, InstructionRequirements>>;
|
|
3067
|
+
readonly runResolvedWorker: Effect.Effect<void, DurableWorkerFailure | DurableBindingFailure>;
|
|
3068
|
+
/**
|
|
3069
|
+
* Recover each pending Thread independently. History/child failures, defects and the
|
|
3070
|
+
* configured timeout return one RecoveryBlocked per Thread; hosts must retain visibility
|
|
3071
|
+
* outside execution history and exclude those Threads from claims. Ledger scan failures,
|
|
3072
|
+
* owner interruption and injected crash boundaries still fail the whole sweep.
|
|
3073
|
+
* Optional Thread selection lets a host recover its selected dispatch lane independently
|
|
3074
|
+
* of old cleanup. Unselected Threads are neither read nor reported by this call.
|
|
3075
|
+
*/
|
|
3076
|
+
readonly runRecovery: (options?: RecoverySweepOptions) => Effect.Effect<RecoverySweepResult, DurableWorkerFailure>;
|
|
3077
|
+
/** Apply one recovery decision; untouched ready input is deferred to its worker claim. */
|
|
3078
|
+
readonly recoverSubmission: (submissionId: SubmissionId) => Effect.Effect<RecoveryReport, DurableWorkerFailure>;
|
|
3079
|
+
}>;
|
|
3080
|
+
/**
|
|
3081
|
+
* Durable Agent Runtime coordinator (deployment class DN; D1/D2). It coordinates the
|
|
3082
|
+
* SubmissionLedger, ThreadStore, and WakeScheduler ports so that once `submit` returns a
|
|
3083
|
+
* Receipt, the Submission settles exactly once (DUR-001/DUR-002) while every external effect
|
|
3084
|
+
* remains at-least-once (DUR-003) — this runtime never claims exactly-once side effects.
|
|
3085
|
+
*
|
|
3086
|
+
* - `submit(agent, input, options)` — durable admission → Thread materialization →
|
|
3087
|
+
* `ThreadCreated` → readiness → Receipt, with failpoints between the steps; a retry with
|
|
3088
|
+
* the same (thread, principal, idempotencyKey) resumes and returns the same Receipt.
|
|
3089
|
+
* - `awaitSettlement(receipt)` — authorized once before the first ledger read, for the lifetime
|
|
3090
|
+
* of this wait; interrupting it detaches the caller only and never cancels accepted work.
|
|
3091
|
+
* - `observe(receipt, {after})` — canonical record observation from a stored offset.
|
|
3092
|
+
* - `abort(command)` — authorized before ledger access; durable idempotent abort intent; inactive work settles aborted through
|
|
3093
|
+
* recovery, an active worker makes the command canonical before interrupting its Run (§13),
|
|
3094
|
+
* settled work fails with `SettlementConflict` (DUR-012). A `joined` Submission fails with a
|
|
3095
|
+
* typed `JoinedToHost` conflict carrying the host identity — it settles with its host, so the
|
|
3096
|
+
* abort target is the host; aborting a `joining` Submission records the intent, honored only
|
|
3097
|
+
* if the host has not consumed the input (revert-then-abort, plan §2.5).
|
|
3098
|
+
* - `resolveUnknown(command)` — the authorized DUR-017 resolution path for Unknown Outcomes:
|
|
3099
|
+
* the durable intent is idempotent per (submission, tool call) and conflicts typed on
|
|
3100
|
+
* divergence; the canonical resolution records are applied by recovery or the next Attempt,
|
|
3101
|
+
* and the lane wakes once every marked call is covered.
|
|
3102
|
+
* - `resolveApproval(command)` — the durable approval decision path (plan §2.6): the intent is
|
|
3103
|
+
* idempotent per (submission, tool call) with a typed `ApprovalConflict` on divergence; once
|
|
3104
|
+
* every pending call of the suspension reason is decided the lane wakes
|
|
3105
|
+
* (`suspended → input-applied`) and the next Attempt resumes the declared batch without model
|
|
3106
|
+
* re-invocation, appending the canonical `ToolApprovalDecided` before honoring the decision.
|
|
3107
|
+
* - `processThread(agent, threadId)` — drain one lane: fenced FIFO-head claims,
|
|
3108
|
+
* canonical input apply, split response/prepared/results Turn commits (plan §2.1),
|
|
3109
|
+
* reconcile-then-mark for open ordinary Tool Calls (DUR-009, never an automatic replay),
|
|
3110
|
+
* declared-batch resume without model re-invocation (§15), and terminalization. An active
|
|
3111
|
+
* host Run claims the contiguous ready prefix of later queued Submissions at every safe Turn
|
|
3112
|
+
* seam (Joining/Joined, plan §2.5): the queued input becomes canonical (`input:{sid}`) before
|
|
3113
|
+
* the next model request, reattaches through the prompt-coverage rule after a crash, and the
|
|
3114
|
+
* joined Submissions settle with the host outcome (DUR-002/DUR-016).
|
|
3115
|
+
* - `runWorker(agent)` — scan-seeded, wake-driven worker loop over every lane (WP4's host driver),
|
|
3116
|
+
* over a singleton current Binding: a claimed head belonging to a different Agent never
|
|
3117
|
+
* runs against this binding. Missing bindings leave accepted roots and children owed.
|
|
3118
|
+
* - `processThreadResolved(threadId)` / `runResolvedWorker` — the
|
|
3119
|
+
* equivalents over registrations owned by the runtime Layer: each stable `agentId` selects
|
|
3120
|
+
* one current Binding. Unfinished operation contracts gate handler execution independently
|
|
3121
|
+
* of immutable admission evidence; missing bindings release the claim with a typed refusal.
|
|
3122
|
+
* - `runRecovery()` — classify every nonterminal Submission with the pure `classifyRecovery` and
|
|
3123
|
+
* execute repair decisions, annotating owned repair attempts with their granted epochs
|
|
3124
|
+
* (DUR-013). Untouched ready input and model-resuming work are reported `deferred` for a
|
|
3125
|
+
* worker claim; Submissions parked on
|
|
3126
|
+
* Unknown Outcomes are reported `unknown`. The S2 binding-free Subagent executors (admission
|
|
3127
|
+
* completion, start-link repair, waiting restoration, wake replay, canonical join accounting,
|
|
3128
|
+
* abort propagation, orphan reservation release) run here; the settlement join itself is
|
|
3129
|
+
* deferred to a claiming worker because it needs the parent Binding's result projection.
|
|
3130
|
+
* - `explain`/`explainThread`, `verify`, `retry`, `wake`, `scanObligations` — the P7
|
|
3131
|
+
* administrative operations (plan §3) over the same two ports, identical on DN and DC.
|
|
3132
|
+
* `explain` and `verify` are strictly read-only; `retry` re-drives exactly one classified
|
|
3133
|
+
* repair with mandatory author/reason audit and typed refusals; `scanObligations` is the
|
|
3134
|
+
* scan-based DUR-017/OPS-001 obligation surface. Every one of them (plus `observe`,
|
|
3135
|
+
* `resolveUnknown`, `resolveApproval`) consults the `OperationAuthorizer` reference
|
|
3136
|
+
* fail-closed — the default Layer preserves the service-possession behavior, and a
|
|
3137
|
+
* host-supplied authorizer turns denials into the typed `OperationDenied`.
|
|
3138
|
+
*/
|
|
3139
|
+
declare class DurableAgentRuntime extends DurableAgentRuntime_base {
|
|
3140
|
+
/**
|
|
3141
|
+
* Resolve typed registrations and capture their services once in the runtime's Layer Scope.
|
|
3142
|
+
* Every claimed head must match an exact registered identity and digest triple. Worker calls
|
|
3143
|
+
* cannot replace these registrations or their captured services. Tool authorization is required.
|
|
3144
|
+
*/
|
|
3145
|
+
static layerRegistered<const Entries extends ReadonlyArray<AgentRegistration>>(registrations: Entries): Layer.Layer<DurableAgentRuntime, DigestError, Crypto.Crypto | DurableRuntimeConfig | DurableRuntimeFailpoint | RunToolAuthorization | SubmissionLedger | ThreadStore | ToolReconciler | WakeScheduler | Exclude<[Entries[number]] extends [never] ? never : Entries[number] extends (infer T) ? T extends Entries[number] ? T extends unknown ? ("attemptLayer" extends keyof T ? T[keyof T & "attemptLayer"] : undefined) extends (infer T_1) ? T_1 extends ("attemptLayer" extends keyof T ? T[keyof T & "attemptLayer"] : undefined) ? T_1 extends ((context: AgentAttemptContext) => Layer.Layer<infer Provides, never, infer Requires>) ? Requires | Exclude<T extends {
|
|
3146
|
+
readonly agent: infer A extends ExecutableAgentBinding;
|
|
3147
|
+
} ? DurableWorkerRequirements<A> : T extends {
|
|
3148
|
+
readonly agent: infer D extends Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined> & {
|
|
3149
|
+
readonly instructions: InstructionSource<never, unknown, unknown>;
|
|
3150
|
+
readonly inputPrompt?: InputPromptSource<never, unknown, unknown> | undefined;
|
|
3151
|
+
};
|
|
3152
|
+
readonly model: infer M extends ExecutableAgentBinding["model"];
|
|
3153
|
+
} ? DurableWorkerRequirements<{
|
|
3154
|
+
readonly definition: D;
|
|
3155
|
+
readonly model: M;
|
|
3156
|
+
}> : never, Provides> : T extends {
|
|
3157
|
+
readonly agent: infer A extends ExecutableAgentBinding;
|
|
3158
|
+
} ? DurableWorkerRequirements<A> : T extends {
|
|
3159
|
+
readonly agent: infer D extends Definition<Schema.Top, Schema.Top, unknown, import("effect/unstable/ai/Toolkit").Any, RunDispositionDeclaration<never, Schema.Top> | undefined, unknown, Schema.Top | undefined> & {
|
|
3160
|
+
readonly instructions: InstructionSource<never, unknown, unknown>;
|
|
3161
|
+
readonly inputPrompt?: InputPromptSource<never, unknown, unknown> | undefined;
|
|
3162
|
+
};
|
|
3163
|
+
readonly model: infer M extends ExecutableAgentBinding["model"];
|
|
3164
|
+
} ? DurableWorkerRequirements<{
|
|
3165
|
+
readonly definition: D;
|
|
3166
|
+
readonly model: M;
|
|
3167
|
+
}> : never : never : never : never : never : never, Scope.Scope>>;
|
|
3168
|
+
/** Construct from precompiled registrations whose captured resources belong to the caller's Scope. */
|
|
3169
|
+
static layerWithBindings(bindings: ReadonlyArray<ResolvedBinding>): Layer.Layer<DurableAgentRuntime, never, Crypto.Crypto | DurableRuntimeConfig | DurableRuntimeFailpoint | RunToolAuthorization | SubmissionLedger | ThreadStore | ToolReconciler | WakeScheduler>;
|
|
3170
|
+
/** Captures optional context preparation; Tool authorization remains required in `R`. */
|
|
3171
|
+
static readonly layerWithServices: Layer.Layer<DurableAgentRuntime, never, SubmissionLedger | ThreadStore | WakeScheduler | DurableRuntimeFailpoint | DurableRuntimeConfig | ToolReconciler | RunToolAuthorization | Crypto.Crypto>;
|
|
3172
|
+
/** Compatible defaults: no host prompt transformation and allow-all Tool authorization. */
|
|
3173
|
+
static readonly layer: Layer.Layer<DurableAgentRuntime, never, SubmissionLedger | ThreadStore | WakeScheduler | DurableRuntimeFailpoint | DurableRuntimeConfig | ToolReconciler | Crypto.Crypto>;
|
|
3174
|
+
}
|
|
3175
|
+
declare namespace Records_d_exports {
|
|
3176
|
+
export { AbortRequested, AbortedSubmissionSettled, AgentUpdateEmitted, ApprovalDecision, BatchId, CURRENT_CANONICAL_SCHEMA_VERSION, CanonicalBatch, CanonicalRecord, CanonicalRecordEnvelope, CanonicalRecordPayload, CanonicalSequence, CompactionCreated, CompletedSubmissionSettled, DefinitionDigestInput, DefinitionDigests, DeploymentId, Digest, FailedSubmissionSettled, MAX_PERSISTED_JSON_BYTES, MAX_PERSISTED_JSON_COLLECTION_LENGTH, MAX_PERSISTED_JSON_DEPTH, MAX_PERSISTED_JSON_NODES, ModelCompleted, ModelResponseInterrupted, ModelResponseRecorded, ObservationOffset, PeerMessagePrepared, PersistedJson, ProducerEpoch, ProducerId, RecordEnvelope, RecordId, RepairAnnotated, ReplayContract, RunCompleted, RunDurationExhausted, RunFailed, RunPolicyUsageReserved, RunStartedRecord, SettlementFailureDiagnostic, SettlementOutcome, SubagentJoined, SubagentLineageRecorded, SubagentRequested, SubagentStarted, SubmissionSettled, SubmissionSettledRecord, SubtreeBudgetReserved, ThreadCreated, ToolApprovalDecided, ToolApprovalRequested, ToolCallPrepared, ToolCallResolution, ToolCallResolved, ToolCallSettled, ToolCallUnknown, ToolOperation, ToolStepSettled, ToolUnavailable, UserInputRecorded, WorkerAdmission, WorkerInputCompleted, WorkerInputRequested, WorkerOrigin, WorkerOriginRecorded, WorkerReportPrepared, WorkerReportRefused, WorkerReportingIntent, WorkerStopRequested };
|
|
3177
|
+
}
|
|
3178
|
+
/** Stable identity of one canonical record. */
|
|
3179
|
+
declare const RecordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
3180
|
+
type RecordId = typeof RecordId.Type;
|
|
3181
|
+
/** Stable idempotency identity of one atomic append. */
|
|
3182
|
+
declare const BatchId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/BatchId">;
|
|
3183
|
+
type BatchId = typeof BatchId.Type;
|
|
3184
|
+
/** Identity of the deployment that produced a record. */
|
|
3185
|
+
declare const DeploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
3186
|
+
type DeploymentId = typeof DeploymentId.Type;
|
|
3187
|
+
/** Identity of a fenced canonical-log producer. */
|
|
3188
|
+
declare const ProducerId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ProducerId">;
|
|
3189
|
+
type ProducerId = typeof ProducerId.Type;
|
|
3190
|
+
/** SHA-256 digest encoded as lowercase hexadecimal text. */
|
|
3191
|
+
declare const Digest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3192
|
+
type Digest = typeof Digest.Type;
|
|
3193
|
+
/** Adapter-owned resume cursor. Callers must not parse or synthesize it. */
|
|
3194
|
+
declare const ObservationOffset: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ObservationOffset">;
|
|
3195
|
+
type ObservationOffset = typeof ObservationOffset.Type;
|
|
3196
|
+
/** Gap-free position in one Thread's canonical sequence. */
|
|
3197
|
+
declare const CanonicalSequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
3198
|
+
type CanonicalSequence = typeof CanonicalSequence.Type;
|
|
3199
|
+
/** Monotonic fencing epoch for a Thread producer. */
|
|
3200
|
+
declare const ProducerEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
3201
|
+
type ProducerEpoch = typeof ProducerEpoch.Type;
|
|
3202
|
+
/**
|
|
3203
|
+
* Private failed-Settlement evidence. The summary remains the safe public projection; diagnostic
|
|
3204
|
+
* and context preserve structured causal evidence for authorized operators, never model context.
|
|
3205
|
+
* Optional fields allow reading supported Settlements written before causal capture was available.
|
|
3206
|
+
*/
|
|
3207
|
+
declare const SettlementFailureDiagnostic: Schema.declareConstructor<{
|
|
3208
|
+
readonly errorTag: string;
|
|
3209
|
+
readonly message: string;
|
|
3210
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
3211
|
+
readonly context?: {
|
|
3212
|
+
readonly agentId?: string | undefined;
|
|
3213
|
+
readonly threadId?: string | undefined;
|
|
3214
|
+
readonly runId?: string | undefined;
|
|
3215
|
+
readonly submissionId?: string | undefined;
|
|
3216
|
+
readonly attemptId?: string | undefined;
|
|
3217
|
+
readonly turnId?: string | undefined;
|
|
3218
|
+
readonly toolCallId?: string | undefined;
|
|
3219
|
+
readonly toolName?: string | undefined;
|
|
3220
|
+
readonly callId?: string | undefined;
|
|
3221
|
+
readonly check?: string | undefined;
|
|
3222
|
+
readonly operation?: string | undefined;
|
|
3223
|
+
} | undefined;
|
|
3224
|
+
}, {
|
|
3225
|
+
readonly errorTag: string;
|
|
3226
|
+
readonly message: string;
|
|
3227
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
3228
|
+
readonly context?: {
|
|
3229
|
+
readonly agentId?: string | undefined;
|
|
3230
|
+
readonly threadId?: string | undefined;
|
|
3231
|
+
readonly runId?: string | undefined;
|
|
3232
|
+
readonly submissionId?: string | undefined;
|
|
3233
|
+
readonly attemptId?: string | undefined;
|
|
3234
|
+
readonly turnId?: string | undefined;
|
|
3235
|
+
readonly toolCallId?: string | undefined;
|
|
3236
|
+
readonly toolName?: string | undefined;
|
|
3237
|
+
readonly callId?: string | undefined;
|
|
3238
|
+
readonly check?: string | undefined;
|
|
3239
|
+
readonly operation?: string | undefined;
|
|
3240
|
+
} | undefined;
|
|
3241
|
+
}, readonly [Schema.Struct<{
|
|
3242
|
+
readonly errorTag: Schema.NonEmptyString;
|
|
3243
|
+
readonly message: Schema.String;
|
|
3244
|
+
readonly diagnostic: Schema.optionalKey<Schema.Codec<Diagnostic, Diagnostic, never, never>>;
|
|
3245
|
+
readonly context: Schema.optionalKey<Schema.declareConstructor<{
|
|
3246
|
+
readonly agentId?: string | undefined;
|
|
3247
|
+
readonly threadId?: string | undefined;
|
|
3248
|
+
readonly runId?: string | undefined;
|
|
3249
|
+
readonly submissionId?: string | undefined;
|
|
3250
|
+
readonly attemptId?: string | undefined;
|
|
3251
|
+
readonly turnId?: string | undefined;
|
|
3252
|
+
readonly toolCallId?: string | undefined;
|
|
3253
|
+
readonly toolName?: string | undefined;
|
|
3254
|
+
readonly callId?: string | undefined;
|
|
3255
|
+
readonly check?: string | undefined;
|
|
3256
|
+
readonly operation?: string | undefined;
|
|
3257
|
+
}, {
|
|
3258
|
+
readonly agentId?: string | undefined;
|
|
3259
|
+
readonly threadId?: string | undefined;
|
|
3260
|
+
readonly runId?: string | undefined;
|
|
3261
|
+
readonly submissionId?: string | undefined;
|
|
3262
|
+
readonly attemptId?: string | undefined;
|
|
3263
|
+
readonly turnId?: string | undefined;
|
|
3264
|
+
readonly toolCallId?: string | undefined;
|
|
3265
|
+
readonly toolName?: string | undefined;
|
|
3266
|
+
readonly callId?: string | undefined;
|
|
3267
|
+
readonly check?: string | undefined;
|
|
3268
|
+
readonly operation?: string | undefined;
|
|
3269
|
+
}, readonly [Schema.Struct<{
|
|
3270
|
+
readonly agentId: Schema.optionalKey<Schema.String>;
|
|
3271
|
+
readonly threadId: Schema.optionalKey<Schema.String>;
|
|
3272
|
+
readonly runId: Schema.optionalKey<Schema.String>;
|
|
3273
|
+
readonly submissionId: Schema.optionalKey<Schema.String>;
|
|
3274
|
+
readonly attemptId: Schema.optionalKey<Schema.String>;
|
|
3275
|
+
readonly turnId: Schema.optionalKey<Schema.String>;
|
|
3276
|
+
readonly toolCallId: Schema.optionalKey<Schema.String>;
|
|
3277
|
+
readonly toolName: Schema.optionalKey<Schema.String>;
|
|
3278
|
+
readonly callId: Schema.optionalKey<Schema.String>;
|
|
3279
|
+
readonly check: Schema.optionalKey<Schema.String>;
|
|
3280
|
+
readonly operation: Schema.optionalKey<Schema.String>;
|
|
3281
|
+
}>], {
|
|
3282
|
+
readonly agentId?: string | undefined;
|
|
3283
|
+
readonly threadId?: string | undefined;
|
|
3284
|
+
readonly runId?: string | undefined;
|
|
3285
|
+
readonly submissionId?: string | undefined;
|
|
3286
|
+
readonly attemptId?: string | undefined;
|
|
3287
|
+
readonly turnId?: string | undefined;
|
|
3288
|
+
readonly toolCallId?: string | undefined;
|
|
3289
|
+
readonly toolName?: string | undefined;
|
|
3290
|
+
readonly callId?: string | undefined;
|
|
3291
|
+
readonly check?: string | undefined;
|
|
3292
|
+
readonly operation?: string | undefined;
|
|
3293
|
+
}>>;
|
|
3294
|
+
}>], {
|
|
3295
|
+
readonly errorTag: string;
|
|
3296
|
+
readonly message: string;
|
|
3297
|
+
readonly diagnostic?: Diagnostic | undefined;
|
|
3298
|
+
readonly context?: {
|
|
3299
|
+
readonly agentId?: string | undefined;
|
|
3300
|
+
readonly threadId?: string | undefined;
|
|
3301
|
+
readonly runId?: string | undefined;
|
|
3302
|
+
readonly submissionId?: string | undefined;
|
|
3303
|
+
readonly attemptId?: string | undefined;
|
|
3304
|
+
readonly turnId?: string | undefined;
|
|
3305
|
+
readonly toolCallId?: string | undefined;
|
|
3306
|
+
readonly toolName?: string | undefined;
|
|
3307
|
+
readonly callId?: string | undefined;
|
|
3308
|
+
readonly check?: string | undefined;
|
|
3309
|
+
readonly operation?: string | undefined;
|
|
3310
|
+
} | undefined;
|
|
3311
|
+
}>;
|
|
3312
|
+
type SettlementFailureDiagnostic = typeof SettlementFailureDiagnostic.Type;
|
|
3313
|
+
declare const MAX_PERSISTED_JSON_DEPTH = 64;
|
|
3314
|
+
declare const MAX_PERSISTED_JSON_COLLECTION_LENGTH = 4096;
|
|
3315
|
+
declare const MAX_PERSISTED_JSON_NODES = 65536;
|
|
3316
|
+
declare const MAX_PERSISTED_JSON_BYTES: number;
|
|
3317
|
+
/** Canonical JSON admitted to persisted records and checkpoints under explicit resource limits. */
|
|
3318
|
+
declare const PersistedJson: Schema.declare<Schema.Json, Schema.Json>;
|
|
3319
|
+
type PersistedJson = typeof PersistedJson.Type;
|
|
3320
|
+
declare const DefinitionDigestInput_base: Schema.Class<DefinitionDigestInput, Schema.Struct<{
|
|
3321
|
+
readonly agent: Schema.declare<Schema.Json, Schema.Json>;
|
|
3322
|
+
readonly model: Schema.declare<Schema.Json, Schema.Json>;
|
|
3323
|
+
readonly tools: Schema.declare<Schema.Json, Schema.Json>;
|
|
3324
|
+
}>, {}>;
|
|
3325
|
+
/** Schema-owned replay inputs whose individual definitions are incorporated into digests. */
|
|
3326
|
+
declare class DefinitionDigestInput extends DefinitionDigestInput_base {}
|
|
3327
|
+
declare const ReplayContract_base: Schema.Class<ReplayContract, Schema.Struct<{
|
|
3328
|
+
readonly agent: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3329
|
+
/** Retained for reading earlier admissions; never selects executable code. */
|
|
3330
|
+
readonly agentBehavior: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
3331
|
+
readonly tools: Schema.$Record<Schema.String, Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
3332
|
+
}>, {}>;
|
|
3333
|
+
/** Admission-time operation fingerprints. Agent fingerprints remain immutable evidence only. */
|
|
3334
|
+
declare class ReplayContract extends ReplayContract_base {}
|
|
3335
|
+
declare const DefinitionDigests_base: Schema.Class<DefinitionDigests, Schema.Struct<{
|
|
3336
|
+
readonly agent: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3337
|
+
readonly model: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3338
|
+
readonly tools: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3339
|
+
readonly replay: Schema.optionalKey<typeof ReplayContract>;
|
|
3340
|
+
}>, {}>;
|
|
3341
|
+
/** Digests identify admission exactly; only an unfinished operation needs replay compatibility. */
|
|
3342
|
+
declare class DefinitionDigests extends DefinitionDigests_base {}
|
|
3343
|
+
declare const ThreadCreated_base: Schema.Class<ThreadCreated, Schema.TaggedStruct<"ThreadCreated", {
|
|
3344
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3345
|
+
readonly definitions: typeof DefinitionDigests;
|
|
3346
|
+
}>, {}>;
|
|
3347
|
+
declare class ThreadCreated extends ThreadCreated_base {}
|
|
3348
|
+
declare const UserInputRecorded_base: Schema.Class<UserInputRecorded, Schema.TaggedStruct<"UserInputRecorded", {
|
|
3349
|
+
readonly submissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
3350
|
+
readonly kind: Schema.Literals<readonly ["user", "steering", "follow-up"]>;
|
|
3351
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">>;
|
|
3352
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
3353
|
+
readonly messageAdmission: Schema.optionalKey<Schema.Union<readonly [Schema.Struct<{
|
|
3354
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3355
|
+
readonly message: Schema.Struct<{
|
|
3356
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3357
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3358
|
+
}>;
|
|
3359
|
+
readonly peerName: Schema.NonEmptyString;
|
|
3360
|
+
readonly sender: Schema.Struct<{
|
|
3361
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3362
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3363
|
+
}>;
|
|
3364
|
+
readonly returnAddress: Schema.Struct<{
|
|
3365
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3366
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3367
|
+
}>;
|
|
3368
|
+
readonly inReplyTo: Schema.optionalKey<Schema.Struct<{
|
|
3369
|
+
readonly ownerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3370
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3371
|
+
}>>;
|
|
3372
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
3373
|
+
readonly _tag: Schema.Literal<"WorkerCompletion">;
|
|
3374
|
+
readonly budgetExhausted: Schema.Boolean;
|
|
3375
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3376
|
+
readonly report: Schema.Union<readonly [Schema.Struct<{
|
|
3377
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
3378
|
+
readonly worker: Schema.Struct<{
|
|
3379
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3380
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3381
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3382
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3383
|
+
}>;
|
|
3384
|
+
readonly receipt: typeof Receipt;
|
|
3385
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3386
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
3387
|
+
readonly outcome: Schema.Literal<"completed">;
|
|
3388
|
+
readonly result: Schema.Union<readonly [Schema.Codec<Schema.Json, Schema.Json, never, never>]>;
|
|
3389
|
+
}>, Schema.Struct<{
|
|
3390
|
+
readonly _tag: Schema.Literal<"Settled">;
|
|
3391
|
+
readonly worker: Schema.Struct<{
|
|
3392
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3393
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3394
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3395
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3396
|
+
}>;
|
|
3397
|
+
readonly receipt: typeof Receipt;
|
|
3398
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3399
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
3400
|
+
readonly outcome: Schema.Literals<readonly ["failed", "aborted"]>;
|
|
3401
|
+
readonly failure: typeof SubagentExecutionFailure;
|
|
3402
|
+
}>]>;
|
|
3403
|
+
}>, Schema.Struct<{
|
|
3404
|
+
readonly _tag: Schema.Literal<"WorkerUpdate">;
|
|
3405
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3406
|
+
readonly worker: Schema.Struct<{
|
|
3407
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3408
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3409
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3410
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3411
|
+
}>;
|
|
3412
|
+
readonly update: typeof Update;
|
|
3413
|
+
}>]>]>>;
|
|
3414
|
+
}>, {}>;
|
|
3415
|
+
/**
|
|
3416
|
+
* One recorded Thread input. `submissionId` is present only for durably accepted work;
|
|
3417
|
+
* retained history has no admission or settlement obligation. `kind` identifies the input seam.
|
|
3418
|
+
*/
|
|
3419
|
+
declare class UserInputRecorded extends UserInputRecorded_base {}
|
|
3420
|
+
declare const RunStartedRecord_base: Schema.Class<RunStartedRecord, Schema.TaggedStruct<"RunStarted", {
|
|
3421
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3422
|
+
/** Older private histories cannot prove programmatic accounting and must be reset. */
|
|
3423
|
+
readonly policyAccountingVersion: Schema.Literal<1>;
|
|
3424
|
+
readonly maxDurationMillis: Schema.Finite;
|
|
3425
|
+
}>, {}>;
|
|
3426
|
+
/** Immutable Run start and per-Attempt duration allowance, before any agent execution. */
|
|
3427
|
+
declare class RunStartedRecord extends RunStartedRecord_base {}
|
|
3428
|
+
declare const RunDurationExhausted_base: Schema.Class<RunDurationExhausted, Schema.TaggedStruct<"RunDurationExhausted", {
|
|
3429
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3430
|
+
}>, {}>;
|
|
3431
|
+
/** An active Attempt exhausted its execution allowance; downtime alone never writes this. */
|
|
3432
|
+
declare class RunDurationExhausted extends RunDurationExhausted_base {}
|
|
3433
|
+
declare const ModelCompleted_base: Schema.Class<ModelCompleted, Schema.Struct<{
|
|
3434
|
+
readonly _tag: Schema.tag<"ModelCompleted">;
|
|
3435
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3436
|
+
readonly output: Schema.declare<Schema.Json, Schema.Json>;
|
|
3437
|
+
readonly messages: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3438
|
+
}>, {}>;
|
|
3439
|
+
/**
|
|
3440
|
+
* Final model output. Immediate history may include the exact encoded Prompt suffix of the
|
|
3441
|
+
* successful Run; durable execution instead journals individual ModelResponseRecorded Turns.
|
|
3442
|
+
*/
|
|
3443
|
+
declare class ModelCompleted extends ModelCompleted_base {}
|
|
3444
|
+
declare const ToolCallSettled_base: Schema.Class<ToolCallSettled, Schema.TaggedStruct<"ToolCallSettled", {
|
|
3445
|
+
readonly toolSelection: Schema.optionalKey<typeof Selection>;
|
|
3446
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3447
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3448
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3449
|
+
readonly result: Schema.declare<Schema.Json, Schema.Json>;
|
|
3450
|
+
readonly isFailure: Schema.Boolean;
|
|
3451
|
+
/** Explicit engine evidence, never inferred from Tool result data. */
|
|
3452
|
+
readonly budgetRejected: Schema.optionalKey<Schema.Literal<true>>;
|
|
3453
|
+
}>, {}>;
|
|
3454
|
+
declare class ToolCallSettled extends ToolCallSettled_base {}
|
|
3455
|
+
declare const ToolOperation_base: Schema.Class<ToolOperation, Schema.Struct<{
|
|
3456
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3457
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3458
|
+
readonly executionClass: Schema.Literals<readonly ["readonly", "idempotent", "uncertain"]>;
|
|
3459
|
+
readonly executionKind: Schema.Literals<readonly ["ordinary", "delegation", "orchestration"]>;
|
|
3460
|
+
readonly replay: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3461
|
+
}>, {}>;
|
|
3462
|
+
/** Compact execution evidence committed with a declaration, before any handler can start. */
|
|
3463
|
+
declare class ToolOperation extends ToolOperation_base {}
|
|
3464
|
+
declare const ToolUnavailable_base: Schema.Class<ToolUnavailable, Schema.TaggedStruct<"ToolUnavailable", {
|
|
3465
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3466
|
+
readonly execution: Schema.Literals<readonly ["not-executed", "unavailable"]>;
|
|
3467
|
+
readonly message: Schema.String;
|
|
3468
|
+
}>, {}>;
|
|
3469
|
+
/** A retired call's runtime result. Unavailable readonly work may already have been observed. */
|
|
3470
|
+
declare class ToolUnavailable extends ToolUnavailable_base {}
|
|
3471
|
+
declare const ModelResponseRecorded_base: Schema.Class<ModelResponseRecorded, Schema.Struct<{
|
|
3472
|
+
readonly _tag: Schema.tag<"ModelResponseRecorded">;
|
|
3473
|
+
readonly toolOperations: Schema.optionalKey<Schema.$Array<typeof ToolOperation>>;
|
|
3474
|
+
readonly toolParameterRejections: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
3475
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3476
|
+
readonly parameters: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
3477
|
+
readonly error: Schema.toEncoded<Schema.Struct<{
|
|
3478
|
+
readonly _tag: Schema.tag<"AiError">;
|
|
3479
|
+
readonly module: Schema.String;
|
|
3480
|
+
readonly method: Schema.String;
|
|
3481
|
+
readonly reason: typeof import("effect/unstable/ai/AiError").ToolParameterValidationError;
|
|
3482
|
+
}>>;
|
|
3483
|
+
}>>>;
|
|
3484
|
+
readonly toolExposure: Schema.optionalKey<typeof Snapshot>;
|
|
3485
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3486
|
+
readonly turnId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/TurnId">;
|
|
3487
|
+
readonly turn: Schema.Int;
|
|
3488
|
+
readonly messages: Schema.declare<Schema.Json, Schema.Json>;
|
|
3489
|
+
readonly messagesDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3490
|
+
readonly runScopedPrefixLength: Schema.optionalKey<Schema.Int>;
|
|
3491
|
+
readonly modelUsage: Schema.optionalKey<Schema.$Array<typeof ModelCallUsage>>;
|
|
3492
|
+
readonly unobservedModelCalls: Schema.optionalKey<Schema.Natural>;
|
|
3493
|
+
readonly inputTokens: Schema.optionalKey<Schema.Natural>;
|
|
3494
|
+
readonly outputTokens: Schema.optionalKey<Schema.Natural>;
|
|
3495
|
+
readonly costMicrousd: Schema.optionalKey<Schema.Natural>;
|
|
3496
|
+
}>, {}>;
|
|
3497
|
+
declare class ModelResponseRecorded extends ModelResponseRecorded_base {}
|
|
3498
|
+
declare const ToolCallPrepared_base: Schema.Class<ToolCallPrepared, Schema.TaggedStruct<"ToolCallPrepared", {
|
|
3499
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3500
|
+
readonly turnId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/TurnId">;
|
|
3501
|
+
readonly turn: Schema.Int;
|
|
3502
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3503
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3504
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
3505
|
+
readonly parametersDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3506
|
+
/** Absent legacy evidence grants no delegation replay authority. */
|
|
3507
|
+
readonly executionKind: Schema.optionalKey<Schema.Literals<readonly ["ordinary", "delegation", "orchestration"]>>;
|
|
3508
|
+
readonly executionClass: Schema.optionalKey<Schema.Literals<readonly ["readonly", "idempotent", "uncertain"]>>;
|
|
3509
|
+
readonly replay: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
3510
|
+
}>, {}>;
|
|
3511
|
+
/**
|
|
3512
|
+
* One approved uncertain/idempotent ordinary Tool Call made durable BEFORE any handler starts
|
|
3513
|
+
* (durability §10). `parameters` is the Schema-encoded wire form of the declared call and
|
|
3514
|
+
* `parametersDigest` pins it; recovery that sees this record without a matching `ToolCallSettled`
|
|
3515
|
+
* (or `ToolCallUnknown` → `ToolCallResolved`) must reconcile or mark unknown, never silently
|
|
3516
|
+
* replay (DUR-009). Ordinary `readonly`-class Tools never produce this record. Delegation
|
|
3517
|
+
* classification is always prepared, including for a Tool annotated `readonly`.
|
|
3518
|
+
*/
|
|
3519
|
+
declare class ToolCallPrepared extends ToolCallPrepared_base {}
|
|
3520
|
+
declare const RunPolicyUsageReserved_base: Schema.Class<RunPolicyUsageReserved, Schema.TaggedStruct<"RunPolicyUsageReserved", {
|
|
3521
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3522
|
+
readonly programmaticToolCalls: Schema.Natural;
|
|
3523
|
+
readonly finalizationUsed: Schema.Boolean;
|
|
3524
|
+
}>, {}>;
|
|
3525
|
+
/** Monotonic reservations charged before programmatic execution or grace finalization. */
|
|
3526
|
+
declare class RunPolicyUsageReserved extends RunPolicyUsageReserved_base {}
|
|
3527
|
+
declare const ToolCallUnknown_base: Schema.Class<ToolCallUnknown, Schema.TaggedStruct<"ToolCallUnknown", {
|
|
3528
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3529
|
+
readonly turn: Schema.Int;
|
|
3530
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3531
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3532
|
+
readonly reason: Schema.String;
|
|
3533
|
+
}>, {}>;
|
|
3534
|
+
/**
|
|
3535
|
+
* A durable Unknown Outcome: the external effect of one prepared ordinary Tool Call may have
|
|
3536
|
+
* happened but was not confirmed canonically (DUR-009/DUR-017). It is neither success nor
|
|
3537
|
+
* ordinary failure; automatic continuation stops until an authorized resolution arrives.
|
|
3538
|
+
*/
|
|
3539
|
+
declare class ToolCallUnknown extends ToolCallUnknown_base {}
|
|
3540
|
+
/** How one open/unknown Tool Call was authoritatively closed (DUR-017 resolution audit). */
|
|
3541
|
+
declare const ToolCallResolution: Schema.Literals<readonly ["completed-with-result", "failed-with-error", "never-started", "safe-retry"]>;
|
|
3542
|
+
type ToolCallResolution = typeof ToolCallResolution.Type;
|
|
3543
|
+
declare const ToolCallResolved_base: Schema.Class<ToolCallResolved, Schema.TaggedStruct<"ToolCallResolved", {
|
|
3544
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3545
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3546
|
+
readonly resolution: Schema.Literals<readonly ["completed-with-result", "failed-with-error", "never-started", "safe-retry"]>;
|
|
3547
|
+
readonly author: Schema.NonEmptyString;
|
|
3548
|
+
readonly reason: Schema.String;
|
|
3549
|
+
}>, {}>;
|
|
3550
|
+
/**
|
|
3551
|
+
* The canonical audit record closing one open or unknown Tool Call: reconciler-recovered supplier
|
|
3552
|
+
* truth or an authorized `resolveUnknown` command. `author`/`reason` make every resolution an
|
|
3553
|
+
* attributable decision (DUR-017); a `completed-with-result` resolution is accompanied by the
|
|
3554
|
+
* per-call `ToolCallSettled` record carrying the recovered result.
|
|
3555
|
+
*/
|
|
3556
|
+
declare class ToolCallResolved extends ToolCallResolved_base {}
|
|
3557
|
+
declare const ToolStepSettled_base: Schema.Class<ToolStepSettled, Schema.TaggedStruct<"ToolStepSettled", {
|
|
3558
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3559
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3560
|
+
readonly stepName: Schema.NonEmptyString;
|
|
3561
|
+
readonly output: Schema.declare<Schema.Json, Schema.Json>;
|
|
3562
|
+
readonly outputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3563
|
+
}>, {}>;
|
|
3564
|
+
/**
|
|
3565
|
+
* One accepted Durable Step result (durability §11): exactly-once-recorded while the Step's
|
|
3566
|
+
* external side effect stays honestly at-least-once-executed. Only success is recorded — a failing
|
|
3567
|
+
* Step body fails into the handler's error channel and re-executes on re-entry. `output` is the
|
|
3568
|
+
* Schema-encoded Step output; `outputDigest` pins it for replay-divergence detection.
|
|
3569
|
+
*/
|
|
3570
|
+
declare class ToolStepSettled extends ToolStepSettled_base {}
|
|
3571
|
+
declare const ToolApprovalRequested_base: Schema.Class<ToolApprovalRequested, Schema.TaggedStruct<"ToolApprovalRequested", {
|
|
3572
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3573
|
+
readonly turnId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/TurnId">;
|
|
3574
|
+
readonly turn: Schema.Int;
|
|
3575
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3576
|
+
readonly toolName: Schema.NonEmptyString;
|
|
3577
|
+
readonly parametersDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3578
|
+
}>, {}>;
|
|
3579
|
+
/**
|
|
3580
|
+
* A canonical approval request for one declared Tool Call (CAP-006, durability §8): with this
|
|
3581
|
+
* record durable, "waiting for explicit approval" is a safe suspension boundary — the resumed
|
|
3582
|
+
* Attempt replays the declared batch instead of re-invoking the model.
|
|
3583
|
+
*/
|
|
3584
|
+
declare class ToolApprovalRequested extends ToolApprovalRequested_base {}
|
|
3585
|
+
/** The two-valued approval decision family shared by canonical records and ledger intents. */
|
|
3586
|
+
declare const ApprovalDecision: Schema.Literals<readonly ["approved", "denied"]>;
|
|
3587
|
+
type ApprovalDecision = typeof ApprovalDecision.Type;
|
|
3588
|
+
declare const ToolApprovalDecided_base: Schema.Class<ToolApprovalDecided, Schema.TaggedStruct<"ToolApprovalDecided", {
|
|
3589
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3590
|
+
readonly turn: Schema.Int;
|
|
3591
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3592
|
+
readonly decision: Schema.Literals<readonly ["approved", "denied"]>;
|
|
3593
|
+
readonly resolver: Schema.NonEmptyString;
|
|
3594
|
+
readonly reason: Schema.String;
|
|
3595
|
+
}>, {}>;
|
|
3596
|
+
/**
|
|
3597
|
+
* The canonical decision for one requested approval. Appended by the deciding Attempt (policy
|
|
3598
|
+
* auto-decisions) or by the resuming Attempt after a durable `resolveApproval` intent; it is the
|
|
3599
|
+
* deterministic decision authority for every later Attempt of the same Run.
|
|
3600
|
+
*/
|
|
3601
|
+
declare class ToolApprovalDecided extends ToolApprovalDecided_base {}
|
|
3602
|
+
declare const ModelResponseInterrupted_base: Schema.Class<ModelResponseInterrupted, Schema.TaggedStruct<"ModelResponseInterrupted", {
|
|
3603
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3604
|
+
readonly supersededEpoch: Schema.brand<Schema.Natural, "@effect-agent/thread/ProducerEpoch">;
|
|
3605
|
+
readonly attemptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AttemptId">;
|
|
3606
|
+
readonly reason: Schema.String;
|
|
3607
|
+
}>, {}>;
|
|
3608
|
+
/**
|
|
3609
|
+
* First-class interruption audit (durability §9): appended by a superseding Attempt before it
|
|
3610
|
+
* re-invokes the model for a Turn whose prior owner died without a complete canonical response.
|
|
3611
|
+
* Duplicate provider cost is thereby possible AND observable in canonical history.
|
|
3612
|
+
*/
|
|
3613
|
+
declare class ModelResponseInterrupted extends ModelResponseInterrupted_base {}
|
|
3614
|
+
declare const CompactionCreated_base: Schema.Class<CompactionCreated, Schema.TaggedStruct<"CompactionCreated", {
|
|
3615
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3616
|
+
readonly turn: Schema.Int;
|
|
3617
|
+
readonly kind: Schema.Literals<readonly ["clear-tool-results", "summarize", "rollover"]>;
|
|
3618
|
+
readonly coversThrough: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
3619
|
+
readonly summary: Schema.optionalKey<Schema.String>;
|
|
3620
|
+
readonly handoff: Schema.optionalKey<Schema.NonEmptyString>;
|
|
3621
|
+
}>, {}>;
|
|
3622
|
+
/**
|
|
3623
|
+
* One engine-native compaction committed before the pre-Turn view changes (RUN-026).
|
|
3624
|
+
* `coversThrough` is a Thread record sequence: the projection
|
|
3625
|
+
* renders records at or below it as a summary (`summarize`), a fresh window (`rollover`), or with
|
|
3626
|
+
* cleared tool results (kind `clear-tool-results`), never erasing source
|
|
3627
|
+
* history. The record carries no digest by decision: it is appended by the
|
|
3628
|
+
* fenced owner into the very log it covers, and re-verifying a digest would
|
|
3629
|
+
* re-read the covered range on every wake — the O(history) work compaction
|
|
3630
|
+
* exists to remove. Host-supplied ContextCompactor decisions use this same commit path.
|
|
3631
|
+
* Summaries exceeding BoundedText are rejected before append, never truncated.
|
|
3632
|
+
* `summary` is present exactly for `summarize` records; the projection
|
|
3633
|
+
* treats a summarize record without one as invalid and ignores it fail-safe.
|
|
3634
|
+
*/
|
|
3635
|
+
declare class CompactionCreated extends CompactionCreated_base {}
|
|
3636
|
+
declare const RunFailed_base: Schema.Class<RunFailed, Schema.TaggedStruct<"RunFailed", {
|
|
3637
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3638
|
+
readonly failure: Schema.declare<Schema.Json, Schema.Json>;
|
|
3639
|
+
}>, {}>;
|
|
3640
|
+
declare class RunFailed extends RunFailed_base {}
|
|
3641
|
+
declare const RunCompleted_base: Schema.Class<RunCompleted, Schema.Struct<{
|
|
3642
|
+
readonly _tag: Schema.tag<"RunCompleted">;
|
|
3643
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3644
|
+
readonly output: Schema.declare<Schema.Json, Schema.Json>;
|
|
3645
|
+
readonly resultDigest: Schema.optionalKey<Schema.brand<Schema.String, "@effect-agent/thread/Digest">>;
|
|
3646
|
+
readonly runDisposition: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3647
|
+
readonly finishReason: Schema.optionalKey<Schema.Literal<"budget-exhausted">>;
|
|
3648
|
+
readonly exhausted: Schema.optionalKey<Schema.Literals<readonly ["tokens", "tool-calls", "turns"]>>;
|
|
3649
|
+
}>, {}>;
|
|
3650
|
+
declare class RunCompleted extends RunCompleted_base {}
|
|
3651
|
+
declare const RepairAnnotated_base: Schema.Class<RepairAnnotated, Schema.TaggedStruct<"RepairAnnotated", {
|
|
3652
|
+
readonly reason: Schema.String;
|
|
3653
|
+
readonly details: Schema.declare<Schema.Json, Schema.Json>;
|
|
3654
|
+
}>, {}>;
|
|
3655
|
+
declare class RepairAnnotated extends RepairAnnotated_base {}
|
|
3656
|
+
/** Terminal outcome family for one accepted Submission (DUR-002). */
|
|
3657
|
+
declare const SettlementOutcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
3658
|
+
type SettlementOutcome = typeof SettlementOutcome.Type;
|
|
3659
|
+
declare const AbortRequested_base: Schema.Class<AbortRequested, Schema.TaggedStruct<"AbortRequested", {
|
|
3660
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
3661
|
+
readonly author: Schema.NonEmptyString;
|
|
3662
|
+
readonly reason: Schema.String;
|
|
3663
|
+
}>, {}>;
|
|
3664
|
+
/**
|
|
3665
|
+
* A durable abort command made canonical before the active worker is interrupted (DUR-012).
|
|
3666
|
+
* Repeating the same abort command is idempotent; abort never rewrites a prior terminal outcome.
|
|
3667
|
+
*/
|
|
3668
|
+
declare class AbortRequested extends AbortRequested_base {}
|
|
3669
|
+
declare const SubmissionSettled_base: Schema.Class<SubmissionSettled, Schema.Struct<{
|
|
3670
|
+
readonly _tag: Schema.tag<"SubmissionSettled">;
|
|
3671
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
3672
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
3673
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
3674
|
+
readonly outcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
3675
|
+
readonly runId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">>;
|
|
3676
|
+
readonly result: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3677
|
+
readonly runDisposition: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3678
|
+
readonly finishReason: Schema.optionalKey<Schema.Literal<"budget-exhausted">>;
|
|
3679
|
+
readonly exhausted: Schema.optionalKey<Schema.Literals<readonly ["tokens", "tool-calls", "turns"]>>;
|
|
3680
|
+
readonly policyLimit: Schema.optionalKey<Schema.Literals<readonly ["turns", "tool-calls", "duration", "usage", "tokens", "cost", "repeated-failures"]>>;
|
|
3681
|
+
readonly usageSummary: Schema.optionalKey<typeof RunUsageSummary>;
|
|
3682
|
+
readonly uncommittedModelUsage: Schema.optionalKey<Schema.$Array<typeof ModelCallUsage>>;
|
|
3683
|
+
}>, {}>;
|
|
3684
|
+
declare class SubmissionSettled extends SubmissionSettled_base {}
|
|
3685
|
+
/** Canonical completed settlement; joined completion may legitimately carry no independent result. */
|
|
3686
|
+
type CompletedSubmissionSettled = SubmissionSettled & {
|
|
3687
|
+
readonly outcome: "completed";
|
|
3688
|
+
};
|
|
3689
|
+
/** Canonical failed settlement; its bounded diagnostic is required and typed. */
|
|
3690
|
+
type FailedSubmissionSettled = SubmissionSettled & {
|
|
3691
|
+
readonly outcome: "failed";
|
|
3692
|
+
readonly result: SettlementFailureDiagnostic;
|
|
3693
|
+
};
|
|
3694
|
+
/** Canonical aborted settlement; abort records intent rather than fabricating a terminal result. */
|
|
3695
|
+
type AbortedSubmissionSettled = SubmissionSettled & {
|
|
3696
|
+
readonly outcome: "aborted";
|
|
3697
|
+
readonly result?: never;
|
|
3698
|
+
};
|
|
3699
|
+
type SubmissionSettledRecord = CompletedSubmissionSettled | FailedSubmissionSettled | AbortedSubmissionSettled;
|
|
3700
|
+
/**
|
|
3701
|
+
* Canonical-boundary view of `SubmissionSettled`: `finishReason` is valid
|
|
3702
|
+
* only on a `completed` outcome, `exhausted` only alongside
|
|
3703
|
+
* `finishReason: "budget-exhausted"`, every `failed` outcome requires the exact bounded
|
|
3704
|
+
* `SettlementFailureDiagnostic`, aborted outcomes carry no result, and `policyLimit` only occurs
|
|
3705
|
+
* on a `failed` outcome whose diagnostic carries the `AgentPolicyError` tag. `runDisposition`
|
|
3706
|
+
* occurs only on an ordinary completed settlement with a Run —
|
|
3707
|
+
* so a malformed persisted combination such as
|
|
3708
|
+
* `{ outcome: "failed", finishReason: "budget-exhausted" }` or a
|
|
3709
|
+
* `policyLimit` contradicting `result.errorTag` fails closed at decode
|
|
3710
|
+
* instead of becoming trusted audit history (STORE-006, RUN-011).
|
|
3711
|
+
*/
|
|
3712
|
+
declare const SubmissionSettledRecord: Schema.refine<SubmissionSettledRecord, typeof SubmissionSettled>;
|
|
3713
|
+
declare const SubagentRequested_base: Schema.Class<SubagentRequested, Schema.TaggedStruct<"SubagentRequested", {
|
|
3714
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3715
|
+
readonly turnId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/TurnId">;
|
|
3716
|
+
readonly turn: Schema.Int;
|
|
3717
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3718
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3719
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3720
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
3721
|
+
readonly childInput: Schema.declare<Schema.Json, Schema.Json>;
|
|
3722
|
+
readonly childInputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3723
|
+
readonly grantDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3724
|
+
readonly reservationId: Schema.NonEmptyString;
|
|
3725
|
+
readonly reservationDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3726
|
+
readonly childThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3727
|
+
readonly childPrincipal: Schema.NonEmptyString;
|
|
3728
|
+
readonly childIdempotencyKey: Schema.NonEmptyString;
|
|
3729
|
+
/** Effective invocation bound, already clamped to the delegation and child Definition. */
|
|
3730
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
3731
|
+
readonly policy: Schema.optionalKey<Schema.toCodecJson<typeof AgentPolicy>>;
|
|
3732
|
+
readonly budget: Schema.optionalKey<Schema.Struct<{
|
|
3733
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
3734
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
3735
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
3736
|
+
}>>;
|
|
3737
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
3738
|
+
readonly depth: Schema.optionalKey<Schema.Int>;
|
|
3739
|
+
}>, {}>;
|
|
3740
|
+
/**
|
|
3741
|
+
* PARENT-log record of one durable child establishment request:
|
|
3742
|
+
* the exact parent Tool Call, delegation and target identity, the digests that pin the child's
|
|
3743
|
+
* Binding/input/grant, the fenced budget reservation, and the INTENDED child identity derived
|
|
3744
|
+
* deterministically from the parent Run and Tool Call pair (D4). `childInput` carries the
|
|
3745
|
+
* prepared child input in encoded form (D3) so recovery can complete child admission from this
|
|
3746
|
+
* record alone — no live delegation handler is required. `childPrincipal`/`childIdempotencyKey`
|
|
3747
|
+
* carry the ledger admission scope with the ledger's exact bounds; the layering keeps their
|
|
3748
|
+
* branded Schemas in the ledger port.
|
|
3749
|
+
*/
|
|
3750
|
+
declare class SubagentRequested extends SubagentRequested_base {}
|
|
3751
|
+
declare const SubagentStarted_base: Schema.Class<SubagentStarted, Schema.TaggedStruct<"SubagentStarted", {
|
|
3752
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3753
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3754
|
+
readonly childThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3755
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
3756
|
+
readonly childReceiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
3757
|
+
readonly childRunId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3758
|
+
}>, {}>;
|
|
3759
|
+
/**
|
|
3760
|
+
* PARENT-log record that the intended child exists as accepted work:
|
|
3761
|
+
* the full established child identity. It is appended only after the child Receipt
|
|
3762
|
+
* exists — SUB-017 holds by construction because `childReceiptId` is a required field.
|
|
3763
|
+
*/
|
|
3764
|
+
declare class SubagentStarted extends SubagentStarted_base {}
|
|
3765
|
+
declare const SubagentJoined_base: Schema.Class<SubagentJoined, Schema.TaggedStruct<"SubagentJoined", {
|
|
3766
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3767
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3768
|
+
readonly childSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
3769
|
+
readonly childSettlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
3770
|
+
readonly childOutcome: Schema.Literals<readonly ["completed", "failed", "aborted"]>;
|
|
3771
|
+
readonly childResultDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3772
|
+
readonly projectedResultDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3773
|
+
readonly usageSummary: Schema.declare<Schema.Json, Schema.Json>;
|
|
3774
|
+
readonly usage: Schema.optionalKey<typeof RunTotals>;
|
|
3775
|
+
readonly delegatedUsage: Schema.optionalKey<typeof RunTotals>;
|
|
3776
|
+
readonly reservationId: Schema.NonEmptyString;
|
|
3777
|
+
readonly finalAccounting: Schema.declare<Schema.Json, Schema.Json>;
|
|
3778
|
+
}>, {}>;
|
|
3779
|
+
/**
|
|
3780
|
+
* PARENT-log record of one verified child settlement join:
|
|
3781
|
+
* the child's canonical Settlement identity and outcome, the digests pinning the verified child
|
|
3782
|
+
* result and the bounded projected parent result, the child usage summary, and the FINAL
|
|
3783
|
+
* consumed/released accounting decision for the reservation. It commits in ONE atomic batch with
|
|
3784
|
+
* the parent `ToolCallSettled` record (SUB-019); `beginChildBudgetRelease` replays
|
|
3785
|
+
* `finalAccounting` from this record, so canonical history authorizes the release (DUR-015).
|
|
3786
|
+
*/
|
|
3787
|
+
declare class SubagentJoined extends SubagentJoined_base {}
|
|
3788
|
+
declare const SubagentLineageRecorded_base: Schema.Class<SubagentLineageRecorded, Schema.TaggedStruct<"SubagentLineageRecorded", {
|
|
3789
|
+
readonly parentLink: typeof SubagentParentLink;
|
|
3790
|
+
readonly parentSubmissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
3791
|
+
readonly childDefinitionDigests: typeof DefinitionDigests;
|
|
3792
|
+
readonly childInputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3793
|
+
readonly grantDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
3794
|
+
/** Copied from the canonical request before readiness; restored for every child Attempt. */
|
|
3795
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
3796
|
+
readonly policy: Schema.optionalKey<Schema.toCodecJson<typeof AgentPolicy>>;
|
|
3797
|
+
readonly budget: Schema.optionalKey<Schema.Struct<{
|
|
3798
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
3799
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
3800
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
3801
|
+
}>>;
|
|
3802
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
3803
|
+
}>, {}>;
|
|
3804
|
+
/**
|
|
3805
|
+
* CHILD-log immutable lineage: the Parent Link plus the digests that pin
|
|
3806
|
+
* the child's definition, input, and authority grant. It is the first record after the child's
|
|
3807
|
+
* `ThreadCreated` (its own single-record batch, so the generic `thread-created:{cid}`
|
|
3808
|
+
* batch identity is never contradicted) and the join path verifies it fail-closed — a fabricated
|
|
3809
|
+
* child or parent identity fails Parent Link verification (SUB-004, D10).
|
|
3810
|
+
*/
|
|
3811
|
+
declare class SubagentLineageRecorded extends SubagentLineageRecorded_base {}
|
|
3812
|
+
declare const WorkerReportingIntent: Schema.Struct<{
|
|
3813
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
3814
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
3815
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
3816
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
3817
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
3818
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
3819
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
3820
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
3821
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
3822
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3823
|
+
readonly depth: Schema.Natural;
|
|
3824
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
3825
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
3826
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3827
|
+
}>>;
|
|
3828
|
+
}>;
|
|
3829
|
+
/** Immutable worker Thread origin. Each input has its own digest and parameters separately. */
|
|
3830
|
+
declare const WorkerOrigin: Schema.Struct<{
|
|
3831
|
+
readonly worker: Schema.Struct<{
|
|
3832
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3833
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3834
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3835
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3836
|
+
}>;
|
|
3837
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
3838
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
3839
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3840
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3841
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3842
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3843
|
+
}>, Schema.Struct<{
|
|
3844
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
3845
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3846
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3847
|
+
}>]>;
|
|
3848
|
+
/** Omitted retains source-subtree funding; worker-run renews only for a new native Run. */
|
|
3849
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
3850
|
+
/** Frozen at worker creation; older origins remain reusable. */
|
|
3851
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
3852
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
3853
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3854
|
+
readonly budget: Schema.Struct<{
|
|
3855
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
3856
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
3857
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
3858
|
+
}>;
|
|
3859
|
+
readonly grant: typeof SubagentGrant;
|
|
3860
|
+
readonly depth: Schema.Int;
|
|
3861
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
3862
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3863
|
+
readonly createdAtMillis: Schema.Natural;
|
|
3864
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
3865
|
+
/** Exact source registration owns projection; absence means reporting was not declared. */
|
|
3866
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
3867
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
3868
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
3869
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
3870
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
3871
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
3872
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
3873
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
3874
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
3875
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
3876
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3877
|
+
readonly depth: Schema.Natural;
|
|
3878
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
3879
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
3880
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3881
|
+
}>>;
|
|
3882
|
+
}>>;
|
|
3883
|
+
}>;
|
|
3884
|
+
type WorkerOrigin = typeof WorkerOrigin.Type;
|
|
3885
|
+
/** Frozen per-input metadata; it grants no attached-child or parent-abort semantics. */
|
|
3886
|
+
declare const WorkerAdmission: Schema.Struct<{
|
|
3887
|
+
readonly origin: Schema.Struct<{
|
|
3888
|
+
readonly worker: Schema.Struct<{
|
|
3889
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3890
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3891
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3892
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3893
|
+
}>;
|
|
3894
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
3895
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
3896
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3897
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3898
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3899
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3900
|
+
}>, Schema.Struct<{
|
|
3901
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
3902
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3903
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3904
|
+
}>]>;
|
|
3905
|
+
/** Omitted retains source-subtree funding; worker-run renews only for a new native Run. */
|
|
3906
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
3907
|
+
/** Frozen at worker creation; older origins remain reusable. */
|
|
3908
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
3909
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
3910
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3911
|
+
readonly budget: Schema.Struct<{
|
|
3912
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
3913
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
3914
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
3915
|
+
}>;
|
|
3916
|
+
readonly grant: typeof SubagentGrant;
|
|
3917
|
+
readonly depth: Schema.Int;
|
|
3918
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
3919
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3920
|
+
readonly createdAtMillis: Schema.Natural;
|
|
3921
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
3922
|
+
/** Exact source registration owns projection; absence means reporting was not declared. */
|
|
3923
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
3924
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
3925
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
3926
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
3927
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
3928
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
3929
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
3930
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
3931
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
3932
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
3933
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3934
|
+
readonly depth: Schema.Natural;
|
|
3935
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
3936
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
3937
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
3938
|
+
}>>;
|
|
3939
|
+
}>>;
|
|
3940
|
+
}>;
|
|
3941
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3942
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
3943
|
+
readonly createdAtMillis: Schema.Natural;
|
|
3944
|
+
/** Host-bound source input whose subtree funds this input; never chosen by a model. */
|
|
3945
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
3946
|
+
/** Enables routed receipt lookup when the delivery is owned by a reporting child. */
|
|
3947
|
+
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
3948
|
+
/** Proven framework updates use a separate bounded input-capacity partition. */
|
|
3949
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
3950
|
+
}>;
|
|
3951
|
+
type WorkerAdmission = typeof WorkerAdmission.Type;
|
|
3952
|
+
declare const WorkerStopRequested_base: Schema.Class<WorkerStopRequested, Schema.TaggedStruct<"WorkerStopRequested", {
|
|
3953
|
+
readonly command: Schema.Struct<{
|
|
3954
|
+
readonly worker: Schema.Struct<{
|
|
3955
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3956
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3957
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3958
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3959
|
+
}>;
|
|
3960
|
+
readonly idempotencyKey: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
3961
|
+
}>;
|
|
3962
|
+
}>, {}>;
|
|
3963
|
+
/** Owner command retained before the destination inbox is sealed. */
|
|
3964
|
+
declare class WorkerStopRequested extends WorkerStopRequested_base {}
|
|
3965
|
+
declare const WorkerInputRequested_base: Schema.Class<WorkerInputRequested, Schema.TaggedStruct<"WorkerInputRequested", {
|
|
3966
|
+
readonly admission: Schema.Struct<{
|
|
3967
|
+
readonly origin: Schema.Struct<{
|
|
3968
|
+
readonly worker: Schema.Struct<{
|
|
3969
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
3970
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
3971
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3972
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3973
|
+
}>;
|
|
3974
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
3975
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
3976
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3977
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3978
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
3979
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
3980
|
+
}>, Schema.Struct<{
|
|
3981
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
3982
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
3983
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
3984
|
+
}>]>;
|
|
3985
|
+
/** Omitted retains source-subtree funding; worker-run renews only for a new native Run. */
|
|
3986
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
3987
|
+
/** Frozen at worker creation; older origins remain reusable. */
|
|
3988
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
3989
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
3990
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
3991
|
+
readonly budget: Schema.Struct<{
|
|
3992
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
3993
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
3994
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
3995
|
+
}>;
|
|
3996
|
+
readonly grant: typeof SubagentGrant;
|
|
3997
|
+
readonly depth: Schema.Int;
|
|
3998
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
3999
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4000
|
+
readonly createdAtMillis: Schema.Natural;
|
|
4001
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
4002
|
+
/** Exact source registration owns projection; absence means reporting was not declared. */
|
|
4003
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
4004
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
4005
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
4006
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
4007
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
4008
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
4009
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
4010
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
4011
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
4012
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
4013
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
4014
|
+
readonly depth: Schema.Natural;
|
|
4015
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
4016
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
4017
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
4018
|
+
}>>;
|
|
4019
|
+
}>>;
|
|
4020
|
+
}>;
|
|
4021
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4022
|
+
readonly parameters: Schema.declare<Schema.Json, Schema.Json>;
|
|
4023
|
+
readonly createdAtMillis: Schema.Natural;
|
|
4024
|
+
/** Host-bound source input whose subtree funds this input; never chosen by a model. */
|
|
4025
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
4026
|
+
/** Enables routed receipt lookup when the delivery is owned by a reporting child. */
|
|
4027
|
+
readonly deliveryPrincipal: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">>;
|
|
4028
|
+
/** Proven framework updates use a separate bounded input-capacity partition. */
|
|
4029
|
+
readonly reportKind: Schema.optionalKey<Schema.Literal<"update">>;
|
|
4030
|
+
}>;
|
|
4031
|
+
readonly inputDigest: Schema.brand<Schema.String, "@effect-agent/thread/Digest">;
|
|
4032
|
+
}>, {}>;
|
|
4033
|
+
/** Source-log capacity reservation, retained independently of the source Run's settlement. */
|
|
4034
|
+
declare class WorkerInputRequested extends WorkerInputRequested_base {}
|
|
4035
|
+
declare const WorkerOriginRecorded_base: Schema.Class<WorkerOriginRecorded, Schema.TaggedStruct<"WorkerOriginRecorded", {
|
|
4036
|
+
readonly origin: Schema.Struct<{
|
|
4037
|
+
readonly worker: Schema.Struct<{
|
|
4038
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
4039
|
+
readonly delegationId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">;
|
|
4040
|
+
readonly targetAgentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
4041
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4042
|
+
}>;
|
|
4043
|
+
readonly source: Schema.Union<readonly [Schema.Struct<{
|
|
4044
|
+
readonly _tag: Schema.Literal<"tool">;
|
|
4045
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
4046
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4047
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
4048
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
4049
|
+
}>, Schema.Struct<{
|
|
4050
|
+
readonly _tag: Schema.Literal<"programmatic">;
|
|
4051
|
+
readonly agentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/AgentId">;
|
|
4052
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4053
|
+
}>]>;
|
|
4054
|
+
/** Omitted retains source-subtree funding; worker-run renews only for a new native Run. */
|
|
4055
|
+
readonly budgetScope: Schema.optionalKey<Schema.Literals<readonly ["source-subtree", "worker-run"]>>;
|
|
4056
|
+
/** Frozen at worker creation; older origins remain reusable. */
|
|
4057
|
+
readonly lifecycle: Schema.optionalKey<Schema.Literal<"assignment">>;
|
|
4058
|
+
readonly targetDigests: typeof DefinitionDigests;
|
|
4059
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
4060
|
+
readonly budget: Schema.Struct<{
|
|
4061
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
4062
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
4063
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
4064
|
+
}>;
|
|
4065
|
+
readonly grant: typeof SubagentGrant;
|
|
4066
|
+
readonly depth: Schema.Int;
|
|
4067
|
+
readonly toolCallAllowance: Schema.optionalKey<Schema.Int>;
|
|
4068
|
+
readonly firstMessageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4069
|
+
readonly createdAtMillis: Schema.Natural;
|
|
4070
|
+
readonly expiresAtMillis: Schema.Natural;
|
|
4071
|
+
/** Exact source registration owns projection; absence means reporting was not declared. */
|
|
4072
|
+
readonly reporting: Schema.optionalKey<Schema.Struct<{
|
|
4073
|
+
/** Absent only in historical custom-report origins; these remain readable as evidence. */
|
|
4074
|
+
readonly mode: Schema.optionalKey<Schema.Literal<"standard">>;
|
|
4075
|
+
readonly sourceDigests: typeof DefinitionDigests;
|
|
4076
|
+
/** Historical custom destination evidence. New worker origins never write this field. */
|
|
4077
|
+
readonly destinationDelegationId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/DelegationId">>;
|
|
4078
|
+
/** Frozen by the sender before acceptance. Standard emission never reads the source runtime. */
|
|
4079
|
+
readonly returnAddress: Schema.optionalKey<Schema.Struct<{
|
|
4080
|
+
readonly input: Schema.declare<Schema.Json, Schema.Json>;
|
|
4081
|
+
readonly principal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
4082
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
4083
|
+
readonly depth: Schema.Natural;
|
|
4084
|
+
readonly grant: Schema.optionalKey<typeof SubagentGrant>;
|
|
4085
|
+
/** Encoded to bound recursive worker origins at the admission boundary. */
|
|
4086
|
+
readonly workerAdmission: Schema.optionalKey<Schema.declare<Schema.Json, Schema.Json>>;
|
|
4087
|
+
}>>;
|
|
4088
|
+
}>>;
|
|
4089
|
+
}>;
|
|
4090
|
+
}>, {}>;
|
|
4091
|
+
/** Child-log origin, reconstructed from a retained delivery before the child becomes ready. */
|
|
4092
|
+
declare class WorkerOriginRecorded extends WorkerOriginRecorded_base {}
|
|
4093
|
+
declare const WorkerInputCompleted_base: Schema.Class<WorkerInputCompleted, Schema.TaggedStruct<"WorkerInputCompleted", {
|
|
4094
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4095
|
+
readonly workerThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4096
|
+
readonly submissionId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">;
|
|
4097
|
+
readonly receiptId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ReceiptId">;
|
|
4098
|
+
readonly settlementId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SettlementId">;
|
|
4099
|
+
readonly completedAtMillis: Schema.Natural;
|
|
4100
|
+
/** New acknowledgements prove that this input's external effects are resolved. */
|
|
4101
|
+
readonly effectsResolved: Schema.optionalKey<Schema.Literal<true>>;
|
|
4102
|
+
}>, {}>;
|
|
4103
|
+
/** Canonical child completion acknowledgement releases only this input's active capacity. */
|
|
4104
|
+
declare class WorkerInputCompleted extends WorkerInputCompleted_base {}
|
|
4105
|
+
declare const WorkerReportPrepared_base: Schema.Class<WorkerReportPrepared, Schema.TaggedStruct<"WorkerReportPrepared", {
|
|
4106
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
4107
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4108
|
+
readonly envelope: Schema.declare<Schema.Json, Schema.Json>;
|
|
4109
|
+
readonly createdAtMillis: Schema.Natural;
|
|
4110
|
+
readonly deadlineAtMillis: Schema.Natural;
|
|
4111
|
+
readonly predecessor: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">>;
|
|
4112
|
+
}>, {}>;
|
|
4113
|
+
/**
|
|
4114
|
+
* Frozen report decision for one actual Run, shared by every joined Receipt. The envelope is
|
|
4115
|
+
* a Schema-encoded PreparedInput, validated before append and decoded again on recovery.
|
|
4116
|
+
* Keeping the encoded value here avoids a Records/PreparedInput schema dependency cycle.
|
|
4117
|
+
*/
|
|
4118
|
+
declare class WorkerReportPrepared extends WorkerReportPrepared_base {}
|
|
4119
|
+
declare const AgentUpdateEmitted_base: Schema.Class<AgentUpdateEmitted, Schema.TaggedStruct<"AgentUpdateEmitted", {
|
|
4120
|
+
readonly update: typeof Update;
|
|
4121
|
+
readonly definitions: typeof DefinitionDigests;
|
|
4122
|
+
readonly delivery: Schema.optionalKey<Schema.Struct<{
|
|
4123
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4124
|
+
readonly envelope: Schema.declare<Schema.Json, Schema.Json>;
|
|
4125
|
+
readonly createdAtMillis: Schema.Natural;
|
|
4126
|
+
readonly deadlineAtMillis: Schema.Natural;
|
|
4127
|
+
readonly predecessor: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">>;
|
|
4128
|
+
}>>;
|
|
4129
|
+
}>, {}>;
|
|
4130
|
+
/** Accepted update and its optional frozen parent delivery are one atomic canonical fact. */
|
|
4131
|
+
declare class AgentUpdateEmitted extends AgentUpdateEmitted_base {}
|
|
4132
|
+
declare const WorkerReportRefused_base: Schema.Class<WorkerReportRefused, Schema.TaggedStruct<"WorkerReportRefused", {
|
|
4133
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
4134
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4135
|
+
readonly reason: Schema.Literals<readonly ["declaration-unavailable", "destination", "projection", "input", "preparation", "timeout", "defect", "expired", "denied", "capacity"]>;
|
|
4136
|
+
}>, {}>;
|
|
4137
|
+
/** Permanent bounded report refusal. Application errors and raw Run dispositions stay private. */
|
|
4138
|
+
declare class WorkerReportRefused extends WorkerReportRefused_base {}
|
|
4139
|
+
declare const PeerMessagePrepared_base: Schema.Class<PeerMessagePrepared, Schema.TaggedStruct<"PeerMessagePrepared", {
|
|
4140
|
+
readonly messageId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/IdempotencyKey">;
|
|
4141
|
+
readonly sourcePrincipal: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/Principal">;
|
|
4142
|
+
readonly operation: Schema.Literals<readonly ["send", "reply"]>;
|
|
4143
|
+
readonly deadlineAtMillis: Schema.Int;
|
|
4144
|
+
readonly encodedEnvelope: Schema.declare<Schema.Json, Schema.Json>;
|
|
4145
|
+
}>, {}>;
|
|
4146
|
+
/** Frozen source proof of peer provenance, readable through routed canonical storage. */
|
|
4147
|
+
declare class PeerMessagePrepared extends PeerMessagePrepared_base {}
|
|
4148
|
+
declare const SubtreeBudgetReserved_base: Schema.Class<SubtreeBudgetReserved, Schema.TaggedStruct<"SubtreeBudgetReserved", {
|
|
4149
|
+
readonly reservationId: Schema.NonEmptyString;
|
|
4150
|
+
readonly sourceSubmissionId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/SubmissionId">>;
|
|
4151
|
+
readonly childThreadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4152
|
+
readonly lifetime: Schema.Literals<readonly ["attached", "background"]>;
|
|
4153
|
+
readonly depth: Schema.Int;
|
|
4154
|
+
readonly policy: Schema.toCodecJson<typeof AgentPolicy>;
|
|
4155
|
+
readonly grant: typeof SubagentGrant;
|
|
4156
|
+
readonly budget: Schema.Struct<{
|
|
4157
|
+
readonly caps: typeof SubagentDelegationCaps;
|
|
4158
|
+
readonly allocation: typeof SubagentReservationAmounts;
|
|
4159
|
+
readonly descendantInvocations: Schema.optionalKey<Schema.Natural>;
|
|
4160
|
+
}>;
|
|
4161
|
+
}>, {}>;
|
|
4162
|
+
/**
|
|
4163
|
+
* One disjoint subtree slice shared by attached and background children of a source input.
|
|
4164
|
+
* The source keeps its own execution ceiling; descendants spend only the remaining allocation.
|
|
4165
|
+
* Reservations include future descendant slots and never refund, including after interruption.
|
|
4166
|
+
* resultBytes reserves the terminal/projection result, not cumulative Tool output bytes.
|
|
4167
|
+
*/
|
|
4168
|
+
declare class SubtreeBudgetReserved extends SubtreeBudgetReserved_base {}
|
|
4169
|
+
/**
|
|
4170
|
+
* Current private-development canonical payload family. Phase 5 adds the seven durable-Tool tags
|
|
4171
|
+
* (prepared/unknown/resolved/step/approval-request/approval-decision/interrupted) additively; S2
|
|
4172
|
+
* adds the four durable-Subagent tags (requested/started/joined/lineage) additively, so the
|
|
4173
|
+
* envelope keeps `schemaVersion: 1` (P4 precedent for additive payload tags).
|
|
4174
|
+
*/
|
|
4175
|
+
declare const CanonicalRecordPayload: Schema.Union<readonly [typeof ThreadCreated, typeof UserInputRecorded, typeof RunStartedRecord, typeof RunDurationExhausted, typeof RunPolicyUsageReserved, typeof ModelCompleted, typeof ModelResponseRecorded, typeof ToolCallPrepared, typeof ToolCallSettled, typeof ToolCallUnknown, typeof ToolCallResolved, typeof ToolStepSettled, typeof ToolApprovalRequested, typeof ToolApprovalDecided, typeof ModelResponseInterrupted, typeof CompactionCreated, typeof RunFailed, typeof RunCompleted, typeof AbortRequested, Schema.refine<SubmissionSettledRecord, typeof SubmissionSettled>, typeof SubagentRequested, typeof SubagentStarted, typeof SubagentJoined, typeof SubagentLineageRecorded, typeof WorkerInputRequested, typeof WorkerStopRequested, typeof WorkerOriginRecorded, typeof WorkerInputCompleted, typeof WorkerReportPrepared, typeof AgentUpdateEmitted, typeof WorkerReportRefused, typeof PeerMessagePrepared, typeof SubtreeBudgetReserved, typeof RepairAnnotated]>;
|
|
4176
|
+
type CanonicalRecordPayload = typeof CanonicalRecordPayload.Type;
|
|
4177
|
+
declare const RecordEnvelope_base: Schema.Class<RecordEnvelope, Schema.Struct<{
|
|
4178
|
+
readonly recordId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/RecordId">;
|
|
4179
|
+
readonly family: Schema.Literal<"thread">;
|
|
4180
|
+
readonly schemaVersion: Schema.Literal<1>;
|
|
4181
|
+
readonly createdAt: Schema.DateTimeUtcFromString;
|
|
4182
|
+
readonly deploymentId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/DeploymentId">;
|
|
4183
|
+
readonly payload: Schema.Union<readonly [typeof ThreadCreated, typeof UserInputRecorded, typeof RunStartedRecord, typeof RunDurationExhausted, typeof RunPolicyUsageReserved, typeof ModelCompleted, typeof ModelResponseRecorded, typeof ToolCallPrepared, typeof ToolCallSettled, typeof ToolCallUnknown, typeof ToolCallResolved, typeof ToolStepSettled, typeof ToolApprovalRequested, typeof ToolApprovalDecided, typeof ModelResponseInterrupted, typeof CompactionCreated, typeof RunFailed, typeof RunCompleted, typeof AbortRequested, Schema.refine<SubmissionSettledRecord, typeof SubmissionSettled>, typeof SubagentRequested, typeof SubagentStarted, typeof SubagentJoined, typeof SubagentLineageRecorded, typeof WorkerInputRequested, typeof WorkerStopRequested, typeof WorkerOriginRecorded, typeof WorkerInputCompleted, typeof WorkerReportPrepared, typeof AgentUpdateEmitted, typeof WorkerReportRefused, typeof PeerMessagePrepared, typeof SubtreeBudgetReserved, typeof RepairAnnotated]>;
|
|
4184
|
+
}>, {}>;
|
|
4185
|
+
/**
|
|
4186
|
+
* Versioned record envelope stored in an atomic batch. Thread ordering is assigned only
|
|
4187
|
+
* when the batch is committed.
|
|
4188
|
+
*/
|
|
4189
|
+
declare class RecordEnvelope extends RecordEnvelope_base {}
|
|
4190
|
+
/** Backward-compatible domain name for a canonical record. */
|
|
4191
|
+
declare const CanonicalRecord: typeof RecordEnvelope;
|
|
4192
|
+
type CanonicalRecord = RecordEnvelope;
|
|
4193
|
+
declare const CanonicalBatch_base: Schema.Class<CanonicalBatch, Schema.Struct<{
|
|
4194
|
+
readonly batchId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/BatchId">;
|
|
4195
|
+
readonly producerId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ProducerId">;
|
|
4196
|
+
readonly records: Schema.NonEmptyArray<typeof RecordEnvelope>;
|
|
4197
|
+
}>, {}>;
|
|
4198
|
+
/** One non-empty, bounded, idempotent atomic append unit. */
|
|
4199
|
+
declare class CanonicalBatch extends CanonicalBatch_base {}
|
|
4200
|
+
declare const CanonicalRecordEnvelope_base: Schema.Class<CanonicalRecordEnvelope, Schema.Struct<{
|
|
4201
|
+
readonly threadId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ThreadId">;
|
|
4202
|
+
readonly batchId: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/BatchId">;
|
|
4203
|
+
readonly sequence: Schema.brand<Schema.Natural, "@effect-agent/thread/CanonicalSequence">;
|
|
4204
|
+
readonly offset: Schema.brand<Schema.NonEmptyString, "@effect-agent/thread/ObservationOffset">;
|
|
4205
|
+
readonly record: typeof RecordEnvelope;
|
|
4206
|
+
}>, {}>;
|
|
4207
|
+
/**
|
|
4208
|
+
* A committed record with its Thread ordering and opaque resumable observation cursor.
|
|
4209
|
+
*/
|
|
4210
|
+
declare class CanonicalRecordEnvelope extends CanonicalRecordEnvelope_base {}
|
|
4211
|
+
declare const CURRENT_CANONICAL_SCHEMA_VERSION: 1;
|
|
4212
|
+
//#endregion
|
|
4213
|
+
export { ToolCallPrepared as $, MarkUnknownRequest as $a, RecoveryEvidence as $i, modelResponseInterruptedRecordId as $n, ObligationSeverity as $r, FenceRejected as $t, ProducerId as A, ApprovalPendingSuspension as Aa, AppendReservedSettlement as Ai, getRecord as An, SubmissionState as Ao, turnApprovalsBatchId as Ar, DurableRetryFailure as At, RunStartedRecord as B, ChildSettledOutcome as Ba, CompleteChildAdmission as Bi, RunJournalProjection as Bn, WaitingChild as Bo, workerOriginRecordId as Br, RecoveryFailure as Bt, ModelCompleted as C, AdmissionPolicyError as Ca, DigestError as Ci, ThreadStoreDiagnostic as Cn, SubmissionLedger as Co, toolCallResolutionBatchId as Cr, DurableApprovalSuspension as Ct, PeerMessagePrepared as D, ApprovalConflict as Da, digestDefinition as Di, ThreadTail as Dn, SubmissionLookupById as Do, toolCallUnknownRecordId as Dr, DurableObserveOptions as Dt, ObservationOffset as E, AdmissionResult as Ea, digestCanonicalBatch as Ei, ThreadStore_d_exports as En, SubmissionLookup as Eo, toolCallSettledRecordId as Er, DurableObligationFailure as Et, ReplayContract as F, ChildBudgetReservationSnapshot as Fa, AwaitChildAdmissionResolution as Fi, SettledSubmission as Fn, SuspensionSnapshot as Fo, turnResponseBatch as Fr, DurableSubmitOptions as Ft, SubagentRequested as G, InputAppliedMarker as Ga, FinalizeLedgerFromHistory as Gi, approvalDecisionBatchId as Gn, submissionAbortBatchId as Go, ExplainedUnknownCall as Gr, isolateRecovery as Gt, SettlementOutcome as H, ClaimJoiningRequest as Ha, DeclaredPendingBatchEvidence as Hi, RunJournal_d_exports as Hn, WorkerLedgerState as Ho, Admin_d_exports as Hr, RecoverySweepOptions as Ht, RunCompleted as I, ChildReservationConflict as Ia, AwaitChildSettlement as Ii, SubmissionStatus as In, UnknownResolution as Io, turnResponseBatchId as Ir, DurableVerifyFailure as It, SubmissionSettledRecord as J, LedgerCapabilities as Ja, OpenDelegationCallEvidence as Ji, compactionBatchId as Jn, submissionInputRecordId as Jo, IntegrityCheckStatus as Jr, threadCreatedBatchId as Jt, SubagentStarted as K, JoinSnapshot as Ka, MarkUnknown as Ki, childIdempotencyKeyFor as Kn, submissionAbortRecordId as Ko, IntegrityCheck as Kr, recoveryRepairBatchId as Kt, RunDurationExhausted as L, ChildReservationId as La, AwaitHostSettlement as Li, SubmissionStatus_d_exports as Ln, UnknownResolutionCommand as Lo, turnResultsBatch as Lr, DurableWorkerFailure as Lt, RecordId as M, BeginChildBudgetReleaseRequest as Ma, ApplyJoinAccounting as Mi, readOutstanding as Mn, SuspendRequest as Mo, turnCanonicalBatch as Mr, DurableRuntimeConfigOptions as Mt, Records_d_exports as N, ChildAttachmentSnapshot as Na, ApplyUnknownResolutions as Ni, readWorkerState as Nn, SuspensionOutcome as No, turnIdForRun as Nr, DurableSubmitAgent as Nt, PersistedJson as O, ApprovalDecisionCommand as Oa, digestDefinitions as Oi, ThreadTailRequest as On, SubmissionLookupByKey as Oo, toolStepSettledBatchId as Or, DurableProgressFailure as Ot, RepairAnnotated as P, ChildBudgetReservationRequest as Pa, AwaitApprovalDecision as Pi, PendingSubmission as Pn, SuspensionReason as Po, turnPreparedBatchId as Pr, DurableSubmitFailure as Pt, ToolApprovalRequested as Q, MarkReadyRequest as Qa, RecoveryDecision as Qi, modelResponseInterruptedBatchId as Qn, workerTerminalFromRecord as Qo, ObligationReport as Qr, CheckpointRejected as Qt, RunFailed as R, ChildReservationStatus as Ra, AwaitParentEstablishment as Ri, JournalBoundary as Rn, UnknownResolutionConflict as Ro, turnResultsBatchId as Rr, DurableWorkerRequirements as Rt, MAX_PERSISTED_JSON_NODES as S, AdmissionNotAdmitted as Sa, definitionDigestsEqual as Si, ThreadStore as Sn, SubmissionAdmissionFence as So, toolCallPreparedRecordId as Sr, DurableApprovalResolver as St, ModelResponseRecorded as T, AdmissionResolution as Ta, EMPTY_TAIL_DIGEST as Ti, ThreadStoreFailure as Tn, SubmissionLedger_d_exports as To, toolCallResultBatchId as Tr, DurableExplainFailure as Tt, SubagentJoined as U, ClaimRequest as Ua, DelegationAdmissionEvidence as Ui, TurnCommitInput as Un, WorkerStopCommand as Uo, ExplainedEvidence as Ur, RecoverySweepResult as Ut, SettlementFailureDiagnostic as V, Claim as Va, CompleteMaterialization as Vi, RunJournalUsage as Vn, WaitingForChildSuspension as Vo, workerReportRecordId as Vr, RecoveryReport as Vt, SubagentLineageRecorded as W, DEFAULT_OWNERSHIP_LEASE_DURATION as Wa, EnsureWaitingForChild as Wi, agentUpdateRecordId as Wn, settlementFailureFromRecord as Wo, ExplainedSubmission as Wr, childReservationIdFor as Wt, ThreadCreated as X, MarkInputAppliedRequest as Xa, PendingApprovalEvidence as Xi, firstWorkerInputRecordId as Xn, submissionSettlementId as Xo, ObligationBlockedOn as Xr, AppendConflict as Xt, SubtreeBudgetReserved as Y, LedgerError as Ya, OpenToolCallEvidence as Yi, compactionRecordId as Yn, submissionSettlementBatchId as Yo, IntegrityReport as Yr, threadCreatedRecordId as Yt, ToolApprovalDecided as Z, MarkJoinedRequest as Za, PropagateChildAbort as Zi, markUnknownBatchId as Zn, submissionSettlementRecordId as Zo, ObligationEntry as Zr, AppendResult as Zt, Digest as _, AdmissionAdmitted as _a, ExecutableAgentBinding as _i, ThreadReadRequest as _n, Settlement as _o, subagentRequestedRecordId as _r, ApprovalSuspensionError as _t, BatchId as a, RepairSubagentStartLink as aa, RetryRefusalReason as ai, SelectedThreadRead as an, RecoverySnapshot as ao, runCompletedRecordId as ar, ToolStepSettled as at, MAX_PERSISTED_JSON_COLLECTION_LENGTH as b, AdmissionGroup as ba, compileBindingContracts as bi, ThreadRunInputRequest as bn, SettlementReservation as bo, toolApprovalDecisionRecordId as br, DurableAgentRuntime_d_exports as bt, CanonicalRecord as c, ResumeSuspended as ca, predictRecoveryDisposition as ci, ThreadExport as cn, ReleaseOwnershipRequest as co, runDurationRecordId as cr, WorkerAdmission as ct, CanonicalSequence as d, SettleAborted as da, AgentRegistration_d_exports as di, ThreadNotMaterialized as dn, ReservedSettlement as do, runStartedRecordId as dr, WorkerOrigin as dt, Recovery_d_exports as ea, ObligationThresholds as ei, FencedAppendRequest as en, OwnershipLost as eo, modelResponseRecordId as er, ToolCallResolution as et, CompactionCreated as f, SettleJoinedWithHost as fa, AgentAttemptContext as fi, ThreadObservation as fn, ResolutionAbortSubmission as fo, subagentJoinBatchId as fr, WorkerOriginRecorded as ft, DeploymentId as g, AbortIntentRequest as ga, DurableWorkerBinding as gi, ThreadRead as gn, RevertJoiningRequest as go, subagentRequestedBatchId as gr, WorkerStopRequested as gt, DefinitionDigests as h, AbortIntent as ha, DurableBindingFailure as hi, ThreadPeerCountRequest as hn, ResolutionSafeToRetry as ho, subagentLineageRecordId as hr, WorkerReportingIntent as ht, ApprovalDecision as i, RepairReadiness as ia, RetryCommand as ii, SaveRecoveryCheckpointRequest as in, ParentLinkage as io, promptFromCanonicalRecords as ir, ToolOperation as it, RecordEnvelope as j, AttachChildToReservationRequest as ja, ApplyInput as ji, getRunInput as jn, SubmissionWorkItem as jo, turnBatchId as jr, DurableRuntimeConfig as jt, ProducerEpoch as k, ApprovalDecisionIntent as ka, digestJson as ki, ThreadWorkerStateRequest as kn, SubmissionSnapshot as ko, toolStepSettledRecordId as kr, DurableResolveFailure as kt, CanonicalRecordEnvelope as l, ResumeWaitingParent as la, recoveryDecisionMeaning as li, ThreadExportRequest as ln, RenewOwnershipRequest as lo, runIdForSubmission as lr, WorkerInputCompleted as lt, DefinitionDigestInput as m, AbortCommand as ma, BindingUnavailable as mi, ThreadOutstandingRequest as mn, ResolutionNeverHappened as mo, subagentLineageBatchId as mr, WorkerReportRefused as mt, AbortedSubmissionSettled as n, RepairInputMarker as na, RecoveryDisposition as ni, MAX_THREAD_EXPORT_RECORDS as nn, OwnershipSnapshot as no, projectRunJournal as nr, ToolCallSettled as nt, CURRENT_CANONICAL_SCHEMA_VERSION as o, ResumeFromTurnBoundary as oa, RetryRefused as oi, ThreadCheckpoint as on, RecoverySnapshotRequest as oo, runCompletionDigest as or, ToolUnavailable as ot, CompletedSubmissionSettled as p, classifyRecovery as pa, AgentRegistration as pi, ThreadOutstanding as pn, ResolutionCompletedWithResult as po, subagentJoinedRecordId as pr, WorkerReportPrepared as pt, SubmissionSettled as q, JoiningClaim as qa, NoAction as qi, childThreadIdFor as qn, submissionInputBatchId as qo, IntegrityCheckName as qr, recoveryRepairRecordId as qt, AgentUpdateEmitted as r, RepairJoinMarker as ra, RecoveryExplanation as ri, SaveCheckpointRequest as rn, OwnershipToken as ro, projectRunJournalStream as rr, ToolCallUnknown as rt, CanonicalBatch as s, ResumePendingToolBatch as sa, obligationSeverityOf as si, ThreadCheckpoints as sn, ReleaseChildBudgetRequest as so, runDurationBatchId as sr, UserInputRecorded as st, AbortRequested as t, ReleaseOrphanChildReservation as ta, RECOVERY_DECISION_MEANINGS as ti, LoadCheckpointRequest as tn, OwnershipRenewal as to, peerMessageRecordId as tr, ToolCallResolved as tt, CanonicalRecordPayload as u, RevertJoining as ua, renderRecoveryExplanation as ui, ThreadMaterialization as un, ReservedChildBudget as uo, runStartedBatchId as ur, WorkerInputRequested as ut, FailedSubmissionSettled as v, AdmissionConflict as va, ReplayVersions as vi, ThreadRecordRequest as vn, SettlementConflict as vo, subagentStartedBatchId as vr, DurableAbortFailure as vt, ModelResponseInterrupted as w, AdmissionRequest as wa, Digest_d_exports as wi, ThreadStoreError as wn, SubmissionLedgerFailure as wo, toolCallResolvedRecordId as wr, DurableAwaitFailure as wt, MAX_PERSISTED_JSON_DEPTH as x, AdmissionIndeterminate as xa, compileRegistrations as xi, ThreadSelection as xn, SettlementReservationSnapshot as xo, toolApprovalRequestRecordId as xr, DurableApprovalFailure as xt, MAX_PERSISTED_JSON_BYTES as y, AdmissionFence as ya, ResolvedBinding as yi, ThreadRecoveryCheckpoints as yn, SettlementFinalization as yo, subagentStartedRecordId as yr, DurableAgentRuntime as yt, RunPolicyUsageReserved as z, ChildSettledNotification as za, AwaitUnknownResolution as zi, RunJournalError as zn, UnknownResolutionIntent as zo, workerInputRecordId as zr, RecoveryBlocked as zt };
|
|
4214
|
+
//# sourceMappingURL=Records-D88mgvyS.d.mts.map
|