@ai-ecoverse/slicc-agent 6.18.18 → 6.19.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +23 -1
- package/dist/codemode/index.js +8 -1
- package/dist/codemode/index.js.map +2 -2
- package/dist/guests/guard.js +32 -2
- package/dist/guests/guard.js.map +2 -2
- package/dist/scoops/cli.js +3 -0
- package/dist/scoops/cli.js.map +2 -2
- package/dist/scoops/index.js +14 -0
- package/dist/scoops/index.js.map +2 -2
- package/dist/scoops/service.js +6 -1
- package/dist/scoops/service.js.map +2 -2
- package/dist/types/codemode/index.d.ts +3 -1
- package/dist/types/guests/guard.d.ts +10 -1
- package/dist/types/scoops/cli.d.ts +2 -1
- package/dist/types/scoops/service.d.ts +11 -1
- package/dist/types/workflow/index.d.ts +104 -0
- package/dist/types/workflow/run.d.ts +137 -0
- package/dist/types/workflow/script.d.ts +20 -0
- package/dist/types/workflow/step.d.ts +53 -0
- package/dist/workflow/index.js +444 -0
- package/dist/workflow/index.js.map +7 -0
- package/dist/workflow/run.js +437 -0
- package/dist/workflow/run.js.map +7 -0
- package/dist/workflow/script.js +250 -0
- package/dist/workflow/script.js.map +7 -0
- package/dist/workflow/step.js +132 -0
- package/dist/workflow/step.js.map +7 -0
- package/package.json +4 -4
- package/packages/vfs-root/skills/agent/SKILL.md +4 -0
|
@@ -0,0 +1,444 @@
|
|
|
1
|
+
import { Type } from "@earendil-works/pi-ai";
|
|
2
|
+
import {
|
|
3
|
+
defineExtension,
|
|
4
|
+
defineTool
|
|
5
|
+
} from "@earendil-works/pi-durable";
|
|
6
|
+
import { MEMORY_LIMIT_BYTES, sharedSandbox } from "../codemode/index.js";
|
|
7
|
+
import { runTaints } from "../guests/guard.js";
|
|
8
|
+
import { resolve } from "../kernel/paths.js";
|
|
9
|
+
import { coneOf } from "../scoops/service.js";
|
|
10
|
+
import {
|
|
11
|
+
KEPT_RUNS,
|
|
12
|
+
runTask,
|
|
13
|
+
WorkflowsDoc
|
|
14
|
+
} from "./run.js";
|
|
15
|
+
import { buildCode, DEFAULT_CONCURRENCY, maxConcurrency, parseMeta } from "./script.js";
|
|
16
|
+
import { WorkflowsDoc as WorkflowsDoc2 } from "./run.js";
|
|
17
|
+
const WORKFLOW = "workflow";
|
|
18
|
+
const SAVE_NAME = /^[a-z0-9][a-z0-9-]*$/;
|
|
19
|
+
const ok = (out) => ({ code: 0, out });
|
|
20
|
+
const fail = (out, code = 1) => ({ code, out: `workflow: ${out}
|
|
21
|
+
` });
|
|
22
|
+
function workflowsDir(home) {
|
|
23
|
+
return `${home}/.slicc/workflows`;
|
|
24
|
+
}
|
|
25
|
+
function pathOf(files, target) {
|
|
26
|
+
if (SAVE_NAME.test(target) && !target.endsWith(".js"))
|
|
27
|
+
return `${files.dir}/${target}.workflow.js`;
|
|
28
|
+
return resolve(files.cwd, target);
|
|
29
|
+
}
|
|
30
|
+
function concurrencyOf(value) {
|
|
31
|
+
const most = maxConcurrency();
|
|
32
|
+
if (value === void 0) return Math.min(DEFAULT_CONCURRENCY, most);
|
|
33
|
+
if (!Number.isFinite(value)) throw new Error("concurrency must be a number");
|
|
34
|
+
return Math.min(most, Math.max(1, Math.trunc(value)));
|
|
35
|
+
}
|
|
36
|
+
function budgetOf(value) {
|
|
37
|
+
if (value === void 0) return null;
|
|
38
|
+
if (!Number.isFinite(value) || value <= 0) throw new Error("budget must be a positive number");
|
|
39
|
+
return value;
|
|
40
|
+
}
|
|
41
|
+
async function sourceOf(request, context) {
|
|
42
|
+
if (request.script) return { source: request.target, file: null };
|
|
43
|
+
const path = pathOf(request.files, request.target);
|
|
44
|
+
const read = await request.files.env.readTextFile(path, context);
|
|
45
|
+
if (!read.ok) throw new Error(`can't read ${path}: ${read.error.message}`);
|
|
46
|
+
return { source: read.value, file: path };
|
|
47
|
+
}
|
|
48
|
+
function prune(runs) {
|
|
49
|
+
const ended = Object.values(runs).filter((run) => run.status !== "running").sort((a, b) => Number(a.id) - Number(b.id));
|
|
50
|
+
for (const run of ended.slice(0, Math.max(0, ended.length - KEPT_RUNS))) delete runs[run.id];
|
|
51
|
+
}
|
|
52
|
+
function summary(run) {
|
|
53
|
+
const budget = run.budget === null ? "" : ` of ${run.budget}`;
|
|
54
|
+
const lines = [
|
|
55
|
+
`run ${run.id}: ${run.name} (${run.status})`,
|
|
56
|
+
`phase: ${run.phase ?? "-"}`,
|
|
57
|
+
`agents: ${run.agents.done} done, ${run.agents.failed} failed, ${run.agents.running.length} running, ${run.agents.started} started`,
|
|
58
|
+
`output tokens: ${run.spent}${budget}`,
|
|
59
|
+
`concurrency: ${run.concurrency}`
|
|
60
|
+
];
|
|
61
|
+
if (run.logs.length) lines.push("log:", ...run.logs.slice(-20).map((line) => ` ${line}`));
|
|
62
|
+
if (run.error) lines.push(`error: ${run.error}`);
|
|
63
|
+
if (run.status === "completed")
|
|
64
|
+
lines.push(`result: ${JSON.stringify(run.result ?? null, null, 2)}`);
|
|
65
|
+
return `${lines.join("\n")}
|
|
66
|
+
`;
|
|
67
|
+
}
|
|
68
|
+
function outcome(run) {
|
|
69
|
+
if (run.status === "completed") return ok(`${JSON.stringify(run.result ?? null, null, 2)}
|
|
70
|
+
`);
|
|
71
|
+
if (run.status === "stopped") return fail(`run ${run.id} was stopped`);
|
|
72
|
+
return fail(`run ${run.id} failed: ${run.error ?? "unknown error"}`);
|
|
73
|
+
}
|
|
74
|
+
function createWorkflows(host) {
|
|
75
|
+
const runs = async (context) => {
|
|
76
|
+
const { harness } = await host;
|
|
77
|
+
return (await harness.snapshot(WorkflowsDoc, context))?.runs ?? {};
|
|
78
|
+
};
|
|
79
|
+
const find = async (id, context) => (await runs(context))[id];
|
|
80
|
+
async function start(request, context) {
|
|
81
|
+
const { harness, agents } = await host;
|
|
82
|
+
const { source, file } = await sourceOf(request, context);
|
|
83
|
+
const meta = parseMeta(source);
|
|
84
|
+
const budget = budgetOf(request.budget);
|
|
85
|
+
const concurrency = concurrencyOf(request.concurrency);
|
|
86
|
+
const code = buildCode(source, {
|
|
87
|
+
...request.args !== void 0 ? { args: request.args } : {},
|
|
88
|
+
budget,
|
|
89
|
+
concurrency
|
|
90
|
+
});
|
|
91
|
+
const cone = await agents.conversation(request.cone, context);
|
|
92
|
+
if (!cone) throw new Error(`there is no cone ${request.cone}`);
|
|
93
|
+
const from = request.from ?? null;
|
|
94
|
+
const taints = from === null ? [] : await runTaints(harness, from, context);
|
|
95
|
+
return harness.commit(async (tx) => {
|
|
96
|
+
const task = await tx.createTask(
|
|
97
|
+
(await host).tasks.run,
|
|
98
|
+
{ code },
|
|
99
|
+
{
|
|
100
|
+
ownership: { kind: "conversation" },
|
|
101
|
+
conversationId: cone.id,
|
|
102
|
+
background: true
|
|
103
|
+
}
|
|
104
|
+
);
|
|
105
|
+
const doc = await tx.doc(WorkflowsDoc);
|
|
106
|
+
prune(doc.runs);
|
|
107
|
+
const id = String(task);
|
|
108
|
+
doc.runs[id] = {
|
|
109
|
+
id,
|
|
110
|
+
name: meta.name,
|
|
111
|
+
description: meta.description,
|
|
112
|
+
cone: request.cone,
|
|
113
|
+
home: request.files.dir,
|
|
114
|
+
file,
|
|
115
|
+
source,
|
|
116
|
+
budget,
|
|
117
|
+
concurrency,
|
|
118
|
+
status: "running",
|
|
119
|
+
phase: null,
|
|
120
|
+
started: Date.now(),
|
|
121
|
+
ended: null,
|
|
122
|
+
agents: { started: 0, done: 0, failed: 0, running: [] },
|
|
123
|
+
spent: 0,
|
|
124
|
+
logs: [],
|
|
125
|
+
fromAgent: from !== null,
|
|
126
|
+
taints
|
|
127
|
+
};
|
|
128
|
+
return id;
|
|
129
|
+
}, context);
|
|
130
|
+
}
|
|
131
|
+
async function wait(id, context) {
|
|
132
|
+
const { harness } = await host;
|
|
133
|
+
if (!await find(id, context)) return void 0;
|
|
134
|
+
await harness.waitForTask(Number(id), context);
|
|
135
|
+
return find(id, context);
|
|
136
|
+
}
|
|
137
|
+
async function stop(id, context) {
|
|
138
|
+
const { harness } = await host;
|
|
139
|
+
const run = await find(id, context);
|
|
140
|
+
if (run?.status !== "running") return run;
|
|
141
|
+
await harness.abortTask(Number(id), context);
|
|
142
|
+
return wait(id, context);
|
|
143
|
+
}
|
|
144
|
+
async function save(id, name, force, files, context) {
|
|
145
|
+
if (!SAVE_NAME.test(name)) return fail(`invalid name ${name} (use [a-z0-9][a-z0-9-]*)`, 2);
|
|
146
|
+
const run = await find(id, context);
|
|
147
|
+
if (!run) return fail(`there is no run ${id}`);
|
|
148
|
+
const path = `${files.dir}/${name}.workflow.js`;
|
|
149
|
+
const exists = await files.env.fileInfo(path, context);
|
|
150
|
+
if (exists.ok && !force) return fail(`${path} already exists (pass --force to overwrite)`);
|
|
151
|
+
const made = await files.env.createDir(files.dir, { recursive: true }, context);
|
|
152
|
+
if (!made.ok) return fail(`can't create ${files.dir}: ${made.error.message}`);
|
|
153
|
+
const written = await files.env.writeFile(path, run.source, context);
|
|
154
|
+
if (!written.ok) return fail(`can't write ${path}: ${written.error.message}`);
|
|
155
|
+
return ok(`saved workflow ${name} to ${path}; run it with agent workflow run ${name}
|
|
156
|
+
`);
|
|
157
|
+
}
|
|
158
|
+
return {
|
|
159
|
+
runs,
|
|
160
|
+
find,
|
|
161
|
+
start,
|
|
162
|
+
wait,
|
|
163
|
+
stop,
|
|
164
|
+
save,
|
|
165
|
+
async list(cone, context) {
|
|
166
|
+
return Object.values(await runs(context)).filter((run) => cone === null || run.cone === cone).sort((a, b) => Number(a.id) - Number(b.id));
|
|
167
|
+
}
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
const USAGE = `usage:
|
|
171
|
+
agent workflow run <file.js | name> [--args <json>] [--budget <tokens>] [--concurrency <n>] [--wait]
|
|
172
|
+
agent workflow run --script '<js>' [same options]
|
|
173
|
+
agent workflow list | status <run> | wait <run> | stop <run> | save <run> <name> [--force]
|
|
174
|
+
|
|
175
|
+
Globals: agent(prompt, { label, phase, schema, model, effort, agentType }), parallel(thunks),
|
|
176
|
+
pipeline(items, ...stages), phase(title), log(message), console, args, budget (output tokens).
|
|
177
|
+
|
|
178
|
+
Runs a Claude Code .workflow.js as a durable task; it survives a reload. Without --wait it prints
|
|
179
|
+
the run id. --budget caps output tokens, --concurrency caps agents running at once. save keeps a
|
|
180
|
+
run's source as ~/.slicc/workflows/<name>.workflow.js, which agent workflow run <name> runs.
|
|
181
|
+
`;
|
|
182
|
+
const VALUES = /* @__PURE__ */ new Set(["--args", "--budget", "--concurrency", "--script"]);
|
|
183
|
+
const SWITCHES = /* @__PURE__ */ new Set(["--wait", "--force"]);
|
|
184
|
+
function parseArgv(argv) {
|
|
185
|
+
const values = /* @__PURE__ */ new Map();
|
|
186
|
+
const switches = /* @__PURE__ */ new Set();
|
|
187
|
+
const rest = [];
|
|
188
|
+
for (let at = 0; at < argv.length; at++) {
|
|
189
|
+
const arg = argv[at];
|
|
190
|
+
if (VALUES.has(arg)) {
|
|
191
|
+
const value = argv[++at];
|
|
192
|
+
if (value === void 0) throw new Error(`${arg} needs a value`);
|
|
193
|
+
values.set(arg, value);
|
|
194
|
+
} else if (SWITCHES.has(arg)) switches.add(arg);
|
|
195
|
+
else if (arg.startsWith("--")) throw new Error(`unknown option ${arg}`);
|
|
196
|
+
else rest.push(arg);
|
|
197
|
+
}
|
|
198
|
+
return { values, switches, rest };
|
|
199
|
+
}
|
|
200
|
+
function number(parsed, flag) {
|
|
201
|
+
const value = parsed.values.get(flag);
|
|
202
|
+
if (value === void 0) return void 0;
|
|
203
|
+
const found = Number(value);
|
|
204
|
+
if (!Number.isFinite(found)) throw new Error(`${flag} must be a number`);
|
|
205
|
+
return found;
|
|
206
|
+
}
|
|
207
|
+
function argsOf(parsed) {
|
|
208
|
+
const text = parsed.values.get("--args");
|
|
209
|
+
if (text === void 0) return void 0;
|
|
210
|
+
try {
|
|
211
|
+
return JSON.parse(text);
|
|
212
|
+
} catch {
|
|
213
|
+
throw new Error("--args must be valid JSON");
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
async function runWorkflow(workflows, who, options, context) {
|
|
217
|
+
if (who.scoop) return fail("a scoop cannot start workflows");
|
|
218
|
+
const target = options.script ?? options.target;
|
|
219
|
+
if (target === void 0) return fail("run needs a <file.js>, a saved name or --script", 2);
|
|
220
|
+
const id = await workflows.start(
|
|
221
|
+
{
|
|
222
|
+
cone: who.cone,
|
|
223
|
+
from: who.from,
|
|
224
|
+
files: who.files,
|
|
225
|
+
target,
|
|
226
|
+
...options.script !== void 0 ? { script: true } : {},
|
|
227
|
+
...options.args !== void 0 ? { args: options.args } : {},
|
|
228
|
+
...options.budget !== void 0 ? { budget: options.budget } : {},
|
|
229
|
+
...options.concurrency !== void 0 ? { concurrency: options.concurrency } : {}
|
|
230
|
+
},
|
|
231
|
+
context
|
|
232
|
+
);
|
|
233
|
+
if (!options.wait)
|
|
234
|
+
return ok(`${id}
|
|
235
|
+
workflow run ${id} started; follow it with agent workflow status ${id}
|
|
236
|
+
`);
|
|
237
|
+
const run = await workflows.wait(id, context);
|
|
238
|
+
return run ? outcome(run) : fail(`run ${id} is gone`);
|
|
239
|
+
}
|
|
240
|
+
async function listed(workflows, who, context) {
|
|
241
|
+
const rows = await workflows.list(who.cone, context);
|
|
242
|
+
if (!rows.length) return ok("no workflow runs\n");
|
|
243
|
+
return ok(
|
|
244
|
+
`${rows.map((run) => `${run.id} ${run.status} ${run.agents.done}/${run.agents.started} ${run.name}`).join("\n")}
|
|
245
|
+
`
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
function runOptions(parsed) {
|
|
249
|
+
const args = argsOf(parsed);
|
|
250
|
+
const budget = number(parsed, "--budget");
|
|
251
|
+
const concurrency = number(parsed, "--concurrency");
|
|
252
|
+
const script = parsed.values.get("--script");
|
|
253
|
+
const target = parsed.rest[0];
|
|
254
|
+
return {
|
|
255
|
+
...target !== void 0 ? { target } : {},
|
|
256
|
+
...script !== void 0 ? { script } : {},
|
|
257
|
+
...args !== void 0 ? { args } : {},
|
|
258
|
+
...budget !== void 0 ? { budget } : {},
|
|
259
|
+
...concurrency !== void 0 ? { concurrency } : {},
|
|
260
|
+
wait: parsed.switches.has("--wait")
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
async function owned(workflows, who, id, context) {
|
|
264
|
+
const run = await workflows.find(id, context);
|
|
265
|
+
return run && run.cone === who.cone ? run : void 0;
|
|
266
|
+
}
|
|
267
|
+
const VERBS = {
|
|
268
|
+
run: (workflows, who, parsed, context) => runWorkflow(workflows, who, runOptions(parsed), context),
|
|
269
|
+
list: (workflows, who, _parsed, context) => listed(workflows, who, context),
|
|
270
|
+
async status(workflows, who, parsed, context) {
|
|
271
|
+
const id = parsed.rest[0] ?? "";
|
|
272
|
+
const run = await owned(workflows, who, id, context);
|
|
273
|
+
return run ? ok(summary(run)) : fail(`there is no run ${id}`);
|
|
274
|
+
},
|
|
275
|
+
async wait(workflows, who, parsed, context) {
|
|
276
|
+
const id = parsed.rest[0] ?? "";
|
|
277
|
+
if (!await owned(workflows, who, id, context)) return fail(`there is no run ${id}`);
|
|
278
|
+
const run = await workflows.wait(id, context);
|
|
279
|
+
return run ? outcome(run) : fail(`run ${id} is gone`);
|
|
280
|
+
},
|
|
281
|
+
async stop(workflows, who, parsed, context) {
|
|
282
|
+
const id = parsed.rest[0] ?? "";
|
|
283
|
+
if (who.scoop) return fail("a scoop cannot stop workflows");
|
|
284
|
+
if (!await owned(workflows, who, id, context)) return fail(`there is no run ${id}`);
|
|
285
|
+
const run = await workflows.stop(id, context);
|
|
286
|
+
return ok(`run ${id} is ${run?.status ?? "gone"}
|
|
287
|
+
`);
|
|
288
|
+
},
|
|
289
|
+
async save(workflows, who, parsed, context) {
|
|
290
|
+
const id = parsed.rest[0] ?? "";
|
|
291
|
+
if (who.scoop) return fail("a scoop cannot save workflows");
|
|
292
|
+
if (!await owned(workflows, who, id, context)) return fail(`there is no run ${id}`);
|
|
293
|
+
const name = parsed.rest[1] ?? "";
|
|
294
|
+
return workflows.save(id, name, parsed.switches.has("--force"), who.files, context);
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
async function command(workflows, who, argv, context) {
|
|
298
|
+
const [verb, ...rest] = argv;
|
|
299
|
+
const handler = verb === void 0 ? void 0 : VERBS[verb];
|
|
300
|
+
if (!handler) return { code: verb === "help" || verb === void 0 ? 0 : 2, out: USAGE };
|
|
301
|
+
return handler(workflows, who, parseArgv(rest), context);
|
|
302
|
+
}
|
|
303
|
+
const TOOL_DESCRIPTION = `Run a Claude Code dynamic workflow (.workflow.js) as a durable background task that survives a reload, or manage runs.
|
|
304
|
+
action run: give file (a path, or the name of a saved workflow) or script (the source). The source starts with \`export const meta = { name, description }\`; the body may use top-level await and return a JSON result. Globals: \`agent(prompt, { label, phase, schema, model: 'provider/model', effort, agentType })\` runs one scoop and resolves to its answer (JSON matching schema, when given), and rejects when it fails; \`parallel(thunks)\` and \`pipeline(items, ...stages)\` turn a failed branch into null; \`phase(title)\`, \`log(message)\`, \`console.*\`, \`args\`, \`budget\` ({ total, spent(), remaining() } in output tokens). No Date.now(), Math.random(), timers, require, fs or nested workflow().
|
|
305
|
+
budget caps output tokens, concurrency caps agents running at once (default 8). wait: true blocks until the run ends and returns its result; otherwise the run id comes back at once.
|
|
306
|
+
action list | status (run) | stop (run) | save (run, name, force): manage runs; save keeps the source as ~/.slicc/workflows/<name>.workflow.js.`;
|
|
307
|
+
const parameters = Type.Object({
|
|
308
|
+
action: Type.Union([
|
|
309
|
+
Type.Literal("run"),
|
|
310
|
+
Type.Literal("list"),
|
|
311
|
+
Type.Literal("status"),
|
|
312
|
+
Type.Literal("stop"),
|
|
313
|
+
Type.Literal("save")
|
|
314
|
+
]),
|
|
315
|
+
file: Type.Optional(Type.String()),
|
|
316
|
+
script: Type.Optional(Type.String()),
|
|
317
|
+
args: Type.Optional(Type.Unknown()),
|
|
318
|
+
budget: Type.Optional(Type.Number()),
|
|
319
|
+
concurrency: Type.Optional(Type.Number()),
|
|
320
|
+
wait: Type.Optional(Type.Boolean()),
|
|
321
|
+
run: Type.Optional(Type.String()),
|
|
322
|
+
name: Type.Optional(Type.String()),
|
|
323
|
+
force: Type.Optional(Type.Boolean())
|
|
324
|
+
});
|
|
325
|
+
function toolArgv(args) {
|
|
326
|
+
const argv = [args.action];
|
|
327
|
+
if (args.action !== "run") {
|
|
328
|
+
if (args.run !== void 0) argv.push(args.run);
|
|
329
|
+
if (args.name !== void 0) argv.push(args.name);
|
|
330
|
+
if (args.force) argv.push("--force");
|
|
331
|
+
}
|
|
332
|
+
return argv;
|
|
333
|
+
}
|
|
334
|
+
function workflowTool(workflows, who) {
|
|
335
|
+
return defineTool({
|
|
336
|
+
name: WORKFLOW,
|
|
337
|
+
description: TOOL_DESCRIPTION,
|
|
338
|
+
parameters,
|
|
339
|
+
async execute(args, api, context) {
|
|
340
|
+
const caller = await who(Number(api.conversationId), context);
|
|
341
|
+
if (!caller) throw new Error("only a cone can use workflows");
|
|
342
|
+
const given = args;
|
|
343
|
+
const answer = given.action === "run" ? await runWorkflow(
|
|
344
|
+
workflows,
|
|
345
|
+
caller,
|
|
346
|
+
{
|
|
347
|
+
...given.file !== void 0 ? { target: given.file } : {},
|
|
348
|
+
...given.script !== void 0 ? { script: given.script } : {},
|
|
349
|
+
...given.args !== void 0 ? { args: given.args } : {},
|
|
350
|
+
...given.budget !== void 0 ? { budget: given.budget } : {},
|
|
351
|
+
...given.concurrency !== void 0 ? { concurrency: given.concurrency } : {},
|
|
352
|
+
wait: given.wait === true
|
|
353
|
+
},
|
|
354
|
+
context
|
|
355
|
+
) : await command(workflows, caller, toolArgv(given), context);
|
|
356
|
+
return {
|
|
357
|
+
output: [{ type: "text", text: answer.out }],
|
|
358
|
+
...answer.code === 0 ? {} : { isError: true }
|
|
359
|
+
};
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
}
|
|
363
|
+
function setupWorkflows(registry) {
|
|
364
|
+
let bind = () => void 0;
|
|
365
|
+
const host = new Promise((resolve2) => {
|
|
366
|
+
bind = resolve2;
|
|
367
|
+
});
|
|
368
|
+
const run = runTask(() => host);
|
|
369
|
+
const workflows = createWorkflows(host);
|
|
370
|
+
const who = async (conversation, context) => {
|
|
371
|
+
const bound = await host;
|
|
372
|
+
const cone = coneOf(bound.agents.state(), conversation);
|
|
373
|
+
if (!cone) return void 0;
|
|
374
|
+
const home = bound.layout.homeOf(cone);
|
|
375
|
+
return {
|
|
376
|
+
cone,
|
|
377
|
+
scoop: false,
|
|
378
|
+
from: conversation,
|
|
379
|
+
files: { dir: workflowsDir(home), env: await bound.envFor(cone, context), cwd: home }
|
|
380
|
+
};
|
|
381
|
+
};
|
|
382
|
+
const extension = defineExtension({
|
|
383
|
+
name: "slicc-workflows",
|
|
384
|
+
tasks: [run],
|
|
385
|
+
tools: [workflowTool(workflows, who)]
|
|
386
|
+
});
|
|
387
|
+
registry.install(extension);
|
|
388
|
+
return {
|
|
389
|
+
workflows,
|
|
390
|
+
extension,
|
|
391
|
+
attach(given) {
|
|
392
|
+
bind({ ...given, tasks: { run } });
|
|
393
|
+
}
|
|
394
|
+
};
|
|
395
|
+
}
|
|
396
|
+
function cliCommand(workflows, layout, env, agents) {
|
|
397
|
+
return async (argv, who, request, context) => {
|
|
398
|
+
const user = request.user ?? null;
|
|
399
|
+
const files = {
|
|
400
|
+
dir: workflowsDir(layout.homeOf(user)),
|
|
401
|
+
env: await layout.envFor(user, context) ?? env,
|
|
402
|
+
cwd: request.cwd
|
|
403
|
+
};
|
|
404
|
+
const from = who.fromAgent ? agents.state().cones[who.cone]?.conversation ?? null : null;
|
|
405
|
+
return command(
|
|
406
|
+
workflows,
|
|
407
|
+
{ cone: who.cone, scoop: who.scoop !== null, from, files },
|
|
408
|
+
argv,
|
|
409
|
+
context
|
|
410
|
+
);
|
|
411
|
+
};
|
|
412
|
+
}
|
|
413
|
+
function workflowEngine(factory = sharedSandbox) {
|
|
414
|
+
let engine;
|
|
415
|
+
return () => {
|
|
416
|
+
const make = factory();
|
|
417
|
+
if (!make) throw new Error("workflows need the codemode sandbox, which settings turned off");
|
|
418
|
+
engine ??= make({ memoryLimitBytes: MEMORY_LIMIT_BYTES });
|
|
419
|
+
return engine;
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
export {
|
|
423
|
+
SAVE_NAME,
|
|
424
|
+
TOOL_DESCRIPTION,
|
|
425
|
+
USAGE,
|
|
426
|
+
WORKFLOW,
|
|
427
|
+
WorkflowsDoc2 as WorkflowsDoc,
|
|
428
|
+
budgetOf,
|
|
429
|
+
cliCommand,
|
|
430
|
+
command,
|
|
431
|
+
concurrencyOf,
|
|
432
|
+
createWorkflows,
|
|
433
|
+
outcome,
|
|
434
|
+
parseArgv,
|
|
435
|
+
pathOf,
|
|
436
|
+
runWorkflow,
|
|
437
|
+
setupWorkflows,
|
|
438
|
+
summary,
|
|
439
|
+
toolArgv,
|
|
440
|
+
workflowEngine,
|
|
441
|
+
workflowTool,
|
|
442
|
+
workflowsDir
|
|
443
|
+
};
|
|
444
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/workflow/index.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Context, JsonValue } from '@earendil-works/chord';\nimport { Type } from '@earendil-works/pi-ai';\nimport {\n type AnyTask,\n type ConversationId,\n defineExtension,\n defineTool,\n type Extension,\n type Registry,\n type TaskId,\n type ToolRegistration,\n} from '@earendil-works/pi-durable';\nimport type { ExecutionEnv } from '@earendil-works/pi-durable/env';\nimport type { Agents } from '../agents.ts';\nimport { MEMORY_LIMIT_BYTES, sharedSandbox } from '../codemode/index.ts';\nimport { runTaints } from '../guests/guard.ts';\nimport { resolve } from '../kernel/paths.ts';\nimport type { Layout } from '../layout.ts';\nimport { coneOf } from '../scoops/service.ts';\nimport {\n type Engine,\n KEPT_RUNS,\n type RunHost,\n type RunRecord,\n runTask,\n WorkflowsDoc,\n} from './run.ts';\nimport { buildCode, DEFAULT_CONCURRENCY, maxConcurrency, parseMeta } from './script.ts';\n\nexport { WorkflowsDoc } from './run.ts';\n\nexport const WORKFLOW = 'workflow';\nexport const SAVE_NAME = /^[a-z0-9][a-z0-9-]*$/;\n\nexport type Answer = { code: number; out: string };\n\nexport interface Files {\n dir: string;\n env: Pick<ExecutionEnv, 'readTextFile' | 'writeFile' | 'createDir' | 'fileInfo'>;\n cwd: string;\n}\n\nexport interface RunRequest {\n cone: string;\n from?: number | null;\n files: Files;\n target: string;\n script?: boolean;\n args?: JsonValue;\n budget?: number;\n concurrency?: number;\n}\n\nexport interface WorkflowHost extends RunHost {\n envFor(user: string | null, context: Context): Promise<Files['env']>;\n tasks: { run: AnyTask };\n}\n\nconst ok = (out: string): Answer => ({ code: 0, out });\nconst fail = (out: string, code = 1): Answer => ({ code, out: `workflow: ${out}\\n` });\n\nexport function workflowsDir(home: string): string {\n return `${home}/.slicc/workflows`;\n}\n\nexport function pathOf(files: Files, target: string): string {\n if (SAVE_NAME.test(target) && !target.endsWith('.js'))\n return `${files.dir}/${target}.workflow.js`;\n return resolve(files.cwd, target);\n}\n\nexport function concurrencyOf(value: number | undefined): number {\n const most = maxConcurrency();\n if (value === undefined) return Math.min(DEFAULT_CONCURRENCY, most);\n if (!Number.isFinite(value)) throw new Error('concurrency must be a number');\n return Math.min(most, Math.max(1, Math.trunc(value)));\n}\n\nexport function budgetOf(value: number | undefined): number | null {\n if (value === undefined) return null;\n if (!Number.isFinite(value) || value <= 0) throw new Error('budget must be a positive number');\n return value;\n}\n\nasync function sourceOf(request: RunRequest, context: Context) {\n if (request.script) return { source: request.target, file: null };\n const path = pathOf(request.files, request.target);\n const read = await request.files.env.readTextFile(path, context);\n if (!read.ok) throw new Error(`can't read ${path}: ${read.error.message}`);\n return { source: read.value, file: path };\n}\n\nfunction prune(runs: Record<string, RunRecord>): void {\n const ended = Object.values(runs)\n .filter((run) => run.status !== 'running')\n .sort((a, b) => Number(a.id) - Number(b.id));\n for (const run of ended.slice(0, Math.max(0, ended.length - KEPT_RUNS))) delete runs[run.id];\n}\n\nexport function summary(run: RunRecord): string {\n const budget = run.budget === null ? '' : ` of ${run.budget}`;\n const lines = [\n `run ${run.id}: ${run.name} (${run.status})`,\n `phase: ${run.phase ?? '-'}`,\n `agents: ${run.agents.done} done, ${run.agents.failed} failed, ${run.agents.running.length} running, ${run.agents.started} started`,\n `output tokens: ${run.spent}${budget}`,\n `concurrency: ${run.concurrency}`,\n ];\n if (run.logs.length) lines.push('log:', ...run.logs.slice(-20).map((line) => ` ${line}`));\n if (run.error) lines.push(`error: ${run.error}`);\n if (run.status === 'completed')\n lines.push(`result: ${JSON.stringify(run.result ?? null, null, 2)}`);\n return `${lines.join('\\n')}\\n`;\n}\n\nexport function outcome(run: RunRecord): Answer {\n if (run.status === 'completed') return ok(`${JSON.stringify(run.result ?? null, null, 2)}\\n`);\n if (run.status === 'stopped') return fail(`run ${run.id} was stopped`);\n return fail(`run ${run.id} failed: ${run.error ?? 'unknown error'}`);\n}\n\nexport function createWorkflows(host: Promise<WorkflowHost>) {\n const runs = async (context: Context) => {\n const { harness } = await host;\n return (await harness.snapshot(WorkflowsDoc, context))?.runs ?? {};\n };\n const find = async (id: string, context: Context) => (await runs(context))[id];\n\n async function start(request: RunRequest, context: Context): Promise<string> {\n const { harness, agents } = await host;\n const { source, file } = await sourceOf(request, context);\n const meta = parseMeta(source);\n const budget = budgetOf(request.budget);\n const concurrency = concurrencyOf(request.concurrency);\n const code = buildCode(source, {\n ...(request.args !== undefined ? { args: request.args } : {}),\n budget,\n concurrency,\n });\n const cone = await agents.conversation(request.cone, context);\n if (!cone) throw new Error(`there is no cone ${request.cone}`);\n const from = request.from ?? null;\n const taints = from === null ? [] : await runTaints(harness, from as ConversationId, context);\n return harness.commit(async (tx) => {\n const task = await tx.createTask(\n (await host).tasks.run as never,\n { code },\n {\n ownership: { kind: 'conversation' },\n conversationId: cone.id as ConversationId,\n background: true,\n }\n );\n const doc = await tx.doc(WorkflowsDoc);\n prune(doc.runs as Record<string, RunRecord>);\n const id = String(task);\n doc.runs[id] = {\n id,\n name: meta.name,\n description: meta.description,\n cone: request.cone,\n home: request.files.dir,\n file,\n source,\n budget,\n concurrency,\n status: 'running',\n phase: null,\n started: Date.now(),\n ended: null,\n agents: { started: 0, done: 0, failed: 0, running: [] },\n spent: 0,\n logs: [],\n fromAgent: from !== null,\n taints,\n };\n return id;\n }, context);\n }\n\n async function wait(id: string, context: Context): Promise<RunRecord | undefined> {\n const { harness } = await host;\n if (!(await find(id, context))) return undefined;\n await harness.waitForTask(Number(id) as TaskId, context);\n return find(id, context);\n }\n\n async function stop(id: string, context: Context): Promise<RunRecord | undefined> {\n const { harness } = await host;\n const run = await find(id, context);\n if (run?.status !== 'running') return run;\n await harness.abortTask(Number(id) as TaskId, context);\n return wait(id, context);\n }\n\n async function save(\n id: string,\n name: string,\n force: boolean,\n files: Files,\n context: Context\n ): Promise<Answer> {\n if (!SAVE_NAME.test(name)) return fail(`invalid name ${name} (use [a-z0-9][a-z0-9-]*)`, 2);\n const run = await find(id, context);\n if (!run) return fail(`there is no run ${id}`);\n const path = `${files.dir}/${name}.workflow.js`;\n const exists = await files.env.fileInfo(path, context);\n if (exists.ok && !force) return fail(`${path} already exists (pass --force to overwrite)`);\n const made = await files.env.createDir(files.dir, { recursive: true }, context);\n if (!made.ok) return fail(`can't create ${files.dir}: ${made.error.message}`);\n const written = await files.env.writeFile(path, run.source, context);\n if (!written.ok) return fail(`can't write ${path}: ${written.error.message}`);\n return ok(`saved workflow ${name} to ${path}; run it with agent workflow run ${name}\\n`);\n }\n\n return {\n runs,\n find,\n start,\n wait,\n stop,\n save,\n async list(cone: string | null, context: Context): Promise<RunRecord[]> {\n return Object.values(await runs(context))\n .filter((run) => cone === null || run.cone === cone)\n .sort((a, b) => Number(a.id) - Number(b.id));\n },\n };\n}\n\nexport type Workflows = ReturnType<typeof createWorkflows>;\n\nexport interface Invocation {\n cone: string;\n scoop: boolean;\n from: number | null;\n files: Files;\n}\n\nexport const USAGE = `usage:\n agent workflow run <file.js | name> [--args <json>] [--budget <tokens>] [--concurrency <n>] [--wait]\n agent workflow run --script '<js>' [same options]\n agent workflow list | status <run> | wait <run> | stop <run> | save <run> <name> [--force]\n\nGlobals: agent(prompt, { label, phase, schema, model, effort, agentType }), parallel(thunks),\npipeline(items, ...stages), phase(title), log(message), console, args, budget (output tokens).\n\nRuns a Claude Code .workflow.js as a durable task; it survives a reload. Without --wait it prints\nthe run id. --budget caps output tokens, --concurrency caps agents running at once. save keeps a\nrun's source as ~/.slicc/workflows/<name>.workflow.js, which agent workflow run <name> runs.\n`;\n\nconst VALUES = new Set(['--args', '--budget', '--concurrency', '--script']);\nconst SWITCHES = new Set(['--wait', '--force']);\n\ntype Parsed = { values: Map<string, string>; switches: Set<string>; rest: string[] };\n\nexport function parseArgv(argv: readonly string[]): Parsed {\n const values = new Map<string, string>();\n const switches = new Set<string>();\n const rest: string[] = [];\n for (let at = 0; at < argv.length; at++) {\n const arg = argv[at] as string;\n if (VALUES.has(arg)) {\n const value = argv[++at];\n if (value === undefined) throw new Error(`${arg} needs a value`);\n values.set(arg, value);\n } else if (SWITCHES.has(arg)) switches.add(arg);\n else if (arg.startsWith('--')) throw new Error(`unknown option ${arg}`);\n else rest.push(arg);\n }\n return { values, switches, rest };\n}\n\nfunction number(parsed: Parsed, flag: string): number | undefined {\n const value = parsed.values.get(flag);\n if (value === undefined) return undefined;\n const found = Number(value);\n if (!Number.isFinite(found)) throw new Error(`${flag} must be a number`);\n return found;\n}\n\nfunction argsOf(parsed: Parsed): JsonValue | undefined {\n const text = parsed.values.get('--args');\n if (text === undefined) return undefined;\n try {\n return JSON.parse(text) as JsonValue;\n } catch {\n throw new Error('--args must be valid JSON');\n }\n}\n\nexport interface RunOptions {\n target?: string;\n script?: string;\n args?: JsonValue;\n budget?: number;\n concurrency?: number;\n wait?: boolean;\n}\n\nexport async function runWorkflow(\n workflows: Workflows,\n who: Invocation,\n options: RunOptions,\n context: Context\n): Promise<Answer> {\n if (who.scoop) return fail('a scoop cannot start workflows');\n const target = options.script ?? options.target;\n if (target === undefined) return fail('run needs a <file.js>, a saved name or --script', 2);\n const id = await workflows.start(\n {\n cone: who.cone,\n from: who.from,\n files: who.files,\n target,\n ...(options.script !== undefined ? { script: true } : {}),\n ...(options.args !== undefined ? { args: options.args } : {}),\n ...(options.budget !== undefined ? { budget: options.budget } : {}),\n ...(options.concurrency !== undefined ? { concurrency: options.concurrency } : {}),\n },\n context\n );\n if (!options.wait)\n return ok(`${id}\\nworkflow run ${id} started; follow it with agent workflow status ${id}\\n`);\n const run = await workflows.wait(id, context);\n return run ? outcome(run) : fail(`run ${id} is gone`);\n}\n\nasync function listed(workflows: Workflows, who: Invocation, context: Context) {\n const rows = await workflows.list(who.cone, context);\n if (!rows.length) return ok('no workflow runs\\n');\n return ok(\n `${rows.map((run) => `${run.id}\\t${run.status}\\t${run.agents.done}/${run.agents.started}\\t${run.name}`).join('\\n')}\\n`\n );\n}\n\nfunction runOptions(parsed: Parsed): RunOptions {\n const args = argsOf(parsed);\n const budget = number(parsed, '--budget');\n const concurrency = number(parsed, '--concurrency');\n const script = parsed.values.get('--script');\n const target = parsed.rest[0];\n return {\n ...(target !== undefined ? { target } : {}),\n ...(script !== undefined ? { script } : {}),\n ...(args !== undefined ? { args } : {}),\n ...(budget !== undefined ? { budget } : {}),\n ...(concurrency !== undefined ? { concurrency } : {}),\n wait: parsed.switches.has('--wait'),\n };\n}\n\ntype Verb = (\n workflows: Workflows,\n who: Invocation,\n parsed: Parsed,\n context: Context\n) => Promise<Answer>;\n\nasync function owned(workflows: Workflows, who: Invocation, id: string, context: Context) {\n const run = await workflows.find(id, context);\n return run && run.cone === who.cone ? run : undefined;\n}\n\nconst VERBS: Record<string, Verb> = {\n run: (workflows, who, parsed, context) =>\n runWorkflow(workflows, who, runOptions(parsed), context),\n list: (workflows, who, _parsed, context) => listed(workflows, who, context),\n async status(workflows, who, parsed, context) {\n const id = parsed.rest[0] ?? '';\n const run = await owned(workflows, who, id, context);\n return run ? ok(summary(run)) : fail(`there is no run ${id}`);\n },\n async wait(workflows, who, parsed, context) {\n const id = parsed.rest[0] ?? '';\n if (!(await owned(workflows, who, id, context))) return fail(`there is no run ${id}`);\n const run = await workflows.wait(id, context);\n return run ? outcome(run) : fail(`run ${id} is gone`);\n },\n async stop(workflows, who, parsed, context) {\n const id = parsed.rest[0] ?? '';\n if (who.scoop) return fail('a scoop cannot stop workflows');\n if (!(await owned(workflows, who, id, context))) return fail(`there is no run ${id}`);\n const run = await workflows.stop(id, context);\n return ok(`run ${id} is ${run?.status ?? 'gone'}\\n`);\n },\n async save(workflows, who, parsed, context) {\n const id = parsed.rest[0] ?? '';\n if (who.scoop) return fail('a scoop cannot save workflows');\n if (!(await owned(workflows, who, id, context))) return fail(`there is no run ${id}`);\n const name = parsed.rest[1] ?? '';\n return workflows.save(id, name, parsed.switches.has('--force'), who.files, context);\n },\n};\n\nexport async function command(\n workflows: Workflows,\n who: Invocation,\n argv: readonly string[],\n context: Context\n): Promise<Answer> {\n const [verb, ...rest] = argv;\n const handler = verb === undefined ? undefined : VERBS[verb];\n if (!handler) return { code: verb === 'help' || verb === undefined ? 0 : 2, out: USAGE };\n return handler(workflows, who, parseArgv(rest), context);\n}\n\nexport const TOOL_DESCRIPTION = `Run a Claude Code dynamic workflow (.workflow.js) as a durable background task that survives a reload, or manage runs.\naction run: give file (a path, or the name of a saved workflow) or script (the source). The source starts with \\`export const meta = { name, description }\\`; the body may use top-level await and return a JSON result. Globals: \\`agent(prompt, { label, phase, schema, model: 'provider/model', effort, agentType })\\` runs one scoop and resolves to its answer (JSON matching schema, when given), and rejects when it fails; \\`parallel(thunks)\\` and \\`pipeline(items, ...stages)\\` turn a failed branch into null; \\`phase(title)\\`, \\`log(message)\\`, \\`console.*\\`, \\`args\\`, \\`budget\\` ({ total, spent(), remaining() } in output tokens). No Date.now(), Math.random(), timers, require, fs or nested workflow().\nbudget caps output tokens, concurrency caps agents running at once (default 8). wait: true blocks until the run ends and returns its result; otherwise the run id comes back at once.\naction list | status (run) | stop (run) | save (run, name, force): manage runs; save keeps the source as ~/.slicc/workflows/<name>.workflow.js.`;\n\nconst parameters = Type.Object({\n action: Type.Union([\n Type.Literal('run'),\n Type.Literal('list'),\n Type.Literal('status'),\n Type.Literal('stop'),\n Type.Literal('save'),\n ]),\n file: Type.Optional(Type.String()),\n script: Type.Optional(Type.String()),\n args: Type.Optional(Type.Unknown()),\n budget: Type.Optional(Type.Number()),\n concurrency: Type.Optional(Type.Number()),\n wait: Type.Optional(Type.Boolean()),\n run: Type.Optional(Type.String()),\n name: Type.Optional(Type.String()),\n force: Type.Optional(Type.Boolean()),\n});\n\ntype ToolArgs = {\n action: 'run' | 'list' | 'status' | 'stop' | 'save';\n file?: string;\n script?: string;\n args?: unknown;\n budget?: number;\n concurrency?: number;\n wait?: boolean;\n run?: string;\n name?: string;\n force?: boolean;\n};\n\nexport function toolArgv(args: ToolArgs): string[] {\n const argv: string[] = [args.action];\n if (args.action !== 'run') {\n if (args.run !== undefined) argv.push(args.run);\n if (args.name !== undefined) argv.push(args.name);\n if (args.force) argv.push('--force');\n }\n return argv;\n}\n\nexport function workflowTool(\n workflows: Workflows,\n who: (conversation: number, context: Context) => Promise<Invocation | undefined>\n): ToolRegistration {\n return defineTool({\n name: WORKFLOW,\n description: TOOL_DESCRIPTION,\n parameters,\n async execute(args, api, context) {\n const caller = await who(Number(api.conversationId), context);\n if (!caller) throw new Error('only a cone can use workflows');\n const given = args as ToolArgs;\n const answer =\n given.action === 'run'\n ? await runWorkflow(\n workflows,\n caller,\n {\n ...(given.file !== undefined ? { target: given.file } : {}),\n ...(given.script !== undefined ? { script: given.script } : {}),\n ...(given.args !== undefined ? { args: given.args as JsonValue } : {}),\n ...(given.budget !== undefined ? { budget: given.budget } : {}),\n ...(given.concurrency !== undefined ? { concurrency: given.concurrency } : {}),\n wait: given.wait === true,\n },\n context\n )\n : await command(workflows, caller, toolArgv(given), context);\n return {\n output: [{ type: 'text', text: answer.out }],\n ...(answer.code === 0 ? {} : { isError: true }),\n };\n },\n }) as ToolRegistration;\n}\n\nexport interface WorkflowsSetup {\n workflows: Workflows;\n extension: Extension;\n attach(host: Omit<WorkflowHost, 'tasks'>): void;\n}\n\nexport function setupWorkflows(registry: Registry): WorkflowsSetup {\n let bind: (host: WorkflowHost) => void = () => undefined;\n const host = new Promise<WorkflowHost>((resolve) => {\n bind = resolve;\n });\n const run = runTask(() => host);\n const workflows = createWorkflows(host);\n const who = async (conversation: number, context: Context): Promise<Invocation | undefined> => {\n const bound = await host;\n const cone = coneOf(bound.agents.state(), conversation);\n if (!cone) return undefined;\n const home = bound.layout.homeOf(cone);\n return {\n cone,\n scoop: false,\n from: conversation,\n files: { dir: workflowsDir(home), env: await bound.envFor(cone, context), cwd: home },\n };\n };\n const extension = defineExtension({\n name: 'slicc-workflows',\n tasks: [run],\n tools: [workflowTool(workflows, who)],\n });\n registry.install(extension);\n return {\n workflows,\n extension,\n attach(given) {\n bind({ ...given, tasks: { run: run as AnyTask } });\n },\n };\n}\n\nexport function cliCommand(\n workflows: Workflows,\n layout: Layout,\n env: Files['env'],\n agents: Pick<Agents, 'state'>\n): (\n argv: readonly string[],\n who: { cone: string; scoop: string | null; fromAgent: boolean },\n request: { user?: string | null; cwd: string },\n context: Context\n) => Promise<Answer> {\n return async (argv, who, request, context) => {\n const user = request.user ?? null;\n const files = {\n dir: workflowsDir(layout.homeOf(user)),\n env: (await layout.envFor(user, context)) ?? env,\n cwd: request.cwd,\n };\n const from = who.fromAgent ? (agents.state().cones[who.cone]?.conversation ?? null) : null;\n return command(\n workflows,\n { cone: who.cone, scoop: who.scoop !== null, from, files },\n argv,\n context\n );\n };\n}\n\nexport function workflowEngine(factory = sharedSandbox): () => Engine {\n let engine: Engine | undefined;\n return () => {\n const make = factory();\n if (!make) throw new Error('workflows need the codemode sandbox, which settings turned off');\n engine ??= make({ memoryLimitBytes: MEMORY_LIMIT_BYTES });\n return engine;\n };\n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