@polderlabs/bizar 6.2.5 → 6.3.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 (329) 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/settings.json +116 -0
  41. package/.claude/skills/9router/SKILL.md +80 -0
  42. package/.claude/skills/9router-chat/SKILL.md +73 -0
  43. package/.claude/skills/9router-embeddings/SKILL.md +69 -0
  44. package/.claude/skills/9router-image/SKILL.md +86 -0
  45. package/.claude/skills/9router-stt/SKILL.md +79 -0
  46. package/.claude/skills/9router-tts/SKILL.md +80 -0
  47. package/.claude/skills/9router-web-fetch/SKILL.md +99 -0
  48. package/.claude/skills/9router-web-search/SKILL.md +91 -0
  49. package/.claude/skills/bizar/README.md +9 -0
  50. package/.claude/skills/bizar/SKILL.md +450 -0
  51. package/.claude/skills/cpp-coding-standards/README.md +28 -0
  52. package/.claude/skills/cpp-coding-standards/SKILL.md +634 -0
  53. package/.claude/skills/cpp-coding-standards/references/concurrency.md +320 -0
  54. package/.claude/skills/cpp-coding-standards/references/error-handling.md +229 -0
  55. package/.claude/skills/cpp-coding-standards/references/memory-safety.md +216 -0
  56. package/.claude/skills/cpp-coding-standards/references/modern-idioms.md +282 -0
  57. package/.claude/skills/cpp-coding-standards/references/review-checklist.md +96 -0
  58. package/.claude/skills/cpp-testing/README.md +28 -0
  59. package/.claude/skills/cpp-testing/SKILL.md +304 -0
  60. package/.claude/skills/cpp-testing/references/coverage.md +370 -0
  61. package/.claude/skills/cpp-testing/references/framework-compare.md +175 -0
  62. package/.claude/skills/cpp-testing/references/host-test-for-embedded.md +499 -0
  63. package/.claude/skills/cpp-testing/references/mocking.md +364 -0
  64. package/.claude/skills/cpp-testing/references/tdd-workflow.md +308 -0
  65. package/.claude/skills/cubesandbox/SKILL.md +148 -0
  66. package/.claude/skills/embedded-esp-idf/README.md +41 -0
  67. package/.claude/skills/embedded-esp-idf/SKILL.md +439 -0
  68. package/.claude/skills/embedded-esp-idf/references/freertos-patterns.md +214 -0
  69. package/.claude/skills/embedded-esp-idf/references/host-tests.md +164 -0
  70. package/.claude/skills/embedded-esp-idf/references/idf-py-commands.md +157 -0
  71. package/.claude/skills/embedded-esp-idf/references/kconfig.md +159 -0
  72. package/.claude/skills/embedded-esp-idf/references/logging-discipline.md +118 -0
  73. package/.claude/skills/embedded-esp-idf/references/memory-and-iram.md +137 -0
  74. package/.claude/skills/embedded-esp-idf/references/nvs.md +121 -0
  75. package/.claude/skills/embedded-esp-idf/references/packed-structs.md +192 -0
  76. package/.claude/skills/embedded-esp-idf/scripts/idf_env.sh +47 -0
  77. package/.claude/skills/embedded-esp-idf/scripts/size_check.sh +77 -0
  78. package/.claude/skills/glyph/SKILL.md +163 -0
  79. package/.claude/skills/harness-engineering/SKILL.md +143 -0
  80. package/.claude/skills/lightrag/SKILL.md +81 -0
  81. package/.claude/skills/memory-protocol/SKILL.md +105 -0
  82. package/.claude/skills/obsidian/SKILL.md +306 -0
  83. package/.claude/skills/read-the-damn-docs/SKILL.md +113 -0
  84. package/.claude/skills/self-improvement/SKILL.md +64 -0
  85. package/README.md +87 -59
  86. package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js → EnvVarsSection-B58aiJiE.js} +1 -1
  87. package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js.map → EnvVarsSection-B58aiJiE.js.map} +1 -1
  88. package/bizar-dash/dist/assets/{MobileChat-BnKN_Ks_.js → MobileChat-BJrqwVDd.js} +1 -1
  89. package/bizar-dash/dist/assets/{MobileChat-BnKN_Ks_.js.map → MobileChat-BJrqwVDd.js.map} +1 -1
  90. package/bizar-dash/dist/assets/{MobileSettings-DjCPxC-Q.js → MobileSettings-CEQNJNLJ.js} +1 -1
  91. package/bizar-dash/dist/assets/{MobileSettings-DjCPxC-Q.js.map → MobileSettings-CEQNJNLJ.js.map} +1 -1
  92. package/bizar-dash/dist/assets/{main-DYiZqMrn.js → main-IvfQAOfy.js} +1 -1
  93. package/bizar-dash/dist/assets/{main-DYiZqMrn.js.map → main-IvfQAOfy.js.map} +1 -1
  94. package/bizar-dash/dist/assets/{markdown-C6mXtQxD.js → markdown-tOLaD6nm.js} +1 -1
  95. package/bizar-dash/dist/assets/{markdown-C6mXtQxD.js.map → markdown-tOLaD6nm.js.map} +1 -1
  96. package/bizar-dash/dist/assets/{mobile-CMHqtLV2.js → mobile-DYCHcUpq.js} +1 -1
  97. package/bizar-dash/dist/assets/{mobile-CMHqtLV2.js.map → mobile-DYCHcUpq.js.map} +1 -1
  98. package/bizar-dash/dist/assets/{mobile-layout-3jIhHX_p.js → mobile-layout-CBHjpwsb.js} +2 -2
  99. package/bizar-dash/dist/assets/{mobile-layout-3jIhHX_p.js.map → mobile-layout-CBHjpwsb.js.map} +1 -1
  100. package/bizar-dash/dist/assets/{useSlashCommands-DtITw8Xv.js → useSlashCommands-Bd7_FA6U.js} +2 -2
  101. package/bizar-dash/dist/assets/{useSlashCommands-DtITw8Xv.js.map → useSlashCommands-Bd7_FA6U.js.map} +1 -1
  102. package/bizar-dash/dist/assets/{vendor-CeHGtduv.js → vendor-C843201K.js} +12 -12
  103. package/bizar-dash/dist/assets/vendor-C843201K.js.map +1 -0
  104. package/bizar-dash/dist/index.html +6 -6
  105. package/bizar-dash/dist/mobile.html +2 -2
  106. package/bizar-dash/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
  107. package/bizar-dash/src/server/api.mjs +4 -4
  108. package/bizar-dash/src/server/background-store.mjs +15 -16
  109. package/bizar-dash/src/server/bg-poller.mjs +25 -35
  110. package/bizar-dash/src/server/bg-retry.mjs +66 -194
  111. package/bizar-dash/src/server/claude-bg-spawner.mjs +390 -0
  112. package/bizar-dash/src/server/claude-info.mjs +412 -0
  113. package/bizar-dash/src/server/{cline-runner.mjs → claude-runner.mjs} +53 -48
  114. package/bizar-dash/src/server/claude-sdk.mjs +191 -0
  115. package/bizar-dash/src/server/providers-store.mjs +22 -49
  116. package/bizar-dash/src/server/routes/background.mjs +24 -20
  117. package/bizar-dash/src/server/routes/chat.mjs +223 -326
  118. package/bizar-dash/src/server/routes/claude-session-detail.mjs +329 -0
  119. package/bizar-dash/src/server/routes/claude-sessions.mjs +259 -0
  120. package/bizar-dash/src/server/routes/tasks.mjs +20 -28
  121. package/bizar-dash/src/server/task-delegator.mjs +76 -77
  122. package/bizar-dash/src/web/components/chat/useChat.ts +23 -27
  123. package/bizar-dash/src/web/views/Chat.tsx +8 -8
  124. package/cli/bin.mjs +17 -18
  125. package/cli/commands/claude-cmd.mjs +348 -0
  126. package/cli/commands/install.mjs +12 -11
  127. package/cli/commands/validate.mjs +252 -325
  128. package/cli/dev-link.test.mjs +11 -11
  129. package/cli/doctor.mjs +131 -213
  130. package/cli/install.mjs +33 -37
  131. package/cli/install.test.mjs +9 -9
  132. package/cli/provision-claude.mjs +893 -0
  133. package/cli/provision.mjs +224 -227
  134. package/cli/utils.mjs +72 -58
  135. package/config/AGENTS.md +28 -28
  136. package/install.sh +66 -44
  137. package/package.json +19 -11
  138. package/packages/sdk/ARCHITECTURE.md +40 -36
  139. package/packages/sdk/package-lock.json +32 -0
  140. package/packages/sdk/package.json +15 -5
  141. package/{plugins/bizar → packages/sdk}/src/dangerous-patterns.ts +6 -28
  142. package/packages/sdk/src/fingerprint.ts +0 -0
  143. package/packages/sdk/src/index.ts +38 -73
  144. package/packages/sdk/src/mcp/bin.ts +51 -0
  145. package/packages/sdk/src/mcp/server.ts +498 -0
  146. package/{plugins/bizar/src/memory-vault.ts → packages/sdk/src/memory/index.ts} +18 -21
  147. package/packages/sdk/tests/sdk.test.mjs +148 -0
  148. package/packages/sdk/vitest.config.ts +1 -1
  149. package/scripts/bh-full-e2e.mjs +166 -363
  150. package/scripts/check-deps.mjs +28 -46
  151. package/scripts/mirror-claude-md.sh +78 -0
  152. package/scripts/test-in-container.sh +31 -9
  153. package/templates/clean-state-checklist.md +3 -3
  154. package/templates/sprint-contract.md +2 -2
  155. package/bizar-dash/.bizar/activity.log +0 -3
  156. package/bizar-dash/.omx/logs/omx-2026-07-07.jsonl +0 -1
  157. package/bizar-dash/.omx/state/session.json +0 -10
  158. package/bizar-dash/bizar-design/EXPLANATION.md +0 -307
  159. package/bizar-dash/bizar-design/INSTRUCTIONS.md +0 -149
  160. package/bizar-dash/bizar-design/canvas.html +0 -281
  161. package/bizar-dash/bizar-design/canvas.html.artifact.json +0 -19
  162. package/bizar-dash/bizar-design/components.css +0 -1665
  163. package/bizar-dash/bizar-design/components.html +0 -557
  164. package/bizar-dash/bizar-design/components.html.artifact.json +0 -19
  165. package/bizar-dash/bizar-design/desktop/agents.html +0 -74
  166. package/bizar-dash/bizar-design/desktop/agents.html.artifact.json +0 -19
  167. package/bizar-dash/bizar-design/desktop/memory.html +0 -75
  168. package/bizar-dash/bizar-design/desktop/memory.html.artifact.json +0 -19
  169. package/bizar-dash/bizar-design/desktop/metrics.html +0 -63
  170. package/bizar-dash/bizar-design/desktop/metrics.html.artifact.json +0 -19
  171. package/bizar-dash/bizar-design/desktop/overview.html +0 -95
  172. package/bizar-dash/bizar-design/desktop/overview.html.artifact.json +0 -19
  173. package/bizar-dash/bizar-design/desktop/settings.html +0 -70
  174. package/bizar-dash/bizar-design/desktop/settings.html.artifact.json +0 -19
  175. package/bizar-dash/bizar-design/icons.svg +0 -44
  176. package/bizar-dash/bizar-design/index.html +0 -192
  177. package/bizar-dash/bizar-design/index.html.artifact.json +0 -19
  178. package/bizar-dash/bizar-design/mobile/agents.html +0 -29
  179. package/bizar-dash/bizar-design/mobile/agents.html.artifact.json +0 -19
  180. package/bizar-dash/bizar-design/mobile/memory.html +0 -28
  181. package/bizar-dash/bizar-design/mobile/memory.html.artifact.json +0 -19
  182. package/bizar-dash/bizar-design/mobile/metrics.html +0 -29
  183. package/bizar-dash/bizar-design/mobile/metrics.html.artifact.json +0 -19
  184. package/bizar-dash/bizar-design/mobile/overview.html +0 -33
  185. package/bizar-dash/bizar-design/mobile/overview.html.artifact.json +0 -19
  186. package/bizar-dash/bizar-design/mobile/settings.html +0 -28
  187. package/bizar-dash/bizar-design/mobile/settings.html.artifact.json +0 -19
  188. package/bizar-dash/bizar-design/prototype.js +0 -114
  189. package/bizar-dash/bizar-design/tokens.css +0 -106
  190. package/bizar-dash/dist/assets/vendor-CeHGtduv.js.map +0 -1
  191. package/bizar-dash/node_modules/.package-lock.json +0 -6
  192. package/bizar-dash/package-lock.json +0 -6
  193. package/bizar-dash/src/server/cline-sdk.mjs +0 -132
  194. package/bizar-dash/src/server/routes/cline-session-detail.mjs +0 -559
  195. package/bizar-dash/src/server/routes/cline-sessions.mjs +0 -291
  196. package/cli/commands/cline-cmd.mjs +0 -289
  197. package/cli/commands/validate.test.mjs +0 -379
  198. package/cli/doctor.test.mjs +0 -350
  199. package/config/cline.json.template +0 -342
  200. package/packages/sdk/src/client.ts +0 -188
  201. package/packages/sdk/src/cline-events.ts +0 -134
  202. package/packages/sdk/src/cline-types.ts +0 -66
  203. package/packages/sdk/src/cline.ts +0 -339
  204. package/packages/sdk/src/errors.ts +0 -129
  205. package/packages/sdk/src/events.ts +0 -153
  206. package/packages/sdk/src/types.ts +0 -176
  207. package/packages/sdk/tests/client.test.ts +0 -217
  208. package/packages/sdk/tests/errors.test.ts +0 -108
  209. package/packages/sdk/tests/events.test.ts +0 -139
  210. package/packages/sdk/tests/fixtures/fetch-mock.ts +0 -152
  211. package/packages/sdk/tests/fixtures/sse-mock.ts +0 -30
  212. package/plugins/bizar/ARCHITECTURE.md +0 -142
  213. package/plugins/bizar/CONSTRAINTS.md +0 -67
  214. package/plugins/bizar/LICENSE +0 -21
  215. package/plugins/bizar/README.md +0 -448
  216. package/plugins/bizar/index.ts +0 -925
  217. package/plugins/bizar/package.json +0 -39
  218. package/plugins/bizar/scripts/check-forbidden-imports.sh +0 -33
  219. package/plugins/bizar/src/background-state.ts +0 -641
  220. package/plugins/bizar/src/background.ts +0 -1806
  221. package/plugins/bizar/src/cline-runner.ts +0 -203
  222. package/plugins/bizar/src/clineruntime.ts +0 -227
  223. package/plugins/bizar/src/commands-impl.ts +0 -151
  224. package/plugins/bizar/src/commands.ts +0 -1799
  225. package/plugins/bizar/src/compaction.d.mts +0 -48
  226. package/plugins/bizar/src/compaction.mjs +0 -192
  227. package/plugins/bizar/src/dashboard-client.ts +0 -233
  228. package/plugins/bizar/src/event-stream.ts +0 -606
  229. package/plugins/bizar/src/fingerprint.ts +0 -120
  230. package/plugins/bizar/src/handoff.ts +0 -79
  231. package/plugins/bizar/src/hooks/memory-flush-on-compact.ts +0 -123
  232. package/plugins/bizar/src/hooks/memory-inject.ts +0 -247
  233. package/plugins/bizar/src/hooks/memory-write-on-end.ts +0 -188
  234. package/plugins/bizar/src/hooks/skill-curator.ts +0 -180
  235. package/plugins/bizar/src/http-client.ts +0 -467
  236. package/plugins/bizar/src/key-rotation.ts +0 -218
  237. package/plugins/bizar/src/logger.ts +0 -144
  238. package/plugins/bizar/src/loop-engineering.ts +0 -241
  239. package/plugins/bizar/src/loop.ts +0 -176
  240. package/plugins/bizar/src/mistake-recovery.ts +0 -98
  241. package/plugins/bizar/src/odin.ts +0 -227
  242. package/plugins/bizar/src/options.ts +0 -470
  243. package/plugins/bizar/src/plan-fs.ts +0 -323
  244. package/plugins/bizar/src/reasoning-clean.ts +0 -454
  245. package/plugins/bizar/src/report.ts +0 -178
  246. package/plugins/bizar/src/research-prompt.ts +0 -35
  247. package/plugins/bizar/src/serve-info.ts +0 -228
  248. package/plugins/bizar/src/serve.ts +0 -496
  249. package/plugins/bizar/src/settings.ts +0 -349
  250. package/plugins/bizar/src/state.ts +0 -298
  251. package/plugins/bizar/src/tool-discipline.ts +0 -105
  252. package/plugins/bizar/src/tools/agent-browser.ts +0 -315
  253. package/plugins/bizar/src/tools/bg-collect.ts +0 -131
  254. package/plugins/bizar/src/tools/bg-get-comments.ts +0 -266
  255. package/plugins/bizar/src/tools/bg-kill.ts +0 -116
  256. package/plugins/bizar/src/tools/bg-pause.ts +0 -99
  257. package/plugins/bizar/src/tools/bg-report-progress.ts +0 -115
  258. package/plugins/bizar/src/tools/bg-resume.ts +0 -94
  259. package/plugins/bizar/src/tools/bg-send-message.ts +0 -223
  260. package/plugins/bizar/src/tools/bg-spawn.ts +0 -502
  261. package/plugins/bizar/src/tools/bg-status.ts +0 -130
  262. package/plugins/bizar/src/tools/graph-query.ts +0 -278
  263. package/plugins/bizar/src/tools/loop-engineering.ts +0 -193
  264. package/plugins/bizar/src/tools/memory-list.ts +0 -43
  265. package/plugins/bizar/src/tools/memory-read.ts +0 -69
  266. package/plugins/bizar/src/tools/memory-search.ts +0 -47
  267. package/plugins/bizar/src/tools/memory-write.ts +0 -54
  268. package/plugins/bizar/src/tools/open-kb.ts +0 -198
  269. package/plugins/bizar/src/tools/plan-action.ts +0 -785
  270. package/plugins/bizar/src/tools/read-glyph-feedback.ts +0 -191
  271. package/plugins/bizar/src/tools/sandbox.ts +0 -232
  272. package/plugins/bizar/src/tools/team-spawn.ts +0 -73
  273. package/plugins/bizar/src/tools/team-status.ts +0 -76
  274. package/plugins/bizar/src/tools/wait-for-feedback.ts +0 -415
  275. package/plugins/bizar/src/trajectory.ts +0 -104
  276. package/plugins/bizar/tests/README.md +0 -99
  277. package/plugins/bizar/tests/attach-handler-bug.test.ts +0 -169
  278. package/plugins/bizar/tests/background-state.test.ts +0 -277
  279. package/plugins/bizar/tests/background.test.ts +0 -402
  280. package/plugins/bizar/tests/block.test.ts +0 -195
  281. package/plugins/bizar/tests/canonical-key-order.test.ts +0 -75
  282. package/plugins/bizar/tests/clineruntime-config.test.ts +0 -283
  283. package/plugins/bizar/tests/commands-impl.test.ts +0 -316
  284. package/plugins/bizar/tests/commands.test.ts +0 -584
  285. package/plugins/bizar/tests/compaction.test.ts +0 -264
  286. package/plugins/bizar/tests/config.test.ts +0 -128
  287. package/plugins/bizar/tests/dashboard-client.test.ts +0 -159
  288. package/plugins/bizar/tests/dispose.test.ts +0 -336
  289. package/plugins/bizar/tests/event-stream.test.ts +0 -409
  290. package/plugins/bizar/tests/event.test.ts +0 -262
  291. package/plugins/bizar/tests/fingerprint.test.ts +0 -190
  292. package/plugins/bizar/tests/http-client.test.ts +0 -404
  293. package/plugins/bizar/tests/init-helpers.test.ts +0 -203
  294. package/plugins/bizar/tests/integration/slash-command.test.ts +0 -349
  295. package/plugins/bizar/tests/integration/tool-routing.test.ts +0 -98
  296. package/plugins/bizar/tests/key-rotation.test.ts +0 -396
  297. package/plugins/bizar/tests/loop-engineering.test.ts +0 -168
  298. package/plugins/bizar/tests/loop.test.ts +0 -397
  299. package/plugins/bizar/tests/memory-write-on-end.test.ts +0 -92
  300. package/plugins/bizar/tests/mistake-recovery.test.ts +0 -116
  301. package/plugins/bizar/tests/odin.test.ts +0 -125
  302. package/plugins/bizar/tests/options.test.ts +0 -329
  303. package/plugins/bizar/tests/reasoning-clean.test.ts +0 -422
  304. package/plugins/bizar/tests/safety.test.ts +0 -281
  305. package/plugins/bizar/tests/serve.test.ts +0 -339
  306. package/plugins/bizar/tests/settings.test.ts +0 -351
  307. package/plugins/bizar/tests/stall-think.test.ts +0 -750
  308. package/plugins/bizar/tests/state.test.ts +0 -276
  309. package/plugins/bizar/tests/tool-discipline.test.ts +0 -77
  310. package/plugins/bizar/tests/tools/agent-browser.test.ts +0 -98
  311. package/plugins/bizar/tests/tools/bg-collect.test.ts +0 -337
  312. package/plugins/bizar/tests/tools/bg-get-comments.test.ts +0 -485
  313. package/plugins/bizar/tests/tools/bg-kill.test.ts +0 -235
  314. package/plugins/bizar/tests/tools/bg-pause.test.ts +0 -61
  315. package/plugins/bizar/tests/tools/bg-report-progress.test.ts +0 -79
  316. package/plugins/bizar/tests/tools/bg-resume.test.ts +0 -40
  317. package/plugins/bizar/tests/tools/bg-send-message.test.ts +0 -116
  318. package/plugins/bizar/tests/tools/bg-spawn-delegation.test.ts +0 -147
  319. package/plugins/bizar/tests/tools/bg-spawn-http.test.ts +0 -233
  320. package/plugins/bizar/tests/tools/bg-spawn.test.ts +0 -311
  321. package/plugins/bizar/tests/tools/bg-status.test.ts +0 -217
  322. package/plugins/bizar/tests/tools/cline-runner.test.ts +0 -115
  323. package/plugins/bizar/tests/tools/plan-action.test.ts +0 -599
  324. package/plugins/bizar/tests/tools/read-glyph-feedback.test.ts +0 -253
  325. package/plugins/bizar/tests/tools/sandbox.test.ts +0 -117
  326. package/plugins/bizar/tests/tools/wait-for-feedback.test.ts +0 -390
  327. package/plugins/bizar/tests/update-deadlock.test.ts +0 -151
  328. package/plugins/bizar/tsconfig.json +0 -29
  329. package/scripts/mirror-agents-md.sh +0 -69
