@vpxa/aikit 0.1.59 → 0.1.60

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 (553) hide show
  1. package/README.md +38 -3
  2. package/package.json +2 -1
  3. package/packages/aikit-client/dist/index.d.ts +146 -4
  4. package/packages/aikit-client/dist/index.js +5 -1
  5. package/packages/analyzers/dist/index.d.ts +309 -11
  6. package/packages/analyzers/dist/index.js +54 -1
  7. package/packages/chunker/dist/index.d.ts +451 -18
  8. package/packages/chunker/dist/index.js +24 -1
  9. package/packages/cli/dist/{commands/init/constants.js → constants-D3v4VDf0.js} +1 -1
  10. package/packages/cli/dist/index.js +15 -2
  11. package/packages/cli/dist/init-D0CiV9PX.js +7 -0
  12. package/packages/cli/dist/scaffold-CJwkHf-q.js +2 -0
  13. package/packages/cli/dist/{commands/init/templates.js → templates-DJ7EC5vw.js} +1 -1
  14. package/packages/cli/dist/user-HmJYNt5b.js +5 -0
  15. package/packages/core/dist/index.d.ts +357 -6
  16. package/packages/core/dist/index.js +1 -1
  17. package/packages/dashboard/dist/assets/{index-Cdke3KDK.js → index-C6D-PCp0.js} +7 -7
  18. package/packages/dashboard/dist/assets/index-C6D-PCp0.js.map +1 -0
  19. package/packages/dashboard/dist/index.html +1 -1
  20. package/packages/elicitation/dist/index.d.ts +139 -4
  21. package/packages/elicitation/dist/index.js +1 -1
  22. package/packages/embeddings/dist/index.d.ts +45 -2
  23. package/packages/embeddings/dist/index.js +1 -1
  24. package/packages/enterprise-bridge/dist/index.d.ts +275 -7
  25. package/packages/enterprise-bridge/dist/index.js +1 -1
  26. package/packages/flows/dist/index.d.ts +345 -12
  27. package/packages/flows/dist/index.js +15 -1
  28. package/packages/indexer/dist/index.d.ts +196 -6
  29. package/packages/indexer/dist/index.js +1 -1
  30. package/packages/present/dist/index.html +314 -313
  31. package/packages/server/dist/curated-manager-DX-_oJg0.js +5 -0
  32. package/packages/server/dist/index.d.ts +139 -1
  33. package/packages/server/dist/index.js +1 -1
  34. package/packages/server/dist/server-eMZ64H9b.js +1274 -0
  35. package/packages/store/dist/index.d.ts +316 -5
  36. package/packages/store/dist/index.js +90 -1
  37. package/packages/store/dist/lance-store-jdHZp-V4.js +1 -0
  38. package/packages/tools/dist/index.d.ts +2161 -61
  39. package/packages/tools/dist/index.js +117 -1
  40. package/packages/tui/dist/{App-CoMyn2kt.js → App-DobfqTPH.js} +1 -1
  41. package/packages/tui/dist/App.d.ts +1 -1
  42. package/packages/tui/dist/App.js +1 -1
  43. package/packages/tui/dist/{LogPanel-CDItCD0E.js → LogPanel-DGeptKim.js} +3 -3
  44. package/packages/tui/dist/hooks/useKBClient.d.ts +1 -1
  45. package/packages/tui/dist/{index-MXJeXmCf.d.ts → index-floZQwfo.d.ts} +2 -1
  46. package/packages/tui/dist/index.d.ts +1 -1
  47. package/packages/tui/dist/index.js +1 -1
  48. package/packages/tui/dist/panels/LogPanel.js +1 -1
  49. package/scaffold/definitions/bodies.mjs +47 -0
  50. package/scaffold/definitions/protocols.mjs +9 -0
  51. package/scaffold/definitions/tools.mjs +15 -0
  52. package/scaffold/general/agents/Debugger.agent.md +9 -0
  53. package/scaffold/general/agents/Documenter.agent.md +9 -0
  54. package/scaffold/general/agents/Frontend.agent.md +9 -0
  55. package/scaffold/general/agents/Implementer.agent.md +9 -0
  56. package/scaffold/general/agents/Orchestrator.agent.md +47 -0
  57. package/scaffold/general/agents/Planner.agent.md +9 -0
  58. package/scaffold/general/agents/Refactor.agent.md +9 -0
  59. package/scaffold/general/agents/Security.agent.md +9 -0
  60. package/scaffold/general/agents/_shared/code-agent-base.md +9 -0
  61. package/scaffold/general/skills/aikit/SKILL.md +71 -7
  62. package/packages/aikit-client/dist/direct-client.d.ts +0 -37
  63. package/packages/aikit-client/dist/direct-client.js +0 -1
  64. package/packages/aikit-client/dist/mcp-client.d.ts +0 -19
  65. package/packages/aikit-client/dist/mcp-client.js +0 -4
  66. package/packages/aikit-client/dist/parsers.d.ts +0 -35
  67. package/packages/aikit-client/dist/parsers.js +0 -2
  68. package/packages/aikit-client/dist/types.d.ts +0 -62
  69. package/packages/aikit-client/dist/types.js +0 -1
  70. package/packages/analyzers/dist/blast-radius-analyzer.d.ts +0 -19
  71. package/packages/analyzers/dist/blast-radius-analyzer.js +0 -6
  72. package/packages/analyzers/dist/dependency-analyzer.d.ts +0 -32
  73. package/packages/analyzers/dist/dependency-analyzer.js +0 -8
  74. package/packages/analyzers/dist/diagram-generator.d.ts +0 -16
  75. package/packages/analyzers/dist/diagram-generator.js +0 -2
  76. package/packages/analyzers/dist/entry-point-analyzer.d.ts +0 -40
  77. package/packages/analyzers/dist/entry-point-analyzer.js +0 -4
  78. package/packages/analyzers/dist/knowledge-producer.d.ts +0 -40
  79. package/packages/analyzers/dist/knowledge-producer.js +0 -26
  80. package/packages/analyzers/dist/pattern-analyzer.d.ts +0 -15
  81. package/packages/analyzers/dist/pattern-analyzer.js +0 -2
  82. package/packages/analyzers/dist/regex-call-graph.d.ts +0 -10
  83. package/packages/analyzers/dist/regex-call-graph.js +0 -1
  84. package/packages/analyzers/dist/structure-analyzer.d.ts +0 -19
  85. package/packages/analyzers/dist/structure-analyzer.js +0 -4
  86. package/packages/analyzers/dist/symbol-analyzer.d.ts +0 -14
  87. package/packages/analyzers/dist/symbol-analyzer.js +0 -9
  88. package/packages/analyzers/dist/ts-call-graph.d.ts +0 -29
  89. package/packages/analyzers/dist/ts-call-graph.js +0 -1
  90. package/packages/analyzers/dist/types.d.ts +0 -110
  91. package/packages/analyzers/dist/types.js +0 -1
  92. package/packages/chunker/dist/call-graph-extractor.d.ts +0 -25
  93. package/packages/chunker/dist/call-graph-extractor.js +0 -1
  94. package/packages/chunker/dist/chunker-factory.d.ts +0 -19
  95. package/packages/chunker/dist/chunker-factory.js +0 -1
  96. package/packages/chunker/dist/chunker.interface.d.ts +0 -13
  97. package/packages/chunker/dist/chunker.interface.js +0 -1
  98. package/packages/chunker/dist/code-chunker.d.ts +0 -17
  99. package/packages/chunker/dist/code-chunker.js +0 -11
  100. package/packages/chunker/dist/extractors/call-extractor.d.ts +0 -24
  101. package/packages/chunker/dist/extractors/call-extractor.js +0 -1
  102. package/packages/chunker/dist/extractors/entry-point-detector.d.ts +0 -14
  103. package/packages/chunker/dist/extractors/entry-point-detector.js +0 -1
  104. package/packages/chunker/dist/extractors/import-extractor.d.ts +0 -14
  105. package/packages/chunker/dist/extractors/import-extractor.js +0 -1
  106. package/packages/chunker/dist/extractors/pattern-detector.d.ts +0 -14
  107. package/packages/chunker/dist/extractors/pattern-detector.js +0 -1
  108. package/packages/chunker/dist/extractors/scope-resolver.d.ts +0 -26
  109. package/packages/chunker/dist/extractors/scope-resolver.js +0 -1
  110. package/packages/chunker/dist/extractors/symbol-extractor.d.ts +0 -14
  111. package/packages/chunker/dist/extractors/symbol-extractor.js +0 -3
  112. package/packages/chunker/dist/extractors/types.d.ts +0 -44
  113. package/packages/chunker/dist/extractors/types.js +0 -1
  114. package/packages/chunker/dist/generic-chunker.d.ts +0 -15
  115. package/packages/chunker/dist/generic-chunker.js +0 -5
  116. package/packages/chunker/dist/markdown-chunker.d.ts +0 -17
  117. package/packages/chunker/dist/markdown-chunker.js +0 -3
  118. package/packages/chunker/dist/wasm/languages.d.ts +0 -18
  119. package/packages/chunker/dist/wasm/languages.js +0 -1
  120. package/packages/chunker/dist/wasm/query-executor.d.ts +0 -70
  121. package/packages/chunker/dist/wasm/query-executor.js +0 -1
  122. package/packages/chunker/dist/wasm/runtime.d.ts +0 -44
  123. package/packages/chunker/dist/wasm/runtime.js +0 -1
  124. package/packages/chunker/dist/wasm/types.d.ts +0 -84
  125. package/packages/chunker/dist/wasm/types.js +0 -1
  126. package/packages/chunker/dist/wasm-chunker.d.ts +0 -23
  127. package/packages/chunker/dist/wasm-chunker.js +0 -6
  128. package/packages/cli/dist/aikit-init.d.ts +0 -59
  129. package/packages/cli/dist/aikit-init.js +0 -1
  130. package/packages/cli/dist/commands/analyze.d.ts +0 -6
  131. package/packages/cli/dist/commands/analyze.js +0 -2
  132. package/packages/cli/dist/commands/context-cmds.d.ts +0 -6
  133. package/packages/cli/dist/commands/context-cmds.js +0 -1
  134. package/packages/cli/dist/commands/environment.d.ts +0 -6
  135. package/packages/cli/dist/commands/environment.js +0 -1
  136. package/packages/cli/dist/commands/execution.d.ts +0 -6
  137. package/packages/cli/dist/commands/execution.js +0 -1
  138. package/packages/cli/dist/commands/flow.d.ts +0 -6
  139. package/packages/cli/dist/commands/flow.js +0 -1
  140. package/packages/cli/dist/commands/graph.d.ts +0 -6
  141. package/packages/cli/dist/commands/graph.js +0 -6
  142. package/packages/cli/dist/commands/init/adapters.d.ts +0 -28
  143. package/packages/cli/dist/commands/init/adapters.js +0 -1
  144. package/packages/cli/dist/commands/init/config.d.ts +0 -10
  145. package/packages/cli/dist/commands/init/config.js +0 -3
  146. package/packages/cli/dist/commands/init/constants.d.ts +0 -46
  147. package/packages/cli/dist/commands/init/curated.d.ts +0 -7
  148. package/packages/cli/dist/commands/init/curated.js +0 -1
  149. package/packages/cli/dist/commands/init/frontmatter.d.ts +0 -79
  150. package/packages/cli/dist/commands/init/frontmatter.js +0 -2
  151. package/packages/cli/dist/commands/init/index.d.ts +0 -36
  152. package/packages/cli/dist/commands/init/index.js +0 -5
  153. package/packages/cli/dist/commands/init/manifest.d.ts +0 -72
  154. package/packages/cli/dist/commands/init/manifest.js +0 -1
  155. package/packages/cli/dist/commands/init/scaffold.d.ts +0 -58
  156. package/packages/cli/dist/commands/init/scaffold.js +0 -1
  157. package/packages/cli/dist/commands/init/templates.d.ts +0 -9
  158. package/packages/cli/dist/commands/init/user.d.ts +0 -61
  159. package/packages/cli/dist/commands/init/user.js +0 -5
  160. package/packages/cli/dist/commands/knowledge.d.ts +0 -6
  161. package/packages/cli/dist/commands/knowledge.js +0 -1
  162. package/packages/cli/dist/commands/search.d.ts +0 -6
  163. package/packages/cli/dist/commands/search.js +0 -1
  164. package/packages/cli/dist/commands/system.d.ts +0 -6
  165. package/packages/cli/dist/commands/system.js +0 -4
  166. package/packages/cli/dist/commands/upgrade.d.ts +0 -6
  167. package/packages/cli/dist/commands/upgrade.js +0 -1
  168. package/packages/cli/dist/commands/workspace.d.ts +0 -6
  169. package/packages/cli/dist/commands/workspace.js +0 -1
  170. package/packages/cli/dist/context.d.ts +0 -7
  171. package/packages/cli/dist/context.js +0 -1
  172. package/packages/cli/dist/helpers.d.ts +0 -55
  173. package/packages/cli/dist/helpers.js +0 -5
  174. package/packages/cli/dist/types.d.ts +0 -9
  175. package/packages/cli/dist/types.js +0 -1
  176. package/packages/core/dist/constants.d.ts +0 -74
  177. package/packages/core/dist/constants.js +0 -1
  178. package/packages/core/dist/content-detector.d.ts +0 -13
  179. package/packages/core/dist/content-detector.js +0 -1
  180. package/packages/core/dist/errors.d.ts +0 -20
  181. package/packages/core/dist/errors.js +0 -1
  182. package/packages/core/dist/global-registry.d.ts +0 -69
  183. package/packages/core/dist/global-registry.js +0 -1
  184. package/packages/core/dist/logger.d.ts +0 -32
  185. package/packages/core/dist/logger.js +0 -1
  186. package/packages/core/dist/types.d.ts +0 -149
  187. package/packages/core/dist/types.js +0 -1
  188. package/packages/dashboard/dist/assets/index-Cdke3KDK.js.map +0 -1
  189. package/packages/elicitation/dist/build.d.ts +0 -14
  190. package/packages/elicitation/dist/build.js +0 -1
  191. package/packages/elicitation/dist/fields.d.ts +0 -32
  192. package/packages/elicitation/dist/fields.js +0 -1
  193. package/packages/elicitation/dist/normalize.d.ts +0 -15
  194. package/packages/elicitation/dist/normalize.js +0 -1
  195. package/packages/elicitation/dist/types.d.ts +0 -88
  196. package/packages/elicitation/dist/types.js +0 -1
  197. package/packages/embeddings/dist/embedder.interface.d.ts +0 -26
  198. package/packages/embeddings/dist/embedder.interface.js +0 -1
  199. package/packages/embeddings/dist/onnx-embedder.d.ts +0 -23
  200. package/packages/embeddings/dist/onnx-embedder.js +0 -1
  201. package/packages/enterprise-bridge/dist/cache.d.ts +0 -28
  202. package/packages/enterprise-bridge/dist/cache.js +0 -1
  203. package/packages/enterprise-bridge/dist/er-client.d.ts +0 -37
  204. package/packages/enterprise-bridge/dist/er-client.js +0 -1
  205. package/packages/enterprise-bridge/dist/evolution-collector.d.ts +0 -62
  206. package/packages/enterprise-bridge/dist/evolution-collector.js +0 -1
  207. package/packages/enterprise-bridge/dist/policy-store.d.ts +0 -45
  208. package/packages/enterprise-bridge/dist/policy-store.js +0 -1
  209. package/packages/enterprise-bridge/dist/push-adapter.d.ts +0 -23
  210. package/packages/enterprise-bridge/dist/push-adapter.js +0 -1
  211. package/packages/enterprise-bridge/dist/result-merger.d.ts +0 -14
  212. package/packages/enterprise-bridge/dist/result-merger.js +0 -1
  213. package/packages/enterprise-bridge/dist/types.d.ts +0 -81
  214. package/packages/enterprise-bridge/dist/types.js +0 -1
  215. package/packages/flows/dist/adapters/claude-plugin.d.ts +0 -25
  216. package/packages/flows/dist/adapters/claude-plugin.js +0 -3
  217. package/packages/flows/dist/adapters/copilot.d.ts +0 -12
  218. package/packages/flows/dist/adapters/copilot.js +0 -1
  219. package/packages/flows/dist/adapters/index.d.ts +0 -12
  220. package/packages/flows/dist/adapters/index.js +0 -1
  221. package/packages/flows/dist/adapters/native.d.ts +0 -10
  222. package/packages/flows/dist/adapters/native.js +0 -1
  223. package/packages/flows/dist/adapters/openspec.d.ts +0 -40
  224. package/packages/flows/dist/adapters/openspec.js +0 -1
  225. package/packages/flows/dist/builtins.d.ts +0 -16
  226. package/packages/flows/dist/builtins.js +0 -1
  227. package/packages/flows/dist/foundation.d.ts +0 -20
  228. package/packages/flows/dist/foundation.js +0 -11
  229. package/packages/flows/dist/git.d.ts +0 -53
  230. package/packages/flows/dist/git.js +0 -2
  231. package/packages/flows/dist/loader.d.ts +0 -13
  232. package/packages/flows/dist/loader.js +0 -2
  233. package/packages/flows/dist/registry.d.ts +0 -23
  234. package/packages/flows/dist/registry.js +0 -1
  235. package/packages/flows/dist/state-machine.d.ts +0 -23
  236. package/packages/flows/dist/state-machine.js +0 -1
  237. package/packages/flows/dist/symlinks.d.ts +0 -17
  238. package/packages/flows/dist/symlinks.js +0 -1
  239. package/packages/flows/dist/types.d.ts +0 -127
  240. package/packages/flows/dist/types.js +0 -1
  241. package/packages/indexer/dist/file-hasher.d.ts +0 -13
  242. package/packages/indexer/dist/file-hasher.js +0 -1
  243. package/packages/indexer/dist/filesystem-crawler.d.ts +0 -29
  244. package/packages/indexer/dist/filesystem-crawler.js +0 -1
  245. package/packages/indexer/dist/graph-extractor.d.ts +0 -22
  246. package/packages/indexer/dist/graph-extractor.js +0 -1
  247. package/packages/indexer/dist/hash-cache.d.ts +0 -24
  248. package/packages/indexer/dist/hash-cache.js +0 -1
  249. package/packages/indexer/dist/incremental-indexer.d.ts +0 -73
  250. package/packages/indexer/dist/incremental-indexer.js +0 -1
  251. package/packages/indexer/dist/smart-index-scheduler.d.ts +0 -47
  252. package/packages/indexer/dist/smart-index-scheduler.js +0 -1
  253. package/packages/server/dist/api.d.ts +0 -3
  254. package/packages/server/dist/api.js +0 -1
  255. package/packages/server/dist/auto-gc.d.ts +0 -30
  256. package/packages/server/dist/auto-gc.js +0 -1
  257. package/packages/server/dist/background-task.d.ts +0 -47
  258. package/packages/server/dist/background-task.js +0 -1
  259. package/packages/server/dist/completions.d.ts +0 -14
  260. package/packages/server/dist/completions.js +0 -1
  261. package/packages/server/dist/compression-interceptor.d.ts +0 -12
  262. package/packages/server/dist/compression-interceptor.js +0 -1
  263. package/packages/server/dist/config.d.ts +0 -16
  264. package/packages/server/dist/cross-workspace.d.ts +0 -43
  265. package/packages/server/dist/cross-workspace.js +0 -1
  266. package/packages/server/dist/curated-manager.d.ts +0 -92
  267. package/packages/server/dist/curated-manager.js +0 -5
  268. package/packages/server/dist/dashboard-static.d.ts +0 -27
  269. package/packages/server/dist/elicitor.d.ts +0 -18
  270. package/packages/server/dist/elicitor.js +0 -1
  271. package/packages/server/dist/idle-timer.d.ts +0 -33
  272. package/packages/server/dist/idle-timer.js +0 -1
  273. package/packages/server/dist/mcp-logging.d.ts +0 -11
  274. package/packages/server/dist/mcp-logging.js +0 -1
  275. package/packages/server/dist/memory-monitor.d.ts +0 -37
  276. package/packages/server/dist/memory-monitor.js +0 -1
  277. package/packages/server/dist/output-schemas.d.ts +0 -244
  278. package/packages/server/dist/output-schemas.js +0 -1
  279. package/packages/server/dist/prompts.d.ts +0 -13
  280. package/packages/server/dist/prompts.js +0 -13
  281. package/packages/server/dist/replay-interceptor.d.ts +0 -23
  282. package/packages/server/dist/replay-interceptor.js +0 -1
  283. package/packages/server/dist/resource-links.d.ts +0 -34
  284. package/packages/server/dist/resource-links.js +0 -1
  285. package/packages/server/dist/resources/curated-resources.d.ts +0 -13
  286. package/packages/server/dist/resources/curated-resources.js +0 -2
  287. package/packages/server/dist/resources/resource-notifier.d.ts +0 -45
  288. package/packages/server/dist/resources/resource-notifier.js +0 -1
  289. package/packages/server/dist/resources/resources.d.ts +0 -8
  290. package/packages/server/dist/resources/resources.js +0 -2
  291. package/packages/server/dist/sampling.d.ts +0 -41
  292. package/packages/server/dist/sampling.js +0 -2
  293. package/packages/server/dist/server.d.ts +0 -63
  294. package/packages/server/dist/server.js +0 -3
  295. package/packages/server/dist/structured-content-guard.d.ts +0 -28
  296. package/packages/server/dist/structured-content-guard.js +0 -1
  297. package/packages/server/dist/task-manager.d.ts +0 -40
  298. package/packages/server/dist/task-manager.js +0 -1
  299. package/packages/server/dist/tool-metadata.d.ts +0 -38
  300. package/packages/server/dist/tool-metadata.js +0 -1
  301. package/packages/server/dist/tool-prefix.d.ts +0 -12
  302. package/packages/server/dist/tool-prefix.js +0 -1
  303. package/packages/server/dist/tool-timeout.d.ts +0 -27
  304. package/packages/server/dist/tool-timeout.js +0 -1
  305. package/packages/server/dist/tools/analyze.tools.d.ts +0 -14
  306. package/packages/server/dist/tools/analyze.tools.js +0 -8
  307. package/packages/server/dist/tools/audit.tool.d.ts +0 -8
  308. package/packages/server/dist/tools/audit.tool.js +0 -1
  309. package/packages/server/dist/tools/brainstorm.tool.d.ts +0 -7
  310. package/packages/server/dist/tools/brainstorm.tool.js +0 -9
  311. package/packages/server/dist/tools/bridge.tools.d.ts +0 -34
  312. package/packages/server/dist/tools/bridge.tools.js +0 -15
  313. package/packages/server/dist/tools/config.tool.d.ts +0 -8
  314. package/packages/server/dist/tools/config.tool.js +0 -12
  315. package/packages/server/dist/tools/context.tools.d.ts +0 -15
  316. package/packages/server/dist/tools/context.tools.js +0 -10
  317. package/packages/server/dist/tools/evolution.tools.d.ts +0 -7
  318. package/packages/server/dist/tools/evolution.tools.js +0 -5
  319. package/packages/server/dist/tools/execution.tools.d.ts +0 -14
  320. package/packages/server/dist/tools/execution.tools.js +0 -4
  321. package/packages/server/dist/tools/flow.tools.d.ts +0 -7
  322. package/packages/server/dist/tools/flow.tools.js +0 -16
  323. package/packages/server/dist/tools/forge.tools.d.ts +0 -13
  324. package/packages/server/dist/tools/forge.tools.js +0 -10
  325. package/packages/server/dist/tools/forget.tool.d.ts +0 -8
  326. package/packages/server/dist/tools/forget.tool.js +0 -1
  327. package/packages/server/dist/tools/graph.tool.d.ts +0 -7
  328. package/packages/server/dist/tools/graph.tool.js +0 -29
  329. package/packages/server/dist/tools/infra.tools.d.ts +0 -10
  330. package/packages/server/dist/tools/infra.tools.js +0 -5
  331. package/packages/server/dist/tools/list.tool.d.ts +0 -7
  332. package/packages/server/dist/tools/list.tool.js +0 -2
  333. package/packages/server/dist/tools/lookup.tool.d.ts +0 -7
  334. package/packages/server/dist/tools/lookup.tool.js +0 -3
  335. package/packages/server/dist/tools/manipulation.tools.d.ts +0 -10
  336. package/packages/server/dist/tools/manipulation.tools.js +0 -4
  337. package/packages/server/dist/tools/onboard.tool.d.ts +0 -12
  338. package/packages/server/dist/tools/onboard.tool.js +0 -2
  339. package/packages/server/dist/tools/persistence.tools.d.ts +0 -10
  340. package/packages/server/dist/tools/persistence.tools.js +0 -5
  341. package/packages/server/dist/tools/policy.tools.d.ts +0 -7
  342. package/packages/server/dist/tools/policy.tools.js +0 -3
  343. package/packages/server/dist/tools/present/browser.d.ts +0 -4
  344. package/packages/server/dist/tools/present/browser.js +0 -93
  345. package/packages/server/dist/tools/present/helpers.d.ts +0 -19
  346. package/packages/server/dist/tools/present/helpers.js +0 -16
  347. package/packages/server/dist/tools/present/html.d.ts +0 -18
  348. package/packages/server/dist/tools/present/html.js +0 -5
  349. package/packages/server/dist/tools/present/index.d.ts +0 -2
  350. package/packages/server/dist/tools/present/index.js +0 -1
  351. package/packages/server/dist/tools/present/markdown.d.ts +0 -32
  352. package/packages/server/dist/tools/present/markdown.js +0 -11
  353. package/packages/server/dist/tools/present/templates.d.ts +0 -14
  354. package/packages/server/dist/tools/present/templates.js +0 -472
  355. package/packages/server/dist/tools/present/tool.d.ts +0 -27
  356. package/packages/server/dist/tools/present/tool.js +0 -39
  357. package/packages/server/dist/tools/present-blocks.d.ts +0 -46
  358. package/packages/server/dist/tools/present-blocks.js +0 -27
  359. package/packages/server/dist/tools/present-charts.d.ts +0 -31
  360. package/packages/server/dist/tools/present-charts.js +0 -34
  361. package/packages/server/dist/tools/present-theme.d.ts +0 -14
  362. package/packages/server/dist/tools/present-theme.js +0 -396
  363. package/packages/server/dist/tools/present-utils.d.ts +0 -11
  364. package/packages/server/dist/tools/present-utils.js +0 -1
  365. package/packages/server/dist/tools/present.tool.d.ts +0 -2
  366. package/packages/server/dist/tools/present.tool.js +0 -1
  367. package/packages/server/dist/tools/produce.tool.d.ts +0 -7
  368. package/packages/server/dist/tools/produce.tool.js +0 -4
  369. package/packages/server/dist/tools/read.tool.d.ts +0 -7
  370. package/packages/server/dist/tools/read.tool.js +0 -2
  371. package/packages/server/dist/tools/reindex.tool.d.ts +0 -11
  372. package/packages/server/dist/tools/reindex.tool.js +0 -9
  373. package/packages/server/dist/tools/remember.tool.d.ts +0 -9
  374. package/packages/server/dist/tools/remember.tool.js +0 -4
  375. package/packages/server/dist/tools/replay.tool.d.ts +0 -6
  376. package/packages/server/dist/tools/replay.tool.js +0 -3
  377. package/packages/server/dist/tools/restore.tool.d.ts +0 -6
  378. package/packages/server/dist/tools/restore.tool.js +0 -3
  379. package/packages/server/dist/tools/search.tool.d.ts +0 -11
  380. package/packages/server/dist/tools/search.tool.js +0 -10
  381. package/packages/server/dist/tools/status.tool.d.ts +0 -28
  382. package/packages/server/dist/tools/status.tool.js +0 -3
  383. package/packages/server/dist/tools/update.tool.d.ts +0 -8
  384. package/packages/server/dist/tools/update.tool.js +0 -1
  385. package/packages/server/dist/tools/utility.tools.d.ts +0 -15
  386. package/packages/server/dist/tools/utility.tools.js +0 -13
  387. package/packages/server/dist/version-check.d.ts +0 -32
  388. package/packages/store/dist/graph-store.interface.d.ts +0 -159
  389. package/packages/store/dist/graph-store.interface.js +0 -1
  390. package/packages/store/dist/lance-store.d.ts +0 -46
  391. package/packages/store/dist/lance-store.js +0 -1
  392. package/packages/store/dist/sqlite-graph-store.d.ts +0 -57
  393. package/packages/store/dist/sqlite-graph-store.js +0 -90
  394. package/packages/store/dist/store-factory.d.ts +0 -12
  395. package/packages/store/dist/store-factory.js +0 -1
  396. package/packages/store/dist/store.interface.d.ts +0 -54
  397. package/packages/store/dist/store.interface.js +0 -1
  398. package/packages/tools/dist/audit.d.ts +0 -65
  399. package/packages/tools/dist/audit.js +0 -6
  400. package/packages/tools/dist/batch.d.ts +0 -23
  401. package/packages/tools/dist/batch.js +0 -1
  402. package/packages/tools/dist/changelog.d.ts +0 -36
  403. package/packages/tools/dist/changelog.js +0 -2
  404. package/packages/tools/dist/check.d.ts +0 -48
  405. package/packages/tools/dist/check.js +0 -2
  406. package/packages/tools/dist/checkpoint.d.ts +0 -19
  407. package/packages/tools/dist/checkpoint.js +0 -1
  408. package/packages/tools/dist/codemod.d.ts +0 -39
  409. package/packages/tools/dist/codemod.js +0 -2
  410. package/packages/tools/dist/compact.d.ts +0 -47
  411. package/packages/tools/dist/compact.js +0 -3
  412. package/packages/tools/dist/compress-output.d.ts +0 -38
  413. package/packages/tools/dist/compress-output.js +0 -1
  414. package/packages/tools/dist/compression/delta-cache.d.ts +0 -29
  415. package/packages/tools/dist/compression/delta-cache.js +0 -1
  416. package/packages/tools/dist/compression/engine.d.ts +0 -34
  417. package/packages/tools/dist/compression/engine.js +0 -4
  418. package/packages/tools/dist/compression/litm.d.ts +0 -20
  419. package/packages/tools/dist/compression/litm.js +0 -1
  420. package/packages/tools/dist/compression/mmr.d.ts +0 -24
  421. package/packages/tools/dist/compression/mmr.js +0 -1
  422. package/packages/tools/dist/compression/rules/docker.d.ts +0 -11
  423. package/packages/tools/dist/compression/rules/docker.js +0 -3
  424. package/packages/tools/dist/compression/rules/generic.d.ts +0 -11
  425. package/packages/tools/dist/compression/rules/generic.js +0 -3
  426. package/packages/tools/dist/compression/rules/git.d.ts +0 -11
  427. package/packages/tools/dist/compression/rules/git.js +0 -3
  428. package/packages/tools/dist/compression/rules/index.d.ts +0 -14
  429. package/packages/tools/dist/compression/rules/index.js +0 -1
  430. package/packages/tools/dist/compression/rules/kubectl.d.ts +0 -11
  431. package/packages/tools/dist/compression/rules/kubectl.js +0 -3
  432. package/packages/tools/dist/compression/rules/lint.d.ts +0 -11
  433. package/packages/tools/dist/compression/rules/lint.js +0 -3
  434. package/packages/tools/dist/compression/rules/npm.d.ts +0 -11
  435. package/packages/tools/dist/compression/rules/npm.js +0 -3
  436. package/packages/tools/dist/compression/rules/test-runner.d.ts +0 -11
  437. package/packages/tools/dist/compression/rules/test-runner.js +0 -3
  438. package/packages/tools/dist/compression/scoring.d.ts +0 -26
  439. package/packages/tools/dist/compression/scoring.js +0 -1
  440. package/packages/tools/dist/compression/types.d.ts +0 -61
  441. package/packages/tools/dist/compression/types.js +0 -1
  442. package/packages/tools/dist/config-extractor.d.ts +0 -9
  443. package/packages/tools/dist/config-extractor.js +0 -7
  444. package/packages/tools/dist/data-transform.d.ts +0 -12
  445. package/packages/tools/dist/data-transform.js +0 -1
  446. package/packages/tools/dist/dead-symbols.d.ts +0 -28
  447. package/packages/tools/dist/dead-symbols.js +0 -2
  448. package/packages/tools/dist/delegate.d.ts +0 -36
  449. package/packages/tools/dist/delegate.js +0 -1
  450. package/packages/tools/dist/diagram-builder.d.ts +0 -9
  451. package/packages/tools/dist/diagram-builder.js +0 -9
  452. package/packages/tools/dist/diff-parse.d.ts +0 -28
  453. package/packages/tools/dist/diff-parse.js +0 -3
  454. package/packages/tools/dist/digest.d.ts +0 -55
  455. package/packages/tools/dist/digest.js +0 -6
  456. package/packages/tools/dist/dogfood-log.d.ts +0 -49
  457. package/packages/tools/dist/dogfood-log.js +0 -2
  458. package/packages/tools/dist/encode.d.ts +0 -16
  459. package/packages/tools/dist/encode.js +0 -1
  460. package/packages/tools/dist/env-info.d.ts +0 -30
  461. package/packages/tools/dist/env-info.js +0 -1
  462. package/packages/tools/dist/eval.d.ts +0 -15
  463. package/packages/tools/dist/eval.js +0 -2
  464. package/packages/tools/dist/evidence-map.d.ts +0 -92
  465. package/packages/tools/dist/evidence-map.js +0 -2
  466. package/packages/tools/dist/file-cache.d.ts +0 -41
  467. package/packages/tools/dist/file-cache.js +0 -3
  468. package/packages/tools/dist/file-summary.d.ts +0 -52
  469. package/packages/tools/dist/file-summary.js +0 -2
  470. package/packages/tools/dist/file-walk.d.ts +0 -6
  471. package/packages/tools/dist/file-walk.js +0 -1
  472. package/packages/tools/dist/find-examples.d.ts +0 -29
  473. package/packages/tools/dist/find-examples.js +0 -3
  474. package/packages/tools/dist/find.d.ts +0 -49
  475. package/packages/tools/dist/find.js +0 -1
  476. package/packages/tools/dist/forge-classify.d.ts +0 -44
  477. package/packages/tools/dist/forge-classify.js +0 -2
  478. package/packages/tools/dist/forge-ground.d.ts +0 -61
  479. package/packages/tools/dist/forge-ground.js +0 -1
  480. package/packages/tools/dist/git-context.d.ts +0 -25
  481. package/packages/tools/dist/git-context.js +0 -3
  482. package/packages/tools/dist/graph-query.d.ts +0 -98
  483. package/packages/tools/dist/graph-query.js +0 -1
  484. package/packages/tools/dist/guide.d.ts +0 -25
  485. package/packages/tools/dist/guide.js +0 -1
  486. package/packages/tools/dist/health.d.ts +0 -16
  487. package/packages/tools/dist/health.js +0 -2
  488. package/packages/tools/dist/http-request.d.ts +0 -25
  489. package/packages/tools/dist/http-request.js +0 -1
  490. package/packages/tools/dist/lane.d.ts +0 -41
  491. package/packages/tools/dist/lane.js +0 -6
  492. package/packages/tools/dist/measure.d.ts +0 -42
  493. package/packages/tools/dist/measure.js +0 -2
  494. package/packages/tools/dist/onboard-utils.d.ts +0 -12
  495. package/packages/tools/dist/onboard-utils.js +0 -1
  496. package/packages/tools/dist/onboard.d.ts +0 -50
  497. package/packages/tools/dist/onboard.js +0 -18
  498. package/packages/tools/dist/parse-output.d.ts +0 -84
  499. package/packages/tools/dist/parse-output.js +0 -2
  500. package/packages/tools/dist/path-resolver.d.ts +0 -14
  501. package/packages/tools/dist/path-resolver.js +0 -1
  502. package/packages/tools/dist/process-manager.d.ts +0 -20
  503. package/packages/tools/dist/process-manager.js +0 -1
  504. package/packages/tools/dist/queue.d.ts +0 -40
  505. package/packages/tools/dist/queue.js +0 -1
  506. package/packages/tools/dist/regex-test.d.ts +0 -33
  507. package/packages/tools/dist/regex-test.js +0 -1
  508. package/packages/tools/dist/regex-utils.d.ts +0 -8
  509. package/packages/tools/dist/regex-utils.js +0 -1
  510. package/packages/tools/dist/rename.d.ts +0 -31
  511. package/packages/tools/dist/rename.js +0 -2
  512. package/packages/tools/dist/replay.d.ts +0 -59
  513. package/packages/tools/dist/replay.js +0 -4
  514. package/packages/tools/dist/response-envelope.d.ts +0 -43
  515. package/packages/tools/dist/response-envelope.js +0 -1
  516. package/packages/tools/dist/restore-points.d.ts +0 -22
  517. package/packages/tools/dist/restore-points.js +0 -1
  518. package/packages/tools/dist/schema-validate.d.ts +0 -25
  519. package/packages/tools/dist/schema-validate.js +0 -1
  520. package/packages/tools/dist/scope-map.d.ts +0 -51
  521. package/packages/tools/dist/scope-map.js +0 -1
  522. package/packages/tools/dist/snippet.d.ts +0 -35
  523. package/packages/tools/dist/snippet.js +0 -1
  524. package/packages/tools/dist/stash.d.ts +0 -14
  525. package/packages/tools/dist/stash.js +0 -1
  526. package/packages/tools/dist/stratum-card.d.ts +0 -30
  527. package/packages/tools/dist/stratum-card.js +0 -4
  528. package/packages/tools/dist/symbol.d.ts +0 -45
  529. package/packages/tools/dist/symbol.js +0 -3
  530. package/packages/tools/dist/synthesis-engine.d.ts +0 -13
  531. package/packages/tools/dist/synthesis-engine.js +0 -6
  532. package/packages/tools/dist/test-run.d.ts +0 -28
  533. package/packages/tools/dist/test-run.js +0 -2
  534. package/packages/tools/dist/text-utils.d.ts +0 -24
  535. package/packages/tools/dist/text-utils.js +0 -2
  536. package/packages/tools/dist/time-utils.d.ts +0 -20
  537. package/packages/tools/dist/time-utils.js +0 -1
  538. package/packages/tools/dist/trace.d.ts +0 -43
  539. package/packages/tools/dist/trace.js +0 -2
  540. package/packages/tools/dist/truncation.d.ts +0 -66
  541. package/packages/tools/dist/truncation.js +0 -11
  542. package/packages/tools/dist/watch.d.ts +0 -32
  543. package/packages/tools/dist/watch.js +0 -1
  544. package/packages/tools/dist/web-fetch.d.ts +0 -47
  545. package/packages/tools/dist/web-fetch.js +0 -8
  546. package/packages/tools/dist/web-search.d.ts +0 -25
  547. package/packages/tools/dist/web-search.js +0 -1
  548. package/packages/tools/dist/workset.d.ts +0 -47
  549. package/packages/tools/dist/workset.js +0 -1
  550. package/scaffold/__tests__/copilot-inline-shared-protocols.test.mjs +0 -39
  551. /package/packages/server/dist/{config.js → config-C5IU9Lau.js} +0 -0
  552. /package/packages/server/dist/{dashboard-static.js → dashboard-static-BfIe0Si1.js} +0 -0
  553. /package/packages/server/dist/{version-check.js → version-check-D4j0Pykd.js} +0 -0
