@colbymchenry/codegraph 0.7.10 → 0.9.0

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 (362) hide show
  1. package/README.md +70 -54
  2. package/npm-shim.js +43 -0
  3. package/package.json +13 -51
  4. package/LICENSE +0 -21
  5. package/dist/bin/codegraph.d.ts +0 -21
  6. package/dist/bin/codegraph.d.ts.map +0 -1
  7. package/dist/bin/codegraph.js +0 -1232
  8. package/dist/bin/codegraph.js.map +0 -1
  9. package/dist/bin/node-version-check.d.ts +0 -20
  10. package/dist/bin/node-version-check.d.ts.map +0 -1
  11. package/dist/bin/node-version-check.js +0 -42
  12. package/dist/bin/node-version-check.js.map +0 -1
  13. package/dist/bin/uninstall.d.ts +0 -14
  14. package/dist/bin/uninstall.d.ts.map +0 -1
  15. package/dist/bin/uninstall.js +0 -36
  16. package/dist/bin/uninstall.js.map +0 -1
  17. package/dist/config.d.ts +0 -51
  18. package/dist/config.d.ts.map +0 -1
  19. package/dist/config.js +0 -321
  20. package/dist/config.js.map +0 -1
  21. package/dist/context/formatter.d.ts +0 -30
  22. package/dist/context/formatter.d.ts.map +0 -1
  23. package/dist/context/formatter.js +0 -244
  24. package/dist/context/formatter.js.map +0 -1
  25. package/dist/context/index.d.ts +0 -97
  26. package/dist/context/index.d.ts.map +0 -1
  27. package/dist/context/index.js +0 -1048
  28. package/dist/context/index.js.map +0 -1
  29. package/dist/db/index.d.ts +0 -72
  30. package/dist/db/index.d.ts.map +0 -1
  31. package/dist/db/index.js +0 -200
  32. package/dist/db/index.js.map +0 -1
  33. package/dist/db/migrations.d.ts +0 -44
  34. package/dist/db/migrations.d.ts.map +0 -1
  35. package/dist/db/migrations.js +0 -131
  36. package/dist/db/migrations.js.map +0 -1
  37. package/dist/db/queries.d.ts +0 -253
  38. package/dist/db/queries.d.ts.map +0 -1
  39. package/dist/db/queries.js +0 -1207
  40. package/dist/db/queries.js.map +0 -1
  41. package/dist/db/schema.sql +0 -151
  42. package/dist/db/sqlite-adapter.d.ts +0 -52
  43. package/dist/db/sqlite-adapter.d.ts.map +0 -1
  44. package/dist/db/sqlite-adapter.js +0 -237
  45. package/dist/db/sqlite-adapter.js.map +0 -1
  46. package/dist/directory.d.ts +0 -57
  47. package/dist/directory.d.ts.map +0 -1
  48. package/dist/directory.js +0 -264
  49. package/dist/directory.js.map +0 -1
  50. package/dist/errors.d.ts +0 -136
  51. package/dist/errors.d.ts.map +0 -1
  52. package/dist/errors.js +0 -219
  53. package/dist/errors.js.map +0 -1
  54. package/dist/extraction/dfm-extractor.d.ts +0 -31
  55. package/dist/extraction/dfm-extractor.d.ts.map +0 -1
  56. package/dist/extraction/dfm-extractor.js +0 -151
  57. package/dist/extraction/dfm-extractor.js.map +0 -1
  58. package/dist/extraction/grammars.d.ts +0 -78
  59. package/dist/extraction/grammars.d.ts.map +0 -1
  60. package/dist/extraction/grammars.js +0 -322
  61. package/dist/extraction/grammars.js.map +0 -1
  62. package/dist/extraction/index.d.ts +0 -130
  63. package/dist/extraction/index.d.ts.map +0 -1
  64. package/dist/extraction/index.js +0 -1279
  65. package/dist/extraction/index.js.map +0 -1
  66. package/dist/extraction/languages/c-cpp.d.ts +0 -4
  67. package/dist/extraction/languages/c-cpp.d.ts.map +0 -1
  68. package/dist/extraction/languages/c-cpp.js +0 -126
  69. package/dist/extraction/languages/c-cpp.js.map +0 -1
  70. package/dist/extraction/languages/csharp.d.ts +0 -3
  71. package/dist/extraction/languages/csharp.d.ts.map +0 -1
  72. package/dist/extraction/languages/csharp.js +0 -72
  73. package/dist/extraction/languages/csharp.js.map +0 -1
  74. package/dist/extraction/languages/dart.d.ts +0 -3
  75. package/dist/extraction/languages/dart.d.ts.map +0 -1
  76. package/dist/extraction/languages/dart.js +0 -192
  77. package/dist/extraction/languages/dart.js.map +0 -1
  78. package/dist/extraction/languages/go.d.ts +0 -3
  79. package/dist/extraction/languages/go.d.ts.map +0 -1
  80. package/dist/extraction/languages/go.js +0 -58
  81. package/dist/extraction/languages/go.js.map +0 -1
  82. package/dist/extraction/languages/index.d.ts +0 -10
  83. package/dist/extraction/languages/index.d.ts.map +0 -1
  84. package/dist/extraction/languages/index.js +0 -45
  85. package/dist/extraction/languages/index.js.map +0 -1
  86. package/dist/extraction/languages/java.d.ts +0 -3
  87. package/dist/extraction/languages/java.d.ts.map +0 -1
  88. package/dist/extraction/languages/java.js +0 -64
  89. package/dist/extraction/languages/java.js.map +0 -1
  90. package/dist/extraction/languages/javascript.d.ts +0 -3
  91. package/dist/extraction/languages/javascript.d.ts.map +0 -1
  92. package/dist/extraction/languages/javascript.js +0 -90
  93. package/dist/extraction/languages/javascript.js.map +0 -1
  94. package/dist/extraction/languages/kotlin.d.ts +0 -3
  95. package/dist/extraction/languages/kotlin.d.ts.map +0 -1
  96. package/dist/extraction/languages/kotlin.js +0 -253
  97. package/dist/extraction/languages/kotlin.js.map +0 -1
  98. package/dist/extraction/languages/pascal.d.ts +0 -3
  99. package/dist/extraction/languages/pascal.d.ts.map +0 -1
  100. package/dist/extraction/languages/pascal.js +0 -66
  101. package/dist/extraction/languages/pascal.js.map +0 -1
  102. package/dist/extraction/languages/php.d.ts +0 -3
  103. package/dist/extraction/languages/php.d.ts.map +0 -1
  104. package/dist/extraction/languages/php.js +0 -107
  105. package/dist/extraction/languages/php.js.map +0 -1
  106. package/dist/extraction/languages/python.d.ts +0 -3
  107. package/dist/extraction/languages/python.d.ts.map +0 -1
  108. package/dist/extraction/languages/python.js +0 -56
  109. package/dist/extraction/languages/python.js.map +0 -1
  110. package/dist/extraction/languages/ruby.d.ts +0 -3
  111. package/dist/extraction/languages/ruby.d.ts.map +0 -1
  112. package/dist/extraction/languages/ruby.js +0 -114
  113. package/dist/extraction/languages/ruby.js.map +0 -1
  114. package/dist/extraction/languages/rust.d.ts +0 -3
  115. package/dist/extraction/languages/rust.d.ts.map +0 -1
  116. package/dist/extraction/languages/rust.js +0 -109
  117. package/dist/extraction/languages/rust.js.map +0 -1
  118. package/dist/extraction/languages/scala.d.ts +0 -3
  119. package/dist/extraction/languages/scala.d.ts.map +0 -1
  120. package/dist/extraction/languages/scala.js +0 -139
  121. package/dist/extraction/languages/scala.js.map +0 -1
  122. package/dist/extraction/languages/swift.d.ts +0 -3
  123. package/dist/extraction/languages/swift.d.ts.map +0 -1
  124. package/dist/extraction/languages/swift.js +0 -91
  125. package/dist/extraction/languages/swift.js.map +0 -1
  126. package/dist/extraction/languages/typescript.d.ts +0 -3
  127. package/dist/extraction/languages/typescript.d.ts.map +0 -1
  128. package/dist/extraction/languages/typescript.js +0 -129
  129. package/dist/extraction/languages/typescript.js.map +0 -1
  130. package/dist/extraction/liquid-extractor.d.ts +0 -52
  131. package/dist/extraction/liquid-extractor.d.ts.map +0 -1
  132. package/dist/extraction/liquid-extractor.js +0 -313
  133. package/dist/extraction/liquid-extractor.js.map +0 -1
  134. package/dist/extraction/parse-worker.d.ts +0 -8
  135. package/dist/extraction/parse-worker.d.ts.map +0 -1
  136. package/dist/extraction/parse-worker.js +0 -94
  137. package/dist/extraction/parse-worker.js.map +0 -1
  138. package/dist/extraction/svelte-extractor.d.ts +0 -56
  139. package/dist/extraction/svelte-extractor.d.ts.map +0 -1
  140. package/dist/extraction/svelte-extractor.js +0 -272
  141. package/dist/extraction/svelte-extractor.js.map +0 -1
  142. package/dist/extraction/tree-sitter-helpers.d.ts +0 -28
  143. package/dist/extraction/tree-sitter-helpers.d.ts.map +0 -1
  144. package/dist/extraction/tree-sitter-helpers.js +0 -103
  145. package/dist/extraction/tree-sitter-helpers.js.map +0 -1
  146. package/dist/extraction/tree-sitter-types.d.ts +0 -179
  147. package/dist/extraction/tree-sitter-types.d.ts.map +0 -1
  148. package/dist/extraction/tree-sitter-types.js +0 -10
  149. package/dist/extraction/tree-sitter-types.js.map +0 -1
  150. package/dist/extraction/tree-sitter.d.ts +0 -233
  151. package/dist/extraction/tree-sitter.d.ts.map +0 -1
  152. package/dist/extraction/tree-sitter.js +0 -2393
  153. package/dist/extraction/tree-sitter.js.map +0 -1
  154. package/dist/extraction/vue-extractor.d.ts +0 -36
  155. package/dist/extraction/vue-extractor.d.ts.map +0 -1
  156. package/dist/extraction/vue-extractor.js +0 -163
  157. package/dist/extraction/vue-extractor.js.map +0 -1
  158. package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
  159. package/dist/extraction/wasm/tree-sitter-scala.wasm +0 -0
  160. package/dist/graph/index.d.ts +0 -8
  161. package/dist/graph/index.d.ts.map +0 -1
  162. package/dist/graph/index.js +0 -13
  163. package/dist/graph/index.js.map +0 -1
  164. package/dist/graph/queries.d.ts +0 -106
  165. package/dist/graph/queries.d.ts.map +0 -1
  166. package/dist/graph/queries.js +0 -366
  167. package/dist/graph/queries.js.map +0 -1
  168. package/dist/graph/traversal.d.ts +0 -127
  169. package/dist/graph/traversal.d.ts.map +0 -1
  170. package/dist/graph/traversal.js +0 -493
  171. package/dist/graph/traversal.js.map +0 -1
  172. package/dist/index.d.ts +0 -447
  173. package/dist/index.d.ts.map +0 -1
  174. package/dist/index.js +0 -825
  175. package/dist/index.js.map +0 -1
  176. package/dist/installer/claude-md-template.d.ts +0 -14
  177. package/dist/installer/claude-md-template.d.ts.map +0 -1
  178. package/dist/installer/claude-md-template.js +0 -21
  179. package/dist/installer/claude-md-template.js.map +0 -1
  180. package/dist/installer/config-writer.d.ts +0 -29
  181. package/dist/installer/config-writer.d.ts.map +0 -1
  182. package/dist/installer/config-writer.js +0 -109
  183. package/dist/installer/config-writer.js.map +0 -1
  184. package/dist/installer/index.d.ts +0 -53
  185. package/dist/installer/index.d.ts.map +0 -1
  186. package/dist/installer/index.js +0 -338
  187. package/dist/installer/index.js.map +0 -1
  188. package/dist/installer/instructions-template.d.ts +0 -28
  189. package/dist/installer/instructions-template.d.ts.map +0 -1
  190. package/dist/installer/instructions-template.js +0 -63
  191. package/dist/installer/instructions-template.js.map +0 -1
  192. package/dist/installer/targets/claude.d.ts +0 -27
  193. package/dist/installer/targets/claude.d.ts.map +0 -1
  194. package/dist/installer/targets/claude.js +0 -246
  195. package/dist/installer/targets/claude.js.map +0 -1
  196. package/dist/installer/targets/codex.d.ts +0 -18
  197. package/dist/installer/targets/codex.d.ts.map +0 -1
  198. package/dist/installer/targets/codex.js +0 -185
  199. package/dist/installer/targets/codex.js.map +0 -1
  200. package/dist/installer/targets/cursor.d.ts +0 -35
  201. package/dist/installer/targets/cursor.d.ts.map +0 -1
  202. package/dist/installer/targets/cursor.js +0 -229
  203. package/dist/installer/targets/cursor.js.map +0 -1
  204. package/dist/installer/targets/opencode.d.ts +0 -30
  205. package/dist/installer/targets/opencode.d.ts.map +0 -1
  206. package/dist/installer/targets/opencode.js +0 -235
  207. package/dist/installer/targets/opencode.js.map +0 -1
  208. package/dist/installer/targets/registry.d.ts +0 -35
  209. package/dist/installer/targets/registry.d.ts.map +0 -1
  210. package/dist/installer/targets/registry.js +0 -83
  211. package/dist/installer/targets/registry.js.map +0 -1
  212. package/dist/installer/targets/shared.d.ts +0 -77
  213. package/dist/installer/targets/shared.d.ts.map +0 -1
  214. package/dist/installer/targets/shared.js +0 -246
  215. package/dist/installer/targets/shared.js.map +0 -1
  216. package/dist/installer/targets/toml.d.ts +0 -52
  217. package/dist/installer/targets/toml.d.ts.map +0 -1
  218. package/dist/installer/targets/toml.js +0 -147
  219. package/dist/installer/targets/toml.js.map +0 -1
  220. package/dist/installer/targets/types.d.ts +0 -116
  221. package/dist/installer/targets/types.d.ts.map +0 -1
  222. package/dist/installer/targets/types.js +0 -16
  223. package/dist/installer/targets/types.js.map +0 -1
  224. package/dist/mcp/index.d.ts +0 -86
  225. package/dist/mcp/index.d.ts.map +0 -1
  226. package/dist/mcp/index.js +0 -355
  227. package/dist/mcp/index.js.map +0 -1
  228. package/dist/mcp/server-instructions.d.ts +0 -19
  229. package/dist/mcp/server-instructions.d.ts.map +0 -1
  230. package/dist/mcp/server-instructions.js +0 -59
  231. package/dist/mcp/server-instructions.js.map +0 -1
  232. package/dist/mcp/tools.d.ts +0 -200
  233. package/dist/mcp/tools.d.ts.map +0 -1
  234. package/dist/mcp/tools.js +0 -1319
  235. package/dist/mcp/tools.js.map +0 -1
  236. package/dist/mcp/transport.d.ts +0 -89
  237. package/dist/mcp/transport.d.ts.map +0 -1
  238. package/dist/mcp/transport.js +0 -170
  239. package/dist/mcp/transport.js.map +0 -1
  240. package/dist/resolution/frameworks/cargo-workspace.d.ts +0 -18
  241. package/dist/resolution/frameworks/cargo-workspace.d.ts.map +0 -1
  242. package/dist/resolution/frameworks/cargo-workspace.js +0 -225
  243. package/dist/resolution/frameworks/cargo-workspace.js.map +0 -1
  244. package/dist/resolution/frameworks/csharp.d.ts +0 -8
  245. package/dist/resolution/frameworks/csharp.d.ts.map +0 -1
  246. package/dist/resolution/frameworks/csharp.js +0 -213
  247. package/dist/resolution/frameworks/csharp.js.map +0 -1
  248. package/dist/resolution/frameworks/express.d.ts +0 -8
  249. package/dist/resolution/frameworks/express.d.ts.map +0 -1
  250. package/dist/resolution/frameworks/express.js +0 -225
  251. package/dist/resolution/frameworks/express.js.map +0 -1
  252. package/dist/resolution/frameworks/go.d.ts +0 -8
  253. package/dist/resolution/frameworks/go.d.ts.map +0 -1
  254. package/dist/resolution/frameworks/go.js +0 -158
  255. package/dist/resolution/frameworks/go.js.map +0 -1
  256. package/dist/resolution/frameworks/index.d.ts +0 -41
  257. package/dist/resolution/frameworks/index.d.ts.map +0 -1
  258. package/dist/resolution/frameworks/index.js +0 -129
  259. package/dist/resolution/frameworks/index.js.map +0 -1
  260. package/dist/resolution/frameworks/java.d.ts +0 -8
  261. package/dist/resolution/frameworks/java.d.ts.map +0 -1
  262. package/dist/resolution/frameworks/java.js +0 -177
  263. package/dist/resolution/frameworks/java.js.map +0 -1
  264. package/dist/resolution/frameworks/laravel.d.ts +0 -13
  265. package/dist/resolution/frameworks/laravel.d.ts.map +0 -1
  266. package/dist/resolution/frameworks/laravel.js +0 -248
  267. package/dist/resolution/frameworks/laravel.js.map +0 -1
  268. package/dist/resolution/frameworks/python.d.ts +0 -10
  269. package/dist/resolution/frameworks/python.d.ts.map +0 -1
  270. package/dist/resolution/frameworks/python.js +0 -278
  271. package/dist/resolution/frameworks/python.js.map +0 -1
  272. package/dist/resolution/frameworks/react.d.ts +0 -8
  273. package/dist/resolution/frameworks/react.d.ts.map +0 -1
  274. package/dist/resolution/frameworks/react.js +0 -272
  275. package/dist/resolution/frameworks/react.js.map +0 -1
  276. package/dist/resolution/frameworks/ruby.d.ts +0 -8
  277. package/dist/resolution/frameworks/ruby.d.ts.map +0 -1
  278. package/dist/resolution/frameworks/ruby.js +0 -198
  279. package/dist/resolution/frameworks/ruby.js.map +0 -1
  280. package/dist/resolution/frameworks/rust.d.ts +0 -8
  281. package/dist/resolution/frameworks/rust.d.ts.map +0 -1
  282. package/dist/resolution/frameworks/rust.js +0 -207
  283. package/dist/resolution/frameworks/rust.js.map +0 -1
  284. package/dist/resolution/frameworks/svelte.d.ts +0 -9
  285. package/dist/resolution/frameworks/svelte.d.ts.map +0 -1
  286. package/dist/resolution/frameworks/svelte.js +0 -249
  287. package/dist/resolution/frameworks/svelte.js.map +0 -1
  288. package/dist/resolution/frameworks/swift.d.ts +0 -10
  289. package/dist/resolution/frameworks/swift.d.ts.map +0 -1
  290. package/dist/resolution/frameworks/swift.js +0 -376
  291. package/dist/resolution/frameworks/swift.js.map +0 -1
  292. package/dist/resolution/frameworks/vue.d.ts +0 -9
  293. package/dist/resolution/frameworks/vue.d.ts.map +0 -1
  294. package/dist/resolution/frameworks/vue.js +0 -306
  295. package/dist/resolution/frameworks/vue.js.map +0 -1
  296. package/dist/resolution/import-resolver.d.ts +0 -40
  297. package/dist/resolution/import-resolver.d.ts.map +0 -1
  298. package/dist/resolution/import-resolver.js +0 -663
  299. package/dist/resolution/import-resolver.js.map +0 -1
  300. package/dist/resolution/index.d.ts +0 -106
  301. package/dist/resolution/index.d.ts.map +0 -1
  302. package/dist/resolution/index.js +0 -709
  303. package/dist/resolution/index.js.map +0 -1
  304. package/dist/resolution/name-matcher.d.ts +0 -32
  305. package/dist/resolution/name-matcher.d.ts.map +0 -1
  306. package/dist/resolution/name-matcher.js +0 -384
  307. package/dist/resolution/name-matcher.js.map +0 -1
  308. package/dist/resolution/path-aliases.d.ts +0 -68
  309. package/dist/resolution/path-aliases.d.ts.map +0 -1
  310. package/dist/resolution/path-aliases.js +0 -238
  311. package/dist/resolution/path-aliases.js.map +0 -1
  312. package/dist/resolution/strip-comments.d.ts +0 -27
  313. package/dist/resolution/strip-comments.d.ts.map +0 -1
  314. package/dist/resolution/strip-comments.js +0 -441
  315. package/dist/resolution/strip-comments.js.map +0 -1
  316. package/dist/resolution/types.d.ts +0 -172
  317. package/dist/resolution/types.d.ts.map +0 -1
  318. package/dist/resolution/types.js +0 -8
  319. package/dist/resolution/types.js.map +0 -1
  320. package/dist/search/query-parser.d.ts +0 -57
  321. package/dist/search/query-parser.d.ts.map +0 -1
  322. package/dist/search/query-parser.js +0 -177
  323. package/dist/search/query-parser.js.map +0 -1
  324. package/dist/search/query-utils.d.ts +0 -53
  325. package/dist/search/query-utils.d.ts.map +0 -1
  326. package/dist/search/query-utils.js +0 -347
  327. package/dist/search/query-utils.js.map +0 -1
  328. package/dist/sync/index.d.ts +0 -13
  329. package/dist/sync/index.d.ts.map +0 -1
  330. package/dist/sync/index.js +0 -17
  331. package/dist/sync/index.js.map +0 -1
  332. package/dist/sync/watcher.d.ts +0 -81
  333. package/dist/sync/watcher.d.ts.map +0 -1
  334. package/dist/sync/watcher.js +0 -184
  335. package/dist/sync/watcher.js.map +0 -1
  336. package/dist/types.d.ts +0 -423
  337. package/dist/types.d.ts.map +0 -1
  338. package/dist/types.js +0 -256
  339. package/dist/types.js.map +0 -1
  340. package/dist/ui/glyphs.d.ts +0 -42
  341. package/dist/ui/glyphs.d.ts.map +0 -1
  342. package/dist/ui/glyphs.js +0 -78
  343. package/dist/ui/glyphs.js.map +0 -1
  344. package/dist/ui/shimmer-progress.d.ts +0 -11
  345. package/dist/ui/shimmer-progress.d.ts.map +0 -1
  346. package/dist/ui/shimmer-progress.js +0 -90
  347. package/dist/ui/shimmer-progress.js.map +0 -1
  348. package/dist/ui/shimmer-worker.d.ts +0 -2
  349. package/dist/ui/shimmer-worker.d.ts.map +0 -1
  350. package/dist/ui/shimmer-worker.js +0 -118
  351. package/dist/ui/shimmer-worker.js.map +0 -1
  352. package/dist/ui/types.d.ts +0 -17
  353. package/dist/ui/types.d.ts.map +0 -1
  354. package/dist/ui/types.js +0 -3
  355. package/dist/ui/types.js.map +0 -1
  356. package/dist/utils.d.ts +0 -205
  357. package/dist/utils.d.ts.map +0 -1
  358. package/dist/utils.js +0 -549
  359. package/dist/utils.js.map +0 -1
  360. package/scripts/local-install.sh +0 -41
  361. package/scripts/patch-tree-sitter-dart.js +0 -112
  362. package/scripts/release.sh +0 -70
