effect-durable-agent 0.2.3 → 0.4.0
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/{delivery-A0JGAmbC.d.ts → delivery-DoHIy6rQ.d.ts} +2 -2
- package/dist/domain/command-queues.d.ts +1 -1
- package/dist/domain/message-transcript.d.ts +1 -1
- package/dist/domain/reduced-state.d.ts +1 -1
- package/dist/domain/run-scheduling.d.ts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/{reduced-state-M2tbEOWK.d.ts → reduced-state-DNfEwxu7.d.ts} +365 -342
- package/dist/services/compaction.d.ts +1 -1
- package/dist/services/decider.d.ts +1 -1
- package/dist/services/decider.js +1 -1
- package/dist/services/model-call.d.ts +1 -1
- package/dist/services/prompt-projector.d.ts +1 -1
- package/dist/services/run-scheduler.d.ts +1 -1
- package/dist/services/runtime-layer.d.ts +1 -2
- package/dist/services/runtime-layer.js +3 -3
- package/dist/services/runtime.d.ts +1 -1
- package/dist/services/runtime.js +1 -1
- package/dist/services/session-event-observer.d.ts +1 -1
- package/dist/services/session-event-observer.js.map +1 -1
- package/dist/services/session-query.d.ts +1 -1
- package/dist/services/session-query.js +1 -1
- package/dist/services/session-state.d.ts +1 -1
- package/dist/services/session-state.js +2 -2
- package/dist/services/session-store.js +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/{session-admission-WE8J_0z9.js → session-admission-DC98zwtj.js} +1 -2
- package/dist/session-admission-DC98zwtj.js.map +1 -0
- package/dist/{session-state-7fAC2GDp.js → session-state-urBjAvsy.js} +8 -19
- package/dist/session-state-urBjAvsy.js.map +1 -0
- package/dist/{sink-registry-AOjX5_A1.js → sink-registry-CjdKeTUM.js} +2 -2
- package/dist/{sink-registry-AOjX5_A1.js.map → sink-registry-CjdKeTUM.js.map} +1 -1
- package/dist/testkit/layers.d.ts +1 -2
- package/dist/testkit/layers.js +3 -3
- package/dist/websocket/events.d.ts +1 -1
- package/dist/websocket.d.ts +1 -1
- package/package.json +1 -1
- package/dist/session-admission-WE8J_0z9.js.map +0 -1
- package/dist/session-event-observer-BWQUJTcN.d.ts +0 -24
- package/dist/session-state-7fAC2GDp.js.map +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $t as PromptPrefixSummaryCompactionExecutorOptions, Bt as CompactionError, Gt as CompactionPlan, Ht as CompactionExecutorInput, Jt as CompactionPolicyShape, Kt as CompactionPolicy, Qt as LanguageModelSummaryCompactionExecutorOptions, Ut as CompactionExecutorShape, Vt as CompactionExecutor, Wt as CompactionOutput, Xt as CompactionRunnerInput, Yt as CompactionRunner, Zt as CompactionRunnerShape, an as promptPrefixSummaryCompactionExecutor, en as defaultCompactionCharsPerToken, in as defaultCompactionThresholdTokens, nn as defaultCompactionRetainTailTokens, qt as CompactionPolicyInput, rn as defaultCompactionSummaryInstructions, tn as defaultCompactionMinSummarizableTokens, zt as ApproximateTokenThresholdCompactionPolicyOptions } from "../reduced-state-
|
|
1
|
+
import { $t as PromptPrefixSummaryCompactionExecutorOptions, Bt as CompactionError, Gt as CompactionPlan, Ht as CompactionExecutorInput, Jt as CompactionPolicyShape, Kt as CompactionPolicy, Qt as LanguageModelSummaryCompactionExecutorOptions, Ut as CompactionExecutorShape, Vt as CompactionExecutor, Wt as CompactionOutput, Xt as CompactionRunnerInput, Yt as CompactionRunner, Zt as CompactionRunnerShape, an as promptPrefixSummaryCompactionExecutor, en as defaultCompactionCharsPerToken, in as defaultCompactionThresholdTokens, nn as defaultCompactionRetainTailTokens, qt as CompactionPolicyInput, rn as defaultCompactionSummaryInstructions, tn as defaultCompactionMinSummarizableTokens, zt as ApproximateTokenThresholdCompactionPolicyOptions } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { ApproximateTokenThresholdCompactionPolicyOptions, CompactionError, CompactionExecutor, CompactionExecutorInput, CompactionExecutorShape, CompactionOutput, CompactionPlan, CompactionPolicy, CompactionPolicyInput, CompactionPolicyShape, CompactionRunner, CompactionRunnerInput, CompactionRunnerShape, LanguageModelSummaryCompactionExecutorOptions, PromptPrefixSummaryCompactionExecutorOptions, defaultCompactionCharsPerToken, defaultCompactionMinSummarizableTokens, defaultCompactionRetainTailTokens, defaultCompactionSummaryInstructions, defaultCompactionThresholdTokens, promptPrefixSummaryCompactionExecutor };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $n as
|
|
1
|
+
import { $n as deciderMarkerDedupeKey, Gn as EDADeciderItem, Hn as EDADecider, Jn as EDADeciderView, Kn as EDADeciderOutcome, Qn as deciderIdempotencyKeyViolation, Un as EDADeciderDefinition, Wn as EDADeciderError, Xn as EDAErasedDecision, Yn as EDADecision, Zn as EDAEventDraft, ar as maxDeciderResultBytes, er as deciderNamePattern, ir as maxDeciderIdempotencyKeyLength, nr as encodeDeciderJson, qn as EDADeciderRegistry, rr as makeEDADeciderRegistry, tr as edaReservedDeciderNamePrefix } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDADecider, EDADeciderDefinition, EDADeciderError, EDADeciderItem, EDADeciderOutcome, EDADeciderRegistry, EDADeciderView, EDADecision, EDAErasedDecision, EDAEventDraft, deciderIdempotencyKeyViolation, deciderMarkerDedupeKey, deciderNamePattern, edaReservedDeciderNamePrefix, encodeDeciderJson, makeEDADeciderRegistry, maxDeciderIdempotencyKeyLength, maxDeciderResultBytes };
|
package/dist/services/decider.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "../envelope-BSI_Xh-f.js";
|
|
2
|
-
import { i as eventSchemaNamespaces, s as storedJsonForm } from "../session-admission-
|
|
2
|
+
import { i as eventSchemaNamespaces, s as storedJsonForm } from "../session-admission-DC98zwtj.js";
|
|
3
3
|
import * as Context from "effect/Context";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
5
|
import * as Result from "effect/Result";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { sn as EDAModelToolkit } from "../reduced-state-
|
|
1
|
+
import { sn as EDAModelToolkit } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as LanguageModel from "effect/ai/LanguageModel";
|
|
4
4
|
import * as Prompt from "effect/ai/Prompt";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { cr as EDAProjectedPromptContext, dr as EDAPromptProjectorShape, fr as EDA_PROMPT_OPTIONS_KEY, gr as nativeCompactionSummaryMessage, hr as isEDACacheBreakpoint, lr as EDAPromptProjectionInput, mr as getNativeCompaction, pr as buildEDAPrompt, sr as EDANativeCompaction, ur as EDAPromptProjector } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDANativeCompaction, EDAProjectedPromptContext, EDAPromptProjectionInput, EDAPromptProjector, EDAPromptProjectorShape, EDA_PROMPT_OPTIONS_KEY, buildEDAPrompt, getNativeCompaction, isEDACacheBreakpoint, nativeCompactionSummaryMessage };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Ct as RunSchedulingDeliveryError, St as RunSchedulingDelivery, Tn as LocalRunResolution, bt as RunScheduler, jn as RunSchedulingInput, kn as RunResolution, wn as DeferredRunResolution, xt as RunSchedulerShape } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { DeferredRunResolution, LocalRunResolution, type RunResolution, RunScheduler, RunSchedulerShape, RunSchedulingDelivery, RunSchedulingDeliveryError, type RunSchedulingInput };
|
|
@@ -2,8 +2,7 @@ import { g as SessionId } from "../core-BcimKMIv.js";
|
|
|
2
2
|
import { i as EDAAppEvents, o as EDASessionStore, s as EDASessionStoreError } from "../session-store-DaSHeg8Q.js";
|
|
3
3
|
import { t as ModelResolver } from "../model-resolver-O8Kn27GH.js";
|
|
4
4
|
import { r as EDAReducerRegistry } from "../reducer-registry-Bqn5B4JO.js";
|
|
5
|
-
import { $ as SessionCommandAdmissionError, At as EDASink,
|
|
6
|
-
import { t as SessionEventObserver } from "../session-event-observer-BWQUJTcN.js";
|
|
5
|
+
import { $ as SessionCommandAdmissionError, At as EDASink, Hn as EDADecider, J as EDARuntimeConfig, Kt as CompactionPolicy, Sn as SessionEventObserver, Vt as CompactionExecutor, bt as RunScheduler, q as EDARuntime, sn as EDAModelToolkit, un as EDAToolRegistryShape, ur as EDAPromptProjector } from "../reduced-state-DNfEwxu7.js";
|
|
7
6
|
import { t as IdGenerator } from "../id-generator-BKGoKjt-.js";
|
|
8
7
|
import { t as EDAKeepAlive } from "../keep-alive-_zFCUvt3.js";
|
|
9
8
|
import { n as SinkCheckpointStore } from "../sink-checkpoint-store-CUvIVvlZ.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RunSchedulingWakeup } from "./run-scheduling-wakeup.js";
|
|
2
2
|
import { RunScheduler } from "./run-scheduler.js";
|
|
3
|
-
import { d as InferenceRunner, f as ToolExecutor, l as SessionState, p as LiveEventBus, u as TurnRunner } from "../session-state-
|
|
4
|
-
import { t as RegisteredAppEvents } from "../session-admission-
|
|
3
|
+
import { d as InferenceRunner, f as ToolExecutor, l as SessionState, p as LiveEventBus, u as TurnRunner } from "../session-state-urBjAvsy.js";
|
|
4
|
+
import { t as RegisteredAppEvents } from "../session-admission-DC98zwtj.js";
|
|
5
5
|
import { EDASessionStore, registerAppEvents } from "./session-store.js";
|
|
6
6
|
import { a as CompactionPolicy, n as CompactionExecutor, o as CompactionRunner } from "../compaction-Dlq4wgZE.js";
|
|
7
7
|
import { EDAPromptProjector } from "./prompt-projector.js";
|
|
@@ -11,7 +11,7 @@ import { IdGenerator } from "./id-generator.js";
|
|
|
11
11
|
import { EDAKeepAlive } from "./keep-alive.js";
|
|
12
12
|
import { SessionEventObserver } from "./session-event-observer.js";
|
|
13
13
|
import { EDAReducerRegistry } from "./reducer-registry.js";
|
|
14
|
-
import { n as EDASinkRegistry } from "../sink-registry-
|
|
14
|
+
import { n as EDASinkRegistry } from "../sink-registry-CjdKeTUM.js";
|
|
15
15
|
import { EDADeciderRegistry, makeEDADeciderRegistry } from "./decider.js";
|
|
16
16
|
import { EDASessionQuery } from "./session-query.js";
|
|
17
17
|
import { EDARuntime } from "./runtime.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { G as CommittedCommandTerminalEvent, J as EDARuntimeConfig, K as EDACommandTerminalEvent, X as EDARuntimeShape, Y as EDARuntimeError, Z as EDARuntimeSubmit, q as EDARuntime } from "../reduced-state-
|
|
1
|
+
import { G as CommittedCommandTerminalEvent, J as EDARuntimeConfig, K as EDACommandTerminalEvent, X as EDARuntimeShape, Y as EDARuntimeError, Z as EDARuntimeSubmit, q as EDARuntime } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { CommittedCommandTerminalEvent, EDACommandTerminalEvent, EDARuntime, EDARuntimeConfig, EDARuntimeError, EDARuntimeShape, EDARuntimeSubmit };
|
package/dist/services/runtime.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DurablePosition, SequenceNumber, durablePosition } from "../types/core.js";
|
|
2
2
|
import { d as NonNegativeInt, h as SystemPromptText, u as ModelSelectionPayload } from "../envelope-BSI_Xh-f.js";
|
|
3
3
|
import { w as CommandFailedEvent, x as CommandCompletedEvent, y as CommandCancelledEvent } from "../durable-Da57Rcml.js";
|
|
4
|
-
import { l as SessionState } from "../session-state-
|
|
4
|
+
import { l as SessionState } from "../session-state-urBjAvsy.js";
|
|
5
5
|
import { annotateEdaSpan, committedBatchAttributes } from "./tracing.js";
|
|
6
6
|
import { EDASessionQuery } from "./session-query.js";
|
|
7
7
|
import * as Context from "effect/Context";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Cn as SessionEventObserverShape, Sn as SessionEventObserver } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { SessionEventObserver, SessionEventObserverShape };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"session-event-observer.js","names":[],"sources":["../../src/services/session-event-observer.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\nimport type { PositionedEvent } from \"../types/events\";\n\n/**\n * Outbound integration point notified synchronously after EDA publishes an event.\n *\n * Hosts provide this service while composing the runtime. Implementations own\n * their failures and never expose host errors to the session runtime.\n */\nexport interface SessionEventObserverShape {\n readonly onEvent: (event: PositionedEvent) => Effect.Effect<void>;\n}\n\n/** Host-provided observer for append-driven integrations such as hibernatable WebSockets. */\nexport class SessionEventObserver extends Context.Service<\n SessionEventObserver,\n SessionEventObserverShape\n>()(\"@effect-durable-agent/SessionEventObserver\") {\n static readonly Noop = Layer.succeed(SessionEventObserver, {\n onEvent: () => Effect.void,\n });\n\n static readonly FromHandler = (\n onEvent: SessionEventObserverShape[\"onEvent\"],\n ): Layer.Layer<SessionEventObserver> => Layer.succeed(SessionEventObserver, { onEvent });\n}\n"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"session-event-observer.js","names":[],"sources":["../../src/services/session-event-observer.ts"],"sourcesContent":["import * as Context from \"effect/Context\";\nimport * as Effect from \"effect/Effect\";\nimport * as Layer from \"effect/Layer\";\n\nimport type { ReducedState } from \"../domain/reduced-state\";\nimport type { PositionedEvent } from \"../types/events\";\n\n/**\n * Outbound integration point notified synchronously after EDA publishes an event.\n *\n * Hosts provide this service while composing the runtime. Implementations own\n * their failures and never expose host errors to the session runtime.\n */\nexport interface SessionEventObserverShape {\n /**\n * `state` is the session's reduced state when `event` is published. A durable batch folds\n * before it publishes, so `state.lastSeq >= event.position.seq`, with equality on the batch's\n * last event. An ephemeral event is published at the head, so `state.lastSeq` equals its seq.\n * State with `lastSeq` equal to a durable event's seq is exactly the fold through that event.\n */\n readonly onEvent: (event: PositionedEvent, state: ReducedState) => Effect.Effect<void>;\n}\n\n/** Host-provided observer for append-driven integrations such as hibernatable WebSockets. */\nexport class SessionEventObserver extends Context.Service<\n SessionEventObserver,\n SessionEventObserverShape\n>()(\"@effect-durable-agent/SessionEventObserver\") {\n static readonly Noop = Layer.succeed(SessionEventObserver, {\n onEvent: () => Effect.void,\n });\n\n static readonly FromHandler = (\n onEvent: SessionEventObserverShape[\"onEvent\"],\n ): Layer.Layer<SessionEventObserver> => Layer.succeed(SessionEventObserver, { onEvent });\n}\n"],"mappings":";;;;;AAwBA,IAAa,uBAAb,MAAa,6BAA6B,QAAQ,QAGhD,CAAC,CAAC,4CAA4C,CAAC,CAAC;CAChD,OAAgB,OAAO,MAAM,QAAQ,sBAAsB,EACzD,eAAe,OAAO,KACxB,CAAC;CAED,OAAgB,eACd,YACsC,MAAM,QAAQ,sBAAsB,EAAE,QAAQ,CAAC;AACzF"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _n as EDASessionEventPage, bn as EDASessionSnapshot, vn as EDASessionQuery, yn as EDASessionQueryShape } from "../reduced-state-
|
|
1
|
+
import { _n as EDASessionEventPage, bn as EDASessionSnapshot, vn as EDASessionQuery, yn as EDASessionQueryShape } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDASessionEventPage, EDASessionQuery, EDASessionQueryShape, EDASessionSnapshot };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SequenceNumber } from "../types/core.js";
|
|
2
2
|
import { f as PositionedEvent } from "../envelope-BSI_Xh-f.js";
|
|
3
3
|
import { Xn as durableEventEnvelope } from "../durable-Da57Rcml.js";
|
|
4
|
-
import { l as SessionState, p as LiveEventBus } from "../session-state-
|
|
4
|
+
import { l as SessionState, p as LiveEventBus } from "../session-state-urBjAvsy.js";
|
|
5
5
|
import { ReducedStateSchema } from "../domain/reduced-state-schema.js";
|
|
6
6
|
import { EDASessionStore } from "./session-store.js";
|
|
7
7
|
import { annotateEdaSpan } from "./tracing.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { $ as SessionCommandAdmissionError, Q as EDASubmittable, at as SessionDecideError, ct as SessionForkedCommand, dt as SessionRunInput, et as SessionCommandCancelled, ft as SessionState, ht as SessionStateSnapshotData, it as SessionCommandResult, lt as SessionNoRunnableCommand, mt as SessionStateShape, nt as SessionCommandFailed, ot as SessionDrainProcessed, pt as SessionStateError, rt as SessionCommandOutcome, st as SessionDrainResult, tt as SessionCommandCompleted, ut as SessionNoRunnableReason
|
|
1
|
+
import { $ as SessionCommandAdmissionError, Q as EDASubmittable, Vn as SessionCommandAdmissionConflict, at as SessionDecideError, ct as SessionForkedCommand, dt as SessionRunInput, et as SessionCommandCancelled, ft as SessionState, ht as SessionStateSnapshotData, it as SessionCommandResult, lt as SessionNoRunnableCommand, mt as SessionStateShape, nt as SessionCommandFailed, ot as SessionDrainProcessed, pt as SessionStateError, rt as SessionCommandOutcome, st as SessionDrainResult, tt as SessionCommandCompleted, ut as SessionNoRunnableReason } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDASubmittable, SessionCommandAdmissionConflict, SessionCommandAdmissionError, SessionCommandCancelled, SessionCommandCompleted, SessionCommandFailed, SessionCommandOutcome, SessionCommandResult, SessionDecideError, SessionDrainProcessed, SessionDrainResult, SessionForkedCommand, SessionNoRunnableCommand, SessionNoRunnableReason, SessionRunInput, SessionState, SessionStateError, SessionStateShape, SessionStateSnapshotData };
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { a as SessionForkedCommand, c as SessionRunInput, i as SessionCommandOutcome, l as SessionState, n as SessionCommandCompleted, o as SessionNoRunnableCommand, r as SessionCommandFailed, s as SessionNoRunnableReason, t as SessionCommandCancelled } from "../session-state-
|
|
2
|
-
import { n as SessionCommandAdmissionConflict } from "../session-admission-
|
|
1
|
+
import { a as SessionForkedCommand, c as SessionRunInput, i as SessionCommandOutcome, l as SessionState, n as SessionCommandCompleted, o as SessionNoRunnableCommand, r as SessionCommandFailed, s as SessionNoRunnableReason, t as SessionCommandCancelled } from "../session-state-urBjAvsy.js";
|
|
2
|
+
import { n as SessionCommandAdmissionConflict } from "../session-admission-DC98zwtj.js";
|
|
3
3
|
export { SessionCommandAdmissionConflict, SessionCommandCancelled, SessionCommandCompleted, SessionCommandFailed, SessionCommandOutcome, SessionForkedCommand, SessionNoRunnableCommand, SessionNoRunnableReason, SessionRunInput, SessionState };
|
|
@@ -2,7 +2,7 @@ import { CommandId, DurablePosition, SequenceNumber, durablePosition } from "../
|
|
|
2
2
|
import { t as DurableEventEnvelope } from "../envelope-BSI_Xh-f.js";
|
|
3
3
|
import { Fn as commandAdmittedEventType, Gn as contextRebasedEventType, Mr as decodeRetainingExcess, W as DecodedDurableEvent, Xn as durableEventEnvelope, _r as summaryCreatedEventType, qn as decodeDurableEventSync } from "../durable-Da57Rcml.js";
|
|
4
4
|
import { CompactionSummaryArtifact } from "../domain/context-projection.js";
|
|
5
|
-
import { i as eventSchemaNamespaces } from "../session-admission-
|
|
5
|
+
import { i as eventSchemaNamespaces } from "../session-admission-DC98zwtj.js";
|
|
6
6
|
import { m as makeTranscriptDefinition, p as emptyTranscriptMappings } from "../interpreter-BwYN2PCC.js";
|
|
7
7
|
import { T as TranscriptLogIncarnation } from "../records-D0ZIAOzd.js";
|
|
8
8
|
import { a as maintainTranscripts, i as initialTranscriptState, r as inMemoryTranscriptWindowSource } from "../in-memory-E497WhtS.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { At as EDASink, Dt as EDAProjectedSink, Et as EDAProjectedDurableSinkDefinition, Ft as EDASinkRawDurableBatch, It as EDASinkRegistry, Lt as EDASinkRegistryShape, Mt as EDASinkContext, Nt as EDASinkDurableBatch, Ot as EDARawDurableSinkDefinition, Pt as EDASinkInterests, Rt as EDASinkRunnerStartInput, Tt as EDAEphemeralSinkDefinition, jt as EDASinkCheckpoint, kt as EDARawSink, wt as EDADurableSinkDefinition } from "../reduced-state-
|
|
1
|
+
import { At as EDASink, Dt as EDAProjectedSink, Et as EDAProjectedDurableSinkDefinition, Ft as EDASinkRawDurableBatch, It as EDASinkRegistry, Lt as EDASinkRegistryShape, Mt as EDASinkContext, Nt as EDASinkDurableBatch, Ot as EDARawDurableSinkDefinition, Pt as EDASinkInterests, Rt as EDASinkRunnerStartInput, Tt as EDAEphemeralSinkDefinition, jt as EDASinkCheckpoint, kt as EDARawSink, wt as EDADurableSinkDefinition } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDADurableSinkDefinition, EDAEphemeralSinkDefinition, EDAProjectedDurableSinkDefinition, EDAProjectedSink, EDARawDurableSinkDefinition, EDARawSink, EDASink, EDASinkCheckpoint, EDASinkContext, EDASinkDurableBatch, EDASinkInterests, EDASinkRawDurableBatch, EDASinkRegistry, EDASinkRegistryShape, EDASinkRunnerStartInput };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { n as EDASinkRegistry, t as EDASink } from "../sink-registry-
|
|
1
|
+
import { n as EDASinkRegistry, t as EDASink } from "../sink-registry-CjdKeTUM.js";
|
|
2
2
|
export { EDASink, EDASinkRegistry };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { cn as EDAToolExecutionContext, dn as ToolParamsSchema, fn as ToolRecovery, gn as toolRecoveryPolicy, hn as maxToolCallAttempts, ln as EDAToolRegistry, mn as makeEDAToolkit, pn as ToolRecoveryPolicy, sn as EDAModelToolkit, un as EDAToolRegistryShape } from "../reduced-state-
|
|
1
|
+
import { cn as EDAToolExecutionContext, dn as ToolParamsSchema, fn as ToolRecovery, gn as toolRecoveryPolicy, hn as maxToolCallAttempts, ln as EDAToolRegistry, mn as makeEDAToolkit, pn as ToolRecoveryPolicy, sn as EDAModelToolkit, un as EDAToolRegistryShape } from "../reduced-state-DNfEwxu7.js";
|
|
2
2
|
export { EDAModelToolkit, EDAToolExecutionContext, EDAToolRegistry, EDAToolRegistryShape, ToolParamsSchema, ToolRecovery, ToolRecoveryPolicy, makeEDAToolkit, maxToolCallAttempts, toolRecoveryPolicy };
|
|
@@ -13,7 +13,6 @@ import * as Brand from "effect/Brand";
|
|
|
13
13
|
*/
|
|
14
14
|
var SessionCommandAdmissionConflict = class extends Schema.TaggedError()("SessionCommandAdmissionConflict", {
|
|
15
15
|
code: Schema.Literals([
|
|
16
|
-
"queue_paused",
|
|
17
16
|
"paused_queue_changed",
|
|
18
17
|
"event_too_large",
|
|
19
18
|
"framework_event",
|
|
@@ -135,4 +134,4 @@ const appEventConflict = (refusal) => new SessionCommandAdmissionConflict({
|
|
|
135
134
|
//#endregion
|
|
136
135
|
export { jsonBytes as a, eventSchemaNamespaces as i, SessionCommandAdmissionConflict as n, makeAppEventAdmission as o, appEventConflict as r, storedJsonForm as s, RegisteredAppEvents as t };
|
|
137
136
|
|
|
138
|
-
//# sourceMappingURL=session-admission-
|
|
137
|
+
//# sourceMappingURL=session-admission-DC98zwtj.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"session-admission-DC98zwtj.js","names":[],"sources":["../src/services/session-admission.ts"],"sourcesContent":["import * as Brand from \"effect/Brand\";\nimport * as Context from \"effect/Context\";\nimport * as Result from \"effect/Result\";\nimport * as Schema from \"effect/Schema\";\nimport type * as SchemaAST from \"effect/SchemaAST\";\n\nimport { MessageId } from \"../types/core\";\nimport {\n type DurableEventEnvelope,\n effectDurableAgentNamespace,\n maxAppEventBytes,\n} from \"../types/events/envelope\";\nimport { decodeDurableEventSync } from \"../types/events/durable\";\nimport { decodeRetainingExcess } from \"../types/events/internal\";\n\n/**\n * Admission rules every app-written durable event passes before it reaches the store, shared by\n * `submit`, decider drafts, tool `emitDurable` and sink `stageDurable`. A refusal here is not a\n * store error, so it never makes the live runtime fatal. Internal: not an exported subpath.\n */\n\nexport class SessionCommandAdmissionConflict extends Schema.TaggedError<SessionCommandAdmissionConflict>()(\n \"SessionCommandAdmissionConflict\",\n {\n code: Schema.Literals([\n \"paused_queue_changed\",\n \"event_too_large\",\n \"framework_event\",\n \"invalid_event\",\n \"payload_not_json\",\n ]),\n message: Schema.String,\n pausedMessageIds: Schema.Array(MessageId),\n },\n) {}\n\n/** Why an app event is refused. */\nexport interface AppEventRefusal {\n readonly code: \"event_too_large\" | \"framework_event\" | \"invalid_event\" | \"payload_not_json\";\n readonly message: string;\n}\n\n/**\n * Framework event types app code may still write through `submit`, decider drafts, `emitDurable`\n * and `stageDurable`: a session seed (`SessionConfigured`, `SystemMessageCommitted`) and imported\n * history. Every other `effect-durable-agent` event is the framework's alone; a forged\n * `DeciderAccepted` would make a later decision replay a result nobody decided.\n */\nexport const appWritableFrameworkEventTypes: ReadonlySet<string> = new Set([\n \"SessionConfigured\",\n \"SystemMessageCommitted\",\n \"AssistantMessageImported\",\n]);\n\n/** App event schemas are a union of structs with literal namespaces; throw for any other shape. */\nexport const eventSchemaNamespaces = (ast: SchemaAST.AST): ReadonlyArray<string> => {\n if (ast._tag === \"Union\") return ast.types.flatMap(eventSchemaNamespaces);\n if (ast._tag === \"Objects\") {\n const namespace = ast.propertySignatures.find((field) => field.name === \"namespace\")?.type;\n if (namespace?._tag === \"Literal\" && typeof namespace.literal === \"string\")\n return [namespace.literal];\n }\n throw new Error(\"App event schemas must be a union of structs with literal namespaces\");\n};\n\n/**\n * The JSON form the store keeps, `JSON.parse(JSON.stringify(value))`, or why `value` has none.\n * The round trip may only drop an object property whose value is `undefined`; anything else it\n * would change is refused rather than silently rewritten: anything with a prototype (`Redacted`,\n * `Option`, `Date`, a class instance), `undefined` in an array, a non-finite number, a bigint, a\n * function, a symbol or a cycle. Every check that must hold for what is stored runs on this form.\n */\nexport const storedJsonForm = (\n value: unknown,\n path: string,\n): Result.Result<Schema.Json, string> => {\n const violation = jsonNativeAt(value, path, new Set());\n if (violation !== undefined) return Result.fail(violation);\n const json: Schema.Json = JSON.parse(JSON.stringify(value));\n return Result.succeed(json);\n};\n\nconst jsonNativeAt = (value: unknown, path: string, seen: Set<object>): string | undefined => {\n if (value === null || typeof value === \"string\" || typeof value === \"boolean\") return undefined;\n if (typeof value === \"number\") {\n return Number.isFinite(value) ? undefined : `${path} is the non-finite number ${value}`;\n }\n if (typeof value !== \"object\") return `${path} is a ${typeof value}`;\n if (seen.has(value)) return `${path} is a cycle`;\n seen.add(value);\n try {\n if (Array.isArray(value)) {\n for (let index = 0; index < value.length; index += 1) {\n if (!(index in value) || value[index] === undefined) {\n return `${path}[${index}] is undefined`;\n }\n const violation = jsonNativeAt(value[index], `${path}[${index}]`, seen);\n if (violation !== undefined) return violation;\n }\n return undefined;\n }\n const prototype: unknown = Object.getPrototypeOf(value);\n if (prototype !== Object.prototype && prototype !== null) {\n const name =\n typeof prototype === \"object\" &&\n prototype !== null &&\n \"constructor\" in prototype &&\n typeof prototype.constructor === \"function\"\n ? prototype.constructor.name\n : \"unknown\";\n return `${path} is not a plain object (prototype ${name || \"anonymous\"})`;\n }\n if (Object.getOwnPropertySymbols(value).length > 0) return `${path} has symbol keys`;\n for (const [key, entry] of Object.entries(value)) {\n if (entry === undefined) continue;\n const violation = jsonNativeAt(entry, `${path}.${key}`, seen);\n if (violation !== undefined) return violation;\n }\n return undefined;\n } finally {\n seen.delete(value);\n }\n};\n\nconst jsonEncoder = new TextEncoder();\n\n/** UTF-8 size of a JSON-native value's JSON text. */\nexport const jsonBytes = (value: unknown): number => {\n const json: string | undefined = JSON.stringify(value);\n return json === undefined ? 0 : jsonEncoder.encode(json).byteLength;\n};\n\n/** The registered application event union, if the runtime has one. */\nexport type AppEventCodec = Schema.Codec<DurableEventEnvelope, unknown, never, never>;\n\n/** The runtime's registered `appEvents` union; absent for a framework-only runtime. */\nexport const RegisteredAppEvents = Context.Reference<AppEventCodec | undefined>(\n \"effect-durable-agent/RegisteredAppEvents\",\n { defaultValue: () => undefined },\n);\n\n/**\n * An app-written durable event that passed admission. Its payload is already the JSON form the\n * store keeps, so what is appended is exactly what was checked. Only `admit` makes one.\n */\nexport type AdmittedAppEvent = DurableEventEnvelope & Brand.Brand<\"AdmittedAppEvent\">;\nconst AdmittedAppEvent = Brand.nominal<AdmittedAppEvent>();\n\n/** Admits app-written durable events under the runtime's rules. */\nexport interface AppEventAdmission {\n /**\n * The event to append in place of `event`, or why it is refused. The payload is replaced by its\n * stored JSON form first; the size, framework-schema and `appEvents` checks all read that form.\n */\n readonly admit: (event: DurableEventEnvelope) => Result.Result<AdmittedAppEvent, AppEventRefusal>;\n}\n\n/** Build the checker for a runtime, with its registered `appEvents` codec if any. */\nexport const makeAppEventAdmission = (appEvents: AppEventCodec | undefined): AppEventAdmission => {\n const namespaces = new Set(appEvents === undefined ? [] : eventSchemaNamespaces(appEvents.ast));\n const decode = appEvents === undefined ? undefined : decodeRetainingExcess(appEvents);\n const describe = (event: DurableEventEnvelope) =>\n `Event ${event.namespace}/${event.type} ${event.eventId}`;\n const refuse = (code: AppEventRefusal[\"code\"], message: string) =>\n Result.fail<AppEventRefusal>({ code, message });\n return {\n admit: (event) => {\n const isFramework = event.namespace === effectDurableAgentNamespace;\n if (isFramework && !appWritableFrameworkEventTypes.has(event.type)) {\n return refuse(\n \"framework_event\",\n `${describe(event)} is a framework lifecycle event; app code may write only ${Array.from(appWritableFrameworkEventTypes).join(\", \")}`,\n );\n }\n const payload = storedJsonForm(event.payload, \"payload\");\n if (Result.isFailure(payload)) {\n return refuse(\n \"payload_not_json\",\n `${describe(event)} payload is not JSON-native: ${payload.failure}. Encode it before writing; the store keeps JSON only.`,\n );\n }\n const stored = { ...event, payload: payload.success };\n const bytes = jsonBytes(stored.payload);\n if (bytes > maxAppEventBytes) {\n return refuse(\n \"event_too_large\",\n `${describe(event)} payload is ${bytes} bytes; the limit is ${maxAppEventBytes} bytes`,\n );\n }\n try {\n // The store decodes framework events with their own schema and would fail a malformed one\n // as a store error, so an allowlisted type is checked against that schema here.\n if (isFramework) decodeDurableEventSync(stored);\n } catch (cause) {\n return refuse(\n \"invalid_event\",\n `${describe(event)} does not match its framework event schema once stored as JSON: ${String(cause)}`,\n );\n }\n try {\n if (decode !== undefined && namespaces.has(event.namespace)) decode(stored);\n } catch (cause) {\n return refuse(\n \"invalid_event\",\n `${describe(event)} does not match the registered appEvents schema once stored as JSON: ${String(cause)}`,\n );\n }\n return Result.succeed(AdmittedAppEvent(stored));\n },\n };\n};\n\n/** The admission conflict a refused `submit` item fails with. */\nexport const appEventConflict = (refusal: AppEventRefusal): SessionCommandAdmissionConflict =>\n new SessionCommandAdmissionConflict({\n code: refusal.code,\n message: refusal.message,\n pausedMessageIds: [],\n });\n"],"mappings":"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"}
|
|
@@ -10,7 +10,7 @@ import { H as DeciderAcceptedEvent, Jt as ToolCallCreatedEvent, Kn as deciderAcc
|
|
|
10
10
|
import { n as assertNeverError, t as assertNever } from "./assert-never-CoyUpoRB.js";
|
|
11
11
|
import { activeTurnIdentityForCommand, classifyRecoverableWork, decodeReducedStateCheckpoint, encodeReducedStateCheckpoint, foldReducedState, frameworkReducedStateReducerName, initialReducedState, reducedStateCheckpointEventSeqs } from "./domain/reduced-state.js";
|
|
12
12
|
import { ContextProjection, emptyContextProjection } from "./domain/context-projection.js";
|
|
13
|
-
import { a as jsonBytes, n as SessionCommandAdmissionConflict, o as makeAppEventAdmission, r as appEventConflict, t as RegisteredAppEvents } from "./session-admission-
|
|
13
|
+
import { a as jsonBytes, n as SessionCommandAdmissionConflict, o as makeAppEventAdmission, r as appEventConflict, t as RegisteredAppEvents } from "./session-admission-DC98zwtj.js";
|
|
14
14
|
import { CommittedDurableEvent, EDASessionStore, EDASessionStoreError, hasEDASessionStoreError, queryCommittedEvents } from "./services/session-store.js";
|
|
15
15
|
import { o as CompactionRunner, p as makeUsagePayload } from "./compaction-Dlq4wgZE.js";
|
|
16
16
|
import { EDAPromptProjector, buildEDAPrompt } from "./services/prompt-projector.js";
|
|
@@ -21,7 +21,7 @@ import { annotateEdaSpan, committedBatchAttributes, currentOrRootEDAEventTrace,
|
|
|
21
21
|
import { EDAKeepAlive } from "./services/keep-alive.js";
|
|
22
22
|
import { SessionEventObserver } from "./services/session-event-observer.js";
|
|
23
23
|
import { EDAReducerRegistry, decodeReducerState, encodeReducerState, reducerSchemaVersion } from "./services/reducer-registry.js";
|
|
24
|
-
import { n as EDASinkRegistry } from "./sink-registry-
|
|
24
|
+
import { n as EDASinkRegistry } from "./sink-registry-CjdKeTUM.js";
|
|
25
25
|
import { EDADeciderError, EDADeciderRegistry, deciderIdempotencyKeyViolation, deciderMarkerDedupeKey, encodeDeciderJson, maxDeciderResultBytes } from "./services/decider.js";
|
|
26
26
|
import * as Context from "effect/Context";
|
|
27
27
|
import * as Effect from "effect/Effect";
|
|
@@ -285,9 +285,9 @@ var LiveEventBus = class LiveEventBus extends Context.Service()("@effect-durable
|
|
|
285
285
|
static Noop = LiveEventBus.Live.pipe(Layer.provide(SessionEventObserver.Noop));
|
|
286
286
|
};
|
|
287
287
|
const makeLiveBus = (pubsub, activeTurnReplay, observer) => ({
|
|
288
|
-
publish: (event) => Effect.gen(function* () {
|
|
288
|
+
publish: (event, state) => Effect.gen(function* () {
|
|
289
289
|
yield* updateActiveTurnReplay(activeTurnReplay, event);
|
|
290
|
-
yield* observer.onEvent(event);
|
|
290
|
+
yield* observer.onEvent(event, state);
|
|
291
291
|
return yield* PubSub.publish(pubsub, event);
|
|
292
292
|
}),
|
|
293
293
|
subscribeQueue: () => PubSub.subscribe(pubsub),
|
|
@@ -1741,7 +1741,7 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
1741
1741
|
for (const entry of fresh) yield* liveBus.publish(PositionedEvent.make({
|
|
1742
1742
|
position: entry.position,
|
|
1743
1743
|
event: durableEventEnvelope(entry.event)
|
|
1744
|
-
}));
|
|
1744
|
+
}), nextReduced);
|
|
1745
1745
|
return { head: nextReduced.lastSeq };
|
|
1746
1746
|
});
|
|
1747
1747
|
const snapshot = () => Ref.get(state).pipe(Effect.map((state) => state.reduced));
|
|
@@ -1798,7 +1798,7 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
1798
1798
|
lastSubSeq: nextSubSeq
|
|
1799
1799
|
}
|
|
1800
1800
|
});
|
|
1801
|
-
yield* liveBus.publish(positioned);
|
|
1801
|
+
yield* liveBus.publish(positioned, current.reduced);
|
|
1802
1802
|
yield* sinkRegistry.publishEphemeralToSinks(positioned);
|
|
1803
1803
|
return positioned;
|
|
1804
1804
|
}));
|
|
@@ -1834,18 +1834,7 @@ const makeLiveSessionState = Effect.gen(function* () {
|
|
|
1834
1834
|
const current = yield* Ref.get(state);
|
|
1835
1835
|
const pausedMessageIds = current.reduced.commandQueues.pausedQueue.map((message) => message.messageId);
|
|
1836
1836
|
const requestedClear = admitted.expectedPausedMessageIdsToCancel;
|
|
1837
|
-
if (
|
|
1838
|
-
if (requestedClear === void 0) return yield* new SessionCommandAdmissionConflict({
|
|
1839
|
-
code: "queue_paused",
|
|
1840
|
-
message: "Queue paused because you interrupted",
|
|
1841
|
-
pausedMessageIds
|
|
1842
|
-
});
|
|
1843
|
-
if (!sameMessageIdSet(requestedClear, pausedMessageIds)) return yield* new SessionCommandAdmissionConflict({
|
|
1844
|
-
code: "paused_queue_changed",
|
|
1845
|
-
message: "Paused queue changed; confirm the current messages before clearing",
|
|
1846
|
-
pausedMessageIds
|
|
1847
|
-
});
|
|
1848
|
-
} else if (requestedClear !== void 0 && !sameMessageIdSet(requestedClear, pausedMessageIds)) return yield* new SessionCommandAdmissionConflict({
|
|
1837
|
+
if (requestedClear !== void 0 && !sameMessageIdSet(requestedClear, pausedMessageIds)) return yield* new SessionCommandAdmissionConflict({
|
|
1849
1838
|
code: "paused_queue_changed",
|
|
1850
1839
|
message: "Paused queue changed; confirm the current messages before clearing",
|
|
1851
1840
|
pausedMessageIds
|
|
@@ -3523,4 +3512,4 @@ const isSessionNoRunnableCommand = (result) => "_tag" in result && result._tag =
|
|
|
3523
3512
|
//#endregion
|
|
3524
3513
|
export { SessionForkedCommand as a, SessionRunInput as c, InferenceRunner as d, ToolExecutor as f, SessionCommandOutcome as i, SessionState as l, SessionCommandCompleted as n, SessionNoRunnableCommand as o, LiveEventBus as p, SessionCommandFailed as r, SessionNoRunnableReason as s, SessionCommandCancelled as t, TurnRunner as u };
|
|
3525
3514
|
|
|
3526
|
-
//# sourceMappingURL=session-state-
|
|
3515
|
+
//# sourceMappingURL=session-state-urBjAvsy.js.map
|