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,126 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { n as utf8ByteLength } from "../utf8-DchGZRBd.mjs";
|
|
3
|
+
import { MemoryLookup, MemoryPassage, MemoryRecallError, MemoryRecallLimits } from "./MemoryReference.mjs";
|
|
4
|
+
import { MemoryDocument, MemoryKey, MemoryReader, MemoryScope, MemoryStorageError } from "./MemoryStore.mjs";
|
|
5
|
+
import { Effect, Schema } from "effect";
|
|
6
|
+
//#region src/core/MemoryRevalidation.ts
|
|
7
|
+
var MemoryRevalidation_exports = /* @__PURE__ */ __exportAll({
|
|
8
|
+
MemoryAccess: () => MemoryAccess,
|
|
9
|
+
revalidateMemoryLookup: () => revalidateMemoryLookup
|
|
10
|
+
});
|
|
11
|
+
const RevalidationLimits = Schema.Struct({
|
|
12
|
+
maxInputBytes: MemoryRecallLimits.fields.maxInputBytes,
|
|
13
|
+
maxSourceBytes: MemoryRecallLimits.fields.maxInputBytes
|
|
14
|
+
});
|
|
15
|
+
/** Bind these values in host code. Neither is a model-selectable retrieval parameter. */
|
|
16
|
+
var MemoryAccessWire = class extends Schema.Class("@effect-agent/capabilities/MemoryAccess")({
|
|
17
|
+
namespace: MemoryKey.Wire.fields.namespace,
|
|
18
|
+
scope: MemoryScope
|
|
19
|
+
}) {};
|
|
20
|
+
const MemoryAccess = {
|
|
21
|
+
Wire: MemoryAccessWire,
|
|
22
|
+
make: (fields) => Object.assign(Schema.decodeUnknownSync(MemoryAccessWire)(fields), { namespace: fields.namespace })
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Resolve derivative candidates against the current authoritative source and host-bound access.
|
|
26
|
+
* The reader needs no write capability. A same-revision excerpt is kept only if its exact text
|
|
27
|
+
* occurs in the current source; all attribution and metadata come from that source. Otherwise
|
|
28
|
+
* the whole current document replaces it. Aggregate output JSON is bounded before retention,
|
|
29
|
+
* including duplicates, by maxInputBytes, defaulting to 16 MiB with a 64 MiB maximum.
|
|
30
|
+
* maxSourceBytes optionally bounds aggregate encoded authoritative documents, once per source.
|
|
31
|
+
* One authoritative document is decoded at a time; reader-side allocations precede these bounds.
|
|
32
|
+
*
|
|
33
|
+
* There is no cache. One invocation reads each distinct source once. Checks begun after a
|
|
34
|
+
* successful withdrawal or access revocation exclude that source; an in-flight snapshot can
|
|
35
|
+
* finish, including its same-Turn overflow retry. Original history and prior outputs remain.
|
|
36
|
+
*/
|
|
37
|
+
const revalidateMemoryLookup = Effect.fn("revalidateMemoryLookup")(function* (lookup, access, limits = {}) {
|
|
38
|
+
const decodedLimits = yield* Schema.decodeEffect(RevalidationLimits)(limits).pipe(Effect.mapError(() => MemoryRecallError.make({
|
|
39
|
+
reason: "invalid-input",
|
|
40
|
+
message: "Invalid revalidation limits"
|
|
41
|
+
})));
|
|
42
|
+
const decodedAccess = yield* Schema.decodeEffect(MemoryAccess.Wire)(access).pipe(Effect.mapError(() => MemoryRecallError.make({
|
|
43
|
+
reason: "invalid-input",
|
|
44
|
+
message: "Invalid host memory access"
|
|
45
|
+
})));
|
|
46
|
+
const decoded = yield* Schema.decodeEffect(MemoryLookup)(lookup).pipe(Effect.mapError(() => MemoryRecallError.make({
|
|
47
|
+
reason: "invalid-input",
|
|
48
|
+
message: "Malformed memory candidates"
|
|
49
|
+
})));
|
|
50
|
+
if (decoded._tag !== "Found") return decoded;
|
|
51
|
+
const reader = yield* MemoryReader;
|
|
52
|
+
const groups = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const [index, candidate] of decoded.passages.entries()) {
|
|
54
|
+
const group = groups.get(candidate.source.id);
|
|
55
|
+
if (group === void 0) groups.set(candidate.source.id, [{
|
|
56
|
+
candidate,
|
|
57
|
+
index
|
|
58
|
+
}]);
|
|
59
|
+
else group.push({
|
|
60
|
+
candidate,
|
|
61
|
+
index
|
|
62
|
+
});
|
|
63
|
+
}
|
|
64
|
+
const passages = [];
|
|
65
|
+
const maxInputBytes = decodedLimits.maxInputBytes ?? 16777216;
|
|
66
|
+
let inputBytes = 0;
|
|
67
|
+
let sourceBytes = 0;
|
|
68
|
+
for (const [sourceId, group] of groups) {
|
|
69
|
+
yield* Effect.yieldNow;
|
|
70
|
+
const key = MemoryKey.make({
|
|
71
|
+
namespace: decodedAccess.namespace,
|
|
72
|
+
id: sourceId
|
|
73
|
+
});
|
|
74
|
+
const document = yield* reader.get(key).pipe(Effect.flatMap((value) => Schema.decodeEffect(Schema.NullOr(MemoryDocument.Wire))(value).pipe(Effect.mapError(() => MemoryStorageError.make({
|
|
75
|
+
operation: "validate source view",
|
|
76
|
+
reason: "corrupt"
|
|
77
|
+
})))));
|
|
78
|
+
if (document !== null && (document.key.namespace.address !== key.namespace.address || document.key.id !== key.id || document.source.id !== key.id)) return yield* MemoryStorageError.make({
|
|
79
|
+
operation: "validate source identity",
|
|
80
|
+
reason: "corrupt"
|
|
81
|
+
});
|
|
82
|
+
if (document === null || document._tag === "WithdrawnMemoryDocument" || !document.scopes.includes(decodedAccess.scope)) continue;
|
|
83
|
+
if (decodedLimits.maxSourceBytes !== void 0) {
|
|
84
|
+
sourceBytes += utf8ByteLength(JSON.stringify(document));
|
|
85
|
+
if (sourceBytes > decodedLimits.maxSourceBytes) return yield* MemoryRecallError.make({
|
|
86
|
+
reason: "budget",
|
|
87
|
+
sourceId,
|
|
88
|
+
message: "Authoritative memory source byte budget exceeded"
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
for (const { candidate, index } of group) {
|
|
92
|
+
const sameExcerpt = document.source.revision === candidate.source.revision && document.content.text.includes(candidate.content.text);
|
|
93
|
+
const passage = MemoryPassage.make({
|
|
94
|
+
version: 1,
|
|
95
|
+
authority: decodedAccess.namespace.address,
|
|
96
|
+
source: document.source,
|
|
97
|
+
passageId: sameExcerpt ? candidate.passageId : "document",
|
|
98
|
+
content: {
|
|
99
|
+
...document.content,
|
|
100
|
+
text: sameExcerpt ? candidate.content.text : document.content.text
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const encoded = JSON.stringify(passage);
|
|
104
|
+
const remaining = maxInputBytes - inputBytes;
|
|
105
|
+
const encodedBytes = encoded.length <= remaining ? utf8ByteLength(encoded) : void 0;
|
|
106
|
+
if (encodedBytes === void 0 || encodedBytes > remaining) return yield* MemoryRecallError.make({
|
|
107
|
+
reason: "budget",
|
|
108
|
+
sourceId,
|
|
109
|
+
message: "Revalidated memory input encoding budget exceeded"
|
|
110
|
+
});
|
|
111
|
+
inputBytes += encodedBytes;
|
|
112
|
+
passages.push({
|
|
113
|
+
passage,
|
|
114
|
+
index
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return passages.length === 0 ? { _tag: "NoMatch" } : {
|
|
119
|
+
_tag: "Found",
|
|
120
|
+
passages: passages.sort((left, right) => left.index - right.index).map(({ passage }) => passage)
|
|
121
|
+
};
|
|
122
|
+
});
|
|
123
|
+
//#endregion
|
|
124
|
+
export { MemoryAccess, revalidateMemoryLookup, MemoryRevalidation_exports as t };
|
|
125
|
+
|
|
126
|
+
//# sourceMappingURL=MemoryRevalidation.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryRevalidation.mjs","names":[],"sources":["../../src/core/MemoryRevalidation.ts"],"sourcesContent":["import { Effect, Schema } from \"effect\";\n\nimport { utf8ByteLength } from \"./internal/utf8.ts\";\nimport type * as MemoryNamespace from \"./MemoryNamespace.ts\";\nimport {\n MemoryLookup,\n MemoryPassage,\n MemoryRecallError,\n MemoryRecallLimits,\n} from \"./MemoryReference.ts\";\nimport {\n MemoryDocument,\n MemoryKey,\n MemoryReader,\n MemoryScope,\n MemoryStorageError,\n} from \"./MemoryStore.ts\";\n\nconst RevalidationLimits = Schema.Struct({\n maxInputBytes: MemoryRecallLimits.fields.maxInputBytes,\n maxSourceBytes: MemoryRecallLimits.fields.maxInputBytes,\n});\n\n/** Bind these values in host code. Neither is a model-selectable retrieval parameter. */\nclass MemoryAccessWire extends Schema.Class<MemoryAccessWire>(\n \"@effect-agent/capabilities/MemoryAccess\",\n)({\n namespace: MemoryKey.Wire.fields.namespace,\n scope: MemoryScope,\n}) {}\n\nexport type MemoryAccess<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> = Omit<\n MemoryAccessWire,\n \"namespace\"\n> & { readonly namespace: Namespace };\n\nexport const MemoryAccess = {\n Wire: MemoryAccessWire,\n make: <Namespace extends MemoryNamespace.Any>(\n fields: MemoryAccess<Namespace>,\n ): MemoryAccess<Namespace> =>\n Object.assign(Schema.decodeUnknownSync(MemoryAccessWire)(fields), {\n namespace: fields.namespace,\n }),\n};\n\n/**\n * Resolve derivative candidates against the current authoritative source and host-bound access.\n * The reader needs no write capability. A same-revision excerpt is kept only if its exact text\n * occurs in the current source; all attribution and metadata come from that source. Otherwise\n * the whole current document replaces it. Aggregate output JSON is bounded before retention,\n * including duplicates, by maxInputBytes, defaulting to 16 MiB with a 64 MiB maximum.\n * maxSourceBytes optionally bounds aggregate encoded authoritative documents, once per source.\n * One authoritative document is decoded at a time; reader-side allocations precede these bounds.\n *\n * There is no cache. One invocation reads each distinct source once. Checks begun after a\n * successful withdrawal or access revocation exclude that source; an in-flight snapshot can\n * finish, including its same-Turn overflow retry. Original history and prior outputs remain.\n */\nexport const revalidateMemoryLookup = Effect.fn(\"revalidateMemoryLookup\")(function* (\n lookup: MemoryLookup,\n access: MemoryAccess,\n limits: Pick<MemoryRecallLimits, \"maxInputBytes\"> & { readonly maxSourceBytes?: number } = {},\n) {\n const decodedLimits = yield* Schema.decodeEffect(RevalidationLimits)(limits).pipe(\n Effect.mapError(() =>\n MemoryRecallError.make({ reason: \"invalid-input\", message: \"Invalid revalidation limits\" }),\n ),\n );\n\n const decodedAccess = yield* Schema.decodeEffect(MemoryAccess.Wire)(access).pipe(\n Effect.mapError(() =>\n MemoryRecallError.make({ reason: \"invalid-input\", message: \"Invalid host memory access\" }),\n ),\n );\n\n const decoded = yield* Schema.decodeEffect(MemoryLookup)(lookup).pipe(\n Effect.mapError(() =>\n MemoryRecallError.make({ reason: \"invalid-input\", message: \"Malformed memory candidates\" }),\n ),\n );\n\n if (decoded._tag !== \"Found\") return decoded;\n const reader = yield* MemoryReader;\n\n const groups = new Map<\n string,\n Array<{ readonly candidate: MemoryPassage; readonly index: number }>\n >();\n\n for (const [index, candidate] of decoded.passages.entries()) {\n const group = groups.get(candidate.source.id);\n\n if (group === undefined) groups.set(candidate.source.id, [{ candidate, index }]);\n else group.push({ candidate, index });\n }\n const passages: Array<{ readonly passage: MemoryPassage; readonly index: number }> = [];\n const maxInputBytes = decodedLimits.maxInputBytes ?? 16_777_216;\n let inputBytes = 0;\n let sourceBytes = 0;\n\n for (const [sourceId, group] of groups) {\n yield* Effect.yieldNow;\n const key = MemoryKey.make({ namespace: decodedAccess.namespace, id: sourceId });\n\n const document = yield* reader\n .get(key)\n .pipe(\n Effect.flatMap((value) =>\n Schema.decodeEffect(Schema.NullOr(MemoryDocument.Wire))(value).pipe(\n Effect.mapError(() =>\n MemoryStorageError.make({ operation: \"validate source view\", reason: \"corrupt\" }),\n ),\n ),\n ),\n );\n\n if (\n document !== null &&\n (document.key.namespace.address !== key.namespace.address ||\n document.key.id !== key.id ||\n document.source.id !== key.id)\n ) {\n return yield* MemoryStorageError.make({\n operation: \"validate source identity\",\n reason: \"corrupt\",\n });\n }\n if (\n document === null ||\n document._tag === \"WithdrawnMemoryDocument\" ||\n !document.scopes.includes(decodedAccess.scope)\n )\n continue;\n if (decodedLimits.maxSourceBytes !== undefined) {\n sourceBytes += utf8ByteLength(JSON.stringify(document));\n if (sourceBytes > decodedLimits.maxSourceBytes)\n return yield* MemoryRecallError.make({\n reason: \"budget\",\n sourceId,\n message: \"Authoritative memory source byte budget exceeded\",\n });\n }\n for (const { candidate, index } of group) {\n const sameExcerpt =\n document.source.revision === candidate.source.revision &&\n document.content.text.includes(candidate.content.text);\n\n const passage = MemoryPassage.make({\n version: 1,\n authority: decodedAccess.namespace.address,\n source: document.source,\n passageId: sameExcerpt ? candidate.passageId : \"document\",\n content: {\n ...document.content,\n text: sameExcerpt ? candidate.content.text : document.content.text,\n },\n });\n\n const encoded = JSON.stringify(passage);\n const remaining = maxInputBytes - inputBytes;\n\n const encodedBytes = encoded.length <= remaining ? utf8ByteLength(encoded) : undefined;\n\n if (encodedBytes === undefined || encodedBytes > remaining) {\n return yield* MemoryRecallError.make({\n reason: \"budget\",\n sourceId,\n message: \"Revalidated memory input encoding budget exceeded\",\n });\n }\n inputBytes += encodedBytes;\n passages.push({ passage, index });\n }\n }\n\n return passages.length === 0\n ? { _tag: \"NoMatch\" as const }\n : {\n _tag: \"Found\" as const,\n passages: passages\n .sort((left, right) => left.index - right.index)\n .map(({ passage }) => passage),\n };\n});\n"],"mappings":"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"}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import { l as MemorySourceReference, n as MemoryContent } from "../MemoryReference-B8Q3UJoJ.mjs";
|
|
2
|
+
import { t as Any } from "../MemoryNamespace-BbRW5p71.mjs";
|
|
3
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
4
|
+
declare namespace MemoryStore_d_exports {
|
|
5
|
+
export { ActiveMemoryDocument, MemoryConflict, MemoryDocument, MemoryKey, MemoryMutationFailpoint, MemoryMutationFailure, MemoryMutationPoint, MemoryOperationConflict, MemoryReader, MemoryScope, MemoryStorageError, MemoryWithdrawn, MemoryWrite, MemoryWriteError, MemoryWriter, WithdrawnMemoryDocument, applyMemoryWrite };
|
|
6
|
+
}
|
|
7
|
+
/** Host-defined recall visibility label. A scope identifies access policy; it does not grant it. */
|
|
8
|
+
declare const MemoryScope: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/MemoryScope">;
|
|
9
|
+
type MemoryScope = typeof MemoryScope.Type;
|
|
10
|
+
declare const MemoryKeyWire_base: Schema.Class<MemoryKeyWire, Schema.Struct<{
|
|
11
|
+
readonly namespace: Schema.Struct<{
|
|
12
|
+
readonly address: Schema.brand<Schema.String, "@effect-agent/core/MemoryNamespaceAddress">;
|
|
13
|
+
}>;
|
|
14
|
+
readonly id: Schema.NonEmptyString;
|
|
15
|
+
}>, {}>;
|
|
16
|
+
/** A host-selected namespace prevents accidental cross-tenant document lookup. */
|
|
17
|
+
declare class MemoryKeyWire extends MemoryKeyWire_base {}
|
|
18
|
+
type MemoryKey<Namespace extends Any = Any> = Omit<MemoryKeyWire, "namespace"> & {
|
|
19
|
+
readonly namespace: Namespace;
|
|
20
|
+
};
|
|
21
|
+
declare const MemoryKey: {
|
|
22
|
+
Wire: typeof MemoryKeyWire;
|
|
23
|
+
make: <Namespace extends Any>(fields: MemoryKey<Namespace>) => MemoryKey<Namespace>;
|
|
24
|
+
};
|
|
25
|
+
declare const ActiveMemoryDocumentWire_base: Schema.Class<ActiveMemoryDocumentWire, Schema.TaggedStruct<"ActiveMemoryDocument", {
|
|
26
|
+
readonly version: Schema.Literal<1>;
|
|
27
|
+
readonly key: typeof MemoryKeyWire;
|
|
28
|
+
readonly source: Schema.Struct<{
|
|
29
|
+
readonly id: Schema.NonEmptyString;
|
|
30
|
+
readonly locator: Schema.NonEmptyString;
|
|
31
|
+
readonly revision: Schema.NonEmptyString;
|
|
32
|
+
}>;
|
|
33
|
+
readonly generation: Schema.Int;
|
|
34
|
+
readonly predecessor: Schema.NullOr<typeof MemorySourceReference>;
|
|
35
|
+
readonly modifiedAt: Schema.Finite;
|
|
36
|
+
readonly content: typeof MemoryContent;
|
|
37
|
+
/** Explicit application-defined scope names. Empty grants no recall access. */
|
|
38
|
+
readonly scopes: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/MemoryScope">>;
|
|
39
|
+
}>, {}>;
|
|
40
|
+
declare class ActiveMemoryDocumentWire extends ActiveMemoryDocumentWire_base {}
|
|
41
|
+
declare const WithdrawnMemoryDocumentWire_base: Schema.Class<WithdrawnMemoryDocumentWire, Schema.TaggedStruct<"WithdrawnMemoryDocument", {
|
|
42
|
+
readonly version: Schema.Literal<1>;
|
|
43
|
+
readonly key: typeof MemoryKeyWire;
|
|
44
|
+
readonly source: Schema.Struct<{
|
|
45
|
+
readonly id: Schema.NonEmptyString;
|
|
46
|
+
readonly locator: Schema.NonEmptyString;
|
|
47
|
+
readonly revision: Schema.NonEmptyString;
|
|
48
|
+
}>;
|
|
49
|
+
readonly generation: Schema.Int;
|
|
50
|
+
readonly predecessor: Schema.NullOr<typeof MemorySourceReference>;
|
|
51
|
+
readonly modifiedAt: Schema.Finite;
|
|
52
|
+
readonly reason: Schema.String;
|
|
53
|
+
}>, {}>;
|
|
54
|
+
/** Terminal tombstone. Reusing its ID cannot restore the source through delayed work. */
|
|
55
|
+
declare class WithdrawnMemoryDocumentWire extends WithdrawnMemoryDocumentWire_base {}
|
|
56
|
+
type ActiveMemoryDocument<Namespace extends Any = Any> = Omit<ActiveMemoryDocumentWire, "key"> & {
|
|
57
|
+
readonly key: MemoryKey<Namespace>;
|
|
58
|
+
};
|
|
59
|
+
declare const ActiveMemoryDocument: {
|
|
60
|
+
Wire: typeof ActiveMemoryDocumentWire;
|
|
61
|
+
make: <Namespace extends Any>(fields: Omit<ActiveMemoryDocument<Namespace>, "_tag"> & {
|
|
62
|
+
readonly _tag?: "ActiveMemoryDocument";
|
|
63
|
+
}) => ActiveMemoryDocument<Namespace>;
|
|
64
|
+
};
|
|
65
|
+
type WithdrawnMemoryDocument<Namespace extends Any = Any> = Omit<WithdrawnMemoryDocumentWire, "key"> & {
|
|
66
|
+
readonly key: MemoryKey<Namespace>;
|
|
67
|
+
};
|
|
68
|
+
declare const WithdrawnMemoryDocument: {
|
|
69
|
+
Wire: typeof WithdrawnMemoryDocumentWire;
|
|
70
|
+
make: <Namespace extends Any>(fields: Omit<WithdrawnMemoryDocument<Namespace>, "_tag"> & {
|
|
71
|
+
readonly _tag?: "WithdrawnMemoryDocument";
|
|
72
|
+
}) => WithdrawnMemoryDocument<Namespace>;
|
|
73
|
+
};
|
|
74
|
+
type MemoryDocument<Namespace extends Any = Any> = ActiveMemoryDocument<Namespace> | WithdrawnMemoryDocument<Namespace>;
|
|
75
|
+
declare const MemoryDocument: {
|
|
76
|
+
Wire: Schema.Union<readonly [typeof ActiveMemoryDocumentWire, typeof WithdrawnMemoryDocumentWire]>;
|
|
77
|
+
restore: <Namespace extends Any>(namespace: Namespace, input: unknown) => Effect.Effect<MemoryDocument<Namespace>, MemoryStorageError, never>;
|
|
78
|
+
};
|
|
79
|
+
declare const MemoryWriteWire: Schema.Union<readonly [Schema.TaggedStruct<"Put", {
|
|
80
|
+
readonly key: typeof MemoryKeyWire;
|
|
81
|
+
readonly operationId: Schema.NonEmptyString;
|
|
82
|
+
readonly expectedRevision: Schema.NullOr<Schema.NonEmptyString>;
|
|
83
|
+
readonly locator: Schema.NonEmptyString;
|
|
84
|
+
readonly content: typeof MemoryContent;
|
|
85
|
+
readonly scopes: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/MemoryScope">>;
|
|
86
|
+
}>, Schema.TaggedStruct<"Withdraw", {
|
|
87
|
+
readonly key: typeof MemoryKeyWire;
|
|
88
|
+
readonly operationId: Schema.NonEmptyString;
|
|
89
|
+
readonly expectedRevision: Schema.NonEmptyString;
|
|
90
|
+
readonly reason: Schema.String;
|
|
91
|
+
}>]>;
|
|
92
|
+
type MemoryWrite<Namespace extends Any = Any> = (Omit<(typeof MemoryWriteWire.members)[0]["Type"], "key"> | Omit<(typeof MemoryWriteWire.members)[1]["Type"], "key">) & {
|
|
93
|
+
readonly key: MemoryKey<Namespace>;
|
|
94
|
+
};
|
|
95
|
+
declare const MemoryWrite: {
|
|
96
|
+
Wire: Schema.Union<readonly [Schema.TaggedStruct<"Put", {
|
|
97
|
+
readonly key: typeof MemoryKeyWire;
|
|
98
|
+
readonly operationId: Schema.NonEmptyString;
|
|
99
|
+
readonly expectedRevision: Schema.NullOr<Schema.NonEmptyString>;
|
|
100
|
+
readonly locator: Schema.NonEmptyString;
|
|
101
|
+
readonly content: typeof MemoryContent;
|
|
102
|
+
readonly scopes: Schema.$Array<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/MemoryScope">>;
|
|
103
|
+
}>, Schema.TaggedStruct<"Withdraw", {
|
|
104
|
+
readonly key: typeof MemoryKeyWire;
|
|
105
|
+
readonly operationId: Schema.NonEmptyString;
|
|
106
|
+
readonly expectedRevision: Schema.NonEmptyString;
|
|
107
|
+
readonly reason: Schema.String;
|
|
108
|
+
}>]>;
|
|
109
|
+
make: <Namespace extends Any>(fields: MemoryWrite<Namespace>) => MemoryWrite<Namespace>;
|
|
110
|
+
};
|
|
111
|
+
declare const MemoryConflict_base: Schema.Class<MemoryConflict, Schema.TaggedStruct<"MemoryConflict", {
|
|
112
|
+
readonly key: typeof MemoryKeyWire;
|
|
113
|
+
readonly expectedRevision: Schema.NullOr<Schema.NonEmptyString>;
|
|
114
|
+
readonly actualRevision: Schema.NullOr<Schema.NonEmptyString>;
|
|
115
|
+
}>, import("effect/Cause").YieldableError>;
|
|
116
|
+
declare class MemoryConflict extends MemoryConflict_base {}
|
|
117
|
+
declare const MemoryWithdrawn_base: Schema.Class<MemoryWithdrawn, Schema.TaggedStruct<"MemoryWithdrawn", {
|
|
118
|
+
readonly key: typeof MemoryKeyWire;
|
|
119
|
+
readonly revision: Schema.NonEmptyString;
|
|
120
|
+
}>, import("effect/Cause").YieldableError>;
|
|
121
|
+
declare class MemoryWithdrawn extends MemoryWithdrawn_base {}
|
|
122
|
+
declare const MemoryOperationConflict_base: Schema.Class<MemoryOperationConflict, Schema.TaggedStruct<"MemoryOperationConflict", {
|
|
123
|
+
readonly key: typeof MemoryKeyWire;
|
|
124
|
+
readonly operationId: Schema.NonEmptyString;
|
|
125
|
+
}>, import("effect/Cause").YieldableError>;
|
|
126
|
+
declare class MemoryOperationConflict extends MemoryOperationConflict_base {}
|
|
127
|
+
declare const MemoryStorageError_base: Schema.Class<MemoryStorageError, Schema.TaggedStruct<"MemoryStorageError", {
|
|
128
|
+
readonly operation: Schema.NonEmptyString;
|
|
129
|
+
readonly reason: Schema.Literals<readonly ["invalid-input", "unavailable", "corrupt", "incompatible"]>;
|
|
130
|
+
}>, import("effect/Cause").YieldableError>;
|
|
131
|
+
declare class MemoryStorageError extends MemoryStorageError_base {}
|
|
132
|
+
declare const MemoryMutationPoint: Schema.Literals<readonly ["memory:initialize:before", "memory:initialize:before-accounting", "memory:initialize:after-accounting", "memory:initialize:after", "memory:change:before", "memory:change:after-state", "memory:change:after-receipt", "memory:change:after"]>;
|
|
133
|
+
type MemoryMutationPoint = typeof MemoryMutationPoint.Type;
|
|
134
|
+
declare const MemoryMutationFailure_base: Schema.Class<MemoryMutationFailure, Schema.TaggedStruct<"MemoryMutationFailure", {
|
|
135
|
+
readonly point: Schema.Literals<readonly ["memory:initialize:before", "memory:initialize:before-accounting", "memory:initialize:after-accounting", "memory:initialize:after", "memory:change:before", "memory:change:after-state", "memory:change:after-receipt", "memory:change:after"]>;
|
|
136
|
+
}>, import("effect/Cause").YieldableError>;
|
|
137
|
+
declare class MemoryMutationFailure extends MemoryMutationFailure_base {}
|
|
138
|
+
declare const MemoryMutationFailpoint_base: Context.ServiceClass<MemoryMutationFailpoint, "@effect-agent/core/MemoryMutationFailpoint", {
|
|
139
|
+
readonly hit: (point: MemoryMutationPoint) => Effect.Effect<void, MemoryMutationFailure>;
|
|
140
|
+
}>;
|
|
141
|
+
/** Explicit fault-injection seam; production adapters install the no-op Layer. */
|
|
142
|
+
declare class MemoryMutationFailpoint extends MemoryMutationFailpoint_base {
|
|
143
|
+
static readonly layer: Layer.Layer<MemoryMutationFailpoint, never, never>;
|
|
144
|
+
}
|
|
145
|
+
type MemoryWriteError = MemoryStorageError | MemoryConflict | MemoryWithdrawn | MemoryOperationConflict | MemoryMutationFailure;
|
|
146
|
+
declare const MemoryReader_base: Context.ServiceClass<MemoryReader, "@effect-agent/core/MemoryReader", {
|
|
147
|
+
readonly get: <Namespace extends Any>(key: MemoryKey<Namespace>) => Effect.Effect<MemoryDocument<Namespace> | null, MemoryStorageError>;
|
|
148
|
+
}>;
|
|
149
|
+
/**
|
|
150
|
+
* Read capability independent of editing. A get begun after a committed write must observe
|
|
151
|
+
* that write or a later revision. An adapter unable to provide that view must fail typed.
|
|
152
|
+
* Host code binds namespace and access scope; cached candidates do not implement this port.
|
|
153
|
+
*/
|
|
154
|
+
declare class MemoryReader extends MemoryReader_base {
|
|
155
|
+
static fromAdapter(adapter: {
|
|
156
|
+
readonly get: (key: MemoryKey) => Effect.Effect<MemoryDocument | null, MemoryStorageError>;
|
|
157
|
+
}): MemoryReader["Service"];
|
|
158
|
+
}
|
|
159
|
+
declare const MemoryWriter_base: Context.ServiceClass<MemoryWriter, "@effect-agent/core/MemoryWriter", {
|
|
160
|
+
readonly change: <Namespace extends Any>(write: MemoryWrite<Namespace>) => Effect.Effect<MemoryDocument<Namespace>, MemoryWriteError>;
|
|
161
|
+
}>;
|
|
162
|
+
/**
|
|
163
|
+
* Optional conditional writer. Implement only where atomic expected-revision checks and
|
|
164
|
+
* durable idempotency receipts can be guaranteed. Apply authorization before calling it.
|
|
165
|
+
* Reconcile an existing operation receipt before evaluating tombstones or expected revisions:
|
|
166
|
+
* identical commands return the original result; changed commands fail MemoryOperationConflict.
|
|
167
|
+
* Original results include content, even for a historical Put replayed after withdrawal;
|
|
168
|
+
* replay does not change the current head. Revalidate a source before using recalled content.
|
|
169
|
+
* A failed acknowledgement can hide a committed change: retain and retry the exact command.
|
|
170
|
+
* Successful withdrawal excludes checks begun afterward; already captured views may finish.
|
|
171
|
+
* Receipts and original Thread history are separate retention concerns.
|
|
172
|
+
*/
|
|
173
|
+
declare class MemoryWriter extends MemoryWriter_base {
|
|
174
|
+
static fromAdapter(adapter: {
|
|
175
|
+
readonly change: (write: MemoryWrite) => Effect.Effect<MemoryDocument, MemoryWriteError>;
|
|
176
|
+
}): MemoryWriter["Service"];
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Transition mechanics for an authoritative document store. Revisions identify this readable
|
|
180
|
+
* source, not the original activity from which a consumer extracted it. The adapter reconciles
|
|
181
|
+
* receipts first and owns atomicity and the clock. Original evidence belongs in provenance.
|
|
182
|
+
*/
|
|
183
|
+
declare const applyMemoryWrite: <Namespace extends Any>(current: MemoryDocument<NoInfer<Namespace>> | null, write: MemoryWrite<Namespace>, modifiedAt: number) => Effect.Effect<MemoryDocument<Namespace>, MemoryConflict | MemoryStorageError | MemoryWithdrawn, never>;
|
|
184
|
+
//#endregion
|
|
185
|
+
export { ActiveMemoryDocument, MemoryConflict, MemoryDocument, MemoryKey, MemoryMutationFailpoint, MemoryMutationFailure, MemoryMutationPoint, MemoryOperationConflict, MemoryReader, MemoryScope, MemoryStorageError, MemoryWithdrawn, MemoryWrite, MemoryWriteError, MemoryWriter, WithdrawnMemoryDocument, applyMemoryWrite, MemoryStore_d_exports as t };
|
|
186
|
+
//# sourceMappingURL=MemoryStore.d.mts.map
|
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { MemoryContent, MemorySourceReference } from "./MemoryReference.mjs";
|
|
3
|
+
import { Any, equals } from "./MemoryNamespace.mjs";
|
|
4
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
+
//#region src/core/MemoryStore.ts
|
|
6
|
+
var MemoryStore_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
ActiveMemoryDocument: () => ActiveMemoryDocument,
|
|
8
|
+
MemoryConflict: () => MemoryConflict,
|
|
9
|
+
MemoryDocument: () => MemoryDocument,
|
|
10
|
+
MemoryKey: () => MemoryKey,
|
|
11
|
+
MemoryMutationFailpoint: () => MemoryMutationFailpoint,
|
|
12
|
+
MemoryMutationFailure: () => MemoryMutationFailure,
|
|
13
|
+
MemoryMutationPoint: () => MemoryMutationPoint,
|
|
14
|
+
MemoryOperationConflict: () => MemoryOperationConflict,
|
|
15
|
+
MemoryReader: () => MemoryReader,
|
|
16
|
+
MemoryScope: () => MemoryScope,
|
|
17
|
+
MemoryStorageError: () => MemoryStorageError,
|
|
18
|
+
MemoryWithdrawn: () => MemoryWithdrawn,
|
|
19
|
+
MemoryWrite: () => MemoryWrite,
|
|
20
|
+
MemoryWriter: () => MemoryWriter,
|
|
21
|
+
WithdrawnMemoryDocument: () => WithdrawnMemoryDocument,
|
|
22
|
+
applyMemoryWrite: () => applyMemoryWrite
|
|
23
|
+
});
|
|
24
|
+
const Identity = Schema.NonEmptyString.check(Schema.isMaxLength(1024));
|
|
25
|
+
const Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));
|
|
26
|
+
/** Host-defined recall visibility label. A scope identifies access policy; it does not grant it. */
|
|
27
|
+
const MemoryScope = Identity.pipe(Schema.brand("@effect-agent/core/MemoryScope"));
|
|
28
|
+
/** A host-selected namespace prevents accidental cross-tenant document lookup. */
|
|
29
|
+
var MemoryKeyWire = class extends Schema.Class("@effect-agent/core/MemoryKey")({
|
|
30
|
+
namespace: Any,
|
|
31
|
+
id: MemorySourceReference.fields.id
|
|
32
|
+
}) {};
|
|
33
|
+
const MemoryKey = {
|
|
34
|
+
Wire: MemoryKeyWire,
|
|
35
|
+
make: (fields) => Object.assign(Schema.decodeUnknownSync(MemoryKeyWire)(fields), { namespace: fields.namespace })
|
|
36
|
+
};
|
|
37
|
+
const KnownSource = Schema.Struct({
|
|
38
|
+
...MemorySourceReference.fields,
|
|
39
|
+
revision: Identity
|
|
40
|
+
});
|
|
41
|
+
const AccessScopes = Schema.Array(MemoryScope).check(Schema.isMaxLength(128), Schema.makeFilter((scopes) => new Set(scopes).size === scopes.length, { expected: "unique access scopes" }));
|
|
42
|
+
const DocumentFields = {
|
|
43
|
+
version: Schema.Literal(1),
|
|
44
|
+
key: MemoryKey.Wire,
|
|
45
|
+
source: KnownSource,
|
|
46
|
+
generation: Schema.Int.check(Schema.isBetween({
|
|
47
|
+
minimum: 1,
|
|
48
|
+
maximum: Number.MAX_SAFE_INTEGER
|
|
49
|
+
})),
|
|
50
|
+
predecessor: Schema.NullOr(MemorySourceReference),
|
|
51
|
+
modifiedAt: Timestamp
|
|
52
|
+
};
|
|
53
|
+
var ActiveMemoryDocumentWire = class extends Schema.TaggedClass()("ActiveMemoryDocument", {
|
|
54
|
+
...DocumentFields,
|
|
55
|
+
content: MemoryContent,
|
|
56
|
+
/** Explicit application-defined scope names. Empty grants no recall access. */
|
|
57
|
+
scopes: AccessScopes
|
|
58
|
+
}) {};
|
|
59
|
+
/** Terminal tombstone. Reusing its ID cannot restore the source through delayed work. */
|
|
60
|
+
var WithdrawnMemoryDocumentWire = class extends Schema.TaggedClass()("WithdrawnMemoryDocument", {
|
|
61
|
+
...DocumentFields,
|
|
62
|
+
reason: Schema.String.check(Schema.isMaxLength(4096))
|
|
63
|
+
}) {};
|
|
64
|
+
const ActiveMemoryDocument = {
|
|
65
|
+
Wire: ActiveMemoryDocumentWire,
|
|
66
|
+
make: (fields) => Object.assign(Schema.decodeUnknownSync(ActiveMemoryDocumentWire)({
|
|
67
|
+
_tag: "ActiveMemoryDocument",
|
|
68
|
+
...fields
|
|
69
|
+
}), { key: MemoryKey.make(fields.key) })
|
|
70
|
+
};
|
|
71
|
+
const WithdrawnMemoryDocument = {
|
|
72
|
+
Wire: WithdrawnMemoryDocumentWire,
|
|
73
|
+
make: (fields) => Object.assign(Schema.decodeUnknownSync(WithdrawnMemoryDocumentWire)({
|
|
74
|
+
_tag: "WithdrawnMemoryDocument",
|
|
75
|
+
...fields
|
|
76
|
+
}), { key: MemoryKey.make(fields.key) })
|
|
77
|
+
};
|
|
78
|
+
const MemoryDocument = {
|
|
79
|
+
Wire: Schema.Union([ActiveMemoryDocument.Wire, WithdrawnMemoryDocument.Wire]),
|
|
80
|
+
restore: Effect.fn("MemoryDocument.restore")(function* (namespace, input) {
|
|
81
|
+
const document = yield* Schema.decodeUnknownEffect(MemoryDocument.Wire)(input).pipe(Effect.mapError(() => MemoryStorageError.make({
|
|
82
|
+
operation: "restore memory document",
|
|
83
|
+
reason: "corrupt"
|
|
84
|
+
})));
|
|
85
|
+
if (!equals(namespace, document.key.namespace)) return yield* MemoryStorageError.make({
|
|
86
|
+
operation: "restore memory namespace",
|
|
87
|
+
reason: "corrupt"
|
|
88
|
+
});
|
|
89
|
+
const key = MemoryKey.make({
|
|
90
|
+
...document.key,
|
|
91
|
+
namespace
|
|
92
|
+
});
|
|
93
|
+
return document._tag === "ActiveMemoryDocument" ? ActiveMemoryDocument.make({
|
|
94
|
+
...document,
|
|
95
|
+
key
|
|
96
|
+
}) : WithdrawnMemoryDocument.make({
|
|
97
|
+
...document,
|
|
98
|
+
key
|
|
99
|
+
});
|
|
100
|
+
})
|
|
101
|
+
};
|
|
102
|
+
const WriteFields = {
|
|
103
|
+
key: MemoryKey.Wire,
|
|
104
|
+
/** The same operation ID must always carry exactly the same Schema-encoded command. */
|
|
105
|
+
operationId: Identity
|
|
106
|
+
};
|
|
107
|
+
const MemoryWriteWire = Schema.Union([Schema.TaggedStruct("Put", {
|
|
108
|
+
...WriteFields,
|
|
109
|
+
expectedRevision: Schema.NullOr(Identity),
|
|
110
|
+
locator: MemorySourceReference.fields.locator,
|
|
111
|
+
content: MemoryContent,
|
|
112
|
+
scopes: AccessScopes
|
|
113
|
+
}), Schema.TaggedStruct("Withdraw", {
|
|
114
|
+
...WriteFields,
|
|
115
|
+
expectedRevision: Identity,
|
|
116
|
+
reason: WithdrawnMemoryDocument.Wire.fields.reason
|
|
117
|
+
})]);
|
|
118
|
+
const MemoryWrite = {
|
|
119
|
+
Wire: MemoryWriteWire,
|
|
120
|
+
make: (fields) => Object.assign(Schema.decodeUnknownSync(MemoryWriteWire)(fields), { key: MemoryKey.make(fields.key) })
|
|
121
|
+
};
|
|
122
|
+
var MemoryConflict = class extends Schema.TaggedError()("MemoryConflict", {
|
|
123
|
+
key: MemoryKey.Wire,
|
|
124
|
+
expectedRevision: Schema.NullOr(Identity),
|
|
125
|
+
actualRevision: Schema.NullOr(Identity)
|
|
126
|
+
}) {};
|
|
127
|
+
var MemoryWithdrawn = class extends Schema.TaggedError()("MemoryWithdrawn", {
|
|
128
|
+
key: MemoryKey.Wire,
|
|
129
|
+
revision: Identity
|
|
130
|
+
}) {};
|
|
131
|
+
var MemoryOperationConflict = class extends Schema.TaggedError()("MemoryOperationConflict", {
|
|
132
|
+
key: MemoryKey.Wire,
|
|
133
|
+
operationId: Identity
|
|
134
|
+
}) {};
|
|
135
|
+
var MemoryStorageError = class extends Schema.TaggedError()("MemoryStorageError", {
|
|
136
|
+
operation: Schema.NonEmptyString,
|
|
137
|
+
reason: Schema.Literals([
|
|
138
|
+
"invalid-input",
|
|
139
|
+
"unavailable",
|
|
140
|
+
"corrupt",
|
|
141
|
+
"incompatible"
|
|
142
|
+
])
|
|
143
|
+
}) {};
|
|
144
|
+
const MemoryMutationPoint = Schema.Literals([
|
|
145
|
+
"memory:initialize:before",
|
|
146
|
+
"memory:initialize:before-accounting",
|
|
147
|
+
"memory:initialize:after-accounting",
|
|
148
|
+
"memory:initialize:after",
|
|
149
|
+
"memory:change:before",
|
|
150
|
+
"memory:change:after-state",
|
|
151
|
+
"memory:change:after-receipt",
|
|
152
|
+
"memory:change:after"
|
|
153
|
+
]);
|
|
154
|
+
var MemoryMutationFailure = class extends Schema.TaggedError()("MemoryMutationFailure", { point: MemoryMutationPoint }) {};
|
|
155
|
+
/** Explicit fault-injection seam; production adapters install the no-op Layer. */
|
|
156
|
+
var MemoryMutationFailpoint = class extends Context.Service()("@effect-agent/core/MemoryMutationFailpoint") {
|
|
157
|
+
static layer = Layer.succeed(this, { hit: () => Effect.void });
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Read capability independent of editing. A get begun after a committed write must observe
|
|
161
|
+
* that write or a later revision. An adapter unable to provide that view must fail typed.
|
|
162
|
+
* Host code binds namespace and access scope; cached candidates do not implement this port.
|
|
163
|
+
*/
|
|
164
|
+
var MemoryReader = class extends Context.Service()("@effect-agent/core/MemoryReader") {
|
|
165
|
+
static fromAdapter(adapter) {
|
|
166
|
+
return { get: Effect.fn("MemoryReader.get")(function* (key) {
|
|
167
|
+
const document = yield* adapter.get(key);
|
|
168
|
+
return document === null ? null : yield* MemoryDocument.restore(key.namespace, document);
|
|
169
|
+
}) };
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
/**
|
|
173
|
+
* Optional conditional writer. Implement only where atomic expected-revision checks and
|
|
174
|
+
* durable idempotency receipts can be guaranteed. Apply authorization before calling it.
|
|
175
|
+
* Reconcile an existing operation receipt before evaluating tombstones or expected revisions:
|
|
176
|
+
* identical commands return the original result; changed commands fail MemoryOperationConflict.
|
|
177
|
+
* Original results include content, even for a historical Put replayed after withdrawal;
|
|
178
|
+
* replay does not change the current head. Revalidate a source before using recalled content.
|
|
179
|
+
* A failed acknowledgement can hide a committed change: retain and retry the exact command.
|
|
180
|
+
* Successful withdrawal excludes checks begun afterward; already captured views may finish.
|
|
181
|
+
* Receipts and original Thread history are separate retention concerns.
|
|
182
|
+
*/
|
|
183
|
+
var MemoryWriter = class extends Context.Service()("@effect-agent/core/MemoryWriter") {
|
|
184
|
+
static fromAdapter(adapter) {
|
|
185
|
+
return { change: Effect.fn("MemoryWriter.change")(function* (write) {
|
|
186
|
+
const document = yield* adapter.change(write);
|
|
187
|
+
return yield* MemoryDocument.restore(write.key.namespace, document);
|
|
188
|
+
}) };
|
|
189
|
+
}
|
|
190
|
+
};
|
|
191
|
+
/**
|
|
192
|
+
* Transition mechanics for an authoritative document store. Revisions identify this readable
|
|
193
|
+
* source, not the original activity from which a consumer extracted it. The adapter reconciles
|
|
194
|
+
* receipts first and owns atomicity and the clock. Original evidence belongs in provenance.
|
|
195
|
+
*/
|
|
196
|
+
const applyMemoryWrite = Effect.fn("applyMemoryWrite")(function* (current, write, modifiedAt) {
|
|
197
|
+
if (current !== null && (!equals(current.key.namespace, write.key.namespace) || current.key.id !== write.key.id || current.source.id !== write.key.id)) return yield* MemoryStorageError.make({
|
|
198
|
+
operation: "memory transition identity",
|
|
199
|
+
reason: "corrupt"
|
|
200
|
+
});
|
|
201
|
+
if (current?._tag === "WithdrawnMemoryDocument") return yield* MemoryWithdrawn.make({
|
|
202
|
+
key: write.key,
|
|
203
|
+
revision: current.source.revision
|
|
204
|
+
});
|
|
205
|
+
const actualRevision = current?.source.revision ?? null;
|
|
206
|
+
if (actualRevision !== write.expectedRevision) return yield* MemoryConflict.make({
|
|
207
|
+
key: write.key,
|
|
208
|
+
expectedRevision: write.expectedRevision,
|
|
209
|
+
actualRevision
|
|
210
|
+
});
|
|
211
|
+
const generation = (current?.generation ?? 0) + 1;
|
|
212
|
+
const fields = {
|
|
213
|
+
version: 1,
|
|
214
|
+
key: write.key,
|
|
215
|
+
source: {
|
|
216
|
+
id: write.key.id,
|
|
217
|
+
locator: write._tag === "Put" ? write.locator : current?.source.locator ?? "",
|
|
218
|
+
revision: String(generation)
|
|
219
|
+
},
|
|
220
|
+
generation,
|
|
221
|
+
predecessor: current?.source ?? null,
|
|
222
|
+
modifiedAt
|
|
223
|
+
};
|
|
224
|
+
const next = write._tag === "Put" ? {
|
|
225
|
+
_tag: "ActiveMemoryDocument",
|
|
226
|
+
...fields,
|
|
227
|
+
content: write.content,
|
|
228
|
+
scopes: write.scopes
|
|
229
|
+
} : {
|
|
230
|
+
_tag: "WithdrawnMemoryDocument",
|
|
231
|
+
...fields,
|
|
232
|
+
reason: write.reason
|
|
233
|
+
};
|
|
234
|
+
const document = yield* Schema.decodeUnknownEffect(MemoryDocument.Wire)(next).pipe(Effect.mapError(() => MemoryStorageError.make({
|
|
235
|
+
operation: "memory transition",
|
|
236
|
+
reason: "invalid-input"
|
|
237
|
+
})));
|
|
238
|
+
return yield* MemoryDocument.restore(write.key.namespace, document);
|
|
239
|
+
});
|
|
240
|
+
//#endregion
|
|
241
|
+
export { ActiveMemoryDocument, MemoryConflict, MemoryDocument, MemoryKey, MemoryMutationFailpoint, MemoryMutationFailure, MemoryMutationPoint, MemoryOperationConflict, MemoryReader, MemoryScope, MemoryStorageError, MemoryWithdrawn, MemoryWrite, MemoryWriter, WithdrawnMemoryDocument, applyMemoryWrite, MemoryStore_exports as t };
|
|
242
|
+
|
|
243
|
+
//# sourceMappingURL=MemoryStore.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MemoryStore.mjs","names":["MemoryNamespace.Any","MemoryNamespace.equals"],"sources":["../../src/core/MemoryStore.ts"],"sourcesContent":["import { Context, Effect, Layer, Schema } from \"effect\";\n\nimport * as MemoryNamespace from \"./MemoryNamespace.ts\";\nimport { MemoryContent, MemorySourceReference } from \"./MemoryReference.ts\";\n\nconst Identity = Schema.NonEmptyString.check(Schema.isMaxLength(1_024));\nconst Timestamp = Schema.Finite.check(Schema.isGreaterThanOrEqualTo(0));\n\n/** Host-defined recall visibility label. A scope identifies access policy; it does not grant it. */\nexport const MemoryScope = Identity.pipe(Schema.brand(\"@effect-agent/core/MemoryScope\"));\nexport type MemoryScope = typeof MemoryScope.Type;\n\n/** A host-selected namespace prevents accidental cross-tenant document lookup. */\nclass MemoryKeyWire extends Schema.Class<MemoryKeyWire>(\"@effect-agent/core/MemoryKey\")({\n namespace: MemoryNamespace.Any,\n id: MemorySourceReference.fields.id,\n}) {}\n\nexport type MemoryKey<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> = Omit<\n MemoryKeyWire,\n \"namespace\"\n> & { readonly namespace: Namespace };\n\nexport const MemoryKey = {\n Wire: MemoryKeyWire,\n make: <Namespace extends MemoryNamespace.Any>(\n fields: MemoryKey<Namespace>,\n ): MemoryKey<Namespace> =>\n Object.assign(Schema.decodeUnknownSync(MemoryKeyWire)(fields), { namespace: fields.namespace }),\n};\n\nconst KnownSource = Schema.Struct({\n ...MemorySourceReference.fields,\n revision: Identity,\n});\n\nconst AccessScopes = Schema.Array(MemoryScope).check(\n Schema.isMaxLength(128),\n Schema.makeFilter((scopes) => new Set(scopes).size === scopes.length, {\n expected: \"unique access scopes\",\n }),\n);\n\nconst DocumentFields = {\n version: Schema.Literal(1),\n key: MemoryKey.Wire,\n source: KnownSource,\n generation: Schema.Int.check(Schema.isBetween({ minimum: 1, maximum: Number.MAX_SAFE_INTEGER })),\n predecessor: Schema.NullOr(MemorySourceReference),\n modifiedAt: Timestamp,\n};\n\nclass ActiveMemoryDocumentWire extends Schema.TaggedClass<ActiveMemoryDocumentWire>()(\n \"ActiveMemoryDocument\",\n {\n ...DocumentFields,\n content: MemoryContent,\n /** Explicit application-defined scope names. Empty grants no recall access. */\n scopes: AccessScopes,\n },\n) {}\n\n/** Terminal tombstone. Reusing its ID cannot restore the source through delayed work. */\nclass WithdrawnMemoryDocumentWire extends Schema.TaggedClass<WithdrawnMemoryDocumentWire>()(\n \"WithdrawnMemoryDocument\",\n {\n ...DocumentFields,\n reason: Schema.String.check(Schema.isMaxLength(4_096)),\n },\n) {}\n\nexport type ActiveMemoryDocument<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> =\n Omit<ActiveMemoryDocumentWire, \"key\"> & { readonly key: MemoryKey<Namespace> };\n\nexport const ActiveMemoryDocument = {\n Wire: ActiveMemoryDocumentWire,\n make: <Namespace extends MemoryNamespace.Any>(\n fields: Omit<ActiveMemoryDocument<Namespace>, \"_tag\"> & {\n readonly _tag?: \"ActiveMemoryDocument\";\n },\n ): ActiveMemoryDocument<Namespace> =>\n Object.assign(\n Schema.decodeUnknownSync(ActiveMemoryDocumentWire)({\n _tag: \"ActiveMemoryDocument\",\n ...fields,\n }),\n { key: MemoryKey.make(fields.key) },\n ),\n};\n\nexport type WithdrawnMemoryDocument<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> =\n Omit<WithdrawnMemoryDocumentWire, \"key\"> & { readonly key: MemoryKey<Namespace> };\n\nexport const WithdrawnMemoryDocument = {\n Wire: WithdrawnMemoryDocumentWire,\n make: <Namespace extends MemoryNamespace.Any>(\n fields: Omit<WithdrawnMemoryDocument<Namespace>, \"_tag\"> & {\n readonly _tag?: \"WithdrawnMemoryDocument\";\n },\n ): WithdrawnMemoryDocument<Namespace> =>\n Object.assign(\n Schema.decodeUnknownSync(WithdrawnMemoryDocumentWire)({\n _tag: \"WithdrawnMemoryDocument\",\n ...fields,\n }),\n { key: MemoryKey.make(fields.key) },\n ),\n};\n\nexport type MemoryDocument<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> =\n | ActiveMemoryDocument<Namespace>\n | WithdrawnMemoryDocument<Namespace>;\n\nexport const MemoryDocument = {\n Wire: Schema.Union([ActiveMemoryDocument.Wire, WithdrawnMemoryDocument.Wire]),\n restore: Effect.fn(\"MemoryDocument.restore\")(function* <Namespace extends MemoryNamespace.Any>(\n namespace: Namespace,\n input: unknown,\n ): Effect.fn.Return<MemoryDocument<Namespace>, MemoryStorageError> {\n const document = yield* Schema.decodeUnknownEffect(MemoryDocument.Wire)(input).pipe(\n Effect.mapError(() =>\n MemoryStorageError.make({ operation: \"restore memory document\", reason: \"corrupt\" }),\n ),\n );\n\n if (!MemoryNamespace.equals(namespace, document.key.namespace))\n return yield* MemoryStorageError.make({\n operation: \"restore memory namespace\",\n reason: \"corrupt\",\n });\n const key = MemoryKey.make({ ...document.key, namespace });\n\n return document._tag === \"ActiveMemoryDocument\"\n ? ActiveMemoryDocument.make({ ...document, key })\n : WithdrawnMemoryDocument.make({ ...document, key });\n }),\n};\n\nconst WriteFields = {\n key: MemoryKey.Wire,\n /** The same operation ID must always carry exactly the same Schema-encoded command. */\n operationId: Identity,\n};\n\nconst MemoryWriteWire = Schema.Union([\n Schema.TaggedStruct(\"Put\", {\n ...WriteFields,\n expectedRevision: Schema.NullOr(Identity),\n locator: MemorySourceReference.fields.locator,\n content: MemoryContent,\n scopes: AccessScopes,\n }),\n Schema.TaggedStruct(\"Withdraw\", {\n ...WriteFields,\n expectedRevision: Identity,\n reason: WithdrawnMemoryDocument.Wire.fields.reason,\n }),\n]);\n\nexport type MemoryWrite<Namespace extends MemoryNamespace.Any = MemoryNamespace.Any> = (\n | Omit<(typeof MemoryWriteWire.members)[0][\"Type\"], \"key\">\n | Omit<(typeof MemoryWriteWire.members)[1][\"Type\"], \"key\">\n) & { readonly key: MemoryKey<Namespace> };\n\nexport const MemoryWrite = {\n Wire: MemoryWriteWire,\n make: <Namespace extends MemoryNamespace.Any>(\n fields: MemoryWrite<Namespace>,\n ): MemoryWrite<Namespace> =>\n Object.assign(Schema.decodeUnknownSync(MemoryWriteWire)(fields), {\n key: MemoryKey.make(fields.key),\n }),\n};\n\nexport class MemoryConflict extends Schema.TaggedError<MemoryConflict>()(\"MemoryConflict\", {\n key: MemoryKey.Wire,\n expectedRevision: Schema.NullOr(Identity),\n actualRevision: Schema.NullOr(Identity),\n}) {}\n\nexport class MemoryWithdrawn extends Schema.TaggedError<MemoryWithdrawn>()(\"MemoryWithdrawn\", {\n key: MemoryKey.Wire,\n revision: Identity,\n}) {}\n\nexport class MemoryOperationConflict extends Schema.TaggedError<MemoryOperationConflict>()(\n \"MemoryOperationConflict\",\n {\n key: MemoryKey.Wire,\n operationId: Identity,\n },\n) {}\n\nexport class MemoryStorageError extends Schema.TaggedError<MemoryStorageError>()(\n \"MemoryStorageError\",\n {\n operation: Schema.NonEmptyString,\n reason: Schema.Literals([\"invalid-input\", \"unavailable\", \"corrupt\", \"incompatible\"]),\n },\n) {}\n\nexport const MemoryMutationPoint = Schema.Literals([\n \"memory:initialize:before\",\n \"memory:initialize:before-accounting\",\n \"memory:initialize:after-accounting\",\n \"memory:initialize:after\",\n \"memory:change:before\",\n \"memory:change:after-state\",\n \"memory:change:after-receipt\",\n \"memory:change:after\",\n]);\n\nexport type MemoryMutationPoint = typeof MemoryMutationPoint.Type;\n\nexport class MemoryMutationFailure extends Schema.TaggedError<MemoryMutationFailure>()(\n \"MemoryMutationFailure\",\n {\n point: MemoryMutationPoint,\n },\n) {}\n\n/** Explicit fault-injection seam; production adapters install the no-op Layer. */\nexport class MemoryMutationFailpoint extends Context.Service<\n MemoryMutationFailpoint,\n {\n readonly hit: (point: MemoryMutationPoint) => Effect.Effect<void, MemoryMutationFailure>;\n }\n>()(\"@effect-agent/core/MemoryMutationFailpoint\") {\n static readonly layer = Layer.succeed(this, { hit: () => Effect.void });\n}\n\nexport type MemoryWriteError =\n | MemoryStorageError\n | MemoryConflict\n | MemoryWithdrawn\n | MemoryOperationConflict\n | MemoryMutationFailure;\n\n/**\n * Read capability independent of editing. A get begun after a committed write must observe\n * that write or a later revision. An adapter unable to provide that view must fail typed.\n * Host code binds namespace and access scope; cached candidates do not implement this port.\n */\nexport class MemoryReader extends Context.Service<\n MemoryReader,\n {\n readonly get: <Namespace extends MemoryNamespace.Any>(\n key: MemoryKey<Namespace>,\n ) => Effect.Effect<MemoryDocument<Namespace> | null, MemoryStorageError>;\n }\n>()(\"@effect-agent/core/MemoryReader\") {\n static fromAdapter(adapter: {\n readonly get: (key: MemoryKey) => Effect.Effect<MemoryDocument | null, MemoryStorageError>;\n }): MemoryReader[\"Service\"] {\n return {\n get: Effect.fn(\"MemoryReader.get\")(function* <Namespace extends MemoryNamespace.Any>(\n key: MemoryKey<Namespace>,\n ) {\n const document = yield* adapter.get(key);\n\n return document === null ? null : yield* MemoryDocument.restore(key.namespace, document);\n }),\n };\n }\n}\n\n/**\n * Optional conditional writer. Implement only where atomic expected-revision checks and\n * durable idempotency receipts can be guaranteed. Apply authorization before calling it.\n * Reconcile an existing operation receipt before evaluating tombstones or expected revisions:\n * identical commands return the original result; changed commands fail MemoryOperationConflict.\n * Original results include content, even for a historical Put replayed after withdrawal;\n * replay does not change the current head. Revalidate a source before using recalled content.\n * A failed acknowledgement can hide a committed change: retain and retry the exact command.\n * Successful withdrawal excludes checks begun afterward; already captured views may finish.\n * Receipts and original Thread history are separate retention concerns.\n */\nexport class MemoryWriter extends Context.Service<\n MemoryWriter,\n {\n readonly change: <Namespace extends MemoryNamespace.Any>(\n write: MemoryWrite<Namespace>,\n ) => Effect.Effect<MemoryDocument<Namespace>, MemoryWriteError>;\n }\n>()(\"@effect-agent/core/MemoryWriter\") {\n static fromAdapter(adapter: {\n readonly change: (write: MemoryWrite) => Effect.Effect<MemoryDocument, MemoryWriteError>;\n }): MemoryWriter[\"Service\"] {\n return {\n change: Effect.fn(\"MemoryWriter.change\")(function* <Namespace extends MemoryNamespace.Any>(\n write: MemoryWrite<Namespace>,\n ) {\n const document = yield* adapter.change(write);\n\n return yield* MemoryDocument.restore(write.key.namespace, document);\n }),\n };\n }\n}\n\n/**\n * Transition mechanics for an authoritative document store. Revisions identify this readable\n * source, not the original activity from which a consumer extracted it. The adapter reconciles\n * receipts first and owns atomicity and the clock. Original evidence belongs in provenance.\n */\nexport const applyMemoryWrite = Effect.fn(\"applyMemoryWrite\")(function* <\n Namespace extends MemoryNamespace.Any,\n>(\n current: MemoryDocument<NoInfer<Namespace>> | null,\n write: MemoryWrite<Namespace>,\n modifiedAt: number,\n) {\n if (\n current !== null &&\n (!MemoryNamespace.equals(current.key.namespace, write.key.namespace) ||\n current.key.id !== write.key.id ||\n current.source.id !== write.key.id)\n ) {\n return yield* MemoryStorageError.make({\n operation: \"memory transition identity\",\n reason: \"corrupt\",\n });\n }\n if (current?._tag === \"WithdrawnMemoryDocument\") {\n return yield* MemoryWithdrawn.make({ key: write.key, revision: current.source.revision });\n }\n const actualRevision = current?.source.revision ?? null;\n\n if (actualRevision !== write.expectedRevision) {\n return yield* MemoryConflict.make({\n key: write.key,\n expectedRevision: write.expectedRevision,\n actualRevision,\n });\n }\n const generation = (current?.generation ?? 0) + 1;\n\n const fields = {\n version: 1 as const,\n key: write.key,\n source: {\n id: write.key.id,\n locator: write._tag === \"Put\" ? write.locator : (current?.source.locator ?? \"\"),\n revision: String(generation),\n },\n generation,\n predecessor: current?.source ?? null,\n modifiedAt,\n };\n\n const next =\n write._tag === \"Put\"\n ? {\n _tag: \"ActiveMemoryDocument\" as const,\n ...fields,\n content: write.content,\n scopes: write.scopes,\n }\n : { _tag: \"WithdrawnMemoryDocument\" as const, ...fields, reason: write.reason };\n\n const document = yield* Schema.decodeUnknownEffect(MemoryDocument.Wire)(next).pipe(\n Effect.mapError(() =>\n MemoryStorageError.make({ operation: \"memory transition\", reason: \"invalid-input\" }),\n ),\n );\n\n return yield* MemoryDocument.restore(write.key.namespace, document);\n});\n"],"mappings":"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"}
|