open-multi-agent-kit 0.97.0 → 0.98.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 (261) hide show
  1. package/CHANGELOG.md +36 -1
  2. package/README.md +41 -9
  3. package/dist/cli/args.d.ts +2 -3
  4. package/dist/cli/args.d.ts.map +1 -1
  5. package/dist/cli/args.js +13 -189
  6. package/dist/cli/args.js.map +1 -1
  7. package/dist/cli/help.d.ts +3 -0
  8. package/dist/cli/help.d.ts.map +1 -0
  9. package/dist/cli/help.js +194 -0
  10. package/dist/cli/help.js.map +1 -0
  11. package/dist/cli/initial-message.d.ts.map +1 -1
  12. package/dist/cli/initial-message.js +2 -1
  13. package/dist/cli/initial-message.js.map +1 -1
  14. package/dist/cli/resource-paths.d.ts +4 -0
  15. package/dist/cli/resource-paths.d.ts.map +1 -0
  16. package/dist/cli/resource-paths.js +59 -0
  17. package/dist/cli/resource-paths.js.map +1 -0
  18. package/dist/commands/adaptorch-doctor-cli.d.ts +13 -0
  19. package/dist/commands/adaptorch-doctor-cli.d.ts.map +1 -0
  20. package/dist/commands/adaptorch-doctor-cli.js +115 -0
  21. package/dist/commands/adaptorch-doctor-cli.js.map +1 -0
  22. package/dist/commands/resource-doctor-cli.d.ts +4 -0
  23. package/dist/commands/resource-doctor-cli.d.ts.map +1 -1
  24. package/dist/commands/resource-doctor-cli.js +35 -5
  25. package/dist/commands/resource-doctor-cli.js.map +1 -1
  26. package/dist/core/adaptorch-bridge.d.ts +11 -13
  27. package/dist/core/adaptorch-bridge.d.ts.map +1 -1
  28. package/dist/core/adaptorch-bridge.js +11 -13
  29. package/dist/core/adaptorch-bridge.js.map +1 -1
  30. package/dist/core/agent-session-snapshot.d.ts +16 -0
  31. package/dist/core/agent-session-snapshot.d.ts.map +1 -0
  32. package/dist/core/agent-session-snapshot.js +111 -0
  33. package/dist/core/agent-session-snapshot.js.map +1 -0
  34. package/dist/core/agent-session.d.ts +5 -9
  35. package/dist/core/agent-session.d.ts.map +1 -1
  36. package/dist/core/agent-session.js +27 -219
  37. package/dist/core/agent-session.js.map +1 -1
  38. package/dist/core/agent-tool-settings.d.ts +10 -0
  39. package/dist/core/agent-tool-settings.d.ts.map +1 -1
  40. package/dist/core/agent-tool-settings.js +10 -1
  41. package/dist/core/agent-tool-settings.js.map +1 -1
  42. package/dist/core/compaction/compaction.d.ts +7 -0
  43. package/dist/core/compaction/compaction.d.ts.map +1 -1
  44. package/dist/core/compaction/compaction.js +25 -61
  45. package/dist/core/compaction/compaction.js.map +1 -1
  46. package/dist/core/compaction/index.d.ts +1 -0
  47. package/dist/core/compaction/index.d.ts.map +1 -1
  48. package/dist/core/compaction/index.js +1 -0
  49. package/dist/core/compaction/index.js.map +1 -1
  50. package/dist/core/compaction/knowledge-triage-format.d.ts +9 -0
  51. package/dist/core/compaction/knowledge-triage-format.d.ts.map +1 -0
  52. package/dist/core/compaction/knowledge-triage-format.js +71 -0
  53. package/dist/core/compaction/knowledge-triage-format.js.map +1 -0
  54. package/dist/core/compaction/knowledge-triage-types.d.ts +7 -0
  55. package/dist/core/compaction/knowledge-triage-types.d.ts.map +1 -0
  56. package/dist/core/compaction/knowledge-triage-types.js +2 -0
  57. package/dist/core/compaction/knowledge-triage-types.js.map +1 -0
  58. package/dist/core/compaction/knowledge-triage.d.ts +29 -0
  59. package/dist/core/compaction/knowledge-triage.d.ts.map +1 -0
  60. package/dist/core/compaction/knowledge-triage.js +189 -0
  61. package/dist/core/compaction/knowledge-triage.js.map +1 -0
  62. package/dist/core/compaction/transaction.d.ts.map +1 -1
  63. package/dist/core/compaction/transaction.js +1 -1
  64. package/dist/core/compaction/transaction.js.map +1 -1
  65. package/dist/core/compaction/utils.d.ts +4 -0
  66. package/dist/core/compaction/utils.d.ts.map +1 -1
  67. package/dist/core/compaction/utils.js +37 -0
  68. package/dist/core/compaction/utils.js.map +1 -1
  69. package/dist/core/completion-sound-io.d.ts +14 -0
  70. package/dist/core/completion-sound-io.d.ts.map +1 -0
  71. package/dist/core/completion-sound-io.js +64 -0
  72. package/dist/core/completion-sound-io.js.map +1 -0
  73. package/dist/core/completion-sound.d.ts +4 -10
  74. package/dist/core/completion-sound.d.ts.map +1 -1
  75. package/dist/core/completion-sound.js +28 -58
  76. package/dist/core/completion-sound.js.map +1 -1
  77. package/dist/core/context-budget-relevance.d.ts +15 -2
  78. package/dist/core/context-budget-relevance.d.ts.map +1 -1
  79. package/dist/core/context-budget-relevance.js +21 -9
  80. package/dist/core/context-budget-relevance.js.map +1 -1
  81. package/dist/core/context-budget-system-prompt-items.d.ts +1 -1
  82. package/dist/core/context-budget-system-prompt-items.d.ts.map +1 -1
  83. package/dist/core/context-budget-system-prompt-items.js.map +1 -1
  84. package/dist/core/context-budget-system-prompt.d.ts +1 -1
  85. package/dist/core/context-budget-system-prompt.d.ts.map +1 -1
  86. package/dist/core/context-budget-system-prompt.js.map +1 -1
  87. package/dist/core/context-file.d.ts +23 -0
  88. package/dist/core/context-file.d.ts.map +1 -0
  89. package/dist/core/context-file.js +17 -0
  90. package/dist/core/context-file.js.map +1 -0
  91. package/dist/core/keybindings.d.ts +1 -1
  92. package/dist/core/keybindings.d.ts.map +1 -1
  93. package/dist/core/keybindings.js +6 -1
  94. package/dist/core/keybindings.js.map +1 -1
  95. package/dist/core/model-prompt-policy.d.ts +1 -1
  96. package/dist/core/model-prompt-policy.d.ts.map +1 -1
  97. package/dist/core/model-prompt-policy.js.map +1 -1
  98. package/dist/core/prompt-settlement.d.ts +6 -3
  99. package/dist/core/prompt-settlement.d.ts.map +1 -1
  100. package/dist/core/prompt-settlement.js +10 -14
  101. package/dist/core/prompt-settlement.js.map +1 -1
  102. package/dist/core/reasoning-router-promotion.d.ts +41 -1
  103. package/dist/core/reasoning-router-promotion.d.ts.map +1 -1
  104. package/dist/core/reasoning-router-promotion.js +31 -2
  105. package/dist/core/reasoning-router-promotion.js.map +1 -1
  106. package/dist/core/reasoning-router-replay-stability.d.ts +65 -0
  107. package/dist/core/reasoning-router-replay-stability.d.ts.map +1 -0
  108. package/dist/core/reasoning-router-replay-stability.js +67 -0
  109. package/dist/core/reasoning-router-replay-stability.js.map +1 -0
  110. package/dist/core/reasoning-router-v4-weights.d.ts +6 -6
  111. package/dist/core/reasoning-router-v4-weights.d.ts.map +1 -1
  112. package/dist/core/reasoning-router-v4-weights.js +3 -3
  113. package/dist/core/reasoning-router-v4-weights.js.map +1 -1
  114. package/dist/core/reasoning-router-v4.d.ts.map +1 -1
  115. package/dist/core/reasoning-router-v4.js +6 -6
  116. package/dist/core/reasoning-router-v4.js.map +1 -1
  117. package/dist/core/redaction.d.ts.map +1 -1
  118. package/dist/core/redaction.js +1 -1
  119. package/dist/core/redaction.js.map +1 -1
  120. package/dist/core/resource-admission.d.ts +2 -1
  121. package/dist/core/resource-admission.d.ts.map +1 -1
  122. package/dist/core/resource-admission.js +11 -0
  123. package/dist/core/resource-admission.js.map +1 -1
  124. package/dist/core/resource-governor-format.d.ts +1 -1
  125. package/dist/core/resource-governor-format.d.ts.map +1 -1
  126. package/dist/core/resource-governor-format.js.map +1 -1
  127. package/dist/core/resource-governor-settings.d.ts +6 -12
  128. package/dist/core/resource-governor-settings.d.ts.map +1 -1
  129. package/dist/core/resource-governor-settings.js.map +1 -1
  130. package/dist/core/resource-governor-types.d.ts +24 -0
  131. package/dist/core/resource-governor-types.d.ts.map +1 -0
  132. package/dist/core/resource-governor-types.js +15 -0
  133. package/dist/core/resource-governor-types.js.map +1 -0
  134. package/dist/core/resource-loader.d.ts +1 -7
  135. package/dist/core/resource-loader.d.ts.map +1 -1
  136. package/dist/core/resource-loader.js.map +1 -1
  137. package/dist/core/resource-observation-journal.d.ts +2 -1
  138. package/dist/core/resource-observation-journal.d.ts.map +1 -1
  139. package/dist/core/resource-observation-journal.js +4 -3
  140. package/dist/core/resource-observation-journal.js.map +1 -1
  141. package/dist/core/resource-observation-report-reader.d.ts +7 -0
  142. package/dist/core/resource-observation-report-reader.d.ts.map +1 -0
  143. package/dist/core/resource-observation-report-reader.js +157 -0
  144. package/dist/core/resource-observation-report-reader.js.map +1 -0
  145. package/dist/core/resource-observation-report.d.ts +24 -0
  146. package/dist/core/resource-observation-report.d.ts.map +1 -0
  147. package/dist/core/resource-observation-report.js +101 -0
  148. package/dist/core/resource-observation-report.js.map +1 -0
  149. package/dist/core/router-feedback-collector.d.ts +1 -1
  150. package/dist/core/router-feedback-collector.d.ts.map +1 -1
  151. package/dist/core/router-feedback-collector.js.map +1 -1
  152. package/dist/core/session-failure-cause.d.ts +33 -0
  153. package/dist/core/session-failure-cause.d.ts.map +1 -0
  154. package/dist/core/session-failure-cause.js +141 -0
  155. package/dist/core/session-failure-cause.js.map +1 -0
  156. package/dist/core/session-system-prompt.d.ts +1 -1
  157. package/dist/core/session-system-prompt.d.ts.map +1 -1
  158. package/dist/core/session-system-prompt.js.map +1 -1
  159. package/dist/core/settings-manager.d.ts +1 -1
  160. package/dist/core/settings-manager.d.ts.map +1 -1
  161. package/dist/core/settings-manager.js.map +1 -1
  162. package/dist/core/system-prompt.d.ts +1 -1
  163. package/dist/core/system-prompt.d.ts.map +1 -1
  164. package/dist/core/system-prompt.js.map +1 -1
  165. package/dist/core/tools/bash.d.ts.map +1 -1
  166. package/dist/core/tools/bash.js +7 -7
  167. package/dist/core/tools/bash.js.map +1 -1
  168. package/dist/core/workload-classifier.d.ts +2 -10
  169. package/dist/core/workload-classifier.d.ts.map +1 -1
  170. package/dist/core/workload-classifier.js +17 -0
  171. package/dist/core/workload-classifier.js.map +1 -1
  172. package/dist/core/workload-family-matcher.d.ts +1 -1
  173. package/dist/core/workload-family-matcher.d.ts.map +1 -1
  174. package/dist/core/workload-family-matcher.js.map +1 -1
  175. package/dist/core/workload-shard-execution-types.d.ts +40 -0
  176. package/dist/core/workload-shard-execution-types.d.ts.map +1 -0
  177. package/dist/core/workload-shard-execution-types.js +14 -0
  178. package/dist/core/workload-shard-execution-types.js.map +1 -0
  179. package/dist/core/workload-shard-executor.d.ts +3 -27
  180. package/dist/core/workload-shard-executor.d.ts.map +1 -1
  181. package/dist/core/workload-shard-executor.js.map +1 -1
  182. package/dist/core/workload-shard-runner.d.ts +1 -1
  183. package/dist/core/workload-shard-runner.d.ts.map +1 -1
  184. package/dist/core/workload-shard-runner.js.map +1 -1
  185. package/dist/core/workload-types.d.ts +24 -0
  186. package/dist/core/workload-types.d.ts.map +1 -0
  187. package/dist/core/workload-types.js +15 -0
  188. package/dist/core/workload-types.js.map +1 -0
  189. package/dist/main.d.ts +2 -0
  190. package/dist/main.d.ts.map +1 -1
  191. package/dist/main.js +27 -47
  192. package/dist/main.js.map +1 -1
  193. package/dist/modes/interactive/theme/omk-control-panel.json +1 -1
  194. package/dist/utils/clipboard-image.d.ts.map +1 -1
  195. package/dist/utils/clipboard-image.js +42 -33
  196. package/dist/utils/clipboard-image.js.map +1 -1
  197. package/dist/utils/clipboard.d.ts.map +1 -1
  198. package/dist/utils/clipboard.js +14 -2
  199. package/dist/utils/clipboard.js.map +1 -1
  200. package/docs/adaptorch-preview-spec.md +20 -18
  201. package/docs/adaptorch-preview.md +9 -9
  202. package/docs/compaction.md +24 -3
  203. package/docs/correctness-wall.md +10 -10
  204. package/docs/docs.json +12 -0
  205. package/docs/environment-variables.md +9 -2
  206. package/docs/index.md +3 -0
  207. package/docs/runtime-algorithms.md +359 -0
  208. package/docs/sdk.md +2 -2
  209. package/docs/settings.md +11 -10
  210. package/docs/usage.md +18 -2
  211. package/examples/extensions/custom-provider-anthropic/package-lock.json +2 -2
  212. package/examples/extensions/custom-provider-anthropic/package.json +1 -1
  213. package/examples/extensions/custom-provider-gitlab-duo/package.json +1 -1
  214. package/examples/extensions/gondolin/package-lock.json +2 -2
  215. package/examples/extensions/gondolin/package.json +1 -1
  216. package/examples/extensions/sandbox/package-lock.json +2 -2
  217. package/examples/extensions/sandbox/package.json +1 -1
  218. package/examples/extensions/with-deps/package-lock.json +2 -2
  219. package/examples/extensions/with-deps/package.json +1 -1
  220. package/npm-shrinkwrap.json +18 -18
  221. package/package.json +6 -6
  222. package/dist/core/context-budget-governor.d.ts +0 -67
  223. package/dist/core/context-budget-governor.d.ts.map +0 -1
  224. package/dist/core/context-budget-governor.js +0 -224
  225. package/dist/core/context-budget-governor.js.map +0 -1
  226. package/dist/core/lean-ctx.d.ts +0 -99
  227. package/dist/core/lean-ctx.d.ts.map +0 -1
  228. package/dist/core/lean-ctx.js +0 -225
  229. package/dist/core/lean-ctx.js.map +0 -1
  230. package/dist/core/read-anchors.d.ts +0 -110
  231. package/dist/core/read-anchors.d.ts.map +0 -1
  232. package/dist/core/read-anchors.js +0 -193
  233. package/dist/core/read-anchors.js.map +0 -1
  234. package/dist/core/recovery-checkpoint.d.ts +0 -196
  235. package/dist/core/recovery-checkpoint.d.ts.map +0 -1
  236. package/dist/core/recovery-checkpoint.js +0 -382
  237. package/dist/core/recovery-checkpoint.js.map +0 -1
  238. package/dist/core/sandbox-policy-v2.d.ts +0 -49
  239. package/dist/core/sandbox-policy-v2.d.ts.map +0 -1
  240. package/dist/core/sandbox-policy-v2.js +0 -368
  241. package/dist/core/sandbox-policy-v2.js.map +0 -1
  242. package/dist/guardrails/audit-logger.d.ts +0 -4
  243. package/dist/guardrails/audit-logger.d.ts.map +0 -1
  244. package/dist/guardrails/audit-logger.js +0 -28
  245. package/dist/guardrails/audit-logger.js.map +0 -1
  246. package/dist/guardrails/freedomd-adapter.d.ts +0 -16
  247. package/dist/guardrails/freedomd-adapter.d.ts.map +0 -1
  248. package/dist/guardrails/freedomd-adapter.js +0 -87
  249. package/dist/guardrails/freedomd-adapter.js.map +0 -1
  250. package/dist/orchestration/lane-grant-auditor.d.ts +0 -4
  251. package/dist/orchestration/lane-grant-auditor.d.ts.map +0 -1
  252. package/dist/orchestration/lane-grant-auditor.js +0 -87
  253. package/dist/orchestration/lane-grant-auditor.js.map +0 -1
  254. package/dist/types/guardrails.d.ts +0 -61
  255. package/dist/types/guardrails.d.ts.map +0 -1
  256. package/dist/types/guardrails.js +0 -9
  257. package/dist/types/guardrails.js.map +0 -1
  258. package/dist/types/lane-grant.d.ts +0 -58
  259. package/dist/types/lane-grant.d.ts.map +0 -1
  260. package/dist/types/lane-grant.js +0 -9
  261. package/dist/types/lane-grant.js.map +0 -1
