effect-durable-agent 0.1.0-alpha.22 → 0.1.0-alpha.24

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 (65) hide show
  1. package/dist/domain/command-queues.d.ts +1 -1
  2. package/dist/domain/message-transcript.d.ts +1 -1
  3. package/dist/domain/reduced-state.d.ts +1 -1
  4. package/dist/domain/run-scheduling.d.ts +1 -1
  5. package/dist/in-memory-D8qQXNc5.js +150 -0
  6. package/dist/in-memory-D8qQXNc5.js.map +1 -0
  7. package/dist/index.d.ts +1 -1
  8. package/dist/{window-read-B8aF_hDq.js → interpreter-BYstFpr4.js} +82 -868
  9. package/dist/interpreter-BYstFpr4.js.map +1 -0
  10. package/dist/records-DWKEjuqb.js +675 -0
  11. package/dist/records-DWKEjuqb.js.map +1 -0
  12. package/dist/{reduced-state-PJdig48e.d.ts → reduced-state-B5WxKSM5.d.ts} +4206 -4206
  13. package/dist/{reducer-registry-BAbhZs6d.d.ts → reducer-registry-CPObI3cs.d.ts} +2 -2
  14. package/dist/{run-scheduling-wakeup-QLK87OqG.d.ts → run-scheduling-wakeup-B19JTeyq.d.ts} +2 -2
  15. package/dist/services/compaction.d.ts +1 -1
  16. package/dist/services/model-call.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/reducer-registry.js +1 -1
  20. package/dist/services/run-scheduler.d.ts +1 -1
  21. package/dist/services/run-scheduling-wakeup.d.ts +1 -1
  22. package/dist/services/runtime-layer.d.ts +6 -6
  23. package/dist/services/runtime-layer.js +3 -3
  24. package/dist/services/runtime.d.ts +1 -1
  25. package/dist/services/runtime.js +1 -1
  26. package/dist/services/session-query.d.ts +1 -1
  27. package/dist/services/session-query.js +2 -2
  28. package/dist/services/session-state.d.ts +1 -1
  29. package/dist/services/session-state.js +1 -1
  30. package/dist/services/session-store.d.ts +1 -1
  31. package/dist/services/session-store.js +271 -1
  32. package/dist/services/session-store.js.map +1 -0
  33. package/dist/services/sink-checkpoint-store.d.ts +1 -1
  34. package/dist/services/sink-registry.d.ts +1 -1
  35. package/dist/services/sink-registry.js +1 -1
  36. package/dist/services/tool-registry.d.ts +1 -1
  37. package/dist/{session-state-StlO5B2N.js → session-state-BW0l2aNk.js} +3 -3
  38. package/dist/{session-state-StlO5B2N.js.map → session-state-BW0l2aNk.js.map} +1 -1
  39. package/dist/{session-store-ByDjS03N.d.ts → session-store-CWYZ29CV.d.ts} +163 -45
  40. package/dist/{sink-checkpoint-store-BHb8YRTw.d.ts → sink-checkpoint-store-B8Ky5nfW.d.ts} +2 -2
  41. package/dist/{sink-registry-DEneTH8u.js → sink-registry-D0MetcNq.js} +2 -2
  42. package/dist/{sink-registry-DEneTH8u.js.map → sink-registry-D0MetcNq.js.map} +1 -1
  43. package/dist/subscription-DelB8L87.d.ts +958 -0
  44. package/dist/subscription-g5W0Ggqx.js +498 -0
  45. package/dist/subscription-g5W0Ggqx.js.map +1 -0
  46. package/dist/testkit/layers.d.ts +9 -6
  47. package/dist/testkit/layers.js +4 -4
  48. package/dist/testkit/layers.js.map +1 -1
  49. package/dist/testkit/transcript.d.ts +226 -0
  50. package/dist/testkit/transcript.js +1475 -0
  51. package/dist/testkit/transcript.js.map +1 -0
  52. package/dist/{tool-registry-CxZ0iuYb.d.ts → tool-registry-B_WE2ZwK.d.ts} +2 -2
  53. package/dist/transcript.d.ts +40 -99
  54. package/dist/transcript.js +99 -170
  55. package/dist/transcript.js.map +1 -1
  56. package/dist/websocket.d.ts +2209 -2
  57. package/dist/websocket.js +704 -18
  58. package/dist/websocket.js.map +1 -1
  59. package/dist/window-read-DBf1Iktt.d.ts +104 -0
  60. package/dist/window-read-U55aAeuz.js +184 -0
  61. package/dist/window-read-U55aAeuz.js.map +1 -0
  62. package/package.json +5 -1
  63. package/dist/session-store-DcJjs4Fd.js +0 -413
  64. package/dist/session-store-DcJjs4Fd.js.map +0 -1
  65. package/dist/window-read-B8aF_hDq.js.map +0 -1
@@ -1,6 +1,6 @@
1
1
  import { d as UserMessageContent } from "../commands-3OD-p8dD.js";
2
2
  import { b as TurnId, h as SequenceNumber, p as RunId, u as MessageId } from "../core-BcimKMIv.js";
3
- import { C as RunRecord, f as MessageRecord, p as PendingCommand, r as CommandRecord, t as ActiveCommandEvidence } from "../reduced-state-PJdig48e.js";
3
+ import { C as RunRecord, f as MessageRecord, p as PendingCommand, r as CommandRecord, t as ActiveCommandEvidence } from "../reduced-state-B5WxKSM5.js";
4
4
  //#region src/domain/command-queues.d.ts