package/cli/provision.mjs CHANGED
@@ -1,16 +1,13 @@
1
1
  /**
2
2
  * cli/provision.mjs
3
3
  *
4
- * v4.4.7 — Unified installer + updater.
4
+ * v6.3.0 — Unified installer + updater (Claude Code-native).
5
5
  *
6
6
  * `bizar install` and `bizar update` used to be two separate code paths
7
7
  * (install.sh + cli/install.mjs for install, cli/update.mjs for update)
8
- * with massive overlap: both copied agents, both patched cline.json,
8
+ * with massive overlap: both copied agents, both patched settings.json,
9
9
  * both ran the plugin copy, both kicked off the service, both called
10
- * `bizar doctor` at the end. The two paths diverged over time, and the
11
- * user-visible bug was that `update` tried to install separate npm
12
- * packages (@polderlabs/bizar-plugin, @polderlabs/bizar-dash) that no
13
- * longer exist.
10
+ * `bizar doctor` at the end. The two paths diverged over time.
14
11
  *
15
12
  * This module is the single source of truth. Both `bizar install` and
16
13
  * `bizar update` call `runProvision({ mode, ... })`. The differences
@@ -21,9 +18,10 @@
21
18
  * doctor. Does NOT kill running instances (fresh install
22
19
  * has none).
23
20
  * update: refresh an existing install. Kills running instances,
24
- * upgrades @polderlabs/bizar + cline via npm, re-copies
25
- * agent files / plugin / skills, re-patches cline.json
26
- * (idempotent), restarts the dashboard, runs doctor.
21
+ * upgrades @polderlabs/bizar + @anthropic-ai/claude-code via
22
+ * npm, re-copies agent files / skills / commands, re-patches
23
+ * ~/.claude/settings.json (idempotent), restarts the
24
+ * dashboard, runs doctor.
27
25
  *
28
26
  * Both modes are safe to re-run — every step is idempotent and skips
29
27
  * work that's already done.
@@ -58,55 +56,57 @@ export const PKG_MAIN = '@polderlabs/bizar';
58
56
  export const BIZAR_HOME = bizarConfigDir();
59
57
 
60
58
  /**
61
- * Resolve the Cline config directory.
59
+ * Resolve the Claude Code config directory.
62
60
  *
63
- * Cline (v3.0+) uses `~/.cline/` (or `$CLINE_DIR`) as the global config dir
64
- * for `agents/`, `skills/`, `plugins/`, `hooks/`, `rules/`, `workflows/`.
65
- * It also checks `~/.agents/skills/` for global agents, and
66
- * `~/Documents/Cline/{Plugins,Hooks,Rules,Workflows,Agents}/` as a
67
- * Documents-side mirror.
61
+ * Claude Code (v1.0+) uses `~/.claude/` (or `$CLAUDE_CONFIG_DIR`) as the
62
+ * global config dir for `agents/`, `skills/`, `plugins/`, `commands/`,
63
+ * `hooks/`, and `settings.json`.
68
64
  *
69
- * v4.4.7–v5.6.0 of this provisioner hard-coded `~/.config/cline/`, which was
70
- * the OpenCode layout. After the Phase-1 Cline migration (v5.6.0-beta.9),
71
- * agents/commands/skills were still being written to `~/.config/cline/` and
72
- * silently invisible to the `cline` CLI. Fixed in v5.6.0-beta.12.
65
+ * Resolution order (matches Claude Code's configuration discovery):
66
+ * 1. `process.env.CLAUDE_CONFIG_DIR` (explicit override)
67
+ * 2. `$HOME/.claude` (the Claude Code default)
68
+ * 3. (Windows only) `%USERPROFILE%/.claude`
73
69
  *
74
- * Resolution order (matches Cline's `resolveClineDir()` in
75
- * `@cline/shared/dist/storage/index.js`):
76
- * 1. `process.env.CLINE_DIR` (explicit override)
77
- * 2. `$HOME/.cline` (the Cline default — matches `cline config --config` discovery)
78
- * 3. (Windows only) `%APPDATA%\cline`
79
- *
80
- * `BIZAR_LEGACY_CLINE_DIR=1` opts back into the old `~/.config/cline/`
81
- * layout for users who deliberately want the legacy path.
70
+ * `BIZAR_LEGACY_CLAUDE_DIR=1` opts back into the old Cline layout
71
+ * (`~/.config/cline/`) for users who deliberately want the legacy path.
72
+ * Removed in v6.3.0 — Claude Code is the only supported backend.
82
73
  */
