vigiles 30.0.2 → 31.0.1

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 (42) hide show
  1. package/dist/adapter-conformance.js +9 -15
  2. package/dist/adapters/claude-code/run-scripts.d.ts +5 -3
  3. package/dist/adapters/claude-code/run-scripts.js +5 -3
  4. package/dist/claude-code.js +5 -0
  5. package/dist/cli-main.d.ts +8 -0
  6. package/dist/cli-main.js +315 -212
  7. package/dist/codex.js +5 -0
  8. package/dist/core/compile.d.ts +5 -5
  9. package/dist/core/compile.js +28 -25
  10. package/dist/core/config-schema.d.ts +32 -32
  11. package/dist/core/coverage.d.ts +4 -3
  12. package/dist/core/coverage.js +4 -3
  13. package/dist/core/doc-refs.d.ts +3 -1
  14. package/dist/core/doc-refs.js +2 -1
  15. package/dist/core/frame.d.ts +90 -0
  16. package/dist/core/frame.js +58 -0
  17. package/dist/core/glob-ignore.d.ts +28 -0
  18. package/dist/core/glob-ignore.js +42 -0
  19. package/dist/core/orphans.d.ts +5 -3
  20. package/dist/core/orphans.js +5 -4
  21. package/dist/core/refs.d.ts +2 -2
  22. package/dist/core/refs.js +9 -12
  23. package/dist/core/spec.js +5 -0
  24. package/dist/core/symbols.d.ts +25 -19
  25. package/dist/core/symbols.js +51 -74
  26. package/dist/core/tree-sitter-wasm.d.ts +24 -0
  27. package/dist/core/tree-sitter-wasm.js +128 -0
  28. package/dist/eval-surface.js +5 -0
  29. package/dist/exclude.d.ts +3 -5
  30. package/dist/exclude.js +3 -3
  31. package/dist/hook-install.js +23 -10
  32. package/dist/hook.js +5 -0
  33. package/dist/jest.js +5 -0
  34. package/dist/linting.d.ts +11 -30
  35. package/dist/linting.js +22 -35
  36. package/dist/scan.d.ts +3 -3
  37. package/dist/scan.js +8 -7
  38. package/dist/test-coverage.d.ts +20 -3
  39. package/dist/test-coverage.js +40 -14
  40. package/dist/test.js +5 -0
  41. package/dist/vitest.mjs +5 -0
  42. package/package.json +4 -7
@@ -14,8 +14,7 @@ exports.assertAdapterLoadsHooks = assertAdapterLoadsHooks;
14
14
  */
15
15
  const node_fs_1 = require("node:fs");
16
16
  const node_path_1 = require("node:path");
17
- const compile_js_1 = require("./core/compile.js");
18
- const spec_js_1 = require("./core/spec.js");
17
+ const tool_contract_js_1 = require("./core/tool-contract.js");
19
18
  const plugin_loader_js_1 = require("./plugin-loader.js");
20
19
  const vocabulary_consistency_js_1 = require("./core/vocabulary-consistency.js");
21
20
  const event_capability_js_1 = require("./core/event-capability.js");
@@ -190,21 +189,16 @@ function checkAdapterConformance(adapter) {
190
189
  catch (e) {
191
190
  need(false, `layout.settings ("${adapter.layout.settings.label}") threw on its own output: ${String(e)}`);
192
191
  }
193
- // Behavioural: the dialect drives the compiler — its own built-in tool must
194
- // pass the subagent tool-contract check under this dialect.
192
+ // Behavioural: the dialect drives the subagent tool-contract check — its own built-in tool
193
+ // must pass that check under this dialect. This calls the SAME validator `compileAgent` uses
194
+ // (`verifyToolContract` + `authoringIssues`) rather than `compileAgent` itself: the tool
195
+ // contract is what this line claims to check, and compiling a whole agent would tie this
196
+ // synchronous public kit to the compiler's (async) reference validation for nothing.
195
197
  const tool = adapter.dialect.builtinAgentTools[0];
196
198
  if (tool) {
197
- const spec = (0, spec_js_1.experimental_agent)({
198
- name: "conformance",
199
- description: "conformance probe",
200
- tools: [tool],
201
- body: "probe",
202
- });
203
- const r = (0, compile_js_1.compileAgent)(spec, {
204
- specFile: "conformance.md.spec.ts",
205
- dialect: adapter.dialect,
206
- });
207
- need(!r.errors.some((e) => e.type === "unknown-tool"), `dialect rejects its own built-in tool "${tool}"`);
199
+ const issues = (0, tool_contract_js_1.authoringIssues)((0, tool_contract_js_1.verifyToolContract)([tool], adapter.dialect));
200
+ need(issues.length === 0, `dialect rejects its own built-in tool "${tool}"` +
201
+ (issues.length ? `: ${issues.map((i) => i.message).join("; ")}` : ""));
208
202
  }
209
203
  return { ok: failures.length === 0, failures };
210
204
  }