@@ -1,28 +0,0 @@
1
- /**
2
- * Agent-instructions template — the markdown body each agent target
3
- * writes into its conventional instructions file (CLAUDE.md /
4
- * AGENTS.md / codegraph.mdc / etc.).
5
- *
6
- * The body content is identical across agents because the codegraph
7
- * usage advice is agent-agnostic — only the destination filename and
8
- * any optional frontmatter (Cursor `.mdc`) varies per target.
9
- *
10
- * The legacy `claude-md-template.ts` re-exports these names for
11
- * backwards compatibility with downstream importers.
12
- */
13
- /** Markers used by the marker-based section replacement. */
14
- export declare const CODEGRAPH_SECTION_START = "<!-- CODEGRAPH_START -->";
15
- export declare const CODEGRAPH_SECTION_END = "<!-- CODEGRAPH_END -->";
16
- /**
17
- * The full marker-delimited block written into each agent's
18
- * instructions file. Includes the start/end markers so the section
19
- * can be detected and replaced on re-install.
20
- */
21
- export declare const INSTRUCTIONS_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"Survey an unfamiliar module/topic\" | `codegraph_explore` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one call.\n- **`codegraph_explore` is the heavy hitter** for unfamiliar areas \u2014 it returns full source from all relevant files in one call, but is token-heavy. If your harness supports parallel subagents (e.g., Claude Code's Task tool), spawn one for explore-class questions to keep main session context clean.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
22
- /**
23
- * Backwards-compat alias. Existing downstream code may import
24
- * `CLAUDE_MD_TEMPLATE` from this module via the re-export shim in
25
- * `claude-md-template.ts`.
26
- */
27
- export declare const CLAUDE_MD_TEMPLATE = "<!-- CODEGRAPH_START -->\n## CodeGraph\n\nThis project has a CodeGraph MCP server (`codegraph_*` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.\n\n### When to prefer codegraph over native search\n\nUse codegraph for **structural** questions \u2014 what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.\n\n| Question | Tool |\n|---|---|\n| \"Where is X defined?\" / \"Find symbol named X\" | `codegraph_search` |\n| \"What calls function Y?\" | `codegraph_callers` |\n| \"What does Y call?\" | `codegraph_callees` |\n| \"What would break if I changed Z?\" | `codegraph_impact` |\n| \"Show me Y's signature / source / docstring\" | `codegraph_node` |\n| \"Give me focused context for a task/area\" | `codegraph_context` |\n| \"Survey an unfamiliar module/topic\" | `codegraph_explore` |\n| \"What files exist under path/\" | `codegraph_files` |\n| \"Is the index healthy?\" | `codegraph_status` |\n\n### Rules of thumb\n\n- **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep \u2014 that's slower, less accurate, and wastes context.\n- **Don't grep first** when looking up a symbol by name. `codegraph_search` is faster and returns kind + location + signature in one call.\n- **Don't chain `codegraph_search` + `codegraph_node`** when you just want context \u2014 `codegraph_context` is one call.\n- **`codegraph_explore` is the heavy hitter** for unfamiliar areas \u2014 it returns full source from all relevant files in one call, but is token-heavy. If your harness supports parallel subagents (e.g., Claude Code's Task tool), spawn one for explore-class questions to keep main session context clean.\n- **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.\n\n### If `.codegraph/` doesn't exist\n\nThe MCP server returns \"not initialized.\" Ask the user: *\"I notice this project doesn't have CodeGraph initialized. Want me to run `codegraph init -i` to build the index?\"*\n<!-- CODEGRAPH_END -->";
28
- //# sourceMappingURL=instructions-template.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instructions-template.d.ts","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,4DAA4D;AAC5D,eAAO,MAAM,uBAAuB,6BAA6B,CAAC;AAClE,eAAO,MAAM,qBAAqB,2BAA2B,CAAC;AAE9D;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,+wEAgCT,CAAC;AAE1B;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,+wEAAwB,CAAC"}
@@ -1,63 +0,0 @@
1
- "use strict";
2
- /**
3
- * Agent-instructions template — the markdown body each agent target
4
- * writes into its conventional instructions file (CLAUDE.md /
5
- * AGENTS.md / codegraph.mdc / etc.).
6
- *
7
- * The body content is identical across agents because the codegraph
8
- * usage advice is agent-agnostic — only the destination filename and
9
- * any optional frontmatter (Cursor `.mdc`) varies per target.
10
- *
11
- * The legacy `claude-md-template.ts` re-exports these names for
12
- * backwards compatibility with downstream importers.
13
- */
14
- Object.defineProperty(exports, "__esModule", { value: true });
15
- exports.CLAUDE_MD_TEMPLATE = exports.INSTRUCTIONS_TEMPLATE = exports.CODEGRAPH_SECTION_END = exports.CODEGRAPH_SECTION_START = void 0;
16
- /** Markers used by the marker-based section replacement. */
17
- exports.CODEGRAPH_SECTION_START = '<!-- CODEGRAPH_START -->';
18
- exports.CODEGRAPH_SECTION_END = '<!-- CODEGRAPH_END -->';
19
- /**
20
- * The full marker-delimited block written into each agent's
21
- * instructions file. Includes the start/end markers so the section
22
- * can be detected and replaced on re-install.
23
- */
24
- exports.INSTRUCTIONS_TEMPLATE = `${exports.CODEGRAPH_SECTION_START}
25
- ## CodeGraph
26
-
27
- This project has a CodeGraph MCP server (\`codegraph_*\` tools) configured. CodeGraph is a tree-sitter-parsed knowledge graph of every symbol, edge, and file. Reads are sub-millisecond and return structural information grep cannot.
28
-
29
- ### When to prefer codegraph over native search
30
-
31
- Use codegraph for **structural** questions — what calls what, what would break, where is X defined, what is X's signature. Use native grep/read only for **literal text** queries (string contents, comments, log messages) or after you already have a specific file open.
32
-
33
- | Question | Tool |
34
- |---|---|
35
- | "Where is X defined?" / "Find symbol named X" | \`codegraph_search\` |
36
- | "What calls function Y?" | \`codegraph_callers\` |
37
- | "What does Y call?" | \`codegraph_callees\` |
38
- | "What would break if I changed Z?" | \`codegraph_impact\` |
39
- | "Show me Y's signature / source / docstring" | \`codegraph_node\` |
40
- | "Give me focused context for a task/area" | \`codegraph_context\` |
41
- | "Survey an unfamiliar module/topic" | \`codegraph_explore\` |
42
- | "What files exist under path/" | \`codegraph_files\` |
43
- | "Is the index healthy?" | \`codegraph_status\` |
44
-
45
- ### Rules of thumb
46
-
47
- - **Trust codegraph results.** They come from a full AST parse. Do NOT re-verify them with grep — that's slower, less accurate, and wastes context.
48
- - **Don't grep first** when looking up a symbol by name. \`codegraph_search\` is faster and returns kind + location + signature in one call.
49
- - **Don't chain \`codegraph_search\` + \`codegraph_node\`** when you just want context — \`codegraph_context\` is one call.
50
- - **\`codegraph_explore\` is the heavy hitter** for unfamiliar areas — it returns full source from all relevant files in one call, but is token-heavy. If your harness supports parallel subagents (e.g., Claude Code's Task tool), spawn one for explore-class questions to keep main session context clean.
51
- - **Index lag**: the file watcher debounces ~500ms behind writes; don't re-query immediately after editing a file in the same turn.
52
-
53
- ### If \`.codegraph/\` doesn't exist
54
-
55
- The MCP server returns "not initialized." Ask the user: *"I notice this project doesn't have CodeGraph initialized. Want me to run \`codegraph init -i\` to build the index?"*
56
- ${exports.CODEGRAPH_SECTION_END}`;
57
- /**
58
- * Backwards-compat alias. Existing downstream code may import
59
- * `CLAUDE_MD_TEMPLATE` from this module via the re-export shim in
60
- * `claude-md-template.ts`.
61
- */
62
- exports.CLAUDE_MD_TEMPLATE = exports.INSTRUCTIONS_TEMPLATE;
63
- //# sourceMappingURL=instructions-template.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"instructions-template.js","sourceRoot":"","sources":["../../src/installer/instructions-template.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;GAWG;;;AAEH,4DAA4D;AAC/C,QAAA,uBAAuB,GAAG,0BAA0B,CAAC;AACrD,QAAA,qBAAqB,GAAG,wBAAwB,CAAC;AAE9D;;;;GAIG;AACU,QAAA,qBAAqB,GAAG,GAAG,+BAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAgC7D,6BAAqB,EAAE,CAAC;AAE1B;;;;GAIG;AACU,QAAA,kBAAkB,GAAG,6BAAqB,CAAC"}
@@ -1,27 +0,0 @@
1
- /**
2
- * Claude Code target — the historical default. Writes:
3
- *
4
- * - MCP server entry to `~/.claude.json` (global) or
5
- * `./.claude.json` (local).
6
- * - Permissions to `~/.claude/settings.json` (global) or
7
- * `./.claude/settings.json` (local), gated on `autoAllow`.
8
- * - Instructions to `~/.claude/CLAUDE.md` (global) or
9
- * `./.claude/CLAUDE.md` (local).
10
- *
11
- * All paths and shapes ported verbatim from the original
12
- * `config-writer.ts` so existing Claude Code installs upgrade in
13
- * place — no migration on disk required.
14
- */
15
- import { AgentTarget, Location, WriteResult } from './types';
16
- /**
17
- * Per-file write helpers, exported so the legacy `config-writer.ts`
18
- * shim can call only the named operation (writeMcpConfig writes ONLY
19
- * the MCP entry, etc.) instead of `claudeTarget.install()` which
20
- * writes all three files. Without this split the shims silently
21
- * cause side effects callers don't expect.
22
- */
23
- export declare function writeMcpEntry(loc: Location): WriteResult['files'][number];
24
- export declare function writePermissionsEntry(loc: Location): WriteResult['files'][number];
25
- export declare function writeInstructionsEntry(loc: Location): WriteResult['files'][number];
26
- export declare const claudeTarget: AgentTarget;
27
- //# sourceMappingURL=claude.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/claude.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAKH,OAAO,EACL,WAAW,EAGX,QAAQ,EACR,WAAW,EACZ,MAAM,SAAS,CAAC;AAqIjB;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAqBzE;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAoBjF;AAED,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,QAAQ,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CA0ClF;AAED,eAAO,MAAM,YAAY,EAAE,WAAoC,CAAC"}
@@ -1,246 +0,0 @@
1
- "use strict";
2
- /**
3
- * Claude Code target — the historical default. Writes:
4
- *
5
- * - MCP server entry to `~/.claude.json` (global) or
6
- * `./.claude.json` (local).
7
- * - Permissions to `~/.claude/settings.json` (global) or
8
- * `./.claude/settings.json` (local), gated on `autoAllow`.
9
- * - Instructions to `~/.claude/CLAUDE.md` (global) or
10
- * `./.claude/CLAUDE.md` (local).
11
- *
12
- * All paths and shapes ported verbatim from the original
13
- * `config-writer.ts` so existing Claude Code installs upgrade in
14
- * place — no migration on disk required.
15
- */
16
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- var desc = Object.getOwnPropertyDescriptor(m, k);
19
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
20
- desc = { enumerable: true, get: function() { return m[k]; } };
21
- }
22
- Object.defineProperty(o, k2, desc);
23
- }) : (function(o, m, k, k2) {
24
- if (k2 === undefined) k2 = k;
25
- o[k2] = m[k];
26
- }));
27
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
28
- Object.defineProperty(o, "default", { enumerable: true, value: v });
29
- }) : function(o, v) {
30
- o["default"] = v;
31
- });
32
- var __importStar = (this && this.__importStar) || (function () {
33
- var ownKeys = function(o) {
34
- ownKeys = Object.getOwnPropertyNames || function (o) {
35
- var ar = [];
36
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
37
- return ar;
38
- };
39
- return ownKeys(o);
40
- };
41
- return function (mod) {
42
- if (mod && mod.__esModule) return mod;
43
- var result = {};
44
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
45
- __setModuleDefault(result, mod);
46
- return result;
47
- };
48
- })();
49
- Object.defineProperty(exports, "__esModule", { value: true });
50
- exports.claudeTarget = void 0;
51
- exports.writeMcpEntry = writeMcpEntry;
52
- exports.writePermissionsEntry = writePermissionsEntry;
53
- exports.writeInstructionsEntry = writeInstructionsEntry;
54
- const fs = __importStar(require("fs"));
55
- const path = __importStar(require("path"));
56
- const os = __importStar(require("os"));
57
- const shared_1 = require("./shared");
58
- const instructions_template_1 = require("../instructions-template");
59
- function configDir(loc) {
60
- return loc === 'global'
61
- ? path.join(os.homedir(), '.claude')
62
- : path.join(process.cwd(), '.claude');
63
- }
64
- function mcpJsonPath(loc) {
65
- return loc === 'global'
66
- ? path.join(os.homedir(), '.claude.json')
67
- : path.join(process.cwd(), '.claude.json');
68
- }
69
- function settingsJsonPath(loc) {
70
- return path.join(configDir(loc), 'settings.json');
71
- }
72
- function instructionsPath(loc) {
73
- return path.join(configDir(loc), 'CLAUDE.md');
74
- }
75
- class ClaudeCodeTarget {
76
- id = 'claude';
77
- displayName = 'Claude Code';
78
- docsUrl = 'https://docs.claude.com/en/docs/claude-code';
79
- supportsLocation(_loc) {
80
- return true;
81
- }
82
- detect(loc) {
83
- const mcpPath = mcpJsonPath(loc);
84
- const config = (0, shared_1.readJsonFile)(mcpPath);
85
- const alreadyConfigured = !!config.mcpServers?.codegraph;
86
- // For "installed" we infer from the existence of either the dir
87
- // (global) or the project marker file (local). Cheap and avoids
88
- // shelling out to `claude --version`.
89
- const installed = loc === 'global'
90
- ? fs.existsSync(configDir(loc)) || fs.existsSync(mcpPath)
91
- : fs.existsSync(mcpPath) || fs.existsSync(configDir(loc));
92
- return { installed, alreadyConfigured, configPath: mcpPath };
93
- }
94
- install(loc, opts) {
95
- const files = [];
96
- // 1. MCP server entry
97
- files.push(writeMcpEntry(loc));
98
- // 2. Permissions (only when autoAllow)
99
- if (opts.autoAllow) {
100
- files.push(writePermissionsEntry(loc));
101
- }
102
- // 3. CLAUDE.md instructions
103
- files.push(writeInstructionsEntry(loc));
104
- return { files };
105
- }
106
- uninstall(loc) {
107
- const files = [];
108
- // 1. MCP server entry
109
- const mcpPath = mcpJsonPath(loc);
110
- const config = (0, shared_1.readJsonFile)(mcpPath);
111
- if (config.mcpServers?.codegraph) {
112
- delete config.mcpServers.codegraph;
113
- if (Object.keys(config.mcpServers).length === 0) {
114
- delete config.mcpServers;
115
- }
116
- (0, shared_1.writeJsonFile)(mcpPath, config);
117
- files.push({ path: mcpPath, action: 'removed' });
118
- }
119
- else {
120
- files.push({ path: mcpPath, action: 'not-found' });
121
- }
122
- // 2. Permissions
123
- const settingsPath = settingsJsonPath(loc);
124
- const settings = (0, shared_1.readJsonFile)(settingsPath);
125
- if (Array.isArray(settings.permissions?.allow)) {
126
- const before = settings.permissions.allow.length;
127
- settings.permissions.allow = settings.permissions.allow.filter((p) => !p.startsWith('mcp__codegraph__'));
128
- if (settings.permissions.allow.length !== before) {
129
- if (settings.permissions.allow.length === 0) {
130
- delete settings.permissions.allow;
131
- }
132
- if (Object.keys(settings.permissions).length === 0) {
133
- delete settings.permissions;
134
- }
135
- (0, shared_1.writeJsonFile)(settingsPath, settings);
136
- files.push({ path: settingsPath, action: 'removed' });
137
- }
138
- else {
139
- files.push({ path: settingsPath, action: 'not-found' });
140
- }
141
- }
142
- else {
143
- files.push({ path: settingsPath, action: 'not-found' });
144
- }
145
- // 3. Instructions
146
- const instr = instructionsPath(loc);
147
- const action = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
148
- files.push({ path: instr, action });
149
- return { files };
150
- }
151
- printConfig(loc) {
152
- const target = mcpJsonPath(loc);
153
- const snippet = JSON.stringify({ mcpServers: { codegraph: (0, shared_1.getMcpServerConfig)() } }, null, 2);
154
- return `# Add to ${target}\n\n${snippet}\n`;
155
- }
156
- describePaths(loc) {
157
- return [mcpJsonPath(loc), settingsJsonPath(loc), instructionsPath(loc)];
158
- }
159
- }
160
- /**
161
- * Per-file write helpers, exported so the legacy `config-writer.ts`
162
- * shim can call only the named operation (writeMcpConfig writes ONLY
163
- * the MCP entry, etc.) instead of `claudeTarget.install()` which
164
- * writes all three files. Without this split the shims silently
165
- * cause side effects callers don't expect.
166
- */
167
- function writeMcpEntry(loc) {
168
- const file = mcpJsonPath(loc);
169
- const existing = (0, shared_1.readJsonFile)(file);
170
- const before = existing.mcpServers?.codegraph;
171
- const after = (0, shared_1.getMcpServerConfig)();
172
- if ((0, shared_1.jsonDeepEqual)(before, after)) {
173
- // Already exactly what we'd write — preserve byte-identical file.
174
- return { path: file, action: 'unchanged' };
175
- }
176
- // 'created' here means: the file itself did not exist before this
177
- // write. A pre-existing `.claude.json` containing other MCP servers
178
- // (no `codegraph` key) is 'updated', not 'created' — we're adding
179
- // an entry to a file that was already there. Codex uses a different
180
- // idiom (empty-content => 'created') because its config.toml is
181
- // ours alone to manage.
182
- const action = before ? 'updated' : (fs.existsSync(file) ? 'updated' : 'created');
183
- if (!existing.mcpServers)
184
- existing.mcpServers = {};
185
- existing.mcpServers.codegraph = after;
186
- (0, shared_1.writeJsonFile)(file, existing);
187
- return { path: file, action };
188
- }
189
- function writePermissionsEntry(loc) {
190
- const file = settingsJsonPath(loc);
191
- const settings = (0, shared_1.readJsonFile)(file);
192
- const created = !fs.existsSync(file);
193
- if (!settings.permissions)
194
- settings.permissions = {};
195
- if (!Array.isArray(settings.permissions.allow))
196
- settings.permissions.allow = [];
197
- const want = (0, shared_1.getCodeGraphPermissions)();
198
- const before = [...settings.permissions.allow];
199
- for (const perm of want) {
200
- if (!settings.permissions.allow.includes(perm)) {
201
- settings.permissions.allow.push(perm);
202
- }
203
- }
204
- if ((0, shared_1.jsonDeepEqual)(before, settings.permissions.allow) && !created) {
205
- return { path: file, action: 'unchanged' };
206
- }
207
- (0, shared_1.writeJsonFile)(file, settings);
208
- return { path: file, action: created ? 'created' : 'updated' };
209
- }
210
- function writeInstructionsEntry(loc) {
211
- const file = instructionsPath(loc);
212
- // Ensure config dir exists (for global ~/.claude/).
213
- const dir = path.dirname(file);
214
- if (!fs.existsSync(dir))
215
- fs.mkdirSync(dir, { recursive: true });
216
- // Honor the legacy "unmarked ## CodeGraph" rewrite path that the
217
- // original installer supported (some users hand-pasted a section
218
- // before markers existed). Detect first and migrate inline.
219
- if (fs.existsSync(file)) {
220
- const content = fs.readFileSync(file, 'utf-8');
221
- if (!content.includes(instructions_template_1.CODEGRAPH_SECTION_START)) {
222
- const headerMatch = content.match(/\n## CodeGraph\n/);
223
- if (headerMatch && headerMatch.index !== undefined) {
224
- const sectionStart = headerMatch.index;
225
- const after = content.substring(sectionStart + 1);
226
- const nextHeader = after.match(/\n## (?!#)/);
227
- const sectionEnd = nextHeader && nextHeader.index !== undefined
228
- ? sectionStart + 1 + nextHeader.index
229
- : content.length;
230
- const merged = content.substring(0, sectionStart) +
231
- '\n' + instructions_template_1.INSTRUCTIONS_TEMPLATE +
232
- content.substring(sectionEnd);
233
- (0, shared_1.atomicWriteFileSync)(file, merged);
234
- return { path: file, action: 'updated' };
235
- }
236
- }
237
- }
238
- const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
239
- // Map the four-state action to WriteResult's action vocabulary.
240
- const mapped = action === 'created' ? 'created'
241
- : action === 'unchanged' ? 'unchanged'
242
- : 'updated';
243
- return { path: file, action: mapped };
244
- }
245
- exports.claudeTarget = new ClaudeCodeTarget();
246
- //# sourceMappingURL=claude.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"claude.js","sourceRoot":"","sources":["../../../src/installer/targets/claude.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuJH,sCAqBC;AAED,sDAoBC;AAED,wDA0CC;AA5OD,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCASkB;AAClB,oEAIkC;AAEl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AC;AAEY,QAAA,YAAY,GAAgB,IAAI,gBAAgB,EAAE,CAAC"}
@@ -1,18 +0,0 @@
1
- /**
2
- * OpenAI Codex CLI target.
3
- *
4
- * - MCP server entry to `~/.codex/config.toml` as the dotted-key
5
- * table `[mcp_servers.codegraph]`. TOML — not JSON — handled by
6
- * the narrow serializer in `./toml.ts`.
7
- * - Instructions to `~/.codex/AGENTS.md`.
8
- *
9
- * Codex CLI as of 2026-05 has no project-local config concept —
10
- * everything lives under `~/.codex/`. `supportsLocation('local')`
11
- * returns false; the orchestrator skips Codex when the user picks
12
- * the local install location.
13
- *
14
- * No permissions concept.
15
- */
16
- import { AgentTarget } from './types';
17
- export declare const codexTarget: AgentTarget;
18
- //# sourceMappingURL=codex.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex.d.ts","sourceRoot":"","sources":["../../../src/installer/targets/codex.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAKH,OAAO,EACL,WAAW,EAKZ,MAAM,SAAS,CAAC;AA2JjB,eAAO,MAAM,WAAW,EAAE,WAA+B,CAAC"}
@@ -1,185 +0,0 @@
1
- "use strict";
2
- /**
3
- * OpenAI Codex CLI target.
4
- *
5
- * - MCP server entry to `~/.codex/config.toml` as the dotted-key
6
- * table `[mcp_servers.codegraph]`. TOML — not JSON — handled by
7
- * the narrow serializer in `./toml.ts`.
8
- * - Instructions to `~/.codex/AGENTS.md`.
9
- *
10
- * Codex CLI as of 2026-05 has no project-local config concept —
11
- * everything lives under `~/.codex/`. `supportsLocation('local')`
12
- * returns false; the orchestrator skips Codex when the user picks
13
- * the local install location.
14
- *
15
- * No permissions concept.
16
- */
17
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
- if (k2 === undefined) k2 = k;
19
- var desc = Object.getOwnPropertyDescriptor(m, k);
20
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
- desc = { enumerable: true, get: function() { return m[k]; } };
22
- }
23
- Object.defineProperty(o, k2, desc);
24
- }) : (function(o, m, k, k2) {
25
- if (k2 === undefined) k2 = k;
26
- o[k2] = m[k];
27
- }));
28
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
- Object.defineProperty(o, "default", { enumerable: true, value: v });
30
- }) : function(o, v) {
31
- o["default"] = v;
32
- });
33
- var __importStar = (this && this.__importStar) || (function () {
34
- var ownKeys = function(o) {
35
- ownKeys = Object.getOwnPropertyNames || function (o) {
36
- var ar = [];
37
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
- return ar;
39
- };
40
- return ownKeys(o);
41
- };
42
- return function (mod) {
43
- if (mod && mod.__esModule) return mod;
44
- var result = {};
45
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
- __setModuleDefault(result, mod);
47
- return result;
48
- };
49
- })();
50
- Object.defineProperty(exports, "__esModule", { value: true });
51
- exports.codexTarget = void 0;
52
- const fs = __importStar(require("fs"));
53
- const path = __importStar(require("path"));
54
- const os = __importStar(require("os"));
55
- const shared_1 = require("./shared");
56
- const instructions_template_1 = require("../instructions-template");
57
- const toml_1 = require("./toml");
58
- const TOML_HEADER = 'mcp_servers.codegraph';
59
- function configDir() {
60
- return path.join(os.homedir(), '.codex');
61
- }
62
- function tomlConfigPath() {
63
- return path.join(configDir(), 'config.toml');
64
- }
65
- function instructionsPath() {
66
- return path.join(configDir(), 'AGENTS.md');
67
- }
68
- class CodexTarget {
69
- id = 'codex';
70
- displayName = 'Codex CLI';
71
- docsUrl = 'https://github.com/openai/codex';
72
- supportsLocation(loc) {
73
- return loc === 'global';
74
- }
75
- detect(loc) {
76
- if (loc !== 'global') {
77
- return { installed: false, alreadyConfigured: false };
78
- }
79
- const tomlPath = tomlConfigPath();
80
- let alreadyConfigured = false;
81
- if (fs.existsSync(tomlPath)) {
82
- try {
83
- const content = fs.readFileSync(tomlPath, 'utf-8');
84
- alreadyConfigured = content.includes(`[${TOML_HEADER}]`);
85
- }
86
- catch { /* ignore */ }
87
- }
88
- const installed = fs.existsSync(configDir());
89
- return { installed, alreadyConfigured, configPath: tomlPath };
90
- }
91
- install(loc, _opts) {
92
- if (loc !== 'global') {
93
- return {
94
- files: [],
95
- notes: ['Codex CLI has no project-local config — re-run with --location=global to install.'],
96
- };
97
- }
98
- const files = [];
99
- files.push(writeMcpEntry());
100
- files.push(writeInstructionsEntry());
101
- return { files };
102
- }
103
- uninstall(loc) {
104
- if (loc !== 'global')
105
- return { files: [] };
106
- const files = [];
107
- const tomlPath = tomlConfigPath();
108
- if (fs.existsSync(tomlPath)) {
109
- const content = fs.readFileSync(tomlPath, 'utf-8');
110
- const { content: nextContent, action } = (0, toml_1.removeTomlTable)(content, TOML_HEADER);
111
- if (action === 'removed') {
112
- if (nextContent.trim() === '') {
113
- try {
114
- fs.unlinkSync(tomlPath);
115
- }
116
- catch { /* ignore */ }
117
- }
118
- else {
119
- (0, shared_1.atomicWriteFileSync)(tomlPath, nextContent.trimEnd() + '\n');
120
- }
121
- files.push({ path: tomlPath, action: 'removed' });
122
- }
123
- else {
124
- files.push({ path: tomlPath, action: 'not-found' });
125
- }
126
- }
127
- else {
128
- files.push({ path: tomlPath, action: 'not-found' });
129
- }
130
- const instr = instructionsPath();
131
- const instrAction = (0, shared_1.removeMarkedSection)(instr, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
132
- files.push({ path: instr, action: instrAction });
133
- return { files };
134
- }
135
- printConfig(loc) {
136
- if (loc !== 'global') {
137
- return '# Codex CLI has no project-local config — use --location=global.\n';
138
- }
139
- const block = buildCodegraphBlock();
140
- return `# Add to ${tomlConfigPath()}\n\n${block}\n`;
141
- }
142
- describePaths(loc) {
143
- if (loc !== 'global')
144
- return [];
145
- return [tomlConfigPath(), instructionsPath()];
146
- }
147
- }
148
- function buildCodegraphBlock() {
149
- const mcp = (0, shared_1.getMcpServerConfig)();
150
- return (0, toml_1.buildTomlTable)(TOML_HEADER, {
151
- command: mcp.command,
152
- args: mcp.args,
153
- });
154
- }
155
- function writeMcpEntry() {
156
- const file = tomlConfigPath();
157
- const dir = path.dirname(file);
158
- if (!fs.existsSync(dir))
159
- fs.mkdirSync(dir, { recursive: true });
160
- const block = buildCodegraphBlock();
161
- // Single read — `existing === ''` derives both "is the file empty
162
- // or absent" and "what was its content," avoiding a TOCTOU window
163
- // between two `fs.existsSync` calls.
164
- const existing = fs.existsSync(file) ? fs.readFileSync(file, 'utf-8') : '';
165
- const created = existing.length === 0;
166
- const { content: nextContent, action } = (0, toml_1.upsertTomlTable)(existing, TOML_HEADER, block);
167
- if (action === 'unchanged') {
168
- return { path: file, action: 'unchanged' };
169
- }
170
- (0, shared_1.atomicWriteFileSync)(file, nextContent);
171
- return { path: file, action: created ? 'created' : 'updated' };
172
- }
173
- function writeInstructionsEntry() {
174
- const file = instructionsPath();
175
- const dir = path.dirname(file);
176
- if (!fs.existsSync(dir))
177
- fs.mkdirSync(dir, { recursive: true });
178
- const action = (0, shared_1.replaceOrAppendMarkedSection)(file, instructions_template_1.INSTRUCTIONS_TEMPLATE, instructions_template_1.CODEGRAPH_SECTION_START, instructions_template_1.CODEGRAPH_SECTION_END);
179
- const mapped = action === 'created' ? 'created'
180
- : action === 'unchanged' ? 'unchanged'
181
- : 'updated';
182
- return { path: file, action: mapped };
183
- }
184
- exports.codexTarget = new CodexTarget();
185
- //# sourceMappingURL=codex.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"codex.js","sourceRoot":"","sources":["../../../src/installer/targets/codex.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,2CAA6B;AAC7B,uCAAyB;AAQzB,qCAKkB;AAClB,oEAIkC;AAClC,iCAA0E;AAE1E,MAAM,WAAW,GAAG,uBAAuB,CAAC;AAE5C,SA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,qCAA4B,EACzC,IAAI,EACJ,6CAAqB,EACrB,+CAAuB,EACvB,6CAAqB,CACtB,CAAC;IACF,MAAM,MAAM,GACV,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS;QAC9B,CAAC,CAAC,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,WAAW;YACpC,CAAC,CAAC,SAAS,CAAC;IAClB,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,CAAC;AACxC,CAAC;AAEY,QAAA,WAAW,GAAgB,IAAI,WAAW,EAAE,CAAC"}
@@ -1,35 +0,0 @@
1
- /**
2
- * Cursor target.
3
- *
4
- * - MCP server entry to `~/.cursor/mcp.json` (global) or
5
- * `./.cursor/mcp.json` (local). Same `{mcpServers: {...}}` shape
6
- * as Claude.
7
- * - Instructions to `./.cursor/rules/codegraph.mdc` (project-local
8
- * ONLY). Cursor's rules system is a project-scoped surface;
9
- * global cursor rules aren't a stable convention as of 2026-05.
10
- * For `--location=global`, only mcp.json is written.
11
- *
12
- * ## Why we hardcode `--path` for Cursor
13
- *
14
- * Cursor launches MCP-server subprocesses with a working directory
15
- * that ISN'T the workspace root AND doesn't pass `rootUri` /
16
- * `workspaceFolders` in the MCP initialize call. The codegraph MCP
17
- * server's `process.cwd()` fallback therefore misses the workspace's
18
- * `.codegraph/` and reports "not initialized" on every tool call.
19
- *
20
- * So we inject `--path` into the args ourselves:
21
- *
22
- * - `local` install: absolute path (we know it at install time).
23
- * - `global` install: `${workspaceFolder}` — Cursor expands this to
24
- * the open workspace's root, giving us per-workspace behavior
25
- * from a single global config.
26
- *
27
- * Codex and Claude do not need this — they launch MCP servers with
28
- * `cwd = workspace` and pass `rootUri`, respectively.
29
- *
30
- * No permissions concept — Cursor doesn't have an auto-allow list
31
- * the installer can populate. `autoAllow` is silently ignored.
32
- */
33
- import { AgentTarget } from './types';
34
- export declare const cursorTarget: AgentTarget;
35
- //# sourceMappingURL=cursor.d.ts.map