83
- function resolveClineDir() {
84
- if (process.env.BIZAR_LEGACY_CLINE_DIR === '1') {
74
+ function resolveClaudeDir() {
75
+ if (process.env.BIZAR_LEGACY_CLAUDE_DIR === '1') {
85
76
  return join(
86
77
  process.env.XDG_CONFIG_HOME || join(HOME, '.config'),
87
78
  'cline',
88
79
  );
89
80
  }
90
- if (process.env.CLINE_DIR && process.env.CLINE_DIR.trim()) {
91
- return process.env.CLINE_DIR.trim();
81
+ if (process.env.CLAUDE_CONFIG_DIR && process.env.CLAUDE_CONFIG_DIR.trim()) {
82
+ return process.env.CLAUDE_CONFIG_DIR.trim();
92
83
  }
93
84
  if (process.platform === 'win32') {
94
- return join(process.env.APPDATA || HOME, 'cline');
85
+ return join(HOME, '.claude');
95
86
  }
96
- return join(HOME, '.cline');
87
+ return join(HOME, '.claude');
97
88
  }
98
89
 
99
- export const CLINE_DIR = resolveClineDir();
90
+ /**
91
+ * Compatibility export — many existing checks still reference this name.
92
+ * @deprecated Use `CLAUDE_DIR` instead.
93
+ */
94
+ export const CLAUDE_DIR = resolveClaudeDir();
95
+
96
+ /**
97
+ * Back-compat alias used by other modules + scripts.
98
+ * Same value as CLAUDE_DIR; kept so old imports still resolve.
99
+ * @deprecated Use `CLAUDE_DIR` instead.
100
+ */
101
+ export const CLINE_DIR = resolveClaudeDir();
100
102
 
101
103
  /**
102
104
  * Legacy Cline directory (the old OpenCode layout).
103
105
  *
104
- * Kept as an opt-in fallback for users who already have agents/commands/
105
- * skills installed under `~/.config/cline/` and want to keep using them
106
- * there. The installer writes new content to `CLINE_DIR` (current Cline
107
- * default) but still emits a warning if `LEGACY_CLINE_DIR` exists.
106
+ * Kept as an opt-in fallback. The installer warns but does not write
107
+ * here under the v6.3.0 Claude Code-native flow.
108
108
  */
109
- export const LEGACY_CLINE_DIR = join(
109
+ export const LEGACY_CLAUDE_DIR = join(
110
110
  process.env.XDG_CONFIG_HOME || join(HOME, '.config'),
111
111
  'cline',
112
112
  );
@@ -319,7 +319,7 @@ export function writeBizarSkillLock({ skillsSrc, agentsDir }) {
319
319
  * clineJson: { path, hasPluginEntry, exists },
320
320
  * service: { installed, running, unitPath },
321
321
  * dashboard: { running, pid, port },
322
- * clineCli: { version, latest },
322
+ * claudeCli: { version, latest },
323
323
  * headsUpState: { ok, blockerCount, warningCount },
324
324
  * gitRepo: boolean, // are we running from a git checkout?
325
325
  * }
@@ -365,9 +365,9 @@ export function detectState({ cwd = process.cwd() } = {}) {
365
365
  const pkgVersion = globalRoot ? currentVersion(PKG_MAIN) : null;
366
366
  const pkgLatest = latestVersion(PKG_MAIN);
367
367
 
368
- // ── Plugin copy (deployed to ${CLINE_DIR}/plugins/bizar) ──
368
+ // ── Plugin copy (deployed to ${CLAUDE_DIR}/plugins/bizar) ──
369
369
  const pluginSourceDir = pkgRoot ? join(pkgRoot, 'plugins', 'bizar') : null;
370
- const pluginDestDir = join(CLINE_DIR, 'plugins', 'bizar');
370
+ const pluginDestDir = join(CLAUDE_DIR, 'plugins', 'bizar');
371
371
  let pluginInstalled = false;
372
372
  let pluginUpToDate = false;
373
373
  let pluginSymlink = false;
@@ -392,13 +392,12 @@ export function detectState({ cwd = process.cwd() } = {}) {
392
392
  }
393
393
 
394
394
  // ── cline.json plugin entry ───────────────────────────────────────
395
- const clineJsonPath = join(CLINE_DIR, 'cline.json');
396
- const clineJson = readJsonSafe(clineJsonPath, null);
397
- let hasPluginEntry = false;
398
- if (clineJson && Array.isArray(clineJson.plugin)) {
399
- hasPluginEntry = clineJson.plugin.some(
400
- (p) => Array.isArray(p) && typeof p[0] === 'string' && p[0].includes('plugins/bizar'),
401
- );
395
+ // v6.3.0 — Read Claude Code settings.json (replaces cline.json).
396
+ const claudeSettingsPath = join(CLAUDE_DIR, 'settings.json');
397
+ const claudeSettings = readJsonSafe(claudeSettingsPath, null);
398
+ let hasMcpServerEntry = false;
399
+ if (claudeSettings && claudeSettings.mcpServers && typeof claudeSettings.mcpServers === 'object') {
400
+ hasMcpServerEntry = !!claudeSettings.mcpServers.bizar;
402
401
  }
403
402
 
404
403
  // ── Background service ─────────────────────────────────────────────
@@ -418,10 +417,10 @@ export function detectState({ cwd = process.cwd() } = {}) {
418
417
  const dashboardPid = readLivePid(DASHBOARD_PID_FILE);
419
418
  const dashboardPort = parseInt(readTextSafe(DASHBOARD_PORT_FILE, '').trim(), 10) || null;
420
419
 
421
- // ── cline CLI version ───────────────────────────────────────────
422
- const clineCli = {
423
- version: currentVersion('cline'),
424
- latest: latestVersion('cline'),
420
+ // ── Claude Code CLI version ────────────────────────────────────────
421
+ const claudeCli = {
422
+ version: currentVersion('@anthropic-ai/claude-code'),
423
+ latest: latestVersion('@anthropic-ai/claude-code'),
425
424
  };
426
425
 
427
426
  // ── Heads-up gate (.bizar/PRE_PUSH_NOTES.md) ───────────────────────
@@ -455,10 +454,10 @@ export function detectState({ cwd = process.cwd() } = {}) {
455
454
  upToDate: pluginUpToDate,
456
455
  symlink: pluginSymlink,
457
456
  },
458
- clineJson: {
459
- path: clineJsonPath,
460
- exists: !!clineJson,
461
- hasPluginEntry,
457
+ claudeSettings: {
458
+ path: claudeSettingsPath,
459
+ exists: !!claudeSettings,
460
+ hasMcpServerEntry,
462
461
  },
463
462
  service: {
464
463
  installed: serviceInstalled,
@@ -471,7 +470,7 @@ export function detectState({ cwd = process.cwd() } = {}) {
471
470
  pid: dashboardPid,
472
471
  port: dashboardPort,
473
472
  },
474
- clineCli,
473
+ claudeCli,
475
474
  headsUpState,
476
475
  gitRepo,
477
476
  installedMods,
@@ -626,40 +625,53 @@ export async function ensureNpmPackage(pkg, { mode, dryRun, force }) {
626
625
  }
627
626
 
628
627
  export async function updateClineCli({ dryRun, force }) {
629
- const current = currentVersion('cline');
630
- const latest = latestVersion('cline');
628
+ // v6.3.0 — Back-compat alias. The new code path upgrades the
629
+ // `@anthropic-ai/claude-code` npm package instead of `cline`.
630
+ return updateClaudeCodeCli({ dryRun, force });
631
+ }
632
+
633
+ export async function updateClaudeCodeCli({ dryRun, force }) {
634
+ const current = currentVersion('@anthropic-ai/claude-code');
635
+ const latest = latestVersion('@anthropic-ai/claude-code');
631
636
 
632
637
  if (current && current === latest && !force) {
633
- return { ok: true, message: `cline@${current} up to date`, installed: current };
638
+ return {
639
+ ok: true,
640
+ message: `@anthropic-ai/claude-code@${current} up to date`,
641
+ installed: current,
642
+ };
634
643
  }
635
644
 
636
645
  if (dryRun) {
637
- return { ok: true, message: '[dry-run] cline upgrade' };
646
+ return { ok: true, message: '[dry-run] @anthropic-ai/claude-code upgrade' };
638
647
  }
639
648
 
640
- // Prefer the upstream installer (`cline upgrade`). Falls back to npm.
641
- const r1 = spawnSync('cline', ['upgrade'], { stdio: 'inherit' });
642
- if (r1.status === 0) {
643
- return { ok: true, message: 'cline updated via `cline upgrade`' };
644
- }
645
- console.log(chalk.dim(' cline upgrade not available; falling back to npm'));
646
- const npm2Args = ['install', '-g', 'cline@latest'];
649
+ // Claude Code ships via npm; `claude upgrade` is not a built-in
650
+ // subcommand. Always go through npm.
651
+ const npmArgs = ['install', '-g', '@anthropic-ai/claude-code@latest'];
647
652
  if (process.env.NPM_CONFIG_PREFIX) {
648
- npm2Args.push('--prefix', process.env.NPM_CONFIG_PREFIX);
653
+ npmArgs.push('--prefix', process.env.NPM_CONFIG_PREFIX);
649
654
  }
650
- const r2 = spawnSync('npm', npm2Args, { stdio: 'inherit', timeout: 600000 });
651
- if (r2.status === null && r2.error?.code === 'ETIMEDOUT') {
652
- return { ok: false, message: 'cline install timed out after 10 minutes' };
655
+ const r = spawnSync('npm', npmArgs, { stdio: 'inherit', timeout: 600000 });
656
+ if (r.status === null && r.error?.code === 'ETIMEDOUT') {
657
+ return {
658
+ ok: false,
659
+ message: '@anthropic-ai/claude-code install timed out after 10 minutes',
660
+ };
653
661
  }
654
- if (r2.status === 0) {
655
- return { ok: true, message: 'cline updated via npm' };
662
+ if (r.status !== 0) {
663
+ return { ok: false, message: '@anthropic-ai/claude-code install failed' };
656
664
  }
657
- return { ok: false, message: 'cline update failed' };
665
+ return {
666
+ ok: true,
667
+ message: '@anthropic-ai/claude-code updated',
668
+ installed: latestVersion('@anthropic-ai/claude-code'),
669
+ };
658
670
  }
659
671
 
660
672
  /**
661
673
  * Copy `plugins/bizar/` from the npm-installed package into
662
- * `${CLINE_DIR}/plugins/bizar/`. Skips if the dest is a dev symlink
674
+ * `${CLAUDE_DIR}/plugins/bizar/`. Skips if the dest is a dev symlink
663
675
  * (set by `bizar dev-link`). Idempotent — safe to re-run.
664
676
  *
665
677
  * Bug history (v5.6.0-beta.12): the cp filter used to be
@@ -687,31 +699,27 @@ export async function copyPluginToCline({ dryRun, force }) {
687
699
  };
688
700
  }
689
701
 
690
- // v5.6.0-beta.14: require a package.json with a `cline` field before
691
- // copying. Per https://docs.cline.bot/customization/plugins — without
692
- // the `cline.plugins` manifest, Cline falls back to recursive
693
- // auto-discovery and tries to load every .ts file in the plugin tree
694
- // (including `src/tools/*.ts`, `tests/*.test.ts`) as a plugin module,
695
- // which produces ~100 `Invalid plugin module` errors at startup.
696
- // Refuse to copy a plugin that isn't actually a Cline plugin.
702
+ // v6.3.0 — Claude Code uses MCP servers, not the legacy Cline
703
+ // plugin manifest. The Bizar SDK ships under packages/sdk/ and is
704
+ // registered in ~/.claude/settings.json as `mcpServers.bizar`. The
705
+ // plugins/bizar/ tree is now a thin shim that re-exports the SDK,
706
+ // and we no longer copy it into ${CLAUDE_DIR}/plugins/bizar/.
707
+ // We only verify that the source has a package.json (sanity check).
697
708
  const pkgJsonPath = join(src, 'package.json');
698
709
  if (!existsSync(pkgJsonPath)) {
699
710
  return {
700
711
  ok: false,
701
712
  message:
702
713
  `plugin source missing package.json at ${pkgJsonPath} — ` +
703
- `rebuild @polderlabs/bizar (the plugin must ship a cline field)`,
714
+ `rebuild @polderlabs/bizar`,
704
715
  };
705
716
  }
706
717
  try {
707
718
  const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
708
- if (!pkg.cline?.plugins?.length) {
719
+ if (!pkg.name) {
709
720
  return {
710
721
  ok: false,
711
- message:
712
- `plugin package.json at ${pkgJsonPath} is missing the ` +
713
- 'cline.plugins manifest required by Cline — see ' +
714
- 'https://docs.cline.bot/customization/plugins',
722
+ message: `plugin package.json at ${pkgJsonPath} is missing required 'name' field`,
715
723
  };
716
724
  }
717
725
  } catch (err) {
@@ -788,7 +796,7 @@ export async function copyPluginToCline({ dryRun, force }) {
788
796
 
789
797
  // Copy the SDK into the deployed plugin's node_modules so Bun can
790
798
  // resolve @polderlabs/bizar-sdk when loading the plugin from
791
- // ${CLINE_DIR}/plugins/bizar/.
799
+ // ${CLAUDE_DIR}/plugins/bizar/.
792
800
  const sdkSrc = join(state.pkgRoot, 'node_modules', '@polderlabs', 'bizar-sdk');
793
801
  const sdkDst = join(dest, 'node_modules', '@polderlabs', 'bizar-sdk');
794
802
  if (existsSync(sdkSrc)) {
@@ -796,16 +804,18 @@ export async function copyPluginToCline({ dryRun, force }) {
796
804
  await cp(sdkSrc, sdkDst, { recursive: true });
797
805
  }
798
806
 
799
- // Wire runtime deps (`zod`, `@cline/*`) into the deployed plugin's
800
- // node_modules/ so Bun's module resolver finds them when loading the
801
- // plugin from ${CLINE_DIR}/plugins/bizar/. Without this, the plugin
802
- // throws "Cannot find module 'zod' (+2 more)" at startup.
807
+ // Wire runtime deps (`zod`, `@anthropic-ai/claude-agent-sdk`) into
808
+ // the deployed plugin's node_modules/ so Bun's module resolver
809
+ // finds them when loading the plugin from
810
+ // ${CLAUDE_DIR}/plugins/bizar/. Without this, the plugin throws
811
+ // "Cannot find module 'zod' (+2 more)" at startup.
803
812
  //
804
813
  // The resolution logic lives in `cli/plugin-runtime-deps.mjs` and is
805
814
  // shared with the legacy installer (`cli/install.mjs`). It searches
806
- // the Bizar npm pkg's own `node_modules/`, then the `cline` npm
807
- // pkg's `node_modules/`, then the dev source tree. Symlinks are
808
- // preferred; recursive copy is the fallback.
815
+ // the Bizar npm pkg's own `node_modules/`, then the
816
+ // `@anthropic-ai/claude-code` npm pkg's `node_modules/`, then the
817
+ // dev source tree. Symlinks are preferred; recursive copy is the
818
+ // fallback.
809
819
  //
810
820
  // Only wire when the plugin entry is a `.ts` source file. If the
811
821
  // plugin ships a pre-bundled `dist/index.js`, the runtime deps are
@@ -894,155 +904,134 @@ function readdirSyncSafe(p) {
894
904
  }
895
905
 
896
906
  /**
897
- * Ensure the Bizar plugin entry exists in `${CLINE_DIR}/cline.json`.
907
+ * Ensure the Bizar plugin entry exists in `${CLAUDE_DIR}/cline.json`.
898
908
  * Idempotent: if the entry already exists, no-op.
899
909
  */
900
910
  export async function patchClineJson({ dryRun, force }) {
901
- const cfgPath = join(CLINE_DIR, 'cline.json');
911
+ // v6.3.0 — Claude Code-native. The "plugin entry" model is gone;
912
+ // Claude Code uses an MCP server entry in `mcpServers` plus optional
913
+ // hooks in `hooks`. We still expose this function under the old name
914
+ // for back-compat with callers (e.g. update.mjs), but the body now
915
+ // patches ~/.claude/settings.json.
916
+ return patchClaudeSettings({ dryRun, force });
917
+ }
918
+
919
+ export async function patchClaudeSettings({ dryRun, force }) {
920
+ const cfgPath = join(CLAUDE_DIR, 'settings.json');
902
921
  if (!existsSync(cfgPath)) {
903
922
  if (dryRun) {
904
923
  return { ok: true, message: `[dry-run] would bootstrap ${cfgPath}` };
905
924
  }
906
- mkdirSync(CLINE_DIR, { recursive: true });
907
- const templateSrc = join(REPO_ROOT, 'config', 'cline.json');
925
+ mkdirSync(CLAUDE_DIR, { recursive: true });
926
+ const templateSrc = join(REPO_ROOT, 'config', 'claude.settings.json');
908
927
  if (existsSync(templateSrc)) {
909
- const { copyFileSync } = await import('node:fs');
910
- copyFileSync(templateSrc, cfgPath);
928
+ const { copyFileSync: cfs } = await import('node:fs');
929
+ cfs(templateSrc, cfgPath);
911
930
  return { ok: true, message: `${cfgPath} bootstrapped from package template` };
912
931
  }
913
932
  writeFileSync(cfgPath, JSON.stringify({
914
- $schema: 'https://docs.cline.bot/config.json',
915
- plugin: [],
933
+ $schema: 'https://json.schemastore.org/claude-code-settings.json',
934
+ mcpServers: {
935
+ bizar: {
936
+ command: 'bizar-mcp',
937
+ args: [],
938
+ },
939
+ },
940
+ hooks: {},
916
941
  }, null, 2));
917
942
  return { ok: true, message: `${cfgPath} created` };
918
943
  }
919
944
 
920
- // File exists. Check whether the Bizar entry is already there.
945
+ // File exists. Patch the Bizar config surface idempotently.
921
946
  const cfg = readJsonSafe(cfgPath, null);
922
947
  if (!cfg || typeof cfg !== 'object') {
923
948
  return { ok: false, message: `${cfgPath} is not valid JSON` };
924
949
  }
925
- const plugins = Array.isArray(cfg.plugin) ? cfg.plugin : [];
926
- const hasEntry = plugins.some(
927
- (p) => Array.isArray(p) && typeof p[0] === 'string' && p[0].includes('plugins/bizar'),
928
- );
929
950
 
930
- // v6.2.2 — Multi-patch installer. On every install/update, ensure the
931
- // Bizar config surface is present in cline.json:
951
+ // v6.3.0 — Multi-patch installer. On every install/update, ensure the
952
+ // Bizar config surface is present in ~/.claude/settings.json:
932
953
  //
933
- // 1. plugin entry — add if missing (the critical one; without this
934
- // the Bizar plugin never loads).
935
- // 2. default_agent — set to "odin" if missing.
936
- // 3. $schema — add if missing (helps editors validate).
937
- // 4. instructions — point at .cline/instructions/bizar-tools.md if
938
- // missing, so Cline loads the tool reference on every session.
939
- // 5. permissions — set to "allow" if missing.
940
- // 6. snapshot — set to false if missing.
941
- //
942
- // v6.2.2 REMOVED:
943
- // - provider.9router (was added automatically in v6.0.1–v6.2.1)
944
- // - provider.minimax (legacy fallback)
954
+ // 1. mcpServers.bizar — register the Bizar MCP server (the critical
955
+ // entry; without this, Claude Code has no access to Bizar tools).
956
+ // 2. $schema — add if missing (helps editors validate).
957
+ // 3. hooks — point at .claude/hooks/bizar-tools.md so Claude Code
958
+ // fires them on every session.
945
959
  //
946
960
  // Per user request: "the installer should do nothing with providers,
947
- // the user has to configure it themselves." The user picks their own
948
- // provider, plugs in their API key, and configures which model catalog
949
- // to use. The installer just sets up the Bizar scaffolding (plugin
950
- // entry, default agent, schema, instructions, etc.) and stays out of
961
+ // the user has to configure it themselves." The installer sets up the
962
+ // Bizar scaffolding (MCP server entry, schema, hooks) and stays out of
951
963
  // provider configuration entirely.
952
964
  //
953
965
  // All patches are additive and idempotent. We never overwrite a value
954
966
  // the user has set; the `force` flag bypasses that protection for the
955
- // plugin entry only.
956
- let addedDefaultAgent = false;
967
+ // MCP server entry only.
968
+ let addedMcpServer = false;
957
969
  let addedSchema = false;
958
- let addedInstructions = false;
959
- let addedPermissions = false;
960
- let addedSnapshot = false;
961
-
962
- // 1. default_agent
963
- if (!cfg.default_agent) {
964
- cfg.default_agent = 'odin';
965
- addedDefaultAgent = true;
970
+ let addedHooks = false;
971
+
972
+ const mcpServers = (cfg.mcpServers && typeof cfg.mcpServers === 'object')
973
+ ? cfg.mcpServers : {};
974
+ if (!mcpServers.bizar) {
975
+ mcpServers.bizar = {
976
+ command: 'bizar-mcp',
977
+ args: [],
978
+ };
979
+ addedMcpServer = true;
966
980
  }
981
+ cfg.mcpServers = mcpServers;
967
982
 
968
983
  // 2. $schema
969
984
  if (!cfg.$schema) {
970
- cfg.$schema = 'https://docs.cline.bot/config.json';
985
+ cfg.$schema = 'https://json.schemastore.org/claude-code-settings.json';
971
986
  addedSchema = true;
972
987
  }
973
988
 
974
- // 3. instructions — point at the bundled Bizar tools reference.
975
- if (!cfg.instructions || (Array.isArray(cfg.instructions) && cfg.instructions.length === 0)) {
976
- cfg.instructions = ['.cline/instructions/bizar-tools.md'];
977
- addedInstructions = true;
978
- }
979
-
980
- // 4. permission
981
- if (!cfg.permission) {
982
- cfg.permission = 'allow';
983
- addedPermissions = true;
984
- }
985
-
986
- // 5. snapshot
987
- if (typeof cfg.snapshot !== 'boolean') {
988
- cfg.snapshot = false;
989
- addedSnapshot = true;
989
+ // 3. hooks — point at the bundled Bizar hooks file.
990
+ if (!cfg.hooks || (typeof cfg.hooks === 'object' && Object.keys(cfg.hooks).length === 0)) {
991
+ cfg.hooks = {
992
+ SessionStart: [
993
+ {
994
+ hooks: [
995
+ {
996
+ type: 'command',
997
+ command: 'cat .claude/hooks/bizar-tools.md',
998
+ },
999
+ ],
1000
+ },
1001
+ ],
1002
+ };
1003
+ addedHooks = true;
990
1004
  }
991
1005
 
992
- const anyAdded = addedDefaultAgent || addedSchema
993
- || addedInstructions || addedPermissions || addedSnapshot;
1006
+ const anyAdded = addedMcpServer || addedSchema || addedHooks;
994
1007
 
995
- if (hasEntry && !force && !anyAdded) {
996
- return { ok: true, message: 'cline.json already has Bizar plugin entry' };
1008
+ if (!addedMcpServer && !force && !anyAdded) {
1009
+ return { ok: true, message: 'settings.json already has Bizar MCP server entry' };
997
1010
  }
998
1011
 
999
1012
  if (dryRun) {
1000
1013
  const added = [];
1001
- if (!hasEntry) added.push('plugin entry');
1002
- if (addedDefaultAgent) added.push('default_agent');
1014
+ if (addedMcpServer) added.push('mcpServers.bizar');
1003
1015
  if (addedSchema) added.push('$schema');
1004
- if (addedInstructions) added.push('instructions');
1005
- if (addedPermissions) added.push('permission');
1006
- if (addedSnapshot) added.push('snapshot');
1007
- return { ok: true, message: `[dry-run] would patch cline.json with: ${added.join(', ')}` };
1008
- }
1009
-
1010
- if (!hasEntry) {
1011
- // v5.6.0-beta.14: point at the plugin DIRECTORY (not a file inside
1012
- // it). Cline reads `package.json#cline.plugins` from there and loads
1013
- // the entry point declared in the manifest. Pointing at `index.ts`
1014
- // directly used to work, but with the new auto-discovery rules (see
1015
- // https://docs.cline.bot/customization/plugins) it can cause every
1016
- // .ts file under the plugin tree to be loaded as a separate plugin
1017
- // module — producing ~100 `Invalid plugin module` errors at startup.
1018
- plugins.push(['./plugins/bizar', {
1019
- loopThresholdWarn: 5,
1020
- loopThresholdEscalate: 8,
1021
- loopThresholdBlock: 12,
1022
- loopWindowSize: 10,
1023
- clineruntimeMaxConsecutiveMistakes: 6,
1024
- }]);
1025
- cfg.plugin = plugins;
1016
+ if (addedHooks) added.push('hooks');
1017
+ return { ok: true, message: `[dry-run] would patch settings.json with: ${added.join(', ')}` };
1026
1018
  }
1027
1019
 
1028
1020
  writeFileSync(cfgPath, JSON.stringify(cfg, null, 2) + '\n');
1029
1021
  const added = [];
1030
- if (!hasEntry) added.push('plugin entry');
1031
- if (addedDefaultAgent) added.push('default_agent');
1022
+ if (addedMcpServer) added.push('mcpServers.bizar');
1032
1023
  if (addedSchema) added.push('$schema');
1033
- if (addedInstructions) added.push('instructions');
1034
- if (addedPermissions) added.push('permission');
1035
- if (addedSnapshot) added.push('snapshot');
1024
+ if (addedHooks) added.push('hooks');
1036
1025
  return {
1037
1026
  ok: true,
1038
1027
  message: added.length > 0
1039
- ? `cline.json patched: ${added.join(', ')}`
1040
- : 'cline.json already complete',
1028
+ ? `settings.json patched: ${added.join(', ')}`
1029
+ : 'settings.json already complete',
1041
1030
  };
1042
1031
  }
1043
1032
 
1044
1033
  /**
1045
- * Copy `config/agents/*.md` into `${CLINE_DIR}/agents/`. Idempotent.
1034
+ * Copy `config/agents/*.md` into `${CLAUDE_DIR}/agents/`. Idempotent.
1046
1035
  * Doesn't overwrite existing files unless `force: true`.
1047
1036
  */
1048
1037
  export async function syncAgentFiles({ dryRun, force }) {
@@ -1058,11 +1047,11 @@ export async function syncAgentFiles({ dryRun, force }) {
1058
1047
  * (frontmatter + body). Both are valid: the body is the system prompt,
1059
1048
  * the frontmatter is config. To make agents loadable by the Cline CLI
1060
1049
  * we copy both `.md` (legacy / docs) and `.yaml` (Cline-loadable) into
1061
- * `${CLINE_DIR}/agents/`. The YAML version is auto-generated if
1050
+ * `${CLAUDE_DIR}/agents/`. The YAML version is auto-generated if
1062
1051
  * missing, with the `name` field added from the filename.
1063
1052
  */
1064
1053
  const srcDir = join(REPO_ROOT, 'config', 'agents');
1065
- const dstDir = join(CLINE_DIR, 'agents');
1054
+ const dstDir = join(CLAUDE_DIR, 'agents');
1066
1055
  if (!existsSync(srcDir)) {
1067
1056
  return { ok: true, message: 'no bundled agents to sync' };
1068
1057
  }
@@ -1212,7 +1201,7 @@ function mdToClineAgentYaml(mdText, fallbackName) {
1212
1201
  * `lightrag`, `memory-protocol`, `self-improvement`) were silently
1213
1202
  * missing from the installed Cline.
1214
1203
  * - Each skill is copied as its OWN subdirectory under
1215
- * `${CLINE_DIR}/skills/<name>/` (e.g. `skills/obsidian/SKILL.md`),
1204
+ * `${CLAUDE_DIR}/skills/<name>/` (e.g. `skills/obsidian/SKILL.md`),
1216
1205
  * matching Cline's `resolveSkillsConfigSearchPaths` layout. Previously
1217
1206
  * all skills were flattened into one dir, causing `SKILL.md` from
1218
1207
  * each to overwrite the previous one — only the last copy survived.
@@ -1221,7 +1210,7 @@ function mdToClineAgentYaml(mdText, fallbackName) {
1221
1210
  * - Idempotent: re-running refreshes content but never deletes user
1222
1211
  * additions.
1223
1212
  *
1224
- * v6.0.1 — also syncs `config/rules/*.md` into `${CLINE_DIR}/rules/`.
1213
+ * v6.0.1 — also syncs `config/rules/*.md` into `${CLAUDE_DIR}/rules/`.
1225
1214
  * Previously `config/rules/*.md` was only copied by the legacy
1226
1215
  * `cli/copy.mjs:installRules()` helper, never invoked by `bizar install`
1227
1216
  * or `bizar update` (which both go through `runProvision`). This meant
@@ -1257,7 +1246,7 @@ export async function syncConfigExtras({ dryRun }) {
1257
1246
  // Cline searches `~/.cline/commands/` for command files (.md).
1258
1247
  const commandsSrc = join(REPO_ROOT, 'config', 'commands');
1259
1248
  if (existsSync(commandsSrc)) {
1260
- const commandsDst = join(CLINE_DIR, 'commands');
1249
+ const commandsDst = join(CLAUDE_DIR, 'commands');
1261
1250
  mkdirSync(commandsDst, { recursive: true });
1262
1251
  // One subdir per command (matching Cline's command loading pattern).
1263
1252
  for (const cmd of readdirSync(commandsSrc, { withFileTypes: true })) {
@@ -1276,7 +1265,7 @@ export async function syncConfigExtras({ dryRun }) {
1276
1265
  // Legacy: also drop a copy under `commands-bizar/` for back-compat
1277
1266
  // with anyone referencing the v3.x command tree path.
1278
1267
  if (existsSync(commandsSrc)) {
1279
- const commandsBizarDst = join(CLINE_DIR, 'commands-bizar');
1268
+ const commandsBizarDst = join(CLAUDE_DIR, 'commands-bizar');
1280
1269
  mkdirSync(commandsBizarDst, { recursive: true });
1281
1270
  for (const cmd of readdirSync(commandsSrc, { withFileTypes: true })) {
1282
1271
  if (!cmd.isFile()) continue;
@@ -1291,7 +1280,7 @@ export async function syncConfigExtras({ dryRun }) {
1291
1280
  // subdir of `config/skills/` (no hardcoded list).
1292
1281
  const skillsSrc = join(REPO_ROOT, 'config', 'skills');
1293
1282
  if (existsSync(skillsSrc)) {
1294
- const skillsDst = join(CLINE_DIR, 'skills');
1283
+ const skillsDst = join(CLAUDE_DIR, 'skills');
1295
1284
  mkdirSync(skillsDst, { recursive: true });
1296
1285
  for (const skillDir of readdirSync(skillsSrc, { withFileTypes: true })) {
1297
1286
  if (!skillDir.isDirectory()) continue;
@@ -1341,7 +1330,7 @@ export async function syncConfigExtras({ dryRun }) {
1341
1330
  // marketplace / loader, and the baseline fails to attach.
1342
1331
  const sharedAgentsDir = join(REPO_ROOT, 'config', 'agents', '_shared');
1343
1332
  if (existsSync(join(sharedAgentsDir, 'AGENT_BASELINE.md'))) {
1344
- const baselineSkillDir1 = join(CLINE_DIR, 'skills', 'agent-baseline');
1333
+ const baselineSkillDir1 = join(CLAUDE_DIR, 'skills', 'agent-baseline');
1345
1334
  const baselineSkillDir2 = join(HOME, '.agents', 'skills', 'agent-baseline');
1346
1335
  mkdirSync(baselineSkillDir1, { recursive: true });
1347
1336
  mkdirSync(baselineSkillDir2, { recursive: true });
@@ -1376,7 +1365,7 @@ export async function syncConfigExtras({ dryRun }) {
1376
1365
  .map((e) => e.name);
1377
1366
 
1378
1367
  // Install to ~/.cline/hooks/ (used by --hooks-dir override)
1379
- const hooksDst1 = join(CLINE_DIR, 'hooks');
1368
+ const hooksDst1 = join(CLAUDE_DIR, 'hooks');
1380
1369
  mkdirSync(hooksDst1, { recursive: true });
1381
1370
  for (const hookFile of hookFiles) {
1382
1371
  const src = join(hooksSrc, hookFile);
@@ -1409,7 +1398,7 @@ export async function syncConfigExtras({ dryRun }) {
1409
1398
  // existed but was empty on a fresh install.
1410
1399
  const rulesSrc = join(REPO_ROOT, 'config', 'rules');
1411
1400
  if (existsSync(rulesSrc)) {
1412
- const rulesDst = join(CLINE_DIR, 'rules');
1401
+ const rulesDst = join(CLAUDE_DIR, 'rules');
1413
1402
  mkdirSync(rulesDst, { recursive: true });
1414
1403
  let ruleCount = 0;
1415
1404
  for (const entry of readdirSync(rulesSrc, { withFileTypes: true })) {
@@ -1427,7 +1416,7 @@ export async function syncConfigExtras({ dryRun }) {
1427
1416
  // ── Workflows ────────────────────────────────────────────────
1428
1417
  const workflowsSrc = join(REPO_ROOT, 'config', 'workflows');
1429
1418
  if (existsSync(workflowsSrc)) {
1430
- const workflowsDst = join(CLINE_DIR, 'workflows');
1419
+ const workflowsDst = join(CLAUDE_DIR, 'workflows');
1431
1420
  mkdirSync(workflowsDst, { recursive: true });
1432
1421
  await copyDirIfExists(workflowsSrc, workflowsDst);
1433
1422
  counts.workflows = 1;
@@ -1439,7 +1428,7 @@ export async function syncConfigExtras({ dryRun }) {
1439
1428
  // path). Clean up those legacy flat dirs so users on older installs
1440
1429
  // don't keep seeing the wrong skill.
1441
1430
  for (const legacy of ['skill']) {
1442
- const p = join(CLINE_DIR, legacy);
1431
+ const p = join(CLAUDE_DIR, legacy);
1443
1432
  if (existsSync(p)) {
1444
1433
  // Only remove if it's flat (no subdirs). Real skill dirs under
1445
1434
  // skills/<name>/SKILL.md live in `skills/`, not `skill/`.
@@ -1810,7 +1799,7 @@ export function spawnFreshDashboard({ port } = {}) {
1810
1799
  * 5. Upgrade npm packages (bizar + cline).
1811
1800
  * 6. Shell to install.sh for system-deps + service registration.
1812
1801
  * 7. Sync agent files, slash commands, skills, hooks, workflows.
1813
- * 8. Copy plugin to ${CLINE_DIR}/plugins/bizar/.
1802
+ * 8. Copy plugin to ${CLAUDE_DIR}/plugins/bizar/.
1814
1803
  * 9. Patch cline.json with the Bizar plugin entry.
1815
1804
  * 10. (update only) Restart dashboard.
1816
1805
  * 11. Doctor health check.
@@ -1867,7 +1856,11 @@ export async function runProvision(opts = {}) {
1867
1856
  if (mode === 'update') {
1868
1857
  console.log(' Installed vs. latest:');
1869
1858
  printVersionMatrix([
1870
- { label: 'cline', current: state.clineCli.version, latest: state.clineCli.latest },
1859
+ {
1860
+ label: '@anthropic-ai/claude-code',
1861
+ current: state.claudeCli.version,
1862
+ latest: state.claudeCli.latest,
1863
+ },
1871
1864
  { label: PKG_MAIN, current: state.pkgVersion, latest: state.pkgLatest },
1872
1865
  ]);
1873
1866
  console.log('');
@@ -1926,7 +1919,9 @@ export async function runProvision(opts = {}) {
1926
1919
  };
1927
1920
 
1928
1921
  if (mode === 'update') {
1929
- await runStep('cline', () => updateClineCli({ dryRun, force }));
1922
+ await runStep('@anthropic-ai/claude-code', () =>
1923
+ updateClaudeCodeCli({ dryRun, force }),
1924
+ );
1930
1925
  }
1931
1926
  await runStep(PKG_MAIN, () => ensureNpmPackage(PKG_MAIN, { mode, dryRun, force }));
1932
1927
 
@@ -1939,7 +1934,7 @@ export async function runProvision(opts = {}) {
1939
1934
  // ── 6.5. LightRAG install (Node-side, in case shell script skipped) ─
1940
1935
  await runStep('lightrag-server', () => installLightragProvision({ dryRun }));
1941
1936
 
1942
- // ── 7-9. Sync agent files, commands, skills, plugin, cline.json ──
1937
+ // ── 7-9. Sync agent files, commands, skills, plugin, settings.json ─
1943
1938
  console.log('');
1944
1939
  await runStep('agent files + slash commands + skills', () =>
1945
1940
  Promise.all([
@@ -1951,10 +1946,9 @@ export async function runProvision(opts = {}) {
1951
1946
  return { ok: allOk, message: msgs || 'synced' };
1952
1947
  }),
1953
1948
  );
1954
- await runStep(`plugin → ${CLINE_DIR}/plugins/bizar/`, () =>
1955
- copyPluginToCline({ dryRun, force }),
1949
+ await runStep('settings.json Bizar entry', () =>
1950
+ patchClaudeSettings({ dryRun, force }),
1956
1951
  );
1957
- await runStep('cline.json plugin entry', () => patchClineJson({ dryRun, force }));
1958
1952
 
1959
1953
  // ── 9.5. v5.x — issue #7. Restart the system service so it picks up
1960
1954
  // the freshly-installed binary. We do this AFTER the npm upgrade
@@ -2052,27 +2046,26 @@ export async function runProvision(opts = {}) {
2052
2046
  }
2053
2047
 
2054
2048
  // ── 13. Provider bootstrap warning ───────────────────────────────
2055
- // v6.2.2 — The installer no longer configures a provider. The user
2049
+ // v6.3.0 — The installer no longer configures a provider. The user
2056
2050
  // must add their own. After a successful install, surface a clear
2057
- // hint pointing them at the right places.
2051
+ // hint pointing them at Claude Code's settings.json.
2058
2052
  if (mode === 'install' && !dryRun && !anyFail) {
2059
- const cfgPath = join(CLINE_DIR, 'cline.json');
2053
+ const cfgPath = join(CLAUDE_DIR, 'settings.json');
2060
2054
  const cfg = readJsonSafe(cfgPath, null);
2061
- const hasProvider = cfg && cfg.provider && Object.keys(cfg.provider).length > 0;
2062
- if (!hasProvider) {
2063
- console.log(chalk.yellow(' ⚠ No provider configured in cline.json.'));
2055
+ // Claude Code doesn't have a "provider" config block; providers
2056
+ // are configured in `env` (per-session overrides) or via the
2057
+ // `claude` CLI's `/config` command. We only check for the env
2058
+ // presence here.
2059
+ const hasAnthropicKey = !!process.env.ANTHROPIC_API_KEY;
2060
+ if (!hasAnthropicKey) {
2061
+ console.log(chalk.yellow(' ⚠ No ANTHROPIC_API_KEY in your environment.'));
2064
2062
  console.log(chalk.yellow(' `bizar install` no longer touches provider config (v6.2.2+).'));
2065
- console.log(chalk.yellow(' You must add one yourself — see the "Provider setup" section below.'));
2063
+ console.log(chalk.yellow(' You must set one yourself — see the "Provider setup" section below.'));
2066
2064
  console.log('');
2067
2065
  console.log(chalk.cyan(' ┌─ Provider setup ─────────────────────────────────────────────┐'));
2068
- console.log(chalk.cyan(' │ 1. Edit ~/.cline/cline.json and add a `provider` block: │'));
2069
- console.log(chalk.cyan(' │ { "provider": { "9router": { │'));
2070
- console.log(chalk.cyan(' │ "baseUrl": "http://localhost:20128/v1", │'));
2071
- console.log(chalk.cyan(' │ "apiKey": "<your-key>", │'));
2072
- console.log(chalk.cyan(' │ "models": { "minimax/MiniMax-M3": {}, │'));
2073
- console.log(chalk.cyan(' │ "minimax/MiniMax-M2.7": {} } } } │'));
2074
- console.log(chalk.cyan(' │ │'));
2075
- console.log(chalk.cyan(' │ 2. Or run `bizar connect` for an interactive TUI setup. │'));
2066
+ console.log(chalk.cyan(' │ 1. Export ANTHROPIC_API_KEY in your shell, or: │'));
2067
+ console.log(chalk.cyan(' │ 2. Run `claude /login` to authenticate via OAuth. │'));
2068
+ console.log(chalk.cyan(' │ 3. Or run `bizar connect` for an interactive TUI setup. │'));
2076
2069
  console.log(chalk.cyan(' └──────────────────────────────────────────────────────────────┘'));
2077
2070
  console.log('');
2078
2071
  console.log(chalk.dim(' Models available at http://localhost:20128/v1/models:'));
@@ -2168,7 +2161,11 @@ export async function runCheck(channel = 'stable') {
2168
2161
 
2169
2162
  const state = detectState();
2170
2163
  printVersionMatrix([
2171
- { label: 'cline', current: state.clineCli.version, latest: state.clineCli.latest },
2164
+ {
2165
+ label: '@anthropic-ai/claude-code',
2166
+ current: state.claudeCli.version,
2167
+ latest: state.claudeCli.latest,
2168
+ },
2172
2169
  { label: PKG_MAIN, current: state.pkgVersion, latest: state.pkgLatest },
2173
2170
  ]);
2174
2171