@polderlabs/bizar 6.2.5 → 7.0.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 (540) hide show
  1. package/.claude/CLAUDE.md +15 -0
  2. package/.claude/agents/_shared/AGENT_BASELINE.md +168 -0
  3. package/.claude/agents/_shared/CLAUDE_TOOLS.md +412 -0
  4. package/.claude/agents/_shared/SKILLS.md +109 -0
  5. package/.claude/agents/agent-browser.md +80 -0
  6. package/.claude/agents/baldr.md +49 -0
  7. package/.claude/agents/forseti.md +51 -0
  8. package/.claude/agents/frigg.md +42 -0
  9. package/.claude/agents/heimdall.md +33 -0
  10. package/.claude/agents/hermod.md +53 -0
  11. package/.claude/agents/mimir.md +49 -0
  12. package/.claude/agents/odin.md +287 -0
  13. package/.claude/agents/quick.md +34 -0
  14. package/.claude/agents/semble-search.md +50 -0
  15. package/.claude/agents/thor.md +53 -0
  16. package/.claude/agents/tyr.md +56 -0
  17. package/.claude/agents/vidarr.md +54 -0
  18. package/.claude/agents/vor.md +53 -0
  19. package/.claude/commands/audit.md +25 -0
  20. package/.claude/commands/bizar.md +22 -0
  21. package/.claude/commands/explain.md +17 -0
  22. package/.claude/commands/init.md +29 -0
  23. package/.claude/commands/learn.md +44 -0
  24. package/.claude/commands/plan.md +35 -0
  25. package/.claude/commands/plow-through.md +50 -0
  26. package/.claude/commands/pr-review.md +49 -0
  27. package/.claude/commands/setup-provider.md +96 -0
  28. package/.claude/commands/tailscale-serve.md +100 -0
  29. package/.claude/commands/team.md +132 -0
  30. package/.claude/commands/test.md +62 -0
  31. package/.claude/commands/validate.md +68 -0
  32. package/.claude/commands/visual-plan.md +24 -0
  33. package/.claude/hooks/README.md +92 -0
  34. package/.claude/hooks/posttooluse-editwrite.mjs +91 -0
  35. package/.claude/hooks/pretooluse-bash.mjs +81 -0
  36. package/.claude/hooks/pretooluse-editwrite.mjs +139 -0
  37. package/.claude/hooks/sessionend-recall.mjs +74 -0
  38. package/.claude/hooks/sessionstart-prime.mjs +80 -0
  39. package/.claude/hooks/userpromptsubmit-tag.mjs +80 -0
  40. package/.claude/hooks/worker-suggest.mjs +110 -0
  41. package/.claude/settings.json +125 -0
  42. package/.claude/skills/9router/SKILL.md +80 -0
  43. package/.claude/skills/9router-chat/SKILL.md +73 -0
  44. package/.claude/skills/9router-embeddings/SKILL.md +69 -0
  45. package/.claude/skills/9router-image/SKILL.md +86 -0
  46. package/.claude/skills/9router-stt/SKILL.md +79 -0
  47. package/.claude/skills/9router-tts/SKILL.md +80 -0
  48. package/.claude/skills/9router-web-fetch/SKILL.md +99 -0
  49. package/.claude/skills/9router-web-search/SKILL.md +91 -0
  50. package/.claude/skills/bizar/README.md +9 -0
  51. package/.claude/skills/bizar/SKILL.md +450 -0
  52. package/.claude/skills/cpp-coding-standards/README.md +28 -0
  53. package/.claude/skills/cpp-coding-standards/SKILL.md +634 -0
  54. package/.claude/skills/cpp-coding-standards/references/concurrency.md +320 -0
  55. package/.claude/skills/cpp-coding-standards/references/error-handling.md +229 -0
  56. package/.claude/skills/cpp-coding-standards/references/memory-safety.md +216 -0
  57. package/.claude/skills/cpp-coding-standards/references/modern-idioms.md +282 -0
  58. package/.claude/skills/cpp-coding-standards/references/review-checklist.md +96 -0
  59. package/.claude/skills/cpp-testing/README.md +28 -0
  60. package/.claude/skills/cpp-testing/SKILL.md +304 -0
  61. package/.claude/skills/cpp-testing/references/coverage.md +370 -0
  62. package/.claude/skills/cpp-testing/references/framework-compare.md +175 -0
  63. package/.claude/skills/cpp-testing/references/host-test-for-embedded.md +499 -0
  64. package/.claude/skills/cpp-testing/references/mocking.md +364 -0
  65. package/.claude/skills/cpp-testing/references/tdd-workflow.md +308 -0
  66. package/.claude/skills/cubesandbox/SKILL.md +148 -0
  67. package/.claude/skills/embedded-esp-idf/README.md +41 -0
  68. package/.claude/skills/embedded-esp-idf/SKILL.md +439 -0
  69. package/.claude/skills/embedded-esp-idf/references/freertos-patterns.md +214 -0
  70. package/.claude/skills/embedded-esp-idf/references/host-tests.md +164 -0
  71. package/.claude/skills/embedded-esp-idf/references/idf-py-commands.md +157 -0
  72. package/.claude/skills/embedded-esp-idf/references/kconfig.md +159 -0
  73. package/.claude/skills/embedded-esp-idf/references/logging-discipline.md +118 -0
  74. package/.claude/skills/embedded-esp-idf/references/memory-and-iram.md +137 -0
  75. package/.claude/skills/embedded-esp-idf/references/nvs.md +121 -0
  76. package/.claude/skills/embedded-esp-idf/references/packed-structs.md +192 -0
  77. package/.claude/skills/embedded-esp-idf/scripts/idf_env.sh +47 -0
  78. package/.claude/skills/embedded-esp-idf/scripts/size_check.sh +77 -0
  79. package/.claude/skills/glyph/SKILL.md +163 -0
  80. package/.claude/skills/harness-engineering/SKILL.md +143 -0
  81. package/.claude/skills/lightrag/SKILL.md +81 -0
  82. package/.claude/skills/memory-protocol/SKILL.md +105 -0
  83. package/.claude/skills/obsidian/SKILL.md +306 -0
  84. package/.claude/skills/read-the-damn-docs/SKILL.md +113 -0
  85. package/.claude/skills/self-improvement/SKILL.md +64 -0
  86. package/README.md +87 -59
  87. package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js → EnvVarsSection-CW6fWKds.js} +3 -3
  88. package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js.map → EnvVarsSection-CW6fWKds.js.map} +1 -1
  89. package/bizar-dash/dist/assets/MobileChat-D7zRhU9K.js +1 -0
  90. package/bizar-dash/dist/assets/{MobileChat-BnKN_Ks_.js.map → MobileChat-D7zRhU9K.js.map} +1 -1
  91. package/bizar-dash/dist/assets/MobileSettings-K-sNsn_r.js +1 -0
  92. package/bizar-dash/dist/assets/{MobileSettings-DjCPxC-Q.js.map → MobileSettings-K-sNsn_r.js.map} +1 -1
  93. package/bizar-dash/dist/assets/{Toast-Cpl6-E63.js → Toast-WTxc3m2g.js} +1 -1
  94. package/bizar-dash/dist/assets/{Toast-Cpl6-E63.js.map → Toast-WTxc3m2g.js.map} +1 -1
  95. package/bizar-dash/dist/assets/flow-BpU0-gK2.js +1 -0
  96. package/bizar-dash/dist/assets/flow-BpU0-gK2.js.map +1 -0
  97. package/bizar-dash/dist/assets/fuzzy-l0sNRNKZ.js +1 -0
  98. package/bizar-dash/dist/assets/fuzzy-l0sNRNKZ.js.map +1 -0
  99. package/bizar-dash/dist/assets/{icons-Do5N2jmX.js → icons-B0AKnYI3.js} +98 -103
  100. package/bizar-dash/dist/assets/icons-B0AKnYI3.js.map +1 -0
  101. package/bizar-dash/dist/assets/main-C-Md3DaY.css +1 -0
  102. package/bizar-dash/dist/assets/main-CO8fIxQK.js +18 -0
  103. package/bizar-dash/dist/assets/main-CO8fIxQK.js.map +1 -0
  104. package/bizar-dash/dist/assets/markdown-w2bDDkAH.js +1 -0
  105. package/bizar-dash/dist/assets/{markdown-C6mXtQxD.js.map → markdown-w2bDDkAH.js.map} +1 -1
  106. package/bizar-dash/dist/assets/mobile-DXYCA0hC.js +1 -0
  107. package/bizar-dash/dist/assets/{mobile-CMHqtLV2.js.map → mobile-DXYCA0hC.js.map} +1 -1
  108. package/bizar-dash/dist/assets/mobile-layout-DSmtNPja.js +2 -0
  109. package/bizar-dash/dist/assets/mobile-layout-DSmtNPja.js.map +1 -0
  110. package/bizar-dash/dist/assets/react-vendor-BnuhLJ6X.css +1 -0
  111. package/bizar-dash/dist/assets/react-vendor-D3pra6w-.js +46 -0
  112. package/bizar-dash/dist/assets/react-vendor-D3pra6w-.js.map +1 -0
  113. package/bizar-dash/dist/assets/useSlashCommands-3DFLOfpk.js +2 -0
  114. package/bizar-dash/dist/assets/useSlashCommands-3DFLOfpk.js.map +1 -0
  115. package/bizar-dash/dist/assets/vendor-Di7Cp-rw.js +45 -0
  116. package/bizar-dash/dist/assets/vendor-Di7Cp-rw.js.map +1 -0
  117. package/bizar-dash/dist/index.html +12 -10
  118. package/bizar-dash/dist/mobile.html +7 -4
  119. package/bizar-dash/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  120. package/bizar-dash/src/server/api.mjs +15 -4
  121. package/bizar-dash/src/server/background-store.mjs +15 -16
  122. package/bizar-dash/src/server/bg-poller.mjs +25 -35
  123. package/bizar-dash/src/server/bg-retry.mjs +66 -194
  124. package/bizar-dash/src/server/claude-bg-spawner.mjs +390 -0
  125. package/bizar-dash/src/server/claude-info.mjs +412 -0
  126. package/bizar-dash/src/server/{cline-runner.mjs → claude-runner.mjs} +53 -48
  127. package/bizar-dash/src/server/claude-sdk.mjs +191 -0
  128. package/bizar-dash/src/server/memory-consolidator.mjs +218 -0
  129. package/bizar-dash/src/server/memory-distillation.mjs +296 -0
  130. package/bizar-dash/src/server/providers-store.mjs +22 -49
  131. package/bizar-dash/src/server/routes/background.mjs +24 -20
  132. package/bizar-dash/src/server/routes/chat.mjs +223 -326
  133. package/bizar-dash/src/server/routes/claude-session-detail.mjs +329 -0
  134. package/bizar-dash/src/server/routes/claude-sessions.mjs +259 -0
  135. package/bizar-dash/src/server/routes/distill.mjs +129 -0
  136. package/bizar-dash/src/server/routes/goal-planner.mjs +236 -0
  137. package/bizar-dash/src/server/routes/tasks.mjs +20 -28
  138. package/bizar-dash/src/server/task-delegator.mjs +76 -77
  139. package/bizar-dash/src/web/App.tsx +4 -0
  140. package/bizar-dash/src/web/components/Tag.tsx +18 -5
  141. package/bizar-dash/src/web/components/Topbar.tsx +3 -0
  142. package/bizar-dash/src/web/components/agents/CommunicationLog.tsx +126 -0
  143. package/bizar-dash/src/web/components/agents/DependencyGraph.tsx +163 -0
  144. package/bizar-dash/src/web/components/agents/QualityGates.tsx +123 -0
  145. package/bizar-dash/src/web/components/agents/RealTimeEventLog.tsx +127 -0
  146. package/bizar-dash/src/web/components/agents/RoutingDecisions.test.tsx +148 -0
  147. package/bizar-dash/src/web/components/agents/RoutingDecisions.tsx +160 -0
  148. package/bizar-dash/src/web/components/chat/useChat.ts +23 -27
  149. package/bizar-dash/src/web/components/goals/GoalInput.tsx +86 -0
  150. package/bizar-dash/src/web/components/goals/PlanVisualization.tsx +111 -0
  151. package/bizar-dash/src/web/lib/goapPlanner.ts +614 -0
  152. package/bizar-dash/src/web/lib/types.ts +25 -0
  153. package/bizar-dash/src/web/styles/agents-redesign.css +311 -0
  154. package/bizar-dash/src/web/styles/main.css +251 -0
  155. package/bizar-dash/src/web/styles/tasks-redesign.css +231 -0
  156. package/bizar-dash/src/web/ui/controls/Button.tsx +77 -0
  157. package/bizar-dash/src/web/ui/controls/Checkbox.tsx +95 -0
  158. package/bizar-dash/src/web/ui/controls/IconButton.tsx +66 -0
  159. package/bizar-dash/src/web/ui/controls/Kbd.tsx +24 -0
  160. package/bizar-dash/src/web/ui/controls/NumberInput.tsx +77 -0
  161. package/bizar-dash/src/web/ui/controls/RadioGroup.tsx +109 -0
  162. package/bizar-dash/src/web/ui/controls/SearchInput.tsx +91 -0
  163. package/bizar-dash/src/web/ui/controls/Select.tsx +92 -0
  164. package/bizar-dash/src/web/ui/controls/Slider.tsx +70 -0
  165. package/bizar-dash/src/web/ui/controls/TextInput.tsx +67 -0
  166. package/bizar-dash/src/web/ui/controls/Toggle.tsx +79 -0
  167. package/bizar-dash/src/web/ui/controls/controls.css +454 -0
  168. package/bizar-dash/src/web/ui/controls/index.ts +33 -0
  169. package/bizar-dash/src/web/ui/data/BarChart.tsx +60 -0
  170. package/bizar-dash/src/web/ui/data/DataTable.tsx +216 -0
  171. package/bizar-dash/src/web/ui/data/EmptyState.tsx +60 -0
  172. package/bizar-dash/src/web/ui/data/ErrorState.tsx +56 -0
  173. package/bizar-dash/src/web/ui/data/KeyValueList.tsx +106 -0
  174. package/bizar-dash/src/web/ui/data/LoadingState.tsx +65 -0
  175. package/bizar-dash/src/web/ui/data/Sparkline.tsx +87 -0
  176. package/bizar-dash/src/web/ui/data/StatTile.tsx +87 -0
  177. package/bizar-dash/src/web/ui/data/data.css +535 -0
  178. package/bizar-dash/src/web/ui/data/index.ts +31 -0
  179. package/bizar-dash/src/web/ui/feedback/Badge.tsx +49 -0
  180. package/bizar-dash/src/web/ui/feedback/Dialog.tsx +209 -0
  181. package/bizar-dash/src/web/ui/feedback/ProgressBar.tsx +69 -0
  182. package/bizar-dash/src/web/ui/feedback/StatusDot.tsx +50 -0
  183. package/bizar-dash/src/web/ui/feedback/Toast.tsx +200 -0
  184. package/bizar-dash/src/web/ui/feedback/Tooltip.tsx +126 -0
  185. package/bizar-dash/src/web/ui/feedback/feedback.css +314 -0
  186. package/bizar-dash/src/web/ui/feedback/index.ts +43 -0
  187. package/bizar-dash/src/web/ui/index.ts +56 -0
  188. package/bizar-dash/src/web/ui/layout/AppShell.tsx +51 -0
  189. package/bizar-dash/src/web/ui/layout/Breadcrumbs.tsx +97 -0
  190. package/bizar-dash/src/web/ui/layout/Panel.tsx +73 -0
  191. package/bizar-dash/src/web/ui/layout/PanelHeader.tsx +39 -0
  192. package/bizar-dash/src/web/ui/layout/Sidebar.tsx +131 -0
  193. package/bizar-dash/src/web/ui/layout/Tabs.tsx +133 -0
  194. package/bizar-dash/src/web/ui/layout/Topbar.tsx +42 -0
  195. package/bizar-dash/src/web/ui/layout/index.ts +33 -0
  196. package/bizar-dash/src/web/ui/layout/layout.css +413 -0
  197. package/bizar-dash/src/web/ui/navigation/CommandPalette.tsx +199 -0
  198. package/bizar-dash/src/web/ui/navigation/NavGroup.tsx +95 -0
  199. package/bizar-dash/src/web/ui/navigation/NavLink.tsx +93 -0
  200. package/bizar-dash/src/web/ui/navigation/index.ts +17 -0
  201. package/bizar-dash/src/web/ui/navigation/navigation.css +343 -0
  202. package/bizar-dash/src/web/ui/primitives/Box.tsx +91 -0
  203. package/bizar-dash/src/web/ui/primitives/Grid.tsx +49 -0
  204. package/bizar-dash/src/web/ui/primitives/Inline.tsx +55 -0
  205. package/bizar-dash/src/web/ui/primitives/Separator.tsx +46 -0
  206. package/bizar-dash/src/web/ui/primitives/Stack.tsx +54 -0
  207. package/bizar-dash/src/web/ui/primitives/VisuallyHidden.tsx +26 -0
  208. package/bizar-dash/src/web/ui/primitives/index.ts +23 -0
  209. package/bizar-dash/src/web/ui/primitives/primitives.css +183 -0
  210. package/bizar-dash/src/web/ui/styles/globals.css +86 -0
  211. package/bizar-dash/src/web/ui/styles/reset.css +125 -0
  212. package/bizar-dash/src/web/ui/styles/tokens.css +195 -0
  213. package/bizar-dash/src/web/ui/theme/ThemeProvider.tsx +142 -0
  214. package/bizar-dash/src/web/ui/theme/tokens.ts +131 -0
  215. package/bizar-dash/src/web/ui/theme/useTheme.ts +22 -0
  216. package/bizar-dash/src/web/ui/utils/cx.ts +42 -0
  217. package/bizar-dash/src/web/views/Agents.tsx +506 -266
  218. package/bizar-dash/src/web/views/Chat.tsx +8 -8
  219. package/bizar-dash/src/web/views/GoalPlanner.tsx +158 -0
  220. package/bizar-dash/src/web/views/Overview.tsx +996 -448
  221. package/bizar-dash/src/web/views/Tasks.tsx +277 -273
  222. package/bizar-dash/tests/communication-log.test.tsx +67 -0
  223. package/bizar-dash/tests/dep-graph.test.tsx +40 -0
  224. package/bizar-dash/tests/event-log.test.tsx +61 -0
  225. package/bizar-dash/tests/goal-input.test.tsx +72 -0
  226. package/bizar-dash/tests/goap-planner.test.ts +68 -0
  227. package/bizar-dash/tests/quality-gates.test.tsx +59 -0
  228. package/bizar-dash/tests/setup.ts +31 -1
  229. package/bizar-dash/tests/ui/controls/Button.test.tsx +50 -0
  230. package/bizar-dash/tests/ui/controls/Checkbox.test.tsx +44 -0
  231. package/bizar-dash/tests/ui/controls/IconButton.test.tsx +37 -0
  232. package/bizar-dash/tests/ui/controls/Kbd.test.tsx +39 -0
  233. package/bizar-dash/tests/ui/controls/NumberInput.test.tsx +56 -0
  234. package/bizar-dash/tests/ui/controls/RadioGroup.test.tsx +58 -0
  235. package/bizar-dash/tests/ui/controls/SearchInput.test.tsx +52 -0
  236. package/bizar-dash/tests/ui/controls/Select.test.tsx +66 -0
  237. package/bizar-dash/tests/ui/controls/Slider.test.tsx +41 -0
  238. package/bizar-dash/tests/ui/controls/TextInput.test.tsx +44 -0
  239. package/bizar-dash/tests/ui/controls/Toggle.test.tsx +39 -0
  240. package/bizar-dash/tests/ui/data/BarChart.test.tsx +55 -0
  241. package/bizar-dash/tests/ui/data/DataTable.test.tsx +112 -0
  242. package/bizar-dash/tests/ui/data/EmptyState.test.tsx +57 -0
  243. package/bizar-dash/tests/ui/data/ErrorState.test.tsx +47 -0
  244. package/bizar-dash/tests/ui/data/KeyValueList.test.tsx +59 -0
  245. package/bizar-dash/tests/ui/data/LoadingState.test.tsx +37 -0
  246. package/bizar-dash/tests/ui/data/Sparkline.test.tsx +56 -0
  247. package/bizar-dash/tests/ui/data/StatTile.test.tsx +69 -0
  248. package/bizar-dash/tests/ui/feedback/Badge.test.tsx +41 -0
  249. package/bizar-dash/tests/ui/feedback/Dialog.test.tsx +99 -0
  250. package/bizar-dash/tests/ui/feedback/ProgressBar.test.tsx +66 -0
  251. package/bizar-dash/tests/ui/feedback/StatusDot.test.tsx +41 -0
  252. package/bizar-dash/tests/ui/feedback/Toast.test.tsx +124 -0
  253. package/bizar-dash/tests/ui/feedback/Tooltip.test.tsx +102 -0
  254. package/bizar-dash/tests/ui/layout/AppShell.test.tsx +50 -0
  255. package/bizar-dash/tests/ui/layout/Breadcrumbs.test.tsx +85 -0
  256. package/bizar-dash/tests/ui/layout/Panel.test.tsx +52 -0
  257. package/bizar-dash/tests/ui/layout/PanelHeader.test.tsx +32 -0
  258. package/bizar-dash/tests/ui/layout/Sidebar.test.tsx +95 -0
  259. package/bizar-dash/tests/ui/layout/Tabs.test.tsx +87 -0
  260. package/bizar-dash/tests/ui/layout/Topbar.test.tsx +41 -0
  261. package/bizar-dash/tests/ui/navigation/CommandPalette.test.tsx +105 -0
  262. package/bizar-dash/tests/ui/navigation/NavGroup.test.tsx +55 -0
  263. package/bizar-dash/tests/ui/navigation/NavLink.test.tsx +61 -0
  264. package/bizar-dash/tests/ui/primitives/Box.test.tsx +49 -0
  265. package/bizar-dash/tests/ui/primitives/Grid.test.tsx +37 -0
  266. package/bizar-dash/tests/ui/primitives/Inline.test.tsx +33 -0
  267. package/bizar-dash/tests/ui/primitives/Separator.test.tsx +34 -0
  268. package/bizar-dash/tests/ui/primitives/Stack.test.tsx +45 -0
  269. package/bizar-dash/tests/ui/primitives/VisuallyHidden.test.tsx +27 -0
  270. package/bizar-dash/tests/views/Agents.test.tsx +359 -0
  271. package/bizar-dash/tests/views/Overview.test.tsx +413 -0
  272. package/bizar-dash/tests/views/Tasks.test.tsx +250 -0
  273. package/bizar-dash/vitest.config.ts +3 -1
  274. package/cli/__tests__/cost-gate.test.mjs +301 -0
  275. package/cli/__tests__/feature-list-bridge.test.mjs +371 -0
  276. package/cli/bin.mjs +55 -18
  277. package/cli/commands/claim.mjs +282 -0
  278. package/cli/commands/claude-cmd.mjs +348 -0
  279. package/cli/commands/cost.mjs +279 -0
  280. package/cli/commands/install.mjs +12 -11
  281. package/cli/commands/validate.mjs +252 -325
  282. package/cli/cost-gate.mjs +501 -0
  283. package/cli/dev-link.test.mjs +11 -11
  284. package/cli/doctor.mjs +131 -213
  285. package/cli/feature-list-bridge.mjs +400 -0
  286. package/cli/install.mjs +33 -37
  287. package/cli/install.test.mjs +9 -9
  288. package/cli/memory-constants.mjs +17 -0
  289. package/cli/provision-claude.mjs +893 -0
  290. package/cli/provision.mjs +224 -227
  291. package/cli/utils.mjs +72 -58
  292. package/cli/worker-dispatcher.mjs +259 -0
  293. package/cli/worker-dispatcher.test.mjs +204 -0
  294. package/config/AGENTS.md +28 -28
  295. package/config/trigger-patterns.json +186 -0
  296. package/install.sh +66 -44
  297. package/package.json +19 -11
  298. package/packages/sdk/ARCHITECTURE.md +40 -36
  299. package/packages/sdk/package.json +15 -5
  300. package/packages/sdk/src/agent-registry.ts +304 -0
  301. package/packages/sdk/src/consensus/byzantine.ts +587 -0
  302. package/packages/sdk/src/consensus/index.ts +147 -0
  303. package/packages/sdk/src/consensus/queen.ts +173 -0
  304. package/packages/sdk/src/consensus/types.ts +199 -0
  305. package/{plugins/bizar → packages/sdk}/src/dangerous-patterns.ts +6 -28
  306. package/packages/sdk/src/federation/audit.ts +156 -0
  307. package/packages/sdk/src/federation/budget.ts +269 -0
  308. package/packages/sdk/src/federation/envelope.ts +144 -0
  309. package/packages/sdk/src/federation/hmac.ts +160 -0
  310. package/packages/sdk/src/federation/index.ts +443 -0
  311. package/packages/sdk/src/federation/pii.ts +241 -0
  312. package/packages/sdk/src/federation/policy.ts +112 -0
  313. package/packages/sdk/src/federation/trust.ts +146 -0
  314. package/packages/sdk/src/fingerprint.ts +0 -0
  315. package/packages/sdk/src/index.ts +101 -69
  316. package/packages/sdk/src/mcp/bin.ts +51 -0
  317. package/packages/sdk/src/mcp/server.ts +848 -0
  318. package/{plugins/bizar/src/memory-vault.ts → packages/sdk/src/memory/index.ts} +18 -21
  319. package/packages/sdk/src/router/codemod-intent.ts +125 -0
  320. package/packages/sdk/src/router/index.ts +247 -0
  321. package/packages/sdk/src/router/memory-distillation-shim.mjs +18 -0
  322. package/packages/sdk/src/router/memory-distillation.ts +249 -0
  323. package/packages/sdk/src/router/model-router.ts +235 -0
  324. package/packages/sdk/src/router/q-learning-router.ts +304 -0
  325. package/packages/sdk/src/swarm-topology.ts +279 -0
  326. package/packages/sdk/tests/agent-registry.test.ts +285 -0
  327. package/packages/sdk/tests/consensus.test.ts +376 -0
  328. package/packages/sdk/tests/federation/audit.test.ts +164 -0
  329. package/packages/sdk/tests/federation/budget.test.ts +189 -0
  330. package/packages/sdk/tests/federation/envelope.test.ts +120 -0
  331. package/packages/sdk/tests/federation/hmac.test.ts +194 -0
  332. package/packages/sdk/tests/federation/orchestrator.test.ts +176 -0
  333. package/packages/sdk/tests/federation/pii.test.ts +106 -0
  334. package/packages/sdk/tests/federation/policy.test.ts +140 -0
  335. package/packages/sdk/tests/federation/trust.test.ts +124 -0
  336. package/packages/sdk/tests/mcp-tools.test.ts +204 -0
  337. package/packages/sdk/tests/memory-distillation.test.mjs +186 -0
  338. package/packages/sdk/tests/model-router.test.mjs +108 -0
  339. package/packages/sdk/tests/q-learning-router.test.mjs +100 -0
  340. package/packages/sdk/tests/router-orchestrator.test.mjs +172 -0
  341. package/packages/sdk/tests/router.test.mjs +91 -0
  342. package/packages/sdk/tests/sdk.test.mjs +172 -0
  343. package/packages/sdk/tests/swarm-topology.test.ts +258 -0
  344. package/packages/sdk/vitest.config.ts +1 -1
  345. package/scripts/bh-full-e2e.mjs +167 -368
  346. package/scripts/check-deps.mjs +28 -46
  347. package/scripts/mirror-claude-md.sh +78 -0
  348. package/scripts/test-in-container.sh +31 -9
  349. package/templates/clean-state-checklist.md +3 -3
  350. package/templates/sprint-contract.md +2 -2
  351. package/bizar-dash/.bizar/activity.log +0 -3
  352. package/bizar-dash/.omx/logs/omx-2026-07-07.jsonl +0 -1
  353. package/bizar-dash/.omx/state/session.json +0 -10
  354. package/bizar-dash/bizar-design/EXPLANATION.md +0 -307
  355. package/bizar-dash/bizar-design/INSTRUCTIONS.md +0 -149
  356. package/bizar-dash/bizar-design/canvas.html +0 -281
  357. package/bizar-dash/bizar-design/canvas.html.artifact.json +0 -19
  358. package/bizar-dash/bizar-design/components.css +0 -1665
  359. package/bizar-dash/bizar-design/components.html +0 -557
  360. package/bizar-dash/bizar-design/components.html.artifact.json +0 -19
  361. package/bizar-dash/bizar-design/desktop/agents.html +0 -74
  362. package/bizar-dash/bizar-design/desktop/agents.html.artifact.json +0 -19
  363. package/bizar-dash/bizar-design/desktop/memory.html +0 -75
  364. package/bizar-dash/bizar-design/desktop/memory.html.artifact.json +0 -19
  365. package/bizar-dash/bizar-design/desktop/metrics.html +0 -63
  366. package/bizar-dash/bizar-design/desktop/metrics.html.artifact.json +0 -19
  367. package/bizar-dash/bizar-design/desktop/overview.html +0 -95
  368. package/bizar-dash/bizar-design/desktop/overview.html.artifact.json +0 -19
  369. package/bizar-dash/bizar-design/desktop/settings.html +0 -70
  370. package/bizar-dash/bizar-design/desktop/settings.html.artifact.json +0 -19
  371. package/bizar-dash/bizar-design/icons.svg +0 -44
  372. package/bizar-dash/bizar-design/index.html +0 -192
  373. package/bizar-dash/bizar-design/index.html.artifact.json +0 -19
  374. package/bizar-dash/bizar-design/mobile/agents.html +0 -29
  375. package/bizar-dash/bizar-design/mobile/agents.html.artifact.json +0 -19
  376. package/bizar-dash/bizar-design/mobile/memory.html +0 -28
  377. package/bizar-dash/bizar-design/mobile/memory.html.artifact.json +0 -19
  378. package/bizar-dash/bizar-design/mobile/metrics.html +0 -29
  379. package/bizar-dash/bizar-design/mobile/metrics.html.artifact.json +0 -19
  380. package/bizar-dash/bizar-design/mobile/overview.html +0 -33
  381. package/bizar-dash/bizar-design/mobile/overview.html.artifact.json +0 -19
  382. package/bizar-dash/bizar-design/mobile/settings.html +0 -28
  383. package/bizar-dash/bizar-design/mobile/settings.html.artifact.json +0 -19
  384. package/bizar-dash/bizar-design/prototype.js +0 -114
  385. package/bizar-dash/bizar-design/tokens.css +0 -106
  386. package/bizar-dash/dist/assets/MobileChat-BnKN_Ks_.js +0 -1
  387. package/bizar-dash/dist/assets/MobileSettings-DjCPxC-Q.js +0 -1
  388. package/bizar-dash/dist/assets/icons-Do5N2jmX.js.map +0 -1
  389. package/bizar-dash/dist/assets/main-DYiZqMrn.js +0 -18
  390. package/bizar-dash/dist/assets/main-DYiZqMrn.js.map +0 -1
  391. package/bizar-dash/dist/assets/main-ietCEg_R.css +0 -1
  392. package/bizar-dash/dist/assets/markdown-C6mXtQxD.js +0 -1
  393. package/bizar-dash/dist/assets/mobile-CMHqtLV2.js +0 -1
  394. package/bizar-dash/dist/assets/mobile-layout-3jIhHX_p.js +0 -2
  395. package/bizar-dash/dist/assets/mobile-layout-3jIhHX_p.js.map +0 -1
  396. package/bizar-dash/dist/assets/react-vendor-Dn4wqh4Z.js +0 -40
  397. package/bizar-dash/dist/assets/react-vendor-Dn4wqh4Z.js.map +0 -1
  398. package/bizar-dash/dist/assets/useSlashCommands-DtITw8Xv.js +0 -2
  399. package/bizar-dash/dist/assets/useSlashCommands-DtITw8Xv.js.map +0 -1
  400. package/bizar-dash/dist/assets/vendor-CeHGtduv.js +0 -29
  401. package/bizar-dash/dist/assets/vendor-CeHGtduv.js.map +0 -1
  402. package/bizar-dash/node_modules/.package-lock.json +0 -6
  403. package/bizar-dash/package-lock.json +0 -6
  404. package/bizar-dash/src/server/cline-sdk.mjs +0 -132
  405. package/bizar-dash/src/server/routes/cline-session-detail.mjs +0 -559
  406. package/bizar-dash/src/server/routes/cline-sessions.mjs +0 -291
  407. package/cli/commands/cline-cmd.mjs +0 -289
  408. package/cli/commands/validate.test.mjs +0 -379
  409. package/cli/doctor.test.mjs +0 -350
  410. package/config/cline.json.template +0 -342
  411. package/packages/sdk/src/client.ts +0 -188
  412. package/packages/sdk/src/cline-events.ts +0 -134
  413. package/packages/sdk/src/cline-types.ts +0 -66
  414. package/packages/sdk/src/cline.ts +0 -339
  415. package/packages/sdk/src/errors.ts +0 -129
  416. package/packages/sdk/src/events.ts +0 -153
  417. package/packages/sdk/src/types.ts +0 -176
  418. package/packages/sdk/tests/client.test.ts +0 -217
  419. package/packages/sdk/tests/errors.test.ts +0 -108
  420. package/packages/sdk/tests/events.test.ts +0 -139
  421. package/packages/sdk/tests/fixtures/fetch-mock.ts +0 -152
  422. package/packages/sdk/tests/fixtures/sse-mock.ts +0 -30
  423. package/plugins/bizar/ARCHITECTURE.md +0 -142
  424. package/plugins/bizar/CONSTRAINTS.md +0 -67
  425. package/plugins/bizar/LICENSE +0 -21
  426. package/plugins/bizar/README.md +0 -448
  427. package/plugins/bizar/index.ts +0 -925
  428. package/plugins/bizar/package.json +0 -39
  429. package/plugins/bizar/scripts/check-forbidden-imports.sh +0 -33
  430. package/plugins/bizar/src/background-state.ts +0 -641
  431. package/plugins/bizar/src/background.ts +0 -1806
  432. package/plugins/bizar/src/cline-runner.ts +0 -203
  433. package/plugins/bizar/src/clineruntime.ts +0 -227
  434. package/plugins/bizar/src/commands-impl.ts +0 -151
  435. package/plugins/bizar/src/commands.ts +0 -1799
  436. package/plugins/bizar/src/compaction.d.mts +0 -48
  437. package/plugins/bizar/src/compaction.mjs +0 -192
  438. package/plugins/bizar/src/dashboard-client.ts +0 -233
  439. package/plugins/bizar/src/event-stream.ts +0 -606
  440. package/plugins/bizar/src/fingerprint.ts +0 -120
  441. package/plugins/bizar/src/handoff.ts +0 -79
  442. package/plugins/bizar/src/hooks/memory-flush-on-compact.ts +0 -123
  443. package/plugins/bizar/src/hooks/memory-inject.ts +0 -247
  444. package/plugins/bizar/src/hooks/memory-write-on-end.ts +0 -188
  445. package/plugins/bizar/src/hooks/skill-curator.ts +0 -180
  446. package/plugins/bizar/src/http-client.ts +0 -467
  447. package/plugins/bizar/src/key-rotation.ts +0 -218
  448. package/plugins/bizar/src/logger.ts +0 -144
  449. package/plugins/bizar/src/loop-engineering.ts +0 -241
  450. package/plugins/bizar/src/loop.ts +0 -176
  451. package/plugins/bizar/src/mistake-recovery.ts +0 -98
  452. package/plugins/bizar/src/odin.ts +0 -227
  453. package/plugins/bizar/src/options.ts +0 -470
  454. package/plugins/bizar/src/plan-fs.ts +0 -323
  455. package/plugins/bizar/src/reasoning-clean.ts +0 -454
  456. package/plugins/bizar/src/report.ts +0 -178
  457. package/plugins/bizar/src/research-prompt.ts +0 -35
  458. package/plugins/bizar/src/serve-info.ts +0 -228
  459. package/plugins/bizar/src/serve.ts +0 -496
  460. package/plugins/bizar/src/settings.ts +0 -349
  461. package/plugins/bizar/src/state.ts +0 -298
  462. package/plugins/bizar/src/tool-discipline.ts +0 -105
  463. package/plugins/bizar/src/tools/agent-browser.ts +0 -315
  464. package/plugins/bizar/src/tools/bg-collect.ts +0 -131
  465. package/plugins/bizar/src/tools/bg-get-comments.ts +0 -266
  466. package/plugins/bizar/src/tools/bg-kill.ts +0 -116
  467. package/plugins/bizar/src/tools/bg-pause.ts +0 -99
  468. package/plugins/bizar/src/tools/bg-report-progress.ts +0 -115
  469. package/plugins/bizar/src/tools/bg-resume.ts +0 -94
  470. package/plugins/bizar/src/tools/bg-send-message.ts +0 -223
  471. package/plugins/bizar/src/tools/bg-spawn.ts +0 -502
  472. package/plugins/bizar/src/tools/bg-status.ts +0 -130
  473. package/plugins/bizar/src/tools/graph-query.ts +0 -278
  474. package/plugins/bizar/src/tools/loop-engineering.ts +0 -193
  475. package/plugins/bizar/src/tools/memory-list.ts +0 -43
  476. package/plugins/bizar/src/tools/memory-read.ts +0 -69
  477. package/plugins/bizar/src/tools/memory-search.ts +0 -47
  478. package/plugins/bizar/src/tools/memory-write.ts +0 -54
  479. package/plugins/bizar/src/tools/open-kb.ts +0 -198
  480. package/plugins/bizar/src/tools/plan-action.ts +0 -785
  481. package/plugins/bizar/src/tools/read-glyph-feedback.ts +0 -191
  482. package/plugins/bizar/src/tools/sandbox.ts +0 -232
  483. package/plugins/bizar/src/tools/team-spawn.ts +0 -73
  484. package/plugins/bizar/src/tools/team-status.ts +0 -76
  485. package/plugins/bizar/src/tools/wait-for-feedback.ts +0 -415
  486. package/plugins/bizar/src/trajectory.ts +0 -104
  487. package/plugins/bizar/tests/README.md +0 -99
  488. package/plugins/bizar/tests/attach-handler-bug.test.ts +0 -169
  489. package/plugins/bizar/tests/background-state.test.ts +0 -277
  490. package/plugins/bizar/tests/background.test.ts +0 -402
  491. package/plugins/bizar/tests/block.test.ts +0 -195
  492. package/plugins/bizar/tests/canonical-key-order.test.ts +0 -75
  493. package/plugins/bizar/tests/clineruntime-config.test.ts +0 -283
  494. package/plugins/bizar/tests/commands-impl.test.ts +0 -316
  495. package/plugins/bizar/tests/commands.test.ts +0 -584
  496. package/plugins/bizar/tests/compaction.test.ts +0 -264
  497. package/plugins/bizar/tests/config.test.ts +0 -128
  498. package/plugins/bizar/tests/dashboard-client.test.ts +0 -159
  499. package/plugins/bizar/tests/dispose.test.ts +0 -336
  500. package/plugins/bizar/tests/event-stream.test.ts +0 -409
  501. package/plugins/bizar/tests/event.test.ts +0 -262
  502. package/plugins/bizar/tests/fingerprint.test.ts +0 -190
  503. package/plugins/bizar/tests/http-client.test.ts +0 -404
  504. package/plugins/bizar/tests/init-helpers.test.ts +0 -203
  505. package/plugins/bizar/tests/integration/slash-command.test.ts +0 -349
  506. package/plugins/bizar/tests/integration/tool-routing.test.ts +0 -98
  507. package/plugins/bizar/tests/key-rotation.test.ts +0 -396
  508. package/plugins/bizar/tests/loop-engineering.test.ts +0 -168
  509. package/plugins/bizar/tests/loop.test.ts +0 -397
  510. package/plugins/bizar/tests/memory-write-on-end.test.ts +0 -92
  511. package/plugins/bizar/tests/mistake-recovery.test.ts +0 -116
  512. package/plugins/bizar/tests/odin.test.ts +0 -125
  513. package/plugins/bizar/tests/options.test.ts +0 -329
  514. package/plugins/bizar/tests/reasoning-clean.test.ts +0 -422
  515. package/plugins/bizar/tests/safety.test.ts +0 -281
  516. package/plugins/bizar/tests/serve.test.ts +0 -339
  517. package/plugins/bizar/tests/settings.test.ts +0 -351
  518. package/plugins/bizar/tests/stall-think.test.ts +0 -750
  519. package/plugins/bizar/tests/state.test.ts +0 -276
  520. package/plugins/bizar/tests/tool-discipline.test.ts +0 -77
  521. package/plugins/bizar/tests/tools/agent-browser.test.ts +0 -98
  522. package/plugins/bizar/tests/tools/bg-collect.test.ts +0 -337
  523. package/plugins/bizar/tests/tools/bg-get-comments.test.ts +0 -485
  524. package/plugins/bizar/tests/tools/bg-kill.test.ts +0 -235
  525. package/plugins/bizar/tests/tools/bg-pause.test.ts +0 -61
  526. package/plugins/bizar/tests/tools/bg-report-progress.test.ts +0 -79
  527. package/plugins/bizar/tests/tools/bg-resume.test.ts +0 -40
  528. package/plugins/bizar/tests/tools/bg-send-message.test.ts +0 -116
  529. package/plugins/bizar/tests/tools/bg-spawn-delegation.test.ts +0 -147
  530. package/plugins/bizar/tests/tools/bg-spawn-http.test.ts +0 -233
  531. package/plugins/bizar/tests/tools/bg-spawn.test.ts +0 -311
  532. package/plugins/bizar/tests/tools/bg-status.test.ts +0 -217
  533. package/plugins/bizar/tests/tools/cline-runner.test.ts +0 -115
  534. package/plugins/bizar/tests/tools/plan-action.test.ts +0 -599
  535. package/plugins/bizar/tests/tools/read-glyph-feedback.test.ts +0 -253
  536. package/plugins/bizar/tests/tools/sandbox.test.ts +0 -117
  537. package/plugins/bizar/tests/tools/wait-for-feedback.test.ts +0 -390
  538. package/plugins/bizar/tests/update-deadlock.test.ts +0 -151
  539. package/plugins/bizar/tsconfig.json +0 -29
  540. package/scripts/mirror-agents-md.sh +0 -69
