comfy-ts 2.18.1 → 2.20.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.
Files changed (65) hide show
  1. package/README.md +147 -97
  2. package/claude-code/.claude-plugin/plugin.json +9 -0
  3. package/claude-code/skills/convert/SKILL.md +25 -0
  4. package/claude-code/skills/guide/SKILL.md +21 -0
  5. package/claude-code/skills/run/SKILL.md +12 -0
  6. package/claude-code/skills/setup/SKILL.md +15 -0
  7. package/claude-code/skills/workflow/SKILL.md +19 -0
  8. package/dist/{ServeApp-qXcQfdgT.js → ServeApp-B469W26E.js} +5 -5
  9. package/dist/{ServeApp-qXcQfdgT.js.map → ServeApp-B469W26E.js.map} +1 -1
  10. package/dist/cli.js +228 -11
  11. package/dist/cli.js.map +1 -1
  12. package/dist/{state-C067Kbew.js → exampleAssets-j1f26nGc.js} +177 -56
  13. package/dist/{state-C067Kbew.js.map → exampleAssets-j1f26nGc.js.map} +1 -1
  14. package/dist/{findDefinedWorkflow-0lG-VTEd.js → findDefinedWorkflow-B90-xFxX.js} +2 -2
  15. package/dist/{findDefinedWorkflow-0lG-VTEd.js.map → findDefinedWorkflow-B90-xFxX.js.map} +1 -1
  16. package/dist/index.cjs +92 -10
  17. package/dist/index.cjs.map +1 -1
  18. package/dist/index.d.cts +12 -2
  19. package/dist/index.d.ts +12 -2
  20. package/dist/index.js +92 -10
  21. package/dist/index.js.map +1 -1
  22. package/dist/{run-run-Zr699h2S.js → run-run-QEoh7Wbh.js} +5 -6
  23. package/dist/{run-run-Zr699h2S.js.map → run-run-QEoh7Wbh.js.map} +1 -1
  24. package/dist/{run-serve-DaXzoVTS.js → run-serve-CsEYPGm9.js} +4 -4
  25. package/dist/{run-serve-DaXzoVTS.js.map → run-serve-CsEYPGm9.js.map} +1 -1
  26. package/dist/{run-tui-CeM1GOJP.js → run-tui-YxiSoNvK.js} +9 -15
  27. package/dist/run-tui-YxiSoNvK.js.map +1 -0
  28. package/dist/{schemaDrift-CbsABBuk.js → schemaDrift-DaWsE-mt.js} +15 -15
  29. package/dist/{schemaDrift-CbsABBuk.js.map → schemaDrift-DaWsE-mt.js.map} +1 -1
  30. package/dist/web.d.ts +30 -20
  31. package/dist/web.js +83 -6
  32. package/dist/web.js.map +1 -1
  33. package/examples/README.md +17 -11
  34. package/examples/rvion/01-txt2img.cflow.ts +1 -1
  35. package/examples/rvion/02-img2img-upload.cflow.ts +1 -1
  36. package/examples/rvion/03-export-workflow-json.cflow.ts +1 -1
  37. package/examples/rvion/04-krea2-turbo-t2i.cflow.ts +1 -1
  38. package/examples/rvion/06-qwen-image-edit.cflow.ts +1 -1
  39. package/examples/rvion/07-local-llm-text-gen.cflow.ts +1 -1
  40. package/examples/rvion/08-qwen-image-21-t2i.cflow.ts +1 -1
  41. package/examples/rvion/09-qwen-image-21-edit.cflow.ts +1 -1
  42. package/examples/rvion/10-anima-t2i.cflow.ts +1 -1
  43. package/examples/rvion/11-yue2-t2a.cflow.ts +1 -1
  44. package/examples/rvion/12-stable-audio-3-t2a.cflow.ts +1 -1
  45. package/examples/rvion/13-ace-step-15-xl-t2a.cflow.ts +1 -1
  46. package/examples/rvion/14-video-soundtrack.cflow.ts +1 -1
  47. package/examples/rvion/15-tts-voice-clone.cflow.ts +1 -1
  48. package/examples/rvion/16-tts-voice-design.cflow.ts +1 -1
  49. package/guide-for-agents.md +8 -5
  50. package/package.json +8 -7
  51. package/src/cli/comfy-ts-cli.ts +12 -2
  52. package/src/cli/gen.ts +6 -1
  53. package/src/cli/serve/ServeApp.ts +4 -4
  54. package/src/cli/serve/web/api.ts +1 -1
  55. package/src/cli/skill.ts +207 -0
  56. package/src/cli/tui/components/Header.tsx +1 -4
  57. package/src/cli/tui/components/HostPanel.tsx +1 -4
  58. package/src/cli/tui/state/HostSt.ts +2 -2
  59. package/src/exampleAssets.ts +10 -4
  60. package/src/host/ComfyHost.ts +35 -5
  61. package/src/host/hostFile.ts +57 -0
  62. package/src/state.ts +15 -9
  63. package/dist/exampleAssets-BfWzygoM.js +0 -38
  64. package/dist/exampleAssets-BfWzygoM.js.map +0 -1
  65. package/dist/run-tui-CeM1GOJP.js.map +0 -1
