vigiles 6.0.0 → 7.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.
Files changed (65) hide show
  1. package/README.md +78 -68
  2. package/dist/action-gate.js +1 -1
  3. package/dist/adapters/claude-code/agent-runtime.d.ts +46 -11
  4. package/dist/adapters/claude-code/agent-runtime.js +95 -24
  5. package/dist/adapters/claude-code/effect-region.js +1 -1
  6. package/dist/adapters/claude-code/skill-runtime.d.ts +1 -1
  7. package/dist/adapters/claude-code/skill-runtime.js +1 -1
  8. package/dist/adapters/codex/hook-protocol.js +3 -0
  9. package/dist/adapters/codex/mock-model.js +1 -1
  10. package/dist/cli-commands.d.ts +19 -0
  11. package/dist/cli-commands.js +51 -0
  12. package/dist/cli.js +599 -86
  13. package/dist/core/bash-effects.d.ts +12 -0
  14. package/dist/core/bash-effects.js +31 -0
  15. package/dist/core/capability-diff.d.ts +46 -0
  16. package/dist/core/capability-diff.js +97 -0
  17. package/dist/core/guards.d.ts +126 -0
  18. package/dist/core/guards.js +309 -0
  19. package/dist/core/harness-driver.d.ts +1 -1
  20. package/dist/core/hook-program.d.ts +459 -0
  21. package/dist/core/hook-program.js +468 -0
  22. package/dist/core/hook-protocol.d.ts +7 -0
  23. package/dist/core/hook-providers.d.ts +138 -0
  24. package/dist/core/hook-providers.js +155 -0
  25. package/dist/core/hook-spec.d.ts +74 -0
  26. package/dist/core/hook-spec.js +130 -0
  27. package/dist/core/inline.js +1 -1
  28. package/dist/core/mcp-tool.d.ts +12 -0
  29. package/dist/core/mcp-tool.js +20 -0
  30. package/dist/core/mcp.d.ts +13 -0
  31. package/dist/core/mcp.js +67 -0
  32. package/dist/core/types.d.ts +8 -0
  33. package/dist/dialect-drift.d.ts +65 -0
  34. package/dist/dialect-drift.js +216 -0
  35. package/dist/eval.d.ts +40 -5
  36. package/dist/eval.js +59 -5
  37. package/dist/guardrail-check.d.ts +85 -0
  38. package/dist/guardrail-check.js +152 -0
  39. package/dist/harness-assert.d.ts +10 -0
  40. package/dist/harness-assert.js +30 -0
  41. package/dist/hook-install.d.ts +43 -0
  42. package/dist/hook-install.js +91 -0
  43. package/dist/hook.d.ts +52 -0
  44. package/dist/hook.js +98 -0
  45. package/dist/leaderboard.d.ts +6 -0
  46. package/dist/leaderboard.js +43 -1
  47. package/dist/linting.d.ts +9 -5
  48. package/dist/linting.js +17 -5
  49. package/dist/optimize.js +1 -1
  50. package/dist/scaffold-test.js +21 -7
  51. package/dist/scan-behavioral.d.ts +60 -0
  52. package/dist/scan-behavioral.js +239 -1
  53. package/dist/scan.d.ts +14 -0
  54. package/dist/scan.js +33 -1
  55. package/dist/score-explainer.js +1 -1
  56. package/dist/self-command-refs.d.ts +21 -0
  57. package/dist/self-command-refs.js +125 -0
  58. package/dist/testing.d.ts +5 -3
  59. package/dist/testing.js +37 -23
  60. package/dist/tool-intercept.d.ts +4 -4
  61. package/dist/tool-intercept.js +5 -5
  62. package/dist/unit.d.ts +2 -0
  63. package/dist/unit.js +8 -1
  64. package/hooks/refs-nudge.sh +1 -1
  65. package/package.json +5 -3
@@ -23,7 +23,7 @@ exports.parseIntercepts = parseIntercepts;
23
23
  *
24
24
  * - `decideIntercept` — does this call get intercepted, and with what deny reason;
25
25
  * - `buildInterceptSettings` — the PreToolUse hook fragment routing matched tools
