@animastor/installer 0.2.14 → 0.2.15

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 CHANGED
@@ -14,7 +14,7 @@ published to npm as `@animastor/installer`.
14
14
 
15
15
  ```
16
16
  packages/animastor-installer/
17
- ├── package.json @animastor/installer 0.2.14, Node >=20, zero runtime deps
17
+ ├── package.json @animastor/installer 0.2.15, Node >=20, zero runtime deps
18
18
  ├── src/installer/
19
19
  │ ├── cli.js CLI entry (detect/plan/install/verify/resume/uninstall)
20
20
  │ ├── index.js Public API entry (10 exports, incl. setupContract)
@@ -222,6 +222,19 @@ is logged with name, size and outcome (`downloaded`, `present, verified sha256
222
222
  — skipped`, `failed: <reason>`). `install`, `doctor` and `resume` append their
223
223
  log to `~/animastor/logs/bootstrap.log`, not only `animastor boot`.
224
224
 
225
+ Custom node updates (0.2.15): a node the installer itself copied from a
226
+ repository subdirectory (marker `.animastor-source.json`, e.g.
227
+ `animastor-voice-ref`) whose commit differs from the manifest pin is updated
228
+ automatically, also in mode `existing` — no question: the pinned copy is staged
229
+ in `<ComfyUI>/.animastor-node-sources/<dir>.new`, the old copy moves to
230
+ `<dir>.prev` (backup of the last update), a failed swap puts the old copy back.
231
+ The plan lists it under Actions (`Update <node>: <old> → <new>`). ComfyUI loads
232
+ the new code only on a restart: a managed ComfyUI is restarted; the platform's
233
+ ComfyUI is restarted when that restart is allowed (`--restart-platform-comfy`
234
+ or the recorded answer), otherwise the result says the old code still runs. A
235
+ git checkout (a user's or third-party node) at another commit stays a review
236
+ item and is never replaced.
237
+
225
238
  ## Manifest resolution (MANIFEST_ROOT contract)
226
239
 
227
240
  1. `/app/artifacts/install-manifests` (baked container layout)
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "manifest_version": "1.0.0",
3
- "revision": "2026.11.12-r1",
3
+ "revision": "2026.12.05-r1",
4
4
  "status": "ready",
5
5
  "profile": {
6
6
  "id": "audio/qwen-tts",
@@ -30,7 +30,7 @@
30
30
  "gpu_min_vram_gb": 8,
31
31
  "basis": "minimum_supported",
32
32
  "reference_gpu": "NVIDIA L40S (46068 MiB)",
33
- "derivation": "Estimate, not a measured floor (VOICE_REFERENCES.md): every workflow now loads ONE 1.7B repo — narrator/dialogue the Base model only (voice clone from a locked reference), voice-reference the VoiceDesign model only (3.57 GiB weights + 0.65 GiB speech tokenizer ≈ 4.2 GiB) plus faster-whisper small (≈ 0.5 GiB fp16) and activations; 8 GB leaves headroom. Was 12 GB while the dialogue workflow loaded VoiceDesign + Base together. Known to run on L40S 46 GB; installed on Tesla V100 (E2E, 2026-10-30). Lower it only after a measured run on a smaller card."
33
+ "derivation": "Estimate, not a measured floor (VOICE_REFERENCES.md): every workflow now loads ONE 1.7B repo — narrator/dialogue the Base model only (voice clone from a locked reference), voice-reference the VoiceDesign model only (3.57 GiB weights + 0.65 GiB speech tokenizer ≈ 4.2 GiB) and activations; faster-whisper small runs on the CPU since node 1.1.0 (no VRAM); 8 GB leaves headroom. Was 12 GB while the dialogue workflow loaded VoiceDesign + Base together. Known to run on L40S 46 GB; installed on Tesla V100 (E2E, 2026-10-30). Lower it only after a measured run on a smaller card."
34
34
  },
35
35
  "runtime_requirements": {
36
36
  "comfyui": {
@@ -263,7 +263,7 @@
263
263
  "source": {
264
264
  "kind": "github",
265
265
  "repository": "https://github.com/Animastor/animastor-worker",
266
- "commit": "6a88ad960e47df9fa6e76e4cce5308d9590297c3",
266
+ "commit": "3e8faab16ca8168065e6b85e17ad49f7fdaf2638",
267
267
  "subdirectory": "comfyui-nodes/animastor-voice-ref",
268
268
  "verification": "confirmed"
269
269
  }
@@ -284,7 +284,8 @@
284
284
  },
285
285
  "notes": [
286
286
  "Needs the ffmpeg binary on PATH (normalisation to WAV pcm_s16le mono 24 kHz).",
287
- "faster-whisper device=auto: CUDA float16, else CPU int8 (recorded in the candidate metadata). The ctranslate2 4.6.0 CUDA path on a V100 (sm_70) is NOT verified yet — live check step in reports/2026-11-12/voice-references.md.",
287
+ "Node 1.1.0 (animastor-worker 3e8faab): faster-whisper runs on the CPU (int8) by default — the CUDA path of ctranslate2 4.6.0 crashed the whole ComfyUI natively on a Tesla V100 (sm_70, 05.12.2026); CPU int8: 11 s of audio in ~2 s. GPU only via ANIMASTOR_WHISPER_DEVICE=cuda|auto in the ComfyUI environment. The candidate metadata records whisper_device / compute_type.",
288
+ "An installed copy at an older commit (marker .animastor-source.json) is updated to this pin by installer >= 0.2.15 automatically (old copy kept in .animastor-node-sources/animastor-voice-ref.prev); the platform's ComfyUI is restarted to load the new code when that restart is allowed.",
288
289
  "Installed from a SUBDIRECTORY of the repository (install.source.subdirectory); the installer writes .animastor-source.json (repository + commit) into the node folder so the pinned version stays verifiable."
289
290
  ]
290
291
  },
@@ -665,7 +666,8 @@
665
666
  "Open question 8: ComfyUI-Manager inclusion (D7)",
666
667
  "Open question 12: minimum VRAM is an estimate (12 GB, hardware.derivation) — measure on a smaller card",
667
668
  "VOICE_REFERENCES: confirm LoadAudio (core) on the reference fork c4cfee7 via /object_info",
668
- "VOICE_REFERENCES: ctranslate2 4.6.0 CUDA path on Tesla V100 (sm_70) — measure; CPU int8 fallback is automatic",
669
+ "VOICE_REFERENCES: ctranslate2 4.6.0 CUDA path on Tesla V100 (sm_70) crashes ComfyUI natively (05.12.2026) — faster-whisper is on the CPU by default since node 1.1.0; the GPU path stays opt-in (ANIMASTOR_WHISPER_DEVICE)",
670
+ "Qwen3-TTS is loaded in bf16; a Tesla V100 (sm_70) has no native bf16 — evaluate fp16 on V100 (separate task)",
669
671
  "VOICE_REFERENCES: qwen-tts pip version on the worker (`pip show qwen-tts`)"
670
672
  ]
671
673
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@animastor/installer",
3
- "version": "0.2.14",
3
+ "version": "0.2.15",
4
4
  "description": "Animastor Private GPU Worker installer — self-contained CLI and library for GPU worker setup, verification, and management.",
5
5
  "main": "src/installer/index.js",
6
6
  "exports": {
@@ -619,6 +619,7 @@ async function platformNodeDepsGate(io, {
619
619
  instance, state = null, root, manifests, flags = {}, boot = false, yes = false, prompt = null,
620
620
  waitMs = 600000, logger = null, statePath = null, sleep = null, intervalMs = 3000, progressMs = 30000,
621
621
  workerDir = null, platformGraceMs = 30000, otherManifests = [], command = 'doctor',
622
+ codeChanged = [],
622
623
  } = {}) {
623
624
  const out = {
624
625
  instance, checked: false, installed: [], restarted: false, pid_changed: false, failed: false, reason: null, record: {},
@@ -654,6 +655,7 @@ async function platformNodeDepsGate(io, {
654
655
  out.checked = true;
655
656
  for (const e of check.errors) warn(`custom-node dependency check: ${e}`);
656
657
  let needRestart = !!(out.prestartup && (out.prestartup.status === 'created' || out.prestartup.status === 'updated'));
658
+ if (Array.isArray(codeChanged) && codeChanged.length > 0) needRestart = true; // 0.2.15: updated node code
657
659
  let snapshotOf = null;
658
660
  const dropSnap = () => { if (snapshotOf) overridesMod.dropSnapshot(io, snapshotOf); snapshotOf = null; };
659
661
  if (check.nodes.length === 0) {
@@ -793,7 +795,10 @@ async function platformNodeDepsGate(io, {
793
795
  const have = instance.url ? await comfyuiMod.objectInfoClasses(io, instance.url) : null;
794
796
  if (!have && !needRestart) return out; // not answering — the platform gate/verification reports it
795
797
  const missingNow = have ? expectClasses.filter((c) => !have.has(c)) : expectClasses;
796
- if (missingNow.length === 0) {
798
+ // 0.2.15: an updated node keeps its classes, but the running process still
799
+ // has the OLD code — it is loaded only by a restart
800
+ const codeUpdated = Array.isArray(codeChanged) && codeChanged.length > 0;
801
+ if (missingNow.length === 0 && !codeUpdated) {
797
802
  if (needRestart) info(`the running ComfyUI (pid ${instance.pid}) already has the node classes — no restart needed`);
798
803
  return out;
799
804
  }
@@ -813,19 +818,25 @@ async function platformNodeDepsGate(io, {
813
818
  info(`node classes missing in the running ComfyUI (pid ${instance.pid}): ${missingNow.join(', ')} — ${diag.detail}`);
814
819
  }
815
820
  if (restartAllowed === null && interactive) {
816
- restartAllowed = await prompt.confirm(`The running ComfyUI (pid ${instance.pid}) loaded the custom nodes before their dependencies were in place. Restart it now (same command line, working directory and environment)?`, { defaultYes: true });
821
+ const why = missingNow.length === 0
822
+ ? `runs the old code of the updated custom node(s) ${codeChanged.join(', ')}`
823
+ : 'loaded the custom nodes before their dependencies were in place';
824
+ restartAllowed = await prompt.confirm(`The running ComfyUI (pid ${instance.pid}) ${why}. Restart it now (same command line, working directory and environment)?`, { defaultYes: true });
817
825
  out.record.restartPlatformComfy = restartAllowed;
818
826
  }
819
827
  if (restartAllowed !== true) {
820
828
  // A ComfyUI that is not ours is never stopped without the option.
821
829
  out.failed = true;
822
- out.reason = `custom-node dependencies are in place, but the platform's ComfyUI (pid ${instance.pid}) imported the nodes before that and was not restarted (restart of the platform's ComfyUI is off): ${missingNow.join(', ')} missing`;
830
+ out.reason = missingNow.length === 0
831
+ ? `custom node(s) ${codeChanged.join(', ')} updated on disk, but the platform's ComfyUI (pid ${instance.pid}) still runs the old code and was not restarted (restart of the platform's ComfyUI is off)`
832
+ : `custom-node dependencies are in place, but the platform's ComfyUI (pid ${instance.pid}) imported the nodes before that and was not restarted (restart of the platform's ComfyUI is off): ${missingNow.join(', ')} missing`;
823
833
  out.fix = `restart the ComfyUI from the platform console, or run: ${tool} doctor --restart-platform-comfy`;
824
834
  return out;
825
835
  }
836
+ if (codeUpdated) info(`custom node(s) updated: ${codeChanged.join(', ')} — restarting the platform's ComfyUI (pid ${instance.pid}) so it loads the new code`);
826
837
  const restartLog = workerDir ? path.join(path.dirname(path.resolve(workerDir)), 'logs', 'comfyui-restart.log') : null;
