@comfanion/workflow 4.36.10 → 4.36.11
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/bin/cli.js +23 -26
- package/package.json +1 -1
- package/src/build-info.json +1 -1
package/bin/cli.js
CHANGED
|
@@ -273,21 +273,16 @@ program
|
|
|
273
273
|
// If updating, preserve vectorizer and indexes
|
|
274
274
|
const vectorizerDir = path.join(targetDir, 'vectorizer');
|
|
275
275
|
const vectorsDir = path.join(targetDir, 'vectors');
|
|
276
|
-
const vectorizerNodeModules = path.join(vectorizerDir, 'node_modules');
|
|
277
|
-
const tempNodeModules = path.join(process.cwd(), '.vectorizer-node_modules-temp');
|
|
278
276
|
const tempVectors = path.join(process.cwd(), '.vectors-temp');
|
|
279
277
|
|
|
280
|
-
let hadVectorizer = false;
|
|
281
278
|
let hadVectors = false;
|
|
282
|
-
|
|
283
279
|
let existingConfigContent = null;
|
|
284
280
|
|
|
285
281
|
if (await fs.pathExists(targetDir)) {
|
|
286
282
|
const timestamp = new Date().toISOString().replace(/[:.]/g, '-').slice(0, 19);
|
|
287
283
|
const backupDir = path.join(process.cwd(), `.opencode.backup-${timestamp}`);
|
|
288
284
|
|
|
289
|
-
// Check what we need to preserve
|
|
290
|
-
hadVectorizer = await fs.pathExists(vectorizerNodeModules);
|
|
285
|
+
// Check what we need to preserve (only vectors, vectorizer will be reinstalled fresh)
|
|
291
286
|
hadVectors = await fs.pathExists(vectorsDir);
|
|
292
287
|
|
|
293
288
|
// Read existing config.yaml for merge
|
|
@@ -296,13 +291,7 @@ program
|
|
|
296
291
|
existingConfigContent = await fs.readFile(existingConfigPath, 'utf8');
|
|
297
292
|
}
|
|
298
293
|
|
|
299
|
-
// Preserve
|
|
300
|
-
if (hadVectorizer) {
|
|
301
|
-
spinner.text = 'Preserving vectorizer dependencies...';
|
|
302
|
-
await fs.move(vectorizerNodeModules, tempNodeModules, { overwrite: true });
|
|
303
|
-
}
|
|
304
|
-
|
|
305
|
-
// Preserve vector indexes
|
|
294
|
+
// Preserve vector indexes only (not node_modules - will reinstall fresh)
|
|
306
295
|
if (hadVectors) {
|
|
307
296
|
spinner.text = 'Preserving vector indexes...';
|
|
308
297
|
await fs.move(vectorsDir, tempVectors, { overwrite: true });
|
|
@@ -325,19 +314,24 @@ program
|
|
|
325
314
|
// Copy .opencode structure (fresh, no old files)
|
|
326
315
|
await fs.copy(OPENCODE_SRC, targetDir);
|
|
327
316
|
|
|
328
|
-
// Copy
|
|
317
|
+
// Copy and install vectorizer fresh
|
|
329
318
|
if (await fs.pathExists(VECTORIZER_SRC)) {
|
|
330
|
-
spinner.text = '
|
|
319
|
+
spinner.text = 'Installing vectorizer...';
|
|
331
320
|
const newVectorizerDir = path.join(targetDir, 'vectorizer');
|
|
332
321
|
await fs.ensureDir(newVectorizerDir);
|
|
333
322
|
await fs.copy(path.join(VECTORIZER_SRC, 'index.js'), path.join(newVectorizerDir, 'index.js'));
|
|
334
323
|
await fs.copy(path.join(VECTORIZER_SRC, 'package.json'), path.join(newVectorizerDir, 'package.json'));
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
324
|
+
|
|
325
|
+
// Always install vectorizer dependencies fresh
|
|
326
|
+
try {
|
|
327
|
+
execSync('npm install --silent', {
|
|
328
|
+
cwd: newVectorizerDir,
|
|
329
|
+
stdio: 'pipe',
|
|
330
|
+
timeout: 120000
|
|
331
|
+
});
|
|
332
|
+
} catch (e) {
|
|
333
|
+
// Non-fatal, will show warning below
|
|
334
|
+
}
|
|
341
335
|
}
|
|
342
336
|
|
|
343
337
|
// Restore vector indexes
|
|
@@ -456,16 +450,19 @@ program
|
|
|
456
450
|
console.log(chalk.gray(' Run manually: cd .opencode && bun install'));
|
|
457
451
|
}
|
|
458
452
|
|
|
459
|
-
// Show what was
|
|
460
|
-
|
|
461
|
-
|
|
453
|
+
// Show what was done
|
|
454
|
+
const vectorizerInstalled = await fs.pathExists(path.join(targetDir, 'vectorizer', 'node_modules'));
|
|
455
|
+
if (vectorizerInstalled) {
|
|
456
|
+
console.log(chalk.green('✅ Vectorizer installed (fresh dependencies)'));
|
|
457
|
+
} else {
|
|
458
|
+
console.log(chalk.yellow('⚠️ Vectorizer: run `npx @comfanion/workflow vectorizer install`'));
|
|
462
459
|
}
|
|
463
460
|
if (hadVectors) {
|
|
464
461
|
console.log(chalk.green('✅ Vector indexes preserved'));
|
|
465
462
|
}
|
|
466
463
|
|
|
467
|
-
// Install vectorizer if requested
|
|
468
|
-
if (config.install_vectorizer && !
|
|
464
|
+
// Install vectorizer if requested and failed above
|
|
465
|
+
if (config.install_vectorizer && !vectorizerInstalled) {
|
|
469
466
|
await installVectorizer(targetDir);
|
|
470
467
|
}
|
|
471
468
|
|
package/package.json
CHANGED