spectra-cli 4.1.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 (1147) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +350 -0
  3. package/dist/adapters/go-adapter.d.ts +38 -0
  4. package/dist/adapters/go-adapter.d.ts.map +1 -0
  5. package/dist/adapters/go-adapter.js +58 -0
  6. package/dist/adapters/go-adapter.js.map +1 -0
  7. package/dist/adapters/index.d.ts +21 -0
  8. package/dist/adapters/index.d.ts.map +1 -0
  9. package/dist/adapters/index.js +36 -0
  10. package/dist/adapters/index.js.map +1 -0
  11. package/dist/adapters/java-adapter.d.ts +39 -0
  12. package/dist/adapters/java-adapter.d.ts.map +1 -0
  13. package/dist/adapters/java-adapter.js +65 -0
  14. package/dist/adapters/java-adapter.js.map +1 -0
  15. package/dist/adapters/language-adapter-registry.d.ts +56 -0
  16. package/dist/adapters/language-adapter-registry.d.ts.map +1 -0
  17. package/dist/adapters/language-adapter-registry.js +110 -0
  18. package/dist/adapters/language-adapter-registry.js.map +1 -0
  19. package/dist/adapters/language-adapter.d.ts +127 -0
  20. package/dist/adapters/language-adapter.d.ts.map +1 -0
  21. package/dist/adapters/language-adapter.js +2 -0
  22. package/dist/adapters/language-adapter.js.map +1 -0
  23. package/dist/adapters/python-adapter.d.ts +61 -0
  24. package/dist/adapters/python-adapter.d.ts.map +1 -0
  25. package/dist/adapters/python-adapter.js +260 -0
  26. package/dist/adapters/python-adapter.js.map +1 -0
  27. package/dist/adapters/tree-sitter-comment-extractor.d.ts +15 -0
  28. package/dist/adapters/tree-sitter-comment-extractor.d.ts.map +1 -0
  29. package/dist/adapters/tree-sitter-comment-extractor.js +105 -0
  30. package/dist/adapters/tree-sitter-comment-extractor.js.map +1 -0
  31. package/dist/adapters/ts-js-adapter.d.ts +38 -0
  32. package/dist/adapters/ts-js-adapter.d.ts.map +1 -0
  33. package/dist/adapters/ts-js-adapter.js +164 -0
  34. package/dist/adapters/ts-js-adapter.js.map +1 -0
  35. package/dist/auth/auth-detector.d.ts +41 -0
  36. package/dist/auth/auth-detector.d.ts.map +1 -0
  37. package/dist/auth/auth-detector.js +324 -0
  38. package/dist/auth/auth-detector.js.map +1 -0
  39. package/dist/auth/cli-proxy.d.ts +35 -0
  40. package/dist/auth/cli-proxy.d.ts.map +1 -0
  41. package/dist/auth/cli-proxy.js +225 -0
  42. package/dist/auth/cli-proxy.js.map +1 -0
  43. package/dist/auth/codex-proxy.d.ts +22 -0
  44. package/dist/auth/codex-proxy.d.ts.map +1 -0
  45. package/dist/auth/codex-proxy.js +199 -0
  46. package/dist/auth/codex-proxy.js.map +1 -0
  47. package/dist/batch/batch-orchestrator.d.ts +214 -0
  48. package/dist/batch/batch-orchestrator.d.ts.map +1 -0
  49. package/dist/batch/batch-orchestrator.js +1552 -0
  50. package/dist/batch/batch-orchestrator.js.map +1 -0
  51. package/dist/batch/batch-readme-generator.d.ts +32 -0
  52. package/dist/batch/batch-readme-generator.d.ts.map +1 -0
  53. package/dist/batch/batch-readme-generator.js +153 -0
  54. package/dist/batch/batch-readme-generator.js.map +1 -0
  55. package/dist/batch/budget-gate.d.ts +107 -0
  56. package/dist/batch/budget-gate.d.ts.map +1 -0
  57. package/dist/batch/budget-gate.js +279 -0
  58. package/dist/batch/budget-gate.js.map +1 -0
  59. package/dist/batch/checkpoint.d.ts +25 -0
  60. package/dist/batch/checkpoint.d.ts.map +1 -0
  61. package/dist/batch/checkpoint.js +68 -0
  62. package/dist/batch/checkpoint.js.map +1 -0
  63. package/dist/batch/cost-summary.d.ts +78 -0
  64. package/dist/batch/cost-summary.d.ts.map +1 -0
  65. package/dist/batch/cost-summary.js +191 -0
  66. package/dist/batch/cost-summary.js.map +1 -0
  67. package/dist/batch/delta-regenerator.d.ts +41 -0
  68. package/dist/batch/delta-regenerator.d.ts.map +1 -0
  69. package/dist/batch/delta-regenerator.js +267 -0
  70. package/dist/batch/delta-regenerator.js.map +1 -0
  71. package/dist/batch/directory-classifier.d.ts +79 -0
  72. package/dist/batch/directory-classifier.d.ts.map +1 -0
  73. package/dist/batch/directory-classifier.js +270 -0
  74. package/dist/batch/directory-classifier.js.map +1 -0
  75. package/dist/batch/language-grouper.d.ts +28 -0
  76. package/dist/batch/language-grouper.d.ts.map +1 -0
  77. package/dist/batch/language-grouper.js +67 -0
  78. package/dist/batch/language-grouper.js.map +1 -0
  79. package/dist/batch/model-override-decision.d.ts +27 -0
  80. package/dist/batch/model-override-decision.d.ts.map +1 -0
  81. package/dist/batch/model-override-decision.js +14 -0
  82. package/dist/batch/model-override-decision.js.map +1 -0
  83. package/dist/batch/module-grouper.d.ts +59 -0
  84. package/dist/batch/module-grouper.d.ts.map +1 -0
  85. package/dist/batch/module-grouper.js +286 -0
  86. package/dist/batch/module-grouper.js.map +1 -0
  87. package/dist/batch/progress-reporter.d.ts +68 -0
  88. package/dist/batch/progress-reporter.d.ts.map +1 -0
  89. package/dist/batch/progress-reporter.js +273 -0
  90. package/dist/batch/progress-reporter.js.map +1 -0
  91. package/dist/batch/readme-graph-section.d.ts +53 -0
  92. package/dist/batch/readme-graph-section.d.ts.map +1 -0
  93. package/dist/batch/readme-graph-section.js +183 -0
  94. package/dist/batch/readme-graph-section.js.map +1 -0
  95. package/dist/cli/commands/auth-status.d.ts +10 -0
  96. package/dist/cli/commands/auth-status.d.ts.map +1 -0
  97. package/dist/cli/commands/auth-status.js +50 -0
  98. package/dist/cli/commands/auth-status.js.map +1 -0
  99. package/dist/cli/commands/batch.d.ts +10 -0
  100. package/dist/cli/commands/batch.d.ts.map +1 -0
  101. package/dist/cli/commands/batch.js +133 -0
  102. package/dist/cli/commands/batch.js.map +1 -0
  103. package/dist/cli/commands/cache.d.ts +13 -0
  104. package/dist/cli/commands/cache.d.ts.map +1 -0
  105. package/dist/cli/commands/cache.js +65 -0
  106. package/dist/cli/commands/cache.js.map +1 -0
  107. package/dist/cli/commands/community.d.ts +10 -0
  108. package/dist/cli/commands/community.d.ts.map +1 -0
  109. package/dist/cli/commands/community.js +92 -0
  110. package/dist/cli/commands/community.js.map +1 -0
  111. package/dist/cli/commands/diff.d.ts +10 -0
  112. package/dist/cli/commands/diff.d.ts.map +1 -0
  113. package/dist/cli/commands/diff.js +49 -0
  114. package/dist/cli/commands/diff.js.map +1 -0
  115. package/dist/cli/commands/direction-audit.d.ts +12 -0
  116. package/dist/cli/commands/direction-audit.d.ts.map +1 -0
  117. package/dist/cli/commands/direction-audit.js +458 -0
  118. package/dist/cli/commands/direction-audit.js.map +1 -0
  119. package/dist/cli/commands/export.d.ts +22 -0
  120. package/dist/cli/commands/export.d.ts.map +1 -0
  121. package/dist/cli/commands/export.js +123 -0
  122. package/dist/cli/commands/export.js.map +1 -0
  123. package/dist/cli/commands/generate.d.ts +10 -0
  124. package/dist/cli/commands/generate.d.ts.map +1 -0
  125. package/dist/cli/commands/generate.js +50 -0
  126. package/dist/cli/commands/generate.js.map +1 -0
  127. package/dist/cli/commands/graph.d.ts +20 -0
  128. package/dist/cli/commands/graph.d.ts.map +1 -0
  129. package/dist/cli/commands/graph.js +189 -0
  130. package/dist/cli/commands/graph.js.map +1 -0
  131. package/dist/cli/commands/init.d.ts +10 -0
  132. package/dist/cli/commands/init.d.ts.map +1 -0
  133. package/dist/cli/commands/init.js +33 -0
  134. package/dist/cli/commands/init.js.map +1 -0
  135. package/dist/cli/commands/install.d.ts +11 -0
  136. package/dist/cli/commands/install.d.ts.map +1 -0
  137. package/dist/cli/commands/install.js +52 -0
  138. package/dist/cli/commands/install.js.map +1 -0
  139. package/dist/cli/commands/mcp-server.d.ts +23 -0
  140. package/dist/cli/commands/mcp-server.d.ts.map +1 -0
  141. package/dist/cli/commands/mcp-server.js +90 -0
  142. package/dist/cli/commands/mcp-server.js.map +1 -0
  143. package/dist/cli/commands/panoramic.d.ts +7 -0
  144. package/dist/cli/commands/panoramic.d.ts.map +1 -0
  145. package/dist/cli/commands/panoramic.js +43 -0
  146. package/dist/cli/commands/panoramic.js.map +1 -0
  147. package/dist/cli/commands/prepare.d.ts +13 -0
  148. package/dist/cli/commands/prepare.d.ts.map +1 -0
  149. package/dist/cli/commands/prepare.js +148 -0
  150. package/dist/cli/commands/prepare.js.map +1 -0
  151. package/dist/cli/commands/query.d.ts +13 -0
  152. package/dist/cli/commands/query.d.ts.map +1 -0
  153. package/dist/cli/commands/query.js +116 -0
  154. package/dist/cli/commands/query.js.map +1 -0
  155. package/dist/cli/commands/watch.d.ts +16 -0
  156. package/dist/cli/commands/watch.d.ts.map +1 -0
  157. package/dist/cli/commands/watch.js +188 -0
  158. package/dist/cli/commands/watch.js.map +1 -0
  159. package/dist/cli/index.d.ts +7 -0
  160. package/dist/cli/index.d.ts.map +1 -0
  161. package/dist/cli/index.js +193 -0
  162. package/dist/cli/index.js.map +1 -0
  163. package/dist/cli/utils/error-handler.d.ts +41 -0
  164. package/dist/cli/utils/error-handler.d.ts.map +1 -0
  165. package/dist/cli/utils/error-handler.js +90 -0
  166. package/dist/cli/utils/error-handler.js.map +1 -0
  167. package/dist/cli/utils/parse-args.d.ts +111 -0
  168. package/dist/cli/utils/parse-args.d.ts.map +1 -0
  169. package/dist/cli/utils/parse-args.js +756 -0
  170. package/dist/cli/utils/parse-args.js.map +1 -0
  171. package/dist/config/project-config.d.ts +49 -0
  172. package/dist/config/project-config.d.ts.map +1 -0
  173. package/dist/config/project-config.js +118 -0
  174. package/dist/config/project-config.js.map +1 -0
  175. package/dist/config/spec-driver-config.d.ts +32 -0
  176. package/dist/config/spec-driver-config.d.ts.map +1 -0
  177. package/dist/config/spec-driver-config.js +91 -0
  178. package/dist/config/spec-driver-config.js.map +1 -0
  179. package/dist/core/ast-analyzer.d.ts +49 -0
  180. package/dist/core/ast-analyzer.d.ts.map +1 -0
  181. package/dist/core/ast-analyzer.js +439 -0
  182. package/dist/core/ast-analyzer.js.map +1 -0
  183. package/dist/core/code-slice-extractor.d.ts +47 -0
  184. package/dist/core/code-slice-extractor.d.ts.map +1 -0
  185. package/dist/core/code-slice-extractor.js +227 -0
  186. package/dist/core/code-slice-extractor.js.map +1 -0
  187. package/dist/core/context-assembler.d.ts +80 -0
  188. package/dist/core/context-assembler.d.ts.map +1 -0
  189. package/dist/core/context-assembler.js +262 -0
  190. package/dist/core/context-assembler.js.map +1 -0
  191. package/dist/core/grammar-manager.d.ts +79 -0
  192. package/dist/core/grammar-manager.d.ts.map +1 -0
  193. package/dist/core/grammar-manager.js +188 -0
  194. package/dist/core/grammar-manager.js.map +1 -0
  195. package/dist/core/llm-client.d.ts +120 -0
  196. package/dist/core/llm-client.d.ts.map +1 -0
  197. package/dist/core/llm-client.js +608 -0
  198. package/dist/core/llm-client.js.map +1 -0
  199. package/dist/core/model-selection.d.ts +50 -0
  200. package/dist/core/model-selection.d.ts.map +1 -0
  201. package/dist/core/model-selection.js +410 -0
  202. package/dist/core/model-selection.js.map +1 -0
  203. package/dist/core/query-mappers/base-mapper.d.ts +22 -0
  204. package/dist/core/query-mappers/base-mapper.d.ts.map +1 -0
  205. package/dist/core/query-mappers/base-mapper.js +2 -0
  206. package/dist/core/query-mappers/base-mapper.js.map +1 -0
  207. package/dist/core/query-mappers/go-mapper.d.ts +46 -0
  208. package/dist/core/query-mappers/go-mapper.d.ts.map +1 -0
  209. package/dist/core/query-mappers/go-mapper.js +477 -0
  210. package/dist/core/query-mappers/go-mapper.js.map +1 -0
  211. package/dist/core/query-mappers/index.d.ts +6 -0
  212. package/dist/core/query-mappers/index.d.ts.map +1 -0
  213. package/dist/core/query-mappers/index.js +5 -0
  214. package/dist/core/query-mappers/index.js.map +1 -0
  215. package/dist/core/query-mappers/java-mapper.d.ts +40 -0
  216. package/dist/core/query-mappers/java-mapper.d.ts.map +1 -0
  217. package/dist/core/query-mappers/java-mapper.js +405 -0
  218. package/dist/core/query-mappers/java-mapper.js.map +1 -0
  219. package/dist/core/query-mappers/python-mapper.d.ts +65 -0
  220. package/dist/core/query-mappers/python-mapper.d.ts.map +1 -0
  221. package/dist/core/query-mappers/python-mapper.js +673 -0
  222. package/dist/core/query-mappers/python-mapper.js.map +1 -0
  223. package/dist/core/query-mappers/typescript-mapper.d.ts +54 -0
  224. package/dist/core/query-mappers/typescript-mapper.d.ts.map +1 -0
  225. package/dist/core/query-mappers/typescript-mapper.js +706 -0
  226. package/dist/core/query-mappers/typescript-mapper.js.map +1 -0
  227. package/dist/core/secret-redactor.d.ts +10 -0
  228. package/dist/core/secret-redactor.d.ts.map +1 -0
  229. package/dist/core/secret-redactor.js +208 -0
  230. package/dist/core/secret-redactor.js.map +1 -0
  231. package/dist/core/single-spec-orchestrator.d.ts +103 -0
  232. package/dist/core/single-spec-orchestrator.d.ts.map +1 -0
  233. package/dist/core/single-spec-orchestrator.js +911 -0
  234. package/dist/core/single-spec-orchestrator.js.map +1 -0
  235. package/dist/core/token-counter.d.ts +48 -0
  236. package/dist/core/token-counter.d.ts.map +1 -0
  237. package/dist/core/token-counter.js +136 -0
  238. package/dist/core/token-counter.js.map +1 -0
  239. package/dist/core/tree-sitter-analyzer.d.ts +62 -0
  240. package/dist/core/tree-sitter-analyzer.d.ts.map +1 -0
  241. package/dist/core/tree-sitter-analyzer.js +229 -0
  242. package/dist/core/tree-sitter-analyzer.js.map +1 -0
  243. package/dist/core/tree-sitter-fallback.d.ts +14 -0
  244. package/dist/core/tree-sitter-fallback.d.ts.map +1 -0
  245. package/dist/core/tree-sitter-fallback.js +423 -0
  246. package/dist/core/tree-sitter-fallback.js.map +1 -0
  247. package/dist/debt-scanner/aggregator/quality-report-patcher.d.ts +22 -0
  248. package/dist/debt-scanner/aggregator/quality-report-patcher.d.ts.map +1 -0
  249. package/dist/debt-scanner/aggregator/quality-report-patcher.js +107 -0
  250. package/dist/debt-scanner/aggregator/quality-report-patcher.js.map +1 -0
  251. package/dist/debt-scanner/aggregator/readme-indexer.d.ts +6 -0
  252. package/dist/debt-scanner/aggregator/readme-indexer.d.ts.map +1 -0
  253. package/dist/debt-scanner/aggregator/readme-indexer.js +52 -0
  254. package/dist/debt-scanner/aggregator/readme-indexer.js.map +1 -0
  255. package/dist/debt-scanner/aggregator/report-builder.d.ts +25 -0
  256. package/dist/debt-scanner/aggregator/report-builder.d.ts.map +1 -0
  257. package/dist/debt-scanner/aggregator/report-builder.js +162 -0
  258. package/dist/debt-scanner/aggregator/report-builder.js.map +1 -0
  259. package/dist/debt-scanner/comments/debt-classifier.d.ts +28 -0
  260. package/dist/debt-scanner/comments/debt-classifier.d.ts.map +1 -0
  261. package/dist/debt-scanner/comments/debt-classifier.js +50 -0
  262. package/dist/debt-scanner/comments/debt-classifier.js.map +1 -0
  263. package/dist/debt-scanner/comments/index.d.ts +32 -0
  264. package/dist/debt-scanner/comments/index.d.ts.map +1 -0
  265. package/dist/debt-scanner/comments/index.js +103 -0
  266. package/dist/debt-scanner/comments/index.js.map +1 -0
  267. package/dist/debt-scanner/comments/symbol-resolver.d.ts +18 -0
  268. package/dist/debt-scanner/comments/symbol-resolver.d.ts.map +1 -0
  269. package/dist/debt-scanner/comments/symbol-resolver.js +18 -0
  270. package/dist/debt-scanner/comments/symbol-resolver.js.map +1 -0
  271. package/dist/debt-scanner/design-docs/doc-discoverer.d.ts +6 -0
  272. package/dist/debt-scanner/design-docs/doc-discoverer.d.ts.map +1 -0
  273. package/dist/debt-scanner/design-docs/doc-discoverer.js +62 -0
  274. package/dist/debt-scanner/design-docs/doc-discoverer.js.map +1 -0
  275. package/dist/debt-scanner/design-docs/index.d.ts +28 -0
  276. package/dist/debt-scanner/design-docs/index.d.ts.map +1 -0
  277. package/dist/debt-scanner/design-docs/index.js +60 -0
  278. package/dist/debt-scanner/design-docs/index.js.map +1 -0
  279. package/dist/debt-scanner/design-docs/llm-topic-inferrer.d.ts +68 -0
  280. package/dist/debt-scanner/design-docs/llm-topic-inferrer.d.ts.map +1 -0
  281. package/dist/debt-scanner/design-docs/llm-topic-inferrer.js +151 -0
  282. package/dist/debt-scanner/design-docs/llm-topic-inferrer.js.map +1 -0
  283. package/dist/debt-scanner/design-docs/markdown-sections.d.ts +24 -0
  284. package/dist/debt-scanner/design-docs/markdown-sections.d.ts.map +1 -0
  285. package/dist/debt-scanner/design-docs/markdown-sections.js +92 -0
  286. package/dist/debt-scanner/design-docs/markdown-sections.js.map +1 -0
  287. package/dist/debt-scanner/design-docs/rule-detector.d.ts +18 -0
  288. package/dist/debt-scanner/design-docs/rule-detector.d.ts.map +1 -0
  289. package/dist/debt-scanner/design-docs/rule-detector.js +46 -0
  290. package/dist/debt-scanner/design-docs/rule-detector.js.map +1 -0
  291. package/dist/debt-scanner/index.d.ts +43 -0
  292. package/dist/debt-scanner/index.d.ts.map +1 -0
  293. package/dist/debt-scanner/index.js +177 -0
  294. package/dist/debt-scanner/index.js.map +1 -0
  295. package/dist/debt-scanner/llm-clients.d.ts +33 -0
  296. package/dist/debt-scanner/llm-clients.d.ts.map +1 -0
  297. package/dist/debt-scanner/llm-clients.js +78 -0
  298. package/dist/debt-scanner/llm-clients.js.map +1 -0
  299. package/dist/debt-scanner/types.d.ts +97 -0
  300. package/dist/debt-scanner/types.d.ts.map +1 -0
  301. package/dist/debt-scanner/types.js +7 -0
  302. package/dist/debt-scanner/types.js.map +1 -0
  303. package/dist/diff/drift-orchestrator.d.ts +25 -0
  304. package/dist/diff/drift-orchestrator.d.ts.map +1 -0
  305. package/dist/diff/drift-orchestrator.js +248 -0
  306. package/dist/diff/drift-orchestrator.js.map +1 -0
  307. package/dist/diff/noise-filter.d.ts +27 -0
  308. package/dist/diff/noise-filter.d.ts.map +1 -0
  309. package/dist/diff/noise-filter.js +129 -0
  310. package/dist/diff/noise-filter.js.map +1 -0
  311. package/dist/diff/semantic-diff.d.ts +12 -0
  312. package/dist/diff/semantic-diff.d.ts.map +1 -0
  313. package/dist/diff/semantic-diff.js +94 -0
  314. package/dist/diff/semantic-diff.js.map +1 -0
  315. package/dist/diff/structural-diff.d.ts +16 -0
  316. package/dist/diff/structural-diff.d.ts.map +1 -0
  317. package/dist/diff/structural-diff.js +171 -0
  318. package/dist/diff/structural-diff.js.map +1 -0
  319. package/dist/extraction/artifact-classifier.d.ts +19 -0
  320. package/dist/extraction/artifact-classifier.d.ts.map +1 -0
  321. package/dist/extraction/artifact-classifier.js +104 -0
  322. package/dist/extraction/artifact-classifier.js.map +1 -0
  323. package/dist/extraction/extraction-cache.d.ts +32 -0
  324. package/dist/extraction/extraction-cache.d.ts.map +1 -0
  325. package/dist/extraction/extraction-cache.js +117 -0
  326. package/dist/extraction/extraction-cache.js.map +1 -0
  327. package/dist/extraction/extraction-pipeline.d.ts +44 -0
  328. package/dist/extraction/extraction-pipeline.d.ts.map +1 -0
  329. package/dist/extraction/extraction-pipeline.js +286 -0
  330. package/dist/extraction/extraction-pipeline.js.map +1 -0
  331. package/dist/extraction/extraction-types.d.ts +180 -0
  332. package/dist/extraction/extraction-types.d.ts.map +1 -0
  333. package/dist/extraction/extraction-types.js +63 -0
  334. package/dist/extraction/extraction-types.js.map +1 -0
  335. package/dist/extraction/image-extractor.d.ts +21 -0
  336. package/dist/extraction/image-extractor.d.ts.map +1 -0
  337. package/dist/extraction/image-extractor.js +211 -0
  338. package/dist/extraction/image-extractor.js.map +1 -0
  339. package/dist/extraction/index.d.ts +8 -0
  340. package/dist/extraction/index.d.ts.map +1 -0
  341. package/dist/extraction/index.js +6 -0
  342. package/dist/extraction/index.js.map +1 -0
  343. package/dist/extraction/markdown-extractor.d.ts +11 -0
  344. package/dist/extraction/markdown-extractor.d.ts.map +1 -0
  345. package/dist/extraction/markdown-extractor.js +212 -0
  346. package/dist/extraction/markdown-extractor.js.map +1 -0
  347. package/dist/extraction/openapi-extractor.d.ts +10 -0
  348. package/dist/extraction/openapi-extractor.d.ts.map +1 -0
  349. package/dist/extraction/openapi-extractor.js +449 -0
  350. package/dist/extraction/openapi-extractor.js.map +1 -0
  351. package/dist/generator/frontmatter.d.ts +58 -0
  352. package/dist/generator/frontmatter.d.ts.map +1 -0
  353. package/dist/generator/frontmatter.js +100 -0
  354. package/dist/generator/frontmatter.js.map +1 -0
  355. package/dist/generator/index-generator.d.ts +27 -0
  356. package/dist/generator/index-generator.d.ts.map +1 -0
  357. package/dist/generator/index-generator.js +129 -0
  358. package/dist/generator/index-generator.js.map +1 -0
  359. package/dist/generator/mermaid-class-diagram.d.ts +14 -0
  360. package/dist/generator/mermaid-class-diagram.d.ts.map +1 -0
  361. package/dist/generator/mermaid-class-diagram.js +115 -0
  362. package/dist/generator/mermaid-class-diagram.js.map +1 -0
  363. package/dist/generator/mermaid-dependency-graph.d.ts +15 -0
  364. package/dist/generator/mermaid-dependency-graph.d.ts.map +1 -0
  365. package/dist/generator/mermaid-dependency-graph.js +84 -0
  366. package/dist/generator/mermaid-dependency-graph.js.map +1 -0
  367. package/dist/generator/spec-renderer.d.ts +24 -0
  368. package/dist/generator/spec-renderer.d.ts.map +1 -0
  369. package/dist/generator/spec-renderer.js +110 -0
  370. package/dist/generator/spec-renderer.js.map +1 -0
  371. package/dist/graph/dependency-graph.d.ts +24 -0
  372. package/dist/graph/dependency-graph.d.ts.map +1 -0
  373. package/dist/graph/dependency-graph.js +206 -0
  374. package/dist/graph/dependency-graph.js.map +1 -0
  375. package/dist/graph/directory-graph.d.ts +16 -0
  376. package/dist/graph/directory-graph.d.ts.map +1 -0
  377. package/dist/graph/directory-graph.js +281 -0
  378. package/dist/graph/directory-graph.js.map +1 -0
  379. package/dist/graph/mermaid-renderer.d.ts +22 -0
  380. package/dist/graph/mermaid-renderer.d.ts.map +1 -0
  381. package/dist/graph/mermaid-renderer.js +133 -0
  382. package/dist/graph/mermaid-renderer.js.map +1 -0
  383. package/dist/graph/topological-sort.d.ts +31 -0
  384. package/dist/graph/topological-sort.d.ts.map +1 -0
  385. package/dist/graph/topological-sort.js +167 -0
  386. package/dist/graph/topological-sort.js.map +1 -0
  387. package/dist/hooks/git-hook-installer.d.ts +37 -0
  388. package/dist/hooks/git-hook-installer.d.ts.map +1 -0
  389. package/dist/hooks/git-hook-installer.js +136 -0
  390. package/dist/hooks/git-hook-installer.js.map +1 -0
  391. package/dist/hooks/hook-installer.d.ts +39 -0
  392. package/dist/hooks/hook-installer.d.ts.map +1 -0
  393. package/dist/hooks/hook-installer.js +164 -0
  394. package/dist/hooks/hook-installer.js.map +1 -0
  395. package/dist/installer/skill-installer.d.ts +63 -0
  396. package/dist/installer/skill-installer.d.ts.map +1 -0
  397. package/dist/installer/skill-installer.js +203 -0
  398. package/dist/installer/skill-installer.js.map +1 -0
  399. package/dist/installer/skill-templates.d.ts +19 -0
  400. package/dist/installer/skill-templates.d.ts.map +1 -0
  401. package/dist/installer/skill-templates.js +42 -0
  402. package/dist/installer/skill-templates.js.map +1 -0
  403. package/dist/mcp/graph-tools.d.ts +17 -0
  404. package/dist/mcp/graph-tools.d.ts.map +1 -0
  405. package/dist/mcp/graph-tools.js +269 -0
  406. package/dist/mcp/graph-tools.js.map +1 -0
  407. package/dist/mcp/index.d.ts +10 -0
  408. package/dist/mcp/index.d.ts.map +1 -0
  409. package/dist/mcp/index.js +18 -0
  410. package/dist/mcp/index.js.map +1 -0
  411. package/dist/mcp/server.d.ts +10 -0
  412. package/dist/mcp/server.d.ts.map +1 -0
  413. package/dist/mcp/server.js +235 -0
  414. package/dist/mcp/server.js.map +1 -0
  415. package/dist/models/code-skeleton.d.ts +394 -0
  416. package/dist/models/code-skeleton.d.ts.map +1 -0
  417. package/dist/models/code-skeleton.js +119 -0
  418. package/dist/models/code-skeleton.js.map +1 -0
  419. package/dist/models/dependency-graph.d.ts +172 -0
  420. package/dist/models/dependency-graph.d.ts.map +1 -0
  421. package/dist/models/dependency-graph.js +44 -0
  422. package/dist/models/dependency-graph.js.map +1 -0
  423. package/dist/models/drift-item.d.ts +104 -0
  424. package/dist/models/drift-item.d.ts.map +1 -0
  425. package/dist/models/drift-item.js +38 -0
  426. package/dist/models/drift-item.js.map +1 -0
  427. package/dist/models/module-spec.d.ts +1905 -0
  428. package/dist/models/module-spec.d.ts.map +1 -0
  429. package/dist/models/module-spec.js +272 -0
  430. package/dist/models/module-spec.js.map +1 -0
  431. package/dist/panoramic/abstract-registry.d.ts +87 -0
  432. package/dist/panoramic/abstract-registry.d.ts.map +1 -0
  433. package/dist/panoramic/abstract-registry.js +88 -0
  434. package/dist/panoramic/abstract-registry.js.map +1 -0
  435. package/dist/panoramic/anchoring/chunker.d.ts +34 -0
  436. package/dist/panoramic/anchoring/chunker.d.ts.map +1 -0
  437. package/dist/panoramic/anchoring/chunker.js +274 -0
  438. package/dist/panoramic/anchoring/chunker.js.map +1 -0
  439. package/dist/panoramic/anchoring/edge-builder.d.ts +53 -0
  440. package/dist/panoramic/anchoring/edge-builder.d.ts.map +1 -0
  441. package/dist/panoramic/anchoring/edge-builder.js +183 -0
  442. package/dist/panoramic/anchoring/edge-builder.js.map +1 -0
  443. package/dist/panoramic/anchoring/embedding-provider.d.ts +51 -0
  444. package/dist/panoramic/anchoring/embedding-provider.d.ts.map +1 -0
  445. package/dist/panoramic/anchoring/embedding-provider.js +7 -0
  446. package/dist/panoramic/anchoring/embedding-provider.js.map +1 -0
  447. package/dist/panoramic/anchoring/index.d.ts +73 -0
  448. package/dist/panoramic/anchoring/index.d.ts.map +1 -0
  449. package/dist/panoramic/anchoring/index.js +91 -0
  450. package/dist/panoramic/anchoring/index.js.map +1 -0
  451. package/dist/panoramic/anchoring/providers/factory.d.ts +35 -0
  452. package/dist/panoramic/anchoring/providers/factory.d.ts.map +1 -0
  453. package/dist/panoramic/anchoring/providers/factory.js +33 -0
  454. package/dist/panoramic/anchoring/providers/factory.js.map +1 -0
  455. package/dist/panoramic/anchoring/providers/local-provider.d.ts +48 -0
  456. package/dist/panoramic/anchoring/providers/local-provider.d.ts.map +1 -0
  457. package/dist/panoramic/anchoring/providers/local-provider.js +145 -0
  458. package/dist/panoramic/anchoring/providers/local-provider.js.map +1 -0
  459. package/dist/panoramic/anchoring/providers/openai-provider.d.ts +45 -0
  460. package/dist/panoramic/anchoring/providers/openai-provider.d.ts.map +1 -0
  461. package/dist/panoramic/anchoring/providers/openai-provider.js +78 -0
  462. package/dist/panoramic/anchoring/providers/openai-provider.js.map +1 -0
  463. package/dist/panoramic/anchoring/similarity.d.ts +37 -0
  464. package/dist/panoramic/anchoring/similarity.d.ts.map +1 -0
  465. package/dist/panoramic/anchoring/similarity.js +75 -0
  466. package/dist/panoramic/anchoring/similarity.js.map +1 -0
  467. package/dist/panoramic/api-surface/endpoint-utils.d.ts +15 -0
  468. package/dist/panoramic/api-surface/endpoint-utils.d.ts.map +1 -0
  469. package/dist/panoramic/api-surface/endpoint-utils.js +145 -0
  470. package/dist/panoramic/api-surface/endpoint-utils.js.map +1 -0
  471. package/dist/panoramic/api-surface/express-extractor.d.ts +3 -0
  472. package/dist/panoramic/api-surface/express-extractor.d.ts.map +1 -0
  473. package/dist/panoramic/api-surface/express-extractor.js +288 -0
  474. package/dist/panoramic/api-surface/express-extractor.js.map +1 -0
  475. package/dist/panoramic/api-surface/fastapi-extractor.d.ts +6 -0
  476. package/dist/panoramic/api-surface/fastapi-extractor.d.ts.map +1 -0
  477. package/dist/panoramic/api-surface/fastapi-extractor.js +287 -0
  478. package/dist/panoramic/api-surface/fastapi-extractor.js.map +1 -0
  479. package/dist/panoramic/api-surface/framework-introspection.d.ts +3 -0
  480. package/dist/panoramic/api-surface/framework-introspection.d.ts.map +1 -0
  481. package/dist/panoramic/api-surface/framework-introspection.js +189 -0
  482. package/dist/panoramic/api-surface/framework-introspection.js.map +1 -0
  483. package/dist/panoramic/api-surface/index.d.ts +13 -0
  484. package/dist/panoramic/api-surface/index.d.ts.map +1 -0
  485. package/dist/panoramic/api-surface/index.js +238 -0
  486. package/dist/panoramic/api-surface/index.js.map +1 -0
  487. package/dist/panoramic/api-surface/openapi-extractor.d.ts +3 -0
  488. package/dist/panoramic/api-surface/openapi-extractor.d.ts.map +1 -0
  489. package/dist/panoramic/api-surface/openapi-extractor.js +247 -0
  490. package/dist/panoramic/api-surface/openapi-extractor.js.map +1 -0
  491. package/dist/panoramic/api-surface/types.d.ts +140 -0
  492. package/dist/panoramic/api-surface/types.d.ts.map +1 -0
  493. package/dist/panoramic/api-surface/types.js +7 -0
  494. package/dist/panoramic/api-surface/types.js.map +1 -0
  495. package/dist/panoramic/api-surface/utils.d.ts +29 -0
  496. package/dist/panoramic/api-surface/utils.d.ts.map +1 -0
  497. package/dist/panoramic/api-surface/utils.js +340 -0
  498. package/dist/panoramic/api-surface/utils.js.map +1 -0
  499. package/dist/panoramic/batch-project-docs.d.ts +101 -0
  500. package/dist/panoramic/batch-project-docs.d.ts.map +1 -0
  501. package/dist/panoramic/batch-project-docs.js +616 -0
  502. package/dist/panoramic/batch-project-docs.js.map +1 -0
  503. package/dist/panoramic/builders/architecture-ir-builder.d.ts +19 -0
  504. package/dist/panoramic/builders/architecture-ir-builder.d.ts.map +1 -0
  505. package/dist/panoramic/builders/architecture-ir-builder.js +561 -0
  506. package/dist/panoramic/builders/architecture-ir-builder.js.map +1 -0
  507. package/dist/panoramic/builders/architecture-ir-mermaid-adapter.d.ts +6 -0
  508. package/dist/panoramic/builders/architecture-ir-mermaid-adapter.d.ts.map +1 -0
  509. package/dist/panoramic/builders/architecture-ir-mermaid-adapter.js +98 -0
  510. package/dist/panoramic/builders/architecture-ir-mermaid-adapter.js.map +1 -0
  511. package/dist/panoramic/builders/component-view-builder.d.ts +38 -0
  512. package/dist/panoramic/builders/component-view-builder.d.ts.map +1 -0
  513. package/dist/panoramic/builders/component-view-builder.js +694 -0
  514. package/dist/panoramic/builders/component-view-builder.js.map +1 -0
  515. package/dist/panoramic/builders/doc-graph-builder.d.ts +179 -0
  516. package/dist/panoramic/builders/doc-graph-builder.d.ts.map +1 -0
  517. package/dist/panoramic/builders/doc-graph-builder.js +546 -0
  518. package/dist/panoramic/builders/doc-graph-builder.js.map +1 -0
  519. package/dist/panoramic/builders/dynamic-scenarios-builder.d.ts +38 -0
  520. package/dist/panoramic/builders/dynamic-scenarios-builder.d.ts.map +1 -0
  521. package/dist/panoramic/builders/dynamic-scenarios-builder.js +361 -0
  522. package/dist/panoramic/builders/dynamic-scenarios-builder.js.map +1 -0
  523. package/dist/panoramic/cache/cache-key-builder.d.ts +25 -0
  524. package/dist/panoramic/cache/cache-key-builder.d.ts.map +1 -0
  525. package/dist/panoramic/cache/cache-key-builder.js +119 -0
  526. package/dist/panoramic/cache/cache-key-builder.js.map +1 -0
  527. package/dist/panoramic/cache/cache-manager.d.ts +58 -0
  528. package/dist/panoramic/cache/cache-manager.d.ts.map +1 -0
  529. package/dist/panoramic/cache/cache-manager.js +170 -0
  530. package/dist/panoramic/cache/cache-manager.js.map +1 -0
  531. package/dist/panoramic/cache/content-hasher.d.ts +47 -0
  532. package/dist/panoramic/cache/content-hasher.d.ts.map +1 -0
  533. package/dist/panoramic/cache/content-hasher.js +89 -0
  534. package/dist/panoramic/cache/content-hasher.js.map +1 -0
  535. package/dist/panoramic/cache/index.d.ts +10 -0
  536. package/dist/panoramic/cache/index.d.ts.map +1 -0
  537. package/dist/panoramic/cache/index.js +13 -0
  538. package/dist/panoramic/cache/index.js.map +1 -0
  539. package/dist/panoramic/cache/manifest-manager.d.ts +83 -0
  540. package/dist/panoramic/cache/manifest-manager.d.ts.map +1 -0
  541. package/dist/panoramic/cache/manifest-manager.js +119 -0
  542. package/dist/panoramic/cache/manifest-manager.js.map +1 -0
  543. package/dist/panoramic/cache/schemas.d.ts +199 -0
  544. package/dist/panoramic/cache/schemas.d.ts.map +1 -0
  545. package/dist/panoramic/cache/schemas.js +53 -0
  546. package/dist/panoramic/cache/schemas.js.map +1 -0
  547. package/dist/panoramic/cluster-orchestrator.d.ts +278 -0
  548. package/dist/panoramic/cluster-orchestrator.d.ts.map +1 -0
  549. package/dist/panoramic/cluster-orchestrator.js +531 -0
  550. package/dist/panoramic/cluster-orchestrator.js.map +1 -0
  551. package/dist/panoramic/community/community-detector.d.ts +41 -0
  552. package/dist/panoramic/community/community-detector.d.ts.map +1 -0
  553. package/dist/panoramic/community/community-detector.js +190 -0
  554. package/dist/panoramic/community/community-detector.js.map +1 -0
  555. package/dist/panoramic/community/god-node-analyzer.d.ts +28 -0
  556. package/dist/panoramic/community/god-node-analyzer.d.ts.map +1 -0
  557. package/dist/panoramic/community/god-node-analyzer.js +91 -0
  558. package/dist/panoramic/community/god-node-analyzer.js.map +1 -0
  559. package/dist/panoramic/community/graph-report-generator.d.ts +31 -0
  560. package/dist/panoramic/community/graph-report-generator.d.ts.map +1 -0
  561. package/dist/panoramic/community/graph-report-generator.js +98 -0
  562. package/dist/panoramic/community/graph-report-generator.js.map +1 -0
  563. package/dist/panoramic/community/index.d.ts +31 -0
  564. package/dist/panoramic/community/index.d.ts.map +1 -0
  565. package/dist/panoramic/community/index.js +63 -0
  566. package/dist/panoramic/community/index.js.map +1 -0
  567. package/dist/panoramic/community/surprising-edges.d.ts +42 -0
  568. package/dist/panoramic/community/surprising-edges.d.ts.map +1 -0
  569. package/dist/panoramic/community/surprising-edges.js +154 -0
  570. package/dist/panoramic/community/surprising-edges.js.map +1 -0
  571. package/dist/panoramic/cross-reference-index.d.ts +4 -0
  572. package/dist/panoramic/cross-reference-index.d.ts.map +1 -0
  573. package/dist/panoramic/cross-reference-index.js +201 -0
  574. package/dist/panoramic/cross-reference-index.js.map +1 -0
  575. package/dist/panoramic/exporters/architecture-ir-exporters.d.ts +7 -0
  576. package/dist/panoramic/exporters/architecture-ir-exporters.d.ts.map +1 -0
  577. package/dist/panoramic/exporters/architecture-ir-exporters.js +183 -0
  578. package/dist/panoramic/exporters/architecture-ir-exporters.js.map +1 -0
  579. package/dist/panoramic/exporters/export-types.d.ts +33 -0
  580. package/dist/panoramic/exporters/export-types.d.ts.map +1 -0
  581. package/dist/panoramic/exporters/export-types.js +7 -0
  582. package/dist/panoramic/exporters/export-types.js.map +1 -0
  583. package/dist/panoramic/exporters/html-exporter.d.ts +83 -0
  584. package/dist/panoramic/exporters/html-exporter.d.ts.map +1 -0
  585. package/dist/panoramic/exporters/html-exporter.js +224 -0
  586. package/dist/panoramic/exporters/html-exporter.js.map +1 -0
  587. package/dist/panoramic/exporters/html-template.d.ts +32 -0
  588. package/dist/panoramic/exporters/html-template.d.ts.map +1 -0
  589. package/dist/panoramic/exporters/html-template.js +737 -0
  590. package/dist/panoramic/exporters/html-template.js.map +1 -0
  591. package/dist/panoramic/exporters/obsidian-exporter.d.ts +67 -0
  592. package/dist/panoramic/exporters/obsidian-exporter.d.ts.map +1 -0
  593. package/dist/panoramic/exporters/obsidian-exporter.js +333 -0
  594. package/dist/panoramic/exporters/obsidian-exporter.js.map +1 -0
  595. package/dist/panoramic/generator-registry.d.ts +86 -0
  596. package/dist/panoramic/generator-registry.d.ts.map +1 -0
  597. package/dist/panoramic/generator-registry.js +194 -0
  598. package/dist/panoramic/generator-registry.js.map +1 -0
  599. package/dist/panoramic/generators/architecture-ir-generator.d.ts +36 -0
  600. package/dist/panoramic/generators/architecture-ir-generator.d.ts.map +1 -0
  601. package/dist/panoramic/generators/architecture-ir-generator.js +51 -0
  602. package/dist/panoramic/generators/architecture-ir-generator.js.map +1 -0
  603. package/dist/panoramic/generators/architecture-overview-generator.d.ts +31 -0
  604. package/dist/panoramic/generators/architecture-overview-generator.d.ts.map +1 -0
  605. package/dist/panoramic/generators/architecture-overview-generator.js +454 -0
  606. package/dist/panoramic/generators/architecture-overview-generator.js.map +1 -0
  607. package/dist/panoramic/generators/config-reference-generator.d.ts +78 -0
  608. package/dist/panoramic/generators/config-reference-generator.d.ts.map +1 -0
  609. package/dist/panoramic/generators/config-reference-generator.js +201 -0
  610. package/dist/panoramic/generators/config-reference-generator.js.map +1 -0
  611. package/dist/panoramic/generators/cross-package-analyzer.d.ts +112 -0
  612. package/dist/panoramic/generators/cross-package-analyzer.d.ts.map +1 -0
  613. package/dist/panoramic/generators/cross-package-analyzer.js +258 -0
  614. package/dist/panoramic/generators/cross-package-analyzer.js.map +1 -0
  615. package/dist/panoramic/generators/data-model-generator.d.ts +528 -0
  616. package/dist/panoramic/generators/data-model-generator.d.ts.map +1 -0
  617. package/dist/panoramic/generators/data-model-generator.js +674 -0
  618. package/dist/panoramic/generators/data-model-generator.js.map +1 -0
  619. package/dist/panoramic/generators/event-surface-generator.d.ts +52 -0
  620. package/dist/panoramic/generators/event-surface-generator.d.ts.map +1 -0
  621. package/dist/panoramic/generators/event-surface-generator.js +634 -0
  622. package/dist/panoramic/generators/event-surface-generator.js.map +1 -0
  623. package/dist/panoramic/generators/interface-surface-generator.d.ts +50 -0
  624. package/dist/panoramic/generators/interface-surface-generator.d.ts.map +1 -0
  625. package/dist/panoramic/generators/interface-surface-generator.js +393 -0
  626. package/dist/panoramic/generators/interface-surface-generator.js.map +1 -0
  627. package/dist/panoramic/generators/mock-readme-generator.d.ts +90 -0
  628. package/dist/panoramic/generators/mock-readme-generator.d.ts.map +1 -0
  629. package/dist/panoramic/generators/mock-readme-generator.js +113 -0
  630. package/dist/panoramic/generators/mock-readme-generator.js.map +1 -0
  631. package/dist/panoramic/generators/pattern-hints-generator.d.ts +28 -0
  632. package/dist/panoramic/generators/pattern-hints-generator.d.ts.map +1 -0
  633. package/dist/panoramic/generators/pattern-hints-generator.js +170 -0
  634. package/dist/panoramic/generators/pattern-hints-generator.js.map +1 -0
  635. package/dist/panoramic/generators/runtime-topology-generator.d.ts +77 -0
  636. package/dist/panoramic/generators/runtime-topology-generator.d.ts.map +1 -0
  637. package/dist/panoramic/generators/runtime-topology-generator.js +679 -0
  638. package/dist/panoramic/generators/runtime-topology-generator.js.map +1 -0
  639. package/dist/panoramic/generators/troubleshooting-generator.d.ts +51 -0
  640. package/dist/panoramic/generators/troubleshooting-generator.d.ts.map +1 -0
  641. package/dist/panoramic/generators/troubleshooting-generator.js +464 -0
  642. package/dist/panoramic/generators/troubleshooting-generator.js.map +1 -0
  643. package/dist/panoramic/generators/workspace-index-generator.d.ts +148 -0
  644. package/dist/panoramic/generators/workspace-index-generator.d.ts.map +1 -0
  645. package/dist/panoramic/generators/workspace-index-generator.js +500 -0
  646. package/dist/panoramic/generators/workspace-index-generator.js.map +1 -0
  647. package/dist/panoramic/graph/confidence-mapper.d.ts +39 -0
  648. package/dist/panoramic/graph/confidence-mapper.d.ts.map +1 -0
  649. package/dist/panoramic/graph/confidence-mapper.js +55 -0
  650. package/dist/panoramic/graph/confidence-mapper.js.map +1 -0
  651. package/dist/panoramic/graph/graph-builder.d.ts +33 -0
  652. package/dist/panoramic/graph/graph-builder.d.ts.map +1 -0
  653. package/dist/panoramic/graph/graph-builder.js +382 -0
  654. package/dist/panoramic/graph/graph-builder.js.map +1 -0
  655. package/dist/panoramic/graph/graph-paths.d.ts +13 -0
  656. package/dist/panoramic/graph/graph-paths.d.ts.map +1 -0
  657. package/dist/panoramic/graph/graph-paths.js +16 -0
  658. package/dist/panoramic/graph/graph-paths.js.map +1 -0
  659. package/dist/panoramic/graph/graph-query.d.ts +226 -0
  660. package/dist/panoramic/graph/graph-query.d.ts.map +1 -0
  661. package/dist/panoramic/graph/graph-query.js +571 -0
  662. package/dist/panoramic/graph/graph-query.js.map +1 -0
  663. package/dist/panoramic/graph/graph-types.d.ts +156 -0
  664. package/dist/panoramic/graph/graph-types.d.ts.map +1 -0
  665. package/dist/panoramic/graph/graph-types.js +10 -0
  666. package/dist/panoramic/graph/graph-types.js.map +1 -0
  667. package/dist/panoramic/graph/index.d.ts +6 -0
  668. package/dist/panoramic/graph/index.d.ts.map +1 -0
  669. package/dist/panoramic/graph/index.js +8 -0
  670. package/dist/panoramic/graph/index.js.map +1 -0
  671. package/dist/panoramic/hyperedges/constants.d.ts +16 -0
  672. package/dist/panoramic/hyperedges/constants.d.ts.map +1 -0
  673. package/dist/panoramic/hyperedges/constants.js +13 -0
  674. package/dist/panoramic/hyperedges/constants.js.map +1 -0
  675. package/dist/panoramic/hyperedges/extractor.d.ts +80 -0
  676. package/dist/panoramic/hyperedges/extractor.d.ts.map +1 -0
  677. package/dist/panoramic/hyperedges/extractor.js +133 -0
  678. package/dist/panoramic/hyperedges/extractor.js.map +1 -0
  679. package/dist/panoramic/hyperedges/index.d.ts +12 -0
  680. package/dist/panoramic/hyperedges/index.d.ts.map +1 -0
  681. package/dist/panoramic/hyperedges/index.js +19 -0
  682. package/dist/panoramic/hyperedges/index.js.map +1 -0
  683. package/dist/panoramic/hyperedges/prompt.d.ts +30 -0
  684. package/dist/panoramic/hyperedges/prompt.d.ts.map +1 -0
  685. package/dist/panoramic/hyperedges/prompt.js +88 -0
  686. package/dist/panoramic/hyperedges/prompt.js.map +1 -0
  687. package/dist/panoramic/hyperedges/schema.d.ts +91 -0
  688. package/dist/panoramic/hyperedges/schema.d.ts.map +1 -0
  689. package/dist/panoramic/hyperedges/schema.js +52 -0
  690. package/dist/panoramic/hyperedges/schema.js.map +1 -0
  691. package/dist/panoramic/index.d.ts +17 -0
  692. package/dist/panoramic/index.d.ts.map +1 -0
  693. package/dist/panoramic/index.js +22 -0
  694. package/dist/panoramic/index.js.map +1 -0
  695. package/dist/panoramic/interfaces.d.ts +243 -0
  696. package/dist/panoramic/interfaces.d.ts.map +1 -0
  697. package/dist/panoramic/interfaces.js +130 -0
  698. package/dist/panoramic/interfaces.js.map +1 -0
  699. package/dist/panoramic/internal.d.ts +67 -0
  700. package/dist/panoramic/internal.d.ts.map +1 -0
  701. package/dist/panoramic/internal.js +93 -0
  702. package/dist/panoramic/internal.js.map +1 -0
  703. package/dist/panoramic/models/architecture-ir-model.d.ts +92 -0
  704. package/dist/panoramic/models/architecture-ir-model.d.ts.map +1 -0
  705. package/dist/panoramic/models/architecture-ir-model.js +14 -0
  706. package/dist/panoramic/models/architecture-ir-model.js.map +1 -0
  707. package/dist/panoramic/models/architecture-overview-model.d.ts +77 -0
  708. package/dist/panoramic/models/architecture-overview-model.d.ts.map +1 -0
  709. package/dist/panoramic/models/architecture-overview-model.js +31 -0
  710. package/dist/panoramic/models/architecture-overview-model.js.map +1 -0
  711. package/dist/panoramic/models/component-view-model.d.ts +127 -0
  712. package/dist/panoramic/models/component-view-model.d.ts.map +1 -0
  713. package/dist/panoramic/models/component-view-model.js +65 -0
  714. package/dist/panoramic/models/component-view-model.js.map +1 -0
  715. package/dist/panoramic/models/docs-bundle-profiles.d.ts +4 -0
  716. package/dist/panoramic/models/docs-bundle-profiles.d.ts.map +1 -0
  717. package/dist/panoramic/models/docs-bundle-profiles.js +82 -0
  718. package/dist/panoramic/models/docs-bundle-profiles.js.map +1 -0
  719. package/dist/panoramic/models/docs-bundle-types.d.ts +94 -0
  720. package/dist/panoramic/models/docs-bundle-types.d.ts.map +1 -0
  721. package/dist/panoramic/models/docs-bundle-types.js +10 -0
  722. package/dist/panoramic/models/docs-bundle-types.js.map +1 -0
  723. package/dist/panoramic/models/docs-quality-model.d.ts +125 -0
  724. package/dist/panoramic/models/docs-quality-model.d.ts.map +1 -0
  725. package/dist/panoramic/models/docs-quality-model.js +166 -0
  726. package/dist/panoramic/models/docs-quality-model.js.map +1 -0
  727. package/dist/panoramic/models/pattern-hints-model.d.ts +89 -0
  728. package/dist/panoramic/models/pattern-hints-model.d.ts.map +1 -0
  729. package/dist/panoramic/models/pattern-hints-model.js +61 -0
  730. package/dist/panoramic/models/pattern-hints-model.js.map +1 -0
  731. package/dist/panoramic/models/pattern-knowledge-base.d.ts +31 -0
  732. package/dist/panoramic/models/pattern-knowledge-base.d.ts.map +1 -0
  733. package/dist/panoramic/models/pattern-knowledge-base.js +407 -0
  734. package/dist/panoramic/models/pattern-knowledge-base.js.map +1 -0
  735. package/dist/panoramic/models/runtime-topology-model.d.ts +145 -0
  736. package/dist/panoramic/models/runtime-topology-model.d.ts.map +1 -0
  737. package/dist/panoramic/models/runtime-topology-model.js +300 -0
  738. package/dist/panoramic/models/runtime-topology-model.js.map +1 -0
  739. package/dist/panoramic/output-filenames.d.ts +26 -0
  740. package/dist/panoramic/output-filenames.d.ts.map +1 -0
  741. package/dist/panoramic/output-filenames.js +48 -0
  742. package/dist/panoramic/output-filenames.js.map +1 -0
  743. package/dist/panoramic/parser-registry.d.ts +89 -0
  744. package/dist/panoramic/parser-registry.d.ts.map +1 -0
  745. package/dist/panoramic/parser-registry.js +169 -0
  746. package/dist/panoramic/parser-registry.js.map +1 -0
  747. package/dist/panoramic/parsers/abstract-artifact-parser.d.ts +48 -0
  748. package/dist/panoramic/parsers/abstract-artifact-parser.d.ts.map +1 -0
  749. package/dist/panoramic/parsers/abstract-artifact-parser.js +52 -0
  750. package/dist/panoramic/parsers/abstract-artifact-parser.js.map +1 -0
  751. package/dist/panoramic/parsers/abstract-config-parser.d.ts +35 -0
  752. package/dist/panoramic/parsers/abstract-config-parser.d.ts.map +1 -0
  753. package/dist/panoramic/parsers/abstract-config-parser.js +34 -0
  754. package/dist/panoramic/parsers/abstract-config-parser.js.map +1 -0
  755. package/dist/panoramic/parsers/behavior-yaml-parser.d.ts +34 -0
  756. package/dist/panoramic/parsers/behavior-yaml-parser.d.ts.map +1 -0
  757. package/dist/panoramic/parsers/behavior-yaml-parser.js +195 -0
  758. package/dist/panoramic/parsers/behavior-yaml-parser.js.map +1 -0
  759. package/dist/panoramic/parsers/comment-tracker.d.ts +37 -0
  760. package/dist/panoramic/parsers/comment-tracker.d.ts.map +1 -0
  761. package/dist/panoramic/parsers/comment-tracker.js +50 -0
  762. package/dist/panoramic/parsers/comment-tracker.js.map +1 -0
  763. package/dist/panoramic/parsers/dockerfile-parser.d.ts +42 -0
  764. package/dist/panoramic/parsers/dockerfile-parser.d.ts.map +1 -0
  765. package/dist/panoramic/parsers/dockerfile-parser.js +128 -0
  766. package/dist/panoramic/parsers/dockerfile-parser.js.map +1 -0
  767. package/dist/panoramic/parsers/env-config-parser.d.ts +37 -0
  768. package/dist/panoramic/parsers/env-config-parser.d.ts.map +1 -0
  769. package/dist/panoramic/parsers/env-config-parser.js +73 -0
  770. package/dist/panoramic/parsers/env-config-parser.js.map +1 -0
  771. package/dist/panoramic/parsers/index.d.ts +25 -0
  772. package/dist/panoramic/parsers/index.d.ts.map +1 -0
  773. package/dist/panoramic/parsers/index.js +25 -0
  774. package/dist/panoramic/parsers/index.js.map +1 -0
  775. package/dist/panoramic/parsers/skill-md-parser.d.ts +42 -0
  776. package/dist/panoramic/parsers/skill-md-parser.d.ts.map +1 -0
  777. package/dist/panoramic/parsers/skill-md-parser.js +105 -0
  778. package/dist/panoramic/parsers/skill-md-parser.js.map +1 -0
  779. package/dist/panoramic/parsers/toml-config-parser.d.ts +39 -0
  780. package/dist/panoramic/parsers/toml-config-parser.d.ts.map +1 -0
  781. package/dist/panoramic/parsers/toml-config-parser.js +98 -0
  782. package/dist/panoramic/parsers/toml-config-parser.js.map +1 -0
  783. package/dist/panoramic/parsers/types.d.ts +314 -0
  784. package/dist/panoramic/parsers/types.d.ts.map +1 -0
  785. package/dist/panoramic/parsers/types.js +136 -0
  786. package/dist/panoramic/parsers/types.js.map +1 -0
  787. package/dist/panoramic/parsers/yaml-config-parser.d.ts +58 -0
  788. package/dist/panoramic/parsers/yaml-config-parser.d.ts.map +1 -0
  789. package/dist/panoramic/parsers/yaml-config-parser.js +356 -0
  790. package/dist/panoramic/parsers/yaml-config-parser.js.map +1 -0
  791. package/dist/panoramic/pipelines/adr-decision-pipeline.d.ts +74 -0
  792. package/dist/panoramic/pipelines/adr-decision-pipeline.d.ts.map +1 -0
  793. package/dist/panoramic/pipelines/adr-decision-pipeline.js +421 -0
  794. package/dist/panoramic/pipelines/adr-decision-pipeline.js.map +1 -0
  795. package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts +30 -0
  796. package/dist/panoramic/pipelines/adr-evidence-verifier.d.ts.map +1 -0
  797. package/dist/panoramic/pipelines/adr-evidence-verifier.js +141 -0
  798. package/dist/panoramic/pipelines/adr-evidence-verifier.js.map +1 -0
  799. package/dist/panoramic/pipelines/adr-mapreduce.d.ts +316 -0
  800. package/dist/panoramic/pipelines/adr-mapreduce.d.ts.map +1 -0
  801. package/dist/panoramic/pipelines/adr-mapreduce.js +331 -0
  802. package/dist/panoramic/pipelines/adr-mapreduce.js.map +1 -0
  803. package/dist/panoramic/pipelines/adr-migration.d.ts +26 -0
  804. package/dist/panoramic/pipelines/adr-migration.d.ts.map +1 -0
  805. package/dist/panoramic/pipelines/adr-migration.js +203 -0
  806. package/dist/panoramic/pipelines/adr-migration.js.map +1 -0
  807. package/dist/panoramic/pipelines/architecture-narrative-mapreduce.d.ts +121 -0
  808. package/dist/panoramic/pipelines/architecture-narrative-mapreduce.d.ts.map +1 -0
  809. package/dist/panoramic/pipelines/architecture-narrative-mapreduce.js +412 -0
  810. package/dist/panoramic/pipelines/architecture-narrative-mapreduce.js.map +1 -0
  811. package/dist/panoramic/pipelines/architecture-narrative.d.ts +123 -0
  812. package/dist/panoramic/pipelines/architecture-narrative.d.ts.map +1 -0
  813. package/dist/panoramic/pipelines/architecture-narrative.js +419 -0
  814. package/dist/panoramic/pipelines/architecture-narrative.js.map +1 -0
  815. package/dist/panoramic/pipelines/coverage-auditor.d.ts +95 -0
  816. package/dist/panoramic/pipelines/coverage-auditor.d.ts.map +1 -0
  817. package/dist/panoramic/pipelines/coverage-auditor.js +290 -0
  818. package/dist/panoramic/pipelines/coverage-auditor.js.map +1 -0
  819. package/dist/panoramic/pipelines/debt-intelligence-pipeline.d.ts +32 -0
  820. package/dist/panoramic/pipelines/debt-intelligence-pipeline.d.ts.map +1 -0
  821. package/dist/panoramic/pipelines/debt-intelligence-pipeline.js +108 -0
  822. package/dist/panoramic/pipelines/debt-intelligence-pipeline.js.map +1 -0
  823. package/dist/panoramic/pipelines/docs-bundle-manifest-reader.d.ts +26 -0
  824. package/dist/panoramic/pipelines/docs-bundle-manifest-reader.d.ts.map +1 -0
  825. package/dist/panoramic/pipelines/docs-bundle-manifest-reader.js +108 -0
  826. package/dist/panoramic/pipelines/docs-bundle-manifest-reader.js.map +1 -0
  827. package/dist/panoramic/pipelines/docs-bundle-orchestrator.d.ts +16 -0
  828. package/dist/panoramic/pipelines/docs-bundle-orchestrator.d.ts.map +1 -0
  829. package/dist/panoramic/pipelines/docs-bundle-orchestrator.js +588 -0
  830. package/dist/panoramic/pipelines/docs-bundle-orchestrator.js.map +1 -0
  831. package/dist/panoramic/pipelines/docs-quality-evaluator.d.ts +55 -0
  832. package/dist/panoramic/pipelines/docs-quality-evaluator.d.ts.map +1 -0
  833. package/dist/panoramic/pipelines/docs-quality-evaluator.js +1045 -0
  834. package/dist/panoramic/pipelines/docs-quality-evaluator.js.map +1 -0
  835. package/dist/panoramic/pipelines/narrative-provenance-adapter.d.ts +8 -0
  836. package/dist/panoramic/pipelines/narrative-provenance-adapter.d.ts.map +1 -0
  837. package/dist/panoramic/pipelines/narrative-provenance-adapter.js +99 -0
  838. package/dist/panoramic/pipelines/narrative-provenance-adapter.js.map +1 -0
  839. package/dist/panoramic/pipelines/product-ux-docs.d.ts +123 -0
  840. package/dist/panoramic/pipelines/product-ux-docs.d.ts.map +1 -0
  841. package/dist/panoramic/pipelines/product-ux-docs.js +959 -0
  842. package/dist/panoramic/pipelines/product-ux-docs.js.map +1 -0
  843. package/dist/panoramic/project-context.d.ts +17 -0
  844. package/dist/panoramic/project-context.d.ts.map +1 -0
  845. package/dist/panoramic/project-context.js +289 -0
  846. package/dist/panoramic/project-context.js.map +1 -0
  847. package/dist/panoramic/qa/citation.d.ts +21 -0
  848. package/dist/panoramic/qa/citation.d.ts.map +1 -0
  849. package/dist/panoramic/qa/citation.js +184 -0
  850. package/dist/panoramic/qa/citation.js.map +1 -0
  851. package/dist/panoramic/qa/debt-context.d.ts +33 -0
  852. package/dist/panoramic/qa/debt-context.d.ts.map +1 -0
  853. package/dist/panoramic/qa/debt-context.js +82 -0
  854. package/dist/panoramic/qa/debt-context.js.map +1 -0
  855. package/dist/panoramic/qa/graph-retriever.d.ts +29 -0
  856. package/dist/panoramic/qa/graph-retriever.d.ts.map +1 -0
  857. package/dist/panoramic/qa/graph-retriever.js +65 -0
  858. package/dist/panoramic/qa/graph-retriever.js.map +1 -0
  859. package/dist/panoramic/qa/index.d.ts +23 -0
  860. package/dist/panoramic/qa/index.d.ts.map +1 -0
  861. package/dist/panoramic/qa/index.js +201 -0
  862. package/dist/panoramic/qa/index.js.map +1 -0
  863. package/dist/panoramic/qa/llm-caller.d.ts +35 -0
  864. package/dist/panoramic/qa/llm-caller.d.ts.map +1 -0
  865. package/dist/panoramic/qa/llm-caller.js +138 -0
  866. package/dist/panoramic/qa/llm-caller.js.map +1 -0
  867. package/dist/panoramic/qa/prompt-builder.d.ts +36 -0
  868. package/dist/panoramic/qa/prompt-builder.d.ts.map +1 -0
  869. package/dist/panoramic/qa/prompt-builder.js +143 -0
  870. package/dist/panoramic/qa/prompt-builder.js.map +1 -0
  871. package/dist/panoramic/qa/rag-reranker.d.ts +43 -0
  872. package/dist/panoramic/qa/rag-reranker.d.ts.map +1 -0
  873. package/dist/panoramic/qa/rag-reranker.js +129 -0
  874. package/dist/panoramic/qa/rag-reranker.js.map +1 -0
  875. package/dist/panoramic/qa/types.d.ts +126 -0
  876. package/dist/panoramic/qa/types.d.ts.map +1 -0
  877. package/dist/panoramic/qa/types.js +6 -0
  878. package/dist/panoramic/qa/types.js.map +1 -0
  879. package/dist/panoramic/query.d.ts +29 -0
  880. package/dist/panoramic/query.d.ts.map +1 -0
  881. package/dist/panoramic/query.js +80 -0
  882. package/dist/panoramic/query.js.map +1 -0
  883. package/dist/panoramic/stored-module-specs.d.ts +26 -0
  884. package/dist/panoramic/stored-module-specs.d.ts.map +1 -0
  885. package/dist/panoramic/stored-module-specs.js +155 -0
  886. package/dist/panoramic/stored-module-specs.js.map +1 -0
  887. package/dist/panoramic/utils/html-sanitizer.d.ts +33 -0
  888. package/dist/panoramic/utils/html-sanitizer.d.ts.map +1 -0
  889. package/dist/panoramic/utils/html-sanitizer.js +170 -0
  890. package/dist/panoramic/utils/html-sanitizer.js.map +1 -0
  891. package/dist/panoramic/utils/llm-enricher.d.ts +74 -0
  892. package/dist/panoramic/utils/llm-enricher.d.ts.map +1 -0
  893. package/dist/panoramic/utils/llm-enricher.js +315 -0
  894. package/dist/panoramic/utils/llm-enricher.js.map +1 -0
  895. package/dist/panoramic/utils/llm-facade.d.ts +66 -0
  896. package/dist/panoramic/utils/llm-facade.d.ts.map +1 -0
  897. package/dist/panoramic/utils/llm-facade.js +136 -0
  898. package/dist/panoramic/utils/llm-facade.js.map +1 -0
  899. package/dist/panoramic/utils/logger.d.ts +43 -0
  900. package/dist/panoramic/utils/logger.d.ts.map +1 -0
  901. package/dist/panoramic/utils/logger.js +76 -0
  902. package/dist/panoramic/utils/logger.js.map +1 -0
  903. package/dist/panoramic/utils/mermaid-helpers.d.ts +19 -0
  904. package/dist/panoramic/utils/mermaid-helpers.d.ts.map +1 -0
  905. package/dist/panoramic/utils/mermaid-helpers.js +21 -0
  906. package/dist/panoramic/utils/mermaid-helpers.js.map +1 -0
  907. package/dist/panoramic/utils/multi-format-writer.d.ts +43 -0
  908. package/dist/panoramic/utils/multi-format-writer.d.ts.map +1 -0
  909. package/dist/panoramic/utils/multi-format-writer.js +73 -0
  910. package/dist/panoramic/utils/multi-format-writer.js.map +1 -0
  911. package/dist/panoramic/utils/template-loader.d.ts +15 -0
  912. package/dist/panoramic/utils/template-loader.d.ts.map +1 -0
  913. package/dist/panoramic/utils/template-loader.js +65 -0
  914. package/dist/panoramic/utils/template-loader.js.map +1 -0
  915. package/dist/panoramic/utils/text-segmenter.d.ts +50 -0
  916. package/dist/panoramic/utils/text-segmenter.d.ts.map +1 -0
  917. package/dist/panoramic/utils/text-segmenter.js +151 -0
  918. package/dist/panoramic/utils/text-segmenter.js.map +1 -0
  919. package/dist/scripts/postinstall.d.ts +7 -0
  920. package/dist/scripts/postinstall.d.ts.map +1 -0
  921. package/dist/scripts/postinstall.js +70 -0
  922. package/dist/scripts/postinstall.js.map +1 -0
  923. package/dist/scripts/preuninstall.d.ts +7 -0
  924. package/dist/scripts/preuninstall.d.ts.map +1 -0
  925. package/dist/scripts/preuninstall.js +62 -0
  926. package/dist/scripts/preuninstall.js.map +1 -0
  927. package/dist/spec-store/index.d.ts +9 -0
  928. package/dist/spec-store/index.d.ts.map +1 -0
  929. package/dist/spec-store/index.js +9 -0
  930. package/dist/spec-store/index.js.map +1 -0
  931. package/dist/spec-store/spec-identity.d.ts +28 -0
  932. package/dist/spec-store/spec-identity.d.ts.map +1 -0
  933. package/dist/spec-store/spec-identity.js +24 -0
  934. package/dist/spec-store/spec-identity.js.map +1 -0
  935. package/dist/spec-store/spec-store.d.ts +62 -0
  936. package/dist/spec-store/spec-store.d.ts.map +1 -0
  937. package/dist/spec-store/spec-store.js +201 -0
  938. package/dist/spec-store/spec-store.js.map +1 -0
  939. package/dist/utils/atomic-write.d.ts +10 -0
  940. package/dist/utils/atomic-write.d.ts.map +1 -0
  941. package/dist/utils/atomic-write.js +27 -0
  942. package/dist/utils/atomic-write.js.map +1 -0
  943. package/dist/utils/chunk-splitter.d.ts +32 -0
  944. package/dist/utils/chunk-splitter.d.ts.map +1 -0
  945. package/dist/utils/chunk-splitter.js +116 -0
  946. package/dist/utils/chunk-splitter.js.map +1 -0
  947. package/dist/utils/file-scanner.d.ts +38 -0
  948. package/dist/utils/file-scanner.d.ts.map +1 -0
  949. package/dist/utils/file-scanner.js +323 -0
  950. package/dist/utils/file-scanner.js.map +1 -0
  951. package/dist/utils/git-blame.d.ts +32 -0
  952. package/dist/utils/git-blame.d.ts.map +1 -0
  953. package/dist/utils/git-blame.js +151 -0
  954. package/dist/utils/git-blame.js.map +1 -0
  955. package/dist/utils/specify-template-sync.d.ts +16 -0
  956. package/dist/utils/specify-template-sync.d.ts.map +1 -0
  957. package/dist/utils/specify-template-sync.js +66 -0
  958. package/dist/utils/specify-template-sync.js.map +1 -0
  959. package/dist/watcher/file-watcher.d.ts +77 -0
  960. package/dist/watcher/file-watcher.d.ts.map +1 -0
  961. package/dist/watcher/file-watcher.js +233 -0
  962. package/dist/watcher/file-watcher.js.map +1 -0
  963. package/dist/watcher/index.d.ts +6 -0
  964. package/dist/watcher/index.d.ts.map +1 -0
  965. package/dist/watcher/index.js +5 -0
  966. package/dist/watcher/index.js.map +1 -0
  967. package/grammars/manifest.json +28 -0
  968. package/grammars/tree-sitter-go.wasm +0 -0
  969. package/grammars/tree-sitter-java.wasm +0 -0
  970. package/grammars/tree-sitter-javascript.wasm +0 -0
  971. package/grammars/tree-sitter-python.wasm +0 -0
  972. package/grammars/tree-sitter-typescript.wasm +0 -0
  973. package/package.json +84 -0
  974. package/plugins/spec-driver/.claude-plugin/plugin.json +16 -0
  975. package/plugins/spec-driver/README.md +401 -0
  976. package/plugins/spec-driver/agents/analyze.artifact.yaml +10 -0
  977. package/plugins/spec-driver/agents/analyze.md +144 -0
  978. package/plugins/spec-driver/agents/checklist.artifact.yaml +8 -0
  979. package/plugins/spec-driver/agents/checklist.md +84 -0
  980. package/plugins/spec-driver/agents/clarify.artifact.yaml +6 -0
  981. package/plugins/spec-driver/agents/clarify.md +104 -0
  982. package/plugins/spec-driver/agents/constitution.artifact.yaml +9 -0
  983. package/plugins/spec-driver/agents/constitution.md +100 -0
  984. package/plugins/spec-driver/agents/implement.artifact.yaml +8 -0
  985. package/plugins/spec-driver/agents/implement.md +159 -0
  986. package/plugins/spec-driver/agents/plan.artifact.yaml +12 -0
  987. package/plugins/spec-driver/agents/plan.md +116 -0
  988. package/plugins/spec-driver/agents/product-research.artifact.yaml +11 -0
  989. package/plugins/spec-driver/agents/product-research.md +94 -0
  990. package/plugins/spec-driver/agents/quality-review.artifact.yaml +11 -0
  991. package/plugins/spec-driver/agents/quality-review.md +165 -0
  992. package/plugins/spec-driver/agents/refactor-plan.md +132 -0
  993. package/plugins/spec-driver/agents/spec-review.artifact.yaml +12 -0
  994. package/plugins/spec-driver/agents/spec-review.md +111 -0
  995. package/plugins/spec-driver/agents/specify.artifact.yaml +9 -0
  996. package/plugins/spec-driver/agents/specify.md +109 -0
  997. package/plugins/spec-driver/agents/sync.artifact.yaml +19 -0
  998. package/plugins/spec-driver/agents/sync.md +91 -0
  999. package/plugins/spec-driver/agents/tasks.artifact.yaml +10 -0
  1000. package/plugins/spec-driver/agents/tasks.md +88 -0
  1001. package/plugins/spec-driver/agents/tech-research.artifact.yaml +12 -0
  1002. package/plugins/spec-driver/agents/tech-research.md +102 -0
  1003. package/plugins/spec-driver/agents/verify.artifact.yaml +11 -0
  1004. package/plugins/spec-driver/agents/verify.md +204 -0
  1005. package/plugins/spec-driver/config/orchestration.yaml +779 -0
  1006. package/plugins/spec-driver/contracts/orchestration-overrides-contract.yaml +124 -0
  1007. package/plugins/spec-driver/contracts/orchestration-schema.mjs +301 -0
  1008. package/plugins/spec-driver/contracts/scan-project-output.md +70 -0
  1009. package/plugins/spec-driver/contracts/wrapper-source-of-truth.yaml +44 -0
  1010. package/plugins/spec-driver/hooks/hooks.json +70 -0
  1011. package/plugins/spec-driver/hooks/post-tool-use-format.sh +28 -0
  1012. package/plugins/spec-driver/hooks/pre-tool-use-guard.sh +42 -0
  1013. package/plugins/spec-driver/hooks/stop-task-check.sh +22 -0
  1014. package/plugins/spec-driver/hooks/worktree-lifecycle.sh +33 -0
  1015. package/plugins/spec-driver/lib/orchestration-output-serializer.mjs +219 -0
  1016. package/plugins/spec-driver/lib/orchestration-resolver.mjs +485 -0
  1017. package/plugins/spec-driver/lib/orchestrator-fallback.mjs +98 -0
  1018. package/plugins/spec-driver/lib/orchestrator.mjs +280 -0
  1019. package/plugins/spec-driver/scorecards/default-governance.yaml +63 -0
  1020. package/plugins/spec-driver/scripts/codex-skills.sh +225 -0
  1021. package/plugins/spec-driver/scripts/experimental/README.md +9 -0
  1022. package/plugins/spec-driver/scripts/generate-adoption-insights.mjs +523 -0
  1023. package/plugins/spec-driver/scripts/generate-product-entity-catalog.mjs +472 -0
  1024. package/plugins/spec-driver/scripts/generate-product-quality-reports.mjs +18 -0
  1025. package/plugins/spec-driver/scripts/generate-product-scorecards.mjs +25 -0
  1026. package/plugins/spec-driver/scripts/generate-project-context-suggestions.mjs +622 -0
  1027. package/plugins/spec-driver/scripts/generate-workflow-registry.mjs +16 -0
  1028. package/plugins/spec-driver/scripts/init-project.sh +328 -0
  1029. package/plugins/spec-driver/scripts/lib/config-schema.mjs +433 -0
  1030. package/plugins/spec-driver/scripts/lib/init-project-output.sh +146 -0
  1031. package/plugins/spec-driver/scripts/lib/product-artifact-patchers.mjs +29 -0
  1032. package/plugins/spec-driver/scripts/lib/product-artifact-paths.mjs +129 -0
  1033. package/plugins/spec-driver/scripts/lib/product-governance-helpers.mjs +48 -0
  1034. package/plugins/spec-driver/scripts/lib/product-quality-core.mjs +531 -0
  1035. package/plugins/spec-driver/scripts/lib/product-scorecard-core.mjs +810 -0
  1036. package/plugins/spec-driver/scripts/lib/project-context-paths.mjs +21 -0
  1037. package/plugins/spec-driver/scripts/lib/project-profile-resolver.mjs +704 -0
  1038. package/plugins/spec-driver/scripts/lib/project-profile-schema.mjs +78 -0
  1039. package/plugins/spec-driver/scripts/lib/script-cli-args.mjs +25 -0
  1040. package/plugins/spec-driver/scripts/lib/script-diagnostics.mjs +29 -0
  1041. package/plugins/spec-driver/scripts/lib/script-report-io.mjs +37 -0
  1042. package/plugins/spec-driver/scripts/lib/simple-yaml.mjs +257 -0
  1043. package/plugins/spec-driver/scripts/lib/sync-conflict-resolver.mjs +128 -0
  1044. package/plugins/spec-driver/scripts/lib/sync-merge-strategy.mjs +388 -0
  1045. package/plugins/spec-driver/scripts/lib/sync-product-mapping.mjs +228 -0
  1046. package/plugins/spec-driver/scripts/lib/sync-timeline-builder.mjs +114 -0
  1047. package/plugins/spec-driver/scripts/lib/sync-validator.mjs +174 -0
  1048. package/plugins/spec-driver/scripts/lib/workflow-registry-core.mjs +281 -0
  1049. package/plugins/spec-driver/scripts/orchestrator-cli.mjs +490 -0
  1050. package/plugins/spec-driver/scripts/orchestrator-cli.sh +36 -0
  1051. package/plugins/spec-driver/scripts/postinstall.sh +101 -0
  1052. package/plugins/spec-driver/scripts/record-workflow-run.mjs +332 -0
  1053. package/plugins/spec-driver/scripts/resolve-project-context.mjs +56 -0
  1054. package/plugins/spec-driver/scripts/scan-project.sh +668 -0
  1055. package/plugins/spec-driver/scripts/sync-merge-engine.mjs +663 -0
  1056. package/plugins/spec-driver/scripts/validate-config.mjs +223 -0
  1057. package/plugins/spec-driver/scripts/validate-orchestration-overrides.mjs +190 -0
  1058. package/plugins/spec-driver/scripts/validate-wrapper-sources.mjs +302 -0
  1059. package/plugins/spec-driver/skills/spec-driver-constitution/SKILL.md +77 -0
  1060. package/plugins/spec-driver/skills/spec-driver-doc/SKILL.md +732 -0
  1061. package/plugins/spec-driver/skills/spec-driver-feature/SKILL.md +336 -0
  1062. package/plugins/spec-driver/skills/spec-driver-fix/SKILL.md +457 -0
  1063. package/plugins/spec-driver/skills/spec-driver-implement/SKILL.md +653 -0
  1064. package/plugins/spec-driver/skills/spec-driver-refactor/SKILL.md +250 -0
  1065. package/plugins/spec-driver/skills/spec-driver-resume/SKILL.md +325 -0
  1066. package/plugins/spec-driver/skills/spec-driver-story/SKILL.md +566 -0
  1067. package/plugins/spec-driver/skills/spec-driver-sync/SKILL.md +300 -0
  1068. package/plugins/spec-driver/templates/code-of-conduct-v2.1.md +85 -0
  1069. package/plugins/spec-driver/templates/licenses/Apache-2.0.txt +201 -0
  1070. package/plugins/spec-driver/templates/licenses/BSD-2-Clause.txt +24 -0
  1071. package/plugins/spec-driver/templates/licenses/BSD-3-Clause.txt +28 -0
  1072. package/plugins/spec-driver/templates/licenses/GPL-3.0.txt +232 -0
  1073. package/plugins/spec-driver/templates/licenses/ISC.txt +15 -0
  1074. package/plugins/spec-driver/templates/licenses/MIT.txt +21 -0
  1075. package/plugins/spec-driver/templates/licenses/MPL-2.0.txt +373 -0
  1076. package/plugins/spec-driver/templates/licenses/Unlicense.txt +24 -0
  1077. package/plugins/spec-driver/templates/orchestration-overrides.example.yaml +81 -0
  1078. package/plugins/spec-driver/templates/product-research-template.md +95 -0
  1079. package/plugins/spec-driver/templates/product-spec-template.md +250 -0
  1080. package/plugins/spec-driver/templates/research-synthesis-template.md +102 -0
  1081. package/plugins/spec-driver/templates/spec-driver.config-template.yaml +244 -0
  1082. package/plugins/spec-driver/templates/specify-base/agent-file-template.md +28 -0
  1083. package/plugins/spec-driver/templates/specify-base/checklist-template.md +40 -0
  1084. package/plugins/spec-driver/templates/specify-base/constitution-template.md +50 -0
  1085. package/plugins/spec-driver/templates/specify-base/plan-template.md +134 -0
  1086. package/plugins/spec-driver/templates/specify-base/product-research-template.md +95 -0
  1087. package/plugins/spec-driver/templates/specify-base/project-context-template.yaml +40 -0
  1088. package/plugins/spec-driver/templates/specify-base/research-synthesis-template.md +102 -0
  1089. package/plugins/spec-driver/templates/specify-base/spec-template.md +115 -0
  1090. package/plugins/spec-driver/templates/specify-base/tasks-template.md +266 -0
  1091. package/plugins/spec-driver/templates/specify-base/tech-research-template.md +111 -0
  1092. package/plugins/spec-driver/templates/specify-base/verification-report-template.md +63 -0
  1093. package/plugins/spec-driver/templates/tech-research-template.md +111 -0
  1094. package/plugins/spec-driver/templates/verification-report-template.md +63 -0
  1095. package/plugins/spec-driver/workflows/golden-paths.yaml +39 -0
  1096. package/plugins/spec-driver/workflows/spec-driver-doc.yaml +24 -0
  1097. package/plugins/spec-driver/workflows/spec-driver-feature.yaml +29 -0
  1098. package/plugins/spec-driver/workflows/spec-driver-fix.yaml +21 -0
  1099. package/plugins/spec-driver/workflows/spec-driver-implement.yaml +23 -0
  1100. package/plugins/spec-driver/workflows/spec-driver-resume.yaml +20 -0
  1101. package/plugins/spec-driver/workflows/spec-driver-story.yaml +24 -0
  1102. package/plugins/spec-driver/workflows/spec-driver-sync.yaml +34 -0
  1103. package/plugins/spectra/.claude-plugin/plugin.json +20 -0
  1104. package/plugins/spectra/.mcp.json +8 -0
  1105. package/plugins/spectra/README.md +128 -0
  1106. package/plugins/spectra/contracts/skill-source-of-truth.yaml +34 -0
  1107. package/plugins/spectra/hooks/hooks.json +15 -0
  1108. package/plugins/spectra/scripts/postinstall.sh +12 -0
  1109. package/plugins/spectra/scripts/sync-skill-mirrors.mjs +148 -0
  1110. package/plugins/spectra/scripts/validate-skill-sources.mjs +280 -0
  1111. package/plugins/spectra/skills/spectra/SKILL.md +214 -0
  1112. package/plugins/spectra/skills/spectra-batch/SKILL.md +232 -0
  1113. package/plugins/spectra/skills/spectra-diff/SKILL.md +99 -0
  1114. package/queries/go.scm +54 -0
  1115. package/queries/java.scm +50 -0
  1116. package/queries/javascript.scm +30 -0
  1117. package/queries/python.scm +35 -0
  1118. package/queries/typescript.scm +50 -0
  1119. package/scripts/lifecycle-runner.cjs +33 -0
  1120. package/templates/adr-draft.hbs +51 -0
  1121. package/templates/adr-index.hbs +25 -0
  1122. package/templates/api-surface.hbs +40 -0
  1123. package/templates/architecture-ir.hbs +49 -0
  1124. package/templates/architecture-narrative.hbs +116 -0
  1125. package/templates/architecture-overview.hbs +103 -0
  1126. package/templates/component-view.hbs +87 -0
  1127. package/templates/config-reference.hbs +22 -0
  1128. package/templates/coverage-report.hbs +84 -0
  1129. package/templates/cross-package-analysis.hbs +43 -0
  1130. package/templates/data-model.hbs +72 -0
  1131. package/templates/delta-report.hbs +53 -0
  1132. package/templates/docs-bundle-index.hbs +41 -0
  1133. package/templates/drift-report.hbs +53 -0
  1134. package/templates/dynamic-scenarios.hbs +46 -0
  1135. package/templates/event-surface.hbs +90 -0
  1136. package/templates/feature-brief-index.hbs +27 -0
  1137. package/templates/feature-brief.hbs +28 -0
  1138. package/templates/index-spec.hbs +57 -0
  1139. package/templates/interface-surface.hbs +87 -0
  1140. package/templates/module-spec.hbs +117 -0
  1141. package/templates/pattern-hints.hbs +85 -0
  1142. package/templates/product-overview.hbs +65 -0
  1143. package/templates/quality-report.hbs +130 -0
  1144. package/templates/runtime-topology.hbs +128 -0
  1145. package/templates/troubleshooting.hbs +86 -0
  1146. package/templates/user-journeys.hbs +44 -0
  1147. package/templates/workspace-index.hbs +26 -0