26
- * through `vigiles intercept-tool-hook`;
26
+ * through `vigiles hook-runtime intercept-tool`;
27
27
  * - `serializeIntercepts` / `parseIntercepts` — the env round-trip (incl. RegExp
28
28
  * matchers) the hook subprocess reads back.
29
29
  *
@@ -40,7 +40,7 @@ exports.parseIntercepts = parseIntercepts;
40
40
  * tools, so deny+reason is the closest available — with that ceiling.
41
41
  */
42
42
  const arg_match_js_1 = require("./arg-match.js");
43
- /** Env var the spawned `vigiles intercept-tool-hook` reads its intercept list from. */
43
+ /** Env var the spawned `vigiles hook-runtime intercept-tool` reads its intercept list from. */
44
44
  exports.INTERCEPT_TOOLS_ENV = "VIGILES_INTERCEPT_TOOLS";
45
45
  /** The default denial reason — honest that the call was intercepted (prevented), NOT executed. */
46
46
  exports.DEFAULT_INTERCEPT_REASON = "vigiles intercepted this tool call for testing — it was NOT executed. " +
@@ -48,7 +48,7 @@ exports.DEFAULT_INTERCEPT_REASON = "vigiles intercepted this tool call for testi
48
48
  /**
49
49
  * Decide whether a tool call should be intercepted. Returns the first matching
50
50
  * intercept's denial reason (preventing real execution), or `{ intercept: false }`
51
- * to let the call run for real. Pure — the same logic `vigiles intercept-tool-hook`
51
+ * to let the call run for real. Pure — the same logic `vigiles hook-runtime intercept-tool`
52
52
  * runs.
53
53
  */
