@polderlabs/bizar 3.23.1 → 4.2.0

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 (361) hide show
  1. package/README.md +83 -16
  2. package/bizar-dash/.bizar/activity.log +3 -0
  3. package/bizar-dash/.bizar/graph/.graphify_analysis.json +1540 -0
  4. package/bizar-dash/.bizar/graph/.graphify_labels.json +1 -0
  5. package/bizar-dash/.bizar/graph/GRAPH_REPORT.md +404 -0
  6. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/0661b816358db84dfdb7f10443db8a61152fd20b3fee950caf8fbf32920a1790.json +1 -0
  7. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/16da06d774142a6e5d74829ad982531286a6193ef798de8f593db029e123ec32.json +1 -0
  8. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/27e5697c01254c69c64c5a33896669073b40afb5ba88375102ae77fa5404136d.json +1 -0
  9. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/532997898027254aa4c0932243dc71d2f55888181232b65974961934997dc85b.json +1 -0
  10. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/84e3451a64c7f99f0cd6a88b0748d7426780486f53ab4935b7476b28c08f8293.json +1 -0
  11. package/bizar-dash/.bizar/graph/cache/ast/v0.8.46/88e5ea5f3e78fa69353fe9e6a8d1a05391d54605e25600cb125531eb5a6432ff.json +1 -0
  12. package/bizar-dash/.bizar/graph/cache/stat-index.json +1 -0
  13. package/bizar-dash/.bizar/graph/graph.html +307 -0
  14. package/bizar-dash/.bizar/graph/graph.json +40267 -0
  15. package/bizar-dash/.bizar/graph/manifest.json +762 -0
  16. package/bizar-dash/.graphifyignore +40 -0
  17. package/bizar-dash/.obsidian/README.md +14 -0
  18. package/bizar-dash/.obsidian/daily/2026-06-25.md +9 -0
  19. package/bizar-dash/.obsidian/vault.json +7 -0
  20. package/bizar-dash/.od-skills/web-prototype-e1429c1737/SKILL.md +103 -0
  21. package/bizar-dash/.od-skills/web-prototype-e1429c1737/assets/template.html +338 -0
  22. package/bizar-dash/.od-skills/web-prototype-e1429c1737/example.html +81 -0
  23. package/bizar-dash/.od-skills/web-prototype-e1429c1737/open-design.json +172 -0
  24. package/bizar-dash/.od-skills/web-prototype-e1429c1737/references/checklist.md +44 -0
  25. package/bizar-dash/.od-skills/web-prototype-e1429c1737/references/layouts.md +247 -0
  26. package/bizar-dash/CHANGELOG.md +474 -0
  27. package/bizar-dash/DESIGN.md +136 -0
  28. package/bizar-dash/dist/assets/main-B3RgW6FS.js +331 -0
  29. package/bizar-dash/dist/assets/main-B3RgW6FS.js.map +1 -0
  30. package/bizar-dash/dist/assets/main-DlJ8wgLR.css +1 -0
  31. package/bizar-dash/dist/assets/mobile-CsZQAswA.css +1 -0
  32. package/bizar-dash/dist/assets/mobile-DbxIw8BG.js +2 -0
  33. package/bizar-dash/dist/assets/mobile-DbxIw8BG.js.map +1 -0
  34. package/bizar-dash/dist/assets/mobile-Dvq2d53Y.js +354 -0
  35. package/bizar-dash/dist/assets/mobile-Dvq2d53Y.js.map +1 -0
  36. package/bizar-dash/dist/index.html +40 -0
  37. package/bizar-dash/dist/mobile.html +22 -0
  38. package/bizar-dash/plans/debug-plan/comments.json +1 -0
  39. package/bizar-dash/plans/debug-plan/meta.json +10 -0
  40. package/bizar-dash/plans/debug-plan/plan.json +174 -0
  41. package/bizar-dash/scripts/smoke-bg-retry.mjs +246 -0
  42. package/bizar-dash/src/cli/dashboard-ports.mjs +488 -0
  43. package/bizar-dash/src/cli.mjs +522 -0
  44. package/bizar-dash/src/server/activity-log.mjs +174 -0
  45. package/bizar-dash/src/server/agents-store.mjs +465 -0
  46. package/bizar-dash/src/server/api.mjs +138 -0
  47. package/bizar-dash/src/server/artifact-template.html +810 -0
  48. package/bizar-dash/src/server/artifacts-store.mjs +733 -0
  49. package/bizar-dash/src/server/auth.mjs +381 -0
  50. package/bizar-dash/src/server/background-store.mjs +447 -0
  51. package/bizar-dash/src/server/bg-poller.mjs +305 -0
  52. package/bizar-dash/src/server/bg-retry.mjs +574 -0
  53. package/bizar-dash/src/server/browser.mjs +40 -0
  54. package/bizar-dash/src/server/diagnostics-store.mjs +148 -0
  55. package/bizar-dash/src/server/dialog-poller.mjs +105 -0
  56. package/bizar-dash/src/server/dialog-store.mjs +177 -0
  57. package/bizar-dash/src/server/glyphs/mdx-compiler.mjs +583 -0
  58. package/bizar-dash/src/server/lib/path-safe.mjs +283 -0
  59. package/bizar-dash/src/server/memory-git.mjs +329 -0
  60. package/bizar-dash/src/server/memory-lightrag.mjs +767 -0
  61. package/bizar-dash/src/server/memory-schema.mjs +145 -0
  62. package/bizar-dash/src/server/memory-secrets.mjs +84 -0
  63. package/bizar-dash/src/server/memory-store.mjs +471 -0
  64. package/bizar-dash/src/server/mod-security.mjs +398 -0
  65. package/bizar-dash/src/server/mods-loader.mjs +1067 -0
  66. package/bizar-dash/src/server/notifications-store.mjs +243 -0
  67. package/bizar-dash/src/server/obsidian-store.mjs +318 -0
  68. package/bizar-dash/src/server/opencode-runner.mjs +279 -0
  69. package/bizar-dash/src/server/pair-store.mjs +138 -0
  70. package/bizar-dash/src/server/projects-store.mjs +364 -0
  71. package/bizar-dash/src/server/providers-store.mjs +789 -0
  72. package/bizar-dash/src/server/routes/_shared.mjs +415 -0
  73. package/bizar-dash/src/server/routes/activity.mjs +110 -0
  74. package/bizar-dash/src/server/routes/agents.mjs +134 -0
  75. package/bizar-dash/src/server/routes/artifacts.mjs +279 -0
  76. package/bizar-dash/src/server/routes/auth.mjs +69 -0
  77. package/bizar-dash/src/server/routes/background.mjs +165 -0
  78. package/bizar-dash/src/server/routes/chat.mjs +485 -0
  79. package/bizar-dash/src/server/routes/config.mjs +129 -0
  80. package/bizar-dash/src/server/routes/diagnostics.mjs +50 -0
  81. package/bizar-dash/src/server/routes/dialogs.mjs +86 -0
  82. package/bizar-dash/src/server/routes/fs.mjs +429 -0
  83. package/bizar-dash/src/server/routes/history.mjs +78 -0
  84. package/bizar-dash/src/server/routes/memory.mjs +658 -0
  85. package/bizar-dash/src/server/routes/misc.mjs +89 -0
  86. package/bizar-dash/src/server/routes/mods.mjs +359 -0
  87. package/bizar-dash/src/server/routes/notifications.mjs +54 -0
  88. package/bizar-dash/src/server/routes/obsidian.mjs +239 -0
  89. package/bizar-dash/src/server/routes/opencode-sessions.mjs +55 -0
  90. package/bizar-dash/src/server/routes/overview.mjs +91 -0
  91. package/bizar-dash/src/server/routes/pair.mjs +67 -0
  92. package/bizar-dash/src/server/routes/projects.mjs +175 -0
  93. package/bizar-dash/src/server/routes/providers.mjs +47 -0
  94. package/bizar-dash/src/server/routes/schedules.mjs +104 -0
  95. package/bizar-dash/src/server/routes/settings.mjs +51 -0
  96. package/bizar-dash/src/server/routes/skills.mjs +76 -0
  97. package/bizar-dash/src/server/routes/tasks.mjs +468 -0
  98. package/bizar-dash/src/server/routes/themes.mjs +51 -0
  99. package/bizar-dash/src/server/routes-v2/auth.mjs +59 -0
  100. package/bizar-dash/src/server/routes-v2/events.mjs +107 -0
  101. package/bizar-dash/src/server/routes-v2/health.mjs +21 -0
  102. package/bizar-dash/src/server/routes-v2/index.mjs +90 -0
  103. package/bizar-dash/src/server/routes-v2/sessions.mjs +111 -0
  104. package/bizar-dash/src/server/schedules-runner.mjs +369 -0
  105. package/bizar-dash/src/server/schedules-store.mjs +268 -0
  106. package/bizar-dash/src/server/search-store.mjs +220 -0
  107. package/bizar-dash/src/server/serve-info.mjs +684 -0
  108. package/bizar-dash/src/server/server.mjs +796 -0
  109. package/bizar-dash/src/server/settings-store.mjs +45 -0
  110. package/bizar-dash/src/server/skills-store.mjs +300 -0
  111. package/bizar-dash/src/server/state.mjs +437 -0
  112. package/bizar-dash/src/server/tailscale-store.mjs +113 -0
  113. package/bizar-dash/src/server/task-delegator.mjs +824 -0
  114. package/bizar-dash/src/server/tasks-store.mjs +508 -0
  115. package/bizar-dash/src/server/tui.mjs +923 -0
  116. package/bizar-dash/src/server/update-store.mjs +168 -0
  117. package/bizar-dash/src/server/v2-auth-file.mjs +99 -0
  118. package/bizar-dash/src/server/v2-event-bus.mjs +128 -0
  119. package/bizar-dash/src/server/watcher.mjs +81 -0
  120. package/bizar-dash/src/server/yaml.mjs +238 -0
  121. package/bizar-dash/src/web/App.tsx +718 -0
  122. package/bizar-dash/src/web/MobileApp.tsx +408 -0
  123. package/bizar-dash/src/web/components/ArtifactCreateDialog.tsx +95 -0
  124. package/bizar-dash/src/web/components/ArtifactListDialog.tsx +55 -0
  125. package/bizar-dash/src/web/components/ArtifactViewer.tsx +143 -0
  126. package/bizar-dash/src/web/components/AuditDialog.tsx +79 -0
  127. package/bizar-dash/src/web/components/BgStatusBadge.tsx +32 -0
  128. package/bizar-dash/src/web/components/Button.tsx +56 -0
  129. package/bizar-dash/src/web/components/CanvasContextMenu.tsx +68 -0
  130. package/bizar-dash/src/web/components/Card.tsx +40 -0
  131. package/bizar-dash/src/web/components/CollapsibleSection.tsx +72 -0
  132. package/bizar-dash/src/web/components/CommandDialog.tsx +66 -0
  133. package/bizar-dash/src/web/components/EmptyState.tsx +30 -0
  134. package/bizar-dash/src/web/components/FileBrowser.tsx +633 -0
  135. package/bizar-dash/src/web/components/HelpDialog.tsx +55 -0
  136. package/bizar-dash/src/web/components/KillConfirmDialog.tsx +88 -0
  137. package/bizar-dash/src/web/components/Modal.tsx +215 -0
  138. package/bizar-dash/src/web/components/Notifications.tsx +241 -0
  139. package/bizar-dash/src/web/components/SearchModal.tsx +224 -0
  140. package/bizar-dash/src/web/components/Sidebar.tsx +66 -0
  141. package/bizar-dash/src/web/components/Spinner.tsx +19 -0
  142. package/bizar-dash/src/web/components/StatusBadge.tsx +25 -0
  143. package/bizar-dash/src/web/components/Tag.tsx +28 -0
  144. package/bizar-dash/src/web/components/Toast.tsx +150 -0
  145. package/bizar-dash/src/web/components/Topbar.tsx +368 -0
  146. package/bizar-dash/src/web/components/VisualPlanDialog.tsx +58 -0
  147. package/bizar-dash/src/web/components/chat/AgentChip.tsx +68 -0
  148. package/bizar-dash/src/web/components/chat/ChatBubble.tsx +60 -0
  149. package/bizar-dash/src/web/components/chat/ChatThread.tsx +88 -0
  150. package/bizar-dash/src/web/components/chat/ChatTopBar.tsx +50 -0
  151. package/bizar-dash/src/web/components/chat/Composer.tsx +164 -0
  152. package/bizar-dash/src/web/components/chat/ConfirmModal.tsx +54 -0
  153. package/bizar-dash/src/web/components/chat/EmptyState.tsx +21 -0
  154. package/bizar-dash/src/web/components/chat/FirstRunGreeting.tsx +18 -0
  155. package/bizar-dash/src/web/components/chat/FloatingComposer.tsx +32 -0
  156. package/bizar-dash/src/web/components/chat/InfoPanel.tsx +119 -0
  157. package/bizar-dash/src/web/components/chat/LoadingSkeleton.tsx +19 -0
  158. package/bizar-dash/src/web/components/chat/MessageBubble.tsx +60 -0
  159. package/bizar-dash/src/web/components/chat/SessionList.tsx +153 -0
  160. package/bizar-dash/src/web/components/chat/StreamingIndicator.tsx +9 -0
  161. package/bizar-dash/src/web/components/chat/SuggestionCards.tsx +55 -0
  162. package/bizar-dash/src/web/components/chat/WelcomeScreen.tsx +36 -0
  163. package/bizar-dash/src/web/components/chat/index.ts +20 -0
  164. package/bizar-dash/src/web/components/chat/useAutoGrowTextarea.ts +18 -0
  165. package/bizar-dash/src/web/components/chat/useChat.ts +219 -0
  166. package/bizar-dash/src/web/components/chat/useSlashCommands.ts +47 -0
  167. package/bizar-dash/src/web/index.html +37 -0
  168. package/bizar-dash/src/web/lib/api.ts +193 -0
  169. package/bizar-dash/src/web/lib/markdown.tsx +59 -0
  170. package/bizar-dash/src/web/lib/types.ts +668 -0
  171. package/bizar-dash/src/web/lib/utils.ts +114 -0
  172. package/bizar-dash/src/web/lib/ws.ts +176 -0
  173. package/bizar-dash/src/web/main.tsx +34 -0
  174. package/bizar-dash/src/web/mobile/MobileApp.tsx +278 -0
  175. package/bizar-dash/src/web/mobile/MobileBottomNav.tsx +38 -0
  176. package/bizar-dash/src/web/mobile/MobileTopbar.tsx +115 -0
  177. package/bizar-dash/src/web/mobile/components/MobileBottomSheet.tsx +182 -0
  178. package/bizar-dash/src/web/mobile/components/MobileListItem.tsx +64 -0
  179. package/bizar-dash/src/web/mobile/components/MobileModal.tsx +123 -0
  180. package/bizar-dash/src/web/mobile/views/MobileActivity.tsx +273 -0
  181. package/bizar-dash/src/web/mobile/views/MobileAgents.tsx +374 -0
  182. package/bizar-dash/src/web/mobile/views/MobileArtifactCanvas.tsx +439 -0
  183. package/bizar-dash/src/web/mobile/views/MobileArtifacts.tsx +143 -0
  184. package/bizar-dash/src/web/mobile/views/MobileChat.tsx +180 -0
  185. package/bizar-dash/src/web/mobile/views/MobileConfig.tsx +175 -0
  186. package/bizar-dash/src/web/mobile/views/MobileHistory.tsx +191 -0
  187. package/bizar-dash/src/web/mobile/views/MobileMods.tsx +149 -0
  188. package/bizar-dash/src/web/mobile/views/MobileMore.tsx +121 -0
  189. package/bizar-dash/src/web/mobile/views/MobileNotifications.tsx +137 -0
  190. package/bizar-dash/src/web/mobile/views/MobilePlans.tsx +26 -0
  191. package/bizar-dash/src/web/mobile/views/MobileSchedules.tsx +685 -0
  192. package/bizar-dash/src/web/mobile/views/MobileSearchModal.tsx +172 -0
  193. package/bizar-dash/src/web/mobile/views/MobileSettings.tsx +388 -0
  194. package/bizar-dash/src/web/mobile/views/MobileSkills.tsx +153 -0
  195. package/bizar-dash/src/web/mobile/views/MobileTasks.tsx +564 -0
  196. package/bizar-dash/src/web/mobile.html +20 -0
  197. package/bizar-dash/src/web/mobile.tsx +13 -0
  198. package/bizar-dash/src/web/styles/chat.css +198 -0
  199. package/bizar-dash/src/web/styles/glyphs.css +960 -0
  200. package/bizar-dash/src/web/styles/main.css +8855 -0
  201. package/bizar-dash/src/web/styles/mobile-chat.css +5 -0
  202. package/bizar-dash/src/web/styles/mobile.css +1960 -0
  203. package/bizar-dash/src/web/views/Activity.tsx +1203 -0
  204. package/bizar-dash/src/web/views/Agents.tsx +701 -0
  205. package/bizar-dash/src/web/views/Artifacts.tsx +1480 -0
  206. package/bizar-dash/src/web/views/BackgroundAgents.tsx +450 -0
  207. package/bizar-dash/src/web/views/Chat.tsx +190 -0
  208. package/bizar-dash/src/web/views/Config.tsx +2063 -0
  209. package/bizar-dash/src/web/views/History.tsx +335 -0
  210. package/bizar-dash/src/web/views/ModView.tsx +207 -0
  211. package/bizar-dash/src/web/views/Mods.tsx +693 -0
  212. package/bizar-dash/src/web/views/Overview.tsx +812 -0
  213. package/bizar-dash/src/web/views/Providers.tsx +302 -0
  214. package/bizar-dash/src/web/views/Schedules.tsx +802 -0
  215. package/bizar-dash/src/web/views/Settings.tsx +1787 -0
  216. package/bizar-dash/src/web/views/Skills.tsx +431 -0
  217. package/bizar-dash/src/web/views/Tasks.tsx +1523 -0
  218. package/bizar-dash/src/web/views/glyphs/GlyphRenderer.tsx +613 -0
  219. package/bizar-dash/src/web/views/glyphs/components.tsx +1098 -0
  220. package/bizar-dash/templates/mod/FORMAT.md +76 -0
  221. package/bizar-dash/templates/mod/hello-mod/README.md +19 -0
  222. package/bizar-dash/templates/mod/hello-mod/agents/greeter.md +8 -0
  223. package/bizar-dash/templates/mod/hello-mod/commands/hello.md +6 -0
  224. package/bizar-dash/templates/mod/hello-mod/mod.json +20 -0
  225. package/bizar-dash/templates/mod/hello-mod/routes/ping.mjs +9 -0
  226. package/bizar-dash/templates/mod/hello-mod/views/HelloView.tsx +10 -0
  227. package/bizar-dash/tests/dashboard-ports.test.mjs +138 -0
  228. package/bizar-dash/tests/graphify-mod-spawn.node.test.mjs +90 -0
  229. package/bizar-dash/tests/memory-cli.test.mjs +542 -0
  230. package/bizar-dash/tests/memory-config.test.mjs +422 -0
  231. package/bizar-dash/tests/memory-git.test.mjs +246 -0
  232. package/bizar-dash/tests/memory-lightrag.test.mjs +153 -0
  233. package/bizar-dash/tests/memory-protocol-drift.test.mjs +45 -0
  234. package/bizar-dash/tests/memory-schema.test.mjs +198 -0
  235. package/bizar-dash/tests/memory-secrets.test.mjs +121 -0
  236. package/bizar-dash/tests/memory-store.test.mjs +390 -0
  237. package/bizar-dash/tests/memory-sync.test.mjs +141 -0
  238. package/bizar-dash/tests/mod-instructions.node.test.mjs +188 -0
  239. package/bizar-dash/tests/mod-security.test.mjs +273 -0
  240. package/bizar-dash/tests/mod-upgrade.node.test.mjs +357 -0
  241. package/bizar-dash/tests/no-agent-browser.node.test.mjs +98 -0
  242. package/bizar-dash/tests/obsidian-back-compat.test.mjs +199 -0
  243. package/bizar-dash/tests/opencode-runner.test.mjs +172 -0
  244. package/bizar-dash/tests/path-safe.test.mjs +108 -0
  245. package/bizar-dash/tests/providers-store-backup-keys.node.test.mjs +333 -0
  246. package/bizar-dash/tests/smoke-v2.mjs +212 -0
  247. package/bizar-dash/tests/strip-thinking.test.mjs +175 -0
  248. package/bizar-dash/tests/submit-feedback.test.mjs +353 -0
  249. package/bizar-dash/tests/tmux-wrap.test.mjs +145 -0
  250. package/bizar-dash/tests/yaml.test.mjs +128 -0
  251. package/bizar-dash/tsconfig.json +23 -0
  252. package/bizar-dash/vite.config.ts +27 -0
  253. package/cli/atomic.mjs +73 -0
  254. package/cli/banner.mjs +1 -1
  255. package/cli/bin.mjs +44 -47
  256. package/cli/bootstrap.mjs +1 -1
  257. package/cli/copy.mjs +25 -16
  258. package/cli/dev-link.mjs +17 -1
  259. package/cli/doctor.mjs +4 -4
  260. package/cli/doctor.test.mjs +2 -2
  261. package/cli/init.mjs +135 -1
  262. package/cli/install.mjs +31 -39
  263. package/cli/memory-constants.mjs +59 -0
  264. package/cli/memory.mjs +1436 -0
  265. package/cli/service.mjs +5 -6
  266. package/cli/utils.mjs +6 -3
  267. package/config/AGENTS.md +7 -7
  268. package/config/agents/_shared/AGENT_BASELINE.md +59 -61
  269. package/config/opencode.json +13 -38
  270. package/config/skills/memory-protocol/SKILL.md +105 -0
  271. package/config/skills/obsidian/SKILL.md +270 -65
  272. package/install.sh +59 -19
  273. package/package.json +49 -14
  274. package/packages/sdk/LICENSE +21 -0
  275. package/packages/sdk/README.md +80 -0
  276. package/packages/sdk/src/client.ts +183 -0
  277. package/packages/sdk/src/errors.ts +120 -0
  278. package/packages/sdk/src/events.ts +153 -0
  279. package/packages/sdk/src/index.ts +63 -0
  280. package/packages/sdk/src/types.ts +176 -0
  281. package/packages/sdk/src/version.ts +4 -0
  282. package/packages/sdk/tests/client.test.ts +217 -0
  283. package/packages/sdk/tests/errors.test.ts +108 -0
  284. package/packages/sdk/tests/events.test.ts +139 -0
  285. package/packages/sdk/tests/fixtures/fetch-mock.ts +152 -0
  286. package/packages/sdk/tests/fixtures/sse-mock.ts +30 -0
  287. package/packages/sdk/tsconfig.json +25 -0
  288. package/packages/sdk/vitest.config.ts +9 -0
  289. package/plugins/bizar/LICENSE +21 -0
  290. package/plugins/bizar/README.md +448 -0
  291. package/plugins/bizar/dist/index.js +29901 -0
  292. package/plugins/bizar/index.ts +1491 -0
  293. package/plugins/bizar/scripts/check-forbidden-imports.sh +33 -0
  294. package/plugins/bizar/src/background-state.ts +551 -0
  295. package/plugins/bizar/src/background.ts +1250 -0
  296. package/plugins/bizar/src/commands-impl.ts +464 -0
  297. package/plugins/bizar/src/commands.ts +1168 -0
  298. package/plugins/bizar/src/dashboard-client.ts +233 -0
  299. package/plugins/bizar/src/event-stream.ts +606 -0
  300. package/plugins/bizar/src/fingerprint.ts +120 -0
  301. package/plugins/bizar/src/handoff.ts +79 -0
  302. package/plugins/bizar/src/http-client.ts +467 -0
  303. package/plugins/bizar/src/key-rotation.ts +218 -0
  304. package/plugins/bizar/src/logger.ts +144 -0
  305. package/plugins/bizar/src/loop.ts +176 -0
  306. package/plugins/bizar/src/opencode-runner.ts +390 -0
  307. package/plugins/bizar/src/options.ts +421 -0
  308. package/plugins/bizar/src/plan-fs.ts +323 -0
  309. package/plugins/bizar/src/reasoning-clean.ts +454 -0
  310. package/plugins/bizar/src/report.ts +178 -0
  311. package/plugins/bizar/src/research-prompt.ts +35 -0
  312. package/plugins/bizar/src/serve-info.ts +228 -0
  313. package/plugins/bizar/src/serve.ts +496 -0
  314. package/plugins/bizar/src/settings.ts +349 -0
  315. package/plugins/bizar/src/state.ts +298 -0
  316. package/plugins/bizar/src/tools/bg-collect.ts +104 -0
  317. package/plugins/bizar/src/tools/bg-get-comments.ts +239 -0
  318. package/plugins/bizar/src/tools/bg-kill.ts +87 -0
  319. package/plugins/bizar/src/tools/bg-spawn.ts +401 -0
  320. package/plugins/bizar/src/tools/bg-status.ts +99 -0
  321. package/plugins/bizar/src/tools/open-kb.ts +191 -0
  322. package/plugins/bizar/src/tools/plan-action.ts +767 -0
  323. package/plugins/bizar/src/tools/read-glyph-feedback.ts +170 -0
  324. package/plugins/bizar/src/tools/wait-for-feedback.ts +402 -0
  325. package/plugins/bizar/tests/attach-handler-bug.test.ts +169 -0
  326. package/plugins/bizar/tests/background-state.test.ts +277 -0
  327. package/plugins/bizar/tests/background.test.ts +402 -0
  328. package/plugins/bizar/tests/block.test.ts +195 -0
  329. package/plugins/bizar/tests/canonical-key-order.test.ts +75 -0
  330. package/plugins/bizar/tests/commands-impl.test.ts +442 -0
  331. package/plugins/bizar/tests/commands.test.ts +584 -0
  332. package/plugins/bizar/tests/config.test.ts +122 -0
  333. package/plugins/bizar/tests/dashboard-client.test.ts +159 -0
  334. package/plugins/bizar/tests/dispose.test.ts +336 -0
  335. package/plugins/bizar/tests/event-stream.test.ts +409 -0
  336. package/plugins/bizar/tests/event.test.ts +262 -0
  337. package/plugins/bizar/tests/fingerprint.test.ts +162 -0
  338. package/plugins/bizar/tests/http-client.test.ts +404 -0
  339. package/plugins/bizar/tests/init-helpers.test.ts +203 -0
  340. package/plugins/bizar/tests/integration/slash-command.test.ts +348 -0
  341. package/plugins/bizar/tests/integration/tool-routing.test.ts +314 -0
  342. package/plugins/bizar/tests/key-rotation.test.ts +396 -0
  343. package/plugins/bizar/tests/loop.test.ts +397 -0
  344. package/plugins/bizar/tests/options.test.ts +276 -0
  345. package/plugins/bizar/tests/reasoning-clean.test.ts +422 -0
  346. package/plugins/bizar/tests/serve.test.ts +339 -0
  347. package/plugins/bizar/tests/settings.test.ts +351 -0
  348. package/plugins/bizar/tests/stall-think.test.ts +750 -0
  349. package/plugins/bizar/tests/state.test.ts +276 -0
  350. package/plugins/bizar/tests/tools/bg-collect.test.ts +337 -0
  351. package/plugins/bizar/tests/tools/bg-get-comments.test.ts +485 -0
  352. package/plugins/bizar/tests/tools/bg-kill.test.ts +235 -0
  353. package/plugins/bizar/tests/tools/bg-spawn-delegation.test.ts +147 -0
  354. package/plugins/bizar/tests/tools/bg-spawn.test.ts +311 -0
  355. package/plugins/bizar/tests/tools/bg-status.test.ts +217 -0
  356. package/plugins/bizar/tests/tools/opencode-runner.test.ts +115 -0
  357. package/plugins/bizar/tests/tools/plan-action.test.ts +599 -0
  358. package/plugins/bizar/tests/tools/read-glyph-feedback.test.ts +253 -0
  359. package/plugins/bizar/tests/tools/wait-for-feedback.test.ts +390 -0
  360. package/plugins/bizar/tests/update-deadlock.test.ts +145 -0
  361. package/plugins/bizar/tsconfig.json +29 -0
