@ngocsangairvds/vsaf 4.0.3 → 4.0.5

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.3",
3
+ "version": "4.0.5",
4
4
  "description": "README",
5
5
  "main": "packages/core/dist/index.js",
6
6
  "types": "packages/core/dist/index.d.ts",
@@ -14,6 +14,8 @@ Before doing anything, run this check via Bash tool:
14
14
  ```bash
15
15
  source .claude/skills/_shared/vds-skill/credentials.sh 2>/dev/null
16
16
  MISSING=""
17
+ { command -v vds-cli >/dev/null 2>&1 || [[ -x .claude/bin/vds-cli ]]; } || MISSING="$MISSING vds-cli"
18
+ [[ -x .claude/bin/vds-cli ]] && export PATH=".claude/bin:$PATH"
17
19
  [[ -z "${VDS_BITBUCKET_TOKEN:-}" ]] && MISSING="$MISSING VDS_BITBUCKET_TOKEN"
18
20
  if [[ -n "$MISSING" ]]; then
19
21
  echo "BLOCKED — missing:$MISSING"
@@ -14,6 +14,8 @@ Before doing anything, run this check via Bash tool:
14
14
  ```bash
15
15
  source .claude/skills/_shared/vds-skill/credentials.sh 2>/dev/null
16
16
  MISSING=""
17
+ { command -v vds-cli >/dev/null 2>&1 || [[ -x .claude/bin/vds-cli ]]; } || MISSING="$MISSING vds-cli"
18
+ [[ -x .claude/bin/vds-cli ]] && export PATH=".claude/bin:$PATH"
17
19
  [[ -z "${VDS_JIRA_TOKEN:-}" ]] && MISSING="$MISSING VDS_JIRA_TOKEN"
18
20
  [[ -z "${VDS_JIRA_PROJECT_DEFAULT:-}" ]] && MISSING="$MISSING VDS_JIRA_PROJECT_DEFAULT"
19
21
  if [[ -n "$MISSING" ]]; then
@@ -141,17 +141,92 @@ if (missing.length > 0) {
141
141
  log('💡', 'Skills will also lazy-prompt at runtime if values are empty.');
142
142
  }
143
143
 
144
- // ── Step 4: Check vds-cli ──
144
+ // ── Step 4: Check vds-cli + create project-local wrapper ──
145
145
 
146
146
  console.log('');