package/dist/cli.js CHANGED
@@ -1,11 +1,12 @@
1
1
  #!/usr/bin/env node
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 ComfySchema, r as readableStringify, t as ComfyTS } from "./state-C067Kbew.js";
2
+ import { a as readableStringify, c as writeHostFile, l as renderHttpBase, n as comfyTsPackageDir, r as ComfyTS, s as ComfySchema } from "./exampleAssets-j1f26nGc.js";
3
+ import { D as readLoraMirror, F as fetchLoraList, H as lmModelName, K as lmTrainedWords, _ as buildLoraMirror, j as writeLoraMirror } from "./schemaDrift-DaWsE-mt.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 = [
@@ -95,10 +96,12 @@ async function runGen(args) {
95
96
  };
96
97
  const spec = await fetchJSON("/object_info");
97
98
  const embeddings = await fetchJSON("/embeddings").catch(() => []);
98
- const dir = join(process.cwd(), ".comfy-ts", "hosts", id);
99
+ const dir = host.cacheFolder;
99
100
  mkdirSync(dir, { recursive: true });
100
101
  writeFileSync(join(dir, "object_info.json"), readableStringify(spec, 4), "utf8");
101
102
  writeFileSync(join(dir, "embeddings.json"), JSON.stringify(embeddings), "utf8");
