effect-durable-agent 0.1.0-alpha.16 → 0.1.0-alpha.18

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 (97) hide show
  1. package/dist/{compaction-CCdfxYkq.js → compaction-Db6eoLce.js} +3 -3
  2. package/dist/{compaction-CCdfxYkq.js.map → compaction-Db6eoLce.js.map} +1 -1
  3. package/dist/{context-projection-C43pyxn2.d.ts → context-projection-Dr_kA41k.d.ts} +3 -3
  4. package/dist/domain/command-queues.d.ts +82 -2
  5. package/dist/domain/context-projection.d.ts +1 -1
  6. package/dist/domain/message-transcript.d.ts +1 -1
  7. package/dist/domain/model-usage.d.ts +1 -1
  8. package/dist/domain/model-usage.js +1 -1
  9. package/dist/domain/reduced-state-schema.d.ts +3 -992
  10. package/dist/domain/reduced-state-schema.js +116 -4
  11. package/dist/domain/reduced-state-schema.js.map +1 -1
  12. package/dist/domain/reduced-state.d.ts +2 -2
  13. package/dist/domain/reduced-state.js +1 -1
  14. package/dist/domain/run-scheduling.d.ts +1 -1
  15. package/dist/{durable-D_tjjz4B.js → durable-DRY7AcsF.js} +59 -40
  16. package/dist/durable-DRY7AcsF.js.map +1 -0
  17. package/dist/{durable-RSiz3YBK.d.ts → durable-DeQBR5wA.d.ts} +4266 -235
  18. package/dist/{envelope-DxQzo5rN.js → envelope-BCzKUq_z.js} +12 -3
  19. package/dist/envelope-BCzKUq_z.js.map +1 -0
  20. package/dist/{envelope-DkZyMIgp.d.ts → envelope-VXFEC8zr.d.ts} +68 -4
  21. package/dist/{event-factory-CX0_laE5.js → event-factory-CKuWhjS4.js} +3 -3
  22. package/dist/{event-factory-CX0_laE5.js.map → event-factory-CKuWhjS4.js.map} +1 -1
  23. package/dist/{events-LZFNoESe.d.ts → events-D3OAPXgS.d.ts} +22 -22
  24. package/dist/index.d.ts +6 -6
  25. package/dist/index.js +4 -4
  26. package/dist/{model-resolver-BPPJAsuh.d.ts → model-resolver-ci5D5WQv.d.ts} +2 -2
  27. package/dist/{model-usage-CdBEkTwU.d.ts → model-usage-CNcnhj72.d.ts} +2 -2
  28. package/dist/{reduced-state-BAKvToAh.js → reduced-state-DFIYylAq.js} +55 -56
  29. package/dist/reduced-state-DFIYylAq.js.map +1 -0
  30. package/dist/reduced-state-schema-CgW0mzpS.d.ts +2167 -0
  31. package/dist/reduced-state-xY-tYuGo.d.ts +47902 -0
  32. package/dist/{reducer-registry-BgtK0NuX.d.ts → reducer-registry-bRbc4COf.d.ts} +7 -4
  33. package/dist/{run-scheduling-wakeup-DRYZztL6.d.ts → run-scheduling-wakeup-CY5hfgMR.d.ts} +2 -2
  34. package/dist/services/compaction.d.ts +1 -1
  35. package/dist/services/compaction.js +1 -1
  36. package/dist/services/model-resolver.d.ts +1 -1
  37. package/dist/services/prompt-projector.d.ts +1 -1
  38. package/dist/services/reducer-registry.d.ts +1 -1
  39. package/dist/services/reducer-registry.js +19 -6
  40. package/dist/services/reducer-registry.js.map +1 -1
  41. package/dist/services/run-scheduler.d.ts +1 -2
  42. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  43. package/dist/services/runtime-layer.d.ts +11 -13
  44. package/dist/services/runtime-layer.js +11 -7
  45. package/dist/services/runtime-layer.js.map +1 -1
  46. package/dist/services/runtime.d.ts +1 -1
  47. package/dist/services/runtime.js +17 -9
  48. package/dist/services/runtime.js.map +1 -1
  49. package/dist/services/session-event-observer.d.ts +1 -1
  50. package/dist/services/session-query.d.ts +2 -2
  51. package/dist/services/session-query.js +30 -13
  52. package/dist/services/session-query.js.map +1 -1
  53. package/dist/services/session-state.d.ts +1 -1
  54. package/dist/services/session-state.js +1 -1
  55. package/dist/services/session-store.d.ts +2 -2
  56. package/dist/services/session-store.js +84 -16
  57. package/dist/services/session-store.js.map +1 -1
  58. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  59. package/dist/services/sink-registry.d.ts +1 -1
  60. package/dist/services/sink-registry.js +1 -1
  61. package/dist/services/tool-registry.d.ts +1 -1
  62. package/dist/services/tool-registry.js.map +1 -1
  63. package/dist/services/tracing.d.ts +1 -1
  64. package/dist/{session-event-observer-DaFMKKNc.d.ts → session-event-observer-BWppl2Fr.d.ts} +2 -2
  65. package/dist/{session-state-CWKwjwdx.js → session-state-8PJZvuR3.js} +28 -20
  66. package/dist/session-state-8PJZvuR3.js.map +1 -0
  67. package/dist/{session-store-DCs--1kc.d.ts → session-store-CERvTeaV.d.ts} +25 -40
  68. package/dist/{sink-checkpoint-store-CasqHvDz.d.ts → sink-checkpoint-store-DTiswoqy.d.ts} +2 -2
  69. package/dist/{sink-registry-DUkifMag.js → sink-registry-B4yxTmlI.js} +33 -8
  70. package/dist/sink-registry-B4yxTmlI.js.map +1 -0
  71. package/dist/testkit/layers.d.ts +10 -16
  72. package/dist/testkit/layers.js +6 -6
  73. package/dist/testkit/layers.js.map +1 -1
  74. package/dist/{tool-registry-CHMtDCJ5.d.ts → tool-registry-D4ALie3K.d.ts} +11 -4
  75. package/dist/types/events/durable.d.ts +2 -2
  76. package/dist/types/events/durable.js +2 -2
  77. package/dist/types/events.d.ts +4 -4
  78. package/dist/types/events.js +3 -3
  79. package/dist/websocket.d.ts +66 -66
  80. package/dist/websocket.js +2 -2
  81. package/package.json +1 -1
  82. package/dist/command-queues-CtOtDZm3.d.ts +0 -556
  83. package/dist/compaction-BfzzyWko.d.ts +0 -165
  84. package/dist/durable-D_tjjz4B.js.map +0 -1
  85. package/dist/envelope-DxQzo5rN.js.map +0 -1
  86. package/dist/event-factory-CClLXzI9.d.ts +0 -91
  87. package/dist/index-BVVgDSdq.d.ts +0 -1
  88. package/dist/message-transcript-CEp0gCSQ.d.ts +0 -32
  89. package/dist/prompt-projector-Dh1-qvCH.d.ts +0 -39
  90. package/dist/reduced-state-BAKvToAh.js.map +0 -1
  91. package/dist/run-scheduler-CpPjFQD7.d.ts +0 -43
  92. package/dist/runtime-CX1M7jgX.d.ts +0 -69
  93. package/dist/session-query-BHB4OxR_.d.ts +0 -46
  94. package/dist/session-state-CWKwjwdx.js.map +0 -1
  95. package/dist/session-state-dE07Zzcr.d.ts +0 -895
  96. package/dist/sink-registry-CEBjrMd_.d.ts +0 -140
  97. package/dist/sink-registry-DUkifMag.js.map +0 -1
