@vpxa/aikit 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (649) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +1207 -0
  3. package/bin/aikit.mjs +10 -0
  4. package/package.json +92 -0
  5. package/packages/aikit-client/dist/direct-client.d.ts +37 -0
  6. package/packages/aikit-client/dist/direct-client.js +1 -0
  7. package/packages/aikit-client/dist/index.d.ts +5 -0
  8. package/packages/aikit-client/dist/index.js +1 -0
  9. package/packages/aikit-client/dist/mcp-client.d.ts +19 -0
  10. package/packages/aikit-client/dist/mcp-client.js +4 -0
  11. package/packages/aikit-client/dist/parsers.d.ts +35 -0
  12. package/packages/aikit-client/dist/parsers.js +2 -0
  13. package/packages/aikit-client/dist/types.d.ts +62 -0
  14. package/packages/aikit-client/dist/types.js +1 -0
  15. package/packages/analyzers/dist/blast-radius-analyzer.d.ts +19 -0
  16. package/packages/analyzers/dist/blast-radius-analyzer.js +6 -0
  17. package/packages/analyzers/dist/dependency-analyzer.d.ts +32 -0
  18. package/packages/analyzers/dist/dependency-analyzer.js +8 -0
  19. package/packages/analyzers/dist/diagram-generator.d.ts +16 -0
  20. package/packages/analyzers/dist/diagram-generator.js +2 -0
  21. package/packages/analyzers/dist/entry-point-analyzer.d.ts +40 -0
  22. package/packages/analyzers/dist/entry-point-analyzer.js +4 -0
  23. package/packages/analyzers/dist/index.d.ts +12 -0
  24. package/packages/analyzers/dist/index.js +1 -0
  25. package/packages/analyzers/dist/knowledge-producer.d.ts +40 -0
  26. package/packages/analyzers/dist/knowledge-producer.js +26 -0
  27. package/packages/analyzers/dist/pattern-analyzer.d.ts +15 -0
  28. package/packages/analyzers/dist/pattern-analyzer.js +2 -0
  29. package/packages/analyzers/dist/regex-call-graph.d.ts +10 -0
  30. package/packages/analyzers/dist/regex-call-graph.js +1 -0
  31. package/packages/analyzers/dist/structure-analyzer.d.ts +19 -0
  32. package/packages/analyzers/dist/structure-analyzer.js +4 -0
  33. package/packages/analyzers/dist/symbol-analyzer.d.ts +14 -0
  34. package/packages/analyzers/dist/symbol-analyzer.js +9 -0
  35. package/packages/analyzers/dist/ts-call-graph.d.ts +29 -0
  36. package/packages/analyzers/dist/ts-call-graph.js +1 -0
  37. package/packages/analyzers/dist/types.d.ts +110 -0
  38. package/packages/analyzers/dist/types.js +1 -0
  39. package/packages/chunker/dist/call-graph-extractor.d.ts +25 -0
  40. package/packages/chunker/dist/call-graph-extractor.js +1 -0
  41. package/packages/chunker/dist/chunker-factory.d.ts +19 -0
  42. package/packages/chunker/dist/chunker-factory.js +1 -0
  43. package/packages/chunker/dist/chunker.interface.d.ts +13 -0
  44. package/packages/chunker/dist/chunker.interface.js +1 -0
  45. package/packages/chunker/dist/code-chunker.d.ts +17 -0
  46. package/packages/chunker/dist/code-chunker.js +11 -0
  47. package/packages/chunker/dist/extractors/call-extractor.d.ts +24 -0
  48. package/packages/chunker/dist/extractors/call-extractor.js +1 -0
  49. package/packages/chunker/dist/extractors/entry-point-detector.d.ts +14 -0
  50. package/packages/chunker/dist/extractors/entry-point-detector.js +1 -0
  51. package/packages/chunker/dist/extractors/import-extractor.d.ts +14 -0
  52. package/packages/chunker/dist/extractors/import-extractor.js +1 -0
  53. package/packages/chunker/dist/extractors/pattern-detector.d.ts +14 -0
  54. package/packages/chunker/dist/extractors/pattern-detector.js +1 -0
  55. package/packages/chunker/dist/extractors/scope-resolver.d.ts +26 -0
  56. package/packages/chunker/dist/extractors/scope-resolver.js +1 -0
  57. package/packages/chunker/dist/extractors/symbol-extractor.d.ts +14 -0
  58. package/packages/chunker/dist/extractors/symbol-extractor.js +3 -0
  59. package/packages/chunker/dist/extractors/types.d.ts +44 -0
  60. package/packages/chunker/dist/extractors/types.js +1 -0
  61. package/packages/chunker/dist/generic-chunker.d.ts +15 -0
  62. package/packages/chunker/dist/generic-chunker.js +5 -0
  63. package/packages/chunker/dist/index.d.ts +19 -0
  64. package/packages/chunker/dist/index.js +1 -0
  65. package/packages/chunker/dist/markdown-chunker.d.ts +17 -0
  66. package/packages/chunker/dist/markdown-chunker.js +3 -0
  67. package/packages/chunker/dist/wasm/languages.d.ts +18 -0
  68. package/packages/chunker/dist/wasm/languages.js +1 -0
  69. package/packages/chunker/dist/wasm/query-executor.d.ts +70 -0
  70. package/packages/chunker/dist/wasm/query-executor.js +1 -0
  71. package/packages/chunker/dist/wasm/runtime.d.ts +44 -0
  72. package/packages/chunker/dist/wasm/runtime.js +1 -0
  73. package/packages/chunker/dist/wasm/types.d.ts +84 -0
  74. package/packages/chunker/dist/wasm/types.js +1 -0
  75. package/packages/chunker/dist/wasm-chunker.d.ts +23 -0
  76. package/packages/chunker/dist/wasm-chunker.js +6 -0
  77. package/packages/chunker/src/queries/go/calls.scm +11 -0
  78. package/packages/chunker/src/queries/go/entry-points.scm +20 -0
  79. package/packages/chunker/src/queries/go/imports.scm +6 -0
  80. package/packages/chunker/src/queries/go/patterns.scm +25 -0
  81. package/packages/chunker/src/queries/go/symbols.scm +26 -0
  82. package/packages/chunker/src/queries/java/calls.scm +10 -0
  83. package/packages/chunker/src/queries/java/entry-points.scm +27 -0
  84. package/packages/chunker/src/queries/java/imports.scm +11 -0
  85. package/packages/chunker/src/queries/java/patterns.scm +27 -0
  86. package/packages/chunker/src/queries/java/symbols.scm +28 -0
  87. package/packages/chunker/src/queries/javascript/calls.scm +21 -0
  88. package/packages/chunker/src/queries/javascript/entry-points.scm +31 -0
  89. package/packages/chunker/src/queries/javascript/imports.scm +32 -0
  90. package/packages/chunker/src/queries/javascript/patterns.scm +28 -0
  91. package/packages/chunker/src/queries/javascript/symbols.scm +52 -0
  92. package/packages/chunker/src/queries/python/calls.scm +11 -0
  93. package/packages/chunker/src/queries/python/entry-points.scm +21 -0
  94. package/packages/chunker/src/queries/python/imports.scm +14 -0
  95. package/packages/chunker/src/queries/python/patterns.scm +25 -0
  96. package/packages/chunker/src/queries/python/symbols.scm +17 -0
  97. package/packages/chunker/src/queries/rust/calls.scm +20 -0
  98. package/packages/chunker/src/queries/rust/entry-points.scm +7 -0
  99. package/packages/chunker/src/queries/rust/imports.scm +26 -0
  100. package/packages/chunker/src/queries/rust/patterns.scm +18 -0
  101. package/packages/chunker/src/queries/rust/symbols.scm +73 -0
  102. package/packages/chunker/src/queries/typescript/calls.scm +21 -0
  103. package/packages/chunker/src/queries/typescript/entry-points.scm +48 -0
  104. package/packages/chunker/src/queries/typescript/imports.scm +35 -0
  105. package/packages/chunker/src/queries/typescript/patterns.scm +47 -0
  106. package/packages/chunker/src/queries/typescript/symbols.scm +79 -0
  107. package/packages/chunker/wasm/tree-sitter-c.wasm +0 -0
  108. package/packages/chunker/wasm/tree-sitter-c_sharp.wasm +0 -0
  109. package/packages/chunker/wasm/tree-sitter-cpp.wasm +0 -0
  110. package/packages/chunker/wasm/tree-sitter-go.wasm +0 -0
  111. package/packages/chunker/wasm/tree-sitter-java.wasm +0 -0
  112. package/packages/chunker/wasm/tree-sitter-javascript.wasm +0 -0
  113. package/packages/chunker/wasm/tree-sitter-kotlin.wasm +0 -0
  114. package/packages/chunker/wasm/tree-sitter-php.wasm +0 -0
  115. package/packages/chunker/wasm/tree-sitter-python.wasm +0 -0
  116. package/packages/chunker/wasm/tree-sitter-ruby.wasm +0 -0
  117. package/packages/chunker/wasm/tree-sitter-rust.wasm +0 -0
  118. package/packages/chunker/wasm/tree-sitter-scala.wasm +0 -0
  119. package/packages/chunker/wasm/tree-sitter-swift.wasm +0 -0
  120. package/packages/chunker/wasm/tree-sitter-typescript.wasm +0 -0
  121. package/packages/chunker/wasm/tree-sitter.wasm +0 -0
  122. package/packages/cli/dist/aikit-init.d.ts +54 -0
  123. package/packages/cli/dist/aikit-init.js +1 -0
  124. package/packages/cli/dist/commands/analyze.d.ts +6 -0
  125. package/packages/cli/dist/commands/analyze.js +2 -0
  126. package/packages/cli/dist/commands/context-cmds.d.ts +6 -0
  127. package/packages/cli/dist/commands/context-cmds.js +1 -0
  128. package/packages/cli/dist/commands/environment.d.ts +6 -0
  129. package/packages/cli/dist/commands/environment.js +1 -0
  130. package/packages/cli/dist/commands/execution.d.ts +6 -0
  131. package/packages/cli/dist/commands/execution.js +1 -0
  132. package/packages/cli/dist/commands/flow.d.ts +6 -0
  133. package/packages/cli/dist/commands/flow.js +1 -0
  134. package/packages/cli/dist/commands/graph.d.ts +6 -0
  135. package/packages/cli/dist/commands/graph.js +6 -0
  136. package/packages/cli/dist/commands/init/adapters.d.ts +28 -0
  137. package/packages/cli/dist/commands/init/adapters.js +1 -0
  138. package/packages/cli/dist/commands/init/config.d.ts +10 -0
  139. package/packages/cli/dist/commands/init/config.js +3 -0
  140. package/packages/cli/dist/commands/init/constants.d.ts +41 -0
  141. package/packages/cli/dist/commands/init/constants.js +1 -0
  142. package/packages/cli/dist/commands/init/curated.d.ts +7 -0
  143. package/packages/cli/dist/commands/init/curated.js +1 -0
  144. package/packages/cli/dist/commands/init/frontmatter.d.ts +54 -0
  145. package/packages/cli/dist/commands/init/frontmatter.js +2 -0
  146. package/packages/cli/dist/commands/init/index.d.ts +36 -0
  147. package/packages/cli/dist/commands/init/index.js +5 -0
  148. package/packages/cli/dist/commands/init/manifest.d.ts +71 -0
  149. package/packages/cli/dist/commands/init/manifest.js +1 -0
  150. package/packages/cli/dist/commands/init/scaffold.d.ts +46 -0
  151. package/packages/cli/dist/commands/init/scaffold.js +1 -0
  152. package/packages/cli/dist/commands/init/templates.d.ts +9 -0
  153. package/packages/cli/dist/commands/init/templates.js +194 -0
  154. package/packages/cli/dist/commands/init/user.d.ts +61 -0
  155. package/packages/cli/dist/commands/init/user.js +5 -0
  156. package/packages/cli/dist/commands/knowledge.d.ts +6 -0
  157. package/packages/cli/dist/commands/knowledge.js +1 -0
  158. package/packages/cli/dist/commands/search.d.ts +6 -0
  159. package/packages/cli/dist/commands/search.js +1 -0
  160. package/packages/cli/dist/commands/system.d.ts +6 -0
  161. package/packages/cli/dist/commands/system.js +4 -0
  162. package/packages/cli/dist/commands/upgrade.d.ts +6 -0
  163. package/packages/cli/dist/commands/upgrade.js +1 -0
  164. package/packages/cli/dist/commands/workspace.d.ts +6 -0
  165. package/packages/cli/dist/commands/workspace.js +1 -0
  166. package/packages/cli/dist/context.d.ts +7 -0
  167. package/packages/cli/dist/context.js +1 -0
  168. package/packages/cli/dist/helpers.d.ts +55 -0
  169. package/packages/cli/dist/helpers.js +5 -0
  170. package/packages/cli/dist/index.d.ts +10 -0
  171. package/packages/cli/dist/index.js +3 -0
  172. package/packages/cli/dist/types.d.ts +9 -0
  173. package/packages/cli/dist/types.js +1 -0
  174. package/packages/core/dist/constants.d.ts +74 -0
  175. package/packages/core/dist/constants.js +1 -0
  176. package/packages/core/dist/content-detector.d.ts +13 -0
  177. package/packages/core/dist/content-detector.js +1 -0
  178. package/packages/core/dist/errors.d.ts +20 -0
  179. package/packages/core/dist/errors.js +1 -0
  180. package/packages/core/dist/global-registry.d.ts +63 -0
  181. package/packages/core/dist/global-registry.js +1 -0
  182. package/packages/core/dist/index.d.ts +7 -0
  183. package/packages/core/dist/index.js +1 -0
  184. package/packages/core/dist/logger.d.ts +32 -0
  185. package/packages/core/dist/logger.js +1 -0
  186. package/packages/core/dist/types.d.ts +133 -0
  187. package/packages/core/dist/types.js +1 -0
  188. package/packages/dashboard/dist/assets/index-BjA4YODs.js +21 -0
  189. package/packages/dashboard/dist/assets/index-BjA4YODs.js.map +1 -0
  190. package/packages/dashboard/dist/assets/index-CHpVij2M.css +1 -0
  191. package/packages/dashboard/dist/index.html +18 -0
  192. package/packages/elicitation/dist/build.d.ts +14 -0
  193. package/packages/elicitation/dist/build.js +1 -0
  194. package/packages/elicitation/dist/fields.d.ts +32 -0
  195. package/packages/elicitation/dist/fields.js +1 -0
  196. package/packages/elicitation/dist/index.d.ts +5 -0
  197. package/packages/elicitation/dist/index.js +1 -0
  198. package/packages/elicitation/dist/normalize.d.ts +15 -0
  199. package/packages/elicitation/dist/normalize.js +1 -0
  200. package/packages/elicitation/dist/types.d.ts +88 -0
  201. package/packages/elicitation/dist/types.js +1 -0
  202. package/packages/embeddings/dist/embedder.interface.d.ts +26 -0
  203. package/packages/embeddings/dist/embedder.interface.js +1 -0
  204. package/packages/embeddings/dist/index.d.ts +3 -0
  205. package/packages/embeddings/dist/index.js +1 -0
  206. package/packages/embeddings/dist/onnx-embedder.d.ts +22 -0
  207. package/packages/embeddings/dist/onnx-embedder.js +1 -0
  208. package/packages/enterprise-bridge/dist/cache.d.ts +28 -0
  209. package/packages/enterprise-bridge/dist/cache.js +1 -0
  210. package/packages/enterprise-bridge/dist/er-client.d.ts +37 -0
  211. package/packages/enterprise-bridge/dist/er-client.js +1 -0
  212. package/packages/enterprise-bridge/dist/evolution-collector.d.ts +62 -0
  213. package/packages/enterprise-bridge/dist/evolution-collector.js +1 -0
  214. package/packages/enterprise-bridge/dist/index.d.ts +8 -0
  215. package/packages/enterprise-bridge/dist/index.js +1 -0
  216. package/packages/enterprise-bridge/dist/policy-store.d.ts +45 -0
  217. package/packages/enterprise-bridge/dist/policy-store.js +1 -0
  218. package/packages/enterprise-bridge/dist/push-adapter.d.ts +23 -0
  219. package/packages/enterprise-bridge/dist/push-adapter.js +1 -0
  220. package/packages/enterprise-bridge/dist/result-merger.d.ts +14 -0
  221. package/packages/enterprise-bridge/dist/result-merger.js +1 -0
  222. package/packages/enterprise-bridge/dist/types.d.ts +81 -0
  223. package/packages/enterprise-bridge/dist/types.js +1 -0
  224. package/packages/flows/dist/adapters/claude-plugin.d.ts +12 -0
  225. package/packages/flows/dist/adapters/claude-plugin.js +1 -0
  226. package/packages/flows/dist/adapters/copilot.d.ts +10 -0
  227. package/packages/flows/dist/adapters/copilot.js +1 -0
  228. package/packages/flows/dist/adapters/index.d.ts +11 -0
  229. package/packages/flows/dist/adapters/index.js +1 -0
  230. package/packages/flows/dist/adapters/native.d.ts +10 -0
  231. package/packages/flows/dist/adapters/native.js +1 -0
  232. package/packages/flows/dist/builtins.d.ts +16 -0
  233. package/packages/flows/dist/builtins.js +1 -0
  234. package/packages/flows/dist/foundation.d.ts +20 -0
  235. package/packages/flows/dist/foundation.js +11 -0
  236. package/packages/flows/dist/git.d.ts +34 -0
  237. package/packages/flows/dist/git.js +1 -0
  238. package/packages/flows/dist/index.d.ts +12 -0
  239. package/packages/flows/dist/index.js +1 -0
  240. package/packages/flows/dist/loader.d.ts +13 -0
  241. package/packages/flows/dist/loader.js +2 -0
  242. package/packages/flows/dist/registry.d.ts +23 -0
  243. package/packages/flows/dist/registry.js +1 -0
  244. package/packages/flows/dist/state-machine.d.ts +23 -0
  245. package/packages/flows/dist/state-machine.js +1 -0
  246. package/packages/flows/dist/symlinks.d.ts +17 -0
  247. package/packages/flows/dist/symlinks.js +1 -0
  248. package/packages/flows/dist/types.d.ts +112 -0
  249. package/packages/flows/dist/types.js +1 -0
  250. package/packages/indexer/dist/file-hasher.d.ts +13 -0
  251. package/packages/indexer/dist/file-hasher.js +1 -0
  252. package/packages/indexer/dist/filesystem-crawler.d.ts +29 -0
  253. package/packages/indexer/dist/filesystem-crawler.js +1 -0
  254. package/packages/indexer/dist/graph-extractor.d.ts +18 -0
  255. package/packages/indexer/dist/graph-extractor.js +1 -0
  256. package/packages/indexer/dist/hash-cache.d.ts +24 -0
  257. package/packages/indexer/dist/hash-cache.js +1 -0
  258. package/packages/indexer/dist/incremental-indexer.d.ts +56 -0
  259. package/packages/indexer/dist/incremental-indexer.js +1 -0
  260. package/packages/indexer/dist/index.d.ts +6 -0
  261. package/packages/indexer/dist/index.js +1 -0
  262. package/packages/present/dist/index.html +709 -0
  263. package/packages/server/dist/api.d.ts +3 -0
  264. package/packages/server/dist/api.js +1 -0
  265. package/packages/server/dist/auto-gc.d.ts +30 -0
  266. package/packages/server/dist/auto-gc.js +1 -0
  267. package/packages/server/dist/completions.d.ts +14 -0
  268. package/packages/server/dist/completions.js +1 -0
  269. package/packages/server/dist/config.d.ts +14 -0
  270. package/packages/server/dist/config.js +1 -0
  271. package/packages/server/dist/cross-workspace.d.ts +43 -0
  272. package/packages/server/dist/cross-workspace.js +1 -0
  273. package/packages/server/dist/curated-manager.d.ts +92 -0
  274. package/packages/server/dist/curated-manager.js +5 -0
  275. package/packages/server/dist/dashboard-static.d.ts +27 -0
  276. package/packages/server/dist/dashboard-static.js +1 -0
  277. package/packages/server/dist/elicitor.d.ts +18 -0
  278. package/packages/server/dist/elicitor.js +1 -0
  279. package/packages/server/dist/index.d.ts +1 -0
  280. package/packages/server/dist/index.js +1 -0
  281. package/packages/server/dist/mcp-logging.d.ts +11 -0
  282. package/packages/server/dist/mcp-logging.js +1 -0
  283. package/packages/server/dist/output-schemas.d.ts +242 -0
  284. package/packages/server/dist/output-schemas.js +1 -0
  285. package/packages/server/dist/prompts.d.ts +13 -0
  286. package/packages/server/dist/prompts.js +13 -0
  287. package/packages/server/dist/replay-interceptor.d.ts +23 -0
  288. package/packages/server/dist/replay-interceptor.js +1 -0
  289. package/packages/server/dist/resource-links.d.ts +34 -0
  290. package/packages/server/dist/resource-links.js +1 -0
  291. package/packages/server/dist/resources/curated-resources.d.ts +13 -0
  292. package/packages/server/dist/resources/curated-resources.js +2 -0
  293. package/packages/server/dist/resources/resource-notifier.d.ts +45 -0
  294. package/packages/server/dist/resources/resource-notifier.js +1 -0
  295. package/packages/server/dist/resources/resources.d.ts +8 -0
  296. package/packages/server/dist/resources/resources.js +2 -0
  297. package/packages/server/dist/sampling.d.ts +41 -0
  298. package/packages/server/dist/sampling.js +2 -0
  299. package/packages/server/dist/server.d.ts +47 -0
  300. package/packages/server/dist/server.js +3 -0
  301. package/packages/server/dist/structured-content-guard.d.ts +26 -0
  302. package/packages/server/dist/structured-content-guard.js +1 -0
  303. package/packages/server/dist/task-manager.d.ts +40 -0
  304. package/packages/server/dist/task-manager.js +1 -0
  305. package/packages/server/dist/tool-metadata.d.ts +38 -0
  306. package/packages/server/dist/tool-metadata.js +1 -0
  307. package/packages/server/dist/tool-prefix.d.ts +12 -0
  308. package/packages/server/dist/tool-prefix.js +1 -0
  309. package/packages/server/dist/tools/analyze.tools.d.ts +14 -0
  310. package/packages/server/dist/tools/analyze.tools.js +8 -0
  311. package/packages/server/dist/tools/audit.tool.d.ts +8 -0
  312. package/packages/server/dist/tools/audit.tool.js +1 -0
  313. package/packages/server/dist/tools/brainstorm.tool.d.ts +7 -0
  314. package/packages/server/dist/tools/brainstorm.tool.js +9 -0
  315. package/packages/server/dist/tools/bridge.tools.d.ts +34 -0
  316. package/packages/server/dist/tools/bridge.tools.js +15 -0
  317. package/packages/server/dist/tools/context.tools.d.ts +15 -0
  318. package/packages/server/dist/tools/context.tools.js +10 -0
  319. package/packages/server/dist/tools/evolution.tools.d.ts +7 -0
  320. package/packages/server/dist/tools/evolution.tools.js +5 -0
  321. package/packages/server/dist/tools/execution.tools.d.ts +14 -0
  322. package/packages/server/dist/tools/execution.tools.js +4 -0
  323. package/packages/server/dist/tools/flow.tools.d.ts +7 -0
  324. package/packages/server/dist/tools/flow.tools.js +1 -0
  325. package/packages/server/dist/tools/forge.tools.d.ts +13 -0
  326. package/packages/server/dist/tools/forge.tools.js +10 -0
  327. package/packages/server/dist/tools/forget.tool.d.ts +8 -0
  328. package/packages/server/dist/tools/forget.tool.js +1 -0
  329. package/packages/server/dist/tools/graph.tool.d.ts +7 -0
  330. package/packages/server/dist/tools/graph.tool.js +5 -0
  331. package/packages/server/dist/tools/infra.tools.d.ts +10 -0
  332. package/packages/server/dist/tools/infra.tools.js +5 -0
  333. package/packages/server/dist/tools/list.tool.d.ts +7 -0
  334. package/packages/server/dist/tools/list.tool.js +2 -0
  335. package/packages/server/dist/tools/lookup.tool.d.ts +7 -0
  336. package/packages/server/dist/tools/lookup.tool.js +3 -0
  337. package/packages/server/dist/tools/manipulation.tools.d.ts +10 -0
  338. package/packages/server/dist/tools/manipulation.tools.js +4 -0
  339. package/packages/server/dist/tools/onboard.tool.d.ts +9 -0
  340. package/packages/server/dist/tools/onboard.tool.js +2 -0
  341. package/packages/server/dist/tools/persistence.tools.d.ts +10 -0
  342. package/packages/server/dist/tools/persistence.tools.js +5 -0
  343. package/packages/server/dist/tools/policy.tools.d.ts +7 -0
  344. package/packages/server/dist/tools/policy.tools.js +3 -0
  345. package/packages/server/dist/tools/present/browser.d.ts +4 -0
  346. package/packages/server/dist/tools/present/browser.js +93 -0
  347. package/packages/server/dist/tools/present/helpers.d.ts +18 -0
  348. package/packages/server/dist/tools/present/helpers.js +1 -0
  349. package/packages/server/dist/tools/present/html.d.ts +18 -0
  350. package/packages/server/dist/tools/present/html.js +5 -0
  351. package/packages/server/dist/tools/present/index.d.ts +2 -0
  352. package/packages/server/dist/tools/present/index.js +1 -0
  353. package/packages/server/dist/tools/present/markdown.d.ts +17 -0
  354. package/packages/server/dist/tools/present/markdown.js +8 -0
  355. package/packages/server/dist/tools/present/templates.d.ts +14 -0
  356. package/packages/server/dist/tools/present/templates.js +472 -0
  357. package/packages/server/dist/tools/present/tool.d.ts +27 -0
  358. package/packages/server/dist/tools/present/tool.js +19 -0
  359. package/packages/server/dist/tools/present-blocks.d.ts +46 -0
  360. package/packages/server/dist/tools/present-blocks.js +27 -0
  361. package/packages/server/dist/tools/present-charts.d.ts +31 -0
  362. package/packages/server/dist/tools/present-charts.js +34 -0
  363. package/packages/server/dist/tools/present-theme.d.ts +14 -0
  364. package/packages/server/dist/tools/present-theme.js +395 -0
  365. package/packages/server/dist/tools/present-utils.d.ts +11 -0
  366. package/packages/server/dist/tools/present-utils.js +1 -0
  367. package/packages/server/dist/tools/present.tool.d.ts +2 -0
  368. package/packages/server/dist/tools/present.tool.js +1 -0
  369. package/packages/server/dist/tools/produce.tool.d.ts +7 -0
  370. package/packages/server/dist/tools/produce.tool.js +4 -0
  371. package/packages/server/dist/tools/read.tool.d.ts +7 -0
  372. package/packages/server/dist/tools/read.tool.js +2 -0
  373. package/packages/server/dist/tools/reindex.tool.d.ts +11 -0
  374. package/packages/server/dist/tools/reindex.tool.js +3 -0
  375. package/packages/server/dist/tools/remember.tool.d.ts +9 -0
  376. package/packages/server/dist/tools/remember.tool.js +4 -0
  377. package/packages/server/dist/tools/replay.tool.d.ts +6 -0
  378. package/packages/server/dist/tools/replay.tool.js +3 -0
  379. package/packages/server/dist/tools/restore.tool.d.ts +6 -0
  380. package/packages/server/dist/tools/restore.tool.js +3 -0
  381. package/packages/server/dist/tools/search.tool.d.ts +11 -0
  382. package/packages/server/dist/tools/search.tool.js +10 -0
  383. package/packages/server/dist/tools/status.tool.d.ts +20 -0
  384. package/packages/server/dist/tools/status.tool.js +3 -0
  385. package/packages/server/dist/tools/update.tool.d.ts +8 -0
  386. package/packages/server/dist/tools/update.tool.js +1 -0
  387. package/packages/server/dist/tools/utility.tools.d.ts +15 -0
  388. package/packages/server/dist/tools/utility.tools.js +13 -0
  389. package/packages/server/dist/version-check.d.ts +32 -0
  390. package/packages/server/dist/version-check.js +1 -0
  391. package/packages/store/dist/graph-store.interface.d.ts +118 -0
  392. package/packages/store/dist/graph-store.interface.js +1 -0
  393. package/packages/store/dist/index.d.ts +6 -0
  394. package/packages/store/dist/index.js +1 -0
  395. package/packages/store/dist/lance-store.d.ts +44 -0
  396. package/packages/store/dist/lance-store.js +1 -0
  397. package/packages/store/dist/sqlite-graph-store.d.ts +45 -0
  398. package/packages/store/dist/sqlite-graph-store.js +58 -0
  399. package/packages/store/dist/store-factory.d.ts +12 -0
  400. package/packages/store/dist/store-factory.js +1 -0
  401. package/packages/store/dist/store.interface.d.ts +54 -0
  402. package/packages/store/dist/store.interface.js +1 -0
  403. package/packages/tools/dist/audit.d.ts +65 -0
  404. package/packages/tools/dist/audit.js +6 -0
  405. package/packages/tools/dist/batch.d.ts +23 -0
  406. package/packages/tools/dist/batch.js +1 -0
  407. package/packages/tools/dist/changelog.d.ts +36 -0
  408. package/packages/tools/dist/changelog.js +2 -0
  409. package/packages/tools/dist/check.d.ts +48 -0
  410. package/packages/tools/dist/check.js +2 -0
  411. package/packages/tools/dist/checkpoint.d.ts +19 -0
  412. package/packages/tools/dist/checkpoint.js +1 -0
  413. package/packages/tools/dist/codemod.d.ts +39 -0
  414. package/packages/tools/dist/codemod.js +2 -0
  415. package/packages/tools/dist/compact.d.ts +41 -0
  416. package/packages/tools/dist/compact.js +3 -0
  417. package/packages/tools/dist/config-extractor.d.ts +9 -0
  418. package/packages/tools/dist/config-extractor.js +7 -0
  419. package/packages/tools/dist/data-transform.d.ts +12 -0
  420. package/packages/tools/dist/data-transform.js +1 -0
  421. package/packages/tools/dist/dead-symbols.d.ts +28 -0
  422. package/packages/tools/dist/dead-symbols.js +2 -0
  423. package/packages/tools/dist/delegate.d.ts +36 -0
  424. package/packages/tools/dist/delegate.js +1 -0
  425. package/packages/tools/dist/diagram-builder.d.ts +9 -0
  426. package/packages/tools/dist/diagram-builder.js +9 -0
  427. package/packages/tools/dist/diff-parse.d.ts +28 -0
  428. package/packages/tools/dist/diff-parse.js +3 -0
  429. package/packages/tools/dist/digest.d.ts +50 -0
  430. package/packages/tools/dist/digest.js +6 -0
  431. package/packages/tools/dist/dogfood-log.d.ts +49 -0
  432. package/packages/tools/dist/dogfood-log.js +2 -0
  433. package/packages/tools/dist/encode.d.ts +16 -0
  434. package/packages/tools/dist/encode.js +1 -0
  435. package/packages/tools/dist/env-info.d.ts +30 -0
  436. package/packages/tools/dist/env-info.js +1 -0
  437. package/packages/tools/dist/eval.d.ts +15 -0
  438. package/packages/tools/dist/eval.js +2 -0
  439. package/packages/tools/dist/evidence-map.d.ts +92 -0
  440. package/packages/tools/dist/evidence-map.js +2 -0
  441. package/packages/tools/dist/file-cache.d.ts +41 -0
  442. package/packages/tools/dist/file-cache.js +3 -0
  443. package/packages/tools/dist/file-summary.d.ts +52 -0
  444. package/packages/tools/dist/file-summary.js +2 -0
  445. package/packages/tools/dist/file-walk.d.ts +6 -0
  446. package/packages/tools/dist/file-walk.js +1 -0
  447. package/packages/tools/dist/find-examples.d.ts +29 -0
  448. package/packages/tools/dist/find-examples.js +3 -0
  449. package/packages/tools/dist/find.d.ts +49 -0
  450. package/packages/tools/dist/find.js +1 -0
  451. package/packages/tools/dist/forge-classify.d.ts +44 -0
  452. package/packages/tools/dist/forge-classify.js +2 -0
  453. package/packages/tools/dist/forge-ground.d.ts +61 -0
  454. package/packages/tools/dist/forge-ground.js +1 -0
  455. package/packages/tools/dist/git-context.d.ts +25 -0
  456. package/packages/tools/dist/git-context.js +3 -0
  457. package/packages/tools/dist/graph-query.d.ts +86 -0
  458. package/packages/tools/dist/graph-query.js +1 -0
  459. package/packages/tools/dist/guide.d.ts +25 -0
  460. package/packages/tools/dist/guide.js +1 -0
  461. package/packages/tools/dist/health.d.ts +16 -0
  462. package/packages/tools/dist/health.js +2 -0
  463. package/packages/tools/dist/http-request.d.ts +25 -0
  464. package/packages/tools/dist/http-request.js +1 -0
  465. package/packages/tools/dist/index.d.ts +57 -0
  466. package/packages/tools/dist/index.js +1 -0
  467. package/packages/tools/dist/lane.d.ts +41 -0
  468. package/packages/tools/dist/lane.js +6 -0
  469. package/packages/tools/dist/measure.d.ts +42 -0
  470. package/packages/tools/dist/measure.js +2 -0
  471. package/packages/tools/dist/onboard-utils.d.ts +12 -0
  472. package/packages/tools/dist/onboard-utils.js +1 -0
  473. package/packages/tools/dist/onboard.d.ts +50 -0
  474. package/packages/tools/dist/onboard.js +18 -0
  475. package/packages/tools/dist/parse-output.d.ts +82 -0
  476. package/packages/tools/dist/parse-output.js +2 -0
  477. package/packages/tools/dist/path-resolver.d.ts +14 -0
  478. package/packages/tools/dist/path-resolver.js +1 -0
  479. package/packages/tools/dist/process-manager.d.ts +20 -0
  480. package/packages/tools/dist/process-manager.js +1 -0
  481. package/packages/tools/dist/queue.d.ts +40 -0
  482. package/packages/tools/dist/queue.js +1 -0
  483. package/packages/tools/dist/regex-test.d.ts +33 -0
  484. package/packages/tools/dist/regex-test.js +1 -0
  485. package/packages/tools/dist/regex-utils.d.ts +8 -0
  486. package/packages/tools/dist/regex-utils.js +1 -0
  487. package/packages/tools/dist/rename.d.ts +31 -0
  488. package/packages/tools/dist/rename.js +2 -0
  489. package/packages/tools/dist/replay.d.ts +59 -0
  490. package/packages/tools/dist/replay.js +4 -0
  491. package/packages/tools/dist/response-envelope.d.ts +43 -0
  492. package/packages/tools/dist/response-envelope.js +1 -0
  493. package/packages/tools/dist/restore-points.d.ts +22 -0
  494. package/packages/tools/dist/restore-points.js +1 -0
  495. package/packages/tools/dist/schema-validate.d.ts +25 -0
  496. package/packages/tools/dist/schema-validate.js +1 -0
  497. package/packages/tools/dist/scope-map.d.ts +51 -0
  498. package/packages/tools/dist/scope-map.js +1 -0
  499. package/packages/tools/dist/snippet.d.ts +35 -0
  500. package/packages/tools/dist/snippet.js +1 -0
  501. package/packages/tools/dist/stash.d.ts +14 -0
  502. package/packages/tools/dist/stash.js +1 -0
  503. package/packages/tools/dist/stratum-card.d.ts +30 -0
  504. package/packages/tools/dist/stratum-card.js +4 -0
  505. package/packages/tools/dist/symbol.d.ts +45 -0
  506. package/packages/tools/dist/symbol.js +3 -0
  507. package/packages/tools/dist/synthesis-engine.d.ts +13 -0
  508. package/packages/tools/dist/synthesis-engine.js +6 -0
  509. package/packages/tools/dist/test-run.d.ts +28 -0
  510. package/packages/tools/dist/test-run.js +2 -0
  511. package/packages/tools/dist/text-utils.d.ts +24 -0
  512. package/packages/tools/dist/text-utils.js +2 -0
  513. package/packages/tools/dist/time-utils.d.ts +20 -0
  514. package/packages/tools/dist/time-utils.js +1 -0
  515. package/packages/tools/dist/trace.d.ts +29 -0
  516. package/packages/tools/dist/trace.js +2 -0
  517. package/packages/tools/dist/truncation.d.ts +33 -0
  518. package/packages/tools/dist/truncation.js +7 -0
  519. package/packages/tools/dist/watch.d.ts +32 -0
  520. package/packages/tools/dist/watch.js +1 -0
  521. package/packages/tools/dist/web-fetch.d.ts +47 -0
  522. package/packages/tools/dist/web-fetch.js +8 -0
  523. package/packages/tools/dist/web-search.d.ts +25 -0
  524. package/packages/tools/dist/web-search.js +1 -0
  525. package/packages/tools/dist/workset.d.ts +47 -0
  526. package/packages/tools/dist/workset.js +1 -0
  527. package/packages/tui/dist/App-DU2KEylW.js +2 -0
  528. package/packages/tui/dist/App.d.ts +13 -0
  529. package/packages/tui/dist/App.js +2 -0
  530. package/packages/tui/dist/CuratedPanel-BIamXLNy.js +2 -0
  531. package/packages/tui/dist/LogPanel-Bo8a8QXB.js +3 -0
  532. package/packages/tui/dist/SearchPanel-CpJGczAc.js +2 -0
  533. package/packages/tui/dist/StatusPanel-BAbUxyqQ.js +2 -0
  534. package/packages/tui/dist/chunk-D6axbAb-.js +2 -0
  535. package/packages/tui/dist/devtools-DMOZMn70.js +7 -0
  536. package/packages/tui/dist/hooks/useKBClient.d.ts +9 -0
  537. package/packages/tui/dist/hooks/useKBClient.js +2 -0
  538. package/packages/tui/dist/hooks/usePolling.d.ts +8 -0
  539. package/packages/tui/dist/hooks/usePolling.js +2 -0
  540. package/packages/tui/dist/index-BXafekwr.d.ts +64 -0
  541. package/packages/tui/dist/index.d.ts +7 -0
  542. package/packages/tui/dist/index.js +2 -0
  543. package/packages/tui/dist/jsx-runtime-y6Gdq5PZ.js +294 -0
  544. package/packages/tui/dist/panels/CuratedPanel.d.ts +7 -0
  545. package/packages/tui/dist/panels/CuratedPanel.js +2 -0
  546. package/packages/tui/dist/panels/LogPanel.d.ts +7 -0
  547. package/packages/tui/dist/panels/LogPanel.js +2 -0
  548. package/packages/tui/dist/panels/SearchPanel.d.ts +7 -0
  549. package/packages/tui/dist/panels/SearchPanel.js +2 -0
  550. package/packages/tui/dist/panels/StatusPanel.d.ts +7 -0
  551. package/packages/tui/dist/panels/StatusPanel.js +2 -0
  552. package/packages/tui/dist/react-D__J1GQe.js +24 -0
  553. package/packages/tui/dist/useKBClient-C35iA4uG.js +2 -0
  554. package/packages/tui/dist/usePolling-BbjnRWgx.js +2 -0
  555. package/scaffold/README.md +192 -0
  556. package/scaffold/adapters/claude-code.mjs +56 -0
  557. package/scaffold/adapters/copilot.mjs +270 -0
  558. package/scaffold/definitions/agents.mjs +189 -0
  559. package/scaffold/definitions/bodies.mjs +487 -0
  560. package/scaffold/definitions/hooks.mjs +43 -0
  561. package/scaffold/definitions/models.mjs +56 -0
  562. package/scaffold/definitions/plugins.mjs +38 -0
  563. package/scaffold/definitions/prompts.mjs +145 -0
  564. package/scaffold/definitions/protocols.mjs +679 -0
  565. package/scaffold/definitions/tools.mjs +229 -0
  566. package/scaffold/flows/aikit-advanced/flow.json +60 -0
  567. package/scaffold/flows/aikit-advanced/skills/execute/SKILL.md +124 -0
  568. package/scaffold/flows/aikit-advanced/skills/plan/SKILL.md +100 -0
  569. package/scaffold/flows/aikit-advanced/skills/spec/SKILL.md +100 -0
  570. package/scaffold/flows/aikit-advanced/skills/task/SKILL.md +99 -0
  571. package/scaffold/flows/aikit-advanced/skills/verify/SKILL.md +122 -0
  572. package/scaffold/flows/aikit-basic/flow.json +36 -0
  573. package/scaffold/flows/aikit-basic/skills/assess/SKILL.md +82 -0
  574. package/scaffold/flows/aikit-basic/skills/implement/SKILL.md +105 -0
  575. package/scaffold/flows/aikit-basic/skills/verify/SKILL.md +96 -0
  576. package/scaffold/general/agents/Architect-Reviewer-Alpha.agent.md +21 -0
  577. package/scaffold/general/agents/Architect-Reviewer-Beta.agent.md +21 -0
  578. package/scaffold/general/agents/Code-Reviewer-Alpha.agent.md +12 -0
  579. package/scaffold/general/agents/Code-Reviewer-Beta.agent.md +12 -0
  580. package/scaffold/general/agents/Debugger.agent.md +34 -0
  581. package/scaffold/general/agents/Documenter.agent.md +53 -0
  582. package/scaffold/general/agents/Explorer.agent.md +63 -0
  583. package/scaffold/general/agents/Frontend.agent.md +29 -0
  584. package/scaffold/general/agents/Implementer.agent.md +33 -0
  585. package/scaffold/general/agents/Orchestrator.agent.md +149 -0
  586. package/scaffold/general/agents/Planner.agent.md +79 -0
  587. package/scaffold/general/agents/README.md +57 -0
  588. package/scaffold/general/agents/Refactor.agent.md +36 -0
  589. package/scaffold/general/agents/Researcher-Alpha.agent.md +20 -0
  590. package/scaffold/general/agents/Researcher-Beta.agent.md +20 -0
  591. package/scaffold/general/agents/Researcher-Delta.agent.md +20 -0
  592. package/scaffold/general/agents/Researcher-Gamma.agent.md +20 -0
  593. package/scaffold/general/agents/Security.agent.md +55 -0
  594. package/scaffold/general/agents/_shared/architect-reviewer-base.md +60 -0
  595. package/scaffold/general/agents/_shared/code-agent-base.md +262 -0
  596. package/scaffold/general/agents/_shared/code-reviewer-base.md +64 -0
  597. package/scaffold/general/agents/_shared/decision-protocol.md +27 -0
  598. package/scaffold/general/agents/_shared/forge-protocol.md +90 -0
  599. package/scaffold/general/agents/_shared/researcher-base.md +101 -0
  600. package/scaffold/general/agents/templates/adr-template.md +28 -0
  601. package/scaffold/general/agents/templates/execution-state.md +26 -0
  602. package/scaffold/general/prompts/ask.prompt.md +21 -0
  603. package/scaffold/general/prompts/debug.prompt.md +25 -0
  604. package/scaffold/general/prompts/design.prompt.md +23 -0
  605. package/scaffold/general/prompts/implement.prompt.md +26 -0
  606. package/scaffold/general/prompts/plan.prompt.md +25 -0
  607. package/scaffold/general/prompts/review.prompt.md +32 -0
  608. package/scaffold/general/skills/adr-skill/SKILL.md +329 -0
  609. package/scaffold/general/skills/adr-skill/assets/templates/adr-madr.md +89 -0
  610. package/scaffold/general/skills/adr-skill/assets/templates/adr-readme.md +20 -0
  611. package/scaffold/general/skills/adr-skill/assets/templates/adr-simple.md +46 -0
  612. package/scaffold/general/skills/adr-skill/references/adr-conventions.md +95 -0
  613. package/scaffold/general/skills/adr-skill/references/examples.md +193 -0
  614. package/scaffold/general/skills/adr-skill/references/review-checklist.md +77 -0
  615. package/scaffold/general/skills/adr-skill/references/template-variants.md +52 -0
  616. package/scaffold/general/skills/adr-skill/scripts/bootstrap_adr.js +259 -0
  617. package/scaffold/general/skills/adr-skill/scripts/new_adr.js +391 -0
  618. package/scaffold/general/skills/adr-skill/scripts/set_adr_status.js +169 -0
  619. package/scaffold/general/skills/aikit/SKILL.md +521 -0
  620. package/scaffold/general/skills/brainstorming/SKILL.md +259 -0
  621. package/scaffold/general/skills/brainstorming/scripts/frame-template.html +365 -0
  622. package/scaffold/general/skills/brainstorming/scripts/helper.js +216 -0
  623. package/scaffold/general/skills/brainstorming/scripts/server.cjs +9 -0
  624. package/scaffold/general/skills/brainstorming/scripts/server.src.cjs +249 -0
  625. package/scaffold/general/skills/brainstorming/spec-document-reviewer-prompt.md +49 -0
  626. package/scaffold/general/skills/brainstorming/visual-companion.md +430 -0
  627. package/scaffold/general/skills/c4-architecture/SKILL.md +295 -0
  628. package/scaffold/general/skills/c4-architecture/references/advanced-patterns.md +552 -0
  629. package/scaffold/general/skills/c4-architecture/references/c4-syntax.md +492 -0
  630. package/scaffold/general/skills/c4-architecture/references/common-mistakes.md +437 -0
  631. package/scaffold/general/skills/lesson-learned/SKILL.md +105 -0
  632. package/scaffold/general/skills/lesson-learned/references/anti-patterns.md +55 -0
  633. package/scaffold/general/skills/lesson-learned/references/se-principles.md +109 -0
  634. package/scaffold/general/skills/multi-agents-development/SKILL.md +435 -0
  635. package/scaffold/general/skills/multi-agents-development/architecture-review-prompt.md +81 -0
  636. package/scaffold/general/skills/multi-agents-development/code-quality-review-prompt.md +91 -0
  637. package/scaffold/general/skills/multi-agents-development/implementer-prompt.md +93 -0
  638. package/scaffold/general/skills/multi-agents-development/parallel-dispatch-example.md +167 -0
  639. package/scaffold/general/skills/multi-agents-development/spec-review-prompt.md +81 -0
  640. package/scaffold/general/skills/present/SKILL.md +424 -0
  641. package/scaffold/general/skills/requirements-clarity/SKILL.md +324 -0
  642. package/scaffold/general/skills/session-handoff/SKILL.md +189 -0
  643. package/scaffold/general/skills/session-handoff/references/handoff-template.md +139 -0
  644. package/scaffold/general/skills/session-handoff/references/resume-checklist.md +80 -0
  645. package/scaffold/general/skills/session-handoff/scripts/check_staleness.js +269 -0
  646. package/scaffold/general/skills/session-handoff/scripts/create_handoff.js +299 -0
  647. package/scaffold/general/skills/session-handoff/scripts/list_handoffs.js +113 -0
  648. package/scaffold/general/skills/session-handoff/scripts/validate_handoff.js +241 -0
  649. package/scaffold/generate.mjs +82 -0
