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 @@
|
|
|
1
|
+
{"version":3,"file":"CommittedActivity.mjs","names":[],"sources":["../../src/durable/CommittedActivity.ts"],"sourcesContent":["import { Clock, Effect, Schema, Stream, type Crypto, type Scope } from \"effect\";\n\nimport {\n ActivityClaim,\n ActivityClaimRequest,\n ActivityProcessorKey,\n ActivityProcessorStore,\n PreparedActivity,\n type ActivityStoreFailure,\n} from \"./ActivityStore.ts\";\nimport { digestJson, type DigestError } from \"./Digest.ts\";\nimport {\n CanonicalRecordEnvelope,\n CanonicalSequence,\n PersistedJson,\n RecordEnvelope,\n} from \"./Records.ts\";\nimport {\n ThreadRead,\n ThreadStore,\n ThreadTail,\n ThreadTailRequest,\n type ThreadNotMaterialized,\n type ThreadStoreError,\n} from \"./ThreadStore.ts\";\n\nexport class ActivityPassLimits extends Schema.Class<ActivityPassLimits>(\n \"@effect-agent/thread/ActivityPassLimits\",\n)({\n maxRecords: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 4_096 })),\n pageSize: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 128 })),\n timeoutMillis: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: 300_000 })),\n leaseMillis: ActivityClaimRequest.fields.leaseMillis,\n}) {}\n\nexport class ActivityProcessingError extends Schema.TaggedError<ActivityProcessingError>()(\n \"ActivityProcessingError\",\n {\n reason: Schema.Literals([\"invalid-input\", \"noncontiguous\", \"timeout\"]),\n message: Schema.String.check(Schema.isMaxLength(1_024)),\n },\n) {}\n\nexport class ActivityPassResult extends Schema.Class<ActivityPassResult>(\n \"@effect-agent/thread/ActivityPassResult\",\n)({\n key: ActivityProcessorKey,\n capturedTail: CanonicalSequence,\n throughSequence: CanonicalSequence,\n processed: Schema.Natural,\n pendingRecords: Schema.Natural,\n startedAt: Schema.Finite,\n finishedAt: Schema.Finite,\n}) {}\n\nexport interface CommittedActivityProcessor<E = never, R = never, EApply = never, RApply = never> {\n readonly key: ActivityProcessorKey;\n /** Unique to this worker lifetime; it is not canonical Thread ownership. */\n readonly owner: string;\n readonly limits: ActivityPassLimits;\n /** Select eligibility and encode an application Schema; null can represent no output. */\n readonly extract: (record: CanonicalRecordEnvelope) => Effect.Effect<PersistedJson, E, R>;\n /**\n * Must durably reconcile workId before returning, using atomic idempotency and conditional\n * writes. This may run again after any lost acknowledgement. A stale invocation can finish\n * only the already pinned output; it must not overwrite a later correction or withdrawal.\n * Retain reconciliation evidence for the lifetime of pending work, including any supported\n * backup/restore window. Returning before durable application would permit skipped output.\n */\n readonly apply: (work: PreparedActivity) => Effect.Effect<void, EApply, RApply>;\n}\n\nconst invalid = (message: string) =>\n ActivityProcessingError.make({ reason: \"invalid-input\", message });\n\nconst contiguous = () =>\n ActivityProcessingError.make({\n reason: \"noncontiguous\",\n message: \"Committed activity does not match its captured Thread prefix or pinned record\",\n });\n\n/** Stable work identity independent of worker claims, retry count, extraction, and clocks. */\nexport const activityWorkId = Effect.fn(\"activityWorkId\")(function* (\n key: ActivityProcessorKey,\n sequence: CanonicalSequence,\n) {\n return yield* digestJson([\n \"effect-agent/activity@1\",\n key.processorId,\n key.processorVersion,\n key.threadId,\n sequence,\n ]);\n});\n\n/**\n * Process one bounded committed prefix of one application-selected Thread. Nothing runs until\n * invoked, and no daemon, global Thread directory, admission ledger, or engine checkpoint is\n * involved. PersistentHistory makes a successful Run's batch visible together; durable Runs\n * expose incremental committed records. The application decides what each record means.\n *\n * A durable pending output wins over a new extraction after restart. Apply finishes before\n * progress advances, so separate output stores require durable idempotency. This does not\n * promise exactly-once external side effects. Each callback owns a Scope; the finite pass has\n * a timeout and a longer lease. Claim release has a separate 500ms deadline; failure leaves\n * the bounded lease to expire.\n */\nexport const processCommittedActivity = Effect.fn(\"processCommittedActivity\")(function* <\n E = never,\n R = never,\n EApply = never,\n RApply = never,\n>(\n processor: CommittedActivityProcessor<E, R, EApply, RApply>,\n): Effect.fn.Return<\n ActivityPassResult,\n | E\n | EApply\n | ActivityStoreFailure\n | ActivityProcessingError\n | DigestError\n | ThreadStoreError\n | ThreadNotMaterialized,\n ActivityProcessorStore | ThreadStore | Crypto.Crypto | Exclude<R | RApply, Scope.Scope>\n> {\n const key = yield* Schema.decodeEffect(ActivityProcessorKey)(processor.key).pipe(\n Effect.mapError(() => invalid(\"Invalid activity processor key\")),\n );\n\n const limits = yield* Schema.decodeEffect(ActivityPassLimits)(processor.limits).pipe(\n Effect.mapError(() => invalid(\"Invalid activity pass limits\")),\n );\n\n if (limits.leaseMillis < limits.timeoutMillis + 1_000) {\n return yield* invalid(\"The activity lease must exceed the pass timeout by at least 1000ms\");\n }\n\n const request = yield* ActivityClaimRequest.makeEffect({\n key,\n owner: processor.owner,\n leaseMillis: limits.leaseMillis,\n }).pipe(Effect.mapError(() => invalid(\"Invalid activity worker identity\")));\n\n const progress = yield* ActivityProcessorStore;\n const threads = yield* ThreadStore;\n\n return yield* Effect.scoped(\n Effect.gen(function* () {\n const acquired = yield* Effect.acquireRelease(\n progress.claim(request).pipe(Effect.interruptible),\n (claim) =>\n progress\n .release(claim)\n .pipe(Effect.interruptible, Effect.timeoutOption(500), Effect.ignore),\n );\n\n let claim = yield* Schema.decodeEffect(ActivityClaim)(acquired).pipe(\n Effect.mapError(() => invalid(\"Malformed activity claim\")),\n );\n\n if (\n !Schema.toEquivalence(ActivityProcessorKey)(claim.key, key) ||\n claim.owner !== request.owner\n )\n return yield* invalid(\"Activity claim identity does not match its request\");\n const startedAt = yield* Clock.currentTimeMillis;\n\n const tail = yield* threads\n .inspectTail(ThreadTailRequest.make({ threadId: key.threadId }))\n .pipe(\n Effect.flatMap((value) =>\n Schema.decodeEffect(ThreadTail)(value).pipe(Effect.mapError(contiguous)),\n ),\n );\n\n if (\n tail.threadId !== key.threadId ||\n tail.tailSequence < claim.throughSequence ||\n (claim.pending !== null && tail.tailSequence < claim.pending.sequence)\n ) {\n return yield* contiguous();\n }\n const through = Math.min(tail.tailSequence, claim.throughSequence + limits.maxRecords);\n let processed = 0;\n\n while (claim.throughSequence < through) {\n const limit = Math.min(limits.pageSize, through - claim.throughSequence);\n\n const page = yield* threads\n .read(\n ThreadRead.make({\n threadId: key.threadId,\n afterSequence: claim.throughSequence,\n limit,\n }),\n )\n .pipe(Stream.take(limit + 1), Stream.runCollect);\n\n if (page.length !== limit) return yield* contiguous();\n for (const rawRecord of page) {\n const record = yield* Schema.decodeEffect(Schema.toType(CanonicalRecordEnvelope))(\n rawRecord,\n ).pipe(Effect.mapError(contiguous));\n\n if (record.threadId !== key.threadId || record.sequence !== claim.throughSequence + 1) {\n return yield* contiguous();\n }\n const workId = yield* activityWorkId(key, record.sequence);\n\n const encodedRecord = yield* Schema.encodeEffect(RecordEnvelope)(record.record).pipe(\n Effect.mapError(contiguous),\n );\n\n const recordDigest = yield* digestJson(encodedRecord);\n let work = claim.pending;\n\n if (work === null) {\n const output = yield* Effect.scoped(processor.extract(record)).pipe(\n Effect.flatMap((value) =>\n Schema.decodeEffect(PersistedJson)(value).pipe(\n Effect.mapError(() => invalid(\"Malformed activity output\")),\n ),\n ),\n );\n\n work = yield* progress.prepare({\n claim,\n work: PreparedActivity.make({\n version: 1,\n key,\n sequence: record.sequence,\n workId,\n recordId: record.record.recordId,\n recordDigest,\n output,\n }),\n });\n }\n\n const prepared = yield* Schema.decodeEffect(PreparedActivity)(work).pipe(\n Effect.mapError(() => invalid(\"Malformed prepared activity\")),\n );\n\n if (\n !Schema.toEquivalence(ActivityProcessorKey)(prepared.key, key) ||\n prepared.sequence !== record.sequence ||\n prepared.workId !== workId ||\n prepared.recordId !== record.record.recordId ||\n prepared.recordDigest !== recordDigest\n )\n return yield* contiguous();\n yield* Effect.scoped(processor.apply(prepared));\n\n const next = yield* progress\n .advance({ claim, workId })\n .pipe(\n Effect.flatMap((value) =>\n Schema.decodeEffect(ActivityClaim)(value).pipe(\n Effect.mapError(() => invalid(\"Malformed activity progress\")),\n ),\n ),\n );\n\n if (\n !Schema.toEquivalence(ActivityProcessorKey)(next.key, key) ||\n next.owner !== claim.owner ||\n next.epoch !== claim.epoch ||\n next.throughSequence !== record.sequence ||\n next.pending !== null\n )\n return yield* invalid(\"Activity progress advanced outside the claimed record\");\n claim = next;\n processed += 1;\n }\n }\n\n return ActivityPassResult.make({\n key,\n capturedTail: tail.tailSequence,\n throughSequence: claim.throughSequence,\n processed,\n pendingRecords: tail.tailSequence - claim.throughSequence,\n startedAt,\n finishedAt: yield* Clock.currentTimeMillis,\n });\n }),\n ).pipe(\n Effect.timeoutOrElse({\n duration: limits.timeoutMillis,\n orElse: () =>\n Effect.fail(\n ActivityProcessingError.make({ reason: \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AS;EAA0B,CAAC,CACxF;CACJ,CAAC,CACH;AACF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { Gr as digestDefinition, Kr as digestDefinitions, Ur as EMPTY_TAIL_DIGEST, Vr as DigestError, Wr as digestCanonicalBatch, qr as digestJson } from "../Records-BAGkekt8.mjs";
|
|
2
|
+
export { DigestError, EMPTY_TAIL_DIGEST, digestCanonicalBatch, digestDefinition, digestDefinitions, digestJson };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { CanonicalBatch, DefinitionDigests, Digest } from "./Records.mjs";
|
|
3
|
+
import { Array, Crypto, Effect, Encoding, Schema } from "effect";
|
|
4
|
+
//#region src/durable/Digest.ts
|
|
5
|
+
var Digest_exports = /* @__PURE__ */ __exportAll({
|
|
6
|
+
DigestError: () => DigestError,
|
|
7
|
+
EMPTY_TAIL_DIGEST: () => EMPTY_TAIL_DIGEST,
|
|
8
|
+
digestCanonicalBatch: () => digestCanonicalBatch,
|
|
9
|
+
digestDefinition: () => digestDefinition,
|
|
10
|
+
digestDefinitions: () => digestDefinitions,
|
|
11
|
+
digestJson: () => digestJson
|
|
12
|
+
});
|
|
13
|
+
var DigestError = class extends Schema.TaggedError()("DigestError", {
|
|
14
|
+
message: Schema.String,
|
|
15
|
+
cause: Schema.optionalKey(Schema.Defect())
|
|
16
|
+
}) {};
|
|
17
|
+
const utf8 = new TextEncoder();
|
|
18
|
+
const canonicalJson = (value) => {
|
|
19
|
+
if (value === null || typeof value === "boolean" || typeof value === "number" || typeof value === "string") return JSON.stringify(value);
|
|
20
|
+
if (Array.isArray(value)) return `[${globalThis.Array.from(value, canonicalJson).join(",")}]`;
|
|
21
|
+
return `{${Object.entries(value).sort(([left], [right]) => left < right ? -1 : left > right ? 1 : 0).map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`).join(",")}}`;
|
|
22
|
+
};
|
|
23
|
+
/** Digest a JSON value using a stable, locale-independent object-key ordering (UTF-16 code units, RFC 8785 style). */
|
|
24
|
+
const digestJson = Effect.fn("Thread.digestJson")(function* (value) {
|
|
25
|
+
const crypto = yield* Crypto.Crypto;
|
|
26
|
+
const bytes = utf8.encode(canonicalJson(value));
|
|
27
|
+
const digest = yield* crypto.digest("SHA-256", bytes).pipe(Effect.mapError((error) => DigestError.make({
|
|
28
|
+
message: `SHA-256 failed: ${error.message}`,
|
|
29
|
+
cause: error
|
|
30
|
+
})));
|
|
31
|
+
return yield* Schema.decodeEffect(Digest)(Encoding.encodeHex(digest)).pipe(Effect.mapError(() => DigestError.make({ message: "SHA-256 returned an invalid digest" })));
|
|
32
|
+
});
|
|
33
|
+
/** Digest a canonical batch together with the prior tail to form an append-only hash chain. */
|
|
34
|
+
const digestCanonicalBatch = Effect.fn("Thread.digestCanonicalBatch")((previousTailDigest, batch) => Schema.encodeEffect(CanonicalBatch)(batch).pipe(Effect.mapError(() => DigestError.make({ message: "Canonical batch encoding failed" })), Effect.flatMap((encoded) => digestJson({
|
|
35
|
+
previousTailDigest,
|
|
36
|
+
batch: encoded
|
|
37
|
+
}))));
|
|
38
|
+
/** Digest one schema-encoded Agent, Model, or Toolkit definition. */
|
|
39
|
+
const digestDefinition = Effect.fn("Thread.digestDefinition")((definition) => digestJson(definition));
|
|
40
|
+
/** Digest all replay-relevant definitions without hiding which authority changed. */
|
|
41
|
+
const digestDefinitions = Effect.fn("Thread.digestDefinitions")((definitions) => Effect.all({
|
|
42
|
+
agent: digestDefinition(definitions.agent),
|
|
43
|
+
model: digestDefinition(definitions.model),
|
|
44
|
+
tools: digestDefinition(definitions.tools)
|
|
45
|
+
}).pipe(Effect.map((digests) => DefinitionDigests.make(digests))));
|
|
46
|
+
const EMPTY_TAIL_DIGEST = Schema.decodeSync(Digest)("0000000000000000000000000000000000000000000000000000000000000000");
|
|
47
|
+
//#endregion
|
|
48
|
+
export { DigestError, EMPTY_TAIL_DIGEST, digestCanonicalBatch, digestDefinition, digestDefinitions, digestJson, Digest_exports as t };
|
|
49
|
+
|
|
50
|
+
//# sourceMappingURL=Digest.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Digest.mjs","names":[],"sources":["../../src/durable/Digest.ts"],"sourcesContent":["import type { PlatformError } from \"effect\";\nimport { Array, Crypto, Effect, Encoding, Schema } from \"effect\";\n\nimport type { DefinitionDigestInput } from \"./Records.ts\";\nimport { CanonicalBatch, DefinitionDigests, Digest } from \"./Records.ts\";\n\nexport class DigestError extends Schema.TaggedError<DigestError>()(\"DigestError\", {\n message: Schema.String,\n cause: Schema.optionalKey(Schema.Defect()),\n}) {}\n\nconst utf8 = new TextEncoder();\n\nconst canonicalJson = (value: Schema.Json): string => {\n if (\n value === null ||\n typeof value === \"boolean\" ||\n typeof value === \"number\" ||\n typeof value === \"string\"\n ) {\n return JSON.stringify(value);\n }\n if (Array.isArray<Schema.Json>(value)) {\n return `[${globalThis.Array.from(value, canonicalJson).join(\",\")}]`;\n }\n\n const entries = Object.entries(value).sort(([left], [right]) =>\n left < right ? -1 : left > right ? 1 : 0,\n );\n\n return `{${entries\n .map(([key, entry]) => `${JSON.stringify(key)}:${canonicalJson(entry)}`)\n .join(\",\")}}`;\n};\n\n/** Digest a JSON value using a stable, locale-independent object-key ordering (UTF-16 code units, RFC 8785 style). */\nexport const digestJson = Effect.fn(\"Thread.digestJson\")(function* (\n value: Schema.Json,\n): Effect.fn.Return<Digest, DigestError, Crypto.Crypto> {\n const crypto = yield* Crypto.Crypto;\n\n const bytes = utf8.encode(canonicalJson(value));\n\n const digest = yield* crypto\n .digest(\"SHA-256\", bytes)\n .pipe(\n Effect.mapError((error: PlatformError.PlatformError) =>\n DigestError.make({ message: `SHA-256 failed: ${error.message}`, cause: error }),\n ),\n );\n\n return yield* Schema.decodeEffect(Digest)(Encoding.encodeHex(digest)).pipe(\n Effect.mapError(() => DigestError.make({ message: \"SHA-256 returned an invalid digest\" })),\n );\n});\n\n/** Digest a canonical batch together with the prior tail to form an append-only hash chain. */\nexport const digestCanonicalBatch = Effect.fn(\"Thread.digestCanonicalBatch\")(\n (\n previousTailDigest: Digest,\n batch: CanonicalBatch,\n ): Effect.Effect<Digest, DigestError, Crypto.Crypto> =>\n Schema.encodeEffect(CanonicalBatch)(batch).pipe(\n Effect.mapError(() => DigestError.make({ message: \"Canonical batch encoding failed\" })),\n Effect.flatMap((encoded) =>\n digestJson({\n previousTailDigest,\n batch: encoded,\n }),\n ),\n ),\n);\n\n/** Digest one schema-encoded Agent, Model, or Toolkit definition. */\nexport const digestDefinition = Effect.fn(\"Thread.digestDefinition\")((definition: Schema.Json) =>\n digestJson(definition),\n);\n\n/** Digest all replay-relevant definitions without hiding which authority changed. */\nexport const digestDefinitions = Effect.fn(\"Thread.digestDefinitions\")(\n (\n definitions: DefinitionDigestInput,\n ): Effect.Effect<DefinitionDigests, DigestError, Crypto.Crypto> =>\n Effect.all({\n agent: digestDefinition(definitions.agent),\n model: digestDefinition(definitions.model),\n tools: digestDefinition(definitions.tools),\n }).pipe(Effect.map((digests) => DefinitionDigests.make(digests))),\n);\n\nexport const EMPTY_TAIL_DIGEST = Schema.decodeSync(Digest)(\n \"0000000000000000000000000000000000000000000000000000000000000000\",\n);\n"],"mappings":";;;;;;;;;;;;AAMA,IAAa,cAAb,cAAiC,OAAO,YAAyB,CAAC,CAAC,eAAe;CAChF,SAAS,OAAO;CAChB,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;AAC3C,CAAC,CAAC,CAAC,CAAC;AAEJ,MAAM,OAAO,IAAI,YAAY;AAE7B,MAAM,iBAAiB,UAA+B;CACpD,IACE,UAAU,QACV,OAAO,UAAU,aACjB,OAAO,UAAU,YACjB,OAAO,UAAU,UAEjB,OAAO,KAAK,UAAU,KAAK;CAE7B,IAAI,MAAM,QAAqB,KAAK,GAClC,OAAO,IAAI,WAAW,MAAM,KAAK,OAAO,aAAa,CAAC,CAAC,KAAK,GAAG,E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AC,CAAC,KAAK,OAAO,KAAK,YAAY,kBAAkB,KAAK,OAAO,CAAC,CAAC,CACpE;AAEA,MAAa,oBAAoB,OAAO,WAAW,MAAM,CAAC,CACxD,kEACF"}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { a as Receipt } from "../Receipt-BAHyigAF.mjs";
|
|
2
|
+
import { At as DurableWorkerFailure, Ct as DurableRetryFailure, Dt as DurableSubmitFailure, Et as DurableSubmitAgent, Ft as recoveryRepairRecordId, It as threadCreatedBatchId, Lt as threadCreatedRecordId, Mt as RecoveryReport, Nt as childReservationIdFor, Ot as DurableSubmitOptions, Pt as recoveryRepairBatchId, St as DurableResolveFailure, Tt as DurableRuntimeConfigOptions, _t as DurableAwaitFailure, bt as DurableObserveOptions, ft as DurableAbortFailure, gt as DurableApprovalResolver, ht as DurableApprovalFailure, jt as DurableWorkerRequirements, kt as DurableVerifyFailure, pt as DurableAgentRuntime, vt as DurableExplainFailure, wt as DurableRuntimeConfig, xt as DurableProgressFailure, yt as DurableObligationFailure } from "../Records-BAGkekt8.mjs";
|
|
3
|
+
export { DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryReport, childReservationIdFor, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { Receipt } from "../core/Receipt.mjs";
|
|
2
|
+
import { a as RecoveryReport, c as recoveryRepairRecordId, i as DurableRuntimeConfig, l as threadCreatedBatchId, o as childReservationIdFor, r as DurableApprovalResolver, s as recoveryRepairBatchId, t as DurableAgentRuntime, u as threadCreatedRecordId } from "../DurableAgentRuntime-uggeJpv3.mjs";
|
|
3
|
+
export { DurableAgentRuntime, DurableApprovalResolver, DurableRuntimeConfig, Receipt, RecoveryReport, childReservationIdFor, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as DurableRuntimeFailpointLocation, i as DurableRuntimeFailpointHandler, n as DurableRuntimeFailpoint, r as DurableRuntimeFailpointError } from "../DurableFailpoint-Oinuuedm.mjs";
|
|
2
|
+
export { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointHandler, DurableRuntimeFailpointLocation };
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
3
|
+
//#region src/durable/DurableFailpoint.ts
|
|
4
|
+
var DurableFailpoint_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
DurableRuntimeFailpoint: () => DurableRuntimeFailpoint,
|
|
6
|
+
DurableRuntimeFailpointError: () => DurableRuntimeFailpointError,
|
|
7
|
+
DurableRuntimeFailpointLocation: () => DurableRuntimeFailpointLocation
|
|
8
|
+
});
|
|
9
|
+
/**
|
|
10
|
+
* Coordinator-owned failpoint locations (plan §Failpoints). Locations normally sit immediately
|
|
11
|
+
* AFTER one durable mutation of the six-step coordinator flow, so a fault injected there
|
|
12
|
+
* simulates a crash between two durable steps; the matching BEFORE boundary of each mutation is
|
|
13
|
+
* owned by the storage adapters (`ledger:*:before`, `append:before`, ...), giving every durable
|
|
14
|
+
* mutation a failpoint on both sides (change discipline). Run-start append also exposes its
|
|
15
|
+
* BEFORE boundary here to distinguish a fresh clock from a committed clock in crash tests.
|
|
16
|
+
*
|
|
17
|
+
* The `subagent:*` family covers every durable mutation of the S2 establishment/join protocol
|
|
18
|
+
* including reservation, request append, child admission, child readiness,
|
|
19
|
+
* start-link append, sibling per-call settles at the suspension seam, the `waitingForChild`
|
|
20
|
+
* suspension, child abort propagation, the atomic join batch, and both reservation-release
|
|
21
|
+
* transitions.
|
|
22
|
+
*/
|
|
23
|
+
const DurableRuntimeFailpointLocation = Schema.Literals([
|
|
24
|
+
"submit:after-admit",
|
|
25
|
+
"submit:after-materialize",
|
|
26
|
+
"claim:after-claim",
|
|
27
|
+
"input:after-canonical-append",
|
|
28
|
+
"run:before-start-append",
|
|
29
|
+
"run:after-start-append",
|
|
30
|
+
"turn:after-canonical-append",
|
|
31
|
+
"turn:after-response-append",
|
|
32
|
+
"turn:after-results-append",
|
|
33
|
+
"compaction:before-canonical-append",
|
|
34
|
+
"compaction:after-canonical-append",
|
|
35
|
+
"checkpoint:before-save",
|
|
36
|
+
"checkpoint:after-save",
|
|
37
|
+
"tools:after-prepared-append",
|
|
38
|
+
"tools:before-prepared-append",
|
|
39
|
+
"policy:before-reservation-append",
|
|
40
|
+
"policy:after-reservation-append",
|
|
41
|
+
"step:after-step-append",
|
|
42
|
+
"approval:after-request-append",
|
|
43
|
+
"approval:after-suspend",
|
|
44
|
+
"join:after-claim",
|
|
45
|
+
"join:after-canonical-append",
|
|
46
|
+
"resolve:after-intent",
|
|
47
|
+
"terminalize:after-reserve",
|
|
48
|
+
"terminalize:after-canonical-append",
|
|
49
|
+
"abort:after-intent",
|
|
50
|
+
"subagent:after-reserve",
|
|
51
|
+
"subagent:after-request-append",
|
|
52
|
+
"subagent:after-admit",
|
|
53
|
+
"subagent:after-child-ready",
|
|
54
|
+
"subagent:after-start-append",
|
|
55
|
+
"subagent:after-sibling-settle",
|
|
56
|
+
"subagent:after-suspend",
|
|
57
|
+
"subagent:after-child-abort-intent",
|
|
58
|
+
"subagent:before-join-append",
|
|
59
|
+
"subagent:after-join-append",
|
|
60
|
+
"subagent:after-release-pending",
|
|
61
|
+
"subagent:after-release",
|
|
62
|
+
"worker:before-source-append",
|
|
63
|
+
"worker:after-source-append",
|
|
64
|
+
"worker:before-origin-append",
|
|
65
|
+
"worker:after-origin-append",
|
|
66
|
+
"worker:before-completion-append",
|
|
67
|
+
"worker:after-completion-append",
|
|
68
|
+
"worker:before-subtree-append",
|
|
69
|
+
"worker:after-subtree-append",
|
|
70
|
+
"worker:before-report-append",
|
|
71
|
+
"worker:after-report-append",
|
|
72
|
+
"worker:before-report-delivery",
|
|
73
|
+
"worker:after-report-delivery",
|
|
74
|
+
"update:before-canonical-append",
|
|
75
|
+
"update:after-canonical-append",
|
|
76
|
+
"update:before-delivery-insert",
|
|
77
|
+
"update:after-delivery-insert"
|
|
78
|
+
]);
|
|
79
|
+
/** Injected coordinator fault. Reaching the caller means the preceding durable step committed. */
|
|
80
|
+
var DurableRuntimeFailpointError = class extends Schema.TaggedError()("DurableRuntimeFailpointError", { location: DurableRuntimeFailpointLocation }) {};
|
|
81
|
+
const noFailpoint = () => Effect.void;
|
|
82
|
+
/**
|
|
83
|
+
* Explicit fault-injection authority used at durable coordinator step boundaries. The process
|
|
84
|
+
* crash harness (WP5) maps a hit to `process.exit`; in-process tests fail the step with the
|
|
85
|
+
* typed `DurableRuntimeFailpointError` instead.
|
|
86
|
+
*/
|
|
87
|
+
var DurableRuntimeFailpoint = class extends Context.Service()("@effect-agent/thread/DurableRuntimeFailpoint") {
|
|
88
|
+
/** Production default: no fault injection. */
|
|
89
|
+
static layer = Layer.succeed(this)({ hit: noFailpoint });
|
|
90
|
+
};
|
|
91
|
+
//#endregion
|
|
92
|
+
export { DurableRuntimeFailpoint, DurableRuntimeFailpointError, DurableRuntimeFailpointLocation, DurableFailpoint_exports as t };
|
|
93
|
+
|
|
94
|
+
//# sourceMappingURL=DurableFailpoint.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DurableFailpoint.mjs","names":[],"sources":["../../src/durable/DurableFailpoint.ts"],"sourcesContent":["import { Context, Effect, Layer, Schema } from \"effect\";\n\n/**\n * Coordinator-owned failpoint locations (plan §Failpoints). Locations normally sit immediately\n * AFTER one durable mutation of the six-step coordinator flow, so a fault injected there\n * simulates a crash between two durable steps; the matching BEFORE boundary of each mutation is\n * owned by the storage adapters (`ledger:*:before`, `append:before`, ...), giving every durable\n * mutation a failpoint on both sides (change discipline). Run-start append also exposes its\n * BEFORE boundary here to distinguish a fresh clock from a committed clock in crash tests.\n *\n * The `subagent:*` family covers every durable mutation of the S2 establishment/join protocol\n * including reservation, request append, child admission, child readiness,\n * start-link append, sibling per-call settles at the suspension seam, the `waitingForChild`\n * suspension, child abort propagation, the atomic join batch, and both reservation-release\n * transitions.\n */\nexport const DurableRuntimeFailpointLocation = Schema.Literals([\n \"submit:after-admit\",\n \"submit:after-materialize\",\n \"claim:after-claim\",\n \"input:after-canonical-append\",\n \"run:before-start-append\",\n \"run:after-start-append\",\n \"turn:after-canonical-append\",\n \"turn:after-response-append\",\n \"turn:after-results-append\",\n \"compaction:before-canonical-append\",\n \"compaction:after-canonical-append\",\n \"checkpoint:before-save\",\n \"checkpoint:after-save\",\n \"tools:after-prepared-append\",\n \"tools:before-prepared-append\",\n \"policy:before-reservation-append\",\n \"policy:after-reservation-append\",\n \"step:after-step-append\",\n \"approval:after-request-append\",\n \"approval:after-suspend\",\n \"join:after-claim\",\n \"join:after-canonical-append\",\n \"resolve:after-intent\",\n \"terminalize:after-reserve\",\n \"terminalize:after-canonical-append\",\n \"abort:after-intent\",\n \"subagent:after-reserve\",\n \"subagent:after-request-append\",\n \"subagent:after-admit\",\n \"subagent:after-child-ready\",\n \"subagent:after-start-append\",\n \"subagent:after-sibling-settle\",\n \"subagent:after-suspend\",\n \"subagent:after-child-abort-intent\",\n \"subagent:before-join-append\",\n \"subagent:after-join-append\",\n \"subagent:after-release-pending\",\n \"subagent:after-release\",\n \"worker:before-source-append\",\n \"worker:after-source-append\",\n \"worker:before-origin-append\",\n \"worker:after-origin-append\",\n \"worker:before-completion-append\",\n \"worker:after-completion-append\",\n \"worker:before-subtree-append\",\n \"worker:after-subtree-append\",\n \"worker:before-report-append\",\n \"worker:after-report-append\",\n \"worker:before-report-delivery\",\n \"worker:after-report-delivery\",\n \"update:before-canonical-append\",\n \"update:after-canonical-append\",\n \"update:before-delivery-insert\",\n \"update:after-delivery-insert\",\n]);\n\nexport type DurableRuntimeFailpointLocation = typeof DurableRuntimeFailpointLocation.Type;\n\n/** Injected coordinator fault. Reaching the caller means the preceding durable step committed. */\nexport class DurableRuntimeFailpointError extends Schema.TaggedError<DurableRuntimeFailpointError>()(\n \"DurableRuntimeFailpointError\",\n {\n location: DurableRuntimeFailpointLocation,\n },\n) {}\n\nexport type DurableRuntimeFailpointHandler = (\n location: DurableRuntimeFailpointLocation,\n) => Effect.Effect<void, DurableRuntimeFailpointError>;\n\nconst noFailpoint: DurableRuntimeFailpointHandler = () => Effect.void;\n\n/**\n * Explicit fault-injection authority used at durable coordinator step boundaries. The process\n * crash harness (WP5) maps a hit to `process.exit`; in-process tests fail the step with the\n * typed `DurableRuntimeFailpointError` instead.\n */\nexport class DurableRuntimeFailpoint extends Context.Service<\n DurableRuntimeFailpoint,\n {\n readonly hit: DurableRuntimeFailpointHandler;\n }\n>()(\"@effect-agent/thread/DurableRuntimeFailpoint\") {\n /** Production default: no fault injection. */\n static readonly layer = Layer.succeed(this)({ hit: noFailpoint });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgBA,MAAa,kCAAkC,OAAO,SAAS;CAC7D;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;;AAKD,IAAa,+BAAb,cAAkD,OAAO,YAA0C,CAAC,CAClG,gCACA,EACE,UAAU,gCACZ,CACF,CAAC,CAAC,CAAC;AAMH,MAAM,oBAAoD,OAAO;;;;;;AAOjE,IAAa,0BAAb,cAA6C,QAAQ,QAKnD,CAAC,CAAC,8CAA8C,CAAC,CAAC;;CAElD,OAAgB,QAAQ,MAAM,QAAQ,IAAI,CAAC,CAAC,EAAE,KAAK,YAAY,CAAC;AAClE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { i as DurableRuntimeFailpointHandler, n as DurableRuntimeFailpoint } from "../DurableFailpoint-Oinuuedm.mjs";
|
|
2
|
+
import { Context, Effect, Layer } from "effect";
|
|
3
|
+
//#region src/durable/DurableFailpointTestControl.d.ts
|
|
4
|
+
declare const DurableRuntimeFailpointTestControl_base: Context.ServiceClass<DurableRuntimeFailpointTestControl, "@effect-agent/thread/DurableRuntimeFailpointTestControl", {
|
|
5
|
+
readonly clear: Effect.Effect<void>;
|
|
6
|
+
readonly setHandler: (handler: DurableRuntimeFailpointHandler) => Effect.Effect<void>;
|
|
7
|
+
}>;
|
|
8
|
+
/** Test-only control for replacing the active coordinator failpoint handler. */
|
|
9
|
+
declare class DurableRuntimeFailpointTestControl extends DurableRuntimeFailpointTestControl_base {
|
|
10
|
+
/** Reusable test Layer with a control service backed by the same handler Ref. */
|
|
11
|
+
static readonly layer: Layer.Layer<DurableRuntimeFailpoint | DurableRuntimeFailpointTestControl, never, never>;
|
|
12
|
+
}
|
|
13
|
+
//#endregion
|
|
14
|
+
export { DurableRuntimeFailpointTestControl };
|
|
15
|
+
//# sourceMappingURL=DurableFailpointTestControl.d.mts.map
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { DurableRuntimeFailpoint } from "./DurableFailpoint.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Ref } from "effect";
|
|
3
|
+
//#region src/durable/DurableFailpointTestControl.ts
|
|
4
|
+
const noFailpoint = () => Effect.void;
|
|
5
|
+
/** Test-only control for replacing the active coordinator failpoint handler. */
|
|
6
|
+
var DurableRuntimeFailpointTestControl = class DurableRuntimeFailpointTestControl extends Context.Service()("@effect-agent/thread/DurableRuntimeFailpointTestControl") {
|
|
7
|
+
/** Reusable test Layer with a control service backed by the same handler Ref. */
|
|
8
|
+
static layer = Layer.effectContext(Effect.gen(function* () {
|
|
9
|
+
const handler = yield* Ref.make(noFailpoint);
|
|
10
|
+
return Context.make(DurableRuntimeFailpoint, DurableRuntimeFailpoint.of({ hit: (location) => Ref.get(handler).pipe(Effect.flatMap((current) => current(location))) })).pipe(Context.add(DurableRuntimeFailpointTestControl, DurableRuntimeFailpointTestControl.of({
|
|
11
|
+
clear: Ref.set(handler, noFailpoint),
|
|
12
|
+
setHandler: (next) => Ref.set(handler, next)
|
|
13
|
+
})));
|
|
14
|
+
}));
|
|
15
|
+
};
|
|
16
|
+
//#endregion
|
|
17
|
+
export { DurableRuntimeFailpointTestControl };
|
|
18
|
+
|
|
19
|
+
//# sourceMappingURL=DurableFailpointTestControl.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DurableFailpointTestControl.mjs","names":[],"sources":["../../src/durable/DurableFailpointTestControl.ts"],"sourcesContent":["import { Context, Effect, Layer, Ref } from \"effect\";\n\nimport {\n DurableRuntimeFailpoint,\n type DurableRuntimeFailpointHandler,\n} from \"./DurableFailpoint.ts\";\n\nconst noFailpoint: DurableRuntimeFailpointHandler = () => Effect.void;\n\n/** Test-only control for replacing the active coordinator failpoint handler. */\nexport class DurableRuntimeFailpointTestControl extends Context.Service<\n DurableRuntimeFailpointTestControl,\n {\n readonly clear: Effect.Effect<void>;\n readonly setHandler: (handler: DurableRuntimeFailpointHandler) => Effect.Effect<void>;\n }\n>()(\"@effect-agent/thread/DurableRuntimeFailpointTestControl\") {\n /** Reusable test Layer with a control service backed by the same handler Ref. */\n static readonly layer = Layer.effectContext(\n Effect.gen(function* () {\n const handler = yield* Ref.make<DurableRuntimeFailpointHandler>(noFailpoint);\n\n return Context.make(\n DurableRuntimeFailpoint,\n DurableRuntimeFailpoint.of({\n hit: (location) => Ref.get(handler).pipe(Effect.flatMap((current) => current(location))),\n }),\n ).pipe(\n Context.add(\n DurableRuntimeFailpointTestControl,\n DurableRuntimeFailpointTestControl.of({\n clear: Ref.set(handler, noFailpoint),\n setHandler: (next) => Ref.set(handler, next),\n }),\n ),\n );\n }),\n );\n}\n"],"mappings":";;;AAOA,MAAM,oBAAoD,OAAO;;AAGjE,IAAa,qCAAb,MAAa,2CAA2C,QAAQ,QAM9D,CAAC,CAAC,yDAAyD,CAAC,CAAC;;CAE7D,OAAgB,QAAQ,MAAM,cAC5B,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAO,IAAI,KAAqC,WAAW;EAE3E,OAAO,QAAQ,KACb,yBACA,wBAAwB,GAAG,EACzB,MAAM,aAAa,IAAI,IAAI,OAAO,CAAC,CAAC,KAAK,OAAO,SAAS,YAAY,QAAQ,QAAQ,CAAC,CAAC,EACzF,CAAC,CACH,CAAC,CAAC,KACA,QAAQ,IACN,oCACA,mCAAmC,GAAG;GACpC,OAAO,IAAI,IAAI,SAAS,WAAW;GACnC,aAAa,SAAS,IAAI,IAAI,SAAS,IAAI;EAC7C,CAAC,CACH,CACF;CACF,CAAC,CACH;AACF"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { PersistedJson } from "./Records.mjs";
|
|
3
|
+
import { SubscriptionSourceError } from "./Subscription.mjs";
|
|
4
|
+
import { Context, Effect, Schema } from "effect";
|
|
5
|
+
//#region src/durable/EventSource.ts
|
|
6
|
+
var EventSource_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
EventSources: () => EventSources,
|
|
8
|
+
makeEventSource: () => makeEventSource
|
|
9
|
+
});
|
|
10
|
+
var EventSources = class extends Context.Service()("@effect-agent/thread/EventSources") {};
|
|
11
|
+
const invalid = () => SubscriptionSourceError.make({
|
|
12
|
+
code: "source-schema",
|
|
13
|
+
retryable: false
|
|
14
|
+
});
|
|
15
|
+
/**
|
|
16
|
+
* Capture the source's explicit Effect dependencies at host assembly. Matching and key functions
|
|
17
|
+
* must be pure and bounded under this exact semantic version.
|
|
18
|
+
* The returned source accepts Schema-encoded values at intake and management boundaries.
|
|
19
|
+
* Each operation owns a fresh Scope for its callbacks and codecs; captured host services
|
|
20
|
+
* retain their host lifetime. Operation resources finalize on success, failure, or interruption.
|
|
21
|
+
*/
|
|
22
|
+
const makeEventSource = Effect.fn("Thread.makeEventSource")(function* (options) {
|
|
23
|
+
const services = yield* Effect.context();
|
|
24
|
+
const encode = (schema, value) => Schema.encodeEffect(schema)(value).pipe(Effect.flatMap(Schema.decodeUnknownEffect(PersistedJson)), Effect.mapError(invalid));
|
|
25
|
+
const normalized = Effect.fn("EventSource.normalized")(function* (event) {
|
|
26
|
+
const occurredAtMillis = options.occurredAtMillis?.(event);
|
|
27
|
+
return {
|
|
28
|
+
eventId: options.identity(event),
|
|
29
|
+
...occurredAtMillis === void 0 ? {} : { occurredAtMillis },
|
|
30
|
+
matchingKey: options.eventKey(event),
|
|
31
|
+
payload: yield* encode(options.event, event)
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
const normalize = (value) => Schema.decodeUnknownEffect(PersistedJson)(value).pipe(Effect.flatMap(Schema.decodeUnknownEffect(options.event)), Effect.mapError(invalid), Effect.flatMap(normalized), Effect.scoped, Effect.provideContext(services));
|
|
35
|
+
const parameters = (value) => Effect.gen(function* () {
|
|
36
|
+
yield* Schema.decodeUnknownEffect(PersistedJson)(value).pipe(Effect.mapError(invalid));
|
|
37
|
+
const decoded = yield* Schema.decodeUnknownEffect(options.parameters)(value).pipe(Effect.mapError(invalid));
|
|
38
|
+
return {
|
|
39
|
+
parameters: yield* encode(options.parameters, decoded),
|
|
40
|
+
matchingKey: options.parameterKey(decoded)
|
|
41
|
+
};
|
|
42
|
+
}).pipe(Effect.scoped, Effect.provideContext(services));
|
|
43
|
+
const matches = (event, subscription) => Effect.gen(function* () {
|
|
44
|
+
const e = yield* Schema.decodeEffect(options.event)(event.payload).pipe(Effect.mapError(invalid));
|
|
45
|
+
const p = yield* Schema.decodeEffect(options.parameters)(subscription.configuration.parameters).pipe(Effect.mapError(invalid));
|
|
46
|
+
return options.matches(e, p);
|
|
47
|
+
}).pipe(Effect.scoped, Effect.provideContext(services));
|
|
48
|
+
const reconcile = options.reconcile;
|
|
49
|
+
return {
|
|
50
|
+
source: options.source,
|
|
51
|
+
continuity: options.continuity,
|
|
52
|
+
parameters,
|
|
53
|
+
normalize,
|
|
54
|
+
matches,
|
|
55
|
+
...reconcile === void 0 ? {} : { reconcile: (subscription) => Effect.gen(function* () {
|
|
56
|
+
const p = yield* Schema.decodeEffect(options.parameters)(subscription.configuration.parameters).pipe(Effect.mapError(invalid));
|
|
57
|
+
const event = yield* reconcile(p);
|
|
58
|
+
return event === null ? null : yield* normalized(event);
|
|
59
|
+
}).pipe(Effect.scoped, Effect.provideContext(services)) }
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
//#endregion
|
|
63
|
+
export { EventSources, makeEventSource, EventSource_exports as t };
|
|
64
|
+
|
|
65
|
+
//# sourceMappingURL=EventSource.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EventSource.mjs","names":[],"sources":["../../src/durable/EventSource.ts"],"sourcesContent":["import { Context, Effect, Schema, type Scope } from \"effect\";\n\nimport { PersistedJson } from \"./Records.ts\";\nimport {\n type AcceptedEvent,\n type EventSourceVersion,\n type SubscriptionRecord,\n SubscriptionSourceError,\n} from \"./Subscription.ts\";\n\nexport interface NormalizedEvent {\n readonly eventId: string;\n readonly occurredAtMillis?: number;\n readonly matchingKey: string;\n readonly payload: PersistedJson;\n}\n\n/** Runtime-only versioned behavior. Never persist this object or silently replace its version. */\nexport interface EventSource {\n readonly source: EventSourceVersion;\n readonly continuity: string;\n readonly parameters: (\n value: unknown,\n ) => Effect.Effect<\n { readonly parameters: PersistedJson; readonly matchingKey: string },\n SubscriptionSourceError\n >;\n readonly normalize: (value: unknown) => Effect.Effect<NormalizedEvent, SubscriptionSourceError>;\n readonly matches: (\n event: AcceptedEvent,\n subscription: SubscriptionRecord,\n ) => Effect.Effect<boolean, SubscriptionSourceError>;\n readonly reconcile?: (\n subscription: SubscriptionRecord,\n ) => Effect.Effect<NormalizedEvent | null, SubscriptionSourceError>;\n}\n\nexport class EventSources extends Context.Service<\n EventSources,\n {\n readonly sources: ReadonlyArray<EventSource>;\n }\n>()(\"@effect-agent/thread/EventSources\") {}\n\nconst invalid = () => SubscriptionSourceError.make({ code: \"source-schema\", retryable: false });\n\n/**\n * Capture the source's explicit Effect dependencies at host assembly. Matching and key functions\n * must be pure and bounded under this exact semantic version.\n * The returned source accepts Schema-encoded values at intake and management boundaries.\n * Each operation owns a fresh Scope for its callbacks and codecs; captured host services\n * retain their host lifetime. Operation resources finalize on success, failure, or interruption.\n */\nexport const makeEventSource = Effect.fn(\"Thread.makeEventSource\")(function* <\n Event extends Schema.Top,\n Parameters extends Schema.Top,\n R = never,\n>(options: {\n readonly source: EventSourceVersion;\n readonly continuity: string;\n readonly event: Event;\n readonly parameters: Parameters;\n readonly identity: (event: Event[\"Type\"]) => string;\n /** Authenticated source time, stable across delivery retries; required for bounded retention. */\n readonly occurredAtMillis?: (event: Event[\"Type\"]) => number | undefined;\n readonly eventKey: (event: Event[\"Type\"]) => string;\n readonly parameterKey: (parameters: Parameters[\"Type\"]) => string;\n readonly matches: (event: Event[\"Type\"], parameters: Parameters[\"Type\"]) => boolean;\n readonly reconcile?: (\n parameters: Parameters[\"Type\"],\n ) => Effect.Effect<Event[\"Type\"] | null, SubscriptionSourceError, R>;\n}): Effect.fn.Return<\n EventSource,\n never,\n Exclude<\n | R\n | Event[\"DecodingServices\"]\n | Event[\"EncodingServices\"]\n | Parameters[\"DecodingServices\"]\n | Parameters[\"EncodingServices\"],\n Scope.Scope\n >\n> {\n const services =\n yield* Effect.context<\n Exclude<\n | R\n | Event[\"DecodingServices\"]\n | Event[\"EncodingServices\"]\n | Parameters[\"DecodingServices\"]\n | Parameters[\"EncodingServices\"],\n Scope.Scope\n >\n >();\n\n const encode = <S extends Schema.Top>(schema: S, value: S[\"Type\"]) =>\n Schema.encodeEffect(schema)(value).pipe(\n Effect.flatMap(Schema.decodeUnknownEffect(PersistedJson)),\n Effect.mapError(invalid),\n );\n\n const normalized = Effect.fn(\"EventSource.normalized\")(function* (event: Event[\"Type\"]) {\n const occurredAtMillis = options.occurredAtMillis?.(event);\n\n return {\n eventId: options.identity(event),\n ...(occurredAtMillis === undefined ? {} : { occurredAtMillis }),\n matchingKey: options.eventKey(event),\n payload: yield* encode(options.event, event),\n };\n });\n\n const normalize: EventSource[\"normalize\"] = (value) =>\n Schema.decodeUnknownEffect(PersistedJson)(value).pipe(\n Effect.flatMap(Schema.decodeUnknownEffect(options.event)),\n Effect.mapError(invalid),\n Effect.flatMap(normalized),\n Effect.scoped,\n Effect.provideContext(services),\n );\n\n const parameters: EventSource[\"parameters\"] = (value) =>\n Effect.gen(function* () {\n yield* Schema.decodeUnknownEffect(PersistedJson)(value).pipe(Effect.mapError(invalid));\n\n const decoded = yield* Schema.decodeUnknownEffect(options.parameters)(value).pipe(\n Effect.mapError(invalid),\n );\n\n return {\n parameters: yield* encode(options.parameters, decoded),\n matchingKey: options.parameterKey(decoded),\n };\n }).pipe(Effect.scoped, Effect.provideContext(services));\n\n const matches: EventSource[\"matches\"] = (event, subscription) =>\n Effect.gen(function* () {\n const e = yield* Schema.decodeEffect(options.event)(event.payload).pipe(\n Effect.mapError(invalid),\n );\n\n const p = yield* Schema.decodeEffect(options.parameters)(\n subscription.configuration.parameters,\n ).pipe(Effect.mapError(invalid));\n\n return options.matches(e, p);\n }).pipe(Effect.scoped, Effect.provideContext(services));\n\n const reconcile = options.reconcile;\n\n return {\n source: options.source,\n continuity: options.continuity,\n parameters,\n normalize,\n matches,\n ...(reconcile === undefined\n ? {}\n : {\n reconcile: (subscription: SubscriptionRecord) =>\n Effect.gen(function* () {\n const p = yield* Schema.decodeEffect(options.parameters)(\n subscription.configuration.parameters,\n ).pipe(Effect.mapError(invalid));\n\n const event = yield* reconcile(p);\n\n return event === null ? null : yield* normalized(event);\n }).pipe(Effect.scoped, Effect.provideContext(services)),\n }),\n };\n});\n"],"mappings":";;;;;;;;;AAqCA,IAAa,eAAb,cAAkC,QAAQ,QAKxC,CAAC,CAAC,mCAAmC,CAAC,CAAC,CAAC;AAE1C,MAAM,gBAAgB,wBAAwB,KAAK;CAAE,MAAM;CAAiB,WAAW;AAAM,CAAC;;;;;;;;AAS9F,MAAa,kBAAkB,OAAO,GAAG,wBAAwB,CAAC,CAAC,WAIjE,SAyBA;CACA,MAAM,WACJ,OAAO,OAAO,QASZ;CAEJ,MAAM,UAAgC,QAAW,UAC/C,OAAO,aAAa,MAAM,CAAC,CAAC,KAAK,CAAC,CAAC,KACjC,OAAO,QAAQ,OAAO,oBAAoB,aAAa,CAAC,GACxD,OAAO,SAAS,OAAO,CACzB;CAEF,MAAM,aAAa,OAAO,GAAG,wBAAwB,CAAC,CAAC,WAAW,OAAsB;EACtF,MAAM,mBAAmB,QAAQ,mBAAmB,KAAK;EAEzD,OAAO;GACL,SAAS,QAAQ,SAAS,KAAK;GAC/B,GAAI,qBAAqB,KAAA,IAAY,CAAC,IAAI,EAAE,iBAAiB;GAC7D,aAAa,QAAQ,SAAS,KAAK;GACnC,SAAS,OAAO,OAAO,QAAQ,OAAO,KAAK;EAC7C;CACF,CAAC;CAED,MAAM,aAAuC,UAC3C,OAAO,oBAAoB,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,KAC/C,OAAO,QAAQ,OAAO,oBAAoB,QAAQ,KAAK,CAAC,GACxD,OAAO,SAAS,OAAO,GACvB,OAAO,QAAQ,UAAU,GACzB,OAAO,QACP,OAAO,eAAe,QAAQ,CAChC;CAEF,MAAM,cAAyC,UAC7C,OAAO,IAAI,aAAa;EACtB,OAAO,OAAO,oBAAoB,aAAa,CAAC,CAAC,KAAK,CAAC,CAAC,KAAK,OAA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js";
|
|
2
|
+
import "../Records-BAGkekt8.mjs";
|
|
3
|
+
import { E as SubscriptionSourceError } from "../Subscription-BEP8oQO5.mjs";
|
|
4
|
+
import { t as EventSource } from "../EventSource-OqS_P9ug.mjs";
|
|
5
|
+
import { SubscriptionFailure, SubscriptionIntake } from "./Subscriptions.mjs";
|
|
6
|
+
import { Context, Effect, Layer, Redacted, Schema } from "effect";
|
|
7
|
+
import { HttpClient } from "effect/unstable/http";
|
|
8
|
+
//#region src/durable/GitHubWorkflowSource.d.ts
|
|
9
|
+
/** One repository whose identity and credentials are selected by the host. */
|
|
10
|
+
declare const GitHubRepository: Schema.Struct<{
|
|
11
|
+
readonly id: Schema.Int;
|
|
12
|
+
readonly owner: Schema.NonEmptyString;
|
|
13
|
+
readonly name: Schema.NonEmptyString;
|
|
14
|
+
}>;
|
|
15
|
+
type GitHubRepository = typeof GitHubRepository.Type;
|
|
16
|
+
/** Exact workflow attempt requested by an Agent through a host-permitted source. */
|
|
17
|
+
declare const GitHubWorkflowRunWatch: Schema.Struct<{
|
|
18
|
+
readonly runId: Schema.Int;
|
|
19
|
+
readonly attempt: Schema.Int;
|
|
20
|
+
readonly expectedHeadSha: Schema.String;
|
|
21
|
+
}>;
|
|
22
|
+
type GitHubWorkflowRunWatch = typeof GitHubWorkflowRunWatch.Type;
|
|
23
|
+
/**
|
|
24
|
+
* Small canonical completion shared by webhook intake and REST reconciliation. Provider delivery
|
|
25
|
+
* IDs, URLs, actors, and mutable metadata are deliberately omitted from durable event identity.
|
|
26
|
+
*/
|
|
27
|
+
declare const GitHubWorkflowRunCompletion: Schema.Struct<{
|
|
28
|
+
readonly repositoryId: Schema.Int;
|
|
29
|
+
readonly runId: Schema.Int;
|
|
30
|
+
readonly attempt: Schema.Int;
|
|
31
|
+
readonly headSha: Schema.String;
|
|
32
|
+
readonly conclusion: Schema.NonEmptyString;
|
|
33
|
+
}>;
|
|
34
|
+
type GitHubWorkflowRunCompletion = typeof GitHubWorkflowRunCompletion.Type;
|
|
35
|
+
declare const GitHubWorkflowRunWebhook: Schema.Struct<{
|
|
36
|
+
readonly action: Schema.Literal<"completed">;
|
|
37
|
+
readonly repository: Schema.Struct<{
|
|
38
|
+
readonly id: Schema.Int;
|
|
39
|
+
}>;
|
|
40
|
+
readonly workflow_run: Schema.Struct<{
|
|
41
|
+
readonly id: Schema.Int;
|
|
42
|
+
readonly run_attempt: Schema.Int;
|
|
43
|
+
readonly head_sha: Schema.String;
|
|
44
|
+
readonly status: Schema.NonEmptyString;
|
|
45
|
+
readonly conclusion: Schema.NullOr<Schema.NonEmptyString>;
|
|
46
|
+
readonly repository: Schema.Struct<{
|
|
47
|
+
readonly id: Schema.Int;
|
|
48
|
+
}>;
|
|
49
|
+
}>;
|
|
50
|
+
}>;
|
|
51
|
+
type GitHubWorkflowRunWebhook = typeof GitHubWorkflowRunWebhook.Type;
|
|
52
|
+
declare const GitHubWorkflowRunAttempt: Schema.Struct<{
|
|
53
|
+
readonly id: Schema.Int;
|
|
54
|
+
readonly run_attempt: Schema.Int;
|
|
55
|
+
readonly head_sha: Schema.String;
|
|
56
|
+
readonly status: Schema.NonEmptyString;
|
|
57
|
+
readonly conclusion: Schema.NullOr<Schema.NonEmptyString>;
|
|
58
|
+
readonly repository: Schema.Struct<{
|
|
59
|
+
readonly id: Schema.Int;
|
|
60
|
+
}>;
|
|
61
|
+
}>;
|
|
62
|
+
type GitHubWorkflowRunAttempt = typeof GitHubWorkflowRunAttempt.Type;
|
|
63
|
+
declare const GitHubWorkflowRunSourceVersion: {
|
|
64
|
+
readonly name: "github-workflow-run-completed";
|
|
65
|
+
readonly version: "1";
|
|
66
|
+
};
|
|
67
|
+
declare const GitHubWorkflowRunsError_base: Schema.Class<GitHubWorkflowRunsError, Schema.TaggedStruct<"GitHubWorkflowRunsError", {
|
|
68
|
+
readonly reason: Schema.Literals<readonly ["rate-limited", "unavailable", "unauthorized", "not-found", "invalid-response"]>;
|
|
69
|
+
readonly retryable: Schema.Boolean;
|
|
70
|
+
}>, import("effect/Cause").YieldableError>;
|
|
71
|
+
declare class GitHubWorkflowRunsError extends GitHubWorkflowRunsError_base {}
|
|
72
|
+
interface GitHubWorkflowRunAttemptRequest {
|
|
73
|
+
readonly repository: GitHubRepository;
|
|
74
|
+
readonly runId: number;
|
|
75
|
+
readonly attempt: number;
|
|
76
|
+
}
|
|
77
|
+
declare const GitHubWorkflowRuns_base: Context.ServiceClass<GitHubWorkflowRuns, "@effect-agent/thread/GitHubWorkflowRuns", {
|
|
78
|
+
readonly getAttempt: (request: GitHubWorkflowRunAttemptRequest) => Effect.Effect<GitHubWorkflowRunAttempt, GitHubWorkflowRunsError>;
|
|
79
|
+
}>;
|
|
80
|
+
/**
|
|
81
|
+
* Credentialed, read-only GitHub boundary. Implementations must authorize the repository and read
|
|
82
|
+
* the exact attempt endpoint; the source never receives or persists a credential.
|
|
83
|
+
*/
|
|
84
|
+
declare class GitHubWorkflowRuns extends GitHubWorkflowRuns_base {}
|
|
85
|
+
interface GitHubWorkflowRunsHttpOptions {
|
|
86
|
+
/** Repository this credentialed adapter is authorized to read. */
|
|
87
|
+
readonly repository: GitHubRepository;
|
|
88
|
+
readonly token: Redacted.Redacted<string>;
|
|
89
|
+
readonly apiUrl?: string | undefined;
|
|
90
|
+
readonly userAgent?: string | undefined;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* GitHub REST adapter for `GET /repos/{owner}/{repo}/actions/runs/{run_id}/attempts/{attempt}`.
|
|
94
|
+
* It performs one bounded read. Scheduling retries and backoff remain owned by SubscriptionDriver.
|
|
95
|
+
*/
|
|
96
|
+
declare const githubWorkflowRunsHttpLayer: (options: GitHubWorkflowRunsHttpOptions) => Layer.Layer<GitHubWorkflowRuns, GitHubWorkflowRunsError, HttpClient.HttpClient>;
|
|
97
|
+
interface GitHubWorkflowRunSourceOptions {
|
|
98
|
+
readonly repository: GitHubRepository;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Build the exact-attempt completion source, shared by all destination Agents in this partition.
|
|
102
|
+
* Reconciliation depends on GitHub retaining a readable exact attempt.
|
|
103
|
+
*/
|
|
104
|
+
declare const makeGitHubWorkflowRunSource: (options: GitHubWorkflowRunSourceOptions) => Effect.Effect<EventSource, SubscriptionSourceError, GitHubWorkflowRuns>;
|
|
105
|
+
declare const GitHubWebhookVerificationError_base: Schema.Class<GitHubWebhookVerificationError, Schema.TaggedStruct<"GitHubWebhookVerificationError", {
|
|
106
|
+
readonly reason: Schema.Literals<readonly ["invalid-signature", "invalid-event", "invalid-payload", "payload-too-large", "crypto-unavailable"]>;
|
|
107
|
+
}>, import("effect/Cause").YieldableError>;
|
|
108
|
+
declare class GitHubWebhookVerificationError extends GitHubWebhookVerificationError_base {}
|
|
109
|
+
declare const GitHubWebhookSignatureVerifier_base: Context.ServiceClass<GitHubWebhookSignatureVerifier, "@effect-agent/thread/GitHubWebhookSignatureVerifier", {
|
|
110
|
+
readonly verify: (body: Uint8Array, signature: string) => Effect.Effect<void, GitHubWebhookVerificationError>;
|
|
111
|
+
}>;
|
|
112
|
+
/** Host-held webhook secret verification; callers cannot bypass it by supplying parsed JSON. */
|
|
113
|
+
declare class GitHubWebhookSignatureVerifier extends GitHubWebhookSignatureVerifier_base {}
|
|
114
|
+
/** Narrow host WebCrypto capability used for GitHub HMAC-SHA256 verification. */
|
|
115
|
+
interface GitHubWebhookSubtleCrypto<Key> {
|
|
116
|
+
readonly importKey: (format: "raw", keyData: ArrayBuffer, algorithm: {
|
|
117
|
+
readonly name: "HMAC";
|
|
118
|
+
readonly hash: "SHA-256";
|
|
119
|
+
}, extractable: false, usages: ["verify"]) => PromiseLike<Key>;
|
|
120
|
+
readonly verify: (algorithm: "HMAC", key: Key, signature: ArrayBuffer, data: ArrayBuffer) => PromiseLike<boolean>;
|
|
121
|
+
}
|
|
122
|
+
/** GitHub-compatible HMAC-SHA256 verifier over the exact raw request bytes. */
|
|
123
|
+
declare const webCryptoGitHubWebhookSignatureVerifierLayer: <Key>(secret: Redacted.Redacted<string>, subtle: GitHubWebhookSubtleCrypto<Key>) => Layer.Layer<GitHubWebhookSignatureVerifier>;
|
|
124
|
+
interface VerifiedGitHubWorkflowRunWebhookRequest {
|
|
125
|
+
readonly body: Uint8Array;
|
|
126
|
+
readonly eventHeader: string | undefined;
|
|
127
|
+
readonly signatureHeader: string | undefined;
|
|
128
|
+
readonly principal: Principal;
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Verify raw ingress, decode only a completed `workflow_run`, and hand its canonical completion to
|
|
132
|
+
* durable intake. The acknowledgement means routing work is retained; it is not a Submission Receipt.
|
|
133
|
+
*/
|
|
134
|
+
declare const acceptVerifiedGitHubWorkflowRunWebhook: (request: VerifiedGitHubWorkflowRunWebhookRequest) => Effect.Effect<{
|
|
135
|
+
readonly partition: {
|
|
136
|
+
readonly tenantId: string;
|
|
137
|
+
readonly address: string;
|
|
138
|
+
};
|
|
139
|
+
readonly eventId: string;
|
|
140
|
+
readonly acceptedAtMillis: number;
|
|
141
|
+
}, GitHubWebhookVerificationError | SubscriptionFailure, GitHubWebhookSignatureVerifier | SubscriptionIntake>;
|
|
142
|
+
//#endregion
|
|
143
|
+
export { GitHubRepository, GitHubWebhookSignatureVerifier, GitHubWebhookSubtleCrypto, GitHubWebhookVerificationError, GitHubWorkflowRunAttempt, GitHubWorkflowRunAttemptRequest, GitHubWorkflowRunCompletion, GitHubWorkflowRunSourceOptions, GitHubWorkflowRunSourceVersion, GitHubWorkflowRunWatch, GitHubWorkflowRunWebhook, GitHubWorkflowRuns, GitHubWorkflowRunsError, GitHubWorkflowRunsHttpOptions, VerifiedGitHubWorkflowRunWebhookRequest, acceptVerifiedGitHubWorkflowRunWebhook, githubWorkflowRunsHttpLayer, makeGitHubWorkflowRunSource, webCryptoGitHubWebhookSignatureVerifierLayer };
|
|
144
|
+
//# sourceMappingURL=GitHubWorkflowSource.d.mts.map
|