bikky 0.3.13 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (362) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/CODE_OF_CONDUCT.md +80 -0
  3. package/CONTRIBUTING.md +206 -0
  4. package/README.md +94 -20
  5. package/SECURITY.md +58 -0
  6. package/SUPPORT.md +22 -0
  7. package/dist/config.d.ts +68 -1
  8. package/dist/config.js +197 -4
  9. package/dist/daemon/extraction.d.ts +12 -2
  10. package/dist/daemon/extraction.js +85 -133
  11. package/dist/daemon/loop.js +15 -1
  12. package/dist/daemon/qdrant.js +0 -1
  13. package/dist/daemon/transcript-sources.d.ts +26 -0
  14. package/dist/daemon/transcript-sources.js +193 -0
  15. package/dist/daemon/watcher.d.ts +3 -2
  16. package/dist/daemon/watcher.js +51 -2
  17. package/dist/install.d.ts +9 -1
  18. package/dist/install.js +62 -34
  19. package/dist/lib/qdrant-pool.d.ts +57 -0
  20. package/dist/lib/qdrant-pool.js +104 -0
  21. package/dist/mcp/api.d.ts +57 -19
  22. package/dist/mcp/api.js +134 -72
  23. package/dist/mcp/helpers.d.ts +0 -1
  24. package/dist/mcp/helpers.js +2 -15
  25. package/dist/mcp/index.js +29 -14
  26. package/dist/mcp/tools.d.ts +0 -7
  27. package/dist/mcp/tools.js +618 -276
  28. package/dist/mcp/types.d.ts +0 -3
  29. package/dist/routing.d.ts +53 -0
  30. package/dist/routing.js +129 -0
  31. package/dist/search-scope.d.ts +24 -0
  32. package/dist/search-scope.js +174 -0
  33. package/docs/config/fully-hosted.md +57 -0
  34. package/docs/config/hosted-models.md +50 -0
  35. package/docs/config/hosted-qdrant-local-models.md +39 -0
  36. package/docs/config/local.md +34 -0
  37. package/docs/configuration.md +403 -0
  38. package/docs/privacy-first.md +140 -0
  39. package/docs/screenshots/dashboard.png +0 -0
  40. package/docs/screenshots/graph.png +0 -0
  41. package/docs/screenshots/memory.png +0 -0
  42. package/package.json +28 -7
  43. package/dist/cli.d.ts.map +0 -1
  44. package/dist/cli.js.map +0 -1
  45. package/dist/config.d.ts.map +0 -1
  46. package/dist/config.js.map +0 -1
  47. package/dist/config.test.d.ts +0 -9
  48. package/dist/config.test.d.ts.map +0 -1
  49. package/dist/config.test.js +0 -576
  50. package/dist/config.test.js.map +0 -1
  51. package/dist/daemon/capture-policy.d.ts.map +0 -1
  52. package/dist/daemon/capture-policy.js.map +0 -1
  53. package/dist/daemon/capture-policy.test.d.ts +0 -2
  54. package/dist/daemon/capture-policy.test.d.ts.map +0 -1
  55. package/dist/daemon/capture-policy.test.js +0 -48
  56. package/dist/daemon/capture-policy.test.js.map +0 -1
  57. package/dist/daemon/consolidation.d.ts.map +0 -1
  58. package/dist/daemon/consolidation.js.map +0 -1
  59. package/dist/daemon/entity-typing.d.ts.map +0 -1
  60. package/dist/daemon/entity-typing.js.map +0 -1
  61. package/dist/daemon/entity-typing.test.d.ts +0 -2
  62. package/dist/daemon/entity-typing.test.d.ts.map +0 -1
  63. package/dist/daemon/entity-typing.test.js +0 -50
  64. package/dist/daemon/entity-typing.test.js.map +0 -1
  65. package/dist/daemon/episode-summary.d.ts.map +0 -1
  66. package/dist/daemon/episode-summary.js.map +0 -1
  67. package/dist/daemon/episode-summary.test.d.ts +0 -2
  68. package/dist/daemon/episode-summary.test.d.ts.map +0 -1
  69. package/dist/daemon/episode-summary.test.js +0 -104
  70. package/dist/daemon/episode-summary.test.js.map +0 -1
  71. package/dist/daemon/extraction-quality.test.d.ts +0 -2
  72. package/dist/daemon/extraction-quality.test.d.ts.map +0 -1
  73. package/dist/daemon/extraction-quality.test.js +0 -283
  74. package/dist/daemon/extraction-quality.test.js.map +0 -1
  75. package/dist/daemon/extraction-rules.d.ts.map +0 -1
  76. package/dist/daemon/extraction-rules.js.map +0 -1
  77. package/dist/daemon/extraction-rules.test.d.ts +0 -2
  78. package/dist/daemon/extraction-rules.test.d.ts.map +0 -1
  79. package/dist/daemon/extraction-rules.test.js +0 -203
  80. package/dist/daemon/extraction-rules.test.js.map +0 -1
  81. package/dist/daemon/extraction.d.ts.map +0 -1
  82. package/dist/daemon/extraction.js.map +0 -1
  83. package/dist/daemon/extraction.test.d.ts +0 -2
  84. package/dist/daemon/extraction.test.d.ts.map +0 -1
  85. package/dist/daemon/extraction.test.js +0 -225
  86. package/dist/daemon/extraction.test.js.map +0 -1
  87. package/dist/daemon/index.d.ts.map +0 -1
  88. package/dist/daemon/index.js.map +0 -1
  89. package/dist/daemon/loop.d.ts.map +0 -1
  90. package/dist/daemon/loop.js.map +0 -1
  91. package/dist/daemon/loop.test.d.ts +0 -2
  92. package/dist/daemon/loop.test.d.ts.map +0 -1
  93. package/dist/daemon/loop.test.js +0 -85
  94. package/dist/daemon/loop.test.js.map +0 -1
  95. package/dist/daemon/maintenance-state.d.ts.map +0 -1
  96. package/dist/daemon/maintenance-state.js.map +0 -1
  97. package/dist/daemon/maintenance-state.test.d.ts +0 -2
  98. package/dist/daemon/maintenance-state.test.d.ts.map +0 -1
  99. package/dist/daemon/maintenance-state.test.js +0 -56
  100. package/dist/daemon/maintenance-state.test.js.map +0 -1
  101. package/dist/daemon/qdrant.d.ts.map +0 -1
  102. package/dist/daemon/qdrant.js.map +0 -1
  103. package/dist/daemon/qdrant.test.d.ts +0 -8
  104. package/dist/daemon/qdrant.test.d.ts.map +0 -1
  105. package/dist/daemon/qdrant.test.js +0 -265
  106. package/dist/daemon/qdrant.test.js.map +0 -1
  107. package/dist/daemon/relations-vocab.d.ts.map +0 -1
  108. package/dist/daemon/relations-vocab.js.map +0 -1
  109. package/dist/daemon/relations-vocab.test.d.ts +0 -2
  110. package/dist/daemon/relations-vocab.test.d.ts.map +0 -1
  111. package/dist/daemon/relations-vocab.test.js +0 -69
  112. package/dist/daemon/relations-vocab.test.js.map +0 -1
  113. package/dist/daemon/relations.d.ts.map +0 -1
  114. package/dist/daemon/relations.js.map +0 -1
  115. package/dist/daemon/relations.test.d.ts +0 -2
  116. package/dist/daemon/relations.test.d.ts.map +0 -1
  117. package/dist/daemon/relations.test.js +0 -36
  118. package/dist/daemon/relations.test.js.map +0 -1
  119. package/dist/daemon/session-index.d.ts.map +0 -1
  120. package/dist/daemon/session-index.js.map +0 -1
  121. package/dist/daemon/session-index.test.d.ts +0 -2
  122. package/dist/daemon/session-index.test.d.ts.map +0 -1
  123. package/dist/daemon/session-index.test.js +0 -60
  124. package/dist/daemon/session-index.test.js.map +0 -1
  125. package/dist/daemon/session-summary.d.ts.map +0 -1
  126. package/dist/daemon/session-summary.js.map +0 -1
  127. package/dist/daemon/session-summary.test.d.ts +0 -2
  128. package/dist/daemon/session-summary.test.d.ts.map +0 -1
  129. package/dist/daemon/session-summary.test.js +0 -162
  130. package/dist/daemon/session-summary.test.js.map +0 -1
  131. package/dist/daemon/staleness.d.ts.map +0 -1
  132. package/dist/daemon/staleness.js.map +0 -1
  133. package/dist/daemon/staleness.test.d.ts +0 -7
  134. package/dist/daemon/staleness.test.d.ts.map +0 -1
  135. package/dist/daemon/staleness.test.js +0 -128
  136. package/dist/daemon/staleness.test.js.map +0 -1
  137. package/dist/daemon/watcher-health.d.ts.map +0 -1
  138. package/dist/daemon/watcher-health.js.map +0 -1
  139. package/dist/daemon/watcher-health.test.d.ts +0 -5
  140. package/dist/daemon/watcher-health.test.d.ts.map +0 -1
  141. package/dist/daemon/watcher-health.test.js +0 -119
  142. package/dist/daemon/watcher-health.test.js.map +0 -1
  143. package/dist/daemon/watcher.d.ts.map +0 -1
  144. package/dist/daemon/watcher.js.map +0 -1
  145. package/dist/daemon/watcher.test.d.ts +0 -9
  146. package/dist/daemon/watcher.test.d.ts.map +0 -1
  147. package/dist/daemon/watcher.test.js +0 -204
  148. package/dist/daemon/watcher.test.js.map +0 -1
  149. package/dist/daemon/workstream-resolver.d.ts.map +0 -1
  150. package/dist/daemon/workstream-resolver.js.map +0 -1
  151. package/dist/daemon/workstream-resolver.test.d.ts +0 -2
  152. package/dist/daemon/workstream-resolver.test.d.ts.map +0 -1
  153. package/dist/daemon/workstream-resolver.test.js +0 -128
  154. package/dist/daemon/workstream-resolver.test.js.map +0 -1
  155. package/dist/daemon/workstream-summary.d.ts.map +0 -1
  156. package/dist/daemon/workstream-summary.js.map +0 -1
  157. package/dist/daemon/workstream-summary.test.d.ts +0 -2
  158. package/dist/daemon/workstream-summary.test.d.ts.map +0 -1
  159. package/dist/daemon/workstream-summary.test.js +0 -89
  160. package/dist/daemon/workstream-summary.test.js.map +0 -1
  161. package/dist/install.d.ts.map +0 -1
  162. package/dist/install.js.map +0 -1
  163. package/dist/install.test.d.ts +0 -9
  164. package/dist/install.test.d.ts.map +0 -1
  165. package/dist/install.test.js +0 -126
  166. package/dist/install.test.js.map +0 -1
  167. package/dist/lib/qdrant-client.d.ts.map +0 -1
  168. package/dist/lib/qdrant-client.js.map +0 -1
  169. package/dist/lib/qdrant-client.test.d.ts +0 -8
  170. package/dist/lib/qdrant-client.test.d.ts.map +0 -1
  171. package/dist/lib/qdrant-client.test.js +0 -274
  172. package/dist/lib/qdrant-client.test.js.map +0 -1
  173. package/dist/lifecycle.d.ts.map +0 -1
  174. package/dist/lifecycle.js.map +0 -1
  175. package/dist/lifecycle.test.d.ts +0 -8
  176. package/dist/lifecycle.test.d.ts.map +0 -1
  177. package/dist/lifecycle.test.js +0 -74
  178. package/dist/lifecycle.test.js.map +0 -1
  179. package/dist/llm/embedding/index.d.ts.map +0 -1
  180. package/dist/llm/embedding/index.js.map +0 -1
  181. package/dist/llm/embedding/index.test.d.ts +0 -8
  182. package/dist/llm/embedding/index.test.d.ts.map +0 -1
  183. package/dist/llm/embedding/index.test.js +0 -100
  184. package/dist/llm/embedding/index.test.js.map +0 -1
  185. package/dist/llm/embedding/providers/bedrock.d.ts.map +0 -1
  186. package/dist/llm/embedding/providers/bedrock.js.map +0 -1
  187. package/dist/llm/embedding/providers/bedrock.test.d.ts +0 -2
  188. package/dist/llm/embedding/providers/bedrock.test.d.ts.map +0 -1
  189. package/dist/llm/embedding/providers/bedrock.test.js +0 -24
  190. package/dist/llm/embedding/providers/bedrock.test.js.map +0 -1
  191. package/dist/llm/embedding/providers/index.d.ts.map +0 -1
  192. package/dist/llm/embedding/providers/index.js.map +0 -1
  193. package/dist/llm/embedding/providers/ollama.d.ts.map +0 -1
  194. package/dist/llm/embedding/providers/ollama.js.map +0 -1
  195. package/dist/llm/embedding/providers/ollama.test.d.ts +0 -2
  196. package/dist/llm/embedding/providers/ollama.test.d.ts.map +0 -1
  197. package/dist/llm/embedding/providers/ollama.test.js +0 -54
  198. package/dist/llm/embedding/providers/ollama.test.js.map +0 -1
  199. package/dist/llm/embedding/providers/openai.d.ts.map +0 -1
  200. package/dist/llm/embedding/providers/openai.js.map +0 -1
  201. package/dist/llm/embedding/providers/openai.test.d.ts +0 -2
  202. package/dist/llm/embedding/providers/openai.test.d.ts.map +0 -1
  203. package/dist/llm/embedding/providers/openai.test.js +0 -48
  204. package/dist/llm/embedding/providers/openai.test.js.map +0 -1
  205. package/dist/llm/embedding/providers/portkey.d.ts.map +0 -1
  206. package/dist/llm/embedding/providers/portkey.js.map +0 -1
  207. package/dist/llm/embedding/providers/portkey.test.d.ts +0 -2
  208. package/dist/llm/embedding/providers/portkey.test.d.ts.map +0 -1
  209. package/dist/llm/embedding/providers/portkey.test.js +0 -56
  210. package/dist/llm/embedding/providers/portkey.test.js.map +0 -1
  211. package/dist/llm/embedding/registry.d.ts.map +0 -1
  212. package/dist/llm/embedding/registry.js.map +0 -1
  213. package/dist/llm/embedding/registry.test.d.ts +0 -7
  214. package/dist/llm/embedding/registry.test.d.ts.map +0 -1
  215. package/dist/llm/embedding/registry.test.js +0 -68
  216. package/dist/llm/embedding/registry.test.js.map +0 -1
  217. package/dist/llm/embedding/types.d.ts.map +0 -1
  218. package/dist/llm/embedding/types.js.map +0 -1
  219. package/dist/llm/errors.d.ts.map +0 -1
  220. package/dist/llm/errors.js.map +0 -1
  221. package/dist/llm/errors.test.d.ts +0 -2
  222. package/dist/llm/errors.test.d.ts.map +0 -1
  223. package/dist/llm/errors.test.js +0 -103
  224. package/dist/llm/errors.test.js.map +0 -1
  225. package/dist/llm/fetch.d.ts.map +0 -1
  226. package/dist/llm/fetch.js.map +0 -1
  227. package/dist/llm/index.d.ts.map +0 -1
  228. package/dist/llm/index.js.map +0 -1
  229. package/dist/llm/inference/index.d.ts.map +0 -1
  230. package/dist/llm/inference/index.js.map +0 -1
  231. package/dist/llm/inference/index.test.d.ts +0 -6
  232. package/dist/llm/inference/index.test.d.ts.map +0 -1
  233. package/dist/llm/inference/index.test.js +0 -150
  234. package/dist/llm/inference/index.test.js.map +0 -1
  235. package/dist/llm/inference/providers/bedrock.d.ts.map +0 -1
  236. package/dist/llm/inference/providers/bedrock.js.map +0 -1
  237. package/dist/llm/inference/providers/bedrock.test.d.ts +0 -2
  238. package/dist/llm/inference/providers/bedrock.test.d.ts.map +0 -1
  239. package/dist/llm/inference/providers/bedrock.test.js +0 -68
  240. package/dist/llm/inference/providers/bedrock.test.js.map +0 -1
  241. package/dist/llm/inference/providers/index.d.ts.map +0 -1
  242. package/dist/llm/inference/providers/index.js.map +0 -1
  243. package/dist/llm/inference/providers/ollama.d.ts.map +0 -1
  244. package/dist/llm/inference/providers/ollama.js.map +0 -1
  245. package/dist/llm/inference/providers/ollama.test.d.ts +0 -2
  246. package/dist/llm/inference/providers/ollama.test.d.ts.map +0 -1
  247. package/dist/llm/inference/providers/ollama.test.js +0 -57
  248. package/dist/llm/inference/providers/ollama.test.js.map +0 -1
  249. package/dist/llm/inference/providers/openai.d.ts.map +0 -1
  250. package/dist/llm/inference/providers/openai.js.map +0 -1
  251. package/dist/llm/inference/providers/openai.test.d.ts +0 -2
  252. package/dist/llm/inference/providers/openai.test.d.ts.map +0 -1
  253. package/dist/llm/inference/providers/openai.test.js +0 -82
  254. package/dist/llm/inference/providers/openai.test.js.map +0 -1
  255. package/dist/llm/inference/providers/portkey.d.ts.map +0 -1
  256. package/dist/llm/inference/providers/portkey.js.map +0 -1
  257. package/dist/llm/inference/providers/portkey.test.d.ts +0 -2
  258. package/dist/llm/inference/providers/portkey.test.d.ts.map +0 -1
  259. package/dist/llm/inference/providers/portkey.test.js +0 -48
  260. package/dist/llm/inference/providers/portkey.test.js.map +0 -1
  261. package/dist/llm/inference/registry.d.ts.map +0 -1
  262. package/dist/llm/inference/registry.js.map +0 -1
  263. package/dist/llm/inference/registry.test.d.ts +0 -6
  264. package/dist/llm/inference/registry.test.d.ts.map +0 -1
  265. package/dist/llm/inference/registry.test.js +0 -63
  266. package/dist/llm/inference/registry.test.js.map +0 -1
  267. package/dist/llm/inference/types.d.ts.map +0 -1
  268. package/dist/llm/inference/types.js.map +0 -1
  269. package/dist/llm/telemetry.d.ts.map +0 -1
  270. package/dist/llm/telemetry.js.map +0 -1
  271. package/dist/llm/telemetry.test.d.ts +0 -5
  272. package/dist/llm/telemetry.test.d.ts.map +0 -1
  273. package/dist/llm/telemetry.test.js +0 -89
  274. package/dist/llm/telemetry.test.js.map +0 -1
  275. package/dist/llm/types.d.ts.map +0 -1
  276. package/dist/llm/types.js.map +0 -1
  277. package/dist/logger.d.ts.map +0 -1
  278. package/dist/logger.js.map +0 -1
  279. package/dist/logger.test.d.ts +0 -5
  280. package/dist/logger.test.d.ts.map +0 -1
  281. package/dist/logger.test.js +0 -103
  282. package/dist/logger.test.js.map +0 -1
  283. package/dist/mcp/api.d.ts.map +0 -1
  284. package/dist/mcp/api.js.map +0 -1
  285. package/dist/mcp/api.test.d.ts +0 -6
  286. package/dist/mcp/api.test.d.ts.map +0 -1
  287. package/dist/mcp/api.test.js +0 -130
  288. package/dist/mcp/api.test.js.map +0 -1
  289. package/dist/mcp/helpers.d.ts.map +0 -1
  290. package/dist/mcp/helpers.js.map +0 -1
  291. package/dist/mcp/helpers.test.d.ts +0 -5
  292. package/dist/mcp/helpers.test.d.ts.map +0 -1
  293. package/dist/mcp/helpers.test.js +0 -548
  294. package/dist/mcp/helpers.test.js.map +0 -1
  295. package/dist/mcp/index.d.ts.map +0 -1
  296. package/dist/mcp/index.js.map +0 -1
  297. package/dist/mcp/taxonomy.d.ts.map +0 -1
  298. package/dist/mcp/taxonomy.js.map +0 -1
  299. package/dist/mcp/taxonomy.test.d.ts +0 -5
  300. package/dist/mcp/taxonomy.test.d.ts.map +0 -1
  301. package/dist/mcp/taxonomy.test.js +0 -215
  302. package/dist/mcp/taxonomy.test.js.map +0 -1
  303. package/dist/mcp/tools.d.ts.map +0 -1
  304. package/dist/mcp/tools.integration.itest.d.ts +0 -23
  305. package/dist/mcp/tools.integration.itest.d.ts.map +0 -1
  306. package/dist/mcp/tools.integration.itest.js +0 -171
  307. package/dist/mcp/tools.integration.itest.js.map +0 -1
  308. package/dist/mcp/tools.js.map +0 -1
  309. package/dist/mcp/tools.test.d.ts +0 -16
  310. package/dist/mcp/tools.test.d.ts.map +0 -1
  311. package/dist/mcp/tools.test.js +0 -908
  312. package/dist/mcp/tools.test.js.map +0 -1
  313. package/dist/mcp/types.d.ts.map +0 -1
  314. package/dist/mcp/types.js.map +0 -1
  315. package/dist/postinstall.d.ts.map +0 -1
  316. package/dist/postinstall.js.map +0 -1
  317. package/dist/privacy/redaction.d.ts.map +0 -1
  318. package/dist/privacy/redaction.js.map +0 -1
  319. package/dist/privacy/redaction.test.d.ts +0 -2
  320. package/dist/privacy/redaction.test.d.ts.map +0 -1
  321. package/dist/privacy/redaction.test.js +0 -51
  322. package/dist/privacy/redaction.test.js.map +0 -1
  323. package/dist/prompts/brief.d.ts.map +0 -1
  324. package/dist/prompts/brief.js.map +0 -1
  325. package/dist/prompts/contradiction.d.ts.map +0 -1
  326. package/dist/prompts/contradiction.js.map +0 -1
  327. package/dist/prompts/distill.d.ts.map +0 -1
  328. package/dist/prompts/distill.js.map +0 -1
  329. package/dist/prompts/entity-typing.d.ts.map +0 -1
  330. package/dist/prompts/entity-typing.js.map +0 -1
  331. package/dist/prompts/episode-summary.d.ts.map +0 -1
  332. package/dist/prompts/episode-summary.js.map +0 -1
  333. package/dist/prompts/extraction.d.ts.map +0 -1
  334. package/dist/prompts/extraction.js.map +0 -1
  335. package/dist/prompts/index.d.ts.map +0 -1
  336. package/dist/prompts/index.js.map +0 -1
  337. package/dist/prompts/prompts.test.d.ts +0 -8
  338. package/dist/prompts/prompts.test.d.ts.map +0 -1
  339. package/dist/prompts/prompts.test.js +0 -140
  340. package/dist/prompts/prompts.test.js.map +0 -1
  341. package/dist/prompts/relations.d.ts.map +0 -1
  342. package/dist/prompts/relations.js.map +0 -1
  343. package/dist/prompts/workstream-summary.d.ts.map +0 -1
  344. package/dist/prompts/workstream-summary.js.map +0 -1
  345. package/dist/provenance/actor.d.ts.map +0 -1
  346. package/dist/provenance/actor.js.map +0 -1
  347. package/dist/provenance/actor.test.d.ts +0 -2
  348. package/dist/provenance/actor.test.d.ts.map +0 -1
  349. package/dist/provenance/actor.test.js +0 -49
  350. package/dist/provenance/actor.test.js.map +0 -1
  351. package/dist/render.d.ts.map +0 -1
  352. package/dist/render.js.map +0 -1
  353. package/dist/render.test.d.ts +0 -8
  354. package/dist/render.test.d.ts.map +0 -1
  355. package/dist/render.test.js +0 -244
  356. package/dist/render.test.js.map +0 -1
  357. package/dist/status.d.ts.map +0 -1
  358. package/dist/status.js.map +0 -1
  359. package/dist/status.test.d.ts +0 -5
  360. package/dist/status.test.d.ts.map +0 -1
  361. package/dist/status.test.js +0 -203
  362. package/dist/status.test.js.map +0 -1
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Copilot session watcher detects active sessions by scanning
3
- * ~/.copilot/session-state/ for directories with events.jsonl files.
2
+ * Session watcher helpers for supported coding-agent transcript directories.
4
3
  */
