@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.
- package/.claude/CLAUDE.md +15 -0
- package/.claude/agents/_shared/AGENT_BASELINE.md +168 -0
- package/.claude/agents/_shared/CLAUDE_TOOLS.md +412 -0
- package/.claude/agents/_shared/SKILLS.md +109 -0
- package/.claude/agents/agent-browser.md +80 -0
- package/.claude/agents/baldr.md +49 -0
- package/.claude/agents/forseti.md +51 -0
- package/.claude/agents/frigg.md +42 -0
- package/.claude/agents/heimdall.md +33 -0
- package/.claude/agents/hermod.md +53 -0
- package/.claude/agents/mimir.md +49 -0
- package/.claude/agents/odin.md +287 -0
- package/.claude/agents/quick.md +34 -0
- package/.claude/agents/semble-search.md +50 -0
- package/.claude/agents/thor.md +53 -0
- package/.claude/agents/tyr.md +56 -0
- package/.claude/agents/vidarr.md +54 -0
- package/.claude/agents/vor.md +53 -0
- package/.claude/commands/audit.md +25 -0
- package/.claude/commands/bizar.md +22 -0
- package/.claude/commands/explain.md +17 -0
- package/.claude/commands/init.md +29 -0
- package/.claude/commands/learn.md +44 -0
- package/.claude/commands/plan.md +35 -0
- package/.claude/commands/plow-through.md +50 -0
- package/.claude/commands/pr-review.md +49 -0
- package/.claude/commands/setup-provider.md +96 -0
- package/.claude/commands/tailscale-serve.md +100 -0
- package/.claude/commands/team.md +132 -0
- package/.claude/commands/test.md +62 -0
- package/.claude/commands/validate.md +68 -0
- package/.claude/commands/visual-plan.md +24 -0
- package/.claude/hooks/README.md +92 -0
- package/.claude/hooks/posttooluse-editwrite.mjs +91 -0
- package/.claude/hooks/pretooluse-bash.mjs +81 -0
- package/.claude/hooks/pretooluse-editwrite.mjs +139 -0
- package/.claude/hooks/sessionend-recall.mjs +74 -0
- package/.claude/hooks/sessionstart-prime.mjs +80 -0
- package/.claude/hooks/userpromptsubmit-tag.mjs +80 -0
- package/.claude/settings.json +116 -0
- package/.claude/skills/9router/SKILL.md +80 -0
- package/.claude/skills/9router-chat/SKILL.md +73 -0
- package/.claude/skills/9router-embeddings/SKILL.md +69 -0
- package/.claude/skills/9router-image/SKILL.md +86 -0
- package/.claude/skills/9router-stt/SKILL.md +79 -0
- package/.claude/skills/9router-tts/SKILL.md +80 -0
- package/.claude/skills/9router-web-fetch/SKILL.md +99 -0
- package/.claude/skills/9router-web-search/SKILL.md +91 -0
- package/.claude/skills/bizar/README.md +9 -0
- package/.claude/skills/bizar/SKILL.md +450 -0
- package/.claude/skills/cpp-coding-standards/README.md +28 -0
- package/.claude/skills/cpp-coding-standards/SKILL.md +634 -0
- package/.claude/skills/cpp-coding-standards/references/concurrency.md +320 -0
- package/.claude/skills/cpp-coding-standards/references/error-handling.md +229 -0
- package/.claude/skills/cpp-coding-standards/references/memory-safety.md +216 -0
- package/.claude/skills/cpp-coding-standards/references/modern-idioms.md +282 -0
- package/.claude/skills/cpp-coding-standards/references/review-checklist.md +96 -0
- package/.claude/skills/cpp-testing/README.md +28 -0
- package/.claude/skills/cpp-testing/SKILL.md +304 -0
- package/.claude/skills/cpp-testing/references/coverage.md +370 -0
- package/.claude/skills/cpp-testing/references/framework-compare.md +175 -0
- package/.claude/skills/cpp-testing/references/host-test-for-embedded.md +499 -0
- package/.claude/skills/cpp-testing/references/mocking.md +364 -0
- package/.claude/skills/cpp-testing/references/tdd-workflow.md +308 -0
- package/.claude/skills/cubesandbox/SKILL.md +148 -0
- package/.claude/skills/embedded-esp-idf/README.md +41 -0
- package/.claude/skills/embedded-esp-idf/SKILL.md +439 -0
- package/.claude/skills/embedded-esp-idf/references/freertos-patterns.md +214 -0
- package/.claude/skills/embedded-esp-idf/references/host-tests.md +164 -0
- package/.claude/skills/embedded-esp-idf/references/idf-py-commands.md +157 -0
- package/.claude/skills/embedded-esp-idf/references/kconfig.md +159 -0
- package/.claude/skills/embedded-esp-idf/references/logging-discipline.md +118 -0
- package/.claude/skills/embedded-esp-idf/references/memory-and-iram.md +137 -0
- package/.claude/skills/embedded-esp-idf/references/nvs.md +121 -0
- package/.claude/skills/embedded-esp-idf/references/packed-structs.md +192 -0
- package/.claude/skills/embedded-esp-idf/scripts/idf_env.sh +47 -0
- package/.claude/skills/embedded-esp-idf/scripts/size_check.sh +77 -0
- package/.claude/skills/glyph/SKILL.md +163 -0
- package/.claude/skills/harness-engineering/SKILL.md +143 -0
- package/.claude/skills/lightrag/SKILL.md +81 -0
- package/.claude/skills/memory-protocol/SKILL.md +105 -0
- package/.claude/skills/obsidian/SKILL.md +306 -0
- package/.claude/skills/read-the-damn-docs/SKILL.md +113 -0
- package/.claude/skills/self-improvement/SKILL.md +64 -0
- package/README.md +87 -59
- package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js → EnvVarsSection-B58aiJiE.js} +1 -1
- package/bizar-dash/dist/assets/{EnvVarsSection-DXM8gRm_.js.map → EnvVarsSection-B58aiJiE.js.map} +1 -1
- package/bizar-dash/dist/assets/{MobileChat-BnKN_Ks_.js → MobileChat-BJrqwVDd.js} +1 -1
- package/bizar-dash/dist/assets/{MobileChat-BnKN_Ks_.js.map → MobileChat-BJrqwVDd.js.map} +1 -1
- package/bizar-dash/dist/assets/{MobileSettings-DjCPxC-Q.js → MobileSettings-CEQNJNLJ.js} +1 -1
- package/bizar-dash/dist/assets/{MobileSettings-DjCPxC-Q.js.map → MobileSettings-CEQNJNLJ.js.map} +1 -1
- package/bizar-dash/dist/assets/{main-DYiZqMrn.js → main-IvfQAOfy.js} +1 -1
- package/bizar-dash/dist/assets/{main-DYiZqMrn.js.map → main-IvfQAOfy.js.map} +1 -1
- package/bizar-dash/dist/assets/{markdown-C6mXtQxD.js → markdown-tOLaD6nm.js} +1 -1
- package/bizar-dash/dist/assets/{markdown-C6mXtQxD.js.map → markdown-tOLaD6nm.js.map} +1 -1
- package/bizar-dash/dist/assets/{mobile-CMHqtLV2.js → mobile-DYCHcUpq.js} +1 -1
- package/bizar-dash/dist/assets/{mobile-CMHqtLV2.js.map → mobile-DYCHcUpq.js.map} +1 -1
- package/bizar-dash/dist/assets/{mobile-layout-3jIhHX_p.js → mobile-layout-CBHjpwsb.js} +2 -2
- package/bizar-dash/dist/assets/{mobile-layout-3jIhHX_p.js.map → mobile-layout-CBHjpwsb.js.map} +1 -1
- package/bizar-dash/dist/assets/{useSlashCommands-DtITw8Xv.js → useSlashCommands-Bd7_FA6U.js} +2 -2
- package/bizar-dash/dist/assets/{useSlashCommands-DtITw8Xv.js.map → useSlashCommands-Bd7_FA6U.js.map} +1 -1
- package/bizar-dash/dist/assets/{vendor-CeHGtduv.js → vendor-C843201K.js} +12 -12
- package/bizar-dash/dist/assets/vendor-C843201K.js.map +1 -0
- package/bizar-dash/dist/index.html +6 -6
- package/bizar-dash/dist/mobile.html +2 -2
- package/bizar-dash/node_modules/.vite/vitest/da39a3ee5e6b4b0d3255bfef95601890afd80709/results.json +1 -1
- package/bizar-dash/src/server/api.mjs +4 -4
- package/bizar-dash/src/server/background-store.mjs +15 -16
- package/bizar-dash/src/server/bg-poller.mjs +25 -35
- package/bizar-dash/src/server/bg-retry.mjs +66 -194
- package/bizar-dash/src/server/claude-bg-spawner.mjs +390 -0
- package/bizar-dash/src/server/claude-info.mjs +412 -0
- package/bizar-dash/src/server/{cline-runner.mjs → claude-runner.mjs} +53 -48
- package/bizar-dash/src/server/claude-sdk.mjs +191 -0
- package/bizar-dash/src/server/providers-store.mjs +22 -49
- package/bizar-dash/src/server/routes/background.mjs +24 -20
- package/bizar-dash/src/server/routes/chat.mjs +223 -326
- package/bizar-dash/src/server/routes/claude-session-detail.mjs +329 -0
- package/bizar-dash/src/server/routes/claude-sessions.mjs +259 -0
- package/bizar-dash/src/server/routes/tasks.mjs +20 -28
- package/bizar-dash/src/server/task-delegator.mjs +76 -77
- package/bizar-dash/src/web/components/chat/useChat.ts +23 -27
- package/bizar-dash/src/web/views/Chat.tsx +8 -8
- package/cli/bin.mjs +17 -18
- package/cli/commands/claude-cmd.mjs +348 -0
- package/cli/commands/install.mjs +12 -11
- package/cli/commands/validate.mjs +252 -325
- package/cli/dev-link.test.mjs +11 -11
- package/cli/doctor.mjs +131 -213
- package/cli/install.mjs +33 -37
- package/cli/install.test.mjs +9 -9
- package/cli/provision-claude.mjs +893 -0
- package/cli/provision.mjs +224 -227
- package/cli/utils.mjs +72 -58
- package/config/AGENTS.md +28 -28
- package/install.sh +66 -44
- package/package.json +19 -11
- package/packages/sdk/ARCHITECTURE.md +40 -36
- package/packages/sdk/package-lock.json +32 -0
- package/packages/sdk/package.json +15 -5
- package/{plugins/bizar → packages/sdk}/src/dangerous-patterns.ts +6 -28
- package/packages/sdk/src/fingerprint.ts +0 -0
- package/packages/sdk/src/index.ts +38 -73
- package/packages/sdk/src/mcp/bin.ts +51 -0
- package/packages/sdk/src/mcp/server.ts +498 -0
- package/{plugins/bizar/src/memory-vault.ts → packages/sdk/src/memory/index.ts} +18 -21
- package/packages/sdk/tests/sdk.test.mjs +148 -0
- package/packages/sdk/vitest.config.ts +1 -1
- package/scripts/bh-full-e2e.mjs +166 -363
- package/scripts/check-deps.mjs +28 -46
- package/scripts/mirror-claude-md.sh +78 -0
- package/scripts/test-in-container.sh +31 -9
- package/templates/clean-state-checklist.md +3 -3
- package/templates/sprint-contract.md +2 -2
- package/bizar-dash/.bizar/activity.log +0 -3
- package/bizar-dash/.omx/logs/omx-2026-07-07.jsonl +0 -1
- package/bizar-dash/.omx/state/session.json +0 -10
- package/bizar-dash/bizar-design/EXPLANATION.md +0 -307
- package/bizar-dash/bizar-design/INSTRUCTIONS.md +0 -149
- package/bizar-dash/bizar-design/canvas.html +0 -281
- package/bizar-dash/bizar-design/canvas.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/components.css +0 -1665
- package/bizar-dash/bizar-design/components.html +0 -557
- package/bizar-dash/bizar-design/components.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/desktop/agents.html +0 -74
- package/bizar-dash/bizar-design/desktop/agents.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/desktop/memory.html +0 -75
- package/bizar-dash/bizar-design/desktop/memory.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/desktop/metrics.html +0 -63
- package/bizar-dash/bizar-design/desktop/metrics.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/desktop/overview.html +0 -95
- package/bizar-dash/bizar-design/desktop/overview.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/desktop/settings.html +0 -70
- package/bizar-dash/bizar-design/desktop/settings.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/icons.svg +0 -44
- package/bizar-dash/bizar-design/index.html +0 -192
- package/bizar-dash/bizar-design/index.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/mobile/agents.html +0 -29
- package/bizar-dash/bizar-design/mobile/agents.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/mobile/memory.html +0 -28
- package/bizar-dash/bizar-design/mobile/memory.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/mobile/metrics.html +0 -29
- package/bizar-dash/bizar-design/mobile/metrics.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/mobile/overview.html +0 -33
- package/bizar-dash/bizar-design/mobile/overview.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/mobile/settings.html +0 -28
- package/bizar-dash/bizar-design/mobile/settings.html.artifact.json +0 -19
- package/bizar-dash/bizar-design/prototype.js +0 -114
- package/bizar-dash/bizar-design/tokens.css +0 -106
- package/bizar-dash/dist/assets/vendor-CeHGtduv.js.map +0 -1
- package/bizar-dash/node_modules/.package-lock.json +0 -6
- package/bizar-dash/package-lock.json +0 -6
- package/bizar-dash/src/server/cline-sdk.mjs +0 -132
- package/bizar-dash/src/server/routes/cline-session-detail.mjs +0 -559
- package/bizar-dash/src/server/routes/cline-sessions.mjs +0 -291
- package/cli/commands/cline-cmd.mjs +0 -289
- package/cli/commands/validate.test.mjs +0 -379
- package/cli/doctor.test.mjs +0 -350
- package/config/cline.json.template +0 -342
- package/packages/sdk/src/client.ts +0 -188
- package/packages/sdk/src/cline-events.ts +0 -134
- package/packages/sdk/src/cline-types.ts +0 -66
- package/packages/sdk/src/cline.ts +0 -339
- package/packages/sdk/src/errors.ts +0 -129
- package/packages/sdk/src/events.ts +0 -153
- package/packages/sdk/src/types.ts +0 -176
- package/packages/sdk/tests/client.test.ts +0 -217
- package/packages/sdk/tests/errors.test.ts +0 -108
- package/packages/sdk/tests/events.test.ts +0 -139
- package/packages/sdk/tests/fixtures/fetch-mock.ts +0 -152
- package/packages/sdk/tests/fixtures/sse-mock.ts +0 -30
- package/plugins/bizar/ARCHITECTURE.md +0 -142
- package/plugins/bizar/CONSTRAINTS.md +0 -67
- package/plugins/bizar/LICENSE +0 -21
- package/plugins/bizar/README.md +0 -448
- package/plugins/bizar/index.ts +0 -925
- package/plugins/bizar/package.json +0 -39
- package/plugins/bizar/scripts/check-forbidden-imports.sh +0 -33
- package/plugins/bizar/src/background-state.ts +0 -641
- package/plugins/bizar/src/background.ts +0 -1806
- package/plugins/bizar/src/cline-runner.ts +0 -203
- package/plugins/bizar/src/clineruntime.ts +0 -227
- package/plugins/bizar/src/commands-impl.ts +0 -151
- package/plugins/bizar/src/commands.ts +0 -1799
- package/plugins/bizar/src/compaction.d.mts +0 -48
- package/plugins/bizar/src/compaction.mjs +0 -192
- package/plugins/bizar/src/dashboard-client.ts +0 -233
- package/plugins/bizar/src/event-stream.ts +0 -606
- package/plugins/bizar/src/fingerprint.ts +0 -120
- package/plugins/bizar/src/handoff.ts +0 -79
- package/plugins/bizar/src/hooks/memory-flush-on-compact.ts +0 -123
- package/plugins/bizar/src/hooks/memory-inject.ts +0 -247
- package/plugins/bizar/src/hooks/memory-write-on-end.ts +0 -188
- package/plugins/bizar/src/hooks/skill-curator.ts +0 -180
- package/plugins/bizar/src/http-client.ts +0 -467
- package/plugins/bizar/src/key-rotation.ts +0 -218
- package/plugins/bizar/src/logger.ts +0 -144
- package/plugins/bizar/src/loop-engineering.ts +0 -241
- package/plugins/bizar/src/loop.ts +0 -176
- package/plugins/bizar/src/mistake-recovery.ts +0 -98
- package/plugins/bizar/src/odin.ts +0 -227
- package/plugins/bizar/src/options.ts +0 -470
- package/plugins/bizar/src/plan-fs.ts +0 -323
- package/plugins/bizar/src/reasoning-clean.ts +0 -454
- package/plugins/bizar/src/report.ts +0 -178
- package/plugins/bizar/src/research-prompt.ts +0 -35
- package/plugins/bizar/src/serve-info.ts +0 -228
- package/plugins/bizar/src/serve.ts +0 -496
- package/plugins/bizar/src/settings.ts +0 -349
- package/plugins/bizar/src/state.ts +0 -298
- package/plugins/bizar/src/tool-discipline.ts +0 -105
- package/plugins/bizar/src/tools/agent-browser.ts +0 -315
- package/plugins/bizar/src/tools/bg-collect.ts +0 -131
- package/plugins/bizar/src/tools/bg-get-comments.ts +0 -266
- package/plugins/bizar/src/tools/bg-kill.ts +0 -116
- package/plugins/bizar/src/tools/bg-pause.ts +0 -99
- package/plugins/bizar/src/tools/bg-report-progress.ts +0 -115
- package/plugins/bizar/src/tools/bg-resume.ts +0 -94
- package/plugins/bizar/src/tools/bg-send-message.ts +0 -223
- package/plugins/bizar/src/tools/bg-spawn.ts +0 -502
- package/plugins/bizar/src/tools/bg-status.ts +0 -130
- package/plugins/bizar/src/tools/graph-query.ts +0 -278
- package/plugins/bizar/src/tools/loop-engineering.ts +0 -193
- package/plugins/bizar/src/tools/memory-list.ts +0 -43
- package/plugins/bizar/src/tools/memory-read.ts +0 -69
- package/plugins/bizar/src/tools/memory-search.ts +0 -47
- package/plugins/bizar/src/tools/memory-write.ts +0 -54
- package/plugins/bizar/src/tools/open-kb.ts +0 -198
- package/plugins/bizar/src/tools/plan-action.ts +0 -785
- package/plugins/bizar/src/tools/read-glyph-feedback.ts +0 -191
- package/plugins/bizar/src/tools/sandbox.ts +0 -232
- package/plugins/bizar/src/tools/team-spawn.ts +0 -73
- package/plugins/bizar/src/tools/team-status.ts +0 -76
- package/plugins/bizar/src/tools/wait-for-feedback.ts +0 -415
- package/plugins/bizar/src/trajectory.ts +0 -104
- package/plugins/bizar/tests/README.md +0 -99
- package/plugins/bizar/tests/attach-handler-bug.test.ts +0 -169
- package/plugins/bizar/tests/background-state.test.ts +0 -277
- package/plugins/bizar/tests/background.test.ts +0 -402
- package/plugins/bizar/tests/block.test.ts +0 -195
- package/plugins/bizar/tests/canonical-key-order.test.ts +0 -75
- package/plugins/bizar/tests/clineruntime-config.test.ts +0 -283
- package/plugins/bizar/tests/commands-impl.test.ts +0 -316
- package/plugins/bizar/tests/commands.test.ts +0 -584
- package/plugins/bizar/tests/compaction.test.ts +0 -264
- package/plugins/bizar/tests/config.test.ts +0 -128
- package/plugins/bizar/tests/dashboard-client.test.ts +0 -159
- package/plugins/bizar/tests/dispose.test.ts +0 -336
- package/plugins/bizar/tests/event-stream.test.ts +0 -409
- package/plugins/bizar/tests/event.test.ts +0 -262
- package/plugins/bizar/tests/fingerprint.test.ts +0 -190
- package/plugins/bizar/tests/http-client.test.ts +0 -404
- package/plugins/bizar/tests/init-helpers.test.ts +0 -203
- package/plugins/bizar/tests/integration/slash-command.test.ts +0 -349
- package/plugins/bizar/tests/integration/tool-routing.test.ts +0 -98
- package/plugins/bizar/tests/key-rotation.test.ts +0 -396
- package/plugins/bizar/tests/loop-engineering.test.ts +0 -168
- package/plugins/bizar/tests/loop.test.ts +0 -397
- package/plugins/bizar/tests/memory-write-on-end.test.ts +0 -92
- package/plugins/bizar/tests/mistake-recovery.test.ts +0 -116
- package/plugins/bizar/tests/odin.test.ts +0 -125
- package/plugins/bizar/tests/options.test.ts +0 -329
- package/plugins/bizar/tests/reasoning-clean.test.ts +0 -422
- package/plugins/bizar/tests/safety.test.ts +0 -281
- package/plugins/bizar/tests/serve.test.ts +0 -339
- package/plugins/bizar/tests/settings.test.ts +0 -351
- package/plugins/bizar/tests/stall-think.test.ts +0 -750
- package/plugins/bizar/tests/state.test.ts +0 -276
- package/plugins/bizar/tests/tool-discipline.test.ts +0 -77
- package/plugins/bizar/tests/tools/agent-browser.test.ts +0 -98
- package/plugins/bizar/tests/tools/bg-collect.test.ts +0 -337
- package/plugins/bizar/tests/tools/bg-get-comments.test.ts +0 -485
- package/plugins/bizar/tests/tools/bg-kill.test.ts +0 -235
- package/plugins/bizar/tests/tools/bg-pause.test.ts +0 -61
- package/plugins/bizar/tests/tools/bg-report-progress.test.ts +0 -79
- package/plugins/bizar/tests/tools/bg-resume.test.ts +0 -40
- package/plugins/bizar/tests/tools/bg-send-message.test.ts +0 -116
- package/plugins/bizar/tests/tools/bg-spawn-delegation.test.ts +0 -147
- package/plugins/bizar/tests/tools/bg-spawn-http.test.ts +0 -233
- package/plugins/bizar/tests/tools/bg-spawn.test.ts +0 -311
- package/plugins/bizar/tests/tools/bg-status.test.ts +0 -217
- package/plugins/bizar/tests/tools/cline-runner.test.ts +0 -115
- package/plugins/bizar/tests/tools/plan-action.test.ts +0 -599
- package/plugins/bizar/tests/tools/read-glyph-feedback.test.ts +0 -253
- package/plugins/bizar/tests/tools/sandbox.test.ts +0 -117
- package/plugins/bizar/tests/tools/wait-for-feedback.test.ts +0 -390
- package/plugins/bizar/tests/update-deadlock.test.ts +0 -151
- package/plugins/bizar/tsconfig.json +0 -29
- 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
|
-
*
|
|
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
|
|
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
|
|
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 +
|
|
25
|
-
* agent files /
|
|
26
|
-
* (idempotent), restarts the
|
|
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
|
|
59
|
+
* Resolve the Claude Code config directory.
|
|
62
60
|
*
|
|
63
|
-
*
|
|
64
|
-
* for `agents/`, `skills/`, `plugins/`, `
|
|
65
|
-
*
|
|
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
|
-
*
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
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
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
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
|
|
84
|
-
if (process.env.
|
|
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.
|
|
91
|
-
return process.env.
|
|
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(
|
|
85
|
+
return join(HOME, '.claude');
|
|
95
86
|
}
|
|
96
|
-
return join(HOME, '.
|
|
87
|
+
return join(HOME, '.claude');
|
|
97
88
|
}
|
|
98
89
|
|
|
99
|
-
|
|
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
|
|
105
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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 ${
|
|
368
|
+
// ── Plugin copy (deployed to ${CLAUDE_DIR}/plugins/bizar) ──
|
|
369
369
|
const pluginSourceDir = pkgRoot ? join(pkgRoot, 'plugins', 'bizar') : null;
|
|
370
|
-
const pluginDestDir = join(
|
|
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
|
-
|
|
396
|
-
const
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
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
|
-
// ──
|
|
422
|
-
const
|
|
423
|
-
version: currentVersion('
|
|
424
|
-
latest: latestVersion('
|
|
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
|
-
|
|
459
|
-
path:
|
|
460
|
-
exists: !!
|
|
461
|
-
|
|
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
|
-
|
|
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
|
-
|
|
630
|
-
|
|
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 {
|
|
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]
|
|
646
|
+
return { ok: true, message: '[dry-run] @anthropic-ai/claude-code upgrade' };
|
|
638
647
|
}
|
|
639
648
|
|
|
640
|
-
//
|
|
641
|
-
|
|
642
|
-
|
|
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
|
-
|
|
653
|
+
npmArgs.push('--prefix', process.env.NPM_CONFIG_PREFIX);
|
|
649
654
|
}
|
|
650
|
-
const
|
|
651
|
-
if (
|
|
652
|
-
return {
|
|
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 (
|
|
655
|
-
return { ok:
|
|
662
|
+
if (r.status !== 0) {
|
|
663
|
+
return { ok: false, message: '@anthropic-ai/claude-code install failed' };
|
|
656
664
|
}
|
|
657
|
-
return {
|
|
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
|
-
* `${
|
|
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
|
-
//
|
|
691
|
-
//
|
|
692
|
-
//
|
|
693
|
-
//
|
|
694
|
-
//
|
|
695
|
-
//
|
|
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
|
|
714
|
+
`rebuild @polderlabs/bizar`,
|
|
704
715
|
};
|
|
705
716
|
}
|
|
706
717
|
try {
|
|
707
718
|
const pkg = JSON.parse(readFileSync(pkgJsonPath, 'utf8'));
|
|
708
|
-
if (!pkg.
|
|
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
|
-
// ${
|
|
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`, `@
|
|
800
|
-
// node_modules/ so Bun's module resolver
|
|
801
|
-
//
|
|
802
|
-
//
|
|
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
|
|
807
|
-
// pkg's `node_modules/`, then the
|
|
808
|
-
// preferred; recursive copy is the
|
|
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 `${
|
|
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
|
-
|
|
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(
|
|
907
|
-
const templateSrc = join(REPO_ROOT, 'config', '
|
|
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
|
-
|
|
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://
|
|
915
|
-
|
|
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.
|
|
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.
|
|
931
|
-
// Bizar config surface is present in
|
|
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.
|
|
934
|
-
//
|
|
935
|
-
// 2.
|
|
936
|
-
// 3.
|
|
937
|
-
//
|
|
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
|
|
948
|
-
//
|
|
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
|
-
//
|
|
956
|
-
let
|
|
967
|
+
// MCP server entry only.
|
|
968
|
+
let addedMcpServer = false;
|
|
957
969
|
let addedSchema = false;
|
|
958
|
-
let
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
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://
|
|
985
|
+
cfg.$schema = 'https://json.schemastore.org/claude-code-settings.json';
|
|
971
986
|
addedSchema = true;
|
|
972
987
|
}
|
|
973
988
|
|
|
974
|
-
// 3.
|
|
975
|
-
if (!cfg.
|
|
976
|
-
cfg.
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
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 =
|
|
993
|
-
|| addedInstructions || addedPermissions || addedSnapshot;
|
|
1006
|
+
const anyAdded = addedMcpServer || addedSchema || addedHooks;
|
|
994
1007
|
|
|
995
|
-
if (
|
|
996
|
-
return { ok: true, message: '
|
|
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 (
|
|
1002
|
-
if (addedDefaultAgent) added.push('default_agent');
|
|
1014
|
+
if (addedMcpServer) added.push('mcpServers.bizar');
|
|
1003
1015
|
if (addedSchema) added.push('$schema');
|
|
1004
|
-
if (
|
|
1005
|
-
|
|
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 (
|
|
1031
|
-
if (addedDefaultAgent) added.push('default_agent');
|
|
1022
|
+
if (addedMcpServer) added.push('mcpServers.bizar');
|
|
1032
1023
|
if (addedSchema) added.push('$schema');
|
|
1033
|
-
if (
|
|
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
|
-
? `
|
|
1040
|
-
: '
|
|
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 `${
|
|
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
|
-
* `${
|
|
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(
|
|
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
|
-
* `${
|
|
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 `${
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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(
|
|
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 ${
|
|
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
|
-
{
|
|
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('
|
|
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,
|
|
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(
|
|
1955
|
-
|
|
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.
|
|
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
|
|
2051
|
+
// hint pointing them at Claude Code's settings.json.
|
|
2058
2052
|
if (mode === 'install' && !dryRun && !anyFail) {
|
|
2059
|
-
const cfgPath = join(
|
|
2053
|
+
const cfgPath = join(CLAUDE_DIR, 'settings.json');
|
|
2060
2054
|
const cfg = readJsonSafe(cfgPath, null);
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
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
|
|
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.
|
|
2069
|
-
console.log(chalk.cyan(' │
|
|
2070
|
-
console.log(chalk.cyan(' │
|
|
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
|
-
{
|
|
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
|
|