@documentation-robotics/cli 0.1.13 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/README.md +74 -2
  2. package/dist/analysis/relationship-classifier.js +2 -9
  3. package/dist/analysis/relationship-classifier.js.map +2 -2
  4. package/dist/analyzers/call-graph-utils.js +2 -2
  5. package/dist/analyzers/call-graph-utils.js.map +2 -2
  6. package/dist/analyzers/cards/build.js +171 -0
  7. package/dist/analyzers/cards/build.js.map +7 -0
  8. package/dist/analyzers/cards/classify.js +42 -0
  9. package/dist/analyzers/cards/classify.js.map +7 -0
  10. package/dist/analyzers/cards/edge-index.js +44 -0
  11. package/dist/analyzers/cards/edge-index.js.map +7 -0
  12. package/dist/analyzers/cards/facts.js +46 -0
  13. package/dist/analyzers/cards/facts.js.map +7 -0
  14. package/dist/analyzers/cards/graph.js +42 -0
  15. package/dist/analyzers/cards/graph.js.map +7 -0
  16. package/dist/analyzers/cards/index.js +8 -0
  17. package/dist/analyzers/cards/index.js.map +7 -0
  18. package/dist/analyzers/cards/tier0.js +18 -0
  19. package/dist/analyzers/cards/tier0.js.map +7 -0
  20. package/dist/analyzers/cards/types.js +1 -0
  21. package/dist/analyzers/cards/types.js.map +7 -0
  22. package/dist/analyzers/cbm-analyzer.js +195 -171
  23. package/dist/analyzers/cbm-analyzer.js.map +2 -2
  24. package/dist/analyzers/cbm-responses.js +336 -0
  25. package/dist/analyzers/cbm-responses.js.map +7 -0
  26. package/dist/analyzers/edge-relationships.js +45 -0
  27. package/dist/analyzers/edge-relationships.js.map +7 -0
  28. package/dist/analyzers/mapping-loader.js +9 -0
  29. package/dist/analyzers/mapping-loader.js.map +2 -2
  30. package/dist/analyzers/tier0-rules.js +153 -0
  31. package/dist/analyzers/tier0-rules.js.map +7 -0
  32. package/dist/analyzers/types.js.map +1 -1
  33. package/dist/analyzers/verify-engine.js +22 -19
  34. package/dist/analyzers/verify-engine.js.map +2 -2
  35. package/dist/audit/relationships/ai/prompts.js +10 -10
  36. package/dist/audit/relationships/ai/prompts.js.map +2 -2
  37. package/dist/audit/relationships/analysis/layer-templates.js +52 -52
  38. package/dist/audit/relationships/analysis/layer-templates.js.map +1 -1
  39. package/dist/cli.js +112 -28
  40. package/dist/cli.js.map +3 -3
  41. package/dist/coding-agents/agents/claude-code.js +3 -1
  42. package/dist/coding-agents/agents/claude-code.js.map +2 -2
  43. package/dist/coding-agents/claude-code-client.js +2 -1
  44. package/dist/coding-agents/claude-code-client.js.map +2 -2
  45. package/dist/coding-agents/copilot-client.js +17 -12
  46. package/dist/coding-agents/copilot-client.js.map +2 -2
  47. package/dist/coding-agents/default-permissions.js +152 -0
  48. package/dist/coding-agents/default-permissions.js.map +7 -0
  49. package/dist/coding-agents/drbot-mcp.js +167 -0
  50. package/dist/coding-agents/drbot-mcp.js.map +7 -0
  51. package/dist/commands/add.js +12 -7
  52. package/dist/commands/add.js.map +2 -2
  53. package/dist/commands/analyzer.js +134 -23
  54. package/dist/commands/analyzer.js.map +2 -2
  55. package/dist/commands/audit.js +6 -6
  56. package/dist/commands/audit.js.map +2 -2
  57. package/dist/commands/changeset-verify.js +55 -0
  58. package/dist/commands/changeset-verify.js.map +7 -0
  59. package/dist/commands/changeset.js +261 -147
  60. package/dist/commands/changeset.js.map +2 -2
  61. package/dist/commands/delete.js +52 -19
  62. package/dist/commands/delete.js.map +3 -3
  63. package/dist/commands/element.js +3 -2
  64. package/dist/commands/element.js.map +2 -2
  65. package/dist/commands/farm.js +773 -0
  66. package/dist/commands/farm.js.map +7 -0
  67. package/dist/commands/init.js +11 -1
  68. package/dist/commands/init.js.map +2 -2
  69. package/dist/commands/mcp.js +122 -0
  70. package/dist/commands/mcp.js.map +7 -0
  71. package/dist/commands/relationship.js +251 -47
  72. package/dist/commands/relationship.js.map +2 -2
  73. package/dist/commands/reports.js +1 -1
  74. package/dist/commands/reports.js.map +2 -2
  75. package/dist/commands/update.js +56 -24
  76. package/dist/commands/update.js.map +2 -2
  77. package/dist/commands/upgrade.js +99 -11
  78. package/dist/commands/upgrade.js.map +3 -3
  79. package/dist/commands/validate.js +41 -3
  80. package/dist/commands/validate.js.map +2 -2
  81. package/dist/commands/version.js +2 -2
  82. package/dist/commands/version.js.map +2 -2
  83. package/dist/commands/visualize.js +4 -3
  84. package/dist/commands/visualize.js.map +2 -2
  85. package/dist/config.js +83 -0
  86. package/dist/config.js.map +7 -0
  87. package/dist/core/annotation-store.js +138 -0
  88. package/dist/core/annotation-store.js.map +7 -0
  89. package/dist/core/catalog-migration.js +33 -0
  90. package/dist/core/catalog-migration.js.map +7 -0
  91. package/dist/core/changeset-analysis.js +421 -0
  92. package/dist/core/changeset-analysis.js.map +7 -0
  93. package/dist/core/changeset-base-index.js +153 -0
  94. package/dist/core/changeset-base-index.js.map +7 -0
  95. package/dist/core/changeset-brief-delta.js +102 -0
  96. package/dist/core/changeset-brief-delta.js.map +7 -0
  97. package/dist/core/changeset-graph.js +281 -0
  98. package/dist/core/changeset-graph.js.map +7 -0
  99. package/dist/core/changeset-only-guard.js +32 -0
  100. package/dist/core/changeset-only-guard.js.map +7 -0
  101. package/dist/core/changeset-summary.js +68 -0
  102. package/dist/core/changeset-summary.js.map +7 -0
  103. package/dist/core/changeset-validator.js +66 -20
  104. package/dist/core/changeset-validator.js.map +2 -2
  105. package/dist/core/changeset-verify.js +518 -0
  106. package/dist/core/changeset-verify.js.map +7 -0
  107. package/dist/core/changeset.js +56 -9
  108. package/dist/core/changeset.js.map +2 -2
  109. package/dist/core/element-type-migration.js +145 -0
  110. package/dist/core/element-type-migration.js.map +7 -0
  111. package/dist/core/farm-manifest.js +140 -0
  112. package/dist/core/farm-manifest.js.map +7 -0
  113. package/dist/core/farm-sync-engine.js +346 -0
  114. package/dist/core/farm-sync-engine.js.map +7 -0
  115. package/dist/core/farm-sync-state.js +167 -0
  116. package/dist/core/farm-sync-state.js.map +7 -0
  117. package/dist/core/manifest.js +6 -3
  118. package/dist/core/manifest.js.map +2 -2
  119. package/dist/core/migration-registry.js +84 -1
  120. package/dist/core/migration-registry.js.map +2 -2
  121. package/dist/core/model-upgrade.js +102 -0
  122. package/dist/core/model-upgrade.js.map +7 -0
  123. package/dist/core/model.js +257 -44
  124. package/dist/core/model.js.map +3 -3
  125. package/dist/core/mutation-handler.js +71 -6
  126. package/dist/core/mutation-handler.js.map +2 -2
  127. package/dist/core/relationship-migration-table.js +6639 -0
  128. package/dist/core/relationship-migration-table.js.map +7 -0
  129. package/dist/core/relationship-migration.js +272 -0
  130. package/dist/core/relationship-migration.js.map +7 -0
  131. package/dist/core/relationship-prune.js +49 -0
  132. package/dist/core/relationship-prune.js.map +7 -0
  133. package/dist/core/relationship-staging.js +68 -0
  134. package/dist/core/relationship-staging.js.map +7 -0
  135. package/dist/core/relationships.js +26 -4
  136. package/dist/core/relationships.js.map +2 -2
  137. package/dist/core/report-data-model.js +7 -13
  138. package/dist/core/report-data-model.js.map +2 -2
  139. package/dist/core/staged-changeset-storage.js +64 -17
  140. package/dist/core/staged-changeset-storage.js.map +2 -2
  141. package/dist/core/staged-source-reference.js +28 -0
  142. package/dist/core/staged-source-reference.js.map +7 -0
  143. package/dist/core/staging-area.js +83 -18
  144. package/dist/core/staging-area.js.map +2 -2
  145. package/dist/core/virtual-projection.js +14 -5
  146. package/dist/core/virtual-projection.js.map +2 -2
  147. package/dist/export/archimate-exporter.js +1 -0
  148. package/dist/export/archimate-exporter.js.map +2 -2
  149. package/dist/generated/compiled-validators.js +2 -2
  150. package/dist/generated/compiled-validators.js.map +2 -2
  151. package/dist/generated/layer-registry.js +16 -16
  152. package/dist/generated/layer-registry.js.map +2 -2
  153. package/dist/generated/node-types.js +186 -168
  154. package/dist/generated/node-types.js.map +2 -2
  155. package/dist/generated/relationship-index.js +2209 -7727
  156. package/dist/generated/relationship-index.js.map +2 -2
  157. package/dist/integrations/claude_code/agents/dr-architect.md +16 -3
  158. package/dist/integrations/claude_code/agents/dr-extractor.md +1 -1
  159. package/dist/integrations/claude_code/commands/dr-analyzer.md +565 -0
  160. package/dist/integrations/claude_code/commands/dr-map.md +13 -0
  161. package/dist/integrations/claude_code/commands/dr-plan.md +40 -0
  162. package/dist/integrations/claude_code/commands/dr-relate.md +106 -96
  163. package/dist/integrations/claude_code/commands/dr-verify.md +45 -2
  164. package/dist/integrations/claude_code/docs/END_TO_END_WALKTHROUGH.md +14 -0
  165. package/dist/integrations/claude_code/docs/MCP_SERVER.md +79 -0
  166. package/dist/integrations/claude_code/docs/QUICK_START.md +37 -8
  167. package/dist/integrations/claude_code/docs/README.md +52 -1
  168. package/dist/integrations/claude_code/skills/dr_01_motivation_layer/SKILL.md +93 -72
  169. package/dist/integrations/claude_code/skills/dr_02_business_layer/SKILL.md +163 -126
  170. package/dist/integrations/claude_code/skills/dr_03_product_layer/SKILL.md +161 -126
  171. package/dist/integrations/claude_code/skills/dr_04_security_layer/SKILL.md +153 -133
  172. package/dist/integrations/claude_code/skills/dr_05_application_layer/SKILL.md +129 -100
  173. package/dist/integrations/claude_code/skills/dr_06_technology_layer/SKILL.md +111 -94
  174. package/dist/integrations/claude_code/skills/dr_07_api_layer/SKILL.md +143 -157
  175. package/dist/integrations/claude_code/skills/dr_08_data_model_layer/SKILL.md +117 -33
  176. package/dist/integrations/claude_code/skills/dr_09_dataset_layer/SKILL.md +74 -25
  177. package/dist/integrations/claude_code/skills/dr_10_ux_layer/SKILL.md +88 -12
  178. package/dist/integrations/claude_code/skills/dr_11_navigation_layer/SKILL.md +83 -24
  179. package/dist/integrations/claude_code/skills/dr_12_apm_layer/SKILL.md +57 -12
  180. package/dist/integrations/claude_code/skills/dr_13_testing_layer/SKILL.md +92 -15
  181. package/dist/integrations/claude_code/skills/dr_change_planning/SKILL.md +119 -0
  182. package/dist/integrations/claude_code/skills/dr_changeset_reviewer/SKILL.md +3 -0
  183. package/dist/integrations/claude_code/skills/dr_engineering_guide/SKILL.md +1 -1
  184. package/dist/integrations/github_copilot/agents/dr-architect.md +1 -1
  185. package/dist/integrations/github_copilot/skills/dr_01_motivation_layer/SKILL.md +182 -102
  186. package/dist/integrations/github_copilot/skills/dr_02_business_layer/SKILL.md +266 -148
  187. package/dist/integrations/github_copilot/skills/dr_03_product_layer/SKILL.md +547 -86
  188. package/dist/integrations/github_copilot/skills/dr_04_security_layer/SKILL.md +164 -169
  189. package/dist/integrations/github_copilot/skills/dr_05_application_layer/SKILL.md +420 -150
  190. package/dist/integrations/github_copilot/skills/dr_06_technology_layer/SKILL.md +331 -138
  191. package/dist/integrations/github_copilot/skills/dr_07_api_layer/SKILL.md +265 -201
  192. package/dist/integrations/github_copilot/skills/dr_08_data_model_layer/SKILL.md +181 -58
  193. package/dist/integrations/github_copilot/skills/dr_09_dataset_layer/SKILL.md +209 -57
  194. package/dist/integrations/github_copilot/skills/dr_10_ux_layer/SKILL.md +277 -112
  195. package/dist/integrations/github_copilot/skills/dr_11_navigation_layer/SKILL.md +219 -70
  196. package/dist/integrations/github_copilot/skills/dr_12_apm_layer/SKILL.md +189 -105
  197. package/dist/integrations/github_copilot/skills/dr_13_testing_layer/SKILL.md +222 -102
  198. package/dist/integrations/github_copilot/skills/dr_change_planning/SKILL.md +119 -0
  199. package/dist/integrations/github_copilot/skills/dr_changeset_reviewer/SKILL.md +3 -0
  200. package/dist/integrations/hash-utils.js.map +2 -2
  201. package/dist/mcp/api-key-manager.js +111 -0
  202. package/dist/mcp/api-key-manager.js.map +7 -0
  203. package/dist/mcp/changeset-only.js +34 -0
  204. package/dist/mcp/changeset-only.js.map +7 -0
  205. package/dist/mcp/http-transport.js +176 -0
  206. package/dist/mcp/http-transport.js.map +7 -0
  207. package/dist/mcp/resource-registry.js +97 -0
  208. package/dist/mcp/resource-registry.js.map +7 -0
  209. package/dist/mcp/tool-registry.js +60 -0
  210. package/dist/mcp/tool-registry.js.map +7 -0
  211. package/dist/mcp/tools/annotation-create.js +39 -0
  212. package/dist/mcp/tools/annotation-create.js.map +7 -0
  213. package/dist/mcp/tools/annotation-delete.js +29 -0
  214. package/dist/mcp/tools/annotation-delete.js.map +7 -0
  215. package/dist/mcp/tools/annotation-get.js +29 -0
  216. package/dist/mcp/tools/annotation-get.js.map +7 -0
  217. package/dist/mcp/tools/annotation-list.js +24 -0
  218. package/dist/mcp/tools/annotation-list.js.map +7 -0
  219. package/dist/mcp/tools/annotation-reply.js +34 -0
  220. package/dist/mcp/tools/annotation-reply.js.map +7 -0
  221. package/dist/mcp/tools/annotation-shared.js +10 -0
  222. package/dist/mcp/tools/annotation-shared.js.map +7 -0
  223. package/dist/mcp/tools/annotation-update.js +39 -0
  224. package/dist/mcp/tools/annotation-update.js.map +7 -0
  225. package/dist/mcp/tools/changeset-analysis-tools.js +78 -0
  226. package/dist/mcp/tools/changeset-analysis-tools.js.map +7 -0
  227. package/dist/mcp/tools/changeset-editing.js +184 -0
  228. package/dist/mcp/tools/changeset-editing.js.map +7 -0
  229. package/dist/mcp/tools/changeset-lifecycle.js +83 -0
  230. package/dist/mcp/tools/changeset-lifecycle.js.map +7 -0
  231. package/dist/mcp/tools/changeset-list.js +33 -0
  232. package/dist/mcp/tools/changeset-list.js.map +7 -0
  233. package/dist/mcp/tools/changeset-shared.js +31 -0
  234. package/dist/mcp/tools/changeset-shared.js.map +7 -0
  235. package/dist/mcp/tools/changeset-show.js +55 -0
  236. package/dist/mcp/tools/changeset-show.js.map +7 -0
  237. package/dist/mcp/tools/changeset-verify.js +43 -0
  238. package/dist/mcp/tools/changeset-verify.js.map +7 -0
  239. package/dist/mcp/tools/chat-launch.js +50 -0
  240. package/dist/mcp/tools/chat-launch.js.map +7 -0
  241. package/dist/mcp/tools/chat-status.js +26 -0
  242. package/dist/mcp/tools/chat-status.js.map +7 -0
  243. package/dist/mcp/tools/index.js +65 -0
  244. package/dist/mcp/tools/index.js.map +7 -0
  245. package/dist/mcp/tools/model-add.js +107 -0
  246. package/dist/mcp/tools/model-add.js.map +7 -0
  247. package/dist/mcp/tools/model-delete.js +99 -0
  248. package/dist/mcp/tools/model-delete.js.map +7 -0
  249. package/dist/mcp/tools/model-export.js +72 -0
  250. package/dist/mcp/tools/model-export.js.map +7 -0
  251. package/dist/mcp/tools/model-info.js +51 -0
  252. package/dist/mcp/tools/model-info.js.map +7 -0
  253. package/dist/mcp/tools/model-list.js +53 -0
  254. package/dist/mcp/tools/model-list.js.map +7 -0
  255. package/dist/mcp/tools/model-reload.js +34 -0
  256. package/dist/mcp/tools/model-reload.js.map +7 -0
  257. package/dist/mcp/tools/model-search.js +102 -0
  258. package/dist/mcp/tools/model-search.js.map +7 -0
  259. package/dist/mcp/tools/model-show.js +68 -0
  260. package/dist/mcp/tools/model-show.js.map +7 -0
  261. package/dist/mcp/tools/model-stats.js +22 -0
  262. package/dist/mcp/tools/model-stats.js.map +7 -0
  263. package/dist/mcp/tools/model-trace.js +118 -0
  264. package/dist/mcp/tools/model-trace.js.map +7 -0
  265. package/dist/mcp/tools/model-update.js +121 -0
  266. package/dist/mcp/tools/model-update.js.map +7 -0
  267. package/dist/mcp/tools/model-validate.js +78 -0
  268. package/dist/mcp/tools/model-validate.js.map +7 -0
  269. package/dist/mcp/tools/relationship-tools.js +98 -0
  270. package/dist/mcp/tools/relationship-tools.js.map +7 -0
  271. package/dist/mcp/tools/shared.js +126 -0
  272. package/dist/mcp/tools/shared.js.map +7 -0
  273. package/dist/mcp/tools/spec-type.js +90 -0
  274. package/dist/mcp/tools/spec-type.js.map +7 -0
  275. package/dist/reports/model-layer-report-generator.js +5 -3
  276. package/dist/reports/model-layer-report-generator.js.map +2 -2
  277. package/dist/reports/model-readme-generator.js +116 -0
  278. package/dist/reports/model-readme-generator.js.map +7 -0
  279. package/dist/reports/model-report-data.js +37 -1
  280. package/dist/reports/model-report-data.js.map +2 -2
  281. package/dist/reports/model-report-orchestrator.js +29 -6
  282. package/dist/reports/model-report-orchestrator.js.map +2 -2
  283. package/dist/reports/model-report-utils.js +9 -0
  284. package/dist/reports/model-report-utils.js.map +7 -0
  285. package/dist/schemas/bundled/analyzers/cbm.json +1186 -68
  286. package/dist/schemas/bundled/analyzers/manifest.json +2 -2
  287. package/dist/schemas/bundled/api.json +1029 -1658
  288. package/dist/schemas/bundled/apm.json +499 -734
  289. package/dist/schemas/bundled/application.json +745 -370
  290. package/dist/schemas/bundled/base.json +3 -220
  291. package/dist/schemas/bundled/business.json +452 -366
  292. package/dist/schemas/bundled/data-model.json +403 -383
  293. package/dist/schemas/bundled/data-store.json +334 -558
  294. package/dist/schemas/bundled/manifest.json +18 -18
  295. package/dist/schemas/bundled/motivation.json +349 -368
  296. package/dist/schemas/bundled/navigation.json +415 -731
  297. package/dist/schemas/bundled/product.json +325 -159
  298. package/dist/schemas/bundled/security.json +864 -1232
  299. package/dist/schemas/bundled/technology.json +574 -703
  300. package/dist/schemas/bundled/testing.json +718 -1643
  301. package/dist/schemas/bundled/ux.json +739 -1352
  302. package/dist/server/schemas.js +8 -0
  303. package/dist/server/schemas.js.map +2 -2
  304. package/dist/server/server.js +234 -31
  305. package/dist/server/server.js.map +2 -2
  306. package/dist/server-entry.js +2 -1
  307. package/dist/server-entry.js.map +2 -2
  308. package/dist/telemetry/config.js +2 -40
  309. package/dist/telemetry/config.js.map +2 -2
  310. package/dist/telemetry/index.js +1 -1
  311. package/dist/types/index.js.map +2 -2
  312. package/dist/utils/ansi-suppressor.js +23 -0
  313. package/dist/utils/ansi-suppressor.js.map +7 -0
  314. package/dist/utils/attribute-patch.js +41 -0
  315. package/dist/utils/attribute-patch.js.map +7 -0
  316. package/dist/utils/color-utils.js +34 -0
  317. package/dist/utils/color-utils.js.map +7 -0
  318. package/dist/utils/element-reference-shape.js +15 -1
  319. package/dist/utils/element-reference-shape.js.map +3 -3
  320. package/dist/utils/error-hints.js +29 -0
  321. package/dist/utils/error-hints.js.map +7 -0
  322. package/dist/utils/errors.js +75 -10
  323. package/dist/utils/errors.js.map +2 -2
  324. package/dist/utils/globals.js +17 -1
  325. package/dist/utils/globals.js.map +2 -2
  326. package/dist/utils/project-paths.js +50 -3
  327. package/dist/utils/project-paths.js.map +2 -2
  328. package/dist/utils/reference-path-parser.js +49 -0
  329. package/dist/utils/reference-path-parser.js.map +7 -0
  330. package/dist/utils/source-reference.js +17 -10
  331. package/dist/utils/source-reference.js.map +2 -2
  332. package/dist/utils/spec-version.js +10 -2
  333. package/dist/utils/spec-version.js.map +2 -2
  334. package/dist/validators/composed-reference-validator.js +240 -0
  335. package/dist/validators/composed-reference-validator.js.map +7 -0
  336. package/dist/validators/reference-validator.js +57 -13
  337. package/dist/validators/reference-validator.js.map +3 -3
  338. package/dist/validators/relationship-schema-validator.js +33 -5
  339. package/dist/validators/relationship-schema-validator.js.map +3 -3
  340. package/dist/validators/schema-validator.js +27 -9
  341. package/dist/validators/schema-validator.js.map +2 -2
  342. package/dist/validators/types.js.map +1 -1
  343. package/dist/viewer/README.md +6 -6
  344. package/dist/viewer/assets/main-CxzcuU_o.js +84 -0
  345. package/dist/viewer/assets/main-j-7ULYpm.css +1 -0
  346. package/dist/viewer/index.html +2 -2
  347. package/dist/viewer/manifest.json +10 -10
  348. package/dist/viewer/version.json +1 -1
  349. package/package.json +7 -3
  350. package/dist/viewer/assets/main-B7AOQXXX.js +0 -81
  351. package/dist/viewer/assets/main-vdrFrG7q.css +0 -1