103
+ const hostFile = writeHostFile(comfy.storage, dir, { url: renderHttpBase(host.base) });
104
+ console.log(`[comfy-ts gen] 🟢 ${hostFile}: comfy.host({ id: '${id}' }) now finds this host`);
102
105
  const parsed = new ComfySchema({
103
106
  spec,
104
107
  embeddings
@@ -275,14 +278,221 @@ function runOutline(args) {
275
278
  return 0;
276
279
  }
277
280
  //#endregion
281
+ //#region src/cli/skill.ts
282
+ const SKILL_PREFIX = "comfy-ts-";
283
+ const SKILL_RECORD_FILE = ".comfy-ts-skills.json";
284
+ const SKILL_USAGE = `comfy-ts skill install [--user | --dir <skills-dir>] [--force]
285
+ copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd (--user: your personal
286
+ skills folder, --dir: that folder): /comfy-ts-guide, /comfy-ts-setup, /comfy-ts-workflow,
287
+ /comfy-ts-convert, /comfy-ts-run. A rerun updates what it wrote; a file you edited is never
288
+ overwritten without --force. The same skills ship as a Claude Code plugin:
289
+ /plugin marketplace add rvion/comfy-ts, then /plugin install comfy-ts@comfy-ts`;
290
+ /** claude-code/skills/ of the installed package, resolved from this module, never from the cwd */
291
+ function skillSourceDir() {
292
+ const pkgDir = comfyTsPackageDir(import.meta.url);
293
+ if (pkgDir == null) throw new Error("cannot find the comfy-ts package this command runs from");
294
+ const dir = join(pkgDir, "claude-code", "skills");
295
+ if (!existsSync(dir)) throw new Error(`the comfy-ts package has no skills folder at ${dir}`);
296
+ return dir;
297
+ }
298
+ const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
299
+ /** every file under a skill folder, as paths relative to it */
300
+ function filesUnder(dir, prefix = "") {
301
+ const out = [];
302
+ for (const name of readdirSync(dir).sort()) {
303
+ const abs = join(dir, name);
304
+ if (statSync(abs).isDirectory()) out.push(...filesUnder(abs, `${prefix}${name}/`));
305
+ else out.push(`${prefix}${name}`);
306
+ }
307
+ return out;
308
+ }
309
+ function readRecord(path) {
310
+ if (!existsSync(path)) return null;
311
+ let parsed;
312
+ try {
313
+ parsed = JSON.parse(readFileSync(path, "utf8"));
314
+ } catch (e) {
315
+ throw new Error(`${path} is not valid json (${e instanceof Error ? e.message : String(e)}): fix or delete it`, { cause: e });
316
+ }
317
+ if (typeof parsed !== "object" || parsed == null || !("files" in parsed)) throw new Error(`${path} has no "files" map: fix or delete it`);
318
+ const files = parsed.files;
319
+ if (typeof files !== "object" || files == null) throw new Error(`${path} has no "files" map: fix or delete it`);
320
+ const out = {};
321
+ for (const [k, v] of Object.entries(files)) if (typeof v === "string") out[k] = v;
322
+ return {
323
+ version: "version" in parsed && typeof parsed.version === "string" ? parsed.version : "",
324
+ files: out
325
+ };
326
+ }
327
+ function packageVersion(pkgDir) {
328
+ const parsed = JSON.parse(readFileSync(join(pkgDir, "package.json"), "utf8"));
329
+ if (typeof parsed === "object" && parsed != null && "version" in parsed && typeof parsed.version === "string") return parsed.version;
330
+ throw new Error(`${join(pkgDir, "package.json")} has no version`);
331
+ }
332
+ /**
333
+ * plan, then write only when nothing conflicts (or `force`): a conflict anywhere writes nothing,
334
+ * so a refused install never leaves half an update behind
335
+ */
336
+ function installSkills(p) {
337
+ const recordPath = join(p.to, SKILL_RECORD_FILE);
338
+ const record = readRecord(recordPath);
339
+ const source = /* @__PURE__ */ new Map();
340
+ const commands = [];
341
+ for (const skill of readdirSync(p.from).sort()) {
342
+ if (!statSync(join(p.from, skill)).isDirectory()) continue;
343
+ commands.push(`/${SKILL_PREFIX}${skill}`);
344
+ for (const f of filesUnder(join(p.from, skill))) source.set(`${SKILL_PREFIX}${skill}/${f}`, readFileSync(join(p.from, skill, f)));
345
+ }
346
+ const lines = [];
347
+ const writes = [];
348
+ const removals = [];
349
+ for (const [rel, bytes] of source) {
350
+ const abs = join(p.to, rel);
351
+ if (!existsSync(abs)) {
352
+ lines.push({
353
+ action: "created",
354
+ file: abs
355
+ });
356
+ writes.push(rel);
357
+ continue;
358
+ }
359
+ const onDisk = readFileSync(abs);
360
+ if (onDisk.equals(bytes)) lines.push({
361
+ action: "unchanged",
362
+ file: abs
363
+ });
364
+ else if (record?.files[rel] === sha256(onDisk)) {
365
+ lines.push({
366
+ action: "updated",
367
+ file: abs
368
+ });
369
+ writes.push(rel);
370
+ } else if (p.force) {
371
+ lines.push({
372
+ action: "overwritten",
373
+ file: abs
374
+ });
375
+ writes.push(rel);
376
+ } else lines.push({
377
+ action: "conflict",
378
+ file: abs
379
+ });
380
+ }
381
+ for (const [rel, hash] of Object.entries(record?.files ?? {})) {
382
+ const abs = join(p.to, rel);
383
+ if (source.has(rel) || !existsSync(abs)) continue;
384
+ if (sha256(readFileSync(abs)) === hash) {
385
+ lines.push({
386
+ action: "removed",
387
+ file: abs
388
+ });
389
+ removals.push(rel);
390
+ } else lines.push({
391
+ action: "kept",
392
+ file: abs
393
+ });
394
+ }
395
+ if (lines.some((l) => l.action === "conflict")) return {
396
+ ok: false,
397
+ lines,
398
+ commands
399
+ };
400
+ for (const rel of writes) {
401
+ const abs = join(p.to, rel);
402
+ mkdirSync(dirname(abs), { recursive: true });
403
+ writeFileSync(abs, source.get(rel) ?? Buffer.alloc(0));
404
+ }
405
+ for (const rel of removals) {
406
+ const abs = join(p.to, rel);
407
+ rmSync(abs);
408
+ const dir = dirname(abs);
409
+ if (readdirSync(dir).length === 0) rmdirSync(dir);
410
+ }
411
+ const files = {};
412
+ for (const [rel, bytes] of source) files[rel] = sha256(bytes);
413
+ mkdirSync(p.to, { recursive: true });
414
+ writeFileSync(recordPath, `${JSON.stringify({
415
+ version: p.version,
416
+ files
417
+ }, null, 3)}\n`);
418
+ return {
419
+ ok: true,
420
+ lines,
421
+ commands
422
+ };
423
+ }
424
+ const MARK = {
425
+ created: "+",
426
+ unchanged: "=",
427
+ updated: "~",
428
+ overwritten: "!",
429
+ removed: "-",
430
+ kept: "?",
431
+ conflict: "✗"
432
+ };
433
+ function runSkill(args, p = {}) {
434
+ const log = p.log ?? console.log;
435
+ const cwd = p.cwd ?? process.cwd();
436
+ const env = p.env ?? process.env;
437
+ const sub = args[0];
438
+ const rest = args.slice(1);
439
+ if (sub == null || sub === "help" || sub === "--help" || rest.includes("--help")) {
440
+ log(SKILL_USAGE);
441
+ return 0;
442
+ }
443
+ if (sub !== "install") throw new Error(`unknown skill command "${sub}"\n${SKILL_USAGE}`);
444
+ let user = false;
445
+ let force = false;
446
+ let dir = null;
447
+ for (let i = 0; i < rest.length; i++) {
448
+ const a = rest[i];
449
+ if (a === "--user") user = true;
450
+ else if (a === "--force") force = true;
451
+ else if (a === "--dir") {
452
+ const v = rest[++i];
453
+ if (v == null || v.startsWith("--")) throw new Error("--dir needs a value");
454
+ dir = v;
455
+ } else throw new Error(`unknown argument "${a}"\n${SKILL_USAGE}`);
456
+ }
457
+ if (user && dir != null) throw new Error("--user and --dir name two targets: pass one");
458
+ const configDir = env.CLAUDE_CONFIG_DIR ?? join(env.HOME ?? homedir(), ".claude");
459
+ const to = dir != null ? resolve(cwd, dir) : user ? join(configDir, "skills") : join(cwd, ".claude", "skills");
460
+ const from = skillSourceDir();
461
+ const version = packageVersion(dirname(dirname(from)));
462
+ const show = (abs) => {
463
+ const rel = relative(cwd, abs);
464
+ return rel.startsWith("..") ? abs : rel;
465
+ };
466
+ const report = installSkills({
467
+ from,
468
+ to,
469
+ force,
470
+ version
471
+ });
472
+ log(`[comfy-ts skill] comfy-ts ${version} skills → ${show(to)}`);
473
+ for (const l of report.lines) log(` ${MARK[l.action]} ${l.action.padEnd(11)} ${show(l.file)}`);
474
+ if (!report.ok) {
475
+ const n = report.lines.filter((l) => l.action === "conflict").length;
476
+ 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`);
477
+ return 1;
478
+ }
479
+ const kept = report.lines.filter((l) => l.action === "kept").length;
480
+ if (kept > 0) log(`[comfy-ts skill] ${kept} file(s) no longer shipped were kept because you edited them (? above)`);
481
+ log(`[comfy-ts skill] 🟢 Claude Code commands: ${report.commands.join(" ")}`);
482
+ log(`[comfy-ts skill] a session started before this skills folder existed needs /reload-skills`);
483
+ return 0;
484
+ }
485
+ //#endregion
278
486
  //#region src/cli/comfy-ts-cli.ts
279
487
  const HELP = `comfy-ts — typed SDK codegen for ComfyUI
280
488
 
281
489
  Usage:
282
490
  comfy-ts gen --id <host-id> [--host http://127.0.0.1:8188] [--api-key <key>] [--out <sdk-path>]
283
491
  fetch object_info + embeddings from a live ComfyUI host and write
284
- .comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts}
285
- (--api-key or COMFY_CLOUD_API_KEY authenticates via X-API-Key;
492
+ .comfy-ts/hosts/<host-id>/{object_info.json,embeddings.json,sdk.d.ts,host.json}
493
+ (host.json saves the address: code then names the host by id alone,
494
+ comfy.host({ id: '<host-id>' }); the api key is never written;
495
+ --api-key or COMFY_CLOUD_API_KEY authenticates via X-API-Key;
286
496
  --out relocates ONLY the sdk.d.ts, e.g. a committed cloud catalog)
287
497
 
288
498
  comfy-ts outline [file] [--lines N] [--section Name]
@@ -318,6 +528,12 @@ Usage:
318
528
  dir keeps the server's names). \`comfy-ts run <name> --help\` lists the vars,
319
529
  \`comfy-ts run\` lists the modules. --json prints one line with the paths
320
530
 
531
+ comfy-ts skill install [--user | --dir <skills-dir>] [--force]
532
+ copy the comfy-ts Claude Code skills into .claude/skills/ of the cwd
533
+ (--user: your personal skills folder): /comfy-ts-guide, -setup,
534
+ -workflow, -convert, -run. A file you edited is never overwritten
535
+ without --force. \`comfy-ts skill --help\` says more
536
+
321
537
  comfy-ts help
322
538
  `;
323
539
  async function main() {
@@ -325,6 +541,7 @@ async function main() {
325
541
  if (cmd === "gen") return runGen(rest);
326
542
  if (cmd === "outline") return runOutline(rest);
327
543
  if (cmd === "loras") return runLoras(rest);
544
+ if (cmd === "skill") return runSkill(rest);
328
545
  if (cmd === "tui" || cmd === "serve" || cmd === "run") {
329
546
  if (process.versions.bun == null) {
330
547
  const res = await hopToBun([
@@ -337,14 +554,14 @@ async function main() {
337
554
  }
338
555
  armHopChild();
339
556
  if (cmd === "run") {
340
- const { runRun } = await import("./run-run-Zr699h2S.js");
557
+ const { runRun } = await import("./run-run-QEoh7Wbh.js");
341
558
  return runRun(rest);
342
559
  }
343
560
  if (cmd === "serve") {
344
- const { runServe } = await import("./run-serve-DaXzoVTS.js");
561
+ const { runServe } = await import("./run-serve-CsEYPGm9.js");
345
562
  return runServe(rest);
346
563
  }
347
- const { runTui } = await import("./run-tui-CeM1GOJP.js");
564
+ const { runTui } = await import("./run-tui-YxiSoNvK.js");
348
565
  return runTui(rest);
349
566
  }
350
567
  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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C/B,MAAM,MAAM,MAAM,SAAS;IAAC,cAAc,OAAO,KAAK,GAAG;IAAG;IAAK,GAAG;GAAI,CAAC;GACzE,IAAI,UAAU,KAAK,OAAO,IAAI;GAC9B,QAAQ,MACL,aAAa,IAAI,mBAAmB,IAAI,MAAM,QAAQ,gJACzD;EACH;EACA,YAAY;EACZ,IAAI,QAAQ,OAAO;GAChB,MAAM,EAAE,WAAW,MAAM,OAAO;GAChC,OAAO,OAAO,IAAI;EACrB;EACA,IAAI,QAAQ,SAAS;GAClB,MAAM,EAAE,aAAa,MAAM,OAAO;GAClC,OAAO,SAAS,IAAI;EACvB;EAEA,MAAM,EAAE,WAAW,MAAM,OAAO;EAChC,OAAO,OAAO,IAAI;CACrB;CACA,QAAQ,IAAI,IAAI;CAChB,OAAO,OAAO,QAAQ,QAAQ,SAAS,IAAI;AAC9C;AAIA,QAAQ,WAAW,MAAM,KAAK,CAAC,CAAC,OAAO,MAAe;CACnD,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 { writeHostFile } from 'src/host/hostFile.ts'\nimport { renderHttpBase } from 'src/host/hostUrl.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 = host.cacheFolder\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 // the address, so code names this host by id alone: comfy.host({ id })\n const hostFile = writeHostFile(comfy.storage, dir, { url: renderHttpBase(host.base) })\n console.log(`[comfy-ts gen] 🟢 ${hostFile}: comfy.host({ id: '${id}' }) now finds this host`)\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,host.json}\n (host.json saves the address: code then names the host by id alone,\n comfy.host({ id: '<host-id>' }); the api key is never written;\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.exit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