@proposit/proposit-core 2.4.0 → 2.4.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.
Files changed (40) hide show
  1. package/dist/lib/conversation/turn.js +1 -1
  2. package/dist/lib/conversation/turn.js.map +1 -1
  3. package/dist/lib/core/expression-manager-checks.d.ts +73 -0
  4. package/dist/lib/core/expression-manager-checks.d.ts.map +1 -0
  5. package/dist/lib/core/expression-manager-checks.js +355 -0
  6. package/dist/lib/core/expression-manager-checks.js.map +1 -0
  7. package/dist/lib/core/expression-manager-dirty-set.d.ts +21 -0
  8. package/dist/lib/core/expression-manager-dirty-set.d.ts.map +1 -0
  9. package/dist/lib/core/expression-manager-dirty-set.js +93 -0
  10. package/dist/lib/core/expression-manager-dirty-set.js.map +1 -0
  11. package/dist/lib/core/expression-manager-invariants.d.ts +14 -0
  12. package/dist/lib/core/expression-manager-invariants.d.ts.map +1 -0
  13. package/dist/lib/core/expression-manager-invariants.js +171 -0
  14. package/dist/lib/core/expression-manager-invariants.js.map +1 -0
  15. package/dist/lib/core/expression-manager.d.ts +2 -3
  16. package/dist/lib/core/expression-manager.d.ts.map +1 -1
  17. package/dist/lib/core/expression-manager.js +18 -523
  18. package/dist/lib/core/expression-manager.js.map +1 -1
  19. package/dist/lib/pipelines/index.d.ts +4 -2
  20. package/dist/lib/pipelines/index.d.ts.map +1 -1
  21. package/dist/lib/pipelines/index.js +2 -1
  22. package/dist/lib/pipelines/index.js.map +1 -1
  23. package/dist/lib/pipelines/llm-stage-helpers.d.ts +126 -0
  24. package/dist/lib/pipelines/llm-stage-helpers.d.ts.map +1 -0
  25. package/dist/lib/pipelines/llm-stage-helpers.js +567 -0
  26. package/dist/lib/pipelines/llm-stage-helpers.js.map +1 -0
  27. package/dist/lib/pipelines/scheduler.d.ts +62 -0
  28. package/dist/lib/pipelines/scheduler.d.ts.map +1 -0
  29. package/dist/lib/pipelines/{execute.js → scheduler.js} +8 -325
  30. package/dist/lib/pipelines/scheduler.js.map +1 -0
  31. package/dist/lib/pipelines/{execute.d.ts → single-stage.d.ts} +2 -22
  32. package/dist/lib/pipelines/{execute.d.ts.map → single-stage.d.ts.map} +1 -1
  33. package/dist/lib/pipelines/single-stage.js +333 -0
  34. package/dist/lib/pipelines/single-stage.js.map +1 -0
  35. package/dist/lib/pipelines/stage-helpers.d.ts +4 -123
  36. package/dist/lib/pipelines/stage-helpers.d.ts.map +1 -1
  37. package/dist/lib/pipelines/stage-helpers.js +28 -567
  38. package/dist/lib/pipelines/stage-helpers.js.map +1 -1
  39. package/package.json +3 -3
  40. package/dist/lib/pipelines/execute.js.map +0 -1