@@ -0,0 +1,400 @@
1
+ /**
2
+ * cli/feature-list-bridge.mjs
3
+ *
4
+ * F-035 (MetaHarness) — wraps `feature_list.json` with claim semantics.
5
+ *
6
+ * Source-of-truth port from
7
+ * ruflo/v3/@claude-flow/cli/src/services/claim-service.ts (ClaimService,
8
+ * ADR-016) — issues.ts is the CLI surface we mirror.
9
+ *
10
+ * Status state machine:
11
+ * unclaimed -> claimed
12
+ * claimed -> active (start work)
13
+ * active -> paused
14
+ * paused -> active
15
+ * active -> handoff-pending (initiated)
16
+ * handoff-pending -> claimed (accepted by recipient)
17
+ * active -> blocked (caller marked a blocker)
18
+ * blocked -> active
19
+ * {claimed,active,paused,blocked,handoff-pending}
20
+ * -> completed
21
+ * {claimed,active,...} -> unclaimed (release)
22
+ *
23
+ * Steal reasons (per spec): overloaded | stale | blocked-timeout | voluntary
24
+ *
25
+ * Persistence model: we ADD the following fields on each feature entry —
26
+ * claimant : { type: 'human'|'agent', id, name }
27
+ * claimStatus : ClaimStatus
28
+ * claimedAt : ISO timestamp
29
+ * claimHistory : Array<{ event, claimant?, ts, reason? }>
30
+ *
31
+ * We MUST NOT modify the existing `vcr` / `passing` semantics of
32
+ * feature_list.json — claims are additive fields only.
33
+ *
34
+ * File writes are atomic via the standard `writeFileSync` to .tmp +
35
+ * `renameSync` pattern.
36
+ */
37
+
38
+ import { existsSync, readFileSync, writeFileSync, mkdirSync, renameSync, statSync, copyFileSync } from 'node:fs';
39
+ import { dirname, join, resolve } from 'node:path';
40
+ import { randomUUID } from 'node:crypto';
41
+
42
+ // ── Constants ────────────────────────────────────────────────────────
43
+
44
+ export const CLAIM_STATUSES = Object.freeze([
45
+ 'unclaimed',
46
+ 'claimed',
47
+ 'active',
48
+ 'paused',
49
+ 'handoff-pending',
50
+ 'blocked',
51
+ 'completed',
52
+ ]);
53
+
54
+ export const STEAL_REASONS = Object.freeze([
55
+ 'overloaded',
56
+ 'stale',
57
+ 'blocked-timeout',
58
+ 'voluntary',
59
+ ]);
60
+
61
+ // Transitions the bridge will allow without complaint. Anything else
62
+ // emits a typed error.
63
+ const ALLOWED_TRANSITIONS = {
64
+ unclaimed: new Set(['claimed']),
65
+ claimed: new Set(['active', 'unclaimed', 'completed', 'handoff-pending']),
66
+ active: new Set(['paused', 'blocked', 'completed', 'handoff-pending', 'unclaimed']),
67
+ paused: new Set(['active', 'unclaimed', 'completed']),
68
+ 'handoff-pending': new Set(['claimed', 'unclaimed']),
69
+ blocked: new Set(['active', 'unclaimed']),
70
+ completed: new Set([]),
71
+ };
72
+
73
+ // ── Errors ───────────────────────────────────────────────────────────
74
+
75
+ export class ClaimError extends Error {
76
+ constructor(code, message) {
77
+ super(message || code);
78
+ this.name = 'ClaimError';
79
+ this.code = code;
80
+ }
81
+ }
82
+
83
+ // ── Helpers ──────────────────────────────────────────────────────────
84
+
85
+ function nowIso() {
86
+ return new Date().toISOString();
87
+ }
88
+
89
+ function readJsonSafe(file) {
90
+ try {
91
+ if (!existsSync(file)) return null;
92
+ const txt = readFileSync(file, 'utf8');
93
+ return JSON.parse(txt);
94
+ } catch {
95
+ return null;
96
+ }
97
+ }
98
+
99
+ function writeJsonAtomic(file, data) {
100
+ mkdirSync(dirname(file), { recursive: true });
101
+ const tmp = `${file}.tmp.${randomUUID()}`;
102
+ writeFileSync(tmp, JSON.stringify(data, null, 2) + '\n');
103
+ renameSync(tmp, file);
104
+ }
105
+
106
+ function appendHistory(feature, event, extra) {
107
+ const prev = Array.isArray(feature.claimHistory) ? feature.claimHistory : [];
108
+ feature.claimHistory = [...prev, { event, ts: nowIso(), ...(extra || {}) }];
109
+ }
110
+
111
+ function setClaim(feature, status, claimant, reason) {
112
+ feature.claimant = claimant || null;
113
+ feature.claimStatus = status;
114
+ if (status === 'claimed' || status === 'active' || status === 'paused' || status === 'handoff-pending' || status === 'blocked') {
115
+ if (!feature.claimedAt) feature.claimedAt = nowIso();
116
+ }
117
+ if (status === 'unclaimed' || status === 'completed') {
118
+ // Keep claimedAt as historical record.
119
+ }
120
+ if (reason) feature.claimReason = reason;
121
+ }
122
+
123
+ function assertStatus(s) {
124
+ if (!CLAIM_STATUSES.includes(s)) {
125
+ throw new ClaimError('UNKNOWN_STATUS', `Unknown claim status: ${s}`);
126
+ }
127
+ }
128
+
129
+ function assertReason(r) {
130
+ if (!STEAL_REASONS.includes(r)) {
131
+ throw new ClaimError('UNKNOWN_STEAL_REASON', `Unknown steal reason: ${r}`);
132
+ }
133
+ }
134
+
135
+ // ── FeatureListBridge ────────────────────────────────────────────────
136
+
137
+ export class FeatureListBridge {
138
+ /**
139
+ * @param {object|string} opts Either a path string or `{ filePath, backup }`.
140
+ * - filePath: path to feature_list.json (default: ./feature_list.json)
141
+ * - backup : write a .bak copy before each write (default: true)
142
+ */
143
+ constructor(opts = {}) {
144
+ if (typeof opts === 'string') {
145
+ this.filePath = resolve(opts);
146
+ } else {
147
+ this.filePath = resolve(opts.filePath || 'feature_list.json');
148
+ this.backup = opts.backup !== false;
149
+ }
150
+ }
151
+
152
+ /** Load the feature list from disk. Returns the parsed JSON. */
153
+ load() {
154
+ const data = readJsonSafe(this.filePath);
155
+ if (!data) {
156
+ throw new ClaimError('NO_FILE', `feature_list.json not found at ${this.filePath}`);
157
+ }
158
+ if (!Array.isArray(data.features)) {
159
+ throw new ClaimError('SCHEMA', 'feature_list.json missing top-level features[]');
160
+ }
161
+ return data;
162
+ }
163
+
164
+ /** Save + atomic temp-rename. Creates a .bak if `backup=true`. */
165
+ save(data, { reason = 'update' } = {}) {
166
+ if (this.backup && existsSync(this.filePath)) {
167
+ try { copyFileSync(this.filePath, `${this.filePath}.bak`); } catch { /* best-effort */ }
168
+ }
169
+ writeJsonAtomic(this.filePath, data);
170
+ return { ok: true, path: this.filePath, reason };
171
+ }
172
+
173
+ _find(data, featureId) {
174
+ const idx = data.features.findIndex((f) => f.id === featureId);
175
+ if (idx === -1) {
176
+ throw new ClaimError('NOT_FOUND', `Feature ${featureId} not in feature_list.json`);
177
+ }
178
+ return idx;
179
+ }
180
+
181
+ _getOrThrow(data, featureId) {
182
+ return data.features[this._find(data, featureId)];
183
+ }
184
+
185
+ // ── claim ─────────────────────────────────────────────────────────
186
+
187
+ /**
188
+ * @param {string} featureId
189
+ * @param {{type:'human'|'agent', id:string, name?:string}} claimant
190
+ * @param {string} reason
191
+ * @returns {{ ok: true, feature: object }}
192
+ */
193
+ claim(featureId, claimant, reason) {
194
+ if (!claimant || (claimant.type !== 'human' && claimant.type !== 'agent')) {
195
+ throw new ClaimError('BAD_CLAIMANT', 'claimant must be {type:"human"|"agent", id, name?}');
196
+ }
197
+ const data = this.load();
198
+ const feature = this._getOrThrow(data, featureId);
199
+ const prev = feature.claimant || null;
200
+ const prevStatus = feature.claimStatus || 'unclaimed';
201
+
202
+ if (prevStatus !== 'unclaimed' && prevStatus !== 'completed') {
203
+ throw new ClaimError(
204
+ 'ALREADY_CLAIMED',
205
+ `Feature ${featureId} is ${prevStatus} by ${prev?.name || prev?.id || 'unknown'} — release or steal first.`,
206
+ );
207
+ }
208
+
209
+ feature.claimant = claimant;
210
+ feature.claimStatus = 'claimed';
211
+ feature.claimedAt = nowIso();
212
+ if (reason) feature.claimReason = reason;
213
+ appendHistory(feature, 'claim', { claimant, reason });
214
+
215
+ this.save(data, { reason: `claim:${featureId}` });
216
+ return { ok: true, feature, previousClaimant: prev };
217
+ }
218
+
219
+ // ── release ───────────────────────────────────────────────────────
220
+
221
+ /**
222
+ * @param {string} featureId
223
+ * @param {{id:string}} claimant expected to match the current claimant
224
+ * @param {string} reason
225
+ */
226
+ release(featureId, claimant, reason) {
227
+ const data = this.load();
228
+ const feature = this._getOrThrow(data, featureId);
229
+ const prevStatus = feature.claimStatus || 'unclaimed';
230
+ if (prevStatus === 'unclaimed' || prevStatus === 'completed') {
231
+ throw new ClaimError(
232
+ 'NOT_CLAIMED',
233
+ `Feature ${featureId} is ${prevStatus}; nothing to release.`,
234
+ );
235
+ }
236
+ if (claimant && feature.claimant && feature.claimant.id !== claimant.id) {
237
+ throw new ClaimError(
238
+ 'WRONG_CLAIMANT',
239
+ `Feature ${featureId} is claimed by ${feature.claimant.name || feature.claimant.id}, not ${claimant.name || claimant.id}.`,
240
+ );
241
+ }
242
+ const prev = feature.claimant;
243
+ feature.claimStatus = 'unclaimed';
244
+ appendHistory(feature, 'release', { releasedBy: claimant, reason });
245
+ // Keep claimant for historical record (the entry's `claimHistory`
246
+ // captures who held it); but flip `claimant` to null so further
247
+ // list({status: 'claimed'}) filters don't pick it up accidentally.
248
+ feature.claimant = null;
249
+
250
+ this.save(data, { reason: `release:${featureId}` });
251
+ return { ok: true, feature, previousClaimant: prev };
252
+ }
253
+
254
+ // ── handoff ───────────────────────────────────────────────────────
255
+
256
+ /**
257
+ * Hand off the feature from one claimant to another.
258
+ * The recipient must be a valid claimant shape.
259
+ */
260
+ handoff(featureId, fromClaimant, toClaimant, reason) {
261
+ if (!toClaimant || (toClaimant.type !== 'human' && toClaimant.type !== 'agent')) {
262
+ throw new ClaimError('BAD_CLAIMANT', 'toClaimant must be {type:"human"|"agent", id, name?}');
263
+ }
264
+ const data = this.load();
265
+ const feature = this._getOrThrow(data, featureId);
266
+ const prevStatus = feature.claimStatus || 'unclaimed';
267
+ if (prevStatus === 'unclaimed' || prevStatus === 'completed') {
268
+ throw new ClaimError('NOT_CLAIMED', `Feature ${featureId} is ${prevStatus}; cannot handoff.`);
269
+ }
270
+ if (fromClaimant && feature.claimant && feature.claimant.id !== fromClaimant.id) {
271
+ throw new ClaimError(
272
+ 'WRONG_CLAIMANT',
273
+ `Feature ${featureId} is held by ${feature.claimant.name || feature.claimant.id}, not ${fromClaimant.name || fromClaimant.id}.`,
274
+ );
275
+ }
276
+
277
+ appendHistory(feature, 'handoff-initiated', { from: feature.claimant, to: toClaimant, reason });
278
+ feature.handoffTo = toClaimant;
279
+ feature.claimStatus = 'handoff-pending';
280
+
281
+ // Synchronous accept per the simplest semantics — the CLI flag
282
+ // `bizar claim handoff` accepts immediately. An async workflow
283
+ // would split this into handoff-initiate + handoff-accept, but
284
+ // v1 keeps it atomic.
285
+ feature.claimant = toClaimant;
286
+ feature.claimStatus = 'claimed';
287
+ feature.claimedAt = nowIso();
288
+ appendHistory(feature, 'handoff-accepted', { by: toClaimant, reason });
289
+ delete feature.handoffTo;
290
+
291
+ this.save(data, { reason: `handoff:${featureId}` });
292
+ return { ok: true, feature };
293
+ }
294
+
295
+ // ── steal ─────────────────────────────────────────────────────────
296
+
297
+ /**
298
+ * Steal a feature from the current claimant. Requires a `stealReason`
299
+ * (one of STEAL_REASONS). Records the event in `claimHistory`.
300
+ */
301
+ steal(featureId, newClaimant, reason) {
302
+ assertReason(reason);
303
+ if (!newClaimant || (newClaimant.type !== 'human' && newClaimant.type !== 'agent')) {
304
+ throw new ClaimError('BAD_CLAIMANT', 'newClaimant must be {type:"human"|"agent", id, name?}');
305
+ }
306
+ const data = this.load();
307
+ const feature = this._getOrThrow(data, featureId);
308
+ const prevStatus = feature.claimStatus || 'unclaimed';
309
+ if (prevStatus === 'unclaimed' || prevStatus === 'completed') {
310
+ throw new ClaimError('NOT_CLAIMED', `Feature ${featureId} is ${prevStatus}; nothing to steal.`);
311
+ }
312
+ const prev = feature.claimant;
313
+ appendHistory(feature, 'steal', { stolenFrom: prev, stolenBy: newClaimant, reason });
314
+ feature.claimant = newClaimant;
315
+ feature.claimStatus = 'claimed';
316
+ feature.claimedAt = nowIso();
317
+ feature.claimReason = reason;
318
+
319
+ this.save(data, { reason: `steal:${featureId}` });
320
+ return { ok: true, feature, previousClaimant: prev, stealReason: reason };
321
+ }
322
+
323
+ // ── transition ────────────────────────────────────────────────────
324
+
325
+ /**
326
+ * Generic status transition (active / paused / blocked / completed).
327
+ * Used by the CLI to mark a claim actively-in-progress, paused,
328
+ * blocked, or completed.
329
+ */
330
+ transition(featureId, newStatus, claimant, reason) {
331
+ assertStatus(newStatus);
332
+ const data = this.load();
333
+ const feature = this._getOrThrow(data, featureId);
334
+ const prevStatus = feature.claimStatus || 'unclaimed';
335
+ if (newStatus === prevStatus) {
336
+ return { ok: true, feature, unchanged: true };
337
+ }
338
+ const allowed = ALLOWED_TRANSITIONS[prevStatus] || new Set();
339
+ if (!allowed.has(newStatus)) {
340
+ throw new ClaimError(
341
+ 'BAD_TRANSITION',
342
+ `Cannot transition ${featureId}: ${prevStatus} → ${newStatus} not allowed.`,
343
+ );
344
+ }
345
+ if (claimant && feature.claimant && feature.claimant.id !== claimant.id) {
346
+ throw new ClaimError(
347
+ 'WRONG_CLAIMANT',
348
+ `Feature ${featureId} is held by ${feature.claimant.name || feature.claimant.id}, not ${claimant.name || claimant.id}.`,
349
+ );
350
+ }
351
+ appendHistory(feature, 'transition', { from: prevStatus, to: newStatus, by: claimant, reason });
352
+ feature.claimStatus = newStatus;
353
+
354
+ this.save(data, { reason: `transition:${featureId}:${newStatus}` });
355
+ return { ok: true, feature };
356
+ }
357
+
358
+ // ── list ──────────────────────────────────────────────────────────
359
+
360
+ /**
361
+ * List features, optionally filtered by status or claimant.
362
+ * @param {{status?:string|string[], claimantId?:string}} filters
363
+ */
364
+ list(filters = {}) {
365
+ const data = this.load();
366
+ let out = data.features.slice();
367
+ if (filters.status) {
368
+ const statuses = Array.isArray(filters.status) ? filters.status : [filters.status];
369
+ out = out.filter((f) => statuses.includes(f.claimStatus || 'unclaimed'));
370
+ }
371
+ if (filters.claimantId) {
372
+ out = out.filter((f) => f.claimant && f.claimant.id === filters.claimantId);
373
+ }
374
+ if (filters.claimedByHuman != null) {
375
+ out = out.filter((f) => Boolean(f.claimant) === Boolean(filters.claimedByHuman) && (!f.claimant || f.claimant.type === 'human'));
376
+ }
377
+ if (filters.claimedByAgent != null) {
378
+ out = out.filter((f) => Boolean(f.claimant) && f.claimant.type === 'agent');
379
+ }
380
+ return out;
381
+ }
382
+
383
+ /** Get a single feature with its full claim history. */
384
+ get(featureId) {
385
+ const data = this.load();
386
+ return this._getOrThrow(data, featureId);
387
+ }
388
+ }
389
+
390
+ // ── Path helper ──────────────────────────────────────────────────────
391
+
392
+ import { cwd } from 'node:process';
393
+
394
+ /** Default path under cwd / feature_list.json. */
395
+ export function defaultFeatureListPath() {
396
+ if (process.env.BIZAR_FEATURE_LIST && process.env.BIZAR_FEATURE_LIST.trim()) {
397
+ return resolve(process.env.BIZAR_FEATURE_LIST);
398
+ }
399
+ return join(cwd(), 'feature_list.json');
400
+ }
package/cli/install.mjs CHANGED
@@ -16,7 +16,7 @@ const __dirname = dirname(fileURLToPath(import.meta.url));
16
16
 
