effect-durable-agent 0.1.0-alpha.12 → 0.1.0-alpha.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (52) hide show
  1. package/dist/{command-queues-B45Xa1Dl.d.ts → command-queues-CSEl1yrH.d.ts} +2 -2
  2. package/dist/{compaction-CLCDOR1t.d.ts → compaction-CYItD6di.d.ts} +5 -5
  3. package/dist/{context-projection-CCoN8m9W.d.ts → context-projection-C43pyxn2.d.ts} +4 -4
  4. package/dist/domain/command-queues.d.ts +1 -1
  5. package/dist/domain/context-projection.d.ts +1 -1
  6. package/dist/domain/message-transcript.d.ts +1 -1
  7. package/dist/domain/reduced-state.d.ts +1 -1
  8. package/dist/domain/run-scheduling.d.ts +1 -1
  9. package/dist/index.d.ts +1 -1
  10. package/dist/{message-transcript-Dr6Rk-re.d.ts → message-transcript-CmCHC1Pg.d.ts} +3 -3
  11. package/dist/{prompt-projector-CGo1TGyZ.d.ts → prompt-projector-_Zxe7dlE.d.ts} +4 -4
  12. package/dist/{reducer-registry-DqljrD58.d.ts → reducer-registry-BgtK0NuX.d.ts} +2 -2
  13. package/dist/{run-scheduler-DvHWwWBJ.d.ts → run-scheduler-BBqZ0Ate.d.ts} +2 -2
  14. package/dist/{run-scheduling-wakeup-CGgJ7RNe.d.ts → run-scheduling-wakeup-DRYZztL6.d.ts} +2 -2
  15. package/dist/{runtime-j93ZOBnG.d.ts → runtime-BRURBOyt.d.ts} +4 -4
  16. package/dist/services/compaction.d.ts +1 -1
  17. package/dist/services/prompt-projector.d.ts +1 -1
  18. package/dist/services/reducer-registry.d.ts +1 -1
  19. package/dist/services/run-scheduler.d.ts +2 -2
  20. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  21. package/dist/services/runtime-layer.d.ts +11 -11
  22. package/dist/services/runtime-layer.js +2 -2
  23. package/dist/services/runtime.d.ts +1 -1
  24. package/dist/services/runtime.js +1 -1
  25. package/dist/services/session-query.d.ts +1 -1
  26. package/dist/services/session-query.js +2 -2
  27. package/dist/services/session-state.d.ts +1 -1
  28. package/dist/services/session-state.js +1 -1
  29. package/dist/services/session-store.d.ts +1 -1
  30. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  31. package/dist/services/sink-registry.d.ts +1 -1
  32. package/dist/services/sink-registry.js +1 -1
  33. package/dist/services/span-names.d.ts +1 -1
  34. package/dist/services/span-names.js +2 -0
  35. package/dist/services/span-names.js.map +1 -1
  36. package/dist/services/tool-registry.d.ts +1 -1
  37. package/dist/services/tracing.js +1 -1
  38. package/dist/services/tracing.js.map +1 -1
  39. package/dist/{session-query-DYuJXhMQ.d.ts → session-query-Dzdcr2xL.d.ts} +7 -7
  40. package/dist/{session-state-13z-3YaF.d.ts → session-state-Cm5sXbZW.d.ts} +14 -14
  41. package/dist/{session-state-xXXyniwU.js → session-state-DfYX21mA.js} +19 -4
  42. package/dist/session-state-DfYX21mA.js.map +1 -0
  43. package/dist/{session-store-BIr-xfJ7.d.ts → session-store-DCs--1kc.d.ts} +2 -2
  44. package/dist/{sink-checkpoint-store-Cr9_GmOw.d.ts → sink-checkpoint-store-CasqHvDz.d.ts} +2 -2
  45. package/dist/{sink-registry-CUIrrkXU.js → sink-registry-CT3C3N5R.js} +28 -12
  46. package/dist/{sink-registry-CUIrrkXU.js.map → sink-registry-CT3C3N5R.js.map} +1 -1
  47. package/dist/{sink-registry-C2t3DI_g.d.ts → sink-registry-CU-WMK96.d.ts} +6 -6
  48. package/dist/testkit/layers.d.ts +12 -12
  49. package/dist/testkit/layers.js +2 -2
  50. package/dist/{tool-registry-Dhs2KmYK.d.ts → tool-registry-CHMtDCJ5.d.ts} +2 -2
  51. package/package.json +1 -1
  52. package/dist/session-state-xXXyniwU.js.map +0 -1
