@johpaz/hive-agents 0.0.47 → 1.0.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 (322) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +128 -897
  3. package/dist/hive.js +222237 -206295
  4. package/dist/tool-worker.js +226 -927
  5. package/dist/ui/assets/A2UIPage-D4nzp5NV.js +8 -0
  6. package/dist/ui/assets/AgentCreateForm-M2RhjeA1.js +1 -0
  7. package/dist/ui/assets/AgentDetailPage-DkFRtj8g.js +1 -0
  8. package/dist/ui/assets/AgentNewPage-CfBU7puz.js +1 -0
  9. package/dist/ui/assets/AgentsPage-Ctzq2LWx.js +10 -0
  10. package/dist/ui/assets/ApiClientPage-DKbGO1QW.js +3 -0
  11. package/dist/ui/assets/ChannelsPage-H6rgr8DQ.js +8 -0
  12. package/dist/ui/assets/DashboardPage-BIjYGf4m.js +6 -0
  13. package/dist/ui/assets/{LoginPage-BTxJdFVG.js → LoginPage-DazoxtBJ.js} +1 -1
  14. package/dist/ui/assets/{LogsPage-DVV2eHbh.js → LogsPage-DMZ6KtQ3.js} +1 -1
  15. package/dist/ui/assets/MeetingPage-CSLFvHL7.js +1 -0
  16. package/dist/ui/assets/ModelSelector-BCfvugHB.js +1 -0
  17. package/dist/ui/assets/{NotFound-BIUDlIXU.js → NotFound-Bpr12V51.js} +1 -1
  18. package/dist/ui/assets/Office3DPage-BE6Epe0d.js +4614 -0
  19. package/dist/ui/assets/Office3DPage-C3SIzd2H.css +1 -0
  20. package/dist/ui/assets/ProvidersPage-D0cApfM1.js +1 -0
  21. package/dist/ui/assets/{RecoverPage-7YDQysBL.js → RecoverPage-BVUPHG9z.js} +1 -1
  22. package/dist/ui/assets/SettingsPage-DCZ4nql4.js +9 -0
  23. package/dist/ui/assets/SetupPage-In19p30M.js +1 -0
  24. package/dist/ui/assets/WebChatPage-ByVBSzxL.js +29 -0
  25. package/dist/ui/assets/{activity-c3pNngT_.js → activity-BIIli7ET.js} +1 -1
  26. package/dist/ui/assets/agentCapabilities-D1PD9yFH.js +1 -0
  27. package/dist/ui/assets/alert-CQlRq6sv.js +1 -0
  28. package/dist/ui/assets/arrow-left-BfcnX8Er.js +1 -0
  29. package/dist/ui/assets/arrow-right-Q-dzAn8k.js +1 -0
  30. package/dist/ui/assets/arrow-up-right-Bf-8wrUQ.js +1 -0
  31. package/dist/ui/assets/badge-DKGZbVZJ.js +1 -0
  32. package/dist/ui/assets/{calendar-B-KZ9RQO.js → calendar-S9-_Q6QR.js} +1 -1
  33. package/dist/ui/assets/{card-CNf6BS2e.js → card-D3Nw3kh3.js} +1 -1
  34. package/dist/ui/assets/check-CryV78SQ.js +1 -0
  35. package/dist/ui/assets/chevron-down-QCtMs-Af.js +1 -0
  36. package/dist/ui/assets/chevron-left-dTGbyl5G.js +1 -0
  37. package/dist/ui/assets/chevron-right-D0GjXbnO.js +1 -0
  38. package/dist/ui/assets/chevron-up-Cg0jO8uT.js +1 -0
  39. package/dist/ui/assets/{circle-alert-KuAm2FWh.js → circle-alert-DTVW4R94.js} +1 -1
  40. package/dist/ui/assets/circle-check-BAolxswA.js +1 -0
  41. package/dist/ui/assets/{circle-x-DjLkFDO8.js → circle-x-CJXbXzRh.js} +1 -1
  42. package/dist/ui/assets/{copy-Bu5d7C-0.js → copy-X_TPpA-A.js} +1 -1
  43. package/dist/ui/assets/{dialog-Jk4bieO4.js → dialog-uUBz_NIB.js} +1 -1
  44. package/dist/ui/assets/dist-CD_qfA30.js +1 -0
  45. package/dist/ui/assets/{download-Cjbk4Rek.js → download-C-fXu08w.js} +1 -1
  46. package/dist/ui/assets/earth-CTsVjCmp.js +1 -0
  47. package/dist/ui/assets/ellipsis-vertical-5zBh5yzc.js +1 -0
  48. package/dist/ui/assets/{external-link-6sTlRDUR.js → external-link-CvpRhwC_.js} +1 -1
  49. package/dist/ui/assets/{eye-Df8o0tkC.js → eye-CM-HQEWU.js} +1 -1
  50. package/dist/ui/assets/{file-text-lnxnjBp0.js → file-text-lwkvYGtA.js} +1 -1
  51. package/dist/ui/assets/{gateway-url-DwzPmoc8.js → gateway-url-BlnabM5e.js} +1 -1
  52. package/dist/ui/assets/gauge-CB-cas-h.js +1 -0
  53. package/dist/ui/assets/{history-CAF_R34_.js → history-eSHspWRr.js} +1 -1
  54. package/dist/ui/assets/index-D489S18g.css +2 -0
  55. package/dist/ui/assets/index-ZjAc-KQS.js +116 -0
  56. package/dist/ui/assets/{info-WjromB4Y.js → info-DTgFQ_jA.js} +1 -1
  57. package/dist/ui/assets/key-CeM9JJkq.js +1 -0
  58. package/dist/ui/assets/label-k0jYxoWW.js +1 -0
  59. package/dist/ui/assets/loader-circle-Dtfz4FWw.js +1 -0
  60. package/dist/ui/assets/lock-open-B089GUAJ.js +1 -0
  61. package/dist/ui/assets/mail--gNFIe4M.js +1 -0
  62. package/dist/ui/assets/{pause-VqeUmp2Z.js → pause-DjT1nwQM.js} +1 -1
  63. package/dist/ui/assets/pencil-6PRgdjiU.js +1 -0
  64. package/dist/ui/assets/play-tOrP0xUJ.js +1 -0
  65. package/dist/ui/assets/plus-Cnom3j47.js +1 -0
  66. package/dist/ui/assets/progress-DrI2UDu-.js +1 -0
  67. package/dist/ui/assets/radio-D-joO9J0.js +1 -0
  68. package/dist/ui/assets/{refresh-cw-CCzDCAuz.js → refresh-cw-BRrzoHQW.js} +1 -1
  69. package/dist/ui/assets/scroll-area-CfHn94Vb.js +1 -0
  70. package/dist/ui/assets/search-D277MUP0.js +1 -0
  71. package/dist/ui/assets/select-BOR8MsSL.js +1 -0
  72. package/dist/ui/assets/{send-BPk9XbIq.js → send-DIlj81PT.js} +1 -1
  73. package/dist/ui/assets/{settings-BGfrZ_zM.js → settings-CkBjgAEm.js} +1 -1
  74. package/dist/ui/assets/{shield-CxhcUT39.js → shield-U0hIjGzm.js} +1 -1
  75. package/dist/ui/assets/slider-CmE_z1Ii.js +1 -0
  76. package/dist/ui/assets/{sparkles-BhwlS1pc.js → sparkles-VXHGDbNh.js} +1 -1
  77. package/dist/ui/assets/{square-DMNWw4Hi.js → square-OHeetvN3.js} +1 -1
  78. package/dist/ui/assets/switch-DXcELPsM.js +1 -0
  79. package/dist/ui/assets/tabs-CxiybXcw.js +1 -0
  80. package/dist/ui/assets/terminal-C6YPcJl_.js +1 -0
  81. package/dist/ui/assets/{textarea-B6Z1Zc6W.js → textarea-rp6vsOZl.js} +1 -1
  82. package/dist/ui/assets/{trash-2-xD2o4SgX.js → trash-2-DQxm7DUM.js} +1 -1
  83. package/dist/ui/assets/{triangle-alert-pVIJGjga.js → triangle-alert-Dj8ZhmWj.js} +1 -1
  84. package/dist/ui/assets/{useHiveAgentsModelLoad-BnC4jLE-.js → useHiveAgentsModelLoad-COLvs-Ho.js} +1 -1
  85. package/dist/ui/assets/useOfficeModel-Cy7cAyEn.js +1 -0
  86. package/dist/ui/assets/useProviders-q6iROeWE.js +1 -0
  87. package/dist/ui/assets/utils-Dyb7SC2_.js +1 -0
  88. package/dist/ui/assets/vendor-charts-K3xcRl0X.js +60 -0
  89. package/dist/ui/assets/{vendor-query-DsWPbQdG.js → vendor-query-Dj8xYhQD.js} +1 -1
  90. package/dist/ui/assets/vendor-radix-D0s_k6Gp.js +63 -0
  91. package/dist/ui/assets/vendor-react-CPJEWbIG.js +1 -0
  92. package/dist/ui/assets/{vendor-router-gqiZ7xhx.js → vendor-router-zpB-76nT.js} +1 -1
  93. package/dist/ui/assets/volume-x-Bm735CXN.js +1 -0
  94. package/dist/ui/assets/wifi-DklBfOZ6.js +1 -0
  95. package/dist/ui/assets/{zap-B4RaNNO5.js → zap-BEZNJ0i0.js} +1 -1
  96. package/dist/ui/index.html +16 -13
  97. package/dist/ui/logoblack.png +0 -0
  98. package/dist/ui/logocolor-dark.png +0 -0
  99. package/dist/ui/logocolorbg.png +0 -0
  100. package/dist/ui/logodoradobg.png +0 -0
  101. package/package.json +18 -15
  102. package/packages/cli/src/adapters/config.ts +1 -80
  103. package/packages/cli/src/adapters/factory.ts +0 -45
  104. package/packages/cli/src/adapters/index.ts +0 -8
  105. package/packages/cli/src/commands/doctor.ts +156 -1
  106. package/packages/cli/src/commands/gateway.ts +2 -9
  107. package/packages/cli/src/commands/onboard.ts +126 -59
  108. package/packages/cli/src/index.ts +9 -11
  109. package/packages/cli/src/ui-bundle.generated.ts +9 -92
  110. package/packages/core/src/agent/acceptance-checks.ts +172 -0
  111. package/packages/core/src/agent/agent-catalog.ts +348 -0
  112. package/packages/core/src/agent/agent-loop.ts +204 -28
  113. package/packages/core/src/agent/capability-search.ts +5 -5
  114. package/packages/core/src/agent/catalog-selector.ts +103 -0
  115. package/packages/core/src/agent/compaction.ts +52 -42
  116. package/packages/core/src/agent/context-compiler.ts +185 -63
  117. package/packages/core/src/agent/conversation-store.ts +56 -3
  118. package/packages/core/src/agent/curator.ts +129 -34
  119. package/packages/core/src/agent/delegation-runtime.ts +241 -0
  120. package/packages/core/src/agent/goal-runner.ts +111 -32
  121. package/packages/core/src/agent/index.ts +17 -0
  122. package/packages/core/src/agent/llm-client.ts +34 -2
  123. package/packages/core/src/agent/llm-providers/anthropic.ts +10 -7
  124. package/packages/core/src/agent/llm-providers/hiveagents.ts +1 -1
  125. package/packages/core/src/agent/llm-providers/interface.ts +16 -5
  126. package/packages/core/src/agent/llm-providers/modelscope.ts +5 -0
  127. package/packages/core/src/agent/llm-providers/openai-compat-base.ts +1 -1
  128. package/packages/core/src/agent/llm-providers/z-ai.ts +5 -0
  129. package/packages/core/src/agent/minimal-loadout.ts +47 -0
  130. package/packages/core/src/agent/playbook-selector.ts +1 -1
  131. package/packages/core/src/agent/prompt-builder.ts +4 -0
  132. package/packages/core/src/agent/proof-packet.ts +6 -1
  133. package/packages/core/src/agent/providers/index.ts +9 -4
  134. package/packages/core/src/agent/routing-intent.ts +22 -0
  135. package/packages/core/src/agent/run-store.ts +24 -3
  136. package/packages/core/src/agent/service.ts +2 -2
  137. package/packages/core/src/agent/skill-selector.ts +12 -31
  138. package/packages/core/src/agent/tool-selector.ts +61 -36
  139. package/packages/core/src/agent/tracer.ts +5 -1
  140. package/packages/core/src/artifacts/store.ts +162 -0
  141. package/packages/core/src/canvas/canvas-manager.ts +5 -234
  142. package/packages/core/src/canvas/emitter.ts +121 -69
  143. package/packages/core/src/canvas/index.ts +0 -2
  144. package/packages/core/src/channels/base.ts +3 -1
  145. package/packages/core/src/channels/manager.ts +117 -25
  146. package/packages/core/src/channels/webchat.ts +4 -8
  147. package/packages/core/src/channels/whatsapp.ts +6 -1
  148. package/packages/core/src/config/loader.ts +13 -23
  149. package/packages/core/src/events/agent-bus.ts +0 -31
  150. package/packages/core/src/events/channel-narration.ts +150 -0
  151. package/packages/core/src/events/narration.ts +82 -0
  152. package/packages/core/src/events/tool-narration.ts +62 -0
  153. package/packages/core/src/gateway/channel-notify.ts +43 -10
  154. package/packages/core/src/gateway/delegation-groups.ts +258 -0
  155. package/packages/core/src/gateway/delegation-notify.ts +103 -0
  156. package/packages/core/src/gateway/durable-queue.ts +33 -2
  157. package/packages/core/src/gateway/helpers/index.ts +2 -2
  158. package/packages/core/src/gateway/helpers/narration.ts +4 -57
  159. package/packages/core/src/gateway/helpers/redact.ts +1 -1
  160. package/packages/core/src/gateway/helpers/ui-source.ts +67 -0
  161. package/packages/core/src/gateway/initializer.ts +15 -13
  162. package/packages/core/src/gateway/job-executors.ts +197 -104
  163. package/packages/core/src/gateway/lane-queue.ts +1 -1
  164. package/packages/core/src/gateway/notification-inbox.ts +57 -0
  165. package/packages/core/src/gateway/resolver.ts +11 -25
  166. package/packages/core/src/gateway/routes/agents.ts +91 -1
  167. package/packages/core/src/gateway/routes/auth.ts +21 -42
  168. package/packages/core/src/gateway/routes/channels.ts +15 -1
  169. package/packages/core/src/gateway/routes/chat.ts +6 -6
  170. package/packages/core/src/gateway/routes/cron-api.ts +0 -4
  171. package/packages/core/src/gateway/routes/mcp.ts +0 -63
  172. package/packages/core/src/gateway/routes/meeting.ts +245 -0
  173. package/packages/core/src/gateway/routes/models.ts +69 -12
  174. package/packages/core/src/gateway/routes/providers.ts +111 -28
  175. package/packages/core/src/gateway/routes/setup.ts +92 -35
  176. package/packages/core/src/gateway/routes/skills.ts +2 -2
  177. package/packages/core/src/gateway/routes/system.ts +31 -10
  178. package/packages/core/src/gateway/routes/users.ts +24 -1
  179. package/packages/core/src/gateway/routes/voice.ts +3 -0
  180. package/packages/core/src/gateway/server.ts +207 -141
  181. package/packages/core/src/gateway/session.ts +6 -4
  182. package/packages/core/src/gateway/slash-commands.ts +7 -6
  183. package/packages/core/src/gateway/webchat-turn.ts +63 -13
  184. package/packages/core/src/index.ts +3 -0
  185. package/packages/core/src/mcp/hot-reload.ts +14 -7
  186. package/packages/core/src/mcp/singleton.ts +0 -3
  187. package/packages/core/src/mcp/tool-sync.ts +2 -2
  188. package/packages/core/src/resilience/retry.ts +1 -1
  189. package/packages/core/src/scheduler/CronScheduler.ts +3 -1
  190. package/packages/core/src/scheduler/integration.ts +1 -1
  191. package/packages/core/src/storage/bootstrap.ts +34 -10
  192. package/packages/core/src/storage/collections.ts +167 -27
  193. package/packages/core/src/storage/crypto.ts +147 -58
  194. package/packages/core/src/storage/hivedb.ts +9 -0
  195. package/packages/core/src/storage/model-id.ts +53 -0
  196. package/packages/core/src/storage/onboarding.ts +160 -34
  197. package/packages/core/src/storage/reconcile.ts +2 -5
  198. package/packages/core/src/storage/seed.ts +436 -158
  199. package/packages/core/src/storage/usage.ts +61 -132
  200. package/packages/core/src/storage/user-email.ts +11 -0
  201. package/packages/core/src/tool-runtime/index.ts +69 -23
  202. package/packages/core/src/tool-runtime/worker-tools.ts +4 -2
  203. package/packages/core/src/{canvas/a2ui-tools.ts → tools/a2ui/index.ts} +17 -8
  204. package/packages/core/src/tools/agents/index.ts +566 -85
  205. package/packages/core/src/tools/core/index.ts +28 -10
  206. package/packages/core/src/tools/cron/index.ts +1 -6
  207. package/packages/core/src/tools/index.ts +19 -46
  208. package/packages/core/src/tools/types.ts +1 -1
  209. package/packages/core/src/tools/web/artifact-inspect.ts +23 -0
  210. package/packages/core/src/tools/web/browser-backend.ts +129 -0
  211. package/packages/core/src/tools/web/browser-screenshot.ts +26 -5
  212. package/packages/core/src/tools/web/browser-service.ts +75 -35
  213. package/packages/core/src/tools/web/index.ts +3 -0
  214. package/packages/core/src/tools/web/webview-backend.ts +412 -0
  215. package/packages/core/src/utils/logger.ts +58 -30
  216. package/packages/core/src/utils/toon.ts +0 -20
  217. package/packages/core/src/voice/index.ts +108 -17
  218. package/packages/mcp/src/manager.ts +8 -7
  219. package/packages/mcp/src/transports/sse.ts +0 -4
  220. package/packages/mcp/src/transports/websocket.ts +0 -6
  221. package/packages/skills/src/bundled/{canvas → a2ui}/a2ui_dashboard/SKILL.md +4 -4
  222. package/packages/skills/src/bundled/{canvas → a2ui}/a2ui_form/SKILL.md +4 -4
  223. package/packages/skills/src/bundled/{canvas → a2ui}/a2ui_interactive/SKILL.md +5 -5
  224. package/packages/skills/src/bundled/agents/agent_spawner/SKILL.md +24 -18
  225. package/packages/skills/src/bundled/agents/task_orchestrator/SKILL.md +48 -148
  226. package/packages/skills/src/bundled/cli/cli_pipeline/SKILL.md +9 -10
  227. package/packages/skills/src/bundled/cli/cli_safe_exec/SKILL.md +1 -1
  228. package/packages/skills/src/bundled/cli/software_engineering/SKILL.md +23 -0
  229. package/packages/skills/src/bundled/cron_manager/SKILL.md +2 -2
  230. package/packages/skills/src/bundled/cron_reminder/SKILL.md +7 -7
  231. package/packages/skills/src/bundled/filesystem/file_read_and_summarize/SKILL.md +11 -10
  232. package/packages/skills/src/bundled/filesystem/file_writer/SKILL.md +29 -35
  233. package/packages/skills/src/bundled/filesystem/workspace_file_operator/SKILL.md +22 -0
  234. package/packages/skills/src/bundled/search_knowledge/capability_discovery/SKILL.md +5 -4
  235. package/packages/skills/src/bundled-data.generated.ts +640 -1226
  236. package/dist/ui/assets/AgentCreateForm-DzaIT-dA.js +0 -1
  237. package/dist/ui/assets/AgentDetailPage-DgqcJceY.js +0 -1
  238. package/dist/ui/assets/AgentNewPage-CNSpoOSA.js +0 -1
  239. package/dist/ui/assets/AgentsPage-BMUJzTD6.js +0 -10
  240. package/dist/ui/assets/ApiClientPage-Cum_a_3j.js +0 -3
  241. package/dist/ui/assets/CanvasPage-o6oCP6uq.js +0 -33
  242. package/dist/ui/assets/ChannelsPage-WrB0zwLq.js +0 -8
  243. package/dist/ui/assets/DashboardPage-BCd6kNw0.js +0 -6
  244. package/dist/ui/assets/MeetingPage-BULIAWzq.js +0 -1
  245. package/dist/ui/assets/ModelSelector-BMYOChYb.js +0 -1
  246. package/dist/ui/assets/ProvidersPage-BVN5UZrI.js +0 -1
  247. package/dist/ui/assets/SettingsPage-CYmpFfDn.js +0 -9
  248. package/dist/ui/assets/SetupPage-Dnmb1Lbv.js +0 -1
  249. package/dist/ui/assets/WebChatPage-DmmdFhIC.js +0 -16
  250. package/dist/ui/assets/accordion-CnLzKNHK.js +0 -1
  251. package/dist/ui/assets/alert-B9J6KHmt.js +0 -1
  252. package/dist/ui/assets/alert-dialog-KcYQWcJ6.js +0 -1
  253. package/dist/ui/assets/arrow-left-CBcbX5EZ.js +0 -1
  254. package/dist/ui/assets/badge-88dRb4M8.js +0 -1
  255. package/dist/ui/assets/bell-8BqRYmzf.js +0 -1
  256. package/dist/ui/assets/chevron-down-DIosfU_U.js +0 -1
  257. package/dist/ui/assets/chevron-left-D4U-5A27.js +0 -1
  258. package/dist/ui/assets/chevron-right-CR4Skrf3.js +0 -1
  259. package/dist/ui/assets/chevron-up-CI-W21Fy.js +0 -1
  260. package/dist/ui/assets/circle-check-6Ard1-2z.js +0 -1
  261. package/dist/ui/assets/dropdown-menu-DDiaHg5y.js +0 -1
  262. package/dist/ui/assets/es-4I-joeZz.js +0 -1
  263. package/dist/ui/assets/folder-open-DJBLDFjv.js +0 -1
  264. package/dist/ui/assets/format-DsLPBxvt.js +0 -1
  265. package/dist/ui/assets/gauge-B8Tj43rC.js +0 -1
  266. package/dist/ui/assets/hexagon-6L79pgVK.js +0 -1
  267. package/dist/ui/assets/index-BmwTAwOF.css +0 -2
  268. package/dist/ui/assets/index-Cyw7L0Li.js +0 -116
  269. package/dist/ui/assets/key-DyKOoQh5.js +0 -1
  270. package/dist/ui/assets/label-B_15zZlR.js +0 -1
  271. package/dist/ui/assets/loader-circle-BmBOgYze.js +0 -1
  272. package/dist/ui/assets/lock-BS6OLXPv.js +0 -1
  273. package/dist/ui/assets/play-zJpWuhrr.js +0 -1
  274. package/dist/ui/assets/plus-BZQX26Dr.js +0 -1
  275. package/dist/ui/assets/progress-D5c-Eilm.js +0 -1
  276. package/dist/ui/assets/scroll-area-CihOx0cb.js +0 -1
  277. package/dist/ui/assets/search-DzDptO9s.js +0 -1
  278. package/dist/ui/assets/select-BQCOjM2j.js +0 -1
  279. package/dist/ui/assets/slider-bcUiUfx0.js +0 -14
  280. package/dist/ui/assets/switch-BR30E4ej.js +0 -1
  281. package/dist/ui/assets/table-B3aGEaVp.js +0 -1
  282. package/dist/ui/assets/tabs-LQidMKRS.js +0 -1
  283. package/dist/ui/assets/terminal--7G943As.js +0 -1
  284. package/dist/ui/assets/useProviders-C1xVKLxB.js +0 -1
  285. package/dist/ui/assets/utils-3pnRFmFe.js +0 -1
  286. package/dist/ui/assets/vendor-charts-Bu2lyBKP.js +0 -65
  287. package/dist/ui/assets/vendor-radix-D6rA7xKY.js +0 -63
  288. package/dist/ui/assets/vendor-react-BU5iQU4f.js +0 -1
  289. package/dist/ui/assets/volume-2-BekVQl6P.js +0 -1
  290. package/packages/core/src/agent/context-guard.ts +0 -91
  291. package/packages/core/src/agent/hooks.ts +0 -166
  292. package/packages/core/src/agent/providers.ts +0 -1
  293. package/packages/core/src/auth/auth.ts +0 -111
  294. package/packages/core/src/auth/index.ts +0 -1
  295. package/packages/core/src/canvas/canvas-tools.ts +0 -448
  296. package/packages/core/src/gateway/router.ts +0 -126
  297. package/packages/core/src/scheduler/dag/AgentExecutor.ts +0 -53
  298. package/packages/core/src/scheduler/dag/DAGScheduler.ts +0 -250
  299. package/packages/core/src/scheduler/dag/EventBridge.ts +0 -122
  300. package/packages/core/src/scheduler/dag/TaskGraph.ts +0 -192
  301. package/packages/core/src/scheduler/dag/TaskNode.ts +0 -97
  302. package/packages/core/src/scheduler/dag/TaskResult.ts +0 -22
  303. package/packages/core/src/scheduler/dag/errors.ts +0 -37
  304. package/packages/core/src/scheduler/dag/index.ts +0 -26
  305. package/packages/core/src/scheduler/dag/presets/ResearchPreset.ts +0 -97
  306. package/packages/core/src/scheduler/dag/strategies/ParallelStrategy.ts +0 -21
  307. package/packages/core/src/scheduler/dag/strategies/PriorityStrategy.ts +0 -46
  308. package/packages/core/src/scheduler/index.ts +0 -22
  309. package/packages/core/src/scheduler/task-driver.ts +0 -216
  310. package/packages/core/src/tools/canvas/index.ts +0 -420
  311. package/packages/core/src/tools/meeting/index.ts +0 -336
  312. package/packages/core/src/tools/projects/index.ts +0 -348
  313. package/packages/core/src/tools/voice/index.ts +0 -104
  314. package/packages/core/src/utils/index.ts +0 -5
  315. package/packages/skills/src/bundled/agents/code_delegator/SKILL.md +0 -156
  316. package/packages/skills/src/bundled/canvas/canvas_dashboard/SKILL.md +0 -146
  317. package/packages/skills/src/bundled/canvas/canvas_interact/SKILL.md +0 -148
  318. package/packages/skills/src/bundled/canvas/canvas_report/SKILL.md +0 -146
  319. package/packages/skills/src/bundled/meeting/meeting_transcription/SKILL.md +0 -213
  320. package/packages/skills/src/bundled/voice/voice_assistant/SKILL.md +0 -174
  321. package/packages/skills/src/bundled/voice/voice_input/SKILL.md +0 -146
  322. package/packages/skills/src/bundled/voice/voice_output/SKILL.md +0 -151
