vigiles 27.3.0 → 29.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/README.md +1 -1
- package/dist/adapter-registry.d.ts +39 -0
- package/dist/adapter-registry.js +45 -0
- package/dist/adapter.d.ts +8 -0
- package/dist/adapter.js +10 -1
- package/dist/adapters/claude-code/adapter.js +9 -2
- package/dist/adapters/claude-code/layout.d.ts +5 -0
- package/dist/adapters/claude-code/plugin-loader.d.ts +10 -1
- package/dist/adapters/claude-code/plugin-loader.js +10 -1
- package/dist/adapters/codex/adapter.js +7 -2
- package/dist/adapters/codex/layout.d.ts +51 -5
- package/dist/adapters/codex/layout.js +13 -4
- package/dist/adapters/opencode/adapter.js +6 -0
- package/dist/audit-report.template.html +1 -1
- package/dist/audit-score.d.ts +7 -0
- package/dist/audit-score.js +49 -2
- package/dist/cli-main.js +162 -39
- package/dist/core/adapter.d.ts +45 -1
- package/dist/core/compile.js +11 -1
- package/dist/core/config-schema.d.ts +244 -0
- package/dist/core/config-schema.js +452 -0
- package/dist/core/hook-program.d.ts +43 -0
- package/dist/core/hook-program.js +32 -0
- package/dist/core/refs.js +10 -1
- package/dist/core/surface-discovery.d.ts +270 -0
- package/dist/core/surface-discovery.js +425 -0
- package/dist/core/surface-scopes.d.ts +38 -1
- package/dist/core/surface-scopes.js +73 -1
- package/dist/core/symbols.d.ts +24 -2
- package/dist/core/symbols.js +66 -18
- package/dist/core/types.d.ts +36 -107
- package/dist/core/validate.d.ts +46 -18
- package/dist/core/validate.js +98 -172
- package/dist/exclude.d.ts +20 -0
- package/dist/exclude.js +11 -1
- package/dist/harness-test.js +3 -3
- package/dist/hook-install.d.ts +53 -0
- package/dist/hook-install.js +60 -0
- package/dist/hook-runtime.d.ts +2 -2
- package/dist/hook-runtime.js +82 -63
- package/dist/layout-registry.d.ts +14 -0
- package/dist/layout-registry.js +40 -0
- package/dist/load-hook.d.ts +1 -1
- package/dist/load-hook.js +2 -2
- package/dist/plugin-loader.d.ts +49 -1
- package/dist/plugin-loader.js +120 -14
- package/dist/run-hook.js +17 -1
- package/dist/scan-core.d.ts +19 -0
- package/dist/scan-core.js +30 -0
- package/dist/scan-files.js +15 -5
- package/dist/scan.d.ts +63 -0
- package/dist/scan.js +68 -12
- package/dist/score-core.js +8 -0
- package/dist/setup-plan.d.ts +2 -1
- package/dist/setup-plan.js +7 -2
- package/dist/surface-discovery-fs.d.ts +12 -0
- package/dist/surface-discovery-fs.js +108 -0
- package/dist/vigilesrc.schema.json +1689 -0
- package/package.json +10 -6
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `.vigilesrc.json`, AS A SCHEMA — the one place the config's shape, its
|
|
3
|
+
* defaults and its error messages live.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 WHY A SCHEMA AND NOT THE HAND-WRITTEN CHECKS IT REPLACED. `loadConfig` used
|
|
6
|
+
* to coerce the keys it happened to remember (`asStringArray` on three of them),
|
|
7
|
+
* spread everything else through untouched, and say nothing at all about a key
|
|
8
|
+
* it had never heard of. MEASURED on this repo's own CLI before the change:
|
|
9
|
+
*
|
|
10
|
+
* ```
|
|
11
|
+
* $ echo '{"surfaceRootz":[".ai"]}' > .vigilesrc.json && vigiles audit .
|
|
12
|
+
* (no complaint about the unknown key — exit 0)
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* A key the tool does not read is a line the user believes is working. That is
|
|
16
|
+
* the product's own subject — a passing signal standing in for work nobody did —
|
|
17
|
+
* happening inside the tool, so the shape is now DECLARED and anything outside
|
|
18
|
+
* it is named out loud.
|
|
19
|
+
*
|
|
20
|
+
* THE TYPE IS DERIVED FROM THIS, not written beside it: `VigilesConfig` is
|
|
21
|
+
* `z.infer<typeof vigilesConfigSchema>` (see `./types.ts`), so a field cannot
|
|
22
|
+
* exist in the type and not in the validator, which is how `surfaceRoots` ended
|
|
23
|
+
* up documented in `docs/cli.md` for a week after it stopped being read.
|
|
24
|
+
*
|
|
25
|
+
* DEFAULTS LIVE HERE TOO, and that is what makes the derivation exact. Every key
|
|
26
|
+
* the loaded config is guaranteed to carry (`rules`, `files`, `ruleMarkers`)
|
|
27
|
+
* carries a Zod `.default(...)`, and Zod's inferred OUTPUT type for a defaulted
|
|
28
|
+
* field is non-optional — so `z.infer` reproduces the old
|
|
29
|
+
* `rules: Required<RulesConfig>` exactly, rather than approximating it. Parsing
|
|
30
|
+
* `{}` yields byte-for-byte the old `DEFAULT_CONFIG`.
|
|
31
|
+
*
|
|
32
|
+
* ⚠️ ZOD COSTS ~45 ms TO IMPORT (measured, Zod 4.6.5), AND IT IS IMPORTED
|
|
33
|
+
* NORMALLY — `src/core/validate.ts` has a top-level `import`, not a deferred
|
|
34
|
+
* `require`. The deferral was tried and is recorded there rather than here,
|
|
35
|
+
* because the reason it was dropped is a property of the two worlds this code
|
|
36
|
+
* runs in, not of this file. What matters here: the genuinely hot rail — a
|
|
37
|
+
* compiled hook's decision, `vigiles hook-runtime run-program`, one fresh
|
|
38
|
+
* process per matching tool call — never loads the verb barrel and therefore
|
|
39
|
+
* never loads this module (`src/cli.ts` branches first;
|
|
40
|
+
* `src/hook-runtime-graph.test.ts` fails the day that stops being true). The
|
|
41
|
+
* rails that DO load the barrel already pay ~316 ms of Node startup and ~85
|
|
42
|
+
* requires, against which 45 ms is ~13%.
|
|
43
|
+
*/
|
|
44
|
+
import { z } from "zod";
|
|
45
|
+
/** The rule names, for the "did you mean" on an unknown one. */
|
|
46
|
+
export declare const RULE_NAMES: readonly string[];
|
|
47
|
+
/**
|
|
48
|
+
* ONE harness's entry in {@link vigilesConfigSchema}'s `harnesses`.
|
|
49
|
+
*
|
|
50
|
+
* `.strict()` is load-bearing here specifically: the whole reason this key
|
|
51
|
+
* exists is that a declaration which reaches nothing used to be silent, and
|
|
52
|
+
* `{"claude-code": {"root": ".ai"}}` (singular, no `s`) reaches nothing.
|
|
53
|
+
*/
|
|
54
|
+
declare const harnessDeclarationSchema: z.ZodObject<{
|
|
55
|
+
roots: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
56
|
+
}, z.core.$strict>;
|
|
57
|
+
/** The harness keys' value shape, exported so `types.ts` can derive the type. */
|
|
58
|
+
export type HarnessDeclarationShape = z.infer<typeof harnessDeclarationSchema>;
|
|
59
|
+
/**
|
|
60
|
+
* The whole of `.vigilesrc.json`.
|
|
61
|
+
*
|
|
62
|
+
* `.strict()` at the top level is the check that did not exist: an unrecognized
|
|
63
|
+
* key is now a named error with a suggestion, where it used to be spread into
|
|
64
|
+
* the config object and never read.
|
|
65
|
+
*/
|
|
66
|
+
export declare const vigilesConfigSchema: z.ZodObject<{
|
|
67
|
+
ruleMarkers: z.ZodDefault<z.ZodArray<z.ZodEnum<{
|
|
68
|
+
headings: "headings";
|
|
69
|
+
checkboxes: "checkboxes";
|
|
70
|
+
}>>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
79
|
+
linterRules: z.ZodOptional<z.ZodNumber>;
|
|
80
|
+
scripts: z.ZodOptional<z.ZodNumber>;
|
|
81
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodLiteral<"error">, z.ZodObject<{
|
|
82
|
+
linterRules: z.ZodOptional<z.ZodNumber>;
|
|
83
|
+
scripts: z.ZodOptional<z.ZodNumber>;
|
|
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 | "off" | "warn" | "error">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
86
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
87
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
88
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
89
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodLiteral<"error">, z.ZodObject<{
|
|
90
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
91
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
92
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
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 | "off" | "warn" | "error">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
95
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
96
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
97
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
98
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodLiteral<"error">, z.ZodObject<{
|
|
99
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
100
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
101
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
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 | "off" | "warn" | "error">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
104
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
105
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
106
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
107
|
+
}, z.core.$strict>], null>, z.ZodTuple<[z.ZodLiteral<"error">, z.ZodObject<{
|
|
108
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
109
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
110
|
+
testExtension: z.ZodOptional<z.ZodString>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
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 | "off" | "warn" | "error">>>;
|
|
134
|
+
}, z.core.$strict>>;
|
|
135
|
+
files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
136
|
+
maxRules: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
maxTokens: z.ZodOptional<z.ZodNumber>;
|
|
138
|
+
maxSectionLines: z.ZodOptional<z.ZodNumber>;
|
|
139
|
+
catalogOnly: z.ZodOptional<z.ZodBoolean>;
|
|
140
|
+
linters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
141
|
+
rulesDir: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>;
|
|
142
|
+
}, z.core.$strict>>>;
|
|
143
|
+
bundles: z.ZodOptional<z.ZodEnum<{
|
|
144
|
+
root: "root";
|
|
145
|
+
all: "all";
|
|
146
|
+
}>>;
|
|
147
|
+
orphans: z.ZodOptional<z.ZodObject<{
|
|
148
|
+
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
149
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
150
|
+
}, z.core.$strict>>;
|
|
151
|
+
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
152
|
+
sharedDirs: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
153
|
+
harnesses: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
154
|
+
roots: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
155
|
+
}, z.core.$strict>>>;
|
|
156
|
+
audit: z.ZodOptional<z.ZodObject<{
|
|
157
|
+
measure: z.ZodOptional<z.ZodBoolean>;
|
|
158
|
+
}, z.core.$strict>>;
|
|
159
|
+
eval: z.ZodOptional<z.ZodObject<{
|
|
160
|
+
apiVersion: z.ZodOptional<z.ZodNumber>;
|
|
161
|
+
}, z.core.$strict>>;
|
|
162
|
+
nudge: z.ZodOptional<z.ZodLiteral<"dismissed">>;
|
|
163
|
+
$schema: z.ZodOptional<z.ZodString>;
|
|
164
|
+
}, z.core.$strict>;
|
|
165
|
+
/**
|
|
166
|
+
* A `.vigilesrc.json` that cannot be honoured as written.
|
|
167
|
+
*
|
|
168
|
+
* 🔴 IT HAS ITS OWN CLASS BECAUSE THE READER CATCHES EVERYTHING ELSE. A missing
|
|
169
|
+
* file, an unreadable one and malformed JSON all mean "use the defaults", which
|
|
170
|
+
* is right — and a file that IS readable and says something we refuse must not
|
|
171
|
+
* join them, or the user's declaration vanishes into the defaults and the run
|
|
172
|
+
* looks clean. A distinct class is what lets the CLI print it as a config error
|
|
173
|
+
* and a hook rail downgrade it to a warning, from one throw site.
|
|
174
|
+
*/
|
|
175
|
+
export declare class VigilesConfigError extends Error {
|
|
176
|
+
readonly name = "VigilesConfigError";
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* The whole config, AS THE SCHEMA DEFINES IT — `VigilesConfig` is this.
|
|
180
|
+
*
|
|
181
|
+
* Exported from here and re-exported (type-only, so no runtime cycle) by
|
|
182
|
+
* `./types.ts`, which every consumer already imports. The derivation is the
|
|
183
|
+
* point: a key cannot be in the type and absent from the validator.
|
|
184
|
+
*/
|
|
185
|
+
export type VigilesConfigShape = z.infer<typeof vigilesConfigSchema>;
|
|
186
|
+
/**
|
|
187
|
+
* The two keys `harnesses` replaced, and the sentence each one gets (#240).
|
|
188
|
+
*
|
|
189
|
+
* They are listed here rather than left to `.strict()`'s "Unrecognized key"
|
|
190
|
+
* because the reader of that message is someone whose config USED to work: they
|
|
191
|
+
* need the new spelling, not the news that the old one is unknown. `.strict()`
|
|
192
|
+
* would tell them the truth in the least useful possible way.
|
|
193
|
+
*/
|
|
194
|
+
export declare const REPLACED_KEYS: ReadonlyArray<{
|
|
195
|
+
readonly key: string;
|
|
196
|
+
readonly was: string;
|
|
197
|
+
readonly now: string;
|
|
198
|
+
}>;
|
|
199
|
+
/** The message a config written in the replaced shape gets. */
|
|
200
|
+
export declare function replacedKeyMessage(present: ReadonlyArray<(typeof REPLACED_KEYS)[number]>): string;
|
|
201
|
+
/**
|
|
202
|
+
* Turn a Zod failure into the lines a human acts on — ONE per real problem.
|
|
203
|
+
*
|
|
204
|
+
* 🔴 THE FORMATTER IS THE POINT, because the library's own message is worse than
|
|
205
|
+
* what it replaced on the two things that matter. Measured on Zod 4.6.5 against
|
|
206
|
+
* this schema:
|
|
207
|
+
*
|
|
208
|
+
* ```
|
|
209
|
+
* {"rules":{"spec-refs":"errr"}}
|
|
210
|
+
* -> invalid_union, EIGHT branch errors: expected "warn" / "error" / false /
|
|
211
|
+
* "off" / 0 / 1 / 2 / true — one line per union member, none of them the
|
|
212
|
+
* sentence "these are the values this key takes"
|
|
213
|
+
* {"harnessez":{}}
|
|
214
|
+
* -> Unrecognized key: "harnessez" (names the culprit, suggests nothing)
|
|
215
|
+
* ```
|
|
216
|
+
*
|
|
217
|
+
* The first is CASCADE NOISE: a union failure is one problem, not eight, and
|
|
218
|
+
* printing the branches makes the schema's internals the user's problem. The
|
|
219
|
+
* second is the regression we refuse to ship — the line it would replace is
|
|
220
|
+
* `✗ Unknown harness "claud-code". Known: claude-code, codex.`, which names the
|
|
221
|
+
* candidates AND the near-miss. So a union collapses to one line listing what
|
|
222
|
+
* the key accepts, and an unknown key carries the candidate list plus a
|
|
223
|
+
* distance-bounded "did you mean".
|
|
224
|
+
*/
|
|
225
|
+
export declare function formatConfigIssues(issues: readonly ConfigIssue[]): string[];
|
|
226
|
+
/**
|
|
227
|
+
* The shape of a Zod issue this formatter reads — structural, not imported.
|
|
228
|
+
*
|
|
229
|
+
* Zod's own `$ZodIssue` union is exhaustive over every code the library can
|
|
230
|
+
* emit, and switching on it would make adding a schema construct a compile
|
|
231
|
+
* error in a message formatter that has a perfectly good default branch. The
|
|
232
|
+
* fields below are the ones read; everything else falls through to `message`.
|
|
233
|
+
*/
|
|
234
|
+
export interface ConfigIssue {
|
|
235
|
+
readonly code?: string;
|
|
236
|
+
readonly path?: readonly PropertyKey[];
|
|
237
|
+
readonly message?: string;
|
|
238
|
+
readonly keys?: readonly string[];
|
|
239
|
+
readonly expected?: string;
|
|
240
|
+
readonly values?: readonly unknown[];
|
|
241
|
+
readonly errors?: ReadonlyArray<readonly ConfigIssue[]>;
|
|
242
|
+
}
|
|
243
|
+
export {};
|
|
244
|
+
//# sourceMappingURL=config-schema.d.ts.map
|