5
5
  /**
6
6
  * A steering message admitted for an active run but not necessarily consumed
@@ -1,2 +1,2 @@
1
- import { at as contextProjectionPromptWithUserContents, ct as durableTranscriptPromptWithUserContent, it as contextProjectionPromptWithUserContent, lt as projectionStateThrough, nt as DurableTranscriptMessage, ot as durableMessageTranscript, rt as contextProjectionPrompt, st as durableTranscriptPrompt } from "../reduced-state-PJdig48e.js";
1
+ import { at as contextProjectionPromptWithUserContents, ct as durableTranscriptPromptWithUserContent, it as contextProjectionPromptWithUserContent, lt as projectionStateThrough, nt as DurableTranscriptMessage, ot as durableMessageTranscript, rt as contextProjectionPrompt, st as durableTranscriptPrompt } from "../reduced-state-B5WxKSM5.js";
2
2
  export { DurableTranscriptMessage, contextProjectionPrompt, contextProjectionPromptWithUserContent, contextProjectionPromptWithUserContents, durableMessageTranscript, durableTranscriptPrompt, durableTranscriptPromptWithUserContent, projectionStateThrough };
@@ -1,3 +1,3 @@
1
- import { A as TurnTerminal, B as pendingCommands, C as RunRecord, D as ToolDecision, E as ToolCallRecord, F as encodeReducedStateCheckpoint, H as reduceCommittedEvents, I as foldReducedState, L as frameworkReducedStateReducerName, M as activeTurnIdentityForCommand, N as classifyRecoverableWork, O as ToolTerminal, P as decodeReducedStateCheckpoint, R as frameworkReducedStateReducerSchemaVersion, S as ReducedStateCheckpointToolTerminal, T as StopRequestRecord, U as reducedStateCheckpointEventSeqs, V as pendingStopCommand, _ as ReducedStateCheckpointCommandRecord, a as CompactionRecord, b as ReducedStateCheckpointToolCallRecord, c as InferenceRecord, d as LifecycleTiming, f as MessageRecord, g as ReducedState, h as RecoveryContinuationRecord, i as CommandTerminal, j as activeCommand, k as TurnRecord, l as InferenceTerminal, m as RecoverableWork, n as ActiveTurnIdentity, o as CompactionTerminal, p as PendingCommand, r as CommandRecord, s as ContextRecord, t as ActiveCommandEvidence, u as LifecycleFailure, v as ReducedStateCheckpointMessageRecord, w as RunTerminal, x as ReducedStateCheckpointToolDecision, y as ReducedStateCheckpointPayload, z as initialReducedState } from "../reduced-state-PJdig48e.js";
1
+ import { A as TurnTerminal, B as pendingCommands, C as RunRecord, D as ToolDecision, E as ToolCallRecord, F as encodeReducedStateCheckpoint, H as reduceCommittedEvents, I as foldReducedState, L as frameworkReducedStateReducerName, M as activeTurnIdentityForCommand, N as classifyRecoverableWork, O as ToolTerminal, P as decodeReducedStateCheckpoint, R as frameworkReducedStateReducerSchemaVersion, S as ReducedStateCheckpointToolTerminal, T as StopRequestRecord, U as reducedStateCheckpointEventSeqs, V as pendingStopCommand, _ as ReducedStateCheckpointCommandRecord, a as CompactionRecord, b as ReducedStateCheckpointToolCallRecord, c as InferenceRecord, d as LifecycleTiming, f as MessageRecord, g as ReducedState, h as RecoveryContinuationRecord, i as CommandTerminal, j as activeCommand, k as TurnRecord, l as InferenceTerminal, m as RecoverableWork, n as ActiveTurnIdentity, o as CompactionTerminal, p as PendingCommand, r as CommandRecord, s as ContextRecord, t as ActiveCommandEvidence, u as LifecycleFailure, v as ReducedStateCheckpointMessageRecord, w as RunTerminal, x as ReducedStateCheckpointToolDecision, y as ReducedStateCheckpointPayload, z as initialReducedState } from "../reduced-state-B5WxKSM5.js";
2
2
  import { n as TokenConsumptionState, r as TokenUsageTotals } from "../model-usage-0GeHwaaU.js";
3
3
  export { ActiveCommandEvidence, ActiveTurnIdentity, CommandRecord, CommandTerminal, CompactionRecord, CompactionTerminal, ContextRecord, InferenceRecord, InferenceTerminal, LifecycleFailure, LifecycleTiming, MessageRecord, PendingCommand, RecoverableWork, RecoveryContinuationRecord, ReducedState, ReducedStateCheckpointCommandRecord, ReducedStateCheckpointMessageRecord, ReducedStateCheckpointPayload, ReducedStateCheckpointToolCallRecord, ReducedStateCheckpointToolDecision, ReducedStateCheckpointToolTerminal, RunRecord, RunTerminal, StopRequestRecord, TokenConsumptionState, type TokenUsageTotals, ToolCallRecord, ToolDecision, ToolTerminal, TurnRecord, TurnTerminal, activeCommand, activeTurnIdentityForCommand, classifyRecoverableWork, decodeReducedStateCheckpoint, encodeReducedStateCheckpoint, foldReducedState, frameworkReducedStateReducerName, frameworkReducedStateReducerSchemaVersion, initialReducedState, pendingCommands, pendingStopCommand, reduceCommittedEvents, reducedStateCheckpointEventSeqs };
@@ -1,2 +1,2 @@
1
- import { Bt as RunResolution, Gt as RunSchedulingWork, Ht as RunSchedulingInput, It as DeferredRunResolution, Jt as planWaitingRunInterruption, Kt as canGrantRun, Lt as LocalRunResolution, Rt as RunGrantResult, Ut as RunSchedulingRequest, Vt as RunSchedulingCancellationPlan, Wt as RunSchedulingRequestRecord, Xt as waitingRunControl, Yt as runSchedulingInputMessageIds, qt as planRunSchedulingCancellation, zt as RunRequestOutcome } from "../reduced-state-PJdig48e.js";
1
+ import { Bt as RunResolution, Gt as RunSchedulingWork, Ht as RunSchedulingInput, It as DeferredRunResolution, Jt as planWaitingRunInterruption, Kt as canGrantRun, Lt as LocalRunResolution, Rt as RunGrantResult, Ut as RunSchedulingRequest, Vt as RunSchedulingCancellationPlan, Wt as RunSchedulingRequestRecord, Xt as waitingRunControl, Yt as runSchedulingInputMessageIds, qt as planRunSchedulingCancellation, zt as RunRequestOutcome } from "../reduced-state-B5WxKSM5.js";
2
2
  export { DeferredRunResolution, LocalRunResolution, RunGrantResult, RunRequestOutcome, RunResolution, RunSchedulingCancellationPlan, RunSchedulingInput, RunSchedulingRequest, RunSchedulingRequestRecord, RunSchedulingWork, canGrantRun, planRunSchedulingCancellation, planWaitingRunInterruption, runSchedulingInputMessageIds, waitingRunControl };
@@ -0,0 +1,150 @@
1
+ import { SequenceNumber } from "./types/core.js";
2
+ import { E as TranscriptOrder, G as isTopLevelTranscriptRecord, W as isPendingTranscriptUserRecord } from "./records-DWKEjuqb.js";
3
+ import { t as planTranscriptBatch } from "./interpreter-BYstFpr4.js";
4
+ //#region src/transcript/in-memory.ts
5
+ const aliasKey = (namespace, key) => `${namespace}\u0000${key}`;
6
+ /** The carried definition for a stored version, if this release still carries it. */
7
+ const carriedTranscriptDefinition = (config, version) => config.current.version === version ? config.current : config.previous?.version === version ? config.previous : void 0;
8
+ /** An empty version before any event is projected. */
9
+ const emptyTranscriptVersion = (version, role) => ({
10
+ meta: {
11
+ version,
12
+ role,
13
+ cursor: SequenceNumber.make(0),
14
+ status: { _tag: "Ok" }
15
+ },
16
+ records: /* @__PURE__ */ new Map(),
17
+ aliases: /* @__PURE__ */ new Map(),
18
+ ordinals: /* @__PURE__ */ new Map()
19
+ });
20
+ const lookupOf = (version) => ({
21
+ cursor: version.meta.cursor,
22
+ record: (id) => version.records.get(id),
23
+ alias: (namespace, key) => version.aliases.get(aliasKey(namespace, key)),
24
+ nextOrdinal: (anchorSeq) => version.ordinals.get(anchorSeq) ?? 0
25
+ });
26
+ const applyPlan = (version, plan) => {
27
+ const records = new Map(version.records);
28
+ const aliases = new Map(version.aliases);
29
+ const ordinals = new Map(version.ordinals);
30
+ for (const record of plan.records) {
31
+ records.set(record.id, record);
32
+ if ("position" in record && record.position !== void 0) {
33
+ const { anchorSeq, ordinal } = record.position;
34
+ ordinals.set(anchorSeq, Math.max(ordinals.get(anchorSeq) ?? 0, ordinal + 1));
35
+ }
36
+ }
37
+ for (const alias of plan.aliases) {
38
+ const key = aliasKey(alias.namespace, alias.key);
39
+ if (!aliases.has(key)) aliases.set(key, alias.recordId);
40
+ }
41
+ return {
42
+ meta: {
43
+ ...version.meta,
44
+ cursor: plan.throughSeq
45
+ },
46
+ records,
47
+ aliases,
48
+ ordinals
49
+ };
50
+ };
51
+ /**
52
+ * Project committed events into one version, or freeze it.
53
+ *
54
+ * A projection failure marks only this version failed at its unchanged cursor and leaves its
55
+ * rows exactly as they were, so it remains a consistent last-good cut.
56
+ */
57
+ const advanceTranscriptVersion = (version, definition, committed) => {
58
+ const fresh = committed.filter((entry) => entry.position.seq > version.meta.cursor);
59
+ const first = fresh[0];
60
+ if (first === void 0 || version.meta.status._tag === "Failed") return version;
61
+ try {
62
+ return applyPlan(version, planTranscriptBatch(lookupOf(version), fresh, definition));
63
+ } catch (error) {
64
+ return {
65
+ ...version,
66
+ meta: {
67
+ ...version.meta,
68
+ status: {
69
+ _tag: "Failed",
70
+ failedAtSeq: first.position.seq,
71
+ error: error instanceof Error ? error.message : String(error)
72
+ }
73
+ }
74
+ };
75
+ }
76
+ };
77
+ /** Maintain every carried, healthy version for a committed append; others stay frozen. */
78
+ const maintainTranscripts = (state, committed) => ({
79
+ ...state,
80
+ versions: state.versions.map((version) => {
81
+ const definition = carriedTranscriptDefinition(state.config, version.meta.version);
82
+ return definition === void 0 ? version : advanceTranscriptVersion(version, definition, committed);
83
+ })
84
+ });
85
+ /**
86
+ * Converge a session to the current definition, as the adapter's builder does in slices.
87
+ *
88
+ * A building version that is not `current` is discarded. If the active version is not `current`,
89
+ * `current` is built from the log (never from old rows) and, once it reaches the head, becomes
90
+ * active and the old version is deleted. A failed build leaves the active version serving; only a
91
+ * new definition repairs it. A brand-new log simply initializes `current`.
92
+ */
93
+ const convergeTranscripts = (state, log) => {
94
+ const current = state.config.current;
95
+ const versions = state.versions.filter((version) => version.meta.role === "active" || version.meta.version === current.version);
96
+ if (versions.find((version) => version.meta.role === "active")?.meta.version === current.version) return {
97
+ ...state,
98
+ versions
99
+ };
100
+ const building = versions.find((version) => version.meta.role === "building") ?? emptyTranscriptVersion(current.version, "building");
101
+ const built = advanceTranscriptVersion(building, current, log);
102
+ if (built.meta.status._tag === "Failed") return {
103
+ ...state,
104
+ versions: [...versions.filter((version) => version !== building), built]
105
+ };
106
+ return {
107
+ ...state,
108
+ versions: [{
109
+ ...built,
110
+ meta: {
111
+ ...built.meta,
112
+ role: "active"
113
+ }
114
+ }]
115
+ };
116
+ };
117
+ /** Initial transcript state for a store whose log already holds `log`. */
118
+ const initialTranscriptState = (incarnation, config, log) => convergeTranscripts({
119
+ incarnation,
120
+ config,
121
+ versions: []
122
+ }, log);
123
+ const topLevelOrder = (record) => ({
124
+ anchorSeq: record.position?.anchorSeq ?? 0,
125
+ ordinal: record.position?.ordinal ?? 0,
126
+ recordId: record.id
127
+ });
128
+ /** Window reads over the active version, or undefined while nothing is servable. */
129
+ const inMemoryTranscriptWindowSource = (state) => {
130
+ const active = state.versions.find((version) => version.meta.role === "active");
131
+ if (active === void 0) return void 0;
132
+ const records = Array.from(active.records.values());
133
+ const ordered = records.filter(isTopLevelTranscriptRecord).sort((left, right) => TranscriptOrder(topLevelOrder(left), topLevelOrder(right)));
134
+ const compare = (record, key) => TranscriptOrder(topLevelOrder(record), key);
135
+ return {
136
+ incarnation: state.incarnation,
137
+ meta: active.meta,
138
+ carried: carriedTranscriptDefinition(state.config, active.meta.version) !== void 0,
139
+ topLevelBefore: (key, limit, inclusive) => ordered.filter((record) => key === void 0 || (inclusive ? compare(record, key) <= 0 : compare(record, key) < 0)).reverse().slice(0, limit),
140
+ topLevelAfter: (key, limit, inclusive) => ordered.filter((record) => key === void 0 || (inclusive ? compare(record, key) >= 0 : compare(record, key) > 0)).slice(0, limit),
141
+ record: (id) => active.records.get(id),
142
+ alias: (namespace, key) => active.aliases.get(aliasKey(namespace, key)),
143
+ toolsOf: (assistantId) => records.flatMap((record) => record.kind === "tool" && record.assistantId === assistantId ? [record] : []),
144
+ pendingUsers: () => records.filter(isPendingTranscriptUserRecord)
145
+ };
146
+ };
147
+ //#endregion
148
+ export { maintainTranscripts as a, initialTranscriptState as i, emptyTranscriptVersion as n, inMemoryTranscriptWindowSource as r, advanceTranscriptVersion as t };
149
+
150
+ //# sourceMappingURL=in-memory-D8qQXNc5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"in-memory-D8qQXNc5.js","names":[],"sources":["../src/transcript/in-memory.ts"],"sourcesContent":["import type { CommittedDurableEvent } from \"../services/session-store\";\nimport { SequenceNumber } from \"../types/core\";\nimport { planTranscriptBatch } from \"./interpreter\";\nimport type { TranscriptDefinition } from \"./mapping\";\nimport type { TranscriptAliasNamespace, TranscriptChangePlan, TranscriptLookup } from \"./plan\";\nimport {\n TranscriptOrder,\n isPendingTranscriptUserRecord,\n isTopLevelTranscriptRecord,\n type TranscriptLogIncarnation,\n type TranscriptOrderKey,\n type TranscriptRecord,\n type TranscriptRecordId,\n type TranscriptTopLevelRecord,\n type TranscriptVersion,\n} from \"./records\";\nimport type { TranscriptMaintenanceConfig } from \"./store\";\nimport type { TranscriptVersionMeta } from \"./window\";\nimport type { TranscriptWindowSource } from \"./window-read\";\n\n/**\n * The in-memory store's transcript state: the semantic model of the adapter's tables\n * (`transcript_records`, `transcript_aliases`, `transcript_meta`), kept inside the store's\n * `Ref.modify` critical section so maintenance commits atomically with the appended events.\n */\nexport interface InMemoryTranscriptVersion {\n readonly meta: TranscriptVersionMeta;\n readonly records: ReadonlyMap<TranscriptRecordId, TranscriptRecord>;\n readonly aliases: ReadonlyMap<string, TranscriptRecordId>;\n readonly ordinals: ReadonlyMap<number, number>;\n}\n\nexport interface InMemoryTranscriptState {\n readonly incarnation: TranscriptLogIncarnation;\n readonly config: TranscriptMaintenanceConfig;\n readonly versions: ReadonlyArray<InMemoryTranscriptVersion>;\n}\n\nconst aliasKey = (namespace: TranscriptAliasNamespace, key: string) => `${namespace}\\u0000${key}`;\n\n/** The carried definition for a stored version, if this release still carries it. */\nexport const carriedTranscriptDefinition = (\n config: TranscriptMaintenanceConfig,\n version: TranscriptVersion,\n): TranscriptDefinition | undefined =>\n config.current.version === version\n ? config.current\n : config.previous?.version === version\n ? config.previous\n : undefined;\n\n/** An empty version before any event is projected. */\nexport const emptyTranscriptVersion = (\n version: TranscriptVersion,\n role: TranscriptVersionMeta[\"role\"],\n): InMemoryTranscriptVersion => ({\n meta: { version, role, cursor: SequenceNumber.make(0), status: { _tag: \"Ok\" } },\n records: new Map(),\n aliases: new Map(),\n ordinals: new Map(),\n});\n\nconst lookupOf = (version: InMemoryTranscriptVersion): TranscriptLookup => ({\n cursor: version.meta.cursor,\n record: (id) => version.records.get(id),\n alias: (namespace, key) => version.aliases.get(aliasKey(namespace, key)),\n nextOrdinal: (anchorSeq) => version.ordinals.get(anchorSeq) ?? 0,\n});\n\nconst applyPlan = (\n version: InMemoryTranscriptVersion,\n plan: TranscriptChangePlan,\n): InMemoryTranscriptVersion => {\n const records = new Map(version.records);\n const aliases = new Map(version.aliases);\n const ordinals = new Map(version.ordinals);\n for (const record of plan.records) {\n records.set(record.id, record);\n if (\"position\" in record && record.position !== undefined) {\n const { anchorSeq, ordinal } = record.position;\n ordinals.set(anchorSeq, Math.max(ordinals.get(anchorSeq) ?? 0, ordinal + 1));\n }\n }\n for (const alias of plan.aliases) {\n const key = aliasKey(alias.namespace, alias.key);\n if (!aliases.has(key)) aliases.set(key, alias.recordId);\n }\n return { meta: { ...version.meta, cursor: plan.throughSeq }, records, aliases, ordinals };\n};\n\n/**\n * Project committed events into one version, or freeze it.\n *\n * A projection failure marks only this version failed at its unchanged cursor and leaves its\n * rows exactly as they were, so it remains a consistent last-good cut.\n */\nexport const advanceTranscriptVersion = (\n version: InMemoryTranscriptVersion,\n definition: TranscriptDefinition,\n committed: ReadonlyArray<CommittedDurableEvent>,\n): InMemoryTranscriptVersion => {\n const fresh = committed.filter((entry) => entry.position.seq > version.meta.cursor);\n const first = fresh[0];\n if (first === undefined || version.meta.status._tag === \"Failed\") return version;\n try {\n return applyPlan(version, planTranscriptBatch(lookupOf(version), fresh, definition));\n } catch (error) {\n return {\n ...version,\n meta: {\n ...version.meta,\n status: {\n _tag: \"Failed\",\n failedAtSeq: first.position.seq,\n error: error instanceof Error ? error.message : String(error),\n },\n },\n };\n }\n};\n\n/** Maintain every carried, healthy version for a committed append; others stay frozen. */\nexport const maintainTranscripts = (\n state: InMemoryTranscriptState,\n committed: ReadonlyArray<CommittedDurableEvent>,\n): InMemoryTranscriptState => ({\n ...state,\n versions: state.versions.map((version) => {\n const definition = carriedTranscriptDefinition(state.config, version.meta.version);\n return definition === undefined\n ? version\n : advanceTranscriptVersion(version, definition, committed);\n }),\n});\n\n/**\n * Converge a session to the current definition, as the adapter's builder does in slices.\n *\n * A building version that is not `current` is discarded. If the active version is not `current`,\n * `current` is built from the log (never from old rows) and, once it reaches the head, becomes\n * active and the old version is deleted. A failed build leaves the active version serving; only a\n * new definition repairs it. A brand-new log simply initializes `current`.\n */\nexport const convergeTranscripts = (\n state: InMemoryTranscriptState,\n log: ReadonlyArray<CommittedDurableEvent>,\n): InMemoryTranscriptState => {\n const current = state.config.current;\n const versions = state.versions.filter(\n (version) => version.meta.role === \"active\" || version.meta.version === current.version,\n );\n const active = versions.find((version) => version.meta.role === \"active\");\n if (active?.meta.version === current.version) return { ...state, versions };\n\n const building =\n versions.find((version) => version.meta.role === \"building\") ??\n emptyTranscriptVersion(current.version, \"building\");\n const built = advanceTranscriptVersion(building, current, log);\n if (built.meta.status._tag === \"Failed\") {\n return { ...state, versions: [...versions.filter((version) => version !== building), built] };\n }\n return { ...state, versions: [{ ...built, meta: { ...built.meta, role: \"active\" } }] };\n};\n\n/** Initial transcript state for a store whose log already holds `log`. */\nexport const initialTranscriptState = (\n incarnation: TranscriptLogIncarnation,\n config: TranscriptMaintenanceConfig,\n log: ReadonlyArray<CommittedDurableEvent>,\n): InMemoryTranscriptState => convergeTranscripts({ incarnation, config, versions: [] }, log);\n\nconst topLevelOrder = (record: TranscriptTopLevelRecord): TranscriptOrderKey => ({\n anchorSeq: record.position?.anchorSeq ?? 0,\n ordinal: record.position?.ordinal ?? 0,\n recordId: record.id,\n});\n\n/** Window reads over the active version, or undefined while nothing is servable. */\nexport const inMemoryTranscriptWindowSource = (\n state: InMemoryTranscriptState,\n): TranscriptWindowSource | undefined => {\n const active = state.versions.find((version) => version.meta.role === \"active\");\n if (active === undefined) return undefined;\n const records = Array.from(active.records.values());\n const ordered = records\n .filter(isTopLevelTranscriptRecord)\n .sort((left, right) => TranscriptOrder(topLevelOrder(left), topLevelOrder(right)));\n const compare = (record: TranscriptTopLevelRecord, key: TranscriptOrderKey) =>\n TranscriptOrder(topLevelOrder(record), key);\n return {\n incarnation: state.incarnation,\n meta: active.meta,\n carried: carriedTranscriptDefinition(state.config, active.meta.version) !== undefined,\n topLevelBefore: (key, limit, inclusive) =>\n ordered\n .filter(\n (record) =>\n key === undefined || (inclusive ? compare(record, key) <= 0 : compare(record, key) < 0),\n )\n .reverse()\n .slice(0, limit),\n topLevelAfter: (key, limit, inclusive) =>\n ordered\n .filter(\n (record) =>\n key === undefined || (inclusive ? compare(record, key) >= 0 : compare(record, key) > 0),\n )\n .slice(0, limit),\n record: (id) => active.records.get(id),\n alias: (namespace, key) => active.aliases.get(aliasKey(namespace, key)),\n toolsOf: (assistantId) =>\n records.flatMap((record) =>\n record.kind === \"tool\" && record.assistantId === assistantId ? [record] : [],\n ),\n pendingUsers: () => records.filter(isPendingTranscriptUserRecord),\n };\n};\n"],"mappings":"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"}
package/dist/index.d.ts CHANGED
@@ -4,5 +4,5 @@ import { _ as parseEDATraceparent, a as EDATraceAttributes, c as EDATraceLink, d
4
4
  import { _ as UnixEpochMillis, a as EventNamespace, b as makeEventType, c as FailurePayload, d as NonNegativeInt, f as PositionedEvent, g as ToolName, h as SystemPromptText, i as EventEnvelope, l as ForeignDurableEvent, m as SchemaVersion, n as EphemeralEventEnvelope, o as EventType, p as ProviderPartId, r as EventDurability, s as EventTypeName, t as DurableEventEnvelope, u as ModelSelectionPayload, v as UsagePayload, x as schemaV1, y as effectDurableAgentNamespace } from "./envelope-Che6KatU.js";
5
5
  import { $ as LegacyAttemptEvent, $n as pendingMessagesPausedEventType, $t as ToolCallRejectedPayload, A as CompactionFailedEvent, An as baseStateCreatedEventType, At as SessionConfiguredEvent, B as ContextRebasedPayload, Bn as compactionRequestedEventType, Bt as SummaryCreatedEvent, C as CommandEvent, Cn as UserMessagePromotedEvent, Cr as turnStartedEventType, Ct as RunSchedulingGrantedPayload, D as CommandStartedPayload, Dn as assistantMessageCommittedEventType, Dr as userMessagePromotedEventType, Dt as RunSchedulingRequestedPayload, E as CommandStartedEvent, En as UserMessageSubmittedPayload, Er as userMessageCommittedEventType, Et as RunSchedulingRequestedEvent, F as CompactionStartedPayload, Fn as commandCompletedEventType, Ft as StopControlEvent, G as InferenceCompletedEvent, Gn as decodeUnknownEDADurableEvent, Gt as ToolCallCompletedPayload, H as DecodedDurableEvent, Hn as contextProjectedEventType, Ht as SystemMessageCommittedEvent, I as ContextAndCompactionEvent, In as commandFailedEventType, It as StopTurnAppliedEvent, J as InferenceFailedEvent, Jn as inferenceCompletedEventType, Jt as ToolCallEvent, K as InferenceCompletedPayload, Kn as decodeUnknownEDADurableEventSync, Kt as ToolCallCreatedEvent, L as ContextProjectedEvent, Ln as commandStartedEventType, Lt as StopTurnAppliedPayload, M as CompactionRequestedEvent, Mn as baseStateRequestedEventType, Mt as SteeringMessageCancelledPayload, N as CompactionRequestedPayload, Nn as commandAdmittedEventType, Nt as SteeringMessageQueuedEvent, O as CompactionCompletedEvent, On as assistantMessageImportedEventType, Or as userMessageSubmittedEventType, Ot as RunStartedEvent, P as CompactionStartedEvent, Pn as commandCancelledEventType, Pt as SteeringMessageQueuedPayload, Q as LegacyAssistantMessageCommittedEvent, Qn as messageQueuePausedEventType, Qt as ToolCallRejectedEvent, R as ContextProjectedPayload, Rn as compactionCompletedEventType, Rt as StopTurnRequestedEvent, S as CommandCompletedPayload, Sn as UserMessageDisposition, Sr as turnFailedEventType, St as RunSchedulingGrantedEvent, T as CommandFailedPayload, Tn as UserMessageSubmittedEvent, Tr as userMessageCancelledEventType, Tt as RunSchedulingInvalidatedPayload, U as EDADurableEvent, Un as contextRebasedEventType, Ut as SystemMessageCommittedPayload, V as CurrentEDADurableEvent, Vn as compactionStartedEventType, Vt as SummaryCreatedPayload, W as EDADurableEventV1, Wn as decodeDurableEventSync, Wt as ToolCallCompletedEvent, X as InferenceStartedEvent, Xn as inferenceStartedEventType, Xt as ToolCallFailedPayload, Y as InferenceFailedPayload, Yn as inferenceFailedEventType, Yt as ToolCallFailedEvent, Z as InferenceStartedPayload, Zn as interpretLegacyAttemptForReduction, Zt as ToolCallPromptPart, _ as CommandAdmittedEvent, _n as UserMessageCancellationReason, _r as toolCallCreatedEventType, _t as RunInterruptedEvent, a as AssistantMessageImportedPayload, an as ToolPromptPart, ar as runSchedulingGrantedEventType, at as MessageQueuePausedPayload, b as CommandCancelledPayload, bn as UserMessageCommittedEvent, br as toolCallStartedEventType, bt as RunSchedulingDeliveredPayload, c as AssistantPromptPart, cn as TurnCompletedEvent, cr as runStartedEventType, ct as RecoveryCompletedEvent, d as BaseStateCreatedPayload, dn as TurnFailedEvent, dr as steeringMessageQueuedEventType, dt as RecoveryEvent, en as ToolCallRejectionFeedback, er as recoveryCompletedEventType, et as LegacyToolCallCreatedEvent, f as BaseStateEvent, fn as TurnFailedPayload, fr as stopTurnAppliedEventType, ft as RunCompletedEvent, g as BaseStateRequestedPayload, gn as TurnStoppedPayload, gr as toolCallCompletedEventType, gt as RunFailedPayload, h as BaseStateRequestedEvent, hn as TurnStoppedEvent, hr as systemMessageCommittedEventType, ht as RunFailedEvent, i as AssistantMessageImportedEvent, in as ToolFailurePromptPart, ir as runSchedulingDeliveredEventType, it as MessageQueuePausedEvent, j as CompactionFailedPayload, jn as baseStateFailedEventType, jt as SteeringMessageCancelledEvent, k as CompactionCompletedPayload, kn as assistantPartialCommittedEventType, kt as RunStartedPayload, l as AssistantPromptParts, ln as TurnCompletedPayload, lr as sessionConfiguredEventType, lt as RecoveryCompletedPayload, m as BaseStateFailedPayload, mn as TurnStartedPayload, mr as summaryCreatedEventType, mt as RunEvent, n as AssistantMessageCommittedPayload, nn as ToolCallStartedEvent, nr as runFailedEventType, nt as LegacyTurnAttemptStartedEvent, o as AssistantPartialCommittedEvent, on as ToolRejectionPromptPart, or as runSchedulingInvalidatedEventType, ot as PendingMessagesPausedEvent, p as BaseStateFailedEvent, pn as TurnStartedEvent, pr as stopTurnRequestedEventType, pt as RunCompletedPayload, q as InferenceEvent, qn as durableEventEnvelope, qt as ToolCallCreatedPayload, r as AssistantMessageContent, rn as ToolCallStartedPayload, rr as runInterruptedEventType, rt as MessageEvent, s as AssistantPartialCommittedPayload, sn as ToolSuccessPromptPart, sr as runSchedulingRequestedEventType, st as PendingMessagesPausedPayload, t as AssistantMessageCommittedEvent, tn as ToolCallRejectionReason, tr as runCompletedEventType, tt as LegacyTurnAttemptCompletedEvent, u as BaseStateCreatedEvent, un as TurnEvent, ur as steeringMessageCancelledEventType, ut as RecoveryContinuation, v as CommandAdmittedPayload, vn as UserMessageCancelledEvent, vr as toolCallFailedEventType, vt as RunInterruptedPayload, w as CommandFailedEvent, wn as UserMessagePromotedPayload, wr as turnStoppedEventType, wt as RunSchedulingInvalidatedEvent, x as CommandCompletedEvent, xn as UserMessageCommittedPayload, xr as turnCompletedEventType, xt as RunSchedulingEvent, y as CommandCancelledEvent, yn as UserMessageCancelledPayload, yr as toolCallRejectedEventType, yt as RunSchedulingDeliveredEvent, z as ContextRebasedEvent, zn as compactionFailedEventType, zt as StopTurnRequestedPayload } from "./durable-CKdCCqhw.js";
6
6
  import { C as toolParamsDeltaEventType, E as traceStatusEventType, S as textDeltaEventType, T as toolParamsStartEventType, _ as TraceStatusEvent, a as RuntimeStatusEvent, b as reasoningDeltaEventType, c as SubscriberStatusPayload, d as ToolParamsDeltaEvent, f as ToolParamsDeltaPayload, g as ToolParamsStartPayload, h as ToolParamsStartEvent, i as ReasoningDeltaPayload, l as TextDeltaEvent, m as ToolParamsEndPayload, n as ModelStreamEvent, o as SubscriberStatusEvent, p as ToolParamsEndEvent, r as ReasoningDeltaEvent, s as SubscriberStatusKind, t as EDAEphemeralEvent, u as TextDeltaPayload, v as TraceStatusKind, w as toolParamsEndEventType, x as subscriberStatusEventType, y as TraceStatusPayload } from "./events-BWuvzVml.js";
7
- import { G as EDACommandTerminalEvent, J as EDARuntimeError, K as EDARuntime, W as CommittedCommandTerminalEvent, X as EDARuntimeSubmit, Y as EDARuntimeShape, q as EDARuntimeConfig } from "./reduced-state-PJdig48e.js";
7
+ import { G as EDACommandTerminalEvent, J as EDARuntimeError, K as EDARuntime, W as CommittedCommandTerminalEvent, X as EDARuntimeSubmit, Y as EDARuntimeShape, q as EDARuntimeConfig } from "./reduced-state-B5WxKSM5.js";
8
8
  export { AssistantMessageCommittedEvent, AssistantMessageCommittedPayload, AssistantMessageContent, AssistantMessageImportedEvent, AssistantMessageImportedPayload, AssistantPartialCommittedEvent, AssistantPartialCommittedPayload, AssistantPromptPart, AssistantPromptParts, BaseStateCreatedEvent, BaseStateCreatedPayload, BaseStateEvent, BaseStateFailedEvent, BaseStateFailedPayload, BaseStateId, BaseStateRequestedEvent, BaseStateRequestedPayload, CancelPendingMessageCommand, CommandAdmittedEvent, CommandAdmittedPayload, CommandCancelledEvent, CommandCancelledPayload, CommandCompletedEvent, CommandCompletedPayload, CommandEvent, CommandFailedEvent, CommandFailedPayload, CommandId, CommandIdempotencyKey, CommandStartedEvent, CommandStartedPayload, CommittedCommandTerminalEvent, CompactionCompletedEvent, CompactionCompletedPayload, CompactionFailedEvent, CompactionFailedPayload, CompactionId, CompactionRequestedEvent, CompactionRequestedPayload, CompactionStartedEvent, CompactionStartedPayload, ContextAndCompactionEvent, ContextProjectedEvent, ContextProjectedPayload, ContextRebasedEvent, ContextRebasedPayload, ContextVersion, CorrelationId, CurrentEDADurableEvent, DecodedDurableEvent, DurableEventEnvelope, DurablePosition, DurableSubSequenceNumber, EDACommand, EDACommandTerminalEvent, EDADurableEvent, EDADurableEventV1, EDAEphemeralEvent, EDAEventTrace, EDARunTrace, EDARuntime, EDARuntimeConfig, EDARuntimeError, EDARuntimeShape, EDARuntimeSubmit, EDASpanId, EDATraceAttributeValue, EDATraceAttributes, EDATraceContext, EDATraceId, EDATraceLink, EDATraceMetadata, EphemeralEventEnvelope, EventDurability, EventEnvelope, EventId, EventNamespace, EventType, EventTypeName, FailurePayload, ForeignDurableEvent, GrantRunCommand, InferenceCompletedEvent, InferenceCompletedPayload, InferenceEvent, InferenceFailedEvent, InferenceFailedPayload, InferenceId, InferenceStartedEvent, InferenceStartedPayload, LegacyAssistantMessageCommittedEvent, LegacyAttemptEvent, LegacyToolCallCreatedEvent, LegacyTurnAttemptCompletedEvent, LegacyTurnAttemptStartedEvent, MessageEvent, MessageId, MessageQueuePausedEvent, MessageQueuePausedPayload, ModelSelectionPayload, ModelStreamEvent, NonNegativeInt, PendingMessageCancellationReason, PendingMessagesPausedEvent, PendingMessagesPausedPayload, Position, PositionOrder, PositionedEvent, PromotePendingMessageCommand, ProviderPartId, ReasoningDeltaEvent, ReasoningDeltaPayload, RecoveryCompletedEvent, RecoveryCompletedPayload, RecoveryContinuation, RecoveryEvent, ResumePendingMessagesCommand, RunCompletedEvent, RunCompletedPayload, RunEvent, RunFailedEvent, RunFailedPayload, RunId, RunInterruptedEvent, RunInterruptedPayload, RunRequestId, RunSchedulingDeliveredEvent, RunSchedulingDeliveredPayload, RunSchedulingEvent, RunSchedulingGrantedEvent, RunSchedulingGrantedPayload, RunSchedulingInvalidatedEvent, RunSchedulingInvalidatedPayload, RunSchedulingRequestedEvent, RunSchedulingRequestedPayload, RunStartedEvent, RunStartedPayload, RuntimeStatusEvent, SchemaVersion, SequenceNumber, SessionConfiguredEvent, SessionId, SteeringMessageCancelledEvent, SteeringMessageCancelledPayload, SteeringMessageQueuedEvent, SteeringMessageQueuedPayload, StopControlEvent, StopTurnAppliedEvent, StopTurnAppliedPayload, StopTurnCommand, StopTurnRequestedEvent, StopTurnRequestedPayload, SubSequenceNumber, SubmitMessageCommand, SubmitMessageDisposition, SubscriberStatusEvent, SubscriberStatusKind, SubscriberStatusPayload, SummaryCreatedEvent, SummaryCreatedPayload, SummaryId, SystemMessageCommittedEvent, SystemMessageCommittedPayload, SystemPromptText, TextDeltaEvent, TextDeltaPayload, ToolCallCompletedEvent, ToolCallCompletedPayload, ToolCallCreatedEvent, ToolCallCreatedPayload, ToolCallEvent, ToolCallFailedEvent, ToolCallFailedPayload, ToolCallId, ToolCallPromptPart, ToolCallRejectedEvent, ToolCallRejectedPayload, ToolCallRejectionFeedback, ToolCallRejectionReason, ToolCallStartedEvent, ToolCallStartedPayload, ToolFailurePromptPart, ToolName, ToolParamsDeltaEvent, ToolParamsDeltaPayload, ToolParamsEndEvent, ToolParamsEndPayload, ToolParamsStartEvent, ToolParamsStartPayload, ToolPromptPart, ToolRejectionPromptPart, ToolSuccessPromptPart, TraceStatusEvent, TraceStatusKind, TraceStatusPayload, TurnCompletedEvent, TurnCompletedPayload, TurnEvent, TurnFailedEvent, TurnFailedPayload, TurnId, TurnStartedEvent, TurnStartedPayload, TurnStoppedEvent, TurnStoppedPayload, UnixEpochMillis, UsagePayload, UserMessageCancellationReason, UserMessageCancelledEvent, UserMessageCancelledPayload, UserMessageCommittedEvent, UserMessageCommittedPayload, UserMessageContent, UserMessageDisposition, UserMessagePart, UserMessagePromotedEvent, UserMessagePromotedPayload, UserMessageSubmittedEvent, UserMessageSubmittedPayload, assistantMessageCommittedEventType, assistantMessageImportedEventType, assistantPartialCommittedEventType, baseStateCreatedEventType, baseStateFailedEventType, baseStateRequestedEventType, buildEDATraceparent, commandAdmittedEventType, commandCancelledEventType, commandCompletedEventType, commandFailedEventType, commandStartedEventType, compactionCompletedEventType, compactionFailedEventType, compactionRequestedEventType, compactionStartedEventType, comparePosition, contextProjectedEventType, contextRebasedEventType, decodeDurableEventSync, decodeUnknownEDADurableEvent, decodeUnknownEDADurableEventSync, durableEventEnvelope, durablePosition, effectDurableAgentNamespace, inferenceCompletedEventType, inferenceFailedEventType, inferenceStartedEventType, interpretLegacyAttemptForReduction, makeEDAEventTrace, makeEDARunTrace, makeEDATraceContext, makeEDATraceMetadataFromParent, makeEventType, makeRootEDAEventTrace, makeRootEDATraceMetadata, messageQueuePausedEventType, parseEDATraceparent, pendingMessagesPausedEventType, reasoningDeltaEventType, recoveryCompletedEventType, runCompletedEventType, runFailedEventType, runInterruptedEventType, runSchedulingDeliveredEventType, runSchedulingGrantedEventType, runSchedulingInvalidatedEventType, runSchedulingRequestedEventType, runStartedEventType, schemaV1, sessionConfiguredEventType, steeringMessageCancelledEventType, steeringMessageQueuedEventType, stopTurnAppliedEventType, stopTurnRequestedEventType, subscriberStatusEventType, summaryCreatedEventType, systemMessageCommittedEventType, textDeltaEventType, toolCallCompletedEventType, toolCallCreatedEventType, toolCallFailedEventType, toolCallRejectedEventType, toolCallStartedEventType, toolParamsDeltaEventType, toolParamsEndEventType, toolParamsStartEventType, traceStatusEventType, turnCompletedEventType, turnFailedEventType, turnStartedEventType, turnStoppedEventType, userMessageCancelledEventType, userMessageCommittedEventType, userMessagePromotedEventType, userMessageSubmittedEventType };