@@ -1,101 +1,306 @@
1
1
  ---
2
2
  name: obsidian
3
- description: Use the project's Obsidian vault (`.obsidian/`) for persistent project knowledge. Read it before decisions, write to it after work. Every Bizar agent follows this rule.
4
- version: 1
3
+ description: Use the Bizar Memory Service for persistent project knowledge — local Obsidian-compatible Markdown + Git-shared sync. Read vault entries before non-trivial decisions; write after meaningful work. Three layers: Markdown (truth) Git (collaboration) → LightRAG (derived index, Phase 2).
4
+ version: 2
5
5
  ---
6
6
 
7
- # Obsidian Vault — Project Knowledge
7
+ # Bizar Memory Service — Project Knowledge
8
8
 
9
- **Project knowledge lives in `.obsidian/`. Read it before you start, write to it when you learn.**
9
+ **The Bizar Memory Service is the project's persistent knowledge layer.** It replaces the disabled Hindsight MCP service. Every Bizar project uses the same three-layer architecture; only the backend mode (`local-only` vs `managed`) and the vault location differ.
10
10
 
11
- Every Bizar project has an Obsidian vault at `.obsidian/` with index files (`index/`), agent-specific memory (`agents/`), bug postmortems (`bugs/`), design decisions, and ongoing work notes. The user has been working on this project — their notes contain the real context, the gotchas, the failed approaches, the preferred patterns. **Read the relevant vault entries before making any non-trivial decision.**
11
+ The user has been working on this project — their notes contain the real context, the gotchas, the failed approaches, the preferred patterns. **Read the relevant vault entries before making any non-trivial decision.**
12
12
 
