@ngocsangairvds/vsaf 4.0.10 → 4.0.12

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ngocsangairvds/vsaf",
3
- "version": "4.0.10",
3
+ "version": "4.0.12",
4
4
  "description": "is it ready to use ?",
5
5
  "main": "packages/core/dist/index.js",
6
6
  "types": "packages/core/dist/index.d.ts",
@@ -26,7 +26,7 @@
26
26
  ],
27
27
  "scripts": {
28
28
  "build": "npm run build --workspaces",
29
- "postinstall": "node -e \"const fs=require('fs'),p=require('path'),r=p.resolve;const d=r(process.cwd(),'node_modules','@vsaf');fs.mkdirSync(d,{recursive:true});const t=r(d,'core');try{fs.rmSync(t,{recursive:true,force:true})}catch{};fs.symlinkSync(r(process.cwd(),'packages','core','dist'),t,'dir')\"",
29
+ "postinstall": "node -e \"const fs=require('fs'),p=require('path'),r=p.resolve;const d=r(process.cwd(),'node_modules','@vsaf');fs.mkdirSync(d,{recursive:true});const t=r(d,'core');try{fs.rmSync(t,{recursive:true,force:true})}catch{};const s=r(process.cwd(),'packages','core','dist');try{fs.symlinkSync(s,t,process.platform==='win32'?'junction':'dir')}catch{fs.cpSync(s,t,{recursive:true})}\"",
30
30
  "prepack": "cp package.json package.json.bak && node -e \"const f='package.json',j=JSON.parse(require('fs').readFileSync(f));delete j.workspaces;require('fs').writeFileSync(f,JSON.stringify(j,null,2)+'\\n')\"",
31
31
  "postpack": "mv package.json.bak package.json",
32
32
  "test": "vitest run",
@@ -10,8 +10,8 @@
10
10
  * node install-deps.mjs [projectPath]
11
11
  */
12
12
 
13
- import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, chmodSync } from 'fs';
14
- import { join, dirname } from 'path';
13
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, cpSync, chmodSync, unlinkSync } from 'fs';
14
+ import { join, dirname, delimiter } from 'path';
15
15
  import { homedir } from 'os';
16
16
 
17
17
  const projectPath = process.argv[2] || process.cwd();
@@ -227,19 +227,37 @@ if (!vdsCliFound) {
227
227
  if (vdsScriptsDir) {
228
228
  log('📂', `vds-scripts: ${vdsScriptsDir}`);
229
229
  if (existsSync(join(vdsScriptsDir, 'pyproject.toml'))) {
230
- console.log('');
231
- log('🔄', 'Syncing vds-scripts packages (uv sync --all-packages)...');
230
+ // Check uv is available before attempting sync
231
+ let uvAvailable = false;
232
232
  try {
233
- execSync('uv sync --all-packages', {
234
- stdio: 'pipe',
235
- encoding: 'utf-8',
236
- timeout: 120000,
237
- cwd: vdsScriptsDir,
238
- });
239
- log('✅', 'All vds-scripts packages synced');
233
+ execSync('uv --version', { stdio: 'pipe', encoding: 'utf-8', timeout: 10000 });
234
+ uvAvailable = true;
240
235
  } catch {
241
- log('⚠️', 'Failed to sync vds-scripts packagessubcommands like confluence/jira may not work');
242
- log(' ', `Fix: cd ${vdsScriptsDir} && uv sync --all-packages`);
236
+ log('⚠️', 'uv (Python package manager) not found required for vds-scripts');
237
+ if (process.platform === 'win32') {
238
+ log(' ', 'Install: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"');
239
+ log(' ', ' or: winget install astral-sh.uv');
240
+ } else {
241
+ log(' ', 'Install: curl -LsSf https://astral.sh/uv/install.sh | sh');
242
+ log(' ', ' or: brew install uv');
243
+ }
244
+ }
245
+
246
+ if (uvAvailable) {
247
+ console.log('');
248
+ log('🔄', 'Syncing vds-scripts packages (uv sync --all-packages)...');
249
+ try {
250
+ execSync('uv sync --all-packages', {
251
+ stdio: 'pipe',
252
+ encoding: 'utf-8',
253
+ timeout: 120000,
254
+ cwd: vdsScriptsDir,
255
+ });
256
+ log('✅', 'All vds-scripts packages synced');
257
+ } catch {
258
+ log('⚠️', 'Failed to sync vds-scripts packages — subcommands like confluence/jira may not work');
259
+ log(' ', `Fix: cd ${vdsScriptsDir} && uv sync --all-packages`);
260
+ }
243
261
  }
244
262
  }
245
263
  } else {
@@ -252,31 +270,43 @@ console.log('');
252
270
  log('🔍', 'Verifying vds-cli...');
253
271
 
254
272
  let verified = false;
273
+
274
+ // First pass: try vds-cli on PATH
255
275
  try {
256
276
  const ver = execSync('vds-cli --version', { stdio: 'pipe', encoding: 'utf-8', timeout: 15000 }).trim();
257
277
  log('✅', `vds-cli ${ver} — working`);
258
278
  verified = true;
259
279
  } catch {
260
- // Try with project-local wrapper in PATH
280
+ // vds-cli on PATH failed check if a broken shim exists and auto-remove it
281
+ try {
282
+ const whichCmd = process.platform === 'win32' ? 'where' : 'which';
283
+ const shimPath = execSync(`${whichCmd} vds-cli`, { stdio: 'pipe', encoding: 'utf-8' }).trim().split('\n')[0];
284
+ // Shim exists but doesn't work — remove it automatically
285
+ log('🗑️', `Removing broken shim: ${shimPath}`);
286
+ try {
287
+ unlinkSync(shimPath);
288
+ log('✅', 'Broken shim removed');
289
+ } catch (e) {
290
+ log('⚠️', `Cannot auto-remove shim (${e.code || e.message})`);
291
+ log(' ', `Manual fix: del "${shimPath}" then re-run: vsaf install vds-skill`);
292
+ }
293
+ } catch {
294
+ // No shim found — that's fine
295
+ }
296
+ }
297
+
298
+ // Second pass: try project-local wrapper
299
+ if (!verified) {
261
300
  try {
262
301
  const wrapperPath = join(projectPath, '.claude', 'bin');
263
302
  const ver = execSync('vds-cli --version', {
264
303
  stdio: 'pipe', encoding: 'utf-8', timeout: 15000,
265
- env: { ...process.env, PATH: `${wrapperPath}:${process.env.PATH}` },
304
+ env: { ...process.env, PATH: `${wrapperPath}${delimiter}${process.env.PATH}` },
266
305
  }).trim();
267
306
  log('✅', `vds-cli ${ver} — working (via .claude/bin/vds-cli)`);
268
307
  verified = true;
269
308
  } catch {
270
- // Check if a shim exists but is broken
271
- try {
272
- const whichCmd = process.platform === 'win32' ? 'where' : 'which';
273
- const shimPath = execSync(`${whichCmd} vds-cli`, { stdio: 'pipe', encoding: 'utf-8' }).trim().split('\n')[0];
274
- log('❌', `vds-cli BROKEN — ${shimPath} exists but fails to run`);
275
- log(' ', 'The shim likely points to a deleted venv or missing vds-scripts directory.');
276
- log(' ', `Fix: rm ${shimPath} then re-run: vsaf install vds-skill`);
277
- } catch {
278
- log('❌', 'vds-cli not found');
279
- }
309
+ log('❌', 'vds-cli not working skills will be BLOCKED at runtime');
280
310
  }
281
311
  }
282
312