vigiles 14.7.0 → 14.9.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/adapters/claude-code/agent-runtime.d.ts +2 -19
- package/dist/adapters/claude-code/agent-runtime.js +5 -30
- package/dist/adapters/claude-code/agent-tools.d.ts +20 -0
- package/dist/adapters/claude-code/agent-tools.js +40 -0
- package/dist/audit-report.d.ts +1 -1
- package/dist/audit-report.template.html +37 -32
- package/dist/audit-score.d.ts +1 -1
- package/dist/audit-score.js +20 -20
- package/dist/audit-verdict.d.ts +1 -1
- package/dist/audit-verdict.js +3 -3
- package/dist/core/assert-never.d.ts +9 -0
- package/dist/core/assert-never.js +14 -0
- package/dist/core/description-overlap.js +2 -2
- package/dist/core/effects.js +3 -3
- package/dist/core/hash.d.ts +1 -2
- package/dist/core/hash.js +6 -4
- package/dist/core/hook-block-ineffective.d.ts +55 -6
- package/dist/core/hook-block-ineffective.js +9 -14
- package/dist/core/mcp-contract-message.d.ts +22 -0
- package/dist/core/mcp-contract-message.js +29 -0
- package/dist/core/mcp.d.ts +4 -12
- package/dist/core/mcp.js +3 -14
- package/dist/core/ncd.d.ts +12 -0
- package/dist/core/ncd.js +50 -0
- package/dist/core/plugin-dir-layout.d.ts +5 -5
- package/dist/core/plugin-dir-layout.js +10 -22
- package/dist/core/proofs.d.ts +2 -11
- package/dist/core/proofs.js +4 -39
- package/dist/core/skill-resources.d.ts +3 -3
- package/dist/core/skill-resources.js +9 -8
- package/dist/leaderboard.d.ts +2 -51
- package/dist/leaderboard.js +20 -225
- package/dist/optimize.d.ts +1 -1
- package/dist/optimize.js +3 -3
- package/dist/posix-path.d.ts +40 -0
- package/dist/posix-path.js +293 -0
- package/dist/scan-core.d.ts +154 -0
- package/dist/scan-core.js +690 -0
- package/dist/scan-files.d.ts +28 -0
- package/dist/scan-files.js +489 -0
- package/dist/scan.d.ts +11 -34
- package/dist/scan.js +55 -668
- package/dist/score-core.d.ts +83 -0
- package/dist/score-core.js +236 -0
- package/dist/test-coverage-files.d.ts +11 -0
- package/dist/test-coverage-files.js +208 -0
- package/package.json +1 -1
|
@@ -23,25 +23,8 @@
|
|
|
23
23
|
* harness-agnostic and fully testable.
|
|
24
24
|
*/
|
|
25
25
|
import type { PurityLevel } from "../../core/effects.js";
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
*
|
|
29
|
-
* Returns the list of allowed tool names, or `null` when the agent declares no
|
|
30
|
-
* `tools:` line at all — which in Claude Code means it inherits EVERY tool (the
|
|
31
|
-
* #1 footgun). `null` is the "no restriction" signal the decision logic honors;
|
|
32
|
-
* an empty list (`tools:` with nothing after it) means "no tools allowed".
|
|
33
|
-
*/
|
|
34
|
-
export declare function parseAgentTools(markdown: string): string[] | null;
|
|
35
|
-
/**
|
|
36
|
-
* Parse a comma/array tool list under an arbitrary frontmatter `key` (e.g.
|
|
37
|
-
* `tools:` or `disallowedTools:`) via the shared lenient reader
|
|
38
|
-
* (core/frontmatter-read.ts): a real YAML parse (so `key: [Read, "Bash"]` is a
|
|
39
|
-
* native array and `key: Read, Bash` a comma scalar) with a regex salvage when
|
|
40
|
-
* the block is malformed — the rail still reads the contract. `null` when the key
|
|
41
|
-
* is absent (inherits all), `[]` when present-but-empty (no tools). Shared by the
|
|
42
|
-
* rail (`tools:`) and the `disallowed-tools-contract` scan/lint.
|
|
43
|
-
*/
|
|
44
|
-
export declare function parseAgentToolList(markdown: string, key: string): string[] | null;
|
|
26
|
+
import { parseAgentTools, parseAgentToolList } from "./agent-tools.js";
|
|
27
|
+
export { parseAgentTools, parseAgentToolList };
|
|
45
28
|
/**
|
|
46
29
|
* Parse the declared purity floor from a compiled agent's `.md` — the
|
|
47
30
|
* `<!-- vigiles:purity:LEVEL -->` marker `compile` emits (see `purityMarker`).
|
|
@@ -24,8 +24,7 @@
|
|
|
24
24
|
* harness-agnostic and fully testable.
|
|
25
25
|
*/
|
|
26
26
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.parseAgentTools =
|
|
28
|
-
exports.parseAgentToolList = parseAgentToolList;
|
|
27
|
+
exports.parseAgentToolList = exports.parseAgentTools = void 0;
|
|
29
28
|
exports.parseAgentPurity = parseAgentPurity;
|
|
30
29
|
exports.decidePreToolUse = decidePreToolUse;
|
|
31
30
|
exports.readActiveStack = readActiveStack;
|
|
@@ -39,36 +38,12 @@ exports.decideTaskDispatch = decideTaskDispatch;
|
|
|
39
38
|
exports.evaluatePreToolUse = evaluatePreToolUse;
|
|
40
39
|
const node_fs_1 = require("node:fs");
|
|
41
40
|
const node_path_1 = require("node:path");
|
|
42
|
-
const frontmatter_read_js_1 = require("../../core/frontmatter-read.js");
|
|
43
41
|
const effects_js_1 = require("../../core/effects.js");
|
|
44
42
|
const dialect_js_1 = require("./dialect.js");
|
|
45
43
|
const effect_region_js_1 = require("./effect-region.js");
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Parse an agent's allowed-tools contract from its compiled markdown.
|
|
51
|
-
*
|
|
52
|
-
* Returns the list of allowed tool names, or `null` when the agent declares no
|
|
53
|
-
* `tools:` line at all — which in Claude Code means it inherits EVERY tool (the
|
|
54
|
-
* #1 footgun). `null` is the "no restriction" signal the decision logic honors;
|
|
55
|
-
* an empty list (`tools:` with nothing after it) means "no tools allowed".
|
|
56
|
-
*/
|
|
57
|
-
function parseAgentTools(markdown) {
|
|
58
|
-
return parseAgentToolList(markdown, "tools");
|
|
59
|
-
}
|
|
60
|
-
/**
|
|
61
|
-
* Parse a comma/array tool list under an arbitrary frontmatter `key` (e.g.
|
|
62
|
-
* `tools:` or `disallowedTools:`) via the shared lenient reader
|
|
63
|
-
* (core/frontmatter-read.ts): a real YAML parse (so `key: [Read, "Bash"]` is a
|
|
64
|
-
* native array and `key: Read, Bash` a comma scalar) with a regex salvage when
|
|
65
|
-
* the block is malformed — the rail still reads the contract. `null` when the key
|
|
66
|
-
* is absent (inherits all), `[]` when present-but-empty (no tools). Shared by the
|
|
67
|
-
* rail (`tools:`) and the `disallowed-tools-contract` scan/lint.
|
|
68
|
-
*/
|
|
69
|
-
function parseAgentToolList(markdown, key) {
|
|
70
|
-
return (0, frontmatter_read_js_1.frontmatterList)((0, frontmatter_read_js_1.readFrontmatter)(markdown), key);
|
|
71
|
-
}
|
|
44
|
+
const agent_tools_js_1 = require("./agent-tools.js");
|
|
45
|
+
Object.defineProperty(exports, "parseAgentTools", { enumerable: true, get: function () { return agent_tools_js_1.parseAgentTools; } });
|
|
46
|
+
Object.defineProperty(exports, "parseAgentToolList", { enumerable: true, get: function () { return agent_tools_js_1.parseAgentToolList; } });
|
|
72
47
|
const PURITY_RE = /<!--\s*vigiles:purity:(pure|bounded|unrestricted)\s*-->/;
|
|
73
48
|
/**
|
|
74
49
|
* Parse the declared purity floor from a compiled agent's `.md` — the
|
|
@@ -264,7 +239,7 @@ function evaluatePreToolUse(cwd, tool, command) {
|
|
|
264
239
|
return { allow: true, message: "" };
|
|
265
240
|
const md = (0, node_fs_1.readFileSync)(full, "utf-8");
|
|
266
241
|
// 1) Tool-contract rail — the declared allowlist.
|
|
267
|
-
const rail = decidePreToolUse(parseAgentTools(md), tool);
|
|
242
|
+
const rail = decidePreToolUse((0, agent_tools_js_1.parseAgentTools)(md), tool);
|
|
268
243
|
if (!rail.allow)
|
|
269
244
|
return rail;
|
|
270
245
|
// 2) Purity gate — the declared effect floor, refined by the live command.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parse an agent's allowed-tools contract from its compiled markdown.
|
|
3
|
+
*
|
|
4
|
+
* Returns the list of allowed tool names, or `null` when the agent declares no
|
|
5
|
+
* `tools:` line at all — which in Claude Code means it inherits EVERY tool (the
|
|
6
|
+
* #1 footgun). `null` is the "no restriction" signal the decision logic honors;
|
|
7
|
+
* an empty list (`tools:` with nothing after it) means "no tools allowed".
|
|
8
|
+
*/
|
|
9
|
+
export declare function parseAgentTools(markdown: string): string[] | null;
|
|
10
|
+
/**
|
|
11
|
+
* Parse a comma/array tool list under an arbitrary frontmatter `key` (e.g.
|
|
12
|
+
* `tools:` or `disallowedTools:`) via the shared lenient reader
|
|
13
|
+
* (core/frontmatter-read.ts): a real YAML parse (so `key: [Read, "Bash"]` is a
|
|
14
|
+
* native array and `key: Read, Bash` a comma scalar) with a regex salvage when
|
|
15
|
+
* the block is malformed — the rail still reads the contract. `null` when the key
|
|
16
|
+
* is absent (inherits all), `[]` when present-but-empty (no tools). Shared by the
|
|
17
|
+
* rail (`tools:`) and the `disallowed-tools-contract` scan/lint.
|
|
18
|
+
*/
|
|
19
|
+
export declare function parseAgentToolList(markdown: string, key: string): string[] | null;
|
|
20
|
+
//# sourceMappingURL=agent-tools.d.ts.map
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseAgentTools = parseAgentTools;
|
|
4
|
+
exports.parseAgentToolList = parseAgentToolList;
|
|
5
|
+
/**
|
|
6
|
+
* Pure tool-contract PARSERS for a compiled agent/skill `.md` — extracted from
|
|
7
|
+
* `agent-runtime.ts` so a consumer can read a `tools:`/`allowed-tools:` contract
|
|
8
|
+
* WITHOUT pulling `agent-runtime.ts`'s `node:fs` runtime rail into the bundle.
|
|
9
|
+
*
|
|
10
|
+
* The deterministic audit engine (`scan-core.ts` → `scanAgents`/`scanSkills`)
|
|
11
|
+
* reads these contracts in the browser, where `node:fs` cannot be bundled; the
|
|
12
|
+
* live PreToolUse rail (`agent-runtime.ts`) re-exports both so its callers are
|
|
13
|
+
* unchanged. Node-free by construction — the only dependency is the shared
|
|
14
|
+
* lenient frontmatter reader (`core/frontmatter-read.ts`, js-yaml, no `node:`).
|
|
15
|
+
*/
|
|
16
|
+
const frontmatter_read_js_1 = require("../../core/frontmatter-read.js");
|
|
17
|
+
/**
|
|
18
|
+
* Parse an agent's allowed-tools contract from its compiled markdown.
|
|
19
|
+
*
|
|
20
|
+
* Returns the list of allowed tool names, or `null` when the agent declares no
|
|
21
|
+
* `tools:` line at all — which in Claude Code means it inherits EVERY tool (the
|
|
22
|
+
* #1 footgun). `null` is the "no restriction" signal the decision logic honors;
|
|
23
|
+
* an empty list (`tools:` with nothing after it) means "no tools allowed".
|
|
24
|
+
*/
|
|
25
|
+
function parseAgentTools(markdown) {
|
|
26
|
+
return parseAgentToolList(markdown, "tools");
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Parse a comma/array tool list under an arbitrary frontmatter `key` (e.g.
|
|
30
|
+
* `tools:` or `disallowedTools:`) via the shared lenient reader
|
|
31
|
+
* (core/frontmatter-read.ts): a real YAML parse (so `key: [Read, "Bash"]` is a
|
|
32
|
+
* native array and `key: Read, Bash` a comma scalar) with a regex salvage when
|
|
33
|
+
* the block is malformed — the rail still reads the contract. `null` when the key
|
|
34
|
+
* is absent (inherits all), `[]` when present-but-empty (no tools). Shared by the
|
|
35
|
+
* rail (`tools:`) and the `disallowed-tools-contract` scan/lint.
|
|
36
|
+
*/
|
|
37
|
+
function parseAgentToolList(markdown, key) {
|
|
38
|
+
return (0, frontmatter_read_js_1.frontmatterList)((0, frontmatter_read_js_1.readFrontmatter)(markdown), key);
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=agent-tools.js.map
|
package/dist/audit-report.d.ts
CHANGED
|
@@ -17,7 +17,7 @@ import { type Verdict } from "./audit-verdict.js";
|
|
|
17
17
|
import type { LedgerSummary } from "./observe.js";
|
|
18
18
|
import type { AdoptabilityResult } from "./adoptability.js";
|
|
19
19
|
import type { ScanReport, MarketplaceInfo } from "./scan.js";
|
|
20
|
-
import type { PluginScore } from "./
|
|
20
|
+
import type { PluginScore } from "./score-core.js";
|
|
21
21
|
import type { RuleInventoryItem } from "./rule-inventory.js";
|
|
22
22
|
import type { RuleRouting } from "./rule-routing.js";
|
|
23
23
|
/**
|