@@ -108,6 +108,7 @@ export declare const SCRIPT_EXTS: readonly ["mjs", "cjs", "js", "mts", "cts", "t
108
108
  export declare function scriptGlob(kind: "harness" | "eval"): string;
109
109
  export { detectNodeCaps, canRunTypeScript, type NodeCaps, } from "../../ts-runner-caps.js";
110
110
  import type { NodeCaps } from "../../ts-runner-caps.js";
111
+ import { type GlobIgnore } from "../../core/glob-ignore.js";
111
112
  /**
112
113
  * The `node` argv (after the binary) to run a single script. Plain JS runs
113
114
  * directly; a TypeScript script picks `tsx` when available, else Node's native
@@ -128,12 +129,13 @@ export declare function interpreterArgs(file: string, caps: NodeCaps, entry?: st
128
129
  * Expand the given path/glob patterns into concrete script files. A pattern
129
130
  * that is an existing file passes through unchanged; anything else is treated
130
131
  * as a glob. Falls back to `defaultGlob` when no patterns are given. Results
131
- * are deduped and sorted. `ignore` is the repo's ExcludeSet string face
132
- * (src/exclude.ts — the floor plus `.vigilesrc.json#exclude`), REQUIRED so a
132
+ * are deduped and sorted. `ignore` is the repo's `ExcludeSet.globIgnore`
133
+ * (src/exclude.ts — the floor plus `.vigilesrc.json#exclude`, correct from any
134
+ * `cwd`; a plain list is relative to `cwd`), REQUIRED so a
133
135
  * vendored corpus's own `*.harness.mjs` cannot be discovered and run as ours
134
136
  * (#192). A path given explicitly in `patterns` is still run.
135
137
  */
136
- export declare function discoverScripts(patterns: readonly string[], defaultGlob: string, cwd: string, ignore: readonly string[]): string[];
138
+ export declare function discoverScripts(patterns: readonly string[], defaultGlob: string, cwd: string, ignore: GlobIgnore): string[];
137
139
  /** Extra wiring for {@link runScripts}. */
138
140
  export interface RunScriptsOptions {
139
141
  /**
@@ -120,6 +120,7 @@ Object.defineProperty(exports, "detectNodeCaps", { enumerable: true, get: functi
120
120
  Object.defineProperty(exports, "canRunTypeScript", { enumerable: true, get: function () { return ts_runner_caps_js_1.canRunTypeScript; } });
121
121
  const ts_runner_caps_js_2 = require("../../ts-runner-caps.js");
122
122
  const tmp_root_js_1 = require("../../core/tmp-root.js");
123
+ const glob_ignore_js_1 = require("../../core/glob-ignore.js");
123
124
  /**
124
125
  * The `node` argv (after the binary) to run a single script. Plain JS runs
125
126
  * directly; a TypeScript script picks `tsx` when available, else Node's native
@@ -152,8 +153,9 @@ function interpreterArgs(file, caps, entry) {
152
153
  * Expand the given path/glob patterns into concrete script files. A pattern
153
154
  * that is an existing file passes through unchanged; anything else is treated
154
155
  * as a glob. Falls back to `defaultGlob` when no patterns are given. Results
155
- * are deduped and sorted. `ignore` is the repo's ExcludeSet string face
156
- * (src/exclude.ts — the floor plus `.vigilesrc.json#exclude`), REQUIRED so a
156
+ * are deduped and sorted. `ignore` is the repo's `ExcludeSet.globIgnore`
157
+ * (src/exclude.ts — the floor plus `.vigilesrc.json#exclude`, correct from any
158
+ * `cwd`; a plain list is relative to `cwd`), REQUIRED so a
157
159
  * vendored corpus's own `*.harness.mjs` cannot be discovered and run as ours
158
160
  * (#192). A path given explicitly in `patterns` is still run.
159
161
  */
@@ -189,7 +191,7 @@ function discoverScripts(patterns, defaultGlob, cwd, ignore) {
189
191
  // Asked of the globber rather than filtered afterwards: it already knows.
190
192
  for (const m of (0, glob_1.globSync)(p, {
191
193
  cwd,
192
- ignore: [...ignore],
194
+ ignore: (0, glob_ignore_js_1.withIgnored)([], ignore),
193
195
  dot: true,
194
196
  nodir: true,
195
197
  })) {
@@ -15,6 +15,11 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.formatSelectionReport = exports.assertNoCollision = exports.measureSelectionMatrix = exports.agent = exports.experimental_skill = exports.experimental_agent = exports.claudeAvailable = exports.parseClaudeRun = exports.buildClaudeArgs = exports.claudeCodeDriver = void 0;
18
+ // 🔴 PUBLIC ENTRY POINT `vigiles/claude-code` — every export here is a promise to users. The default for a
19
+ // symbol is INTERNAL. It is exported only if (a) a NAMED external consumer uses it, or (b) it is
20
+ // a deliberate extension point listed in STABILITY.md (the adapter kit is the example). "Might
21
+ // be useful" is neither. Review point: the diff of `api-surface/vigiles-claude-code.api.md`, which
22
+ // `npm run api:check` fails on.
18
23
  /**
19
24
  * `vigiles/claude-code` — the Claude Code-specific harness pieces a *different*
20
25
  * harness would swap out: the plugin/repo loader (reads real Claude Code plugin
@@ -113,6 +113,14 @@ export declare function lintTotals(report: LintReport): {
113
113
  errors: number;
114
114
  warnings: number;
115
115
  };
116
+ /**
117
+ * Unified lint command: verify hashes, report coverage gaps, detect duplicates,
118
+ * suggest improvements.
119
+ *
120
+ * Flags:
121
+ * --summary Print a single-line summary (for SessionStart hooks)
122
+ * --json Print structured JSON report (for CI integration)
123
+ */
116
124
  /**
117
125
  * Nested plugin bundles under a lint root — a directory that is itself a harness
118
126
  * (its own `.claude-plugin/plugin.json`, or its own skills dir) and is NOT the