cgraphx 1.4.3 → 2.0.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 (1309) hide show
  1. package/LICENSE +1 -1
  2. package/README.en.md +126 -0
  3. package/README.md +78 -196
  4. package/dist/.claude-template/.cgraphx/timeline-current-turn.json +1 -0
  5. package/dist/.claude-template/CLAUDE.md +10 -0
  6. package/dist/.claude-template/FLOW-MAP.md +107 -0
  7. package/dist/.claude-template/agents/knowledge-recall.md +11 -17
  8. package/dist/.claude-template/commands/my-query.md +1 -1
  9. package/dist/.claude-template/deprecated-assets.json +11 -0
  10. package/dist/.claude-template/hooks/precommit-check/precommit-check.cjs +27 -24
  11. package/dist/.claude-template/skills/.cgraphx/timeline-current-turn.json +1 -0
  12. package/dist/.claude-template/skills/cgraphx-guide/SKILL.md +22 -24
  13. package/dist/.claude-template/skills/cgraphx-guide/how-to-use.html +273 -156
  14. package/dist/.claude-template/skills/cgraphx-guide/how-to-use.md +148 -86
  15. package/dist/.claude-template/skills/clarify-requirements/SKILL.md +75 -384
  16. package/dist/.claude-template/skills/developer-timeline/SKILL.md +3 -2
  17. package/dist/.claude-template/skills/export-table-ddl/SKILL.md +3 -2
  18. package/dist/.claude-template/skills/handdrawn-deck/.cgraphx/timeline-current-turn.json +1 -0
  19. package/dist/.claude-template/skills/handdrawn-deck/SKILL.md +305 -0
  20. package/dist/.claude-template/skills/handdrawn-deck/references/.cgraphx/timeline-current-turn.json +1 -0
  21. package/dist/.claude-template/skills/handdrawn-deck/references/deck-template.html +469 -0
  22. package/dist/.claude-template/skills/handdrawn-deck/references/gen-script-md.cjs +44 -0
  23. package/dist/.claude-template/skills/handdrawn-deck/references/seg.cjs +54 -0
  24. package/dist/.claude-template/skills/handdrawn-sketch-engine/.cgraphx/timeline-current-turn.json +1 -0
  25. package/dist/.claude-template/skills/handdrawn-sketch-engine/SKILL.md +279 -0
  26. package/dist/.claude-template/skills/handdrawn-sketch-engine/assets/icon-library.js +238 -0
  27. package/dist/.claude-template/skills/handdrawn-sketch-engine/references/engine-template.html +275 -0
  28. package/dist/.claude-template/skills/handdrawn-sketch-engine/references/reference-render.html +445 -0
  29. package/dist/.claude-template/skills/implementation/SKILL.md +36 -130
  30. package/dist/.claude-template/skills/init-project-guides/SKILL.md +81 -0
  31. package/dist/.claude-template/skills/init-project-guides/templates/git-standards.md +37 -0
  32. package/dist/.claude-template/skills/init-project-guides/templates/go.md +160 -0
  33. package/dist/.claude-template/skills/init-project-guides/templates/java.md +173 -0
  34. package/dist/.claude-template/skills/init-project-guides/templates/schema-convention.md +11 -0
  35. package/dist/.claude-template/skills/init-project-guides/templates/typescript.md +156 -0
  36. package/dist/.claude-template/skills/knowledge-api/SKILL.md +143 -0
  37. package/dist/.claude-template/skills/knowledge-api/agent-prompt.md +51 -0
  38. package/dist/.claude-template/skills/knowledge-init/SKILL.md +761 -0
  39. package/dist/.claude-template/skills/knowledge-migrate/SKILL.md +173 -0
  40. package/dist/.claude-template/skills/knowledge-recall/SKILL.md +5 -4
  41. package/dist/.claude-template/skills/knowledge-write/SKILL.md +126 -0
  42. package/dist/.claude-template/skills/knowledge-write/template-concept.md +95 -0
  43. package/dist/.claude-template/skills/knowledge-write/template-flow.md +100 -0
  44. package/dist/.claude-template/skills/knowledge-write/template-guide.md +77 -0
  45. package/dist/.claude-template/skills/knowledge-write/template-memory.md +61 -0
  46. package/dist/.claude-template/skills/run-api-test/SKILL.md +6 -4
  47. package/dist/.claude-template/skills/run-api-test/assets/template-test-report.md +448 -55
  48. package/dist/.claude-template/skills/run-api-test/assets/template-test-verify.jsonl +5 -5
  49. package/dist/.claude-template/skills/run-api-test/references/report-format.md +54 -19
  50. package/dist/.claude-template/skills/subagent-implement/SKILL.md +60 -183
  51. package/dist/.claude-template/skills/subagent-implement/implementer-prompt.md +9 -4
  52. package/dist/.claude-template/skills/subagent-implement/quality-reviewer-prompt.md +1 -1
  53. package/dist/.claude-template/skills/subagent-implement/spec-reviewer-prompt.md +1 -0
  54. package/dist/.claude-template/skills/write-api/SKILL.md +7 -5
  55. package/dist/.claude-template/skills/write-api/assets/template-api-spec.md +2 -3
  56. package/dist/.claude-template/skills/write-api/assets/template-request.bru +21 -0
  57. package/dist/.claude-template/skills/write-api/references/ai-prompts.md +1 -2
  58. package/dist/.claude-template/skills/write-api/references/api-spec-format.md +0 -1
  59. package/dist/.claude-template/skills/write-api-doc/SKILL.md +8 -7
  60. package/dist/.claude-template/skills/write-design-doc/SKILL.md +86 -0
  61. package/dist/.claude-template/skills/write-design-doc/template-design-html.md +357 -0
  62. package/dist/.claude-template/skills/write-design-doc/template-design-md.md +164 -0
  63. package/dist/.claude-template/skills/write-plan/SKILL.md +94 -291
  64. package/dist/.claude-template/skills/write-plan/plan-document-reviewer-prompt.md +24 -6
  65. package/dist/.claude-template/skills/write-prd/SKILL.md +4 -2
  66. package/dist/.claude-template/skills/write-spec/SKILL.md +75 -282
  67. package/dist/.claude-template/skills/write-unit-test-code/SKILL.md +87 -2
  68. package/dist/.claude-template/skills/write-workload/SKILL.md +130 -0
  69. package/dist/cli/fatal-handler.d.ts +21 -0
  70. package/dist/cli/fatal-handler.d.ts.map +1 -0
  71. package/dist/cli/fatal-handler.js +109 -0
  72. package/dist/cli/fatal-handler.js.map +1 -0
  73. package/dist/cli/index.d.ts +27 -0
  74. package/dist/cli/index.d.ts.map +1 -0
  75. package/dist/cli/index.js +284 -0
  76. package/dist/cli/index.js.map +1 -0
  77. package/dist/cli/installer/claude-assets.d.ts +101 -0
  78. package/dist/cli/installer/claude-assets.d.ts.map +1 -0
  79. package/dist/cli/installer/claude-assets.js +321 -0
  80. package/dist/cli/installer/claude-assets.js.map +1 -0
  81. package/dist/cli/installer/index.d.ts +103 -0
  82. package/dist/cli/installer/index.d.ts.map +1 -0
  83. package/dist/cli/installer/index.js +526 -0
  84. package/dist/cli/installer/index.js.map +1 -0
  85. package/dist/cli/installer/targets/claude.d.ts +56 -0
  86. package/dist/cli/installer/targets/claude.d.ts.map +1 -0
  87. package/dist/cli/installer/targets/claude.js +497 -0
  88. package/dist/cli/installer/targets/claude.js.map +1 -0
  89. package/dist/cli/installer/targets/registry.d.ts +32 -0
  90. package/dist/cli/installer/targets/registry.d.ts.map +1 -0
  91. package/dist/cli/installer/targets/registry.js +72 -0
  92. package/dist/cli/installer/targets/registry.js.map +1 -0
  93. package/dist/cli/installer/targets/shared.d.ts +66 -0
  94. package/dist/cli/installer/targets/shared.d.ts.map +1 -0
  95. package/dist/cli/installer/targets/shared.js +228 -0
  96. package/dist/cli/installer/targets/shared.js.map +1 -0
  97. package/dist/cli/installer/targets/types.d.ts +96 -0
  98. package/dist/cli/installer/targets/types.d.ts.map +1 -0
  99. package/dist/cli/installer/targets/types.js +15 -0
  100. package/dist/cli/installer/targets/types.js.map +1 -0
  101. package/dist/cli/node-version-check.d.ts +32 -0
  102. package/dist/cli/node-version-check.d.ts.map +1 -0
  103. package/dist/cli/node-version-check.js +54 -0
  104. package/dist/cli/node-version-check.js.map +1 -0
  105. package/dist/cli/ui/glyphs.d.ts +43 -0
  106. package/dist/cli/ui/glyphs.d.ts.map +1 -0
  107. package/dist/cli/ui/glyphs.js +79 -0
  108. package/dist/cli/ui/glyphs.js.map +1 -0
  109. package/dist/cli/uninstall.d.ts +18 -0
  110. package/dist/cli/uninstall.d.ts.map +1 -0
  111. package/dist/cli/uninstall.js +19 -0
  112. package/dist/cli/uninstall.js.map +1 -0
  113. package/dist/cli/upgrade/index.d.ts +149 -0
  114. package/dist/cli/upgrade/index.d.ts.map +1 -0
  115. package/dist/cli/upgrade/index.js +395 -0
  116. package/dist/cli/upgrade/index.js.map +1 -0
  117. package/dist/core/db/index.d.ts +123 -0
  118. package/dist/core/db/index.d.ts.map +1 -0
  119. package/dist/core/db/index.js +260 -0
  120. package/dist/core/db/index.js.map +1 -0
  121. package/dist/core/db/migrate.d.ts +29 -0
  122. package/dist/core/db/migrate.d.ts.map +1 -0
  123. package/dist/core/db/migrate.js +100 -0
  124. package/dist/core/db/migrate.js.map +1 -0
  125. package/dist/core/db/sqlite-adapter.d.ts +51 -0
  126. package/dist/core/db/sqlite-adapter.d.ts.map +1 -0
  127. package/dist/core/db/sqlite-adapter.js +116 -0
  128. package/dist/core/db/sqlite-adapter.js.map +1 -0
  129. package/dist/core/dbquery/cli.d.ts +17 -0
  130. package/dist/core/dbquery/cli.d.ts.map +1 -0
  131. package/dist/core/dbquery/cli.js +246 -0
  132. package/dist/core/dbquery/cli.js.map +1 -0
  133. package/dist/core/dbquery/config.d.ts.map +1 -0
  134. package/dist/core/dbquery/config.js.map +1 -0
  135. package/dist/core/dbquery/constants.d.ts.map +1 -0
  136. package/dist/core/dbquery/constants.js.map +1 -0
  137. package/dist/core/dbquery/drivers/mysql.d.ts.map +1 -0
  138. package/dist/core/dbquery/drivers/mysql.js.map +1 -0
  139. package/dist/core/dbquery/drivers/postgres.d.ts.map +1 -0
  140. package/dist/core/dbquery/drivers/postgres.js.map +1 -0
  141. package/dist/core/dbquery/errors.d.ts +40 -0
  142. package/dist/core/dbquery/errors.d.ts.map +1 -0
  143. package/dist/core/dbquery/errors.js +85 -0
  144. package/dist/core/dbquery/errors.js.map +1 -0
  145. package/dist/core/dbquery/executor.d.ts.map +1 -0
  146. package/dist/core/dbquery/executor.js.map +1 -0
  147. package/dist/core/dbquery/format.d.ts.map +1 -0
  148. package/dist/core/dbquery/format.js.map +1 -0
  149. package/dist/core/dbquery/identifiers.d.ts.map +1 -0
  150. package/dist/core/dbquery/identifiers.js.map +1 -0
  151. package/dist/core/dbquery/index.d.ts.map +1 -0
  152. package/dist/core/dbquery/index.js.map +1 -0
  153. package/dist/core/dbquery/init.d.ts +33 -0
  154. package/dist/core/dbquery/init.d.ts.map +1 -0
  155. package/dist/core/dbquery/init.js +125 -0
  156. package/dist/core/dbquery/init.js.map +1 -0
  157. package/dist/core/dbquery/logging.d.ts.map +1 -0
  158. package/dist/core/dbquery/logging.js.map +1 -0
  159. package/dist/core/dbquery/queries.d.ts.map +1 -0
  160. package/dist/core/dbquery/queries.js.map +1 -0
  161. package/dist/core/dbquery/safety.d.ts.map +1 -0
  162. package/dist/core/dbquery/safety.js.map +1 -0
  163. package/dist/core/dbquery/types.d.ts +139 -0
  164. package/dist/core/dbquery/types.d.ts.map +1 -0
  165. package/dist/core/dbquery/types.js +10 -0
  166. package/dist/core/dbquery/types.js.map +1 -0
  167. package/dist/core/directory.d.ts +60 -0
  168. package/dist/core/directory.d.ts.map +1 -0
  169. package/dist/core/directory.js +243 -0
  170. package/dist/core/directory.js.map +1 -0
  171. package/dist/core/errors.d.ts +79 -0
  172. package/dist/core/errors.d.ts.map +1 -0
  173. package/dist/core/errors.js +133 -0
  174. package/dist/core/errors.js.map +1 -0
  175. package/dist/core/features/cli.d.ts +12 -0
  176. package/dist/core/features/cli.d.ts.map +1 -0
  177. package/dist/core/features/cli.js +154 -0
  178. package/dist/core/features/cli.js.map +1 -0
  179. package/dist/core/features/index.d.ts +15 -0
  180. package/dist/core/features/index.d.ts.map +1 -0
  181. package/dist/core/features/index.js +39 -0
  182. package/dist/core/features/index.js.map +1 -0
  183. package/dist/core/features/scanner.d.ts +26 -0
  184. package/dist/core/features/scanner.d.ts.map +1 -0
  185. package/dist/core/features/scanner.js +198 -0
  186. package/dist/core/features/scanner.js.map +1 -0
  187. package/dist/core/features/sync.d.ts +26 -0
  188. package/dist/core/features/sync.d.ts.map +1 -0
  189. package/dist/core/features/sync.js +108 -0
  190. package/dist/core/features/sync.js.map +1 -0
  191. package/dist/core/features/types.d.ts +35 -0
  192. package/dist/core/features/types.d.ts.map +1 -0
  193. package/dist/core/features/types.js +12 -0
  194. package/dist/core/features/types.js.map +1 -0
  195. package/dist/core/markdown/cli.d.ts +16 -0
  196. package/dist/core/markdown/cli.d.ts.map +1 -0
  197. package/dist/core/markdown/cli.js +575 -0
  198. package/dist/core/markdown/cli.js.map +1 -0
  199. package/dist/core/markdown/constants.d.ts +22 -0
  200. package/dist/core/markdown/constants.d.ts.map +1 -0
  201. package/dist/core/markdown/constants.js +61 -0
  202. package/dist/core/markdown/constants.js.map +1 -0
  203. package/dist/core/markdown/dedup.d.ts.map +1 -0
  204. package/dist/core/markdown/dedup.js.map +1 -0
  205. package/dist/core/markdown/errors.d.ts +22 -0
  206. package/dist/core/markdown/errors.d.ts.map +1 -0
  207. package/dist/core/markdown/errors.js +45 -0
  208. package/dist/core/markdown/errors.js.map +1 -0
  209. package/dist/core/markdown/extractor.d.ts.map +1 -0
  210. package/dist/core/markdown/extractor.js.map +1 -0
  211. package/dist/core/markdown/frontmatter-parser.d.ts +54 -0
  212. package/dist/core/markdown/frontmatter-parser.d.ts.map +1 -0
  213. package/dist/core/markdown/frontmatter-parser.js +229 -0
  214. package/dist/core/markdown/frontmatter-parser.js.map +1 -0
  215. package/dist/core/markdown/index.d.ts +21 -0
  216. package/dist/core/markdown/index.d.ts.map +1 -0
  217. package/dist/core/markdown/index.js +36 -0
  218. package/dist/core/markdown/index.js.map +1 -0
  219. package/dist/core/markdown/indexer.d.ts +34 -0
  220. package/dist/core/markdown/indexer.d.ts.map +1 -0
  221. package/dist/core/markdown/indexer.js +256 -0
  222. package/dist/core/markdown/indexer.js.map +1 -0
  223. package/dist/core/markdown/query-dedup.d.ts +23 -0
  224. package/dist/core/markdown/query-dedup.d.ts.map +1 -0
  225. package/dist/core/markdown/query-dedup.js +141 -0
  226. package/dist/core/markdown/query-dedup.js.map +1 -0
  227. package/dist/core/markdown/query-helpers.d.ts +66 -0
  228. package/dist/core/markdown/query-helpers.d.ts.map +1 -0
  229. package/dist/core/markdown/query-helpers.js +334 -0
  230. package/dist/core/markdown/query-helpers.js.map +1 -0
  231. package/dist/core/markdown/query.d.ts +125 -0
  232. package/dist/core/markdown/query.d.ts.map +1 -0
  233. package/dist/core/markdown/query.js +367 -0
  234. package/dist/core/markdown/query.js.map +1 -0
  235. package/dist/core/markdown/schema-bootstrap.d.ts +40 -0
  236. package/dist/core/markdown/schema-bootstrap.d.ts.map +1 -0
  237. package/dist/core/markdown/schema-bootstrap.js +85 -0
  238. package/dist/core/markdown/schema-bootstrap.js.map +1 -0
  239. package/dist/core/markdown/schema.sql +124 -0
  240. package/dist/core/markdown/store.d.ts.map +1 -0
  241. package/dist/core/markdown/store.js.map +1 -0
  242. package/dist/core/markdown/summary-extractor.d.ts.map +1 -0
  243. package/dist/core/markdown/summary-extractor.js.map +1 -0
  244. package/dist/core/markdown/types.d.ts +186 -0
  245. package/dist/core/markdown/types.d.ts.map +1 -0
  246. package/dist/core/markdown/types.js.map +1 -0
  247. package/dist/core/markdown/validator.d.ts +44 -0
  248. package/dist/core/markdown/validator.d.ts.map +1 -0
  249. package/dist/core/markdown/validator.js +95 -0
  250. package/dist/core/markdown/validator.js.map +1 -0
  251. package/dist/core/timeline/bash-semantics.d.ts.map +1 -0
  252. package/dist/core/timeline/bash-semantics.js.map +1 -0
  253. package/dist/core/timeline/cli.d.ts.map +1 -0
  254. package/dist/core/timeline/cli.js.map +1 -0
  255. package/dist/core/timeline/constants.d.ts +62 -0
  256. package/dist/core/timeline/constants.d.ts.map +1 -0
  257. package/dist/core/timeline/constants.js +73 -0
  258. package/dist/core/timeline/constants.js.map +1 -0
  259. package/dist/core/timeline/errors.d.ts.map +1 -0
  260. package/dist/core/timeline/errors.js.map +1 -0
  261. package/dist/core/timeline/hook-runner.d.ts.map +1 -0
  262. package/dist/core/timeline/hook-runner.js.map +1 -0
  263. package/dist/core/timeline/hooks.d.ts.map +1 -0
  264. package/dist/core/timeline/hooks.js.map +1 -0
  265. package/dist/core/timeline/index.d.ts.map +1 -0
  266. package/dist/core/timeline/index.js.map +1 -0
  267. package/dist/core/timeline/indexer.d.ts.map +1 -0
  268. package/dist/core/timeline/indexer.js.map +1 -0
  269. package/dist/core/timeline/installer.d.ts.map +1 -0
  270. package/dist/core/timeline/installer.js.map +1 -0
  271. package/dist/core/timeline/payload.d.ts.map +1 -0
  272. package/dist/core/timeline/payload.js.map +1 -0
  273. package/dist/core/timeline/post-tool-summary.d.ts.map +1 -0
  274. package/dist/core/timeline/post-tool-summary.js.map +1 -0
  275. package/dist/core/timeline/recorder.d.ts.map +1 -0
  276. package/dist/core/timeline/recorder.js.map +1 -0
  277. package/dist/core/timeline/schema-bootstrap.d.ts +42 -0
  278. package/dist/core/timeline/schema-bootstrap.d.ts.map +1 -0
  279. package/dist/core/timeline/schema-bootstrap.js +81 -0
  280. package/dist/core/timeline/schema-bootstrap.js.map +1 -0
  281. package/dist/core/timeline/store.d.ts.map +1 -0
  282. package/dist/core/timeline/store.js.map +1 -0
  283. package/dist/core/timeline/types.d.ts.map +1 -0
  284. package/dist/core/timeline/types.js.map +1 -0
  285. package/dist/core/types.d.ts +25 -0
  286. package/dist/core/types.d.ts.map +1 -0
  287. package/dist/core/types.js +12 -0
  288. package/dist/core/types.js.map +1 -0
  289. package/dist/web/bootstrap.d.ts +26 -0
  290. package/dist/web/bootstrap.d.ts.map +1 -0
  291. package/dist/web/bootstrap.js +98 -0
  292. package/dist/web/bootstrap.js.map +1 -0
  293. package/dist/web/constants.d.ts +27 -0
  294. package/dist/web/constants.d.ts.map +1 -0
  295. package/dist/web/constants.js +41 -0
  296. package/dist/web/constants.js.map +1 -0
  297. package/dist/web/errors.d.ts +46 -0
  298. package/dist/web/errors.d.ts.map +1 -0
  299. package/dist/web/errors.js +56 -0
  300. package/dist/web/errors.js.map +1 -0
  301. package/dist/web/index.d.ts +13 -0
  302. package/dist/web/index.d.ts.map +1 -0
  303. package/dist/web/index.js +20 -0
  304. package/dist/web/index.js.map +1 -0
  305. package/dist/web/layout.d.ts +31 -0
  306. package/dist/web/layout.d.ts.map +1 -0
  307. package/dist/web/layout.js +77 -0
  308. package/dist/web/layout.js.map +1 -0
  309. package/dist/web/markdown.d.ts +23 -0
  310. package/dist/web/markdown.d.ts.map +1 -0
  311. package/dist/web/markdown.js +38 -0
  312. package/dist/web/markdown.js.map +1 -0
  313. package/dist/web/overview-templates.d.ts +123 -0
  314. package/dist/web/overview-templates.d.ts.map +1 -0
  315. package/dist/web/overview-templates.js +213 -0
  316. package/dist/web/overview-templates.js.map +1 -0
  317. package/dist/web/pages-detail.d.ts +32 -0
  318. package/dist/web/pages-detail.d.ts.map +1 -0
  319. package/dist/web/pages-detail.js +275 -0
  320. package/dist/web/pages-detail.js.map +1 -0
  321. package/dist/web/pages-overview.d.ts +60 -0
  322. package/dist/web/pages-overview.d.ts.map +1 -0
  323. package/dist/web/pages-overview.js +304 -0
  324. package/dist/web/pages-overview.js.map +1 -0
  325. package/dist/web/public/app.css +1772 -0
  326. package/dist/web/public/app.js +41 -0
  327. package/dist/web/register.d.ts +12 -0
  328. package/dist/web/register.d.ts.map +1 -0
  329. package/dist/web/register.js +88 -0
  330. package/dist/web/register.js.map +1 -0
  331. package/dist/web/render-utils.d.ts +28 -0
  332. package/dist/web/render-utils.d.ts.map +1 -0
  333. package/dist/web/render-utils.js +54 -0
  334. package/dist/web/render-utils.js.map +1 -0
  335. package/dist/web/server.d.ts +42 -0
  336. package/dist/web/server.d.ts.map +1 -0
  337. package/dist/web/server.js +292 -0
  338. package/dist/web/server.js.map +1 -0
  339. package/package.json +14 -27
  340. package/scripts/copy-assets.cjs +89 -0
  341. package/dist/.claude-template/commands/my-commit.md +0 -9
  342. package/dist/.claude-template/skills/cgraphx/SKILL.md +0 -143
  343. package/dist/.claude-template/skills/cgraphx/agent-prompt.md +0 -56
  344. package/dist/.claude-template/skills/code-impact-api/SKILL.md +0 -143
  345. package/dist/.claude-template/skills/code-impact-api/agent-prompt.md +0 -51
  346. package/dist/.claude-template/skills/code-impact-docgen/SKILL.md +0 -376
  347. package/dist/.claude-template/skills/code-impact-docgen/template-design-html.md +0 -357
  348. package/dist/.claude-template/skills/code-impact-docgen/template-design-md.md +0 -164
  349. package/dist/.claude-template/skills/code-impact-init/SKILL.md +0 -803
  350. package/dist/.claude-template/skills/code-impact-markdown/SKILL.md +0 -353
  351. package/dist/.claude-template/skills/code-impact-markdown/template-guide.md +0 -68
  352. package/dist/.claude-template/skills/code-impact-markdown/template-memory.md +0 -82
  353. package/dist/.claude-template/skills/code-impact-markdown/template-runbook.md +0 -58
  354. package/dist/.claude-template/skills/precommit-review/SKILL.md +0 -50
  355. package/dist/api-test/ai-fields.d.ts +0 -37
  356. package/dist/api-test/ai-fields.d.ts.map +0 -1
  357. package/dist/api-test/ai-fields.js +0 -114
  358. package/dist/api-test/ai-fields.js.map +0 -1
  359. package/dist/api-test/assemble.d.ts +0 -76
  360. package/dist/api-test/assemble.d.ts.map +0 -1
  361. package/dist/api-test/assemble.js +0 -185
  362. package/dist/api-test/assemble.js.map +0 -1
  363. package/dist/api-test/bru-cli-invoker.d.ts +0 -72
  364. package/dist/api-test/bru-cli-invoker.d.ts.map +0 -1
  365. package/dist/api-test/bru-cli-invoker.js +0 -169
  366. package/dist/api-test/bru-cli-invoker.js.map +0 -1
  367. package/dist/api-test/bru-report-parser.d.ts +0 -24
  368. package/dist/api-test/bru-report-parser.d.ts.map +0 -1
  369. package/dist/api-test/bru-report-parser.js +0 -110
  370. package/dist/api-test/bru-report-parser.js.map +0 -1
  371. package/dist/api-test/bru-runner.d.ts +0 -101
  372. package/dist/api-test/bru-runner.d.ts.map +0 -1
  373. package/dist/api-test/bru-runner.js +0 -316
  374. package/dist/api-test/bru-runner.js.map +0 -1
  375. package/dist/api-test/bru-writer.d.ts +0 -52
  376. package/dist/api-test/bru-writer.d.ts.map +0 -1
  377. package/dist/api-test/bru-writer.js +0 -159
  378. package/dist/api-test/bru-writer.js.map +0 -1
  379. package/dist/api-test/call-chain-extractor.d.ts +0 -80
  380. package/dist/api-test/call-chain-extractor.d.ts.map +0 -1
  381. package/dist/api-test/call-chain-extractor.js +0 -179
  382. package/dist/api-test/call-chain-extractor.js.map +0 -1
  383. package/dist/api-test/cli.d.ts +0 -133
  384. package/dist/api-test/cli.d.ts.map +0 -1
  385. package/dist/api-test/cli.js +0 -1009
  386. package/dist/api-test/cli.js.map +0 -1
  387. package/dist/api-test/config.d.ts +0 -75
  388. package/dist/api-test/config.d.ts.map +0 -1
  389. package/dist/api-test/config.js +0 -406
  390. package/dist/api-test/config.js.map +0 -1
  391. package/dist/api-test/db-query-cli.d.ts +0 -51
  392. package/dist/api-test/db-query-cli.d.ts.map +0 -1
  393. package/dist/api-test/db-query-cli.js +0 -119
  394. package/dist/api-test/db-query-cli.js.map +0 -1
  395. package/dist/api-test/enhance-prepare.d.ts +0 -111
  396. package/dist/api-test/enhance-prepare.d.ts.map +0 -1
  397. package/dist/api-test/enhance-prepare.js +0 -425
  398. package/dist/api-test/enhance-prepare.js.map +0 -1
  399. package/dist/api-test/enhance-write.d.ts +0 -28
  400. package/dist/api-test/enhance-write.d.ts.map +0 -1
  401. package/dist/api-test/enhance-write.js +0 -145
  402. package/dist/api-test/enhance-write.js.map +0 -1
  403. package/dist/api-test/errors.d.ts +0 -48
  404. package/dist/api-test/errors.d.ts.map +0 -1
  405. package/dist/api-test/errors.js +0 -76
  406. package/dist/api-test/errors.js.map +0 -1
  407. package/dist/api-test/field-extractor.d.ts +0 -98
  408. package/dist/api-test/field-extractor.d.ts.map +0 -1
  409. package/dist/api-test/field-extractor.js +0 -327
  410. package/dist/api-test/field-extractor.js.map +0 -1
  411. package/dist/api-test/impl-finder.d.ts +0 -37
  412. package/dist/api-test/impl-finder.d.ts.map +0 -1
  413. package/dist/api-test/impl-finder.js +0 -54
  414. package/dist/api-test/impl-finder.js.map +0 -1
  415. package/dist/api-test/index.d.ts +0 -41
  416. package/dist/api-test/index.d.ts.map +0 -1
  417. package/dist/api-test/index.js +0 -124
  418. package/dist/api-test/index.js.map +0 -1
  419. package/dist/api-test/java-parser.d.ts +0 -89
  420. package/dist/api-test/java-parser.d.ts.map +0 -1
  421. package/dist/api-test/java-parser.js +0 -508
  422. package/dist/api-test/java-parser.js.map +0 -1
  423. package/dist/api-test/md-writer.d.ts +0 -49
  424. package/dist/api-test/md-writer.d.ts.map +0 -1
  425. package/dist/api-test/md-writer.js +0 -202
  426. package/dist/api-test/md-writer.js.map +0 -1
  427. package/dist/api-test/parser-httpservice.d.ts +0 -91
  428. package/dist/api-test/parser-httpservice.d.ts.map +0 -1
  429. package/dist/api-test/parser-httpservice.js +0 -271
  430. package/dist/api-test/parser-httpservice.js.map +0 -1
  431. package/dist/api-test/report.d.ts +0 -188
  432. package/dist/api-test/report.d.ts.map +0 -1
  433. package/dist/api-test/report.js +0 -522
  434. package/dist/api-test/report.js.map +0 -1
  435. package/dist/api-test/snapshot.d.ts +0 -26
  436. package/dist/api-test/snapshot.d.ts.map +0 -1
  437. package/dist/api-test/snapshot.js +0 -150
  438. package/dist/api-test/snapshot.js.map +0 -1
  439. package/dist/api-test/test-history.d.ts +0 -48
  440. package/dist/api-test/test-history.d.ts.map +0 -1
  441. package/dist/api-test/test-history.js +0 -122
  442. package/dist/api-test/test-history.js.map +0 -1
  443. package/dist/api-test/types.d.ts +0 -174
  444. package/dist/api-test/types.d.ts.map +0 -1
  445. package/dist/api-test/types.js +0 -13
  446. package/dist/api-test/types.js.map +0 -1
  447. package/dist/api-test/verify-prepare.d.ts +0 -30
  448. package/dist/api-test/verify-prepare.d.ts.map +0 -1
  449. package/dist/api-test/verify-prepare.js +0 -150
  450. package/dist/api-test/verify-prepare.js.map +0 -1
  451. package/dist/api-test/verify-write.d.ts +0 -31
  452. package/dist/api-test/verify-write.d.ts.map +0 -1
  453. package/dist/api-test/verify-write.js +0 -159
  454. package/dist/api-test/verify-write.js.map +0 -1
  455. package/dist/bin/codegraph.d.ts +0 -26
  456. package/dist/bin/codegraph.d.ts.map +0 -1
  457. package/dist/bin/codegraph.js +0 -1914
  458. package/dist/bin/codegraph.js.map +0 -1
  459. package/dist/bin/fatal-handler.d.ts +0 -20
  460. package/dist/bin/fatal-handler.d.ts.map +0 -1
  461. package/dist/bin/fatal-handler.js +0 -118
  462. package/dist/bin/fatal-handler.js.map +0 -1
  463. package/dist/bin/node-version-check.d.ts +0 -51
  464. package/dist/bin/node-version-check.d.ts.map +0 -1
  465. package/dist/bin/node-version-check.js +0 -114
  466. package/dist/bin/node-version-check.js.map +0 -1
  467. package/dist/bin/uninstall.d.ts +0 -14
  468. package/dist/bin/uninstall.d.ts.map +0 -1
  469. package/dist/bin/uninstall.js +0 -36
  470. package/dist/bin/uninstall.js.map +0 -1
  471. package/dist/context/formatter.d.ts +0 -30
  472. package/dist/context/formatter.d.ts.map +0 -1
  473. package/dist/context/formatter.js +0 -263
  474. package/dist/context/formatter.js.map +0 -1
  475. package/dist/context/index.d.ts +0 -119
  476. package/dist/context/index.d.ts.map +0 -1
  477. package/dist/context/index.js +0 -1296
  478. package/dist/context/index.js.map +0 -1
  479. package/dist/context/markers.d.ts +0 -19
  480. package/dist/context/markers.d.ts.map +0 -1
  481. package/dist/context/markers.js +0 -22
  482. package/dist/context/markers.js.map +0 -1
  483. package/dist/db/index.d.ts +0 -122
  484. package/dist/db/index.d.ts.map +0 -1
  485. package/dist/db/index.js +0 -296
  486. package/dist/db/index.js.map +0 -1
  487. package/dist/db/migrations.d.ts +0 -44
  488. package/dist/db/migrations.d.ts.map +0 -1
  489. package/dist/db/migrations.js +0 -140
  490. package/dist/db/migrations.js.map +0 -1
  491. package/dist/db/queries.d.ts +0 -401
  492. package/dist/db/queries.d.ts.map +0 -1
  493. package/dist/db/queries.js +0 -1591
  494. package/dist/db/queries.js.map +0 -1
  495. package/dist/db/schema.sql +0 -152
  496. package/dist/db/sqlite-adapter.d.ts +0 -53
  497. package/dist/db/sqlite-adapter.d.ts.map +0 -1
  498. package/dist/db/sqlite-adapter.js +0 -117
  499. package/dist/db/sqlite-adapter.js.map +0 -1
  500. package/dist/dbquery/cli.d.ts +0 -17
  501. package/dist/dbquery/cli.d.ts.map +0 -1
  502. package/dist/dbquery/cli.js +0 -246
  503. package/dist/dbquery/cli.js.map +0 -1
  504. package/dist/dbquery/config.d.ts.map +0 -1
  505. package/dist/dbquery/config.js.map +0 -1
  506. package/dist/dbquery/constants.d.ts.map +0 -1
  507. package/dist/dbquery/constants.js.map +0 -1
  508. package/dist/dbquery/drivers/mysql.d.ts.map +0 -1
  509. package/dist/dbquery/drivers/mysql.js.map +0 -1
  510. package/dist/dbquery/drivers/postgres.d.ts.map +0 -1
  511. package/dist/dbquery/drivers/postgres.js.map +0 -1
  512. package/dist/dbquery/dump-schema.d.ts +0 -46
  513. package/dist/dbquery/dump-schema.d.ts.map +0 -1
  514. package/dist/dbquery/dump-schema.js +0 -379
  515. package/dist/dbquery/dump-schema.js.map +0 -1
  516. package/dist/dbquery/errors.d.ts +0 -40
  517. package/dist/dbquery/errors.d.ts.map +0 -1
  518. package/dist/dbquery/errors.js +0 -85
  519. package/dist/dbquery/errors.js.map +0 -1
  520. package/dist/dbquery/executor.d.ts.map +0 -1
  521. package/dist/dbquery/executor.js.map +0 -1
  522. package/dist/dbquery/format.d.ts.map +0 -1
  523. package/dist/dbquery/format.js.map +0 -1
  524. package/dist/dbquery/identifiers.d.ts.map +0 -1
  525. package/dist/dbquery/identifiers.js.map +0 -1
  526. package/dist/dbquery/index.d.ts.map +0 -1
  527. package/dist/dbquery/index.js.map +0 -1
  528. package/dist/dbquery/init.d.ts +0 -33
  529. package/dist/dbquery/init.d.ts.map +0 -1
  530. package/dist/dbquery/init.js +0 -125
  531. package/dist/dbquery/init.js.map +0 -1
  532. package/dist/dbquery/logging.d.ts.map +0 -1
  533. package/dist/dbquery/logging.js.map +0 -1
  534. package/dist/dbquery/mcp-tools.d.ts +0 -29
  535. package/dist/dbquery/mcp-tools.d.ts.map +0 -1
  536. package/dist/dbquery/mcp-tools.js +0 -206
  537. package/dist/dbquery/mcp-tools.js.map +0 -1
  538. package/dist/dbquery/queries.d.ts.map +0 -1
  539. package/dist/dbquery/queries.js.map +0 -1
  540. package/dist/dbquery/safety.d.ts.map +0 -1
  541. package/dist/dbquery/safety.js.map +0 -1
  542. package/dist/dbquery/types.d.ts +0 -139
  543. package/dist/dbquery/types.d.ts.map +0 -1
  544. package/dist/dbquery/types.js +0 -10
  545. package/dist/dbquery/types.js.map +0 -1
  546. package/dist/directory.d.ts +0 -147
  547. package/dist/directory.d.ts.map +0 -1
  548. package/dist/directory.js +0 -523
  549. package/dist/directory.js.map +0 -1
  550. package/dist/errors.d.ts +0 -136
  551. package/dist/errors.d.ts.map +0 -1
  552. package/dist/errors.js +0 -219
  553. package/dist/errors.js.map +0 -1
  554. package/dist/extraction/astro-extractor.d.ts +0 -79
  555. package/dist/extraction/astro-extractor.d.ts.map +0 -1
  556. package/dist/extraction/astro-extractor.js +0 -320
  557. package/dist/extraction/astro-extractor.js.map +0 -1
  558. package/dist/extraction/dfm-extractor.d.ts +0 -31
  559. package/dist/extraction/dfm-extractor.d.ts.map +0 -1
  560. package/dist/extraction/dfm-extractor.js +0 -151
  561. package/dist/extraction/dfm-extractor.js.map +0 -1
  562. package/dist/extraction/extraction-version.d.ts +0 -25
  563. package/dist/extraction/extraction-version.d.ts.map +0 -1
  564. package/dist/extraction/extraction-version.js +0 -28
  565. package/dist/extraction/extraction-version.js.map +0 -1
  566. package/dist/extraction/function-ref.d.ts +0 -118
  567. package/dist/extraction/function-ref.d.ts.map +0 -1
  568. package/dist/extraction/function-ref.js +0 -727
  569. package/dist/extraction/function-ref.js.map +0 -1
  570. package/dist/extraction/generated-detection.d.ts +0 -30
  571. package/dist/extraction/generated-detection.d.ts.map +0 -1
  572. package/dist/extraction/generated-detection.js +0 -83
  573. package/dist/extraction/generated-detection.js.map +0 -1
  574. package/dist/extraction/grammars.d.ts +0 -114
  575. package/dist/extraction/grammars.d.ts.map +0 -1
  576. package/dist/extraction/grammars.js +0 -477
  577. package/dist/extraction/grammars.js.map +0 -1
  578. package/dist/extraction/index.d.ts +0 -175
  579. package/dist/extraction/index.d.ts.map +0 -1
  580. package/dist/extraction/index.js +0 -1887
  581. package/dist/extraction/index.js.map +0 -1
  582. package/dist/extraction/languages/c-cpp.d.ts +0 -12
  583. package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
  584. package/dist/extraction/languages/c-cpp.js +0 -275
  585. package/dist/extraction/languages/c-cpp.js.map +0 -1
  586. package/dist/extraction/languages/csharp.d.ts +0 -25
  587. package/dist/extraction/languages/csharp.d.ts.map +0 -1
  588. package/dist/extraction/languages/csharp.js +0 -175
  589. package/dist/extraction/languages/csharp.js.map +0 -1
  590. package/dist/extraction/languages/dart.d.ts +0 -3
  591. package/dist/extraction/languages/dart.d.ts.map +0 -1
  592. package/dist/extraction/languages/dart.js +0 -374
  593. package/dist/extraction/languages/dart.js.map +0 -1
  594. package/dist/extraction/languages/go.d.ts +0 -3
  595. package/dist/extraction/languages/go.d.ts.map +0 -1
  596. package/dist/extraction/languages/go.js +0 -111
  597. package/dist/extraction/languages/go.js.map +0 -1
  598. package/dist/extraction/languages/index.d.ts +0 -10
  599. package/dist/extraction/languages/index.d.ts.map +0 -1
  600. package/dist/extraction/languages/index.js +0 -53
  601. package/dist/extraction/languages/index.js.map +0 -1
  602. package/dist/extraction/languages/java.d.ts +0 -3
  603. package/dist/extraction/languages/java.d.ts.map +0 -1
  604. package/dist/extraction/languages/java.js +0 -315
  605. package/dist/extraction/languages/java.js.map +0 -1
  606. package/dist/extraction/languages/javascript.d.ts +0 -3
  607. package/dist/extraction/languages/javascript.d.ts.map +0 -1
  608. package/dist/extraction/languages/javascript.js +0 -106
  609. package/dist/extraction/languages/javascript.js.map +0 -1
  610. package/dist/extraction/languages/kotlin.d.ts +0 -3
  611. package/dist/extraction/languages/kotlin.d.ts.map +0 -1
  612. package/dist/extraction/languages/kotlin.js +0 -379
  613. package/dist/extraction/languages/kotlin.js.map +0 -1
  614. package/dist/extraction/languages/lua.d.ts +0 -3
  615. package/dist/extraction/languages/lua.d.ts.map +0 -1
  616. package/dist/extraction/languages/lua.js +0 -150
  617. package/dist/extraction/languages/lua.js.map +0 -1
  618. package/dist/extraction/languages/luau.d.ts +0 -3
  619. package/dist/extraction/languages/luau.d.ts.map +0 -1
  620. package/dist/extraction/languages/luau.js +0 -37
  621. package/dist/extraction/languages/luau.js.map +0 -1
  622. package/dist/extraction/languages/objc.d.ts +0 -3
  623. package/dist/extraction/languages/objc.d.ts.map +0 -1
  624. package/dist/extraction/languages/objc.js +0 -175
  625. package/dist/extraction/languages/objc.js.map +0 -1
  626. package/dist/extraction/languages/pascal.d.ts +0 -3
  627. package/dist/extraction/languages/pascal.d.ts.map +0 -1
  628. package/dist/extraction/languages/pascal.js +0 -77
  629. package/dist/extraction/languages/pascal.js.map +0 -1
  630. package/dist/extraction/languages/php.d.ts +0 -3
  631. package/dist/extraction/languages/php.d.ts.map +0 -1
  632. package/dist/extraction/languages/php.js +0 -196
  633. package/dist/extraction/languages/php.js.map +0 -1
  634. package/dist/extraction/languages/python.d.ts +0 -3
  635. package/dist/extraction/languages/python.d.ts.map +0 -1
  636. package/dist/extraction/languages/python.js +0 -56
  637. package/dist/extraction/languages/python.js.map +0 -1
  638. package/dist/extraction/languages/r.d.ts +0 -3
  639. package/dist/extraction/languages/r.d.ts.map +0 -1
  640. package/dist/extraction/languages/r.js +0 -314
  641. package/dist/extraction/languages/r.js.map +0 -1
  642. package/dist/extraction/languages/ruby.d.ts +0 -3
  643. package/dist/extraction/languages/ruby.d.ts.map +0 -1
  644. package/dist/extraction/languages/ruby.js +0 -149
  645. package/dist/extraction/languages/ruby.js.map +0 -1
  646. package/dist/extraction/languages/rust.d.ts +0 -3
  647. package/dist/extraction/languages/rust.d.ts.map +0 -1
  648. package/dist/extraction/languages/rust.js +0 -142
  649. package/dist/extraction/languages/rust.js.map +0 -1
  650. package/dist/extraction/languages/scala.d.ts +0 -3
  651. package/dist/extraction/languages/scala.d.ts.map +0 -1
  652. package/dist/extraction/languages/scala.js +0 -209
  653. package/dist/extraction/languages/scala.js.map +0 -1
  654. package/dist/extraction/languages/swift.d.ts +0 -3
  655. package/dist/extraction/languages/swift.d.ts.map +0 -1
  656. package/dist/extraction/languages/swift.js +0 -152
  657. package/dist/extraction/languages/swift.js.map +0 -1
  658. package/dist/extraction/languages/typescript.d.ts +0 -16
  659. package/dist/extraction/languages/typescript.d.ts.map +0 -1
  660. package/dist/extraction/languages/typescript.js +0 -167
  661. package/dist/extraction/languages/typescript.js.map +0 -1
  662. package/dist/extraction/liquid-extractor.d.ts +0 -59
  663. package/dist/extraction/liquid-extractor.d.ts.map +0 -1
  664. package/dist/extraction/liquid-extractor.js +0 -357
  665. package/dist/extraction/liquid-extractor.js.map +0 -1
  666. package/dist/extraction/mybatis-extractor.d.ts +0 -48
  667. package/dist/extraction/mybatis-extractor.d.ts.map +0 -1
  668. package/dist/extraction/mybatis-extractor.js +0 -198
  669. package/dist/extraction/mybatis-extractor.js.map +0 -1
  670. package/dist/extraction/parse-worker.d.ts +0 -8
  671. package/dist/extraction/parse-worker.d.ts.map +0 -1
  672. package/dist/extraction/parse-worker.js +0 -97
  673. package/dist/extraction/parse-worker.js.map +0 -1
  674. package/dist/extraction/razor-extractor.d.ts +0 -42
  675. package/dist/extraction/razor-extractor.d.ts.map +0 -1
  676. package/dist/extraction/razor-extractor.js +0 -285
  677. package/dist/extraction/razor-extractor.js.map +0 -1
  678. package/dist/extraction/svelte-extractor.d.ts +0 -56
  679. package/dist/extraction/svelte-extractor.d.ts.map +0 -1
  680. package/dist/extraction/svelte-extractor.js +0 -275
  681. package/dist/extraction/svelte-extractor.js.map +0 -1
  682. package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
  683. package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
  684. package/dist/extraction/tree-sitter-helpers.js +0 -152
  685. package/dist/extraction/tree-sitter-helpers.js.map +0 -1
  686. package/dist/extraction/tree-sitter-types.d.ts +0 -239
  687. package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
  688. package/dist/extraction/tree-sitter-types.js +0 -10
  689. package/dist/extraction/tree-sitter-types.js.map +0 -1
  690. package/dist/extraction/tree-sitter.d.ts +0 -647
  691. package/dist/extraction/tree-sitter.d.ts.map +0 -1
  692. package/dist/extraction/tree-sitter.js +0 -5592
  693. package/dist/extraction/tree-sitter.js.map +0 -1
  694. package/dist/extraction/vue-extractor.d.ts +0 -51
  695. package/dist/extraction/vue-extractor.d.ts.map +0 -1
  696. package/dist/extraction/vue-extractor.js +0 -254
  697. package/dist/extraction/vue-extractor.js.map +0 -1
  698. package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
  699. package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
  700. package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
  701. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  702. package/dist/extraction/wasm/tree-sitter-r.wasm +0 -0
  703. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  704. package/dist/extraction/wasm-runtime-flags.d.ts +0 -38
  705. package/dist/extraction/wasm-runtime-flags.d.ts.map +0 -1
  706. package/dist/extraction/wasm-runtime-flags.js +0 -106
  707. package/dist/extraction/wasm-runtime-flags.js.map +0 -1
  708. package/dist/graph/index.d.ts +0 -8
  709. package/dist/graph/index.d.ts.map +0 -1
  710. package/dist/graph/index.js +0 -13
  711. package/dist/graph/index.js.map +0 -1
  712. package/dist/graph/queries.d.ts +0 -106
  713. package/dist/graph/queries.d.ts.map +0 -1
  714. package/dist/graph/queries.js +0 -339
  715. package/dist/graph/queries.js.map +0 -1
  716. package/dist/graph/traversal.d.ts +0 -127
  717. package/dist/graph/traversal.d.ts.map +0 -1
  718. package/dist/graph/traversal.js +0 -540
  719. package/dist/graph/traversal.js.map +0 -1
  720. package/dist/index.d.ts +0 -563
  721. package/dist/index.d.ts.map +0 -1
  722. package/dist/index.js +0 -1041
  723. package/dist/index.js.map +0 -1
  724. package/dist/installer/claude-assets.d.ts +0 -45
  725. package/dist/installer/claude-assets.d.ts.map +0 -1
  726. package/dist/installer/claude-assets.js +0 -144
  727. package/dist/installer/claude-assets.js.map +0 -1
  728. package/dist/installer/config-writer.d.ts +0 -28
  729. package/dist/installer/config-writer.d.ts.map +0 -1
  730. package/dist/installer/config-writer.js +0 -91
  731. package/dist/installer/config-writer.js.map +0 -1
  732. package/dist/installer/index.d.ts +0 -101
  733. package/dist/installer/index.d.ts.map +0 -1
  734. package/dist/installer/index.js +0 -692
  735. package/dist/installer/index.js.map +0 -1
  736. package/dist/installer/instructions-template.d.ts +0 -41
  737. package/dist/installer/instructions-template.d.ts.map +0 -1
  738. package/dist/installer/instructions-template.js +0 -53
  739. package/dist/installer/instructions-template.js.map +0 -1
  740. package/dist/installer/targets/antigravity.d.ts +0 -57
  741. package/dist/installer/targets/antigravity.d.ts.map +0 -1
  742. package/dist/installer/targets/antigravity.js +0 -308
  743. package/dist/installer/targets/antigravity.js.map +0 -1
  744. package/dist/installer/targets/claude.d.ts +0 -81
  745. package/dist/installer/targets/claude.d.ts.map +0 -1
  746. package/dist/installer/targets/claude.js +0 -617
  747. package/dist/installer/targets/claude.js.map +0 -1
  748. package/dist/installer/targets/codex.d.ts +0 -18
  749. package/dist/installer/targets/codex.d.ts.map +0 -1
  750. package/dist/installer/targets/codex.js +0 -185
  751. package/dist/installer/targets/codex.js.map +0 -1
  752. package/dist/installer/targets/cursor.d.ts +0 -35
  753. package/dist/installer/targets/cursor.d.ts.map +0 -1
  754. package/dist/installer/targets/cursor.js +0 -254
  755. package/dist/installer/targets/cursor.js.map +0 -1
  756. package/dist/installer/targets/gemini.d.ts +0 -26
  757. package/dist/installer/targets/gemini.d.ts.map +0 -1
  758. package/dist/installer/targets/gemini.js +0 -165
  759. package/dist/installer/targets/gemini.js.map +0 -1
  760. package/dist/installer/targets/hermes.d.ts +0 -18
  761. package/dist/installer/targets/hermes.d.ts.map +0 -1
  762. package/dist/installer/targets/hermes.js +0 -359
  763. package/dist/installer/targets/hermes.js.map +0 -1
  764. package/dist/installer/targets/kiro.d.ts +0 -27
  765. package/dist/installer/targets/kiro.d.ts.map +0 -1
  766. package/dist/installer/targets/kiro.js +0 -178
  767. package/dist/installer/targets/kiro.js.map +0 -1
  768. package/dist/installer/targets/opencode.d.ts +0 -38
  769. package/dist/installer/targets/opencode.d.ts.map +0 -1
  770. package/dist/installer/targets/opencode.js +0 -288
  771. package/dist/installer/targets/opencode.js.map +0 -1
  772. package/dist/installer/targets/registry.d.ts +0 -35
  773. package/dist/installer/targets/registry.d.ts.map +0 -1
  774. package/dist/installer/targets/registry.js +0 -91
  775. package/dist/installer/targets/registry.js.map +0 -1
  776. package/dist/installer/targets/shared.d.ts +0 -101
  777. package/dist/installer/targets/shared.d.ts.map +0 -1
  778. package/dist/installer/targets/shared.js +0 -264
  779. package/dist/installer/targets/shared.js.map +0 -1
  780. package/dist/installer/targets/toml.d.ts +0 -52
  781. package/dist/installer/targets/toml.d.ts.map +0 -1
  782. package/dist/installer/targets/toml.js +0 -147
  783. package/dist/installer/targets/toml.js.map +0 -1
  784. package/dist/installer/targets/types.d.ts +0 -108
  785. package/dist/installer/targets/types.d.ts.map +0 -1
  786. package/dist/installer/targets/types.js +0 -16
  787. package/dist/installer/targets/types.js.map +0 -1
  788. package/dist/markdown/cli.d.ts +0 -16
  789. package/dist/markdown/cli.d.ts.map +0 -1
  790. package/dist/markdown/cli.js +0 -575
  791. package/dist/markdown/cli.js.map +0 -1
  792. package/dist/markdown/constants.d.ts +0 -22
  793. package/dist/markdown/constants.d.ts.map +0 -1
  794. package/dist/markdown/constants.js +0 -71
  795. package/dist/markdown/constants.js.map +0 -1
  796. package/dist/markdown/dedup.d.ts.map +0 -1
  797. package/dist/markdown/dedup.js.map +0 -1
  798. package/dist/markdown/errors.d.ts +0 -22
  799. package/dist/markdown/errors.d.ts.map +0 -1
  800. package/dist/markdown/errors.js +0 -45
  801. package/dist/markdown/errors.js.map +0 -1
  802. package/dist/markdown/extractor.d.ts.map +0 -1
  803. package/dist/markdown/extractor.js.map +0 -1
  804. package/dist/markdown/frontmatter-parser.d.ts +0 -47
  805. package/dist/markdown/frontmatter-parser.d.ts.map +0 -1
  806. package/dist/markdown/frontmatter-parser.js +0 -199
  807. package/dist/markdown/frontmatter-parser.js.map +0 -1
  808. package/dist/markdown/indexer.d.ts +0 -34
  809. package/dist/markdown/indexer.d.ts.map +0 -1
  810. package/dist/markdown/indexer.js +0 -256
  811. package/dist/markdown/indexer.js.map +0 -1
  812. package/dist/markdown/mcp-tools.d.ts +0 -33
  813. package/dist/markdown/mcp-tools.d.ts.map +0 -1
  814. package/dist/markdown/mcp-tools.js +0 -300
  815. package/dist/markdown/mcp-tools.js.map +0 -1
  816. package/dist/markdown/query.d.ts +0 -108
  817. package/dist/markdown/query.d.ts.map +0 -1
  818. package/dist/markdown/query.js +0 -570
  819. package/dist/markdown/query.js.map +0 -1
  820. package/dist/markdown/schema-bootstrap.d.ts +0 -40
  821. package/dist/markdown/schema-bootstrap.d.ts.map +0 -1
  822. package/dist/markdown/schema-bootstrap.js +0 -85
  823. package/dist/markdown/schema-bootstrap.js.map +0 -1
  824. package/dist/markdown/schema.sql +0 -124
  825. package/dist/markdown/store.d.ts.map +0 -1
  826. package/dist/markdown/store.js.map +0 -1
  827. package/dist/markdown/summary-extractor.d.ts.map +0 -1
  828. package/dist/markdown/summary-extractor.js.map +0 -1
  829. package/dist/markdown/types.d.ts +0 -159
  830. package/dist/markdown/types.d.ts.map +0 -1
  831. package/dist/markdown/types.js.map +0 -1
  832. package/dist/markdown/validator.d.ts +0 -44
  833. package/dist/markdown/validator.d.ts.map +0 -1
  834. package/dist/markdown/validator.js +0 -95
  835. package/dist/markdown/validator.js.map +0 -1
  836. package/dist/mcp/daemon-manager.d.ts +0 -42
  837. package/dist/mcp/daemon-manager.d.ts.map +0 -1
  838. package/dist/mcp/daemon-manager.js +0 -129
  839. package/dist/mcp/daemon-manager.js.map +0 -1
  840. package/dist/mcp/daemon-paths.d.ts +0 -46
  841. package/dist/mcp/daemon-paths.d.ts.map +0 -1
  842. package/dist/mcp/daemon-paths.js +0 -125
  843. package/dist/mcp/daemon-paths.js.map +0 -1
  844. package/dist/mcp/daemon-registry.d.ts +0 -47
  845. package/dist/mcp/daemon-registry.d.ts.map +0 -1
  846. package/dist/mcp/daemon-registry.js +0 -229
  847. package/dist/mcp/daemon-registry.js.map +0 -1
  848. package/dist/mcp/daemon.d.ts +0 -220
  849. package/dist/mcp/daemon.d.ts.map +0 -1
  850. package/dist/mcp/daemon.js +0 -637
  851. package/dist/mcp/daemon.js.map +0 -1
  852. package/dist/mcp/dynamic-boundaries.d.ts +0 -41
  853. package/dist/mcp/dynamic-boundaries.d.ts.map +0 -1
  854. package/dist/mcp/dynamic-boundaries.js +0 -359
  855. package/dist/mcp/dynamic-boundaries.js.map +0 -1
  856. package/dist/mcp/engine.d.ts +0 -105
  857. package/dist/mcp/engine.d.ts.map +0 -1
  858. package/dist/mcp/engine.js +0 -278
  859. package/dist/mcp/engine.js.map +0 -1
  860. package/dist/mcp/index.d.ts +0 -113
  861. package/dist/mcp/index.d.ts.map +0 -1
  862. package/dist/mcp/index.js +0 -499
  863. package/dist/mcp/index.js.map +0 -1
  864. package/dist/mcp/liveness-watchdog.d.ts +0 -18
  865. package/dist/mcp/liveness-watchdog.d.ts.map +0 -1
  866. package/dist/mcp/liveness-watchdog.js +0 -207
  867. package/dist/mcp/liveness-watchdog.js.map +0 -1
  868. package/dist/mcp/ppid-watchdog.d.ts +0 -44
  869. package/dist/mcp/ppid-watchdog.d.ts.map +0 -1
  870. package/dist/mcp/ppid-watchdog.js +0 -27
  871. package/dist/mcp/ppid-watchdog.js.map +0 -1
  872. package/dist/mcp/proxy.d.ts +0 -87
  873. package/dist/mcp/proxy.d.ts.map +0 -1
  874. package/dist/mcp/proxy.js +0 -641
  875. package/dist/mcp/proxy.js.map +0 -1
  876. package/dist/mcp/server-instructions.d.ts +0 -34
  877. package/dist/mcp/server-instructions.d.ts.map +0 -1
  878. package/dist/mcp/server-instructions.js +0 -106
  879. package/dist/mcp/server-instructions.js.map +0 -1
  880. package/dist/mcp/session.d.ts +0 -79
  881. package/dist/mcp/session.d.ts.map +0 -1
  882. package/dist/mcp/session.js +0 -330
  883. package/dist/mcp/session.js.map +0 -1
  884. package/dist/mcp/stdin-teardown.d.ts +0 -27
  885. package/dist/mcp/stdin-teardown.d.ts.map +0 -1
  886. package/dist/mcp/stdin-teardown.js +0 -49
  887. package/dist/mcp/stdin-teardown.js.map +0 -1
  888. package/dist/mcp/tools.d.ts +0 -547
  889. package/dist/mcp/tools.d.ts.map +0 -1
  890. package/dist/mcp/tools.js +0 -4122
  891. package/dist/mcp/tools.js.map +0 -1
  892. package/dist/mcp/transport.d.ts +0 -188
  893. package/dist/mcp/transport.d.ts.map +0 -1
  894. package/dist/mcp/transport.js +0 -359
  895. package/dist/mcp/transport.js.map +0 -1
  896. package/dist/mcp/version.d.ts +0 -19
  897. package/dist/mcp/version.d.ts.map +0 -1
  898. package/dist/mcp/version.js +0 -71
  899. package/dist/mcp/version.js.map +0 -1
  900. package/dist/project-config.d.ts +0 -36
  901. package/dist/project-config.d.ts.map +0 -1
  902. package/dist/project-config.js +0 -235
  903. package/dist/project-config.js.map +0 -1
  904. package/dist/reasoning/config.d.ts +0 -45
  905. package/dist/reasoning/config.d.ts.map +0 -1
  906. package/dist/reasoning/config.js +0 -171
  907. package/dist/reasoning/config.js.map +0 -1
  908. package/dist/reasoning/credentials.d.ts +0 -5
  909. package/dist/reasoning/credentials.d.ts.map +0 -1
  910. package/dist/reasoning/credentials.js +0 -83
  911. package/dist/reasoning/credentials.js.map +0 -1
  912. package/dist/reasoning/login.d.ts +0 -21
  913. package/dist/reasoning/login.d.ts.map +0 -1
  914. package/dist/reasoning/login.js +0 -85
  915. package/dist/reasoning/login.js.map +0 -1
  916. package/dist/reasoning/reasoner.d.ts +0 -43
  917. package/dist/reasoning/reasoner.d.ts.map +0 -1
  918. package/dist/reasoning/reasoner.js +0 -308
  919. package/dist/reasoning/reasoner.js.map +0 -1
  920. package/dist/resolution/c-fnptr-synthesizer.d.ts +0 -33
  921. package/dist/resolution/c-fnptr-synthesizer.d.ts.map +0 -1
  922. package/dist/resolution/c-fnptr-synthesizer.js +0 -352
  923. package/dist/resolution/c-fnptr-synthesizer.js.map +0 -1
  924. package/dist/resolution/callback-synthesizer.d.ts +0 -15
  925. package/dist/resolution/callback-synthesizer.d.ts.map +0 -1
  926. package/dist/resolution/callback-synthesizer.js +0 -2926
  927. package/dist/resolution/callback-synthesizer.js.map +0 -1
  928. package/dist/resolution/frameworks/astro.d.ts +0 -9
  929. package/dist/resolution/frameworks/astro.d.ts.map +0 -1
  930. package/dist/resolution/frameworks/astro.js +0 -169
  931. package/dist/resolution/frameworks/astro.js.map +0 -1
  932. package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
  933. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
  934. package/dist/resolution/frameworks/cargo-workspace.js +0 -225
  935. package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
  936. package/dist/resolution/frameworks/csharp.d.ts +0 -8
  937. package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
  938. package/dist/resolution/frameworks/csharp.js +0 -241
  939. package/dist/resolution/frameworks/csharp.js.map +0 -1
  940. package/dist/resolution/frameworks/drupal.d.ts +0 -51
  941. package/dist/resolution/frameworks/drupal.d.ts.map +0 -1
  942. package/dist/resolution/frameworks/drupal.js +0 -367
  943. package/dist/resolution/frameworks/drupal.js.map +0 -1
  944. package/dist/resolution/frameworks/expo-modules.d.ts +0 -3
  945. package/dist/resolution/frameworks/expo-modules.d.ts.map +0 -1
  946. package/dist/resolution/frameworks/expo-modules.js +0 -148
  947. package/dist/resolution/frameworks/expo-modules.js.map +0 -1
  948. package/dist/resolution/frameworks/express.d.ts +0 -8
  949. package/dist/resolution/frameworks/express.d.ts.map +0 -1
  950. package/dist/resolution/frameworks/express.js +0 -308
  951. package/dist/resolution/frameworks/express.js.map +0 -1
  952. package/dist/resolution/frameworks/fabric.d.ts +0 -3
  953. package/dist/resolution/frameworks/fabric.d.ts.map +0 -1
  954. package/dist/resolution/frameworks/fabric.js +0 -354
  955. package/dist/resolution/frameworks/fabric.js.map +0 -1
  956. package/dist/resolution/frameworks/go.d.ts +0 -8
  957. package/dist/resolution/frameworks/go.d.ts.map +0 -1
  958. package/dist/resolution/frameworks/go.js +0 -161
  959. package/dist/resolution/frameworks/go.js.map +0 -1
  960. package/dist/resolution/frameworks/goframe.d.ts +0 -41
  961. package/dist/resolution/frameworks/goframe.d.ts.map +0 -1
  962. package/dist/resolution/frameworks/goframe.js +0 -112
  963. package/dist/resolution/frameworks/goframe.js.map +0 -1
  964. package/dist/resolution/frameworks/index.d.ts +0 -50
  965. package/dist/resolution/frameworks/index.d.ts.map +0 -1
  966. package/dist/resolution/frameworks/index.js +0 -169
  967. package/dist/resolution/frameworks/index.js.map +0 -1
  968. package/dist/resolution/frameworks/java.d.ts +0 -8
  969. package/dist/resolution/frameworks/java.d.ts.map +0 -1
  970. package/dist/resolution/frameworks/java.js +0 -509
  971. package/dist/resolution/frameworks/java.js.map +0 -1
  972. package/dist/resolution/frameworks/laravel.d.ts +0 -13
  973. package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
  974. package/dist/resolution/frameworks/laravel.js +0 -257
  975. package/dist/resolution/frameworks/laravel.js.map +0 -1
  976. package/dist/resolution/frameworks/nestjs.d.ts +0 -26
  977. package/dist/resolution/frameworks/nestjs.d.ts.map +0 -1
  978. package/dist/resolution/frameworks/nestjs.js +0 -698
  979. package/dist/resolution/frameworks/nestjs.js.map +0 -1
  980. package/dist/resolution/frameworks/play.d.ts +0 -19
  981. package/dist/resolution/frameworks/play.d.ts.map +0 -1
  982. package/dist/resolution/frameworks/play.js +0 -111
  983. package/dist/resolution/frameworks/play.js.map +0 -1
  984. package/dist/resolution/frameworks/python.d.ts +0 -10
  985. package/dist/resolution/frameworks/python.d.ts.map +0 -1
  986. package/dist/resolution/frameworks/python.js +0 -400
  987. package/dist/resolution/frameworks/python.js.map +0 -1
  988. package/dist/resolution/frameworks/react-native.d.ts +0 -3
  989. package/dist/resolution/frameworks/react-native.d.ts.map +0 -1
  990. package/dist/resolution/frameworks/react-native.js +0 -410
  991. package/dist/resolution/frameworks/react-native.js.map +0 -1
  992. package/dist/resolution/frameworks/react.d.ts +0 -8
  993. package/dist/resolution/frameworks/react.d.ts.map +0 -1
  994. package/dist/resolution/frameworks/react.js +0 -334
  995. package/dist/resolution/frameworks/react.js.map +0 -1
  996. package/dist/resolution/frameworks/ruby.d.ts +0 -8
  997. package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
  998. package/dist/resolution/frameworks/ruby.js +0 -302
  999. package/dist/resolution/frameworks/ruby.js.map +0 -1
  1000. package/dist/resolution/frameworks/rust.d.ts +0 -8
  1001. package/dist/resolution/frameworks/rust.d.ts.map +0 -1
  1002. package/dist/resolution/frameworks/rust.js +0 -304
  1003. package/dist/resolution/frameworks/rust.js.map +0 -1
  1004. package/dist/resolution/frameworks/svelte.d.ts +0 -9
  1005. package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
  1006. package/dist/resolution/frameworks/svelte.js +0 -253
  1007. package/dist/resolution/frameworks/svelte.js.map +0 -1
  1008. package/dist/resolution/frameworks/swift-objc.d.ts +0 -37
  1009. package/dist/resolution/frameworks/swift-objc.d.ts.map +0 -1
  1010. package/dist/resolution/frameworks/swift-objc.js +0 -252
  1011. package/dist/resolution/frameworks/swift-objc.js.map +0 -1
  1012. package/dist/resolution/frameworks/swift.d.ts +0 -10
  1013. package/dist/resolution/frameworks/swift.d.ts.map +0 -1
  1014. package/dist/resolution/frameworks/swift.js +0 -400
  1015. package/dist/resolution/frameworks/swift.js.map +0 -1
  1016. package/dist/resolution/frameworks/vue.d.ts +0 -9
  1017. package/dist/resolution/frameworks/vue.d.ts.map +0 -1
  1018. package/dist/resolution/frameworks/vue.js +0 -303
  1019. package/dist/resolution/frameworks/vue.js.map +0 -1
  1020. package/dist/resolution/go-module.d.ts +0 -26
  1021. package/dist/resolution/go-module.d.ts.map +0 -1
  1022. package/dist/resolution/go-module.js +0 -78
  1023. package/dist/resolution/go-module.js.map +0 -1
  1024. package/dist/resolution/goframe-synthesizer.d.ts +0 -28
  1025. package/dist/resolution/goframe-synthesizer.d.ts.map +0 -1
  1026. package/dist/resolution/goframe-synthesizer.js +0 -158
  1027. package/dist/resolution/goframe-synthesizer.js.map +0 -1
  1028. package/dist/resolution/import-resolver.d.ts +0 -78
  1029. package/dist/resolution/import-resolver.d.ts.map +0 -1
  1030. package/dist/resolution/import-resolver.js +0 -1849
  1031. package/dist/resolution/import-resolver.js.map +0 -1
  1032. package/dist/resolution/index.d.ts +0 -196
  1033. package/dist/resolution/index.d.ts.map +0 -1
  1034. package/dist/resolution/index.js +0 -1341
  1035. package/dist/resolution/index.js.map +0 -1
  1036. package/dist/resolution/lru-cache.d.ts +0 -24
  1037. package/dist/resolution/lru-cache.d.ts.map +0 -1
  1038. package/dist/resolution/lru-cache.js +0 -62
  1039. package/dist/resolution/lru-cache.js.map +0 -1
  1040. package/dist/resolution/name-matcher.d.ts +0 -93
  1041. package/dist/resolution/name-matcher.d.ts.map +0 -1
  1042. package/dist/resolution/name-matcher.js +0 -1212
  1043. package/dist/resolution/name-matcher.js.map +0 -1
  1044. package/dist/resolution/path-aliases.d.ts +0 -68
  1045. package/dist/resolution/path-aliases.d.ts.map +0 -1
  1046. package/dist/resolution/path-aliases.js +0 -238
  1047. package/dist/resolution/path-aliases.js.map +0 -1
  1048. package/dist/resolution/scope-index.d.ts +0 -86
  1049. package/dist/resolution/scope-index.d.ts.map +0 -1
  1050. package/dist/resolution/scope-index.js +0 -143
  1051. package/dist/resolution/scope-index.js.map +0 -1
  1052. package/dist/resolution/stdlib-blocklist.d.ts +0 -53
  1053. package/dist/resolution/stdlib-blocklist.d.ts.map +0 -1
  1054. package/dist/resolution/stdlib-blocklist.js +0 -143
  1055. package/dist/resolution/stdlib-blocklist.js.map +0 -1
  1056. package/dist/resolution/strip-comments.d.ts +0 -27
  1057. package/dist/resolution/strip-comments.d.ts.map +0 -1
  1058. package/dist/resolution/strip-comments.js +0 -443
  1059. package/dist/resolution/strip-comments.js.map +0 -1
  1060. package/dist/resolution/swift-objc-bridge.d.ts +0 -134
  1061. package/dist/resolution/swift-objc-bridge.d.ts.map +0 -1
  1062. package/dist/resolution/swift-objc-bridge.js +0 -256
  1063. package/dist/resolution/swift-objc-bridge.js.map +0 -1
  1064. package/dist/resolution/types.d.ts +0 -233
  1065. package/dist/resolution/types.d.ts.map +0 -1
  1066. package/dist/resolution/types.js +0 -8
  1067. package/dist/resolution/types.js.map +0 -1
  1068. package/dist/resolution/workspace-packages.d.ts +0 -48
  1069. package/dist/resolution/workspace-packages.d.ts.map +0 -1
  1070. package/dist/resolution/workspace-packages.js +0 -208
  1071. package/dist/resolution/workspace-packages.js.map +0 -1
  1072. package/dist/search/ast-helpers.d.ts +0 -42
  1073. package/dist/search/ast-helpers.d.ts.map +0 -1
  1074. package/dist/search/ast-helpers.js +0 -106
  1075. package/dist/search/ast-helpers.js.map +0 -1
  1076. package/dist/search/call-sites.d.ts +0 -398
  1077. package/dist/search/call-sites.d.ts.map +0 -1
  1078. package/dist/search/call-sites.js +0 -1433
  1079. package/dist/search/call-sites.js.map +0 -1
  1080. package/dist/search/context.d.ts +0 -134
  1081. package/dist/search/context.d.ts.map +0 -1
  1082. package/dist/search/context.js +0 -575
  1083. package/dist/search/context.js.map +0 -1
  1084. package/dist/search/impact.d.ts +0 -139
  1085. package/dist/search/impact.d.ts.map +0 -1
  1086. package/dist/search/impact.js +0 -646
  1087. package/dist/search/impact.js.map +0 -1
  1088. package/dist/search/query-parser.d.ts +0 -57
  1089. package/dist/search/query-parser.d.ts.map +0 -1
  1090. package/dist/search/query-parser.js +0 -177
  1091. package/dist/search/query-parser.js.map +0 -1
  1092. package/dist/search/query-utils.d.ts +0 -87
  1093. package/dist/search/query-utils.d.ts.map +0 -1
  1094. package/dist/search/query-utils.js +0 -449
  1095. package/dist/search/query-utils.js.map +0 -1
  1096. package/dist/search/related.d.ts +0 -178
  1097. package/dist/search/related.d.ts.map +0 -1
  1098. package/dist/search/related.js +0 -667
  1099. package/dist/search/related.js.map +0 -1
  1100. package/dist/search/slice.d.ts +0 -148
  1101. package/dist/search/slice.d.ts.map +0 -1
  1102. package/dist/search/slice.js +0 -460
  1103. package/dist/search/slice.js.map +0 -1
  1104. package/dist/search/snr-constants.d.ts +0 -41
  1105. package/dist/search/snr-constants.d.ts.map +0 -1
  1106. package/dist/search/snr-constants.js +0 -44
  1107. package/dist/search/snr-constants.js.map +0 -1
  1108. package/dist/search/types.d.ts +0 -28
  1109. package/dist/search/types.d.ts.map +0 -1
  1110. package/dist/search/types.js +0 -12
  1111. package/dist/search/types.js.map +0 -1
  1112. package/dist/sync/git-hooks.d.ts +0 -45
  1113. package/dist/sync/git-hooks.d.ts.map +0 -1
  1114. package/dist/sync/git-hooks.js +0 -225
  1115. package/dist/sync/git-hooks.js.map +0 -1
  1116. package/dist/sync/index.d.ts +0 -19
  1117. package/dist/sync/index.d.ts.map +0 -1
  1118. package/dist/sync/index.js +0 -35
  1119. package/dist/sync/index.js.map +0 -1
  1120. package/dist/sync/watch-policy.d.ts +0 -48
  1121. package/dist/sync/watch-policy.d.ts.map +0 -1
  1122. package/dist/sync/watch-policy.js +0 -124
  1123. package/dist/sync/watch-policy.js.map +0 -1
  1124. package/dist/sync/watcher.d.ts +0 -350
  1125. package/dist/sync/watcher.d.ts.map +0 -1
  1126. package/dist/sync/watcher.js +0 -811
  1127. package/dist/sync/watcher.js.map +0 -1
  1128. package/dist/sync/worktree.d.ts +0 -54
  1129. package/dist/sync/worktree.d.ts.map +0 -1
  1130. package/dist/sync/worktree.js +0 -137
  1131. package/dist/sync/worktree.js.map +0 -1
  1132. package/dist/telemetry/index.d.ts +0 -143
  1133. package/dist/telemetry/index.d.ts.map +0 -1
  1134. package/dist/telemetry/index.js +0 -541
  1135. package/dist/telemetry/index.js.map +0 -1
  1136. package/dist/timeline/bash-semantics.d.ts.map +0 -1
  1137. package/dist/timeline/bash-semantics.js.map +0 -1
  1138. package/dist/timeline/cli.d.ts.map +0 -1
  1139. package/dist/timeline/cli.js.map +0 -1
  1140. package/dist/timeline/constants.d.ts +0 -62
  1141. package/dist/timeline/constants.d.ts.map +0 -1
  1142. package/dist/timeline/constants.js +0 -73
  1143. package/dist/timeline/constants.js.map +0 -1
  1144. package/dist/timeline/errors.d.ts.map +0 -1
  1145. package/dist/timeline/errors.js.map +0 -1
  1146. package/dist/timeline/hook-runner.d.ts.map +0 -1
  1147. package/dist/timeline/hook-runner.js.map +0 -1
  1148. package/dist/timeline/hooks.d.ts.map +0 -1
  1149. package/dist/timeline/hooks.js.map +0 -1
  1150. package/dist/timeline/index.d.ts.map +0 -1
  1151. package/dist/timeline/index.js.map +0 -1
  1152. package/dist/timeline/indexer.d.ts.map +0 -1
  1153. package/dist/timeline/indexer.js.map +0 -1
  1154. package/dist/timeline/installer.d.ts.map +0 -1
  1155. package/dist/timeline/installer.js.map +0 -1
  1156. package/dist/timeline/payload.d.ts.map +0 -1
  1157. package/dist/timeline/payload.js.map +0 -1
  1158. package/dist/timeline/post-tool-summary.d.ts.map +0 -1
  1159. package/dist/timeline/post-tool-summary.js.map +0 -1
  1160. package/dist/timeline/recorder.d.ts.map +0 -1
  1161. package/dist/timeline/recorder.js.map +0 -1
  1162. package/dist/timeline/schema-bootstrap.d.ts +0 -42
  1163. package/dist/timeline/schema-bootstrap.d.ts.map +0 -1
  1164. package/dist/timeline/schema-bootstrap.js +0 -81
  1165. package/dist/timeline/schema-bootstrap.js.map +0 -1
  1166. package/dist/timeline/store.d.ts.map +0 -1
  1167. package/dist/timeline/store.js.map +0 -1
  1168. package/dist/timeline/types.d.ts.map +0 -1
  1169. package/dist/timeline/types.js.map +0 -1
  1170. package/dist/types.d.ts +0 -392
  1171. package/dist/types.d.ts.map +0 -1
  1172. package/dist/types.js +0 -81
  1173. package/dist/types.js.map +0 -1
  1174. package/dist/ui/glyphs.d.ts +0 -42
  1175. package/dist/ui/glyphs.d.ts.map +0 -1
  1176. package/dist/ui/glyphs.js +0 -78
  1177. package/dist/ui/glyphs.js.map +0 -1
  1178. package/dist/ui/shimmer-progress.d.ts +0 -11
  1179. package/dist/ui/shimmer-progress.d.ts.map +0 -1
  1180. package/dist/ui/shimmer-progress.js +0 -90
  1181. package/dist/ui/shimmer-progress.js.map +0 -1
  1182. package/dist/ui/shimmer-worker.d.ts +0 -2
  1183. package/dist/ui/shimmer-worker.d.ts.map +0 -1
  1184. package/dist/ui/shimmer-worker.js +0 -118
  1185. package/dist/ui/shimmer-worker.js.map +0 -1
  1186. package/dist/ui/types.d.ts +0 -17
  1187. package/dist/ui/types.d.ts.map +0 -1
  1188. package/dist/ui/types.js +0 -3
  1189. package/dist/ui/types.js.map +0 -1
  1190. package/dist/upgrade/index.d.ts +0 -132
  1191. package/dist/upgrade/index.d.ts.map +0 -1
  1192. package/dist/upgrade/index.js +0 -498
  1193. package/dist/upgrade/index.js.map +0 -1
  1194. package/dist/utils.d.ts +0 -224
  1195. package/dist/utils.d.ts.map +0 -1
  1196. package/dist/utils.js +0 -583
  1197. package/dist/utils.js.map +0 -1
  1198. package/scripts/add-lang/bench.sh +0 -60
  1199. package/scripts/add-lang/check-grammar.mjs +0 -75
  1200. package/scripts/add-lang/dump-ast.mjs +0 -103
  1201. package/scripts/add-lang/verify-extraction.mjs +0 -70
  1202. package/scripts/agent-eval/ab-adoption.sh +0 -91
  1203. package/scripts/agent-eval/ab-hook.sh +0 -86
  1204. package/scripts/agent-eval/ab-impl.sh +0 -78
  1205. package/scripts/agent-eval/ab-new-vs-baseline.sh +0 -102
  1206. package/scripts/agent-eval/ab-sufficiency.sh +0 -78
  1207. package/scripts/agent-eval/arms-F.sh +0 -21
  1208. package/scripts/agent-eval/arms-matrix.sh +0 -37
  1209. package/scripts/agent-eval/audit.sh +0 -68
  1210. package/scripts/agent-eval/bench-readme.sh +0 -28
  1211. package/scripts/agent-eval/bench-why-repo.sh +0 -22
  1212. package/scripts/agent-eval/block-read-hook.sh +0 -19
  1213. package/scripts/agent-eval/hook-settings.json +0 -15
  1214. package/scripts/agent-eval/itrun.sh +0 -120
  1215. package/scripts/agent-eval/offload-eval-3arm.sh +0 -72
  1216. package/scripts/agent-eval/offload-eval-cost.mjs +0 -133
  1217. package/scripts/agent-eval/offload-eval-effort.mjs +0 -108
  1218. package/scripts/agent-eval/offload-eval-frontload-matrix.sh +0 -25
  1219. package/scripts/agent-eval/offload-eval-frontload.sh +0 -47
  1220. package/scripts/agent-eval/offload-eval-ground-truth.json +0 -18
  1221. package/scripts/agent-eval/offload-eval-hook.mjs +0 -84
  1222. package/scripts/agent-eval/offload-eval-judge.mjs +0 -103
  1223. package/scripts/agent-eval/offload-eval-matrix.sh +0 -20
  1224. package/scripts/agent-eval/offload-eval-metrics.mjs +0 -94
  1225. package/scripts/agent-eval/offload-eval-refs1.sh +0 -50
  1226. package/scripts/agent-eval/offload-eval-setup.sh +0 -24
  1227. package/scripts/agent-eval/offload-eval-styles.sh +0 -72
  1228. package/scripts/agent-eval/offload-eval-summarize.mjs +0 -68
  1229. package/scripts/agent-eval/offload-eval.md +0 -76
  1230. package/scripts/agent-eval/parse-arms.mjs +0 -116
  1231. package/scripts/agent-eval/parse-bench-readme.mjs +0 -84
  1232. package/scripts/agent-eval/parse-run.mjs +0 -45
  1233. package/scripts/agent-eval/parse-session.mjs +0 -93
  1234. package/scripts/agent-eval/probe-context.mjs +0 -21
  1235. package/scripts/agent-eval/probe-explore.mjs +0 -40
  1236. package/scripts/agent-eval/probe-node.mjs +0 -20
  1237. package/scripts/agent-eval/probe-sweep.mjs +0 -119
  1238. package/scripts/agent-eval/probe-trace.mjs +0 -20
  1239. package/scripts/agent-eval/redirect-read-hook.sh +0 -38
  1240. package/scripts/agent-eval/run-agent.sh +0 -34
  1241. package/scripts/agent-eval/run-all.sh +0 -69
  1242. package/scripts/agent-eval/run-arms.sh +0 -56
  1243. package/scripts/agent-eval/seq-matrix.mjs +0 -137
  1244. package/scripts/agent-eval/subagent-token-cost.py +0 -188
  1245. package/scripts/build-bundle.sh +0 -118
  1246. package/scripts/extract-release-notes.mjs +0 -130
  1247. package/scripts/local-install.sh +0 -41
  1248. package/scripts/npm-sdk.js +0 -75
  1249. package/scripts/npm-shim.js +0 -246
  1250. package/scripts/pack-npm.sh +0 -118
  1251. package/scripts/prepare-release.mjs +0 -270
  1252. /package/dist/{dbquery → core/dbquery}/config.d.ts +0 -0
  1253. /package/dist/{dbquery → core/dbquery}/config.js +0 -0
  1254. /package/dist/{dbquery → core/dbquery}/constants.d.ts +0 -0
  1255. /package/dist/{dbquery → core/dbquery}/constants.js +0 -0
  1256. /package/dist/{dbquery → core/dbquery}/drivers/mysql.d.ts +0 -0
  1257. /package/dist/{dbquery → core/dbquery}/drivers/mysql.js +0 -0
  1258. /package/dist/{dbquery → core/dbquery}/drivers/postgres.d.ts +0 -0
  1259. /package/dist/{dbquery → core/dbquery}/drivers/postgres.js +0 -0
  1260. /package/dist/{dbquery → core/dbquery}/executor.d.ts +0 -0
  1261. /package/dist/{dbquery → core/dbquery}/executor.js +0 -0
  1262. /package/dist/{dbquery → core/dbquery}/format.d.ts +0 -0
  1263. /package/dist/{dbquery → core/dbquery}/format.js +0 -0
  1264. /package/dist/{dbquery → core/dbquery}/identifiers.d.ts +0 -0
  1265. /package/dist/{dbquery → core/dbquery}/identifiers.js +0 -0
  1266. /package/dist/{dbquery → core/dbquery}/index.d.ts +0 -0
  1267. /package/dist/{dbquery → core/dbquery}/index.js +0 -0
  1268. /package/dist/{dbquery → core/dbquery}/logging.d.ts +0 -0
  1269. /package/dist/{dbquery → core/dbquery}/logging.js +0 -0
  1270. /package/dist/{dbquery → core/dbquery}/queries.d.ts +0 -0
  1271. /package/dist/{dbquery → core/dbquery}/queries.js +0 -0
  1272. /package/dist/{dbquery → core/dbquery}/safety.d.ts +0 -0
  1273. /package/dist/{dbquery → core/dbquery}/safety.js +0 -0
  1274. /package/dist/{markdown → core/markdown}/dedup.d.ts +0 -0
  1275. /package/dist/{markdown → core/markdown}/dedup.js +0 -0
  1276. /package/dist/{markdown → core/markdown}/extractor.d.ts +0 -0
  1277. /package/dist/{markdown → core/markdown}/extractor.js +0 -0
  1278. /package/dist/{markdown → core/markdown}/store.d.ts +0 -0
  1279. /package/dist/{markdown → core/markdown}/store.js +0 -0
  1280. /package/dist/{markdown → core/markdown}/summary-extractor.d.ts +0 -0
  1281. /package/dist/{markdown → core/markdown}/summary-extractor.js +0 -0
  1282. /package/dist/{markdown → core/markdown}/types.js +0 -0
  1283. /package/dist/{timeline → core/timeline}/bash-semantics.d.ts +0 -0
  1284. /package/dist/{timeline → core/timeline}/bash-semantics.js +0 -0
  1285. /package/dist/{timeline → core/timeline}/cli.d.ts +0 -0
  1286. /package/dist/{timeline → core/timeline}/cli.js +0 -0
  1287. /package/dist/{timeline → core/timeline}/errors.d.ts +0 -0
  1288. /package/dist/{timeline → core/timeline}/errors.js +0 -0
  1289. /package/dist/{timeline → core/timeline}/hook-runner.d.ts +0 -0
  1290. /package/dist/{timeline → core/timeline}/hook-runner.js +0 -0
  1291. /package/dist/{timeline → core/timeline}/hooks.d.ts +0 -0
  1292. /package/dist/{timeline → core/timeline}/hooks.js +0 -0
  1293. /package/dist/{timeline → core/timeline}/index.d.ts +0 -0
  1294. /package/dist/{timeline → core/timeline}/index.js +0 -0
  1295. /package/dist/{timeline → core/timeline}/indexer.d.ts +0 -0
  1296. /package/dist/{timeline → core/timeline}/indexer.js +0 -0
  1297. /package/dist/{timeline → core/timeline}/installer.d.ts +0 -0
  1298. /package/dist/{timeline → core/timeline}/installer.js +0 -0
  1299. /package/dist/{timeline → core/timeline}/payload.d.ts +0 -0
  1300. /package/dist/{timeline → core/timeline}/payload.js +0 -0
  1301. /package/dist/{timeline → core/timeline}/post-tool-summary.d.ts +0 -0
  1302. /package/dist/{timeline → core/timeline}/post-tool-summary.js +0 -0
  1303. /package/dist/{timeline → core/timeline}/recorder.d.ts +0 -0
  1304. /package/dist/{timeline → core/timeline}/recorder.js +0 -0
  1305. /package/dist/{timeline → core/timeline}/schema.sql +0 -0
  1306. /package/dist/{timeline → core/timeline}/store.d.ts +0 -0
  1307. /package/dist/{timeline → core/timeline}/store.js +0 -0
  1308. /package/dist/{timeline → core/timeline}/types.d.ts +0 -0
  1309. /package/dist/{timeline → core/timeline}/types.js +0 -0
