@v11g/agents-rock 1.0.12 → 1.0.14

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 (574) hide show
  1. package/README.md +23 -5
  2. package/package.json +1 -1
  3. package/plugins/business-analyst/skills/business-analyst/README.md +1 -1
  4. package/plugins/business-analyst/skills/business-analyst/evals/evals.json +1 -1
  5. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-314.pyc +0 -0
  6. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-314.pyc +0 -0
  7. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-314.pyc +0 -0
  8. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-314.pyc +0 -0
  9. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-314.pyc +0 -0
  10. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-314.pyc +0 -0
  11. package/plugins/business-analyst/skills/business-analyst/scripts/test/quality-gates.test.mjs +1 -1
  12. package/plugins/business-analyst/skills/business-analyst/scripts/test/review-browser.test.mjs +2 -2
  13. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_body.cpython-314.pyc +0 -0
  14. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_flow.cpython-314.pyc +0 -0
  15. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_package.cpython-314.pyc +0 -0
  16. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_xml.cpython-314.pyc +0 -0
  17. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_quotes.cpython-314.pyc +0 -0
  18. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_rules.cpython-314.pyc +0 -0
  19. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_schema.cpython-314.pyc +0 -0
  20. package/plugins/presales/.claude-plugin/plugin.json +9 -0
  21. package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/workflow-or-exact-stop.md +1 -1
  22. package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/evals.json +5 -5
  23. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/ba-facts-cli.test.mjs +5 -1
  24. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/ba-package-cli.test.mjs +5 -1
  25. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/browser.test.mjs +6 -2
  26. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/check-quotes-cli.test.mjs +5 -1
  27. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/drift-cli.test.mjs +5 -1
  28. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/inputs.test.mjs +6 -2
  29. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-config-cli.test.mjs +5 -1
  30. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-export-cli.test.mjs +5 -1
  31. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-gen-cli.test.mjs +5 -1
  32. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/record-cli.test.mjs +5 -1
  33. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/render.test.mjs +22 -18
  34. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/rerun-safety.test.mjs +5 -1
  35. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-quotes-cli.test.mjs +5 -1
  36. package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-strategy-cli.test.mjs +5 -1
  37. package/plugins/{solution-architect → presales}/skills/estimate/README.md +14 -4
  38. package/plugins/{solution-architect → presales}/skills/estimate/classic/references/writing.md +1 -1
  39. package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/roadmap.mjs +9 -5
  40. package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/estimate-math.test.mjs +11 -0
  41. package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/project-price.test.mjs +10 -0
  42. package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/xlsx-export.test.mjs +12 -12
  43. package/plugins/{solution-architect → presales}/skills/estimate/evals/evals.json +1 -1
  44. package/plugins/presales/skills/estimate/shared/assets/xlsx-export.js +392 -0
  45. package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/project-price.mjs +6 -4
  46. package/plugins/presales/skills/estimate/workflow-based/FLOW.md +176 -0
  47. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/assets/estimate-template.html +127 -10
  48. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/assets/estimator-system.xlsx +0 -0
  49. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/assets/score-review.html +164 -27
  50. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/references/linking.md +3 -2
  51. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/build-template.mjs +9 -2
  52. package/plugins/presales/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +76 -0
  53. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/build-xlsx-template.py +3 -3
  54. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/cites.mjs +60 -0
  55. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/groups.mjs +65 -0
  56. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/page-html.mjs +43 -0
  57. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/page-view.mjs +30 -4
  58. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/rollup.mjs +43 -12
  59. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/schema-components.mjs +17 -0
  60. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/schema.mjs +23 -1
  61. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/score-diff.mjs +6 -1
  62. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/score-html.mjs +23 -4
  63. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/xlsx-group-rows.mjs +20 -0
  64. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +81 -0
  65. package/plugins/presales/skills/estimate/workflow-based/scripts/lib/xlsx-tasks.mjs +25 -0
  66. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/render.mjs +8 -10
  67. package/plugins/presales/skills/estimate/workflow-based/scripts/score-review.mjs +81 -0
  68. package/plugins/presales/skills/estimate/workflow-based/scripts/template/cites.js +46 -0
  69. package/plugins/presales/skills/estimate/workflow-based/scripts/template/effort.css +22 -0
  70. package/plugins/presales/skills/estimate/workflow-based/scripts/template/effort.mjs +37 -0
  71. package/plugins/presales/skills/estimate/workflow-based/scripts/template/estimate-page.css +10 -0
  72. package/plugins/presales/skills/estimate/workflow-based/scripts/template/estimate-page.js +16 -0
  73. package/plugins/presales/skills/estimate/workflow-based/scripts/template/feature-tasks.js +33 -0
  74. package/plugins/presales/skills/estimate/workflow-based/scripts/template/lavish.mjs +39 -0
  75. package/plugins/presales/skills/estimate/workflow-based/scripts/template/tasks.css +25 -0
  76. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/view.js +21 -2
  77. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/also-builds-browser.test.mjs +6 -4
  78. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/browser.test.mjs +10 -7
  79. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/build-pages.test.mjs +10 -15
  80. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/build-template.test.mjs +6 -2
  81. package/plugins/presales/skills/estimate/workflow-based/scripts/test/cites.test.mjs +64 -0
  82. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/cli.test.mjs +1 -0
  83. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/estimator-system.test.mjs +5 -5
  84. package/plugins/presales/skills/estimate/workflow-based/scripts/test/feature-tasks-browser.test.mjs +39 -0
  85. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/fixtures/inputs-pass.json +8 -8
  86. package/plugins/presales/skills/estimate/workflow-based/scripts/test/groups-browser.test.mjs +39 -0
  87. package/plugins/presales/skills/estimate/workflow-based/scripts/test/groups.test.mjs +156 -0
  88. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/link-picker-browser.test.mjs +1 -10
  89. package/plugins/presales/skills/estimate/workflow-based/scripts/test/open-lavish.test.mjs +54 -0
  90. package/plugins/presales/skills/estimate/workflow-based/scripts/test/page-html.test.mjs +21 -0
  91. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/pages-browser.test.mjs +25 -21
  92. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/render.test.mjs +5 -5
  93. package/plugins/presales/skills/estimate/workflow-based/scripts/test/review-effort.test.mjs +104 -0
  94. package/plugins/presales/skills/estimate/workflow-based/scripts/test/review-lavish.test.mjs +193 -0
  95. package/plugins/presales/skills/estimate/workflow-based/scripts/test/review-tasks.test.mjs +66 -0
  96. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/rollup.test.mjs +8 -0
  97. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/schema.test.mjs +18 -0
  98. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/score-review.test.mjs +10 -1
  99. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/stage.mjs +16 -8
  100. package/plugins/presales/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +110 -0
  101. package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/validate.mjs +2 -0
  102. package/plugins/{solution-architect → presales}/skills/new-lead/README.md +1 -1
  103. package/plugins/{solution-architect → presales}/skills/new-lead/SKILL.md +1 -1
  104. package/plugins/{solution-architect → presales}/skills/new-lead/evals/evals.json +13 -13
  105. package/plugins/presales/skills/proposal/README.md +63 -0
  106. package/plugins/presales/skills/proposal/SKILL.md +91 -0
  107. package/plugins/presales/skills/proposal/assets/proposal-page.html +156 -0
  108. package/plugins/presales/skills/proposal/assets/roboto-widths.json +1 -0
  109. package/plugins/{solution-architect → presales}/skills/proposal/evals/evals.json +22 -22
  110. package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation-inputs.json +35 -8
  111. package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/estimation.json +35 -8
  112. package/plugins/presales/skills/proposal/references/build.md +33 -0
  113. package/plugins/presales/skills/proposal/references/diagrams.md +123 -0
  114. package/plugins/presales/skills/proposal/references/interview.md +66 -0
  115. package/plugins/presales/skills/proposal/references/review.md +41 -0
  116. package/plugins/{solution-architect → presales}/skills/proposal/references/workflow.md +30 -22
  117. package/plugins/presales/skills/proposal/references/writing.md +167 -0
  118. package/plugins/presales/skills/proposal/scripts/build/arrows.mjs +70 -0
  119. package/plugins/presales/skills/proposal/scripts/build/brand.mjs +43 -0
  120. package/plugins/presales/skills/proposal/scripts/build/build.mjs +75 -0
  121. package/plugins/presales/skills/proposal/scripts/build/contents.mjs +42 -0
  122. package/plugins/presales/skills/proposal/scripts/build/docx-blocks.mjs +102 -0
  123. package/plugins/presales/skills/proposal/scripts/build/docx-doc.mjs +91 -0
  124. package/plugins/presales/skills/proposal/scripts/build/docx-inline.mjs +48 -0
  125. package/plugins/presales/skills/proposal/scripts/build/docx-table.mjs +75 -0
  126. package/plugins/presales/skills/proposal/scripts/build/figures.mjs +95 -0
  127. package/plugins/presales/skills/proposal/scripts/build/html.mjs +80 -0
  128. package/plugins/presales/skills/proposal/scripts/build/layout.mjs +48 -0
  129. package/plugins/presales/skills/proposal/scripts/build/notes.mjs +30 -0
  130. package/plugins/presales/skills/proposal/scripts/build/overlap.mjs +57 -0
  131. package/plugins/presales/skills/proposal/scripts/build/page.mjs +50 -0
  132. package/plugins/presales/skills/proposal/scripts/build/pdf.mjs +88 -0
  133. package/plugins/presales/skills/proposal/scripts/build/scope-ids.mjs +10 -0
  134. package/plugins/presales/skills/proposal/scripts/build/tool.mjs +35 -0
  135. package/plugins/{solution-architect → presales}/skills/proposal/scripts/derive.mjs +7 -1
  136. package/plugins/presales/skills/proposal/scripts/diagram/align.mjs +36 -0
  137. package/plugins/presales/skills/proposal/scripts/diagram/draw.mjs +81 -0
  138. package/plugins/presales/skills/proposal/scripts/diagram/grid.mjs +90 -0
  139. package/plugins/presales/skills/proposal/scripts/diagram/icons.mjs +30 -0
  140. package/plugins/presales/skills/proposal/scripts/diagram/index.mjs +23 -0
  141. package/plugins/presales/skills/proposal/scripts/diagram/layout.mjs +42 -0
  142. package/plugins/presales/skills/proposal/scripts/diagram/obstacles.mjs +49 -0
  143. package/plugins/presales/skills/proposal/scripts/diagram/pack.mjs +101 -0
  144. package/plugins/presales/skills/proposal/scripts/diagram/route.mjs +129 -0
  145. package/plugins/presales/skills/proposal/scripts/diagram/steps.mjs +74 -0
  146. package/plugins/presales/skills/proposal/scripts/diagram/style.mjs +61 -0
  147. package/plugins/presales/skills/proposal/scripts/diagram/text.mjs +28 -0
  148. package/plugins/presales/skills/proposal/scripts/lib/bans.mjs +82 -0
  149. package/plugins/presales/skills/proposal/scripts/lib/checks-client.mjs +74 -0
  150. package/plugins/presales/skills/proposal/scripts/lib/checks-doc.mjs +78 -0
  151. package/plugins/presales/skills/proposal/scripts/lib/checks.mjs +44 -0
  152. package/plugins/presales/skills/proposal/scripts/lib/citations.mjs +45 -0
  153. package/plugins/presales/skills/proposal/scripts/lib/diagram-spec.mjs +67 -0
  154. package/plugins/presales/skills/proposal/scripts/lib/figures.mjs +79 -0
  155. package/plugins/presales/skills/proposal/scripts/lib/load.mjs +42 -0
  156. package/plugins/presales/skills/proposal/scripts/lib/money.mjs +62 -0
  157. package/plugins/presales/skills/proposal/scripts/lib/parts.mjs +83 -0
  158. package/plugins/presales/skills/proposal/scripts/lib/price-source.mjs +74 -0
  159. package/plugins/presales/skills/proposal/scripts/lib/prose.mjs +55 -0
  160. package/plugins/presales/skills/proposal/scripts/lib/workbook.mjs +86 -0
  161. package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/workflow-checks.mjs +7 -2
  162. package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/workflow-cli.mjs +16 -18
  163. package/plugins/presales/skills/proposal/scripts/lib/workflow-md.mjs +35 -0
  164. package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/workflow-view.mjs +3 -3
  165. package/plugins/presales/skills/proposal/scripts/render.mjs +55 -0
  166. package/plugins/presales/skills/proposal/scripts/test/acme.mjs +28 -0
  167. package/plugins/presales/skills/proposal/scripts/test/bans.test.mjs +59 -0
  168. package/plugins/presales/skills/proposal/scripts/test/build.test.mjs +128 -0
  169. package/plugins/presales/skills/proposal/scripts/test/diagram.test.mjs +154 -0
  170. package/plugins/presales/skills/proposal/scripts/test/docs.test.mjs +13 -0
  171. package/plugins/presales/skills/proposal/scripts/test/e2e.test.mjs +20 -0
  172. package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/evals-fixtures.test.mjs +8 -5
  173. package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/figures.test.mjs +29 -1
  174. package/plugins/presales/skills/proposal/scripts/test/fixtures/acme/diagrams/aws-on-neutral.json +60 -0
  175. package/plugins/presales/skills/proposal/scripts/test/fixtures/acme/diagrams/booking.json +61 -0
  176. package/plugins/presales/skills/proposal/scripts/test/fixtures/acme/proposal-fail.md +49 -0
  177. package/plugins/presales/skills/proposal/scripts/test/fixtures/acme/proposal.md +72 -0
  178. package/plugins/presales/skills/proposal/scripts/test/fixtures/acme/references.json +5 -0
  179. package/plugins/presales/skills/proposal/scripts/test/fixtures/workbook-recalculated.xlsx +0 -0
  180. package/plugins/presales/skills/proposal/scripts/test/fixtures/workbook-unrecalculated.xlsx +0 -0
  181. package/plugins/presales/skills/proposal/scripts/test/layout.test.mjs +89 -0
  182. package/plugins/presales/skills/proposal/scripts/test/parts.test.mjs +112 -0
  183. package/plugins/presales/skills/proposal/scripts/test/prices.test.mjs +122 -0
  184. package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/quality-gates.test.mjs +1 -1
  185. package/plugins/presales/skills/proposal/scripts/test/steps.test.mjs +38 -0
  186. package/plugins/presales/skills/proposal/scripts/test/validate.test.mjs +46 -0
  187. package/plugins/presales/skills/proposal/scripts/test/workbook.test.mjs +76 -0
  188. package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/workflow-checks.test.mjs +7 -2
  189. package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/workflow-view.test.mjs +15 -10
  190. package/plugins/{solution-architect → presales}/skills/proposal/scripts/validate.mjs +8 -3
  191. package/src/cli/install.mjs +18 -2
  192. package/src/cli/registry.mjs +8 -0
  193. package/src/cli/targets.mjs +4 -2
  194. package/src/cli/uninstall.mjs +11 -1
  195. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_data.cpython-312.pyc +0 -0
  196. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_layout.cpython-312.pyc +0 -0
  197. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/review_page.cpython-312.pyc +0 -0
  198. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_checks.cpython-312.pyc +0 -0
  199. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/scope_render.cpython-312.pyc +0 -0
  200. package/plugins/business-analyst/skills/business-analyst/scripts/__pycache__/validate.cpython-312.pyc +0 -0
  201. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_body.cpython-312.pyc +0 -0
  202. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_flow.cpython-312.pyc +0 -0
  203. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_package.cpython-312.pyc +0 -0
  204. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/docx_xml.cpython-312.pyc +0 -0
  205. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_quotes.cpython-312.pyc +0 -0
  206. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_rules.cpython-312.pyc +0 -0
  207. package/plugins/business-analyst/skills/draft-scope/scripts/__pycache__/draft_schema.cpython-312.pyc +0 -0
  208. package/plugins/solution-architect/.claude-plugin/plugin.json +0 -9
  209. package/plugins/solution-architect/skills/estimate/shared/assets/xlsx-export.js +0 -336
  210. package/plugins/solution-architect/skills/estimate/workflow-based/FLOW.md +0 -91
  211. package/plugins/solution-architect/skills/estimate/workflow-based/assets/estimate-components.html +0 -1058
  212. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-components-template.mjs +0 -80
  213. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/build-workflow-template.mjs +0 -51
  214. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/page-html.mjs +0 -44
  215. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/lib/xlsx-rows.mjs +0 -51
  216. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/score-review.mjs +0 -46
  217. package/plugins/solution-architect/skills/estimate/workflow-based/scripts/test/xlsx-rows.test.mjs +0 -58
  218. package/plugins/solution-architect/skills/proposal/README.md +0 -51
  219. package/plugins/solution-architect/skills/proposal/SKILL.md +0 -69
  220. package/plugins/solution-architect/skills/proposal/assets/proposal-template.html +0 -82
  221. package/plugins/solution-architect/skills/proposal/assets/proposal-workflow.html +0 -143
  222. package/plugins/solution-architect/skills/proposal/references/interview.md +0 -60
  223. package/plugins/solution-architect/skills/proposal/references/review.md +0 -40
  224. package/plugins/solution-architect/skills/proposal/references/writing.md +0 -104
  225. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-client.mjs +0 -58
  226. package/plugins/solution-architect/skills/proposal/scripts/lib/checks-doc.mjs +0 -64
  227. package/plugins/solution-architect/skills/proposal/scripts/lib/checks.mjs +0 -21
  228. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-body.mjs +0 -42
  229. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-package.mjs +0 -56
  230. package/plugins/solution-architect/skills/proposal/scripts/lib/docx-xml.mjs +0 -44
  231. package/plugins/solution-architect/skills/proposal/scripts/lib/figures.mjs +0 -34
  232. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-html.mjs +0 -39
  233. package/plugins/solution-architect/skills/proposal/scripts/lib/workflow-page.mjs +0 -30
  234. package/plugins/solution-architect/skills/proposal/scripts/render.mjs +0 -64
  235. package/plugins/solution-architect/skills/proposal/scripts/test/checks-client.test.mjs +0 -147
  236. package/plugins/solution-architect/skills/proposal/scripts/test/checks-doc.test.mjs +0 -152
  237. package/plugins/solution-architect/skills/proposal/scripts/test/docs.test.mjs +0 -57
  238. package/plugins/solution-architect/skills/proposal/scripts/test/docx.test.mjs +0 -68
  239. package/plugins/solution-architect/skills/proposal/scripts/test/e2e.test.mjs +0 -30
  240. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-fail.md +0 -27
  241. package/plugins/solution-architect/skills/proposal/scripts/test/fixtures/proposal-pass.md +0 -51
  242. package/plugins/solution-architect/skills/proposal/scripts/test/render.test.mjs +0 -70
  243. package/plugins/solution-architect/skills/proposal/scripts/test/validate.test.mjs +0 -41
  244. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-browser.test.mjs +0 -96
  245. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-docs.test.mjs +0 -25
  246. package/plugins/solution-architect/skills/proposal/scripts/test/workflow-render.test.mjs +0 -75
  247. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/case.yaml +0 -0
  248. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/fixture.sh +0 -0
  249. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/graders/inputs-written.md +0 -0
  250. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/graders/no-proposal-md.md +0 -0
  251. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/graders/skill-fired.md +0 -0
  252. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/graders/validate-then-render.md +0 -0
  253. /package/plugins/{solution-architect → presales}/evals/proposal-workflow/prompt.md +0 -0
  254. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/case.yaml +0 -0
  255. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/fixture.sh +0 -0
  256. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/graders/no-classic-fallback.md +0 -0
  257. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/graders/nothing-written.md +0 -0
  258. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/graders/skill-fired.md +0 -0
  259. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/graders/stops-at-gate.md +0 -0
  260. /package/plugins/{solution-architect → presales}/evals/workflow-gate-no-architecture/prompt.md +0 -0
  261. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/case.yaml +0 -0
  262. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/fixture.sh +0 -0
  263. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/no-estimation-md.md +0 -0
  264. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/pages-or-stop.md +0 -0
  265. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/routed-to-workflow.md +0 -0
  266. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/skill-fired.md +0 -0
  267. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/graders/three-questions-max.md +0 -0
  268. /package/plugins/{solution-architect → presales}/evals/workflow-happy-path/prompt.md +0 -0
  269. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/README.md +0 -0
  270. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/SKILL.md +0 -0
  271. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/OFL.txt +0 -0
  272. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-400-normal.woff2 +0 -0
  273. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/ibm-plex-mono-latin-600-normal.woff2 +0 -0
  274. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-400-normal.woff2 +0 -0
  275. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-500-normal.woff2 +0 -0
  276. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/fonts/ibm-plex-sans-latin-600-normal.woff2 +0 -0
  277. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/mermaid-theme.json +0 -0
  278. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/section-help.json +0 -0
  279. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/assets/viewer-template.html +0 -0
  280. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.json +0 -0
  281. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/fixtures/ba-package-citations/requirements.md +0 -0
  282. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/fixtures/greenfield-llm-triage-spec/triage-service-spec.md +0 -0
  283. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/fixtures/transcript-citations/C1-kickoff-call.txt +0 -0
  284. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/evals/fixtures/transcript-citations/E1-intro-email.md +0 -0
  285. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/extract.md +0 -0
  286. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/interview.md +0 -0
  287. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/likec4.md +0 -0
  288. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/project-types.md +0 -0
  289. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/quality-goals.md +0 -0
  290. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/research.md +0 -0
  291. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/rewriting.md +0 -0
  292. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/viewer.md +0 -0
  293. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/references/writing.md +0 -0
  294. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/ba-facts.mjs +0 -0
  295. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/check-quotes.mjs +0 -0
  296. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/drift.mjs +0 -0
  297. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/ba-package.mjs +0 -0
  298. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/cdp.mjs +0 -0
  299. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/chrome.mjs +0 -0
  300. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/companion-links.mjs +0 -0
  301. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/doc-kinds.mjs +0 -0
  302. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/doc-links.mjs +0 -0
  303. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/doc-routes.mjs +0 -0
  304. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/doc-sections.mjs +0 -0
  305. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/drift.mjs +0 -0
  306. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/embed.mjs +0 -0
  307. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/er-entities.mjs +0 -0
  308. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/fonts.mjs +0 -0
  309. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/frontmatter.mjs +0 -0
  310. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/git-diff.mjs +0 -0
  311. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/inputs.mjs +0 -0
  312. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/likec4-config.mjs +0 -0
  313. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/likec4-extract.mjs +0 -0
  314. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/likec4-steps.mjs +0 -0
  315. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-defs.mjs +0 -0
  316. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-flows.mjs +0 -0
  317. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-inline.mjs +0 -0
  318. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-links.mjs +0 -0
  319. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-list.mjs +0 -0
  320. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-render.mjs +0 -0
  321. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-shape.mjs +0 -0
  322. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-tables.mjs +0 -0
  323. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-views.mjs +0 -0
  324. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/md-wide.mjs +0 -0
  325. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/nav.mjs +0 -0
  326. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/offline.mjs +0 -0
  327. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/port.mjs +0 -0
  328. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/quality-gate.mjs +0 -0
  329. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/section-help.mjs +0 -0
  330. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/slug-registry.mjs +0 -0
  331. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/state.mjs +0 -0
  332. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/strategy-sections.mjs +0 -0
  333. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-clusters.mjs +0 -0
  334. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-deployment.mjs +0 -0
  335. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-elections.mjs +0 -0
  336. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-links.mjs +0 -0
  337. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-model-tables.mjs +0 -0
  338. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-palette.mjs +0 -0
  339. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-provenance.mjs +0 -0
  340. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-quotes.mjs +0 -0
  341. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-strategy.mjs +0 -0
  342. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/lib/validate-tree.mjs +0 -0
  343. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/likec4-config.mjs +0 -0
  344. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/likec4-export.mjs +0 -0
  345. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/likec4-gen.mjs +0 -0
  346. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/record.mjs +0 -0
  347. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/render.mjs +0 -0
  348. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/serve.mjs +0 -0
  349. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/ba-package.test.mjs +0 -0
  350. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/companion-links.test.mjs +0 -0
  351. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/doc-kinds.test.mjs +0 -0
  352. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/doc-links.test.mjs +0 -0
  353. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/doc-routes.test.mjs +0 -0
  354. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/doc-sections.test.mjs +0 -0
  355. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/drift.test.mjs +0 -0
  356. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/embed.test.mjs +0 -0
  357. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/er-entities.test.mjs +0 -0
  358. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/extract-workflow.test.mjs +0 -0
  359. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/ARCHITECTURE.md +0 -0
  360. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/broken/model.c4 +0 -0
  361. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/c4-src/pass/model.c4 +0 -0
  362. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/adr/0001-sample.md +0 -0
  363. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimate.html +0 -0
  364. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/docs/estimation.md +0 -0
  365. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model-broken.json +0 -0
  366. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/model.json +0 -0
  367. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/docs-pass/threat-model.md +0 -0
  368. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/sample-model.json +0 -0
  369. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fixtures/sample.c4 +0 -0
  370. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/fonts.test.mjs +0 -0
  371. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/frontmatter.test.mjs +0 -0
  372. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/git-diff.test.mjs +0 -0
  373. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-config.test.mjs +0 -0
  374. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-extract.test.mjs +0 -0
  375. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/likec4-steps.test.mjs +0 -0
  376. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-flows.test.mjs +0 -0
  377. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-links.test.mjs +0 -0
  378. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-provenance.test.mjs +0 -0
  379. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-render.test.mjs +0 -0
  380. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-tables.test.mjs +0 -0
  381. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-views.test.mjs +0 -0
  382. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/md-wide.test.mjs +0 -0
  383. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/nav.test.mjs +0 -0
  384. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/offline.test.mjs +0 -0
  385. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/quality-gate.test.mjs +0 -0
  386. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/quality-gates.test.mjs +0 -0
  387. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/research-workflow.test.mjs +0 -0
  388. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/rewriting.test.mjs +0 -0
  389. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/section-help.test.mjs +0 -0
  390. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/serve.test.mjs +0 -0
  391. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/state.test.mjs +0 -0
  392. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-clusters.test.mjs +0 -0
  393. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-deployment.test.mjs +0 -0
  394. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-elections.test.mjs +0 -0
  395. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-links.test.mjs +0 -0
  396. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-model-tables.test.mjs +0 -0
  397. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-provenance.test.mjs +0 -0
  398. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-quotes.test.mjs +0 -0
  399. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-strategy.test.mjs +0 -0
  400. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/validate-tree.test.mjs +0 -0
  401. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/test/viewer-template.test.mjs +0 -0
  402. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/scripts/validate.mjs +0 -0
  403. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/workflows/extract.js +0 -0
  404. /package/plugins/{solution-architect → presales}/skills/analyze-requirements/workflows/research.js +0 -0
  405. /package/plugins/{solution-architect → presales}/skills/estimate/SKILL.md +0 -0
  406. /package/plugins/{solution-architect → presales}/skills/estimate/classic/FLOW.md +0 -0
  407. /package/plugins/{solution-architect → presales}/skills/estimate/classic/assets/estimate-template-agentic.html +0 -0
  408. /package/plugins/{solution-architect → presales}/skills/estimate/classic/assets/estimate-template.html +0 -0
  409. /package/plugins/{solution-architect → presales}/skills/estimate/classic/assets/scores-review-template.html +0 -0
  410. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/agentic-estimation.md +0 -0
  411. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/ai-multipliers.md +0 -0
  412. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/interview.md +0 -0
  413. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/scoring-guide.md +0 -0
  414. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/slicing.md +0 -0
  415. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/task-shapes.md +0 -0
  416. /package/plugins/{solution-architect → presales}/skills/estimate/classic/references/techniques.md +0 -0
  417. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/compute.mjs +0 -0
  418. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/agentic-checks.mjs +0 -0
  419. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/checks.mjs +0 -0
  420. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/components.mjs +0 -0
  421. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/md-tables.mjs +0 -0
  422. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/redact.mjs +0 -0
  423. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/rollup.mjs +0 -0
  424. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/schema.mjs +0 -0
  425. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/score-csv.mjs +0 -0
  426. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/score-html.mjs +0 -0
  427. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/lib/scoring-checks.mjs +0 -0
  428. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/render.mjs +0 -0
  429. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/score-review.mjs +0 -0
  430. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/baselines.test.mjs +0 -0
  431. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/browser-agentic.test.mjs +0 -0
  432. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/browser.test.mjs +0 -0
  433. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/compute.test.mjs +0 -0
  434. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/e2e.test.mjs +0 -0
  435. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/agentic-estimation-fail.md +0 -0
  436. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/agentic-estimation-pass.md +0 -0
  437. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/agentic-inputs.json +0 -0
  438. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/booking-inputs.json +0 -0
  439. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/estimation-fail.md +0 -0
  440. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/estimation-pass.md +0 -0
  441. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/fixtures/measurements.jsonl +0 -0
  442. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/measurements.test.mjs +0 -0
  443. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/pricing.test.mjs +0 -0
  444. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/quality-gates.test.mjs +0 -0
  445. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/references.test.mjs +0 -0
  446. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/render.test.mjs +0 -0
  447. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/schema.test.mjs +0 -0
  448. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/score-review.test.mjs +0 -0
  449. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/scoring.test.mjs +0 -0
  450. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/url-state.test.mjs +0 -0
  451. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/validate.test.mjs +0 -0
  452. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/zip-store.test.mjs +0 -0
  453. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/test/zip.mjs +0 -0
  454. /package/plugins/{solution-architect → presales}/skills/estimate/classic/scripts/validate.mjs +0 -0
  455. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/gate-check-northgate/northgate-email.md +0 -0
  456. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-agentic-halyard/measurements.jsonl +0 -0
  457. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-agentic-halyard/requirements.json +0 -0
  458. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-agentic-halyard/requirements.md +0 -0
  459. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-traditional-trellis/ARCHITECTURE.md +0 -0
  460. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-traditional-trellis/requirements.json +0 -0
  461. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/pre-fed-traditional-trellis/requirements.md +0 -0
  462. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +0 -0
  463. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.json +0 -0
  464. /package/plugins/{solution-architect → presales}/skills/estimate/evals/fixtures/workflow-sin-kowa-mini/requirements.md +0 -0
  465. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/agentic-task-schema.mjs +0 -0
  466. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/baselines.mjs +0 -0
  467. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/context-schema.mjs +0 -0
  468. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/estimate-math.mjs +0 -0
  469. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/inline.mjs +0 -0
  470. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/measurements.mjs +0 -0
  471. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/pricing.mjs +0 -0
  472. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/score-diff.mjs +0 -0
  473. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/scoring-schema.mjs +0 -0
  474. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/scoring.mjs +0 -0
  475. /package/plugins/{solution-architect → presales}/skills/estimate/shared/lib/zip.mjs +0 -0
  476. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/references/hidden-work-by-type.md +0 -0
  477. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/compute.mjs +0 -0
  478. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/pair-findings.mjs +0 -0
  479. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/lib/requirements.mjs +0 -0
  480. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/also-builds.css +0 -0
  481. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/also-builds.js +0 -0
  482. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/arch-link.js +0 -0
  483. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/click.js +0 -0
  484. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/link-picker.css +0 -0
  485. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/link-picker.js +0 -0
  486. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/template/prelude.js +0 -0
  487. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/fixtures/ARCHITECTURE-mini.md +0 -0
  488. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/fixtures/feedback.json +0 -0
  489. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/fixtures/measurements.jsonl +0 -0
  490. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/fixtures/requirements.json +0 -0
  491. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/page-view.test.mjs +0 -0
  492. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/quality-gates.test.mjs +0 -0
  493. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/requirements.test.mjs +0 -0
  494. /package/plugins/{solution-architect → presales}/skills/estimate/workflow-based/scripts/test/workflow-script.test.mjs +0 -0
  495. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/dashboard/detail.html +0 -0
  496. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/dashboard/index.html +0 -0
  497. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/dashboard/start.sh +0 -0
  498. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/dashboard/stats.mjs +0 -0
  499. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/dashboard/vendor/reactflow-bundle.js +0 -0
  500. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/vendor-build/entry.jsx +0 -0
  501. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/vendor-build/package-lock.json +0 -0
  502. /package/plugins/{solution-architect → presales}/skills/new-lead/assets/vendor-build/package.json +0 -0
  503. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/ARCHITECTURE.md +0 -0
  504. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/brief.md +0 -0
  505. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/dist/index.html +0 -0
  506. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/estimation.json +0 -0
  507. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/proposal.md +0 -0
  508. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/harborline-logistics-tms/requirements.json +0 -0
  509. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/sable-dental-booking/rfp.md +0 -0
  510. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/vellum-books-checkout/ARCHITECTURE.md +0 -0
  511. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads/vellum-books-checkout/rfp.md +0 -0
  512. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/existing-root-pipeline/leads.json +0 -0
  513. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/fresh-lead-northwind/rfp-northwind.md +0 -0
  514. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/skips-to-proposal/leads/meridian-freight-portal/rfp.md +0 -0
  515. /package/plugins/{solution-architect → presales}/skills/new-lead/evals/fixtures/skips-to-proposal/leads.json +0 -0
  516. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/init-root.mjs +0 -0
  517. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lead-upsert.mjs +0 -0
  518. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lib/enrich.mjs +0 -0
  519. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lib/map-nodes.mjs +0 -0
  520. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lib/map.mjs +0 -0
  521. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lib/port.mjs +0 -0
  522. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/lib/registry.mjs +0 -0
  523. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/serve.mjs +0 -0
  524. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/e2e-workspace.test.mjs +0 -0
  525. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/enrich.test.mjs +0 -0
  526. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/ARCHITECTURE.md +0 -0
  527. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/brief.md +0 -0
  528. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/index.html +0 -0
  529. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/proposal-non-tech.html +0 -0
  530. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/dist/threat-model.html +0 -0
  531. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation-inputs.json +0 -0
  532. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/estimation.json +0 -0
  533. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/notes.md +0 -0
  534. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/proposal-non-tech.md +0 -0
  535. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads/acme-crm/rfp.md +0 -0
  536. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/fixtures/root/leads.json +0 -0
  537. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/init-root.test.mjs +0 -0
  538. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/lead-upsert.test.mjs +0 -0
  539. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/map.test.mjs +0 -0
  540. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/port.test.mjs +0 -0
  541. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/registry-io.test.mjs +0 -0
  542. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/registry.test.mjs +0 -0
  543. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/serve.test.mjs +0 -0
  544. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/stats.test.mjs +0 -0
  545. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/validate-cli.test.mjs +0 -0
  546. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/test/vendor-bundle.test.mjs +0 -0
  547. /package/plugins/{solution-architect → presales}/skills/new-lead/scripts/validate.mjs +0 -0
  548. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-rivet-gym/ARCHITECTURE.md +0 -0
  549. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-rivet-gym/brief.md +0 -0
  550. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/ARCHITECTURE.md +0 -0
  551. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/brief.md +0 -0
  552. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation-inputs.json +0 -0
  553. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/gate-check-unpriced-harborline/estimation.json +0 -0
  554. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/ARCHITECTURE.md +0 -0
  555. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/brief.md +0 -0
  556. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/dist/mermaid.js +0 -0
  557. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation-inputs.json +0 -0
  558. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.json +0 -0
  559. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-harborline-dispatch/estimation.md +0 -0
  560. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/ARCHITECTURE.md +0 -0
  561. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/brief.md +0 -0
  562. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/dist/mermaid.js +0 -0
  563. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation-inputs.json +0 -0
  564. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.json +0 -0
  565. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/pre-fed-meridian-dental/estimation.md +0 -0
  566. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/ARCHITECTURE.md +0 -0
  567. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/measurements.jsonl +0 -0
  568. /package/plugins/{solution-architect → presales}/skills/proposal/evals/fixtures/workflow-sin-kowa-mini/requirements.json +0 -0
  569. /package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/jargon.mjs +0 -0
  570. /package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/sections.mjs +0 -0
  571. /package/plugins/{solution-architect → presales}/skills/proposal/scripts/lib/workflow-lead.mjs +0 -0
  572. /package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/fixtures/proposal-inputs-pass.json +0 -0
  573. /package/plugins/{solution-architect → presales}/skills/proposal/scripts/test/workflow-stage.mjs +0 -0
  574. /package/plugins/{solution-architect → presales}/workflows/review-links.js +0 -0
