effect-durable-agent 0.1.0-alpha.6 → 0.1.0-alpha.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{command-queues-C8muEqeQ.d.ts → command-queues-DdDB_aYM.d.ts} +11 -18
- package/dist/{compaction-F4HEWzuI.d.ts → compaction-BEor3jKv.d.ts} +27 -8
- package/dist/compaction-BgDr5VJy.js +473 -0
- package/dist/compaction-BgDr5VJy.js.map +1 -0
- package/dist/{context-projection-C43pyxn2.d.ts → context-projection-n6Rdup0N.d.ts} +2 -2
- package/dist/domain/command-queues.d.ts +1 -1
- package/dist/domain/context-projection.d.ts +1 -1
- package/dist/domain/message-transcript.d.ts +1 -1
- package/dist/domain/model-usage.d.ts +2 -0
- package/dist/domain/model-usage.js +59 -0
- package/dist/domain/model-usage.js.map +1 -0
- package/dist/domain/reduced-state-schema.d.ts +11 -17
- package/dist/domain/reduced-state-schema.js +6 -11
- package/dist/domain/reduced-state-schema.js.map +1 -1
- package/dist/domain/reduced-state.d.ts +3 -2
- package/dist/domain/reduced-state.js +3 -2
- package/dist/{durable-DsV9PxZC.js → durable-BGFvX7Mh.js} +17 -80
- package/dist/durable-BGFvX7Mh.js.map +1 -0
- package/dist/{durable-B7M6TD_0.d.ts → durable-br2C1bWK.d.ts} +247 -4
- package/dist/envelope-DkZyMIgp.d.ts +191 -0
- package/dist/envelope-DxQzo5rN.js +82 -0
- package/dist/envelope-DxQzo5rN.js.map +1 -0
- package/dist/{event-factory-tcpLgdMN.js → event-factory-DTFdy0Cb.js} +3 -2
- package/dist/{event-factory-tcpLgdMN.js.map → event-factory-DTFdy0Cb.js.map} +1 -1
- package/dist/{event-factory-CLJcyymV.d.ts → event-factory-pFzsPlDs.d.ts} +4 -4
- package/dist/{events-Bb9-Cu-7.d.ts → events-LZFNoESe.d.ts} +2 -188
- package/dist/index.d.ts +5 -4
- package/dist/index.js +4 -3
- package/dist/{message-transcript-DsKTT47f.d.ts → message-transcript-DQNlzxle.d.ts} +3 -3
- package/dist/model-resolver-BPPJAsuh.d.ts +18 -0
- package/dist/model-usage-CdBEkTwU.d.ts +55 -0
- package/dist/{prompt-projector-hqPh5-NI.d.ts → prompt-projector-f4ElyXCE.d.ts} +4 -4
- package/dist/{reduced-state-TMi7ISla.js → reduced-state-DF0-6mbR.js} +25 -30
- package/dist/reduced-state-DF0-6mbR.js.map +1 -0
- package/dist/{reducer-registry--vQFATXb.d.ts → reducer-registry-aFjz_ZLT.d.ts} +2 -2
- package/dist/{runtime-BO9KJq_Y.d.ts → runtime-DbTCb32-.d.ts} +5 -5
- package/dist/services/compaction.d.ts +1 -1
- package/dist/services/compaction.js +1 -426
- package/dist/services/model-resolver.d.ts +2 -0
- package/dist/services/model-resolver.js +17 -0
- package/dist/services/model-resolver.js.map +1 -0
- package/dist/services/prompt-projector.d.ts +1 -1
- package/dist/services/reducer-registry.d.ts +1 -1
- package/dist/services/runtime-layer.d.ts +14 -14
- package/dist/services/runtime-layer.js +8 -7
- package/dist/services/runtime-layer.js.map +1 -1
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +3 -2
- package/dist/services/runtime.js.map +1 -1
- package/dist/services/session-event-observer.d.ts +1 -1
- package/dist/services/session-query.d.ts +1 -1
- package/dist/services/session-query.js +3 -3
- package/dist/services/session-state.d.ts +1 -1
- package/dist/services/session-state.js +1 -1
- package/dist/services/session-store.d.ts +1 -1
- package/dist/services/session-store.js +2 -1
- package/dist/services/session-store.js.map +1 -1
- package/dist/services/sink-checkpoint-store.d.ts +1 -1
- package/dist/services/sink-registry.d.ts +1 -1
- package/dist/services/sink-registry.js +1 -1
- package/dist/services/tool-registry.d.ts +1 -1
- package/dist/services/tracing.d.ts +1 -1
- package/dist/{session-event-observer-D_aoFnQs.d.ts → session-event-observer-DaFMKKNc.d.ts} +2 -2
- package/dist/{session-query-_Z3Kw6jj.d.ts → session-query-l8xpJYp8.d.ts} +8 -8
- package/dist/{session-state-BfoXKafd.d.ts → session-state-YHFzOGDf.d.ts} +16 -16
- package/dist/{session-state-C4m0j6CJ.js → session-state-aIqe9CLa.js} +30 -39
- package/dist/session-state-aIqe9CLa.js.map +1 -0
- package/dist/{session-store-ofm8FFxs.d.ts → session-store-Cpi_NwTR.d.ts} +3 -3
- package/dist/{sink-checkpoint-store-BQVbI9DQ.d.ts → sink-checkpoint-store-M7qIxoSH.d.ts} +2 -2
- package/dist/{sink-registry-DH6uiEgP.js → sink-registry-NDgeyzO0.js} +4 -4
- package/dist/{sink-registry-DH6uiEgP.js.map → sink-registry-NDgeyzO0.js.map} +1 -1
- package/dist/{sink-registry-PRYbj6dp.d.ts → sink-registry-T1wOUuzq.d.ts} +9 -9
- package/dist/testkit/layers.d.ts +17 -14
- package/dist/testkit/layers.js +10 -8
- package/dist/testkit/layers.js.map +1 -1
- package/dist/{tool-registry-ClHdr_G5.d.ts → tool-registry-BJaVNtw4.d.ts} +3 -3
- package/dist/types/events/durable.d.ts +2 -2
- package/dist/types/events/durable.js +2 -2
- package/dist/types/events.d.ts +4 -3
- package/dist/types/events.js +3 -2
- package/dist/types/events.js.map +1 -1
- package/dist/websocket.d.ts +83 -4
- package/dist/websocket.js +82 -12
- package/dist/websocket.js.map +1 -1
- package/package.json +10 -1
- package/dist/durable-DsV9PxZC.js.map +0 -1
- package/dist/reduced-state-TMi7ISla.js.map +0 -1
- package/dist/services/compaction.js.map +0 -1
- package/dist/session-state-C4m0j6CJ.js.map +0 -1
package/dist/types/events.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
+
import { _ as UsagePayload, a as EventNamespace, b as schemaV1, c as FailurePayload, 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 EventTypeName, t as DurableEventEnvelope, u as NonNegativeInt, v as effectDurableAgentNamespace, y as makeEventType } from "../envelope-DkZyMIgp.js";
|
|
1
2
|
import { _ as parseEDATraceparent, a as EDATraceAttributes, c as EDATraceLink, d as makeEDAEventTrace, f as makeEDARunTrace, g as makeRootEDATraceMetadata, h as makeRootEDAEventTrace, i as EDATraceAttributeValue, l as EDATraceMetadata, m as makeEDATraceMetadataFromParent, n as EDARunTrace, o as EDATraceContext, p as makeEDATraceContext, r as EDASpanId, s as EDATraceId, t as EDAEventTrace, u as buildEDATraceparent } from "../tracing-BXHAkxkx.js";
|
|
2
|
-
import { A as
|
|
3
|
-
import {
|
|
4
|
-
export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, DurableEventEnvelope, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventNamespace, EventType, EventTypeName, FailurePayload, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessagesPausedEvent, PendingMessagesPausedPayload, PositionedEvent, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, 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, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runStartedEventType, schemaV1, 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 };
|
|
3
|
+
import { $ as PendingMessagesPausedEvent, $n as turnFailedEventType, $t as TurnStoppedEvent, A as CompactionFailedEvent, An as inferenceCompletedEventType, At as ToolCallCreatedEvent, B as ContextRebasedPayload, Bn as sessionConfiguredEventType, Bt as ToolCallStartedEvent, C as CommandEvent, Cn as compactionFailedEventType, Ct as StopTurnRequestedPayload, D as CommandStartedPayload, Dn as contextRebasedEventType, Dt as SystemMessageCommittedPayload, E as CommandStartedEvent, En as contextProjectedEventType, Et as SystemMessageCommittedEvent, F as CompactionStartedPayload, Fn as recoveryCompletedEventType, Ft as ToolCallPromptPart, G as InferenceEvent, Gn as summaryCreatedEventType, Gt as ToolSuccessPromptPart, H as EDADurableEventV1, Hn as steeringMessageQueuedEventType, Ht as ToolFailurePromptPart, I as ContextAndCompactionEvent, In as runCompletedEventType, It as ToolCallRejectedEvent, J as InferenceStartedEvent, Jn as toolCallCreatedEventType, Jt as TurnEvent, K as InferenceFailedEvent, Kn as systemMessageCommittedEventType, Kt as TurnCompletedEvent, L as ContextProjectedEvent, Ln as runFailedEventType, Lt as ToolCallRejectedPayload, M as CompactionRequestedEvent, Mn as inferenceStartedEventType, Mt as ToolCallEvent, N as CompactionRequestedPayload, Nn as messageQueuePausedEventType, Nt as ToolCallFailedEvent, O as CompactionCompletedEvent, On as decodeUnknownEDADurableEvent, Ot as ToolCallCompletedEvent, P as CompactionStartedEvent, Pn as pendingMessagesPausedEventType, Pt as ToolCallFailedPayload, Q as MessageQueuePausedPayload, Qn as turnCompletedEventType, Qt as TurnStartedPayload, R as ContextProjectedPayload, Rn as runInterruptedEventType, Rt as ToolCallRejectionFeedback, S as CommandCompletedPayload, Sn as compactionCompletedEventType, St as StopTurnRequestedEvent, T as CommandFailedPayload, Tn as compactionStartedEventType, Tt as SummaryCreatedPayload, U as InferenceCompletedEvent, Un as stopTurnAppliedEventType, Ut as ToolPromptPart, V as EDADurableEvent, Vn as steeringMessageCancelledEventType, Vt as ToolCallStartedPayload, W as InferenceCompletedPayload, Wn as stopTurnRequestedEventType, Wt as ToolRejectionPromptPart, X as MessageEvent, Xn as toolCallRejectedEventType, Xt as TurnFailedPayload, Y as InferenceStartedPayload, Yn as toolCallFailedEventType, Yt as TurnFailedEvent, Z as MessageQueuePausedEvent, Zn as toolCallStartedEventType, Zt as TurnStartedEvent, _ as CommandAdmittedEvent, _n as commandAdmittedEventType, _t as SteeringMessageQueuedEvent, a as AssistantMessageImportedPayload, an as UserMessageCommittedPayload, ar as userMessageSubmittedEventType, at as RunCompletedEvent, b as CommandCancelledPayload, bn as commandFailedEventType, bt as StopTurnAppliedEvent, c as AssistantPromptPart, cn as UserMessagePromotedPayload, ct as RunFailedEvent, d as BaseStateCreatedPayload, dn as assistantMessageCommittedEventType, dt as RunInterruptedPayload, en as TurnStoppedPayload, er as turnStartedEventType, et as PendingMessagesPausedPayload, f as BaseStateEvent, fn as assistantMessageImportedEventType, ft as RunStartedEvent, g as BaseStateRequestedPayload, gn as baseStateRequestedEventType, gt as SteeringMessageCancelledPayload, h as BaseStateRequestedEvent, hn as baseStateFailedEventType, ht as SteeringMessageCancelledEvent, i as AssistantMessageImportedEvent, in as UserMessageCommittedEvent, ir as userMessagePromotedEventType, it as RecoveryEvent, j as CompactionFailedPayload, jn as inferenceFailedEventType, jt as ToolCallCreatedPayload, k as CompactionCompletedPayload, kn as decodeUnknownEDADurableEventSync, kt as ToolCallCompletedPayload, l as AssistantPromptParts, ln as UserMessageSubmittedEvent, lt as RunFailedPayload, m as BaseStateFailedPayload, mn as baseStateCreatedEventType, mt as SessionConfiguredEvent, n as AssistantMessageCommittedPayload, nn as UserMessageCancelledEvent, nr as userMessageCancelledEventType, nt as RecoveryCompletedPayload, o as AssistantPartialCommittedEvent, on as UserMessageDisposition, ot as RunCompletedPayload, p as BaseStateFailedEvent, pn as assistantPartialCommittedEventType, pt as RunStartedPayload, q as InferenceFailedPayload, qn as toolCallCompletedEventType, qt as TurnCompletedPayload, r as AssistantMessageContent, rn as UserMessageCancelledPayload, rr as userMessageCommittedEventType, rt as RecoveryContinuation, s as AssistantPartialCommittedPayload, sn as UserMessagePromotedEvent, st as RunEvent, t as AssistantMessageCommittedEvent, tn as UserMessageCancellationReason, tr as turnStoppedEventType, tt as RecoveryCompletedEvent, u as BaseStateCreatedEvent, un as UserMessageSubmittedPayload, ut as RunInterruptedEvent, v as CommandAdmittedPayload, vn as commandCancelledEventType, vt as SteeringMessageQueuedPayload, w as CommandFailedEvent, wn as compactionRequestedEventType, wt as SummaryCreatedEvent, x as CommandCompletedEvent, xn as commandStartedEventType, xt as StopTurnAppliedPayload, y as CommandCancelledEvent, yn as commandCompletedEventType, yt as StopControlEvent, z as ContextRebasedEvent, zn as runStartedEventType, zt as ToolCallRejectionReason } from "../durable-br2C1bWK.js";
|
|
4
|
+
import { C as toolParamsDeltaEventType, E as traceStatusEventType, S as textDeltaEventType, T as toolParamsStartEventType, _ as TraceStatusEvent, a as RuntimeStatusEvent, b as reasoningDeltaEventType, c as SubscriberStatusPayload, d as ToolParamsDeltaEvent, f as ToolParamsDeltaPayload, g as ToolParamsStartPayload, h as ToolParamsStartEvent, i as ReasoningDeltaPayload, l as TextDeltaEvent, m as ToolParamsEndPayload, n as ModelStreamEvent, o as SubscriberStatusEvent, p as ToolParamsEndEvent, r as ReasoningDeltaEvent, s as SubscriberStatusKind, t as EDAEphemeralEvent, u as TextDeltaPayload, v as TraceStatusKind, w as toolParamsEndEventType, x as subscriberStatusEventType, y as TraceStatusPayload } from "../events-LZFNoESe.js";
|
|
5
|
+
export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, DurableEventEnvelope, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventNamespace, EventType, EventTypeName, FailurePayload, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessagesPausedEvent, PendingMessagesPausedPayload, PositionedEvent, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, 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, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, 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 };
|
package/dist/types/events.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ToolCallId } from "./core.js";
|
|
2
2
|
import { EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, buildEDATraceparent, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeRootEDAEventTrace, makeRootEDATraceMetadata, parseEDATraceparent } from "./tracing.js";
|
|
3
|
-
import {
|
|
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";
|
|
4
|
+
import { $ as PendingMessagesPausedEvent, $n as turnFailedEventType, $t as TurnStoppedEvent, A as CompactionFailedEvent, An as inferenceCompletedEventType, At as ToolCallCreatedEvent, B as ContextRebasedPayload, Bn as sessionConfiguredEventType, Bt as ToolCallStartedEvent, C as CommandEvent, Cn as compactionFailedEventType, Ct as StopTurnRequestedPayload, D as CommandStartedPayload, Dn as contextRebasedEventType, Dt as SystemMessageCommittedPayload, E as CommandStartedEvent, En as contextProjectedEventType, Et as SystemMessageCommittedEvent, F as CompactionStartedPayload, Fn as recoveryCompletedEventType, Ft as ToolCallPromptPart, G as InferenceEvent, Gn as summaryCreatedEventType, Gt as ToolSuccessPromptPart, H as EDADurableEventV1, Hn as steeringMessageQueuedEventType, Ht as ToolFailurePromptPart, I as ContextAndCompactionEvent, In as runCompletedEventType, It as ToolCallRejectedEvent, J as InferenceStartedEvent, Jn as toolCallCreatedEventType, Jt as TurnEvent, K as InferenceFailedEvent, Kn as systemMessageCommittedEventType, Kt as TurnCompletedEvent, L as ContextProjectedEvent, Ln as runFailedEventType, Lt as ToolCallRejectedPayload, M as CompactionRequestedEvent, Mn as inferenceStartedEventType, Mt as ToolCallEvent, N as CompactionRequestedPayload, Nn as messageQueuePausedEventType, Nt as ToolCallFailedEvent, O as CompactionCompletedEvent, On as decodeUnknownEDADurableEvent, Ot as ToolCallCompletedEvent, P as CompactionStartedEvent, Pn as pendingMessagesPausedEventType, Pt as ToolCallFailedPayload, Q as MessageQueuePausedPayload, Qn as turnCompletedEventType, Qt as TurnStartedPayload, R as ContextProjectedPayload, Rn as runInterruptedEventType, Rt as ToolCallRejectionFeedback, S as CommandCompletedPayload, Sn as compactionCompletedEventType, St as StopTurnRequestedEvent, T as CommandFailedPayload, Tn as compactionStartedEventType, Tt as SummaryCreatedPayload, U as InferenceCompletedEvent, Un as stopTurnAppliedEventType, Ut as ToolPromptPart, V as EDADurableEvent, Vn as steeringMessageCancelledEventType, Vt as ToolCallStartedPayload, W as InferenceCompletedPayload, Wn as stopTurnRequestedEventType, Wt as ToolRejectionPromptPart, X as MessageEvent, Xn as toolCallRejectedEventType, Xt as TurnFailedPayload, Y as InferenceStartedPayload, Yn as toolCallFailedEventType, Yt as TurnFailedEvent, Z as MessageQueuePausedEvent, Zn as toolCallStartedEventType, Zt as TurnStartedEvent, _ as CommandAdmittedEvent, _n as commandAdmittedEventType, _t as SteeringMessageQueuedEvent, a as AssistantMessageImportedPayload, an as UserMessageCommittedPayload, ar as userMessageSubmittedEventType, at as RunCompletedEvent, b as CommandCancelledPayload, bn as commandFailedEventType, bt as StopTurnAppliedEvent, c as AssistantPromptPart, cn as UserMessagePromotedPayload, ct as RunFailedEvent, d as BaseStateCreatedPayload, dn as assistantMessageCommittedEventType, dt as RunInterruptedPayload, en as TurnStoppedPayload, er as turnStartedEventType, et as PendingMessagesPausedPayload, f as BaseStateEvent, fn as assistantMessageImportedEventType, ft as RunStartedEvent, g as BaseStateRequestedPayload, gn as baseStateRequestedEventType, gt as SteeringMessageCancelledPayload, h as BaseStateRequestedEvent, hn as baseStateFailedEventType, ht as SteeringMessageCancelledEvent, i as AssistantMessageImportedEvent, in as UserMessageCommittedEvent, ir as userMessagePromotedEventType, it as RecoveryEvent, j as CompactionFailedPayload, jn as inferenceFailedEventType, jt as ToolCallCreatedPayload, k as CompactionCompletedPayload, kn as decodeUnknownEDADurableEventSync, kt as ToolCallCompletedPayload, l as AssistantPromptParts, ln as UserMessageSubmittedEvent, lt as RunFailedPayload, m as BaseStateFailedPayload, mn as baseStateCreatedEventType, mt as SessionConfiguredEvent, n as AssistantMessageCommittedPayload, nn as UserMessageCancelledEvent, nr as userMessageCancelledEventType, nt as RecoveryCompletedPayload, o as AssistantPartialCommittedEvent, on as UserMessageDisposition, or as ephemeralEventSchema, ot as RunCompletedPayload, p as BaseStateFailedEvent, pn as assistantPartialCommittedEventType, pt as RunStartedPayload, q as InferenceFailedPayload, qn as toolCallCompletedEventType, qt as TurnCompletedPayload, r as AssistantMessageContent, rn as UserMessageCancelledPayload, rr as userMessageCommittedEventType, rt as RecoveryContinuation, s as AssistantPartialCommittedPayload, sn as UserMessagePromotedEvent, st as RunEvent, t as AssistantMessageCommittedEvent, tn as UserMessageCancellationReason, tr as turnStoppedEventType, tt as RecoveryCompletedEvent, u as BaseStateCreatedEvent, un as UserMessageSubmittedPayload, ut as RunInterruptedEvent, v as CommandAdmittedPayload, vn as commandCancelledEventType, vt as SteeringMessageQueuedPayload, w as CommandFailedEvent, wn as compactionRequestedEventType, wt as SummaryCreatedEvent, x as CommandCompletedEvent, xn as commandStartedEventType, xt as StopTurnAppliedPayload, y as CommandCancelledEvent, yn as commandCompletedEventType, yt as StopControlEvent, z as ContextRebasedEvent, zn as runStartedEventType, zt as ToolCallRejectionReason } from "../durable-BGFvX7Mh.js";
|
|
4
5
|
import * as Schema from "effect/Schema";
|
|
5
6
|
//#region src/types/events/ephemeral.ts
|
|
6
7
|
/** Event type values for ephemeral model stream events. */
|
|
@@ -85,6 +86,6 @@ const RuntimeStatusEvent = Schema.Union([SubscriberStatusEvent, TraceStatusEvent
|
|
|
85
86
|
/** Built-in ephemeral event union for framework-owned live-only updates. */
|
|
86
87
|
const EDAEphemeralEvent = Schema.Union([ModelStreamEvent, RuntimeStatusEvent]);
|
|
87
88
|
//#endregion
|
|
88
|
-
export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, DurableEventEnvelope, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventNamespace, EventType, FailurePayload, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessagesPausedEvent, PendingMessagesPausedPayload, PositionedEvent, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, 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, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runStartedEventType, schemaV1, 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 };
|
|
89
|
+
export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateRequestedEvent, BaseStateRequestedPayload, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandStartedEvent, CommandStartedPayload, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, DurableEventEnvelope, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventNamespace, EventType, FailurePayload, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceStartedEvent, InferenceStartedPayload, MessageEvent, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessagesPausedEvent, PendingMessagesPausedPayload, PositionedEvent, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunInterruptedEvent, RunInterruptedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SessionConfiguredEvent, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnRequestedEvent, StopTurnRequestedPayload, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, 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, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageDisposition, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, contextProjectedEventType, contextRebasedEventType, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, 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 };
|
|
89
90
|
|
|
90
91
|
//# sourceMappingURL=events.js.map
|
package/dist/types/events.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","names":[],"sources":["../../src/types/events/ephemeral.ts"],"sourcesContent":["import * as Schema from \"effect/Schema\";\n\nimport { ToolCallId } from \"../core\";\nimport { ProviderPartId, ToolName, makeEventType } from \"./envelope\";\nimport { ephemeralEventSchema } from \"./internal\";\n\n/** Event type values for ephemeral model stream events. */\nexport const textDeltaEventType = makeEventType(\"TextDelta\");\nexport const reasoningDeltaEventType = makeEventType(\"ReasoningDelta\");\nexport const toolParamsStartEventType = makeEventType(\"ToolParamsStart\");\nexport const toolParamsDeltaEventType = makeEventType(\"ToolParamsDelta\");\nexport const toolParamsEndEventType = makeEventType(\"ToolParamsEnd\");\n\n/** Payload for live assistant text deltas. */\nexport const TextDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n delta: Schema.String,\n});\nexport type TextDeltaPayload = typeof TextDeltaPayload.Type;\nexport const TextDeltaEvent = ephemeralEventSchema(textDeltaEventType, TextDeltaPayload);\nexport type TextDeltaEvent = typeof TextDeltaEvent.Type;\n\n/** Payload for live assistant reasoning deltas. */\nexport const ReasoningDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n delta: Schema.String,\n});\nexport type ReasoningDeltaPayload = typeof ReasoningDeltaPayload.Type;\nexport const ReasoningDeltaEvent = ephemeralEventSchema(\n reasoningDeltaEventType,\n ReasoningDeltaPayload,\n);\nexport type ReasoningDeltaEvent = typeof ReasoningDeltaEvent.Type;\n\n/** Payload for the speculative start of streamed tool parameters. */\nexport const ToolParamsStartPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n toolName: ToolName,\n providerExecuted: Schema.Boolean,\n});\nexport type ToolParamsStartPayload = typeof ToolParamsStartPayload.Type;\nexport const ToolParamsStartEvent = ephemeralEventSchema(\n toolParamsStartEventType,\n ToolParamsStartPayload,\n);\nexport type ToolParamsStartEvent = typeof ToolParamsStartEvent.Type;\n\n/** Payload for one speculative streamed tool parameter chunk. */\nexport const ToolParamsDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n delta: Schema.String,\n});\nexport type ToolParamsDeltaPayload = typeof ToolParamsDeltaPayload.Type;\nexport const ToolParamsDeltaEvent = ephemeralEventSchema(\n toolParamsDeltaEventType,\n ToolParamsDeltaPayload,\n);\nexport type ToolParamsDeltaEvent = typeof ToolParamsDeltaEvent.Type;\n\n/** Payload for the speculative end of streamed tool parameters. */\nexport const ToolParamsEndPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n});\nexport type ToolParamsEndPayload = typeof ToolParamsEndPayload.Type;\nexport const ToolParamsEndEvent = ephemeralEventSchema(\n toolParamsEndEventType,\n ToolParamsEndPayload,\n);\nexport type ToolParamsEndEvent = typeof ToolParamsEndEvent.Type;\n\n/** Ephemeral event union for live provider stream parts. */\nexport const ModelStreamEvent = Schema.Union([\n TextDeltaEvent,\n ReasoningDeltaEvent,\n ToolParamsStartEvent,\n ToolParamsDeltaEvent,\n ToolParamsEndEvent,\n]);\nexport type ModelStreamEvent = typeof ModelStreamEvent.Type;\n\n/** Event type values for ephemeral runtime status events. */\nexport const subscriberStatusEventType = makeEventType(\"SubscriberStatus\");\nexport const traceStatusEventType = makeEventType(\"TraceStatus\");\n\n/** Status values emitted by the live subscriber pipeline. */\nexport const SubscriberStatusKind = Schema.Literals([\n \"connected\",\n \"catching-up\",\n \"live\",\n \"lagging\",\n \"closed\",\n]);\nexport type SubscriberStatusKind = typeof SubscriberStatusKind.Type;\n\n/** Payload for live subscriber lifecycle and lag notifications. */\nexport const SubscriberStatusPayload = Schema.Struct({\n status: SubscriberStatusKind,\n reason: Schema.optionalKey(Schema.String),\n});\nexport type SubscriberStatusPayload = typeof SubscriberStatusPayload.Type;\nexport const SubscriberStatusEvent = ephemeralEventSchema(\n subscriberStatusEventType,\n SubscriberStatusPayload,\n);\nexport type SubscriberStatusEvent = typeof SubscriberStatusEvent.Type;\n\n/** Status values emitted by runtime tracing hooks. */\nexport const TraceStatusKind = Schema.Literals([\"span-started\", \"span-ended\", \"span-failed\"]);\nexport type TraceStatusKind = typeof TraceStatusKind.Type;\n\n/** Payload for live trace/status breadcrumbs that are never replayed durably. */\nexport const TraceStatusPayload = Schema.Struct({\n status: TraceStatusKind,\n spanName: Schema.NonEmptyString,\n details: Schema.optionalKey(Schema.Unknown),\n});\nexport type TraceStatusPayload = typeof TraceStatusPayload.Type;\nexport const TraceStatusEvent = ephemeralEventSchema(traceStatusEventType, TraceStatusPayload);\nexport type TraceStatusEvent = typeof TraceStatusEvent.Type;\n\n/** Ephemeral event union for live runtime status updates. */\nexport const RuntimeStatusEvent = Schema.Union([SubscriberStatusEvent, TraceStatusEvent]);\nexport type RuntimeStatusEvent = typeof RuntimeStatusEvent.Type;\n\n/** Built-in ephemeral event union for framework-owned live-only updates. */\nexport const EDAEphemeralEvent = Schema.Union([ModelStreamEvent, RuntimeStatusEvent]);\nexport type EDAEphemeralEvent = typeof EDAEphemeralEvent.Type;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"events.js","names":[],"sources":["../../src/types/events/ephemeral.ts"],"sourcesContent":["import * as Schema from \"effect/Schema\";\n\nimport { ToolCallId } from \"../core\";\nimport { ProviderPartId, ToolName, makeEventType } from \"./envelope\";\nimport { ephemeralEventSchema } from \"./internal\";\n\n/** Event type values for ephemeral model stream events. */\nexport const textDeltaEventType = makeEventType(\"TextDelta\");\nexport const reasoningDeltaEventType = makeEventType(\"ReasoningDelta\");\nexport const toolParamsStartEventType = makeEventType(\"ToolParamsStart\");\nexport const toolParamsDeltaEventType = makeEventType(\"ToolParamsDelta\");\nexport const toolParamsEndEventType = makeEventType(\"ToolParamsEnd\");\n\n/** Payload for live assistant text deltas. */\nexport const TextDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n delta: Schema.String,\n});\nexport type TextDeltaPayload = typeof TextDeltaPayload.Type;\nexport const TextDeltaEvent = ephemeralEventSchema(textDeltaEventType, TextDeltaPayload);\nexport type TextDeltaEvent = typeof TextDeltaEvent.Type;\n\n/** Payload for live assistant reasoning deltas. */\nexport const ReasoningDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n delta: Schema.String,\n});\nexport type ReasoningDeltaPayload = typeof ReasoningDeltaPayload.Type;\nexport const ReasoningDeltaEvent = ephemeralEventSchema(\n reasoningDeltaEventType,\n ReasoningDeltaPayload,\n);\nexport type ReasoningDeltaEvent = typeof ReasoningDeltaEvent.Type;\n\n/** Payload for the speculative start of streamed tool parameters. */\nexport const ToolParamsStartPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n toolName: ToolName,\n providerExecuted: Schema.Boolean,\n});\nexport type ToolParamsStartPayload = typeof ToolParamsStartPayload.Type;\nexport const ToolParamsStartEvent = ephemeralEventSchema(\n toolParamsStartEventType,\n ToolParamsStartPayload,\n);\nexport type ToolParamsStartEvent = typeof ToolParamsStartEvent.Type;\n\n/** Payload for one speculative streamed tool parameter chunk. */\nexport const ToolParamsDeltaPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n delta: Schema.String,\n});\nexport type ToolParamsDeltaPayload = typeof ToolParamsDeltaPayload.Type;\nexport const ToolParamsDeltaEvent = ephemeralEventSchema(\n toolParamsDeltaEventType,\n ToolParamsDeltaPayload,\n);\nexport type ToolParamsDeltaEvent = typeof ToolParamsDeltaEvent.Type;\n\n/** Payload for the speculative end of streamed tool parameters. */\nexport const ToolParamsEndPayload = Schema.Struct({\n providerPartId: ProviderPartId,\n toolCallId: ToolCallId,\n});\nexport type ToolParamsEndPayload = typeof ToolParamsEndPayload.Type;\nexport const ToolParamsEndEvent = ephemeralEventSchema(\n toolParamsEndEventType,\n ToolParamsEndPayload,\n);\nexport type ToolParamsEndEvent = typeof ToolParamsEndEvent.Type;\n\n/** Ephemeral event union for live provider stream parts. */\nexport const ModelStreamEvent = Schema.Union([\n TextDeltaEvent,\n ReasoningDeltaEvent,\n ToolParamsStartEvent,\n ToolParamsDeltaEvent,\n ToolParamsEndEvent,\n]);\nexport type ModelStreamEvent = typeof ModelStreamEvent.Type;\n\n/** Event type values for ephemeral runtime status events. */\nexport const subscriberStatusEventType = makeEventType(\"SubscriberStatus\");\nexport const traceStatusEventType = makeEventType(\"TraceStatus\");\n\n/** Status values emitted by the live subscriber pipeline. */\nexport const SubscriberStatusKind = Schema.Literals([\n \"connected\",\n \"catching-up\",\n \"live\",\n \"lagging\",\n \"closed\",\n]);\nexport type SubscriberStatusKind = typeof SubscriberStatusKind.Type;\n\n/** Payload for live subscriber lifecycle and lag notifications. */\nexport const SubscriberStatusPayload = Schema.Struct({\n status: SubscriberStatusKind,\n reason: Schema.optionalKey(Schema.String),\n});\nexport type SubscriberStatusPayload = typeof SubscriberStatusPayload.Type;\nexport const SubscriberStatusEvent = ephemeralEventSchema(\n subscriberStatusEventType,\n SubscriberStatusPayload,\n);\nexport type SubscriberStatusEvent = typeof SubscriberStatusEvent.Type;\n\n/** Status values emitted by runtime tracing hooks. */\nexport const TraceStatusKind = Schema.Literals([\"span-started\", \"span-ended\", \"span-failed\"]);\nexport type TraceStatusKind = typeof TraceStatusKind.Type;\n\n/** Payload for live trace/status breadcrumbs that are never replayed durably. */\nexport const TraceStatusPayload = Schema.Struct({\n status: TraceStatusKind,\n spanName: Schema.NonEmptyString,\n details: Schema.optionalKey(Schema.Unknown),\n});\nexport type TraceStatusPayload = typeof TraceStatusPayload.Type;\nexport const TraceStatusEvent = ephemeralEventSchema(traceStatusEventType, TraceStatusPayload);\nexport type TraceStatusEvent = typeof TraceStatusEvent.Type;\n\n/** Ephemeral event union for live runtime status updates. */\nexport const RuntimeStatusEvent = Schema.Union([SubscriberStatusEvent, TraceStatusEvent]);\nexport type RuntimeStatusEvent = typeof RuntimeStatusEvent.Type;\n\n/** Built-in ephemeral event union for framework-owned live-only updates. */\nexport const EDAEphemeralEvent = Schema.Union([ModelStreamEvent, RuntimeStatusEvent]);\nexport type EDAEphemeralEvent = typeof EDAEphemeralEvent.Type;\n"],"mappings":";;;;;;;AAOA,MAAa,qBAAqB,cAAc,WAAW;AAC3D,MAAa,0BAA0B,cAAc,gBAAgB;AACrE,MAAa,2BAA2B,cAAc,iBAAiB;AACvE,MAAa,2BAA2B,cAAc,iBAAiB;AACvE,MAAa,yBAAyB,cAAc,eAAe;;AAGnE,MAAa,mBAAmB,OAAO,OAAO;CAC5C,gBAAgB;CAChB,OAAO,OAAO;AAChB,CAAC;AAED,MAAa,iBAAiB,qBAAqB,oBAAoB,gBAAgB;;AAIvF,MAAa,wBAAwB,OAAO,OAAO;CACjD,gBAAgB;CAChB,OAAO,OAAO;AAChB,CAAC;AAED,MAAa,sBAAsB,qBACjC,yBACA,qBACF;;AAIA,MAAa,yBAAyB,OAAO,OAAO;CAClD,gBAAgB;CAChB,YAAY;CACZ,UAAU;CACV,kBAAkB,OAAO;AAC3B,CAAC;AAED,MAAa,uBAAuB,qBAClC,0BACA,sBACF;;AAIA,MAAa,yBAAyB,OAAO,OAAO;CAClD,gBAAgB;CAChB,YAAY;CACZ,OAAO,OAAO;AAChB,CAAC;AAED,MAAa,uBAAuB,qBAClC,0BACA,sBACF;;AAIA,MAAa,uBAAuB,OAAO,OAAO;CAChD,gBAAgB;CAChB,YAAY;AACd,CAAC;AAED,MAAa,qBAAqB,qBAChC,wBACA,oBACF;;AAIA,MAAa,mBAAmB,OAAO,MAAM;CAC3C;CACA;CACA;CACA;CACA;AACF,CAAC;;AAID,MAAa,4BAA4B,cAAc,kBAAkB;AACzE,MAAa,uBAAuB,cAAc,aAAa;;AAG/D,MAAa,uBAAuB,OAAO,SAAS;CAClD;CACA;CACA;CACA;CACA;AACF,CAAC;;AAID,MAAa,0BAA0B,OAAO,OAAO;CACnD,QAAQ;CACR,QAAQ,OAAO,YAAY,OAAO,MAAM;AAC1C,CAAC;AAED,MAAa,wBAAwB,qBACnC,2BACA,uBACF;;AAIA,MAAa,kBAAkB,OAAO,SAAS;CAAC;CAAgB;CAAc;AAAa,CAAC;;AAI5F,MAAa,qBAAqB,OAAO,OAAO;CAC9C,QAAQ;CACR,UAAU,OAAO;CACjB,SAAS,OAAO,YAAY,OAAO,OAAO;AAC5C,CAAC;AAED,MAAa,mBAAmB,qBAAqB,sBAAsB,kBAAkB;;AAI7F,MAAa,qBAAqB,OAAO,MAAM,CAAC,uBAAuB,gBAAgB,CAAC;;AAIxF,MAAa,oBAAoB,OAAO,MAAM,CAAC,kBAAkB,kBAAkB,CAAC"}
|
package/dist/websocket.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
import { d as PositionedEvent, i as EventEnvelope } from "./envelope-DkZyMIgp.js";
|
|
1
2
|
import { m as SequenceNumber } from "./core-CYT6DBaS.js";
|
|
2
3
|
import { a as PromotePendingMessageCommand, c as SubmitMessageCommand, o as ResumePendingMessagesCommand, s as StopTurnCommand, t as CancelPendingMessageCommand } from "./commands-Ce1ec6kH.js";
|
|
3
|
-
import { A as EventEnvelope, L as PositionedEvent } from "./events-Bb9-Cu-7.js";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
5
|
import * as Schema from "effect/Schema";
|
|
6
6
|
|
|
@@ -89,7 +89,40 @@ type EDAWebSocketEventConsumerPolicy<Event extends {
|
|
|
89
89
|
readonly type: string;
|
|
90
90
|
}, Disposition> = Readonly<Record<Event["type"], Disposition>>;
|
|
91
91
|
/** Complete framework-owned event union present on every EDA WebSocket. */
|
|
92
|
-
declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<readonly [Schema.
|
|
92
|
+
declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<readonly [Schema.Struct<{
|
|
93
|
+
readonly namespace: Schema.Literal<string>;
|
|
94
|
+
readonly type: Schema.Literal<"SessionConfigured">;
|
|
95
|
+
readonly schemaVersion: Schema.Literal<number>;
|
|
96
|
+
readonly payload: Schema.Struct<{
|
|
97
|
+
readonly modelSelection: Schema.Struct<{
|
|
98
|
+
readonly provider: Schema.NonEmptyString;
|
|
99
|
+
readonly modelId: Schema.NonEmptyString;
|
|
100
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
101
|
+
}>;
|
|
102
|
+
}>;
|
|
103
|
+
readonly durability: Schema.Literal<"durable">;
|
|
104
|
+
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
105
|
+
readonly sessionId: Schema.brand<Schema.String, "SessionId">;
|
|
106
|
+
readonly correlationId: Schema.optionalKey<Schema.brand<Schema.String, "CorrelationId">>;
|
|
107
|
+
readonly createdAtMs: Schema.brand<Schema.Int, "UnixEpochMillis">;
|
|
108
|
+
readonly trace: Schema.withConstructorDefault<Schema.Struct<{
|
|
109
|
+
readonly span: Schema.Struct<{
|
|
110
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
111
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
112
|
+
readonly sampled: Schema.Boolean;
|
|
113
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
114
|
+
}>;
|
|
115
|
+
readonly links: Schema.$Array<Schema.Struct<{
|
|
116
|
+
readonly context: Schema.Struct<{
|
|
117
|
+
readonly traceId: Schema.brand<Schema.String, "EDATraceId">;
|
|
118
|
+
readonly spanId: Schema.brand<Schema.String, "EDASpanId">;
|
|
119
|
+
readonly sampled: Schema.Boolean;
|
|
120
|
+
readonly tracestate: Schema.NullOr<Schema.String>;
|
|
121
|
+
}>;
|
|
122
|
+
readonly attributes: Schema.$Record<Schema.String, Schema.Union<readonly [Schema.String, Schema.Number, Schema.Boolean]>>;
|
|
123
|
+
}>>;
|
|
124
|
+
}>>;
|
|
125
|
+
}>, Schema.Union<readonly [Schema.Struct<{
|
|
93
126
|
readonly namespace: Schema.Literal<string>;
|
|
94
127
|
readonly type: Schema.Literal<"CommandAdmitted">;
|
|
95
128
|
readonly schemaVersion: Schema.Literal<number>;
|
|
@@ -1011,6 +1044,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
|
|
|
1011
1044
|
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
1012
1045
|
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
1013
1046
|
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1047
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1014
1048
|
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
1015
1049
|
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
1016
1050
|
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
@@ -1147,6 +1181,7 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
|
|
|
1147
1181
|
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
1148
1182
|
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
1149
1183
|
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1184
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1150
1185
|
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
1151
1186
|
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
1152
1187
|
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
@@ -1604,6 +1639,19 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
|
|
|
1604
1639
|
readonly schemaVersion: Schema.Literal<number>;
|
|
1605
1640
|
readonly payload: Schema.Struct<{
|
|
1606
1641
|
readonly compactionId: Schema.brand<Schema.String, "CompactionId">;
|
|
1642
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
1643
|
+
readonly provider: Schema.NonEmptyString;
|
|
1644
|
+
readonly modelId: Schema.NonEmptyString;
|
|
1645
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
1646
|
+
}>>;
|
|
1647
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
1648
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
1649
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1650
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1651
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
1652
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
1653
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
1654
|
+
}>>;
|
|
1607
1655
|
}>;
|
|
1608
1656
|
readonly durability: Schema.Literal<"durable">;
|
|
1609
1657
|
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
@@ -1670,6 +1718,19 @@ declare const EDAFrameworkWebSocketEvent: Schema.Union<readonly [Schema.Union<re
|
|
|
1670
1718
|
readonly code: Schema.optionalKey<Schema.String>;
|
|
1671
1719
|
readonly details: Schema.optionalKey<Schema.Unknown>;
|
|
1672
1720
|
}>;
|
|
1721
|
+
readonly modelSelection: Schema.optionalKey<Schema.Struct<{
|
|
1722
|
+
readonly provider: Schema.NonEmptyString;
|
|
1723
|
+
readonly modelId: Schema.NonEmptyString;
|
|
1724
|
+
readonly settings: Schema.optionalKey<Schema.Unknown>;
|
|
1725
|
+
}>>;
|
|
1726
|
+
readonly usage: Schema.optionalKey<Schema.Struct<{
|
|
1727
|
+
readonly inputTokens: Schema.optionalKey<Schema.Int>;
|
|
1728
|
+
readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1729
|
+
readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
|
|
1730
|
+
readonly outputTokens: Schema.optionalKey<Schema.Int>;
|
|
1731
|
+
readonly textTokens: Schema.optionalKey<Schema.Int>;
|
|
1732
|
+
readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
|
|
1733
|
+
}>>;
|
|
1673
1734
|
}>;
|
|
1674
1735
|
readonly durability: Schema.Literal<"durable">;
|
|
1675
1736
|
readonly eventId: Schema.brand<Schema.String, "EventId">;
|
|
@@ -2499,6 +2560,13 @@ declare const EDAWebSocketInFlightFrame: Schema.Struct<{
|
|
|
2499
2560
|
readonly sentAtMs: Schema.Number;
|
|
2500
2561
|
}>;
|
|
2501
2562
|
type EDAWebSocketInFlightFrame = typeof EDAWebSocketInFlightFrame.Type;
|
|
2563
|
+
/** Compact consecutive host-suppressed receipts blocked by a visible ACK. */
|
|
2564
|
+
declare const EDAWebSocketSuppressedRange: Schema.Struct<{
|
|
2565
|
+
readonly fromFrameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2566
|
+
readonly throughFrameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2567
|
+
readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
2568
|
+
}>;
|
|
2569
|
+
type EDAWebSocketSuppressedRange = typeof EDAWebSocketSuppressedRange.Type;
|
|
2502
2570
|
/** Complete delivery bookkeeping persisted in the WebSocket attachment. */
|
|
2503
2571
|
declare const EDAWebSocketDeliveryCheckpoint: Schema.Struct<{
|
|
2504
2572
|
readonly lastAckedSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
@@ -2510,7 +2578,12 @@ declare const EDAWebSocketDeliveryCheckpoint: Schema.Struct<{
|
|
|
2510
2578
|
readonly frameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2511
2579
|
readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
2512
2580
|
readonly sentAtMs: Schema.Number;
|
|
2513
|
-
}>>;
|
|
2581
|
+
}>>; /** Host-projected receipts waiting behind an earlier client-visible ACK. */
|
|
2582
|
+
readonly suppressed: Schema.optionalKey<Schema.$Array<Schema.Struct<{
|
|
2583
|
+
readonly fromFrameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2584
|
+
readonly throughFrameId: Schema.brand<Schema.Int, "FrameId">;
|
|
2585
|
+
readonly durableThroughSeq: Schema.brand<Schema.Int, "SequenceNumber">;
|
|
2586
|
+
}>>>;
|
|
2514
2587
|
}>;
|
|
2515
2588
|
type EDAWebSocketDeliveryCheckpoint = typeof EDAWebSocketDeliveryCheckpoint.Type;
|
|
2516
2589
|
/** In-memory delivery state for one accepted event WebSocket. */
|
|
@@ -2519,6 +2592,7 @@ interface EDAWebSocketDeliveryState extends EDAWebSocketDeliveryCheckpoint {
|
|
|
2519
2592
|
readonly policy: EDAWebSocketFlowControl;
|
|
2520
2593
|
/** Ephemeral events are live-only and intentionally absent from the attachment. */
|
|
2521
2594
|
readonly pendingEphemeral: ReadonlyArray<PositionedEvent>;
|
|
2595
|
+
readonly suppressed: ReadonlyArray<EDAWebSocketSuppressedRange>;
|
|
2522
2596
|
}
|
|
2523
2597
|
/** Explicit instructions emitted by the pure delivery state machine. */
|
|
2524
2598
|
type EDAWebSocketDeliveryAction = {
|
|
@@ -2562,6 +2636,11 @@ declare const onDurableEvents: (state: EDAWebSocketDeliveryState, events: Readon
|
|
|
2562
2636
|
declare const onEphemeralEvent: (state: EDAWebSocketDeliveryState, event: PositionedEvent, nowMs: number) => EDAWebSocketDeliveryResult;
|
|
2563
2637
|
/** Apply one client ACK, reopen the window, and drain buffered ephemeral events. */
|
|
2564
2638
|
declare const onClientAck: (state: EDAWebSocketDeliveryState, ack: EDAWebSocketAckFrame, nowMs: number) => EDAWebSocketDeliveryResult;
|
|
2639
|
+
/**
|
|
2640
|
+
* Apply one exact host-suppressed receipt without cumulatively ACKing any
|
|
2641
|
+
* earlier client-visible frame.
|
|
2642
|
+
*/
|
|
2643
|
+
declare const onHostSuppressedFrame: (state: EDAWebSocketDeliveryState, frame: Pick<EDAWebSocketEventsFrame, "durableThroughSeq" | "frameId">, nowMs: number) => EDAWebSocketDeliveryResult;
|
|
2565
2644
|
//#endregion
|
|
2566
|
-
export { EDAFrameworkWebSocketEvent, EDAWebSocketAckFrame, EDAWebSocketClientFrame, EDAWebSocketDeliveryAction, EDAWebSocketDeliveryCheckpoint, EDAWebSocketDeliveryResult, EDAWebSocketDeliveryState, EDAWebSocketErrorFrame, EDAWebSocketEventConsumerPolicy, EDAWebSocketEventsFrame, EDAWebSocketFlowControl, EDAWebSocketHeartbeatFrame, EDAWebSocketHelloFrame, EDAWebSocketInFlightFrame, EDAWebSocketLaggedFrame, EDAWebSocketPingFrame, EDAWebSocketPongFrame, EDAWebSocketServerFrame, EDAWebSocketServerFrameEncoder, EDAWebSocketServerFrameInput, EDAWebSocketWireAckFrame, EDAWebSocketWireClientFrame, EDAWebSocketWireErrorFrame, EDAWebSocketWireFlowControl, EDAWebSocketWireHeartbeatFrame, EDAWebSocketWireHelloFrame, EDAWebSocketWireLaggedFrame, EDAWebSocketWirePingFrame, EDAWebSocketWirePongFrame, EDAWebSocketWireProtocol, EDA_WEB_SOCKET_PING_MESSAGE, EDA_WEB_SOCKET_PONG_MESSAGE, EDA_WEB_SOCKET_PROTOCOL_VERSION, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION, EDA_WS_CLOSE_GOING_AWAY, EDA_WS_CLOSE_LAGGED, EDA_WS_CLOSE_PROTOCOL_ERROR, EDA_WS_CLOSE_SEND_FAILED, EDA_WS_CLOSE_UNSUPPORTED_DATA, FrameId, MakeDeliveryStateInput, SubscriberId, SubscriberLagReason, checkpointWebSocketDeliveryState, decodeEDAWebSocketClientMessage, defaultEDAWebSocketFlowControl, deliveryHelloFrame, edaFrameworkWebSocketWireProtocol, encodeEDAWebSocketServerFrame, laggedCloseReason, makeEDAWebSocketWireProtocol, makeWebSocketDeliveryState, onClientAck, onDurableEvents, onEphemeralEvent, restoreWebSocketDeliveryState };
|
|
2645
|
+
export { EDAFrameworkWebSocketEvent, EDAWebSocketAckFrame, EDAWebSocketClientFrame, EDAWebSocketDeliveryAction, EDAWebSocketDeliveryCheckpoint, EDAWebSocketDeliveryResult, EDAWebSocketDeliveryState, EDAWebSocketErrorFrame, EDAWebSocketEventConsumerPolicy, EDAWebSocketEventsFrame, EDAWebSocketFlowControl, EDAWebSocketHeartbeatFrame, EDAWebSocketHelloFrame, EDAWebSocketInFlightFrame, EDAWebSocketLaggedFrame, EDAWebSocketPingFrame, EDAWebSocketPongFrame, EDAWebSocketServerFrame, EDAWebSocketServerFrameEncoder, EDAWebSocketServerFrameInput, EDAWebSocketSuppressedRange, EDAWebSocketWireAckFrame, EDAWebSocketWireClientFrame, EDAWebSocketWireErrorFrame, EDAWebSocketWireFlowControl, EDAWebSocketWireHeartbeatFrame, EDAWebSocketWireHelloFrame, EDAWebSocketWireLaggedFrame, EDAWebSocketWirePingFrame, EDAWebSocketWirePongFrame, EDAWebSocketWireProtocol, EDA_WEB_SOCKET_PING_MESSAGE, EDA_WEB_SOCKET_PONG_MESSAGE, EDA_WEB_SOCKET_PROTOCOL_VERSION, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION, EDA_WS_CLOSE_GOING_AWAY, EDA_WS_CLOSE_LAGGED, EDA_WS_CLOSE_PROTOCOL_ERROR, EDA_WS_CLOSE_SEND_FAILED, EDA_WS_CLOSE_UNSUPPORTED_DATA, FrameId, MakeDeliveryStateInput, SubscriberId, SubscriberLagReason, checkpointWebSocketDeliveryState, decodeEDAWebSocketClientMessage, defaultEDAWebSocketFlowControl, deliveryHelloFrame, edaFrameworkWebSocketWireProtocol, encodeEDAWebSocketServerFrame, laggedCloseReason, makeEDAWebSocketWireProtocol, makeWebSocketDeliveryState, onClientAck, onDurableEvents, onEphemeralEvent, onHostSuppressedFrame, restoreWebSocketDeliveryState };
|
|
2567
2646
|
//# sourceMappingURL=websocket.d.ts.map
|
package/dist/websocket.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Position, SequenceNumber } from "./types/core.js";
|
|
2
|
-
import {
|
|
2
|
+
import { h as UnixEpochMillis, i as EventEnvelope, u as PositionedEvent } from "./envelope-DxQzo5rN.js";
|
|
3
|
+
import { V as EDADurableEvent } from "./durable-BGFvX7Mh.js";
|
|
3
4
|
import { EDAEphemeralEvent } from "./types/events.js";
|
|
4
5
|
import * as Effect from "effect/Effect";
|
|
5
6
|
import * as Schema from "effect/Schema";
|
|
@@ -219,6 +220,12 @@ const EDAWebSocketInFlightFrame = Schema.Struct({
|
|
|
219
220
|
durableThroughSeq: SequenceNumber,
|
|
220
221
|
sentAtMs: Schema.Number
|
|
221
222
|
});
|
|
223
|
+
/** Compact consecutive host-suppressed receipts blocked by a visible ACK. */
|
|
224
|
+
const EDAWebSocketSuppressedRange = Schema.Struct({
|
|
225
|
+
fromFrameId: FrameId,
|
|
226
|
+
throughFrameId: FrameId,
|
|
227
|
+
durableThroughSeq: SequenceNumber
|
|
228
|
+
});
|
|
222
229
|
/** Complete delivery bookkeeping persisted in the WebSocket attachment. */
|
|
223
230
|
const EDAWebSocketDeliveryCheckpoint = Schema.Struct({
|
|
224
231
|
lastAckedSeq: SequenceNumber,
|
|
@@ -226,7 +233,9 @@ const EDAWebSocketDeliveryCheckpoint = Schema.Struct({
|
|
|
226
233
|
lastSentFrameId: Schema.Int.check(Schema.isGreaterThanOrEqualTo(0)),
|
|
227
234
|
nextFrameId: Schema.Int.check(Schema.isGreaterThanOrEqualTo(1)),
|
|
228
235
|
sentDurableThroughSeq: SequenceNumber,
|
|
229
|
-
inFlight: Schema.Array(EDAWebSocketInFlightFrame)
|
|
236
|
+
inFlight: Schema.Array(EDAWebSocketInFlightFrame),
|
|
237
|
+
/** Host-projected receipts waiting behind an earlier client-visible ACK. */
|
|
238
|
+
suppressed: Schema.optionalKey(Schema.Array(EDAWebSocketSuppressedRange))
|
|
230
239
|
});
|
|
231
240
|
/** Build delivery state for a newly accepted connection. */
|
|
232
241
|
const makeWebSocketDeliveryState = (input) => ({
|
|
@@ -238,6 +247,7 @@ const makeWebSocketDeliveryState = (input) => ({
|
|
|
238
247
|
nextFrameId: 1,
|
|
239
248
|
sentDurableThroughSeq: input.resumeSeq,
|
|
240
249
|
inFlight: [],
|
|
250
|
+
suppressed: [],
|
|
241
251
|
pendingEphemeral: []
|
|
242
252
|
});
|
|
243
253
|
/** Rebuild exact ACK bookkeeping from a hibernating WebSocket attachment. */
|
|
@@ -245,7 +255,8 @@ const restoreWebSocketDeliveryState = (input) => ({
|
|
|
245
255
|
subscriberId: input.subscriberId,
|
|
246
256
|
policy: input.policy,
|
|
247
257
|
...input.checkpoint,
|
|
248
|
-
pendingEphemeral: []
|
|
258
|
+
pendingEphemeral: [],
|
|
259
|
+
suppressed: input.checkpoint.suppressed ?? []
|
|
249
260
|
});
|
|
250
261
|
/** Project in-memory delivery state into the attachment-safe checkpoint. */
|
|
251
262
|
const checkpointWebSocketDeliveryState = (state) => ({
|
|
@@ -254,7 +265,8 @@ const checkpointWebSocketDeliveryState = (state) => ({
|
|
|
254
265
|
lastSentFrameId: state.lastSentFrameId,
|
|
255
266
|
nextFrameId: state.nextFrameId,
|
|
256
267
|
sentDurableThroughSeq: state.sentDurableThroughSeq,
|
|
257
|
-
inFlight: state.inFlight
|
|
268
|
+
inFlight: state.inFlight,
|
|
269
|
+
...state.suppressed.length === 0 ? {} : { suppressed: state.suppressed }
|
|
258
270
|
});
|
|
259
271
|
/** First frame for a freshly accepted connection. Restores never re-send hello. */
|
|
260
272
|
const deliveryHelloFrame = (state) => EDAWebSocketHelloFrame.make({
|
|
@@ -313,7 +325,23 @@ const onClientAck = (state, ack, nowMs) => {
|
|
|
313
325
|
state,
|
|
314
326
|
actions: []
|
|
315
327
|
};
|
|
316
|
-
|
|
328
|
+
return reopenDeliveryWindow(validated.state, nowMs);
|
|
329
|
+
};
|
|
330
|
+
/**
|
|
331
|
+
* Apply one exact host-suppressed receipt without cumulatively ACKing any
|
|
332
|
+
* earlier client-visible frame.
|
|
333
|
+
*/
|
|
334
|
+
const onHostSuppressedFrame = (state, frame, nowMs) => {
|
|
335
|
+
const receipt = state.inFlight.find((candidate) => candidate.frameId === frame.frameId);
|
|
336
|
+
if (receipt === void 0 || receipt.durableThroughSeq !== frame.durableThroughSeq) return protocolClose(state, "Host suppressed an unknown frame receipt").result;
|
|
337
|
+
return reopenDeliveryWindow(advanceSuppressedReceipts({
|
|
338
|
+
...state,
|
|
339
|
+
inFlight: state.inFlight.filter((candidate) => candidate.frameId !== frame.frameId),
|
|
340
|
+
suppressed: insertSuppressedReceipt(state.suppressed, receipt)
|
|
341
|
+
}), nowMs);
|
|
342
|
+
};
|
|
343
|
+
const reopenDeliveryWindow = (state, nowMs) => {
|
|
344
|
+
let next = state;
|
|
317
345
|
const frames = [];
|
|
318
346
|
while (next.pendingEphemeral.length > 0 && windowCapacity(next) > 0) {
|
|
319
347
|
const [head, ...rest] = next.pendingEphemeral;
|
|
@@ -333,20 +361,62 @@ const applyAck = (state, ack) => {
|
|
|
333
361
|
if (ack.frameId <= state.lastAckedFrameId) return ack.durableThroughSeq > state.lastAckedSeq ? protocolClose(state, "Duplicate ACK attempted to advance durable seq") : { _tag: "ignore" };
|
|
334
362
|
if (ack.frameId > state.lastSentFrameId) return protocolClose(state, "ACK referenced an unsent frame");
|
|
335
363
|
if (ack.durableThroughSeq < state.lastAckedSeq) return protocolClose(state, "ACK durable seq moved backwards");
|
|
336
|
-
const
|
|
337
|
-
if (
|
|
338
|
-
|
|
364
|
+
const acknowledgedVisible = state.inFlight.filter((frame) => frame.frameId <= ack.frameId);
|
|
365
|
+
if (acknowledgedVisible.length === 0) return protocolClose(state, "ACK referenced no in-flight frames");
|
|
366
|
+
if (state.suppressed.some((range) => range.fromFrameId <= ack.frameId && ack.frameId <= range.throughFrameId)) return protocolClose(state, "ACK referenced a host-suppressed frame");
|
|
367
|
+
const acknowledgedSuppressed = state.suppressed.filter((range) => range.throughFrameId <= ack.frameId);
|
|
368
|
+
const acknowledged = [...acknowledgedVisible, ...acknowledgedSuppressed];
|
|
369
|
+
const allowedDurableSeq = SequenceNumber.make(acknowledged.reduce((max, receipt) => Math.max(max, receipt.durableThroughSeq), state.lastAckedSeq));
|
|
339
370
|
if (ack.durableThroughSeq > allowedDurableSeq) return protocolClose(state, "ACK durable seq exceeded sent frame boundary");
|
|
340
371
|
return {
|
|
341
372
|
_tag: "apply",
|
|
342
|
-
state: {
|
|
373
|
+
state: advanceSuppressedReceipts({
|
|
343
374
|
...state,
|
|
344
375
|
inFlight: state.inFlight.filter((frame) => frame.frameId > ack.frameId),
|
|
345
376
|
lastAckedFrameId: ack.frameId,
|
|
346
|
-
lastAckedSeq: ack.durableThroughSeq
|
|
347
|
-
|
|
377
|
+
lastAckedSeq: ack.durableThroughSeq,
|
|
378
|
+
suppressed: state.suppressed.filter((range) => range.throughFrameId > ack.frameId)
|
|
379
|
+
})
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
const advanceSuppressedReceipts = (state) => {
|
|
383
|
+
let lastAckedFrameId = state.lastAckedFrameId;
|
|
384
|
+
let lastAckedSeq = state.lastAckedSeq;
|
|
385
|
+
let consumed = 0;
|
|
386
|
+
for (const range of state.suppressed) {
|
|
387
|
+
if (range.fromFrameId !== lastAckedFrameId + 1) break;
|
|
388
|
+
lastAckedFrameId = range.throughFrameId;
|
|
389
|
+
lastAckedSeq = SequenceNumber.make(Math.max(lastAckedSeq, range.durableThroughSeq));
|
|
390
|
+
consumed += 1;
|
|
391
|
+
}
|
|
392
|
+
return consumed === 0 ? state : {
|
|
393
|
+
...state,
|
|
394
|
+
lastAckedFrameId,
|
|
395
|
+
lastAckedSeq,
|
|
396
|
+
suppressed: state.suppressed.slice(consumed)
|
|
348
397
|
};
|
|
349
398
|
};
|
|
399
|
+
const insertSuppressedReceipt = (ranges, receipt) => {
|
|
400
|
+
const inserted = [...ranges, EDAWebSocketSuppressedRange.make({
|
|
401
|
+
fromFrameId: receipt.frameId,
|
|
402
|
+
throughFrameId: receipt.frameId,
|
|
403
|
+
durableThroughSeq: receipt.durableThroughSeq
|
|
404
|
+
})].sort((left, right) => left.fromFrameId - right.fromFrameId);
|
|
405
|
+
const compacted = [];
|
|
406
|
+
for (const range of inserted) {
|
|
407
|
+
const previous = compacted.at(-1);
|
|
408
|
+
if (previous === void 0 || range.fromFrameId > previous.throughFrameId + 1) {
|
|
409
|
+
compacted.push(range);
|
|
410
|
+
continue;
|
|
411
|
+
}
|
|
412
|
+
compacted[compacted.length - 1] = EDAWebSocketSuppressedRange.make({
|
|
413
|
+
fromFrameId: previous.fromFrameId,
|
|
414
|
+
throughFrameId: FrameId.make(Math.max(previous.throughFrameId, range.throughFrameId)),
|
|
415
|
+
durableThroughSeq: SequenceNumber.make(Math.max(previous.durableThroughSeq, range.durableThroughSeq))
|
|
416
|
+
});
|
|
417
|
+
}
|
|
418
|
+
return compacted;
|
|
419
|
+
};
|
|
350
420
|
const windowCapacity = (state) => state.policy.maxInFlightFrames - state.inFlight.length;
|
|
351
421
|
const sendEventsFrame = (state, events, nowMs) => {
|
|
352
422
|
const [first, ...rest] = events;
|
|
@@ -423,6 +493,6 @@ const protocolClose = (state, message) => ({
|
|
|
423
493
|
}
|
|
424
494
|
});
|
|
425
495
|
//#endregion
|
|
426
|
-
export { EDAFrameworkWebSocketEvent, EDAWebSocketAckFrame, EDAWebSocketClientFrame, EDAWebSocketDeliveryCheckpoint, EDAWebSocketErrorFrame, EDAWebSocketEventsFrame, EDAWebSocketFlowControl, EDAWebSocketHeartbeatFrame, EDAWebSocketHelloFrame, EDAWebSocketInFlightFrame, EDAWebSocketLaggedFrame, EDAWebSocketPingFrame, EDAWebSocketPongFrame, EDAWebSocketServerFrame, EDAWebSocketWireAckFrame, EDAWebSocketWireClientFrame, EDAWebSocketWireErrorFrame, EDAWebSocketWireFlowControl, EDAWebSocketWireHeartbeatFrame, EDAWebSocketWireHelloFrame, EDAWebSocketWireLaggedFrame, EDAWebSocketWirePingFrame, EDAWebSocketWirePongFrame, EDA_WEB_SOCKET_PING_MESSAGE, EDA_WEB_SOCKET_PONG_MESSAGE, EDA_WEB_SOCKET_PROTOCOL_VERSION, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION, EDA_WS_CLOSE_GOING_AWAY, EDA_WS_CLOSE_LAGGED, EDA_WS_CLOSE_PROTOCOL_ERROR, EDA_WS_CLOSE_SEND_FAILED, EDA_WS_CLOSE_UNSUPPORTED_DATA, FrameId, SubscriberId, SubscriberLagReason, checkpointWebSocketDeliveryState, decodeEDAWebSocketClientMessage, defaultEDAWebSocketFlowControl, deliveryHelloFrame, edaFrameworkWebSocketWireProtocol, encodeEDAWebSocketServerFrame, laggedCloseReason, makeEDAWebSocketWireProtocol, makeWebSocketDeliveryState, onClientAck, onDurableEvents, onEphemeralEvent, restoreWebSocketDeliveryState };
|
|
496
|
+
export { EDAFrameworkWebSocketEvent, EDAWebSocketAckFrame, EDAWebSocketClientFrame, EDAWebSocketDeliveryCheckpoint, EDAWebSocketErrorFrame, EDAWebSocketEventsFrame, EDAWebSocketFlowControl, EDAWebSocketHeartbeatFrame, EDAWebSocketHelloFrame, EDAWebSocketInFlightFrame, EDAWebSocketLaggedFrame, EDAWebSocketPingFrame, EDAWebSocketPongFrame, EDAWebSocketServerFrame, EDAWebSocketSuppressedRange, EDAWebSocketWireAckFrame, EDAWebSocketWireClientFrame, EDAWebSocketWireErrorFrame, EDAWebSocketWireFlowControl, EDAWebSocketWireHeartbeatFrame, EDAWebSocketWireHelloFrame, EDAWebSocketWireLaggedFrame, EDAWebSocketWirePingFrame, EDAWebSocketWirePongFrame, EDA_WEB_SOCKET_PING_MESSAGE, EDA_WEB_SOCKET_PONG_MESSAGE, EDA_WEB_SOCKET_PROTOCOL_VERSION, EDA_WEB_SOCKET_WIRE_PROTOCOL_VERSION, EDA_WS_CLOSE_GOING_AWAY, EDA_WS_CLOSE_LAGGED, EDA_WS_CLOSE_PROTOCOL_ERROR, EDA_WS_CLOSE_SEND_FAILED, EDA_WS_CLOSE_UNSUPPORTED_DATA, FrameId, SubscriberId, SubscriberLagReason, checkpointWebSocketDeliveryState, decodeEDAWebSocketClientMessage, defaultEDAWebSocketFlowControl, deliveryHelloFrame, edaFrameworkWebSocketWireProtocol, encodeEDAWebSocketServerFrame, laggedCloseReason, makeEDAWebSocketWireProtocol, makeWebSocketDeliveryState, onClientAck, onDurableEvents, onEphemeralEvent, onHostSuppressedFrame, restoreWebSocketDeliveryState };
|
|
427
497
|
|
|
428
498
|
//# sourceMappingURL=websocket.js.map
|