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
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* llmSwarm — the classic Swarm, with the LLM doing the routing.
|
|
3
|
+
*
|
|
4
|
+
* WHY this exists: `swarm()` gives you the hand-off machinery but asks you
|
|
5
|
+
* for a sync `route()` function; `llmRouter()` gives you the LLM decision
|
|
6
|
+
* but asks you to place it in the chain yourself. Placing it correctly is
|
|
7
|
+
* the fiddly half — the decision for a message must be made BEFORE that
|
|
8
|
+
* message reaches `route()`, which means one router call before the first
|
|
9
|
+
* turn and one after every turn. Get it wrong and the swarm halts on turn
|
|
10
|
+
* one for no visible reason. This wires it, once:
|
|
11
|
+
*
|
|
12
|
+
* Sequence
|
|
13
|
+
* ├── router.step ← the first decision
|
|
14
|
+
* └── swarm({ agents, route }) ← Loop(Conditional(agent))
|
|
15
|
+
* └── per agent: Sequence(agent → router.step)
|
|
16
|
+
* ↑ the next decision, made on
|
|
17
|
+
* the text it hands forward
|
|
18
|
+
*
|
|
19
|
+
* Every `route()` call is then a lookup of a decision already made for
|
|
20
|
+
* that exact message. No LLM call ever happens inside `route()` — which
|
|
21
|
+
* matters, because `swarm()` evaluates it once per branch predicate AND
|
|
22
|
+
* again in the loop's exit guard.
|
|
23
|
+
*
|
|
24
|
+
* Pattern: Facade (GoF) over `llmRouter` + `swarm` + `Sequence`. No new
|
|
25
|
+
* control flow — everything here is composition.
|
|
26
|
+
*
|
|
27
|
+
* Cost shape: one routing call per turn, plus one to start. A 2-hand-off
|
|
28
|
+
* conversation costs 3 routing calls and 2 specialist calls.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const desk = llmSwarm({
|
|
33
|
+
* provider,
|
|
34
|
+
* model: 'claude-sonnet-4-5',
|
|
35
|
+
* agents: [
|
|
36
|
+
* { id: 'billing', description: 'Invoices, refunds, payment methods.', runner: billingAgent },
|
|
37
|
+
* { id: 'tech', description: 'Login problems, errors, outages.', runner: techAgent },
|
|
38
|
+
* ],
|
|
39
|
+
* maxHandoffs: 4,
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* desk.on('agentfootprint.composition.route_decided', (e) =>
|
|
43
|
+
* console.log(e.payload.chosen, '←', e.payload.rationale),
|
|
44
|
+
* );
|
|
45
|
+
*
|
|
46
|
+
* const answer = await desk.run({ message: 'my invoice is wrong' });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
import type { LLMProvider } from '../adapters/types.js';
|
|
50
|
+
import type { Runner } from '../core/runner.js';
|
|
51
|
+
import { type SwarmAgent } from './Swarm.js';
|
|
52
|
+
/**
|
|
53
|
+
* A swarm member as the LLM router sees it: the runner that handles a
|
|
54
|
+
* turn, plus the `description` that becomes its line in the router's
|
|
55
|
+
* prompt. One source — the roster the swarm dispatches on and the roster
|
|
56
|
+
* the model reads are the same list.
|
|
57
|
+
*/
|
|
58
|
+
export interface LlmSwarmAgent extends SwarmAgent {
|
|
59
|
+
/** What this agent handles, in the model's language. Required here:
|
|
60
|
+
* an agent with no description is invisible to the router. */
|
|
61
|
+
readonly description: string;
|
|
62
|
+
}
|
|
63
|
+
export interface LlmSwarmOptions {
|
|
64
|
+
/** The LLM that makes the routing decisions (not the specialists' own). */
|
|
65
|
+
readonly provider: LLMProvider;
|
|
66
|
+
/** Model to ask for routing decisions. */
|
|
67
|
+
readonly model: string;
|
|
68
|
+
/** The roster. Two or more; ids must be unique and none may be `'done'`. */
|
|
69
|
+
readonly agents: readonly LlmSwarmAgent[];
|
|
70
|
+
/** Extra authored framing for the router. See `llmRouter`. */
|
|
71
|
+
readonly instruction?: string;
|
|
72
|
+
/** Routing temperature. Default `0`. */
|
|
73
|
+
readonly temperature?: number;
|
|
74
|
+
/**
|
|
75
|
+
* Maximum agent turns before the loop halts. Default 10 (the swarm's
|
|
76
|
+
* own default). The router runs once per turn plus once to start.
|
|
77
|
+
*/
|
|
78
|
+
readonly maxHandoffs?: number;
|
|
79
|
+
/** Stable id for the swarm's composition events. Default `'swarm'`. */
|
|
80
|
+
readonly id?: string;
|
|
81
|
+
/** Display name. Default `'Swarm'`. */
|
|
82
|
+
readonly name?: string;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Build a swarm whose hand-offs are decided by an LLM.
|
|
86
|
+
*
|
|
87
|
+
* Halting: the router omits `agentId` when it judges the work done — the
|
|
88
|
+
* swarm stops and that decision's `message` is the answer. An id that is
|
|
89
|
+
* not in the roster follows `swarm()`'s existing law (the `done` fallback
|
|
90
|
+
* echoes the message and the loop guard halts), so a hallucinated agent
|
|
91
|
+
* ends the run instead of silently picking someone.
|
|
92
|
+
*
|
|
93
|
+
* Watching it: subscribe to `agentfootprint.composition.route_decided` —
|
|
94
|
+
* every decision arrives with the chosen id, a rationale, and the model's
|
|
95
|
+
* own `reason` as evidence. (That reason stays in the trace; it is never
|
|
96
|
+
* fed back into a prompt.)
|
|
97
|
+
*/
|
|
98
|
+
export declare function llmSwarm(opts: LlmSwarmOptions): Runner<{
|
|
99
|
+
message: string;
|
|
100
|
+
}, string>;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* llmSwarm — the classic Swarm, with the LLM doing the routing.
|
|
3
|
+
*
|
|
4
|
+
* WHY this exists: `swarm()` gives you the hand-off machinery but asks you
|
|
5
|
+
* for a sync `route()` function; `llmRouter()` gives you the LLM decision
|
|
6
|
+
* but asks you to place it in the chain yourself. Placing it correctly is
|
|
7
|
+
* the fiddly half — the decision for a message must be made BEFORE that
|
|
8
|
+
* message reaches `route()`, which means one router call before the first
|
|
9
|
+
* turn and one after every turn. Get it wrong and the swarm halts on turn
|
|
10
|
+
* one for no visible reason. This wires it, once:
|
|
11
|
+
*
|
|
12
|
+
* Sequence
|
|
13
|
+
* ├── router.step ← the first decision
|
|
14
|
+
* └── swarm({ agents, route }) ← Loop(Conditional(agent))
|
|
15
|
+
* └── per agent: Sequence(agent → router.step)
|
|
16
|
+
* ↑ the next decision, made on
|
|
17
|
+
* the text it hands forward
|
|
18
|
+
*
|
|
19
|
+
* Every `route()` call is then a lookup of a decision already made for
|
|
20
|
+
* that exact message. No LLM call ever happens inside `route()` — which
|
|
21
|
+
* matters, because `swarm()` evaluates it once per branch predicate AND
|
|
22
|
+
* again in the loop's exit guard.
|
|
23
|
+
*
|
|
24
|
+
* Pattern: Facade (GoF) over `llmRouter` + `swarm` + `Sequence`. No new
|
|
25
|
+
* control flow — everything here is composition.
|
|
26
|
+
*
|
|
27
|
+
* Cost shape: one routing call per turn, plus one to start. A 2-hand-off
|
|
28
|
+
* conversation costs 3 routing calls and 2 specialist calls.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const desk = llmSwarm({
|
|
33
|
+
* provider,
|
|
34
|
+
* model: 'claude-sonnet-4-5',
|
|
35
|
+
* agents: [
|
|
36
|
+
* { id: 'billing', description: 'Invoices, refunds, payment methods.', runner: billingAgent },
|
|
37
|
+
* { id: 'tech', description: 'Login problems, errors, outages.', runner: techAgent },
|
|
38
|
+
* ],
|
|
39
|
+
* maxHandoffs: 4,
|
|
40
|
+
* });
|
|
41
|
+
*
|
|
42
|
+
* desk.on('agentfootprint.composition.route_decided', (e) =>
|
|
43
|
+
* console.log(e.payload.chosen, '←', e.payload.rationale),
|
|
44
|
+
* );
|
|
45
|
+
*
|
|
46
|
+
* const answer = await desk.run({ message: 'my invoice is wrong' });
|
|
47
|
+
* ```
|
|
48
|
+
*/
|
|
49
|
+
import { Sequence } from '../core-flow/Sequence.js';
|
|
50
|
+
import { llmRouter } from './LlmRouter.js';
|
|
51
|
+
import { swarm } from './Swarm.js';
|
|
52
|
+
/**
|
|
53
|
+
* Build a swarm whose hand-offs are decided by an LLM.
|
|
54
|
+
*
|
|
55
|
+
* Halting: the router omits `agentId` when it judges the work done — the
|
|
56
|
+
* swarm stops and that decision's `message` is the answer. An id that is
|
|
57
|
+
* not in the roster follows `swarm()`'s existing law (the `done` fallback
|
|
58
|
+
* echoes the message and the loop guard halts), so a hallucinated agent
|
|
59
|
+
* ends the run instead of silently picking someone.
|
|
60
|
+
*
|
|
61
|
+
* Watching it: subscribe to `agentfootprint.composition.route_decided` —
|
|
62
|
+
* every decision arrives with the chosen id, a rationale, and the model's
|
|
63
|
+
* own `reason` as evidence. (That reason stays in the trace; it is never
|
|
64
|
+
* fed back into a prompt.)
|
|
65
|
+
*/
|
|
66
|
+
export function llmSwarm(opts) {
|
|
67
|
+
// Checked here, before the router is built, so the error names the call
|
|
68
|
+
// the consumer actually made.
|
|
69
|
+
if (opts.agents.length < 2) {
|
|
70
|
+
throw new Error('llmSwarm: must have >= 2 agents (use Agent for 1)');
|
|
71
|
+
}
|
|
72
|
+
const id = opts.id ?? 'swarm';
|
|
73
|
+
const name = opts.name ?? 'Swarm';
|
|
74
|
+
const router = llmRouter({
|
|
75
|
+
provider: opts.provider,
|
|
76
|
+
model: opts.model,
|
|
77
|
+
agents: opts.agents.map((a) => ({ id: a.id, description: a.description })),
|
|
78
|
+
...(opts.instruction !== undefined && { instruction: opts.instruction }),
|
|
79
|
+
...(opts.temperature !== undefined && { temperature: opts.temperature }),
|
|
80
|
+
id: `${id}-router`,
|
|
81
|
+
name: `${name} router`,
|
|
82
|
+
});
|
|
83
|
+
// Each turn is "agent answers, then the router reads that answer" — so
|
|
84
|
+
// the decision for the text the loop carries forward exists before the
|
|
85
|
+
// next iteration's route() and before the loop's exit guard.
|
|
86
|
+
const agents = opts.agents.map((a) => ({
|
|
87
|
+
id: a.id,
|
|
88
|
+
...(a.name !== undefined && { name: a.name }),
|
|
89
|
+
runner: Sequence.create({
|
|
90
|
+
id: `${id}-${a.id}-turn`,
|
|
91
|
+
name: `${a.name ?? a.id} turn`,
|
|
92
|
+
})
|
|
93
|
+
.step('agent', a.runner)
|
|
94
|
+
.step('route', router.step)
|
|
95
|
+
.build(),
|
|
96
|
+
}));
|
|
97
|
+
const dispatch = swarm({
|
|
98
|
+
agents,
|
|
99
|
+
route: router.route,
|
|
100
|
+
...(opts.maxHandoffs !== undefined && { maxHandoffs: opts.maxHandoffs }),
|
|
101
|
+
id,
|
|
102
|
+
name,
|
|
103
|
+
});
|
|
104
|
+
return Sequence.create({ id: `${id}-chain`, name })
|
|
105
|
+
.step('route', router.step)
|
|
106
|
+
.step('swarm', dispatch)
|
|
107
|
+
.build();
|
|
108
|
+
}
|
|
109
|
+
//# sourceMappingURL=LlmSwarm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LlmSwarm.js","sourceRoot":"","sources":["../../../src/patterns/LlmSwarm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,SAAS,EAAkB,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,KAAK,EAAmB,MAAM,YAAY,CAAC;AAoCpD;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,QAAQ,CAAC,IAAqB;IAC5C,wEAAwE;IACxE,8BAA8B;IAC9B,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;IACvE,CAAC;IACD,MAAM,EAAE,GAAG,IAAI,CAAC,EAAE,IAAI,OAAO,CAAC;IAC9B,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,IAAI,OAAO,CAAC;IAElC,MAAM,MAAM,GAAc,SAAS,CAAC;QAClC,QAAQ,EAAE,IAAI,CAAC,QAAQ;QACvB,KAAK,EAAE,IAAI,CAAC,KAAK;QACjB,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,WAAW,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;QAC1E,GAAG,CAAC,IAAI,CAAC,WA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AAE,MAAM,CAAC,IAAI,CAAC;SAC1B,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC;SACvB,KAAK,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -20,3 +20,5 @@ export { debate, type DebateOptions } from './Debate.js';
|
|
|
20
20
|
export { mapReduce, type MapReduceOptions } from './MapReduce.js';
|
|
21
21
|
export { tot, type ToTOptions } from './ToT.js';
|
|
22
22
|
export { swarm, type SwarmOptions, type SwarmAgent } from './Swarm.js';
|
|
23
|
+
export { llmRouter, RoutingDecisionError, type LlmRouter, type LlmRouterOptions, type RouterAgent, type RoutingDecision, } from './LlmRouter.js';
|
|
24
|
+
export { llmSwarm, type LlmSwarmAgent, type LlmSwarmOptions } from './LlmSwarm.js';
|
|
@@ -20,4 +20,6 @@ export { debate } from './Debate.js';
|
|
|
20
20
|
export { mapReduce } from './MapReduce.js';
|
|
21
21
|
export { tot } from './ToT.js';
|
|
22
22
|
export { swarm } from './Swarm.js';
|
|
23
|
+
export { llmRouter, RoutingDecisionError, } from './LlmRouter.js';
|
|
24
|
+
export { llmSwarm } from './LlmSwarm.js';
|
|
23
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,KAAK,EAAsC,MAAM,YAAY,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/patterns/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,eAAe,EAA+B,MAAM,sBAAsB,CAAC;AACpF,OAAO,EAAE,UAAU,EAA0B,MAAM,iBAAiB,CAAC;AACrE,OAAO,EAAE,MAAM,EAAsB,MAAM,aAAa,CAAC;AACzD,OAAO,EAAE,SAAS,EAAyB,MAAM,gBAAgB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAmB,MAAM,UAAU,CAAC;AAChD,OAAO,EAAE,KAAK,EAAsC,MAAM,YAAY,CAAC;AACvE,OAAO,EACL,SAAS,EACT,oBAAoB,GAKrB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,QAAQ,EAA4C,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -22,7 +22,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.ConditionalBuilder = exports.Conditional = exports.ParallelBuilder = exports.Parallel = exports.SequenceBuilder = exports.Sequence = exports.formatToolContractCheckup = exports.toolContractCheckup = exports.warnIfInvalidToolName = exports.assertValidToolName = exports.defineTool = exports.flowchartAsTool = exports.RunCheckpointError = exports.applyOutputSchema = exports.OutputSchemaError = exports.AgentBuilder = exports.Agent = exports.buildAgentMessageApiChart = exports.LLMCallBuilder = exports.LLMCall = exports.selectCommentaryKey = exports.renderCommentary = exports.extractCommentaryVars = exports.extractAgentName = exports.defaultCommentaryTemplates = exports.CheckInRecorder = exports.minimalEvidenceAssembler = exports.standardEvidenceAssembler = exports.lexicalDriverScorer = exports.isCheckInDecision = exports.checkInDeclined = exports.checkInApproved = exports.isCheckInPause = exports.isPaused = exports.isPauseRequest = exports.askHuman = exports.pauseHere = exports.makeRunId = exports.RunnerBase = exports.BASELINE_SOURCES = exports.ENGINEERED_SOURCES = exports.isBaselineSource = exports.isEngineeredSource = exports.contextEngineering = exports.COMPOSITION_KEYS = exports.milestoneFor = exports.stageRole = exports.isInjectionKey = exports.injectionKeyForSlot = exports.INJECTION_KEYS = void 0;
|
|
25
|
-
exports.indexDocuments = exports.defineRAG = exports.providerFromEnv = exports.LoopBuilder = exports.Loop = void 0;
|
|
25
|
+
exports.indexDocuments = exports.defineRAG = exports.providerFromEnv = exports.Workflow = exports.workflow = exports.LoopBuilder = exports.Loop = void 0;
|
|
26
26
|
// Side-effect imports — auto-register v2.6+ cache strategies in the
|
|
27
27
|
// strategy registry. Without these, only the wildcard NoOp is
|
|
28
28
|
// registered and `Agent.create({ provider: browserAnthropic({...}) })`
|
|
@@ -169,6 +169,9 @@ Object.defineProperty(exports, "ConditionalBuilder", { enumerable: true, get: fu
|
|
|
169
169
|
var Loop_js_1 = require("./core-flow/Loop.js");
|
|
170
170
|
Object.defineProperty(exports, "Loop", { enumerable: true, get: function () { return Loop_js_1.Loop; } });
|
|
171
171
|
Object.defineProperty(exports, "LoopBuilder", { enumerable: true, get: function () { return Loop_js_1.LoopBuilder; } });
|
|
172
|
+
var Workflow_js_1 = require("./core-flow/Workflow.js");
|
|
173
|
+
Object.defineProperty(exports, "workflow", { enumerable: true, get: function () { return Workflow_js_1.workflow; } });
|
|
174
|
+
Object.defineProperty(exports, "Workflow", { enumerable: true, get: function () { return Workflow_js_1.Workflow; } });
|
|
172
175
|
// Adapters — LLM providers
|
|
173
176
|
// `mock(...)` is the lowercase factory equivalent to `new MockProvider(...)`.
|
|
174
177
|
// `anthropic(...)` is the real Claude provider via `@anthropic-ai/sdk`.
|
package/dist/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;AAClE,sEAAsE;AACtE,sDAAsD;AACtD,wDAAsD;AACtD,qDAAmD;AACnD,sDAAoD;AAsCpD,6BAA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