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