13
- ## When to read
13
+ ## Quick Start for Agents
14
14
 
15
- - At the start of every session (skim the index)
16
- - Before any non-trivial implementation decision
17
- - When you're about to suggest something the user has already tried
18
- - When the codebase feels like it's working around something you don't understand
19
- - When you encounter a `// FIXME` or `// HACK` comment — there's probably a vault entry explaining it
15
+ **First-time setup** (if `.bizar/memory.json` is missing):
16
+ ```bash
17
+ bizar memory setup --remote git@github.com:you/bizar-memory.git
18
+ bizar memory status # confirm vault reachable
19
+ bizar memory doctor # schema + secrets + git state
20
+ ```
20
21
 
21
- ## When to write
22
+ Memory is accessed via the `bizar memory` CLI — agents have `bash: allow` and can invoke it directly.
22
23
 
23
- - After completing a meaningful piece of work
24
- - On discovering a bug or postmortem
25
- - When you find a pattern that should be reused
26
- - When the user corrects you
27
- - When you make a design decision that should be remembered
24
+ **Find the vault root:**
25
+ ```bash
26
+ bizar memory status
27
+ ```
28
28
 
29
- ## What to write
29
+ **Search memory:**
30
+ ```bash
31
+ bizar memory search "<query>"
32
+ ```
30
33
 
