@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,54 +0,0 @@
1
- import { ContentType, IndexStats, KnowledgeOrigin, KnowledgeRecord, SearchResult, SourceType } from "../../core/dist/index.js";
2
-
3
- //#region packages/store/src/store.interface.d.ts
4
- /** Options for searching the store */
5
- interface SearchOptions {
6
- /** Maximum number of results to return */
7
- limit?: number;
8
- /** Minimum similarity score (0-1) */
9
- minScore?: number;
10
- /** Filter by content type */
11
- contentType?: ContentType;
12
- /** Filter by coarse source type (source, documentation, test, config, generated) */
13
- sourceType?: SourceType;
14
- /** Filter by origin */
15
- origin?: KnowledgeOrigin;
16
- /** Filter by category */
17
- category?: string;
18
- /** Filter by tags (any match) */
19
- tags?: string[];
20
- }
21
- interface IKnowledgeStore {
22
- /** Initialize the store (create tables, etc.) */
23
- initialize(): Promise<void>;
24
- /** Add or update records with their embedding vectors */
25
- upsert(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
26
- /** Add or update records with priority over bulk indexing writes */
27
- upsertInteractive(records: KnowledgeRecord[], vectors: Float32Array[]): Promise<void>;
28
- /** Search by vector similarity */
29
- search(queryVector: Float32Array, options?: SearchOptions): Promise<SearchResult[]>;
30
- /** Get a specific record by ID */
31
- getById(id: string): Promise<KnowledgeRecord | null>;
32
- /** Delete records by source path (used during re-indexing) */
33
- deleteBySourcePath(sourcePath: string): Promise<number>;
34
- /** Delete a specific record by ID */
35
- deleteById(id: string): Promise<boolean>;
36
- /** Delete a specific record by ID with priority over bulk indexing writes */
37
- deleteByIdInteractive(id: string): Promise<boolean>;
38
- /** Get all records for a source path */
39
- getBySourcePath(sourcePath: string): Promise<KnowledgeRecord[]>;
40
- /** Get index statistics */
41
- getStats(): Promise<IndexStats>;
42
- /** List all unique source paths in the store */
43
- listSourcePaths(): Promise<string[]>;
44
- /** Create a full-text search index on the content column for keyword search */
45
- createFtsIndex(): Promise<void>;
46
- /** Full-text keyword search (requires FTS index) */
47
- ftsSearch(query: string, options?: SearchOptions): Promise<SearchResult[]>;
48
- /** Drop the backing table entirely — used for hard resets (e.g. dimension changes) */
49
- dropTable(): Promise<void>;
50
- /** Close the store connection */
51
- close(): Promise<void>;
52
- }
53
- //#endregion
54
- export { IKnowledgeStore, SearchOptions };
@@ -1 +0,0 @@
1
- export{};
@@ -1,65 +0,0 @@
1
- import { KBResponse } from "./response-envelope.js";
2
- import { IEmbedder } from "../../embeddings/dist/index.js";
3
- import { IKnowledgeStore } from "../../store/dist/index.js";
4
-
5
- //#region packages/tools/src/audit.d.ts
6
- type AuditCheck = 'structure' | 'dependencies' | 'patterns' | 'health' | 'dead_symbols' | 'check' | 'entry_points';
7
- interface AuditOptions {
8
- /** Root path to audit (default: cwd) */
9
- path?: string;
10
- /** Which checks to run (default: all) */
11
- checks?: AuditCheck[];
12
- /** Detail level (default: 'summary') */
13
- detail?: 'summary' | 'full';
14
- }
15
- interface AuditRecommendation {
16
- priority: 'high' | 'medium' | 'low';
17
- area: string;
18
- message: string;
19
- }
20
- interface AuditData {
21
- score: number;
22
- structure?: {
23
- files: number;
24
- packages: number;
25
- languages: Record<string, number>;
26
- };
27
- dependencies?: {
28
- external: number;
29
- internal: number;
30
- };
31
- patterns?: Array<{
32
- name: string;
33
- confidence: string;
34
- count: number;
35
- }>;
36
- health?: {
37
- score: number;
38
- checks: number;
39
- passed: number;
40
- warned: number;
41
- failed: number;
42
- };
43
- deadSymbols?: {
44
- source: number;
45
- docs: number;
46
- };
47
- entryPoints?: {
48
- total: number;
49
- types: Record<string, number>;
50
- };
51
- typecheck?: {
52
- passed: boolean;
53
- errorCount: number;
54
- topErrors: string[];
55
- };
56
- lint?: {
57
- passed: boolean;
58
- errorCount: number;
59
- topErrors: string[];
60
- };
61
- recommendations: AuditRecommendation[];
62
- }
63
- declare function audit(store: IKnowledgeStore, embedder: IEmbedder, options?: AuditOptions): Promise<KBResponse<AuditData>>;
64
- //#endregion
65
- export { AuditCheck, AuditData, AuditOptions, AuditRecommendation, audit };
@@ -1,6 +0,0 @@
1
- import{check as e,summarizeCheckResult as t}from"./check.js";import{findDeadSymbols as n}from"./dead-symbols.js";import{health as r}from"./health.js";import{resolvePath as i}from"./path-resolver.js";import{errorResponse as a,okResponse as o}from"./response-envelope.js";import{DependencyAnalyzer as s,EntryPointAnalyzer as c,PatternAnalyzer as l,StructureAnalyzer as u}from"../../analyzers/dist/index.js";const d=[`structure`,`dependencies`,`patterns`,`health`,`dead_symbols`,`check`,`entry_points`];async function f(f,m,h={}){let g=Date.now(),_=i(h.path),v=h.checks??d,y=h.detail??`summary`,b=[],x={score:100,recommendations:b};try{let i=[];v.includes(`structure`)&&i.push((async()=>{let e=await new u().analyze(_,{format:`json`}),t=e.data;x.structure={files:t.stats?.totalFiles??e.meta.fileCount,packages:Array.isArray(t.packages)?t.packages.length:0,languages:t.stats?.languages??{}}})()),v.includes(`dependencies`)&&i.push((async()=>{let e=(await new s().analyze(_)).data,t=e.imports??[];x.dependencies={external:e.external?.length??t.filter(e=>e.isExternal).length,internal:e.internal?.length??t.filter(e=>!e.isExternal).length}})()),v.includes(`patterns`)&&i.push((async()=>{x.patterns=((await new l().analyze(_)).data.patterns??[]).map(e=>({name:e.pattern,confidence:e.confidence,count:e.locations.length}))})()),v.includes(`entry_points`)&&i.push((async()=>{let e=(await new c().analyze(_)).data,t=e.entryPoints??[],n={};for(let e of t)n[e.type]=(n[e.type]??0)+1;x.entryPoints={total:e.total??t.length,types:n}})()),v.includes(`health`)&&i.push((async()=>{let e=r(_);x.health={score:e.score,checks:e.checks.length,passed:e.checks.filter(e=>e.status===`pass`).length,warned:e.checks.filter(e=>e.status===`warn`).length,failed:e.checks.filter(e=>e.status===`fail`).length},e.score<70&&b.push({priority:`medium`,area:`health`,message:`Health score ${e.score}/100 — ${x.health.failed} failed checks`})})()),v.includes(`dead_symbols`)&&i.push((async()=>{let e=await n(m,f,{rootPath:_});x.deadSymbols={source:e.totalDeadSource,docs:e.totalDeadDocs},e.totalDeadSource>0&&b.push({priority:e.totalDeadSource>10?`high`:`medium`,area:`dead-code`,message:`${e.totalDeadSource} unused exports in source files`})})()),v.includes(`check`)&&i.push((async()=>{let n=t(await e({cwd:_}));x.typecheck={passed:n.tsc.passed,errorCount:n.tsc.errorCount,topErrors:n.tsc.topErrors},x.lint={passed:n.biome.passed,errorCount:n.biome.errorCount,topErrors:n.biome.topErrors},n.tsc.passed||b.push({priority:`high`,area:`type-safety`,message:`Fix ${n.tsc.errorCount} tsc error(s)`}),n.biome.passed||b.push({priority:`medium`,area:`lint`,message:`Fix ${n.biome.errorCount} lint error(s)`})})()),await Promise.all(i);let a=0;x.typecheck&&!x.typecheck.passed&&(a+=15),x.lint&&!x.lint.passed&&(a+=5),x.health&&x.health.score<80&&(a+=10),x.deadSymbols&&x.deadSymbols.source>10&&(a+=5),x.entryPoints&&x.entryPoints.total===0&&(a+=5),x.score=Math.max(0,100-a);let d={high:0,medium:1,low:2};b.sort((e,t)=>d[e.priority]-d[t.priority]);let h=p(x,y),S=[];return x.typecheck&&!x.typecheck.passed&&S.push({tool:`check`,reason:`Get full error details`,suggested_args:{detail:`errors`}}),x.deadSymbols&&x.deadSymbols.source>0&&S.push({tool:`dead_symbols`,reason:`See which exports are unused`,suggested_args:{root_path:_}}),o(`audit`,h,x,{durationMs:Date.now()-g,detail:y},S)}catch(e){return a(`audit`,{code:`ANALYSIS_FAILED`,category:`runtime`,retryable:!1,message:`Audit failed: ${e instanceof Error?e.message:String(e)}`},Date.now()-g)}}function p(e,t){let n=[];if(n.push(`## Audit Report — Score: ${e.score}/100\n`),e.structure&&n.push(`**Structure:** ${e.structure.files} files, ${e.structure.packages} packages, ${Object.keys(e.structure.languages).length} languages`),e.entryPoints){let t=Object.entries(e.entryPoints.types).map(([e,t])=>`${t} ${e}`).join(`, `);n.push(`**Entry Points:** ${e.entryPoints.total} (${t||`none`})`)}if(e.dependencies&&n.push(`**Dependencies:** ${e.dependencies.external} external, ${e.dependencies.internal} internal`),e.health&&n.push(`**Health:** ${e.health.score}/100 (${e.health.passed}✓ ${e.health.warned}⚠ ${e.health.failed}✗)`),e.deadSymbols&&n.push(`**Dead Symbols:** ${e.deadSymbols.source} in source (actionable), ${e.deadSymbols.docs} in docs`),e.typecheck){let t=e.typecheck.passed?`✓ passed`:`✗ ${e.typecheck.errorCount} errors`;n.push(`**Typecheck:** ${t}`)}if(e.lint){let t=e.lint.passed?`✓ passed`:`✗ ${e.lint.errorCount} errors`;n.push(`**Lint:** ${t}`)}if(e.recommendations.length>0){n.push(`
2
- ### Recommendations
3
- `);for(let t of e.recommendations){let e=t.priority===`high`?`🔴`:t.priority===`medium`?`🟡`:`🟢`;n.push(`${e} **${t.area}:** ${t.message}`)}}if(t===`full`&&e.patterns&&e.patterns.length>0){n.push(`
4
- ### Patterns Detected
5
- `),n.push(`| Pattern | Confidence | Count |`),n.push(`|---------|-----------|-------|`);for(let t of e.patterns)n.push(`| ${t.name} | ${t.confidence} | ${t.count} |`)}return n.join(`
6
- `)}export{f as audit};
@@ -1,23 +0,0 @@
1
- //#region packages/tools/src/batch.d.ts
2
- interface BatchOperation {
3
- /** Unique ID for this operation */
4
- id: string;
5
- /** Operation type */
6
- type: string;
7
- /** Arguments for the operation */
8
- args: Record<string, unknown>;
9
- }
10
- interface BatchResult {
11
- id: string;
12
- status: 'success' | 'error';
13
- result?: unknown;
14
- error?: string;
15
- durationMs: number;
16
- }
17
- interface BatchOptions {
18
- /** Max concurrent operations (default: 4) */
19
- concurrency?: number;
20
- }
21
- declare function batch(operations: BatchOperation[], executor: (op: BatchOperation) => Promise<unknown>, options?: BatchOptions): Promise<BatchResult[]>;
22
- //#endregion
23
- export { BatchOperation, BatchOptions, BatchResult, batch };
@@ -1 +0,0 @@
1
- async function e(e,t,n={}){let r=Math.max(1,n.concurrency??4),i=[],a=[...e];async function o(e){let n=Date.now();try{let r=await t(e);return{id:e.id,status:`success`,result:r,durationMs:Date.now()-n}}catch(t){return{id:e.id,status:`error`,error:t instanceof Error?t.message:String(t),durationMs:Date.now()-n}}}for(;a.length>0;){let e=a.splice(0,r),t=await Promise.allSettled(e.map(e=>o(e)));for(let n=0;n<t.length;n++){let r=t[n];if(r.status===`fulfilled`){i.push(r.value);continue}i.push({id:e[n]?.id??`unknown`,status:`error`,error:r.reason instanceof Error?r.reason.message:`Promise rejected`,durationMs:0})}}return i}export{e as batch};
@@ -1,36 +0,0 @@
1
- //#region packages/tools/src/changelog.d.ts
2
- /**
3
- * aikit_changelog — Generate a changelog from git history.
4
- */
5
- type ChangelogFormat = 'grouped' | 'chronological' | 'per-scope';
6
- interface ChangelogOptions {
7
- from: string;
8
- to?: string;
9
- format?: ChangelogFormat;
10
- includeBreaking?: boolean;
11
- cwd?: string;
12
- }
13
- interface ChangelogEntry {
14
- hash: string;
15
- type: string;
16
- scope: string;
17
- subject: string;
18
- body: string;
19
- author: string;
20
- date: string;
21
- breaking: boolean;
22
- }
23
- interface ChangelogResult {
24
- entries: ChangelogEntry[];
25
- markdown: string;
26
- stats: {
27
- total: number;
28
- breaking: number;
29
- types: Record<string, number>;
30
- };
31
- }
32
- declare function changelog(options: ChangelogOptions): ChangelogResult;
33
- /** Exported for testing */
34
- declare function formatChangelog(entries: ChangelogEntry[], format: ChangelogFormat, includeBreaking: boolean): string;
35
- //#endregion
36
- export { ChangelogEntry, ChangelogFormat, ChangelogOptions, ChangelogResult, changelog, formatChangelog };
@@ -1,2 +0,0 @@
1
- import{execFileSync as e}from"node:child_process";const t=/^[a-zA-Z0-9_./\-~^@{}]+$/;function n(n){let{from:i,to:a=`HEAD`,format:o=`grouped`,includeBreaking:s=!0,cwd:c=process.cwd()}=n;if(!t.test(i))throw Error(`Invalid git ref: ${i}`);if(!t.test(a))throw Error(`Invalid git ref: ${a}`);let l;try{l=e(`git`,[`log`,`${i}..${a}`,`--format=%H%s%b%an%ai`],{cwd:c,encoding:`utf8`,maxBuffer:10*1024*1024,timeout:3e4})}catch{throw Error(`Git log failed. Ensure "${i}" and "${a}" are valid refs.`)}let u=l.split(``).map(e=>e.trim()).filter(Boolean).map(e=>{let[t=``,n=``,r=``,i=``,a=``]=e.split(``),o=n.match(/^(\w+)(?:\(([^)]*)\))?(!)?:\s*(.+)/);return{hash:t.slice(0,8),type:o?.[1]??`other`,scope:o?.[2]??``,subject:o?.[4]??n,body:r.trim(),author:i.trim(),date:a.trim().split(` `)[0],breaking:!!(o?.[3]||/BREAKING[\s-]CHANGE/i.test(r))}}),d={},f=0;for(let e of u)d[e.type]=(d[e.type]??0)+1,e.breaking&&f++;return{entries:u,markdown:r(u,o,s),stats:{total:u.length,breaking:f,types:d}}}function r(e,t,n){let r=[`# Changelog`,``];if(n){let t=e.filter(e=>e.breaking);if(t.length>0){r.push(`## Breaking Changes`,``);for(let e of t)r.push(`- ${e.subject} (${e.hash})`);r.push(``)}}if(t===`grouped`){let t={};for(let n of e)t[n.type]||(t[n.type]=[]),t[n.type].push(n);let n=[`feat`,`fix`,`refactor`,`perf`,`test`,`docs`,`chore`],i={feat:`Features`,fix:`Bug Fixes`,refactor:`Refactoring`,perf:`Performance`,test:`Tests`,docs:`Documentation`,chore:`Chores`,other:`Other`};for(let e of[...n,...Object.keys(t).filter(e=>!n.includes(e))])if(t[e]?.length){r.push(`## ${i[e]??e}`,``);for(let n of t[e]){let e=n.scope?`**${n.scope}:** `:``;r.push(`- ${e}${n.subject} (${n.hash})`)}r.push(``)}}else if(t===`chronological`)for(let t of e){let e=t.scope?`(${t.scope}) `:``;r.push(`- \`${t.date}\` ${t.type}: ${e}${t.subject} (${t.hash})`)}else{let t={};for(let n of e){let e=n.scope||`general`;t[e]||(t[e]=[]),t[e].push(n)}for(let[e,n]of Object.entries(t)){r.push(`## ${e}`,``);for(let e of n)r.push(`- ${e.type}: ${e.subject} (${e.hash})`);r.push(``)}}return r.join(`
2
- `)}export{n as changelog,r as formatChangelog};
@@ -1,48 +0,0 @@
1
- import { ParsedError } from "./parse-output.js";
2
-
3
- //#region packages/tools/src/check.d.ts
4
- interface CheckOptions {
5
- /** Specific files to check (if empty, checks all) */
6
- files?: string[];
7
- /** Working directory */
8
- cwd?: string;
9
- /** Skip typecheck */
10
- skipTypes?: boolean;
11
- /** Skip lint */
12
- skipLint?: boolean;
13
- /** Detail level: summary (default, minimal), errors (parsed errors), full (includes raw) */
14
- detail?: 'summary' | 'errors' | 'full';
15
- }
16
- interface CheckSummaryResult {
17
- passed: boolean;
18
- tsc: {
19
- passed: boolean;
20
- errorCount: number;
21
- warningCount: number;
22
- topErrors: string[];
23
- };
24
- biome: {
25
- passed: boolean;
26
- errorCount: number;
27
- warningCount: number;
28
- topErrors: string[];
29
- };
30
- }
31
- interface CheckResult {
32
- tsc: {
33
- errors: ParsedError[];
34
- passed: boolean;
35
- raw?: string;
36
- };
37
- biome: {
38
- errors: ParsedError[];
39
- passed: boolean;
40
- raw?: string;
41
- };
42
- passed: boolean;
43
- }
44
- declare function check(options?: CheckOptions): Promise<CheckResult>;
45
- /** Produce a minimal summary for LLM consumption (~300 tokens) */
46
- declare function summarizeCheckResult(result: CheckResult): CheckSummaryResult;
47
- //#endregion
48
- export { CheckOptions, CheckResult, CheckSummaryResult, check, summarizeCheckResult };
@@ -1,2 +0,0 @@
1
- import{parseBiome as e,parseTsc as t}from"./parse-output.js";import{exec as n}from"node:child_process";import{readFile as r}from"node:fs/promises";import{join as i}from"node:path";import{promisify as a}from"node:util";const o=a(n);let s=0;function c(e){let t=e;return[t.stdout?.toString()??``,t.stderr?.toString()??``].filter(Boolean).join(`
2
- `).trim()||t.message||`Command failed`}async function l(e={}){if(s>=2)throw Error(`Too many concurrent check runs (max 2). Try again later.`);s++;try{return await u(e)}finally{s--}}async function u(n){let a=n.cwd??process.cwd(),s={errors:[],passed:!0,raw:``},l={errors:[],passed:!0,raw:``};if(!n.skipTypes)try{let e=i(a,`package.json`),t=!1;try{t=!!JSON.parse(await r(e,`utf-8`)).scripts?.typecheck}catch{}if(t&&!n.files?.length)await o(`npx turbo run typecheck`,{cwd:a,timeout:12e4});else{let e=[`--noEmit`];n.files?.length&&e.push(...n.files),await o(`npx tsc ${e.join(` `)}`,{cwd:a,timeout:12e4})}}catch(e){s.raw=c(e),s.errors=t(s.raw),s.passed=s.errors.length===0}if(!n.skipLint)try{let e=[`check`];n.files?.length&&e.push(...n.files),await o(`npx biome ${e.join(` `)}`,{cwd:a,timeout:12e4})}catch(t){l.raw=c(t),l.errors=e(l.raw),l.passed=l.errors.length===0}let u=n.detail??`errors`,d={tsc:s,biome:l,passed:s.passed&&l.passed};return u===`full`?d:{tsc:{errors:s.errors,passed:s.passed},biome:{errors:l.errors,passed:l.passed},passed:d.passed}}function d(e){let t=e.tsc.errors.filter(e=>e.severity===`error`),n=e.tsc.errors.filter(e=>e.severity===`warning`),r=e.biome.errors.filter(e=>e.severity===`error`),i=e.biome.errors.filter(e=>e.severity===`warning`);return{passed:e.passed,tsc:{passed:e.tsc.passed,errorCount:t.length,warningCount:n.length,topErrors:t.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)},biome:{passed:e.biome.passed,errorCount:r.length,warningCount:i.length,topErrors:r.slice(0,3).map(e=>`${e.file}:${e.line} — ${e.message}`)}}}export{l as check,d as summarizeCheckResult};
@@ -1,19 +0,0 @@
1
- //#region packages/tools/src/checkpoint.d.ts
2
- interface Checkpoint {
3
- id: string;
4
- label: string;
5
- createdAt: string;
6
- data: Record<string, unknown>;
7
- files?: string[];
8
- notes?: string;
9
- }
10
- declare function checkpointSave(label: string, data: Record<string, unknown>, options?: {
11
- files?: string[];
12
- notes?: string;
13
- cwd?: string;
14
- }): Checkpoint;
15
- declare function checkpointLoad(id: string, cwd?: string): Checkpoint | undefined;
16
- declare function checkpointList(cwd?: string): Checkpoint[];
17
- declare function checkpointLatest(cwd?: string): Checkpoint | undefined;
18
- //#endregion
19
- export { Checkpoint, checkpointLatest, checkpointList, checkpointLoad, checkpointSave };
@@ -1 +0,0 @@
1
- import{resolve as e}from"node:path";import{existsSync as t,mkdirSync as n,readFileSync as r,readdirSync as i,renameSync as a,writeFileSync as o}from"node:fs";import{resolveStateDir as s}from"../../core/dist/index.js";function c(r){let i=e(s(r??process.cwd()),`checkpoints`);return t(i)||n(i,{recursive:!0}),i}function l(t,n,r){let i=t.toLowerCase().replace(/[^a-z0-9]+/g,`-`).replace(/^-|-$/g,``)||`checkpoint`,s={id:`${Date.now()}-${i}`,label:t,createdAt:new Date().toISOString(),data:n,files:r?.files,notes:r?.notes},l=e(c(r?.cwd),`${s.id}.json`),u=`${l}.tmp`;return o(u,`${JSON.stringify(s,null,2)}\n`,`utf-8`),a(u,l),s}function u(n,i){let a=c(i),o=e(a,`${n}.json`);if(o.startsWith(e(a))&&t(o))try{return JSON.parse(r(o,`utf-8`))}catch(e){if(e?.code===`ENOENT`)return;console.warn(`Corrupt state file ${o}: ${e instanceof Error?e.message:String(e)}`);return}}function d(t){let n=c(t);return i(n).filter(e=>e.endsWith(`.json`)).flatMap(t=>{let i=e(n,t);try{return[JSON.parse(r(i,`utf-8`))]}catch(e){return e?.code===`ENOENT`||console.warn(`Corrupt state file ${i}: ${e instanceof Error?e.message:String(e)}`),[]}}).sort((e,t)=>t.createdAt.localeCompare(e.createdAt))}function f(e){return d(e)[0]}export{f as checkpointLatest,d as checkpointList,u as checkpointLoad,l as checkpointSave};
@@ -1,39 +0,0 @@
1
- //#region packages/tools/src/codemod.d.ts
2
- interface CodemodRule {
3
- /** Description of what this rule does */
4
- description: string;
5
- /** Regex pattern to match (string form, will be compiled) */
6
- pattern: string;
7
- /** Replacement string (supports $1, $2 capture groups) */
8
- replacement: string;
9
- /** Optional: only apply to files matching this glob */
10
- fileFilter?: string;
11
- }
12
- interface CodemodOptions {
13
- /** Root directory to apply codemod in */
14
- rootPath: string;
15
- /** Rules to apply */
16
- rules: CodemodRule[];
17
- /** File extensions to process */
18
- extensions?: string[];
19
- /** Exclude patterns */
20
- exclude?: string[];
21
- /** Dry run */
22
- dryRun?: boolean;
23
- }
24
- interface CodemodChange {
25
- rule: string;
26
- path: string;
27
- line: number;
28
- before: string;
29
- after: string;
30
- }
31
- interface CodemodResult {
32
- changes: CodemodChange[];
33
- rulesApplied: number;
34
- filesModified: number;
35
- dryRun: boolean;
36
- }
37
- declare function codemod(options: CodemodOptions): Promise<CodemodResult>;
38
- //#endregion
39
- export { CodemodChange, CodemodOptions, CodemodResult, CodemodRule, codemod };
@@ -1,2 +0,0 @@
1
- import{DEFAULT_TOOL_EXTENSIONS as e,matchesGlobPattern as t,walkFiles as n}from"./file-walk.js";import{createRestorePoint as r}from"./restore-points.js";import{readFile as i,writeFile as a}from"node:fs/promises";import{relative as o}from"node:path";function s(e){return e.replace(/\\/g,`/`)}async function c(c){let{rootPath:l,rules:u,extensions:d=e,exclude:f=[],dryRun:p=!1}=c,m=u.map(e=>({...e,regex:new RegExp(e.pattern,`g`)})),h=await n(l,d,f),g=[],_=new Set,v=0,y=[];for(let e of h){let n=s(o(l,e)),r=await i(e,`utf-8`),c=r.split(/\r?\n/),u=!1;for(let[e,r]of m.entries())if(!(r.fileFilter&&!t(n,r.fileFilter)))for(let t=0;t<c.length;t++){let i=c[t];r.regex.lastIndex=0;let a=i.replace(r.regex,r.replacement);i!==a&&(c[t]=a,u=!0,_.add(e),g.push({rule:r.description,path:n,line:t+1,before:i,after:a}))}u&&(v+=1,p||(y.push({path:e,content:r}),await a(e,c.join(`
2
- `),`utf-8`)))}return!p&&y.length>0&&r(`codemod`,y,`codemod: ${u.length} rules, ${v} files`),{changes:g,rulesApplied:_.size,filesModified:v,dryRun:p}}export{c as codemod};
@@ -1,47 +0,0 @@
1
- import { FileCache } from "./file-cache.js";
2
- import { IEmbedder } from "../../embeddings/dist/index.js";
3
-
4
- //#region packages/tools/src/compact.d.ts
5
- interface CompactOptions {
6
- /** The text to compress (at least one of text/path required) */
7
- text?: string;
8
- /** File path to read server-side — avoids read_file round-trip (at least one of text/path required) */
9
- path?: string;
10
- /** The focus query — what are we trying to understand? */
11
- query: string;
12
- /** Target output size in characters (default: 3000) */
13
- maxChars?: number;
14
- /** Token budget — when set, overrides maxChars (approx 4 chars per token) */
15
- tokenBudget?: number;
16
- /** Minimum similarity score to include a segment (0-1, default: 0.3) */
17
- minScore?: number;
18
- /** Segmentation strategy (default: 'paragraph') */
19
- segmentation?: 'paragraph' | 'sentence' | 'line';
20
- /** Optional file cache — use cached content instead of raw readFile */
21
- cache?: FileCache;
22
- /**
23
- * Content delivery mode:
24
- * - 'full' (default): Return compressed text as normal
25
- * - 'delta': Return only changes since last read (for re-reads of same file)
26
- */
27
- mode?: 'full' | 'delta';
28
- }
29
- interface CompactResult {
30
- /** The compressed text */
31
- text: string;
32
- /** Original size in chars */
33
- originalChars: number;
34
- /** Compressed size in chars */
35
- compressedChars: number;
36
- /** Compression ratio (0-1, lower = more compressed) */
37
- ratio: number;
38
- /** Number of segments kept / total */
39
- segmentsKept: number;
40
- segmentsTotal: number;
41
- }
42
- /**
43
- * Compress text by extracting segments most relevant to a query.
44
- */
45
- declare function compact(embedder: IEmbedder, options: CompactOptions): Promise<CompactResult>;
46
- //#endregion
47
- export { CompactOptions, CompactResult, compact };
@@ -1,3 +0,0 @@
1
- import{bookendReorder as e,cosineSimilarity as t,segment as n}from"./text-utils.js";import{getDelta as r}from"./compression/delta-cache.js";import{scoreLines as i}from"./compression/scoring.js";import{readFile as a,stat as o}from"node:fs/promises";async function s(s,c){let{query:l,maxChars:u=3e3,minScore:d=.3,segmentation:f=`paragraph`}=c,p=c.tokenBudget?c.tokenBudget*4:u,m;if(c.text)m=c.text;else if(c.path){let e;try{e=await o(c.path)}catch(e){let t=e.code;throw t===`ENOENT`?Error(`File not found: ${c.path}. Check the path and try again.`):t===`EACCES`||t===`EPERM`?Error(`Permission denied reading ${c.path}. The file exists but is not accessible.`):e}if(e.isDirectory())throw Error(`Path is a directory: ${c.path}. compact 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). compact supports files up to 10MB. Consider splitting or using search instead.`);m=c.cache?(await c.cache.get(c.path)).content:await a(c.path,`utf-8`)}else throw Error(`Either "text" or "path" must be provided`);if(c.mode===`delta`&&c.path){let e=r(c.path,m);if(e.isDelta)return{text:e.text,originalChars:m.length,compressedChars:e.text.length,ratio:e.text.length/m.length,segmentsKept:1,segmentsTotal:1}}if(m.length<=p)return{text:m,originalChars:m.length,compressedChars:m.length,ratio:1,segmentsKept:1,segmentsTotal:1};let h=n(m,f);if(h.length===0)return{text:``,originalChars:m.length,compressedChars:0,ratio:0,segmentsKept:0,segmentsTotal:0};let g=await s.embed(l),_=i(h),v=[];for(let e=0;e<h.length;e++){let n=.85*t(g,await s.embed(h[e]))+.15*(_[e]??0);v.push({text:h[e],score:n,index:e})}let y=v.filter(e=>e.score>=d).sort((e,t)=>t.score-e.score),b=[],x=0;for(let e of y){if(x+e.text.length>p){x===0&&(b.push({...e,text:e.text.slice(0,p)}),x=p);break}b.push(e),x+=e.text.length+2}let S=e(b.sort((e,t)=>t.score-e.score)).map(e=>e.text).join(`
2
-
3
- `);return{text:S,originalChars:m.length,compressedChars:S.length,ratio:S.length/m.length,segmentsKept:b.length,segmentsTotal:h.length}}export{s as compact};
@@ -1,38 +0,0 @@
1
- import { CompressionMode, CompressionResult } from "./compression/types.js";
2
- import { detectOutputTool } from "./compression/engine.js";
3
-
4
- //#region packages/tools/src/compress-output.d.ts
5
- interface CompressOutputOptions {
6
- /** Raw terminal/shell output text */
7
- text: string;
8
- /** Override detected tool (e.g., 'git', 'npm', 'tsc') */
9
- tool?: string;
10
- /** Compression mode: structural (default), heuristic, aggressive */
11
- mode?: CompressionMode;
12
- /** Maximum output characters (default: 4000) */
13
- maxChars?: number;
14
- /** Maximum output tokens (alternative to maxChars, uses 4 chars/token) */
15
- tokenBudget?: number;
16
- }
17
- /**
18
- * Compress terminal/shell output using intelligent rule-based compression.
19
- *
20
- * Automatically detects the tool that produced the output (git, npm, tsc,
21
- * vitest, docker, kubectl, ESLint, etc.) and applies tool-specific
22
- * compression strategies that preserve critical information while reducing
23
- * token count.
24
- *
25
- * @example
26
- * ```ts
27
- * const result = compressTerminalOutput({
28
- * text: rawGitDiff,
29
- * maxChars: 3000,
30
- * });
31
- * // result.text contains compressed output
32
- * // result.rule tells which compression rule was applied
33
- * // result._meta.truncated tells if output was further truncated
34
- * ```
35
- */
36
- declare function compressTerminalOutput(options: CompressOutputOptions): CompressionResult;
37
- //#endregion
38
- export { CompressOutputOptions, type CompressionMode, type CompressionResult, compressTerminalOutput, detectOutputTool };
@@ -1 +0,0 @@
1
- import{compressOutput as e,detectOutputTool as t}from"./compression/engine.js";import"./compression/rules/index.js";function n(t){let{text:n,tool:r,mode:i=`structural`,maxChars:a,tokenBudget:o}=t;return e(n,{mode:i,maxChars:o?o*4:a??4e3,tool:r})}export{n as compressTerminalOutput,t as detectOutputTool};
@@ -1,29 +0,0 @@
1
- //#region packages/tools/src/compression/delta-cache.d.ts
2
- interface DeltaCacheEntry {
3
- hash: string;
4
- text: string;
5
- timestamp: number;
6
- }
7
- interface DeltaResult {
8
- /** The delta text (diff or full text if no prior version) */
9
- text: string;
10
- /** Whether this is a delta (true) or full text (false) */
11
- isDelta: boolean;
12
- /** Content hash of current version */
13
- hash: string;
14
- }
15
- /**
16
- * Get delta for a given key (typically file path).
17
- * Returns unified diff if prior version cached, or full text otherwise.
18
- */
19
- declare function getDelta(key: string, currentText: string): DeltaResult;
20
- /**
21
- * Clear the delta cache (useful for testing).
22
- */
23
- declare function clearDeltaCache(): void;
24
- /**
25
- * Check if a key has a cached version.
26
- */
27
- declare function hasCachedVersion(key: string): boolean;
28
- //#endregion
29
- export { DeltaCacheEntry, DeltaResult, clearDeltaCache, getDelta, hasCachedVersion };
@@ -1 +0,0 @@
1
- import{createHash as e}from"node:crypto";import{createTwoFilesPatch as t}from"diff";import{LRUCache as n}from"lru-cache";const r=new n({max:200,ttl:1e3*60*30});function i(t){return e(`sha256`).update(t).digest(`hex`).slice(0,16)}function a(e,n){let a=i(n),o=r.get(e);if(r.set(e,{hash:a,text:n,timestamp:Date.now()}),!o||o.hash===a)return{text:o?.hash===a?`[No changes since last read]`:n,isDelta:o?.hash===a,hash:a};let s=t(e,e,o.text,n,`previous`,`current`,{context:3});return s.length>=n.length*.8?{text:n,isDelta:!1,hash:a}:{text:s,isDelta:!0,hash:a}}function o(){r.clear()}function s(e){return r.has(e)}export{o as clearDeltaCache,a as getDelta,s as hasCachedVersion};
@@ -1,34 +0,0 @@
1
- import { CompressionContext, CompressionMode, CompressionResult, CompressionRule } from "./types.js";
2
-
3
- //#region packages/tools/src/compression/engine.d.ts
4
- /**
5
- * Register a compression rule. Rules are auto-sorted by priority (highest first).
6
- */
7
- declare function registerRule(rule: CompressionRule): void;
8
- /**
9
- * Register multiple compression rules at once.
10
- */
11
- declare function registerRules(newRules: CompressionRule[]): void;
12
- /**
13
- * Get all registered rules (for testing/inspection).
14
- */
15
- declare function getRegisteredRules(): readonly CompressionRule[];
16
- /**
17
- * Detect the tool that produced the output.
18
- * Uses heuristic pattern matching on the raw text.
19
- */
20
- declare function detectOutputTool(text: string): string;
21
- /**
22
- * Core compression pipeline.
23
- * 1. Strip ANSI codes
24
- * 2. Detect tool
25
- * 3. Find matching rule (priority order)
26
- * 4. Apply rule or fall back to truncation
27
- */
28
- declare function compressOutput(rawText: string, options?: {
29
- mode?: CompressionMode;
30
- maxChars?: number;
31
- tool?: string;
32
- }): CompressionResult;
33
- //#endregion
34
- export { type CompressionContext, type CompressionMode, type CompressionResult, type CompressionRule, compressOutput, detectOutputTool, getRegisteredRules, registerRule, registerRules };
@@ -1,4 +0,0 @@
1
- import{stripAnsi as e}from"../parse-output.js";import{estimateTokens as t}from"../text-utils.js";const n=[];function r(e){n.push(e),n.sort((e,t)=>t.priority-e.priority)}function i(e){for(let t of e)r(t)}function a(){return n}function o(e){return/^(diff --git|commit [0-9a-f]{7,40}|On branch |Your branch )/m.test(e)?`git`:/^\s*[MADRCU?!]{1,2}\s+\S/m.test(e)&&/^##\s/m.test(e)?`git-status`:/^(npm (warn|ERR!|notice)|added \d+ packages?|up to date)/m.test(e)?`npm`:/^(Packages|Progress):/m.test(e)||/pnpm/.test(e)?`pnpm`:/✓|✗|PASS|FAIL|Tests?\s+\d+\s+(passed|failed)/m.test(e)||/^(PASS|FAIL)\s+\S/m.test(e)?`test-runner`:/^(error TS\d+|warning TS\d+|\S+\.tsx?[(:]\d+)/m.test(e)?`tsc`:/^\S+\.\w+:\d+:\d+\s+(error|warning|info)/m.test(e)||/Found \d+ (error|warning)/m.test(e)?`lint`:/^(CONTAINER ID|IMAGE|REPOSITORY|Step \d+\/\d+|--->)/m.test(e)||/docker|Dockerfile/i.test(e)?`docker`:/^(NAME\s+READY|NAMESPACE\s|kubectl)/m.test(e)?`kubectl`:`unknown`}function s(r,i={}){let{mode:a=`structural`,maxChars:s=4e3}=i,c=e(r),l=i.tool??o(c),u=c.length;if(u<=s)return{text:c,originalChars:u,compressedChars:c.length,ratio:1,rule:`passthrough`,tool:l,_meta:{truncated:!1,mode:a}};let d={text:c,tool:l,mode:a,maxChars:s,originalChars:u};for(let e of n)if(e.match(d)){let n=e.compress(d),r=n.length,i=r>s?`${n.slice(0,s-50)}\n... [truncated ${r-s+50} chars, ~${t(n.slice(s-50))} tokens]`:n;return{text:i,originalChars:u,compressedChars:i.length,ratio:i.length/u,rule:e.name,tool:l,_meta:{truncated:r>s,mode:a}}}let f=Math.floor(s*.6),p=s-f-60,m=c.split(`
2
- `),h=``,g=0;for(let e of m){if(h.length+e.length+1>f)break;h+=`${h?`
3
- `:``}${e}`,g++}let _=``,v=0;for(let e=m.length-1;e>=g&&!(_.length+m[e].length+1>p);e--)_=`${m[e]}${_?`
4
- `:``}${_}`,v++;let y=`\n... [${m.length-g-v} lines omitted (${Math.max(0,u-h.length-_.length)} chars, ~${t(c.slice(h.length,Math.max(h.length,c.length-_.length)))} tokens)] ...\n`,b=`${h}${y}${_}`;return{text:b,originalChars:u,compressedChars:b.length,ratio:b.length/u,rule:`fallback-truncation`,tool:l,_meta:{truncated:!0,mode:a}}}export{s as compressOutput,o as detectOutputTool,a as getRegisteredRules,r as registerRule,i as registerRules};
@@ -1,20 +0,0 @@
1
- //#region packages/tools/src/compression/litm.d.ts
2
- /**
3
- * LITM-aware block positioning for multi-source digest.
4
- * Liu et al. TACL 2024: LLMs attend more to start and end positions.
5
- * Re-orders source blocks so highest-relevance sources appear at edges.
6
- */
7
- interface ScoredBlock {
8
- id: string;
9
- text: string;
10
- /** Maximum segment score for this source block */
11
- maxScore: number;
12
- }
13
- /**
14
- * Reorder source blocks using bookend (U-curve) positioning.
15
- * Highest-scoring blocks placed at start and end positions.
16
- * Input order is preserved for blocks with equal scores.
17
- */
18
- declare function reorderBlocksLITM(blocks: ScoredBlock[]): ScoredBlock[];
19
- //#endregion
20
- export { ScoredBlock, reorderBlocksLITM };
@@ -1 +0,0 @@
1
- function e(e){if(e.length<=2)return e;let t=[...e].sort((e,t)=>t.maxScore-e.maxScore),n=Array(t.length),r=0,i=t.length-1;for(let e=0;e<t.length;e++)e%2==0?n[r++]=t[e]:n[i--]=t[e];return n}export{e as reorderBlocksLITM};
@@ -1,24 +0,0 @@
1
- //#region packages/tools/src/compression/mmr.d.ts
2
- /**
3
- * MMR (Maximal Marginal Relevance) deduplication for digest segments.
4
- * Prevents near-identical segments from consuming budget.
5
- * Uses bigram Jaccard similarity for fast structural comparison.
6
- */
7
- interface MMRCandidate {
8
- index: number;
9
- text: string;
10
- /** Query relevance score (0-1) */
11
- relevance: number;
12
- }
13
- /**
14
- * Select segments using MMR to balance relevance and diversity.
15
- *
16
- * @param candidates - Segments with their relevance scores
17
- * @param lambda - Trade-off: 1.0 = pure relevance, 0.0 = pure diversity (default: 0.7)
18
- * @param maxItems - Maximum items to select (default: all)
19
- * @param safetyThreshold - Segments above this relevance are always kept (default: 0.8)
20
- * @returns Selected candidates in MMR order
21
- */
22
- declare function mmrSelect(candidates: MMRCandidate[], lambda?: number, maxItems?: number, safetyThreshold?: number): MMRCandidate[];
23
- //#endregion
24
- export { MMRCandidate, mmrSelect };
@@ -1 +0,0 @@
1
- function e(e){let t=new Set,n=e.toLowerCase().replace(/\s+/g,` `);for(let e=0;e<n.length-1;e++)t.add(n.slice(e,e+2));return t}function t(e,t){if(e.size===0&&t.size===0)return 1;let n=0;for(let r of e)t.has(r)&&n++;let r=e.size+t.size-n;return r===0?0:n/r}function n(n,r=.7,i,a=.8){if(n.length===0)return[];let o=i??n.length,s=[],c=[],l=new Set(n.map((e,t)=>t)),u=n.map(t=>e(t.text));for(;s.length<o&&l.size>0;){let e=-1,i=-1/0;for(let o of l){let l=n[o];if(l.relevance>=a&&s.length===0){e=o;break}let d=0;for(let e of c){let n=t(u[o],e);n>d&&(d=n)}let f=r*l.relevance-(1-r)*d;f>i&&(i=f,e=o)}if(e===-1)break;s.push(n[e]),c.push(u[e]),l.delete(e)}return s}export{n as mmrSelect};
@@ -1,11 +0,0 @@
1
- import { CompressionRule } from "../types.js";
2
-
3
- //#region packages/tools/src/compression/rules/docker.d.ts
4
- /**
5
- * Compression rule for Docker build/run output.
6
- * Preserves: build errors, final image info, layer cache hits.
7
- * Collapses: download progress, intermediate steps.
8
- */
9
- declare const dockerRule: CompressionRule;
10
- //#endregion
11
- export { dockerRule };
@@ -1,3 +0,0 @@
1
- const e={name:`docker`,toolPatterns:[`docker`],priority:8,match(e){return e.tool===`docker`},compress(e){let t=e.text.split(`
2
- `),n=[],r=0,i=0;for(let e of t){if(e.match(/^(ERROR|error|Error|WARNING|SECURITY)/i)||e.includes(`failed`)){n.push(e);continue}if(e.match(/^Step \d+\/\d+\s*:/)){n.push(e);continue}if(e.match(/^\s*(FROM|RUN|COPY|ADD|WORKDIR|ENV|EXPOSE|CMD|ENTRYPOINT)\s/i)){n.push(e);continue}if(e.includes(`CACHED`)||e.includes(`Using cache`)){r++;continue}if(e.match(/^[a-f0-9]+:\s*(Pull|Download|Extract|Waiting|Verifying)/)){i++;continue}if(e.match(/^(Successfully|sha256:|REPOSITORY|IMAGE ID|CONTAINER ID)/)){n.push(e);continue}if(e.match(/^\S{12}\s+\S+/)&&!e.match(/^[a-f0-9]+:/)){n.push(e);continue}e.match(/^#\d+\s/)&&n.push(e)}return r>0&&n.push(`[${r} cached layers]`),i>0&&n.push(`[${i} download/extract operations]`),n.join(`
3
- `)}};export{e as dockerRule};
@@ -1,11 +0,0 @@
1
- import { CompressionRule } from "../types.js";
2
-
3
- //#region packages/tools/src/compression/rules/generic.d.ts
4
- /**
5
- * Generic compression rule — lowest priority fallback.
6
- * Handles: dedup repeated lines, collapse blank lines, smart truncation.
7
- * Applied when no specific tool rule matches.
8
- */
9
- declare const genericRule: CompressionRule;
10
- //#endregion
11
- export { genericRule };
@@ -1,3 +0,0 @@
1
- const e={name:`generic`,toolPatterns:[/.*/],priority:0,match(e){return e.tool===`unknown`||!e.tool},compress(e){let t=e.text.split(`
2
- `),n=[],r=``,i=0,a=0;for(let e of t){let t=e.trim();if(t===``){a++,a<=1&&n.push(``);continue}if(a=0,t===r.trim()){i++;continue}i>0&&(n.push(` [repeated ${i} more times]`),i=0),r=e,n.push(e)}return i>0&&n.push(` [repeated ${i} more times]`),n.join(`
3
- `)}};export{e as genericRule};
@@ -1,11 +0,0 @@
1
- import { CompressionRule } from "../types.js";
2
-
3
- //#region packages/tools/src/compression/rules/git.d.ts
4
- /**
5
- * Compression rule for git diff and git log output.
6
- * Preserves: file list, +/- stats, error messages.
7
- * Collapses: hunk bodies, repeated context lines.
8
- */
9
- declare const gitRule: CompressionRule;
10
- //#endregion
11
- export { gitRule };
@@ -1,3 +0,0 @@
1
- const e={name:`git`,toolPatterns:[`git`,`git-status`],priority:10,match(e){return e.tool===`git`||e.tool===`git-status`},compress(e){let t=e.text.split(`
2
- `),n=[],r=!1,i=0,a=0,o=``;for(let s of t){if(s.startsWith(`diff --git`)||s.startsWith(`---`)||s.startsWith(`+++`)){r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines in ${o}]`),r=!1,i=0,a=0,n.push(s),s.startsWith(`diff --git`)&&(o=s.replace(/^diff --git a\/\S+ b\//,``));continue}if(s.startsWith(`@@`)){r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines]`),r=!0,i=0,a=0,n.push(s);continue}if(e.tool===`git-status`){n.push(s);continue}if(r){s.startsWith(`+`)?i++:s.startsWith(`-`)&&a++;continue}if(s.startsWith(`commit `)||s.startsWith(`Author:`)||s.startsWith(`Date:`)||s.startsWith(`On branch`)||s.match(/^\s*\d+ file/)||s.match(/insertion|deletion/)){n.push(s);continue}if(s.startsWith(`error:`)||s.startsWith(`fatal:`)||s.startsWith(`warning:`)){n.push(s);continue}/^\s{4}\S/.test(s)&&n.push(s)}return r&&(i>0||a>0)&&n.push(` [${i}+ ${a}- lines in ${o}]`),n.join(`
3
- `)}};export{e as gitRule};