vigiles 33.2.0 → 34.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 +3 -2
- package/action.yml +45 -8
- package/dist/adapter.d.ts +1 -1
- package/dist/adapters/claude-code/runtime.js +70 -0
- package/dist/adapters/claude-code/skill-reachability.d.ts +42 -21
- package/dist/adapters/claude-code/skill-reachability.js +91 -28
- package/dist/cli-flag-check.js +1 -0
- package/dist/cli-main.js +401 -21
- package/dist/core/adapter.d.ts +7 -0
- package/dist/core/config-schema.d.ts +53 -34
- package/dist/core/config-schema.js +42 -0
- package/dist/core/install-reader.js +15 -0
- package/dist/core/layout.d.ts +10 -0
- package/dist/core/layout.js +17 -0
- package/dist/core/presets.d.ts +44 -0
- package/dist/core/presets.js +44 -0
- package/dist/core/run-env.d.ts +50 -0
- package/dist/core/run-env.js +51 -0
- package/dist/core/runtime.d.ts +44 -0
- package/dist/core/skill-link-target.d.ts +20 -0
- package/dist/core/skill-link-target.js +33 -0
- package/dist/core/validate.js +1 -1
- package/dist/eval.d.ts +39 -39
- package/dist/eval.js +62 -115
- package/dist/harness-test.d.ts +35 -0
- package/dist/harness-test.js +49 -7
- package/dist/output-style-arms.js +7 -2
- package/dist/plugin-declaration.d.ts +6 -6
- package/dist/plugin-declaration.js +6 -6
- package/dist/setup-plan.d.ts +142 -34
- package/dist/setup-plan.js +235 -135
- package/dist/skill-links.d.ts +183 -0
- package/dist/skill-links.js +255 -0
- package/dist/test-coverage.js +37 -1
- package/dist/vigilesrc.schema.json +6 -0
- package/package.json +1 -1
|
@@ -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 | "
|
|
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 | "
|
|
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 | "
|
|
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 | "
|
|
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 | "
|
|
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 | "
|
|
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 | "
|
|
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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "
|
|
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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "
|
|
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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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 | "
|
|
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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "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,7 +109,7 @@ 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
|
-
"untested-output-style": 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 | "
|
|
112
|
+
"untested-output-style": 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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>, z.ZodTuple<[z.ZodLiteral<"warn">, z.ZodObject<{
|
|
113
113
|
include: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
114
114
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
115
115
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
@@ -118,29 +118,29 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
118
118
|
exclude: z.ZodOptional<z.ZodPipe<z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>, z.ZodTransform<readonly string[], string | string[]>>>;
|
|
119
119
|
testExtension: z.ZodOptional<z.ZodString>;
|
|
120
120
|
}, z.core.$strict>], null>]>>;
|
|
121
|
-
"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 | "
|
|
122
|
-
"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 | "
|
|
123
|
-
"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 | "
|
|
124
|
-
"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 | "
|
|
125
|
-
"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 | "
|
|
126
|
-
"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 | "
|
|
127
|
-
"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 | "
|
|
128
|
-
"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 | "
|
|
129
|
-
"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 | "
|
|
130
|
-
"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 | "
|
|
131
|
-
"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 | "
|
|
132
|
-
"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 | "
|
|
133
|
-
"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 | "
|
|
134
|
-
"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 | "
|
|
135
|
-
"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 | "
|
|
136
|
-
"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 | "
|
|
137
|
-
"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 | "
|
|
138
|
-
"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 | "
|
|
139
|
-
"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 | "
|
|
140
|
-
"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 | "
|
|
141
|
-
"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 | "
|
|
142
|
-
"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 | "
|
|
143
|
-
"instruction-weight": 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 | "
|
|
121
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
122
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
123
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
124
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
125
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
126
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
127
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
128
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
129
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
130
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
131
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
132
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
133
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
134
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
135
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
136
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
137
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
138
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
139
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
140
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
141
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
142
|
+
"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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
143
|
+
"instruction-weight": 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 | "error" | "warn", boolean | 0 | 1 | 2 | "error" | "warn" | "off">>>;
|
|
144
144
|
}, z.core.$strict>>;
|
|
145
145
|
files: z.ZodDefault<z.ZodArray<z.ZodString>>;
|
|
146
146
|
maxRules: z.ZodOptional<z.ZodNumber>;
|
|
@@ -170,8 +170,27 @@ export declare const vigilesConfigSchema: z.ZodObject<{
|
|
|
170
170
|
apiVersion: z.ZodOptional<z.ZodNumber>;
|
|
171
171
|
}, z.core.$strict>>;
|
|
172
172
|
nudge: z.ZodOptional<z.ZodLiteral<"dismissed">>;
|
|
173
|
+
extends: z.ZodOptional<z.ZodEnum<{
|
|
174
|
+
"vigiles:recommended": "vigiles:recommended";
|
|
175
|
+
}>>;
|
|
173
176
|
$schema: z.ZodOptional<z.ZodString>;
|
|
174
177
|
}, z.core.$strict>;
|
|
178
|
+
/**
|
|
179
|
+
* Parse a raw `.vigilesrc.json` value — THE one entry point every reader uses.
|
|
180
|
+
*
|
|
181
|
+
* 🔴 THE PRESET IS MERGED INTO THE RAW INPUT, BEFORE THE SCHEMA, for one reason:
|
|
182
|
+
* after parsing, every rule carries a value (the schema fills each default), so
|
|
183
|
+
* "the user wrote `hook-events: warn`" and "nobody wrote it" are the same
|
|
184
|
+
* output, and an explicit downgrade could not win over the preset. Before
|
|
185
|
+
* parsing, the user's own `rules` keys are exactly what they wrote. So the
|
|
186
|
+
* preset's severities go UNDER them, and the schema then normalizes and
|
|
187
|
+
* validates the result as if the user had typed both.
|
|
188
|
+
*
|
|
189
|
+
* Only a recognized preset with an object (or absent) `rules` is expanded;
|
|
190
|
+
* anything else is passed through untouched for the schema to refuse with its
|
|
191
|
+
* own message, so a typo in `extends` is reported, never silently ignored.
|
|
192
|
+
*/
|
|
193
|
+
export declare function parseVigilesConfig(raw: unknown): Readonly<ReturnType<typeof vigilesConfigSchema.safeParse>>;
|
|
175
194
|
/**
|
|
176
195
|
* A `.vigilesrc.json` that cannot be honoured as written.
|
|
177
196
|
*
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.REPLACED_KEYS = exports.VigilesConfigError = exports.vigilesConfigSchema = exports.RULE_NAMES = void 0;
|
|
4
|
+
exports.parseVigilesConfig = parseVigilesConfig;
|
|
4
5
|
exports.replacedKeyMessage = replacedKeyMessage;
|
|
5
6
|
exports.formatConfigIssues = formatConfigIssues;
|
|
6
7
|
/**
|
|
@@ -48,6 +49,7 @@ exports.formatConfigIssues = formatConfigIssues;
|
|
|
48
49
|
*/
|
|
49
50
|
const zod_1 = require("zod");
|
|
50
51
|
const edit_distance_js_1 = require("./edit-distance.js");
|
|
52
|
+
const presets_js_1 = require("./presets.js");
|
|
51
53
|
// ---------------------------------------------------------------------------
|
|
52
54
|
// Primitives
|
|
53
55
|
// ---------------------------------------------------------------------------
|
|
@@ -232,6 +234,14 @@ exports.vigilesConfigSchema = zod_1.z
|
|
|
232
234
|
audit: zod_1.z.object({ measure: zod_1.z.boolean().optional() }).strict().optional(),
|
|
233
235
|
eval: zod_1.z.object({ apiVersion: zod_1.z.number().optional() }).strict().optional(),
|
|
234
236
|
nudge: zod_1.z.literal("dismissed").optional(),
|
|
237
|
+
/**
|
|
238
|
+
* A named preset whose rule severities apply UNDER `rules` — ESLint's
|
|
239
|
+
* `extends`. `"vigiles:recommended"` gates the structural group (see
|
|
240
|
+
* `./presets.ts`); an explicit `rules` entry overrides it. Applied by
|
|
241
|
+
* {@link parseVigilesConfig}, which is why this key is only VALIDATED here.
|
|
242
|
+
* Placed after the keys people misspell most: the "Known:" list is capped.
|
|
243
|
+
*/
|
|
244
|
+
extends: zod_1.z.enum(presets_js_1.PRESET_NAMES).optional(),
|
|
235
245
|
/**
|
|
236
246
|
* The editor's pointer at the published JSON Schema. Accepted, never read.
|
|
237
247
|
*
|
|
@@ -262,6 +272,38 @@ exports.vigilesConfigSchema = zod_1.z
|
|
|
262
272
|
$schema: zod_1.z.string().optional(),
|
|
263
273
|
})
|
|
264
274
|
.strict();
|
|
275
|
+
/**
|
|
276
|
+
* Parse a raw `.vigilesrc.json` value — THE one entry point every reader uses.
|
|
277
|
+
*
|
|
278
|
+
* 🔴 THE PRESET IS MERGED INTO THE RAW INPUT, BEFORE THE SCHEMA, for one reason:
|
|
279
|
+
* after parsing, every rule carries a value (the schema fills each default), so
|
|
280
|
+
* "the user wrote `hook-events: warn`" and "nobody wrote it" are the same
|
|
281
|
+
* output, and an explicit downgrade could not win over the preset. Before
|
|
282
|
+
* parsing, the user's own `rules` keys are exactly what they wrote. So the
|
|
283
|
+
* preset's severities go UNDER them, and the schema then normalizes and
|
|
284
|
+
* validates the result as if the user had typed both.
|
|
285
|
+
*
|
|
286
|
+
* Only a recognized preset with an object (or absent) `rules` is expanded;
|
|
287
|
+
* anything else is passed through untouched for the schema to refuse with its
|
|
288
|
+
* own message, so a typo in `extends` is reported, never silently ignored.
|
|
289
|
+
*/
|
|
290
|
+
function parseVigilesConfig(raw) {
|
|
291
|
+
return exports.vigilesConfigSchema.safeParse(withPresetRules(raw));
|
|
292
|
+
}
|
|
293
|
+
/** `raw` with its `extends` preset's rules placed under its own `rules`. */
|
|
294
|
+
function withPresetRules(raw) {
|
|
295
|
+
if (typeof raw !== "object" || raw === null || Array.isArray(raw))
|
|
296
|
+
return raw;
|
|
297
|
+
const preset = "extends" in raw ? raw.extends : undefined;
|
|
298
|
+
const rules = "rules" in raw ? raw.rules : undefined;
|
|
299
|
+
if (!(0, presets_js_1.isPresetName)(preset))
|
|
300
|
+
return raw;
|
|
301
|
+
if (rules === undefined)
|
|
302
|
+
return { ...raw, rules: { ...(0, presets_js_1.presetRules)(preset) } };
|
|
303
|
+
if (typeof rules !== "object" || rules === null || Array.isArray(rules))
|
|
304
|
+
return raw;
|
|
305
|
+
return { ...raw, rules: { ...(0, presets_js_1.presetRules)(preset), ...rules } };
|
|
306
|
+
}
|
|
265
307
|
/**
|
|
266
308
|
* A `.vigilesrc.json` that cannot be honoured as written.
|
|
267
309
|
*
|
|
@@ -30,6 +30,18 @@ function readOrNull(absolute) {
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
|
+
/** A symlink's stored target, or null when it is not a link. Never throws. */
|
|
34
|
+
function linkOrNull(absolute) {
|
|
35
|
+
try {
|
|
36
|
+
return (0, node_fs_1.lstatSync)(absolute, { throwIfNoEntry: false })?.isSymbolicLink() ===
|
|
37
|
+
true
|
|
38
|
+
? (0, node_fs_1.readlinkSync)(absolute)
|
|
39
|
+
: null;
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return null;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
33
45
|
/** Directory names directly under `dir`, or [] when it is not readable. */
|
|
34
46
|
function dirNames(dir) {
|
|
35
47
|
try {
|
|
@@ -80,6 +92,9 @@ function buildInstallReader(adapter, root, opts = {}) {
|
|
|
80
92
|
repo: (repoRelative) => adapter.claims(repoRelative)
|
|
81
93
|
? readOrNull((0, node_path_1.resolve)(root, repoRelative))
|
|
82
94
|
: null,
|
|
95
|
+
repoLink: (repoRelative) => adapter.claims(repoRelative)
|
|
96
|
+
? linkOrNull((0, node_path_1.resolve)(root, repoRelative))
|
|
97
|
+
: null,
|
|
83
98
|
home: (homeRelative) => readOrNull((0, node_path_1.join)(home, homeRelative)),
|
|
84
99
|
repoDependsOnVigiles: pkgJson !== null && declaresVigilesDependency(pkgJson),
|
|
85
100
|
vendoredSkillNames: dirNames((0, node_path_1.join)(root, "node_modules", "vigiles", "skills")),
|
package/dist/core/layout.d.ts
CHANGED
|
@@ -241,6 +241,16 @@ export declare function executableSourceDirs(layout: PluginLayout): readonly str
|
|
|
241
241
|
* written a layout where they differed.
|
|
242
242
|
*/
|
|
243
243
|
export declare function materializePrefix(layout: PluginLayout): string;
|
|
244
|
+
/**
|
|
245
|
+
* Where a REPOSITORY keeps its skills for this harness, repo-relative — the
|
|
246
|
+
* skill surface under {@link materializePrefix}: `.claude/skills` on Claude
|
|
247
|
+
* Code, `.agents/skills` on Codex. `null` when the layout has no skill surface.
|
|
248
|
+
*
|
|
249
|
+
* `vigiles init` links the package's shipped skills here, so it must be the
|
|
250
|
+
* directory the harness actually scans for a project; deriving it from the two
|
|
251
|
+
* fields that already say so keeps a third spelling from appearing.
|
|
252
|
+
*/
|
|
253
|
+
export declare function skillsHome(layout: Pick<PluginLayout, "surfaces" | "userSurfaceRoot">): string | null;
|
|
244
254
|
/**
|
|
245
255
|
* How DEEP a harness reads its {@link PluginLayout.agentDir} — the one statement
|
|
246
256
|
* of that rule, as a RegExp source fragment matching the part of a path AFTER
|
package/dist/core/layout.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.RULE_FILE_LEAF_RE = exports.AGENT_FILE_LEAF_RE = exports.SURFACE_KINDS =
|
|
|
4
4
|
exports.surfaceDirs = surfaceDirs;
|
|
5
5
|
exports.executableSourceDirs = executableSourceDirs;
|
|
6
6
|
exports.materializePrefix = materializePrefix;
|
|
7
|
+
exports.skillsHome = skillsHome;
|
|
7
8
|
exports.rulesHome = rulesHome;
|
|
8
9
|
exports.ruleFileRe = ruleFileRe;
|
|
9
10
|
exports.agentSurfaceName = agentSurfaceName;
|
|
@@ -46,6 +47,22 @@ function executableSourceDirs(layout) {
|
|
|
46
47
|
function materializePrefix(layout) {
|
|
47
48
|
return layout.userSurfaceRoot ?? "";
|
|
48
49
|
}
|
|
50
|
+
/**
|
|
51
|
+
* Where a REPOSITORY keeps its skills for this harness, repo-relative — the
|
|
52
|
+
* skill surface under {@link materializePrefix}: `.claude/skills` on Claude
|
|
53
|
+
* Code, `.agents/skills` on Codex. `null` when the layout has no skill surface.
|
|
54
|
+
*
|
|
55
|
+
* `vigiles init` links the package's shipped skills here, so it must be the
|
|
56
|
+
* directory the harness actually scans for a project; deriving it from the two
|
|
57
|
+
* fields that already say so keeps a third spelling from appearing.
|
|
58
|
+
*/
|
|
59
|
+
function skillsHome(layout) {
|
|
60
|
+
const skill = layout.surfaces.skill;
|
|
61
|
+
if (skill === undefined || skill === "")
|
|
62
|
+
return null;
|
|
63
|
+
const root = layout.userSurfaceRoot;
|
|
64
|
+
return root === undefined || root === "" ? skill : `${root}/${skill}`;
|
|
65
|
+
}
|
|
49
66
|
/**
|
|
50
67
|
* How DEEP a harness reads its {@link PluginLayout.agentDir} — the one statement
|
|
51
68
|
* of that rule, as a RegExp source fragment matching the part of a path AFTER
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Named rule PRESETS a `.vigilesrc.json` can `extends` — the ESLint
|
|
3
|
+
* `recommended` model, stored as data.
|
|
4
|
+
*
|
|
5
|
+
* 🔴 WHY A PRESET READ AT LOAD TIME, NOT RULE LINES WRITTEN AT SETUP TIME. Every
|
|
6
|
+
* rule's built-in default stays `warn` (`config-schema.ts`); the structural rules
|
|
7
|
+
* gate only because `init` turns them up. It used to do that by WRITING nine
|
|
8
|
+
* `"<rule>": "error"` lines into the new repo's config — a snapshot of the group
|
|
9
|
+
* on the day `init` ran. A repo adopted before a rule joined the group never got
|
|
10
|
+
* it from an upgrade, and re-running `init` to fetch it rewrote far more than
|
|
11
|
+
* the rule (#338). `"extends": "vigiles:recommended"` is resolved by the loader
|
|
12
|
+
* on every run, so the repo follows the group as the installed vigiles ships it,
|
|
13
|
+
* and an explicit `rules` entry still overrides it.
|
|
14
|
+
*
|
|
15
|
+
* ⚠️ ADDING A RULE HERE IS A BREAKING CHANGE (a `!` commit, a semver major): it
|
|
16
|
+
* can turn a consumer's CI red with no edit on their side. Removing one is not.
|
|
17
|
+
* ESLint treats `eslint:recommended` the same way.
|
|
18
|
+
*
|
|
19
|
+
* Harness-agnostic data: rule names only, no adapter fact.
|
|
20
|
+
*/
|
|
21
|
+
import type { RulesConfig } from "./types.js";
|
|
22
|
+
/**
|
|
23
|
+
* The rules `vigiles:recommended` raises to `error` — the FP-safe structural
|
|
24
|
+
* group: each one fires only on a genuine defect (a never-available or typo'd
|
|
25
|
+
* tool, a subagent missing `name`/`description`, a typo'd hook event, a dead hook
|
|
26
|
+
* script, a broken MCP reference, two skills that collide in the selector), so a
|
|
27
|
+
* well-formed harness stays green.
|
|
28
|
+
*
|
|
29
|
+
* Deliberately EXCLUDES the workflow rules (`require-instructions-spec`,
|
|
30
|
+
* `untested-*`): a clean repo fails those until the work is done, so they stay
|
|
31
|
+
* an explicit opt-in (`init --strict`).
|
|
32
|
+
*/
|
|
33
|
+
export declare const RECOMMENDED_RULES: readonly ["subagent-tool-contract", "subagent-frontmatter", "hook-events", "hook-script-exists", "mcp-config", "mcp-tool-resolves", "mcp-hook-target-resolves", "disallowed-tools-contract", "description-overlap"];
|
|
34
|
+
/** The preset names `extends` accepts. One today; the tuple is the enum. */
|
|
35
|
+
export declare const PRESET_NAMES: readonly ["vigiles:recommended"];
|
|
36
|
+
/** A preset name `extends` accepts. */
|
|
37
|
+
export type PresetName = (typeof PRESET_NAMES)[number];
|
|
38
|
+
/** The preset `init` writes. */
|
|
39
|
+
export declare const RECOMMENDED_PRESET: PresetName;
|
|
40
|
+
/** Whether a raw value names a preset. */
|
|
41
|
+
export declare function isPresetName(value: unknown): value is PresetName;
|
|
42
|
+
/** The rule severities a preset sets, in the config's raw spelling. */
|
|
43
|
+
export declare function presetRules(name: PresetName): Readonly<Partial<Record<keyof RulesConfig, "error">>>;
|
|
44
|
+
//# sourceMappingURL=presets.d.ts.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RECOMMENDED_PRESET = exports.PRESET_NAMES = exports.RECOMMENDED_RULES = void 0;
|
|
4
|
+
exports.isPresetName = isPresetName;
|
|
5
|
+
exports.presetRules = presetRules;
|
|
6
|
+
/**
|
|
7
|
+
* The rules `vigiles:recommended` raises to `error` — the FP-safe structural
|
|
8
|
+
* group: each one fires only on a genuine defect (a never-available or typo'd
|
|
9
|
+
* tool, a subagent missing `name`/`description`, a typo'd hook event, a dead hook
|
|
10
|
+
* script, a broken MCP reference, two skills that collide in the selector), so a
|
|
11
|
+
* well-formed harness stays green.
|
|
12
|
+
*
|
|
13
|
+
* Deliberately EXCLUDES the workflow rules (`require-instructions-spec`,
|
|
14
|
+
* `untested-*`): a clean repo fails those until the work is done, so they stay
|
|
15
|
+
* an explicit opt-in (`init --strict`).
|
|
16
|
+
*/
|
|
17
|
+
exports.RECOMMENDED_RULES = [
|
|
18
|
+
"subagent-tool-contract",
|
|
19
|
+
"subagent-frontmatter",
|
|
20
|
+
"hook-events",
|
|
21
|
+
"hook-script-exists",
|
|
22
|
+
"mcp-config",
|
|
23
|
+
"mcp-tool-resolves",
|
|
24
|
+
"mcp-hook-target-resolves",
|
|
25
|
+
"disallowed-tools-contract",
|
|
26
|
+
"description-overlap",
|
|
27
|
+
];
|
|
28
|
+
/** The preset names `extends` accepts. One today; the tuple is the enum. */
|
|
29
|
+
exports.PRESET_NAMES = ["vigiles:recommended"];
|
|
30
|
+
/** The preset `init` writes. */
|
|
31
|
+
exports.RECOMMENDED_PRESET = "vigiles:recommended";
|
|
32
|
+
/** What each preset sets, as the config would spell it. */
|
|
33
|
+
const PRESETS = {
|
|
34
|
+
"vigiles:recommended": Object.fromEntries(exports.RECOMMENDED_RULES.map((r) => [r, "error"])),
|
|
35
|
+
};
|
|
36
|
+
/** Whether a raw value names a preset. */
|
|
37
|
+
function isPresetName(value) {
|
|
38
|
+
return exports.PRESET_NAMES.some((n) => n === value);
|
|
39
|
+
}
|
|
40
|
+
/** The rule severities a preset sets, in the config's raw spelling. */
|
|
41
|
+
function presetRules(name) {
|
|
42
|
+
return PRESETS[name];
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=presets.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The environment a child agent run inherits — the one place the runners turn
|
|
3
|
+
* a caller's `process.env` into a spawn env.
|
|
4
|
+
*
|
|
5
|
+
* Two shapes, both driven by the harness's declared {@link RunEnvPolicy}:
|
|
6
|
+
*
|
|
7
|
+
* - SCRUBBED (`scrubbedRunEnv`): a throwaway HOME/TMPDIR, the OS essentials, the
|
|
8
|
+
* harness's declared auth, and the caller's own named extras. Everything else
|
|
9
|
+
* is dropped. The eval tier's `ephemeralEnv` and the harness-tier preflight of
|
|
10
|
+
* `experimental_outputStyleArms` use it.
|
|
11
|
+
* - INHERITED (`withoutSessionIdentity`): the caller's env as-is, minus the
|
|
12
|
+
* harness's declared session identity. The default spawn of both tiers.
|
|
13
|
+
*
|
|
14
|
+
* In both, the parent session's identity never reaches the child. The core
|
|
15
|
+
* names no harness: which variables are auth and which are identity is the
|
|
16
|
+
* adapter's declaration.
|
|
17
|
+
*
|
|
18
|
+
* Pure — no fs, no spawn.
|
|
19
|
+
*/
|
|
20
|
+
import type { RunEnvPolicy } from "./runtime.js";
|
|
21
|
+
type EnvLike = Readonly<Record<string, string | undefined>>;
|
|
22
|
+
/**
|
|
23
|
+
* What ANY spawned process needs to function, whatever the harness: resolve
|
|
24
|
+
* binaries (`PATH`) and keep the locale and terminal (`LANG`, `LC_*`, `TERM`).
|
|
25
|
+
* Mirrors what `bwrapArgs` sets back after `--clearenv` in `src/sandbox.ts`.
|
|
26
|
+
*/
|
|
27
|
+
export declare const OS_ESSENTIAL_ENV: readonly string[];
|
|
28
|
+
/**
|
|
29
|
+
* Build a SCRUBBED run environment: a NEW env with `HOME`/`TMPDIR` set to the
|
|
30
|
+
* throwaway `opts.home`, the {@link OS_ESSENTIAL_ENV}, the harness's
|
|
31
|
+
* `policy.keep`, and the caller's `opts.allow`, taken from `base`. Everything
|
|
32
|
+
* else is dropped, and `policy.sessionIdentity` is dropped even when listed in
|
|
33
|
+
* `keep` or `allow`.
|
|
34
|
+
*
|
|
35
|
+
* Without a policy only the essentials pass: right for a run against a scripted
|
|
36
|
+
* mock, which needs no auth.
|
|
37
|
+
*/
|
|
38
|
+
export declare function scrubbedRunEnv(base: EnvLike, opts: {
|
|
39
|
+
readonly home: string;
|
|
40
|
+
readonly policy?: RunEnvPolicy;
|
|
41
|
+
readonly allow?: readonly string[];
|
|
42
|
+
}): Readonly<Record<string, string>>;
|
|
43
|
+
/**
|
|
44
|
+
* The caller's env with the harness's declared session identity removed — the
|
|
45
|
+
* INHERITED shape. Unset (`undefined`) values are dropped too, so the result is
|
|
46
|
+
* a plain spawn env. Without a policy nothing is removed.
|
|
47
|
+
*/
|
|
48
|
+
export declare function withoutSessionIdentity(base: EnvLike, policy?: RunEnvPolicy): Readonly<Record<string, string>>;
|
|
49
|
+
export {};
|
|
50
|
+
//# sourceMappingURL=run-env.d.ts.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OS_ESSENTIAL_ENV = void 0;
|
|
4
|
+
exports.scrubbedRunEnv = scrubbedRunEnv;
|
|
5
|
+
exports.withoutSessionIdentity = withoutSessionIdentity;
|
|
6
|
+
/**
|
|
7
|
+
* What ANY spawned process needs to function, whatever the harness: resolve
|
|
8
|
+
* binaries (`PATH`) and keep the locale and terminal (`LANG`, `LC_*`, `TERM`).
|
|
9
|
+
* Mirrors what `bwrapArgs` sets back after `--clearenv` in `src/sandbox.ts`.
|
|
10
|
+
*/
|
|
11
|
+
exports.OS_ESSENTIAL_ENV = ["PATH", "LANG", "TERM"];
|
|
12
|
+
const OS_ESSENTIAL_PREFIXES = ["LC_"];
|
|
13
|
+
/**
|
|
14
|
+
* Build a SCRUBBED run environment: a NEW env with `HOME`/`TMPDIR` set to the
|
|
15
|
+
* throwaway `opts.home`, the {@link OS_ESSENTIAL_ENV}, the harness's
|
|
16
|
+
* `policy.keep`, and the caller's `opts.allow`, taken from `base`. Everything
|
|
17
|
+
* else is dropped, and `policy.sessionIdentity` is dropped even when listed in
|
|
18
|
+
* `keep` or `allow`.
|
|
19
|
+
*
|
|
20
|
+
* Without a policy only the essentials pass: right for a run against a scripted
|
|
21
|
+
* mock, which needs no auth.
|
|
22
|
+
*/
|
|
23
|
+
function scrubbedRunEnv(base, opts) {
|
|
24
|
+
const identity = new Set(opts.policy?.sessionIdentity ?? []);
|
|
25
|
+
const exact = new Set([
|
|
26
|
+
...exports.OS_ESSENTIAL_ENV,
|
|
27
|
+
...(opts.policy?.keep ?? []),
|
|
28
|
+
...(opts.allow ?? []),
|
|
29
|
+
]);
|
|
30
|
+
const passes = (k) => !identity.has(k) &&
|
|
31
|
+
(exact.has(k) || OS_ESSENTIAL_PREFIXES.some((p) => k.startsWith(p)));
|
|
32
|
+
return {
|
|
33
|
+
...defined(base, passes),
|
|
34
|
+
// Last, so they win over anything passed through.
|
|
35
|
+
HOME: opts.home,
|
|
36
|
+
TMPDIR: opts.home,
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* The caller's env with the harness's declared session identity removed — the
|
|
41
|
+
* INHERITED shape. Unset (`undefined`) values are dropped too, so the result is
|
|
42
|
+
* a plain spawn env. Without a policy nothing is removed.
|
|
43
|
+
*/
|
|
44
|
+
function withoutSessionIdentity(base, policy) {
|
|
45
|
+
const identity = new Set(policy?.sessionIdentity ?? []);
|
|
46
|
+
return defined(base, (k) => !identity.has(k));
|
|
47
|
+
}
|
|
48
|
+
function defined(base, keep) {
|
|
49
|
+
return Object.fromEntries(Object.entries(base).filter((e) => e[1] !== undefined && keep(e[0])));
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=run-env.js.map
|
package/dist/core/runtime.d.ts
CHANGED
|
@@ -54,5 +54,49 @@ export interface HarnessRuntime {
|
|
|
54
54
|
* caller resolves the raw string via `agentBinary --version`); unit-testable.
|
|
55
55
|
*/
|
|
56
56
|
versionKey(raw: string): string;
|
|
57
|
+
/**
|
|
58
|
+
* Which of the caller's environment a child run may inherit — see
|
|
59
|
+
* {@link RunEnvPolicy}. Absent: a scrubbed run inherits no harness variable,
|
|
60
|
+
* and nothing is removed from an inherited env.
|
|
61
|
+
*/
|
|
62
|
+
readonly runEnv?: RunEnvPolicy;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Which of the caller's environment a CHILD run of this harness may inherit.
|
|
66
|
+
*
|
|
67
|
+
* A run spawned from inside a live session of the same harness (an eval started
|
|
68
|
+
* by an agent, a harness test run from a hook) inherits that session's process
|
|
69
|
+
* environment, and a harness marks its own session there. Measured on Claude
|
|
70
|
+
* Code 2.1.292 (2026-10-07): a child `claude -p` started with the parent's
|
|
71
|
+
* session variables ran AS the parent session — a task it created landed in the
|
|
72
|
+
* parent's live task list. Which variables are identity and which are auth is a
|
|
73
|
+
* fact about one harness, so the adapter declares it and the runners apply it
|
|
74
|
+
* (`src/core/run-env.ts`) without spelling a single name.
|
|
75
|
+
*
|
|
76
|
+
* Optional, so an adapter written before this field still type-checks. An
|
|
77
|
+
* adapter without one gets the strict reading: a scrubbed run inherits no
|
|
78
|
+
* harness variable at all, and an inherited one has nothing removed.
|
|
79
|
+
*/
|
|
80
|
+
export interface RunEnvPolicy {
|
|
81
|
+
/**
|
|
82
|
+
* Exact names a SCRUBBED run (fresh HOME, cleared env) inherits: the
|
|
83
|
+
* harness's auth and backend selection, nothing else. An allowlist on purpose —
|
|
84
|
+
* a harness's session variables are open-ended (the Claude Code 2.1.292
|
|
85
|
+
* binary references several dozen `*SESSION*` / `*SOCKET*` / `*TOKEN*` names),
|
|
86
|
+
* so a prefix with a few exceptions would keep passing whichever ones nobody
|
|
87
|
+
* listed.
|
|
88
|
+
*/
|
|
89
|
+
readonly keep: readonly string[];
|
|
90
|
+
/**
|
|
91
|
+
* Auth FILES under HOME (relative paths) that a scrubbed run's throwaway HOME
|
|
92
|
+
* is seeded with, by copy. The file half of `keep`.
|
|
93
|
+
*/
|
|
94
|
+
readonly keepHomeFiles: readonly string[];
|
|
95
|
+
/**
|
|
96
|
+
* The PARENT session's identity: names no child run ever inherits — not a
|
|
97
|
+
* scrubbed run, and not a run that otherwise inherits the whole caller env.
|
|
98
|
+
* Wins over `keep` and over any name a caller allows.
|
|
99
|
+
*/
|
|
100
|
+
readonly sessionIdentity: readonly string[];
|
|
57
101
|
}
|
|
58
102
|
//# sourceMappingURL=runtime.d.ts.map
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Is a symlink's stored target one that `vigiles init` writes — a path ending
|
|
3
|
+
* in `node_modules/vigiles/skills/<name>`, for the SAME skill name?
|
|
4
|
+
*
|
|
5
|
+
* Two readers ask, and must agree, so the answer lives here once:
|
|
6
|
+
*
|
|
7
|
+
* - `init` (`../skill-links.ts`): an existing link of this shape that points
|
|
8
|
+
* somewhere other than where `init` would link now was made by an earlier
|
|
9
|
+
* `init` (for example before a workspace install hoisted the package), so it
|
|
10
|
+
* is replaced instead of being refused as the user's;
|
|
11
|
+
* - `audit` (`../adapters/claude-code/skill-reachability.ts`): only a dangling
|
|
12
|
+
* link of this shape is "vigiles's link, run npm install". A dangling link
|
|
13
|
+
* that merely shares a skill's NAME is the user's, and the advice would send
|
|
14
|
+
* them to fix the wrong thing.
|
|
15
|
+
*
|
|
16
|
+
* The test is on path SEGMENTS (either separator, so a link written on Windows
|
|
17
|
+
* reads the same), not on a substring: `my-node_modules/vigiles/...` is not it.
|
|
18
|
+
*/
|
|
19
|
+
export declare function isVigilesSkillTarget(target: string, name: string): boolean;
|
|
20
|
+
//# sourceMappingURL=skill-link-target.d.ts.map
|