vigiles 30.0.2 → 31.0.0
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/dist/adapter-conformance.js +9 -15
- package/dist/claude-code.js +5 -0
- package/dist/cli-main.js +21 -23
- package/dist/codex.js +5 -0
- package/dist/core/compile.d.ts +5 -5
- package/dist/core/compile.js +28 -25
- package/dist/core/config-schema.d.ts +32 -32
- package/dist/core/refs.d.ts +2 -2
- package/dist/core/refs.js +9 -12
- package/dist/core/spec.js +5 -0
- package/dist/core/symbols.d.ts +25 -19
- package/dist/core/symbols.js +51 -74
- package/dist/core/tree-sitter-wasm.d.ts +24 -0
- package/dist/core/tree-sitter-wasm.js +128 -0
- package/dist/eval-surface.js +5 -0
- package/dist/hook-install.js +23 -10
- package/dist/hook.js +5 -0
- package/dist/jest.js +5 -0
- package/dist/linting.d.ts +11 -30
- package/dist/linting.js +22 -35
- package/dist/test.js +5 -0
- package/dist/vitest.mjs +5 -0
- package/package.json +2 -6
|
@@ -14,8 +14,7 @@ exports.assertAdapterLoadsHooks = assertAdapterLoadsHooks;
|
|
|
14
14
|
*/
|
|
15
15
|
const node_fs_1 = require("node:fs");
|
|
16
16
|
const node_path_1 = require("node:path");
|
|
17
|
-
const
|
|
18
|
-
const spec_js_1 = require("./core/spec.js");
|
|
17
|
+
const tool_contract_js_1 = require("./core/tool-contract.js");
|
|
19
18
|
const plugin_loader_js_1 = require("./plugin-loader.js");
|
|
20
19
|
const vocabulary_consistency_js_1 = require("./core/vocabulary-consistency.js");
|
|
21
20
|
const event_capability_js_1 = require("./core/event-capability.js");
|
|
@@ -190,21 +189,16 @@ function checkAdapterConformance(adapter) {
|
|
|
190
189
|
catch (e) {
|
|
191
190
|
need(false, `layout.settings ("${adapter.layout.settings.label}") threw on its own output: ${String(e)}`);
|
|
192
191
|
}
|
|
193
|
-
// Behavioural: the dialect drives the
|
|
194
|
-
// pass
|
|
192
|
+
// Behavioural: the dialect drives the subagent tool-contract check — its own built-in tool
|
|
193
|
+
// must pass that check under this dialect. This calls the SAME validator `compileAgent` uses
|
|
194
|
+
// (`verifyToolContract` + `authoringIssues`) rather than `compileAgent` itself: the tool
|
|
195
|
+
// contract is what this line claims to check, and compiling a whole agent would tie this
|
|
196
|
+
// synchronous public kit to the compiler's (async) reference validation for nothing.
|
|
195
197
|
const tool = adapter.dialect.builtinAgentTools[0];
|
|
196
198
|
if (tool) {
|
|
197
|
-
const
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
tools: [tool],
|
|
201
|
-
body: "probe",
|
|
202
|
-
});
|
|
203
|
-
const r = (0, compile_js_1.compileAgent)(spec, {
|
|
204
|
-
specFile: "conformance.md.spec.ts",
|
|
205
|
-
dialect: adapter.dialect,
|
|
206
|
-
});
|
|
207
|
-
need(!r.errors.some((e) => e.type === "unknown-tool"), `dialect rejects its own built-in tool "${tool}"`);
|
|
199
|
+
const issues = (0, tool_contract_js_1.authoringIssues)((0, tool_contract_js_1.verifyToolContract)([tool], adapter.dialect));
|
|
200
|
+
need(issues.length === 0, `dialect rejects its own built-in tool "${tool}"` +
|
|
201
|
+
(issues.length ? `: ${issues.map((i) => i.message).join("; ")}` : ""));
|
|
208
202
|
}
|
|
209
203
|
return { ok: failures.length === 0, failures };
|
|
210
204
|
}
|
package/dist/claude-code.js
CHANGED
|
@@ -15,6 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.formatSelectionReport = exports.assertNoCollision = exports.measureSelectionMatrix = exports.agent = exports.experimental_skill = exports.experimental_agent = exports.claudeAvailable = exports.parseClaudeRun = exports.buildClaudeArgs = exports.claudeCodeDriver = void 0;
|
|
18
|
+
// 🔴 PUBLIC ENTRY POINT `vigiles/claude-code` — every export here is a promise to users. The default for a
|
|
19
|
+
// symbol is INTERNAL. It is exported only if (a) a NAMED external consumer uses it, or (b) it is
|
|
20
|
+
// a deliberate extension point listed in STABILITY.md (the adapter kit is the example). "Might
|
|
21
|
+
// be useful" is neither. Review point: the diff of `api-surface/vigiles-claude-code.api.md`, which
|
|
22
|
+
// `npm run api:check` fails on.
|
|
18
23
|
/**
|
|
19
24
|
* `vigiles/claude-code` — the Claude Code-specific harness pieces a *different*
|
|
20
25
|
* harness would swap out: the plugin/repo loader (reads real Claude Code plugin
|
package/dist/cli-main.js
CHANGED
|
@@ -335,9 +335,9 @@ function compileGeneratorSkillToFile(specPath, source) {
|
|
|
335
335
|
return false;
|
|
336
336
|
}
|
|
337
337
|
/** Compile a ClaudeSpec → its primary + any additional targets. */
|
|
338
|
-
function compileClaudeToFile(spec, specPath, config, dialect) {
|
|
338
|
+
async function compileClaudeToFile(spec, specPath, config, dialect) {
|
|
339
339
|
const basePath = process.cwd();
|
|
340
|
-
const { markdown, errors, warnings, linterResults, targets } = (0, compile_js_1.compileClaude)(spec, {
|
|
340
|
+
const { markdown, errors, warnings, linterResults, targets } = await (0, compile_js_1.compileClaude)(spec, {
|
|
341
341
|
basePath,
|
|
342
342
|
specFile: specPath,
|
|
343
343
|
dialect,
|
|
@@ -471,9 +471,9 @@ function formatArtifactSize(markdown) {
|
|
|
471
471
|
return `${size} · ~${String(kTokens)}k tokens est.`;
|
|
472
472
|
}
|
|
473
473
|
/** Compile a declarative SkillSpec → SKILL.md. */
|
|
474
|
-
function compileSkillToFile(spec, specPath, dialect) {
|
|
474
|
+
async function compileSkillToFile(spec, specPath, dialect) {
|
|
475
475
|
const outputPath = specPath.replace(/\.spec\.ts$/, "");
|
|
476
|
-
const { artifact, errors, warnings } = (0, compile_js_1.compileSkill)(spec, {
|
|
476
|
+
const { artifact, errors, warnings } = await (0, compile_js_1.compileSkill)(spec, {
|
|
477
477
|
basePath: process.cwd(),
|
|
478
478
|
specFile: specPath,
|
|
479
479
|
// The SKILL.md frontmatter profile comes from the resolved harness — a Codex
|
|
@@ -495,9 +495,9 @@ function compileSkillToFile(spec, specPath, dialect) {
|
|
|
495
495
|
return false;
|
|
496
496
|
}
|
|
497
497
|
/** Compile a subagent spec → agents/<name>.md (with its result-contract section). */
|
|
498
|
-
function compileAgentToFile(spec, specPath, dialect) {
|
|
498
|
+
async function compileAgentToFile(spec, specPath, dialect) {
|
|
499
499
|
const outputPath = specPath.replace(/\.spec\.ts$/, "");
|
|
500
|
-
const { artifact, errors, warnings } = (0, compile_js_1.compileAgent)(spec, {
|
|
500
|
+
const { artifact, errors, warnings } = await (0, compile_js_1.compileAgent)(spec, {
|
|
501
501
|
basePath: process.cwd(),
|
|
502
502
|
specFile: specPath,
|
|
503
503
|
dialect,
|
|
@@ -592,7 +592,7 @@ async function compile(specPaths, config, excludes, opts = {}) {
|
|
|
592
592
|
const specDialect = opts.harnessFlag === undefined
|
|
593
593
|
? ((0, adapter_registry_js_1.adapterForInstructionFile)(targetFile)?.dialect ?? dialect)
|
|
594
594
|
: dialect;
|
|
595
|
-
if (compileClaudeToFile(spec, specPath, config, specDialect)) {
|
|
595
|
+
if (await compileClaudeToFile(spec, specPath, config, specDialect)) {
|
|
596
596
|
writeInstructionMirrors(specPath.replace(/\.spec\.ts$/, ""), declaredHarnesses);
|
|
597
597
|
}
|
|
598
598
|
else {
|
|
@@ -608,11 +608,11 @@ async function compile(specPaths, config, excludes, opts = {}) {
|
|
|
608
608
|
for (const w of (0, skill_harness_js_1.skillFrontmatterDropWarnings)(spec, forHarnesses)) {
|
|
609
609
|
console.log(`⚠ ${w}`);
|
|
610
610
|
}
|
|
611
|
-
if (!compileSkillToFile(spec, specPath, dialect))
|
|
611
|
+
if (!(await compileSkillToFile(spec, specPath, dialect)))
|
|
612
612
|
allValid = false;
|
|
613
613
|
}
|
|
614
614
|
else if (spec._specType === "agent") {
|
|
615
|
-
if (!compileAgentToFile(spec, specPath, dialect))
|
|
615
|
+
if (!(await compileAgentToFile(spec, specPath, dialect)))
|
|
616
616
|
allValid = false;
|
|
617
617
|
}
|
|
618
618
|
else if (spec._specType === "railway") {
|
|
@@ -821,7 +821,7 @@ async function findDuplicateRules(excludes, threshold = 0.3, silent = false, sco
|
|
|
821
821
|
* Each named file is parsed on demand; there is no project-wide index. Returns
|
|
822
822
|
* the count of broken references.
|
|
823
823
|
*/
|
|
824
|
-
function verifyMarkdownSymbols(files, silent) {
|
|
824
|
+
async function verifyMarkdownSymbols(files, silent) {
|
|
825
825
|
if (files.length === 0)
|
|
826
826
|
return 0;
|
|
827
827
|
const cwd = process.cwd();
|
|
@@ -835,7 +835,7 @@ function verifyMarkdownSymbols(files, silent) {
|
|
|
835
835
|
catch {
|
|
836
836
|
continue;
|
|
837
837
|
}
|
|
838
|
-
const broken = (0, refs_js_1.verifySymbolRefs)(markdown, (0, node_path_1.dirname)((0, node_path_1.resolve)(cwd, f)));
|
|
838
|
+
const broken = await (0, refs_js_1.verifySymbolRefs)(markdown, (0, node_path_1.dirname)((0, node_path_1.resolve)(cwd, f)));
|
|
839
839
|
if (broken.length === 0)
|
|
840
840
|
continue;
|
|
841
841
|
if (!silent) {
|
|
@@ -1361,7 +1361,7 @@ async function checkSpecRefs(excludes, config, silent, dialect) {
|
|
|
1361
1361
|
// collected lazily so a repo with no railway spec never pays for the walk.
|
|
1362
1362
|
if (spec._specType === "railway")
|
|
1363
1363
|
knownAgents ??= await collectAgentNames(excludes);
|
|
1364
|
-
const errors = specCompileErrors(spec, specPath, dialect, config, knownAgents ?? []);
|
|
1364
|
+
const errors = await specCompileErrors(spec, specPath, dialect, config, knownAgents ?? []);
|
|
1365
1365
|
for (const e of errors)
|
|
1366
1366
|
found.push(`${target}: ${e.message} (from ${specPath})`);
|
|
1367
1367
|
}
|
|
@@ -1399,11 +1399,11 @@ async function checkSpecRefs(excludes, config, silent, dialect) {
|
|
|
1399
1399
|
* only the options differ. Exhaustive over `_specType`, so a FIFTH spec type is
|
|
1400
1400
|
* a tsc error here instead of a silent skip, which is the failure this closes.
|
|
1401
1401
|
*/
|
|
1402
|
-
function specCompileErrors(spec, specPath, dialect, config, knownAgents) {
|
|
1402
|
+
async function specCompileErrors(spec, specPath, dialect, config, knownAgents) {
|
|
1403
1403
|
const basePath = process.cwd();
|
|
1404
1404
|
switch (spec._specType) {
|
|
1405
1405
|
case "claude":
|
|
1406
|
-
return (0, compile_js_1.compileClaude)(spec, {
|
|
1406
|
+
return (await (0, compile_js_1.compileClaude)(spec, {
|
|
1407
1407
|
basePath,
|
|
1408
1408
|
specFile: specPath,
|
|
1409
1409
|
dialect,
|
|
@@ -1412,13 +1412,11 @@ function specCompileErrors(spec, specPath, dialect, config, knownAgents) {
|
|
|
1412
1412
|
maxSectionLines: config?.maxSectionLines,
|
|
1413
1413
|
catalogOnly: config?.catalogOnly,
|
|
1414
1414
|
linters: config?.linters,
|
|
1415
|
-
}).errors;
|
|
1415
|
+
})).errors;
|
|
1416
1416
|
case "skill":
|
|
1417
|
-
return (0, compile_js_1.compileSkill)(spec, { basePath, specFile: specPath, dialect })
|
|
1418
|
-
.errors;
|
|
1417
|
+
return (await (0, compile_js_1.compileSkill)(spec, { basePath, specFile: specPath, dialect })).errors;
|
|
1419
1418
|
case "agent":
|
|
1420
|
-
return (0, compile_js_1.compileAgent)(spec, { basePath, specFile: specPath, dialect })
|
|
1421
|
-
.errors;
|
|
1419
|
+
return (await (0, compile_js_1.compileAgent)(spec, { basePath, specFile: specPath, dialect })).errors;
|
|
1422
1420
|
case "railway":
|
|
1423
1421
|
return (0, compile_js_1.compileRailway)(spec, { specFile: specPath, knownAgents }).errors;
|
|
1424
1422
|
default:
|
|
@@ -1725,7 +1723,7 @@ async function runLint(restArgs, flags, excludes, config) {
|
|
|
1725
1723
|
}
|
|
1726
1724
|
}
|
|
1727
1725
|
// 9. Verify code-shaped symbol references live (see src/refs.ts).
|
|
1728
|
-
const symbolRefErrors = verifyMarkdownSymbols(files, silent);
|
|
1726
|
+
const symbolRefErrors = await verifyMarkdownSymbols(files, silent);
|
|
1729
1727
|
// 10. Verify `vigiles:mcp server#tool` marks against live MCP servers
|
|
1730
1728
|
// (only when a .mcp.json declares them). See src/mcp.ts.
|
|
1731
1729
|
const mcpRefErrors = await verifyMarkdownMcpRefs(files, silent);
|
|
@@ -5648,7 +5646,7 @@ async function handleHookRuntime(kind, restArgs) {
|
|
|
5648
5646
|
actionHookCommand();
|
|
5649
5647
|
return;
|
|
5650
5648
|
case "refs":
|
|
5651
|
-
refsHookCommand();
|
|
5649
|
+
await refsHookCommand();
|
|
5652
5650
|
return;
|
|
5653
5651
|
case "eval-lock-nudge":
|
|
5654
5652
|
evalLockNudgeHookCommand();
|
|
@@ -5797,7 +5795,7 @@ function evalLockNudgeHookCommand() {
|
|
|
5797
5795
|
* agent mark its references, at write time, with full context. `vigiles:ignore`
|
|
5798
5796
|
* opts a prose span out.
|
|
5799
5797
|
*/
|
|
5800
|
-
function refsHookCommand() {
|
|
5798
|
+
async function refsHookCommand() {
|
|
5801
5799
|
let raw = "";
|
|
5802
5800
|
try {
|
|
5803
5801
|
raw = (0, node_fs_1.readFileSync)(0, "utf-8");
|
|
@@ -5830,7 +5828,7 @@ function refsHookCommand() {
|
|
|
5830
5828
|
catch {
|
|
5831
5829
|
return;
|
|
5832
5830
|
}
|
|
5833
|
-
const issues = (0, refs_js_1.collectRefIssues)(markdown, (0, node_path_1.dirname)((0, node_path_1.resolve)(cwd, file)));
|
|
5831
|
+
const issues = await (0, refs_js_1.collectRefIssues)(markdown, (0, node_path_1.dirname)((0, node_path_1.resolve)(cwd, file)));
|
|
5834
5832
|
const action = (0, refs_js_1.refsHookAction)(issues.length, severity);
|
|
5835
5833
|
if (action === "ok")
|
|
5836
5834
|
return;
|
package/dist/codex.js
CHANGED
|
@@ -14,6 +14,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// 🔴 PUBLIC ENTRY POINT `vigiles/codex` — every export here is a promise to users. The default for a
|
|
18
|
+
// symbol is INTERNAL. It is exported only if (a) a NAMED external consumer uses it, or (b) it is
|
|
19
|
+
// a deliberate extension point listed in STABILITY.md (the adapter kit is the example). "Might
|
|
20
|
+
// be useful" is neither. Review point: the diff of `api-surface/vigiles-codex.api.md`, which
|
|
21
|
+
// `npm run api:check` fails on.
|
|
17
22
|
/**
|
|
18
23
|
* `vigiles/codex` — the OpenAI Codex harness adapter. Sits beside
|
|
19
24
|
* `vigiles/claude-code`: same harness-agnostic `vigiles` testing core, a
|
package/dist/core/compile.d.ts
CHANGED
|
@@ -63,7 +63,7 @@ export interface CompileError {
|
|
|
63
63
|
export declare function validateFileRef(filePath: string, basePath: string): CompileError | null;
|
|
64
64
|
export declare function readPackageScripts(basePath: string): Record<string, string> | null;
|
|
65
65
|
export declare function validateCommandRef(command: string, basePath: string): CompileError | null;
|
|
66
|
-
export declare function validateSymbolRef(file: string, name: string, basePath: string): CompileError | null
|
|
66
|
+
export declare function validateSymbolRef(file: string, name: string, basePath: string): Promise<CompileError | null>;
|
|
67
67
|
export declare function validateDirRef(dirPath: string, basePath: string): CompileError | null;
|
|
68
68
|
export declare function validateGlobRef(pattern: string, basePath: string): CompileError | null;
|
|
69
69
|
export interface CompileClaudeResult {
|
|
@@ -142,7 +142,7 @@ export declare const DEFAULT_MAX_SECTION_CHARS = 15000;
|
|
|
142
142
|
* Returns the compiled markdown, validation errors, and linter check results.
|
|
143
143
|
* The markdown is generated even if there are errors (with warnings).
|
|
144
144
|
*/
|
|
145
|
-
export declare function compileClaude(spec: ClaudeSpec, options?: CompileClaudeOptions): CompileClaudeResult
|
|
145
|
+
export declare function compileClaude(spec: ClaudeSpec, options?: CompileClaudeOptions): Promise<CompileClaudeResult>;
|
|
146
146
|
export interface CompileSkillResult {
|
|
147
147
|
/**
|
|
148
148
|
* The stamped artifact — present ONLY when `errors` is empty. `null` is what
|
|
@@ -163,7 +163,7 @@ export declare function compileSkill(spec: SkillSpec, options?: {
|
|
|
163
163
|
/** The harness dialect — supplies `skillFrontmatterKeys`. Omitting it emits
|
|
164
164
|
* every key the compiler can render, so existing callers are unchanged. */
|
|
165
165
|
dialect?: HarnessDialect;
|
|
166
|
-
}): CompileSkillResult
|
|
166
|
+
}): Promise<CompileSkillResult>;
|
|
167
167
|
export interface CompileAgentResult {
|
|
168
168
|
/**
|
|
169
169
|
* The stamped artifact — present ONLY when `errors` is empty. `null` is what
|
|
@@ -186,7 +186,7 @@ export declare function compileAgent(spec: AgentSpec, options: {
|
|
|
186
186
|
/** The harness dialect to verify the tool contract against (required — the
|
|
187
187
|
* core defines no default dialect; the adapter/composition root injects it). */
|
|
188
188
|
dialect: HarnessDialect;
|
|
189
|
-
}): CompileAgentResult
|
|
189
|
+
}): Promise<CompileAgentResult>;
|
|
190
190
|
export interface CompileRailwayOptions {
|
|
191
191
|
/** Names of compiled agents, to resolve `delegate` targets. Skipped if omitted. */
|
|
192
192
|
knownAgents?: readonly string[];
|
|
@@ -230,5 +230,5 @@ export interface AdoptResult {
|
|
|
230
230
|
* Compare a generated file against what the spec would produce.
|
|
231
231
|
* Returns the diff so users can see what was manually changed.
|
|
232
232
|
*/
|
|
233
|
-
export declare function adoptDiff(filePath: string, spec: ClaudeSpec | SkillSpec | AgentSpec, basePath: string, dialect: HarnessDialect): AdoptResult
|
|
233
|
+
export declare function adoptDiff(filePath: string, spec: ClaudeSpec | SkillSpec | AgentSpec, basePath: string, dialect: HarnessDialect): Promise<AdoptResult>;
|
|
234
234
|
//# sourceMappingURL=compile.d.ts.map
|
package/dist/core/compile.js
CHANGED
|
@@ -169,7 +169,7 @@ function validateCommandRef(command, basePath) {
|
|
|
169
169
|
}
|
|
170
170
|
return null;
|
|
171
171
|
}
|
|
172
|
-
function validateSymbolRef(file, name, basePath) {
|
|
172
|
+
async function validateSymbolRef(file, name, basePath) {
|
|
173
173
|
const full = (0, node_path_1.resolve)(basePath, file);
|
|
174
174
|
if (!(0, node_fs_1.existsSync)(full)) {
|
|
175
175
|
return {
|
|
@@ -178,7 +178,7 @@ function validateSymbolRef(file, name, basePath) {
|
|
|
178
178
|
path: file,
|
|
179
179
|
};
|
|
180
180
|
}
|
|
181
|
-
const support = (0, symbols_js_1.langForFile)(file);
|
|
181
|
+
const support = await (0, symbols_js_1.langForFile)(file);
|
|
182
182
|
if (support.kind === "unsupported") {
|
|
183
183
|
return {
|
|
184
184
|
type: "stale-ref",
|
|
@@ -186,16 +186,16 @@ function validateSymbolRef(file, name, basePath) {
|
|
|
186
186
|
path: file,
|
|
187
187
|
};
|
|
188
188
|
}
|
|
189
|
-
if (support.kind === "grammar-
|
|
190
|
-
// The language is parseable by this tool;
|
|
189
|
+
if (support.kind === "grammar-load-failed") {
|
|
190
|
+
// The language is parseable by this tool; its grammar failed to load in THIS process.
|
|
191
191
|
// Distinct wording on purpose — see the union's docblock in core/symbols.ts.
|
|
192
192
|
return {
|
|
193
193
|
type: "stale-ref",
|
|
194
|
-
message:
|
|
194
|
+
message: (0, symbols_js_1.notCheckedReason)(support),
|
|
195
195
|
path: file,
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
if (!(0, symbols_js_1.fileDefinesSymbol)(full, name)) {
|
|
198
|
+
if (!(await (0, symbols_js_1.fileDefinesSymbol)(full, name))) {
|
|
199
199
|
return {
|
|
200
200
|
type: "stale-ref",
|
|
201
201
|
message: `"${name}" is not defined in ${file}`,
|
|
@@ -235,18 +235,18 @@ function validateGlobRef(pattern, basePath) {
|
|
|
235
235
|
}
|
|
236
236
|
return null;
|
|
237
237
|
}
|
|
238
|
-
function validateRefs(fragments, basePath) {
|
|
238
|
+
async function validateRefs(fragments, basePath) {
|
|
239
239
|
const errors = [];
|
|
240
240
|
for (const fragment of fragments) {
|
|
241
241
|
if (typeof fragment !== "string") {
|
|
242
|
-
errors.push(...validateOneRef(fragment, basePath));
|
|
242
|
+
errors.push(...(await validateOneRef(fragment, basePath)));
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
return errors;
|
|
246
246
|
}
|
|
247
247
|
const wrap = (e) => (e ? [e] : []);
|
|
248
248
|
/** Validate a single non-string fragment (a `Ref` or `EffectRegion`). */
|
|
249
|
-
function validateOneRef(r, basePath) {
|
|
249
|
+
async function validateOneRef(r, basePath) {
|
|
250
250
|
switch (r._ref) {
|
|
251
251
|
case "file":
|
|
252
252
|
return wrap(validateFileRef(r.path, basePath));
|
|
@@ -263,7 +263,7 @@ function validateOneRef(r, basePath) {
|
|
|
263
263
|
]
|
|
264
264
|
: [];
|
|
265
265
|
case "symbol":
|
|
266
|
-
return wrap(validateSymbolRef(r.file, r.symbol, basePath));
|
|
266
|
+
return wrap(await validateSymbolRef(r.file, r.symbol, basePath));
|
|
267
267
|
case "dir":
|
|
268
268
|
return wrap(validateDirRef(r.path, basePath));
|
|
269
269
|
case "glob":
|
|
@@ -448,7 +448,7 @@ const RESERVED_SECTION_KEYS = new Set([
|
|
|
448
448
|
"key_files",
|
|
449
449
|
"rules",
|
|
450
450
|
]);
|
|
451
|
-
function compileSectionsSection(spec, basePath, maxSectionLines) {
|
|
451
|
+
async function compileSectionsSection(spec, basePath, maxSectionLines) {
|
|
452
452
|
if (!spec.sections)
|
|
453
453
|
return { lines: [], errors: [] };
|
|
454
454
|
const lines = [];
|
|
@@ -467,7 +467,7 @@ function compileSectionsSection(spec, basePath, maxSectionLines) {
|
|
|
467
467
|
lines.push(`## ${heading}\n\n${content.trim()}`);
|
|
468
468
|
}
|
|
469
469
|
else {
|
|
470
|
-
errors.push(...validateRefs(content, basePath));
|
|
470
|
+
errors.push(...(await validateRefs(content, basePath)));
|
|
471
471
|
const rendered = content.map(renderFragment).join("");
|
|
472
472
|
errors.push(...validateSectionContent(name, rendered, maxSectionLines));
|
|
473
473
|
lines.push(`## ${heading}\n\n${rendered.trim()}`);
|
|
@@ -581,7 +581,7 @@ function compileRulesSection(spec, basePath, options) {
|
|
|
581
581
|
// (no frontmatter), so Codex/OpenCode reuse it unchanged — only the h1 target
|
|
582
582
|
// differs, which already comes from the injected dialect. Nothing here is
|
|
583
583
|
// CC-only, so there is no per-dialect branch to gate.
|
|
584
|
-
function compileClaude(spec, options = {}) {
|
|
584
|
+
async function compileClaude(spec, options = {}) {
|
|
585
585
|
const targets = spec.target ?? options.dialect?.instructionTargets[0] ?? DEFAULT_TARGET;
|
|
586
586
|
const target = Array.isArray(targets) ? targets[0] : targets;
|
|
587
587
|
const basePath = options.basePath ?? process.cwd();
|
|
@@ -614,7 +614,7 @@ function compileClaude(spec, options = {}) {
|
|
|
614
614
|
}
|
|
615
615
|
// Per-spec maxSectionLines takes precedence, then compile options
|
|
616
616
|
const maxSectionLines = spec.maxSectionLines ?? options.maxSectionLines;
|
|
617
|
-
const prose = compileSectionsSection(spec, basePath, maxSectionLines);
|
|
617
|
+
const prose = await compileSectionsSection(spec, basePath, maxSectionLines);
|
|
618
618
|
const keyFiles = compileKeyFilesSection(spec, basePath);
|
|
619
619
|
const commands = compileCommandsSection(spec, basePath);
|
|
620
620
|
const rules = compileRulesSection(spec, basePath, options);
|
|
@@ -902,7 +902,7 @@ function checkInlineCode(markdown, max) {
|
|
|
902
902
|
/**
|
|
903
903
|
* Compile a SkillSpec into SKILL.md markdown with YAML frontmatter.
|
|
904
904
|
*/
|
|
905
|
-
function compileSkill(spec, options = {}) {
|
|
905
|
+
async function compileSkill(spec, options = {}) {
|
|
906
906
|
// 🔴 NORMALISE FIRST, before anything reads the spec. `compileSkill` accepts a
|
|
907
907
|
// `SkillSpec` STRUCTURALLY, so a caller can hand us `{ _specType: "skill", …,
|
|
908
908
|
// result: cmd(…) }` without ever touching `experimental_skill()`. Both readers
|
|
@@ -931,7 +931,7 @@ function compileSkill(spec, options = {}) {
|
|
|
931
931
|
});
|
|
932
932
|
}
|
|
933
933
|
}
|
|
934
|
-
errors.push(...validateRefs(collectSkillRefs(spec), basePath));
|
|
934
|
+
errors.push(...(await validateRefs(collectSkillRefs(spec), basePath)));
|
|
935
935
|
// A typed `output` Result contract is valid ONLY for a forked skill: an inline
|
|
936
936
|
// skill has no call→return boundary, so a typed outcome there is a category
|
|
937
937
|
// error (see research/spec-syntax-and-railway-scope.md). Enforce it at compile.
|
|
@@ -1063,7 +1063,7 @@ function purityMarker(purity) {
|
|
|
1063
1063
|
return `<!-- vigiles:purity:${level} -->`;
|
|
1064
1064
|
}
|
|
1065
1065
|
/** Render the subagent's named `##` system-prompt sections (verified like CLAUDE.md). */
|
|
1066
|
-
function renderAgentSections(sections, basePath) {
|
|
1066
|
+
async function renderAgentSections(sections, basePath) {
|
|
1067
1067
|
const lines = [];
|
|
1068
1068
|
const errors = [];
|
|
1069
1069
|
for (const [name, content] of Object.entries(sections)) {
|
|
@@ -1079,7 +1079,7 @@ function renderAgentSections(sections, basePath) {
|
|
|
1079
1079
|
lines.push(`## ${heading}\n\n${content.trim()}`);
|
|
1080
1080
|
}
|
|
1081
1081
|
else {
|
|
1082
|
-
errors.push(...validateRefs(content, basePath));
|
|
1082
|
+
errors.push(...(await validateRefs(content, basePath)));
|
|
1083
1083
|
const rendered = content.map(renderFragment).join("");
|
|
1084
1084
|
errors.push(...validateSectionContent(name, rendered));
|
|
1085
1085
|
lines.push(`## ${heading}\n\n${rendered.trim()}`);
|
|
@@ -1134,7 +1134,7 @@ function renderAgentRules(rules) {
|
|
|
1134
1134
|
* Verifies the tool contract and the body's references; the marks the body
|
|
1135
1135
|
* carries (`vigiles:symbol`, file/cmd refs) are the same ones `lint` re-checks.
|
|
1136
1136
|
*/
|
|
1137
|
-
function compileAgent(spec, options) {
|
|
1137
|
+
async function compileAgent(spec, options) {
|
|
1138
1138
|
const basePath = options.basePath ?? process.cwd();
|
|
1139
1139
|
const specFile = options.specFile ?? "agent.md.spec.ts";
|
|
1140
1140
|
const dialect = options.dialect;
|
|
@@ -1169,13 +1169,13 @@ function compileAgent(spec, options) {
|
|
|
1169
1169
|
}
|
|
1170
1170
|
}
|
|
1171
1171
|
if (Array.isArray(spec.body)) {
|
|
1172
|
-
errors.push(...validateRefs(spec.body, basePath));
|
|
1172
|
+
errors.push(...(await validateRefs(spec.body, basePath)));
|
|
1173
1173
|
}
|
|
1174
1174
|
const sections = [];
|
|
1175
1175
|
if (spec.body !== undefined)
|
|
1176
1176
|
sections.push(renderBody(spec.body).trim());
|
|
1177
1177
|
if (spec.sections) {
|
|
1178
|
-
const result = renderAgentSections(spec.sections, basePath);
|
|
1178
|
+
const result = await renderAgentSections(spec.sections, basePath);
|
|
1179
1179
|
sections.push(...result.lines);
|
|
1180
1180
|
errors.push(...result.errors);
|
|
1181
1181
|
}
|
|
@@ -1287,7 +1287,7 @@ function checkFileHash(filePath) {
|
|
|
1287
1287
|
* Compare a generated file against what the spec would produce.
|
|
1288
1288
|
* Returns the diff so users can see what was manually changed.
|
|
1289
1289
|
*/
|
|
1290
|
-
function adoptDiff(filePath, spec, basePath, dialect) {
|
|
1290
|
+
async function adoptDiff(filePath, spec, basePath, dialect) {
|
|
1291
1291
|
const fullPath = (0, node_path_1.resolve)(basePath, filePath);
|
|
1292
1292
|
const currentContent = (0, node_fs_1.existsSync)(fullPath)
|
|
1293
1293
|
? (0, node_fs_1.readFileSync)(fullPath, "utf-8")
|
|
@@ -1296,7 +1296,7 @@ function adoptDiff(filePath, spec, basePath, dialect) {
|
|
|
1296
1296
|
// Compile the spec to get what it WOULD produce
|
|
1297
1297
|
let compiledContent = null;
|
|
1298
1298
|
if (spec._specType === "claude") {
|
|
1299
|
-
const { markdown } = compileClaude(spec, {
|
|
1299
|
+
const { markdown } = await compileClaude(spec, {
|
|
1300
1300
|
basePath,
|
|
1301
1301
|
specFile: filePath,
|
|
1302
1302
|
dialect,
|
|
@@ -1304,11 +1304,14 @@ function adoptDiff(filePath, spec, basePath, dialect) {
|
|
|
1304
1304
|
compiledContent = markdown;
|
|
1305
1305
|
}
|
|
1306
1306
|
else if (spec._specType === "skill") {
|
|
1307
|
-
const { markdown } = compileSkill(spec, {
|
|
1307
|
+
const { markdown } = await compileSkill(spec, {
|
|
1308
|
+
basePath,
|
|
1309
|
+
specFile: filePath,
|
|
1310
|
+
});
|
|
1308
1311
|
compiledContent = markdown;
|
|
1309
1312
|
}
|
|
1310
1313
|
else if (spec._specType === "agent") {
|
|
1311
|
-
const { markdown } = compileAgent(spec, {
|
|
1314
|
+
const { markdown } = await compileAgent(spec, {
|
|
1312
1315
|
basePath,
|
|
1313
1316
|
specFile: filePath,
|
|
1314
1317
|
dialect,
|
|
@@ -69,20 +69,20 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
69
69
|
checkboxes: "checkboxes";
|
|
70
70
|
}>>>;
|
|
71
71
|
rules: z.ZodPrefault<z.ZodObject<{
|
|
72
|
-
"spec-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
73
|
-
"orphan-docs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
74
|
-
"duplicate-rules": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
75
|
-
"require-instructions-spec": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
76
|
-
"require-skill-spec": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
77
|
-
integrity: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
78
|
-
coverage: z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
72
|
+
"spec-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
73
|
+
"orphan-docs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
74
|
+
"duplicate-rules": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
75
|
+
"require-instructions-spec": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
76
|
+
"require-skill-spec": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
77
|
+
integrity: z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
78
|
+
coverage: z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
79
79
|
linterRules: z.ZodOptional<z.ZodNumber>;
|
|
80
80
|
scripts: z.ZodOptional<z.ZodNumber>;
|
|
81
81
|
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodLiteral<"error">, z.ZodObject<{
|
|
82
82
|
linterRules: z.ZodOptional<z.ZodNumber>;
|
|
83
83
|
scripts: z.ZodOptional<z.ZodNumber>;
|
|
84
84
|
}, z.core.$strict>], null>]>>;
|
|
85
|
-
"untested-skill": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
85
|
+
"untested-skill": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
86
86
|
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
87
87
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
88
88
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
@@ -91,7 +91,7 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
91
91
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
92
92
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
93
93
|
}, z.core.$strict>], null>]>>;
|
|
94
|
-
"untested-subagent": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
94
|
+
"untested-subagent": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
95
95
|
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
96
96
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
97
97
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
@@ -100,7 +100,7 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
100
100
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
101
101
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
102
102
|
}, z.core.$strict>], null>]>>;
|
|
103
|
-
"untested-hook": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
103
|
+
"untested-hook": z.ZodDefault<z.ZodUnion<readonly [z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
104
104
|
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
105
105
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
106
106
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
@@ -109,28 +109,28 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
109
109
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
110
110
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
111
111
|
}, z.core.$strict>], null>]>>;
|
|
112
|
-
"unmarked-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
113
|
-
"subagent-tool-contract": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
114
|
-
"hook-events": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
115
|
-
"subagent-frontmatter": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
116
|
-
"mcp-config": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
117
|
-
"skill-frontmatter": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
118
|
-
"mcp-tool-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
119
|
-
"hook-script-exists": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
120
|
-
"prefer-compiled-hooks": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
121
|
-
"disallowed-tools-contract": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
122
|
-
"description-overlap": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
123
|
-
"skill-description-budget": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
124
|
-
"frontmatter-valid": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
125
|
-
"mcp-hook-target-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
126
|
-
"lethal-trifecta": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
127
|
-
"skill-resource-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
128
|
-
"skill-missing-fence": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
129
|
-
"plugin-dir-layout": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
130
|
-
"delegation-trifecta": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
131
|
-
"hook-block-ineffective": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
132
|
-
"hook-matcher": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
133
|
-
"doc-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "
|
|
112
|
+
"unmarked-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
113
|
+
"subagent-tool-contract": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
114
|
+
"hook-events": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
115
|
+
"subagent-frontmatter": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
116
|
+
"mcp-config": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
117
|
+
"skill-frontmatter": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
118
|
+
"mcp-tool-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
119
|
+
"hook-script-exists": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
120
|
+
"prefer-compiled-hooks": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
121
|
+
"disallowed-tools-contract": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
122
|
+
"description-overlap": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
123
|
+
"skill-description-budget": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
124
|
+
"frontmatter-valid": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
125
|
+
"mcp-hook-target-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
126
|
+
"lethal-trifecta": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
127
|
+
"skill-resource-resolves": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
128
|
+
"skill-missing-fence": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
129
|
+
"plugin-dir-layout": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
130
|
+
"delegation-trifecta": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
131
|
+
"hook-block-ineffective": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
132
|
+
"hook-matcher": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
133
|
+
"doc-refs": z.ZodDefault<z.ZodPipe<z.ZodUnion<readonly [z.ZodLiteral<"warn">, z.ZodLiteral<"error">, z.ZodLiteral<false>, z.ZodLiteral<"off">, z.ZodLiteral<0>, z.ZodLiteral<1>, z.ZodLiteral<2>, z.ZodLiteral<true>]>, z.ZodTransform<false | "warn" | "error", boolean | 0 | 1 | 2 | "warn" | "error" | "off">>>;
|
|
134
134
|
}, z.core.$strict>>;
|
|
135
135
|
files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
136
|
maxRules: z.ZodOptional<z.ZodNumber>;
|
package/dist/core/refs.d.ts
CHANGED
|
@@ -26,7 +26,7 @@ export declare function symbolRefs(markdown: string): SymbolRef[];
|
|
|
26
26
|
* file must exist and define the named symbol. `basePath` is the directory the
|
|
27
27
|
* paths resolve against (the instruction file's own directory).
|
|
28
28
|
*/
|
|
29
|
-
export declare function verifySymbolRefs(markdown: string, basePath: string): SymbolRefError[]
|
|
29
|
+
export declare function verifySymbolRefs(markdown: string, basePath: string): Promise<SymbolRefError[]>;
|
|
30
30
|
/**
|
|
31
31
|
* Whether a span is a **linter-rule reference** that ought to be marked
|
|
32
32
|
* (`enforce()` / inline `<!-- vigiles:enforce -->`) so the lint can verify the
|
|
@@ -50,7 +50,7 @@ export declare function unmarkedCodeRefs(markdown: string): Span[];
|
|
|
50
50
|
* code-shaped span that ought to be a mark. The shared detector behind both the
|
|
51
51
|
* `vigiles refs` CLI and the PostToolUse refs-hook.
|
|
52
52
|
*/
|
|
53
|
-
export declare function collectRefIssues(markdown: string, basePath: string): string[]
|
|
53
|
+
export declare function collectRefIssues(markdown: string, basePath: string): Promise<string[]>;
|
|
54
54
|
/** What the refs-hook should do given the issue count and configured severity. */
|
|
55
55
|
export type RefsHookAction = "ok" | "nudge" | "block";
|
|
56
56
|
/**
|