@animastor/installer 0.1.1 → 0.2.9

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.
@@ -56,24 +56,23 @@ function getInstallerVersion() {
56
56
  * package.json. Checks baked-in artifacts first (container), then
57
57
  * repo checkout (development), then hub probe (network).
58
58
  */
59
- function getWorkerBundleVersion() {
60
- // Priority: baked-in > repo checkout > null (hub probe is primary source)
59
+ function getWorkerBundleVersion(bundleDir) {
60
+ // Priority: baked-in > explicit bundleDir (test fixture) > repo checkout > null
61
+ // (hub probe is primary source). bundleDir lets tests inject a synthetic
62
+ // worker bundle instead of depending on packages/animastor-worker, which
63
+ // lives in the worker repo post-split.
61
64
  const bakedIn = path.join('/app', 'artifacts', 'worker-bundle', 'package.json');
62
65
  try {
63
66
  const pkg = JSON.parse(fs.readFileSync(bakedIn, 'utf8'));
64
67
  if (typeof pkg.version === 'string' && pkg.version) return pkg.version;
65
68
  } catch (_) { /* not in container */ }
66
69
  try {
67
- // Canonical repo location (packages/animastor-worker/worker) with the
68
- // legacy worker/worker fallback for pre-relocation checkouts — see
69
- // installer/worker-bundle-source.js. Resolved against THIS module dir
70
- // (packages/animastor-installer/src/installer → repo root): inside the
71
- // monorepo that is the repo root; inside a distributed installer package
72
- // it is the extraction parent, mirroring the repo layout.
73
- const candidates = [
74
- path.join(__dirname, '..', '..', '..', '..', 'packages', 'animastor-worker', 'worker', 'package.json'),
75
- path.join(__dirname, '..', '..', '..', '..', 'worker', 'worker', 'package.json'),
76
- ];
70
+ const candidates = bundleDir
71
+ ? [path.join(bundleDir, 'package.json')]
72
+ : [
73
+ path.join(__dirname, '..', '..', '..', '..', 'packages', 'animastor-worker', 'worker', 'package.json'),
74
+ path.join(__dirname, '..', '..', '..', '..', 'worker', 'worker', 'package.json'),
75
+ ];
77
76
  for (const file of candidates) {
78
77
  try {
79
78
  const pkg = JSON.parse(fs.readFileSync(file, 'utf8'));
@@ -692,7 +691,7 @@ function dockerContainerSteps({ profileIds, mode, hubUrl }) {
692
691
  id: 'docker-build',
693
692
  title: 'Build the worker image',
694
693
  body: 'Clone the Animastor repository and build the worker image from its canonical Dockerfile (the image runs the universal installer in docker deployment).',
695
- code: 'git clone https://github.com/Animastor/animastor.git\ncd animastor\ndocker build -t animastor-worker -f docker/worker/Dockerfile docker/worker',
694
+ code: 'git clone https://github.com/Animastor/animastor-worker.git\ncd animastor-worker\ndocker build -t animastor-worker -f docker/worker/Dockerfile docker/worker',
696
695
  });
697
696
  steps.push({
698
697
  id: 'docker-install',
@@ -926,7 +925,10 @@ function buildInstructions({
926
925
  status: artifacts.installer.status || 'available',
927
926
  download_url: bootstrapUrl,
928
927
  };
929
- response.verify_command = '$HOME/animastor/tools/status.sh';
928
+ // The installer links the `animastor` command into ~/.local/bin (root
929
+ // included) and persists that directory in ~/.bashrc / ~/.profile; the
930
+ // tools-dir path works without PATH too.
931
+ response.verify_command = 'animastor status # or: $HOME/animastor/tools/animastor status';
930
932
 
931
933
  if (target.deployment === 'docker') {
932
934
  // Docker deployment (linux platform) — the canonical container flow
@@ -1028,18 +1030,16 @@ function buildInstructions({
1028
1030
  code: 'powershell -ExecutionPolicy Bypass -File .\\animastor-installer.ps1',
1029
1031
  });
1030
1032
  } else {
1031
- steps.push({
1032
- id: 'download-bootstrap',
1033
- title: 'Download the installer',
1034
- body: `Download the bootstrap installer (installer version ${artifacts.installer.version}). The profile and connection mode you selected here are already embedded — nothing needs to be typed.`,
1035
- code: `curl -fsSL -o animastor-installer.sh ${bootstrapUrl}`,
1036
- });
1037
-
1033
+ // ONE command. The URL is quoted: unquoted, the shell treats every
1034
+ // `&` in the query as "run in background" and the profile/mode/
1035
+ // platform parameters are silently lost. The installer reads its
1036
+ // questions (and the hidden Worker Key) from /dev/tty, so piping the
1037
+ // script into bash is the supported way to run it.
1038
1038
  steps.push({
1039
1039
  id: 'run-bootstrap',
1040
1040
  title: 'Run the installer',
1041
- body: 'The installer itself downloads and verifies all components (ComfyUI, models, worker), then asks for the Worker Key (hidden input) — paste the key saved above.',
1042
- code: 'bash animastor-installer.sh',
1041
+ body: `Run this one command in a terminal on the GPU machine (installer version ${artifacts.installer.version}). The profile and connection mode you selected here are already embedded. The installer checks the machine, installs only what is missing, asks for the Worker Key (hidden input — paste the key saved above) and finishes with a ✓/✗ summary.`,
1042
+ code: bootstrapOneLiner(bootstrapUrl),
1043
1043
  });
1044
1044
  }
1045
1045
 
@@ -1052,6 +1052,17 @@ function buildInstructions({
1052
1052
  return response;
1053
1053
  }
1054
1054
 
1055
+ /**
1056
+ * The Linux install command: `curl -fsSL "<url>" | bash`. The URL is always
1057
+ * double-quoted (it carries `&`-separated query parameters); a URL that
1058
+ * could break out of the quotes is refused rather than emitted.
1059
+ */
1060
+ function bootstrapOneLiner(url) {
1061
+ const u = String(url || '');
1062
+ if (!u || /["`$\\\s]/.test(u)) throw new Error('bootstrap URL contains characters that cannot be quoted safely');
1063
+ return `curl -fsSL "${u}" | bash`;
1064
+ }
1065
+
1055
1066
  // ---------------------------------------------------------------------------
1056
1067
  // Worker status adapter & capabilities normalization
1057
1068
  // ---------------------------------------------------------------------------
@@ -1371,6 +1382,7 @@ function buildSetupPlan({ profileIds, mode, platform = 'linux', deployment = 'na
1371
1382
  }
1372
1383
 
1373
1384
  module.exports = {
1385
+ bootstrapOneLiner,
1374
1386
  PLATFORMS,
1375
1387
  OS_PLATFORMS,
1376
1388
  DEPLOYMENTS,
@@ -67,6 +67,13 @@ function summarizeRuntime(entries) {
67
67
  .join(', ') || null;
68
68
  }
69
69
 
70
+ /** Headline of a missing-node-classes cause (node-deps diagnoseMissingClasses). */
71
+ const CAUSE_TITLE = {
72
+ 'deps-missing': 'Python packages missing',
73
+ 'import-failed': 'IMPORT FAILED in the ComfyUI log',
74
+ 'restart-needed': 'ComfyUI restart needed',
75
+ };
76
+
70
77
  /**
71
78
  * @param {object} args
72
79
  * @param {object} args.report - resolver report
@@ -84,11 +91,13 @@ function buildVerificationReport({ report, live = {} }) {
84
91
  throw new Error('buildVerificationReport requires a resolution report');
85
92
  }
86
93
  const lines = [];
94
+ const checks = [];
87
95
  let fails = 0;
88
96
  let warns = 0;
89
97
 
90
- const push = (verdict, label, detail) => {
98
+ const push = (verdict, label, detail, extra = null) => {
91
99
  lines.push(line(verdict, label, detail));
100
+ checks.push({ verdict, label, detail: detail || null, ...(extra || {}) });
92
101
  if (verdict === false) fails += 1;
93
102
  else if (verdict === null) warns += 1;
94
103
  };
@@ -132,9 +141,16 @@ function buildVerificationReport({ report, live = {} }) {
132
141
  const nodeEntriesAll = byKind('custom_node');
133
142
  const presentButUnregistered = nodeEntriesAll.length > 0
134
143
  && nodeEntriesAll.every((e) => e.status === 'installed');
135
- push(false, 'ComfyUI node classes', `missing: ${c.missing_node_classes.join(', ')}${presentButUnregistered
136
- ? ' — the node files are present, but the running ComfyUI did not register them (import failed — see <ComfyUI>/comfyui-installer.log — or the instance predates the install); restart ComfyUI and re-run verify'
137
- : ''}`);
144
+ const cause = c.missing_node_classes_cause || null;
145
+ if (cause && cause.kind && cause.kind !== 'unknown') {
146
+ // Installer 0.2.5: the cause, not a generic "re-run" (the fix
147
+ // line is chosen from cause.kind in engine/summary.js).
148
+ push(false, 'ComfyUI node classes', `missing: ${c.missing_node_classes.join(', ')} — ${CAUSE_TITLE[cause.kind] || cause.kind}: ${cause.detail}`, { cause });
149
+ } else {
150
+ push(false, 'ComfyUI node classes', `missing: ${c.missing_node_classes.join(', ')}${presentButUnregistered
151
+ ? ' — the node files are present, but the running ComfyUI did not register them (import failed — see <ComfyUI>/comfyui-installer.log — or the instance predates the install); restart ComfyUI and re-run verify'
152
+ : ''}${cause && cause.detail ? ` (${cause.detail})` : ''}`, cause ? { cause } : null);
153
+ }
138
154
  }
139
155
  } else {
140
156
  push(null, 'ComfyUI API', 'not checked (start ComfyUI and re-run verification)');
@@ -212,7 +228,7 @@ function buildVerificationReport({ report, live = {} }) {
212
228
  : 'INSTALLATION INCOMPLETE';
213
229
 
214
230
  const text = [header, '', ...lines].join('\n');
215
- return { status, fails, warns, lines, text };
231
+ return { status, fails, warns, lines, checks, text };
216
232
  }
217
233
 
218
234
  module.exports = {