package/README.md ADDED
@@ -0,0 +1,1207 @@
1
+ # @vpxa/aikit
2
+
3
+ Local-first AI developer toolkit — knowledge base, code analysis, context management, and developer tools for LLM agents.
4
+
5
+ ## Features
6
+
7
+ - **67 MCP tools** for AI agents to search, analyze, and manipulate codebases
8
+ - **47 CLI commands** for shell-based interaction
9
+ - **Local-first** — ONNX embeddings, LanceDB vector store, no cloud dependencies
10
+ - **Three interfaces**: MCP (for agent IDEs), CLI (for terminal agents), and programmatic API
11
+
12
+ ## What This Is
13
+
14
+ This is an **MCP (Model Context Protocol) server** that gives AI agents:
15
+
16
+ 1. **Hybrid search** — combines semantic vector search with full-text keyword search (BM25) using Reciprocal Rank Fusion (RRF) for best results. Supports `hybrid` (default), `semantic`, and `keyword` modes.
17
+ 2. **Persistent curated memory** — agents can `remember`, `update`, `read`, `list`, and `forget` knowledge entries that survive across sessions
18
+ 3. **Codebase analysis** — structural analysis, dependency graphs with confidence scoring, symbol extraction, pattern detection, and Mermaid diagram generation. Analysis results are auto-persisted into the vector store for future search.
19
+ 4. **Knowledge production** — automated analysis pipelines that produce structured baselines for the agent to synthesize and store
20
+ 5. **Next-step workflow hints** — every tool response includes contextual `_Next:` suggestions guiding the agent to logical follow-up actions
21
+ 6. **Tree-sitter code chunking** — AST-based chunking for TS/JS/Python/Go/Rust/Java preserves function/class boundaries for higher-quality code search
22
+ 7. **Knowledge graph** — auto-populated SQLite graph of modules, symbols, and import relationships with traversal, neighbor queries, and change impact tracking
23
+ 8. **Graph auto-population** — during indexing, a lightweight regex extractor builds the knowledge graph automatically from TS/JS source files (functions, classes, interfaces, types, imports)
24
+ 9. **Optimized reindex** — full reindex skips redundant hash checks, batches graph writes (flush every 50 files), and skips per-file graph deletes when bulk-cleared
25
+
26
+ The KB auto-indexes configured source directories on startup, stores embeddings in a local LanceDB vector store, and exposes everything through 67 MCP tools, 45 CLI commands, and 2 resources.
27
+
28
+ ---
29
+
30
+ ## Quick Start
31
+
32
+ ### User-Level Install (recommended for multi-project setups)
33
+
34
+ ```bash
35
+ # Install once, works across all your projects
36
+ npx @vpxa/aikit init --user
37
+
38
+ # Then in any workspace, scaffold instructions only
39
+ npx @vpxa/aikit init
40
+ ```
41
+
42
+ ### Workspace Install (per-project, self-contained)
43
+
44
+ ```bash
45
+ # Full workspace initialization
46
+ npx @vpxa/aikit init --workspace
47
+
48
+ # Index and search
49
+ npx @vpxa/aikit reindex
50
+ npx @vpxa/aikit search "authentication middleware"
51
+ npx @vpxa/aikit serve
52
+ ```
53
+
54
+ ### After upgrading
55
+
56
+ ```bash
57
+ npx @vpxa/aikit init --force # Overwrite all scaffold/skill files
58
+ npx @vpxa/aikit init --guide # Check which files are outdated
59
+ ```
60
+
61
+ > **Note:** In workspace mode, once `@vpxa/aikit` is installed locally, you can use the short `aikit` command (e.g. `aikit search`, `aikit serve`) since the local binary takes precedence.
62
+
63
+ ## User-Level vs Workspace Mode
64
+
65
+ KB supports two installation modes:
66
+
67
+ | | User-Level | Workspace |
68
+ |---|---|---|
69
+ | **Install** | `aikit init --user` (once) | `aikit init --workspace` (per project) |
70
+ | **MCP config** | User-level (IDE-wide) | `.vscode/mcp.json` (workspace) |
71
+ | **Data store** | `~/.aikit-data/<partition>/` | `.aikit-data/store/` (in project) |
72
+ | **Skills** | `~/.aikit-data/skills/` | `.github/skills/` (in project) |
73
+ | **Config** | Auto defaults per workspace | `kb.config.json` (in project) |
74
+
75
+ ### How it works
76
+
77
+ - **`aikit init --user`** — Installs the MCP server in your user-level IDE config (VS Code, Cursor, Claude Code, Windsurf). Creates `~/.aikit-data/` for data. Skills are shared. The server auto-indexes each workspace it's opened in.
78
+ - **`aikit init`** (smart default) — If user-level is installed, scaffolds workspace-only files (AGENTS.md, instructions, curated directories). If not, does a full workspace install.
79
+ - **`aikit init --workspace`** — Traditional per-project install with full local config and data store.
80
+
81
+ ### Checking your mode
82
+
83
+ ```bash
84
+ aikit status
85
+ # Mode: user (workspace scaffolded)
86
+ # Data: ~/.aikit-data/my-project-a1b2c3d4/
87
+ # Registry: 3 workspace(s) enrolled
88
+ ```
89
+
90
+ ### Cross-workspace search (user-level mode only)
91
+
92
+ ```
93
+ search({ query: "error handling", workspaces: ["*"] }) # All workspaces
94
+ search({ query: "CircuitBreaker", workspaces: ["other-project"] }) # Specific workspace
95
+ symbol({ name: "MyService", workspaces: ["*"] }) # Find symbol across all
96
+ find({ query: "retry logic", workspaces: ["backend", "shared"] }) # Multiple workspaces
97
+ ```
98
+
99
+ Tools supporting `workspaces` param: `search`, `find`, `symbol`.
100
+
101
+ ## Tools by Category
102
+
103
+ ### Search & Discovery
104
+ | Tool | CLI | Description |
105
+ |------|-----|-------------|
106
+ | `aikit_search` | `aikit search` | Hybrid vector + keyword search |
107
+ | `aikit_find` | `aikit find` | Federated search (vector, FTS, glob, regex). Use `mode: 'examples'` to find usage examples. |
108
+ | `aikit_symbol` | `aikit symbol` | Resolve symbol definition, imports, references |
109
+ | `aikit_lookup` | `aikit lookup` | Look up indexed chunks by file path |
110
+ | `aikit_trace` | `aikit trace` | Forward/backward flow tracing |
111
+ | `aikit_scope_map` | `aikit scope-map` | Generate task-scoped reading plan |
112
+ | `aikit_dead_symbols` | `aikit dead-symbols` | Find unused exported symbols (source vs docs) |
113
+ | `aikit_file_summary` | `aikit summarize` | Structural file overview |
114
+
115
+ ### Code Analysis
116
+ | Tool | CLI | Description |
117
+ |------|-----|-------------|
118
+ | `aikit_analyze_structure` | `aikit analyze structure` | Project structure analysis |
119
+ | `aikit_analyze_dependencies` | `aikit analyze deps` | Dependency graph |
120
+ | `aikit_analyze_symbols` | `aikit analyze symbols` | Symbol extraction |
121
+ | `aikit_analyze_patterns` | `aikit analyze patterns` | Code pattern detection |
122
+ | `aikit_analyze_entry_points` | `aikit analyze entry-points` | Entry point discovery: handlers, CDK constructs, test suites, package exports (walks monorepo workspaces) |
123
+ | `aikit_analyze_diagram` | `aikit analyze diagram` | Mermaid diagram generation |
124
+ | `aikit_blast_radius` | `aikit analyze blast-radius` | Change impact analysis |
125
+
126
+ ### Context Management
127
+ | Tool | CLI | Description |
128
+ |------|-----|-------------|
129
+ | `aikit_compact` | `aikit compact` | Compress text/file to relevant sections (accepts `path`) |
130
+ | `aikit_workset` | `aikit workset` | Named file set management |
131
+ | `aikit_stash` | `aikit stash` | Named key-value store |
132
+ | `aikit_checkpoint` | `aikit checkpoint` | Session checkpoint save/restore |
133
+ | `aikit_parse_output` | `aikit parse-output` | Parse build tool output (tsc, vitest, biome) |
134
+
135
+ ### FORGE & Context Compression
136
+ | Tool | CLI | Description |
137
+ |------|-----|-------------|
138
+ | `aikit_forge_ground` | — | Complete FORGE Ground phase in one call (chains classify→scope→summarize→constraints→evidence) |
139
+ | `aikit_forge_classify` | — | Classify FORGE tier (Floor/Standard/Critical) from files and task |
140
+ | `aikit_evidence_map` | — | Track critical-path claims as V/A/U with receipts + deterministic Gate |
141
+ | `aikit_digest` | — | Compress multiple text sources into token-budgeted digest |
142
+ | `aikit_stratum_card` | — | Generate STRATUM T1/T2 context cards (10-100x token reduction) |
143
+
144
+ ### Code Manipulation
145
+ | Tool | CLI | Description |
146
+ |------|-----|-------------|
147
+ | `aikit_rename` | `aikit rename` | Smart symbol rename across files |
148
+ | `aikit_codemod` | `aikit codemod` | Regex-based code transformations |
149
+ | `aikit_diff_parse` | `aikit diff` | Parse unified diff into structured changes |
150
+ | `aikit_data_transform` | `aikit transform` | JQ-like JSON transformations |
151
+
152
+ ### Execution & Validation
153
+ | Tool | CLI | Description |
154
+ |------|-----|-------------|
155
+ | `aikit_eval` | `aikit eval` | Sandboxed JavaScript/TypeScript execution |
156
+ | `aikit_check` | `aikit check` | Incremental typecheck + lint (`detail`: summary/errors/full) |
157
+ | `aikit_test_run` | `aikit test` | Run tests with structured results |
158
+ | `aikit_batch` | `aikit batch` | Parallel operation execution |
159
+ | `aikit_audit` | `aikit audit` | Unified project audit: runs structure, deps, patterns, health, dead symbols, check, entry points in one call. Returns score, recommendations, and next steps. |
160
+
161
+ ### Knowledge Management
162
+ | Tool | CLI | Description |
163
+ |------|-----|-------------|
164
+ | `aikit_remember` | `aikit remember` | Store curated knowledge |
165
+ | `aikit_update` | `aikit update` | Update existing entries |
166
+ | `aikit_forget` | `aikit forget` | Remove entries |
167
+ | `aikit_read` | `aikit read` | Read entry content |
168
+ | `aikit_list` | `aikit list` | List entries |
169
+ | `aikit_produce_knowledge` | — | Auto-generate knowledge from analysis |
170
+
171
+ ### Git & Environment
172
+ | Tool | CLI | Description |
173
+ |------|-----|-------------|
174
+ | `aikit_git_context` | `aikit git` | Branch, status, recent commits |
175
+ | `aikit_process` | `aikit proc` | Process supervisor |
176
+ | `aikit_watch` | `aikit watch` | Filesystem watcher |
177
+ | `aikit_delegate` | `aikit delegate` | Delegate subtask to local Ollama model |
178
+
179
+ ### Web & Network
180
+ | Tool | CLI | Description |
181
+ |------|-----|-------------|
182
+ | `aikit_web_fetch` | — | Fetch web page → markdown/raw/links/outline |
183
+ | `aikit_web_search` | — | Search the web via DuckDuckGo (no API key) |
184
+ | `aikit_http` | — | Make HTTP requests for API testing/debugging |
185
+
186
+ ### Developer Utilities
187
+ | Tool | CLI | Description |
188
+ |------|-----|-------------|
189
+ | `aikit_regex_test` | — | Test regex patterns (match/replace/split modes) |
190
+ | `aikit_encode` | — | Base64, URL, SHA-256, MD5, hex, JWT decode |
191
+ | `aikit_measure` | — | Code complexity and line-count metrics |
192
+ | `aikit_changelog` | — | Generate changelog from git history |
193
+ | `aikit_schema_validate` | — | Validate JSON data against JSON Schema |
194
+ | `aikit_snippet` | — | Persistent code snippet/template storage |
195
+ | `aikit_env` | — | System and runtime environment info |
196
+ | `aikit_time` | — | Date parsing, timezone conversion, duration math |
197
+
198
+ ### Verified Lanes
199
+ | Tool | CLI | Description |
200
+ |------|-----|-------------|
201
+ | `aikit_lane` (create) | `aikit lane create` | Create isolated file copy for parallel exploration |
202
+ | `aikit_lane` (list) | `aikit lane list` | List active lanes |
203
+ | `aikit_lane` (status) | `aikit lane status` | Show modified/added/deleted files in a lane |
204
+ | `aikit_lane` (diff) | `aikit lane diff` | Generate diff between lane and originals |
205
+ | `aikit_lane` (merge) | `aikit lane merge` | Merge lane files back to originals |
206
+ | `aikit_lane` (discard) | `aikit lane discard` | Discard a lane entirely |
207
+
208
+ ### System
209
+ | Tool | CLI | Description |
210
+ |------|-----|-------------|
211
+ | `aikit_status` | `aikit status` | Index statistics + tree-sitter availability |
212
+ | `aikit_reindex` | `aikit reindex` | Rebuild index |
213
+ | `aikit_health` | `aikit health` | Project health checks (package.json, tsconfig, lockfile, circular deps) |
214
+ | `aikit_guide` | `aikit guide` | Tool discovery — given a goal, recommends tools and workflow order |
215
+ | `aikit_queue` | `aikit queue` | Task queue for sequential agent operations |
216
+ | `aikit_graph` | `aikit graph` | Query and manage the knowledge graph (8 actions: find_nodes, find_edges, neighbors, traverse, stats, add, delete, clear) |
217
+ | `aikit_onboard` | `aikit onboard` | First-time codebase onboarding — runs all analysis tools in one command, auto-persists results |
218
+ | `aikit_replay` | `aikit replay` | View or clear the audit trail of tool invocations (action: list/clear) |
219
+
220
+ ### TUI Dashboard
221
+
222
+ ```bash
223
+ aikit tui # Launch interactive Ink terminal dashboard
224
+ ```
225
+
226
+ The TUI is a human monitoring dashboard with 4 panels: Status, Search, Curated, and Activity Log. It shows real-time tool activity via the replay audit trail, letting you observe what an AI agent is doing with the KB.
227
+
228
+ ## MCP Integration
229
+
230
+ After `aikit init`, your `.vscode/mcp.json` is configured automatically:
231
+
232
+ ```json
233
+ {
234
+ "servers": {
235
+ "knowledge-base": {
236
+ "type": "stdio",
237
+ "command": "npx",
238
+ "args": ["@vpxa/aikit", "serve"]
239
+ }
240
+ }
241
+ }
242
+ ```
243
+
244
+ > **User-level mode:** When installed with `aikit init --user`, the MCP server is configured at the user level — no per-project `mcp.json` needed. The server auto-detects and indexes each workspace.
245
+
246
+ ## CLI Usage
247
+
248
+ ```bash
249
+ aikit <command> [options]
250
+
251
+ # Search & Discovery
252
+ aikit search <query> [--limit N] [--mode hybrid|semantic|keyword]
253
+ aikit find [query] [--glob pattern] [--pattern regex] [--limit N]
254
+ aikit symbol <name>
255
+ aikit scope-map <task> [--max-files N]
256
+ aikit trace <symbol> [--direction forward|backward|both] [--depth N]
257
+ aikit examples <query> [--limit N]
258
+ aikit summarize <file>
259
+ aikit dead-symbols [--limit N]
260
+
261
+ # Analysis
262
+ aikit analyze <type> <path>
263
+ aikit lookup <path>
264
+
265
+ # Context
266
+ aikit compact <query> [--path <file>] [--max-chars N]
267
+ aikit workset <action> [name] [--files f1,f2]
268
+ aikit stash <action> [key] [value]
269
+ aikit checkpoint <action> [label]
270
+ aikit parse-output [--tool tsc|vitest|biome|git-status]
271
+
272
+ # Code Manipulation
273
+ aikit rename <old> <new> <path> [--dry-run]
274
+ aikit codemod <path> --rules <file.json> [--dry-run]
275
+ aikit diff
276
+ aikit transform <expression>
277
+
278
+ # Execution
279
+ aikit eval <code> [--lang js|ts] [--timeout N]
280
+ aikit test [files...] [--grep pattern]
281
+ aikit check [--skip-types] [--skip-lint] [--detail summary|errors|full]
282
+ aikit batch
283
+
284
+ # Knowledge
285
+ aikit remember <title> --category <cat> [--tags t1,t2]
286
+ aikit forget <path> --reason <reason>
287
+ aikit read <path>
288
+ aikit list [--category cat] [--tag tag]
289
+ aikit update <path> --reason <reason>
290
+
291
+ # Git & Environment
292
+ aikit git [--commits N] [--diff]
293
+ aikit proc <action> [id] [--command cmd]
294
+ aikit watch <action> [--path dir]
295
+
296
+ # Verified Lanes
297
+ aikit lane create <name> --files file1.ts,file2.ts
298
+ aikit lane list
299
+ aikit lane status <name>
300
+ aikit lane diff <name>
301
+ aikit lane merge <name>
302
+ aikit lane discard <name>
303
+
304
+ # Graph
305
+ aikit graph stats
306
+ aikit graph find-nodes [--type module|function|class] [--query pattern]
307
+ aikit graph find-edges [--type imports|defines] [--source path]
308
+ aikit graph neighbors <nodeId> [--direction in|out|both]
309
+ aikit graph traverse <startId> [--direction forward|backward] [--depth N]
310
+
311
+ # System
312
+ aikit status
313
+ aikit reindex [--full]
314
+ aikit onboard <path> [--generate] [--out-dir <dir>]
315
+ aikit serve [--transport stdio|http] [--port N]
316
+ aikit init [--user|--workspace] [--force] [--guide]
317
+ ```
318
+
319
+ ## Configuration
320
+
321
+ `kb.config.json`:
322
+
323
+ ```json
324
+ {
325
+ "sources": [{ "path": ".", "name": "project" }],
326
+ "embedding": {
327
+ "model": "Xenova/mxbai-embed-large-v1",
328
+ "dimensions": 1024
329
+ },
330
+ "store": {
331
+ "backend": "lancedb",
332
+ "path": ".aikit-data/store"
333
+ },
334
+ "curated": {
335
+ "path": "curated"
336
+ }
337
+ }
338
+ ```
339
+
340
+ ## Architecture
341
+
342
+ ```text
343
+ @vpxa/aikit
344
+ ├── packages/
345
+ │ ├── core/ — types, config, logger, constants, global registry
346
+ │ ├── store/ — LanceDB vector store
347
+ │ ├── embeddings/ — ONNX local embeddings
348
+ │ ├── chunker/ — tree-sitter + regex code chunking
349
+ │ ├── indexer/ — incremental file indexer
350
+ │ ├── analyzers/ — blast-radius, deps, symbols, patterns, diagrams
351
+ │ ├── tools/ — 55 tool modules (67 MCP tools)
352
+ │ ├── server/ — MCP protocol server
353
+ │ └── cli/ — command-line interface
354
+ ├── bin/aikit.mjs — CLI entry point
355
+ └── skills/ — LLM skill files
356
+ ```
357
+
358
+ ## License
359
+
360
+ MIT
361
+
362
+ ### Development
363
+
364
+ ```bash
365
+ pnpm install # Install dependencies
366
+ pnpm build # Build all packages
367
+ pnpm test # Run tests (Vitest)
368
+ pnpm lint # Lint (Biome)
369
+ ```
370
+
371
+ ---
372
+
373
+ ## Detailed MCP Tools Reference
374
+
375
+ ### Search & Retrieval
376
+
377
+ #### `aikit_search` — Hybrid search across the knowledge base
378
+
379
+ Find relevant code, docs, patterns, and curated knowledge using hybrid (vector + keyword), semantic, or keyword-only search.
380
+
381
+ | Parameter | Type | Required | Default | Description |
382
+ |-----------|------|----------|---------|-------------|
383
+ | `query` | string | **yes** | — | Natural language search query |
384
+ | `limit` | number (1–20) | no | 5 | Maximum results to return |
385
+ | `search_mode` | enum | no | `hybrid` | Search strategy: `hybrid` (vector + FTS + RRF fusion), `semantic` (vector only), `keyword` (FTS only) |
386
+ | `content_type` | enum | no | — | Filter: `markdown`, `code-typescript`, `code-javascript`, `code-python`, `config-json`, `config-yaml`, `config-toml`, `config-dotenv`, `infrastructure`, `documentation`, `test`, `script`, `curated-knowledge`, `produced-knowledge`, `other` |
387
+ | `origin` | enum | no | — | Filter: `indexed` (from files), `curated` (agent memory), `produced` (auto-generated) |
388
+ | `category` | string | no | — | Filter by curated category (e.g., `decisions`, `patterns`) |
389
+ | `tags` | string[] | no | — | Filter by tags (OR matching) |
390
+ | `workspaces` | string[] | no | — | Cross-workspace search: partition names, folder basenames, or `["*"]` for all. User-level mode only. |
391
+ | `min_score` | number (0–1) | no | 0.25 | Minimum similarity score threshold |
392
+
393
+ **Returns**: Ranked results with score, source path, content type, line range, heading path, origin, tags, and full content text. Each response includes a `_Next:` hint suggesting logical follow-up tools.
394
+
395
+ **Search modes**:
396
+ - **`hybrid`** (default) — Runs vector similarity and full-text keyword search in parallel, then merges rankings using Reciprocal Rank Fusion (k=60). Best for most queries.
397
+ - **`semantic`** — Pure vector cosine similarity. Best when searching by meaning/concept rather than exact terms.
398
+ - **`keyword`** — Full-text search using LanceDB's built-in FTS index. Best when searching for exact identifiers, function names, or specific strings.
399
+
400
+ **Best practices for query**:
401
+ - Use natural language describing what you're looking for: `"how does the notification dispatcher route messages"`
402
+ - Include domain terms that would appear in the code: `"DynamoDB single-table GSI pattern for notifications"`
403
+ - Use `search_mode: "keyword"` for exact function/class names: `"reciprocalRankFusion"`
404
+ - Use `search_mode: "semantic"` for conceptual queries: `"retry strategy with exponential backoff"`
405
+ - For curated knowledge, combine with `origin: "curated"`: `query: "architecture decision", origin: "curated"`
406
+
407
+ #### `aikit_lookup` — Get all chunks for a specific file
408
+
409
+ | Parameter | Type | Required | Description |
410
+ |-----------|------|----------|-------------|
411
+ | `path` | string | **yes** | Relative file path (e.g., `src/index.ts`) |
412
+
413
+ **Returns**: All chunks for that file, sorted by position, with line ranges and content.
414
+
415
+ #### `aikit_status` — View index statistics
416
+
417
+ No parameters. Returns total records, total files, content type breakdown, last indexed timestamp, and list of indexed files.
418
+
419
+ ### Curated Knowledge (Persistent Memory)
420
+
421
+ These tools give the agent **persistent, version-tracked memory** that survives across sessions. Knowledge is stored as markdown files with YAML frontmatter in the `curated/` directory and simultaneously indexed into the vector store for semantic search.
422
+
423
+ #### `aikit_remember` — Store new knowledge
424
+
425
+ | Parameter | Type | Required | Description |
426
+ |-----------|------|----------|-------------|
427
+ | `title` | string (3–120 chars) | **yes** | Short descriptive title |
428
+ | `content` | string (≥10 chars) | **yes** | Markdown content to store |
429
+ | `category` | string (kebab-case) | **yes** | Category slug: `decisions`, `patterns`, `conventions`, `troubleshooting`, or any custom kebab-case name |
430
+ | `tags` | string[] | no | Tags for filtering |
431
+
432
+ **What to remember**: Architecture decisions, coding conventions, recurring patterns, API contracts, deployment procedures, debugging solutions, team agreements, review findings.
433
+
434
+ #### `aikit_update` — Update existing knowledge
435
+
436
+ | Parameter | Type | Required | Description |
437
+ |-----------|------|----------|-------------|
438
+ | `path` | string | **yes** | Path from `aikit_list` (e.g., `decisions/use-lancedb.md`) |
439
+ | `content` | string (≥10 chars) | **yes** | New markdown content (replaces existing) |
440
+ | `reason` | string (≥3 chars) | **yes** | Why this update is being made (recorded in changelog) |
441
+
442
+ Increments version number and appends to the entry's changelog.
443
+
444
+ #### `aikit_read` — Read a curated entry
445
+
446
+ | Parameter | Type | Required | Description |
447
+ |-----------|------|----------|-------------|
448
+ | `path` | string | **yes** | Path from `aikit_list` |
449
+
450
+ **Returns**: Full metadata (title, version, tags, created, updated) and content.
451
+
452
+ #### `aikit_list` — List curated entries
453
+
454
+ | Parameter | Type | Required | Description |
455
+ |-----------|------|----------|-------------|
456
+ | `category` | string | no | Filter by category |
457
+ | `tag` | string | no | Filter by tag |
458
+
459
+ **Returns**: All entries with title, version, tags, path, and 80-char content preview.
460
+
461
+ #### `aikit_forget` — Remove a curated entry
462
+
463
+ | Parameter | Type | Required | Description |
464
+ |-----------|------|----------|-------------|
465
+ | `path` | string | **yes** | Path from `aikit_list` |
466
+ | `reason` | string (≥3 chars) | **yes** | Why this entry is being removed |
467
+
468
+ Deletes from disk and vector store.
469
+
470
+ ### Indexing
471
+
472
+ #### `aikit_reindex` — Trigger re-indexing
473
+
474
+ | Parameter | Type | Required | Default | Description |
475
+ |-----------|------|----------|---------|-------------|
476
+ | `full` | boolean | no | false | If true, force full re-index ignoring file hashes |
477
+
478
+ Incremental mode (default) only re-indexes files whose content hash has changed. Full mode drops the table and rebuilds from scratch.
479
+
480
+ ### Codebase Analysis
481
+
482
+ #### `aikit_produce_knowledge` — Automated analysis + synthesis instructions
483
+
484
+ | Parameter | Type | Required | Default | Description |
485
+ |-----------|------|----------|---------|-------------|
486
+ | `scope` | string | no | `.` (root) | Root path to analyze |
487
+ | `aspects` | enum[] | no | `["all"]` | `all`, `structure`, `dependencies`, `symbols`, `patterns`, `entry-points`, `diagrams` |
488
+
489
+ Runs deterministic analyzers, then returns structured instructions for the agent to synthesize and store findings using `aikit_remember`.
490
+
491
+ #### `aikit_analyze_structure` — File/directory tree with language stats
492
+
493
+ | Parameter | Type | Required | Default | Description |
494
+ |-----------|------|----------|---------|-------------|
495
+ | `path` | string | **yes** | — | Root path to analyze |
496
+ | `max_depth` | number (1–10) | no | 6 | Maximum directory depth |
497
+ | `format` | enum | no | `markdown` | `json` or `markdown` |
498
+
499
+ #### `aikit_analyze_dependencies` — Import/require dependency graph (with confidence)
500
+
501
+ | Parameter | Type | Required | Default | Description |
502
+ |-----------|------|----------|---------|-------------|
503
+ | `path` | string | **yes** | — | Root path |
504
+ | `format` | enum | no | `markdown` | `json`, `markdown`, or `mermaid` |
505
+
506
+ Dependency results include a **confidence** level per import: `high` (ES static imports), `medium` (dynamic imports, require()), `low` (inferred). The markdown format shows a Confidence column in dependency tables.
507
+
508
+ #### `aikit_analyze_symbols` — Exported & local symbols
509
+
510
+ | Parameter | Type | Required | Default | Description |
511
+ |-----------|------|----------|---------|-------------|
512
+ | `path` | string | **yes** | — | Root path |
513
+ | `filter` | string | no | — | Filter symbols by name substring |
514
+ | `format` | enum | no | `markdown` | `json` or `markdown` |
515
+
516
+ #### `aikit_analyze_patterns` — Detect architectural patterns & frameworks
517
+
518
+ | Parameter | Type | Required | Description |
519
+ |-----------|------|----------|-------------|
520
+ | `path` | string | **yes** | Root path |
521
+
522
+ #### `aikit_analyze_entry_points` — Find Lambda handlers, CDK constructs, test suites, package exports
523
+
524
+ Walks monorepo workspace packages (pnpm-workspace.yaml / package.json#workspaces), parses `exports` fields, detects CDK constructs and test suites.
525
+
526
+ | Parameter | Type | Required | Description |
527
+ |-----------|------|----------|-------------|
528
+ | `path` | string | **yes** | Root path |
529
+
530
+ #### `aikit_analyze_diagram` — Generate Mermaid architecture/dependency diagrams
531
+
532
+ | Parameter | Type | Required | Default | Description |
533
+ |-----------|------|----------|---------|-------------|
534
+ | `path` | string | **yes** | — | Root path |
535
+ | `diagram_type` | enum | no | `architecture` | `architecture` or `dependencies` |
536
+
537
+ ### Context Management
538
+
539
+ #### `aikit_compact` — Compress text to query-relevant sections
540
+
541
+ | Parameter | Type | Required | Default | Description |
542
+ |-----------|------|----------|---------|-------------|
543
+ | `text` | string | no* | — | The text to compress (provide `text` or `path`) |
544
+ | `path` | string | no* | — | File path to read server-side (avoids read_file round-trip) |
545
+ | `query` | string | **yes** | — | Focus query — what are you trying to understand? |
546
+ | `max_chars` | number (100–50000) | no | `3000` | Target output size in characters |
547
+ | `segmentation` | enum | no | `paragraph` | How to split: `paragraph`, `sentence`, `line` |
548
+
549
+ \* At least one of `text` or `path` must be provided. Using `path` is preferred — it eliminates the `read_file` → `compact` two-call chain and prevents token doubling.
550
+
551
+ #### `aikit_workset` — Manage named file sets
552
+
553
+ | Parameter | Type | Required | Default | Description |
554
+ |-----------|------|----------|---------|-------------|
555
+ | `action` | enum | **yes** | — | `save`, `get`, `list`, `delete`, `add`, `remove` |
556
+ | `name` | string | varies | — | Workset name (required for all except `list`) |
557
+ | `files` | string[] | varies | — | File paths (required for `save`, `add`, `remove`) |
558
+ | `description` | string | no | — | Description (for `save`) |
559
+
560
+ Worksets persist across sessions in `.aikit-state/worksets.json`.
561
+
562
+ #### `aikit_stash` — Persist named key-value pairs
563
+
564
+ | Parameter | Type | Required | Default | Description |
565
+ |-----------|------|----------|---------|-------------|
566
+ | `action` | enum | **yes** | — | `set`, `get`, `list`, `delete`, `clear` |
567
+ | `key` | string | varies | — | Entry key (for `set`, `get`, `delete`) |
568
+ | `value` | string | varies | — | String or JSON value (for `set`) |
569
+
570
+ Stores intermediate results between tool calls in `.aikit-state/stash.json`.
571
+
572
+ #### `aikit_checkpoint` — Save/restore session checkpoints
573
+
574
+ | Parameter | Type | Required | Default | Description |
575
+ |-----------|------|----------|---------|-------------|
576
+ | `action` | enum | **yes** | — | `save`, `load`, `list`, `latest` |
577
+ | `label` | string | varies | — | Checkpoint label (for `save`), or checkpoint ID (for `load`) |
578
+ | `data` | string | varies | — | JSON object string (for `save`) |
579
+ | `notes` | string | no | — | Optional notes (for `save`) |
580
+
581
+ Lightweight checkpoints stored in `.aikit-state/checkpoints/` for cross-session continuity.
582
+
583
+ #### `aikit_parse_output` — Parse build tool output
584
+
585
+ | Parameter | Type | Required | Default | Description |
586
+ |-----------|------|----------|---------|-------------|
587
+ | `output` | string | **yes** | — | Raw output text from a build tool |
588
+ | `tool` | enum | no | auto-detect | `tsc`, `vitest`, `biome`, `git-status` |
589
+
590
+ Returns JSON structured parse result with errors, warnings, and file references. Auto-detects the tool format when not specified.
591
+
592
+ ### FORGE & Context Compression
593
+
594
+ #### `aikit_forge_ground` — Complete FORGE Ground phase
595
+
596
+ | Parameter | Type | Required | Default | Description |
597
+ |-----------|------|----------|---------|-------------|
598
+ | `task` | string | **yes** | — | Task description |
599
+ | `files` | string[] | **yes** | — | Target files being modified (absolute paths) |
600
+ | `root_path` | string | **yes** | — | Root path of the codebase |
601
+ | `max_constraints` | number (0–10) | no | `3` | Max constraint entries to load from KB |
602
+ | `force_tier` | enum | no | auto | Force tier: `floor`, `standard`, `critical` (skips auto-classification) |
603
+ | `task_id` | string | no | auto-generated | Custom task ID for evidence map |
604
+
605
+ Chains: tier classification → scope map → file summaries → constraint loading → typed unknown seeds → evidence map creation. Replaces 5-15 manual tool calls. Floor tasks get a minimal shortcut (no scope map / constraints / evidence map).
606
+
607
+ #### `aikit_forge_classify` — Classify FORGE tier
608
+
609
+ | Parameter | Type | Required | Description |
610
+ |-----------|------|----------|-------------|
611
+ | `files` | string[] | **yes** | Files being modified (paths) |
612
+ | `task` | string | **yes** | Task description |
613
+ | `root_path` | string | **yes** | Root path of the codebase |
614
+
615
+ Checks blast radius, cross-package boundaries, schema/contract patterns, and security signals. Returns tier, triggers, typed unknown seeds, packages crossed, and ceremony guidance.
616
+
617
+ #### `aikit_evidence_map` — FORGE Evidence Map CRUD + Gate
618
+
619
+ | Parameter | Type | Required | Default | Description |
620
+ |-----------|------|----------|---------|-------------|
621
+ | `action` | enum | **yes** | — | `create`, `add`, `update`, `get`, `gate`, `list`, `delete` |
622
+ | `task_id` | string | varies | — | Task identifier (all except `list`) |
623
+ | `tier` | enum | varies | — | FORGE tier (for `create`): `floor`, `standard`, `critical` |
624
+ | `claim` | string | varies | — | Critical-path claim text (for `add`) |
625
+ | `status` | enum | varies | — | `V` (Verified), `A` (Assumed), `U` (Unresolved) |
626
+ | `receipt` | string | no | — | Evidence: tool→ref for V, reasoning for A, attempts for U |
627
+ | `id` | number | varies | — | Entry ID (for `update`) |
628
+ | `critical_path` | boolean | no | `true` | Whether claim is on the critical path |
629
+ | `unknown_type` | enum | no | — | `contract`, `convention`, `freshness`, `runtime`, `data-flow`, `impact` |
630
+ | `retry_count` | number | no | `0` | Retry count for gate evaluation |
631
+
632
+ Gate decision logic: HARD_BLOCK (contract U on critical path) → HOLD (non-contract U, retry 0) → FORCED_DELIVERY (non-contract U, retry ≥ 1) → YIELD. Persists in `.aikit-state/evidence-maps.json`.
633
+
634
+ #### `aikit_digest` — Token-budgeted multi-source compression
635
+
636
+ | Parameter | Type | Required | Default | Description |
637
+ |-----------|------|----------|---------|-------------|
638
+ | `sources` | object[] | **yes** | — | Sources: `{ id, text, weight }` (weight = priority, higher = more budget) |
639
+ | `query` | string | **yes** | — | Focus query — what matters for the next step? |
640
+ | `max_chars` | number (100–50000) | no | `4000` | Target budget in characters |
641
+ | `pin_fields` | string[] | no | status, files, decisions, blockers, next | Key fields to always extract |
642
+ | `segmentation` | enum | no | `paragraph` | `paragraph`, `sentence`, `line` |
643
+
644
+ Jointly ranks across all sources using embedding similarity. Pins structured fields (key:value patterns) and allocates remaining budget proportionally by weight. Returns compressed text + extracted fields + per-source stats.
645
+
646
+ #### `aikit_stratum_card` — STRATUM context cards
647
+
648
+ | Parameter | Type | Required | Default | Description |
649
+ |-----------|------|----------|---------|-------------|
650
+ | `files` | string[] | **yes** | — | Absolute file paths to generate cards for |
651
+ | `query` | string | **yes** | — | Current task query — guides relevance scoring |
652
+ | `tier` | enum | no | `T1` | `T1` = structural only (~100 tok/file), `T2` = T1 + compressed content (~300 tok/file) |
653
+ | `max_content_chars` | number (100–5000) | no | `800` | For T2: max chars for compressed content section |
654
+
655
+ T1 cards contain: ROLE, DEPS, EXPORTS, UNKNOWNS, RISK. T2 adds a CONTEXT section with query-compressed content. Uses `aikit_file_summary` + embedder similarity. No generative LLM needed.
656
+
657
+ ### Search & Discovery
658
+
659
+ #### `aikit_find` — Federated multi-strategy search
660
+
661
+ | Parameter | Type | Required | Default | Description |
662
+ |-----------|------|----------|---------|-------------|
663
+ | `query` | string | no | — | Semantic/keyword search query |
664
+ | `glob` | string | no | — | File glob pattern |
665
+ | `pattern` | string | no | — | Regex pattern to match in content |
666
+ | `limit` | number (1–50) | no | `10` | Max results |
667
+ | `content_type` | string | no | — | Filter by content type |
668
+
669
+ Combines vector similarity, keyword (FTS), file glob, and regex strategies. Deduplicates and returns unified results with source, path, line range, score %, and preview.
670
+
671
+ #### `aikit_symbol` — Resolve a symbol across the codebase
672
+
673
+ | Parameter | Type | Required | Default | Description |
674
+ |-----------|------|----------|---------|-------------|
675
+ | `name` | string | **yes** | — | Symbol name (function, class, type, etc.) |
676
+ | `limit` | number (1–50) | no | `20` | Max results per category |
677
+
678
+ Finds where a symbol is defined, who imports it, and where it is referenced. Works on TypeScript and JavaScript.
679
+
680
+ #### `aikit_scope_map` — Generate a task-scoped reading plan
681
+
682
+ | Parameter | Type | Required | Default | Description |
683
+ |-----------|------|----------|---------|-------------|
684
+ | `task` | string | **yes** | — | Description of the task to scope |
685
+ | `max_files` | number (1–50) | no | `15` | Maximum files to include |
686
+ | `content_type` | string | no | — | Filter by content type |
687
+
688
+ Returns a ranked file list with estimated token counts, relevance %, focus line ranges, and a suggested reading order.
689
+
690
+ #### `aikit_trace` — Trace data flow through imports/references
691
+
692
+ | Parameter | Type | Required | Default | Description |
693
+ |-----------|------|----------|---------|-------------|
694
+ | `start` | string | **yes** | — | Starting point — symbol name or `file:line` reference |
695
+ | `direction` | enum | **yes** | — | `forward`, `backward`, `both` |
696
+ | `max_depth` | number (1–10) | no | `3` | Maximum trace depth |
697
+
698
+ Follows imports, call sites, and references to build a relationship graph from a starting symbol or file location.
699
+
700
+ #### `aikit_dead_symbols` — Find unused exported symbols
701
+
702
+ | Parameter | Type | Required | Default | Description |
703
+ |-----------|------|----------|---------|-------------|
704
+ | `limit` | number (1–500) | no | `100` | Maximum exported symbols to scan |
705
+
706
+ Finds exported symbols that are never imported or re-exported anywhere in the project.
707
+
708
+ #### `aikit_file_summary` — Structural summary of a source file
709
+
710
+ | Parameter | Type | Required | Description |
711
+ |-----------|------|----------|-------------|
712
+ | `path` | string | **yes** | Absolute path to the file |
713
+
714
+ Returns imports, exports, functions, classes, interfaces, and types found in the file.
715
+
716
+ ### Code Manipulation
717
+
718
+ #### `aikit_rename` — Rename a symbol across files
719
+
720
+ | Parameter | Type | Required | Default | Description |
721
+ |-----------|------|----------|---------|-------------|
722
+ | `old_name` | string | **yes** | — | Existing symbol name |
723
+ | `new_name` | string | **yes** | — | New symbol name |
724
+ | `root_path` | string | **yes** | — | Root directory to search within |
725
+ | `extensions` | string[] | no | — | File extensions to include (e.g., `.ts`, `.tsx`) |
726
+ | `dry_run` | boolean | no | `true` | Preview changes without writing files |
727
+
728
+ Uses whole-word regex matching for exports, imports, and general usage references. Defaults to dry run.
729
+
730
+ #### `aikit_codemod` — Apply regex-based codemod rules
731
+
732
+ | Parameter | Type | Required | Default | Description |
733
+ |-----------|------|----------|---------|-------------|
734
+ | `root_path` | string | **yes** | — | Root directory to transform within |
735
+ | `rules` | object[] (min 1) | **yes** | — | Codemod rules: `description`, `pattern` (regex), `replacement` (with capture groups) |
736
+ | `dry_run` | boolean | no | `true` | Preview changes without writing files |
737
+
738
+ Returns structured before/after changes for each affected line. Defaults to dry run.
739
+
740
+ #### `aikit_diff_parse` — Parse unified diff text
741
+
742
+ | Parameter | Type | Required | Description |
743
+ |-----------|------|----------|-------------|
744
+ | `diff` | string | **yes** | Raw unified diff text |
745
+
746
+ Parses into file-level and hunk-level structural changes.
747
+
748
+ #### `aikit_data_transform` — jq-like JSON transforms
749
+
750
+ | Parameter | Type | Required | Description |
751
+ |-----------|------|----------|-------------|
752
+ | `input` | string | **yes** | Input JSON string |
753
+ | `expression` | string | **yes** | Transform expression (filtering, projection, grouping, path extraction) |
754
+
755
+ ### Execution & Validation
756
+
757
+ #### `aikit_eval` — Execute code in a sandboxed VM
758
+
759
+ | Parameter | Type | Required | Default | Description |
760
+ |-----------|------|----------|---------|-------------|
761
+ | `code` | string | **yes** | — | Code snippet to execute |
762
+ | `lang` | enum | no | `js` | `js` (direct) or `ts` (strips type syntax first) |
763
+ | `timeout` | number (1–60000) | no | `5000` | Execution timeout in milliseconds |
764
+
765
+ Captures console output and return values. Constrained VM with timeout.
766
+
767
+ #### `aikit_check` — Run typecheck and lint
768
+
769
+ | Parameter | Type | Required | Default | Description |
770
+ |-----------|------|----------|---------|-------------|
771
+ | `files` | string[] | no | — | Specific files (omit to check all) |
772
+ | `cwd` | string | no | — | Working directory |
773
+ | `skip_types` | boolean | no | `false` | Skip TypeScript typecheck |
774
+ | `skip_lint` | boolean | no | `false` | Skip Biome lint |
775
+
776
+ Runs incremental `tsc` and `biome` and returns structured error/warning lists.
777
+
778
+ #### `aikit_test_run` — Run Vitest tests
779
+
780
+ | Parameter | Type | Required | Default | Description |
781
+ |-----------|------|----------|---------|-------------|
782
+ | `files` | string[] | no | — | Specific test files or patterns |
783
+ | `grep` | string | no | — | Only run tests matching this pattern |
784
+ | `cwd` | string | no | — | Working directory |
785
+
786
+ Returns structured pass/fail summary. `isError` set if any tests failed.
787
+
788
+ #### `aikit_batch` — Execute multiple operations in parallel
789
+
790
+ | Parameter | Type | Required | Default | Description |
791
+ |-----------|------|----------|---------|-------------|
792
+ | `operations` | object[] (min 1) | **yes** | — | Operations: `id` (string), `type` (`search`/`find`/`check`), `args` (record) |
793
+ | `concurrency` | number (1–20) | no | `4` | Max concurrent operations |
794
+
795
+ Returns per-operation outcomes (success/failure with results or errors).
796
+
797
+ #### `aikit_audit` — Unified project audit
798
+
799
+ Runs multiple analysis checks in a single call and returns a synthesized report with a composite score (0–100), per-check summaries, and prioritized recommendations.
800
+
801
+ | Parameter | Type | Required | Default | Description |
802
+ |-----------|------|----------|---------|-------------|
803
+ | `path` | string | no | `.` | Root path to audit |
804
+ | `checks` | string[] | no | all | Subset of checks: `structure`, `dependencies`, `patterns`, `health`, `dead_symbols`, `check`, `entry_points` |
805
+ | `detail` | enum | no | `summary` | `summary` (markdown overview) or `full` (structured JSON data) |
806
+
807
+ Returns `KBResponse<AuditData>` with `next[]` hints for follow-up actions.
808
+
809
+ ### Git & Environment
810
+
811
+ #### `aikit_git_context` — Summarize Git repository state
812
+
813
+ | Parameter | Type | Required | Default | Description |
814
+ |-----------|------|----------|---------|-------------|
815
+ | `cwd` | string | no | — | Repository root |
816
+ | `commit_count` | number (1–50) | no | `5` | Recent commits to include |
817
+ | `include_diff` | boolean | no | `false` | Include diff stat for working tree |
818
+
819
+ Returns branch, working tree status, recent commits, and optionally diff stats.
820
+
821
+ #### `aikit_process` — Manage child processes
822
+
823
+ | Parameter | Type | Required | Default | Description |
824
+ |-----------|------|----------|---------|-------------|
825
+ | `action` | enum | **yes** | — | `start`, `stop`, `status`, `list`, `logs` |
826
+ | `id` | string | varies | — | Managed process ID |
827
+ | `command` | string | varies | — | Executable (for `start`) |
828
+ | `args` | string[] | no | — | Arguments (for `start`) |
829
+ | `tail` | number (1–500) | no | — | Log lines (for `logs`) |
830
+
831
+ #### `aikit_watch` — Filesystem watchers
832
+
833
+ | Parameter | Type | Required | Default | Description |
834
+ |-----------|------|----------|---------|-------------|
835
+ | `action` | enum | **yes** | — | `start`, `stop`, `list` |
836
+ | `path` | string | varies | — | Directory path (for `start`) |
837
+ | `id` | string | varies | — | Watcher ID (for `stop`) |
838
+
839
+ #### `aikit_delegate` — Delegate subtask to local Ollama model
840
+
841
+ | Parameter | Type | Required | Default | Description |
842
+ |-----------|------|----------|---------|-------------|
843
+ | `prompt` | string | **yes** | — | Task or question to send |
844
+ | `model` | string | no | first available | Ollama model name |
845
+ | `system` | string | no | — | System prompt |
846
+ | `context` | string | no | — | Context text (e.g., file contents) |
847
+ | `temperature` | number (0–2) | no | `0.3` | Sampling temperature |
848
+ | `timeout` | number (1000–600000) | no | `120000` | Timeout in ms |
849
+ | `action` | enum | no | `generate` | `generate` or `list_models` |
850
+
851
+ Fails fast if Ollama is not running. Returns model name, response text, duration, and token count.
852
+
853
+ ### Web & Network
854
+
855
+ #### `aikit_web_fetch` — Fetch web page for LLM consumption
856
+
857
+ | Parameter | Type | Required | Default | Description |
858
+ |-----------|------|----------|---------|-------------|
859
+ | `url` | string | **yes** | — | URL to fetch (http/https only) |
860
+ | `mode` | enum | no | `markdown` | `markdown`, `raw`, `links`, `outline` |
861
+ | `selector` | string | no | — | CSS selector to extract a specific element |
862
+ | `max_length` | number (500–100000) | no | `15000` | Max output characters |
863
+ | `include_metadata` | boolean | no | `true` | Include page title/description header |
864
+ | `include_links` | boolean | no | `false` | Append extracted links |
865
+ | `include_images` | boolean | no | `false` | Include image alt texts |
866
+ | `timeout` | number (1000–60000) | no | `15000` | Request timeout in ms |
867
+
868
+ Strips scripts, styles, and boilerplate. Smart truncation at paragraph boundaries.
869
+
870
+ #### `aikit_web_search` — Search the web
871
+
872
+ | Parameter | Type | Required | Default | Description |
873
+ |-----------|------|----------|---------|-------------|
874
+ | `query` | string | **yes** | — | Search query |
875
+ | `limit` | number (1–20) | no | `5` | Max results |
876
+ | `site` | string | no | — | Restrict to domain (e.g., `docs.aws.amazon.com`) |
877
+
878
+ Uses DuckDuckGo HTML search — no API key required. Returns title, URL, and snippet for each result.
879
+
880
+ #### `aikit_http` — Make HTTP requests
881
+
882
+ | Parameter | Type | Required | Default | Description |
883
+ |-----------|------|----------|---------|-------------|
884
+ | `url` | string | **yes** | — | Request URL (http/https only) |
885
+ | `method` | enum | no | `GET` | `GET`, `POST`, `PUT`, `PATCH`, `DELETE`, `HEAD` |
886
+ | `headers` | record | no | — | Request headers |
887
+ | `body` | string | no | — | Request body |
888
+ | `timeout` | number (1000–60000) | no | `15000` | Timeout in ms |
889
+
890
+ Returns status, headers, formatted body (auto-pretty-prints JSON), timing, and size. Truncates responses over 50K chars.
891
+
892
+ ### Developer Utilities
893
+
894
+ #### `aikit_regex_test` — Test regex patterns
895
+
896
+ | Parameter | Type | Required | Default | Description |
897
+ |-----------|------|----------|---------|-------------|
898
+ | `pattern` | string | **yes** | — | Regex pattern (without delimiters) |
899
+ | `flags` | string | no | `""` | Regex flags (g, i, m, s, etc.) |
900
+ | `test_strings` | string[] | **yes** | — | Strings to test against |
901
+ | `mode` | enum | no | `match` | `match`, `replace`, `split` |
902
+ | `replacement` | string | no | — | Replacement string (for replace mode) |
903
+
904
+ Returns match details with groups and indices for each test string.
905
+
906
+ #### `aikit_encode` — Encoding, decoding, and hashing
907
+
908
+ | Parameter | Type | Required | Description |
909
+ |-----------|------|----------|-------------|
910
+ | `operation` | enum | **yes** | `base64_encode`, `base64_decode`, `url_encode`, `url_decode`, `sha256`, `md5`, `jwt_decode`, `hex_encode`, `hex_decode` |
911
+ | `input` | string | **yes** | Input text |
912
+
913
+ JWT decode shows header and payload without signature verification.
914
+
915
+ #### `aikit_measure` — Code complexity metrics
916
+
917
+ | Parameter | Type | Required | Default | Description |
918
+ |-----------|------|----------|---------|-------------|
919
+ | `path` | string | **yes** | — | File or directory to measure |
920
+ | `extensions` | string[] | no | `.ts,.tsx,.js,.jsx` | File extensions to include |
921
+
922
+ Returns per-file metrics (cyclomatic complexity, line counts, function counts, imports/exports) sorted by complexity, plus aggregate summary.
923
+
924
+ #### `aikit_changelog` — Generate changelog from git history
925
+
926
+ | Parameter | Type | Required | Default | Description |
927
+ |-----------|------|----------|---------|-------------|
928
+ | `from` | string | **yes** | — | Start ref (tag, SHA, HEAD~N) |
929
+ | `to` | string | no | `HEAD` | End ref |
930
+ | `format` | enum | no | `grouped` | `grouped`, `chronological`, `per-scope` |
931
+ | `include_breaking` | boolean | no | `true` | Highlight breaking changes |
932
+
933
+ Parses conventional commit format (type(scope): subject). Groups by feat/fix/refactor/etc.
934
+
935
+ #### `aikit_schema_validate` — JSON Schema validation
936
+
937
+ | Parameter | Type | Required | Description |
938
+ |-----------|------|----------|-------------|
939
+ | `data` | string | **yes** | JSON data to validate (as string) |
940
+ | `schema` | string | **yes** | JSON Schema to validate against (as string) |
941
+
942
+ Supports: type, required, properties, additionalProperties, items, enum, const, pattern, minimum/maximum, minLength/maxLength, minItems/maxItems.
943
+
944
+ #### `aikit_snippet` — Persistent code snippet storage
945
+
946
+ | Parameter | Type | Required | Description |
947
+ |-----------|------|----------|-------------|
948
+ | `action` | enum | **yes** | `save`, `get`, `list`, `search`, `delete` |
949
+ | `name` | string | varies | Snippet name |
950
+ | `language` | string | no | Language tag |
951
+ | `code` | string | varies | Code content (for save) |
952
+ | `tags` | string[] | no | Categorization tags |
953
+ | `query` | string | varies | Search query (for search) |
954
+
955
+ Stored as JSON in `.aikit-state/snippets/`. Searchable by name, tags, language, and content.
956
+
957
+ #### `aikit_env` — System environment info
958
+
959
+ | Parameter | Type | Required | Default | Description |
960
+ |-----------|------|----------|---------|-------------|
961
+ | `include_env` | boolean | no | `false` | Include environment variables |
962
+ | `filter_env` | string | no | — | Filter env vars by name substring |
963
+ | `show_sensitive` | boolean | no | `false` | Show sensitive values (redacted by default) |
964
+
965
+ Returns platform, arch, OS, CPU count, memory, Node version, CWD. Sensitive env var values (keys matching key/secret/token/password) are redacted unless explicitly requested.
966
+
967
+ #### `aikit_time` — Date/time utilities
968
+
969
+ | Parameter | Type | Required | Description |
970
+ |-----------|------|----------|-------------|
971
+ | `operation` | enum | **yes** | `now`, `parse`, `convert`, `diff`, `add` |
972
+ | `input` | string | varies | Date input (ISO, unix timestamp, parseable string). For diff: two comma-separated dates |
973
+ | `timezone` | string | no | Target timezone (e.g., `America/New_York`) |
974
+ | `duration` | string | no | Duration to add (e.g., `2h30m`, `1d`) — for add operation |
975
+
976
+ Auto-detects unix seconds vs milliseconds. Supports human-readable duration format (2h30m, 1d12h).
977
+
978
+ ### Verified Lanes
979
+
980
+ #### `aikit_lane` — Manage verified lanes
981
+
982
+ | Parameter | Type | Required | Default | Description |
983
+ |-----------|------|----------|---------|-------------|
984
+ | `action` | enum | **yes** | — | `create`, `list`, `status`, `diff`, `merge`, `discard` |
985
+ | `name` | string | varies | — | Lane name |
986
+ | `files` | string[] | varies | — | File paths to copy into lane (for `create`) |
987
+
988
+ Isolated file copies for parallel exploration. Create a lane, make changes, diff against originals, merge back, or discard.
989
+
990
+ ### System
991
+
992
+ #### `aikit_guide` — Tool discovery
993
+
994
+ | Parameter | Type | Required | Default | Description |
995
+ |-----------|------|----------|---------|-------------|
996
+ | `goal` | string | **yes** | — | What you want to accomplish |
997
+ | `max_recommendations` | number | no | 5 | Max tools to recommend (1-10) |
998
+
999
+ Given a goal description, recommends which KB tools to use and in what order. Matches against 10 predefined workflows: onboard, audit, bugfix, implement, refactor, search, context, memory, validate, analyze.
1000
+
1001
+ #### `aikit_health` — Run project health checks
1002
+
1003
+ | Parameter | Type | Required | Default | Description |
1004
+ |-----------|------|----------|---------|-------------|
1005
+ | `path` | string | no | cwd | Root directory to check |
1006
+
1007
+ Verifies package.json, tsconfig, scripts, lockfile, README, LICENSE, .gitignore, circular dependencies.
1008
+
1009
+ #### `aikit_queue` — Manage task queues
1010
+
1011
+ | Parameter | Type | Required | Default | Description |
1012
+ |-----------|------|----------|---------|-------------|
1013
+ | `action` | enum | **yes** | — | `create`, `push`, `next`, `done`, `fail`, `get`, `list`, `clear`, `delete` |
1014
+ | `name` | string | varies | — | Queue name |
1015
+ | `title` | string | varies | — | Item title (for `push`) |
1016
+ | `id` | string | varies | — | Item ID (for `done`/`fail`) |
1017
+ | `data` | any | no | — | Arbitrary data to attach |
1018
+ | `error` | string | varies | — | Error message (for `fail`) |
1019
+
1020
+ Sequential task queues for agent operations.
1021
+
1022
+ #### `aikit_replay` — View or clear audit trail
1023
+
1024
+ | Parameter | Type | Required | Default | Description |
1025
+ |-----------|------|----------|---------|-------------|
1026
+ | `action` | enum | no | `list` | `list` to view entries, `clear` to wipe the log |
1027
+ | `last` | number | no | 20 | Number of entries to return (list only) |
1028
+ | `tool` | string | no | — | Filter by tool name (list only) |
1029
+ | `source` | enum | no | — | Filter by source: `mcp` or `cli` (list only) |
1030
+ | `since` | string | no | — | ISO timestamp — only show entries after this time (list only) |
1031
+
1032
+ Shows the audit trail of recent tool invocations. Each entry includes tool name, duration, input/output summaries, and status. Useful for debugging agent behavior.
1033
+
1034
+ ---
1035
+
1036
+ ## MCP Resources
1037
+
1038
+ | URI | Name | Description |
1039
+ |-----|------|-------------|
1040
+ | `kb://status` | `aikit-status` | Quick status: record count, file count, last indexed time |
1041
+ | `kb://file-tree` | `aikit-file-tree` | Sorted list of all indexed source file paths |
1042
+
1043
+ ---
1044
+
1045
+ ## Curated Knowledge System
1046
+
1047
+ The curated system is the agent's **persistent memory layer**. Files are stored as markdown with YAML frontmatter in `curated/`:
1048
+
1049
+ ```
1050
+ curated/
1051
+ ├── conventions/ # 214 entries — coding conventions, style rules, naming patterns
1052
+ ├── decisions/ # 295 entries — architecture decisions, ADRs, design rationale
1053
+ ├── patterns/ # 165 entries — recurring patterns, templates, code idioms
1054
+ └── troubleshooting/ # 62 entries — known issues, fixes, debugging guides
1055
+ ```
1056
+
1057
+ ### Frontmatter Format
1058
+
1059
+ ```yaml
1060
+ ---
1061
+ title: "Use LanceDB for local vector storage"
1062
+ category: decisions
1063
+ tags: ["vector-store", "architecture", "lancedb"]
1064
+ created: 2026-01-15T10:30:00.000Z
1065
+ updated: 2026-02-20T14:22:00.000Z
1066
+ version: 3
1067
+ origin: curated
1068
+ changelog:
1069
+ - version: 1
1070
+ date: 2026-01-15T10:30:00.000Z
1071
+ reason: "Initial creation"
1072
+ - version: 2
1073
+ date: 2026-02-01T09:00:00.000Z
1074
+ reason: "Added performance benchmarks"
1075
+ - version: 3
1076
+ date: 2026-02-20T14:22:00.000Z
1077
+ reason: "Updated with hybrid search findings"
1078
+ ---
1079
+
1080
+ Markdown content here...
1081
+ ```
1082
+
1083
+ ### Category Guidelines
1084
+
1085
+ | Category | Use For | Examples |
1086
+ |----------|---------|---------|
1087
+ | `conventions` | Rules the team follows | Naming patterns, import ordering, error handling style, test structure |
1088
+ | `decisions` | Why something was chosen | ADRs, technology choices, pattern selections with trade-offs |
1089
+ | `patterns` | How to do recurring things | CDK stack templates, API endpoint patterns, state machine shapes |
1090
+ | `troubleshooting` | Known problems and fixes | Build failures, deployment gotchas, dependency conflicts |
1091
+ | Custom (`api-contracts`, `runbooks`, etc.) | Any kebab-case slug | Domain-specific categories as needed |
1092
+
1093
+ ---
1094
+
1095
+ ## How to Write Agent Instructions for Using This KB
1096
+
1097
+ When writing instructions for an AI agent (e.g., in `.copilot-instructions.md`, `AGENTS.md`, `CLAUDE.md`, or system prompts), include the following guidance:
1098
+
1099
+ ### Recommended Agent Instruction Template
1100
+
1101
+ ```markdown
1102
+ ## Knowledge Base Usage
1103
+
1104
+ You have access to a persistent knowledge base via MCP tools. Use it proactively.
1105
+
1106
+ ### Before Starting Any Task
1107
+ 1. **Search first**: Use `aikit_search` with a natural language query describing your task to find relevant context, prior decisions, conventions, and patterns before writing code.
1108
+ 2. **Check conventions**: `aikit_search` with `origin: "curated"` and `category: "conventions"` for coding standards that apply to your work.
1109
+ 3. **Check decisions**: `aikit_search` with `category: "decisions"` to understand why things were built a certain way.
1110
+
1111
+ ### Search Strategies
1112
+ - **Broad hybrid** (default, best for most queries): `aikit_search({ query: "notification routing architecture" })`
1113
+ - **Exact identifier lookup**: `aikit_search({ query: "handleNotification", search_mode: "keyword" })`
1114
+ - **Conceptual similarity**: `aikit_search({ query: "event-driven message fanout design", search_mode: "semantic" })`
1115
+ - **Specific convention**: `aikit_search({ query: "error handling", origin: "curated", category: "conventions" })`
1116
+ - **Code patterns**: `aikit_search({ query: "DynamoDB batch write pattern", content_type: "code-typescript" })`
1117
+ - **Troubleshooting**: `aikit_search({ query: "deployment failure CDK", category: "troubleshooting" })`
1118
+ - **View a full file**: `aikit_lookup({ path: "src/services/dispatcher.ts" })`
1119
+
1120
+ ### Follow the Hints
1121
+ Every tool response includes a `_Next:` suggestion at the bottom. Follow these hints for efficient workflows — they guide you to logical next actions (e.g., after `aikit_search`, the hint suggests `aikit_lookup` or `aikit_analyze_structure`).
1122
+
1123
+ ### After Completing a Task
1124
+ 1. **Remember decisions**: If you made an architecture or design decision, store it:
1125
+ ```
1126
+ aikit_remember({
1127
+ title: "Use event-driven pattern for notification fanout",
1128
+ content: "## Decision\n\n...\n\n## Rationale\n\n...\n\n## Alternatives Considered\n\n...",
1129
+ category: "decisions",
1130
+ tags: ["notifications", "architecture", "event-driven"]
1131
+ })
1132
+ ```
1133
+ 2. **Remember patterns**: If you established a reusable code pattern:
1134
+ ```
1135
+ aikit_remember({
1136
+ title: "CDK construct pattern for SQS-Lambda integration",
1137
+ content: "## Pattern\n\n```typescript\n...\n```\n\n## When to Use\n\n...",
1138
+ category: "patterns",
1139
+ tags: ["cdk", "sqs", "lambda"]
1140
+ })
1141
+ ```
1142
+ 3. **Remember troubleshooting**: If you solved a tricky bug:
1143
+ ```
1144
+ aikit_remember({
1145
+ title: "LanceDB dimension mismatch after model change",
1146
+ content: "## Problem\n\n...\n\n## Solution\n\nRun `aikit_reindex({ full: true })`...",
1147
+ category: "troubleshooting",
1148
+ tags: ["lancedb", "embeddings"]
1149
+ })
1150
+ ```
1151
+ 4. **Update existing knowledge**: If you're revising a prior decision:
1152
+ ```
1153
+ aikit_update({
1154
+ path: "decisions/use-event-driven-fanout.md",
1155
+ content: "updated markdown...",
1156
+ reason: "Added retry strategy after production incident"
1157
+ })
1158
+ ```
1159
+
1160
+ ### Knowledge Quality Standards
1161
+ - **Decisions** should include: Context, Decision, Rationale, Alternatives Considered, Consequences
1162
+ - **Patterns** should include: Pattern description, Code example, When to Use, When Not to Use
1163
+ - **Conventions** should include: The Rule, Why, Examples (good vs bad)
1164
+ - **Troubleshooting** should include: Problem, Symptoms, Root Cause, Solution, Prevention
1165
+
1166
+ ### Codebase Analysis (for onboarding or deep understanding)
1167
+ - Run `aikit_produce_knowledge({ aspects: ["all"] })` to get analysis baselines and follow the synthesis instructions to populate the KB
1168
+ - Use `aikit_analyze_structure({ path: "." })` for project layout overview
1169
+ - Use `aikit_analyze_dependencies({ path: ".", format: "mermaid" })` for dependency visualization
1170
+ - Use `aikit_analyze_patterns({ path: "." })` to detect frameworks and conventions
1171
+
1172
+ ### Index Maintenance
1173
+ - Run `aikit_reindex()` after significant code changes (incremental, fast)
1174
+ - Run `aikit_reindex({ full: true })` after model changes or corruption
1175
+ - Check `aikit_status()` to verify index health
1176
+ ```
1177
+
1178
+ ---
1179
+
1180
+ ## Environment Variables
1181
+
1182
+ | Variable | Default | Description |
1183
+ |----------|---------|-------------|
1184
+ | `AIKIT_TRANSPORT` | `stdio` | Transport mode: `stdio` or `http` |
1185
+ | `AIKIT_PORT` | `3210` | HTTP server port (when `--transport http`) |
1186
+ | `AIKIT_AUTO_INDEX` | `true` | Set to `false` to skip initial auto-indexing |
1187
+ | `AIKIT_CORS_ORIGIN` | `*` | CORS allowed origin for HTTP mode |
1188
+ | `AIKIT_WORKSPACE_DIR` | — | Override workspace root path |
1189
+ | `AIKIT_DATA_DIR` | — | Override LanceDB data directory |
1190
+ | `AIKIT_MODEL_DIR` | — | Override ONNX model cache directory |
1191
+
1192
+ ---
1193
+
1194
+ ## Tech Stack
1195
+
1196
+ - **Embeddings**: `@huggingface/transformers` with `mixedbread-ai/mxbai-embed-large-v1` (1024 dimensions, ONNX, query-prefixed with `"Represent this sentence for searching relevant passages: "`)
1197
+ - **Vector Store**: LanceDB (local disk, L2 distance → similarity score, built-in FTS index for keyword search)
1198
+ - **Search**: Hybrid (vector + FTS + RRF fusion), semantic-only, or keyword-only modes
1199
+ - **Chunking**: Markdown-aware (heading hierarchy), **tree-sitter AST-based** (TS/JS/Python/Go/Rust/Java — preserves function/class boundaries), with overlap. Falls back to regex-based generic chunking when tree-sitter grammars are unavailable.
1200
+ - **Dependency Analysis**: Confidence-scored imports (high/medium/low per import pattern)
1201
+ - **Auto-Persist**: Analysis tool results are automatically indexed as `origin: 'produced'` entries for future search
1202
+ - **Workflow Hints**: Every tool response includes `_Next:` suggestions for logical follow-up actions
1203
+ - **MCP SDK**: `@modelcontextprotocol/sdk` (stdio + StreamableHTTP transports)
1204
+ - **Runtime**: Node.js ≥ 24, TypeScript, ESM, pnpm workspaces
1205
+ - **Build**: tsdown with integrated dts generation
1206
+ - **Lint**: Biome
1207
+ - **Test**: Vitest