sdl-mcp 0.10.1 → 0.10.3

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 (516) hide show
  1. package/README.md +134 -182
  2. package/config/sdlmcp.config.example.json +18 -16
  3. package/config/sdlmcp.config.schema.json +109 -80
  4. package/dist/.tsbuildinfo +1 -1
  5. package/dist/agent/context-engine.d.ts +58 -0
  6. package/dist/agent/context-engine.d.ts.map +1 -0
  7. package/dist/agent/context-engine.js +670 -0
  8. package/dist/agent/context-engine.js.map +1 -0
  9. package/dist/agent/context-ranking.d.ts +41 -0
  10. package/dist/agent/context-ranking.d.ts.map +1 -0
  11. package/dist/agent/context-ranking.js +432 -0
  12. package/dist/agent/context-ranking.js.map +1 -0
  13. package/dist/agent/context-seeding.d.ts +41 -0
  14. package/dist/agent/context-seeding.d.ts.map +1 -0
  15. package/dist/agent/context-seeding.js +302 -0
  16. package/dist/agent/context-seeding.js.map +1 -0
  17. package/dist/agent/executor.d.ts +23 -0
  18. package/dist/agent/executor.d.ts.map +1 -1
  19. package/dist/agent/executor.js +392 -74
  20. package/dist/agent/executor.js.map +1 -1
  21. package/dist/agent/index.d.ts +1 -1
  22. package/dist/agent/index.d.ts.map +1 -1
  23. package/dist/agent/index.js +1 -1
  24. package/dist/agent/index.js.map +1 -1
  25. package/dist/agent/planner.d.ts +15 -5
  26. package/dist/agent/planner.d.ts.map +1 -1
  27. package/dist/agent/planner.js +196 -37
  28. package/dist/agent/planner.js.map +1 -1
  29. package/dist/agent/types.d.ts +53 -1
  30. package/dist/agent/types.d.ts.map +1 -1
  31. package/dist/cli/commands/benchmark.js +2 -2
  32. package/dist/cli/commands/benchmark.js.map +1 -1
  33. package/dist/cli/commands/doctor.js +2 -2
  34. package/dist/cli/commands/doctor.js.map +1 -1
  35. package/dist/cli/commands/health.js +1 -1
  36. package/dist/cli/commands/health.js.map +1 -1
  37. package/dist/cli/commands/init.d.ts.map +1 -1
  38. package/dist/cli/commands/init.js +161 -29
  39. package/dist/cli/commands/init.js.map +1 -1
  40. package/dist/cli/commands/serve.d.ts.map +1 -1
  41. package/dist/cli/commands/serve.js +35 -1
  42. package/dist/cli/commands/serve.js.map +1 -1
  43. package/dist/cli/commands/tool-actions.d.ts.map +1 -1
  44. package/dist/cli/commands/tool-actions.js +67 -8
  45. package/dist/cli/commands/tool-actions.js.map +1 -1
  46. package/dist/cli/transport/http.d.ts +8 -2
  47. package/dist/cli/transport/http.d.ts.map +1 -1
  48. package/dist/cli/transport/http.js +108 -28
  49. package/dist/cli/transport/http.js.map +1 -1
  50. package/dist/code/gate.d.ts.map +1 -1
  51. package/dist/code/gate.js +17 -9
  52. package/dist/code/gate.js.map +1 -1
  53. package/dist/code/hotpath.d.ts +1 -1
  54. package/dist/code/hotpath.d.ts.map +1 -1
  55. package/dist/code/hotpath.js +16 -2
  56. package/dist/code/hotpath.js.map +1 -1
  57. package/dist/code/skeleton.d.ts +1 -1
  58. package/dist/code/skeleton.d.ts.map +1 -1
  59. package/dist/code/skeleton.js +53 -6
  60. package/dist/code/skeleton.js.map +1 -1
  61. package/dist/code/windows.d.ts +2 -1
  62. package/dist/code/windows.d.ts.map +1 -1
  63. package/dist/code/windows.js +18 -5
  64. package/dist/code/windows.js.map +1 -1
  65. package/dist/code-mode/action-catalog.d.ts +7 -4
  66. package/dist/code-mode/action-catalog.d.ts.map +1 -1
  67. package/dist/code-mode/action-catalog.js +229 -39
  68. package/dist/code-mode/action-catalog.js.map +1 -1
  69. package/dist/code-mode/descriptions.d.ts +2 -1
  70. package/dist/code-mode/descriptions.d.ts.map +1 -1
  71. package/dist/code-mode/descriptions.js +17 -11
  72. package/dist/code-mode/descriptions.js.map +1 -1
  73. package/dist/code-mode/etag-cache.d.ts +7 -5
  74. package/dist/code-mode/etag-cache.d.ts.map +1 -1
  75. package/dist/code-mode/etag-cache.js +72 -16
  76. package/dist/code-mode/etag-cache.js.map +1 -1
  77. package/dist/code-mode/index.d.ts +4 -3
  78. package/dist/code-mode/index.d.ts.map +1 -1
  79. package/dist/code-mode/index.js +121 -69
  80. package/dist/code-mode/index.js.map +1 -1
  81. package/dist/code-mode/ladder-validator.d.ts +2 -2
  82. package/dist/code-mode/ladder-validator.d.ts.map +1 -1
  83. package/dist/code-mode/ladder-validator.js.map +1 -1
  84. package/dist/code-mode/manual-generator.d.ts +8 -0
  85. package/dist/code-mode/manual-generator.d.ts.map +1 -1
  86. package/dist/code-mode/manual-generator.js +126 -33
  87. package/dist/code-mode/manual-generator.js.map +1 -1
  88. package/dist/code-mode/ref-resolver.d.ts.map +1 -1
  89. package/dist/code-mode/ref-resolver.js +75 -24
  90. package/dist/code-mode/ref-resolver.js.map +1 -1
  91. package/dist/code-mode/transforms.d.ts +1 -1
  92. package/dist/code-mode/transforms.d.ts.map +1 -1
  93. package/dist/code-mode/transforms.js +59 -14
  94. package/dist/code-mode/transforms.js.map +1 -1
  95. package/dist/code-mode/types.d.ts +31 -19
  96. package/dist/code-mode/types.d.ts.map +1 -1
  97. package/dist/code-mode/types.js +16 -10
  98. package/dist/code-mode/types.js.map +1 -1
  99. package/dist/code-mode/{chain-budget.d.ts → workflow-budget.d.ts} +4 -4
  100. package/dist/code-mode/workflow-budget.d.ts.map +1 -0
  101. package/dist/code-mode/{chain-budget.js → workflow-budget.js} +19 -18
  102. package/dist/code-mode/workflow-budget.js.map +1 -0
  103. package/dist/code-mode/workflow-executor.d.ts +11 -0
  104. package/dist/code-mode/workflow-executor.d.ts.map +1 -0
  105. package/dist/code-mode/{chain-executor.js → workflow-executor.js} +169 -81
  106. package/dist/code-mode/workflow-executor.js.map +1 -0
  107. package/dist/code-mode/workflow-parser.d.ts +31 -0
  108. package/dist/code-mode/workflow-parser.d.ts.map +1 -0
  109. package/dist/code-mode/{chain-parser.js → workflow-parser.js} +30 -21
  110. package/dist/code-mode/workflow-parser.js.map +1 -0
  111. package/dist/code-mode/workflow-truncation.d.ts +32 -0
  112. package/dist/code-mode/workflow-truncation.d.ts.map +1 -0
  113. package/dist/code-mode/workflow-truncation.js +121 -0
  114. package/dist/code-mode/workflow-truncation.js.map +1 -0
  115. package/dist/config/constants.d.ts +1 -1
  116. package/dist/config/constants.js +1 -1
  117. package/dist/config/memory-config.d.ts +26 -0
  118. package/dist/config/memory-config.d.ts.map +1 -0
  119. package/dist/config/memory-config.js +74 -0
  120. package/dist/config/memory-config.js.map +1 -0
  121. package/dist/config/types.d.ts +51 -8
  122. package/dist/config/types.d.ts.map +1 -1
  123. package/dist/config/types.js +56 -20
  124. package/dist/config/types.js.map +1 -1
  125. package/dist/db/graph-db-path.d.ts.map +1 -1
  126. package/dist/db/graph-db-path.js +4 -0
  127. package/dist/db/graph-db-path.js.map +1 -1
  128. package/dist/db/ladybug-clusters.d.ts +6 -0
  129. package/dist/db/ladybug-clusters.d.ts.map +1 -1
  130. package/dist/db/ladybug-clusters.js +24 -11
  131. package/dist/db/ladybug-clusters.js.map +1 -1
  132. package/dist/db/ladybug-edges.d.ts +15 -0
  133. package/dist/db/ladybug-edges.d.ts.map +1 -1
  134. package/dist/db/ladybug-edges.js +54 -2
  135. package/dist/db/ladybug-edges.js.map +1 -1
  136. package/dist/db/ladybug-memory.d.ts.map +1 -1
  137. package/dist/db/ladybug-memory.js +13 -3
  138. package/dist/db/ladybug-memory.js.map +1 -1
  139. package/dist/db/ladybug-processes.d.ts +8 -0
  140. package/dist/db/ladybug-processes.d.ts.map +1 -1
  141. package/dist/db/ladybug-processes.js +35 -0
  142. package/dist/db/ladybug-processes.js.map +1 -1
  143. package/dist/db/ladybug-repos.d.ts +5 -0
  144. package/dist/db/ladybug-repos.d.ts.map +1 -1
  145. package/dist/db/ladybug-repos.js +24 -0
  146. package/dist/db/ladybug-repos.js.map +1 -1
  147. package/dist/db/ladybug-schema.d.ts.map +1 -1
  148. package/dist/db/ladybug-schema.js +4 -1
  149. package/dist/db/ladybug-schema.js.map +1 -1
  150. package/dist/db/ladybug-symbols.d.ts +5 -2
  151. package/dist/db/ladybug-symbols.d.ts.map +1 -1
  152. package/dist/db/ladybug-symbols.js +95 -23
  153. package/dist/db/ladybug-symbols.js.map +1 -1
  154. package/dist/db/ladybug-versions.js +1 -1
  155. package/dist/db/ladybug.d.ts +6 -0
  156. package/dist/db/ladybug.d.ts.map +1 -1
  157. package/dist/db/ladybug.js +24 -0
  158. package/dist/db/ladybug.js.map +1 -1
  159. package/dist/db/migrations/index.d.ts.map +1 -1
  160. package/dist/db/migrations/index.js +2 -1
  161. package/dist/db/migrations/index.js.map +1 -1
  162. package/dist/db/migrations/m010-add-jina-code-embedding.d.ts +5 -0
  163. package/dist/db/migrations/m010-add-jina-code-embedding.d.ts.map +1 -0
  164. package/dist/db/migrations/m010-add-jina-code-embedding.js +30 -0
  165. package/dist/db/migrations/m010-add-jina-code-embedding.js.map +1 -0
  166. package/dist/db/schema.d.ts +17 -1
  167. package/dist/db/schema.d.ts.map +1 -1
  168. package/dist/delta/blastRadius.d.ts +1 -1
  169. package/dist/delta/blastRadius.d.ts.map +1 -1
  170. package/dist/delta/diff.d.ts +1 -1
  171. package/dist/delta/diff.d.ts.map +1 -1
  172. package/dist/delta/diff.js +14 -6
  173. package/dist/delta/diff.js.map +1 -1
  174. package/dist/delta/versioning.d.ts +1 -1
  175. package/dist/delta/versioning.d.ts.map +1 -1
  176. package/dist/domain/types.d.ts +18 -2
  177. package/dist/domain/types.d.ts.map +1 -1
  178. package/dist/domain/types.js +13 -2
  179. package/dist/domain/types.js.map +1 -1
  180. package/dist/gateway/descriptions.d.ts +9 -0
  181. package/dist/gateway/descriptions.d.ts.map +1 -1
  182. package/dist/gateway/descriptions.js +21 -4
  183. package/dist/gateway/descriptions.js.map +1 -1
  184. package/dist/gateway/index.d.ts.map +1 -1
  185. package/dist/gateway/index.js +4 -2
  186. package/dist/gateway/index.js.map +1 -1
  187. package/dist/gateway/legacy.js +3 -3
  188. package/dist/gateway/legacy.js.map +1 -1
  189. package/dist/gateway/router.d.ts.map +1 -1
  190. package/dist/gateway/router.js +20 -6
  191. package/dist/gateway/router.js.map +1 -1
  192. package/dist/gateway/schemas.d.ts +24 -4
  193. package/dist/gateway/schemas.d.ts.map +1 -1
  194. package/dist/gateway/schemas.js +24 -6
  195. package/dist/gateway/schemas.js.map +1 -1
  196. package/dist/gateway/thin-schemas.d.ts.map +1 -1
  197. package/dist/gateway/thin-schemas.js +3 -1
  198. package/dist/gateway/thin-schemas.js.map +1 -1
  199. package/dist/graph/buildGraph.d.ts +2 -1
  200. package/dist/graph/buildGraph.d.ts.map +1 -1
  201. package/dist/graph/buildGraph.js.map +1 -1
  202. package/dist/graph/cache.d.ts +1 -1
  203. package/dist/graph/cache.d.ts.map +1 -1
  204. package/dist/graph/graphSnapshotCache.d.ts +1 -1
  205. package/dist/graph/graphSnapshotCache.d.ts.map +1 -1
  206. package/dist/graph/metrics.d.ts +20 -6
  207. package/dist/graph/metrics.d.ts.map +1 -1
  208. package/dist/graph/metrics.js +107 -39
  209. package/dist/graph/metrics.js.map +1 -1
  210. package/dist/graph/overview.d.ts.map +1 -1
  211. package/dist/graph/overview.js +138 -14
  212. package/dist/graph/overview.js.map +1 -1
  213. package/dist/graph/slice/beam-search-engine.d.ts +1 -1
  214. package/dist/graph/slice/beam-search-engine.d.ts.map +1 -1
  215. package/dist/graph/slice/beam-search-engine.js.map +1 -1
  216. package/dist/graph/slice/result.d.ts +4 -1
  217. package/dist/graph/slice/result.d.ts.map +1 -1
  218. package/dist/graph/slice/result.js +4 -0
  219. package/dist/graph/slice/result.js.map +1 -1
  220. package/dist/graph/slice/slice-serializer.d.ts +1 -1
  221. package/dist/graph/slice/slice-serializer.d.ts.map +1 -1
  222. package/dist/graph/slice/start-node-resolver.d.ts +1 -1
  223. package/dist/graph/slice/start-node-resolver.d.ts.map +1 -1
  224. package/dist/graph/slice/start-node-resolver.js +56 -0
  225. package/dist/graph/slice/start-node-resolver.js.map +1 -1
  226. package/dist/graph/slice.d.ts +1 -1
  227. package/dist/graph/slice.d.ts.map +1 -1
  228. package/dist/graph/slice.js +23 -0
  229. package/dist/graph/slice.js.map +1 -1
  230. package/dist/graph/sliceCache.d.ts +1 -1
  231. package/dist/graph/sliceCache.d.ts.map +1 -1
  232. package/dist/indexer/adapter/LanguageAdapter.d.ts +1 -1
  233. package/dist/indexer/adapter/LanguageAdapter.d.ts.map +1 -1
  234. package/dist/indexer/cluster-orchestrator.d.ts +2 -0
  235. package/dist/indexer/cluster-orchestrator.d.ts.map +1 -1
  236. package/dist/indexer/cluster-orchestrator.js +290 -76
  237. package/dist/indexer/cluster-orchestrator.js.map +1 -1
  238. package/dist/indexer/edge-builder/cleanup.js +19 -16
  239. package/dist/indexer/edge-builder/cleanup.js.map +1 -1
  240. package/dist/indexer/edge-builder/symbol-index.d.ts +1 -1
  241. package/dist/indexer/edge-builder/symbol-index.d.ts.map +1 -1
  242. package/dist/indexer/edge-builder/symbol-mapping.d.ts +1 -1
  243. package/dist/indexer/edge-builder/symbol-mapping.d.ts.map +1 -1
  244. package/dist/indexer/edge-builder/telemetry.d.ts +1 -1
  245. package/dist/indexer/edge-builder/telemetry.d.ts.map +1 -1
  246. package/dist/indexer/edge-builder/types.d.ts +1 -1
  247. package/dist/indexer/edge-builder/types.d.ts.map +1 -1
  248. package/dist/indexer/edge-builder/unresolved-imports.d.ts +8 -2
  249. package/dist/indexer/edge-builder/unresolved-imports.d.ts.map +1 -1
  250. package/dist/indexer/edge-builder/unresolved-imports.js +100 -55
  251. package/dist/indexer/edge-builder/unresolved-imports.js.map +1 -1
  252. package/dist/indexer/edge-confidence.d.ts +1 -1
  253. package/dist/indexer/edge-confidence.d.ts.map +1 -1
  254. package/dist/indexer/embeddings.d.ts +0 -10
  255. package/dist/indexer/embeddings.d.ts.map +1 -1
  256. package/dist/indexer/embeddings.js +10 -126
  257. package/dist/indexer/embeddings.js.map +1 -1
  258. package/dist/indexer/indexer-init.d.ts +6 -2
  259. package/dist/indexer/indexer-init.d.ts.map +1 -1
  260. package/dist/indexer/indexer-init.js +10 -15
  261. package/dist/indexer/indexer-init.js.map +1 -1
  262. package/dist/indexer/indexer-memory.d.ts.map +1 -1
  263. package/dist/indexer/indexer-memory.js +8 -0
  264. package/dist/indexer/indexer-memory.js.map +1 -1
  265. package/dist/indexer/indexer-pass1.d.ts.map +1 -1
  266. package/dist/indexer/indexer-pass1.js +11 -0
  267. package/dist/indexer/indexer-pass1.js.map +1 -1
  268. package/dist/indexer/indexer-pass2.d.ts +3 -0
  269. package/dist/indexer/indexer-pass2.d.ts.map +1 -1
  270. package/dist/indexer/indexer-pass2.js +7 -5
  271. package/dist/indexer/indexer-pass2.js.map +1 -1
  272. package/dist/indexer/indexer-version.d.ts.map +1 -1
  273. package/dist/indexer/indexer-version.js +27 -9
  274. package/dist/indexer/indexer-version.js.map +1 -1
  275. package/dist/indexer/indexer.d.ts +9 -1
  276. package/dist/indexer/indexer.d.ts.map +1 -1
  277. package/dist/indexer/indexer.js +242 -70
  278. package/dist/indexer/indexer.js.map +1 -1
  279. package/dist/indexer/metrics-updater.d.ts +7 -2
  280. package/dist/indexer/metrics-updater.d.ts.map +1 -1
  281. package/dist/indexer/metrics-updater.js +94 -65
  282. package/dist/indexer/metrics-updater.js.map +1 -1
  283. package/dist/indexer/model-downloader.js +15 -3
  284. package/dist/indexer/model-downloader.js.map +1 -1
  285. package/dist/indexer/model-registry.d.ts +16 -0
  286. package/dist/indexer/model-registry.d.ts.map +1 -1
  287. package/dist/indexer/model-registry.js +42 -4
  288. package/dist/indexer/model-registry.js.map +1 -1
  289. package/dist/indexer/parser/build-rows.js +2 -2
  290. package/dist/indexer/parser/build-rows.js.map +1 -1
  291. package/dist/indexer/parser/early-exit.d.ts.map +1 -1
  292. package/dist/indexer/parser/early-exit.js +24 -3
  293. package/dist/indexer/parser/early-exit.js.map +1 -1
  294. package/dist/indexer/parser/helpers.d.ts +3 -8
  295. package/dist/indexer/parser/helpers.d.ts.map +1 -1
  296. package/dist/indexer/parser/helpers.js +2 -1
  297. package/dist/indexer/parser/helpers.js.map +1 -1
  298. package/dist/indexer/parser/parse-and-extract.d.ts.map +1 -1
  299. package/dist/indexer/parser/parse-and-extract.js +8 -1
  300. package/dist/indexer/parser/parse-and-extract.js.map +1 -1
  301. package/dist/indexer/parser/process-file.d.ts.map +1 -1
  302. package/dist/indexer/parser/process-file.js +12 -0
  303. package/dist/indexer/parser/process-file.js.map +1 -1
  304. package/dist/indexer/parser/rust-process-file.d.ts +2 -8
  305. package/dist/indexer/parser/rust-process-file.d.ts.map +1 -1
  306. package/dist/indexer/parser/rust-process-file.js +18 -1
  307. package/dist/indexer/parser/rust-process-file.js.map +1 -1
  308. package/dist/indexer/parser/types.d.ts +2 -0
  309. package/dist/indexer/parser/types.d.ts.map +1 -1
  310. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.d.ts +1 -1
  311. package/dist/indexer/pass2/resolvers/rust-pass2-resolver.d.ts.map +1 -1
  312. package/dist/indexer/scanner.d.ts +1 -0
  313. package/dist/indexer/scanner.d.ts.map +1 -1
  314. package/dist/indexer/scanner.js +17 -8
  315. package/dist/indexer/scanner.js.map +1 -1
  316. package/dist/indexer/summaries.d.ts +33 -2
  317. package/dist/indexer/summaries.d.ts.map +1 -1
  318. package/dist/indexer/summaries.js +965 -126
  319. package/dist/indexer/summaries.js.map +1 -1
  320. package/dist/indexer/symbol-map-cache.d.ts +29 -0
  321. package/dist/indexer/symbol-map-cache.d.ts.map +1 -0
  322. package/dist/indexer/symbol-map-cache.js +152 -0
  323. package/dist/indexer/symbol-map-cache.js.map +1 -0
  324. package/dist/indexer/ts/tsParser.d.ts +9 -1
  325. package/dist/indexer/ts/tsParser.d.ts.map +1 -1
  326. package/dist/indexer/ts/tsParser.js +136 -24
  327. package/dist/indexer/ts/tsParser.js.map +1 -1
  328. package/dist/live-index/checkpoint-service.d.ts +15 -0
  329. package/dist/live-index/checkpoint-service.d.ts.map +1 -1
  330. package/dist/live-index/checkpoint-service.js +74 -0
  331. package/dist/live-index/checkpoint-service.js.map +1 -1
  332. package/dist/live-index/coordinator.d.ts.map +1 -1
  333. package/dist/live-index/coordinator.js +41 -9
  334. package/dist/live-index/coordinator.js.map +1 -1
  335. package/dist/live-index/debounce.d.ts.map +1 -1
  336. package/dist/live-index/debounce.js +5 -0
  337. package/dist/live-index/debounce.js.map +1 -1
  338. package/dist/live-index/overlay-merge.d.ts.map +1 -1
  339. package/dist/live-index/overlay-merge.js +5 -0
  340. package/dist/live-index/overlay-merge.js.map +1 -1
  341. package/dist/live-index/overlay-reader.d.ts +1 -1
  342. package/dist/live-index/overlay-reader.d.ts.map +1 -1
  343. package/dist/live-index/overlay-reader.js +8 -2
  344. package/dist/live-index/overlay-reader.js.map +1 -1
  345. package/dist/live-index/reconcile-worker.d.ts.map +1 -1
  346. package/dist/live-index/reconcile-worker.js +0 -4
  347. package/dist/live-index/reconcile-worker.js.map +1 -1
  348. package/dist/main.js +21 -3
  349. package/dist/main.js.map +1 -1
  350. package/dist/mcp/context-response-projection.d.ts +18 -0
  351. package/dist/mcp/context-response-projection.d.ts.map +1 -0
  352. package/dist/mcp/context-response-projection.js +56 -0
  353. package/dist/mcp/context-response-projection.js.map +1 -0
  354. package/dist/mcp/hooks/memory-hint.d.ts.map +1 -1
  355. package/dist/mcp/hooks/memory-hint.js +20 -8
  356. package/dist/mcp/hooks/memory-hint.js.map +1 -1
  357. package/dist/mcp/savings-meter.d.ts +7 -0
  358. package/dist/mcp/savings-meter.d.ts.map +1 -1
  359. package/dist/mcp/savings-meter.js +34 -7
  360. package/dist/mcp/savings-meter.js.map +1 -1
  361. package/dist/mcp/telemetry.d.ts +1 -1
  362. package/dist/mcp/telemetry.d.ts.map +1 -1
  363. package/dist/mcp/token-accumulator.js +2 -2
  364. package/dist/mcp/token-accumulator.js.map +1 -1
  365. package/dist/mcp/token-usage.d.ts +0 -5
  366. package/dist/mcp/token-usage.d.ts.map +1 -1
  367. package/dist/mcp/token-usage.js +26 -6
  368. package/dist/mcp/token-usage.js.map +1 -1
  369. package/dist/mcp/tool-call-formatter.d.ts +1 -1
  370. package/dist/mcp/tool-call-formatter.d.ts.map +1 -1
  371. package/dist/mcp/tool-call-formatter.js +129 -107
  372. package/dist/mcp/tool-call-formatter.js.map +1 -1
  373. package/dist/mcp/tool-presentation.d.ts.map +1 -1
  374. package/dist/mcp/tool-presentation.js +1 -2
  375. package/dist/mcp/tool-presentation.js.map +1 -1
  376. package/dist/mcp/tools/code.d.ts.map +1 -1
  377. package/dist/mcp/tools/code.js +154 -37
  378. package/dist/mcp/tools/code.js.map +1 -1
  379. package/dist/mcp/tools/context.d.ts +3 -0
  380. package/dist/mcp/tools/context.d.ts.map +1 -0
  381. package/dist/mcp/tools/context.js +111 -0
  382. package/dist/mcp/tools/context.js.map +1 -0
  383. package/dist/mcp/tools/delta.d.ts.map +1 -1
  384. package/dist/mcp/tools/delta.js +110 -22
  385. package/dist/mcp/tools/delta.js.map +1 -1
  386. package/dist/mcp/tools/file-read.d.ts +3 -0
  387. package/dist/mcp/tools/file-read.d.ts.map +1 -0
  388. package/dist/mcp/tools/file-read.js +268 -0
  389. package/dist/mcp/tools/file-read.js.map +1 -0
  390. package/dist/mcp/tools/index.js +1 -1
  391. package/dist/mcp/tools/index.js.map +1 -1
  392. package/dist/mcp/tools/memory.d.ts.map +1 -1
  393. package/dist/mcp/tools/memory.js +126 -100
  394. package/dist/mcp/tools/memory.js.map +1 -1
  395. package/dist/mcp/tools/prRisk.d.ts +92 -17
  396. package/dist/mcp/tools/prRisk.d.ts.map +1 -1
  397. package/dist/mcp/tools/prRisk.js +148 -19
  398. package/dist/mcp/tools/prRisk.js.map +1 -1
  399. package/dist/mcp/tools/repo.d.ts.map +1 -1
  400. package/dist/mcp/tools/repo.js +173 -35
  401. package/dist/mcp/tools/repo.js.map +1 -1
  402. package/dist/mcp/tools/runtime.d.ts.map +1 -1
  403. package/dist/mcp/tools/runtime.js +106 -17
  404. package/dist/mcp/tools/runtime.js.map +1 -1
  405. package/dist/mcp/tools/slice-wire-format.d.ts +58 -2
  406. package/dist/mcp/tools/slice-wire-format.d.ts.map +1 -1
  407. package/dist/mcp/tools/slice-wire-format.js +120 -0
  408. package/dist/mcp/tools/slice-wire-format.js.map +1 -1
  409. package/dist/mcp/tools/slice.d.ts.map +1 -1
  410. package/dist/mcp/tools/slice.js +28 -13
  411. package/dist/mcp/tools/slice.js.map +1 -1
  412. package/dist/mcp/tools/summary.d.ts.map +1 -1
  413. package/dist/mcp/tools/summary.js +5 -2
  414. package/dist/mcp/tools/summary.js.map +1 -1
  415. package/dist/mcp/tools/symbol.d.ts +30 -0
  416. package/dist/mcp/tools/symbol.d.ts.map +1 -1
  417. package/dist/mcp/tools/symbol.js +360 -82
  418. package/dist/mcp/tools/symbol.js.map +1 -1
  419. package/dist/mcp/tools/tool-descriptors.d.ts.map +1 -1
  420. package/dist/mcp/tools/tool-descriptors.js +22 -8
  421. package/dist/mcp/tools/tool-descriptors.js.map +1 -1
  422. package/dist/mcp/tools/usage.js +2 -2
  423. package/dist/mcp/tools/usage.js.map +1 -1
  424. package/dist/mcp/tools.d.ts +235 -23
  425. package/dist/mcp/tools.d.ts.map +1 -1
  426. package/dist/mcp/tools.js +141 -21
  427. package/dist/mcp/tools.js.map +1 -1
  428. package/dist/retrieval/fallback.d.ts +1 -1
  429. package/dist/retrieval/fallback.d.ts.map +1 -1
  430. package/dist/retrieval/fallback.js +11 -8
  431. package/dist/retrieval/fallback.js.map +1 -1
  432. package/dist/retrieval/feedback-boost.d.ts +3 -1
  433. package/dist/retrieval/feedback-boost.d.ts.map +1 -1
  434. package/dist/retrieval/feedback-boost.js +4 -2
  435. package/dist/retrieval/feedback-boost.js.map +1 -1
  436. package/dist/retrieval/model-mapping.d.ts.map +1 -1
  437. package/dist/retrieval/model-mapping.js +1 -0
  438. package/dist/retrieval/model-mapping.js.map +1 -1
  439. package/dist/retrieval/orchestrator.d.ts.map +1 -1
  440. package/dist/retrieval/orchestrator.js +13 -4
  441. package/dist/retrieval/orchestrator.js.map +1 -1
  442. package/dist/retrieval/task-query-ranking.d.ts +9 -0
  443. package/dist/retrieval/task-query-ranking.d.ts.map +1 -0
  444. package/dist/retrieval/task-query-ranking.js +89 -0
  445. package/dist/retrieval/task-query-ranking.js.map +1 -0
  446. package/dist/retrieval/types.d.ts +2 -1
  447. package/dist/retrieval/types.d.ts.map +1 -1
  448. package/dist/runtime/artifacts.d.ts.map +1 -1
  449. package/dist/runtime/artifacts.js +20 -0
  450. package/dist/runtime/artifacts.js.map +1 -1
  451. package/dist/runtime/runtimes.d.ts.map +1 -1
  452. package/dist/runtime/runtimes.js +4 -0
  453. package/dist/runtime/runtimes.js.map +1 -1
  454. package/dist/server.d.ts.map +1 -1
  455. package/dist/server.js +77 -65
  456. package/dist/server.js.map +1 -1
  457. package/dist/services/card-builder.d.ts.map +1 -1
  458. package/dist/services/card-builder.js +23 -10
  459. package/dist/services/card-builder.js.map +1 -1
  460. package/dist/services/health.d.ts +1 -1
  461. package/dist/services/health.d.ts.map +1 -1
  462. package/dist/services/health.js +1 -1
  463. package/dist/services/health.js.map +1 -1
  464. package/dist/services/summary.d.ts.map +1 -1
  465. package/dist/services/summary.js +263 -20
  466. package/dist/services/summary.js.map +1 -1
  467. package/dist/sync/types.d.ts +1 -1
  468. package/dist/sync/types.d.ts.map +1 -1
  469. package/dist/ts/mapping.d.ts +1 -1
  470. package/dist/ts/mapping.d.ts.map +1 -1
  471. package/dist/util/conditional-response.d.ts +16 -0
  472. package/dist/util/conditional-response.d.ts.map +1 -0
  473. package/dist/util/conditional-response.js +20 -0
  474. package/dist/util/conditional-response.js.map +1 -0
  475. package/dist/util/hashing.d.ts +2 -0
  476. package/dist/util/hashing.d.ts.map +1 -1
  477. package/dist/util/hashing.js +8 -4
  478. package/dist/util/hashing.js.map +1 -1
  479. package/dist/util/resolve-symbol-ref.d.ts.map +1 -1
  480. package/dist/util/resolve-symbol-ref.js +66 -4
  481. package/dist/util/resolve-symbol-ref.js.map +1 -1
  482. package/package.json +2 -2
  483. package/templates/AGENTS.md.template +39 -10
  484. package/templates/CLAUDE.md.template +32 -7
  485. package/templates/CODEX.md.template +33 -5
  486. package/templates/GEMINI.md.template +33 -5
  487. package/templates/OPENCODE.md.template +32 -4
  488. package/config/sdlmcp.config.json.sample +0 -73
  489. package/dist/agent/orchestrator.d.ts +0 -15
  490. package/dist/agent/orchestrator.d.ts.map +0 -1
  491. package/dist/agent/orchestrator.js +0 -291
  492. package/dist/agent/orchestrator.js.map +0 -1
  493. package/dist/code-mode/chain-budget.d.ts.map +0 -1
  494. package/dist/code-mode/chain-budget.js.map +0 -1
  495. package/dist/code-mode/chain-executor.d.ts +0 -11
  496. package/dist/code-mode/chain-executor.d.ts.map +0 -1
  497. package/dist/code-mode/chain-executor.js.map +0 -1
  498. package/dist/code-mode/chain-parser.d.ts +0 -28
  499. package/dist/code-mode/chain-parser.d.ts.map +0 -1
  500. package/dist/code-mode/chain-parser.js.map +0 -1
  501. package/dist/experiments/event-log-replay.d.ts +0 -118
  502. package/dist/experiments/event-log-replay.d.ts.map +0 -1
  503. package/dist/experiments/event-log-replay.js +0 -161
  504. package/dist/experiments/event-log-replay.js.map +0 -1
  505. package/dist/indexer/ann-index.d.ts +0 -111
  506. package/dist/indexer/ann-index.d.ts.map +0 -1
  507. package/dist/indexer/ann-index.js +0 -502
  508. package/dist/indexer/ann-index.js.map +0 -1
  509. package/dist/indexer/summary-transfer.d.ts +0 -35
  510. package/dist/indexer/summary-transfer.d.ts.map +0 -1
  511. package/dist/indexer/summary-transfer.js +0 -184
  512. package/dist/indexer/summary-transfer.js.map +0 -1
  513. package/dist/mcp/tools/agent.d.ts +0 -3
  514. package/dist/mcp/tools/agent.d.ts.map +0 -1
  515. package/dist/mcp/tools/agent.js +0 -34
  516. package/dist/mcp/tools/agent.js.map +0 -1
