effect-agent 0.1.0-beta.164 → 0.1.0-beta.165
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-Vhz6NdaH.d.mts → Admin-CbwoQEm8.d.mts} +24 -24
- package/dist/{Agent-BMATXYsI.mjs → Agent-B0WrUcHy.mjs} +9 -9
- package/dist/Agent-B0WrUcHy.mjs.map +1 -0
- package/dist/{Agent-ZfnNCQXs.d.mts → Agent-D0fbFT2d.d.mts} +27 -24
- package/dist/{AgentError-Bn1ytXRD.d.mts → AgentError-BMqPzIVt.d.mts} +3 -3
- package/dist/{AgentPolicy-B4oH8TbG.d.mts → AgentPolicy-CclAEpHn.d.mts} +2 -2
- package/dist/{AgentRuntime-D1MmB_0z.d.mts → AgentRuntime-BM36roNi.d.mts} +44 -30
- package/dist/{AgentRuntime-Q50HloUc.mjs → AgentRuntime-BTfPyMXN.mjs} +91 -30
- package/dist/AgentRuntime-BTfPyMXN.mjs.map +1 -0
- package/dist/{AgentUpdates-DMJ-_xow.d.mts → AgentUpdates-DksV4D0A.d.mts} +6 -3
- package/dist/{ContextCompactor-BoKQOjr5.d.mts → ContextCompactor-DLpX-HUG.d.mts} +18 -12
- package/dist/{ContextWindow-DRQ5Mbm2.d.mts → ContextWindow-aGZOPIPq.d.mts} +24 -22
- package/dist/{Digest-COAt3Orl.d.mts → Digest-3l_02jaM.d.mts} +2 -2
- package/dist/{DurableAgentRuntime-BTMOgDl_.mjs → DurableAgentRuntime-CWmWREPj.mjs} +11 -11
- package/dist/{DurableAgentRuntime-BTMOgDl_.mjs.map → DurableAgentRuntime-CWmWREPj.mjs.map} +1 -1
- package/dist/{DurableStep-Cry_iol4.d.mts → DurableStep-CTqx6DOV.d.mts} +13 -11
- package/dist/{EventSource-CtS0RBM7.d.mts → EventSource-D29Jsj5U.d.mts} +3 -3
- package/dist/{FailureDiagnostic-BElLOoED.mjs → FailureDiagnostic-D9oW23Cn.mjs} +16 -10
- package/dist/FailureDiagnostic-D9oW23Cn.mjs.map +1 -0
- package/dist/{FailureDiagnostic-CaAkzGHL.d.mts → FailureDiagnostic-DvHruCSJ.d.mts} +10 -9
- package/dist/InMemory.d.mts +28 -5
- package/dist/InMemory.mjs +37 -4
- package/dist/InMemory.mjs.map +1 -1
- package/dist/{Messaging-CICd_CSi.d.mts → Messaging-BbuaphiQ.d.mts} +6 -6
- package/dist/{Messaging-7VXQnWI3.d.mts → Messaging-DF_IWnxV.d.mts} +5 -5
- package/dist/{MessagingHost-DXwWnrMh.d.mts → MessagingHost-Bfbfkx6f.d.mts} +13 -12
- package/dist/{MessagingHost-DfsbMPvq.mjs → MessagingHost-DJZJZILu.mjs} +4 -3
- package/dist/MessagingHost-DJZJZILu.mjs.map +1 -0
- package/dist/{Output-CY7NZByV.d.mts → Output-UsQKiPhz.d.mts} +4 -4
- package/dist/{PreparedInputAdmission-CS_zlCvD.d.mts → PreparedInputAdmission-DXvjTe4U.d.mts} +6 -6
- package/dist/{Receipt-BAHyigAF.d.mts → Receipt-BkM21Qiu.d.mts} +2 -2
- package/dist/{Records-Bm4Qt70a.d.mts → Records-CAQktL0z.d.mts} +8 -8
- package/dist/{RunEvent-D0aepYwN.d.mts → RunEvent-B3CRIqIC.d.mts} +5 -5
- package/dist/{RunEventSink-9CUdI9Ar.d.mts → RunEventSink-sDXDkrAl.d.mts} +9 -7
- package/dist/{RunJournal-D8Vvf_io.mjs → RunJournal-NRgq1PNe.mjs} +3 -3
- package/dist/{RunJournal-D8Vvf_io.mjs.map → RunJournal-NRgq1PNe.mjs.map} +1 -1
- package/dist/{RunOptions-BHmBa05n.d.mts → RunOptions-CkSZSuIh.d.mts} +87 -83
- package/dist/{RunPolicyUsage-CUudVtg_.d.mts → RunPolicyUsage-QmYVw9z8.d.mts} +2 -2
- package/dist/{Schedule-Bi_XVKLF.d.mts → Schedule-rEIiYnRq.d.mts} +4 -4
- package/dist/{Subagent-Cxvuaius.mjs → Subagent-C-fyHbcp.mjs} +5 -5
- package/dist/{Subagent-Cxvuaius.mjs.map → Subagent-C-fyHbcp.mjs.map} +1 -1
- package/dist/{Subagent-D59om8SR.d.mts → Subagent-t3pJDZMN.d.mts} +15 -15
- package/dist/{SubagentContract-tyN9v-Jv.d.mts → SubagentContract-DdPzxYQj.d.mts} +3 -2
- package/dist/{SubagentHost-VTyf_wEF.d.mts → SubagentHost-CXFlEpj0.d.mts} +19 -16
- package/dist/{Subscription-nbSNY6Hs.d.mts → Subscription-BJj-R-6V.d.mts} +8 -8
- package/dist/{SubscriptionInput-DbXnOMS2.d.mts → SubscriptionInput-DyQtODg2.d.mts} +3 -3
- package/dist/Thread-DT8RTLIQ.d.mts +117 -0
- package/dist/{ThreadHistory-FD-o4TsR.d.mts → ThreadHistory-DQ-IC1hU.d.mts} +12 -9
- package/dist/{ToolBroker-DWs4tZra.d.mts → ToolBroker-DXwv2aUT.d.mts} +14 -12
- package/dist/{ToolExposure-UCN12eCd.d.mts → ToolExposure-BsaSH15e.d.mts} +5 -4
- package/dist/{ToolExposure-r2eOWk4F.d.mts → ToolExposure-Ckg3-sTf.d.mts} +3 -2
- package/dist/{ToolExposure-9uF_Yo0T.mjs → ToolExposure-DBATXxmL.mjs} +2 -2
- package/dist/ToolExposure-DBATXxmL.mjs.map +1 -0
- package/dist/{ToolExposure-C93U1sPu.mjs → ToolExposure-hTJT2ekj.mjs} +3 -2
- package/dist/ToolExposure-hTJT2ekj.mjs.map +1 -0
- package/dist/ToolExposure.d.mts +2 -2
- package/dist/ToolExposure.mjs +2 -2
- package/dist/{ToolResult-BKdqWRff.d.mts → ToolResult-DqyEhJLF.d.mts} +2 -2
- package/dist/{Usage-BNjPR7Zr.d.mts → Usage-CzZJ6A2n.d.mts} +3 -2
- package/dist/{Worker-XEBYxRQv.d.mts → Worker-DH5SAVIK.d.mts} +7 -7
- package/dist/{Worker-CfwzMZEK.mjs → Worker-DZjdMjZn.mjs} +3 -3
- package/dist/Worker-DZjdMjZn.mjs.map +1 -0
- package/dist/{WorkerAdmission-BVbSB8_A.mjs → WorkerAdmission-DJ76C2b-.mjs} +4 -4
- package/dist/{WorkerAdmission-BVbSB8_A.mjs.map → WorkerAdmission-DJ76C2b-.mjs.map} +1 -1
- package/dist/{agent-registration-BIOzAej4.mjs → agent-registration-D1dWV7KK.mjs} +3 -3
- package/dist/{agent-registration-BIOzAej4.mjs.map → agent-registration-D1dWV7KK.mjs.map} +1 -1
- package/dist/capabilities/BrowserUse.d.mts +1 -1
- package/dist/capabilities/BrowserUse.mjs +1 -1
- package/dist/capabilities/CodeMode.d.mts +2 -2
- package/dist/capabilities/CodeMode.mjs +3 -3
- package/dist/capabilities/Commands.d.mts +1 -1
- package/dist/capabilities/ContextTools.d.mts +2 -2
- package/dist/capabilities/ContextTools.mjs +1 -1
- package/dist/capabilities/Mcp.d.mts +1 -1
- package/dist/capabilities/Mcp.mjs +1 -1
- package/dist/capabilities/McpClient.d.mts +1 -1
- package/dist/capabilities/McpClient.mjs +1 -1
- package/dist/capabilities/MemoryNotes.d.mts +2 -2
- package/dist/capabilities/MemoryNotes.mjs +1 -1
- package/dist/capabilities/Messaging.d.mts +2 -2
- package/dist/capabilities/Messaging.mjs +3 -3
- package/dist/capabilities/ModelContext.d.mts +1 -1
- package/dist/capabilities/Redaction.d.mts +1 -1
- package/dist/capabilities/RunHooks.d.mts +7 -6
- package/dist/capabilities/RunHooks.mjs +2 -1
- package/dist/capabilities/RunHooks.mjs.map +1 -1
- package/dist/capabilities/SemanticMemory.d.mts +1 -1
- package/dist/capabilities/SemanticMemory.mjs +1 -1
- package/dist/capabilities/Subagent.d.mts +3 -3
- package/dist/capabilities/Subagent.mjs +2 -2
- package/dist/capabilities/SubagentReservations.d.mts +64 -60
- package/dist/capabilities/SubagentReservations.mjs +6 -1
- package/dist/capabilities/SubagentReservations.mjs.map +1 -1
- package/dist/capabilities/ToolDiscovery.d.mts +2 -2
- package/dist/capabilities/ToolDiscovery.mjs +3 -3
- package/dist/capabilities/WebCapture.d.mts +1 -1
- package/dist/capabilities/WebCapture.mjs +1 -1
- package/dist/capabilities/WebSearch.d.mts +1 -1
- package/dist/capabilities/WebSearch.mjs +1 -1
- package/dist/{compaction-BQK4MUg3.mjs → compaction-FDJhjbzH.mjs} +4 -3
- package/dist/compaction-FDJhjbzH.mjs.map +1 -0
- package/dist/core/Agent.d.mts +1 -1
- package/dist/core/Agent.mjs +1 -1
- package/dist/core/AgentError.d.mts +1 -1
- package/dist/core/AgentError.mjs +4 -4
- package/dist/core/AgentError.mjs.map +1 -1
- package/dist/core/AgentPolicy.d.mts +1 -1
- package/dist/core/AgentUpdates.d.mts +1 -1
- package/dist/core/AgentUpdates.mjs +5 -1
- package/dist/core/AgentUpdates.mjs.map +1 -1
- package/dist/core/FailureDiagnostic.d.mts +1 -1
- package/dist/core/FailureDiagnostic.mjs +1 -1
- package/dist/core/IdGenerator.d.mts +3 -1
- package/dist/core/IdGenerator.mjs +8 -5
- package/dist/core/IdGenerator.mjs.map +1 -1
- package/dist/core/Receipt.d.mts +1 -1
- package/dist/core/Receipt.mjs +1 -1
- package/dist/core/Receipt.mjs.map +1 -1
- package/dist/core/RunEvent.d.mts +1 -1
- package/dist/core/RunEvent.mjs +2 -2
- package/dist/core/RunEvent.mjs.map +1 -1
- package/dist/core/RunPolicyUsage.d.mts +1 -1
- package/dist/core/RunPolicyUsage.mjs +1 -1
- package/dist/core/RunPolicyUsage.mjs.map +1 -1
- package/dist/core/SubagentContract.d.mts +1 -1
- package/dist/core/SubagentContract.mjs +2 -1
- package/dist/core/SubagentContract.mjs.map +1 -1
- package/dist/core/Thread.d.mts +2 -2
- package/dist/core/Thread.mjs +82 -33
- package/dist/core/Thread.mjs.map +1 -1
- package/dist/core/ToolResult.d.mts +1 -1
- package/dist/core/ToolResult.mjs +1 -1
- package/dist/core/ToolResult.mjs.map +1 -1
- package/dist/core/Usage.d.mts +1 -1
- package/dist/core/Usage.mjs +2 -1
- package/dist/core/Usage.mjs.map +1 -1
- package/dist/core/Worker.d.mts +2 -2
- package/dist/core/Worker.mjs +1 -1
- package/dist/durable/ActivityStore.d.mts +1 -1
- package/dist/durable/Admin.d.mts +1 -1
- package/dist/durable/AgentRegistration.d.mts +1 -1
- package/dist/durable/AgentRegistration.mjs +1 -1
- package/dist/durable/Certification.d.mts +1 -1
- package/dist/durable/CommittedActivity.d.mts +3 -3
- package/dist/durable/Digest.d.mts +1 -1
- package/dist/durable/DurableAgentRuntime.d.mts +2 -2
- package/dist/durable/DurableAgentRuntime.mjs +2 -2
- package/dist/durable/EventSource.d.mts +1 -1
- package/dist/durable/GitHubWorkflowSource.d.mts +4 -4
- package/dist/durable/GitHubWorkflowSource.mjs +1 -1
- package/dist/durable/LifecyclePublication.d.mts +1 -1
- package/dist/durable/LifecyclePublication.mjs +1 -1
- package/dist/durable/MessageDelivery.d.mts +9 -9
- package/dist/durable/MessageDelivery.mjs +2 -2
- package/dist/durable/MessageDeliveryStoreConformance.d.mts +28 -28
- package/dist/durable/MessageDeliveryStoreConformance.mjs +1 -1
- package/dist/durable/PersistentHistory.d.mts +2 -2
- package/dist/durable/PersistentHistory.mjs +2 -2
- package/dist/durable/PreparedInputAdmission.d.mts +1 -1
- package/dist/durable/PreparedInputAdmission.mjs +1 -1
- package/dist/durable/Records.d.mts +1 -1
- package/dist/durable/Records.mjs +5 -5
- package/dist/durable/Recovery.d.mts +1 -1
- package/dist/durable/RunJournal.d.mts +1 -1
- package/dist/durable/RunJournal.mjs +1 -1
- package/dist/durable/Schedule.d.mts +1 -1
- package/dist/durable/Schedule.mjs +1 -1
- package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
- package/dist/durable/ScheduleTransition.d.mts +1 -1
- package/dist/durable/Scheduling.d.mts +4 -4
- package/dist/durable/SubmissionLedger.d.mts +2 -2
- package/dist/durable/SubmissionLedger.mjs +3 -3
- package/dist/durable/SubmissionLedgerConformance.d.mts +2 -2
- package/dist/durable/SubmissionLedgerConformance.mjs +3 -3
- package/dist/durable/SubmissionStatus.d.mts +1 -1
- package/dist/durable/Subscription.d.mts +1 -1
- package/dist/durable/Subscription.mjs +1 -1
- package/dist/durable/SubscriptionInput.d.mts +1 -1
- package/dist/durable/SubscriptionInput.mjs +1 -1
- package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
- package/dist/durable/SubscriptionTools.d.mts +7 -7
- package/dist/durable/SubscriptionTools.mjs +1 -1
- package/dist/durable/SubscriptionTransition.d.mts +1 -1
- package/dist/durable/Subscriptions.d.mts +7 -7
- package/dist/durable/ThreadContextHistory.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
- package/dist/durable/ThreadContextHistoryProjection.mjs +2 -2
- package/dist/durable/ThreadInvariants.d.mts +2 -2
- package/dist/durable/ThreadInvariants.mjs +1 -1
- package/dist/durable/ThreadProjection.d.mts +1 -1
- package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
- package/dist/durable/ThreadStore.d.mts +1 -1
- package/dist/durable/ThreadStore.mjs +1 -1
- package/dist/durable/ThreadStoreConformance.d.mts +1 -1
- package/dist/durable/ThreadStoreConformance.mjs +1 -1
- package/dist/durable/WorkerAdmission.d.mts +6 -6
- package/dist/durable/WorkerAdmission.mjs +1 -1
- package/dist/durable/WorkerHost.d.mts +7 -7
- package/dist/durable/WorkerHost.mjs +1 -1
- package/dist/engine/AgentRuntime.d.mts +1 -1
- package/dist/engine/AgentRuntime.mjs +1 -1
- package/dist/engine/Compaction.d.mts +1 -1
- package/dist/engine/Compaction.mjs +1 -1
- package/dist/engine/ContextCompactor.d.mts +1 -1
- package/dist/engine/ContextCompactor.mjs +8 -3
- package/dist/engine/ContextCompactor.mjs.map +1 -1
- package/dist/engine/ContextWindow.d.mts +1 -1
- package/dist/engine/ContextWindow.mjs +3 -1
- package/dist/engine/ContextWindow.mjs.map +1 -1
- package/dist/engine/DurableStep.d.mts +1 -1
- package/dist/engine/DurableStep.mjs +2 -1
- package/dist/engine/DurableStep.mjs.map +1 -1
- package/dist/engine/MessagingHost.d.mts +1 -1
- package/dist/engine/MessagingHost.mjs +1 -1
- package/dist/engine/Output.d.mts +1 -1
- package/dist/engine/Output.mjs +1 -1
- package/dist/engine/RunEventSink.d.mts +1 -1
- package/dist/engine/RunEventSink.mjs +2 -1
- package/dist/engine/RunEventSink.mjs.map +1 -1
- package/dist/engine/RunOptions.d.mts +1 -1
- package/dist/engine/RunOptions.mjs +5 -2
- package/dist/engine/RunOptions.mjs.map +1 -1
- package/dist/engine/SubagentHost.d.mts +1 -1
- package/dist/engine/SubagentHost.mjs +4 -2
- package/dist/engine/SubagentHost.mjs.map +1 -1
- package/dist/engine/ThreadHistory.d.mts +1 -1
- package/dist/engine/ThreadHistory.mjs +12 -10
- package/dist/engine/ThreadHistory.mjs.map +1 -1
- package/dist/engine/ToolBroker.d.mts +1 -1
- package/dist/engine/ToolBroker.mjs +2 -1
- package/dist/engine/ToolBroker.mjs.map +1 -1
- package/dist/index.d.mts +34 -34
- package/dist/index.mjs +9 -9
- package/dist/{output-contract-DS-S8mTv.mjs → output-contract-DUNIO6as.mjs} +4 -3
- package/dist/output-contract-DUNIO6as.mjs.map +1 -0
- package/package.json +1 -1
- package/src/InMemory.ts +61 -2
- package/src/capabilities/RunHooks.ts +6 -3
- package/src/capabilities/SubagentReservations.ts +7 -1
- package/src/core/Agent.ts +3 -8
- package/src/core/AgentError.ts +1 -1
- package/src/core/AgentUpdates.ts +5 -1
- package/src/core/FailureDiagnostic.ts +6 -8
- package/src/core/IdGenerator.ts +5 -2
- package/src/core/Messaging.ts +1 -1
- package/src/core/Receipt.ts +1 -1
- package/src/core/RunEvent.ts +1 -1
- package/src/core/RunPolicyUsage.ts +1 -1
- package/src/core/SubagentContract.ts +2 -1
- package/src/core/Thread.ts +163 -61
- package/src/core/ToolExposure.ts +2 -1
- package/src/core/ToolResult.ts +1 -1
- package/src/core/Usage.ts +2 -1
- package/src/core/Worker.ts +1 -1
- package/src/core/internal/agent-updates.ts +3 -2
- package/src/core/internal/message-status.ts +1 -1
- package/src/core/internal/strict-schema.ts +3 -1
- package/src/engine/ContextCompactor.ts +8 -2
- package/src/engine/ContextWindow.ts +4 -1
- package/src/engine/DurableStep.ts +2 -1
- package/src/engine/MessagingHost.ts +2 -1
- package/src/engine/RunEventSink.ts +2 -1
- package/src/engine/RunOptions.ts +5 -1
- package/src/engine/SubagentHost.ts +3 -1
- package/src/engine/ThreadHistory.ts +20 -10
- package/src/engine/ToolBroker.ts +2 -1
- package/src/engine/ToolExposure.ts +2 -1
- package/src/engine/internal/agent-runtime.ts +41 -49
- package/src/engine/internal/bounded-value.ts +2 -1
- package/src/engine/internal/compaction.ts +3 -2
- package/src/engine/internal/output-contract.ts +3 -2
- package/src/engine/internal/primitive-delta.ts +51 -10
- package/src/engine/internal/tool-derivative.ts +5 -1
- package/src/engine/internal/tool-exposure.ts +5 -2
- package/src/engine/internal/tool-telemetry.ts +12 -13
- package/dist/Agent-BMATXYsI.mjs.map +0 -1
- package/dist/AgentRuntime-Q50HloUc.mjs.map +0 -1
- package/dist/FailureDiagnostic-BElLOoED.mjs.map +0 -1
- package/dist/MessagingHost-DfsbMPvq.mjs.map +0 -1
- package/dist/Thread-DOBQ0QUY.d.mts +0 -96
- package/dist/ToolExposure-9uF_Yo0T.mjs.map +0 -1
- package/dist/ToolExposure-C93U1sPu.mjs.map +0 -1
- package/dist/Worker-CfwzMZEK.mjs.map +0 -1
- package/dist/compaction-BQK4MUg3.mjs.map +0 -1
- package/dist/output-contract-DS-S8mTv.mjs.map +0 -1
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { d as ToolCallId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
+
import * as Schema$1 from "effect/Schema";
|
|
3
|
+
import * as Context$1 from "effect/Context";
|
|
4
|
+
import { Effect, Option } from "effect";
|
|
2
5
|
import { Tool } from "effect/unstable/ai";
|
|
3
|
-
import { Context, Effect, Option, Schema } from "effect";
|
|
4
6
|
declare namespace DurableStep_d_exports {
|
|
5
7
|
export { DurableStep, DurableStepError, DurableStepService, PersistedStepResult, RunStepHook, RunStepKey, ToolExecutionClass, ToolExecutionClassValue, getToolExecutionClass };
|
|
6
8
|
}
|
|
@@ -25,7 +27,7 @@ type ToolExecutionClassValue = "readonly" | "idempotent" | "uncertain";
|
|
|
25
27
|
* decisions are fail-closed, so the framework never infers a safer class
|
|
26
28
|
* from a Tool's shape.
|
|
27
29
|
*/
|
|
28
|
-
declare const ToolExecutionClass: Context.Reference<ToolExecutionClassValue>;
|
|
30
|
+
declare const ToolExecutionClass: Context$1.Reference<ToolExecutionClassValue>;
|
|
29
31
|
/** Read a Tool's declared execution class, falling back to the fail-closed `"uncertain"` default. */
|
|
30
32
|
declare const getToolExecutionClass: (tool: Tool.Any) => ToolExecutionClassValue;
|
|
31
33
|
/** Stable identity of one Step within one Tool Call: `(toolCallId, stepName)`. */
|
|
@@ -51,13 +53,13 @@ interface RunStepHook<Error = never, Requirements = never> {
|
|
|
51
53
|
readonly lookup: (key: RunStepKey) => Effect.Effect<Option.Option<PersistedStepResult>, Error, Requirements>;
|
|
52
54
|
readonly commit: (key: RunStepKey, encodedOutput: unknown) => Effect.Effect<void, Error, Requirements>;
|
|
53
55
|
}
|
|
54
|
-
declare const DurableStepError_base: Schema.Class<DurableStepError, Schema.TaggedStruct<"DurableStepError", {
|
|
55
|
-
readonly stepName: Schema.String;
|
|
56
|
-
readonly reason: Schema.Literals<readonly ["duplicate-step-name", "lookup-failed", "recorded-result-invalid", "output-encoding-failed", "commit-failed", "no-active-tool-call"]>;
|
|
57
|
-
readonly message: Schema.String;
|
|
58
|
-
readonly toolCallId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
56
|
+
declare const DurableStepError_base: Schema$1.Class<DurableStepError, Schema$1.TaggedStruct<"DurableStepError", {
|
|
57
|
+
readonly stepName: Schema$1.String;
|
|
58
|
+
readonly reason: Schema$1.Literals<readonly ["duplicate-step-name", "lookup-failed", "recorded-result-invalid", "output-encoding-failed", "commit-failed", "no-active-tool-call"]>;
|
|
59
|
+
readonly message: Schema$1.String;
|
|
60
|
+
readonly toolCallId: Schema$1.optionalKey<Schema$1.brand<Schema$1.NonEmptyString, "@effect-agent/core/ToolCallId">>;
|
|
59
61
|
/** Diagnostic cause for the live Effect only; Run events retain the fixed public message. */
|
|
60
|
-
readonly cause: Schema.optionalKey<Schema.Defect>;
|
|
62
|
+
readonly cause: Schema$1.optionalKey<Schema$1.Defect>;
|
|
61
63
|
}>, import("effect/Cause").YieldableError>;
|
|
62
64
|
/**
|
|
63
65
|
* Typed failure of one `DurableStep.do` call.
|
|
@@ -82,9 +84,9 @@ declare class DurableStepError extends DurableStepError_base {}
|
|
|
82
84
|
* reconciliation API, or compensating workflow.
|
|
83
85
|
*/
|
|
84
86
|
interface DurableStepService {
|
|
85
|
-
readonly do: <Output extends Schema.Top, BodyError, BodyServices>(name: string, output: Output, execute: Effect.Effect<Output["Type"], BodyError, BodyServices>) => Effect.Effect<Output["Type"], DurableStepError | BodyError, BodyServices | Output["DecodingServices"] | Output["EncodingServices"]>;
|
|
87
|
+
readonly do: <Output extends Schema$1.Top, BodyError, BodyServices>(name: string, output: Output, execute: Effect.Effect<Output["Type"], BodyError, BodyServices>) => Effect.Effect<Output["Type"], DurableStepError | BodyError, BodyServices | Output["DecodingServices"] | Output["EncodingServices"]>;
|
|
86
88
|
}
|
|
87
|
-
declare const DurableStep_base: Context.ServiceClass<DurableStep, "@effect-agent/engine/DurableStep", DurableStepService>;
|
|
89
|
+
declare const DurableStep_base: Context$1.ServiceClass<DurableStep, "@effect-agent/engine/DurableStep", DurableStepService>;
|
|
88
90
|
/**
|
|
89
91
|
* Engine-owned Durable Step seam.
|
|
90
92
|
*
|
|
@@ -100,4 +102,4 @@ declare const DurableStep_base: Context.ServiceClass<DurableStep, "@effect-agent
|
|
|
100
102
|
declare class DurableStep extends DurableStep_base {}
|
|
101
103
|
//#endregion
|
|
102
104
|
export { PersistedStepResult as a, ToolExecutionClass as c, DurableStep_d_exports as i, ToolExecutionClassValue as l, DurableStepError as n, RunStepHook as o, DurableStepService as r, RunStepKey as s, DurableStep as t, getToolExecutionClass as u };
|
|
103
|
-
//# sourceMappingURL=DurableStep-
|
|
105
|
+
//# sourceMappingURL=DurableStep-CTqx6DOV.d.mts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as PersistedJson } from "./Records-
|
|
2
|
-
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-
|
|
1
|
+
import { k as PersistedJson } from "./Records-CAQktL0z.mjs";
|
|
2
|
+
import { E as SubscriptionSourceError, b as SubscriptionRecord, i as EventSourceVersion, t as AcceptedEvent } from "./Subscription-BJj-R-6V.mjs";
|
|
3
3
|
import { Context, Effect, Schema, Scope } from "effect";
|
|
4
4
|
declare namespace EventSource_d_exports {
|
|
5
5
|
export { EventSource, EventSources, NormalizedEvent, makeEventSource };
|
|
@@ -48,4 +48,4 @@ declare const makeEventSource: <Event extends Schema.Top, Parameters extends Sch
|
|
|
48
48
|
}) => Effect.Effect<EventSource, never, Exclude<R, Scope.Scope> | Exclude<Event["DecodingServices"], Scope.Scope> | Exclude<Event["EncodingServices"], Scope.Scope> | Exclude<Parameters["DecodingServices"], Scope.Scope> | Exclude<Parameters["EncodingServices"], Scope.Scope>>;
|
|
49
49
|
//#endregion
|
|
50
50
|
export { makeEventSource as a, NormalizedEvent as i, EventSource_d_exports as n, EventSources as r, EventSource as t };
|
|
51
|
-
//# sourceMappingURL=EventSource-
|
|
51
|
+
//# sourceMappingURL=EventSource-D29Jsj5U.d.mts.map
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import
|
|
2
|
+
import * as Schema from "effect/Schema";
|
|
3
|
+
import * as EffectCause from "effect/Cause";
|
|
4
|
+
import * as Exit from "effect/Exit";
|
|
5
|
+
import * as Predicate from "effect/Predicate";
|
|
6
|
+
import * as Redacted from "effect/Redacted";
|
|
7
|
+
import * as SchemaTransformation from "effect/SchemaTransformation";
|
|
8
|
+
import * as SchemaParser from "effect/SchemaParser";
|
|
3
9
|
//#region src/core/internal/strict-schema.ts
|
|
4
10
|
/** Keep strict parsing on nested values even when an outer parser uses its defaults. */
|
|
5
11
|
const strictSchema = (schema) => Schema.declareConstructor()([schema], ([codec]) => (value, _ast, options) => SchemaParser.decodeUnknownEffect(codec)(value, {
|
|
@@ -9,8 +15,8 @@ const strictSchema = (schema) => Schema.declareConstructor()([schema], ([codec])
|
|
|
9
15
|
//#endregion
|
|
10
16
|
//#region src/core/FailureDiagnostic.ts
|
|
11
17
|
var FailureDiagnostic_exports = /* @__PURE__ */ __exportAll({
|
|
12
|
-
Cause: () => Cause
|
|
13
|
-
Context: () => Context
|
|
18
|
+
Cause: () => Cause,
|
|
19
|
+
Context: () => Context,
|
|
14
20
|
Diagnostic: () => Diagnostic,
|
|
15
21
|
Failure: () => Failure,
|
|
16
22
|
Value: () => Value,
|
|
@@ -27,7 +33,7 @@ const Scalar = Schema.Union([
|
|
|
27
33
|
Schema.Null
|
|
28
34
|
]);
|
|
29
35
|
/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */
|
|
30
|
-
const Context
|
|
36
|
+
const Context = Schema.Struct({
|
|
31
37
|
agentId: Schema.optionalKey(Name),
|
|
32
38
|
threadId: Schema.optionalKey(Name),
|
|
33
39
|
runId: Schema.optionalKey(Name),
|
|
@@ -51,7 +57,7 @@ const diagnosticSchema = (nested) => Schema.Union([
|
|
|
51
57
|
code: Schema.optionalKey(Schema.Union([Name, Schema.Finite])),
|
|
52
58
|
cause: Schema.optionalKey(nested),
|
|
53
59
|
errors: Schema.optionalKey(Schema.Array(nested).check(Schema.isMaxLength(128))),
|
|
54
|
-
context: Schema.optionalKey(Context
|
|
60
|
+
context: Schema.optionalKey(Context),
|
|
55
61
|
omittedFields: Schema.optionalKey(Schema.Array(Name).check(Schema.isMaxLength(32))),
|
|
56
62
|
truncated: Schema.optionalKey(Schema.Literal(true))
|
|
57
63
|
}),
|
|
@@ -148,7 +154,7 @@ const capture = (value, options) => {
|
|
|
148
154
|
value: text(node.value)
|
|
149
155
|
} : node;
|
|
150
156
|
}
|
|
151
|
-
const originalReasons =
|
|
157
|
+
const originalReasons = EffectCause.isCause(value) ? value.reasons : node?._tag === "Cause" ? node.reasons : void 0;
|
|
152
158
|
if (originalReasons !== void 0) {
|
|
153
159
|
const reasons = [];
|
|
154
160
|
for (const reason of originalReasons) {
|
|
@@ -257,7 +263,7 @@ const Value = Diagnostic.pipe(Schema.decodeTo(Schema.Unknown, SchemaTransformati
|
|
|
257
263
|
encode: (value) => capture(value)
|
|
258
264
|
})));
|
|
259
265
|
/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */
|
|
260
|
-
const Cause
|
|
266
|
+
const Cause = Schema.Cause(Value, Value).pipe(Schema.decodeTo(Schema.declare(EffectCause.isCause), SchemaTransformation.transform({
|
|
261
267
|
decode: (cause) => cause,
|
|
262
268
|
encode: (cause) => cause
|
|
263
269
|
})));
|
|
@@ -266,9 +272,9 @@ const Failure = Schema.Struct({
|
|
|
266
272
|
errorTag: Schema.NonEmptyString.check(Schema.isMaxLength(256)),
|
|
267
273
|
message: Text,
|
|
268
274
|
diagnostic: Schema.optionalKey(Diagnostic),
|
|
269
|
-
context: Schema.optionalKey(Context
|
|
275
|
+
context: Schema.optionalKey(Context)
|
|
270
276
|
}).pipe(strictSchema);
|
|
271
277
|
//#endregion
|
|
272
|
-
export { FailureDiagnostic_exports as a, captureContext as c, Failure as i, redactText as l, Context
|
|
278
|
+
export { FailureDiagnostic_exports as a, captureContext as c, Failure as i, redactText as l, Context as n, Value as o, Diagnostic as r, capture as s, Cause as t, strictSchema as u };
|
|
273
279
|
|
|
274
|
-
//# sourceMappingURL=FailureDiagnostic-
|
|
280
|
+
//# sourceMappingURL=FailureDiagnostic-D9oW23Cn.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FailureDiagnostic-D9oW23Cn.mjs","names":[],"sources":["../src/core/internal/strict-schema.ts","../src/core/FailureDiagnostic.ts"],"sourcesContent":["import * as Schema from \"effect/Schema\";\nimport * as SchemaParser from \"effect/SchemaParser\";\nimport * as SchemaTransformation from \"effect/SchemaTransformation\";\n\n/** Keep strict parsing on nested values even when an outer parser uses its defaults. */\nexport const strictSchema = <S extends Schema.Top>(schema: S) =>\n Schema.declareConstructor<S[\"Type\"], S[\"Encoded\"]>()(\n [schema],\n ([codec]) =>\n (value, _ast, options) =>\n SchemaParser.decodeUnknownEffect(codec)(value, { ...options, onExcessProperty: \"error\" }),\n {\n toCodecJson: ([codec]) =>\n Schema.link<S[\"Encoded\"]>()(codec, SchemaTransformation.passthrough()),\n },\n );\n","import * as EffectCause from \"effect/Cause\";\nimport * as Exit from \"effect/Exit\";\nimport * as Predicate from \"effect/Predicate\";\nimport * as Redacted from \"effect/Redacted\";\nimport * as Schema from \"effect/Schema\";\nimport * as SchemaTransformation from \"effect/SchemaTransformation\";\n\nimport { strictSchema } from \"./internal/strict-schema.ts\";\n\nconst Text = Schema.String.check(Schema.isMaxLength(16 * 1024));\nconst Name = Schema.String.check(Schema.isMaxLength(1_024));\nconst Scalar = Schema.Union([Text, Schema.Finite, Schema.Boolean, Schema.Null]);\n\n/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */\nexport const Context = Schema.Struct({\n agentId: Schema.optionalKey(Name),\n threadId: Schema.optionalKey(Name),\n runId: Schema.optionalKey(Name),\n submissionId: Schema.optionalKey(Name),\n attemptId: Schema.optionalKey(Name),\n turnId: Schema.optionalKey(Name),\n toolCallId: Schema.optionalKey(Name),\n toolName: Schema.optionalKey(Name),\n callId: Schema.optionalKey(Name),\n check: Schema.optionalKey(Name),\n operation: Schema.optionalKey(Name),\n}).pipe(strictSchema);\n\nexport type Context = typeof Context.Type;\n\ntype CauseReason =\n | { readonly _tag: \"Fail\"; readonly error: Diagnostic }\n | { readonly _tag: \"Die\"; readonly defect: Diagnostic }\n | { readonly _tag: \"Interrupt\"; readonly fiberId?: number };\n\n/** A private diagnostic projection, not a JavaScript error reconstruction or model response. */\nexport type Diagnostic =\n | {\n readonly _tag: \"Error\";\n readonly errorTag?: string;\n readonly name?: string;\n readonly message?: string;\n readonly stack?: string;\n readonly reason?: Diagnostic;\n readonly code?: string | number;\n readonly cause?: Diagnostic;\n readonly errors?: ReadonlyArray<Diagnostic>;\n readonly context?: Context;\n readonly omittedFields?: ReadonlyArray<string>;\n readonly truncated?: true;\n }\n | {\n readonly _tag: \"Cause\";\n readonly reasons: ReadonlyArray<CauseReason>;\n readonly truncated?: true;\n }\n | { readonly _tag: \"Value\"; readonly value: string | number | boolean | null }\n | { readonly _tag: \"Omitted\"; readonly reason: \"redacted\" | \"cycle\" | \"limit\" | \"unsupported\" };\n\nconst diagnosticSchema = <Nested extends Schema.Top>(nested: Nested) =>\n Schema.Union([\n Schema.Struct({\n _tag: Schema.Literal(\"Error\"),\n errorTag: Schema.optionalKey(Name),\n name: Schema.optionalKey(Name),\n message: Schema.optionalKey(Text),\n stack: Schema.optionalKey(Text),\n reason: Schema.optionalKey(nested),\n code: Schema.optionalKey(Schema.Union([Name, Schema.Finite])),\n cause: Schema.optionalKey(nested),\n errors: Schema.optionalKey(Schema.Array(nested).check(Schema.isMaxLength(128))),\n context: Schema.optionalKey(Context),\n omittedFields: Schema.optionalKey(Schema.Array(Name).check(Schema.isMaxLength(32))),\n truncated: Schema.optionalKey(Schema.Literal(true)),\n }),\n Schema.Struct({\n _tag: Schema.Literal(\"Cause\"),\n reasons: Schema.Array(\n Schema.Union([\n Schema.Struct({ _tag: Schema.Literal(\"Fail\"), error: nested }),\n Schema.Struct({ _tag: Schema.Literal(\"Die\"), defect: nested }),\n Schema.Struct({\n _tag: Schema.Literal(\"Interrupt\"),\n fiberId: Schema.optionalKey(Schema.Finite),\n }),\n ]),\n ).check(Schema.isMaxLength(128)),\n truncated: Schema.optionalKey(Schema.Literal(true)),\n }),\n Schema.Struct({ _tag: Schema.Literal(\"Value\"), value: Scalar }),\n Schema.Struct({\n _tag: Schema.Literal(\"Omitted\"),\n reason: Schema.Literals([\"redacted\", \"cycle\", \"limit\", \"unsupported\"]),\n }),\n ]);\n\n/** Structured, allowlisted Error fields and ordered Effect Fail/Die/Interrupt reasons. */\nexport const Diagnostic: Schema.Codec<Diagnostic> = Schema.suspend(() =>\n diagnosticSchema(Diagnostic),\n).pipe(strictSchema);\n\n// Inspect one encoded node only; recursion must share capture's depth/node/text budgets.\nconst decodeDiagnosticNode = Schema.decodeUnknownExit(\n diagnosticSchema(Schema.Unknown).pipe(strictSchema),\n);\n\n/** Remove common credential forms; hosts must keep arbitrary private payloads out of error text. */\nexport const redactText = (text: string): string =>\n text\n .replace(/\\b(Bearer|Basic)\\s+[A-Za-z0-9._~+/=-]+/gi, \"$1 [REDACTED]\")\n .replace(/(https?:\\/\\/)[^\\s/@]+:[^\\s/@]+@/gi, \"$1[REDACTED]@\")\n .replace(\n /([?&](?:access_token|api_key|apikey|token|key|secret|password|signature)=)[^\\s&#]*/gi,\n \"$1[REDACTED]\",\n )\n .replace(\n /\\b((?:api[_-]?key|access[_-]?token|authorization|password|secret)\\s*[=:]\\s*)[^\\s,;}]+/gi,\n \"$1[REDACTED]\",\n );\n\n/**\n * Capture only diagnostic fields. Local values are never mutated. Cycles and exhausted limits\n * are explicit, not silently dropped; capture visits at most 1,024 nodes, with 56 JSON levels\n * and 128 KiB text. Inner causes have priority over outer stacks when the text budget is exhausted.\n * Text remains operator-private. No generic serializer can identify secrets embedded in arbitrary\n * prose: application error messages must exclude payloads, and hosts may supply stricter redaction.\n */\nexport const capture = (\n value: unknown,\n options?: { readonly redactText?: (text: string) => string },\n): Diagnostic => {\n const seen = new WeakSet<object>();\n let remainingNodes = 1_024;\n let remainingText = 128 * 1024;\n\n const text = (value: string, limit = 16 * 1024): string => {\n const safe = (options?.redactText ?? redactText)(value);\n const length = Math.max(0, Math.min(limit, remainingText));\n\n const marker = \"[truncated]\".slice(0, length);\n\n const result =\n safe.length <= length ? safe : `${safe.slice(0, length - marker.length)}${marker}`;\n\n remainingText -= result.length;\n\n return result;\n };\n\n const visit = (value: unknown, depth: number): Diagnostic => {\n if (remainingNodes <= 0 || depth >= 56) return { _tag: \"Omitted\", reason: \"limit\" };\n remainingNodes--;\n if (Redacted.isRedacted(value)) return { _tag: \"Omitted\", reason: \"redacted\" };\n if (Predicate.isString(value)) return { _tag: \"Value\", value: text(value) };\n if (\n value === null ||\n Predicate.isBoolean(value) ||\n (Predicate.isNumber(value) && Number.isFinite(value))\n )\n return { _tag: \"Value\", value };\n if (!Predicate.isObject(value)) return { _tag: \"Omitted\", reason: \"unsupported\" };\n if (seen.has(value)) return { _tag: \"Omitted\", reason: \"cycle\" };\n seen.add(value);\n const nested = (value: unknown) => visit(value, depth + 1);\n // Local errors retain their own tag, even when it happens to be \"Error\".\n const decoded = value instanceof Error ? undefined : decodeDiagnosticNode(value);\n const node = decoded !== undefined && Exit.isSuccess(decoded) ? decoded.value : undefined;\n\n if (node?._tag === \"Omitted\" || node?._tag === \"Value\") {\n seen.delete(value);\n\n return node._tag === \"Value\" && typeof node.value === \"string\"\n ? { _tag: \"Value\", value: text(node.value) }\n : node;\n }\n\n const originalReasons = EffectCause.isCause(value)\n ? value.reasons\n : node?._tag === \"Cause\"\n ? node.reasons\n : undefined;\n\n if (originalReasons !== undefined) {\n const reasons: Array<CauseReason> = [];\n\n for (const reason of originalReasons) {\n if (reasons.length >= 128 || remainingNodes <= 0) break;\n remainingNodes--;\n\n // reasons -> array item -> error/defect contributes three JSON levels.\n switch (reason._tag) {\n case \"Fail\":\n reasons.push({ _tag: \"Fail\", error: visit(reason.error, depth + 3) });\n break;\n case \"Die\":\n reasons.push({ _tag: \"Die\", defect: visit(reason.defect, depth + 3) });\n break;\n case \"Interrupt\":\n reasons.push({\n _tag: \"Interrupt\",\n ...(reason.fiberId === undefined ? {} : { fiberId: reason.fiberId }),\n });\n break;\n }\n }\n\n const result: Diagnostic = {\n _tag: \"Cause\",\n ...(originalReasons.length > reasons.length || (node?._tag === \"Cause\" && node.truncated)\n ? { truncated: true }\n : {}),\n reasons,\n };\n\n seen.delete(value);\n\n return result;\n }\n const retained = node?._tag === \"Error\" ? node : undefined;\n const omittedFields: Array<string> = [];\n\n const read = (key: string): unknown => {\n // A throwing accessor must not replace the original failure during diagnostic capture.\n try {\n return Reflect.get(value, key);\n } catch {\n omittedFields.push(key);\n\n return undefined;\n }\n };\n\n const tag = retained === undefined ? read(\"_tag\") : retained.errorTag;\n const name = read(\"name\");\n const message = read(\"message\");\n const stack = read(\"stack\");\n const reason = read(\"reason\");\n const code = read(\"code\");\n const cause = read(\"cause\");\n const errors = read(\"errors\");\n const capturedCause = cause === undefined ? undefined : nested(cause);\n const capturedReason = reason === undefined ? undefined : nested(reason);\n const capturedErrors: Array<Diagnostic> = [];\n\n if (Array.isArray(errors))\n for (const error of errors) {\n if (capturedErrors.length >= 128 || remainingNodes <= 0) break;\n capturedErrors.push(visit(error, depth + 2));\n }\n\n for (const field of retained?.omittedFields ?? []) omittedFields.push(text(field, 1_024));\n\n const context: Record<string, string> = {};\n\n for (const key of [\n \"agentId\",\n \"threadId\",\n \"runId\",\n \"submissionId\",\n \"attemptId\",\n \"turnId\",\n \"toolCallId\",\n \"toolName\",\n \"callId\",\n \"check\",\n \"operation\",\n ] as const) {\n const field = retained === undefined ? read(key) : retained.context?.[key];\n\n if (Predicate.isString(field)) context[key] = text(field, 1_024);\n }\n\n const result: Diagnostic = {\n _tag: \"Error\",\n ...(Predicate.isString(tag) ? { errorTag: text(tag, 1_024) } : {}),\n ...(Predicate.isString(name) ? { name: text(name, 1_024) } : {}),\n ...(Predicate.isString(message) ? { message: text(message) } : {}),\n ...(Predicate.isString(stack) ? { stack: text(stack) } : {}),\n ...(capturedReason === undefined ? {} : { reason: capturedReason }),\n ...(Predicate.isString(code)\n ? { code: text(code, 1_024) }\n : Predicate.isNumber(code) && Number.isFinite(code)\n ? { code }\n : {}),\n ...(capturedCause === undefined ? {} : { cause: capturedCause }),\n ...(Array.isArray(errors) ? { errors: capturedErrors } : {}),\n ...(Object.keys(context).length === 0 ? {} : { context }),\n ...(omittedFields.length === 0 ? {} : { omittedFields }),\n ...(retained?.truncated ||\n (Array.isArray(errors) && errors.length > capturedErrors.length) ||\n remainingText === 0\n ? { truncated: true }\n : {}),\n };\n\n seen.delete(value);\n\n return result;\n };\n\n return visit(value, 0);\n};\n\n/** Bound and redact a diagnostic copy; canonical identities stay in their owning records. */\nexport const captureContext = (context: Context): Context => {\n const diagnostic = capture(context);\n\n return diagnostic._tag === \"Error\" ? (diagnostic.context ?? {}) : {};\n};\n\n/**\n * Preserve the original value in-process; across JSON retain its structured diagnostic projection.\n * Decoding returns Diagnostic data, never claims to reconstruct an application error class.\n */\nexport const Value = Diagnostic.pipe(\n Schema.decodeTo(\n Schema.Unknown,\n SchemaTransformation.transform({\n decode: (diagnostic): unknown => diagnostic,\n encode: (value: unknown) => capture(value),\n }),\n ),\n);\n\n/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */\nexport const Cause = Schema.Cause(Value, Value).pipe(\n Schema.decodeTo(\n Schema.declare<EffectCause.Cause<unknown>>(EffectCause.isCause),\n SchemaTransformation.transform({ decode: (cause) => cause, encode: (cause) => cause }),\n ),\n);\n\n/** Safe summary plus optional operator-private causal evidence retained at a terminal boundary. */\nexport const Failure = Schema.Struct({\n errorTag: Schema.NonEmptyString.check(Schema.isMaxLength(256)),\n message: Text,\n diagnostic: Schema.optionalKey(Diagnostic),\n context: Schema.optionalKey(Context),\n}).pipe(strictSchema);\n\nexport type Failure = typeof Failure.Type;\n"],"mappings":";;;;;;;;;;AAKA,MAAa,gBAAsC,WACjD,OAAO,mBAA4C,CAAC,CAClD,CAAC,MAAM,IACN,CAAC,YACC,OAAO,MAAM,YACZ,aAAa,oBAAoB,KAAK,CAA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9 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
import * as EffectCause from "effect/Cause";
|
|
2
3
|
declare namespace FailureDiagnostic_d_exports {
|
|
3
|
-
export { Cause
|
|
4
|
+
export { Cause, Context, Diagnostic, Failure, Value, capture, captureContext, redactText };
|
|
4
5
|
}
|
|
5
6
|
/** Correlation only: never include inputs, tool parameters, request bodies, or credentials. */
|
|
6
|
-
declare const Context
|
|
7
|
+
declare const Context: Schema.declareConstructor<{
|
|
7
8
|
readonly agentId?: string | undefined;
|
|
8
9
|
readonly threadId?: string | undefined;
|
|
9
10
|
readonly runId?: string | undefined;
|
|
@@ -52,7 +53,7 @@ declare const Context$1: Schema.declareConstructor<{
|
|
|
52
53
|
readonly check?: string | undefined;
|
|
53
54
|
readonly operation?: string | undefined;
|
|
54
55
|
}>;
|
|
55
|
-
type Context
|
|
56
|
+
type Context = typeof Context.Type;
|
|
56
57
|
type CauseReason = {
|
|
57
58
|
readonly _tag: "Fail";
|
|
58
59
|
readonly error: Diagnostic;
|
|
@@ -74,7 +75,7 @@ type Diagnostic = {
|
|
|
74
75
|
readonly code?: string | number;
|
|
75
76
|
readonly cause?: Diagnostic;
|
|
76
77
|
readonly errors?: ReadonlyArray<Diagnostic>;
|
|
77
|
-
readonly context?: Context
|
|
78
|
+
readonly context?: Context;
|
|
78
79
|
readonly omittedFields?: ReadonlyArray<string>;
|
|
79
80
|
readonly truncated?: true;
|
|
80
81
|
} | {
|
|
@@ -103,14 +104,14 @@ declare const capture: (value: unknown, options?: {
|
|
|
103
104
|
readonly redactText?: (text: string) => string;
|
|
104
105
|
}) => Diagnostic;
|
|
105
106
|
/** Bound and redact a diagnostic copy; canonical identities stay in their owning records. */
|
|
106
|
-
declare const captureContext: (context: Context
|
|
107
|
+
declare const captureContext: (context: Context) => Context;
|
|
107
108
|
/**
|
|
108
109
|
* Preserve the original value in-process; across JSON retain its structured diagnostic projection.
|
|
109
110
|
* Decoding returns Diagnostic data, never claims to reconstruct an application error class.
|
|
110
111
|
*/
|
|
111
112
|
declare const Value: Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>;
|
|
112
113
|
/** Original local Effect Cause; its JSON codec preserves ordered typed, defect and interrupt reasons. */
|
|
113
|
-
declare const Cause
|
|
114
|
+
declare const Cause: Schema.decodeTo<Schema.declare<EffectCause.Cause<unknown>, EffectCause.Cause<unknown>>, Schema.Cause<Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>, Schema.decodeTo<Schema.Unknown, Schema.Codec<Diagnostic, Diagnostic, never, never>, never, never>>, never, never>;
|
|
114
115
|
/** Safe summary plus optional operator-private causal evidence retained at a terminal boundary. */
|
|
115
116
|
declare const Failure: Schema.declareConstructor<{
|
|
116
117
|
readonly errorTag: string;
|
|
@@ -219,5 +220,5 @@ declare const Failure: Schema.declareConstructor<{
|
|
|
219
220
|
}>;
|
|
220
221
|
type Failure = typeof Failure.Type;
|
|
221
222
|
//#endregion
|
|
222
|
-
export { FailureDiagnostic_d_exports as a, captureContext as c, Failure as i, redactText as l, Context
|
|
223
|
-
//# sourceMappingURL=FailureDiagnostic-
|
|
223
|
+
export { FailureDiagnostic_d_exports as a, captureContext as c, Failure as i, redactText as l, Context as n, Value as o, Diagnostic as r, capture as s, Cause as t };
|
|
224
|
+
//# sourceMappingURL=FailureDiagnostic-DvHruCSJ.d.mts.map
|
package/dist/InMemory.d.mts
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
|
-
import { t as Store } from "./Thread-DOBQ0QUY.mjs";
|
|
2
1
|
import { SubagentReservations } from "./capabilities/SubagentReservations.mjs";
|
|
3
|
-
import { t as
|
|
4
|
-
import {
|
|
2
|
+
import { t as Store } from "./Thread-DT8RTLIQ.mjs";
|
|
3
|
+
import { t as ThreadHistory } from "./ThreadHistory-DQ-IC1hU.mjs";
|
|
4
|
+
import * as Schema$1 from "effect/Schema";
|
|
5
|
+
import * as Effect$1 from "effect/Effect";
|
|
6
|
+
import * as Layer$1 from "effect/Layer";
|
|
7
|
+
import { Scope } from "effect";
|
|
5
8
|
declare namespace InMemory_d_exports {
|
|
6
|
-
export { layer };
|
|
9
|
+
export { InMemoryScopeError, layer, scoped };
|
|
7
10
|
}
|
|
8
11
|
/**
|
|
9
12
|
* Run agents and attached subagents with in-memory conversation history.
|
|
10
13
|
* Provide once around the parent program and all child handler Layers so siblings
|
|
11
14
|
* share history and one reservation ledger. Reuse a Thread ID to continue a conversation.
|
|
12
15
|
* Conversations can span any number of Runs within the store's capacity limits.
|
|
16
|
+
* Use scoped for disposable request workflows within this shared store.
|
|
13
17
|
* Each independent Layer build owns fresh state; state is released when its Scope closes.
|
|
14
18
|
* Process loss loses history and active execution; this Layer provides no crash recovery.
|
|
15
19
|
*
|
|
@@ -18,7 +22,26 @@ declare namespace InMemory_d_exports {
|
|
|
18
22
|
* For storage-backed history, provide PersistentHistory.layer and a shared
|
|
19
23
|
* SubagentReservationsMemoryLive instead. Durable hosts own their own assembly.
|
|
20
24
|
*/
|
|
21
|
-
export declare const layer: Layer.Layer<Store | SubagentReservations | ThreadHistory, never, never>;
|
|
25
|
+
export declare const layer: Layer$1.Layer<Store | SubagentReservations | ThreadHistory, never, never>;
|
|
26
|
+
declare const InMemoryScopeError_base: Schema$1.Class<InMemoryScopeError, Schema$1.TaggedStruct<"InMemoryScopeError", {
|
|
27
|
+
readonly message: Schema$1.String;
|
|
28
|
+
}>, import("effect/Cause").YieldableError>;
|
|
29
|
+
/** Disposable lifetime requires an in-memory store and its incremental history adapter. */
|
|
30
|
+
export declare class InMemoryScopeError extends InMemoryScopeError_base {}
|
|
31
|
+
/**
|
|
32
|
+
* Own disposable conversations for one complete workflow on the enclosing shared store.
|
|
33
|
+
* Retain history across Runs and attached children inside the workflow, then release its
|
|
34
|
+
* Threads and encoded bytes on every exit. Existing retained or foreign Threads cannot be
|
|
35
|
+
* claimed. Counts and bytes share the application's original limits and reservation ledger.
|
|
36
|
+
*
|
|
37
|
+
* Consume streams, await start handles, and capture any snapshots inside this effect.
|
|
38
|
+
* Returned outputs and snapshots remain usable; returned IDs lose their continuation history.
|
|
39
|
+
* Persistent history adapters and stores without scoped ownership fail with InMemoryScopeError.
|
|
40
|
+
* This wrapper is for ordinary Runs; durable hosts retain their own journal history.
|
|
41
|
+
* Construct store-capturing hooks inside the workflow. The workflow's child fibers finish
|
|
42
|
+
* cleanup before history is released. Default application retention remains unchanged.
|
|
43
|
+
*/
|
|
44
|
+
export declare const scoped: <A, E, R>(effect: Effect$1.Effect<A, E, R>) => Effect$1.Effect<A, E | InMemoryScopeError, Exclude<Exclude<R, Store | ThreadHistory>, Scope.Scope> | Store | ThreadHistory>;
|
|
22
45
|
//#endregion
|
|
23
46
|
export { InMemory_d_exports as t };
|
|
24
47
|
//# sourceMappingURL=InMemory.d.mts.map
|
package/dist/InMemory.mjs
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { Store } from "./core/Thread.mjs";
|
|
3
|
+
import { ThreadHistory, layer as layer$1 } from "./engine/ThreadHistory.mjs";
|
|
3
4
|
import { SubagentReservationsMemoryLive } from "./capabilities/SubagentReservations.mjs";
|
|
4
|
-
import
|
|
5
|
+
import * as Schema from "effect/Schema";
|
|
6
|
+
import * as Effect from "effect/Effect";
|
|
7
|
+
import * as Fiber from "effect/Fiber";
|
|
8
|
+
import * as Layer from "effect/Layer";
|
|
5
9
|
//#region src/InMemory.ts
|
|
6
|
-
var InMemory_exports = /* @__PURE__ */ __exportAll({
|
|
10
|
+
var InMemory_exports = /* @__PURE__ */ __exportAll({
|
|
11
|
+
InMemoryScopeError: () => InMemoryScopeError,
|
|
12
|
+
layer: () => layer,
|
|
13
|
+
scoped: () => scoped
|
|
14
|
+
});
|
|
7
15
|
/**
|
|
8
16
|
* Run agents and attached subagents with in-memory conversation history.
|
|
9
17
|
* Provide once around the parent program and all child handler Layers so siblings
|
|
10
18
|
* share history and one reservation ledger. Reuse a Thread ID to continue a conversation.
|
|
11
19
|
* Conversations can span any number of Runs within the store's capacity limits.
|
|
20
|
+
* Use scoped for disposable request workflows within this shared store.
|
|
12
21
|
* Each independent Layer build owns fresh state; state is released when its Scope closes.
|
|
13
22
|
* Process loss loses history and active execution; this Layer provides no crash recovery.
|
|
14
23
|
*
|
|
@@ -18,7 +27,31 @@ var InMemory_exports = /* @__PURE__ */ __exportAll({ layer: () => layer });
|
|
|
18
27
|
* SubagentReservationsMemoryLive instead. Durable hosts own their own assembly.
|
|
19
28
|
*/
|
|
20
29
|
const layer = Layer.merge(layer$1, SubagentReservationsMemoryLive);
|
|
30
|
+
/** Disposable lifetime requires an in-memory store and its incremental history adapter. */
|
|
31
|
+
var InMemoryScopeError = class extends Schema.TaggedError()("InMemoryScopeError", { message: Schema.String }) {};
|
|
32
|
+
/**
|
|
33
|
+
* Own disposable conversations for one complete workflow on the enclosing shared store.
|
|
34
|
+
* Retain history across Runs and attached children inside the workflow, then release its
|
|
35
|
+
* Threads and encoded bytes on every exit. Existing retained or foreign Threads cannot be
|
|
36
|
+
* claimed. Counts and bytes share the application's original limits and reservation ledger.
|
|
37
|
+
*
|
|
38
|
+
* Consume streams, await start handles, and capture any snapshots inside this effect.
|
|
39
|
+
* Returned outputs and snapshots remain usable; returned IDs lose their continuation history.
|
|
40
|
+
* Persistent history adapters and stores without scoped ownership fail with InMemoryScopeError.
|
|
41
|
+
* This wrapper is for ordinary Runs; durable hosts retain their own journal history.
|
|
42
|
+
* Construct store-capturing hooks inside the workflow. The workflow's child fibers finish
|
|
43
|
+
* cleanup before history is released. Default application retention remains unchanged.
|
|
44
|
+
*/
|
|
45
|
+
const scoped = (effect) => Effect.scoped(Effect.gen(function* () {
|
|
46
|
+
const store = yield* Store;
|
|
47
|
+
const history = yield* ThreadHistory;
|
|
48
|
+
if (store.scoped === void 0 || history.retention !== "incremental" || history.memoryStore !== store) return yield* InMemoryScopeError.make({ message: "InMemory.scoped requires a scoped in-memory store and incremental history" });
|
|
49
|
+
const owned = yield* store.scoped;
|
|
50
|
+
const services = Layer.fresh(ThreadHistory.layerFromStore).pipe(Layer.provideMerge(Layer.succeed(Store, owned)));
|
|
51
|
+
const fiber = yield* effect.pipe(Effect.provide(services), Effect.forkScoped);
|
|
52
|
+
return yield* Fiber.join(fiber);
|
|
53
|
+
}));
|
|
21
54
|
//#endregion
|
|
22
|
-
export { layer, InMemory_exports as t };
|
|
55
|
+
export { InMemoryScopeError, layer, scoped, InMemory_exports as t };
|
|
23
56
|
|
|
24
57
|
//# sourceMappingURL=InMemory.mjs.map
|
package/dist/InMemory.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InMemory.mjs","names":["historyLayer"],"sources":["../src/InMemory.ts"],"sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"InMemory.mjs","names":["historyLayer"],"sources":["../src/InMemory.ts"],"sourcesContent":["import type { Scope } from \"effect\";\nimport * as Effect from \"effect/Effect\";\nimport * as Fiber from \"effect/Fiber\";\nimport * as Layer from \"effect/Layer\";\nimport * as Schema from \"effect/Schema\";\n\nimport { SubagentReservationsMemoryLive } from \"./capabilities/SubagentReservations.ts\";\nimport { Store } from \"./core/Thread.ts\";\nimport { ThreadHistory, layer as historyLayer } from \"./engine/ThreadHistory.ts\";\n\n/**\n * Run agents and attached subagents with in-memory conversation history.\n * Provide once around the parent program and all child handler Layers so siblings\n * share history and one reservation ledger. Reuse a Thread ID to continue a conversation.\n * Conversations can span any number of Runs within the store's capacity limits.\n * Use scoped for disposable request workflows within this shared store.\n * Each independent Layer build owns fresh state; state is released when its Scope closes.\n * Process loss loses history and active execution; this Layer provides no crash recovery.\n *\n * Models, tool handlers, and provider clients remain application-supplied. Default\n * IDs need no Layer; enclosing ID and context-preparation overrides are preserved.\n * For storage-backed history, provide PersistentHistory.layer and a shared\n * SubagentReservationsMemoryLive instead. Durable hosts own their own assembly.\n */\nexport const layer = Layer.merge(historyLayer, SubagentReservationsMemoryLive);\n\n/** Disposable lifetime requires an in-memory store and its incremental history adapter. */\nexport class InMemoryScopeError extends Schema.TaggedError<InMemoryScopeError>()(\n \"InMemoryScopeError\",\n { message: Schema.String },\n) {}\n\n/**\n * Own disposable conversations for one complete workflow on the enclosing shared store.\n * Retain history across Runs and attached children inside the workflow, then release its\n * Threads and encoded bytes on every exit. Existing retained or foreign Threads cannot be\n * claimed. Counts and bytes share the application's original limits and reservation ledger.\n *\n * Consume streams, await start handles, and capture any snapshots inside this effect.\n * Returned outputs and snapshots remain usable; returned IDs lose their continuation history.\n * Persistent history adapters and stores without scoped ownership fail with InMemoryScopeError.\n * This wrapper is for ordinary Runs; durable hosts retain their own journal history.\n * Construct store-capturing hooks inside the workflow. The workflow's child fibers finish\n * cleanup before history is released. Default application retention remains unchanged.\n */\nexport const scoped = <A, E, R>(\n effect: Effect.Effect<A, E, R>,\n): Effect.Effect<\n A,\n E | InMemoryScopeError,\n Exclude<Exclude<R, Store | ThreadHistory>, Scope.Scope> | Store | ThreadHistory\n> =>\n Effect.scoped(\n Effect.gen(function* () {\n const store = yield* Store;\n const history = yield* ThreadHistory;\n\n if (\n store.scoped === undefined ||\n history.retention !== \"incremental\" ||\n history.memoryStore !== store\n ) {\n return yield* InMemoryScopeError.make({\n message: \"InMemory.scoped requires a scoped in-memory store and incremental history\",\n });\n }\n const owned = yield* store.scoped;\n\n // The enclosing Layer memo map may already contain the application adapter.\n const services = Layer.fresh(ThreadHistory.layerFromStore).pipe(\n Layer.provideMerge(Layer.succeed(Store, owned)),\n );\n\n const fiber = yield* effect.pipe(Effect.provide(services), Effect.forkScoped);\n\n return yield* Fiber.join(fiber);\n }),\n );\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAwBA,MAAa,QAAQ,MAAM,MAAMA,SAAc,8BAA8B;;AAG7E,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA,EAAE,SAAS,OAAO,OAAO,CAC3B,CAAC,CAAC,CAAC;;;;;;;;;;;;;;AAeH,MAAa,UACX,WAMA,OAAO,OACL,OAAO,IAAI,aAAa;CACtB,MAAM,QAAQ,OAAO;CACrB,MAAM,UAAU,OAAO;CAEvB,IACE,MAAM,WAAW,KAAA,KACjB,QAAQ,cAAc,iBACtB,QAAQ,gBAAgB,OAExB,OAAO,OAAO,mBAAmB,KAAK,EACpC,SAAS,4EACX,CAAC;CAEH,MAAM,QAAQ,OAAO,MAAM;CAG3B,MAAM,WAAW,MAAM,MAAM,cAAc,cAAc,CAAC,CAAC,KACzD,MAAM,aAAa,MAAM,QAAQ,OAAO,KAAK,CAAC,CAChD;CAEA,MAAM,QAAQ,OAAO,OAAO,KAAK,OAAO,QAAQ,QAAQ,GAAG,OAAO,UAAU;CAE5E,OAAO,OAAO,MAAM,KAAK,KAAK;AAChC,CAAC,CACH"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { a as Receipt, t as IdempotencyKey } from "./Receipt-
|
|
2
|
-
import { r as AnyDefinition } from "./Agent-
|
|
3
|
-
import { a as MessageAdmission, c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError, r as InputMessage, s as PeerName, t as InboxEntry } from "./Messaging-
|
|
4
|
-
import { t as MessagingHost } from "./MessagingHost-
|
|
5
|
-
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
1
|
+
import { a as Receipt, t as IdempotencyKey } from "./Receipt-BkM21Qiu.mjs";
|
|
2
|
+
import { r as AnyDefinition } from "./Agent-D0fbFT2d.mjs";
|
|
3
|
+
import { a as MessageAdmission, c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError, r as InputMessage, s as PeerName, t as InboxEntry } from "./Messaging-DF_IWnxV.mjs";
|
|
4
|
+
import { t as MessagingHost } from "./MessagingHost-Bfbfkx6f.mjs";
|
|
6
5
|
import { Crypto, Effect, Schema } from "effect";
|
|
6
|
+
import { Tool, Toolkit } from "effect/unstable/ai";
|
|
7
7
|
declare namespace Messaging_d_exports {
|
|
8
8
|
export { InboxEntry, InboxPage, InputMessage, MessageAddress, MessageAdmission, MessageRef, MessageStatus, MessagingError, Peer, PeerName, inbox, inboxTool, inspect, inspectTool, peer, reply, replyTool, retry, retryTool, send, sendTool };
|
|
9
9
|
}
|
|
@@ -1064,4 +1064,4 @@ declare const retryTool: <const Name extends string, Input extends Schema.Top>(d
|
|
|
1064
1064
|
};
|
|
1065
1065
|
//#endregion
|
|
1066
1066
|
export { inspect as a, reply as c, retryTool as d, send as f, inboxTool as i, replyTool as l, Peer as n, inspectTool as o, sendTool as p, inbox as r, peer as s, Messaging_d_exports as t, retry as u };
|
|
1067
|
-
//# sourceMappingURL=Messaging-
|
|
1067
|
+
//# sourceMappingURL=Messaging-BbuaphiQ.d.mts.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { s as SubagentExecutionFailure } from "./SubagentContract-
|
|
2
|
-
import { a as Receipt } from "./Receipt-
|
|
3
|
-
import { r as Update } from "./AgentUpdates-
|
|
4
|
-
import
|
|
1
|
+
import { s as SubagentExecutionFailure } from "./SubagentContract-DdPzxYQj.mjs";
|
|
2
|
+
import { a as Receipt } from "./Receipt-BkM21Qiu.mjs";
|
|
3
|
+
import { r as Update } from "./AgentUpdates-DksV4D0A.mjs";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
5
|
//#region src/core/internal/message-status.d.ts
|
|
6
6
|
/** A retained outbound delivery identity, not a destination Receipt or access grant. */
|
|
7
7
|
declare const MessageRef: Schema.Struct<{
|
|
@@ -218,4 +218,4 @@ declare const InputMessage: Schema.Union<readonly [Schema.Struct<{
|
|
|
218
218
|
type InputMessage = typeof InputMessage.Type;
|
|
219
219
|
//#endregion
|
|
220
220
|
export { MessageAdmission as a, MessageRef as c, MessageAddress as i, MessageStatus as l, InboxPage as n, MessagingError as o, InputMessage as r, PeerName as s, InboxEntry as t };
|
|
221
|
-
//# sourceMappingURL=Messaging-
|
|
221
|
+
//# sourceMappingURL=Messaging-DF_IWnxV.d.mts.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { u as ThreadId } from "./Identifiers-CN2s30fF.mjs";
|
|
2
|
-
import { r as Principal, t as IdempotencyKey } from "./Receipt-
|
|
3
|
-
import { r as AnyDefinition } from "./Agent-
|
|
4
|
-
import { h as WorkerSource } from "./Worker-
|
|
5
|
-
import { c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError } from "./Messaging-
|
|
6
|
-
import
|
|
2
|
+
import { r as Principal, t as IdempotencyKey } from "./Receipt-BkM21Qiu.mjs";
|
|
3
|
+
import { r as AnyDefinition } from "./Agent-D0fbFT2d.mjs";
|
|
4
|
+
import { h as WorkerSource } from "./Worker-DH5SAVIK.mjs";
|
|
5
|
+
import { c as MessageRef, i as MessageAddress, l as MessageStatus, n as InboxPage, o as MessagingError } from "./Messaging-DF_IWnxV.mjs";
|
|
6
|
+
import * as Context$1 from "effect/Context";
|
|
7
|
+
import { Effect } from "effect";
|
|
7
8
|
declare namespace MessagingHost_d_exports {
|
|
8
9
|
export { MessagingHost, PeerAuthorizationRequest, PeerAuthorizer, PeerDeliveryLifetime, PeerMessageCapacity, PeerRoutes, PeerTarget, SendPeerMessage };
|
|
9
10
|
}
|
|
@@ -18,7 +19,7 @@ interface SendPeerMessage extends PeerTarget {
|
|
|
18
19
|
/** Correlation on sends; replies additionally resolve and authorize the recorded return address. */
|
|
19
20
|
readonly inReplyTo?: MessageRef;
|
|
20
21
|
}
|
|
21
|
-
declare const MessagingHost_base: Context.ServiceClass<MessagingHost, "@effect-agent/engine/MessagingHost", {
|
|
22
|
+
declare const MessagingHost_base: Context$1.ServiceClass<MessagingHost, "@effect-agent/engine/MessagingHost", {
|
|
22
23
|
readonly context: Effect.Effect<WorkerSource, MessagingError>;
|
|
23
24
|
readonly send: (request: SendPeerMessage) => Effect.Effect<MessageStatus, MessagingError>;
|
|
24
25
|
readonly reply: (request: SendPeerMessage & {
|
|
@@ -39,7 +40,7 @@ declare const MessagingHost_base: Context.ServiceClass<MessagingHost, "@effect-a
|
|
|
39
40
|
declare class MessagingHost extends MessagingHost_base {
|
|
40
41
|
static readonly unavailable: MessagingHost["Service"];
|
|
41
42
|
/** Runtime-owned per-call binding. Unconfigured Runs deny peer operations. */
|
|
42
|
-
static readonly forTool: Context.Reference<(source: Extract<WorkerSource, {
|
|
43
|
+
static readonly forTool: Context$1.Reference<(source: Extract<WorkerSource, {
|
|
43
44
|
readonly _tag: "tool";
|
|
44
45
|
}>) => MessagingHost["Service"]>;
|
|
45
46
|
}
|
|
@@ -52,12 +53,12 @@ interface PeerAuthorizationRequest {
|
|
|
52
53
|
readonly peerName?: string;
|
|
53
54
|
readonly destination?: MessageAddress;
|
|
54
55
|
}
|
|
55
|
-
declare const PeerAuthorizer: Context.Reference<{
|
|
56
|
+
declare const PeerAuthorizer: Context$1.Reference<{
|
|
56
57
|
/** Return the stable delivery principal for sends. It is retained with the frozen envelope. */
|
|
57
58
|
readonly authorize: (request: PeerAuthorizationRequest) => Effect.Effect<Principal, MessagingError>;
|
|
58
59
|
}>;
|
|
59
60
|
/** Application-owned routing; the target Agent is resolved from the existing exact registrations. */
|
|
60
|
-
declare const PeerRoutes: Context.Reference<{
|
|
61
|
+
declare const PeerRoutes: Context$1.Reference<{
|
|
61
62
|
readonly resolve: (request: {
|
|
62
63
|
readonly source: MessageAddress;
|
|
63
64
|
readonly principal: Principal;
|
|
@@ -66,9 +67,9 @@ declare const PeerRoutes: Context.Reference<{
|
|
|
66
67
|
}) => Effect.Effect<ThreadId, MessagingError>;
|
|
67
68
|
}>;
|
|
68
69
|
/** Retry windows are finite; exhaustion parks the retained envelope for explicit authorized retry. */
|
|
69
|
-
declare const PeerDeliveryLifetime: Context.Reference<number>;
|
|
70
|
+
declare const PeerDeliveryLifetime: Context$1.Reference<number>;
|
|
70
71
|
/** Bound canonical send intents across all peers and principals in one source Thread. */
|
|
71
|
-
declare const PeerMessageCapacity: Context.Reference<number>;
|
|
72
|
+
declare const PeerMessageCapacity: Context$1.Reference<number>;
|
|
72
73
|
//#endregion
|
|
73
74
|
export { PeerDeliveryLifetime as a, PeerTarget as c, PeerAuthorizer as i, SendPeerMessage as l, MessagingHost_d_exports as n, PeerMessageCapacity as o, PeerAuthorizationRequest as r, PeerRoutes as s, MessagingHost as t };
|
|
74
|
-
//# sourceMappingURL=MessagingHost-
|
|
75
|
+
//# sourceMappingURL=MessagingHost-Bfbfkx6f.d.mts.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { t as __exportAll } from "./rolldown-runtime-D7D4PA-g.mjs";
|
|
2
2
|
import { AgentId, ThreadId } from "./core/Identifiers.mjs";
|
|
3
|
-
import { S as MessageRef, r as FrameworkMessage } from "./Worker-
|
|
4
|
-
import
|
|
3
|
+
import { S as MessageRef, r as FrameworkMessage } from "./Worker-DZjdMjZn.mjs";
|
|
4
|
+
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Context from "effect/Context";
|
|
5
6
|
//#region src/core/Messaging.ts
|
|
6
7
|
/** Application-chosen fixed route name; it never authorizes a destination by itself. */
|
|
7
8
|
const PeerName = Schema.NonEmptyString.check(Schema.isMaxLength(64), Schema.isPattern(/^[a-zA-Z0-9_-]+$/u));
|
|
@@ -107,4 +108,4 @@ const PeerMessageCapacity = Context.Reference("@effect-agent/thread/PeerMessageC
|
|
|
107
108
|
//#endregion
|
|
108
109
|
export { PeerMessageCapacity as a, InboxPage as c, MessageAdmission as d, MessagingError as f, PeerDeliveryLifetime as i, InputMessage as l, MessagingHost_exports as n, PeerRoutes as o, PeerName as p, PeerAuthorizer as r, InboxEntry as s, MessagingHost as t, MessageAddress as u };
|
|
109
110
|
|
|
110
|
-
//# sourceMappingURL=MessagingHost-
|
|
111
|
+
//# sourceMappingURL=MessagingHost-DJZJZILu.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MessagingHost-DJZJZILu.mjs","names":[],"sources":["../src/core/Messaging.ts","../src/engine/MessagingHost.ts"],"sourcesContent":["import * as Schema from \"effect/Schema\";\n\nimport { AgentId, ThreadId } from \"./Identifiers.ts\";\nimport { MessageRef } from \"./internal/message-status.ts\";\nimport { FrameworkMessage } from \"./Worker.ts\";\n\nexport { MessageRef, MessageStatus } from \"./internal/message-status.ts\";\n\n/** Application-chosen fixed route name; it never authorizes a destination by itself. */\nexport const PeerName = Schema.NonEmptyString.check(\n Schema.isMaxLength(64),\n Schema.isPattern(/^[a-zA-Z0-9_-]+$/u),\n);\n\nexport type PeerName = typeof PeerName.Type;\n\nexport const MessageAddress = Schema.Struct({ threadId: ThreadId, agentId: AgentId });\nexport type MessageAddress = typeof MessageAddress.Type;\n\n/** Host-authenticated provenance stored separately from destination-owned application input. */\nexport const MessageAdmission = Schema.Struct({\n schemaVersion: Schema.Literal(1),\n message: MessageRef,\n peerName: PeerName,\n sender: MessageAddress,\n returnAddress: MessageAddress,\n inReplyTo: Schema.optionalKey(MessageRef),\n}).check(\n Schema.makeFilter(\n (value) =>\n value.message.ownerThreadId === value.sender.threadId &&\n value.sender.threadId === value.returnAddress.threadId &&\n value.sender.agentId === value.returnAddress.agentId,\n ),\n);\n\nexport type MessageAdmission = typeof MessageAdmission.Type;\n\nexport const InboxEntry = Schema.Struct({\n sequence: Schema.Natural.check(Schema.isGreaterThan(0)),\n admission: MessageAdmission,\n});\n\nexport type InboxEntry = typeof InboxEntry.Type;\n\nexport const InboxPage = Schema.Struct({\n items: Schema.Array(InboxEntry).check(Schema.isMaxLength(100)),\n next: Schema.NullOr(Schema.Natural),\n});\n\nexport type InboxPage = typeof InboxPage.Type;\n\nexport class MessagingError extends Schema.TaggedError<MessagingError>()(\"MessagingError\", {\n operation: Schema.Literals([\"context\", \"send\", \"reply\", \"inbox\", \"inspect\", \"retry\"]),\n reason: Schema.Literals([\n \"denied\",\n \"unavailable\",\n \"route-unavailable\",\n \"binding-mismatch\",\n \"invalid-input\",\n \"invalid-reference\",\n \"conflict\",\n \"capacity\",\n \"not-found\",\n \"storage\",\n \"corrupt\",\n ]),\n}) {}\n\n/** Canonical input provenance: peer input or a framework-owned completion message. */\nexport const InputMessage = Schema.Union([MessageAdmission, FrameworkMessage]);\nexport type InputMessage = typeof InputMessage.Type;\n","import type { Effect } from \"effect\";\nimport * as Context from \"effect/Context\";\n\nimport type { AnyDefinition } from \"../core/Agent.ts\";\nimport type { ThreadId } from \"../core/Identifiers.ts\";\nimport {\n type InboxPage,\n type MessageAddress,\n type MessageRef,\n type MessageStatus,\n MessagingError,\n} from \"../core/Messaging.ts\";\nimport type { IdempotencyKey, Principal } from \"../core/Receipt.ts\";\nimport type { WorkerSource } from \"../core/Worker.ts\";\n\nexport interface PeerTarget {\n readonly name: string;\n readonly target: AnyDefinition;\n}\n\n/** A fixed declaration chooses the route. Caller input never selects a destination Thread. */\nexport interface SendPeerMessage extends PeerTarget {\n readonly encodedInput: unknown;\n readonly idempotencyKey: IdempotencyKey;\n /** Correlation on sends; replies additionally resolve and authorize the recorded return address. */\n readonly inReplyTo?: MessageRef;\n}\n\n/** Trusted per-invocation facet. It carries caller authority without exposing it in Tool schemas. */\nexport class MessagingHost extends Context.Service<\n MessagingHost,\n {\n readonly context: Effect.Effect<WorkerSource, MessagingError>;\n readonly send: (request: SendPeerMessage) => Effect.Effect<MessageStatus, MessagingError>;\n readonly reply: (\n request: SendPeerMessage & { readonly inReplyTo: MessageRef },\n ) => Effect.Effect<MessageStatus, MessagingError>;\n readonly inbox: (\n request: PeerTarget & { readonly after?: number; readonly limit: number },\n ) => Effect.Effect<InboxPage, MessagingError>;\n readonly inspect: (\n request: PeerTarget & { readonly message: MessageRef },\n ) => Effect.Effect<MessageStatus, MessagingError>;\n readonly retry: (\n request: PeerTarget & { readonly message: MessageRef },\n ) => Effect.Effect<MessageStatus, MessagingError>;\n }\n>()(\"@effect-agent/engine/MessagingHost\") {\n static readonly unavailable: MessagingHost[\"Service\"] = {\n context: MessagingError.make({ operation: \"context\", reason: \"unavailable\" }),\n send: () => MessagingError.make({ operation: \"send\", reason: \"unavailable\" }),\n reply: () => MessagingError.make({ operation: \"reply\", reason: \"unavailable\" }),\n inbox: () => MessagingError.make({ operation: \"inbox\", reason: \"unavailable\" }),\n inspect: () => MessagingError.make({ operation: \"inspect\", reason: \"unavailable\" }),\n retry: () => MessagingError.make({ operation: \"retry\", reason: \"unavailable\" }),\n };\n\n /** Runtime-owned per-call binding. Unconfigured Runs deny peer operations. */\n static readonly forTool = Context.Reference<\n (source: Extract<WorkerSource, { readonly _tag: \"tool\" }>) => MessagingHost[\"Service\"]\n >(\"@effect-agent/engine/MessagingHost/forTool\", {\n defaultValue: () => () => MessagingHost.unavailable,\n });\n}\n\n/** Separate context, history, send and management grants; incoming messages grant none of them. */\nexport interface PeerAuthorizationRequest {\n readonly source: MessageAddress;\n readonly principal: Principal;\n readonly operation: MessagingError[\"operation\"];\n readonly access: \"context\" | \"read\" | \"send\" | \"control\";\n readonly peerName?: string;\n readonly destination?: MessageAddress;\n}\n\nexport const PeerAuthorizer = Context.Reference<{\n /** Return the stable delivery principal for sends. It is retained with the frozen envelope. */\n readonly authorize: (\n request: PeerAuthorizationRequest,\n ) => Effect.Effect<Principal, MessagingError>;\n}>(\"@effect-agent/thread/PeerAuthorizer\", {\n defaultValue: () => ({\n authorize: (request) => MessagingError.make({ operation: request.operation, reason: \"denied\" }),\n }),\n});\n\n/** Application-owned routing; the target Agent is resolved from the existing exact registrations. */\nexport const PeerRoutes = Context.Reference<{\n readonly resolve: (request: {\n readonly source: MessageAddress;\n readonly principal: Principal;\n readonly peerName: string;\n readonly targetAgentId: MessageAddress[\"agentId\"];\n }) => Effect.Effect<ThreadId, MessagingError>;\n}>(\"@effect-agent/thread/PeerRoutes\", {\n defaultValue: () => ({\n resolve: () => MessagingError.make({ operation: \"send\", reason: \"route-unavailable\" }),\n }),\n});\n\n/** Retry windows are finite; exhaustion parks the retained envelope for explicit authorized retry. */\nexport const PeerDeliveryLifetime = Context.Reference<number>(\n \"@effect-agent/thread/PeerDeliveryLifetime\",\n { defaultValue: () => 86_400_000 },\n);\n\n/** Bound canonical send intents across all peers and principals in one source Thread. */\nexport const PeerMessageCapacity = Context.Reference<number>(\n \"@effect-agent/thread/PeerMessageCapacity\",\n { defaultValue: () => 256 },\n);\n"],"mappings":";;;;;;;AASA,MAAa,WAAW,OAAO,eAAe,MAC5C,OAAO,YAAY,EAAE,GACrB,OAAO,UAAU,mBAAmB,CACtC;AAIA,MAAa,iBAAiB,OAAO,OAAO;CAAE,UAAU;CAAU,SAAS;AAAQ,CAAC;;AAIpF,MAAa,mBAAmB,OAAO,OAAO;CAC5C,eAAe,OAAO,QAAQ,CAAC;CAC/B,SAAS;CACT,UAAU;CACV,QAAQ;CACR,eAAe;CACf,WAAW,OAAO,YAAY,UAAU;AAC1C,CAAC,CAAC,CAAC,MACD,OAAO,YACJ,UACC,MAAM,QAAQ,kBAAkB,MAAM,OAAO,YAC7C,MAAM,OAAO,aAAa,MAAM,cAAc,YAC9C,MAAM,OAAO,YAAY,MAAM,cAAc,OACjD,CACF;AAIA,MAAa,aAAa,OAAO,OAAO;CACtC,UAAU,OAAO,QAAQ,MAAM,OAAO,cAAc,CAAC,CAAC;CACtD,WAAW;AACb,CAAC;AAID,MAAa,YAAY,OAAO,OAAO;CACrC,OAAO,OAAO,MAAM,UAAU,CAAC,CAAC,MAAM,OAAO,YAAY,GAAG,CAAC;CAC7D,MAAM,OAAO,OAAO,OAAO,OAAO;AACpC,CAAC;AAID,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,WAAW,OAAO,SAAS;EAAC;EAAW;EAAQ;EAAS;EAAS;EAAW;CAAO,CAAC;CACpF,QAAQ,OAAO,SAAS;EACtB;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;EACA;CACF,CAAC;AACH,CAAC,CAAC,CAAC,CAAC;;AAGJ,M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ompt";
|
|
4
4
|
//#region src/engine/internal/output-contract.d.ts
|
|
5
5
|
/**
|
|
6
6
|
* Declare ordinary assistant text as an Agent's final-output wire format. Apply this to the
|
|
@@ -22,4 +22,4 @@ declare namespace Output_d_exports {
|
|
|
22
22
|
}
|
|
23
23
|
//#endregion
|
|
24
24
|
export { textOutput as n, Output_d_exports as t };
|
|
25
|
-
//# sourceMappingURL=Output-
|
|
25
|
+
//# sourceMappingURL=Output-UsQKiPhz.d.mts.map
|
package/dist/{PreparedInputAdmission-CS_zlCvD.d.mts → PreparedInputAdmission-DXvjTe4U.d.mts}
RENAMED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { a as Receipt } from "./Receipt-
|
|
2
|
-
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-
|
|
3
|
-
import { Oi as SubmissionStatus } from "./Admin-
|
|
4
|
-
import { H as ScheduledInputRefused, V as ScheduledInputFailure, j as ScheduleStorageError } from "./Schedule-
|
|
5
|
-
import { a as PreparedInput } from "./Subscription-
|
|
1
|
+
import { a as Receipt } from "./Receipt-BkM21Qiu.mjs";
|
|
2
|
+
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-DvHruCSJ.mjs";
|
|
3
|
+
import { Oi as SubmissionStatus } from "./Admin-CbwoQEm8.mjs";
|
|
4
|
+
import { H as ScheduledInputRefused, V as ScheduledInputFailure, j as ScheduleStorageError } from "./Schedule-rEIiYnRq.mjs";
|
|
5
|
+
import { a as PreparedInput } from "./Subscription-BJj-R-6V.mjs";
|
|
6
6
|
import { Context, Effect } from "effect";
|
|
7
7
|
declare namespace PreparedInputAdmission_d_exports {
|
|
8
8
|
export { PreparedInputAdmission, admitPreparedInput };
|
|
@@ -39,4 +39,4 @@ declare const admitPreparedInput: <R>(submit: Effect.Effect<Receipt, ScheduledIn
|
|
|
39
39
|
}, ScheduleStorageError, R>;
|
|
40
40
|
//#endregion
|
|
41
41
|
export { PreparedInputAdmission_d_exports as n, admitPreparedInput as r, PreparedInputAdmission as t };
|
|
42
|
-
//# sourceMappingURL=PreparedInputAdmission-
|
|
42
|
+
//# sourceMappingURL=PreparedInputAdmission-DXvjTe4U.d.mts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
2
|
declare namespace Receipt_d_exports {
|
|
3
3
|
export { IdempotencyKey, JoinedToHost, Principal, QueueSequence, Receipt };
|
|
4
4
|
}
|
|
@@ -30,4 +30,4 @@ declare const JoinedToHost_base: Schema.Class<JoinedToHost, Schema.TaggedStruct<
|
|
|
30
30
|
declare class JoinedToHost extends JoinedToHost_base {}
|
|
31
31
|
//#endregion
|
|
32
32
|
export { Receipt as a, QueueSequence as i, JoinedToHost as n, Receipt_d_exports as o, Principal as r, IdempotencyKey as t };
|
|
33
|
-
//# sourceMappingURL=Receipt-
|
|
33
|
+
//# sourceMappingURL=Receipt-BkM21Qiu.d.mts.map
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDelegationCaps, s as SubagentExecutionFailure, u as SubagentParentLink } from "./SubagentContract-
|
|
2
|
-
import { a as Receipt } from "./Receipt-
|
|
3
|
-
import { r as Update } from "./AgentUpdates-
|
|
4
|
-
import { c as Selection, l as Snapshot } from "./ToolExposure-
|
|
5
|
-
import { l as RunUsageSummary, r as ModelCallUsage, s as RunTotals } from "./Usage-
|
|
6
|
-
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-
|
|
7
|
-
import { t as AgentPolicy } from "./AgentPolicy-
|
|
1
|
+
import { d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDelegationCaps, s as SubagentExecutionFailure, u as SubagentParentLink } from "./SubagentContract-DdPzxYQj.mjs";
|
|
2
|
+
import { a as Receipt } from "./Receipt-BkM21Qiu.mjs";
|
|
3
|
+
import { r as Update } from "./AgentUpdates-DksV4D0A.mjs";
|
|
4
|
+
import { c as Selection, l as Snapshot } from "./ToolExposure-Ckg3-sTf.mjs";
|
|
5
|
+
import { l as RunUsageSummary, r as ModelCallUsage, s as RunTotals } from "./Usage-CzZJ6A2n.mjs";
|
|
6
|
+
import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "./FailureDiagnostic-DvHruCSJ.mjs";
|
|
7
|
+
import { t as AgentPolicy } from "./AgentPolicy-CclAEpHn.mjs";
|
|
8
8
|
import { Schema } from "effect";
|
|
9
9
|
declare namespace Records_d_exports {
|
|
10
10
|
export { AbortRequested, AbortedSubmissionSettled, AgentUpdateEmitted, ApprovalDecision, BatchId, CURRENT_CANONICAL_SCHEMA_VERSION, CanonicalBatch, CanonicalRecord, CanonicalRecordEnvelope, CanonicalRecordPayload, CanonicalSequence, CompactionCreated, CompletedSubmissionSettled, DefinitionDigestInput, DefinitionDigests, DeploymentId, Digest, FailedSubmissionSettled, MAX_PERSISTED_JSON_BYTES, MAX_PERSISTED_JSON_COLLECTION_LENGTH, MAX_PERSISTED_JSON_DEPTH, MAX_PERSISTED_JSON_NODES, ModelCallAborted, ModelCompleted, ModelResponseInterrupted, ModelResponseRecorded, ObservationOffset, PeerMessagePrepared, PersistedJson, ProducerEpoch, ProducerId, RecordEnvelope, RecordId, RepairAnnotated, ReplayContract, RunCompleted, RunDurationExhausted, RunFailed, RunPolicyUsageReserved, RunStartedRecord, SettlementFailureDiagnostic, SettlementOutcome, SubagentJoined, SubagentLineageRecorded, SubagentRequested, SubagentStarted, SubmissionSettled, SubmissionSettledRecord, SubtreeBudgetReserved, ThreadCreated, ToolApprovalDecided, ToolApprovalRequested, ToolCallPrepared, ToolCallResolution, ToolCallResolved, ToolCallSettled, ToolCallUnknown, ToolOperation, ToolStepSettled, ToolUnavailable, UserInputRecorded, WorkerAdmission, WorkerContinuation, WorkerInputCompleted, WorkerInputRequested, WorkerOrigin, WorkerOriginRecorded, WorkerReportPrepared, WorkerReportRefused, WorkerReportingIntent, WorkerStopRequested };
|
|
@@ -1112,4 +1112,4 @@ declare class CanonicalRecordEnvelope extends CanonicalRecordEnvelope_base {}
|
|
|
1112
1112
|
declare const CURRENT_CANONICAL_SCHEMA_VERSION: 1;
|
|
1113
1113
|
//#endregion
|
|
1114
1114
|
export { ToolApprovalRequested as $, ProducerEpoch as A, RunPolicyUsageReserved as B, ModelCallAborted as C, ObservationOffset as D, ModelResponseRecorded as E, RepairAnnotated as F, SubagentLineageRecorded as G, SettlementFailureDiagnostic as H, ReplayContract as I, SubmissionSettled as J, SubagentRequested as K, RunCompleted as L, RecordEnvelope as M, RecordId as N, PeerMessagePrepared as O, Records_d_exports as P, ToolApprovalDecided as Q, RunDurationExhausted as R, MAX_PERSISTED_JSON_NODES as S, ModelResponseInterrupted as T, SettlementOutcome as U, RunStartedRecord as V, SubagentJoined as W, SubtreeBudgetReserved as X, SubmissionSettledRecord as Y, ThreadCreated as Z, Digest as _, WorkerReportingIntent as _t, BatchId as a, ToolOperation as at, MAX_PERSISTED_JSON_COLLECTION_LENGTH as b, CanonicalRecord as c, UserInputRecorded as ct, CanonicalSequence as d, WorkerInputCompleted as dt, ToolCallPrepared as et, CompactionCreated as f, WorkerInputRequested as ft, DeploymentId as g, WorkerReportRefused as gt, DefinitionDigests as h, WorkerReportPrepared as ht, ApprovalDecision as i, ToolCallUnknown as it, ProducerId as j, PersistedJson as k, CanonicalRecordEnvelope as l, WorkerAdmission as lt, DefinitionDigestInput as m, WorkerOriginRecorded as mt, AbortedSubmissionSettled as n, ToolCallResolved as nt, CURRENT_CANONICAL_SCHEMA_VERSION as o, ToolStepSettled as ot, CompletedSubmissionSettled as p, WorkerOrigin as pt, SubagentStarted as q, AgentUpdateEmitted as r, ToolCallSettled as rt, CanonicalBatch as s, ToolUnavailable as st, AbortRequested as t, ToolCallResolution as tt, CanonicalRecordPayload as u, WorkerContinuation as ut, FailedSubmissionSettled as v, WorkerStopRequested as vt, ModelCompleted as w, MAX_PERSISTED_JSON_DEPTH as x, MAX_PERSISTED_JSON_BYTES as y, RunFailed as z };
|
|
1115
|
-
//# sourceMappingURL=Records-
|
|
1115
|
+
//# sourceMappingURL=Records-CAQktL0z.d.mts.map
|