package/dist/index.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import { BaseStateId, CommandId, CompactionId, ContextVersion, CorrelationId, DurablePosition, DurableSubSequenceNumber, EventId, InferenceId, MessageId, Position, PositionOrder, RunId, RunRequestId, SequenceNumber, SessionId, SubSequenceNumber, SummaryId, ToolCallId, TurnId, comparePosition, durablePosition } from "./types/core.js";
2
2
  import { EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, buildEDATraceparent, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeRootEDAEventTrace, makeRootEDATraceMetadata, parseEDATraceparent } from "./types/tracing.js";
3
- import { _ as effectDurableAgentNamespace, a as EventNamespace, c as ModelSelectionPayload, d as ProviderPartId, f as SchemaVersion, g as UsagePayload, h as UnixEpochMillis, i as EventEnvelope, l as NonNegativeInt, m as ToolName, n as EphemeralEventEnvelope, o as EventType, p as SystemPromptText, r as EventDurability, s as FailurePayload, t as DurableEventEnvelope, u as PositionedEvent, v as makeEventType, y as schemaV1 } from "./envelope-DxQzo5rN.js";
3
+ import { _ as UsagePayload, a as EventNamespace, b as schemaV1, c as ForeignDurableEvent, d as PositionedEvent, f as ProviderPartId, g as UnixEpochMillis, h as ToolName, i as EventEnvelope, l as ModelSelectionPayload, m as SystemPromptText, n as EphemeralEventEnvelope, o as EventType, p as SchemaVersion, r as EventDurability, s as FailurePayload, t as DurableEventEnvelope, u as NonNegativeInt, v as effectDurableAgentNamespace, y as makeEventType } from "./envelope-BCzKUq_z.js";
4
4
  import { CancelPendingMessageCommand, CommandIdempotencyKey, EDACommand, GrantRunCommand, PendingMessageCancellationReason, PromotePendingMessageCommand, ResumePendingMessagesCommand, StopTurnCommand, SubmitMessageCommand, SubmitMessageDisposition, UserMessageContent, UserMessagePart } from "./types/commands.js";