@@ -1,92 +0,0 @@
1
- //#region packages/tools/src/evidence-map.d.ts
2
- /**
3
- * aikit_evidence_map — FORGE Evidence Map CRUD + Gate evaluator.
4
- *
5
- * Structured storage, validation, and gate evaluation for FORGE Evidence Map entries.
6
- * Persisted in .aikit-state/evidence-maps.json.
7
- */
8
- type EvidenceStatus = 'V' | 'A' | 'U';
9
- type UnknownType = 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
10
- type GateDecision = 'YIELD' | 'HOLD' | 'HARD_BLOCK' | 'FORCED_DELIVERY';
11
- type ForgeTier = 'floor' | 'standard' | 'critical';
12
- type SafetyGate = 'provenance' | 'commitment' | 'coverage';
13
- interface EvidenceEntry {
14
- id: number;
15
- claim: string;
16
- status: EvidenceStatus;
17
- receipt: string;
18
- criticalPath: boolean;
19
- unknownType?: UnknownType;
20
- safetyGate?: SafetyGate;
21
- }
22
- interface EvidenceMapState {
23
- taskId: string;
24
- tier: ForgeTier;
25
- entries: EvidenceEntry[];
26
- createdAt: string;
27
- updatedAt: string;
28
- }
29
- interface SafetyGateResult {
30
- provenance: 'pass' | 'fail';
31
- commitment: 'pass' | 'fail';
32
- coverage: 'pass' | 'fail';
33
- failures: string[];
34
- }
35
- interface GateResult {
36
- decision: GateDecision;
37
- reason: string;
38
- unresolvedCritical: EvidenceEntry[];
39
- warnings: string[];
40
- stats: {
41
- total: number;
42
- verified: number;
43
- assumed: number;
44
- unresolved: number;
45
- };
46
- safetyGates?: SafetyGateResult;
47
- annotation?: string;
48
- }
49
- type EvidenceMapAction = {
50
- action: 'create';
51
- taskId: string;
52
- tier: ForgeTier;
53
- } | {
54
- action: 'add';
55
- taskId: string;
56
- claim: string;
57
- status: EvidenceStatus;
58
- receipt: string;
59
- criticalPath?: boolean;
60
- unknownType?: UnknownType;
61
- safetyGate?: SafetyGate;
62
- } | {
63
- action: 'update';
64
- taskId: string;
65
- id: number;
66
- status: EvidenceStatus;
67
- receipt: string;
68
- } | {
69
- action: 'get';
70
- taskId: string;
71
- } | {
72
- action: 'gate';
73
- taskId: string;
74
- retryCount?: number;
75
- } | {
76
- action: 'list';
77
- } | {
78
- action: 'delete';
79
- taskId: string;
80
- };
81
- interface EvidenceMapResult {
82
- state?: EvidenceMapState;
83
- states?: EvidenceMapState[];
84
- entry?: EvidenceEntry;
85
- gate?: GateResult;
86
- deleted?: boolean;
87
- formattedMap?: string;
88
- }
89
- declare function evidenceMap(action: EvidenceMapAction, cwd?: string): EvidenceMapResult;
90
- declare function autoClaimTestFailures(taskId: string, failures: string[], cwd?: string): EvidenceEntry[];
91
- //#endregion
92
- export { EvidenceEntry, EvidenceMapAction, EvidenceMapResult, EvidenceMapState, EvidenceStatus, ForgeTier, GateDecision, GateResult, SafetyGate, SafetyGateResult, UnknownType, autoClaimTestFailures, evidenceMap };
@@ -1,2 +0,0 @@
1
- import{dirname as e,resolve as t}from"node:path";import{existsSync as n,mkdirSync as r,readFileSync as i,renameSync as a,writeFileSync as o}from"node:fs";import{resolveStateDir as s}from"../../core/dist/index.js";function c(e){return t(s(e??process.cwd()),`evidence-maps.json`)}function l(e){let t=c(e);if(!n(t))return{};try{let e=i(t,`utf-8`);return JSON.parse(e)}catch(e){return e?.code===`ENOENT`||console.warn(`Corrupt state file ${t}: ${e instanceof Error?e.message:String(e)}`),{}}}function u(t,i){let s=c(i),l=e(s);n(l)||r(l,{recursive:!0});let u=`${s}.tmp`;o(u,`${JSON.stringify(t,null,2)}\n`,`utf-8`),a(u,s)}function d(e,t){let n=l(t),r=n[e];if(!r)throw Error(`Evidence map not found: ${e}`);return{maps:n,state:r}}function f(e){return e.reduce((e,t)=>Math.max(e,t.id),0)+1}function p(e){let t=e.trim();if(!t)throw Error(`Claim is required`);if(/\r?\n/.test(t))throw Error(`Claim must be a single line`);return t}function m(e){return(e??``).replace(/\r?\n/g,` `).replace(/\|/g,`\\|`)}function h(e){let t=[`| # | Claim | Status | Receipt | Critical | Type | Safety |`,`|---|-------|--------|---------|----------|------|--------|`];for(let n of e.entries)t.push(`| ${n.id} | ${m(n.claim)} | ${n.status} | ${m(n.receipt)} | ${n.criticalPath?`yes`:`no`} | ${m(n.unknownType)} | ${m(n.safetyGate)} |`);return t.join(`
2
- `)}function g(e){return{total:e.length,verified:e.filter(e=>e.status===`V`).length,assumed:e.filter(e=>e.status===`A`).length,unresolved:e.filter(e=>e.status===`U`).length}}function _(e){let t=[];for(let n of e.entries)n.status===`V`&&n.receipt.trim()===``&&t.push(`V entry without receipt`),n.status===`A`&&e.tier===`critical`&&n.unknownType===`contract`&&t.push(`Assumed contract at Critical tier — should be Verified`);return t}function v(e){return`FORCED DELIVERY annotation: unresolved entries remain -> ${e.filter(e=>e.status===`U`).map(e=>`#${e.id} ${e.claim}`).join(`; `)}`}function y(e){let t=[],n=e.entries.filter(e=>e.status===`V`&&!e.receipt.trim());n.length>0&&t.push(`Provenance: ${n.length} verified claim(s) lack receipts`);let r=e.entries.filter(e=>e.safetyGate===`commitment`&&e.status!==`V`);r.length>0&&t.push(`Commitment: ${r.length} commitment(s) not verified`);let i=e.entries.some(e=>e.safetyGate===`coverage`&&e.status===`U`);return i&&t.push(`Coverage: unresolved coverage entries remain`),{provenance:n.length>0?`fail`:`pass`,commitment:r.length>0?`fail`:`pass`,coverage:i?`fail`:`pass`,failures:t}}function b(e,t=0){let n=e.entries.filter(e=>e.criticalPath&&e.status===`U`),r=_(e),i=g(e.entries);return n.find(e=>e.unknownType===`contract`)?{decision:`HARD_BLOCK`,reason:`Unresolved contract unknown on critical path`,unresolvedCritical:n,warnings:r,stats:i}:n.length>0&&t===0?{decision:`HOLD`,reason:`Unresolved critical-path unknown — retry available`,unresolvedCritical:n,warnings:r,stats:i}:n.length>0&&t>=1?{decision:`FORCED_DELIVERY`,reason:`Unresolved critical-path unknown after retry`,unresolvedCritical:n,warnings:r,stats:i,annotation:v(e.entries)}:{decision:`YIELD`,reason:`All critical-path claims satisfy gate rules`,unresolvedCritical:[],warnings:r,stats:i,...x(e,r,i)}}function x(e,t,n){if(!e.entries.some(e=>e.safetyGate)||e.tier===`floor`)return{};let r=y(e);return r.failures.length>0?{safetyGates:r,decision:`HOLD`,reason:`Safety gate failure: ${r.failures.join(`; `)}`,warnings:[...t,...r.failures]}:{safetyGates:r}}function S(e,t){switch(e.action){case`create`:{let n=l(t),r=new Date().toISOString(),i={taskId:e.taskId,tier:e.tier,entries:[],createdAt:r,updatedAt:r};return n[e.taskId]=i,u(n,t),{state:i,formattedMap:h(i)}}case`add`:{let{maps:n,state:r}=d(e.taskId,t),i={id:f(r.entries),claim:p(e.claim),status:e.status,receipt:e.receipt,criticalPath:e.criticalPath??!1,unknownType:e.unknownType,safetyGate:e.safetyGate};return r.entries.push(i),r.updatedAt=new Date().toISOString(),n[e.taskId]=r,u(n,t),{state:r,entry:i,formattedMap:h(r)}}case`update`:{let{maps:n,state:r}=d(e.taskId,t),i=r.entries.find(t=>t.id===e.id);if(!i)throw Error(`Evidence entry not found: ${e.id}`);return i.status=e.status,i.receipt=e.receipt,r.updatedAt=new Date().toISOString(),n[e.taskId]=r,u(n,t),{state:r,entry:i,formattedMap:h(r)}}case`get`:{let{state:n}=d(e.taskId,t);return{state:n,formattedMap:h(n)}}case`gate`:{let{state:n}=d(e.taskId,t);return{state:n,gate:b(n,e.retryCount??0),formattedMap:h(n)}}case`list`:return{states:Object.values(l(t)).sort((e,t)=>e.createdAt.localeCompare(t.createdAt))};case`delete`:{let n=l(t);return e.taskId in n?(delete n[e.taskId],u(n,t),{deleted:!0}):{deleted:!1}}}}function C(e,t,n){let r=[];for(let i of t){let t=S({action:`add`,taskId:e,claim:`Test failure: ${i}`,status:`U`,receipt:``,criticalPath:!0},n);t.entry&&r.push(t.entry)}return r}export{C as autoClaimTestFailures,S as evidenceMap};
@@ -1,41 +0,0 @@
1
- //#region packages/tools/src/file-cache.d.ts
2
- interface FileCacheEntry {
3
- /** Full file content */
4
- content: string;
5
- /** SHA-256 hash of content */
6
- hash: string;
7
- /** Line count */
8
- lines: number;
9
- /** Estimated token count (~chars/4) */
10
- estimatedTokens: number;
11
- /** How many times this file has been requested */
12
- hitCount: number;
13
- /** Whether content changed since last read (false on cache hit) */
14
- changed: boolean;
15
- }
16
- interface FileCacheStats {
17
- totalReads: number;
18
- cacheHits: number;
19
- filesTracked: number;
20
- }
21
- declare class FileCache {
22
- private cache;
23
- private totalReads;
24
- private cacheHits;
25
- private static readonly MAX_ENTRIES;
26
- /**
27
- * Get file content with deduplication.
28
- * First call: reads from disk, hashes, caches.
29
- * Subsequent calls: checks mtime → if unchanged, cache hit (skip read).
30
- * If mtime changed: re-reads, re-hashes, checks if content actually changed.
31
- */
32
- get(filePath: string): Promise<FileCacheEntry>;
33
- /** Remove a single file from cache. Returns true if it was cached. */
34
- invalidate(filePath: string): boolean;
35
- /** Clear all cached files. Returns how many were cleared. */
36
- clear(): number;
37
- /** Get cache statistics. */
38
- stats(): FileCacheStats;
39
- }
40
- //#endregion
41
- export { FileCache, FileCacheEntry, FileCacheStats };
@@ -1,3 +0,0 @@
1
- import{estimateTokens as e}from"./text-utils.js";import{readFile as t,stat as n}from"node:fs/promises";import{resolve as r}from"node:path";import{createHash as i}from"node:crypto";var a=class i{cache=new Map;totalReads=0;cacheHits=0;static MAX_ENTRIES=500;async get(a){let s=r(a);this.totalReads++;let c=await n(s);if(c.isDirectory())throw Error(`Path is a directory: ${a}. Expected a file path, not a directory. Use analyze_structure or find to explore directories.`);let l=c.mtimeMs,u=this.cache.get(s);if(u){if(u.mtimeMs===l)return this.cacheHits++,u.hitCount++,{content:u.content,hash:u.hash,lines:u.lines,estimatedTokens:u.estimatedTokens,hitCount:u.hitCount,changed:!1};let n=await t(s,`utf-8`),r=o(n);if(r===u.hash)return this.cacheHits++,u.hitCount++,u.mtimeMs=l,{content:u.content,hash:u.hash,lines:u.lines,estimatedTokens:u.estimatedTokens,hitCount:u.hitCount,changed:!1};let i=n.split(`
2
- `).length,a=e(n);return u.content=n,u.hash=r,u.lines=i,u.estimatedTokens=a,u.hitCount++,u.mtimeMs=l,{content:n,hash:r,lines:i,estimatedTokens:a,hitCount:u.hitCount,changed:!0}}let d=await t(s,`utf-8`),f=o(d),p=d.split(`
3
- `).length,m=e(d);if(this.cache.set(s,{content:d,hash:f,lines:p,estimatedTokens:m,hitCount:1,mtimeMs:l}),this.cache.size>i.MAX_ENTRIES){let e=this.cache.keys().next().value;e&&this.cache.delete(e)}return{content:d,hash:f,lines:p,estimatedTokens:m,hitCount:1,changed:!0}}invalidate(e){return this.cache.delete(r(e))}clear(){let e=this.cache.size;return this.cache.clear(),e}stats(){return{totalReads:this.totalReads,cacheHits:this.cacheHits,filesTracked:this.cache.size}}};function o(e){return i(`sha256`).update(e).digest(`hex`)}export{a as FileCache};
@@ -1,52 +0,0 @@
1
- //#region packages/tools/src/file-summary.d.ts
2
- interface FileSummaryOptions {
3
- path: string;
4
- /** Pre-loaded content — skip readFile when provided (e.g., from FileCache) */
5
- content?: string;
6
- previewLines?: number;
7
- }
8
- interface FileSummaryResult {
9
- path: string;
10
- lines: number;
11
- language: string;
12
- imports: string[];
13
- exports: string[];
14
- functions: Array<{
15
- name: string;
16
- line: number;
17
- exported: boolean;
18
- signature?: string;
19
- }>;
20
- classes: Array<{
21
- name: string;
22
- line: number;
23
- exported: boolean;
24
- signature?: string;
25
- }>;
26
- interfaces: Array<{
27
- name: string;
28
- line: number;
29
- exported: boolean;
30
- }>;
31
- types: Array<{
32
- name: string;
33
- line: number;
34
- exported: boolean;
35
- }>;
36
- /** Import details with external/internal classification (AST-powered) */
37
- importDetails?: Array<{
38
- source: string;
39
- specifiers: string[];
40
- isExternal: boolean;
41
- }>;
42
- /** Intra-file call edges showing which functions call which (AST-powered) */
43
- callEdges?: Array<{
44
- caller: string;
45
- callee: string;
46
- line: number;
47
- }>;
48
- estimatedTokens: number;
49
- }
50
- declare function fileSummary(options: FileSummaryOptions): Promise<FileSummaryResult>;
51
- //#endregion
52
- export { FileSummaryOptions, FileSummaryResult, fileSummary };
@@ -1,2 +0,0 @@
1
- import{readFile as e,stat as t}from"node:fs/promises";import{extname as n}from"node:path";import{SUPPORTED_EXTENSIONS as r,WasmRuntime as i,extractCalls as a,extractImports as o,extractSymbols as s}from"../../chunker/dist/index.js";async function c(a){let{path:o,previewLines:s=3}=a;if(!a.content){let e;try{e=await t(o)}catch(e){let t=e.code;throw t===`ENOENT`?Error(`File not found: ${o}. Check the path and try again.`):t===`EACCES`||t===`EPERM`?Error(`Permission denied reading ${o}. The file exists but is not accessible.`):e}if(e.isDirectory())throw Error(`Path is a directory: ${o}. file_summary requires a file path, not a directory. Use analyze_structure or find to explore directories.`);if(e.size>1e7)throw Error(`File too large (${(e.size/1e6).toFixed(1)}MB). file_summary supports files up to 10MB. Use search or compact with a query instead.`)}let c=a.content??await e(o,`utf-8`),d=c.split(`
2
- `),f=o.split(`.`).pop()??``,p=n(o);return i.get()&&r.has(p)?l(o,c,d,f,p):u(o,c,d,f)}async function l(e,t,n,r,i){let[c,l,u]=await Promise.all([s(t,i,e),o(t,i,e),a(t,i,e).catch(()=>[])]),f=l.map(e=>`import ${e.specifiers.length>0?`{ ${e.specifiers.join(`, `)} }`:`*`} from '${e.source}'`),p=[],m=[],h=[],g=[],_=[];for(let e of c)switch(e.exported&&p.push(e.name),e.kind){case`function`:case`method`:m.push({name:e.name,line:e.line,exported:e.exported,signature:e.signature});break;case`class`:h.push({name:e.name,line:e.line,exported:e.exported,signature:e.signature});break;case`interface`:g.push({name:e.name,line:e.line,exported:e.exported});break;case`type`:_.push({name:e.name,line:e.line,exported:e.exported});break}let v=l.map(e=>({source:e.source,specifiers:e.specifiers,isExternal:e.isExternal})),y=u.map(e=>({caller:e.callerName,callee:e.calleeName,line:e.line}));return{path:e,lines:n.length,language:d(r),imports:f,exports:p,functions:m,classes:h,interfaces:g,types:_,importDetails:v,callEdges:y.length>0?y:void 0,estimatedTokens:Math.ceil(t.length/4)}}function u(e,t,n,r){let i=[],a=[],o=[],s=[],c=[],l=[];for(let e=0;e<n.length;e+=1){let t=n[e],r=e+1;if(/^import\s+.+/.test(t)){i.push(t.trim());continue}let u=t.match(/^export\s+(?:async\s+)?function\s+(\w+)/);if(u){o.push({name:u[1],line:r,exported:!0}),a.push(u[1]);continue}let d=t.match(/^(?:async\s+)?function\s+(\w+)/);if(d){o.push({name:d[1],line:r,exported:!1});continue}let f=t.match(/^(export\s+)?const\s+(\w+)\s*=.*(?:=>|\bfunction\b)/);if(f){let e=!!f[1];o.push({name:f[2],line:r,exported:e}),e&&a.push(f[2]);continue}let p=t.match(/^export\s+const\s+(\w+)\s*=/);if(p){a.push(p[1]);continue}let m=t.match(/^(export\s+)?(?:abstract\s+)?class\s+(\w+)/);if(m){let e=!!m[1];s.push({name:m[2],line:r,exported:e}),e&&a.push(m[2]);continue}let h=t.match(/^(export\s+)?interface\s+(\w+)/);if(h){let e=!!h[1];c.push({name:h[2],line:r,exported:e}),e&&a.push(h[2]);continue}let g=t.match(/^(export\s+)?type\s+(\w+)/);if(g){let e=!!g[1];l.push({name:g[2],line:r,exported:e}),e&&a.push(g[2]);continue}let _=t.match(/^export\s+\{(.+)\}/);if(_){let e=_[1].split(`,`).map(e=>e.trim().split(/\s+as\s+/).pop()?.trim()??``).filter(Boolean);a.push(...e)}}return{path:e,lines:n.length,language:d(r),imports:i,exports:a,functions:o,classes:s,interfaces:c,types:l,estimatedTokens:Math.ceil(t.length/4)}}function d(e){return{ts:`typescript`,tsx:`typescript-jsx`,js:`javascript`,jsx:`javascript-jsx`,py:`python`,rs:`rust`,go:`go`,java:`java`,rb:`ruby`,md:`markdown`,json:`json`,yaml:`yaml`,yml:`yaml`,css:`css`,html:`html`,sh:`shell`,bash:`shell`}[e]??e}export{c as fileSummary};
@@ -1,6 +0,0 @@
1
- //#region packages/tools/src/file-walk.d.ts
2
- declare const DEFAULT_TOOL_EXTENSIONS: string[];
3
- declare function matchesGlobPattern(path: string, pattern: string): boolean;
4
- declare function walkFiles(rootPath: string, extensions: string[], exclude: string[]): Promise<string[]>;
5
- //#endregion
6
- export { DEFAULT_TOOL_EXTENSIONS, matchesGlobPattern, walkFiles };
@@ -1 +0,0 @@
1
- import{readdir as e,stat as t}from"node:fs/promises";import{extname as n,join as r,relative as i}from"node:path";import{AIKIT_PATHS as a}from"../../core/dist/index.js";const o=[`.ts`,`.tsx`,`.js`,`.jsx`],s=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,a.state]);function c(e){return e.replace(/\\/g,`/`)}function l(e){return e.replace(/[.+^${}()|[\]\\]/g,`\\$&`)}function u(e,t){let n=c(e),r=c(t).trim();if(!r)return!1;let i=l(r).replace(/\*\*/g,`::DOUBLE_STAR::`).replace(/\*/g,`[^/]*`).replace(/\?/g,`[^/]`).replace(/::DOUBLE_STAR::/g,`.*`);return RegExp(`^${i}$`).test(n)}function d(e,t,n){return t.some(t=>u(e,t)?!0:n?u(`${e}/`,t):!1)}async function f(a,o,l){let u=[],f=o.map(e=>e.toLowerCase());async function p(o){let m=await e(o);for(let e of m){if(s.has(e))continue;let m=r(o,e),h=await t(m),g=c(i(a,m));if(h.isDirectory()){d(g,l,!0)||await p(m);continue}d(g,l,!1)||f.includes(n(e).toLowerCase())&&u.push(m)}}return await p(a),u.sort((e,t)=>e.localeCompare(t)),u}export{o as DEFAULT_TOOL_EXTENSIONS,u as matchesGlobPattern,f as walkFiles};
@@ -1,29 +0,0 @@
1
- import { ContentType } from "../../core/dist/index.js";
2
- import { IEmbedder } from "../../embeddings/dist/index.js";
3
- import { IKnowledgeStore } from "../../store/dist/index.js";
4
-
5
- //#region packages/tools/src/find-examples.d.ts
6
- interface FindExamplesOptions {
7
- /** Symbol or pattern to find examples of */
8
- query: string;
9
- /** Max examples to return (default: 5) */
10
- limit?: number;
11
- /** Filter by content type */
12
- contentType?: ContentType;
13
- }
14
- interface Example {
15
- path: string;
16
- startLine: number;
17
- endLine: number;
18
- content: string;
19
- relevance: number;
20
- context: string;
21
- }
22
- interface FindExamplesResult {
23
- query: string;
24
- examples: Example[];
25
- totalFound: number;
26
- }
27
- declare function findExamples(embedder: IEmbedder, store: IKnowledgeStore, options: FindExamplesOptions): Promise<FindExamplesResult>;
28
- //#endregion
29
- export { Example, FindExamplesOptions, FindExamplesResult, findExamples };
@@ -1,3 +0,0 @@
1
- import{escapeRegExp as e}from"./regex-utils.js";async function t(t,n,r){let{query:i,limit:a=5,contentType:o}=r,s=`usage example of ${i}`,c=await t.embed(s),l=await n.search(c,{limit:a*3,contentType:o}),u=RegExp(`\\b${e(i)}\\b`,`i`),d=l.filter(e=>u.test(e.record.content));return{query:i,examples:d.map(e=>{let t=e.record.content,n=/export\s+(?:async\s+)?(?:function|class|const|interface|type)\s/.test(t),r=/^\s*import\s/m.test(t),i=/(?:^|[\\/])(test|tests|__tests__|spec)(?:[\\/]|$)/i.test(e.record.sourcePath)||/\.(test|spec)\.[jt]sx?$/i.test(e.record.sourcePath),a=0;n||(a+=.1),r||(a+=.05),i&&(a+=.05);let o=t.split(`
2
- `),s=o.findIndex(e=>u.test(e)),c=Math.max(0,s-2),l=Math.min(o.length,s+5),d=o.slice(c,l).join(`
3
- `);return{path:e.record.sourcePath,startLine:e.record.startLine,endLine:e.record.endLine,content:d||t.slice(0,300),relevance:Math.min(1,e.score+a),context:i?`test`:n?`definition`:`usage`}}).sort((e,t)=>t.relevance-e.relevance).slice(0,a),totalFound:d.length}}export{t as findExamples};
@@ -1,49 +0,0 @@
1
- import { ContentType } from "../../core/dist/index.js";
2
- import { IEmbedder } from "../../embeddings/dist/index.js";
3
- import { IKnowledgeStore } from "../../store/dist/index.js";
4
-
5
- //#region packages/tools/src/find.d.ts
6
- interface FindOptions {
7
- /** Semantic search query (optional) */
8
- query?: string;
9
- /** File glob pattern (optional) */
10
- glob?: string;
11
- /** Keyword/regex pattern for text search (optional) */
12
- pattern?: string;
13
- /** Max results per strategy (default: 10) */
14
- limit?: number;
15
- /** Filter by content type */
16
- contentType?: ContentType;
17
- /** Working directory for glob resolution (default: cwd) */
18
- cwd?: string;
19
- }
20
- interface FindResult {
21
- /** File path (relative to cwd) */
22
- path: string;
23
- /** How this result was found */
24
- source: 'vector' | 'keyword' | 'glob' | 'pattern';
25
- /** Relevance score (0-1 for vector/keyword, 1 for glob/pattern matches) */
26
- score: number;
27
- /** Line range if from AI Kit search */
28
- lineRange?: {
29
- start: number;
30
- end: number;
31
- };
32
- /** Content preview */
33
- preview?: string;
34
- }
35
- interface FindResults {
36
- results: FindResult[];
37
- strategies: string[];
38
- totalFound: number;
39
- failedStrategies?: Array<{
40
- strategy: string;
41
- reason: string;
42
- }>;
43
- }
44
- /**
45
- * Run federated search across multiple strategies.
46
- */
47
- declare function find(embedder: IEmbedder, store: IKnowledgeStore, options: FindOptions): Promise<FindResults>;
48
- //#endregion
49
- export { FindOptions, FindResult, FindResults, find };
@@ -1 +0,0 @@
1
- import{AIKIT_PATHS as e}from"../../core/dist/index.js";async function t(t,a,o){let{query:s,glob:c,pattern:l,limit:u=10,contentType:d,cwd:f=process.cwd()}=o,p=[],m=[],h=new Set,g=[];if(s){p.push(`vector`);let e=await t.embed(s),n={limit:u,contentType:d},r=await a.search(e,n);for(let e of r){let t=`${e.record.sourcePath}:${e.record.startLine}`;h.has(t)||(h.add(t),m.push({path:e.record.sourcePath,source:`vector`,score:e.score,lineRange:{start:e.record.startLine,end:e.record.endLine},preview:e.record.content.slice(0,200)}))}}if(s){p.push(`keyword`);try{let e=await a.ftsSearch(s,{limit:u,contentType:d});for(let t of e){let e=`${t.record.sourcePath}:${t.record.startLine}`;h.has(e)||(h.add(e),m.push({path:t.record.sourcePath,source:`keyword`,score:t.score,lineRange:{start:t.record.startLine,end:t.record.endLine},preview:t.record.content.slice(0,200)}))}}catch(e){g.push({strategy:`keyword`,reason:e instanceof Error?e.message:String(e)})}}if(c){p.push(`glob`);try{let{globSync:t}=await import(`node:fs`),n=t(c,{cwd:f,withFileTypes:!1}),r=new Set([`node_modules`,`.git`,`dist`,`build`,`coverage`,`.turbo`,`.cache`,`cdk.out`,e.state,e.data]),i=n.filter(e=>!e.replace(/\\/g,`/`).split(`/`).some(e=>r.has(e)));for(let e of i.slice(0,u)){let t=`glob:${e}`;h.has(t)||(h.add(t),m.push({path:e,source:`glob`,score:1}))}}catch(e){g.push({strategy:`glob`,reason:e instanceof Error?e.message:String(e)})}}if(l){p.push(`pattern`);try{let e=n(l),t=e?r(l):l,o=new RegExp(t,`i`),s=e?i(l):l,c=await a.ftsSearch(s,{limit:u*2,contentType:d});for(let t of c){let n=e?t.record.sourcePath:t.record.content;if(o.test(n)){let e=`${t.record.sourcePath}:${t.record.startLine}`;h.has(e)||(h.add(e),m.push({path:t.record.sourcePath,source:`pattern`,score:t.score,lineRange:{start:t.record.startLine,end:t.record.endLine},preview:t.record.content.slice(0,200)}))}}}catch(e){g.push({strategy:`pattern`,reason:e instanceof Error?e.message:String(e)})}}return m.sort((e,t)=>t.score-e.score),{results:m.slice(0,u),strategies:p,totalFound:m.length,...g.length>0&&{failedStrategies:g}}}function n(e){return/\*\*|^[*?]|\/\*|^\*\./.test(e)}function r(e){let t=`\0DS\0`,n=`\0SS\0`,r=e.replace(/\*\*/g,t).replace(/\*/g,n);return r=r.replace(/[.+^${}()|[\]\\]/g,`\\$&`),r=r.replace(/\?/g,`.`),r=r.replace(new RegExp(t.replace(/\0/g,`\\0`),`g`),`.*`),r=r.replace(new RegExp(n.replace(/\0/g,`\\0`),`g`),`[^/]*`),r}function i(e){return e.replace(/\*+/g,` `).replace(/[/\\]/g,` `).trim().split(/\s+/).filter(e=>e.length>1).join(` `)||e}export{t as find};
@@ -1,44 +0,0 @@
1
- import { ForgeTier } from "./evidence-map.js";
2
-
3
- //#region packages/tools/src/forge-classify.d.ts
4
- interface ForgeClassifyOptions {
5
- /** Files being modified (absolute or relative paths) */
6
- files: string[];
7
- /** Task description for keyword detection */
8
- task: string;
9
- /** Root path for package boundary detection */
10
- rootPath: string;
11
- }
12
- interface ClassifyTrigger {
13
- rule: string;
14
- detail: string;
15
- source: 'blast_radius' | 'cross_package' | 'schema_contract' | 'security_auth' | 'task_hint' | 'default';
16
- }
17
- interface TypedUnknownSeed {
18
- description: string;
19
- type: 'contract' | 'convention' | 'freshness' | 'runtime' | 'data-flow' | 'impact';
20
- suggestedTool: string;
21
- }
22
- interface ForgeClassifyCeremony {
23
- ground: string;
24
- build: string;
25
- break: string;
26
- evidenceMap: string;
27
- gate: string;
28
- }
29
- interface ForgeClassifyResult {
30
- tier: ForgeTier;
31
- triggers: ClassifyTrigger[];
32
- packagesCrossed: string[];
33
- hasSchemaChange: boolean;
34
- hasSecurityPath: boolean;
35
- typedUnknownSeeds: TypedUnknownSeed[];
36
- ceremony: ForgeClassifyCeremony;
37
- reclassifyHint?: {
38
- suggestedTier: ForgeTier;
39
- reason: string;
40
- };
41
- }
42
- declare function forgeClassify(options: ForgeClassifyOptions): Promise<ForgeClassifyResult>;
43
- //#endregion
44
- export { ClassifyTrigger, ForgeClassifyCeremony, ForgeClassifyOptions, ForgeClassifyResult, TypedUnknownSeed, forgeClassify };
@@ -1,2 +0,0 @@
1
- import{fileSummary as e}from"./file-summary.js";import{dirname as t,extname as n,relative as r,resolve as i}from"node:path";import{existsSync as a,readFileSync as o,readdirSync as s,statSync as c}from"node:fs";import{AIKIT_PATHS as l}from"../../core/dist/index.js";const u=new Set([`.ts`,`.tsx`,`.js`,`.jsx`,`.mts`,`.cts`,`.mjs`,`.cjs`]),d=new Set([`.git`,l.data,l.state,`.turbo`,`.yarn`,`build`,`coverage`,`dist`,`node_modules`]),f=/auth|token|permission|acl|encrypt|secret|credential|jwt|oauth|password/i,p=/\b(hash|sign|verify|bcrypt|jwt|decrypt|secret|password)\b/i,m=/auth|security|permission|encrypt|secret|credential/i,h=/types\.ts$|schema\.ts$|contract\.ts$|\.proto$|openapi|swagger|\.graphql$/i,g=/(?:^|\/)(events|contracts|shared)(?:\/|$)/i,_=/export\s+interface\b|export\s+type\b|export\s+const\s+\w*Schema\w*\s*=\s*z\./i,v=/schema|contract|migration|breaking.change|api.change/i,y=/migration|data.?model|multi.?service|breaking|backward.?compat/i,b={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function x(e){let t=i(e.rootPath),n=e.task.trim(),r=e.files.map(e=>i(t,e)),a=[],o=!1,s=!1;for(let e of r){let r=C(e,t),i=T(e);(f.test(r)||p.test(i)||m.test(n))&&(o=!0),(h.test(r)||g.test(r)||v.test(n)||_.test(i)||await E(e))&&(s=!0)}o&&S(a,{rule:`security-path`,detail:`Security/auth path, task, or content matched security heuristics`,source:`security_auth`}),s&&S(a,{rule:`schema-contract`,detail:`Schema or contract path, task, or export shape matched contract heuristics`,source:`schema_contract`});let c=D(r,t);c.affectedFiles>5&&S(a,{rule:`blast-radius-importers`,detail:`${c.affectedFiles} affected files via direct import scanning`,source:`blast_radius`});let l=[...new Set(r.map(e=>M(e,t)).filter(e=>!!e))].sort();l.length>=2&&S(a,{rule:`cross-package-boundary`,detail:`Files span ${l.length} packages: ${l.join(`, `)}`,source:`cross_package`}),y.test(n)&&S(a,{rule:`task-hint-critical`,detail:`Task description matched migration or compatibility criticality hints`,source:`task_hint`});let u=a.length>0?`critical`:r.length===1?`floor`:`standard`;u===`floor`&&(o||s)&&(u=`standard`);let d=j(a),x=u===`floor`&&d.some(e=>e.type===`contract`)?{suggestedTier:`standard`,reason:`Contract-type unknowns detected — Floor may be insufficient`}:void 0;return{tier:u,triggers:a,packagesCrossed:l,hasSchemaChange:s,hasSecurityPath:o,typedUnknownSeeds:d,ceremony:b[u],reclassifyHint:x}}function S(e,t){e.some(e=>e.rule===t.rule&&e.source===t.source)||e.push(t)}function C(e,t){let n=i(t,e),a=r(t,n);return(a&&!a.startsWith(`..`)?a:n).replace(/\\/g,`/`)}function w(e){if(!a(e))return!1;try{return c(e).size<=1e5}catch{return!1}}function T(e){if(!w(e))return``;try{return o(e,`utf-8`).split(/\r?\n/).slice(0,200).join(`
2
- `)}catch{return``}}async function E(t){if(!w(t))return!1;try{let n=await e({path:t}),r=new Set(n.exports);return n.interfaces.some(e=>r.has(e.name))||n.types.some(e=>r.has(e.name))}catch{return!1}}function D(e,t){let n=new Set(e.filter(e=>a(e)));if(n.size===0)return{affectedFiles:e.length,importers:[]};let i=new Set;for(let e of O(t)){if(n.has(e)||!w(e))continue;let t=T(e);t&&k(t).some(t=>A(t,e,n))&&i.add(e)}return{affectedFiles:e.length+i.size,importers:[...i].map(e=>r(t,e).replace(/\\/g,`/`))}}function O(e){let t=[];function r(e){let a=[];try{a=s(e)}catch{return}for(let o of a){if(d.has(o))continue;let a=i(e,o),s;try{s=c(a)}catch{continue}if(s.isDirectory()){r(a);continue}u.has(n(o).toLowerCase())&&t.push(a)}}return r(e),t}function k(e){let t=new Set;for(let n of e.matchAll(/(?:from\s+['"]([^'"]+)['"]|import\s+['"]([^'"]+)['"]|require\(\s*['"]([^'"]+)['"]\s*\))/g)){let e=n[1]??n[2]??n[3];e&&t.add(e)}return[...t]}function A(e,n,r){if(!e.startsWith(`.`))return!1;let a=i(t(n),e);return[a,`${a}.ts`,`${a}.tsx`,`${a}.js`,`${a}.jsx`,`${a}.mts`,`${a}.cts`,`${a}.mjs`,`${a}.cjs`,i(a,`index.ts`),i(a,`index.tsx`),i(a,`index.js`),i(a,`index.jsx`)].some(e=>r.has(e))}function j(e){return e.map(e=>{switch(e.source){case`security_auth`:return{description:`Verify auth and security assumptions before yielding`,type:`contract`,suggestedTool:`aikit_search`};case`schema_contract`:return{description:`Confirm schema and contract compatibility`,type:`contract`,suggestedTool:`aikit_schema_validate`};case`blast_radius`:return{description:`Inspect affected importers before delivery`,type:`impact`,suggestedTool:`aikit_blast_radius`};case`cross_package`:return{description:`Assess downstream package impact across boundaries`,type:`impact`,suggestedTool:`aikit_blast_radius`};case`task_hint`:return{description:`Check established conventions for migrations or compatibility work`,type:`convention`,suggestedTool:`aikit_find`};default:return{description:`No explicit unknown routing required`,type:`freshness`,suggestedTool:`aikit_lookup`}}})}function M(e,n){let s=t(i(n,e)),c=i(n);for(;s.length>=c.length;){let e=i(s,`package.json`);if(a(e))try{return JSON.parse(o(e,`utf-8`)).name??r(c,s).replace(/\\/g,`/`)}catch{return r(c,s).replace(/\\/g,`/`)}let n=t(s);if(n===s)break;s=n}}export{x as forgeClassify};
@@ -1,61 +0,0 @@
1
- import { ForgeTier } from "./evidence-map.js";
2
- import { ClassifyTrigger, TypedUnknownSeed } from "./forge-classify.js";
3
- import { ScopeMapResult } from "./scope-map.js";
4
- import { IEmbedder } from "../../embeddings/dist/index.js";
5
- import { IKnowledgeStore } from "../../store/dist/index.js";
6
-
7
- //#region packages/tools/src/forge-ground.d.ts
8
- interface ForgeGroundOptions {
9
- /** Task description */
10
- task: string;
11
- /** Target files being modified (absolute paths) */
12
- files: string[];
13
- /** Root path of the codebase */
14
- rootPath: string;
15
- /** Max constraint entries to load (default: 3) */
16
- maxConstraints?: number;
17
- /** Force a specific tier (skip auto-classify) */
18
- forceTier?: ForgeTier;
19
- /** Task ID for evidence map creation (default: auto-generated from task) */
20
- taskId?: string;
21
- }
22
- interface ConstraintRef {
23
- source: string;
24
- snippet: string;
25
- relevance: number;
26
- }
27
- interface ForgeGroundResult {
28
- /** Computed or forced tier */
29
- tier: ForgeTier;
30
- /** Classification triggers (empty if tier was forced) */
31
- classifyTriggers: ClassifyTrigger[];
32
- /** Scope map (relevant files with focus ranges) — null for Floor tier */
33
- scopeMap: ScopeMapResult | null;
34
- /** Typed Unknown Queue seeds */
35
- typedUnknownSeeds: TypedUnknownSeed[];
36
- /** Constraint seed — relevant AI Kit entries from decisions/patterns */
37
- constraints: ConstraintRef[];
38
- /** File summaries for target files */
39
- fileSummaries: Array<{
40
- path: string;
41
- exports: string[];
42
- functions: string[];
43
- lines: number;
44
- error?: string;
45
- }>;
46
- /** Evidence map task ID (created if Standard or Critical) */
47
- evidenceMapTaskId: string | null;
48
- /** Total estimated tokens for this Ground output */
49
- estimatedTokens: number;
50
- /** Ceremony recommendations for this tier */
51
- ceremony: {
52
- ground: string;
53
- build: string;
54
- break: string;
55
- evidenceMap: string;
56
- gate: string;
57
- };
58
- }
59
- declare function forgeGround(embedder: IEmbedder, store: IKnowledgeStore, options: ForgeGroundOptions): Promise<ForgeGroundResult>;
60
- //#endregion
61
- export { ConstraintRef, ForgeGroundOptions, ForgeGroundResult, forgeGround };
@@ -1 +0,0 @@
1
- import{estimateTokens as e}from"./text-utils.js";import{evidenceMap as t}from"./evidence-map.js";import{fileSummary as n}from"./file-summary.js";import{forgeClassify as r}from"./forge-classify.js";import{scopeMap as i}from"./scope-map.js";const a={floor:{ground:`Parasitic — read target file only`,build:`Implement directly`,break:`Skip`,evidenceMap:`Not required`,gate:`Self-certify`},standard:{ground:`Scope map + blast radius + constraint seed`,build:`TDD — test first, then implement`,break:`Error paths + edge cases`,evidenceMap:`3-8 critical-path entries`,gate:`YIELD/HOLD evaluation`},critical:{ground:`Full scope map + blast radius + trace + patterns + constraint pack`,build:`TDD + contract verification + cross-service validation`,break:`Error paths + edge cases + security dimensions + data-flow verification`,evidenceMap:`Comprehensive — all critical-path claims with receipts`,gate:`Strict YIELD/HOLD/HARD_BLOCK evaluation`}};async function o(e,t,n){let r=n.maxConstraints??3,i=await s(n),a=await u(n.files);if(i.tier===`floor`)return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:null,typedUnknownSeeds:i.typedUnknownSeeds,constraints:[],fileSummaries:a,evidenceMapTaskId:null,ceremony:i.ceremony});let[o,d,p]=await Promise.all([c(e,t,n.task,i.tier),l(e,t,n.task,r),f(n.rootPath,n.taskId??v(n.task),i.tier)]);return _({tier:i.tier,classifyTriggers:i.classifyTriggers,scopeMap:o,typedUnknownSeeds:i.typedUnknownSeeds,constraints:d,fileSummaries:a,evidenceMapTaskId:p,ceremony:i.ceremony})}async function s(e){if(e.forceTier)return{tier:e.forceTier,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(e.forceTier)};try{let t=await r({files:e.files,task:e.task,rootPath:e.rootPath});return{tier:t.tier,classifyTriggers:t.triggers,typedUnknownSeeds:t.typedUnknownSeeds,ceremony:t.ceremony}}catch{return{tier:`standard`,classifyTriggers:[],typedUnknownSeeds:[],ceremony:g(`standard`)}}}async function c(e,t,n,r){try{return await i(e,t,{task:n,maxFiles:r===`critical`?20:10})}catch{return null}}async function l(e,t,n,r){try{let i=`decision pattern convention ${n}`,a=typeof e.embedQuery==`function`?await e.embedQuery(i):await e.embed(i);return(await t.search(a,{limit:r,origin:`curated`})).slice(0,r).map(e=>p(e))}catch{return[]}}async function u(e){return Promise.all(e.map(async e=>d(e)))}async function d(e){try{return h(await n({path:e}))}catch(t){return{path:e,exports:[],functions:[],lines:0,error:t instanceof Error?t.message:`Unable to summarize file`}}}async function f(e,n,r){try{return t({action:`create`,taskId:n,tier:r},e),n}catch{return null}}function p(e){return{source:e.record.sourcePath,snippet:m(e.record.content),relevance:e.score}}function m(e){let t=e.replace(/\s+/g,` `).trim();return t.length<=200?t:`${t.slice(0,197).trimEnd()}...`}function h(e){return{path:e.path,exports:e.exports,functions:e.functions.map(e=>e.name),lines:e.lines}}function g(e){return{...a[e]}}function _(t){return{...t,estimatedTokens:e(JSON.stringify(t))}}function v(e){let t=e.toLowerCase().replace(/[^a-z0-9\s]/g,` `).split(/\s+/).filter(Boolean).slice(0,5).join(`-`),n=Date.now().toString(36);return`${t||`task`}-${n}`}export{o as forgeGround};
@@ -1,25 +0,0 @@
1
- //#region packages/tools/src/git-context.d.ts
2
- interface GitContextOptions {
3
- cwd?: string;
4
- commitCount?: number;
5
- includeDiff?: boolean;
6
- }
7
- interface GitContextResult {
8
- gitRoot: string;
9
- branch: string;
10
- status: {
11
- staged: string[];
12
- modified: string[];
13
- untracked: string[];
14
- };
15
- recentCommits: Array<{
16
- hash: string;
17
- message: string;
18
- author: string;
19
- date: string;
20
- }>;
21
- diff?: string;
22
- }
23
- declare function gitContext(options?: GitContextOptions): Promise<GitContextResult>;
24
- //#endregion
25
- export { GitContextOptions, GitContextResult, gitContext };
@@ -1,3 +0,0 @@
1
- import{execFile as e}from"node:child_process";import{promisify as t}from"node:util";const n=t(e);async function r(e,t){try{let{stdout:r}=await n(`git`,e,{cwd:t,timeout:15e3});return r.toString().trim()}catch{return``}}async function i(e={}){let t=e.cwd??process.cwd(),n=e.commitCount??5,i=await r([`rev-parse`,`--show-toplevel`],t);if(!i)return{gitRoot:t,branch:`unknown`,status:{staged:[],modified:[],untracked:[]},recentCommits:[]};let a=i,[o,s,c,l]=await Promise.all([r([`rev-parse`,`--abbrev-ref`,`HEAD`],a),r([`status`,`--porcelain`],a),r([`log`,`--max-count=${n}`,`--format=%h|%s|%an|%ai`],a),e.includeDiff?r([`diff`,`--stat`,`--no-color`],a):Promise.resolve(``)]),u=[],d=[],f=[];for(let e of s.split(`
2
- `).filter(Boolean)){let t=e[0],n=e[1],r=e.slice(3).trim();t!==` `&&t!==`?`&&u.push(r),(n===`M`||n===`D`)&&d.push(r),t===`?`&&f.push(r)}let p=c.split(`
3
- `).filter(Boolean).map(e=>{let[t,n,r,i]=e.split(`|`);return{hash:t,message:n,author:r,date:i}});return{gitRoot:i,branch:o||`unknown`,status:{staged:u,modified:d,untracked:f},recentCommits:p,diff:l||void 0}}export{i as gitContext};
@@ -1,98 +0,0 @@
1
- import { DepthGroupedResult, GraphEdge, GraphNode, GraphStats, GraphTraversalResult, GraphValidationResult, IGraphStore, ProcessInfo, Symbol360 } from "../../store/dist/index.js";
2
-
3
- //#region packages/tools/src/graph-query.d.ts
4
- interface GraphQueryOptions {
5
- /** Action: query nodes, traverse from a node, get stats, or add data */
6
- action: 'find_nodes' | 'find_edges' | 'neighbors' | 'traverse' | 'stats' | 'validate' | 'add' | 'delete' | 'clear' | 'detect_communities' | 'set_community' | 'trace_process' | 'list_processes' | 'delete_process' | 'depth_traverse' | 'cohesion' | 'symbol360';
7
- /** Node type filter (for find_nodes) */
8
- nodeType?: string;
9
- /** Name pattern (LIKE %pattern%) for find_nodes */
10
- namePattern?: string;
11
- /** Source path filter */
12
- sourcePath?: string;
13
- /** Node ID for neighbors/traverse/delete */
14
- nodeId?: string;
15
- /** Edge type filter */
16
- edgeType?: string;
17
- /** From node ID (for find_edges) */
18
- fromId?: string;
19
- /** To node ID (for find_edges) */
20
- toId?: string;
21
- /** Traversal direction */
22
- direction?: 'outgoing' | 'incoming' | 'both';
23
- /** Max traversal depth (default: 2) */
24
- maxDepth?: number;
25
- /** Max results (default: 50) */
26
- limit?: number;
27
- /** Nodes to add (for action=add) */
28
- nodes?: Array<{
29
- id?: string;
30
- type: string;
31
- name: string;
32
- properties?: Record<string, unknown>;
33
- sourceRecordId?: string;
34
- sourcePath?: string;
35
- }>;
36
- /** Edges to add (for action=add) */
37
- edges?: Array<{
38
- id?: string;
39
- fromId: string;
40
- toId: string;
41
- type: string;
42
- weight?: number;
43
- properties?: Record<string, unknown>;
44
- }>;
45
- /** Community label (for set_community, cohesion) */
46
- community?: string;
47
- /** Process ID (for delete_process) */
48
- processId?: string;
49
- /** Label for process tracing */
50
- label?: string;
51
- }
52
- interface GraphQueryResult {
53
- action: string;
54
- nodes?: GraphNode[];
55
- edges?: GraphEdge[];
56
- stats?: GraphStats;
57
- validation?: GraphValidationResult;
58
- communities?: Record<string, string[]>;
59
- process?: ProcessInfo;
60
- processes?: ProcessInfo[];
61
- depthGroups?: DepthGroupedResult;
62
- cohesionScore?: number;
63
- symbol360?: Symbol360;
64
- nodesAdded?: number;
65
- edgesAdded?: number;
66
- deleted?: number;
67
- summary: string;
68
- }
69
- declare function graphQuery(graphStore: IGraphStore, options: GraphQueryOptions): Promise<GraphQueryResult>;
70
- interface GraphAugmentOptions {
71
- /** Max graph hops from each vector hit (default: 1) */
72
- hops?: number;
73
- /** Edge type filter for graph expansion */
74
- edgeType?: string;
75
- /** Max graph nodes per vector hit (default: 5) */
76
- maxPerHit?: number;
77
- }
78
- interface GraphAugmentedResult {
79
- /** Original search result record ID */
80
- recordId: string;
81
- /** Original similarity score */
82
- score: number;
83
- /** Source path of the matched record */
84
- sourcePath: string;
85
- /** Graph nodes connected to this record (via sourceRecordId) */
86
- graphContext: GraphTraversalResult;
87
- }
88
- /**
89
- * Augment vector search results with graph context.
90
- * For each search hit, finds linked graph nodes and traverses their connections.
91
- */
92
- declare function graphAugmentSearch(graphStore: IGraphStore, hits: Array<{
93
- recordId: string;
94
- score: number;
95
- sourcePath: string;
96
- }>, options?: GraphAugmentOptions): Promise<GraphAugmentedResult[]>;
97
- //#endregion
98
- export { GraphAugmentOptions, GraphAugmentedResult, GraphQueryOptions, GraphQueryResult, graphAugmentSearch, graphQuery };
@@ -1 +0,0 @@
1
- import{createHash as e}from"node:crypto";function t(t,...n){return`${t}_${e(`sha256`).update(n.join(`|`)).digest(`hex`).slice(0,12)}`}async function n(e,n){let{action:r}=n;switch(r){case`find_nodes`:{let t=await e.findNodes({type:n.nodeType,namePattern:n.namePattern,sourcePath:n.sourcePath,limit:n.limit});return{action:r,nodes:t,summary:`Found ${t.length} node(s)${n.nodeType?` of type "${n.nodeType}"`:``}${n.namePattern?` matching "${n.namePattern}"`:``}`}}case`find_edges`:{let t=await e.findEdges({type:n.edgeType,fromId:n.fromId,toId:n.toId,limit:n.limit});return{action:r,edges:t,summary:`Found ${t.length} edge(s)${n.edgeType?` of type "${n.edgeType}"`:``}`}}case`neighbors`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for neighbors action`};let t=await e.getNeighbors(n.nodeId,{edgeType:n.edgeType,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Found ${t.nodes.length} neighbor(s) and ${t.edges.length} edge(s) for node "${n.nodeId}"`}}case`traverse`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for traverse action`};let t=await e.traverse(n.nodeId,{edgeType:n.edgeType,maxDepth:n.maxDepth,direction:n.direction,limit:n.limit});return{action:r,nodes:t.nodes,edges:t.edges,summary:`Traversed ${t.nodes.length} node(s) and ${t.edges.length} edge(s) from "${n.nodeId}" (depth=${n.maxDepth??2})`}}case`stats`:{let t=await e.getStats();return{action:r,stats:t,summary:`Graph: ${t.nodeCount} nodes, ${t.edgeCount} edges. Types: ${Object.entries(t.nodeTypes).map(([e,t])=>`${e}(${t})`).join(`, `)||`none`}`}}case`validate`:{let t=await e.validate();return{action:r,validation:t,stats:t.stats,summary:t.valid?`Graph validation passed: ${t.stats.nodeCount} nodes, ${t.stats.edgeCount} edges, ${t.orphanNodes.length} orphan node(s)`:`Graph validation found ${t.danglingEdges.length} dangling edge(s) and ${t.orphanNodes.length} orphan node(s)`}}case`add`:{let i=0,a=0;if(n.nodes&&n.nodes.length>0){let r=n.nodes.map(e=>({id:e.id??t(`node`,e.type,e.name),type:e.type,name:e.name,properties:e.properties??{},sourceRecordId:e.sourceRecordId,sourcePath:e.sourcePath,createdAt:new Date().toISOString()}));await e.upsertNodes(r),i=r.length}if(n.edges&&n.edges.length>0){let r=n.edges.map(e=>({id:e.id??t(`edge`,e.fromId,e.toId,e.type),fromId:e.fromId,toId:e.toId,type:e.type,weight:e.weight,properties:e.properties}));await e.upsertEdges(r),a=r.length}return{action:r,nodesAdded:i,edgesAdded:a,summary:`Added ${i} node(s) and ${a} edge(s) to the graph`}}case`delete`:if(n.nodeId)return await e.deleteNode(n.nodeId),{action:r,deleted:1,summary:`Deleted node "${n.nodeId}" and its edges`};if(n.sourcePath){let t=await e.deleteBySourcePath(n.sourcePath);return{action:r,deleted:t,summary:`Deleted ${t} node(s) from source "${n.sourcePath}"`}}return{action:r,summary:`Error: nodeId or sourcePath required for delete action`};case`clear`:{let t=await e.getStats();return await e.clear(),{action:r,deleted:t.nodeCount,summary:`Cleared graph: removed ${t.nodeCount} node(s) and ${t.edgeCount} edge(s)`}}case`detect_communities`:{let t=await e.detectCommunities(),n=Object.values(t).reduce((e,t)=>e+t.length,0);return{action:r,communities:t,summary:`Detected ${Object.keys(t).length} community/communities covering ${n} node(s)`}}case`set_community`:return!n.nodeId||!n.community?{action:r,summary:`Error: nodeId and community are required for set_community action`}:(await e.setNodeCommunity(n.nodeId,n.community),{action:r,summary:`Set community "${n.community}" on node "${n.nodeId}"`});case`trace_process`:{if(!n.nodeId||!n.label)return{action:r,summary:`Error: nodeId and label are required for trace_process action`};let t=await e.traceProcess(n.nodeId,n.label);return{action:r,process:t,summary:`Traced process "${t.label}" from node "${n.nodeId}": ${t.steps.length} step(s)`}}case`list_processes`:{let t=await e.getProcesses(n.nodeId);return{action:r,processes:t,summary:`Found ${t.length} process(es)${n.nodeId?` involving node "${n.nodeId}"`:``}`}}case`delete_process`:return n.processId?(await e.deleteProcess(n.processId),{action:r,summary:`Deleted process "${n.processId}"`}):{action:r,summary:`Error: processId is required for delete_process action`};case`depth_traverse`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for depth_traverse action`};let t=await e.depthGroupedTraversal(n.nodeId,n.maxDepth,{edgeType:n.edgeType,direction:n.direction,limit:n.limit}),i=Object.values(t).reduce((e,t)=>e+t.length,0);return{action:r,depthGroups:t,summary:`Depth-grouped traversal from "${n.nodeId}": ${i} node(s) across ${Object.keys(t).length} depth level(s)`}}case`cohesion`:{if(!n.community)return{action:r,summary:`Error: community is required for cohesion action`};let t=await e.getCohesionScore(n.community);return{action:r,cohesionScore:t,summary:`Community "${n.community}" cohesion score: ${(t*100).toFixed(1)}%`}}case`symbol360`:{if(!n.nodeId)return{action:r,summary:`Error: nodeId is required for symbol360 action`};let t=await e.getSymbol360(n.nodeId);return{action:r,symbol360:t,nodes:[t.node],edges:[...t.incoming,...t.outgoing],summary:`360° view of "${t.node.name}": ${t.incoming.length} incoming, ${t.outgoing.length} outgoing, community: ${t.community??`none`}, ${t.processes.length} process(es)`}}default:return{action:r,summary:`Unknown action: ${r}`}}}async function r(e,t,n){let r=n?.hops??1,i=n?.maxPerHit??5,a=[];for(let o of t)try{let t=await e.findNodes({sourcePath:o.sourcePath}),s=[],c=[],l=new Set,u=new Set;for(let a of t.slice(0,i))if(!l.has(a.id)&&(l.add(a.id),s.push(a),r>0)){let t=await e.traverse(a.id,{maxDepth:r,edgeType:n?.edgeType,limit:i});for(let e of t.nodes)l.has(e.id)||(l.add(e.id),s.push(e));for(let e of t.edges)u.has(e.id)||(u.add(e.id),c.push(e))}a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:s,edges:c}})}catch{a.push({recordId:o.recordId,score:o.score,sourcePath:o.sourcePath,graphContext:{nodes:[],edges:[]}})}return a}export{r as graphAugmentSearch,n as graphQuery};
@@ -1,25 +0,0 @@
1
- //#region packages/tools/src/guide.d.ts
2
- /**
3
- * Tool discovery — recommends MCP tools and workflows for a given goal.
4
- *
5
- * Uses keyword matching against predefined workflow templates.
6
- * No embeddings required — pure string matching for instant results.
7
- */
8
- interface GuideRecommendation {
9
- tool: string;
10
- reason: string;
11
- order: number;
12
- suggestedArgs?: Record<string, unknown>;
13
- }
14
- interface GuideResult {
15
- workflow: string;
16
- description: string;
17
- tools: GuideRecommendation[];
18
- alternativeWorkflows: string[];
19
- }
20
- /**
21
- * Match a goal description to the best workflow and return tool recommendations.
22
- */
23
- declare function guide(goal: string, maxRecommendations?: number, indexMode?: string): GuideResult;
24
- //#endregion
25
- export { GuideRecommendation, GuideResult, guide };