@orygn/opa-mcp 0.1.2 → 0.1.4

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 (100) hide show
  1. package/CHANGELOG.md +63 -1
  2. package/README.md +65 -23
  3. package/dist/config.d.ts +1 -1
  4. package/dist/config.js +2 -2
  5. package/dist/constants.d.ts +8 -0
  6. package/dist/constants.d.ts.map +1 -0
  7. package/dist/constants.js +8 -0
  8. package/dist/constants.js.map +1 -0
  9. package/dist/lib/errors.d.ts +1 -1
  10. package/dist/lib/logger.js +2 -2
  11. package/dist/lib/logger.js.map +1 -1
  12. package/dist/lib/opa-cli.d.ts +3 -3
  13. package/dist/lib/opa-cli.js +5 -5
  14. package/dist/lib/opa-cli.js.map +1 -1
  15. package/dist/lib/opa-client.d.ts +1 -1
  16. package/dist/lib/regal-cli.d.ts +4 -4
  17. package/dist/lib/regal-cli.js +5 -5
  18. package/dist/lib/subprocess.d.ts +1 -1
  19. package/dist/lib/subprocess.js +2 -2
  20. package/dist/lib/tool-helpers.d.ts +1 -1
  21. package/dist/prompts/index.js +6 -6
  22. package/dist/prompts/index.js.map +1 -1
  23. package/dist/resources/index.d.ts +4 -4
  24. package/dist/resources/patterns.d.ts +1 -1
  25. package/dist/resources/patterns.d.ts.map +1 -1
  26. package/dist/resources/patterns.js +7 -7
  27. package/dist/resources/style-guide.d.ts +1 -1
  28. package/dist/resources/style-guide.d.ts.map +1 -1
  29. package/dist/resources/style-guide.js +3 -3
  30. package/dist/server.d.ts +2 -2
  31. package/dist/server.d.ts.map +1 -1
  32. package/dist/server.js +4 -4
  33. package/dist/server.js.map +1 -1
  34. package/dist/tools/authoring/capabilities.js +1 -1
  35. package/dist/tools/authoring/check.js +3 -3
  36. package/dist/tools/authoring/check.js.map +1 -1
  37. package/dist/tools/authoring/deps.js +2 -2
  38. package/dist/tools/authoring/deps.js.map +1 -1
  39. package/dist/tools/authoring/format.js +1 -1
  40. package/dist/tools/authoring/index.d.ts +1 -1
  41. package/dist/tools/authoring/inspect.js +2 -2
  42. package/dist/tools/authoring/inspect.js.map +1 -1
  43. package/dist/tools/authoring/lint.js +1 -1
  44. package/dist/tools/authoring/parse.js +1 -1
  45. package/dist/tools/bundles/build.js +1 -1
  46. package/dist/tools/bundles/index.d.ts +1 -1
  47. package/dist/tools/bundles/sign.js +1 -1
  48. package/dist/tools/evaluation/_shared.d.ts +1 -1
  49. package/dist/tools/evaluation/_shared.js +1 -1
  50. package/dist/tools/evaluation/bench.js +1 -1
  51. package/dist/tools/evaluation/compile.d.ts +2 -2
  52. package/dist/tools/evaluation/compile.js +1 -1
  53. package/dist/tools/evaluation/compile.js.map +1 -1
  54. package/dist/tools/evaluation/eval.d.ts +2 -2
  55. package/dist/tools/evaluation/eval.js +1 -1
  56. package/dist/tools/evaluation/eval.js.map +1 -1
  57. package/dist/tools/evaluation/index.d.ts +1 -1
  58. package/dist/tools/evaluation/test.js +1 -1
  59. package/dist/tools/helpers/coverage-gaps.d.ts +29 -0
  60. package/dist/tools/helpers/coverage-gaps.d.ts.map +1 -0
  61. package/dist/tools/helpers/coverage-gaps.js +125 -0
  62. package/dist/tools/helpers/coverage-gaps.js.map +1 -0
  63. package/dist/tools/helpers/describe-policy.js +1 -1
  64. package/dist/tools/helpers/explain-decision.d.ts +1 -1
  65. package/dist/tools/helpers/explain-decision.js +1 -1
  66. package/dist/tools/helpers/explain-decision.js.map +1 -1
  67. package/dist/tools/helpers/generate-test-skeleton.js +3 -3
  68. package/dist/tools/helpers/generate-test-skeleton.js.map +1 -1
  69. package/dist/tools/helpers/index.d.ts +1 -1
  70. package/dist/tools/helpers/index.d.ts.map +1 -1
  71. package/dist/tools/helpers/index.js +4 -0
  72. package/dist/tools/helpers/index.js.map +1 -1
  73. package/dist/tools/helpers/security-audit.d.ts +21 -0
  74. package/dist/tools/helpers/security-audit.d.ts.map +1 -0
  75. package/dist/tools/helpers/security-audit.js +111 -0
  76. package/dist/tools/helpers/security-audit.js.map +1 -0
  77. package/dist/tools/helpers/suggest-fix.js +6 -6
  78. package/dist/tools/helpers/suggest-fix.js.map +1 -1
  79. package/dist/tools/index.d.ts +9 -6
  80. package/dist/tools/index.d.ts.map +1 -1
  81. package/dist/tools/index.js +2 -0
  82. package/dist/tools/index.js.map +1 -1
  83. package/dist/tools/meta/index.d.ts +10 -0
  84. package/dist/tools/meta/index.d.ts.map +1 -0
  85. package/dist/tools/meta/index.js +5 -0
  86. package/dist/tools/meta/index.js.map +1 -0
  87. package/dist/tools/meta/server-info.d.ts +17 -0
  88. package/dist/tools/meta/server-info.d.ts.map +1 -0
  89. package/dist/tools/meta/server-info.js +30 -0
  90. package/dist/tools/meta/server-info.js.map +1 -0
  91. package/dist/tools/server-management/data.js +1 -1
  92. package/dist/tools/server-management/data.js.map +1 -1
  93. package/dist/tools/server-management/decisions.js +1 -1
  94. package/dist/tools/server-management/decisions.js.map +1 -1
  95. package/dist/tools/server-management/index.d.ts +1 -1
  96. package/dist/tools/server-management/policies.js +1 -1
  97. package/dist/tools/server-management/policies.js.map +1 -1
  98. package/dist/tools/server-management/status.js +2 -2
  99. package/dist/tools/server-management/status.js.map +1 -1
  100. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -17,6 +17,66 @@ not part of the public surface and may change in minor releases.