@@ -0,0 +1,333 @@
1
+ // Single-stage / single-finalize entry points, plus the launch/complete
2
+ // split for LLM-background stages.
3
+ //
4
+ // A durable orchestrator (e.g. a server running each stage in its own
5
+ // serverless invocation, persisting typed outputs to a database between
6
+ // stages) needs to run ONE stage — or the finalize — given the upstream
7
+ // stages' persisted outputs AND outcomes, without re-running the whole
8
+ // DAG. `executeStage` and `executeFinalize` are the thin, stateless
9
+ // (state in, state out) entry points for that: they reuse the same
10
+ // `runOneStage` / `runFinalize` bodies the whole-DAG scheduler
11
+ // (`scheduler.ts`) uses.
12
+ import { Value } from "typebox/value";
13
+ import { depId } from "./types.js";
14
+ import { readLlmStageConfig, buildLlmRequest, applyRetrySuffix, validateLlmOutcome, failureRetryReason, } from "./stage-helpers.js";
15
+ import { PipelineConfigurationError, makeStageContext, runOneStage, runFinalize, now, noopEmit, defaultGenerateId, } from "./scheduler.js";
16
+ // Seed a fresh `records` map from the caller-supplied `upstream`,
17
+ // keeping only the entries the consumer (a stage or finalize) actually
18
+ // depends on, and dropping `output` for any non-`completed` record so a
19
+ // caller bug can't leak a stale output into a skipped/failed dependency.
20
+ function seedRecordsFromUpstream(upstream, depIds) {
21
+ const records = new Map();
22
+ for (const id of depIds) {
23
+ const supplied = upstream[id];
24
+ if (!supplied)
25
+ continue;
26
+ if (supplied.outcome === "completed") {
27
+ records.set(id, {
28
+ outcome: "completed",
29
+ output: supplied.output,
30
+ });
31
+ }
32
+ else {
33
+ records.set(id, {
34
+ outcome: supplied.outcome,
35
+ output: undefined,
36
+ });
37
+ }
38
+ }
39
+ return records;
40
+ }
41
+ // Shared run-state builder for the single-shot entry points. The
42
+ // `setConfigError` disposition differs from the whole-DAG scheduler's:
43
+ // a `ctx.get`-on-non-dep error throws straight out of the entry point
44
+ // (there are no run-level bookends to emit first), so it is surfaced
45
+ // directly to the caller as the caller bug it is.
46
+ function buildSingleShotState(upstream, depIds, input, deps) {
47
+ return {
48
+ records: seedRecordsFromUpstream(upstream, depIds),
49
+ failures: [],
50
+ signal: deps.signal ?? new AbortController().signal,
51
+ emit: deps.onEvent ?? noopEmit,
52
+ generateId: deps.generateId ?? defaultGenerateId,
53
+ llm: deps.llm,
54
+ input,
55
+ setConfigError: (error) => {
56
+ throw error;
57
+ },
58
+ };
59
+ }
60
+ /**
61
+ * Run a single stage of `pipeline` against the caller-supplied upstream
62
+ * records, without re-running the whole DAG. The upstream map carries
63
+ * each dependency's `{ outcome, output? }` so `ctx.get` / `ctx.stageStatus`
64
+ * reproduce monolithic-run semantics exactly. `input` is validated +
65
+ * transformed via `Value.Parse(pipeline.inputSchema, input)` (a schema
66
+ * mismatch throws, same as `executePipeline`) and the PARSED value seeds
67
+ * `ctx.input`.
68
+ *
69
+ * Emits the per-stage events only (`stage:start`, `stage:llm-request`,
70
+ * `stage:llm-response-created`, `stage:llm-call`, `stage:retry`,
71
+ * `stage:end`) — no `pipeline:*` bookends. Throws `PipelineConfigurationError`
72
+ * (`UNKNOWN_STAGE`) when `stageId` is not in `pipeline.stages`, and throws a
73
+ * `PipelineConfigurationError` (`GET_OUTSIDE_DEPS` / `STATUS_OUTSIDE_DEPS`)
74
+ * out directly when the stage reads a non-dependency — both are caller
75
+ * bugs, surfaced rather than swallowed into the result.
76
+ *
77
+ * The caller may pass a superset of `upstream` records; `executeStage`
78
+ * uses the stage's own `dependsOn` to pick the relevant ones. It does NOT
79
+ * decide whether the stage SHOULD run given its upstream outcomes — a
80
+ * required-failed upstream just means `ctx.get` returns `undefined`; the
81
+ * skip decision belongs to the caller's scheduler.
82
+ */
83
+ export async function executeStage(pipeline, stageId, upstream, input, deps) {
84
+ const stage = pipeline.stages.find((s) => s.id === stageId);
85
+ if (!stage) {
86
+ throw new PipelineConfigurationError({
87
+ code: "UNKNOWN_STAGE",
88
+ message: `Pipeline "${pipeline.id}" has no stage "${stageId}".`,
89
+ stageId,
90
+ });
91
+ }
92
+ // Input-validation parity with `executePipeline`: parse + seed the
93
+ // PARSED (Default/Convert/Clean-transformed) value into ctx.input.
94
+ const parsedInput = Value.Parse(pipeline.inputSchema, input);
95
+ const depIds = new Set(stage.dependsOn.map((d) => depId(d)));
96
+ const state = buildSingleShotState(upstream, depIds, parsedInput, deps);
97
+ const ctx = makeStageContext(state, depIds, stage.id);
98
+ await runOneStage(stage, ctx, state);
99
+ const record = state.records.get(stage.id);
100
+ const outcome = record?.outcome ?? "skipped";
101
+ const result = {
102
+ outcome,
103
+ failures: state.failures,
104
+ };
105
+ if (outcome === "completed") {
106
+ result.output = record?.output;
107
+ if (record?.tokenUsage !== undefined) {
108
+ result.tokenUsage = record.tokenUsage;
109
+ }
110
+ }
111
+ return result;
112
+ }
113
+ /**
114
+ * Run `pipeline.finalize` against the caller-supplied upstream records,
115
+ * without re-running the whole DAG. Symmetric with `executeStage`:
116
+ * `input` is parsed via `Value.Parse(pipeline.inputSchema, input)` and the
117
+ * PARSED value seeds the finalize `ctx.input`; the finalize `ctx` is built
118
+ * with `pipeline.finalize.dependsOn` as its allowed-dep set; the
119
+ * required-finalize-dep gate (`output` stays `null` if any required dep is
120
+ * not `completed`) and the `FINALIZE_UNCAUGHT_ERROR` capture match
121
+ * `executePipeline`.
122
+ *
123
+ * Emits NO events (finalize is not a stage — it has no `stage:*`
124
+ * lifecycle — and there are no `pipeline:*` bookends). `async` purely for
125
+ * signature symmetry with `executeStage`; `TPipelineFinalize.run` stays
126
+ * synchronous and the `async` wrapper just resolves its result.
127
+ */
128
+ // `async` is deliberate (a Promise-returning signature symmetric with
129
+ // `executeStage`, so callers `await` both uniformly) even though the
130
+ // synchronous finalize body has nothing to await — the eslint
131
+ // require-await rule does not apply here.
132
+ // eslint-disable-next-line @typescript-eslint/require-await
133
+ export async function executeFinalize(pipeline, upstream, input, deps) {
134
+ // Input-validation parity with `executePipeline` (see `executeStage`).
135
+ const parsedInput = Value.Parse(pipeline.inputSchema, input);
136
+ const depIds = new Set(pipeline.finalize.dependsOn.map((d) => depId(d)));
137
+ // Finalize emits no events, so swallow any caller-supplied onEvent.
138
+ const state = buildSingleShotState(upstream, depIds, parsedInput, {
139
+ ...deps,
140
+ onEvent: undefined,
141
+ });
142
+ const ctx = makeStageContext(state, depIds, "finalize");
143
+ const output = runFinalize(pipeline, ctx, state);
144
+ return { output, failures: state.failures };
145
+ }
146
+ // -- Launch / complete split for LLM-background stages -------------------
147
+ //
148
+ // A durable orchestrator (e.g. a server workflow) cannot block a single
149
+ // step for an LLM call's full duration. `launchStage` submits the
150
+ // background response and returns its `responseId` WITHOUT awaiting;
151
+ // `completeStage` — in a later invocation, after the response completed —
152
+ // validates the retrieved response into a `TExecuteStageResult`. Both
153
+ // reuse the package-internal `llmStage` seam (`buildLlmRequest` /
154
+ // `validateLlmOutcome`) so prompt assembly + output validation have a
155
+ // single implementation shared with the in-process `llmStage` loop.
156
+ // Resolve the LLM config carried by an `llmStage`-built stage, or throw a
157
+ // clear error when the looked-up stage is not an LLM stage (no carrier).
158
+ function requireLlmStage(pipeline, stageId, fnName) {
159
+ const stage = pipeline.stages.find((s) => s.id === stageId);
160
+ if (!stage) {
161
+ throw new PipelineConfigurationError({
162
+ code: "UNKNOWN_STAGE",
163
+ message: `Pipeline "${pipeline.id}" has no stage "${stageId}".`,
164
+ stageId,
165
+ });
166
+ }
167
+ const cfg = readLlmStageConfig(stage);
168
+ if (!cfg) {
169
+ throw new PipelineConfigurationError({
170
+ code: "UNKNOWN_STAGE",
171
+ message: `${fnName} requires an LLM stage, but stage "${stageId}" in pipeline "${pipeline.id}" is not one (it carries no LLM config). Run deterministic stages via executeStage.`,
172
+ stageId,
173
+ });
174
+ }
175
+ return { stage, cfg };
176
+ }
177
+ /**
178
+ * Launch an LLM-background stage: rehydrate `ctx` from `upstream` +
179
+ * parsed input, build the request via the shared seam, submit it via the
180
+ * injected `deps.submitBackgroundResponse`, and return
181
+ * `{ responseId, status }` WITHOUT awaiting completion.
182
+ *
183
+ * Emits `stage:start`, `stage:llm-request`, and `stage:llm-response-created`
184
+ * (from the submit's returned id) — but NO `stage:llm-call` / `stage:end`
185
+ * (the completion side emits those, in a later invocation). The
186
+ * per-stage event pair therefore spans two invocations; an `onEvent`
187
+ * consumer must NOT assume a balanced start↔end per call.
188
+ *
189
+ * `deps.submitBackgroundResponse` is REQUIRED; `launchStage` throws if it
190
+ * is absent. `stageId` must name an LLM stage (built by `llmStage`);
191
+ * a non-LLM stage throws. `attempt` (default 1) lets a re-launch rebuild
192
+ * the retry-suffixed user message for attempt 2+.
193
+ */
194
+ export async function launchStage(pipeline, stageId, upstream, input, deps, attempt = 1) {
195
+ const submit = deps.submitBackgroundResponse;
196
+ if (!submit) {
197
+ throw new PipelineConfigurationError({
198
+ code: "UNKNOWN_STAGE",
199
+ message: `launchStage requires deps.submitBackgroundResponse (the submit-only background-response capability), but it was not supplied.`,
200
+ stageId,
201
+ });
202
+ }
203
+ const { stage, cfg } = requireLlmStage(pipeline, stageId, "launchStage");
204
+ // Input-validation parity: parse + seed the parsed ctx.input. The
205
+ // stage's `ctx` reads its own dependsOn as allowed deps.
206
+ const parsedInput = Value.Parse(pipeline.inputSchema, input);
207
+ const allowedDeps = new Set(stage.dependsOn.map((d) => depId(d)));
208
+ const state = buildSingleShotState(upstream, allowedDeps, parsedInput, deps);
209
+ const ctx = makeStageContext(state, allowedDeps, stageId);
210
+ // Compute the per-attempt user message. Attempt 1 is the prompt's
211
+ // user message; attempt 2+ appends the same retry-suffix the
212
+ // in-process loop adds after a schema-validation failure (the shared
213
+ // `applyRetrySuffix` helper). The exact prior-attempt validation
214
+ // error does not cross the durable suspend, so the re-launch suffix
215
+ // carries a generic prior-error note — the wrapper text matches the
216
+ // in-process loop's phrasing.
217
+ const baseUser = cfg.buildPrompt(ctx).user;
218
+ const userMessage = attempt > 1
219
+ ? applyRetrySuffix(baseUser, "the previous attempt's output did not conform to the schema", cfg.retryPolicy.maxAppendedErrorBytes ?? 2048)
220
+ : baseUser;
221
+ const { req } = buildLlmRequest(cfg, ctx, userMessage);
222
+ state.emit({ kind: "stage:start", stageId, at: now() });
223
+ state.emit({
224
+ kind: "stage:llm-request",
225
+ stageId,
226
+ attempt,
227
+ prompts: { system: req.systemPrompt, user: req.userMessage },
228
+ at: now(),
229
+ });
230
+ // The req is already TLlmRequest<unknown> (the recovered config is
231
+ // generic-erased at the lookup boundary); the typed output is
232
+ // recovered in completeStage via the stage's outputSchema.
233
+ const submitResult = await submit(req, {
234
+ apiKey: resolveApiKey(deps),
235
+ signal: deps.signal,
236
+ });
237
+ state.emit({
238
+ kind: "stage:llm-response-created",
239
+ stageId,
240
+ attempt,
241
+ responseId: submitResult.responseId,
242
+ at: now(),
243
+ });
244
+ return submitResult;
245
+ }
246
+ /**
247
+ * Complete an LLM-background stage from its retrieved response. Recovers
248
+ * the stage's LLM config, parses the RAW assistant text in
249
+ * `retrieved.output` against the stage's schema (via the shared seam),
250
+ * classifies a non-`completed` status per the launch/complete table, and
251
+ * returns the standard `TExecuteStageResult`.
252
+ *
253
+ * Emits `stage:llm-call` + `stage:end` (NO `stage:start` — that fired in
254
+ * the launch invocation). `tokenUsage` is taken directly from
255
+ * `retrieved.tokenUsage` (the per-`ctx` WeakMap cannot bridge the two
256
+ * invocations). On a RETRYABLE failure the result carries `retryReason`
257
+ * (the reason code); a fail-fast failure (`failed` envelope,
258
+ * `content_filter`) carries none; a `cancelled` response settles as
259
+ * `outcome: "skipped"` with no `ProcessingFailure`.
260
+ *
261
+ * `stageId` must name an LLM stage; a non-LLM stage throws.
262
+ */
263
+ // eslint-disable-next-line @typescript-eslint/require-await
264
+ export async function completeStage(pipeline, stageId, retrieved, deps, attempt = 1) {
265
+ const { cfg } = requireLlmStage(pipeline, stageId, "completeStage");
266
+ const emit = deps.onEvent ?? noopEmit;
267
+ const validated = validateLlmOutcome(cfg, retrieved.output, retrieved.status, retrieved.incompleteReason);
268
+ // The output shown on stage:llm-call is the parsed value when the
269
+ // response parsed + validated; otherwise the raw assistant text (so a
270
+ // consumer's bridge can persist whatever the model returned).
271
+ const callOutput = validated.output !== undefined ? validated.output : retrieved.output;
272
+ emit({
273
+ kind: "stage:llm-call",
274
+ stageId,
275
+ attempt,
276
+ prompts: { system: "", user: "" },
277
+ output: callOutput,
278
+ tokenUsage: retrieved.tokenUsage ?? { input: 0, output: 0 },
279
+ rawResponseId: retrieved.rawResponseId,
280
+ validationError: validated.validationError,
281
+ at: now(),
282
+ });
283
+ const failures = [];
284
+ let retryReason;
285
+ if (validated.outcome === "failed" && validated.failure) {
286
+ // A cancelled response settled as `skipped` above (no failure);
287
+ // only genuine failures push a ProcessingFailure.
288
+ failures.push({
289
+ stage: stageId,
290
+ code: validated.failure.code,
291
+ message: validated.failure.message,
292
+ severity: "error",
293
+ });
294
+ retryReason = failureRetryReason(validated.failure);
295
+ }
296
+ const stageEndEvent = retrieved.tokenUsage !== undefined
297
+ ? {
298
+ kind: "stage:end",
299
+ stageId,
300
+ status: validated.outcome,
301
+ tokenUsage: retrieved.tokenUsage,
302
+ at: now(),
303
+ }
304
+ : {
305
+ kind: "stage:end",
306
+ stageId,
307
+ status: validated.outcome,
308
+ at: now(),
309
+ };
310
+ emit(stageEndEvent);
311
+ const result = {
312
+ outcome: validated.outcome,
313
+ failures,
314
+ };
315
+ if (validated.outcome === "completed") {
316
+ result.output = validated.output;
317
+ }
318
+ if (retrieved.tokenUsage !== undefined) {
319
+ result.tokenUsage = retrieved.tokenUsage;
320
+ }
321
+ if (retryReason !== undefined) {
322
+ result.retryReason = retryReason;
323
+ }
324
+ return result;
325
+ }
326
+ // API-key resolution for the submit dep. The injected
327
+ // `submitBackgroundResponse` is apiKey-bound by the consumer, so core
328
+ // passes an empty key — the bound capability ignores it. (Kept as a seam
329
+ // in case a future dep shape threads the key through deps.)
330
+ function resolveApiKey(_deps) {
331
+ return "";
332
+ }
333
+ //# sourceMappingURL=single-stage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"single-stage.js","sourceRoot":"","sources":["../../../src/lib/pipelines/single-stage.ts"],"names":[],"mappings":"AAAA,wEAAwE;AACxE,mCAAmC;AACnC,EAAE;AACF,sEAAsE;AACtE,wEAAwE;AACxE,wEAAwE;AACxE,uEAAuE;AACvE,oEAAoE;AACpE,mEAAmE;AACnE,+DAA+D;AAC/D,yBAAyB;AAEzB,OAAO,EAAE,KAAK,EAAE,MAAM,eAAe,CAAA;AAQrC,OAAO,EAAE,KAAK,EAAE,MAAM,YAAY,CAAA;AAClC,OAAO,EACH,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,GACrB,MAAM,oBAAoB,CAAA;AAE3B,OAAO,EACH,0BAA0B,EAC1B,gBAAgB,EAChB,WAAW,EACX,WAAW,EACX,GAAG,EACH,QAAQ,EACR,iBAAiB,GACpB,MAAM,gBAAgB,CAAA;AA0GvB,kEAAkE;AAClE,uEAAuE;AACvE,wEAAwE;AACxE,yEAAyE;AACzE,SAAS,uBAAuB,CAC5B,QAAuD,EACvD,MAAmB;IAEnB,MAAM,OAAO,GAAG,IAAI,GAAG,EAAwB,CAAA;IAC/C,KAAK,MAAM,EAAE,IAAI,MAAM,EAAE,CAAC;QACtB,MAAM,QAAQ,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAA;QAC7B,IAAI,CAAC,QAAQ;YAAE,SAAQ;QACvB,IAAI,QAAQ,CAAC,OAAO,KAAK,WAAW,EAAE,CAAC;YACnC,OAAO,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,7 @@
1
1
  import type { TSchema } from "typebox";