@@ -36,14 +36,14 @@ const LAYER_TEMPLATES = [
36
36
  {
37
37
  sourcePattern: "role",
38
38
  destinationPattern: "process",
39
- predicate: "performs",
40
- description: "Roles perform processes"
39
+ predicate: "assigned-to",
40
+ description: "Roles are assigned to the processes they perform"
41
41
  },
42
42
  {
43
- sourcePattern: "service",
44
- destinationPattern: "process",
43
+ sourcePattern: "process",
44
+ destinationPattern: "service",
45
45
  predicate: "realizes",
46
- description: "Services realize processes"
46
+ description: "Processes realize services"
47
47
  }
48
48
  ]
49
49
  },
@@ -53,15 +53,15 @@ const LAYER_TEMPLATES = [
53
53
  patterns: [
54
54
  {
55
55
  sourcePattern: "feature",
56
- destinationPattern: "capability",
56
+ destinationPattern: "softwarecapability",
57
57
  predicate: "realizes",
58
- description: "Features realize capabilities"
58
+ description: "Features realize software capabilities"
59
59
  },
60
60
  {
61
- sourcePattern: "capability",
61
+ sourcePattern: "softwarecapability",
62
62
  destinationPattern: "milestone",
63
63
  predicate: "scheduled-for",
64
- description: "Capabilities are scheduled for milestones"
64
+ description: "Software capabilities are scheduled for milestones"
65
65
  },
66
66
  {
67
67
  sourcePattern: "feature",
@@ -96,8 +96,8 @@ const LAYER_TEMPLATES = [
96
96
  {
97
97
  sourcePattern: "role",
98
98
  destinationPattern: "permission",
99
- predicate: "authorizes",
100
- description: "Roles authorize permissions"
99
+ predicate: "aggregates",
100
+ description: "Roles aggregate the permissions they grant"
101
101
  },
102
102
  {
103
103
  sourcePattern: "policy",
@@ -148,10 +148,10 @@ const LAYER_TEMPLATES = [
148
148
  description: "Artifacts realize components"
149
149
  },
150
150
  {
151
- sourcePattern: "infrastructure",
152
- destinationPattern: "node",
153
- predicate: "hosts",
154
- description: "Infrastructure hosts nodes"
151
+ sourcePattern: "node",
152
+ destinationPattern: "systemsoftware",
153
+ predicate: "composes",
154
+ description: "Nodes compose the system software they run"
155
155
  }
156
156
  ]
157
157
  },
@@ -160,46 +160,46 @@ const LAYER_TEMPLATES = [
160
160
  standard: "OpenAPI 3.0",
161
161
  patterns: [
162
162
  {
163
- sourcePattern: "operation",
164
- destinationPattern: "schema",
165
- predicate: "references",
166
- description: "Operations reference schemas"
163
+ sourcePattern: "pathitem",
164
+ destinationPattern: "operation",
165
+ predicate: "composes",
166
+ description: "Path items compose their operations"
167
167
  },
168
168
  {
169
- sourcePattern: "securityscheme",
170
- destinationPattern: "operation",
171
- predicate: "serves",
172
- description: "Security schemes serve operations"
169
+ sourcePattern: "operation",
170
+ destinationPattern: "responses",
171
+ predicate: "composes",
172
+ description: "Operations compose their responses map"
173
173
  },
174
174
  {
175
- sourcePattern: "response",
175
+ sourcePattern: "mediatype",
176
176
  destinationPattern: "schema",
177
- predicate: "returns",
178
- description: "Responses return schemas"
177
+ predicate: "references",
178
+ description: "Media types reference their schema by $ref"
179
179
  }
180
180
  ]
181
181
  },
182
182
  {
183
183
  layer: "ux",
184
- standard: "React/Component",
184
+ standard: "HTML 5.3 / component libraries",
185
185
  patterns: [
186
186
  {
187
- sourcePattern: "component",
188
- destinationPattern: "component",
189
- predicate: "renders",
190
- description: "Components render other components"
187
+ sourcePattern: "view",
188
+ destinationPattern: "componentinstance",
189
+ predicate: "composes",
190
+ description: "Views compose the component instances placed in them"
191
191
  },
192
192
  {
193
- sourcePattern: "component",
194
- destinationPattern: "entity",
195
- predicate: "binds-to",
196
- description: "Components bind to entities"
193
+ sourcePattern: "componentinstance",
194
+ destinationPattern: "librarycomponent",
195
+ predicate: "realizes",
196
+ description: "Instances realize the library component they place"
197
197
  },
198
198
  {
199
- sourcePattern: "form",
200
- destinationPattern: "schema",
201
- predicate: "validates",
202
- description: "Forms validate against schemas"
199
+ sourcePattern: "view",
200
+ destinationPattern: "dataconfig",
201
+ predicate: "binds-to",
202
+ description: "Views bind to their data configuration"
203
203
  }
204
204
  ]
205
205
  },
@@ -301,25 +301,25 @@ const LAYER_TEMPLATES = [
301
301
  },
302
302
  {
303
303
  layer: "testing",
304
- standard: "Testing best practices",
304
+ standard: "IEEE 829-2008 test documentation",
305
305
  patterns: [
306
306
  {
307
- sourcePattern: "testcase",
308
- destinationPattern: "requirement",
309
- predicate: "verifies",
310
- description: "Test cases verify requirements"
307
+ sourcePattern: "testcasesketch",
308
+ destinationPattern: "coveragerequirement",
309
+ predicate: "validates",
310
+ description: "Test case sketches validate the coverage requirement they exercise"
311
311
  },
312
312
  {
313
- sourcePattern: "testdata",
314
- destinationPattern: "testcase",
315
- predicate: "supports",
316
- description: "Test data supports test cases"
313
+ sourcePattern: "testcoveragetarget",
314
+ destinationPattern: "coveragerequirement",
315
+ predicate: "composes",
316
+ description: "Coverage targets compose their coverage requirements"
317
317
  },
318
318
  {
319
- sourcePattern: "testsuite",
320
- destinationPattern: "testcase",
321
- predicate: "contains",
322
- description: "Test suites contain test cases"
319
+ sourcePattern: "testcoveragemodel",
320
+ destinationPattern: "testcoveragetarget",
321
+ predicate: "composes",
322
+ description: "Coverage models compose their coverage targets"
323
323
  }
324
324
  ]
325
325
  }
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/audit/relationships/analysis/layer-templates.ts"],
4
- "sourcesContent": ["/**\n * Layer-specific relationship templates for gap analysis and standard alignment\n */\n\nexport interface LayerTemplate {\n layer: string;\n standard: string;\n patterns: Array<{\n sourcePattern: string;\n destinationPattern: string;\n predicate: string;\n description: string;\n }>;\n}\n\nexport const LAYER_TEMPLATES: LayerTemplate[] = [\n {\n layer: \"motivation\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"goal\",\n destinationPattern: \"principle\",\n predicate: \"supports\",\n description: \"Goals support principles\",\n },\n {\n sourcePattern: \"requirement\",\n destinationPattern: \"goal\",\n predicate: \"realizes\",\n description: \"Requirements realize goals\",\n },\n {\n sourcePattern: \"constraint\",\n destinationPattern: \"requirement\",\n predicate: \"restricts\",\n description: \"Constraints restrict requirements\",\n },\n ],\n },\n {\n layer: \"business\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"process\",\n destinationPattern: \"process\",\n predicate: \"triggers\",\n description: \"Processes trigger other processes\",\n },\n {\n sourcePattern: \"role\",\n destinationPattern: \"process\",\n predicate: \"performs\",\n description: \"Roles perform processes\",\n },\n {\n sourcePattern: \"service\",\n destinationPattern: \"process\",\n predicate: \"realizes\",\n description: \"Services realize processes\",\n },\n ],\n },\n {\n layer: \"product\",\n standard: \"Product Management Practice\",\n patterns: [\n {\n sourcePattern: \"feature\",\n destinationPattern: \"capability\",\n predicate: \"realizes\",\n description: \"Features realize capabilities\",\n },\n {\n sourcePattern: \"capability\",\n destinationPattern: \"milestone\",\n predicate: \"scheduled-for\",\n description: \"Capabilities are scheduled for milestones\",\n },\n {\n sourcePattern: \"feature\",\n destinationPattern: \"milestone\",\n predicate: \"scheduled-for\",\n description: \"Features are scheduled for milestones\",\n },\n {\n sourcePattern: \"feature\",\n destinationPattern: \"feature\",\n predicate: \"depends-on\",\n description: \"Features depend on other features\",\n },\n {\n sourcePattern: \"userworkflow\",\n destinationPattern: \"feature\",\n predicate: \"composes\",\n description: \"User workflows compose features\",\n },\n ],\n },\n {\n layer: \"security\",\n standard: \"NIST SP 800-53\",\n patterns: [\n {\n sourcePattern: \"countermeasure\",\n destinationPattern: \"threat\",\n predicate: \"mitigates\",\n description: \"Countermeasures mitigate threats\",\n },\n {\n sourcePattern: \"role\",\n destinationPattern: \"permission\",\n predicate: \"authorizes\",\n description: \"Roles authorize permissions\",\n },\n {\n sourcePattern: \"policy\",\n destinationPattern: \"countermeasure\",\n predicate: \"mandates\",\n description: \"Policies mandate countermeasures\",\n },\n ],\n },\n {\n layer: \"application\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"component\",\n destinationPattern: \"service\",\n predicate: \"realizes\",\n description: \"Components realize services\",\n },\n {\n sourcePattern: \"component\",\n destinationPattern: \"component\",\n predicate: \"uses\",\n description: \"Components use other components\",\n },\n {\n sourcePattern: \"interface\",\n destinationPattern: \"service\",\n predicate: \"serves\",\n description: \"Interfaces serve services\",\n },\n ],\n },\n {\n layer: \"technology\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"node\",\n destinationPattern: \"device\",\n predicate: \"composes\",\n description: \"Nodes compose devices\",\n },\n {\n sourcePattern: \"artifact\",\n destinationPattern: \"component\",\n predicate: \"realizes\",\n description: \"Artifacts realize components\",\n },\n {\n sourcePattern: \"infrastructure\",\n destinationPattern: \"node\",\n predicate: \"hosts\",\n description: \"Infrastructure hosts nodes\",\n },\n ],\n },\n {\n layer: \"api\",\n standard: \"OpenAPI 3.0\",\n patterns: [\n {\n sourcePattern: \"operation\",\n destinationPattern: \"schema\",\n predicate: \"references\",\n description: \"Operations reference schemas\",\n },\n {\n sourcePattern: \"securityscheme\",\n destinationPattern: \"operation\",\n predicate: \"serves\",\n description: \"Security schemes serve operations\",\n },\n {\n sourcePattern: \"response\",\n destinationPattern: \"schema\",\n predicate: \"returns\",\n description: \"Responses return schemas\",\n },\n ],\n },\n {\n layer: \"ux\",\n standard: \"React/Component\",\n patterns: [\n {\n sourcePattern: \"component\",\n destinationPattern: \"component\",\n predicate: \"renders\",\n description: \"Components render other components\",\n },\n {\n sourcePattern: \"component\",\n destinationPattern: \"entity\",\n predicate: \"binds-to\",\n description: \"Components bind to entities\",\n },\n {\n sourcePattern: \"form\",\n destinationPattern: \"schema\",\n predicate: \"validates\",\n description: \"Forms validate against schemas\",\n },\n ],\n },\n {\n layer: \"navigation\",\n standard: \"Router patterns\",\n patterns: [\n {\n sourcePattern: \"route\",\n destinationPattern: \"screen\",\n predicate: \"navigates-to\",\n description: \"Routes navigate to screens\",\n },\n {\n sourcePattern: \"menuitem\",\n destinationPattern: \"route\",\n predicate: \"references\",\n description: \"Menu items reference routes\",\n },\n {\n sourcePattern: \"link\",\n destinationPattern: \"route\",\n predicate: \"targets\",\n description: \"Links target routes\",\n },\n ],\n },\n {\n layer: \"data-model\",\n standard: \"JSON Schema Draft 7\",\n patterns: [\n {\n sourcePattern: \"entity\",\n destinationPattern: \"entity\",\n predicate: \"references\",\n description: \"Entities reference other entities\",\n },\n {\n sourcePattern: \"entity\",\n destinationPattern: \"property\",\n predicate: \"has\",\n description: \"Entities have properties\",\n },\n {\n sourcePattern: \"property\",\n destinationPattern: \"entity\",\n predicate: \"references\",\n description: \"Properties reference entities\",\n },\n ],\n },\n {\n layer: \"data-store\",\n standard: \"Database schema patterns\",\n patterns: [\n {\n sourcePattern: \"table\",\n destinationPattern: \"table\",\n predicate: \"references\",\n description: \"Tables reference other tables via foreign keys\",\n },\n {\n sourcePattern: \"index\",\n destinationPattern: \"table\",\n predicate: \"indexes\",\n description: \"Indexes apply to tables\",\n },\n {\n sourcePattern: \"view\",\n destinationPattern: \"table\",\n predicate: \"derives-from\",\n description: \"Views derive from tables\",\n },\n ],\n },\n {\n layer: \"apm\",\n standard: \"OpenTelemetry\",\n patterns: [\n {\n sourcePattern: \"trace\",\n destinationPattern: \"service\",\n predicate: \"monitors\",\n description: \"Traces monitor services\",\n },\n {\n sourcePattern: \"metric\",\n destinationPattern: \"component\",\n predicate: \"measures\",\n description: \"Metrics measure components\",\n },\n {\n sourcePattern: \"alert\",\n destinationPattern: \"metric\",\n predicate: \"triggers-on\",\n description: \"Alerts trigger on metrics\",\n },\n ],\n },\n {\n layer: \"testing\",\n standard: \"Testing best practices\",\n patterns: [\n {\n sourcePattern: \"testcase\",\n destinationPattern: \"requirement\",\n predicate: \"verifies\",\n description: \"Test cases verify requirements\",\n },\n {\n sourcePattern: \"testdata\",\n destinationPattern: \"testcase\",\n predicate: \"supports\",\n description: \"Test data supports test cases\",\n },\n {\n sourcePattern: \"testsuite\",\n destinationPattern: \"testcase\",\n predicate: \"contains\",\n description: \"Test suites contain test cases\",\n },\n ],\n },\n];\n"],
4
+ "sourcesContent": ["/**\n * Layer-specific relationship templates for gap analysis and standard alignment\n */\n\nexport interface LayerTemplate {\n layer: string;\n standard: string;\n patterns: Array<{\n sourcePattern: string;\n destinationPattern: string;\n predicate: string;\n description: string;\n }>;\n}\n\nexport const LAYER_TEMPLATES: LayerTemplate[] = [\n {\n layer: \"motivation\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"goal\",\n destinationPattern: \"principle\",\n predicate: \"supports\",\n description: \"Goals support principles\",\n },\n {\n sourcePattern: \"requirement\",\n destinationPattern: \"goal\",\n predicate: \"realizes\",\n description: \"Requirements realize goals\",\n },\n {\n sourcePattern: \"constraint\",\n destinationPattern: \"requirement\",\n predicate: \"restricts\",\n description: \"Constraints restrict requirements\",\n },\n ],\n },\n {\n layer: \"business\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"process\",\n destinationPattern: \"process\",\n predicate: \"triggers\",\n description: \"Processes trigger other processes\",\n },\n {\n sourcePattern: \"role\",\n destinationPattern: \"process\",\n predicate: \"assigned-to\",\n description: \"Roles are assigned to the processes they perform\",\n },\n {\n sourcePattern: \"process\",\n destinationPattern: \"service\",\n predicate: \"realizes\",\n description: \"Processes realize services\",\n },\n ],\n },\n {\n layer: \"product\",\n standard: \"Product Management Practice\",\n patterns: [\n {\n sourcePattern: \"feature\",\n destinationPattern: \"softwarecapability\",\n predicate: \"realizes\",\n description: \"Features realize software capabilities\",\n },\n {\n sourcePattern: \"softwarecapability\",\n destinationPattern: \"milestone\",\n predicate: \"scheduled-for\",\n description: \"Software capabilities are scheduled for milestones\",\n },\n {\n sourcePattern: \"feature\",\n destinationPattern: \"milestone\",\n predicate: \"scheduled-for\",\n description: \"Features are scheduled for milestones\",\n },\n {\n sourcePattern: \"feature\",\n destinationPattern: \"feature\",\n predicate: \"depends-on\",\n description: \"Features depend on other features\",\n },\n {\n sourcePattern: \"userworkflow\",\n destinationPattern: \"feature\",\n predicate: \"composes\",\n description: \"User workflows compose features\",\n },\n ],\n },\n {\n layer: \"security\",\n standard: \"NIST SP 800-53\",\n patterns: [\n {\n sourcePattern: \"countermeasure\",\n destinationPattern: \"threat\",\n predicate: \"mitigates\",\n description: \"Countermeasures mitigate threats\",\n },\n {\n sourcePattern: \"role\",\n destinationPattern: \"permission\",\n predicate: \"aggregates\",\n description: \"Roles aggregate the permissions they grant\",\n },\n {\n sourcePattern: \"policy\",\n destinationPattern: \"countermeasure\",\n predicate: \"mandates\",\n description: \"Policies mandate countermeasures\",\n },\n ],\n },\n {\n layer: \"application\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"component\",\n destinationPattern: \"service\",\n predicate: \"realizes\",\n description: \"Components realize services\",\n },\n {\n sourcePattern: \"component\",\n destinationPattern: \"component\",\n predicate: \"uses\",\n description: \"Components use other components\",\n },\n {\n sourcePattern: \"interface\",\n destinationPattern: \"service\",\n predicate: \"serves\",\n description: \"Interfaces serve services\",\n },\n ],\n },\n {\n layer: \"technology\",\n standard: \"ArchiMate 3.2\",\n patterns: [\n {\n sourcePattern: \"node\",\n destinationPattern: \"device\",\n predicate: \"composes\",\n description: \"Nodes compose devices\",\n },\n {\n sourcePattern: \"artifact\",\n destinationPattern: \"component\",\n predicate: \"realizes\",\n description: \"Artifacts realize components\",\n },\n {\n sourcePattern: \"node\",\n destinationPattern: \"systemsoftware\",\n predicate: \"composes\",\n description: \"Nodes compose the system software they run\",\n },\n ],\n },\n {\n layer: \"api\",\n standard: \"OpenAPI 3.0\",\n patterns: [\n {\n sourcePattern: \"pathitem\",\n destinationPattern: \"operation\",\n predicate: \"composes\",\n description: \"Path items compose their operations\",\n },\n {\n sourcePattern: \"operation\",\n destinationPattern: \"responses\",\n predicate: \"composes\",\n description: \"Operations compose their responses map\",\n },\n {\n sourcePattern: \"mediatype\",\n destinationPattern: \"schema\",\n predicate: \"references\",\n description: \"Media types reference their schema by $ref\",\n },\n ],\n },\n {\n layer: \"ux\",\n standard: \"HTML 5.3 / component libraries\",\n patterns: [\n {\n sourcePattern: \"view\",\n destinationPattern: \"componentinstance\",\n predicate: \"composes\",\n description: \"Views compose the component instances placed in them\",\n },\n {\n sourcePattern: \"componentinstance\",\n destinationPattern: \"librarycomponent\",\n predicate: \"realizes\",\n description: \"Instances realize the library component they place\",\n },\n {\n sourcePattern: \"view\",\n destinationPattern: \"dataconfig\",\n predicate: \"binds-to\",\n description: \"Views bind to their data configuration\",\n },\n ],\n },\n {\n layer: \"navigation\",\n standard: \"Router patterns\",\n patterns: [\n {\n sourcePattern: \"route\",\n destinationPattern: \"screen\",\n predicate: \"navigates-to\",\n description: \"Routes navigate to screens\",\n },\n {\n sourcePattern: \"menuitem\",\n destinationPattern: \"route\",\n predicate: \"references\",\n description: \"Menu items reference routes\",\n },\n {\n sourcePattern: \"link\",\n destinationPattern: \"route\",\n predicate: \"targets\",\n description: \"Links target routes\",\n },\n ],\n },\n {\n layer: \"data-model\",\n standard: \"JSON Schema Draft 7\",\n patterns: [\n {\n sourcePattern: \"entity\",\n destinationPattern: \"entity\",\n predicate: \"references\",\n description: \"Entities reference other entities\",\n },\n {\n sourcePattern: \"entity\",\n destinationPattern: \"property\",\n predicate: \"has\",\n description: \"Entities have properties\",\n },\n {\n sourcePattern: \"property\",\n destinationPattern: \"entity\",\n predicate: \"references\",\n description: \"Properties reference entities\",\n },\n ],\n },\n {\n layer: \"data-store\",\n standard: \"Database schema patterns\",\n patterns: [\n {\n sourcePattern: \"table\",\n destinationPattern: \"table\",\n predicate: \"references\",\n description: \"Tables reference other tables via foreign keys\",\n },\n {\n sourcePattern: \"index\",\n destinationPattern: \"table\",\n predicate: \"indexes\",\n description: \"Indexes apply to tables\",\n },\n {\n sourcePattern: \"view\",\n destinationPattern: \"table\",\n predicate: \"derives-from\",\n description: \"Views derive from tables\",\n },\n ],\n },\n {\n layer: \"apm\",\n standard: \"OpenTelemetry\",\n patterns: [\n {\n sourcePattern: \"trace\",\n destinationPattern: \"service\",\n predicate: \"monitors\",\n description: \"Traces monitor services\",\n },\n {\n sourcePattern: \"metric\",\n destinationPattern: \"component\",\n predicate: \"measures\",\n description: \"Metrics measure components\",\n },\n {\n sourcePattern: \"alert\",\n destinationPattern: \"metric\",\n predicate: \"triggers-on\",\n description: \"Alerts trigger on metrics\",\n },\n ],\n },\n {\n layer: \"testing\",\n standard: \"IEEE 829-2008 test documentation\",\n patterns: [\n {\n sourcePattern: \"testcasesketch\",\n destinationPattern: \"coveragerequirement\",\n predicate: \"validates\",\n description: \"Test case sketches validate the coverage requirement they exercise\",\n },\n {\n sourcePattern: \"testcoveragetarget\",\n destinationPattern: \"coveragerequirement\",\n predicate: \"composes\",\n description: \"Coverage targets compose their coverage requirements\",\n },\n {\n sourcePattern: \"testcoveragemodel\",\n destinationPattern: \"testcoveragetarget\",\n predicate: \"composes\",\n description: \"Coverage models compose their coverage targets\",\n },\n ],\n },\n];\n"],
5
5
  "mappings": "AAeO,MAAM,kBAAmC;EAC9C;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;EAInB;IACE,OAAO;IACP,UAAU;IACV,UAAU;MACR;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;MAEf;QACE,eAAe;QACf,oBAAoB;QACpB,WAAW;QACX,aAAa;;;;;",
6
6
  "names": []
7
7
  }
package/dist/cli.js CHANGED
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import { Command, CommanderError } from "commander";
3
3
  import { setGlobalOptions } from "./utils/globals.js";
4
+ import { installAnsiSuppressor } from "./utils/ansi-suppressor.js";
4
5
  import { initCommand } from "./commands/init.js";
5
6
  import { addCommand } from "./commands/add.js";
6
7
  import { updateCommand } from "./commands/update.js";
@@ -22,6 +23,7 @@ import { chatCommand } from "./commands/chat.js";
22
23
  import { upgradeCommand } from "./commands/upgrade.js";
23
24
  import { conformanceCommand } from "./commands/conformance.js";
24
25
  import { changesetCommands } from "./commands/changeset.js";
26
+ import { farmCommands } from "./commands/farm.js";
25
27
  import { claudeCommands } from "./commands/claude.js";
26
28
  import { copilotCommands } from "./commands/copilot.js";
27
29
  import { analyzerCommands } from "./commands/analyzer.js";
@@ -35,11 +37,13 @@ import { auditSnapshotsCommand } from "./commands/audit-snapshots.js";
35
37
  import { repairAttributeCollisionCommand } from "./commands/repair.js";
36
38
  import { initTelemetry, startActiveSpan, shutdownTelemetry } from "./telemetry/index.js";
37
39
  import { installConsoleInterceptor } from "./telemetry/console-interceptor.js";
38
- import { getErrorMessage } from "./utils/errors.js";
40
+ import { getErrorMessage, CLIError } from "./utils/errors.js";
41
+ import { getCliVersion } from "./utils/spec-version.js";
39
42
  const isTelemetryEnabled = !1, CONSOLE_LOGGING_COMMANDS = /* @__PURE__ */ new Set(["chat", "validate", "import", "export"]);
43
+ process.stdout.isTTY || (process.env.FORCE_COLOR = "0", process.env.NO_COLOR = "1"), installAnsiSuppressor();
40
44
  async function extractExitCode(error) {
41
- const { CLIError } = await import("./utils/errors.js");
42
- if (error instanceof CLIError || error instanceof CommanderError)
45
+ const { CLIError: CLIError2 } = await import("./utils/errors.js");
46
+ if (error instanceof CLIError2 || error instanceof CommanderError)
43
47
  return error.exitCode;
44
48
  if (error && typeof error == "object" && "exitCode" in error) {
45
49
  const errorObj = error;
@@ -48,26 +52,28 @@ async function extractExitCode(error) {
48
52
  }
49
53
  return 1;
50
54
  }
51
- const cliVersion = "0.1.13", program = new Command();
52
- (process.argv.includes("--version") || process.argv.includes("-V")) && (process.argv = ["node", "dr", "version"]), program.name("dr").description("Documentation Robotics CLI - Architecture Model Management").option("-v, --verbose", "Enable verbose output").option("--debug", "Enable debug mode").exitOverride().showSuggestionAfterError().hook("preAction", async (thisCommand) => {
55
+ const cliVersion = getCliVersion(), program = new Command();
56
+ (process.argv.includes("--version") || process.argv.includes("-V")) && (process.argv = ["node", "dr", "version"]), program.name("dr").description("Documentation Robotics CLI - Architecture Model Management").option("-v, --verbose", "Enable verbose output").option("--debug", "Enable debug mode").option("--json", "Output as JSON (supported on mutating and query commands)").option("--codebase-path <path>", "Override codebase root path (default: resolved from manifest or project root)").exitOverride().showSuggestionAfterError().hook("preAction", async (thisCommand) => {
53
57
  const options = thisCommand.opts();
54
58
  setGlobalOptions({
55
59
  verbose: options.verbose,
56
- debug: options.debug
60
+ debug: options.debug,
61
+ json: options.json,
62
+ codebasePath: options.codebasePath
57
63
  });
58
64
  }), program.command("init [name]").description("Initialize a new architecture model").option("--name <name>", "Model name (overrides positional argument)").option("--author <author>", "Model author").option("--description <desc>", "Model description").addHelpText("after", `
59
65
  Examples:
60
66
  $ dr init
61
67
  $ dr init claudetoreum
62
68
  $ dr init "Enterprise Architecture" --author "Team A"
63
- $ dr init --name "My Project" --description "13-layer federated model"`).action((name, options) => initCommand({ ...options, name: options.name || name })), program.command("add <layer> <type> <name>").description("Add an element to a layer").option("--name <name>", "Element display name (defaults to the name argument)").option("--description <desc>", "Element description").option("--attributes <json>", "Element type-specific attributes as JSON object").option("--source-file <path>", "Source file path (relative from repository root)").option("--source-symbol <name>", "Symbol name (class, function, variable) in source file").option("--source-provenance <type>", "Provenance type: extracted, manual, inferred, generated").option("--source-repo-remote <url>", "Git remote URL for repository context").option("--source-repo-commit <sha>", "Git commit SHA (40 hex characters) for repository context").addHelpText("after", `
69
+ $ dr init --name "My Project" --description "13-layer federated model"`).action((name, options) => initCommand({ ...options, name: options.name || name })), program.command("add <layer> <type> <name>").description("Add an element to a layer").option("--model <path>", "Path to model root (contains model/manifest.yaml)").option("--name <name>", "Element display name (defaults to the name argument)").option("--description <desc>", "Element description").option("--attributes <json>", "Element type-specific attributes as JSON object").option("--source-file <path>", "Source file path (relative from repository root)").option("--source-symbol <name>", "Symbol name (class, function, variable) in source file").option("--source-provenance <type>", "Provenance type: extracted, manual, inferred, generated").option("--source-repo-remote <url>", "Git remote URL for repository context").option("--source-repo-commit <sha>", "Git commit SHA (40 hex characters) for repository context").option("--verbose", "Show detailed output (can also use global -v flag)").addHelpText("after", `
64
70
  Examples:
65
71
  $ dr add business service "Customer Management"
66
72
  $ dr add api operation "Create Customer" --attributes '{"operationId":"createCustomer","summary":"Create a customer","tags":"customers"}'
67
73
  $ dr add application component "Customer API" --description "REST API for customer operations"
68
74
  $ dr add security policy "Auth Validator" --source-file "src/auth/validator.ts" --source-symbol "validateToken" --source-provenance "extracted"
69
75
 
70
- Note: Element IDs are generated automatically in format {layer}.{type}.{kebab-name}`).action(addCommand), program.command("update <id>").description("Update an element").option("--name <name>", "New element name").option("--description <desc>", "New description").option("--type <new-type>", "Change element type (must be valid for the element's layer; incompatible attributes must be cleaned up manually)").option("--attributes <json>", "Updated type-specific attributes (JSON)").option("--source-file <path>", "Source file path (relative from repository root)").option("--source-symbol <name>", "Symbol name (class, function, variable) in source file").option("--source-provenance <type>", "Provenance type: extracted, manual, inferred, generated").option("--source-repo-remote <url>", "Git remote URL for repository context").option("--source-repo-commit <sha>", "Git commit SHA (40 hex characters) for repository context").option("--clear-source-reference", "Remove source reference from element").addHelpText("after", `
76
+ Note: Element IDs are generated automatically in format {layer}.{type}.{kebab-name}`).action((layer, type, name, options) => addCommand(layer, type, name, { ...options, verbose: options.verbose ?? program.opts().verbose })), program.command("update <id>").description("Update an element").option("--model <path>", "Path to model root (contains model/manifest.yaml)").option("--name <name>", "New element name").option("--description <desc>", "New description").option("--type <new-type>", "Change element type (must be valid for the element's layer; incompatible attributes must be cleaned up manually)").option("--attributes <json>", "Updated type-specific attributes (JSON)").option("--attribute-patch <json>", "Merge these attributes into the current ones (JSON object; null removes a key). Cannot be combined with --attributes").option("--source-file <path>", "Source file path (relative from repository root)").option("--source-symbol <name>", "Symbol name (class, function, variable) in source file").option("--source-provenance <type>", "Provenance type: extracted, manual, inferred, generated").option("--source-repo-remote <url>", "Git remote URL for repository context").option("--source-repo-commit <sha>", "Git commit SHA (40 hex characters) for repository context").option("--clear-source-reference", "Remove source reference from element").option("--verbose", "Show detailed output (can also use global -v flag)").addHelpText("after", `
71
77
  Note: Changes are written immediately to model files.
72
78
  To track changes for review, activate a changeset first:
73
79
  $ dr changeset activate my-changeset
@@ -76,13 +82,14 @@ Examples:
76
82
  $ dr update api-endpoint-create-customer --name "Create Customer (v2)"
77
83
  $ dr update business-service-order --description "Updated description"
78
84
  $ dr update application-applicationfunction-process-orders --type applicationservice
79
- $ dr update security-policy-auth --source-file "src/auth/policy.ts" --source-provenance "extracted"`).action(updateCommand), program.command("delete <id>").description("Delete an element").option("--force", "Skip dependency checks (confirmation is also skipped in non-TTY environments)").option("--cascade", "Remove dependent elements automatically").option("--dry-run", "Show what would be removed without actually removing").addHelpText("after", `
85
+ $ dr update api.operation.create-customer --attribute-patch '{"summary":"Create a customer (v2)"}'
86
+ $ dr update security-policy-auth --source-file "src/auth/policy.ts" --source-provenance "extracted"`).action((id, options) => updateCommand(id, { ...options, verbose: options.verbose ?? program.opts().verbose })), program.command("delete <id>").description("Delete an element").option("--model <path>", "Path to model root (contains model/manifest.yaml)").option("--force", "Skip dependency checks (confirmation is also skipped in non-TTY environments)").option("--cascade", "Remove dependent elements automatically").option("--dry-run", "Show what would be removed without actually removing").option("--verbose", "Show detailed output (can also use global -v flag)").addHelpText("after", `
80
87
  Examples:
81
88
  $ dr delete api-endpoint-old-endpoint
82
89
  $ dr delete api-endpoint-old-endpoint --force
83
90
  $ dr delete api-endpoint-old-endpoint --cascade
84
91
  $ dr delete api-endpoint-old-endpoint --dry-run
85
- $ dr delete api-endpoint-old-endpoint --cascade --dry-run`).action(deleteCommand), program.command("show <id>").description("Display element details").option("--model <path>", "Path to model root (contains model/manifest.yaml)").addHelpText("after", `
92
+ $ dr delete api-endpoint-old-endpoint --cascade --dry-run`).action((id, options) => deleteCommand(id, { ...options, verbose: options.verbose ?? program.opts().verbose })), program.command("show <id>").description("Display element details").option("--model <path>", "Path to model root (contains model/manifest.yaml)").addHelpText("after", `
86
93
  Examples:
87
94
  $ dr show api-endpoint-create-customer
88
95
  $ dr show business-service-order-mgmt`).action((id, options) => showCommand(id, options)), program.command("list [layer]").description("List elements in a layer (or all layers if omitted)").option("--type <type>", "Filter by element type").option("--json", "Output as JSON").option("--model <path>", "Path to model root (contains model/manifest.yaml)").addHelpText("after", `
@@ -91,12 +98,12 @@ Examples:
91
98
  $ dr list api
92
99
  $ dr list business --type businessservice
93
100
  $ dr list api --json
94
- $ dr list --json`).action(listCommand), program.command("search <query>").description("Search for elements by name or ID").option("--layer <layer>", "Limit search to specific layer").option("--type <type>", "Filter by element type").option("--source-file <path>", "Find elements referencing a source file (takes precedence over pattern matching)").option("--json", "Output as JSON").addHelpText("after", `
101
+ $ dr list --json`).action((layer, options) => listCommand(layer, { ...options, json: options.json ?? program.opts().json })), program.command("search <query>").description("Search for elements by name or ID").option("--layer <layer>", "Limit search to specific layer").option("--type <type>", "Filter by element type").option("--source-file <path>", "Find elements referencing a source file (takes precedence over pattern matching)").option("--json", "Output as JSON").addHelpText("after", `
95
102
  Examples:
96
103
  $ dr search customer
97
104
  $ dr search "order processing" --layer business
98
105
  $ dr search create-* --type endpoint
99
- $ dr search "" --source-file src/api/customer.ts`).action(searchCommand), program.command("validate").description("Validate the architecture model").option("--layers <layers...>", "Specific layers to validate").option("--strict", "Treat warnings as errors").option("--verbose", "Show detailed validation output with relationship breakdown").option("--quiet", "Show minimal output").option("--output <path>", "Export validation report to file (JSON or Markdown)").option("--model <path>", "Path to model root (contains model/manifest.yaml)").option("--orphans", "Show only orphaned elements grouped by layer with relationship suggestions").option("--all", "Run all validations (default behavior)").option("--markdown", "Validate markdown structure").option("--schemas", "Validate JSON schemas").option("--schema", "Validate JSON schemas (alias for --schemas)").option("--relationships", "Validate relationships").option("--structure", "Validate documentation structure").option("--naming", "Validate naming conventions").option("--references", "Validate cross-layer references").addHelpText("after", `
106
+ $ dr search "" --source-file src/api/customer.ts`).action((query, options) => searchCommand(query, { ...options, json: options.json ?? program.opts().json })), program.command("validate").description("Validate the architecture model").option("--layers <layers...>", "Specific layers to validate").option("--strict", "Treat warnings as errors").option("--verbose", "Show detailed validation output with relationship breakdown").option("--quiet", "Show minimal output").option("--output <path>", "Export validation report to file (JSON or Markdown)").option("--model <path>", "Path to model root (contains model/manifest.yaml)").option("--orphans", "Show only orphaned elements grouped by layer with relationship suggestions").option("--all", "Run all validations (default behavior)").option("--markdown", "Validate markdown structure").option("--schemas", "Validate JSON schemas").option("--schema", "Validate JSON schemas (alias for --schemas)").option("--relationships", "Validate relationships").option("--structure", "Validate documentation structure").option("--naming", "Validate naming conventions").option("--references", "Validate cross-layer references").option("--scope <scope>", "Validation scope: 'local' (default) or 'composed' for cross-model validation").option("--model-path <mapping...>", "Override filesystem path for external model (format: model-name=/path/to/project-root, can be repeated)").addHelpText("after", `
100
107
  Examples:
101
108
  $ dr validate
102
109
  $ dr validate --all --strict
@@ -108,7 +115,11 @@ Examples:
108
115
  $ dr validate --relationships
109
116
  $ dr validate --layers business api
110
117
  $ dr validate --orphans
111
- $ dr validate --orphans --output orphans.json`).action(validateCommand), program.command("export <format>").description("Export the architecture model to various formats").option("--output <path>", "Output file path (default: print to stdout)").option("--layers <layers...>", "Specific layers to export").option("--model <path>", "Path to model root directory or manifest.yaml file").option("--include-sources", "Include source file paths in PlantUML diagrams as notes").addHelpText("after", `
118
+ $ dr validate --orphans --output orphans.json
119
+ $ dr validate --scope composed --model-path auth-service=/path/to/auth-service-repo
120
+ $ dr validate --scope composed --model-path auth-service=/path/to/auth-service-repo --model-path payment-service=/path/to/payment-repo
121
+
122
+ Note: When using --model-path, pass the project root (where documentation-robotics/model/ is located).`).action(validateCommand), program.command("export <format>").description("Export the architecture model to various formats").option("--output <path>", "Output file path (default: print to stdout)").option("--layers <layers...>", "Specific layers to export").option("--model <path>", "Path to model root directory or manifest.yaml file").option("--include-sources", "Include source file paths in PlantUML diagrams as notes").addHelpText("after", `
112
123
  Supported formats:
113
124
  archimate Export to ArchiMate XML (layers 1, 2, 5, 6)
114
125
  openapi Export to OpenAPI 3.0 specification (layer 7)
@@ -233,9 +244,9 @@ Examples:
233
244
  $ dr repair:attribute-collision --apply # Restore every recoverable value
234
245
  $ dr repair:attribute-collision --format json --output report.json`).action((options) => repairAttributeCollisionCommand(options));
235
246
  const relationshipGroup = program.command("relationship").description("Relationship operations");
236
- relationshipCommands(relationshipGroup);
247
+ relationshipCommands(relationshipGroup, program);
237
248
  const elementGroup = program.command("element").description("Element operations");
238
- elementCommands(elementGroup), schemaCommands(program), catalogCommands(program), docsCommands(program), program.command("trace <elementId>").description("Trace dependencies for an element").option("--direction <dir>", "Trace direction: up (dependencies), down (dependents), both (default)").option("--depth <num>", "Maximum traversal depth").option("--metrics", "Show graph and element metrics").option("--model <path>", "Path to model root (contains model/manifest.yaml)").addHelpText("after", `
249
+ elementCommands(elementGroup, program), schemaCommands(program), catalogCommands(program), docsCommands(program), program.command("trace <elementId>").description("Trace dependencies for an element").option("--direction <dir>", "Trace direction: up (dependencies), down (dependents), both (default)").option("--depth <num>", "Maximum traversal depth").option("--metrics", "Show graph and element metrics").option("--model <path>", "Path to model root (contains model/manifest.yaml)").addHelpText("after", `
239
250
  Examples:
240
251
  $ dr trace api-endpoint-create-customer
241
252
  $ dr trace business-service-order --direction down --metrics
@@ -246,7 +257,7 @@ Examples:
246
257
  showMetrics: options.metrics,
247
258
  model: options.model
248
259
  });
249
- }), program.command("visualize").description("Launch visualization server with WebSocket support").option("--port <num>", "Server port (default: 8080)").option("--no-browser", "Do not auto-open browser").option("--no-auth", "Disable authentication (enabled by default)").option("--token <token>", "Custom auth token (auto-generated by default)").option("--with-danger", "Enable dangerous mode for chat (skip permissions)").option("--viewer-path <path>", "Path to custom viewer build (e.g., ./dist/embedded/dr-viewer-bundle)").addHelpText("after", `
260
+ }), program.command("visualize").description("Launch visualization server with WebSocket support").option("--port <num>", "Server port (default: 8080)").option("--no-browser", "Do not auto-open browser").option("--no-auth", "Disable authentication (enabled by default)").option("--token <token>", "Custom auth token (auto-generated by default)").option("--with-danger", "Enable dangerous mode for chat (skip permissions)").option("--with-changesets", "Let chat stage model changes in a changeset (no commit, apply or delete)").option("--viewer-path <path>", "Path to custom viewer build (e.g., ./dist/embedded/dr-viewer-bundle)").addHelpText("after", `
250
261
  Examples:
251
262
  $ dr visualize
252
263
  $ dr visualize --port 3000
@@ -254,11 +265,25 @@ Examples:
254
265
  $ dr visualize --no-auth
255
266
  $ dr visualize --token my-secret-token
256
267
  $ dr visualize --with-danger
268
+ $ dr visualize --with-changesets
257
269
  $ dr visualize --viewer-path ./dist/embedded/dr-viewer-bundle
258
270
 
259
- The --with-danger flag enables dangerous mode for chat functionality:
260
- - Claude Code: --dangerously-skip-permissions
261
- - GitHub Copilot: --allow-all-tools
271
+ Default mode (read-safe permissions) enables:
272
+ - Running 'dr' CLI commands to query the architecture model
273
+ - Reading the codebase
274
+ - Reading the documentation-robotics/ model folder
275
+ - Reading the .dr/ configuration folder
276
+
277
+ Changeset mode (--with-changesets, Claude Code) adds to the read-safe mode:
278
+ - Creating, activating and inspecting changesets
279
+ - Staging new elements, element updates and new relationships (dr add,
280
+ dr update, dr relationship add) in the active changeset
281
+ - Never committing, applying, reverting or deleting: those stay with you.
282
+ Writes outside an active changeset are refused.
283
+
284
+ Dangerous mode (--with-danger) enables unrestricted access:
285
+ - Claude Code: --dangerously-skip-permissions (full tool access)
286
+ - GitHub Copilot: --allow-all-tools (full tool access)
262
287
 
263
288
  The --viewer-path option allows loading a local build of the web UI:
264
289
  - Point to a directory containing index.html and supporting files
@@ -272,8 +297,61 @@ The --viewer-path option allows loading a local build of the web UI:
272
297
  // Commander sets 'auth' to false when --no-auth is used
273
298
  token: options.token,
274
299
  withDanger: options.withDanger,
300
+ withChangesets: options.withChangesets,
275
301
  viewerPath: options.viewerPath
276
302
  });
303
+ }), program.command("mcp").description("Start MCP server for AI assistant integration").option("--regenerate-key", "Generate a new MCP API key, overwrite it at the configured storage path, and print it (does not start the server)").option("--transport <type>", "Transport type: stdio or http (default: stdio)", "stdio").option("--port <number>", "Port for HTTP transport (default: 3100, only meaningful with --transport http)", "3100").option("--host <address>", "Host address for HTTP transport (default: 127.0.0.1, only meaningful with --transport http)", "127.0.0.1").addHelpText("after", `
304
+ Examples:
305
+
306
+ Stdio transport (default):
307
+ $ dr mcp
308
+
309
+ HTTP transport:
310
+ $ dr mcp --transport http # HTTP on localhost:3100
311
+ $ dr mcp --transport http --port 8200 # HTTP on custom port
312
+ $ dr mcp --transport http --host 0.0.0.0 --port 3100 # Listen on all interfaces
313
+
314
+ Key management:
315
+ $ dr mcp --regenerate-key # Generate new API key
316
+
317
+ Initial Setup:
318
+ On first launch, generates an API key and asks where to store it (interactive
319
+ sessions only; non-interactive launches default to ~/.dr-mcp-key). The key is
320
+ printed to stderr on every launch and must be supplied via environment variable.
321
+
322
+ Stdio Configuration:
323
+ For stdio transport, supply the key via environment variable:
324
+
325
+ {
326
+ "command": "dr",
327
+ "args": ["mcp"],
328
+ "env": { "DR_MCP_API_KEY": "<your-api-key>" }
329
+ }
330
+
331
+ HTTP Configuration:
332
+ For HTTP transport, include the API key as a Bearer token in the Authorization header:
333
+
334
+ {
335
+ "url": "http://localhost:3100/mcp",
336
+ "headers": {
337
+ "Authorization": "Bearer <your-api-key>"
338
+ }
339
+ }
340
+
341
+ Use --regenerate-key to rotate the key (e.g. after a suspected leak) without
342
+ manually deleting the stored key file or config.`).action(async (options) => {
343
+ const { mcpCommand } = await import("./commands/mcp.js"), transport = options.transport.toLowerCase();
344
+ if (transport !== "stdio" && transport !== "http")
345
+ throw new CLIError(`Invalid transport: ${transport}. Allowed values: stdio, http`, 1);
346
+ const port = parseInt(options.port, 10);
347
+ if (!Number.isFinite(port) || port < 1 || port > 65535)
348
+ throw new CLIError(`Invalid port: ${options.port}. Must be a number between 1 and 65535`, 1);
349
+ await mcpCommand({
350
+ regenerateKey: options.regenerateKey,
351
+ transport,
352
+ port,
353
+ host: options.host
354
+ });
277
355
  }), program.command("chat [client] [withDanger]").description("Interactive chat with AI about the architecture model").addHelpText("after", `
278
356
  Arguments:
279
357
  client Optional AI client to use: "claude-code" or "github-copilot"
@@ -287,9 +365,15 @@ Examples:
287
365
  $ dr chat claude-code with-danger # Use Claude Code with dangerous mode
288
366
  $ dr chat github-copilot with-danger # Use GitHub Copilot with dangerous mode
289
367
 
290
- Dangerous mode enables:
291
- - Claude Code: --dangerously-skip-permissions
292
- - GitHub Copilot: --allow-all-tools
368
+ Default mode (read-safe permissions) enables:
369
+ - Running 'dr' CLI commands to query the architecture model
370
+ - Reading the codebase
371
+ - Reading the documentation-robotics/ model folder
372
+ - Reading the .dr/ configuration folder
373
+
374
+ Dangerous mode (--with-danger) enables unrestricted access:
375
+ - Claude Code: --dangerously-skip-permissions (full tool access)
376
+ - GitHub Copilot: --allow-all-tools (full tool access)
293
377
 
294
378
  This launches an interactive chat interface where you can ask AI questions
295
379
  about your architecture model. Supports Claude Code CLI and GitHub Copilot CLI.
@@ -322,10 +406,10 @@ Examples:
322
406
  $ dr conformance --verbose`).action(async (options) => {
323
407
  await conformanceCommand({
324
408
  layers: options.layers,
325
- json: options.json,
409
+ json: options.json ?? program.opts().json,
326
410
  verbose: options.verbose ?? program.opts().verbose
327
411
  });
328
- }), changesetCommands(program), claudeCommands(program), copilotCommands(program), analyzerCommands(program), (async () => {
412
+ }), changesetCommands(program), farmCommands(program), claudeCommands(program), copilotCommands(program), analyzerCommands(program), (async () => {
329
413
  let exitCode = 0;
330
414
  try {
331
415
  if (isTelemetryEnabled) {
@@ -346,8 +430,8 @@ Examples:
346
430
  // SpanStatusCode.ERROR
347
431
  message: getErrorMessage(error)
348
432
  }));
349
- const { CLIError } = await import("./utils/errors.js");
350
- error instanceof CommanderError || (error instanceof CLIError ? console.error(error.format()) : error instanceof Error ? console.error(error.message) : console.error(String(error))), exitCode = await extractExitCode(error);
433
+ const { CLIError: CLIError2 } = await import("./utils/errors.js"), { isJson } = await import("./utils/globals.js");
434
+ error instanceof CommanderError || (error instanceof CLIError2 ? isJson() || console.error(error.format()) : error instanceof Error ? console.error(error.message) : console.error(String(error))), exitCode = await extractExitCode(error);
351
435
  }
352
436
  }, {
353
437
  "cli.command": commandName,
@@ -359,8 +443,8 @@ Examples:
359
443
  try {
360
444
  await program.parseAsync(process.argv);
361
445
  } catch (error) {
362
- const { CLIError } = await import("./utils/errors.js");
363
- error instanceof CommanderError || (error instanceof CLIError ? console.error(error.format()) : error instanceof Error ? console.error(error.message) : console.error(String(error)));
446
+ const { CLIError: CLIError2 } = await import("./utils/errors.js"), { isJson } = await import("./utils/globals.js");
447
+ error instanceof CommanderError || (error instanceof CLIError2 ? isJson() || console.error(error.format()) : error instanceof Error ? console.error(error.message) : console.error(String(error)));
364
448
  const exitCodeFromError = await extractExitCode(error);
365
449
  process.exit(exitCodeFromError);
366
450
  }