5
4
  import fs from "node:fs";
6
5
  import path from "node:path";
@@ -31,8 +30,58 @@ export function discoverSessions() {
31
30
  uuid: entry,
32
31
  eventsPath,
33
32
  active: lockFiles.length > 0,
33
+ source: "copilot",
34
34
  });
35
35
  }
36
36
  return sessions;
37
37
  }
38
+ export function discoverClaudeSessions() {
39
+ const cfg = loadConfig();
40
+ if (!cfg.watchers.claude.enabled)
41
+ return [];
42
+ const baseDir = cfg.watchers.claude.path;
43
+ if (!fs.existsSync(baseDir))
44
+ return [];
45
+ const sessions = [];
46
+ for (const entry of fs.readdirSync(baseDir)) {
47
+ const projectPath = path.join(baseDir, entry);
48
+ let stat;
49
+ try {
50
+ stat = fs.statSync(projectPath);
51
+ }
52
+ catch {
53
+ continue;
54
+ }
55
+ if (stat.isFile() && entry.endsWith(".jsonl")) {
56
+ sessions.push({
57
+ uuid: path.basename(entry, ".jsonl"),
58
+ eventsPath: projectPath,
59
+ active: true,
60
+ source: "claude",
61
+ });
62
+ continue;
63
+ }
64
+ if (!stat.isDirectory())
65
+ continue;
66
+ for (const file of fs.readdirSync(projectPath)) {
67
+ const transcriptPath = path.join(projectPath, file);
68
+ let transcriptStat;
69
+ try {
70
+ transcriptStat = fs.statSync(transcriptPath);
71
+ }
72
+ catch {
73
+ continue;
74
+ }
75
+ if (!transcriptStat.isFile() || !file.endsWith(".jsonl"))
76
+ continue;
77
+ sessions.push({
78
+ uuid: path.basename(file, ".jsonl"),
79
+ eventsPath: transcriptPath,
80
+ active: true,
81
+ source: "claude",
82
+ });
83
+ }
84
+ }
85
+ return sessions;
86
+ }
38
87
  //# sourceMappingURL=watcher.js.map