@@ -0,0 +1,90 @@
1
+ // Shortest orthogonal path on a sparse grid. The grid's lines run just
2
+ // outside and just inside every frame, every frame header and every service,
3
+ // and through every port, so a path can use the channel above a row of zones
4
+ // or the gap between two frames. Each step costs its length, a turn costs a
5
+ // bend, and costOf adds what a segment crosses (a service, a header, a label,
6
+ // another arrow).
7
+ const BEND = 40;
8
+ const DIRS = [[1, 0], [-1, 0], [0, 1], [0, -1]];
9
+ const BACK = [1, 0, 3, 2];
10
+
11
+ export function gridLines(rects, points) {
12
+ const xs = new Set(points.map((p) => p[0]));
13
+ const ys = new Set(points.map((p) => p[1]));
14
+ for (const r of rects) for (const d of [-10, 10]) {
15
+ xs.add(r.x + d); xs.add(r.x + r.w + d); ys.add(r.y + d); ys.add(r.y + r.h + d);
16
+ }
17
+ const sort = (s) => [...s].map((v) => Math.round(v * 10) / 10).filter((v, i, a) => a.indexOf(v) === i).sort((a, b) => a - b);
18
+ return { xs: sort(xs), ys: sort(ys) };
19
+ }
20
+
21
+ function push(heap, item) {
22
+ heap.push(item);
23
+ for (let i = heap.length - 1; i > 0;) {
24
+ const p = (i - 1) >> 1;
25
+ if (heap[p][0] <= heap[i][0]) break;
26
+ [heap[p], heap[i]] = [heap[i], heap[p]]; i = p;
27
+ }
28
+ }
29
+
30
+ function pop(heap) {
31
+ const top = heap[0]; const last = heap.pop();
32
+ if (heap.length) {
33
+ heap[0] = last;
34
+ for (let i = 0; ;) {
35
+ const [l, r] = [2 * i + 1, 2 * i + 2];
36
+ let m = i;
37
+ if (l < heap.length && heap[l][0] < heap[m][0]) m = l;
38
+ if (r < heap.length && heap[r][0] < heap[m][0]) m = r;
39
+ if (m === i) break;
40
+ [heap[m], heap[i]] = [heap[i], heap[m]]; i = m;
41
+ }
42
+ }
43
+ return top;
44
+ }
45
+
46
+ const at = (grid, [x, y]) => [grid.xs.indexOf(Math.round(x * 10) / 10), grid.ys.indexOf(Math.round(y * 10) / 10)];
47
+
48
+ // Walks prev back from the goal state to the start, as grid points.
49
+ function rebuild(grid, { prev, key }) {
50
+ const pts = [];
51
+ for (let k = key; k >= 0; k = prev[k]) {
52
+ const cell = k >> 2;
53
+ pts.unshift([grid.xs[Math.floor(cell / grid.ys.length)], grid.ys[cell % grid.ys.length]]);
54
+ }
55
+ return pts;
56
+ }
57
+
58
+ function step(grid, { state, costOf }) {
59
+ const [cell, d] = [state >> 2, state & 3];
60
+ const [ix, iy] = [Math.floor(cell / grid.ys.length), cell % grid.ys.length];
61
+ return DIRS.map(([dx, dy], nd) => {
62
+ const [jx, jy] = [ix + dx, iy + dy];
63
+ if (nd === BACK[d] || jx < 0 || jy < 0 || jx >= grid.xs.length || jy >= grid.ys.length) return null;
64
+ const seg = [[grid.xs[ix], grid.ys[iy]], [grid.xs[jx], grid.ys[jy]]];
65
+ const c = Math.abs(seg[1][0] - seg[0][0]) + Math.abs(seg[1][1] - seg[0][1]) + (nd === d ? 0 : BEND) + costOf(seg);
66
+ return [((jx * grid.ys.length + jy) << 2) | nd, c];
67
+ }).filter(Boolean);
68
+ }
69
+
70
+ // starts: [{ pt, dir, cost }]; goals: [{ pt, dir, cost }] where dir is the
71
+ // direction of the final move (0 E, 1 W, 2 S, 3 N). Returns the grid points.
72
+ export function findPath(grid, { starts, goals, costOf }) {
73
+ const n = grid.xs.length * grid.ys.length * 4;
74
+ const dist = new Float64Array(n).fill(Infinity);
75
+ const prev = new Int32Array(n).fill(-1);
76
+ const heap = [];
77
+ const keyOf = (pt, dir) => { const [ix, iy] = at(grid, pt); return ((ix * grid.ys.length + iy) << 2) | dir; };
78
+ for (const s of starts) { const k = keyOf(s.pt, s.dir); if (s.cost < dist[k]) { dist[k] = s.cost; push(heap, [s.cost, k]); } }
79
+ const goal = new Map(goals.map((g) => [keyOf(g.pt, g.dir), g.cost]));
80
+ while (heap.length) {
81
+ const [c, k] = pop(heap);
82
+ if (c > dist[k]) continue;
83
+ if (goal.has(k)) return rebuild(grid, { prev, key: k });
84
+ for (const [nk, w] of step(grid, { state: k, costOf })) {
85
+ const nc = c + w + (goal.get(nk) ?? 0);
86
+ if (nc < dist[nk]) { dist[nk] = nc; prev[nk] = k; push(heap, [nc, nk]); }
87
+ }
88
+ }
89
+ return null;
90
+ }
@@ -0,0 +1,30 @@
1
+ // Icon symbols for the architecture figures. Neutral icons are Lucide glyphs
2
+ // (lucide-static, ISC licence) drawn white on a family tile. AWS icons are the
3
+ // official AWS Architecture Icons (aws-icons package), used as published:
4
+ // "aws:<Name>" is a service icon, "aws-res:<Name>" a resource icon, and group
5
+ // badges come from the architecture-group set. Both packages live in the
6
+ // pinned tool folder (references/build.md), never in the repo.
7
+ import { existsSync, readFileSync } from 'node:fs';
8
+ import { join } from 'node:path';
9
+
10
+ const AWS_SETS = { 'aws:': 'architecture-service', 'aws-res:': 'resource', 'aws-group:': 'architecture-group' };
11
+
12
+ export const isAwsIcon = (name) => /^aws(?:-res|-group)?:/.test(String(name));
13
+ export const symbolId = (name) => `i-${String(name).replace(/[^A-Za-z0-9-]/g, '_')}`;
14
+
15
+ function iconFile(name, toolDir) {
16
+ const prefix = Object.keys(AWS_SETS).find((p) => name.startsWith(p));
17
+ if (prefix) return join(toolDir, 'node_modules/aws-icons/icons', AWS_SETS[prefix], `${name.slice(prefix.length)}.svg`);
18
+ return join(toolDir, 'node_modules/lucide-static/icons', `${name}.svg`);
19
+ }
20
+
21
+ function symbol(name, toolDir) {
22
+ const file = iconFile(name, toolDir);
23
+ if (!existsSync(file)) throw new Error(`diagram icon "${name}" not found (${file})`);
24
+ const src = readFileSync(file, 'utf8').replace(/<!--[\s\S]*?-->/g, '').replace(/<title>[\s\S]*?<\/title>/g, '');
25
+ const m = /<svg[^>]*viewBox="([^"]+)"[^>]*>([\s\S]*)<\/svg>/.exec(src);
26
+ if (isAwsIcon(name)) return `<symbol id="${symbolId(name)}" viewBox="${m[1]}">${m[2].trim()}</symbol>`;
27
+ return `<symbol id="${symbolId(name)}" viewBox="${m[1]}" fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round">${m[2].trim()}</symbol>`;
28
+ }
29
+
30
+ export const symbols = (names, toolDir) => [...new Set(names)].sort().map((n) => symbol(n, toolDir)).join('');
@@ -0,0 +1,23 @@
1
+ // Architecture spec (references/diagrams.md) to a style-B SVG: layout.mjs
2
+ // arranges and routes it, draw.mjs paints it, icons.mjs supplies the glyphs
3
+ // from the icon packages in the pinned tool folder.
4
+ import { INK, arrowSize, groupStyle } from './style.mjs';
5
+ import { layout } from './layout.mjs';
6
+ import { drawSvg } from './draw.mjs';
7
+ import { symbols } from './icons.mjs';
8
+
9
+ const marker = (head) => `<marker id="arr" viewBox="0 0 10 10" refX="8.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="${head}" markerHeight="${head}" orient="auto-start-reverse"><path d="M0,0 L10,5 L0,10 z" fill="${INK}"/></marker>`;
10
+
11
+ function iconNames(spec) {
12
+ const icons = spec.icons ?? 'neutral';
13
+ const badges = spec.groups.filter((g) => g.kind !== 'plain').map((g) => groupStyle(g.kind, icons)).flatMap((st) => [
14
+ st.icon, st.awsIcon && `aws-group:${st.awsIcon}`].filter(Boolean));
15
+ return [...spec.nodes.map((n) => n.icon), ...badges];
16
+ }
17
+
18
+ export async function renderArchitecture(spec, toolDir) {
19
+ const placed = layout(spec);
20
+ const arrow = arrowSize(placed.width, placed.height);
21
+ const defs = `<defs>${marker(arrow.head)}${symbols(iconNames(spec), toolDir)}</defs>`;
22
+ return { svg: drawSvg(spec, { placed, defs, stroke: arrow.stroke }), width: placed.width, height: placed.height, edges: placed.edges.length, warnings: placed.warnings };
23
+ }
@@ -0,0 +1,42 @@
1
+ // Lays out an architecture spec: pack.mjs places the frames and services,
2
+ // route.mjs draws the arrows between them. Also reports any sibling frames of
3
+ // one kind (two zones, two subnets) that do not line up, which the build
4
+ // treats as a finding.
5
+ import { pack, measureNode } from './pack.mjs';
6
+ import { route } from './route.mjs';
7
+ import { solids, channels, foreignFrames, crossings } from './obstacles.mjs';
8
+
9
+ export { measureNode, crossings, foreignFrames };
10
+
11
+ export function misaligned(spec, boxes) {
12
+ const out = [];
13
+ for (const parent of [null, ...spec.groups.map((g) => g.id)]) {
14
+ const kin = spec.groups.filter((g) => (g.in ?? null) === parent && ['zone', 'subnet', 'public-subnet', 'region'].includes(g.kind));
15
+ for (const kind of new Set(kin.map((g) => g.kind))) {
16
+ const same = kin.filter((g) => g.kind === kind).map((g) => boxes.get(g.id));
17
+ const lined = same.every((b) => Math.abs(b.y - same[0].y) < 1) || same.every((b) => Math.abs(b.x - same[0].x) < 1);
18
+ if (!lined) out.push(`sibling ${kind} frames do not line up in a row or a column`);
19
+ }
20
+ }
21
+ return out;
22
+ }
23
+
24
+ // Links whose two tiles line up go first, so they keep their straight line
25
+ // (a primary and its standby, a load balancer and the app beside it); the
26
+ // others route around what is already drawn. Ties keep the spec's order.
27
+ function routeOrder(spec, boxes) {
28
+ const tile = (id) => { const b = boxes.get(id); const s = measureNode(spec.nodes.find((n) => n.id === id)).s; return [b.x + b.w / 2, b.y + s / 2]; };
29
+ const straight = (e) => { const [a, b] = [tile(e.from), tile(e.to)]; return Math.abs(a[0] - b[0]) < 2 || Math.abs(a[1] - b[1]) < 2; };
30
+ return spec.edges.map((e, i) => ({ e, i, k: straight(e) ? 0 : 1 })).sort((x, y) => x.k - y.k || x.i - y.i);
31
+ }
32
+
33
+ export function layout(spec) {
34
+ const placed = pack(spec);
35
+ const hard = solids(spec, placed.boxes);
36
+ const frames = spec.groups.filter((g) => g.kind !== 'plain').map((g) => placed.boxes.get(g.id));
37
+ const ctx = { spec, boxes: placed.boxes, hard, frames, foreign: (e) => foreignFrames(spec, { e, boxes: placed.boxes }), rects: channels(spec, placed.boxes, hard), drawn: [], labels: [] };
38
+ const routed = [];
39
+ for (const { e, i } of routeOrder(spec, placed.boxes)) routed[i] = route(e, ctx);
40
+ const edges = routed;
41
+ return { ...placed, edges, warnings: [...misaligned(spec, placed.boxes), ...crossings(spec, { edges, hard, boxes: placed.boxes })] };
42
+ }
@@ -0,0 +1,49 @@
1
+ // What an arrow must keep clear of, and the check that it did: services and
2
+ // their captions, frame headers, the frames that hold neither end of the
3
+ // arrow, and other arrows' labels. Frame borders may be crossed.
4
+ import { measureNode, titleWidth } from './pack.mjs';
5
+ import { HARD } from './route.mjs';
6
+
7
+ // What no arrow may cross: each service's tile and caption, and each frame's
8
+ // header (badge and title). Arrows may cross frame borders.
9
+ export function solids(spec, boxes) {
10
+ const nodes = spec.nodes.flatMap((n) => {
11
+ const b = boxes.get(n.id); const s = measureNode(n).s; const cx = b.x + b.w / 2;
12
+ return [{ x: cx - s / 2 - 3, y: b.y - 3, w: s + 6, h: s + 6, weight: HARD, what: `service "${n.label}"`, id: n.id },
13
+ { x: b.x - 2, y: b.y + s + 3, w: b.w + 4, h: b.h - s - 1, weight: HARD, what: `the caption of "${n.label}"`, id: n.id }];
14
+ });
15
+ const heads = spec.groups.filter((g) => g.kind !== 'plain').map((g) => ({ ...boxes.get(g.id), w: titleWidth(g), h: 30, weight: HARD, what: `the header of "${g.label}"` }));
16
+ return [...nodes, ...heads];
17
+ }
18
+
19
+ // Frames that hold neither end of an arrow: the arrow must go around them.
20
+ function ancestors(spec, id) {
21
+ const out = new Set();
22
+ for (let p = [...spec.nodes, ...spec.groups].find((x) => x.id === id)?.in; p; p = spec.groups.find((g) => g.id === p)?.in) out.add(p);
23
+ return out;
24
+ }
25
+
26
+ export function foreignFrames(spec, { e, boxes }) {
27
+ const own = new Set([...ancestors(spec, e.from), ...ancestors(spec, e.to)]);
28
+ return spec.groups.filter((g) => g.kind !== 'plain' && !own.has(g.id))
29
+ .map((g) => ({ ...boxes.get(g.id), weight: HARD, what: `the frame "${g.label}", which holds neither end` }));
30
+ }
31
+
32
+ // The rects whose edges give the routing grid its channels.
33
+ export function channels(spec, boxes, hard) {
34
+ return [...spec.groups.filter((g) => g.kind !== 'plain').map((g) => boxes.get(g.id)), ...hard];
35
+ }
36
+
37
+ // Every arrow segment that crosses a service, a caption, a header or another
38
+ // arrow's label: the build refuses the figure.
39
+ export function crossings(spec, { edges, hard, boxes }) {
40
+ const out = [];
41
+ const cut = ([[x1, y1], [x2, y2]], r) => Math.max(x1, x2) > r.x && Math.min(x1, x2) < r.x + r.w && Math.max(y1, y2) > r.y && Math.min(y1, y2) < r.y + r.h;
42
+ const pads = edges.map((e) => e.label && { x: e.label.x, y: e.label.y, w: e.label.width, h: e.label.height, what: `the label "${e.label.text}"` });
43
+ edges.forEach((e, i) => {
44
+ const solid = [...hard, ...foreignFrames(spec, { e: e.spec, boxes }), ...pads.filter((p, j) => p && j !== i)];
45
+ const segs = e.pts.slice(1).map((p, k) => [e.pts[k], p]);
46
+ for (const r of solid) if (segs.some((sg) => cut(sg, r))) out.push(`the arrow ${e.spec.from} → ${e.spec.to} crosses ${r.what}`);
47
+ });
48
+ return out;
49
+ }
@@ -0,0 +1,101 @@
1
+ // Places an architecture spec the way the approved figures are drawn by hand:
2
+ // each frame lays its children out in a row (left to right) or a column (top
3
+ // to bottom), in the order the spec gives. In a row, services alone align
4
+ // their tops (so tiles line up), frames stretch to one height, and a service
5
+ // beside frames is centred; a column centres its children. Sibling zones therefore sit side by side as equal frames, and a
6
+ // primary and its standby face each other. `arrange` on a group, and on the spec for the
7
+ // figure itself, picks row or column; a `plain` group arranges without a frame.
8
+ import { textWidth, wrap } from './text.mjs';
9
+ import { alignLoners } from './align.mjs';
10
+
11
+ const TILE = 52;
12
+ const HEAD = 50;
13
+ const PAD = 10;
14
+ const GAP = 26;
15
+ const TIGHT = 10;
16
+
17
+ export function measureNode(n) {
18
+ const s = n.size ?? TILE;
19
+ const label = wrap(n.label, { width: 150, size: 16, bold: true });
20
+ const sub = [].concat(n.sub ?? []).flatMap((t) => wrap(t, { width: 128, size: 15 }));
21
+ const widest = Math.max(s, ...label.map((l) => textWidth(l, 16, true)), ...sub.map((l) => textWidth(l, 15)));
22
+ return { s, label, sub, width: Math.ceil(widest + 12), height: s + 10 + label.length * 21 + sub.length * 19 };
23
+ }
24
+
25
+ // Children in the spec's order: an explicit `children` list, else the
26
+ // group's nodes, then its groups.
27
+ export function childrenOf(spec, g) {
28
+ const id = g.id === '#root' ? null : g.id;
29
+ const all = [...spec.nodes.filter((n) => (n.in ?? null) === id), ...spec.groups.filter((x) => (x.in ?? null) === id)];
30
+ if (!g.children) return all;
31
+ return g.children.map((c) => all.find((x) => x.id === c)).filter(Boolean);
32
+ }
33
+
34
+ export const arrangeOf = (g) => g.arrange ?? 'row';
35
+ export const isGroup = (spec, item) => spec.groups.some((g) => g.id === item.id) || item.id === '#root';
36
+ export const framed = (g) => g.id !== '#root' && g.kind !== 'plain';
37
+ export const HEAD_HEIGHT = HEAD;
38
+
39
+ // Space after the i-th child of a row: wider when a labelled arrow joins it
40
+ // to the next service, so the label fits on the arrow between them.
41
+ function gapsOf(spec, { kids, gap, row }) {
42
+ return kids.slice(0, -1).map((k, i) => {
43
+ const e = spec.edges.find((x) => x.label && [x.from, x.to].includes(k.id) && [x.from, x.to].includes(kids[i + 1].id));
44
+ return row && e ? Math.max(gap, Math.ceil(textWidth(e.label, 14) + 48)) : gap;
45
+ });
46
+ }
47
+
48
+ export function titleWidth(g) {
49
+ return framed(g) ? Math.ceil(textWidth(g.label, 16, true) + 54 + (g.note ? textWidth(g.note, 15) + 14 : 0)) : 0;
50
+ }
51
+
52
+ // Size of every item, bottom up, into sizes (id -> { w, h }).
53
+ function measure(spec, item, sizes) {
54
+ if (!isGroup(spec, item)) {
55
+ const m = measureNode(item);
56
+ sizes.set(item.id, { w: m.width, h: m.height });
57
+ return sizes.get(item.id);
58
+ }
59
+ const kids = childrenOf(spec, item).map((c) => measure(spec, c, sizes));
60
+ const small = childrenOf(spec, item).every((c) => !isGroup(spec, c) && (c.size ?? TILE) < 46);
61
+ const gap = small ? TIGHT : GAP;
62
+ const gaps = gapsOf(spec, { kids: childrenOf(spec, item), gap, row: arrangeOf(item) === 'row' });
63
+ const along = kids.reduce((s, k) => s + (arrangeOf(item) === 'row' ? k.w : k.h), 0) + gaps.reduce((s, g) => s + g, 0);
64
+ const across = Math.max(0, ...kids.map((k) => (arrangeOf(item) === 'row' ? k.h : k.w)));
65
+ const [pad, head] = framed(item) ? [PAD, HEAD] : [0, 0];
66
+ const inner = arrangeOf(item) === 'row' ? { w: along, h: across } : { w: across, h: along };
67
+ sizes.set(item.id, { w: Math.max(inner.w + 2 * pad, titleWidth(item)), h: inner.h + head + pad, gaps, pad, head });
68
+ return sizes.get(item.id);
69
+ }
70
+
71
+ // Absolute boxes, top down, into boxes (id -> { x, y, w, h }); h overrides
72
+ // the measured height when a row stretches its frames to one height.
73
+ function place(spec, { item, x, y, h }, out) {
74
+ const size = out.sizes.get(item.id);
75
+ out.boxes.set(item.id, { id: item.id, x, y, w: size.w, h: h ?? size.h });
76
+ if (!isGroup(spec, item)) return;
77
+ const row = arrangeOf(item) === 'row';
78
+ const kids = childrenOf(spec, item);
79
+ const along = kids.reduce((s, k) => s + (row ? out.sizes.get(k.id).w : out.sizes.get(k.id).h), 0) + size.gaps.reduce((s, g) => s + g, 0);
80
+ const inner = { x: x + size.pad, y: y + size.head, w: size.w - 2 * size.pad, h: size.h - size.head - size.pad };
81
+ let at = row ? inner.x + (inner.w - along) / 2 : inner.y;
82
+ for (const [i, k] of kids.entries()) {
83
+ const ks = out.sizes.get(k.id);
84
+ const stretch = row && isGroup(spec, k) && framed(k) ? inner.h : undefined;
85
+ const top = stretch !== undefined || kids.every((c) => !isGroup(spec, c));
86
+ const pos = row ? { x: at, y: top ? inner.y : inner.y + (inner.h - ks.h) / 2 } : { x: inner.x + (inner.w - ks.w) / 2, y: at };
87
+ place(spec, { item: k, x: pos.x, y: pos.y, h: stretch }, out);
88
+ at += (row ? ks.w : ks.h) + (size.gaps[i] ?? 0);
89
+ }
90
+ alignLoners(spec, { item, boxes: out.boxes });
91
+ }
92
+
93
+ export function pack(spec) {
94
+ const root = { id: '#root', kind: 'plain', arrange: spec.arrange ?? 'row', children: spec.children };
95
+ const sizes = new Map();
96
+ const total = measure(spec, root, sizes);
97
+ const out = { sizes, boxes: new Map() };
98
+ place(spec, { item: root, x: 16, y: 16 }, out);
99
+ out.boxes.delete('#root');
100
+ return { boxes: out.boxes, width: Math.ceil(total.w + 32), height: Math.ceil(total.h + 32) };
101
+ }
@@ -0,0 +1,129 @@
1
+ // Routes each arrow of a packed figure: it leaves and enters a service at its
2
+ // tile (east, west or north side) or under its caption (south), and takes the
3
+ // shortest orthogonal path on the channel grid (grid.mjs) that crosses no
4
+ // service, no frame header, no label and no other arrow, with few bends.
5
+ // `exit` and `entry` on an edge pin the sides.
6
+ import { measureNode } from './pack.mjs';
7
+ import { textWidth } from './text.mjs';
8
+ import { gridLines, findPath } from './grid.mjs';
9
+
10
+ const SIDES = ['E', 'W', 'N', 'S'];
11
+ const OUT = { E: [1, 0], W: [-1, 0], N: [0, -1], S: [0, 1] };
12
+
13
+ // A side has three slots (centre, then either side of it), so two arrows at
14
+ // one tile can arrive side by side instead of on one line.
15
+ const SLOTS = [0, -13, 13];
16
+
17
+ function port(node, { box, side, slot }) {
18
+ const s = measureNode(node).s;
19
+ const [cx, cy] = [box.x + box.w / 2, box.y + s / 2];
20
+ const d = Math.sign(slot) * Math.min(Math.abs(slot), s / 2 - 4);
21
+ return { E: [cx + s / 2 + 3, cy + d], W: [cx - s / 2 - 3, cy + d], N: [cx + d, box.y - 3], S: [cx + d, box.y + box.h + 3] }[side];
22
+ }
23
+
24
+ // Drop repeated points and the middle of any straight run.
25
+ function clean(pts) {
26
+ const uniq = pts.filter((pt, i) => i === 0 || pt[0] !== pts[i - 1][0] || pt[1] !== pts[i - 1][1]);
27
+ return uniq.filter((pt, i) => i === 0 || i === uniq.length - 1
28
+ || !((uniq[i - 1][0] === pt[0] && pt[0] === uniq[i + 1][0]) || (uniq[i - 1][1] === pt[1] && pt[1] === uniq[i + 1][1])));
29
+ }
30
+
31
+ const cuts = ([[x1, y1], [x2, y2]], r) => Math.max(x1, x2) > r.x && Math.min(x1, x2) < r.x + r.w && Math.max(y1, y2) > r.y && Math.min(y1, y2) < r.y + r.h;
32
+
33
+ // Two arrows on one line read as one arrow: running along a drawn arrow
34
+ // costs almost as much as crossing a service; crossing one costs a little.
35
+ const SHARED = 20000;
36
+ const CROSSED = 60;
37
+
38
+ function against(seg, drawn) {
39
+ const [[x1, y1], [x2, y2]] = seg;
40
+ let c = 0;
41
+ for (const [[u1, v1], [u2, v2]] of drawn) {
42
+ const sameX = x1 === x2 && u1 === u2 && Math.abs(x1 - u1) < 6 && Math.min(Math.max(y1, y2), Math.max(v1, v2)) - Math.max(Math.min(y1, y2), Math.min(v1, v2)) > 4;
43
+ const sameY = y1 === y2 && v1 === v2 && Math.abs(y1 - v1) < 6 && Math.min(Math.max(x1, x2), Math.max(u1, u2)) - Math.max(Math.min(x1, x2), Math.min(u1, u2)) > 4;
44
+ if (sameX || sameY) c += SHARED;
45
+ else if (cuts(seg, { x: Math.min(u1, u2) - 0.5, y: Math.min(v1, v2) - 0.5, w: Math.abs(u2 - u1) + 1, h: Math.abs(v2 - v1) + 1 })) c += CROSSED;
46
+ }
47
+ return c;
48
+ }
49
+
50
+ export const HARD = 1000000;
51
+ const HUG = 300;
52
+
53
+ // A segment running alongside a frame's border, closer than 6 px, reads as
54
+ // part of the frame: keep arrows in the middle of their channel.
55
+ function hugs([[x1, y1], [x2, y2]], r) {
56
+ const over = ([a1, a2], [b1, b2]) => Math.min(Math.max(a1, a2), b2) - Math.max(Math.min(a1, a2), b1) > 4;
57
+ if (y1 === y2) return [r.y, r.y + r.h].some((y) => Math.abs(y - y1) < 6) && over([x1, x2], [r.x, r.x + r.w]);
58
+ return [r.x, r.x + r.w].some((x) => Math.abs(x - x1) < 6) && over([y1, y2], [r.y, r.y + r.h]);
59
+ }
60
+
61
+ // What one segment costs to draw: anything solid it crosses, and any arrow
62
+ // already drawn that it runs along or across.
63
+ function segCost(seg, { hard, drawn, frames }) {
64
+ return hard.filter((r) => cuts(seg, r)).length * HARD + against(seg, drawn) + frames.filter((r) => hugs(seg, r)).length * HUG;
65
+ }
66
+
67
+ // The label sits on a segment of the arrow, on a white pad: the longest
68
+ // segment's middle when that is clear of services, else the clearest spot.
69
+ function labelAt(pts, { text, obstacles }) {
70
+ const w = Math.ceil(textWidth(text, 14) + 12);
71
+ const spots = [];
72
+ for (let i = 1; i < pts.length; i += 1) {
73
+ const [a, b] = [pts[i - 1], pts[i]];
74
+ const len = Math.abs(b[0] - a[0]) + Math.abs(b[1] - a[1]);
75
+ for (const t of [0.5, 0.3, 0.7]) {
76
+ const [x, y] = [a[0] + (b[0] - a[0]) * t, a[1] + (b[1] - a[1]) * t];
77
+ spots.push({ len, x: x - w / 2, y: y - 10 });
78
+ // Beside the line when the line itself is too crowded: above a level
79
+ // segment, to the right of an upright one.
80
+ if (a[1] === b[1]) spots.push({ len: len - 60, x: x - w / 2, y: y - 24 }, { len: len - 90, x: x - w / 2, y: y - 38 });
81
+ else spots.push({ len: len - 60, x: x + 6, y: y - 10 });
82
+ }
83
+ }
84
+ const clash = (p) => obstacles.filter((r) => p.x < r.x + r.w && r.x < p.x + w && p.y < r.y + r.h && r.y < p.y + 20).reduce((n, r) => n + (r.weight ?? 1), 0);
85
+ const best = spots.map((p) => ({ ...p, c: clash(p) * 10 - p.len })).sort((a, b) => a.c - b.c)[0];
86
+ return { text, width: w, height: 20, x: best.x, y: best.y, clash: clash(best) };
87
+ }
88
+
89
+ // The chosen path and label become obstacles for the arrows routed after it.
90
+ function commit(best, { e, ctx }) {
91
+ for (let i = 1; i < best.pts.length; i += 1) ctx.drawn.push([best.pts[i - 1], best.pts[i]]);
92
+ if (best.label) ctx.labels.push({ x: best.label.x - 4, y: best.label.y - 2, w: best.label.width + 8, h: 24, weight: 100000 });
93
+ return { pts: best.pts, label: best.label, spec: e };
94
+ }
95
+
96
+ const LEAD = 14;
97
+ const DIR = { E: 0, W: 1, S: 2, N: 3 };
98
+ const INWARD = { E: 1, W: 0, S: 3, N: 2 };
99
+
100
+ // Every side and slot an arrow may use at one end, with the point 14 px out
101
+ // from the tile where the grid path starts or ends.
102
+ function endsOf(node, { box, pin, target }) {
103
+ return (pin ? [pin] : SIDES).flatMap((side) => SLOTS.map((slot) => {
104
+ const p = port(node, { box, side, slot });
105
+ const lead = [p[0] + OUT[side][0] * LEAD, p[1] + OUT[side][1] * LEAD];
106
+ // Arriving from under a caption reads backwards: prefer the tile's sides.
107
+ return { side, port: p, lead, cost: Math.abs(slot) * 2 + (target && side === 'S' ? 400 : 0) };
108
+ }));
109
+ }
110
+
111
+ const same = (a, b) => Math.abs(a[0] - b[0]) < 0.06 && Math.abs(a[1] - b[1]) < 0.06;
112
+
113
+ // ctx: { spec, boxes, rects (grid channels), hard (solid rects), frames, drawn (segments
114
+ // of arrows routed so far), labels (label pads placed so far) }.
115
+ export function route(e, ctx) {
116
+ const node = (id) => ctx.spec.nodes.find((n) => n.id === id);
117
+ const src = endsOf(node(e.from), { box: ctx.boxes.get(e.from), pin: e.exit });
118
+ const dst = endsOf(node(e.to), { box: ctx.boxes.get(e.to), pin: e.entry, target: true });
119
+ const hard = [...ctx.hard, ...ctx.foreign(e), ...ctx.labels];
120
+ const grid = gridLines(ctx.rects, [...src, ...dst].map((x) => x.lead));
121
+ const mid = findPath(grid, {
122
+ starts: src.map((x) => ({ pt: x.lead, dir: DIR[x.side], cost: x.cost })),
123
+ goals: dst.map((x) => ({ pt: x.lead, dir: INWARD[x.side], cost: x.cost })),
124
+ costOf: (seg) => segCost(seg, { hard, drawn: ctx.drawn, frames: ctx.frames }),
125
+ });
126
+ const pts = clean([src.find((x) => same(x.lead, mid[0])).port, ...mid, dst.find((x) => same(x.lead, mid[mid.length - 1])).port]);
127
+ const label = e.label ? labelAt(pts, { text: e.label, obstacles: hard }) : null;
128
+ return commit({ pts, label }, { e, ctx });
129
+ }
@@ -0,0 +1,74 @@
1
+ // A numbered step flow, drawn the way the sent proposals draw a workflow:
2
+ // rounded boxes, an orange numbered badge, a bold step title over grey
3
+ // detail lines, thick ink arrows between every pair of steps, and rows that
4
+ // wrap with an elbow connector from the last step of a row to the first of
5
+ // the next. Written as a ```steps fence (references/diagrams.md):
6
+ // per-row: 3 (optional, default 3)
7
+ // highlight: 5 (optional: the step drawn in the accent colours)
8
+ // Open a job | Pick a recent job or start a new one
9
+ import { esc, textWidth, wrap } from './text.mjs';
10
+ import { arrowSize } from './style.mjs';
11
+
12
+ const INK = '#273043';
13
+ const ACCENT = '#F15927';
14
+ const SOFT = '#FDF0EB';
15
+ const GREY = '#5d6577';
16
+ const G = { w: 250, gap: 64, vgap: 76, m: 24 };
17
+
18
+ export function parseSteps(body) {
19
+ const opts = { perRow: 3, highlight: null };
20
+ const steps = [];
21
+ for (const line of body.split('\n').map((l) => l.trim()).filter(Boolean)) {
22
+ const kv = /^(per-row|highlight):\s*(\d+)$/.exec(line);
23
+ if (kv) { opts[kv[1] === 'per-row' ? 'perRow' : 'highlight'] = Number(kv[2]); continue; }
24
+ const [title, ...rest] = line.split('|').map((s) => s.trim());
25
+ steps.push({ title, detail: rest.join(' ') });
26
+ }
27
+ return { ...opts, steps };
28
+ }
29
+
30
+ function geometry({ steps, perRow }) {
31
+ const w = Math.max(G.w, ...steps.map((s) => Math.ceil(textWidth(s.title, 18, true) + 80)));
32
+ const lines = steps.map((s) => wrap(s.detail, { width: w - 48, size: 15 }));
33
+ const h = Math.max(112, 72 + 22 * Math.max(1, ...lines.map((l) => l.length)));
34
+ const cols = Math.min(perRow, steps.length);
35
+ const rows = Math.ceil(steps.length / perRow);
36
+ return { w, h, lines, cols, rows, width: G.m * 2 + w * cols + G.gap * (cols - 1), height: G.m * 2 + h * rows + G.vgap * (rows - 1) };
37
+ }
38
+
39
+ const at = (i, g, perRow) => ({ x: G.m + (i % perRow) * (g.w + G.gap), y: G.m + Math.floor(i / perRow) * (g.h + G.vgap) });
40
+
41
+ function boxSvg(s, { i, g, hot, perRow }) {
42
+ const { x, y } = at(i, g, perRow);
43
+ const out = [`<rect x="${x}" y="${y}" width="${g.w}" height="${g.h}" rx="10" fill="${hot ? SOFT : '#FFFFFF'}" stroke="${hot ? ACCENT : INK}" stroke-width="2"/>`,
44
+ `<circle cx="${x + 30}" cy="${y + 32}" r="15" fill="${ACCENT}"/>`,
45
+ `<text x="${x + 30}" y="${y + 38}" text-anchor="middle" style="font-size:16px;font-weight:700" fill="#FFFFFF">${i + 1}</text>`,
46
+ `<text x="${x + 56}" y="${y + 38}" style="font-size:18px;font-weight:700" fill="${INK}">${esc(s.title)}</text>`];
47
+ g.lines[i].forEach((l, k) => out.push(`<text x="${x + 24}" y="${y + 72 + k * 22}" style="font-size:15px" fill="${GREY}">${esc(l)}</text>`));
48
+ return out.join('');
49
+ }
50
+
51
+ // Arrow i joins step i to step i + 1: straight within a row, an elbow
52
+ // (down, back across, down) from the end of one row to the start of the next.
53
+ function arrowSvg(i, { g, perRow, arrow }) {
54
+ const a = at(i, g, perRow);
55
+ const b = at(i + 1, g, perRow);
56
+ const pts = a.y === b.y
57
+ ? [[a.x + g.w + 4, a.y + g.h / 2], [b.x - 4, b.y + g.h / 2]]
58
+ : [[a.x + g.w / 2, a.y + g.h + 4], [a.x + g.w / 2, a.y + g.h + G.vgap / 2], [b.x + g.w / 2, a.y + g.h + G.vgap / 2], [b.x + g.w / 2, b.y - 4]];
59
+ return `<path data-edge="${i}" d="M${pts.map(([x, y]) => `${x},${y}`).join(' L')}" fill="none" stroke="${INK}" stroke-width="${arrow.stroke}" marker-end="url(#step-arr)"/>`;
60
+ }
61
+
62
+ const marker = (head) => `<defs><marker id="step-arr" viewBox="0 0 10 10" refX="8.5" refY="5" markerUnits="userSpaceOnUse" markerWidth="${head}" markerHeight="${head}" orient="auto"><path d="M0,0 L10,5 L0,10 z" fill="${INK}"/></marker></defs>`;
63
+
64
+ // Returns the SVG and the number of arrows it must contain (steps - 1).
65
+ export function stepsSvg(body, caption) {
66
+ const spec = parseSteps(body);
67
+ const g = geometry(spec);
68
+ const boxes = spec.steps.map((s, i) => boxSvg(s, { i, g, hot: spec.highlight === i + 1, perRow: spec.perRow })).join('');
69
+ const arrow = arrowSize(g.width, g.height);
70
+ const arrows = spec.steps.slice(1).map((_, i) => arrowSvg(i, { g, perRow: spec.perRow, arrow })).join('');
71
+ const svg = `<svg xmlns="http://www.w3.org/2000/svg" width="${g.width}" height="${g.height}" viewBox="0 0 ${g.width} ${g.height}" role="img" style="font-family:Roboto, Helvetica, Arial, sans-serif">`
72
+ + `<title>${esc(caption ?? '')}</title>${marker(arrow.head)}<rect width="${g.width}" height="${g.height}" fill="#FFFFFF"/>${arrows}${boxes}</svg>`;
73
+ return { svg, edges: spec.steps.length - 1 };
74
+ }
@@ -0,0 +1,61 @@
1
+ // Colours and group frames for the architecture figures (style B): nested
2
+ // frames by infrastructure, one coloured tile per service, thick ink arrows on
3
+ // a light background. CES palette for ink, accent and panels.
4
+ export const INK = '#273043';
5
+ export const GREY = '#5d6577';
6
+ export const LINE = '#9AA3B2';
7
+ export const PANEL = '#F7F8FA';
8
+
9
+ // The largest a figure is printed in the Word file and the PDF (px at 96 dpi).
10
+ export const PAGE = { w: 678, h: 800 };
11
+
12
+ // Arrows sized for the scale the figure is printed at, so a large figure
13
+ // shrunk onto the page still shows a thick line and a clear head.
14
+ export function arrowSize(width, height) {
15
+ const k = Math.min(1, PAGE.w / width, PAGE.h / height);
16
+ return { stroke: +Math.max(2.4, 1.4 / k).toFixed(2), head: Math.ceil(Math.max(13, 9 / k)) };
17
+ }
18
+
19
+ // Tile colour per service family, so a family reads the same in every figure.
20
+ export const FAMILY = {
21
+ compute: '#E8590C', db: '#3B48CC', storage: '#2F8F3A', net: '#7B3FE4', ops: '#D6336C',
22
+ ai: '#0892A5', msg: '#5d6577', dev: '#273043', user: null,
23
+ };
24
+
25
+ // Neutral frames: any cloud but AWS, or no cloud at all. Lucide badge icons.
26
+ const NEUTRAL = {
27
+ country: { color: '#1F7A3A', icon: 'map-pin', dashed: true },
28
+ cloud: { color: INK, icon: 'cloud' },
29
+ account: { color: INK, icon: 'building-2' },
30
+ region: { color: '#0892A5', icon: 'flag', dashed: true },
31
+ network: { color: '#7B3FE4', icon: 'lock' },
32
+ zone: { color: '#0892A5', dashed: true, fill: '#F3FAFB' },
33
+ subnet: { color: '#7B3FE4', dashed: true, fill: '#F8F5FE' },
34
+ server: { color: '#E8590C', icon: 'server', fill: '#FFFFFF' },
35
+ device: { color: INK, icon: 'monitor', fill: '#FFFFFF' },
36
+ site: { color: GREY, icon: 'building', dashed: true },
37
+ external: { color: LINE, icon: 'globe', dashed: true, fill: PANEL },
38
+ panel: { color: LINE, icon: 'layers', fill: PANEL },
39
+ // No frame at all: only arranges its children (a column of users).
40
+ plain: { color: LINE },
41
+ };
42
+
43
+ // AWS frames follow the AWS Architecture Icons group conventions (colour,
44
+ // dash and corner icon). Kinds with no AWS meaning keep the neutral frame.
45
+ const AWS = {
46
+ ...NEUTRAL,
47
+ cloud: { color: '#232F3E', awsIcon: 'AWSCloudlogo' },
48
+ account: { color: '#E7157B', awsIcon: 'AWSAccount' },
49
+ region: { color: '#00A4A6', awsIcon: 'Region', dashed: true },
50
+ zone: { color: '#00A4A6', dashed: true },
51
+ network: { color: '#8C4FFF', awsIcon: 'VirtualprivatecloudVPC' },
52
+ subnet: { color: '#00A4A6', awsIcon: 'Privatesubnet', fill: '#E6F6F7' },
53
+ 'public-subnet': { color: '#7AA116', awsIcon: 'Publicsubnet', fill: '#F2F6E8' },
54
+ server: { color: '#ED7100', awsIcon: 'EC2instancecontents', fill: '#FFFFFF' },
55
+ autoscaling: { color: '#ED7100', awsIcon: 'AutoScalinggroup', dashed: true },
56
+ datacenter: { color: '#7D8998', awsIcon: 'Corporatedatacenter' },
57
+ };
58
+
59
+ export const GROUP_KINDS = { neutral: NEUTRAL, aws: AWS };
60
+
61
+ export const groupStyle = (kind, icons) => GROUP_KINDS[icons][kind];
@@ -0,0 +1,28 @@
1
+ // Text metrics for the architecture figures. Widths come from a table measured
2
+ // once from the Roboto files in scripts/ces-brand/fonts (assets/roboto-widths.json,
3
+ // em units at weights 400 and 700), so layout runs in Node without a browser.
4
+ // The overlap check in Chrome is the backstop for any width the table gets wrong.
5
+ import { readFileSync } from 'node:fs';
6
+
7
+ const WIDTHS = JSON.parse(readFileSync(new URL('../../assets/roboto-widths.json', import.meta.url), 'utf8'));
8
+ const FALLBACK = 0.58;
9
+
10
+ export const esc = (s) => String(s).replaceAll('&', '&amp;').replaceAll('<', '&lt;').replaceAll('>', '&gt;').replaceAll('"', '&quot;');
11
+
12
+ export function textWidth(s, size, bold = false) {
13
+ const table = WIDTHS[bold ? 700 : 400];
14
+ let em = 0;
15
+ for (const ch of String(s)) em += table[ch] ?? FALLBACK;
16
+ return em * size;
17
+ }
18
+
19
+ // Greedy word wrap to a pixel width; a single word longer than the width keeps its own line.
20
+ export function wrap(s, { width, size, bold = false }) {
21
+ const lines = [];
22
+ let cur = '';
23
+ for (const word of String(s).split(/\s+/).filter(Boolean)) {
24
+ const next = cur ? `${cur} ${word}` : word;
25
+ if (cur && textWidth(next, size, bold) > width) { lines.push(cur); cur = word; } else cur = next;
26
+ }
27
+ return cur ? [...lines, cur] : lines;
28
+ }