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