@shrkcrft/inspector 0.1.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (708) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +15 -0
  3. package/dist/acceptance-replay.d.ts +63 -0
  4. package/dist/acceptance-replay.d.ts.map +1 -0
  5. package/dist/acceptance-replay.js +240 -0
  6. package/dist/action-hint-diagnostics.d.ts +32 -0
  7. package/dist/action-hint-diagnostics.d.ts.map +1 -0
  8. package/dist/action-hint-diagnostics.js +133 -0
  9. package/dist/adoption-check.d.ts +28 -0
  10. package/dist/adoption-check.d.ts.map +1 -0
  11. package/dist/adoption-check.js +181 -0
  12. package/dist/adoption-checkpoint.d.ts +97 -0
  13. package/dist/adoption-checkpoint.d.ts.map +1 -0
  14. package/dist/adoption-checkpoint.js +209 -0
  15. package/dist/adoption-merge-preview.d.ts +28 -0
  16. package/dist/adoption-merge-preview.d.ts.map +1 -0
  17. package/dist/adoption-merge-preview.js +254 -0
  18. package/dist/adoption-report-renderer.d.ts +33 -0
  19. package/dist/adoption-report-renderer.d.ts.map +1 -0
  20. package/dist/adoption-report-renderer.js +257 -0
  21. package/dist/adoption-state.d.ts +100 -0
  22. package/dist/adoption-state.d.ts.map +1 -0
  23. package/dist/adoption-state.js +296 -0
  24. package/dist/adoption-three-way.d.ts +46 -0
  25. package/dist/adoption-three-way.d.ts.map +1 -0
  26. package/dist/adoption-three-way.js +181 -0
  27. package/dist/agent-brief.d.ts +77 -0
  28. package/dist/agent-brief.d.ts.map +1 -0
  29. package/dist/agent-brief.js +490 -0
  30. package/dist/agent-contract-gate.d.ts +108 -0
  31. package/dist/agent-contract-gate.d.ts.map +1 -0
  32. package/dist/agent-contract-gate.js +412 -0
  33. package/dist/agent-contract-templates.d.ts +63 -0
  34. package/dist/agent-contract-templates.d.ts.map +1 -0
  35. package/dist/agent-contract-templates.js +346 -0
  36. package/dist/agent-contract.d.ts +65 -0
  37. package/dist/agent-contract.d.ts.map +1 -0
  38. package/dist/agent-contract.js +555 -0
  39. package/dist/agent-handoff.d.ts +123 -0
  40. package/dist/agent-handoff.d.ts.map +1 -0
  41. package/dist/agent-handoff.js +470 -0
  42. package/dist/agent-instructions.d.ts +2 -0
  43. package/dist/agent-instructions.d.ts.map +1 -0
  44. package/dist/agent-instructions.js +21 -0
  45. package/dist/agent-orchestration.d.ts +61 -0
  46. package/dist/agent-orchestration.d.ts.map +1 -0
  47. package/dist/agent-orchestration.js +285 -0
  48. package/dist/agent-task-prep.d.ts +31 -0
  49. package/dist/agent-task-prep.d.ts.map +1 -0
  50. package/dist/agent-task-prep.js +73 -0
  51. package/dist/ai-readiness.d.ts +30 -0
  52. package/dist/ai-readiness.d.ts.map +1 -0
  53. package/dist/ai-readiness.js +279 -0
  54. package/dist/api-report.d.ts +51 -0
  55. package/dist/api-report.d.ts.map +1 -0
  56. package/dist/api-report.js +254 -0
  57. package/dist/apply-dispatch-trace.d.ts +93 -0
  58. package/dist/apply-dispatch-trace.d.ts.map +1 -0
  59. package/dist/apply-dispatch-trace.js +283 -0
  60. package/dist/apply-gate-result.d.ts +52 -0
  61. package/dist/apply-gate-result.d.ts.map +1 -0
  62. package/dist/apply-gate-result.js +44 -0
  63. package/dist/architecture-map.d.ts +118 -0
  64. package/dist/architecture-map.d.ts.map +1 -0
  65. package/dist/architecture-map.js +543 -0
  66. package/dist/area-explore.d.ts +75 -0
  67. package/dist/area-explore.d.ts.map +1 -0
  68. package/dist/area-explore.js +438 -0
  69. package/dist/area-map.d.ts +57 -0
  70. package/dist/area-map.d.ts.map +1 -0
  71. package/dist/area-map.js +214 -0
  72. package/dist/asset-provenance.d.ts +123 -0
  73. package/dist/asset-provenance.d.ts.map +1 -0
  74. package/dist/asset-provenance.js +209 -0
  75. package/dist/barrel-operations.d.ts +45 -0
  76. package/dist/barrel-operations.d.ts.map +1 -0
  77. package/dist/barrel-operations.js +159 -0
  78. package/dist/boundaries-changed-only.d.ts +62 -0
  79. package/dist/boundaries-changed-only.d.ts.map +1 -0
  80. package/dist/boundaries-changed-only.js +97 -0
  81. package/dist/boundary-suggestions.d.ts +20 -0
  82. package/dist/boundary-suggestions.d.ts.map +1 -0
  83. package/dist/boundary-suggestions.js +51 -0
  84. package/dist/bundle-diff.d.ts +98 -0
  85. package/dist/bundle-diff.d.ts.map +1 -0
  86. package/dist/bundle-diff.js +531 -0
  87. package/dist/bundle-replay.d.ts +68 -0
  88. package/dist/bundle-replay.d.ts.map +1 -0
  89. package/dist/bundle-replay.js +273 -0
  90. package/dist/bundle-validate-html.d.ts +11 -0
  91. package/dist/bundle-validate-html.d.ts.map +1 -0
  92. package/dist/bundle-validate-html.js +60 -0
  93. package/dist/change-intent.d.ts +36 -0
  94. package/dist/change-intent.d.ts.map +1 -0
  95. package/dist/change-intent.js +259 -0
  96. package/dist/changed-preflight.d.ts +59 -0
  97. package/dist/changed-preflight.d.ts.map +1 -0
  98. package/dist/changed-preflight.js +358 -0
  99. package/dist/changed-scope.d.ts +112 -0
  100. package/dist/changed-scope.d.ts.map +1 -0
  101. package/dist/changed-scope.js +172 -0
  102. package/dist/changes-summary.d.ts +87 -0
  103. package/dist/changes-summary.d.ts.map +1 -0
  104. package/dist/changes-summary.js +323 -0
  105. package/dist/check-result-v1.d.ts +90 -0
  106. package/dist/check-result-v1.d.ts.map +1 -0
  107. package/dist/check-result-v1.js +335 -0
  108. package/dist/ci-integrity-report.d.ts +38 -0
  109. package/dist/ci-integrity-report.d.ts.map +1 -0
  110. package/dist/ci-integrity-report.js +324 -0
  111. package/dist/ci-permissions-fix.d.ts +38 -0
  112. package/dist/ci-permissions-fix.d.ts.map +1 -0
  113. package/dist/ci-permissions-fix.js +382 -0
  114. package/dist/ci-permissions.d.ts +51 -0
  115. package/dist/ci-permissions.d.ts.map +1 -0
  116. package/dist/ci-permissions.js +431 -0
  117. package/dist/ci-predict.d.ts +42 -0
  118. package/dist/ci-predict.d.ts.map +1 -0
  119. package/dist/ci-predict.js +300 -0
  120. package/dist/ci-scaffold.d.ts +47 -0
  121. package/dist/ci-scaffold.d.ts.map +1 -0
  122. package/dist/ci-scaffold.js +638 -0
  123. package/dist/codemod-assist.d.ts +97 -0
  124. package/dist/codemod-assist.d.ts.map +1 -0
  125. package/dist/codemod-assist.js +261 -0
  126. package/dist/command-recommender.d.ts +25 -0
  127. package/dist/command-recommender.d.ts.map +1 -0
  128. package/dist/command-recommender.js +145 -0
  129. package/dist/command-suggester.d.ts +61 -0
  130. package/dist/command-suggester.d.ts.map +1 -0
  131. package/dist/command-suggester.js +159 -0
  132. package/dist/command-taxonomy.d.ts +38 -0
  133. package/dist/command-taxonomy.d.ts.map +1 -0
  134. package/dist/command-taxonomy.js +164 -0
  135. package/dist/compliance-evidence.d.ts +58 -0
  136. package/dist/compliance-evidence.d.ts.map +1 -0
  137. package/dist/compliance-evidence.js +260 -0
  138. package/dist/compliance-profiles.d.ts +42 -0
  139. package/dist/compliance-profiles.d.ts.map +1 -0
  140. package/dist/compliance-profiles.js +171 -0
  141. package/dist/construct-adoption-diff.d.ts +55 -0
  142. package/dist/construct-adoption-diff.d.ts.map +1 -0
  143. package/dist/construct-adoption-diff.js +331 -0
  144. package/dist/construct-adoption.d.ts +71 -0
  145. package/dist/construct-adoption.d.ts.map +1 -0
  146. package/dist/construct-adoption.js +331 -0
  147. package/dist/construct-inference.d.ts +44 -0
  148. package/dist/construct-inference.d.ts.map +1 -0
  149. package/dist/construct-inference.js +391 -0
  150. package/dist/construct-registry.d.ts +32 -0
  151. package/dist/construct-registry.d.ts.map +1 -0
  152. package/dist/construct-registry.js +198 -0
  153. package/dist/contract-file-rule.d.ts +37 -0
  154. package/dist/contract-file-rule.d.ts.map +1 -0
  155. package/dist/contract-file-rule.js +99 -0
  156. package/dist/contract-template-registry.d.ts +28 -0
  157. package/dist/contract-template-registry.d.ts.map +1 -0
  158. package/dist/contract-template-registry.js +161 -0
  159. package/dist/contradictions.d.ts +52 -0
  160. package/dist/contradictions.d.ts.map +1 -0
  161. package/dist/contradictions.js +391 -0
  162. package/dist/convention-registry.d.ts +44 -0
  163. package/dist/convention-registry.d.ts.map +1 -0
  164. package/dist/convention-registry.js +195 -0
  165. package/dist/coverage-report.d.ts +25 -0
  166. package/dist/coverage-report.d.ts.map +1 -0
  167. package/dist/coverage-report.js +190 -0
  168. package/dist/custom-checks.d.ts +146 -0
  169. package/dist/custom-checks.d.ts.map +1 -0
  170. package/dist/custom-checks.js +260 -0
  171. package/dist/dashboard/dashboard-data.d.ts +59 -0
  172. package/dist/dashboard/dashboard-data.d.ts.map +1 -0
  173. package/dist/dashboard/dashboard-data.js +653 -0
  174. package/dist/dashboard-export.d.ts +67 -0
  175. package/dist/dashboard-export.d.ts.map +1 -0
  176. package/dist/dashboard-export.js +203 -0
  177. package/dist/decision-records.d.ts +47 -0
  178. package/dist/decision-records.d.ts.map +1 -0
  179. package/dist/decision-records.js +255 -0
  180. package/dist/demo-package.d.ts +49 -0
  181. package/dist/demo-package.d.ts.map +1 -0
  182. package/dist/demo-package.js +305 -0
  183. package/dist/demo-script.d.ts +25 -0
  184. package/dist/demo-script.d.ts.map +1 -0
  185. package/dist/demo-script.js +198 -0
  186. package/dist/demo-workflow.d.ts +28 -0
  187. package/dist/demo-workflow.d.ts.map +1 -0
  188. package/dist/demo-workflow.js +178 -0
  189. package/dist/dev-cycle.d.ts +41 -0
  190. package/dist/dev-cycle.d.ts.map +1 -0
  191. package/dist/dev-cycle.js +94 -0
  192. package/dist/dev-session-html.d.ts +13 -0
  193. package/dist/dev-session-html.d.ts.map +1 -0
  194. package/dist/dev-session-html.js +223 -0
  195. package/dist/dev-session-report.d.ts +11 -0
  196. package/dist/dev-session-report.d.ts.map +1 -0
  197. package/dist/dev-session-report.js +206 -0
  198. package/dist/dev-session.d.ts +257 -0
  199. package/dist/dev-session.d.ts.map +1 -0
  200. package/dist/dev-session.js +568 -0
  201. package/dist/diagnostics-suggest.d.ts +17 -0
  202. package/dist/diagnostics-suggest.d.ts.map +1 -0
  203. package/dist/diagnostics-suggest.js +69 -0
  204. package/dist/docs-check.d.ts +40 -0
  205. package/dist/docs-check.d.ts.map +1 -0
  206. package/dist/docs-check.js +221 -0
  207. package/dist/doctor-acknowledgements.d.ts +69 -0
  208. package/dist/doctor-acknowledgements.d.ts.map +1 -0
  209. package/dist/doctor-acknowledgements.js +150 -0
  210. package/dist/doctor-result.d.ts +51 -0
  211. package/dist/doctor-result.d.ts.map +1 -0
  212. package/dist/doctor-result.js +7 -0
  213. package/dist/doctor-suppressions.d.ts +91 -0
  214. package/dist/doctor-suppressions.d.ts.map +1 -0
  215. package/dist/doctor-suppressions.js +238 -0
  216. package/dist/drift-baseline.d.ts +29 -0
  217. package/dist/drift-baseline.d.ts.map +1 -0
  218. package/dist/drift-baseline.js +80 -0
  219. package/dist/drift.d.ts +38 -0
  220. package/dist/drift.d.ts.map +1 -0
  221. package/dist/drift.js +107 -0
  222. package/dist/entrypoint-matrix.d.ts +61 -0
  223. package/dist/entrypoint-matrix.d.ts.map +1 -0
  224. package/dist/entrypoint-matrix.js +221 -0
  225. package/dist/examples-check.d.ts +36 -0
  226. package/dist/examples-check.d.ts.map +1 -0
  227. package/dist/examples-check.js +168 -0
  228. package/dist/execution-graph.d.ts +98 -0
  229. package/dist/execution-graph.d.ts.map +1 -0
  230. package/dist/execution-graph.js +484 -0
  231. package/dist/export-bundle.d.ts +10 -0
  232. package/dist/export-bundle.d.ts.map +1 -0
  233. package/dist/export-bundle.js +90 -0
  234. package/dist/failure-diagnostics.d.ts +63 -0
  235. package/dist/failure-diagnostics.d.ts.map +1 -0
  236. package/dist/failure-diagnostics.js +243 -0
  237. package/dist/feature-bundle.d.ts +111 -0
  238. package/dist/feature-bundle.d.ts.map +1 -0
  239. package/dist/feature-bundle.js +211 -0
  240. package/dist/feedback-actions-v2.d.ts +65 -0
  241. package/dist/feedback-actions-v2.d.ts.map +1 -0
  242. package/dist/feedback-actions-v2.js +183 -0
  243. package/dist/feedback-ingestion.d.ts +96 -0
  244. package/dist/feedback-ingestion.d.ts.map +1 -0
  245. package/dist/feedback-ingestion.js +400 -0
  246. package/dist/fix-preview.d.ts +82 -0
  247. package/dist/fix-preview.d.ts.map +1 -0
  248. package/dist/fix-preview.js +365 -0
  249. package/dist/fuzzy-impact.d.ts +50 -0
  250. package/dist/fuzzy-impact.d.ts.map +1 -0
  251. package/dist/fuzzy-impact.js +446 -0
  252. package/dist/generated-code.d.ts +97 -0
  253. package/dist/generated-code.d.ts.map +1 -0
  254. package/dist/generated-code.js +395 -0
  255. package/dist/git-helpers.d.ts +38 -0
  256. package/dist/git-helpers.d.ts.map +1 -0
  257. package/dist/git-helpers.js +173 -0
  258. package/dist/golden-output.d.ts +33 -0
  259. package/dist/golden-output.d.ts.map +1 -0
  260. package/dist/golden-output.js +92 -0
  261. package/dist/grounding/build-grounding.d.ts +53 -0
  262. package/dist/grounding/build-grounding.d.ts.map +1 -0
  263. package/dist/grounding/build-grounding.js +51 -0
  264. package/dist/grounding/nx-projects.d.ts +29 -0
  265. package/dist/grounding/nx-projects.d.ts.map +1 -0
  266. package/dist/grounding/nx-projects.js +109 -0
  267. package/dist/grounding/validate-extracted-plan.d.ts +20 -0
  268. package/dist/grounding/validate-extracted-plan.d.ts.map +1 -0
  269. package/dist/grounding/validate-extracted-plan.js +127 -0
  270. package/dist/healing-plan.d.ts +33 -0
  271. package/dist/healing-plan.d.ts.map +1 -0
  272. package/dist/healing-plan.js +346 -0
  273. package/dist/helper-registry.d.ts +90 -0
  274. package/dist/helper-registry.d.ts.map +1 -0
  275. package/dist/helper-registry.js +529 -0
  276. package/dist/impact-analysis.d.ts +150 -0
  277. package/dist/impact-analysis.d.ts.map +1 -0
  278. package/dist/impact-analysis.js +697 -0
  279. package/dist/impact-graph-render.d.ts +51 -0
  280. package/dist/impact-graph-render.d.ts.map +1 -0
  281. package/dist/impact-graph-render.js +139 -0
  282. package/dist/impact-graph.d.ts +17 -0
  283. package/dist/impact-graph.d.ts.map +1 -0
  284. package/dist/impact-graph.js +119 -0
  285. package/dist/impact-render.d.ts +22 -0
  286. package/dist/impact-render.d.ts.map +1 -0
  287. package/dist/impact-render.js +422 -0
  288. package/dist/import-graph-analysis.d.ts +28 -0
  289. package/dist/import-graph-analysis.d.ts.map +1 -0
  290. package/dist/import-graph-analysis.js +193 -0
  291. package/dist/import-hygiene.d.ts +93 -0
  292. package/dist/import-hygiene.d.ts.map +1 -0
  293. package/dist/import-hygiene.js +366 -0
  294. package/dist/index.d.ts +224 -0
  295. package/dist/index.d.ts.map +1 -0
  296. package/dist/index.js +234 -0
  297. package/dist/ingest-adoption.d.ts +50 -0
  298. package/dist/ingest-adoption.d.ts.map +1 -0
  299. package/dist/ingest-adoption.js +183 -0
  300. package/dist/ingest-apply.d.ts +80 -0
  301. package/dist/ingest-apply.d.ts.map +1 -0
  302. package/dist/ingest-apply.js +227 -0
  303. package/dist/ingest-body-extractor.d.ts +28 -0
  304. package/dist/ingest-body-extractor.d.ts.map +1 -0
  305. package/dist/ingest-body-extractor.js +129 -0
  306. package/dist/ingest-drafts.d.ts +16 -0
  307. package/dist/ingest-drafts.d.ts.map +1 -0
  308. package/dist/ingest-drafts.js +482 -0
  309. package/dist/inspector-cache.d.ts +41 -0
  310. package/dist/inspector-cache.d.ts.map +1 -0
  311. package/dist/inspector-cache.js +104 -0
  312. package/dist/install-smoke.d.ts +44 -0
  313. package/dist/install-smoke.d.ts.map +1 -0
  314. package/dist/install-smoke.js +31 -0
  315. package/dist/knowledge-authoring.d.ts +151 -0
  316. package/dist/knowledge-authoring.d.ts.map +1 -0
  317. package/dist/knowledge-authoring.js +586 -0
  318. package/dist/knowledge-graph.d.ts +76 -0
  319. package/dist/knowledge-graph.d.ts.map +1 -0
  320. package/dist/knowledge-graph.js +336 -0
  321. package/dist/knowledge-lint.d.ts +97 -0
  322. package/dist/knowledge-lint.d.ts.map +1 -0
  323. package/dist/knowledge-lint.js +302 -0
  324. package/dist/knowledge-rename.d.ts +38 -0
  325. package/dist/knowledge-rename.d.ts.map +1 -0
  326. package/dist/knowledge-rename.js +88 -0
  327. package/dist/knowledge-stale.d.ts +124 -0
  328. package/dist/knowledge-stale.d.ts.map +1 -0
  329. package/dist/knowledge-stale.js +892 -0
  330. package/dist/languages/command-inference.d.ts +27 -0
  331. package/dist/languages/command-inference.d.ts.map +1 -0
  332. package/dist/languages/command-inference.js +214 -0
  333. package/dist/languages/dependency-scan.d.ts +33 -0
  334. package/dist/languages/dependency-scan.d.ts.map +1 -0
  335. package/dist/languages/dependency-scan.js +343 -0
  336. package/dist/languages/index.d.ts +14 -0
  337. package/dist/languages/index.d.ts.map +1 -0
  338. package/dist/languages/index.js +13 -0
  339. package/dist/languages/language-boundaries.d.ts +30 -0
  340. package/dist/languages/language-boundaries.d.ts.map +1 -0
  341. package/dist/languages/language-boundaries.js +176 -0
  342. package/dist/languages/language-cache.d.ts +54 -0
  343. package/dist/languages/language-cache.d.ts.map +1 -0
  344. package/dist/languages/language-cache.js +236 -0
  345. package/dist/languages/language-detection.d.ts +30 -0
  346. package/dist/languages/language-detection.d.ts.map +1 -0
  347. package/dist/languages/language-detection.js +584 -0
  348. package/dist/languages/language-id.d.ts +15 -0
  349. package/dist/languages/language-id.d.ts.map +1 -0
  350. package/dist/languages/language-id.js +15 -0
  351. package/dist/languages/language-runner.d.ts +90 -0
  352. package/dist/languages/language-runner.d.ts.map +1 -0
  353. package/dist/languages/language-runner.js +346 -0
  354. package/dist/languages/polyglot-boundary.d.ts +80 -0
  355. package/dist/languages/polyglot-boundary.d.ts.map +1 -0
  356. package/dist/languages/polyglot-boundary.js +373 -0
  357. package/dist/languages/polyglot-ci.d.ts +25 -0
  358. package/dist/languages/polyglot-ci.d.ts.map +1 -0
  359. package/dist/languages/polyglot-ci.js +278 -0
  360. package/dist/languages/test-impact.d.ts +19 -0
  361. package/dist/languages/test-impact.d.ts.map +1 -0
  362. package/dist/languages/test-impact.js +157 -0
  363. package/dist/loader-diagnostics.d.ts +40 -0
  364. package/dist/loader-diagnostics.d.ts.map +1 -0
  365. package/dist/loader-diagnostics.js +49 -0
  366. package/dist/memory-diff.d.ts +60 -0
  367. package/dist/memory-diff.d.ts.map +1 -0
  368. package/dist/memory-diff.js +302 -0
  369. package/dist/migration-profile-registry.d.ts +26 -0
  370. package/dist/migration-profile-registry.d.ts.map +1 -0
  371. package/dist/migration-profile-registry.js +135 -0
  372. package/dist/migration-readiness.d.ts +101 -0
  373. package/dist/migration-readiness.d.ts.map +1 -0
  374. package/dist/migration-readiness.js +253 -0
  375. package/dist/monorepo-onboarding.d.ts +51 -0
  376. package/dist/monorepo-onboarding.d.ts.map +1 -0
  377. package/dist/monorepo-onboarding.js +235 -0
  378. package/dist/onboarding-adoption-diff.d.ts +53 -0
  379. package/dist/onboarding-adoption-diff.d.ts.map +1 -0
  380. package/dist/onboarding-adoption-diff.js +285 -0
  381. package/dist/onboarding-adoption.d.ts +136 -0
  382. package/dist/onboarding-adoption.d.ts.map +1 -0
  383. package/dist/onboarding-adoption.js +702 -0
  384. package/dist/onboarding-agent-import.d.ts +40 -0
  385. package/dist/onboarding-agent-import.d.ts.map +1 -0
  386. package/dist/onboarding-agent-import.js +114 -0
  387. package/dist/onboarding-diff.d.ts +39 -0
  388. package/dist/onboarding-diff.d.ts.map +1 -0
  389. package/dist/onboarding-diff.js +240 -0
  390. package/dist/onboarding-drafts-merge.d.ts +71 -0
  391. package/dist/onboarding-drafts-merge.d.ts.map +1 -0
  392. package/dist/onboarding-drafts-merge.js +174 -0
  393. package/dist/onboarding-drafts.d.ts +42 -0
  394. package/dist/onboarding-drafts.d.ts.map +1 -0
  395. package/dist/onboarding-drafts.js +268 -0
  396. package/dist/onboarding-report.d.ts +8 -0
  397. package/dist/onboarding-report.d.ts.map +1 -0
  398. package/dist/onboarding-report.js +239 -0
  399. package/dist/onboarding.d.ts +134 -0
  400. package/dist/onboarding.d.ts.map +1 -0
  401. package/dist/onboarding.js +729 -0
  402. package/dist/ownership.d.ts +38 -0
  403. package/dist/ownership.d.ts.map +1 -0
  404. package/dist/ownership.js +102 -0
  405. package/dist/pack-author-ux.d.ts +58 -0
  406. package/dist/pack-author-ux.d.ts.map +1 -0
  407. package/dist/pack-author-ux.js +219 -0
  408. package/dist/pack-author.d.ts +94 -0
  409. package/dist/pack-author.d.ts.map +1 -0
  410. package/dist/pack-author.js +208 -0
  411. package/dist/pack-compatibility.d.ts +21 -0
  412. package/dist/pack-compatibility.d.ts.map +1 -0
  413. package/dist/pack-compatibility.js +114 -0
  414. package/dist/pack-contributions-inventory.d.ts +121 -0
  415. package/dist/pack-contributions-inventory.d.ts.map +1 -0
  416. package/dist/pack-contributions-inventory.js +732 -0
  417. package/dist/pack-docs.d.ts +11 -0
  418. package/dist/pack-docs.d.ts.map +1 -0
  419. package/dist/pack-docs.js +101 -0
  420. package/dist/pack-doctor.d.ts +50 -0
  421. package/dist/pack-doctor.d.ts.map +1 -0
  422. package/dist/pack-doctor.js +302 -0
  423. package/dist/pack-helper-registry.d.ts +29 -0
  424. package/dist/pack-helper-registry.d.ts.map +1 -0
  425. package/dist/pack-helper-registry.js +144 -0
  426. package/dist/pack-pending.d.ts +68 -0
  427. package/dist/pack-pending.d.ts.map +1 -0
  428. package/dist/pack-pending.js +189 -0
  429. package/dist/pack-quality-score.d.ts +44 -0
  430. package/dist/pack-quality-score.d.ts.map +1 -0
  431. package/dist/pack-quality-score.js +155 -0
  432. package/dist/pack-release-check.d.ts +24 -0
  433. package/dist/pack-release-check.d.ts.map +1 -0
  434. package/dist/pack-release-check.js +258 -0
  435. package/dist/pack-signature-status.d.ts +72 -0
  436. package/dist/pack-signature-status.d.ts.map +1 -0
  437. package/dist/pack-signature-status.js +222 -0
  438. package/dist/pack-symbol-compat.d.ts +73 -0
  439. package/dist/pack-symbol-compat.d.ts.map +1 -0
  440. package/dist/pack-symbol-compat.js +519 -0
  441. package/dist/pack-test-runner.d.ts +59 -0
  442. package/dist/pack-test-runner.d.ts.map +1 -0
  443. package/dist/pack-test-runner.js +211 -0
  444. package/dist/pipeline-command-dictionary.d.ts +2 -0
  445. package/dist/pipeline-command-dictionary.d.ts.map +1 -0
  446. package/dist/pipeline-command-dictionary.js +20 -0
  447. package/dist/pipeline-lint.d.ts +30 -0
  448. package/dist/pipeline-lint.d.ts.map +1 -0
  449. package/dist/pipeline-lint.js +134 -0
  450. package/dist/plan-dependency-graph.d.ts +25 -0
  451. package/dist/plan-dependency-graph.d.ts.map +1 -0
  452. package/dist/plan-dependency-graph.js +195 -0
  453. package/dist/plan-review.d.ts +64 -0
  454. package/dist/plan-review.d.ts.map +1 -0
  455. package/dist/plan-review.js +242 -0
  456. package/dist/plan-simulation.d.ts +108 -0
  457. package/dist/plan-simulation.d.ts.map +1 -0
  458. package/dist/plan-simulation.js +767 -0
  459. package/dist/playbook-registry.d.ts +25 -0
  460. package/dist/playbook-registry.d.ts.map +1 -0
  461. package/dist/playbook-registry.js +148 -0
  462. package/dist/playbook-script.d.ts +60 -0
  463. package/dist/playbook-script.d.ts.map +1 -0
  464. package/dist/playbook-script.js +161 -0
  465. package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
  466. package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
  467. package/dist/plugin-lifecycle-profile-registry.js +202 -0
  468. package/dist/plugin-lifecycle.d.ts +132 -0
  469. package/dist/plugin-lifecycle.d.ts.map +1 -0
  470. package/dist/plugin-lifecycle.js +477 -0
  471. package/dist/policy-engine.d.ts +101 -0
  472. package/dist/policy-engine.d.ts.map +1 -0
  473. package/dist/policy-engine.js +321 -0
  474. package/dist/policy-override-audit.d.ts +18 -0
  475. package/dist/policy-override-audit.d.ts.map +1 -0
  476. package/dist/policy-override-audit.js +54 -0
  477. package/dist/policy-overrides.d.ts +35 -0
  478. package/dist/policy-overrides.d.ts.map +1 -0
  479. package/dist/policy-overrides.js +84 -0
  480. package/dist/policy-test.d.ts +83 -0
  481. package/dist/policy-test.d.ts.map +1 -0
  482. package/dist/policy-test.js +342 -0
  483. package/dist/pr-summary.d.ts +34 -0
  484. package/dist/pr-summary.d.ts.map +1 -0
  485. package/dist/pr-summary.js +220 -0
  486. package/dist/product-coherence.d.ts +21 -0
  487. package/dist/product-coherence.d.ts.map +1 -0
  488. package/dist/product-coherence.js +158 -0
  489. package/dist/profile-registry.d.ts +42 -0
  490. package/dist/profile-registry.d.ts.map +1 -0
  491. package/dist/profile-registry.js +104 -0
  492. package/dist/project-coupling-audit.d.ts +64 -0
  493. package/dist/project-coupling-audit.d.ts.map +1 -0
  494. package/dist/project-coupling-audit.js +282 -0
  495. package/dist/project-overview.d.ts +14 -0
  496. package/dist/project-overview.d.ts.map +1 -0
  497. package/dist/project-overview.js +27 -0
  498. package/dist/propose-knowledge.d.ts +64 -0
  499. package/dist/propose-knowledge.d.ts.map +1 -0
  500. package/dist/propose-knowledge.js +367 -0
  501. package/dist/quality-baseline.d.ts +123 -0
  502. package/dist/quality-baseline.d.ts.map +1 -0
  503. package/dist/quality-baseline.js +433 -0
  504. package/dist/quality-html.d.ts +7 -0
  505. package/dist/quality-html.d.ts.map +1 -0
  506. package/dist/quality-html.js +64 -0
  507. package/dist/quality-report.d.ts +49 -0
  508. package/dist/quality-report.d.ts.map +1 -0
  509. package/dist/quality-report.js +296 -0
  510. package/dist/query-resolver.d.ts +38 -0
  511. package/dist/query-resolver.d.ts.map +1 -0
  512. package/dist/query-resolver.js +163 -0
  513. package/dist/ranker-explainability.d.ts +91 -0
  514. package/dist/ranker-explainability.d.ts.map +1 -0
  515. package/dist/ranker-explainability.js +550 -0
  516. package/dist/reference-lookup.d.ts +8 -0
  517. package/dist/reference-lookup.d.ts.map +1 -0
  518. package/dist/reference-lookup.js +18 -0
  519. package/dist/registration-hint-registry.d.ts +55 -0
  520. package/dist/registration-hint-registry.d.ts.map +1 -0
  521. package/dist/registration-hint-registry.js +327 -0
  522. package/dist/registry-lifecycle.d.ts +47 -0
  523. package/dist/registry-lifecycle.d.ts.map +1 -0
  524. package/dist/registry-lifecycle.js +214 -0
  525. package/dist/release-readiness.d.ts +64 -0
  526. package/dist/release-readiness.d.ts.map +1 -0
  527. package/dist/release-readiness.js +456 -0
  528. package/dist/release-smoke.d.ts +138 -0
  529. package/dist/release-smoke.d.ts.map +1 -0
  530. package/dist/release-smoke.js +459 -0
  531. package/dist/release-train.d.ts +33 -0
  532. package/dist/release-train.d.ts.map +1 -0
  533. package/dist/release-train.js +104 -0
  534. package/dist/repo-memory.d.ts +95 -0
  535. package/dist/repo-memory.d.ts.map +1 -0
  536. package/dist/repo-memory.js +614 -0
  537. package/dist/report-site.d.ts +92 -0
  538. package/dist/report-site.d.ts.map +1 -0
  539. package/dist/report-site.js +658 -0
  540. package/dist/reposet.d.ts +56 -0
  541. package/dist/reposet.d.ts.map +1 -0
  542. package/dist/reposet.js +160 -0
  543. package/dist/repository-intelligence.d.ts +145 -0
  544. package/dist/repository-intelligence.d.ts.map +1 -0
  545. package/dist/repository-intelligence.js +729 -0
  546. package/dist/repository-knowledge-model.d.ts +218 -0
  547. package/dist/repository-knowledge-model.d.ts.map +1 -0
  548. package/dist/repository-knowledge-model.js +939 -0
  549. package/dist/repository-map.d.ts +72 -0
  550. package/dist/repository-map.d.ts.map +1 -0
  551. package/dist/repository-map.js +332 -0
  552. package/dist/repository-stats.d.ts +66 -0
  553. package/dist/repository-stats.d.ts.map +1 -0
  554. package/dist/repository-stats.js +329 -0
  555. package/dist/review-comment-renderer.d.ts +59 -0
  556. package/dist/review-comment-renderer.d.ts.map +1 -0
  557. package/dist/review-comment-renderer.js +181 -0
  558. package/dist/review-comment-v2.d.ts +9 -0
  559. package/dist/review-comment-v2.d.ts.map +1 -0
  560. package/dist/review-comment-v2.js +178 -0
  561. package/dist/review-html.d.ts +13 -0
  562. package/dist/review-html.d.ts.map +1 -0
  563. package/dist/review-html.js +79 -0
  564. package/dist/review-packet-v2.d.ts +29 -0
  565. package/dist/review-packet-v2.d.ts.map +1 -0
  566. package/dist/review-packet-v2.js +81 -0
  567. package/dist/review-packet-v3.d.ts +22 -0
  568. package/dist/review-packet-v3.d.ts.map +1 -0
  569. package/dist/review-packet-v3.js +181 -0
  570. package/dist/review-packet.d.ts +49 -0
  571. package/dist/review-packet.d.ts.map +1 -0
  572. package/dist/review-packet.js +129 -0
  573. package/dist/risk-signals.d.ts +28 -0
  574. package/dist/risk-signals.d.ts.map +1 -0
  575. package/dist/risk-signals.js +68 -0
  576. package/dist/role-views.d.ts +50 -0
  577. package/dist/role-views.d.ts.map +1 -0
  578. package/dist/role-views.js +334 -0
  579. package/dist/rounds.d.ts +52 -0
  580. package/dist/rounds.d.ts.map +1 -0
  581. package/dist/rounds.js +172 -0
  582. package/dist/rule-drift.d.ts +42 -0
  583. package/dist/rule-drift.d.ts.map +1 -0
  584. package/dist/rule-drift.js +148 -0
  585. package/dist/rule-quality.d.ts +73 -0
  586. package/dist/rule-quality.d.ts.map +1 -0
  587. package/dist/rule-quality.js +356 -0
  588. package/dist/rule-scaffold.d.ts +71 -0
  589. package/dist/rule-scaffold.d.ts.map +1 -0
  590. package/dist/rule-scaffold.js +258 -0
  591. package/dist/safety-audit-deep.d.ts +38 -0
  592. package/dist/safety-audit-deep.d.ts.map +1 -0
  593. package/dist/safety-audit-deep.js +162 -0
  594. package/dist/safety-audit.d.ts +91 -0
  595. package/dist/safety-audit.d.ts.map +1 -0
  596. package/dist/safety-audit.js +138 -0
  597. package/dist/safety-html.d.ts +7 -0
  598. package/dist/safety-html.d.ts.map +1 -0
  599. package/dist/safety-html.js +70 -0
  600. package/dist/scaffold-coverage.d.ts +46 -0
  601. package/dist/scaffold-coverage.d.ts.map +1 -0
  602. package/dist/scaffold-coverage.js +273 -0
  603. package/dist/scaffold-patterns.d.ts +38 -0
  604. package/dist/scaffold-patterns.d.ts.map +1 -0
  605. package/dist/scaffold-patterns.js +282 -0
  606. package/dist/schema-inventory.d.ts +55 -0
  607. package/dist/schema-inventory.d.ts.map +1 -0
  608. package/dist/schema-inventory.js +301 -0
  609. package/dist/search-index.d.ts +75 -0
  610. package/dist/search-index.d.ts.map +1 -0
  611. package/dist/search-index.js +531 -0
  612. package/dist/search-tuning-explain.d.ts +68 -0
  613. package/dist/search-tuning-explain.d.ts.map +1 -0
  614. package/dist/search-tuning-explain.js +207 -0
  615. package/dist/search-tuning-registry.d.ts +54 -0
  616. package/dist/search-tuning-registry.d.ts.map +1 -0
  617. package/dist/search-tuning-registry.js +303 -0
  618. package/dist/self-audit.d.ts +59 -0
  619. package/dist/self-audit.d.ts.map +1 -0
  620. package/dist/self-audit.js +192 -0
  621. package/dist/self-config-doctor-v2.d.ts +57 -0
  622. package/dist/self-config-doctor-v2.d.ts.map +1 -0
  623. package/dist/self-config-doctor-v2.js +653 -0
  624. package/dist/self-config-doctor.d.ts +47 -0
  625. package/dist/self-config-doctor.d.ts.map +1 -0
  626. package/dist/self-config-doctor.js +432 -0
  627. package/dist/sharkcraft-inspector.d.ts +73 -0
  628. package/dist/sharkcraft-inspector.d.ts.map +1 -0
  629. package/dist/sharkcraft-inspector.js +745 -0
  630. package/dist/spec/spec-cross-validate.d.ts +17 -0
  631. package/dist/spec/spec-cross-validate.d.ts.map +1 -0
  632. package/dist/spec/spec-cross-validate.js +53 -0
  633. package/dist/spec/spec-discovery.d.ts +27 -0
  634. package/dist/spec/spec-discovery.d.ts.map +1 -0
  635. package/dist/spec/spec-discovery.js +78 -0
  636. package/dist/spec/spec-review.d.ts +36 -0
  637. package/dist/spec/spec-review.d.ts.map +1 -0
  638. package/dist/spec/spec-review.js +37 -0
  639. package/dist/stability-map.d.ts +62 -0
  640. package/dist/stability-map.d.ts.map +1 -0
  641. package/dist/stability-map.js +404 -0
  642. package/dist/start-here.d.ts +49 -0
  643. package/dist/start-here.d.ts.map +1 -0
  644. package/dist/start-here.js +259 -0
  645. package/dist/surface-profile-detect.d.ts +42 -0
  646. package/dist/surface-profile-detect.d.ts.map +1 -0
  647. package/dist/surface-profile-detect.js +76 -0
  648. package/dist/symbol-index.d.ts +108 -0
  649. package/dist/symbol-index.d.ts.map +1 -0
  650. package/dist/symbol-index.js +483 -0
  651. package/dist/task-decompose.d.ts +38 -0
  652. package/dist/task-decompose.d.ts.map +1 -0
  653. package/dist/task-decompose.js +154 -0
  654. package/dist/task-packet.d.ts +104 -0
  655. package/dist/task-packet.d.ts.map +1 -0
  656. package/dist/task-packet.js +156 -0
  657. package/dist/task-ranker.d.ts +51 -0
  658. package/dist/task-ranker.d.ts.map +1 -0
  659. package/dist/task-ranker.js +410 -0
  660. package/dist/task-risk.d.ts +84 -0
  661. package/dist/task-risk.d.ts.map +1 -0
  662. package/dist/task-risk.js +731 -0
  663. package/dist/task-routing-hint-registry.d.ts +36 -0
  664. package/dist/task-routing-hint-registry.d.ts.map +1 -0
  665. package/dist/task-routing-hint-registry.js +186 -0
  666. package/dist/template-authoring.d.ts +113 -0
  667. package/dist/template-authoring.d.ts.map +1 -0
  668. package/dist/template-authoring.js +521 -0
  669. package/dist/template-body-inference-v2.d.ts +19 -0
  670. package/dist/template-body-inference-v2.d.ts.map +1 -0
  671. package/dist/template-body-inference-v2.js +468 -0
  672. package/dist/template-body-inference.d.ts +59 -0
  673. package/dist/template-body-inference.d.ts.map +1 -0
  674. package/dist/template-body-inference.js +277 -0
  675. package/dist/template-drift.d.ts +39 -0
  676. package/dist/template-drift.d.ts.map +1 -0
  677. package/dist/template-drift.js +353 -0
  678. package/dist/template-lint.d.ts +31 -0
  679. package/dist/template-lint.d.ts.map +1 -0
  680. package/dist/template-lint.js +113 -0
  681. package/dist/test-definitions.d.ts +41 -0
  682. package/dist/test-definitions.d.ts.map +1 -0
  683. package/dist/test-definitions.js +6 -0
  684. package/dist/test-impact.d.ts +30 -0
  685. package/dist/test-impact.d.ts.map +1 -0
  686. package/dist/test-impact.js +173 -0
  687. package/dist/test-runner.d.ts +87 -0
  688. package/dist/test-runner.d.ts.map +1 -0
  689. package/dist/test-runner.js +560 -0
  690. package/dist/uncertainty-report.d.ts +46 -0
  691. package/dist/uncertainty-report.d.ts.map +1 -0
  692. package/dist/uncertainty-report.js +108 -0
  693. package/dist/uncertainty.d.ts +38 -0
  694. package/dist/uncertainty.d.ts.map +1 -0
  695. package/dist/uncertainty.js +115 -0
  696. package/dist/universal-search.d.ts +64 -0
  697. package/dist/universal-search.d.ts.map +1 -0
  698. package/dist/universal-search.js +347 -0
  699. package/dist/upgrade-advisor.d.ts +22 -0
  700. package/dist/upgrade-advisor.d.ts.map +1 -0
  701. package/dist/upgrade-advisor.js +109 -0
  702. package/dist/why-file.d.ts +75 -0
  703. package/dist/why-file.d.ts.map +1 -0
  704. package/dist/why-file.js +202 -0
  705. package/dist/workflow-simulation.d.ts +46 -0
  706. package/dist/workflow-simulation.d.ts.map +1 -0
  707. package/dist/workflow-simulation.js +154 -0
  708. package/package.json +65 -0
