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,105 @@
|
|
|
1
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
import { ThreadId, RunId, SubmissionId, ToolCallId } from "../core/Identifiers.ts";
|
|
4
|
+
import { Digest, PersistedJson, ToolCallPrepared } from "./Records.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Everything a reconciliation policy can consult about one prepared-but-unsettled ordinary Tool
|
|
8
|
+
* Call (durability §10): deterministic identities for supplier-side lookup plus the exact
|
|
9
|
+
* Schema-encoded parameters and their digest. Built from the canonical `ToolCallPrepared` record
|
|
10
|
+
* and the owning Submission's identities — never from in-memory Attempt state.
|
|
11
|
+
*/
|
|
12
|
+
export class PreparedToolCallEvidence extends Schema.Class<PreparedToolCallEvidence>(
|
|
13
|
+
"@effect-agent/thread/PreparedToolCallEvidence",
|
|
14
|
+
)({
|
|
15
|
+
threadId: ThreadId,
|
|
16
|
+
submissionId: SubmissionId,
|
|
17
|
+
runId: RunId,
|
|
18
|
+
turn: ToolCallPrepared.fields.turn,
|
|
19
|
+
toolCallId: ToolCallId,
|
|
20
|
+
toolName: ToolCallPrepared.fields.toolName,
|
|
21
|
+
parameters: PersistedJson,
|
|
22
|
+
parametersDigest: Digest,
|
|
23
|
+
}) {}
|
|
24
|
+
|
|
25
|
+
/** Proof that the external execution never started: the call may re-execute on resume. */
|
|
26
|
+
export class ReconciliationNeverStarted extends Schema.TaggedClass<ReconciliationNeverStarted>(
|
|
27
|
+
"@effect-agent/thread/ReconciliationNeverStarted",
|
|
28
|
+
)("NeverStarted", {}) {}
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Proof that the external execution completed: `result` is the recovered supplier truth, which
|
|
32
|
+
* becomes canonical (`ToolCallSettled` + `ToolCallResolved`) WITHOUT executing anything.
|
|
33
|
+
*/
|
|
34
|
+
export class ReconciliationCompleted extends Schema.TaggedClass<ReconciliationCompleted>(
|
|
35
|
+
"@effect-agent/thread/ReconciliationCompleted",
|
|
36
|
+
)("CompletedWithResult", {
|
|
37
|
+
result: PersistedJson,
|
|
38
|
+
isFailure: Schema.Boolean,
|
|
39
|
+
}) {}
|
|
40
|
+
|
|
41
|
+
/** The call is safe to repeat under a stable external idempotency contract. */
|
|
42
|
+
export class ReconciliationSafeToRetry extends Schema.TaggedClass<ReconciliationSafeToRetry>(
|
|
43
|
+
"@effect-agent/thread/ReconciliationSafeToRetry",
|
|
44
|
+
)("SafeToRetry", {}) {}
|
|
45
|
+
|
|
46
|
+
/** No proof either way: the outcome is Unknown and requires authorized resolution (DUR-017). */
|
|
47
|
+
export class ReconciliationUncertain extends Schema.TaggedClass<ReconciliationUncertain>(
|
|
48
|
+
"@effect-agent/thread/ReconciliationUncertain",
|
|
49
|
+
)("Uncertain", {
|
|
50
|
+
reason: Schema.String,
|
|
51
|
+
}) {}
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* What a reconciliation policy can prove about one prepared-but-unsettled ordinary Tool Call
|
|
55
|
+
* (durability §10): execution never started, execution completed with a recoverable result,
|
|
56
|
+
* execution is safe to repeat, or nothing — in which case the Run enters Unknown. The engine
|
|
57
|
+
* never manufactures an error result and continues.
|
|
58
|
+
*/
|
|
59
|
+
export const ReconciliationDecision = Schema.Union([
|
|
60
|
+
ReconciliationNeverStarted,
|
|
61
|
+
ReconciliationCompleted,
|
|
62
|
+
ReconciliationSafeToRetry,
|
|
63
|
+
ReconciliationUncertain,
|
|
64
|
+
]);
|
|
65
|
+
|
|
66
|
+
export type ReconciliationDecision = typeof ReconciliationDecision.Type;
|
|
67
|
+
|
|
68
|
+
/** The reconciliation policy itself failed (supplier unreachable, corrupt lookup, ...). The
|
|
69
|
+
* caller treats this as no proof: the call stays open and the pass may retry. */
|
|
70
|
+
export class ToolReconcilerError extends Schema.TaggedError<ToolReconcilerError>()(
|
|
71
|
+
"ToolReconcilerError",
|
|
72
|
+
{
|
|
73
|
+
toolCallId: ToolCallId,
|
|
74
|
+
message: Schema.String,
|
|
75
|
+
cause: Schema.optionalKey(Schema.Defect()),
|
|
76
|
+
},
|
|
77
|
+
) {}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Application-registered reconciliation policy consulted by recovery for every open ordinary
|
|
81
|
+
* Tool Call before an Unknown Outcome is recorded (durability §10, DUR-009). A decision is a
|
|
82
|
+
* claim about EXTERNAL truth — typically an idempotency-keyed supplier lookup — never a guess
|
|
83
|
+
* from canonical state alone.
|
|
84
|
+
*
|
|
85
|
+
* `ToolReconciler.uncertain` is the fail-closed default (AGENTS rule 11): with no registered
|
|
86
|
+
* policy, every open call stays Unknown and routes to the authorized DUR-017 resolution path.
|
|
87
|
+
*/
|
|
88
|
+
export class ToolReconciler extends Context.Service<
|
|
89
|
+
ToolReconciler,
|
|
90
|
+
{
|
|
91
|
+
readonly reconcile: (
|
|
92
|
+
evidence: PreparedToolCallEvidence,
|
|
93
|
+
) => Effect.Effect<ReconciliationDecision, ToolReconcilerError>;
|
|
94
|
+
}
|
|
95
|
+
>()("@effect-agent/thread/ToolReconciler") {
|
|
96
|
+
/** Fail-closed default: no proof is ever asserted, every open call stays Unknown. */
|
|
97
|
+
static readonly uncertain: Layer.Layer<ToolReconciler> = Layer.succeed(this)({
|
|
98
|
+
reconcile: () =>
|
|
99
|
+
Effect.succeed(
|
|
100
|
+
ReconciliationUncertain.make({
|
|
101
|
+
reason: "No reconciliation policy is registered; the outcome stays unknown",
|
|
102
|
+
}),
|
|
103
|
+
),
|
|
104
|
+
});
|
|
105
|
+
}
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import type { Scope } from "effect";
|
|
2
|
+
import { Context, Deferred, Effect, Layer, Ref, Stream } from "effect";
|
|
3
|
+
|
|
4
|
+
import { type ThreadId } from "../core/Identifiers.ts";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Incarnation-local, thread-keyed wake registrations. A registration is installed before
|
|
8
|
+
* its returned Effect can be awaited, which lets a caller subscribe, check durable authority,
|
|
9
|
+
* and then park without a lost-wakeup window.
|
|
10
|
+
*/
|
|
11
|
+
export interface WakeSubscriptionHub {
|
|
12
|
+
/** Register one Scope-owned waiter and return its one-shot wake Effect. */
|
|
13
|
+
readonly subscribe: (
|
|
14
|
+
threadId: ThreadId,
|
|
15
|
+
) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
|
|
16
|
+
/** Wake every currently registered waiter for exactly this Thread. */
|
|
17
|
+
readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
interface WakeRegistration {
|
|
21
|
+
readonly id: number;
|
|
22
|
+
readonly deferred: Deferred.Deferred<void>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
type WakeRegistrations = ReadonlyMap<ThreadId, ReadonlyMap<number, Deferred.Deferred<void>>>;
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Build the shared per-incarnation registration primitive used by host WakeSchedulers. The hub
|
|
29
|
+
* contains hints only: eviction may discard it, while a reconnecting caller re-subscribes and
|
|
30
|
+
* rechecks canonical storage. Scope finalizers remove cancelled waiters, and notify broadcasts
|
|
31
|
+
* instead of consuming a signal that belongs to another waiter.
|
|
32
|
+
*/
|
|
33
|
+
export const makeWakeSubscriptionHub: Effect.Effect<WakeSubscriptionHub> = Effect.gen(function* () {
|
|
34
|
+
const registrations = yield* Ref.make<WakeRegistrations>(new Map());
|
|
35
|
+
const nextId = yield* Ref.make(0);
|
|
36
|
+
|
|
37
|
+
const remove = (threadId: ThreadId, id: number) =>
|
|
38
|
+
Ref.update(registrations, (current) => {
|
|
39
|
+
const existing = current.get(threadId);
|
|
40
|
+
|
|
41
|
+
if (existing === undefined || !existing.has(id)) return current;
|
|
42
|
+
const next = new Map(current);
|
|
43
|
+
const thread = new Map(existing);
|
|
44
|
+
|
|
45
|
+
thread.delete(id);
|
|
46
|
+
if (thread.size === 0) {
|
|
47
|
+
next.delete(threadId);
|
|
48
|
+
} else {
|
|
49
|
+
next.set(threadId, thread);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return next;
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
const subscribe = Effect.fn("WakeSubscriptionHub.subscribe")(
|
|
56
|
+
(threadId: ThreadId): Effect.Effect<Effect.Effect<void>, never, Scope.Scope> =>
|
|
57
|
+
Effect.gen(function* () {
|
|
58
|
+
const deferred = yield* Deferred.make<void>();
|
|
59
|
+
const id = yield* Ref.getAndUpdate(nextId, (current) => current + 1);
|
|
60
|
+
const registration: WakeRegistration = { id, deferred };
|
|
61
|
+
|
|
62
|
+
yield* Effect.addFinalizer(() => remove(threadId, registration.id));
|
|
63
|
+
yield* Ref.update(registrations, (current) => {
|
|
64
|
+
const next = new Map(current);
|
|
65
|
+
const thread = new Map(current.get(threadId) ?? []);
|
|
66
|
+
|
|
67
|
+
thread.set(registration.id, registration.deferred);
|
|
68
|
+
next.set(threadId, thread);
|
|
69
|
+
|
|
70
|
+
return next;
|
|
71
|
+
});
|
|
72
|
+
|
|
73
|
+
return registration.deferred;
|
|
74
|
+
}).pipe(Effect.map((deferred) => Deferred.await(deferred))),
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
const notify = Effect.fn("WakeSubscriptionHub.notify")(function* (threadId: ThreadId) {
|
|
78
|
+
const waiters = yield* Ref.modify(registrations, (current) => {
|
|
79
|
+
const thread = current.get(threadId);
|
|
80
|
+
|
|
81
|
+
if (thread === undefined) return [[], current] as const;
|
|
82
|
+
const next = new Map(current);
|
|
83
|
+
|
|
84
|
+
next.delete(threadId);
|
|
85
|
+
|
|
86
|
+
return [[...thread.values()], next] as const;
|
|
87
|
+
});
|
|
88
|
+
|
|
89
|
+
yield* Effect.forEach(waiters, (waiter) => Deferred.succeed(waiter, undefined), {
|
|
90
|
+
discard: true,
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
return { subscribe, notify };
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Liveness hint channel for durable schedulers. `notify` announces that a Thread lane may
|
|
99
|
+
* have claimable, canonical, or settled work; `wakes` is the all-lanes subscription surface for
|
|
100
|
+
* workers, while `subscribe` installs an efficient one-Thread wait registration.
|
|
101
|
+
*
|
|
102
|
+
* Correctness must NEVER depend on delivery: notifications may be dropped, coalesced, duplicated,
|
|
103
|
+
* or observed by no subscriber (a notify before any subscription is simply lost). Every consumer
|
|
104
|
+
* must pair a wake with durable authority: workers use periodic SubmissionLedger scans, while a
|
|
105
|
+
* public progress waiter subscribes before its canonical read and reconnects/rechecks after an
|
|
106
|
+
* incarnation loss (persistence §14).
|
|
107
|
+
*
|
|
108
|
+
* Each run of `wakes` creates its own subscription whose resources live in that run's Scope and
|
|
109
|
+
* are released when the consuming stream ends or is interrupted. Implementations must not spawn
|
|
110
|
+
* daemon fibers.
|
|
111
|
+
*/
|
|
112
|
+
export class WakeScheduler extends Context.Service<
|
|
113
|
+
WakeScheduler,
|
|
114
|
+
{
|
|
115
|
+
/** Best-effort hint that `threadId` may have claimable or settled work. Never fails. */
|
|
116
|
+
readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
|
|
117
|
+
/** Scope-owned one-shot registration for exactly one Thread. */
|
|
118
|
+
readonly subscribe: (
|
|
119
|
+
threadId: ThreadId,
|
|
120
|
+
) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
|
|
121
|
+
/** Scope-owned subscription to wake hints, starting at subscription time. */
|
|
122
|
+
readonly wakes: Stream.Stream<ThreadId>;
|
|
123
|
+
}
|
|
124
|
+
>()("@effect-agent/thread/WakeScheduler") {
|
|
125
|
+
/**
|
|
126
|
+
* Discards every notification and never wakes anyone. Valid because WakeScheduler is only a
|
|
127
|
+
* liveness hint: consumers relying on ledger scans stay correct, merely slower.
|
|
128
|
+
*/
|
|
129
|
+
static readonly layerNoop: Layer.Layer<WakeScheduler> = Layer.succeed(WakeScheduler, {
|
|
130
|
+
notify: () => Effect.void,
|
|
131
|
+
subscribe: () => Effect.succeed(Effect.never),
|
|
132
|
+
wakes: Stream.never,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
import { Context, Effect, Option, Schema } from "effect";
|
|
2
|
+
|
|
3
|
+
import type * as Agent from "../core/Agent.ts";
|
|
4
|
+
import type { AgentPolicy } from "../core/AgentPolicy.ts";
|
|
5
|
+
import type { SubmissionId, ThreadId } from "../core/Identifiers.ts";
|
|
6
|
+
import type { SubagentBudgetReservation } from "../core/SubagentContract.ts";
|
|
7
|
+
import { WorkerError, type WorkerRef, type WorkerSource } from "../core/Worker.ts";
|
|
8
|
+
import type { DefinitionDigests, Digest, PersistedJson, WorkerOrigin } from "./Records.ts";
|
|
9
|
+
import type { Principal, SubmissionSnapshot } from "./SubmissionLedger.ts";
|
|
10
|
+
|
|
11
|
+
/** Host-verified source input; absence never means the latest input in the Thread. */
|
|
12
|
+
export interface WorkerPolicySource {
|
|
13
|
+
readonly threadId: ThreadId;
|
|
14
|
+
readonly definition: Agent.AnyDefinition;
|
|
15
|
+
readonly definitions: DefinitionDigests;
|
|
16
|
+
readonly submission?: SubmissionSnapshot;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
/** Initial input is validated again at destination admission, including idempotent replay. */
|
|
20
|
+
export type WorkerPolicyTarget = {
|
|
21
|
+
readonly definition: Agent.AnyDefinition;
|
|
22
|
+
readonly definitions: DefinitionDigests;
|
|
23
|
+
readonly source: WorkerSource;
|
|
24
|
+
} & (
|
|
25
|
+
| {
|
|
26
|
+
readonly _tag: "InitialInput";
|
|
27
|
+
readonly sourceSubmission?: SubmissionSnapshot;
|
|
28
|
+
readonly input: PersistedJson;
|
|
29
|
+
readonly inputDigest: Digest;
|
|
30
|
+
}
|
|
31
|
+
| {
|
|
32
|
+
readonly _tag: "RetainedWorker";
|
|
33
|
+
/** Verified against canonical source history before this request reaches the resolver. */
|
|
34
|
+
readonly origin: WorkerOrigin;
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Opt-in host authority for policies captured in immutable application input. None preserves
|
|
40
|
+
* the registered Definition's existing policy/override semantics. Some is a complete policy,
|
|
41
|
+
* never merged with static overrides. Decode and authorize the exact captured revision; do not
|
|
42
|
+
* read mutable settings or substitute a current capture for missing historical authority.
|
|
43
|
+
* RetainedWorker may affirm only origin.policy, never replace a continuing worker's allowance.
|
|
44
|
+
* Return WorkerError(unavailable) for temporarily unavailable authority so delivery can retry.
|
|
45
|
+
* Implementations are acquired through Effect Layers; capture their dependencies in Layer R.
|
|
46
|
+
*/
|
|
47
|
+
export const WorkerPolicyResolver = Context.Reference<{
|
|
48
|
+
readonly resolveSource: (
|
|
49
|
+
request: WorkerPolicySource,
|
|
50
|
+
) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;
|
|
51
|
+
readonly resolveTarget: (
|
|
52
|
+
request: WorkerPolicyTarget,
|
|
53
|
+
) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;
|
|
54
|
+
}>("@effect-agent/thread/WorkerPolicyResolver", {
|
|
55
|
+
defaultValue: () => ({
|
|
56
|
+
resolveSource: () => Effect.succeed(Option.none()),
|
|
57
|
+
resolveTarget: () => Effect.succeed(Option.none()),
|
|
58
|
+
}),
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const Positive = Schema.Int.check(Schema.isGreaterThan(0));
|
|
62
|
+
|
|
63
|
+
/** A host-authorized ceiling on active background workers, not retained workers or Run usage. */
|
|
64
|
+
export const WorkerConcurrencyLimit = Schema.Struct({
|
|
65
|
+
maxActiveWorkersPerSource: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
66
|
+
});
|
|
67
|
+
|
|
68
|
+
export type WorkerConcurrencyLimit = typeof WorkerConcurrencyLimit.Type;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Optional source-aware operational authority. Resolution occurs inside every new source
|
|
72
|
+
* reservation attempt, against the same canonical history used for the append CAS. None
|
|
73
|
+
* preserves WorkerHostConfig; Some can only narrow it. The selected submission is exact,
|
|
74
|
+
* never the latest input. Implementations must authorize that immutable capture and retain
|
|
75
|
+
* construction dependencies in Layer R. Unavailable authority must return WorkerError(unavailable).
|
|
76
|
+
*
|
|
77
|
+
* One worker occupies a slot while any of its inputs remain unacknowledged. Steering an active
|
|
78
|
+
* worker does not acquire another slot. Decreases (including zero) do not cancel incumbents;
|
|
79
|
+
* an idle worker needs a slot again. Idempotent retained reservations do not reacquire slots.
|
|
80
|
+
*/
|
|
81
|
+
export const WorkerConcurrencyResolver = Context.Reference<{
|
|
82
|
+
readonly resolve: (request: {
|
|
83
|
+
readonly source: WorkerSource;
|
|
84
|
+
readonly sourceSubmission?: SubmissionSnapshot;
|
|
85
|
+
readonly worker: WorkerRef;
|
|
86
|
+
readonly principal: Principal;
|
|
87
|
+
}) => Effect.Effect<Option.Option<WorkerConcurrencyLimit>, WorkerError>;
|
|
88
|
+
}>("@effect-agent/thread/WorkerConcurrencyResolver", {
|
|
89
|
+
defaultValue: () => ({ resolve: () => Effect.succeed(Option.none()) }),
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
/** Host ceilings apply across all declarations owned by one source Thread. */
|
|
93
|
+
export const WorkerHostLimits = Schema.Struct({
|
|
94
|
+
maxWorkersPerSource: Positive.check(Schema.isLessThanOrEqualTo(100)),
|
|
95
|
+
/** Active background workers across declarations; omission retains source Tool concurrency. */
|
|
96
|
+
maxActiveWorkersPerSource: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(100))),
|
|
97
|
+
maxInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(1_000)),
|
|
98
|
+
maxPendingInputsPerWorker: Positive.check(Schema.isLessThanOrEqualTo(100)),
|
|
99
|
+
maxUpdateInputsPerWorker: Schema.optionalKey(Positive.check(Schema.isLessThanOrEqualTo(1_000))),
|
|
100
|
+
maxPendingUpdateInputsPerWorker: Schema.optionalKey(
|
|
101
|
+
Positive.check(Schema.isLessThanOrEqualTo(100)),
|
|
102
|
+
),
|
|
103
|
+
lifetimeMillis: Positive.check(Schema.isLessThanOrEqualTo(604_800_000)),
|
|
104
|
+
/** Preparation may repeat after loss before its decision commits; keep callbacks side-effect free. */
|
|
105
|
+
reportPreparationTimeoutMillis: Schema.optionalKey(
|
|
106
|
+
Positive.check(Schema.isLessThanOrEqualTo(30_000)),
|
|
107
|
+
),
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
export type WorkerHostLimits = typeof WorkerHostLimits.Type;
|
|
111
|
+
|
|
112
|
+
export const WorkerHostConfig = Context.Reference<WorkerHostLimits>(
|
|
113
|
+
"@effect-agent/thread/WorkerHostConfig",
|
|
114
|
+
{
|
|
115
|
+
defaultValue: () => ({
|
|
116
|
+
maxWorkersPerSource: 32,
|
|
117
|
+
maxInputsPerWorker: 64,
|
|
118
|
+
maxPendingInputsPerWorker: 8,
|
|
119
|
+
lifetimeMillis: 86_400_000,
|
|
120
|
+
}),
|
|
121
|
+
},
|
|
122
|
+
);
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* Authenticate every acquisition/operation and authorize its exact source Thread. A returned
|
|
126
|
+
* Principal is host-owned admission identity. Context access authenticates source metadata;
|
|
127
|
+
* read, send and control remain separate grants. WorkerRefs and caller-supplied Thread
|
|
128
|
+
* identifiers alone never confer any of them.
|
|
129
|
+
*/
|
|
130
|
+
export interface WorkerHostAuthorizationRequest {
|
|
131
|
+
readonly sourceThreadId: ThreadId;
|
|
132
|
+
/** An explicitly selected owner input; authorize this locator as well as the Thread. */
|
|
133
|
+
readonly sourceSubmissionId?: SubmissionId;
|
|
134
|
+
readonly principal: Principal;
|
|
135
|
+
readonly operation: WorkerError["operation"];
|
|
136
|
+
readonly access: "context" | "read" | "send" | "control";
|
|
137
|
+
readonly worker?: WorkerRef;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export const WorkerHostAuthorizer = Context.Reference<{
|
|
141
|
+
readonly authorize: (
|
|
142
|
+
request: WorkerHostAuthorizationRequest,
|
|
143
|
+
) => Effect.Effect<Principal, WorkerError>;
|
|
144
|
+
}>("@effect-agent/thread/WorkerHostAuthorizer", {
|
|
145
|
+
defaultValue: () => ({
|
|
146
|
+
authorize: (request) =>
|
|
147
|
+
WorkerError.make({
|
|
148
|
+
operation: request.operation,
|
|
149
|
+
reason: "denied",
|
|
150
|
+
}),
|
|
151
|
+
}),
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Deployment-owned permission to fund a root's background worker independently. The decision
|
|
156
|
+
* covers the exact immutable origin and is checked again before each input admission. It never
|
|
157
|
+
* changes delegation depth or Tool authority. Omission denies independent funding.
|
|
158
|
+
*/
|
|
159
|
+
export const WorkerBudgetAuthorizer = Context.Reference<{
|
|
160
|
+
readonly authorize: (request: {
|
|
161
|
+
readonly source: WorkerSource;
|
|
162
|
+
readonly principal: Principal;
|
|
163
|
+
readonly worker: WorkerRef;
|
|
164
|
+
readonly policy: AgentPolicy;
|
|
165
|
+
readonly budget: SubagentBudgetReservation;
|
|
166
|
+
}) => Effect.Effect<void, WorkerError>;
|
|
167
|
+
}>("@effect-agent/thread/WorkerBudgetAuthorizer", {
|
|
168
|
+
defaultValue: () => ({
|
|
169
|
+
authorize: () => WorkerError.make({ operation: "start", reason: "denied" }),
|
|
170
|
+
}),
|
|
171
|
+
});
|