31
- Date-stamped entry under the appropriate category:
34
+ **Read a specific note:**
35
+ ```bash
36
+ # 1. List notes to find the path
37
+ bizar memory list 2>/dev/null || ls ~/.local/share/bizar/memory/bizar-memory/projects/<projectId>/
38
+ # 2. Read the note
39
+ cat ~/.local/share/bizar/memory/bizar-memory/projects/<projectId>/<relpath>
40
+ ```
32
41
 
33
- - `index/` high-level project context, decisions, handoffs
34
- - `bugs/` — bug postmortems, root-cause analyses
35
- - `agents/<name>/` — per-agent memory (what you learned, what to do differently)
36
- - `reference/` — external API docs, tool notes
37
- - `workflows/` — multi-step procedures
38
- - `daily/` — running log of what happened today
42
+ **Write a new note:**
43
+ ```bash
44
+ bizar memory write <relpath> \
45
+ --type <type> \
46
+ --status active \
47
+ --confidence verified \
48
+ --tag <tag1> --tag <tag2> \
49
+ --body "<body text>"
50
+ ```
39
51
 
40
- Each entry:
52
+ `<relpath>` is relative to the project namespace root (e.g. `decisions/0001-foo.md`). Do NOT include the `projects/<projectId>/` prefix — that double-nests.
41
53
 
