effect-durable-agent 0.1.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/CONTRIBUTING.md +26 -0
- package/LICENSE +21 -0
- package/README.md +305 -0
- package/SECURITY.md +8 -0
- package/dist/command-queues-CQ9cwRP7.d.ts +468 -0
- package/dist/commands-Ce1ec6kH.d.ts +104 -0
- package/dist/compaction-YayFKo_1.d.ts +144 -0
- package/dist/core-Hv3cFydL.d.ts +81 -0
- package/dist/domain/command-queues.d.ts +2 -0
- package/dist/domain/command-queues.js +97 -0
- package/dist/domain/command-queues.js.map +1 -0
- package/dist/domain/message-transcript.d.ts +2 -0
- package/dist/domain/message-transcript.js +111 -0
- package/dist/domain/message-transcript.js.map +1 -0
- package/dist/domain/reduced-state-schema.d.ts +996 -0
- package/dist/domain/reduced-state-schema.js +286 -0
- package/dist/domain/reduced-state-schema.js.map +1 -0
- package/dist/domain/reduced-state.d.ts +2 -0
- package/dist/domain/reduced-state.js +2 -0
- package/dist/durable-C3Rz7kg3.js +625 -0
- package/dist/durable-C3Rz7kg3.js.map +1 -0
- package/dist/durable-DlScwmCy.d.ts +7424 -0
- package/dist/durable-object-runtime-B7jwBY2R.js +1494 -0
- package/dist/durable-object-runtime-B7jwBY2R.js.map +1 -0
- package/dist/durable-object-runtime-pWv0ohlz.d.ts +257 -0
- package/dist/durable-object-storage-Czy7IPrh.d.ts +41 -0
- package/dist/events-Bb9-Cu-7.d.ts +918 -0
- package/dist/host/durable-object-runtime.d.ts +2 -0
- package/dist/host/durable-object-runtime.js +2 -0
- package/dist/host/durable-object-storage.d.ts +2 -0
- package/dist/host/durable-object-storage.js +0 -0
- package/dist/host/durable-object.d.ts +83 -0
- package/dist/host/durable-object.js +191 -0
- package/dist/host/durable-object.js.map +1 -0
- package/dist/host/websocket-wire.d.ts +2 -0
- package/dist/host/websocket-wire.js +88 -0
- package/dist/host/websocket-wire.js.map +1 -0
- package/dist/id-generator-C2Q15uZM.d.ts +33 -0
- package/dist/index-BVVgDSdq.d.ts +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +7 -0
- package/dist/keep-alive-DYDsH6qN.d.ts +111 -0
- package/dist/keep-alive-p8dIcSVy.js +109 -0
- package/dist/keep-alive-p8dIcSVy.js.map +1 -0
- package/dist/message-transcript-BCHdHAe2.d.ts +32 -0
- package/dist/prompt-projector-9_02lk5-.d.ts +40 -0
- package/dist/reduced-state-C4nVVzz9.js +910 -0
- package/dist/reduced-state-C4nVVzz9.js.map +1 -0
- package/dist/reducer-registry-C0svUa63.d.ts +69 -0
- package/dist/runtime-C56FQxiL.d.ts +60 -0
- package/dist/services/compaction.d.ts +2 -0
- package/dist/services/compaction.js +426 -0
- package/dist/services/compaction.js.map +1 -0
- package/dist/services/id-generator.d.ts +2 -0
- package/dist/services/id-generator.js +56 -0
- package/dist/services/id-generator.js.map +1 -0
- package/dist/services/prompt-projector.d.ts +2 -0
- package/dist/services/prompt-projector.js +27 -0
- package/dist/services/prompt-projector.js.map +1 -0
- package/dist/services/reducer-registry.d.ts +2 -0
- package/dist/services/reducer-registry.js +71 -0
- package/dist/services/reducer-registry.js.map +1 -0
- package/dist/services/runtime.d.ts +2 -0
- package/dist/services/runtime.js +84 -0
- package/dist/services/runtime.js.map +1 -0
- package/dist/services/session-query.d.ts +2 -0
- package/dist/services/session-query.js +2 -0
- package/dist/services/session-store.d.ts +2 -0
- package/dist/services/session-store.js +2 -0
- package/dist/services/sink-registry.d.ts +2 -0
- package/dist/services/sink-registry.js +2 -0
- package/dist/services/span-names.d.ts +28 -0
- package/dist/services/span-names.js +42 -0
- package/dist/services/span-names.js.map +1 -0
- package/dist/services/tool-registry.d.ts +2 -0
- package/dist/services/tool-registry.js +46 -0
- package/dist/services/tool-registry.js.map +1 -0
- package/dist/services/tracing.d.ts +76 -0
- package/dist/services/tracing.js +116 -0
- package/dist/services/tracing.js.map +1 -0
- package/dist/session-query-DOc1KanA.js +2930 -0
- package/dist/session-query-DOc1KanA.js.map +1 -0
- package/dist/session-query-DlRo5Ufc.d.ts +769 -0
- package/dist/session-store-D2Ore1QC.d.ts +295 -0
- package/dist/session-store-pYxQW9qh.js +214 -0
- package/dist/session-store-pYxQW9qh.js.map +1 -0
- package/dist/sink-registry-CFC6xjsN.js +312 -0
- package/dist/sink-registry-CFC6xjsN.js.map +1 -0
- package/dist/sink-registry-CIU0LD3m.d.ts +158 -0
- package/dist/testkit/layers.d.ts +101 -0
- package/dist/testkit/layers.js +108 -0
- package/dist/testkit/layers.js.map +1 -0
- package/dist/tool-registry-CcnkAAQK.d.ts +51 -0
- package/dist/tracing-BXHAkxkx.d.ts +111 -0
- package/dist/types/commands.d.ts +2 -0
- package/dist/types/commands.js +60 -0
- package/dist/types/commands.js.map +1 -0
- package/dist/types/core.d.ts +2 -0
- package/dist/types/core.js +68 -0
- package/dist/types/core.js.map +1 -0
- package/dist/types/events/durable.d.ts +2 -0
- package/dist/types/events/durable.js +2 -0
- package/dist/types/events.d.ts +4 -0
- package/dist/types/events.js +90 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/tracing.d.ts +2 -0
- package/dist/types/tracing.js +99 -0
- package/dist/types/tracing.js.map +1 -0
- package/dist/websocket-wire-DvOu_6BJ.d.ts +16773 -0
- package/docs/assets/architecture.svg +106 -0
- package/docs/assets/event-sequence.svg +143 -0
- package/docs/assets/gcp-trace.png +0 -0
- package/docs/message-steering.md +831 -0
- package/docs/releasing.md +57 -0
- package/docs/spec.md +774 -0
- package/docs/subagents.md +725 -0
- package/docs/testing.md +64 -0
- package/docs/ui-projection.md +742 -0
- package/docs/websocket-protocol.md +613 -0
- package/examples/001-no-tools/README.md +65 -0
- package/examples/001-no-tools/worker.ts +79 -0
- package/examples/002-slack-bridge/README.md +134 -0
- package/examples/002-slack-bridge/events.ts +115 -0
- package/examples/002-slack-bridge/reducer.ts +216 -0
- package/examples/002-slack-bridge/scenario.test.ts +223 -0
- package/examples/002-slack-bridge/sinks.ts +109 -0
- package/examples/002-slack-bridge/worker.ts +140 -0
- package/examples/003-sandbox-lifecycle/README.md +78 -0
- package/examples/003-sandbox-lifecycle/events.ts +203 -0
- package/examples/003-sandbox-lifecycle/reducer.ts +305 -0
- package/examples/003-sandbox-lifecycle/scenario.test.ts +202 -0
- package/examples/_shared/event-id.ts +12 -0
- package/examples/_shared/http.ts +27 -0
- package/examples/_shared/openai.ts +33 -0
- package/package.json +181 -0
- package/testing/offline-trace/README.md +63 -0
- package/tooling/oxlint/index.mjs +15 -0
- package/tooling/oxlint/rules/effect-span-from-catalog.mjs +152 -0
- package/tooling/oxlint/rules/span-catalog-format.mjs +74 -0
|
@@ -0,0 +1,468 @@
|
|
|
1
|
+
import { _ as SummaryId, i as ContextVersion, l as InferenceId, m as SequenceNumber, n as CommandId, p as RunId, r as CompactionId, u as MessageId, v as ToolCallId, y as TurnId } from "./core-Hv3cFydL.js";
|
|
2
|
+
import { r as EDACommand, u as UserMessageContent } from "./commands-Ce1ec6kH.js";
|
|
3
|
+
import { n as EDARunTrace, t as EDAEventTrace } from "./tracing-BXHAkxkx.js";
|
|
4
|
+
import { B as SystemPromptText, P as FailurePayload, R as ProviderPartId, U as UsagePayload, V as ToolName } from "./events-Bb9-Cu-7.js";
|
|
5
|
+
import { r as AssistantMessageContent, tt as RecoveryContinuation } from "./durable-DlScwmCy.js";
|
|
6
|
+
import { t as CommittedDurableEvent } from "./session-store-D2Ore1QC.js";
|
|
7
|
+
import * as Prompt from "effect/unstable/ai/Prompt";
|
|
8
|
+
|
|
9
|
+
//#region src/domain/reduced-state.d.ts
|
|
10
|
+
/** Failure payload paired with the durable sequence that recorded it. */
|
|
11
|
+
type LifecycleFailure = {
|
|
12
|
+
readonly seq: SequenceNumber;
|
|
13
|
+
readonly error: FailurePayload;
|
|
14
|
+
};
|
|
15
|
+
/** Terminal command state folded from command lifecycle events. */
|
|
16
|
+
type CommandTerminal = {
|
|
17
|
+
readonly _tag: "Completed";
|
|
18
|
+
readonly seq: SequenceNumber;
|
|
19
|
+
} | {
|
|
20
|
+
readonly _tag: "Failed";
|
|
21
|
+
readonly seq: SequenceNumber;
|
|
22
|
+
readonly error: FailurePayload;
|
|
23
|
+
} | {
|
|
24
|
+
readonly _tag: "Cancelled";
|
|
25
|
+
readonly seq: SequenceNumber;
|
|
26
|
+
readonly reason: string;
|
|
27
|
+
};
|
|
28
|
+
/** Durable command lifecycle projection used for scheduling and recovery. */
|
|
29
|
+
interface CommandRecord {
|
|
30
|
+
readonly commandId: CommandId;
|
|
31
|
+
readonly command?: EDACommand;
|
|
32
|
+
readonly admittedSeq?: SequenceNumber;
|
|
33
|
+
readonly admissionTrace?: EDAEventTrace;
|
|
34
|
+
readonly startedSeq?: SequenceNumber;
|
|
35
|
+
readonly terminal?: CommandTerminal;
|
|
36
|
+
}
|
|
37
|
+
/** Terminal run state folded from run lifecycle events. */
|
|
38
|
+
type RunTerminal = {
|
|
39
|
+
readonly _tag: "Completed";
|
|
40
|
+
readonly seq: SequenceNumber;
|
|
41
|
+
} | {
|
|
42
|
+
readonly _tag: "Failed";
|
|
43
|
+
readonly seq: SequenceNumber;
|
|
44
|
+
readonly error: FailurePayload;
|
|
45
|
+
} | {
|
|
46
|
+
readonly _tag: "Interrupted";
|
|
47
|
+
readonly seq: SequenceNumber;
|
|
48
|
+
readonly reason: string;
|
|
49
|
+
};
|
|
50
|
+
/** Common wall-clock lifecycle timing folded from durable event envelopes. */
|
|
51
|
+
interface LifecycleTiming {
|
|
52
|
+
readonly startedAtMs?: number;
|
|
53
|
+
readonly terminalAtMs?: number;
|
|
54
|
+
readonly durationMs?: number;
|
|
55
|
+
}
|
|
56
|
+
/** Durable run lifecycle projection tying one run to its owning command ids. */
|
|
57
|
+
interface RunRecord extends LifecycleTiming {
|
|
58
|
+
readonly runId: RunId;
|
|
59
|
+
readonly commandIds: ReadonlyArray<CommandId>;
|
|
60
|
+
readonly startedSeq: SequenceNumber;
|
|
61
|
+
readonly trace: EDARunTrace;
|
|
62
|
+
readonly terminal?: RunTerminal;
|
|
63
|
+
}
|
|
64
|
+
/** Terminal turn state folded from turn lifecycle events. */
|
|
65
|
+
type TurnTerminal = {
|
|
66
|
+
readonly _tag: "Completed";
|
|
67
|
+
readonly seq: SequenceNumber;
|
|
68
|
+
readonly usage?: UsagePayload;
|
|
69
|
+
} | {
|
|
70
|
+
readonly _tag: "Failed";
|
|
71
|
+
readonly seq: SequenceNumber;
|
|
72
|
+
readonly error: FailurePayload;
|
|
73
|
+
} | {
|
|
74
|
+
readonly _tag: "Stopped";
|
|
75
|
+
readonly seq: SequenceNumber;
|
|
76
|
+
readonly reason: string;
|
|
77
|
+
};
|
|
78
|
+
/** Durable turn lifecycle projection nested under a run. */
|
|
79
|
+
interface TurnRecord extends LifecycleTiming {
|
|
80
|
+
readonly runId: RunId;
|
|
81
|
+
readonly turnId: TurnId;
|
|
82
|
+
readonly startedSeq: SequenceNumber;
|
|
83
|
+
readonly terminal?: TurnTerminal;
|
|
84
|
+
}
|
|
85
|
+
/** Terminal inference state folded from inference lifecycle events. */
|
|
86
|
+
type InferenceTerminal = {
|
|
87
|
+
readonly _tag: "Completed";
|
|
88
|
+
readonly seq: SequenceNumber;
|
|
89
|
+
readonly usage?: UsagePayload;
|
|
90
|
+
} | {
|
|
91
|
+
readonly _tag: "Failed";
|
|
92
|
+
readonly seq: SequenceNumber;
|
|
93
|
+
readonly error: FailurePayload;
|
|
94
|
+
};
|
|
95
|
+
/** Durable model-inference lifecycle projection nested under a turn. */
|
|
96
|
+
interface InferenceRecord extends LifecycleTiming {
|
|
97
|
+
readonly runId: RunId;
|
|
98
|
+
readonly turnId: TurnId;
|
|
99
|
+
readonly inferenceId: InferenceId;
|
|
100
|
+
readonly startedSeq: SequenceNumber;
|
|
101
|
+
readonly terminal?: InferenceTerminal;
|
|
102
|
+
}
|
|
103
|
+
/** Durable decision produced after a model inference seals final tool calls. */
|
|
104
|
+
type ToolDecision = {
|
|
105
|
+
readonly _tag: "Created";
|
|
106
|
+
readonly seq: SequenceNumber;
|
|
107
|
+
readonly runId: RunId;
|
|
108
|
+
readonly turnId: TurnId;
|
|
109
|
+
readonly inferenceId: InferenceId;
|
|
110
|
+
readonly providerPartId: ProviderPartId;
|
|
111
|
+
readonly toolName: ToolName;
|
|
112
|
+
readonly params: unknown;
|
|
113
|
+
readonly providerExecuted: boolean;
|
|
114
|
+
readonly promptPart?: Prompt.ToolCallPart;
|
|
115
|
+
} | {
|
|
116
|
+
readonly _tag: "Rejected";
|
|
117
|
+
readonly seq: SequenceNumber;
|
|
118
|
+
readonly runId: RunId;
|
|
119
|
+
readonly turnId: TurnId;
|
|
120
|
+
readonly inferenceId: InferenceId;
|
|
121
|
+
readonly providerPartId: ProviderPartId;
|
|
122
|
+
readonly toolName: ToolName;
|
|
123
|
+
readonly reason: "unknown-tool" | "invalid-params";
|
|
124
|
+
readonly modelFeedback: string;
|
|
125
|
+
readonly promptPart?: Prompt.ToolResultPart;
|
|
126
|
+
};
|
|
127
|
+
/** Terminal framework-owned tool-call execution state. */
|
|
128
|
+
type ToolTerminal = {
|
|
129
|
+
readonly _tag: "Completed";
|
|
130
|
+
readonly seq: SequenceNumber;
|
|
131
|
+
readonly result: unknown;
|
|
132
|
+
readonly promptPart?: Prompt.ToolResultPart;
|
|
133
|
+
} | {
|
|
134
|
+
readonly _tag: "Failed";
|
|
135
|
+
readonly seq: SequenceNumber;
|
|
136
|
+
readonly error: FailurePayload;
|
|
137
|
+
readonly promptPart?: Prompt.ToolResultPart;
|
|
138
|
+
};
|
|
139
|
+
/** Durable tool-call projection from decision through execution terminal. */
|
|
140
|
+
interface ToolCallRecord extends LifecycleTiming {
|
|
141
|
+
readonly toolCallId: ToolCallId;
|
|
142
|
+
readonly decision?: ToolDecision;
|
|
143
|
+
readonly startedSeq?: SequenceNumber;
|
|
144
|
+
readonly terminal?: ToolTerminal;
|
|
145
|
+
}
|
|
146
|
+
/** Durable message-like facts folded from the event log. */
|
|
147
|
+
type MessageRecord = {
|
|
148
|
+
readonly _tag: "System";
|
|
149
|
+
readonly messageId: MessageId;
|
|
150
|
+
readonly content: SystemPromptText;
|
|
151
|
+
readonly createdAtMs?: number;
|
|
152
|
+
readonly seq: SequenceNumber;
|
|
153
|
+
} | {
|
|
154
|
+
readonly _tag: "User";
|
|
155
|
+
readonly messageId: MessageId;
|
|
156
|
+
readonly commandId: CommandId;
|
|
157
|
+
readonly content: UserMessageContent;
|
|
158
|
+
readonly createdAtMs?: number;
|
|
159
|
+
readonly seq: SequenceNumber; /** Present for admission-time message entities; absent on legacy committed users. */
|
|
160
|
+
readonly requestedDisposition?: "queue" | "steer";
|
|
161
|
+
readonly disposition?: "queue" | "steer";
|
|
162
|
+
readonly promotedSeq?: SequenceNumber;
|
|
163
|
+
readonly pausedSeq?: SequenceNumber;
|
|
164
|
+
readonly pausedByCommandId?: CommandId;
|
|
165
|
+
readonly consumedSeq?: SequenceNumber;
|
|
166
|
+
readonly consumedTurnId?: TurnId;
|
|
167
|
+
readonly cancelledSeq?: SequenceNumber;
|
|
168
|
+
readonly cancelledByCommandId?: CommandId;
|
|
169
|
+
readonly cancellationReason?: string;
|
|
170
|
+
} | {
|
|
171
|
+
readonly _tag: "Steering";
|
|
172
|
+
readonly messageId: MessageId;
|
|
173
|
+
readonly commandId: CommandId;
|
|
174
|
+
readonly runId: RunId;
|
|
175
|
+
readonly content: UserMessageContent;
|
|
176
|
+
readonly createdAtMs?: number;
|
|
177
|
+
readonly seq: SequenceNumber;
|
|
178
|
+
readonly promotedSeq?: SequenceNumber;
|
|
179
|
+
readonly consumedSeq?: SequenceNumber;
|
|
180
|
+
readonly consumedTurnId?: TurnId;
|
|
181
|
+
readonly cancelledSeq?: SequenceNumber;
|
|
182
|
+
readonly cancelledByCommandId?: CommandId;
|
|
183
|
+
readonly cancellationReason?: string;
|
|
184
|
+
readonly pausedSeq?: SequenceNumber;
|
|
185
|
+
readonly pausedByCommandId?: CommandId;
|
|
186
|
+
} | {
|
|
187
|
+
readonly _tag: "Assistant";
|
|
188
|
+
readonly messageId: MessageId;
|
|
189
|
+
readonly runId: RunId;
|
|
190
|
+
readonly turnId: TurnId;
|
|
191
|
+
readonly inferenceId: InferenceId;
|
|
192
|
+
readonly content: AssistantMessageContent;
|
|
193
|
+
readonly createdAtMs?: number;
|
|
194
|
+
readonly promptParts?: ReadonlyArray<Prompt.AssistantMessagePart>;
|
|
195
|
+
readonly seq: SequenceNumber;
|
|
196
|
+
} | {
|
|
197
|
+
readonly _tag: "AssistantPartial";
|
|
198
|
+
readonly messageId: MessageId;
|
|
199
|
+
readonly runId: RunId;
|
|
200
|
+
readonly turnId: TurnId;
|
|
201
|
+
readonly inferenceId: InferenceId;
|
|
202
|
+
readonly content: AssistantMessageContent;
|
|
203
|
+
readonly createdAtMs?: number;
|
|
204
|
+
readonly promptParts?: ReadonlyArray<Prompt.AssistantMessagePart>;
|
|
205
|
+
readonly reason: string;
|
|
206
|
+
readonly seq: SequenceNumber;
|
|
207
|
+
};
|
|
208
|
+
/** Terminal compaction state folded from compaction lifecycle events. */
|
|
209
|
+
type CompactionTerminal = {
|
|
210
|
+
readonly _tag: "Completed";
|
|
211
|
+
readonly seq: SequenceNumber;
|
|
212
|
+
} | {
|
|
213
|
+
readonly _tag: "Failed";
|
|
214
|
+
readonly seq: SequenceNumber;
|
|
215
|
+
readonly error: FailurePayload;
|
|
216
|
+
};
|
|
217
|
+
/** Durable compaction lifecycle projection and its produced summary cursor. */
|
|
218
|
+
interface CompactionRecord {
|
|
219
|
+
readonly compactionId: CompactionId;
|
|
220
|
+
readonly requestedSeq?: SequenceNumber;
|
|
221
|
+
readonly startedSeq?: SequenceNumber;
|
|
222
|
+
readonly summaryCreatedSeq?: SequenceNumber;
|
|
223
|
+
readonly summaryId?: SummaryId;
|
|
224
|
+
readonly sourceFromSeq?: SequenceNumber;
|
|
225
|
+
readonly sourceToSeq?: SequenceNumber;
|
|
226
|
+
readonly rebasedSeq?: SequenceNumber;
|
|
227
|
+
readonly contextVersion?: ContextVersion;
|
|
228
|
+
readonly terminal?: CompactionTerminal;
|
|
229
|
+
}
|
|
230
|
+
/** Current model-context version and summary selected by compaction. */
|
|
231
|
+
interface ContextRecord {
|
|
232
|
+
readonly version: ContextVersion;
|
|
233
|
+
readonly currentSummaryId?: SummaryId;
|
|
234
|
+
}
|
|
235
|
+
/** Durable StopTurn request and the lifecycle boundary it eventually applied to. */
|
|
236
|
+
interface StopRequestRecord {
|
|
237
|
+
readonly commandId: CommandId;
|
|
238
|
+
readonly requestedSeq: SequenceNumber;
|
|
239
|
+
readonly requestedRunId?: RunId;
|
|
240
|
+
readonly requestedTurnId?: TurnId;
|
|
241
|
+
readonly appliedSeq?: SequenceNumber;
|
|
242
|
+
readonly appliedRunId?: RunId;
|
|
243
|
+
readonly appliedTurnId?: TurnId;
|
|
244
|
+
readonly appliedInferenceId?: InferenceId;
|
|
245
|
+
}
|
|
246
|
+
/** Rolling session totals for provider-reported model token usage. */
|
|
247
|
+
interface TokenUsageTotals {
|
|
248
|
+
readonly inputTokens: number;
|
|
249
|
+
readonly cachedInputTokens: number;
|
|
250
|
+
readonly outputTokens: number;
|
|
251
|
+
readonly textTokens: number;
|
|
252
|
+
readonly reasoningTokens: number;
|
|
253
|
+
}
|
|
254
|
+
/** First-party token consumption metadata folded by the framework reducer. */
|
|
255
|
+
interface TokenConsumptionState {
|
|
256
|
+
readonly total: TokenUsageTotals;
|
|
257
|
+
}
|
|
258
|
+
/** Admitted command that has not yet crossed the `CommandStarted` boundary. */
|
|
259
|
+
interface PendingCommand {
|
|
260
|
+
/** Lifecycle ID for the admitted command. */
|
|
261
|
+
readonly commandId: CommandId;
|
|
262
|
+
/** Typed command payload admitted durably. */
|
|
263
|
+
readonly command: EDACommand;
|
|
264
|
+
/** Admission sequence used for deterministic FIFO/control ordering. */
|
|
265
|
+
readonly admittedSeq: SequenceNumber;
|
|
266
|
+
/** Trace context captured at the durable command admission boundary. */
|
|
267
|
+
readonly admissionTrace?: EDAEventTrace;
|
|
268
|
+
}
|
|
269
|
+
/** Started command without a terminal command boundary, optionally tied to an open run. */
|
|
270
|
+
interface ActiveCommandEvidence {
|
|
271
|
+
readonly commandId: CommandId;
|
|
272
|
+
readonly runId?: RunId;
|
|
273
|
+
}
|
|
274
|
+
/** Active run/turn/inference identity derived from unfinished lifecycle records. */
|
|
275
|
+
type ActiveTurnIdentity = {
|
|
276
|
+
readonly runId: RunId;
|
|
277
|
+
readonly turnId: TurnId;
|
|
278
|
+
readonly inferenceId?: InferenceId;
|
|
279
|
+
};
|
|
280
|
+
/** Canonical durable replay product used by queries, recovery, and scheduling. */
|
|
281
|
+
interface ReducedState {
|
|
282
|
+
readonly lastSeq: SequenceNumber;
|
|
283
|
+
readonly commands: ReadonlyMap<CommandId, CommandRecord>;
|
|
284
|
+
readonly runs: ReadonlyMap<RunId, RunRecord>;
|
|
285
|
+
/** Explicit startup-recovery links keyed by replacement physical run id. */
|
|
286
|
+
readonly recoveryContinuations: ReadonlyMap<RunId, RecoveryContinuationRecord>;
|
|
287
|
+
readonly turns: ReadonlyMap<TurnId, TurnRecord>;
|
|
288
|
+
readonly inferences: ReadonlyMap<InferenceId, InferenceRecord>;
|
|
289
|
+
readonly toolCalls: ReadonlyMap<ToolCallId, ToolCallRecord>;
|
|
290
|
+
readonly messages: ReadonlyMap<MessageId, MessageRecord>;
|
|
291
|
+
readonly stopRequests: ReadonlyMap<CommandId, StopRequestRecord>;
|
|
292
|
+
readonly compactions: ReadonlyMap<CompactionId, CompactionRecord>;
|
|
293
|
+
readonly context: ContextRecord;
|
|
294
|
+
/** Rolling model-token usage totals derived from completed provider inferences. */
|
|
295
|
+
readonly tokenConsumption: TokenConsumptionState;
|
|
296
|
+
/** Materialized scheduler queues derived from the maps above after every fold. */
|
|
297
|
+
readonly commandQueues: CommandQueues;
|
|
298
|
+
}
|
|
299
|
+
/** Durable recovery continuation plus the sequence of its completion barrier. */
|
|
300
|
+
interface RecoveryContinuationRecord extends RecoveryContinuation {
|
|
301
|
+
readonly seq: SequenceNumber;
|
|
302
|
+
}
|
|
303
|
+
/** Unfinished lifecycle records requiring deterministic startup recovery. */
|
|
304
|
+
interface RecoverableWork {
|
|
305
|
+
readonly activeCommands: ReadonlyArray<CommandRecord>;
|
|
306
|
+
readonly activeRuns: ReadonlyArray<RunRecord>;
|
|
307
|
+
readonly activeTurns: ReadonlyArray<TurnRecord>;
|
|
308
|
+
readonly activeInferences: ReadonlyArray<InferenceRecord>;
|
|
309
|
+
readonly openToolCalls: ReadonlyArray<ToolCallRecord>;
|
|
310
|
+
readonly runningToolCalls: ReadonlyArray<ToolCallRecord>;
|
|
311
|
+
readonly pendingStopRequests: ReadonlyArray<StopRequestRecord>;
|
|
312
|
+
readonly openCompactions: ReadonlyArray<CompactionRecord>;
|
|
313
|
+
}
|
|
314
|
+
/** Empty durable replay state before any session event has committed. */
|
|
315
|
+
declare const initialReducedState: ReducedState;
|
|
316
|
+
/** Reserved reducer checkpoint name for the framework-owned `ReducedState`. */
|
|
317
|
+
declare const frameworkReducedStateReducerName = "_eda.framework.reduced-state";
|
|
318
|
+
/** Schema version for the framework-owned `ReducedState` checkpoint payload. */
|
|
319
|
+
declare const frameworkReducedStateReducerSchemaVersion = 4;
|
|
320
|
+
/** JSON payload stored for the framework-owned reduced-state reducer checkpoint. */
|
|
321
|
+
type ReducedStateCheckpointCommandRecord = Omit<CommandRecord, "command">;
|
|
322
|
+
type SystemMessageRecord = Extract<MessageRecord, {
|
|
323
|
+
readonly _tag: "System";
|
|
324
|
+
}>;
|
|
325
|
+
type UserMessageRecord = Extract<MessageRecord, {
|
|
326
|
+
readonly _tag: "User";
|
|
327
|
+
}>;
|
|
328
|
+
type SteeringMessageRecord = Extract<MessageRecord, {
|
|
329
|
+
readonly _tag: "Steering";
|
|
330
|
+
}>;
|
|
331
|
+
type AssistantMessageRecord = Extract<MessageRecord, {
|
|
332
|
+
readonly _tag: "Assistant";
|
|
333
|
+
}>;
|
|
334
|
+
type AssistantPartialMessageRecord = Extract<MessageRecord, {
|
|
335
|
+
readonly _tag: "AssistantPartial";
|
|
336
|
+
}>;
|
|
337
|
+
type ReducedStateCheckpointMessageRecord = Omit<SystemMessageRecord, "content"> | Omit<UserMessageRecord, "content"> | Omit<SteeringMessageRecord, "content"> | Omit<AssistantMessageRecord, "content" | "promptParts"> | Omit<AssistantPartialMessageRecord, "content" | "promptParts">;
|
|
338
|
+
type CreatedToolDecision = Extract<ToolDecision, {
|
|
339
|
+
readonly _tag: "Created";
|
|
340
|
+
}>;
|
|
341
|
+
type RejectedToolDecision = Extract<ToolDecision, {
|
|
342
|
+
readonly _tag: "Rejected";
|
|
343
|
+
}>;
|
|
344
|
+
type CompletedToolTerminal = Extract<ToolTerminal, {
|
|
345
|
+
readonly _tag: "Completed";
|
|
346
|
+
}>;
|
|
347
|
+
type FailedToolTerminal = Extract<ToolTerminal, {
|
|
348
|
+
readonly _tag: "Failed";
|
|
349
|
+
}>;
|
|
350
|
+
type ReducedStateCheckpointToolDecision = Omit<CreatedToolDecision, "params" | "promptPart"> | Omit<RejectedToolDecision, "promptPart">;
|
|
351
|
+
type ReducedStateCheckpointToolTerminal = Omit<CompletedToolTerminal, "result" | "promptPart"> | Omit<FailedToolTerminal, "error" | "promptPart">;
|
|
352
|
+
interface ReducedStateCheckpointToolCallRecord extends Omit<ToolCallRecord, "decision" | "terminal"> {
|
|
353
|
+
readonly decision?: ReducedStateCheckpointToolDecision;
|
|
354
|
+
readonly terminal?: ReducedStateCheckpointToolTerminal;
|
|
355
|
+
}
|
|
356
|
+
interface ReducedStateCheckpointPayload {
|
|
357
|
+
readonly lastSeq: SequenceNumber;
|
|
358
|
+
readonly commands: ReadonlyArray<readonly [CommandId, ReducedStateCheckpointCommandRecord]>;
|
|
359
|
+
readonly runs: ReadonlyArray<readonly [RunId, RunRecord]>;
|
|
360
|
+
readonly recoveryContinuations?: ReadonlyArray<readonly [RunId, RecoveryContinuationRecord]>;
|
|
361
|
+
readonly turns: ReadonlyArray<readonly [TurnId, TurnRecord]>;
|
|
362
|
+
readonly inferences: ReadonlyArray<readonly [InferenceId, InferenceRecord]>;
|
|
363
|
+
readonly toolCalls: ReadonlyArray<readonly [ToolCallId, ReducedStateCheckpointToolCallRecord]>;
|
|
364
|
+
readonly messages: ReadonlyArray<readonly [MessageId, ReducedStateCheckpointMessageRecord]>;
|
|
365
|
+
readonly stopRequests: ReadonlyArray<readonly [CommandId, StopRequestRecord]>;
|
|
366
|
+
readonly compactions: ReadonlyArray<readonly [CompactionId, CompactionRecord]>;
|
|
367
|
+
readonly context: ContextRecord;
|
|
368
|
+
readonly tokenConsumption?: TokenConsumptionState;
|
|
369
|
+
}
|
|
370
|
+
/** Encode the framework reducer state into a pointer-based JSON-safe checkpoint payload. */
|
|
371
|
+
declare const encodeReducedStateCheckpoint: (state: ReducedState) => ReducedStateCheckpointPayload;
|
|
372
|
+
/** Event-log positions required to hydrate a pointer-based framework checkpoint. */
|
|
373
|
+
declare const reducedStateCheckpointEventSeqs: (payload: unknown) => ReadonlyArray<SequenceNumber>;
|
|
374
|
+
/** Decode the framework reducer checkpoint and rebuild derived scheduler queues. */
|
|
375
|
+
declare const decodeReducedStateCheckpoint: (payload: unknown, referencedEvents: ReadonlyArray<CommittedDurableEvent>) => ReducedState;
|
|
376
|
+
/** Fold newly committed durable events into the canonical replay state. */
|
|
377
|
+
declare const foldReducedState: (state: ReducedState, committed: ReadonlyArray<CommittedDurableEvent>) => ReducedState;
|
|
378
|
+
/** Fold committed events from genesis into a fresh `ReducedState`. */
|
|
379
|
+
declare const reduceCommittedEvents: (committed: ReadonlyArray<CommittedDurableEvent>) => ReducedState;
|
|
380
|
+
/** Pending admitted commands in deterministic scheduler order. */
|
|
381
|
+
declare const pendingCommands: (state: ReducedState) => ReadonlyArray<PendingCommand>;
|
|
382
|
+
/** First pending StopTurn control command, when one is waiting. */
|
|
383
|
+
declare const pendingStopCommand: (state: ReducedState) => PendingCommand | undefined;
|
|
384
|
+
/** Currently active command evidence, if any unfinished command is blocking FIFO work. */
|
|
385
|
+
declare const activeCommand: (state: ReducedState) => ActiveCommandEvidence | undefined;
|
|
386
|
+
/** Active run/turn/inference identity owned by a specific active command. */
|
|
387
|
+
declare const activeTurnIdentityForCommand: (state: ReducedState, commandId: CommandId) => ActiveTurnIdentity | undefined;
|
|
388
|
+
/** Classify unfinished durable lifecycles that recovery may need to repair. */
|
|
389
|
+
declare const classifyRecoverableWork: (state: ReducedState) => RecoverableWork;
|
|
390
|
+
//#endregion
|
|
391
|
+
//#region src/domain/command-queues.d.ts
|
|
392
|
+
/**
|
|
393
|
+
* A steering message admitted for an active run but not necessarily consumed
|
|
394
|
+
* by a later turn yet.
|
|
395
|
+
*/
|
|
396
|
+
interface PendingSteeringMessage {
|
|
397
|
+
/** Durable message identity used by `TurnStarted.inputMessageIds` when consumed. */
|
|
398
|
+
readonly messageId: MessageId;
|
|
399
|
+
/** Command that admitted this steering message. */
|
|
400
|
+
readonly commandId: PendingCommand["commandId"];
|
|
401
|
+
/** Active run this steering message may continue. */
|
|
402
|
+
readonly runId: RunId;
|
|
403
|
+
/** User content to append to the next continuation prompt when selected. */
|
|
404
|
+
readonly content: UserMessageContent;
|
|
405
|
+
/** Sequence where `SteeringMessageQueued` committed; used for one-by-one ordering. */
|
|
406
|
+
readonly queuedSeq: SequenceNumber;
|
|
407
|
+
/** Sequence where a later `TurnStarted` consumed this steering message. */
|
|
408
|
+
readonly consumedSeq?: SequenceNumber;
|
|
409
|
+
/** Turn that consumed this steering message. */
|
|
410
|
+
readonly consumedTurnId?: TurnId;
|
|
411
|
+
}
|
|
412
|
+
/**
|
|
413
|
+
* Materialized command scheduler view derived from durable `ReducedState`.
|
|
414
|
+
*
|
|
415
|
+
* `pendingCommands` means admitted commands with no `CommandStarted` yet.
|
|
416
|
+
* `queuedCommands` is the FIFO subset that should wait for idle session work
|
|
417
|
+
* (`SubmitMessage{disposition:"queue"}`). `activeControlCommands` is the
|
|
418
|
+
* subset that may affect an active run (`StopTurn`, `steer`, `interrupt`).
|
|
419
|
+
* `steeringByRun` is not a command queue; it is queued steering content already
|
|
420
|
+
* admitted/completed as commands but not yet consumed by a turn.
|
|
421
|
+
*/
|
|
422
|
+
interface CommandQueues {
|
|
423
|
+
/** Started command without terminal command evidence, plus active run when known. */
|
|
424
|
+
readonly active?: ActiveCommandEvidence;
|
|
425
|
+
/** All admitted commands that have not yet crossed `CommandStarted`. */
|
|
426
|
+
readonly pendingCommands: ReadonlyArray<PendingCommand>;
|
|
427
|
+
/** FIFO user-message work that waits until no command/run is active. */
|
|
428
|
+
readonly queuedCommands: ReadonlyArray<PendingCommand>;
|
|
429
|
+
/** Stop/steer/interrupt work that can be interpreted while a run is active. */
|
|
430
|
+
readonly activeControlCommands: ReadonlyArray<PendingCommand>;
|
|
431
|
+
/** Unconsumed steering messages grouped by target run and sorted by queued seq. */
|
|
432
|
+
readonly steeringByRun: ReadonlyMap<RunId, ReadonlyArray<PendingSteeringMessage>>;
|
|
433
|
+
/** Admission-time queue messages eligible for separate work. */
|
|
434
|
+
readonly pendingQueue: ReadonlyArray<PendingUserMessage>;
|
|
435
|
+
/** Admission-time steer messages eligible at the next boundary. */
|
|
436
|
+
readonly pendingSteers: ReadonlyArray<PendingUserMessage>;
|
|
437
|
+
/** Queue messages held by an explicit interruption pause. */
|
|
438
|
+
readonly pausedQueue: ReadonlyArray<PendingUserMessage>;
|
|
439
|
+
}
|
|
440
|
+
interface PendingUserMessage {
|
|
441
|
+
readonly messageId: MessageId;
|
|
442
|
+
readonly commandId: PendingCommand["commandId"];
|
|
443
|
+
readonly content: UserMessageContent;
|
|
444
|
+
readonly submittedSeq: SequenceNumber;
|
|
445
|
+
readonly effectiveSeq: SequenceNumber;
|
|
446
|
+
readonly disposition: "queue" | "steer";
|
|
447
|
+
readonly targetRunId?: RunId;
|
|
448
|
+
readonly pausedByCommandId?: PendingCommand["commandId"];
|
|
449
|
+
}
|
|
450
|
+
/** Durable records needed to derive `CommandQueues` without services or refs. */
|
|
451
|
+
interface CommandQueueSource {
|
|
452
|
+
readonly commands: ReadonlyMap<PendingCommand["commandId"], CommandRecord>;
|
|
453
|
+
readonly runs: ReadonlyMap<RunId, RunRecord>;
|
|
454
|
+
readonly messages: ReadonlyMap<MessageId, MessageRecord>;
|
|
455
|
+
}
|
|
456
|
+
/** Empty queue view for `initialReducedState` before any durable events exist. */
|
|
457
|
+
declare const emptyCommandQueues: CommandQueues;
|
|
458
|
+
/**
|
|
459
|
+
* Derive scheduler queues from durable replay state.
|
|
460
|
+
*
|
|
461
|
+
* These queues are cached inside `ReducedState` for clarity and fast scheduler
|
|
462
|
+
* reads, but durable command/message/run records remain the source of truth.
|
|
463
|
+
* Never mutate a queue directly; fold durable events and derive again.
|
|
464
|
+
*/
|
|
465
|
+
declare const deriveCommandQueues: (state: CommandQueueSource) => CommandQueues;
|
|
466
|
+
//#endregion
|
|
467
|
+
export { RunTerminal as A, activeTurnIdentityForCommand as B, ReducedStateCheckpointCommandRecord as C, ReducedStateCheckpointToolDecision as D, ReducedStateCheckpointToolCallRecord as E, ToolDecision as F, frameworkReducedStateReducerName as G, decodeReducedStateCheckpoint as H, ToolTerminal as I, pendingCommands as J, frameworkReducedStateReducerSchemaVersion as K, TurnRecord as L, TokenConsumptionState as M, TokenUsageTotals as N, ReducedStateCheckpointToolTerminal as O, ToolCallRecord as P, TurnTerminal as R, ReducedState as S, ReducedStateCheckpointPayload as T, encodeReducedStateCheckpoint as U, classifyRecoverableWork as V, foldReducedState as W, reduceCommittedEvents as X, pendingStopCommand as Y, reducedStateCheckpointEventSeqs as Z, LifecycleTiming as _, deriveCommandQueues as a, RecoverableWork as b, ActiveTurnIdentity as c, CompactionRecord as d, CompactionTerminal as f, LifecycleFailure as g, InferenceTerminal as h, PendingUserMessage as i, StopRequestRecord as j, RunRecord as k, CommandRecord as l, InferenceRecord as m, CommandQueues as n, emptyCommandQueues as o, ContextRecord as p, initialReducedState as q, PendingSteeringMessage as r, ActiveCommandEvidence as s, CommandQueueSource as t, CommandTerminal as u, MessageRecord as v, ReducedStateCheckpointMessageRecord as w, RecoveryContinuationRecord as x, PendingCommand as y, activeCommand as z };
|
|
468
|
+
//# sourceMappingURL=command-queues-CQ9cwRP7.d.ts.map
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as Schema from "effect/Schema";
|
|
2
|
+
|
|
3
|
+
//#region src/types/commands.d.ts
|
|
4
|
+
/** Caller-owned stable retry/correlation key for a submitted command. */
|
|
5
|
+
declare const CommandIdempotencyKey: Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">;
|
|
6
|
+
type CommandIdempotencyKey = typeof CommandIdempotencyKey.Type;
|
|
7
|
+
/** How a submitted user message interacts with an active run. */
|
|
8
|
+
declare const SubmitMessageDisposition: Schema.Literals<readonly ["queue", "steer", "interrupt"]>;
|
|
9
|
+
type SubmitMessageDisposition = typeof SubmitMessageDisposition.Type;
|
|
10
|
+
/** User-authored content parts accepted into the durable command stream. */
|
|
11
|
+
declare const UserMessagePart: Schema.Union<readonly [Schema.Struct<{
|
|
12
|
+
readonly type: Schema.Literal<"text">;
|
|
13
|
+
readonly text: Schema.String;
|
|
14
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
15
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
16
|
+
}>, Schema.Struct<{
|
|
17
|
+
readonly type: Schema.Literal<"file">;
|
|
18
|
+
readonly mediaType: Schema.String;
|
|
19
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
20
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
21
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
22
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
23
|
+
}>]>;
|
|
24
|
+
type UserMessagePart = typeof UserMessagePart.Type;
|
|
25
|
+
/** Non-empty user-authored content, aligned to Effect AI `Prompt.UserMessage` content. */
|
|
26
|
+
declare const UserMessageContent: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
27
|
+
readonly type: Schema.Literal<"text">;
|
|
28
|
+
readonly text: Schema.String;
|
|
29
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
30
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
31
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
32
|
+
readonly type: Schema.Literal<"text">;
|
|
33
|
+
readonly text: Schema.String;
|
|
34
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
35
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
36
|
+
}>, Schema.Struct<{
|
|
37
|
+
readonly type: Schema.Literal<"file">;
|
|
38
|
+
readonly mediaType: Schema.String;
|
|
39
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
40
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
41
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
42
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
43
|
+
}>]>>]>;
|
|
44
|
+
type UserMessageContent = typeof UserMessageContent.Type;
|
|
45
|
+
declare const SubmitMessageCommand_base: Schema.Class<SubmitMessageCommand, Schema.TaggedStruct<"SubmitMessage", {
|
|
46
|
+
readonly disposition: Schema.Literals<readonly ["queue", "steer", "interrupt"]>;
|
|
47
|
+
readonly content: Schema.Union<readonly [Schema.decodeTo<Schema.NonEmptyArray<Schema.toType<Schema.Struct<{
|
|
48
|
+
readonly type: Schema.Literal<"text">;
|
|
49
|
+
readonly text: Schema.String;
|
|
50
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
51
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
52
|
+
}>>>, Schema.String, never, never>, Schema.NonEmptyArray<Schema.Union<readonly [Schema.Struct<{
|
|
53
|
+
readonly type: Schema.Literal<"text">;
|
|
54
|
+
readonly text: Schema.String;
|
|
55
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
56
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
57
|
+
}>, Schema.Struct<{
|
|
58
|
+
readonly type: Schema.Literal<"file">;
|
|
59
|
+
readonly mediaType: Schema.String;
|
|
60
|
+
readonly fileName: Schema.optional<Schema.String>;
|
|
61
|
+
readonly data: Schema.Union<readonly [Schema.String, Schema.Uint8Array, Schema.URL]>;
|
|
62
|
+
readonly "~effect/ai/Prompt/Part": Schema.withDecodingDefaultKey<Schema.Literal<"~effect/ai/Prompt/Part">>;
|
|
63
|
+
readonly options: Schema.withDecodingDefault<Schema.$Record<Schema.String, Schema.NullOr<Schema.Codec<Schema.Json>>>>;
|
|
64
|
+
}>]>>]>;
|
|
65
|
+
readonly expectedPausedMessageIdsToCancel: Schema.optionalKey<Schema.$Array<Schema.brand<Schema.String, "MessageId">>>;
|
|
66
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
67
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
68
|
+
}>, {}>;
|
|
69
|
+
/** Submit a user message to the session command stream. */
|
|
70
|
+
declare class SubmitMessageCommand extends SubmitMessageCommand_base {}
|
|
71
|
+
declare const PendingMessageCancellationReason: Schema.Literals<readonly ["edit", "user-cancel"]>;
|
|
72
|
+
type PendingMessageCancellationReason = typeof PendingMessageCancellationReason.Type;
|
|
73
|
+
declare const CancelPendingMessageCommand_base: Schema.Class<CancelPendingMessageCommand, Schema.TaggedStruct<"CancelPendingMessage", {
|
|
74
|
+
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
75
|
+
readonly reason: Schema.Literals<readonly ["edit", "user-cancel"]>;
|
|
76
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
77
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
78
|
+
}>, {}>;
|
|
79
|
+
declare class CancelPendingMessageCommand extends CancelPendingMessageCommand_base {}
|
|
80
|
+
declare const PromotePendingMessageCommand_base: Schema.Class<PromotePendingMessageCommand, Schema.TaggedStruct<"PromotePendingMessage", {
|
|
81
|
+
readonly messageId: Schema.brand<Schema.String, "MessageId">;
|
|
82
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
83
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
84
|
+
}>, {}>;
|
|
85
|
+
declare class PromotePendingMessageCommand extends PromotePendingMessageCommand_base {}
|
|
86
|
+
declare const ResumePendingMessagesCommand_base: Schema.Class<ResumePendingMessagesCommand, Schema.TaggedStruct<"ResumePendingMessages", {
|
|
87
|
+
readonly messageIds: Schema.NonEmptyArray<Schema.brand<Schema.String, "MessageId">>;
|
|
88
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
89
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
90
|
+
}>, {}>;
|
|
91
|
+
/** Framework-internal owner for restarting unconsumed messages after unexpected failure. */
|
|
92
|
+
declare class ResumePendingMessagesCommand extends ResumePendingMessagesCommand_base {}
|
|
93
|
+
declare const StopTurnCommand_base: Schema.Class<StopTurnCommand, Schema.TaggedStruct<"StopTurn", {
|
|
94
|
+
readonly commandId: Schema.optionalKey<Schema.brand<Schema.String, "CommandId">>;
|
|
95
|
+
readonly idempotencyKey: Schema.optionalKey<Schema.brand<Schema.NonEmptyString, "CommandIdempotencyKey">>;
|
|
96
|
+
}>, {}>;
|
|
97
|
+
/** Request interruption/finalization of the active turn. */
|
|
98
|
+
declare class StopTurnCommand extends StopTurnCommand_base {}
|
|
99
|
+
/** Mutating input accepted by effect-durable-agent before runtime processing. */
|
|
100
|
+
declare const EDACommand: Schema.Union<readonly [typeof SubmitMessageCommand, typeof StopTurnCommand, typeof CancelPendingMessageCommand, typeof PromotePendingMessageCommand, typeof ResumePendingMessagesCommand]>;
|
|
101
|
+
type EDACommand = typeof EDACommand.Type;
|
|
102
|
+
//#endregion
|
|
103
|
+
export { PromotePendingMessageCommand as a, SubmitMessageCommand as c, UserMessagePart as d, PendingMessageCancellationReason as i, SubmitMessageDisposition as l, CommandIdempotencyKey as n, ResumePendingMessagesCommand as o, EDACommand as r, StopTurnCommand as s, CancelPendingMessageCommand as t, UserMessageContent as u };
|
|
104
|
+
//# sourceMappingURL=commands-Ce1ec6kH.d.ts.map
|