package/dist/install.d.ts CHANGED
@@ -1,5 +1,13 @@
1
1
  /**
2
2
  * Write MCP config entries for Copilot and/or Claude Code.
3
3
  */
4
- export declare function writeInstallConfig(): Promise<void>;
4
+ export interface InstallOptions {
5
+ homeDir?: string;
6
+ /**
7
+ * Defaults to `claude`. Set to null to skip the Claude Code CLI and write the
8
+ * user config file directly.
9
+ */
10
+ claudeCommand?: string | null;
11
+ }
12
+ export declare function writeInstallConfig(options?: InstallOptions): Promise<void>;
5
13
  //# sourceMappingURL=install.d.ts.map
package/dist/install.js CHANGED
@@ -4,46 +4,74 @@
4
4
  import fs from "node:fs";
5
5
  import path from "node:path";
6
6
  import os from "node:os";
7
- export async function writeInstallConfig() {
7
+ import { spawnSync } from "node:child_process";
8
+ const SERVER_NAME = "bikky";
9
+ function readJsonConfig(filePath) {
10
+ if (!fs.existsSync(filePath))
11
+ return {};
12
+ try {
13
+ return JSON.parse(fs.readFileSync(filePath, "utf-8"));
14
+ }
15
+ catch {
16
+ return {};
17
+ }
18
+ }
19
+ function writeJsonConfig(filePath, config) {
20
+ fs.mkdirSync(path.dirname(filePath), { recursive: true });
21
+ fs.writeFileSync(filePath, JSON.stringify(config, null, 2) + "\n");
22
+ }
23
+ function writeCopilotConfig(homeDir, entry) {
24
+ const copilotConfigPath = path.join(homeDir, ".copilot", "mcp-config.json");
25
+ const config = readJsonConfig(copilotConfigPath);
26
+ config.mcpServers ??= {};
27
+ config.mcpServers[SERVER_NAME] = entry;
28
+ writeJsonConfig(copilotConfigPath, config);
29
+ console.log(`✅ Written to ${copilotConfigPath}`);
30
+ }
31
+ function registerClaudeWithCli(homeDir, entry, command) {
32
+ const result = spawnSync(command, ["mcp", "add-json", "-s", "user", SERVER_NAME, JSON.stringify(entry)], {
33
+ env: { ...process.env, HOME: homeDir },
34
+ encoding: "utf-8",
35
+ stdio: "pipe",
36
+ });
37
+ if (result.status === 0) {
38
+ console.log(`✅ Registered ${SERVER_NAME} with Claude Code user config`);
39
+ return true;
40
+ }
41
+ if (result.error && "code" in result.error && result.error.code === "ENOENT") {
42
+ return false;
43
+ }
44
+ const stderr = typeof result.stderr === "string" ? result.stderr.trim() : "";
45
+ if (/already exists/i.test(stderr)) {
46
+ return false;
47
+ }
48
+ const detail = stderr ? `: ${stderr}` : "";
49
+ console.warn(`⚠️ Claude Code CLI registration failed${detail}`);
50
+ return false;
51
+ }
52
+ function writeClaudeCodeUserConfig(homeDir, entry) {
53
+ const claudeConfigPath = path.join(homeDir, ".claude.json");
54
+ const config = readJsonConfig(claudeConfigPath);
55
+ config.mcpServers ??= {};
56
+ config.mcpServers[SERVER_NAME] = entry;
57
+ writeJsonConfig(claudeConfigPath, config);
58
+ console.log(`✅ Written to ${claudeConfigPath}`);
59
+ }
60
+ export async function writeInstallConfig(options = {}) {
61
+ const homeDir = options.homeDir ?? os.homedir();
8
62
  const entry = {
9
63
  type: "stdio",
10
64
  command: "npx",
11
65
  args: ["-y", "bikky", "mcp"],
12
66
  };
13
- // Copilot MCP config
14
- const copilotConfigPath = path.join(os.homedir(), ".copilot", "mcp-config.json");
15
- let config = {};
16
- if (fs.existsSync(copilotConfigPath)) {
17
- try {
18
- config = JSON.parse(fs.readFileSync(copilotConfigPath, "utf-8"));
19
- }
20
- catch {
21
- config = {};
22
- }
67
+ writeCopilotConfig(homeDir, entry);
68
+ const claudeCommand = options.claudeCommand === undefined ? "claude" : options.claudeCommand;
69
+ const registeredWithClaudeCli = claudeCommand
70
+ ? registerClaudeWithCli(homeDir, entry, claudeCommand)
71
+ : false;
72
+ if (!registeredWithClaudeCli) {
73
+ writeClaudeCodeUserConfig(homeDir, entry);
23
74
  }
24
- if (!config.mcpServers)
25
- config.mcpServers = {};
26
- config.mcpServers["bikky"] = entry;
27
- fs.mkdirSync(path.dirname(copilotConfigPath), { recursive: true });
28
- fs.writeFileSync(copilotConfigPath, JSON.stringify(config, null, 2) + "\n");
29
- console.log(`✅ Written to ${copilotConfigPath}`);
30
- // Claude Code MCP config
31
- const claudeConfigPath = path.join(os.homedir(), ".claude", "mcp.json");
32
- let claudeConfig = {};
33
- if (fs.existsSync(claudeConfigPath)) {
34
- try {
35
- claudeConfig = JSON.parse(fs.readFileSync(claudeConfigPath, "utf-8"));
36
- }
37
- catch {
38
- claudeConfig = {};
39
- }
40
- }
41
- if (!claudeConfig.mcpServers)
42
- claudeConfig.mcpServers = {};
43
- claudeConfig.mcpServers["bikky"] = entry;
44
- fs.mkdirSync(path.dirname(claudeConfigPath), { recursive: true });
45
- fs.writeFileSync(claudeConfigPath, JSON.stringify(claudeConfig, null, 2) + "\n");
46
- console.log(`✅ Written to ${claudeConfigPath}`);
47
75
  console.log("\n🧠 bikky is now registered. Restart your editor to activate.");
48
76
  }
49
77
  //# sourceMappingURL=install.js.map
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Per-destination Qdrant client cache.
3
+ *
4
+ * Multi-destination bikky may talk to several Qdrant Cloud accounts (or
5
+ * collections) in parallel. We keep one `QdrantClient` per destination keyed
6
+ * by `destination.name`, lazily constructed on first use.
7
+ *
8
+ * The cache also tracks per-destination `collectionReady` so the daemon can
9
+ * keep retrying `ensureCollection` for destinations whose collection failed
10
+ * to materialize at startup, without blocking other destinations.
11
+ */
12
+ import type { Destination, QdrantClientConfig } from "../config.js";
13
+ import { QdrantClient, type QdrantLogFn } from "./qdrant-client.js";
14
+ export interface PoolOptions {
15
+ client: QdrantClientConfig;
16
+ log?: QdrantLogFn;
17
+ }
18
+ export declare class QdrantPool {
19
+ private readonly entries;
20
+ private readonly options;
21
+ constructor(destinations: ReadonlyArray<Destination>, options: PoolOptions);
22
+ /** Returns the names of all destinations in the pool, in registration order. */
23
+ names(): string[];
24
+ /** All Destination objects currently registered. */
25
+ destinations(): Destination[];
26
+ /** Get the QdrantClient for a destination by name. Throws if unknown. */
27
+ client(name: string): QdrantClient;
28
+ /** Get the collection name for a destination. */
29
+ collection(name: string): string;
30
+ /** Whether the destination's collection has been confirmed ready. */
31
+ isCollectionReady(name: string): boolean;
32
+ /** Last error observed for a destination, or null. */
33
+ lastError(name: string): string | null;
34
+ /**
35
+ * Run `ensureCollection` for a single destination. Updates the pool's
36
+ * readiness flag and last-error state. Re-throws on failure so the caller
37
+ * can decide whether to retry, log, or skip.
38
+ */
39
+ ensureCollection(name: string, vectorSize: number, indexes: Array<{
40
+ field_name: string;
41
+ field_schema: string;
42
+ }>): Promise<void>;
43
+ /**
44
+ * Run a callback against every destination's client, in parallel. Errors
45
+ * from one destination do not prevent others from running. Returns the per-
46
+ * destination result (or error) so callers can act on the outcome.
47
+ */
48
+ fanOut<T>(fn: (destination: Destination, client: QdrantClient) => Promise<T>): Promise<Array<{
49
+ destination: Destination;
50
+ result: T | null;
51
+ error: Error | null;
52
+ }>>;
53
+ /** Replace the entire pool with a new destination set. Existing clients are dropped. */
54
+ rebuild(destinations: ReadonlyArray<Destination>): void;
55
+ private upsertEntry;
56
+ }
57
+ //# sourceMappingURL=qdrant-pool.d.ts.map
@@ -0,0 +1,104 @@
1
+ import { QdrantClient } from "./qdrant-client.js";
2
+ export class QdrantPool {
3
+ entries = new Map();
4
+ options;
5
+ constructor(destinations, options) {
6
+ this.options = options;
7
+ for (const destination of destinations) {
8
+ this.upsertEntry(destination);
9
+ }
10
+ }
11
+ /** Returns the names of all destinations in the pool, in registration order. */
12
+ names() {
13
+ return [...this.entries.keys()];
14
+ }
15
+ /** All Destination objects currently registered. */
16
+ destinations() {
17
+ return [...this.entries.values()].map((e) => e.destination);
18
+ }
19
+ /** Get the QdrantClient for a destination by name. Throws if unknown. */
20
+ client(name) {
21
+ const entry = this.entries.get(name);
22
+ if (!entry) {
23
+ throw new Error(`Destination '${name}' is not in the pool. Known: ${this.names().join(", ") || "(none)"}`);
24
+ }
25
+ return entry.client;
26
+ }
27
+ /** Get the collection name for a destination. */
28
+ collection(name) {
29
+ const entry = this.entries.get(name);
30
+ if (!entry)
31
+ throw new Error(`Destination '${name}' is not in the pool.`);
32
+ return entry.destination.collection;
33
+ }
34
+ /** Whether the destination's collection has been confirmed ready. */
35
+ isCollectionReady(name) {
36
+ return this.entries.get(name)?.collectionReady === true;
37
+ }
38
+ /** Last error observed for a destination, or null. */
39
+ lastError(name) {
40
+ return this.entries.get(name)?.lastError ?? null;
41
+ }
42
+ /**
43
+ * Run `ensureCollection` for a single destination. Updates the pool's
44
+ * readiness flag and last-error state. Re-throws on failure so the caller
45
+ * can decide whether to retry, log, or skip.
46
+ */
47
+ async ensureCollection(name, vectorSize, indexes) {
48
+ const entry = this.entries.get(name);
49
+ if (!entry)
50
+ throw new Error(`Destination '${name}' is not in the pool.`);
51
+ try {
52
+ await entry.client.ensureCollection(vectorSize, indexes);
53
+ entry.collectionReady = true;
54
+ entry.lastError = null;
55
+ }
56
+ catch (e) {
57
+ entry.collectionReady = false;
58
+ entry.lastError = e instanceof Error ? e.message : String(e);
59
+ throw e;
60
+ }
61
+ }
62
+ /**
63
+ * Run a callback against every destination's client, in parallel. Errors
64
+ * from one destination do not prevent others from running. Returns the per-
65
+ * destination result (or error) so callers can act on the outcome.
66
+ */
67
+ async fanOut(fn) {
68
+ const promises = [...this.entries.values()].map(async (entry) => {
69
+ try {
70
+ const result = await fn(entry.destination, entry.client);
71
+ return { destination: entry.destination, result, error: null };
72
+ }
73
+ catch (e) {
74
+ const err = e instanceof Error ? e : new Error(String(e));
75
+ return { destination: entry.destination, result: null, error: err };
76
+ }
77
+ });
78
+ return Promise.all(promises);
79
+ }
80
+ /** Replace the entire pool with a new destination set. Existing clients are dropped. */
81
+ rebuild(destinations) {
82
+ this.entries.clear();
83
+ for (const destination of destinations)
84
+ this.upsertEntry(destination);
85
+ }
86
+ upsertEntry(destination) {
87
+ const client = new QdrantClient({
88
+ url: destination.qdrant_url,
89
+ apiKey: destination.qdrant_api_key,
90
+ collection: destination.collection,
91
+ timeoutMs: this.options.client.timeout_ms,
92
+ retries: this.options.client.retries,
93
+ retryBaseDelayMs: this.options.client.retry_base_delay_ms,
94
+ log: this.options.log,
95
+ });
96
+ this.entries.set(destination.name, {
97
+ destination,
98
+ client,
99
+ collectionReady: false,
100
+ lastError: null,
101
+ });
102
+ }
103
+ }
104
+ //# sourceMappingURL=qdrant-pool.js.map
package/dist/mcp/api.d.ts CHANGED
@@ -1,17 +1,25 @@
1
1
  /**
2
- * External API helpers — Qdrant REST client, LLM chat, logging.
3
- * Credentials come from config (~/.bikky/config.json) or env vars.
2
+ * External API helpers — Qdrant REST client pool, LLM chat, logging.
3
+ *
4
+ * Multi-destination model: write operations resolve to one Destination
5
+ * (see ../routing.ts) and operate against that destination's QdrantClient
6
+ * via the QdrantPool (see ../lib/qdrant-pool.ts). Read/search operations may
7
+ * resolve a search scope and fan out across multiple destinations.
8
+ *
9
+ * The legacy single-Qdrant API is kept around for back-compat where call sites
10
+ * have not yet been refactored — they all route to a "default" destination
11
+ * synthesized from the top-level qdrant_url/qdrant_api_key/collection.
4
12
  */
5
13
  import type { QdrantFilter, QdrantGetResult, QdrantScrollResult, QdrantSearchResult } from "./types.js";
6
14
  import { embed, getEmbeddingDimensions, getEmbeddingConfig, initEmbedding } from "../llm/index.js";
7
15
  import type { ChatCompletionOpts } from "../llm/index.js";
8
16
  export type { ResolvedEmbeddingConfig } from "../llm/index.js";
9
17
  export { embed, getEmbeddingDimensions, getEmbeddingConfig, initEmbedding };
18
+ import { type Destination } from "../config.js";
19
+ import { QdrantPool } from "../lib/qdrant-pool.js";
20
+ import { type RoutingInput } from "../routing.js";
10
21
  export declare const MEMORY_DIR: string;
11
- export declare function getCollection(): string;
12
- export declare function setCollection(name: string): void;
13
- export declare let qdrantUrl: string | null;
14
- export declare let qdrantApiKey: string | null;
22
+ export declare const log: import("../logger.js").LogFn;
15
23
  export declare let ready: boolean;
16
24
  /**
17
25
  * Reason the system is not ready, when known. Set by `setSetupError` from the
@@ -20,25 +28,55 @@ export declare let ready: boolean;
20
28
  * instead of a generic "setup_required".
21
29
  */
22
30
  export declare let setupError: string | null;
23
- export declare function setQdrantUrl(v: string | null): void;
24
- export declare function setQdrantApiKey(v: string | null): void;
25
31
  export declare function setReady(v: boolean): void;
26
32
  export declare function setSetupError(v: string | null): void;
27
- export declare const log: import("../logger.js").LogFn;
28
- export declare function chatComplete(systemPrompt: string, userPrompt: string): Promise<string>;
29
33
  /**
30
- * Run a pre-rendered prompt (from src/prompts/*) through the LLM. The
31
- * RenderedPrompt already carries messages, response_format, temperature, etc.
34
+ * (Re)build the destination pool from the current config. Idempotent — safe
35
+ * to call after configure_credentials updates the on-disk config.
32
36
  */
37
+ export declare function rebuildPool(): void;
38
+ export declare function getPool(): QdrantPool;
39
+ /** Whether at least one destination is configured. */
40
+ export declare function hasPool(): boolean;
41
+ /** All destination names currently in the pool, in registration order. */
42
+ export declare function destinationNames(): string[];
43
+ /** All Destination objects in the pool. */
44
+ export declare function listDestinations(): Destination[];
45
+ /** True if any destination's collection is confirmed ready. */
46
+ export declare function anyCollectionReady(): boolean;
47
+ /** Resolve a destination from caller input. Throws if not configured/found. */
48
+ export declare function resolveDest(input: RoutingInput): Destination;
49
+ /** Build a resolver closure from the current pool's destinations. */
50
+ export declare function makeResolver(): (input: RoutingInput) => Destination;
51
+ export declare function chatComplete(systemPrompt: string, userPrompt: string): Promise<string>;
33
52
  export declare function chatCompleteRendered(opts: ChatCompletionOpts): Promise<string>;
34
- export declare function qdrantReq<T>(method: string, urlPath: string, body?: unknown): Promise<T>;
35
- export declare function ensureCollection(indexes: Array<{
53
+ export declare function qdrantReq<T>(destination: Destination, method: string, urlPath: string, body?: unknown): Promise<T>;
54
+ export declare function ensureCollection(destination: Destination, indexes: Array<{
36
55
  field_name: string;
37
56
  field_schema: string;
38
57
  }>): Promise<void>;
39
- export declare function qdrantUpsert(id: string, vector: number[], payload: Record<string, unknown>): Promise<unknown>;
40
- export declare function qdrantSearch(vector: number[], filter: QdrantFilter | undefined, limit?: number): Promise<QdrantSearchResult>;
41
- export declare function qdrantScroll(filter: QdrantFilter, limit?: number): Promise<QdrantScrollResult>;
42
- export declare function qdrantSetPayload(ids: string[], payload: Record<string, unknown>): Promise<unknown>;
43
- export declare function qdrantGetPoints(ids: string[]): Promise<QdrantGetResult>;
58
+ /** Run ensureCollection for every destination in the pool. Failures don't stop the loop. */
59
+ export declare function ensureCollectionsAll(indexes: Array<{
60
+ field_name: string;
61
+ field_schema: string;
62
+ }>): Promise<Array<{
63
+ destination: Destination;
64
+ ok: boolean;
65
+ error: string | null;
66
+ }>>;
67
+ export declare function qdrantUpsert(destination: Destination, id: string, vector: number[], payload: Record<string, unknown>): Promise<unknown>;
68
+ export declare function qdrantSearch(destination: Destination, vector: number[], filter: QdrantFilter | undefined, limit?: number): Promise<QdrantSearchResult>;
69
+ export declare function qdrantScroll(destination: Destination, filter: QdrantFilter, limit?: number): Promise<QdrantScrollResult>;
70
+ export declare function qdrantSetPayload(destination: Destination, ids: string[], payload: Record<string, unknown>): Promise<unknown>;
71
+ export declare function qdrantGetPoints(destination: Destination, ids: string[]): Promise<QdrantGetResult>;
72
+ /**
73
+ * Look up a point by ID across every destination. Returns the first hit found
74
+ * (and which destination it lives in), or null. Used by `memory_forget`,
75
+ * `memory_verify`, `memory_report_outcome`, and any other ID-based op where
76
+ * the caller doesn't know upfront which destination owns the ID.
77
+ */
78
+ export declare function findPointById(id: string): Promise<{
79
+ destination: Destination;
80
+ point: NonNullable<QdrantGetResult["result"]>[number];
81
+ } | null>;
44
82
  //# sourceMappingURL=api.d.ts.map