42
- ```markdown
43
- ---
44
- title: "What happened"
45
- date: 2026-06-26
46
- tags: [tag1, tag2]
47
- ---
54
+ **Commit and push (if shared vault):**
55
+ ```bash
56
+ bizar memory sync
57
+ ```
58
+
59
+ **Health check:**
60
+ ```bash
61
+ bizar memory doctor
62
+ ```
48
63
 
49
- # Title
64
+ ## The three layers
50
65
 
51
- ## Context
52
- What was happening. What was the user trying to do.
66
+ | Layer | Role | Backed by | Write path |
67
+ |---|---|---|---|
68
+ | **Markdown** | Canonical truth | Obsidian-flavoured `.md` files on disk | Author writes here; this is the only layer that is authoritative |
69
+ | **Git** | Collaboration / history | The vault directory is a Git repo (local-only mode keeps it as a local repo with no remote) | The `bizar memory sync` orchestrator runs `git add/commit/push` after a write |
70
+ | **LightRAG** (Phase 2) | Derived search index | A LightRAG server (disabled by default in `memory.json`) | NEVER write here directly — always rebuild from Markdown via `bizar memory reindex` |
53
71
 
54
- ## Lesson
55
- What you learned. Why it matters.
72
+ **Rule of thumb:** if you wanted to "update the project's memory," write Markdown. Git and LightRAG follow.
56
73
 
57
- ## Pattern
58
- What to do next time. Code examples welcome.
74
+ ## Vault location
59
75
 
60
- ## Files changed
61
- - path/to/file.ts (added, modified, removed)
76
+ The root of the vault is determined by `.bizar/memory.json` in the active project. Two modes:
77
+
78
+ - **`local-only` (default)** — vault is `.obsidian/` inside this project. Single-machine. Stays out of any cross-project repo. Use this when the project is solo or when the project itself is private.
79
+ - **`managed`** — vault is `~/.local/share/bizar/memory/<repoName>/` (a user-level shared repo). Multiple projects contribute to the same Git repo under per-project namespaces. Use this when you want cross-project search and a single source of truth across all your Bizar projects.
80
+
81
+ `bizar memory status` prints the active mode and resolved paths; `bizar memory doctor` validates the vault is reachable and the Git state is consistent.
82
+
83
+ ## The three namespaces
84
+
85
+ Namespaces live at the vault root. Pick a namespace by deciding the SCOPE of the note, not the project.
86
+
87
+ | Namespace | Path (under vault root) | When to write here |
88
+ |---|---|---|
89
+ | **project** | `projects/<projectId>/` | Anything specific to THIS project — design decisions, postmortems, agent-tuning notes, project-local gotchas, daily logs of what happened in this repo |
90
+ | **global** | `global/bizar/` | Anything that applies to Bizar AS A SYSTEM, regardless of project — agent patterns, model-routing rules, CLI conventions, cross-project gotchas that should reach every project you work on |
91
+ | **user** | `users/<userId>/` | Anything that is purely personal — your preferences, your scratch notes, your "things I keep forgetting" |
92
+
93
+ Resolution rule: **memory root = `~/.local/share/bizar/memory/<repoName>/` (or `.obsidian/`) + the namespace you picked**. The `projectId` is the basename of the project root (e.g. `bizar` for `/path/to/bizar`); the `userId` is the OS username.
94
+
95
+ When in doubt, write to **project**. Promote to **global** only when the pattern repeats across another project; demote to **user** only when it's purely personal preference.
96
+
97
+ ## How to read vault entries
98
+
99
+ ### Via the dashboard REST API (canonical)
100
+
101
+ ```bash
102
+ # List notes under a namespace
103
+ curl -s http://127.0.0.1:4321/api/memory/notes?namespace=projects/bizar | jq
104
+
105
+ # Read a specific note (returns parsed frontmatter + body)
106
+ curl -s http://127.0.0.1:4321/api/memory/notes/projects/bizar/Architecture.md | jq
107
+
108
+ # Full-text search (Markdown content + frontmatter)
109
+ curl -s -X POST http://127.0.0.1:4321/api/memory/search \
110
+ -H 'Content-Type: application/json' \
111
+ -d '{"query":"router ordering","namespace":"projects/bizar"}' | jq
62
112
  ```
63
113
 
64
- Link to related entries with `[[wikilinks]]`.
114
+ ### Via the CLI
65
115
 
66
- ## What NOT to write
116
+ ```bash
117
+ bizar memory search "router ordering" # full-text search
118
+ bizar memory status # show mode + paths + git status
119
+ bizar memory doctor # health check
120
+ bizar memory log --tail 20 # recent operations log
121
+ bizar memory conflicts # list notes with status=conflict
122
+ ```
123
+
124
+ ## Operations
125
+
126
+ - **Open in Obsidian**: `/kb` — opens the project vault in Obsidian (resolves
127
+ from .bizar/memory.json; falls back to printing the path if Obsidian isn't
128
+ installed)
129
+
130
+ ### Via direct file read (acceptable for one-off reads)
67
131
 
68
- - Secrets, API keys, tokens (use `auth.json`)
69
- - Temporary scratch (use a TODO comment in code)
70
- - Anything already obvious from reading the code
71
- - Long code dumps (link to file with `path:line`)
132
+ ```bash
133
+ # local-only
134
+ cat .obsidian/projects/<projectId>/Architecture.md
135
+
136
+ # managed
137
+ cat ~/.local/share/bizar/memory/bizar-memory/projects/<projectId>/Architecture.md
138
+ ```
139
+
140
+ Direct reads bypass the dashboard, which is fine for diagnostics. Bypass the dashboard for writes too ONLY in an emergency (CI recovery, hook-driven bots) — always prefer the API for agent-driven writes so the schema, secret scan, and Git sync run.
141
+
142
+ ## How to write vault entries
143
+
144
+ ### Via the dashboard REST API (canonical)
145
+
146
+ ```bash
147
+ # Write or update a note — the API validates schema, scans for secrets, and
148
+ # runs the sync orchestrator (git commit) if memory.json.git.autoCommit is on.
149
+ curl -s -X POST http://127.0.0.1:4321/api/memory/notes \
150
+ -H 'Content-Type: application/json' \
151
+ -d '{
152
+ "path": "projects/bizar/adr/0001-router-ordering.md",
153
+ "namespace": "projects/bizar",
154
+ "frontmatter": {
155
+ "title": "Router ordering: Forseti before Tier 4/5",
156
+ "type": "architecture_decision",
157
+ "status": "active",
158
+ "confidence": "verified",
159
+ "date": "2026-06-29",
160
+ "tags": ["router", "agents"]
161
+ },
162
+ "body": "## Context\n...\n## Decision\n...\n## Consequences\n..."
163
+ }'
164
+
165
+ # LightRAG reindex — NEVER run during a write. Schedule from the
166
+ # orchestrator or run manually after a batch of writes.
167
+ curl -s -X POST http://127.0.0.1:4321/api/memory/reindex \
168
+ -H 'Content-Type: application/json' \
169
+ -d '{"namespace":"projects/bizar"}'
170
+ ```
72
171
 
73
- ## How to use the vault
172
+ The rich shape (path, namespace, frontmatter, body) is the canonical write. The legacy `/api/obsidian/notes` endpoint accepts the same body wrapped as `{ content: "<frontmatter + body>", path, namespace }` for back-compat.
74
173
 
75
- ### Via Obsidian CLI (preferred)
174
+ ### Via the CLI
76
175
 
77
176
  ```bash
78
- obsidian search "<query>" # full-text search
79
- obsidian read "<path>" # read a file
80
- obsidian create "<path>" "<content>" # create a file
81
- obsidian append "<path>" "<content>" # append to a file
82
- obsidian daily "<content>" # append to today's daily note
83
- obsidian tasks # list open tasks
84
- obsidian backlinks "<path>" # find what links to this file
177
+ bizar memory write "<path>" # opens $EDITOR for the body
178
+ bizar memory sync # git add/commit/push the staged notes
179
+ bizar memory commit -m "adr: 0001 router ordering"
180
+ bizar memory pull # fetch + rebase from configured remote
181
+ bizar memory push # push committed notes to remote
182
+ bizar memory reindex # rebuild LightRAG from Markdown (Phase 2)
183
+ bizar memory conflicts # human review surface for status=conflict
85
184
  ```
86
185
 
87
- ### Via MCP server (if available)
186
+ ## When to read
187
+
188
+ - **At the start of every session** — skim the project namespace's index entries (`index/`, `_index.md`, anything tagged `type: project_index`).
189
+ - **Before any non-trivial implementation decision** — search the relevant namespace for prior art.
190
+ - **When you're about to suggest something the user has already tried** — search before recommending.
191
+ - **When the codebase feels like it's working around something you don't understand** — there's probably a vault entry explaining the why.
192
+ - **When you encounter a `// FIXME` or `// HACK` comment** — there's probably a vault entry explaining it.
193
+ - **Before claiming a pattern is "the Bizar way"** — global namespace might say otherwise.
194
+
195
+ ## When to write
196
+
197
+ - **After completing a meaningful piece of work** — what was decided, what was learned, what the consequences were.
198
+ - **On discovering a bug or postmortem** — `type: bug_postmortem` with the root cause, evidence links, and the fix.
199
+ - **When you find a pattern that should be reused** — `type: pattern`, with the rationale and a code snippet.
200
+ - **When the user corrects you** — `type: lesson_learned` with what was wrong, why, and the new rule.
201
+ - **When you make a design decision that should be remembered** — `type: architecture_decision` (the classic ADR format).
202
+ - **When you encode an active rule** that future sessions should follow — `type: active_rule`, and (importantly) also add it to `.bizar/AGENTS_SELF_IMPROVEMENT.md` under "Active Rules" so the orchestrator picks it up before vault lookups.
203
+
204
+ ## Write categories (matches the 11 schema `type` values)
205
+
206
+ | type | Use when |
207
+ |---|---|
208
+ | `architecture_decision` | ADR — context, decision, consequences |
209
+ | `pattern` | Reusable approach with code example |
210
+ | `lesson_learned` | A mistake or surprise the next agent should not repeat |
211
+ | `bug_postmortem` | Root-cause analysis of an actual bug, with evidence |
212
+ | `active_rule` | A standing rule for this project (mirror in `.bizar/AGENTS_SELF_IMPROVEMENT.md`) |
213
+ | `agent_memory` | Per-agent history — what THIS agent learned across sessions |
214
+ | `project_index` | Top-level entry points (`Architecture`, `Conventions`, `Entry-Points`) |
215
+ | `reference` | External API docs, tool notes, library gotchas |
216
+ | `workflow` | Multi-step procedure with prerequisites + steps + verification |
217
+ | `note` | Free-form scratch that doesn't fit another category |
218
+ | `adr` | Alias for `architecture_decision` (kept for legacy writers) |
219
+
220
+ ## Status values (frontmatter `status`)
221
+
222
+ | status | Meaning | When to use |
223
+ |---|---|---|
224
+ | `active` | Current truth | The note still reflects reality |
225
+ | `draft` | Work in progress | Agent is still thinking; do not auto-commit |
226
+ | `superseded` | Replaced by a newer note | **Always link `superseded_by` to the replacement** |
227
+ | `stale` | Probably outdated | Needs human review — the orchestrator tags these after a `--reindex` heuristic |
228
+ | `conflict` | Two versions disagree | **Requires human resolution** — never auto-resolve |
229
+ | `archived` | Kept for history, not searched | Visible only with explicit namespace filter |
88
230
 
