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,739 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { SettlementId, SubmissionId, ThreadId, ToolCallId } from "../core/Identifiers.mjs";
|
|
3
|
+
import { SettlementOutcome, ToolCallPrepared } from "./Records.mjs";
|
|
4
|
+
import { ChildReservationId, WaitingChild, submissionSettlementId } from "./SubmissionLedger.mjs";
|
|
5
|
+
import { Effect, Schema } from "effect";
|
|
6
|
+
//#region src/durable/Recovery.ts
|
|
7
|
+
var Recovery_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
AppendReservedSettlement: () => AppendReservedSettlement,
|
|
9
|
+
ApplyInput: () => ApplyInput,
|
|
10
|
+
ApplyJoinAccounting: () => ApplyJoinAccounting,
|
|
11
|
+
ApplyUnknownResolutions: () => ApplyUnknownResolutions,
|
|
12
|
+
AwaitApprovalDecision: () => AwaitApprovalDecision,
|
|
13
|
+
AwaitChildAdmissionResolution: () => AwaitChildAdmissionResolution,
|
|
14
|
+
AwaitChildSettlement: () => AwaitChildSettlement,
|
|
15
|
+
AwaitHostSettlement: () => AwaitHostSettlement,
|
|
16
|
+
AwaitParentEstablishment: () => AwaitParentEstablishment,
|
|
17
|
+
AwaitUnknownResolution: () => AwaitUnknownResolution,
|
|
18
|
+
CompleteChildAdmission: () => CompleteChildAdmission,
|
|
19
|
+
CompleteMaterialization: () => CompleteMaterialization,
|
|
20
|
+
DeclaredPendingBatchEvidence: () => DeclaredPendingBatchEvidence,
|
|
21
|
+
DelegationAdmissionEvidence: () => DelegationAdmissionEvidence,
|
|
22
|
+
EnsureWaitingForChild: () => EnsureWaitingForChild,
|
|
23
|
+
FinalizeLedgerFromHistory: () => FinalizeLedgerFromHistory,
|
|
24
|
+
MarkUnknown: () => MarkUnknown,
|
|
25
|
+
NoAction: () => NoAction,
|
|
26
|
+
OpenDelegationCallEvidence: () => OpenDelegationCallEvidence,
|
|
27
|
+
OpenToolCallEvidence: () => OpenToolCallEvidence,
|
|
28
|
+
PendingApprovalEvidence: () => PendingApprovalEvidence,
|
|
29
|
+
PropagateChildAbort: () => PropagateChildAbort,
|
|
30
|
+
RecoveryDecision: () => RecoveryDecision,
|
|
31
|
+
RecoveryEvidence: () => RecoveryEvidence,
|
|
32
|
+
ReleaseOrphanChildReservation: () => ReleaseOrphanChildReservation,
|
|
33
|
+
RepairInputMarker: () => RepairInputMarker,
|
|
34
|
+
RepairJoinMarker: () => RepairJoinMarker,
|
|
35
|
+
RepairReadiness: () => RepairReadiness,
|
|
36
|
+
RepairSubagentStartLink: () => RepairSubagentStartLink,
|
|
37
|
+
ResumeFromTurnBoundary: () => ResumeFromTurnBoundary,
|
|
38
|
+
ResumePendingToolBatch: () => ResumePendingToolBatch,
|
|
39
|
+
ResumeSuspended: () => ResumeSuspended,
|
|
40
|
+
ResumeWaitingParent: () => ResumeWaitingParent,
|
|
41
|
+
RevertJoining: () => RevertJoining,
|
|
42
|
+
SettleAborted: () => SettleAborted,
|
|
43
|
+
SettleJoinedWithHost: () => SettleJoinedWithHost,
|
|
44
|
+
classifyRecovery: () => classifyRecovery
|
|
45
|
+
});
|
|
46
|
+
/** One canonical `ToolCallPrepared` without a settling or resolving canonical record (DUR-009). */
|
|
47
|
+
var OpenToolCallEvidence = class extends Schema.Class("@effect-agent/thread/OpenToolCallEvidence")({
|
|
48
|
+
toolCallId: ToolCallId,
|
|
49
|
+
toolName: ToolCallPrepared.fields.toolName,
|
|
50
|
+
turn: ToolCallPrepared.fields.turn
|
|
51
|
+
}) {};
|
|
52
|
+
/**
|
|
53
|
+
* A committed tool-declaring response with ZERO prepared and ZERO settled records for its Turn:
|
|
54
|
+
* the provably-safe durability §15 window — no prepared records means no handler ran, so the
|
|
55
|
+
* declared batch resumes without model re-invocation and without Unknown.
|
|
56
|
+
*/
|
|
57
|
+
var DeclaredPendingBatchEvidence = class extends Schema.Class("@effect-agent/thread/DeclaredPendingBatchEvidence")({
|
|
58
|
+
turn: ToolCallPrepared.fields.turn,
|
|
59
|
+
callCount: Schema.Int.check(Schema.isGreaterThan(0))
|
|
60
|
+
}) {};
|
|
61
|
+
/** One canonical `ToolApprovalRequested` without a canonical `ToolApprovalDecided`. */
|
|
62
|
+
var PendingApprovalEvidence = class extends Schema.Class("@effect-agent/thread/PendingApprovalEvidence")({
|
|
63
|
+
toolCallId: ToolCallId,
|
|
64
|
+
turn: ToolCallPrepared.fields.turn
|
|
65
|
+
}) {};
|
|
66
|
+
/**
|
|
67
|
+
* The authoritative tri-state admission answer recorded as pure classifier evidence (SUB-031):
|
|
68
|
+
* the recovery pass queries `resolveAdmission` with the deterministic child idempotency key for
|
|
69
|
+
* a requested-but-unstarted delegation call and records the result here. Absence of this field
|
|
70
|
+
* means the lookup was not performed — the classifier treats that exactly like `indeterminate`
|
|
71
|
+
* (fail-closed: only a proven `not-admitted` ever permits an admission attempt).
|
|
72
|
+
*/
|
|
73
|
+
const DelegationAdmissionEvidence = Schema.Literals([
|
|
74
|
+
"not-admitted",
|
|
75
|
+
"admitted",
|
|
76
|
+
"indeterminate"
|
|
77
|
+
]);
|
|
78
|
+
/**
|
|
79
|
+
* One prepared-without-outcome parent Tool Call that IS a delegation (plan §4.1), separated from
|
|
80
|
+
* `openToolCalls` because its establishment protocol is idempotent by construction and must
|
|
81
|
+
* NEVER be marked Unknown (spec §13 vs. DUR-009). Delegation detection is durable and
|
|
82
|
+
* fail-closed: canonical preparation records carry the definition-owned execution kind;
|
|
83
|
+
* child reservations and request records must agree with that classification. Names never
|
|
84
|
+
* authorize replay, including in the pre-reservation window. The
|
|
85
|
+
* `requested`/`started`/`joined` flags come from the parent-log canonical records; the child
|
|
86
|
+
* identity fields are present exactly when those records (or the reservation attachment) carry
|
|
87
|
+
* them.
|
|
88
|
+
*/
|
|
89
|
+
var OpenDelegationCallEvidence = class extends Schema.Class("@effect-agent/thread/OpenDelegationCallEvidence")({
|
|
90
|
+
toolCallId: ToolCallId,
|
|
91
|
+
toolName: ToolCallPrepared.fields.toolName,
|
|
92
|
+
turn: ToolCallPrepared.fields.turn,
|
|
93
|
+
/** The canonical `SubagentRequested` record exists for this call. */
|
|
94
|
+
requested: Schema.Boolean,
|
|
95
|
+
/** The canonical `SubagentStarted` record exists for this call. */
|
|
96
|
+
started: Schema.Boolean,
|
|
97
|
+
/** The canonical `SubagentJoined` record exists for this call. */
|
|
98
|
+
joined: Schema.Boolean,
|
|
99
|
+
childThreadId: Schema.optionalKey(ThreadId),
|
|
100
|
+
childSubmissionId: Schema.optionalKey(SubmissionId),
|
|
101
|
+
admission: Schema.optionalKey(DelegationAdmissionEvidence)
|
|
102
|
+
}) {};
|
|
103
|
+
/**
|
|
104
|
+
* Canonical-log facts about one Submission, read strongly consistently alongside the ledger
|
|
105
|
+
* `RecoverySnapshot` (STORE-003). Canonical history wins over every ledger marker (DUR-015), so
|
|
106
|
+
* the classifier consults these facts before trusting ledger state — with one deliberate Phase 5
|
|
107
|
+
* inversion: a RECORDED terminal outcome now beats open tool calls, because a canonical
|
|
108
|
+
* settlement is never revisited (DUR-002/DUR-015); the P4 rule that unknown-beats-settlement is
|
|
109
|
+
* gone.
|
|
110
|
+
*
|
|
111
|
+
* `openToolCalls` is the DUR-009 seam: every `ToolCallPrepared` without a matching
|
|
112
|
+
* `ToolCallSettled` or `ToolCallResolved`. S2 separates `openDelegationCalls` from it (plan
|
|
113
|
+
* §4.1): a delegation's prepared-without-outcome state is provably replay-safe, so those calls
|
|
114
|
+
* route through the Subagent recovery rows and never through `MarkUnknown`. Names and
|
|
115
|
+
* operational reservation rows cannot upgrade ordinary classification. `joinedInputCovered`
|
|
116
|
+
* implements the plan §2.5 prompt-coverage rule for the joined side: a joined input is covered
|
|
117
|
+
* iff a later `ModelResponseRecorded` of the host Run exists after the `input:{sid}` record.
|
|
118
|
+
* `hostSettlementOutcome` is the joined-side view of the host's canonical `SubmissionSettled`
|
|
119
|
+
* record, present exactly when that record exists.
|
|
120
|
+
*/
|
|
121
|
+
var RecoveryEvidence = class extends Schema.Class("@effect-agent/thread/RecoveryEvidence")({
|
|
122
|
+
/** The Thread exists in the ThreadStore. */
|
|
123
|
+
threadMaterialized: Schema.Boolean,
|
|
124
|
+
/** The deterministic canonical `UserInputRecorded` record (`input:{sid}`) is committed. */
|
|
125
|
+
inputRecorded: Schema.Boolean,
|
|
126
|
+
/**
|
|
127
|
+
* The committed canonical `SubmissionSettled` outcome (`settlement:{sid}`). Present exactly
|
|
128
|
+
* when the canonical settlement record exists, so the flag and the outcome cannot diverge.
|
|
129
|
+
*/
|
|
130
|
+
recordedSettlementOutcome: Schema.optionalKey(SettlementOutcome),
|
|
131
|
+
/** The deterministic canonical `AbortRequested` record (`abort:{sid}`) is committed. */
|
|
132
|
+
abortRecorded: Schema.Boolean,
|
|
133
|
+
/** Prepared ordinary Tool Calls without a canonical settled/resolved outcome (DUR-009). */
|
|
134
|
+
openToolCalls: Schema.Array(OpenToolCallEvidence),
|
|
135
|
+
/**
|
|
136
|
+
* Delegation Tool Calls with an open parent-side obligation (plan §4.1), removed from
|
|
137
|
+
* `openToolCalls`. Wire-required; construction alone defaults it so pre-S2 evidence
|
|
138
|
+
* assemblers stay valid while the classifier's fail-closed detection still protects them.
|
|
139
|
+
*/
|
|
140
|
+
openDelegationCalls: Schema.Array(OpenDelegationCallEvidence).pipe(Schema.withConstructorDefault(Effect.succeed([]))),
|
|
141
|
+
/** Only persisted orchestration classification authorizes idempotent host-operation replay. */
|
|
142
|
+
openWorkerCalls: Schema.optionalKey(Schema.Array(OpenToolCallEvidence)),
|
|
143
|
+
/** A declared-but-unprepared tool batch: response canonical, zero prepared, zero settled. */
|
|
144
|
+
declaredPendingBatch: Schema.optionalKey(DeclaredPendingBatchEvidence),
|
|
145
|
+
/** Canonically requested approvals without a canonical decision. */
|
|
146
|
+
approvalsPending: Schema.Array(PendingApprovalEvidence),
|
|
147
|
+
/** Joined-side prompt coverage (plan §2.5); `true` whenever the Submission is not joined. */
|
|
148
|
+
joinedInputCovered: Schema.Boolean,
|
|
149
|
+
/** Joined-side view of the host's canonical settlement record, when it exists. */
|
|
150
|
+
hostSettlementOutcome: Schema.optionalKey(SettlementOutcome),
|
|
151
|
+
/**
|
|
152
|
+
* The Thread carries its canonical `SubagentLineageRecorded` record. Only
|
|
153
|
+
* consulted for a parent-linked Submission: a child whose lineage is not yet canonical defers
|
|
154
|
+
* its own materialization/readiness repair to the parent's idempotent establishment
|
|
155
|
+
* (`AwaitParentEstablishment`). Defaults to `false` so an assembler that does not compute it
|
|
156
|
+
* stays fail-closed: deferring is safe because the parent's establishment completes the child;
|
|
157
|
+
* running a Turn before lineage is recorded would violate the child establishment ordering.
|
|
158
|
+
*/
|
|
159
|
+
subagentLineageRecorded: Schema.Boolean.pipe(Schema.withConstructorDefault(Effect.succeed(false)))
|
|
160
|
+
}) {};
|
|
161
|
+
/** Ledger admission committed but the Thread is not durable: finish materialization,
|
|
162
|
+
* append `ThreadCreated`, and mark readiness (crash between admit and materialize). */
|
|
163
|
+
var CompleteMaterialization = class extends Schema.TaggedClass("@effect-agent/thread/CompleteMaterialization")("CompleteMaterialization", { submissionId: SubmissionId }) {};
|
|
164
|
+
/** Thread durable but the readiness marker is missing: idempotent `markReady`. */
|
|
165
|
+
var RepairReadiness = class extends Schema.TaggedClass("@effect-agent/thread/RepairReadiness")("RepairReadiness", { submissionId: SubmissionId }) {};
|
|
166
|
+
/** No canonical input yet: append the deterministic `UserInputRecorded` record and mark it. */
|
|
167
|
+
var ApplyInput = class extends Schema.TaggedClass("@effect-agent/thread/ApplyInput")("ApplyInput", { submissionId: SubmissionId }) {};
|
|
168
|
+
/** Canonical input exists but the ledger marker was lost: repair the marker only (DUR-015). */
|
|
169
|
+
var RepairInputMarker = class extends Schema.TaggedClass("@effect-agent/thread/RepairInputMarker")("RepairInputMarker", { submissionId: SubmissionId }) {};
|
|
170
|
+
/** Input applied and no terminal work reserved: a worker resumes the Run from the last committed
|
|
171
|
+
* Turn boundary (D6; the model may be re-invoked, duplicate cost is observable — the resuming
|
|
172
|
+
* worker appends `ModelResponseInterrupted` when superseding a prior owner, durability §9). */
|
|
173
|
+
var ResumeFromTurnBoundary = class extends Schema.TaggedClass("@effect-agent/thread/ResumeFromTurnBoundary")("ResumeFromTurnBoundary", { submissionId: SubmissionId }) {};
|
|
174
|
+
/** A settlement is reserved but not canonical: append the EXACT reserved record, then finalize. */
|
|
175
|
+
var AppendReservedSettlement = class extends Schema.TaggedClass("@effect-agent/thread/AppendReservedSettlement")("AppendReservedSettlement", {
|
|
176
|
+
submissionId: SubmissionId,
|
|
177
|
+
settlementId: SettlementId,
|
|
178
|
+
outcome: SettlementOutcome
|
|
179
|
+
}) {};
|
|
180
|
+
/** The canonical settlement record exists: rebuild/finalize the ledger from history and never
|
|
181
|
+
* rewrite history from the cached ledger status (DUR-011, DUR-015). */
|
|
182
|
+
var FinalizeLedgerFromHistory = class extends Schema.TaggedClass("@effect-agent/thread/FinalizeLedgerFromHistory")("FinalizeLedgerFromHistory", {
|
|
183
|
+
submissionId: SubmissionId,
|
|
184
|
+
settlementId: SettlementId,
|
|
185
|
+
outcome: SettlementOutcome
|
|
186
|
+
}) {};
|
|
187
|
+
/** A durable abort intent exists, no terminal outcome is reserved, and no attached-child
|
|
188
|
+
* obligation remains open: settle aborted (DUR-012). The executor first appends
|
|
189
|
+
* `ToolCallUnknown` audit records for any open ordinary calls — abort settles the obligation but
|
|
190
|
+
* never asserts external rollback (durability §13). */
|
|
191
|
+
var SettleAborted = class extends Schema.TaggedClass("@effect-agent/thread/SettleAborted")("SettleAborted", { submissionId: SubmissionId }) {};
|
|
192
|
+
/** Prepared ordinary Tool Calls have no canonical outcome: the executor reconciles each open
|
|
193
|
+
* call (recovered result / never-started / safe-retry) and marks the remainder Unknown — never
|
|
194
|
+
* an automatic replay (DUR-009/DUR-017). Delegation calls are excluded: their establishment is
|
|
195
|
+
* idempotent by construction and routes through the Subagent rows instead (plan §4.3). */
|
|
196
|
+
var MarkUnknown = class extends Schema.TaggedClass("@effect-agent/thread/MarkUnknown")("MarkUnknown", {
|
|
197
|
+
submissionId: SubmissionId,
|
|
198
|
+
reason: Schema.String,
|
|
199
|
+
openToolCallIds: Schema.Array(ToolCallId)
|
|
200
|
+
}) {};
|
|
201
|
+
/** A committed tool-declaring response has zero prepared and zero settled records: a worker
|
|
202
|
+
* resumes the declared batch — no model re-invocation, no Unknown (durability §15). S2 also
|
|
203
|
+
* routes an open delegation call WITHOUT establishment evidence here (spec §13 row 1): the
|
|
204
|
+
* declared batch re-executes and the idempotent establishment converges on one child. */
|
|
205
|
+
var ResumePendingToolBatch = class extends Schema.TaggedClass("@effect-agent/thread/ResumePendingToolBatch")("ResumePendingToolBatch", {
|
|
206
|
+
submissionId: SubmissionId,
|
|
207
|
+
turn: DeclaredPendingBatchEvidence.fields.turn
|
|
208
|
+
}) {};
|
|
209
|
+
/** Canonically requested approvals lack decisions: the lane waits durably (the executor repairs
|
|
210
|
+
* the ledger suspension from history when the suspend transition itself was lost). */
|
|
211
|
+
var AwaitApprovalDecision = class extends Schema.TaggedClass("@effect-agent/thread/AwaitApprovalDecision")("AwaitApprovalDecision", { submissionId: SubmissionId }) {};
|
|
212
|
+
/** Every pending approval has a durable decision: a worker resumes the declared batch via the
|
|
213
|
+
* batch-resume seam, appending the canonical `ToolApprovalDecided` records first. */
|
|
214
|
+
var ResumeSuspended = class extends Schema.TaggedClass("@effect-agent/thread/ResumeSuspended")("ResumeSuspended", { submissionId: SubmissionId }) {};
|
|
215
|
+
/** Unknown Outcomes lack covering resolutions: the lane stays blocked awaiting the authorized
|
|
216
|
+
* DUR-017 resolution path; the obligation stays visible, nothing replays. */
|
|
217
|
+
var AwaitUnknownResolution = class extends Schema.TaggedClass("@effect-agent/thread/AwaitUnknownResolution")("AwaitUnknownResolution", { submissionId: SubmissionId }) {};
|
|
218
|
+
/** Durable resolution intents cover every open call: apply them canonically
|
|
219
|
+
* (`ToolCallResolved` + `ToolCallSettled` for recovered results) and reopen the lane. */
|
|
220
|
+
var ApplyUnknownResolutions = class extends Schema.TaggedClass("@effect-agent/thread/ApplyUnknownResolutions")("ApplyUnknownResolutions", { submissionId: SubmissionId }) {};
|
|
221
|
+
/** `joining` without a canonical `input:{sid}` record: revert to `ready` — the input was never
|
|
222
|
+
* consumed and will be delivered exactly once later (DUR-016). */
|
|
223
|
+
var RevertJoining = class extends Schema.TaggedClass("@effect-agent/thread/RevertJoining")("RevertJoining", { submissionId: SubmissionId }) {};
|
|
224
|
+
/** The canonical input exists but the `joined` marker was lost: repair the marker only, exactly
|
|
225
|
+
* like `RepairInputMarker` (DUR-015/DUR-016); the input reattaches, never duplicates. */
|
|
226
|
+
var RepairJoinMarker = class extends Schema.TaggedClass("@effect-agent/thread/RepairJoinMarker")("RepairJoinMarker", { submissionId: SubmissionId }) {};
|
|
227
|
+
/** The host Run settled canonically: settle this joined Submission with the host outcome
|
|
228
|
+
* (each joined Submission is owed its own settlement, DUR-002). */
|
|
229
|
+
var SettleJoinedWithHost = class extends Schema.TaggedClass("@effect-agent/thread/SettleJoinedWithHost")("SettleJoinedWithHost", {
|
|
230
|
+
submissionId: SubmissionId,
|
|
231
|
+
outcome: SettlementOutcome
|
|
232
|
+
}) {};
|
|
233
|
+
/** The Submission is `joined` and its host Run is still live: nothing to repair — the input
|
|
234
|
+
* reattaches through the host's resume and the Submission settles with the host. */
|
|
235
|
+
var AwaitHostSettlement = class extends Schema.TaggedClass("@effect-agent/thread/AwaitHostSettlement")("AwaitHostSettlement", {
|
|
236
|
+
submissionId: SubmissionId,
|
|
237
|
+
hostSubmissionId: Schema.optionalKey(SubmissionId)
|
|
238
|
+
}) {};
|
|
239
|
+
/** A canonical `SubagentRequested` exists and the authoritative admission lookup proved
|
|
240
|
+
* `notAdmitted`: idempotently admit the intended child from the canonical request payload — it
|
|
241
|
+
* carries the encoded child input (D3), the intended child identity, and every digest — then
|
|
242
|
+
* materialize the child Thread, append its immutable lineage, and mark it ready. No live
|
|
243
|
+
* delegation handler is required (spec §13, SUB-016/SUB-031). */
|
|
244
|
+
var CompleteChildAdmission = class extends Schema.TaggedClass("@effect-agent/thread/CompleteChildAdmission")("CompleteChildAdmission", {
|
|
245
|
+
submissionId: SubmissionId,
|
|
246
|
+
toolCallId: ToolCallId
|
|
247
|
+
}) {};
|
|
248
|
+
/** A canonical `SubagentRequested` exists but the authoritative admission lookup answered
|
|
249
|
+
* `indeterminate` — or was not (yet) performed: wait and retry the authoritative owner directly.
|
|
250
|
+
* Absence from a projection is never proof of absence and a second admission NEVER occurs
|
|
251
|
+
* (spec §12, SUB-031). */
|
|
252
|
+
var AwaitChildAdmissionResolution = class extends Schema.TaggedClass("@effect-agent/thread/AwaitChildAdmissionResolution")("AwaitChildAdmissionResolution", {
|
|
253
|
+
submissionId: SubmissionId,
|
|
254
|
+
toolCallId: ToolCallId
|
|
255
|
+
}) {};
|
|
256
|
+
/** The child Submission is admitted but the parent's `SubagentStarted` link is missing (or its
|
|
257
|
+
* reservation attachment was lost): resolve the SAME child by its deterministic idempotency key
|
|
258
|
+
* and append the exact deterministic start record, then attach the child to its reservation —
|
|
259
|
+
* the same Receipt on every replay (spec §13, SUB-016/SUB-017). */
|
|
260
|
+
var RepairSubagentStartLink = class extends Schema.TaggedClass("@effect-agent/thread/RepairSubagentStartLink")("RepairSubagentStartLink", {
|
|
261
|
+
submissionId: SubmissionId,
|
|
262
|
+
toolCallId: ToolCallId
|
|
263
|
+
}) {};
|
|
264
|
+
/** Children are established and at least one is nonterminal while the parent lane is NOT
|
|
265
|
+
* durably suspended: restore the `waitingForChild` suspension so the lane holds no worker
|
|
266
|
+
* permit while each child runs on its own lane. Recovery reattaches the one existing child and
|
|
267
|
+
* NEVER spawns a replacement (spec §13, SUB-018/SUB-030). */
|
|
268
|
+
var EnsureWaitingForChild = class extends Schema.TaggedClass("@effect-agent/thread/EnsureWaitingForChild")("EnsureWaitingForChild", {
|
|
269
|
+
submissionId: SubmissionId,
|
|
270
|
+
children: Schema.NonEmptyArray(WaitingChild)
|
|
271
|
+
}) {};
|
|
272
|
+
/** The parent is durably suspended `WaitingForChild` and at least one listed child is not yet
|
|
273
|
+
* provably settled: the lane stays dormant and consumes no permit; the child's Settlement wakes
|
|
274
|
+
* it durably (spec §12 step 10). An unresolved ordinary Tool inside a child keeps the parent
|
|
275
|
+
* here honestly — the obligation stays visible and aged, nothing is fabricated (SUB-021). */
|
|
276
|
+
var AwaitChildSettlement = class extends Schema.TaggedClass("@effect-agent/thread/AwaitChildSettlement")("AwaitChildSettlement", { submissionId: SubmissionId }) {};
|
|
277
|
+
/** Every relevant child is provably settled but the parent has not joined (legacy data, or a
|
|
278
|
+
* canonical settlement whose idempotent wake still needs replay): record/replay the durable wake
|
|
279
|
+
* so a claiming worker resumes the declared batch and joins each child's canonical Settlement —
|
|
280
|
+
* the join itself needs the parent Binding and is deferred to that worker (spec §13). */
|
|
281
|
+
var ResumeWaitingParent = class extends Schema.TaggedClass("@effect-agent/thread/ResumeWaitingParent")("ResumeWaitingParent", {
|
|
282
|
+
submissionId: SubmissionId,
|
|
283
|
+
children: Schema.NonEmptyArray(WaitingChild)
|
|
284
|
+
}) {};
|
|
285
|
+
/** The canonical `SubagentJoined` record exists but the reservation release is incomplete:
|
|
286
|
+
* replay `beginChildBudgetRelease` with the accounting decision FROM the canonical record, then
|
|
287
|
+
* apply `releaseChildBudget` — budget stays unavailable until repair, never available twice
|
|
288
|
+
* (spec §12 join step 6, DUR-015). */
|
|
289
|
+
var ApplyJoinAccounting = class extends Schema.TaggedClass("@effect-agent/thread/ApplyJoinAccounting")("ApplyJoinAccounting", {
|
|
290
|
+
submissionId: SubmissionId,
|
|
291
|
+
toolCallId: ToolCallId,
|
|
292
|
+
reservationId: ChildReservationId
|
|
293
|
+
}) {};
|
|
294
|
+
/** Parent abort is canonical while attached children are nonterminal: idempotently issue each
|
|
295
|
+
* child's durable abort command and keep the parent waiting for the joins —
|
|
296
|
+
* request-abort-and-join is the ONLY close behavior; the replayed command returns the recorded
|
|
297
|
+
* child intent unchanged, so the intent row IS the propagation marker (spec §13.1, SUB-022,
|
|
298
|
+
* DUR-012). */
|
|
299
|
+
var PropagateChildAbort = class extends Schema.TaggedClass("@effect-agent/thread/PropagateChildAbort")("PropagateChildAbort", {
|
|
300
|
+
submissionId: SubmissionId,
|
|
301
|
+
children: Schema.NonEmptyArray(WaitingChild)
|
|
302
|
+
}) {};
|
|
303
|
+
/** A child budget reservation can no longer bind a child — its request is absent with no
|
|
304
|
+
* resumable batch, or the parent is aborting and the child provably never admitted: freeze the
|
|
305
|
+
* deterministic zero-consumed accounting decision and release the unused allocation exactly
|
|
306
|
+
* once (spec §13/§14: "releases the reservation exactly once"). */
|
|
307
|
+
var ReleaseOrphanChildReservation = class extends Schema.TaggedClass("@effect-agent/thread/ReleaseOrphanChildReservation")("ReleaseOrphanChildReservation", {
|
|
308
|
+
submissionId: SubmissionId,
|
|
309
|
+
reservationIds: Schema.NonEmptyArray(ChildReservationId)
|
|
310
|
+
}) {};
|
|
311
|
+
/**
|
|
312
|
+
* A parent-linked `admitted` Submission whose Thread lacks the canonical
|
|
313
|
+
* `SubagentLineageRecorded` record: the child lane DEFERS its own materialization/readiness
|
|
314
|
+
* repair — the parent's idempotent establishment (admit → materialize → lineage → ready)
|
|
315
|
+
* completes it, so a child never runs a Turn before its lineage record is canonical.
|
|
316
|
+
* This preserves the child establishment ordering. It is ordering/liveness hygiene, not a
|
|
317
|
+
* safety repair — the join already fails closed without lineage (SUB-019).
|
|
318
|
+
*/
|
|
319
|
+
var AwaitParentEstablishment = class extends Schema.TaggedClass("@effect-agent/thread/AwaitParentEstablishment")("AwaitParentEstablishment", {
|
|
320
|
+
submissionId: SubmissionId,
|
|
321
|
+
parentSubmissionId: SubmissionId,
|
|
322
|
+
parentToolCallId: ToolCallId
|
|
323
|
+
}) {};
|
|
324
|
+
/** The Submission is settled; nothing is owed. */
|
|
325
|
+
var NoAction = class extends Schema.TaggedClass("@effect-agent/thread/NoAction")("NoAction", { submissionId: SubmissionId }) {};
|
|
326
|
+
/** The executable recovery decision table's output alphabet (plan §Recovery classifier). */
|
|
327
|
+
const RecoveryDecision = Schema.Union([
|
|
328
|
+
CompleteMaterialization,
|
|
329
|
+
RepairReadiness,
|
|
330
|
+
ApplyInput,
|
|
331
|
+
RepairInputMarker,
|
|
332
|
+
ResumeFromTurnBoundary,
|
|
333
|
+
AppendReservedSettlement,
|
|
334
|
+
FinalizeLedgerFromHistory,
|
|
335
|
+
SettleAborted,
|
|
336
|
+
MarkUnknown,
|
|
337
|
+
ResumePendingToolBatch,
|
|
338
|
+
AwaitApprovalDecision,
|
|
339
|
+
ResumeSuspended,
|
|
340
|
+
AwaitUnknownResolution,
|
|
341
|
+
ApplyUnknownResolutions,
|
|
342
|
+
RevertJoining,
|
|
343
|
+
RepairJoinMarker,
|
|
344
|
+
SettleJoinedWithHost,
|
|
345
|
+
AwaitHostSettlement,
|
|
346
|
+
CompleteChildAdmission,
|
|
347
|
+
AwaitChildAdmissionResolution,
|
|
348
|
+
RepairSubagentStartLink,
|
|
349
|
+
EnsureWaitingForChild,
|
|
350
|
+
AwaitChildSettlement,
|
|
351
|
+
ResumeWaitingParent,
|
|
352
|
+
ApplyJoinAccounting,
|
|
353
|
+
PropagateChildAbort,
|
|
354
|
+
ReleaseOrphanChildReservation,
|
|
355
|
+
AwaitParentEstablishment,
|
|
356
|
+
NoAction
|
|
357
|
+
]);
|
|
358
|
+
/** The attachment proves the child's canonical Settlement exists. */
|
|
359
|
+
const isTerminalAttachment = (attachment) => attachment.childState === "settled" || attachment.childOutcome !== void 0;
|
|
360
|
+
/**
|
|
361
|
+
* Merge every durable delegation-detection source into per-call views (plan §4.1): the
|
|
362
|
+
* explicitly classified `openDelegationCalls`, reservation rows and child attachments.
|
|
363
|
+
* Reservations may need cleanup, but never upgrade an ordinary call into a replayable delegation.
|
|
364
|
+
*/
|
|
365
|
+
const delegationViewsOf = (snapshot, evidence) => {
|
|
366
|
+
const views = /* @__PURE__ */ new Map();
|
|
367
|
+
const ensure = (toolCallId) => {
|
|
368
|
+
const existing = views.get(toolCallId);
|
|
369
|
+
if (existing !== void 0) return existing;
|
|
370
|
+
const created = {
|
|
371
|
+
toolCallId,
|
|
372
|
+
turn: void 0,
|
|
373
|
+
open: false,
|
|
374
|
+
requested: false,
|
|
375
|
+
started: false,
|
|
376
|
+
joined: false,
|
|
377
|
+
admission: void 0,
|
|
378
|
+
childSubmissionId: void 0,
|
|
379
|
+
reservation: void 0,
|
|
380
|
+
attachment: void 0
|
|
381
|
+
};
|
|
382
|
+
views.set(toolCallId, created);
|
|
383
|
+
return created;
|
|
384
|
+
};
|
|
385
|
+
for (const call of evidence.openDelegationCalls) {
|
|
386
|
+
const view = ensure(call.toolCallId);
|
|
387
|
+
view.turn = call.turn;
|
|
388
|
+
view.open = true;
|
|
389
|
+
view.requested = call.requested;
|
|
390
|
+
view.started = call.started;
|
|
391
|
+
view.joined = call.joined;
|
|
392
|
+
view.admission = call.admission;
|
|
393
|
+
view.childSubmissionId = call.childSubmissionId;
|
|
394
|
+
}
|
|
395
|
+
for (const reservation of snapshot.childReservations) {
|
|
396
|
+
let view = views.get(reservation.parentToolCallId);
|
|
397
|
+
if (view === void 0) view = ensure(reservation.parentToolCallId);
|
|
398
|
+
view.reservation = reservation;
|
|
399
|
+
if (view.childSubmissionId === void 0 && reservation.childSubmissionId !== void 0) view.childSubmissionId = reservation.childSubmissionId;
|
|
400
|
+
}
|
|
401
|
+
for (const attachment of snapshot.childAttachments) {
|
|
402
|
+
const view = ensure(attachment.toolCallId);
|
|
403
|
+
view.attachment = attachment;
|
|
404
|
+
if (view.childSubmissionId === void 0) view.childSubmissionId = attachment.childSubmissionId;
|
|
405
|
+
}
|
|
406
|
+
return [...views.values()];
|
|
407
|
+
};
|
|
408
|
+
const waitingChildOf = (view, childSubmissionId) => WaitingChild.make({
|
|
409
|
+
toolCallId: view.toolCallId,
|
|
410
|
+
childSubmissionId
|
|
411
|
+
});
|
|
412
|
+
const nonEmpty = (values) => {
|
|
413
|
+
const [first, ...rest] = values;
|
|
414
|
+
return first === void 0 ? void 0 : [first, ...rest];
|
|
415
|
+
};
|
|
416
|
+
/**
|
|
417
|
+
* The reservation's frozen accounting decision has not been applied: whether frozen by a
|
|
418
|
+
* canonical join or by an orphan zero-consumed decision, `releasePending` always finishes
|
|
419
|
+
* through the idempotent `releaseChildBudget` replay — never through a second freeze, whose
|
|
420
|
+
* divergent accounting would conflict (`ChildReservationConflict`).
|
|
421
|
+
*/
|
|
422
|
+
const releasePendingReservation = (view) => view.reservation !== void 0 && view.reservation.status === "releasePending" ? view.reservation : void 0;
|
|
423
|
+
/** The reservation still holds unfrozen allocation (`reserved`). */
|
|
424
|
+
const reservedReservation = (view) => view.reservation !== void 0 && view.reservation.status === "reserved" ? view.reservation : void 0;
|
|
425
|
+
/**
|
|
426
|
+
* The spec §13 Subagent rows for a live (non-suspended) parent WITHOUT a durable abort intent,
|
|
427
|
+
* in most-repairing-first order. Returns `undefined` when no delegation obligation is open so
|
|
428
|
+
* the ordinary rows apply.
|
|
429
|
+
*/
|
|
430
|
+
const classifyDelegationRepairs = (submissionId, views) => {
|
|
431
|
+
const applyJoins = [];
|
|
432
|
+
const completeAdmissions = [];
|
|
433
|
+
const repairStartLinks = [];
|
|
434
|
+
const awaitAdmissions = [];
|
|
435
|
+
const resumeBatches = [];
|
|
436
|
+
const waiting = [];
|
|
437
|
+
const terminalUnjoined = [];
|
|
438
|
+
const orphanReservations = [];
|
|
439
|
+
for (const view of views) {
|
|
440
|
+
if (view.reservation !== void 0 && view.reservation.status === "released") continue;
|
|
441
|
+
if (releasePendingReservation(view) !== void 0) {
|
|
442
|
+
applyJoins.push(view);
|
|
443
|
+
continue;
|
|
444
|
+
}
|
|
445
|
+
if (view.joined) {
|
|
446
|
+
if (reservedReservation(view) !== void 0) applyJoins.push(view);
|
|
447
|
+
continue;
|
|
448
|
+
}
|
|
449
|
+
if (view.started && view.childSubmissionId !== void 0) {
|
|
450
|
+
const child = waitingChildOf(view, view.childSubmissionId);
|
|
451
|
+
if (view.attachment !== void 0 && isTerminalAttachment(view.attachment)) terminalUnjoined.push(child);
|
|
452
|
+
else waiting.push(child);
|
|
453
|
+
continue;
|
|
454
|
+
}
|
|
455
|
+
if (view.started || view.childSubmissionId !== void 0 || view.admission === "admitted") {
|
|
456
|
+
repairStartLinks.push(view);
|
|
457
|
+
continue;
|
|
458
|
+
}
|
|
459
|
+
if (view.requested) {
|
|
460
|
+
if (view.admission === "not-admitted") completeAdmissions.push(view);
|
|
461
|
+
else awaitAdmissions.push(view);
|
|
462
|
+
continue;
|
|
463
|
+
}
|
|
464
|
+
if (view.open) {
|
|
465
|
+
resumeBatches.push(view);
|
|
466
|
+
continue;
|
|
467
|
+
}
|
|
468
|
+
const reservation = reservedReservation(view);
|
|
469
|
+
if (reservation !== void 0) orphanReservations.push(reservation);
|
|
470
|
+
}
|
|
471
|
+
const applyJoin = applyJoins[0];
|
|
472
|
+
if (applyJoin?.reservation !== void 0) return ApplyJoinAccounting.make({
|
|
473
|
+
submissionId,
|
|
474
|
+
toolCallId: applyJoin.toolCallId,
|
|
475
|
+
reservationId: applyJoin.reservation.reservationId
|
|
476
|
+
});
|
|
477
|
+
const completeAdmission = completeAdmissions[0];
|
|
478
|
+
if (completeAdmission !== void 0) return CompleteChildAdmission.make({
|
|
479
|
+
submissionId,
|
|
480
|
+
toolCallId: completeAdmission.toolCallId
|
|
481
|
+
});
|
|
482
|
+
const repairStartLink = repairStartLinks[0];
|
|
483
|
+
if (repairStartLink !== void 0) return RepairSubagentStartLink.make({
|
|
484
|
+
submissionId,
|
|
485
|
+
toolCallId: repairStartLink.toolCallId
|
|
486
|
+
});
|
|
487
|
+
const awaitAdmission = awaitAdmissions[0];
|
|
488
|
+
if (awaitAdmission !== void 0) return AwaitChildAdmissionResolution.make({
|
|
489
|
+
submissionId,
|
|
490
|
+
toolCallId: awaitAdmission.toolCallId
|
|
491
|
+
});
|
|
492
|
+
const resumeBatch = resumeBatches[0];
|
|
493
|
+
if (resumeBatch?.turn !== void 0) return ResumePendingToolBatch.make({
|
|
494
|
+
submissionId,
|
|
495
|
+
turn: resumeBatch.turn
|
|
496
|
+
});
|
|
497
|
+
const waitingChildren = nonEmpty([...waiting, ...terminalUnjoined]);
|
|
498
|
+
if (waiting.length > 0 && waitingChildren !== void 0) return EnsureWaitingForChild.make({
|
|
499
|
+
submissionId,
|
|
500
|
+
children: waitingChildren
|
|
501
|
+
});
|
|
502
|
+
const settledChildren = nonEmpty(terminalUnjoined);
|
|
503
|
+
if (settledChildren !== void 0) return ResumeWaitingParent.make({
|
|
504
|
+
submissionId,
|
|
505
|
+
children: settledChildren
|
|
506
|
+
});
|
|
507
|
+
const orphans = nonEmpty(orphanReservations.map((reservation) => reservation.reservationId));
|
|
508
|
+
if (orphans !== void 0) return ReleaseOrphanChildReservation.make({
|
|
509
|
+
submissionId,
|
|
510
|
+
reservationIds: orphans
|
|
511
|
+
});
|
|
512
|
+
};
|
|
513
|
+
/**
|
|
514
|
+
* The spec §13/§13.1 Subagent rows under a canonical parent abort intent: request-abort-and-join
|
|
515
|
+
* is the only close behavior, so a nonterminal attached child converts `SettleAborted` into
|
|
516
|
+
* `PropagateChildAbort`, terminal-but-unjoined children are joined first, incomplete releases
|
|
517
|
+
* are applied, provably childless reservations release exactly once, and only a parent with no
|
|
518
|
+
* open child obligation settles aborted. Returns `undefined` for exactly that last case.
|
|
519
|
+
*/
|
|
520
|
+
const classifyDelegationAbort = (submissionId, views) => {
|
|
521
|
+
const awaitAdmissions = [];
|
|
522
|
+
const repairStartLinks = [];
|
|
523
|
+
const nonterminal = [];
|
|
524
|
+
const terminalUnjoined = [];
|
|
525
|
+
const applyJoins = [];
|
|
526
|
+
const orphanReservations = [];
|
|
527
|
+
for (const view of views) {
|
|
528
|
+
if (view.reservation !== void 0 && view.reservation.status === "released") continue;
|
|
529
|
+
if (releasePendingReservation(view) !== void 0) {
|
|
530
|
+
applyJoins.push(view);
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
if (view.joined) {
|
|
534
|
+
if (reservedReservation(view) !== void 0) applyJoins.push(view);
|
|
535
|
+
continue;
|
|
536
|
+
}
|
|
537
|
+
if (view.childSubmissionId !== void 0) {
|
|
538
|
+
if (!view.started) {
|
|
539
|
+
repairStartLinks.push(view);
|
|
540
|
+
continue;
|
|
541
|
+
}
|
|
542
|
+
const child = waitingChildOf(view, view.childSubmissionId);
|
|
543
|
+
if (view.attachment !== void 0 && isTerminalAttachment(view.attachment)) terminalUnjoined.push(child);
|
|
544
|
+
else nonterminal.push(child);
|
|
545
|
+
continue;
|
|
546
|
+
}
|
|
547
|
+
if (view.started || view.admission === "admitted") {
|
|
548
|
+
repairStartLinks.push(view);
|
|
549
|
+
continue;
|
|
550
|
+
}
|
|
551
|
+
if (view.requested) {
|
|
552
|
+
if (view.admission === "not-admitted") {
|
|
553
|
+
const reservation = reservedReservation(view);
|
|
554
|
+
if (reservation !== void 0) orphanReservations.push(reservation);
|
|
555
|
+
} else awaitAdmissions.push(view);
|
|
556
|
+
continue;
|
|
557
|
+
}
|
|
558
|
+
const reservation = reservedReservation(view);
|
|
559
|
+
if (reservation !== void 0) orphanReservations.push(reservation);
|
|
560
|
+
}
|
|
561
|
+
const awaitAdmission = awaitAdmissions[0];
|
|
562
|
+
if (awaitAdmission !== void 0) return AwaitChildAdmissionResolution.make({
|
|
563
|
+
submissionId,
|
|
564
|
+
toolCallId: awaitAdmission.toolCallId
|
|
565
|
+
});
|
|
566
|
+
const repairStartLink = repairStartLinks[0];
|
|
567
|
+
if (repairStartLink !== void 0) return RepairSubagentStartLink.make({
|
|
568
|
+
submissionId,
|
|
569
|
+
toolCallId: repairStartLink.toolCallId
|
|
570
|
+
});
|
|
571
|
+
const abortChildren = nonEmpty(nonterminal);
|
|
572
|
+
if (abortChildren !== void 0) return PropagateChildAbort.make({
|
|
573
|
+
submissionId,
|
|
574
|
+
children: abortChildren
|
|
575
|
+
});
|
|
576
|
+
const settledChildren = nonEmpty(terminalUnjoined);
|
|
577
|
+
if (settledChildren !== void 0) return ResumeWaitingParent.make({
|
|
578
|
+
submissionId,
|
|
579
|
+
children: settledChildren
|
|
580
|
+
});
|
|
581
|
+
const applyJoin = applyJoins[0];
|
|
582
|
+
if (applyJoin?.reservation !== void 0) return ApplyJoinAccounting.make({
|
|
583
|
+
submissionId,
|
|
584
|
+
toolCallId: applyJoin.toolCallId,
|
|
585
|
+
reservationId: applyJoin.reservation.reservationId
|
|
586
|
+
});
|
|
587
|
+
const orphans = nonEmpty(orphanReservations.map((reservation) => reservation.reservationId));
|
|
588
|
+
if (orphans !== void 0) return ReleaseOrphanChildReservation.make({
|
|
589
|
+
submissionId,
|
|
590
|
+
reservationIds: orphans
|
|
591
|
+
});
|
|
592
|
+
};
|
|
593
|
+
/**
|
|
594
|
+
* Pure recovery classifier (durability §14, DUR-013): a finite persisted snapshot plus canonical
|
|
595
|
+
* evidence deterministically selects exactly one decision. Precedence, most-settled first
|
|
596
|
+
* (plan §4.2/§4.3 — note the deliberate P5 reorder: canonical settlement and reservation beat
|
|
597
|
+
* open tool calls, because a recorded terminal outcome is never revisited, DUR-002/DUR-015; and
|
|
598
|
+
* the three S2 edits: the abort row propagates to nonterminal attached children, delegation
|
|
599
|
+
* calls never mark Unknown, and the suspended row branches on the suspension reason):
|
|
600
|
+
*
|
|
601
|
+
* 1. `settled` → NoAction — terminal outcomes are never revisited (DUR-002).
|
|
602
|
+
* 2. canonical settlement record → FinalizeLedgerFromHistory — history beats every ledger
|
|
603
|
+
* marker (DUR-015), including a missing or divergent reservation AND open tool calls.
|
|
604
|
+
* 3. reservation → FinalizeLedgerFromHistory when finalized, else AppendReservedSettlement —
|
|
605
|
+
* the reserved record is the single exact outcome owed (DUR-011); it also beats a pending
|
|
606
|
+
* abort intent (DUR-012).
|
|
607
|
+
* 4. joined-side states (DUR-016): `joining` without canonical input → RevertJoining; `joining`
|
|
608
|
+
* with canonical input → RepairJoinMarker (marker lost); `joined` + host settled →
|
|
609
|
+
* SettleJoinedWithHost; `joined` + host live → AwaitHostSettlement (deferred).
|
|
610
|
+
* 5. abort intent → the S2 abort rows (spec §13.1 request-abort-and-join): an unproven child
|
|
611
|
+
* admission waits, an admitted-but-unlinked child repairs its start link, a nonterminal
|
|
612
|
+
* attached child gets PropagateChildAbort — the parent does NOT settle — terminal children
|
|
613
|
+
* are joined, incomplete releases applied, provably childless reservations released; ONLY a
|
|
614
|
+
* parent with no open child obligation reaches SettleAborted, where open ordinary calls
|
|
615
|
+
* become `ToolCallUnknown` audit records, never a rollback claim (§13). SettleAborted is
|
|
616
|
+
* position-blind by design (P7 §7(c)): an aborted, never-claimed `ready` Submission earns it
|
|
617
|
+
* ANYWHERE in the queue — the executor settles it immediately without waiting for it to head
|
|
618
|
+
* the lane, because settlement order of never-run work is not execution order (DUR-004
|
|
619
|
+
* bounds execution order; DUR-012 permits settling inactive accepted work without an
|
|
620
|
+
* Attempt).
|
|
621
|
+
* 6. ordinary open tool calls (state not yet `unknown`) → MarkUnknown — reconcile-then-mark,
|
|
622
|
+
* never an automatic replay (DUR-009). Delegation calls are EXCLUDED (plan §4.3's most
|
|
623
|
+
* important edit): their prepared-without-outcome state is provably replay-safe and routes
|
|
624
|
+
* through rows 5/8/9 instead. A lane already `unknown` is in the DUR-017 resolution regime
|
|
625
|
+
* (row 7) and is not re-marked.
|
|
626
|
+
* 7. state `unknown` → ApplyUnknownResolutions when durable intents cover every open ordinary
|
|
627
|
+
* call, else AwaitUnknownResolution.
|
|
628
|
+
* 8. state `suspended` branches on the stored reason: `WaitingForChild` → ResumeWaitingParent
|
|
629
|
+
* when every listed child is provably settled (replay the idempotent wake), else
|
|
630
|
+
* AwaitChildSettlement (SUB-030); `ApprovalPending` keeps the P5 behavior — undecided
|
|
631
|
+
* canonical approval requests → AwaitApprovalDecision (repairing a lost suspend transition
|
|
632
|
+
* from history), every request decided → ResumeSuspended.
|
|
633
|
+
* 9. the S2 establishment/join rows for a live parent (spec §13, most-repairing first):
|
|
634
|
+
* ApplyJoinAccounting → CompleteChildAdmission → RepairSubagentStartLink →
|
|
635
|
+
* AwaitChildAdmissionResolution → ResumePendingToolBatch (idempotent handler re-entry) →
|
|
636
|
+
* EnsureWaitingForChild → ResumeWaitingParent → ReleaseOrphanChildReservation.
|
|
637
|
+
* 10. declared-but-unprepared tool batch → ResumePendingToolBatch — no handler ran (no prepared
|
|
638
|
+
* records), so the batch resumes with no model re-invocation and no Unknown (§15).
|
|
639
|
+
* 11. `admitted` → a parent-linked Submission whose Thread lacks the canonical lineage
|
|
640
|
+
* record defers (AwaitParentEstablishment: the parent's idempotent establishment
|
|
641
|
+
* completes it); otherwise
|
|
642
|
+
* CompleteMaterialization / RepairReadiness by Thread durability.
|
|
643
|
+
* 12. otherwise → ApplyInput / RepairInputMarker / ResumeFromTurnBoundary by canonical input
|
|
644
|
+
* evidence, with the ledger marker repaired from history, never the reverse.
|
|
645
|
+
*
|
|
646
|
+
* A CHILD Submission (one whose snapshot carries `parentLinkage`) classifies through exactly
|
|
647
|
+
* the same rows as any Submission — child recovery proceeds under its own ownership token and
|
|
648
|
+
* epoch (spec §13, SUB-020); nothing here consults the parent's lane.
|
|
649
|
+
*
|
|
650
|
+
* Ownership leases are deliberately ignored here: the executor's fenced claim is the only
|
|
651
|
+
* authority over liveness, and a stale Attempt is fenced by producer epoch regardless (DUR-006).
|
|
652
|
+
*/
|
|
653
|
+
const classifyRecovery = (snapshot, evidence) => {
|
|
654
|
+
const submissionId = snapshot.submission.submissionId;
|
|
655
|
+
const state = snapshot.submission.state;
|
|
656
|
+
if (state === "settled") return NoAction.make({ submissionId });
|
|
657
|
+
if (evidence.recordedSettlementOutcome !== void 0) return FinalizeLedgerFromHistory.make({
|
|
658
|
+
submissionId,
|
|
659
|
+
settlementId: snapshot.reservation?.settlementId ?? submissionSettlementId(submissionId),
|
|
660
|
+
outcome: evidence.recordedSettlementOutcome
|
|
661
|
+
});
|
|
662
|
+
if (snapshot.reservation !== void 0) {
|
|
663
|
+
if (snapshot.reservation.finalized) return FinalizeLedgerFromHistory.make({
|
|
664
|
+
submissionId,
|
|
665
|
+
settlementId: snapshot.reservation.settlementId,
|
|
666
|
+
outcome: snapshot.reservation.outcome
|
|
667
|
+
});
|
|
668
|
+
return AppendReservedSettlement.make({
|
|
669
|
+
submissionId,
|
|
670
|
+
settlementId: snapshot.reservation.settlementId,
|
|
671
|
+
outcome: snapshot.reservation.outcome
|
|
672
|
+
});
|
|
673
|
+
}
|
|
674
|
+
if (state === "joining") return evidence.inputRecorded ? RepairJoinMarker.make({ submissionId }) : RevertJoining.make({ submissionId });
|
|
675
|
+
if (state === "joined") {
|
|
676
|
+
if (evidence.hostSettlementOutcome !== void 0) return SettleJoinedWithHost.make({
|
|
677
|
+
submissionId,
|
|
678
|
+
outcome: evidence.hostSettlementOutcome
|
|
679
|
+
});
|
|
680
|
+
return AwaitHostSettlement.make({
|
|
681
|
+
submissionId,
|
|
682
|
+
...snapshot.hostSubmissionId === void 0 ? {} : { hostSubmissionId: snapshot.hostSubmissionId }
|
|
683
|
+
});
|
|
684
|
+
}
|
|
685
|
+
const delegationViews = delegationViewsOf(snapshot, evidence);
|
|
686
|
+
if (snapshot.abortIntent !== void 0) return classifyDelegationAbort(submissionId, delegationViews) ?? SettleAborted.make({ submissionId });
|
|
687
|
+
const delegationCallIds = new Set(evidence.openDelegationCalls.map((call) => call.toolCallId));
|
|
688
|
+
const ordinaryOpenCalls = evidence.openToolCalls.filter((call) => !delegationCallIds.has(call.toolCallId));
|
|
689
|
+
if (state !== "unknown" && ordinaryOpenCalls.length > 0) return MarkUnknown.make({
|
|
690
|
+
submissionId,
|
|
691
|
+
reason: "An ordinary Tool call may have executed without a canonical outcome",
|
|
692
|
+
openToolCallIds: ordinaryOpenCalls.map((call) => call.toolCallId)
|
|
693
|
+
});
|
|
694
|
+
if (state === "unknown") {
|
|
695
|
+
const resolved = new Set(snapshot.unknownResolutions.map((resolution) => resolution.toolCallId));
|
|
696
|
+
return ordinaryOpenCalls.every((call) => resolved.has(call.toolCallId)) ? ApplyUnknownResolutions.make({ submissionId }) : AwaitUnknownResolution.make({ submissionId });
|
|
697
|
+
}
|
|
698
|
+
const decided = new Set(snapshot.approvalDecisions.map((decision) => decision.toolCallId));
|
|
699
|
+
const undecidedApprovals = evidence.approvalsPending.filter((pending) => !decided.has(pending.toolCallId));
|
|
700
|
+
if (state === "suspended") {
|
|
701
|
+
const reason = snapshot.suspension?.reason;
|
|
702
|
+
if (reason !== void 0 && reason._tag === "WaitingForChild") {
|
|
703
|
+
const terminalChildIds = new Set(snapshot.childAttachments.filter(isTerminalAttachment).map((attachment) => attachment.childSubmissionId));
|
|
704
|
+
return reason.children.every((child) => terminalChildIds.has(child.childSubmissionId)) ? ResumeWaitingParent.make({
|
|
705
|
+
submissionId,
|
|
706
|
+
children: reason.children
|
|
707
|
+
}) : AwaitChildSettlement.make({ submissionId });
|
|
708
|
+
}
|
|
709
|
+
return undecidedApprovals.length === 0 ? ResumeSuspended.make({ submissionId }) : AwaitApprovalDecision.make({ submissionId });
|
|
710
|
+
}
|
|
711
|
+
if (undecidedApprovals.length > 0) return AwaitApprovalDecision.make({ submissionId });
|
|
712
|
+
const delegationDecision = classifyDelegationRepairs(submissionId, delegationViews);
|
|
713
|
+
if (delegationDecision !== void 0) return delegationDecision;
|
|
714
|
+
if (evidence.declaredPendingBatch !== void 0) return ResumePendingToolBatch.make({
|
|
715
|
+
submissionId,
|
|
716
|
+
turn: evidence.declaredPendingBatch.turn
|
|
717
|
+
});
|
|
718
|
+
const workerCall = evidence.openWorkerCalls?.[0];
|
|
719
|
+
if (workerCall !== void 0) return ResumePendingToolBatch.make({
|
|
720
|
+
submissionId,
|
|
721
|
+
turn: workerCall.turn
|
|
722
|
+
});
|
|
723
|
+
if (state === "admitted") {
|
|
724
|
+
const linkage = snapshot.submission.parentLinkage ?? snapshot.parentLinkage;
|
|
725
|
+
if (linkage !== void 0 && !evidence.subagentLineageRecorded) return AwaitParentEstablishment.make({
|
|
726
|
+
submissionId,
|
|
727
|
+
parentSubmissionId: linkage.parentSubmissionId,
|
|
728
|
+
parentToolCallId: linkage.parentToolCallId
|
|
729
|
+
});
|
|
730
|
+
return evidence.threadMaterialized ? RepairReadiness.make({ submissionId }) : CompleteMaterialization.make({ submissionId });
|
|
731
|
+
}
|
|
732
|
+
if (!evidence.inputRecorded) return ApplyInput.make({ submissionId });
|
|
733
|
+
if (snapshot.inputApplied === void 0) return RepairInputMarker.make({ submissionId });
|
|
734
|
+
return ResumeFromTurnBoundary.make({ submissionId });
|
|
735
|
+
};
|
|
736
|
+
//#endregion
|
|
737
|
+
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, Recovery_exports as t };
|
|
738
|
+
|
|
739
|
+
//# sourceMappingURL=Recovery.mjs.map
|