@vibe-agent-toolkit/cli 0.2.0-rc.5 → 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 +726 -127
- 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/claude-config.d.ts.map +1 -1
- package/dist/commands/claude/claude-config.js +6 -0
- package/dist/commands/claude/claude-config.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/helpers.d.ts +59 -1
- package/dist/commands/claude/org/helpers.d.ts.map +1 -1
- package/dist/commands/claude/org/helpers.js +58 -7
- package/dist/commands/claude/org/helpers.js.map +1 -1
- package/dist/commands/claude/org/index.d.ts.map +1 -1
- package/dist/commands/claude/org/index.js +24 -16
- package/dist/commands/claude/org/index.js.map +1 -1
- package/dist/commands/claude/org/skills.d.ts +509 -0
- package/dist/commands/claude/org/skills.d.ts.map +1 -1
- package/dist/commands/claude/org/skills.js +1364 -94
- package/dist/commands/claude/org/skills.js.map +1 -1
- package/dist/commands/claude/org/users.d.ts.map +1 -1
- package/dist/commands/claude/org/users.js +3 -1
- package/dist/commands/claude/org/users.js.map +1 -1
- package/dist/commands/claude/org/workspaces.d.ts.map +1 -1
- package/dist/commands/claude/org/workspaces.js +5 -2
- package/dist/commands/claude/org/workspaces.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-checklist.d.ts.map +1 -1
- package/dist/commands/skill/review-checklist.js +35 -0
- package/dist/commands/skill/review-checklist.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/configure.d.ts +37 -0
- package/dist/commands/skill/test/configure.d.ts.map +1 -1
- package/dist/commands/skill/test/configure.js +57 -12
- package/dist/commands/skill/test/configure.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/config-loader.d.ts.map +1 -1
- package/dist/utils/config-loader.js +22 -6
- package/dist/utils/config-loader.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
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packaging-config.js","sourceRoot":"","sources":["../../src/skill-resolution/packaging-config.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,
|
|
1
|
+
{"version":3,"file":"packaging-config.js","sourceRoot":"","sources":["../../src/skill-resolution/packaging-config.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAkC,wBAAwB,EAAE,MAAM,uCAAuC,CAAC;AACjH,OAAO,EAAE,eAAe,EAAmB,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAC/F,OAAO,EAAE,yBAAyB,EAAE,yBAAyB,EAAE,MAAM,oCAAoC,CAAC;AAE1G,sFAAsF;AACtF,MAAM,mBAAmB,GAAG,IAAI,GAAG,EAA+B,CAAC;AAEnE,uFAAuF;AACvF,MAAM,sBAAsB,GAAG,IAAI,GAAG,EAA+B,CAAC;AAEtE,+FAA+F;AAC/F,MA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C;
|
|
1
|
+
{"version":3,"file":"resolve-skill-reference.d.ts","sourceRoot":"","sources":["../../src/skill-resolution/resolve-skill-reference.ts"],"names":[],"mappings":"AAgDA,OAAO,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAqB,cAAc,EAAE,MAAM,YAAY,CAAC;AA8E3G;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,iBAAiB,GAAG,SAAS,CAAC,CAQxC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,6BAA6B,CACjD,OAAO,EAAE,MAAM,EACf,GAAG,EAAE,MAAM,GACV,OAAO,CAAC,kBAAkB,GAAG,SAAS,CAAC,CAKzC;AAuED,wBAAsB,qBAAqB,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,cAAc,CAAC,CAe7F"}
|
|
@@ -92,7 +92,10 @@ async function findFirstDeclaredSkillEntry(absPath, matches) {
|
|
|
92
92
|
const config = loadConfigCached(configRoot);
|
|
93
93
|
if (config?.skills === undefined)
|
|
94
94
|
return undefined;
|
|
95
|
-
|
|
95
|
+
// `'refuse'`: a reference resolved against a partial declared list can land
|
|
96
|
+
// on `not-found` for a skill that exists. The throw propagates to the
|
|
97
|
+
// command (`vat skill test` wraps it as `SkillBuildError`, named).
|
|
98
|
+
const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot, 'refuse');
|
|
96
99
|
for (const [sourcePath, name] of byPath.entries()) {
|
|
97
100
|
const result = await matches(sourcePath, name, configRoot, config);
|
|
98
101
|
if (result !== undefined)
|
|
@@ -176,7 +179,7 @@ async function resolveBareName(ref, cwd) {
|
|
|
176
179
|
: { kind: 'not-found', ref };
|
|
177
180
|
}
|
|
178
181
|
const byName = new Map(); // name → abs SKILL.md path
|
|
179
|
-
const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot);
|
|
182
|
+
const byPath = await getDiscoveredSkillsByPath(config.skills, configRoot, 'refuse');
|
|
180
183
|
for (const [skillMdPath, name] of byPath.entries())
|
|
181
184
|
byName.set(name, skillMdPath);
|
|
182
185
|
const sourcePath = byName.get(ref);
|
|
@@ -214,7 +217,7 @@ export async function resolveSkillReference(ref, cwd) {
|
|
|
214
217
|
return resolveBareName(ref, cwd);
|
|
215
218
|
}
|
|
216
219
|
async function buildBuildable(name, sourcePath, configRoot, config) {
|
|
217
|
-
const packagingConfig = (await resolveSkillPackagingConfig(sourcePath)) ?? {};
|
|
220
|
+
const packagingConfig = (await resolveSkillPackagingConfig(sourcePath, 'refuse')) ?? {};
|
|
218
221
|
const { distribution, expectedDistDir } = computeSkillDistribution(name, sourcePath, configRoot, config);
|
|
219
222
|
return { kind: 'buildable', name, sourcePath, configRoot, packagingConfig, distribution, expectedDistDir };
|
|
220
223
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-skill-reference.js","sourceRoot":"","sources":["../../src/skill-resolution/resolve-skill-reference.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EACL,oCAAoC,EACpC,iBAAiB,GAClB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,2BAA2B,EAAE,MAAM,uBAAuB,CAAC;AAG/F,SAAS,WAAW,CAAC,CAAS;IAC5B,8FAA8F;IAC9F,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC;AACvB,CAAC;AAED;;;;;GAKG;AACH,SAA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C;AACnC,CAAC;AAED,KAAK,UAAU,cAAc,CAC3B,IAAY,EACZ,UAAkB,EAClB,UAAkB,EAClB,MAAwD;IAExD,MAAM,eAAe,GAAG,CAAC,MAAM,2BAA2B,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;IACxF,MAAM,EAAE,YAAY,EAAE,eAAe,EAAE,GAAG,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,CAAC,CAAC;IACzG,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,EAAE,eAAe,EAAE,YAAY,EAAE,eAAe,EAAE,CAAC;AAC7G,CAAC"}
|
|
@@ -82,6 +82,37 @@ export declare function reportCommandError(error: unknown, logger: Logger, start
|
|
|
82
82
|
* omitted) for YAML — matching the success path's own two-branch switch
|
|
83
83
|
*/
|
|
84
84
|
export declare function handleCommandError(error: unknown, logger: Logger, startTime: number, commandName: string, format?: string | undefined): never;
|
|
85
|
+
/**
|
|
86
|
+
* Publish an EXPECTED failure in the format the operator asked for, then exit
|
|
87
|
+
* with the code the command's own contract assigns it.
|
|
88
|
+
*
|
|
89
|
+
* The third ending of one failure, beside {@link handleCommandError} (the
|
|
90
|
+
* UNEXPECTED failure, always exit 2) and {@link handleValidationGateFailure}
|
|
91
|
+
* (a validation gate, always exit 1, always YAML). This one covers the failure
|
|
92
|
+
* that is neither: the command ran, understood the project, and has a
|
|
93
|
+
* documented non-zero code for what it found — `vat ard emit` exiting 1 for
|
|
94
|
+
* "this project declares no `ard:` block" or 2 for "there is no config file
|
|
95
|
+
* here".
|
|
96
|
+
*
|
|
97
|
+
* 🔑 It exists because those endings were written inline, and an inline ending
|
|
98
|
+
* publishes nothing: `ard emit` honoured `--format json` on its success path
|
|
99
|
+
* and through `handleCommandError`, then wrote **zero bytes to stdout** on the
|
|
100
|
+
* two exits a repository actually reaches — the commonest being the first run
|
|
101
|
+
* of any repository that never opted into ARD. A CI wrapper reading stdout got
|
|
102
|
+
* an empty document and a bare non-zero code, which is the exact failure the
|
|
103
|
+
* `format` note on {@link handleCommandError} exists to forbid.
|
|
104
|
+
*
|
|
105
|
+
* The message goes to stderr as it always did — humans read it there — and the
|
|
106
|
+
* document goes to stdout, matching what both neighbours already do.
|
|
107
|
+
*
|
|
108
|
+
* @param message - What went wrong, in the command's own words
|
|
109
|
+
* @param exitCode - The code this command's `--help` assigns to this outcome
|
|
110
|
+
* @param startTime - Command start time (from Date.now()), so the document
|
|
111
|
+
* reports the run's real duration rather than a fabricated zero
|
|
112
|
+
* @param format - What the operator asked for: `json`, or anything else (and
|
|
113
|
+
* omitted) for YAML — the same two-branch switch the success path uses
|
|
114
|
+
*/
|
|
115
|
+
export declare function handleExpectedFailure(message: string, exitCode: number, startTime: number, format?: string | undefined): never;
|
|
85
116
|
/** The payload a command publishes when its own validation gate stops it. */
|
|
86
117
|
export interface ValidationGateFailure {
|
|
87
118
|
status: 'error';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-error.d.ts","sourceRoot":"","sources":["../../src/utils/command-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,OAAO,EAAmB,KAAK,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAExG,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAG1C;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAQjD;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAMvD;AAED,4EAA4E;AAC5E,MAAM,WAAW,oBAAoB;IACnC,MAAM,EAAE,OAAO,CAAC;IAChB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,kBAAkB,CACh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AAM,qBAAqB,IAAI,CAAC;AAEvC;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,0BAA0B,CAAC,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAE5E"}
|
|
@@ -106,6 +106,51 @@ export function handleCommandError(error, logger, startTime, commandName, format
|
|
|
106
106
|
}
|
|
107
107
|
process.exit(2);
|
|
108
108
|
}
|
|
109
|
+
/**
|
|
110
|
+
* Publish an EXPECTED failure in the format the operator asked for, then exit
|
|
111
|
+
* with the code the command's own contract assigns it.
|
|
112
|
+
*
|
|
113
|
+
* The third ending of one failure, beside {@link handleCommandError} (the
|
|
114
|
+
* UNEXPECTED failure, always exit 2) and {@link handleValidationGateFailure}
|
|
115
|
+
* (a validation gate, always exit 1, always YAML). This one covers the failure
|
|
116
|
+
* that is neither: the command ran, understood the project, and has a
|
|
117
|
+
* documented non-zero code for what it found — `vat ard emit` exiting 1 for
|
|
118
|
+
* "this project declares no `ard:` block" or 2 for "there is no config file
|
|
119
|
+
* here".
|
|
120
|
+
*
|
|
121
|
+
* 🔑 It exists because those endings were written inline, and an inline ending
|
|
122
|
+
* publishes nothing: `ard emit` honoured `--format json` on its success path
|
|
123
|
+
* and through `handleCommandError`, then wrote **zero bytes to stdout** on the
|
|
124
|
+
* two exits a repository actually reaches — the commonest being the first run
|
|
125
|
+
* of any repository that never opted into ARD. A CI wrapper reading stdout got
|
|
126
|
+
* an empty document and a bare non-zero code, which is the exact failure the
|
|
127
|
+
* `format` note on {@link handleCommandError} exists to forbid.
|
|
128
|
+
*
|
|
129
|
+
* The message goes to stderr as it always did — humans read it there — and the
|
|
130
|
+
* document goes to stdout, matching what both neighbours already do.
|
|
131
|
+
*
|
|
132
|
+
* @param message - What went wrong, in the command's own words
|
|
133
|
+
* @param exitCode - The code this command's `--help` assigns to this outcome
|
|
134
|
+
* @param startTime - Command start time (from Date.now()), so the document
|
|
135
|
+
* reports the run's real duration rather than a fabricated zero
|
|
136
|
+
* @param format - What the operator asked for: `json`, or anything else (and
|
|
137
|
+
* omitted) for YAML — the same two-branch switch the success path uses
|
|
138
|
+
*/
|
|
139
|
+
export function handleExpectedFailure(message, exitCode, startTime, format) {
|
|
140
|
+
process.stderr.write(`${message}\n`);
|
|
141
|
+
const document = {
|
|
142
|
+
status: 'error',
|
|
143
|
+
error: message,
|
|
144
|
+
duration: formatDuration(Date.now() - startTime),
|
|
145
|
+
};
|
|
146
|
+
if (format === 'json') {
|
|
147
|
+
writeJsonOutput(document);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
writeYamlOutput(document);
|
|
151
|
+
}
|
|
152
|
+
process.exit(exitCode);
|
|
153
|
+
}
|
|
109
154
|
/**
|
|
110
155
|
* Pure: the document {@link handleValidationGateFailure} writes.
|
|
111
156
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command-error.js","sourceRoot":"","sources":["../../src/utils/command-error.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,eAAe,EAA6C,MAAM,4BAA4B,CAAC;AAGxG,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE/D;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,EAAU;IACvC,IAAI,EAAE,GAAG,IAAI,EAAE,CAAC;QACd,OAAO,GAAG,EAAE,IAAI,CAAC;IACnB,CAAC;IACD,IAAI,EAAE,GAAG,KAAK,EAAE,CAAC;QACf,OAAO,GAAG,CAAC,EAAE,GAAG,IAAI,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;IACtC,CAAC;IACD,OAAO,GAAG,CAAC,EAAE,GAAG,KAAK,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC;AACvC,CAAC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAA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;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,UAAU,0BAA0B,CAAC,iBAAyB;IAClE,OAAO,iBAAiB,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,CAAC;AAC7D,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,EAAuD,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAaxH;;;;;;;;GAQG;AACH,qBAAa,eAAgB,SAAQ,KAAK;IACxC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;gBACjB,WAAW,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO;CAMhD;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAkDzE;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAEvD;AAqBD;;;;;GAKG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,CAM7C;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,gBAAgB,CAAC,WAAW,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAgB/E"}
|
|
@@ -6,10 +6,16 @@
|
|
|
6
6
|
*/
|
|
7
7
|
import { readFileSync, existsSync } from 'node:fs';
|
|
8
8
|
import { dirname } from 'node:path';
|
|
9
|
-
import {
|
|
9
|
+
import { parseConfigAllowingUnknownKeys, ProjectConfigSchema } from '@vibe-agent-toolkit/resources';
|
|
10
10
|
import { safePath } from '@vibe-agent-toolkit/utils';
|
|
11
11
|
import * as yaml from 'yaml';
|
|
12
12
|
const CONFIG_FILENAME = 'vibe-agent-toolkit.config.yaml';
|
|
13
|
+
/**
|
|
14
|
+
* Config paths already warned about for unknown keys, so one config governing
|
|
15
|
+
* many skills produces one line rather than one per skill. Cleared with the
|
|
16
|
+
* config cache, which is what a test isolating a fixture resets.
|
|
17
|
+
*/
|
|
18
|
+
const warnedConfigPaths = new Set();
|
|
13
19
|
/**
|
|
14
20
|
* A `vibe-agent-toolkit.config.yaml` exists but failed to parse or validate.
|
|
15
21
|
*
|
|
@@ -69,11 +75,18 @@ export function loadConfig(projectRoot) {
|
|
|
69
75
|
// never named this file, never said which key was refused in words, and
|
|
70
76
|
// offered no remedy. Every strict block in the schema is a refusal an
|
|
71
77
|
// adopter has to be able to act on from the terminal alone.
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
// An UNKNOWN key warns and is dropped; every other validation failure still
|
|
79
|
+
// throws. See `parseConfigAllowingUnknownKeys` for the reasoning — briefly:
|
|
80
|
+
// a key VAT has no field for is a key VAT was already discarding, and
|
|
81
|
+
// turning that into an exit 2 broke commands that never read the section it
|
|
82
|
+
// was in. Warned once per config path, because `loadConfigCached` will
|
|
83
|
+
// otherwise re-warn for every skill under one project.
|
|
84
|
+
return parseConfigAllowingUnknownKeys(ProjectConfigSchema, parsed, (message) => {
|
|
85
|
+
if (warnedConfigPaths.has(configPath))
|
|
86
|
+
return;
|
|
87
|
+
warnedConfigPaths.add(configPath);
|
|
88
|
+
process.stderr.write(`${message}\n`);
|
|
89
|
+
}, { configPath });
|
|
77
90
|
}
|
|
78
91
|
catch (error) {
|
|
79
92
|
if (error instanceof Error) {
|
|
@@ -120,6 +133,9 @@ const loadErrorCache = new Map();
|
|
|
120
133
|
export function resetLoadedConfigCache() {
|
|
121
134
|
loadedConfigCache.clear();
|
|
122
135
|
loadErrorCache.clear();
|
|
136
|
+
// The warn-once ledger is part of this cache's state: a test that resets the
|
|
137
|
+
// caches and re-loads the same fixture expects to see the warning again.
|
|
138
|
+
warnedConfigPaths.clear();
|
|
123
139
|
}
|
|
124
140
|
/**
|
|
125
141
|
* Cached variant of {@link loadConfig} keyed by `projectRoot`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"config-loader.js","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,EAAE,8BAA8B,EAAE,mBAAmB,EAAsB,MAAM,+BAA+B,CAAC;AACxH,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,KAAK,IAAI,MAAM,MAAM,CAAC;AAE7B,MAAM,eAAe,GAAG,gCAAgC,CAAC;AAEzD;;;;GAIG;AACH,MAAM,iBAAiB,GAAG,IAAI,GAAG,EAAU,CAAC;AAE5C;;;;;;;;GAQG;AACH,MAAM,OAAO,eAAgB,SAAQ,KAAK;IAC/B,WAAW,CAAS;IAC7B,YAAY,WAAmB,EAAE,KAAc;QAC7C,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;QAC9D,IAAI,CAAC,IAAI,GAAG,iBAAiB,CAAC;QAC9B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,KAAK,YAAY,KAAK;YAAE,IAAI,CAAC,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C,IAAI,eAAe,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC;QAC/F,cAAc,CAAC,GAAG,CAAC,WAAW,EAAE,SAAS,CAAC,CAAC;QAC3C,MAAM,SAAS,CAAC;IAClB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluating the authored-link lens over a populated projection, so SQL can ask
|
|
3
|
+
* about edges.
|
|
4
|
+
*
|
|
5
|
+
* ## Why the CLI does this rather than the population
|
|
6
|
+
*
|
|
7
|
+
* `edges` and `edge_resolutions` are derived per lens, and the set of lenses is
|
|
8
|
+
* not known at population time — zones.md §2: *"A lens may be declared in config
|
|
9
|
+
* **or invented on demand** to answer a question nobody anticipated."* So a
|
|
10
|
+
* population cannot produce them without first inventing the lens, which is a
|
|
11
|
+
* question, not a fact. Inventing one here costs a definition and a pass over
|
|
12
|
+
* rows already in memory; it commits the data model to nothing, and the rows go
|
|
13
|
+
* into the per-run in-memory database that `projection-query.ts` guarantees
|
|
14
|
+
* holds this tree and nothing else.
|
|
15
|
+
*
|
|
16
|
+
* ## One lens per extent, and the extent is the thing worth naming
|
|
17
|
+
*
|
|
18
|
+
* A corpus has more than one extent — this repository has two, `filesystem`
|
|
19
|
+
* (the tracked tree) and `agentic-convention` (the CLAUDE.md closure) — and an
|
|
20
|
+
* edge relation over one is a different relation from an edge relation over the
|
|
21
|
+
* other. Evaluating every extent and keying the rows on the lens's own
|
|
22
|
+
* `contextId` means a caller SELECTs the population they meant, rather than
|
|
23
|
+
* silently getting whichever one happened to be evaluated. `lens_contexts` says
|
|
24
|
+
* which lenses exist and which extent each reads over, so the join is
|
|
25
|
+
* discoverable from SQL alone.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ **Only `species: 'extent'` rows are read over.** A lens over a lens is not
|
|
28
|
+
* a thing this evaluation models, and `resolution_contexts` holds no lens rows
|
|
29
|
+
* anyway — nothing in the population mints one. The filter is there so that
|
|
30
|
+
* stops being true loudly rather than silently if something ever does.
|
|
31
|
+
*/
|
|
32
|
+
import { type Projection, type ResolutionContextRow } from '@vibe-agent-toolkit/resources';
|
|
33
|
+
/**
|
|
34
|
+
* The rows one sweep of the corpus produced, ready for `writeDerived`.
|
|
35
|
+
*
|
|
36
|
+
* 🪤 **The three field names must be `DERIVED_TABLES`' own keys, and nothing
|
|
37
|
+
* used to check that.** `writeDerived` looks each relation up by
|
|
38
|
+
* `bundle[spec.key]`, and every member of `DerivedRows` is optional — so
|
|
39
|
+
* renaming a derived relation left this interface spelling the OLD name, which
|
|
40
|
+
* type-checked cleanly as a tolerated excess property while the renamed
|
|
41
|
+
* relation was silently never written. Verified: the rename compiled with zero
|
|
42
|
+
* errors under `--strict`.
|
|
43
|
+
*
|
|
44
|
+
* The `satisfies` below is what makes the correspondence real rather than a
|
|
45
|
+
* coincidence of spelling — a renamed relation now fails to compile here.
|
|
46
|
+
*/
|
|
47
|
+
export interface EvaluatedLenses {
|
|
48
|
+
readonly lensContexts: readonly ResolutionContextRow[];
|
|
49
|
+
readonly edges: readonly Record<string, unknown>[];
|
|
50
|
+
readonly edgeResolutions: readonly Record<string, unknown>[];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Every key of {@link EvaluatedLenses} names a real derived relation.
|
|
54
|
+
*
|
|
55
|
+
* A compile-time assertion with no runtime cost beyond one frozen object: it
|
|
56
|
+
* pins the field names of `EvaluatedLenses` to `DerivedTableName`, which is
|
|
57
|
+
* the correspondence `writeDerived` depends on and cannot express itself.
|
|
58
|
+
*/
|
|
59
|
+
export declare const EVALUATED_LENS_RELATIONS: {
|
|
60
|
+
readonly lensContexts: true;
|
|
61
|
+
readonly edges: true;
|
|
62
|
+
readonly edgeResolutions: true;
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Evaluate the authored-link lens over every extent in a projection.
|
|
66
|
+
*
|
|
67
|
+
* @param projection - A populated projection
|
|
68
|
+
* @returns The lens rows and the two relations, in step with each other
|
|
69
|
+
*/
|
|
70
|
+
export declare function evaluateAuthoredLenses(projection: Projection): EvaluatedLenses;
|
|
71
|
+
/**
|
|
72
|
+
* The lens id for one extent's authored-link view.
|
|
73
|
+
*
|
|
74
|
+
* Derived from the extent's own id rather than minted fresh, so the same tree
|
|
75
|
+
* produces the same lens id on every run and a reader can predict it. It is
|
|
76
|
+
* NOT a digest: nothing here needs collision resistance, and a readable id is
|
|
77
|
+
* what makes `WHERE contextId = …` writable by hand.
|
|
78
|
+
*
|
|
79
|
+
* @param extentContextId - The extent this lens reads over
|
|
80
|
+
* @returns The lens's `contextId`
|
|
81
|
+
*/
|
|
82
|
+
export declare function authoredLensId(extentContextId: string): string;
|
|
83
|
+
//# sourceMappingURL=edge-lens-evaluation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-lens-evaluation.d.ts","sourceRoot":"","sources":["../../src/utils/edge-lens-evaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AAEH,OAAO,EAKL,KAAK,UAAU,EACf,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAavC;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,YAAY,EAAE,SAAS,oBAAoB,EAAE,CAAC;IACvD,QAAQ,CAAC,KAAK,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;IACnD,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;CAC9D;AAED;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB;;;;CAEqE,CAAC;AAE3G;;;;;GAKG;AACH,wBAAgB,sBAAsB,CAAC,UAAU,EAAE,UAAU,GAAG,eAAe,CAsC9E;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,eAAe,EAAE,MAAM,GAAG,MAAM,CAE9D"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Evaluating the authored-link lens over a populated projection, so SQL can ask
|
|
3
|
+
* about edges.
|
|
4
|
+
*
|
|
5
|
+
* ## Why the CLI does this rather than the population
|
|
6
|
+
*
|
|
7
|
+
* `edges` and `edge_resolutions` are derived per lens, and the set of lenses is
|
|
8
|
+
* not known at population time — zones.md §2: *"A lens may be declared in config
|
|
9
|
+
* **or invented on demand** to answer a question nobody anticipated."* So a
|
|
10
|
+
* population cannot produce them without first inventing the lens, which is a
|
|
11
|
+
* question, not a fact. Inventing one here costs a definition and a pass over
|
|
12
|
+
* rows already in memory; it commits the data model to nothing, and the rows go
|
|
13
|
+
* into the per-run in-memory database that `projection-query.ts` guarantees
|
|
14
|
+
* holds this tree and nothing else.
|
|
15
|
+
*
|
|
16
|
+
* ## One lens per extent, and the extent is the thing worth naming
|
|
17
|
+
*
|
|
18
|
+
* A corpus has more than one extent — this repository has two, `filesystem`
|
|
19
|
+
* (the tracked tree) and `agentic-convention` (the CLAUDE.md closure) — and an
|
|
20
|
+
* edge relation over one is a different relation from an edge relation over the
|
|
21
|
+
* other. Evaluating every extent and keying the rows on the lens's own
|
|
22
|
+
* `contextId` means a caller SELECTs the population they meant, rather than
|
|
23
|
+
* silently getting whichever one happened to be evaluated. `lens_contexts` says
|
|
24
|
+
* which lenses exist and which extent each reads over, so the join is
|
|
25
|
+
* discoverable from SQL alone.
|
|
26
|
+
*
|
|
27
|
+
* ⚠️ **Only `species: 'extent'` rows are read over.** A lens over a lens is not
|
|
28
|
+
* a thing this evaluation models, and `resolution_contexts` holds no lens rows
|
|
29
|
+
* anyway — nothing in the population mints one. The filter is there so that
|
|
30
|
+
* stops being true loudly rather than silently if something ever does.
|
|
31
|
+
*/
|
|
32
|
+
import { AUTHORED_EDGE_FORMS, buildReferenceIndex, resolveEdges, } from '@vibe-agent-toolkit/resources';
|
|
33
|
+
/**
|
|
34
|
+
* The lens kind these evaluations declare.
|
|
35
|
+
*
|
|
36
|
+
* `ZoneKindSchema` is an open vocabulary, so this names the POLICY rather than
|
|
37
|
+
* the mechanism: what makes two of these lenses the same is that both admit the
|
|
38
|
+
* authored forms and nothing else. A lens that promoted bare tokens would be a
|
|
39
|
+
* different kind, not a variant of this one, because the two answer differently
|
|
40
|
+
* by an order of magnitude and a reader comparing them must be able to tell.
|
|
41
|
+
*/
|
|
42
|
+
const AUTHORED_LENS_KIND = 'authored-link';
|
|
43
|
+
/**
|
|
44
|
+
* Every key of {@link EvaluatedLenses} names a real derived relation.
|
|
45
|
+
*
|
|
46
|
+
* A compile-time assertion with no runtime cost beyond one frozen object: it
|
|
47
|
+
* pins the field names of `EvaluatedLenses` to `DerivedTableName`, which is
|
|
48
|
+
* the correspondence `writeDerived` depends on and cannot express itself.
|
|
49
|
+
*/
|
|
50
|
+
export const EVALUATED_LENS_RELATIONS = {
|
|
51
|
+
lensContexts: true, edges: true, edgeResolutions: true,
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Evaluate the authored-link lens over every extent in a projection.
|
|
55
|
+
*
|
|
56
|
+
* @param projection - A populated projection
|
|
57
|
+
* @returns The lens rows and the two relations, in step with each other
|
|
58
|
+
*/
|
|
59
|
+
export function evaluateAuthoredLenses(projection) {
|
|
60
|
+
const lensContexts = [];
|
|
61
|
+
const edges = [];
|
|
62
|
+
const edgeResolutions = [];
|
|
63
|
+
// Built ONCE for every lens. It is a pure function of `blob_references` and
|
|
64
|
+
// reads nothing from a lens, so rebuilding it per extent is duplicated work a
|
|
65
|
+
// one-member extent would pay in full — 43 ms at one extent against 713 ms at
|
|
66
|
+
// ten, measured on this repository.
|
|
67
|
+
const referencesByBlob = buildReferenceIndex(projection);
|
|
68
|
+
for (const context of projection.resolutionContexts) {
|
|
69
|
+
if (context.species !== 'extent')
|
|
70
|
+
continue;
|
|
71
|
+
const contextId = authoredLensId(context.contextId);
|
|
72
|
+
lensContexts.push({
|
|
73
|
+
contextId,
|
|
74
|
+
species: 'lens',
|
|
75
|
+
kind: AUTHORED_LENS_KIND,
|
|
76
|
+
rootId: context.rootId,
|
|
77
|
+
extentContextId: context.contextId,
|
|
78
|
+
// Null because this lens's kind is not `tree`; the schema refuses a role
|
|
79
|
+
// on any other kind, which is that check doing its job rather than a
|
|
80
|
+
// field being forgotten.
|
|
81
|
+
role: null,
|
|
82
|
+
});
|
|
83
|
+
const relation = resolveEdges(projection, {
|
|
84
|
+
contextId,
|
|
85
|
+
extentContextId: context.contextId,
|
|
86
|
+
forms: AUTHORED_EDGE_FORMS,
|
|
87
|
+
// Ordinary markdown. `claude-import` is the other dialect and belongs to
|
|
88
|
+
// the `@`-import forms, which the authored-only policy does not admit.
|
|
89
|
+
dialect: 'href',
|
|
90
|
+
}, { referencesByBlob });
|
|
91
|
+
edges.push(...relation.edges);
|
|
92
|
+
edgeResolutions.push(...relation.edgeResolutions);
|
|
93
|
+
}
|
|
94
|
+
return { lensContexts, edges, edgeResolutions };
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* The lens id for one extent's authored-link view.
|
|
98
|
+
*
|
|
99
|
+
* Derived from the extent's own id rather than minted fresh, so the same tree
|
|
100
|
+
* produces the same lens id on every run and a reader can predict it. It is
|
|
101
|
+
* NOT a digest: nothing here needs collision resistance, and a readable id is
|
|
102
|
+
* what makes `WHERE contextId = …` writable by hand.
|
|
103
|
+
*
|
|
104
|
+
* @param extentContextId - The extent this lens reads over
|
|
105
|
+
* @returns The lens's `contextId`
|
|
106
|
+
*/
|
|
107
|
+
export function authoredLensId(extentContextId) {
|
|
108
|
+
return `lens-${AUTHORED_LENS_KIND}-${extentContextId}`;
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=edge-lens-evaluation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"edge-lens-evaluation.js","sourceRoot":"","sources":["../../src/utils/edge-lens-evaluation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;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,CAAC;QACzB,KAAK,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;QAC9B,eAAe,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;IACpD,CAAC;IAED,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,eAAe,EAAE,CAAC;AAClD,CAAC;AAED;;;;;;;;;;GAUG;AACH,MAAM,UAAU,cAAc,CAAC,eAAuB;IACpD,OAAO,QAAQ,kBAAkB,IAAI,eAAe,EAAE,CAAC;AACzD,CAAC"}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* ## Why this exists rather than four `await import()` calls
|
|
6
6
|
*
|
|
7
7
|
* `@vibe-agent-toolkit/rag-lancedb` pulls a platform-native LanceDB binary
|
|
8
|
-
* (
|
|
9
|
-
* `onnxruntime-web` (
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* (97.8 MB unpacked on `darwin-arm64`, and larger still on `win32-x64`, where
|
|
9
|
+
* it measured 119.6 MiB) plus `onnxruntime-web` (137.5 MB) and `gpt-tokenizer`
|
|
10
|
+
* (42.2 MB). Summed over the RAG lane's third-party closure against this
|
|
11
|
+
* release's pins, on `darwin-arm64`: **~287 MB unpacked**, and a static import
|
|
12
|
+
* chain from `bin.ts` meant
|
|
12
13
|
* `import('@lancedb/lancedb')` — **1,350 ms cold** — ran before `vat --version`
|
|
13
14
|
* could print a string. It is a named seam rather than a one-off fix because
|
|
14
15
|
* "optional backend" is a shape VAT keeps growing — a projection store is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional-backend.d.ts","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"optional-backend.d.ts","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAkBH;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAOvD;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,eAAe,GAAG,KAAK,CAcpE;AAED,6DAA6D;AAC7D,MAAM,WAAW,eAAe;IAC9B,wDAAwD;IACxD,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,0EAA0E;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,UAAU,CAAC,IAAI,SAAS,SAAS,OAAO,EAAE,EACxD,OAAO,EAAE,eAAe,EACxB,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAC9C,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,IAAI,CAAC,CAalC"}
|
|
@@ -5,10 +5,11 @@
|
|
|
5
5
|
* ## Why this exists rather than four `await import()` calls
|
|
6
6
|
*
|
|
7
7
|
* `@vibe-agent-toolkit/rag-lancedb` pulls a platform-native LanceDB binary
|
|
8
|
-
* (
|
|
9
|
-
* `onnxruntime-web` (
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* (97.8 MB unpacked on `darwin-arm64`, and larger still on `win32-x64`, where
|
|
9
|
+
* it measured 119.6 MiB) plus `onnxruntime-web` (137.5 MB) and `gpt-tokenizer`
|
|
10
|
+
* (42.2 MB). Summed over the RAG lane's third-party closure against this
|
|
11
|
+
* release's pins, on `darwin-arm64`: **~287 MB unpacked**, and a static import
|
|
12
|
+
* chain from `bin.ts` meant
|
|
12
13
|
* `import('@lancedb/lancedb')` — **1,350 ms cold** — ran before `vat --version`
|
|
13
14
|
* could print a string. It is a named seam rather than a one-off fix because
|
|
14
15
|
* "optional backend" is a shape VAT keeps growing — a projection store is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"optional-backend.js","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"optional-backend.js","sourceRoot":"","sources":["../../src/utils/optional-backend.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,8EAA8E;AAC9E,wEAAwE;AACxE,8EAA8E;AAC9E,8DAA8D;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAE9C;;;;;;;GAOG;AACH,MAAM,gBAAgB,GAAG,sBAAsB,CAAC;AAEhD;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,KAAc;IAC5C,OAAO,CACL,OAAO,KAAK,KAAK,QAAQ;WACtB,KAAK,KAAK,IAAI;WACd,MAAM,IAAI,KAAK;WACd,KAA4B,CAAC,IAAI,KAAK,gBAAgB,CAC3D,CAAC;AACJ,CAAC;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,oBAAoB,CAAC,OAAwB;IAC3D,MAAM,OAAO,GAAG,eAAe,OAAO,CAAC,WAAW,EAAE,CAAC;IACrD,OAAO,CAAC,MAAM,CAAC,KAAK,CAClB,GAAG,OAAO,CAAC,OAAO,6DAA6D;UAC7E,uBAAuB,OAAO,IAAI;UAClC,gFAAgF;UAChF,wDAAwD,CAC3D,CAAC;IACF,eAAe,CAAC;QACd,MAAM,EAAE,OAAO;QACf,KAAK,EAAE,GAAG,OAAO,CAAC,OAAO,2BAA2B,OAAO,CAAC,WAAW,EAAE;QACzE,GAAG,EAAE,OAAO;KACb,CAAC,CAAC;IACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC;AAUD;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,UAAU,UAAU,CACxB,OAAwB,EACxB,IAA+C;IAE/C,OAAO,KAAK,EAAE,GAAG,IAAU,EAAiB,EAAE;QAC5C,IAAI,OAA0C,CAAC;QAC/C,IAAI,CAAC;YACH,OAAO,GAAG,MAAM,IAAI,EAAE,CAAC;QACzB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC5B,MAAM,KAAK,CAAC;YACd,CAAC;YACD,oBAAoB,CAAC,OAAO,CAAC,CAAC;QAChC,CAAC;QACD,MAAM,OAAO,CAAC,GAAG,IAAI,CAAC,CAAC;IACzB,CAAC,CAAC;AACJ,CAAC"}
|
|
@@ -30,4 +30,24 @@ export declare function projectRootOrLoudCwd(startDir: string, logger: Logger):
|
|
|
30
30
|
* `tolerate null` policy — return `string | null`; caller handles either case.
|
|
31
31
|
*/
|
|
32
32
|
export declare function projectRootOrNull(startDir: string): string | null;
|
|
33
|
+
/**
|
|
34
|
+
* Fail loudly on a `[path]` argument that names no directory.
|
|
35
|
+
*
|
|
36
|
+
* Every `resources` verb takes an optional `[path]`, and two things can be
|
|
37
|
+
* meant by it: a SCOPE (`scan`, `validate` — crawl this subtree) or a LOCATOR
|
|
38
|
+
* (`query`, `check` — find the project from here; the projection is always the
|
|
39
|
+
* whole tree). Both start by resolving the argument, and both must refuse one
|
|
40
|
+
* that resolves to nothing — the scoping verbs would otherwise degrade into a
|
|
41
|
+
* glob matching nothing (`filesScanned: 0`, green), and the locating verbs
|
|
42
|
+
* walked UP from the missing path to whatever project the cwd is in and
|
|
43
|
+
* answered about THAT tree at exit 0, byte-identical to a correct run.
|
|
44
|
+
*
|
|
45
|
+
* One function so the two families refuse with one message; a reader who saw
|
|
46
|
+
* `validate` say "Path does not exist" should get the same words from `query`.
|
|
47
|
+
*
|
|
48
|
+
* @param pathArg - The argument as typed, relative to cwd or absolute
|
|
49
|
+
* @returns The resolved absolute path
|
|
50
|
+
* @throws When it does not exist or is not a directory
|
|
51
|
+
*/
|
|
52
|
+
export declare function assertDirectoryArgument(pathArg: string): string;
|
|
33
53
|
//# sourceMappingURL=project-root-policy.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;
|
|
1
|
+
{"version":3,"file":"project-root-policy.d.ts","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAMH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAE1C;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM,CAShF;AAED;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAQ7E;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAEjE;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAW/D"}
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* `.action(...)` callbacks). Inner library functions should take the resolved
|
|
13
13
|
* root as a parameter — never call `findProjectRoot` themselves.
|
|
14
14
|
*/
|
|
15
|
+
import { existsSync, statSync } from 'node:fs';
|
|
15
16
|
import { findProjectRoot, safePath } from '@vibe-agent-toolkit/utils';
|
|
16
17
|
/**
|
|
17
18
|
* `required` policy — refuse to run if no projectRoot can be discovered.
|
|
@@ -46,4 +47,35 @@ export function projectRootOrLoudCwd(startDir, logger) {
|
|
|
46
47
|
export function projectRootOrNull(startDir) {
|
|
47
48
|
return findProjectRoot(startDir);
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Fail loudly on a `[path]` argument that names no directory.
|
|
52
|
+
*
|
|
53
|
+
* Every `resources` verb takes an optional `[path]`, and two things can be
|
|
54
|
+
* meant by it: a SCOPE (`scan`, `validate` — crawl this subtree) or a LOCATOR
|
|
55
|
+
* (`query`, `check` — find the project from here; the projection is always the
|
|
56
|
+
* whole tree). Both start by resolving the argument, and both must refuse one
|
|
57
|
+
* that resolves to nothing — the scoping verbs would otherwise degrade into a
|
|
58
|
+
* glob matching nothing (`filesScanned: 0`, green), and the locating verbs
|
|
59
|
+
* walked UP from the missing path to whatever project the cwd is in and
|
|
60
|
+
* answered about THAT tree at exit 0, byte-identical to a correct run.
|
|
61
|
+
*
|
|
62
|
+
* One function so the two families refuse with one message; a reader who saw
|
|
63
|
+
* `validate` say "Path does not exist" should get the same words from `query`.
|
|
64
|
+
*
|
|
65
|
+
* @param pathArg - The argument as typed, relative to cwd or absolute
|
|
66
|
+
* @returns The resolved absolute path
|
|
67
|
+
* @throws When it does not exist or is not a directory
|
|
68
|
+
*/
|
|
69
|
+
export function assertDirectoryArgument(pathArg) {
|
|
70
|
+
const resolved = safePath.resolve(pathArg);
|
|
71
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI path argument, resolved above
|
|
72
|
+
if (!existsSync(resolved)) {
|
|
73
|
+
throw new Error(`Path does not exist: ${resolved}`);
|
|
74
|
+
}
|
|
75
|
+
// eslint-disable-next-line security/detect-non-literal-fs-filename -- CLI path argument, existence checked above
|
|
76
|
+
if (!statSync(resolved).isDirectory()) {
|
|
77
|
+
throw new Error(`Path is not a directory: ${resolved}`);
|
|
78
|
+
}
|
|
79
|
+
return resolved;
|
|
80
|
+
}
|
|
49
81
|
//# sourceMappingURL=project-root-policy.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"project-root-policy.js","sourceRoot":"","sources":["../../src/utils/project-root-policy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAItE;;;;GAIG;AACH,MAAM,UAAU,kBAAkB,CAAC,QAAgB,EAAE,WAAmB;IACtE,MAAM,IAAI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