89
- The `obsidian` MCP server exposes tools like `obsidian_search`, `obsidian_read_file`, `obsidian_create_file`, `obsidian_append_content`, `obsidian_list_directory`, `obsidian_dataview_query`. Use whichever interface is available.
231
+ ## Confidence values (frontmatter `confidence`)
90
232
 
91
- ## The O in Odin
233
+ | confidence | Meaning | Rule |
234
+ |---|---|---|
235
+ | `verified` | Proven with evidence | Always link the evidence file in the note body (`path:line` citation) |
236
+ | `inferred` | Likely true but unproven | Phrase the body as "appears to be" / "based on X, looks like" |
237
+ | `speculative` | Hypothesis to test | Mark with `type: pattern` and a clear "to verify" section |
238
+
239
+ **Prefer `verified`.** A note with no evidence is a hypothesis at best. The schema rejects writes missing required fields for `architecture_decision` and `lesson_learned`.
240
+
241
+ ## Conflict handling
242
+
243
+ The service NEVER auto-resolves a conflict. When the same path is written from two sources (e.g. local edit + remote pull that doesn't fast-forward), the orchestrator:
244
+
245
+ 1. Renames the incoming version to `<path>.conflict-<timestamp>.md`.
246
+ 2. Sets BOTH versions' `status: conflict`.
247
+ 3. Exits non-zero so the user can review.
248
+ 4. Lists both in `bizar memory conflicts`.
249
+
250
+ Human resolution:
251
+
252
+ 1. Read both versions.
253
+ 2. Decide which is canonical (usually the more recent or more evidence-backed).
254
+ 3. Edit the losing version: `status: superseded`, set `superseded_by: <winning-path>`, add a `## Why this was superseded` section.
255
+ 4. `bizar memory sync` to commit the resolution.
256
+
257
+ Never delete a superseded note — history matters.
258
+
259
+ ## Secret scanning (commit gate)
260
+
261
+ `bizar memory commit` (and the auto-commit path during a write) runs the secret scanner over the staged Markdown. Severities:
262
+
263
+ - **HIGH** — real API keys, bearer tokens, PEM blocks, password= assignments → **BLOCKS the commit**. Fix the leak first, then commit. Use `.template` files and `.gitignore` for live secrets (see `.bizar/AGENTS_SELF_IMPROVEMENT.md` rule #4 for the token-leak history).
264
+ - **MEDIUM** — credential-like patterns (e.g. `ghp_*` with weak validation), obvious test fixtures that could be mistaken for real keys → warns. Commit proceeds unless `--strict`.
265
+ - **LOW** — possible PII, dev URLs on non-public hosts → informational.
266
+
267
+ Override flags: `--allow-secrets` (HIGH-bypass), `--strict` (LOW-becomes-warning). Never use `--allow-secrets` to ship a real credential — fix the secret in the source, not the gate.
268
+
269
+ ## Markdown conventions (Obsidian-flavoured)
270
+
271
+ - **Frontmatter is YAML** between the leading and trailing `---` lines. Required keys depend on `type`; the validator in `memory-schema.mjs` enforces this.
272
+ - **`[[wikilinks]]`** point at note paths relative to the vault root (e.g. `[[projects/bizar/Architecture]]`, not `[[Architecture]]`).
273
+ - **Tag lists** (`tags: [a, b]`) drive search; keep them short and concrete.
274
+ - **Code blocks** with language tags survive parsing — use them for snippets longer than 2 lines.
275
+ - **Callouts** (`> [!note]`, `> [!warning]`) are preserved; use `> [!danger]` for HIGH-severity warnings.
276
+ - **Status emojis** are noise — keep notes emoji-free unless the user has put one in the frontmatter.
277
+
278
+ ## Sync model
279
+
280
+ The vault directory is a Git repo. `bizar memory sync` does, in order:
281
+
282
+ 1. **Pull** — `git fetch` and `git rebase` from the configured remote (no-op for local-only).
283
+ 2. **Schema check** — every staged file is validated by the schema in `memory-schema.mjs`. Bad files become `untracked` until fixed.
284
+ 3. **Secret scan** — staged content is scanned; HIGH blocks, MEDIUM warns.
285
+ 4. **Stage** — `git add` of all Markdown under the vault root.
286
+ 5. **Commit** — `git commit` with `commitMessageTemplate` (default `memory({projectId}): {summary}`).
287
+ 6. **Push** — only if `memory.json.git.autoPushOnSessionEnd` is true.
288
+
289
+ `autoCommitOnMemoryWrite` defaults to `false` — writes return success without committing. The user reviews and runs `bizar memory sync` themselves. This is the default for production deployments.
290
+
291
+ ## What NOT to write
92
292
 
93
- Odin always updates the vault after significant work, regardless of who did the work. The other agents read; Odin writes. This is a hard rule if Odin completes a task without leaving a vault trace, that task isn't really done.
293
+ - **Secrets, API keys, tokens** the secret scanner blocks them, but defense in depth: never produce them in the first place.
294
+ - **Temporary scratch that won't be useful in 7 days** — keep that in a TODO comment in code, not the vault.
295
+ - **Long code dumps** — link with `path:line` so the note stays a living doc. Two-line snippets are fine.
296
+ - **Anything already obvious from reading the code** — the vault is for things code CAN'T say.
297
+ - **Notes that are already in another namespace** — search before writing to avoid duplicates; if you must mirror, link with `mirror_of: <other-path>`.
94
298
 
95
299
  ## See also
96
300
 
97
- - [[AGENTS_SELF_IMPROVEMENT]] — project-specific lessons in `.bizar/AGENTS_SELF_IMPROVEMENT.md`
98
- - [[Architecture]]system structure (in `index/`)
99
- - [[Dashboard]]dashboard conventions
100
- - [[Patterns]]code patterns
101
- - [[Tools]]tool documentation
301
+ - `.bizar/AGENTS_SELF_IMPROVEMENT.md` — project-specific active rules (read before vault lookups).
302
+ - `.bizar/PROJECT.md`stack, conventions, entry points (Vör reads this first).
303
+ - `wiki/Architecture.md`system-level architecture, including the Memory section.
304
+ - `wiki/Self-Improvement.md`self-improvement log conventions.
305
+ - `config/skills/glyph/SKILL.md`graphify knowledge graph (separate from the memory vault).
306
+ - `config/skills/obsidian-skills/SKILL.md` — Obsidian Markdown / Bases / Canvas / CLI (auto-installed by `install.sh` via `skills add kepano/obsidian-skills`).
package/install.sh CHANGED
@@ -2,6 +2,9 @@
2
2
  #
3
3
  # install.sh — One-shot BizarHarness installer.
4
4
  #
5
+ # v4.0.0 — Single-package layout. Dashboard, plugin, and SDK all ship
6
+ # inside @polderlabs/bizar. No more separate npm packages.
7
+ #
5
8
  # v3.20.11 — Comprehensive auto-installer with full dependency
6
9
  # resolution. Replaces the older "print 4 manual next steps" flow
7
10
  # with: (1) install every system dep we can reasonably fetch
@@ -98,6 +101,16 @@ section "Pre-flight: checking system tools"
98
101
  have_cmd() { command -v "$1" >/dev/null 2>&1; }
99
102
  have_file() { [ -e "$1" ]; }
100
103
 
104
+ # Pre-populate PATH with the common install locations for opencode + npm
105
+ # so the rest of this script can find them even if the calling shell
106
+ # didn't source ~/.profile first.
107
+ for p in "$HOME/.opencode/bin" "$HOME/.local/npm/bin" "$HOME/.cargo/bin"; do
108
+ case ":$PATH:" in
109
+ *":$p:"*) ;;
110
+ *) [ -d "$p" ] && export PATH="$p:$PATH" ;;
111
+ esac
112
+ done
113
+
101
114
  MISSING=()
