sdl-mcp 0.8.6 → 0.8.9

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 (458) hide show
  1. package/README.md +408 -183
  2. package/config/sdlmcp.config.example.json +4 -3
  3. package/config/sdlmcp.config.schema.json +104 -7
  4. package/dist/agent/orchestrator.d.ts.map +1 -1
  5. package/dist/agent/orchestrator.js +5 -1
  6. package/dist/agent/orchestrator.js.map +1 -1
  7. package/dist/benchmark/matrix-runner.d.ts +3 -0
  8. package/dist/benchmark/matrix-runner.d.ts.map +1 -0
  9. package/dist/benchmark/matrix-runner.js +18 -0
  10. package/dist/benchmark/matrix-runner.js.map +1 -0
  11. package/dist/cli/argParsing.d.ts +2 -1
  12. package/dist/cli/argParsing.d.ts.map +1 -1
  13. package/dist/cli/argParsing.js +37 -0
  14. package/dist/cli/argParsing.js.map +1 -1
  15. package/dist/cli/commands/doctor.d.ts.map +1 -1
  16. package/dist/cli/commands/doctor.js +127 -33
  17. package/dist/cli/commands/doctor.js.map +1 -1
  18. package/dist/cli/commands/serve.d.ts.map +1 -1
  19. package/dist/cli/commands/serve.js +15 -4
  20. package/dist/cli/commands/serve.js.map +1 -1
  21. package/dist/cli/commands/tool-actions.d.ts +38 -0
  22. package/dist/cli/commands/tool-actions.d.ts.map +1 -0
  23. package/dist/cli/commands/tool-actions.js +454 -0
  24. package/dist/cli/commands/tool-actions.js.map +1 -0
  25. package/dist/cli/commands/tool-arg-parser.d.ts +27 -0
  26. package/dist/cli/commands/tool-arg-parser.d.ts.map +1 -0
  27. package/dist/cli/commands/tool-arg-parser.js +135 -0
  28. package/dist/cli/commands/tool-arg-parser.js.map +1 -0
  29. package/dist/cli/commands/tool-dispatch.d.ts +28 -0
  30. package/dist/cli/commands/tool-dispatch.d.ts.map +1 -0
  31. package/dist/cli/commands/tool-dispatch.js +222 -0
  32. package/dist/cli/commands/tool-dispatch.js.map +1 -0
  33. package/dist/cli/commands/tool-output.d.ts +20 -0
  34. package/dist/cli/commands/tool-output.d.ts.map +1 -0
  35. package/dist/cli/commands/tool-output.js +205 -0
  36. package/dist/cli/commands/tool-output.js.map +1 -0
  37. package/dist/cli/index.js +12 -4
  38. package/dist/cli/index.js.map +1 -1
  39. package/dist/cli/transport/http.d.ts +4 -0
  40. package/dist/cli/transport/http.d.ts.map +1 -1
  41. package/dist/cli/transport/http.js +141 -26
  42. package/dist/cli/transport/http.js.map +1 -1
  43. package/dist/cli/transport/stdio.d.ts.map +1 -1
  44. package/dist/cli/transport/stdio.js.map +1 -1
  45. package/dist/cli/types.d.ts +12 -0
  46. package/dist/cli/types.d.ts.map +1 -1
  47. package/dist/code/gate.d.ts.map +1 -1
  48. package/dist/code/gate.js +4 -12
  49. package/dist/code/gate.js.map +1 -1
  50. package/dist/code/hotpath.d.ts.map +1 -1
  51. package/dist/code/hotpath.js +2 -2
  52. package/dist/code/hotpath.js.map +1 -1
  53. package/dist/code/redact.d.ts.map +1 -1
  54. package/dist/code/redact.js +3 -1
  55. package/dist/code/redact.js.map +1 -1
  56. package/dist/code/skeleton.d.ts +1 -1
  57. package/dist/code/skeleton.d.ts.map +1 -1
  58. package/dist/code/skeleton.js +4 -4
  59. package/dist/code/skeleton.js.map +1 -1
  60. package/dist/code/windows.d.ts.map +1 -1
  61. package/dist/code/windows.js +162 -17
  62. package/dist/code/windows.js.map +1 -1
  63. package/dist/config/constants.d.ts +104 -0
  64. package/dist/config/constants.d.ts.map +1 -1
  65. package/dist/config/constants.js +107 -0
  66. package/dist/config/constants.js.map +1 -1
  67. package/dist/config/loadConfig.js +5 -5
  68. package/dist/config/loadConfig.js.map +1 -1
  69. package/dist/config/types.d.ts +165 -8
  70. package/dist/config/types.d.ts.map +1 -1
  71. package/dist/config/types.js +60 -4
  72. package/dist/config/types.js.map +1 -1
  73. package/dist/db/ladybug-clusters.d.ts +4 -0
  74. package/dist/db/ladybug-clusters.d.ts.map +1 -1
  75. package/dist/db/ladybug-clusters.js +22 -15
  76. package/dist/db/ladybug-clusters.js.map +1 -1
  77. package/dist/db/ladybug-core.d.ts +8 -0
  78. package/dist/db/ladybug-core.d.ts.map +1 -1
  79. package/dist/db/ladybug-core.js +60 -5
  80. package/dist/db/ladybug-core.js.map +1 -1
  81. package/dist/db/ladybug-embeddings.d.ts +2 -0
  82. package/dist/db/ladybug-embeddings.d.ts.map +1 -1
  83. package/dist/db/ladybug-embeddings.js +34 -0
  84. package/dist/db/ladybug-embeddings.js.map +1 -1
  85. package/dist/db/ladybug-feedback.d.ts.map +1 -1
  86. package/dist/db/ladybug-feedback.js +4 -15
  87. package/dist/db/ladybug-feedback.js.map +1 -1
  88. package/dist/db/ladybug-metrics.d.ts +1 -0
  89. package/dist/db/ladybug-metrics.d.ts.map +1 -1
  90. package/dist/db/ladybug-metrics.js +24 -0
  91. package/dist/db/ladybug-metrics.js.map +1 -1
  92. package/dist/db/ladybug-processes.d.ts.map +1 -1
  93. package/dist/db/ladybug-processes.js +15 -13
  94. package/dist/db/ladybug-processes.js.map +1 -1
  95. package/dist/db/ladybug-repos.d.ts.map +1 -1
  96. package/dist/db/ladybug-repos.js +14 -7
  97. package/dist/db/ladybug-repos.js.map +1 -1
  98. package/dist/db/ladybug-schema.d.ts.map +1 -1
  99. package/dist/db/ladybug-schema.js +20 -1
  100. package/dist/db/ladybug-schema.js.map +1 -1
  101. package/dist/db/ladybug-slices.d.ts.map +1 -1
  102. package/dist/db/ladybug-slices.js +5 -3
  103. package/dist/db/ladybug-slices.js.map +1 -1
  104. package/dist/db/ladybug-symbols.d.ts.map +1 -1
  105. package/dist/db/ladybug-symbols.js +42 -18
  106. package/dist/db/ladybug-symbols.js.map +1 -1
  107. package/dist/db/ladybug.d.ts +5 -3
  108. package/dist/db/ladybug.d.ts.map +1 -1
  109. package/dist/db/ladybug.js +35 -15
  110. package/dist/db/ladybug.js.map +1 -1
  111. package/dist/delta/blastRadius.js +16 -10
  112. package/dist/delta/blastRadius.js.map +1 -1
  113. package/dist/delta/diff.d.ts +2 -0
  114. package/dist/delta/diff.d.ts.map +1 -1
  115. package/dist/delta/diff.js +19 -8
  116. package/dist/delta/diff.js.map +1 -1
  117. package/dist/domain/errors.d.ts +31 -1
  118. package/dist/domain/errors.d.ts.map +1 -1
  119. package/dist/domain/errors.js +66 -0
  120. package/dist/domain/errors.js.map +1 -1
  121. package/dist/experiments/event-log-replay.d.ts.map +1 -1
  122. package/dist/experiments/event-log-replay.js +3 -3
  123. package/dist/experiments/event-log-replay.js.map +1 -1
  124. package/dist/gateway/compact-schema.d.ts +9 -0
  125. package/dist/gateway/compact-schema.d.ts.map +1 -0
  126. package/dist/gateway/compact-schema.js +138 -0
  127. package/dist/gateway/compact-schema.js.map +1 -0
  128. package/dist/gateway/descriptions.d.ts +9 -0
  129. package/dist/gateway/descriptions.d.ts.map +1 -0
  130. package/dist/gateway/descriptions.js +26 -0
  131. package/dist/gateway/descriptions.js.map +1 -0
  132. package/dist/gateway/index.d.ts +20 -0
  133. package/dist/gateway/index.d.ts.map +1 -0
  134. package/dist/gateway/index.js +29 -0
  135. package/dist/gateway/index.js.map +1 -0
  136. package/dist/gateway/legacy.d.ts +16 -0
  137. package/dist/gateway/legacy.d.ts.map +1 -0
  138. package/dist/gateway/legacy.js +46 -0
  139. package/dist/gateway/legacy.js.map +1 -0
  140. package/dist/gateway/router.d.ts +34 -0
  141. package/dist/gateway/router.d.ts.map +1 -0
  142. package/dist/gateway/router.js +153 -0
  143. package/dist/gateway/router.js.map +1 -0
  144. package/dist/gateway/schemas.d.ts +697 -0
  145. package/dist/gateway/schemas.d.ts.map +1 -0
  146. package/dist/gateway/schemas.js +301 -0
  147. package/dist/gateway/schemas.js.map +1 -0
  148. package/dist/gateway/thin-schemas.d.ts +14 -0
  149. package/dist/gateway/thin-schemas.d.ts.map +1 -0
  150. package/dist/gateway/thin-schemas.js +35 -0
  151. package/dist/gateway/thin-schemas.js.map +1 -0
  152. package/dist/graph/buildGraph.d.ts +4 -1
  153. package/dist/graph/buildGraph.d.ts.map +1 -1
  154. package/dist/graph/buildGraph.js.map +1 -1
  155. package/dist/graph/cache.d.ts +5 -0
  156. package/dist/graph/cache.d.ts.map +1 -1
  157. package/dist/graph/cache.js +38 -10
  158. package/dist/graph/cache.js.map +1 -1
  159. package/dist/graph/graphSnapshotCache.d.ts +64 -0
  160. package/dist/graph/graphSnapshotCache.d.ts.map +1 -0
  161. package/dist/graph/graphSnapshotCache.js +254 -0
  162. package/dist/graph/graphSnapshotCache.js.map +1 -0
  163. package/dist/graph/metrics.d.ts.map +1 -1
  164. package/dist/graph/metrics.js +2 -1
  165. package/dist/graph/metrics.js.map +1 -1
  166. package/dist/graph/minHeap.d.ts +9 -0
  167. package/dist/graph/minHeap.d.ts.map +1 -1
  168. package/dist/graph/minHeap.js +29 -0
  169. package/dist/graph/minHeap.js.map +1 -1
  170. package/dist/graph/overview.d.ts.map +1 -1
  171. package/dist/graph/overview.js +8 -12
  172. package/dist/graph/overview.js.map +1 -1
  173. package/dist/graph/slice/beam-search-engine.d.ts +10 -0
  174. package/dist/graph/slice/beam-search-engine.d.ts.map +1 -1
  175. package/dist/graph/slice/beam-search-engine.js +134 -18
  176. package/dist/graph/slice/beam-search-engine.js.map +1 -1
  177. package/dist/graph/slice/truncation-handler.d.ts +1 -1
  178. package/dist/graph/slice/truncation-handler.d.ts.map +1 -1
  179. package/dist/graph/slice/truncation-handler.js +2 -2
  180. package/dist/graph/slice/truncation-handler.js.map +1 -1
  181. package/dist/graph/slice.d.ts.map +1 -1
  182. package/dist/graph/slice.js +48 -46
  183. package/dist/graph/slice.js.map +1 -1
  184. package/dist/graph/sliceCache.d.ts.map +1 -1
  185. package/dist/graph/sliceCache.js +9 -13
  186. package/dist/graph/sliceCache.js.map +1 -1
  187. package/dist/indexer/adapter/cpp.d.ts +2 -1
  188. package/dist/indexer/adapter/cpp.d.ts.map +1 -1
  189. package/dist/indexer/adapter/cpp.js +62 -1
  190. package/dist/indexer/adapter/cpp.js.map +1 -1
  191. package/dist/indexer/adapter/csharp.d.ts +2 -1
  192. package/dist/indexer/adapter/csharp.d.ts.map +1 -1
  193. package/dist/indexer/adapter/csharp.js +47 -1
  194. package/dist/indexer/adapter/csharp.js.map +1 -1
  195. package/dist/indexer/adapter/kotlin.d.ts +2 -1
  196. package/dist/indexer/adapter/kotlin.d.ts.map +1 -1
  197. package/dist/indexer/adapter/kotlin.js +43 -0
  198. package/dist/indexer/adapter/kotlin.js.map +1 -1
  199. package/dist/indexer/adapter/php.d.ts +2 -1
  200. package/dist/indexer/adapter/php.d.ts.map +1 -1
  201. package/dist/indexer/adapter/php.js +78 -4
  202. package/dist/indexer/adapter/php.js.map +1 -1
  203. package/dist/indexer/adapter/plugin/types.d.ts +1 -1
  204. package/dist/indexer/adapter/plugin/types.d.ts.map +1 -1
  205. package/dist/indexer/adapter/plugin/types.js.map +1 -1
  206. package/dist/indexer/adapter/rust.d.ts +2 -1
  207. package/dist/indexer/adapter/rust.d.ts.map +1 -1
  208. package/dist/indexer/adapter/rust.js +57 -0
  209. package/dist/indexer/adapter/rust.js.map +1 -1
  210. package/dist/indexer/ann-index.d.ts +1 -0
  211. package/dist/indexer/ann-index.d.ts.map +1 -1
  212. package/dist/indexer/ann-index.js +7 -2
  213. package/dist/indexer/ann-index.js.map +1 -1
  214. package/dist/indexer/configEdges.d.ts +1 -0
  215. package/dist/indexer/configEdges.d.ts.map +1 -1
  216. package/dist/indexer/configEdges.js +12 -0
  217. package/dist/indexer/configEdges.js.map +1 -1
  218. package/dist/indexer/edge-builder/cleanup.js +3 -2
  219. package/dist/indexer/edge-builder/cleanup.js.map +1 -1
  220. package/dist/indexer/edge-builder/pass2.d.ts.map +1 -1
  221. package/dist/indexer/edge-builder/pass2.js +9 -4
  222. package/dist/indexer/edge-builder/pass2.js.map +1 -1
  223. package/dist/indexer/embeddings-local.d.ts +21 -0
  224. package/dist/indexer/embeddings-local.d.ts.map +1 -1
  225. package/dist/indexer/embeddings-local.js +188 -4
  226. package/dist/indexer/embeddings-local.js.map +1 -1
  227. package/dist/indexer/embeddings.d.ts +4 -1
  228. package/dist/indexer/embeddings.d.ts.map +1 -1
  229. package/dist/indexer/embeddings.js +218 -17
  230. package/dist/indexer/embeddings.js.map +1 -1
  231. package/dist/indexer/fingerprints.d.ts +2 -0
  232. package/dist/indexer/fingerprints.d.ts.map +1 -1
  233. package/dist/indexer/fingerprints.js +10 -6
  234. package/dist/indexer/fingerprints.js.map +1 -1
  235. package/dist/indexer/import-resolution/c-include-adapter.d.ts +7 -0
  236. package/dist/indexer/import-resolution/c-include-adapter.d.ts.map +1 -0
  237. package/dist/indexer/import-resolution/c-include-adapter.js +47 -0
  238. package/dist/indexer/import-resolution/c-include-adapter.js.map +1 -0
  239. package/dist/indexer/import-resolution/csharp-adapter.d.ts +7 -0
  240. package/dist/indexer/import-resolution/csharp-adapter.d.ts.map +1 -0
  241. package/dist/indexer/import-resolution/csharp-adapter.js +47 -0
  242. package/dist/indexer/import-resolution/csharp-adapter.js.map +1 -0
  243. package/dist/indexer/import-resolution/python-adapter.d.ts +7 -0
  244. package/dist/indexer/import-resolution/python-adapter.d.ts.map +1 -0
  245. package/dist/indexer/import-resolution/python-adapter.js +58 -0
  246. package/dist/indexer/import-resolution/python-adapter.js.map +1 -0
  247. package/dist/indexer/import-resolution/registry.d.ts.map +1 -1
  248. package/dist/indexer/import-resolution/registry.js +8 -0
  249. package/dist/indexer/import-resolution/registry.js.map +1 -1
  250. package/dist/indexer/import-resolution/shell-adapter.d.ts +7 -0
  251. package/dist/indexer/import-resolution/shell-adapter.d.ts.map +1 -0
  252. package/dist/indexer/import-resolution/shell-adapter.js +35 -0
  253. package/dist/indexer/import-resolution/shell-adapter.js.map +1 -0
  254. package/dist/indexer/indexer.d.ts.map +1 -1
  255. package/dist/indexer/indexer.js +18 -6
  256. package/dist/indexer/indexer.js.map +1 -1
  257. package/dist/indexer/metrics-updater.d.ts.map +1 -1
  258. package/dist/indexer/metrics-updater.js +31 -12
  259. package/dist/indexer/metrics-updater.js.map +1 -1
  260. package/dist/indexer/model-downloader.d.ts +8 -0
  261. package/dist/indexer/model-downloader.d.ts.map +1 -0
  262. package/dist/indexer/model-downloader.js +69 -0
  263. package/dist/indexer/model-downloader.js.map +1 -0
  264. package/dist/indexer/model-registry.d.ts +54 -0
  265. package/dist/indexer/model-registry.d.ts.map +1 -0
  266. package/dist/indexer/model-registry.js +124 -0
  267. package/dist/indexer/model-registry.js.map +1 -0
  268. package/dist/indexer/parser/helpers.d.ts +32 -1
  269. package/dist/indexer/parser/helpers.d.ts.map +1 -1
  270. package/dist/indexer/parser/helpers.js +54 -0
  271. package/dist/indexer/parser/helpers.js.map +1 -1
  272. package/dist/indexer/parser/process-file.d.ts.map +1 -1
  273. package/dist/indexer/parser/process-file.js +39 -52
  274. package/dist/indexer/parser/process-file.js.map +1 -1
  275. package/dist/indexer/parser/rust-process-file.js.map +1 -1
  276. package/dist/indexer/pass2/registry.d.ts.map +1 -1
  277. package/dist/indexer/pass2/registry.js +18 -0
  278. package/dist/indexer/pass2/registry.js.map +1 -1
  279. package/dist/indexer/pass2/resolvers/c-pass2-resolver.d.ts +7 -0
  280. package/dist/indexer/pass2/resolvers/c-pass2-resolver.d.ts.map +1 -0
  281. package/dist/indexer/pass2/resolvers/c-pass2-resolver.js +556 -0
  282. package/dist/indexer/pass2/resolvers/c-pass2-resolver.js.map +1 -0
  283. package/dist/indexer/pass2/resolvers/cpp-pass2-resolver.d.ts +67 -0
  284. package/dist/indexer/pass2/resolvers/cpp-pass2-resolver.d.ts.map +1 -0
  285. package/dist/indexer/pass2/resolvers/cpp-pass2-resolver.js +744 -0
  286. package/dist/indexer/pass2/resolvers/cpp-pass2-resolver.js.map +1 -0
  287. package/dist/indexer/pass2/resolvers/csharp-pass2-resolver.d.ts +7 -0
  288. package/dist/indexer/pass2/resolvers/csharp-pass2-resolver.d.ts.map +1 -0
  289. package/dist/indexer/pass2/resolvers/csharp-pass2-resolver.js +752 -0
  290. package/dist/indexer/pass2/resolvers/csharp-pass2-resolver.js.map +1 -0
  291. package/dist/indexer/pass2/resolvers/java-pass2-resolver.d.ts +7 -0
  292. package/dist/indexer/pass2/resolvers/java-pass2-resolver.d.ts.map +1 -0
  293. package/dist/indexer/pass2/resolvers/java-pass2-resolver.js +687 -0
  294. package/dist/indexer/pass2/resolvers/java-pass2-resolver.js.map +1 -0
  295. package/dist/indexer/pass2/resolvers/kotlin-pass2-resolver.d.ts +7 -0
  296. package/dist/indexer/pass2/resolvers/kotlin-pass2-resolver.d.ts.map +1 -0
  297. package/dist/indexer/pass2/resolvers/kotlin-pass2-resolver.js +622 -0
  298. package/dist/indexer/pass2/resolvers/kotlin-pass2-resolver.js.map +1 -0
  299. package/dist/indexer/pass2/resolvers/php-pass2-resolver.d.ts +7 -0
  300. package/dist/indexer/pass2/resolvers/php-pass2-resolver.d.ts.map +1 -0
  301. package/dist/indexer/pass2/resolvers/php-pass2-resolver.js +825 -0
  302. package/dist/indexer/pass2/resolvers/php-pass2-resolver.js.map +1 -0
  303. package/dist/indexer/pass2/resolvers/python-pass2-resolver.d.ts +7 -0
  304. package/dist/indexer/pass2/resolvers/python-pass2-resolver.d.ts.map +1 -0
  305. package/dist/indexer/pass2/resolvers/python-pass2-resolver.js +663 -0
  306. package/dist/indexer/pass2/resolvers/python-pass2-resolver.js.map +1 -0
  307. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.d.ts +78 -0
  308. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.d.ts.map +1 -0
  309. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.js +625 -0
  310. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.js.map +1 -0
  311. package/dist/indexer/pass2/resolvers/shell-pass2-resolver.d.ts +7 -0
  312. package/dist/indexer/pass2/resolvers/shell-pass2-resolver.d.ts.map +1 -0
  313. package/dist/indexer/pass2/resolvers/shell-pass2-resolver.js +411 -0
  314. package/dist/indexer/pass2/resolvers/shell-pass2-resolver.js.map +1 -0
  315. package/dist/indexer/rustIndexer.d.ts +3 -0
  316. package/dist/indexer/rustIndexer.d.ts.map +1 -1
  317. package/dist/indexer/rustIndexer.js +118 -42
  318. package/dist/indexer/rustIndexer.js.map +1 -1
  319. package/dist/indexer/scanner.d.ts.map +1 -1
  320. package/dist/indexer/scanner.js +4 -2
  321. package/dist/indexer/scanner.js.map +1 -1
  322. package/dist/indexer/summary-generator.d.ts +2 -1
  323. package/dist/indexer/summary-generator.d.ts.map +1 -1
  324. package/dist/indexer/summary-generator.js +100 -11
  325. package/dist/indexer/summary-generator.js.map +1 -1
  326. package/dist/indexer/treesitter/extractCalls.d.ts.map +1 -1
  327. package/dist/indexer/treesitter/extractCalls.js +14 -10
  328. package/dist/indexer/treesitter/extractCalls.js.map +1 -1
  329. package/dist/indexer/treesitter/extractSymbols.d.ts.map +1 -1
  330. package/dist/indexer/treesitter/extractSymbols.js +7 -11
  331. package/dist/indexer/treesitter/extractSymbols.js.map +1 -1
  332. package/dist/indexer/watcher.d.ts.map +1 -1
  333. package/dist/indexer/watcher.js +12 -3
  334. package/dist/indexer/watcher.js.map +1 -1
  335. package/dist/indexer/workerPool.d.ts.map +1 -1
  336. package/dist/indexer/workerPool.js +5 -0
  337. package/dist/indexer/workerPool.js.map +1 -1
  338. package/dist/live-index/coordinator.d.ts +1 -0
  339. package/dist/live-index/coordinator.d.ts.map +1 -1
  340. package/dist/live-index/coordinator.js +6 -0
  341. package/dist/live-index/coordinator.js.map +1 -1
  342. package/dist/live-index/draft-parser.d.ts.map +1 -1
  343. package/dist/live-index/draft-parser.js +14 -6
  344. package/dist/live-index/draft-parser.js.map +1 -1
  345. package/dist/main.js +1 -2
  346. package/dist/main.js.map +1 -1
  347. package/dist/mcp/errors.d.ts +6 -5
  348. package/dist/mcp/errors.d.ts.map +1 -1
  349. package/dist/mcp/errors.js +14 -7
  350. package/dist/mcp/errors.js.map +1 -1
  351. package/dist/mcp/health.d.ts.map +1 -1
  352. package/dist/mcp/health.js +4 -9
  353. package/dist/mcp/health.js.map +1 -1
  354. package/dist/mcp/resources.d.ts.map +1 -1
  355. package/dist/mcp/resources.js +5 -12
  356. package/dist/mcp/resources.js.map +1 -1
  357. package/dist/mcp/session-manager.d.ts.map +1 -1
  358. package/dist/mcp/session-manager.js +3 -2
  359. package/dist/mcp/session-manager.js.map +1 -1
  360. package/dist/mcp/summary.d.ts.map +1 -1
  361. package/dist/mcp/summary.js +4 -5
  362. package/dist/mcp/summary.js.map +1 -1
  363. package/dist/mcp/telemetry.d.ts +18 -0
  364. package/dist/mcp/telemetry.d.ts.map +1 -1
  365. package/dist/mcp/telemetry.js +44 -8
  366. package/dist/mcp/telemetry.js.map +1 -1
  367. package/dist/mcp/tools/agent-feedback.d.ts.map +1 -1
  368. package/dist/mcp/tools/agent-feedback.js +4 -3
  369. package/dist/mcp/tools/agent-feedback.js.map +1 -1
  370. package/dist/mcp/tools/agent.d.ts +12 -12
  371. package/dist/mcp/tools/code.d.ts.map +1 -1
  372. package/dist/mcp/tools/code.js +46 -23
  373. package/dist/mcp/tools/code.js.map +1 -1
  374. package/dist/mcp/tools/delta.d.ts.map +1 -1
  375. package/dist/mcp/tools/delta.js +3 -2
  376. package/dist/mcp/tools/delta.js.map +1 -1
  377. package/dist/mcp/tools/index.d.ts +4 -1
  378. package/dist/mcp/tools/index.d.ts.map +1 -1
  379. package/dist/mcp/tools/index.js +14 -2
  380. package/dist/mcp/tools/index.js.map +1 -1
  381. package/dist/mcp/tools/policy.d.ts.map +1 -1
  382. package/dist/mcp/tools/policy.js +3 -22
  383. package/dist/mcp/tools/policy.js.map +1 -1
  384. package/dist/mcp/tools/prRisk.d.ts.map +1 -1
  385. package/dist/mcp/tools/prRisk.js +11 -9
  386. package/dist/mcp/tools/prRisk.js.map +1 -1
  387. package/dist/mcp/tools/repo.d.ts.map +1 -1
  388. package/dist/mcp/tools/repo.js +3 -0
  389. package/dist/mcp/tools/repo.js.map +1 -1
  390. package/dist/mcp/tools/runtime.d.ts +10 -0
  391. package/dist/mcp/tools/runtime.d.ts.map +1 -0
  392. package/dist/mcp/tools/runtime.js +300 -0
  393. package/dist/mcp/tools/runtime.js.map +1 -0
  394. package/dist/mcp/tools/slice-wire-format.d.ts +14 -0
  395. package/dist/mcp/tools/slice-wire-format.d.ts.map +1 -0
  396. package/dist/mcp/tools/slice-wire-format.js +482 -0
  397. package/dist/mcp/tools/slice-wire-format.js.map +1 -0
  398. package/dist/mcp/tools/slice.d.ts +2 -10
  399. package/dist/mcp/tools/slice.d.ts.map +1 -1
  400. package/dist/mcp/tools/slice.js +33 -549
  401. package/dist/mcp/tools/slice.js.map +1 -1
  402. package/dist/mcp/tools/symbol.d.ts.map +1 -1
  403. package/dist/mcp/tools/symbol.js +143 -28
  404. package/dist/mcp/tools/symbol.js.map +1 -1
  405. package/dist/mcp/tools.d.ts +206 -55
  406. package/dist/mcp/tools.d.ts.map +1 -1
  407. package/dist/mcp/tools.js +135 -37
  408. package/dist/mcp/tools.js.map +1 -1
  409. package/dist/policy/engine.d.ts +9 -2
  410. package/dist/policy/engine.d.ts.map +1 -1
  411. package/dist/policy/engine.js +205 -0
  412. package/dist/policy/engine.js.map +1 -1
  413. package/dist/policy/types.d.ts +35 -8
  414. package/dist/policy/types.d.ts.map +1 -1
  415. package/dist/policy/types.js +1 -1
  416. package/dist/policy/types.js.map +1 -1
  417. package/dist/runtime/artifacts.d.ts +28 -0
  418. package/dist/runtime/artifacts.d.ts.map +1 -0
  419. package/dist/runtime/artifacts.js +216 -0
  420. package/dist/runtime/artifacts.js.map +1 -0
  421. package/dist/runtime/executor.d.ts +9 -0
  422. package/dist/runtime/executor.d.ts.map +1 -0
  423. package/dist/runtime/executor.js +230 -0
  424. package/dist/runtime/executor.js.map +1 -0
  425. package/dist/runtime/runtimes.d.ts +26 -0
  426. package/dist/runtime/runtimes.d.ts.map +1 -0
  427. package/dist/runtime/runtimes.js +269 -0
  428. package/dist/runtime/runtimes.js.map +1 -0
  429. package/dist/runtime/types.d.ts +109 -0
  430. package/dist/runtime/types.d.ts.map +1 -0
  431. package/dist/runtime/types.js +8 -0
  432. package/dist/runtime/types.js.map +1 -0
  433. package/dist/server.d.ts +18 -1
  434. package/dist/server.d.ts.map +1 -1
  435. package/dist/server.js +43 -12
  436. package/dist/server.js.map +1 -1
  437. package/dist/sync/pull.d.ts.map +1 -1
  438. package/dist/sync/pull.js +5 -4
  439. package/dist/sync/pull.js.map +1 -1
  440. package/dist/sync/sync.js +1 -1
  441. package/dist/sync/sync.js.map +1 -1
  442. package/dist/ts/diagnostics.d.ts.map +1 -1
  443. package/dist/ts/diagnostics.js +1 -1
  444. package/dist/ts/diagnostics.js.map +1 -1
  445. package/dist/util/hashing.d.ts.map +1 -1
  446. package/dist/util/hashing.js +3 -2
  447. package/dist/util/hashing.js.map +1 -1
  448. package/dist/util/logger.d.ts.map +1 -1
  449. package/dist/util/logger.js +9 -2
  450. package/dist/util/logger.js.map +1 -1
  451. package/dist/util/safeJson.d.ts +6 -0
  452. package/dist/util/safeJson.d.ts.map +1 -1
  453. package/dist/util/safeJson.js +6 -0
  454. package/dist/util/safeJson.js.map +1 -1
  455. package/dist/util/safeRegex.d.ts.map +1 -1
  456. package/dist/util/safeRegex.js +24 -0
  457. package/dist/util/safeRegex.js.map +1 -1
  458. package/package.json +9 -6
