@vibe-agent-toolkit/cli 0.2.0-rc.6 → 0.2.0-rc.7
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 +4 -4
- package/dist/bin.js +41 -158
- package/dist/bin.js.map +1 -1
- package/dist/command-loaders.d.ts +2 -2
- package/dist/command-loaders.d.ts.map +1 -1
- package/dist/command-loaders.js +4 -2
- package/dist/command-loaders.js.map +1 -1
- package/dist/commands/ard/emit.d.ts +104 -0
- package/dist/commands/ard/emit.d.ts.map +1 -0
- package/dist/commands/ard/emit.js +223 -0
- package/dist/commands/ard/emit.js.map +1 -0
- package/dist/commands/ard/index.d.ts +12 -0
- package/dist/commands/ard/index.d.ts.map +1 -0
- package/dist/commands/ard/index.js +79 -0
- package/dist/commands/ard/index.js.map +1 -0
- package/dist/commands/ard/surfaces.d.ts +56 -0
- package/dist/commands/ard/surfaces.d.ts.map +1 -0
- package/dist/commands/ard/surfaces.js +150 -0
- package/dist/commands/ard/surfaces.js.map +1 -0
- package/dist/commands/audit.d.ts +75 -8
- package/dist/commands/audit.d.ts.map +1 -1
- package/dist/commands/audit.js +605 -140
- package/dist/commands/audit.js.map +1 -1
- package/dist/commands/claude/budget.d.ts +13 -0
- package/dist/commands/claude/budget.d.ts.map +1 -1
- package/dist/commands/claude/budget.js +80 -28
- package/dist/commands/claude/budget.js.map +1 -1
- package/dist/commands/claude/context.js +1 -1
- package/dist/commands/claude/context.js.map +1 -1
- package/dist/commands/claude/marketplace/validate.d.ts +55 -22
- package/dist/commands/claude/marketplace/validate.d.ts.map +1 -1
- package/dist/commands/claude/marketplace/validate.js +380 -75
- package/dist/commands/claude/marketplace/validate.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +84 -3
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +218 -46
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/plugin/build.d.ts +8 -0
- package/dist/commands/claude/plugin/build.d.ts.map +1 -1
- package/dist/commands/claude/plugin/build.js +16 -2
- package/dist/commands/claude/plugin/build.js.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.d.ts +72 -0
- package/dist/commands/claude/plugin/tree-copy.d.ts.map +1 -1
- package/dist/commands/claude/plugin/tree-copy.js +215 -10
- package/dist/commands/claude/plugin/tree-copy.js.map +1 -1
- package/dist/commands/corpus/index.d.ts.map +1 -1
- package/dist/commands/corpus/index.js +3 -0
- package/dist/commands/corpus/index.js.map +1 -1
- package/dist/commands/corpus/report.d.ts +0 -1
- package/dist/commands/corpus/report.d.ts.map +1 -1
- package/dist/commands/corpus/report.js +0 -1
- package/dist/commands/corpus/report.js.map +1 -1
- package/dist/commands/corpus/runner.d.ts +58 -1
- package/dist/commands/corpus/runner.d.ts.map +1 -1
- package/dist/commands/corpus/runner.js +90 -15
- package/dist/commands/corpus/runner.js.map +1 -1
- package/dist/commands/corpus/scan.d.ts.map +1 -1
- package/dist/commands/corpus/scan.js +0 -1
- package/dist/commands/corpus/scan.js.map +1 -1
- package/dist/commands/doctor.d.ts +14 -0
- package/dist/commands/doctor.d.ts.map +1 -1
- package/dist/commands/doctor.js +96 -18
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/okf/index.d.ts +11 -0
- package/dist/commands/okf/index.d.ts.map +1 -0
- package/dist/commands/okf/index.js +102 -0
- package/dist/commands/okf/index.js.map +1 -0
- package/dist/commands/okf/validate.d.ts +82 -0
- package/dist/commands/okf/validate.d.ts.map +1 -0
- package/dist/commands/okf/validate.js +157 -0
- package/dist/commands/okf/validate.js.map +1 -0
- package/dist/commands/phase-utils.d.ts +19 -3
- package/dist/commands/phase-utils.d.ts.map +1 -1
- package/dist/commands/phase-utils.js +26 -5
- package/dist/commands/phase-utils.js.map +1 -1
- package/dist/commands/rag/index-command.d.ts +27 -2
- package/dist/commands/rag/index-command.d.ts.map +1 -1
- package/dist/commands/rag/index-command.js +44 -7
- package/dist/commands/rag/index-command.js.map +1 -1
- package/dist/commands/rag/index.d.ts.map +1 -1
- package/dist/commands/rag/index.js +2 -0
- package/dist/commands/rag/index.js.map +1 -1
- package/dist/commands/resources/check-progress.d.ts +3 -0
- package/dist/commands/resources/check-progress.d.ts.map +1 -1
- package/dist/commands/resources/check-progress.js +6 -0
- package/dist/commands/resources/check-progress.js.map +1 -1
- package/dist/commands/resources/check.d.ts +33 -4
- package/dist/commands/resources/check.d.ts.map +1 -1
- package/dist/commands/resources/check.js +131 -44
- package/dist/commands/resources/check.js.map +1 -1
- package/dist/commands/resources/index.d.ts.map +1 -1
- package/dist/commands/resources/index.js +41 -9
- package/dist/commands/resources/index.js.map +1 -1
- package/dist/commands/resources/query.d.ts +18 -1
- package/dist/commands/resources/query.d.ts.map +1 -1
- package/dist/commands/resources/query.js +29 -4
- package/dist/commands/resources/query.js.map +1 -1
- package/dist/commands/resources/validate.d.ts +29 -0
- package/dist/commands/resources/validate.d.ts.map +1 -1
- package/dist/commands/resources/validate.js +116 -13
- package/dist/commands/resources/validate.js.map +1 -1
- package/dist/commands/skill/review.d.ts.map +1 -1
- package/dist/commands/skill/review.js +9 -2
- package/dist/commands/skill/review.js.map +1 -1
- package/dist/commands/skill/test/run.d.ts.map +1 -1
- package/dist/commands/skill/test/run.js +21 -6
- package/dist/commands/skill/test/run.js.map +1 -1
- package/dist/commands/skills/build.d.ts.map +1 -1
- package/dist/commands/skills/build.js +16 -3
- package/dist/commands/skills/build.js.map +1 -1
- package/dist/commands/skills/list.d.ts +2 -1
- package/dist/commands/skills/list.d.ts.map +1 -1
- package/dist/commands/skills/list.js +31 -9
- package/dist/commands/skills/list.js.map +1 -1
- package/dist/commands/skills/skill-discovery.d.ts +40 -1
- package/dist/commands/skills/skill-discovery.d.ts.map +1 -1
- package/dist/commands/skills/skill-discovery.js +32 -3
- package/dist/commands/skills/skill-discovery.js.map +1 -1
- package/dist/commands/skills/validate-command.d.ts.map +1 -1
- package/dist/commands/skills/validate-command.js +11 -3
- package/dist/commands/skills/validate-command.js.map +1 -1
- package/dist/commands/skills/validate.d.ts +66 -7
- package/dist/commands/skills/validate.d.ts.map +1 -1
- package/dist/commands/skills/validate.js +133 -29
- package/dist/commands/skills/validate.js.map +1 -1
- package/dist/commands/verify.d.ts +94 -3
- package/dist/commands/verify.d.ts.map +1 -1
- package/dist/commands/verify.js +192 -45
- package/dist/commands/verify.js.map +1 -1
- package/dist/skill-resolution/packaging-config.d.ts +49 -5
- package/dist/skill-resolution/packaging-config.d.ts.map +1 -1
- package/dist/skill-resolution/packaging-config.js +59 -19
- package/dist/skill-resolution/packaging-config.js.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.d.ts.map +1 -1
- package/dist/skill-resolution/resolve-skill-reference.js +6 -3
- package/dist/skill-resolution/resolve-skill-reference.js.map +1 -1
- package/dist/utils/command-error.d.ts +31 -0
- package/dist/utils/command-error.d.ts.map +1 -1
- package/dist/utils/command-error.js +45 -0
- package/dist/utils/command-error.js.map +1 -1
- package/dist/utils/edge-lens-evaluation.d.ts +83 -0
- package/dist/utils/edge-lens-evaluation.d.ts.map +1 -0
- package/dist/utils/edge-lens-evaluation.js +110 -0
- package/dist/utils/edge-lens-evaluation.js.map +1 -0
- package/dist/utils/optional-backend.d.ts +5 -4
- package/dist/utils/optional-backend.d.ts.map +1 -1
- package/dist/utils/optional-backend.js +5 -4
- package/dist/utils/optional-backend.js.map +1 -1
- package/dist/utils/project-root-policy.d.ts +20 -0
- package/dist/utils/project-root-policy.d.ts.map +1 -1
- package/dist/utils/project-root-policy.js +32 -0
- package/dist/utils/project-root-policy.js.map +1 -1
- package/dist/utils/projection-query.d.ts +41 -4
- package/dist/utils/projection-query.d.ts.map +1 -1
- package/dist/utils/projection-query.js +44 -10
- package/dist/utils/projection-query.js.map +1 -1
- package/dist/utils/projection-store.d.ts +41 -15
- package/dist/utils/projection-store.d.ts.map +1 -1
- package/dist/utils/projection-store.js +65 -18
- package/dist/utils/projection-store.js.map +1 -1
- package/dist/utils/repeatable-option.d.ts +37 -0
- package/dist/utils/repeatable-option.d.ts.map +1 -0
- package/dist/utils/repeatable-option.js +39 -0
- package/dist/utils/repeatable-option.js.map +1 -0
- package/dist/utils/resource-loader.d.ts +4 -3
- package/dist/utils/resource-loader.d.ts.map +1 -1
- package/dist/utils/resource-loader.js +61 -30
- package/dist/utils/resource-loader.js.map +1 -1
- package/dist/utils/root-argv.d.ts +53 -0
- package/dist/utils/root-argv.d.ts.map +1 -0
- package/dist/utils/root-argv.js +215 -0
- package/dist/utils/root-argv.js.map +1 -0
- package/dist/utils/run-integrity.d.ts +95 -0
- package/dist/utils/run-integrity.d.ts.map +1 -0
- package/dist/utils/run-integrity.js +102 -0
- package/dist/utils/run-integrity.js.map +1 -0
- package/dist/utils/sqlite-experimental-warning.d.ts +69 -0
- package/dist/utils/sqlite-experimental-warning.d.ts.map +1 -0
- package/dist/utils/sqlite-experimental-warning.js +144 -0
- package/dist/utils/sqlite-experimental-warning.js.map +1 -0
- package/dist/utils/user-context-scanner.d.ts +8 -0
- package/dist/utils/user-context-scanner.d.ts.map +1 -1
- package/dist/utils/user-context-scanner.js +4 -0
- package/dist/utils/user-context-scanner.js.map +1 -1
- package/dist/utils/validate-help-files.d.ts.map +1 -1
- package/dist/utils/validate-help-files.js +9 -2
- package/dist/utils/validate-help-files.js.map +1 -1
- package/docs/audit.md +120 -7
- package/docs/doctor.md +6 -6
- package/docs/index.md +1 -1
- package/docs/rag.md +3 -1
- package/docs/resources.md +5 -1
- package/docs/skills.md +47 -62
- package/package.json +18 -18
package/README.md
CHANGED
|
@@ -85,7 +85,7 @@ vat doctor --verbose
|
|
|
85
85
|
```
|
|
86
86
|
|
|
87
87
|
**What it checks:**
|
|
88
|
-
- Node.js version (>=
|
|
88
|
+
- Node.js version (>=22.13.0 required — the range comes from the CLI's own `engines.node`)
|
|
89
89
|
- Git installation and repository
|
|
90
90
|
- Configuration file exists and is valid
|
|
91
91
|
- VAT version (checks for updates)
|
|
@@ -103,7 +103,7 @@ report and states how many it hid):
|
|
|
103
103
|
Running diagnostic checks...
|
|
104
104
|
|
|
105
105
|
✅ Node.js version
|
|
106
|
-
v22.
|
|
106
|
+
v22.13.0 (meets requirement: >=22.13.0)
|
|
107
107
|
|
|
108
108
|
✅ Git installed
|
|
109
109
|
git version 2.43.0
|
|
@@ -131,8 +131,8 @@ If checks fail, doctor provides specific suggestions:
|
|
|
131
131
|
|
|
132
132
|
```
|
|
133
133
|
❌ Node.js version
|
|
134
|
-
|
|
135
|
-
💡
|
|
134
|
+
v22.4.0 does not satisfy the required range. Node.js >=22.13.0 required.
|
|
135
|
+
💡 Install a Node.js version in that range: https://nodejs.org/ or use nvm
|
|
136
136
|
```
|
|
137
137
|
|
|
138
138
|
### Configuration
|
package/dist/bin.js
CHANGED
|
@@ -11,6 +11,7 @@ import { registerCacheControl } from './commands/cache/cache-control.js';
|
|
|
11
11
|
import { exitCodeForCommanderEnding } from './utils/command-error.js';
|
|
12
12
|
import { loadVerboseHelp, writeHelpSync } from './utils/help-loader.js';
|
|
13
13
|
import { createLogger } from './utils/logger.js';
|
|
14
|
+
import { createRootArgvGrammar } from './utils/root-argv.js';
|
|
14
15
|
import { version, getVersionString } from './version.js';
|
|
15
16
|
// Before ANY output: a piped stdio is non-blocking, and every command here exits
|
|
16
17
|
// the moment it finishes, so unflushed bytes would be discarded. See output.ts.
|
|
@@ -93,171 +94,53 @@ program.hook('preAction', () => {
|
|
|
93
94
|
process.chdir(safePath.resolve(cwd));
|
|
94
95
|
}
|
|
95
96
|
});
|
|
96
|
-
// Handle --help --verbose at root level before parsing
|
|
97
|
-
// Manually check process.argv since --verbose is not a root-level option
|
|
98
|
-
const hasHelp = process.argv.includes('--help') || process.argv.includes('-h');
|
|
99
|
-
const hasVerbose = process.argv.includes('--verbose');
|
|
100
|
-
const hasSubcommand = process.argv.slice(2).some(arg => !arg.startsWith('-'));
|
|
101
|
-
if (hasHelp && hasVerbose && !hasSubcommand) {
|
|
102
|
-
// Root level: vat --help --verbose
|
|
103
|
-
showVerboseHelp();
|
|
104
|
-
process.exit(0);
|
|
105
|
-
}
|
|
106
|
-
// Special handling for "resources --verbose" before parsing
|
|
107
|
-
if (process.argv.includes('resources') && process.argv.includes('--verbose')) {
|
|
108
|
-
const argv = process.argv.slice(2);
|
|
109
|
-
const resourcesIndex = argv.indexOf('resources');
|
|
110
|
-
// Check if there's no subcommand after 'resources'
|
|
111
|
-
const afterResources = argv.slice(resourcesIndex + 1);
|
|
112
|
-
const hasSubcommand = afterResources.some(arg => !arg.startsWith('-'));
|
|
113
|
-
if (!hasSubcommand) {
|
|
114
|
-
(await import('./commands/resources/index.js')).showResourcesVerboseHelp();
|
|
115
|
-
process.exit(0);
|
|
116
|
-
}
|
|
117
|
-
}
|
|
118
|
-
// Special handling for "rag --verbose" before parsing
|
|
119
|
-
if (process.argv.includes('rag') && process.argv.includes('--verbose')) {
|
|
120
|
-
const argv = process.argv.slice(2);
|
|
121
|
-
const ragIndex = argv.indexOf('rag');
|
|
122
|
-
// Check if there's no subcommand after 'rag'
|
|
123
|
-
const afterRag = argv.slice(ragIndex + 1);
|
|
124
|
-
const hasSubcommand = afterRag.some(arg => !arg.startsWith('-'));
|
|
125
|
-
if (!hasSubcommand) {
|
|
126
|
-
(await import('./commands/rag/index.js')).showRagVerboseHelp();
|
|
127
|
-
process.exit(0);
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
// Special handling for "agent --verbose" before parsing
|
|
131
|
-
if (process.argv.includes('agent') && process.argv.includes('--verbose')) {
|
|
132
|
-
const argv = process.argv.slice(2);
|
|
133
|
-
const agentIndex = argv.indexOf('agent');
|
|
134
|
-
// Check if there's no subcommand after 'agent'
|
|
135
|
-
const afterAgent = argv.slice(agentIndex + 1);
|
|
136
|
-
const hasSubcommand = afterAgent.some(arg => !arg.startsWith('-'));
|
|
137
|
-
if (!hasSubcommand) {
|
|
138
|
-
(await import('./commands/agent/index.js')).showAgentVerboseHelp();
|
|
139
|
-
process.exit(0);
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
/** Registers `doctor`, which attaches itself to the program rather than being added. */
|
|
143
|
-
const loadDoctor = async () => (await import('./commands/doctor.js')).doctorCommand(program);
|
|
144
97
|
/**
|
|
145
|
-
*
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
* Read off commander's own declarations rather than hardcoded, because the
|
|
149
|
-
* blast radius grows with every future root option. Today that is `--version`,
|
|
150
|
-
* `--cwd <dir>`, `--debug` and `--no-cache`; only `--cwd` takes a value.
|
|
98
|
+
* The argv this program was given, and the grammar every pre-parse decision
|
|
99
|
+
* below reads it through.
|
|
151
100
|
*
|
|
152
|
-
*
|
|
153
|
-
* which
|
|
154
|
-
*
|
|
155
|
-
*
|
|
156
|
-
* perf regression with no failing test to announce it.
|
|
157
|
-
*
|
|
158
|
-
* Note what is deliberately NOT synthesised here: a `--no-x` twin for boolean
|
|
159
|
-
* options, and a positive `--cache` twin for `--no-cache`. Commander matches an
|
|
160
|
-
* option by exact string (`Option.is()` is `short === arg || long === arg`), so
|
|
161
|
-
* `--no-debug` and `--cache` are UNKNOWN options that end the parse in an
|
|
162
|
-
* error. Accepting them here would re-create the very bug this scan exists to
|
|
163
|
-
* avoid: a token commander rejects, treated by us as an ordinary flag to skip.
|
|
101
|
+
* ⚠️ Built HERE, and not earlier: `createRootArgvGrammar` reads
|
|
102
|
+
* `program.options`, which only holds `--no-cache` after
|
|
103
|
+
* `registerCacheControl(program)` above. See that function for what a
|
|
104
|
+
* prematurely-built grammar silently costs.
|
|
164
105
|
*/
|
|
165
|
-
const
|
|
166
|
-
const
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
valueTakingRootFlags.add(flag);
|
|
173
|
-
};
|
|
174
|
-
for (const option of program.options) {
|
|
175
|
-
const takesValue = Boolean(option.required || option.optional);
|
|
176
|
-
declareRootFlag(option.short, takesValue);
|
|
177
|
-
declareRootFlag(option.long, takesValue);
|
|
178
|
-
}
|
|
179
|
-
/**
|
|
180
|
-
* Classify an option-shaped token against what this program declares.
|
|
181
|
-
*
|
|
182
|
-
* The `--flag=value` case is not just "strip the suffix": commander only
|
|
183
|
-
* accepts the inline form for a VALUE-TAKING option — its `--foo=bar` branch
|
|
184
|
-
* requires `option.required || option.optional` — so `--debug=1` is an unknown
|
|
185
|
-
* option even though `--debug` is declared.
|
|
186
|
-
*
|
|
187
|
-
* Anything unrecognised is reported as `undeclared` rather than guessed at.
|
|
188
|
-
* The cost of being wrong is asymmetric: a false `undeclared` only forfeits the
|
|
189
|
-
* lazy-load saving, while a false "declared" ships a wrong help page at exit 0.
|
|
190
|
-
*/
|
|
191
|
-
function classifyOptionToken(arg) {
|
|
192
|
-
const equalsIndex = arg.indexOf('=');
|
|
193
|
-
if (equalsIndex !== -1) {
|
|
194
|
-
return valueTakingRootFlags.has(arg.slice(0, equalsIndex)) ? 'self-contained' : 'undeclared';
|
|
195
|
-
}
|
|
196
|
-
if (!declaredRootFlags.has(arg))
|
|
197
|
-
return 'undeclared';
|
|
198
|
-
return valueTakingRootFlags.has(arg) ? 'consumes-next' : 'self-contained';
|
|
106
|
+
const argv = process.argv.slice(2);
|
|
107
|
+
const rootArgv = createRootArgvGrammar(program.options);
|
|
108
|
+
// `--verbose` is not a commander option anywhere — it selects a hand-written
|
|
109
|
+
// help page — so these four checks run before parsing.
|
|
110
|
+
if (rootArgv.wantsRootVerboseHelp(argv)) {
|
|
111
|
+
showVerboseHelp();
|
|
112
|
+
process.exit(0);
|
|
199
113
|
}
|
|
200
114
|
/**
|
|
201
|
-
* The command
|
|
202
|
-
* is needed (or nothing is).
|
|
203
|
-
*
|
|
204
|
-
* This must model commander's grammar, not just "the first token without a
|
|
205
|
-
* dash". Two ways a naive scan got it wrong, both shipped and both verified:
|
|
206
|
-
*
|
|
207
|
-
* - **An option's VALUE is not a verb.** `--cwd <dir>` takes a value that does
|
|
208
|
-
* not start with `-`, so `vat --cwd skills validate` picked `skills`,
|
|
209
|
-
* registered only that, and left `validate` unregistered — while
|
|
210
|
-
* `vat --cwd skills validate --help` printed ROOT help and exited **0**.
|
|
211
|
-
* Only the space-separated form was affected; `--cwd=skills` carries its
|
|
212
|
-
* value inline. The advertised `vat --cwd <dir> build` also lost the entire
|
|
213
|
-
* startup saving, since a non-colliding directory matched no loader key and
|
|
214
|
-
* fell through to loading everything.
|
|
215
|
-
* - **`--help` BEFORE the verb renders ROOT help**, which has to list every
|
|
216
|
-
* command. Loading only the named one made `vat --help audit` print a help
|
|
217
|
-
* page claiming the CLI has exactly one command, and exit 0. `vat audit
|
|
218
|
-
* --help` is the other order and returns on the verb before reaching the
|
|
219
|
-
* flag, so it still loads just `audit`.
|
|
220
|
-
* - **An UNDECLARED option is not a flag to skip over.** `--help` is only the
|
|
221
|
-
* most visible member of that class — it is not in `program.options` either,
|
|
222
|
-
* which is exactly why the bail-out above works. Commander's `parseOptions`
|
|
223
|
-
* switches its destination to `unknown` at the FIRST unrecognised
|
|
224
|
-
* option-shaped token and never switches back, so the verb after it never
|
|
225
|
-
* reaches `operands`; the run ends in `unknownOption()` +
|
|
226
|
-
* `showHelpAfterError()`, i.e. ROOT help. `vat --verbose audit` therefore
|
|
227
|
-
* printed an error page listing exactly one command. Every undeclared option
|
|
228
|
-
* gets the `--help` treatment for that reason.
|
|
229
|
-
* - **A lone `-` is an OPERAND, not an option.** Commander's `maybeOption`
|
|
230
|
-
* requires `arg.length > 1`, so `-` lands in `operands` and reaches the
|
|
231
|
-
* `command:*` handler as an unknown command — which again renders root help.
|
|
232
|
-
* Falling through to the operand return below hands `-` to the dispatcher,
|
|
233
|
-
* where it matches no loader key and the whole tree loads.
|
|
115
|
+
* The command groups whose `--verbose` help page is a hand-written document.
|
|
234
116
|
*
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
-
*
|
|
238
|
-
* behaviourally correct — the scan only ever trades away startup time.
|
|
117
|
+
* A table rather than three near-identical blocks: they diverged once already
|
|
118
|
+
* (see `wantsGroupVerboseHelp`), and the loader stays inside the arrow so the
|
|
119
|
+
* group's module is imported only when that group is the one being asked about.
|
|
239
120
|
*/
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
121
|
+
const VERBOSE_HELP_GROUPS = [
|
|
122
|
+
{
|
|
123
|
+
group: 'resources',
|
|
124
|
+
show: async () => (await import('./commands/resources/index.js')).showResourcesVerboseHelp(),
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
group: 'rag',
|
|
128
|
+
show: async () => (await import('./commands/rag/index.js')).showRagVerboseHelp(),
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
group: 'agent',
|
|
132
|
+
show: async () => (await import('./commands/agent/index.js')).showAgentVerboseHelp(),
|
|
133
|
+
},
|
|
134
|
+
];
|
|
135
|
+
for (const { group, show } of VERBOSE_HELP_GROUPS) {
|
|
136
|
+
if (rootArgv.wantsGroupVerboseHelp(argv, group)) {
|
|
137
|
+
await show();
|
|
138
|
+
process.exit(0);
|
|
257
139
|
}
|
|
258
|
-
return undefined;
|
|
259
140
|
}
|
|
260
|
-
|
|
141
|
+
/** Registers `doctor`, which attaches itself to the program rather than being added. */
|
|
142
|
+
const loadDoctor = async () => (await import('./commands/doctor.js')).doctorCommand(program);
|
|
143
|
+
const requestedCommand = rootArgv.requestedCommand(argv);
|
|
261
144
|
/**
|
|
262
145
|
* Whether this invocation is answerable without any command module.
|
|
263
146
|
*
|
|
@@ -271,8 +154,8 @@ const requestedCommand = readRequestedCommand(process.argv.slice(2));
|
|
|
271
154
|
* has no subcommands.
|
|
272
155
|
*/
|
|
273
156
|
const versionOnly = requestedCommand === undefined
|
|
274
|
-
&&
|
|
275
|
-
&&
|
|
157
|
+
&& argv.length > 0
|
|
158
|
+
&& argv.every(arg => arg === '--version');
|
|
276
159
|
if (requestedCommand === 'doctor') {
|
|
277
160
|
await loadDoctor();
|
|
278
161
|
}
|
package/dist/bin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bin.js","sourceRoot":"","sources":["../src/bin.ts"],"names":[],"mappings":";AAEA;;;GAGG;AAGH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,qBAAqB,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAC7F,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAEpD,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AACzE,OAAO,EAAE,0BAA0B,EAAE,MAAM,0BAA0B,CAAC;AACtE,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,OAAO,EAAE,gBAAgB,EAAuB,MAAM,cAAc,CAAC;AAE9E,iFAAiF;AACjF,gFAAgF;AAChF,MAAM,aAAa,GAAG,iBAAiB,EAAE,CAAC;AAE1C,gFAAgF;AAChF,iFAAiF;AACjF,6EAA6E;AAC7E,8EAA8E;AAC9E,2DAA2D;AAC3D,IAAI,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,EAAE,CAAC;IACrC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,qBAAqB,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;AAC5E,CAAC;AAED,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,qCAAqC;AACrC,MAAM,OAAO,GAA0B,OAAO,CAAC,GAAG,CAAC,aAAa,CAAC;IAC/D,CAAC,CAAE;QACC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K,EAAE,CAAC;IACf,4EAA4E;IAC5E,sEAAsE;IACtE,4EAA4E;IAC5E,kDAAkD;IAClD,IAAI,CAAC,CAAC,KAAK,YAAY,cAAc,CAAC;QAAE,MAAM,KAAK,CAAC;IACpD,OAAO,CAAC,IAAI,CAAC,0BAA0B,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC3D,CAAC;AAED,SAAS,eAAe;IACtB,aAAa,CAAC,eAAe,EAAE,CAAC,CAAC,CAAC,wCAAwC;AAC5E,CAAC"}
|
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Each one transitively pulls `@vibe-agent-toolkit/resources` (~1.6s of module
|
|
7
7
|
* load on Windows, dominated by the markdown toolchain), so importing all
|
|
8
|
-
*
|
|
8
|
+
* sixteen made every invocation — `vat --version` included — pay for the whole
|
|
9
9
|
* CLI surface. Only the command named on the command line is loaded.
|
|
10
10
|
*
|
|
11
11
|
* ## Why `doctor` is not in the table
|
|
12
12
|
*
|
|
13
|
-
* It is the
|
|
13
|
+
* It is the seventeenth top-level command and the only one outside this table, on
|
|
14
14
|
* purpose. `doctorCommand(program)` registers itself ONTO the program instead of
|
|
15
15
|
* returning a `Command`, so it does not fit the `() => Promise<Command>` shape —
|
|
16
16
|
* `bin.ts` special-cases it — and it is the command that READS this table, in
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-loaders.d.ts","sourceRoot":"","sources":["../src/command-loaders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,
|
|
1
|
+
{"version":3,"file":"command-loaders.d.ts","sourceRoot":"","sources":["../src/command-loaders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAiBlE,CAAC"}
|
package/dist/command-loaders.js
CHANGED
|
@@ -5,12 +5,12 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Each one transitively pulls `@vibe-agent-toolkit/resources` (~1.6s of module
|
|
7
7
|
* load on Windows, dominated by the markdown toolchain), so importing all
|
|
8
|
-
*
|
|
8
|
+
* sixteen made every invocation — `vat --version` included — pay for the whole
|
|
9
9
|
* CLI surface. Only the command named on the command line is loaded.
|
|
10
10
|
*
|
|
11
11
|
* ## Why `doctor` is not in the table
|
|
12
12
|
*
|
|
13
|
-
* It is the
|
|
13
|
+
* It is the seventeenth top-level command and the only one outside this table, on
|
|
14
14
|
* purpose. `doctorCommand(program)` registers itself ONTO the program instead of
|
|
15
15
|
* returning a `Command`, so it does not fit the `() => Promise<Command>` shape —
|
|
16
16
|
* `bin.ts` special-cases it — and it is the command that READS this table, in
|
|
@@ -54,5 +54,7 @@ export const COMMAND_LOADERS = {
|
|
|
54
54
|
build: async () => (await import('./commands/build.js')).createBuildTopLevelCommand(),
|
|
55
55
|
validate: async () => (await import('./commands/validate.js')).createValidateTopLevelCommand(),
|
|
56
56
|
verify: async () => (await import('./commands/verify.js')).createVerifyTopLevelCommand(),
|
|
57
|
+
okf: async () => (await import('./commands/okf/index.js')).createOkfCommand(),
|
|
58
|
+
ard: async () => (await import('./commands/ard/index.js')).createArdCommand(),
|
|
57
59
|
};
|
|
58
60
|
//# sourceMappingURL=command-loaders.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-loaders.js","sourceRoot":"","sources":["../src/command-loaders.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG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AC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,EAAE;IAC7E,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC,CAAC,mBAAmB,EAAE;IACtF,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,kBAAkB,EAAE;IACnF,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,4BAA4B,CAAC,CAAC,CAAC,mBAAmB,EAAE;IACtF,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,2BAA2B,CAAC,CAAC,CAAC,kBAAkB,EAAE;IACnF,KAAK,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,qBAAqB,CAAC,CAAC,CAAC,0BAA0B,EAAE;IACrF,QAAQ,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,wBAAwB,CAAC,CAAC,CAAC,6BAA6B,EAAE;IAC9F,MAAM,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,2BAA2B,EAAE;IACxF,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,EAAE;IAC7E,GAAG,EAAE,KAAK,IAAI,EAAE,CAAC,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC,CAAC,gBAAgB,EAAE;CAC9E,CAAC"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `vat ard emit` — write the project's `/.well-known/ard.json`.
|
|
3
|
+
*
|
|
4
|
+
* **Emit, never depend.** This command produces a document and stops. Nothing
|
|
5
|
+
* in VAT reads one back, and no VAT behaviour is derived from one — ARD is
|
|
6
|
+
* v0.91, status Proposal, and wiring internals to a moving shape is the cost
|
|
7
|
+
* this rule avoids.
|
|
8
|
+
*/
|
|
9
|
+
import { type ShadowedArdOverrideKey } from '@vibe-agent-toolkit/resources';
|
|
10
|
+
import { type SkippedArdSurface } from './surfaces.js';
|
|
11
|
+
/** Default destination, relative to the project root — the path ARD publishes at. */
|
|
12
|
+
export declare const DEFAULT_ARD_OUTPUT = ".well-known/ard.json";
|
|
13
|
+
/**
|
|
14
|
+
* Which of the three absences stopped the run.
|
|
15
|
+
*
|
|
16
|
+
* 🚨 `loadConfig` returns `undefined` for both "that directory does not exist"
|
|
17
|
+
* and "that directory has no config file", and the command used to report the
|
|
18
|
+
* third case for all of them: `--project-root /nope/nothing/here` answered "No
|
|
19
|
+
* `ard:` configuration found … Add an `ard:` block to
|
|
20
|
+
* vibe-agent-toolkit.config.yaml", prescribing an edit to a file in a directory
|
|
21
|
+
* that does not exist. Only a `stat` can tell them apart, so the command does
|
|
22
|
+
* one rather than inferring from a shared `undefined`.
|
|
23
|
+
*
|
|
24
|
+
* The distinction is also what the exit code reads: the first two are system
|
|
25
|
+
* errors (exit 2, as `vat okf validate` documents for the same conditions), the
|
|
26
|
+
* third is a project that never opted in (exit 1).
|
|
27
|
+
*/
|
|
28
|
+
export type ArdConfigAbsence = 'no-project-root' | 'no-config-file' | 'no-ard-block';
|
|
29
|
+
/** No manifest could be built, and this says which absence caused it. */
|
|
30
|
+
export declare class ArdConfigMissingError extends Error {
|
|
31
|
+
readonly projectRoot: string;
|
|
32
|
+
readonly absence: ArdConfigAbsence;
|
|
33
|
+
constructor(projectRoot: string, absence: ArdConfigAbsence);
|
|
34
|
+
}
|
|
35
|
+
export interface ArdEmitOptions {
|
|
36
|
+
/** Project root to read the config from (default: cwd). */
|
|
37
|
+
projectRoot?: string | undefined;
|
|
38
|
+
/** Destination path, absolute or relative to the project root. */
|
|
39
|
+
output?: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* How the run reports itself: a human line (default) or {@link ArdEmitReport}.
|
|
42
|
+
*
|
|
43
|
+
* `text` is the default because it is what the command already wrote, and
|
|
44
|
+
* this lane's stdout is a published contract.
|
|
45
|
+
*/
|
|
46
|
+
format?: 'text' | 'json' | undefined;
|
|
47
|
+
/** Fail the run when it advertises nothing, or skipped a configured surface. */
|
|
48
|
+
strict?: boolean | undefined;
|
|
49
|
+
debug?: boolean | undefined;
|
|
50
|
+
}
|
|
51
|
+
export interface ArdEmitResult {
|
|
52
|
+
readonly outputPath: string;
|
|
53
|
+
readonly entryCount: number;
|
|
54
|
+
readonly skipped: readonly SkippedArdSurface[];
|
|
55
|
+
/**
|
|
56
|
+
* Bare `ard.entries` keys a qualified key for the same surface outranked.
|
|
57
|
+
*
|
|
58
|
+
* Not a failure — the precedence is deterministic and documented — but the
|
|
59
|
+
* losing block is dead config, and an author cannot see that from the file.
|
|
60
|
+
*/
|
|
61
|
+
readonly shadowed: readonly ShadowedArdOverrideKey[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Build and write the manifest.
|
|
65
|
+
*
|
|
66
|
+
* @throws {ArdConfigMissingError} when no config, or no `ard:` block, is found.
|
|
67
|
+
* @throws {ArdDerivationError} when a surface cannot be turned into a
|
|
68
|
+
* conformant entry — a missing `ard.baseUrl`, an unusable URN segment, or a
|
|
69
|
+
* trust identity that does not align with the publisher.
|
|
70
|
+
*/
|
|
71
|
+
export declare function runArdEmit(options: ArdEmitOptions): Promise<ArdEmitResult>;
|
|
72
|
+
/**
|
|
73
|
+
* Whether the manifest this run wrote advertises anything at all.
|
|
74
|
+
*
|
|
75
|
+
* `empty` is a separate word for the same reason `vat okf validate` spells
|
|
76
|
+
* `no-bundles` rather than `passed`: a run that wrote `{"entries":[]}` and one
|
|
77
|
+
* that wrote a full catalogue both ended at exit 0 with a cheerful line on
|
|
78
|
+
* stdout, and nothing a machine could read told them apart. A CI step that
|
|
79
|
+
* emits and publishes was therefore green over a discovery document advertising
|
|
80
|
+
* nothing.
|
|
81
|
+
*/
|
|
82
|
+
export type ArdEmitStatus = 'written' | 'empty';
|
|
83
|
+
/** The document `--format json` publishes. */
|
|
84
|
+
export interface ArdEmitReport {
|
|
85
|
+
readonly status: ArdEmitStatus;
|
|
86
|
+
readonly outputPath: string;
|
|
87
|
+
readonly entryCount: number;
|
|
88
|
+
/**
|
|
89
|
+
* Counts BESIDE the lists, as `vat okf validate` publishes `issueCounts`.
|
|
90
|
+
*
|
|
91
|
+
* The count is what a CI step gates on without a JSON path into an array;
|
|
92
|
+
* the list is what the human it pages then acts on. Publishing only one of
|
|
93
|
+
* them answers "how many" or "which", never both.
|
|
94
|
+
*/
|
|
95
|
+
readonly skippedCount: number;
|
|
96
|
+
readonly shadowedCount: number;
|
|
97
|
+
readonly skipped: readonly SkippedArdSurface[];
|
|
98
|
+
readonly shadowed: readonly ShadowedArdOverrideKey[];
|
|
99
|
+
}
|
|
100
|
+
/** Pure: the report a result becomes, so the status rule is unit-testable. */
|
|
101
|
+
export declare function buildArdEmitReport(result: ArdEmitResult): ArdEmitReport;
|
|
102
|
+
/** Action handler for `vat ard emit`. */
|
|
103
|
+
export declare function ardEmitCommand(options: ArdEmitOptions): Promise<void>;
|
|
104
|
+
//# sourceMappingURL=emit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"emit.d.ts","sourceRoot":"","sources":["../../../src/commands/ard/emit.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAML,KAAK,sBAAsB,EAC5B,MAAM,+BAA+B,CAAC;AASvC,OAAO,EAAsB,KAAK,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAE3E,qFAAqF;AACrF,eAAO,MAAM,kBAAkB,yBAAyB,CAAC;AAKzD;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,gBAAgB,GAAG,iBAAiB,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAErF,yEAAyE;AACzE,qBAAa,qBAAsB,SAAQ,KAAK;IAC9C,Q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