package/README.md CHANGED
@@ -41,29 +41,21 @@ SDL-MCP fixes this. It indexes your codebase into a searchable **symbol graph**
41
41
 
42
42
  ## How it works — in 30 seconds
43
43
 
44
- ```
45
- Your Codebase
46
-
47
- ┌──────┴──────┐
48
- │ Indexer │ Native Rust (fast) or Tree-sitter (universal)
49
- │ 12 langs │ TS · JS · Python · Go · Java · C# · C · C++ · PHP · Rust · Kotlin · Shell
50
- └──────┬──────┘
51
-
52
-
53
- ┌───────────────────────┐
54
- │ Symbol Graph (DB) │ Functions, classes, interfaces, types, edges, metrics
55
- │ LadybugDB (graph) │ Persisted. Incremental. Versioned.
56
- └───────────┬───────────┘
57
-
58
- ┌──────────┼──────────┐
59
- │ │ │
60
- ▼ ▼ ▼
61
- 35 MCP 13 CLI HTTP API
62
- Tools Commands (dev/network)
63
-
64
-
65
- AI Coding Agent
66
- (Claude Code, Claude Desktop, Cursor, Windsurf, any MCP client)
44
+ ```mermaid
45
+ flowchart TD
46
+ Codebase["Your Codebase"]
47
+ Indexer["Indexer<br/>12 languages<br/>Rust native or Tree-sitter fallback"]
48
+ Graph["LadybugDB graph<br/>symbols, edges, metrics, versions"]
49
+ MCP["34 flat MCP tools<br/>plus optional gateway and code-mode surfaces"]
50
+ CLI["13 CLI commands"]
51
+ HTTP["HTTP API and graph UI"]
52
+ Agent["AI coding agent<br/>Claude Code, Claude Desktop, Cursor, Windsurf, Codex, Gemini"]
53
+
54
+ Codebase --> Indexer --> Graph
55
+ Graph --> MCP
56
+ Graph --> CLI
57
+ Graph --> HTTP
58
+ MCP --> Agent
67
59
  ```
68
60
 
69
61
  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
@@ -105,24 +97,14 @@ Point your MCP client at the server and the agent gains access to all SDL-MCP to
105
97
 
106
98
  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.
107
99
 
108
- ```
109
- Token Cost What the Agent Sees
110
- ────────────────────────────────────────────────
111
- ~100 RUNG 1 Symbol Card
112
- Name, signature, summary, dependencies, metrics
113
- "What does this function do and what does it call?"
114
-
115
- ~300 RUNG 2 Skeleton IR
116
- Signatures + control flow, bodies replaced with /* ... */
117
- "What's the shape of this class?"
118
-
119
- ~600 RUNG 3 ▸ Hot-Path Excerpt
120
- Only lines matching specific identifiers + context
121
- "Where exactly is `this.cache` initialized?"
122
-
123
- ~2,000 RUNG 4 ▸ Raw Code Window Policy-gated
124
- Full source code, requires justification
125
- "I need to rewrite this error handler"
100
+ ```mermaid
101
+ flowchart TB
102
+ R1["~100 tokens<br/>Rung 1: Symbol Card<br/>Name, signature, summary, dependencies, metrics"]
103
+ R2["~300 tokens<br/>Rung 2: Skeleton IR<br/>Signatures and control flow with bodies elided"]
104
+ R3["~600 tokens<br/>Rung 3: Hot-Path Excerpt<br/>Identifier-focused lines with context"]
105
+ R4["~2,000 tokens<br/>Rung 4: Raw Code Window<br/>Policy-gated full source"]
106
+
107
+ R1 --> R2 --> R3 --> R4
126
108
  ```
