@noetic-tools/core 3.2.0 → 5.0.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.
- package/dist/adapters/in-memory-subprocess/manifest-persistence.d.ts +1 -1
- package/dist/adapters/in-memory-subprocess/types.d.ts +1 -1
- package/dist/adapters/openrouter.d.ts +2 -2
- package/dist/adapters/openrouter.js +2 -2
- package/dist/builders/context-builder.d.ts +11 -0
- package/dist/builders/context-builder.js +15 -0
- package/dist/builders/context-option.d.ts +23 -0
- package/dist/builders/context-option.js +22 -0
- package/dist/builders/control-flow-builders.d.ts +19 -19
- package/dist/builders/every.d.ts +4 -4
- package/dist/builders/layer-provides-builders.d.ts +1 -1
- package/dist/builders/layer-provides-builders.js +1 -1
- package/dist/builders/loop-builder.d.ts +3 -3
- package/dist/builders/provide-builder.d.ts +14 -7
- package/dist/builders/provide-builder.js +15 -4
- package/dist/builders/spawn-builder.d.ts +8 -6
- package/dist/builders/spawn-builder.js +7 -2
- package/dist/builders/step-builders.d.ts +19 -20
- package/dist/builders/tool-builder.d.ts +9 -5
- package/dist/builders/tool-builder.js +3 -2
- package/dist/builders/workflow-hydrator.d.ts +17 -4
- package/dist/builders/workflow-hydrator.js +87 -8
- package/dist/builders/workflow-step.d.ts +61 -0
- package/dist/builders/workflow-step.js +126 -0
- package/dist/conditions/conditions.d.ts +17 -17
- package/dist/conditions/conditions.js +1 -1
- package/dist/deprecated.d.ts +30 -0
- package/dist/deprecated.js +28 -0
- package/dist/harness/agent-harness.d.ts +42 -26
- package/dist/harness/agent-harness.js +68 -21
- package/dist/harness/deps/{memory.d.ts → context.d.ts} +2 -2
- package/dist/harness/deps/{memory.js → context.js} +1 -1
- package/dist/harness/deps/types.d.ts +1 -1
- package/dist/harness/model-schema.d.ts +2 -2
- package/dist/index.d.ts +21 -17
- package/dist/index.js +14 -8
- package/dist/interpreter/action-deps.d.ts +3 -3
- package/dist/interpreter/action-deps.js +2 -2
- package/dist/interpreter/action-types.d.ts +1 -1
- package/dist/interpreter/collect-tools.d.ts +1 -1
- package/dist/interpreter/execute-action.d.ts +10 -10
- package/dist/interpreter/execute-action.js +13 -13
- package/dist/interpreter/execute-control.d.ts +4 -4
- package/dist/interpreter/execute-control.js +1 -1
- package/dist/interpreter/execute-sub-harness.d.ts +1 -1
- package/dist/interpreter/execute.d.ts +3 -3
- package/dist/interpreter/execute.js +78 -31
- package/dist/interpreter/step-dispatcher.d.ts +3 -3
- package/dist/interpreter/sub-harness-events.d.ts +2 -2
- package/dist/interpreter/typeguards.d.ts +4 -4
- package/dist/patterns/dynamic-workflow.d.ts +7 -4
- package/dist/patterns/dynamic-workflow.js +2 -0
- package/dist/patterns/interview.d.ts +2 -2
- package/dist/patterns/plans.d.ts +5 -5
- package/dist/patterns/ralph-wiggum.d.ts +2 -2
- package/dist/patterns/react.d.ts +7 -5
- package/dist/patterns/react.js +6 -4
- package/dist/portable/builders.js +2 -0
- package/dist/portable/context-layers.d.ts +8 -0
- package/dist/portable/context-layers.js +8 -0
- package/dist/portable.d.ts +2 -2
- package/dist/portable.js +2 -2
- package/dist/runtime/channel-store.d.ts +33 -0
- package/dist/runtime/channel-store.js +297 -11
- package/dist/runtime/context-deps.d.ts +2 -2
- package/dist/runtime/context-deps.js +1 -1
- package/dist/runtime/context-impl.d.ts +10 -8
- package/dist/runtime/context-impl.js +11 -7
- package/dist/runtime/context-type-deps.d.ts +1 -1
- package/dist/runtime/durable/checkpoint-store.d.ts +1 -1
- package/dist/runtime/durable/harness-checkpoints.d.ts +2 -3
- package/dist/runtime/durable/harness-checkpoints.js +2 -3
- package/dist/runtime/durable/step-ledger.d.ts +1 -1
- package/dist/runtime/durable/step-ledger.js +1 -1
- package/dist/runtime/in-memory-storage.d.ts +1 -1
- package/dist/runtime/session-runner.d.ts +1 -1
- package/dist/runtime/step-registry.d.ts +3 -3
- package/dist/runtime/{tool-memory.d.ts → tool-context.d.ts} +1 -2
- package/dist/runtime/{tool-memory.js → tool-context.js} +5 -2
- package/dist/runtime/tool-ui.d.ts +1 -1
- package/dist/runtime/tool-ui.js +1 -1
- package/dist/schemas/workflow.d.ts +5 -279
- package/dist/schemas/workflow.js +4 -376
- package/dist/types/mutable-context.d.ts +2 -2
- package/dist/types/step-registrar.d.ts +1 -1
- package/dist/unstable.d.ts +5 -5
- package/dist/unstable.js +3 -3
- package/dist/until/predicates.d.ts +1 -1
- package/package.json +4 -4
- package/schema/noetic-workflow.schema.json +28 -0
- package/dist/builders/memory-builder.d.ts +0 -11
- package/dist/builders/memory-builder.js +0 -15
- package/dist/patterns/flow.d.ts +0 -2
- package/dist/patterns/flow.js +0 -1
- package/dist/portable/memory-layers.d.ts +0 -8
- package/dist/portable/memory-layers.js +0 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
function buildToolContext(harness, ctx) {
|
|
2
2
|
return {
|
|
3
3
|
get(layerId) {
|
|
4
4
|
return harness.getLayerState(ctx.id, layerId);
|
|
@@ -9,12 +9,15 @@ export function buildToolMemory(harness, ctx) {
|
|
|
9
9
|
};
|
|
10
10
|
}
|
|
11
11
|
export function buildToolExecutionContext(ctx, harness, turnContext) {
|
|
12
|
+
const toolContext = buildToolContext(harness, ctx);
|
|
12
13
|
return {
|
|
13
14
|
ctx,
|
|
14
15
|
harness,
|
|
15
16
|
fs: harness.fs,
|
|
16
17
|
shell: harness.shell,
|
|
17
|
-
|
|
18
|
+
context: toolContext,
|
|
19
|
+
// Deprecated alias — same accessor object, not a copy.
|
|
20
|
+
memory: toolContext,
|
|
18
21
|
assembledView: ctx.itemLog.items,
|
|
19
22
|
lastStepMeta: ctx.lastStepMeta,
|
|
20
23
|
turnContext,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* render functions at the call / progress / result / error lifecycle points and
|
|
6
6
|
* forwards each returned `UiFragment` as an `openui.fragment` framework event
|
|
7
7
|
* (namespaced `${agentName}:openui.fragment`). The framework never interprets
|
|
8
|
-
* the fragment source — a UI surface (
|
|
8
|
+
* the fragment source — a UI surface (context layer + transport) composes it.
|
|
9
9
|
*
|
|
10
10
|
* The `ui` methods are declared bivariantly on `ToolUiDeclaration`, so the
|
|
11
11
|
* erased `Tool` handle the runtime holds can call them with runtime values.
|
package/dist/runtime/tool-ui.js
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* render functions at the call / progress / result / error lifecycle points and
|
|
6
6
|
* forwards each returned `UiFragment` as an `openui.fragment` framework event
|
|
7
7
|
* (namespaced `${agentName}:openui.fragment`). The framework never interprets
|
|
8
|
-
* the fragment source — a UI surface (
|
|
8
|
+
* the fragment source — a UI surface (context layer + transport) composes it.
|
|
9
9
|
*
|
|
10
10
|
* The `ui` methods are declared bivariantly on `ToolUiDeclaration`, so the
|
|
11
11
|
* erased `Tool` handle the runtime holds can call them with runtime values.
|
|
@@ -1,281 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* step tree. It covers every step kind. The `run` node carries its body as a
|
|
6
|
-
* code STRING (not an in-process closure) dispatched through a subprocess
|
|
7
|
-
* adapter, keeping the document JSON-safe. The hydrator in
|
|
8
|
-
* `builders/workflow-hydrator.ts` converts a validated document back into live
|
|
9
|
-
* `Step` objects via the existing builders.
|
|
2
|
+
* The JSON workflow schema lives in `@noetic-tools/types` so the memory
|
|
3
|
+
* package (which must not import core) can validate workflow documents.
|
|
4
|
+
* This barrel keeps core's public and intra-core import paths unchanged.
|
|
10
5
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
interface UntilAnyPredicate {
|
|
14
|
-
kind: 'any';
|
|
15
|
-
predicates: UntilPredicate[];
|
|
16
|
-
}
|
|
17
|
-
interface UntilAllPredicate {
|
|
18
|
-
kind: 'all';
|
|
19
|
-
predicates: UntilPredicate[];
|
|
20
|
-
}
|
|
21
|
-
/** @public Discriminated union of named until predicates usable in JSON workflows. */
|
|
22
|
-
export type UntilPredicate = {
|
|
23
|
-
kind: 'maxSteps';
|
|
24
|
-
n: number;
|
|
25
|
-
} | {
|
|
26
|
-
kind: 'maxCost';
|
|
27
|
-
usd: number;
|
|
28
|
-
} | {
|
|
29
|
-
kind: 'maxDuration';
|
|
30
|
-
ms: number;
|
|
31
|
-
} | {
|
|
32
|
-
kind: 'noToolCalls';
|
|
33
|
-
} | {
|
|
34
|
-
kind: 'outputContains';
|
|
35
|
-
marker: string;
|
|
36
|
-
} | {
|
|
37
|
-
kind: 'outputEquals';
|
|
38
|
-
sentinel: string;
|
|
39
|
-
} | {
|
|
40
|
-
kind: 'converged';
|
|
41
|
-
threshold?: number;
|
|
42
|
-
} | UntilAnyPredicate | UntilAllPredicate;
|
|
43
|
-
/** @public Zod schema validating a named `until` predicate (including `any`/`all` combinators). */
|
|
44
|
-
export declare const UntilPredicateSchema: z.ZodType<UntilPredicate>;
|
|
45
|
-
/** @public ESM literal enum for merge strategies. */
|
|
46
|
-
export declare const MergeStrategy: {
|
|
47
|
-
readonly Last: 'last';
|
|
48
|
-
readonly First: 'first';
|
|
49
|
-
readonly Concat: 'concat';
|
|
50
|
-
};
|
|
51
|
-
/** @public Named merge strategy for fork nodes. */
|
|
52
|
-
export type MergeStrategy = (typeof MergeStrategy)[keyof typeof MergeStrategy];
|
|
53
|
-
/** @public Zod schema for the named merge strategy used by `fork` nodes. */
|
|
54
|
-
export declare const MergeStrategySchema: z.ZodEnum<{
|
|
55
|
-
concat: "concat";
|
|
56
|
-
first: "first";
|
|
57
|
-
last: "last";
|
|
58
|
-
}>;
|
|
59
|
-
declare const ModelParamsSchema: z.ZodObject<{
|
|
60
|
-
temperature: z.ZodOptional<z.ZodNumber>;
|
|
61
|
-
topP: z.ZodOptional<z.ZodNumber>;
|
|
62
|
-
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
63
|
-
stopSequences: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
64
|
-
}, z.core.$strip>;
|
|
65
|
-
/**
|
|
66
|
-
* A uniform tool entry on an `llm` node. Every entry is an object keyed by
|
|
67
|
-
* `type`:
|
|
68
|
-
* - A CLIENT tool is `{ type: "<registered-tool-name>" }`. The hydrator
|
|
69
|
-
* resolves `type` against the tool registry; `parameters` (if present) is
|
|
70
|
-
* ignored — client tools receive their call args from the model at runtime.
|
|
71
|
-
* - A SERVER tool is `{ type: "openrouter:web_search" | "openrouter:web_fetch",
|
|
72
|
-
* parameters?: {...} }`. The provider executes it; `parameters` keys are
|
|
73
|
-
* camelCase (e.g. `maxResults`, `searchContextSize`) — the SDK re-serialises
|
|
74
|
-
* them and silently drops unknown keys.
|
|
75
|
-
*
|
|
76
|
-
* Server vs client is decided by the `type` value (a reserved `openrouter:*`
|
|
77
|
-
* server-tool literal vs an arbitrary tool name), not by the entry's shape.
|
|
78
|
-
*/
|
|
79
|
-
declare const LlmToolEntrySchema: z.ZodObject<{
|
|
80
|
-
type: z.ZodString;
|
|
81
|
-
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
82
|
-
}, z.core.$strip>;
|
|
83
|
-
/** Retry policy for a `run` node, mirroring `RetryPolicy` in `@noetic-tools/types`. */
|
|
84
|
-
declare const RetryPolicySchema: z.ZodObject<{
|
|
85
|
-
maxAttempts: z.ZodNumber;
|
|
86
|
-
backoff: z.ZodEnum<{
|
|
87
|
-
exponential: "exponential";
|
|
88
|
-
fixed: "fixed";
|
|
89
|
-
linear: "linear";
|
|
90
|
-
}>;
|
|
91
|
-
initialDelay: z.ZodNumber;
|
|
92
|
-
maxDelay: z.ZodOptional<z.ZodNumber>;
|
|
93
|
-
}, z.core.$strip>;
|
|
94
|
-
declare const HarnessSettingsSchema: z.ZodObject<{
|
|
95
|
-
model: z.ZodOptional<z.ZodString>;
|
|
96
|
-
permissionMode: z.ZodOptional<z.ZodEnum<{
|
|
97
|
-
acceptEdits: "acceptEdits";
|
|
98
|
-
bypassPermissions: "bypassPermissions";
|
|
99
|
-
default: "default";
|
|
100
|
-
plan: "plan";
|
|
101
|
-
}>>;
|
|
102
|
-
maxTurns: z.ZodOptional<z.ZodNumber>;
|
|
103
|
-
allowedTools: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
104
|
-
extra: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
105
|
-
}, z.core.$strip>;
|
|
106
|
-
declare const HarnessSessionPolicySchema: z.ZodObject<{
|
|
107
|
-
reuse: z.ZodOptional<z.ZodString>;
|
|
108
|
-
onComplete: z.ZodOptional<z.ZodEnum<{
|
|
109
|
-
destroy: "destroy";
|
|
110
|
-
detach: "detach";
|
|
111
|
-
stop: "stop";
|
|
112
|
-
}>>;
|
|
113
|
-
}, z.core.$strip>;
|
|
114
|
-
interface WorkflowNodeBase {
|
|
115
|
-
id: string;
|
|
116
|
-
}
|
|
117
|
-
/**
|
|
118
|
-
* A reference to a streaming `OutputCodec` for an `llm` node's structured
|
|
119
|
-
* output. The hydrator resolves `library` from `HydrationContext.uiLibraries`
|
|
120
|
-
* to a live codec (e.g. `openUi(myLibrary)` from `@noetic-tools/openui`), the
|
|
121
|
-
* same registry-resolution pattern sub-harness nodes use for adapters. Kept a
|
|
122
|
-
* *reference* because a codec is a runtime object, not JSON-expressible.
|
|
123
|
-
*/
|
|
124
|
-
export interface OutputCodecRef {
|
|
125
|
-
/** The codec dialect. Only `'openui'` is defined today. */
|
|
126
|
-
codec: 'openui';
|
|
127
|
-
/** Registry key resolved from `HydrationContext.uiLibraries`. */
|
|
128
|
-
library: string;
|
|
129
|
-
}
|
|
130
|
-
export interface LlmWorkflowNode extends WorkflowNodeBase {
|
|
131
|
-
kind: 'llm';
|
|
132
|
-
model?: string;
|
|
133
|
-
instructions: string;
|
|
134
|
-
/**
|
|
135
|
-
* Tool entries. Every entry is an object `{ type, parameters? }`. A CLIENT
|
|
136
|
-
* tool is `{ type: "<registered-tool-name>" }` (resolved from the registry);
|
|
137
|
-
* a SERVER tool is `{ type: "openrouter:web_search" | "openrouter:web_fetch",
|
|
138
|
-
* parameters?: {...} }` (executed by the provider). Client vs server is
|
|
139
|
-
* decided by the `type` value.
|
|
140
|
-
*/
|
|
141
|
-
tools?: z.infer<typeof LlmToolEntrySchema>[];
|
|
142
|
-
params?: z.infer<typeof ModelParamsSchema>;
|
|
143
|
-
/** Streaming output-codec reference, resolved from `HydrationContext.uiLibraries`. */
|
|
144
|
-
output?: OutputCodecRef;
|
|
145
|
-
}
|
|
146
|
-
export interface ToolWorkflowNode extends WorkflowNodeBase {
|
|
147
|
-
kind: 'tool';
|
|
148
|
-
toolName: string;
|
|
149
|
-
args?: Record<string, unknown>;
|
|
150
|
-
}
|
|
151
|
-
/**
|
|
152
|
-
* A node that runs a serialised code body. Unlike the programmatic `step.run`
|
|
153
|
-
* (which carries a closure), the JSON form carries `execute` as a code STRING.
|
|
154
|
-
* The code is never eval'd in-process (Cloudflare Workers forbid eval); it is
|
|
155
|
-
* dispatched through a subprocess adapter (`ctx.subprocess`, or a named adapter
|
|
156
|
-
* resolved by ref). Execution therefore requires a subprocess adapter capable
|
|
157
|
-
* of running the code and returning its stdout.
|
|
158
|
-
*/
|
|
159
|
-
export interface RunWorkflowNode extends WorkflowNodeBase {
|
|
160
|
-
kind: 'run';
|
|
161
|
-
/** Source code executed in the subprocess. Receives the step input on stdin. */
|
|
162
|
-
execute: string;
|
|
163
|
-
/** Optional retry policy applied to the step. */
|
|
164
|
-
retry?: z.infer<typeof RetryPolicySchema>;
|
|
165
|
-
/** Named subprocess adapter ref; defaults to `ctx.subprocess` when omitted. */
|
|
166
|
-
subprocess?: string;
|
|
167
|
-
}
|
|
168
|
-
export interface BranchRoute {
|
|
169
|
-
match: string;
|
|
170
|
-
target: WorkflowNode;
|
|
171
|
-
}
|
|
172
|
-
export interface BranchWorkflowNode extends WorkflowNodeBase {
|
|
173
|
-
kind: 'branch';
|
|
174
|
-
routes: BranchRoute[];
|
|
175
|
-
default?: WorkflowNode;
|
|
176
|
-
}
|
|
177
|
-
export interface ForkWorkflowNode extends WorkflowNodeBase {
|
|
178
|
-
kind: 'fork';
|
|
179
|
-
mode: 'race' | 'all' | 'settle';
|
|
180
|
-
/**
|
|
181
|
-
* Static fan-out: one child per entry. Mutually exclusive with `each` —
|
|
182
|
-
* supply exactly one.
|
|
183
|
-
*/
|
|
184
|
-
paths?: WorkflowNode[];
|
|
185
|
-
/**
|
|
186
|
-
* Dynamic fan-out: instantiate this body template once per item of a
|
|
187
|
-
* runtime-produced array (data-dependent N). Mutually exclusive with `paths`.
|
|
188
|
-
*/
|
|
189
|
-
each?: WorkflowNode;
|
|
190
|
-
/**
|
|
191
|
-
* Selector key into the fork input (parsed as JSON) locating the array to
|
|
192
|
-
* fan out over. When omitted, the input string itself is parsed as a JSON
|
|
193
|
-
* array. Only meaningful with `each`.
|
|
194
|
-
*/
|
|
195
|
-
over?: string;
|
|
196
|
-
merge?: MergeStrategy;
|
|
197
|
-
concurrency?: number;
|
|
198
|
-
}
|
|
199
|
-
export interface SpawnWorkflowNode extends WorkflowNodeBase {
|
|
200
|
-
kind: 'spawn';
|
|
201
|
-
child: WorkflowNode;
|
|
202
|
-
timeout?: number;
|
|
203
|
-
/**
|
|
204
|
-
* Memory layers the child runs with, by registered name (resolved from
|
|
205
|
-
* `HydrationContext.layers`, like `provide`). Omit to inherit the parent's
|
|
206
|
-
* layers — the default spawn behaviour. Naming layers here REPLACES the
|
|
207
|
-
* inherited set for the child, so list every layer the child needs.
|
|
208
|
-
*/
|
|
209
|
-
layers?: string[];
|
|
210
|
-
}
|
|
211
|
-
export interface ProvideWorkflowNode extends WorkflowNodeBase {
|
|
212
|
-
kind: 'provide';
|
|
213
|
-
child: WorkflowNode;
|
|
214
|
-
layers: string[];
|
|
215
|
-
}
|
|
216
|
-
export interface LoopWorkflowNode extends WorkflowNodeBase {
|
|
217
|
-
kind: 'loop';
|
|
218
|
-
body: WorkflowNode;
|
|
219
|
-
until: UntilPredicate;
|
|
220
|
-
maxIterations?: number;
|
|
221
|
-
}
|
|
222
|
-
export interface SequenceWorkflowNode extends WorkflowNodeBase {
|
|
223
|
-
kind: 'sequence';
|
|
224
|
-
steps: WorkflowNode[];
|
|
225
|
-
}
|
|
226
|
-
export interface EveryWorkflowNode extends WorkflowNodeBase {
|
|
227
|
-
kind: 'every';
|
|
228
|
-
step: WorkflowNode;
|
|
229
|
-
ms: number;
|
|
230
|
-
onError?: 'continue' | 'fail';
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* A node that delegates a turn to a coding-agent harness. `kind` is the harness
|
|
234
|
-
* id (e.g. `claude-code`); the hydrator resolves the matching adapter from the
|
|
235
|
-
* workflow's harness registry.
|
|
236
|
-
*/
|
|
237
|
-
export interface SubHarnessWorkflowNode extends WorkflowNodeBase {
|
|
238
|
-
kind: SubHarnessKind;
|
|
239
|
-
prompt: string;
|
|
240
|
-
instructions?: string;
|
|
241
|
-
settings?: z.infer<typeof HarnessSettingsSchema>;
|
|
242
|
-
session?: z.infer<typeof HarnessSessionPolicySchema>;
|
|
243
|
-
}
|
|
244
|
-
/** @public Discriminated union of all JSON-serialisable workflow node kinds. */
|
|
245
|
-
export type WorkflowNode = LlmWorkflowNode | ToolWorkflowNode | RunWorkflowNode | BranchWorkflowNode | ForkWorkflowNode | SpawnWorkflowNode | ProvideWorkflowNode | LoopWorkflowNode | SequenceWorkflowNode | EveryWorkflowNode | SubHarnessWorkflowNode;
|
|
246
|
-
/** @public Zod schema validating a single `WorkflowNode` (any JSON-safe kind). */
|
|
247
|
-
export declare const WorkflowNodeSchema: z.ZodType<WorkflowNode>;
|
|
248
|
-
/** @public Top-level envelope for a JSON workflow definition. */
|
|
249
|
-
export interface WorkflowDocument {
|
|
250
|
-
version: 1;
|
|
251
|
-
root: WorkflowNode;
|
|
252
|
-
}
|
|
253
|
-
/** @public Zod schema validating a complete `WorkflowDocument`. */
|
|
254
|
-
export declare const WorkflowDocumentSchema: z.ZodType<WorkflowDocument>;
|
|
255
|
-
/** Validates a candidate workflow document. Throws `ZodError` on invalid input. */
|
|
256
|
-
export declare function validateWorkflow(input: unknown): WorkflowDocument;
|
|
257
|
-
/** Walks a workflow tree depth-first, yielding each node. */
|
|
258
|
-
export declare function walkWorkflow(node: WorkflowNode): Iterable<WorkflowNode>;
|
|
259
|
-
/** A flattened, JSON-safe view of a workflow tree: its nodes and parent→child edges. */
|
|
260
|
-
export interface WorkflowGraph {
|
|
261
|
-
nodes: Array<{
|
|
262
|
-
id: string;
|
|
263
|
-
kind: WorkflowNode['kind'];
|
|
264
|
-
}>;
|
|
265
|
-
edges: Array<{
|
|
266
|
-
from: string;
|
|
267
|
-
to: string;
|
|
268
|
-
}>;
|
|
269
|
-
}
|
|
270
|
-
/**
|
|
271
|
-
* Flattens a workflow tree into a node + edge list — the static "potential
|
|
272
|
-
* paths" of the DAG, suitable for attaching to a trace span so observers can
|
|
273
|
-
* reconstruct the declared graph independent of which branches actually ran.
|
|
274
|
-
*/
|
|
275
|
-
export declare function workflowGraph(root: WorkflowNode): WorkflowGraph;
|
|
276
|
-
/**
|
|
277
|
-
* Returns the maximum depth of a workflow tree.
|
|
278
|
-
* Leaf nodes (`llm`, `tool`) have depth 0. Structural nodes add +1.
|
|
279
|
-
*/
|
|
280
|
-
export declare function workflowDepth(node: WorkflowNode): number;
|
|
281
|
-
export {};
|
|
6
|
+
export type { BranchRoute, BranchWorkflowNode, EveryWorkflowNode, ForkWorkflowNode, LlmWorkflowNode, LoopWorkflowNode, OutputCodecRef, ProvideWorkflowNode, RunWorkflowNode, SequenceWorkflowNode, SpawnWorkflowNode, SubflowWorkflowNode, SubHarnessWorkflowNode, ToolWorkflowNode, UntilPredicate, WorkflowDocument, WorkflowGraph, WorkflowNode, } from '@noetic-tools/types';
|
|
7
|
+
export { MergeStrategy, MergeStrategySchema, UntilPredicateSchema, validateWorkflow, WorkflowDocumentSchema, WorkflowNodeSchema, walkWorkflow, workflowDepth, workflowGraph, } from '@noetic-tools/types';
|