agentfootprint 7.9.0 → 7.10.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/README.md +2 -2
- package/dist/core-flow/Workflow.js +210 -0
- package/dist/core-flow/Workflow.js.map +1 -0
- package/dist/esm/core-flow/Workflow.d.ts +146 -0
- package/dist/esm/core-flow/Workflow.js +205 -0
- package/dist/esm/core-flow/Workflow.js.map +1 -0
- package/dist/esm/index.d.ts +1 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/patterns/LlmRouter.d.ts +221 -0
- package/dist/esm/patterns/LlmRouter.js +400 -0
- package/dist/esm/patterns/LlmRouter.js.map +1 -0
- package/dist/esm/patterns/LlmSwarm.d.ts +100 -0
- package/dist/esm/patterns/LlmSwarm.js +109 -0
- package/dist/esm/patterns/LlmSwarm.js.map +1 -0
- package/dist/esm/patterns/index.d.ts +2 -0
- package/dist/esm/patterns/index.js +2 -0
- package/dist/esm/patterns/index.js.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/patterns/LlmRouter.js +406 -0
- package/dist/patterns/LlmRouter.js.map +1 -0
- package/dist/patterns/LlmSwarm.js +113 -0
- package/dist/patterns/LlmSwarm.js.map +1 -0
- package/dist/patterns/index.js +6 -1
- package/dist/patterns/index.js.map +1 -1
- package/dist/types/core-flow/Workflow.d.ts +147 -0
- package/dist/types/core-flow/Workflow.d.ts.map +1 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/patterns/LlmRouter.d.ts +222 -0
- package/dist/types/patterns/LlmRouter.d.ts.map +1 -0
- package/dist/types/patterns/LlmSwarm.d.ts +101 -0
- package/dist/types/patterns/LlmSwarm.d.ts.map +1 -0
- package/dist/types/patterns/index.d.ts +2 -0
- package/dist/types/patterns/index.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -171,7 +171,7 @@ const pipeline = Sequence.create()
|
|
|
171
171
|
await pipeline.run({ message: 'URGENT: refund dispute on order #4411' });
|
|
172
172
|
```
|
|
173
173
|
|
|
174
|
-
The fourth primitive is `Loop` — `Loop.repeat(agent).until(guard).times(5)`, with a mandatory budget guard. And the named patterns from the research literature ship pre-composed from the same four: `selfConsistency` · `reflection` · `debate` · `mapReduce` · `tot` · `swarm
|
|
174
|
+
The fourth primitive is `Loop` — `Loop.repeat(agent).until(guard).times(5)`, with a mandatory budget guard. And the named patterns from the research literature ship pre-composed from the same four: `selfConsistency` · `reflection` · `debate` · `mapReduce` · `tot` · `swarm` · `llmSwarm` (a swarm whose hand-offs an LLM decides). Because every composition is a flowchart, the structure you wrote is the structure you see in the UI — and the trace spans the whole pipeline, not one agent at a time. [Designing systems of agents ↓](#-build--design-your-agent-or-system-of-agents)
|
|
175
175
|
|
|
176
176
|
---
|
|
177
177
|
|
|
@@ -753,7 +753,7 @@ The flowchart, recorders, and tests don't change between dev and prod.
|
|
|
753
753
|
|
|
754
754
|
**Core**
|
|
755
755
|
- 2 primitives — `LLMCall`, `Agent` (the ReAct loop)
|
|
756
|
-
- 4 control flows — `Sequence`, `Parallel`, `Conditional`, `Loop`
|
|
756
|
+
- 4 control flows — `Sequence`, `Parallel`, `Conditional`, `Loop` (plus `workflow()`, the same sequence with every hand-off type-checked by the compiler)
|
|
757
757
|
- 1 Injection primitive — `defineSkill` / `defineSteering` / `defineInstruction` / `defineFact`
|
|
758
758
|
- 1 reliability gate — `.reliability({ preCheck, postDecide, providers, circuitBreaker, fallback })`
|
|
759
759
|
- 1 tool dispatch primitive — `ToolProvider` (sync OR async) — `staticTools` · `gatedTools` · `skillScopedTools` · or a custom `ToolProvider` that discovers over hubs / MCP / per-tenant catalogs
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* workflow() — sequential steps whose hand-offs are checked by the compiler.
|
|
4
|
+
*
|
|
5
|
+
* WHY this exists: `Sequence` is the workhorse for "A, then B, then C",
|
|
6
|
+
* and every step it accepts has the same shape — takes `{ message }`,
|
|
7
|
+
* returns `string`. That is exactly right for chaining LLM calls, and
|
|
8
|
+
* exactly wrong the moment a step wants to hand the next one something
|
|
9
|
+
* structured: `Sequence` coerces any non-string step output to `''`
|
|
10
|
+
* (Sequence.ts, the step `outputMapper`), so a step that returns a parsed
|
|
11
|
+
* ticket silently hands the next step nothing at all. The mistake shows up
|
|
12
|
+
* as an empty prompt three steps later, at runtime, in production.
|
|
13
|
+
*
|
|
14
|
+
* `workflow()` closes that gap from both ends:
|
|
15
|
+
*
|
|
16
|
+
* - **At compile time** — step N's OUTPUT type must be what step N+1
|
|
17
|
+
* accepts. A `Runner<{ message: string }, Ticket>` followed by a
|
|
18
|
+
* `Runner<{ orderId: string }, string>` does not compile. The chain is
|
|
19
|
+
* proven before you run it, not debugged after.
|
|
20
|
+
* - **At run time** — a step's value is handed to the next step
|
|
21
|
+
* UNCHANGED. Objects stay objects. The one convenience is the house
|
|
22
|
+
* convention: a step that returns a `string` feeds the next step's
|
|
23
|
+
* `{ message }`, because that is what every LLM runner here wants.
|
|
24
|
+
*
|
|
25
|
+
* Pattern: Adapter over footprintjs's `addSubFlowChartNext`, with the
|
|
26
|
+
* type-level handoff proof carried by overloads (1–8 steps).
|
|
27
|
+
* Role: core-flow/ layer, alongside Sequence/Parallel/Conditional/Loop.
|
|
28
|
+
* Pure control flow — no LLM dependency.
|
|
29
|
+
* Emits: agentfootprint.composition.enter / exit, reported as kind
|
|
30
|
+
* `'Sequence'` — a workflow IS a sequential composition, and
|
|
31
|
+
* widening the public `CompositionKind` union would break
|
|
32
|
+
* exhaustive switches in consumer code for no behavioural gain.
|
|
33
|
+
*
|
|
34
|
+
* THREE HONEST LIMITS, all inherited from the engine and all verified in
|
|
35
|
+
* `test/core-flow/scenario/Workflow.test.ts` — worth knowing before you
|
|
36
|
+
* put rich objects on the wire:
|
|
37
|
+
*
|
|
38
|
+
* 1. Only PLAIN DATA crosses a step boundary. A value with a prototype
|
|
39
|
+
* (Date, Map, Set, a class instance) arrives as `{}`, and `undefined`
|
|
40
|
+
* fields are dropped. Send strings, numbers, arrays and plain
|
|
41
|
+
* objects; send a timestamp as an ISO string, not a `Date`.
|
|
42
|
+
* 2. A step must RETURN its output — the value handed forward is the
|
|
43
|
+
* step chart's traversal result. A step whose last stage returns
|
|
44
|
+
* nothing hands its whole scope forward instead.
|
|
45
|
+
* 3. The workflow's own input keys stay visible to LATER steps too
|
|
46
|
+
* (footprintjs's `getArgs()` inherits the run's arguments). A key the
|
|
47
|
+
* previous step actually produced always wins; a key it did NOT
|
|
48
|
+
* produce can still be read from the original input rather than
|
|
49
|
+
* coming back `undefined`.
|
|
50
|
+
*
|
|
51
|
+
* @example a typed three-step chain
|
|
52
|
+
* ```ts
|
|
53
|
+
* interface Ticket { orderId: string; angry: boolean }
|
|
54
|
+
*
|
|
55
|
+
* const parse: Runner<{ message: string }, Ticket> = …;
|
|
56
|
+
* const lookup: Runner<Ticket, { refundUsd: number }> = …;
|
|
57
|
+
* const reply: Runner<{ refundUsd: number }, string> = …;
|
|
58
|
+
*
|
|
59
|
+
* const intake = workflow(parse, lookup, reply);
|
|
60
|
+
* const answer = await intake.run({ message: 'where is my refund?' });
|
|
61
|
+
* // ^? string — the chain's last output type
|
|
62
|
+
*
|
|
63
|
+
* workflow(parse, reply); // ✗ compile error: Ticket is not { refundUsd }
|
|
64
|
+
* ```
|
|
65
|
+
*/
|
|
66
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
+
exports.workflow = exports.Workflow = void 0;
|
|
68
|
+
const footprintjs_1 = require("footprintjs");
|
|
69
|
+
const RunnerBase_js_1 = require("../core/RunnerBase.js");
|
|
70
|
+
const AgentRecorder_js_1 = require("../recorders/core/AgentRecorder.js");
|
|
71
|
+
const CompositionRecorder_js_1 = require("../recorders/core/CompositionRecorder.js");
|
|
72
|
+
const ContextRecorder_js_1 = require("../recorders/core/ContextRecorder.js");
|
|
73
|
+
const StreamRecorder_js_1 = require("../recorders/core/StreamRecorder.js");
|
|
74
|
+
const typedEmit_js_1 = require("../recorders/core/typedEmit.js");
|
|
75
|
+
/**
|
|
76
|
+
* Hand the previous step's value to the next step as its input args.
|
|
77
|
+
*
|
|
78
|
+
* `string` → `{ message }` (the house convention). Plain object → itself.
|
|
79
|
+
* Anything else is a broken hand-off and says so loudly: the alternative
|
|
80
|
+
* is an empty input three steps downstream with nothing pointing back
|
|
81
|
+
* here.
|
|
82
|
+
*/
|
|
83
|
+
function toStepArgs(value, stepNumber) {
|
|
84
|
+
if (typeof value === 'string')
|
|
85
|
+
return { message: value };
|
|
86
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
87
|
+
return { ...value };
|
|
88
|
+
}
|
|
89
|
+
const got = value === null ? 'null' : Array.isArray(value) ? 'an array' : typeof value;
|
|
90
|
+
throw new Error(`workflow: step ${stepNumber - 1} handed forward ${got}, but step ${stepNumber} needs an ` +
|
|
91
|
+
'object (or a string, which arrives as { message }). Make each step return its output.');
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* A sequential composition that passes values through untouched. Build one
|
|
95
|
+
* with {@link workflow} — that factory carries the type-level chain proof.
|
|
96
|
+
*/
|
|
97
|
+
class Workflow extends RunnerBase_js_1.RunnerBase {
|
|
98
|
+
name;
|
|
99
|
+
id;
|
|
100
|
+
steps;
|
|
101
|
+
opts;
|
|
102
|
+
currentRunContext = {
|
|
103
|
+
runStartMs: 0,
|
|
104
|
+
runId: 'pending',
|
|
105
|
+
compositionPath: [],
|
|
106
|
+
};
|
|
107
|
+
constructor(steps, opts = {}) {
|
|
108
|
+
super();
|
|
109
|
+
if (steps.length === 0) {
|
|
110
|
+
throw new Error('Workflow: must have at least one step');
|
|
111
|
+
}
|
|
112
|
+
this.opts = opts;
|
|
113
|
+
this.name = opts.name ?? 'Workflow';
|
|
114
|
+
this.id = opts.id ?? 'workflow';
|
|
115
|
+
this.steps = steps;
|
|
116
|
+
// Eager chart construction — see `RunnerBase.initChart` JSDoc.
|
|
117
|
+
this.initChart(() => this.buildChart());
|
|
118
|
+
}
|
|
119
|
+
async run(input, options) {
|
|
120
|
+
const executor = this.createExecutor();
|
|
121
|
+
this.lastExecutor = executor;
|
|
122
|
+
const result = await executor.run({ input: { ...input }, ...(options ?? {}) });
|
|
123
|
+
return this.finalizeResult(executor, result);
|
|
124
|
+
}
|
|
125
|
+
async resume(checkpoint, input, options) {
|
|
126
|
+
this.emitPauseResume(checkpoint, input);
|
|
127
|
+
const executor = this.createExecutor();
|
|
128
|
+
this.lastExecutor = executor;
|
|
129
|
+
const result = await executor.resume(checkpoint, input, options);
|
|
130
|
+
return this.finalizeResult(executor, result);
|
|
131
|
+
}
|
|
132
|
+
createExecutor() {
|
|
133
|
+
this.currentRunContext = {
|
|
134
|
+
runStartMs: Date.now(),
|
|
135
|
+
runId: (0, RunnerBase_js_1.makeRunId)(),
|
|
136
|
+
compositionPath: [`Workflow:${this.id}`],
|
|
137
|
+
};
|
|
138
|
+
const executor = new footprintjs_1.FlowChartExecutor(this.getSpec());
|
|
139
|
+
const dispatcher = this.getDispatcher();
|
|
140
|
+
const getRunCtx = () => this.currentRunContext;
|
|
141
|
+
executor.attachCombinedRecorder(new ContextRecorder_js_1.ContextRecorder({ dispatcher, getRunContext: getRunCtx }));
|
|
142
|
+
executor.attachCombinedRecorder((0, StreamRecorder_js_1.streamRecorder)({ dispatcher, getRunContext: getRunCtx }));
|
|
143
|
+
executor.attachCombinedRecorder((0, AgentRecorder_js_1.agentRecorder)({ dispatcher, getRunContext: getRunCtx }));
|
|
144
|
+
executor.attachCombinedRecorder((0, CompositionRecorder_js_1.compositionRecorder)({ dispatcher, getRunContext: getRunCtx }));
|
|
145
|
+
for (const r of this.attachedRecorders)
|
|
146
|
+
executor.attachCombinedRecorder(r);
|
|
147
|
+
return executor;
|
|
148
|
+
}
|
|
149
|
+
finalizeResult(executor, result) {
|
|
150
|
+
const paused = this.detectPause(executor, result);
|
|
151
|
+
if (paused)
|
|
152
|
+
return paused;
|
|
153
|
+
if (result instanceof Error)
|
|
154
|
+
throw result;
|
|
155
|
+
return result;
|
|
156
|
+
}
|
|
157
|
+
buildChart() {
|
|
158
|
+
const steps = this.steps;
|
|
159
|
+
const compositionId = this.id;
|
|
160
|
+
const compositionName = this.name;
|
|
161
|
+
const seed = (scope) => {
|
|
162
|
+
// The workflow's own input IS step 1's input — no unwrapping, no
|
|
163
|
+
// re-wrapping; that is the whole point of the typed chain.
|
|
164
|
+
scope.current = scope.$getArgs();
|
|
165
|
+
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.composition.enter', {
|
|
166
|
+
kind: 'Sequence',
|
|
167
|
+
id: compositionId,
|
|
168
|
+
name: compositionName,
|
|
169
|
+
childCount: steps.length,
|
|
170
|
+
});
|
|
171
|
+
};
|
|
172
|
+
// Root description prefix `Sequence:` is the taxonomy marker every
|
|
173
|
+
// consumer (Lens, FlowchartRecorder.mapTopologyToSteps) already reads.
|
|
174
|
+
let builder = (0, footprintjs_1.flowChart)('Seed', seed, 'seed', {
|
|
175
|
+
...(this.opts.structureRecorders !== undefined && {
|
|
176
|
+
structureRecorders: [...this.opts.structureRecorders],
|
|
177
|
+
}),
|
|
178
|
+
description: `Sequence: ${steps.length}-step typed workflow`,
|
|
179
|
+
});
|
|
180
|
+
steps.forEach((step, index) => {
|
|
181
|
+
const stepNumber = index + 1;
|
|
182
|
+
builder = builder.addSubFlowChartNext(`step-${stepNumber}`, step.getSpec(), `Step ${stepNumber}`, {
|
|
183
|
+
inputMapper: (parent) => toStepArgs(parent.current, stepNumber),
|
|
184
|
+
// Untouched: whatever the step's chart returned is what the next
|
|
185
|
+
// step (or the caller) receives. No string coercion.
|
|
186
|
+
outputMapper: (sfOutput) => ({ current: sfOutput }),
|
|
187
|
+
});
|
|
188
|
+
});
|
|
189
|
+
builder = builder.addFunction('Finalize', (scope) => {
|
|
190
|
+
(0, typedEmit_js_1.typedEmit)(scope, 'agentfootprint.composition.exit', {
|
|
191
|
+
kind: 'Sequence',
|
|
192
|
+
id: compositionId,
|
|
193
|
+
name: compositionName,
|
|
194
|
+
status: 'ok',
|
|
195
|
+
durationMs: Date.now() - this.currentRunContext.runStartMs,
|
|
196
|
+
});
|
|
197
|
+
return scope.current;
|
|
198
|
+
}, 'finalize', 'Workflow finalize');
|
|
199
|
+
return builder.build();
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
exports.Workflow = Workflow;
|
|
203
|
+
function workflow(...steps) {
|
|
204
|
+
if (steps.length === 0) {
|
|
205
|
+
throw new Error('workflow(): needs at least one step');
|
|
206
|
+
}
|
|
207
|
+
return new Workflow(steps);
|
|
208
|
+
}
|
|
209
|
+
exports.workflow = workflow;
|
|
210
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../src/core-flow/Workflow.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;;;AAEH,6CAQqB;AAIrB,yDAA8D;AAC9D,yEAAmE;AACnE,qFAA+E;AAC/E,6EAAuE;AACvE,2EAAqE;AACrE,iEAA2D;AAoC3D;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,KAAc,EAAE,UAAkB;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO,EAAE,GAAI,KAAiC,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK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I,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IACD,OAAO,IAAI,QAAQ,CAAC,KAAK,CAA2B,CAAC;AACvD,CAAC;AALD,4BAKC"}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* workflow() — sequential steps whose hand-offs are checked by the compiler.
|
|
3
|
+
*
|
|
4
|
+
* WHY this exists: `Sequence` is the workhorse for "A, then B, then C",
|
|
5
|
+
* and every step it accepts has the same shape — takes `{ message }`,
|
|
6
|
+
* returns `string`. That is exactly right for chaining LLM calls, and
|
|
7
|
+
* exactly wrong the moment a step wants to hand the next one something
|
|
8
|
+
* structured: `Sequence` coerces any non-string step output to `''`
|
|
9
|
+
* (Sequence.ts, the step `outputMapper`), so a step that returns a parsed
|
|
10
|
+
* ticket silently hands the next step nothing at all. The mistake shows up
|
|
11
|
+
* as an empty prompt three steps later, at runtime, in production.
|
|
12
|
+
*
|
|
13
|
+
* `workflow()` closes that gap from both ends:
|
|
14
|
+
*
|
|
15
|
+
* - **At compile time** — step N's OUTPUT type must be what step N+1
|
|
16
|
+
* accepts. A `Runner<{ message: string }, Ticket>` followed by a
|
|
17
|
+
* `Runner<{ orderId: string }, string>` does not compile. The chain is
|
|
18
|
+
* proven before you run it, not debugged after.
|
|
19
|
+
* - **At run time** — a step's value is handed to the next step
|
|
20
|
+
* UNCHANGED. Objects stay objects. The one convenience is the house
|
|
21
|
+
* convention: a step that returns a `string` feeds the next step's
|
|
22
|
+
* `{ message }`, because that is what every LLM runner here wants.
|
|
23
|
+
*
|
|
24
|
+
* Pattern: Adapter over footprintjs's `addSubFlowChartNext`, with the
|
|
25
|
+
* type-level handoff proof carried by overloads (1–8 steps).
|
|
26
|
+
* Role: core-flow/ layer, alongside Sequence/Parallel/Conditional/Loop.
|
|
27
|
+
* Pure control flow — no LLM dependency.
|
|
28
|
+
* Emits: agentfootprint.composition.enter / exit, reported as kind
|
|
29
|
+
* `'Sequence'` — a workflow IS a sequential composition, and
|
|
30
|
+
* widening the public `CompositionKind` union would break
|
|
31
|
+
* exhaustive switches in consumer code for no behavioural gain.
|
|
32
|
+
*
|
|
33
|
+
* THREE HONEST LIMITS, all inherited from the engine and all verified in
|
|
34
|
+
* `test/core-flow/scenario/Workflow.test.ts` — worth knowing before you
|
|
35
|
+
* put rich objects on the wire:
|
|
36
|
+
*
|
|
37
|
+
* 1. Only PLAIN DATA crosses a step boundary. A value with a prototype
|
|
38
|
+
* (Date, Map, Set, a class instance) arrives as `{}`, and `undefined`
|
|
39
|
+
* fields are dropped. Send strings, numbers, arrays and plain
|
|
40
|
+
* objects; send a timestamp as an ISO string, not a `Date`.
|
|
41
|
+
* 2. A step must RETURN its output — the value handed forward is the
|
|
42
|
+
* step chart's traversal result. A step whose last stage returns
|
|
43
|
+
* nothing hands its whole scope forward instead.
|
|
44
|
+
* 3. The workflow's own input keys stay visible to LATER steps too
|
|
45
|
+
* (footprintjs's `getArgs()` inherits the run's arguments). A key the
|
|
46
|
+
* previous step actually produced always wins; a key it did NOT
|
|
47
|
+
* produce can still be read from the original input rather than
|
|
48
|
+
* coming back `undefined`.
|
|
49
|
+
*
|
|
50
|
+
* @example a typed three-step chain
|
|
51
|
+
* ```ts
|
|
52
|
+
* interface Ticket { orderId: string; angry: boolean }
|
|
53
|
+
*
|
|
54
|
+
* const parse: Runner<{ message: string }, Ticket> = …;
|
|
55
|
+
* const lookup: Runner<Ticket, { refundUsd: number }> = …;
|
|
56
|
+
* const reply: Runner<{ refundUsd: number }, string> = …;
|
|
57
|
+
*
|
|
58
|
+
* const intake = workflow(parse, lookup, reply);
|
|
59
|
+
* const answer = await intake.run({ message: 'where is my refund?' });
|
|
60
|
+
* // ^? string — the chain's last output type
|
|
61
|
+
*
|
|
62
|
+
* workflow(parse, reply); // ✗ compile error: Ticket is not { refundUsd }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
import { type FlowchartCheckpoint, type RunOptions, type StructureRecorder } from 'footprintjs';
|
|
66
|
+
import type { RunnerPauseOutcome } from '../core/pause.js';
|
|
67
|
+
import type { Runner } from '../core/runner.js';
|
|
68
|
+
import { RunnerBase } from '../core/RunnerBase.js';
|
|
69
|
+
/**
|
|
70
|
+
* What the NEXT step must accept, given what the previous one returns.
|
|
71
|
+
*
|
|
72
|
+
* A `string` output feeds `{ message }` — the convention every runner in
|
|
73
|
+
* this library already speaks (LLMCall, Agent, Sequence, Swarm). Anything
|
|
74
|
+
* else is handed over as-is, so the next step's input type must be that
|
|
75
|
+
* same type.
|
|
76
|
+
*/
|
|
77
|
+
export type NextStepInput<TPreviousOutput> = TPreviousOutput extends string ? {
|
|
78
|
+
message: string;
|
|
79
|
+
} : TPreviousOutput;
|
|
80
|
+
/** Any runner, viewed only as "a thing with a chart" — the workflow never
|
|
81
|
+
* needs a step's own input/output types at run time. */
|
|
82
|
+
type AnyStep = Runner<never, unknown>;
|
|
83
|
+
export interface WorkflowOptions {
|
|
84
|
+
/** Human-friendly name for events + topology. Default `'Workflow'`. */
|
|
85
|
+
readonly name?: string;
|
|
86
|
+
/** Stable id used for topology + events. Default `'workflow'`. */
|
|
87
|
+
readonly id?: string;
|
|
88
|
+
/**
|
|
89
|
+
* Optional build-time recorders passed through to footprintjs's
|
|
90
|
+
* `flowChart()` factory — they observe this workflow's own nodes (Seed +
|
|
91
|
+
* one mount per step + Finalize). Not propagated into the mounted step
|
|
92
|
+
* charts; attach them to each step runner for full coverage.
|
|
93
|
+
*/
|
|
94
|
+
readonly structureRecorders?: readonly StructureRecorder[];
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* A sequential composition that passes values through untouched. Build one
|
|
98
|
+
* with {@link workflow} — that factory carries the type-level chain proof.
|
|
99
|
+
*/
|
|
100
|
+
export declare class Workflow<TIn extends object = object, TOut = unknown> extends RunnerBase<TIn, TOut> {
|
|
101
|
+
readonly name: string;
|
|
102
|
+
readonly id: string;
|
|
103
|
+
private readonly steps;
|
|
104
|
+
private readonly opts;
|
|
105
|
+
private currentRunContext;
|
|
106
|
+
constructor(steps: readonly AnyStep[], opts?: WorkflowOptions);
|
|
107
|
+
run(input: TIn, options?: RunOptions): Promise<TOut | RunnerPauseOutcome>;
|
|
108
|
+
resume(checkpoint: FlowchartCheckpoint, input?: unknown, options?: RunOptions): Promise<TOut | RunnerPauseOutcome>;
|
|
109
|
+
private createExecutor;
|
|
110
|
+
private finalizeResult;
|
|
111
|
+
private buildChart;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Chain 1–8 runners into one, with every hand-off checked by the compiler.
|
|
115
|
+
*
|
|
116
|
+
* Step N's output type must be what step N+1 accepts — a `string` output
|
|
117
|
+
* feeds the next step's `{ message }` (the house convention), anything
|
|
118
|
+
* else is handed over as-is. A chain that does not line up is a COMPILE
|
|
119
|
+
* error, not a silent empty value at run time.
|
|
120
|
+
*
|
|
121
|
+
* @example LLM steps chain as they always have
|
|
122
|
+
* ```ts
|
|
123
|
+
* const draft = LLMCall.create({ provider, model }).system('Draft it.').build();
|
|
124
|
+
* const edit = LLMCall.create({ provider, model }).system('Tighten it.').build();
|
|
125
|
+
*
|
|
126
|
+
* const pipeline = workflow(draft, edit);
|
|
127
|
+
* const text = await pipeline.run({ message: 'a note about refunds' });
|
|
128
|
+
* ```
|
|
129
|
+
*
|
|
130
|
+
* @example structured hand-offs survive
|
|
131
|
+
* ```ts
|
|
132
|
+
* const classify: Runner<{ message: string }, { topic: string }> = …;
|
|
133
|
+
* const answer: Runner<{ topic: string }, string> = …;
|
|
134
|
+
*
|
|
135
|
+
* await workflow(classify, answer).run({ message: 'my card was declined' });
|
|
136
|
+
* ```
|
|
137
|
+
*/
|
|
138
|
+
export declare function workflow<A extends object, B>(s1: Runner<A, B>): Workflow<A, B>;
|
|
139
|
+
export declare function workflow<A extends object, B, C>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>): Workflow<A, C>;
|
|
140
|
+
export declare function workflow<A extends object, B, C, D>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>): Workflow<A, D>;
|
|
141
|
+
export declare function workflow<A extends object, B, C, D, E>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>, s4: Runner<NextStepInput<D>, E>): Workflow<A, E>;
|
|
142
|
+
export declare function workflow<A extends object, B, C, D, E, F>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>, s4: Runner<NextStepInput<D>, E>, s5: Runner<NextStepInput<E>, F>): Workflow<A, F>;
|
|
143
|
+
export declare function workflow<A extends object, B, C, D, E, F, G>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>, s4: Runner<NextStepInput<D>, E>, s5: Runner<NextStepInput<E>, F>, s6: Runner<NextStepInput<F>, G>): Workflow<A, G>;
|
|
144
|
+
export declare function workflow<A extends object, B, C, D, E, F, G, H>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>, s4: Runner<NextStepInput<D>, E>, s5: Runner<NextStepInput<E>, F>, s6: Runner<NextStepInput<F>, G>, s7: Runner<NextStepInput<G>, H>): Workflow<A, H>;
|
|
145
|
+
export declare function workflow<A extends object, B, C, D, E, F, G, H, I>(s1: Runner<A, B>, s2: Runner<NextStepInput<B>, C>, s3: Runner<NextStepInput<C>, D>, s4: Runner<NextStepInput<D>, E>, s5: Runner<NextStepInput<E>, F>, s6: Runner<NextStepInput<F>, G>, s7: Runner<NextStepInput<G>, H>, s8: Runner<NextStepInput<H>, I>): Workflow<A, I>;
|
|
146
|
+
export {};
|
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* workflow() — sequential steps whose hand-offs are checked by the compiler.
|
|
3
|
+
*
|
|
4
|
+
* WHY this exists: `Sequence` is the workhorse for "A, then B, then C",
|
|
5
|
+
* and every step it accepts has the same shape — takes `{ message }`,
|
|
6
|
+
* returns `string`. That is exactly right for chaining LLM calls, and
|
|
7
|
+
* exactly wrong the moment a step wants to hand the next one something
|
|
8
|
+
* structured: `Sequence` coerces any non-string step output to `''`
|
|
9
|
+
* (Sequence.ts, the step `outputMapper`), so a step that returns a parsed
|
|
10
|
+
* ticket silently hands the next step nothing at all. The mistake shows up
|
|
11
|
+
* as an empty prompt three steps later, at runtime, in production.
|
|
12
|
+
*
|
|
13
|
+
* `workflow()` closes that gap from both ends:
|
|
14
|
+
*
|
|
15
|
+
* - **At compile time** — step N's OUTPUT type must be what step N+1
|
|
16
|
+
* accepts. A `Runner<{ message: string }, Ticket>` followed by a
|
|
17
|
+
* `Runner<{ orderId: string }, string>` does not compile. The chain is
|
|
18
|
+
* proven before you run it, not debugged after.
|
|
19
|
+
* - **At run time** — a step's value is handed to the next step
|
|
20
|
+
* UNCHANGED. Objects stay objects. The one convenience is the house
|
|
21
|
+
* convention: a step that returns a `string` feeds the next step's
|
|
22
|
+
* `{ message }`, because that is what every LLM runner here wants.
|
|
23
|
+
*
|
|
24
|
+
* Pattern: Adapter over footprintjs's `addSubFlowChartNext`, with the
|
|
25
|
+
* type-level handoff proof carried by overloads (1–8 steps).
|
|
26
|
+
* Role: core-flow/ layer, alongside Sequence/Parallel/Conditional/Loop.
|
|
27
|
+
* Pure control flow — no LLM dependency.
|
|
28
|
+
* Emits: agentfootprint.composition.enter / exit, reported as kind
|
|
29
|
+
* `'Sequence'` — a workflow IS a sequential composition, and
|
|
30
|
+
* widening the public `CompositionKind` union would break
|
|
31
|
+
* exhaustive switches in consumer code for no behavioural gain.
|
|
32
|
+
*
|
|
33
|
+
* THREE HONEST LIMITS, all inherited from the engine and all verified in
|
|
34
|
+
* `test/core-flow/scenario/Workflow.test.ts` — worth knowing before you
|
|
35
|
+
* put rich objects on the wire:
|
|
36
|
+
*
|
|
37
|
+
* 1. Only PLAIN DATA crosses a step boundary. A value with a prototype
|
|
38
|
+
* (Date, Map, Set, a class instance) arrives as `{}`, and `undefined`
|
|
39
|
+
* fields are dropped. Send strings, numbers, arrays and plain
|
|
40
|
+
* objects; send a timestamp as an ISO string, not a `Date`.
|
|
41
|
+
* 2. A step must RETURN its output — the value handed forward is the
|
|
42
|
+
* step chart's traversal result. A step whose last stage returns
|
|
43
|
+
* nothing hands its whole scope forward instead.
|
|
44
|
+
* 3. The workflow's own input keys stay visible to LATER steps too
|
|
45
|
+
* (footprintjs's `getArgs()` inherits the run's arguments). A key the
|
|
46
|
+
* previous step actually produced always wins; a key it did NOT
|
|
47
|
+
* produce can still be read from the original input rather than
|
|
48
|
+
* coming back `undefined`.
|
|
49
|
+
*
|
|
50
|
+
* @example a typed three-step chain
|
|
51
|
+
* ```ts
|
|
52
|
+
* interface Ticket { orderId: string; angry: boolean }
|
|
53
|
+
*
|
|
54
|
+
* const parse: Runner<{ message: string }, Ticket> = …;
|
|
55
|
+
* const lookup: Runner<Ticket, { refundUsd: number }> = …;
|
|
56
|
+
* const reply: Runner<{ refundUsd: number }, string> = …;
|
|
57
|
+
*
|
|
58
|
+
* const intake = workflow(parse, lookup, reply);
|
|
59
|
+
* const answer = await intake.run({ message: 'where is my refund?' });
|
|
60
|
+
* // ^? string — the chain's last output type
|
|
61
|
+
*
|
|
62
|
+
* workflow(parse, reply); // ✗ compile error: Ticket is not { refundUsd }
|
|
63
|
+
* ```
|
|
64
|
+
*/
|
|
65
|
+
import { FlowChartExecutor, flowChart, } from 'footprintjs';
|
|
66
|
+
import { RunnerBase, makeRunId } from '../core/RunnerBase.js';
|
|
67
|
+
import { agentRecorder } from '../recorders/core/AgentRecorder.js';
|
|
68
|
+
import { compositionRecorder } from '../recorders/core/CompositionRecorder.js';
|
|
69
|
+
import { ContextRecorder } from '../recorders/core/ContextRecorder.js';
|
|
70
|
+
import { streamRecorder } from '../recorders/core/StreamRecorder.js';
|
|
71
|
+
import { typedEmit } from '../recorders/core/typedEmit.js';
|
|
72
|
+
/**
|
|
73
|
+
* Hand the previous step's value to the next step as its input args.
|
|
74
|
+
*
|
|
75
|
+
* `string` → `{ message }` (the house convention). Plain object → itself.
|
|
76
|
+
* Anything else is a broken hand-off and says so loudly: the alternative
|
|
77
|
+
* is an empty input three steps downstream with nothing pointing back
|
|
78
|
+
* here.
|
|
79
|
+
*/
|
|
80
|
+
function toStepArgs(value, stepNumber) {
|
|
81
|
+
if (typeof value === 'string')
|
|
82
|
+
return { message: value };
|
|
83
|
+
if (typeof value === 'object' && value !== null && !Array.isArray(value)) {
|
|
84
|
+
return { ...value };
|
|
85
|
+
}
|
|
86
|
+
const got = value === null ? 'null' : Array.isArray(value) ? 'an array' : typeof value;
|
|
87
|
+
throw new Error(`workflow: step ${stepNumber - 1} handed forward ${got}, but step ${stepNumber} needs an ` +
|
|
88
|
+
'object (or a string, which arrives as { message }). Make each step return its output.');
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* A sequential composition that passes values through untouched. Build one
|
|
92
|
+
* with {@link workflow} — that factory carries the type-level chain proof.
|
|
93
|
+
*/
|
|
94
|
+
export class Workflow extends RunnerBase {
|
|
95
|
+
name;
|
|
96
|
+
id;
|
|
97
|
+
steps;
|
|
98
|
+
opts;
|
|
99
|
+
currentRunContext = {
|
|
100
|
+
runStartMs: 0,
|
|
101
|
+
runId: 'pending',
|
|
102
|
+
compositionPath: [],
|
|
103
|
+
};
|
|
104
|
+
constructor(steps, opts = {}) {
|
|
105
|
+
super();
|
|
106
|
+
if (steps.length === 0) {
|
|
107
|
+
throw new Error('Workflow: must have at least one step');
|
|
108
|
+
}
|
|
109
|
+
this.opts = opts;
|
|
110
|
+
this.name = opts.name ?? 'Workflow';
|
|
111
|
+
this.id = opts.id ?? 'workflow';
|
|
112
|
+
this.steps = steps;
|
|
113
|
+
// Eager chart construction — see `RunnerBase.initChart` JSDoc.
|
|
114
|
+
this.initChart(() => this.buildChart());
|
|
115
|
+
}
|
|
116
|
+
async run(input, options) {
|
|
117
|
+
const executor = this.createExecutor();
|
|
118
|
+
this.lastExecutor = executor;
|
|
119
|
+
const result = await executor.run({ input: { ...input }, ...(options ?? {}) });
|
|
120
|
+
return this.finalizeResult(executor, result);
|
|
121
|
+
}
|
|
122
|
+
async resume(checkpoint, input, options) {
|
|
123
|
+
this.emitPauseResume(checkpoint, input);
|
|
124
|
+
const executor = this.createExecutor();
|
|
125
|
+
this.lastExecutor = executor;
|
|
126
|
+
const result = await executor.resume(checkpoint, input, options);
|
|
127
|
+
return this.finalizeResult(executor, result);
|
|
128
|
+
}
|
|
129
|
+
createExecutor() {
|
|
130
|
+
this.currentRunContext = {
|
|
131
|
+
runStartMs: Date.now(),
|
|
132
|
+
runId: makeRunId(),
|
|
133
|
+
compositionPath: [`Workflow:${this.id}`],
|
|
134
|
+
};
|
|
135
|
+
const executor = new FlowChartExecutor(this.getSpec());
|
|
136
|
+
const dispatcher = this.getDispatcher();
|
|
137
|
+
const getRunCtx = () => this.currentRunContext;
|
|
138
|
+
executor.attachCombinedRecorder(new ContextRecorder({ dispatcher, getRunContext: getRunCtx }));
|
|
139
|
+
executor.attachCombinedRecorder(streamRecorder({ dispatcher, getRunContext: getRunCtx }));
|
|
140
|
+
executor.attachCombinedRecorder(agentRecorder({ dispatcher, getRunContext: getRunCtx }));
|
|
141
|
+
executor.attachCombinedRecorder(compositionRecorder({ dispatcher, getRunContext: getRunCtx }));
|
|
142
|
+
for (const r of this.attachedRecorders)
|
|
143
|
+
executor.attachCombinedRecorder(r);
|
|
144
|
+
return executor;
|
|
145
|
+
}
|
|
146
|
+
finalizeResult(executor, result) {
|
|
147
|
+
const paused = this.detectPause(executor, result);
|
|
148
|
+
if (paused)
|
|
149
|
+
return paused;
|
|
150
|
+
if (result instanceof Error)
|
|
151
|
+
throw result;
|
|
152
|
+
return result;
|
|
153
|
+
}
|
|
154
|
+
buildChart() {
|
|
155
|
+
const steps = this.steps;
|
|
156
|
+
const compositionId = this.id;
|
|
157
|
+
const compositionName = this.name;
|
|
158
|
+
const seed = (scope) => {
|
|
159
|
+
// The workflow's own input IS step 1's input — no unwrapping, no
|
|
160
|
+
// re-wrapping; that is the whole point of the typed chain.
|
|
161
|
+
scope.current = scope.$getArgs();
|
|
162
|
+
typedEmit(scope, 'agentfootprint.composition.enter', {
|
|
163
|
+
kind: 'Sequence',
|
|
164
|
+
id: compositionId,
|
|
165
|
+
name: compositionName,
|
|
166
|
+
childCount: steps.length,
|
|
167
|
+
});
|
|
168
|
+
};
|
|
169
|
+
// Root description prefix `Sequence:` is the taxonomy marker every
|
|
170
|
+
// consumer (Lens, FlowchartRecorder.mapTopologyToSteps) already reads.
|
|
171
|
+
let builder = flowChart('Seed', seed, 'seed', {
|
|
172
|
+
...(this.opts.structureRecorders !== undefined && {
|
|
173
|
+
structureRecorders: [...this.opts.structureRecorders],
|
|
174
|
+
}),
|
|
175
|
+
description: `Sequence: ${steps.length}-step typed workflow`,
|
|
176
|
+
});
|
|
177
|
+
steps.forEach((step, index) => {
|
|
178
|
+
const stepNumber = index + 1;
|
|
179
|
+
builder = builder.addSubFlowChartNext(`step-${stepNumber}`, step.getSpec(), `Step ${stepNumber}`, {
|
|
180
|
+
inputMapper: (parent) => toStepArgs(parent.current, stepNumber),
|
|
181
|
+
// Untouched: whatever the step's chart returned is what the next
|
|
182
|
+
// step (or the caller) receives. No string coercion.
|
|
183
|
+
outputMapper: (sfOutput) => ({ current: sfOutput }),
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
builder = builder.addFunction('Finalize', (scope) => {
|
|
187
|
+
typedEmit(scope, 'agentfootprint.composition.exit', {
|
|
188
|
+
kind: 'Sequence',
|
|
189
|
+
id: compositionId,
|
|
190
|
+
name: compositionName,
|
|
191
|
+
status: 'ok',
|
|
192
|
+
durationMs: Date.now() - this.currentRunContext.runStartMs,
|
|
193
|
+
});
|
|
194
|
+
return scope.current;
|
|
195
|
+
}, 'finalize', 'Workflow finalize');
|
|
196
|
+
return builder.build();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
export function workflow(...steps) {
|
|
200
|
+
if (steps.length === 0) {
|
|
201
|
+
throw new Error('workflow(): needs at least one step');
|
|
202
|
+
}
|
|
203
|
+
return new Workflow(steps);
|
|
204
|
+
}
|
|
205
|
+
//# sourceMappingURL=Workflow.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Workflow.js","sourceRoot":"","sources":["../../../src/core-flow/Workflow.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+DG;AAEH,OAAO,EACL,iBAAiB,EACjB,SAAS,GAMV,MAAM,aAAa,CAAC;AAIrB,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,mBAAmB,EAAE,MAAM,0CAA0C,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AACvE,OAAO,EAAE,cAAc,EAAE,MAAM,qCAAqC,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAoC3D;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,KAAc,EAAE,UAAkB;IACpD,IAAI,OAAO,KAAK,KAAK,QAAQ;QAAE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;IACzD,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;QACzE,OAAO,EAAE,GAAI,KAAiC,EAAE,CAAC;IACnD,CAAC;IACD,MAAM,GAAG,GAAG,KAAK,KAAK,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,OAAO,KAAK,CAAC;IACvF,MAAM,IAAI,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equence, SequenceBuilder, type SequenceInput, type SequenceOptions, ty
|
|
|
42
42
|
export { Parallel, ParallelBuilder, type BranchOutcome, type MergeFn, type MergeOutcomesFn, type MergeWithLLMOptions, type ParallelBranchOptions, type ParallelInput, type ParallelOptions, type ParallelOutput, } from './core-flow/Parallel.js';
|
|
43
43
|
export { Conditional, ConditionalBuilder, type ConditionalInput, type ConditionalOptions, type ConditionalOutput, type Predicate, } from './core-flow/Conditional.js';
|
|
44
44
|
export { Loop, LoopBuilder, type LoopInput, type LoopOptions, type LoopOutput, type UntilGuard, } from './core-flow/Loop.js';
|
|
45
|
+
export { workflow, Workflow, type NextStepInput, type WorkflowOptions, } from './core-flow/Workflow.js';
|
|
45
46
|
export { providerFromEnv, type ProviderKind, type CreateProviderOptions, type ProviderFromEnv, } from './adapters/llm/createProvider.js';
|
|
46
47
|
export * from './patterns/index.js';
|
|
47
48
|
export { defineRAG, type DefineRAGOptions, indexDocuments, type IndexDocumentsOptions, type RagDocument, } from './lib/rag/index.js';
|
package/dist/esm/index.js
CHANGED
|
@@ -102,6 +102,7 @@ export { Sequence, SequenceBuilder, } from './core-flow/Sequence.js';
|
|
|
102
102
|
export { Parallel, ParallelBuilder, } from './core-flow/Parallel.js';
|
|
103
103
|
export { Conditional, ConditionalBuilder, } from './core-flow/Conditional.js';
|
|
104
104
|
export { Loop, LoopBuilder, } from './core-flow/Loop.js';
|
|
105
|
+
export { workflow, Workflow, } from './core-flow/Workflow.js';
|
|
105
106
|
// Adapters — LLM providers
|
|
106
107
|
// `mock(...)` is the lowercase factory equivalent to `new MockProvider(...)`.
|
|
107
108
|
// `anthropic(...)` is the real Claude provider via `@anthropic-ai/sdk`.
|
package/dist/esm/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,oEAAoE;AACpE,8DAA8D;AAC9D,uEAAuE;AACvE,kEAAkE;A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