127
109
 
128
110
  > **Most questions are answered at Rungs 1-2** without ever reading raw code. That's where the token savings come from.
@@ -153,26 +135,21 @@ The core innovation. Named after the adjustable aperture that controls light flo
153
135
 
154
136
  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.
155
137
 
156
- ```
157
- ┌─────────────────────────────────────────────────────────┐
158
- Symbol Card: validateToken
159
- │─────────────────────────────────────────────────────────│
160
- │ Kind: function (exported) │
161
- │ File: src/auth/jwt.ts:42-67 │
162
- │ Signature: (token: string, opts?: ValidateOpts) │
163
- │ → Promise<DecodedToken> │
164
- │ Summary: Validates JWT signature and expiration, │
165
- │ returns decoded payload or throws │
166
- │ Invariants: ["throws on expired token"]
167
- │ Side FX: ["logs to audit trail"]
168
- │ Deps: calls: [verifySignature, checkExpiry]
169
- │ imports: [jsonwebtoken, AuditLogger] │
170
- │ Metrics: fan-in: 12 fan-out: 4 churn: 3/30d │
171
- │ Cluster: auth-module (8 members) │
172
- │ Process: request-pipeline (intermediate, depth 1) │
173
- │ Test: auth.test.ts (distance: 1, proximity: 0.9)│
174
- │ ETag: a7f3c2... (for conditional requests) │
175
- └─────────────────────────────────────────────────────────┘
138
+ ```mermaid
139
+ flowchart TB
140
+ Card["Symbol Card: validateToken"]
141
+ Kind["Kind: function (exported)"]
142
+ File["File: src/auth/jwt.ts:42-67"]
143
+ Signature["Signature: (token: string, opts?: ValidateOpts) -> Promise<DecodedToken>"]
144
+ Summary["Summary: validates JWT signature and expiration"]
145
+ Invariants["Invariants: throws on expired token"]
146
+ SideEffects["Side effects: logs to audit trail"]
147
+ Deps["Dependencies: verifySignature, checkExpiry, jsonwebtoken, AuditLogger"]
148
+ Metrics["Metrics: fan-in 12, fan-out 4, churn 3/30d"]
149
+ Context["Context: auth-module, request-pipeline, auth.test.ts"]
150
+ ETag["ETag: a7f3c2..."]
151
+
152
+ Card --> Kind --> File --> Signature --> Summary --> Invariants --> SideEffects --> Deps --> Metrics --> Context --> ETag
176
153
  ```
177
154
 
178
155
  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).
@@ -182,6 +159,7 @@ Cards include **confidence-scored call resolution** (the pass-2 resolver traces
182
159
  - Confidence-scored dependency edges trace real call relationships across files
183
160
  - Community detection and call-chain tracing reveal architectural structure
184
161
  - ETag-based conditional requests avoid re-fetching unchanged symbols
162
+ - Workflow ETag caching now seeds `slice.build` with `knownCardEtags` so repeated slice builds can skip unchanged cards
185
163
 
186
164
  [Indexing & Language Support Deep Dive →](./docs/feature-deep-dives/indexing-languages.md)
187
165
 
@@ -191,23 +169,16 @@ Cards include **confidence-scored call resolution** (the pass-2 resolver traces
191
169
 
192
170
  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.
193
171
 
194
- ```
195
- "Fix the auth middleware" → slice.build
196
-
197
- BFS over graph
198
-
199
- ┌──────────────────┼──────────────────┐
200
- ▼ ▼ ▼
201
- authenticate validateToken JwtConfig
202
- │ │ │
203
- ▼ ▼ ▼
204
- hashPassword getUserById envLoader
205
-
206
- ◆ frontier
207
- (outside budget)
208
-
209
- 8 cards returned · ~800 tokens
210
- vs. reading 8 files · ~16,000 tokens
172
+ ```mermaid
173
+ flowchart TD
174
+ Task["Task: Fix the auth middleware"] --> Slice["sdl.slice.build"]
175
+ Slice --> Auth["authenticate"]
176
+ Slice --> Validate["validateToken"]
177
+ Slice --> Config["JwtConfig"]
178
+ Auth --> Hash["hashPassword"]
179
+ Validate --> User["getUserById"]
180
+ Config --> Env["envLoader"]
181
+ Env -. frontier outside budget .-> Frontier["spillover frontier"]
211
182
  ```
