effect-agent 0.1.0-beta.16 → 0.1.0-beta.160
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/Admin-Dirux8PR.d.mts +4270 -0
- package/dist/Agent-BMATXYsI.mjs +93 -0
- package/dist/Agent-BMATXYsI.mjs.map +1 -0
- package/dist/Agent-ZfnNCQXs.d.mts +259 -0
- package/dist/AgentError-Bn1ytXRD.d.mts +117 -0
- package/dist/AgentPolicy-B4oH8TbG.d.mts +112 -0
- package/dist/AgentRuntime-CVMHysXm.mjs +4844 -0
- package/dist/AgentRuntime-CVMHysXm.mjs.map +1 -0
- package/dist/AgentRuntime-D1MmB_0z.d.mts +346 -0
- package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
- package/dist/ContextCompactor-BoKQOjr5.d.mts +161 -0
- package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
- package/dist/Digest-COAt3Orl.d.mts +22 -0
- package/dist/DurableAgentRuntime-pr7cCaZw.mjs +7507 -0
- package/dist/DurableAgentRuntime-pr7cCaZw.mjs.map +1 -0
- package/dist/DurableFailpoint-Cnr3wx1L.d.mts +41 -0
- package/dist/DurableStep-Cry_iol4.d.mts +103 -0
- package/dist/EventSource-DOXB0RJR.d.mts +51 -0
- package/dist/FailureDiagnostic-BElLOoED.mjs +274 -0
- package/dist/FailureDiagnostic-BElLOoED.mjs.map +1 -0
- package/dist/FailureDiagnostic-CaAkzGHL.d.mts +223 -0
- package/dist/Identifiers-CN2s30fF.d.mts +40 -0
- package/dist/InMemory.d.mts +24 -0
- package/dist/InMemory.mjs +24 -0
- package/dist/InMemory.mjs.map +1 -0
- package/dist/MemoryNamespace-BbRW5p71.d.mts +36 -0
- package/dist/MemoryReference-B8Q3UJoJ.d.mts +79 -0
- package/dist/Messaging-7VXQnWI3.d.mts +221 -0
- package/dist/Messaging-CICd_CSi.d.mts +1067 -0
- package/dist/MessagingHost-DXwWnrMh.d.mts +74 -0
- package/dist/MessagingHost-DfsbMPvq.mjs +110 -0
- package/dist/MessagingHost-DfsbMPvq.mjs.map +1 -0
- package/dist/OperationAuthorizer-TzcQtpX5.d.mts +61 -0
- package/dist/Output-CY7NZByV.d.mts +25 -0
- package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
- package/dist/PreparedInputAdmission-B7r401xJ.d.mts +42 -0
- package/dist/Receipt-BAHyigAF.d.mts +33 -0
- package/dist/Records-Bm4Qt70a.d.mts +1115 -0
- package/dist/RunEvent-D0aepYwN.d.mts +474 -0
- package/dist/RunEventSink-9CUdI9Ar.d.mts +108 -0
- package/dist/RunJournal-CA2bsvHn.mjs +979 -0
- package/dist/RunJournal-CA2bsvHn.mjs.map +1 -0
- package/dist/RunOptions-BHmBa05n.d.mts +960 -0
- package/dist/RunPolicyUsage-CUudVtg_.d.mts +23 -0
- package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
- package/dist/Schedule-Bi_XVKLF.d.mts +847 -0
- package/dist/Scheduling-DPb2QyAK.mjs +691 -0
- package/dist/Scheduling-DPb2QyAK.mjs.map +1 -0
- package/dist/Subagent-D59om8SR.d.mts +1650 -0
- package/dist/Subagent-DH6G120f.mjs +1499 -0
- package/dist/Subagent-DH6G120f.mjs.map +1 -0
- package/dist/SubagentContract-tyN9v-Jv.d.mts +112 -0
- package/dist/SubagentHost-VTyf_wEF.d.mts +172 -0
- package/dist/Subscription-B3ScCBaN.d.mts +979 -0
- package/dist/SubscriptionInput-BP5WVsX_.d.mts +41 -0
- package/dist/Thread-DOBQ0QUY.d.mts +96 -0
- package/dist/ThreadHistory-FD-o4TsR.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 +8 -0
- package/dist/ToolExposure.mjs +21 -0
- package/dist/ToolExposure.mjs.map +1 -0
- package/dist/ToolReconciler-BmVRAHKs.d.mts +80 -0
- package/dist/ToolResult-BKdqWRff.d.mts +78 -0
- package/dist/Usage-BNjPR7Zr.d.mts +129 -0
- package/dist/WakeScheduler-EjUF-GhC.d.mts +56 -0
- package/dist/Worker-CfwzMZEK.mjs +271 -0
- package/dist/Worker-CfwzMZEK.mjs.map +1 -0
- package/dist/Worker-XEBYxRQv.d.mts +472 -0
- package/dist/WorkerAdmission-Cmcxd6nS.mjs +171 -0
- package/dist/WorkerAdmission-Cmcxd6nS.mjs.map +1 -0
- package/dist/agent-registration-BIOzAej4.mjs +210 -0
- package/dist/agent-registration-BIOzAej4.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/BrowserUse.d.mts +545 -0
- package/dist/capabilities/BrowserUse.mjs +254 -0
- package/dist/capabilities/BrowserUse.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 +523 -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 +187 -0
- package/dist/capabilities/ContextTools.mjs +87 -0
- package/dist/capabilities/ContextTools.mjs.map +1 -0
- package/dist/capabilities/Mcp.d.mts +108 -0
- package/dist/capabilities/Mcp.mjs +259 -0
- package/dist/capabilities/Mcp.mjs.map +1 -0
- package/dist/capabilities/McpClient.d.mts +115 -0
- package/dist/capabilities/McpClient.mjs +519 -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 +152 -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 +129 -0
- package/dist/capabilities/ToolDiscovery.mjs +239 -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 +75 -0
- package/dist/capabilities/WebSearch.mjs +123 -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 +134 -0
- package/dist/core/AgentError.mjs.map +1 -0
- package/dist/core/AgentPolicy.d.mts +2 -0
- package/dist/core/AgentPolicy.mjs +102 -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/FailureDiagnostic.d.mts +2 -0
- package/dist/core/FailureDiagnostic.mjs +2 -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 +346 -0
- package/dist/core/RunEvent.mjs.map +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +26 -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 +142 -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 +156 -0
- package/dist/core/ToolResult.mjs.map +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +340 -0
- package/dist/core/Usage.mjs.map +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +3 -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 +330 -0
- package/dist/durable/Admin.mjs.map +1 -0
- package/dist/durable/AgentRegistration.d.mts +2 -0
- package/dist/durable/AgentRegistration.mjs +15 -0
- package/dist/durable/AgentRegistration.mjs.map +1 -0
- package/dist/durable/Certification.d.mts +110 -0
- package/dist/durable/Certification.mjs +159 -0
- package/dist/durable/Certification.mjs.map +1 -0
- package/dist/durable/CommittedActivity.d.mts +64 -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 +4 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +102 -0
- package/dist/durable/DurableFailpoint.mjs.map +1 -0
- package/dist/durable/DurableFailpointTestControl.d.mts +14 -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 +185 -0
- package/dist/durable/GitHubWorkflowSource.mjs +209 -0
- package/dist/durable/GitHubWorkflowSource.mjs.map +1 -0
- package/dist/durable/LifecyclePublication.d.mts +2 -0
- package/dist/durable/LifecyclePublication.mjs +189 -0
- package/dist/durable/LifecyclePublication.mjs.map +1 -0
- package/dist/durable/MessageDelivery.d.mts +949 -0
- package/dist/durable/MessageDelivery.mjs +589 -0
- package/dist/durable/MessageDelivery.mjs.map +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +400 -0
- package/dist/durable/MessageDeliveryStoreConformance.mjs +270 -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 +38 -0
- package/dist/durable/PreparedInputAdmission.mjs.map +1 -0
- package/dist/durable/Records.d.mts +2 -0
- package/dist/durable/Records.mjs +873 -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 +391 -0
- package/dist/durable/Schedule.mjs.map +1 -0
- package/dist/durable/ScheduleStoreConformance.d.mts +17 -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 +55 -0
- package/dist/durable/Scheduling.mjs +2 -0
- package/dist/durable/SqlMemoryStore.d.mts +742 -0
- package/dist/durable/SqlMemoryStore.mjs +627 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +986 -0
- package/dist/durable/SubmissionLedger.mjs.map +1 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +30 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2254 -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 +16 -0
- package/dist/durable/SubscriptionStoreConformance.mjs +625 -0
- package/dist/durable/SubscriptionStoreConformance.mjs.map +1 -0
- package/dist/durable/SubscriptionTools.d.mts +274 -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 +74 -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 +77 -0
- package/dist/durable/ThreadInvariants.mjs +246 -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 +383 -0
- package/dist/durable/ThreadStore.mjs.map +1 -0
- package/dist/durable/ThreadStoreConformance.d.mts +28 -0
- package/dist/durable/ThreadStoreConformance.mjs +543 -0
- package/dist/durable/ThreadStoreConformance.mjs.map +1 -0
- package/dist/durable/ToolReconciler.d.mts +2 -0
- package/dist/durable/ToolReconciler.mjs +85 -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/WorkerAdmission.d.mts +172 -0
- package/dist/durable/WorkerAdmission.mjs +2 -0
- package/dist/durable/WorkerHost.d.mts +156 -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 +125 -0
- package/dist/engine/RunOptions.mjs.map +1 -0
- package/dist/engine/SubagentHost.d.mts +2 -0
- package/dist/engine/SubagentHost.mjs +76 -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 +93 -6
- package/dist/index.mjs +101 -6
- package/dist/output-contract-DS-S8mTv.mjs +135 -0
- package/dist/output-contract-DS-S8mTv.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 +257 -0
- package/dist/sandbox/InteractiveBrowser.mjs +236 -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 +48 -0
- package/dist/sandbox/PageScreenshot.mjs +53 -0
- package/dist/sandbox/PageScreenshot.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 -40
- package/src/InMemory.ts +19 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/Approval.ts +352 -0
- package/src/capabilities/BrowserUse.ts +367 -0
- package/src/capabilities/Budget.ts +536 -0
- package/src/capabilities/CodeMode.ts +1099 -0
- package/src/capabilities/Commands.ts +86 -0
- package/src/capabilities/ContextTools.ts +129 -0
- package/src/capabilities/Mcp.ts +426 -0
- package/src/capabilities/McpClient.ts +983 -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 +2486 -0
- package/src/capabilities/SubagentReservations.ts +850 -0
- package/src/capabilities/ToolDiscovery.ts +383 -0
- package/src/capabilities/WebCapture.ts +722 -0
- package/src/capabilities/WebSearch.ts +205 -0
- package/src/capabilities/internal/subagent-background.ts +1307 -0
- package/src/capabilities/internal/subagent-contract.ts +146 -0
- package/src/capabilities/internal/subagent-policy.ts +235 -0
- package/src/capabilities/internal/subagent-reporting.ts +136 -0
- package/src/capabilities/internal/utf8.ts +10 -0
- package/src/core/Agent.ts +623 -0
- package/src/core/AgentError.ts +172 -0
- package/src/core/AgentPolicy.ts +161 -0
- package/src/core/AgentUpdates.ts +100 -0
- package/src/core/FailureDiagnostic.ts +343 -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 +72 -0
- package/src/core/Receipt.ts +42 -0
- package/src/core/RememberingStore.ts +300 -0
- package/src/core/RunEvent.ts +375 -0
- package/src/core/RunPolicyUsage.ts +19 -0
- package/src/core/SemanticMemoryIndex.ts +250 -0
- package/src/core/SemanticMemoryRevalidation.ts +254 -0
- package/src/core/SubagentContract.ts +189 -0
- package/src/core/Thread.ts +371 -0
- package/src/core/ToolExposure.ts +74 -0
- package/src/core/ToolResult.ts +190 -0
- package/src/core/Usage.ts +570 -0
- package/src/core/Worker.ts +240 -0
- package/src/core/internal/agent-updates.ts +34 -0
- package/src/core/internal/message-status.ts +60 -0
- package/src/core/internal/strict-schema.ts +14 -0
- package/src/core/internal/utf8.ts +23 -0
- package/src/durable/ActivityStore.ts +160 -0
- package/src/durable/Admin.ts +505 -0
- package/src/durable/AgentRegistration.ts +16 -0
- package/src/durable/Certification.ts +210 -0
- package/src/durable/CommittedActivity.ts +296 -0
- package/src/durable/Digest.ts +87 -0
- package/src/durable/DurableAgentRuntime.ts +11854 -0
- package/src/durable/DurableFailpoint.ts +111 -0
- package/src/durable/DurableFailpointTestControl.ts +39 -0
- package/src/durable/EventSource.ts +172 -0
- package/src/durable/GitHubWorkflowSource.ts +447 -0
- package/src/durable/LifecyclePublication.ts +311 -0
- package/src/durable/MessageDelivery.ts +878 -0
- package/src/durable/MessageDeliveryStoreConformance.ts +410 -0
- package/src/durable/OperationAuthorizer.ts +85 -0
- package/src/durable/PersistentHistory.ts +260 -0
- package/src/durable/PreparedInputAdmission.ts +57 -0
- package/src/durable/Records.ts +1099 -0
- package/src/durable/Recovery.ts +1018 -0
- package/src/durable/RunJournal.ts +1768 -0
- package/src/durable/Schedule.ts +513 -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 +1056 -0
- package/src/durable/SubmissionLedger.ts +1297 -0
- package/src/durable/SubmissionLedgerConformance.ts +4940 -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 +507 -0
- package/src/durable/ThreadProjection.ts +269 -0
- package/src/durable/ThreadProjectionMaintenance.ts +67 -0
- package/src/durable/ThreadStore.ts +637 -0
- package/src/durable/ThreadStoreConformance.ts +1296 -0
- package/src/durable/ToolReconciler.ts +109 -0
- package/src/durable/WakeScheduler.ts +134 -0
- package/src/durable/WorkerAdmission.ts +104 -0
- package/src/durable/WorkerHost.ts +205 -0
- package/src/durable/internal/agent-registration.ts +621 -0
- package/src/durable/internal/agent-updates.ts +306 -0
- package/src/durable/internal/foreign-diagnostic.ts +47 -0
- package/src/durable/internal/journal-checkpoint.ts +158 -0
- package/src/durable/internal/journal-metadata.ts +124 -0
- package/src/durable/internal/message-status.ts +20 -0
- package/src/durable/internal/messaging-host.ts +637 -0
- package/src/durable/internal/schedule-time.ts +303 -0
- package/src/durable/internal/thread-initialization.ts +195 -0
- package/src/durable/internal/worker-host.ts +3309 -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 +1127 -0
- package/src/engine/SubagentHost.ts +239 -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 +10845 -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 +250 -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 +100 -22
- package/src/sandbox/CodeExecutor.ts +352 -0
- package/src/sandbox/InteractiveBrowser.ts +339 -0
- package/src/sandbox/PageCapture.ts +691 -0
- package/src/sandbox/PageCrawl.ts +148 -0
- package/src/sandbox/PageScreenshot.ts +81 -0
- package/src/sandbox/Sandbox.ts +241 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"SubagentHost.mjs","names":[],"sources":["../../src/engine/SubagentHost.ts"],"sourcesContent":["import type { Effect, Option } from \"effect\";\nimport { Context, Schema, Stream } from \"effect\";\n\nimport type * as Agent from \"../core/Agent.ts\";\nimport type { AgentPolicy } from \"../core/AgentPolicy.ts\";\nimport type { Update } from \"../core/AgentUpdates.ts\";\nimport type * as FailureDiagnostic from \"../core/FailureDiagnostic.ts\";\nimport type { DelegationId, RunId, SettlementId, ThreadId } from \"../core/Identifiers.ts\";\nimport type { MessageRef, MessageStatus } from \"../core/Messaging.ts\";\nimport { type IdempotencyKey, type JoinedToHost, type Receipt } from \"../core/Receipt.ts\";\nimport type { SubagentBudgetReservation } from \"../core/SubagentContract.ts\";\nimport {\n WorkerError,\n type WorkerStop,\n type WorkerStopped,\n type WorkerCompletion,\n type WorkerHistoryEntry,\n type WorkerContext,\n type WorkerBudgetScope,\n type WorkerSource,\n type WorkerPage,\n type WorkerRef,\n type WorkerStarted,\n type WorkerSummary,\n} from \"../core/Worker.ts\";\n\n/** Prepared values cross this port only to be Schema-decoded before durable storage. */\nexport interface StartWorkerRequest {\n readonly delegationId: DelegationId;\n /** Start a distinct assignment using verified completed predecessor authority. */\n readonly continuationOf?: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n readonly policy: AgentPolicy;\n readonly budget: SubagentBudgetReservation;\n readonly encodedGrant: unknown;\n readonly toolCallAllowance?: number;\n /** Author-owned request; the durable host must separately authorize worker-run funding. */\n readonly budgetScope?: WorkerBudgetScope;\n}\n\n/**\n * First-admission preparation stays lazy until the owner authorizes the caller and checks the\n * retained command. Replays compare declared parameters/options and reuse the original capture.\n * Prepared policy, budget, and allowance are frozen first-admission configuration, not replay\n * arguments; changing them requires a new command key. Current caller authorization still applies.\n * Preparation must be free of external effects: concurrent first admissions can prepare before\n * the retained delivery chooses its first writer.\n */\nexport interface DeferredStartWorkerRequest<E = never, R = never> extends Pick<\n StartWorkerRequest,\n | \"delegationId\"\n | \"continuationOf\"\n | \"target\"\n | \"idempotencyKey\"\n | \"encodedParameters\"\n | \"encodedGrant\"\n | \"budgetScope\"\n> {\n readonly prepare: Effect.Effect<\n Pick<StartWorkerRequest, \"encodedInput\" | \"policy\" | \"budget\" | \"toolCallAllowance\">,\n E,\n R\n >;\n}\n\nexport interface FollowUpWorkerRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly idempotencyKey: IdempotencyKey;\n readonly encodedInput: unknown;\n readonly encodedParameters: unknown;\n}\n\n/**\n * Like deferred starts, follow-ups prepare only after current authorization and retained-command\n * lookup. Replays compare declared parameters and reuse the original input and worker authority.\n * Preparation must be free of external effects because concurrent first admissions can prepare.\n */\nexport interface DeferredFollowUpWorkerRequest<E = never, R = never> extends Omit<\n FollowUpWorkerRequest,\n \"encodedInput\"\n> {\n readonly prepare: Effect.Effect<Pick<FollowUpWorkerRequest, \"encodedInput\">, E, R>;\n}\n\nexport interface WorkerReceiptRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly receipt: Receipt;\n}\n\nexport interface WorkerMessageRequest {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly message: MessageRef;\n}\n\n/**\n * Canonical terminal values remain encoded until the capability decodes the saved parameters\n * and target output and applies its declared result projection. Child E does not survive settlement.\n */\nexport type WorkerObservation =\n | { readonly _tag: \"Pending\"; readonly receipt: Receipt }\n | {\n readonly _tag: \"Settled\";\n readonly receipt: Receipt;\n /** Absent when an input failed or was cancelled before any Run started. */\n readonly runId?: RunId;\n readonly settlementId: SettlementId;\n readonly outcome: \"completed\" | \"failed\" | \"aborted\";\n readonly encodedParameters: unknown;\n readonly encodedResult: unknown;\n /** Operator-private failed-settlement evidence; never part of a model Tool result. */\n readonly diagnostic?: FailureDiagnostic.Failure;\n readonly budgetExhausted: boolean;\n };\n\n/** One actual canonical Run, independent of how many input Receipts joined it. */\nexport interface WorkerRunReport {\n readonly worker: WorkerRef;\n readonly context: WorkerContext;\n readonly observation: Extract<WorkerObservation, { readonly _tag: \"Settled\" }> & {\n readonly runId: RunId;\n };\n}\n\n/** A bounded projection failure; raw application errors never enter durable report records. */\nexport class WorkerReportPreparationFailure extends Schema.TaggedError<WorkerReportPreparationFailure>()(\n \"WorkerReportPreparationFailure\",\n { stage: Schema.Literals([\"projection\", \"input\", \"preparation\"]) },\n) {}\n\n/**\n * Source-owned standard projection discovered from background tools.\n * The concrete descriptor retains its E/R; durable registration captures R and records\n * bounded preparation failure rather than serializing arbitrary application errors.\n */\nexport interface WorkerReporting<E = never, R = never> {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n /** Pure first-emission selection. False retains the canonical update without parent delivery. */\n readonly reportUpdate?: (update: Update) => boolean;\n /** False retains a filtered report receipt without waking the parent. */\n readonly reportCompletion?: (report: WorkerRunReport) => boolean;\n readonly prepare: (report: WorkerRunReport) => Effect.Effect<\n {\n readonly message: WorkerCompletion;\n },\n E | WorkerReportPreparationFailure,\n R\n >;\n}\n\n/** Descriptor carried by background tools; registration discovers it without an app handoff. */\nexport const BackgroundReporting = Context.Reference<\n WorkerReporting<WorkerReportPreparationFailure> | undefined\n>(\"@effect-agent/engine/BackgroundReporting\", { defaultValue: () => undefined });\n\n/**\n * Trusted, caller-bound host port. The interpreter supplies a fresh facet for each Tool Call;\n * programmatic callers acquire a separately authorized Thread facet. Request values cannot\n * choose the source identity, replace worker provenance or expand its authority and budgets.\n */\nexport class SubagentHost extends Context.Service<\n SubagentHost,\n {\n readonly context: Effect.Effect<WorkerContext, WorkerError>;\n /** Resolve prepared input through host authority; None retains legacy target inheritance. */\n readonly resolveTargetPolicy: (request: {\n readonly continuationOf?: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly encodedInput: unknown;\n }) => Effect.Effect<Option.Option<AgentPolicy>, WorkerError>;\n /** Prepared callers retain strict input/policy conflicts; deferred callers replay the saved capture. */\n readonly start: <E = never, R = never>(\n request: StartWorkerRequest | DeferredStartWorkerRequest<E, R>,\n ) => Effect.Effect<WorkerStarted, WorkerError | E, R>;\n /** Prepared callers retain strict input conflicts; deferred callers replay the saved capture. */\n readonly followUp: <E = never, R = never>(\n request: FollowUpWorkerRequest | DeferredFollowUpWorkerRequest<E, R>,\n ) => Effect.Effect<MessageStatus, WorkerError | E, R>;\n readonly inspect: (\n request: WorkerReceiptRequest | WorkerMessageRequest,\n ) => Effect.Effect<WorkerObservation | MessageStatus, WorkerError>;\n /** Inspect the continuing worker using the same summary contract as discovery. */\n readonly summary: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n }) => Effect.Effect<WorkerSummary, WorkerError>;\n /** A finite snapshot through the captured tail; resume with the last sequence as `after`. */\n readonly observe: (request: {\n readonly worker: WorkerRef;\n readonly target: Agent.AnyDefinition;\n readonly after?: number;\n }) => Stream.Stream<WorkerHistoryEntry, WorkerError>;\n /** Interrupting this wait never requests cancellation of accepted work. */\n readonly await: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<WorkerObservation, WorkerError>;\n readonly list: (request: {\n readonly delegationId: DelegationId;\n readonly target: Agent.AnyDefinition;\n readonly limit: number;\n readonly after?: ThreadId;\n }) => Effect.Effect<WorkerPage, WorkerError>;\n /** Seal the whole worker; retries reconcile the same command, including a lost acknowledgement. */\n readonly stop: (\n request: WorkerStop & { readonly target: Agent.AnyDefinition },\n ) => Effect.Effect<WorkerStopped, WorkerError>;\n /** Cancel exactly this Receipt; preserve JoinedToHost without broadening its target. */\n readonly cancel: (\n request: WorkerReceiptRequest,\n ) => Effect.Effect<void, WorkerError | JoinedToHost>;\n }\n>()(\"@effect-agent/engine/SubagentHost\") {\n static readonly unavailable: SubagentHost[\"Service\"] = {\n context: WorkerError.make({ operation: \"context\", reason: \"unavailable\" }),\n resolveTargetPolicy: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n start: () => WorkerError.make({ operation: \"start\", reason: \"unavailable\" }),\n followUp: () => WorkerError.make({ operation: \"followUp\", reason: \"unavailable\" }),\n inspect: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n summary: () => WorkerError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n observe: () => Stream.fail(WorkerError.make({ operation: \"observe\", reason: \"unavailable\" })),\n await: () => WorkerError.make({ operation: \"await\", reason: \"unavailable\" }),\n list: () => WorkerError.make({ operation: \"list\", reason: \"unavailable\" }),\n stop: () => WorkerError.make({ operation: \"stop\", reason: \"unavailable\" }),\n cancel: () => WorkerError.make({ operation: \"cancel\", reason: \"unavailable\" }),\n };\n\n /** Runtime-owned per-call binding. Unconfigured Runs deny background operations. */\n static readonly forTool = Context.Reference<\n (source: Extract<WorkerSource, { readonly _tag: \"tool\" }>) => SubagentHost[\"Service\"]\n >(\"@effect-agent/engine/SubagentHost/forTool\", {\n defaultValue: () => () => SubagentHost.unavailable,\n });\n}\n"],"mappings":";;;;;;;;;;AAkIA,IAAa,iCAAb,cAAoD,OAAO,YAA4C,CAAC,CACtG,kCACA,EAAE,OAAO,OAAO,SAAS;CAAC;CAAc;CAAS;AAAa,CAAC,EAAE,CACnE,CAAC,CAAC,CAAC;;AAwBH,MAAa,sBAAsB,QAAQ,UAEzC,4CAA4C,EAAE,oBAAoB,KAAA,EAAU,CAAC;;;;;;AAO/E,IAAa,eAAb,MAAa,qBAAqB,QAAQ,QAmDxC,CAAC,CAAC,mCAAmC,CAAC,CAAC;CACvC,OAAgB,cAAuC;EACrD,SAAS,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EACzE,2BAA2B,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EACzF,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,gBAAgB,YAAY,KAAK;GAAE,WAAW;GAAY,QAAQ;EAAc,CAAC;EACjF,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC;EAC/E,eAAe,OAAO,KAAK,YAAY,KAAK;GAAE,WAAW;GAAW,QAAQ;EAAc,CAAC,CAAC;EAC5F,aAAa,YAAY,KAAK;GAAE,WAAW;GAAS,QAAQ;EAAc,CAAC;EAC3E,YAAY,YAAY,KAAK;GAAE,WAAW;GAAQ,QAAQ;EAAc,CAAC;EACzE,YAAY,YAAY,KAAK;GAAE,WAAW;GAAQ,QAAQ;EAAc,CAAC;EACzE,cAAc,YAAY,KAAK;GAAE,WAAW;GAAU,QAAQ;EAAc,CAAC;CAC/E;;CAGA,OAAgB,UAAU,QAAQ,UAEhC,6CAA6C,EAC7C,0BAA0B,aAAa,YACzC,CAAC;AACH"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { ThreadId } from "../core/Identifiers.mjs";
|
|
3
|
+
import { Store, layerMemory, toPrompt } from "../core/Thread.mjs";
|
|
4
|
+
import { Context, Effect, Layer, Schema } from "effect";
|
|
5
|
+
//#region src/engine/ThreadHistory.ts
|
|
6
|
+
var ThreadHistory_exports = /* @__PURE__ */ __exportAll({
|
|
7
|
+
ThreadHistory: () => ThreadHistory,
|
|
8
|
+
ThreadHistoryError: () => ThreadHistoryError,
|
|
9
|
+
layer: () => layer
|
|
10
|
+
});
|
|
11
|
+
/** A history adapter rejected a read, staged value, or completed Run commit. */
|
|
12
|
+
var ThreadHistoryError = class extends Schema.TaggedError()("ThreadHistoryError", {
|
|
13
|
+
threadId: ThreadId,
|
|
14
|
+
reason: Schema.Literals([
|
|
15
|
+
"not-found",
|
|
16
|
+
"conflict",
|
|
17
|
+
"fenced",
|
|
18
|
+
"incompatible",
|
|
19
|
+
"limit",
|
|
20
|
+
"encoding",
|
|
21
|
+
"storage"
|
|
22
|
+
]),
|
|
23
|
+
message: Schema.String,
|
|
24
|
+
cause: Schema.optionalKey(Schema.Defect())
|
|
25
|
+
}) {};
|
|
26
|
+
/**
|
|
27
|
+
* History shared by Runs with the same Thread ID. The default layer retains native messages
|
|
28
|
+
* incrementally in memory for its application Scope, including completed updates before a failure.
|
|
29
|
+
* PersistentHistory.layer from effect-agent/persistent-history instead commits successful
|
|
30
|
+
* Runs to an explicit ThreadStore. Durable hosts retain history through their journal hooks.
|
|
31
|
+
* No implementation may retry model or Tool execution or claim interrupted-work recovery.
|
|
32
|
+
*/
|
|
33
|
+
var ThreadHistory = class ThreadHistory extends Context.Service()("@effect-agent/engine/ThreadHistory") {
|
|
34
|
+
/**
|
|
35
|
+
* Retain bounded in-memory history across Runs. Provide once around the application so
|
|
36
|
+
* all Runs share the same store. The underlying Thread.Store service is exposed for
|
|
37
|
+
* snapshots and interactive hooks; separate Layer builds own separate stores.
|
|
38
|
+
*/
|
|
39
|
+
static layer = Layer.effect(ThreadHistory, Effect.gen(function* () {
|
|
40
|
+
const threads = yield* Store;
|
|
41
|
+
const historyError = (cause) => ThreadHistoryError.make({
|
|
42
|
+
threadId: cause.threadId,
|
|
43
|
+
reason: cause._tag === "ThreadNotFound" ? "not-found" : cause._tag === "ThreadLimitExceeded" ? "limit" : cause._tag === "ThreadHistoryDiverged" ? "conflict" : "encoding",
|
|
44
|
+
message: cause._tag === "ThreadNotFound" ? "Thread history is not present in this application Scope" : cause._tag === "ThreadLimitExceeded" ? `In-memory history exceeds the ${cause.limit} limit of ${cause.limitValue}` : cause.message,
|
|
45
|
+
cause
|
|
46
|
+
});
|
|
47
|
+
return ThreadHistory.of({
|
|
48
|
+
retention: "incremental",
|
|
49
|
+
load: (threadId) => threads.snapshot(threadId).pipe(Effect.map(toPrompt), Effect.mapError(historyError)),
|
|
50
|
+
open: Effect.fn("ThreadHistory.open")(function* ({ threadId, runId }) {
|
|
51
|
+
const snapshot = yield* threads.create(threadId).pipe(Effect.mapError(historyError));
|
|
52
|
+
return {
|
|
53
|
+
prompt: toPrompt(snapshot),
|
|
54
|
+
stageInput: () => Effect.void,
|
|
55
|
+
stageHistory: (history) => threads.recordHistory(threadId, runId, history).pipe(Effect.asVoid, Effect.mapError(historyError)),
|
|
56
|
+
commit: () => Effect.void
|
|
57
|
+
};
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
})).pipe(Layer.provideMerge(layerMemory));
|
|
61
|
+
};
|
|
62
|
+
/** Retain in-memory conversation history for the application Scope. */
|
|
63
|
+
const layer = ThreadHistory.layer;
|
|
64
|
+
//#endregion
|
|
65
|
+
export { ThreadHistory, ThreadHistoryError, layer, ThreadHistory_exports as t };
|
|
66
|
+
|
|
67
|
+
//# sourceMappingURL=ThreadHistory.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThreadHistory.mjs","names":["ConversationStore"],"sources":["../../src/engine/ThreadHistory.ts"],"sourcesContent":["import { Context, Effect, Layer, Schema } from \"effect\";\nimport type { Prompt } from \"effect/unstable/ai\";\n\nimport { ThreadId, type RunId } from \"../core/Identifiers.ts\";\nimport { type RunCompleted } from \"../core/RunEvent.ts\";\nimport {\n Store as ConversationStore,\n layerMemory,\n toPrompt,\n type ThreadError,\n} from \"../core/Thread.ts\";\n\n/** A history adapter rejected a read, staged value, or completed Run commit. */\nexport class ThreadHistoryError extends Schema.TaggedError<ThreadHistoryError>()(\n \"ThreadHistoryError\",\n {\n threadId: ThreadId,\n reason: Schema.Literals([\n \"not-found\",\n \"conflict\",\n \"fenced\",\n \"incompatible\",\n \"limit\",\n \"encoding\",\n \"storage\",\n ]),\n message: Schema.String,\n cause: Schema.optionalKey(Schema.Defect()),\n },\n) {}\n\n/**\n * One Run's history owner. Incremental adapters retain each stageHistory update; on-success\n * adapters stage privately until commit. Before commit, the interpreter\n * finishes run-owned work and closes resources acquired for that Run, then validates the result\n * for run/start.await. Shared model, provider, and client services supplied by an enclosing\n * application Layer remain owned by that application's Scope and may outlive multiple Runs.\n * Commit must succeed before RunCompleted becomes observable. Schema-encoded input is opaque\n * here; the adapter owns its persistence boundary. A failed commit may have reached storage;\n * callers must inspect history before retrying external execution.\n */\nexport interface ThreadHistoryRun {\n readonly prompt: Prompt.Prompt;\n readonly stageInput: (input: unknown) => Effect.Effect<void, ThreadHistoryError>;\n readonly stageHistory: (history: Prompt.Prompt) => Effect.Effect<void, ThreadHistoryError>;\n readonly commit: (completed: RunCompleted) => Effect.Effect<void, ThreadHistoryError>;\n}\n\n/**\n * History shared by Runs with the same Thread ID. The default layer retains native messages\n * incrementally in memory for its application Scope, including completed updates before a failure.\n * PersistentHistory.layer from effect-agent/persistent-history instead commits successful\n * Runs to an explicit ThreadStore. Durable hosts retain history through their journal hooks.\n * No implementation may retry model or Tool execution or claim interrupted-work recovery.\n */\nexport class ThreadHistory extends Context.Service<\n ThreadHistory,\n {\n readonly retention: \"incremental\" | \"on-success\";\n readonly open: (request: {\n readonly threadId: ThreadId;\n readonly runId: RunId;\n }) => Effect.Effect<ThreadHistoryRun, ThreadHistoryError>;\n readonly load: (threadId: ThreadId) => Effect.Effect<Prompt.Prompt, ThreadHistoryError>;\n }\n>()(\"@effect-agent/engine/ThreadHistory\") {\n /**\n * Retain bounded in-memory history across Runs. Provide once around the application so\n * all Runs share the same store. The underlying Thread.Store service is exposed for\n * snapshots and interactive hooks; separate Layer builds own separate stores.\n */\n static readonly layer = Layer.effect(\n ThreadHistory,\n Effect.gen(function* () {\n const threads = yield* ConversationStore;\n\n const historyError = (cause: ThreadError): ThreadHistoryError =>\n ThreadHistoryError.make({\n threadId: cause.threadId,\n reason:\n cause._tag === \"ThreadNotFound\"\n ? \"not-found\"\n : cause._tag === \"ThreadLimitExceeded\"\n ? \"limit\"\n : cause._tag === \"ThreadHistoryDiverged\"\n ? \"conflict\"\n : \"encoding\",\n message:\n cause._tag === \"ThreadNotFound\"\n ? \"Thread history is not present in this application Scope\"\n : cause._tag === \"ThreadLimitExceeded\"\n ? `In-memory history exceeds the ${cause.limit} limit of ${cause.limitValue}`\n : cause.message,\n cause,\n });\n\n return ThreadHistory.of({\n retention: \"incremental\",\n load: (threadId) =>\n threads.snapshot(threadId).pipe(Effect.map(toPrompt), Effect.mapError(historyError)),\n open: Effect.fn(\"ThreadHistory.open\")(function* ({ threadId, runId }) {\n const snapshot = yield* threads.create(threadId).pipe(Effect.mapError(historyError));\n\n return {\n prompt: toPrompt(snapshot),\n stageInput: () => Effect.void,\n stageHistory: (history: Prompt.Prompt) =>\n threads\n .recordHistory(threadId, runId, history)\n .pipe(Effect.asVoid, Effect.mapError(historyError)),\n commit: () => Effect.void,\n };\n }),\n });\n }),\n ).pipe(Layer.provideMerge(layerMemory));\n}\n\n/** Retain in-memory conversation history for the application Scope. */\nexport const layer = ThreadHistory.layer;\n"],"mappings":";;;;;;;;;;;AAaA,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CACE,UAAU;CACV,QAAQ,OAAO,SAAS;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;CACD,SAAS,OAAO;CAChB,OAAO,OAAO,YAAY,OAAO,OAAO,CAAC;AAC3C,CACF,CAAC,CAAC,CAAC;;;;;;;;AA0BH,IAAa,gBAAb,MAAa,sBAAsB,QAAQ,QAUzC,CAAC,CAAC,oCAAoC,CAAC,CAAC;;;;;;CAMxC,OAAgB,QAAQ,MAAM,OAC5B,eACA,OAAO,IAAI,aAAa;EACtB,MAAM,UAAU,OAAOA;EAEvB,MAAM,gBAAgB,UACpB,mBAAmB,KAAK;GACtB,UAAU,MAAM;GAChB,QACE,MAAM,SAAS,mBACX,cACA,MAAM,SAAS,wBACb,UACA,MAAM,SAAS,0BACb,aACA;GACV,SACE,MAAM,SAAS,mBACX,4DACA,MAAM,SAAS,wBACb,iCAAiC,MAAM,MAAM,YAAY,MAAM,eAC/D,MAAM;GACd;EACF,CAAC;EAEH,OAAO,cAAc,GAAG;GACtB,WAAW;GACX,OAAO,aACL,QAAQ,SAAS,QAAQ,CAAC,CAAC,KAAK,OAAO,IAAI,QAAQ,GAAG,OAAO,SAAS,YAAY,CAAC;GACrF,MAAM,OAAO,GAAG,oBAAoB,CAAC,CAAC,WAAW,EAAE,UAAU,SAAS;IACpE,MAAM,WAAW,OAAO,QAAQ,OAAO,QAAQ,CAAC,CAAC,KAAK,OAAO,SAAS,YAAY,CAAC;IAEnF,OAAO;KACL,QAAQ,SAAS,QAAQ;KACzB,kBAAkB,OAAO;KACzB,eAAe,YACb,QACG,cAAc,UAAU,OAAO,OAAO,CAAC,CACvC,KAAK,OAAO,QAAQ,OAAO,SAAS,YAAY,CAAC;KACtD,cAAc,OAAO;IACvB;GACF,CAAC;EACH,CAAC;CACH,CAAC,CACH,CAAC,CAAC,KAAK,MAAM,aAAa,WAAW,CAAC;AACxC;;AAGA,MAAa,QAAQ,cAAc"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { a as ProgrammaticCallSuccess, c as ToolBrokerConfigurationError, d as ToolBrokerService, f as ToolBrokerUnavailableError, i as ProgrammaticCallRecord, l as ToolBrokerPass, n as ProgrammaticCallFailure, o as ProgrammaticToolInput, r as ProgrammaticCallOutcome, s as ToolBroker, t as ProgrammaticCallError, u as ToolBrokerPassOptions } from "../ToolBroker-DWs4tZra.mjs";
|
|
2
|
+
export { ProgrammaticCallError, ProgrammaticCallFailure, ProgrammaticCallOutcome, ProgrammaticCallRecord, ProgrammaticCallSuccess, ProgrammaticToolInput, ToolBroker, ToolBrokerConfigurationError, ToolBrokerPass, ToolBrokerPassOptions, ToolBrokerService, ToolBrokerUnavailableError };
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { Context, Schema } from "effect";
|
|
3
|
+
//#region src/engine/ToolBroker.ts
|
|
4
|
+
var ToolBroker_exports = /* @__PURE__ */ __exportAll({
|
|
5
|
+
ProgrammaticCallRecord: () => ProgrammaticCallRecord,
|
|
6
|
+
ToolBroker: () => ToolBroker,
|
|
7
|
+
ToolBrokerConfigurationError: () => ToolBrokerConfigurationError,
|
|
8
|
+
ToolBrokerUnavailableError: () => ToolBrokerUnavailableError
|
|
9
|
+
});
|
|
10
|
+
/**
|
|
11
|
+
* Ephemeral execution evidence, ordered by invocation rather than completion. No arguments or
|
|
12
|
+
* results are copied into this diagnostic. A started call without a confirmed result is uncertain;
|
|
13
|
+
* a failed call is a confirmed failure, not a promise that external effects were rolled back.
|
|
14
|
+
*/
|
|
15
|
+
const ProgrammaticCallRecord = Schema.Struct({
|
|
16
|
+
sequenceIndex: Schema.Natural,
|
|
17
|
+
toolName: Schema.String,
|
|
18
|
+
status: Schema.Literals([
|
|
19
|
+
"not-started",
|
|
20
|
+
"succeeded",
|
|
21
|
+
"failed",
|
|
22
|
+
"uncertain"
|
|
23
|
+
]),
|
|
24
|
+
errorTag: Schema.optionalKey(Schema.String)
|
|
25
|
+
});
|
|
26
|
+
/** The broker was used outside a live Tool batch; there is nothing to bind to. */
|
|
27
|
+
var ToolBrokerUnavailableError = class extends Schema.TaggedError()("ToolBrokerUnavailableError", { message: Schema.String }) {};
|
|
28
|
+
/**
|
|
29
|
+
* The pass options are invalid — for example a `maxResultBytes` that is not
|
|
30
|
+
* a positive safe integer, which would make the size comparison fail open.
|
|
31
|
+
*/
|
|
32
|
+
var ToolBrokerConfigurationError = class extends Schema.TaggedError()("ToolBrokerConfigurationError", { message: Schema.String }) {};
|
|
33
|
+
/**
|
|
34
|
+
* Engine-provided programmatic Tool broker (RUN-016, RUN-017). Declare it
|
|
35
|
+
* with `.addDependency(ToolBroker)` on a Tool that performs programmatic
|
|
36
|
+
* invocation; the interpreter supplies it, and an application Layer must not.
|
|
37
|
+
*/
|
|
38
|
+
var ToolBroker = class extends Context.Service()("@effect-agent/engine/ToolBroker") {};
|
|
39
|
+
//#endregion
|
|
40
|
+
export { ProgrammaticCallRecord, ToolBroker, ToolBrokerConfigurationError, ToolBrokerUnavailableError, ToolBroker_exports as t };
|
|
41
|
+
|
|
42
|
+
//# sourceMappingURL=ToolBroker.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ToolBroker.mjs","names":[],"sources":["../../src/engine/ToolBroker.ts"],"sourcesContent":["import type { Effect } from \"effect\";\nimport { Context, Schema } from \"effect\";\nimport type { Tool, Toolkit } from \"effect/unstable/ai\";\n\n/**\n * Programmatic Tool invocation seam for Code Mode (runtime spec §12.1,\n * ADR-0017 decision 3). The interpreter provides `ToolBroker` locally in the\n * same pattern as `AgentSpawner` and `DurableStep`: a fail-closed Run-level\n * default shadowed by a live per-outer-Tool-Call service, excluded from\n * `AgentRuntimeRequirements`. The live service is bound to the outer Tool\n * Call's identity, the Run's policy context, and the already-held scheduling\n * permit; per-call input from generated code is data only, and the broker\n * allocates every sequence index from its own monotonic per-pass state.\n */\n\n/** One programmatic invocation request. Data only: the broker owns identity. */\nexport interface ProgrammaticToolInput {\n /** The exact Effect AI Tool name resolved by the capability's namespace map. */\n readonly toolName: string;\n /** Schema-encoded (wire-form) parameters, exactly as they cross the sandbox. */\n readonly encodedArguments: unknown;\n}\n\n/** The handler ran and settled with an owned JSON snapshot of its encoded success value. */\nexport interface ProgrammaticCallSuccess {\n readonly _tag: \"ProgrammaticCallSuccess\";\n /** Broker-owned invocation index within the pass; rejected calls leave gaps. */\n readonly index: number;\n readonly encodedResult: unknown;\n}\n\n/**\n * The handler settled with the Tool's declared, Schema-encoded typed failure\n * (an Effect AI `failureMode: \"return\"` result). The program may catch and\n * branch on it.\n */\nexport interface ProgrammaticCallFailure {\n readonly _tag: \"ProgrammaticCallFailure\";\n readonly index: number;\n readonly encodedResult: unknown;\n}\n\n/**\n * The call never produced a settled handler result: a broker preflight\n * rejected it (authorization, budget, unknown Tool, approval-requiring Tool,\n * invalid parameters), the handler failed in its typed error channel, or the\n * result failed encoding or the broker-owned size bound. `errorTag` and\n * `message` are the same bounded projection the direct path uses for\n * `ToolCallFailed` events; `index` is present only when the handler was\n * actually started (preflight rejections consume no identity and no budget).\n */\nexport interface ProgrammaticCallError {\n readonly _tag: \"ProgrammaticCallError\";\n readonly index: number | undefined;\n readonly errorTag: string;\n readonly message: string;\n}\n\n/**\n * Total outcome of one programmatic invocation; defects stay defects. Trusted applications may\n * install `CurrentToolFailureObserver` to receive non-propagating failures before the outcome\n * returns, with the live Cause retained before projection. Neither Causes nor observation values\n * cross the broker boundary.\n */\nexport type ProgrammaticCallOutcome =\n | ProgrammaticCallSuccess\n | ProgrammaticCallFailure\n | ProgrammaticCallError;\n\n/**\n * Ephemeral execution evidence, ordered by invocation rather than completion. No arguments or\n * results are copied into this diagnostic. A started call without a confirmed result is uncertain;\n * a failed call is a confirmed failure, not a promise that external effects were rolled back.\n */\nexport const ProgrammaticCallRecord = Schema.Struct({\n sequenceIndex: Schema.Natural,\n toolName: Schema.String,\n status: Schema.Literals([\"not-started\", \"succeeded\", \"failed\", \"uncertain\"]),\n errorTag: Schema.optionalKey(Schema.String),\n});\n\nexport type ProgrammaticCallRecord = typeof ProgrammaticCallRecord.Type;\n\n/** Broker-owned per-pass policy for results crossing back into the sandbox. */\nexport interface ToolBrokerPassOptions {\n /** Maximum active invocations in this pass, from one through 64. Defaults to four. */\n readonly concurrency?: number | undefined;\n /**\n * Maximum UTF-8 byte size of one encoded success result at the sandbox\n * boundary. The returned value is decoded from the exact JSON representation\n * admitted by this bound, after redaction. Later handler or redactor mutations\n * cannot change it. The executor enforces its own transport bound independently.\n */\n readonly maxResultBytes: number;\n /**\n * Optional broker-owned redaction pass applied to every encoded success\n * result before the size bound. It must be total; a defect stays a defect.\n */\n readonly redactResult?: ((encodedResult: unknown) => Effect.Effect<unknown>) | undefined;\n}\n\n/**\n * One open programmatic pass, bound to one outer Tool Call. A finite Effect Semaphore bounds\n * execution. The caller owns invocation fibers and must join or interrupt them before leaving\n * its Scope. Results return as soon as they settle, without waiting for unrelated earlier calls.\n */\nexport interface ToolBrokerPass {\n readonly invoke: (input: ProgrammaticToolInput) => Effect.Effect<ProgrammaticCallOutcome>;\n /** Owned snapshot in invocation order, including interrupted and rejected calls. Never replay it. */\n readonly snapshot: Effect.Effect<ReadonlyArray<ProgrammaticCallRecord>>;\n}\n\n/** The broker was used outside a live Tool batch; there is nothing to bind to. */\nexport class ToolBrokerUnavailableError extends Schema.TaggedError<ToolBrokerUnavailableError>()(\n \"ToolBrokerUnavailableError\",\n {\n message: Schema.String,\n },\n) {}\n\n/**\n * The pass options are invalid — for example a `maxResultBytes` that is not\n * a positive safe integer, which would make the size comparison fail open.\n */\nexport class ToolBrokerConfigurationError extends Schema.TaggedError<ToolBrokerConfigurationError>()(\n \"ToolBrokerConfigurationError\",\n {\n message: Schema.String,\n },\n) {}\n\n/**\n * The engine-owned broker service. `openPass` fixes the capability-supplied\n * Toolkit and per-pass result policy once for the whole pass and captures the\n * handler services present at the call site, so nothing inside business\n * execution — least of all generated code — can substitute handlers, policy,\n * or identity afterwards.\n */\nexport interface ToolBrokerService {\n readonly openPass: <Tools extends Record<string, Tool.Any>>(\n toolkit: Toolkit.WithHandler<Tools>,\n options: ToolBrokerPassOptions,\n ) => Effect.Effect<\n ToolBrokerPass,\n ToolBrokerUnavailableError | ToolBrokerConfigurationError,\n Tool.HandlerServices<Tools[keyof Tools]>\n >;\n}\n\n/**\n * Engine-provided programmatic Tool broker (RUN-016, RUN-017). Declare it\n * with `.addDependency(ToolBroker)` on a Tool that performs programmatic\n * invocation; the interpreter supplies it, and an application Layer must not.\n */\nexport class ToolBroker extends Context.Service<ToolBroker, ToolBrokerService>()(\n \"@effect-agent/engine/ToolBroker\",\n) {}\n"],"mappings":";;;;;;;;;;;;;;AA0EA,MAAa,yBAAyB,OAAO,OAAO;CAClD,eAAe,OAAO;CACtB,UAAU,OAAO;CACjB,QAAQ,OAAO,SAAS;EAAC;EAAe;EAAa;EAAU;CAAW,CAAC;CAC3E,UAAU,OAAO,YAAY,OAAO,MAAM;AAC5C,CAAC;;AAkCD,IAAa,6BAAb,cAAgD,OAAO,YAAwC,CAAC,CAC9F,8BACA,EACE,SAAS,OAAO,OAClB,CACF,CAAC,CAAC,CAAC;;;;;AAMH,IAAa,+BAAb,cAAkD,OAAO,YAA0C,CAAC,CAClG,gCACA,EACE,SAAS,OAAO,OAClB,CACF,CAAC,CAAC,CAAC;;;;;;AAyBH,IAAa,aAAb,cAAgC,QAAQ,QAAuC,CAAC,CAC9E,iCACF,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Option, Schema } from "effect";
|
|
2
|
+
//#region src/durable/internal/foreign-diagnostic.ts
|
|
3
|
+
const ErrorMessage = Schema.Struct({ message: Schema.String });
|
|
4
|
+
const ErrorTag = Schema.Struct({ _tag: Schema.NonEmptyString });
|
|
5
|
+
const decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);
|
|
6
|
+
const decodeErrorTag = Schema.decodeUnknownOption(ErrorTag);
|
|
7
|
+
/**
|
|
8
|
+
* Inspect a foreign failure without trusting its property accessors. Schema owns the accepted
|
|
9
|
+
* fields, while the guards around each decode keep hostile proxies and getters from escaping as
|
|
10
|
+
* defects during diagnostic projection.
|
|
11
|
+
*/
|
|
12
|
+
const inspectForeignDiagnostic = (value) => {
|
|
13
|
+
let tag;
|
|
14
|
+
let message;
|
|
15
|
+
try {
|
|
16
|
+
tag = Option.getOrUndefined(decodeErrorTag(value))?._tag;
|
|
17
|
+
} catch {}
|
|
18
|
+
try {
|
|
19
|
+
message = Option.getOrUndefined(decodeErrorMessage(value))?.message;
|
|
20
|
+
} catch {}
|
|
21
|
+
return {
|
|
22
|
+
...tag === void 0 ? {} : { tag },
|
|
23
|
+
...message === void 0 ? {} : { message }
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
/** Render an opaque foreign value without allowing its coercion hooks to escape. */
|
|
27
|
+
const safeUnknownString = (value, fallback) => {
|
|
28
|
+
try {
|
|
29
|
+
return String(value);
|
|
30
|
+
} catch {
|
|
31
|
+
return fallback;
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
//#endregion
|
|
35
|
+
export { safeUnknownString as n, inspectForeignDiagnostic as t };
|
|
36
|
+
|
|
37
|
+
//# sourceMappingURL=foreign-diagnostic-DBQ1XHKh.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"foreign-diagnostic-DBQ1XHKh.mjs","names":[],"sources":["../src/durable/internal/foreign-diagnostic.ts"],"sourcesContent":["import { Option, Schema } from \"effect\";\n\nconst ErrorMessage = Schema.Struct({ message: Schema.String });\nconst ErrorTag = Schema.Struct({ _tag: Schema.NonEmptyString });\nconst decodeErrorMessage = Schema.decodeUnknownOption(ErrorMessage);\nconst decodeErrorTag = Schema.decodeUnknownOption(ErrorTag);\n\ninterface ForeignDiagnostic {\n readonly tag?: string | undefined;\n readonly message?: string | undefined;\n}\n\n/**\n * Inspect a foreign failure without trusting its property accessors. Schema owns the accepted\n * fields, while the guards around each decode keep hostile proxies and getters from escaping as\n * defects during diagnostic projection.\n */\nexport const inspectForeignDiagnostic = (value: unknown): ForeignDiagnostic => {\n let tag: string | undefined;\n let message: string | undefined;\n\n try {\n tag = Option.getOrUndefined(decodeErrorTag(value))?._tag;\n } catch {\n // A diagnostic is best effort. The caller supplies the stable fallback classification.\n }\n\n try {\n message = Option.getOrUndefined(decodeErrorMessage(value))?.message;\n } catch {\n // A hostile message accessor must not replace the original failure with a defect.\n }\n\n return {\n ...(tag === undefined ? {} : { tag }),\n ...(message === undefined ? {} : { message }),\n };\n};\n\n/** Render an opaque foreign value without allowing its coercion hooks to escape. */\nexport const safeUnknownString = (value: unknown, fallback: string): string => {\n try {\n return String(value);\n } catch {\n return fallback;\n }\n};\n"],"mappings":";;AAEA,MAAM,eAAe,OAAO,OAAO,EAAE,SAAS,OAAO,OAAO,CAAC;AAC7D,MAAM,WAAW,OAAO,OAAO,EAAE,MAAM,OAAO,eAAe,CAAC;AAC9D,MAAM,qBAAqB,OAAO,oBAAoB,YAAY;AAClE,MAAM,iBAAiB,OAAO,oBAAoB,QAAQ;;;;;;AAY1D,MAAa,4BAA4B,UAAsC;CAC7E,IAAI;CACJ,IAAI;CAEJ,IAAI;EACF,MAAM,OAAO,eAAe,eAAe,KAAK,CAAC,CAAC,EAAE;CACtD,QAAQ,CAER;CAEA,IAAI;EACF,UAAU,OAAO,eAAe,mBAAmB,KAAK,CAAC,CAAC,EAAE;CAC9D,QAAQ,CAER;CAEA,OAAO;EACL,GAAI,QAAQ,KAAA,IAAY,CAAC,IAAI,EAAE,IAAI;EACnC,GAAI,YAAY,KAAA,IAAY,CAAC,IAAI,EAAE,QAAQ;CAC7C;AACF;;AAGA,MAAa,qBAAqB,OAAgB,aAA6B;CAC7E,IAAI;EACF,OAAO,OAAO,KAAK;CACrB,QAAQ;EACN,OAAO;CACT;AACF"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,93 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { a as Identifiers_d_exports } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
+
import { f as Thread_d_exports } from "./Thread-DOBQ0QUY.mjs";
|
|
3
|
+
import { a as SubagentContract_d_exports } from "./SubagentContract-tyN9v-Jv.mjs";
|
|
4
|
+
import { t as SubagentReservations_d_exports } from "./capabilities/SubagentReservations.mjs";
|
|
5
|
+
import { o as Receipt_d_exports } from "./Receipt-BAHyigAF.mjs";
|
|
6
|
+
import { t as AgentUpdates_d_exports } from "./AgentUpdates-DMJ-_xow.mjs";
|
|
7
|
+
import { f as Usage_d_exports } from "./Usage-BNjPR7Zr.mjs";
|
|
8
|
+
import { d as RunEvent_d_exports } from "./RunEvent-D0aepYwN.mjs";
|
|
9
|
+
import { i as ThreadHistory_d_exports } from "./ThreadHistory-FD-o4TsR.mjs";
|
|
10
|
+
import { t as InMemory_d_exports } from "./InMemory.mjs";
|
|
11
|
+
import { t as ToolExposure_d_exports } from "./ToolExposure.mjs";
|
|
12
|
+
import { t as Redaction_d_exports } from "./capabilities/Redaction.mjs";
|
|
13
|
+
import { t as Approval_d_exports } from "./capabilities/Approval.mjs";
|
|
14
|
+
import { t as BrowserUse_d_exports } from "./capabilities/BrowserUse.mjs";
|
|
15
|
+
import { t as Budget_d_exports } from "./capabilities/Budget.mjs";
|
|
16
|
+
import { p as ToolBroker_d_exports } from "./ToolBroker-DWs4tZra.mjs";
|
|
17
|
+
import { D as Sandbox_d_exports } from "./Sandbox-CEsDWBLq.mjs";
|
|
18
|
+
import { t as CodeExecutor_d_exports } from "./sandbox/CodeExecutor.mjs";
|
|
19
|
+
import { t as CodeMode_d_exports } from "./capabilities/CodeMode.mjs";
|
|
20
|
+
import { a as FailureDiagnostic_d_exports } from "./FailureDiagnostic-CaAkzGHL.mjs";
|
|
21
|
+
import { i as AgentError_d_exports } from "./AgentError-Bn1ytXRD.mjs";
|
|
22
|
+
import { r as ToolResult_d_exports } from "./ToolResult-BKdqWRff.mjs";
|
|
23
|
+
import { r as AgentPolicy_d_exports } from "./AgentPolicy-B4oH8TbG.mjs";
|
|
24
|
+
import { t as Agent_d_exports } from "./Agent-ZfnNCQXs.mjs";
|
|
25
|
+
import { c as MemoryReference_d_exports } from "./MemoryReference-B8Q3UJoJ.mjs";
|
|
26
|
+
import { n as RunPolicyUsage_d_exports } from "./RunPolicyUsage-CUudVtg_.mjs";
|
|
27
|
+
import { x as Worker_d_exports } from "./Worker-XEBYxRQv.mjs";
|
|
28
|
+
import { s as ContextWindow_d_exports } from "./ContextWindow-DRQ5Mbm2.mjs";
|
|
29
|
+
import { s as ContextCompactor_d_exports } from "./ContextCompactor-BoKQOjr5.mjs";
|
|
30
|
+
import { i as DurableStep_d_exports } from "./DurableStep-Cry_iol4.mjs";
|
|
31
|
+
import { F as RunOptions_d_exports } from "./RunOptions-BHmBa05n.mjs";
|
|
32
|
+
import { t as Commands_d_exports } from "./capabilities/Commands.mjs";
|
|
33
|
+
import { t as ContextHistory_d_exports } from "./engine/ContextHistory.mjs";
|
|
34
|
+
import { t as ContextTools_d_exports } from "./capabilities/ContextTools.mjs";
|
|
35
|
+
import { t as Mcp_d_exports } from "./capabilities/Mcp.mjs";
|
|
36
|
+
import { t as McpClient_d_exports } from "./capabilities/McpClient.mjs";
|
|
37
|
+
import { i as MemoryNamespace_d_exports } from "./MemoryNamespace-BbRW5p71.mjs";
|
|
38
|
+
import { t as MemoryStore_d_exports } from "./core/MemoryStore.mjs";
|
|
39
|
+
import { t as MemoryNotes_d_exports } from "./capabilities/MemoryNotes.mjs";
|
|
40
|
+
import { n as MessagingHost_d_exports } from "./MessagingHost-DXwWnrMh.mjs";
|
|
41
|
+
import { t as Messaging_d_exports } from "./Messaging-CICd_CSi.mjs";
|
|
42
|
+
import { t as ModelContext_d_exports } from "./capabilities/ModelContext.mjs";
|
|
43
|
+
import { t as RememberingStore_d_exports } from "./core/RememberingStore.mjs";
|
|
44
|
+
import { t as Remembering_d_exports } from "./capabilities/Remembering.mjs";
|
|
45
|
+
import { t as RunHooks_d_exports } from "./capabilities/RunHooks.mjs";
|
|
46
|
+
import { t as MemoryRevalidation_d_exports } from "./core/MemoryRevalidation.mjs";
|
|
47
|
+
import { t as SemanticMemoryIndex_d_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
48
|
+
import { t as SemanticMemoryRevalidation_d_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
49
|
+
import { t as SemanticMemory_d_exports } from "./capabilities/SemanticMemory.mjs";
|
|
50
|
+
import { s as SubagentHost_d_exports } from "./SubagentHost-VTyf_wEF.mjs";
|
|
51
|
+
import { t as AgentRuntime_d_exports } from "./AgentRuntime-D1MmB_0z.mjs";
|
|
52
|
+
import { i as RunEventSink_d_exports } from "./RunEventSink-9CUdI9Ar.mjs";
|
|
53
|
+
import { v as Subagent_d_exports } from "./Subagent-D59om8SR.mjs";
|
|
54
|
+
import { t as ToolDiscovery_d_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
55
|
+
import { D as PageCapture_d_exports } from "./PageCapture-Df8Xwskw.mjs";
|
|
56
|
+
import { t as WebCapture_d_exports } from "./capabilities/WebCapture.mjs";
|
|
57
|
+
import { t as WebSearch_d_exports } from "./capabilities/WebSearch.mjs";
|
|
58
|
+
import { t as IdGenerator_d_exports } from "./core/IdGenerator.mjs";
|
|
59
|
+
import { t as Memory_d_exports } from "./core/Memory.mjs";
|
|
60
|
+
import { P as Records_d_exports } from "./Records-Bm4Qt70a.mjs";
|
|
61
|
+
import { t as ActivityStore_d_exports } from "./durable/ActivityStore.mjs";
|
|
62
|
+
import { n as Digest_d_exports } from "./Digest-COAt3Orl.mjs";
|
|
63
|
+
import { J as Recovery_d_exports, Pa as AgentRegistration_d_exports, Pi as RunJournal_d_exports, Qn as DurableAgentRuntime_d_exports, Si as LifecyclePublication_d_exports, bn as SubmissionLedger_d_exports, ki as SubmissionStatus_d_exports, oi as ThreadStore_d_exports, t as Admin_d_exports } from "./Admin-Dirux8PR.mjs";
|
|
64
|
+
import { t as DurableFailpoint_d_exports } from "./DurableFailpoint-Cnr3wx1L.mjs";
|
|
65
|
+
import { a as OperationAuthorizer_d_exports } from "./OperationAuthorizer-TzcQtpX5.mjs";
|
|
66
|
+
import { l as ToolReconciler_d_exports } from "./ToolReconciler-BmVRAHKs.mjs";
|
|
67
|
+
import { n as WakeScheduler_d_exports } from "./WakeScheduler-EjUF-GhC.mjs";
|
|
68
|
+
import { t as CommittedActivity_d_exports } from "./durable/CommittedActivity.mjs";
|
|
69
|
+
import { R as Schedule_d_exports } from "./Schedule-Bi_XVKLF.mjs";
|
|
70
|
+
import { k as Subscription_d_exports } from "./Subscription-B3ScCBaN.mjs";
|
|
71
|
+
import { n as EventSource_d_exports } from "./EventSource-DOXB0RJR.mjs";
|
|
72
|
+
import { n as PreparedInputAdmission_d_exports } from "./PreparedInputAdmission-B7r401xJ.mjs";
|
|
73
|
+
import { r as SubscriptionInput_d_exports } from "./SubscriptionInput-BP5WVsX_.mjs";
|
|
74
|
+
import { t as Subscriptions_d_exports } from "./durable/Subscriptions.mjs";
|
|
75
|
+
import { t as MessageDelivery_d_exports } from "./durable/MessageDelivery.mjs";
|
|
76
|
+
import { t as PersistentHistory_d_exports } from "./durable/PersistentHistory.mjs";
|
|
77
|
+
import { t as ScheduleTransition_d_exports } from "./durable/ScheduleTransition.mjs";
|
|
78
|
+
import { t as Scheduling_d_exports } from "./durable/Scheduling.mjs";
|
|
79
|
+
import { t as SubscriptionTools_d_exports } from "./durable/SubscriptionTools.mjs";
|
|
80
|
+
import { t as SubscriptionTransition_d_exports } from "./durable/SubscriptionTransition.mjs";
|
|
81
|
+
import { t as ThreadContextHistory_d_exports } from "./durable/ThreadContextHistory.mjs";
|
|
82
|
+
import { t as ThreadContextHistoryProjection_d_exports } from "./durable/ThreadContextHistoryProjection.mjs";
|
|
83
|
+
import { t as ThreadInvariants_d_exports } from "./durable/ThreadInvariants.mjs";
|
|
84
|
+
import { t as ThreadProjection_d_exports } from "./durable/ThreadProjection.mjs";
|
|
85
|
+
import { t as ThreadProjectionMaintenance_d_exports } from "./durable/ThreadProjectionMaintenance.mjs";
|
|
86
|
+
import { t as WorkerAdmission_d_exports } from "./durable/WorkerAdmission.mjs";
|
|
87
|
+
import { t as WorkerHost_d_exports } from "./durable/WorkerHost.mjs";
|
|
88
|
+
import { t as Compaction_d_exports } from "./engine/Compaction.mjs";
|
|
89
|
+
import { t as Output_d_exports } from "./Output-CY7NZByV.mjs";
|
|
90
|
+
import { t as PageScreenshot_d_exports } from "./sandbox/PageScreenshot.mjs";
|
|
91
|
+
import { t as InteractiveBrowser_d_exports } from "./sandbox/InteractiveBrowser.mjs";
|
|
92
|
+
import { t as PageCrawl_d_exports } from "./sandbox/PageCrawl.mjs";
|
|
93
|
+
export { ActivityStore_d_exports as ActivityStore, Admin_d_exports as Admin, Agent_d_exports as Agent, AgentError_d_exports as AgentError, AgentPolicy_d_exports as AgentPolicy, AgentRegistration_d_exports as AgentRegistration, AgentRuntime_d_exports as AgentRuntime, AgentUpdates_d_exports as AgentUpdates, Approval_d_exports as Approval, BrowserUse_d_exports as BrowserUse, Budget_d_exports as Budget, CodeExecutor_d_exports as CodeExecutor, CodeMode_d_exports as CodeMode, Commands_d_exports as Commands, CommittedActivity_d_exports as CommittedActivity, Compaction_d_exports as Compaction, ContextCompactor_d_exports as ContextCompactor, ContextHistory_d_exports as ContextHistory, ContextTools_d_exports as ContextTools, ContextWindow_d_exports as ContextWindow, Digest_d_exports as Digest, DurableAgentRuntime_d_exports as DurableAgentRuntime, DurableFailpoint_d_exports as DurableFailpoint, DurableStep_d_exports as DurableStep, EventSource_d_exports as EventSource, FailureDiagnostic_d_exports as FailureDiagnostic, IdGenerator_d_exports as IdGenerator, Identifiers_d_exports as Identifiers, InMemory_d_exports as InMemory, InteractiveBrowser_d_exports as InteractiveBrowser, LifecyclePublication_d_exports as LifecyclePublication, Mcp_d_exports as Mcp, McpClient_d_exports as McpClient, Memory_d_exports as Memory, MemoryNamespace_d_exports as MemoryNamespace, MemoryNotes_d_exports as MemoryNotes, MemoryReference_d_exports as MemoryReference, MemoryRevalidation_d_exports as MemoryRevalidation, MemoryStore_d_exports as MemoryStore, MessageDelivery_d_exports as MessageDelivery, Messaging_d_exports as Messaging, MessagingHost_d_exports as MessagingHost, ModelContext_d_exports as ModelContext, OperationAuthorizer_d_exports as OperationAuthorizer, Output_d_exports as Output, PageCapture_d_exports as PageCapture, PageCrawl_d_exports as PageCrawl, PageScreenshot_d_exports as PageScreenshot, PersistentHistory_d_exports as PersistentHistory, PreparedInputAdmission_d_exports as PreparedInputAdmission, Receipt_d_exports as Receipt, Records_d_exports as Records, Recovery_d_exports as Recovery, Redaction_d_exports as Redaction, Remembering_d_exports as Remembering, RememberingStore_d_exports as RememberingStore, RunEvent_d_exports as RunEvent, RunEventSink_d_exports as RunEventSink, RunHooks_d_exports as RunHooks, RunJournal_d_exports as RunJournal, RunOptions_d_exports as RunOptions, RunPolicyUsage_d_exports as RunPolicyUsage, Sandbox_d_exports as Sandbox, Schedule_d_exports as Schedule, ScheduleTransition_d_exports as ScheduleTransition, Scheduling_d_exports as Scheduling, SemanticMemory_d_exports as SemanticMemory, SemanticMemoryIndex_d_exports as SemanticMemoryIndex, SemanticMemoryRevalidation_d_exports as SemanticMemoryRevalidation, Subagent_d_exports as Subagent, SubagentContract_d_exports as SubagentContract, SubagentHost_d_exports as SubagentHost, SubagentReservations_d_exports as SubagentReservations, SubmissionLedger_d_exports as SubmissionLedger, SubmissionStatus_d_exports as SubmissionStatus, Subscription_d_exports as Subscription, SubscriptionInput_d_exports as SubscriptionInput, SubscriptionTools_d_exports as SubscriptionTools, SubscriptionTransition_d_exports as SubscriptionTransition, Subscriptions_d_exports as Subscriptions, Thread_d_exports as Thread, ThreadContextHistory_d_exports as ThreadContextHistory, ThreadContextHistoryProjection_d_exports as ThreadContextHistoryProjection, ThreadHistory_d_exports as ThreadHistory, ThreadInvariants_d_exports as ThreadInvariants, ThreadProjection_d_exports as ThreadProjection, ThreadProjectionMaintenance_d_exports as ThreadProjectionMaintenance, ThreadStore_d_exports as ThreadStore, ToolBroker_d_exports as ToolBroker, ToolDiscovery_d_exports as ToolDiscovery, ToolExposure_d_exports as ToolExposure, ToolReconciler_d_exports as ToolReconciler, ToolResult_d_exports as ToolResult, Usage_d_exports as Usage, WakeScheduler_d_exports as WakeScheduler, WebCapture_d_exports as WebCapture, WebSearch_d_exports as WebSearch, Worker_d_exports as Worker, WorkerAdmission_d_exports as WorkerAdmission, WorkerHost_d_exports as WorkerHost };
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,101 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { t as Identifiers_exports } from "./core/Identifiers.mjs";
|
|
2
|
+
import { t as ToolResult_exports } from "./core/ToolResult.mjs";
|
|
3
|
+
import { t as AgentPolicy_exports } from "./core/AgentPolicy.mjs";
|
|
4
|
+
import { t as Receipt_exports } from "./core/Receipt.mjs";
|
|
5
|
+
import { t as AgentUpdates_exports } from "./core/AgentUpdates.mjs";
|
|
6
|
+
import { t as Agent_exports } from "./Agent-BMATXYsI.mjs";
|
|
7
|
+
import { a as FailureDiagnostic_exports } from "./FailureDiagnostic-BElLOoED.mjs";
|
|
8
|
+
import { t as AgentError_exports } from "./core/AgentError.mjs";
|
|
9
|
+
import { t as IdGenerator_exports } from "./core/IdGenerator.mjs";
|
|
10
|
+
import { t as SubagentContract_exports } from "./core/SubagentContract.mjs";
|
|
11
|
+
import { t as Usage_exports } from "./core/Usage.mjs";
|
|
12
|
+
import { t as RunEvent_exports } from "./core/RunEvent.mjs";
|
|
13
|
+
import { x as Worker_exports } from "./Worker-CfwzMZEK.mjs";
|
|
14
|
+
import { n as MessagingHost_exports } from "./MessagingHost-DfsbMPvq.mjs";
|
|
15
|
+
import { t as SubagentHost_exports } from "./engine/SubagentHost.mjs";
|
|
16
|
+
import { t as Thread_exports } from "./core/Thread.mjs";
|
|
17
|
+
import { t as ThreadHistory_exports } from "./engine/ThreadHistory.mjs";
|
|
18
|
+
import { t as AgentRuntime_exports } from "./AgentRuntime-CVMHysXm.mjs";
|
|
19
|
+
import { t as ContextWindow_exports } from "./engine/ContextWindow.mjs";
|
|
20
|
+
import { t as DurableStep_exports } from "./engine/DurableStep.mjs";
|
|
21
|
+
import { t as ContextCompactor_exports } from "./engine/ContextCompactor.mjs";
|
|
22
|
+
import { t as RunEventSink_exports } from "./engine/RunEventSink.mjs";
|
|
23
|
+
import { t as MemoryReference_exports } from "./core/MemoryReference.mjs";
|
|
24
|
+
import { t as RunPolicyUsage_exports } from "./core/RunPolicyUsage.mjs";
|
|
25
|
+
import { t as RunOptions_exports } from "./engine/RunOptions.mjs";
|
|
26
|
+
import { t as ToolBroker_exports } from "./engine/ToolBroker.mjs";
|
|
27
|
+
import { t as Redaction_exports } from "./capabilities/Redaction.mjs";
|
|
28
|
+
import { t as Approval_exports } from "./capabilities/Approval.mjs";
|
|
29
|
+
import { t as BrowserUse_exports } from "./capabilities/BrowserUse.mjs";
|
|
30
|
+
import { t as Budget_exports } from "./capabilities/Budget.mjs";
|
|
31
|
+
import { t as Sandbox_exports } from "./sandbox/Sandbox.mjs";
|
|
32
|
+
import { t as CodeExecutor_exports } from "./sandbox/CodeExecutor.mjs";
|
|
33
|
+
import { t as CodeMode_exports } from "./capabilities/CodeMode.mjs";
|
|
34
|
+
import { t as Commands_exports } from "./capabilities/Commands.mjs";
|
|
35
|
+
import { t as Compaction_exports } from "./engine/Compaction.mjs";
|
|
36
|
+
import { t as ContextHistory_exports } from "./engine/ContextHistory.mjs";
|
|
37
|
+
import { t as ContextTools_exports } from "./capabilities/ContextTools.mjs";
|
|
38
|
+
import { t as SubagentReservations_exports } from "./capabilities/SubagentReservations.mjs";
|
|
39
|
+
import { t as InMemory_exports } from "./InMemory.mjs";
|
|
40
|
+
import { t as InteractiveBrowser_exports } from "./sandbox/InteractiveBrowser.mjs";
|
|
41
|
+
import { t as Mcp_exports } from "./capabilities/Mcp.mjs";
|
|
42
|
+
import { t as McpClient_exports } from "./capabilities/McpClient.mjs";
|
|
43
|
+
import { t as Memory_exports } from "./core/Memory.mjs";
|
|
44
|
+
import { t as MemoryNamespace_exports } from "./core/MemoryNamespace.mjs";
|
|
45
|
+
import { t as MemoryStore_exports } from "./core/MemoryStore.mjs";
|
|
46
|
+
import { t as MemoryNotes_exports } from "./capabilities/MemoryNotes.mjs";
|
|
47
|
+
import { t as MemoryRevalidation_exports } from "./core/MemoryRevalidation.mjs";
|
|
48
|
+
import { t as Messaging_exports } from "./capabilities/Messaging.mjs";
|
|
49
|
+
import { t as ModelContext_exports } from "./capabilities/ModelContext.mjs";
|
|
50
|
+
import { t as Output_exports } from "./engine/Output.mjs";
|
|
51
|
+
import { t as PageCapture_exports } from "./sandbox/PageCapture.mjs";
|
|
52
|
+
import { t as PageCrawl_exports } from "./sandbox/PageCrawl.mjs";
|
|
53
|
+
import { t as PageScreenshot_exports } from "./sandbox/PageScreenshot.mjs";
|
|
54
|
+
import { t as RememberingStore_exports } from "./core/RememberingStore.mjs";
|
|
55
|
+
import { t as Remembering_exports } from "./capabilities/Remembering.mjs";
|
|
56
|
+
import { t as RunHooks_exports } from "./capabilities/RunHooks.mjs";
|
|
57
|
+
import { t as SemanticMemoryIndex_exports } from "./core/SemanticMemoryIndex.mjs";
|
|
58
|
+
import { t as SemanticMemoryRevalidation_exports } from "./core/SemanticMemoryRevalidation.mjs";
|
|
59
|
+
import { t as SemanticMemory_exports } from "./capabilities/SemanticMemory.mjs";
|
|
60
|
+
import { r as Subagent_exports } from "./Subagent-DH6G120f.mjs";
|
|
61
|
+
import { t as ToolDiscovery_exports } from "./capabilities/ToolDiscovery.mjs";
|
|
62
|
+
import { t as ToolExposure_exports } from "./ToolExposure.mjs";
|
|
63
|
+
import { t as WebCapture_exports } from "./capabilities/WebCapture.mjs";
|
|
64
|
+
import { t as WebSearch_exports } from "./capabilities/WebSearch.mjs";
|
|
65
|
+
import { t as Records_exports } from "./durable/Records.mjs";
|
|
66
|
+
import { t as ActivityStore_exports } from "./durable/ActivityStore.mjs";
|
|
67
|
+
import { t as SubmissionLedger_exports } from "./durable/SubmissionLedger.mjs";
|
|
68
|
+
import { t as Recovery_exports } from "./durable/Recovery.mjs";
|
|
69
|
+
import { t as Admin_exports } from "./durable/Admin.mjs";
|
|
70
|
+
import { t as Digest_exports } from "./durable/Digest.mjs";
|
|
71
|
+
import { t as AgentRegistration_exports } from "./durable/AgentRegistration.mjs";
|
|
72
|
+
import { r as DurableAgentRuntime_exports } from "./DurableAgentRuntime-pr7cCaZw.mjs";
|
|
73
|
+
import { n as RunJournal_exports } from "./RunJournal-CA2bsvHn.mjs";
|
|
74
|
+
import { t as ThreadStore_exports } from "./durable/ThreadStore.mjs";
|
|
75
|
+
import { t as CommittedActivity_exports } from "./durable/CommittedActivity.mjs";
|
|
76
|
+
import { t as DurableFailpoint_exports } from "./durable/DurableFailpoint.mjs";
|
|
77
|
+
import { t as Schedule_exports } from "./durable/Schedule.mjs";
|
|
78
|
+
import { t as PreparedInputAdmission_exports } from "./durable/PreparedInputAdmission.mjs";
|
|
79
|
+
import { t as Subscription_exports } from "./durable/Subscription.mjs";
|
|
80
|
+
import { t as MessageDelivery_exports } from "./durable/MessageDelivery.mjs";
|
|
81
|
+
import { t as WakeScheduler_exports } from "./durable/WakeScheduler.mjs";
|
|
82
|
+
import { i as WorkerAdmission_exports } from "./WorkerAdmission-Cmcxd6nS.mjs";
|
|
83
|
+
import { t as WorkerHost_exports } from "./durable/WorkerHost.mjs";
|
|
84
|
+
import { t as OperationAuthorizer_exports } from "./durable/OperationAuthorizer.mjs";
|
|
85
|
+
import { t as SubmissionStatus_exports } from "./durable/SubmissionStatus.mjs";
|
|
86
|
+
import { t as ThreadInvariants_exports } from "./durable/ThreadInvariants.mjs";
|
|
87
|
+
import { t as ToolReconciler_exports } from "./durable/ToolReconciler.mjs";
|
|
88
|
+
import { t as EventSource_exports } from "./durable/EventSource.mjs";
|
|
89
|
+
import { t as PersistentHistory_exports } from "./durable/PersistentHistory.mjs";
|
|
90
|
+
import { t as ScheduleTransition_exports } from "./durable/ScheduleTransition.mjs";
|
|
91
|
+
import { i as Scheduling_exports } from "./Scheduling-DPb2QyAK.mjs";
|
|
92
|
+
import { t as SubscriptionInput_exports } from "./durable/SubscriptionInput.mjs";
|
|
93
|
+
import { t as Subscriptions_exports } from "./durable/Subscriptions.mjs";
|
|
94
|
+
import { t as SubscriptionTools_exports } from "./durable/SubscriptionTools.mjs";
|
|
95
|
+
import { t as SubscriptionTransition_exports } from "./durable/SubscriptionTransition.mjs";
|
|
96
|
+
import { t as ThreadProjection_exports } from "./durable/ThreadProjection.mjs";
|
|
97
|
+
import { t as ThreadProjectionMaintenance_exports } from "./durable/ThreadProjectionMaintenance.mjs";
|
|
98
|
+
import { t as ThreadContextHistoryProjection_exports } from "./durable/ThreadContextHistoryProjection.mjs";
|
|
99
|
+
import { t as ThreadContextHistory_exports } from "./durable/ThreadContextHistory.mjs";
|
|
100
|
+
import { t as LifecyclePublication_exports } from "./durable/LifecyclePublication.mjs";
|
|
101
|
+
export { ActivityStore_exports as ActivityStore, Admin_exports as Admin, Agent_exports as Agent, AgentError_exports as AgentError, AgentPolicy_exports as AgentPolicy, AgentRegistration_exports as AgentRegistration, AgentRuntime_exports as AgentRuntime, AgentUpdates_exports as AgentUpdates, Approval_exports as Approval, BrowserUse_exports as BrowserUse, Budget_exports as Budget, CodeExecutor_exports as CodeExecutor, CodeMode_exports as CodeMode, Commands_exports as Commands, CommittedActivity_exports as CommittedActivity, Compaction_exports as Compaction, ContextCompactor_exports as ContextCompactor, ContextHistory_exports as ContextHistory, ContextTools_exports as ContextTools, ContextWindow_exports as ContextWindow, Digest_exports as Digest, DurableAgentRuntime_exports as DurableAgentRuntime, DurableFailpoint_exports as DurableFailpoint, DurableStep_exports as DurableStep, EventSource_exports as EventSource, FailureDiagnostic_exports as FailureDiagnostic, IdGenerator_exports as IdGenerator, Identifiers_exports as Identifiers, InMemory_exports as InMemory, InteractiveBrowser_exports as InteractiveBrowser, LifecyclePublication_exports as LifecyclePublication, Mcp_exports as Mcp, McpClient_exports as McpClient, Memory_exports as Memory, MemoryNamespace_exports as MemoryNamespace, MemoryNotes_exports as MemoryNotes, MemoryReference_exports as MemoryReference, MemoryRevalidation_exports as MemoryRevalidation, MemoryStore_exports as MemoryStore, MessageDelivery_exports as MessageDelivery, Messaging_exports as Messaging, MessagingHost_exports as MessagingHost, ModelContext_exports as ModelContext, OperationAuthorizer_exports as OperationAuthorizer, Output_exports as Output, PageCapture_exports as PageCapture, PageCrawl_exports as PageCrawl, PageScreenshot_exports as PageScreenshot, PersistentHistory_exports as PersistentHistory, PreparedInputAdmission_exports as PreparedInputAdmission, Receipt_exports as Receipt, Records_exports as Records, Recovery_exports as Recovery, Redaction_exports as Redaction, Remembering_exports as Remembering, RememberingStore_exports as RememberingStore, RunEvent_exports as RunEvent, RunEventSink_exports as RunEventSink, RunHooks_exports as RunHooks, RunJournal_exports as RunJournal, RunOptions_exports as RunOptions, RunPolicyUsage_exports as RunPolicyUsage, Sandbox_exports as Sandbox, Schedule_exports as Schedule, ScheduleTransition_exports as ScheduleTransition, Scheduling_exports as Scheduling, SemanticMemory_exports as SemanticMemory, SemanticMemoryIndex_exports as SemanticMemoryIndex, SemanticMemoryRevalidation_exports as SemanticMemoryRevalidation, Subagent_exports as Subagent, SubagentContract_exports as SubagentContract, SubagentHost_exports as SubagentHost, SubagentReservations_exports as SubagentReservations, SubmissionLedger_exports as SubmissionLedger, SubmissionStatus_exports as SubmissionStatus, Subscription_exports as Subscription, SubscriptionInput_exports as SubscriptionInput, SubscriptionTools_exports as SubscriptionTools, SubscriptionTransition_exports as SubscriptionTransition, Subscriptions_exports as Subscriptions, Thread_exports as Thread, ThreadContextHistory_exports as ThreadContextHistory, ThreadContextHistoryProjection_exports as ThreadContextHistoryProjection, ThreadHistory_exports as ThreadHistory, ThreadInvariants_exports as ThreadInvariants, ThreadProjection_exports as ThreadProjection, ThreadProjectionMaintenance_exports as ThreadProjectionMaintenance, ThreadStore_exports as ThreadStore, ToolBroker_exports as ToolBroker, ToolDiscovery_exports as ToolDiscovery, ToolExposure_exports as ToolExposure, ToolReconciler_exports as ToolReconciler, ToolResult_exports as ToolResult, Usage_exports as Usage, WakeScheduler_exports as WakeScheduler, WebCapture_exports as WebCapture, WebSearch_exports as WebSearch, Worker_exports as Worker, WorkerAdmission_exports as WorkerAdmission, WorkerHost_exports as WorkerHost };
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { Prompt, Tool } from "effect/unstable/ai";
|
|
2
|
+
import { Schema } from "effect";
|
|
3
|
+
//#region src/engine/internal/output-contract.ts
|
|
4
|
+
const outputFormatAnnotation = "@effect-agent/engine/Output/format";
|
|
5
|
+
/**
|
|
6
|
+
* Declare ordinary assistant text as an Agent's final-output wire format. Apply this to the
|
|
7
|
+
* complete output Schema after composing transformations. Its encoded type must be string;
|
|
8
|
+
* decoding, checks, transformations, and service requirements remain owned by that Schema.
|
|
9
|
+
* Text is preserved verbatim, including whitespace, quotes, and an empty reply when allowed.
|
|
10
|
+
* Required completion Tools still take precedence. Unmarked Schemas use JSON final output.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* output: Output.text(Schema.String.check(Schema.isMaxLength(20_000)))
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
const textOutput = (schema) => schema.annotate({ [outputFormatAnnotation]: "text" });
|
|
18
|
+
const isTextOutput = (schema) => Schema.resolveAnnotations(schema)?.[outputFormatAnnotation] === "text";
|
|
19
|
+
const contractDirective = (definition) => definition.completion === void 0 ? "Final output contract: when the task is complete, the final assistant message must be only JSON that is valid against this JSON Schema — no prose, no Markdown code fences, nothing before or after the JSON." : `Final output contract: when the task is complete without calling the "${definition.completion.tool}" completion Tool, the final assistant message must be only JSON that is valid against this JSON Schema — no prose, no Markdown code fences, nothing before or after the JSON. When calling the "${definition.completion.tool}" completion Tool, never place this private Agent output JSON in any Tool argument; follow the Tool's parameter schema instead. Call it as the sole application Tool Call, after receiving any other needed application Tool results. Completed provider Tool results may accompany it. The engine projects the successful completion Tool result into the Agent output.`;
|
|
20
|
+
const requiredCompletionDirective = (tool, hasAlternatives) => `Final output contract: ${hasAlternatives ? "otherwise complete" : "complete only"} by calling the required completion Tool ${JSON.stringify(tool)} as the sole application Tool Call in its batch. Completed provider Tool results may accompany it. Do not emit an ordinary final assistant text answer. The Tool's canonical parameters and successful result are projected and validated as the Agent output.`;
|
|
21
|
+
/**
|
|
22
|
+
* Render the model-visible final-output contract for one definition. The
|
|
23
|
+
* derivation and message identity are stable for an immutable definition.
|
|
24
|
+
* An output Schema the Effect AI derivation cannot represent is reported as
|
|
25
|
+
* `unrenderable`; the caller falls back to the prior behavior — the contract
|
|
26
|
+
* is guidance, and a Schema that decodes but does not render must not become
|
|
27
|
+
* a new failure mode.
|
|
28
|
+
*/
|
|
29
|
+
const rendered = (message) => ({
|
|
30
|
+
_tag: "rendered",
|
|
31
|
+
message,
|
|
32
|
+
part: Prompt.makeMessage("system", { content: message })
|
|
33
|
+
});
|
|
34
|
+
const renderOutputSchemaContract = (definition) => {
|
|
35
|
+
if (definition.completion?.required === true) return rendered(requiredCompletionDirective(definition.completion.tool, (definition.completionFromTools?.length ?? 0) > 0));
|
|
36
|
+
if (isTextOutput(definition.output)) return rendered("Final output contract: write the final reply as ordinary assistant text, without JSON wrapping. An empty reply is valid only when allowed by the output Schema and the task instructions." + (definition.completion === void 0 ? "" : ` When calling the "${definition.completion.tool}" completion Tool, follow its parameter schema instead and call it as the sole application Tool Call, after receiving any other needed application Tool results; completed provider Tool results may accompany it; the engine projects its successful result into the Agent output.`));
|
|
37
|
+
try {
|
|
38
|
+
const jsonSchema = Tool.getJsonSchemaFromSchema(definition.output);
|
|
39
|
+
return rendered(`${contractDirective(definition)}\n\n${JSON.stringify(jsonSchema, void 0, 2)}`);
|
|
40
|
+
} catch (cause) {
|
|
41
|
+
return {
|
|
42
|
+
_tag: "unrenderable",
|
|
43
|
+
reason: cause instanceof Error ? cause.message : String(cause)
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
const outputContracts = /* @__PURE__ */ new WeakMap();
|
|
48
|
+
const outputSchemaContract = (definition) => {
|
|
49
|
+
const cached = outputContracts.get(definition);
|
|
50
|
+
if (cached !== void 0) return cached;
|
|
51
|
+
const base = renderOutputSchemaContract(definition);
|
|
52
|
+
const alternatives = definition.completionFromTools ?? [];
|
|
53
|
+
const contract = base._tag === "rendered" && alternatives.length > 0 ? rendered(`The following action Tools may complete the Run from their successful canonical result: ${alternatives.map((declaration) => JSON.stringify(declaration.tool)).join(", ")}. Call such a Tool as the sole application Tool Call, following its parameter schema. Completed provider Tool results may accompany it. It may complete the Run only when it satisfies the whole request. An incomplete or pending result continues the Run. These actions are unavailable during finalization after budget exhaustion.
|
|
54
|
+
|
|
55
|
+
` + base.message) : base;
|
|
56
|
+
outputContracts.set(definition, contract);
|
|
57
|
+
return contract;
|
|
58
|
+
};
|
|
59
|
+
const sameSystemMessage = Schema.toEquivalence(Prompt.SystemMessage);
|
|
60
|
+
/**
|
|
61
|
+
* Keep supported system instructions in conversation order so changing late guidance
|
|
62
|
+
* cannot invalidate the preceding user/tool cache prefix. Omit an exact repeat
|
|
63
|
+
* only when no distinct system instruction intervened; returning to an earlier
|
|
64
|
+
* instruction after a different one must preserve the new directive's precedence.
|
|
65
|
+
* Anchor the immutable output contract after the initial system block.
|
|
66
|
+
* Restore leading static instructions for caller-supplied conversation-only history.
|
|
67
|
+
*
|
|
68
|
+
* This runs after preparation and compaction. Canonical messages, protected
|
|
69
|
+
* instruction/input spans and compaction coverage retain their original positions.
|
|
70
|
+
* Adapters without this capability retain the grouped-system projection: keep the
|
|
71
|
+
* last equivalent instruction with its native options, then the contract and
|
|
72
|
+
* conversation. This prevents older Anthropic adapters from discarding system groups.
|
|
73
|
+
*/
|
|
74
|
+
const prepareModelPrompt = (prompt, contract, systemMessagesInHistory, staticInstructions) => {
|
|
75
|
+
if (systemMessagesInHistory) {
|
|
76
|
+
const content = [];
|
|
77
|
+
let lastSystem;
|
|
78
|
+
let ordered = prompt.content;
|
|
79
|
+
if (staticInstructions !== void 0) {
|
|
80
|
+
const firstConversation = prompt.content.findIndex((message) => message.role !== "system");
|
|
81
|
+
const leading = prompt.content.slice(0, firstConversation === -1 ? prompt.content.length : firstConversation);
|
|
82
|
+
const restored = [];
|
|
83
|
+
const instructions = typeof staticInstructions === "string" ? [Prompt.systemMessage({ content: staticInstructions })] : Prompt.make(staticInstructions).content;
|
|
84
|
+
for (const message of instructions) {
|
|
85
|
+
if (message.role !== "system") break;
|
|
86
|
+
if (leading.some((candidate) => candidate.role === "system" && sameSystemMessage(candidate, message))) break;
|
|
87
|
+
const original = prompt.content.find((candidate) => candidate.role === "system" && sameSystemMessage(candidate, message));
|
|
88
|
+
if (original === void 0) break;
|
|
89
|
+
restored.push(original);
|
|
90
|
+
}
|
|
91
|
+
if (restored.length > 0) ordered = [
|
|
92
|
+
...leading,
|
|
93
|
+
...restored,
|
|
94
|
+
...prompt.content.slice(leading.length)
|
|
95
|
+
];
|
|
96
|
+
}
|
|
97
|
+
for (const message of ordered) {
|
|
98
|
+
if (message.role === "system") {
|
|
99
|
+
if (lastSystem !== void 0 && sameSystemMessage(lastSystem, message)) continue;
|
|
100
|
+
lastSystem = message;
|
|
101
|
+
}
|
|
102
|
+
content.push(message);
|
|
103
|
+
}
|
|
104
|
+
if (contract !== void 0) {
|
|
105
|
+
const firstConversation = content.findIndex((message) => message.role !== "system");
|
|
106
|
+
content.splice(firstConversation === -1 ? content.length : firstConversation, 0, contract);
|
|
107
|
+
}
|
|
108
|
+
return Prompt.fromMessages(content);
|
|
109
|
+
}
|
|
110
|
+
const systems = [];
|
|
111
|
+
const conversation = [];
|
|
112
|
+
const seen = /* @__PURE__ */ new Map();
|
|
113
|
+
for (let index = prompt.content.length - 1; index >= 0; index -= 1) {
|
|
114
|
+
const message = prompt.content[index];
|
|
115
|
+
if (message === void 0) continue;
|
|
116
|
+
if (message.role !== "system") {
|
|
117
|
+
conversation.push(message);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
const variants = seen.get(message.content);
|
|
121
|
+
if (variants?.some((previous) => sameSystemMessage(previous, message))) continue;
|
|
122
|
+
if (variants === void 0) seen.set(message.content, [message]);
|
|
123
|
+
else variants.push(message);
|
|
124
|
+
systems.push(message);
|
|
125
|
+
}
|
|
126
|
+
return Prompt.fromMessages([
|
|
127
|
+
...systems.reverse(),
|
|
128
|
+
...contract === void 0 ? [] : [contract],
|
|
129
|
+
...conversation.reverse()
|
|
130
|
+
]);
|
|
131
|
+
};
|
|
132
|
+
//#endregion
|
|
133
|
+
export { textOutput as i, outputSchemaContract as n, prepareModelPrompt as r, isTextOutput as t };
|
|
134
|
+
|
|
135
|
+
//# sourceMappingURL=output-contract-DS-S8mTv.mjs.map
|