@@ -1,28 +0,0 @@
1
- import { appendFileSync, existsSync, mkdirSync, readFileSync } from "node:fs";
2
- import { dirname } from "node:path";
3
- export function appendAuditEvent(auditPath, event) {
4
- return new Promise((resolve, reject) => {
5
- try {
6
- const dir = dirname(auditPath);
7
- if (!existsSync(dir)) {
8
- mkdirSync(dir, { recursive: true });
9
- }
10
- const line = `${JSON.stringify(event)}\n`;
11
- appendFileSync(auditPath, line, "utf-8");
12
- resolve();
13
- }
14
- catch (err) {
15
- reject(err);
16
- }
17
- });
18
- }
19
- export function readAuditEvents(auditPath) {
20
- if (!existsSync(auditPath))
21
- return [];
22
- const content = readFileSync(auditPath, "utf-8");
23
- return content
24
- .split("\n")
25
- .filter((line) => line.trim().length > 0)
26
- .map((line) => JSON.parse(line));
27
- }
28
- //# sourceMappingURL=audit-logger.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"audit-logger.js","sourceRoot":"","sources":["../../src/guardrails/audit-logger.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,MAAM,UAAU,gBAAgB,CAAC,SAAiB,EAAE,KAA0B,EAAiB;IAC9F,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACJ,MAAM,GAAG,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;YAC/B,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;gBACtB,SAAS,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;YACrC,CAAC;YACD,MAAM,IAAI,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC;YAC1C,cAAc,CAAC,SAAS,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACzC,OAAO,EAAE,CAAC;QACX,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACd,MAAM,CAAC,GAAG,CAAC,CAAC;QACb,CAAC;IAAA,CACD,CAAC,CAAC;AAAA,CACH;AAED,MAAM,UAAU,eAAe,CAAC,SAAiB,EAAyB;IACzE,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC;QAAE,OAAO,EAAE,CAAC;IACtC,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC;IACjD,OAAO,OAAO;SACZ,KAAK,CAAC,IAAI,CAAC;SACX,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC;SACxC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAwB,CAAC,CAAC;AAAA,CACzD","sourcesContent":["import { appendFileSync, existsSync, mkdirSync, readFileSync } from \"node:fs\";\nimport { dirname } from \"node:path\";\nimport type { GuardrailAuditEvent } from \"../types/guardrails.ts\";\n\nexport function appendAuditEvent(auditPath: string, event: GuardrailAuditEvent): Promise<void> {\n\treturn new Promise((resolve, reject) => {\n\t\ttry {\n\t\t\tconst dir = dirname(auditPath);\n\t\t\tif (!existsSync(dir)) {\n\t\t\t\tmkdirSync(dir, { recursive: true });\n\t\t\t}\n\t\t\tconst line = `${JSON.stringify(event)}\\n`;\n\t\t\tappendFileSync(auditPath, line, \"utf-8\");\n\t\t\tresolve();\n\t\t} catch (err) {\n\t\t\treject(err);\n\t\t}\n\t});\n}\n\nexport function readAuditEvents(auditPath: string): GuardrailAuditEvent[] {\n\tif (!existsSync(auditPath)) return [];\n\tconst content = readFileSync(auditPath, \"utf-8\");\n\treturn content\n\t\t.split(\"\\n\")\n\t\t.filter((line) => line.trim().length > 0)\n\t\t.map((line) => JSON.parse(line) as GuardrailAuditEvent);\n}\n"]}
@@ -1,16 +0,0 @@
1
- import type { FreedomdAdapter, GuardrailDecision } from "../types/guardrails.ts";
2
- export declare class UnifiedFreedomdAdapter implements FreedomdAdapter {
3
- private policy;
4
- private goalId?;
5
- private auditPath?;
6
- constructor(options?: {
7
- policyPath?: string;
8
- goalId?: string;
9
- auditPath?: string;
10
- });
11
- evaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision>;
12
- private sanitizeInput;
13
- private suggestAlternative;
14
- private log;
15
- }
16
- //# sourceMappingURL=freedomd-adapter.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"freedomd-adapter.d.ts","sourceRoot":"","sources":["../../src/guardrails/freedomd-adapter.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACX,eAAe,EAEf,iBAAiB,EAGjB,MAAM,wBAAwB,CAAC;AAahC,qBAAa,sBAAuB,YAAW,eAAe;IAC7D,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,MAAM,CAAC,CAAS;IACxB,OAAO,CAAC,SAAS,CAAC,CAAS;IAE3B,YAAY,OAAO,CAAC,EAAE;QAAE,UAAU,CAAC,EAAE,MAAM,CAAC;QAAC,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,MAAM,CAAA;KAAE,EAMjF;IAEK,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAqB/E;IAED,OAAO,CAAC,aAAa;IAUrB,OAAO,CAAC,kBAAkB;YAeZ,GAAG;CAWjB","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport YAML from \"yaml\";\nimport type {\n\tFreedomdAdapter,\n\tGuardrailAuditEvent,\n\tGuardrailDecision,\n\tGuardrailPolicy,\n\tGuardrailRule,\n} from \"../types/guardrails.ts\";\nimport { appendAuditEvent } from \"./audit-logger.ts\";\n\nfunction getCurrentDir(): string {\n\ttry {\n\t\treturn dirname(fileURLToPath(import.meta.url));\n\t} catch {\n\t\treturn __dirname;\n\t}\n}\n\nconst DEFAULT_POLICY_PATH = join(getCurrentDir(), \"policy.yaml\");\n\nexport class UnifiedFreedomdAdapter implements FreedomdAdapter {\n\tprivate policy: GuardrailPolicy;\n\tprivate goalId?: string;\n\tprivate auditPath?: string;\n\n\tconstructor(options?: { policyPath?: string; goalId?: string; auditPath?: string }) {\n\t\tconst path = options?.policyPath ?? DEFAULT_POLICY_PATH;\n\t\tconst raw = readFileSync(path, \"utf-8\");\n\t\tthis.policy = YAML.parse(raw) as GuardrailPolicy;\n\t\tthis.goalId = options?.goalId;\n\t\tthis.auditPath = options?.auditPath;\n\t}\n\n\tasync evaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision> {\n\t\tconst inputText = this.sanitizeInput(toolInput);\n\n\t\tfor (const rule of this.policy.rules) {\n\t\t\tif (!rule.enabled) continue;\n\t\t\tif (rule.toolName && rule.toolName !== toolName) continue;\n\t\t\tif (rule.pattern && !new RegExp(rule.pattern, \"i\").test(inputText)) continue;\n\n\t\t\tconst decision: GuardrailDecision = {\n\t\t\t\tallowed: false,\n\t\t\t\trule,\n\t\t\t\treason: `Blocked by rule \"${rule.id}\": ${rule.description}`,\n\t\t\t\tsuggestion: this.suggestAlternative(rule),\n\t\t\t};\n\t\t\tawait this.log(toolName, inputText, decision);\n\t\t\treturn decision;\n\t\t}\n\n\t\tconst allow: GuardrailDecision = { allowed: true };\n\t\tawait this.log(toolName, inputText, allow);\n\t\treturn allow;\n\t}\n\n\tprivate sanitizeInput(input: unknown): string {\n\t\tif (input === null || input === undefined) return \"\";\n\t\tif (typeof input === \"string\") return input;\n\t\ttry {\n\t\t\treturn JSON.stringify(input);\n\t\t} catch {\n\t\t\treturn String(input);\n\t\t}\n\t}\n\n\tprivate suggestAlternative(rule: GuardrailRule): string | undefined {\n\t\tswitch (rule.category) {\n\t\t\tcase \"network\":\n\t\t\t\treturn \"Use context-mode_ctx_fetch_and_index or context-mode_ctx_execute instead of shell networking.\";\n\t\t\tcase \"destructive\":\n\t\t\t\treturn \"Use targeted rm of specific files or confirm destructive operations interactively.\";\n\t\t\tcase \"privilege_escalation\":\n\t\t\t\treturn \"Run the command without sudo or use a dedicated privileged lane grant.\";\n\t\t\tcase \"secret_exposure\":\n\t\t\t\treturn \"Avoid reading secret files; use environment-variable references with $ prefix.\";\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate async log(toolName: string, toolInput: string, decision: GuardrailDecision): Promise<void> {\n\t\tif (!this.auditPath) return;\n\t\tconst event: GuardrailAuditEvent = {\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tgoalId: this.goalId,\n\t\t\ttoolName,\n\t\t\ttoolInput,\n\t\t\tdecision,\n\t\t};\n\t\tawait appendAuditEvent(this.auditPath, event);\n\t}\n}\n"]}
@@ -1,87 +0,0 @@
1
- import { readFileSync } from "node:fs";
2
- import { dirname, join } from "node:path";
3
- import { fileURLToPath } from "node:url";
4
- import YAML from "yaml";
5
- import { appendAuditEvent } from "./audit-logger.js";
6
- function getCurrentDir() {
7
- try {
8
- return dirname(fileURLToPath(import.meta.url));
9
- }
10
- catch {
11
- return __dirname;
12
- }
13
- }
14
- const DEFAULT_POLICY_PATH = join(getCurrentDir(), "policy.yaml");
15
- export class UnifiedFreedomdAdapter {
16
- policy;
17
- goalId;
18
- auditPath;
19
- constructor(options) {
20
- const path = options?.policyPath ?? DEFAULT_POLICY_PATH;
21
- const raw = readFileSync(path, "utf-8");
22
- this.policy = YAML.parse(raw);
23
- this.goalId = options?.goalId;
24
- this.auditPath = options?.auditPath;
25
- }
26
- async evaluate(toolName, toolInput) {
27
- const inputText = this.sanitizeInput(toolInput);
28
- for (const rule of this.policy.rules) {
29
- if (!rule.enabled)
30
- continue;
31
- if (rule.toolName && rule.toolName !== toolName)
32
- continue;
33
- if (rule.pattern && !new RegExp(rule.pattern, "i").test(inputText))
34
- continue;
35
- const decision = {
36
- allowed: false,
37
- rule,
38
- reason: `Blocked by rule "${rule.id}": ${rule.description}`,
39
- suggestion: this.suggestAlternative(rule),
40
- };
41
- await this.log(toolName, inputText, decision);
42
- return decision;
43
- }
44
- const allow = { allowed: true };
45
- await this.log(toolName, inputText, allow);
46
- return allow;
47
- }
48
- sanitizeInput(input) {
49
- if (input === null || input === undefined)
50
- return "";
51
- if (typeof input === "string")
52
- return input;
53
- try {
54
- return JSON.stringify(input);
55
- }
56
- catch {
57
- return String(input);
58
- }
59
- }
60
- suggestAlternative(rule) {
61
- switch (rule.category) {
62
- case "network":
63
- return "Use context-mode_ctx_fetch_and_index or context-mode_ctx_execute instead of shell networking.";
64
- case "destructive":
65
- return "Use targeted rm of specific files or confirm destructive operations interactively.";
66
- case "privilege_escalation":
67
- return "Run the command without sudo or use a dedicated privileged lane grant.";
68
- case "secret_exposure":
69
- return "Avoid reading secret files; use environment-variable references with $ prefix.";
70
- default:
71
- return undefined;
72
- }
73
- }
74
- async log(toolName, toolInput, decision) {
75
- if (!this.auditPath)
76
- return;
77
- const event = {
78
- timestamp: new Date().toISOString(),
79
- goalId: this.goalId,
80
- toolName,
81
- toolInput,
82
- decision,
83
- };
84
- await appendAuditEvent(this.auditPath, event);
85
- }
86
- }
87
- //# sourceMappingURL=freedomd-adapter.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"freedomd-adapter.js","sourceRoot":"","sources":["../../src/guardrails/freedomd-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,IA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iB,EAAE,QAA2B,EAAiB;QAClG,IAAI,CAAC,IAAI,CAAC,SAAS;YAAE,OAAO;QAC5B,MAAM,KAAK,GAAwB;YAClC,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,WAAW,EAAE;YACnC,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,QAAQ;YACR,SAAS;YACT,QAAQ;SACR,CAAC;QACF,MAAM,gBAAgB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;IAAA,CAC9C;CACD","sourcesContent":["import { readFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\nimport YAML from \"yaml\";\nimport type {\n\tFreedomdAdapter,\n\tGuardrailAuditEvent,\n\tGuardrailDecision,\n\tGuardrailPolicy,\n\tGuardrailRule,\n} from \"../types/guardrails.ts\";\nimport { appendAuditEvent } from \"./audit-logger.ts\";\n\nfunction getCurrentDir(): string {\n\ttry {\n\t\treturn dirname(fileURLToPath(import.meta.url));\n\t} catch {\n\t\treturn __dirname;\n\t}\n}\n\nconst DEFAULT_POLICY_PATH = join(getCurrentDir(), \"policy.yaml\");\n\nexport class UnifiedFreedomdAdapter implements FreedomdAdapter {\n\tprivate policy: GuardrailPolicy;\n\tprivate goalId?: string;\n\tprivate auditPath?: string;\n\n\tconstructor(options?: { policyPath?: string; goalId?: string; auditPath?: string }) {\n\t\tconst path = options?.policyPath ?? DEFAULT_POLICY_PATH;\n\t\tconst raw = readFileSync(path, \"utf-8\");\n\t\tthis.policy = YAML.parse(raw) as GuardrailPolicy;\n\t\tthis.goalId = options?.goalId;\n\t\tthis.auditPath = options?.auditPath;\n\t}\n\n\tasync evaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision> {\n\t\tconst inputText = this.sanitizeInput(toolInput);\n\n\t\tfor (const rule of this.policy.rules) {\n\t\t\tif (!rule.enabled) continue;\n\t\t\tif (rule.toolName && rule.toolName !== toolName) continue;\n\t\t\tif (rule.pattern && !new RegExp(rule.pattern, \"i\").test(inputText)) continue;\n\n\t\t\tconst decision: GuardrailDecision = {\n\t\t\t\tallowed: false,\n\t\t\t\trule,\n\t\t\t\treason: `Blocked by rule \"${rule.id}\": ${rule.description}`,\n\t\t\t\tsuggestion: this.suggestAlternative(rule),\n\t\t\t};\n\t\t\tawait this.log(toolName, inputText, decision);\n\t\t\treturn decision;\n\t\t}\n\n\t\tconst allow: GuardrailDecision = { allowed: true };\n\t\tawait this.log(toolName, inputText, allow);\n\t\treturn allow;\n\t}\n\n\tprivate sanitizeInput(input: unknown): string {\n\t\tif (input === null || input === undefined) return \"\";\n\t\tif (typeof input === \"string\") return input;\n\t\ttry {\n\t\t\treturn JSON.stringify(input);\n\t\t} catch {\n\t\t\treturn String(input);\n\t\t}\n\t}\n\n\tprivate suggestAlternative(rule: GuardrailRule): string | undefined {\n\t\tswitch (rule.category) {\n\t\t\tcase \"network\":\n\t\t\t\treturn \"Use context-mode_ctx_fetch_and_index or context-mode_ctx_execute instead of shell networking.\";\n\t\t\tcase \"destructive\":\n\t\t\t\treturn \"Use targeted rm of specific files or confirm destructive operations interactively.\";\n\t\t\tcase \"privilege_escalation\":\n\t\t\t\treturn \"Run the command without sudo or use a dedicated privileged lane grant.\";\n\t\t\tcase \"secret_exposure\":\n\t\t\t\treturn \"Avoid reading secret files; use environment-variable references with $ prefix.\";\n\t\t\tdefault:\n\t\t\t\treturn undefined;\n\t\t}\n\t}\n\n\tprivate async log(toolName: string, toolInput: string, decision: GuardrailDecision): Promise<void> {\n\t\tif (!this.auditPath) return;\n\t\tconst event: GuardrailAuditEvent = {\n\t\t\ttimestamp: new Date().toISOString(),\n\t\t\tgoalId: this.goalId,\n\t\t\ttoolName,\n\t\t\ttoolInput,\n\t\t\tdecision,\n\t\t};\n\t\tawait appendAuditEvent(this.auditPath, event);\n\t}\n}\n"]}
@@ -1,4 +0,0 @@
1
- import type { LaneGrant, LaneGrantAuditReport } from "../types/lane-grant.ts";
2
- export declare function auditLaneGrants(grants: LaneGrant[], evidencePath: string): LaneGrantAuditReport;
3
- export declare function formatAuditReport(report: LaneGrantAuditReport): string;
4
- //# sourceMappingURL=lane-grant-auditor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane-grant-auditor.d.ts","sourceRoot":"","sources":["../../src/orchestration/lane-grant-auditor.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,oBAAoB,EAAgB,MAAM,wBAAwB,CAAC;AAsB5F,wBAAgB,eAAe,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,YAAY,EAAE,MAAM,GAAG,oBAAoB,CA+C/F;AAED,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,oBAAoB,GAAG,MAAM,CAuBtE","sourcesContent":["import { minimatch } from \"minimatch\";\nimport type { LaneGrant, LaneGrantAuditReport, PathConflict } from \"../types/lane-grant.ts\";\n\nfunction pathsOverlap(a: string, b: string): boolean {\n\tconst normalizedA = a.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\");\n\tconst normalizedB = b.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\");\n\tif (normalizedA === normalizedB) return true;\n\tif (minimatch(normalizedA, normalizedB) || minimatch(normalizedB, normalizedA)) return true;\n\tif (normalizedA.startsWith(`${normalizedB}/`) || normalizedB.startsWith(`${normalizedA}/`)) return true;\n\treturn false;\n}\n\nfunction hasOverlap(scopesA: string[], scopesB: string[]): { overlaps: boolean; path: string } {\n\tfor (const a of scopesA) {\n\t\tfor (const b of scopesB) {\n\t\t\tif (pathsOverlap(a, b)) {\n\t\t\t\treturn { overlaps: true, path: a };\n\t\t\t}\n\t\t}\n\t}\n\treturn { overlaps: false, path: \"\" };\n}\n\nexport function auditLaneGrants(grants: LaneGrant[], evidencePath: string): LaneGrantAuditReport {\n\tconst conflicts: PathConflict[] = [];\n\n\tfor (let i = 0; i < grants.length; i++) {\n\t\tfor (let j = i + 1; j < grants.length; j++) {\n\t\t\tconst a = grants[i];\n\t\t\tconst b = grants[j];\n\n\t\t\t// Only writers can conflict with each other.\n\t\t\tif (a.authority !== \"write-scoped\" || b.authority !== \"write-scoped\") continue;\n\n\t\t\tconst writeA = a.allowedPaths;\n\t\t\tconst writeB = b.allowedPaths;\n\t\t\tconst overlap = hasOverlap(writeA, writeB);\n\n\t\t\tif (overlap.overlaps) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tlanes: [a.laneId, b.laneId],\n\t\t\t\t\toverlappingPath: overlap.path,\n\t\t\t\t\tseverity: \"merge-blocked\",\n\t\t\t\t\tsuggestion: `Serialize lanes ${a.laneId} and ${b.laneId}, or split write scopes so they do not overlap at ${overlap.path}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Any grant writing to a blocked path is a merge-blocker.\n\t\tconst grant = grants[i];\n\t\tfor (const allowed of grant.allowedPaths) {\n\t\t\tfor (const blocked of grant.blockedPaths) {\n\t\t\t\tif (pathsOverlap(allowed, blocked)) {\n\t\t\t\t\tconflicts.push({\n\t\t\t\t\t\tlanes: [grant.laneId, grant.laneId],\n\t\t\t\t\t\toverlappingPath: blocked,\n\t\t\t\t\t\tseverity: \"merge-blocked\",\n\t\t\t\t\t\tsuggestion: `Remove ${blocked} from allowedPaths or add an exception; it overlaps blockedPaths in ${grant.laneId}.`,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tgrants,\n\t\tconflicts,\n\t\tmergeBlocked: conflicts.some((c) => c.severity === \"merge-blocked\"),\n\t\tevidencePath,\n\t};\n}\n\nexport function formatAuditReport(report: LaneGrantAuditReport): string {\n\tconst lines: string[] = [\n\t\t`# Lane Grant Audit Report`,\n\t\t\"\",\n\t\t`- Lanes audited: ${report.grants.length}`,\n\t\t`- Conflicts detected: ${report.conflicts.length}`,\n\t\t`- Merge blocked: ${report.mergeBlocked ? \"YES\" : \"NO\"}`,\n\t\t\"\",\n\t];\n\n\tif (report.conflicts.length === 0) {\n\t\tlines.push(\"No path conflicts detected.\");\n\t} else {\n\t\tlines.push(\"## Conflicts\");\n\t\tfor (const conflict of report.conflicts) {\n\t\t\tlines.push(\n\t\t\t\t`- **${conflict.severity.toUpperCase()}** \\`${conflict.lanes.join(\" ↔ \")}\\` at \\`${conflict.overlappingPath}\\``,\n\t\t\t);\n\t\t\tlines.push(` - Suggestion: ${conflict.suggestion}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n"]}
@@ -1,87 +0,0 @@
1
- import { minimatch } from "minimatch";
2
- function pathsOverlap(a, b) {
3
- const normalizedA = a.replace(/\\/g, "/").replace(/\/$/, "");
4
- const normalizedB = b.replace(/\\/g, "/").replace(/\/$/, "");
5
- if (normalizedA === normalizedB)
6
- return true;
7
- if (minimatch(normalizedA, normalizedB) || minimatch(normalizedB, normalizedA))
8
- return true;
9
- if (normalizedA.startsWith(`${normalizedB}/`) || normalizedB.startsWith(`${normalizedA}/`))
10
- return true;
11
- return false;
12
- }
13
- function hasOverlap(scopesA, scopesB) {
14
- for (const a of scopesA) {
15
- for (const b of scopesB) {
16
- if (pathsOverlap(a, b)) {
17
- return { overlaps: true, path: a };
18
- }
19
- }
20
- }
21
- return { overlaps: false, path: "" };
22
- }
23
- export function auditLaneGrants(grants, evidencePath) {
24
- const conflicts = [];
25
- for (let i = 0; i < grants.length; i++) {
26
- for (let j = i + 1; j < grants.length; j++) {
27
- const a = grants[i];
28
- const b = grants[j];
29
- // Only writers can conflict with each other.
30
- if (a.authority !== "write-scoped" || b.authority !== "write-scoped")
31
- continue;
32
- const writeA = a.allowedPaths;
33
- const writeB = b.allowedPaths;
34
- const overlap = hasOverlap(writeA, writeB);
35
- if (overlap.overlaps) {
36
- conflicts.push({
37
- lanes: [a.laneId, b.laneId],
38
- overlappingPath: overlap.path,
39
- severity: "merge-blocked",
40
- suggestion: `Serialize lanes ${a.laneId} and ${b.laneId}, or split write scopes so they do not overlap at ${overlap.path}.`,
41
- });
42
- }
43
- }
44
- // Any grant writing to a blocked path is a merge-blocker.
45
- const grant = grants[i];
46
- for (const allowed of grant.allowedPaths) {
47
- for (const blocked of grant.blockedPaths) {
48
- if (pathsOverlap(allowed, blocked)) {
49
- conflicts.push({
50
- lanes: [grant.laneId, grant.laneId],
51
- overlappingPath: blocked,
52
- severity: "merge-blocked",
53
- suggestion: `Remove ${blocked} from allowedPaths or add an exception; it overlaps blockedPaths in ${grant.laneId}.`,
54
- });
55
- }
56
- }
57
- }
58
- }
59
- return {
60
- grants,
61
- conflicts,
62
- mergeBlocked: conflicts.some((c) => c.severity === "merge-blocked"),
63
- evidencePath,
64
- };
65
- }
66
- export function formatAuditReport(report) {
67
- const lines = [
68
- `# Lane Grant Audit Report`,
69
- "",
70
- `- Lanes audited: ${report.grants.length}`,
71
- `- Conflicts detected: ${report.conflicts.length}`,
72
- `- Merge blocked: ${report.mergeBlocked ? "YES" : "NO"}`,
73
- "",
74
- ];
75
- if (report.conflicts.length === 0) {
76
- lines.push("No path conflicts detected.");
77
- }
78
- else {
79
- lines.push("## Conflicts");
80
- for (const conflict of report.conflicts) {
81
- lines.push(`- **${conflict.severity.toUpperCase()}** \`${conflict.lanes.join(" ↔ ")}\` at \`${conflict.overlappingPath}\``);
82
- lines.push(` - Suggestion: ${conflict.suggestion}`);
83
- }
84
- }
85
- return lines.join("\n");
86
- }
87
- //# sourceMappingURL=lane-grant-auditor.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane-grant-auditor.js","sourceRoot":"","sources":["../../src/orchestration/lane-grant-auditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAGtC,SAAS,YAAY,CAAC,CAAS,EAAE,CAAS,EAAW;IACpD,MAAM,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IAC7D,MAAM,WAAW,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAA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AI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,KAAK,eAAe,CAAC;QACnE,YAAY;KACZ,CAAC;AAAA,CACF;AAED,MAAM,UAAU,iBAAiB,CAAC,MAA4B,EAAU;IACvE,MAAM,KAAK,GAAa;QACvB,2BAA2B;QAC3B,EAAE;QACF,oBAAoB,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE;QAC1C,yBAAyB,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE;QAClD,oBAAoB,MAAM,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,EAAE;QACxD,EAAE;KACF,CAAC;IAEF,IAAI,MAAM,CAAC,SAAS,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACnC,KAAK,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;IAC3C,CAAC;SAAM,CAAC;QACP,KAAK,CAAC,IAAI,CAAC,cAAc,CAAC,CAAC;QAC3B,KAAK,MAAM,QAAQ,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;YACzC,KAAK,CAAC,IAAI,CACT,OAAO,QAAQ,CAAC,QAAQ,CAAC,WAAW,EAAE,QAAQ,QAAQ,CAAC,KAAK,CAAC,IAAI,CAAC,OAAK,CAAC,WAAW,QAAQ,CAAC,eAAe,IAAI,CAC/G,CAAC;YACF,KAAK,CAAC,IAAI,CAAC,mBAAmB,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACtD,CAAC;IACF,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAAA,CACxB","sourcesContent":["import { minimatch } from \"minimatch\";\nimport type { LaneGrant, LaneGrantAuditReport, PathConflict } from \"../types/lane-grant.ts\";\n\nfunction pathsOverlap(a: string, b: string): boolean {\n\tconst normalizedA = a.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\");\n\tconst normalizedB = b.replace(/\\\\/g, \"/\").replace(/\\/$/, \"\");\n\tif (normalizedA === normalizedB) return true;\n\tif (minimatch(normalizedA, normalizedB) || minimatch(normalizedB, normalizedA)) return true;\n\tif (normalizedA.startsWith(`${normalizedB}/`) || normalizedB.startsWith(`${normalizedA}/`)) return true;\n\treturn false;\n}\n\nfunction hasOverlap(scopesA: string[], scopesB: string[]): { overlaps: boolean; path: string } {\n\tfor (const a of scopesA) {\n\t\tfor (const b of scopesB) {\n\t\t\tif (pathsOverlap(a, b)) {\n\t\t\t\treturn { overlaps: true, path: a };\n\t\t\t}\n\t\t}\n\t}\n\treturn { overlaps: false, path: \"\" };\n}\n\nexport function auditLaneGrants(grants: LaneGrant[], evidencePath: string): LaneGrantAuditReport {\n\tconst conflicts: PathConflict[] = [];\n\n\tfor (let i = 0; i < grants.length; i++) {\n\t\tfor (let j = i + 1; j < grants.length; j++) {\n\t\t\tconst a = grants[i];\n\t\t\tconst b = grants[j];\n\n\t\t\t// Only writers can conflict with each other.\n\t\t\tif (a.authority !== \"write-scoped\" || b.authority !== \"write-scoped\") continue;\n\n\t\t\tconst writeA = a.allowedPaths;\n\t\t\tconst writeB = b.allowedPaths;\n\t\t\tconst overlap = hasOverlap(writeA, writeB);\n\n\t\t\tif (overlap.overlaps) {\n\t\t\t\tconflicts.push({\n\t\t\t\t\tlanes: [a.laneId, b.laneId],\n\t\t\t\t\toverlappingPath: overlap.path,\n\t\t\t\t\tseverity: \"merge-blocked\",\n\t\t\t\t\tsuggestion: `Serialize lanes ${a.laneId} and ${b.laneId}, or split write scopes so they do not overlap at ${overlap.path}.`,\n\t\t\t\t});\n\t\t\t}\n\t\t}\n\n\t\t// Any grant writing to a blocked path is a merge-blocker.\n\t\tconst grant = grants[i];\n\t\tfor (const allowed of grant.allowedPaths) {\n\t\t\tfor (const blocked of grant.blockedPaths) {\n\t\t\t\tif (pathsOverlap(allowed, blocked)) {\n\t\t\t\t\tconflicts.push({\n\t\t\t\t\t\tlanes: [grant.laneId, grant.laneId],\n\t\t\t\t\t\toverlappingPath: blocked,\n\t\t\t\t\t\tseverity: \"merge-blocked\",\n\t\t\t\t\t\tsuggestion: `Remove ${blocked} from allowedPaths or add an exception; it overlaps blockedPaths in ${grant.laneId}.`,\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn {\n\t\tgrants,\n\t\tconflicts,\n\t\tmergeBlocked: conflicts.some((c) => c.severity === \"merge-blocked\"),\n\t\tevidencePath,\n\t};\n}\n\nexport function formatAuditReport(report: LaneGrantAuditReport): string {\n\tconst lines: string[] = [\n\t\t`# Lane Grant Audit Report`,\n\t\t\"\",\n\t\t`- Lanes audited: ${report.grants.length}`,\n\t\t`- Conflicts detected: ${report.conflicts.length}`,\n\t\t`- Merge blocked: ${report.mergeBlocked ? \"YES\" : \"NO\"}`,\n\t\t\"\",\n\t];\n\n\tif (report.conflicts.length === 0) {\n\t\tlines.push(\"No path conflicts detected.\");\n\t} else {\n\t\tlines.push(\"## Conflicts\");\n\t\tfor (const conflict of report.conflicts) {\n\t\t\tlines.push(\n\t\t\t\t`- **${conflict.severity.toUpperCase()}** \\`${conflict.lanes.join(\" ↔ \")}\\` at \\`${conflict.overlappingPath}\\``,\n\t\t\t);\n\t\t\tlines.push(` - Suggestion: ${conflict.suggestion}`);\n\t\t}\n\t}\n\n\treturn lines.join(\"\\n\");\n}\n"]}
@@ -1,61 +0,0 @@
1
- /**
2
- * Unified guardrail types for OMK hard-fork runtime.
3
- *
4
- * Integrates Freedomd strict policy with OMK native extension-based
5
- * safety hooks (formerly hooks/). All tool/block decisions flow through
6
- * a single `GuardrailDecision` produced by the `FreedomdAdapter`.
7
- */
8
- export type ToolCategory = "destructive" | "network" | "secret_exposure" | "privilege_escalation" | "filesystem" | "shell" | "unknown";
9
- export type BlockOrigin = "freedomd" | "omk_extension" | "unified_policy";
10
- export interface GuardrailRule {
11
- /** Unique rule identifier (kebab-case). */
12
- id: string;
13
- /** Human-readable description of what is being blocked. */
14
- description: string;
15
- /** Risk category for audit logs. */
16
- category: ToolCategory;
17
- /** Where this rule originated. */
18
- origin: BlockOrigin;
19
- /** Optional glob or regex matched against tool input. */
20
- pattern?: string;
21
- /** Optional exact tool name to match. */
22
- toolName?: string;
23
- /** When true the rule is active. */
24
- enabled: boolean;
25
- }
26
- export interface GuardrailPolicy {
27
- version: string;
28
- /** Default action when no rule matches. */
29
- defaultAction: "allow" | "deny";
30
- /** Ordered list of unified rules. */
31
- rules: GuardrailRule[];
32
- }
33
- export interface GuardrailDecision {
34
- allowed: boolean;
35
- /** Matched rule, if any. */
36
- rule?: GuardrailRule;
37
- /** Human-readable reason for the decision. */
38
- reason?: string;
39
- /** Suggested safe alternative, if blocked. */
40
- suggestion?: string;
41
- }
42
- export interface GuardrailAuditEvent {
43
- /** ISO-8601 timestamp. */
44
- timestamp: string;
45
- /** Goal or session identifier. */
46
- goalId?: string;
47
- /** Tool name that was evaluated. */
48
- toolName: string;
49
- /** Tool input that was evaluated (sanitized, no secrets). */
50
- toolInput: string;
51
- /** Final decision. */
52
- decision: GuardrailDecision;
53
- }
54
- export interface FreedomdAdapter {
55
- /**
56
- * Evaluate a tool call against the unified policy.
57
- * @returns a `GuardrailDecision` and optionally emits an audit event.
58
- */
59
- evaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision>;
60
- }
61
- //# sourceMappingURL=guardrails.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guardrails.d.ts","sourceRoot":"","sources":["../../src/types/guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,YAAY,GACrB,aAAa,GACb,SAAS,GACT,iBAAiB,GACjB,sBAAsB,GACtB,YAAY,GACZ,OAAO,GACP,SAAS,CAAC;AAEb,MAAM,MAAM,WAAW,GAAG,UAAU,GAAG,eAAe,GAAG,gBAAgB,CAAC;AAE1E,MAAM,WAAW,aAAa;IAC7B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IACX,2DAA2D;IAC3D,WAAW,EAAE,MAAM,CAAC;IACpB,oCAAoC;IACpC,QAAQ,EAAE,YAAY,CAAC;IACvB,kCAAkC;IAClC,MAAM,EAAE,WAAW,CAAC;IACpB,yDAAyD;IACzD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oCAAoC;IACpC,OAAO,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,eAAe;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,2CAA2C;IAC3C,aAAa,EAAE,OAAO,GAAG,MAAM,CAAC;IAChC,qCAAqC;IACrC,KAAK,EAAE,aAAa,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,iBAAiB;IACjC,OAAO,EAAE,OAAO,CAAC;IACjB,4BAA4B;IAC5B,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,8CAA8C;IAC9C,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,8CAA8C;IAC9C,UAAU,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,mBAAmB;IACnC,0BAA0B;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,kCAAkC;IAClC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,QAAQ,EAAE,MAAM,CAAC;IACjB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB;IACtB,QAAQ,EAAE,iBAAiB,CAAC;CAC5B;AAED,MAAM,WAAW,eAAe;IAC/B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC3E","sourcesContent":["/**\n * Unified guardrail types for OMK hard-fork runtime.\n *\n * Integrates Freedomd strict policy with OMK native extension-based\n * safety hooks (formerly hooks/). All tool/block decisions flow through\n * a single `GuardrailDecision` produced by the `FreedomdAdapter`.\n */\n\nexport type ToolCategory =\n\t| \"destructive\"\n\t| \"network\"\n\t| \"secret_exposure\"\n\t| \"privilege_escalation\"\n\t| \"filesystem\"\n\t| \"shell\"\n\t| \"unknown\";\n\nexport type BlockOrigin = \"freedomd\" | \"omk_extension\" | \"unified_policy\";\n\nexport interface GuardrailRule {\n\t/** Unique rule identifier (kebab-case). */\n\tid: string;\n\t/** Human-readable description of what is being blocked. */\n\tdescription: string;\n\t/** Risk category for audit logs. */\n\tcategory: ToolCategory;\n\t/** Where this rule originated. */\n\torigin: BlockOrigin;\n\t/** Optional glob or regex matched against tool input. */\n\tpattern?: string;\n\t/** Optional exact tool name to match. */\n\ttoolName?: string;\n\t/** When true the rule is active. */\n\tenabled: boolean;\n}\n\nexport interface GuardrailPolicy {\n\tversion: string;\n\t/** Default action when no rule matches. */\n\tdefaultAction: \"allow\" | \"deny\";\n\t/** Ordered list of unified rules. */\n\trules: GuardrailRule[];\n}\n\nexport interface GuardrailDecision {\n\tallowed: boolean;\n\t/** Matched rule, if any. */\n\trule?: GuardrailRule;\n\t/** Human-readable reason for the decision. */\n\treason?: string;\n\t/** Suggested safe alternative, if blocked. */\n\tsuggestion?: string;\n}\n\nexport interface GuardrailAuditEvent {\n\t/** ISO-8601 timestamp. */\n\ttimestamp: string;\n\t/** Goal or session identifier. */\n\tgoalId?: string;\n\t/** Tool name that was evaluated. */\n\ttoolName: string;\n\t/** Tool input that was evaluated (sanitized, no secrets). */\n\ttoolInput: string;\n\t/** Final decision. */\n\tdecision: GuardrailDecision;\n}\n\nexport interface FreedomdAdapter {\n\t/**\n\t * Evaluate a tool call against the unified policy.\n\t * @returns a `GuardrailDecision` and optionally emits an audit event.\n\t */\n\tevaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision>;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /**
2
- * Unified guardrail types for OMK hard-fork runtime.
3
- *
4
- * Integrates Freedomd strict policy with OMK native extension-based
5
- * safety hooks (formerly hooks/). All tool/block decisions flow through
6
- * a single `GuardrailDecision` produced by the `FreedomdAdapter`.
7
- */
8
- export {};
9
- //# sourceMappingURL=guardrails.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"guardrails.js","sourceRoot":"","sources":["../../src/types/guardrails.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Unified guardrail types for OMK hard-fork runtime.\n *\n * Integrates Freedomd strict policy with OMK native extension-based\n * safety hooks (formerly hooks/). All tool/block decisions flow through\n * a single `GuardrailDecision` produced by the `FreedomdAdapter`.\n */\n\nexport type ToolCategory =\n\t| \"destructive\"\n\t| \"network\"\n\t| \"secret_exposure\"\n\t| \"privilege_escalation\"\n\t| \"filesystem\"\n\t| \"shell\"\n\t| \"unknown\";\n\nexport type BlockOrigin = \"freedomd\" | \"omk_extension\" | \"unified_policy\";\n\nexport interface GuardrailRule {\n\t/** Unique rule identifier (kebab-case). */\n\tid: string;\n\t/** Human-readable description of what is being blocked. */\n\tdescription: string;\n\t/** Risk category for audit logs. */\n\tcategory: ToolCategory;\n\t/** Where this rule originated. */\n\torigin: BlockOrigin;\n\t/** Optional glob or regex matched against tool input. */\n\tpattern?: string;\n\t/** Optional exact tool name to match. */\n\ttoolName?: string;\n\t/** When true the rule is active. */\n\tenabled: boolean;\n}\n\nexport interface GuardrailPolicy {\n\tversion: string;\n\t/** Default action when no rule matches. */\n\tdefaultAction: \"allow\" | \"deny\";\n\t/** Ordered list of unified rules. */\n\trules: GuardrailRule[];\n}\n\nexport interface GuardrailDecision {\n\tallowed: boolean;\n\t/** Matched rule, if any. */\n\trule?: GuardrailRule;\n\t/** Human-readable reason for the decision. */\n\treason?: string;\n\t/** Suggested safe alternative, if blocked. */\n\tsuggestion?: string;\n}\n\nexport interface GuardrailAuditEvent {\n\t/** ISO-8601 timestamp. */\n\ttimestamp: string;\n\t/** Goal or session identifier. */\n\tgoalId?: string;\n\t/** Tool name that was evaluated. */\n\ttoolName: string;\n\t/** Tool input that was evaluated (sanitized, no secrets). */\n\ttoolInput: string;\n\t/** Final decision. */\n\tdecision: GuardrailDecision;\n}\n\nexport interface FreedomdAdapter {\n\t/**\n\t * Evaluate a tool call against the unified policy.\n\t * @returns a `GuardrailDecision` and optionally emits an audit event.\n\t */\n\tevaluate(toolName: string, toolInput: unknown): Promise<GuardrailDecision>;\n}\n"]}
@@ -1,58 +0,0 @@
1
- /**
2
- * Lane grant schema for OMK subagent isolation.
3
- *
4
- * Mirrors the lane grant contract defined in `.omk/agent/AGENTS.md`.
5
- * Used by the lane-grant auditor to detect parallel writer conflicts
6
- * before merge.
7
- */
8
- export type AgentRole = "planner" | "explorer" | "coder" | "tester" | "reviewer" | "security" | "memory" | "synthesizer" | "architect" | "devops" | "qa";
9
- export type AuthorityLevel = "read-only" | "advisory" | "write-scoped" | "execute-tests" | "review-only" | "memory-write";
10
- export interface LaneGrant {
11
- /** Unique lane identifier. */
12
- laneId: string;
13
- /** Agent role / type. */
14
- agent: AgentRole;
15
- /** Task node this lane executes. */
16
- taskNodeId: string;
17
- /** Plain-language allowed scope. */
18
- scope: string;
19
- /** Authority level. */
20
- authority: AuthorityLevel;
21
- /** Paths the lane may read. */
22
- allowedPaths: string[];
23
- /** Paths the lane must never touch. */
24
- blockedPaths: string[];
25
- /** Skill names available to the lane. */
26
- skills: string[];
27
- /** Hook/extension scripts active for the lane. */
28
- hooks: string[];
29
- /** MCP servers available to the lane. */
30
- mcp: string[];
31
- /** Measurable pass criteria. */
32
- acceptance: string[];
33
- /** Path where the lane writes evidence. */
34
- evidenceOutput: string;
35
- /** Explicitly forbidden actions. */
36
- forbiddenActions: string[];
37
- }
38
- export interface PathConflict {
39
- /** Lanes whose write scopes overlap. */
40
- lanes: [string, string];
41
- /** Overlapping path or directory subtree. */
42
- overlappingPath: string;
43
- /** Severity: advisory or merge-blocked. */
44
- severity: "advisory" | "merge-blocked";
45
- /** Suggested resolution. */
46
- suggestion: string;
47
- }
48
- export interface LaneGrantAuditReport {
49
- /** Lane grants that were audited. */
50
- grants: LaneGrant[];
51
- /** Detected conflicts. */
52
- conflicts: PathConflict[];
53
- /** Merge-blocked if any conflict has severity merge-blocked. */
54
- mergeBlocked: boolean;
55
- /** Evidence artifact path. */
56
- evidencePath: string;
57
- }
58
- //# sourceMappingURL=lane-grant.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane-grant.d.ts","sourceRoot":"","sources":["../../src/types/lane-grant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,MAAM,MAAM,SAAS,GAClB,SAAS,GACT,UAAU,GACV,OAAO,GACP,QAAQ,GACR,UAAU,GACV,UAAU,GACV,QAAQ,GACR,aAAa,GACb,WAAW,GACX,QAAQ,GACR,IAAI,CAAC;AAER,MAAM,MAAM,cAAc,GACvB,WAAW,GACX,UAAU,GACV,cAAc,GACd,eAAe,GACf,aAAa,GACb,cAAc,CAAC;AAElB,MAAM,WAAW,SAAS;IACzB,8BAA8B;IAC9B,MAAM,EAAE,MAAM,CAAC;IACf,yBAAyB;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,oCAAoC;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,oCAAoC;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,SAAS,EAAE,cAAc,CAAC;IAC1B,+BAA+B;IAC/B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,uCAAuC;IACvC,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,yCAAyC;IACzC,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,kDAAkD;IAClD,KAAK,EAAE,MAAM,EAAE,CAAC;IAChB,yCAAyC;IACzC,GAAG,EAAE,MAAM,EAAE,CAAC;IACd,gCAAgC;IAChC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,2CAA2C;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,oCAAoC;IACpC,gBAAgB,EAAE,MAAM,EAAE,CAAC;CAC3B;AAED,MAAM,WAAW,YAAY;IAC5B,wCAAwC;IACxC,KAAK,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxB,6CAA6C;IAC7C,eAAe,EAAE,MAAM,CAAC;IACxB,2CAA2C;IAC3C,QAAQ,EAAE,UAAU,GAAG,eAAe,CAAC;IACvC,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACpC,qCAAqC;IACrC,MAAM,EAAE,SAAS,EAAE,CAAC;IACpB,0BAA0B;IAC1B,SAAS,EAAE,YAAY,EAAE,CAAC;IAC1B,gEAAgE;IAChE,YAAY,EAAE,OAAO,CAAC;IACtB,8BAA8B;IAC9B,YAAY,EAAE,MAAM,CAAC;CACrB","sourcesContent":["/**\n * Lane grant schema for OMK subagent isolation.\n *\n * Mirrors the lane grant contract defined in `.omk/agent/AGENTS.md`.\n * Used by the lane-grant auditor to detect parallel writer conflicts\n * before merge.\n */\n\nexport type AgentRole =\n\t| \"planner\"\n\t| \"explorer\"\n\t| \"coder\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"security\"\n\t| \"memory\"\n\t| \"synthesizer\"\n\t| \"architect\"\n\t| \"devops\"\n\t| \"qa\";\n\nexport type AuthorityLevel =\n\t| \"read-only\"\n\t| \"advisory\"\n\t| \"write-scoped\"\n\t| \"execute-tests\"\n\t| \"review-only\"\n\t| \"memory-write\";\n\nexport interface LaneGrant {\n\t/** Unique lane identifier. */\n\tlaneId: string;\n\t/** Agent role / type. */\n\tagent: AgentRole;\n\t/** Task node this lane executes. */\n\ttaskNodeId: string;\n\t/** Plain-language allowed scope. */\n\tscope: string;\n\t/** Authority level. */\n\tauthority: AuthorityLevel;\n\t/** Paths the lane may read. */\n\tallowedPaths: string[];\n\t/** Paths the lane must never touch. */\n\tblockedPaths: string[];\n\t/** Skill names available to the lane. */\n\tskills: string[];\n\t/** Hook/extension scripts active for the lane. */\n\thooks: string[];\n\t/** MCP servers available to the lane. */\n\tmcp: string[];\n\t/** Measurable pass criteria. */\n\tacceptance: string[];\n\t/** Path where the lane writes evidence. */\n\tevidenceOutput: string;\n\t/** Explicitly forbidden actions. */\n\tforbiddenActions: string[];\n}\n\nexport interface PathConflict {\n\t/** Lanes whose write scopes overlap. */\n\tlanes: [string, string];\n\t/** Overlapping path or directory subtree. */\n\toverlappingPath: string;\n\t/** Severity: advisory or merge-blocked. */\n\tseverity: \"advisory\" | \"merge-blocked\";\n\t/** Suggested resolution. */\n\tsuggestion: string;\n}\n\nexport interface LaneGrantAuditReport {\n\t/** Lane grants that were audited. */\n\tgrants: LaneGrant[];\n\t/** Detected conflicts. */\n\tconflicts: PathConflict[];\n\t/** Merge-blocked if any conflict has severity merge-blocked. */\n\tmergeBlocked: boolean;\n\t/** Evidence artifact path. */\n\tevidencePath: string;\n}\n"]}
@@ -1,9 +0,0 @@
1
- /**
2
- * Lane grant schema for OMK subagent isolation.
3
- *
4
- * Mirrors the lane grant contract defined in `.omk/agent/AGENTS.md`.
5
- * Used by the lane-grant auditor to detect parallel writer conflicts
6
- * before merge.
7
- */
8
- export {};
9
- //# sourceMappingURL=lane-grant.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"lane-grant.js","sourceRoot":"","sources":["../../src/types/lane-grant.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG","sourcesContent":["/**\n * Lane grant schema for OMK subagent isolation.\n *\n * Mirrors the lane grant contract defined in `.omk/agent/AGENTS.md`.\n * Used by the lane-grant auditor to detect parallel writer conflicts\n * before merge.\n */\n\nexport type AgentRole =\n\t| \"planner\"\n\t| \"explorer\"\n\t| \"coder\"\n\t| \"tester\"\n\t| \"reviewer\"\n\t| \"security\"\n\t| \"memory\"\n\t| \"synthesizer\"\n\t| \"architect\"\n\t| \"devops\"\n\t| \"qa\";\n\nexport type AuthorityLevel =\n\t| \"read-only\"\n\t| \"advisory\"\n\t| \"write-scoped\"\n\t| \"execute-tests\"\n\t| \"review-only\"\n\t| \"memory-write\";\n\nexport interface LaneGrant {\n\t/** Unique lane identifier. */\n\tlaneId: string;\n\t/** Agent role / type. */\n\tagent: AgentRole;\n\t/** Task node this lane executes. */\n\ttaskNodeId: string;\n\t/** Plain-language allowed scope. */\n\tscope: string;\n\t/** Authority level. */\n\tauthority: AuthorityLevel;\n\t/** Paths the lane may read. */\n\tallowedPaths: string[];\n\t/** Paths the lane must never touch. */\n\tblockedPaths: string[];\n\t/** Skill names available to the lane. */\n\tskills: string[];\n\t/** Hook/extension scripts active for the lane. */\n\thooks: string[];\n\t/** MCP servers available to the lane. */\n\tmcp: string[];\n\t/** Measurable pass criteria. */\n\tacceptance: string[];\n\t/** Path where the lane writes evidence. */\n\tevidenceOutput: string;\n\t/** Explicitly forbidden actions. */\n\tforbiddenActions: string[];\n}\n\nexport interface PathConflict {\n\t/** Lanes whose write scopes overlap. */\n\tlanes: [string, string];\n\t/** Overlapping path or directory subtree. */\n\toverlappingPath: string;\n\t/** Severity: advisory or merge-blocked. */\n\tseverity: \"advisory\" | \"merge-blocked\";\n\t/** Suggested resolution. */\n\tsuggestion: string;\n}\n\nexport interface LaneGrantAuditReport {\n\t/** Lane grants that were audited. */\n\tgrants: LaneGrant[];\n\t/** Detected conflicts. */\n\tconflicts: PathConflict[];\n\t/** Merge-blocked if any conflict has severity merge-blocked. */\n\tmergeBlocked: boolean;\n\t/** Evidence artifact path. */\n\tevidencePath: string;\n}\n"]}