102
115
  have_cmd node || MISSING+=("node")
103
116
  have_cmd uv || MISSING+=("uv")
@@ -359,7 +372,7 @@ section "Install opencode CLI"
359
372
  if ! have_cmd opencode; then
360
373
  echo -e " ${CYAN}→${NC} Installing opencode CLI..."
361
374
  if have_cmd curl; then
362
- if curl -fsSL https://opencode.ai/install.sh | sh >/dev/null 2>&1; then
375
+ if curl -fsSL https://opencode.ai/install | sh >/dev/null 2>&1; then
363
376
  if have_cmd opencode; then
364
377
  note "opencode CLI installed at $(command -v opencode)"
365
378
  else
@@ -375,11 +388,11 @@ else
375
388
  note "opencode CLI already installed"
376
389
  fi
377
390
 
378
- # ── npm packages (BizarHarness, optional @polderlabs/bizar-dash peer) ───
391
+ # ── npm packages (BizarHarness dashboard + plugin + SDK all in one) ──
379
392
  section "Install BizarHarness npm packages"
380
393
 
381
394
  if have_cmd npm; then
382
- for pkg in @polderlabs/bizar @polderlabs/bizar-dash; do
395
+ for pkg in @polderlabs/bizar; do
383
396
  if npm ls -g "$pkg" --depth=0 >/dev/null 2>&1; then
384
397
  cur=$(npm ls -g "$pkg" --depth=0 --json 2>/dev/null | grep -oE '"version":\s*"[^"]+"' | head -1 | sed 's/.*"\([^"]*\)".*/\1/')
385
398
  note "$pkg already installed (v$cur)"
@@ -519,7 +532,14 @@ for skill in bizar self-improvement cpp-coding-standards cpp-testing embedded-es
519
532
  mkdir -p "$SKILLS_DIR/$skill"
520
533
  case "$skill" in
521
534
  obsidian)
522
- cat > "$SKILLS_DIR/$skill/SKILL.md" << 'OBSIDIAN_SKILL'
535
+ # v3.24.0 — Prefer the on-disk SKILL.md so the inline copy can't
536
+ # drift. Fall back to an inline heredoc ONLY when the repo source
537
+ # is missing (e.g. someone running install.sh outside a clone).
538
+ if [ -f "$REPO_DIR/config/skills/obsidian/SKILL.md" ]; then
539
+ cp "$REPO_DIR/config/skills/obsidian/SKILL.md" "$SKILLS_DIR/$skill/SKILL.md"
540
+ note "skill: $skill (from repo)"
541
+ else
542
+ cat > "$SKILLS_DIR/$skill/SKILL.md" << 'OBSIDIAN_SKILL'
523
543
  ---
524
544
  name: obsidian
525
545
  description: Interact with the Obsidian vault for persistent per-project memory. Use when searching notes, creating notes, writing wikilinks, using callouts, setting properties, or managing the project's obsidian knowledge bank.
@@ -544,7 +564,8 @@ Per-project persistent memory for Bizar agents. Every project gets its own vault
544
564
  - Store ADRs under `adr/` prefix
545
565
  - Store implementation notes under `notes/` prefix
546
566
  OBSIDIAN_SKILL
547
- note "skill: $skill (inline)"
567
+ note "skill: $skill (inline)"
568
+ fi
548
569
  ;;
549
570
  glyph)
550
571
  cat > "$SKILLS_DIR/$skill/SKILL.md" << 'GLYPH_SKILL'
@@ -655,6 +676,13 @@ section "Install Bizar opencode plugin"
655
676
 
656
677
  PLUGIN_DST="$CONFIG_DIR/plugins/bizar"
657
678
 
679
+ # v4.0.0: The plugin, dashboard, and SDK are all part of the same
680
+ # @polderlabs/bizar npm package, so there is no separate
681
+ # @polderlabs/bizar-plugin to resolve from the global node_modules.
682
+ # The local-repo copy path is the only one we exercise now; the global
683
+ # fallback is kept for users who still have a legacy install with the
684
+ # old plugin on disk.
685
+ #
658
686
  # v3.20.12: two sources, in priority order:
659
687
  # 1. Local repo's plugins/bizar/ (for `git clone` users)
660
688
  # 2. Globally installed @polderlabs/bizar-plugin (for `npm i -g` users)
@@ -687,19 +715,11 @@ if [ -n "$PLUGIN_SRC" ]; then
687
715
  cp "$f" "$PLUGIN_DST/$rel"
688
716
  done < <(find "$PLUGIN_SRC" -type f -print0)
689
717
  note "plugins/bizar/ copied from $PLUGIN_SRC_KIND"
690
-
691
- # Copy node_modules from the npm plugin package (the plugin imports
692
- # @polderlabs/bizar-sdk, which isn't on npm). Idempotent.
693
- if [ "$PLUGIN_SRC_KIND" != "local repo" ] && [ -d "$PLUGIN_SRC/node_modules" ]; then
694
- if cp -R "$PLUGIN_SRC/node_modules/." "$PLUGIN_DST/node_modules/" 2>/dev/null; then
695
- N_PKG=$(find "$PLUGIN_SRC/node_modules" -maxdepth 1 -mindepth 1 -type d 2>/dev/null | wc -l)
696
- note "node_modules (~$N_PKG packages) bundled with deployed plugin"
697
- else
698
- warn "could not copy plugin node_modules (manual: cp -r $PLUGIN_SRC/node_modules $PLUGIN_DST/)"
699
- fi
700
- fi
718
+ # v4.0.0: No bundled node_modules copy. The SDK ships inside the same
719
+ # @polderlabs/bizar package, so plugin imports resolve from opencode's
720
+ # own node_modules at runtime.
701
721
  else
702
- warn "Bizar plugin source not found (install @polderlabs/bizar-plugin: npm i -g @polderlabs/bizar-plugin)"
722
+ warn "Bizar plugin source not found (install @polderlabs/bizar: npm i -g @polderlabs/bizar)"
703
723
  fi
704
724
 
705
725
  # ── Merge opencode.json (template + user's existing config) ────────────
@@ -751,13 +771,34 @@ if [ -n "$TEMPLATE" ]; then
751
771
  fi
752
772
  fi
753
773
 
774
+ # ── Bootstrap Bizar Memory Service ───────────────────────────────────
775
+ section "Bootstrap Bizar Memory Service"
776
+
777
+ if have_cmd node; then
778
+ MEMORY_REPO_NAME="${BIZAR_MEMORY_REPO_NAME:-bizar-memory}"
779
+ note "initializing local memory vault"
780
+ if node "$REPO_DIR/cli/bin.mjs" memory init \
781
+ --memory-mode managed \
782
+ --memory-repo-name "$MEMORY_REPO_NAME" \
783
+ --yes 2>/dev/null; then
784
+ note "memory service ready (mode: managed, repo: ~/.local/share/bizar/memory/$MEMORY_REPO_NAME)"
785
+ note "next steps:"
786
+ note " bizar memory status # check vault + git state"
787
+ note " bizar memory sync # pull, validate, scan, commit, push"
788
+ note " bizar memory doctor # health check"
789
+ else
790
+ warn "memory init skipped (run 'bizar memory init' manually later)"
791
+ fi
792
+ else
793
+ warn "node not on PATH — skipping memory service bootstrap"
794
+ fi
795
+
754
796
  # ── Write install-state.json (used by `bizar update` for migrations) ───
755
797
  section "Write install-state"
756
798
 
757
799
  mkdir -p "$BIZAR_STATE_DIR"
758
800
  BH_VERSION=$(browser-harness --version 2>/dev/null | head -1 | sed 's/[^0-9.]//g' || echo "")
759
801
  BIZAR_VERSION=$(npm ls -g @polderlabs/bizar --depth=0 --json 2>/dev/null | grep -oE '"@polderlabs/bizar":\s*\{[^}]*"version":\s*"[^"]+"' | grep -oE '"version":\s*"[^"]+"' | grep -oE '"[^"]+"' | tail -1 | tr -d '"' || echo "")
760
- DASH_VERSION=$(npm ls -g @polderlabs/bizar-dash --depth=0 --json 2>/dev/null | grep -oE '"@polderlabs/bizar-dash":\s*\{[^}]*"version":\s*"[^"]+"' | grep -oE '"version":\s*"[^"]+"' | grep -oE '"[^"]+"' | tail -1 | tr -d '"' || echo "")
761
802
  PY_VERSION=$("$PYTHON_BIN" --version 2>/dev/null | head -1 | sed 's/[^0-9.]//g' || echo "")
