@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,14 +0,0 @@
1
- import { ElicitFormSchema, ElicitOptions, FieldSchema } from "./types.js";
2
-
3
- //#region packages/elicitation/src/build.d.ts
4
- /** Build a form schema from a record of named fields. */
5
- declare function buildFormSchema(fields: Record<string, FieldSchema>, required?: string[]): ElicitFormSchema;
6
- /**
7
- * Build the full elicitation request options.
8
- * `message` — prompt text shown above the form.
9
- * `fields` — record of field-id → FieldSchema.
10
- * `required` — field ids that must be filled.
11
- */
12
- declare function buildElicitRequest(message: string, fields: Record<string, FieldSchema>, required?: string[]): ElicitOptions;
13
- //#endregion
14
- export { buildElicitRequest, buildFormSchema };
@@ -1 +0,0 @@
1
- function e(e,t){return{type:`object`,properties:e,...t&&t.length>0?{required:t}:{}}}function t(t,n,r){return{message:t,schema:e(n,r)}}export{t as buildElicitRequest,e as buildFormSchema};
@@ -1,32 +0,0 @@
1
- import { ArrayFieldSchema, BooleanFieldSchema, EnumFieldSchema, NumberFieldSchema, TextFieldSchema } from "./types.js";
2
-
3
- //#region packages/elicitation/src/fields.d.ts
4
- declare const field: {
5
- /** Free text input. */readonly text: (title: string, opts?: {
6
- description?: string;
7
- minLength?: number;
8
- maxLength?: number;
9
- default?: string;
10
- }) => TextFieldSchema; /** Single-select dropdown/radio. */
11
- readonly select: (title: string, options: string[], opts?: {
12
- description?: string;
13
- enumNames?: string[];
14
- default?: string;
15
- }) => EnumFieldSchema; /** Multi-select checkboxes. */
16
- readonly multi: (title: string, options: string[], opts?: {
17
- description?: string;
18
- }) => ArrayFieldSchema; /** Boolean checkbox / confirmation. */
19
- readonly confirm: (title: string, opts?: {
20
- description?: string;
21
- default?: boolean;
22
- }) => BooleanFieldSchema; /** Numeric input. */
23
- readonly number: (title: string, opts?: {
24
- description?: string;
25
- minimum?: number;
26
- maximum?: number;
27
- integer?: boolean;
28
- default?: number;
29
- }) => NumberFieldSchema;
30
- };
31
- //#endregion
32
- export { field };
@@ -1 +0,0 @@
1
- const e={text(e,t){return{type:`string`,title:e,...t?.description!==void 0&&{description:t.description},...t?.minLength!==void 0&&{minLength:t.minLength},...t?.maxLength!==void 0&&{maxLength:t.maxLength},...t?.default!==void 0&&{default:t.default}}},select(e,t,n){return{type:`string`,title:e,enum:t,...n?.description!==void 0&&{description:n.description},...n?.enumNames!==void 0&&{enumNames:n.enumNames},...n?.default!==void 0&&{default:n.default}}},multi(e,t,n){return{type:`array`,title:e,items:{type:`string`,enum:t},uniqueItems:!0,...n?.description!==void 0&&{description:n.description}}},confirm(e,t){return{type:`boolean`,title:e,...t?.description!==void 0&&{description:t.description},...t?.default!==void 0&&{default:t.default}}},number(e,t){return{type:t?.integer?`integer`:`number`,title:e,...t?.description!==void 0&&{description:t.description},...t?.minimum!==void 0&&{minimum:t.minimum},...t?.maximum!==void 0&&{maximum:t.maximum},...t?.default!==void 0&&{default:t.default}}}};export{e as field};
@@ -1,15 +0,0 @@
1
- import { ElicitContent, ElicitResponse } from "./types.js";
2
-
3
- //#region packages/elicitation/src/normalize.d.ts
4
- /** Raw elicitation result from the MCP SDK. */
5
- interface RawElicitResult {
6
- action: string;
7
- content?: Record<string, unknown>;
8
- }
9
- /**
10
- * Normalize a raw MCP elicitation result into a typed response.
11
- * Handles missing fields, unknown actions, and type coercion.
12
- */
13
- declare function normalizeResponse<T extends ElicitContent = ElicitContent>(raw: RawElicitResult | undefined | null): ElicitResponse<T>;
14
- //#endregion
15
- export { normalizeResponse };
@@ -1 +0,0 @@
1
- const e=new Set([`accept`,`decline`,`cancel`]);function t(t){if(!t)return{action:`cancel`};let n=e.has(t.action)?t.action:`cancel`;if(n!==`accept`||!t.content)return{action:n};let r={};for(let[e,n]of Object.entries(t.content))(typeof n==`string`||typeof n==`number`||typeof n==`boolean`||Array.isArray(n)&&n.every(e=>typeof e==`string`))&&(r[e]=n);return{action:n,content:r}}export{t as normalizeResponse};
@@ -1,88 +0,0 @@
1
- //#region packages/elicitation/src/types.d.ts
2
- /**
3
- * MCP elicitation types.
4
- *
5
- * Elicitation allows tools to request structured input from the user via
6
- * the MCP client. The schema follows JSON Schema constraints:
7
- * only flat primitives and string arrays are supported.
8
- */
9
- /** User action on the elicitation dialog. */
10
- type ElicitAction = 'accept' | 'decline' | 'cancel';
11
- /** Flat content map — MCP only supports primitives + string arrays. */
12
- type ElicitContent = Record<string, string | number | boolean | string[]>;
13
- /** Normalized elicitation response. */
14
- interface ElicitResponse<T extends ElicitContent = ElicitContent> {
15
- action: ElicitAction;
16
- content?: T;
17
- }
18
- interface TextFieldSchema {
19
- type: 'string';
20
- title: string;
21
- description?: string;
22
- minLength?: number;
23
- maxLength?: number;
24
- default?: string;
25
- }
26
- interface EnumFieldSchema {
27
- type: 'string';
28
- title: string;
29
- description?: string;
30
- enum: string[];
31
- enumNames?: string[];
32
- default?: string;
33
- }
34
- interface ArrayFieldSchema {
35
- type: 'array';
36
- title: string;
37
- description?: string;
38
- items: {
39
- type: 'string';
40
- enum: string[];
41
- };
42
- uniqueItems: true;
43
- }
44
- interface BooleanFieldSchema {
45
- type: 'boolean';
46
- title: string;
47
- description?: string;
48
- default?: boolean;
49
- }
50
- interface NumberFieldSchema {
51
- type: 'number' | 'integer';
52
- title: string;
53
- description?: string;
54
- minimum?: number;
55
- maximum?: number;
56
- default?: number;
57
- }
58
- type FieldSchema = TextFieldSchema | EnumFieldSchema | ArrayFieldSchema | BooleanFieldSchema | NumberFieldSchema;
59
- /** JSON Schema object for the elicitation form. */
60
- interface ElicitFormSchema {
61
- type: 'object';
62
- properties: Record<string, FieldSchema>;
63
- required?: string[];
64
- }
65
- interface ElicitOptions {
66
- message: string;
67
- schema: ElicitFormSchema;
68
- }
69
- /**
70
- * High-level elicitation interface exposed to tools.
71
- * Wraps `server.createElicitation()` with convenience methods.
72
- */
73
- interface Elicitor {
74
- /** Whether the connected client supports elicitation. */
75
- readonly available: boolean;
76
- /** Ask a structured form question. */
77
- ask<T extends ElicitContent = ElicitContent>(opts: ElicitOptions): Promise<ElicitResponse<T>>;
78
- /** Yes/no confirmation. */
79
- confirm(message: string): Promise<boolean>;
80
- /** Pick one from a list. Returns null if declined/cancelled. */
81
- selectOne(message: string, options: string[]): Promise<string | null>;
82
- /** Pick many from a list. Returns empty array if declined/cancelled. */
83
- selectMany(message: string, options: string[]): Promise<string[]>;
84
- /** Free text prompt. Returns null if declined/cancelled. */
85
- promptText(message: string, description?: string): Promise<string | null>;
86
- }
87
- //#endregion
88
- export { ArrayFieldSchema, BooleanFieldSchema, ElicitAction, ElicitContent, ElicitFormSchema, ElicitOptions, ElicitResponse, Elicitor, EnumFieldSchema, FieldSchema, NumberFieldSchema, TextFieldSchema };
@@ -1 +0,0 @@
1
- export{};
@@ -1,26 +0,0 @@
1
- //#region packages/embeddings/src/embedder.interface.d.ts
2
- /**
3
- * Embedding abstraction — allows swapping embedding models.
4
- */
5
- interface IEmbedder {
6
- /** Generate an embedding vector for a single text string (used for documents/passages) */
7
- embed(text: string): Promise<Float32Array>;
8
- /**
9
- * Generate an embedding vector for a search query.
10
- * Some models (e.g., BGE) use a query prefix for asymmetric retrieval.
11
- * Falls back to embed() if the model doesn't need query prefixing.
12
- */
13
- embedQuery(query: string): Promise<Float32Array>;
14
- /** Generate embeddings for multiple text strings (batched, for documents/passages) */
15
- embedBatch(texts: string[], batchSize?: number): Promise<Float32Array[]>;
16
- /** The dimensionality of the embedding vectors */
17
- readonly dimensions: number;
18
- /** The model identifier */
19
- readonly modelId: string;
20
- /** Initialize the model (download if needed, load into memory) */
21
- initialize(): Promise<void>;
22
- /** Release model resources */
23
- shutdown?(): Promise<void>;
24
- }
25
- //#endregion
26
- export { IEmbedder };
@@ -1 +0,0 @@
1
- export{};
@@ -1,23 +0,0 @@
1
- import { IEmbedder } from "./embedder.interface.js";
2
-
3
- //#region packages/embeddings/src/onnx-embedder.d.ts
4
- declare class OnnxEmbedder implements IEmbedder {
5
- private pipe;
6
- readonly dimensions: number;
7
- readonly modelId: string;
8
- private readonly queryPrefix;
9
- constructor(options?: {
10
- model?: string;
11
- dimensions?: number;
12
- queryPrefix?: string;
13
- });
14
- private detectQueryPrefix;
15
- initialize(): Promise<void>;
16
- private isCorruptionError;
17
- shutdown(): Promise<void>;
18
- embed(text: string): Promise<Float32Array>;
19
- embedQuery(query: string): Promise<Float32Array>;
20
- embedBatch(texts: string[], batchSize?: number): Promise<Float32Array[]>;
21
- }
22
- //#endregion
23
- export { OnnxEmbedder };
@@ -1 +0,0 @@
1
- import{rm as e}from"node:fs/promises";import{homedir as t}from"node:os";import{join as n}from"node:path";import{EMBEDDING_DEFAULTS as r}from"../../core/dist/index.js";import{env as i,pipeline as a}from"@huggingface/transformers";i.cacheDir=n(t(),`.cache`,`huggingface`,`transformers-js`);var o=class{pipe=null;dimensions;modelId;queryPrefix;constructor(e){this.modelId=e?.model??r.model,this.dimensions=e?.dimensions??r.dimensions,this.queryPrefix=e?.queryPrefix??this.detectQueryPrefix(this.modelId)}detectQueryPrefix(e){let t=e.toLowerCase();return t.includes(`bge`)||t.includes(`mxbai-embed`)?`Represent this sentence for searching relevant passages: `:t.includes(`/e5-`)||t.includes(`multilingual-e5`)?`query: `:``}async initialize(){if(!this.pipe)try{this.pipe=await a(`feature-extraction`,this.modelId,{dtype:`q8`})}catch(r){let o=r.message?.toLowerCase()??``;if(this.isCorruptionError(o)){let r=n(i.cacheDir??n(t(),`.cache`,`huggingface`,`transformers-js`),this.modelId);console.error(`[aikit:auto-heal] Detected corrupted model cache for "${this.modelId}". Clearing cache at ${r} and retrying download...`);try{await e(r,{recursive:!0,force:!0})}catch{}try{this.pipe=await a(`feature-extraction`,this.modelId,{dtype:`q8`}),console.error(`[aikit:auto-heal] Model "${this.modelId}" re-downloaded successfully.`);return}catch(e){throw Error(`Failed to initialize embedding model "${this.modelId}" after auto-heal: ${e.message}`)}}throw Error(`Failed to initialize embedding model "${this.modelId}": ${r.message}`)}}isCorruptionError(e){return[`protobuf`,`invalid model`,`invalid onnx`,`unexpected end`,`unexpected token`,`failed to load`,`checksum`,`corrupt`,`could not load`,`onnx`,`malformed`].some(t=>e.includes(t))}async shutdown(){this.pipe=null}async embed(e){this.pipe||await this.initialize();let t=await this.pipe?.(e,{pooling:`mean`,normalize:!0});if(!t)throw Error(`Embedding pipeline returned no output`);return new Float32Array(t.data)}async embedQuery(e){return this.embed(this.queryPrefix+e)}async embedBatch(e,t=64){if(e.length===0)return[];this.pipe||await this.initialize();let n=[];for(let r=0;r<e.length;r+=t){let i=e.slice(r,r+t),a=await this.pipe?.(i,{pooling:`mean`,normalize:!0});if(!a)throw Error(`Embedding pipeline returned no output`);if(i.length===1)n.push(new Float32Array(a.data));else for(let e=0;e<i.length;e++){let t=e*this.dimensions,r=a.data.slice(t,t+this.dimensions);n.push(new Float32Array(r))}}return n}};export{o as OnnxEmbedder};
@@ -1,28 +0,0 @@
1
- import { ERSearchResult } from "./types.js";
2
-
3
- //#region packages/enterprise-bridge/src/cache.d.ts
4
- declare class ERCache {
5
- private readonly cache;
6
- private readonly maxEntries;
7
- private readonly defaultTtl;
8
- constructor(options?: {
9
- maxEntries?: number;
10
- defaultTtl?: number;
11
- });
12
- /** Normalize query for cache key: lowercase, trim, collapse whitespace */
13
- static normalizeKey(query: string): string;
14
- get(query: string): ERSearchResult[] | undefined;
15
- set(query: string, results: ERSearchResult[], ttl?: number): void;
16
- /** Invalidate entries matching a topic (exact normalized key match) */
17
- invalidate(query: string): boolean;
18
- clear(): void;
19
- get size(): number;
20
- /** Get cache stats */
21
- stats(): {
22
- size: number;
23
- maxEntries: number;
24
- defaultTtlMs: number;
25
- };
26
- }
27
- //#endregion
28
- export { ERCache };
@@ -1 +0,0 @@
1
- var e=class e{cache=new Map;maxEntries;defaultTtl;constructor(e){this.maxEntries=e?.maxEntries??100,this.defaultTtl=e?.defaultTtl??216e5}static normalizeKey(e){return e.toLowerCase().trim().replace(/\s+/g,` `)}get(t){let n=e.normalizeKey(t),r=this.cache.get(n);if(r){if(Date.now()-r.cachedAt>r.ttl){this.cache.delete(n);return}return this.cache.delete(n),this.cache.set(n,r),r.results}}set(t,n,r){let i=e.normalizeKey(t);if(this.cache.size>=this.maxEntries&&!this.cache.has(i)){let e=this.cache.keys().next().value;e!==void 0&&this.cache.delete(e)}this.cache.set(i,{results:n,query:i,cachedAt:Date.now(),ttl:r??this.defaultTtl})}invalidate(t){let n=e.normalizeKey(t);return this.cache.delete(n)}clear(){this.cache.clear()}get size(){return this.cache.size}stats(){return{size:this.cache.size,maxEntries:this.maxEntries,defaultTtlMs:this.defaultTtl}}};export{e as ERCache};
@@ -1,37 +0,0 @@
1
- import { ERBridgeConfig, ERPushRequest, ERPushResponse, ERSearchResult } from "./types.js";
2
-
3
- //#region packages/enterprise-bridge/src/er-client.d.ts
4
- declare class ERClient {
5
- private readonly baseUrl;
6
- private readonly apiKey;
7
- private readonly timeoutMs;
8
- private circuitState;
9
- private consecutiveFailures;
10
- private openUntil;
11
- private halfOpenProbeInFlight;
12
- private static readonly FAILURE_THRESHOLD;
13
- private static readonly RESET_TIMEOUT_MS;
14
- constructor(config: ERBridgeConfig);
15
- /** Search ER AI Kit */
16
- search(query: string, maxResults?: number): Promise<ERSearchResult[]>;
17
- /** Push curated knowledge to ER via MCP tools endpoint */
18
- push(request: ERPushRequest): Promise<ERPushResponse>;
19
- /** Explicit pull from ER (bypasses local search, for cross-repo context) */
20
- pull(query: string, maxResults?: number): Promise<ERSearchResult[]>;
21
- /** Check ER health */
22
- health(): Promise<{
23
- healthy: boolean;
24
- status?: number;
25
- }>;
26
- /** Check available MCP tools (verify curated_remember exists) */
27
- listTools(): Promise<string[]>;
28
- private fetch;
29
- private checkCircuit;
30
- private recordSuccess;
31
- private recordFailure;
32
- private backoffMs;
33
- private parseRetryAfter;
34
- private sleep;
35
- }
36
- //#endregion
37
- export { ERClient };
@@ -1 +0,0 @@
1
- import{ERTransientError as e}from"./types.js";var t=class t{baseUrl;apiKey;timeoutMs;circuitState=`closed`;consecutiveFailures=0;openUntil=0;halfOpenProbeInFlight=!1;static FAILURE_THRESHOLD=3;static RESET_TIMEOUT_MS=6e4;constructor(e){let t=new URL(e.baseUrl);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw Error(`Unsupported protocol: ${t.protocol} — only http/https allowed`);let n=t.hostname===`localhost`||t.hostname===`127.0.0.1`||t.hostname===`::1`;if(t.protocol===`http:`&&!n)throw Error(`Non-TLS (http://) ER endpoints are only allowed for localhost. Use https:// to avoid leaking API keys.`);this.baseUrl=e.baseUrl.replace(/\/+$/,``),this.apiKey=e.apiKey,this.timeoutMs=e.timeoutMs}async search(e,t=5){let n=await this.fetch(`/api/v1/search`,{method:`POST`,body:JSON.stringify({query:e,maxResults:t,generateResponse:!1})});if(!n.ok)throw Error(`ER search failed: ${n.status} ${n.statusText}`);return((await n.json()).sources??[]).map(e=>{let t=typeof e.score==`number`?e.score:void 0,n=typeof e.confidence==`number`?e.confidence:void 0;return{content:e.content,sourcePath:e.metadata?.sourceUri??`unknown`,score:t??n??0,metadata:e.metadata}})}async push(e){let t=await this.fetch(`/mcp/tools`,{method:`POST`,body:JSON.stringify({name:`curated_remember`,arguments:{title:e.title,content:e.content,category:e.category??`conventions`,tags:[...e.tags??[],`pushed-from-kb`]}})});if(!t.ok)return{pushed:!1,status:`failed`,timestamp:new Date().toISOString(),error:`ER push failed: ${t.status} ${t.statusText}`};let n=await t.json();return{pushed:!0,status:`stored`,remotePath:typeof n.path==`string`?n.path:void 0,timestamp:new Date().toISOString()}}async pull(e,t=10){return this.search(e,t)}async health(){try{let e=await this.fetch(`/api/v1/health`,{method:`GET`});return{healthy:e.ok,status:e.status}}catch{return{healthy:!1}}}async listTools(){try{let e=await this.fetch(`/mcp/tools`,{method:`GET`});return e.ok?((await e.json()).tools??[]).map(e=>e.name):[]}catch{return[]}}async fetch(e,t){this.checkCircuit();let n;for(let r=0;r<=2;r++){let i=new AbortController,a=setTimeout(()=>i.abort(),this.timeoutMs);try{let n=await fetch(`${this.baseUrl}${e}`,{...t,headers:{"Content-Type":`application/json`,"X-Api-Key":this.apiKey,"User-Agent":`aikit-enterprise-bridge/1.0`,...t.headers},signal:i.signal});if(n.ok||n.status>=400&&n.status<500&&n.status!==429)return this.recordSuccess(),n;if(r<2){let e=this.parseRetryAfter(n)??this.backoffMs(r);await this.sleep(e);continue}return this.recordFailure(),n}catch(e){n=e,r<2&&await this.sleep(this.backoffMs(r))}finally{clearTimeout(a)}}throw this.recordFailure(),n??Error(`Fetch failed after retries`)}checkCircuit(){if(this.circuitState===`open`)if(Date.now()>=this.openUntil){if(this.halfOpenProbeInFlight)throw new e(`ER circuit breaker is half-open — probe in progress`);this.circuitState=`half-open`,this.halfOpenProbeInFlight=!0}else throw new e(`ER circuit breaker is open — skipping request`)}recordSuccess(){this.consecutiveFailures=0,this.circuitState=`closed`,this.halfOpenProbeInFlight=!1}recordFailure(){this.consecutiveFailures++,this.halfOpenProbeInFlight=!1,this.consecutiveFailures>=t.FAILURE_THRESHOLD&&(this.circuitState=`open`,this.openUntil=Date.now()+t.RESET_TIMEOUT_MS)}backoffMs(e){let t=500*3**e,n=t*.25*(Math.random()*2-1);return Math.round(t+n)}parseRetryAfter(e){let t=e.headers.get(`Retry-After`);if(!t)return;let n=Number(t);if(!Number.isNaN(n)&&n>=0)return Math.min(n*1e3,3e4)}sleep(e){return new Promise(t=>setTimeout(t,e))}};export{t as ERClient};
@@ -1,62 +0,0 @@
1
- //#region packages/enterprise-bridge/src/evolution-collector.d.ts
2
- /** Evolution data collector — tracks usage metrics for LLM review */
3
- interface EvolutionMetrics {
4
- /** Search metrics */
5
- search: {
6
- totalSearches: number;
7
- erFallbackCount: number;
8
- erFallbackRate: number;
9
- erCacheHitCount: number;
10
- erCacheHitRate: number;
11
- topMissedQueries: Array<{
12
- query: string;
13
- count: number;
14
- }>;
15
- };
16
- /** Push metrics */
17
- push: {
18
- totalPushes: number;
19
- successCount: number;
20
- failCount: number;
21
- pushRate: number; /** Classification match rate — how often rules fired vs knowledge stored */
22
- classificationMatchRate: number; /** Push acceptance rate — how often LLM decided to push after recommendation */
23
- pushAcceptanceRate: number;
24
- };
25
- /** Rule effectiveness */
26
- rules: {
27
- matchCounts: Record<string, number>;
28
- pushCounts: Record<string, number>; /** Rules that fire often but rarely lead to pushes (potential false positives) */
29
- lowConversionRules: Array<{
30
- ruleId: string;
31
- matchCount: number;
32
- pushCount: number;
33
- conversionRate: number;
34
- }>;
35
- };
36
- /** Summary period */
37
- period: {
38
- startedAt: string;
39
- queriedAt: string;
40
- totalEvents: number;
41
- };
42
- }
43
- declare class EvolutionCollector {
44
- private searchEvents;
45
- private classificationEvents;
46
- private pushEvents;
47
- private readonly startedAt;
48
- constructor();
49
- /** Record a search event */
50
- recordSearch(query: string, erFallbackTriggered: boolean, erCacheHit: boolean): void;
51
- /** Record a classification event (when remember returns classification signals) */
52
- recordClassification(entryTitle: string, matchingRuleIds: string[], pushRecommended: boolean): void;
53
- /** Record a push event */
54
- recordPush(entryId: string, success: boolean, ruleId?: string): void;
55
- /** Get aggregated metrics for LLM review */
56
- getMetrics(): EvolutionMetrics;
57
- /** Reset all collected data */
58
- reset(): void;
59
- private trimEvents;
60
- }
61
- //#endregion
62
- export { EvolutionCollector, EvolutionMetrics };
@@ -1 +0,0 @@
1
- var e=class{searchEvents=[];classificationEvents=[];pushEvents=[];startedAt;constructor(){this.startedAt=new Date().toISOString()}recordSearch(e,t,n){this.searchEvents.push({query:e.toLowerCase().trim(),erFallbackTriggered:t,erCacheHit:n,timestamp:Date.now()}),this.trimEvents()}recordClassification(e,t,n){this.classificationEvents.push({entryTitle:e,matchingRuleIds:t,pushRecommended:n,timestamp:Date.now()}),this.trimEvents()}recordPush(e,t,n){this.pushEvents.push({entryId:e,ruleId:n,success:t,timestamp:Date.now()}),this.trimEvents()}getMetrics(){let e=this.searchEvents.length,t=this.searchEvents.filter(e=>e.erFallbackTriggered).length,n=this.searchEvents.filter(e=>e.erCacheHit).length,r=new Map;for(let e of this.searchEvents)e.erFallbackTriggered&&r.set(e.query,(r.get(e.query)??0)+1);let i=[...r.entries()].sort((e,t)=>t[1]-e[1]).slice(0,20).map(([e,t])=>({query:e,count:t})),a=this.pushEvents.length,o=this.pushEvents.filter(e=>e.success).length,s=this.classificationEvents.length,c=this.classificationEvents.filter(e=>e.pushRecommended).length,l={},u={};for(let e of this.classificationEvents)for(let t of e.matchingRuleIds)l[t]=(l[t]??0)+1;for(let e of this.pushEvents)e.ruleId&&(u[e.ruleId]=(u[e.ruleId]??0)+1);let d=Object.entries(l).map(([e,t])=>{let n=u[e]??0;return{ruleId:e,matchCount:t,pushCount:n,conversionRate:t>0?n/t:0}}).filter(e=>e.matchCount>=3&&e.conversionRate<.3).sort((e,t)=>e.conversionRate-t.conversionRate);return{search:{totalSearches:e,erFallbackCount:t,erFallbackRate:e>0?t/e:0,erCacheHitCount:n,erCacheHitRate:t>0?n/t:0,topMissedQueries:i},push:{totalPushes:a,successCount:o,failCount:a-o,pushRate:s>0?a/s:0,classificationMatchRate:s>0?c/s:0,pushAcceptanceRate:c>0?a/c:0},rules:{matchCounts:l,pushCounts:u,lowConversionRules:d},period:{startedAt:this.startedAt,queriedAt:new Date().toISOString(),totalEvents:this.searchEvents.length+this.classificationEvents.length+this.pushEvents.length}}}reset(){this.searchEvents=[],this.classificationEvents=[],this.pushEvents=[]}trimEvents(){this.searchEvents.length>500&&(this.searchEvents=this.searchEvents.slice(-500)),this.classificationEvents.length>500&&(this.classificationEvents=this.classificationEvents.slice(-500)),this.pushEvents.length>500&&(this.pushEvents=this.pushEvents.slice(-500))}};export{e as EvolutionCollector};
@@ -1,45 +0,0 @@
1
- //#region packages/enterprise-bridge/src/policy-store.d.ts
2
- /** A single classification rule */
3
- interface ClassificationRule {
4
- id: string;
5
- patterns: string[];
6
- category: string;
7
- pushWeight: number;
8
- description: string;
9
- examples: string[];
10
- autoPush: false;
11
- enabled: boolean;
12
- createdAt: string;
13
- updatedAt: string;
14
- }
15
- /** Classification result for a knowledge entry */
16
- interface ClassificationResult {
17
- matchingRules: Array<{
18
- ruleId: string;
19
- category: string;
20
- pushWeight: number;
21
- matchedPatterns: string[];
22
- }>;
23
- pushRecommended: boolean;
24
- maxPushWeight: number;
25
- }
26
- declare class PolicyStore {
27
- private rules;
28
- private readonly rulesPath;
29
- constructor(curatedPath: string);
30
- /** Classify a knowledge entry against all enabled rules */
31
- classify(title: string, content: string, tags: string[]): ClassificationResult;
32
- /** Get all rules */
33
- getRules(): ClassificationRule[];
34
- /** Get a single rule by ID */
35
- getRule(ruleId: string): ClassificationRule | undefined;
36
- /** Update an existing rule */
37
- updateRule(ruleId: string, changes: Partial<Omit<ClassificationRule, 'id' | 'createdAt' | 'autoPush'>>): ClassificationRule | undefined;
38
- /** Add a new rule */
39
- addRule(rule: Omit<ClassificationRule, 'createdAt' | 'updatedAt' | 'autoPush'>): ClassificationRule;
40
- /** Delete a rule */
41
- deleteRule(ruleId: string): boolean;
42
- private save;
43
- }
44
- //#endregion
45
- export { ClassificationResult, ClassificationRule, PolicyStore };
@@ -1 +0,0 @@
1
- import{existsSync as e,mkdirSync as t,readFileSync as n,writeFileSync as r}from"node:fs";import{join as i}from"node:path";import{createLogger as a}from"../../core/dist/index.js";const o=a(`bridge`),s=()=>new Date().toISOString(),c=[{id:`cross-repo-contract`,patterns:[`contract`,`interface`,`api`,`event schema`,`publishes`,`subscribes`],category:`contract`,pushWeight:.8,description:`Knowledge describing cross-service interfaces`,examples:[`Service X publishes OrderCreated event with fields...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`architecture-decision`,patterns:[`decided`,`chose`,`tradeoff`,`adr`,`because we need`],category:`decision`,pushWeight:.7,description:`Architecture decisions that affect the ecosystem`,examples:[`We decided to use event sourcing because...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`shared-pattern`,patterns:[`pattern`,`convention`,`standard`,`guideline`,`always use`],category:`pattern`,pushWeight:.6,description:`Patterns and conventions that maintain consistency across repos`,examples:[`Always use the Result type for error handling...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`company-term`,patterns:[`means`,`defined as`,`acronym`,`refers to`],category:`glossary`,pushWeight:.7,description:`Shared vocabulary and terminology definitions`,examples:[`DDD means Domain-Driven Design in our context...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()},{id:`implementation-detail`,patterns:[`private`,`internal`,`helper`,`todo`,`hack`,`workaround`],category:`local-only`,pushWeight:0,description:`Local-only implementation details — never push`,examples:[`TODO: refactor this helper`,`Internal workaround for...`],autoPush:!1,enabled:!0,createdAt:s(),updatedAt:s()}];var l=class{rules=[];rulesPath;constructor(r){let a=i(r,`_policy`);if(this.rulesPath=i(a,`rules.json`),e(a)||t(a,{recursive:!0}),e(this.rulesPath))try{let e=n(this.rulesPath,`utf-8`),t=JSON.parse(e);if(!Array.isArray(t))throw Error(`rules.json must be an array`);for(let e of t)if(typeof e!=`object`||!e||typeof e.id!=`string`||!Array.isArray(e.patterns)||typeof e.category!=`string`||typeof e.pushWeight!=`number`)throw Error(`Invalid rule: ${JSON.stringify(e).slice(0,100)}`);this.rules=t}catch{o.warn(`Failed to parse policy rules, resetting to starter set`),this.rules=[...c],this.save()}else this.rules=[...c],this.save()}classify(e,t,n){let r=`${e} ${t} ${n.join(` `)}`.toLowerCase(),i=[];for(let e of this.rules){if(!e.enabled)continue;let t=e.patterns.filter(e=>r.includes(e.toLowerCase()));t.length>0&&i.push({ruleId:e.id,category:e.category,pushWeight:e.pushWeight,matchedPatterns:t})}let a=i.length>0?Math.max(...i.map(e=>e.pushWeight)):0;return{matchingRules:i,pushRecommended:a>=.5,maxPushWeight:a}}getRules(){return[...this.rules]}getRule(e){return this.rules.find(t=>t.id===e)}updateRule(e,t){let n=this.rules.find(t=>t.id===e);if(n)return Object.assign(n,t,{updatedAt:new Date().toISOString(),autoPush:!1}),this.save(),n}addRule(e){if(this.rules.find(t=>t.id===e.id))throw Error(`Rule with id '${e.id}' already exists`);let t=new Date().toISOString(),n={...e,autoPush:!1,createdAt:t,updatedAt:t};return this.rules.push(n),this.save(),n}deleteRule(e){let t=this.rules.findIndex(t=>t.id===e);return t===-1?!1:(this.rules.splice(t,1),this.save(),!0)}save(){r(this.rulesPath,JSON.stringify(this.rules,null,2),`utf-8`)}};export{l as PolicyStore};
@@ -1,23 +0,0 @@
1
- import { ERPushRequest, ERPushResponse, ERSyncEntry } from "./types.js";
2
- import { ERClient } from "./er-client.js";
3
-
4
- //#region packages/enterprise-bridge/src/push-adapter.d.ts
5
- declare class PushAdapter {
6
- private readonly client;
7
- private readonly syncHistory;
8
- private static readonly MAX_HISTORY;
9
- constructor(client: ERClient);
10
- /** Push a knowledge entry to ER */
11
- push(entryId: string, request: ERPushRequest): Promise<ERPushResponse>;
12
- /** Get sync history */
13
- getHistory(): ERSyncEntry[];
14
- /** Get sync status summary */
15
- getStatus(): {
16
- totalPushed: number;
17
- successCount: number;
18
- failCount: number;
19
- lastPush?: ERSyncEntry;
20
- };
21
- }
22
- //#endregion
23
- export { PushAdapter };
@@ -1 +0,0 @@
1
- var e=class e{client;syncHistory=[];static MAX_HISTORY=100;constructor(e){this.client=e}async push(t,n){let r=await this.client.push(n);for(this.syncHistory.push({entryId:t,title:n.title,pushedAt:r.timestamp,status:r.status,remotePath:r.remotePath});this.syncHistory.length>e.MAX_HISTORY;)this.syncHistory.shift();return r}getHistory(){return[...this.syncHistory]}getStatus(){let e=this.syncHistory.filter(e=>e.status===`stored`).length;return{totalPushed:this.syncHistory.length,successCount:e,failCount:this.syncHistory.length-e,lastPush:this.syncHistory.at(-1)}}};export{e as PushAdapter};
@@ -1,14 +0,0 @@
1
- import { ERSearchResult, MergedSearchResult } from "./types.js";
2
- import { SearchResult } from "../../core/dist/index.js";
3
-
4
- //#region packages/enterprise-bridge/src/result-merger.d.ts
5
- /**
6
- * Merge local and ER results using local-first interleaving.
7
- *
8
- * Local RRF scores (~0.01-0.05) and ER raw similarity scores (~0.3-0.9) are on
9
- * incomparable scales. Instead of sorting both together (which would always rank
10
- * ER above local), we preserve local ordering, deduplicate, then append ER results.
11
- */
12
- declare function mergeResults(localResults: SearchResult[], erResults: ERSearchResult[], limit: number): MergedSearchResult[];
13
- //#endregion
14
- export { mergeResults };
@@ -1 +0,0 @@
1
- function e(e){return{content:e.record.content,sourcePath:e.record.sourcePath,score:e.score,source:`local`,startLine:e.record.startLine,endLine:e.record.endLine,contentType:e.record.contentType,headingPath:e.record.headingPath,origin:e.record.origin,category:e.record.category,tags:e.record.tags}}function t(e){return{content:e.content,sourcePath:e.sourcePath,score:e.score,source:`er`,metadata:e.metadata}}function n(e){return`${e.slice(0,200).replace(/\s+/g,` `)}:${e.length}`}function r(r,i,a){let o=new Set,s=[];for(let t of r){let r=n(t.record.content);o.has(r)||(o.add(r),s.push(e(t)))}let c=[...i].sort((e,t)=>t.score-e.score);for(let e of c){let r=n(e.content);o.has(r)||(o.add(r),s.push(t(e)))}return s.slice(0,a)}export{r as mergeResults};
@@ -1,81 +0,0 @@
1
- //#region packages/enterprise-bridge/src/types.d.ts
2
- /** ER bridge configuration (subset of KBConfig.er) */
3
- interface ERBridgeConfig {
4
- enabled: boolean;
5
- baseUrl: string;
6
- apiKey: string;
7
- timeoutMs: number;
8
- cacheTtlMs: number;
9
- cacheMaxEntries: number;
10
- fallbackThreshold: number;
11
- }
12
- /** Result from ER search API */
13
- interface ERSearchResult {
14
- content: string;
15
- sourcePath: string;
16
- score: number;
17
- metadata?: Record<string, unknown>;
18
- }
19
- /** Response from ER search API (POST /api/v1/search) */
20
- interface ERSearchResponse {
21
- sources: Array<{
22
- content: string;
23
- metadata: Record<string, string>;
24
- score?: number;
25
- confidence?: number;
26
- }>;
27
- query?: string;
28
- searchMode?: string;
29
- }
30
- /** Push request to ER */
31
- interface ERPushRequest {
32
- title: string;
33
- content: string;
34
- category?: string;
35
- tags?: string[];
36
- }
37
- /** Push response from ER */
38
- interface ERPushResponse {
39
- pushed: boolean;
40
- status: 'stored' | 'failed';
41
- remotePath?: string;
42
- timestamp: string;
43
- error?: string;
44
- }
45
- /** Transient ER error (429, 5xx, network) — retries exhausted but not a permanent failure */
46
- declare class ERTransientError extends Error {
47
- readonly statusCode?: number | undefined;
48
- constructor(message: string, statusCode?: number | undefined);
49
- }
50
- /** Sync status entry for tracking push history */
51
- interface ERSyncEntry {
52
- entryId: string;
53
- title: string;
54
- pushedAt: string;
55
- status: 'stored' | 'failed';
56
- remotePath?: string;
57
- }
58
- /** Cache entry wrapping ER search results */
59
- interface ERCacheEntry {
60
- results: ERSearchResult[];
61
- query: string;
62
- cachedAt: number;
63
- ttl: number;
64
- }
65
- /** Merged search result with source provenance */
66
- interface MergedSearchResult {
67
- content: string;
68
- sourcePath: string;
69
- score: number;
70
- source: 'local' | 'er';
71
- startLine?: number;
72
- endLine?: number;
73
- contentType?: string;
74
- headingPath?: string;
75
- origin?: string;
76
- category?: string;
77
- tags?: string[];
78
- metadata?: Record<string, unknown>;
79
- }
80
- //#endregion
81
- export { ERBridgeConfig, ERCacheEntry, ERPushRequest, ERPushResponse, ERSearchResponse, ERSearchResult, ERSyncEntry, ERTransientError, MergedSearchResult };
@@ -1 +0,0 @@
1
- var e=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`ERTransientError`}};export{e as ERTransientError};
@@ -1,25 +0,0 @@
1
- import { FlowFormatAdapter, FlowManifest, FlowParseOptions } from "../types.js";
2
-
3
- //#region packages/flows/src/adapters/claude-plugin.d.ts
4
- declare class ClaudePluginAdapter implements FlowFormatAdapter {
5
- readonly format: "claude-plugin";
6
- detect(sourceDir: string): boolean;
7
- parse(sourceDir: string, options?: FlowParseOptions): Promise<FlowManifest>;
8
- private readPluginJson;
9
- private readString;
10
- private discoverSteps;
11
- private readStep;
12
- /**
13
- * Copy supporting subdirectories (references/, assets/, scripts/) from
14
- * skills/<step>/ to steps/<step>/ so that relative paths inside the
15
- * step README.md resolve correctly at runtime.
16
- *
17
- * When `force` is true, existing copies are replaced (used during updates).
18
- */
19
- private syncStepAssets;
20
- private materializeNativeSteps;
21
- private buildStepReadme;
22
- private discoverAgents;
23
- }
24
- //#endregion
25
- export { ClaudePluginAdapter };
@@ -1,3 +0,0 @@
1
- import{cpSync as e,existsSync as t,mkdirSync as n,readFileSync as r,readdirSync as i,rmSync as a,writeFileSync as o}from"node:fs";import{basename as s,join as c}from"node:path";const l=[`spec`,`plan`,`task`,`execute`,`verify`];function u(e){let t=e.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/);if(!t)return{data:{},body:e};let n={};for(let e of t[1].split(/\r?\n/)){let t=e.indexOf(`:`);t>0&&(n[e.slice(0,t).trim()]=e.slice(t+1).trim().replace(/^["']|["']$/g,``))}return{data:n,body:t[2]}}function d(e){return e.split(/[-_]/g).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(` `)}function f(e){let t=l.indexOf(e);return t===-1?1/0:t}var p=class{format=`claude-plugin`;detect(e){return t(c(e,`.claude-plugin`,`plugin.json`))}async parse(e,t){let n=this.readPluginJson(e),r=this.discoverSteps(e);await this.materializeNativeSteps(e,r,t);let i=this.discoverAgents(e),a=r.map(({step:e})=>e);return{name:this.readString(n.name)??s(e),version:this.readString(n.version)??`1.0.0`,description:this.readString(n.description)??``,author:this.readString(n.author),steps:a,agents:i,artifacts_dir:`.spec`,install:[]}}readPluginJson(e){let t=c(e,`.claude-plugin`,`plugin.json`);return JSON.parse(r(t,`utf-8`))}readString(e){return typeof e==`string`?e:void 0}discoverSteps(e){let n=c(e,`skills`);if(!t(n))return[];let r=i(n,{withFileTypes:!0}).filter(e=>e.isDirectory()).map(e=>e.name).map(t=>this.readStep(e,t)).filter(e=>e!==null).sort((e,t)=>{let n=Number(e.metadata.order),r=Number(t.metadata.order),i=Number.isFinite(n),a=Number.isFinite(r);if(i&&a)return n-r;if(i)return-1;if(a)return 1;let o=f(e.step.id),s=f(t.step.id);return o===s?e.step.id.localeCompare(t.step.id):o-s});return r.map((e,t)=>({...e,step:{...e.step,requires:t>0?[r[t-1].step.id]:[]}}))}readStep(e,n){let i=c(e,`skills`,n,`SKILL.md`);if(!t(i))return null;let a=r(i,`utf-8`),{data:o,body:s}=u(a),l=o.name||d(n),f=o.description||`${l} step`;return{step:{id:n,name:l,instruction:`steps/${n}/README.md`,produces:[`${n}.md`],requires:[],agents:[],description:f},metadata:o,content:a,body:s}}syncStepAssets(n,r,i){let o=[`references`,`assets`,`scripts`];for(let s of r)for(let r of o){let o=c(n,`skills`,s.id,r),l=c(n,`steps`,s.id,r);if(t(o)){if(t(l)){if(!i)continue;a(l,{recursive:!0,force:!0})}e(o,l,{recursive:!0})}}}async materializeNativeSteps(e,t,r){for(let i of t){let t=c(e,`steps`,i.step.id);n(t,{recursive:!0});let a=r?.transform?await r.transform({content:i.content,sourceFormat:`claude-plugin`,stepName:i.step.id,metadata:i.metadata}):this.buildStepReadme(i.step.name,i.step.description,i.body);o(c(t,`README.md`),a,`utf-8`)}this.syncStepAssets(e,t.map(({step:e})=>e),r?.forceAssetSync)}buildStepReadme(e,t,n){return[`# ${e}`,``,t,``,`---`,``,n.trim()].join(`
2
- `).trimEnd().concat(`
3
- `)}discoverAgents(e){let n=c(e,`agents`);return t(n)?i(n,{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>`agents/${e.name}`):[]}};export{p as ClaudePluginAdapter};
@@ -1,12 +0,0 @@
1
- import { FlowFormatAdapter, FlowManifest, FlowParseOptions } from "../types.js";
2
-
3
- //#region packages/flows/src/adapters/copilot.d.ts
4
- declare class CopilotAdapter implements FlowFormatAdapter {
5
- readonly format: "copilot";
6
- detect(sourceDir: string): boolean;
7
- parse(sourceDir: string, options?: FlowParseOptions): Promise<FlowManifest>;
8
- private getStepId;
9
- private materializeSteps;
10
- }
11
- //#endregion
12
- export { CopilotAdapter };
@@ -1 +0,0 @@
1
- import{existsSync as e,mkdirSync as t,readFileSync as n,readdirSync as r,writeFileSync as i}from"node:fs";import{basename as a,join as o}from"node:path";var s=class{format=`copilot`;detect(t){return e(o(t,`.github`,`agents`))}async parse(e,t){let n=r(o(e,`.github`,`agents`),{withFileTypes:!0}).filter(e=>e.isFile()&&e.name.endsWith(`.md`)).map(e=>`.github/agents/${e.name}`),i=n.map(e=>this.getStepId(e)),s=n.map((e,t)=>{let n=i[t];return{id:n,name:n.charAt(0).toUpperCase()+n.slice(1),instruction:`steps/${n}/README.md`,produces:[`${n}.md`],requires:t>0?[i[t-1]]:[],agents:[e],description:`${n} agent step`}});return await this.materializeSteps(e,s,t),{name:a(e),version:`1.0.0`,description:`Copilot agents flow from ${a(e)}`,steps:s,agents:n,artifacts_dir:`.spec`,install:[]}}getStepId(e){return a(e,`.md`).toLowerCase().replace(/\.agent$/,``)}async materializeSteps(e,r,a){for(let s of r){let r=s.agents[0];if(!r)continue;let c=n(o(e,r),`utf-8`),l=o(e,`steps`,s.id),u=o(l,`README.md`);t(l,{recursive:!0}),i(u,a?.transform?await a.transform({content:c,sourceFormat:`copilot`,stepName:s.id,metadata:{sourcePath:r,displayName:s.name}}):`# ${s.name}\n\n${c}`,`utf-8`)}}};export{s as CopilotAdapter};
@@ -1,12 +0,0 @@
1
- import { FlowFormat, FlowFormatAdapter } from "../types.js";
2
- import { ClaudePluginAdapter } from "./claude-plugin.js";
3
- import { CopilotAdapter } from "./copilot.js";
4
- import { NativeAdapter } from "./native.js";
5
- import { OpenSpecAdapter } from "./openspec.js";
6
-
7
- //#region packages/flows/src/adapters/index.d.ts
8
- declare function detectFormat(sourceDir: string): FlowFormat | null;
9
- declare function getAdapter(format: FlowFormat): FlowFormatAdapter;
10
- declare function getAdapterForSource(sourceDir: string): FlowFormatAdapter | null;
11
- //#endregion
12
- export { ClaudePluginAdapter, CopilotAdapter, NativeAdapter, OpenSpecAdapter, detectFormat, getAdapter, getAdapterForSource };
@@ -1 +0,0 @@
1
- import{ClaudePluginAdapter as e}from"./claude-plugin.js";import{CopilotAdapter as t}from"./copilot.js";import{NativeAdapter as n}from"./native.js";import{OpenSpecAdapter as r}from"./openspec.js";const i=[new n,new e,new t,new r];function a(e){for(let t of i)if(t.detect(e))return t.format;return null}function o(e){let t=i.find(t=>t.format===e);if(!t)throw Error(`No adapter for format: ${e}`);return t}function s(e){for(let t of i)if(t.detect(e))return t;return null}export{e as ClaudePluginAdapter,t as CopilotAdapter,n as NativeAdapter,r as OpenSpecAdapter,a as detectFormat,o as getAdapter,s as getAdapterForSource};