@noetic-tools/types 3.5.0 → 3.6.0

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.
@@ -47,23 +47,32 @@ export type UntilPredicate = {
47
47
  export declare const UntilPredicateSchema: z.ZodType<UntilPredicate>;
48
48
  /** @public ESM literal enum for merge strategies. */
49
49
  export declare const MergeStrategy: {
50
- readonly Last: 'last';
51
- readonly First: 'first';
52
- readonly Concat: 'concat';
50
+ readonly Last: "last";
51
+ readonly First: "first";
52
+ readonly Concat: "concat";
53
53
  };
54
54
  /** @public Named merge strategy for inParallel nodes. */
55
55
  export type MergeStrategy = (typeof MergeStrategy)[keyof typeof MergeStrategy];
56
56
  /** @public Zod schema for the named merge strategy used by `inParallel` nodes. */
57
57
  export declare const MergeStrategySchema: z.ZodEnum<{
58
58
  concat: "concat";
59
- first: "first";
60
59
  last: "last";
60
+ first: "first";
61
61
  }>;
62
62
  declare const ModelParamsSchema: z.ZodObject<{
63
63
  temperature: z.ZodOptional<z.ZodNumber>;
64
64
  topP: z.ZodOptional<z.ZodNumber>;
65
65
  maxTokens: z.ZodOptional<z.ZodNumber>;
66
66
  stopSequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
67
+ serviceTier: z.ZodOptional<z.ZodEnum<{
68
+ readonly Auto: "auto";
69
+ readonly Default: "default";
70
+ readonly Fast: "fast";
71
+ readonly Flex: "flex";
72
+ readonly Priority: "priority";
73
+ readonly Scale: "scale";
74
+ readonly Ultrafast: "ultrafast";
75
+ }>>;
67
76
  }, z.core.$strip>;
68
77
  /**
69
78
  * A uniform tool entry on a `callModel` node. Every entry is an object keyed by
@@ -87,9 +96,9 @@ declare const CallModelToolEntrySchema: z.ZodObject<{
87
96
  declare const RetryPolicySchema: z.ZodObject<{
88
97
  maxAttempts: z.ZodNumber;
89
98
  backoff: z.ZodEnum<{
90
- exponential: "exponential";
91
99
  fixed: "fixed";
92
100
  linear: "linear";
101
+ exponential: "exponential";
93
102
  }>;
94
103
  initialDelay: z.ZodNumber;
95
104
  maxDelay: z.ZodOptional<z.ZodNumber>;
@@ -97,36 +106,36 @@ declare const RetryPolicySchema: z.ZodObject<{
97
106
  declare const AcpPermissionPolicySchema: z.ZodObject<{
98
107
  default: z.ZodOptional<z.ZodEnum<{
99
108
  allow: "allow";
100
- cancel: "cancel";
101
109
  deny: "deny";
110
+ cancel: "cancel";
102
111
  }>>;
103
112
  allow: z.ZodOptional<z.ZodArray<z.ZodObject<{
104
113
  kind: z.ZodOptional<z.ZodEnum<{
114
+ read: "read";
105
115
  delete: "delete";
106
- edit: "edit";
116
+ search: "search";
107
117
  execute: "execute";
108
- fetch: "fetch";
118
+ edit: "edit";
109
119
  move: "move";
110
- other: "other";
111
- read: "read";
112
- search: "search";
113
- switch_mode: "switch_mode";
114
120
  think: "think";
121
+ fetch: "fetch";
122
+ switch_mode: "switch_mode";
123
+ other: "other";
115
124
  }>>;
116
125
  title: z.ZodOptional<z.ZodString>;
117
126
  }, z.core.$strip>>>;
118
127
  deny: z.ZodOptional<z.ZodArray<z.ZodObject<{
119
128
  kind: z.ZodOptional<z.ZodEnum<{
129
+ read: "read";
120
130
  delete: "delete";
121
- edit: "edit";
131
+ search: "search";
122
132
  execute: "execute";
123
- fetch: "fetch";
133
+ edit: "edit";
124
134
  move: "move";
125
- other: "other";
126
- read: "read";
127
- search: "search";
128
- switch_mode: "switch_mode";
129
135
  think: "think";
136
+ fetch: "fetch";
137
+ switch_mode: "switch_mode";
138
+ other: "other";
130
139
  }>>;
131
140
  title: z.ZodOptional<z.ZodString>;
132
141
  }, z.core.$strip>>>;
@@ -166,14 +175,19 @@ declare const AcpMcpServerSchema: z.ZodUnion<readonly [z.ZodObject<{
166
175
  declare const AcpSessionPolicySchema: z.ZodObject<{
167
176
  reuse: z.ZodOptional<z.ZodString>;
168
177
  keepAlive: z.ZodOptional<z.ZodEnum<{
169
- harness: "harness";
170
- run: "run";
171
178
  step: "step";
179
+ run: "run";
180
+ harness: "harness";
172
181
  }>>;
173
182
  load: z.ZodOptional<z.ZodString>;
174
183
  }, z.core.$strip>;
175
184
  interface WorkflowNodeBase {
176
185
  id: string;
186
+ /**
187
+ * Whether a resumed run replays this node's recorded output. Defaults to `true`;
188
+ * `false` makes the node run again on every resume. See spec 23a § Identity.
189
+ */
190
+ durable?: boolean;
177
191
  }