@@ -1,1914 +0,0 @@
1
- #!/usr/bin/env node
2
- "use strict";
3
- /**
4
- * cgraphx CLI
5
- *
6
- * Command-line interface for cgraphx code intelligence.
7
- *
8
- * Usage:
9
- * cgraphx Run interactive installer (when no args)
10
- * cgraphx install Run interactive installer
11
- * cgraphx uninstall Remove cgraphx from your agents
12
- * cgraphx init [path] Initialize cgraphx in a project
13
- * cgraphx uninit [path] Remove cgraphx from a project
14
- * cgraphx index [path] Index all files in the project
15
- * cgraphx sync [path] Sync changes since last index
16
- * cgraphx status [path] Show index status
17
- * cgraphx query <search> Search for symbols
18
- * cgraphx files [options] Show project file structure
19
- * cgraphx context <task> Build context for a task
20
- * cgraphx callers <symbol> Find what calls a function/method
21
- * cgraphx callees <symbol> Find what a function/method calls
22
- * cgraphx impact <symbol> Analyze what code is affected by changing a symbol
23
- * cgraphx affected [files] Find test files affected by changes
24
- * cgraphx upgrade [version] Update cgraphx to the latest release
25
- */
26
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
27
- if (k2 === undefined) k2 = k;
28
- var desc = Object.getOwnPropertyDescriptor(m, k);
29
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
30
- desc = { enumerable: true, get: function() { return m[k]; } };
31
- }
32
- Object.defineProperty(o, k2, desc);
33
- }) : (function(o, m, k, k2) {
34
- if (k2 === undefined) k2 = k;
35
- o[k2] = m[k];
36
- }));
37
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
38
- Object.defineProperty(o, "default", { enumerable: true, value: v });
39
- }) : function(o, v) {
40
- o["default"] = v;
41
- });
42
- var __importStar = (this && this.__importStar) || (function () {
43
- var ownKeys = function(o) {
44
- ownKeys = Object.getOwnPropertyNames || function (o) {
45
- var ar = [];
46
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
47
- return ar;
48
- };
49
- return ownKeys(o);
50
- };
51
- return function (mod) {
52
- if (mod && mod.__esModule) return mod;
53
- var result = {};
54
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
55
- __setModuleDefault(result, mod);
56
- return result;
57
- };
58
- })();
59
- Object.defineProperty(exports, "__esModule", { value: true });
60
- const commander_1 = require("commander");
61
- const path = __importStar(require("path"));
62
- const fs = __importStar(require("fs"));
63
- const directory_1 = require("../directory");
64
- const worktree_1 = require("../sync/worktree");
65
- const shimmer_progress_1 = require("../ui/shimmer-progress");
66
- const glyphs_1 = require("../ui/glyphs");
67
- const node_version_check_1 = require("./node-version-check");
68
- const fatal_handler_1 = require("./fatal-handler");
69
- const wasm_runtime_flags_1 = require("../extraction/wasm-runtime-flags");
70
- const extraction_version_1 = require("../extraction/extraction-version");
71
- const telemetry_1 = require("../telemetry");
72
- const cli_1 = require("../markdown/cli");
73
- const cli_2 = require("../dbquery/cli");
74
- const cli_3 = require("../timeline/cli");
75
- const upgrade_1 = require("../upgrade");
76
- // Lazy-load heavy modules (CodeGraph, runInstaller) to keep CLI startup fast.
77
- async function loadCodeGraph() {
78
- try {
79
- return await Promise.resolve().then(() => __importStar(require('../index')));
80
- }
81
- catch (err) {
82
- const msg = err instanceof Error ? err.message : String(err);
83
- console.error(`\x1b[31m${(0, glyphs_1.getGlyphs)().err}\x1b[0m Failed to load cgraphx modules.`);
84
- console.error(`\n Node: ${process.version} Platform: ${process.platform} ${process.arch}`);
85
- console.error(`\n Error: ${msg}`);
86
- console.error(`\n Try reinstalling with: npm install -g ${upgrade_1.NPM_PACKAGE}\n`);
87
- process.exit(1);
88
- }
89
- }
90
- // Dynamic import helper — tsc compiles import() to require() in CJS mode,
91
- // which fails for ESM-only packages. This bypasses the transformation.
92
- // eslint-disable-next-line @typescript-eslint/no-implied-eval
93
- const importESM = new Function('specifier', 'return import(specifier)');
94
- // Block cgraphx on Node.js 25.x — V8's turboshaft WASM JIT has a Zone
95
- // allocator bug that reliably crashes when compiling tree-sitter
96
- // grammars (see #54, #81, #140). The previous behaviour was a soft
97
- // console.warn that scrolls off-screen before the OOM crash 30 seconds
98
- // later, leading to a steady stream of "what is this OOM" reports.
99
- // Node 25.x hard-exits (known V8 turboshaft Zone OOM, #81). Node 26+ is
100
- // unverified but not blocked — the launcher's --liftoff-only flag keeps
101
- // tree-sitter on the Liftoff baseline compiler, away from the turboshaft
102
- // path where the bug lives, so the same crash should not fire. We still
103
- // warn loudly so users know they're off the verified track.
104
- const nodeVersion = process.versions.node;
105
- const nodeMajor = parseInt(nodeVersion.split('.')[0] ?? '0', 10);
106
- if (nodeMajor === 25) {
107
- process.stderr.write((0, node_version_check_1.buildNode25BlockBanner)(nodeVersion) + '\n');
108
- if (!process.env.CGRAPHX_ALLOW_UNSAFE_NODE) {
109
- process.exit(1);
110
- }
111
- // Override active — banner shown for visibility, continuing.
112
- }
113
- else if (nodeMajor >= 26) {
114
- process.stderr.write((0, node_version_check_1.buildNodeUntestedBanner)(nodeVersion) + '\n');
115
- // No exit — warning only.
116
- }
117
- // Enforce the supported Node floor. `engines` in package.json only *warns* on
118
- // install (unless engine-strict), so hard-block here to actually keep users off
119
- // unsupported versions. Mirrors the 25+ block above. See package.json `engines`.
120
- if (nodeMajor < node_version_check_1.MIN_NODE_MAJOR) {
121
- process.stderr.write((0, node_version_check_1.buildNodeTooOldBanner)(nodeVersion) + '\n');
122
- if (!process.env.CGRAPHX_ALLOW_UNSAFE_NODE) {
123
- process.exit(1);
124
- }
125
- // Override active — banner shown for visibility, continuing.
126
- }
127
- // Re-exec with V8's `--liftoff-only` if it isn't already set, so tree-sitter's
128
- // large WASM grammars never hit the turboshaft Zone OOM (`Fatal process out of
129
- // memory: Zone`) on Node >= 22. No-op under the bundled launcher, which already
130
- // passes the flag. Must run before any grammar (in the parse worker, which
131
- // inherits this process's flags) is compiled. See ../extraction/wasm-runtime-flags.
132
- (0, wasm_runtime_flags_1.relaunchWithWasmRuntimeFlagsIfNeeded)(__filename);
133
- // Last-resort fatal handlers: log a bounded line and exit non-zero. A fault
134
- // that reaches here escaped every boundary, so the process is in an undefined
135
- // state — keeping it alive is what let the detached MCP daemon orphan and pin a
136
- // CPU core with no recovery (#799, #850). Installed before the command branch
137
- // so it also covers a synchronous throw during startup. See ./fatal-handler.
138
- (0, fatal_handler_1.installFatalHandlers)();
139
- // Check if running with no arguments - run installer
140
- if (process.argv.length === 2) {
141
- Promise.resolve().then(() => __importStar(require('../installer'))).then(({ runInstaller }) => runInstaller()).catch((err) => {
142
- console.error('Installation failed:', err instanceof Error ? err.message : String(err));
143
- process.exit(1);
144
- });
145
- }
146
- else {
147
- // Normal CLI flow
148
- main();
149
- }
150
- function main() {
151
- const program = new commander_1.Command();
152
- // Version from package.json
153
- const packageJson = JSON.parse(fs.readFileSync(path.join(__dirname, '..', '..', 'package.json'), 'utf-8'));
154
- // Make the version trivial to reach. commander's `.version()` (below) wires up
155
- // `--version` and `-V`; intercept the spellings it can't — lowercase `-v` and
156
- // single-dash `-version` — before any parsing. (commander's version short flag
157
- // is the capital `-V`, and its parser rejects a multi-character single-dash
158
- // flag.) The bare `cgraphx version` subcommand is registered further down so
159
- // the affordance also shows up in `cgraphx --help`.
160
- const firstArg = process.argv[2];
161
- if (firstArg === '-v' || firstArg === '-version') {
162
- console.log(packageJson.version);
163
- return;
164
- }
165
- // =============================================================================
166
- // ANSI Color Helpers (avoid chalk ESM issues)
167
- // =============================================================================
168
- const colors = {
169
- reset: '\x1b[0m',
170
- bold: '\x1b[1m',
171
- dim: '\x1b[2m',
172
- red: '\x1b[31m',
173
- green: '\x1b[32m',
174
- yellow: '\x1b[33m',
175
- blue: '\x1b[34m',
176
- cyan: '\x1b[36m',
177
- white: '\x1b[37m',
178
- gray: '\x1b[90m',
179
- };
180
- const chalk = {
181
- bold: (s) => `${colors.bold}${s}${colors.reset}`,
182
- dim: (s) => `${colors.dim}${s}${colors.reset}`,
183
- red: (s) => `${colors.red}${s}${colors.reset}`,
184
- green: (s) => `${colors.green}${s}${colors.reset}`,
185
- yellow: (s) => `${colors.yellow}${s}${colors.reset}`,
186
- blue: (s) => `${colors.blue}${s}${colors.reset}`,
187
- cyan: (s) => `${colors.cyan}${s}${colors.reset}`,
188
- white: (s) => `${colors.white}${s}${colors.reset}`,
189
- gray: (s) => `${colors.gray}${s}${colors.reset}`,
190
- };
191
- program
192
- .name('cgraphx')
193
- .description('Code intelligence and knowledge graph for any codebase')
194
- .version(packageJson.version);
195
- // Anonymous usage telemetry (see TELEMETRY.md): record the invoked subcommand
196
- // NAME only — never arguments or paths. Counts buffer locally; network sends
197
- // piggyback on commands that run long anyway (quick commands only append to
198
- // the local buffer at exit, costing nothing).
199
- // install/uninstall are absent on purpose: the installer flushes at its own
200
- // end, AFTER its consent prompt — a flush here would fire the first-run
201
- // notice before the user ever sees the toggle.
202
- const TELEMETRY_FLUSH_COMMANDS = new Set(['init', 'uninit', 'index', 'sync', 'upgrade']);
203
- program.hook('preAction', (_thisCommand, actionCommand) => {
204
- try {
205
- // The detached daemon re-invokes `serve --mcp` internally — not a user action.
206
- if (process.env.CGRAPHX_DAEMON_INTERNAL)
207
- return;
208
- const name = actionCommand.name();
209
- if (name === 'telemetry')
210
- return; // managing telemetry is not usage
211
- (0, telemetry_1.getTelemetry)().recordUsage('cli_command', name, true);
212
- if (TELEMETRY_FLUSH_COMMANDS.has(name))
213
- (0, telemetry_1.getTelemetry)().maybeFlush();
214
- }
215
- catch {
216
- /* telemetry must never break the CLI */
217
- }
218
- });
219
- // =============================================================================
220
- // Helper Functions
221
- // =============================================================================
222
- /**
223
- * Resolve project path from argument or current directory
224
- * Walks up parent directories to find nearest initialized cgraphx project
225
- * (must have .cgraphx/cgraphx.db, not just .cgraphx/lessons.db)
226
- */
227
- function resolveProjectPath(pathArg) {
228
- const absolutePath = path.resolve(pathArg || process.cwd());
229
- // If exact path is initialized (has cgraphx.db), use it
230
- if ((0, directory_1.isInitialized)(absolutePath)) {
231
- return absolutePath;
232
- }
233
- // Walk up to find nearest parent with cgraphx initialized
234
- // Note: findNearestCodeGraphRoot finds any .cgraphx folder, but we need one with cgraphx.db
235
- let current = absolutePath;
236
- const root = path.parse(current).root;
237
- while (current !== root) {
238
- const parent = path.dirname(current);
239
- if (parent === current)
240
- break;
241
- current = parent;
242
- if ((0, directory_1.isInitialized)(current)) {
243
- return current;
244
- }
245
- }
246
- // Not found - return original path (will fail later with helpful error)
247
- return absolutePath;
248
- }
249
- /**
250
- * Format a number with commas
251
- */
252
- function formatNumber(n) {
253
- return n.toLocaleString();
254
- }
255
- /**
256
- * Format duration in milliseconds to human readable
257
- */
258
- function formatDuration(ms) {
259
- if (ms < 1000) {
260
- return `${ms}ms`;
261
- }
262
- const seconds = ms / 1000;
263
- if (seconds < 60) {
264
- return `${seconds.toFixed(1)}s`;
265
- }
266
- const minutes = Math.floor(seconds / 60);
267
- const remainingSeconds = seconds % 60;
268
- return `${minutes}m ${remainingSeconds.toFixed(0)}s`;
269
- }
270
- // Shimmer progress renderer (runs in a worker thread for smooth animation)
271
- // Imported at top of file from '../ui/shimmer-progress'
272
- /**
273
- * Create a plain-text progress callback for --verbose mode.
274
- * No animations, no ANSI tricks — just timestamped lines to stdout.
275
- */
276
- function createVerboseProgress() {
277
- let lastPhase = '';
278
- let lastPct = -1;
279
- const startTime = Date.now();
280
- return (progress) => {
281
- const elapsed = ((Date.now() - startTime) / 1000).toFixed(1);
282
- if (progress.phase !== lastPhase) {
283
- lastPhase = progress.phase;
284
- lastPct = -1;
285
- console.log(`[${elapsed}s] Phase: ${progress.phase}`);
286
- }
287
- if (progress.total > 0) {
288
- const pct = Math.floor((progress.current / progress.total) * 100);
289
- // Log every 5% to keep output manageable
290
- if (pct >= lastPct + 5 || progress.current === progress.total) {
291
- lastPct = pct;
292
- console.log(`[${elapsed}s] ${progress.current}/${progress.total} (${pct}%)${progress.currentFile ? ` ${(0, glyphs_1.getGlyphs)().dash} ${progress.currentFile}` : ''}`);
293
- }
294
- }
295
- else if (progress.current > 0) {
296
- // Scanning phase (no total yet) — log periodically
297
- if (progress.current % 1000 === 0 || progress.current === 1) {
298
- console.log(`[${elapsed}s] ${formatNumber(progress.current)} files found`);
299
- }
300
- }
301
- };
302
- }
303
- /**
304
- * Print success message
305
- */
306
- function success(message) {
307
- console.log(chalk.green((0, glyphs_1.getGlyphs)().ok) + ' ' + message);
308
- }
309
- /**
310
- * Print error message
311
- */
312
- function error(message) {
313
- console.error(chalk.red((0, glyphs_1.getGlyphs)().err) + ' ' + message);
314
- }
315
- /**
316
- * Print info message
317
- */
318
- function info(message) {
319
- console.log(chalk.blue((0, glyphs_1.getGlyphs)().info) + ' ' + message);
320
- }
321
- /**
322
- * Print warning message
323
- */
324
- function warn(message) {
325
- console.log(chalk.yellow((0, glyphs_1.getGlyphs)().warn) + ' ' + message);
326
- }
327
- /**
328
- * Print indexing results using clack log methods
329
- */
330
- function printIndexResult(clack, result, projectPath) {
331
- const hasErrors = result.filesErrored > 0;
332
- // Surface non-file-level failures (e.g. lock-acquisition failure
333
- // when another indexer is running) before the file-count branches.
334
- // Without this the CLI falls through to "No files found to index",
335
- // which is actively misleading — the index DID run, it just couldn't
336
- // get the lock.
337
- //
338
- // If success is false but no severity:'error' entry exists in
339
- // `result.errors` (degenerate case — shouldn't happen in practice
340
- // but worth guarding because the result shape is plumbed through
341
- // multiple call sites), fall back to a generic message rather than
342
- // continuing to the misleading "No files found" branch or throwing.
343
- if (!result.success && !hasErrors && result.filesIndexed === 0) {
344
- const generic = result.errors.find((e) => e.severity === 'error');
345
- clack.log.error(generic?.message ?? `Indexing failed ${(0, glyphs_1.getGlyphs)().dash} no further details available`);
346
- return;
347
- }
348
- if (result.filesIndexed > 0) {
349
- if (hasErrors) {
350
- clack.log.success(`Indexed ${formatNumber(result.filesIndexed)} files (${formatNumber(result.filesErrored)} could not be parsed)`);
351
- }
352
- else {
353
- clack.log.success(`Indexed ${formatNumber(result.filesIndexed)} files`);
354
- }
355
- clack.log.info(`${formatNumber(result.nodesCreated)} nodes, ${formatNumber(result.edgesCreated)} edges in ${formatDuration(result.durationMs)}`);
356
- }
357
- else if (hasErrors) {
358
- clack.log.error(`Indexing failed ${(0, glyphs_1.getGlyphs)().dash} all ${formatNumber(result.filesErrored)} files had errors`);
359
- }
360
- else {
361
- clack.log.warn('No files found to index');
362
- }
363
- if (hasErrors) {
364
- const errorsByCode = new Map();
365
- for (const err of result.errors) {
366
- if (err.severity === 'error') {
367
- const code = err.code || 'unknown';
368
- errorsByCode.set(code, (errorsByCode.get(code) || 0) + 1);
369
- }
370
- }
371
- const codeLabels = {
372
- parse_error: 'files failed to parse',
373
- read_error: 'files could not be read',
374
- size_exceeded: 'files exceeded size limit',
375
- path_traversal: 'blocked paths',
376
- unsupported_language: 'unsupported language',
377
- parser_error: 'parser initialization failures',
378
- };
379
- const breakdown = Array.from(errorsByCode)
380
- .map(([code, count]) => `${formatNumber(count)} ${codeLabels[code] || code}`)
381
- .join('\n');
382
- clack.note(breakdown, 'Error breakdown');
383
- if (projectPath) {
384
- writeErrorLog(projectPath, result.errors);
385
- clack.log.info('See .cgraphx/errors.log for details');
386
- }
387
- if (result.filesIndexed > 0) {
388
- clack.log.info(`The index is fully usable ${(0, glyphs_1.getGlyphs)().dash} only the failed files are missing.`);
389
- }
390
- }
391
- else if (projectPath) {
392
- const logPath = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'errors.log');
393
- if (fs.existsSync(logPath)) {
394
- fs.unlinkSync(logPath);
395
- }
396
- }
397
- }
398
- /**
399
- * Write detailed error log to .cgraphx/errors.log
400
- */
401
- function writeErrorLog(projectPath, errors) {
402
- const cgDir = (0, directory_1.getCodeGraphDir)(projectPath);
403
- if (!fs.existsSync(cgDir))
404
- return;
405
- const logPath = path.join(cgDir, 'errors.log');
406
- // Group errors by file path
407
- const errorsByFile = new Map();
408
- const noFileErrors = [];
409
- for (const err of errors) {
410
- if (err.severity !== 'error')
411
- continue;
412
- if (err.filePath) {
413
- let list = errorsByFile.get(err.filePath);
414
- if (!list) {
415
- list = [];
416
- errorsByFile.set(err.filePath, list);
417
- }
418
- list.push({ message: err.message, code: err.code });
419
- }
420
- else {
421
- noFileErrors.push({ message: err.message, code: err.code });
422
- }
423
- }
424
- const lines = [
425
- `cgraphx Error Log - ${new Date().toISOString()}`,
426
- `${errorsByFile.size} files with errors`,
427
- '',
428
- ];
429
- for (const [filePath, fileErrors] of errorsByFile) {
430
- for (const err of fileErrors) {
431
- lines.push(`${filePath}: ${err.message}`);
432
- }
433
- }
434
- for (const err of noFileErrors) {
435
- lines.push(err.message);
436
- }
437
- fs.writeFileSync(logPath, lines.join('\n') + '\n');
438
- }
439
- /**
440
- * Telemetry for a completed full index (see TELEMETRY.md). The bounded flush
441
- * keeps init/index responsive (these commands just ran for seconds anyway)
442
- * while delivering the event promptly.
443
- */
444
- async function recordIndexTelemetry(cg, result) {
445
- (0, telemetry_1.recordIndexEvent)(cg, result);
446
- await (0, telemetry_1.getTelemetry)().flushNow();
447
- }
448
- // =============================================================================
449
- // Commands
450
- // =============================================================================
451
- /**
452
- * cgraphx init [path]
453
- */
454
- program
455
- .command('init [path]')
456
- .description('Initialize cgraphx in a project directory and build the initial index')
457
- .option('-i, --index', 'Deprecated: indexing now runs by default; flag accepted for backward compatibility')
458
- .option('-f, --force', 'Initialize even if the path looks like your home directory or a filesystem root')
459
- .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
460
- .action(async (pathArg, options) => {
461
- const projectPath = path.resolve(pathArg || process.cwd());
462
- const clack = await importESM('@clack/prompts');
463
- clack.intro('Initializing cgraphx');
464
- try {
465
- // Refuse to index your home directory / a filesystem root — it pulls in
466
- // caches, other projects, and your whole tree (a multi-GB index + watcher
467
- // churn, and on pre-1.0 macOS a machine-crashing fd blowup, #845).
468
- const unsafe = (0, directory_1.unsafeIndexRootReason)(projectPath);
469
- if (unsafe && !options.force) {
470
- clack.log.error(`Refusing to initialize in ${projectPath} — it looks like ${unsafe}.`);
471
- clack.log.info('Run this inside a specific project directory, or pass --force if you really mean to index everything under it.');
472
- clack.outro('');
473
- process.exitCode = 1;
474
- return;
475
- }
476
- if ((0, directory_1.isInitialized)(projectPath)) {
477
- clack.log.warn(`Already initialized in ${projectPath}`);
478
- clack.log.info('Use "cgraphx index" to re-index or "cgraphx sync" to update');
479
- try {
480
- const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
481
- await offerWatchFallback(clack, projectPath);
482
- }
483
- catch { /* non-fatal */ }
484
- clack.outro('');
485
- return;
486
- }
487
- const { default: CodeGraph } = await loadCodeGraph();
488
- const cg = await CodeGraph.init(projectPath, { index: false });
489
- clack.log.success(`Initialized in ${projectPath}`);
490
- // Indexing runs by default now. The legacy -i/--index flag is still
491
- // accepted (so existing muscle memory and scripts don't break) but is a
492
- // no-op — initializing always builds the initial index.
493
- let result;
494
- if (options.verbose) {
495
- result = await cg.indexAll({
496
- onProgress: createVerboseProgress(),
497
- verbose: true,
498
- });
499
- }
500
- else {
501
- process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
502
- const progress = (0, shimmer_progress_1.createShimmerProgress)();
503
- result = await cg.indexAll({
504
- onProgress: progress.onProgress,
505
- });
506
- await progress.stop();
507
- }
508
- printIndexResult(clack, result, projectPath);
509
- await recordIndexTelemetry(cg, result);
510
- try {
511
- const { offerWatchFallback } = await Promise.resolve().then(() => __importStar(require('../installer')));
512
- await offerWatchFallback(clack, projectPath);
513
- }
514
- catch { /* non-fatal */ }
515
- clack.outro('Done');
516
- cg.destroy();
517
- }
518
- catch (err) {
519
- clack.log.error(`Failed: ${err instanceof Error ? err.message : String(err)}`);
520
- process.exit(1);
521
- }
522
- });
523
- /**
524
- * cgraphx uninit [path]
525
- */
526
- program
527
- .command('uninit [path]')
528
- .description('Remove cgraphx from a project (deletes .cgraphx/ directory)')
529
- .option('-f, --force', 'Skip confirmation prompt')
530
- .action(async (pathArg, options) => {
531
- const projectPath = resolveProjectPath(pathArg);
532
- try {
533
- if (!(0, directory_1.isInitialized)(projectPath)) {
534
- warn(`cgraphx is not initialized in ${projectPath}`);
535
- return;
536
- }
537
- if (!options.force) {
538
- // Confirm with user
539
- const readline = await Promise.resolve().then(() => __importStar(require('readline')));
540
- const rl = readline.createInterface({ input: process.stdin, output: process.stdout });
541
- const answer = await new Promise((resolve) => {
542
- rl.question(chalk.yellow(`${(0, glyphs_1.getGlyphs)().warn} This will permanently delete all cgraphx data. Continue? (y/N) `), resolve);
543
- });
544
- rl.close();
545
- if (answer.toLowerCase() !== 'y') {
546
- info('Cancelled');
547
- return;
548
- }
549
- }
550
- const { default: CodeGraph } = await loadCodeGraph();
551
- const cg = CodeGraph.openSync(projectPath);
552
- cg.uninitialize();
553
- // Clean up any git sync hooks we installed (no-op if none / not a repo).
554
- try {
555
- const { removeGitSyncHook } = await Promise.resolve().then(() => __importStar(require('../sync/git-hooks')));
556
- const removed = removeGitSyncHook(projectPath);
557
- if (removed.installed.length > 0) {
558
- info(`Removed git ${removed.installed.join(', ')} sync hook${removed.installed.length > 1 ? 's' : ''}`);
559
- }
560
- }
561
- catch { /* non-fatal */ }
562
- success(`Removed cgraphx from ${projectPath}`);
563
- // Churn signal — and flush now, since after an uninit there may be no
564
- // "next run" to deliver it.
565
- try {
566
- (0, telemetry_1.getTelemetry)().recordLifecycle('uninstall', {});
567
- await (0, telemetry_1.getTelemetry)().flushNow();
568
- }
569
- catch { /* non-fatal */ }
570
- }
571
- catch (err) {
572
- error(`Failed to uninitialize: ${err instanceof Error ? err.message : String(err)}`);
573
- process.exit(1);
574
- }
575
- });
576
- /**
577
- * cgraphx index [path]
578
- */
579
- program
580
- .command('index [path]')
581
- .description('Rebuild the full index from scratch (same result as a fresh init)')
582
- .option('-f, --force', 'Index even if the path looks like your home directory or a filesystem root')
583
- .option('-q, --quiet', 'Suppress progress output')
584
- .option('-v, --verbose', 'Show detailed worker lifecycle and memory info')
585
- .action(async (pathArg, options) => {
586
- const projectPath = resolveProjectPath(pathArg);
587
- try {
588
- // Don't (re)index your home directory / a filesystem root (#845). --force
589
- // doubles as the override.
590
- const unsafe = (0, directory_1.unsafeIndexRootReason)(projectPath);
591
- if (unsafe && !options.force) {
592
- error(`Refusing to index ${projectPath} — it looks like ${unsafe}. Pass --force to override.`);
593
- process.exit(1);
594
- }
595
- if (!(0, directory_1.isInitialized)(projectPath)) {
596
- error(`cgraphx not initialized in ${projectPath}`);
597
- info('Run "cgraphx init" first');
598
- process.exit(1);
599
- }
600
- const { default: CodeGraph } = await loadCodeGraph();
601
- const cg = await CodeGraph.open(projectPath);
602
- if (options.quiet) {
603
- // Quiet mode: no UI, just run. `index` is a full re-index, so clear the
604
- // existing graph and rebuild from scratch (see the note below — #874).
605
- cg.clear();
606
- const result = await cg.indexAll();
607
- if (!result.success)
608
- process.exit(1);
609
- cg.destroy();
610
- return;
611
- }
612
- const clack = await importESM('@clack/prompts');
613
- clack.intro('Indexing project');
614
- // `index` is a FULL re-index: clear the existing graph and rebuild it from
615
- // scratch so the result is identical to a fresh `init`. Without the clear,
616
- // indexAll() skips every unchanged file by its content hash and reports
617
- // "0 nodes, 0 edges" against the already-populated graph — which reads as
618
- // "index wiped my index" (#874). For fast incremental updates use `sync`.
619
- cg.clear();
620
- let result;
621
- if (options.verbose) {
622
- result = await cg.indexAll({
623
- onProgress: createVerboseProgress(),
624
- verbose: true,
625
- });
626
- }
627
- else {
628
- process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
629
- const progress = (0, shimmer_progress_1.createShimmerProgress)();
630
- result = await cg.indexAll({
631
- onProgress: progress.onProgress,
632
- });
633
- await progress.stop();
634
- }
635
- printIndexResult(clack, result, projectPath);
636
- await recordIndexTelemetry(cg, result);
637
- if (!result.success) {
638
- process.exit(1);
639
- }
640
- clack.outro('Done');
641
- cg.destroy();
642
- }
643
- catch (err) {
644
- error(`Failed to index: ${err instanceof Error ? err.message : String(err)}`);
645
- process.exit(1);
646
- }
647
- });
648
- /**
649
- * cgraphx sync [path]
650
- */
651
- program
652
- .command('sync [path]')
653
- .description('Sync changes since last index')
654
- .option('-q, --quiet', 'Suppress output (for git hooks)')
655
- .action(async (pathArg, options) => {
656
- const projectPath = resolveProjectPath(pathArg);
657
- try {
658
- if (!(0, directory_1.isInitialized)(projectPath)) {
659
- if (!options.quiet) {
660
- error(`cgraphx not initialized in ${projectPath}`);
661
- }
662
- process.exit(1);
663
- }
664
- const { default: CodeGraph } = await loadCodeGraph();
665
- const cg = await CodeGraph.open(projectPath);
666
- if (options.quiet) {
667
- await cg.sync();
668
- cg.destroy();
669
- return;
670
- }
671
- const clack = await importESM('@clack/prompts');
672
- clack.intro('Syncing cgraphx');
673
- process.stdout.write(`${colors.dim}${(0, glyphs_1.getGlyphs)().rail}${colors.reset}\n`);
674
- const progress = (0, shimmer_progress_1.createShimmerProgress)();
675
- const result = await cg.sync({
676
- onProgress: progress.onProgress,
677
- });
678
- await progress.stop();
679
- const totalChanges = result.filesAdded + result.filesModified + result.filesRemoved;
680
- if (totalChanges === 0) {
681
- clack.log.info('Already up to date');
682
- }
683
- else {
684
- clack.log.success(`Synced ${formatNumber(totalChanges)} changed files`);
685
- const details = [];
686
- if (result.filesAdded > 0)
687
- details.push(`Added: ${result.filesAdded}`);
688
- if (result.filesModified > 0)
689
- details.push(`Modified: ${result.filesModified}`);
690
- if (result.filesRemoved > 0)
691
- details.push(`Removed: ${result.filesRemoved}`);
692
- clack.log.info(`${details.join(', ')} ${(0, glyphs_1.getGlyphs)().dash} ${formatNumber(result.nodesUpdated)} nodes in ${formatDuration(result.durationMs)}`);
693
- }
694
- clack.outro('Done');
695
- cg.destroy();
696
- }
697
- catch (err) {
698
- if (!options.quiet) {
699
- error(`Failed to sync: ${err instanceof Error ? err.message : String(err)}`);
700
- }
701
- process.exit(1);
702
- }
703
- });
704
- /**
705
- * cgraphx status [path]
706
- */
707
- program
708
- .command('status [path]')
709
- .description('Show index status and statistics')
710
- .option('-j, --json', 'Output as JSON')
711
- .action(async (pathArg, options) => {
712
- const projectPath = resolveProjectPath(pathArg);
713
- // The directory the user actually ran from, before walking up to the index
714
- // root. Used to detect when the resolved index lives in a different git
715
- // working tree (e.g. a nested worktree borrowing the main checkout's index).
716
- const startPath = path.resolve(pathArg || process.cwd());
717
- const worktreeMismatch = (0, worktree_1.detectWorktreeIndexMismatch)(startPath, projectPath);
718
- try {
719
- if (!(0, directory_1.isInitialized)(projectPath)) {
720
- if (options.json) {
721
- console.log(JSON.stringify({
722
- initialized: false,
723
- version: packageJson.version,
724
- projectPath,
725
- indexPath: (0, directory_1.getCodeGraphDir)(projectPath),
726
- lastIndexed: null,
727
- }));
728
- return;
729
- }
730
- console.log(chalk.bold('\ncgraphx Status\n'));
731
- info(`Project: ${projectPath}`);
732
- warn('Not initialized');
733
- info('Run "cgraphx init" to initialize');
734
- return;
735
- }
736
- const { default: CodeGraph } = await loadCodeGraph();
737
- const cg = await CodeGraph.open(projectPath);
738
- const stats = cg.getStats();
739
- const changes = cg.getChangedFiles();
740
- const backend = cg.getBackend();
741
- const journalMode = cg.getJournalMode();
742
- const buildInfo = cg.getIndexBuildInfo();
743
- const reindexRecommended = cg.isIndexStale();
744
- // JSON output mode
745
- if (options.json) {
746
- const lastIndexedMs = cg.getLastIndexedAt();
747
- console.log(JSON.stringify({
748
- initialized: true,
749
- version: packageJson.version,
750
- projectPath,
751
- indexPath: (0, directory_1.getCodeGraphDir)(projectPath),
752
- lastIndexed: lastIndexedMs != null ? new Date(lastIndexedMs).toISOString() : null,
753
- fileCount: stats.fileCount,
754
- nodeCount: stats.nodeCount,
755
- edgeCount: stats.edgeCount,
756
- dbSizeBytes: stats.dbSizeBytes,
757
- backend,
758
- journalMode,
759
- nodesByKind: stats.nodesByKind,
760
- languages: Object.entries(stats.filesByLanguage).filter(([, count]) => count > 0).map(([lang]) => lang),
761
- pendingChanges: {
762
- added: changes.added.length,
763
- modified: changes.modified.length,
764
- removed: changes.removed.length,
765
- },
766
- worktreeMismatch: worktreeMismatch
767
- ? { worktreeRoot: worktreeMismatch.worktreeRoot, indexRoot: worktreeMismatch.indexRoot }
768
- : null,
769
- index: {
770
- builtWithVersion: buildInfo.version,
771
- builtWithExtractionVersion: buildInfo.extractionVersion,
772
- currentExtractionVersion: extraction_version_1.EXTRACTION_VERSION,
773
- reindexRecommended,
774
- },
775
- }));
776
- cg.destroy();
777
- return;
778
- }
779
- console.log(chalk.bold('\ncgraphx Status\n'));
780
- // Project info
781
- console.log(chalk.cyan('Project:'), projectPath);
782
- if (worktreeMismatch) {
783
- warn((0, worktree_1.worktreeMismatchWarning)(worktreeMismatch));
784
- }
785
- console.log();
786
- // Index stats
787
- console.log(chalk.bold('Index Statistics:'));
788
- console.log(` Files: ${formatNumber(stats.fileCount)}`);
789
- console.log(` Nodes: ${formatNumber(stats.nodeCount)}`);
790
- console.log(` Edges: ${formatNumber(stats.edgeCount)}`);
791
- console.log(` DB Size: ${(stats.dbSizeBytes / 1024 / 1024).toFixed(2)} MB`);
792
- // Surface the active SQLite backend (node:sqlite — Node's built-in real
793
- // SQLite, full WAL + FTS5, no native build).
794
- const backendLabel = chalk.green(`node:sqlite ${(0, glyphs_1.getGlyphs)().dash} built-in (full WAL)`);
795
- console.log(` Backend: ${backendLabel}`);
796
- // Effective journal mode: 'wal' means concurrent reads never block on a
797
- // writer; anything else means they can ("database is locked"). node:sqlite
798
- // supports WAL everywhere, so a non-wal mode means the filesystem can't
799
- // (network mounts, WSL2 /mnt). See issue #238.
800
- const journalLabel = journalMode === 'wal'
801
- ? chalk.green('wal')
802
- : chalk.yellow(`${journalMode || 'unknown'} ${(0, glyphs_1.getGlyphs)().dash} WAL inactive; reads can block on writes`);
803
- console.log(` Journal: ${journalLabel}`);
804
- console.log();
805
- // Node breakdown
806
- console.log(chalk.bold('Nodes by Kind:'));
807
- const nodesByKind = Object.entries(stats.nodesByKind)
808
- .filter(([, count]) => count > 0)
809
- .sort((a, b) => b[1] - a[1]);
810
- for (const [kind, count] of nodesByKind) {
811
- console.log(` ${kind.padEnd(15)} ${formatNumber(count)}`);
812
- }
813
- console.log();
814
- // Language breakdown
815
- console.log(chalk.bold('Files by Language:'));
816
- const filesByLang = Object.entries(stats.filesByLanguage)
817
- .filter(([, count]) => count > 0)
818
- .sort((a, b) => b[1] - a[1]);
819
- for (const [lang, count] of filesByLang) {
820
- console.log(` ${lang.padEnd(15)} ${formatNumber(count)}`);
821
- }
822
- console.log();
823
- // Pending changes
824
- const totalChanges = changes.added.length + changes.modified.length + changes.removed.length;
825
- if (totalChanges > 0) {
826
- console.log(chalk.bold('Pending Changes:'));
827
- if (changes.added.length > 0) {
828
- console.log(` Added: ${changes.added.length} files`);
829
- }
830
- if (changes.modified.length > 0) {
831
- console.log(` Modified: ${changes.modified.length} files`);
832
- }
833
- if (changes.removed.length > 0) {
834
- console.log(` Removed: ${changes.removed.length} files`);
835
- }
836
- info('Run "cgraphx sync" to update the index');
837
- }
838
- else {
839
- success('Index is up to date');
840
- }
841
- console.log();
842
- // Re-index hint: the index was built by an older engine than the one now
843
- // running, so a rebuild would add data a migration can't backfill.
844
- if (reindexRecommended) {
845
- const builtWith = buildInfo.version ? `v${buildInfo.version.replace(/^v/, '')}` : 'an earlier version';
846
- warn(`Index was built by ${builtWith}; re-index to pick up this engine's improvements.`);
847
- info('Run "cgraphx index" (full rebuild) or "cgraphx sync"');
848
- console.log();
849
- }
850
- cg.destroy();
851
- }
852
- catch (err) {
853
- error(`Failed to get status: ${err instanceof Error ? err.message : String(err)}`);
854
- process.exit(1);
855
- }
856
- });
857
- /**
858
- * cgraphx query <search>
859
- */
860
- program
861
- .command('query <search>')
862
- .description('Search for symbols in the codebase')
863
- .option('-p, --path <path>', 'Project path')
864
- .option('-l, --limit <number>', 'Maximum results', '10')
865
- .option('-k, --kind <kind>', 'Filter by node kind (function, class, etc.)')
866
- .option('-j, --json', 'Output as JSON')
867
- .action(async (search, options) => {
868
- const projectPath = resolveProjectPath(options.path);
869
- try {
870
- if (!(0, directory_1.isInitialized)(projectPath)) {
871
- error(`cgraphx not initialized in ${projectPath}`);
872
- process.exit(1);
873
- }
874
- const { default: CodeGraph } = await loadCodeGraph();
875
- const cg = await CodeGraph.open(projectPath);
876
- const limit = parseInt(options.limit || '10', 10);
877
- const rawResults = cg.searchNodes(search, {
878
- limit,
879
- kinds: options.kind ? [options.kind] : undefined,
880
- });
881
- // Mirror the MCP search down-rank so the CLI also surfaces the
882
- // hand-written implementation before protobuf/gRPC scaffolding
883
- // when both share a name. See extraction/generated-detection.ts.
884
- const { isGeneratedFile } = await Promise.resolve().then(() => __importStar(require('../extraction/generated-detection')));
885
- const results = [...rawResults].sort((a, b) => {
886
- const aGen = isGeneratedFile(a.node.filePath) ? 1 : 0;
887
- const bGen = isGeneratedFile(b.node.filePath) ? 1 : 0;
888
- return aGen - bGen;
889
- });
890
- if (options.json) {
891
- console.log(JSON.stringify(results, null, 2));
892
- }
893
- else {
894
- if (results.length === 0) {
895
- info(`No results found for "${search}"`);
896
- }
897
- else {
898
- console.log(chalk.bold(`\nSearch Results for "${search}":\n`));
899
- for (const result of results) {
900
- const node = result.node;
901
- const location = `${node.filePath}:${node.startLine}`;
902
- const score = chalk.dim(`(${(result.score * 100).toFixed(0)}%)`);
903
- console.log(chalk.cyan(node.kind.padEnd(12)) +
904
- chalk.white(node.name) +
905
- ' ' + score);
906
- console.log(chalk.dim(` ${location}`));
907
- if (node.signature) {
908
- console.log(chalk.dim(` ${node.signature}`));
909
- }
910
- console.log();
911
- }
912
- }
913
- }
914
- cg.destroy();
915
- }
916
- catch (err) {
917
- error(`Search failed: ${err instanceof Error ? err.message : String(err)}`);
918
- process.exit(1);
919
- }
920
- });
921
- /**
922
- * cgraphx explore <query...>
923
- *
924
- * The CLI face of the MCP codegraph_explore tool — same handler, same
925
- * output (source of the relevant symbols grouped by file + the call path
926
- * among them). Exists so agents WITHOUT the MCP tools — Task-tool
927
- * subagents (which don't inherit MCP tools, #704) and non-MCP harnesses —
928
- * can reach the graph through a plain shell command.
929
- */
930
- program
931
- .command('explore <query...>')
932
- .description('Explore an area: relevant symbols\' source + call paths in one shot (same output as the codegraph_explore MCP tool)')
933
- .option('-p, --path <path>', 'Project path')
934
- .option('--max-files <number>', 'Maximum number of files to include source from')
935
- .action(async (queryParts, options) => {
936
- const projectPath = resolveProjectPath(options.path);
937
- try {
938
- if (!(0, directory_1.isInitialized)(projectPath)) {
939
- error(`cgraphx isn't available here — no .cgraphx/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable cgraphx with 'cgraphx init'.)`);
940
- process.exit(1);
941
- }
942
- const { default: CodeGraph } = await loadCodeGraph();
943
- const cg = await CodeGraph.open(projectPath);
944
- const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
945
- const handler = new ToolHandler(cg);
946
- const args = { query: queryParts.join(' ') };
947
- if (options.maxFiles)
948
- args.maxFiles = parseInt(options.maxFiles, 10);
949
- const result = await handler.execute('codegraph_explore', args);
950
- console.log(result.content[0]?.text ?? '');
951
- cg.destroy();
952
- if (result.isError)
953
- process.exit(1);
954
- }
955
- catch (err) {
956
- error(`Explore failed: ${err instanceof Error ? err.message : String(err)}`);
957
- process.exit(1);
958
- }
959
- });
960
- /**
961
- * cgraphx prompt-hook (hidden)
962
- *
963
- * A Claude Code `UserPromptSubmit` hook entry point. Reads `{prompt, cwd}` JSON
964
- * on stdin; for a structural/flow/impact prompt it runs `codegraph_explore` on
965
- * the indexed project and prints the result to stdout, which Claude injects into
966
- * the agent's context — so the agent's reflex grep/read has nothing left to find
967
- * and reliably uses cgraphx (the adoption problem). Installed by the installer
968
- * into Claude's settings.json (opt-in, default-yes).
969
- *
970
- * LOAD-BEARING: this must NEVER break the user's prompt. Every failure path —
971
- * kill-switch, non-structural prompt, no index, engine error — exits 0 with no
972
- * output. The only effect is additive context when it can confidently provide it.
973
- */
974
- program
975
- .command('prompt-hook', { hidden: true })
976
- .description('Claude UserPromptSubmit hook: inject cgraphx context for structural prompts (reads {prompt,cwd} JSON on stdin)')
977
- .action(async () => {
978
- try {
979
- // Kill-switch: lets a user disable the nudge without uninstalling /
980
- // editing settings.json (CI, low-power machines, personal preference).
981
- if (process.env.CGRAPHX_NO_PROMPT_HOOK === '1' || process.env.CGRAPHX_PROMPT_HOOK === '0')
982
- return;
983
- if (process.stdin.isTTY)
984
- return; // invoked by hand, no piped payload
985
- const raw = await new Promise((resolve) => {
986
- let data = '';
987
- process.stdin.setEncoding('utf8');
988
- process.stdin.on('data', (c) => { data += c; });
989
- process.stdin.on('end', () => resolve(data));
990
- process.stdin.on('error', () => resolve(data));
991
- });
992
- let input = {};
993
- try {
994
- input = JSON.parse(raw);
995
- }
996
- catch {
997
- return;
998
- }
999
- const prompt = String(input.prompt || '');
1000
- // Gate: only structural / flow / impact / where-how prompts get context.
1001
- // A cheap regex keeps every other prompt ("fix this typo") a zero-cost
1002
- // no-op so we never add latency where there's no structural answer to give.
1003
- const STRUCTURAL = /\b(how|where|trace|flow|path|reach(?:es|ed)?|call(?:s|ed|er|ers|ee)?|depend|impact|affect|wired?|connect|implement|architect|structure|breaks?|what calls|why does)\b/i;
1004
- if (!prompt || !STRUCTURAL.test(prompt))
1005
- return;
1006
- // Decide what to inject, shaped by WHERE the index(es) are: the nearest
1007
- // indexed ancestor of cwd, or — when cwd is an un-indexed workspace root
1008
- // whose indexed project(s) live in sub-dirs (the monorepo case, #964) —
1009
- // the sub-project the prompt points at, plus a `projectPath` nudge for any
1010
- // others. Without the down-scan the hook injected nothing at a monorepo
1011
- // root (it only walked up), so the validated adoption lever never fired
1012
- // exactly where the agent most needs it.
1013
- const plan = (0, directory_1.planFrontload)(String(input.cwd || process.cwd()), prompt);
1014
- if (!plan.exploreRoot && plan.nudgeProjects.length === 0)
1015
- return; // nothing reachable — the agent's normal tools apply
1016
- // A "pass projectPath" line for indexed sub-projects we did NOT front-load.
1017
- // Follow-up codegraph_explore calls against a sub-project (cwd isn't its
1018
- // index root) need an explicit projectPath, so spell it out.
1019
- const nudge = (projects, lead) => `${lead}\n${projects.map((p) => ` - projectPath: "${p}"`).join('\n')}\n`;
1020
- if (plan.exploreRoot) {
1021
- const { default: CodeGraph } = await loadCodeGraph();
1022
- const cg = await CodeGraph.open(plan.exploreRoot);
1023
- try {
1024
- const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
1025
- const handler = new ToolHandler(cg);
1026
- const result = await handler.execute('codegraph_explore', { query: prompt });
1027
- const text = result.content[0]?.text ?? '';
1028
- if (!result.isError && text.trim()) {
1029
- // Cap the injection so a large-repo explore can't flood the prompt.
1030
- const MAX = 16000;
1031
- const body = text.length > MAX ? `${text.slice(0, MAX)}\n…(truncated; call codegraph_explore for the rest)` : text;
1032
- // For a front-loaded SUB-project, a follow-up explore needs its path.
1033
- const more = plan.viaSubScan
1034
- ? `call codegraph_explore with projectPath: "${plan.exploreRoot}" for more`
1035
- : 'call codegraph_explore for more';
1036
- const others = plan.nudgeProjects.length
1037
- ? `\n${nudge(plan.nudgeProjects, 'Other indexed projects in this workspace — pass projectPath to query them:')}`
1038
- : '';
1039
- process.stdout.write(`<codegraph_context note="Structural context from cgraphx for this prompt — treat returned source as already read; ${more}.">\n${body}${others}\n</codegraph_context>\n`);
1040
- }
1041
- }
1042
- finally {
1043
- cg.destroy();
1044
- }
1045
- }
1046
- else {
1047
- // Several indexed sub-projects, none a clear match — don't guess; tell
1048
- // the agent they exist and how to query one.
1049
- process.stdout.write(`<codegraph_context note="cgraphx is available for this workspace's indexed sub-projects — query one by passing projectPath to codegraph_explore.">\n` +
1050
- nudge(plan.nudgeProjects, "This workspace's cgraphx indexes live in sub-projects. To use cgraphx, call codegraph_explore with the projectPath of the relevant one:") +
1051
- `</codegraph_context>\n`);
1052
- }
1053
- }
1054
- catch {
1055
- // Degradable by contract: never surface an error to the prompt pipeline.
1056
- }
1057
- });
1058
- /**
1059
- * cgraphx node <name>
1060
- *
1061
- * The CLI face of the MCP codegraph_node tool: one symbol's source +
1062
- * caller/callee trail, or a whole file with line numbers + dependents
1063
- * (Read-parity). Same subagent/non-MCP rationale as `explore`.
1064
- */
1065
- program
1066
- .command('node <name>')
1067
- .description('One symbol\'s source + caller/callee trail, or read a file with line numbers + dependents (same output as the codegraph_node MCP tool)')
1068
- .option('-p, --path <path>', 'Project path')
1069
- .option('-f, --file <file>', 'Treat as file mode (or disambiguate a symbol to this file)')
1070
- .option('--offset <number>', 'File mode: 1-based start line')
1071
- .option('--limit <number>', 'File mode: maximum lines')
1072
- .option('--symbols-only', 'File mode: just the symbol map + dependents')
1073
- .action(async (name, options) => {
1074
- const projectPath = resolveProjectPath(options.path);
1075
- try {
1076
- if (!(0, directory_1.isInitialized)(projectPath)) {
1077
- error(`cgraphx isn't available here — no .cgraphx/ index exists in ${projectPath}. If you are an AI agent: continue with your usual tools; indexing is the user's decision, do not run it yourself. (The project owner can enable cgraphx with 'cgraphx init'.)`);
1078
- process.exit(1);
1079
- }
1080
- const { default: CodeGraph } = await loadCodeGraph();
1081
- const cg = await CodeGraph.open(projectPath);
1082
- const { ToolHandler } = await Promise.resolve().then(() => __importStar(require('../mcp/tools')));
1083
- const handler = new ToolHandler(cg);
1084
- // A name with a path separator is a file read; otherwise a symbol
1085
- // (use --file for basename-only file reads or to pin an overload).
1086
- // Both separators: Windows users type src\auth\session.ts. Symbols
1087
- // never contain either ('/' isn't an identifier char anywhere we
1088
- // index; C++ scope is '::', JS members '.').
1089
- const args = {};
1090
- if (options.file) {
1091
- args.file = options.file;
1092
- if (name && name !== options.file)
1093
- args.symbol = name;
1094
- }
1095
- else if (name.includes('/') || name.includes('\\')) {
1096
- args.file = name.replace(/\\/g, '/');
1097
- }
1098
- else {
1099
- args.symbol = name;
1100
- args.includeCode = true;
1101
- }
1102
- if (options.offset)
1103
- args.offset = parseInt(options.offset, 10);
1104
- if (options.limit)
1105
- args.limit = parseInt(options.limit, 10);
1106
- if (options.symbolsOnly)
1107
- args.symbolsOnly = true;
1108
- const result = await handler.execute('codegraph_node', args);
1109
- console.log(result.content[0]?.text ?? '');
1110
- cg.destroy();
1111
- if (result.isError)
1112
- process.exit(1);
1113
- }
1114
- catch (err) {
1115
- error(`Node lookup failed: ${err instanceof Error ? err.message : String(err)}`);
1116
- process.exit(1);
1117
- }
1118
- });
1119
- /**
1120
- * cgraphx files [path]
1121
- */
1122
- program
1123
- .command('files')
1124
- .description('Show project file structure from the index')
1125
- .option('-p, --path <path>', 'Project path')
1126
- .option('--filter <dir>', 'Filter to files under this directory')
1127
- .option('--pattern <glob>', 'Filter files matching this glob pattern')
1128
- .option('--format <format>', 'Output format (tree, flat, grouped)', 'tree')
1129
- .option('--max-depth <number>', 'Maximum directory depth for tree format')
1130
- .option('--no-metadata', 'Hide file metadata (language, symbol count)')
1131
- .option('-j, --json', 'Output as JSON')
1132
- .action(async (options) => {
1133
- const projectPath = resolveProjectPath(options.path);
1134
- try {
1135
- if (!(0, directory_1.isInitialized)(projectPath)) {
1136
- error(`cgraphx not initialized in ${projectPath}`);
1137
- process.exit(1);
1138
- }
1139
- const { default: CodeGraph } = await loadCodeGraph();
1140
- const cg = await CodeGraph.open(projectPath);
1141
- let files = cg.getFiles();
1142
- if (files.length === 0) {
1143
- info('No files indexed. Run "cgraphx index" first.');
1144
- cg.destroy();
1145
- return;
1146
- }
1147
- // Filter by path prefix
1148
- if (options.filter) {
1149
- const filter = options.filter;
1150
- files = files.filter(f => f.path.startsWith(filter) || f.path.startsWith('./' + filter));
1151
- }
1152
- // Filter by glob pattern
1153
- if (options.pattern) {
1154
- const regex = globToRegex(options.pattern);
1155
- files = files.filter(f => regex.test(f.path));
1156
- }
1157
- if (files.length === 0) {
1158
- info('No files found matching the criteria.');
1159
- cg.destroy();
1160
- return;
1161
- }
1162
- // JSON output
1163
- if (options.json) {
1164
- const output = files.map(f => ({
1165
- path: f.path,
1166
- language: f.language,
1167
- nodeCount: f.nodeCount,
1168
- size: f.size,
1169
- }));
1170
- console.log(JSON.stringify(output, null, 2));
1171
- cg.destroy();
1172
- return;
1173
- }
1174
- const includeMetadata = options.metadata !== false;
1175
- const format = options.format || 'tree';
1176
- const maxDepth = options.maxDepth ? parseInt(options.maxDepth, 10) : undefined;
1177
- // Format output
1178
- switch (format) {
1179
- case 'flat':
1180
- console.log(chalk.bold(`\nFiles (${files.length}):\n`));
1181
- for (const file of files.sort((a, b) => a.path.localeCompare(b.path))) {
1182
- if (includeMetadata) {
1183
- console.log(` ${file.path} ${chalk.dim(`(${file.language}, ${file.nodeCount} symbols)`)}`);
1184
- }
1185
- else {
1186
- console.log(` ${file.path}`);
1187
- }
1188
- }
1189
- break;
1190
- case 'grouped':
1191
- console.log(chalk.bold(`\nFiles by Language (${files.length} total):\n`));
1192
- const byLang = new Map();
1193
- for (const file of files) {
1194
- const existing = byLang.get(file.language) || [];
1195
- existing.push(file);
1196
- byLang.set(file.language, existing);
1197
- }
1198
- const sortedLangs = [...byLang.entries()].sort((a, b) => b[1].length - a[1].length);
1199
- for (const [lang, langFiles] of sortedLangs) {
1200
- console.log(chalk.cyan(`${lang} (${langFiles.length}):`));
1201
- for (const file of langFiles.sort((a, b) => a.path.localeCompare(b.path))) {
1202
- if (includeMetadata) {
1203
- console.log(` ${file.path} ${chalk.dim(`(${file.nodeCount} symbols)`)}`);
1204
- }
1205
- else {
1206
- console.log(` ${file.path}`);
1207
- }
1208
- }
1209
- console.log();
1210
- }
1211
- break;
1212
- case 'tree':
1213
- default:
1214
- console.log(chalk.bold(`\nProject Structure (${files.length} files):\n`));
1215
- printFileTree(files, includeMetadata, maxDepth, chalk);
1216
- break;
1217
- }
1218
- console.log();
1219
- cg.destroy();
1220
- }
1221
- catch (err) {
1222
- error(`Failed to list files: ${err instanceof Error ? err.message : String(err)}`);
1223
- process.exit(1);
1224
- }
1225
- });
1226
- /**
1227
- * Normalize a user-supplied file path to the project-relative, forward-slash
1228
- * form cgraphx stores in the index. Accepts an absolute path, a `./`-prefixed
1229
- * path, or Windows back-slashes; an empty string when the input is blank. Used
1230
- * by `cgraphx affected` so `./src/x.ts`, `/abs/repo/src/x.ts`, and
1231
- * `src/x.ts` all match the same indexed file. (#825)
1232
- */
1233
- function normalizeIndexPath(filePath, projectPath) {
1234
- let f = filePath.trim();
1235
- if (!f)
1236
- return '';
1237
- if (path.isAbsolute(f))
1238
- f = path.relative(projectPath, f);
1239
- // Collapse `.`/`..` segments, then force forward slashes and drop a leading
1240
- // `./` (path.normalize already strips it on POSIX; explicit for Windows).
1241
- f = path.normalize(f).replace(/\\/g, '/').replace(/^\.\//, '');
1242
- return f;
1243
- }
1244
- /**
1245
- * Convert glob pattern to regex
1246
- */
1247
- function globToRegex(pattern) {
1248
- const escaped = pattern
1249
- .replace(/[.+^${}()|[\]\\]/g, '\\$&')
1250
- .replace(/\*\*/g, '{{GLOBSTAR}}')
1251
- .replace(/\*/g, '[^/]*')
1252
- .replace(/\?/g, '[^/]')
1253
- .replace(/\{\{GLOBSTAR\}\}/g, '.*');
1254
- return new RegExp(escaped);
1255
- }
1256
- /**
1257
- * Print files as a tree
1258
- */
1259
- function printFileTree(files, includeMetadata, maxDepth, chalk) {
1260
- const root = { name: '', children: new Map() };
1261
- for (const file of files) {
1262
- const parts = file.path.split('/');
1263
- let current = root;
1264
- for (let i = 0; i < parts.length; i++) {
1265
- const part = parts[i];
1266
- if (!part)
1267
- continue;
1268
- if (!current.children.has(part)) {
1269
- current.children.set(part, { name: part, children: new Map() });
1270
- }
1271
- current = current.children.get(part);
1272
- if (i === parts.length - 1) {
1273
- current.file = { language: file.language, nodeCount: file.nodeCount };
1274
- }
1275
- }
1276
- }
1277
- const renderNode = (node, prefix, isLast, depth) => {
1278
- if (maxDepth !== undefined && depth > maxDepth)
1279
- return;
1280
- const glyphs = (0, glyphs_1.getGlyphs)();
1281
- const connector = isLast ? glyphs.treeLast : glyphs.treeBranch;
1282
- const childPrefix = isLast ? ' ' : glyphs.treePipe;
1283
- if (node.name) {
1284
- let line = prefix + connector + node.name;
1285
- if (node.file && includeMetadata) {
1286
- line += chalk.dim(` (${node.file.language}, ${node.file.nodeCount} symbols)`);
1287
- }
1288
- console.log(line);
1289
- }
1290
- const children = [...node.children.values()];
1291
- children.sort((a, b) => {
1292
- const aIsDir = a.children.size > 0 && !a.file;
1293
- const bIsDir = b.children.size > 0 && !b.file;
1294
- if (aIsDir !== bIsDir)
1295
- return aIsDir ? -1 : 1;
1296
- return a.name.localeCompare(b.name);
1297
- });
1298
- for (let i = 0; i < children.length; i++) {
1299
- const child = children[i];
1300
- const nextPrefix = node.name ? prefix + childPrefix : prefix;
1301
- renderNode(child, nextPrefix, i === children.length - 1, depth + 1);
1302
- }
1303
- };
1304
- renderNode(root, '', true, 0);
1305
- }
1306
- /**
1307
- * cgraphx daemon — interactive manager for the background daemons. Arrow keys
1308
- * to pick one (the current project's daemon floats to the top, auto-selected),
1309
- * enter to stop it. Falls back to a plain list when output isn't a TTY.
1310
- */
1311
- program
1312
- .command('daemon')
1313
- .aliases(['daemons'])
1314
- .description('Manage running cgraphx background daemons — pick one and press enter to stop it')
1315
- .action(async () => {
1316
- const { listDaemons, stopDaemonAt, stopAllDaemons } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-registry')));
1317
- const { runDaemonPicker } = await Promise.resolve().then(() => __importStar(require('../mcp/daemon-manager')));
1318
- const daemons = listDaemons();
1319
- if (daemons.length === 0) {
1320
- info('No cgraphx daemons running.');
1321
- return;
1322
- }
1323
- // No TTY (piped / CI / non-interactive) — can't do arrow-key selection, so
1324
- // just print what's running instead of crashing on a prompt with no input.
1325
- if (!process.stdout.isTTY || !process.stdin.isTTY) {
1326
- for (const d of daemons) {
1327
- console.log(`pid ${d.pid} v${d.version} up ${formatDuration(Date.now() - d.startedAt)} ${d.root}`);
1328
- }
1329
- return;
1330
- }
1331
- // The current project's daemon floats to the top and is pre-selected.
1332
- let cwdRoot = null;
1333
- const found = (0, directory_1.findNearestCodeGraphRoot)(process.cwd());
1334
- if (found) {
1335
- try {
1336
- cwdRoot = fs.realpathSync(found);
1337
- }
1338
- catch {
1339
- cwdRoot = found;
1340
- }
1341
- }
1342
- const clack = await importESM('@clack/prompts');
1343
- clack.intro('cgraphx daemons');
1344
- await runDaemonPicker({
1345
- list: listDaemons,
1346
- stop: stopDaemonAt,
1347
- stopAll: stopAllDaemons,
1348
- cwdRoot,
1349
- now: () => Date.now(),
1350
- select: (opts) => clack.select(opts),
1351
- isCancel: (v) => clack.isCancel(v),
1352
- note: (m) => clack.log.success(m),
1353
- done: (m) => clack.outro(m),
1354
- });
1355
- });
1356
- /**
1357
- * cgraphx serve
1358
- */
1359
- program
1360
- // Hidden from `--help`: this is the stdio entry point an AI agent launches
1361
- // for itself (the installer wires `args: ['serve','--mcp']` into every
1362
- // agent's MCP config), not a command a human runs. It still works when
1363
- // invoked — hiding only removes it from the listing. See the interactive-TTY
1364
- // guard below, which explains this to anyone who runs it by hand.
1365
- .command('serve', { hidden: true })
1366
- .description('Start cgraphx as an MCP server for AI assistants')
1367
- .option('-p, --path <path>', 'Project path (optional for MCP mode, uses rootUri from client)')
1368
- .option('--mcp', 'Run as MCP server (stdio transport)')
1369
- .option('--no-watch', 'Disable the file watcher (no auto-sync; useful on slow filesystems like WSL2 /mnt drives)')
1370
- .action(async (options) => {
1371
- const projectPath = options.path ? resolveProjectPath(options.path) : undefined;
1372
- // Commander sets watch=false when --no-watch is passed. Route it through
1373
- // the same env-var chokepoint the watcher and MCP server already honor.
1374
- if (options.watch === false) {
1375
- process.env.CGRAPHX_NO_WATCH = '1';
1376
- }
1377
- try {
1378
- if (options.mcp) {
1379
- // `serve --mcp` is the stdio MCP server an AI agent launches for itself,
1380
- // not a command to run by hand. A human in a terminal would otherwise
1381
- // see it hang waiting for JSON-RPC on stdin, which reads as broken. If
1382
- // stdin is an interactive TTY, explain instead of hanging. The agent's
1383
- // pipe and the detached daemon both have a non-TTY stdin, so this only
1384
- // ever fires for a person who typed it.
1385
- if (process.stdin.isTTY && !process.env.CGRAPHX_DAEMON_INTERNAL) {
1386
- console.error(chalk.bold('\ncgraphx MCP server\n'));
1387
- console.error("This is the MCP server your AI agent (Claude Code, Cursor, Codex, opencode, …)");
1388
- console.error("starts automatically — you don't run it yourself.");
1389
- console.error(`\nIt's already wired up by ${chalk.cyan('cgraphx install')}. To check on things:`);
1390
- console.error(` ${chalk.cyan('cgraphx status')} ${chalk.dim('— is this project indexed and healthy?')}`);
1391
- console.error(` ${chalk.cyan('cgraphx daemon')} ${chalk.dim('— list or stop background MCP servers')}`);
1392
- console.error(chalk.dim('\n(Running it directly only does something when an MCP client drives it over stdin.)'));
1393
- return;
1394
- }
1395
- // Start MCP server - it handles initialization lazily based on rootUri from client
1396
- const { MCPServer } = await Promise.resolve().then(() => __importStar(require('../mcp/index')));
1397
- const server = new MCPServer(projectPath);
1398
- await server.start();
1399
- // Server will run until terminated
1400
- }
1401
- else {
1402
- // Default: show info about MCP mode.
1403
- // Use stderr so stdout stays clean for any piped/stdio usage.
1404
- console.error(chalk.bold('\ncgraphx MCP Server\n'));
1405
- console.error(chalk.blue((0, glyphs_1.getGlyphs)().info) + ' Use --mcp flag to start the MCP server');
1406
- console.error('\nTo use with Claude Code, add to your MCP configuration:');
1407
- console.error(chalk.dim(`
1408
- {
1409
- "mcpServers": {
1410
- "cgraphx": {
1411
- "command": "cgraphx",
1412
- "args": ["serve", "--mcp"]
1413
- }
1414
- }
1415
- }
1416
- `));
1417
- console.error('Available tools:');
1418
- console.error(chalk.cyan(' codegraph_explore') + ' - Primary: source of the relevant symbols for any question');
1419
- console.error(chalk.cyan(' codegraph_search') + ' - Search for code symbols');
1420
- console.error(chalk.cyan(' codegraph_callers') + ' - Find callers of a symbol');
1421
- console.error(chalk.cyan(' codegraph_callees') + ' - Find what a symbol calls');
1422
- console.error(chalk.cyan(' codegraph_impact') + ' - Analyze impact of changes');
1423
- console.error(chalk.cyan(' codegraph_node') + ' - Get symbol details');
1424
- console.error(chalk.cyan(' codegraph_files') + ' - Get project file structure');
1425
- console.error(chalk.cyan(' codegraph_status') + ' - Get index status');
1426
- }
1427
- }
1428
- catch (err) {
1429
- error(`Failed to start server: ${err instanceof Error ? err.message : String(err)}`);
1430
- process.exit(1);
1431
- }
1432
- });
1433
- /**
1434
- * cgraphx unlock [path]
1435
- */
1436
- program
1437
- .command('unlock [path]')
1438
- .description('Remove a stale lock file that is blocking indexing')
1439
- .action(async (pathArg) => {
1440
- const projectPath = resolveProjectPath(pathArg);
1441
- try {
1442
- if (!(0, directory_1.isInitialized)(projectPath)) {
1443
- error(`cgraphx not initialized in ${projectPath}`);
1444
- return;
1445
- }
1446
- const lockPath = path.join((0, directory_1.getCodeGraphDir)(projectPath), 'cgraphx.lock');
1447
- if (!fs.existsSync(lockPath)) {
1448
- info(`No lock file found ${(0, glyphs_1.getGlyphs)().dash} nothing to do`);
1449
- return;
1450
- }
1451
- fs.unlinkSync(lockPath);
1452
- success('Removed lock file. You can now run indexing again.');
1453
- }
1454
- catch (err) {
1455
- error(`Failed to remove lock: ${err instanceof Error ? err.message : String(err)}`);
1456
- process.exit(1);
1457
- }
1458
- });
1459
- /**
1460
- * cgraphx callers <symbol>
1461
- *
1462
- * CLI parity with the MCP graph tools (codegraph_callers/callees/impact) so the
1463
- * traversal queries work in scripts, CI, and git hooks without a running MCP
1464
- * server.
1465
- */
1466
- program
1467
- .command('callers <symbol>')
1468
- .description('Find all functions/methods that call a specific symbol')
1469
- .option('-p, --path <path>', 'Project path')
1470
- .option('-l, --limit <number>', 'Maximum results', '20')
1471
- .option('-j, --json', 'Output as JSON')
1472
- .action(async (symbol, options) => {
1473
- const projectPath = resolveProjectPath(options.path);
1474
- try {
1475
- if (!(0, directory_1.isInitialized)(projectPath)) {
1476
- error(`cgraphx not initialized in ${projectPath}`);
1477
- process.exit(1);
1478
- }
1479
- const { default: CodeGraph } = await loadCodeGraph();
1480
- const cg = await CodeGraph.open(projectPath);
1481
- const limit = parseInt(options.limit || '20', 10);
1482
- const matches = cg.searchNodes(symbol, { limit: 50 });
1483
- if (matches.length === 0) {
1484
- info(`Symbol "${symbol}" not found`);
1485
- cg.destroy();
1486
- return;
1487
- }
1488
- const seen = new Set();
1489
- const allCallers = [];
1490
- for (const match of matches) {
1491
- const exactMatch = match.node.name === symbol || match.node.name.endsWith(`.${symbol}`) || match.node.name.endsWith(`::${symbol}`);
1492
- if (!exactMatch && matches.length > 1)
1493
- continue;
1494
- for (const c of cg.getCallers(match.node.id)) {
1495
- if (!seen.has(c.node.id)) {
1496
- seen.add(c.node.id);
1497
- allCallers.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
1498
- }
1499
- }
1500
- }
1501
- // Fallback: if exact filter removed everything, use the top match
1502
- if (allCallers.length === 0 && matches[0]) {
1503
- for (const c of cg.getCallers(matches[0].node.id)) {
1504
- if (!seen.has(c.node.id)) {
1505
- seen.add(c.node.id);
1506
- allCallers.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
1507
- }
1508
- }
1509
- }
1510
- const limited = allCallers.slice(0, limit);
1511
- if (options.json) {
1512
- console.log(JSON.stringify({ symbol, callers: limited }, null, 2));
1513
- }
1514
- else if (limited.length === 0) {
1515
- info(`No callers found for "${symbol}"`);
1516
- }
1517
- else {
1518
- console.log(chalk.bold(`\nCallers of "${symbol}" (${limited.length}):\n`));
1519
- for (const node of limited) {
1520
- const loc = node.startLine ? `:${node.startLine}` : '';
1521
- console.log(chalk.cyan(node.kind.padEnd(12)) +
1522
- chalk.white(node.name));
1523
- console.log(chalk.dim(` ${node.filePath}${loc}`));
1524
- console.log();
1525
- }
1526
- }
1527
- cg.destroy();
1528
- }
1529
- catch (err) {
1530
- error(`callers failed: ${err instanceof Error ? err.message : String(err)}`);
1531
- process.exit(1);
1532
- }
1533
- });
1534
- /**
1535
- * cgraphx callees <symbol>
1536
- */
1537
- program
1538
- .command('callees <symbol>')
1539
- .description('Find all functions/methods that a specific symbol calls')
1540
- .option('-p, --path <path>', 'Project path')
1541
- .option('-l, --limit <number>', 'Maximum results', '20')
1542
- .option('-j, --json', 'Output as JSON')
1543
- .action(async (symbol, options) => {
1544
- const projectPath = resolveProjectPath(options.path);
1545
- try {
1546
- if (!(0, directory_1.isInitialized)(projectPath)) {
1547
- error(`cgraphx not initialized in ${projectPath}`);
1548
- process.exit(1);
1549
- }
1550
- const { default: CodeGraph } = await loadCodeGraph();
1551
- const cg = await CodeGraph.open(projectPath);
1552
- const limit = parseInt(options.limit || '20', 10);
1553
- const matches = cg.searchNodes(symbol, { limit: 50 });
1554
- if (matches.length === 0) {
1555
- info(`Symbol "${symbol}" not found`);
1556
- cg.destroy();
1557
- return;
1558
- }
1559
- const seen = new Set();
1560
- const allCallees = [];
1561
- for (const match of matches) {
1562
- const exactMatch = match.node.name === symbol || match.node.name.endsWith(`.${symbol}`) || match.node.name.endsWith(`::${symbol}`);
1563
- if (!exactMatch && matches.length > 1)
1564
- continue;
1565
- for (const c of cg.getCallees(match.node.id)) {
1566
- if (!seen.has(c.node.id)) {
1567
- seen.add(c.node.id);
1568
- allCallees.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
1569
- }
1570
- }
1571
- }
1572
- if (allCallees.length === 0 && matches[0]) {
1573
- for (const c of cg.getCallees(matches[0].node.id)) {
1574
- if (!seen.has(c.node.id)) {
1575
- seen.add(c.node.id);
1576
- allCallees.push({ name: c.node.name, kind: c.node.kind, filePath: c.node.filePath, startLine: c.node.startLine });
1577
- }
1578
- }
1579
- }
1580
- const limited = allCallees.slice(0, limit);
1581
- if (options.json) {
1582
- console.log(JSON.stringify({ symbol, callees: limited }, null, 2));
1583
- }
1584
- else if (limited.length === 0) {
1585
- info(`No callees found for "${symbol}"`);
1586
- }
1587
- else {
1588
- console.log(chalk.bold(`\nCallees of "${symbol}" (${limited.length}):\n`));
1589
- for (const node of limited) {
1590
- const loc = node.startLine ? `:${node.startLine}` : '';
1591
- console.log(chalk.cyan(node.kind.padEnd(12)) +
1592
- chalk.white(node.name));
1593
- console.log(chalk.dim(` ${node.filePath}${loc}`));
1594
- console.log();
1595
- }
1596
- }
1597
- cg.destroy();
1598
- }
1599
- catch (err) {
1600
- error(`callees failed: ${err instanceof Error ? err.message : String(err)}`);
1601
- process.exit(1);
1602
- }
1603
- });
1604
- program
1605
- .command('affected [files...]')
1606
- .description('Find test files affected by changed source files')
1607
- .option('-p, --path <path>', 'Project path')
1608
- .option('--stdin', 'Read file list from stdin (one per line)')
1609
- .option('-d, --depth <number>', 'Max dependency traversal depth', '5')
1610
- .option('-f, --filter <glob>', 'Custom glob filter for test files (e.g. "e2e/*.spec.ts")')
1611
- .option('-j, --json', 'Output as JSON')
1612
- .option('-q, --quiet', 'Only output file paths, no decoration')
1613
- .action(async (fileArgs, options) => {
1614
- const projectPath = resolveProjectPath(options.path);
1615
- try {
1616
- if (!(0, directory_1.isInitialized)(projectPath)) {
1617
- error(`cgraphx not initialized in ${projectPath}`);
1618
- process.exit(1);
1619
- }
1620
- // Collect changed files from args or stdin
1621
- let changedFiles = [...(fileArgs || [])];
1622
- if (options.stdin) {
1623
- const stdinData = fs.readFileSync(0, 'utf-8');
1624
- const stdinFiles = stdinData.split('\n').map(f => f.trim()).filter(Boolean);
1625
- changedFiles.push(...stdinFiles);
1626
- }
1627
- // Normalize inputs to the project-relative, forward-slash form the index
1628
- // stores. Without this, `affected ./src/x.ts`, an absolute path (what a
1629
- // wrapping script often passes), or a Windows back-slash path silently
1630
- // matches nothing and reports 0 affected tests. (#825)
1631
- changedFiles = changedFiles
1632
- .map((f) => normalizeIndexPath(f, projectPath))
1633
- .filter(Boolean);
1634
- if (changedFiles.length === 0) {
1635
- if (!options.quiet)
1636
- info('No files provided. Use file arguments or --stdin.');
1637
- process.exit(0);
1638
- }
1639
- const { default: CodeGraph } = await loadCodeGraph();
1640
- const cg = await CodeGraph.open(projectPath);
1641
- const maxDepth = parseInt(options.depth || '5', 10);
1642
- // Common test file patterns
1643
- const defaultTestPatterns = [
1644
- /\.spec\./,
1645
- /\.test\./,
1646
- /\/__tests__\//,
1647
- /\/tests?\//,
1648
- /\/e2e\//,
1649
- /\/spec\//,
1650
- ];
1651
- // Custom filter pattern
1652
- let customFilter = null;
1653
- if (options.filter) {
1654
- // Convert glob to regex: ** → .+, * → [^/]*, . → \.
1655
- const regex = options.filter
1656
- .replace(/[+[\]{}()^$|\\]/g, '\\$&')
1657
- .replace(/\./g, '\\.')
1658
- .replace(/\*\*/g, '.+')
1659
- .replace(/\*/g, '[^/]*');
1660
- customFilter = new RegExp(regex);
1661
- }
1662
- function isTestFile(filePath) {
1663
- if (customFilter)
1664
- return customFilter.test(filePath);
1665
- return defaultTestPatterns.some(p => p.test(filePath));
1666
- }
1667
- // BFS to find all transitive dependents of changed files, filtered to test files
1668
- const affectedTests = new Set();
1669
- const allDependents = new Set();
1670
- for (const file of changedFiles) {
1671
- // If the changed file is itself a test file, include it
1672
- if (isTestFile(file)) {
1673
- affectedTests.add(file);
1674
- continue;
1675
- }
1676
- // BFS through dependents
1677
- const queue = [{ file, depth: 0 }];
1678
- const visited = new Set();
1679
- visited.add(file);
1680
- while (queue.length > 0) {
1681
- const current = queue.shift();
1682
- if (current.depth >= maxDepth)
1683
- continue;
1684
- const dependents = cg.getFileDependents(current.file);
1685
- for (const dep of dependents) {
1686
- if (visited.has(dep))
1687
- continue;
1688
- visited.add(dep);
1689
- allDependents.add(dep);
1690
- if (isTestFile(dep)) {
1691
- affectedTests.add(dep);
1692
- }
1693
- else {
1694
- queue.push({ file: dep, depth: current.depth + 1 });
1695
- }
1696
- }
1697
- }
1698
- }
1699
- const sortedTests = Array.from(affectedTests).sort();
1700
- // Output
1701
- if (options.json) {
1702
- console.log(JSON.stringify({
1703
- changedFiles,
1704
- affectedTests: sortedTests,
1705
- totalDependentsTraversed: allDependents.size,
1706
- }, null, 2));
1707
- }
1708
- else if (options.quiet) {
1709
- for (const t of sortedTests)
1710
- console.log(t);
1711
- }
1712
- else {
1713
- if (sortedTests.length === 0) {
1714
- info('No test files affected by the changed files.');
1715
- }
1716
- else {
1717
- console.log(chalk.bold(`\nAffected test files (${sortedTests.length}):\n`));
1718
- for (const t of sortedTests) {
1719
- console.log(' ' + chalk.cyan(t));
1720
- }
1721
- console.log();
1722
- }
1723
- }
1724
- cg.destroy();
1725
- }
1726
- catch (err) {
1727
- error(`Affected analysis failed: ${err instanceof Error ? err.message : String(err)}`);
1728
- process.exit(1);
1729
- }
1730
- });
1731
- /**
1732
- * cgraphx install
1733
- */
1734
- program
1735
- .command('install')
1736
- .description('Install cgraphx MCP server into one or more agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent)')
1737
- .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "auto"|"all"|"none". Default: prompt')
1738
- .option('-l, --location <where>', 'Install location: "global" or "local". Default: prompt')
1739
- .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=auto, auto-allow on')
1740
- .option('--no-permissions', 'Skip writing the auto-allow permissions list (Claude Code only)')
1741
- .option('--print-config <id>', 'Print MCP config snippet for the named agent and exit (no file writes)')
1742
- .action(async (opts) => {
1743
- if (opts.printConfig) {
1744
- const { getTarget, listTargetIds } = await Promise.resolve().then(() => __importStar(require('../installer/targets/registry')));
1745
- const target = getTarget(opts.printConfig);
1746
- if (!target) {
1747
- const known = listTargetIds().join(', ');
1748
- error(`Unknown target "${opts.printConfig}". Known: ${known}.`);
1749
- process.exit(1);
1750
- }
1751
- const loc = (opts.location === 'local' ? 'local' : 'global');
1752
- process.stdout.write(target.printConfig(loc));
1753
- return;
1754
- }
1755
- const { runInstallerWithOptions } = await Promise.resolve().then(() => __importStar(require('../installer')));
1756
- if (opts.location && opts.location !== 'global' && opts.location !== 'local') {
1757
- error(`--location must be "global" or "local" (got "${opts.location}").`);
1758
- process.exit(1);
1759
- }
1760
- try {
1761
- // Commander's `--no-permissions` makes `opts.permissions === false`;
1762
- // omitting the flag leaves it `true` (the positive-form default).
1763
- // We MUST treat the default-true as "user did not override — let
1764
- // the orchestrator prompt" and only forward an explicit `false`
1765
- // (or `true` when --yes implies it). Otherwise the auto-allow
1766
- // prompt is silently skipped on every interactive run.
1767
- const explicitNoPermissions = opts.permissions === false;
1768
- const autoAllow = explicitNoPermissions
1769
- ? false
1770
- : opts.yes
1771
- ? true
1772
- : undefined;
1773
- await runInstallerWithOptions({
1774
- target: opts.target,
1775
- location: opts.location,
1776
- autoAllow,
1777
- yes: opts.yes,
1778
- });
1779
- }
1780
- catch (err) {
1781
- error(err instanceof Error ? err.message : String(err));
1782
- process.exit(1);
1783
- }
1784
- });
1785
- /**
1786
- * cgraphx uninstall
1787
- *
1788
- * Inverse of `install`. Removes the codegraph MCP server entry,
1789
- * instructions block, and permissions from every agent (or a
1790
- * `--target` subset). Prompts global-vs-local when not given. Does NOT
1791
- * delete the `.cgraphx/` index — that's `cgraphx uninit`.
1792
- */
1793
- program
1794
- .command('uninstall')
1795
- .description('Remove cgraphx from your agents (Claude Code, Cursor, Codex CLI, opencode, Hermes Agent)')
1796
- .option('-t, --target <ids>', 'Target agent(s): comma-separated ids, or "all". Default: all')
1797
- .option('-l, --location <where>', 'Uninstall location: "global" or "local". Default: prompt')
1798
- .option('-y, --yes', 'Non-interactive: defaults to --location=global --target=all')
1799
- .action(async (opts) => {
1800
- const { runUninstaller } = await Promise.resolve().then(() => __importStar(require('../installer')));
1801
- if (opts.location && opts.location !== 'global' && opts.location !== 'local') {
1802
- error(`--location must be "global" or "local" (got "${opts.location}").`);
1803
- process.exit(1);
1804
- }
1805
- try {
1806
- await runUninstaller({
1807
- target: opts.target,
1808
- location: opts.location,
1809
- yes: opts.yes,
1810
- });
1811
- }
1812
- catch (err) {
1813
- error(err instanceof Error ? err.message : String(err));
1814
- process.exit(1);
1815
- }
1816
- });
1817
- /**
1818
- * cgraphx telemetry [on|off|status]
1819
- */
1820
- program
1821
- .command('telemetry [action]')
1822
- .description('Show or change anonymous usage telemetry (status, on, off)')
1823
- .action((action) => {
1824
- const t = (0, telemetry_1.getTelemetry)();
1825
- if (action === 'on' || action === 'off') {
1826
- t.setEnabled(action === 'on', 'cli');
1827
- if (action === 'on') {
1828
- success('Telemetry enabled — anonymous usage stats only (no code, paths, or names).');
1829
- }
1830
- else {
1831
- success('Telemetry disabled. Buffered, unsent data was deleted.');
1832
- }
1833
- const effective = t.getStatus();
1834
- if (effective.decidedBy === 'DO_NOT_TRACK' || effective.decidedBy === 'CGRAPHX_TELEMETRY') {
1835
- warn(`The ${effective.decidedBy} environment variable overrides this choice — ` +
1836
- `effective state right now: ${effective.enabled ? 'enabled' : 'disabled'}.`);
1837
- }
1838
- return;
1839
- }
1840
- if (action !== undefined && action !== 'status') {
1841
- error(`Unknown action: ${action} (expected status, on, or off)`);
1842
- process.exit(1);
1843
- }
1844
- const s = t.getStatus();
1845
- const decidedBy = {
1846
- DO_NOT_TRACK: 'DO_NOT_TRACK environment variable',
1847
- CGRAPHX_TELEMETRY: 'CGRAPHX_TELEMETRY environment variable',
1848
- config: 'your saved choice',
1849
- default: 'default',
1850
- };
1851
- console.log(`\nTelemetry: ${s.enabled ? chalk.green('enabled') : chalk.yellow('disabled')} ${chalk.dim(`(${decidedBy[s.decidedBy]})`)}`);
1852
- console.log(`Machine ID: ${s.machineId ?? chalk.dim('(random UUID, created on first use)')}`);
1853
- console.log(`Config: ${s.configPath}`);
1854
- console.log(chalk.dim(`\nExactly what is collected (and never collected): ${telemetry_1.TELEMETRY_DOCS}\n`));
1855
- });
1856
- /**
1857
- * cgraphx upgrade [version]
1858
- *
1859
- * Self-update, however cgraphx was installed (bundle via install.sh/.ps1,
1860
- * npm-global, npx, or a source checkout). See ../upgrade for the detection and
1861
- * per-method upgrade logic.
1862
- */
1863
- program
1864
- .command('upgrade [version]')
1865
- .description('Update cgraphx to the latest release (or a specific version)')
1866
- .option('--check', 'Check whether an update is available without installing')
1867
- .option('-f, --force', 'Reinstall even if already on the target version')
1868
- .action(async (versionArg, options) => {
1869
- const up = await Promise.resolve().then(() => __importStar(require('../upgrade')));
1870
- const method = up.detectInstallMethod({
1871
- filename: __filename,
1872
- platform: process.platform,
1873
- cwd: process.cwd(),
1874
- });
1875
- const pin = versionArg || process.env.CGRAPHX_VERSION || undefined;
1876
- const code = await up.runUpgrade({ version: pin, check: options.check, force: options.force }, {
1877
- currentVersion: packageJson.version,
1878
- method,
1879
- resolveLatest: () => up.resolveLatestVersion(),
1880
- run: up.defaultRun,
1881
- hasCommand: up.hasCommand,
1882
- log: (m) => console.log(m),
1883
- warn: (m) => warn(m),
1884
- error: (m) => error(m),
1885
- platform: process.platform,
1886
- });
1887
- process.exit(code);
1888
- });
1889
- /**
1890
- * cgraphx version
1891
- *
1892
- * The bare-noun form of `--version`. commander already provides `--version`
1893
- * and `-V`, and the `-v` / `-version` spellings are intercepted before parse
1894
- * (see top of main). This subcommand makes `cgraphx version` work and lists
1895
- * the version affordance in `cgraphx --help`.
1896
- */
1897
- program
1898
- .command('version')
1899
- .description('Print the installed cgraphx version (also: -v, --version)')
1900
- .action(() => {
1901
- console.log(packageJson.version);
1902
- });
1903
- // Markdown knowledge base subsystem (independent of the code graph).
1904
- // Registration is a single function call so the docs command group stays
1905
- // isolated in src/markdown/cli.ts — see docs/features/2026-06-26-docs-knowledge-base/.
1906
- (0, cli_1.registerDocsCommands)(program);
1907
- // db-query subsystem — isolated in src/dbquery/cli.ts.
1908
- (0, cli_2.registerDbCommands)(program);
1909
- // timeline subsystem — isolated in src/timeline/cli.ts.
1910
- (0, cli_3.registerTimelineCommands)(program);
1911
- // Parse and run
1912
- program.parse();
1913
- } // end main()
1914
- //# sourceMappingURL=codegraph.js.map