17
17
 
18
18
  ## [Unreleased]
19
19
 
20
+ ## [0.1.4] - 2026-05-20
21
+
22
+ ### Fixed
23
+
24
+ - **`rego_inspect` never returned annotation data.** `opa inspect` was
25
+ invoked without the `--annotations` flag, so `# METADATA` block
26
+ contents were always absent from the output even though the tool's
27
+ output type declared them. The flag is now passed on every call.
28
+
29
+ - **`rego_security_audit` remediation hints were keyed to wrong rule
30
+ titles.** Three entries in `REMEDIATION_HINTS` used names that do not
31
+ match real regal rule titles: `duplicate-definition` (actual:
32
+ `duplicate-rule`), `shadowing-builtin` (actual: `rule-shadows-builtin`),
33
+ and `sprintf-formatting` (actual: `sprintf-arguments-mismatch`). All
34
+ three keys are corrected; affected violations were silently falling
35
+ back to the generic remediation string instead of the specific guidance.
36
+
37
+ ### Tests
38
+
39
+ - Added integration test (`regal-cli.test.ts`) that runs a policy
40
+ containing `constant-condition` and `duplicate-rule` against real
41
+ regal 0.30.0 and asserts both violation titles appear in the output.
42
+ Confirms the `bugs` category produces findings in the installed regal
43
+ version and that every returned violation carries `category: "bugs"`.
44
+
45
+ ## [0.1.3] - 2026-05-18
46
+
47
+ ### Added
48
+
49
+ - **`rego_coverage_gaps` tool.** Runs `opa test --coverage` and returns a
50
+ per-file breakdown of uncovered line ranges, sorted by coverage ascending
51
+ so the worst-covered files appear first. Accepts an optional `threshold`
52
+ to limit output to files below a target coverage percentage. Surfaces
53
+ `testsPassed`, `testsFailed`, `testsSkipped`, and `overallCoverage` in
54
+ the envelope alongside the gap report.
55
+
56
+ - **`rego_security_audit` tool.** Runs regal lint restricted to the
57
+ `security` and `bugs` categories across one or more policy directories.
58
+ Returns findings grouped by severity (high / medium) with per-finding
59
+ remediation guidance. Designed for fleet-wide periodic sweeps rather
60
+ than per-file style review. Requires regal.
61
+
62
+ - **`mcp_server_info` tool.** Returns the server name, version, resolved
63
+ `opa` and `regal` versions, transport type, and Node.js version in a
64
+ single call. Useful for verifying which server instance an agent is
65
+ talking to and confirming binary paths resolved correctly.
66
+
67
+ - **Claude Code install section** in README with the `claude mcp add --env`
68
+ command. Standing-instructions template (`examples/CLAUDE.md`) and
69
+ PostToolUse hook config (`examples/claude-code-hook.json`) for policy
70
+ repos using Claude Code.
71
+
72
+ - **Node 24 added to CI matrix.** Unit tests now run on Node 20, 22, and 24
73
+ across Ubuntu, macOS, and Windows.
74
+
75
+ ### Changed
76
+
77
+ - All em dashes in source comments replaced with `--` (U+002D pairs).
78
+ No behavior change; cosmetic consistency fix.
79
+
20
80
  ## [0.1.2] - 2026-05-18
21
81
 
22
82
  ### Fixed
@@ -157,7 +217,9 @@ wrappers end-to-end. CI matrix: Ubuntu, macOS, and Windows on Node
157
217
  20 and 22, plus CodeQL security scanning and weekly Dependabot updates
158
218
  for npm, GitHub Actions, and Docker base images.
159
219
 