@@ -0,0 +1,737 @@
1
+ /**
2
+ * HTML 模板 + 内联 d3-force bundle
3
+ * D3_FORCE_BUNDLE 由构建脚本 scripts/inline-d3.ts 在构建期自动写入
4
+ * 请勿手动编辑 D3_FORCE_BUNDLE 常量(会被下次构建覆盖)
5
+ *
6
+ * d3-force 版本: 3.0.0
7
+ */
8
+ // 内联 d3-force bundle — 由 scripts/inline-d3.ts 在构建期生成
9
+ // d3-force 版本: 3.0.0
10
+ export const D3_FORCE_BUNDLE = `// https://d3js.org/d3-force/ v3.0.0 Copyright 2010-2021 Mike Bostock
11
+ !function(n,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("d3-quadtree"),require("d3-dispatch"),require("d3-timer")):"function"==typeof define&&define.amd?define(["exports","d3-quadtree","d3-dispatch","d3-timer"],t):t((n="undefined"!=typeof globalThis?globalThis:n||self).d3=n.d3||{},n.d3,n.d3,n.d3)}(this,(function(n,t,e,r){"use strict";function i(n){return function(){return n}}function u(n){return 1e-6*(n()-.5)}function o(n){return n.x+n.vx}function f(n){return n.y+n.vy}function a(n){return n.index}function c(n,t){var e=n.get(t);if(!e)throw new Error("node not found: "+t);return e}const l=4294967296;function h(n){return n.x}function v(n){return n.y}var y=Math.PI*(3-Math.sqrt(5));n.forceCenter=function(n,t){var e,r=1;function i(){var i,u,o=e.length,f=0,a=0;for(i=0;i<o;++i)f+=(u=e[i]).x,a+=u.y;for(f=(f/o-n)*r,a=(a/o-t)*r,i=0;i<o;++i)(u=e[i]).x-=f,u.y-=a}return null==n&&(n=0),null==t&&(t=0),i.initialize=function(n){e=n},i.x=function(t){return arguments.length?(n=+t,i):n},i.y=function(n){return arguments.length?(t=+n,i):t},i.strength=function(n){return arguments.length?(r=+n,i):r},i},n.forceCollide=function(n){var e,r,a,c=1,l=1;function h(){for(var n,i,h,y,d,g,x,s=e.length,p=0;p<l;++p)for(i=t.quadtree(e,o,f).visitAfter(v),n=0;n<s;++n)h=e[n],g=r[h.index],x=g*g,y=h.x+h.vx,d=h.y+h.vy,i.visit(M);function M(n,t,e,r,i){var o=n.data,f=n.r,l=g+f;if(!o)return t>y+l||r<y-l||e>d+l||i<d-l;if(o.index>h.index){var v=y-o.x-o.vx,s=d-o.y-o.vy,p=v*v+s*s;p<l*l&&(0===v&&(p+=(v=u(a))*v),0===s&&(p+=(s=u(a))*s),p=(l-(p=Math.sqrt(p)))/p*c,h.vx+=(v*=p)*(l=(f*=f)/(x+f)),h.vy+=(s*=p)*l,o.vx-=v*(l=1-l),o.vy-=s*l)}}}function v(n){if(n.data)return n.r=r[n.data.index];for(var t=n.r=0;t<4;++t)n[t]&&n[t].r>n.r&&(n.r=n[t].r)}function y(){if(e){var t,i,u=e.length;for(r=new Array(u),t=0;t<u;++t)i=e[t],r[i.index]=+n(i,t,e)}}return"function"!=typeof n&&(n=i(null==n?1:+n)),h.initialize=function(n,t){e=n,a=t,y()},h.iterations=function(n){return arguments.length?(l=+n,h):l},h.strength=function(n){return arguments.length?(c=+n,h):c},h.radius=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),y(),h):n},h},n.forceLink=function(n){var t,e,r,o,f,l,h=a,v=function(n){return 1/Math.min(o[n.source.index],o[n.target.index])},y=i(30),d=1;function g(r){for(var i=0,o=n.length;i<d;++i)for(var a,c,h,v,y,g,x,s=0;s<o;++s)c=(a=n[s]).source,v=(h=a.target).x+h.vx-c.x-c.vx||u(l),y=h.y+h.vy-c.y-c.vy||u(l),v*=g=((g=Math.sqrt(v*v+y*y))-e[s])/g*r*t[s],y*=g,h.vx-=v*(x=f[s]),h.vy-=y*x,c.vx+=v*(x=1-x),c.vy+=y*x}function x(){if(r){var i,u,a=r.length,l=n.length,v=new Map(r.map(((n,t)=>[h(n,t,r),n])));for(i=0,o=new Array(a);i<l;++i)(u=n[i]).index=i,"object"!=typeof u.source&&(u.source=c(v,u.source)),"object"!=typeof u.target&&(u.target=c(v,u.target)),o[u.source.index]=(o[u.source.index]||0)+1,o[u.target.index]=(o[u.target.index]||0)+1;for(i=0,f=new Array(l);i<l;++i)u=n[i],f[i]=o[u.source.index]/(o[u.source.index]+o[u.target.index]);t=new Array(l),s(),e=new Array(l),p()}}function s(){if(r)for(var e=0,i=n.length;e<i;++e)t[e]=+v(n[e],e,n)}function p(){if(r)for(var t=0,i=n.length;t<i;++t)e[t]=+y(n[t],t,n)}return null==n&&(n=[]),g.initialize=function(n,t){r=n,l=t,x()},g.links=function(t){return arguments.length?(n=t,x(),g):n},g.id=function(n){return arguments.length?(h=n,g):h},g.iterations=function(n){return arguments.length?(d=+n,g):d},g.strength=function(n){return arguments.length?(v="function"==typeof n?n:i(+n),s(),g):v},g.distance=function(n){return arguments.length?(y="function"==typeof n?n:i(+n),p(),g):y},g},n.forceManyBody=function(){var n,e,r,o,f,a=i(-30),c=1,l=1/0,y=.81;function d(r){var i,u=n.length,f=t.quadtree(n,h,v).visitAfter(x);for(o=r,i=0;i<u;++i)e=n[i],f.visit(s)}function g(){if(n){var t,e,r=n.length;for(f=new Array(r),t=0;t<r;++t)e=n[t],f[e.index]=+a(e,t,n)}}function x(n){var t,e,r,i,u,o=0,a=0;if(n.length){for(r=i=u=0;u<4;++u)(t=n[u])&&(e=Math.abs(t.value))&&(o+=t.value,a+=e,r+=e*t.x,i+=e*t.y);n.x=r/a,n.y=i/a}else{(t=n).x=t.data.x,t.y=t.data.y;do{o+=f[t.data.index]}while(t=t.next)}n.value=o}function s(n,t,i,a){if(!n.value)return!0;var h=n.x-e.x,v=n.y-e.y,d=a-t,g=h*h+v*v;if(d*d/y<g)return g<l&&(0===h&&(g+=(h=u(r))*h),0===v&&(g+=(v=u(r))*v),g<c&&(g=Math.sqrt(c*g)),e.vx+=h*n.value*o/g,e.vy+=v*n.value*o/g),!0;if(!(n.length||g>=l)){(n.data!==e||n.next)&&(0===h&&(g+=(h=u(r))*h),0===v&&(g+=(v=u(r))*v),g<c&&(g=Math.sqrt(c*g)));do{n.data!==e&&(d=f[n.data.index]*o/g,e.vx+=h*d,e.vy+=v*d)}while(n=n.next)}}return d.initialize=function(t,e){n=t,r=e,g()},d.strength=function(n){return arguments.length?(a="function"==typeof n?n:i(+n),g(),d):a},d.distanceMin=function(n){return arguments.length?(c=n*n,d):Math.sqrt(c)},d.distanceMax=function(n){return arguments.length?(l=n*n,d):Math.sqrt(l)},d.theta=function(n){return arguments.length?(y=n*n,d):Math.sqrt(y)},d},n.forceRadial=function(n,t,e){var r,u,o,f=i(.1);function a(n){for(var i=0,f=r.length;i<f;++i){var a=r[i],c=a.x-t||1e-6,l=a.y-e||1e-6,h=Math.sqrt(c*c+l*l),v=(o[i]-h)*u[i]*n/h;a.vx+=c*v,a.vy+=l*v}}function c(){if(r){var t,e=r.length;for(u=new Array(e),o=new Array(e),t=0;t<e;++t)o[t]=+n(r[t],t,r),u[t]=isNaN(o[t])?0:+f(r[t],t,r)}}return"function"!=typeof n&&(n=i(+n)),null==t&&(t=0),null==e&&(e=0),a.initialize=function(n){r=n,c()},a.strength=function(n){return arguments.length?(f="function"==typeof n?n:i(+n),c(),a):f},a.radius=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),c(),a):n},a.x=function(n){return arguments.length?(t=+n,a):t},a.y=function(n){return arguments.length?(e=+n,a):e},a},n.forceSimulation=function(n){var t,i=1,u=.001,o=1-Math.pow(u,1/300),f=0,a=.6,c=new Map,h=r.timer(g),v=e.dispatch("tick","end"),d=function(){let n=1;return()=>(n=(1664525*n+1013904223)%l)/l}();function g(){x(),v.call("tick",t),i<u&&(h.stop(),v.call("end",t))}function x(e){var r,u,l=n.length;void 0===e&&(e=1);for(var h=0;h<e;++h)for(i+=(f-i)*o,c.forEach((function(n){n(i)})),r=0;r<l;++r)null==(u=n[r]).fx?u.x+=u.vx*=a:(u.x=u.fx,u.vx=0),null==u.fy?u.y+=u.vy*=a:(u.y=u.fy,u.vy=0);return t}function s(){for(var t,e=0,r=n.length;e<r;++e){if((t=n[e]).index=e,null!=t.fx&&(t.x=t.fx),null!=t.fy&&(t.y=t.fy),isNaN(t.x)||isNaN(t.y)){var i=10*Math.sqrt(.5+e),u=e*y;t.x=i*Math.cos(u),t.y=i*Math.sin(u)}(isNaN(t.vx)||isNaN(t.vy))&&(t.vx=t.vy=0)}}function p(t){return t.initialize&&t.initialize(n,d),t}return null==n&&(n=[]),s(),t={tick:x,restart:function(){return h.restart(g),t},stop:function(){return h.stop(),t},nodes:function(e){return arguments.length?(n=e,s(),c.forEach(p),t):n},alpha:function(n){return arguments.length?(i=+n,t):i},alphaMin:function(n){return arguments.length?(u=+n,t):u},alphaDecay:function(n){return arguments.length?(o=+n,t):+o},alphaTarget:function(n){return arguments.length?(f=+n,t):f},velocityDecay:function(n){return arguments.length?(a=1-n,t):1-a},randomSource:function(n){return arguments.length?(d=n,c.forEach(p),t):d},force:function(n,e){return arguments.length>1?(null==e?c.delete(n):c.set(n,p(e)),t):c.get(n)},find:function(t,e,r){var i,u,o,f,a,c=0,l=n.length;for(null==r?r=1/0:r*=r,c=0;c<l;++c)(o=(i=t-(f=n[c]).x)*i+(u=e-f.y)*u)<r&&(a=f,r=o);return a},on:function(n,e){return arguments.length>1?(v.on(n,e),t):v.on(n)}}},n.forceX=function(n){var t,e,r,u=i(.1);function o(n){for(var i,u=0,o=t.length;u<o;++u)(i=t[u]).vx+=(r[u]-i.x)*e[u]*n}function f(){if(t){var i,o=t.length;for(e=new Array(o),r=new Array(o),i=0;i<o;++i)e[i]=isNaN(r[i]=+n(t[i],i,t))?0:+u(t[i],i,t)}}return"function"!=typeof n&&(n=i(null==n?0:+n)),o.initialize=function(n){t=n,f()},o.strength=function(n){return arguments.length?(u="function"==typeof n?n:i(+n),f(),o):u},o.x=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),f(),o):n},o},n.forceY=function(n){var t,e,r,u=i(.1);function o(n){for(var i,u=0,o=t.length;u<o;++u)(i=t[u]).vy+=(r[u]-i.y)*e[u]*n}function f(){if(t){var i,o=t.length;for(e=new Array(o),r=new Array(o),i=0;i<o;++i)e[i]=isNaN(r[i]=+n(t[i],i,t))?0:+u(t[i],i,t)}}return"function"!=typeof n&&(n=i(null==n?0:+n)),o.initialize=function(n){t=n,f()},o.strength=function(n){return arguments.length?(u="function"==typeof n?n:i(+n),f(),o):u},o.y=function(t){return arguments.length?(n="function"==typeof t?t:i(+t),f(),o):n},o},Object.defineProperty(n,"__esModule",{value:!0})}));
12
+ `;
13
+ import { createLogger } from '../utils/logger.js';
14
+ const logger = createLogger('html-template');
15
+ /** 力导向布局阈值(Q3 锁定:< 2000 启用力导向,≥ 2000 切静态坐标模式) */
16
+ const FORCE_THRESHOLD = 2000;
17
+ /** 文件体积警告阈值默认值(5 MB) */
18
+ const DEFAULT_FILE_SIZE_WARN_BYTES = 5 * 1024 * 1024;
19
+ /**
20
+ * 极小图阈值(Feature 140 T19):节点数 < SMALL_GRAPH_THRESHOLD 时在 HTML
21
+ * 顶部注入说明 banner,引导用户用 `--include-docs` 增加语义上下文。
22
+ */
23
+ const SMALL_GRAPH_THRESHOLD = 3;
24
+ /** Feature 140 T19:极小图 banner 文案(spec 锁定,不可改) */
25
+ const SMALL_GRAPH_BANNER_MESSAGE = 'This project has too few cross-module references for meaningful visualization. ' +
26
+ 'Run with --include-docs to add semantic context.';
27
+ /**
28
+ * 构建完整 HTML 模板
29
+ * 将 d3 bundle、图谱数据 JSON、CSS、交互 JS 组装为单文件字符串
30
+ *
31
+ * @param graphDataJson - buildGraphData() 返回的 JSON 字符串(含 hyperedges 字段)
32
+ * @param options - graph.html 生成配置(可选,未传时行为与旧版等价)
33
+ * @returns 完整 HTML 字符串(单文件,包含所有内联资源,零外部 CDN 引用)
34
+ */
35
+ export function buildHtmlTemplate(graphDataJson, options) {
36
+ // 合并默认值
37
+ const opts = {
38
+ forceLayoutThreshold: FORCE_THRESHOLD,
39
+ showHyperedges: options?.showHyperedges ?? true,
40
+ enableSearch: options?.enableSearch ?? true,
41
+ enableJumpToSpec: options?.enableJumpToSpec ?? true,
42
+ fileSizeWarnThreshold: options?.fileSizeWarnThreshold ?? DEFAULT_FILE_SIZE_WARN_BYTES,
43
+ nodeCount: options?.nodeCount,
44
+ };
45
+ // 检查生成 HTML 体积(先估算:JSON + bundle 大小约等于最终 HTML 的 90%)
46
+ const estimatedSize = graphDataJson.length + D3_FORCE_BUNDLE.length;
47
+ if (estimatedSize >= opts.fileSizeWarnThreshold) {
48
+ logger.warn(`[warn] graph.html 预估体积 ${(estimatedSize / (1024 * 1024)).toFixed(1)} MB 超过 ${opts.fileSizeWarnThreshold / (1024 * 1024)} MB 阈值,生成不阻断`);
49
+ }
50
+ // 对 </script> 标签转义,防止浏览器提前关闭脚本块
51
+ const safeJson = graphDataJson.replace(/<\//g, '<\\/');
52
+ return buildFullHtml(safeJson, D3_FORCE_BUNDLE, opts);
53
+ }
54
+ /**
55
+ * 组装完整 HTML 字符串(内部函数,便于测试)
56
+ * F5 扩展:支持 hyperedge 凸包、大图横幅、节点跳转 spec、力导向阈值
57
+ */
58
+ export function buildFullHtml(graphDataJson, d3Bundle, opts) {
59
+ const threshold = opts?.forceLayoutThreshold ?? FORCE_THRESHOLD;
60
+ const showHyperedges = opts?.showHyperedges ?? true;
61
+ const enableJumpToSpec = opts?.enableJumpToSpec ?? true;
62
+ // Feature 140 T19:极小图 banner(< 3 节点时显示)
63
+ // 安全说明:nodeCount 必须是数字(caller 在 batch-orchestrator 中通过 .length 计算),
64
+ // 不接受字符串;banner 文案为常量,不含用户输入,无 XSS 风险。
65
+ // 布局说明:body 是横向 flex 容器(line 85: display: flex),banner 必须用 position: fixed
66
+ // 浮在顶部,否则会被作为 flex 子项与 sidebar 并排成竖条(Codex review W2 修复)。
67
+ // z-index: 101(略高于 large-graph-banner 的 100,因为极小图 banner 优先级更高 — 用户首次
68
+ // 看到极小图时最需要这个引导)。
69
+ const showSmallGraphBanner = typeof opts?.nodeCount === 'number' && opts.nodeCount < SMALL_GRAPH_THRESHOLD;
70
+ const smallGraphBannerHtml = showSmallGraphBanner
71
+ ? `<div id="small-graph-banner" role="alert" style="position: fixed; top: 0; left: 0; right: 0; background: #FFF3CD; border-bottom: 1px solid #FFC107; color: #664d03; padding: 12px 16px; font-size: 13px; line-height: 1.5; z-index: 101; text-align: center;">${SMALL_GRAPH_BANNER_MESSAGE}</div>`
72
+ : '';
73
+ return `<!DOCTYPE html>
74
+ <html lang="zh-CN">
75
+ <head>
76
+ <meta charset="UTF-8" />
77
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
78
+ <title>知识图谱可视化</title>
79
+ <style>
80
+ * { box-sizing: border-box; margin: 0; padding: 0; }
81
+ body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; background: #0d1117; color: #e6edf3; display: flex; height: 100vh; overflow: hidden; }
82
+ #sidebar { width: 280px; min-width: 280px; background: #161b22; border-right: 1px solid #30363d; display: flex; flex-direction: column; overflow: hidden; }
83
+ #sidebar-header { padding: 16px; border-bottom: 1px solid #30363d; }
84
+ #sidebar-header h1 { font-size: 14px; font-weight: 600; }
85
+ #sidebar-header p { font-size: 12px; color: #8b949e; margin-top: 4px; }
86
+ #search-section { padding: 12px 16px; border-bottom: 1px solid #30363d; }
87
+ #search-input { width: 100%; padding: 6px 10px; background: #0d1117; border: 1px solid #30363d; border-radius: 6px; color: #e6edf3; font-size: 13px; outline: none; }
88
+ #search-input:focus { border-color: #388bfd; }
89
+ #search-results { margin-top: 8px; max-height: 150px; overflow-y: auto; }
90
+ .search-result-item { padding: 4px 8px; font-size: 12px; cursor: pointer; border-radius: 4px; color: #8b949e; }
91
+ .search-result-item:hover { background: #21262d; color: #e6edf3; }
92
+ #legend-section { padding: 12px 16px; border-bottom: 1px solid #30363d; flex-shrink: 0; }
93
+ #legend-section h3 { font-size: 12px; font-weight: 600; color: #8b949e; text-transform: uppercase; margin-bottom: 8px; }
94
+ #legend-list { max-height: 200px; overflow-y: auto; }
95
+ .legend-item { display: flex; align-items: center; gap: 8px; padding: 3px 0; cursor: pointer; }
96
+ .legend-color { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
97
+ .legend-label { font-size: 12px; color: #8b949e; }
98
+ .legend-item.hidden .legend-label { text-decoration: line-through; opacity: 0.5; }
99
+ #hyperedge-section { padding: 12px 16px; border-bottom: 1px solid #30363d; flex-shrink: 0; display: none; }
100
+ #hyperedge-section h3 { font-size: 12px; font-weight: 600; color: #8b949e; text-transform: uppercase; margin-bottom: 8px; }
101
+ #hyperedge-list { max-height: 120px; overflow-y: auto; }
102
+ .hyperedge-item { display: flex; align-items: center; gap: 6px; padding: 3px 0; font-size: 12px; color: #8b949e; }
103
+ .hyperedge-dot { width: 10px; height: 10px; border-radius: 2px; border: 1.5px dashed currentColor; flex-shrink: 0; }
104
+ #detail-section { padding: 12px 16px; flex: 1; overflow-y: auto; }
105
+ #detail-section h3 { font-size: 12px; font-weight: 600; color: #8b949e; text-transform: uppercase; margin-bottom: 8px; }
106
+ #detail-placeholder { font-size: 12px; color: #484f58; font-style: italic; }
107
+ #node-detail { display: none; }
108
+ #node-detail-title { font-size: 14px; font-weight: 600; margin-bottom: 8px; word-break: break-all; }
109
+ .detail-row { display: flex; gap: 8px; margin-bottom: 6px; }
110
+ .detail-key { font-size: 11px; color: #8b949e; min-width: 60px; flex-shrink: 0; }
111
+ .detail-value { font-size: 11px; word-break: break-all; }
112
+ #spec-link-row { display: none; margin-top: 8px; }
113
+ #open-spec-btn { padding: 5px 10px; background: #21262d; border: 1px solid #388bfd; border-radius: 6px; color: #58a6ff; font-size: 12px; cursor: pointer; }
114
+ #open-spec-btn:hover { background: #388bfd; color: #ffffff; }
115
+ #spec-link-error { display: none; color: #f85149; font-size: 11px; margin-top: 4px; }
116
+ #canvas-area { flex: 1; position: relative; overflow: hidden; }
117
+ #graph-svg { width: 100%; height: 100%; cursor: grab; }
118
+ #graph-svg:active { cursor: grabbing; }
119
+ #zoom-controls { position: absolute; bottom: 20px; right: 20px; display: flex; flex-direction: column; gap: 4px; }
120
+ .zoom-btn { width: 32px; height: 32px; background: #21262d; border: 1px solid #30363d; border-radius: 6px; color: #e6edf3; font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
121
+ .zoom-btn:hover { background: #30363d; }
122
+ .node circle { stroke: #30363d; stroke-width: 1.5; }
123
+ .node circle.highlighted { stroke: #f0883e; stroke-width: 3; }
124
+ .node circle.god-node { stroke: #d29922; stroke-width: 2; }
125
+ .node text { font-size: 10px; fill: #8b949e; pointer-events: none; }
126
+ .link { stroke-opacity: 0.4; }
127
+ #large-graph-banner { display: none; position: fixed; top: 0; left: 0; right: 0; background: #d29922; color: #0d1117; padding: 8px 16px; font-size: 13px; font-weight: 600; z-index: 100; text-align: center; }
128
+ #hyperedge-tooltip { position: fixed; background: #21262d; border: 1px solid #30363d; border-radius: 6px; padding: 6px 10px; font-size: 12px; color: #e6edf3; pointer-events: none; display: none; z-index: 200; }
129
+ .node.search-dim circle { opacity: 0.15; }
130
+ .node.search-dim text { opacity: 0.15; }
131
+ .link.search-dim { opacity: 0.1; }
132
+ </style>
133
+ </head>
134
+ <body>
135
+ <!-- 大图模式横幅(节点数 >= FORCE_THRESHOLD 时动态显示) -->
136
+ <div id="large-graph-banner">
137
+ 大图模式(<span id="banner-node-count"></span> 个节点),力导向布局已关闭,部分交互受限
138
+ </div>
139
+ ${smallGraphBannerHtml}
140
+ <!-- 超边 tooltip -->
141
+ <div id="hyperedge-tooltip"></div>
142
+ <div id="sidebar">
143
+ <div id="sidebar-header">
144
+ <h1>知识图谱</h1>
145
+ <p id="graph-stats">加载中...</p>
146
+ </div>
147
+ <div id="search-section">
148
+ <input id="search-input" type="text" placeholder="搜索节点..." autocomplete="off" />
149
+ <div id="search-results"></div>
150
+ </div>
151
+ <div id="legend-section">
152
+ <h3>社区图例</h3>
153
+ <div id="legend-list"></div>
154
+ </div>
155
+ <!-- 超边图例区块(有 hyperedge 数据时显示) -->
156
+ <div id="hyperedge-section">
157
+ <h3>流程超边</h3>
158
+ <div id="hyperedge-list"></div>
159
+ </div>
160
+ <div id="detail-section">
161
+ <h3>节点详情</h3>
162
+ <div id="detail-placeholder">点击节点查看详情</div>
163
+ <div id="node-detail">
164
+ <div id="node-detail-title"></div>
165
+ <div id="node-detail-rows"></div>
166
+ <!-- F5:spec 文件跳转区块(enableJumpToSpec = true 时有效) -->
167
+ <div id="spec-link-row">
168
+ <button id="open-spec-btn">打开 Spec 文件</button>
169
+ <div id="spec-link-error"></div>
170
+ </div>
171
+ </div>
172
+ </div>
173
+ </div>
174
+ <div id="canvas-area">
175
+ <svg id="graph-svg">
176
+ <g id="graph-group">
177
+ <!-- 超边凸包层(在连线层之前,视觉上在节点之下) -->
178
+ <g id="hyperedges-layer"></g>
179
+ <g id="links-layer"></g>
180
+ <g id="nodes-layer"></g>
181
+ </g>
182
+ </svg>
183
+ <div id="zoom-controls">
184
+ <button class="zoom-btn" id="zoom-in-btn" title="放大">+</button>
185
+ <button class="zoom-btn" id="zoom-reset-btn" title="重置">&#8857;</button>
186
+ <button class="zoom-btn" id="zoom-out-btn" title="缩小">-</button>
187
+ </div>
188
+ </div>
189
+ <script>${d3Bundle}</script>
190
+ <script>
191
+ (function() {
192
+ 'use strict';
193
+ // F5 配置常量(由生成时写入)
194
+ var FORCE_THRESHOLD = ${threshold};
195
+ var SHOW_HYPEREDGES = ${showHyperedges};
196
+ var ENABLE_JUMP_TO_SPEC = ${enableJumpToSpec};
197
+
198
+ var GRAPH_DATA = ${graphDataJson};
199
+ var hiddenCommunities = new Set();
200
+ var currentTransform = { x: 0, y: 0, k: 1 };
201
+ var svg = document.getElementById('graph-svg');
202
+ var graphGroup = document.getElementById('graph-group');
203
+ var linksLayer = document.getElementById('links-layer');
204
+ var nodesLayer = document.getElementById('nodes-layer');
205
+
206
+ function applyTransform(x, y, k) {
207
+ currentTransform = { x: x, y: y, k: k };
208
+ graphGroup.setAttribute('transform', 'translate(' + x + ',' + y + ') scale(' + k + ')');
209
+ }
210
+
211
+ function centerGraph() {
212
+ var rect = svg.getBoundingClientRect();
213
+ applyTransform(rect.width / 2, rect.height / 2, 0.8);
214
+ }
215
+
216
+ function initStats() {
217
+ var el = document.getElementById('graph-stats');
218
+ if (el) el.textContent = GRAPH_DATA.nodes.length + ' 节点 · ' + GRAPH_DATA.links.length + ' 边';
219
+ }
220
+
221
+ function buildLegend() {
222
+ var list = document.getElementById('legend-list');
223
+ if (!list) return;
224
+ (GRAPH_DATA.communities || []).forEach(function(comm) {
225
+ var item = document.createElement('div');
226
+ item.className = 'legend-item';
227
+ item.dataset.communityId = comm.id;
228
+ var dot = document.createElement('div');
229
+ dot.className = 'legend-color';
230
+ dot.style.background = comm.color;
231
+ var label = document.createElement('div');
232
+ label.className = 'legend-label';
233
+ label.textContent = '社区 ' + comm.id + ' (' + comm.nodeCount + ' 节点)';
234
+ item.appendChild(dot);
235
+ item.appendChild(label);
236
+ item.addEventListener('click', function() {
237
+ if (hiddenCommunities.has(comm.id)) { hiddenCommunities.delete(comm.id); item.classList.remove('hidden'); }
238
+ else { hiddenCommunities.add(comm.id); item.classList.add('hidden'); }
239
+ document.querySelectorAll('.node').forEach(function(n) {
240
+ n.style.display = hiddenCommunities.has(parseInt(n.dataset.communityId || '-1', 10)) ? 'none' : '';
241
+ });
242
+ document.querySelectorAll('.link').forEach(function(l) {
243
+ var sc = parseInt(l.dataset.sourceCommunity || '-1', 10);
244
+ var tc = parseInt(l.dataset.targetCommunity || '-1', 10);
245
+ l.style.display = (hiddenCommunities.has(sc) || hiddenCommunities.has(tc)) ? 'none' : '';
246
+ });
247
+ });
248
+ list.appendChild(item);
249
+ });
250
+ }
251
+
252
+ // 构建超边图例区块(FR-019)
253
+ function buildHyperedgeLegend() {
254
+ if (!SHOW_HYPEREDGES) return;
255
+ var hyperedges = GRAPH_DATA.hyperedges || [];
256
+ if (hyperedges.length === 0) return;
257
+ var section = document.getElementById('hyperedge-section');
258
+ var listEl = document.getElementById('hyperedge-list');
259
+ if (!section || !listEl) return;
260
+ section.style.display = 'block';
261
+ hyperedges.forEach(function(he) {
262
+ var item = document.createElement('div');
263
+ item.className = 'hyperedge-item';
264
+ var dot = document.createElement('div');
265
+ dot.className = 'hyperedge-dot';
266
+ dot.style.color = he.color || '#8b949e';
267
+ var text = document.createElement('span');
268
+ text.textContent = he.label + ' (' + (he.nodes || []).length + ' 节点)';
269
+ item.appendChild(dot);
270
+ item.appendChild(text);
271
+ listEl.appendChild(item);
272
+ });
273
+ }
274
+
275
+ var nodeCommMap = new Map();
276
+ GRAPH_DATA.nodes.forEach(function(n) { nodeCommMap.set(n.id, n.communityId); });
277
+
278
+ function renderLinks(links) {
279
+ return links.map(function(link) {
280
+ var line = document.createElementNS('http://www.w3.org/2000/svg', 'line');
281
+ line.classList.add('link');
282
+ line.dataset.sourceCommunity = String(nodeCommMap.get(link.source) != null ? nodeCommMap.get(link.source) : -1);
283
+ line.dataset.targetCommunity = String(nodeCommMap.get(link.target) != null ? nodeCommMap.get(link.target) : -1);
284
+ line.setAttribute('stroke', '#30363d');
285
+ line.setAttribute('stroke-width', '1');
286
+ line.setAttribute('stroke-opacity', String(link.opacity != null ? link.opacity : 0.4));
287
+ linksLayer.appendChild(line);
288
+ return line;
289
+ });
290
+ }
291
+
292
+ function renderNodes(nodes) {
293
+ return nodes.map(function(node) {
294
+ var g = document.createElementNS('http://www.w3.org/2000/svg', 'g');
295
+ g.classList.add('node');
296
+ g.dataset.id = node.id;
297
+ g.dataset.communityId = String(node.communityId != null ? node.communityId : -1);
298
+ var circle = document.createElementNS('http://www.w3.org/2000/svg', 'circle');
299
+ circle.setAttribute('r', String(node.radius != null ? node.radius : 6));
300
+ circle.setAttribute('fill', node.color || '#58a6ff');
301
+ if (node.isGodNode) circle.classList.add('god-node');
302
+ g.appendChild(circle);
303
+ var text = document.createElementNS('http://www.w3.org/2000/svg', 'text');
304
+ text.setAttribute('x', String((node.radius != null ? node.radius : 6) + 3));
305
+ text.setAttribute('y', '4');
306
+ text.textContent = node.label || node.id;
307
+ g.appendChild(text);
308
+ g.addEventListener('click', function() { showDetail(node); });
309
+ nodesLayer.appendChild(g);
310
+ return { el: g, node: node };
311
+ });
312
+ }
313
+
314
+ // 展示节点详情面板(含 F5 扩展:spec 跳转按钮)
315
+ function showDetail(node) {
316
+ document.getElementById('detail-placeholder').style.display = 'none';
317
+ document.getElementById('node-detail').style.display = 'block';
318
+ document.getElementById('node-detail-title').textContent = node.label || node.id;
319
+ var rows = document.getElementById('node-detail-rows');
320
+ rows.innerHTML = '';
321
+ // 基础属性(使用 textContent 防止 XSS)
322
+ [['ID', node.id], ['类型', node.kind || '—'], ['度数', String(node.degree != null ? node.degree : '—')],
323
+ ['社区', node.communityId >= 0 ? '社区 ' + node.communityId : '未分类'],
324
+ ['God Node', node.isGodNode ? '是' : '否']
325
+ ].forEach(function(r) {
326
+ var row = document.createElement('div');
327
+ row.className = 'detail-row';
328
+ var key = document.createElement('span');
329
+ key.className = 'detail-key';
330
+ key.textContent = r[0];
331
+ var val = document.createElement('span');
332
+ val.className = 'detail-value';
333
+ val.textContent = r[1];
334
+ row.appendChild(key);
335
+ row.appendChild(val);
336
+ rows.appendChild(row);
337
+ });
338
+ // 邻居节点列表
339
+ var neighbors = [];
340
+ GRAPH_DATA.links.forEach(function(link) {
341
+ var src = typeof link.source === 'object' ? link.source.id : link.source;
342
+ var tgt = typeof link.target === 'object' ? link.target.id : link.target;
343
+ if (src === node.id && neighbors.indexOf(tgt) === -1) neighbors.push(tgt);
344
+ else if (tgt === node.id && neighbors.indexOf(src) === -1) neighbors.push(src);
345
+ });
346
+ if (neighbors.length > 0) {
347
+ var nRow = document.createElement('div');
348
+ nRow.className = 'detail-row';
349
+ nRow.style.flexDirection = 'column';
350
+ var nKey = document.createElement('span');
351
+ nKey.className = 'detail-key';
352
+ nKey.textContent = '邻居 (' + neighbors.length + ')';
353
+ nRow.appendChild(nKey);
354
+ var nList = document.createElement('div');
355
+ nList.style.cssText = 'max-height:120px;overflow-y:auto;margin-top:4px;';
356
+ neighbors.slice(0, 50).forEach(function(nid) {
357
+ var nNode = GRAPH_DATA.nodes.find(function(nn) { return nn.id === nid; });
358
+ var nItem = document.createElement('div');
359
+ nItem.style.cssText = 'font-size:11px;padding:2px 0;cursor:pointer;color:#58a6ff;';
360
+ nItem.textContent = nNode ? (nNode.label || nNode.id) : nid;
361
+ nItem.addEventListener('click', function() { if (nNode) showDetail(nNode); });
362
+ nList.appendChild(nItem);
363
+ });
364
+ if (neighbors.length > 50) { var more = document.createElement('div'); more.style.cssText='font-size:11px;color:#8b949e;'; more.textContent = '...及其他 ' + (neighbors.length - 50) + ' 个'; nList.appendChild(more); }
365
+ nRow.appendChild(nList);
366
+ rows.appendChild(nRow);
367
+ }
368
+ document.querySelectorAll('.node circle.highlighted').forEach(function(el) { el.classList.remove('highlighted'); });
369
+ var nodeEl = nodesLayer.querySelector('[data-id="' + node.id.replace(/"/g, '\\\\"') + '"] circle');
370
+ if (nodeEl) nodeEl.classList.add('highlighted');
371
+
372
+ // F5 新增:spec 文件跳转(FR-020)
373
+ if (ENABLE_JUMP_TO_SPEC) {
374
+ var specLinkRow = document.getElementById('spec-link-row');
375
+ var openSpecBtn = document.getElementById('open-spec-btn');
376
+ var specLinkError = document.getElementById('spec-link-error');
377
+ if (node.specPath) {
378
+ specLinkRow.style.display = 'block';
379
+ specLinkError.style.display = 'none';
380
+ specLinkError.textContent = '';
381
+ if (node.specPathExists === false) {
382
+ // 预先标记为不存在,显示友好提示
383
+ openSpecBtn.textContent = 'Spec 文件未找到';
384
+ openSpecBtn.onclick = function() {
385
+ specLinkError.textContent = 'spec 文件未找到:' + node.specPath;
386
+ specLinkError.style.display = 'block';
387
+ };
388
+ } else {
389
+ openSpecBtn.textContent = '打开 Spec 文件';
390
+ openSpecBtn.onclick = function() {
391
+ try {
392
+ // file:// URL 在本地浏览器中触发 OS 默认程序打开
393
+ window.open('file://' + node.specPath, '_blank');
394
+ } catch (e) {
395
+ specLinkError.textContent = 'spec 文件打开失败:' + node.specPath;
396
+ specLinkError.style.display = 'block';
397
+ }
398
+ };
399
+ }
400
+ } else {
401
+ specLinkRow.style.display = 'none';
402
+ }
403
+ }
404
+ }
405
+
406
+ // 搜索功能(FR-019):高亮匹配节点,其余淡出
407
+ function initSearch() {
408
+ var input = document.getElementById('search-input');
409
+ var results = document.getElementById('search-results');
410
+ input.addEventListener('input', function() {
411
+ var q = input.value.trim().toLowerCase();
412
+ results.innerHTML = '';
413
+
414
+ if (!q) {
415
+ // 清空搜索时恢复所有节点正常显示
416
+ document.querySelectorAll('.node').forEach(function(n) { n.classList.remove('search-dim'); });
417
+ document.querySelectorAll('.link').forEach(function(l) { l.classList.remove('search-dim'); });
418
+ return;
419
+ }
420
+
421
+ var matchedIds = new Set();
422
+ GRAPH_DATA.nodes.filter(function(n) {
423
+ return (n.label || '').toLowerCase().indexOf(q) !== -1 || n.id.toLowerCase().indexOf(q) !== -1;
424
+ }).slice(0, 20).forEach(function(node) {
425
+ matchedIds.add(node.id);
426
+ var item = document.createElement('div');
427
+ item.className = 'search-result-item';
428
+ item.textContent = node.label || node.id;
429
+ item.addEventListener('click', function() {
430
+ var x = node.fx != null ? node.fx : (node.x || 0);
431
+ var y = node.fy != null ? node.fy : (node.y || 0);
432
+ var rect = svg.getBoundingClientRect();
433
+ applyTransform(rect.width / 2 - x * currentTransform.k, rect.height / 2 - y * currentTransform.k, currentTransform.k);
434
+ showDetail(node);
435
+ results.innerHTML = '';
436
+ input.value = '';
437
+ // 恢复正常显示
438
+ document.querySelectorAll('.node').forEach(function(n) { n.classList.remove('search-dim'); });
439
+ document.querySelectorAll('.link').forEach(function(l) { l.classList.remove('search-dim'); });
440
+ });
441
+ results.appendChild(item);
442
+ });
443
+
444
+ // 高亮匹配节点,淡出其余节点(FR-019 差异化点)
445
+ document.querySelectorAll('.node').forEach(function(n) {
446
+ var nid = n.dataset.id || '';
447
+ if (matchedIds.has(nid)) {
448
+ n.classList.remove('search-dim');
449
+ } else {
450
+ n.classList.add('search-dim');
451
+ }
452
+ });
453
+ document.querySelectorAll('.link').forEach(function(l) {
454
+ var sc = l.dataset.sourceCommunity;
455
+ var tc = l.dataset.targetCommunity;
456
+ // 仅在相关节点都不匹配时才淡出连线(简化处理:全部淡出)
457
+ l.classList.add('search-dim');
458
+ if (sc && tc) {
459
+ // 若连线两端有匹配节点则保持显示
460
+ GRAPH_DATA.links.forEach(function(link) {
461
+ var src = typeof link.source === 'object' ? link.source.id : link.source;
462
+ var tgt = typeof link.target === 'object' ? link.target.id : link.target;
463
+ if (matchedIds.has(src) || matchedIds.has(tgt)) {
464
+ l.classList.remove('search-dim');
465
+ }
466
+ });
467
+ }
468
+ });
469
+ });
470
+ }
471
+
472
+ function initZoomPan() {
473
+ var dragging = false, dragStart = {x:0,y:0}, tStart = {x:0,y:0};
474
+ svg.addEventListener('mousedown', function(e) {
475
+ if (e.target !== svg && e.target !== graphGroup) return;
476
+ dragging = true; dragStart = {x:e.clientX,y:e.clientY}; tStart = {x:currentTransform.x,y:currentTransform.y};
477
+ e.preventDefault();
478
+ });
479
+ window.addEventListener('mousemove', function(e) {
480
+ if (!dragging) return;
481
+ applyTransform(tStart.x + e.clientX - dragStart.x, tStart.y + e.clientY - dragStart.y, currentTransform.k);
482
+ });
483
+ window.addEventListener('mouseup', function() { dragging = false; });
484
+ svg.addEventListener('wheel', function(e) {
485
+ e.preventDefault();
486
+ var delta = e.deltaY > 0 ? 0.9 : 1.1;
487
+ var newK = Math.min(Math.max(currentTransform.k * delta, 0.1), 8);
488
+ var rect = svg.getBoundingClientRect();
489
+ var mx = e.clientX - rect.left, my = e.clientY - rect.top;
490
+ applyTransform(mx - (mx - currentTransform.x) * (newK / currentTransform.k), my - (my - currentTransform.y) * (newK / currentTransform.k), newK);
491
+ }, { passive: false });
492
+ document.getElementById('zoom-in-btn').addEventListener('click', function() { applyTransform(currentTransform.x, currentTransform.y, Math.min(currentTransform.k * 1.3, 8)); });
493
+ document.getElementById('zoom-out-btn').addEventListener('click', function() { applyTransform(currentTransform.x, currentTransform.y, Math.max(currentTransform.k * 0.77, 0.1)); });
494
+ document.getElementById('zoom-reset-btn').addEventListener('click', centerGraph);
495
+ }
496
+
497
+ function updateLinks(linkEls, linkData) {
498
+ linkEls.forEach(function(el, i) {
499
+ var link = linkData[i];
500
+ if (!link) return;
501
+ var src = typeof link.source === 'object' && link.source !== null ? link.source : { x: 0, y: 0 };
502
+ var tgt = typeof link.target === 'object' && link.target !== null ? link.target : { x: 0, y: 0 };
503
+ el.setAttribute('x1', String(src.x || 0)); el.setAttribute('y1', String(src.y || 0));
504
+ el.setAttribute('x2', String(tgt.x || 0)); el.setAttribute('y2', String(tgt.y || 0));
505
+ });
506
+ }
507
+
508
+ function updateNodes(nodeEls) {
509
+ nodeEls.forEach(function(ne) {
510
+ ne.el.setAttribute('transform', 'translate(' + (ne.node.x || 0) + ',' + (ne.node.y || 0) + ')');
511
+ });
512
+ }
513
+
514
+ // ============================================================
515
+ // F5 新增:hyperedge 凸包渲染(FR-013 / FR-019)
516
+ // ============================================================
517
+
518
+ // Graham Scan 凸包算法(约 25 行,无外部依赖)
519
+ function convexHull(points) {
520
+ if (points.length < 3) return points.slice();
521
+ // 找最低点(y 最大,svg 坐标系 y 向下)
522
+ var pivot = points.reduce(function(a, b) { return b.y > a.y || (b.y === a.y && b.x < a.x) ? b : a; });
523
+ // 按极角排序
524
+ var sorted = points.filter(function(p) { return p !== pivot; }).sort(function(a, b) {
525
+ var angA = Math.atan2(a.y - pivot.y, a.x - pivot.x);
526
+ var angB = Math.atan2(b.y - pivot.y, b.x - pivot.x);
527
+ if (angA !== angB) return angA - angB;
528
+ // 距离相同极角时,近点先处理(后续会被远点替换)
529
+ var dA = (a.x - pivot.x) * (a.x - pivot.x) + (a.y - pivot.y) * (a.y - pivot.y);
530
+ var dB = (b.x - pivot.x) * (b.x - pivot.x) + (b.y - pivot.y) * (b.y - pivot.y);
531
+ return dA - dB;
532
+ });
533
+ // 构建凸包
534
+ var hull = [pivot];
535
+ for (var i = 0; i < sorted.length; i++) {
536
+ while (hull.length >= 2) {
537
+ var a = hull[hull.length - 2];
538
+ var b = hull[hull.length - 1];
539
+ var c = sorted[i];
540
+ // 叉积判断是否左转(逆时针);> 0 保留共线点,避免凸包退化(P1-4 修复)
541
+ if ((b.x - a.x) * (c.y - a.y) - (b.y - a.y) * (c.x - a.x) > 0) break;
542
+ hull.pop();
543
+ }
544
+ hull.push(sorted[i]);
545
+ }
546
+ return hull;
547
+ }
548
+
549
+ // 将凸包点集转为 SVG path "d" 属性字符串
550
+ function hullToPathD(hull) {
551
+ if (hull.length === 0) return '';
552
+ var d = 'M ' + hull[0].x + ' ' + hull[0].y;
553
+ for (var i = 1; i < hull.length; i++) {
554
+ d += ' L ' + hull[i].x + ' ' + hull[i].y;
555
+ }
556
+ d += ' Z';
557
+ return d;
558
+ }
559
+
560
+ // 渲染所有超边的凸包(在节点位置确定后调用)
561
+ function renderHyperedges(nodePositions) {
562
+ if (!SHOW_HYPEREDGES) return;
563
+ var hyperedges = GRAPH_DATA.hyperedges || [];
564
+ if (hyperedges.length === 0) return;
565
+ var layer = document.getElementById('hyperedges-layer');
566
+ if (!layer) return;
567
+ layer.innerHTML = '';
568
+
569
+ // 超边颜色调色板
570
+ var palette = ['#58a6ff', '#3fb950', '#d29922', '#f85149', '#8957e5', '#f78166'];
571
+
572
+ hyperedges.forEach(function(he, idx) {
573
+ var pts = (he.nodes || []).map(function(nid) {
574
+ return nodePositions.get(nid);
575
+ }).filter(Boolean);
576
+
577
+ // 少于 3 个节点跳过凸包渲染
578
+ if (pts.length < 3) return;
579
+
580
+ var hull = convexHull(pts);
581
+ var color = he.color || palette[idx % palette.length];
582
+
583
+ // 外描边(更宽,半透明)
584
+ var pathOuter = document.createElementNS('http://www.w3.org/2000/svg', 'path');
585
+ pathOuter.setAttribute('d', hullToPathD(hull));
586
+ pathOuter.setAttribute('stroke', color);
587
+ pathOuter.setAttribute('stroke-width', '8');
588
+ pathOuter.setAttribute('stroke-opacity', '0.08');
589
+ pathOuter.setAttribute('fill', color);
590
+ pathOuter.setAttribute('fill-opacity', '0.04');
591
+ pathOuter.setAttribute('stroke-linejoin', 'round');
592
+ layer.appendChild(pathOuter);
593
+
594
+ // 内虚线边框
595
+ var pathEl = document.createElementNS('http://www.w3.org/2000/svg', 'path');
596
+ pathEl.setAttribute('d', hullToPathD(hull));
597
+ pathEl.setAttribute('stroke-dasharray', '6 3');
598
+ pathEl.setAttribute('stroke', color);
599
+ pathEl.setAttribute('stroke-width', '1.5');
600
+ pathEl.setAttribute('fill', 'none');
601
+ pathEl.setAttribute('stroke-linejoin', 'round');
602
+
603
+ // 鼠标悬浮显示 tooltip
604
+ var tooltip = document.getElementById('hyperedge-tooltip');
605
+ pathEl.addEventListener('mouseenter', function(e) {
606
+ if (tooltip) {
607
+ tooltip.textContent = he.label + (he.rationale ? ':' + he.rationale.slice(0, 60) : '');
608
+ tooltip.style.display = 'block';
609
+ tooltip.style.left = (e.clientX + 12) + 'px';
610
+ tooltip.style.top = (e.clientY - 8) + 'px';
611
+ }
612
+ });
613
+ pathEl.addEventListener('mousemove', function(e) {
614
+ if (tooltip) {
615
+ tooltip.style.left = (e.clientX + 12) + 'px';
616
+ tooltip.style.top = (e.clientY - 8) + 'px';
617
+ }
618
+ });
619
+ pathEl.addEventListener('mouseleave', function() {
620
+ if (tooltip) tooltip.style.display = 'none';
621
+ });
622
+ layer.appendChild(pathEl);
623
+ });
624
+ }
625
+
626
+ // 计算大图模式社区中心(从节点坐标均值推算,无需预计算字段)
627
+ function computeCommunityCenter(nodes) {
628
+ var communityPoints = new Map();
629
+ nodes.forEach(function(n) {
630
+ var cid = n.communityId;
631
+ if (cid == null || cid < 0) return;
632
+ if (!communityPoints.has(cid)) communityPoints.set(cid, []);
633
+ communityPoints.get(cid).push({ x: n.x || 0, y: n.y || 0 });
634
+ });
635
+ var centers = new Map();
636
+ communityPoints.forEach(function(pts, cid) {
637
+ if (pts.length === 0) return;
638
+ var cx = pts.reduce(function(s, p) { return s + p.x; }, 0) / pts.length;
639
+ var cy = pts.reduce(function(s, p) { return s + p.y; }, 0) / pts.length;
640
+ centers.set(cid, { x: cx, y: cy });
641
+ });
642
+ return centers;
643
+ }
644
+
645
+ // 大图静态模式:按社区聚类分配坐标(Radial placement)
646
+ function assignStaticCoords(nodes) {
647
+ var communityMap = new Map();
648
+ nodes.forEach(function(n) {
649
+ var cid = n.communityId != null ? n.communityId : -1;
650
+ if (!communityMap.has(cid)) communityMap.set(cid, []);
651
+ communityMap.get(cid).push(n);
652
+ });
653
+
654
+ var communityIds = Array.from(communityMap.keys());
655
+ var commCount = communityIds.length;
656
+ var radius = Math.min(400, 100 + commCount * 30);
657
+
658
+ communityIds.forEach(function(cid, ci) {
659
+ var members = communityMap.get(cid);
660
+ var angle = (ci / commCount) * 2 * Math.PI;
661
+ var cx = radius * Math.cos(angle);
662
+ var cy = radius * Math.sin(angle);
663
+ var r2 = Math.max(20, Math.sqrt(members.length) * 15);
664
+ members.forEach(function(n, ni) {
665
+ var a2 = (ni / members.length) * 2 * Math.PI;
666
+ n.x = cx + r2 * Math.cos(a2);
667
+ n.y = cy + r2 * Math.sin(a2);
668
+ n.fx = n.x;
669
+ n.fy = n.y;
670
+ });
671
+ });
672
+ }
673
+
674
+ function main() {
675
+ initStats(); buildLegend(); buildHyperedgeLegend(); initSearch(); initZoomPan();
676
+ var nodes = GRAPH_DATA.nodes;
677
+ var links = GRAPH_DATA.links;
678
+
679
+ // Q3 锁定:< FORCE_THRESHOLD 使用力导向,>= FORCE_THRESHOLD 静态坐标
680
+ var isLarge = nodes.length >= FORCE_THRESHOLD;
681
+ var linkEls = renderLinks(links);
682
+ var nodeEls = renderNodes(nodes);
683
+
684
+ if (isLarge) {
685
+ // 显示大图横幅(FR-023)
686
+ var banner = document.getElementById('large-graph-banner');
687
+ if (banner) banner.style.display = 'block';
688
+ var countEl = document.getElementById('banner-node-count');
689
+ if (countEl) countEl.textContent = String(nodes.length);
690
+
691
+ // 按社区分配静态坐标(若 fx/fy 已有值则使用,否则计算)
692
+ var hasFxFy = nodes.some(function(n) { return n.fx != null || n.fy != null; });
693
+ if (!hasFxFy) {
694
+ assignStaticCoords(nodes);
695
+ } else {
696
+ var nodeById = new Map(nodes.map(function(n) { return [n.id, n]; }));
697
+ nodes.forEach(function(n) { n.x = n.fx || 0; n.y = n.fy || 0; });
698
+ links.forEach(function(link) {
699
+ var s = nodeById.get(link.source); var t = nodeById.get(link.target);
700
+ if (s) link.source = s; if (t) link.target = t;
701
+ });
702
+ }
703
+ updateNodes(nodeEls); updateLinks(linkEls, links);
704
+ // 渲染超边凸包(静态坐标已确定)
705
+ var nodePositions = new Map(nodes.map(function(n) { return [n.id, { x: n.x || 0, y: n.y || 0 }]; }));
706
+ renderHyperedges(nodePositions);
707
+ centerGraph();
708
+ } else {
709
+ // 500-2000 节点区间:额外调参加速稳定(R4 缓解)
710
+ var alphaDecayVal = nodes.length > 500 ? 0.05 : 0.0228;
711
+ var chargeStrength = nodes.length > 500 ? -80 : -150;
712
+
713
+ var sim = d3.forceSimulation(nodes)
714
+ .force('link', d3.forceLink(links).id(function(d) { return d.id; }).distance(60).strength(0.5))
715
+ .force('charge', d3.forceManyBody().strength(chargeStrength))
716
+ .force('center', d3.forceCenter(0, 0))
717
+ .force('collision', d3.forceCollide().radius(function(d) { return (d.radius || 6) + 4; }))
718
+ .alphaDecay(alphaDecayVal);
719
+
720
+ sim.on('tick', function() { updateNodes(nodeEls); updateLinks(linkEls, links); });
721
+ sim.on('end', function() {
722
+ // 力导向完成后渲染超边凸包
723
+ var nodePositions = new Map(nodes.map(function(n) { return [n.id, { x: n.x || 0, y: n.y || 0 }]; }));
724
+ renderHyperedges(nodePositions);
725
+ centerGraph();
726
+ });
727
+ }
728
+ }
729
+
730
+ if (document.readyState === 'loading') { document.addEventListener('DOMContentLoaded', main); }
731
+ else { main(); }
732
+ })();
733
+ </script>
734
+ </body>
735
+ </html>`;
736
+ }
737
+ //# sourceMappingURL=html-template.js.map