5
- import { $ as LegacyTurnAttemptCompletedEvent, $n as runInterruptedEventType, $t as ToolCallRejectionReason, A as CompactionFailedEvent, An as baseStateRequestedEventType, At as SteeringMessageCancelledPayload, B as ContextRebasedPayload, Bn as contextProjectedEventType, Bt as SystemMessageCommittedEvent, C as CommandEvent, Cn as UserMessageSubmittedEvent, Cr as userMessagePromotedEventType, Ct as RunSchedulingInvalidatedPayload, D as CommandStartedPayload, Dn as assistantPartialCommittedEventType, Dt as RunStartedPayload, E as CommandStartedEvent, En as assistantMessageImportedEventType, Et as RunStartedEvent, F as CompactionStartedPayload, Fn as commandStartedEventType, Ft as StopTurnAppliedPayload, G as InferenceEvent, Gn as inferenceFailedEventType, Gt as ToolCallCreatedPayload, H as EDADurableEventV1, Hn as decodeUnknownEDADurableEvent, Ht as ToolCallCompletedEvent, I as ContextAndCompactionEvent, In as compactionCompletedEventType, It as StopTurnRequestedEvent, J as InferenceStartedEvent, Jn as messageQueuePausedEventType, Jt as ToolCallFailedPayload, K as InferenceFailedEvent, Kn as inferenceStartedEventType, Kt as ToolCallEvent, L as ContextProjectedEvent, Ln as compactionFailedEventType, Lt as StopTurnRequestedPayload, M as CompactionRequestedEvent, Mn as commandCancelledEventType, Mt as SteeringMessageQueuedPayload, N as CompactionRequestedPayload, Nn as commandCompletedEventType, Nt as StopControlEvent, O as CompactionCompletedEvent, On as baseStateCreatedEventType, Ot as SessionConfiguredEvent, P as CompactionStartedEvent, Pn as commandFailedEventType, Pt as StopTurnAppliedEvent, Q as LegacyToolCallCreatedEvent, Qn as runFailedEventType, Qt as ToolCallRejectionFeedback, R as ContextProjectedPayload, Rn as compactionRequestedEventType, Rt as SummaryCreatedEvent, S as CommandCompletedPayload, Sn as UserMessagePromotedPayload, Sr as userMessageCommittedEventType, St as RunSchedulingInvalidatedEvent, T as CommandFailedPayload, Tn as assistantMessageCommittedEventType, Tt as RunSchedulingRequestedPayload, U as InferenceCompletedEvent, Un as decodeUnknownEDADurableEventSync, Ut as ToolCallCompletedPayload, V as EDADurableEvent, Vn as contextRebasedEventType, Vt as SystemMessageCommittedPayload, W as InferenceCompletedPayload, Wn as inferenceCompletedEventType, Wt as ToolCallCreatedEvent, X as LegacyAssistantMessageCommittedEvent, Xn as recoveryCompletedEventType, Xt as ToolCallRejectedEvent, Y as InferenceStartedPayload, Yn as pendingMessagesPausedEventType, Yt as ToolCallPromptPart, Z as LegacyAttemptEvent, Zn as runCompletedEventType, Zt as ToolCallRejectedPayload, _ as CommandAdmittedEvent, _n as UserMessageCancelledPayload, _r as turnCompletedEventType, _t as RunSchedulingDeliveredEvent, a as AssistantMessageImportedPayload, an as ToolSuccessPromptPart, ar as sessionConfiguredEventType, at as PendingMessagesPausedPayload, b as CommandCancelledPayload, bn as UserMessageDisposition, br as turnStoppedEventType, bt as RunSchedulingGrantedEvent, c as AssistantPromptPart, cn as TurnEvent, cr as stopTurnAppliedEventType, ct as RecoveryContinuation, d as BaseStateCreatedPayload, dn as TurnStartedEvent, dr as systemMessageCommittedEventType, dt as RunCompletedPayload, en as ToolCallStartedEvent, er as runSchedulingDeliveredEventType, et as LegacyTurnAttemptStartedEvent, f as BaseStateEvent, fn as TurnStartedPayload, fr as toolCallCompletedEventType, ft as RunEvent, g as BaseStateRequestedPayload, gn as UserMessageCancelledEvent, gr as toolCallStartedEventType, gt as RunInterruptedPayload, h as BaseStateRequestedEvent, hn as UserMessageCancellationReason, hr as toolCallRejectedEventType, ht as RunInterruptedEvent, i as AssistantMessageImportedEvent, in as ToolRejectionPromptPart, ir as runStartedEventType, it as PendingMessagesPausedEvent, j as CompactionFailedPayload, jn as commandAdmittedEventType, jt as SteeringMessageQueuedEvent, k as CompactionCompletedPayload, kn as baseStateFailedEventType, kt as SteeringMessageCancelledEvent, l as AssistantPromptParts, ln as TurnFailedEvent, lr as stopTurnRequestedEventType, lt as RecoveryEvent, m as BaseStateFailedPayload, mn as TurnStoppedPayload, mr as toolCallFailedEventType, mt as RunFailedPayload, n as AssistantMessageCommittedPayload, nn as ToolFailurePromptPart, nr as runSchedulingInvalidatedEventType, nt as MessageQueuePausedEvent, o as AssistantPartialCommittedEvent, on as TurnCompletedEvent, or as steeringMessageCancelledEventType, ot as RecoveryCompletedEvent, p as BaseStateFailedEvent, pn as TurnStoppedEvent, pr as toolCallCreatedEventType, pt as RunFailedEvent, q as InferenceFailedPayload, qn as interpretLegacyAttemptForReduction, qt as ToolCallFailedEvent, r as AssistantMessageContent, rn as ToolPromptPart, rr as runSchedulingRequestedEventType, rt as MessageQueuePausedPayload, s as AssistantPartialCommittedPayload, sn as TurnCompletedPayload, sr as steeringMessageQueuedEventType, st as RecoveryCompletedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallStartedPayload, tr as runSchedulingGrantedEventType, tt as MessageEvent, u as BaseStateCreatedEvent, un as TurnFailedPayload, ur as summaryCreatedEventType, ut as RunCompletedEvent, v as CommandAdmittedPayload, vn as UserMessageCommittedEvent, vr as turnFailedEventType, vt as RunSchedulingDeliveredPayload, w as CommandFailedEvent, wn as UserMessageSubmittedPayload, wr as userMessageSubmittedEventType, wt as RunSchedulingRequestedEvent, x as CommandCompletedEvent, xn as UserMessagePromotedEvent, xr as userMessageCancelledEventType, xt as RunSchedulingGrantedPayload, y as CommandCancelledEvent, yn as UserMessageCommittedPayload, yr as turnStartedEventType, yt as RunSchedulingEvent, z as ContextRebasedEvent, zn as compactionStartedEventType, zt as SummaryCreatedPayload } from "./durable-D_tjjz4B.js";
5
+ import { $ as LegacyAttemptEvent, $n as pendingMessagesPausedEventType, $t as ToolCallRejectedPayload, A as CompactionFailedEvent, An as baseStateCreatedEventType, At as SessionConfiguredEvent, B as ContextRebasedPayload, Bn as compactionRequestedEventType, Bt as SummaryCreatedEvent, C as CommandEvent, Cn as UserMessagePromotedEvent, Cr as turnStartedEventType, Ct as RunSchedulingGrantedPayload, D as CommandStartedPayload, Dn as assistantMessageCommittedEventType, Dr as userMessagePromotedEventType, Dt as RunSchedulingRequestedPayload, E as CommandStartedEvent, En as UserMessageSubmittedPayload, Er as userMessageCommittedEventType, Et as RunSchedulingRequestedEvent, F as CompactionStartedPayload, Fn as commandCompletedEventType, Ft as StopControlEvent, G as InferenceCompletedEvent, Gn as decodeUnknownEDADurableEvent, Gt as ToolCallCompletedPayload, H as DecodedDurableEvent, Hn as contextProjectedEventType, Ht as SystemMessageCommittedEvent, I as ContextAndCompactionEvent, In as commandFailedEventType, It as StopTurnAppliedEvent, J as InferenceFailedEvent, Jn as inferenceCompletedEventType, Jt as ToolCallEvent, K as InferenceCompletedPayload, Kn as decodeUnknownEDADurableEventSync, Kt as ToolCallCreatedEvent, L as ContextProjectedEvent, Ln as commandStartedEventType, Lt as StopTurnAppliedPayload, M as CompactionRequestedEvent, Mn as baseStateRequestedEventType, Mt as SteeringMessageCancelledPayload, N as CompactionRequestedPayload, Nn as commandAdmittedEventType, Nt as SteeringMessageQueuedEvent, O as CompactionCompletedEvent, On as assistantMessageImportedEventType, Or as userMessageSubmittedEventType, Ot as RunStartedEvent, P as CompactionStartedEvent, Pn as commandCancelledEventType, Pt as SteeringMessageQueuedPayload, Q as LegacyAssistantMessageCommittedEvent, Qn as messageQueuePausedEventType, Qt as ToolCallRejectedEvent, R as ContextProjectedPayload, Rn as compactionCompletedEventType, Rt as StopTurnRequestedEvent, S as CommandCompletedPayload, Sn as UserMessageDisposition, Sr as turnFailedEventType, St as RunSchedulingGrantedEvent, T as CommandFailedPayload, Tn as UserMessageSubmittedEvent, Tr as userMessageCancelledEventType, Tt as RunSchedulingInvalidatedPayload, U as EDADurableEvent, Un as contextRebasedEventType, Ut as SystemMessageCommittedPayload, V as CurrentEDADurableEvent, Vn as compactionStartedEventType, Vt as SummaryCreatedPayload, W as EDADurableEventV1, Wn as decodeDurableEventSync, Wt as ToolCallCompletedEvent, X as InferenceStartedEvent, Xn as inferenceStartedEventType, Xt as ToolCallFailedPayload, Y as InferenceFailedPayload, Yn as inferenceFailedEventType, Yt as ToolCallFailedEvent, Z as InferenceStartedPayload, Zn as interpretLegacyAttemptForReduction, Zt as ToolCallPromptPart, _ as CommandAdmittedEvent, _n as UserMessageCancellationReason, _r as toolCallCreatedEventType, _t as RunInterruptedEvent, a as AssistantMessageImportedPayload, an as ToolPromptPart, ar as runSchedulingGrantedEventType, at as MessageQueuePausedPayload, b as CommandCancelledPayload, bn as UserMessageCommittedEvent, br as toolCallStartedEventType, bt as RunSchedulingDeliveredPayload, c as AssistantPromptPart, cn as TurnCompletedEvent, cr as runStartedEventType, ct as RecoveryCompletedEvent, d as BaseStateCreatedPayload, dn as TurnFailedEvent, dr as steeringMessageQueuedEventType, dt as RecoveryEvent, en as ToolCallRejectionFeedback, er as recoveryCompletedEventType, et as LegacyToolCallCreatedEvent, f as BaseStateEvent, fn as TurnFailedPayload, fr as stopTurnAppliedEventType, ft as RunCompletedEvent, g as BaseStateRequestedPayload, gn as TurnStoppedPayload, gr as toolCallCompletedEventType, gt as RunFailedPayload, h as BaseStateRequestedEvent, hn as TurnStoppedEvent, hr as systemMessageCommittedEventType, ht as RunFailedEvent, i as AssistantMessageImportedEvent, in as ToolFailurePromptPart, ir as runSchedulingDeliveredEventType, it as MessageQueuePausedEvent, j as CompactionFailedPayload, jn as baseStateFailedEventType, jt as SteeringMessageCancelledEvent, k as CompactionCompletedPayload, kn as assistantPartialCommittedEventType, kt as RunStartedPayload, l as AssistantPromptParts, ln as TurnCompletedPayload, lr as sessionConfiguredEventType, lt as RecoveryCompletedPayload, m as BaseStateFailedPayload, mn as TurnStartedPayload, mr as summaryCreatedEventType, mt as RunEvent, n as AssistantMessageCommittedPayload, nn as ToolCallStartedEvent, nr as runFailedEventType, nt as LegacyTurnAttemptStartedEvent, o as AssistantPartialCommittedEvent, on as ToolRejectionPromptPart, or as runSchedulingInvalidatedEventType, ot as PendingMessagesPausedEvent, p as BaseStateFailedEvent, pn as TurnStartedEvent, pr as stopTurnRequestedEventType, pt as RunCompletedPayload, q as InferenceEvent, qn as durableEventEnvelope, qt as ToolCallCreatedPayload, r as AssistantMessageContent, rn as ToolCallStartedPayload, rr as runInterruptedEventType, rt as MessageEvent, s as AssistantPartialCommittedPayload, sn as ToolSuccessPromptPart, sr as runSchedulingRequestedEventType, st as PendingMessagesPausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectionReason, tr as runCompletedEventType, tt as LegacyTurnAttemptCompletedEvent, u as BaseStateCreatedEvent, un as TurnEvent, ur as steeringMessageCancelledEventType, ut as RecoveryContinuation, v as CommandAdmittedPayload, vn as UserMessageCancelledEvent, vr as toolCallFailedEventType, vt as RunInterruptedPayload, w as CommandFailedEvent, wn as UserMessagePromotedPayload, wr as turnStoppedEventType, wt as RunSchedulingInvalidatedEvent, x as CommandCompletedEvent, xn as UserMessageCommittedPayload, xr as turnCompletedEventType, xt as RunSchedulingEvent, y as CommandCancelledEvent, yn as UserMessageCancelledPayload, yr as toolCallRejectedEventType, yt as RunSchedulingDeliveredEvent, z as ContextRebasedEvent, zn as compactionFailedEventType, zt as StopTurnRequestedPayload } from "./durable-DRY7AcsF.js";
6
6
  import { EDAEphemeralEvent, ModelStreamEvent, ReasoningDeltaEvent, ReasoningDeltaPayload, RuntimeStatusEvent, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, TextDeltaEvent, TextDeltaPayload, ToolParamsDeltaEvent, ToolParamsDeltaPayload, ToolParamsEndEvent, ToolParamsEndPayload, ToolParamsStartEvent, ToolParamsStartPayload, TraceStatusEvent, TraceStatusKind, TraceStatusPayload, reasoningDeltaEventType, subscriberStatusEventType, textDeltaEventType, toolParamsDeltaEventType, toolParamsEndEventType, toolParamsStartEventType, traceStatusEventType } from "./types/events.js";
