@orygn/opa-mcp 0.0.0 → 0.1.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 (184) hide show
  1. package/CHANGELOG.md +150 -0
  2. package/LICENSE +21 -0
  3. package/README.md +622 -2
  4. package/dist/config.d.ts +58 -0
  5. package/dist/config.d.ts.map +1 -0
  6. package/dist/config.js +72 -0
  7. package/dist/config.js.map +1 -0
  8. package/dist/lib/errors.d.ts +18 -0
  9. package/dist/lib/errors.d.ts.map +1 -0
  10. package/dist/lib/errors.js +25 -0
  11. package/dist/lib/errors.js.map +1 -0
  12. package/dist/lib/logger.d.ts +10 -0
  13. package/dist/lib/logger.d.ts.map +1 -0
  14. package/dist/lib/logger.js +57 -0
  15. package/dist/lib/logger.js.map +1 -0
  16. package/dist/lib/opa-cli.d.ts +226 -0
  17. package/dist/lib/opa-cli.d.ts.map +1 -0
  18. package/dist/lib/opa-cli.js +283 -0
  19. package/dist/lib/opa-cli.js.map +1 -0
  20. package/dist/lib/opa-client.d.ts +47 -0
  21. package/dist/lib/opa-client.d.ts.map +1 -0
  22. package/dist/lib/opa-client.js +101 -0
  23. package/dist/lib/opa-client.js.map +1 -0
  24. package/dist/lib/output.d.ts +17 -0
  25. package/dist/lib/output.d.ts.map +1 -0
  26. package/dist/lib/output.js +21 -0
  27. package/dist/lib/output.js.map +1 -0
  28. package/dist/lib/regal-cli.d.ts +79 -0
  29. package/dist/lib/regal-cli.d.ts.map +1 -0
  30. package/dist/lib/regal-cli.js +122 -0
  31. package/dist/lib/regal-cli.js.map +1 -0
  32. package/dist/lib/security.d.ts +16 -0
  33. package/dist/lib/security.d.ts.map +1 -0
  34. package/dist/lib/security.js +64 -0
  35. package/dist/lib/security.js.map +1 -0
  36. package/dist/lib/subprocess.d.ts +26 -0
  37. package/dist/lib/subprocess.d.ts.map +1 -0
  38. package/dist/lib/subprocess.js +72 -0
  39. package/dist/lib/subprocess.js.map +1 -0
  40. package/dist/lib/tool-helpers.d.ts +46 -0
  41. package/dist/lib/tool-helpers.d.ts.map +1 -0
  42. package/dist/lib/tool-helpers.js +73 -0
  43. package/dist/lib/tool-helpers.js.map +1 -0
  44. package/dist/prompts/index.d.ts +4 -0
  45. package/dist/prompts/index.d.ts.map +1 -0
  46. package/dist/prompts/index.js +147 -0
  47. package/dist/prompts/index.js.map +1 -0
  48. package/dist/resources/index.d.ts +12 -0
  49. package/dist/resources/index.d.ts.map +1 -0
  50. package/dist/resources/index.js +107 -0
  51. package/dist/resources/index.js.map +1 -0
  52. package/dist/resources/patterns.d.ts +9 -0
  53. package/dist/resources/patterns.d.ts.map +1 -0
  54. package/dist/resources/patterns.js +375 -0
  55. package/dist/resources/patterns.js.map +1 -0
  56. package/dist/resources/style-guide.d.ts +6 -0
  57. package/dist/resources/style-guide.d.ts.map +1 -0
  58. package/dist/resources/style-guide.js +187 -0
  59. package/dist/resources/style-guide.js.map +1 -0
  60. package/dist/server.d.ts +34 -0
  61. package/dist/server.d.ts.map +1 -0
  62. package/dist/server.js +125 -0
  63. package/dist/server.js.map +1 -0
  64. package/dist/tools/authoring/capabilities.d.ts +11 -0
  65. package/dist/tools/authoring/capabilities.d.ts.map +1 -0
  66. package/dist/tools/authoring/capabilities.js +57 -0
  67. package/dist/tools/authoring/capabilities.js.map +1 -0
  68. package/dist/tools/authoring/check.d.ts +18 -0
  69. package/dist/tools/authoring/check.d.ts.map +1 -0
  70. package/dist/tools/authoring/check.js +71 -0
  71. package/dist/tools/authoring/check.js.map +1 -0
  72. package/dist/tools/authoring/deps.d.ts +8 -0
  73. package/dist/tools/authoring/deps.d.ts.map +1 -0
  74. package/dist/tools/authoring/deps.js +51 -0
  75. package/dist/tools/authoring/deps.js.map +1 -0
  76. package/dist/tools/authoring/format.d.ts +8 -0
  77. package/dist/tools/authoring/format.d.ts.map +1 -0
  78. package/dist/tools/authoring/format.js +44 -0
  79. package/dist/tools/authoring/format.js.map +1 -0
  80. package/dist/tools/authoring/index.d.ts +11 -0
  81. package/dist/tools/authoring/index.d.ts.map +1 -0
  82. package/dist/tools/authoring/index.js +17 -0
  83. package/dist/tools/authoring/index.js.map +1 -0
  84. package/dist/tools/authoring/inspect.d.ts +10 -0
  85. package/dist/tools/authoring/inspect.d.ts.map +1 -0
  86. package/dist/tools/authoring/inspect.js +47 -0
  87. package/dist/tools/authoring/inspect.js.map +1 -0
  88. package/dist/tools/authoring/lint.d.ts +18 -0
  89. package/dist/tools/authoring/lint.d.ts.map +1 -0
  90. package/dist/tools/authoring/lint.js +111 -0
  91. package/dist/tools/authoring/lint.js.map +1 -0
  92. package/dist/tools/authoring/parse.d.ts +7 -0
  93. package/dist/tools/authoring/parse.d.ts.map +1 -0
  94. package/dist/tools/authoring/parse.js +43 -0
  95. package/dist/tools/authoring/parse.js.map +1 -0
  96. package/dist/tools/bundles/build.d.ts +8 -0
  97. package/dist/tools/bundles/build.d.ts.map +1 -0
  98. package/dist/tools/bundles/build.js +87 -0
  99. package/dist/tools/bundles/build.js.map +1 -0
  100. package/dist/tools/bundles/index.d.ts +10 -0
  101. package/dist/tools/bundles/index.d.ts.map +1 -0
  102. package/dist/tools/bundles/index.js +7 -0
  103. package/dist/tools/bundles/index.js.map +1 -0
  104. package/dist/tools/bundles/sign.d.ts +8 -0
  105. package/dist/tools/bundles/sign.d.ts.map +1 -0
  106. package/dist/tools/bundles/sign.js +47 -0
  107. package/dist/tools/bundles/sign.js.map +1 -0
  108. package/dist/tools/evaluation/_shared.d.ts +55 -0
  109. package/dist/tools/evaluation/_shared.d.ts.map +1 -0
  110. package/dist/tools/evaluation/_shared.js +102 -0
  111. package/dist/tools/evaluation/_shared.js.map +1 -0
  112. package/dist/tools/evaluation/bench.d.ts +9 -0
  113. package/dist/tools/evaluation/bench.d.ts.map +1 -0
  114. package/dist/tools/evaluation/bench.js +76 -0
  115. package/dist/tools/evaluation/bench.js.map +1 -0
  116. package/dist/tools/evaluation/compile.d.ts +11 -0
  117. package/dist/tools/evaluation/compile.d.ts.map +1 -0
  118. package/dist/tools/evaluation/compile.js +19 -0
  119. package/dist/tools/evaluation/compile.js.map +1 -0
  120. package/dist/tools/evaluation/eval.d.ts +10 -0
  121. package/dist/tools/evaluation/eval.d.ts.map +1 -0
  122. package/dist/tools/evaluation/eval.js +35 -0
  123. package/dist/tools/evaluation/eval.js.map +1 -0
  124. package/dist/tools/evaluation/index.d.ts +11 -0
  125. package/dist/tools/evaluation/index.d.ts.map +1 -0
  126. package/dist/tools/evaluation/index.js +11 -0
  127. package/dist/tools/evaluation/index.js.map +1 -0
  128. package/dist/tools/evaluation/test.d.ts +28 -0
  129. package/dist/tools/evaluation/test.d.ts.map +1 -0
  130. package/dist/tools/evaluation/test.js +74 -0
  131. package/dist/tools/evaluation/test.js.map +1 -0
  132. package/dist/tools/helpers/describe-policy.d.ts +26 -0
  133. package/dist/tools/helpers/describe-policy.d.ts.map +1 -0
  134. package/dist/tools/helpers/describe-policy.js +76 -0
  135. package/dist/tools/helpers/describe-policy.js.map +1 -0
  136. package/dist/tools/helpers/explain-decision.d.ts +41 -0
  137. package/dist/tools/helpers/explain-decision.d.ts.map +1 -0
  138. package/dist/tools/helpers/explain-decision.js +75 -0
  139. package/dist/tools/helpers/explain-decision.js.map +1 -0
  140. package/dist/tools/helpers/generate-test-skeleton.d.ts +8 -0
  141. package/dist/tools/helpers/generate-test-skeleton.d.ts.map +1 -0
  142. package/dist/tools/helpers/generate-test-skeleton.js +93 -0
  143. package/dist/tools/helpers/generate-test-skeleton.js.map +1 -0
  144. package/dist/tools/helpers/index.d.ts +12 -0
  145. package/dist/tools/helpers/index.d.ts.map +1 -0
  146. package/dist/tools/helpers/index.js +11 -0
  147. package/dist/tools/helpers/index.js.map +1 -0
  148. package/dist/tools/helpers/suggest-fix.d.ts +15 -0
  149. package/dist/tools/helpers/suggest-fix.d.ts.map +1 -0
  150. package/dist/tools/helpers/suggest-fix.js +119 -0
  151. package/dist/tools/helpers/suggest-fix.js.map +1 -0
  152. package/dist/tools/index.d.ts +31 -0
  153. package/dist/tools/index.d.ts.map +1 -0
  154. package/dist/tools/index.js +13 -0
  155. package/dist/tools/index.js.map +1 -0
  156. package/dist/tools/server-management/_shared.d.ts +9 -0
  157. package/dist/tools/server-management/_shared.d.ts.map +1 -0
  158. package/dist/tools/server-management/_shared.js +41 -0
  159. package/dist/tools/server-management/_shared.js.map +1 -0
  160. package/dist/tools/server-management/data.d.ts +4 -0
  161. package/dist/tools/server-management/data.d.ts.map +1 -0
  162. package/dist/tools/server-management/data.js +90 -0
  163. package/dist/tools/server-management/data.js.map +1 -0
  164. package/dist/tools/server-management/decisions.d.ts +4 -0
  165. package/dist/tools/server-management/decisions.d.ts.map +1 -0
  166. package/dist/tools/server-management/decisions.js +87 -0
  167. package/dist/tools/server-management/decisions.js.map +1 -0
  168. package/dist/tools/server-management/index.d.ts +11 -0
  169. package/dist/tools/server-management/index.d.ts.map +1 -0
  170. package/dist/tools/server-management/index.js +11 -0
  171. package/dist/tools/server-management/index.js.map +1 -0
  172. package/dist/tools/server-management/policies.d.ts +4 -0
  173. package/dist/tools/server-management/policies.d.ts.map +1 -0
  174. package/dist/tools/server-management/policies.js +94 -0
  175. package/dist/tools/server-management/policies.js.map +1 -0
  176. package/dist/tools/server-management/status.d.ts +4 -0
  177. package/dist/tools/server-management/status.d.ts.map +1 -0
  178. package/dist/tools/server-management/status.js +82 -0
  179. package/dist/tools/server-management/status.js.map +1 -0
  180. package/dist/types.d.ts +24 -0
  181. package/dist/types.d.ts.map +1 -0
  182. package/dist/types.js +5 -0
  183. package/dist/types.js.map +1 -0
  184. package/package.json +86 -4
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,QAAA,MAAM,YAAY;IAChB,wEAAwE;;IAGxE,2EAA2E;;IAG3E,2DAA2D;;IAG3D,+DAA+D;;IAG/D,kEAAkE;;IAGlE,mDAAmD;;IAGnD;;;;;OAKG;;IAGH,uEAAuE;;IAGvE,qCAAqC;;IAGrC;;;;OAIG;;;;;;;;;;;;;;;;;;;;;;;;EAEH,CAAC;AAEH,MAAM,MAAM,MAAM,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,YAAY,CAAC,CAAC;AAWlD,wBAAgB,UAAU,IAAI,MAAM,CAuBnC"}
package/dist/config.js ADDED
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Centralized configuration loaded from environment variables.
3
+ *
4
+ * Environment variables are the only configuration surface — there is no
5
+ * config file, no flags. This matches how MCP clients (Claude Desktop,
6
+ * Cursor, VS Code) pass config via the `env` object in their JSON.
7
+ */
8
+ import { tmpdir } from 'node:os';
9
+ import { join } from 'node:path';
10
+ import { z } from 'zod';
11
+ const ConfigSchema = z.object({
12
+ /** Base URL of a running OPA server (used by `opa_*` runtime tools). */
13
+ opaUrl: z.string().url().default('http://localhost:8181'),
14
+ /** Optional bearer token for OPA running with `--authentication=token`. */
15
+ opaToken: z.string().optional(),
16
+ /** Path to the `opa` binary. Defaults to `opa` on PATH. */
17
+ opaBinary: z.string().default('opa'),
18
+ /** Path to the `regal` binary. Defaults to `regal` on PATH. */
19
+ regalBinary: z.string().default('regal'),
20
+ /** Hard timeout in ms for any spawned subprocess (opa, regal). */
21
+ subprocessTimeoutMs: z.coerce.number().int().positive().default(30_000),
22
+ /** HTTP request timeout for OPA REST API calls. */
23
+ httpTimeoutMs: z.coerce.number().int().positive().default(15_000),
24
+ /**
25
+ * Allow-listed root directories for file path inputs. Tools that accept
26
+ * filesystem paths reject anything outside these roots. Empty by
27
+ * default — file-based tools refuse to read from disk until the
28
+ * operator explicitly opts in via `OPA_MCP_ALLOWED_PATHS`.
29
+ */
30
+ allowedPaths: z.array(z.string()).default([]),
31
+ /** Path to the log file. Defaults to OS tmpdir + orygn-opa-mcp.log. */
32
+ logFile: z.string().default(join(tmpdir(), 'orygn-opa-mcp.log')),
33
+ /** Log level for the file logger. */
34
+ logLevel: z.enum(['debug', 'info', 'warn', 'error']).default('info'),
35
+ /**
36
+ * Maximum size in bytes for tool response payloads before truncation.
37
+ * Larger payloads are truncated with `truncated: true` and a hint to
38
+ * write to a file path the agent specifies.
39
+ */
40
+ maxResponseBytes: z.coerce.number().int().positive().default(100_000),
41
+ });
42
+ function parseAllowedPaths(raw) {
43
+ if (!raw)
44
+ return undefined;
45
+ const parts = raw
46
+ .split(/[;,]/)
47
+ .map((s) => s.trim())
48
+ .filter((s) => s.length > 0);
49
+ return parts.length > 0 ? parts : undefined;
50
+ }
51
+ export function loadConfig() {
52
+ const allowedPaths = parseAllowedPaths(process.env['OPA_MCP_ALLOWED_PATHS']);
53
+ const parsed = ConfigSchema.safeParse({
54
+ opaUrl: process.env['OPA_URL'],
55
+ opaToken: process.env['OPA_TOKEN'],
56
+ opaBinary: process.env['OPA_BINARY'],
57
+ regalBinary: process.env['REGAL_BINARY'],
58
+ subprocessTimeoutMs: process.env['OPA_MCP_TIMEOUT_MS'],
59
+ httpTimeoutMs: process.env['OPA_MCP_HTTP_TIMEOUT_MS'],
60
+ allowedPaths,
61
+ logFile: process.env['OPA_MCP_LOG_FILE'],
62
+ logLevel: process.env['OPA_MCP_LOG_LEVEL'],
63
+ maxResponseBytes: process.env['OPA_MCP_MAX_RESPONSE_BYTES'],
64
+ });
65
+ if (!parsed.success) {
66
+ console.error('Invalid orygn-opa-mcp configuration:');
67
+ console.error(JSON.stringify(parsed.error.format(), null, 2));
68
+ process.exit(2);
69
+ }
70
+ return parsed.data;
71
+ }
72
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC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ACtD,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Helpers for building structured tool errors.
3
+ *
4
+ * Tools should never throw raw exceptions to the MCP layer — every failure
5
+ * mode returns a `ToolEnvelope` with `ok: false` and a structured `error`.
6
+ */
7
+ import type { ToolEnvelope, ToolErrorCode } from '../types.js';
8
+ export declare function err(code: ToolErrorCode, message: string, options?: {
9
+ hint?: string;
10
+ details?: unknown;
11
+ }): ToolEnvelope<never>;
12
+ export declare function ok<T>(data: T, warnings?: string[]): ToolEnvelope<T>;
13
+ /**
14
+ * Wrap an unknown thrown value into a structured error. Used as the
15
+ * outermost catch in tool handlers.
16
+ */
17
+ export declare function fromException(e: unknown): ToolEnvelope<never>;
18
+ //# sourceMappingURL=errors.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,YAAY,EAAa,aAAa,EAAE,MAAM,aAAa,CAAC;AAE1E,wBAAgB,GAAG,CACjB,IAAI,EAAE,aAAa,EACnB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,GAC7C,YAAY,CAAC,KAAK,CAAC,CAKrB;AAED,wBAAgB,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,EAAE,QAAQ,CAAC,EAAE,MAAM,EAAE,GAAG,YAAY,CAAC,CAAC,CAAC,CAInE;AAED;;;GAGG;AACH,wBAAgB,aAAa,CAAC,CAAC,EAAE,OAAO,GAAG,YAAY,CAAC,KAAK,CAAC,CAK7D"}
@@ -0,0 +1,25 @@
1
+ export function err(code, message, options) {
2
+ const error = { code, message };
3
+ if (options?.hint !== undefined)
4
+ error.hint = options.hint;
5
+ if (options?.details !== undefined)
6
+ error.details = options.details;
7
+ return { ok: false, error };
8
+ }
9
+ export function ok(data, warnings) {
10
+ const envelope = { ok: true, data };
11
+ if (warnings && warnings.length > 0)
12
+ envelope.warnings = warnings;
13
+ return envelope;
14
+ }
15
+ /**
16
+ * Wrap an unknown thrown value into a structured error. Used as the
17
+ * outermost catch in tool handlers.
18
+ */
19
+ export function fromException(e) {
20
+ if (e instanceof Error) {
21
+ return err('UNKNOWN_ERROR', e.message, { details: { stack: e.stack } });
22
+ }
23
+ return err('UNKNOWN_ERROR', 'An unknown error occurred', { details: e });
24
+ }
25
+ //# sourceMappingURL=errors.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/lib/errors.ts"],"names":[],"mappings":"AAQA,MAAM,UAAU,GAAG,CACjB,IAAmB,EACnB,OAAe,EACf,OAA8C;IAE9C,MAAM,KAAK,GAAc,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC;IAC3C,IAAI,OAAO,EAAE,IAAI,KAAK,SAAS;QAAE,KAAK,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAC3D,IAAI,OAAO,EAAE,OAAO,KAAK,SAAS;QAAE,KAAK,CAAC,OAAO,GAAG,OAAO,CAAC,OAAO,CAAC;IACpE,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;AAC9B,CAAC;AAED,MAAM,UAAU,EAAE,CAAI,IAAO,EAAE,QAAmB;IAChD,MAAM,QAAQ,GAAoB,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;IACrD,IAAI,QAAQ,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;IAClE,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa,CAAC,CAAU;IACtC,IAAI,CAAC,YAAY,KAAK,EAAE,CAAC;QACvB,OAAO,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC1E,CAAC;IACD,OAAO,GAAG,CAAC,eAAe,EAAE,2BAA2B,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC"}
@@ -0,0 +1,10 @@
1
+ type Level = 'debug' | 'info' | 'warn' | 'error';
2
+ export declare function initLogger(file: string, level: Level): void;
3
+ export declare const logger: {
4
+ debug: (msg: string, ctx?: Record<string, unknown>) => void;
5
+ info: (msg: string, ctx?: Record<string, unknown>) => void;
6
+ warn: (msg: string, ctx?: Record<string, unknown>) => void;
7
+ error: (msg: string, ctx?: Record<string, unknown>) => void;
8
+ };
9
+ export {};
10
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/lib/logger.ts"],"names":[],"mappings":"AAWA,KAAK,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAiBjD,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,IAAI,CAE3D;AAsBD,eAAO,MAAM,MAAM;iBACJ,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;gBAG7C,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;gBAG5C,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;iBAG3C,MAAM,QAAQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAG,IAAI;CAG1D,CAAC"}
@@ -0,0 +1,57 @@
1
+ /**
2
+ * File-only logger.
3
+ *
4
+ * Stdout is reserved for MCP protocol traffic — writing anywhere else
5
+ * would corrupt the JSON-RPC stream. This logger appends to a file with
6
+ * level filtering, and never touches stdout.
7
+ *
8
+ * Usage: `logger.info('message', { context })`
9
+ */
10
+ import { appendFileSync } from 'node:fs';
11
+ const LEVEL_PRIORITY = {
12
+ debug: 10,
13
+ info: 20,
14
+ warn: 30,
15
+ error: 40,
16
+ };
17
+ // Lazy-initialized so config can be loaded first.
18
+ let state;
19
+ export function initLogger(file, level) {
20
+ state = { file, minLevel: level };
21
+ }
22
+ function write(level, msg, ctx) {
23
+ // Pre-init logs are silently dropped. Only the entry point should produce
24
+ // logs before initLogger runs, and that's a tiny window.
25
+ if (!state)
26
+ return;
27
+ if (LEVEL_PRIORITY[level] < LEVEL_PRIORITY[state.minLevel])
28
+ return;
29
+ const entry = {
30
+ ts: new Date().toISOString(),
31
+ level,
32
+ msg,
33
+ ...(ctx ? { ctx } : {}),
34
+ };
35
+ try {
36
+ appendFileSync(state.file, `${JSON.stringify(entry)}\n`, 'utf8');
37
+ }
38
+ catch {
39
+ // Logging must never throw. If the log file is unreachable, drop the
40
+ // line silently — better than crashing the server.
41
+ }
42
+ }
43
+ export const logger = {
44
+ debug: (msg, ctx) => {
45
+ write('debug', msg, ctx);
46
+ },
47
+ info: (msg, ctx) => {
48
+ write('info', msg, ctx);
49
+ },
50
+ warn: (msg, ctx) => {
51
+ write('warn', msg, ctx);
52
+ },
53
+ error: (msg, ctx) => {
54
+ write('error', msg, ctx);
55
+ },
56
+ };
57
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +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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,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"}
@@ -0,0 +1,226 @@
1
+ import type { Config } from '../config.js';
2
+ import { type SpawnResult } from './subprocess.js';
3
+ /** Input for the formatter. */
4
+ export interface FmtInput {
5
+ /** Rego source code to format. */
6
+ source: string;
7
+ }
8
+ /** Input for `opa check`. */
9
+ export interface CheckInput {
10
+ /** Inline Rego source. Mutually exclusive with `paths`. */
11
+ source?: string;
12
+ /** File or directory paths to check. */
13
+ paths?: string[];
14
+ /** Path to a capabilities JSON file (restrict allowed builtins). */
15
+ capabilities?: string;
16
+ /** Run in strict mode (fail on unused vars, deprecated builtins, etc.). */
17
+ strict?: boolean;
18
+ /** Schema directory for input/data validation. */
19
+ schemaDir?: string;
20
+ }
21
+ /** Input for `opa parse`. */
22
+ export interface ParseInput {
23
+ /** Rego source to parse. */
24
+ source: string;
25
+ }
26
+ /** Input for `opa inspect`. */
27
+ export interface InspectInput {
28
+ /** Path to a bundle archive, directory, or single Rego file. */
29
+ target: string;
30
+ }
31
+ /** Input for `opa capabilities`. */
32
+ export interface CapabilitiesInput {
33
+ /** Print the capabilities of the running OPA instead of a named version. */
34
+ current?: boolean;
35
+ /** A specific capabilities version (e.g. "v0.50.0"). */
36
+ version?: string;
37
+ }
38
+ /** Input for `opa deps`. */
39
+ export interface DepsInput {
40
+ /** Policy/data paths to load before computing dependencies. */
41
+ paths: string[];
42
+ /** Reference to compute dependencies for, e.g. "data.example.allow". */
43
+ ref: string;
44
+ }
45
+ /** Input for `opa eval`. */
46
+ export interface EvalInput {
47
+ /** The query string, e.g. "data.example.allow" or "x := 1; x > 0". */
48
+ query: string;
49
+ /** Inline Rego source. Written to a temp file and added to `--data`. */
50
+ source?: string;
51
+ /** Policy / data file or directory paths. */
52
+ paths?: string[];
53
+ /** Inline input document. JSON-stringified and piped via `--stdin-input`. */
54
+ input?: unknown;
55
+ /** Path to an input JSON file. Mutually exclusive with `input`. */
56
+ inputPath?: string;
57
+ /** Add a trace at the requested level. */
58
+ explain?: 'full' | 'notes' | 'fails' | 'debug';
59
+ /** Add per-rule timing data. */
60
+ profile?: boolean;
61
+ /** Add per-line coverage data. */
62
+ coverage?: boolean;
63
+ /** Add evaluation metrics. */
64
+ metrics?: boolean;
65
+ /** Add detailed instrumentation. */
66
+ instrument?: boolean;
67
+ /** Run partial evaluation. */
68
+ partial?: boolean;
69
+ /** Refs treated as unknown during partial evaluation, e.g. ["input.user"]. */
70
+ unknowns?: string[];
71
+ /** Treat builtin errors as fatal instead of returning undefined. */
72
+ strictBuiltinErrors?: boolean;
73
+ /** Path to a capabilities JSON file. */
74
+ capabilities?: string;
75
+ /** Schema directory for input/data validation. */
76
+ schemaDir?: string;
77
+ }
78
+ /** Input for `opa test`. */
79
+ export interface TestInput {
80
+ /** Test directories or files. Tests live in `*_test.rego` siblings. */
81
+ paths: string[];
82
+ /** Verbose output (per-test pass/fail details). */
83
+ verbose?: boolean;
84
+ /** Emit per-line coverage. */
85
+ coverage?: boolean;
86
+ /** Run only tests whose names match this regex. */
87
+ runPattern?: string;
88
+ /** Bench-style timing alongside test results. */
89
+ bench?: boolean;
90
+ }
91
+ /** Input for `opa bench`. */
92
+ export interface BenchInput {
93
+ /** The query to benchmark. */
94
+ query: string;
95
+ /** Policy / data paths to load. */
96
+ paths?: string[];
97
+ /** Inline input document. JSON-stringified and piped via `--stdin-input`. */
98
+ input?: unknown;
99
+ /** Path to an input JSON file. */
100
+ inputPath?: string;
101
+ /** Number of benchmark iterations. */
102
+ count?: number;
103
+ }
104
+ /** Input for `opa build`. */
105
+ export interface BuildInput {
106
+ /** Policy / data paths to bundle. */
107
+ paths: string[];
108
+ /** Output bundle path (typically `*.tar.gz`). */
109
+ output: string;
110
+ /** Optimization level (0 = none, 2 = aggressive). */
111
+ optimize?: 0 | 1 | 2;
112
+ /** Bundle revision string written to the manifest. */
113
+ revision?: string;
114
+ /** Build target (`rego` for source, `wasm` for compiled WASM). */
115
+ target?: 'rego' | 'wasm';
116
+ /** Entrypoint refs (required when `target=wasm` or `optimize > 0`). */
117
+ entrypoints?: string[];
118
+ /** Path to a signing key for inline signing. */
119
+ signingKey?: string;
120
+ /** Signing algorithm (e.g. `RS256`). */
121
+ signingAlg?: string;
122
+ /** Path to a claims file for inline signing. */
123
+ claimsFile?: string;
124
+ /** Path to a capabilities JSON file. */
125
+ capabilities?: string;
126
+ }
127
+ /** Input for `opa sign`. */
128
+ export interface SignInput {
129
+ /** Path to a bundle directory or archive. */
130
+ bundle: string;
131
+ /** Path to the signing key. */
132
+ signingKey: string;
133
+ /** Signing algorithm (e.g. `RS256`). Defaults to `RS256` in OPA. */
134
+ signingAlg?: string;
135
+ /** Path to a claims file (extra signed claims). */
136
+ claimsFile?: string;
137
+ }
138
+ /**
139
+ * Wrapper around the local `opa` binary.
140
+ *
141
+ * Methods do not throw on `opa` errors — non-zero exit codes are
142
+ * surfaced on the returned `SpawnResult` so tools can map them to
143
+ * structured error envelopes at their layer. They DO throw on
144
+ * caller-side bugs (e.g. an empty `paths` array passed where one is
145
+ * required), since those represent contract violations.
146
+ */
147
+ export declare class OpaCli {
148
+ private readonly config;
149
+ constructor(config: Config);
150
+ /**
151
+ * Verify the binary is present and report its version.
152
+ * Returns null if the binary is unreachable or output is malformed.
153
+ */
154
+ version(): Promise<string | null>;
155
+ /**
156
+ * Format Rego source. Stdout contains the formatted output. Reports
157
+ * `exitCode: 0` even when no changes are needed — callers compare
158
+ * input vs output to detect a no-op.
159
+ */
160
+ fmt(input: FmtInput): Promise<SpawnResult>;
161
+ /**
162
+ * Type-check Rego. Returns `exitCode: 0` and empty `stdout` when the
163
+ * policy is valid. On failure, `exitCode` is non-zero and the JSON
164
+ * error report is written to **stderr** (this is OPA's actual
165
+ * behavior — tools must read `stderr`, not `stdout`, for `check`
166
+ * diagnostics). Either inline `source` or one or more `paths` must be
167
+ * provided.
168
+ */
169
+ check(input: CheckInput): Promise<SpawnResult>;
170
+ /**
171
+ * Parse Rego source to a JSON AST. Stdout is the AST as JSON.
172
+ */
173
+ parse(input: ParseInput): Promise<SpawnResult>;
174
+ /**
175
+ * Inspect a bundle, directory, or single Rego file. Returns its
176
+ * packages, namespaces, manifest, and annotations as JSON on stdout.
177
+ */
178
+ inspect(input: InspectInput): Promise<SpawnResult>;
179
+ /**
180
+ * Print available capabilities. With `current=true`, prints the
181
+ * capabilities of the running OPA. With a `version`, prints those of
182
+ * a specific named version. Without either, lists available named
183
+ * versions.
184
+ */
185
+ capabilities(input?: CapabilitiesInput): Promise<SpawnResult>;
186
+ /**
187
+ * Static dependency analysis for a Rego ref. Stdout is JSON with the
188
+ * `base` and `virtual` document references the ref depends on.
189
+ */
190
+ deps(input: DepsInput): Promise<SpawnResult>;
191
+ /**
192
+ * Evaluate a query against a policy + input. Stdout is JSON with the
193
+ * standard `{result: [...]}` shape (plus optional explain, profile,
194
+ * coverage, and metrics sections).
195
+ */
196
+ eval(input: EvalInput): Promise<SpawnResult>;
197
+ /**
198
+ * Run Rego unit tests. Stdout is JSON with per-test pass/fail.
199
+ */
200
+ test(input: TestInput): Promise<SpawnResult>;
201
+ /**
202
+ * Benchmark a query. Stdout is JSON with iteration timing statistics.
203
+ */
204
+ bench(input: BenchInput): Promise<SpawnResult>;
205
+ /** Build a deployable bundle from policy + data paths. */
206
+ build(input: BuildInput): Promise<SpawnResult>;
207
+ /**
208
+ * Sign a bundle. Writes a `.signatures.json` next to the bundle
209
+ * directory.
210
+ */
211
+ sign(input: SignInput): Promise<SpawnResult>;
212
+ /**
213
+ * Run `opa` with the given argv and optional stdin. Tools should
214
+ * prefer the typed methods above, but this exists for the rare cases
215
+ * the typed surface does not yet cover.
216
+ */
217
+ run(args: string[], stdin?: string): Promise<SpawnResult>;
218
+ /**
219
+ * Write `source` to a uniquely named `.rego` file in the OS tmp dir,
220
+ * pass its path to `fn`, and remove it on completion (success or
221
+ * failure). The path is unique per call so concurrent invocations do
222
+ * not collide.
223
+ */
224
+ private withTempSource;
225
+ }
226
+ //# sourceMappingURL=opa-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"opa-cli.d.ts","sourceRoot":"","sources":["../../src/lib/opa-cli.ts"],"names":[],"mappings":"AAsBA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAa,KAAK,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9D,+BAA+B;AAC/B,MAAM,WAAW,QAAQ;IACvB,kCAAkC;IAClC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,6BAA6B;AAC7B,MAAM,WAAW,UAAU;IACzB,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,wCAAwC;IACxC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,oEAAoE;IACpE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,kDAAkD;IAClD,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,6BAA6B;AAC7B,MAAM,WAAW,UAAU;IACzB,4BAA4B;IAC5B,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,+BAA+B;AAC/B,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,oCAAoC;AACpC,MAAM,WAAW,iBAAiB;IAChC,4EAA4E;IAC5E,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,wDAAwD;IACxD,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,4BAA4B;AAC5B,MAAM,WAAW,SAAS;IACxB,+DAA+D;IAC/D,KAAK,EAAE,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