178
192
  /**
179
193
  * A reference to a streaming `OutputCodec` for a `callModel` node's structured
@@ -9,6 +9,7 @@
9
9
  * document back into live `Step` objects via the existing builders.
10
10
  */
11
11
  import { z } from 'zod';
12
+ import { ServiceTier } from '../types/common.js';
12
13
  import { DecideQuestionsSchema, routeOutcomes } from '../types/decide.js';
13
14
  //#endregion
14
15
  //#region Until Predicate Schemas
@@ -90,6 +91,7 @@ const ModelParamsSchema = z.object({
90
91
  topP: z.number().min(0).max(1).optional(),
91
92
  maxTokens: z.number().int().positive().optional(),
92
93
  stopSequences: z.array(z.string()).optional(),
94
+ serviceTier: z.enum(ServiceTier).optional(),
93
95
  });
94
96
  //#endregion
95
97
  //#region Tool Entries
@@ -209,6 +211,7 @@ const AcpSessionPolicySchema = z.object({
209
211
  const WorkflowNodeRef = z.lazy(() => WorkflowNodeSchema);
210
212
  const SHARED_FIELDS = {
211
213
  id: z.string().min(1),
214
+ durable: z.boolean().optional(),
212
215
  };
213
216
  const OutputCodecRefSchema = z.object({
214
217
  codec: z.literal('openui'),
@@ -66,9 +66,9 @@ export interface AcpTransportOptions {
66
66
  export type AcpTransportFactory = (opts: AcpTransportOptions) => Promise<AcpTransport>;
67
67
  /** @public How a permission request was resolved. */
68
68
  export declare const AcpPermissionDecision: {
69
- readonly Allow: 'allow';
70
- readonly Deny: 'deny';
71
- readonly Cancel: 'cancel';
69
+ readonly Allow: "allow";
70
+ readonly Deny: "deny";
71
+ readonly Cancel: "cancel";
72
72
  };
73
73
  /** @public Union of permission decisions. */
74
74
  export type AcpPermissionDecision = (typeof AcpPermissionDecision)[keyof typeof AcpPermissionDecision];
@@ -416,11 +416,11 @@ export interface AcpAgent {
416
416
  */
417
417
  export declare const AcpKeepAlive: {
418
418
  /** Closed when the step finishes. The default. */
419
- readonly Step: 'step';
419
+ readonly Step: "step";
420
420
  /** Kept for the rest of the root run, then closed by the harness. */
421
- readonly Run: 'run';
421
+ readonly Run: "run";
422
422
  /** Kept until {@link AcpSessionDisposer.closeAcpSessions} is called. Nothing closes it for you. */
423
- readonly Harness: 'harness';
423
+ readonly Harness: "harness";
424
424
  };
425
425
  /** @public Union of connection keep-alive scopes. */
426
426
  export type AcpKeepAlive = (typeof AcpKeepAlive)[keyof typeof AcpKeepAlive];
@@ -36,6 +36,22 @@ export interface ServerToolSpec {
36
36
  * @public
37
37
  */
38
38
  export declare function isServerToolSpec(value: unknown): value is ServerToolSpec;
39
+ /**
40
+ * @public OpenRouter service tiers. `fast` is an alias for `priority`;
41
+ * `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then
42
+ * default endpoints.
43
+ */
44
+ export declare const ServiceTier: {
45
+ readonly Auto: "auto";
46
+ readonly Default: "default";
47
+ readonly Fast: "fast";
48
+ readonly Flex: "flex";
49
+ readonly Priority: "priority";
50
+ readonly Scale: "scale";
51
+ readonly Ultrafast: "ultrafast";
52
+ };
53
+ /** @public Union of OpenRouter service tiers. */
54
+ export type ServiceTier = (typeof ServiceTier)[keyof typeof ServiceTier];
39
55
  /**
40
56
  * Optional parameters forwarded to the model provider during an LLM step.
41
57
  * @public
@@ -49,6 +65,8 @@ export interface ModelParams {
49
65
  maxTokens?: number;
50
66
  /** Sequences that cause the model to stop generating. */
51
67
  stopSequences?: string[];
68
+ /** OpenRouter service tier to request. Omit to use the provider default. */
69
+ serviceTier?: ServiceTier;
52
70
  }
53
71
  /** @public Aggregate token counts for an execution (input, output, total, cached). */
54
72
  export interface TokenUsage {
@@ -84,6 +102,8 @@ export interface StepMeta {
84
102
  toolCalls?: FunctionCallItem[];
85
103
  usage?: RoundUsage;
86
104
  cost?: number;
105
+ /** Tier the provider served an `llm` step on; see `LLMResponse.serviceTier`. */
106
+ serviceTier?: string;
87
107
  responseItems?: ReadonlyArray<Item>;
88
108
  /**
89
109
  * Why an ACP agent stopped its turn. Set only by `acp-agent` steps, and the
@@ -107,6 +127,12 @@ export interface LLMResponse {
107
127
  */
108
128
  rounds?: ReadonlyArray<RoundUsage>;
109
129
  cost?: number;
130
+ /**
131
+ * The tier the provider reports it served, from the last round. Absent when
132
+ * the provider reports none — it is never an echo of the requested tier, so
133
+ * a difference from `params.serviceTier` means a fallback happened.
134
+ */
135
+ serviceTier?: string;
110
136
  }
111
137
  /** @public Configuration for the LLM provider used by the agent harness. */
112
138
  export interface LlmProviderConfig {
@@ -17,3 +17,17 @@ export function isServerToolSpec(value) {
17
17
  const { type } = value;
18
18
  return type === 'openrouter:web_search' || type === 'openrouter:web_fetch';
19
19
  }
20
+ /**
21
+ * @public OpenRouter service tiers. `fast` is an alias for `priority`;
22
+ * `ultrafast` prefers ultrafast endpoints and falls back to `priority`, then
23
+ * default endpoints.
24
+ */
25
+ export const ServiceTier = {
26
+ Auto: 'auto',
27
+ Default: 'default',
28
+ Fast: 'fast',
29
+ Flex: 'flex',
30
+ Priority: 'priority',
31
+ Scale: 'scale',
32
+ Ultrafast: 'ultrafast',
33
+ };
@@ -149,7 +149,7 @@ export interface ContextHarness {
149
149
  * consumer frees a slot (back-pressure; default 30s timeout →
150
150
  * `channel_timeout`, abort → `cancelled`).
151
151
  */
152
- send<T>(channel: Channel<T>, value: T, ctx: Context): Promise<void>;
152
+ send<T>(channel: Channel<T>, value: NoInfer<T>, ctx: Context): Promise<void>;
153
153
  recv<T>(channel: Channel<T>, ctx: Context, opts?: {
154
154
  timeout?: number;
155
155
  }): Promise<T>;
@@ -97,6 +97,15 @@ export interface Context<TContext = ContextData, TState = unknown> {
97
97
  readonly unifiedTools?: ReadonlyArray<Tool>;
98
98
  /** Runtime item schema registry active for this context. */
99
99
  readonly itemSchemas?: ItemSchemaRegistry;
100
+ /**
101
+ * Receive a value from a channel. Waits up to `opts.timeout` ms (default
102
+ * 30s) before rejecting with `channel_timeout`; `timeout: 0` waits with no
103
+ * timeout in every mode and records an `unbounded_wait` channel warning.
104
+ * Aborting the context rejects the wait with `cancelled`.
105
+ *
106
+ * @throws `NoeticConfigError` with code `INVALID_CHANNEL_TIMEOUT` (as a
107
+ * rejection) when `opts.timeout` is negative.
108
+ */
100
109
  recv<T>(channel: Channel<T>, opts?: {
101
110
  timeout?: number;
102
111
  }): Promise<T>;
@@ -107,7 +116,7 @@ export interface Context<TContext = ContextData, TState = unknown> {
107
116
  * (back-pressure): after the default 30s timeout it rejects with
108
117
  * `channel_timeout`, and aborting the context rejects it with `cancelled`.
109
118
  */
110
- send<T>(channel: Channel<T>, value: T): Promise<void>;
119
+ send<T>(channel: Channel<T>, value: NoInfer<T>): Promise<void>;
111
120
  tryRecv<T>(channel: Channel<T>): T | null;
112
121
  checkpoint(): Promise<void>;
113
122
  complete<T>(value: T): void;
@@ -1,8 +1,8 @@
1
1
  /** @public Lifecycle states for a detached (background) execution. */
2
2
  declare const DetachedStatus: {
3
- readonly Running: 'running';
4
- readonly Completed: 'completed';
5
- readonly Failed: 'failed';
3
+ readonly Running: "running";
4
+ readonly Completed: "completed";
5
+ readonly Failed: "failed";
6
6
  };
7
7
  type DetachedStatus = (typeof DetachedStatus)[keyof typeof DetachedStatus];
8
8
  /** @public Handle returned by `detachedSpawn`, used to poll or await a background execution. */
@@ -279,7 +279,7 @@ export interface AgentHarnessContract<TParams extends Record<string, unknown> =
279
279
  * consumer frees a slot (30s default timeout → `channel_timeout`; context
280
280
  * abort → `cancelled`).
281
281
  */
282
- send<T>(channel: Channel<T>, value: T, ctx: Context): Promise<void>;
282
+ send<T>(channel: Channel<T>, value: NoInfer<T>, ctx: Context): Promise<void>;
283
283
  recv<T>(channel: Channel<T>, ctx: Context, opts?: {
284
284
  timeout?: number;
285
285
  }): Promise<T>;
@@ -30,7 +30,7 @@ export interface Snapshot {
30
30
  lastOutput: unknown;
31
31
  /** Stringified text of the most recent iteration output. */
32
32
  lastText: string;
33
- /** Array of all prior iteration outputs (bounded by `maxHistorySize`). */
33
+ /** Prior iteration outputs, oldest first; bounded by `maxHistorySize` (default 100, oldest dropped first). */
34
34
  history: unknown[];
35
35
  /** Nesting depth of the current execution context. */
36
36
  depth: number;
@@ -44,7 +44,7 @@ export interface Snapshot {
44
44
  export interface Verdict {
45
45
  /** When true, the loop terminates after this iteration. */
46
46
  stop: boolean;
47
- /** Human-readable explanation of why the loop stopped (logged in traces). */
47
+ /** Why the loop stopped or continued; recorded on the `loop.verdict` span event. */
48
48
  reason?: string;
49
49
  /** Feedback string injected into the next iteration's context (ignored when `stop` is true). */
50
50
  feedback?: string;
@@ -73,10 +73,43 @@ export interface SettleResult<O> {
73
73
  /** The error that caused rejection (present when `status` is `'rejected'`). */
74
74
  error?: NoeticError;
75
75
  }
76
+ /**
77
+ * Combines inParallel path results into one output. `R` is the element type of
78
+ * `results`: `O` in `all` mode, `SettleResult<O>` in `settle` mode.
79
+ * @public
80
+ */
81
+ export type MergeFn<TContext = ContextData, O = unknown, R = O> = (results: R[], ctx: Context<TContext>) => O;
82
+ /**
83
+ * Replay controls shared by every step kind (spec 23a § Identity).
84
+ *
85
+ * A resumed execution replays a recorded step's output in place of running it.
86
+ * By default the ledger keys that record by the step's execution path, so replay
87
+ * identity is positional. These fields change that per step.
88
+ * @public
89
+ */
90
+ export interface StepReplay<TContext = ContextData, I = unknown> {
91
+ /**
92
+ * Whether the ledger records and replays this step. Defaults to `true`. With
93
+ * `false` the step always runs again on resume, so its side effects and state
94
+ * changes happen again too. Use it for cheap orchestration steps whose work is
95
+ * timing-dependent (which batch a worker picked) or lives in state rather than
96
+ * output. Applies to this step only: its children keep their own setting.
97
+ * `schedule` steps are never recorded, whatever this says.
98
+ */
99
+ durable?: boolean;
100
+ /**
101
+ * Content key that replaces the positional path as this step's ledger key, so a
102
+ * step that may run at a different position on resume (a concurrent worker's
103
+ * call) still finds its own output. Two dispatches with the same key in one
104
+ * execution share one entry. A key that throws skips the ledger for that
105
+ * dispatch with a warning; it never fails the step.
106
+ */
107
+ replayKey?(input: I, ctx: Context<TContext>): string;
108
+ }
76
109
  /** @public Discriminated union of all step kinds that can be composed into an execution tree. */
77
110
  export type Step<TContext = ContextData, I = unknown, O = unknown> = StepRunCode<TContext, I, O> | StepCallModel<TContext, I, O> | StepAcpAgent<TContext, I, O> | StepInvokeTool<TContext, I, O> | StepDecide<TContext, I, O> | StepConditional<TContext, I, O> | StepInParallel<TContext, I, O> | StepSpawn<TContext, I, O> | StepWithContext<TContext, I, O> | StepLoop<TContext, I, O> | StepSchedule<TContext, I, O>;
78
111
  /** @public A step that executes arbitrary async logic via a user-supplied function. */
79
- export interface StepRunCode<TContext = ContextData, I = unknown, O = unknown> {
112
+ export interface StepRunCode<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
80
113
  kind: 'runCode';
81
114
  id: string;
82
115
  execute: (input: I, ctx: Context<TContext>) => Promise<O>;
@@ -90,7 +123,7 @@ export interface StepRunCode<TContext = ContextData, I = unknown, O = unknown> {
90
123
  subprocess?: SubprocessAdapter;
91
124
  }
92
125
  /** @public A step that sends a prompt to a language model and returns its response. */
93
- export interface StepCallModel<TContext = ContextData, _I = unknown, O = unknown> {
126
+ export interface StepCallModel<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
94
127
  kind: 'callModel';
95
128
  id: string;
96
129
  /** Model id. Accepts either an eager string or a `(ctx) => string` getter. */
@@ -129,7 +162,7 @@ export interface StepCallModel<TContext = ContextData, _I = unknown, O = unknown
129
162
  * itself is supplied as an adapter, so the set of supported agents is open.
130
163
  * @public
131
164
  */
132
- export interface StepAcpAgent<TContext = ContextData, _I = unknown, O = unknown> {
165
+ export interface StepAcpAgent<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
133
166
  kind: 'acp-agent';
134
167
  id: string;
135
168
  /**
@@ -168,7 +201,7 @@ export interface StepAcpAgent<TContext = ContextData, _I = unknown, O = unknown>
168
201
  emit?: boolean | ((eventType: string, data: Record<string, unknown>) => boolean);
169
202
  }
170
203
  /** @public A step that invokes a single tool directly, bypassing the model. */
171
- export interface StepInvokeTool<_TContext = ContextData, I = unknown, O = unknown> {
204
+ export interface StepInvokeTool<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
172
205
  kind: 'invokeTool';
173
206
  id: string;
174
207
  tool: Tool<StandardSchemaV1<unknown, I>, StandardSchemaV1<unknown, O>>;
@@ -180,7 +213,7 @@ export interface StepInvokeTool<_TContext = ContextData, I = unknown, O = unknow
180
213
  * to it, and runs no steering hooks. See spec 32.
181
214
  * @public
182
215
  */
183
- export interface StepDecide<TContext = ContextData, _I = unknown, O = unknown> {
216
+ export interface StepDecide<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
184
217
  kind: 'decide';
185
218
  /** Phantom field carrying the answers type for inference. Never set at runtime. */
186
219
  readonly _answers?: O;
@@ -216,7 +249,7 @@ export type DecideStep<TContext, I, Q extends DecideQuestions> = StepDecide<TCon
216
249
  */
217
250
  export type DecideView = 'full' | 'layers' | 'none';
218
251
  /** @public A step that dynamically selects and executes one of several possible sub-steps. */
219
- export interface StepConditional<TContext = ContextData, I = unknown, O = unknown> {
252
+ export interface StepConditional<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
220
253
  kind: 'conditional';
221
254
  id: string;
222
255
  /**
@@ -235,7 +268,7 @@ export interface StepConditional<TContext = ContextData, I = unknown, O = unknow
235
268
  /** @public Union of inParallel step variants (`race`, `all`, `settle`) for concurrent path execution. */
236
269
  export type StepInParallel<TContext = ContextData, I = unknown, O = unknown> = StepInParallelRace<TContext, I, O> | StepInParallelAll<TContext, I, O> | StepInParallelSettle<TContext, I, O>;
237
270
  /** @public An inParallel step that returns the result of the first path to complete. */
238
- export interface StepInParallelRace<TContext = ContextData, I = unknown, O = unknown> {
271
+ export interface StepInParallelRace<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
239
272
  kind: 'inParallel';
240
273
  id: string;
241
274
  mode: 'race';
@@ -244,22 +277,22 @@ export interface StepInParallelRace<TContext = ContextData, I = unknown, O = unk
244
277
  _optimizable?: Step<TContext>[];
245
278
  }
246
279
  /** @public An inParallel step that runs all paths and merges their results. */
247
- export interface StepInParallelAll<TContext = ContextData, I = unknown, O = unknown> {
280
+ export interface StepInParallelAll<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
248
281
  kind: 'inParallel';
249
282
  id: string;
250
283
  mode: 'all';
251
284
  paths: (input: I, ctx: Context<TContext>) => Step<TContext, I, O>[];
252
- merge: (results: O[], ctx: Context<TContext>) => O;
285
+ merge: MergeFn<TContext, O>;
253
286
  concurrency?: number;
254
287
  _optimizable?: Step<TContext>[];
255
288
  }
256
289
  /** @public An inParallel step that runs all paths and collects fulfilled/rejected outcomes. */
257
- export interface StepInParallelSettle<TContext = ContextData, I = unknown, O = unknown> {
290
+ export interface StepInParallelSettle<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
258
291
  kind: 'inParallel';
259
292
  id: string;
260
293
  mode: 'settle';
261
294
  paths: (input: I, ctx: Context<TContext>) => Step<TContext, I, O>[];
262
- merge: (results: SettleResult<O>[], ctx: Context<TContext>) => O;
295
+ merge: MergeFn<TContext, O, SettleResult<O>>;
263
296
  concurrency?: number;
264
297
  _optimizable?: Step<TContext>[];
265
298
  }
@@ -269,14 +302,14 @@ export interface StepInParallelSettle<TContext = ContextData, I = unknown, O = u
269
302
  * Spawn and detachedSpawn break the inheritance chain.
270
303
  * @public
271
304
  */
272
- export interface StepWithContext<TContext = ContextData, I = unknown, O = unknown> {
305
+ export interface StepWithContext<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
273
306
  kind: 'withContext';
274
307
  id: string;
275
308
  child: Step<TContext, I, O>;
276
309
  context: ContextConfig | ContextLayer[];
277
310
  }
278
311
  /** @public A step that launches a child execution with its own context scope. */
279
- export interface StepSpawn<TContext = ContextData, I = unknown, O = unknown> {
312
+ export interface StepSpawn<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
280
313
  kind: 'spawn';
281
314
  id: string;
282
315
  child: Step<TContext, I, O>;
@@ -293,7 +326,7 @@ export interface StepSpawn<TContext = ContextData, I = unknown, O = unknown> {
293
326
  * A loop step that iterates a body step until a termination predicate is satisfied.
294
327
  * @public
295
328
  */
296
- export interface StepLoop<TContext = ContextData, I = unknown, O = unknown> {
329
+ export interface StepLoop<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
297
330
  kind: 'loop';
298
331
  /** Unique step identifier used in traces and error messages. */
299
332
  id: string;
@@ -303,7 +336,7 @@ export interface StepLoop<TContext = ContextData, I = unknown, O = unknown> {
303
336
  until: Until;
304
337
  /** Hard safety cap on iterations (default: 1000). */
305
338
  maxIterations?: number;
306
- /** Maximum number of entries kept in the snapshot history array. */
339
+ /** Maximum entries kept in the snapshot history array (default: 100); oldest drop first. */
307
340
  maxHistorySize?: number;
308
341
  /** Optional channel for injecting messages into the loop mid-execution. */
309
342
  inbox?: Channel<string>;
@@ -330,7 +363,7 @@ export type ScheduleErrorPolicy = 'continue' | 'fail';
330
363
  *
331
364
  * @public
332
365
  */
333
- export interface StepSchedule<TContext = ContextData, I = unknown, O = unknown> {
366
+ export interface StepSchedule<TContext = ContextData, I = unknown, O = unknown> extends StepReplay<TContext, I> {
334
367
  kind: 'schedule';
335
368
  /** Unique step identifier used in traces and error messages. */
336
369
  id: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@noetic-tools/types",
3
- "version": "3.5.0",
3
+ "version": "3.6.0",
4
4
  "type": "module",
5
5
  "description": "Foundational type contracts and primitives shared across the Noetic framework (items, LLM config, adapters, steering, errors).",
6
6
  "license": "Apache-2.0",