@shrkcrft/inspector 0.1.0-alpha.2

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 (705) 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 +43 -0
  70. package/dist/area-map.d.ts.map +1 -0
  71. package/dist/area-map.js +197 -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 +201 -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 +26 -0
  256. package/dist/git-helpers.d.ts.map +1 -0
  257. package/dist/git-helpers.js +110 -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 +413 -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 +223 -0
  295. package/dist/index.d.ts.map +1 -0
  296. package/dist/index.js +233 -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.d.ts +28 -0
  391. package/dist/onboarding-drafts.d.ts.map +1 -0
  392. package/dist/onboarding-drafts.js +234 -0
  393. package/dist/onboarding-report.d.ts +8 -0
  394. package/dist/onboarding-report.d.ts.map +1 -0
  395. package/dist/onboarding-report.js +239 -0
  396. package/dist/onboarding.d.ts +134 -0
  397. package/dist/onboarding.d.ts.map +1 -0
  398. package/dist/onboarding.js +729 -0
  399. package/dist/ownership.d.ts +38 -0
  400. package/dist/ownership.d.ts.map +1 -0
  401. package/dist/ownership.js +102 -0
  402. package/dist/pack-author-ux.d.ts +58 -0
  403. package/dist/pack-author-ux.d.ts.map +1 -0
  404. package/dist/pack-author-ux.js +219 -0
  405. package/dist/pack-author.d.ts +94 -0
  406. package/dist/pack-author.d.ts.map +1 -0
  407. package/dist/pack-author.js +208 -0
  408. package/dist/pack-compatibility.d.ts +21 -0
  409. package/dist/pack-compatibility.d.ts.map +1 -0
  410. package/dist/pack-compatibility.js +114 -0
  411. package/dist/pack-contributions-inventory.d.ts +121 -0
  412. package/dist/pack-contributions-inventory.d.ts.map +1 -0
  413. package/dist/pack-contributions-inventory.js +732 -0
  414. package/dist/pack-docs.d.ts +11 -0
  415. package/dist/pack-docs.d.ts.map +1 -0
  416. package/dist/pack-docs.js +101 -0
  417. package/dist/pack-doctor.d.ts +50 -0
  418. package/dist/pack-doctor.d.ts.map +1 -0
  419. package/dist/pack-doctor.js +302 -0
  420. package/dist/pack-helper-registry.d.ts +29 -0
  421. package/dist/pack-helper-registry.d.ts.map +1 -0
  422. package/dist/pack-helper-registry.js +144 -0
  423. package/dist/pack-pending.d.ts +68 -0
  424. package/dist/pack-pending.d.ts.map +1 -0
  425. package/dist/pack-pending.js +189 -0
  426. package/dist/pack-quality-score.d.ts +44 -0
  427. package/dist/pack-quality-score.d.ts.map +1 -0
  428. package/dist/pack-quality-score.js +155 -0
  429. package/dist/pack-release-check.d.ts +24 -0
  430. package/dist/pack-release-check.d.ts.map +1 -0
  431. package/dist/pack-release-check.js +258 -0
  432. package/dist/pack-signature-status.d.ts +72 -0
  433. package/dist/pack-signature-status.d.ts.map +1 -0
  434. package/dist/pack-signature-status.js +222 -0
  435. package/dist/pack-symbol-compat.d.ts +60 -0
  436. package/dist/pack-symbol-compat.d.ts.map +1 -0
  437. package/dist/pack-symbol-compat.js +371 -0
  438. package/dist/pack-test-runner.d.ts +59 -0
  439. package/dist/pack-test-runner.d.ts.map +1 -0
  440. package/dist/pack-test-runner.js +211 -0
  441. package/dist/pipeline-command-dictionary.d.ts +2 -0
  442. package/dist/pipeline-command-dictionary.d.ts.map +1 -0
  443. package/dist/pipeline-command-dictionary.js +20 -0
  444. package/dist/pipeline-lint.d.ts +30 -0
  445. package/dist/pipeline-lint.d.ts.map +1 -0
  446. package/dist/pipeline-lint.js +134 -0
  447. package/dist/plan-dependency-graph.d.ts +25 -0
  448. package/dist/plan-dependency-graph.d.ts.map +1 -0
  449. package/dist/plan-dependency-graph.js +195 -0
  450. package/dist/plan-review.d.ts +64 -0
  451. package/dist/plan-review.d.ts.map +1 -0
  452. package/dist/plan-review.js +242 -0
  453. package/dist/plan-simulation.d.ts +108 -0
  454. package/dist/plan-simulation.d.ts.map +1 -0
  455. package/dist/plan-simulation.js +767 -0
  456. package/dist/playbook-registry.d.ts +25 -0
  457. package/dist/playbook-registry.d.ts.map +1 -0
  458. package/dist/playbook-registry.js +148 -0
  459. package/dist/playbook-script.d.ts +60 -0
  460. package/dist/playbook-script.d.ts.map +1 -0
  461. package/dist/playbook-script.js +161 -0
  462. package/dist/plugin-lifecycle-profile-registry.d.ts +52 -0
  463. package/dist/plugin-lifecycle-profile-registry.d.ts.map +1 -0
  464. package/dist/plugin-lifecycle-profile-registry.js +202 -0
  465. package/dist/plugin-lifecycle.d.ts +132 -0
  466. package/dist/plugin-lifecycle.d.ts.map +1 -0
  467. package/dist/plugin-lifecycle.js +477 -0
  468. package/dist/policy-engine.d.ts +101 -0
  469. package/dist/policy-engine.d.ts.map +1 -0
  470. package/dist/policy-engine.js +321 -0
  471. package/dist/policy-override-audit.d.ts +18 -0
  472. package/dist/policy-override-audit.d.ts.map +1 -0
  473. package/dist/policy-override-audit.js +54 -0
  474. package/dist/policy-overrides.d.ts +35 -0
  475. package/dist/policy-overrides.d.ts.map +1 -0
  476. package/dist/policy-overrides.js +84 -0
  477. package/dist/policy-test.d.ts +83 -0
  478. package/dist/policy-test.d.ts.map +1 -0
  479. package/dist/policy-test.js +342 -0
  480. package/dist/pr-summary.d.ts +34 -0
  481. package/dist/pr-summary.d.ts.map +1 -0
  482. package/dist/pr-summary.js +220 -0
  483. package/dist/product-coherence.d.ts +21 -0
  484. package/dist/product-coherence.d.ts.map +1 -0
  485. package/dist/product-coherence.js +158 -0
  486. package/dist/profile-registry.d.ts +42 -0
  487. package/dist/profile-registry.d.ts.map +1 -0
  488. package/dist/profile-registry.js +104 -0
  489. package/dist/project-coupling-audit.d.ts +64 -0
  490. package/dist/project-coupling-audit.d.ts.map +1 -0
  491. package/dist/project-coupling-audit.js +282 -0
  492. package/dist/project-overview.d.ts +14 -0
  493. package/dist/project-overview.d.ts.map +1 -0
  494. package/dist/project-overview.js +27 -0
  495. package/dist/propose-knowledge.d.ts +64 -0
  496. package/dist/propose-knowledge.d.ts.map +1 -0
  497. package/dist/propose-knowledge.js +367 -0
  498. package/dist/quality-baseline.d.ts +123 -0
  499. package/dist/quality-baseline.d.ts.map +1 -0
  500. package/dist/quality-baseline.js +433 -0
  501. package/dist/quality-html.d.ts +7 -0
  502. package/dist/quality-html.d.ts.map +1 -0
  503. package/dist/quality-html.js +64 -0
  504. package/dist/quality-report.d.ts +49 -0
  505. package/dist/quality-report.d.ts.map +1 -0
  506. package/dist/quality-report.js +296 -0
  507. package/dist/query-resolver.d.ts +38 -0
  508. package/dist/query-resolver.d.ts.map +1 -0
  509. package/dist/query-resolver.js +163 -0
  510. package/dist/ranker-explainability.d.ts +91 -0
  511. package/dist/ranker-explainability.d.ts.map +1 -0
  512. package/dist/ranker-explainability.js +550 -0
  513. package/dist/reference-lookup.d.ts +8 -0
  514. package/dist/reference-lookup.d.ts.map +1 -0
  515. package/dist/reference-lookup.js +18 -0
  516. package/dist/registration-hint-registry.d.ts +55 -0
  517. package/dist/registration-hint-registry.d.ts.map +1 -0
  518. package/dist/registration-hint-registry.js +327 -0
  519. package/dist/registry-lifecycle.d.ts +47 -0
  520. package/dist/registry-lifecycle.d.ts.map +1 -0
  521. package/dist/registry-lifecycle.js +214 -0
  522. package/dist/release-readiness.d.ts +64 -0
  523. package/dist/release-readiness.d.ts.map +1 -0
  524. package/dist/release-readiness.js +456 -0
  525. package/dist/release-smoke.d.ts +138 -0
  526. package/dist/release-smoke.d.ts.map +1 -0
  527. package/dist/release-smoke.js +459 -0
  528. package/dist/release-train.d.ts +33 -0
  529. package/dist/release-train.d.ts.map +1 -0
  530. package/dist/release-train.js +104 -0
  531. package/dist/repo-memory.d.ts +95 -0
  532. package/dist/repo-memory.d.ts.map +1 -0
  533. package/dist/repo-memory.js +614 -0
  534. package/dist/report-site.d.ts +92 -0
  535. package/dist/report-site.d.ts.map +1 -0
  536. package/dist/report-site.js +658 -0
  537. package/dist/reposet.d.ts +56 -0
  538. package/dist/reposet.d.ts.map +1 -0
  539. package/dist/reposet.js +160 -0
  540. package/dist/repository-intelligence.d.ts +145 -0
  541. package/dist/repository-intelligence.d.ts.map +1 -0
  542. package/dist/repository-intelligence.js +729 -0
  543. package/dist/repository-knowledge-model.d.ts +218 -0
  544. package/dist/repository-knowledge-model.d.ts.map +1 -0
  545. package/dist/repository-knowledge-model.js +939 -0
  546. package/dist/repository-map.d.ts +72 -0
  547. package/dist/repository-map.d.ts.map +1 -0
  548. package/dist/repository-map.js +332 -0
  549. package/dist/repository-stats.d.ts +66 -0
  550. package/dist/repository-stats.d.ts.map +1 -0
  551. package/dist/repository-stats.js +329 -0
  552. package/dist/review-comment-renderer.d.ts +59 -0
  553. package/dist/review-comment-renderer.d.ts.map +1 -0
  554. package/dist/review-comment-renderer.js +181 -0
  555. package/dist/review-comment-v2.d.ts +9 -0
  556. package/dist/review-comment-v2.d.ts.map +1 -0
  557. package/dist/review-comment-v2.js +178 -0
  558. package/dist/review-html.d.ts +13 -0
  559. package/dist/review-html.d.ts.map +1 -0
  560. package/dist/review-html.js +79 -0
  561. package/dist/review-packet-v2.d.ts +29 -0
  562. package/dist/review-packet-v2.d.ts.map +1 -0
  563. package/dist/review-packet-v2.js +71 -0
  564. package/dist/review-packet-v3.d.ts +22 -0
  565. package/dist/review-packet-v3.d.ts.map +1 -0
  566. package/dist/review-packet-v3.js +181 -0
  567. package/dist/review-packet.d.ts +49 -0
  568. package/dist/review-packet.d.ts.map +1 -0
  569. package/dist/review-packet.js +129 -0
  570. package/dist/risk-signals.d.ts +28 -0
  571. package/dist/risk-signals.d.ts.map +1 -0
  572. package/dist/risk-signals.js +68 -0
  573. package/dist/role-views.d.ts +50 -0
  574. package/dist/role-views.d.ts.map +1 -0
  575. package/dist/role-views.js +334 -0
  576. package/dist/rounds.d.ts +52 -0
  577. package/dist/rounds.d.ts.map +1 -0
  578. package/dist/rounds.js +172 -0
  579. package/dist/rule-drift.d.ts +42 -0
  580. package/dist/rule-drift.d.ts.map +1 -0
  581. package/dist/rule-drift.js +148 -0
  582. package/dist/rule-quality.d.ts +73 -0
  583. package/dist/rule-quality.d.ts.map +1 -0
  584. package/dist/rule-quality.js +356 -0
  585. package/dist/rule-scaffold.d.ts +71 -0
  586. package/dist/rule-scaffold.d.ts.map +1 -0
  587. package/dist/rule-scaffold.js +258 -0
  588. package/dist/safety-audit-deep.d.ts +38 -0
  589. package/dist/safety-audit-deep.d.ts.map +1 -0
  590. package/dist/safety-audit-deep.js +162 -0
  591. package/dist/safety-audit.d.ts +91 -0
  592. package/dist/safety-audit.d.ts.map +1 -0
  593. package/dist/safety-audit.js +138 -0
  594. package/dist/safety-html.d.ts +7 -0
  595. package/dist/safety-html.d.ts.map +1 -0
  596. package/dist/safety-html.js +70 -0
  597. package/dist/scaffold-coverage.d.ts +46 -0
  598. package/dist/scaffold-coverage.d.ts.map +1 -0
  599. package/dist/scaffold-coverage.js +273 -0
  600. package/dist/scaffold-patterns.d.ts +38 -0
  601. package/dist/scaffold-patterns.d.ts.map +1 -0
  602. package/dist/scaffold-patterns.js +282 -0
  603. package/dist/schema-inventory.d.ts +55 -0
  604. package/dist/schema-inventory.d.ts.map +1 -0
  605. package/dist/schema-inventory.js +301 -0
  606. package/dist/search-index.d.ts +75 -0
  607. package/dist/search-index.d.ts.map +1 -0
  608. package/dist/search-index.js +531 -0
  609. package/dist/search-tuning-explain.d.ts +68 -0
  610. package/dist/search-tuning-explain.d.ts.map +1 -0
  611. package/dist/search-tuning-explain.js +207 -0
  612. package/dist/search-tuning-registry.d.ts +54 -0
  613. package/dist/search-tuning-registry.d.ts.map +1 -0
  614. package/dist/search-tuning-registry.js +303 -0
  615. package/dist/self-audit.d.ts +59 -0
  616. package/dist/self-audit.d.ts.map +1 -0
  617. package/dist/self-audit.js +192 -0
  618. package/dist/self-config-doctor-v2.d.ts +57 -0
  619. package/dist/self-config-doctor-v2.d.ts.map +1 -0
  620. package/dist/self-config-doctor-v2.js +653 -0
  621. package/dist/self-config-doctor.d.ts +47 -0
  622. package/dist/self-config-doctor.d.ts.map +1 -0
  623. package/dist/self-config-doctor.js +432 -0
  624. package/dist/sharkcraft-inspector.d.ts +73 -0
  625. package/dist/sharkcraft-inspector.d.ts.map +1 -0
  626. package/dist/sharkcraft-inspector.js +745 -0
  627. package/dist/spec/spec-cross-validate.d.ts +17 -0
  628. package/dist/spec/spec-cross-validate.d.ts.map +1 -0
  629. package/dist/spec/spec-cross-validate.js +53 -0
  630. package/dist/spec/spec-discovery.d.ts +27 -0
  631. package/dist/spec/spec-discovery.d.ts.map +1 -0
  632. package/dist/spec/spec-discovery.js +78 -0
  633. package/dist/spec/spec-review.d.ts +36 -0
  634. package/dist/spec/spec-review.d.ts.map +1 -0
  635. package/dist/spec/spec-review.js +37 -0
  636. package/dist/stability-map.d.ts +62 -0
  637. package/dist/stability-map.d.ts.map +1 -0
  638. package/dist/stability-map.js +404 -0
  639. package/dist/start-here.d.ts +49 -0
  640. package/dist/start-here.d.ts.map +1 -0
  641. package/dist/start-here.js +259 -0
  642. package/dist/surface-profile-detect.d.ts +42 -0
  643. package/dist/surface-profile-detect.d.ts.map +1 -0
  644. package/dist/surface-profile-detect.js +76 -0
  645. package/dist/symbol-index.d.ts +108 -0
  646. package/dist/symbol-index.d.ts.map +1 -0
  647. package/dist/symbol-index.js +483 -0
  648. package/dist/task-decompose.d.ts +38 -0
  649. package/dist/task-decompose.d.ts.map +1 -0
  650. package/dist/task-decompose.js +154 -0
  651. package/dist/task-packet.d.ts +104 -0
  652. package/dist/task-packet.d.ts.map +1 -0
  653. package/dist/task-packet.js +156 -0
  654. package/dist/task-ranker.d.ts +51 -0
  655. package/dist/task-ranker.d.ts.map +1 -0
  656. package/dist/task-ranker.js +410 -0
  657. package/dist/task-risk.d.ts +84 -0
  658. package/dist/task-risk.d.ts.map +1 -0
  659. package/dist/task-risk.js +731 -0
  660. package/dist/task-routing-hint-registry.d.ts +36 -0
  661. package/dist/task-routing-hint-registry.d.ts.map +1 -0
  662. package/dist/task-routing-hint-registry.js +186 -0
  663. package/dist/template-authoring.d.ts +113 -0
  664. package/dist/template-authoring.d.ts.map +1 -0
  665. package/dist/template-authoring.js +521 -0
  666. package/dist/template-body-inference-v2.d.ts +19 -0
  667. package/dist/template-body-inference-v2.d.ts.map +1 -0
  668. package/dist/template-body-inference-v2.js +468 -0
  669. package/dist/template-body-inference.d.ts +59 -0
  670. package/dist/template-body-inference.d.ts.map +1 -0
  671. package/dist/template-body-inference.js +277 -0
  672. package/dist/template-drift.d.ts +39 -0
  673. package/dist/template-drift.d.ts.map +1 -0
  674. package/dist/template-drift.js +353 -0
  675. package/dist/template-lint.d.ts +31 -0
  676. package/dist/template-lint.d.ts.map +1 -0
  677. package/dist/template-lint.js +113 -0
  678. package/dist/test-definitions.d.ts +41 -0
  679. package/dist/test-definitions.d.ts.map +1 -0
  680. package/dist/test-definitions.js +6 -0
  681. package/dist/test-impact.d.ts +30 -0
  682. package/dist/test-impact.d.ts.map +1 -0
  683. package/dist/test-impact.js +173 -0
  684. package/dist/test-runner.d.ts +87 -0
  685. package/dist/test-runner.d.ts.map +1 -0
  686. package/dist/test-runner.js +560 -0
  687. package/dist/uncertainty-report.d.ts +46 -0
  688. package/dist/uncertainty-report.d.ts.map +1 -0
  689. package/dist/uncertainty-report.js +108 -0
  690. package/dist/uncertainty.d.ts +38 -0
  691. package/dist/uncertainty.d.ts.map +1 -0
  692. package/dist/uncertainty.js +115 -0
  693. package/dist/universal-search.d.ts +64 -0
  694. package/dist/universal-search.d.ts.map +1 -0
  695. package/dist/universal-search.js +347 -0
  696. package/dist/upgrade-advisor.d.ts +22 -0
  697. package/dist/upgrade-advisor.d.ts.map +1 -0
  698. package/dist/upgrade-advisor.js +109 -0
  699. package/dist/why-file.d.ts +75 -0
  700. package/dist/why-file.d.ts.map +1 -0
  701. package/dist/why-file.js +202 -0
  702. package/dist/workflow-simulation.d.ts +46 -0
  703. package/dist/workflow-simulation.d.ts.map +1 -0
  704. package/dist/workflow-simulation.js +154 -0
  705. package/package.json +66 -0