160
- [Unreleased]: https://github.com/OrygnsCode/opa-mcp-server/compare/v0.1.2...HEAD
220
+ [Unreleased]: https://github.com/OrygnsCode/opa-mcp-server/compare/v0.1.4...HEAD
221
+ [0.1.4]: https://github.com/OrygnsCode/opa-mcp-server/compare/v0.1.3...v0.1.4
222
+ [0.1.3]: https://github.com/OrygnsCode/opa-mcp-server/compare/v0.1.2...v0.1.3
161
223
  [0.1.2]: https://github.com/OrygnsCode/opa-mcp-server/releases/tag/v0.1.2
162
224
  [0.1.1]: https://github.com/OrygnsCode/opa-mcp-server/releases/tag/v0.1.1
163
225
  [0.1.0]: https://github.com/OrygnsCode/opa-mcp-server/releases/tag/v0.1.0
package/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![CodeQL](https://github.com/OrygnsCode/opa-mcp-server/actions/workflows/codeql.yml/badge.svg)](https://github.com/OrygnsCode/opa-mcp-server/actions/workflows/codeql.yml)
5
5
  [![npm version](https://img.shields.io/npm/v/@orygn/opa-mcp.svg)](https://www.npmjs.com/package/@orygn/opa-mcp)
6
6
  [![Docker pulls](https://img.shields.io/docker/pulls/orygn/opa-mcp.svg)](https://hub.docker.com/r/orygn/opa-mcp)
7
+ [![OPA Ecosystem](https://img.shields.io/badge/OPA-ecosystem-blue.svg)](https://www.openpolicyagent.org/ecosystem/entry/opa-mcp)
7
8
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](./LICENSE)
8
9
  [![Node.js](https://img.shields.io/node/v/@orygn/opa-mcp.svg)](./package.json)
9
10
 
@@ -17,10 +18,10 @@ environment.
17
18
  +--------------------+ MCP / stdio +-----------------+ spawn / HTTP +------------------+
18
19
  | Claude · Cursor · | ------------> | @orygn/opa-mcp | -------------> | opa · regal · |
19
20
  | VS Code · ... | <------------ | | <------------- | OPA REST API |
20
- +--------------------+ 32 tools +-----------------+ +------------------+
21
+ +--------------------+ 35 tools +-----------------+ +------------------+
21
22
  ```
22
23
 
23
- > **Status:** v0.1.1. Tool surface, error codes, and
24
+ > **Status:** v0.1.4. Tool surface, error codes, and
24
25
  > environment variables follow [SemVer](https://semver.org/) from
25
26
  > v0.1.0 forward.
26
27
 
@@ -100,20 +101,10 @@ recognize the gap this fills.
100
101
  The server runs locally over stdio. Pick the install path that matches
101
102
  your client.
102
103
 
103
- ### Claude Desktop / Claude Code
104
+ ### Claude Desktop
104
105
 
105
- The fastest path is the Smithery one-liner:
106
-
107
- ```bash
108
- npx -y @smithery/cli install @orygn/opa-mcp --client claude
109
- ```
110
-
111
- Or download `opa-mcp.mcpb` from the
112
- [latest release](https://github.com/OrygnsCode/opa-mcp-server/releases/latest)
113
- and double-click it.
114
-
115
- If you prefer to edit `claude_desktop_config.json` by hand, the snippet
116
- lives in [`examples/claude-desktop.json`](./examples/claude-desktop.json):
106
+ Edit `claude_desktop_config.json` directly (or copy from
107
+ [`examples/claude-desktop.json`](./examples/claude-desktop.json)):
117
108
 
118
109
  ```json
119
110
  {
@@ -136,6 +127,47 @@ lives in [`examples/claude-desktop.json`](./examples/claude-desktop.json):
136
127
  > [first-time install gotcha](#-first-time-install-gotcha-read-this-if-you-used-npx-or-the-global-install)
137
128
  > below. Windows users substitute `C:\\path\\to\\opa.exe`.
138
129
 
130
+ Or download `opa-mcp.mcpb` from the
131
+ [latest release](https://github.com/OrygnsCode/opa-mcp-server/releases/latest)
132
+ and double-click it.
133
+
134
+ Alternatively, use the Smithery one-liner:
135
+
136
+ ```bash
137
+ npx -y @smithery/cli install @orygn/opa-mcp --client claude
138
+ ```
139
+
140
+ ### Claude Code (CLI)
141
+
142
+ Register the server for the current project with `claude mcp add`:
143
+
144
+ ```bash
145
+ claude mcp add \
146
+ --env OPA_BINARY=/usr/local/bin/opa \
147
+ --env REGAL_BINARY=/usr/local/bin/regal \
148
+ --env OPA_MCP_ALLOWED_PATHS=/path/to/your/policies \
149
+ opa -- npx -y @orygn/opa-mcp
150
+ ```
151
+
152
+ This writes the config into `.mcp.json` at your project root and is
153
+ picked up automatically on every `claude` session in that directory.
154
+ Add `--scope user` to register it globally instead.
155
+
156
+ > Replace the paths with your real absolute paths (same caveat as
157
+ > Claude Desktop above). On Windows use `C:\path\to\opa.exe` syntax.
158
+
159
+ **Persistent context and auto-checks for policy repos.**
160
+ If you work in an OPA policy repo regularly, two extra files remove
161
+ repetitive setup from every session:
162
+
163
+ - [`examples/CLAUDE.md`](./examples/CLAUDE.md) -- copy to your repo
164
+ root or `.claude/CLAUDE.md`. Claude Code loads it every session,
165
+ so the agent always knows which tools to use and what conventions apply.
166
+ - [`examples/claude-code-hook.json`](./examples/claude-code-hook.json) --
167
+ merge the `hooks` block into `.claude/settings.json`. Runs `opa check`
168
+ automatically after any `.rego` file is written, so syntax errors
169
+ surface immediately without a manual tool call.
170
+
139
171
  ### Cursor
140
172
 
141
173
  Drop [`examples/cursor.json`](./examples/cursor.json) into either
@@ -369,6 +401,14 @@ the tasks agents are actually asked to do.
369
401
  | `rego_generate_test_skeleton` | Given a policy, generate a `_test.rego` skeleton covering each rule. |
370
402
  | `rego_describe_policy` | Summarize what a policy does, its inputs, decisions, and assumptions. |
371
403
  | `rego_suggest_fix` | For a failed `rego_check` or `rego_lint`, propose minimal patches. |
404
+ | `rego_coverage_gaps` | Run `opa test --coverage` and return per-file uncovered line ranges, sorted worst first. Use `threshold` to focus on files below a target percentage. |
405
+ | `rego_security_audit` | Run regal lint restricted to `security` and `bugs` categories across a directory. Returns severity-grouped findings with remediation guidance. |
406
+
407
+ ### Category F: Meta
408
+
409
+ | Tool | What it does |
410
+ | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
411
+ | `mcp_server_info` | Return server name, version, resolved `opa`/`regal` versions, transport type, and Node.js version in one call. Useful for verifying which server instance the agent is connected to. |
372
412
 
373
413
  ## Prompts
374
414
 
@@ -452,7 +492,8 @@ Agent: Done. Policy `rbac` is live on staging at $OPA_URL.
452
492
  │ ├── tools/evaluation/ ─┤ │
453
493
  │ ├── tools/bundles/ ─┼─── lib/opa-cli.ts ──┐ │
454
494
  │ ├── tools/server-management/ ─┤ │ │
455
- │ ├── tools/helpers/ ─┘ │ │
495
+ │ ├── tools/helpers/ ─┤ │ │
496
+ │ ├── tools/meta/ ─┘ │ │
456
497
  │ │ ▼ │
457
498
  │ │ lib/subprocess.ts ──┴── opa │
458
499
  │ │ lib/regal-cli.ts ───── regal│
@@ -554,11 +595,10 @@ upgrade Regal: `brew upgrade regal` or download from the
554
595
 
555
596
  **`directory-package-mismatch` violation when linting inline source.**
556
597
 
557
- When you pass `source` rather than `paths` to `rego_lint`, Regal sees a
558
- randomized temp-file path that can't possibly match your declared package
559
- path. The diagnostic is an artifact of inline linting, not a real issue.
560
- Disable the rule for inline workflows or lint via `paths` against the
561
- real on-disk file when you want canonical signal.
598
+ Since v0.1.1, the server auto-disables this rule for inline-source calls.
599
+ If you see it, you are running an older version -- upgrade to v0.1.1 or
600
+ later. To get canonical signal on this rule, lint via `paths` against the
601
+ real on-disk file instead of passing `source` directly.
562
602
 
563
603
  **Where are the logs?**
564
604
 
@@ -588,8 +628,8 @@ npm run build # compile to dist/
588
628
  ```
589
629
 
590
630
  CI runs lint, typecheck, build, and unit tests on every push and PR
591
- across Ubuntu, macOS, and Windows on Node 20 and 22. Integration tests
592
- run on Linux against pinned `opa` and `regal` releases.
631
+ across Ubuntu, macOS, and Windows on Node 20, 22, and 24. Integration
632
+ tests run on Linux against pinned `opa` and `regal` releases.
593
633
 
594
634
  For the full contributor workflow (adding tools, naming conventions,
595
635
  logging discipline, release process), see [CONTRIBUTING.md](./CONTRIBUTING.md).
@@ -621,3 +661,5 @@ endorsed by, or sponsored by the Open Policy Agent project, the Cloud
621
661
  Native Computing Foundation, Styra, or Anthropic. "Open Policy Agent"
622
662
  and "Rego" are trademarks of their respective owners. "Model Context
623
663
  Protocol" is a trademark of Anthropic, PBC.
664
+
665
+ Listed in the [OPA Ecosystem](https://www.openpolicyagent.org/ecosystem/entry/opa-mcp).
package/dist/config.d.ts CHANGED
@@ -15,7 +15,7 @@ declare const ConfigSchema: z.ZodObject<{
15
15
  /**
16
16
  * Allow-listed root directories for file path inputs. Tools that accept
17
17
  * filesystem paths reject anything outside these roots. Empty by
18
- * default file-based tools refuse to read from disk until the
18
+ * default -- file-based tools refuse to read from disk until the
19
19
  * operator explicitly opts in via `OPA_MCP_ALLOWED_PATHS`.
20
20
  */
21
21
  allowedPaths: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
package/dist/config.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Centralized configuration loaded from environment variables.
3
3
  *
4
- * Environment variables are the only configuration surface there is no
4
+ * Environment variables are the only configuration surface -- there is no
5
5
  * config file, no flags. This matches how MCP clients (Claude Desktop,
6
6
  * Cursor, VS Code) pass config via the `env` object in their JSON.
7
7
  */
@@ -24,7 +24,7 @@ const ConfigSchema = z.object({
24
24
  /**
25
25
  * Allow-listed root directories for file path inputs. Tools that accept
26
26
  * filesystem paths reject anything outside these roots. Empty by
27
- * default file-based tools refuse to read from disk until the
27
+ * default -- file-based tools refuse to read from disk until the
28
28
  * operator explicitly opts in via `OPA_MCP_ALLOWED_PATHS`.
29
29
  */
30
30
  allowedPaths: z.array(z.string()).default([]),
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Server identity constants shared between the entry point and the
3
+ * mcp_server_info tool. Defined here to avoid a circular import
4
+ * (server.ts -> tools -> meta -> server.ts).
5
+ */
6
+ export declare const SERVER_NAME = "orygn-opa-mcp";
7
+ export declare const SERVER_VERSION = "0.1.3";
8
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,WAAW,kBAAkB,CAAC;AAC3C,eAAO,MAAM,cAAc,UAAU,CAAC"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Server identity constants shared between the entry point and the
3
+ * mcp_server_info tool. Defined here to avoid a circular import
4
+ * (server.ts -> tools -> meta -> server.ts).
5
+ */
6
+ export const SERVER_NAME = 'orygn-opa-mcp';
7
+ export const SERVER_VERSION = '0.1.3';
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,eAAe,CAAC;AAC3C,MAAM,CAAC,MAAM,cAAc,GAAG,OAAO,CAAC"}
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helpers for building structured tool errors.
3
3
  *
4
- * Tools should never throw raw exceptions to the MCP layer every failure
4
+ * Tools should never throw raw exceptions to the MCP layer -- every failure
5
5
  * mode returns a `ToolEnvelope` with `ok: false` and a structured `error`.
6
6
  */
7
7
  import type { ToolEnvelope, ToolErrorCode } from '../types.js';
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * File-only logger.
3
3
  *
4
- * Stdout is reserved for MCP protocol traffic writing anywhere else
4
+ * Stdout is reserved for MCP protocol traffic -- writing anywhere else
5
5
  * would corrupt the JSON-RPC stream. This logger appends to a file with
6
6
  * level filtering, and never touches stdout.
7
7
  *
@@ -37,7 +37,7 @@ function write(level, msg, ctx) {
37
37
  }
38
38
  catch {
39
39
  // Logging must never throw. If the log file is unreachable, drop the
40
- // line silently better than crashing the server.
40
+ // line silently -- better than crashing the server.
41
41
  }
42
42
  }
43
43
  export const logger = {
@@ -1 +1 @@
1
- {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAIzC,MAAM,cAAc,GAA0B;IAC5C,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,IAAI,EAAE,EAAE;IACR,KAAK,EAAE,EAAE;CACV,CAA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pB,KAAK,EAAE,CAAC,GAAW,EAAE,GAA6B,EAAQ,EAAE;QAC1D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,EAAE,CAAC,GAAW,EAAE,GAA6B,EAAQ,EAAE;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,IAAI,EAAE,CAAC,GAAW,EAAE,GAA6B,EAAQ,EAAE;QACzD,KAAK,CAAC,MAAM,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC1B,CAAC;IACD,KAAK,EAAE,CAAC,GAAW,EAAE,GAA6B,EAAQ,EAAE;QAC1D,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;IAC3B,CAAC;CACF,CAAC"}
@@ -138,7 +138,7 @@ export interface SignInput {
138
138
  /**
139
139
  * Wrapper around the local `opa` binary.
140
140
  *
141
- * Methods do not throw on `opa` errors non-zero exit codes are
141
+ * Methods do not throw on `opa` errors -- non-zero exit codes are
142
142
  * surfaced on the returned `SpawnResult` so tools can map them to
143
143
  * structured error envelopes at their layer. They DO throw on
144
144
  * caller-side bugs (e.g. an empty `paths` array passed where one is
@@ -154,7 +154,7 @@ export declare class OpaCli {
154
154
  version(): Promise<string | null>;
155
155
  /**
156
156
  * Format Rego source. Stdout contains the formatted output. Reports
157
- * `exitCode: 0` even when no changes are needed callers compare
157
+ * `exitCode: 0` even when no changes are needed -- callers compare
158
158
  * input vs output to detect a no-op.
159
159
  */
160
160
  fmt(input: FmtInput): Promise<SpawnResult>;
@@ -162,7 +162,7 @@ export declare class OpaCli {
162
162
  * Type-check Rego. Returns `exitCode: 0` and empty `stdout` when the
163
163
  * policy is valid. On failure, `exitCode` is non-zero and the JSON
164
164
  * error report is written to **stderr** (this is OPA's actual
165
- * behavior tools must read `stderr`, not `stdout`, for `check`
165
+ * behavior -- tools must read `stderr`, not `stdout`, for `check`
166
166
  * diagnostics). Either inline `source` or one or more `paths` must be
167
167
  * provided.
168
168
  */
@@ -10,7 +10,7 @@
10
10
  * The `-` (read-from-stdin) convention some opa subcommands document is
11
11
  * unreliable on Windows, where `-` is treated as a literal filename.
12
12
  *
13
- * The methods do not parse stdout into typed result objects different
13
+ * The methods do not parse stdout into typed result objects -- different
14
14
  * tools need different shapes of the same output and a one-size parser
15
15
  * would force conversions both ways. Stdout is JSON whenever
16
16
  * `--format=json` is set, and tools call `JSON.parse` on it themselves.
@@ -23,7 +23,7 @@ import { runBinary } from './subprocess.js';
23
23
  /**
24
24
  * Wrapper around the local `opa` binary.
25
25
  *
26
- * Methods do not throw on `opa` errors non-zero exit codes are
26
+ * Methods do not throw on `opa` errors -- non-zero exit codes are
27
27
  * surfaced on the returned `SpawnResult` so tools can map them to
28
28
  * structured error envelopes at their layer. They DO throw on
29
29
  * caller-side bugs (e.g. an empty `paths` array passed where one is
@@ -48,7 +48,7 @@ export class OpaCli {
48
48
  // ─── Authoring ───────────────────────────────────────────────────────
49
49
  /**
50
50
  * Format Rego source. Stdout contains the formatted output. Reports
51
- * `exitCode: 0` even when no changes are needed callers compare
51
+ * `exitCode: 0` even when no changes are needed -- callers compare
52
52
  * input vs output to detect a no-op.
53
53
  */
54
54
  async fmt(input) {
@@ -58,7 +58,7 @@ export class OpaCli {
58
58
  * Type-check Rego. Returns `exitCode: 0` and empty `stdout` when the
59
59
  * policy is valid. On failure, `exitCode` is non-zero and the JSON
60
60
  * error report is written to **stderr** (this is OPA's actual
61
- * behavior tools must read `stderr`, not `stdout`, for `check`
61
+ * behavior -- tools must read `stderr`, not `stdout`, for `check`
62
62
  * diagnostics). Either inline `source` or one or more `paths` must be
63
63
  * provided.
64
64
  */
@@ -90,7 +90,7 @@ export class OpaCli {
90
90
  * packages, namespaces, manifest, and annotations as JSON on stdout.
91
91
  */
92
92
  async inspect(input) {
93
- return this.run(['inspect', '--format=json', input.target]);
93
+ return this.run(['inspect', '--format=json', '--annotations', input.target]);
94
94
  }
95
95
  /**
96
96
  * Print available capabilities. With `current=true`, prints the
@@ -1 +1 @@
1
- {"version":3,"file":"opa-cli.js","sourceRoot":"","sources":["../../src/lib/opa-cli.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAGjC,OAAO,EAAE,SAAS,EAAoB,MAAM,iBAAiB,CAAC;AAoJ9D;;;;;;;;GAQG;AACH,MAAM,OAAO,MAAM;IACY;IAA7B,YAA6B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;IAE/C;;;OAGG;IACH,KAAK,CAAC,OAAO;QACX,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;QAC3C,IAAI,MAAM,CAAC,QAAQ,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QACvC,MAAM,KAAK,GAAG,mBAAmB,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACtD,OAAO,KAAK,EAAE,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC;IAC5B,CAAC;IAED,wEAAwE;IAExE;;;;OAIG;IACH,KAAK,CAAC,GAAG,CAAC,KAAe;QACvB,OAAO,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,CAAC,KAAiB;QAC3B,IAAI,CAAC,KAAK,CAAC,MAAM,IAAI,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;QAC9E,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,EAAE,EAAE,iBAAiB,UAAU,EAAE,OAAO,CAAC,CAAC;QAClE,MAAM,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC;QACtC,IAAI,CAAC;YACH,OAAO,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC;QACxB,CAAC;gBAAS,CAAC;YACT,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;QAClC,CAAC;IACH,CAAC;CACF"}
@@ -29,7 +29,7 @@ export interface RequestOptions {
29
29
  body?: unknown;
30
30
  /**
31
31
  * Raw string body sent verbatim. Used for endpoints that accept
32
- * non-JSON content notably `PUT /v1/policies/{id}` which expects
32
+ * non-JSON content -- notably `PUT /v1/policies/{id}` which expects
33
33
  * Rego source as `text/plain`.
34
34
  */
35
35
  rawBody?: string;
@@ -39,7 +39,7 @@ export interface LintInput {
39
39
  /**
40
40
  * Wrapper around the local `regal` binary.
41
41
  *
42
- * Like `OpaCli`, methods do not throw on Regal-side errors the exit
42
+ * Like `OpaCli`, methods do not throw on Regal-side errors -- the exit
43
43
  * code on the returned `SpawnResult` is the signal. Inline source is
44
44
  * always written to a temp file because `regal lint` does not read
45
45
  * from stdin.
@@ -58,9 +58,9 @@ export declare class RegalCli {
58
58
  * provided.
59
59
  *
60
60
  * Regal's exit codes:
61
- * - 0 no findings at or above `failLevel`
62
- * - 3 findings present
63
- * - non-zero other Regal-internal failure (config error, etc.)
61
+ * - 0 -- no findings at or above `failLevel`
62
+ * - 3 -- findings present
63
+ * - non-zero other -- Regal-internal failure (config error, etc.)
64
64
  *
65
65
  * When called with inline `source`, location-bound rules whose
66
66
  * verdict depends on the on-disk path (currently
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Wrapper around the optional `regal` binary (Rego linter, by Styra).
3
3
  *
4
- * Regal is OPTIONAL only the `rego_lint` tool requires it. Other
4
+ * Regal is OPTIONAL -- only the `rego_lint` tool requires it. Other
5
5
  * tools work without Regal installed. If absent, `rego_lint` returns a
6
6
  * structured `REGAL_NOT_FOUND` error with an install hint.
7
7
  */
@@ -21,7 +21,7 @@ export const INLINE_SOURCE_FALSE_POSITIVE_RULES = ['directory-package-mismatch']
21
21
  /**
22
22
  * Wrapper around the local `regal` binary.
23
23
  *
24
- * Like `OpaCli`, methods do not throw on Regal-side errors the exit
24
+ * Like `OpaCli`, methods do not throw on Regal-side errors -- the exit
25
25
  * code on the returned `SpawnResult` is the signal. Inline source is
26
26
  * always written to a temp file because `regal lint` does not read
27
27
  * from stdin.
@@ -48,9 +48,9 @@ export class RegalCli {
48
48
  * provided.
49
49
  *
50
50
  * Regal's exit codes:
51
- * - 0 no findings at or above `failLevel`
52
- * - 3 findings present
53
- * - non-zero other Regal-internal failure (config error, etc.)
51
+ * - 0 -- no findings at or above `failLevel`
52
+ * - 3 -- findings present
53
+ * - non-zero other -- Regal-internal failure (config error, etc.)
54
54
  *
55
55
  * When called with inline `source`, location-bound rules whose
56
56
  * verdict depends on the on-disk path (currently
@@ -19,7 +19,7 @@ export interface SpawnResult {
19
19
  durationMs: number;
20
20
  }
21
21
  /**
22
- * Run a binary and return its captured output. Never throws failures
22
+ * Run a binary and return its captured output. Never throws -- failures
23
23
  * are reflected in `exitCode` / `timedOut`.
24
24
  */
25
25
  export declare function runBinary(binary: string, opts: SpawnOptions): Promise<SpawnResult>;
@@ -1,14 +1,14 @@
1
1
  /**
2
2
  * Subprocess wrapper used by `opa-cli.ts` and `regal-cli.ts`.
3
3
  *
4
- * - Uses argv arrays only (never shell strings) prevents injection.
4
+ * - Uses argv arrays only (never shell strings) -- prevents injection.
5
5
  * - Hard timeout per invocation, defaulting to config.subprocessTimeoutMs.
6
6
  * - Captures stdout / stderr / exit code separately.
7
7
  * - Optional stdin payload for piping source code.
8
8
  */
9
9
  import { spawn } from 'node:child_process';
10
10
  /**
11
- * Run a binary and return its captured output. Never throws failures
11
+ * Run a binary and return its captured output. Never throws -- failures
12
12
  * are reflected in `exitCode` / `timedOut`.
13
13
  */
14
14
  export async function runBinary(binary, opts) {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * Helpers shared across tool implementations.
3
3
  *
4
- * Each tool follows the same shape validate input, call into a CLI
4
+ * Each tool follows the same shape -- validate input, call into a CLI
5
5
  * wrapper or HTTP client, map errors to a structured envelope, return
6
6
  * the formatted MCP result. The pieces here factor out the parts every
7
7
  * tool repeats so each tool file can stay focused on its own logic.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * MCP Prompts slash-command-like workflow templates.
2
+ * MCP Prompts -- slash-command-like workflow templates.
3
3
  *
4
4
  * Each prompt is a stateless instruction set the agent receives when
5
5
  * the user invokes it. They orient the agent toward a specific
@@ -64,7 +64,7 @@ Return a concise review with: pass/fail per item, recommended diffs.`;
64
64
  const decisionDebuggingWorkflowPrompt = (args) => {
65
65
  return `You are debugging an unexpected Rego decision.
66
66
 
67
- Query: ${args.query ?? '<not provided ask the user>'}
67
+ Query: ${args.query ?? '<not provided -- ask the user>'}
68
68
  User's expectation: ${args.expectation ?? '<ask the user what they expected>'}
69
69
 
70
70
  Workflow:
@@ -77,13 +77,13 @@ Workflow:
77
77
  3. Re-run with \`rego_explain_decision\` to get a structured trace.
78
78
  Identify which rules were evaluated and which fired.
79
79
  4. The cause is one of:
80
- a. **Input mismatch** the policy expected a different input shape.
80
+ a. **Input mismatch** -- the policy expected a different input shape.
81
81
  Use \`rego_describe_policy\` to list the refs the policy reads
82
82
  and confirm each is present in the input.
83
- b. **Rule logic** a guard fired or didn't fire when it should
83
+ b. **Rule logic** -- a guard fired or didn't fire when it should
84
84
  have. Read the trace and explain which rule's body evaluated to
85
85
  true/false and why.
86
- c. **Default decision** no rule produced a value, so the default
86
+ c. **Default decision** -- no rule produced a value, so the default
87
87
  kicked in.
88
88
  5. Propose the smallest fix: either an input correction or a policy
89
89
  change. If a policy change, run \`rego_check\` and \`rego_test\` on the
@@ -115,7 +115,7 @@ export function registerPrompts(server, _config) {
115
115
  source: z
116
116
  .string()
117
117
  .optional()
118
- .describe('Rego source to review. Optional agent can ask for it.'),
118
+ .describe('Rego source to review. Optional -- agent can ask for it.'),
119
119
  },
120
120
  }, (args) => ({
121
121
  messages: [
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/prompts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,MAAM,8BAA8B,GAAG,CAAC,IAGvC,EAAU,EAAE;IACX,MAAM,WAAW,GAAG,IAAI,CAAC,WAAW,IAAI,gBAAgB,CAAC;IACzD,MAAM,WAAW,GAAG,IAAI,CAAC,YAAY,IAAI,gCAAgC,CAAC;IAC1E,OAAO;;;;;EAKP,WAAW;;qBAEQ,WAAW;;;;;;;;;;;;;;;gDAegB,CAAC;AACjD,CAAC,CAAC;AAEF,MAAM,2BAA2B,GAAG,CAAC,IAAyB,EAAU,EAAE;IACxE,OAAO;;;EAGP,IAAI,CAAC,MAAM,IAAI,8CAA8C;;;;;;;;;;;;;;;;;;;;;qEAqBM,CAAC;AACtE,CAAC,CAAC;AAEF,MAAM,+BAA+B,GAAG,CAAC,IAGxC,EAAU,EAAE;IACX,OAAO;;SAEA,IAAI,CAAC,KAAK,IAAI,+BAA+B;sBAChC,IAAI,CAAC,WAAW,IAAI,mCAAmC;;;;;;;;;;;;;;;;;;;;;;;;;2CAyBlC,CAAC;AAC5C,CAAC,CAAC;AAEF,MAAM,UAAU,eAAe,CAAC,MAAiB,EAAE,OAAe;IAChE,MAAM,CAAC,cAAc,CACnB,4BAA4B,EAC5B;QACE,KAAK,EAAE,4BAA4B;QACnC,WAAW,EACT,uHAAuH;QACzH,UAAU,EAAE;YACV,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;YAChF,YAAY,EAAE,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,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,8BAA8B,CAAC,IAAI,CAAC,EAAE;aACtE;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,yBAAyB,EACzB;QACE,KAAK,EAAE,yBAAyB;QAChC,WAAW,EACT,wHAAwH;QAC1H,UAAU,EAAE;YACV,MAAM,EAAE,CAAC;iBACN,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,0DAA0D,CAAC;SACxE;KACF,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,2BAA2B,CAAC,IAAI,CAAC,EAAE;aACnE;SACF;KACF,CAAC,CACH,CAAC;IAEF,MAAM,CAAC,cAAc,CACnB,6BAA6B,EAC7B;QACE,KAAK,EAAE,6BAA6B;QACpC,WAAW,EACT,2IAA2I;QAC7I,UAAU,EAAE;YACV,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,QAAQ,EAAE;iBACV,QAAQ,CAAC,qDAAqD,CAAC;YAClE,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,mCAAmC,CAAC;SACjF;KACF,EACD,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QACT,QAAQ,EAAE;YACR;gBACE,IAAI,EAAE,MAAM;gBACZ,OAAO,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,+BAA+B,CAAC,IAAI,CAAC,EAAE;aACvE;SACF;KACF,CAAC,CACH,CAAC;AACJ,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /**
2
- * MCP Resources read-only references the agent can fetch by URI.
2
+ * MCP Resources -- read-only references the agent can fetch by URI.
3
3
  *
4
- * - opa://builtins derived at read-time from `opa capabilities`.
5
- * - opa://style-guide curated Rego style guide content.
6
- * - opa://patterns pattern library: RBAC, ABAC, K8s admission,
4
+ * - opa://builtins -- derived at read-time from `opa capabilities`.
5
+ * - opa://style-guide -- curated Rego style guide content.
6
+ * - opa://patterns -- pattern library: RBAC, ABAC, K8s admission,
7
7
  * IaC gates, API authz, rate limiting.
8
8
  */
9
9
  import type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';