@@ -1,19 +1,19 @@
1
- import { Q as RunGrantResult, S as ReducedState } from "./command-queues-B45Xa1Dl.js";
1
+ import { Q as RunGrantResult, S as ReducedState } from "./command-queues-CSEl1yrH.js";
2
2
  import { d as PositionedEvent, l as ModelSelectionPayload, n as EphemeralEventEnvelope, t as DurableEventEnvelope, u as NonNegativeInt } from "./envelope-DkZyMIgp.js";
3
3
  import { i as GrantRunCommand, r as EDACommand } from "./commands-p8venTWs.js";
4
4
  import { zt as ToolCallCreatedEvent } from "./durable-DeLCAvbw.js";
5
- import { a as EDASessionStore, o as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-BIr-xfJ7.js";
5
+ import { a as EDASessionStore, o as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-DCs--1kc.js";
6
6
  import { t as ModelResolver } from "./model-resolver-BPPJAsuh.js";
7
7
  import { t as IdGenerator } from "./id-generator--x6itQZ2.js";
8
8
  import { r as SessionContext, t as EventFactory } from "./event-factory-EL4szNWm.js";
9
9
  import { t as EDAKeepAlive } from "./keep-alive-Chl5SJxy.js";
10
- import { d as CompactionRunner } from "./compaction-CLCDOR1t.js";
11
- import { s as EDASinkRegistry, u as LiveEventBus } from "./sink-registry-C2t3DI_g.js";
12
- import { a as EDAReducerStateSnapshot, r as EDAReducerRegistry } from "./reducer-registry-DqljrD58.js";
13
- import { r as EDAPromptProjector } from "./prompt-projector-CGo1TGyZ.js";
14
- import { t as RunScheduler } from "./run-scheduler-DvHWwWBJ.js";
15
- import { t as RunSchedulingWakeup } from "./run-scheduling-wakeup-CGgJ7RNe.js";
16
- import { r as EDAToolRegistry } from "./tool-registry-Dhs2KmYK.js";
10
+ import { d as CompactionRunner } from "./compaction-CYItD6di.js";
11
+ import { s as EDASinkRegistry, u as LiveEventBus } from "./sink-registry-CU-WMK96.js";
12
+ import { a as EDAReducerStateSnapshot, r as EDAReducerRegistry } from "./reducer-registry-BgtK0NuX.js";
13
+ import { r as EDAPromptProjector } from "./prompt-projector-_Zxe7dlE.js";
14
+ import { t as RunScheduler } from "./run-scheduler-BBqZ0Ate.js";
15
+ import { t as RunSchedulingWakeup } from "./run-scheduling-wakeup-DRYZztL6.js";
16
+ import { r as EDAToolRegistry } from "./tool-registry-CHMtDCJ5.js";
17
17
  import * as Context from "effect/Context";
18
18
  import * as Effect from "effect/Effect";
19
19
  import * as Layer from "effect/Layer";
@@ -145,7 +145,7 @@ interface ToolExecutorShape {
145
145
  declare const ToolExecutor_base: Context.ServiceClass<ToolExecutor, "@effect-durable-agent/ToolExecutor", ToolExecutorShape>;
146
146
  /** Executes sealed framework-owned tool calls and commits tool lifecycle boundaries. */
147
147
  declare class ToolExecutor extends ToolExecutor_base {
148
- static readonly Live: Layer.Layer<ToolExecutor, never, EventFactory | IdGenerator | SessionContext | EDAToolRegistry>;
148
+ static readonly Live: Layer.Layer<ToolExecutor, never, EDAToolRegistry | IdGenerator | EventFactory | SessionContext>;
149
149
  }
150
150
  //#endregion
151
151
  //#region src/services/inference-runner.d.ts
@@ -293,7 +293,7 @@ interface InferenceRunnerShape {
293
293
  declare const InferenceRunner_base: Context.ServiceClass<InferenceRunner, "@effect-durable-agent/InferenceRunner", InferenceRunnerShape>;
294
294
  /** Owns provider inference streams and routes them into durable/live inference emissions. */
295
295
  declare class InferenceRunner extends InferenceRunner_base {
296
- static readonly Live: Layer.Layer<InferenceRunner, never, ModelResolver | EventFactory | IdGenerator | EDAToolRegistry>;
296
+ static readonly Live: Layer.Layer<InferenceRunner, never, ModelResolver | EDAToolRegistry | IdGenerator | EventFactory>;
297
297
  }
298
298
  //#endregion
299
299
  //#region src/services/turn-runner.d.ts
@@ -546,7 +546,7 @@ interface TurnRunnerShape {
546
546
  declare const TurnRunner_base: Context.ServiceClass<TurnRunner, "@effect-durable-agent/TurnRunner", TurnRunnerShape>;
547
547
  /** Owns one turn: turn boundaries, inferences, tool handoff, and terminal turn events. */
548
548
  declare class TurnRunner extends TurnRunner_base {
549
- static readonly Live: Layer.Layer<TurnRunner, never, EventFactory | IdGenerator | InferenceRunner | ToolExecutor>;
549
+ static readonly Live: Layer.Layer<TurnRunner, never, IdGenerator | EventFactory | InferenceRunner | ToolExecutor>;
550
550
  }
551
551
  //#endregion
552
552
  //#region src/services/session-state.d.ts
@@ -860,8 +860,8 @@ interface SessionStateShape extends SessionEventSink {
860
860
  declare const SessionState_base: Context.ServiceClass<SessionState, "@effect-durable-agent/SessionState", SessionStateShape>;
861
861
  /** Internal authoritative live state and root control loop for one session. */
862
862
  declare class SessionState extends SessionState_base {
863
- static readonly Live: Layer.Layer<SessionState, EDASessionStoreError, RunScheduler | RunSchedulingWakeup | EDASessionStore | LiveEventBus | EDAReducerRegistry | CompactionRunner | EventFactory | IdGenerator | EDAKeepAlive | TurnRunner | EDAPromptProjector | SessionContext | EDASinkRegistry>;
863
+ static readonly Live: Layer.Layer<SessionState, EDASessionStoreError, RunScheduler | EDAKeepAlive | RunSchedulingWakeup | EDAPromptProjector | EDAReducerRegistry | EDASessionStore | LiveEventBus | IdGenerator | EventFactory | TurnRunner | CompactionRunner | SessionContext | EDASinkRegistry>;
864
864
  }
865
865
  //#endregion
866
866
  export { ToolExecutor as S, SessionStateShape as _, SessionCommandCompleted as a, InferenceRunner as b, SessionCommandResult as c, SessionForkedCommand as d, SessionNoRunnableCommand as f, SessionStateError as g, SessionState as h, SessionCommandCancelled as i, SessionDrainProcessed as l, SessionRunInput as m, SessionCommandAdmissionConflict as n, SessionCommandFailed as o, SessionNoRunnableReason as p, SessionCommandAdmissionError as r, SessionCommandOutcome as s, EDASubmittable as t, SessionDrainResult as u, SessionStateSnapshotData as v, InferenceRunnerStreamPart as x, TurnRunner as y };
867
- //# sourceMappingURL=session-state-13z-3YaF.d.ts.map
867
+ //# sourceMappingURL=session-state-Cm5sXbZW.d.ts.map
@@ -15,7 +15,7 @@ import { IdGenerator } from "./services/id-generator.js";
15
15
  import { n as SessionContext, t as EventFactory } from "./event-factory-QuC_UvyP.js";
16
16
  import { annotateEdaSpan, committedBatchAttributes, edaTraceContextFromSpan, eventBatchAttributes, toEdaExternalSpan, usageAttributes } from "./services/tracing.js";
17
17
  import { EDAKeepAlive } from "./services/keep-alive.js";
18
- import { n as EDASinkRegistry, r as LiveEventBus } from "./sink-registry-CUIrrkXU.js";
18
+ import { n as EDASinkRegistry, r as LiveEventBus } from "./sink-registry-CT3C3N5R.js";
19
19
  import { EDAPromptProjector, buildEDAPrompt } from "./services/prompt-projector.js";
20
20
  import { EDAReducerRegistry, decodeReducerState, encodeReducerState, reducerSchemaVersion } from "./services/reducer-registry.js";
21
21
  import { EDAToolRegistry } from "./services/tool-registry.js";
@@ -1513,8 +1513,23 @@ const makeLiveSessionState = Effect.gen(function* () {
1513
1513
  const schedulingWakeup = yield* RunSchedulingWakeup;
1514
1514
  const reducerRegistry = yield* EDAReducerRegistry;
1515
1515
  const sinkRegistry = yield* EDASinkRegistry;
1516
- const hydrated = yield* hydrateFrameworkReducedState(store);
1517
- const hydratedReducerStates = yield* hydrateAppReducerStates(store, reducerRegistry.reducers);
1516
+ const { hydrated, hydratedReducerStates } = yield* Effect.gen(function* () {
1517
+ const hydrated = yield* hydrateFrameworkReducedState(store);
1518
+ const hydratedReducerStates = yield* hydrateAppReducerStates(store, reducerRegistry.reducers);
1519
+ yield* Effect.annotateCurrentSpan({
1520
+ "eda.seq.head": hydrated.state.lastSeq,
1521
+ "eda.checkpoint.framework_seq": hydrated.checkpointSeq,
1522
+ ...hydratedReducerStates.checkpointSeq === void 0 ? {} : { "eda.checkpoint.app_min_seq": hydratedReducerStates.checkpointSeq }
1523
+ });
1524
+ return {
1525
+ hydrated,
1526
+ hydratedReducerStates
1527
+ };
1528
+ }).pipe(Effect.withSpan("agent.session.hydrate", { attributes: {
1529
+ sessionId: sessionContext.sessionId,
1530
+ "eda.session.id": sessionContext.sessionId,
1531
+ "eda.reducers.count": reducerRegistry.reducers.length
1532
+ } }));
1518
1533
  yield* schedulingWakeup.setPending(hydrated.state.runSchedulingRequest !== void 0 && hydrated.state.runSchedulingRequest.deliveredSeq === void 0);
1519
1534
  const startupRecoveryCheckpointSeq = hydratedReducerStates.checkpointSeq === void 0 ? hydrated.checkpointSeq : SequenceNumber.make(Math.min(hydrated.checkpointSeq, hydratedReducerStates.checkpointSeq));
1520
1535
  const state = yield* Ref.make({
@@ -3094,4 +3109,4 @@ const isSessionNoRunnableCommand = (result) => "_tag" in result && result._tag =
3094
3109
  //#endregion
3095
3110
  export { SessionCommandOutcome as a, SessionNoRunnableReason as c, TurnRunner as d, InferenceRunner as f, SessionCommandFailed as i, SessionRunInput as l, SessionCommandCancelled as n, SessionForkedCommand as o, ToolExecutor as p, SessionCommandCompleted as r, SessionNoRunnableCommand as s, SessionCommandAdmissionConflict as t, SessionState as u };
3096
3111
 
3097
- //# sourceMappingURL=session-state-xXXyniwU.js.map
3112
+ //# sourceMappingURL=session-state-DfYX21mA.js.map