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
@@ -67,7 +67,6 @@ export interface FactPayload {
67
67
  kind?: string;
68
68
  layer?: string | null;
69
69
  memory_subtype?: string | null;
70
- workspace_id?: string;
71
70
  actor_id?: string;
72
71
  entities: string[];
73
72
  source?: string;
@@ -141,8 +140,6 @@ export interface FilterParams {
141
140
  domain?: string;
142
141
  kind?: string;
143
142
  memory_subtype?: string;
144
- workspace_id?: string;
145
- includeLegacyWorkspace?: boolean;
146
143
  actor_id?: string;
147
144
  entity?: string;
148
145
  session_id?: string;
@@ -0,0 +1,53 @@
1
+ /**
2
+ * Pure destination routing.
3
+ *
4
+ * Resolves which `Destination` a memory operation should target based on
5
+ * caller-supplied input (entities, content, metadata) and the current cwd.
6
+ *
7
+ * Resolution order:
8
+ * 1. Explicit override — if `input.destination` is set, the destination with
9
+ * that name is returned. Throws if no such destination exists.
10
+ * 2. Match scan — destinations are walked in array order. For each, ANY
11
+ * regex matching ANY field in the destination's `match` block wins
12
+ * (OR semantics). First matching destination wins.
13
+ * 3. Default fallback — destination with `default: true`, else the first
14
+ * destination in the array.
15
+ *
16
+ * Pure: no I/O, no globals. Easy to unit test.
17
+ */
18
+ import type { Destination } from "./config.js";
19
+ export interface RoutingInput {
20
+ /** Explicit destination name override. Throws if it doesn't match a destination. */
21
+ destination?: string | null;
22
+ /** Current working directory. Defaults to `process.cwd()` if omitted by caller. */
23
+ cwd?: string;
24
+ /** Entity names mentioned by the operation. */
25
+ entities?: ReadonlyArray<string>;
26
+ /** Free-text content (e.g. memory_store content, memory_recall query). */
27
+ content?: string | null;
28
+ /** Caller-provided metadata map. */
29
+ metadata?: Record<string, unknown> | null;
30
+ }
31
+ export declare class DestinationNotFoundError extends Error {
32
+ readonly name: string;
33
+ readonly available: string[];
34
+ constructor(name: string, available: string[]);
35
+ }
36
+ export declare class NoDestinationsConfiguredError extends Error {
37
+ constructor();
38
+ }
39
+ /**
40
+ * Resolve a destination from caller input + a (pre-loaded) list of destinations.
41
+ *
42
+ * Throws `NoDestinationsConfiguredError` if `destinations` is empty.
43
+ * Throws `DestinationNotFoundError` if `input.destination` doesn't match a
44
+ * configured destination.
45
+ */
46
+ export declare function resolveDestination(input: RoutingInput, destinations: ReadonlyArray<Destination>): Destination;
47
+ /**
48
+ * Pre-compile a routing table for hot paths (e.g. per-tick in the daemon).
49
+ * Returns a closure that resolves a destination from input without recompiling
50
+ * regexes on every call.
51
+ */
52
+ export declare function buildResolver(destinations: ReadonlyArray<Destination>): (input: RoutingInput) => Destination;
53
+ //# sourceMappingURL=routing.d.ts.map
@@ -0,0 +1,129 @@
1
+ export class DestinationNotFoundError extends Error {
2
+ name;
3
+ available;
4
+ constructor(name, available) {
5
+ super(`Unknown destination '${name}'. Configured destinations: ${available.length > 0 ? available.join(", ") : "(none)"}`);
6
+ this.name = name;
7
+ this.available = available;
8
+ this.name = "DestinationNotFoundError";
9
+ }
10
+ }
11
+ export class NoDestinationsConfiguredError extends Error {
12
+ constructor() {
13
+ super("No destinations configured. Set top-level qdrant_url or destinations[] in ~/.bikky/config.json.");
14
+ this.name = "NoDestinationsConfiguredError";
15
+ }
16
+ }
17
+ function compileArray(patterns) {
18
+ if (!patterns || patterns.length === 0)
19
+ return [];
20
+ return patterns.map((p) => new RegExp(p));
21
+ }
22
+ function compileMatch(match) {
23
+ const m = { cwd: [], entity: [], content: [], metadata: {} };
24
+ if (!match)
25
+ return m;
26
+ m.cwd = compileArray(match.cwd);
27
+ m.entity = compileArray(match.entity);
28
+ m.content = compileArray(match.content);
29
+ if (match.metadata) {
30
+ for (const [k, v] of Object.entries(match.metadata)) {
31
+ m.metadata[k] = compileArray(v);
32
+ }
33
+ }
34
+ return m;
35
+ }
36
+ function compileDestinations(destinations) {
37
+ return destinations.map((destination) => ({
38
+ destination,
39
+ compiled: compileMatch(destination.match),
40
+ }));
41
+ }
42
+ function anyMatches(value, patterns) {
43
+ if (patterns.length === 0)
44
+ return false;
45
+ return patterns.some((re) => re.test(value));
46
+ }
47
+ function destinationMatches(compiled, input) {
48
+ const cwd = input.cwd ?? "";
49
+ if (cwd && anyMatches(cwd, compiled.cwd))
50
+ return true;
51
+ if (input.entities && input.entities.length > 0 && compiled.entity.length > 0) {
52
+ for (const entity of input.entities) {
53
+ if (anyMatches(entity, compiled.entity))
54
+ return true;
55
+ }
56
+ }
57
+ if (input.content && compiled.content.length > 0 && anyMatches(input.content, compiled.content)) {
58
+ return true;
59
+ }
60
+ if (input.metadata && Object.keys(compiled.metadata).length > 0) {
61
+ for (const [key, patterns] of Object.entries(compiled.metadata)) {
62
+ const raw = input.metadata[key];
63
+ if (raw === undefined || raw === null)
64
+ continue;
65
+ const value = typeof raw === "string" ? raw : String(raw);
66
+ if (anyMatches(value, patterns))
67
+ return true;
68
+ }
69
+ }
70
+ return false;
71
+ }
72
+ function pickFallback(destinations) {
73
+ const explicit = destinations.find((d) => d.default === true);
74
+ if (explicit)
75
+ return explicit;
76
+ return destinations[0];
77
+ }
78
+ /**
79
+ * Resolve a destination from caller input + a (pre-loaded) list of destinations.
80
+ *
81
+ * Throws `NoDestinationsConfiguredError` if `destinations` is empty.
82
+ * Throws `DestinationNotFoundError` if `input.destination` doesn't match a
83
+ * configured destination.
84
+ */
85
+ export function resolveDestination(input, destinations) {
86
+ if (destinations.length === 0)
87
+ throw new NoDestinationsConfiguredError();
88
+ if (input.destination && input.destination.trim() !== "") {
89
+ const wanted = input.destination.trim();
90
+ const found = destinations.find((d) => d.name === wanted);
91
+ if (!found) {
92
+ throw new DestinationNotFoundError(wanted, destinations.map((d) => d.name));
93
+ }
94
+ return found;
95
+ }
96
+ const compiled = compileDestinations(destinations);
97
+ for (const entry of compiled) {
98
+ if (destinationMatches(entry.compiled, input))
99
+ return entry.destination;
100
+ }
101
+ return pickFallback(destinations);
102
+ }
103
+ /**
104
+ * Pre-compile a routing table for hot paths (e.g. per-tick in the daemon).
105
+ * Returns a closure that resolves a destination from input without recompiling
106
+ * regexes on every call.
107
+ */
108
+ export function buildResolver(destinations) {
109
+ if (destinations.length === 0) {
110
+ return () => { throw new NoDestinationsConfiguredError(); };
111
+ }
112
+ const compiled = compileDestinations(destinations);
113
+ return (input) => {
114
+ if (input.destination && input.destination.trim() !== "") {
115
+ const wanted = input.destination.trim();
116
+ const found = destinations.find((d) => d.name === wanted);
117
+ if (!found) {
118
+ throw new DestinationNotFoundError(wanted, destinations.map((d) => d.name));
119
+ }
120
+ return found;
121
+ }
122
+ for (const entry of compiled) {
123
+ if (destinationMatches(entry.compiled, input))
124
+ return entry.destination;
125
+ }
126
+ return pickFallback(destinations);
127
+ };
128
+ }
129
+ //# sourceMappingURL=routing.js.map
@@ -0,0 +1,24 @@
1
+ import type { BikkyConfig, Destination, SearchScopeTarget } from "./config.js";
2
+ import { type RoutingInput } from "./routing.js";
3
+ export type SearchScopeInput = SearchScopeTarget | null | undefined;
4
+ export interface AvailableSearchScope {
5
+ name: string;
6
+ description: string;
7
+ destinations: "routed" | "all" | string[];
8
+ default: boolean;
9
+ source: "builtin" | "destination" | "config";
10
+ }
11
+ export interface ResolvedSearchScope {
12
+ name: string;
13
+ description: string;
14
+ requested: SearchScopeTarget;
15
+ destinations: Destination[];
16
+ }
17
+ export declare class SearchScopeNotFoundError extends Error {
18
+ readonly scope: string;
19
+ readonly available: string[];
20
+ constructor(scope: string, available: string[]);
21
+ }
22
+ export declare function availableSearchScopes(config: BikkyConfig, destinations: ReadonlyArray<Destination>): AvailableSearchScope[];
23
+ export declare function resolveSearchScope(input: SearchScopeInput, config: BikkyConfig, destinations: ReadonlyArray<Destination>, routing: RoutingInput): ResolvedSearchScope;
24
+ //# sourceMappingURL=search-scope.d.ts.map
@@ -0,0 +1,174 @@
1
+ import { resolveDestination } from "./routing.js";
2
+ export class SearchScopeNotFoundError extends Error {
3
+ scope;
4
+ available;
5
+ constructor(scope, available) {
6
+ super(`Unknown search scope '${scope}'. Available scopes: ${available.length > 0 ? available.join(", ") : "(none)"}`);
7
+ this.scope = scope;
8
+ this.available = available;
9
+ this.name = "SearchScopeNotFoundError";
10
+ }
11
+ }
12
+ function normalizeString(value) {
13
+ return value.trim();
14
+ }
15
+ function normalizeTarget(target) {
16
+ if (Array.isArray(target)) {
17
+ const normalized = target.map(normalizeString).filter(Boolean);
18
+ return normalized.length > 0 ? normalized : null;
19
+ }
20
+ if (typeof target === "string") {
21
+ const trimmed = normalizeString(target);
22
+ if (!trimmed)
23
+ return null;
24
+ if (trimmed.includes(",")) {
25
+ const names = trimmed.split(",").map(normalizeString).filter(Boolean);
26
+ if (names.length > 1)
27
+ return names;
28
+ }
29
+ return trimmed;
30
+ }
31
+ return null;
32
+ }
33
+ function targetEquals(a, b) {
34
+ const normalizedA = normalizeTarget(a);
35
+ const normalizedB = normalizeTarget(b);
36
+ if (Array.isArray(normalizedA) || Array.isArray(normalizedB)) {
37
+ if (!Array.isArray(normalizedA) || !Array.isArray(normalizedB))
38
+ return false;
39
+ if (normalizedA.length !== normalizedB.length)
40
+ return false;
41
+ return normalizedA.every((value, idx) => value === normalizedB[idx]);
42
+ }
43
+ return normalizedA === normalizedB;
44
+ }
45
+ function describeTarget(target) {
46
+ const normalized = normalizeTarget(target) ?? "routed";
47
+ if (Array.isArray(normalized))
48
+ return normalized;
49
+ if (normalized === "routed" || normalized === "all")
50
+ return normalized;
51
+ return [normalized];
52
+ }
53
+ function destinationScopeDescription(destination) {
54
+ return destination.description
55
+ ?? `Search only the '${destination.name}' destination (collection '${destination.collection}').`;
56
+ }
57
+ export function availableSearchScopes(config, destinations) {
58
+ const defaultScope = normalizeTarget(config.default_search_scope) ?? "routed";
59
+ const scopes = [
60
+ {
61
+ name: "routed",
62
+ description: "Search the single destination selected by the routing rules (cwd, query/content, entities, metadata), then default/first destination fallback. This preserves historical behavior and keeps destination boundaries narrow.",
63
+ destinations: "routed",
64
+ default: targetEquals(defaultScope, "routed"),
65
+ source: "builtin",
66
+ },
67
+ {
68
+ name: "all",
69
+ description: "Search every configured destination and merge/rerank the results. Use for broad recall when relevant context may span multiple memory stores.",
70
+ destinations: "all",
71
+ default: targetEquals(defaultScope, "all"),
72
+ source: "builtin",
73
+ },
74
+ ];
75
+ for (const destination of destinations) {
76
+ scopes.push({
77
+ name: destination.name,
78
+ description: destinationScopeDescription(destination),
79
+ destinations: [destination.name],
80
+ default: targetEquals(defaultScope, destination.name),
81
+ source: "destination",
82
+ });
83
+ }
84
+ for (const scope of config.search_scopes) {
85
+ scopes.push({
86
+ name: scope.name,
87
+ description: scope.description,
88
+ destinations: describeTarget(scope.destinations),
89
+ default: targetEquals(defaultScope, scope.name) || targetEquals(defaultScope, scope.destinations),
90
+ source: "config",
91
+ });
92
+ }
93
+ return scopes;
94
+ }
95
+ function resolveNames(names, destinations) {
96
+ const byName = new Map(destinations.map((destination) => [destination.name, destination]));
97
+ const resolved = [];
98
+ const seen = new Set();
99
+ for (const rawName of names) {
100
+ const name = normalizeString(rawName);
101
+ if (!name || seen.has(name))
102
+ continue;
103
+ const destination = byName.get(name);
104
+ if (!destination)
105
+ throw new SearchScopeNotFoundError(name, [...byName.keys()]);
106
+ resolved.push(destination);
107
+ seen.add(name);
108
+ }
109
+ if (resolved.length === 0) {
110
+ throw new SearchScopeNotFoundError(names.join(","), [...byName.keys()]);
111
+ }
112
+ return resolved;
113
+ }
114
+ function resolveTarget(target, config, destinations, routing, depth = 0) {
115
+ if (depth > 4) {
116
+ throw new Error("Search scope resolution exceeded maximum nesting depth");
117
+ }
118
+ const normalized = normalizeTarget(target) ?? "routed";
119
+ if (Array.isArray(normalized)) {
120
+ const resolved = resolveNames(normalized, destinations);
121
+ return {
122
+ name: normalized.join(","),
123
+ description: `Search selected destinations: ${normalized.join(", ")}.`,
124
+ requested: normalized,
125
+ destinations: resolved,
126
+ };
127
+ }
128
+ const configuredScope = config.search_scopes.find((scope) => scope.name === normalized);
129
+ if (configuredScope) {
130
+ const resolved = resolveTarget(configuredScope.destinations, config, destinations, routing, depth + 1);
131
+ return {
132
+ name: configuredScope.name,
133
+ description: configuredScope.description,
134
+ requested: normalized,
135
+ destinations: resolved.destinations,
136
+ };
137
+ }
138
+ if (normalized === "routed" || normalized === "auto") {
139
+ const destination = resolveDestination(routing, destinations);
140
+ return {
141
+ name: "routed",
142
+ description: "Search the single destination selected by routing rules.",
143
+ requested: normalized,
144
+ destinations: [destination],
145
+ };
146
+ }
147
+ if (normalized === "all") {
148
+ if (destinations.length === 0) {
149
+ resolveDestination(routing, destinations);
150
+ }
151
+ return {
152
+ name: "all",
153
+ description: "Search every configured destination.",
154
+ requested: normalized,
155
+ destinations: [...destinations],
156
+ };
157
+ }
158
+ const destination = destinations.find((dest) => dest.name === normalized);
159
+ if (destination) {
160
+ return {
161
+ name: destination.name,
162
+ description: destinationScopeDescription(destination),
163
+ requested: normalized,
164
+ destinations: [destination],
165
+ };
166
+ }
167
+ const available = availableSearchScopes(config, destinations).map((scope) => scope.name);
168
+ throw new SearchScopeNotFoundError(normalized, available);
169
+ }
170
+ export function resolveSearchScope(input, config, destinations, routing) {
171
+ const target = normalizeTarget(input) ?? normalizeTarget(config.default_search_scope) ?? "routed";
172
+ return resolveTarget(target, config, destinations, routing);
173
+ }
174
+ //# sourceMappingURL=search-scope.js.map
@@ -0,0 +1,57 @@
1
+ # Fully hosted config
2
+
3
+ Best for performance and teams. This setup uses Qdrant Cloud for managed vector storage and OpenAI-compatible hosted models for extraction, curation, and recall.
4
+
5
+ ## What you need
6
+
7
+ - A Qdrant Cloud cluster URL.
8
+ - A Qdrant API key.
9
+ - An OpenAI API key, or another hosted provider configured in the full configuration guide.
10
+
11
+ For both `embedding.provider` and `llm.provider`, possible values are `openai`, `bedrock`, or `portkey` for hosted models. `ollama` is also supported when you want local model calls.
12
+
13
+ ## Config
14
+
15
+ Save this as `~/.bikky/config.json`:
16
+
17
+ ```json
18
+ {
19
+ "qdrant_url": "https://your-cluster.cloud.qdrant.io:6333",
20
+ "qdrant_api_key": "your-qdrant-api-key",
21
+ "embedding": {
22
+ "provider": "openai",
23
+ "model": "text-embedding-3-small",
24
+ "dimensions": 1536,
25
+ "api_key": "sk-..."
26
+ },
27
+ "llm": {
28
+ "provider": "openai",
29
+ "model": "gpt-4.1-mini",
30
+ "api_key": "sk-..."
31
+ }
32
+ }
33
+ ```
34
+
35
+ `qdrant_api_key` is optional only for unauthenticated self-hosted Qdrant. Qdrant Cloud usually requires it.
36
+
37
+ Prefer not to store hosted model keys in the config file? Omit `api_key` above and set:
38
+
39
+ ```bash
40
+ export OPENAI_API_KEY="sk-..."
41
+ ```
42
+
43
+ ## Check it
44
+
45
+ ```bash
46
+ bikky status
47
+ ```
48
+
49
+ After changing Qdrant or provider settings, restart long-running processes:
50
+
51
+ ```bash
52
+ bikky stop && bikky start
53
+ ```
54
+
55
+ Then restart your editor so its MCP process reloads.
56
+
57
+ For Bedrock, Portkey, custom base URLs, or model-specific dimensions, see the [full configuration guide](../configuration.md).
@@ -0,0 +1,50 @@
1
+ # Local Qdrant + hosted models config
2
+
3
+ This setup keeps Qdrant local while hosted embeddings and LLM calls handle extraction, curation, and recall.
4
+
5
+ ## What you need
6
+
7
+ - Qdrant running locally, usually with Docker.
8
+ - An OpenAI API key, or another hosted provider configured in the full configuration guide.
9
+
10
+ For both `embedding.provider` and `llm.provider`, possible values are `openai`, `bedrock`, or `portkey` for hosted models. `ollama` is also supported when you want local model calls.
11
+
12
+ ## Config
13
+
14
+ Save this as `~/.bikky/config.json`:
15
+
16
+ ```json
17
+ {
18
+ "qdrant_url": "http://localhost:6333",
19
+ "qdrant_api_key": "",
20
+ "embedding": {
21
+ "provider": "openai",
22
+ "model": "text-embedding-3-small",
23
+ "dimensions": 1536,
24
+ "api_key": "sk-..."
25
+ },
26
+ "llm": {
27
+ "provider": "openai",
28
+ "model": "gpt-4.1-mini",
29
+ "api_key": "sk-..."
30
+ }
31
+ }
32
+ ```
33
+
34
+ `qdrant_api_key` is optional. Leave it empty or omit it for local or unauthenticated self-hosted Qdrant.
35
+
36
+ Prefer not to store hosted model keys in the config file? Omit `api_key` above and set:
37
+
38
+ ```bash
39
+ export OPENAI_API_KEY="sk-..."
40
+ ```
41
+
42
+ ## Check it
43
+
44
+ ```bash
45
+ bikky status
46
+ ```
47
+
48
+ If you started from a fresh install, run `bikky setup` after writing the config, then restart your editor so its MCP process reloads.
49
+
50
+ For Bedrock, Portkey, custom base URLs, or model-specific dimensions, see the [full configuration guide](../configuration.md).
@@ -0,0 +1,39 @@
1
+ # Hosted Qdrant + local models
2
+
3
+ Use this path when you want memory shared across machines, but you still want embeddings and background curation to run through local Ollama.
4
+
5
+ ## What you need
6
+
7
+ - A Qdrant Cloud cluster URL.
8
+ - A Qdrant API key.
9
+ - Ollama installed locally.
10
+ - The default embedding model pulled with `ollama pull qwen3-embedding:0.6b`.
11
+
12
+ ## Config
13
+
14
+ Save this as `~/.bikky/config.json`:
15
+
16
+ ```json
17
+ {
18
+ "qdrant_url": "https://your-cluster.cloud.qdrant.io:6333",
19
+ "qdrant_api_key": "your-qdrant-api-key"
20
+ }
21
+ ```
22
+
23
+ bikky will store memory in hosted Qdrant and keep model calls local through Ollama.
24
+
25
+ `qdrant_api_key` is optional only for unauthenticated self-hosted Qdrant. Qdrant Cloud usually requires it.
26
+
27
+ ## Check it
28
+
29
+ ```bash
30
+ bikky status
31
+ ```
32
+
33
+ After changing Qdrant settings, restart long-running processes:
34
+
35
+ ```bash
36
+ bikky stop && bikky start
37
+ ```
38
+
39
+ Then restart your editor so its MCP process reloads.
@@ -0,0 +1,34 @@
1
+ # Local and free config
2
+
3
+ Use this path if you want a private, free setup: Qdrant runs on your machine, and Ollama handles local models.
4
+
5
+ This setup is best for private/free testing rather than long-term team use. Extraction, embedding, and curation performance depends on the local models and hardware you run.
6
+
7
+ ## What you need
8
+
9
+ - Qdrant running locally, usually with Docker.
10
+ - Ollama installed locally.
11
+ - The default embedding model pulled with `ollama pull qwen3-embedding:0.6b`.
12
+
13
+ ## Config
14
+
15
+ Save this as `~/.bikky/config.json`:
16
+
17
+ ```json
18
+ {
19
+ "qdrant_url": "http://localhost:6333",
20
+ "qdrant_api_key": ""
21
+ }
22
+ ```
23
+
24
+ That's the whole config. bikky uses local Ollama defaults for embeddings and background curation.
25
+
26
+ `qdrant_api_key` is optional. Leave it empty or omit it for local or unauthenticated self-hosted Qdrant.
27
+
28
+ ## Check it
29
+
30
+ ```bash
31
+ bikky status
32
+ ```
33
+
34
+ If you started from a fresh install, run `bikky setup` after writing the config, then restart your editor so its MCP process reloads.