7
- import { EDARuntime, EDARuntimeConfig } from "./services/runtime.js";
8
- export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateId, BaseStateRequestedEvent, BaseStateRequestedPayload, CancelPendingMessageCommand, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandId, CommandIdempotencyKey, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionId, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, ContextVersion, CorrelationId, DurableEventEnvelope, DurablePosition, DurableSubSequenceNumber, EDACommand, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDARuntime, EDARuntimeConfig, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventId, EventNamespace, EventType, FailurePayload, GrantRunCommand, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceId, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageId, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessageCancellationReason, PendingMessagesPausedEvent, PendingMessagesPausedPayload, Position, PositionOrder, PositionedEvent, PromotePendingMessageCommand, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, ResumePendingMessagesCommand, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunId, RunInterruptedEvent, RunInterruptedPayload, RunRequestId, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SequenceNumber, SessionConfiguredEvent, SessionId, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnCommand, StopTurnRequestedEvent, StopTurnRequestedPayload, SubSequenceNumber, SubmitMessageCommand, SubmitMessageDisposition, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SummaryId, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallId, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolName, ToolParamsDeltaEvent, ToolParamsDeltaPayload, ToolParamsEndEvent, ToolParamsEndPayload, ToolParamsStartEvent, ToolParamsStartPayload, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TraceStatusEvent, TraceStatusKind, TraceStatusPayload, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnId, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageContent, UserMessageDisposition, UserMessagePart, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, comparePosition, contextProjectedEventType, contextRebasedEventType, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durablePosition, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, schemaV1, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, subscriberStatusEventType, summaryCreatedEventType, systemMessageCommittedEventType, textDeltaEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, toolParamsDeltaEventType, toolParamsEndEventType, toolParamsStartEventType, traceStatusEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };
7
+ import { CommittedCommandTerminalEvent, EDARuntime, EDARuntimeConfig } from "./services/runtime.js";
8
+ export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateId, BaseStateRequestedEvent, BaseStateRequestedPayload, CancelPendingMessageCommand, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandId, CommandIdempotencyKey, CommandStartedEvent, CommandStartedPayload, CommittedCommandTerminalEvent, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionId, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, ContextVersion, CorrelationId, CurrentEDADurableEvent, DecodedDurableEvent, DurableEventEnvelope, DurablePosition, DurableSubSequenceNumber, EDACommand, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDARuntime, EDARuntimeConfig, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventId, EventNamespace, EventType, FailurePayload, ForeignDurableEvent, GrantRunCommand, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceId, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageId, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessageCancellationReason, PendingMessagesPausedEvent, PendingMessagesPausedPayload, Position, PositionOrder, PositionedEvent, PromotePendingMessageCommand, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, ResumePendingMessagesCommand, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunId, RunInterruptedEvent, RunInterruptedPayload, RunRequestId, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SequenceNumber, SessionConfiguredEvent, SessionId, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnCommand, StopTurnRequestedEvent, StopTurnRequestedPayload, SubSequenceNumber, SubmitMessageCommand, SubmitMessageDisposition, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SummaryId, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallId, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolName, ToolParamsDeltaEvent, ToolParamsDeltaPayload, ToolParamsEndEvent, ToolParamsEndPayload, ToolParamsStartEvent, ToolParamsStartPayload, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TraceStatusEvent, TraceStatusKind, TraceStatusPayload, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnId, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageContent, UserMessageDisposition, UserMessagePart, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, comparePosition, contextProjectedEventType, contextRebasedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, durablePosition, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, schemaV1, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, subscriberStatusEventType, summaryCreatedEventType, systemMessageCommittedEventType, textDeltaEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, toolParamsDeltaEventType, toolParamsEndEventType, toolParamsStartEventType, traceStatusEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };
@@ -1,4 +1,4 @@
1
- import { l as ModelSelectionPayload } from "./envelope-DkZyMIgp.js";
1
+ import { u as ModelSelectionPayload } from "./envelope-VXFEC8zr.js";
2
2
  import * as Context from "effect/Context";
3
3
  import * as Effect from "effect/Effect";
4
4
  import * as Layer from "effect/Layer";