@@ -4,16 +4,15 @@ import { laneQueue } from "./lane-queue.ts";
4
4
  import { logger } from "../utils/logger.ts";
5
5
 
6
6
  export interface InboundMessage {
7
- type: "message" | "command" | "ping" | "join" | "canvas_subscribe" | "canvas_unsubscribe" | "logs_subscribe" | "logs_unsubscribe" | "audio" | "canvas:interact" | "a2ui:action" | "stop";
7
+ type: "message" | "command" | "ping" | "join" | "canvas_subscribe" | "canvas_unsubscribe" | "logs_subscribe" | "logs_unsubscribe" | "audio" | "a2ui:action" | "stop" | "notification_sync" | "notification_ack";
8
8
  sessionId: string;
9
9
  content?: string;
10
10
  audio?: string;
11
11
  command?: string;
12
12
  args?: string[];
13
13
  metadata?: Record<string, unknown>;
14
- componentId?: string;
15
14
  data?: Record<string, unknown>;
16
- action?: string;
15
+ notificationId?: string;
17
16
  image?: {
18
17
  base64: string;
19
18
  mimeType?: string;
@@ -27,11 +26,13 @@ export interface InboundMessage {
27
26
  }
28
27
 
29
28
  export interface OutboundMessage {
30
- type: "message" | "stream" | "status" | "error" | "pong" | "command_result" | "joined" | "typing" | "audio" | "welcome" | "progress" | "process" | "reasoning";
29
+ type: "message" | "stream" | "status" | "error" | "pong" | "command_result" | "joined" | "typing" | "audio" | "welcome" | "progress" | "process" | "reasoning" | "notification";
31
30
  sessionId: string;
32
31
  id?: string; // Message ID for streaming
33
32
  messageId?: string;
34
33
  content?: string;
34
+ notificationId?: string;
35
+ createdAt?: number;
35
36
  chunk?: string;
36
37
  isChunk?: boolean; // True if this is a streaming chunk
37
38
  isLast?: boolean;
@@ -80,7 +81,7 @@ export interface SlashCommand {
80
81
 
81
82
  const slashCommands = new Map<string, SlashCommand>();
82
83
 
83
- export function registerSlashCommand(command: SlashCommand): void {
84
+ function registerSlashCommand(command: SlashCommand): void {
84
85
  slashCommands.set(command.name, command);
85
86
  }
86
87
 
@@ -88,7 +89,7 @@ export function isSlashCommand(content: string): boolean {
88
89
  return content.startsWith("/") && content.length > 1;
89
90
  }
90
91
 
91
- export function parseSlashCommand(content: string): { name: string; args: string[] } | null {
92
+ function parseSlashCommand(content: string): { name: string; args: string[] } | null {
92
93
  if (!isSlashCommand(content)) return null;
93
94
 
94
95
  const parts = content.slice(1).split(/\s+/);
@@ -21,12 +21,14 @@ import { sendToUserChannel } from "./channel-notify";
21
21
  import { getNarration } from "./helpers";
22
22
  import { createRun, getRun } from "../agent/run-store";
23
23
  import { getDurableQueue } from "./durable-queue";
24
- import type { JobDoc } from "../storage/collections";
24
+ import { sessionManager } from "./session";
25
+ import type { JobDoc, TurnSource } from "../storage/collections";
25
26
 
26
27
  const log = logger.child("webchat-turn");
27
28
 
28
29
  export interface WebchatTurnPayload {
29
- source: "message" | "audio" | "a2ui" | "canvas" | "api";
30
+ /** "task_complete"/"delegation_summary": synthetic system-authored turns delivering an async-delegated task's outcome (see delegation-notify.ts). Not literal user speech — persisted with the matching `source` so history/compaction/LLM serialization can treat them correctly. */
31
+ source: TurnSource;
30
32
  /** webchat channelUserId for WS sources; canonical threadId for "api". */
31
33
  sessionId: string;
32
34
  /** User text / audio transcript / interaction description. */
@@ -43,6 +45,7 @@ export interface WebchatTurnPayload {
43
45
  channel?: string;
44
46
  /** Linked AgentRun (checkpoint/resume). Set by enqueueChatTurn. */
45
47
  runId?: string;
48
+ turnId?: string;
46
49
  }
47
50
 
48
51
  export interface WebchatTurnLive {
@@ -51,7 +54,7 @@ export interface WebchatTurnLive {
51
54
  }
52
55
 
53
56
  export interface WebchatTurnDeps {
54
- runner: { generate: (opts: Record<string, unknown>) => Promise<{ content?: string }> };
57
+ runner: { generate: (opts: any) => Promise<{ content?: string }> };
55
58
  getProvider: () => string;
56
59
  getModel: () => string;
57
60
  }
@@ -138,6 +141,9 @@ function createProcessReporter(sendRaw: (payload: string) => void, sessionId: st
138
141
  error(summary = "No se pudo completar el proceso") {
139
142
  send({ status: "error", summary });
140
143
  },
144
+ pending(summary = "Tareas delegadas en ejecución") {
145
+ send({ kind: "analysis", status: "thinking", summary });
146
+ },
141
147
  };
142
148
  }
143
149
 
@@ -170,7 +176,7 @@ export async function runWebchatTurn(
170
176
  let userId: string;
171
177
  let threadId: string;
172
178
  const channel = payload.channel ?? "webchat";
173
- if (payload.source === "api") {
179
+ if (payload.source === "api" || payload.source === "delegation_summary") {
174
180
  userId = payload.userId ?? "default";
175
181
  threadId = payload.sessionId;
176
182
  } else {
@@ -286,6 +292,16 @@ export async function runWebchatTurn(
286
292
  runId: payload.runId,
287
293
  resume,
288
294
  durable: !!payload.runId,
295
+ turnId: payload.turnId,
296
+ sessionId,
297
+ channel,
298
+ rawUserMessage: payload.rawContent ?? payload.content,
299
+ // Every turn persists its provenance — see AgentLoopOptions.historySource.
300
+ // System-authored turns (async-delegation fan-in/fan-out notices) still
301
+ // use role:"user" in `messages` above to trigger generation; `source`
302
+ // lets downstream readers (history endpoint, compaction, LLM
303
+ // serialization) recognize and frame them without a second role.
304
+ historySource: payload.source,
289
305
  onToken: async (token: string) => {
290
306
  if (signal.aborted) return;
291
307
  if (!reportedWriting && token.trim()) {
@@ -314,8 +330,6 @@ export async function runWebchatTurn(
314
330
  },
315
331
  onStep: async (step: { type: string; message?: string; toolName?: string }) => {
316
332
  if (signal.aborted) return;
317
- processReporter?.step(step);
318
-
319
333
  // "tool_result" = resultado de herramienta → solo si pide enviarse al usuario
320
334
  if (step.type === "tool_result" && step.message) {
321
335
  try {
@@ -339,9 +353,15 @@ export async function runWebchatTurn(
339
353
  }
340
354
 
341
355
  const response = await d.runner.generate(generateOpts);
356
+ const { sealDelegationGroup } = await import("./delegation-groups");
357
+ const delegationGroup = payload.turnId
358
+ ? await sealDelegationGroup(payload.turnId)
359
+ : null;
342
360
 
343
361
  // Use streamed content from onToken, fallback to response.content
344
- const content = streamedContent || response.content?.trim() || "";
362
+ const content = delegationGroup
363
+ ? ""
364
+ : streamedContent || response.content?.trim() || "";
345
365
  log.info(`Response ready for session ${threadId} (${content.length} chars)`);
346
366
 
347
367
  send({ type: "typing", isTyping: false, sessionId });
@@ -404,14 +424,41 @@ export async function runWebchatTurn(
404
424
  }
405
425
  }
406
426
  } else if (content && payload.source !== "api") {
407
- // Rehydrated turn (crash recovery): nobody streamed this response, so
408
- // deliver the final content through the user's channel.
409
- await sendToUserChannel(channel, userId, content).catch((err) =>
410
- log.warn(`[runWebchatTurn] Failed to deliver crash-recovered response: ${(err as Error).message}`)
411
- );
427
+ // No live callback was attached to this job — either a genuine crash
428
+ // recovery, or (the common case for "delegation_summary"/"task_complete")
429
+ // a turn enqueued from a background job's terminal hook, which never has
430
+ // access to the original request's socket. Before falling back to the
431
+ // notification/toast path, check whether the user's browser still holds
432
+ // an open WS session under this exact sessionId — narration delivery
433
+ // (server.ts) already does this same lookup — and if so, push the
434
+ // response there as a normal chat message instead of a toast.
435
+ const liveSession = channel === "webchat" ? sessionManager.get(sessionId) : undefined;
436
+ const liveWs = liveSession?.ws?.readyState === 1 ? liveSession.ws : null;
437
+ if (liveWs) {
438
+ try {
439
+ liveWs.send(JSON.stringify({ type: "message", id: messageId, sessionId, content, isStep: false }));
440
+ liveWs.send(JSON.stringify({ type: "typing", isTyping: false, sessionId }));
441
+ } catch (err) {
442
+ log.warn(`[runWebchatTurn] Live push to open session failed, falling back to notification: ${(err as Error).message}`);
443
+ await sendToUserChannel(channel, userId, content).catch((err2) =>
444
+ log.warn(`[runWebchatTurn] Failed to deliver response: ${(err2 as Error).message}`)
445
+ );
446
+ }
447
+ } else {
448
+ // Rehydrated turn (crash recovery), or the user's browser isn't
449
+ // connected right now: deliver the final content through the user's
450
+ // channel (persisted notification for webchat; push API for the rest).
451
+ await sendToUserChannel(channel, userId, content).catch((err) =>
452
+ log.warn(`[runWebchatTurn] Failed to deliver crash-recovered response: ${(err as Error).message}`)
453
+ );
454
+ }
412
455
  }
413
456
 
414
- processReporter?.done("Listo");
457
+ if (delegationGroup) {
458
+ processReporter?.pending();
459
+ } else {
460
+ processReporter?.done("Listo");
461
+ }
415
462
  return content;
416
463
  } catch (error) {
417
464
  processReporter?.error("No se pudo completar la respuesta");
@@ -433,7 +480,9 @@ export async function enqueueChatTurn(input: {
433
480
  lane: string;
434
481
  payload: WebchatTurnPayload;
435
482
  live?: WebchatTurnLive;
483
+ idempotencyKey?: string;
436
484
  }): Promise<JobDoc> {
485
+ input.payload.turnId ??= crypto.randomUUID();
437
486
  const run = await createRun({
438
487
  thread_id: input.payload.source === "api" ? input.payload.sessionId : `webchat:${input.payload.sessionId}`,
439
488
  agent_id: input.payload.agentId ?? "",
@@ -450,5 +499,6 @@ export async function enqueueChatTurn(input: {
450
499
  run_id: run.id,
451
500
  payload: input.payload as unknown as Record<string, unknown>,
452
501
  callbacks: input.live?.sendRaw ? { sendRaw: input.live.sendRaw } : undefined,
502
+ idempotency_key: input.idempotencyKey,
453
503
  });
454
504
  }
@@ -11,6 +11,9 @@ export * from "./agent/conversation-store.ts";
11
11
  export * from "./agent/tool-selector.ts";
12
12
  export * from "./agent/skill-selector.ts";
13
13
  export * from "./agent/playbook-selector.ts";
14
+ export * from "./agent/catalog-selector.ts";
15
+ export * from "./agent/delegation-runtime.ts";
16
+ export * from "./agent/acceptance-checks.ts";
14
17
  export * from "./agent/llm-client.ts";
15
18
 
16
19
  // Channels
@@ -12,7 +12,7 @@ import { col, updateDoc } from "../storage/hive";
12
12
  import type { McpServerDoc } from "../storage/collections";
13
13
  import { logger } from "../utils/logger";
14
14
  import { loadMcpHeaders } from "../storage/crypto";
15
- import { syncMCPToolsToDB, syncMCPToolsToFTS, clearMCPToolsFromDB } from "./tool-sync";
15
+ import { syncMCPToolsToDB, syncMCPToolsToIndex, clearMCPToolsFromDB } from "./tool-sync";
16
16
  import type { MCPClientManager } from "@johpaz/hive-agents-mcp";
17
17
 
18
18
  const log = logger.child("mcp:hot-reload");
@@ -88,7 +88,7 @@ async function syncMCPServers(mcpManager: MCPClientManager): Promise<void> {
88
88
  mcpServerConfig.headers = mcpHeaders;
89
89
  }
90
90
 
91
- // Update MCP Manager config (auto-connects new servers)
91
+ // Register (or refresh) the server's config in the manager.
92
92
  const currentConfig = (mcpManager as any).config || { servers: {} };
93
93
  await mcpManager.updateConfig({
94
94
  ...currentConfig,
@@ -98,17 +98,24 @@ async function syncMCPServers(mcpManager: MCPClientManager): Promise<void> {
98
98
  },
99
99
  });
100
100
 
101
- // Wait a bit for connection to establish
102
- await new Promise(resolve => setTimeout(resolve, 500));
101
+ // updateConfig() only reconnects a server whose config changed AND was
102
+ // already connected — it never connects a server that's merely registered
103
+ // (true for both a brand-new server and one restored from DB on boot).
104
+ // Connect explicitly so "new to this process" always means "usable now".
105
+ await mcpManager.connectServer(serverName).catch((err) => {
106
+ log.error(`Failed to connect MCP server ${serverName}: ${err.message}`);
107
+ });
103
108
 
104
- // Get tools count and update status
109
+ // Get tools count and update status from the manager's real state —
110
+ // never assume success.
105
111
  const tools = mcpManager.getServerTools(serverName) || [];
106
- await updateDoc<McpServerDoc>("mcpServers", server.id, { status: "connected", tools_count: tools.length }).catch(() => { /* not found */ });
112
+ const connected = mcpManager.getServerStatus(serverName) === "connected";
113
+ await updateDoc<McpServerDoc>("mcpServers", server.id, { status: connected ? "connected" : "error", tools_count: tools.length }).catch(() => { /* not found */ });
107
114
 
108
115
  // Persist MCP tool definitions to DB and the HiveDB index
109
116
  // Use server.name (human-readable) for mcpToolId consistency with context-compiler
110
117
  await syncMCPToolsToDB(server.id || server.name, server.name || serverName, tools);
111
- await syncMCPToolsToFTS();
118
+ await syncMCPToolsToIndex();
112
119
 
113
120
  log.info(`MCP server ${serverName} connected: ${tools.length} tools available`);
114
121
  } catch (err) {
@@ -16,6 +16,3 @@ export function getMCPManager(): MCPClientManager | null {
16
16
  return _mcpManager;
17
17
  }
18
18
 
19
- export function hasMCPManager(): boolean {
20
- return _mcpManager !== null;
21
- }
@@ -38,7 +38,7 @@ export interface MCPToolDefinition {
38
38
  * resolves search results against executors by this exact string — so it
39
39
  * delegates to mcpToolFullName instead of duplicating the algorithm.
40
40
  */
41
- export function mcpToolId(serverName: string, toolName: string): string {
41
+ function mcpToolId(serverName: string, toolName: string): string {
42
42
  return mcpToolFullName(serverName, toolName)
43
43
  }
44
44
 
@@ -85,7 +85,7 @@ export async function syncMCPToolsToDB(
85
85
  *
86
86
  * This does a full replace of `type=mcp` documents to avoid drift.
87
87
  */
88
- export async function syncMCPToolsToFTS(): Promise<void> {
88
+ export async function syncMCPToolsToIndex(): Promise<void> {
89
89
  try {
90
90
  const mcpToolsCol = await col<McpToolDoc>("mcpTools")
91
91
  const mcpTools = (await mcpToolsCol.scan({})).map(e => e.doc).filter(t => t.active)
@@ -16,7 +16,7 @@ export interface RetryPolicy {
16
16
  maxDelayMs: number;
17
17
  }
18
18
 
19
- export const DEFAULT_RETRY_POLICY: RetryPolicy = {
19
+ const DEFAULT_RETRY_POLICY: RetryPolicy = {
20
20
  maxAttempts: 3,
21
21
  initialDelayMs: 1000,
22
22
  backoffMultiplier: 2,
@@ -10,6 +10,7 @@ import { logger } from "../utils/logger";
10
10
  import { notifyTaskCompletion } from "./integration";
11
11
  import { col, toIndexable, fromIndexable } from "../storage/hive";
12
12
  import type { CronJobDoc, TaskRunDoc } from "../storage/collections";
13
+ import { expireArtifacts } from "../artifacts/store";
13
14
  import type {
14
15
  CronJob,
15
16
  TaskRun,
@@ -707,7 +708,8 @@ export class CronScheduler {
707
708
  }
708
709
  }
709
710
 
710
- log.info("[runCleanup] Cleanup completed");
711
+ const artifacts = await expireArtifacts();
712
+ log.info(`[runCleanup] Cleanup completed (expired artifacts=${artifacts.expired})`);
711
713
  }
712
714
 
713
715
  /**
@@ -34,7 +34,7 @@ export function setSchedulerForCleanup(scheduler: { runCleanup(): Promise<void>
34
34
  * 4. Executes the tool if tool_name is specified
35
35
  * 5. Returns the agent response
36
36
  */
37
- export async function executeScheduledTask(job: CronJob): Promise<CronJobExecutionResult> {
37
+ async function executeScheduledTask(job: CronJob): Promise<CronJobExecutionResult> {
38
38
  log.info(`[execute] Processing job "${job.name}" (${job.id})`);
39
39
 
40
40
  try {
@@ -11,9 +11,10 @@
11
11
  * instead of `DELETE`+`INSERT`.
12
12
  */
13
13
 
14
- import { getHiveDb } from "./hivedb";
14
+ import { getHiveDb, getOpenHiveDb } from "./hivedb";
15
15
  import { col } from "./hive";
16
16
  import { seedAllData } from "./seed";
17
+ import { ensureSecretsBackend } from "./crypto";
17
18
 
18
19
  interface IndexSpec {
19
20
  collection: string;
@@ -36,6 +37,7 @@ const INDEXES: IndexSpec[] = [
36
37
  { collection: "agents", field: "parent_id" },
37
38
  { collection: "agents", field: "role" },
38
39
  { collection: "agents", field: "status" },
40
+ { collection: "agents", field: "source" },
39
41
  // Stage 2 — catalog
40
42
  { collection: "channels", field: "user_id" },
41
43
  { collection: "channels", field: "type" },
@@ -50,6 +52,8 @@ const INDEXES: IndexSpec[] = [
50
52
  { collection: "userChannels", field: "channel" },
51
53
  { collection: "refreshTokens", field: "token_hash", unique: true },
52
54
  { collection: "refreshTokens", field: "user_id" },
55
+ { collection: "notifications", field: "user_id" },
56
+ { collection: "notifications", field: "channel" },
53
57
  // Stage 4 — chat/ACE
54
58
  { collection: "traces", field: "thread_id" },
55
59
  { collection: "traces", field: "agent_id" },
@@ -64,6 +68,7 @@ const INDEXES: IndexSpec[] = [
64
68
  { collection: "agentRuns", field: "thread_id" },
65
69
  { collection: "agentRuns", field: "agent_id" },
66
70
  { collection: "agentRuns", field: "kind" },
71
+ { collection: "agentRuns", field: "catalog_agent_id" },
67
72
  { collection: "jobQueue", field: "status" },
68
73
  { collection: "jobQueue", field: "lane" },
69
74
  { collection: "jobQueue", field: "type" },
@@ -71,17 +76,29 @@ const INDEXES: IndexSpec[] = [
71
76
  { collection: "jobQueue", field: "idempotency_key" },
72
77
  { collection: "proofPackets", field: "run_id" },
73
78
  { collection: "proofPackets", field: "agent_id" },
79
+ { collection: "proofPackets", field: "catalog_agent_id" },
80
+ { collection: "artifacts", field: "run_id" },
81
+ { collection: "artifacts", field: "task_id" },
82
+ { collection: "artifacts", field: "user_id" },
83
+ { collection: "artifacts", field: "status" },
84
+ { collection: "agentProposals", field: "agent_id" },
85
+ { collection: "agentProposals", field: "status" },
86
+ { collection: "agentProposals", field: "type" },
74
87
  // Stage 6 — orchestration
75
- { collection: "projects", field: "user_id" },
76
- { collection: "projects", field: "agent_id" },
77
- { collection: "projects", field: "status" },
78
- { collection: "projects", field: "parent_id" },
79
- { collection: "tasks", field: "project_id" },
80
88
  { collection: "tasks", field: "agent_id" },
81
89
  { collection: "tasks", field: "status" },
90
+ { collection: "tasks", field: "catalog_agent_id" },
91
+ { collection: "tasks", field: "delegation_group_id" },
92
+ { collection: "delegationGroups", field: "turn_id", unique: true },
93
+ { collection: "delegationGroups", field: "thread_id" },
94
+ { collection: "delegationGroups", field: "status" },
82
95
  { collection: "agentBusMessages", field: "to_worker_id" },
83
96
  { collection: "agentBusMessages", field: "from_worker_id" },
84
97
  { collection: "agentBusMessages", field: "event_type" },
98
+ { collection: "narrationEvents", field: "turn_id" },
99
+ { collection: "narrationEvents", field: "thread_id" },
100
+ { collection: "narrationEvents", field: "user_id" },
101
+ { collection: "narrationEvents", field: "kind" },
85
102
  // Stage 7 — meeting
86
103
  { collection: "meetingSessions", field: "user_id" },
87
104
  { collection: "meetingSessions", field: "status" },
@@ -106,7 +123,10 @@ async function ensureSeedData(): Promise<void> {
106
123
  await seedAllData();
107
124
  }
108
125
 
109
- let bootstrapped = false;
126
+ // Bootstrap state belongs to a specific database instance. A boolean that
127
+ // survives closeHiveDb() can report a closed/replaced database as ready when
128
+ // tests or long-running processes open a fresh instance in the same runtime.
129
+ let bootstrappedDb: Awaited<ReturnType<typeof getHiveDb>> | null = null;
110
130
 
111
131
  /**
112
132
  * Idempotent entry point: opens the database, ensures indexes, reseeds the
@@ -114,17 +134,21 @@ let bootstrapped = false;
114
134
  * gateway boot.
115
135
  */
116
136
  export async function ensureHiveDb(): Promise<void> {
117
- await getHiveDb();
137
+ const db = await getHiveDb();
118
138
  await ensureIndexes();
139
+ // Mint the master key before anything can save an API key, so a fresh
140
+ // install is durable from the first keystroke rather than after a restart
141
+ // has already dropped the secret.
142
+ ensureSecretsBackend();
119
143
  await ensureSeedData();
120
144
 
121
145
  const meta = await col<{ value: number }>("meta");
122
146
  const existing = await meta.get("schemaVersion");
123
147
  if (!existing) await meta.put("schemaVersion", { value: 1 }, { expectedVersion: 0 });
124
148
 
125
- bootstrapped = true;
149
+ bootstrappedDb = db;
126
150
  }
127
151
 
128
152
  export function isBootstrapped(): boolean {
129
- return bootstrapped;
153
+ return bootstrappedDb !== null && bootstrappedDb === getOpenHiveDb();
130
154
  }