827
838
  const rr = await nodeDeps.restartForeignComfyUI(io, {
828
- pid: instance.pid, timeoutMs: waitMs, intervalMs, expectClasses: missingNow, sleep, log: logger, onProgress: info, progressMs,
839
+ pid: instance.pid, timeoutMs: waitMs, intervalMs, expectClasses: missingNow.length > 0 ? missingNow : expectClasses, sleep, log: logger, onProgress: info, progressMs,
829
840
  platformGraceMs, logFile: restartLog,
830
841
  });
831
842
  out.restarted = rr.stopped;
@@ -1617,8 +1628,9 @@ async function cmdInstall(flags, { doctor = false } = {}) {
1617
1628
  ? () => prompt.secret('The Worker Key is revoked or wrong. Paste a new Worker Key from Animastor → Settings → Workers (hidden input, Enter = skip)')
1618
1629
  : null,
1619
1630
  // 0.2.13: the node-deps gate again, for nodes installed by this run
1620
- platformNodeDeps: async (current) => {
1631
+ platformNodeDeps: async (current, extra = {}) => {
1621
1632
  const g = await platformNodeDepsGate(realIo, {
1633
+ codeChanged: extra.codeChanged || [],
1622
1634
  instance: current, state: stateStore.loadState(realIo, statePath), root, manifests: loadedManifests, flags, boot, yes, prompt,
1623
1635
  waitMs: Math.max(180000, comfyWaitMs), logger, statePath, workerDir,
1624
1636
  otherManifests: otherProfileManifests(priorState, flags.profiles, { logger }), command: doctor ? 'doctor' : 'install',
@@ -56,7 +56,10 @@ const ENTRY_STATUSES = Object.freeze([
56
56
  'required', 'installed', 'missing', 'incompatible', 'unused', 'unknown',
57
57
  ]);
58
58
 
59
- const ACTIONS = Object.freeze(['install', 'skip', 'review', 'none', 'configure']);
59
+ // 'update' (0.2.15): an installer-copied custom node (subdirectory source with
60
+ // .animastor-source.json) whose commit differs from the manifest pin — replaced
61
+ // by the pinned copy automatically (never a user's git checkout).
62
+ const ACTIONS = Object.freeze(['install', 'skip', 'review', 'none', 'configure', 'update']);
60
63
 
61
64
  const SHARING_VERDICTS = Object.freeze([
62
65
  'shared-compatible', 'shared-conflict', 'requires-isolation', 'unknown',
@@ -464,6 +467,10 @@ function checkCustomNode(dep, env, profiles) {
464
467
  if (shaMatch(wantCommit, haveCommit)) {
465
468
  return { ...base, status: 'installed', grade: 'canonical-version', action: 'skip', found: describeNodeFound(found), notes };
466
469
  }
470
+ if (isInstallerCopiedNode(dep, found)) {
471
+ notes.push(`installed by the Animastor installer at ${haveCommit}; the manifest pins ${wantCommit} — updated automatically (the copy is replaced, a backup is kept)`);
472
+ return { ...base, status: 'installed', grade: 'outdated', action: 'update', expected: wantCommit, found: describeNodeFound(found), notes };
473
+ }
467
474
  notes.push(`installed commit ${haveCommit} differs from manifest pin ${wantCommit}; in 'existing' mode a git-safe checkout is SUGGESTED, never applied automatically`);
468
475
  return { ...base, status: 'incompatible', reason: 'version_mismatch', action: 'review', expected: wantCommit, found: describeNodeFound(found), notes };
469
476
  }
@@ -475,6 +482,18 @@ function checkCustomNode(dep, env, profiles) {
475
482
  return { ...base, status: 'installed', grade: 'presence', action: 'skip', found: describeNodeFound(found), notes };
476
483
  }
477
484
 
485
+ /**
486
+ * 0.2.15: a node the installer itself copied from a repository SUBDIRECTORY
487
+ * (marker .animastor-source.json, no .git) of the repository the manifest names.
488
+ * Only such a node is updated automatically; a git checkout (the user's or a
489
+ * third-party node) stays a review item.
490
+ */
491
+ function isInstallerCopiedNode(dep, found) {
492
+ const src = (dep.install && dep.install.source) || {};
493
+ return !!(found && found.animastor_source === true && src.subdirectory && src.commit
494
+ && src.repository && found.repository && reposEqual(src.repository, found.repository));
495
+ }
496
+
478
497
  function describeNodeExpectation(dep) {
479
498
  const src = (dep.install && dep.install.source) || {};
480
499
  return { directory: dep.install && dep.install.directory, repository: src.repository || null, commit: src.commit || null };
@@ -1202,6 +1221,7 @@ function resolveInstallation({ manifests, environment = null, mode = 'existing',
1202
1221
  const incompatible = entries.filter((e) => e.status === 'incompatible').length;
1203
1222
  const installPlan = entries.filter((e) => e.action === 'install').map((e) => e.id);
1204
1223
  const configurePlan = entries.filter((e) => e.action === 'configure').map((e) => e.id);
1224
+ const updatePlan = entries.filter((e) => e.action === 'update').map((e) => e.id);
1205
1225
  const customizedWorkflows = entries.filter((e) => e.kind === 'workflow' && e.grade === 'customized').map((e) => e.id);
1206
1226
 
1207
1227
  // Hard invariant of Phase 1: resolver never plans destructive operations.
@@ -1227,6 +1247,7 @@ function resolveInstallation({ manifests, environment = null, mode = 'existing',
1227
1247
  blocking: missingRequired + incompatible,
1228
1248
  install_plan: installPlan,
1229
1249
  configure_plan: configurePlan,
1250
+ update_plan: updatePlan,
1230
1251
  customized_workflows: customizedWorkflows,
1231
1252
  },
1232
1253
  warnings,
@@ -700,7 +700,10 @@ async function runInstallation(args) {
700
700
  }
701
701
  }
702
702
  const nodesApproved = !runtimeFatal && nodesStep && nodesStep.action && nodesStep.decision === 'yes';
703
- if (!runtimeFatal && (nodesApproved || retryDeps.length > 0)) {
703
+ // 0.2.15: installer-copied nodes behind the manifest pin are updated
704
+ // without a question — also when nothing is missing (noop step)
705
+ const nodeUpdates = (nodesStep && nodesStep.update) || [];
706
+ if (!runtimeFatal && (nodesApproved || retryDeps.length > 0 || nodeUpdates.length > 0)) {
704
707
  const python = platformAdapter.venvPythonBin(path.join(comfyuiRoot, 'venv'));
705
708
  // A platform ComfyUI imports with ITS interpreter: pip into
706
709
  // <root>/venv is useful only when that is the same Python (0.2.13).
@@ -714,6 +717,7 @@ async function runInstallation(args) {
714
717
  ...(nodesStep || { id: 'custom-nodes', title: 'Custom nodes' }),
715
718
  missing: retryDeps.map((id) => ({ id })),
716
719
  review: [],
720
+ update: nodeUpdates,
717
721
  };
718
722
  const nodeTorchSpec = pickTorchSpec(manifests, decisions, result.warnings, device);
719
723
  const r = await log.step('install custom nodes', () => withBusySync('Installing custom nodes', () => nodes.installCustomNodes(io, {
@@ -772,10 +776,12 @@ async function runInstallation(args) {
772
776
  // the dependency gate of the platform's ComfyUI ran BEFORE the clone and
773
777
  // could not see it, so it runs again (overlay install + restart, 0.2.13).
774
778
  let nodeDepsGate = null;
775
- const freshNodes = (result.results.custom_nodes || []).filter((x) => x.status === 'installed' && x.origin === 'installed');
779
+ // 0.2.15: an UPDATED node (new code, same classes) needs the restart too
780
+ const freshNodes = (result.results.custom_nodes || []).filter((x) => x.status === 'installed' && (x.origin === 'installed' || x.origin === 'updated'));
781
+ const updatedNodes = freshNodes.filter((x) => x.origin === 'updated').map((x) => x.directory);
776
782
  if (!runtimeFatal && foreignComfy && freshNodes.length > 0 && options.platformNodeDeps) {
777
783
  log.info(`checking the Python dependencies of the installed node(s): ${freshNodes.map((x) => x.directory).join(', ')}`);
778
- nodeDepsGate = await options.platformNodeDeps(comfyOwner);
784
+ nodeDepsGate = await options.platformNodeDeps(comfyOwner, { codeChanged: updatedNodes });
779
785
  Object.assign(st.installer_options, nodeDepsGate.record);
780
786
  for (const e of nodeDepsGate.ownedServices || []) state.addOwnedComponent(st, 'services', e);
781
787
  result.results.node_deps_overrides = nodeDepsGate.overrides;
@@ -12,7 +12,10 @@
12
12
  *
13
13
  * Already-installed compatible nodes are KEPT — never reinstalled without
14
14
  * need. Incompatible nodes stop their step pending a user decision; no
15
- * destructive replacement happens automatically.
15
+ * destructive replacement happens automatically — except (0.2.15) a node the
16
+ * installer itself copied from a repository subdirectory (marker
17
+ * .animastor-source.json): it is updated to the manifest pin, old copy kept
18
+ * as <root>/.animastor-node-sources/<dir>.prev.
16
19
  */
17
20
 
18
21
  const path = require('path');
@@ -61,6 +64,114 @@ function pipInstallRequirements(io, { root, reqPath, python, torchSpec, log = nu
61
64
  /** marker written into a node installed from a repository subdirectory (probe reads it) */
62
65
  const SOURCE_MARKER = '.animastor-source.json';
63
66
 
67
+ /**
68
+ * Clone src.repository OUTSIDE custom_nodes, check out src.commit, copy
69
+ * src.subdirectory to `dest`, write the source marker; staging is always removed.
70
+ * @returns {null|{status:'blocked'|'failed', reason:string}} null = copied
71
+ */
72
+ function copySubdirectory(io, { root, dep, dirName, src, dest }) {
73
+ const sub = String(src.subdirectory);
74
+ if (path.isAbsolute(sub) || sub.split(/[\\/]/).includes('..')) {
75
+ return { status: 'blocked', reason: `bad subdirectory ${JSON.stringify(sub)} for ${dep.id}` };
76
+ }
77
+ if (!src.commit) {
78
+ return { status: 'blocked', reason: `${dep.id}: a subdirectory source needs a pinned commit` };
79
+ }
80
+ const staging = path.join(root, '.animastor-node-sources', dirName);
81
+ io.fs.rmSync(staging, { recursive: true, force: true });
82
+ io.fs.mkdirSync(path.dirname(staging), { recursive: true });
83
+ let c = io.exec('git', ['clone', src.repository, staging]);
84
+ if (c.code !== 0) {
85
+ io.fs.rmSync(staging, { recursive: true, force: true });
86
+ return { status: 'failed', reason: `git clone ${src.repository} failed: ${String(c.stderr || c.error).slice(-300)}` };
87
+ }
88
+ c = io.exec('git', ['-C', staging, 'checkout', src.commit]);
89
+ if (c.code !== 0) {
90
+ io.fs.rmSync(staging, { recursive: true, force: true });
91
+ return { status: 'failed', reason: `git checkout ${src.commit} failed: ${String(c.stderr).slice(-300)}` };
92
+ }
93
+ const from = path.join(staging, sub);
94
+ if (!io.fs.isDirectory(from)) {
95
+ io.fs.rmSync(staging, { recursive: true, force: true });
96
+ return { status: 'failed', reason: `subdirectory ${sub} not found in ${src.repository}@${src.commit}` };
97
+ }
98
+ c = io.exec('cp', ['-a', from, dest]);
99
+ io.fs.rmSync(staging, { recursive: true, force: true });
100
+ if (c.code !== 0) return { status: 'failed', reason: `copy of ${sub} failed: ${String(c.stderr || c.error).slice(-300)}` };
101
+ io.fs.writeFileSync(path.join(dest, SOURCE_MARKER), JSON.stringify({ repository: src.repository, commit: src.commit, subdirectory: sub }, null, 2) + '\n');
102
+ return null;
103
+ }
104
+
105
+ function readSourceMarker(io, dir) {
106
+ try {
107
+ const m = JSON.parse(io.fs.readFileSync(path.join(dir, SOURCE_MARKER), 'utf8'));
108
+ return m && typeof m === 'object' ? m : null;
109
+ } catch (_) { return null; }
110
+ }
111
+
112
+ /**
113
+ * 0.2.15 — update a node the installer copied from a repository subdirectory
114
+ * (marker .animastor-source.json, same repository) to the manifest pin:
115
+ * the pinned copy is staged in <root>/.animastor-node-sources/<dir>.new,
116
+ * the current one moves to <dir>.prev (the backup of the last update), the
117
+ * new one takes its place; a failed swap puts the old copy back. A git
118
+ * checkout or a node without the marker is never touched.
119
+ * @returns {{ status: 'installed'|'blocked'|'failed', origin?: 'updated', directory?, from?, to?, reason? }}
120
+ */
121
+ function updateCustomNode(io, { root, dep, python = null, torchSpec = null, log = null }) {
122
+ const src = (dep.install && dep.install.source) || {};
123
+ const dirName = (dep.install && dep.install.directory) || dep.name;
124
+ const target = path.join(root, 'custom_nodes', dirName);
125
+ if (!src.subdirectory || !src.commit || !src.repository) {
126
+ return { status: 'blocked', reason: `${dep.id}: only a node pinned to a repository subdirectory + commit is updated automatically` };
127
+ }
128
+ if (!io.fs.isDirectory(target)) return { status: 'failed', reason: `${target} is not there any more — re-run to install it` };
129
+ if (io.fs.existsSync(path.join(target, '.git'))) {
130
+ return { status: 'blocked', reason: `${target} is a git checkout — not replaced automatically` };
131
+ }
132
+ const marker = readSourceMarker(io, target);
133
+ const norm = (u) => String(u || '').replace(/\.git$/, '').replace(/\/+$/, '').toLowerCase();
134
+ if (!marker || norm(marker.repository) !== norm(src.repository)) {
135
+ return { status: 'blocked', reason: `${target} was not installed by the Animastor installer from ${src.repository} — not replaced automatically` };
136
+ }
137
+ const from = typeof marker.commit === 'string' ? marker.commit : null;
138
+ if (from === src.commit) return { status: 'installed', origin: 'pre-existing', directory: dirName, reason: 'already at the manifest pin' };
139
+
140
+ const base = path.join(root, '.animastor-node-sources');
141
+ const fresh = path.join(base, `${dirName}.new`);
142
+ const backup = path.join(base, `${dirName}.prev`);
143
+ io.fs.mkdirSync(base, { recursive: true });
144
+ io.fs.rmSync(fresh, { recursive: true, force: true });
145
+ const staged = copySubdirectory(io, { root, dep, dirName, src, dest: fresh });
146
+ if (staged) {
147
+ io.fs.rmSync(fresh, { recursive: true, force: true });
148
+ return staged;
149
+ }
150
+ io.fs.rmSync(backup, { recursive: true, force: true });
151
+ try {
152
+ io.fs.renameSync(target, backup);
153
+ } catch (err) {
154
+ io.fs.rmSync(fresh, { recursive: true, force: true });
155
+ return { status: 'failed', reason: `could not move the old ${dirName} aside: ${err.message}` };
156
+ }
157
+ try {
158
+ io.fs.renameSync(fresh, target);
159
+ } catch (err) {
160
+ try { io.fs.renameSync(backup, target); } catch (_) { /* reported below */ }
161
+ io.fs.rmSync(fresh, { recursive: true, force: true });
162
+ return { status: 'failed', reason: `could not put the new ${dirName} in place (old copy restored): ${err.message}` };
163
+ }
164
+ const req = path.join(target, 'requirements.txt');
165
+ if (io.fs.existsSync(req) && python) {
166
+ const pip = pipInstallRequirements(io, { root, reqPath: req, python, torchSpec, log });
167
+ if (!pip.ok) {
168
+ return { status: 'installed', origin: 'updated', directory: dirName, from, to: src.commit, pip_output: pip.output, reason: 'updated; python dependencies incomplete — see warnings' };
169
+ }
170
+ }
171
+ if (log) log.info(`custom node updated: ${dirName} ${String(from || '?').slice(0, 7)} → ${src.commit.slice(0, 7)} (previous copy: ${backup})`);
172
+ return { status: 'installed', origin: 'updated', directory: dirName, from, to: src.commit };
173
+ }
174
+
64
175
  function installCustomNode(io, { root, dep, python = null, torchSpec = null, retryDeps = false, log = null }) {
65
176
  const src = (dep.install && dep.install.source) || {};
66
177
  const dirName = (dep.install && dep.install.directory) || dep.name;
@@ -91,35 +202,8 @@ function installCustomNode(io, { root, dep, python = null, torchSpec = null, ret
91
202
  // animastor-worker/comfyui-nodes/animastor-voice-ref): clone OUTSIDE
92
203
  // custom_nodes (ComfyUI would load the whole checkout as a node),
93
204
  // check out the pin, copy the subdirectory, record the source.
94
- const sub = String(src.subdirectory);
95
- if (path.isAbsolute(sub) || sub.split(/[\\/]/).includes('..')) {
96
- return { status: 'blocked', reason: `bad subdirectory ${JSON.stringify(sub)} for ${dep.id}` };
97
- }
98
- if (!src.commit) {
99
- return { status: 'blocked', reason: `${dep.id}: a subdirectory source needs a pinned commit` };
100
- }
101
- const staging = path.join(root, '.animastor-node-sources', dirName);
102
- io.fs.rmSync(staging, { recursive: true, force: true });
103
- io.fs.mkdirSync(path.dirname(staging), { recursive: true });
104
- let c = io.exec('git', ['clone', src.repository, staging]);
105
- if (c.code !== 0) {
106
- io.fs.rmSync(staging, { recursive: true, force: true });
107
- return { status: 'failed', reason: `git clone ${src.repository} failed: ${String(c.stderr || c.error).slice(-300)}` };
108
- }
109
- c = io.exec('git', ['-C', staging, 'checkout', src.commit]);
110
- if (c.code !== 0) {
111
- io.fs.rmSync(staging, { recursive: true, force: true });
112
- return { status: 'failed', reason: `git checkout ${src.commit} failed: ${String(c.stderr).slice(-300)}` };
113
- }
114
- const from = path.join(staging, sub);
115
- if (!io.fs.isDirectory(from)) {
116
- io.fs.rmSync(staging, { recursive: true, force: true });
117
- return { status: 'failed', reason: `subdirectory ${sub} not found in ${src.repository}@${src.commit}` };
118
- }
119
- c = io.exec('cp', ['-a', from, target]);
120
- io.fs.rmSync(staging, { recursive: true, force: true });
121
- if (c.code !== 0) return { status: 'failed', reason: `copy of ${sub} failed: ${String(c.stderr || c.error).slice(-300)}` };
122
- io.fs.writeFileSync(path.join(target, SOURCE_MARKER), JSON.stringify({ repository: src.repository, commit: src.commit, subdirectory: sub }, null, 2) + '\n');
205
+ const staged = copySubdirectory(io, { root, dep, dirName, src, dest: target });
206
+ if (staged) return staged;
123
207
  } else {
124
208
  let r = io.exec('git', ['clone', src.repository, target]);
125
209
  if (r.code !== 0) {
@@ -169,6 +253,15 @@ function installCustomNodes(io, { root, manifests, planStep, python = null, torc
169
253
  ...installCustomNode(io, { root, dep, python, torchSpec, retryDeps: retryDeps.includes(item.id), log }),
170
254
  });
171
255
  }
256
+ // 0.2.15: installer-copied nodes behind the manifest pin (resolver action 'update')
257
+ for (const item of planStep.update || []) {
258
+ const dep = findManifestDep(manifests, item.id);
259
+ if (!dep) {
260
+ results.push({ id: item.id, status: 'blocked', reason: 'not found in any manifest' });
261
+ continue;
262
+ }
263
+ results.push({ id: item.id, ...updateCustomNode(io, { root, dep, python, torchSpec, log }) });
264
+ }
172
265
  for (const item of planStep.review || []) {
173
266
  results.push({
174
267
  id: item.id,
@@ -181,5 +274,6 @@ function installCustomNodes(io, { root, manifests, planStep, python = null, torc
181
274
 
182
275
  module.exports = {
183
276
  installCustomNode,
277
+ updateCustomNode,
184
278
  installCustomNodes,
185
279
  };
@@ -94,7 +94,7 @@ function gitInfo(io, dir) {
94
94
  if (!io.fs.existsSync(marker)) return null;
95
95
  try {
96
96
  const m = JSON.parse(io.fs.readFileSync(marker, 'utf8'));
97
- if (m && typeof m.repository === 'string' && typeof m.commit === 'string') return { repository: m.repository, commit: m.commit, tag: null };
97
+ if (m && typeof m.repository === 'string' && typeof m.commit === 'string') return { repository: m.repository, commit: m.commit, tag: null, animastor_source: true };
98
98
  } catch (_) { /* unreadable marker → plain directory */ }
99
99
  return null;
100
100
  }
@@ -310,6 +310,9 @@ function probeCustomNodes(io, root) {
310
310
  repository: git ? git.repository : null,
311
311
  commit: git ? git.commit : null,
312
312
  is_git: git !== null,
313
+ // 0.2.15: copied by the installer from a repository subdirectory
314
+ // (.animastor-source.json) — the installer may update it to the pin
315
+ ...(git && git.animastor_source ? { animastor_source: true } : {}),
313
316
  });
314
317
  }
315
318
  return out;
@@ -255,6 +255,10 @@ function buildArtifactStep({ id, title, report, kinds, decisionKey, decisions, m
255
255
  kind: 'prompt',
256
256
  missing: missing.map((e) => ({ id: e.id, label: entryLabel(e) })),
257
257
  review: review.map((e) => ({ id: e.id, label: entryLabel(e), reason: e.reason || e.status, notes: e.notes || [] })),
258
+ // 0.2.15: installer-copied nodes behind the manifest pin — updated
259
+ // without a question (the engine runs them even when the step is a noop)
260
+ update: report.entries.filter((e) => kinds.includes(e.kind) && e.action === 'update')
261
+ .map((e) => ({ id: e.id, label: entryLabel(e), from: e.found ? e.found.commit : null, to: e.expected || null })),
258
262
  ...(stepExtra || {}),
259
263
  };
260
264
  if (missing.length === 0) {
@@ -730,6 +734,7 @@ function renderPlanText(plan, report, { questions = true, header = true } = {})
730
734
  const actions = toInstall.filter((e) => !declined.has(e.id)).map(actionLine);
731
735
  for (const e of report.entries) {
732
736
  if (e.action === 'configure') actions.push(`Configure ${entryLabel(e)} (.env)`);
737
+ if (e.action === 'update') actions.push(`Update ${entryLabel(e)}: ${String((e.found && e.found.commit) || '?').slice(0, 7)} → ${String(e.expected || '?').slice(0, 7)}`);
733
738
  }
734
739
  if (actions.length > 0) {
735
740
  lines.push('Actions:');
@@ -1137,6 +1137,7 @@ function mapEntryToAction(entry, { mode, downloadSpecs }) {
1137
1137
  return { ...base, type: 'REVIEW', component: 'runtime', name: RUNTIME_LABELS[entry.component] || entry.component };
1138
1138
  }
1139
1139
  case 'custom_node': {
1140
+ if (entry.action === 'update') return { ...base, type: 'INSTALL', component: 'custom-node', name: entry.name || entry.id, update: true };
1140
1141
  if (entry.status === 'installed') return { ...base, type: 'KEEP', component: 'custom-node', name: entry.name || entry.id };
1141
1142
  if (entry.requirement !== 'required') return null; // optional/unknown extras are never auto-installed
1142
1143
  return { ...base, type: 'INSTALL', component: 'custom-node', name: entry.name || entry.id };