@@ -15,4 +15,4 @@ declare class ModelResolver extends ModelResolver_base {
15
15
  }
16
16
  //#endregion
17
17
  export { ModelResolver as t };
18
- //# sourceMappingURL=model-resolver-BPPJAsuh.d.ts.map
18
+ //# sourceMappingURL=model-resolver-ci5D5WQv.d.ts.map
@@ -1,4 +1,4 @@
1
- import { _ as UsagePayload } from "./envelope-DkZyMIgp.js";
1
+ import { v as UsagePayload } from "./envelope-VXFEC8zr.js";
2
2
  import * as Schema from "effect/Schema";
3
3
 
4
4
  //#region src/domain/model-usage.d.ts
@@ -52,4 +52,4 @@ declare const addModelUsage: (state: TokenConsumptionState, model: {
52
52
  declare const totalTokenUsage: (state: TokenConsumptionState) => TokenUsageTotals;
53
53
  //#endregion
54
54
  export { emptyTokenUsage as a, addModelUsage as i, TokenConsumptionState as n, totalTokenUsage as o, TokenUsageTotals as r, ModelTokenUsage as t };
55
- //# sourceMappingURL=model-usage-CdBEkTwU.d.ts.map
55
+ //# sourceMappingURL=model-usage-CNcnhj72.d.ts.map
@@ -1,8 +1,8 @@
1
1
  import { ContextVersion, SequenceNumber } from "./types/core.js";
2
2
  import { RunSchedulingRequest, RunSchedulingRequestRecord } from "./domain/run-scheduling.js";
3
- import { _ as effectDurableAgentNamespace } from "./envelope-DxQzo5rN.js";
3
+ import "./envelope-BCzKUq_z.js";
4
4
  import { addModelUsage } from "./domain/model-usage.js";
5
- import { $n as runInterruptedEventType, An as baseStateRequestedEventType, Bn as contextProjectedEventType, Cr as userMessagePromotedEventType, Dn as assistantPartialCommittedEventType, En as assistantMessageImportedEventType, Fn as commandStartedEventType, Gn as inferenceFailedEventType, In as compactionCompletedEventType, Jn as messageQueuePausedEventType, Kn as inferenceStartedEventType, Ln as compactionFailedEventType, Mn as commandCancelledEventType, Nn as commandCompletedEventType, On as baseStateCreatedEventType, Pn as commandFailedEventType, Qn as runFailedEventType, Rn as compactionRequestedEventType, Sr as userMessageCommittedEventType, Tn as assistantMessageCommittedEventType, Vn as contextRebasedEventType, Wn as inferenceCompletedEventType, Xn as recoveryCompletedEventType, Yn as pendingMessagesPausedEventType, Zn as runCompletedEventType, _r as turnCompletedEventType, ar as sessionConfiguredEventType, br as turnStoppedEventType, cr as stopTurnAppliedEventType, dr as systemMessageCommittedEventType, er as runSchedulingDeliveredEventType, fr as toolCallCompletedEventType, gr as toolCallStartedEventType, hr as toolCallRejectedEventType, ir as runStartedEventType, jn as commandAdmittedEventType, kn as baseStateFailedEventType, lr as stopTurnRequestedEventType, mr as toolCallFailedEventType, nr as runSchedulingInvalidatedEventType, or as steeringMessageCancelledEventType, pr as toolCallCreatedEventType, qn as interpretLegacyAttemptForReduction, rr as runSchedulingRequestedEventType, sr as steeringMessageQueuedEventType, tr as runSchedulingGrantedEventType, ur as summaryCreatedEventType, vr as turnFailedEventType, wr as userMessageSubmittedEventType, xr as userMessageCancelledEventType, yr as turnStartedEventType, zn as compactionStartedEventType } from "./durable-D_tjjz4B.js";
5
+ import { $n as pendingMessagesPausedEventType, An as baseStateCreatedEventType, Bn as compactionRequestedEventType, Cr as turnStartedEventType, Dn as assistantMessageCommittedEventType, Dr as userMessagePromotedEventType, Er as userMessageCommittedEventType, Fn as commandCompletedEventType, Hn as contextProjectedEventType, In as commandFailedEventType, Jn as inferenceCompletedEventType, Ln as commandStartedEventType, Mn as baseStateRequestedEventType, Nn as commandAdmittedEventType, On as assistantMessageImportedEventType, Or as userMessageSubmittedEventType, Pn as commandCancelledEventType, Qn as messageQueuePausedEventType, Rn as compactionCompletedEventType, Sr as turnFailedEventType, Tr as userMessageCancelledEventType, Un as contextRebasedEventType, Vn as compactionStartedEventType, Xn as inferenceStartedEventType, Yn as inferenceFailedEventType, Zn as interpretLegacyAttemptForReduction, _r as toolCallCreatedEventType, ar as runSchedulingGrantedEventType, br as toolCallStartedEventType, cr as runStartedEventType, dr as steeringMessageQueuedEventType, er as recoveryCompletedEventType, fr as stopTurnAppliedEventType, gr as toolCallCompletedEventType, hr as systemMessageCommittedEventType, ir as runSchedulingDeliveredEventType, jn as baseStateFailedEventType, kn as assistantPartialCommittedEventType, lr as sessionConfiguredEventType, mr as summaryCreatedEventType, nr as runFailedEventType, or as runSchedulingInvalidatedEventType, pr as stopTurnRequestedEventType, rr as runInterruptedEventType, sr as runSchedulingRequestedEventType, tr as runCompletedEventType, ur as steeringMessageCancelledEventType, vr as toolCallFailedEventType, wr as turnStoppedEventType, xr as turnCompletedEventType, yr as toolCallRejectedEventType, zn as compactionFailedEventType } from "./durable-DRY7AcsF.js";
6
6
  import { deriveCommandQueues, emptyCommandQueues } from "./domain/command-queues.js";
7
7
  import * as Schema from "effect/Schema";
8
8
  //#region src/domain/assert-never.ts
@@ -237,9 +237,8 @@ const foldReducedState = (state, committed) => {
237
237
  let tokenConsumption = state.tokenConsumption;
238
238
  for (const entry of committed) {
239
239
  lastSeq = entry.position.seq;
240
+ if (entry.event.namespace !== "effect-durable-agent") continue;
240
241
  const event = interpretLegacyAttemptForReduction(entry.event);
241
- if (event.namespace !== effectDurableAgentNamespace) continue;
242
- const payload = event.payload;
243
242
  const seq = entry.position.seq;
244
243
  const eventCreatedAtMs = Number(event.createdAtMs);
245
244
  switch (event.type) {
@@ -250,17 +249,17 @@ const foldReducedState = (state, committed) => {
250
249
  });
251
250
  break;
252
251
  case runSchedulingDeliveredEventType:
253
- if (runSchedulingRequest !== void 0 && runSchedulingRequest.requestId === payload.requestId) runSchedulingRequest = {
252
+ if (runSchedulingRequest !== void 0 && runSchedulingRequest.requestId === event.payload.requestId) runSchedulingRequest = {
254
253
  ...runSchedulingRequest,
255
254
  deliveredSeq: seq
256
255
  };
257
256
  break;
258
257
  case runSchedulingInvalidatedEventType:
259
258
  case runSchedulingGrantedEventType:
260
- if (runSchedulingRequest?.requestId === payload.requestId) runSchedulingRequest = void 0;
259
+ if (runSchedulingRequest?.requestId === event.payload.requestId) runSchedulingRequest = void 0;
261
260
  break;
262
261
  case commandAdmittedEventType: {
263
- const { command } = payload;
262
+ const { command } = event.payload;
264
263
  const commandId = requireAdmittedCommandId(command);
265
264
  upsert(commands, commandId, { commandId }, (record) => ({
266
265
  ...record,
@@ -271,7 +270,7 @@ const foldReducedState = (state, committed) => {
271
270
  break;
272
271
  }
273
272
  case commandStartedEventType: {
274
- const { commandId } = payload;
273
+ const { commandId } = event.payload;
275
274
  upsert(commands, commandId, { commandId }, (record) => ({
276
275
  ...record,
277
276
  startedSeq: seq
@@ -279,7 +278,7 @@ const foldReducedState = (state, committed) => {
279
278
  break;
280
279
  }
281
280
  case commandCompletedEventType: {
282
- const { commandId } = payload;
281
+ const { commandId } = event.payload;
283
282
  upsert(commands, commandId, { commandId }, (record) => ({
284
283
  ...record,
285
284
  terminal: {
@@ -290,7 +289,7 @@ const foldReducedState = (state, committed) => {
290
289
  break;
291
290
  }
292
291
  case commandFailedEventType: {
293
- const { commandId, error } = payload;
292
+ const { commandId, error } = event.payload;
294
293
  upsert(commands, commandId, { commandId }, (record) => ({
295
294
  ...record,
296
295
  terminal: {
@@ -302,7 +301,7 @@ const foldReducedState = (state, committed) => {
302
301
  break;
303
302
  }
304
303
  case commandCancelledEventType: {
305
- const { commandId, reason } = payload;
304
+ const { commandId, reason } = event.payload;
306
305
  upsert(commands, commandId, { commandId }, (record) => ({
307
306
  ...record,
308
307
  terminal: {
@@ -314,8 +313,8 @@ const foldReducedState = (state, committed) => {
314
313
  break;
315
314
  }
316
315
  case runStartedEventType: {
317
- const { runId, commandIds, trace } = payload;
318
- modelSelection ??= payload.modelSelection;
316
+ const { runId, commandIds, trace } = event.payload;
317
+ modelSelection ??= event.payload.modelSelection;
319
318
  const terminal = runs.get(runId)?.terminal;
320
319
  runs.set(runId, {
321
320
  runId,
@@ -323,13 +322,13 @@ const foldReducedState = (state, committed) => {
323
322
  startedAtMs: eventCreatedAtMs,
324
323
  startedSeq: seq,
325
324
  trace,
326
- modelSelection: payload.modelSelection,
325
+ modelSelection: event.payload.modelSelection,
327
326
  ...terminal === void 0 ? {} : { terminal }
328
327
  });
329
328
  break;
330
329
  }
331
330
  case runCompletedEventType: {
332
- const { runId } = payload;
331
+ const { runId } = event.payload;
333
332
  updateExisting(runs, runId, (record) => ({
334
333
  ...record,
335
334
  ...terminalTiming(record, eventCreatedAtMs),
@@ -341,7 +340,7 @@ const foldReducedState = (state, committed) => {
341
340
  break;
342
341
  }
343
342
  case runFailedEventType: {
344
- const { runId, error } = payload;
343
+ const { runId, error } = event.payload;
345
344
  updateExisting(runs, runId, (record) => ({
346
345
  ...record,
347
346
  ...terminalTiming(record, eventCreatedAtMs),
@@ -354,7 +353,7 @@ const foldReducedState = (state, committed) => {
354
353
  break;
355
354
  }
356
355
  case runInterruptedEventType: {
357
- const { runId, reason } = payload;
356
+ const { runId, reason } = event.payload;
358
357
  updateExisting(runs, runId, (record) => ({
359
358
  ...record,
360
359
  ...terminalTiming(record, eventCreatedAtMs),
@@ -367,7 +366,7 @@ const foldReducedState = (state, committed) => {
367
366
  break;
368
367
  }
369
368
  case turnStartedEventType: {
370
- const { runId, turnId, inputMessageIds } = payload;
369
+ const { runId, turnId, inputMessageIds } = event.payload;
371
370
  const terminal = turns.get(turnId)?.terminal;
372
371
  turns.set(turnId, {
373
372
  runId,
@@ -387,7 +386,7 @@ const foldReducedState = (state, committed) => {
387
386
  break;
388
387
  }
389
388
  case turnCompletedEventType: {
390
- const { turnId, usage } = payload;
389
+ const { turnId, usage } = event.payload;
391
390
  updateExisting(turns, turnId, (record) => ({
392
391
  ...record,
393
392
  ...terminalTiming(record, eventCreatedAtMs),
@@ -400,7 +399,7 @@ const foldReducedState = (state, committed) => {
400
399
  break;
401
400
  }
402
401
  case turnFailedEventType: {
403
- const { turnId, error } = payload;
402
+ const { turnId, error } = event.payload;
404
403
  updateExisting(turns, turnId, (record) => ({
405
404
  ...record,
406
405
  ...terminalTiming(record, eventCreatedAtMs),
@@ -413,7 +412,7 @@ const foldReducedState = (state, committed) => {
413
412
  break;
414
413
  }
415
414
  case turnStoppedEventType: {
416
- const { turnId, reason } = payload;
415
+ const { turnId, reason } = event.payload;
417
416
  updateExisting(turns, turnId, (record) => ({
418
417
  ...record,
419
418
  ...terminalTiming(record, eventCreatedAtMs),
@@ -426,7 +425,7 @@ const foldReducedState = (state, committed) => {
426
425
  break;
427
426
  }
428
427
  case inferenceStartedEventType: {
429
- const { runId, turnId, inferenceId } = payload;
428
+ const { runId, turnId, inferenceId } = event.payload;
430
429
  const terminal = inferences.get(inferenceId)?.terminal;
431
430
  inferences.set(inferenceId, {
432
431
  runId,
@@ -439,7 +438,7 @@ const foldReducedState = (state, committed) => {
439
438
  break;
440
439
  }
441
440
  case inferenceCompletedEventType: {
442
- const { inferenceId, usage } = payload;
441
+ const { inferenceId, usage } = event.payload;
443
442
  const previouslyCompleted = inferences.get(inferenceId)?.terminal?._tag === "Completed";
444
443
  updateExisting(inferences, inferenceId, (record) => ({
445
444
  ...record,
@@ -451,13 +450,13 @@ const foldReducedState = (state, committed) => {
451
450
  }
452
451
  }));
453
452
  if (!previouslyCompleted && inferences.get(inferenceId)?.terminal?._tag === "Completed") {
454
- const model = runs.get(payload.runId)?.modelSelection;
453
+ const model = runs.get(event.payload.runId)?.modelSelection;
455
454
  if (model !== void 0) tokenConsumption = addModelUsage(tokenConsumption, model, usage);
456
455
  }
457
456
  break;
458
457
  }
459
458
  case inferenceFailedEventType: {
460
- const { inferenceId, error } = payload;
459
+ const { inferenceId, error } = event.payload;
461
460
  updateExisting(inferences, inferenceId, (record) => ({
462
461
  ...record,
463
462
  ...terminalTiming(record, eventCreatedAtMs),
@@ -470,7 +469,7 @@ const foldReducedState = (state, committed) => {
470
469
  break;
471
470
  }
472
471
  case toolCallCreatedEventType: {
473
- const { runId, turnId, inferenceId, toolCallId, promptPart } = payload;
472
+ const { runId, turnId, inferenceId, toolCallId, promptPart } = event.payload;
474
473
  upsert(toolCalls, toolCallId, { toolCallId }, (record) => ({
475
474
  ...record,
476
475
  decision: {
@@ -489,7 +488,7 @@ const foldReducedState = (state, committed) => {
489
488
  break;
490
489
  }
491
490
  case toolCallRejectedEventType: {
492
- const { runId, turnId, inferenceId, toolCallId, promptPart } = payload;
491
+ const { runId, turnId, inferenceId, toolCallId, promptPart } = event.payload;
493
492
  upsert(toolCalls, toolCallId, { toolCallId }, (record) => ({
494
493
  ...record,
495
494
  decision: {
@@ -508,7 +507,7 @@ const foldReducedState = (state, committed) => {
508
507
  break;
509
508
  }
510
509
  case toolCallStartedEventType: {
511
- const { toolCallId } = payload;
510
+ const { toolCallId } = event.payload;
512
511
  upsert(toolCalls, toolCallId, { toolCallId }, (record) => ({
513
512
  ...record,
514
513
  startedAtMs: eventCreatedAtMs,
@@ -517,7 +516,7 @@ const foldReducedState = (state, committed) => {
517
516
  break;
518
517
  }
519
518
  case toolCallCompletedEventType: {
520
- const { toolCallId, promptPart } = payload;
519
+ const { toolCallId, promptPart } = event.payload;
521
520
  upsert(toolCalls, toolCallId, { toolCallId }, (record) => ({
522
521
  ...record,
523
522
  ...terminalTiming(record, eventCreatedAtMs),
@@ -531,7 +530,7 @@ const foldReducedState = (state, committed) => {
531
530
  break;
532
531
  }
533
532
  case toolCallFailedEventType: {
534
- const { toolCallId, promptPart, error } = payload;
533
+ const { toolCallId, promptPart, error } = event.payload;
535
534
  upsert(toolCalls, toolCallId, { toolCallId }, (record) => ({
536
535
  ...record,
537
536
  ...terminalTiming(record, eventCreatedAtMs),
@@ -545,7 +544,7 @@ const foldReducedState = (state, committed) => {
545
544
  break;
546
545
  }
547
546
  case systemMessageCommittedEventType: {
548
- const { messageId, content } = payload;
547
+ const { messageId, content } = event.payload;
549
548
  messages.set(messageId, {
550
549
  _tag: "System",
551
550
  messageId,
@@ -556,7 +555,7 @@ const foldReducedState = (state, committed) => {
556
555
  break;
557
556
  }
558
557
  case userMessageCommittedEventType: {
559
- const { commandId, messageId, content } = payload;
558
+ const { commandId, messageId, content } = event.payload;
560
559
  messages.set(messageId, {
561
560
  _tag: "User",
562
561
  messageId,
@@ -568,7 +567,7 @@ const foldReducedState = (state, committed) => {
568
567
  break;
569
568
  }
570
569
  case userMessageSubmittedEventType: {
571
- const { commandId, messageId, disposition: requestedDisposition, content } = payload;
570
+ const { commandId, messageId, disposition: requestedDisposition, content } = event.payload;
572
571
  messages.set(messageId, {
573
572
  _tag: "User",
574
573
  messageId,
@@ -582,7 +581,7 @@ const foldReducedState = (state, committed) => {
582
581
  break;
583
582
  }
584
583
  case userMessagePromotedEventType: {
585
- const { messageId } = payload;
584
+ const { messageId } = event.payload;
586
585
  const message = messages.get(messageId);
587
586
  if (message?._tag === "User" && message.disposition === "queue" || message?._tag === "Steering" && message.pausedByCommandId !== void 0) {
588
587
  const { pausedByCommandId: _pausedByCommandId, pausedSeq: _pausedSeq, ...unpausedMessage } = message;
@@ -595,7 +594,7 @@ const foldReducedState = (state, committed) => {
595
594
  break;
596
595
  }
597
596
  case userMessageCancelledEventType: {
598
- const { commandId, messageId, reason } = payload;
597
+ const { commandId, messageId, reason } = event.payload;
599
598
  const message = messages.get(messageId);
600
599
  if (message?._tag === "User" || message?._tag === "Steering") messages.set(messageId, {
601
600
  ...message,
@@ -607,8 +606,8 @@ const foldReducedState = (state, committed) => {
607
606
  }
608
607
  case messageQueuePausedEventType:
609
608
  case pendingMessagesPausedEventType: {
610
- const messageIds = payload.messageIds;
611
- const interruptionCommandId = event.type === messageQueuePausedEventType ? payload.stopCommandId : payload.interruptionCommandId;
609
+ const messageIds = event.payload.messageIds;
610
+ const interruptionCommandId = event.type === messageQueuePausedEventType ? event.payload.stopCommandId : event.payload.interruptionCommandId;
612
611
  for (const messageId of messageIds) {
613
612
  const message = messages.get(messageId);
614
613
  if ((message?._tag === "User" || message?._tag === "Steering") && message.consumedSeq === void 0 && message.cancelledSeq === void 0) messages.set(messageId, {
@@ -621,7 +620,7 @@ const foldReducedState = (state, committed) => {
621
620
  break;
622
621
  }
623
622
  case steeringMessageQueuedEventType: {
624
- const { commandId, messageId, runId, content } = payload;
623
+ const { commandId, messageId, runId, content } = event.payload;
625
624
  messages.set(messageId, {
626
625
  _tag: "Steering",
627
626
  messageId,
@@ -634,7 +633,7 @@ const foldReducedState = (state, committed) => {
634
633
  break;
635
634
  }
636
635
  case steeringMessageCancelledEventType: {
637
- const { messageId, reason } = payload;
636
+ const { messageId, reason } = event.payload;
638
637
  const message = messages.get(messageId);
639
638
  if (message?._tag === "Steering") messages.set(messageId, {
640
639
  ...message,
@@ -644,7 +643,7 @@ const foldReducedState = (state, committed) => {
644
643
  break;
645
644
  }
646
645
  case assistantMessageCommittedEventType: {
647
- const { messageId, runId, turnId, inferenceId, promptParts } = payload;
646
+ const { messageId, runId, turnId, inferenceId, promptParts } = event.payload;
648
647
  messages.set(messageId, {
649
648
  _tag: "Assistant",
650
649
  messageId,
@@ -659,7 +658,7 @@ const foldReducedState = (state, committed) => {
659
658
  break;
660
659
  }
661
660
  case assistantMessageImportedEventType: {
662
- const { messageId, runId, turnId, inferenceId, promptParts } = payload;
661
+ const { messageId, runId, turnId, inferenceId, promptParts } = event.payload;
663
662
  messages.set(messageId, {
664
663
  _tag: "Assistant",
665
664
  messageId,
@@ -675,7 +674,7 @@ const foldReducedState = (state, committed) => {
675
674
  break;
676
675
  }
677
676
  case assistantPartialCommittedEventType: {
678
- const { messageId, runId, turnId, inferenceId, promptParts, reason } = payload;
677
+ const { messageId, runId, turnId, inferenceId, promptParts, reason } = event.payload;
679
678
  messages.set(messageId, {
680
679
  _tag: "AssistantPartial",
681
680
  messageId,
@@ -691,7 +690,7 @@ const foldReducedState = (state, committed) => {
691
690
  break;
692
691
  }
693
692
  case stopTurnRequestedEventType: {
694
- const { commandId, runId, turnId } = payload;
693
+ const { commandId, runId, turnId } = event.payload;
695
694
  stopRequests.set(commandId, {
696
695
  commandId,
697
696
  requestedSeq: seq,
@@ -702,7 +701,7 @@ const foldReducedState = (state, committed) => {
702
701
  break;
703
702
  }
704
703
  case stopTurnAppliedEventType: {
705
- const { commandId, runId, turnId, inferenceId } = payload;
704
+ const { commandId, runId, turnId, inferenceId } = event.payload;
706
705
  const existing = stopRequests.get(commandId);
707
706
  stopRequests.set(commandId, {
708
707
  commandId,
@@ -717,7 +716,7 @@ const foldReducedState = (state, committed) => {
717
716
  break;
718
717
  }
719
718
  case contextProjectedEventType: {
720
- const { contextVersion } = payload;
719
+ const { contextVersion } = event.payload;
721
720
  context = {
722
721
  ...context,
723
722
  version: contextVersion
@@ -725,7 +724,7 @@ const foldReducedState = (state, committed) => {
725
724
  break;
726
725
  }
727
726
  case compactionRequestedEventType: {
728
- const { compactionId, sourceFromSeq, sourceToSeq } = payload;
727
+ const { compactionId, sourceFromSeq, sourceToSeq } = event.payload;
729
728
  upsert(compactions, compactionId, { compactionId }, (record) => ({
730
729
  ...record,
731
730
  requestedSeq: seq,
@@ -735,7 +734,7 @@ const foldReducedState = (state, committed) => {
735
734
  break;
736
735
  }
737
736
  case compactionStartedEventType: {
738
- const { compactionId } = payload;
737
+ const { compactionId } = event.payload;
739
738
  upsert(compactions, compactionId, { compactionId }, (record) => ({
740
739
  ...record,
741
740
  startedSeq: seq
@@ -743,7 +742,7 @@ const foldReducedState = (state, committed) => {
743
742
  break;
744
743
  }
745
744
  case summaryCreatedEventType: {
746
- const { compactionId, summaryId, sourceFromSeq, sourceToSeq } = payload;
745
+ const { compactionId, summaryId, sourceFromSeq, sourceToSeq } = event.payload;
747
746
  upsert(compactions, compactionId, { compactionId }, (record) => ({
748
747
  ...record,
749
748
  summaryCreatedSeq: seq,
@@ -754,7 +753,7 @@ const foldReducedState = (state, committed) => {
754
753
  break;
755
754
  }
756
755
  case contextRebasedEventType: {
757
- const { compactionId, summaryId, contextVersion, retainedFromContextSeq } = payload;
756
+ const { compactionId, summaryId, contextVersion, retainedFromContextSeq } = event.payload;
758
757
  upsert(compactions, compactionId, { compactionId }, (record) => ({
759
758
  ...record,
760
759
  summaryId,
@@ -779,8 +778,8 @@ const foldReducedState = (state, committed) => {
779
778
  break;
780
779
  }
781
780
  case compactionCompletedEventType: {
782
- const { compactionId } = payload;
783
- if (compactions.get(compactionId)?.terminal?._tag !== "Completed" && payload.modelSelection !== void 0) tokenConsumption = addModelUsage(tokenConsumption, payload.modelSelection, payload.usage);
781
+ const { compactionId } = event.payload;
782
+ if (compactions.get(compactionId)?.terminal?._tag !== "Completed" && event.payload.modelSelection !== void 0) tokenConsumption = addModelUsage(tokenConsumption, event.payload.modelSelection, event.payload.usage);
784
783
  upsert(compactions, compactionId, { compactionId }, (record) => ({
785
784
  ...record,
786
785
  terminal: {
@@ -791,8 +790,8 @@ const foldReducedState = (state, committed) => {
791
790
  break;
792
791
  }
793
792
  case compactionFailedEventType: {
794
- const { compactionId, error } = payload;
795
- if (payload.modelSelection !== void 0) tokenConsumption = addModelUsage(tokenConsumption, payload.modelSelection, payload.usage);
793
+ const { compactionId, error } = event.payload;
794
+ if (event.payload.modelSelection !== void 0) tokenConsumption = addModelUsage(tokenConsumption, event.payload.modelSelection, event.payload.usage);
796
795
  upsert(compactions, compactionId, { compactionId }, (record) => ({
797
796
  ...record,
798
797
  terminal: {
@@ -806,7 +805,7 @@ const foldReducedState = (state, committed) => {
806
805
  break;
807
806
  }
808
807
  case recoveryCompletedEventType: {
809
- const { continuation } = payload;
808
+ const { continuation } = event.payload;
810
809
  if (continuation !== void 0) recoveryContinuations.set(continuation.replacementRunId, {
811
810
  ...continuation,
812
811
  seq
@@ -814,7 +813,7 @@ const foldReducedState = (state, committed) => {
814
813
  break;
815
814
  }
816
815
  case sessionConfiguredEventType:
817
- modelSelection ??= payload.modelSelection;
816
+ modelSelection ??= event.payload.modelSelection;
818
817
  break;
819
818
  case baseStateRequestedEventType:
820
819
  case baseStateCreatedEventType:
@@ -940,4 +939,4 @@ const appliedFields = (record) => record?.appliedSeq === void 0 ? {} : {
940
939
  //#endregion
941
940
  export { encodeReducedStateCheckpoint as a, frameworkReducedStateReducerSchemaVersion as c, pendingStopCommand as d, reduceCommittedEvents as f, assertNeverError as h, decodeReducedStateCheckpoint as i, initialReducedState as l, assertNever as m, activeTurnIdentityForCommand as n, foldReducedState as o, reducedStateCheckpointEventSeqs as p, classifyRecoverableWork as r, frameworkReducedStateReducerName as s, activeCommand as t, pendingCommands as u };
942
941
 
943
- //# sourceMappingURL=reduced-state-BAKvToAh.js.map
942
+ //# sourceMappingURL=reduced-state-DFIYylAq.js.map