54
54
  function decideIntercept(toolName, input, intercepts) {
@@ -90,14 +90,14 @@ function uniqueToolNames(intercepts) {
90
90
  }
91
91
  /**
92
92
  * Build the PreToolUse hook fragment that routes every intercepted tool through
93
- * `vigiles intercept-tool-hook`. The `matcher` is a CC tool-name regex over the
93
+ * `vigiles hook-runtime intercept-tool`. The `matcher` is a CC tool-name regex over the
94
94
  * union of intercepted tool names (each escaped), so unrelated tools are never
95
95
  * intercepted. Merge the result into an arm's `settings`; the intercept list
96
96
  * itself travels in the {@link INTERCEPT_TOOLS_ENV} env var (see
97
97
  * {@link serializeIntercepts}).
98
98
  */
99
99
  function buildInterceptSettings(intercepts, opts = {}) {
100
- const command = opts.command ?? "npx vigiles intercept-tool-hook";
100
+ const command = opts.command ?? "npx vigiles hook-runtime intercept-tool";
101
101
  const matcher = uniqueToolNames(intercepts).map(escapeRegex).join("|");
102
102
  return {
103
103
  hooks: {
package/dist/unit.d.ts CHANGED
@@ -16,4 +16,6 @@ export { runHook, parseHookOutput, decideHook, propertyHook, } from "./run-hook.
16
16
  export type { HookInput, HookOutput, HookRunResult, RunHookOptions, HookPropertyResult, } from "./run-hook.js";
17
17
  export * from "./check.js";
18
18
  export { hookFired } from "./check.js";
19
+ export { DISASTER_CATALOG, verifyGuardrail, unblockedDisasters, assertBlocksDisasters, formatGuardrailReport, } from "./guardrail-check.js";
20
+ export type { DisasterEvent, DisasterCategory, GuardrailResult, VerifyGuardrailOptions, } from "./guardrail-check.js";
19
21
  //# sourceMappingURL=unit.d.ts.map
package/dist/unit.js CHANGED
@@ -14,7 +14,7 @@ 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
- exports.hookFired = exports.propertyHook = exports.decideHook = exports.parseHookOutput = exports.runHook = void 0;
17
+ exports.formatGuardrailReport = exports.assertBlocksDisasters = exports.unblockedDisasters = exports.verifyGuardrail = exports.DISASTER_CATALOG = exports.hookFired = exports.propertyHook = exports.decideHook = exports.parseHookOutput = exports.runHook = void 0;
18
18
  /**
19
19
  * `vigiles/unit` — the **no-capability** harness-testing surface.
20
20
  *
@@ -39,4 +39,11 @@ Object.defineProperty(exports, "propertyHook", { enumerable: true, get: function
39
39
  __exportStar(require("./check.js"), exports);
40
40
  var check_js_1 = require("./check.js");
41
41
  Object.defineProperty(exports, "hookFired", { enumerable: true, get: function () { return check_js_1.hookFired; } });
42
+ // Guardrail verification — "prove your safety hook actually blocks" (over runHook).
43
+ var guardrail_check_js_1 = require("./guardrail-check.js");
44
+ Object.defineProperty(exports, "DISASTER_CATALOG", { enumerable: true, get: function () { return guardrail_check_js_1.DISASTER_CATALOG; } });
45
+ Object.defineProperty(exports, "verifyGuardrail", { enumerable: true, get: function () { return guardrail_check_js_1.verifyGuardrail; } });
46
+ Object.defineProperty(exports, "unblockedDisasters", { enumerable: true, get: function () { return guardrail_check_js_1.unblockedDisasters; } });
47
+ Object.defineProperty(exports, "assertBlocksDisasters", { enumerable: true, get: function () { return guardrail_check_js_1.assertBlocksDisasters; } });
48
+ Object.defineProperty(exports, "formatGuardrailReport", { enumerable: true, get: function () { return guardrail_check_js_1.formatGuardrailReport; } });
42
49
  //# sourceMappingURL=unit.js.map
@@ -13,7 +13,7 @@ INPUT=$(cat)
13
13
  command -v npx >/dev/null 2>&1 || exit 0
14
14
  [ -f package.json ] || exit 0
15
15
 
16
- printf '%s' "$INPUT" | npx vigiles refs-hook
16
+ printf '%s' "$INPUT" | npx vigiles hook-runtime refs
17
17
  status=${PIPESTATUS[1]}
18
18
 
19
19
  # Propagate ONLY an explicit block (exit 2). Swallow tool/setup errors so a
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vigiles",
3
- "version": "6.0.0",
3
+ "version": "7.0.0",
4
4
  "description": "Lint & test the harness your AI agent runs on — verify the references in your CLAUDE.md / AGENTS.md and test that your hooks and skills actually work.",
5
5
  "keywords": [
6
6
  "claude-code",
@@ -38,6 +38,7 @@
38
38
  "./linting": "./dist/linting.js",
39
39
  "./testing": "./dist/testing.js",
40
40
  "./unit": "./dist/unit.js",
41
+ "./hook": "./dist/hook.js",
41
42
  "./integration": "./dist/integration.js",
42
43
  "./e2e": "./dist/e2e.js",
43
44
  "./claude-code": "./dist/claude-code.js",
@@ -82,11 +83,10 @@
82
83
  "test:types": "npm run build && tsc --noEmit -p test/types/tsconfig.json",
83
84
  "api:report": "npm run build && node scripts/api-extractor.mjs --local",
84
85
  "api:check": "npm run build && node scripts/api-extractor.mjs",
85
- "docs:api": "npm run api:report && api-documenter markdown -i temp -o api-reference"
86
+ "docs:api": "typedoc"
86
87
  },
87
88
  "devDependencies": {
88
89
  "@eslint/js": "^10.0.1",
89
- "@microsoft/api-documenter": "^7.30.7",
90
90
  "@microsoft/api-extractor": "^7.58.9",
91
91
  "@types/js-yaml": "^4.0.9",
92
92
  "@types/minimatch": "^5.1.2",
@@ -102,6 +102,7 @@
102
102
  "jest": "^30.4.2",
103
103
  "prettier": "^3.8.1",
104
104
  "tsx": "^4.21.0",
105
+ "typedoc": "^0.28.19",
105
106
  "typescript": "^5.9.3",
106
107
  "vitest": "^4.1.8"
107
108
  },
@@ -124,6 +125,7 @@
124
125
  "@ast-grep/napi": "^0.43.0",
125
126
  "@iarna/toml": "^2.2.5",
126
127
  "@jackchuka/mdschema": "^0.12.8",
128
+ "ci-info": "^4.4.0",
127
129
  "cosmiconfig": "^9.0.1",
128
130
  "glob": "^13.0.6",
129
131
  "js-yaml": "^4.1.0",