2
2
  import type { TDepSpec, TPipeline, TStage, TStageContext } from "./types.js";
3
- import type { TLlmRequest, TReasoningEffort, TResponseStatus, TToolSpec } from "../llm/types.js";
3
+ export { readLlmStageConfig, isLlmStage, applyRetrySuffix, buildLlmRequest, validateLlmOutcome, failureRetryReason, llmStage, LlmStageRetryExhaustedError, } from "./llm-stage-helpers.js";
4
+ export type { TLlmStageConfig } from "./llm-stage-helpers.js";
4
5
  export declare function deterministicStage<TOutput>(config: {
5
6
  id: string;
6
7
  dependsOn: readonly TDepSpec[];
@@ -32,6 +33,8 @@ export declare class StageAbortedError extends Error {
32
33
  message?: string;
33
34
  });
34
35
  }
36
+ export declare function stashTokenUsage(ctx: TStageContext, stageId: string, usage: import("../llm/types.js").TLlmTokenUsage): void;
37
+ export declare function readStashedTokenUsage(ctx: TStageContext, stageId: string): import("../llm/types.js").TLlmTokenUsage | undefined;
35
38
  /**
36
39
  * Thrown by `subPipelineStage`'s wrapper when the nested pipeline
37
40
  * returns `output: null` (any required dep of its finalize was
@@ -52,128 +55,6 @@ export declare class SubPipelineFailedError extends Error {
52
55
  context?: Record<string, unknown>;
53
56
  });
54
57
  }
55
- /**
56
- * Thrown internally by `llmStage` after retry exhaustion. The
57
- * executor catches it and converts it into a `ProcessingFailure`.
58
- */
59
- export declare class LlmStageRetryExhaustedError extends Error {
60
- readonly reason: TRetryReason;
61
- readonly code: string;
62
- readonly attempts: number;
63
- readonly stageId: string;
64
- readonly failureContext: Record<string, unknown> | undefined;
65
- constructor(args: {
66
- stageId: string;
67
- reason: TRetryReason;
68
- code: string;
69
- attempts: number;
70
- message: string;
71
- context?: Record<string, unknown>;
72
- });
73
- }
74
- /**
75
- * The resolved `llmStage` config the seam functions operate on (defaults
76
- * merged into `retryPolicy`). Package-internal — not exported.
77
- */
78
- export type TLlmStageConfig<TOutput> = {
79
- id: string;
80
- outputSchema: TSchema;
81
- model: string;
82
- reasoningEffort?: TReasoningEffort;
83
- buildPrompt: (ctx: TStageContext) => {
84
- system: string;
85
- user: string;
86
- };
87
- tools?: readonly TToolSpec[];
88
- maxOutputTokens?: number;
89
- /** The resolved retry policy (factory defaults already merged). */
90
- retryPolicy: TRetryPolicy;
91
- /**
92
- * Phantom field carrying the stage's structured-output type `TOutput`
93
- * through the seam (so `buildLlmRequest` / `validateLlmOutcome` recover
94
- * it). Always `undefined` at runtime.
95
- */
96
- _outputTypeMarker?: TOutput;
97
- };
98
- /**
99
- * Recover the resolved `llmStage` config from a stage built by
100
- * `llmStage`. Returns `undefined` for any stage that is not an LLM stage
101
- * (a deterministic / sub-pipeline stage carries no config). Package-internal.
102
- */
103
- export declare function readLlmStageConfig<TOutput>(stage: TStage<TOutput>): TLlmStageConfig<TOutput> | undefined;
104
- /**
105
- * True iff `stage` is an LLM-background stage — one built by `llmStage` that
106
- * carries the resolved LLM config and is therefore driven by `launchStage` /
107
- * `completeStage`. False for deterministic and sub-pipeline stages (drive those
108
- * with `executeStage`). Mirrors exactly the check `launchStage`/`completeStage`
109
- * apply internally, so a consumer driving a pipeline out-of-process can route a
110
- * stage to the right driver without catching a thrown `PipelineConfigurationError`.
111
- */
112
- export declare function isLlmStage<TOutput>(stage: TStage<TOutput>): boolean;
113
- /**
114
- * Append the retry-suffix the in-process loop adds after a failed
115
- * schema-validation attempt. Shared by the loop and `launchStage` (so a
116
- * re-launched attempt 2+ rebuilds the identical `userMessage`).
117
- * Package-internal.
118
- */
119
- export declare function applyRetrySuffix(baseUser: string, validationError: string, errorCap: number): string;
120
- /**
121
- * Front half of the seam: build the per-attempt prompts + `TLlmRequest`.
122
- * `userMessage` overrides the prompt's user message (the loop / launch
123
- * pass the retry-suffixed message on attempt 2+); it defaults to
124
- * `buildPrompt(ctx).user`. The returned `req` carries NO `onResponseCreated`
125
- * — the in-process loop attaches its own emitter; the launch path uses the
126
- * submit return value instead. Package-internal.
127
- */
128
- export declare function buildLlmRequest<TOutput>(cfg: TLlmStageConfig<TOutput>, ctx: TStageContext, userMessage?: string): {
129
- req: TLlmRequest<TOutput>;
130
- prompts: {
131
- system: string;
132
- user: string;
133
- };
134
- };
135
- /**
136
- * Back half of the seam: turn a retrieved background response (RAW
137
- * assistant text + terminal status + `incompleteReason`) into an outcome
138
- * + optional typed output + a retry classification.
139
- *
140
- * The parse + `Value.Check` half is genuinely shared with the in-process
141
- * loop (via `checkLlmOutput`). The status/reason → outcome+retry mapping
142
- * is a DELIBERATE `lib/`-side MIRROR of the OpenAI provider's
143
- * classification (`extensions/openai/provider.ts`): `src/lib/` may not
144
- * import the extension classifier (the zero-SDK-import invariant), so the
145
- * mapping is duplicated here and pinned to the provider by a contract test.
146
- * Package-internal.
147
- */
148
- export declare function validateLlmOutcome<TOutput>(cfg: TLlmStageConfig<TOutput>, rawText: string | undefined, status: TResponseStatus, incompleteReason: string | undefined): {
149
- outcome: "completed" | "failed" | "skipped";
150
- output?: TOutput;
151
- failure?: {
152
- reason: TRetryReason;
153
- code: string;
154
- message: string;
155
- };
156
- validationError?: string;
157
- };
158
- export declare function failureRetryReason(failure: {
159
- reason: TRetryReason;
160
- code: string;
161
- }): TRetryReason | undefined;
162
- export declare function llmStage<TOutput>(config: {
163
- id: string;
164
- dependsOn: readonly TDepSpec[];
165
- outputSchema: TSchema;
166
- model: string;
167
- reasoningEffort?: TReasoningEffort;
168
- buildPrompt: (ctx: TStageContext) => {
169
- system: string;
170
- user: string;
171
- };
172
- tools?: readonly TToolSpec[];
173
- retry?: Partial<TRetryPolicy>;
174
- maxOutputTokens?: number;
175
- }): TStage<TOutput>;
176
- export declare function readStashedTokenUsage(ctx: TStageContext, stageId: string): import("../llm/types.js").TLlmTokenUsage | undefined;
177
58
  export declare function subPipelineStage<TOutput>(config: {
178
59
  id: string;
179
60
  dependsOn: readonly TDepSpec[];
@@ -1 +1 @@
1
- {"version":3,"file":"stage-helpers.d.ts","sourceRoot":"","sources":["../../../src/lib/pipelines/stage-helpers.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,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