@@ -0,0 +1,658 @@
1
+ import { existsSync, mkdirSync, readFileSync, readdirSync, statSync, writeFileSync } from 'node:fs';
2
+ import * as nodePath from 'node:path';
3
+ import { buildAreaMap, renderAreaMapMarkdown } from "./area-map.js";
4
+ import { buildCoverageReport } from "./coverage-report.js";
5
+ import { buildDriftReport } from "./drift.js";
6
+ import { evaluatePolicy } from "./policy-engine.js";
7
+ import { listFeatureBundles, } from "./feature-bundle.js";
8
+ import { buildReviewPacketV3, renderReviewCommentV3, } from "./review-packet-v3.js";
9
+ import { renderQualityBaselineHtml, readQualityBaseline, } from "./quality-baseline.js";
10
+ import { buildQualityReport } from "./quality-report.js";
11
+ import { renderBundleValidationHtml } from "./bundle-validate-html.js";
12
+ import { renderImpactHtml } from "./impact-render.js";
13
+ import { renderImpactDot, renderImpactMermaid } from "./impact-graph.js";
14
+ import { renderImpactGraphSvg } from "./impact-graph-render.js";
15
+ import { listConstructs, warmConstructCache } from "./construct-registry.js";
16
+ function esc(s) {
17
+ return s
18
+ .replace(/&/g, '&')
19
+ .replace(/</g, '&lt;')
20
+ .replace(/>/g, '&gt;')
21
+ .replace(/"/g, '&quot;');
22
+ }
23
+ const NAV = [
24
+ { id: 'overview', href: 'index.html', title: 'Overview' },
25
+ { id: 'quality', href: 'quality.html', title: 'Quality' },
26
+ { id: 'bundles', href: 'bundles.html', title: 'Bundles' },
27
+ { id: 'review', href: 'review.html', title: 'Review' },
28
+ { id: 'impact', href: 'impact.html', title: 'Impact' },
29
+ { id: 'coverage', href: 'coverage.html', title: 'Coverage' },
30
+ { id: 'drift', href: 'drift.html', title: 'Drift' },
31
+ { id: 'policies', href: 'policies.html', title: 'Policies' },
32
+ { id: 'area-map', href: 'area-map.html', title: 'Area map' },
33
+ { id: 'constructs', href: 'constructs.html', title: 'Constructs' },
34
+ { id: 'pack-compat', href: 'pack-compat.html', title: 'Pack compat' },
35
+ ];
36
+ const SITE_GENERATED_AT = new Date().toISOString();
37
+ function pageShellImpl(title, body, options = {}) {
38
+ const extraLinks = [];
39
+ if (options.safetyMatrixUrl)
40
+ extraLinks.push(`<a href="${esc(options.safetyMatrixUrl)}">Safety matrix</a>`);
41
+ if (options.runtimeCompatibilityUrl)
42
+ extraLinks.push(`<a href="${esc(options.runtimeCompatibilityUrl)}">Runtime compat</a>`);
43
+ const nav = (options.brand ? `<span class="brand">${esc(options.brand)}</span>` : '') +
44
+ NAV.map((n) => {
45
+ const isCurrent = n.id === options.current;
46
+ return `<a href="${n.href}"${isCurrent ? ' class="current"' : ''}>${esc(n.title)}</a>`;
47
+ }).join('') +
48
+ extraLinks.join('');
49
+ const banner = options.siteTitle
50
+ ? `<div class="banner"><strong>${esc(options.siteTitle)}</strong></div>`
51
+ : '';
52
+ const description = options.description
53
+ ? `<p class="muted page-desc">${esc(options.description)}</p>`
54
+ : '';
55
+ const emptyState = options.emptyState
56
+ ? `<div class="empty"><h3>${esc(options.emptyState.title)}</h3><p>${esc(options.emptyState.body)}</p></div>`
57
+ : '';
58
+ const commandHints = options.commandHints && options.commandHints.length > 0
59
+ ? `<aside class="hints"><h3>Helpful commands</h3><ul>${options.commandHints.map((c) => `<li><code>${esc(c)}</code></li>`).join('')}</ul></aside>`
60
+ : '';
61
+ const titleSuffix = options.brand ? esc(options.brand) : 'SharkCraft';
62
+ const footer = `<footer class="footer">Generated by ${titleSuffix} · ${esc(SITE_GENERATED_AT)} · <a href="index.html">index</a></footer>`;
63
+ return [
64
+ '<!doctype html><html><head><meta charset="utf-8">',
65
+ `<title>${titleSuffix} — ${esc(title)}</title>`,
66
+ '<style>',
67
+ 'body{font:14px/1.45 -apple-system,sans-serif;max-width:1080px;margin:24px auto;padding:0 16px;color:#1f2328}',
68
+ 'nav{display:flex;gap:12px;padding:8px 0;border-bottom:1px solid #d0d7de;margin-bottom:16px;flex-wrap:wrap}',
69
+ 'nav a{color:#0969da;text-decoration:none}',
70
+ 'nav a:hover{text-decoration:underline}',
71
+ 'nav a.current{font-weight:700;color:#1f2328;text-decoration:underline}',
72
+ 'h1{font-size:22px;border-bottom:1px solid #d0d7de;padding-bottom:8px}',
73
+ 'h2{font-size:16px;margin-top:24px}',
74
+ 'h3{font-size:14px;margin-top:16px}',
75
+ 'table{border-collapse:collapse;width:100%;margin:8px 0}',
76
+ 'th,td{border:1px solid #d0d7de;padding:6px 10px;text-align:left;vertical-align:top}',
77
+ 'th{background:#f6f8fa}',
78
+ 'code,pre{background:#f6f8fa;padding:1px 4px;border-radius:4px;font-size:12px}',
79
+ '.tag{display:inline-block;padding:2px 8px;border-radius:9999px;font-size:11px;font-weight:600}',
80
+ '.tag.ok{background:#dafbe1;color:#1a7f37}',
81
+ '.tag.warn{background:#fff8c5;color:#9a6700}',
82
+ '.tag.fail{background:#ffebe9;color:#cf222e}',
83
+ '.tag.info{background:#eaeef2;color:#57606a}',
84
+ '.muted{color:#57606a}',
85
+ '.page-desc{margin-top:-4px;font-size:13px}',
86
+ '.empty{border:1px dashed #d0d7de;border-radius:8px;padding:12px 16px;margin:16px 0;background:#fafbfc}',
87
+ '.empty h3{margin-top:0}',
88
+ '.hints{border-left:3px solid #0969da;background:#f6f8fa;padding:8px 12px;margin:16px 0;border-radius:0 6px 6px 0}',
89
+ '.hints h3{margin-top:0;font-size:13px;color:#0969da}',
90
+ '.hints ul{margin:4px 0;padding-left:18px}',
91
+ '.footer{margin-top:32px;padding-top:8px;border-top:1px solid #d0d7de;color:#57606a;font-size:12px}',
92
+ '.footer a{color:#57606a}',
93
+ '.brand{font-weight:700;color:#1f2328;margin-right:auto;letter-spacing:0.2px}',
94
+ '.banner{background:#f6f8fa;border:1px solid #d0d7de;border-radius:8px;padding:8px 12px;margin-bottom:12px;font-size:13px}',
95
+ '</style></head><body>',
96
+ '<nav>',
97
+ nav,
98
+ '</nav>',
99
+ banner,
100
+ description,
101
+ emptyState,
102
+ body,
103
+ commandHints,
104
+ footer,
105
+ '</body></html>',
106
+ ].join('\n') + '\n';
107
+ }
108
+ function loadImpactReports(options) {
109
+ const out = [];
110
+ const seen = new Set();
111
+ const tryLoad = (file) => {
112
+ if (seen.has(file))
113
+ return;
114
+ seen.add(file);
115
+ if (!existsSync(file))
116
+ return;
117
+ try {
118
+ const data = JSON.parse(readFileSync(file, 'utf8'));
119
+ if (data &&
120
+ typeof data === 'object' &&
121
+ (data.schema === 'sharkcraft.impact-analysis/v2' ||
122
+ data.schema?.startsWith('sharkcraft.impact-analysis'))) {
123
+ out.push(data);
124
+ }
125
+ }
126
+ catch {
127
+ /* ignore */
128
+ }
129
+ };
130
+ if (options.impactFile)
131
+ tryLoad(options.impactFile);
132
+ if (options.impactDir) {
133
+ try {
134
+ for (const f of readdirSync(options.impactDir)) {
135
+ if (!f.endsWith('.json'))
136
+ continue;
137
+ const full = nodePath.join(options.impactDir, f);
138
+ try {
139
+ if (!statSync(full).isFile())
140
+ continue;
141
+ }
142
+ catch {
143
+ continue;
144
+ }
145
+ tryLoad(full);
146
+ }
147
+ }
148
+ catch {
149
+ /* ignore */
150
+ }
151
+ }
152
+ return out;
153
+ }
154
+ function impactSummaryRow(impact) {
155
+ const target = impact.normalizedTargets[0] ?? impact.specifier ?? impact.task ?? '(unknown)';
156
+ const risk = impact.risk;
157
+ const tag = risk === 'critical' ? 'fail' : risk === 'high' || risk === 'medium' ? 'warn' : 'ok';
158
+ return [
159
+ `<tr><td><code>${esc(target)}</code></td>`,
160
+ `<td><span class="tag ${tag}">${esc(risk.toUpperCase())}</span></td>`,
161
+ `<td>${impact.directDependents.length}</td>`,
162
+ `<td>${impact.transitiveDependents.length}</td>`,
163
+ `<td>${impact.affectedPackages.length}</td>`,
164
+ `<td>${impact.potentialBoundaryRisks.length}</td>`,
165
+ `<td>${impact.affectedPolicies.length}</td></tr>`,
166
+ ].join('');
167
+ }
168
+ function impactIndexBody(impacts) {
169
+ const rows = impacts.map(impactSummaryRow).join('');
170
+ return `<h1>Impact reports (${impacts.length})</h1>
171
+ <table><thead><tr><th>Target</th><th>Risk</th><th>Direct</th><th>Transitive</th><th>Packages</th><th>Boundary</th><th>Policy</th></tr></thead>
172
+ <tbody>${rows}</tbody></table>
173
+ <p class="muted">Per-report pages: ${impacts
174
+ .map((_, i) => `<a href="impact-${i + 1}.html">impact-${i + 1}</a>`)
175
+ .join(' · ')}</p>`;
176
+ }
177
+ function impactPlaceholderBody() {
178
+ return `<h1>Impact</h1>
179
+ <p><em>No impact report selected.</em></p>
180
+ <p>Generate one with one of:</p>
181
+ <ul>
182
+ <li><code>shrk impact --since main --format json &gt; .sharkcraft/reports/impact.json &amp;&amp; shrk report site --impact .sharkcraft/reports/impact.json</code></li>
183
+ <li><code>shrk impact src/services/user.service.ts --format html --output .sharkcraft/reports/impact-direct.html</code> (standalone)</li>
184
+ <li><code>shrk report site --impact-dir .sharkcraft/reports/impact</code> — embed every <code>*.json</code> in a folder.</li>
185
+ </ul>`;
186
+ }
187
+ export async function buildReportSite(inspection, outputDir, options = {}) {
188
+ mkdirSync(outputDir, { recursive: true });
189
+ const files = [];
190
+ const placeholderPages = [];
191
+ const write = (name, content) => {
192
+ const p = nodePath.join(outputDir, name);
193
+ writeFileSync(p, content, 'utf8');
194
+ files.push(p);
195
+ };
196
+ // Branding wrapper — applies optional --title / --brand / --safety-matrix /
197
+ // --runtime-compat to every page consistently.
198
+ const shell = (title, body, shellOpts = {}) => pageShellImpl(title, body, {
199
+ ...shellOpts,
200
+ ...(options.brand ? { brand: options.brand } : {}),
201
+ ...(options.title ? { siteTitle: options.title } : {}),
202
+ ...(options.safetyMatrixUrl ? { safetyMatrixUrl: options.safetyMatrixUrl } : {}),
203
+ ...(options.runtimeCompatibilityUrl
204
+ ? { runtimeCompatibilityUrl: options.runtimeCompatibilityUrl }
205
+ : {}),
206
+ });
207
+ const quality = await buildQualityReport({ inspection, config: {} });
208
+ const coverage = buildCoverageReport(inspection);
209
+ let drift;
210
+ try {
211
+ drift = buildDriftReport(inspection);
212
+ }
213
+ catch {
214
+ drift = { findings: [], counts: { error: 0, warning: 0, info: 0 } };
215
+ }
216
+ const policy = await evaluatePolicy(inspection);
217
+ const areas = buildAreaMap(inspection);
218
+ const bundles = listFeatureBundles(inspection.projectRoot);
219
+ // Warm construct cache so packs contribute to the constructs page.
220
+ await warmConstructCache(inspection);
221
+ const constructs = listConstructs(inspection);
222
+ const baselineFile = nodePath.join(inspection.projectRoot, 'sharkcraft', 'quality-baseline.json');
223
+ const baseline = readQualityBaseline(baselineFile);
224
+ let review = null;
225
+ if (options.bundleId || options.reviewPacketFile) {
226
+ const opts = {};
227
+ if (options.bundleId)
228
+ opts.bundleId = options.bundleId;
229
+ review = await buildReviewPacketV3(inspection, opts);
230
+ }
231
+ const impacts = loadImpactReports(options);
232
+ // index.html
233
+ const indexBody = `
234
+ <h1>SharkCraft report</h1>
235
+ <p class="muted">Generated ${esc(new Date().toISOString())}</p>
236
+ <table>
237
+ <tr><th>Quality score</th><td>${quality.score} <span class="tag ${quality.overall === 'fail' ? 'fail' : quality.overall === 'warn' ? 'warn' : 'ok'}">${esc(quality.overall.toUpperCase())}</span></td></tr>
238
+ <tr><th>Blockers</th><td>${quality.blockers}</td></tr>
239
+ <tr><th>Warnings</th><td>${quality.warnings}</td></tr>
240
+ <tr><th>Coverage overall</th><td>${coverage.overall}</td></tr>
241
+ <tr><th>Drift findings</th><td>${drift.findings.length}</td></tr>
242
+ <tr><th>Policy registrations</th><td>${policy.registrations.length}</td></tr>
243
+ <tr><th>Areas</th><td>${areas.areas.length}</td></tr>
244
+ <tr><th>Bundles</th><td>${bundles.length}</td></tr>
245
+ <tr><th>Constructs</th><td>${constructs.length}</td></tr>
246
+ <tr><th>Impact reports</th><td>${impacts.length}</td></tr>
247
+ </table>
248
+ <h2>Deep links</h2>
249
+ <ul>
250
+ ${NAV.filter((n) => n.id !== 'overview')
251
+ .map((n) => `<li><a href="${n.href}">${esc(n.title)}</a></li>`)
252
+ .join('')}
253
+ </ul>`;
254
+ write('index.html', shell('Overview', indexBody, {
255
+ current: 'overview',
256
+ description: 'High-level snapshot of the SharkCraft state. Every page below is a deep link.',
257
+ commandHints: [
258
+ 'shrk report site --output .sharkcraft/reports/site',
259
+ 'shrk report site --manifest',
260
+ ],
261
+ }));
262
+ // quality.html
263
+ let qualityBody = `<h1>Quality</h1>`;
264
+ qualityBody += `<p>Overall: <span class="tag ${quality.overall === 'fail' ? 'fail' : quality.overall === 'warn' ? 'warn' : 'ok'}">${esc(quality.overall.toUpperCase())}</span> · Score: ${quality.score} · Blockers: ${quality.blockers} · Warnings: ${quality.warnings}</p>`;
265
+ qualityBody += '<table><thead><tr><th>Gate</th><th>Result</th><th>Notes</th></tr></thead><tbody>';
266
+ for (const g of quality.gates) {
267
+ qualityBody += `<tr><td><code>${esc(g.id)}</code></td><td><span class="tag ${g.passed ? 'ok' : g.blocking ? 'fail' : 'warn'}">${g.passed ? 'OK' : g.blocking ? 'BLOCK' : 'WARN'}</span></td><td>${esc(g.notes.join('; '))}</td></tr>`;
268
+ }
269
+ qualityBody += '</tbody></table>';
270
+ if (baseline) {
271
+ qualityBody += '<h2>Baseline</h2>';
272
+ qualityBody += `<p>Captured ${esc(baseline.createdAt)} (toolkit ${esc(baseline.sharkcraftVersion)})</p>`;
273
+ qualityBody += `<p>Score: ${baseline.qualityScore} · Readiness: ${baseline.readinessScore} · Blockers: ${baseline.blockers} · Warnings: ${baseline.warnings}</p>`;
274
+ write('quality-baseline.html', renderQualityBaselineHtml(baseline));
275
+ qualityBody += '<p><a href="quality-baseline.html">Full baseline detail →</a></p>';
276
+ }
277
+ write('quality.html', shell('Quality', qualityBody, {
278
+ current: 'quality',
279
+ description: 'Quality gate matrix. Each gate is run by `shrk quality` and `shrk quality baseline compare`.',
280
+ commandHints: ['shrk quality --strict --ci', 'shrk quality baseline diff latest previous'],
281
+ }));
282
+ // bundles.html
283
+ let bundlesBody = `<h1>Bundles (${bundles.length})</h1>`;
284
+ if (bundles.length === 0)
285
+ bundlesBody += '<p><em>No bundles in this workspace.</em></p>';
286
+ bundlesBody += '<table><thead><tr><th>ID</th><th>Task</th><th>Status</th><th>Plans</th><th>Validations</th></tr></thead><tbody>';
287
+ for (const b of bundles) {
288
+ bundlesBody += `<tr><td><code>${esc(b.id)}</code></td><td>${esc(b.task)}</td><td>${esc(b.status)}</td><td>${b.plans.length}</td><td>${b.validations.length}</td></tr>`;
289
+ }
290
+ bundlesBody += '</tbody></table>';
291
+ for (const b of bundles) {
292
+ const last = b.validations[b.validations.length - 1];
293
+ if (last) {
294
+ const validationHtml = renderBundleValidationHtml(b, last);
295
+ write(`bundle-${b.id}.html`, validationHtml);
296
+ bundlesBody += `<p><a href="bundle-${esc(b.id)}.html">→ ${esc(b.id)} validation</a></p>`;
297
+ }
298
+ }
299
+ write('bundles.html', shell('Bundles', bundlesBody, {
300
+ current: 'bundles',
301
+ description: 'Feature workflow bundles and their latest validation runs.',
302
+ commandHints: ['shrk bundle list', 'shrk bundle replay --all --report --html'],
303
+ }));
304
+ // review.html
305
+ let reviewBody = `<h1>Review</h1>`;
306
+ if (review) {
307
+ reviewBody += renderReviewCommentV3(review, { format: 'html' });
308
+ // Deep-link to affected files (link to area-map for now).
309
+ reviewBody += `<p>See affected areas in <a href="area-map.html">the area map</a> and dependents in <a href="impact.html">impact</a>.</p>`;
310
+ }
311
+ else {
312
+ reviewBody += `<p><em>No review packet selected.</em></p>
313
+ <p>Generate one of the following to populate this page:</p>
314
+ <ul>
315
+ <li><code>shrk report site --bundle &lt;bundleId&gt;</code> — render a bundle's review.</li>
316
+ <li><code>shrk report site --review &lt;packet.json&gt;</code> — render a saved packet.</li>
317
+ <li><code>shrk review packet --v3 --json &gt; /tmp/review.json &amp;&amp; shrk report site --review /tmp/review.json</code></li>
318
+ </ul>`;
319
+ placeholderPages.push('review');
320
+ }
321
+ write('review.html', shell('Review', reviewBody, {
322
+ current: 'review',
323
+ description: review
324
+ ? 'Rendered review packet for the selected bundle/packet.'
325
+ : 'Placeholder — pass --bundle or --review to populate.',
326
+ commandHints: ['shrk review packet --v3 --since origin/main', 'shrk report site --bundle <id>'],
327
+ }));
328
+ // impact.html — index of impact reports (or placeholder).
329
+ const impactGraphFiles = [];
330
+ const impactSvgFiles = [];
331
+ const impactRenderDiagnostics = [];
332
+ if (impacts.length > 0) {
333
+ write('impact.html', shell('Impact', impactIndexBody(impacts), {
334
+ current: 'impact',
335
+ description: `${impacts.length} impact report(s) embedded — click through for detail.`,
336
+ commandHints: [
337
+ 'shrk impact --since origin/main --format json > impact.json',
338
+ 'shrk report impact impact.json --format html --include-graph',
339
+ 'shrk report site --with-impact-graphs',
340
+ ],
341
+ }));
342
+ // Per-report detail pages.
343
+ for (let i = 0; i < impacts.length; i += 1) {
344
+ const impact = impacts[i];
345
+ let html = renderImpactHtml(impact);
346
+ if (options.withImpactGraphs) {
347
+ const mermaid = renderImpactMermaid(impact);
348
+ const dot = renderImpactDot(impact);
349
+ const mermaidFile = `impact-${i + 1}.mmd`;
350
+ const dotFile = `impact-${i + 1}.dot`;
351
+ write(mermaidFile, mermaid);
352
+ write(dotFile, dot);
353
+ impactGraphFiles.push({ impact: i + 1, format: 'mermaid', file: mermaidFile });
354
+ impactGraphFiles.push({ impact: i + 1, format: 'dot', file: dotFile });
355
+ // Optional SVG rendering — opt-in via --render-impact-graphs. Runs a
356
+ // local subprocess against the just-written source files; degrades
357
+ // gracefully if the renderer isn't installed.
358
+ let mermaidSvgLink = '';
359
+ let dotSvgLink = '';
360
+ if (options.renderImpactGraphs) {
361
+ const mermaidSvgPath = nodePath.join(outputDir, `impact-${i + 1}.mermaid.svg`);
362
+ const dotSvgPath = nodePath.join(outputDir, `impact-${i + 1}.dot.svg`);
363
+ const mermaidResult = await renderImpactGraphSvg({
364
+ sourceFile: nodePath.join(outputDir, mermaidFile),
365
+ svgFile: mermaidSvgPath,
366
+ format: 'mermaid',
367
+ });
368
+ if (mermaidResult.rendered && mermaidResult.svgFile) {
369
+ files.push(mermaidResult.svgFile);
370
+ impactSvgFiles.push({
371
+ impact: i + 1,
372
+ format: 'mermaid',
373
+ file: `impact-${i + 1}.mermaid.svg`,
374
+ renderer: mermaidResult.renderer,
375
+ });
376
+ mermaidSvgLink = ` · <a href="impact-${i + 1}.mermaid.svg">svg</a>`;
377
+ }
378
+ impactRenderDiagnostics.push({
379
+ impact: i + 1,
380
+ format: 'mermaid',
381
+ rendered: mermaidResult.rendered,
382
+ ...(mermaidResult.reason ? { reason: mermaidResult.reason } : {}),
383
+ renderer: mermaidResult.renderer,
384
+ });
385
+ const dotResult = await renderImpactGraphSvg({
386
+ sourceFile: nodePath.join(outputDir, dotFile),
387
+ svgFile: dotSvgPath,
388
+ format: 'dot',
389
+ });
390
+ if (dotResult.rendered && dotResult.svgFile) {
391
+ files.push(dotResult.svgFile);
392
+ impactSvgFiles.push({
393
+ impact: i + 1,
394
+ format: 'dot',
395
+ file: `impact-${i + 1}.dot.svg`,
396
+ renderer: dotResult.renderer,
397
+ });
398
+ dotSvgLink = ` · <a href="impact-${i + 1}.dot.svg">svg</a>`;
399
+ }
400
+ impactRenderDiagnostics.push({
401
+ impact: i + 1,
402
+ format: 'dot',
403
+ rendered: dotResult.rendered,
404
+ ...(dotResult.reason ? { reason: dotResult.reason } : {}),
405
+ renderer: dotResult.renderer,
406
+ });
407
+ }
408
+ // Inject the graph source into the impact detail page.
409
+ const inject = [
410
+ '<h2>Graph source</h2>',
411
+ '<p class="muted">Copy into <a href="https://mermaid.live">mermaid.live</a> or render locally with <code>dot</code> / <code>mmdc</code>. SharkCraft never starts a renderer or fetches anything unless you opt in with <code>--render-impact-graphs</code>.</p>',
412
+ `<details><summary>Mermaid (<a href="${mermaidFile}">download</a>${mermaidSvgLink})</summary><pre>${esc(mermaid)}</pre></details>`,
413
+ `<details><summary>DOT (<a href="${dotFile}">download</a>${dotSvgLink})</summary><pre>${esc(dot)}</pre></details>`,
414
+ ].join('\n');
415
+ // Place graph source before the trailing </body> tag.
416
+ html = html.replace('</body>', inject + '\n</body>');
417
+ }
418
+ write(`impact-${i + 1}.html`, html);
419
+ }
420
+ }
421
+ else {
422
+ write('impact.html', shell('Impact', impactPlaceholderBody(), {
423
+ current: 'impact',
424
+ description: 'No impact report selected.',
425
+ emptyState: {
426
+ title: 'No impact report embedded',
427
+ body: 'Pass --impact <path> or --impact-dir <dir> to populate this page.',
428
+ },
429
+ commandHints: [
430
+ 'shrk impact --since origin/main --format json > .sharkcraft/reports/impact.json',
431
+ 'shrk report site --impact .sharkcraft/reports/impact.json',
432
+ ],
433
+ }));
434
+ placeholderPages.push('impact');
435
+ }
436
+ // coverage.html
437
+ let coverageBody = `<h1>Coverage</h1><p>Overall: ${coverage.overall}</p>`;
438
+ coverageBody += '<table><thead><tr><th>Category</th><th>Score</th></tr></thead><tbody>';
439
+ for (const c of coverage.categories) {
440
+ coverageBody += `<tr><td>${esc(c.id)}</td><td>${c.score}</td></tr>`;
441
+ }
442
+ coverageBody += '</tbody></table>';
443
+ write('coverage.html', shell('Coverage', coverageBody, {
444
+ current: 'coverage',
445
+ description: 'Coverage of structured knowledge per category.',
446
+ commandHints: ['shrk coverage --json', 'shrk drift'],
447
+ }));
448
+ // drift.html
449
+ let driftBody = `<h1>Drift</h1><p>Errors: ${drift.counts.error}; Warnings: ${drift.counts.warning}; Info: ${drift.counts.info}</p>`;
450
+ driftBody += '<table><thead><tr><th>Severity</th><th>Category</th><th>Message</th></tr></thead><tbody>';
451
+ for (const f of drift.findings.slice(0, 200)) {
452
+ driftBody += `<tr><td>${esc(f.severity)}</td><td>${esc(f.category)}</td><td>${esc(f.message)}</td></tr>`;
453
+ }
454
+ driftBody += '</tbody></table>';
455
+ write('drift.html', shell('Drift', driftBody, {
456
+ current: 'drift',
457
+ description: 'Drift between live state and structured knowledge.',
458
+ commandHints: ['shrk drift --json', 'shrk drift baseline-create'],
459
+ }));
460
+ // policies.html
461
+ let policyBody = `<h1>Policies</h1><p>Registered: ${policy.registrations.length}; Findings: ${policy.checks.length}; Passed: ${policy.summary.passed}</p>`;
462
+ policyBody += '<h2>Registered</h2>';
463
+ policyBody += '<table><thead><tr><th>ID</th><th>Source</th><th>Severity</th><th>File</th></tr></thead><tbody>';
464
+ for (const r of policy.registrations) {
465
+ policyBody += `<tr><td><code>${esc(r.id)}</code></td><td>${esc(r.source)}</td><td>${esc(r.severity)}</td><td><code>${esc(r.sourceFile)}</code></td></tr>`;
466
+ }
467
+ policyBody += '</tbody></table>';
468
+ if (policy.checks.length > 0) {
469
+ policyBody += '<h2>Findings</h2><ul>';
470
+ for (const c of policy.checks) {
471
+ policyBody += `<li>[${esc(c.severity)}] <code>${esc(c.id)}</code> — ${esc(c.message)}</li>`;
472
+ }
473
+ policyBody += '</ul>';
474
+ }
475
+ write('policies.html', shell('Policies', policyBody, {
476
+ current: 'policies',
477
+ description: 'Registered policy checks + the most recent run.',
478
+ commandHints: ['shrk policy run --json', 'shrk policy snapshot --all --gate'],
479
+ }));
480
+ // area-map.html
481
+ write('area-map.html', shell('Area map', renderAreaMapHtmlBody(areas), {
482
+ current: 'area-map',
483
+ description: 'Folders grouped by area kind with their boundary rules and risk scores.',
484
+ commandHints: ['shrk repo areas', 'shrk check boundaries --json'],
485
+ }));
486
+ // constructs.html
487
+ if (constructs.length === 0) {
488
+ write('constructs.html', shell('Constructs', `<h1>Constructs</h1>`, {
489
+ current: 'constructs',
490
+ description: 'No constructs registered yet.',
491
+ emptyState: {
492
+ title: 'Add constructs',
493
+ body: 'Define them in `sharkcraft/constructs.ts` with `defineConstruct({...})`, or run `shrk constructs infer --write-drafts` and review the drafts.',
494
+ },
495
+ commandHints: ['shrk constructs infer', 'shrk constructs adopt --write-patch'],
496
+ }));
497
+ placeholderPages.push('constructs');
498
+ }
499
+ else {
500
+ let cb = `<h1>Constructs (${constructs.length})</h1>`;
501
+ cb += '<table><thead><tr><th>ID</th><th>Type</th><th>Title</th><th>Files</th><th>Public API</th><th>Source</th></tr></thead><tbody>';
502
+ for (const c of constructs) {
503
+ const fileLinks = (c.files ?? [])
504
+ .slice(0, 5)
505
+ .map((f) => `<code>${esc(f)}</code>`)
506
+ .join(', ');
507
+ const api = (c.publicApi ?? []).map((a) => `<code>${esc(a)}</code>`).join(', ');
508
+ cb += `<tr><td><code>${esc(c.id)}</code></td><td>${esc(c.type)}</td><td>${esc(c.title)}</td><td>${fileLinks || '<span class="muted">—</span>'}</td><td>${api || '<span class="muted">—</span>'}</td><td>${esc(c.source)}${c.packageName ? ` <span class="muted">(${esc(c.packageName)})</span>` : ''}</td></tr>`;
509
+ }
510
+ cb += '</tbody></table>';
511
+ cb += `<p class="muted">See also: <a href="area-map.html">area map</a>, <a href="impact.html">impact</a>.</p>`;
512
+ write('constructs.html', shell('Constructs', cb, {
513
+ current: 'constructs',
514
+ description: 'Constructs registered via local config or pack contributions.',
515
+ commandHints: ['shrk constructs list', 'shrk constructs trace <id>'],
516
+ }));
517
+ }
518
+ // Pack compat page (optional).
519
+ const wantPackCompat = !options.include || options.include.includes('pack-compat');
520
+ if (wantPackCompat) {
521
+ let body = '<h2>Pack compatibility</h2>';
522
+ if (options.packCompatFile && existsSync(options.packCompatFile)) {
523
+ try {
524
+ const compat = JSON.parse(readFileSync(options.packCompatFile, 'utf8'));
525
+ const sym = (compat.symbolCompat ?? {});
526
+ const escHtml = (s) => String(s ?? '').replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
527
+ body += `<p class="muted">pack: <code>${escHtml(compat.pack ?? '(unknown)')}</code></p>`;
528
+ body += `<p class="muted">consumer root: <code>${escHtml(compat.consumerRoot ?? '(unspecified)')}</code></p>`;
529
+ body += '<table><tbody>';
530
+ body += `<tr><th>plugin-api source</th><td><code>${escHtml(sym.pluginApiSource ?? '(not found)')}</code></td></tr>`;
531
+ body += `<tr><th>plugin-api resolution</th><td>${escHtml(sym.pluginApiResolution ?? '')}</td></tr>`;
532
+ body += `<tr><th>source mode</th><td>${escHtml(sym.sourceMode ?? '')}</td></tr>`;
533
+ body += `<tr><th>confidence</th><td>${escHtml(sym.confidence ?? '')}</td></tr>`;
534
+ body += `<tr><th>files inspected</th><td>${(sym.filesInspected ?? []).length}</td></tr>`;
535
+ body += `<tr><th>available symbols</th><td>${(sym.availableSymbols ?? []).length}</td></tr>`;
536
+ body += `<tr><th>missing symbols</th><td>${(sym.missingSymbols ?? []).length}</td></tr>`;
537
+ body += '</tbody></table>';
538
+ if ((sym.missingSymbols ?? []).length > 0) {
539
+ body += '<h3>Missing symbols</h3><ul>';
540
+ for (const s of sym.missingSymbols ?? [])
541
+ body += `<li><code>${escHtml(s)}</code></li>`;
542
+ body += '</ul>';
543
+ }
544
+ if ((sym.findings ?? []).length > 0) {
545
+ body += '<h3>Findings</h3><table><thead><tr><th>symbol</th><th>status</th><th>files</th></tr></thead><tbody>';
546
+ for (const f of sym.findings ?? []) {
547
+ body += `<tr><td><code>${escHtml(f.symbol)}</code></td><td>${escHtml(f.status)}</td><td>${(f.files ?? []).length}</td></tr>`;
548
+ }
549
+ body += '</tbody></table>';
550
+ }
551
+ if ((sym.suggestions ?? []).length > 0) {
552
+ body += '<h3>Suggestions</h3><ul>';
553
+ for (const s of sym.suggestions ?? [])
554
+ body += `<li>${escHtml(s)}</li>`;
555
+ body += '</ul>';
556
+ }
557
+ }
558
+ catch (e) {
559
+ body += `<p class="muted">Could not parse <code>${e.message}</code></p>`;
560
+ placeholderPages.push('pack-compat');
561
+ }
562
+ }
563
+ else {
564
+ body +=
565
+ '<p>Run <code>shrk packs compat &lt;pack&gt; --consumer-root &lt;repo&gt; --json &gt; pack-compat.json</code> ' +
566
+ 'then rebuild the report site with <code>--pack-compat pack-compat.json</code> to populate this page.</p>';
567
+ placeholderPages.push('pack-compat');
568
+ }
569
+ write('pack-compat.html', shell('Pack compatibility', body, {
570
+ current: 'pack-compat',
571
+ description: 'Pack symbol compatibility report.',
572
+ commandHints: ['shrk packs compat <pack> --consumer-root <repo> --json'],
573
+ }));
574
+ }
575
+ // Pages map for quick reference.
576
+ const pages = {};
577
+ for (const f of files) {
578
+ const rel = nodePath.basename(f);
579
+ if (rel.endsWith('.html')) {
580
+ const id = rel.replace(/\.html$/, '');
581
+ pages[id] = rel;
582
+ }
583
+ }
584
+ return {
585
+ outputDir,
586
+ files,
587
+ pages,
588
+ impactCount: impacts.length,
589
+ hasReview: Boolean(review),
590
+ placeholderPages,
591
+ ...(impactGraphFiles.length > 0 ? { impactGraphFiles } : {}),
592
+ ...(impactSvgFiles.length > 0 ? { impactSvgFiles } : {}),
593
+ ...(impactRenderDiagnostics.length > 0 ? { impactRenderDiagnostics } : {}),
594
+ };
595
+ }
596
+ function renderAreaMapHtmlBody(map) {
597
+ const lines = [];
598
+ lines.push('<h1>Area map</h1>');
599
+ lines.push(`<p class="muted">${map.areas.length} areas · ${map.unclassifiedFiles} unclassified files</p>`);
600
+ lines.push('<table><thead><tr><th>Kind</th><th>Files</th><th>Paths</th><th>Boundary rules</th><th>Risk</th></tr></thead><tbody>');
601
+ for (const a of map.areas) {
602
+ lines.push(`<tr><td>${esc(a.kind)}</td><td>${a.fileCount}</td><td>${a.paths.map((p) => `<code>${esc(p)}</code>`).join(', ')}</td><td>${a.boundaryRuleIds.length}</td><td>${a.riskScore}</td></tr>`);
603
+ }
604
+ lines.push('</tbody></table>');
605
+ lines.push(`<details><summary>Markdown export</summary><pre>${esc(renderAreaMapMarkdown(map))}</pre></details>`);
606
+ return lines.join('\n');
607
+ }
608
+ export function buildReportSiteManifest(result, hasReview) {
609
+ const all = [
610
+ { id: 'overview', file: 'index.html', title: 'Overview' },
611
+ { id: 'quality', file: 'quality.html', title: 'Quality' },
612
+ { id: 'bundles', file: 'bundles.html', title: 'Bundles' },
613
+ { id: 'review', file: 'review.html', title: 'Review' },
614
+ { id: 'impact', file: 'impact.html', title: 'Impact' },
615
+ { id: 'coverage', file: 'coverage.html', title: 'Coverage' },
616
+ { id: 'drift', file: 'drift.html', title: 'Drift' },
617
+ { id: 'policies', file: 'policies.html', title: 'Policies' },
618
+ { id: 'area-map', file: 'area-map.html', title: 'Area map' },
619
+ { id: 'constructs', file: 'constructs.html', title: 'Constructs' },
620
+ ];
621
+ const populatedKey = (id) => id === 'overview' ? 'index' : id;
622
+ const reviewPopulated = hasReview;
623
+ const impactPopulated = result.impactCount > 0;
624
+ const placeholderSet = new Set(result.placeholderPages);
625
+ const pages = all.map((p) => {
626
+ let populated = result.pages[populatedKey(p.id)] !== undefined;
627
+ if (p.id === 'review')
628
+ populated = reviewPopulated;
629
+ if (p.id === 'impact')
630
+ populated = impactPopulated;
631
+ if (placeholderSet.has(p.id))
632
+ populated = false;
633
+ return {
634
+ id: p.id,
635
+ file: p.file,
636
+ title: p.title,
637
+ kind: populated ? 'page' : 'placeholder',
638
+ populated,
639
+ };
640
+ });
641
+ const notes = [];
642
+ if (!reviewPopulated)
643
+ notes.push('review.html is a placeholder — re-run with --bundle or --review to populate.');
644
+ if (!impactPopulated)
645
+ notes.push('impact.html is a placeholder — re-run with --impact or --impact-dir to populate.');
646
+ if (placeholderSet.has('constructs'))
647
+ notes.push('constructs.html shows authoring guidance because no constructs are registered.');
648
+ if (result.impactGraphFiles && result.impactGraphFiles.length > 0) {
649
+ notes.push(`impact-graph artifacts embedded: ${result.impactGraphFiles.length} files (mermaid + dot).`);
650
+ }
651
+ return {
652
+ schema: 'sharkcraft.report-site-manifest/v1',
653
+ outputDir: result.outputDir,
654
+ generatedAt: new Date().toISOString(),
655
+ pages,
656
+ notes,
657
+ };
658
+ }