effect-durable-agent 0.1.0-alpha.17 → 0.1.0-alpha.19

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 (107) hide show
  1. package/dist/{commands-p8venTWs.d.ts → commands-3OD-p8dD.d.ts} +7 -8
  2. package/dist/{compaction-Db6eoLce.js → compaction-Bell28K8.js} +2 -4
  3. package/dist/{compaction-Db6eoLce.js.map → compaction-Bell28K8.js.map} +1 -1
  4. package/dist/{context-projection-n6Rdup0N.d.ts → context-projection-D_uRtK3r.d.ts} +13 -14
  5. package/dist/{core-C-6xHzRx.d.ts → core-BcimKMIv.d.ts} +1 -2
  6. package/dist/domain/command-queues.d.ts +81 -2
  7. package/dist/domain/command-queues.js.map +1 -1
  8. package/dist/domain/context-projection.d.ts +1 -1
  9. package/dist/domain/message-transcript.d.ts +1 -1
  10. package/dist/domain/message-transcript.js.map +1 -1
  11. package/dist/domain/model-usage.d.ts +1 -1
  12. package/dist/domain/reduced-state-schema.d.ts +3 -992
  13. package/dist/domain/reduced-state-schema.js +114 -2
  14. package/dist/domain/reduced-state-schema.js.map +1 -1
  15. package/dist/domain/reduced-state.d.ts +2 -2
  16. package/dist/domain/run-scheduling.d.ts +1 -1
  17. package/dist/domain/run-scheduling.js.map +1 -1
  18. package/dist/durable-DRY7AcsF.js.map +1 -1
  19. package/dist/{durable-Ceu9SC2D.d.ts → durable-DoG_e4iL.d.ts} +1486 -1487
  20. package/dist/envelope-BCzKUq_z.js.map +1 -1
  21. package/dist/{envelope-VXFEC8zr.d.ts → envelope-Che6KatU.d.ts} +29 -30
  22. package/dist/event-factory-CKuWhjS4.js.map +1 -1
  23. package/dist/{events-D3OAPXgS.d.ts → events-sxIzJY26.d.ts} +124 -122
  24. package/dist/{id-generator--x6itQZ2.d.ts → id-generator-BKGoKjt-.d.ts} +2 -3
  25. package/dist/index.d.ts +7 -7
  26. package/dist/index.js +2 -2
  27. package/dist/{keep-alive-Chl5SJxy.d.ts → keep-alive-_zFCUvt3.d.ts} +1 -2
  28. package/dist/{model-resolver-ci5D5WQv.d.ts → model-resolver-BHYVHsam.d.ts} +3 -3
  29. package/dist/{model-usage-CNcnhj72.d.ts → model-usage-0GeHwaaU.d.ts} +2 -3
  30. package/dist/reduced-state-DFIYylAq.js.map +1 -1
  31. package/dist/{index-DWC70Fsi.d.ts → reduced-state-DrSHn_47.d.ts} +12581 -9701
  32. package/dist/reduced-state-schema-CPEmuHLY.d.ts +2167 -0
  33. package/dist/{reducer-registry-nO4biZlg.d.ts → reducer-registry-C3ZidOI1.d.ts} +8 -7
  34. package/dist/{run-scheduling-wakeup-CXT5_CkI.d.ts → run-scheduling-wakeup-COUj3r_B.d.ts} +2 -3
  35. package/dist/services/compaction.d.ts +1 -1
  36. package/dist/services/compaction.js +1 -1
  37. package/dist/services/id-generator.d.ts +1 -1
  38. package/dist/services/id-generator.js +2 -1
  39. package/dist/services/id-generator.js.map +1 -1
  40. package/dist/services/keep-alive.d.ts +1 -1
  41. package/dist/services/keep-alive.js.map +1 -1
  42. package/dist/services/model-resolver.d.ts +1 -1
  43. package/dist/services/model-resolver.js.map +1 -1
  44. package/dist/services/prompt-projector.d.ts +1 -1
  45. package/dist/services/prompt-projector.js.map +1 -1
  46. package/dist/services/reducer-registry.d.ts +1 -1
  47. package/dist/services/reducer-registry.js.map +1 -1
  48. package/dist/services/run-scheduler.d.ts +1 -2
  49. package/dist/services/run-scheduler.js.map +1 -1
  50. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  51. package/dist/services/run-scheduling-wakeup.js.map +1 -1
  52. package/dist/services/runtime-layer.d.ts +11 -35
  53. package/dist/services/runtime-layer.js +3 -3
  54. package/dist/services/runtime-layer.js.map +1 -1
  55. package/dist/services/runtime.d.ts +1 -1
  56. package/dist/services/runtime.js +12 -3
  57. package/dist/services/runtime.js.map +1 -1
  58. package/dist/services/session-event-observer.d.ts +1 -1
  59. package/dist/services/session-event-observer.js.map +1 -1
  60. package/dist/services/session-query.d.ts +2 -2
  61. package/dist/services/session-query.js +24 -8
  62. package/dist/services/session-query.js.map +1 -1
  63. package/dist/services/session-state.d.ts +1 -1
  64. package/dist/services/session-state.js +1 -1
  65. package/dist/services/session-store.d.ts +1 -1
  66. package/dist/services/session-store.js +5 -3
  67. package/dist/services/session-store.js.map +1 -1
  68. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  69. package/dist/services/sink-checkpoint-store.js +2 -1
  70. package/dist/services/sink-checkpoint-store.js.map +1 -1
  71. package/dist/services/sink-registry.d.ts +1 -1
  72. package/dist/services/sink-registry.js +1 -1
  73. package/dist/services/tool-registry.d.ts +1 -1
  74. package/dist/services/tool-registry.js.map +1 -1
  75. package/dist/services/tracing.d.ts +3 -3
  76. package/dist/services/tracing.js.map +1 -1
  77. package/dist/{session-event-observer-BWppl2Fr.d.ts → session-event-observer-BDwja1jX.d.ts} +3 -3
  78. package/dist/{session-state-8PJZvuR3.js → session-state-BBzzJrDC.js} +78 -50
  79. package/dist/{session-state-8PJZvuR3.js.map → session-state-BBzzJrDC.js.map} +1 -1
  80. package/dist/{session-store-DBa-TOVH.d.ts → session-store-B_vh581h.d.ts} +9 -9
  81. package/dist/{sink-checkpoint-store-BZGfJLve.d.ts → sink-checkpoint-store-2SxoNMbI.d.ts} +3 -4
  82. package/dist/{sink-registry-B4yxTmlI.js → sink-registry-ogHu2Sw7.js} +2 -2
  83. package/dist/{sink-registry-B4yxTmlI.js.map → sink-registry-ogHu2Sw7.js.map} +1 -1
  84. package/dist/testkit/layers.d.ts +13 -18
  85. package/dist/testkit/layers.js +3 -3
  86. package/dist/testkit/layers.js.map +1 -1
  87. package/dist/{tool-registry-NOP9aTHT.d.ts → tool-registry-DDxbmMpY.d.ts} +5 -5
  88. package/dist/{tracing-BXHAkxkx.d.ts → tracing-BwjbF285.d.ts} +1 -2
  89. package/dist/types/commands.d.ts +1 -1
  90. package/dist/types/commands.js.map +1 -1
  91. package/dist/types/core.d.ts +1 -1
  92. package/dist/types/core.js.map +1 -1
  93. package/dist/types/events/durable.d.ts +1 -1
  94. package/dist/types/events.d.ts +4 -4
  95. package/dist/types/tracing.d.ts +1 -1
  96. package/dist/types/tracing.js.map +1 -1
  97. package/dist/websocket.d.ts +197 -187
  98. package/dist/websocket.js +4 -3
  99. package/dist/websocket.js.map +1 -1
  100. package/package.json +7 -7
  101. package/dist/command-queues-w9WUKTpM.d.ts +0 -556
  102. package/dist/compaction-DhIJ-sAH.d.ts +0 -165
  103. package/dist/event-factory-CHP1-DAF.d.ts +0 -91
  104. package/dist/message-transcript-BfuGCZhP.d.ts +0 -32
  105. package/dist/prompt-projector-DvNHsoEN.d.ts +0 -39
  106. package/dist/run-scheduler-DFBqIRzF.d.ts +0 -43
  107. package/dist/sink-registry-tpmJ-Dhf.d.ts +0 -148