package/README.md CHANGED
@@ -1,267 +1,492 @@
1
1
  <div align="center">
2
2
  <img src="https://github.com/GlitterKill/sdl-mcp/blob/main/docs/Symbol_Delta_Ledger_MCP.jpg" alt="Symbol Delta Ledger MCP">
3
- </div>
4
- <div align="center">
5
- </div>
3
+
4
+ <br/>
6
5
 
7
6
  # SDL-MCP
8
7
 
9
- ![npm version](https://img.shields.io/npm/v/sdl-mcp.svg) ![npm downloads](https://img.shields.io/npm/dm/sdl-mcp.svg) ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/GlitterKill/sdl-mcp/ci.yml?label=CI%20Builds)
10
- ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/GlitterKill/sdl-mcp/publish-native.yml?label=Rust%20Indexer%20Builds) ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/GlitterKill/sdl-mcp)
8
+ ### **Cards-first code context for AI coding agents**
11
9
 
12
- <div align="right">
13
- <details>
14
- <summary><strong>Documentation</strong></summary>
10
+ *Stop feeding entire files into the context window.<br/>Start giving agents exactly the code intelligence they need.*
15
11
 
16
- - [Overview (this page)](./README.md)
17
- - [Documentation Hub](./docs/README.md)
18
- - [Getting Started](./docs/getting-started.md)
19
- - [CLI Reference](./docs/cli-reference.md)
20
- - [MCP Tools Reference](./docs/mcp-tools-reference.md)
21
- - [Configuration Reference](./docs/configuration-reference.md)
22
- - [Agent Workflows](./docs/agent-workflows.md)
23
- - [Troubleshooting](./docs/troubleshooting.md)
24
- - [Legacy User Guide](./docs/USER_GUIDE.md)
12
+ <br/>
13
+
14
+ ![npm version](https://img.shields.io/npm/v/sdl-mcp.svg)
15
+ ![npm downloads](https://img.shields.io/npm/dm/sdl-mcp.svg)
16
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/GlitterKill/sdl-mcp/ci.yml?label=CI%20Builds)
17
+ ![GitHub Actions Workflow Status](https://img.shields.io/github/actions/workflow/status/GlitterKill/sdl-mcp/publish-native.yml?label=Rust%20Indexer%20Builds)
18
+ ![GitHub commit activity](https://img.shields.io/github/commit-activity/w/GlitterKill/sdl-mcp)
25
19
 
26
- </details>
27
20
  </div>
28
21
 
29
- ## Claude Opus 4.6 High Overview
22
+ ---
23
+
24
+ <br/>
25
+
26
+ ## What's the problem?
30
27
 
31
- Question: "Review the code for SDL-MCP and explain to potential new users what this MCP server does and the benefits of
32
- using it."
28
+ Every time an AI coding agent reads a file to answer a question, it consumes thousands of tokens. Most of those tokens are irrelevant to the task. The agent doesn't need 500 lines of a file to know that `validateToken` takes a `string` and returns a `Promise<User>` — but it reads them anyway, because that's all it has.
33
29
 
34
- Response: "# What is SDL-MCP?
30
+ **Multiply that across a debugging session touching 20 files and you've burned 40,000+ tokens on context gathering alone.**
35
31
 
36
- **SDL-MCP** (Symbol Delta Ledger - Model Context Protocol) is an MCP server that gives AI coding agents a structured,
37
- token-efficient way to understand your codebase. Instead of feeding entire files into the context window, SDL-MCP
38
- indexes your repository into a **searchable knowledge graph** of symbols and their relationships, then serves exactly
39
- the right amount of context through a controlled escalation path.
32
+ SDL-MCP fixes this. It indexes your codebase into a searchable **symbol graph** and serves precisely the right amount of context through a controlled escalation path. An agent that uses SDL-MCP understands your code better while consuming a fraction of the tokens.
40
33
 
41
- It ships as an npm package (`npm install -g sdl-mcp`) with a CLI for setup and a server that any MCP-compatible client
42
- (Claude Code, Claude Desktop, etc.) can connect to.
34
+ <br/>
43
35
 
44
36
  ---
45
37
 
46
- ## The Problem It Solves
38
+ <br/>
47
39
 
48
- When AI assistants work with code, they typically read whole files often many of them — to gather enough context.
49
- This has three costs:
40
+ ## How it worksin 30 seconds
50
41
 
51
- 1. **Context windows fill up fast.** A modest codebase can exceed token limits quickly.
52
- 2. **Irrelevant code dilutes focus.** Tokens are spent on code unrelated to the task.
53
- 3. **No incremental understanding.** Every interaction starts fresh with no memory of what was already analyzed.
42
+ ```
43
+ Your Codebase
44
+
45
+ ┌──────┴──────┐
46
+ │ Indexer │ Native Rust (fast) or Tree-sitter (universal)
47
+ │ 12 langs │ TS · JS · Python · Go · Java · C# · C · C++ · PHP · Rust · Kotlin · Shell
48
+ └──────┬──────┘
49
+
50
+
51
+ ┌───────────────────────┐
52
+ │ Symbol Graph (DB) │ Functions, classes, interfaces, types, edges, metrics
53
+ │ LadybugDB (graph) │ Persisted. Incremental. Versioned.
54
+ └───────────┬───────────┘
55
+
56
+ ┌──────────┼──────────┐
57
+ │ │ │
58
+ ▼ ▼ ▼
59
+ 25 MCP 10 CLI HTTP API
60
+ Tools Commands + Graph UI
61
+
62
+
63
+ AI Coding Agent
64
+ (Claude Code, Claude Desktop, Cursor, Windsurf, any MCP client)
65
+ ```
54
66
 
55
- SDL-MCP addresses all three by maintaining a **persistent, indexed graph** of your codebase and controlling context
56
- retrieval through the **Iris Gate Ladder**.
67
+ 1. **Index once** — SDL-MCP parses every symbol in your repo and stores it as a compact metadata record (a "Symbol Card") in a graph database
68
+ 2. **Query efficiently** — Agents use MCP tools to search, slice, and retrieve exactly the context they need
69
+ 3. **Escalate only when necessary** — A four-rung ladder controls how much code the agent sees, from a 100-token card to full source (with justification required)
70
+
71
+ <br/>
57
72
 
58
73
  ---
59
74
 
60
- ## How It Works
75
+ <br/>
61
76
 
62
- ### 1. Repository Indexing
77
+ ## Quick Start
63
78
 
64
- SDL-MCP parses your codebase using either a **native Rust indexer** (default, fast, multi-threaded) or a **tree-sitter
65
- TypeScript fallback**, and extracts every function, class, interface, type, and variable into **Symbol Cards** —
66
- compact metadata records containing signatures, summaries, dependency edges, and metrics like fan-in/out.
79
+ ```bash
80
+ # Install
81
+ npm install -g sdl-mcp
67
82
 
68
- **12 languages supported:** TypeScript, JavaScript, Python, Go, Java, C#, C, C++, PHP, Rust, Kotlin, and Shell.
83
+ # Initialize, auto-detect languages, index your repo, and run health checks
84
+ sdl-mcp init -y --auto-index
69
85
 
70
- Indexing happens once and is persisted in a **LadybugDB embedded graph database**. Incremental re-indexing picks up only
71
- what changed.
86
+ # Start the MCP server for your coding agent
87
+ sdl-mcp serve --stdio
88
+ ```
89
+
90
+ Point your MCP client at the server and the agent gains access to all SDL-MCP tools. That's it.
72
91
 
73
- ### 2. The Iris Gate Ladder (4 Rungs)
92
+ > **npx users:** Replace `sdl-mcp` with `npx --yes sdl-mcp@latest` in all commands above.
74
93
 
75
- Context is served in escalating detail — agents start small and only request more when needed:
94
+ [Full Getting Started Guide →](./docs/getting-started.md)
76
95
 
77
- | Rung | Tool | ~Tokens | What It Provides |
78
- | :---------------------- | :--------------------- | :---------- | :---------------------------------------------- |
79
- | **1. Symbol Cards** | `sdl.symbol.getCard` | 50–150 | Name, signature, summary, dependencies, metrics |
80
- | **2. Skeleton IR** | `sdl.code.getSkeleton` | 200–400 | Signatures + control flow, bodies elided |
81
- | **3. Hot-Path Excerpt** | `sdl.code.getHotPath` | 400–800 | Lines matching specific identifiers + context |
82
- | **4. Raw Code Window** | `sdl.code.needWindow` | 1,000–4,000 | Full source code (policy-gated, requires |
83
- | justification) |
96
+ <br/>
97
+
98
+ ---
84
99
 
85
- > [!TIP]
86
- > Most questions are answered at rungs 1–2 without ever reading raw code.
100
+ <br/>
87
101
 
88
- ### 3. Graph Slices
102
+ ## The Iris Gate Ladder
89
103
 
90
- When the agent needs broader context for a task, `sdl.slice.build` performs a **BFS/beam search** from entry symbols
91
- across weighted dependency edges (call > config > import), bounded by a token budget. The result is the 20–30 most
92
- relevant symbols for the task — not an arbitrary directory listing.
104
+ The core innovation. Named after the adjustable aperture that controls light flow in optics, the Iris Gate Ladder lets agents dial their context "aperture" from a pinhole to wide-open.
105
+
106
+ ```
107
+ Token Cost What the Agent Sees
108
+ ────────────────────────────────────────────────
109
+ ~100 RUNG 1 ▸ Symbol Card
110
+ Name, signature, summary, dependencies, metrics
111
+ "What does this function do and what does it call?"
112
+
113
+ ~300 RUNG 2 ▸ Skeleton IR
114
+ Signatures + control flow, bodies replaced with /* ... */
115
+ "What's the shape of this class?"
116
+
117
+ ~600 RUNG 3 ▸ Hot-Path Excerpt
118
+ Only lines matching specific identifiers + context
119
+ "Where exactly is `this.cache` initialized?"
120
+
121
+ ~2,000 RUNG 4 ▸ Raw Code Window Policy-gated
122
+ Full source code, requires justification
123
+ "I need to rewrite this error handler"
124
+ ```
93
125
 
94
- ### 4. Delta Packs & Blast Radius
126
+ > **Most questions are answered at Rungs 1-2** without ever reading raw code. That's where the token savings come from.
95
127
 
96
- When code changes, SDL-MCP computes **semantic diffs at the symbol level** not line-level diffs, but changes to
97
- signatures, invariants, and side effects. It also computes a **blast radius**: which other symbols are affected,
98
- ranked by proximity, fan-in, and test coverage.
128
+ | Scenario | Reading the file | Using the Ladder | Savings |
129
+ |:---------|:----------------:|:----------------:|:-------:|
130
+ | "What does `parseConfig` accept?" | ~2,000 tok | ~100 tok | **20x** |
131
+ | "Show me the shape of `AuthService`" | ~4,000 tok | ~300 tok | **13x** |
132
+ | "Where is `this.cache` set?" | ~2,000 tok | ~500 tok | **4x** |
99
133
 
100
- ### 5. Proof-of-Need Gating
134
+ [Iris Gate Ladder Deep Dive →](./docs/feature-deep-dives/iris-gate-ladder.md)
101
135
 
102
- Raw code access (rung 4) requires the agent to justify _why_ it needs the code, _what identifiers_ it expects to find,
103
- and _how many lines_. Requests are audited. This enforces disciplined token usage.
136
+ <br/>
104
137
 
105
138
  ---
106
139
 
107
- ## Key Benefits
140
+ <br/>
108
141
 
109
- ### Token Efficiency
142
+ ## Feature Tour
110
143
 
111
- - **10–50x fewer tokens** per coding task compared to reading raw files
112
- - **2,782x compression ratio** for a repository overview vs. a full card dump
144
+ ### Symbol Cards The Atoms of Understanding
113
145
 
114
- ### Better Relevance
146
+ Every function, class, interface, type, and variable becomes a **Symbol Card**: a compact metadata record (~100 tokens) containing everything an agent needs to *understand* a symbol without reading its code.
115
147
 
116
- - Graph-based slicing finds related code that directory-based approaches miss
117
- - Confidence-scored call resolution filters noise from low-confidence edges
148
+ ```
149
+ ┌─────────────────────────────────────────────────────────┐
150
+ │ Symbol Card: validateToken │
151
+ │─────────────────────────────────────────────────────────│
152
+ │ Kind: function (exported) │
153
+ │ File: src/auth/jwt.ts:42-67 │
154
+ │ Signature: (token: string, opts?: ValidateOpts) │
155
+ │ → Promise<DecodedToken> │
156
+ │ Summary: Validates JWT signature and expiration, │
157
+ │ returns decoded payload or throws │
158
+ │ Invariants: ["throws on expired token"] │
159
+ │ Side FX: ["logs to audit trail"] │
160
+ │ Deps: calls: [verifySignature, checkExpiry] │
161
+ │ imports: [jsonwebtoken, AuditLogger] │
162
+ │ Metrics: fan-in: 12 │ fan-out: 4 │ churn: 3/30d │
163
+ │ Cluster: auth-module (8 members) │
164
+ │ Process: request-pipeline (intermediate, depth 1) │
165
+ │ Test: auth.test.ts (distance: 1, proximity: 0.9)│
166
+ │ ETag: a7f3c2... (for conditional requests) │
167
+ └─────────────────────────────────────────────────────────┘
168
+ ```
118
169
 
119
- ### Incremental Understanding
170
+ Cards include **confidence-scored call resolution** (the pass-2 resolver traces imports, aliases, barrel re-exports, and tagged templates to produce accurate dependency edges), **community detection** (cluster membership), and **call-chain tracing** (process participation with entry/intermediate/exit roles).
120
171
 
121
- - Delta packs mean the agent doesn't re-read unchanged code
122
- - Slice handles with leases and refresh support avoid rebuilding context from scratch
172
+ [Indexing & Language Support Deep Dive →](./docs/feature-deep-dives/indexing-languages.md)
173
+
174
+ ---
123
175
 
124
- ### Governance & Auditability
176
+ ### Graph Slicing — The Right Context for Every Task
125
177
 
126
- - Configurable policies control what agents can access
127
- - Every raw code request is logged with justification
128
- - Blast radius analysis shows ripple effects before changes land
178
+ Instead of reading files in the same directory, SDL-MCP follows the *dependency graph*. Starting from symbols relevant to your task, it traverses weighted edges (call: 1.0, config: 0.8, import: 0.6), scores each symbol by relevance, and returns the N most important within a token budget.
179
+
180
+ ```
181
+ "Fix the auth middleware" → slice.build
182
+
183
+ BFS over graph
184
+
185
+ ┌──────────────────┼──────────────────┐
186
+ ▼ ▼ ▼
187
+ authenticate validateToken JwtConfig
188
+ │ │ │
189
+ ▼ ▼ ▼
190
+ hashPassword getUserById envLoader
191
+
192
+ ◆ frontier
193
+ (outside budget)
194
+
195
+ 8 cards returned · ~800 tokens
196
+ vs. reading 8 files · ~16,000 tokens
197
+ ```
129
198
 
130
- ### Multi-Language
199
+ Slices have handles, leases, refresh (delta-only updates), and spillover (paged overflow). You can also skip the symbol search entirely — pass a `taskText` string and SDL-MCP auto-discovers the relevant entry symbols.
131
200
 
132
- - 12 language adapters with a generalized pass-2 resolver for cross-file semantic resolution
201
+ [Graph Slicing Deep Dive →](./docs/feature-deep-dives/graph-slicing.md)
133
202
 
134
203
  ---
135
204
 
136
- ## Feature Summary
205
+ ### Delta Packs & Blast Radius — Semantic Change Intelligence
137
206
 
138
- | Category | Features |
139
- | :------------------ | :-------------------------------------------------------------------------------------------------- |
140
- | **Indexing** | Native Rust + tree-sitter fallback, incremental indexing, live editor-buffer overlay, file watching |
141
- | **Context** | Symbol cards, skeleton IR, hot-path excerpts, gated raw windows |
142
- | **Graph** | Slices with handles/leases/refresh/spillover, cluster detection, call-chain tracing |
143
- | **Change Tracking** | Delta packs, blast radius analysis, PR risk scoring |
144
- | **Intelligence** | Semantic search reranking, LLM-generated summaries, predictive prefetch |
145
- | **Governance** | Policy engine, proof-of-need gating, audit logging |
146
- | **Agent Support** | `sdl.agent.orchestrate` autopilot, `sdl.context.summary` for copy/paste context |
147
- | **Tools** | 17+ MCP tools, 10 CLI commands, HTTP API with graph explorer UI |
148
- | **Integrations** | VSCode extension, Claude Code/Desktop, any MCP client |
207
+ `git diff` tells you what lines changed. SDL-MCP tells you what that change *means* and who's affected.
208
+
209
+ ```
210
+ Modified: validateToken() signature
211
+
212
+ ├── signatureDiff: added `options?: object` parameter
213
+ ├── invariantDiff: added "throws on expired"
214
+ └── sideEffectDiff: added "logs to audit trail"
215
+
216
+
217
+ Blast Radius (ranked):
218
+ 1. authenticate() ← direct caller, distance 1
219
+ 2. refreshSession() ← direct caller, distance 1
220
+ 3. AuthMiddleware ← calls authenticate, distance 2
221
+ 4. auth.test.ts ← test coverage, flagged for re-run
222
+ ```
223
+
224
+ **PR risk analysis** (`sdl.pr.risk.analyze`) wraps this into a scored assessment with findings, evidence, and test recommendations. **Fan-in trend analysis** detects "amplifier" symbols whose growing dependency count means changes ripple further over time.
225
+
226
+ [Delta & Blast Radius Deep Dive →](./docs/feature-deep-dives/delta-blast-radius.md)
227
+
228
+ ---
229
+
230
+ ### Live Indexing — Real-Time Code Intelligence
231
+
232
+ SDL-MCP doesn't wait for you to save. As you type in your editor, buffer updates are pushed to an in-memory overlay store, parsed in the background, and merged with the durable database. Search, cards, and slices reflect your *current* code, not your last save.
233
+
234
+ ```
235
+ Editor keystrokes → sdl.buffer.push → Overlay Store → merged reads
236
+
237
+ on save / idle
238
+
239
+
240
+ LadybugDB (durable)
241
+ ```
242
+
243
+ [Live Indexing Deep Dive →](./docs/feature-deep-dives/live-indexing.md)
244
+
245
+ ---
246
+
247
+ ### Governance & Policy — Controlled Access
248
+
249
+ Raw code access (Rung 4) is **policy-gated**. Agents must provide:
250
+ - A **reason** explaining why they need raw code
251
+ - **Identifiers** they expect to find in the code
252
+ - An **expected line count** within configured limits
253
+
254
+ Requests that don't meet policy are denied with actionable guidance ("try `getHotPath` with these identifiers instead"). Every access is audit-logged.
255
+
256
+ The sandboxed runtime execution tool (`sdl.runtime.execute`) has its own governance layer: disabled by default, executable allowlisting, CWD jailing, environment scrubbing, concurrency limits, and timeout enforcement.
257
+
258
+ [Governance & Policy Deep Dive →](./docs/feature-deep-dives/governance-policy.md)
259
+
260
+ ---
261
+
262
+ ### Agent Orchestration — Autopilot Mode
263
+
264
+ `sdl.agent.orchestrate` is an autonomous task engine. Give it a task type (`debug`, `review`, `implement`, `explain`), a description, and a budget — it plans the optimal Iris Gate path, executes it, collects evidence, and returns a synthesized answer.
265
+
266
+ The feedback loop (`sdl.agent.feedback`) records which symbols were useful and which were missing, improving future slice quality.
267
+
268
+ `sdl.context.summary` generates portable, token-bounded context briefings in markdown, JSON, or clipboard format for use outside MCP environments.
269
+
270
+ [Agent Orchestration Deep Dive →](./docs/feature-deep-dives/agent-orchestration.md)
149
271
 
150
272
  ---
151
273
 
152
- ## Getting Started
274
+ ### Sandboxed Runtime Execution
275
+
276
+ Run tests, linters, and scripts through SDL-MCP's governance layer instead of uncontrolled shell access. Three runtimes (Node.js, Python, Shell), code-mode or args-mode, smart output summarization with keyword-matched excerpts, and gzip artifact persistence.
277
+
278
+ [Runtime Execution Deep Dive →](./docs/feature-deep-dives/runtime-execution.md)
279
+
280
+ ---
281
+
282
+ ### CLI Tool Access — No MCP Server Required
283
+
284
+ Access all 25 tool actions directly from the command line with `sdl-mcp tool`. No MCP server, transport, or SDK — just your terminal.
153
285
 
154
286
  ```bash
155
- # Install globally
156
- npm install -g sdl-mcp
287
+ # Search for symbols
288
+ sdl-mcp tool symbol.search --query "handleAuth" --output-format pretty
157
289
 
158
- # Initialize config + index your repo
159
- sdl-mcp init -y --auto-index
290
+ # Build a task-scoped slice
291
+ sdl-mcp tool slice.build --task-text "debug auth flow" --max-cards 50
160
292
 
161
- # Start the MCP server
162
- sdl-mcp serve --stdio
293
+ # Pipe JSON args, chain commands
294
+ echo '{"repoId":"my-repo"}' | sdl-mcp tool symbol.search --query "auth"
295
+ ```
163
296
 
164
- Then point your MCP client at the server the agent gains access to all SDL-MCP tools and can navigate your codebase
165
- through the Iris Gate Ladder instead of bulk file reads.
297
+ Features include typed argument coercion (string, number, boolean, string[], json), budget flag merging, stdin JSON piping with CLI-flags-win precedence, auto-resolved `repoId` from cwd, four output formats (json, json-compact, pretty, table), typo suggestions, and per-action `--help`. The CLI dispatches through the same gateway router and Zod schemas as the MCP server — identical code paths, identical validation.
166
298
 
167
- [!NOTE]
168
- See the full ./docs/getting-started.md and ./docs/mcp-tools-reference.md for detailed setup and usage instructions.
299
+ [CLI Tool Access Deep Dive →](./docs/feature-deep-dives/cli-tool-access.md)
300
+
301
+ ---
169
302
 
303
+ ### Tool Gateway — 81% Token Reduction
304
+
305
+ The tool gateway consolidates all 25 MCP tools into **4 namespace-scoped tools** (`sdl.query`, `sdl.code`, `sdl.repo`, `sdl.agent`), reducing `tools/list` overhead from **~3,742 tokens to ~713 tokens** — an **81% reduction**.
306
+
307
+ ```
308
+ Before: 25 tools × full JSON Schema = ~3,742 tokens at conversation start
309
+ After: 4 tools × thin schema = ~713 tokens at conversation start
310
+ ─────────────
311
+ ~3,029 tokens saved per conversation
170
312
  ```
171
313
 
172
- ## Core Feature Set
173
-
174
- - Multi-language repository indexing with tree-sitter adapters
175
- - Native Rust pass-1 indexing engine by default (`indexing.engine: "rust"`, with TypeScript fallback)
176
- - Live editor-buffer indexing with draft-aware symbol/search/slice reads, save-time LadybugDB patching, background reconciliation, and automatic checkpoint compaction (`liveIndex.*`)
177
- - Symbol cards with signatures, deps, metrics, and versioning
178
- - Graph slices with handles, leases, refresh, and spillover
179
- - Graph enrichment: clusters (community detection) + processes (call-chain traces) surfaced in cards/slices/overview/blast radius
180
- - Generalized pass2 resolver registry with TypeScript/JavaScript semantic pass2 plus Go pass2, and confidence-scored call metadata available through `symbol.getCard` and `slice.build`
181
- - Delta analysis and blast radius support with amplifier scoring
182
- - Semantic symbol search reranking (`sdl.symbol.search` with `semantic: true`)
183
- - LLM-generated symbol summaries with configurable concurrency and batching (`semantic.summaryModel`, `summaryMaxConcurrency`, `summaryBatchSize`)
184
- - Code access ladder: `getSkeleton` -> `getHotPath` -> `needWindow`
185
- - Policy management (`sdl.policy.get` / `sdl.policy.set`)
186
- - Repository overview and hotspot inspection (`sdl.repo.overview`)
187
- - PR risk analysis (`sdl.pr.risk.analyze`)
188
- - Agent orchestration tool (`sdl.agent.orchestrate`)
189
- - Predictive prefetch heuristics with status metrics (`prefetchStats`)
190
- - File watch debouncing for efficient incremental indexing (`indexing.watchDebounceMs`)
191
- - Live overlay controls for editor-buffer parsing and idle checkpointing (`liveIndex.debounceMs`, `liveIndex.idleCheckpointMs`, `liveIndex.maxDraftFiles`)
192
- - Canonical test mapping in symbol cards (`metrics.canonicalTest`)
193
- - Graph HTTP surface and browser explorer (`/api/graph/*`, `/ui/graph`)
194
- - VSCode extension MVP in `sdl-mcp-vscode/`
195
- - Sync artifact export/import/pull workflows
314
+ Each gateway tool accepts an `action` discriminator field (e.g., `{ action: "symbol.search", repoId: "x", query: "auth" }`) and routes to the same handlers with double Zod validation. Thin wire schemas in `tools/list` keep the registration compact while full validation happens server-side. Legacy flat tool names are optionally emitted alongside for backward compatibility.
315
+
316
+ [Tool Gateway Deep Dive →](./docs/feature-deep-dives/tool-gateway.md)
317
+
318
+ <br/>
319
+
320
+ ---
321
+
322
+ <br/>
323
+
324
+ ## All 25 MCP Tools at a Glance
325
+
326
+ <table>
327
+ <tr><th>Category</th><th>Tool</th><th>One-Line Description</th></tr>
328
+ <tr><td rowspan="4"><strong>Repository</strong></td>
329
+ <td><code>sdl.repo.register</code></td><td>Register a codebase for indexing</td></tr>
330
+ <tr><td><code>sdl.repo.status</code></td><td>Health, versions, watcher, prefetch, live-index stats</td></tr>
331
+ <tr><td><code>sdl.repo.overview</code></td><td>Codebase summary: stats, directories, hotspots, clusters</td></tr>
332
+ <tr><td><code>sdl.index.refresh</code></td><td>Trigger full or incremental re-indexing</td></tr>
333
+
334
+ <tr><td rowspan="3"><strong>Live Buffer</strong></td>
335
+ <td><code>sdl.buffer.push</code></td><td>Push unsaved editor content for real-time indexing</td></tr>
336
+ <tr><td><code>sdl.buffer.checkpoint</code></td><td>Force-write pending buffers to the durable database</td></tr>
337
+ <tr><td><code>sdl.buffer.status</code></td><td>Live indexing diagnostics and queue depth</td></tr>
338
+
339
+ <tr><td rowspan="3"><strong>Symbols</strong></td>
340
+ <td><code>sdl.symbol.search</code></td><td>Search symbols by name (with optional semantic reranking)</td></tr>
341
+ <tr><td><code>sdl.symbol.getCard</code></td><td>Get a symbol card with ETag-based conditional support</td></tr>
342
+ <tr><td><code>sdl.symbol.getCards</code></td><td>Batch-fetch up to 100 cards in one round trip</td></tr>
343
+
344
+ <tr><td rowspan="3"><strong>Slices</strong></td>
345
+ <td><code>sdl.slice.build</code></td><td>Build a task-scoped dependency subgraph</td></tr>
346
+ <tr><td><code>sdl.slice.refresh</code></td><td>Delta-only update of an existing slice</td></tr>
347
+ <tr><td><code>sdl.slice.spillover.get</code></td><td>Page through overflow symbols beyond the budget</td></tr>
348
+
349
+ <tr><td rowspan="3"><strong>Code Access</strong></td>
350
+ <td><code>sdl.code.getSkeleton</code></td><td>Signatures + control flow, bodies elided</td></tr>
351
+ <tr><td><code>sdl.code.getHotPath</code></td><td>Lines matching specific identifiers + context</td></tr>
352
+ <tr><td><code>sdl.code.needWindow</code></td><td>Full source code (policy-gated, requires justification)</td></tr>
353
+
354
+ <tr><td><strong>Deltas</strong></td>
355
+ <td><code>sdl.delta.get</code></td><td>Semantic diff + blast radius between versions</td></tr>
356
+
357
+ <tr><td rowspan="2"><strong>Policy</strong></td>
358
+ <td><code>sdl.policy.get</code></td><td>Read current gating policy</td></tr>
359
+ <tr><td><code>sdl.policy.set</code></td><td>Update line/token limits and identifier requirements</td></tr>
360
+
361
+ <tr><td><strong>Risk</strong></td>
362
+ <td><code>sdl.pr.risk.analyze</code></td><td>Scored PR risk with findings and test recommendations</td></tr>
363
+
364
+ <tr><td><strong>Context</strong></td>
365
+ <td><code>sdl.context.summary</code></td><td>Token-bounded portable briefing (markdown/JSON/clipboard)</td></tr>
366
+
367
+ <tr><td rowspan="3"><strong>Agent</strong></td>
368
+ <td><code>sdl.agent.orchestrate</code></td><td>Autonomous task execution with budget control</td></tr>
369
+ <tr><td><code>sdl.agent.feedback</code></td><td>Record which symbols were useful or missing</td></tr>
370
+ <tr><td><code>sdl.agent.feedback.query</code></td><td>Query aggregated feedback statistics</td></tr>
371
+
372
+ <tr><td><strong>Runtime</strong></td>
373
+ <td><code>sdl.runtime.execute</code></td><td>Sandboxed subprocess execution (Node/Python/Shell)</td></tr>
374
+ </table>
375
+
376
+ [Complete MCP Tools Reference (detailed parameters & responses) →](./docs/mcp-tools-detailed.md)
377
+
378
+ <br/>
379
+
380
+ ---
381
+
382
+ <br/>
196
383
 
197
384
  ## CLI Commands
198
385
 
199
- - `init` - bootstrap config and optional client template
200
- - `doctor` - validate runtime, config, DB path, grammars, repo access, and call-resolution capabilities
201
- - `index` - index repositories (optionally watch)
202
- - `serve` - run MCP server (`--stdio` or `--http`)
203
- - `export` - export sync artifact
204
- - `import` - import sync artifact
205
- - `pull` - pull by version/commit with fallback behavior
206
- - `benchmark:ci` - run CI benchmark checks, including edge-accuracy regression gating
207
- - `summary` - generate token-bounded copy/paste context summaries
208
- - `health` - compute composite index health score and badge/json output
209
- - `version` - show version and environment info
210
-
211
- ## MCP Tools
212
-
213
- - Repository: `sdl.repo.register`, `sdl.repo.status`, `sdl.repo.overview`, `sdl.index.refresh`
214
- - Symbols: `sdl.symbol.search`, `sdl.symbol.getCard`
215
- - Context: `sdl.context.summary`
216
- - Slice: `sdl.slice.build`, `sdl.slice.refresh`, `sdl.slice.spillover.get`
217
- - Delta: `sdl.delta.get`
218
- - Code: `sdl.code.needWindow`, `sdl.code.getSkeleton`, `sdl.code.getHotPath`
219
- - Policy: `sdl.policy.get`, `sdl.policy.set`
220
- - Risk/Agent: `sdl.pr.risk.analyze`, `sdl.agent.orchestrate`
221
-
222
- See: [MCP Tools Reference](./docs/mcp-tools-reference.md)
386
+ | Command | Description |
387
+ |:--------|:------------|
388
+ | `sdl-mcp init` | Bootstrap config, detect repo/languages, optionally auto-index |
389
+ | `sdl-mcp doctor` | Validate runtime, config, DB, grammars, repo access |
390
+ | `sdl-mcp index` | Index repositories (with optional `--watch` mode) |
391
+ | `sdl-mcp serve` | Start MCP server (`--stdio` or `--http`) |
392
+ | `sdl-mcp tool` | Access all 25 MCP tool actions directly ([docs](./docs/feature-deep-dives/cli-tool-access.md)) |
393
+ | `sdl-mcp summary` | Generate copy/paste context summaries from the CLI |
394
+ | `sdl-mcp health` | Compute composite health score with badge/JSON output |
395
+ | `sdl-mcp export` | Export sync artifact |
396
+ | `sdl-mcp import` | Import sync artifact |
397
+ | `sdl-mcp pull` | Pull by version/commit with fallback |
398
+ | `sdl-mcp version` | Show version and environment info |
223
399
 
224
- ## Documentation
400
+ [CLI Reference →](./docs/cli-reference.md) · [Configuration Reference →](./docs/configuration-reference.md)
225
401
 
226
- - [Documentation Hub](./docs/README.md)
227
- - [Iris Gate Ladder](./docs/IRIS_GATE_LADDER.md) - Context escalation methodology
228
- - [Architecture](./docs/ARCHITECTURE.md) - Tech stack and data flow
229
- - [Getting Started](./docs/getting-started.md)
230
- - [CLI Reference](./docs/cli-reference.md)
231
- - [MCP Tools Reference](./docs/mcp-tools-reference.md)
232
- - [Configuration Reference](./docs/configuration-reference.md)
233
- - [Agent Workflows](./docs/agent-workflows.md)
234
- - [Troubleshooting](./docs/troubleshooting.md)
235
- - [VSCode Extension README](./sdl-mcp-vscode/README.md)
236
- - [Legacy User Guide](./docs/USER_GUIDE.md)
402
+ <br/>
237
403
 
238
- ## Development
404
+ ---
239
405
 
240
- ```bash
241
- npm run build
242
- npm run typecheck
243
- npm run lint
244
- npm test
245
- # Optional native addon + parity checks
246
- npm run build:native
247
- npm run test:native-parity
248
- ```
406
+ <br/>
407
+
408
+ ## Compatible With
409
+
410
+ SDL-MCP works with any MCP-compatible client:
249
411
 
250
- Benchmark tooling (npm scripts):
412
+ | Client | Transport | Setup |
413
+ |:-------|:----------|:------|
414
+ | **Claude Code** | stdio | `sdl-mcp init --client claude-code` |
415
+ | **Claude Desktop** | stdio | `sdl-mcp init --client claude-code` |
416
+ | **Cursor** | stdio | Standard MCP server config |
417
+ | **Windsurf** | stdio | Standard MCP server config |
418
+ | **Codex CLI** | stdio | `sdl-mcp init --client codex` |
419
+ | **Gemini CLI** | stdio | `sdl-mcp init --client gemini` |
420
+ | **OpenCode** | stdio | `sdl-mcp init --client opencode` |
421
+ | **Any MCP client** | stdio / http | `sdl-mcp serve --stdio` or `--http` |
251
422
 
252
- - `npm run benchmark:real`
253
- - `npm run benchmark:matrix`
254
- - `npm run benchmark:sweep`
423
+ A **VSCode extension** (`sdl-mcp-vscode/`) provides live buffer integration for real-time indexing of unsaved edits.
255
424
 
256
- Phase A benchmark lockfile:
425
+ <br/>
426
+
427
+ ---
428
+
429
+ <br/>
430
+
431
+ ## Tech Stack
432
+
433
+ | Component | Technology |
434
+ |:----------|:-----------|
435
+ | Runtime | Node.js 20+ / TypeScript 5.9+ (strict ESM) |
436
+ | Graph Database | LadybugDB (embedded, single-file) |
437
+ | Indexer (default) | Rust via napi-rs (multi-threaded) |
438
+ | Indexer (fallback) | tree-sitter + tree-sitter-typescript |
439
+ | MCP SDK | @modelcontextprotocol/sdk |
440
+ | Validation | Zod schemas for all payloads |
441
+ | Transports | stdio (agents) · HTTP (dev/network) |
442
+
443
+ <br/>
444
+
445
+ ---
446
+
447
+ <br/>
448
+
449
+ ## Documentation
450
+
451
+ | Document | Description |
452
+ |:---------|:------------|
453
+ | [Getting Started](./docs/getting-started.md) | Installation, 5-minute setup, MCP client config |
454
+ | [MCP Tools Reference](./docs/mcp-tools-detailed.md) | Detailed docs for all 25 tools (parameters, responses, examples) |
455
+ | [CLI Reference](./docs/cli-reference.md) | All CLI commands and options |
456
+ | [Configuration Reference](./docs/configuration-reference.md) | Every config option with defaults and guidance |
457
+ | [Agent Workflows](./docs/agent-workflows.md) | Workflow instructions for CLAUDE.md / AGENTS.md |
458
+ | [Architecture](./docs/ARCHITECTURE.md) | Tech stack, data flow, component diagram |
459
+ | [Iris Gate Ladder](./docs/IRIS_GATE_LADDER.md) | Context escalation methodology |
460
+ | [Troubleshooting](./docs/troubleshooting.md) | Common issues and fixes |
461
+
462
+ ### Feature Deep Dives
463
+
464
+ | Topic | What You'll Learn |
465
+ |:------|:------------------|
466
+ | [Iris Gate Ladder](./docs/feature-deep-dives/iris-gate-ladder.md) | Four-rung context escalation with token savings analysis |
467
+ | [Graph Slicing](./docs/feature-deep-dives/graph-slicing.md) | BFS/beam search, edge weights, wire formats, auto-discovery |
468
+ | [Delta & Blast Radius](./docs/feature-deep-dives/delta-blast-radius.md) | Semantic diffs, ranked impact analysis, PR risk scoring |
469
+ | [Live Indexing](./docs/feature-deep-dives/live-indexing.md) | Real-time editor buffer integration and overlay architecture |
470
+ | [Governance & Policy](./docs/feature-deep-dives/governance-policy.md) | Proof-of-need gating, audit logging, runtime sandboxing |
471
+ | [Agent Orchestration](./docs/feature-deep-dives/agent-orchestration.md) | Autopilot mode, feedback loops, portable context summaries |
472
+ | [Indexing & Languages](./docs/feature-deep-dives/indexing-languages.md) | Rust/TS engines, two-pass architecture, 12-language support |
473
+ | [Runtime Execution](./docs/feature-deep-dives/runtime-execution.md) | Sandboxed subprocess execution with governance |
474
+ | [CLI Tool Access](./docs/feature-deep-dives/cli-tool-access.md) | Direct CLI access to all 25 actions, output formats, stdin piping, scripting |
475
+ | [Tool Gateway](./docs/feature-deep-dives/tool-gateway.md) | 25→4 tool consolidation, 81% token reduction, thin schemas, migration guide |
476
+ | [Semantic Engine](./docs/feature-deep-dives/semantic-engine.md) | Pass-2 call resolution, embedding search, LLM summaries, confidence scoring |
477
+ | [Semantic Embeddings Setup](./docs/feature-deep-dives/semantic-embeddings-setup.md) | Dependencies, model installation, provider configuration, tier-by-tier setup |
478
+
479
+ <br/>
480
+
481
+ ---
257
482
 
258
- - `scripts/benchmark/phase-a-benchmark-lock.json` pins TS/Python/Tier-3 repos for reproducible baseline runs.
483
+ <br/>
259
484
 
260
485
  ## License
261
486
 
262
487
  This project is **source-available**.
263
488
 
264
489
  - **Free Use (Community License):** You may use, run, and modify this software for any purpose, including **internal business use**, under the terms in [`LICENSE`](./LICENSE).
265
- - **Commercial Distribution / Embedding:** You must obtain a **commercial license** _before_ you **sell, license, sublicense, bundle, embed, or distribute** this software (or a modified version) **as part of a for-sale or monetized product or offering**. See [`COMMERCIAL_LICENSE.md`](./COMMERCIAL_LICENSE.md).
490
+ - **Commercial Distribution / Embedding:** You must obtain a **commercial license** before you **sell, license, sublicense, bundle, embed, or distribute** this software as part of a for-sale or monetized product. See [`COMMERCIAL_LICENSE.md`](./COMMERCIAL_LICENSE.md).
266
491
 
267
- If you're unsure whether your use is "Commercial Distribution / Embedding", contact **gmullins.gkc@gmail.com**.
492
+ Questions? Contact **gmullins.gkc@gmail.com**.