effect-agent 0.1.0-beta.152 → 0.1.0-beta.153

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.
Files changed (131) hide show
  1. package/dist/{Admin-CKIdJoP8.d.mts → Admin-BjmupLN3.d.mts} +36 -17
  2. package/dist/{Agent-Cjd_ZveM.d.mts → Agent-BCyrGaWg.d.mts} +2 -2
  3. package/dist/{AgentPolicy-BqDoSXO6.d.mts → AgentPolicy-CnXWWwdg.d.mts} +5 -1
  4. package/dist/{AgentRuntime-sXpKcyxu.d.mts → AgentRuntime-BAjT5gXl.d.mts} +10 -10
  5. package/dist/{AgentRuntime-D8U9gl9Q.mjs → AgentRuntime-IF_1GoUf.mjs} +54 -11
  6. package/dist/AgentRuntime-IF_1GoUf.mjs.map +1 -0
  7. package/dist/{ContextCompactor-WwSIG_Z2.d.mts → ContextCompactor-CPlStZRc.d.mts} +2 -2
  8. package/dist/{Digest-U69rDHuO.d.mts → Digest-CaJ2RIsF.d.mts} +2 -2
  9. package/dist/{DurableAgentRuntime-DQFV26SB.mjs → DurableAgentRuntime-BQzYkFVy.mjs} +185 -88
  10. package/dist/DurableAgentRuntime-BQzYkFVy.mjs.map +1 -0
  11. package/dist/{EventSource-CMbXXmwe.d.mts → EventSource-C8CKwQy5.d.mts} +3 -3
  12. package/dist/InMemory.d.mts +1 -1
  13. package/dist/{Messaging-ccQURKCf.d.mts → Messaging-B1zumorg.d.mts} +3 -3
  14. package/dist/{MessagingHost-D04wE-7W.d.mts → MessagingHost-B4jqlJmx.d.mts} +3 -3
  15. package/dist/{Output-CFD1CPfU.d.mts → Output-WL7JexCm.d.mts} +2 -2
  16. package/dist/{PreparedInputAdmission-Bt6rgtVu.d.mts → PreparedInputAdmission-CU1PzUVD.d.mts} +4 -4
  17. package/dist/{Records-B5GFWCpn.d.mts → Records-BrEpibum.d.mts} +17 -6
  18. package/dist/{RunEvent-DIrzkjLr.d.mts → RunEvent-DV_llBcq.d.mts} +18 -4
  19. package/dist/{RunJournal-Gd83HYqG.mjs → RunJournal-ixFRCyW3.mjs} +29 -7
  20. package/dist/RunJournal-ixFRCyW3.mjs.map +1 -0
  21. package/dist/{RunOptions-Bv9NpkPZ.d.mts → RunOptions-CkRYnlJa.d.mts} +22 -8
  22. package/dist/{RunPolicyUsage-ClZxyR46.d.mts → RunPolicyUsage-CUudVtg_.d.mts} +3 -1
  23. package/dist/{Schedule-CtYREFnz.d.mts → Schedule-B_z7PMg-.d.mts} +2 -2
  24. package/dist/{Subagent-hG9lJ7tJ.mjs → Subagent-CmFtZaeI.mjs} +2 -2
  25. package/dist/{Subagent-hG9lJ7tJ.mjs.map → Subagent-CmFtZaeI.mjs.map} +1 -1
  26. package/dist/{Subagent-VHrANXFy.d.mts → Subagent-Dld4W1BY.d.mts} +7 -7
  27. package/dist/{SubagentHost-C-4A7tA2.d.mts → SubagentHost--HBuY8fF.d.mts} +4 -4
  28. package/dist/{Subscription-BJAzYNw1.d.mts → Subscription-BomcQ9_W.d.mts} +5 -5
  29. package/dist/{SubscriptionInput-CkBJt0AS.d.mts → SubscriptionInput-gpZSR9vB.d.mts} +3 -3
  30. package/dist/{ThreadHistory-tS1KwxHR.d.mts → ThreadHistory-ZEu_ja6L.d.mts} +2 -2
  31. package/dist/{Worker-fwWkBg12.d.mts → Worker-2r2zGDkh.d.mts} +2 -2
  32. package/dist/{WorkerAdmission-CJ_oWRuS.mjs → WorkerAdmission-CNbm4o_x.mjs} +3 -3
  33. package/dist/{WorkerAdmission-CJ_oWRuS.mjs.map → WorkerAdmission-CNbm4o_x.mjs.map} +1 -1
  34. package/dist/{agent-registration-CKNsrpwo.mjs → agent-registration-U3kmV7nW.mjs} +18 -18
  35. package/dist/agent-registration-U3kmV7nW.mjs.map +1 -0
  36. package/dist/capabilities/Commands.d.mts +1 -1
  37. package/dist/capabilities/Messaging.d.mts +1 -1
  38. package/dist/capabilities/Redaction.d.mts +1 -1
  39. package/dist/capabilities/RunHooks.d.mts +1 -1
  40. package/dist/capabilities/Subagent.d.mts +2 -2
  41. package/dist/capabilities/Subagent.mjs +1 -1
  42. package/dist/core/Agent.d.mts +1 -1
  43. package/dist/core/AgentPolicy.d.mts +1 -1
  44. package/dist/core/AgentPolicy.mjs +2 -0
  45. package/dist/core/AgentPolicy.mjs.map +1 -1
  46. package/dist/core/RunEvent.d.mts +2 -2
  47. package/dist/core/RunEvent.mjs +10 -1
  48. package/dist/core/RunEvent.mjs.map +1 -1
  49. package/dist/core/RunPolicyUsage.d.mts +1 -1
  50. package/dist/core/RunPolicyUsage.mjs +6 -1
  51. package/dist/core/RunPolicyUsage.mjs.map +1 -1
  52. package/dist/core/Worker.d.mts +1 -1
  53. package/dist/durable/ActivityStore.d.mts +1 -1
  54. package/dist/durable/Admin.d.mts +1 -1
  55. package/dist/durable/AgentRegistration.d.mts +2 -2
  56. package/dist/durable/AgentRegistration.mjs +3 -2
  57. package/dist/durable/AgentRegistration.mjs.map +1 -1
  58. package/dist/durable/Certification.d.mts +1 -1
  59. package/dist/durable/CommittedActivity.d.mts +3 -3
  60. package/dist/durable/Digest.d.mts +1 -1
  61. package/dist/durable/DurableAgentRuntime.d.mts +1 -1
  62. package/dist/durable/DurableAgentRuntime.mjs +2 -2
  63. package/dist/durable/EventSource.d.mts +1 -1
  64. package/dist/durable/GitHubWorkflowSource.d.mts +3 -3
  65. package/dist/durable/LifecyclePublication.d.mts +1 -1
  66. package/dist/durable/MessageDelivery.d.mts +5 -5
  67. package/dist/durable/MessageDeliveryStoreConformance.d.mts +24 -24
  68. package/dist/durable/PersistentHistory.d.mts +2 -2
  69. package/dist/durable/PersistentHistory.mjs +1 -1
  70. package/dist/durable/PreparedInputAdmission.d.mts +1 -1
  71. package/dist/durable/Records.d.mts +2 -2
  72. package/dist/durable/Records.mjs +16 -1
  73. package/dist/durable/Records.mjs.map +1 -1
  74. package/dist/durable/Recovery.d.mts +1 -1
  75. package/dist/durable/RunJournal.d.mts +1 -1
  76. package/dist/durable/RunJournal.mjs +1 -1
  77. package/dist/durable/Schedule.d.mts +1 -1
  78. package/dist/durable/ScheduleStoreConformance.d.mts +1 -1
  79. package/dist/durable/ScheduleTransition.d.mts +1 -1
  80. package/dist/durable/Scheduling.d.mts +3 -3
  81. package/dist/durable/SubmissionLedger.d.mts +1 -1
  82. package/dist/durable/SubmissionLedgerConformance.d.mts +2 -2
  83. package/dist/durable/SubmissionLedgerConformance.mjs +1 -1
  84. package/dist/durable/SubmissionStatus.d.mts +1 -1
  85. package/dist/durable/Subscription.d.mts +1 -1
  86. package/dist/durable/SubscriptionInput.d.mts +1 -1
  87. package/dist/durable/SubscriptionInput.mjs +1 -1
  88. package/dist/durable/SubscriptionStoreConformance.d.mts +1 -1
  89. package/dist/durable/SubscriptionTools.d.mts +4 -4
  90. package/dist/durable/SubscriptionTransition.d.mts +1 -1
  91. package/dist/durable/Subscriptions.d.mts +6 -6
  92. package/dist/durable/ThreadContextHistory.d.mts +1 -1
  93. package/dist/durable/ThreadContextHistoryProjection.d.mts +1 -1
  94. package/dist/durable/ThreadInvariants.d.mts +2 -2
  95. package/dist/durable/ThreadInvariants.mjs +1 -1
  96. package/dist/durable/ThreadProjection.d.mts +1 -1
  97. package/dist/durable/ThreadProjectionMaintenance.d.mts +1 -1
  98. package/dist/durable/ThreadStore.d.mts +1 -1
  99. package/dist/durable/ThreadStore.mjs +1 -1
  100. package/dist/durable/ThreadStoreConformance.d.mts +1 -1
  101. package/dist/durable/ThreadStoreConformance.mjs +1 -1
  102. package/dist/durable/WorkerAdmission.d.mts +3 -3
  103. package/dist/durable/WorkerAdmission.mjs +1 -1
  104. package/dist/durable/WorkerHost.d.mts +5 -5
  105. package/dist/engine/AgentRuntime.d.mts +1 -1
  106. package/dist/engine/AgentRuntime.mjs +1 -1
  107. package/dist/engine/Compaction.d.mts +1 -1
  108. package/dist/engine/ContextCompactor.d.mts +1 -1
  109. package/dist/engine/MessagingHost.d.mts +1 -1
  110. package/dist/engine/Output.d.mts +1 -1
  111. package/dist/engine/RunOptions.d.mts +1 -1
  112. package/dist/engine/RunOptions.mjs.map +1 -1
  113. package/dist/engine/SubagentHost.d.mts +1 -1
  114. package/dist/engine/ThreadHistory.d.mts +1 -1
  115. package/dist/index.d.mts +22 -22
  116. package/dist/index.mjs +5 -5
  117. package/package.json +1 -1
  118. package/src/core/AgentPolicy.ts +2 -0
  119. package/src/core/RunEvent.ts +9 -0
  120. package/src/core/RunPolicyUsage.ts +2 -0
  121. package/src/durable/AgentRegistration.ts +2 -0
  122. package/src/durable/DurableAgentRuntime.ts +320 -137
  123. package/src/durable/Records.ts +12 -0
  124. package/src/durable/RunJournal.ts +88 -27
  125. package/src/durable/internal/agent-registration.ts +58 -35
  126. package/src/engine/RunOptions.ts +17 -2
  127. package/src/engine/internal/agent-runtime.ts +115 -8
  128. package/dist/AgentRuntime-D8U9gl9Q.mjs.map +0 -1
  129. package/dist/DurableAgentRuntime-DQFV26SB.mjs.map +0 -1
  130. package/dist/RunJournal-Gd83HYqG.mjs.map +0 -1
  131. package/dist/agent-registration-CKNsrpwo.mjs.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"RunEvent.mjs","names":[],"sources":["../../src/core/RunEvent.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { Update } from \"./AgentUpdates.ts\";\nimport { AgentId, ThreadId, DelegationId, RunId, ToolCallId, TurnId } from \"./Identifiers.ts\";\nimport { DelegationDepth } from \"./SubagentContract.ts\";\nimport { Selection } from \"./ToolExposure.ts\";\nimport { RunTotals } from \"./Usage.ts\";\n\nconst RunEventBase = {\n eventVersion: Schema.Literal(1),\n runId: RunId,\n threadId: ThreadId,\n agentId: AgentId,\n sequence: Schema.Natural,\n timestamp: Schema.DateTimeUtcFromString,\n turnId: Schema.optionalKey(TurnId),\n toolCallId: Schema.optionalKey(ToolCallId),\n};\n\n/** A schema-encoded Agent update accepted by the owning Run. */\nexport class AgentUpdateEmitted extends Schema.TaggedClass<AgentUpdateEmitted>()(\n \"AgentUpdateEmitted\",\n { ...RunEventBase, update: Update },\n) {}\n\n/** Signals that the runtime has created a run and assigned its identities. */\nexport class RunStarted extends Schema.TaggedClass<RunStarted>()(\"RunStarted\", RunEventBase) {}\n\n/** Signals the start of a positive-numbered model turn. */\nexport class TurnStarted extends Schema.TaggedClass<TurnStarted>()(\"TurnStarted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\n/** Signals that the model request for a turn is starting. */\nexport class ModelStarted extends Schema.TaggedClass<ModelStarted>()(\"ModelStarted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\n/** Carries one live assistant text delta. */\nexport class TextDelta extends Schema.TaggedClass<TextDelta>()(\"TextDelta\", {\n ...RunEventBase,\n text: Schema.String,\n}) {}\n\n/** Carries reasoning content explicitly exposed by the provider. */\nexport class ReasoningDelta extends Schema.TaggedClass<ReasoningDelta>()(\"ReasoningDelta\", {\n ...RunEventBase,\n text: Schema.String,\n}) {}\n\n/** Reports a complete model-declared Tool Call and its execution boundary. */\nexport class ToolCallDeclared extends Schema.TaggedClass<ToolCallDeclared>()(\"ToolCallDeclared\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n parameters: Schema.Json,\n providerExecuted: Schema.Boolean,\n}) {}\n\n/** Signals that a validated Tool Call handler has started. */\nexport class ToolCallStarted extends Schema.TaggedClass<ToolCallStarted>()(\"ToolCallStarted\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n}) {}\n\n/** Carries a preliminary Tool result that is not the call's terminal outcome. */\nexport class ToolProgress extends Schema.TaggedClass<ToolProgress>()(\"ToolProgress\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n result: Schema.Json,\n providerExecuted: Schema.Boolean,\n}) {}\n\n/** Records the successful terminal result of a Tool Call. */\nexport class ToolCallSucceeded extends Schema.TaggedClass<ToolCallSucceeded>()(\n \"ToolCallSucceeded\",\n {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n toolSelection: Schema.optionalKey(Selection),\n result: Schema.Json,\n providerExecuted: Schema.Boolean,\n },\n) {}\n\n/**\n * How this boundary handled a failed invocation, independently of its native failure mode.\n * `returned-to-model` records the result path; delivery still requires the complete batch to\n * commit and a later model call. A sibling, policy or later operation can still fail the Run.\n * This classification never implies that side effects were rolled back.\n */\nexport const ToolFailureHandling = Schema.Literals([\n \"propagated\",\n \"returned-to-model\",\n \"returned-to-caller\",\n]);\n\nexport type ToolFailureHandling = typeof ToolFailureHandling.Type;\n\n/** Records a terminal Tool Call failure using safe, serializable diagnostics. */\nexport class ToolCallFailed extends Schema.TaggedClass<ToolCallFailed>()(\"ToolCallFailed\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n errorTag: Schema.NonEmptyString,\n message: Schema.String,\n providerExecuted: Schema.Boolean,\n /** Native configuration when a local Tool is known; absent on provider results and old events. */\n failureMode: Schema.optionalKey(Schema.Literals([\"error\", \"return\"])),\n /** Actual route at this boundary. Absence on older events means unknown, never recoverable. */\n failureHandling: Schema.optionalKey(ToolFailureHandling),\n /** Synthetic policy rejection; no handler ran and the failure streak is unchanged. */\n budgetRejected: Schema.optionalKey(Schema.Literal(true)),\n}) {}\n\n/** Signals that a decoded Tool Call requires approval before execution. */\nexport class ApprovalRequested extends Schema.TaggedClass<ApprovalRequested>()(\n \"ApprovalRequested\",\n {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n },\n) {}\n\n/** Records the normalized finish reason for a completed assistant turn. */\nexport class TurnCompleted extends Schema.TaggedClass<TurnCompleted>()(\"TurnCompleted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: Schema.Literals([\n \"stop\",\n \"length\",\n \"content-filter\",\n \"tool-calls\",\n \"error\",\n \"pause\",\n \"other\",\n \"unknown\",\n ]),\n}) {}\n\n/** Advisory that one policy limit crossed its warning fraction; emitted once per limit per run. */\nexport class BudgetWarning extends Schema.TaggedClass<BudgetWarning>()(\"BudgetWarning\", {\n ...RunEventBase,\n limit: Schema.Literals([\"tokens\", \"tool-calls\", \"turns\", \"duration\", \"context\"]),\n consumed: Schema.Natural,\n limitValue: Schema.Natural,\n}) {}\n\n/** Records that the engine reduced model context at a Turn seam without erasing source history. */\nexport class CompactionPerformed extends Schema.TaggedClass<CompactionPerformed>()(\n \"CompactionPerformed\",\n {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n kind: Schema.Literals([\"clear-tool-results\", \"summarize\", \"rollover\"]),\n tokensBeforeEstimate: Schema.Natural,\n tokensAfterEstimate: Schema.Natural,\n },\n) {}\n\n/**\n * Dimension that bound when a Run settled through the final-answer resolution\n * (RUN-018; the token dimension per RUN-025). This is the exhausted marker\n * the re-delegation grant flow (RUN-021) consumes and the durable\n * `SubmissionSettled` record persists (RUN-011).\n */\nexport const ExhaustedLimit = Schema.Literals([\"tokens\", \"tool-calls\", \"turns\"]);\nexport type ExhaustedLimit = typeof ExhaustedLimit.Type;\n\nconst CompletionFinishReason = Schema.Literals([\"completed\", \"model-stop\", \"budget-exhausted\"]);\n\ntype CompletionMetadata = Readonly<{\n finishReason: typeof CompletionFinishReason.Type;\n exhausted?: ExhaustedLimit | undefined;\n}>;\n\nconst validateCompletionMetadata = ({\n exhausted,\n finishReason,\n}: CompletionMetadata): string | undefined => {\n const isBudgetExhausted = finishReason === \"budget-exhausted\";\n\n return isBudgetExhausted === (exhausted !== undefined)\n ? undefined\n : '`exhausted` must be present exactly when `finishReason` is \"budget-exhausted\"';\n};\n\nconst RunCompletedFields = Schema.Struct({\n ...RunEventBase,\n output: Schema.Json,\n /** Schema-encoded application disposition, present only for an ordinary completed Run. */\n runDisposition: Schema.optionalKey(Schema.Json),\n turns: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: CompletionFinishReason,\n exhausted: Schema.optionalKey(ExhaustedLimit),\n /** Own Run usage, excluding attached descendants. Missing legacy reports are unknown. */\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n}).check(\n Schema.makeFilter((event) => validateCompletionMetadata(event)),\n Schema.makeFilter((event) =>\n event.finishReason === \"budget-exhausted\" && event.runDisposition !== undefined\n ? {\n path: [\"runDisposition\"],\n issue: '`runDisposition` is not allowed when `finishReason` is \"budget-exhausted\"',\n }\n : undefined,\n ),\n);\n\n/**\n * Successful terminal event carrying Schema-compatible output and the completed turn count.\n * `\"budget-exhausted\"` marks a Run that settled through the policy's final-answer resolution\n * after Turn, Tool Call, or token exhaustion — never a plain `\"model-stop\"` (RUN-011); its\n * `turns` count may exceed `maxTurns` by the single grace Turn, and `exhausted` names the\n * dimension that bound.\n *\n * Invariant: `exhausted` is present exactly when `finishReason` is\n * `\"budget-exhausted\"`, and a budget-exhausted completion has no application\n * run disposition. The checked Struct enforces both rules during construction,\n * decoding, and encoding without replacing the class in `RunEvent`.\n */\nexport class RunCompleted extends Schema.TaggedClass<RunCompleted>()(\n \"RunCompleted\",\n RunCompletedFields,\n) {}\n\n/** Terminal event for a run that failed with an expected error. */\nexport class RunFailed extends Schema.TaggedClass<RunFailed>()(\"RunFailed\", {\n ...RunEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n errorTag: Schema.NonEmptyString,\n message: Schema.String,\n}) {}\n\n/** Terminal event for a run stopped by interruption. */\nexport class RunInterrupted extends Schema.TaggedClass<RunInterrupted>()(\"RunInterrupted\", {\n ...RunEventBase,\n message: Schema.String,\n}) {}\n\n/** Terminal event for a run awaiting resumable external input. */\nexport class RunSuspended extends Schema.TaggedClass<RunSuspended>()(\"RunSuspended\", {\n ...RunEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n reason: Schema.String,\n}) {}\n\nconst SubagentText = Schema.String.check(Schema.isMaxLength(4 * 1024));\n\nconst SubagentEventBase = {\n ...RunEventBase,\n turnId: TurnId,\n toolCallId: ToolCallId,\n delegationId: DelegationId,\n childThreadId: ThreadId,\n childRunId: RunId,\n targetAgentId: AgentId,\n depth: DelegationDepth,\n};\n\n/** Signals that a delegation Tool Call passed preflight with preallocated child identity. */\nexport class SubagentRequested extends Schema.TaggedClass<SubagentRequested>()(\n \"SubagentRequested\",\n SubagentEventBase,\n) {}\n\n/** Signals that the child run has started inside its parent-owned scoped region. */\nexport class SubagentStarted extends Schema.TaggedClass<SubagentStarted>()(\n \"SubagentStarted\",\n SubagentEventBase,\n) {}\n\n/** Carries a bounded child progress summary without duplicating the child event stream. */\nexport class SubagentProgress extends Schema.TaggedClass<SubagentProgress>()(\"SubagentProgress\", {\n ...SubagentEventBase,\n summary: SubagentText,\n}) {}\n\n/**\n * Records the child run's successful terminal outcome before the parent join.\n * Same invariant as `RunCompleted`: `exhausted` is present exactly when\n * `finishReason` is `\"budget-exhausted\"` (the pair travels verbatim from the\n * child's terminal event); consumers treat a divergent pair fail-safe.\n */\nexport class SubagentCompleted extends Schema.TaggedClass<SubagentCompleted>()(\n \"SubagentCompleted\",\n Schema.Struct({\n ...SubagentEventBase,\n turns: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: CompletionFinishReason,\n exhausted: Schema.optionalKey(ExhaustedLimit),\n /**\n * The child's own observed usage. Delegated usage covers its attached descendants separately.\n */\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n }).check(Schema.makeFilter((event) => validateCompletionMetadata(event))),\n) {}\n\n/** Records the child run's expected terminal failure using safe, serializable diagnostics. */\nexport class SubagentFailed extends Schema.TaggedClass<SubagentFailed>()(\"SubagentFailed\", {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n errorTag: Schema.NonEmptyString,\n message: SubagentText,\n}) {}\n\n/** Records that the child run was stopped by interruption before a terminal outcome. */\nexport class SubagentInterrupted extends Schema.TaggedClass<SubagentInterrupted>()(\n \"SubagentInterrupted\",\n {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n reason: SubagentText,\n },\n) {}\n\n/** Records that the child's terminal outcome was joined into its parent delegation Tool Call. */\nexport class SubagentJoined extends Schema.TaggedClass<SubagentJoined>()(\"SubagentJoined\", {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n}) {}\n\n/** Versioned union of stable semantic run events, excluding raw provider chunks. */\nexport const RunEvent = Schema.Union([\n AgentUpdateEmitted,\n RunStarted,\n TurnStarted,\n ModelStarted,\n TextDelta,\n ReasoningDelta,\n ToolCallDeclared,\n ToolCallStarted,\n ToolProgress,\n ToolCallSucceeded,\n ToolCallFailed,\n ApprovalRequested,\n TurnCompleted,\n BudgetWarning,\n CompactionPerformed,\n RunCompleted,\n RunFailed,\n RunInterrupted,\n RunSuspended,\n SubagentRequested,\n SubagentStarted,\n SubagentProgress,\n SubagentCompleted,\n SubagentFailed,\n SubagentInterrupted,\n SubagentJoined,\n]);\n\nexport type RunEvent = typeof RunEvent.Type;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,eAAe;CACnB,cAAc,OAAO,QAAQ,CAAC;CAC9B,OAAO;CACP,UAAU;CACV,SAAS;CACT,UAAU,OAAO;CACjB,WAAW,OAAO;CAClB,QAAQ,OAAO,YAAY,MAAM;CACjC,YAAY,OAAO,YAAY,UAAU;AAC3C;;AAGA,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CAAE,GAAG;CAAc,QAAQ;AAAO,CACpC,CAAC,CAAC,CAAC;;AAGH,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC,CAAC;;AAG9F,IA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ACV,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,GAAG;CACH,OAAO,OAAO,YAAY,SAAS;CACnC,gBAAgB,OAAO,YAAY,SAAS;AAC9C,CAAC,CAAC,CAAC,CAAC;;AAGJ,MAAa,WAAW,OAAO,MAAM;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
1
+ {"version":3,"file":"RunEvent.mjs","names":[],"sources":["../../src/core/RunEvent.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport { Update } from \"./AgentUpdates.ts\";\nimport { AgentId, ThreadId, DelegationId, RunId, ToolCallId, TurnId } from \"./Identifiers.ts\";\nimport { DelegationDepth } from \"./SubagentContract.ts\";\nimport { Selection } from \"./ToolExposure.ts\";\nimport { RunTotals } from \"./Usage.ts\";\n\nconst RunEventBase = {\n eventVersion: Schema.Literal(1),\n runId: RunId,\n threadId: ThreadId,\n agentId: AgentId,\n sequence: Schema.Natural,\n timestamp: Schema.DateTimeUtcFromString,\n turnId: Schema.optionalKey(TurnId),\n toolCallId: Schema.optionalKey(ToolCallId),\n};\n\n/** A schema-encoded Agent update accepted by the owning Run. */\nexport class AgentUpdateEmitted extends Schema.TaggedClass<AgentUpdateEmitted>()(\n \"AgentUpdateEmitted\",\n { ...RunEventBase, update: Update },\n) {}\n\n/** Signals that the runtime has created a run and assigned its identities. */\nexport class RunStarted extends Schema.TaggedClass<RunStarted>()(\"RunStarted\", RunEventBase) {}\n\n/** Signals the start of a positive-numbered model turn. */\nexport class TurnStarted extends Schema.TaggedClass<TurnStarted>()(\"TurnStarted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\n/** Signals that the model request for a turn is starting. */\nexport class ModelStarted extends Schema.TaggedClass<ModelStarted>()(\"ModelStarted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n}) {}\n\n/** Discard all drafts for this turnId; a new model request will include joined input. */\nexport class ModelRestarted extends Schema.TaggedClass<ModelRestarted>()(\"ModelRestarted\", {\n ...RunEventBase,\n turnId: TurnId,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n reason: Schema.Literal(\"joined-input\"),\n}) {}\n\n/** Carries one live assistant text delta. */\nexport class TextDelta extends Schema.TaggedClass<TextDelta>()(\"TextDelta\", {\n ...RunEventBase,\n text: Schema.String,\n}) {}\n\n/** Carries reasoning content explicitly exposed by the provider. */\nexport class ReasoningDelta extends Schema.TaggedClass<ReasoningDelta>()(\"ReasoningDelta\", {\n ...RunEventBase,\n text: Schema.String,\n}) {}\n\n/** Reports a complete model-declared Tool Call and its execution boundary. */\nexport class ToolCallDeclared extends Schema.TaggedClass<ToolCallDeclared>()(\"ToolCallDeclared\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n parameters: Schema.Json,\n providerExecuted: Schema.Boolean,\n}) {}\n\n/** Signals that a validated Tool Call handler has started. */\nexport class ToolCallStarted extends Schema.TaggedClass<ToolCallStarted>()(\"ToolCallStarted\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n}) {}\n\n/** Carries a preliminary Tool result that is not the call's terminal outcome. */\nexport class ToolProgress extends Schema.TaggedClass<ToolProgress>()(\"ToolProgress\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n result: Schema.Json,\n providerExecuted: Schema.Boolean,\n}) {}\n\n/** Records the successful terminal result of a Tool Call. */\nexport class ToolCallSucceeded extends Schema.TaggedClass<ToolCallSucceeded>()(\n \"ToolCallSucceeded\",\n {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n toolSelection: Schema.optionalKey(Selection),\n result: Schema.Json,\n providerExecuted: Schema.Boolean,\n },\n) {}\n\n/**\n * How this boundary handled a failed invocation, independently of its native failure mode.\n * `returned-to-model` records the result path; delivery still requires the complete batch to\n * commit and a later model call. A sibling, policy or later operation can still fail the Run.\n * This classification never implies that side effects were rolled back.\n */\nexport const ToolFailureHandling = Schema.Literals([\n \"propagated\",\n \"returned-to-model\",\n \"returned-to-caller\",\n]);\n\nexport type ToolFailureHandling = typeof ToolFailureHandling.Type;\n\n/** Records a terminal Tool Call failure using safe, serializable diagnostics. */\nexport class ToolCallFailed extends Schema.TaggedClass<ToolCallFailed>()(\"ToolCallFailed\", {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n errorTag: Schema.NonEmptyString,\n message: Schema.String,\n providerExecuted: Schema.Boolean,\n /** Native configuration when a local Tool is known; absent on provider results and old events. */\n failureMode: Schema.optionalKey(Schema.Literals([\"error\", \"return\"])),\n /** Actual route at this boundary. Absence on older events means unknown, never recoverable. */\n failureHandling: Schema.optionalKey(ToolFailureHandling),\n /** Synthetic policy rejection; no handler ran and the failure streak is unchanged. */\n budgetRejected: Schema.optionalKey(Schema.Literal(true)),\n}) {}\n\n/** Signals that a decoded Tool Call requires approval before execution. */\nexport class ApprovalRequested extends Schema.TaggedClass<ApprovalRequested>()(\n \"ApprovalRequested\",\n {\n ...RunEventBase,\n toolCallId: ToolCallId,\n toolName: Schema.NonEmptyString,\n },\n) {}\n\n/** Records the normalized finish reason for a completed assistant turn. */\nexport class TurnCompleted extends Schema.TaggedClass<TurnCompleted>()(\"TurnCompleted\", {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: Schema.Literals([\n \"stop\",\n \"length\",\n \"content-filter\",\n \"tool-calls\",\n \"error\",\n \"pause\",\n \"other\",\n \"unknown\",\n ]),\n}) {}\n\n/** Advisory that one policy limit crossed its warning fraction; emitted once per limit per run. */\nexport class BudgetWarning extends Schema.TaggedClass<BudgetWarning>()(\"BudgetWarning\", {\n ...RunEventBase,\n limit: Schema.Literals([\"tokens\", \"tool-calls\", \"turns\", \"duration\", \"context\"]),\n consumed: Schema.Natural,\n limitValue: Schema.Natural,\n}) {}\n\n/** Records that the engine reduced model context at a Turn seam without erasing source history. */\nexport class CompactionPerformed extends Schema.TaggedClass<CompactionPerformed>()(\n \"CompactionPerformed\",\n {\n ...RunEventBase,\n turn: Schema.Int.check(Schema.isGreaterThan(0)),\n kind: Schema.Literals([\"clear-tool-results\", \"summarize\", \"rollover\"]),\n tokensBeforeEstimate: Schema.Natural,\n tokensAfterEstimate: Schema.Natural,\n },\n) {}\n\n/**\n * Dimension that bound when a Run settled through the final-answer resolution\n * (RUN-018; the token dimension per RUN-025). This is the exhausted marker\n * the re-delegation grant flow (RUN-021) consumes and the durable\n * `SubmissionSettled` record persists (RUN-011).\n */\nexport const ExhaustedLimit = Schema.Literals([\"tokens\", \"tool-calls\", \"turns\"]);\nexport type ExhaustedLimit = typeof ExhaustedLimit.Type;\n\nconst CompletionFinishReason = Schema.Literals([\"completed\", \"model-stop\", \"budget-exhausted\"]);\n\ntype CompletionMetadata = Readonly<{\n finishReason: typeof CompletionFinishReason.Type;\n exhausted?: ExhaustedLimit | undefined;\n}>;\n\nconst validateCompletionMetadata = ({\n exhausted,\n finishReason,\n}: CompletionMetadata): string | undefined => {\n const isBudgetExhausted = finishReason === \"budget-exhausted\";\n\n return isBudgetExhausted === (exhausted !== undefined)\n ? undefined\n : '`exhausted` must be present exactly when `finishReason` is \"budget-exhausted\"';\n};\n\nconst RunCompletedFields = Schema.Struct({\n ...RunEventBase,\n output: Schema.Json,\n /** Schema-encoded application disposition, present only for an ordinary completed Run. */\n runDisposition: Schema.optionalKey(Schema.Json),\n turns: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: CompletionFinishReason,\n exhausted: Schema.optionalKey(ExhaustedLimit),\n /** Own Run usage, excluding attached descendants. Missing legacy reports are unknown. */\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n}).check(\n Schema.makeFilter((event) => validateCompletionMetadata(event)),\n Schema.makeFilter((event) =>\n event.finishReason === \"budget-exhausted\" && event.runDisposition !== undefined\n ? {\n path: [\"runDisposition\"],\n issue: '`runDisposition` is not allowed when `finishReason` is \"budget-exhausted\"',\n }\n : undefined,\n ),\n);\n\n/**\n * Successful terminal event carrying Schema-compatible output and the completed turn count.\n * `\"budget-exhausted\"` marks a Run that settled through the policy's final-answer resolution\n * after Turn, Tool Call, or token exhaustion — never a plain `\"model-stop\"` (RUN-011); its\n * `turns` count may exceed `maxTurns` by the single grace Turn, and `exhausted` names the\n * dimension that bound.\n *\n * Invariant: `exhausted` is present exactly when `finishReason` is\n * `\"budget-exhausted\"`, and a budget-exhausted completion has no application\n * run disposition. The checked Struct enforces both rules during construction,\n * decoding, and encoding without replacing the class in `RunEvent`.\n */\nexport class RunCompleted extends Schema.TaggedClass<RunCompleted>()(\n \"RunCompleted\",\n RunCompletedFields,\n) {}\n\n/** Terminal event for a run that failed with an expected error. */\nexport class RunFailed extends Schema.TaggedClass<RunFailed>()(\"RunFailed\", {\n ...RunEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n errorTag: Schema.NonEmptyString,\n message: Schema.String,\n}) {}\n\n/** Terminal event for a run stopped by interruption. */\nexport class RunInterrupted extends Schema.TaggedClass<RunInterrupted>()(\"RunInterrupted\", {\n ...RunEventBase,\n message: Schema.String,\n}) {}\n\n/** Terminal event for a run awaiting resumable external input. */\nexport class RunSuspended extends Schema.TaggedClass<RunSuspended>()(\"RunSuspended\", {\n ...RunEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n reason: Schema.String,\n}) {}\n\nconst SubagentText = Schema.String.check(Schema.isMaxLength(4 * 1024));\n\nconst SubagentEventBase = {\n ...RunEventBase,\n turnId: TurnId,\n toolCallId: ToolCallId,\n delegationId: DelegationId,\n childThreadId: ThreadId,\n childRunId: RunId,\n targetAgentId: AgentId,\n depth: DelegationDepth,\n};\n\n/** Signals that a delegation Tool Call passed preflight with preallocated child identity. */\nexport class SubagentRequested extends Schema.TaggedClass<SubagentRequested>()(\n \"SubagentRequested\",\n SubagentEventBase,\n) {}\n\n/** Signals that the child run has started inside its parent-owned scoped region. */\nexport class SubagentStarted extends Schema.TaggedClass<SubagentStarted>()(\n \"SubagentStarted\",\n SubagentEventBase,\n) {}\n\n/** Carries a bounded child progress summary without duplicating the child event stream. */\nexport class SubagentProgress extends Schema.TaggedClass<SubagentProgress>()(\"SubagentProgress\", {\n ...SubagentEventBase,\n summary: SubagentText,\n}) {}\n\n/**\n * Records the child run's successful terminal outcome before the parent join.\n * Same invariant as `RunCompleted`: `exhausted` is present exactly when\n * `finishReason` is `\"budget-exhausted\"` (the pair travels verbatim from the\n * child's terminal event); consumers treat a divergent pair fail-safe.\n */\nexport class SubagentCompleted extends Schema.TaggedClass<SubagentCompleted>()(\n \"SubagentCompleted\",\n Schema.Struct({\n ...SubagentEventBase,\n turns: Schema.Int.check(Schema.isGreaterThan(0)),\n finishReason: CompletionFinishReason,\n exhausted: Schema.optionalKey(ExhaustedLimit),\n /**\n * The child's own observed usage. Delegated usage covers its attached descendants separately.\n */\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n }).check(Schema.makeFilter((event) => validateCompletionMetadata(event))),\n) {}\n\n/** Records the child run's expected terminal failure using safe, serializable diagnostics. */\nexport class SubagentFailed extends Schema.TaggedClass<SubagentFailed>()(\"SubagentFailed\", {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n errorTag: Schema.NonEmptyString,\n message: SubagentText,\n}) {}\n\n/** Records that the child run was stopped by interruption before a terminal outcome. */\nexport class SubagentInterrupted extends Schema.TaggedClass<SubagentInterrupted>()(\n \"SubagentInterrupted\",\n {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n reason: SubagentText,\n },\n) {}\n\n/** Records that the child's terminal outcome was joined into its parent delegation Tool Call. */\nexport class SubagentJoined extends Schema.TaggedClass<SubagentJoined>()(\"SubagentJoined\", {\n ...SubagentEventBase,\n usage: Schema.optionalKey(RunTotals),\n delegatedUsage: Schema.optionalKey(RunTotals),\n}) {}\n\n/** Versioned union of stable semantic run events, excluding raw provider chunks. */\nexport const RunEvent = Schema.Union([\n AgentUpdateEmitted,\n RunStarted,\n TurnStarted,\n ModelStarted,\n ModelRestarted,\n TextDelta,\n ReasoningDelta,\n ToolCallDeclared,\n ToolCallStarted,\n ToolProgress,\n ToolCallSucceeded,\n ToolCallFailed,\n ApprovalRequested,\n TurnCompleted,\n BudgetWarning,\n CompactionPerformed,\n RunCompleted,\n RunFailed,\n RunInterrupted,\n RunSuspended,\n SubagentRequested,\n SubagentStarted,\n SubagentProgress,\n SubagentCompleted,\n SubagentFailed,\n SubagentInterrupted,\n SubagentJoined,\n]);\n\nexport type RunEvent = typeof RunEvent.Type;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAM,eAAe;CACnB,cAAc,OAAO,QAAQ,CAAC;CAC9B,OAAO;CACP,UAAU;CACV,SAAS;CACT,UAAU,OAAO;CACjB,WAAW,OAAO;CAClB,QAAQ,OAAO,YAAY,MAAM;CACjC,YAAY,OAAO,YAAY,UAAU;AAC3C;;AAGA,IAAa,qBAAb,cAAwC,OAAO,YAAgC,CAAC,CAC9E,sBACA;CAAE,GAAG;CAAc,QAAQ;AAAO,CACpC,CAAC,CAAC,CAAC;;AAGH,IAAa,aAAb,cAAgC,OAAO,YAAwB,CAAC,CAAC,cAAc,YAAY,CAAC,CAAC,CAAC;;AAG9F,IAAa,cAAb,cAAiC,OAAO,YAAyB,CAAC,CAAC,eAAe;CAChF,GAAG;CACH,MAAM,OAAO,IAAI,MAAM,OAAO,cAAc,CAAC,CAAC;AAChD,CA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AAG;CACH,OAAO,OAAO,YAAY,SAAS;CACnC,gBAAgB,OAAO,YAAY,SAAS;CAC5C,QAAQ;AACV,CACF,CAAC,CAAC,CAAC;;AAGH,IAAa,iBAAb,cAAoC,OAAO,YAA4B,CAAC,CAAC,kBAAkB;CACzF,GAAG;CACH,OAAO,OAAO,YAAY,SAAS;CACnC,gBAAgB,OAAO,YAAY,SAAS;AAC9C,CAAC,CAAC,CAAC,CAAC;;AAGJ,MAAa,WAAW,OAAO,MAAM;CACnC;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;CACA;AACF,CAAC"}
@@ -1,2 +1,2 @@
1
- import { t as RunPolicyUsage } from "../RunPolicyUsage-ClZxyR46.mjs";
1
+ import { t as RunPolicyUsage } from "../RunPolicyUsage-CUudVtg_.mjs";
2
2
  export { RunPolicyUsage };
@@ -13,7 +13,12 @@ const RunPolicyUsage = Schema.Struct({
13
13
  toolCalls: Schema.Natural,
14
14
  programmaticToolCalls: Schema.Natural,
15
15
  consecutiveToolFailures: Schema.Natural,
16
- finalizationUsed: Schema.Boolean
16
+ finalizationUsed: Schema.Boolean,
17
+ /** Joined-input replacements already reserved; absent before this feature. */
18
+ modelRestarts: Schema.optionalKey(Schema.Int.check(Schema.isBetween({
19
+ minimum: 0,
20
+ maximum: 2
21
+ })))
17
22
  });
18
23
  //#endregion
19
24
  export { RunPolicyUsage, RunPolicyUsage_exports as t };
@@ -1 +1 @@
1
- {"version":3,"file":"RunPolicyUsage.mjs","names":[],"sources":["../../src/core/RunPolicyUsage.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\n/**\n * Cumulative policy accounting for one logical Run across replacement Attempts.\n * Turns and model-declared calls include a pending batch. The failure streak excludes that\n * entire batch until its declaration-ordered outcomes are folded once during continuation.\n * Programmatic calls are reserved before execution; finalization is reserved before its model call.\n */\nexport const RunPolicyUsage = Schema.Struct({\n committedTurns: Schema.Natural,\n toolCalls: Schema.Natural,\n programmaticToolCalls: Schema.Natural,\n consecutiveToolFailures: Schema.Natural,\n finalizationUsed: Schema.Boolean,\n});\n\nexport type RunPolicyUsage = typeof RunPolicyUsage.Type;\n"],"mappings":";;;;;;;;;;AAQA,MAAa,iBAAiB,OAAO,OAAO;CAC1C,gBAAgB,OAAO;CACvB,WAAW,OAAO;CAClB,uBAAuB,OAAO;CAC9B,yBAAyB,OAAO;CAChC,kBAAkB,OAAO;AAC3B,CAAC"}
1
+ {"version":3,"file":"RunPolicyUsage.mjs","names":[],"sources":["../../src/core/RunPolicyUsage.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\n/**\n * Cumulative policy accounting for one logical Run across replacement Attempts.\n * Turns and model-declared calls include a pending batch. The failure streak excludes that\n * entire batch until its declaration-ordered outcomes are folded once during continuation.\n * Programmatic calls are reserved before execution; finalization is reserved before its model call.\n */\nexport const RunPolicyUsage = Schema.Struct({\n committedTurns: Schema.Natural,\n toolCalls: Schema.Natural,\n programmaticToolCalls: Schema.Natural,\n consecutiveToolFailures: Schema.Natural,\n finalizationUsed: Schema.Boolean,\n /** Joined-input replacements already reserved; absent before this feature. */\n modelRestarts: Schema.optionalKey(Schema.Int.check(Schema.isBetween({ minimum: 0, maximum: 2 }))),\n});\n\nexport type RunPolicyUsage = typeof RunPolicyUsage.Type;\n"],"mappings":";;;;;;;;;;AAQA,MAAa,iBAAiB,OAAO,OAAO;CAC1C,gBAAgB,OAAO;CACvB,WAAW,OAAO;CAClB,uBAAuB,OAAO;CAC9B,yBAAyB,OAAO;CAChC,kBAAkB,OAAO;;CAEzB,eAAe,OAAO,YAAY,OAAO,IAAI,MAAM,OAAO,UAAU;EAAE,SAAS;EAAG,SAAS;CAAE,CAAC,CAAC,CAAC;AAClG,CAAC"}
@@ -1,3 +1,3 @@
1
1
  import { p as WorkerOperationTool } from "../SubagentContract-DdT7Cqe6.mjs";
2
- import { _ as WorkerStop, a as WorkerBudgetScope, b as WorkerUpdate, c as WorkerError, d as WorkerPage, f as WorkerRef, g as WorkerStarted, h as WorkerSource, i as WorkerAppliedInput, l as WorkerHistoryEntry, m as WorkerRun, n as AssignmentTerminal, o as WorkerCompletion, p as WorkerReport, r as FrameworkMessage, s as WorkerContext, t as AssignmentDisposition, u as WorkerInput, v as WorkerStopped, y as WorkerSummary } from "../Worker-fwWkBg12.mjs";
2
+ import { _ as WorkerStop, a as WorkerBudgetScope, b as WorkerUpdate, c as WorkerError, d as WorkerPage, f as WorkerRef, g as WorkerStarted, h as WorkerSource, i as WorkerAppliedInput, l as WorkerHistoryEntry, m as WorkerRun, n as AssignmentTerminal, o as WorkerCompletion, p as WorkerReport, r as FrameworkMessage, s as WorkerContext, t as AssignmentDisposition, u as WorkerInput, v as WorkerStopped, y as WorkerSummary } from "../Worker-2r2zGDkh.mjs";
3
3
  export { AssignmentDisposition, AssignmentTerminal, FrameworkMessage, WorkerAppliedInput, WorkerBudgetScope, WorkerCompletion, WorkerContext, WorkerError, WorkerHistoryEntry, WorkerInput, WorkerOperationTool, WorkerPage, WorkerRef, WorkerReport, WorkerRun, WorkerSource, WorkerStarted, WorkerStop, WorkerStopped, WorkerSummary, WorkerUpdate };
@@ -1,4 +1,4 @@
1
- import { _ as Digest } from "../Records-B5GFWCpn.mjs";
1
+ import { _ as Digest } from "../Records-BrEpibum.mjs";
2
2
  import { Context, Effect, Layer, Schema } from "effect";
3
3
  declare namespace ActivityStore_d_exports {
4
4
  export { ActivityBusy, ActivityClaim, ActivityClaimRequest, ActivityMutationFailpoint, ActivityMutationFailure, ActivityMutationPoint, ActivityOwnershipLost, ActivityProcessorKey, ActivityProcessorStore, ActivityProgress, ActivityStoreError, ActivityStoreFailure, ActivityWorkConflict, PreparedActivity };
@@ -1,2 +1,2 @@
1
- import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-CKIdJoP8.mjs";
1
+ import { C as renderRecoveryExplanation, S as recoveryDecisionMeaning, _ as RetryCommand, a as IntegrityCheck, b as obligationSeverityOf, c as IntegrityReport, d as ObligationReport, f as ObligationSeverity, g as RecoveryExplanation, h as RecoveryDisposition, i as ExplainedUnknownCall, l as ObligationBlockedOn, m as RECOVERY_DECISION_MEANINGS, n as ExplainedEvidence, o as IntegrityCheckName, p as ObligationThresholds, r as ExplainedSubmission, s as IntegrityCheckStatus, u as ObligationEntry, v as RetryRefusalReason, x as predictRecoveryDisposition, y as RetryRefused } from "../Admin-BjmupLN3.mjs";
2
2
  export { ExplainedEvidence, ExplainedSubmission, ExplainedUnknownCall, IntegrityCheck, IntegrityCheckName, IntegrityCheckStatus, IntegrityReport, ObligationBlockedOn, ObligationEntry, ObligationReport, ObligationSeverity, ObligationThresholds, RECOVERY_DECISION_MEANINGS, RecoveryDisposition, RecoveryExplanation, RetryCommand, RetryRefusalReason, RetryRefused, obligationSeverityOf, predictRecoveryDisposition, recoveryDecisionMeaning, renderRecoveryExplanation };
@@ -1,2 +1,2 @@
1
- import { Ba as ExecutableAgentBinding, Fa as AgentAttemptContext, Ga as definitionDigestsEqual, Ha as ResolvedBinding, Ia as AgentRegistration, La as BindingUnavailable, Ra as DurableBindingFailure, Ua as compileBindingContracts, Va as ReplayVersions, Wa as compileRegistrations, za as DurableWorkerBinding } from "../Admin-CKIdJoP8.mjs";
2
- export { type AgentAttemptContext, type AgentRegistration, BindingUnavailable, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
1
+ import { Ba as DurableBindingFailure, Fa as AgentAttemptContext, Ga as compileBindingContracts, Ha as ExecutableAgentBinding, Ia as AgentRegistration, Ka as compileRegistrations, La as BindingSelection, Ra as BindingUnavailable, Ua as ReplayVersions, Va as DurableWorkerBinding, Wa as ResolvedBinding, qa as definitionDigestsEqual, za as CurrentBindingSelection } from "../Admin-BjmupLN3.mjs";
2
+ export { type AgentAttemptContext, type AgentRegistration, type BindingSelection, BindingUnavailable, CurrentBindingSelection, type DurableBindingFailure, DurableWorkerBinding, type ExecutableAgentBinding, type ReplayVersions, type ResolvedBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual };
@@ -1,14 +1,15 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
- import { a as definitionDigestsEqual, i as compileRegistrations, n as DurableWorkerBinding, r as compileBindingContracts, t as BindingUnavailable } from "../agent-registration-CKNsrpwo.mjs";
2
+ import { a as compileRegistrations, i as compileBindingContracts, n as CurrentBindingSelection, o as definitionDigestsEqual, r as DurableWorkerBinding, t as BindingUnavailable } from "../agent-registration-U3kmV7nW.mjs";
3
3
  //#region src/durable/AgentRegistration.ts
4
4
  var AgentRegistration_exports = /* @__PURE__ */ __exportAll({
5
5
  BindingUnavailable: () => BindingUnavailable,
6
+ CurrentBindingSelection: () => CurrentBindingSelection,
6
7
  DurableWorkerBinding: () => DurableWorkerBinding,
7
8
  compileBindingContracts: () => compileBindingContracts,
8
9
  compileRegistrations: () => compileRegistrations,
9
10
  definitionDigestsEqual: () => definitionDigestsEqual
10
11
  });
11
12
  //#endregion
12
- export { BindingUnavailable, DurableWorkerBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual, AgentRegistration_exports as t };
13
+ export { BindingUnavailable, CurrentBindingSelection, DurableWorkerBinding, compileBindingContracts, compileRegistrations, definitionDigestsEqual, AgentRegistration_exports as t };
13
14
 
14
15
  //# sourceMappingURL=AgentRegistration.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentRegistration.mjs","names":[],"sources":["../../src/durable/AgentRegistration.ts"],"sourcesContent":["/** Public AgentRegistration API. Implementation helpers remain private. */\nexport {\n BindingUnavailable,\n DurableWorkerBinding,\n compileRegistrations,\n definitionDigestsEqual,\n compileBindingContracts,\n type ReplayVersions,\n type AgentRegistration,\n type AgentAttemptContext,\n type ExecutableAgentBinding,\n type DurableBindingFailure,\n type ResolvedBinding,\n} from \"./internal/agent-registration.ts\";\n"],"mappings":""}
1
+ {"version":3,"file":"AgentRegistration.mjs","names":[],"sources":["../../src/durable/AgentRegistration.ts"],"sourcesContent":["/** Public AgentRegistration API. Implementation helpers remain private. */\nexport {\n BindingUnavailable,\n CurrentBindingSelection,\n type BindingSelection,\n DurableWorkerBinding,\n compileRegistrations,\n definitionDigestsEqual,\n compileBindingContracts,\n type ReplayVersions,\n type AgentRegistration,\n type AgentAttemptContext,\n type ExecutableAgentBinding,\n type DurableBindingFailure,\n type ResolvedBinding,\n} from \"./internal/agent-registration.ts\";\n"],"mappings":""}
@@ -1,4 +1,4 @@
1
- import { ni as ThreadStore, vn as SubmissionLedger } from "../Admin-CKIdJoP8.mjs";
1
+ import { ni as ThreadStore, vn as SubmissionLedger } from "../Admin-BjmupLN3.mjs";
2
2
  import { Crypto, Effect, Schema } from "effect";
3
3
  //#region src/durable/Certification.d.ts
4
4
  declare const CertifiedAdapterIdentity_base: Schema.Class<CertifiedAdapterIdentity, Schema.Struct<{
@@ -1,7 +1,7 @@
1
- import { O as PersistedJson, l as CanonicalRecordEnvelope } from "../Records-B5GFWCpn.mjs";
1
+ import { k as PersistedJson, l as CanonicalRecordEnvelope } from "../Records-BrEpibum.mjs";
2
2
  import { ActivityProcessorKey, ActivityProcessorStore, ActivityStoreFailure, PreparedActivity } from "./ActivityStore.mjs";
3
- import { t as DigestError } from "../Digest-U69rDHuO.mjs";
4
- import { Gr as ThreadNotMaterialized, ii as ThreadStoreError, ni as ThreadStore } from "../Admin-CKIdJoP8.mjs";
3
+ import { t as DigestError } from "../Digest-CaJ2RIsF.mjs";
4
+ import { Gr as ThreadNotMaterialized, ii as ThreadStoreError, ni as ThreadStore } from "../Admin-BjmupLN3.mjs";
5
5
  import { Crypto, Effect, Schema, Scope } from "effect";
6
6
  declare namespace CommittedActivity_d_exports {
7
7
  export { ActivityPassLimits, ActivityPassResult, ActivityProcessingError, CommittedActivityProcessor, activityWorkId, processCommittedActivity };
@@ -1,2 +1,2 @@
1
- import { a as digestDefinition, i as digestCanonicalBatch, o as digestDefinitions, r as EMPTY_TAIL_DIGEST, s as digestJson, t as DigestError } from "../Digest-U69rDHuO.mjs";
1
+ import { a as digestDefinition, i as digestCanonicalBatch, o as digestDefinitions, r as EMPTY_TAIL_DIGEST, s as digestJson, t as DigestError } from "../Digest-CaJ2RIsF.mjs";
2
2
  export { DigestError, EMPTY_TAIL_DIGEST, digestCanonicalBatch, digestDefinition, digestDefinitions, digestJson };
@@ -1,3 +1,3 @@
1
1
  import { a as Receipt } from "../Receipt-BAHyigAF.mjs";
2
- import { $n as DurableApprovalFailure, Cr as isolateRecovery, Dr as threadCreatedRecordId, Er as threadCreatedBatchId, Sr as childReservationIdFor, Tr as recoveryRepairRecordId, Xn as DurableAbortFailure, Yn as ApprovalSuspensionError, Zn as DurableAgentRuntime, _r as RecoveryBlocked, ar as DurableObserveOptions, br as RecoverySweepOptions, cr as DurableRetryFailure, dr as DurableSubmitAgent, er as DurableApprovalResolver, fr as DurableSubmitFailure, gr as DurableWorkerRequirements, hr as DurableWorkerFailure, ir as DurableObligationFailure, lr as DurableRuntimeConfig, mr as DurableVerifyFailure, nr as DurableAwaitFailure, or as DurableProgressFailure, pr as DurableSubmitOptions, rr as DurableExplainFailure, sr as DurableResolveFailure, tr as DurableApprovalSuspension, ur as DurableRuntimeConfigOptions, vr as RecoveryFailure, wr as recoveryRepairBatchId, xr as RecoverySweepResult, yr as RecoveryReport } from "../Admin-CKIdJoP8.mjs";
2
+ import { $n as DurableApprovalFailure, Cr as isolateRecovery, Dr as threadCreatedRecordId, Er as threadCreatedBatchId, Sr as childReservationIdFor, Tr as recoveryRepairRecordId, Xn as DurableAbortFailure, Yn as ApprovalSuspensionError, Zn as DurableAgentRuntime, _r as RecoveryBlocked, ar as DurableObserveOptions, br as RecoverySweepOptions, cr as DurableRetryFailure, dr as DurableSubmitAgent, er as DurableApprovalResolver, fr as DurableSubmitFailure, gr as DurableWorkerRequirements, hr as DurableWorkerFailure, ir as DurableObligationFailure, lr as DurableRuntimeConfig, mr as DurableVerifyFailure, nr as DurableAwaitFailure, or as DurableProgressFailure, pr as DurableSubmitOptions, rr as DurableExplainFailure, sr as DurableResolveFailure, tr as DurableApprovalSuspension, ur as DurableRuntimeConfigOptions, vr as RecoveryFailure, wr as recoveryRepairBatchId, xr as RecoverySweepResult, yr as RecoveryReport } from "../Admin-BjmupLN3.mjs";
3
3
  export { ApprovalSuspensionError, DurableAbortFailure, DurableAgentRuntime, DurableApprovalFailure, DurableApprovalResolver, DurableApprovalSuspension, DurableAwaitFailure, DurableExplainFailure, DurableObligationFailure, DurableObserveOptions, DurableProgressFailure, DurableResolveFailure, DurableRetryFailure, DurableRuntimeConfig, DurableRuntimeConfigOptions, DurableSubmitAgent, DurableSubmitFailure, DurableSubmitOptions, DurableVerifyFailure, DurableWorkerFailure, DurableWorkerRequirements, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepOptions, RecoverySweepResult, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
@@ -1,4 +1,4 @@
1
1
  import { Receipt } from "../core/Receipt.mjs";
2
- import { a as DurableApprovalSuspension, c as RecoveryFailure, d as childReservationIdFor, f as isolateRecovery, i as DurableApprovalResolver, l as RecoveryReport, m as recoveryRepairRecordId, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as recoveryRepairBatchId, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-DQFV26SB.mjs";
3
- import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-CJ_oWRuS.mjs";
2
+ import { a as DurableApprovalSuspension, c as RecoveryFailure, d as childReservationIdFor, f as isolateRecovery, i as DurableApprovalResolver, l as RecoveryReport, m as recoveryRepairRecordId, n as DurableAgentRuntime, o as DurableRuntimeConfig, p as recoveryRepairBatchId, s as RecoveryBlocked, t as ApprovalSuspensionError, u as RecoverySweepResult } from "../DurableAgentRuntime-BQzYkFVy.mjs";
3
+ import { c as threadCreatedBatchId, l as threadCreatedRecordId } from "../WorkerAdmission-CNbm4o_x.mjs";
4
4
  export { ApprovalSuspensionError, DurableAgentRuntime, DurableApprovalResolver, DurableApprovalSuspension, DurableRuntimeConfig, Receipt, RecoveryBlocked, RecoveryFailure, RecoveryReport, RecoverySweepResult, childReservationIdFor, isolateRecovery, recoveryRepairBatchId, recoveryRepairRecordId, threadCreatedBatchId, threadCreatedRecordId };
@@ -1,2 +1,2 @@
1
- import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-CMbXXmwe.mjs";
1
+ import { a as makeEventSource, i as NormalizedEvent, r as EventSources, t as EventSource } from "../EventSource-C8CKwQy5.mjs";
2
2
  export { EventSource, EventSources, NormalizedEvent, makeEventSource };
@@ -1,7 +1,7 @@
1
1
  import { r as Principal } from "../Receipt-BAHyigAF.mjs";
2
- import "../Admin-CKIdJoP8.mjs";
3
- import { E as SubscriptionSourceError } from "../Subscription-BJAzYNw1.mjs";
4
- import { t as EventSource } from "../EventSource-CMbXXmwe.mjs";
2
+ import "../Admin-BjmupLN3.mjs";
3
+ import { E as SubscriptionSourceError } from "../Subscription-BomcQ9_W.mjs";
4
+ import { t as EventSource } from "../EventSource-C8CKwQy5.mjs";
5
5
  import { SubscriptionFailure, SubscriptionIntake } from "./Subscriptions.mjs";
6
6
  import { Context, Effect, Layer, Redacted, Schema } from "effect";
7
7
  import { HttpClient } from "effect/unstable/http";
@@ -1,2 +1,2 @@
1
- import { Ci as drainLifecyclePublications, Ti as lifecyclePublicationLayer, _i as LifecyclePublicationError, bi as LifecyclePublicationSource, gi as LifecyclePublicationConfig, hi as LifecyclePublicationBatch, mi as LifecyclePublication, vi as LifecyclePublicationFact, wi as lifecyclePublicationBatchMaxFacts, xi as LifecyclePublicationStorage, yi as LifecyclePublicationHandler } from "../Admin-CKIdJoP8.mjs";
1
+ import { Ci as drainLifecyclePublications, Ti as lifecyclePublicationLayer, _i as LifecyclePublicationError, bi as LifecyclePublicationSource, gi as LifecyclePublicationConfig, hi as LifecyclePublicationBatch, mi as LifecyclePublication, vi as LifecyclePublicationFact, wi as lifecyclePublicationBatchMaxFacts, xi as LifecyclePublicationStorage, yi as LifecyclePublicationHandler } from "../Admin-BjmupLN3.mjs";
2
2
  export { LifecyclePublication, LifecyclePublicationBatch, LifecyclePublicationConfig, LifecyclePublicationError, LifecyclePublicationFact, LifecyclePublicationHandler, LifecyclePublicationSource, LifecyclePublicationStorage, drainLifecyclePublications, lifecyclePublicationBatchMaxFacts, lifecyclePublicationLayer };
@@ -3,11 +3,11 @@ import { d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDeleg
3
3
  import { a as Receipt, t as IdempotencyKey } from "../Receipt-BAHyigAF.mjs";
4
4
  import { r as Update } from "../AgentUpdates-DMJ-_xow.mjs";
5
5
  import { a as FailureDiagnostic_d_exports, r as Diagnostic } from "../FailureDiagnostic-CaAkzGHL.mjs";
6
- import { t as AgentPolicy } from "../AgentPolicy-BqDoSXO6.mjs";
7
- import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
8
- import { fn as Settlement, xi as LifecyclePublicationStorage } from "../Admin-CKIdJoP8.mjs";
9
- import { a as PreparedInput } from "../Subscription-BJAzYNw1.mjs";
10
- import { t as PreparedInputAdmission } from "../PreparedInputAdmission-Bt6rgtVu.mjs";
6
+ import { t as AgentPolicy } from "../AgentPolicy-CnXWWwdg.mjs";
7
+ import { h as DefinitionDigests } from "../Records-BrEpibum.mjs";
8
+ import { fn as Settlement, xi as LifecyclePublicationStorage } from "../Admin-BjmupLN3.mjs";
9
+ import { a as PreparedInput } from "../Subscription-BomcQ9_W.mjs";
10
+ import { t as PreparedInputAdmission } from "../PreparedInputAdmission-CU1PzUVD.mjs";
11
11
  import { Context, Crypto, Effect, Layer, Result, Schema } from "effect";
12
12
  declare namespace MessageDelivery_d_exports {
13
13
  export { MessageDeliveryChange, MessageDeliveryDriver, MessageDeliveryDriverLimits, MessageDeliveryError, MessageDeliveryFailpoint, MessageDeliveryFailpointError, MessageDeliveryFailure, MessageDeliveryKey, MessageDeliveryPage, MessageDeliveryPageRequest, MessageDeliveryPolicy, MessageDeliveryRecord, MessageDeliveryStore, MessageDeliveryStoreLimits, applyMessageDeliveryChange, defaultMessageDeliveryPolicy, defaultMessageDeliveryStoreLimits, isWorkerUpdateDelivery, messageDeliveryCapacity, messageDeliveryDeadline, messageDeliveryKeyString, messageDeliveryUsesCapacity, prepareMessageDelivery, readPending, sameMessageDeliveryIdentity, validateMessageDelivery };
@@ -2,10 +2,10 @@ import { d as SubagentReservationAmounts, l as SubagentGrant, o as SubagentDeleg
2
2
  import { a as Receipt } from "../Receipt-BAHyigAF.mjs";
3
3
  import { r as Update } from "../AgentUpdates-DMJ-_xow.mjs";
4
4
  import { r as Diagnostic } from "../FailureDiagnostic-CaAkzGHL.mjs";
5
- import { t as AgentPolicy } from "../AgentPolicy-BqDoSXO6.mjs";
6
- import { h as DefinitionDigests } from "../Records-B5GFWCpn.mjs";
7
- import { t as DigestError } from "../Digest-U69rDHuO.mjs";
8
- import { fn as Settlement } from "../Admin-CKIdJoP8.mjs";
5
+ import { t as AgentPolicy } from "../AgentPolicy-CnXWWwdg.mjs";
6
+ import { h as DefinitionDigests } from "../Records-BrEpibum.mjs";
7
+ import { t as DigestError } from "../Digest-CaJ2RIsF.mjs";
8
+ import { fn as Settlement } from "../Admin-BjmupLN3.mjs";
9
9
  import { MessageDeliveryError, MessageDeliveryFailure, MessageDeliveryStore } from "./MessageDelivery.mjs";
10
10
  import { Effect, Schema } from "effect";
11
11
  //#region src/durable/MessageDeliveryStoreConformance.d.ts
@@ -135,16 +135,6 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
135
135
  readonly outcome: "aborted" | "failed";
136
136
  readonly failure: SubagentExecutionFailure;
137
137
  };
138
- } | {
139
- readonly _tag: "WorkerUpdate";
140
- readonly schemaVersion: 1;
141
- readonly worker: {
142
- readonly schemaVersion: 1;
143
- readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
144
- readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
145
- readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
146
- };
147
- readonly update: Update;
148
138
  } | {
149
139
  readonly schemaVersion: 1;
150
140
  readonly message: {
@@ -164,6 +154,16 @@ export declare const makeMessageDeliveryFixture: (messageId?: any, owner?: any,
164
154
  readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
165
155
  readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
166
156
  } | undefined;
157
+ } | {
158
+ readonly _tag: "WorkerUpdate";
159
+ readonly schemaVersion: 1;
160
+ readonly worker: {
161
+ readonly schemaVersion: 1;
162
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
163
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
164
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
165
+ };
166
+ readonly update: Update;
167
167
  } | undefined;
168
168
  };
169
169
  readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
@@ -318,16 +318,6 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
318
318
  readonly outcome: "aborted" | "failed";
319
319
  readonly failure: SubagentExecutionFailure;
320
320
  };
321
- } | {
322
- readonly _tag: "WorkerUpdate";
323
- readonly schemaVersion: 1;
324
- readonly worker: {
325
- readonly schemaVersion: 1;
326
- readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
327
- readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
328
- readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
329
- };
330
- readonly update: Update;
331
321
  } | {
332
322
  readonly schemaVersion: 1;
333
323
  readonly message: {
@@ -347,6 +337,16 @@ export declare const makeWorkerUpdateDeliveryFixture: (id: string) => Effect.Eff
347
337
  readonly ownerThreadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
348
338
  readonly messageId: string & import("effect/Brand").Brand<"@effect-agent/thread/IdempotencyKey">;
349
339
  } | undefined;
340
+ } | {
341
+ readonly _tag: "WorkerUpdate";
342
+ readonly schemaVersion: 1;
343
+ readonly worker: {
344
+ readonly schemaVersion: 1;
345
+ readonly delegationId: string & import("effect/Brand").Brand<"@effect-agent/core/DelegationId">;
346
+ readonly targetAgentId: string & import("effect/Brand").Brand<"@effect-agent/core/AgentId">;
347
+ readonly threadId: string & import("effect/Brand").Brand<"@effect-agent/core/ThreadId">;
348
+ };
349
+ readonly update: Update;
350
350
  } | undefined;
351
351
  };
352
352
  readonly envelopeDigest: string & import("effect/Brand").Brand<"@effect-agent/thread/Digest">;
@@ -1,5 +1,5 @@
1
- import { t as ThreadHistory } from "../ThreadHistory-tS1KwxHR.mjs";
2
- import { ni as ThreadStore } from "../Admin-CKIdJoP8.mjs";
1
+ import { t as ThreadHistory } from "../ThreadHistory-ZEu_ja6L.mjs";
2
+ import { ni as ThreadStore } from "../Admin-BjmupLN3.mjs";
3
3
  import { Layer } from "effect";
4
4
  declare namespace PersistentHistory_d_exports {
5
5
  export { layer };
@@ -1,7 +1,7 @@
1
1
  import { t as __exportAll } from "../rolldown-runtime-D7D4PA-g.mjs";
2
2
  import { ThreadHistory, ThreadHistoryError } from "../engine/ThreadHistory.mjs";
3
3
  import { BatchId, CanonicalBatch, DeploymentId, ModelCompleted, PersistedJson, ProducerEpoch, ProducerId, RecordEnvelope, RecordId, RunCompleted, UserInputRecorded } from "./Records.mjs";
4
- import { _ as promptFromCanonicalRecords } from "../RunJournal-Gd83HYqG.mjs";
4
+ import { _ as promptFromCanonicalRecords } from "../RunJournal-ixFRCyW3.mjs";
5
5
  import { FencedAppendRequest, MAX_THREAD_EXPORT_RECORDS, ThreadExportRequest, ThreadMaterialization, ThreadStore } from "./ThreadStore.mjs";
6
6
  import { Prompt } from "effect/unstable/ai";
7
7
  import { DateTime, Effect, Layer, Schema } from "effect";
@@ -1,2 +1,2 @@
1
- import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-Bt6rgtVu.mjs";
1
+ import { r as admitPreparedInput, t as PreparedInputAdmission } from "../PreparedInputAdmission-CU1PzUVD.mjs";
2
2
  export { PreparedInputAdmission, admitPreparedInput };
@@ -1,2 +1,2 @@
1
- import { $ as ToolCallPrepared, A as ProducerId, B as RunStartedRecord, C as ModelCompleted, D as PeerMessagePrepared, E as ObservationOffset, F as ReplayContract, G as SubagentRequested, H as SettlementOutcome, I as RunCompleted, J as SubmissionSettledRecord, K as SubagentStarted, L as RunDurationExhausted, M as RecordId, O as PersistedJson, P as RepairAnnotated, Q as ToolApprovalRequested, R as RunFailed, S as MAX_PERSISTED_JSON_NODES, T as ModelResponseRecorded, U as SubagentJoined, V as SettlementFailureDiagnostic, W as SubagentLineageRecorded, X as ThreadCreated, Y as SubtreeBudgetReserved, Z as ToolApprovalDecided, _ as Digest, _t as WorkerStopRequested, a as BatchId, at as ToolStepSettled, b as MAX_PERSISTED_JSON_COLLECTION_LENGTH, c as CanonicalRecord, ct as WorkerAdmission, d as CanonicalSequence, dt as WorkerInputRequested, et as ToolCallResolution, f as CompactionCreated, ft as WorkerOrigin, g as DeploymentId, gt as WorkerReportingIntent, h as DefinitionDigests, ht as WorkerReportRefused, i as ApprovalDecision, it as ToolOperation, j as RecordEnvelope, k as ProducerEpoch, l as CanonicalRecordEnvelope, lt as WorkerContinuation, m as DefinitionDigestInput, mt as WorkerReportPrepared, n as AbortedSubmissionSettled, nt as ToolCallSettled, o as CURRENT_CANONICAL_SCHEMA_VERSION, ot as ToolUnavailable, p as CompletedSubmissionSettled, pt as WorkerOriginRecorded, q as SubmissionSettled, r as AgentUpdateEmitted, rt as ToolCallUnknown, s as CanonicalBatch, st as UserInputRecorded, t as AbortRequested, tt as ToolCallResolved, u as CanonicalRecordPayload, ut as WorkerInputCompleted, v as FailedSubmissionSettled, w as ModelResponseInterrupted, x as MAX_PERSISTED_JSON_DEPTH, y as MAX_PERSISTED_JSON_BYTES, z as RunPolicyUsageReserved } from "../Records-B5GFWCpn.mjs";
2
- 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, 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 };
1
+ import { $ as ToolApprovalRequested, A as ProducerEpoch, B as RunPolicyUsageReserved, C as ModelCallAborted, D as ObservationOffset, E as ModelResponseRecorded, F as RepairAnnotated, G as SubagentLineageRecorded, H as SettlementFailureDiagnostic, I as ReplayContract, J as SubmissionSettled, K as SubagentRequested, L as RunCompleted, M as RecordEnvelope, N as RecordId, O as PeerMessagePrepared, Q as ToolApprovalDecided, R as RunDurationExhausted, S as MAX_PERSISTED_JSON_NODES, T as ModelResponseInterrupted, U as SettlementOutcome, V as RunStartedRecord, W as SubagentJoined, X as SubtreeBudgetReserved, Y as SubmissionSettledRecord, Z as ThreadCreated, _ as Digest, _t as WorkerReportingIntent, a as BatchId, at as ToolOperation, b as MAX_PERSISTED_JSON_COLLECTION_LENGTH, c as CanonicalRecord, ct as UserInputRecorded, d as CanonicalSequence, dt as WorkerInputCompleted, et as ToolCallPrepared, f as CompactionCreated, ft as WorkerInputRequested, g as DeploymentId, gt as WorkerReportRefused, h as DefinitionDigests, ht as WorkerReportPrepared, i as ApprovalDecision, it as ToolCallUnknown, j as ProducerId, k as PersistedJson, l as CanonicalRecordEnvelope, lt as WorkerAdmission, m as DefinitionDigestInput, mt as WorkerOriginRecorded, n as AbortedSubmissionSettled, nt as ToolCallResolved, o as CURRENT_CANONICAL_SCHEMA_VERSION, ot as ToolStepSettled, p as CompletedSubmissionSettled, pt as WorkerOrigin, q as SubagentStarted, r as AgentUpdateEmitted, rt as ToolCallSettled, s as CanonicalBatch, st as ToolUnavailable, t as AbortRequested, tt as ToolCallResolution, u as CanonicalRecordPayload, ut as WorkerContinuation, v as FailedSubmissionSettled, vt as WorkerStopRequested, w as ModelCompleted, x as MAX_PERSISTED_JSON_DEPTH, y as MAX_PERSISTED_JSON_BYTES, z as RunFailed } from "../Records-BrEpibum.mjs";
2
+ 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 };
@@ -38,6 +38,7 @@ var Records_exports = /* @__PURE__ */ __exportAll({
38
38
  MAX_PERSISTED_JSON_COLLECTION_LENGTH: () => MAX_PERSISTED_JSON_COLLECTION_LENGTH,
39
39
  MAX_PERSISTED_JSON_DEPTH: () => 64,
40
40
  MAX_PERSISTED_JSON_NODES: () => MAX_PERSISTED_JSON_NODES,
41
+ ModelCallAborted: () => ModelCallAborted,
41
42
  ModelCompleted: () => ModelCompleted,
42
43
  ModelResponseInterrupted: () => ModelResponseInterrupted,
43
44
  ModelResponseRecorded: () => ModelResponseRecorded,
@@ -421,6 +422,19 @@ var ModelResponseInterrupted = class extends Schema.TaggedClass("@effect-agent/t
421
422
  attemptId: AttemptId,
422
423
  reason: BoundedText
423
424
  }) {};
425
+ /** Disposable call cancellation: no response or Tool declaration is canonical. */
426
+ var ModelCallAborted = class extends Schema.TaggedClass()("ModelCallAborted", {
427
+ runId: RunId,
428
+ turnId: TurnId,
429
+ turn: TurnNumber,
430
+ restart: Schema.Int.check(Schema.isBetween({
431
+ minimum: 1,
432
+ maximum: 2
433
+ })),
434
+ reason: Schema.Literal("joined-input"),
435
+ modelUsage: Schema.Array(ModelCallUsage),
436
+ unobservedModelCalls: Schema.Natural
437
+ }) {};
424
438
  /**
425
439
  * One engine-native compaction committed before the pre-Turn view changes (RUN-026).
426
440
  * `coversThrough` is a Thread record sequence: the projection
@@ -801,6 +815,7 @@ const CanonicalRecordPayload = Schema.Union([
801
815
  ToolApprovalRequested,
802
816
  ToolApprovalDecided,
803
817
  ModelResponseInterrupted,
818
+ ModelCallAborted,
804
819
  CompactionCreated,
805
820
  RunFailed,
806
821
  RunCompleted,
@@ -853,6 +868,6 @@ var CanonicalRecordEnvelope = class extends Schema.Class("@effect-agent/thread/C
853
868
  }) {};
854
869
  const CURRENT_CANONICAL_SCHEMA_VERSION = 1;
855
870
  //#endregion
856
- export { AbortRequested, AgentUpdateEmitted, ApprovalDecision, BatchId, CURRENT_CANONICAL_SCHEMA_VERSION, CanonicalBatch, CanonicalRecord, CanonicalRecordEnvelope, CanonicalRecordPayload, CanonicalSequence, CompactionCreated, DefinitionDigestInput, DefinitionDigests, DeploymentId, Digest, MAX_PERSISTED_JSON_BYTES, MAX_PERSISTED_JSON_COLLECTION_LENGTH, MAX_PERSISTED_JSON_DEPTH, MAX_PERSISTED_JSON_NODES, 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, Records_exports as t };
871
+ export { AbortRequested, AgentUpdateEmitted, ApprovalDecision, BatchId, CURRENT_CANONICAL_SCHEMA_VERSION, CanonicalBatch, CanonicalRecord, CanonicalRecordEnvelope, CanonicalRecordPayload, CanonicalSequence, CompactionCreated, DefinitionDigestInput, DefinitionDigests, DeploymentId, Digest, 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, Records_exports as t };
857
872
 
858
873
  //# sourceMappingURL=Records.mjs.map