effect-agent 0.1.0-beta.12 → 0.1.0-beta.121
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Agent-1DMSO_Fl.mjs +86 -0
- package/dist/Agent-1DMSO_Fl.mjs.map +1 -0
- package/dist/Agent-D9cXqfF3.d.mts +252 -0
- package/dist/AgentError-Bn1ytXRD.d.mts +117 -0
- package/dist/AgentPolicy-BqDoSXO6.d.mts +96 -0
- package/dist/AgentRuntime-BUxDdLpw.d.mts +346 -0
- package/dist/AgentRuntime-Cp1hAb-W.mjs +4739 -0
- package/dist/AgentRuntime-Cp1hAb-W.mjs.map +1 -0
- package/dist/AgentUpdates-DMJ-_xow.d.mts +53 -0
- package/dist/ContextCompactor-WwSIG_Z2.d.mts +161 -0
- package/dist/ContextWindow-DRQ5Mbm2.d.mts +58 -0
- package/dist/DurableAgentRuntime-B-9w7jDt.mjs +7061 -0
- package/dist/DurableAgentRuntime-B-9w7jDt.mjs.map +1 -0
- package/dist/DurableFailpoint-Cnr3wx1L.d.mts +41 -0
- package/dist/DurableStep-Cry_iol4.d.mts +103 -0
- package/dist/EventSource-CnlZ3Kma.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-Dkg87ebg.d.mts +221 -0
- package/dist/Messaging-JYYN3oYS.d.mts +1067 -0
- package/dist/MessagingHost-CqzpxbGz.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-V-6YL1_Z.d.mts +25 -0
- package/dist/PageCapture-Df8Xwskw.d.mts +583 -0
- package/dist/PageScreenshot-BpgZKAxl.d.mts +48 -0
- package/dist/PreparedInputAdmission-BQLGldl-.d.mts +42 -0
- package/dist/Receipt-BAHyigAF.d.mts +33 -0
- package/dist/Records-D88mgvyS.d.mts +4214 -0
- package/dist/RunEvent-DIrzkjLr.d.mts +460 -0
- package/dist/RunEventSink-D5aVhISG.d.mts +108 -0
- package/dist/RunJournal-BXrq0VIK.mjs +931 -0
- package/dist/RunJournal-BXrq0VIK.mjs.map +1 -0
- package/dist/RunOptions-CSBsSj0X.d.mts +935 -0
- package/dist/RunPolicyUsage-ClZxyR46.d.mts +21 -0
- package/dist/Sandbox-CEsDWBLq.d.mts +173 -0
- package/dist/Schedule-BIOHA6RR.d.mts +847 -0
- package/dist/Scheduling-DPb2QyAK.mjs +691 -0
- package/dist/Scheduling-DPb2QyAK.mjs.map +1 -0
- package/dist/Subagent-CNik9RiA.d.mts +1635 -0
- package/dist/Subagent-DCrB7an7.mjs +1498 -0
- package/dist/Subagent-DCrB7an7.mjs.map +1 -0
- package/dist/SubagentContract-DdT7Cqe6.d.mts +116 -0
- package/dist/SubagentHost-4WB8Hj0C.d.mts +164 -0
- package/dist/Subscription-CRteOKRf.d.mts +948 -0
- package/dist/SubscriptionInput-oNcwTPti.d.mts +41 -0
- package/dist/Thread-DOBQ0QUY.d.mts +96 -0
- package/dist/ThreadHistory-tS1KwxHR.d.mts +60 -0
- package/dist/ToolBroker-DWs4tZra.d.mts +133 -0
- package/dist/ToolExposure-9uF_Yo0T.mjs +10 -0
- package/dist/ToolExposure-9uF_Yo0T.mjs.map +1 -0
- package/dist/ToolExposure-C93U1sPu.mjs +30 -0
- package/dist/ToolExposure-C93U1sPu.mjs.map +1 -0
- package/dist/ToolExposure-UCN12eCd.d.mts +39 -0
- package/dist/ToolExposure-r2eOWk4F.d.mts +46 -0
- package/dist/ToolExposure.d.mts +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-Dx0aknfk.d.mts +121 -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-fwWkBg12.d.mts +472 -0
- package/dist/agent-registration-CKNsrpwo.mjs +201 -0
- package/dist/agent-registration-CKNsrpwo.mjs.map +1 -0
- package/dist/capabilities/Approval.d.mts +114 -0
- package/dist/capabilities/Approval.mjs +226 -0
- package/dist/capabilities/Approval.mjs.map +1 -0
- package/dist/capabilities/Budget.d.mts +112 -0
- package/dist/capabilities/Budget.mjs +346 -0
- package/dist/capabilities/Budget.mjs.map +1 -0
- package/dist/capabilities/CodeMode.d.mts +157 -0
- package/dist/capabilities/CodeMode.mjs +522 -0
- package/dist/capabilities/CodeMode.mjs.map +1 -0
- package/dist/capabilities/Commands.d.mts +55 -0
- package/dist/capabilities/Commands.mjs +57 -0
- package/dist/capabilities/Commands.mjs.map +1 -0
- package/dist/capabilities/ContextTools.d.mts +321 -0
- package/dist/capabilities/ContextTools.mjs +126 -0
- package/dist/capabilities/ContextTools.mjs.map +1 -0
- package/dist/capabilities/Mcp.d.mts +108 -0
- package/dist/capabilities/Mcp.mjs +259 -0
- package/dist/capabilities/Mcp.mjs.map +1 -0
- package/dist/capabilities/McpClient.d.mts +115 -0
- package/dist/capabilities/McpClient.mjs +506 -0
- package/dist/capabilities/McpClient.mjs.map +1 -0
- package/dist/capabilities/MemoryNotes.d.mts +424 -0
- package/dist/capabilities/MemoryNotes.mjs +128 -0
- package/dist/capabilities/MemoryNotes.mjs.map +1 -0
- package/dist/capabilities/Messaging.d.mts +3 -0
- package/dist/capabilities/Messaging.mjs +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 +124 -0
- package/dist/capabilities/ToolDiscovery.mjs +230 -0
- package/dist/capabilities/ToolDiscovery.mjs.map +1 -0
- package/dist/capabilities/WebCapture.d.mts +163 -0
- package/dist/capabilities/WebCapture.mjs +335 -0
- package/dist/capabilities/WebCapture.mjs.map +1 -0
- package/dist/capabilities/WebSearch.d.mts +71 -0
- package/dist/capabilities/WebSearch.mjs +115 -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 +94 -0
- package/dist/core/AgentPolicy.mjs.map +1 -0
- package/dist/core/AgentUpdates.d.mts +2 -0
- package/dist/core/AgentUpdates.mjs +63 -0
- package/dist/core/AgentUpdates.mjs.map +1 -0
- package/dist/core/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 +337 -0
- package/dist/core/RunEvent.mjs.map +1 -0
- package/dist/core/RunPolicyUsage.d.mts +2 -0
- package/dist/core/RunPolicyUsage.mjs +21 -0
- package/dist/core/RunPolicyUsage.mjs.map +1 -0
- package/dist/core/SemanticMemoryIndex.d.mts +826 -0
- package/dist/core/SemanticMemoryIndex.mjs +185 -0
- package/dist/core/SemanticMemoryIndex.mjs.map +1 -0
- package/dist/core/SemanticMemoryRevalidation.d.mts +45 -0
- package/dist/core/SemanticMemoryRevalidation.mjs +191 -0
- package/dist/core/SemanticMemoryRevalidation.mjs.map +1 -0
- package/dist/core/SubagentContract.d.mts +2 -0
- package/dist/core/SubagentContract.mjs +148 -0
- package/dist/core/SubagentContract.mjs.map +1 -0
- package/dist/core/Thread.d.mts +2 -0
- package/dist/core/Thread.mjs +250 -0
- package/dist/core/Thread.mjs.map +1 -0
- package/dist/core/ToolResult.d.mts +2 -0
- package/dist/core/ToolResult.mjs +156 -0
- package/dist/core/ToolResult.mjs.map +1 -0
- package/dist/core/Usage.d.mts +2 -0
- package/dist/core/Usage.mjs +319 -0
- package/dist/core/Usage.mjs.map +1 -0
- package/dist/core/Worker.d.mts +3 -0
- package/dist/core/Worker.mjs +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 +14 -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 +62 -0
- package/dist/durable/CommittedActivity.mjs +159 -0
- package/dist/durable/CommittedActivity.mjs.map +1 -0
- package/dist/durable/Digest.d.mts +2 -0
- package/dist/durable/Digest.mjs +50 -0
- package/dist/durable/Digest.mjs.map +1 -0
- package/dist/durable/DurableAgentRuntime.d.mts +3 -0
- package/dist/durable/DurableAgentRuntime.mjs +3 -0
- package/dist/durable/DurableFailpoint.d.mts +2 -0
- package/dist/durable/DurableFailpoint.mjs +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/MessageDelivery.d.mts +893 -0
- package/dist/durable/MessageDelivery.mjs +557 -0
- package/dist/durable/MessageDelivery.mjs.map +1 -0
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +378 -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 +848 -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 +54 -0
- package/dist/durable/Scheduling.mjs +2 -0
- package/dist/durable/SqlMemoryStore.d.mts +29 -0
- package/dist/durable/SqlMemoryStore.mjs +436 -0
- package/dist/durable/SqlMemoryStore.mjs.map +1 -0
- package/dist/durable/SqlMessageDeliveryStore.d.mts +42 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs +179 -0
- package/dist/durable/SqlMessageDeliveryStore.mjs.map +1 -0
- package/dist/durable/SqlStorageV2Upgrade.d.mts +21 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs +459 -0
- package/dist/durable/SqlStorageV2Upgrade.mjs.map +1 -0
- package/dist/durable/SqlSubscriptionStore.d.mts +62 -0
- package/dist/durable/SqlSubscriptionStore.mjs +751 -0
- package/dist/durable/SqlSubscriptionStore.mjs.map +1 -0
- package/dist/durable/SqlThreadNativeReads.d.mts +53 -0
- package/dist/durable/SqlThreadNativeReads.mjs +159 -0
- package/dist/durable/SqlThreadNativeReads.mjs.map +1 -0
- package/dist/durable/SubmissionLedger.d.mts +3 -0
- package/dist/durable/SubmissionLedger.mjs +959 -0
- package/dist/durable/SubmissionLedger.mjs.map +1 -0
- package/dist/durable/SubmissionLedgerConformance.d.mts +29 -0
- package/dist/durable/SubmissionLedgerConformance.mjs +2187 -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 +273 -0
- package/dist/durable/SubscriptionTools.mjs +190 -0
- package/dist/durable/SubscriptionTools.mjs.map +1 -0
- package/dist/durable/SubscriptionTransition.d.mts +21 -0
- package/dist/durable/SubscriptionTransition.mjs +148 -0
- package/dist/durable/SubscriptionTransition.mjs.map +1 -0
- package/dist/durable/Subscriptions.d.mts +73 -0
- package/dist/durable/Subscriptions.mjs +627 -0
- package/dist/durable/Subscriptions.mjs.map +1 -0
- package/dist/durable/ThreadContextHistory.d.mts +32 -0
- package/dist/durable/ThreadContextHistory.mjs +152 -0
- package/dist/durable/ThreadContextHistory.mjs.map +1 -0
- package/dist/durable/ThreadContextHistoryProjection.d.mts +60 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs +149 -0
- package/dist/durable/ThreadContextHistoryProjection.mjs.map +1 -0
- package/dist/durable/ThreadInvariants.d.mts +76 -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 +355 -0
- package/dist/durable/ThreadStore.mjs.map +1 -0
- package/dist/durable/ThreadStoreConformance.d.mts +28 -0
- package/dist/durable/ThreadStoreConformance.mjs +503 -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/WorkerHost.d.mts +129 -0
- package/dist/durable/WorkerHost.mjs +77 -0
- package/dist/durable/WorkerHost.mjs.map +1 -0
- package/dist/engine/AgentRuntime.d.mts +2 -0
- package/dist/engine/AgentRuntime.mjs +2 -0
- package/dist/engine/Compaction.d.mts +7 -0
- package/dist/engine/Compaction.mjs +16 -0
- package/dist/engine/Compaction.mjs.map +1 -0
- package/dist/engine/ContextCompactor.d.mts +2 -0
- package/dist/engine/ContextCompactor.mjs +119 -0
- package/dist/engine/ContextCompactor.mjs.map +1 -0
- package/dist/engine/ContextHistory.d.mts +65 -0
- package/dist/engine/ContextHistory.mjs +76 -0
- package/dist/engine/ContextHistory.mjs.map +1 -0
- package/dist/engine/ContextWindow.d.mts +2 -0
- package/dist/engine/ContextWindow.mjs +59 -0
- package/dist/engine/ContextWindow.mjs.map +1 -0
- package/dist/engine/DurableStep.d.mts +2 -0
- package/dist/engine/DurableStep.mjs +62 -0
- package/dist/engine/DurableStep.mjs.map +1 -0
- package/dist/engine/MessagingHost.d.mts +2 -0
- package/dist/engine/MessagingHost.mjs +2 -0
- package/dist/engine/Output.d.mts +2 -0
- package/dist/engine/Output.mjs +8 -0
- package/dist/engine/Output.mjs.map +1 -0
- package/dist/engine/RunEventSink.d.mts +2 -0
- package/dist/engine/RunEventSink.mjs +22 -0
- package/dist/engine/RunEventSink.mjs.map +1 -0
- package/dist/engine/RunOptions.d.mts +2 -0
- package/dist/engine/RunOptions.mjs +124 -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 +91 -6
- package/dist/index.mjs +100 -6
- package/dist/output-contract-BC7tjlGw.mjs +84 -0
- package/dist/output-contract-BC7tjlGw.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/dist/sandbox/CodeExecutor.d.mts +194 -0
- package/dist/sandbox/CodeExecutor.mjs +278 -0
- package/dist/sandbox/CodeExecutor.mjs.map +1 -0
- package/dist/sandbox/InteractiveBrowser.d.mts +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 +2 -0
- package/dist/sandbox/PageScreenshot.mjs +53 -0
- package/dist/sandbox/PageScreenshot.mjs.map +1 -0
- package/dist/sandbox/ProtectedBrowser.d.mts +283 -0
- package/dist/sandbox/ProtectedBrowser.mjs +298 -0
- package/dist/sandbox/ProtectedBrowser.mjs.map +1 -0
- package/dist/sandbox/Sandbox.d.mts +2 -0
- package/dist/sandbox/Sandbox.mjs +208 -0
- package/dist/sandbox/Sandbox.mjs.map +1 -0
- package/dist/utf8-BYfhEkcj.mjs +11 -0
- package/dist/utf8-BYfhEkcj.mjs.map +1 -0
- package/dist/utf8-DchGZRBd.mjs +23 -0
- package/dist/utf8-DchGZRBd.mjs.map +1 -0
- package/package.json +1 -40
- package/src/InMemory.ts +19 -0
- package/src/ToolExposure.ts +2 -0
- package/src/capabilities/Approval.ts +352 -0
- package/src/capabilities/Budget.ts +536 -0
- package/src/capabilities/CodeMode.ts +1090 -0
- package/src/capabilities/Commands.ts +86 -0
- package/src/capabilities/ContextTools.ts +184 -0
- package/src/capabilities/Mcp.ts +426 -0
- package/src/capabilities/McpClient.ts +967 -0
- package/src/capabilities/MemoryNotes.ts +174 -0
- package/src/capabilities/Messaging.ts +261 -0
- package/src/capabilities/ModelContext.ts +354 -0
- package/src/capabilities/Redaction.ts +157 -0
- package/src/capabilities/Remembering.ts +550 -0
- package/src/capabilities/RunHooks.ts +280 -0
- package/src/capabilities/SemanticMemory.ts +447 -0
- package/src/capabilities/Subagent.ts +2489 -0
- package/src/capabilities/SubagentReservations.ts +850 -0
- package/src/capabilities/ToolDiscovery.ts +369 -0
- package/src/capabilities/WebCapture.ts +722 -0
- package/src/capabilities/WebSearch.ts +190 -0
- package/src/capabilities/internal/subagent-background.ts +1273 -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 +602 -0
- package/src/core/AgentError.ts +172 -0
- package/src/core/AgentPolicy.ts +153 -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 +366 -0
- package/src/core/RunPolicyUsage.ts +17 -0
- package/src/core/SemanticMemoryIndex.ts +250 -0
- package/src/core/SemanticMemoryRevalidation.ts +254 -0
- package/src/core/SubagentContract.ts +196 -0
- package/src/core/Thread.ts +371 -0
- package/src/core/ToolExposure.ts +74 -0
- package/src/core/ToolResult.ts +190 -0
- package/src/core/Usage.ts +529 -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 +14 -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 +11275 -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/MessageDelivery.ts +832 -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 +1075 -0
- package/src/durable/Recovery.ts +1018 -0
- package/src/durable/RunJournal.ts +1631 -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 +778 -0
- package/src/durable/SqlMessageDeliveryStore.ts +335 -0
- package/src/durable/SqlStorageV2Upgrade.ts +500 -0
- package/src/durable/SqlSubscriptionStore.ts +1440 -0
- package/src/durable/SqlThreadNativeReads.ts +270 -0
- package/src/durable/SubmissionLedger.ts +1265 -0
- package/src/durable/SubmissionLedgerConformance.ts +4820 -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 +573 -0
- package/src/durable/ThreadStoreConformance.ts +1156 -0
- package/src/durable/ToolReconciler.ts +109 -0
- package/src/durable/WakeScheduler.ts +134 -0
- package/src/durable/WorkerHost.ts +171 -0
- package/src/durable/internal/agent-registration.ts +587 -0
- package/src/durable/internal/agent-updates.ts +302 -0
- package/src/durable/internal/foreign-diagnostic.ts +47 -0
- package/src/durable/internal/journal-checkpoint.ts +104 -0
- package/src/durable/internal/journal-metadata.ts +117 -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/storage-v2-layout.ts +163 -0
- package/src/durable/internal/storage-v2.ts +73 -0
- package/src/durable/internal/worker-host.ts +2885 -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 +1101 -0
- package/src/engine/SubagentHost.ts +230 -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 +10500 -0
- package/src/engine/internal/bounded-value.ts +315 -0
- package/src/engine/internal/compaction.ts +678 -0
- package/src/engine/internal/error-diagnostic.ts +39 -0
- package/src/engine/internal/output-contract.ts +173 -0
- package/src/engine/internal/primitive-delta.ts +80 -0
- package/src/engine/internal/provider-result-staging.ts +211 -0
- package/src/engine/internal/tool-derivative.ts +106 -0
- package/src/engine/internal/tool-exposure.ts +224 -0
- package/src/engine/internal/tool-telemetry.ts +484 -0
- package/src/index.ts +99 -21
- 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/ProtectedBrowser.ts +452 -0
- package/src/sandbox/Sandbox.ts +241 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import { AiError } from "effect/unstable/ai";
|
|
3
|
+
declare namespace ToolResult_d_exports {
|
|
4
|
+
export { ToolParameterRejection, ToolResultBounds, TruncatedToolResult, UnserializableToolResult, applyToolResultBounds, unserializableToolResult };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Engine-owned evidence that a fresh model call failed parameter validation.
|
|
8
|
+
* Retain the exact JSON arguments beside the native error so recovery can distinguish
|
|
9
|
+
* a rejected request from damaged executable parameters. This never authorizes execution.
|
|
10
|
+
*/
|
|
11
|
+
declare const ToolParameterRejection: Schema.Struct<{
|
|
12
|
+
readonly toolCallId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">;
|
|
13
|
+
readonly parameters: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
14
|
+
readonly error: Schema.toEncoded<Schema.Struct<{
|
|
15
|
+
readonly _tag: Schema.tag<"AiError">;
|
|
16
|
+
readonly module: Schema.String;
|
|
17
|
+
readonly method: Schema.String;
|
|
18
|
+
readonly reason: typeof AiError.ToolParameterValidationError;
|
|
19
|
+
}>>;
|
|
20
|
+
}>;
|
|
21
|
+
type ToolParameterRejection = typeof ToolParameterRejection.Type;
|
|
22
|
+
declare const ToolResultBounds_base: Schema.Class<ToolResultBounds, Schema.Struct<{
|
|
23
|
+
readonly maxBytes: Schema.Int;
|
|
24
|
+
}>, {}>;
|
|
25
|
+
/** Byte bound applied to one encoded application Tool result before it enters history. */
|
|
26
|
+
declare class ToolResultBounds extends ToolResultBounds_base {}
|
|
27
|
+
declare const TruncatedToolResult_base: Schema.Class<TruncatedToolResult, Schema.Struct<{
|
|
28
|
+
readonly truncatedToolResult: Schema.Literal<true>;
|
|
29
|
+
readonly originalBytes: Schema.Natural;
|
|
30
|
+
readonly head: Schema.String;
|
|
31
|
+
readonly tail: Schema.String;
|
|
32
|
+
}>, {}>;
|
|
33
|
+
/**
|
|
34
|
+
* Canonical envelope replacing an encoded Tool result that exceeded its
|
|
35
|
+
* policy bounds. `head` and `tail` are an exact prefix and suffix of the
|
|
36
|
+
* original encoded JSON text; the middle is dropped, never paraphrased.
|
|
37
|
+
*/
|
|
38
|
+
declare class TruncatedToolResult extends TruncatedToolResult_base {}
|
|
39
|
+
declare const UnserializableToolResult_base: Schema.Class<UnserializableToolResult, Schema.Struct<{
|
|
40
|
+
readonly unserializableToolResult: Schema.Literal<true>;
|
|
41
|
+
readonly reason: Schema.String;
|
|
42
|
+
}>, {}>;
|
|
43
|
+
/**
|
|
44
|
+
* Canonical fail-closed sentinel replacing an encoded Tool result that could
|
|
45
|
+
* not be JSON-serialized at all (cyclic value, BigInt, `undefined`, throwing
|
|
46
|
+
* `toJSON`). The original value never enters history or durable records —
|
|
47
|
+
* an unserializable value is unbounded by construction, so the bound seam
|
|
48
|
+
* replaces it wholesale rather than passing it through (runtime spec §9).
|
|
49
|
+
*/
|
|
50
|
+
declare class UnserializableToolResult extends UnserializableToolResult_base {}
|
|
51
|
+
/**
|
|
52
|
+
* Build the encoded sentinel for a serialization failure. Total by
|
|
53
|
+
* construction — the cause is untrusted (a hostile `toString` or an
|
|
54
|
+
* accessor-backed `Error.message` can itself throw on this last-resort
|
|
55
|
+
* path) — and byte-bound: the complete encoded sentinel stays within the
|
|
56
|
+
* 256-byte `ToolResultBounds` schema floor, so it fits every accepted
|
|
57
|
+
* policy without the caller re-applying bounds.
|
|
58
|
+
*/
|
|
59
|
+
declare const unserializableToolResult: (cause: unknown) => typeof UnserializableToolResult.Encoded;
|
|
60
|
+
/**
|
|
61
|
+
* Bound one encoded Tool result to `bounds.maxBytes` UTF-8 bytes.
|
|
62
|
+
*
|
|
63
|
+
* Within bounds the input is returned unchanged. Over bounds the result is
|
|
64
|
+
* the JSON-encoded `TruncatedToolResult` envelope preserving an exact prefix
|
|
65
|
+
* and suffix of the input, split ~50/50 across the byte budget left after
|
|
66
|
+
* the envelope's own overhead and shrunk deterministically until the encoded
|
|
67
|
+
* envelope itself fits. Slicing never splits a UTF-16 surrogate pair, so the
|
|
68
|
+
* envelope always re-encodes as valid JSON.
|
|
69
|
+
*
|
|
70
|
+
* The Schema-level 256-byte floor on `ToolResultBounds.maxBytes` guarantees
|
|
71
|
+
* every accepted bound fits the minimal envelope (at most 81 bytes), so the
|
|
72
|
+
* returned value never exceeds `maxBytes` for a decodable bound. The
|
|
73
|
+
* minimal-envelope fallback below survives purely as defense in depth.
|
|
74
|
+
*/
|
|
75
|
+
declare const applyToolResultBounds: (encodedJson: string, bounds: ToolResultBounds) => string;
|
|
76
|
+
//#endregion
|
|
77
|
+
export { UnserializableToolResult as a, TruncatedToolResult as i, ToolResultBounds as n, applyToolResultBounds as o, ToolResult_d_exports as r, unserializableToolResult as s, ToolParameterRejection as t };
|
|
78
|
+
//# sourceMappingURL=ToolResult-BKdqWRff.d.mts.map
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { Effect, Schema } from "effect";
|
|
2
|
+
declare namespace Usage_d_exports {
|
|
3
|
+
export { ChildRunUsage, InputTokenUsage, ModelCallUsage, ModelResponseIdentity, ModelUsageGroup, OutputTokenUsage, RunTotals, RunUsageReport, RunUsageSummary, UsageAggregationError, UsageCompleteness, emptyRunTotals, runTotalsFromSummary, sumRunTotals, summarizeModelUsage, unknownRunTotals };
|
|
4
|
+
}
|
|
5
|
+
declare const ModelResponseIdentity_base: Schema.Class<ModelResponseIdentity, Schema.Struct<{
|
|
6
|
+
readonly id: Schema.optionalKey<Schema.NonEmptyString>;
|
|
7
|
+
readonly model: Schema.optionalKey<Schema.NonEmptyString>;
|
|
8
|
+
}>, {}>;
|
|
9
|
+
/** Bounded provider response identity. Request configuration is not response evidence. */
|
|
10
|
+
declare class ModelResponseIdentity extends ModelResponseIdentity_base {}
|
|
11
|
+
/** Missing legacy status means unknown, never a free call or a complete report. */
|
|
12
|
+
declare const UsageCompleteness: Schema.Literals<readonly ["complete", "partial", "unknown"]>;
|
|
13
|
+
declare const InputTokenUsage_base: Schema.Class<InputTokenUsage, Schema.Struct<{
|
|
14
|
+
readonly total: Schema.Natural;
|
|
15
|
+
readonly uncached: Schema.Natural;
|
|
16
|
+
readonly cacheRead: Schema.Natural;
|
|
17
|
+
readonly cacheWrite: Schema.Natural;
|
|
18
|
+
}>, {}>;
|
|
19
|
+
/** Provider-reported input-token components for one completed model call. */
|
|
20
|
+
declare class InputTokenUsage extends InputTokenUsage_base {}
|
|
21
|
+
declare const OutputTokenUsage_base: Schema.Class<OutputTokenUsage, Schema.Struct<{
|
|
22
|
+
readonly total: Schema.Natural;
|
|
23
|
+
readonly text: Schema.Natural;
|
|
24
|
+
readonly reasoning: Schema.Natural;
|
|
25
|
+
}>, {}>;
|
|
26
|
+
/** Provider-reported output-token components for one completed model call. */
|
|
27
|
+
declare class OutputTokenUsage extends OutputTokenUsage_base {}
|
|
28
|
+
declare const ModelCallUsage_base: Schema.Class<ModelCallUsage, Schema.Struct<{
|
|
29
|
+
readonly provider: Schema.NonEmptyString;
|
|
30
|
+
/** Configured binding identity. See response.model for provider-reported identity. */
|
|
31
|
+
readonly model: Schema.NonEmptyString;
|
|
32
|
+
readonly serviceTier: Schema.optionalKey<Schema.NonEmptyString>;
|
|
33
|
+
readonly pricingVersion: Schema.optionalKey<Schema.NonEmptyString>;
|
|
34
|
+
readonly response: Schema.optionalKey<typeof ModelResponseIdentity>;
|
|
35
|
+
readonly purpose: Schema.optionalKey<Schema.Literals<readonly ["turn", "summary"]>>;
|
|
36
|
+
readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
|
|
37
|
+
readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["estimated", "unknown"]>>;
|
|
38
|
+
readonly inputTokens: typeof InputTokenUsage;
|
|
39
|
+
readonly outputTokens: typeof OutputTokenUsage;
|
|
40
|
+
readonly costMicrousd: Schema.Natural;
|
|
41
|
+
}>, {}>;
|
|
42
|
+
/** Canonical, provider-independent accounting for one completed model call. */
|
|
43
|
+
declare class ModelCallUsage extends ModelCallUsage_base {}
|
|
44
|
+
declare const RunTotals_base: Schema.Class<RunTotals, Schema.Struct<{
|
|
45
|
+
readonly modelCalls: Schema.Natural;
|
|
46
|
+
readonly inputTokens: Schema.Natural;
|
|
47
|
+
readonly outputTokens: Schema.Natural;
|
|
48
|
+
readonly costMicrousd: Schema.Natural;
|
|
49
|
+
readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
|
|
50
|
+
readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
|
|
51
|
+
readonly unobservedModelCalls: Schema.optionalKey<Schema.Natural>;
|
|
52
|
+
}>, {}>;
|
|
53
|
+
/**
|
|
54
|
+
* Observed model usage and estimated cost, without per-model attribution.
|
|
55
|
+
* Numeric zero with unknown coverage never establishes free execution. Missing legacy
|
|
56
|
+
* statuses mean unknown. Unobserved calls are excluded from the numeric call/token totals.
|
|
57
|
+
*/
|
|
58
|
+
declare class RunTotals extends RunTotals_base {}
|
|
59
|
+
declare const RunUsageReport_base: Schema.Class<RunUsageReport, Schema.Struct<{
|
|
60
|
+
readonly usage: typeof RunTotals;
|
|
61
|
+
readonly delegatedUsage: typeof RunTotals;
|
|
62
|
+
}>, {}>;
|
|
63
|
+
/** Own Run usage and disjoint attached-descendant usage. Add each component once. */
|
|
64
|
+
declare class RunUsageReport extends RunUsageReport_base {}
|
|
65
|
+
declare const ChildRunUsage_base: Schema.Class<ChildRunUsage, Schema.Struct<{
|
|
66
|
+
readonly runId: Schema.brand<Schema.NonEmptyString, "@effect-agent/core/RunId">;
|
|
67
|
+
readonly report: typeof RunUsageReport;
|
|
68
|
+
}>, {}>;
|
|
69
|
+
/** A verified child report retained across durable parent Attempts. */
|
|
70
|
+
declare class ChildRunUsage extends ChildRunUsage_base {}
|
|
71
|
+
/** Known absence of observed work. */
|
|
72
|
+
declare const emptyRunTotals: () => RunTotals;
|
|
73
|
+
/** No accounting evidence, including legacy child reports. This is not known zero spend. */
|
|
74
|
+
declare const unknownRunTotals: () => RunTotals;
|
|
75
|
+
declare const ModelUsageGroup_base: Schema.Class<ModelUsageGroup, Schema.Struct<{
|
|
76
|
+
readonly provider: Schema.NonEmptyString;
|
|
77
|
+
readonly model: Schema.NonEmptyString;
|
|
78
|
+
/** Actual returned model; absent when only the configured binding is known. */
|
|
79
|
+
readonly responseModel: Schema.optionalKey<Schema.NonEmptyString>;
|
|
80
|
+
readonly serviceTier: Schema.optionalKey<Schema.NonEmptyString>;
|
|
81
|
+
readonly pricingVersion: Schema.optionalKey<Schema.NonEmptyString>;
|
|
82
|
+
readonly modelCalls: Schema.Natural;
|
|
83
|
+
readonly inputTokens: typeof InputTokenUsage;
|
|
84
|
+
readonly outputTokens: typeof OutputTokenUsage;
|
|
85
|
+
readonly costMicrousd: Schema.Natural;
|
|
86
|
+
}>, {}>;
|
|
87
|
+
/** Settlement-sized aggregate for calls sharing one pricing identity. */
|
|
88
|
+
declare class ModelUsageGroup extends ModelUsageGroup_base {}
|
|
89
|
+
declare const RunUsageSummary_base: Schema.Class<RunUsageSummary, Schema.Struct<{
|
|
90
|
+
readonly modelCalls: Schema.Natural;
|
|
91
|
+
readonly inputTokens: typeof InputTokenUsage;
|
|
92
|
+
readonly outputTokens: typeof OutputTokenUsage;
|
|
93
|
+
readonly costMicrousd: Schema.Natural;
|
|
94
|
+
readonly byModel: Schema.$Array<typeof ModelUsageGroup>;
|
|
95
|
+
/** Coverage of recorded calls only; interruptions can make the Run less complete. */
|
|
96
|
+
readonly usageStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
|
|
97
|
+
readonly pricingStatus: Schema.optionalKey<Schema.Literals<readonly ["complete", "partial", "unknown"]>>;
|
|
98
|
+
/** Observed invocations without retained accounting, excluded from numeric call/token totals. */
|
|
99
|
+
readonly unobservedModelCalls: Schema.optionalKey<Schema.Natural>;
|
|
100
|
+
}>, {}>;
|
|
101
|
+
/** Settlement aggregate included with a terminal Run settlement. */
|
|
102
|
+
declare class RunUsageSummary extends RunUsageSummary_base {}
|
|
103
|
+
declare const UsageAggregationError_base: Schema.Class<UsageAggregationError, Schema.TaggedStruct<"UsageAggregationError", {
|
|
104
|
+
readonly field: Schema.NonEmptyString;
|
|
105
|
+
readonly message: Schema.String;
|
|
106
|
+
}>, import("effect/Cause").YieldableError>;
|
|
107
|
+
/** Canonical usage could not be aggregated without exceeding safe-integer accounting. */
|
|
108
|
+
declare class UsageAggregationError extends UsageAggregationError_base {}
|
|
109
|
+
/** Combine disjoint totals, retaining uncertainty and rejecting numeric overflow. */
|
|
110
|
+
declare const sumRunTotals: (contributions: readonly RunTotals[]) => Effect.Effect<RunTotals, UsageAggregationError, never>;
|
|
111
|
+
/** Flatten a canonical settlement summary without discarding its coverage markers. */
|
|
112
|
+
declare const runTotalsFromSummary: (summary: RunUsageSummary) => RunTotals;
|
|
113
|
+
/**
|
|
114
|
+
* Deterministically aggregate canonical per-call usage without making cached tokens free.
|
|
115
|
+
* A validated seed retains earlier call totals and pricing groups without retaining those calls.
|
|
116
|
+
* Empty contributions do not change completeness; the seed is never mutated.
|
|
117
|
+
*/
|
|
118
|
+
declare const summarizeModelUsage: (calls: readonly ModelCallUsage[], seed?: RunUsageSummary | undefined) => Effect.Effect<RunUsageSummary, UsageAggregationError, never>;
|
|
119
|
+
//#endregion
|
|
120
|
+
export { unknownRunTotals as _, ModelUsageGroup as a, RunUsageReport as c, UsageCompleteness as d, Usage_d_exports as f, summarizeModelUsage as g, sumRunTotals as h, ModelResponseIdentity as i, RunUsageSummary as l, runTotalsFromSummary as m, InputTokenUsage as n, OutputTokenUsage as o, emptyRunTotals as p, ModelCallUsage as r, RunTotals as s, ChildRunUsage as t, UsageAggregationError as u };
|
|
121
|
+
//# sourceMappingURL=Usage-Dx0aknfk.d.mts.map
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
+
import { Context, Effect, Layer, Scope, Stream } from "effect";
|
|
3
|
+
declare namespace WakeScheduler_d_exports {
|
|
4
|
+
export { WakeScheduler, WakeSubscriptionHub, makeWakeSubscriptionHub };
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Incarnation-local, thread-keyed wake registrations. A registration is installed before
|
|
8
|
+
* its returned Effect can be awaited, which lets a caller subscribe, check durable authority,
|
|
9
|
+
* and then park without a lost-wakeup window.
|
|
10
|
+
*/
|
|
11
|
+
interface WakeSubscriptionHub {
|
|
12
|
+
/** Register one Scope-owned waiter and return its one-shot wake Effect. */
|
|
13
|
+
readonly subscribe: (threadId: ThreadId) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
|
|
14
|
+
/** Wake every currently registered waiter for exactly this Thread. */
|
|
15
|
+
readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Build the shared per-incarnation registration primitive used by host WakeSchedulers. The hub
|
|
19
|
+
* contains hints only: eviction may discard it, while a reconnecting caller re-subscribes and
|
|
20
|
+
* rechecks canonical storage. Scope finalizers remove cancelled waiters, and notify broadcasts
|
|
21
|
+
* instead of consuming a signal that belongs to another waiter.
|
|
22
|
+
*/
|
|
23
|
+
declare const makeWakeSubscriptionHub: Effect.Effect<WakeSubscriptionHub>;
|
|
24
|
+
declare const WakeScheduler_base: Context.ServiceClass<WakeScheduler, "@effect-agent/thread/WakeScheduler", {
|
|
25
|
+
/** Best-effort hint that `threadId` may have claimable or settled work. Never fails. */
|
|
26
|
+
readonly notify: (threadId: ThreadId) => Effect.Effect<void>;
|
|
27
|
+
/** Scope-owned one-shot registration for exactly one Thread. */
|
|
28
|
+
readonly subscribe: (threadId: ThreadId) => Effect.Effect<Effect.Effect<void>, never, Scope.Scope>;
|
|
29
|
+
/** Scope-owned subscription to wake hints, starting at subscription time. */
|
|
30
|
+
readonly wakes: Stream.Stream<ThreadId>;
|
|
31
|
+
}>;
|
|
32
|
+
/**
|
|
33
|
+
* Liveness hint channel for durable schedulers. `notify` announces that a Thread lane may
|
|
34
|
+
* have claimable, canonical, or settled work; `wakes` is the all-lanes subscription surface for
|
|
35
|
+
* workers, while `subscribe` installs an efficient one-Thread wait registration.
|
|
36
|
+
*
|
|
37
|
+
* Correctness must NEVER depend on delivery: notifications may be dropped, coalesced, duplicated,
|
|
38
|
+
* or observed by no subscriber (a notify before any subscription is simply lost). Every consumer
|
|
39
|
+
* must pair a wake with durable authority: workers use periodic SubmissionLedger scans, while a
|
|
40
|
+
* public progress waiter subscribes before its canonical read and reconnects/rechecks after an
|
|
41
|
+
* incarnation loss (persistence §14).
|
|
42
|
+
*
|
|
43
|
+
* Each run of `wakes` creates its own subscription whose resources live in that run's Scope and
|
|
44
|
+
* are released when the consuming stream ends or is interrupted. Implementations must not spawn
|
|
45
|
+
* daemon fibers.
|
|
46
|
+
*/
|
|
47
|
+
declare class WakeScheduler extends WakeScheduler_base {
|
|
48
|
+
/**
|
|
49
|
+
* Discards every notification and never wakes anyone. Valid because WakeScheduler is only a
|
|
50
|
+
* liveness hint: consumers relying on ledger scans stay correct, merely slower.
|
|
51
|
+
*/
|
|
52
|
+
static readonly layerNoop: Layer.Layer<WakeScheduler>;
|
|
53
|
+
}
|
|
54
|
+
//#endregion
|
|
55
|
+
export { makeWakeSubscriptionHub as i, WakeScheduler_d_exports as n, WakeSubscriptionHub as r, WakeScheduler as t };
|
|
56
|
+
//# sourceMappingURL=WakeScheduler-EjUF-GhC.d.mts.map
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
+
import { AgentId, DelegationId, RunId, SettlementId, ThreadId, ToolCallId } from "./core/Identifiers.mjs";
|
|
3
|
+
import { AgentPolicy } from "./core/AgentPolicy.mjs";
|
|
4
|
+
import { IdempotencyKey, Receipt } from "./core/Receipt.mjs";
|
|
5
|
+
import { Update } from "./core/AgentUpdates.mjs";
|
|
6
|
+
import { o as Value } from "./FailureDiagnostic-BElLOoED.mjs";
|
|
7
|
+
import { SubagentExecutionFailure, SubagentGrant, WorkerOperationTool } from "./core/SubagentContract.mjs";
|
|
8
|
+
import { Schema } from "effect";
|
|
9
|
+
//#region src/core/internal/message-status.ts
|
|
10
|
+
/** A retained outbound delivery identity, not a destination Receipt or access grant. */
|
|
11
|
+
const MessageRef = Schema.Struct({
|
|
12
|
+
ownerThreadId: ThreadId,
|
|
13
|
+
messageId: IdempotencyKey
|
|
14
|
+
});
|
|
15
|
+
const Reason = Schema.NonEmptyString.check(Schema.isMaxLength(256));
|
|
16
|
+
const identity = { message: MessageRef };
|
|
17
|
+
/**
|
|
18
|
+
* Source-owned delivery evidence. Pending confirms retention only; accepted supplies the
|
|
19
|
+
* destination Receipt, and processed supplies its canonical settlement. Neither retention nor
|
|
20
|
+
* acceptance proves execution. Refused is a definite rejection; parked stops automatic retry
|
|
21
|
+
* while retaining the same identity and any acceptance evidence. Inspect instead of resending.
|
|
22
|
+
*/
|
|
23
|
+
const MessageStatus = Schema.Union([
|
|
24
|
+
Schema.Struct({
|
|
25
|
+
...identity,
|
|
26
|
+
status: Schema.Literal("pending"),
|
|
27
|
+
receipt: Schema.Null,
|
|
28
|
+
settlement: Schema.Null,
|
|
29
|
+
reason: Schema.NullOr(Reason)
|
|
30
|
+
}),
|
|
31
|
+
Schema.Struct({
|
|
32
|
+
...identity,
|
|
33
|
+
status: Schema.Literal("accepted"),
|
|
34
|
+
receipt: Receipt,
|
|
35
|
+
settlement: Schema.Null,
|
|
36
|
+
reason: Schema.NullOr(Reason)
|
|
37
|
+
}),
|
|
38
|
+
Schema.Struct({
|
|
39
|
+
...identity,
|
|
40
|
+
status: Schema.Literal("processed"),
|
|
41
|
+
receipt: Receipt,
|
|
42
|
+
settlement: Schema.Struct({
|
|
43
|
+
settlementId: SettlementId,
|
|
44
|
+
outcome: Schema.Literals([
|
|
45
|
+
"completed",
|
|
46
|
+
"failed",
|
|
47
|
+
"aborted"
|
|
48
|
+
])
|
|
49
|
+
}),
|
|
50
|
+
reason: Schema.Null
|
|
51
|
+
}),
|
|
52
|
+
Schema.Struct({
|
|
53
|
+
...identity,
|
|
54
|
+
status: Schema.Literal("refused"),
|
|
55
|
+
receipt: Schema.Null,
|
|
56
|
+
settlement: Schema.Null,
|
|
57
|
+
reason: Reason
|
|
58
|
+
}),
|
|
59
|
+
Schema.Struct({
|
|
60
|
+
...identity,
|
|
61
|
+
status: Schema.Literal("parked"),
|
|
62
|
+
receipt: Schema.NullOr(Receipt),
|
|
63
|
+
settlement: Schema.Null,
|
|
64
|
+
reason: Reason
|
|
65
|
+
})
|
|
66
|
+
]);
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/core/Worker.ts
|
|
69
|
+
var Worker_exports = /* @__PURE__ */ __exportAll({
|
|
70
|
+
AssignmentDisposition: () => AssignmentDisposition,
|
|
71
|
+
AssignmentTerminal: () => AssignmentTerminal,
|
|
72
|
+
FrameworkMessage: () => FrameworkMessage,
|
|
73
|
+
WorkerAppliedInput: () => WorkerAppliedInput,
|
|
74
|
+
WorkerBudgetScope: () => WorkerBudgetScope,
|
|
75
|
+
WorkerCompletion: () => WorkerCompletion,
|
|
76
|
+
WorkerContext: () => WorkerContext,
|
|
77
|
+
WorkerError: () => WorkerError,
|
|
78
|
+
WorkerHistoryEntry: () => WorkerHistoryEntry,
|
|
79
|
+
WorkerInput: () => WorkerInput,
|
|
80
|
+
WorkerOperationTool: () => WorkerOperationTool,
|
|
81
|
+
WorkerPage: () => WorkerPage,
|
|
82
|
+
WorkerRef: () => WorkerRef,
|
|
83
|
+
WorkerReport: () => WorkerReport,
|
|
84
|
+
WorkerRun: () => WorkerRun,
|
|
85
|
+
WorkerSource: () => WorkerSource,
|
|
86
|
+
WorkerStarted: () => WorkerStarted,
|
|
87
|
+
WorkerStop: () => WorkerStop,
|
|
88
|
+
WorkerStopped: () => WorkerStopped,
|
|
89
|
+
WorkerSummary: () => WorkerSummary,
|
|
90
|
+
WorkerUpdate: () => WorkerUpdate
|
|
91
|
+
});
|
|
92
|
+
/** Assignment output selected through the Definition's runDisposition declaration. */
|
|
93
|
+
const AssignmentDisposition = Schema.Literals(["completed", "waiting"]);
|
|
94
|
+
/** A permanent destination outcome; an ordinary Run completion does not imply this. */
|
|
95
|
+
const AssignmentTerminal = Schema.Literals([
|
|
96
|
+
"completed",
|
|
97
|
+
"failed",
|
|
98
|
+
"cancelled"
|
|
99
|
+
]);
|
|
100
|
+
/** A reusable child Thread, correlated with its declaration. This value grants no authority. */
|
|
101
|
+
const WorkerRef = Schema.Struct({
|
|
102
|
+
schemaVersion: Schema.Literal(1),
|
|
103
|
+
delegationId: DelegationId,
|
|
104
|
+
targetAgentId: AgentId,
|
|
105
|
+
threadId: ThreadId
|
|
106
|
+
});
|
|
107
|
+
/** A continuing worker identity and retained first delivery, never an execution handle. */
|
|
108
|
+
const WorkerStarted = Schema.Struct({
|
|
109
|
+
worker: WorkerRef,
|
|
110
|
+
delivery: MessageStatus
|
|
111
|
+
}).check(Schema.makeFilter(({ worker, delivery }) => delivery.receipt === null || worker.threadId === delivery.receipt.threadId));
|
|
112
|
+
/** Stable owner command. Reusing its key for a different worker conflicts. */
|
|
113
|
+
const WorkerStop = Schema.Struct({
|
|
114
|
+
worker: WorkerRef,
|
|
115
|
+
idempotencyKey: IdempotencyKey
|
|
116
|
+
});
|
|
117
|
+
/** The inbox is sealed and active execution has released ownership. External actions are not undone. */
|
|
118
|
+
const WorkerStopped = WorkerStop;
|
|
119
|
+
/** A host-authorized Run allowance is independent of the immutable delegation lineage. */
|
|
120
|
+
const WorkerBudgetScope = Schema.Literals(["source-subtree", "worker-run"]);
|
|
121
|
+
/** Host-bound caller metadata. Programmatic calls never fabricate Run or Tool Call identities. */
|
|
122
|
+
const WorkerSource = Schema.Union([Schema.Struct({
|
|
123
|
+
_tag: Schema.Literal("tool"),
|
|
124
|
+
agentId: AgentId,
|
|
125
|
+
threadId: ThreadId,
|
|
126
|
+
runId: RunId,
|
|
127
|
+
toolCallId: ToolCallId
|
|
128
|
+
}), Schema.Struct({
|
|
129
|
+
_tag: Schema.Literal("programmatic"),
|
|
130
|
+
agentId: AgentId,
|
|
131
|
+
threadId: ThreadId
|
|
132
|
+
})]);
|
|
133
|
+
/** The caller's effective policy and root-relative depth, resolved by its host. */
|
|
134
|
+
const WorkerContext = Schema.Struct({
|
|
135
|
+
source: WorkerSource,
|
|
136
|
+
policy: AgentPolicy,
|
|
137
|
+
depth: Schema.Natural,
|
|
138
|
+
grant: Schema.optionalKey(SubagentGrant)
|
|
139
|
+
});
|
|
140
|
+
/** Admission identity is distinct from canonical input application. */
|
|
141
|
+
const WorkerInput = Schema.Struct({
|
|
142
|
+
receipt: Receipt,
|
|
143
|
+
messageId: IdempotencyKey
|
|
144
|
+
});
|
|
145
|
+
const WorkerAppliedInput = Schema.Struct({
|
|
146
|
+
...WorkerInput.fields,
|
|
147
|
+
runId: RunId,
|
|
148
|
+
sequence: Schema.Natural
|
|
149
|
+
});
|
|
150
|
+
/** A Run outcome is not assignment completion. Interpret only a Definition's disposition. */
|
|
151
|
+
const WorkerRun = Schema.Struct({
|
|
152
|
+
runId: RunId,
|
|
153
|
+
hostReceipt: Receipt,
|
|
154
|
+
outcome: Schema.NullOr(Schema.Literals([
|
|
155
|
+
"completed",
|
|
156
|
+
"failed",
|
|
157
|
+
"aborted"
|
|
158
|
+
])),
|
|
159
|
+
disposition: Schema.NullOr(Schema.Json)
|
|
160
|
+
});
|
|
161
|
+
/** Bounded durable listing data; a latest Receipt never substitutes for a requested Receipt. */
|
|
162
|
+
const WorkerSummary = Schema.Struct({
|
|
163
|
+
worker: WorkerRef,
|
|
164
|
+
latestReceipt: Schema.NullOr(Receipt),
|
|
165
|
+
/** stopping/stopped identify an owner-issued worker stop, never an ordinary Receipt abort. */
|
|
166
|
+
state: Schema.Literals([
|
|
167
|
+
"starting",
|
|
168
|
+
"active",
|
|
169
|
+
"idle",
|
|
170
|
+
"stopping",
|
|
171
|
+
"stopped",
|
|
172
|
+
"completed",
|
|
173
|
+
"failed",
|
|
174
|
+
"cancelled"
|
|
175
|
+
]),
|
|
176
|
+
acceptedInput: Schema.NullOr(WorkerInput),
|
|
177
|
+
appliedInput: Schema.NullOr(WorkerAppliedInput),
|
|
178
|
+
run: Schema.NullOr(WorkerRun),
|
|
179
|
+
/** One retained unadmitted input, if any; its state is independent of destination execution. */
|
|
180
|
+
pendingDelivery: Schema.NullOr(MessageStatus),
|
|
181
|
+
/** Consistent destination facts; pending delivery has its own source-owned version. */
|
|
182
|
+
watermark: Schema.Struct({
|
|
183
|
+
canonicalSequence: Schema.Natural,
|
|
184
|
+
acceptedQueueSequence: Schema.Natural,
|
|
185
|
+
pendingDeliveryVersion: Schema.NullOr(Schema.Natural)
|
|
186
|
+
})
|
|
187
|
+
});
|
|
188
|
+
const WorkerPage = Schema.Struct({
|
|
189
|
+
items: Schema.Array(WorkerSummary).check(Schema.isMaxLength(100)),
|
|
190
|
+
next: Schema.NullOr(ThreadId)
|
|
191
|
+
});
|
|
192
|
+
/** Authorized canonical history, encoded independently of storage-adapter representations. */
|
|
193
|
+
const WorkerHistoryEntry = Schema.Struct({
|
|
194
|
+
sequence: Schema.Natural.check(Schema.isGreaterThan(0)),
|
|
195
|
+
recordId: Schema.NonEmptyString.check(Schema.isMaxLength(1024)),
|
|
196
|
+
record: Schema.Json
|
|
197
|
+
});
|
|
198
|
+
/**
|
|
199
|
+
* Closed host-boundary failures. Original causes stay private and survive diagnostic transport.
|
|
200
|
+
* Retained delivery states are successful MessageStatus values, including pending and refused.
|
|
201
|
+
* After a storage failure, keep the same idempotency key and parameters when reconciling.
|
|
202
|
+
*/
|
|
203
|
+
var WorkerError = class extends Schema.TaggedError()("WorkerError", {
|
|
204
|
+
cause: Schema.optionalKey(Value),
|
|
205
|
+
stack: Schema.optionalKey(Schema.String),
|
|
206
|
+
/** Concurrency pressure may clear without changing the request. */
|
|
207
|
+
retryable: Schema.optionalKey(Schema.Literal(true)),
|
|
208
|
+
operation: Schema.Literals([
|
|
209
|
+
"context",
|
|
210
|
+
"start",
|
|
211
|
+
"followUp",
|
|
212
|
+
"inspect",
|
|
213
|
+
"observe",
|
|
214
|
+
"await",
|
|
215
|
+
"list",
|
|
216
|
+
"cancel",
|
|
217
|
+
"stop"
|
|
218
|
+
]),
|
|
219
|
+
reason: Schema.Literals([
|
|
220
|
+
"denied",
|
|
221
|
+
"declaration-unavailable",
|
|
222
|
+
"worker-mismatch",
|
|
223
|
+
"receipt-mismatch",
|
|
224
|
+
"message-mismatch",
|
|
225
|
+
"idempotency-conflict",
|
|
226
|
+
"capacity",
|
|
227
|
+
"not-found",
|
|
228
|
+
"delivery-pending",
|
|
229
|
+
"storage",
|
|
230
|
+
"corrupt",
|
|
231
|
+
"unavailable"
|
|
232
|
+
])
|
|
233
|
+
}) {};
|
|
234
|
+
/** One projected canonical Run outcome. Joined receipts share this identity. */
|
|
235
|
+
const WorkerReport = (success) => {
|
|
236
|
+
const identity = {
|
|
237
|
+
_tag: Schema.Literal("Settled"),
|
|
238
|
+
worker: WorkerRef,
|
|
239
|
+
receipt: Receipt,
|
|
240
|
+
runId: RunId,
|
|
241
|
+
settlementId: SettlementId
|
|
242
|
+
};
|
|
243
|
+
return Schema.Union([Schema.Struct({
|
|
244
|
+
...identity,
|
|
245
|
+
outcome: Schema.Literal("completed"),
|
|
246
|
+
result: Schema.Union([success])
|
|
247
|
+
}), Schema.Struct({
|
|
248
|
+
...identity,
|
|
249
|
+
outcome: Schema.Literals(["failed", "aborted"]),
|
|
250
|
+
failure: SubagentExecutionFailure
|
|
251
|
+
})]);
|
|
252
|
+
};
|
|
253
|
+
/** Framework message stored separately from the parent's application input. */
|
|
254
|
+
const WorkerCompletion = Schema.Struct({
|
|
255
|
+
_tag: Schema.Literal("WorkerCompletion"),
|
|
256
|
+
budgetExhausted: Schema.Boolean,
|
|
257
|
+
schemaVersion: Schema.Literal(1),
|
|
258
|
+
report: WorkerReport(Schema.Json)
|
|
259
|
+
}).check(Schema.makeFilter(({ report }) => report.worker.threadId === report.receipt.threadId));
|
|
260
|
+
/** Source-worker intermediate output, kept separate from application input. */
|
|
261
|
+
const WorkerUpdate = Schema.Struct({
|
|
262
|
+
_tag: Schema.Literal("WorkerUpdate"),
|
|
263
|
+
schemaVersion: Schema.Literal(1),
|
|
264
|
+
worker: WorkerRef,
|
|
265
|
+
update: Update
|
|
266
|
+
}).check(Schema.makeFilter(({ worker, update }) => worker.threadId === update.threadId && worker.targetAgentId === update.agentId));
|
|
267
|
+
const FrameworkMessage = Schema.Union([WorkerCompletion, WorkerUpdate]);
|
|
268
|
+
//#endregion
|
|
269
|
+
export { MessageStatus as C, MessageRef as S, WorkerStop as _, WorkerBudgetScope as a, WorkerUpdate as b, WorkerError as c, WorkerPage as d, WorkerRef as f, WorkerStarted as g, WorkerSource as h, WorkerAppliedInput as i, WorkerHistoryEntry as l, WorkerRun as m, AssignmentTerminal as n, WorkerCompletion as o, WorkerReport as p, FrameworkMessage as r, WorkerContext as s, AssignmentDisposition as t, WorkerInput as u, WorkerStopped as v, Worker_exports as x, WorkerSummary as y };
|
|
270
|
+
|
|
271
|
+
//# sourceMappingURL=Worker-CfwzMZEK.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Worker-CfwzMZEK.mjs","names":["FailureDiagnostic.Value"],"sources":["../src/core/internal/message-status.ts","../src/core/Worker.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { SettlementId, ThreadId } from \"../Identifiers.ts\";\nimport { IdempotencyKey, Receipt } from \"../Receipt.ts\";\n\n/** A retained outbound delivery identity, not a destination Receipt or access grant. */\nexport const MessageRef = Schema.Struct({ ownerThreadId: ThreadId, messageId: IdempotencyKey });\nexport type MessageRef = typeof MessageRef.Type;\n\nconst Reason = Schema.NonEmptyString.check(Schema.isMaxLength(256));\nconst identity = { message: MessageRef };\n\n/**\n * Source-owned delivery evidence. Pending confirms retention only; accepted supplies the\n * destination Receipt, and processed supplies its canonical settlement. Neither retention nor\n * acceptance proves execution. Refused is a definite rejection; parked stops automatic retry\n * while retaining the same identity and any acceptance evidence. Inspect instead of resending.\n */\nexport const MessageStatus = Schema.Union([\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"pending\"),\n receipt: Schema.Null,\n settlement: Schema.Null,\n reason: Schema.NullOr(Reason),\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"accepted\"),\n receipt: Receipt,\n settlement: Schema.Null,\n reason: Schema.NullOr(Reason),\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"processed\"),\n receipt: Receipt,\n settlement: Schema.Struct({\n settlementId: SettlementId,\n outcome: Schema.Literals([\"completed\", \"failed\", \"aborted\"]),\n }),\n reason: Schema.Null,\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"refused\"),\n receipt: Schema.Null,\n settlement: Schema.Null,\n reason: Reason,\n }),\n Schema.Struct({\n ...identity,\n status: Schema.Literal(\"parked\"),\n receipt: Schema.NullOr(Receipt),\n settlement: Schema.Null,\n reason: Reason,\n }),\n]);\n\nexport type MessageStatus = typeof MessageStatus.Type;\n","import { Schema } from \"effect\";\n\nimport { AgentPolicy } from \"./AgentPolicy.ts\";\nimport { Update } from \"./AgentUpdates.ts\";\nimport * as FailureDiagnostic from \"./FailureDiagnostic.ts\";\nimport { AgentId, DelegationId, RunId, SettlementId, ThreadId, ToolCallId } from \"./Identifiers.ts\";\nimport { MessageStatus } from \"./internal/message-status.ts\";\nimport { IdempotencyKey, Receipt } from \"./Receipt.ts\";\nimport { SubagentExecutionFailure, SubagentGrant } from \"./SubagentContract.ts\";\n\n/** Assignment output selected through the Definition's runDisposition declaration. */\nexport const AssignmentDisposition = Schema.Literals([\"completed\", \"waiting\"]);\nexport type AssignmentDisposition = typeof AssignmentDisposition.Type;\n\n/** A permanent destination outcome; an ordinary Run completion does not imply this. */\nexport const AssignmentTerminal = Schema.Literals([\"completed\", \"failed\", \"cancelled\"]);\nexport type AssignmentTerminal = typeof AssignmentTerminal.Type;\n\n/** A reusable child Thread, correlated with its declaration. This value grants no authority. */\nexport const WorkerRef = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n delegationId: DelegationId,\n targetAgentId: AgentId,\n threadId: ThreadId,\n});\n\nexport type WorkerRef = typeof WorkerRef.Type;\n\n/** A continuing worker identity and retained first delivery, never an execution handle. */\nexport const WorkerStarted = Schema.Struct({\n worker: WorkerRef,\n delivery: MessageStatus,\n}).check(\n Schema.makeFilter(\n ({ worker, delivery }) =>\n delivery.receipt === null || worker.threadId === delivery.receipt.threadId,\n ),\n);\n\nexport type WorkerStarted = typeof WorkerStarted.Type;\n\n/** Stable owner command. Reusing its key for a different worker conflicts. */\nexport const WorkerStop = Schema.Struct({ worker: WorkerRef, idempotencyKey: IdempotencyKey });\nexport type WorkerStop = typeof WorkerStop.Type;\n\n/** The inbox is sealed and active execution has released ownership. External actions are not undone. */\nexport const WorkerStopped = WorkerStop;\nexport type WorkerStopped = typeof WorkerStopped.Type;\n\n/** A host-authorized Run allowance is independent of the immutable delegation lineage. */\nexport const WorkerBudgetScope = Schema.Literals([\"source-subtree\", \"worker-run\"]);\nexport type WorkerBudgetScope = typeof WorkerBudgetScope.Type;\n\n/** Host-bound caller metadata. Programmatic calls never fabricate Run or Tool Call identities. */\nexport const WorkerSource = Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal(\"tool\"),\n agentId: AgentId,\n threadId: ThreadId,\n runId: RunId,\n toolCallId: ToolCallId,\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"programmatic\"),\n agentId: AgentId,\n threadId: ThreadId,\n }),\n]);\n\nexport type WorkerSource = typeof WorkerSource.Type;\n\n/** The caller's effective policy and root-relative depth, resolved by its host. */\nexport const WorkerContext = Schema.Struct({\n source: WorkerSource,\n policy: AgentPolicy,\n depth: Schema.Natural,\n grant: Schema.optionalKey(SubagentGrant),\n});\n\nexport type WorkerContext = typeof WorkerContext.Type;\n\n/** Admission identity is distinct from canonical input application. */\nexport const WorkerInput = Schema.Struct({ receipt: Receipt, messageId: IdempotencyKey });\nexport type WorkerInput = typeof WorkerInput.Type;\n\nexport const WorkerAppliedInput = Schema.Struct({\n ...WorkerInput.fields,\n runId: RunId,\n sequence: Schema.Natural,\n});\n\n/** A Run outcome is not assignment completion. Interpret only a Definition's disposition. */\nexport const WorkerRun = Schema.Struct({\n runId: RunId,\n hostReceipt: Receipt,\n outcome: Schema.NullOr(Schema.Literals([\"completed\", \"failed\", \"aborted\"])),\n disposition: Schema.NullOr(Schema.Json),\n});\n\n/** Bounded durable listing data; a latest Receipt never substitutes for a requested Receipt. */\nexport const WorkerSummary = Schema.Struct({\n worker: WorkerRef,\n latestReceipt: Schema.NullOr(Receipt),\n /** stopping/stopped identify an owner-issued worker stop, never an ordinary Receipt abort. */\n state: Schema.Literals([\n \"starting\",\n \"active\",\n \"idle\",\n \"stopping\",\n \"stopped\",\n \"completed\",\n \"failed\",\n \"cancelled\",\n ]),\n acceptedInput: Schema.NullOr(WorkerInput),\n appliedInput: Schema.NullOr(WorkerAppliedInput),\n run: Schema.NullOr(WorkerRun),\n /** One retained unadmitted input, if any; its state is independent of destination execution. */\n pendingDelivery: Schema.NullOr(MessageStatus),\n /** Consistent destination facts; pending delivery has its own source-owned version. */\n watermark: Schema.Struct({\n canonicalSequence: Schema.Natural,\n acceptedQueueSequence: Schema.Natural,\n pendingDeliveryVersion: Schema.NullOr(Schema.Natural),\n }),\n});\n\nexport type WorkerSummary = typeof WorkerSummary.Type;\n\nexport const WorkerPage = Schema.Struct({\n items: Schema.Array(WorkerSummary).check(Schema.isMaxLength(100)),\n next: Schema.NullOr(ThreadId),\n});\n\nexport type WorkerPage = typeof WorkerPage.Type;\n\n/** Authorized canonical history, encoded independently of storage-adapter representations. */\nexport const WorkerHistoryEntry = Schema.Struct({\n sequence: Schema.Natural.check(Schema.isGreaterThan(0)),\n recordId: Schema.NonEmptyString.check(Schema.isMaxLength(1_024)),\n record: Schema.Json,\n});\n\nexport type WorkerHistoryEntry = typeof WorkerHistoryEntry.Type;\n\n/**\n * Closed host-boundary failures. Original causes stay private and survive diagnostic transport.\n * Retained delivery states are successful MessageStatus values, including pending and refused.\n * After a storage failure, keep the same idempotency key and parameters when reconciling.\n */\nexport class WorkerError extends Schema.TaggedError<WorkerError>()(\"WorkerError\", {\n cause: Schema.optionalKey(FailureDiagnostic.Value),\n stack: Schema.optionalKey(Schema.String),\n /** Concurrency pressure may clear without changing the request. */\n retryable: Schema.optionalKey(Schema.Literal(true)),\n operation: Schema.Literals([\n \"context\",\n \"start\",\n \"followUp\",\n \"inspect\",\n \"observe\",\n \"await\",\n \"list\",\n \"cancel\",\n \"stop\",\n ]),\n reason: Schema.Literals([\n \"denied\",\n \"declaration-unavailable\",\n \"worker-mismatch\",\n \"receipt-mismatch\",\n \"message-mismatch\",\n \"idempotency-conflict\",\n \"capacity\",\n \"not-found\",\n // Decode earlier failures without emitting them for retained deliveries.\n \"delivery-pending\",\n \"storage\",\n \"corrupt\",\n \"unavailable\",\n ]),\n}) {}\n\nexport { WorkerOperationTool } from \"./SubagentContract.ts\";\n\n/** One projected canonical Run outcome. Joined receipts share this identity. */\nexport const WorkerReport = <Success extends Schema.Top>(success: Success) => {\n const identity = {\n _tag: Schema.Literal(\"Settled\"),\n worker: WorkerRef,\n receipt: Receipt,\n runId: RunId,\n settlementId: SettlementId,\n };\n\n return Schema.Union([\n // Union preserves the Success codec while making the result field required.\n Schema.Struct({\n ...identity,\n outcome: Schema.Literal(\"completed\"),\n result: Schema.Union([success]),\n }),\n Schema.Struct({\n ...identity,\n outcome: Schema.Literals([\"failed\", \"aborted\"]),\n failure: SubagentExecutionFailure,\n }),\n ]);\n};\n\nexport type WorkerReport<Success extends Schema.Top> = ReturnType<\n typeof WorkerReport<Success>\n>[\"Type\"];\n\n/** Framework message stored separately from the parent's application input. */\nexport const WorkerCompletion = Schema.Struct({\n _tag: Schema.Literal(\"WorkerCompletion\"),\n budgetExhausted: Schema.Boolean,\n schemaVersion: Schema.Literal(1),\n report: WorkerReport(Schema.Json),\n}).check(Schema.makeFilter(({ report }) => report.worker.threadId === report.receipt.threadId));\n\nexport type WorkerCompletion = typeof WorkerCompletion.Type;\n\n/** Source-worker intermediate output, kept separate from application input. */\nexport const WorkerUpdate = Schema.Struct({\n _tag: Schema.Literal(\"WorkerUpdate\"),\n schemaVersion: Schema.Literal(1),\n worker: WorkerRef,\n update: Update,\n}).check(\n Schema.makeFilter(\n ({ worker, update }) =>\n worker.threadId === update.threadId && worker.targetAgentId === update.agentId,\n ),\n);\n\nexport type WorkerUpdate = typeof WorkerUpdate.Type;\nexport const FrameworkMessage = Schema.Union([WorkerCompletion, WorkerUpdate]);\nexport type FrameworkMessage = typeof FrameworkMessage.Type;\n"],"mappings":"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"}
|