17
17
  import { showBanner, showPantheon, sectionHeading } from './banner.mjs';
18
18
  import { promptComponents, promptInstallMode, promptAgents, promptSkillPacks, promptApiKeys, promptConfirmInstall, promptRestartCline } from './prompts.mjs';
19
- import { detectCline, detectHeadroom, detectSemble, detectSkillsCli, detectUv, buildSummary, clineAgentsDir, clineConfigDir, repoPath } from './utils.mjs';
19
+ import { detectClaude, detectHeadroom, detectSemble, detectSkillsCli, detectUv, buildSummary, claudeAgentsDir, claudeConfigDir, repoPath } from './utils.mjs';
20
20
  import { installAgents, installAgentsMd, installSkill, installClineJson, installBizarFolder, installPluginBizar, installHeadroom, installSemble, installSkillsCli, installCuratedSkills, installRules, installHooks, installCommands, installCommandsBizar, mergeToolsIntoUserConfig } from './copy.mjs';
21
21
 
22
22
  const AGENT_FILES = [
@@ -27,8 +27,12 @@ const AGENT_FILES = [
27
27
  ];
28
28
 
29
29
  /**
30
- * Install the Bizar cline plugin from this package's own
31
- * `plugins/bizar/` directory into `~/.config/cline/plugins/bizar/`.
30
+ * Install the Bizar MCP server from this package's own `plugins/bizar/`
31
+ * directory into `~/.claude/plugins/bizar/`.
32
+ *
33
+ * v6.3.0 — Bizar is Claude Code-native. The plugin entry-point still
34
+ * ships at `plugins/bizar/` as a back-compat shim that re-exports the
35
+ * SDK; the actual MCP server lives in `packages/sdk/src/mcp/bin.ts`.
32
36
  *
33
37
  * v4.0.0 consolidated everything into one npm package, so the plugin
34
38
  * source ships with `@polderlabs/bizar` itself — no separate
@@ -44,8 +48,8 @@ const AGENT_FILES = [
44
48
  * workspace-internal package not on the public registry. After copying
45
49
  * the plugin files, this function ALSO copies the source's `node_modules/`
46
50
  * to the deployed `node_modules/` so Bun can resolve the import when the
47
- * plugin is loaded from `~/.config/cline/plugins/bizar/`. Without
48
- * this, the plugin silently fails to load.
51
+ * plugin is loaded from `~/.claude/plugins/bizar/`. Without this, the
52
+ * plugin silently fails to load.
49
53
  *
50
54
  * Pass `{ silent: true }` to suppress the warning prints; the function
51
55
  * still returns `true` if the dest is already in the desired state.
@@ -65,7 +69,7 @@ export async function installPluginFromGlobal(opts = {}) {
65
69
  // A plain copy would dereference the symlink and silently break the
66
70
  // dev workflow. Print a hint unless silent, or honour an explicit
67
71
  // --force from the caller.
68
- const destDir = join(clineConfigDir(), 'plugins', 'bizar');
72
+ const destDir = join(claudeConfigDir(), 'plugins', 'bizar');
69
73
  let destIsSymlink = false;
70
74
  try {
71
75
  destIsSymlink = lstatSync(destDir).isSymbolicLink();
@@ -81,7 +85,7 @@ export async function installPluginFromGlobal(opts = {}) {
81
85
  }
82
86
  console.log(
83
87
  chalk.yellow(
84
- ' ⚠ ~/.config/cline/plugins/bizar is a dev symlink — skipping copy.',
88
+ ' ⚠ ~/.claude/plugins/bizar is a dev symlink — skipping copy.',
85
89
  ),
86
90
  );
87
91
  console.log(
@@ -197,11 +201,11 @@ export async function installPluginFromGlobal(opts = {}) {
197
201
  }
198
202
  }
199
203
 
200
- // Wire runtime deps (`zod` plus `@cline/sdk`, `@cline/core`,
201
- // `@cline/shared`) into the deployed plugin's `node_modules/`.
204
+ // Wire runtime deps (`zod` plus `@anthropic-ai/claude-agent-sdk`)
205
+ // into the deployed plugin's `node_modules/`.
202
206
  // Bun's module resolver walks up from the plugin entry point
203
207
  // looking for `node_modules/`, and without entries there the
204
- // plugin throws `Cannot find module 'zod' (+2 more)` at startup.
208
+ // plugin throws `Cannot find module 'zod'` at startup.
205
209
  //
206
210
  // The resolution logic lives in `cli/plugin-runtime-deps.mjs` and
207
211
  // is shared with the modern provisioner (`cli/provision.mjs`). It
@@ -479,46 +483,38 @@ async function promptGraphifyInstall() {
479
483
  }
480
484
 
481
485
  export async function runPostInstall() {
482
- // v6.1.0 — Bizar is Cline-only. The legacy opencode-era
483
- // `promptAndInstallOptional()` (plugin/dashboard presence probes)
484
- // has been removed; `cli/provision.mjs:runProvision` covers the same
485
- // surface via `runProvision({ mode: 'install' })`, which is the path
486
+ // v6.3.0 — Bizar is Claude Code-native. `cli/provision-claude.mjs:runProvision`
487
+ // covers the install/update/validate surface and is the primary path
486
488
  // used by `bizar install` and `bizar update`. This `runPostInstall`
487
- // is now a thin Cline-only bootstrap that:
488
- // - copies `config/cline.json` template on first install
489
- // - runs `installCommandsBizar()` for the legacy `commands-bizar/` dir
490
- // - installs agents into `~/.cline/agents/`
489
+ // is a thin Claude Code-native bootstrap that:
490
+ // - copies `config/settings.json` template on first install
491
+ // - installs agents into `~/.claude/agents/`
491
492
  // - probes for headroom / semble / skills-cli
492
493
  // - installs Headroom via pip or npm
493
- // The old OpenCode-era probes (`Plugin source present`,
494
- // `Dashboard source present`) moved to `cli/doctor.mjs` as live checks.
495
494
  const { mkdirSync, copyFileSync, existsSync } = await import('node:fs');
496
495
  const { execSync } = await import('node:child_process');
497
496
 
498
- const dest = join(clineConfigDir(), 'cline.json');
499
- const templateSrc = repoPath('config', 'cline.json');
497
+ const dest = join(claudeConfigDir(), 'settings.json');
498
+ const templateSrc = repoPath('config', 'settings.json');
500
499
  if (!existsSync(dest)) {
501
500
  if (existsSync(templateSrc)) {
502
- mkdirSync(clineConfigDir(), { recursive: true });
501
+ mkdirSync(claudeConfigDir(), { recursive: true });
503
502
  copyFileSync(templateSrc, dest);
504
- console.log(' ✓ cline.json bootstrapped from package template');
503
+ console.log(' ✓ settings.json bootstrapped from package template');
505
504
  }
506
505
  }
507
506
 
508
- // Install Bizar commands to commands-bizar/ (separate from ECC's commands symlink)
509
- await installCommandsBizar();
510
-
511
- const env = await detectCline();
507
+ const env = await detectClaude();
512
508
  if (!env.exists) {
513
- mkdirSync(clineConfigDir(), { recursive: true });
514
- console.log(`BizarHarness: created ${clineConfigDir()}/`);
509
+ mkdirSync(claudeConfigDir(), { recursive: true });
510
+ console.log(`BizarHarness: created ${claudeConfigDir()}/`);
515
511
  }
516
512
 
517
- mkdirSync(clineAgentsDir(), { recursive: true });
513
+ mkdirSync(claudeAgentsDir(), { recursive: true });
518
514
 
519
515
  for (const file of AGENT_FILES) {
520
516
  const src = repoPath('config', 'agents', file);
521
- const dest = join(clineAgentsDir(), file);
517
+ const dest = join(claudeAgentsDir(), file);
522
518
  if (!existsSync(dest)) {
523
519
  copyFileSync(src, dest);
524
520
  }
@@ -537,14 +533,14 @@ export async function runPostInstall() {
537
533
  'pip install --user "headroom-ai[all]"',
538
534
  { stdio: 'pipe', timeout: 60000 },
539
535
  );
540
- execSync('headroom wrap cline', { stdio: 'pipe' });
536
+ execSync('headroom wrap claude', { stdio: 'pipe' });
541
537
  console.log('BizarHarness: Headroom installed and configured.');
542
538
  }
543
539
  } catch {
544
540
  // Fall back to npm
545
541
  try {
546
542
  execSync('npm install -g headroom-ai', { stdio: 'pipe', timeout: 60000 });
547
- execSync('headroom wrap cline', { stdio: 'pipe' });
543
+ execSync('headroom wrap claude', { stdio: 'pipe' });
548
544
  console.log('BizarHarness: Headroom installed (npm) and configured.');
549
545
  } catch {
550
546
  console.log('BizarHarness: Headroom install failed. Install manually: pip install "headroom-ai[all]" or npm install -g headroom-ai');
@@ -552,10 +548,10 @@ export async function runPostInstall() {
552
548
  }
553
549
  } else {
554
550
  try {
555
- execSync('headroom wrap cline', { stdio: 'pipe' });
556
- console.log('BizarHarness: Headroom configured for cline.');
551
+ execSync('headroom wrap claude', { stdio: 'pipe' });
552
+ console.log('BizarHarness: Headroom configured for claude.');
557
553
  } catch {
558
- console.log('BizarHarness: could not configure Headroom. Run `headroom wrap cline` manually.');
554
+ console.log('BizarHarness: could not configure Headroom. Run `headroom wrap claude` manually.');
559
555
  }
560
556
  }
561
557
 
@@ -5,7 +5,7 @@
5
5
  * the node_modules copy step added in the "make the plugin-install fix
6
6
  * durable" change.
7
7
  *
8
- * Strategy: mock HOME so clineConfigDir() resolves inside a tmpdir,
8
+ * Strategy: mock HOME so claudeConfigDir() resolves inside a tmpdir,
9
9
  * and pass `opts.sourceDir` to bypass the `npm root -g` lookup with a
10
10
  * caller-supplied fake plugin source.
11
11
  *
@@ -31,25 +31,25 @@ const ORIG_HOME = process.env.HOME;
31
31
  const ORIG_XDG = process.env.XDG_CONFIG_HOME;
32
32
 
33
33
  /**
34
- * Point HOME at a fresh tmpdir so the module's clineConfigDir()
35
- * resolves inside it. As of v5.6.0-beta.12, `clineConfigDir()` returns
36
- * `<HOME>/.cline/` (matching Cline's own `resolveClineDir` since v3.0).
34
+ * Point HOME at a fresh tmpdir so the module's claudeConfigDir()
35
+ * resolves inside it. As of v6.3.0, `claudeConfigDir()` returns
36
+ * `<HOME>/.claude/`.
37
37
  *
38
- * We also reset CLINE_DIR and BIZAR_LEGACY_CLINE_DIR so the test uses
39
- * the canonical path even if the developer's env is non-default.
38
+ * We also reset CLAUDE_CONFIG_DIR and BIZAR_LEGACY_CLAUDE_DIR so the
39
+ * test uses the canonical path even if the developer's env is non-default.
40
40
  */
41
41
  function freshHome() {
42
42
  const home = mkdtempSync(join(tmpdir(), 'bizar-install-'));
43
43
  process.env.HOME = home;
44
44
  delete process.env.XDG_CONFIG_HOME;
45
- delete process.env.CLINE_DIR;
46
- delete process.env.BIZAR_LEGACY_CLINE_DIR;
45
+ delete process.env.CLAUDE_CONFIG_DIR;
46
+ delete process.env.BIZAR_LEGACY_CLAUDE_DIR;
47
47
  return home;
48
48
  }
49
49
 
50
50
  /** Path to the deployed plugin dir under the mocked HOME. */
51
51
  function pluginDest(home) {
52
- return join(home, '.cline', 'plugins', 'bizar');
52
+ return join(home, '.claude', 'plugins', 'bizar');
53
53
  }
54
54
 
55
55
  /**
@@ -19,6 +19,23 @@ export const VALID_TYPES = [
19
19
  'task_summary',
20
20
  'session_summary',
21
21
  'user_preference',
22
+ // v6.4.0 — F-033 ReasoningBank distillation pipeline (ADR-174).
23
+ // `pattern` is emitted by `bizar-dash/src/server/memory-consolidator.mjs`
24
+ // when a distillation run produces a promoted pattern (oracle:test-exec
25
+ // or judge:fable tier, ≥1 contributing entry). Patterns are searchable
26
+ // and re-feed into subsequent distillation runs as plain inputs.
27
+ 'pattern',
28
+ ];
29
+
30
+ export const VALID_PROVENANCE_TIERS = [
31
+ // Tier-1 (oracle) — observed via test execution. Eligible for promotion.
32
+ 'oracle:test-exec',
33
+ // Tier-2 (proxy) — structural inference only. NOT eligible for
34
+ // promotion; written to the vault but `promoted: false`.
35
+ 'proxy:structural',
36
+ // Tier-3 (judge:fable) — cost-bounded LLM-judge path; requires
37
+ // `BIZAR_DISTILL_BUDGET_USD > 0`. Out of scope in the $0 default.
38
+ 'judge:fable',
22
39
  ];
23
40
 
24
41
  export const VALID_STATUSES = [