@@ -1,165 +0,0 @@
1
- import { S as ReducedState } from "./command-queues-w9WUKTpM.js";
2
- import { i as ContextProjection, n as CompactionPolicyId, t as CompactionExecutorId } from "./context-projection-n6Rdup0N.js";
3
- import { r as DurableAppendEntry, s as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-DBa-TOVH.js";
4
- import { t as ModelResolver } from "./model-resolver-ci5D5WQv.js";
5
- import { t as IdGenerator } from "./id-generator--x6itQZ2.js";
6
- import { t as EventFactory } from "./event-factory-CHP1-DAF.js";
7
- import { t as EDAKeepAlive } from "./keep-alive-Chl5SJxy.js";
8
- import * as Context from "effect/Context";
9
- import * as Effect from "effect/Effect";
10
- import * as Layer from "effect/Layer";
11
- import * as Schema from "effect/Schema";
12
- import * as LanguageModel from "effect/unstable/ai/LanguageModel";
13
-
14
- //#region src/services/compaction.d.ts
15
- /** Candidate durable range and retained cursor selected by compaction policy. */
16
- declare const CompactionPlan: Schema.Struct<{
17
- readonly policyId: Schema.brand<Schema.NonEmptyString, "CompactionPolicyId">;
18
- readonly sourceFromSeq: Schema.brand<Schema.Int, "SequenceNumber">;
19
- readonly sourceToSeq: Schema.brand<Schema.Int, "SequenceNumber">;
20
- readonly retainedFromContextSeq: Schema.brand<Schema.Int, "SequenceNumber">;
21
- }>;
22
- type CompactionPlan = typeof CompactionPlan.Type;
23
- /** Rough token heuristic used by the built-in compaction presets. */
24
- declare const defaultCompactionCharsPerToken = 4;
25
- /** Production-oriented context threshold for the built-in approximate-token policy. */
26
- declare const defaultCompactionThresholdTokens = 220000;
27
- /** Recent model-facing tail retained verbatim by the built-in approximate-token policy. */
28
- declare const defaultCompactionRetainTailTokens = 40000;
29
- /** Minimum newly summarizable prefix needed before the approximate-token policy plans work. */
30
- declare const defaultCompactionMinSummarizableTokens = 10000;
31
- /** Approximate-token policy options for common production compaction. */
32
- interface ApproximateTokenThresholdCompactionPolicyOptions {
33
- /** Stable policy id stored on summary artifacts. */
34
- readonly policyId?: string;
35
- /** Context-size threshold that triggers compaction. Defaults to 220k tokens. */
36
- readonly thresholdTokens?: number;
37
- /** Recent tail retained verbatim after compaction. Defaults to 40k tokens. */
38
- readonly retainTailTokens?: number;
39
- /** Smallest prefix worth summarizing. Defaults to 10k tokens. */
40
- readonly minSummarizableTokens?: number;
41
- /** Character-to-token divisor for the approximate estimator. Defaults to 4. */
42
- readonly charsPerToken?: number;
43
- }
44
- /** LanguageModel-backed summary executor options. */
45
- interface LanguageModelSummaryCompactionExecutorOptions {
46
- /** Stable executor id stored on summary artifacts. */
47
- readonly executorId?: string;
48
- /** Prefix used for the synthetic prompt message inserted into future context. */
49
- readonly summaryMessagePrefix?: string;
50
- }
51
- /** Input visible to policy decisions. */
52
- interface CompactionPolicyInput {
53
- readonly state: ReducedState;
54
- readonly context: ContextProjection;
55
- }
56
- /** Result produced by the summary executor before the framework commits it. */
57
- declare const CompactionOutput: Schema.Struct<{
58
- readonly text: Schema.NonEmptyString;
59
- readonly promptMessage: Schema.Struct<{
60
- readonly role: Schema.Literal<"user">;
61
- readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
62
- readonly type: Schema.Literal<"text">;
63
- readonly text: Schema.String;
64
- readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
65
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
66
- }>>>, Schema.String, never, never>, Schema.$Array<Schema.Union<readonly [Schema.Struct<{
67
- readonly type: Schema.Literal<"text">;
68
- readonly text: Schema.String;
69
- readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
70
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
71
- }>, Schema.Struct<{
72
- readonly type: Schema.Literal<"file">;
73
- readonly mediaType: Schema.String;
74
- readonly fileName: Schema.optional<Schema.String>;
75
- readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
76
- readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
77
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
78
- }>]>>]>;
79
- readonly "~effect/ai/Prompt/Message": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Message">>;
80
- readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
81
- }>;
82
- readonly executorId: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CompactionExecutorId">>;
83
- readonly usage: Schema.optionalKey<Schema.Struct<{
84
- readonly inputTokens: Schema.optionalKey<Schema.Int>;
85
- readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
86
- readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
87
- readonly outputTokens: Schema.optionalKey<Schema.Int>;
88
- readonly textTokens: Schema.optionalKey<Schema.Int>;
89
- readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
90
- }>>;
91
- }>;
92
- type CompactionOutput = typeof CompactionOutput.Type;
93
- /** Executor input with framework-minted lifecycle identities. */
94
- interface CompactionExecutorInput extends CompactionPolicyInput {
95
- readonly plan: CompactionPlan;
96
- /** Provider service resolved from the same durable selection used for accounting. */
97
- readonly model: LanguageModel.Service;
98
- }
99
- declare const CompactionError_base: Schema.Class<CompactionError, Schema.TaggedStruct<"CompactionError", {
100
- readonly message: Schema.String;
101
- readonly usage: Schema.optionalKey<Schema.Struct<{
102
- readonly inputTokens: Schema.optionalKey<Schema.Int>;
103
- readonly cachedInputTokens: Schema.optionalKey<Schema.Int>;
104
- readonly cacheWriteInputTokens: Schema.optionalKey<Schema.Int>;
105
- readonly outputTokens: Schema.optionalKey<Schema.Int>;
106
- readonly textTokens: Schema.optionalKey<Schema.Int>;
107
- readonly reasoningTokens: Schema.optionalKey<Schema.Int>;
108
- }>>;
109
- }>, import("effect/Cause").YieldableError>;
110
- /** Typed failure from policy planning or summary generation. */
111
- declare class CompactionError extends CompactionError_base {}
112
- /** Service contract for deciding whether the current context should be compacted. */
113
- interface CompactionPolicyShape {
114
- readonly id: CompactionPolicyId;
115
- readonly plan: (input: CompactionPolicyInput) => Effect.Effect<CompactionPlan | undefined, CompactionError>;
116
- }
117
- declare const CompactionPolicy_base: Context.ServiceClass<CompactionPolicy, "@effect-durable-agent/CompactionPolicy", CompactionPolicyShape>;
118
- /** Decides whether a safe prompt-context rebase should be attempted. */
119
- declare class CompactionPolicy extends CompactionPolicy_base {
120
- /** Default policy: compaction is disabled and commits no skip events. */
121
- static readonly Disabled: Layer.Layer<CompactionPolicy, never, never>;
122
- /** Test/app hook for replacing the policy with a concrete planner. */
123
- static readonly FromFunction: (id: string, plan: CompactionPolicyShape["plan"]) => Layer.Layer<CompactionPolicy>;
124
- /**
125
- * Common production policy: compact when approximate prompt context exceeds a token threshold.
126
- *
127
- * The policy keeps a recent tail verbatim, summarizes the older prefix, and advances from the
128
- * current summary cursor so repeated compactions behave like the first one.
129
- */
130
- static readonly ApproximateTokenThreshold: (options?: ApproximateTokenThresholdCompactionPolicyOptions) => Layer.Layer<CompactionPolicy>;
131
- }
132
- /** Service contract for turning a selected compaction range into a summary artifact. */
133
- interface CompactionExecutorShape {
134
- readonly id: CompactionExecutorId;
135
- readonly execute: (input: CompactionExecutorInput) => Effect.Effect<CompactionOutput, CompactionError>;
136
- }
137
- declare const CompactionExecutor_base: Context.ServiceClass<CompactionExecutor, "@effect-durable-agent/CompactionExecutor", CompactionExecutorShape>;
138
- /** Produces a cumulative summary artifact for a selected compaction plan. */
139
- declare class CompactionExecutor extends CompactionExecutor_base {
140
- /** Placeholder executor for the disabled default policy. It should never be called. */
141
- static readonly Disabled: Layer.Layer<CompactionExecutor, never, never>;
142
- /** Test/app hook for replacing summary generation. */
143
- static readonly FromFunction: (id: string, execute: CompactionExecutorShape["execute"]) => Layer.Layer<CompactionExecutor>;
144
- /** Summary executor backed by the configured Effect AI LanguageModel. */
145
- static readonly LanguageModelSummary: (options?: LanguageModelSummaryCompactionExecutorOptions) => Layer.Layer<CompactionExecutor>;
146
- }
147
- /** Inputs needed by the framework-owned compaction lifecycle runner. */
148
- interface CompactionRunnerInput {
149
- readonly state: ReducedState;
150
- readonly context: ContextProjection;
151
- readonly appendDurableEntries: (entries: ReadonlyArray<DurableAppendEntry>) => Effect.Effect<ReadonlyArray<CommittedDurableEvent>, EDASessionStoreError>;
152
- }
153
- /** Runtime service that executes framework-owned compaction lifecycles. */
154
- interface CompactionRunnerShape {
155
- /** Evaluate policy and run one compaction if a plan is selected. */
156
- readonly maybeCompact: (input: CompactionRunnerInput) => Effect.Effect<ReadonlyArray<CommittedDurableEvent>, EDASessionStoreError>;
157
- }
158
- declare const CompactionRunner_base: Context.ServiceClass<CompactionRunner, "@effect-durable-agent/CompactionRunner", CompactionRunnerShape>;
159
- /** Framework-owned compaction lifecycle runner. */
160
- declare class CompactionRunner extends CompactionRunner_base {
161
- static readonly Live: Layer.Layer<CompactionRunner, never, ModelResolver | IdGenerator | EDAKeepAlive | CompactionPolicy | CompactionExecutor | EventFactory>;
162
- }
163
- //#endregion
164
- export { defaultCompactionRetainTailTokens as _, CompactionExecutorShape as a, CompactionPolicy as c, CompactionRunner as d, CompactionRunnerInput as f, defaultCompactionMinSummarizableTokens as g, defaultCompactionCharsPerToken as h, CompactionExecutorInput as i, CompactionPolicyInput as l, LanguageModelSummaryCompactionExecutorOptions as m, CompactionError as n, CompactionOutput as o, CompactionRunnerShape as p, CompactionExecutor as r, CompactionPlan as s, ApproximateTokenThresholdCompactionPolicyOptions as t, CompactionPolicyShape as u, defaultCompactionThresholdTokens as v };
165
- //# sourceMappingURL=compaction-DhIJ-sAH.d.ts.map
@@ -1,91 +0,0 @@
1
- import { g as SessionId } from "./core-C-6xHzRx.js";
2
- import { $t as ToolCallRejectedPayload, A as CompactionFailedEvent, B as ContextRebasedPayload, Bt as SummaryCreatedEvent, Cn as UserMessagePromotedEvent, Ct as RunSchedulingGrantedPayload, D as CommandStartedPayload, Dt as RunSchedulingRequestedPayload, E as CommandStartedEvent, En as UserMessageSubmittedPayload, Et as RunSchedulingRequestedEvent, F as CompactionStartedPayload, G as InferenceCompletedEvent, Gt as ToolCallCompletedPayload, Ht as SystemMessageCommittedEvent, It as StopTurnAppliedEvent, J as InferenceFailedEvent, K as InferenceCompletedPayload, Kt as ToolCallCreatedEvent, Lt as StopTurnAppliedPayload, M as CompactionRequestedEvent, Mt as SteeringMessageCancelledPayload, N as CompactionRequestedPayload, Nt as SteeringMessageQueuedEvent, O as CompactionCompletedEvent, Ot as RunStartedEvent, P as CompactionStartedEvent, Pt as SteeringMessageQueuedPayload, Qt as ToolCallRejectedEvent, Rt as StopTurnRequestedEvent, S as CommandCompletedPayload, St as RunSchedulingGrantedEvent, T as CommandFailedPayload, Tn as UserMessageSubmittedEvent, Tt as RunSchedulingInvalidatedPayload, Ut as SystemMessageCommittedPayload, Vt as SummaryCreatedPayload, Wt as ToolCallCompletedEvent, X as InferenceStartedEvent, Xt as ToolCallFailedPayload, Y as InferenceFailedPayload, Yt as ToolCallFailedEvent, Z as InferenceStartedPayload, _ as CommandAdmittedEvent, _t as RunInterruptedEvent, b as CommandCancelledPayload, bn as UserMessageCommittedEvent, bt as RunSchedulingDeliveredPayload, cn as TurnCompletedEvent, ct as RecoveryCompletedEvent, dn as TurnFailedEvent, fn as TurnFailedPayload, ft as RunCompletedEvent, gn as TurnStoppedPayload, gt as RunFailedPayload, hn as TurnStoppedEvent, ht as RunFailedEvent, j as CompactionFailedPayload, jt as SteeringMessageCancelledEvent, k as CompactionCompletedPayload, kt as RunStartedPayload, ln as TurnCompletedPayload, lt as RecoveryCompletedPayload, mn as TurnStartedPayload, n as AssistantMessageCommittedPayload, nn as ToolCallStartedEvent, o as AssistantPartialCommittedEvent, ot as PendingMessagesPausedEvent, pn as TurnStartedEvent, pt as RunCompletedPayload, qt as ToolCallCreatedPayload, rn as ToolCallStartedPayload, s as AssistantPartialCommittedPayload, st as PendingMessagesPausedPayload, t as AssistantMessageCommittedEvent, v as CommandAdmittedPayload, vn as UserMessageCancelledEvent, vt as RunInterruptedPayload, w as CommandFailedEvent, wn as UserMessagePromotedPayload, wt as RunSchedulingInvalidatedEvent, x as CommandCompletedEvent, xn as UserMessageCommittedPayload, y as CommandCancelledEvent, yn as UserMessageCancelledPayload, yt as RunSchedulingDeliveredEvent, z as ContextRebasedEvent, zt as StopTurnRequestedPayload } from "./durable-Ceu9SC2D.js";
3
- import { d as ToolParamsDeltaEvent, f as ToolParamsDeltaPayload, g as ToolParamsStartPayload, h as ToolParamsStartEvent, i as ReasoningDeltaPayload, l as TextDeltaEvent, m as ToolParamsEndPayload, p as ToolParamsEndEvent, r as ReasoningDeltaEvent, u as TextDeltaPayload } from "./events-D3OAPXgS.js";
4
- import { t as IdGenerator } from "./id-generator--x6itQZ2.js";
5
- import * as Context from "effect/Context";
6
- import * as Effect from "effect/Effect";
7
- import * as Layer from "effect/Layer";
8
-
9
- //#region src/services/session-context.d.ts
10
- /** Runtime-scoped session identity dependency. */
11
- interface SessionContextShape {
12
- /** The one session this runtime instance owns; fixed for the runtime lifetime. */
13
- readonly sessionId: SessionId;
14
- }
15
- declare const SessionContext_base: Context.ServiceClass<SessionContext, "@effect-durable-agent/SessionContext", SessionContextShape>;
16
- /**
17
- * Identity of the session a runtime instance is bound to. One runtime = one
18
- * session, so services read the session here instead of threading `sessionId`
19
- * through every input struct.
20
- */
21
- declare class SessionContext extends SessionContext_base {
22
- static readonly Live: (sessionId: SessionId) => Layer.Layer<SessionContext, never, never>;
23
- }
24
- //#endregion
25
- //#region src/services/event-factory.d.ts
26
- /** Central envelope factory that stamps session id, event id, and current clock time. */
27
- interface EventFactoryShape {
28
- readonly commandAdmitted: (payload: CommandAdmittedPayload) => Effect.Effect<CommandAdmittedEvent>;
29
- readonly commandStarted: (payload: CommandStartedPayload) => Effect.Effect<CommandStartedEvent>;
30
- readonly commandCompleted: (payload: CommandCompletedPayload) => Effect.Effect<CommandCompletedEvent>;
31
- readonly commandFailed: (payload: CommandFailedPayload) => Effect.Effect<CommandFailedEvent>;
32
- readonly commandCancelled: (payload: CommandCancelledPayload) => Effect.Effect<CommandCancelledEvent>;
33
- readonly systemMessageCommitted: (payload: SystemMessageCommittedPayload) => Effect.Effect<SystemMessageCommittedEvent>;
34
- readonly userMessageCommitted: (payload: UserMessageCommittedPayload) => Effect.Effect<UserMessageCommittedEvent>;
35
- readonly userMessageSubmitted: (payload: UserMessageSubmittedPayload) => Effect.Effect<UserMessageSubmittedEvent>;
36
- readonly userMessagePromoted: (payload: UserMessagePromotedPayload) => Effect.Effect<UserMessagePromotedEvent>;
37
- readonly userMessageCancelled: (payload: UserMessageCancelledPayload) => Effect.Effect<UserMessageCancelledEvent>;
38
- readonly pendingMessagesPaused: (payload: PendingMessagesPausedPayload) => Effect.Effect<PendingMessagesPausedEvent>;
39
- readonly steeringMessageQueued: (payload: SteeringMessageQueuedPayload) => Effect.Effect<SteeringMessageQueuedEvent>;
40
- readonly steeringMessageCancelled: (payload: SteeringMessageCancelledPayload) => Effect.Effect<SteeringMessageCancelledEvent>;
41
- readonly assistantMessageCommitted: (payload: AssistantMessageCommittedPayload) => Effect.Effect<AssistantMessageCommittedEvent>;
42
- readonly assistantPartialCommitted: (payload: AssistantPartialCommittedPayload) => Effect.Effect<AssistantPartialCommittedEvent>;
43
- readonly runSchedulingRequested: (payload: RunSchedulingRequestedPayload) => Effect.Effect<RunSchedulingRequestedEvent>;
44
- readonly runSchedulingDelivered: (payload: RunSchedulingDeliveredPayload) => Effect.Effect<RunSchedulingDeliveredEvent>;
45
- readonly runSchedulingInvalidated: (payload: RunSchedulingInvalidatedPayload) => Effect.Effect<RunSchedulingInvalidatedEvent>;
46
- readonly runSchedulingGranted: (payload: RunSchedulingGrantedPayload) => Effect.Effect<RunSchedulingGrantedEvent>;
47
- readonly runStarted: (payload: RunStartedPayload) => Effect.Effect<RunStartedEvent>;
48
- readonly runCompleted: (payload: RunCompletedPayload) => Effect.Effect<RunCompletedEvent>;
49
- readonly runFailed: (payload: RunFailedPayload) => Effect.Effect<RunFailedEvent>;
50
- readonly recoveryCompleted: (payload: RecoveryCompletedPayload) => Effect.Effect<RecoveryCompletedEvent>;
51
- /** @deprecated Emit `runFailed` with `error.code = "run.interrupted"`. Retained for legacy event construction only. */
52
- readonly runInterrupted: (payload: RunInterruptedPayload) => Effect.Effect<RunInterruptedEvent>;
53
- readonly turnStarted: (payload: TurnStartedPayload) => Effect.Effect<TurnStartedEvent>;
54
- readonly turnCompleted: (payload: TurnCompletedPayload) => Effect.Effect<TurnCompletedEvent>;
55
- readonly turnFailed: (payload: TurnFailedPayload) => Effect.Effect<TurnFailedEvent>;
56
- /** @deprecated Emit `turnFailed` with `error.code = "turn.interrupted"`. Retained for legacy event construction only. */
57
- readonly turnStopped: (payload: TurnStoppedPayload) => Effect.Effect<TurnStoppedEvent>;
58
- readonly inferenceStarted: (payload: InferenceStartedPayload) => Effect.Effect<InferenceStartedEvent>;
59
- readonly inferenceCompleted: (payload: InferenceCompletedPayload) => Effect.Effect<InferenceCompletedEvent>;
60
- readonly inferenceFailed: (payload: InferenceFailedPayload) => Effect.Effect<InferenceFailedEvent>;
61
- readonly toolCallCreated: (payload: ToolCallCreatedPayload) => Effect.Effect<ToolCallCreatedEvent>;
62
- readonly toolCallRejected: (payload: ToolCallRejectedPayload) => Effect.Effect<ToolCallRejectedEvent>;
63
- readonly toolCallStarted: (payload: ToolCallStartedPayload) => Effect.Effect<ToolCallStartedEvent>;
64
- readonly toolCallCompleted: (payload: ToolCallCompletedPayload) => Effect.Effect<ToolCallCompletedEvent>;
65
- readonly toolCallFailed: (payload: ToolCallFailedPayload) => Effect.Effect<ToolCallFailedEvent>;
66
- readonly stopTurnRequested: (payload: StopTurnRequestedPayload) => Effect.Effect<StopTurnRequestedEvent>;
67
- readonly stopTurnApplied: (payload: StopTurnAppliedPayload) => Effect.Effect<StopTurnAppliedEvent>;
68
- readonly compactionRequested: (payload: CompactionRequestedPayload) => Effect.Effect<CompactionRequestedEvent>;
69
- readonly compactionStarted: (payload: CompactionStartedPayload) => Effect.Effect<CompactionStartedEvent>;
70
- readonly summaryCreated: (payload: SummaryCreatedPayload) => Effect.Effect<SummaryCreatedEvent>;
71
- readonly contextRebased: (payload: ContextRebasedPayload) => Effect.Effect<ContextRebasedEvent>;
72
- readonly compactionCompleted: (payload: CompactionCompletedPayload) => Effect.Effect<CompactionCompletedEvent>;
73
- readonly compactionFailed: (payload: CompactionFailedPayload) => Effect.Effect<CompactionFailedEvent>;
74
- readonly textDelta: (payload: TextDeltaPayload) => Effect.Effect<TextDeltaEvent>;
75
- readonly reasoningDelta: (payload: ReasoningDeltaPayload) => Effect.Effect<ReasoningDeltaEvent>;
76
- readonly toolParamsStart: (payload: ToolParamsStartPayload) => Effect.Effect<ToolParamsStartEvent>;
77
- readonly toolParamsDelta: (payload: ToolParamsDeltaPayload) => Effect.Effect<ToolParamsDeltaEvent>;
78
- readonly toolParamsEnd: (payload: ToolParamsEndPayload) => Effect.Effect<ToolParamsEndEvent>;
79
- }
80
- declare const EventFactory_base: Context.ServiceClass<EventFactory, "@effect-durable-agent/EventFactory", EventFactoryShape>;
81
- /**
82
- * The one construction path for built-in event envelopes. It closes over the
83
- * session identity, mints `eventId`s, and stamps `createdAtMs` from the
84
- * ambient `Clock`, so lifecycle code provides only the payload.
85
- */
86
- declare class EventFactory extends EventFactory_base {
87
- static readonly Live: Layer.Layer<EventFactory, never, IdGenerator | SessionContext>;
88
- }
89
- //#endregion
90
- export { EventFactoryShape as n, SessionContext as r, EventFactory as t };
91
- //# sourceMappingURL=event-factory-CHP1-DAF.d.ts.map
@@ -1,32 +0,0 @@
1
- import { S as ReducedState, v as MessageRecord } from "./command-queues-w9WUKTpM.js";
2
- import { d as UserMessageContent } from "./commands-p8venTWs.js";
3
- import { i as ContextProjection } from "./context-projection-n6Rdup0N.js";
4
- import * as Prompt from "effect/unstable/ai/Prompt";
5
-
6
- //#region src/domain/message-transcript.d.ts
7
- /** Durable user/assistant message records suitable for a session transcript. */
8
- type DurableTranscriptMessage = Extract<MessageRecord, {
9
- readonly _tag: "User" | "Assistant" | "AssistantPartial";
10
- }> | (Extract<MessageRecord, {
11
- readonly _tag: "Steering";
12
- }> & {
13
- readonly consumedSeq: NonNullable<Extract<MessageRecord, {
14
- readonly _tag: "Steering";
15
- }>["consumedSeq"]>;
16
- });
17
- /** Derive the durable user/assistant transcript in committed sequence order. */
18
- declare const durableMessageTranscript: (state: Pick<ReducedState, "messages">) => ReadonlyArray<DurableTranscriptMessage>;
19
- type PromptProjectionState = Pick<ReducedState, "messages"> & Partial<Pick<ReducedState, "toolCalls">>;
20
- /** Convert all durable transcript messages and exact tool-result parts into provider prompt history. */
21
- declare const durableTranscriptPrompt: (state: PromptProjectionState) => Prompt.Prompt;
22
- /** Convert the current compacted context into provider prompt history. */
23
- declare const contextProjectionPrompt: (state: PromptProjectionState, context: ContextProjection | undefined) => Prompt.Prompt;
24
- /** Build a provider prompt with extra user content selected by the scheduler but not yet folded. */
25
- declare const durableTranscriptPromptWithUserContent: (state: PromptProjectionState, content: UserMessageContent) => Prompt.Prompt;
26
- /** Build a compacted provider prompt with extra user content selected by the scheduler. */
27
- declare const contextProjectionPromptWithUserContent: (state: PromptProjectionState, context: ContextProjection | undefined, content: UserMessageContent) => Prompt.Prompt;
28
- /** Build a compacted provider prompt with multiple scheduler-selected user messages. */
29
- declare const contextProjectionPromptWithUserContents: (state: PromptProjectionState, context: ContextProjection | undefined, contents: ReadonlyArray<UserMessageContent>) => Prompt.Prompt;
30
- //#endregion
31
- export { durableMessageTranscript as a, contextProjectionPromptWithUserContents as i, contextProjectionPrompt as n, durableTranscriptPrompt as o, contextProjectionPromptWithUserContent as r, durableTranscriptPromptWithUserContent as s, DurableTranscriptMessage as t };
32
- //# sourceMappingURL=message-transcript-BfuGCZhP.d.ts.map
@@ -1,39 +0,0 @@
1
- import { g as SessionId } from "./core-C-6xHzRx.js";
2
- import { S as ReducedState } from "./command-queues-w9WUKTpM.js";
3
- import { i as ContextProjection } from "./context-projection-n6Rdup0N.js";
4
- import { a as EDAReducerStateSnapshot } from "./reducer-registry-nO4biZlg.js";
5
- import * as Context from "effect/Context";
6
- import * as Effect from "effect/Effect";
7
- import * as Layer from "effect/Layer";
8
- import * as Prompt from "effect/unstable/ai/Prompt";
9
-
10
- //#region src/services/prompt-projector.d.ts
11
- /** Input for app-extensible state-to-LLM prompt projection. */
12
- interface EDAPromptProjectionInput {
13
- readonly sessionId: SessionId;
14
- readonly state: ReducedState;
15
- readonly reducerStates: EDAReducerStateSnapshot;
16
- readonly context?: ContextProjection;
17
- }
18
- /** App-derived instructions and data inserted around the durable transcript. */
19
- interface EDAProjectedPromptContext {
20
- /** Instruction messages placed after durable system context and before transcript history. */
21
- readonly instructions: ReadonlyArray<Prompt.SystemMessage>;
22
- /** Data messages placed after transcript history and before scheduler-selected user messages. */
23
- readonly messages: ReadonlyArray<Prompt.UserMessage>;
24
- }
25
- /** Host-extensible projection from durable state into provider prompt context. */
26
- interface EDAPromptProjectorShape {
27
- readonly projectContext: (input: EDAPromptProjectionInput) => Effect.Effect<EDAProjectedPromptContext>;
28
- readonly projectState: (input: EDAPromptProjectionInput) => Effect.Effect<ReducedState>;
29
- }
30
- /** Build a provider prompt entirely from the current durable state projection. */
31
- declare const buildEDAPrompt: (projector: EDAPromptProjectorShape, input: EDAPromptProjectionInput) => Effect.Effect<Prompt.Prompt>;
32
- declare const EDAPromptProjector_base: Context.ServiceClass<EDAPromptProjector, "@effect-durable-agent/EDAPromptProjector", EDAPromptProjectorShape>;
33
- /** Service that lets apps derive LLM context independently from UI projections. */
34
- declare class EDAPromptProjector extends EDAPromptProjector_base {
35
- static readonly Default: Layer.Layer<EDAPromptProjector, never, never>;
36
- }
37
- //#endregion
38
- export { buildEDAPrompt as a, EDAPromptProjectorShape as i, EDAPromptProjectionInput as n, EDAPromptProjector as r, EDAProjectedPromptContext as t };
39
- //# sourceMappingURL=prompt-projector-DvNHsoEN.d.ts.map
@@ -1,43 +0,0 @@
1
- import { g as SessionId } from "./core-C-6xHzRx.js";
2
- import { et as RunResolution, nt as RunSchedulingInput, rt as RunSchedulingRequest } from "./command-queues-w9WUKTpM.js";
3
- import * as Context from "effect/Context";
4
- import * as Effect from "effect/Effect";
5
- import * as Layer from "effect/Layer";
6
- import * as Schema from "effect/Schema";
7
-
8
- //#region src/services/run-scheduler.d.ts
9
- declare const RunSchedulingDeliveryError_base: Schema.Class<RunSchedulingDeliveryError, Schema.TaggedStruct<"RunSchedulingDeliveryError", {
10
- readonly message: Schema.String;
11
- }>, import("effect/Cause").YieldableError>;
12
- /** Recoverable failure delivering a persisted request; it never acknowledges that request. */
13
- declare class RunSchedulingDeliveryError extends RunSchedulingDeliveryError_base {}
14
- /** At-least-once outbound delivery, separate from the serialized run-start decision. */
15
- type RunSchedulingDelivery = (input: {
16
- readonly sessionId: SessionId;
17
- readonly request: RunSchedulingRequest;
18
- }) => Effect.Effect<void, RunSchedulingDeliveryError>;
19
- /**
20
- * Run-start boundary called by SessionState after pure dispatch or recovery policy
21
- * selects work, before allocating its run ID or committing RunStarted.
22
- *
23
- * Resolution must finish promptly with Local or Deferred intent and must not contact
24
- * an external scheduler. SessionState persists Deferred intent before calling deliver
25
- * outside the control loop. A successful delivery must mean the scheduler durably
26
- * accepted responsibility for the request and will retry its trusted grant callback.
27
- * Calls may repeat after a restart; command identity is not an exactly-once key.
28
- */
29
- interface RunSchedulerShape {
30
- readonly resolve: (input: RunSchedulingInput) => Effect.Effect<RunResolution>;
31
- readonly deliver: RunSchedulingDelivery;
32
- }
33
- declare const RunScheduler_base: Context.ServiceClass<RunScheduler, "@effect-durable-agent/RunScheduler", RunSchedulerShape>;
34
- /** Replaceable run-start integration, independent of persistence and host SDKs. */
35
- declare class RunScheduler extends RunScheduler_base {
36
- /** Preserve local execution without allocating IDs, issuing commands, or writing events. */
37
- static readonly Immediate: Layer.Layer<RunScheduler, never, never>;
38
- /** Defer every new run to a durable, idempotent external authorizer. */
39
- static readonly Deferred: (deliver: RunSchedulingDelivery) => Layer.Layer<RunScheduler, never, never>;
40
- }
41
- //#endregion
42
- export { RunSchedulingDeliveryError as i, RunSchedulerShape as n, RunSchedulingDelivery as r, RunScheduler as t };
43
- //# sourceMappingURL=run-scheduler-DFBqIRzF.d.ts.map
@@ -1,148 +0,0 @@
1
- import { c as EventId, g as SessionId, h as SequenceNumber } from "./core-C-6xHzRx.js";
2
- import { S as ReducedState } from "./command-queues-w9WUKTpM.js";
3
- import { f as PositionedEvent, i as EventEnvelope, n as EphemeralEventEnvelope, t as DurableEventEnvelope } from "./envelope-VXFEC8zr.js";
4
- import { H as DecodedDurableEvent } from "./durable-Ceu9SC2D.js";
5
- import { o as EDASessionStore, s as EDASessionStoreError, t as CommittedDurableEvent } from "./session-store-DBa-TOVH.js";
6
- import { t as IdGenerator } from "./id-generator--x6itQZ2.js";
7
- import { n as EventFactoryShape, r as SessionContext, t as EventFactory } from "./event-factory-CHP1-DAF.js";
8
- import { t as EDAKeepAlive } from "./keep-alive-Chl5SJxy.js";
9
- import { a as EDAReducerStateSnapshot, r as EDAReducerRegistry } from "./reducer-registry-nO4biZlg.js";
10
- import { n as SinkCheckpointStore } from "./sink-checkpoint-store-BZGfJLve.js";
11
- import * as Context from "effect/Context";
12
- import * as Effect from "effect/Effect";
13
- import * as Layer from "effect/Layer";
14
- import * as Schema from "effect/Schema";
15
- import * as Scope from "effect/Scope";
16
-
17
- //#region src/services/sink-registry.d.ts
18
- /** Cursor-window input delivered to one durable sink drain. */
19
- interface EDASinkRawDurableBatch<E = DecodedDurableEvent> {
20
- /** All durable events replayed for this cursor window, including uninterested events. */
21
- readonly allEvents: ReadonlyArray<CommittedDurableEvent>;
22
- /** Events matching the sink's durable interests. */
23
- readonly events: ReadonlyArray<CommittedDurableEvent<E>>;
24
- /** Durable sequence through which the sink may advance after success. */
25
- readonly throughSeq: SequenceNumber;
26
- }
27
- /** Cursor window with framework and app projections, enabled by default. */
28
- interface EDASinkDurableBatch<E = DecodedDurableEvent> extends EDASinkRawDurableBatch<E> {
29
- /** Authoritative reduced state folded exactly through `throughSeq`. */
30
- readonly stateAfter: ReducedState;
31
- /** App-specific durable reducer states folded exactly through `throughSeq`. */
32
- readonly reducerStates: EDAReducerStateSnapshot;
33
- }
34
- /** Typed, sink-owned durable state stored independently from cursor advancement. */
35
- interface EDASinkCheckpoint {
36
- /** Decode current durable state, or return `initial` for a new or legacy cursor row. */
37
- readonly get: <State>(schema: Schema.Codec<State, unknown, never, never>, initial: State) => Effect.Effect<State, EDASessionStoreError>;
38
- /** Validate, encode, and durably save state without advancing the sink cursor. */
39
- readonly save: <State>(schema: Schema.Codec<State, unknown, never, never>, state: State) => Effect.Effect<void, EDASessionStoreError>;
40
- }
41
- /** Capabilities exposed to sink processors without granting raw store or bus access. */
42
- interface EDASinkContext {
43
- readonly sessionId: SessionId;
44
- /** Sink-owned checkpoint state, serialized with cursor commits and background writes. */
45
- readonly checkpoint: EDASinkCheckpoint;
46
- /** Build a framework durable event if the sink needs to emit one. */
47
- readonly events: EventFactoryShape;
48
- /** Mint an app durable event id for staged custom events. */
49
- readonly makeEventId: () => Effect.Effect<EventId>;
50
- /** Publish a best-effort live-only event. */
51
- readonly emitEphemeral: (event: EphemeralEventEnvelope) => Effect.Effect<PositionedEvent, EDASessionStoreError>;
52
- /** Stage durable events; the runner commits them after the sink succeeds. */
53
- readonly stageDurable: (event: DurableEventEnvelope) => Effect.Effect<void>;
54
- /** Fork background sink work into the session scope. */
55
- readonly forkScoped: (effect: Effect.Effect<unknown, unknown>) => Effect.Effect<void>;
56
- }
57
- /** `"*"` and omission select every fact; a schema selects and narrows matching envelopes. */
58
- type EDASinkInterests = "*" | Schema.Codec<DurableEventEnvelope, unknown, never, never>;
59
- /** Delivery policy shared by raw and projected durable consumers. */
60
- interface EDADurableSinkOptions {
61
- readonly interests?: EDASinkInterests;
62
- readonly batchSize?: number;
63
- }
64
- /** Default durable consumer with framework and app projections at each cursor window. */
65
- interface EDAProjectedDurableSinkDefinition extends EDADurableSinkOptions {
66
- readonly process: (batch: EDASinkDurableBatch, ctx: EDASinkContext) => Effect.Effect<void, never>;
67
- }
68
- /** Raw consumer that never hydrates, folds, or retains a session projection. */
69
- interface EDARawDurableSinkDefinition extends EDADurableSinkOptions {
70
- readonly process: (batch: EDASinkRawDurableBatch, ctx: EDASinkContext) => Effect.Effect<void, never>;
71
- }
72
- /** Durable sink definition backed by a checkpoint and an app-owned delivery policy. */
73
- type EDADurableSinkDefinition = EDAProjectedDurableSinkDefinition;
74
- /** Best-effort live-only sink definition. */
75
- interface EDAEphemeralSinkDefinition {
76
- readonly interests?: "*" | Schema.Codec<EventEnvelope, unknown, never, never>;
77
- readonly process: (event: PositionedEvent, ctx: EDASinkContext) => Effect.Effect<void, never>;
78
- }
79
- /**
80
- * Named app integration hook with optional durable and ephemeral filters.
81
- *
82
- * Every sink runs on one serialized position-ordered lane. Sinks own retry and
83
- * terminal failure handling, so callbacks must have an infallible typed error
84
- * channel. An unexpected defect is logged and skipped before the durable checkpoint
85
- * advances. Ephemeral callbacks are best-effort and are only processed after the
86
- * durable prefix at their anchor sequence has been projected.
87
- */
88
- interface EDASinkOptions {
89
- readonly name: string;
90
- readonly ephemeral?: EDAEphemeralSinkDefinition;
91
- }
92
- /** Existing consumers receive framework and app projections unless explicitly opted out. */
93
- interface EDAProjectedSink extends EDASinkOptions {
94
- readonly state?: "projected";
95
- readonly durable?: EDAProjectedDurableSinkDefinition;
96
- }
97
- /** Raw consumers retain only their cursor and sink-owned checkpoint payload. */
98
- interface EDARawSink extends EDASinkOptions {
99
- readonly state: "none";
100
- readonly durable?: EDARawDurableSinkDefinition;
101
- }
102
- /** The outer discriminant preserves contextual callback typing for inline default sinks. */
103
- type EDASink = EDAProjectedSink | EDARawSink;
104
- /** Projected and raw overloads preserve contextual callback inference and literal names. */
105
- declare function makeSink<const Sink extends EDAProjectedSink>(sink: Sink): Sink;
106
- declare function makeSink<const Sink extends EDARawSink>(sink: Sink): Sink;
107
- declare function makeSink<const Sink extends EDASink>(sink: Sink): Sink;
108
- /** Convenience constructor preserving a sink's literal name/type information. */
109
- declare const EDASink: {
110
- make: typeof makeSink; /** The live-event schema owns both subscription filtering and callback typing. */
111
- forEphemeralEvents: <E extends EventEnvelope>(interests: Schema.Codec<E, unknown, never, never>, process: (event: PositionedEvent<E>, ctx: EDASinkContext) => Effect.Effect<void, never>) => EDAEphemeralSinkDefinition; /** One schema selects and narrows the facts delivered to a projected durable consumer. */
112
- forEvents: <E extends DurableEventEnvelope>(interests: Schema.Codec<E, unknown, never, never>, sink: Omit<EDAProjectedSink, "durable"> & {
113
- readonly durable: {
114
- readonly batchSize?: number;
115
- readonly process: (batch: EDASinkDurableBatch<E>, ctx: EDASinkContext) => Effect.Effect<void, never>;
116
- };
117
- }) => EDAProjectedSink;
118
- };
119
- /** Session-owned capabilities needed to start all registered sink runners. */
120
- interface EDASinkRunnerStartInput {
121
- readonly appendDurableBatch: (events: ReadonlyArray<DurableEventEnvelope>) => Effect.Effect<ReadonlyArray<CommittedDurableEvent>, EDASessionStoreError>;
122
- /** Immutable framework and app projections at one common durable head. */
123
- readonly initialProjection: {
124
- readonly reduced: ReducedState;
125
- readonly reducerStates: EDAReducerStateSnapshot;
126
- };
127
- readonly publishEphemeral: (event: EphemeralEventEnvelope) => Effect.Effect<PositionedEvent, EDASessionStoreError>;
128
- readonly scope: Scope.Scope;
129
- }
130
- /** Registry service coordinating durable checkpoints and live sink delivery. */
131
- interface EDASinkRegistryShape {
132
- readonly sinks: ReadonlyArray<EDASink>;
133
- /** Start long-lived sink runners. Safe to call once during session-state acquisition. */
134
- readonly startSinkRunners: (input: EDASinkRunnerStartInput) => Effect.Effect<void, EDASessionStoreError>;
135
- /** Coalesced non-blocking nudge that the durable log head advanced. */
136
- readonly notifyDurableHeadAdvanced: (head: SequenceNumber) => Effect.Effect<void>;
137
- /** Best-effort non-blocking delivery to ephemeral sink workers. */
138
- readonly publishEphemeralToSinks: (event: PositionedEvent) => Effect.Effect<void>;
139
- }
140
- declare const EDASinkRegistry_base: Context.ServiceClass<EDASinkRegistry, "@effect-durable-agent/EDASinkRegistry", EDASinkRegistryShape>;
141
- /** Registry and runner for app-provided EDA sinks. */
142
- declare class EDASinkRegistry extends EDASinkRegistry_base {
143
- static readonly Empty: Layer.Layer<EDASinkRegistry, never, never>;
144
- static readonly Live: (sinks: ReadonlyArray<EDASink>) => Layer.Layer<EDASinkRegistry, never, IdGenerator | EDAKeepAlive | EDAReducerRegistry | EventFactory | EDASessionStore | SinkCheckpointStore | SessionContext>;
145
- }
146
- //#endregion
147
- export { EDARawDurableSinkDefinition as a, EDASinkCheckpoint as c, EDASinkInterests as d, EDASinkRawDurableBatch as f, EDASinkRunnerStartInput as h, EDAProjectedSink as i, EDASinkContext as l, EDASinkRegistryShape as m, EDAEphemeralSinkDefinition as n, EDARawSink as o, EDASinkRegistry as p, EDAProjectedDurableSinkDefinition as r, EDASink as s, EDADurableSinkDefinition as t, EDASinkDurableBatch as u };
148
- //# sourceMappingURL=sink-registry-tpmJ-Dhf.d.ts.map