147
+ const { execSync } = await import('child_process');
148
+
149
+ // Detect vds-scripts location (project-local preferred, then global)
150
+ const localVdsScripts = join(projectPath, '.claude', 'vds-scripts');
151
+ const globalVdsScripts = join(homedir(), '.claude', 'vds-scripts');
152
+ const vdsScriptsDir = existsSync(localVdsScripts) ? localVdsScripts
153
+ : existsSync(globalVdsScripts) ? globalVdsScripts
154
+ : null;
155
+
156
+ let vdsCliFound = false;
157
+
158
+ // Check if vds-cli is already on PATH
147
159
  try {
148
- const { execSync } = await import('child_process');
149
160
  const version = execSync('vds-cli --version', { stdio: 'pipe', encoding: 'utf-8' }).trim();
150
- log('✅', `vds-cli ${version}`);
161
+ log('✅', `vds-cli ${version} (on PATH)`);
162
+ vdsCliFound = true;
151
163
  } catch {
164
+ // Not on PATH — try to create project-local wrapper
165
+ }
166
+
167
+ // Create project-local vds-cli wrapper if vds-scripts exists but vds-cli not on PATH
168
+ if (!vdsCliFound && vdsScriptsDir) {
169
+ const wrapperDir = join(projectPath, '.claude', 'bin');
170
+ const wrapperPath = join(wrapperDir, 'vds-cli');
171
+ const uvRunner = join(vdsScriptsDir, 'scripts', 'worktree_uv.sh');
172
+
173
+ if (existsSync(uvRunner)) {
174
+ mkdirSync(wrapperDir, { recursive: true });
175
+ const wrapperContent = `#!/usr/bin/env bash
176
+ # Project-local vds-cli wrapper — created by vsaf install vds-skill
177
+ # Delegates to worktree_uv.sh in the detected vds-scripts directory.
178
+ set -euo pipefail
179
+ exec "${uvRunner}" run --directory "${vdsScriptsDir}" --package vds-cli vds-cli "$@"
180
+ `;
181
+ writeFileSync(wrapperPath, wrapperContent, { mode: 0o755 });
182
+ log('✅', `vds-cli wrapper created: ${wrapperPath}`);
183
+ log(' ', `Points to: ${vdsScriptsDir}`);
184
+ log('💡', 'Add to PATH: export PATH=".claude/bin:$PATH"');
185
+ vdsCliFound = true;
186
+ }
187
+ }
188
+
189
+ if (!vdsCliFound) {
152
190
  log('⚠️', 'vds-cli not found — required for non-dry-run execution');
153
- log(' ', 'Install vds-scripts from Viettel internal repo, then verify:');
154
- log(' ', ' command -v vds-cli && vds-cli --version');
191
+ log(' ', 'Option 1: Clone vds-scripts into .claude/vds-scripts/ then re-run install');
192
+ log(' ', 'Option 2: Install vds-cli globally (pip install / Viettel internal)');
193
+ log(' ', 'Verify: command -v vds-cli && vds-cli --version');
194
+ }
195
+
196
+ // ── Step 5: Sync all vds-scripts packages (ensures subcommand binaries exist) ──
197
+
198
+ if (vdsScriptsDir) {
199
+ log('📂', `vds-scripts: ${vdsScriptsDir}`);
200
+ const uvRunner = join(vdsScriptsDir, 'scripts', 'worktree_uv.sh');
201
+ if (existsSync(uvRunner)) {
202
+ console.log('');
203
+ log('🔄', 'Syncing vds-scripts packages (uv sync --all-packages)...');
204
+ try {
205
+ execSync(`"${uvRunner}" sync --directory "${vdsScriptsDir}" --all-packages`, {
206
+ stdio: 'pipe',
207
+ encoding: 'utf-8',
208
+ timeout: 120000,
209
+ cwd: vdsScriptsDir,
210
+ });
211
+ log('✅', 'All vds-scripts packages synced');
212
+ } catch (e) {
213
+ // Fallback: try direct uv sync
214
+ try {
215
+ execSync('uv sync --all-packages', {
216
+ stdio: 'pipe',
217
+ encoding: 'utf-8',
218
+ timeout: 120000,
219
+ cwd: vdsScriptsDir,
220
+ });
221
+ log('✅', 'All vds-scripts packages synced (direct uv)');
222
+ } catch {
223
+ log('⚠️', 'Failed to sync vds-scripts packages — subcommands like confluence/jira may not work');
224
+ log(' ', `Fix: cd ${vdsScriptsDir} && uv sync --all-packages`);
225
+ }
226
+ }
227
+ }
228
+ } else {
229
+ log('⚠️', 'vds-scripts not found at .claude/vds-scripts/ or ~/.claude/vds-scripts/');
155
230
  }
156
231
 
157
232
  console.log('\n[vds-skill] Setup complete ✅\n');
@@ -19,7 +19,8 @@ Before doing anything, run this check via Bash tool:
19
19
  ```bash
20
20
  source .claude/skills/_shared/vds-skill/credentials.sh 2>/dev/null
21
21
  MISSING=""
22
- command -v vds-cli >/dev/null 2>&1 || MISSING="$MISSING vds-cli"
22
+ { command -v vds-cli >/dev/null 2>&1 || [[ -x .claude/bin/vds-cli ]]; } || MISSING="$MISSING vds-cli"
23
+ [[ -x .claude/bin/vds-cli ]] && export PATH=".claude/bin:$PATH"
23
24
  [[ -z "${VDS_CONFLUENCE_TOKEN:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_TOKEN"
24
25
  [[ -z "${VDS_CONFLUENCE_SPACE_DEFAULT:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_SPACE_DEFAULT"
25
26
  if [[ -n "$MISSING" ]]; then
@@ -19,7 +19,8 @@ Before doing anything, run this check via Bash tool:
19
19
  ```bash