212
183
 
213
184
  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.
@@ -226,19 +197,28 @@ Slices have handles, leases, refresh (delta-only updates), and spillover (paged
226
197
 
227
198
  `git diff` tells you what lines changed. SDL-MCP tells you what that change *means* and who's affected.
228
199
 
229
- ```
230
- Modified: validateToken() signature
231
-
232
- ├── signatureDiff: added `options?: object` parameter
233
- ├── invariantDiff: added "throws on expired"
234
- └── sideEffectDiff: added "logs to audit trail"
235
-
236
-
237
- Blast Radius (ranked):
238
- 1. authenticate() ← direct caller, distance 1
239
- 2. refreshSession() ← direct caller, distance 1
240
- 3. AuthMiddleware ← calls authenticate, distance 2
241
- 4. auth.test.ts ← test coverage, flagged for re-run
200
+ ```mermaid
201
+ flowchart TD
202
+ Change["Modified validateToken() signature"]
203
+ Sig["signatureDiff<br/>added options?: object"]
204
+ Inv["invariantDiff<br/>added throws on expired"]
205
+ Fx["sideEffectDiff<br/>added logs to audit trail"]
206
+ Blast["Blast radius"]
207
+ A1["authenticate()<br/>distance 1"]
208
+ A2["refreshSession()<br/>distance 1"]
209
+ A3["AuthMiddleware<br/>distance 2"]
210
+ A4["auth.test.ts<br/>re-run recommended"]
211
+
212
+ Change --> Sig
213
+ Change --> Inv
214
+ Change --> Fx
215
+ Sig --> Blast
216
+ Inv --> Blast
217
+ Fx --> Blast
218
+ Blast --> A1
219
+ Blast --> A2
220
+ Blast --> A3
221
+ Blast --> A4
242
222
  ```
243
223
 
244
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.
@@ -257,13 +237,13 @@ Slices have handles, leases, refresh (delta-only updates), and spillover (paged
257
237
 
258
238
  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.
259
239
 
260
- ```
261
- Editor keystrokes → sdl.buffer.push → Overlay Store → merged reads
262
-
263
- on save / idle
264
-
265
-
266
- LadybugDB (durable)
240
+ ```mermaid
241
+ flowchart LR
242
+ Editor["Editor keystrokes"] --> Push["sdl.buffer.push"]
243
+ Push --> Overlay["Overlay store"]
244
+ Overlay --> Reads["Merged reads<br/>search, cards, slices"]
245
+ Overlay --> Persist["save / idle checkpoint"]
246
+ Persist --> DB["LadybugDB durable graph"]
267
247
  ```
268
248
 
269
249
  **Why it matters:**
@@ -284,7 +264,7 @@ Raw code access (Rung 4) is **policy-gated**. Agents must provide:
284
264
 
285
265
  Requests that don't meet policy are denied with actionable guidance ("try `getHotPath` with these identifiers instead"). Every access is audit-logged.
286
266
 
287
- 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. The `outputMode` parameter (`"minimal"` | `"summary"` | `"intent"`) defaults to `"minimal"` for ~95% token savings, with `sdl.runtime.queryOutput` enabling on-demand output retrieval when needed.
267
+ The sandboxed runtime execution tool (`sdl.runtime.execute`) has its own governance layer: enabled by default, but still guarded by executable allowlisting, CWD jailing, environment scrubbing, concurrency limits, and timeout enforcement. The `outputMode` parameter (`"minimal"` | `"summary"` | `"intent"`) defaults to `"minimal"` for ~95% token savings, with `sdl.runtime.queryOutput` enabling on-demand output retrieval when needed.
288
268
 
289
269
  **Why it matters:**
290
270
  - Proof-of-need gating prevents agents from wastefully reading raw code
@@ -296,20 +276,20 @@ The sandboxed runtime execution tool (`sdl.runtime.execute`) has its own governa
296
276
 
297
277
  ---
298
278
 
299
- ### Agent OrchestrationAutopilot Mode
279
+ ### Agent ContextTask-Shaped Retrieval
300
280
 
301
- `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.
281
+ `sdl.agent.context` is SDL-MCP's task-shaped context engine. Give it a task type (`debug`, `review`, `implement`, `explain`), a description, and a budget — it selects the right Iris Gate rungs, collects evidence, and returns context tuned to the job. In Code Mode, `sdl.context` provides the same retrieval surface without dropping into `sdl.workflow`.
302
282
 
303
283
  The feedback loop (`sdl.agent.feedback`) records which symbols were useful and which were missing, improving future slice quality.
304
284
 
305
285
  `sdl.context.summary` generates portable, token-bounded context briefings in markdown, JSON, or clipboard format for use outside MCP environments.
306
286
 
307
287
  **Why it matters:**
308
- - Autonomous task execution plans the **optimal Iris Gate path** within a token budget
288
+ - Task-shaped context retrieval plans the **right Iris Gate path** within a token budget
309
289
  - Feedback loop records what was useful/missing, improving future slice quality
310
290
  - Portable context summaries export findings for use outside MCP environments
311
291
 
312
- [Agent Orchestration Deep Dive →](./docs/feature-deep-dives/agent-orchestration.md)
292
+ [Agent Context Deep Dive →](./docs/feature-deep-dives/agent-context.md) · [Context Modes →](./docs/feature-deep-dives/context-modes.md)
313
293
 
314
294
  ---
315
295
 
@@ -327,32 +307,28 @@ Run tests, linters, and scripts through SDL-MCP's governance layer instead of un
327
307
 
328
308
  ---
329
309
 
330
- ### Development Memories — Cross-Session Knowledge Persistence
310
+ ### Development Memories — Cross-Session Knowledge Persistence (Opt-In)
331
311
 
332
- Agents forget everything between sessions. SDL-MCP fixes this with a **graph-backed memory system** that lets agents store decisions, bugfix context, and task notes linked directly to the symbols and files they relate to. Memories are stored both in the graph database (for fast querying) and as checked-in markdown files (for version control and team sharing).
312
+ Agents forget everything between sessions. SDL-MCP fixes this with an **opt-in graph-backed memory system** that lets agents store decisions, bugfix context, and task notes linked directly to the symbols and files they relate to. Memory is **disabled by default** and must be explicitly enabled in the configuration. When enabled, memories are stored both in the graph database (for fast querying) and as checked-in markdown files (for version control and team sharing).
333
313
 
334
- ```
335
- Agent Session 1 Agent Session 2
336
- ───────────── ─────────────
337
- "Fixed race condition in sdl.memory.surface
338
- authenticate() added mutex"
339
- │ ┌────┴─────┐
340
- ▼ │ Relevant │
341
- sdl.memory.store │ memories │
342
- │ │ surfaced │
343
- ├──▶ Graph DB (Memory node) └────┬─────┘
344
- │ ├── MEMORY_OF ──▶ authenticate() │
345
- │ └── HAS_MEMORY ◀── Repo ▼
346
- │ "Previous fix: race condition
347
- └──▶ .sdl-memory/bugfixes/a1b2c3.md in authenticate() — mutex added"
348
- (YAML frontmatter + markdown)
314
+ ```mermaid
315
+ flowchart LR
316
+ Session1["Agent session 1<br/>records bugfix memory"] --> Store["sdl.memory.store"]
317
+ Store --> Graph["LadybugDB memory node"]
318
+ Store --> Files[".sdl-memory/bugfixes/<id>.md"]
319
+ Graph --> Link1["MEMORY_OF -> authenticate()"]
320
+ Graph --> Link2["HAS_MEMORY -> repo"]
321
+ Session2["Agent session 2"] --> Surface["sdl.memory.surface"]
322
+ Surface --> Graph
323
+ Graph --> Recall["Relevant memory surfaced<br/>race condition fix in authenticate()"]
349
324
  ```
350
325
 
351
- Memories are **automatically surfaced** inside graph slices — when an agent builds a slice touching symbols with linked memories, those memories appear alongside the cards. During re-indexing, memories linked to changed symbols are **flagged as stale**, prompting agents to review and update them. Four MCP tools (`store`, `query`, `remove`, `surface`) provide full CRUD plus intelligent ranking by confidence, recency, and symbol overlap.
326
+ When enabled, memories are **automatically surfaced** inside graph slices — when an agent builds a slice touching symbols with linked memories, those memories appear alongside the cards. During re-indexing, memories linked to changed symbols are **flagged as stale**, prompting agents to review and update them. Four MCP tools (`store`, `query`, `remove`, `surface`) provide full CRUD plus intelligent ranking by confidence, recency, and symbol overlap. Memory tools are only available when memory is enabled in the configuration.
352
327
 
353
328
  **Why it matters:**
354
329
  - Structured knowledge **persists across sessions**, linked directly to symbols and files
355
- - Automatically surfaced inside graph slices when touching related symbols
330
+ - Opt-in and disabled by default enable via `"memory": { "enabled": true }` in config
331
+ - When enabled, automatically surfaced inside graph slices when touching related symbols
356
332
  - Stale memories flagged when linked symbols change during re-indexing
357
333
  - Dual storage: graph DB for fast querying + markdown files for version control and team sharing
358
334
 
@@ -362,7 +338,7 @@ Memories are **automatically surfaced** inside graph slices — when an agent bu
362
338
 
363
339
  ### CLI Tool Access — No MCP Server Required
364
340
 
365
- Access all 35 tool actions directly from the command line with `sdl-mcp tool`. No MCP server, transport, or SDK just your terminal.
341
+ Access all 32 flat SDL action tools directly from the command line with `sdl-mcp tool`. No MCP server, transport, or SDK is required.
366
342
 
367
343
  ```bash
368
344
  # Search for symbols
@@ -389,20 +365,19 @@ Features include typed argument coercion (string, number, boolean, string[], jso
389
365
 
390
366
  ### Tool Gateway — 81% Token Reduction
391
367
 
392
- The tool gateway consolidates all 35 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**.
368
+ The tool gateway consolidates the 32 flat SDL action tools into **4 namespace-scoped tools** (`sdl.query`, `sdl.code`, `sdl.repo`, `sdl.agent`), reducing `tools/list` overhead from the full flat schema surface to a compact gateway surface.
393
369
 
394
- ```
395
- Before: 35 tools × full JSON Schema = ~3,742 tokens at conversation start
396
- After: 4 tools × thin schema = ~713 tokens at conversation start
397
- ─────────────
398
- ~3,029 tokens saved per conversation
370
+ ```mermaid
371
+ flowchart LR
372
+ Before["Flat mode<br/>32 flat action tools<br/>plus universal discovery/info"] --> After["Gateway mode<br/>4 namespace tools<br/>plus universal discovery/info"]
373
+ After --> Savings["Smaller tools/list payload<br/>lower agent startup overhead"]
399
374
  ```
400
375
 
401
376
  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.
402
377
 
403
378
  **Why it matters:**
404
- - **81% token reduction** in `tools/list` overhead (~3,742 ~713 tokens per conversation)
405
- - 35 tools consolidated into 4 namespace-scoped tools for simpler agent selection
379
+ - Large reduction in `tools/list` overhead for gateway-first agents
380
+ - 32 flat action tools consolidated into 4 namespace-scoped tools for simpler agent selection
406
381
  - Fewer tool choices means faster and more accurate tool dispatch by the agent
407
382
  - Backward-compatible: legacy flat tool names optionally emitted alongside
408
383
 
@@ -414,14 +389,14 @@ Each gateway tool accepts an `action` discriminator field (e.g., `{ action: "sym
414
389
 
415
390
  <br/>
416
391
 
417
- ## All 35 MCP Tools at a Glance
392
+ ## All 36 Unique Tool Surfaces at a Glance
418
393
 
419
394
  <table>
420
395
  <tr><th>Category</th><th>Tool</th><th>One-Line Description</th></tr>
421
396
  <tr><td rowspan="4"><strong>Repository</strong></td>
422
397
  <td><code>sdl.repo.register</code></td><td>Register a codebase for indexing</td></tr>
423
398
  <tr><td><code>sdl.repo.status</code></td><td>Health, versions, watcher, prefetch, live-index stats</td></tr>
424
- <tr><td><code>sdl.repo.overview</code></td><td>Codebase summary: stats, directories, hotspots, clusters</td></tr>
399
+ <tr><td><code>sdl.repo.overview</code></td><td>Codebase summary: stats, directories, hotspots, clusters, with conditional ETag fetch support</td></tr>
425
400
  <tr><td><code>sdl.index.refresh</code></td><td>Trigger full or incremental re-indexing</td></tr>
426
401
 
427
402
  <tr><td rowspan="3"><strong>Live Buffer</strong></td>
@@ -440,8 +415,8 @@ Each gateway tool accepts an `action` discriminator field (e.g., `{ action: "sym
440
415
  <tr><td><code>sdl.slice.spillover.get</code></td><td>Page through overflow symbols beyond the budget</td></tr>
441
416
 
442
417
  <tr><td rowspan="3"><strong>Code Access</strong></td>
443
- <td><code>sdl.code.getSkeleton</code></td><td>Signatures + control flow, bodies elided</td></tr>
444
- <tr><td><code>sdl.code.getHotPath</code></td><td>Lines matching specific identifiers + context</td></tr>
418
+ <td><code>sdl.code.getSkeleton</code></td><td>Signatures + control flow, bodies elided, with conditional ETag fetch support</td></tr>
419
+ <tr><td><code>sdl.code.getHotPath</code></td><td>Lines matching specific identifiers + context, with conditional ETag fetch support</td></tr>
445
420
  <tr><td><code>sdl.code.needWindow</code></td><td>Full source code (policy-gated, requires justification)</td></tr>
446
421
 
447
422
  <tr><td><strong>Deltas</strong></td>
@@ -455,10 +430,10 @@ Each gateway tool accepts an `action` discriminator field (e.g., `{ action: "sym
455
430
  <td><code>sdl.pr.risk.analyze</code></td><td>Scored PR risk with findings and test recommendations</td></tr>
456
431
 
457
432
  <tr><td><strong>Context</strong></td>
458
- <td><code>sdl.context.summary</code></td><td>Token-bounded portable briefing (markdown/JSON/clipboard)</td></tr>
433
+ <td><code>sdl.context.summary</code></td><td>Token-bounded portable briefing (markdown/JSON/clipboard) with conditional ETag fetch support</td></tr>
459
434
 
460
435
  <tr><td rowspan="3"><strong>Agent</strong></td>
461
- <td><code>sdl.agent.orchestrate</code></td><td>Autonomous task execution with budget control</td></tr>
436
+ <td><code>sdl.agent.context</code></td><td>Task-shaped context retrieval with budget-controlled rung planning and conditional ETag fetch support</td></tr>
462
437
  <tr><td><code>sdl.agent.feedback</code></td><td>Record which symbols were useful or missing</td></tr>
463
438
  <tr><td><code>sdl.agent.feedback.query</code></td><td>Query aggregated feedback statistics</td></tr>
464
439
 
@@ -472,8 +447,9 @@ Each gateway tool accepts an `action` discriminator field (e.g., `{ action: "sym
472
447
  <tr><td><code>sdl.memory.remove</code></td><td>Soft-delete a memory from graph and optionally from disk</td></tr>
473
448
  <tr><td><code>sdl.memory.surface</code></td><td>Auto-surface relevant memories for a task context</td></tr>
474
449
 
475
- <tr><td rowspan="2"><strong>Code Mode</strong></td>
476
- <td><code>sdl.chain</code></td><td>Multi-step tool chaining with budget tracking and ETag caching</td></tr>
450
+ <tr><td rowspan="3"><strong>Code Mode</strong></td>
451
+ <td><code>sdl.context</code></td><td>Code Mode task-shaped context retrieval for explain/debug/review/implement work</td></tr>
452
+ <tr><td><code>sdl.workflow</code></td><td>Multi-step operations with budget tracking, ETag caching, and transforms</td></tr>
477
453
  <tr><td><code>sdl.manual</code></td><td>Self-documentation — query usage guide, action schemas, output format reference</td></tr>
478
454
 
479
455
  <tr><td rowspan="3"><strong>Meta</strong></td>
@@ -559,46 +535,21 @@ A **VSCode extension** (`sdl-mcp-vscode/`) provides live buffer integration for
559
535
 
560
536
  ## System Architecture
561
537
 
562
- ```
563
- ┌─────────────────────────────────────────────────────────────────────┐
564
- MCP Clients │
565
- │ Claude Code · Claude Desktop · Cursor · Windsurf · Codex · Gemini │
566
- └──────────────────────────┬──────────────────────────────────────────┘
567
- stdio / HTTP
568
- ┌──────────────────────────▼──────────────────────────────────────────┐
569
- │ Tool Gateway │
570
- │ 4 namespace-scoped tools (sdl.query, sdl.code, sdl.repo, sdl.agent) │
571
- │ ← Thin JSON schemas → Double Zod validation → Handler dispatch │
572
- └───────┬────────┬────────┬────────┬────────┬────────┬────────────────┘
573
- │ │ │ │ │ │
574
- ┌───────▼──┐ ┌───▼───┐ ┌─▼──┐ ┌──▼──┐ ┌──▼───┐ ┌──▼──────┐
575
- Symbols │ │Slices │ │Code│ │Delta│ │Agent │ │ Memory │
576
- search │ │build │ │gate│ │diff │ │orch. │ │ store │
577
- │ getCard │ │refresh│ │skel│ │blast│ │feedbk│ │ query │
578
- │ getCards │ │spill. │ │hot │ │risk │ │chain │ │ surface │
579
- └────┬─────┘ └───┬───┘ └─┬──┘ └──┬──┘ └──┬───┘ └──┬─────┘
580
- │ │ │ │ │ │
581
- ┌────▼───────────▼───────▼───────▼───────▼────────▼───────┐
582
- │ Policy Engine │
583
- │ Proof-of-need gating · Token budgets · Audit logging │
584
- └──────────────────────────┬──────────────────────────────┘
585
-
586
- ┌──────────────────────────▼──────────────────────────────┐
587
- │ LadybugDB (Graph) │
588
- │ Symbols · Edges · Files · Versions · Clusters · │
589
- │ Processes · Memories · Metrics │
590
- └──────────────────────────▲──────────────────────────────┘
591
-
592
- ┌──────────────────────────┴──────────────────────────────┐
593
- │ Indexer Pipeline │
594
- │ ┌─────────────────┐ ┌────────────────────────────┐ │
595
- │ │ Rust (napi-rs) │ or │ Tree-sitter (TS fallback) │ │
596
- │ │ default engine │ │ 11 language grammars │ │
597
- │ └────────┬────────┘ └──────────┬─────────────────┘ │
598
- │ │ Pass 1: Symbols + Imports + Calls │
599
- │ │ Pass 2: Cross-file call resolution │
600
- │ │ Semantic: Embeddings + LLM summaries │
601
- └───────────┴──────────────────────────────────────────────┘
538
+ ```mermaid
539
+ flowchart TD
540
+ Clients["MCP clients<br/>Claude Code, Claude Desktop, Cursor, Windsurf, Codex, Gemini"]
541
+ Gateway["Tool gateway<br/>sdl.query, sdl.code, sdl.repo, sdl.agent"]
542
+ Flat["Flat tools and optional code-mode surfaces"]
543
+ Policy["Policy engine<br/>proof-of-need, budgets, audit logging"]
544
+ Graph["LadybugDB graph<br/>symbols, edges, files, versions, memories"]
545
+ Indexer["Indexer pipeline<br/>Rust native or Tree-sitter fallback<br/>pass 1, pass 2, semantic enrichment"]
546
+
547
+ Clients --> Gateway
548
+ Clients --> Flat
549
+ Gateway --> Policy
550
+ Flat --> Policy
551
+ Policy --> Graph
552
+ Indexer --> Graph
602
553
  ```
603
554
 
604
555
  [Full Architecture Documentation →](./docs/architecture.md)
@@ -614,7 +565,7 @@ A **VSCode extension** (`sdl-mcp-vscode/`) provides live buffer integration for
614
565
  | Document | Description |
615
566
  |:---------|:------------|
616
567
  | [Getting Started](./docs/getting-started.md) | Installation, 5-minute setup, MCP client config |
617
- | [MCP Tools Reference](./docs/mcp-tools-detailed.md) | Detailed docs for all 35 tools (parameters, responses, examples) |
568
+ | [MCP Tools Reference](./docs/mcp-tools-detailed.md) | Detailed docs for all 36 unique tool surfaces (parameters, responses, examples) |
618
569
  | [CLI Reference](./docs/cli-reference.md) | All CLI commands and options |
619
570
  | [Configuration Reference](./docs/configuration-reference.md) | Every config option with defaults and guidance |
620
571
  | [Agent Workflows](./docs/agent-workflows.md) | Workflow instructions for CLAUDE.md / AGENTS.md |
@@ -631,14 +582,15 @@ A **VSCode extension** (`sdl-mcp-vscode/`) provides live buffer integration for
631
582
  | [Delta & Blast Radius](./docs/feature-deep-dives/delta-blast-radius.md) | Semantic diffs, ranked impact analysis, PR risk scoring |
632
583
  | [Live Indexing](./docs/feature-deep-dives/live-indexing.md) | Real-time editor buffer integration and overlay architecture |
633
584
  | [Governance & Policy](./docs/feature-deep-dives/governance-policy.md) | Proof-of-need gating, audit logging, runtime sandboxing |
634
- | [Agent Orchestration](./docs/feature-deep-dives/agent-orchestration.md) | Autopilot mode, feedback loops, portable context summaries |
585
+ | [Agent Context](./docs/feature-deep-dives/agent-context.md) | Task-shaped context retrieval, feedback loops, portable context summaries |
586
+ | [Context Modes](./docs/feature-deep-dives/context-modes.md) | Precise vs broad retrieval, adaptive symbol ranking, benchmark trade-offs |
635
587
  | [Indexing & Languages](./docs/feature-deep-dives/indexing-languages.md) | Rust/TS engines, two-pass architecture, 12-language support |
636
588
  | [Runtime Execution](./docs/feature-deep-dives/runtime-execution.md) | Sandboxed subprocess execution with governance |
637
589
  | [CLI Tool Access](./docs/feature-deep-dives/cli-tool-access.md) | Direct CLI access to all tool actions, output formats, stdin piping, scripting |
638
590
  | [Tool Gateway](./docs/feature-deep-dives/tool-gateway.md) | 35→4 tool consolidation, token reduction, thin schemas, migration guide |
639
591
  | [Semantic Engine](./docs/feature-deep-dives/semantic-engine.md) | Pass-2 call resolution, embedding search, LLM summaries, confidence scoring |
640
592
  | [Semantic Embeddings Setup](./docs/feature-deep-dives/semantic-embeddings-setup.md) | Dependencies, model installation, provider configuration, tier-by-tier setup |
641
- | [Code Mode](./docs/feature-deep-dives/code-mode.md) | Tool chaining (sdl.chain), action discovery, manual reference, one-call workflows |
593
+ | [Code Mode](./docs/feature-deep-dives/code-mode.md) | `sdl.context`, `sdl.workflow`, action discovery, manual reference, one-call workflows |
642
594
  | [Development Memories](./docs/feature-deep-dives/development-memories.md) | Graph-backed cross-session memory, file sync, staleness detection, auto-surfacing |
643
595
  | [Token Savings Meter](./docs/feature-deep-dives/token-savings-meter.md) | Per-call meter, session summaries, lifetime tracking, `sdl.usage.stats` |
644
596
 
@@ -32,7 +32,12 @@
32
32
  "includeNodeModulesTypes": true,
33
33
  "packageJsonPath": null,
34
34
  "tsconfigPath": null,
35
- "workspaceGlobs": null
35
+ "workspaceGlobs": null,
36
+ "memory": {
37
+ "enabled": true,
38
+ "surfacingEnabled": true,
39
+ "fileSyncEnabled": false
40
+ }
36
41
  }
37
42
  ],
38
43
  "graphDatabase": {
@@ -96,7 +101,6 @@
96
101
  },
97
102
  "semantic": {
98
103
  "enabled": true,
99
- "alpha": 0.6,
100
104
  "provider": "local",
101
105
  "model": "all-MiniLM-L6-v2",
102
106
  "modelCacheDir": null,
@@ -107,15 +111,8 @@
107
111
  "summaryApiBaseUrl": null,
108
112
  "summaryMaxConcurrency": 5,
109
113
  "summaryBatchSize": 20,
110
- "ann": {
111
- "enabled": true,
112
- "m": 16,
113
- "efConstruction": 200,
114
- "efSearch": 50,
115
- "maxElements": 200000
116
- },
117
114
  "retrieval": {
118
- "mode": "legacy",
115
+ "mode": "hybrid",
119
116
  "extensionsOptional": true,
120
117
  "fts": {
121
118
  "enabled": true,
@@ -168,10 +165,12 @@
168
165
  "toolQueueTimeoutMs": 30000
169
166
  },
170
167
  "runtime": {
171
- "enabled": false,
168
+ "enabled": true,
172
169
  "allowedRuntimes": [
173
170
  "node",
174
- "python"
171
+ "typescript",
172
+ "python",
173
+ "shell"
175
174
  ],
176
175
  "allowedExecutables": [],
177
176
  "maxDurationMs": 30000,
@@ -185,7 +184,7 @@
185
184
  },
186
185
  "gateway": {
187
186
  "enabled": true,
188
- "emitLegacyTools": true
187
+ "emitLegacyTools": false
189
188
  },
190
189
  "httpAuth": {
191
190
  "enabled": false,
@@ -194,13 +193,16 @@
194
193
  "codeMode": {
195
194
  "enabled": true,
196
195
  "exclusive": true,
197
- "maxChainSteps": 20,
198
- "maxChainTokens": 50000,
199
- "maxChainDurationMs": 60000,
196
+ "maxWorkflowSteps": 20,
197
+ "maxWorkflowTokens": 50000,
198
+ "maxWorkflowDurationMs": 60000,
200
199
  "ladderValidation": "warn",
201
200
  "etagCaching": true
202
201
  },
203
202
  "security": {
204
203
  "allowedRepoRoots": []
204
+ },
205
+ "memory": {
206
+ "enabled": false
205
207
  }
206
208
  }