@vibe-agent-toolkit/cli 0.1.0-rc.9 → 0.1.1
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 +67 -4
- package/dist/bin/vat.d.ts +13 -2
- package/dist/bin/vat.d.ts.map +1 -1
- package/dist/bin/vat.js +147 -25
- package/dist/bin/vat.js.map +1 -1
- package/dist/bin.js +22 -14
- package/dist/bin.js.map +1 -1
- package/dist/commands/agent/index.d.ts.map +1 -1
- package/dist/commands/agent/index.js +0 -37
- package/dist/commands/agent/index.js.map +1 -1
- package/dist/commands/audit/cache-detector.d.ts +32 -0
- package/dist/commands/audit/cache-detector.d.ts.map +1 -0
- package/dist/commands/audit/cache-detector.js +68 -0
- package/dist/commands/audit/cache-detector.js.map +1 -0
- package/dist/commands/audit/hierarchical-output.d.ts +41 -0
- package/dist/commands/audit/hierarchical-output.d.ts.map +1 -0
- package/dist/commands/audit/hierarchical-output.js +267 -0
- package/dist/commands/audit/hierarchical-output.js.map +1 -0
- package/dist/commands/audit.d.ts +18 -0
- package/dist/commands/audit.d.ts.map +1 -0
- package/dist/commands/audit.js +386 -0
- package/dist/commands/audit.js.map +1 -0
- package/dist/commands/doctor.d.ts +106 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +499 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/resources/index.js +1 -1
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/scan.d.ts.map +1 -1
- package/dist/commands/resources/scan.js +8 -0
- package/dist/commands/resources/scan.js.map +1 -1
- package/dist/utils/config-loader.d.ts +6 -0
- package/dist/utils/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +18 -0
- package/dist/utils/config-loader.js.map +1 -1
- package/docs/audit.md +446 -0
- package/docs/doctor.md +268 -0
- package/docs/index.md +302 -26
- package/package.json +11 -8
- package/dist/commands/agent/audit.d.ts +0 -9
- package/dist/commands/agent/audit.d.ts.map +0 -1
- package/dist/commands/agent/audit.js +0 -139
- package/dist/commands/agent/audit.js.map +0 -1
package/README.md
CHANGED
|
@@ -71,6 +71,69 @@ vat rag clear
|
|
|
71
71
|
- 384-dimensional embeddings
|
|
72
72
|
- No API key required
|
|
73
73
|
|
|
74
|
+
### Doctor Command
|
|
75
|
+
|
|
76
|
+
Diagnose vat setup and environment health.
|
|
77
|
+
|
|
78
|
+
**Usage:**
|
|
79
|
+
```bash
|
|
80
|
+
# Check environment and configuration
|
|
81
|
+
vat doctor
|
|
82
|
+
|
|
83
|
+
# Show all checks (including passing ones)
|
|
84
|
+
vat doctor --verbose
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
**What it checks:**
|
|
88
|
+
- Node.js version (>=20 required)
|
|
89
|
+
- Git installation and repository
|
|
90
|
+
- Configuration file exists and is valid
|
|
91
|
+
- VAT version (checks for updates)
|
|
92
|
+
- CLI build status (in VAT source tree only)
|
|
93
|
+
|
|
94
|
+
**Exit codes:**
|
|
95
|
+
- `0` - All checks passed
|
|
96
|
+
- `1` - One or more checks failed
|
|
97
|
+
|
|
98
|
+
**Example output:**
|
|
99
|
+
```
|
|
100
|
+
🩺 vat doctor
|
|
101
|
+
|
|
102
|
+
Running diagnostic checks...
|
|
103
|
+
|
|
104
|
+
✅ Node.js version
|
|
105
|
+
v22.0.0 (meets requirement: >=20.0.0)
|
|
106
|
+
|
|
107
|
+
✅ Git installed
|
|
108
|
+
git version 2.43.0
|
|
109
|
+
|
|
110
|
+
✅ Git repository
|
|
111
|
+
Current directory is a git repository
|
|
112
|
+
|
|
113
|
+
✅ Configuration file
|
|
114
|
+
Found: vibe-agent-toolkit.config.yaml
|
|
115
|
+
|
|
116
|
+
✅ Configuration valid
|
|
117
|
+
Configuration is valid
|
|
118
|
+
|
|
119
|
+
✅ vat version
|
|
120
|
+
Current: 0.1.0 — up to date
|
|
121
|
+
|
|
122
|
+
📊 Results: 6/6 checks passed
|
|
123
|
+
|
|
124
|
+
✨ All checks passed! Your vat setup looks healthy.
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
**Troubleshooting:**
|
|
128
|
+
|
|
129
|
+
If checks fail, doctor provides specific suggestions:
|
|
130
|
+
|
|
131
|
+
```
|
|
132
|
+
❌ Node.js version
|
|
133
|
+
v18.0.0 is too old. Node.js 20+ required.
|
|
134
|
+
💡 Upgrade Node.js: https://nodejs.org/ or use nvm
|
|
135
|
+
```
|
|
136
|
+
|
|
74
137
|
### Configuration
|
|
75
138
|
|
|
76
139
|
Create `vibe-agent-toolkit.config.yaml` at project root:
|
|
@@ -111,10 +174,10 @@ vat --version # Shows: 0.1.0-dev (/path/to/vibe-agent-toolkit)
|
|
|
111
174
|
# Build
|
|
112
175
|
bun run build
|
|
113
176
|
|
|
114
|
-
# Test
|
|
115
|
-
bun test
|
|
116
|
-
bun test:integration
|
|
117
|
-
bun test:system
|
|
177
|
+
# Test (do NOT use 'bun test' directly)
|
|
178
|
+
bun run test:unit
|
|
179
|
+
bun run test:integration
|
|
180
|
+
bun run test:system
|
|
118
181
|
|
|
119
182
|
# Prepare binaries after build
|
|
120
183
|
bun run prepare-cli-bin
|
package/dist/bin/vat.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Smart wrapper
|
|
4
|
-
*
|
|
3
|
+
* Smart vat wrapper with context-aware execution
|
|
4
|
+
*
|
|
5
|
+
* Automatically detects execution context and delegates to appropriate binary:
|
|
6
|
+
* - Developer mode: Inside vibe-agent-toolkit repo → packages/cli/dist/bin.js (unpackaged dev build)
|
|
7
|
+
* - Local install: Project has vibe-agent-toolkit → node_modules version (packaged)
|
|
8
|
+
* - Global install: Fallback → globally installed version (packaged)
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Version detection and comparison
|
|
12
|
+
* - Debug mode (VAT_DEBUG=1) shows resolution details
|
|
13
|
+
* - Works from any subdirectory within the repo
|
|
14
|
+
*
|
|
15
|
+
* Works in both git and non-git directories.
|
|
5
16
|
*/
|
|
6
17
|
export {};
|
|
7
18
|
//# sourceMappingURL=vat.d.ts.map
|
package/dist/bin/vat.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../src/bin/vat.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"vat.d.ts","sourceRoot":"","sources":["../../src/bin/vat.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG"}
|
package/dist/bin/vat.js
CHANGED
|
@@ -1,10 +1,21 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Smart wrapper
|
|
4
|
-
*
|
|
3
|
+
* Smart vat wrapper with context-aware execution
|
|
4
|
+
*
|
|
5
|
+
* Automatically detects execution context and delegates to appropriate binary:
|
|
6
|
+
* - Developer mode: Inside vibe-agent-toolkit repo → packages/cli/dist/bin.js (unpackaged dev build)
|
|
7
|
+
* - Local install: Project has vibe-agent-toolkit → node_modules version (packaged)
|
|
8
|
+
* - Global install: Fallback → globally installed version (packaged)
|
|
9
|
+
*
|
|
10
|
+
* Features:
|
|
11
|
+
* - Version detection and comparison
|
|
12
|
+
* - Debug mode (VAT_DEBUG=1) shows resolution details
|
|
13
|
+
* - Works from any subdirectory within the repo
|
|
14
|
+
*
|
|
15
|
+
* Works in both git and non-git directories.
|
|
5
16
|
*/
|
|
6
17
|
import { spawnSync } from 'node:child_process';
|
|
7
|
-
import { existsSync } from 'node:fs';
|
|
18
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
8
19
|
import { resolve, dirname, join } from 'node:path';
|
|
9
20
|
import { fileURLToPath } from 'node:url';
|
|
10
21
|
import { findProjectRoot } from '../utils/project-root.js';
|
|
@@ -22,31 +33,142 @@ function spawnCli(binPath, context, contextPath) {
|
|
|
22
33
|
});
|
|
23
34
|
process.exit(result.status ?? 1);
|
|
24
35
|
}
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
36
|
+
/**
|
|
37
|
+
* Check if we're in vibe-agent-toolkit repo (developer mode)
|
|
38
|
+
* Simple detection: both wrapper and bin.js must exist in project structure
|
|
39
|
+
*
|
|
40
|
+
* @param projectRoot - Root directory of the project
|
|
41
|
+
* @returns Path to bin.js if detected, null otherwise
|
|
42
|
+
*/
|
|
43
|
+
function getDevModeBinary(projectRoot) {
|
|
44
|
+
const wrapperPath = join(projectRoot, 'packages/cli/dist/bin/vat.js');
|
|
45
|
+
const binPath = join(projectRoot, 'packages/cli/dist/bin.js');
|
|
46
|
+
if (process.env['VAT_DEBUG'] === '1') {
|
|
47
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- checking project structure files for debug
|
|
48
|
+
console.error(`[vat debug] Dev check - wrapper: ${wrapperPath} (${existsSync(wrapperPath)})`);
|
|
49
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- checking project structure files for debug
|
|
50
|
+
console.error(`[vat debug] Dev check - bin: ${binPath} (${existsSync(binPath)})`);
|
|
51
|
+
}
|
|
52
|
+
// Both files must exist to confirm we're in vibe-agent-toolkit repo
|
|
53
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- checking project structure files
|
|
54
|
+
if (existsSync(wrapperPath) && existsSync(binPath)) {
|
|
55
|
+
return binPath;
|
|
31
56
|
}
|
|
57
|
+
return null;
|
|
32
58
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
59
|
+
/**
|
|
60
|
+
* Find local vibe-agent-toolkit installation in node_modules
|
|
61
|
+
* Walks up directory tree from project root
|
|
62
|
+
*
|
|
63
|
+
* @param projectRoot - Root directory to start searching from
|
|
64
|
+
* @returns Path to local bin.js if found, null otherwise
|
|
65
|
+
*/
|
|
66
|
+
function findLocalInstall(projectRoot) {
|
|
67
|
+
let current = projectRoot;
|
|
68
|
+
while (true) {
|
|
69
|
+
const localBin = join(current, 'node_modules/@vibe-agent-toolkit/cli/dist/bin.js');
|
|
70
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- checking for local install
|
|
71
|
+
if (existsSync(localBin)) {
|
|
72
|
+
return localBin;
|
|
73
|
+
}
|
|
74
|
+
const parent = dirname(current);
|
|
75
|
+
if (parent === current) {
|
|
76
|
+
// Reached filesystem root
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
current = parent;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
39
82
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
83
|
+
/**
|
|
84
|
+
* Read version from package.json
|
|
85
|
+
* @param packageJsonPath - Path to package.json file
|
|
86
|
+
* @returns Version string or null if not found
|
|
87
|
+
*/
|
|
88
|
+
function readVersion(packageJsonPath) {
|
|
89
|
+
try {
|
|
90
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- reading version from package.json
|
|
91
|
+
if (!existsSync(packageJsonPath)) {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- reading version from package.json
|
|
95
|
+
const content = readFileSync(packageJsonPath, 'utf-8');
|
|
96
|
+
const pkg = JSON.parse(content);
|
|
97
|
+
return pkg.version ?? null;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return null;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Main entry point - detects context and executes appropriate binary
|
|
105
|
+
*/
|
|
106
|
+
function main() {
|
|
107
|
+
const cwd = process.cwd();
|
|
108
|
+
const args = process.argv.slice(2);
|
|
109
|
+
const debug = process.env['VAT_DEBUG'] === '1';
|
|
110
|
+
// Priority 1: Explicit override via VAT_ROOT_DIR
|
|
111
|
+
if (process.env['VAT_ROOT_DIR']) {
|
|
112
|
+
const binPath = join(process.env['VAT_ROOT_DIR'], 'packages/cli/dist/bin.js');
|
|
113
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- dynamic path from env is expected
|
|
114
|
+
if (existsSync(binPath)) {
|
|
115
|
+
if (debug) {
|
|
116
|
+
console.error('[vat debug] Using VAT_ROOT_DIR override');
|
|
117
|
+
console.error(`[vat debug] Binary: ${binPath}`);
|
|
118
|
+
}
|
|
119
|
+
spawnCli(binPath, 'dev', process.env['VAT_ROOT_DIR']);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
// Find project root from current working directory
|
|
123
|
+
const projectRoot = findProjectRoot(cwd) ?? cwd;
|
|
124
|
+
let binPath;
|
|
125
|
+
let context;
|
|
126
|
+
let binDir;
|
|
127
|
+
// Priority 2: Check for developer mode (inside vibe-agent-toolkit repo)
|
|
128
|
+
const devBin = getDevModeBinary(projectRoot);
|
|
129
|
+
if (devBin) {
|
|
130
|
+
binPath = devBin;
|
|
131
|
+
context = 'dev';
|
|
132
|
+
binDir = dirname(dirname(devBin)); // packages/cli/dist -> packages/cli
|
|
133
|
+
}
|
|
134
|
+
// Priority 3: Check for local install (node_modules)
|
|
135
|
+
else {
|
|
136
|
+
const localBin = findLocalInstall(projectRoot);
|
|
137
|
+
if (localBin) {
|
|
138
|
+
binPath = localBin;
|
|
139
|
+
context = 'local';
|
|
140
|
+
binDir = dirname(dirname(localBin)); // node_modules/@vibe-agent-toolkit/cli/dist -> node_modules/@vibe-agent-toolkit/cli
|
|
141
|
+
}
|
|
142
|
+
// Priority 4: Use global install (this script's location)
|
|
143
|
+
else {
|
|
144
|
+
binPath = resolve(__dirname, '../bin.js');
|
|
145
|
+
context = 'global';
|
|
146
|
+
binDir = dirname(__dirname); // dist -> cli root
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
// Read versions for comparison
|
|
150
|
+
// __dirname = dist/bin, so go up twice to reach package.json at cli root
|
|
151
|
+
const globalPkgPath = join(dirname(dirname(__dirname)), 'package.json');
|
|
152
|
+
const globalVersion = readVersion(globalPkgPath);
|
|
153
|
+
let localVersion = null;
|
|
154
|
+
if (context === 'local') {
|
|
155
|
+
const localPkgPath = join(binDir, 'package.json');
|
|
156
|
+
localVersion = readVersion(localPkgPath);
|
|
157
|
+
}
|
|
158
|
+
// Debug output
|
|
159
|
+
if (debug) {
|
|
160
|
+
console.error(`[vat debug] CWD: ${cwd}`);
|
|
161
|
+
console.error(`[vat debug] Project root: ${projectRoot}`);
|
|
162
|
+
console.error(`[vat debug] Context: ${context}`);
|
|
163
|
+
console.error(`[vat debug] Binary: ${binPath}`);
|
|
164
|
+
console.error(`[vat debug] Global version: ${globalVersion ?? 'unknown'}`);
|
|
165
|
+
console.error(`[vat debug] Local version: ${localVersion ?? 'N/A'}`);
|
|
166
|
+
console.error(`[vat debug] Args: ${args.join(' ')}`);
|
|
47
167
|
}
|
|
168
|
+
// Execute the binary with all arguments (only pass projectRoot for dev context)
|
|
169
|
+
const contextPath = context === 'dev' ? projectRoot : undefined;
|
|
170
|
+
spawnCli(binPath, context, contextPath);
|
|
48
171
|
}
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
spawnCli(globalBinPath, 'global');
|
|
172
|
+
// Run main function
|
|
173
|
+
main();
|
|
52
174
|
//# sourceMappingURL=vat.js.map
|
package/dist/bin/vat.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vat.js","sourceRoot":"","sources":["../../src/bin/vat.ts"],"names":[],"mappings":";AAEA
|
|
1
|
+
{"version":3,"file":"vat.js","sourceRoot":"","sources":["../../src/bin/vat.ts"],"names":[],"mappings":";AAEA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAA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CAAC,SAAS,CAAC;IAChE,QAAQ,CAAC,OAAO,EAAE,OAAO,EAAE,WAAW,CAAC,CAAC;AAC1C,CAAC;AAED,oBAAoB;AACpB,IAAI,EAAE,CAAC"}
|
package/dist/bin.js
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { Command } from 'commander';
|
|
7
7
|
import { createAgentCommand, showAgentVerboseHelp } from './commands/agent/index.js';
|
|
8
|
+
import { createAuditCommand } from './commands/audit.js';
|
|
9
|
+
import { doctorCommand } from './commands/doctor.js';
|
|
8
10
|
import { createRagCommand, showRagVerboseHelp } from './commands/rag/index.js';
|
|
9
11
|
import { createResourcesCommand, showResourcesVerboseHelp } from './commands/resources/index.js';
|
|
10
12
|
import { loadVerboseHelp } from './utils/help-loader.js';
|
|
@@ -20,10 +22,9 @@ const context = process.env['VAT_CONTEXT']
|
|
|
20
22
|
: null;
|
|
21
23
|
program
|
|
22
24
|
.name('vat')
|
|
23
|
-
.description('
|
|
25
|
+
.description('Agent-friendly toolkit for building, testing, and deploying portable AI agents')
|
|
24
26
|
.version(getVersionString(version, context), '-v, --version', 'Output version number')
|
|
25
27
|
.option('--debug', 'Enable debug logging')
|
|
26
|
-
.option('--verbose', 'Show verbose help (markdown format)')
|
|
27
28
|
.helpCommand(false) // Disable redundant 'help' command, use --help instead
|
|
28
29
|
.showHelpAfterError()
|
|
29
30
|
.configureOutput({
|
|
@@ -32,21 +33,25 @@ program
|
|
|
32
33
|
})
|
|
33
34
|
.addHelpText('after', `
|
|
34
35
|
Example:
|
|
35
|
-
$ vat resources validate docs/ # Validate markdown links
|
|
36
|
+
$ vat resources validate docs/ # Validate markdown links (run before commit)
|
|
37
|
+
|
|
38
|
+
Environment:
|
|
39
|
+
VAT_DEBUG=1 # Show context detection details
|
|
36
40
|
|
|
37
41
|
For command details: vat resources --help
|
|
42
|
+
For comprehensive help: vat --help --verbose
|
|
43
|
+
For agent guidance: docs/cli/CLAUDE.md
|
|
38
44
|
`);
|
|
39
|
-
// Handle --help --verbose at root level
|
|
40
|
-
//
|
|
45
|
+
// Handle --help --verbose at root level before parsing
|
|
46
|
+
// Manually check process.argv since --verbose is not a root-level option
|
|
47
|
+
const hasHelp = process.argv.includes('--help') || process.argv.includes('-h');
|
|
48
|
+
const hasVerbose = process.argv.includes('--verbose');
|
|
41
49
|
const hasSubcommand = process.argv.slice(2).some(arg => !arg.startsWith('-'));
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
process.exit(0);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
+
if (hasHelp && hasVerbose && !hasSubcommand) {
|
|
51
|
+
// Root level: vat --help --verbose
|
|
52
|
+
showVerboseHelp();
|
|
53
|
+
process.exit(0);
|
|
54
|
+
}
|
|
50
55
|
// Special handling for "resources --verbose" before parsing
|
|
51
56
|
if (process.argv.includes('resources') && process.argv.includes('--verbose')) {
|
|
52
57
|
const argv = process.argv.slice(2);
|
|
@@ -83,10 +88,13 @@ if (process.argv.includes('agent') && process.argv.includes('--verbose')) {
|
|
|
83
88
|
process.exit(0);
|
|
84
89
|
}
|
|
85
90
|
}
|
|
86
|
-
// Add command groups
|
|
91
|
+
// Add command groups (audit is common, should be first)
|
|
92
|
+
program.addCommand(createAuditCommand());
|
|
87
93
|
program.addCommand(createResourcesCommand());
|
|
88
94
|
program.addCommand(createRagCommand());
|
|
89
95
|
program.addCommand(createAgentCommand());
|
|
96
|
+
// Add standalone commands
|
|
97
|
+
doctorCommand(program);
|
|
90
98
|
// Handle unknown commands
|
|
91
99
|
program.on('command:*', (operands) => {
|
|
92
100
|
const logger = createLogger();
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAA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C,CAAC;AAEzC,0BAA0B;AAC1B,aAAa,CAAC,OAAO,CAAC,CAAC;AAEvB,0BAA0B;AAC1B,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,QAAQ,EAAE,EAAE;IACnC,MAAM,MAAM,GAAG,YAAY,EAAE,CAAC;IAC9B,MAAM,CAAC,KAAK,CAAC,2BAA2B,QAAQ,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC;IACxD,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACjB,OAAO,CAAC,IAAI,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;AAChC,CAAC,CAAC,CAAC;AAEH,OAAO,CAAC,KAAK,EAAE,CAAC;AAEhB,SAAS,eAAe;IACtB,MAAM,WAAW,GAAG,eAAe,EAAE,CAAC,CAAC,+BAA+B;IACtE,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC;IAClC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAoBpC,wBAAgB,kBAAkB,IAAI,OAAO,CA8Q5C;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* Agent command group
|
|
3
3
|
*/
|
|
4
4
|
import { Command } from 'commander';
|
|
5
|
-
import { auditCommand } from './audit.js';
|
|
6
5
|
import { buildCommand } from './build.js';
|
|
7
6
|
import { importCommand } from './import.js';
|
|
8
7
|
import { installAgent } from './install.js';
|
|
@@ -138,42 +137,6 @@ Examples:
|
|
|
138
137
|
$ vat agent validate agent-generator # Validate by name
|
|
139
138
|
$ vat agent validate ./my-agent # Validate by path
|
|
140
139
|
$ vat agent validate ./agent.yaml # Validate specific file
|
|
141
|
-
`);
|
|
142
|
-
agent
|
|
143
|
-
.command('audit [path]')
|
|
144
|
-
.description('Audit Claude Skills for quality and compatibility')
|
|
145
|
-
.option('-r, --recursive', 'Scan directories recursively for SKILL.md files')
|
|
146
|
-
.option('--debug', DEBUG_OPTION_DESC)
|
|
147
|
-
.action(auditCommand)
|
|
148
|
-
.addHelpText('after', `
|
|
149
|
-
Description:
|
|
150
|
-
Audits Claude Skills (SKILL.md files) for quality, correctness, and
|
|
151
|
-
console compatibility. Validates frontmatter, links, naming conventions,
|
|
152
|
-
and warns about console-incompatible features. Outputs YAML report to
|
|
153
|
-
stdout, errors/warnings to stderr.
|
|
154
|
-
|
|
155
|
-
Path can be: directory, single SKILL.md file, or VAT agent directory
|
|
156
|
-
Default: current directory
|
|
157
|
-
|
|
158
|
-
Validation Checks:
|
|
159
|
-
Errors (must fix):
|
|
160
|
-
- Missing or invalid frontmatter (name, description)
|
|
161
|
-
- Broken links to other files
|
|
162
|
-
- Reserved words in names (anthropic, claude)
|
|
163
|
-
- XML tags in frontmatter fields
|
|
164
|
-
- Windows-style backslashes in paths
|
|
165
|
-
|
|
166
|
-
Warnings (should fix):
|
|
167
|
-
- Skill exceeds recommended length (>5000 lines)
|
|
168
|
-
- References console-incompatible tools (Write, Edit, Bash)
|
|
169
|
-
|
|
170
|
-
Exit Codes:
|
|
171
|
-
0 - Success | 1 - Errors found | 2 - System error
|
|
172
|
-
|
|
173
|
-
Examples:
|
|
174
|
-
$ vat agent audit # Audit current directory
|
|
175
|
-
$ vat agent audit ./my-skill/SKILL.md # Audit single skill
|
|
176
|
-
$ vat agent audit ./skills --recursive # Audit all skills recursively
|
|
177
140
|
`);
|
|
178
141
|
agent
|
|
179
142
|
.command('import <skillPath>')
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/commands/agent/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AACtC,OAAO,EAAE,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAEhD,MAAM,iBAAiB,GAAG,sBAAsB,CAAC;AACjD,MAAM,YAAY,GAAG,iBAAiB,CAAC;AACvC,MAAM,iBAAiB,GAAG,oCAAoC,CAAC;AAC/D,MAAM,aAAa,GAAG,MAAM,CAAC;AAC7B,MAAM,cAAc,GAAG,kBAAkB,CAAC;AAC1C,MAAM,mBAAmB,GAAG,gBAAgB,CAAC;AAC7C,MAAM,eAAe,GAAG,cAAc,CAAC;AACvC,MAAM,aAAa,GAAG,4CAA4C,CAAC;AAEnE,MAAM,UAAU,kBAAkB;IAChC,MAAM,KAAK,GAAG,IAAI,OAAO,CAAC,OAAO,CAAC,CAAC;IAEnC,KAAK;SAC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gBAAgB,CAAC;SACxB,WAAW,CACV,OAAO,EACP;;;;;;;;;;;;;;;;;;;;;CAqBL,CACI,CAAC;IAEJ,OAAO,KAAK,CAAC;AACf,CAAC;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import type { ResourceMetadata } from '@vibe-agent-toolkit/resources';
|
|
2
|
+
export interface CacheStalenessResult {
|
|
3
|
+
fresh: FreshEntry[];
|
|
4
|
+
stale: StaleEntry[];
|
|
5
|
+
cacheOnly: ResourceMetadata[];
|
|
6
|
+
installedOnly: ResourceMetadata[];
|
|
7
|
+
}
|
|
8
|
+
export interface FreshEntry {
|
|
9
|
+
installed: ResourceMetadata;
|
|
10
|
+
cached: ResourceMetadata;
|
|
11
|
+
}
|
|
12
|
+
export interface StaleEntry {
|
|
13
|
+
installed: ResourceMetadata;
|
|
14
|
+
cached: ResourceMetadata;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Detect cache staleness by comparing checksums between installed and cached resources.
|
|
18
|
+
*
|
|
19
|
+
* Compares resources by filename and checksum to determine:
|
|
20
|
+
* - Fresh: Cache and installed have matching checksums
|
|
21
|
+
* - Stale: Cache and installed have different checksums
|
|
22
|
+
* - Cache-only: File exists in cache but not in installed
|
|
23
|
+
* - Installed-only: File exists in installed but not in cache
|
|
24
|
+
*
|
|
25
|
+
* Uses O(1) Map lookups for efficient matching.
|
|
26
|
+
*
|
|
27
|
+
* @param installed - Resources from installed plugin locations
|
|
28
|
+
* @param cached - Resources from ~/.claude/plugins/cache/
|
|
29
|
+
* @returns Categorized comparison results
|
|
30
|
+
*/
|
|
31
|
+
export declare function detectCacheStaleness(installed: ResourceMetadata[], cached: ResourceMetadata[]): CacheStalenessResult;
|
|
32
|
+
//# sourceMappingURL=cache-detector.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-detector.d.ts","sourceRoot":"","sources":["../../../src/commands/audit/cache-detector.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,KAAK,EAAE,UAAU,EAAE,CAAC;IACpB,SAAS,EAAE,gBAAgB,EAAE,CAAC;IAC9B,aAAa,EAAE,gBAAgB,EAAE,CAAC;CACnC;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AAED,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,gBAAgB,CAAC;IAC5B,MAAM,EAAE,gBAAgB,CAAC;CAC1B;AASD;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,oBAAoB,CAClC,SAAS,EAAE,gBAAgB,EAAE,EAC7B,MAAM,EAAE,gBAAgB,EAAE,GACzB,oBAAoB,CAmDtB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
/**
|
|
3
|
+
* Extract filename from file path
|
|
4
|
+
*/
|
|
5
|
+
function getFileName(filePath) {
|
|
6
|
+
return path.basename(filePath);
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Detect cache staleness by comparing checksums between installed and cached resources.
|
|
10
|
+
*
|
|
11
|
+
* Compares resources by filename and checksum to determine:
|
|
12
|
+
* - Fresh: Cache and installed have matching checksums
|
|
13
|
+
* - Stale: Cache and installed have different checksums
|
|
14
|
+
* - Cache-only: File exists in cache but not in installed
|
|
15
|
+
* - Installed-only: File exists in installed but not in cache
|
|
16
|
+
*
|
|
17
|
+
* Uses O(1) Map lookups for efficient matching.
|
|
18
|
+
*
|
|
19
|
+
* @param installed - Resources from installed plugin locations
|
|
20
|
+
* @param cached - Resources from ~/.claude/plugins/cache/
|
|
21
|
+
* @returns Categorized comparison results
|
|
22
|
+
*/
|
|
23
|
+
export function detectCacheStaleness(installed, cached) {
|
|
24
|
+
const fresh = [];
|
|
25
|
+
const stale = [];
|
|
26
|
+
const cacheOnly = [];
|
|
27
|
+
const installedOnly = [];
|
|
28
|
+
// Build index of installed resources by filename for O(1) lookup
|
|
29
|
+
const installedByName = new Map();
|
|
30
|
+
for (const resource of installed) {
|
|
31
|
+
const filename = getFileName(resource.filePath);
|
|
32
|
+
installedByName.set(filename, resource);
|
|
33
|
+
}
|
|
34
|
+
// Check each cached resource
|
|
35
|
+
const matchedInstalledNames = new Set();
|
|
36
|
+
for (const cachedResource of cached) {
|
|
37
|
+
const cachedFilename = getFileName(cachedResource.filePath);
|
|
38
|
+
const installedResource = installedByName.get(cachedFilename);
|
|
39
|
+
if (!installedResource) {
|
|
40
|
+
// Cache file has no corresponding installed file
|
|
41
|
+
cacheOnly.push(cachedResource);
|
|
42
|
+
continue;
|
|
43
|
+
}
|
|
44
|
+
matchedInstalledNames.add(cachedFilename);
|
|
45
|
+
if (cachedResource.checksum === installedResource.checksum) {
|
|
46
|
+
// Checksums match - cache is fresh
|
|
47
|
+
fresh.push({
|
|
48
|
+
installed: installedResource,
|
|
49
|
+
cached: cachedResource,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
// Checksums differ - cache is stale
|
|
54
|
+
stale.push({
|
|
55
|
+
installed: installedResource,
|
|
56
|
+
cached: cachedResource,
|
|
57
|
+
});
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
// Find installed resources with no cache entry
|
|
61
|
+
for (const [name, resource] of installedByName) {
|
|
62
|
+
if (!matchedInstalledNames.has(name)) {
|
|
63
|
+
installedOnly.push(resource);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
return { fresh, stale, cacheOnly, installedOnly };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=cache-detector.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cache-detector.js","sourceRoot":"","sources":["../../../src/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,EAAE,iBAAiB;gBAC5B,MAAM,EAAE,cAAc;aACvB,CAAC,CAAC;QACL,CAAC;aAAM,CAAC;YACN,oCAAoC;YACpC,KAAK,CAAC,IAAI,CAAC;gBACT,SAAS,EAAE,iBAAiB;gBAC5B,MAAM,EAAE,cAAc;aACvB,CAAC,CAAC;QACL,CAAC;IACH,CAAC;IAED,+CAA+C;IAC/C,KAAK,MAAM,CAAC,IAAI,EAAE,QAAQ,CAAC,IAAI,eAAe,EAAE,CAAC;QAC/C,IAAI,CAAC,qBAAqB,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC;YACrC,aAAa,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC/B,CAAC;IACH,CAAC;IAED,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,aAAa,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { ValidationIssue, ValidationResult } from '@vibe-agent-toolkit/runtime-claude-skills';
|
|
2
|
+
export interface HierarchicalOutput {
|
|
3
|
+
marketplaces: MarketplaceGroup[];
|
|
4
|
+
cachedPlugins: PluginGroup[];
|
|
5
|
+
standalonePlugins: PluginGroup[];
|
|
6
|
+
standaloneSkills: SkillEntry[];
|
|
7
|
+
}
|
|
8
|
+
export interface MarketplaceGroup {
|
|
9
|
+
name: string;
|
|
10
|
+
plugins: PluginGroup[];
|
|
11
|
+
}
|
|
12
|
+
export interface PluginGroup {
|
|
13
|
+
name: string;
|
|
14
|
+
skills: SkillEntry[];
|
|
15
|
+
}
|
|
16
|
+
export type CacheStatus = 'stale' | 'orphaned' | 'fresh';
|
|
17
|
+
export interface SkillEntry {
|
|
18
|
+
name: string;
|
|
19
|
+
path: string;
|
|
20
|
+
status: 'success' | 'warning' | 'error';
|
|
21
|
+
issues: ValidationIssue[];
|
|
22
|
+
cacheStatus?: CacheStatus;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Build hierarchical output structure from validation results.
|
|
26
|
+
*
|
|
27
|
+
* Groups skills by:
|
|
28
|
+
* 1. Marketplace -> Plugin -> Skills (for marketplace-installed plugins)
|
|
29
|
+
* 2. Standalone Plugins -> Skills (for non-marketplace plugins)
|
|
30
|
+
* 3. Standalone Skills (for skills without plugins)
|
|
31
|
+
*
|
|
32
|
+
* By default, only includes skills with issues (terse principle).
|
|
33
|
+
* With verbose=true, includes all scanned skills regardless of status.
|
|
34
|
+
* Replaces home directory with ~ for cleaner display.
|
|
35
|
+
*
|
|
36
|
+
* @param results - Validation results from audit command
|
|
37
|
+
* @param verbose - If true, include all results; if false, only show results with issues
|
|
38
|
+
* @returns Hierarchical structure for display
|
|
39
|
+
*/
|
|
40
|
+
export declare function buildHierarchicalOutput(results: ValidationResult[], verbose?: boolean): HierarchicalOutput;
|
|
41
|
+
//# sourceMappingURL=hierarchical-output.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hierarchical-output.d.ts","sourceRoot":"","sources":["../../../src/commands/audit/hierarchical-output.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,2CAA2C,CAAC;AAGnG,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,gBAAgB,EAAE,CAAC;IACjC,aAAa,EAAE,WAAW,EAAE,CAAC;IAC7B,iBAAiB,EAAE,WAAW,EAAE,CAAC;IACjC,gBAAgB,EAAE,UAAU,EAAE,CAAC;CAChC;AAED,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,UAAU,GAAG,OAAO,CAAC;AAEzD,MAAM,WAAW,UAAU;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;IACxC,MAAM,EAAE,eAAe,EAAE,CAAC;IAC1B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B;AA+RD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,gBAAgB,EAAE,EAAE,OAAO,GAAE,OAAe,GAAG,kBAAkB,CAiCjH"}
|