20
20
  source .claude/skills/_shared/vds-skill/credentials.sh 2>/dev/null
21
21
  MISSING=""
22
- command -v vds-cli >/dev/null 2>&1 || MISSING="$MISSING vds-cli"
22
+ { command -v vds-cli >/dev/null 2>&1 || [[ -x .claude/bin/vds-cli ]]; } || MISSING="$MISSING vds-cli"
23
+ [[ -x .claude/bin/vds-cli ]] && export PATH=".claude/bin:$PATH"
23
24
  [[ -z "${VDS_CONFLUENCE_TOKEN:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_TOKEN"
24
25
  [[ -z "${VDS_CONFLUENCE_SPACE_DEFAULT:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_SPACE_DEFAULT"
25
26
  if [[ -n "$MISSING" ]]; then
@@ -14,7 +14,8 @@ Before doing anything, run this check via Bash tool:
14
14
  ```bash
15
15
  source .claude/skills/_shared/vds-skill/credentials.sh 2>/dev/null
16
16
  MISSING=""
17
- command -v vds-cli >/dev/null 2>&1 || MISSING="$MISSING vds-cli"
17
+ { command -v vds-cli >/dev/null 2>&1 || [[ -x .claude/bin/vds-cli ]]; } || MISSING="$MISSING vds-cli"
18
+ [[ -x .claude/bin/vds-cli ]] && export PATH=".claude/bin:$PATH"
18
19
  [[ -z "${VDS_CONFLUENCE_TOKEN:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_TOKEN"
19
20
  [[ -z "${VDS_JIRA_TOKEN:-}" ]] && MISSING="$MISSING VDS_JIRA_TOKEN"
20
21
  [[ -z "${VDS_CONFLUENCE_SPACE_DEFAULT:-}" ]] && MISSING="$MISSING VDS_CONFLUENCE_SPACE_DEFAULT"
@@ -18,7 +18,7 @@ metadata:
18
18
 
19
19
  Use this skill as the **platform-routing entrypoint** for the WHO scripts ecosystem.
20
20
 
21
- The VDS scripts ecosystem lives at `~/.claude/vds-scripts/` (installed via `vsaf global`).
21
+ The VDS scripts ecosystem can be installed at project-level `.claude/vds-scripts/` (preferred) or global `~/.claude/vds-scripts/`.
22
22
 
23
23
  This skill helps you:
24
24
  - find the right `vds-cli` command family
@@ -44,22 +44,24 @@ Do **not** use this skill as the authoritative deep runbook for:
44
44
 
45
45
  ## Canonical Sources
46
46
 
47
- - Scripts workspace: `~/.claude/vds-scripts/`
47
+ - Scripts workspace: `.claude/vds-scripts/` (project-local, preferred) or `~/.claude/vds-scripts/` (global)
48
48
 
49
49
  ## Primary Command Entry Points
50
50
 
51
51
  ```bash
52
- # Via vds-cli (recommended — MCP-registered)
52
+ # Via vds-cli on PATH (recommended — MCP-registered)
53
53
  vds-cli --help
54
54
  vds-cli confluence --help
55
55
  vds-cli jira --help
56
56
  vds-cli bitbucket --help
57
57
  vds-cli git --help
58
58
 
59
- # Direct uv invocation from vds-scripts root
59
+ # Direct uv invocation project-local
60
+ .claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package vds-cli vds-cli --help
61
+ .claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package audit_orchestrator vds-audit --help
62
+
63
+ # Direct uv invocation — global fallback
60
64
  ~/.claude/vds-scripts/scripts/worktree_uv.sh run --directory ~/.claude/vds-scripts --package vds-cli vds-cli --help
61
- ~/.claude/vds-scripts/scripts/worktree_uv.sh run --directory ~/.claude/vds-scripts --package audit_orchestrator vds-audit --help
62
- ~/.claude/vds-scripts/scripts/worktree_uv.sh run --directory ~/.claude/vds-scripts --package spec_orchestrator vds-spec --help
63
65
  ```
64
66
 
65
67
  ## Platform Command Families
@@ -123,5 +125,5 @@ Use these bundled references for depth:
123
125
  ## Notes
124
126
 
125
127
  - Keep this file concise and routing-oriented; push deeper command catalogs into `references/`.
126
- - For integrated `~/.claude/vds-scripts` workspace usage, Python 3.10+ is the preferred baseline.
127
- - After updates, re-run `vsaf global` to sync skills to all agent surfaces.
128
+ - For integrated vds-scripts workspace usage, Python 3.10+ is the preferred baseline.
129
+ - vds-scripts can live at `.claude/vds-scripts/` (project) or `~/.claude/vds-scripts/` (global). Project-local is preferred for portability.
@@ -66,6 +66,6 @@ Interactive monorepo-root usage commonly uses:
66
66
 
67
67
  ```bash
68
68
  vds-cli google-sheets <command>
69
- # Or direct uv invocation:
70
- ~/.claude/vds-scripts/scripts/worktree_uv.sh run --directory ~/.claude/vds-scripts --package vds-cli vds-cli google-sheets <command>
69
+ # Or direct uv invocation (project-local):
70
+ .claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package vds-cli vds-cli google-sheets <command>
71
71
  ```
@@ -2,7 +2,7 @@
2
2
 
3
3
  vds Representative WHO integration command families.
4
4
 
5
- These examples use `vds-cli` (MCP-registered entrypoint). For direct uv invocation, prefer `~/.claude/vds-scripts/scripts/worktree_uv.sh run --directory ~/.claude/vds-scripts --package <uv-package-name> ...`.
5
+ These examples use `vds-cli` (MCP-registered entrypoint). For direct uv invocation, use `.claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package <uv-package-name> ...` (project-local) or `~/.claude/vds-scripts/...` (global fallback).
6
6
 
7
7
  - `vds-cli jira ...`
8
8
  - JQL search example: `vds-cli jira search "project = CBDC ORDER BY updated DESC" --limit 5 --json-only`
@@ -4,18 +4,18 @@ Use this guide when you need to enter the WHO scripts ecosystem and choose the f
4
4
 
5
5
  ## Canonical entrypoints
6
6
 
7
+ vds-scripts can be installed at **project-local** `.claude/vds-scripts/` (preferred) or **global** `~/.claude/vds-scripts/`.
8
+
9
+ - Project-local usage (preferred):
10
+ - `.claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package vds-cli vds-cli --help`
11
+ - `.claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package vds-cli vds-cli env status`
12
+ - `.claude/vds-scripts/scripts/worktree_uv.sh run --directory .claude/vds-scripts --package vds-cli vds-cli doctor`
7
13
  - Interactive monorepo-root usage:
8
14
  - `./WHO-project/vds-scripts/scripts/worktree_uv.sh run --directory WHO-project/vds-scripts --package vds-cli vds-cli --help`
9
- - `./WHO-project/vds-scripts/scripts/worktree_uv.sh run --directory WHO-project/vds-scripts --package vds-cli vds-cli env status`
10
- - `./WHO-project/vds-scripts/scripts/worktree_uv.sh run --directory WHO-project/vds-scripts --package vds-cli vds-cli status`
11
- - `./WHO-project/vds-scripts/scripts/worktree_uv.sh run --directory WHO-project/vds-scripts --package vds-cli vds-cli doctor`
12
15
  - Dedicated `vds-scripts` worktree usage:
13
16
  - `./scripts/worktree_uv.sh run --package vds_cli vds-cli --help`
14
- - `./scripts/worktree_uv.sh run --package vds_cli vds-cli env status`
15
- - `./scripts/worktree_uv.sh run --package vds_cli vds-cli status`
16
- - `./scripts/worktree_uv.sh run --package vds_cli vds-cli doctor`
17
17
  - Maintained shell scripts should not copy those raw forms. They should source `scripts/vds_sh_helpers.sh` and use the helper contract (`vds_uv_run_package`, `vds_uv_sync_package`, `vds_uv_sync_all`).
18
- - Preferred integrated baseline for the `WHO-project/vds-scripts` workspace is Python 3.14+.
18
+ - Preferred integrated baseline is Python 3.10+.
19
19
 
20
20
  ## Common first steps
21
21