762
803
  UV_VERSION=$(uv --version 2>/dev/null | head -1 | sed 's/[^0-9.]//g' || echo "")
763
804
  JQ_VERSION=$(jq --version 2>/dev/null | sed 's/[^0-9.]//g' || echo "")
@@ -767,7 +808,6 @@ STATE_JSON=$(cat <<JSON
767
808
  "installedAt": "$(date -u +%Y-%m-%dT%H:%M:%SZ 2>/dev/null || date -u +%Y-%m-%dT%H:%M:%S.%NZ | sed 's/\.[0-9]*//')",
768
809
  "components": {
769
810
  "bizar": "${BIZAR_VERSION:-unknown}",
770
- "bizar-dash": "${DASH_VERSION:-unknown}",
771
811
  "browser-harness": "${BH_VERSION:-unknown}",
772
812
  "uv": "${UV_VERSION:-unknown}",
773
813
  "python3.12": "${PY_VERSION:-unknown}",
package/package.json CHANGED
@@ -1,27 +1,27 @@
1
1
  {
2
2
  "name": "@polderlabs/bizar",
3
- "version": "3.23.1",
4
- "description": "Norse-pantheon multi-agent system for opencode — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness.",
3
+ "version": "4.2.0",
4
+ "description": "Norse-pantheon multi-agent system for opencode — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness. v4 ships as a single npm package bundling the dashboard server, opencode plugin, and typed SDK.",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "bizar": "cli/bin.mjs"
8
8
  },
9
9
  "files": [
10
10
  "cli/",
11
+ "bizar-dash/",
12
+ "plugins/",
13
+ "packages/sdk/",
11
14
  "config/",
12
15
  "templates/",
13
16
  "install.sh",
14
17
  "cli/browser-harness-up.sh"
15
18
  ],
16
- "workspaces": [
17
- "packages/*"
18
- ],
19
19
  "scripts": {
20
20
  "typecheck": "tsc --noEmit",
21
- "build:sdk": "npm run build -w @polderlabs/bizar-sdk",
22
- "test:sdk": "npm run test -w @polderlabs/bizar-sdk",
23
- "test:sdk:watch": "npm run test:watch -w @polderlabs/bizar-sdk",
24
- "test": "npm run typecheck && npm run test:sdk && (cd plugins/bizar && bun test tests/loop.test.ts tests/block.test.ts tests/stall-think.test.ts tests/tools/bg-get-comments.test.ts tests/tools/bg-spawn-delegation.test.ts tests/tools/opencode-runner.test.ts tests/settings.test.ts tests/commands.test.ts tests/commands-impl.test.ts tests/tools/plan-action.test.ts tests/tools/wait-for-feedback.test.ts tests/tools/read-glyph-feedback.test.ts tests/reasoning-clean.test.ts tests/key-rotation.test.ts) && node bizar-dash/tests/smoke-v2.mjs && node --test bizar-dash/tests/path-safe.test.mjs bizar-dash/tests/tmux-wrap.test.mjs bizar-dash/tests/opencode-runner.test.mjs bizar-dash/tests/mod-instructions.node.test.mjs bizar-dash/tests/mod-upgrade.node.test.mjs bizar-dash/tests/graphify-mod-spawn.node.test.mjs bizar-dash/tests/no-agent-browser.node.test.mjs bizar-dash/tests/providers-store-backup-keys.node.test.mjs bizar-dash/tests/dashboard-ports.test.mjs bizar-dash/tests/submit-feedback.test.mjs",
21
+ "build:sdk": "tsc -p packages/sdk/tsconfig.json",
22
+ "test:sdk": "npm test --prefix packages/sdk",
23
+ "test:sdk:watch": "npm run test:watch --prefix packages/sdk",
24
+ "test": "npm run typecheck && npm run test:sdk && bun test plugins/bizar/tests/loop.test.ts plugins/bizar/tests/block.test.ts plugins/bizar/tests/stall-think.test.ts plugins/bizar/tests/tools/bg-get-comments.test.ts plugins/bizar/tests/tools/bg-spawn-delegation.test.ts plugins/bizar/tests/tools/opencode-runner.test.ts plugins/bizar/tests/settings.test.ts plugins/bizar/tests/commands.test.ts plugins/bizar/tests/commands-impl.test.ts plugins/bizar/tests/tools/plan-action.test.ts plugins/bizar/tests/tools/wait-for-feedback.test.ts plugins/bizar/tests/tools/read-glyph-feedback.test.ts plugins/bizar/tests/reasoning-clean.test.ts plugins/bizar/tests/key-rotation.test.ts && node bizar-dash/tests/smoke-v2.mjs && node --test bizar-dash/tests/path-safe.test.mjs bizar-dash/tests/tmux-wrap.test.mjs bizar-dash/tests/opencode-runner.test.mjs bizar-dash/tests/mod-instructions.node.test.mjs bizar-dash/tests/mod-upgrade.node.test.mjs bizar-dash/tests/graphify-mod-spawn.node.test.mjs bizar-dash/tests/no-agent-browser.node.test.mjs bizar-dash/tests/providers-store-backup-keys.node.test.mjs bizar-dash/tests/dashboard-ports.test.mjs bizar-dash/tests/submit-feedback.test.mjs bizar-dash/tests/yaml.test.mjs bizar-dash/tests/memory-store.test.mjs bizar-dash/tests/memory-schema.test.mjs bizar-dash/tests/memory-secrets.test.mjs bizar-dash/tests/memory-git.test.mjs bizar-dash/tests/memory-sync.test.mjs bizar-dash/tests/obsidian-back-compat.test.mjs bizar-dash/tests/memory-lightrag.test.mjs bizar-dash/tests/memory-config.test.mjs bizar-dash/tests/memory-cli.test.mjs",
25
25
  "build": "npm run build:sdk"
26
26
  },
27
27
  "keywords": [
@@ -36,22 +36,57 @@
36
36
  "schedules"
37
37
  ],
38
38
  "license": "MIT",
39
+ "engines": {
40
+ "node": ">=18",
41
+ "bun": ">=1.1.0"
42
+ },
39
43
  "dependencies": {
44
+ "@mdx-js/mdx": "^3.1.1",
45
+ "@mdx-js/react": "^3.1.1",
46
+ "@xyflow/react": "^12.11.1",
47
+ "better-sqlite3": "^12.11.1",
48
+ "blessed": "^0.1.81",
40
49
  "boxen": "^8.0.0",
41
50
  "chalk": "^5.4.0",
51
+ "chokidar": "^3.6.0",
52
+ "cors": "^2.8.6",
53
+ "croner": "^10.0.1",
54
+ "express": "^4.22.0",
55
+ "fuse.js": "^7.0.0",
42
56
  "inquirer": "^12.0.0",
43
- "ora": "^8.1.0"
57
+ "lucide-react": "^0.460.0",
58
+ "ora": "^8.1.0",
59
+ "qrcode-terminal": "^0.12.0",
60
+ "qrcode.react": "^4.2.0",
61
+ "react": "^18.3.0",
62
+ "react-dom": "^18.3.0",
63
+ "react-markdown": "^9.0.0",
64
+ "remark-gfm": "^4.0.0",
65
+ "ws": "^8.18.0",
66
+ "zod": "4.1.8"
44
67
  },
45
68
  "peerDependencies": {
46
- "@polderlabs/bizar-dash": "^3.10.0"
69
+ "@opencode-ai/plugin": ">=1.17.0"
47
70
  },
48
71
  "peerDependenciesMeta": {
49
- "@polderlabs/bizar-dash": {
72
+ "@opencode-ai/plugin": {
50
73
  "optional": true
51
74
  }
52
75
  },
53
76
  "devDependencies": {
54
- "typescript": "^5.0.0"
77
+ "@opencode-ai/plugin": "^1.17.7",
78
+ "@types/better-sqlite3": "^7.6.13",
79
+ "@types/bun": "latest",
80
+ "@types/node": "^22.0.0",
81
+ "@types/react": "^18.3.0",
82
+ "@types/react-dom": "^18.3.0",
83
+ "@vitejs/plugin-react": "^4.3.0",
84
+ "typescript": "^5.6.0",
85
+ "vite": "^5.0.0",
86
+ "vitest": "^2.1.0"
87
+ },
88
+ "allowScripts": {
89
+ "better-sqlite3@12.11.1": true
55
90
  },
56
91
  "repository": {
57
92
  "type": "git",
@@ -61,4 +96,4 @@
61
96
  "url": "https://github.com/DrB0rk/BizarHarness/issues"
62
97
  },
63
98
  "homepage": "https://github.com/DrB0rk/BizarHarness#readme"
64
- }
99
+ }