@@ -0,0 +1,729 @@
1
+ /**
2
+ * Repository intelligence graph v2.
3
+ *
4
+ * Unifies existing SharkCraft data sources (packages, files, constructs,
5
+ * rules, paths, templates, pipelines, presets, boundaries, packs,
6
+ * ownership, sessions, bundles) into a single deterministic graph the
7
+ * agent can navigate.
8
+ *
9
+ * Read-only. Sources data from the already-loaded inspection — never
10
+ * re-walks the filesystem unless absolutely necessary. Truncates large
11
+ * collections with explicit metadata so the graph stays bounded on
12
+ * large repos.
13
+ */
14
+ import { existsSync, readdirSync, readFileSync, statSync } from 'node:fs';
15
+ import * as nodePath from 'node:path';
16
+ import { loadTsconfigPaths, scanImports } from '@shrkcrft/boundaries';
17
+ import { listConstructs, loadConstructs } from "./construct-registry.js";
18
+ export const REPOSITORY_INTELLIGENCE_SCHEMA = 'sharkcraft.repository-intelligence/v1';
19
+ export var RepoNodeKind;
20
+ (function (RepoNodeKind) {
21
+ RepoNodeKind["File"] = "file";
22
+ RepoNodeKind["Directory"] = "directory";
23
+ RepoNodeKind["Package"] = "package";
24
+ RepoNodeKind["App"] = "app";
25
+ RepoNodeKind["Library"] = "library";
26
+ RepoNodeKind["Construct"] = "construct";
27
+ RepoNodeKind["PublicApi"] = "public-api";
28
+ RepoNodeKind["Template"] = "template";
29
+ RepoNodeKind["Pipeline"] = "pipeline";
30
+ RepoNodeKind["Playbook"] = "playbook";
31
+ RepoNodeKind["Preset"] = "preset";
32
+ RepoNodeKind["Policy"] = "policy";
33
+ RepoNodeKind["BoundaryRule"] = "boundary-rule";
34
+ RepoNodeKind["OwnershipRule"] = "ownership-rule";
35
+ RepoNodeKind["Test"] = "test";
36
+ RepoNodeKind["Doc"] = "doc";
37
+ RepoNodeKind["Script"] = "script";
38
+ RepoNodeKind["Pack"] = "pack";
39
+ RepoNodeKind["Session"] = "session";
40
+ RepoNodeKind["Bundle"] = "bundle";
41
+ RepoNodeKind["Decision"] = "decision";
42
+ })(RepoNodeKind || (RepoNodeKind = {}));
43
+ export var RepoEdgeKind;
44
+ (function (RepoEdgeKind) {
45
+ RepoEdgeKind["Imports"] = "imports";
46
+ RepoEdgeKind["Exports"] = "exports";
47
+ RepoEdgeKind["Owns"] = "owns";
48
+ RepoEdgeKind["BelongsTo"] = "belongs-to";
49
+ RepoEdgeKind["Tests"] = "tests";
50
+ RepoEdgeKind["Violates"] = "violates";
51
+ RepoEdgeKind["GovernedBy"] = "governed-by";
52
+ RepoEdgeKind["GeneratedBy"] = "generated-by";
53
+ RepoEdgeKind["ReferencedBy"] = "referenced-by";
54
+ RepoEdgeKind["DependsOn"] = "depends-on";
55
+ RepoEdgeKind["Impacts"] = "impacts";
56
+ RepoEdgeKind["UsesTemplate"] = "uses-template";
57
+ RepoEdgeKind["UsesPipeline"] = "uses-pipeline";
58
+ RepoEdgeKind["UsesPlaybook"] = "uses-playbook";
59
+ RepoEdgeKind["RelatedRule"] = "related-rule";
60
+ RepoEdgeKind["RelatedPath"] = "related-path";
61
+ RepoEdgeKind["PublicApiOf"] = "public-api-of";
62
+ })(RepoEdgeKind || (RepoEdgeKind = {}));
63
+ const FILES_CAP = 800;
64
+ const IMPORT_EDGE_CAP = 4000;
65
+ const TEST_PATTERN = /(?:^|\/)(?:test|tests|__tests__|spec|specs|e2e)(?:\/|\.)|\.(?:test|spec|e2e)\.[tj]sx?$/i;
66
+ const DOC_PATTERN = /(?:^|\/)(?:README|CHANGELOG|LICENSE|CONTRIBUTING|SECURITY)(?:\.md)?$|\.md$/i;
67
+ const SCRIPT_PATTERN = /(?:^|\/)(?:scripts?|tools)\//i;
68
+ function listPackages(projectRoot) {
69
+ const out = [];
70
+ for (const top of ['packages', 'apps', 'examples']) {
71
+ const root = nodePath.join(projectRoot, top);
72
+ if (!existsSync(root))
73
+ continue;
74
+ for (const short of readdirSync(root)) {
75
+ const dir = nodePath.join(root, short);
76
+ const pkgJson = nodePath.join(dir, 'package.json');
77
+ if (!existsSync(pkgJson))
78
+ continue;
79
+ try {
80
+ const stat = statSync(dir);
81
+ if (!stat.isDirectory())
82
+ continue;
83
+ }
84
+ catch {
85
+ continue;
86
+ }
87
+ let name = short;
88
+ try {
89
+ const meta = JSON.parse(readFileSync(pkgJson, 'utf8'));
90
+ if (typeof meta.name === 'string')
91
+ name = meta.name;
92
+ }
93
+ catch {
94
+ /* keep short */
95
+ }
96
+ const kind = top === 'packages' ? 'package' : top === 'apps' ? 'app' : 'example';
97
+ out.push({ name, kind, dir });
98
+ }
99
+ }
100
+ return out;
101
+ }
102
+ function walkSourceFiles(packageDir, cap) {
103
+ const out = [];
104
+ const stack = [packageDir];
105
+ while (stack.length > 0 && out.length < cap) {
106
+ const dir = stack.pop();
107
+ let entries = [];
108
+ try {
109
+ entries = readdirSync(dir);
110
+ }
111
+ catch {
112
+ continue;
113
+ }
114
+ for (const name of entries) {
115
+ if (name === 'node_modules' || name === 'dist' || name === '.git' || name === '.sharkcraft' || name.startsWith('.')) {
116
+ continue;
117
+ }
118
+ const full = nodePath.join(dir, name);
119
+ let st;
120
+ try {
121
+ st = statSync(full);
122
+ }
123
+ catch {
124
+ continue;
125
+ }
126
+ if (st.isDirectory())
127
+ stack.push(full);
128
+ else if (/\.(?:ts|tsx|js|jsx|mts|cts|md)$/.test(name))
129
+ out.push(full);
130
+ if (out.length >= cap)
131
+ break;
132
+ }
133
+ }
134
+ return out;
135
+ }
136
+ export async function buildRepositoryIntelligenceGraph(inspection, options = {}) {
137
+ await loadConstructs(inspection);
138
+ const includeImports = options.includeImports === true;
139
+ const importEdgeCap = options.importEdgeCap ?? IMPORT_EDGE_CAP;
140
+ const nodes = [];
141
+ const edges = [];
142
+ const seen = new Set();
143
+ const addNode = (n) => {
144
+ if (seen.has(n.id))
145
+ return;
146
+ seen.add(n.id);
147
+ nodes.push(n);
148
+ };
149
+ const addEdge = (e) => {
150
+ edges.push(e);
151
+ };
152
+ // Packages / apps / libraries.
153
+ const packages = listPackages(inspection.projectRoot);
154
+ for (const p of packages) {
155
+ const id = `pkg:${p.name}`;
156
+ const kind = p.kind === 'app'
157
+ ? RepoNodeKind.App
158
+ : p.kind === 'example'
159
+ ? RepoNodeKind.Library
160
+ : RepoNodeKind.Package;
161
+ addNode({ id, kind, label: p.name, meta: { dir: p.dir } });
162
+ }
163
+ // Files (capped). Walk each package once.
164
+ let totalFiles = 0;
165
+ let filesCapped = false;
166
+ for (const p of packages) {
167
+ const files = walkSourceFiles(p.dir, FILES_CAP - totalFiles);
168
+ for (const f of files) {
169
+ totalFiles += 1;
170
+ if (totalFiles > FILES_CAP) {
171
+ filesCapped = true;
172
+ break;
173
+ }
174
+ const rel = nodePath.relative(inspection.projectRoot, f);
175
+ const fileId = `file:${rel}`;
176
+ const fileKind = TEST_PATTERN.test(rel)
177
+ ? RepoNodeKind.Test
178
+ : DOC_PATTERN.test(rel)
179
+ ? RepoNodeKind.Doc
180
+ : SCRIPT_PATTERN.test(rel)
181
+ ? RepoNodeKind.Script
182
+ : RepoNodeKind.File;
183
+ addNode({ id: fileId, kind: fileKind, label: rel });
184
+ addEdge({ from: fileId, to: `pkg:${p.name}`, kind: RepoEdgeKind.BelongsTo });
185
+ }
186
+ if (filesCapped)
187
+ break;
188
+ }
189
+ // Add scripts/* and docs/* at repo root too.
190
+ for (const top of ['scripts', 'docs']) {
191
+ const root = nodePath.join(inspection.projectRoot, top);
192
+ if (!existsSync(root))
193
+ continue;
194
+ const files = walkSourceFiles(root, Math.max(0, FILES_CAP - totalFiles));
195
+ for (const f of files) {
196
+ totalFiles += 1;
197
+ if (totalFiles > FILES_CAP) {
198
+ filesCapped = true;
199
+ break;
200
+ }
201
+ const rel = nodePath.relative(inspection.projectRoot, f);
202
+ const id = `file:${rel}`;
203
+ addNode({
204
+ id,
205
+ kind: top === 'docs' ? RepoNodeKind.Doc : RepoNodeKind.Script,
206
+ label: rel,
207
+ });
208
+ }
209
+ if (filesCapped)
210
+ break;
211
+ }
212
+ // Constructs.
213
+ for (const c of listConstructs(inspection)) {
214
+ const id = `construct:${c.id}`;
215
+ addNode({ id, kind: RepoNodeKind.Construct, label: c.id, meta: { constructType: c.type } });
216
+ if (/api|public/i.test(c.type)) {
217
+ addNode({ id: `public-api:${c.id}`, kind: RepoNodeKind.PublicApi, label: c.id });
218
+ addEdge({ from: `public-api:${c.id}`, to: id, kind: RepoEdgeKind.PublicApiOf });
219
+ }
220
+ }
221
+ // Templates.
222
+ for (const t of inspection.templates) {
223
+ addNode({ id: `template:${t.id}`, kind: RepoNodeKind.Template, label: t.id });
224
+ }
225
+ // Pipelines.
226
+ for (const p of inspection.pipelines) {
227
+ addNode({ id: `pipeline:${p.id}`, kind: RepoNodeKind.Pipeline, label: p.id });
228
+ }
229
+ // Presets.
230
+ for (const pr of inspection.presetRegistry.list()) {
231
+ addNode({ id: `preset:${pr.id}`, kind: RepoNodeKind.Preset, label: pr.id });
232
+ }
233
+ // Boundary rules.
234
+ for (const b of inspection.boundaryRegistry.list()) {
235
+ addNode({
236
+ id: `boundary:${b.id}`,
237
+ kind: RepoNodeKind.BoundaryRule,
238
+ label: b.id,
239
+ meta: { severity: b.severity ?? 'warning' },
240
+ });
241
+ }
242
+ // Packs.
243
+ for (const p of inspection.packs.validPacks ?? []) {
244
+ addNode({
245
+ id: `pack:${p.packageName}`,
246
+ kind: RepoNodeKind.Pack,
247
+ label: p.packageName,
248
+ meta: { version: p.packageVersion ?? '' },
249
+ });
250
+ }
251
+ // Summaries.
252
+ let pkgN = 0, appN = 0, libN = 0, constructN = 0, policyN = 0, boundaryN = 0, ownN = 0, testN = 0, docN = 0, scriptN = 0, packN = 0, decisionN = 0;
253
+ for (const n of nodes) {
254
+ switch (n.kind) {
255
+ case RepoNodeKind.Package:
256
+ pkgN++;
257
+ break;
258
+ case RepoNodeKind.App:
259
+ appN++;
260
+ break;
261
+ case RepoNodeKind.Library:
262
+ libN++;
263
+ break;
264
+ case RepoNodeKind.Construct:
265
+ constructN++;
266
+ break;
267
+ case RepoNodeKind.Policy:
268
+ policyN++;
269
+ break;
270
+ case RepoNodeKind.BoundaryRule:
271
+ boundaryN++;
272
+ break;
273
+ case RepoNodeKind.OwnershipRule:
274
+ ownN++;
275
+ break;
276
+ case RepoNodeKind.Test:
277
+ testN++;
278
+ break;
279
+ case RepoNodeKind.Doc:
280
+ docN++;
281
+ break;
282
+ case RepoNodeKind.Script:
283
+ scriptN++;
284
+ break;
285
+ case RepoNodeKind.Pack:
286
+ packN++;
287
+ break;
288
+ case RepoNodeKind.Decision:
289
+ decisionN++;
290
+ break;
291
+ default:
292
+ break;
293
+ }
294
+ }
295
+ // Import / depends-on / tests edges (opt-in).
296
+ let importEdgeCount = 0;
297
+ let importEdgesCapped = false;
298
+ let aliasResolvedEdges = 0;
299
+ if (includeImports) {
300
+ let scan = null;
301
+ try {
302
+ scan = scanImports({ projectRoot: inspection.projectRoot });
303
+ }
304
+ catch {
305
+ scan = null;
306
+ }
307
+ let aliasMap = new Map();
308
+ if (options.resolveAliases === true) {
309
+ try {
310
+ aliasMap = loadTsconfigPaths(inspection.projectRoot).aliases;
311
+ }
312
+ catch {
313
+ aliasMap = new Map();
314
+ }
315
+ }
316
+ // Build a map of package short name (last segment after /) → package name + dir.
317
+ const packageByDir = new Map();
318
+ for (const p of packages)
319
+ packageByDir.set(p.dir, p.name);
320
+ const packageByPath = (rel) => {
321
+ for (const [dir, name] of packageByDir) {
322
+ const relDir = nodePath.relative(inspection.projectRoot, dir);
323
+ if (rel === relDir || rel.startsWith(relDir + nodePath.sep) || rel.startsWith(relDir + '/'))
324
+ return name;
325
+ }
326
+ return undefined;
327
+ };
328
+ const internalPackageNames = new Set(packages.map((p) => p.name));
329
+ const tryResolveCandidates = (target) => {
330
+ const candidates = /\.[a-z]+$/i.test(target)
331
+ ? [target]
332
+ : [target + '.ts', target + '.tsx', target + '.js', target + '.jsx', target + '/index.ts'];
333
+ for (const c of candidates) {
334
+ const abs = nodePath.join(inspection.projectRoot, c);
335
+ if (existsSync(abs))
336
+ return c;
337
+ }
338
+ return undefined;
339
+ };
340
+ const resolveAliasSpecifier = (spec) => {
341
+ for (const [pattern, paths] of aliasMap.entries()) {
342
+ if (pattern.endsWith('*')) {
343
+ const prefix = pattern.slice(0, -1);
344
+ if (!spec.startsWith(prefix))
345
+ continue;
346
+ const rest = spec.slice(prefix.length);
347
+ for (const targetPattern of paths) {
348
+ const resolved = targetPattern.replace(/\*/g, rest);
349
+ const r = tryResolveCandidates(resolved);
350
+ if (r)
351
+ return r;
352
+ }
353
+ }
354
+ else if (pattern === spec) {
355
+ for (const t of paths) {
356
+ const r = tryResolveCandidates(t);
357
+ if (r)
358
+ return r;
359
+ }
360
+ }
361
+ }
362
+ return undefined;
363
+ };
364
+ if (scan) {
365
+ for (const e of scan.edges) {
366
+ if (importEdgeCount >= importEdgeCap) {
367
+ importEdgesCapped = true;
368
+ break;
369
+ }
370
+ const fromFileId = `file:${e.from}`;
371
+ if (e.kind === 'internal') {
372
+ // Relative path → resolve.
373
+ const target = nodePath.normalize(nodePath.join(nodePath.dirname(e.from), e.importSpecifier));
374
+ const resolved = tryResolveCandidates(target);
375
+ if (!resolved)
376
+ continue;
377
+ const toFileId = `file:${resolved}`;
378
+ if (!seen.has(toFileId))
379
+ continue;
380
+ addEdge({ from: fromFileId, to: toFileId, kind: RepoEdgeKind.Imports, resolvedVia: 'literal' });
381
+ importEdgeCount++;
382
+ if (TEST_PATTERN.test(e.from) && !TEST_PATTERN.test(resolved)) {
383
+ addEdge({ from: fromFileId, to: toFileId, kind: RepoEdgeKind.Tests, resolvedVia: 'literal' });
384
+ importEdgeCount++;
385
+ }
386
+ }
387
+ else if (e.kind === 'external' && e.importSpecifier.startsWith('@')) {
388
+ // Try tsconfig alias resolution first.
389
+ if (options.resolveAliases === true && aliasMap.size > 0) {
390
+ const resolved = resolveAliasSpecifier(e.importSpecifier);
391
+ if (resolved) {
392
+ const toFileId = `file:${resolved}`;
393
+ if (seen.has(toFileId)) {
394
+ addEdge({ from: fromFileId, to: toFileId, kind: RepoEdgeKind.Imports, resolvedVia: 'tsconfig-path' });
395
+ importEdgeCount++;
396
+ aliasResolvedEdges++;
397
+ if (TEST_PATTERN.test(e.from) && !TEST_PATTERN.test(resolved)) {
398
+ addEdge({ from: fromFileId, to: toFileId, kind: RepoEdgeKind.Tests, resolvedVia: 'tsconfig-path' });
399
+ importEdgeCount++;
400
+ }
401
+ continue;
402
+ }
403
+ }
404
+ }
405
+ // @scope/package → depends-on between packages.
406
+ const targetPkg = e.importSpecifier.split('/').slice(0, 2).join('/');
407
+ if (!internalPackageNames.has(targetPkg))
408
+ continue;
409
+ const fromPkgName = packageByPath(e.from);
410
+ if (!fromPkgName || fromPkgName === targetPkg)
411
+ continue;
412
+ addEdge({ from: `pkg:${fromPkgName}`, to: `pkg:${targetPkg}`, kind: RepoEdgeKind.DependsOn });
413
+ importEdgeCount++;
414
+ }
415
+ }
416
+ }
417
+ }
418
+ return {
419
+ schema: REPOSITORY_INTELLIGENCE_SCHEMA,
420
+ generatedAt: new Date().toISOString(),
421
+ projectRoot: inspection.projectRoot,
422
+ nodes,
423
+ edges,
424
+ summaries: {
425
+ packages: pkgN,
426
+ apps: appN,
427
+ libraries: libN,
428
+ constructs: constructN,
429
+ policies: policyN,
430
+ boundaries: boundaryN,
431
+ ownership: ownN,
432
+ tests: testN,
433
+ docs: docN,
434
+ scripts: scriptN,
435
+ packs: packN,
436
+ decisions: decisionN,
437
+ },
438
+ truncation: {
439
+ files: totalFiles,
440
+ filesCap: FILES_CAP,
441
+ filesCapped,
442
+ importEdges: importEdgeCount,
443
+ importEdgeCap,
444
+ importEdgesCapped,
445
+ aliasResolvedEdges,
446
+ },
447
+ };
448
+ }
449
+ export function getRepositoryNode(graph, id) {
450
+ return graph.nodes.find((n) => n.id === id);
451
+ }
452
+ export function explainRepositoryNode(graph, id) {
453
+ const node = getRepositoryNode(graph, id);
454
+ if (!node)
455
+ return undefined;
456
+ const incoming = graph.edges.filter((e) => e.to === id);
457
+ const outgoing = graph.edges.filter((e) => e.from === id);
458
+ const neighbors = new Set();
459
+ for (const e of incoming)
460
+ neighbors.add(e.from);
461
+ for (const e of outgoing)
462
+ neighbors.add(e.to);
463
+ return { node, incoming, outgoing, neighborCount: neighbors.size };
464
+ }
465
+ export function findRepositoryPath(graph, from, to, maxDepth = 6) {
466
+ if (!getRepositoryNode(graph, from) || !getRepositoryNode(graph, to))
467
+ return undefined;
468
+ const adj = new Map();
469
+ for (const e of graph.edges) {
470
+ if (!adj.has(e.from))
471
+ adj.set(e.from, []);
472
+ if (!adj.has(e.to))
473
+ adj.set(e.to, []);
474
+ adj.get(e.from).push(e.to);
475
+ adj.get(e.to).push(e.from);
476
+ }
477
+ const visited = new Map();
478
+ visited.set(from, null);
479
+ const queue = [from];
480
+ let depth = 0;
481
+ while (queue.length > 0 && depth < maxDepth) {
482
+ const next = [];
483
+ for (const cur of queue) {
484
+ if (cur === to) {
485
+ // Reconstruct.
486
+ const path = [];
487
+ let p = cur;
488
+ while (p) {
489
+ path.unshift(p);
490
+ p = visited.get(p) ?? null;
491
+ }
492
+ return path;
493
+ }
494
+ for (const n of adj.get(cur) ?? []) {
495
+ if (visited.has(n))
496
+ continue;
497
+ visited.set(n, cur);
498
+ next.push(n);
499
+ }
500
+ }
501
+ if (next.length === 0)
502
+ break;
503
+ queue.length = 0;
504
+ queue.push(...next);
505
+ depth++;
506
+ }
507
+ return undefined;
508
+ }
509
+ function applyTokenToGroup(group, token, errors) {
510
+ const negated = token.startsWith('not:');
511
+ const body = negated ? token.slice(4) : token;
512
+ const i = body.indexOf(':');
513
+ if (i < 0) {
514
+ if (negated) {
515
+ group.notText?.push(body) ?? (group.notText = [body]);
516
+ }
517
+ else {
518
+ group.text = (group.text ? group.text + ' ' : '') + body;
519
+ }
520
+ return;
521
+ }
522
+ const key = body.slice(0, i).toLowerCase();
523
+ const value = body.slice(i + 1);
524
+ if (negated) {
525
+ if (key === 'kind')
526
+ (group.notKinds ??= []).push(value);
527
+ else if (key === 'edge')
528
+ (group.notEdgeKinds ??= []).push(value);
529
+ else if (key === 'text')
530
+ (group.notText ??= []).push(value);
531
+ else if (key === 'tag')
532
+ (group.notTag ??= []).push(value);
533
+ else if (key === 'package' || key === 'pkg')
534
+ (group.notPackage ??= []).push(value);
535
+ else
536
+ errors.push(`Unsupported negated filter: not:${key}:<…>`);
537
+ return;
538
+ }
539
+ if (key === 'kind')
540
+ (group.kinds ??= []).push(value);
541
+ else if (key === 'edge')
542
+ (group.edgeKinds ??= []).push(value);
543
+ else if (key === 'imports')
544
+ group.imports = value;
545
+ else if (key === 'depends-on' || key === 'dependson' || key === 'depends')
546
+ group.dependsOn = value;
547
+ else if (key === 'text')
548
+ group.text = (group.text ? group.text + ' ' : '') + value;
549
+ else if (key === 'tag')
550
+ group.tag = value;
551
+ else if (key === 'package' || key === 'pkg')
552
+ group.packageName = value;
553
+ else if (key === 'construct')
554
+ group.constructId = value;
555
+ else if (key === 'risk' && (value === 'low' || value === 'medium' || value === 'high'))
556
+ group.risk = value;
557
+ else
558
+ errors.push(`Unknown filter key: ${key}`);
559
+ }
560
+ export function parseRepositoryGraphExpression(raw) {
561
+ const tokens = raw.trim().split(/\s+/).filter(Boolean);
562
+ const errors = [];
563
+ const groups = [{}];
564
+ for (const token of tokens) {
565
+ if (/^OR$/i.test(token)) {
566
+ groups.push({});
567
+ continue;
568
+ }
569
+ if (/^AND$/i.test(token))
570
+ continue;
571
+ const current = groups[groups.length - 1];
572
+ if (current)
573
+ applyTokenToGroup(current, token, errors);
574
+ }
575
+ return { expression: { groups }, errors };
576
+ }
577
+ /** Back-compat: single-group AND parse. */
578
+ export function parseRepositoryGraphQuery(raw) {
579
+ const { expression } = parseRepositoryGraphExpression(raw);
580
+ // When the user didn't use OR, return the single group so callers that
581
+ // expect the legacy IRepositoryGraphQuery shape still work.
582
+ return expression.groups[0] ?? {};
583
+ }
584
+ function applyGroupFilters(graph, query, reasons) {
585
+ let nodes = [...graph.nodes];
586
+ let edges = [...graph.edges];
587
+ if (query.kinds && query.kinds.length > 0) {
588
+ nodes = nodes.filter((n) => query.kinds.includes(n.kind));
589
+ reasons.push(`kind ∈ {${query.kinds.join(', ')}}`);
590
+ }
591
+ if (query.edgeKinds && query.edgeKinds.length > 0) {
592
+ edges = edges.filter((e) => query.edgeKinds.includes(e.kind));
593
+ reasons.push(`edge ∈ {${query.edgeKinds.join(', ')}}`);
594
+ }
595
+ if (query.text) {
596
+ const t = query.text.toLowerCase();
597
+ nodes = nodes.filter((n) => n.id.toLowerCase().includes(t) || n.label.toLowerCase().includes(t));
598
+ reasons.push(`text contains "${query.text}"`);
599
+ }
600
+ if (query.tag) {
601
+ const t = query.tag.toLowerCase();
602
+ nodes = nodes.filter((n) => n.kind === t || n.label.toLowerCase().includes(t));
603
+ reasons.push(`tag "${query.tag}"`);
604
+ }
605
+ if (query.packageName) {
606
+ nodes = nodes.filter((n) => n.label === query.packageName || n.id === `pkg:${query.packageName}`);
607
+ reasons.push(`package "${query.packageName}"`);
608
+ }
609
+ if (query.constructId) {
610
+ nodes = nodes.filter((n) => n.id === `construct:${query.constructId}` || n.label === query.constructId);
611
+ reasons.push(`construct "${query.constructId}"`);
612
+ }
613
+ if (query.imports) {
614
+ const fragment = query.imports;
615
+ const matchedFromIds = new Set();
616
+ for (const e of graph.edges) {
617
+ if (e.kind !== RepoEdgeKind.Imports)
618
+ continue;
619
+ if (e.to.includes(fragment) || e.to === `pkg:${fragment}`)
620
+ matchedFromIds.add(e.from);
621
+ }
622
+ nodes = nodes.filter((n) => matchedFromIds.has(n.id));
623
+ reasons.push(`imports contains "${fragment}"`);
624
+ }
625
+ if (query.dependsOn) {
626
+ const fragment = query.dependsOn;
627
+ const matchedFromIds = new Set();
628
+ for (const e of graph.edges) {
629
+ if (e.kind !== RepoEdgeKind.DependsOn)
630
+ continue;
631
+ if (e.to.includes(fragment))
632
+ matchedFromIds.add(e.from);
633
+ }
634
+ nodes = nodes.filter((n) => matchedFromIds.has(n.id));
635
+ reasons.push(`depends-on "${fragment}"`);
636
+ }
637
+ // Negated filters
638
+ if (query.notKinds && query.notKinds.length > 0) {
639
+ nodes = nodes.filter((n) => !query.notKinds.includes(n.kind));
640
+ reasons.push(`not:kind ∈ {${query.notKinds.join(', ')}}`);
641
+ }
642
+ if (query.notEdgeKinds && query.notEdgeKinds.length > 0) {
643
+ edges = edges.filter((e) => !query.notEdgeKinds.includes(e.kind));
644
+ reasons.push(`not:edge ∈ {${query.notEdgeKinds.join(', ')}}`);
645
+ }
646
+ if (query.notText && query.notText.length > 0) {
647
+ const lows = query.notText.map((t) => t.toLowerCase());
648
+ nodes = nodes.filter((n) => !lows.some((t) => n.id.toLowerCase().includes(t) || n.label.toLowerCase().includes(t)));
649
+ reasons.push(`not:text ∈ {${query.notText.join(', ')}}`);
650
+ }
651
+ if (query.notTag && query.notTag.length > 0) {
652
+ const lows = query.notTag.map((t) => t.toLowerCase());
653
+ nodes = nodes.filter((n) => !lows.some((t) => n.kind === t || n.label.toLowerCase().includes(t)));
654
+ reasons.push(`not:tag ∈ {${query.notTag.join(', ')}}`);
655
+ }
656
+ if (query.notPackage && query.notPackage.length > 0) {
657
+ nodes = nodes.filter((n) => !query.notPackage.includes(n.label));
658
+ reasons.push(`not:package ∈ {${query.notPackage.join(', ')}}`);
659
+ }
660
+ return { nodes, edges };
661
+ }
662
+ export function queryRepositoryIntelligence(graph, query) {
663
+ const reasons = [];
664
+ // Backwards-compatible: a plain query object is treated as a single AND group.
665
+ const groups = query.groups ?? [query];
666
+ if (groups.length === 1) {
667
+ const { nodes, edges } = applyGroupFilters(graph, groups[0], reasons);
668
+ return { nodes, edges, reasons };
669
+ }
670
+ // Multiple groups: OR together. Compute each group and union the nodes by id.
671
+ const unionNodes = new Map();
672
+ const unionEdgesKey = new Set();
673
+ const unionEdges = [];
674
+ for (let i = 0; i < groups.length; i++) {
675
+ const groupReasons = [];
676
+ const { nodes, edges } = applyGroupFilters(graph, groups[i], groupReasons);
677
+ reasons.push(`group ${i + 1}: ${groupReasons.join(' ∧ ') || '(no filters)'}`);
678
+ for (const n of nodes)
679
+ unionNodes.set(n.id, n);
680
+ for (const e of edges) {
681
+ const k = `${e.from}|${e.kind}|${e.to}`;
682
+ if (unionEdgesKey.has(k))
683
+ continue;
684
+ unionEdgesKey.add(k);
685
+ unionEdges.push(e);
686
+ }
687
+ }
688
+ return { nodes: [...unionNodes.values()], edges: unionEdges, reasons };
689
+ }
690
+ export function summarizeEdgeKinds(graph) {
691
+ const out = {};
692
+ for (const e of graph.edges)
693
+ out[e.kind] = (out[e.kind] ?? 0) + 1;
694
+ return out;
695
+ }
696
+ export function renderRepositoryIntelligenceText(graph) {
697
+ const lines = [];
698
+ lines.push('=== Repository intelligence ===');
699
+ lines.push(` nodes ${graph.nodes.length}`);
700
+ lines.push(` edges ${graph.edges.length}`);
701
+ lines.push(` packages ${graph.summaries.packages}`);
702
+ lines.push(` apps ${graph.summaries.apps}`);
703
+ lines.push(` libraries ${graph.summaries.libraries}`);
704
+ lines.push(` constructs ${graph.summaries.constructs}`);
705
+ lines.push(` policies ${graph.summaries.policies}`);
706
+ lines.push(` boundaries ${graph.summaries.boundaries}`);
707
+ lines.push(` ownership ${graph.summaries.ownership}`);
708
+ lines.push(` tests ${graph.summaries.tests}`);
709
+ lines.push(` docs ${graph.summaries.docs}`);
710
+ lines.push(` scripts ${graph.summaries.scripts}`);
711
+ lines.push(` packs ${graph.summaries.packs}`);
712
+ lines.push(` decisions ${graph.summaries.decisions}`);
713
+ if (graph.truncation.filesCapped) {
714
+ lines.push(` truncated files capped at ${graph.truncation.filesCap}`);
715
+ }
716
+ if (graph.truncation.importEdges > 0 || graph.truncation.importEdgesCapped) {
717
+ lines.push(` import edges ${graph.truncation.importEdges}${graph.truncation.importEdgesCapped ? ` (capped at ${graph.truncation.importEdgeCap})` : ''}`);
718
+ }
719
+ if (graph.truncation.aliasResolvedEdges > 0) {
720
+ lines.push(` alias-resolved edges ${graph.truncation.aliasResolvedEdges}`);
721
+ }
722
+ const ek = summarizeEdgeKinds(graph);
723
+ if (Object.keys(ek).length > 0) {
724
+ lines.push('Edges by kind:');
725
+ for (const [k, v] of Object.entries(ek).sort((a, b) => b[1] - a[1]))
726
+ lines.push(` ${k.padEnd(16)} ${v}`);
727
+ }
728
+ return lines.join('\n') + '\n';
729
+ }