comfy-ts 2.18.0 → 2.19.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 +140 -95
- package/claude-code/.claude-plugin/plugin.json +9 -0
- package/claude-code/skills/convert/SKILL.md +25 -0
- package/claude-code/skills/guide/SKILL.md +21 -0
- package/claude-code/skills/run/SKILL.md +12 -0
- package/claude-code/skills/setup/SKILL.md +15 -0
- package/claude-code/skills/workflow/SKILL.md +19 -0
- package/dist/cli.js +219 -6
- package/dist/cli.js.map +1 -1
- package/dist/{state-DgwWhZWb.js → exampleAssets-CE4PUy3n.js} +206 -58
- package/dist/exampleAssets-CE4PUy3n.js.map +1 -0
- package/dist/index.cjs +173 -59
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +37 -8
- package/dist/index.d.ts +37 -8
- package/dist/index.js +173 -59
- package/dist/index.js.map +1 -1
- package/dist/{run-run-Wn7H72Zg.js → run-run-C_yXY0vl.js} +2 -3
- package/dist/{run-run-Wn7H72Zg.js.map → run-run-C_yXY0vl.js.map} +1 -1
- package/dist/{run-tui-VWSj1D_j.js → run-tui-B3dsftdB.js} +2 -3
- package/dist/{run-tui-VWSj1D_j.js.map → run-tui-B3dsftdB.js.map} +1 -1
- package/dist/web.d.ts +55 -26
- package/dist/web.js +164 -55
- package/dist/web.js.map +1 -1
- package/examples/README.md +17 -11
- package/guide-for-agents.md +4 -1
- package/package.json +3 -2
- package/src/cli/comfy-ts-cli.ts +8 -0
- package/src/cli/skill.ts +207 -0
- package/src/exampleAssets.ts +10 -4
- package/src/host/ComfyHost.ts +6 -36
- package/src/host/ComfyManager.ts +168 -42
- package/src/litegraph/expandSubgraphs.ts +58 -4
- package/src/litegraph/normalizeWorkflow.ts +6 -1
- package/src/manager/installedView.ts +2 -0
- package/src/sdk-generator/litegraphToApiRequestPayload.ts +25 -11
- package/dist/exampleAssets-BfWzygoM.js +0 -38
- package/dist/exampleAssets-BfWzygoM.js.map +0 -1
- package/dist/state-DgwWhZWb.js.map +0 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Generate with comfy-ts, one headless run of a *.cflow.ts workflow module or a bundled example through comfy-ts run, returning the output files. Use when the user wants an image, video, audio or text generated.
|
|
3
|
+
argument-hint: "[module] [--var value ...]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Generate with comfy-ts: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
1. Find the module: `bunx comfy-ts run` lists the modules of the cwd and the bundled examples. A path, a module key, the key without its number, or a unique part of it selects one. A bundled example runs on the host its file declares, so prefer the project's own modules.
|
|
9
|
+
2. Read its vars: `bunx comfy-ts run <module> --help`. Each var is a flag; pass only the vars the request changes. `--<var>-file <path>` reads a long text var from a file.
|
|
10
|
+
3. Run: `bunx comfy-ts run <module> --<var> <value> --out <path> --json`. The one JSON line carries `ok` and the absolute `outputs`.
|
|
11
|
+
4. A failed run exits 1 with the reason (host down, missing model, bad value). Report it as given; never retry with invented values.
|
|
12
|
+
5. Look at an image output before you say it worked, then give the user the paths.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Set up comfy-ts in this project, install it and generate the typed SDK of a ComfyUI host. Use when a project starts using comfy-ts or adds a ComfyUI host.
|
|
3
|
+
argument-hint: "[host-url] [host-id]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Set up comfy-ts in this project. Arguments: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
The host url is where ComfyUI listens (default `http://127.0.0.1:8188`); ask for it when none is given and the default does not answer. The host id is a short stable name of your choice (`local`, `my-gpu`): it names the generated types, so never change it later.
|
|
9
|
+
|
|
10
|
+
1. Install with the project's package manager: `bun add comfy-ts` (or npm, pnpm, yarn). Workflow modules run under bun, so check `bun --version` too.
|
|
11
|
+
2. Read `node_modules/comfy-ts/guide-for-agents.md`, section "Setup flow", and do each step for this host: `bunx comfy-ts gen --id <host-id> --host <host-url>`, the tsconfig `include`, the `.gitignore` line. A Comfy Cloud host also needs `--api-key` or `COMFY_CLOUD_API_KEY`.
|
|
12
|
+
3. Add `@./node_modules/comfy-ts/guide-for-agents.md` as a line of the project's `CLAUDE.md`, so every session knows the library.
|
|
13
|
+
4. Check: `.comfy-ts/hosts/<host-id>/sdk.d.ts` exists and the project still typechecks.
|
|
14
|
+
|
|
15
|
+
Report the host id, the node count `gen` printed, and every file you changed.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: Write a new comfy-ts workflow module (*.cflow.ts) that generates an image, video, audio or text on a ComfyUI host. Use when the user wants a new generation pipeline in TypeScript.
|
|
3
|
+
argument-hint: "[what it should generate]"
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
Write a new comfy-ts workflow module for: $ARGUMENTS
|
|
7
|
+
|
|
8
|
+
1. Read `node_modules/comfy-ts/guide-for-agents.md`: the module pattern and the var kinds. No `.comfy-ts/hosts/<id>/sdk.d.ts` yet means the project needs its setup first.
|
|
9
|
+
2. Start from the closest bundled example: `grep -rl <NodeName> node_modules/comfy-ts/examples --include=*.cflow.ts`. Keep the project's own host, never the example's.
|
|
10
|
+
3. Take every node, input name, model file and enum value from the host's `sdk.d.ts` (grep ` <NodeName>: {`). A model the user may swap becomes a `v.model` var, never a typed file name.
|
|
11
|
+
4. Make vars of what a user tunes (prompt, seed, size, steps, input media) and keep the rest as constants.
|
|
12
|
+
5. Save it as `<name>.cflow.ts` with the workflow as its default export and the `import.meta.main` block of the guide.
|
|
13
|
+
6. Check it offline:
|
|
14
|
+
- the project typechecks;
|
|
15
|
+
- `bunx comfy-ts run ./<name>.cflow.ts --help` lists the vars;
|
|
16
|
+
- a dry build reports no problem: `bun -e "const m = await import('./<name>.cflow.ts'); const wf = await m.default.build({ dry: true }); console.log(wf.problems)"` prints `[]`.
|
|
17
|
+
7. Generate only when the user asks: `bunx comfy-ts run ./<name>.cflow.ts --out <path>`.
|
|
18
|
+
|
|
19
|
+
Report the file, its vars, and the checks you ran.
|
package/dist/cli.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { D as readLoraMirror, F as fetchLoraList, H as lmModelName, K as lmTrainedWords, _ as buildLoraMirror, j as writeLoraMirror } from "./schemaDrift-CbsABBuk.js";
|
|
3
|
-
import { a as
|
|
3
|
+
import { a as readableStringify, n as comfyTsPackageDir, r as ComfyTS, s as ComfySchema } from "./exampleAssets-CE4PUy3n.js";
|
|
4
4
|
import { spawn } from "node:child_process";
|
|
5
|
-
import { constants } from "node:os";
|
|
5
|
+
import { constants, homedir } from "node:os";
|
|
6
6
|
import { fileURLToPath } from "node:url";
|
|
7
|
-
import { existsSync, mkdirSync, readFileSync, readdirSync, rmdirSync, writeFileSync } from "node:fs";
|
|
8
|
-
import { dirname, join, resolve } from "pathe";
|
|
7
|
+
import { existsSync, mkdirSync, readFileSync, readdirSync, rmSync, rmdirSync, statSync, writeFileSync } from "node:fs";
|
|
8
|
+
import { dirname, join, relative, resolve } from "pathe";
|
|
9
|
+
import { createHash } from "node:crypto";
|
|
9
10
|
//#region src/cli/bunHop.ts
|
|
10
11
|
const HOP_PARENT_ENV = "COMFY_TS_HOP_PARENT";
|
|
11
12
|
const FORWARDED = [
|
|
@@ -275,6 +276,211 @@ function runOutline(args) {
|
|
|
275
276
|
return 0;
|
|
276
277
|
}
|
|
277
278
|
//#endregion
|
|
279
|
+
//#region src/cli/skill.ts
|
|
280
|
+
const SKILL_PREFIX = "comfy-ts-";
|
|
281
|
+
const SKILL_RECORD_FILE = ".comfy-ts-skills.json";
|
|
282
|
+
const SKILL_USAGE = `comfy-ts skill install [--user | --dir <skills-dir>] [--force]
|
|
283
|
+
copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd (--user: your personal
|
|
284
|
+
skills folder, --dir: that folder): /comfy-ts-guide, /comfy-ts-setup, /comfy-ts-workflow,
|
|
285
|
+
/comfy-ts-convert, /comfy-ts-run. A rerun updates what it wrote; a file you edited is never
|
|
286
|
+
overwritten without --force. The same skills ship as a Claude Code plugin:
|
|
287
|
+
/plugin marketplace add rvion/comfy-ts, then /plugin install comfy-ts@comfy-ts`;
|
|
288
|
+
/** claude-code/skills/ of the installed package, resolved from this module, never from the cwd */
|
|
289
|
+
function skillSourceDir() {
|
|
290
|
+
const pkgDir = comfyTsPackageDir(import.meta.url);
|
|
291
|
+
if (pkgDir == null) throw new Error("cannot find the comfy-ts package this command runs from");
|
|
292
|
+
const dir = join(pkgDir, "claude-code", "skills");
|
|
293
|
+
if (!existsSync(dir)) throw new Error(`the comfy-ts package has no skills folder at ${dir}`);
|
|
294
|
+
return dir;
|
|
295
|
+
}
|
|
296
|
+
const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
|
|
297
|
+
/** every file under a skill folder, as paths relative to it */
|
|
298
|
+
function filesUnder(dir, prefix = "") {
|
|
299
|
+
const out = [];
|
|
300
|
+
for (const name of readdirSync(dir).sort()) {
|
|
301
|
+
const abs = join(dir, name);
|
|
302
|
+
if (statSync(abs).isDirectory()) out.push(...filesUnder(abs, `${prefix}${name}/`));
|
|
303
|
+
else out.push(`${prefix}${name}`);
|
|
304
|
+
}
|
|
305
|
+
return out;
|
|
306
|
+
}
|
|
307
|
+
function readRecord(path) {
|
|
308
|
+
if (!existsSync(path)) return null;
|
|
309
|
+
let parsed;
|
|
310
|
+
try {
|
|
311
|
+
parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
312
|
+
} catch (e) {
|
|
313
|
+
throw new Error(`${path} is not valid json (${e instanceof Error ? e.message : String(e)}): fix or delete it`, { cause: e });
|
|
314
|
+
}
|
|
315
|
+
if (typeof parsed !== "object" || parsed == null || !("files" in parsed)) throw new Error(`${path} has no "files" map: fix or delete it`);
|
|
316
|
+
const files = parsed.files;
|
|
317
|
+
if (typeof files !== "object" || files == null) throw new Error(`${path} has no "files" map: fix or delete it`);
|
|
318
|
+
const out = {};
|
|
319
|
+
for (const [k, v] of Object.entries(files)) if (typeof v === "string") out[k] = v;
|
|
320
|
+
return {
|
|
321
|
+
version: "version" in parsed && typeof parsed.version === "string" ? parsed.version : "",
|
|
322
|
+
files: out
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
function packageVersion(pkgDir) {
|
|
326
|
+
const parsed = JSON.parse(readFileSync(join(pkgDir, "package.json"), "utf8"));
|
|
327
|
+
if (typeof parsed === "object" && parsed != null && "version" in parsed && typeof parsed.version === "string") return parsed.version;
|
|
328
|
+
throw new Error(`${join(pkgDir, "package.json")} has no version`);
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* plan, then write only when nothing conflicts (or `force`): a conflict anywhere writes nothing,
|
|
332
|
+
* so a refused install never leaves half an update behind
|
|
333
|
+
*/
|
|
334
|
+
function installSkills(p) {
|
|
335
|
+
const recordPath = join(p.to, SKILL_RECORD_FILE);
|
|
336
|
+
const record = readRecord(recordPath);
|
|
337
|
+
const source = /* @__PURE__ */ new Map();
|
|
338
|
+
const commands = [];
|
|
339
|
+
for (const skill of readdirSync(p.from).sort()) {
|
|
340
|
+
if (!statSync(join(p.from, skill)).isDirectory()) continue;
|
|
341
|
+
commands.push(`/${SKILL_PREFIX}${skill}`);
|
|
342
|
+
for (const f of filesUnder(join(p.from, skill))) source.set(`${SKILL_PREFIX}${skill}/${f}`, readFileSync(join(p.from, skill, f)));
|
|
343
|
+
}
|
|
344
|
+
const lines = [];
|
|
345
|
+
const writes = [];
|
|
346
|
+
const removals = [];
|
|
347
|
+
for (const [rel, bytes] of source) {
|
|
348
|
+
const abs = join(p.to, rel);
|
|
349
|
+
if (!existsSync(abs)) {
|
|
350
|
+
lines.push({
|
|
351
|
+
action: "created",
|
|
352
|
+
file: abs
|
|
353
|
+
});
|
|
354
|
+
writes.push(rel);
|
|
355
|
+
continue;
|
|
356
|
+
}
|
|
357
|
+
const onDisk = readFileSync(abs);
|
|
358
|
+
if (onDisk.equals(bytes)) lines.push({
|
|
359
|
+
action: "unchanged",
|
|
360
|
+
file: abs
|
|
361
|
+
});
|
|
362
|
+
else if (record?.files[rel] === sha256(onDisk)) {
|
|
363
|
+
lines.push({
|
|
364
|
+
action: "updated",
|
|
365
|
+
file: abs
|
|
366
|
+
});
|
|
367
|
+
writes.push(rel);
|
|
368
|
+
} else if (p.force) {
|
|
369
|
+
lines.push({
|
|
370
|
+
action: "overwritten",
|
|
371
|
+
file: abs
|
|
372
|
+
});
|
|
373
|
+
writes.push(rel);
|
|
374
|
+
} else lines.push({
|
|
375
|
+
action: "conflict",
|
|
376
|
+
file: abs
|
|
377
|
+
});
|
|
378
|
+
}
|
|
379
|
+
for (const [rel, hash] of Object.entries(record?.files ?? {})) {
|
|
380
|
+
const abs = join(p.to, rel);
|
|
381
|
+
if (source.has(rel) || !existsSync(abs)) continue;
|
|
382
|
+
if (sha256(readFileSync(abs)) === hash) {
|
|
383
|
+
lines.push({
|
|
384
|
+
action: "removed",
|
|
385
|
+
file: abs
|
|
386
|
+
});
|
|
387
|
+
removals.push(rel);
|
|
388
|
+
} else lines.push({
|
|
389
|
+
action: "kept",
|
|
390
|
+
file: abs
|
|
391
|
+
});
|
|
392
|
+
}
|
|
393
|
+
if (lines.some((l) => l.action === "conflict")) return {
|
|
394
|
+
ok: false,
|
|
395
|
+
lines,
|
|
396
|
+
commands
|
|
397
|
+
};
|
|
398
|
+
for (const rel of writes) {
|
|
399
|
+
const abs = join(p.to, rel);
|
|
400
|
+
mkdirSync(dirname(abs), { recursive: true });
|
|
401
|
+
writeFileSync(abs, source.get(rel) ?? Buffer.alloc(0));
|
|
402
|
+
}
|
|
403
|
+
for (const rel of removals) {
|
|
404
|
+
const abs = join(p.to, rel);
|
|
405
|
+
rmSync(abs);
|
|
406
|
+
const dir = dirname(abs);
|
|
407
|
+
if (readdirSync(dir).length === 0) rmdirSync(dir);
|
|
408
|
+
}
|
|
409
|
+
const files = {};
|
|
410
|
+
for (const [rel, bytes] of source) files[rel] = sha256(bytes);
|
|
411
|
+
mkdirSync(p.to, { recursive: true });
|
|
412
|
+
writeFileSync(recordPath, `${JSON.stringify({
|
|
413
|
+
version: p.version,
|
|
414
|
+
files
|
|
415
|
+
}, null, 3)}\n`);
|
|
416
|
+
return {
|
|
417
|
+
ok: true,
|
|
418
|
+
lines,
|
|
419
|
+
commands
|
|
420
|
+
};
|
|
421
|
+
}
|
|
422
|
+
const MARK = {
|
|
423
|
+
created: "+",
|
|
424
|
+
unchanged: "=",
|
|
425
|
+
updated: "~",
|
|
426
|
+
overwritten: "!",
|
|
427
|
+
removed: "-",
|
|
428
|
+
kept: "?",
|
|
429
|
+
conflict: "✗"
|
|
430
|
+
};
|
|
431
|
+
function runSkill(args, p = {}) {
|
|
432
|
+
const log = p.log ?? console.log;
|
|
433
|
+
const cwd = p.cwd ?? process.cwd();
|
|
434
|
+
const env = p.env ?? process.env;
|
|
435
|
+
const sub = args[0];
|
|
436
|
+
const rest = args.slice(1);
|
|
437
|
+
if (sub == null || sub === "help" || sub === "--help" || rest.includes("--help")) {
|
|
438
|
+
log(SKILL_USAGE);
|
|
439
|
+
return 0;
|
|
440
|
+
}
|
|
441
|
+
if (sub !== "install") throw new Error(`unknown skill command "${sub}"\n${SKILL_USAGE}`);
|
|
442
|
+
let user = false;
|
|
443
|
+
let force = false;
|
|
444
|
+
let dir = null;
|
|
445
|
+
for (let i = 0; i < rest.length; i++) {
|
|
446
|
+
const a = rest[i];
|
|
447
|
+
if (a === "--user") user = true;
|
|
448
|
+
else if (a === "--force") force = true;
|
|
449
|
+
else if (a === "--dir") {
|
|
450
|
+
const v = rest[++i];
|
|
451
|
+
if (v == null || v.startsWith("--")) throw new Error("--dir needs a value");
|
|
452
|
+
dir = v;
|
|
453
|
+
} else throw new Error(`unknown argument "${a}"\n${SKILL_USAGE}`);
|
|
454
|
+
}
|
|
455
|
+
if (user && dir != null) throw new Error("--user and --dir name two targets: pass one");
|
|
456
|
+
const configDir = env.CLAUDE_CONFIG_DIR ?? join(env.HOME ?? homedir(), ".claude");
|
|
457
|
+
const to = dir != null ? resolve(cwd, dir) : user ? join(configDir, "skills") : join(cwd, ".claude", "skills");
|
|
458
|
+
const from = skillSourceDir();
|
|
459
|
+
const version = packageVersion(dirname(dirname(from)));
|
|
460
|
+
const show = (abs) => {
|
|
461
|
+
const rel = relative(cwd, abs);
|
|
462
|
+
return rel.startsWith("..") ? abs : rel;
|
|
463
|
+
};
|
|
464
|
+
const report = installSkills({
|
|
465
|
+
from,
|
|
466
|
+
to,
|
|
467
|
+
force,
|
|
468
|
+
version
|
|
469
|
+
});
|
|
470
|
+
log(`[comfy-ts skill] comfy-ts ${version} skills → ${show(to)}`);
|
|
471
|
+
for (const l of report.lines) log(` ${MARK[l.action]} ${l.action.padEnd(11)} ${show(l.file)}`);
|
|
472
|
+
if (!report.ok) {
|
|
473
|
+
const n = report.lines.filter((l) => l.action === "conflict").length;
|
|
474
|
+
log(`[comfy-ts skill] 🔴 ${n} file(s) changed since comfy-ts wrote them (✗ above): nothing was written. Keep your edits, or rerun with --force to overwrite them`);
|
|
475
|
+
return 1;
|
|
476
|
+
}
|
|
477
|
+
const kept = report.lines.filter((l) => l.action === "kept").length;
|
|
478
|
+
if (kept > 0) log(`[comfy-ts skill] ${kept} file(s) no longer shipped were kept because you edited them (? above)`);
|
|
479
|
+
log(`[comfy-ts skill] 🟢 Claude Code commands: ${report.commands.join(" ")}`);
|
|
480
|
+
log(`[comfy-ts skill] a session started before this skills folder existed needs /reload-skills`);
|
|
481
|
+
return 0;
|
|
482
|
+
}
|
|
483
|
+
//#endregion
|
|
278
484
|
//#region src/cli/comfy-ts-cli.ts
|
|
279
485
|
const HELP = `comfy-ts — typed SDK codegen for ComfyUI
|
|
280
486
|
|
|
@@ -318,6 +524,12 @@ Usage:
|
|
|
318
524
|
dir keeps the server's names). \`comfy-ts run <name> --help\` lists the vars,
|
|
319
525
|
\`comfy-ts run\` lists the modules. --json prints one line with the paths
|
|
320
526
|
|
|
527
|
+
comfy-ts skill install [--user | --dir <skills-dir>] [--force]
|
|
528
|
+
copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd
|
|
529
|
+
(--user: your personal skills folder): /comfy-ts-guide, -setup,
|
|
530
|
+
-workflow, -convert, -run. A file you edited is never overwritten
|
|
531
|
+
without --force. \`comfy-ts skill --help\` says more
|
|
532
|
+
|
|
321
533
|
comfy-ts help
|
|
322
534
|
`;
|
|
323
535
|
async function main() {
|
|
@@ -325,6 +537,7 @@ async function main() {
|
|
|
325
537
|
if (cmd === "gen") return runGen(rest);
|
|
326
538
|
if (cmd === "outline") return runOutline(rest);
|
|
327
539
|
if (cmd === "loras") return runLoras(rest);
|
|
540
|
+
if (cmd === "skill") return runSkill(rest);
|
|
328
541
|
if (cmd === "tui" || cmd === "serve" || cmd === "run") {
|
|
329
542
|
if (process.versions.bun == null) {
|
|
330
543
|
const res = await hopToBun([
|
|
@@ -337,14 +550,14 @@ async function main() {
|
|
|
337
550
|
}
|
|
338
551
|
armHopChild();
|
|
339
552
|
if (cmd === "run") {
|
|
340
|
-
const { runRun } = await import("./run-run-
|
|
553
|
+
const { runRun } = await import("./run-run-C_yXY0vl.js");
|
|
341
554
|
return runRun(rest);
|
|
342
555
|
}
|
|
343
556
|
if (cmd === "serve") {
|
|
344
557
|
const { runServe } = await import("./run-serve-DaXzoVTS.js");
|
|
345
558
|
return runServe(rest);
|
|
346
559
|
}
|
|
347
|
-
const { runTui } = await import("./run-tui-
|
|
560
|
+
const { runTui } = await import("./run-tui-B3dsftdB.js");
|
|
348
561
|
return runTui(rest);
|
|
349
562
|
}
|
|
350
563
|
console.log(HELP);
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli/bunHop.ts","../src/cli/flags.ts","../src/cli/gen.ts","../src/cli/loras.ts","../src/cli/outline.ts","../src/cli/comfy-ts-cli.ts"],"sourcesContent":["// `tui`, `serve` and `run` import .cflow.ts modules, which need bun: the bin's\n// node shebang re-execs the same command line through it. The wrapper is the pid\n// a terminal, a supervisor or an agent holds and stops, so the child must never\n// outlive it (agent/architecture.md item 10)\nimport { spawn } from 'node:child_process'\nimport { constants } from 'node:os'\n\nconst HOP_PARENT_ENV = 'COMFY_TS_HOP_PARENT'\nconst FORWARDED: NodeJS.Signals[] = ['SIGINT', 'SIGTERM', 'SIGHUP']\n\n/** runs `bun <argv>` with the terminal inherited, forwarding the stop signals;\n * resolves the child's exit code, or `error` when bun cannot start */\nexport function hopToBun(argv: string[]): Promise<{ code: number } | { error: Error }> {\n return new Promise((resolve) => {\n const child = spawn('bun', argv, {\n stdio: 'inherit',\n env: { ...process.env, [HOP_PARENT_ENV]: String(process.pid) },\n })\n const forward = (signal: NodeJS.Signals): void => {\n child.kill(signal)\n }\n for (const signal of FORWARDED) process.on(signal, forward)\n const done = (r: { code: number } | { error: Error }): void => {\n for (const signal of FORWARDED) process.off(signal, forward)\n resolve(r)\n }\n child.once('error', (error) => done({ error }))\n child.once('exit', (code, signal) => {\n if (code != null) return done({ code })\n done({ code: signal == null ? 1 : 128 + (constants.signals[signal] ?? 0) })\n })\n })\n}\n\n/** in the bun child: exit once the process that started it is gone. A SIGKILL to\n * the wrapper reaches no handler, so the child polls its own ppid, which changes\n * (to 1, or a subreaper) when its parent dies. It watches the ppid it started\n * with, not the wrapper pid: a version manager shim may sit between the two */\nexport function armHopChild(p: { intervalMs?: number } = {}): void {\n if (process.env[HOP_PARENT_ENV] == null) return\n // a grandchild has another parent: it must never inherit the watch\n Reflect.deleteProperty(process.env, HOP_PARENT_ENV)\n const parent = process.ppid\n setInterval(() => {\n if (process.ppid === parent) return\n console.error(`[comfy-ts] the process that started this one (pid ${parent}) is gone: exiting`)\n process.exit(1)\n }, p.intervalMs ?? 1000).unref()\n}\n","/**\n * the CLI's one flag reader: `--name value`.\n * A flag written with no value after it is a TYPO, never a request for the\n * default — silently falling back would run against the wrong host.\n */\nexport function flagReader(args: string[]): (name: string) => string | null {\n return (name: string): string | null => {\n const ix = args.indexOf(`--${name}`)\n if (ix < 0) return null\n const value = args[ix + 1]\n if (value == null || value.startsWith('--')) throw new Error(`--${name} needs a value`)\n return value\n }\n}\n","// fetch a live host's schema and generate its typed sdk\nimport { mkdirSync, writeFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'pathe'\nimport { flagReader } from 'src/cli/flags.ts'\nimport { ComfySchema } from 'src/sdk-generator/ComfySchema.ts'\nimport type { ComfySchemaJSON } from 'src/sdk-generator/ComfyUIObjectInfoTypes.ts'\nimport { ComfyTS } from 'src/state.ts'\nimport { readableStringify } from 'src/utils/stringifyReadable.ts'\n\nexport async function runGen(args: string[]): Promise<number> {\n const getFlag = flagReader(args)\n const hostUrl = getFlag('host') ?? 'http://127.0.0.1:8188'\n const id = getFlag('id')\n if (id == null) {\n console.error('[comfy-ts gen] 🔴 --id <host-id> is required (it names .comfy-ts/hosts/<id>/)')\n return 1\n }\n\n // the lib's own authed host.fetch does the /api-first probing + X-API-Key\n const comfy = ComfyTS.create()\n const apiKey = getFlag('api-key') ?? process.env.COMFY_CLOUD_API_KEY\n const host = comfy.host({ id, url: hostUrl, apiKey: apiKey ?? undefined })\n\n const fetchJSON = async <T>(route: string): Promise<T> => {\n console.log(`[comfy-ts gen] fetching ${hostUrl} ${route} …`)\n const res = await host.fetch(route)\n if (!res.ok) throw new Error(`GET ${route} failed on ${hostUrl}: ${res.status}`)\n if (!(res.headers.get('content-type') ?? '').includes('json'))\n throw new Error(`GET ${route} on ${hostUrl} did not answer json`)\n return (await res.json()) as T\n }\n\n const spec = await fetchJSON<ComfySchemaJSON>('/object_info')\n const embeddings = await fetchJSON<string[]>('/embeddings').catch(() => [] as string[])\n\n const dir = join(process.cwd(), '.comfy-ts', 'hosts', id)\n mkdirSync(dir, { recursive: true })\n writeFileSync(join(dir, 'object_info.json'), readableStringify(spec, 4), 'utf8')\n writeFileSync(join(dir, 'embeddings.json'), JSON.stringify(embeddings), 'utf8')\n\n const parsed = new ComfySchema({ spec, embeddings })\n const dts = parsed.codegenDTS({ hostId: id })\n // --out: explicit sdk home (the committed cloud catalog) — the json dumps\n // above still cache under .comfy-ts/hosts/<id>/, but the sdk must exist at\n // ONE tsconfig-visible path only, so it skips the hosts dir entirely\n const out = getFlag('out')\n const outPath = out != null ? resolve(process.cwd(), out) : join(dir, 'sdk.d.ts')\n if (out != null) mkdirSync(dirname(outPath), { recursive: true })\n writeFileSync(outPath, dts, 'utf8')\n console.log(`[comfy-ts gen] 🟢 ${outPath} (${parsed.nodes.length} nodes, ${(dts.length / 1024).toFixed(0)}kB)`)\n if (out == null)\n console.log(`[comfy-ts gen] add \".comfy-ts/hosts/**/sdk.d.ts\" to your tsconfig \"include\" to activate the types`)\n return 0\n}\n","// refresh the local mirror of what ComfyUI-Lora-Manager knows about a host's loras\nimport { readdirSync, rmdirSync } from 'node:fs'\nimport { join } from 'pathe'\nimport { flagReader } from 'src/cli/flags.ts'\nimport { buildLoraMirror, readLoraMirror, writeLoraMirror } from 'src/host/loraInfoCache.ts'\nimport { fetchLoraList, lmModelName, lmTrainedWords } from 'src/host/loraManagerApi.ts'\nimport { ComfyTS } from 'src/state.ts'\n\nconst DEFAULT_HOST_URL = 'http://127.0.0.1:8188'\n\n/** host ids already known on disk — `.comfy-ts/hosts/<id>/` is created by `comfy-ts gen` */\nfunction knownHostIds(): string[] {\n try {\n return readdirSync(join(process.cwd(), '.comfy-ts', 'hosts'), { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name)\n .sort()\n } catch {\n return []\n }\n}\n\nexport async function runLoras(args: string[]): Promise<number> {\n const getFlag = flagReader(args)\n\n // --id: explicit, else the only host folder on disk (unambiguous), else loud\n const known = knownHostIds()\n const explicitId = getFlag('id')\n const id = explicitId ?? (known.length === 1 ? known[0] : null)\n if (id == null) {\n const hint =\n known.length === 0 ? 'none yet — run `comfy-ts gen --id <host-id> --host <url>` first' : known.join(', ')\n console.error(`[comfy-ts loras] 🔴 --id <host-id> is required (known: ${hint})`)\n return 1\n }\n // registering a host MKDIRS .comfy-ts/hosts/<id>/, so a typo used to leave a\n // junk folder that broke the `--id` default (and outline's) for good. Rather\n // than refuse unknown ids — `loras` has no real dependency on `gen` — remember\n // whether the folder pre-existed and take it back if the sweep fails.\n const hostDirExisted = known.includes(id)\n\n // ComfyTS FIRST: every .comfy-ts path, the mirror's included, resolves through the global\n const comfy = ComfyTS.create()\n\n // --host: explicit, else the url the last sync remembered for this id\n const previous = readLoraMirror(id)\n const hostUrl = getFlag('host') ?? (previous?.hostUrl !== '' ? previous?.hostUrl : null) ?? DEFAULT_HOST_URL\n\n const apiKey = getFlag('api-key') ?? process.env.COMFY_CLOUD_API_KEY\n const host = comfy.host({ id, url: hostUrl, apiKey: apiKey ?? undefined })\n\n /** a sweep that never produced a mirror must leave no trace of this run */\n const abandon = (): void => {\n if (hostDirExisted) return\n const dir = join(process.cwd(), '.comfy-ts', 'hosts', id)\n try {\n if (readdirSync(dir).length === 0) rmdirSync(dir)\n } catch {\n // best effort: a non-empty or vanished dir is not this command's business\n }\n }\n\n console.log(`[comfy-ts loras] sweeping ${hostUrl} /api/lm/loras/list …`)\n const sweep = await fetchLoraList(host)\n if (sweep.status === 'absent') {\n console.error(\n `[comfy-ts loras] 🔴 ${hostUrl} has no ComfyUI-Lora-Manager: the extension is not installed there. Mirror left untouched.`,\n )\n abandon()\n return 1\n }\n if (sweep.status === 'unreachable') {\n console.error(`[comfy-ts loras] 🔴 ${hostUrl} unreachable — ${sweep.reason}. Mirror left untouched.`)\n abandon()\n return 1\n }\n if (sweep.status === 'partial') {\n // writing this would DELETE loras from the mirror that are alive on the\n // host, and every surface would then quietly not know them\n console.error(\n `[comfy-ts loras] 🔴 the sweep broke off after ${sweep.items.length} loras (${sweep.reason}). Writing that would drop every lora past it, so the mirror is left untouched. Re-run when the host is healthy.`,\n )\n abandon()\n return 1\n }\n\n const mirror = buildLoraMirror({ hostId: id, hostUrl, fetchedAt: new Date().toISOString(), items: sweep.items })\n const path = writeLoraMirror(mirror)\n\n // what actually moved since the last sync — the whole point of running it again\n const before = previous?.loras ?? {}\n const added: string[] = []\n const changed: string[] = []\n let withWords = 0\n for (const [key, item] of Object.entries(mirror.loras)) {\n const words = lmTrainedWords(item)\n if (words.length > 0) withWords++\n const old = before[key]\n if (old == null) {\n if (words.length > 0) added.push(`${key} → ${words.join(', ')}`)\n else added.push(key)\n } else if (lmTrainedWords(old).join('\\0') !== words.join('\\0')) {\n changed.push(`${key} → ${words.length === 0 ? '(cleared)' : words.join(', ')}`)\n }\n }\n const removed = Object.keys(before).filter((k) => mirror.loras[k] == null)\n\n const sample = (label: string, lines: string[]): void => {\n if (lines.length === 0) return\n console.log(`[comfy-ts loras] ${label} (${lines.length}):`)\n for (const line of lines.slice(0, 10)) console.log(` ${line}`)\n if (lines.length > 10) console.log(` … +${lines.length - 10} more`)\n }\n sample('added', added)\n sample('trigger words changed', changed)\n sample('gone from the host', removed)\n\n const named = Object.values(mirror.loras).filter((i) => lmModelName(i) != null).length\n console.log(\n `[comfy-ts loras] 🟢 ${path} — ${mirror.count} loras, ${withWords} with trigger words, ${named} with a model name`,\n )\n if (previous == null) console.log(`[comfy-ts loras] next time: \\`comfy-ts loras --id ${id}\\` (url remembered)`)\n return 0\n}\n","// outline a generated sdk.d.ts without reading 2MB blind\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { join } from 'pathe'\n\ntype Section = { name: string; kind: string; start: number; end: number; depth: number }\n\nfunction findDefaultSdk(): string | null {\n const hostsDir = join(process.cwd(), '.comfy-ts', 'hosts')\n if (!existsSync(hostsDir)) return null\n for (const id of readdirSync(hostsDir)) {\n const p = join(hostsDir, id, 'sdk.d.ts')\n if (existsSync(p)) return p\n }\n return null\n}\n\nexport function runOutline(args: string[]): number {\n const linesFlagIx = args.indexOf('--lines')\n const maxLines = linesFlagIx >= 0 ? Number(args[linesFlagIx + 1] ?? 10) : null\n const sectionFlagIx = args.indexOf('--section')\n const wantedSection = sectionFlagIx >= 0 ? args[sectionFlagIx + 1] : null\n const flagValueIxs = new Set([linesFlagIx + 1, sectionFlagIx + 1].filter((ix) => ix > 0))\n const fileArg = args.find((a, ix) => !a.startsWith('--') && !flagValueIxs.has(ix))\n\n const file = fileArg ?? findDefaultSdk()\n if (file == null || !existsSync(file)) {\n console.error('[sdk-outline] 🔴 no sdk.d.ts found; pass a path explicitly')\n return 1\n }\n\n const lines = readFileSync(file, 'utf8').split('\\n')\n\n // scan: track brace depth, record interface/type/namespace declarations up to depth 3\n const sections: Section[] = []\n const stack: Section[] = []\n let depth = 0\n const declRe = /^\\s*(?:export\\s+)?(interface|namespace|type)\\s+([A-Za-z0-9_$]+)/\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? ''\n const m = depth <= 3 ? declRe.exec(line) : null\n const opens = (line.match(/{/g) ?? []).length\n const closes = (line.match(/}/g) ?? []).length\n if (m && (opens > 0 || m[1] === 'type')) {\n const sec: Section = { name: m[2] ?? '?', kind: m[1] ?? '?', start: i + 1, end: i + 1, depth }\n sections.push(sec)\n if (opens > closes) stack.push(sec)\n }\n depth += opens - closes\n while (stack.length > 0 && depth <= (stack[stack.length - 1]?.depth ?? 0)) {\n const closed = stack.pop()\n if (closed) closed.end = i + 1\n }\n // type aliases (no braces): extend until next decl at same depth\n const last = sections[sections.length - 1]\n if (last && last.kind === 'type' && stack[stack.length - 1] !== last) last.end = Math.max(last.end, i)\n }\n\n if (wantedSection) {\n const sec = sections.find((s) => s.name === wantedSection)\n if (sec == null) {\n console.error(\n `[sdk-outline] 🔴 section \"${wantedSection}\" not found. Available: ${sections.map((s) => s.name).join(', ')}`,\n )\n return 1\n }\n const body = lines.slice(sec.start - 1, maxLines ? Math.min(sec.end, sec.start - 1 + maxLines) : sec.end)\n console.log(body.join('\\n'))\n if (maxLines && sec.end - sec.start + 1 > maxLines)\n console.log(`… (${sec.end - sec.start + 1 - maxLines} more lines, ends at line ${sec.end})`)\n } else {\n console.log(`${file} — ${lines.length} lines\\n`)\n for (const s of sections) {\n const indent = ' '.repeat(s.depth)\n console.log(`${indent}${s.kind} ${s.name} [${s.start}-${s.end}] (${s.end - s.start + 1} lines)`)\n if (maxLines) {\n const body = lines.slice(s.start - 1, s.start - 1 + maxLines)\n console.log(body.map((l) => `${indent} │ ${l.trim()}`).join('\\n'))\n }\n }\n }\n return 0\n}\n","#!/usr/bin/env node\n// sidekick CLI: `bunx comfy-ts <command>` — codegen without writing any code\nimport { armHopChild, hopToBun } from 'src/cli/bunHop.ts'\nimport { fileURLToPath } from 'node:url'\nimport { runGen } from 'src/cli/gen.ts'\nimport { runLoras } from 'src/cli/loras.ts'\nimport { runOutline } from 'src/cli/outline.ts'\n\nconst HELP = `comfy-ts — typed SDK codegen for ComfyUI\n\nUsage:\n comfy-ts gen --id <host-id> [--host http://127.0.0.1:8188] [--api-key <key>] [--out <sdk-path>]\n fetch object_info + embeddings from a live ComfyUI host and write\n .comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts}\n (--api-key or COMFY_CLOUD_API_KEY authenticates via X-API-Key;\n --out relocates ONLY the sdk.d.ts, e.g. a committed cloud catalog)\n\n comfy-ts outline [file] [--lines N] [--section Name]\n outline a generated sdk.d.ts (defaults to the first one in .comfy-ts/hosts/)\n\n comfy-ts loras [--id <host-id>] [--host http://…] [--api-key <key>]\n mirror what the optional ComfyUI-Lora-Manager extension knows about\n every lora into .comfy-ts/hosts/<id>/loras.json: real model names,\n civitai trigger words, tags, base model, preview urls. The TUI then\n fuzzy-matches loras by their human name and auto-injects their trigger\n words into v.prompt (⌃K still overrides, per lora). --id defaults to\n the only host folder on disk, --host to the url the last sync used\n\n comfy-ts tui [dir | workflow-module.ts]\n interactive tweak & re-run over **/*.cflow.ts modules (exporting\n host.defineWorkflow(...)); no arg scans cwd + the examples bundled\n with comfy-ts, an explicit dir/file limits to it (file preselected)\n\n comfy-ts serve [dir | workflow-module.ts] [--port 8288] [--host 127.0.0.1]\n drafts as a local HTTP generation API: POST /generate/<module>/<draft>\n with { ...vars } overriding the draft's values (blocking; raw image\n bytes under Accept: image/*), GET /drafts self-describes every var,\n GET /outputs/... serves the results. Open / in a browser for the web\n panel. No bundled examples, no auth, and any origin may call it: use\n --host beyond localhost only on a network you trust.\n\n comfy-ts run <name | module.cflow.ts> [--draft <name>] [--<var> <value>…] [--out <path>] [--json]\n ONE generation, headless, with live progress: the module is found in cwd,\n then in the examples bundled with comfy-ts, by its key (10-anima-t2i), its\n key without the number (anima-t2i) or a unique part (anima). Each var is a\n flag (--prompt \"…\" --seed 7 --image in.png), --<var>-file reads a text var\n from a file, --out writes the output there (several: a-1.png, a-2.png; a\n dir keeps the server's names). \\`comfy-ts run <name> --help\\` lists the vars,\n \\`comfy-ts run\\` lists the modules. --json prints one line with the paths\n\n comfy-ts help\n`\n\nasync function main(): Promise<number> {\n const [cmd, ...rest] = process.argv.slice(2)\n if (cmd === 'gen') return runGen(rest)\n if (cmd === 'outline') return runOutline(rest)\n if (cmd === 'loras') return runLoras(rest)\n if (cmd === 'tui' || cmd === 'serve' || cmd === 'run') {\n // .cflow.ts workflow modules need bun: node refuses to strip types under\n // node_modules, exactly where the packaged examples live — and the bin's\n // node shebang means `bunx comfy-ts tui|serve` lands here under NODE. Hop\n // to bun when we are not already in it; without bun, degrade loudly.\n if (process.versions.bun == null) {\n const res = await hopToBun([fileURLToPath(import.meta.url), cmd, ...rest])\n if ('code' in res) return res.code\n console.error(\n `[comfy-ts ${cmd}] bun not found (${res.error.message}) — continuing under node: the examples packaged in node_modules cannot load here, and your own .cflow.ts modules rely on node's type stripping`,\n )\n }\n armHopChild()\n if (cmd === 'run') {\n const { runRun } = await import('src/cli/run/run-run.ts')\n return runRun(rest)\n }\n if (cmd === 'serve') {\n const { runServe } = await import('src/cli/serve/run-serve.ts')\n return runServe(rest)\n }\n // lazy import: keeps ink/react out of the codegen paths\n const { runTui } = await import('src/cli/tui/run-tui.tsx')\n return runTui(rest)\n }\n console.log(HELP)\n return cmd == null || cmd === 'help' ? 0 : 1\n}\n\n// a thrown command (a flag with no value, an unreadable path) must print ONE\n// clear line and exit non-zero, never a raw unhandled-rejection stack\nprocess.exitCode = await main().catch((e: unknown) => {\n console.error(`[comfy-ts] 🔴 ${e instanceof Error ? e.message : String(e)}`)\n return 1\n})\n"],"mappings":";;;;;;;;;AAOA,MAAM,iBAAiB;AACvB,MAAM,YAA8B;CAAC;CAAU;CAAW;AAAQ;;;AAIlE,SAAgB,SAAS,MAA8D;CACpF,OAAO,IAAI,SAAS,YAAY;EAC7B,MAAM,QAAQ,MAAM,OAAO,MAAM;GAC9B,OAAO;GACP,KAAK;IAAE,GAAG,QAAQ;KAAM,iBAAiB,OAAO,QAAQ,GAAG;GAAE;EAChE,CAAC;EACD,MAAM,WAAW,WAAiC;GAC/C,MAAM,KAAK,MAAM;EACpB;EACA,KAAK,MAAM,UAAU,WAAW,QAAQ,GAAG,QAAQ,OAAO;EAC1D,MAAM,QAAQ,MAAiD;GAC5D,KAAK,MAAM,UAAU,WAAW,QAAQ,IAAI,QAAQ,OAAO;GAC3D,QAAQ,CAAC;EACZ;EACA,MAAM,KAAK,UAAU,UAAU,KAAK,EAAE,MAAM,CAAC,CAAC;EAC9C,MAAM,KAAK,SAAS,MAAM,WAAW;GAClC,IAAI,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,CAAC;GACtC,KAAK,EAAE,MAAM,UAAU,OAAO,IAAI,OAAO,UAAU,QAAQ,WAAW,GAAG,CAAC;EAC7E,CAAC;CACJ,CAAC;AACJ;;;;;AAMA,SAAgB,YAAY,IAA6B,CAAC,GAAS;CAChE,IAAI,QAAQ,IAAI,mBAAmB,MAAM;CAEzC,QAAQ,eAAe,QAAQ,KAAK,cAAc;CAClD,MAAM,SAAS,QAAQ;CACvB,kBAAkB;EACf,IAAI,QAAQ,SAAS,QAAQ;EAC7B,QAAQ,MAAM,qDAAqD,OAAO,mBAAmB;EAC7F,QAAQ,KAAK,CAAC;CACjB,GAAG,EAAE,cAAc,GAAI,CAAC,CAAC,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nD,QAAQ,MAAM,iBAAiB,aAAa,QAAQ,EAAE,UAAU,OAAO,CAAC,GAAG;CAC3E,OAAO;AACV,CAAC"}
|
|
1
|
+
{"version":3,"file":"cli.js","names":[],"sources":["../src/cli/bunHop.ts","../src/cli/flags.ts","../src/cli/gen.ts","../src/cli/loras.ts","../src/cli/outline.ts","../src/cli/skill.ts","../src/cli/comfy-ts-cli.ts"],"sourcesContent":["// `tui`, `serve` and `run` import .cflow.ts modules, which need bun: the bin's\n// node shebang re-execs the same command line through it. The wrapper is the pid\n// a terminal, a supervisor or an agent holds and stops, so the child must never\n// outlive it (agent/architecture.md item 10)\nimport { spawn } from 'node:child_process'\nimport { constants } from 'node:os'\n\nconst HOP_PARENT_ENV = 'COMFY_TS_HOP_PARENT'\nconst FORWARDED: NodeJS.Signals[] = ['SIGINT', 'SIGTERM', 'SIGHUP']\n\n/** runs `bun <argv>` with the terminal inherited, forwarding the stop signals;\n * resolves the child's exit code, or `error` when bun cannot start */\nexport function hopToBun(argv: string[]): Promise<{ code: number } | { error: Error }> {\n return new Promise((resolve) => {\n const child = spawn('bun', argv, {\n stdio: 'inherit',\n env: { ...process.env, [HOP_PARENT_ENV]: String(process.pid) },\n })\n const forward = (signal: NodeJS.Signals): void => {\n child.kill(signal)\n }\n for (const signal of FORWARDED) process.on(signal, forward)\n const done = (r: { code: number } | { error: Error }): void => {\n for (const signal of FORWARDED) process.off(signal, forward)\n resolve(r)\n }\n child.once('error', (error) => done({ error }))\n child.once('exit', (code, signal) => {\n if (code != null) return done({ code })\n done({ code: signal == null ? 1 : 128 + (constants.signals[signal] ?? 0) })\n })\n })\n}\n\n/** in the bun child: exit once the process that started it is gone. A SIGKILL to\n * the wrapper reaches no handler, so the child polls its own ppid, which changes\n * (to 1, or a subreaper) when its parent dies. It watches the ppid it started\n * with, not the wrapper pid: a version manager shim may sit between the two */\nexport function armHopChild(p: { intervalMs?: number } = {}): void {\n if (process.env[HOP_PARENT_ENV] == null) return\n // a grandchild has another parent: it must never inherit the watch\n Reflect.deleteProperty(process.env, HOP_PARENT_ENV)\n const parent = process.ppid\n setInterval(() => {\n if (process.ppid === parent) return\n console.error(`[comfy-ts] the process that started this one (pid ${parent}) is gone: exiting`)\n process.exit(1)\n }, p.intervalMs ?? 1000).unref()\n}\n","/**\n * the CLI's one flag reader: `--name value`.\n * A flag written with no value after it is a TYPO, never a request for the\n * default — silently falling back would run against the wrong host.\n */\nexport function flagReader(args: string[]): (name: string) => string | null {\n return (name: string): string | null => {\n const ix = args.indexOf(`--${name}`)\n if (ix < 0) return null\n const value = args[ix + 1]\n if (value == null || value.startsWith('--')) throw new Error(`--${name} needs a value`)\n return value\n }\n}\n","// fetch a live host's schema and generate its typed sdk\nimport { mkdirSync, writeFileSync } from 'node:fs'\nimport { dirname, join, resolve } from 'pathe'\nimport { flagReader } from 'src/cli/flags.ts'\nimport { ComfySchema } from 'src/sdk-generator/ComfySchema.ts'\nimport type { ComfySchemaJSON } from 'src/sdk-generator/ComfyUIObjectInfoTypes.ts'\nimport { ComfyTS } from 'src/state.ts'\nimport { readableStringify } from 'src/utils/stringifyReadable.ts'\n\nexport async function runGen(args: string[]): Promise<number> {\n const getFlag = flagReader(args)\n const hostUrl = getFlag('host') ?? 'http://127.0.0.1:8188'\n const id = getFlag('id')\n if (id == null) {\n console.error('[comfy-ts gen] 🔴 --id <host-id> is required (it names .comfy-ts/hosts/<id>/)')\n return 1\n }\n\n // the lib's own authed host.fetch does the /api-first probing + X-API-Key\n const comfy = ComfyTS.create()\n const apiKey = getFlag('api-key') ?? process.env.COMFY_CLOUD_API_KEY\n const host = comfy.host({ id, url: hostUrl, apiKey: apiKey ?? undefined })\n\n const fetchJSON = async <T>(route: string): Promise<T> => {\n console.log(`[comfy-ts gen] fetching ${hostUrl} ${route} …`)\n const res = await host.fetch(route)\n if (!res.ok) throw new Error(`GET ${route} failed on ${hostUrl}: ${res.status}`)\n if (!(res.headers.get('content-type') ?? '').includes('json'))\n throw new Error(`GET ${route} on ${hostUrl} did not answer json`)\n return (await res.json()) as T\n }\n\n const spec = await fetchJSON<ComfySchemaJSON>('/object_info')\n const embeddings = await fetchJSON<string[]>('/embeddings').catch(() => [] as string[])\n\n const dir = join(process.cwd(), '.comfy-ts', 'hosts', id)\n mkdirSync(dir, { recursive: true })\n writeFileSync(join(dir, 'object_info.json'), readableStringify(spec, 4), 'utf8')\n writeFileSync(join(dir, 'embeddings.json'), JSON.stringify(embeddings), 'utf8')\n\n const parsed = new ComfySchema({ spec, embeddings })\n const dts = parsed.codegenDTS({ hostId: id })\n // --out: explicit sdk home (the committed cloud catalog) — the json dumps\n // above still cache under .comfy-ts/hosts/<id>/, but the sdk must exist at\n // ONE tsconfig-visible path only, so it skips the hosts dir entirely\n const out = getFlag('out')\n const outPath = out != null ? resolve(process.cwd(), out) : join(dir, 'sdk.d.ts')\n if (out != null) mkdirSync(dirname(outPath), { recursive: true })\n writeFileSync(outPath, dts, 'utf8')\n console.log(`[comfy-ts gen] 🟢 ${outPath} (${parsed.nodes.length} nodes, ${(dts.length / 1024).toFixed(0)}kB)`)\n if (out == null)\n console.log(`[comfy-ts gen] add \".comfy-ts/hosts/**/sdk.d.ts\" to your tsconfig \"include\" to activate the types`)\n return 0\n}\n","// refresh the local mirror of what ComfyUI-Lora-Manager knows about a host's loras\nimport { readdirSync, rmdirSync } from 'node:fs'\nimport { join } from 'pathe'\nimport { flagReader } from 'src/cli/flags.ts'\nimport { buildLoraMirror, readLoraMirror, writeLoraMirror } from 'src/host/loraInfoCache.ts'\nimport { fetchLoraList, lmModelName, lmTrainedWords } from 'src/host/loraManagerApi.ts'\nimport { ComfyTS } from 'src/state.ts'\n\nconst DEFAULT_HOST_URL = 'http://127.0.0.1:8188'\n\n/** host ids already known on disk — `.comfy-ts/hosts/<id>/` is created by `comfy-ts gen` */\nfunction knownHostIds(): string[] {\n try {\n return readdirSync(join(process.cwd(), '.comfy-ts', 'hosts'), { withFileTypes: true })\n .filter((e) => e.isDirectory())\n .map((e) => e.name)\n .sort()\n } catch {\n return []\n }\n}\n\nexport async function runLoras(args: string[]): Promise<number> {\n const getFlag = flagReader(args)\n\n // --id: explicit, else the only host folder on disk (unambiguous), else loud\n const known = knownHostIds()\n const explicitId = getFlag('id')\n const id = explicitId ?? (known.length === 1 ? known[0] : null)\n if (id == null) {\n const hint =\n known.length === 0 ? 'none yet — run `comfy-ts gen --id <host-id> --host <url>` first' : known.join(', ')\n console.error(`[comfy-ts loras] 🔴 --id <host-id> is required (known: ${hint})`)\n return 1\n }\n // registering a host MKDIRS .comfy-ts/hosts/<id>/, so a typo used to leave a\n // junk folder that broke the `--id` default (and outline's) for good. Rather\n // than refuse unknown ids — `loras` has no real dependency on `gen` — remember\n // whether the folder pre-existed and take it back if the sweep fails.\n const hostDirExisted = known.includes(id)\n\n // ComfyTS FIRST: every .comfy-ts path, the mirror's included, resolves through the global\n const comfy = ComfyTS.create()\n\n // --host: explicit, else the url the last sync remembered for this id\n const previous = readLoraMirror(id)\n const hostUrl = getFlag('host') ?? (previous?.hostUrl !== '' ? previous?.hostUrl : null) ?? DEFAULT_HOST_URL\n\n const apiKey = getFlag('api-key') ?? process.env.COMFY_CLOUD_API_KEY\n const host = comfy.host({ id, url: hostUrl, apiKey: apiKey ?? undefined })\n\n /** a sweep that never produced a mirror must leave no trace of this run */\n const abandon = (): void => {\n if (hostDirExisted) return\n const dir = join(process.cwd(), '.comfy-ts', 'hosts', id)\n try {\n if (readdirSync(dir).length === 0) rmdirSync(dir)\n } catch {\n // best effort: a non-empty or vanished dir is not this command's business\n }\n }\n\n console.log(`[comfy-ts loras] sweeping ${hostUrl} /api/lm/loras/list …`)\n const sweep = await fetchLoraList(host)\n if (sweep.status === 'absent') {\n console.error(\n `[comfy-ts loras] 🔴 ${hostUrl} has no ComfyUI-Lora-Manager: the extension is not installed there. Mirror left untouched.`,\n )\n abandon()\n return 1\n }\n if (sweep.status === 'unreachable') {\n console.error(`[comfy-ts loras] 🔴 ${hostUrl} unreachable — ${sweep.reason}. Mirror left untouched.`)\n abandon()\n return 1\n }\n if (sweep.status === 'partial') {\n // writing this would DELETE loras from the mirror that are alive on the\n // host, and every surface would then quietly not know them\n console.error(\n `[comfy-ts loras] 🔴 the sweep broke off after ${sweep.items.length} loras (${sweep.reason}). Writing that would drop every lora past it, so the mirror is left untouched. Re-run when the host is healthy.`,\n )\n abandon()\n return 1\n }\n\n const mirror = buildLoraMirror({ hostId: id, hostUrl, fetchedAt: new Date().toISOString(), items: sweep.items })\n const path = writeLoraMirror(mirror)\n\n // what actually moved since the last sync — the whole point of running it again\n const before = previous?.loras ?? {}\n const added: string[] = []\n const changed: string[] = []\n let withWords = 0\n for (const [key, item] of Object.entries(mirror.loras)) {\n const words = lmTrainedWords(item)\n if (words.length > 0) withWords++\n const old = before[key]\n if (old == null) {\n if (words.length > 0) added.push(`${key} → ${words.join(', ')}`)\n else added.push(key)\n } else if (lmTrainedWords(old).join('\\0') !== words.join('\\0')) {\n changed.push(`${key} → ${words.length === 0 ? '(cleared)' : words.join(', ')}`)\n }\n }\n const removed = Object.keys(before).filter((k) => mirror.loras[k] == null)\n\n const sample = (label: string, lines: string[]): void => {\n if (lines.length === 0) return\n console.log(`[comfy-ts loras] ${label} (${lines.length}):`)\n for (const line of lines.slice(0, 10)) console.log(` ${line}`)\n if (lines.length > 10) console.log(` … +${lines.length - 10} more`)\n }\n sample('added', added)\n sample('trigger words changed', changed)\n sample('gone from the host', removed)\n\n const named = Object.values(mirror.loras).filter((i) => lmModelName(i) != null).length\n console.log(\n `[comfy-ts loras] 🟢 ${path} — ${mirror.count} loras, ${withWords} with trigger words, ${named} with a model name`,\n )\n if (previous == null) console.log(`[comfy-ts loras] next time: \\`comfy-ts loras --id ${id}\\` (url remembered)`)\n return 0\n}\n","// outline a generated sdk.d.ts without reading 2MB blind\nimport { existsSync, readdirSync, readFileSync } from 'node:fs'\nimport { join } from 'pathe'\n\ntype Section = { name: string; kind: string; start: number; end: number; depth: number }\n\nfunction findDefaultSdk(): string | null {\n const hostsDir = join(process.cwd(), '.comfy-ts', 'hosts')\n if (!existsSync(hostsDir)) return null\n for (const id of readdirSync(hostsDir)) {\n const p = join(hostsDir, id, 'sdk.d.ts')\n if (existsSync(p)) return p\n }\n return null\n}\n\nexport function runOutline(args: string[]): number {\n const linesFlagIx = args.indexOf('--lines')\n const maxLines = linesFlagIx >= 0 ? Number(args[linesFlagIx + 1] ?? 10) : null\n const sectionFlagIx = args.indexOf('--section')\n const wantedSection = sectionFlagIx >= 0 ? args[sectionFlagIx + 1] : null\n const flagValueIxs = new Set([linesFlagIx + 1, sectionFlagIx + 1].filter((ix) => ix > 0))\n const fileArg = args.find((a, ix) => !a.startsWith('--') && !flagValueIxs.has(ix))\n\n const file = fileArg ?? findDefaultSdk()\n if (file == null || !existsSync(file)) {\n console.error('[sdk-outline] 🔴 no sdk.d.ts found; pass a path explicitly')\n return 1\n }\n\n const lines = readFileSync(file, 'utf8').split('\\n')\n\n // scan: track brace depth, record interface/type/namespace declarations up to depth 3\n const sections: Section[] = []\n const stack: Section[] = []\n let depth = 0\n const declRe = /^\\s*(?:export\\s+)?(interface|namespace|type)\\s+([A-Za-z0-9_$]+)/\n for (let i = 0; i < lines.length; i++) {\n const line = lines[i] ?? ''\n const m = depth <= 3 ? declRe.exec(line) : null\n const opens = (line.match(/{/g) ?? []).length\n const closes = (line.match(/}/g) ?? []).length\n if (m && (opens > 0 || m[1] === 'type')) {\n const sec: Section = { name: m[2] ?? '?', kind: m[1] ?? '?', start: i + 1, end: i + 1, depth }\n sections.push(sec)\n if (opens > closes) stack.push(sec)\n }\n depth += opens - closes\n while (stack.length > 0 && depth <= (stack[stack.length - 1]?.depth ?? 0)) {\n const closed = stack.pop()\n if (closed) closed.end = i + 1\n }\n // type aliases (no braces): extend until next decl at same depth\n const last = sections[sections.length - 1]\n if (last && last.kind === 'type' && stack[stack.length - 1] !== last) last.end = Math.max(last.end, i)\n }\n\n if (wantedSection) {\n const sec = sections.find((s) => s.name === wantedSection)\n if (sec == null) {\n console.error(\n `[sdk-outline] 🔴 section \"${wantedSection}\" not found. Available: ${sections.map((s) => s.name).join(', ')}`,\n )\n return 1\n }\n const body = lines.slice(sec.start - 1, maxLines ? Math.min(sec.end, sec.start - 1 + maxLines) : sec.end)\n console.log(body.join('\\n'))\n if (maxLines && sec.end - sec.start + 1 > maxLines)\n console.log(`… (${sec.end - sec.start + 1 - maxLines} more lines, ends at line ${sec.end})`)\n } else {\n console.log(`${file} — ${lines.length} lines\\n`)\n for (const s of sections) {\n const indent = ' '.repeat(s.depth)\n console.log(`${indent}${s.kind} ${s.name} [${s.start}-${s.end}] (${s.end - s.start + 1} lines)`)\n if (maxLines) {\n const body = lines.slice(s.start - 1, s.start - 1 + maxLines)\n console.log(body.map((l) => `${indent} │ ${l.trim()}`).join('\\n'))\n }\n }\n }\n return 0\n}\n","// `comfy-ts skill install`: copy the Claude Code skills of claude-code/skills/ into a skills folder.\n// the record file holds the hash of every file the install wrote: it is what tells an untouched\n// file (safe to update) from one the user edited (never overwritten without --force)\nimport { createHash } from 'node:crypto'\nimport { existsSync, mkdirSync, readdirSync, readFileSync, rmdirSync, rmSync, statSync, writeFileSync } from 'node:fs'\nimport { homedir } from 'node:os'\nimport { dirname, join, relative, resolve } from 'pathe'\nimport { comfyTsPackageDir } from 'src/exampleAssets.ts'\n\nexport const SKILL_PREFIX = 'comfy-ts-'\nexport const SKILL_RECORD_FILE = '.comfy-ts-skills.json'\n\nexport const SKILL_USAGE = `comfy-ts skill install [--user | --dir <skills-dir>] [--force]\n copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd (--user: your personal\n skills folder, --dir: that folder): /comfy-ts-guide, /comfy-ts-setup, /comfy-ts-workflow,\n /comfy-ts-convert, /comfy-ts-run. A rerun updates what it wrote; a file you edited is never\n overwritten without --force. The same skills ship as a Claude Code plugin:\n /plugin marketplace add rvion/comfy-ts, then /plugin install comfy-ts@comfy-ts`\n\nexport type SkillAction = 'created' | 'unchanged' | 'updated' | 'overwritten' | 'removed' | 'kept' | 'conflict'\nexport type SkillLine = { action: SkillAction; file: string }\nexport type SkillReport = { ok: boolean; lines: SkillLine[]; commands: string[] }\ntype SkillRecord = { version: string; files: Record<string, string> }\n\n/** claude-code/skills/ of the installed package, resolved from this module, never from the cwd */\nexport function skillSourceDir(): string {\n const pkgDir = comfyTsPackageDir(import.meta.url)\n if (pkgDir == null) throw new Error('cannot find the comfy-ts package this command runs from')\n const dir = join(pkgDir, 'claude-code', 'skills')\n if (!existsSync(dir)) throw new Error(`the comfy-ts package has no skills folder at ${dir}`)\n return dir\n}\n\nconst sha256 = (bytes: Buffer): string => createHash('sha256').update(bytes).digest('hex')\n\n/** every file under a skill folder, as paths relative to it */\nfunction filesUnder(dir: string, prefix = ''): string[] {\n const out: string[] = []\n for (const name of readdirSync(dir).sort()) {\n const abs = join(dir, name)\n if (statSync(abs).isDirectory()) out.push(...filesUnder(abs, `${prefix}${name}/`))\n else out.push(`${prefix}${name}`)\n }\n return out\n}\n\nfunction readRecord(path: string): SkillRecord | null {\n if (!existsSync(path)) return null\n let parsed: unknown\n try {\n parsed = JSON.parse(readFileSync(path, 'utf8'))\n } catch (e) {\n throw new Error(`${path} is not valid json (${e instanceof Error ? e.message : String(e)}): fix or delete it`, {\n cause: e,\n })\n }\n if (typeof parsed !== 'object' || parsed == null || !('files' in parsed)) {\n throw new Error(`${path} has no \"files\" map: fix or delete it`)\n }\n const files = parsed.files\n if (typeof files !== 'object' || files == null) throw new Error(`${path} has no \"files\" map: fix or delete it`)\n const out: Record<string, string> = {}\n for (const [k, v] of Object.entries(files)) if (typeof v === 'string') out[k] = v\n const version = 'version' in parsed && typeof parsed.version === 'string' ? parsed.version : ''\n return { version, files: out }\n}\n\nfunction packageVersion(pkgDir: string): string {\n const parsed: unknown = JSON.parse(readFileSync(join(pkgDir, 'package.json'), 'utf8'))\n if (typeof parsed === 'object' && parsed != null && 'version' in parsed && typeof parsed.version === 'string') {\n return parsed.version\n }\n throw new Error(`${join(pkgDir, 'package.json')} has no version`)\n}\n\n/**\n * plan, then write only when nothing conflicts (or `force`): a conflict anywhere writes nothing,\n * so a refused install never leaves half an update behind\n */\nexport function installSkills(p: { from: string; to: string; force: boolean; version: string }): SkillReport {\n const recordPath = join(p.to, SKILL_RECORD_FILE)\n const record = readRecord(recordPath)\n const source = new Map<string, Buffer>()\n const commands: string[] = []\n for (const skill of readdirSync(p.from).sort()) {\n if (!statSync(join(p.from, skill)).isDirectory()) continue\n commands.push(`/${SKILL_PREFIX}${skill}`)\n for (const f of filesUnder(join(p.from, skill))) {\n source.set(`${SKILL_PREFIX}${skill}/${f}`, readFileSync(join(p.from, skill, f)))\n }\n }\n\n const lines: SkillLine[] = []\n const writes: string[] = []\n const removals: string[] = []\n for (const [rel, bytes] of source) {\n const abs = join(p.to, rel)\n if (!existsSync(abs)) {\n lines.push({ action: 'created', file: abs })\n writes.push(rel)\n continue\n }\n const onDisk = readFileSync(abs)\n if (onDisk.equals(bytes)) lines.push({ action: 'unchanged', file: abs })\n else if (record?.files[rel] === sha256(onDisk)) {\n lines.push({ action: 'updated', file: abs })\n writes.push(rel)\n } else if (p.force) {\n lines.push({ action: 'overwritten', file: abs })\n writes.push(rel)\n } else lines.push({ action: 'conflict', file: abs })\n }\n for (const [rel, hash] of Object.entries(record?.files ?? {})) {\n const abs = join(p.to, rel)\n if (source.has(rel) || !existsSync(abs)) continue\n if (sha256(readFileSync(abs)) === hash) {\n lines.push({ action: 'removed', file: abs })\n removals.push(rel)\n } else lines.push({ action: 'kept', file: abs })\n }\n\n if (lines.some((l) => l.action === 'conflict')) return { ok: false, lines, commands }\n\n for (const rel of writes) {\n const abs = join(p.to, rel)\n mkdirSync(dirname(abs), { recursive: true })\n writeFileSync(abs, source.get(rel) ?? Buffer.alloc(0))\n }\n for (const rel of removals) {\n const abs = join(p.to, rel)\n rmSync(abs)\n // the skill folder goes too once it is empty, so no dead slash command stays listed\n const dir = dirname(abs)\n if (readdirSync(dir).length === 0) rmdirSync(dir)\n }\n const files: Record<string, string> = {}\n for (const [rel, bytes] of source) files[rel] = sha256(bytes)\n mkdirSync(p.to, { recursive: true })\n writeFileSync(recordPath, `${JSON.stringify({ version: p.version, files }, null, 3)}\\n`)\n return { ok: true, lines, commands }\n}\n\nconst MARK: Record<SkillAction, string> = {\n created: '+',\n unchanged: '=',\n updated: '~',\n overwritten: '!',\n removed: '-',\n kept: '?',\n conflict: '✗',\n}\n\nexport function runSkill(\n args: string[],\n p: { cwd?: string; env?: Record<string, string | undefined>; log?: (line: string) => void } = {},\n): number {\n const log = p.log ?? console.log\n const cwd = p.cwd ?? process.cwd()\n const env = p.env ?? process.env\n const sub = args[0]\n const rest = args.slice(1)\n if (sub == null || sub === 'help' || sub === '--help' || rest.includes('--help')) {\n log(SKILL_USAGE)\n return 0\n }\n if (sub !== 'install') throw new Error(`unknown skill command \"${sub}\"\\n${SKILL_USAGE}`)\n\n let user = false\n let force = false\n let dir: string | null = null\n for (let i = 0; i < rest.length; i++) {\n const a = rest[i]\n if (a === '--user') user = true\n else if (a === '--force') force = true\n else if (a === '--dir') {\n const v = rest[++i]\n if (v == null || v.startsWith('--')) throw new Error('--dir needs a value')\n dir = v\n } else throw new Error(`unknown argument \"${a}\"\\n${SKILL_USAGE}`)\n }\n if (user && dir != null) throw new Error('--user and --dir name two targets: pass one')\n\n const configDir = env.CLAUDE_CONFIG_DIR ?? join(env.HOME ?? homedir(), '.claude')\n const to = dir != null ? resolve(cwd, dir) : user ? join(configDir, 'skills') : join(cwd, '.claude', 'skills')\n const from = skillSourceDir()\n const version = packageVersion(dirname(dirname(from)))\n const show = (abs: string): string => {\n const rel = relative(cwd, abs)\n return rel.startsWith('..') ? abs : rel\n }\n\n const report = installSkills({ from, to, force, version })\n log(`[comfy-ts skill] comfy-ts ${version} skills → ${show(to)}`)\n for (const l of report.lines) log(` ${MARK[l.action]} ${l.action.padEnd(11)} ${show(l.file)}`)\n if (!report.ok) {\n const n = report.lines.filter((l) => l.action === 'conflict').length\n log(\n `[comfy-ts skill] 🔴 ${n} file(s) changed since comfy-ts wrote them (✗ above): nothing was written. Keep your edits, or rerun with --force to overwrite them`,\n )\n return 1\n }\n const kept = report.lines.filter((l) => l.action === 'kept').length\n if (kept > 0) log(`[comfy-ts skill] ${kept} file(s) no longer shipped were kept because you edited them (? above)`)\n log(`[comfy-ts skill] 🟢 Claude Code commands: ${report.commands.join(' ')}`)\n log(`[comfy-ts skill] a session started before this skills folder existed needs /reload-skills`)\n return 0\n}\n","#!/usr/bin/env node\n// sidekick CLI: `bunx comfy-ts <command>` — codegen without writing any code\nimport { armHopChild, hopToBun } from 'src/cli/bunHop.ts'\nimport { fileURLToPath } from 'node:url'\nimport { runGen } from 'src/cli/gen.ts'\nimport { runLoras } from 'src/cli/loras.ts'\nimport { runOutline } from 'src/cli/outline.ts'\nimport { runSkill } from 'src/cli/skill.ts'\n\nconst HELP = `comfy-ts — typed SDK codegen for ComfyUI\n\nUsage:\n comfy-ts gen --id <host-id> [--host http://127.0.0.1:8188] [--api-key <key>] [--out <sdk-path>]\n fetch object_info + embeddings from a live ComfyUI host and write\n .comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts}\n (--api-key or COMFY_CLOUD_API_KEY authenticates via X-API-Key;\n --out relocates ONLY the sdk.d.ts, e.g. a committed cloud catalog)\n\n comfy-ts outline [file] [--lines N] [--section Name]\n outline a generated sdk.d.ts (defaults to the first one in .comfy-ts/hosts/)\n\n comfy-ts loras [--id <host-id>] [--host http://…] [--api-key <key>]\n mirror what the optional ComfyUI-Lora-Manager extension knows about\n every lora into .comfy-ts/hosts/<id>/loras.json: real model names,\n civitai trigger words, tags, base model, preview urls. The TUI then\n fuzzy-matches loras by their human name and auto-injects their trigger\n words into v.prompt (⌃K still overrides, per lora). --id defaults to\n the only host folder on disk, --host to the url the last sync used\n\n comfy-ts tui [dir | workflow-module.ts]\n interactive tweak & re-run over **/*.cflow.ts modules (exporting\n host.defineWorkflow(...)); no arg scans cwd + the examples bundled\n with comfy-ts, an explicit dir/file limits to it (file preselected)\n\n comfy-ts serve [dir | workflow-module.ts] [--port 8288] [--host 127.0.0.1]\n drafts as a local HTTP generation API: POST /generate/<module>/<draft>\n with { ...vars } overriding the draft's values (blocking; raw image\n bytes under Accept: image/*), GET /drafts self-describes every var,\n GET /outputs/... serves the results. Open / in a browser for the web\n panel. No bundled examples, no auth, and any origin may call it: use\n --host beyond localhost only on a network you trust.\n\n comfy-ts run <name | module.cflow.ts> [--draft <name>] [--<var> <value>…] [--out <path>] [--json]\n ONE generation, headless, with live progress: the module is found in cwd,\n then in the examples bundled with comfy-ts, by its key (10-anima-t2i), its\n key without the number (anima-t2i) or a unique part (anima). Each var is a\n flag (--prompt \"…\" --seed 7 --image in.png), --<var>-file reads a text var\n from a file, --out writes the output there (several: a-1.png, a-2.png; a\n dir keeps the server's names). \\`comfy-ts run <name> --help\\` lists the vars,\n \\`comfy-ts run\\` lists the modules. --json prints one line with the paths\n\n comfy-ts skill install [--user | --dir <skills-dir>] [--force]\n copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd\n (--user: your personal skills folder): /comfy-ts-guide, -setup,\n -workflow, -convert, -run. A file you edited is never overwritten\n without --force. \\`comfy-ts skill --help\\` says more\n\n comfy-ts help\n`\n\nasync function main(): Promise<number> {\n const [cmd, ...rest] = process.argv.slice(2)\n if (cmd === 'gen') return runGen(rest)\n if (cmd === 'outline') return runOutline(rest)\n if (cmd === 'loras') return runLoras(rest)\n if (cmd === 'skill') return runSkill(rest)\n if (cmd === 'tui' || cmd === 'serve' || cmd === 'run') {\n // .cflow.ts workflow modules need bun: node refuses to strip types under\n // node_modules, exactly where the packaged examples live — and the bin's\n // node shebang means `bunx comfy-ts tui|serve` lands here under NODE. Hop\n // to bun when we are not already in it; without bun, degrade loudly.\n if (process.versions.bun == null) {\n const res = await hopToBun([fileURLToPath(import.meta.url), cmd, ...rest])\n if ('code' in res) return res.code\n console.error(\n `[comfy-ts ${cmd}] bun not found (${res.error.message}) — continuing under node: the examples packaged in node_modules cannot load here, and your own .cflow.ts modules rely on node's type stripping`,\n )\n }\n armHopChild()\n if (cmd === 'run') {\n const { runRun } = await import('src/cli/run/run-run.ts')\n return runRun(rest)\n }\n if (cmd === 'serve') {\n const { runServe } = await import('src/cli/serve/run-serve.ts')\n return runServe(rest)\n }\n // lazy import: keeps ink/react out of the codegen paths\n const { runTui } = await import('src/cli/tui/run-tui.tsx')\n return runTui(rest)\n }\n console.log(HELP)\n return cmd == null || cmd === 'help' ? 0 : 1\n}\n\n// a thrown command (a flag with no value, an unreadable path) must print ONE\n// clear line and exit non-zero, never a raw unhandled-rejection stack\nprocess.exitCode = await main().catch((e: unknown) => {\n console.error(`[comfy-ts] 🔴 ${e instanceof Error ? e.message : String(e)}`)\n return 1\n})\n"],"mappings":";;;;;;;;;;AAOA,MAAM,iBAAiB;AACvB,MAAM,YAA8B;CAAC;CAAU;CAAW;AAAQ;;;AAIlE,SAAgB,SAAS,MAA8D;CACpF,OAAO,IAAI,SAAS,YAAY;EAC7B,MAAM,QAAQ,MAAM,OAAO,MAAM;GAC9B,OAAO;GACP,KAAK;IAAE,GAAG,QAAQ;KAAM,iBAAiB,OAAO,QAAQ,GAAG;GAAE;EAChE,CAAC;EACD,MAAM,WAAW,WAAiC;GAC/C,MAAM,KAAK,MAAM;EACpB;EACA,KAAK,MAAM,UAAU,WAAW,QAAQ,GAAG,QAAQ,OAAO;EAC1D,MAAM,QAAQ,MAAiD;GAC5D,KAAK,MAAM,UAAU,WAAW,QAAQ,IAAI,QAAQ,OAAO;GAC3D,QAAQ,CAAC;EACZ;EACA,MAAM,KAAK,UAAU,UAAU,KAAK,EAAE,MAAM,CAAC,CAAC;EAC9C,MAAM,KAAK,SAAS,MAAM,WAAW;GAClC,IAAI,QAAQ,MAAM,OAAO,KAAK,EAAE,KAAK,CAAC;GACtC,KAAK,EAAE,MAAM,UAAU,OAAO,IAAI,OAAO,UAAU,QAAQ,WAAW,GAAG,CAAC;EAC7E,CAAC;CAC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