@polderlabs/bizar 4.4.12 → 4.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/bizar-dash/CHANGELOG.md +37 -276
  2. package/bizar-dash/dist/assets/main-CDFKHzBg.css +1 -0
  3. package/bizar-dash/dist/assets/main-NYFpS2wY.js +312 -0
  4. package/bizar-dash/dist/assets/main-NYFpS2wY.js.map +1 -0
  5. package/bizar-dash/dist/assets/{mobile-DSb-t42Y.js → mobile--0FBIKX3.js} +2 -2
  6. package/bizar-dash/dist/assets/{mobile-DSb-t42Y.js.map → mobile--0FBIKX3.js.map} +1 -1
  7. package/bizar-dash/dist/assets/mobile-OgRp8VIb.js +352 -0
  8. package/bizar-dash/dist/assets/mobile-OgRp8VIb.js.map +1 -0
  9. package/bizar-dash/dist/index.html +3 -3
  10. package/bizar-dash/dist/mobile.html +2 -2
  11. package/bizar-dash/skills/agent-baseline/SKILL.md +80 -0
  12. package/bizar-dash/skills/bizar/SKILL.md +96 -0
  13. package/bizar-dash/skills/chat/SKILL.md +74 -0
  14. package/bizar-dash/skills/lightrag/SKILL.md +75 -0
  15. package/bizar-dash/skills/minimax/SKILL.md +80 -0
  16. package/bizar-dash/skills/obsidian/SKILL.md +55 -0
  17. package/bizar-dash/skills/providers/SKILL.md +75 -0
  18. package/bizar-dash/skills/sdk/SKILL.md +138 -0
  19. package/bizar-dash/skills/self-improvement/SKILL.md +53 -0
  20. package/bizar-dash/skills/skills-cli/SKILL.md +94 -0
  21. package/bizar-dash/skills/usage/SKILL.md +62 -0
  22. package/bizar-dash/src/server/api.mjs +12 -0
  23. package/bizar-dash/src/server/memory-lightrag.mjs +5 -2
  24. package/bizar-dash/src/server/memory-store.mjs +38 -0
  25. package/bizar-dash/src/server/minimax-usage-store.mjs +372 -0
  26. package/bizar-dash/src/server/minimax.mjs +427 -110
  27. package/bizar-dash/src/server/providers-store.mjs +966 -6
  28. package/bizar-dash/src/server/routes/config.mjs +52 -1
  29. package/bizar-dash/src/server/routes/env-vars.mjs +165 -0
  30. package/bizar-dash/src/server/routes/lightrag.mjs +154 -0
  31. package/bizar-dash/src/server/routes/memory.mjs +241 -1
  32. package/bizar-dash/src/server/routes/minimax.mjs +50 -57
  33. package/bizar-dash/src/server/routes/opencode-session-detail.mjs +14 -29
  34. package/bizar-dash/src/server/routes/opencode-sessions.mjs +205 -3
  35. package/bizar-dash/src/server/routes/providers.mjs +266 -5
  36. package/bizar-dash/src/server/routes/skills.mjs +32 -43
  37. package/bizar-dash/src/server/routes/update.mjs +340 -0
  38. package/bizar-dash/src/server/routes/usage.mjs +136 -0
  39. package/bizar-dash/src/server/serve-info.mjs +135 -4
  40. package/bizar-dash/src/server/server.mjs +4 -0
  41. package/bizar-dash/src/server/skills-store.mjs +152 -262
  42. package/bizar-dash/src/web/App.tsx +118 -29
  43. package/bizar-dash/src/web/components/EnvVarManager.tsx +247 -0
  44. package/bizar-dash/src/web/components/SettingsSearch.tsx +213 -0
  45. package/bizar-dash/src/web/components/Topbar.tsx +0 -1
  46. package/bizar-dash/src/web/components/UsageChart.tsx +250 -0
  47. package/bizar-dash/src/web/components/UsageTable.tsx +90 -0
  48. package/bizar-dash/src/web/components/chat/ChatComposer.tsx +21 -25
  49. package/bizar-dash/src/web/components/chat/ChatInfoPanel.tsx +199 -37
  50. package/bizar-dash/src/web/components/chat/ChatThread.tsx +29 -17
  51. package/bizar-dash/src/web/components/chat/FloatingComposer.tsx +7 -1
  52. package/bizar-dash/src/web/components/chat/InfoPanel.tsx +71 -6
  53. package/bizar-dash/src/web/components/chat/useChat.ts +751 -257
  54. package/bizar-dash/src/web/lib/api.ts +43 -0
  55. package/bizar-dash/src/web/main.tsx +1 -0
  56. package/bizar-dash/src/web/mobile/views/MobileChat.tsx +110 -35
  57. package/bizar-dash/src/web/styles/chat.css +135 -1
  58. package/bizar-dash/src/web/styles/main.css +46 -0
  59. package/bizar-dash/src/web/styles/minimax-usage.css +471 -0
  60. package/bizar-dash/src/web/styles/settings.css +418 -0
  61. package/bizar-dash/src/web/styles/skills.css +302 -0
  62. package/bizar-dash/src/web/styles/tasks.css +288 -0
  63. package/bizar-dash/src/web/views/Chat.tsx +276 -48
  64. package/bizar-dash/src/web/views/Config.tsx +3 -2065
  65. package/bizar-dash/src/web/views/MiniMaxUsage.tsx +620 -240
  66. package/bizar-dash/src/web/views/Settings.tsx +6 -0
  67. package/bizar-dash/src/web/views/Skills.tsx +208 -260
  68. package/bizar-dash/src/web/views/Tasks.tsx +348 -1119
  69. package/bizar-dash/tests/chat-session-create.test.mjs +391 -0
  70. package/bizar-dash/tests/chat-session-stream.test.mjs +308 -0
  71. package/bizar-dash/tests/env-vars-store.test.mjs +216 -0
  72. package/bizar-dash/tests/lightrag-defaults.node.test.mjs +118 -0
  73. package/bizar-dash/tests/minimax-chat-usage.test.mjs +178 -0
  74. package/bizar-dash/tests/minimax-usage-store.node.test.mjs +293 -0
  75. package/bizar-dash/tests/opencode-sessions-detail.test.mjs +12 -9
  76. package/bizar-dash/tests/providers-store-backup-keys.node.test.mjs +479 -3
  77. package/bizar-dash/tests/providers-store-search.node.test.mjs +166 -0
  78. package/bizar-dash/tests/skills-list.test.mjs +232 -0
  79. package/bizar-dash/tests/skills-search.test.mjs +222 -0
  80. package/bizar-dash/tests/tasks-create.test.mjs +187 -0
  81. package/bizar-dash/tests/update-check.test.mjs +127 -0
  82. package/bizar-dash/tests/update-run.test.mjs +266 -0
  83. package/cli/bin.mjs +345 -4
  84. package/cli/provision.mjs +118 -4
  85. package/config/agents/_shared/SKILLS.md +109 -0
  86. package/package.json +1 -1
  87. package/bizar-dash/dist/assets/main-BKXEqU1w.css +0 -1
  88. package/bizar-dash/dist/assets/main-EK_fzXn_.js +0 -352
  89. package/bizar-dash/dist/assets/main-EK_fzXn_.js.map +0 -1
  90. package/bizar-dash/dist/assets/mobile-Dl1q7Cyq.js +0 -354
  91. package/bizar-dash/dist/assets/mobile-Dl1q7Cyq.js.map +0 -1
@@ -29,10 +29,10 @@
29
29
  }
30
30
  })();
31
31
  </script>
32
- <script type="module" crossorigin src="/assets/main-EK_fzXn_.js"></script>
33
- <link rel="modulepreload" crossorigin href="/assets/mobile-Dl1q7Cyq.js">
32
+ <script type="module" crossorigin src="/assets/main-NYFpS2wY.js"></script>
33
+ <link rel="modulepreload" crossorigin href="/assets/mobile-OgRp8VIb.js">
34
34
  <link rel="stylesheet" crossorigin href="/assets/mobile-CsZQAswA.css">
35
- <link rel="stylesheet" crossorigin href="/assets/main-BKXEqU1w.css">
35
+ <link rel="stylesheet" crossorigin href="/assets/main-CDFKHzBg.css">
36
36
  </head>
37
37
  <body>
38
38
  <div id="root"></div>
@@ -12,8 +12,8 @@
12
12
  <link rel="preconnect" href="https://fonts.googleapis.com" />
13
13
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
14
14
  <link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
15
- <script type="module" crossorigin src="/assets/mobile-DSb-t42Y.js"></script>
16
- <link rel="modulepreload" crossorigin href="/assets/mobile-Dl1q7Cyq.js">
15
+ <script type="module" crossorigin src="/assets/mobile--0FBIKX3.js"></script>
16
+ <link rel="modulepreload" crossorigin href="/assets/mobile-OgRp8VIb.js">
17
17
  <link rel="stylesheet" crossorigin href="/assets/mobile-CsZQAswA.css">
18
18
  </head>
19
19
  <body>
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: agent-baseline
3
+ description: Always-on rules for every Bizar agent. Covers Semble, Skills CLI, loop guard, communication, thinking, parallel execution, and the general agent baseline.
4
+ ---
5
+
6
+ # Agent Baseline
7
+
8
+ Always-on behavioral rules for every Bizar agent. Loaded automatically at session start.
9
+
10
+ ## Semble Code Search
11
+
12
+ A `semble` MCP server is available with two tools:
13
+ - `mcp__semble__search` - search the codebase with a natural-language or code query.
14
+ - `mcp__semble__find_related` - find code similar to a specific file and line.
15
+
16
+ Always call `semble search` before using Grep, Glob, or Read to explore the codebase. Use Grep/Glob/Read only for exact path lookup, exhaustive literal matches, or when the returned chunk lacks enough context.
17
+
18
+ ```bash
19
+ semble search "authentication flow" ./my-project
20
+ semble search "deployment guide" ./my-project --content docs
21
+ ```
22
+
23
+ ## Skills CLI
24
+
25
+ The `skills` CLI (`npm install -g skills`) installs coding skills. Before any non-trivial task, check if a relevant skill exists:
26
+
27
+ ```bash
28
+ skills list --json
29
+ ```
30
+
31
+ Known skill repos by domain:
32
+ - General: `vercel-labs/skills`
33
+ - Frontend (React, a11y): `vercel-labs/agent-skills`, `shadcn/ui`
34
+ - Backend (Supabase, Postgres, auth): `supabase/agent-skills`
35
+ - Testing (TDD, Playwright): `mattpocock/skills`, `microsoft/playwright-cli`
36
+ - Design (frontend-design, UI/UX): `anthropics/skills`, `leonxlnx/taste-skill`
37
+
38
+ ## Loop Guard
39
+
40
+ Follow `rules/uncertainty.md` strictly. When uncertain or stuck, the next move is a research tool call - not a third variation of the same edit. If you catch yourself about to retry the same failed command with slightly different arguments, stop and search first.
41
+
42
+ ## Thinking Rule
43
+
44
+ For agents with reasoning enabled: cap reasoning at 2–4 sentences. No informal self-talk, no "what if" loops, no mid-thought self-correction. Think once, decide, act.
45
+
46
+ ## Parallel Execution
47
+
48
+ When running alongside sibling agents:
49
+ 1. **File scope is sacred.** Only modify files inside your assigned scope.
50
+ 2. **No write-level git.** `git commit`, `push`, `merge`, `rebase`, `reset`, `clean`, `stash`, `checkout` to switch branches, and `pull --rebase` are FORBIDDEN for all agents except @hermod.
51
+ 3. **Detect conflicts before they happen.** Before writing a file, run `git diff --name-only` and confirm it is not in a sibling's scope.
52
+ 4. **`.git/index.lock` is a sibling's signal.** Wait 2–3 seconds and retry. If it persists, STOP and report. Do not delete the lock file.
53
+
54
+ ## Always-On Rules
55
+
56
+ ### Simplicity Rule
57
+ Match the work to the ask. If the user asked one question, answer one question. If they asked for one change, make one change. Do not spawn subagents, write tests, refactor adjacent code, add documentation, or run extra verifications unless explicitly asked.
58
+
59
+ ### No Speculative Features
60
+ Do not add error handling, fallbacks, configurability, or "just in case" code the user did not request. If you think something is needed, mention it - do not implement it.
61
+
62
+ ### Research First
63
+ For facts that change quickly (current positions, prices, breaking news) or anything that could have changed recently, search before answering. For stable technical knowledge, answer directly without search.
64
+
65
+ ### Copyright Compliance
66
+ - Never reproduce copyrighted material, even in code comments.
67
+ - Every direct quote must be under 15 words. One quote per source maximum.
68
+ - Summaries must be much shorter than the original and substantially different in wording, structure, and phrasing.
69
+
70
+ ## File Handling
71
+
72
+ - `read` to view a file. `edit` to make precise edits. `write` for new files or full rewrites.
73
+ - Verify a file exists with `read` or `glob` before claiming to inspect or modify it.
74
+ - Preserve user content unless a change is explicitly requested.
75
+
76
+ ## Communication
77
+
78
+ - Provide brief progress updates during longer or multi-step tasks.
79
+ - Final answers should be direct and briefly summarize changes, limitations, and verification.
80
+ - Match the user's register: brief reply to a brief question; depth only when they want depth.
@@ -0,0 +1,96 @@
1
+ ---
2
+ name: biz
3
+ description: Use when working with, configuring, troubleshooting, or understanding the Bizar Norse-pantheon multi-agent system for opencode. Covers Odin routing, agent tiers, cost-aware dispatch, parallel implementation, and common failure modes.
4
+ ---
5
+
6
+ # Bizar
7
+
8
+ Norse-pantheon multi-agent system for opencode. 13 agents across 4 cost tiers, with Odin as a pure router that always splits implementation across parallel subagents.
9
+
10
+ ## Architecture
11
+
12
+ Odin is the only primary agent. Every request hits him first. He NEVER does work - he decomposes into parallel streams and dispatches to subagents.
13
+
14
+ All subagents use Obsidian vault memory with per-project vaults. Call `obsidian_list_vaults` at session start to discover available vaults, determine the project name, and use the matching `<project-name>` vault. The default vault is for general/cross-project knowledge only.
15
+
16
+ ## Agent Reference
17
+
18
+ | Agent | Model | Tier | Cost | When to Route |
19
+ |---|---|---|---|---|
20
+ | Odin | MiniMax-M3 | Router | $0.30/M · $1.20/M | Primary entry point. Decomposes and dispatches. |
21
+ | Mimir | DeepSeek V4 Flash | Free | $0 | Deep codebase research, Semble-first exploration, docs analysis |
22
+ | Heimdall | DeepSeek V4 Flash | Free | $0 | Simple edits, file ops, mechanical CRUD, quick answers |
23
+ | Hermod | MiniMax-M2.7 | Mid | $0.30/M · $1.20/M | Git ops: commit, push, PR, merge, rebase, branches |
24
+ | Thor | MiniMax-M2.7 | Mid | $0.30/M · $1.20/M | Moderate implementation, tests, debugging, refactoring |
25
+ | Tyr | MiniMax-M3 | High | $0.30/M · $1.20/M | Complex features, architecture, deep debugging, cross-cutting refactor |
26
+ | Vidarr | GPT-5.5 | Ultra | ChatGPT sub | Last resort when Tyr fails or debugging is stuck |
27
+ | Forseti | MiniMax-M3 | Gate | $0.30/M · $1.20/M | Plan auditor - reviews Tyr/Vidarr plans before execution |
28
+ | Semble | MCP search | Free | $0 | MCP code search tool - not an agent |
29
+
30
+ ## Odin Routing Rules
31
+
32
+ **Odin has `edit: deny`, `bash: deny`, `glob: deny`, `grep: deny`.** He literally cannot self-handle.
33
+
34
+ ### Mandatory Parallelism
35
+
36
+ 1. Every request is decomposed into independent work items
37
+ 2. Always 2+ parallel `task` calls in a single message
38
+ 3. Implementation always splits across @thor + @tyr (frontend/backend, file split, impl+tests)
39
+ 4. If a task truly cannot be split, pair it with a parallel research or review task
40
+
41
+ ### Routing Cheat Sheet
42
+
43
+ ```
44
+ Research / Understanding → @mimir (free, Semble-first)
45
+ Quick edit / File ops → @heimdall (free)
46
+ Git / PR / Merge → @hermod (M2.7)
47
+ Moderate implementation → @thor (M2.7)
48
+ Complex implementation → @tyr (M3, after @forseti audit)
49
+ Ultimate fallback → @vidarr (GPT-5.5, after @forseti audit)
50
+ Plan review / Audit → @forseti (M3, review only)
51
+ ```
52
+
53
+ ### Cost Escalation
54
+
55
+ ```
56
+ Free (Mimir, Heimdall) → $Mid (Thor, Hermod) → $$High (Tyr) → $$$Ultra (Vidarr)
57
+ ```
58
+
59
+ Never use a paid agent for work a free agent can do. Never use Tyr for what Thor can handle.
60
+
61
+ ## MiniMax Multi-Key Rotation
62
+
63
+ When using the `minimax/MiniMax-M3` or `minimax/MiniMax-M2.7` model ids, do NOT set a custom `baseURL`. The plugin rotates through keys on 429/402/5xx:
64
+
65
+ ```bash
66
+ # Option A - comma-separated env var
67
+ export MINIMAX_API_KEYS="key1,key2,key3"
68
+
69
+ # Option B - numbered env vars
70
+ export MINIMAX_API_KEY="primary-key"
71
+ export MINIMAX_API_KEY_2="second-key"
72
+ export MINIMAX_API_KEY_3="third-key"
73
+ ```
74
+
75
+ Rotation triggers on 429 (rate limit), 402 (quota exhausted), 500/502/503/504 (server error). Does NOT trigger on 401 (unauthorized - fix the key).
76
+
77
+ ## Troubleshooting
78
+
79
+ ### Odin Self-Handles Instead of Routing
80
+ **Symptoms:** Odin runs bash, glob, grep, edit, or write directly.
81
+
82
+ **Fix:** Remove those permissions from `~/.config/opencode/agents/odin.md`:
83
+ ```yaml
84
+ permission:
85
+ task: allow
86
+ read: allow
87
+ list: allow
88
+ todowrite: allow
89
+ question: allow
90
+ webfetch: allow
91
+ websearch: allow
92
+ # NO bash, glob, grep, edit, write
93
+ ```
94
+
95
+ ### Forseti Rejects Every Plan
96
+ Provide more detail: specific file paths, data flow, error handling, security implications.
@@ -0,0 +1,74 @@
1
+ ---
2
+ name: chat
3
+ description: How chat and opencode session integration works in BizarHarness - session management, message history, opencode session detail, and the chat view.
4
+ ---
5
+
6
+ # Chat + OpenCode Session Integration
7
+
8
+ The chat view in BizarHarness integrates with opencode sessions to provide a conversational interface for agent interactions.
9
+
10
+ ## Session Management
11
+
12
+ Each opencode session has a unique session ID. The chat router (`bizar-dash/src/server/routes/chat.mjs`) manages:
13
+ - Listing active and historical sessions
14
+ - Streaming message events via SSE
15
+ - Session termination
16
+
17
+ ## Chat Endpoints
18
+
19
+ - `GET /api/chat/sessions` - list all sessions (active and recent)
20
+ - `GET /api/chat/sessions/:id` - get session metadata and messages
21
+ - `POST /api/chat/sessions` - create a new session
22
+ - `DELETE /api/chat/sessions/:id` - terminate a session
23
+ - `GET /api/chat/sessions/:id/stream` - SSE stream of messages
24
+
25
+ ## Message Format
26
+
27
+ ```typescript
28
+ interface Message {
29
+ id: string;
30
+ sessionId: string;
31
+ role: 'user' | 'assistant' | 'system' | 'tool';
32
+ content: string;
33
+ model?: string;
34
+ tokens?: { input: number; output: number };
35
+ createdAt: string;
36
+ attachments?: Attachment[];
37
+ }
38
+ ```
39
+
40
+ ## OpenCode Session Detail
41
+
42
+ `bizar-dash/src/server/routes/opencode-session-detail.mjs` exposes per-session metadata:
43
+ - Agent chain (which agents handled this message)
44
+ - Token usage breakdown
45
+ - Tool calls made
46
+ - Session duration
47
+
48
+ ## Chat View (Frontend)
49
+
50
+ `bizar-dash/src/web/views/Chat.tsx` - the main chat UI:
51
+ - Real-time message streaming via SSE
52
+ - Markdown rendering with syntax highlighting
53
+ - File attachment support
54
+ - Message regeneration
55
+ - Copy code buttons
56
+
57
+ Mobile: `bizar-dash/src/web/views/MobileChat.tsx`
58
+
59
+ ## Hooks
60
+
61
+ `bizar-dash/src/web/hooks/useChat.ts` - manages:
62
+ - Session state
63
+ - Message list
64
+ - Streaming state
65
+ - Auto-scroll
66
+ - Error recovery
67
+
68
+ ## Common Issues
69
+
70
+ ### Messages not streaming
71
+ Check that the SSE endpoint is reachable and the session is still active. The server closes the stream after session timeout.
72
+
73
+ ### Session shows wrong agent
74
+ Sessions are routed based on the current routing table in `AGENTS.md`. A session started under Thor will continue under Thor unless explicitly rerouted.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: lightrag
3
+ description: LightRAG integration with BizarHarness. Covers setup, opencode-free defaults, querying, indexing, and the memory service integration.
4
+ ---
5
+
6
+ # LightRAG Integration
7
+
8
+ LightRAG provides fast full-text and keyword search over Obsidian vault content. It is the Phase 2 component of the Bizar Memory Service.
9
+
10
+ ## Overview
11
+
12
+ - **LightRAG** - a lightweight RAG (Retrieval-Augmented Generation) server that indexes Markdown files
13
+ - **Bizar Memory Service** - three-layer system: Markdown (truth) → Git (collaboration) → LightRAG (index)
14
+ - **opencode-free defaults** - LightRAG runs without opencode, accessible to any HTTP client
15
+
16
+ ## Setup
17
+
18
+ Start the LightRAG server:
19
+ ```bash
20
+ npx lightrag-server --port 8724
21
+ ```
22
+
23
+ Or via the Bizar dashboard: navigate to Settings → LightRAG and configure the server URL.
24
+
25
+ ## Configuration
26
+
27
+ LightRAG settings are stored in `~/.config/opencode/lightrag.json`:
28
+
29
+ ```json
30
+ {
31
+ "serverUrl": "http://localhost:8724",
32
+ "indexRoot": "~/.config/opencode/memory",
33
+ "autoIndex": true,
34
+ "embeddingModel": "bge-m3"
35
+ }
36
+ ```
37
+
38
+ ## API Endpoints
39
+
40
+ - `GET /api/lightrag/status` - server health and index stats
41
+ - `POST /api/lightrag/index` - trigger re-indexing of vault
42
+ - `GET /api/lightrag/search?q=` - full-text search over vault
43
+ - `GET /api/lightrag/extract?entities=` - entity extraction
44
+
45
+ ## Search Example
46
+
47
+ ```bash
48
+ curl "http://localhost:8724/search?q=authentication+flow&k=5"
49
+ ```
50
+
51
+ Returns ranked snippets with source file paths.
52
+
53
+ ## Integration with Memory Service
54
+
55
+ When both Obsidian vault and LightRAG are configured:
56
+ 1. The memory service writes new knowledge to the vault
57
+ 2. LightRAG indexes the vault continuously or on-demand
58
+ 3. `bizar memory search` routes natural-language queries to LightRAG
59
+
60
+ ## When to Use LightRAG vs Direct File Read
61
+
62
+ | Query Type | Use |
63
+ |---|---|
64
+ | Natural-language question | LightRAG search |
65
+ | Specific fact lookup | Direct file read |
66
+ | Related concepts discovery | LightRAG search |
67
+ | Precise location of text | grep + read |
68
+
69
+ ## Common Issues
70
+
71
+ ### Empty search results
72
+ Cause: index is stale or the server is down. Fix: POST to `/api/lightrag/index` to re-index.
73
+
74
+ ### Server not responding
75
+ Check that LightRAG is running: `curl http://localhost:8724/status`. If not, restart with `npx lightrag-server`.
@@ -0,0 +1,80 @@
1
+ ---
2
+ name: minimax
3
+ description: MiniMax integration for the Bizar multi-agent system. Covers chat completions, usage tracking, multi-key rotation, rate limiting, and agent awareness of model limits and pricing.
4
+ ---
5
+
6
+ # MiniMax Integration
7
+
8
+ Bizar agents use MiniMax models as the primary paid tier. This skill covers the provider configuration, usage tracking, and common failure modes.
9
+
10
+ ## Model Reference
11
+
12
+ | Model ID | Context | Cost (in/out) | Best for |
13
+ |---|---|---|---|
14
+ | `minimax/MiniMax-M2.7` | 32k | $0.30/M · $1.20/M | Mid-tier implementation, Git ops, moderate tasks |
15
+ | `minimax/MiniMax-M3` | 32k | $0.30/M · $1.20/M | Complex features, deep debugging, architecture |
16
+
17
+ The `MiniMax-M3` model is the primary high-tier agent (Tyr, Forseti). The `MiniMax-M2.7` model is used for Thor and Hermod.
18
+
19
+ ## Provider Configuration
20
+
21
+ Do NOT set `baseURL` on the `minimax` provider - opencode ships a built-in MiniMax provider that resolves the correct API endpoint. Adding an explicit baseURL is a common cause of 404s.
22
+
23
+ ```json
24
+ {
25
+ "provider": "minimax",
26
+ "model": "minimax/MiniMax-M3"
27
+ }
28
+ ```
29
+
30
+ ## Multi-Key Rotation
31
+
32
+ When you have multiple MiniMax accounts and want to distribute load:
33
+
34
+ ```bash
35
+ # Comma-separated (simplest)
36
+ export MINIMAX_API_KEYS="key1,key2,key3"
37
+
38
+ # Numbered env vars (explicit ordering)
39
+ export MINIMAX_API_KEY="primary-key"
40
+ export MINIMAX_API_KEY_2="backup-key"
41
+ ```
42
+
43
+ **Rotation triggers:** 429 (rate limit), 402 (quota exhausted), 500/502/503/504 (server error).
44
+
45
+ **Does NOT rotate on:** 401 (unauthorized - fix the key), 4xx client errors (the request is bad).
46
+
47
+ **Round-robin on success:** the next request starts on the next key, spreading load evenly.
48
+
49
+ ## Usage Tracking
50
+
51
+ The dashboard tracks token usage per session via `bizar-dash/src/server/minimax-usage-store.mjs`. Usage is recorded for:
52
+ - Input tokens
53
+ - Output tokens
54
+ - Model used
55
+ - Session ID
56
+ - Timestamp
57
+
58
+ View usage at `/usage` in the dashboard.
59
+
60
+ ## Common Failure Modes
61
+
62
+ ### 429 / Rate Limit
63
+ Cause: single key hit rate limit. Fix: add more keys to rotation.
64
+
65
+ ### 402 / Quota Exhausted
66
+ Cause: monthly spend limit reached on the key. Fix: add a different key with remaining quota.
67
+
68
+ ### 404 on Chat Completions
69
+ Cause: wrong baseURL or malformed model ID. Fix: remove custom baseURL, use `minimax/MiniMax-M3` as model ID.
70
+
71
+ ### Empty Responses / Truncated Output
72
+ Cause: output hit token limit or streaming was interrupted. Fix: increase `maxTokens` if possible, or split the request.
73
+
74
+ ## Agent Cost Awareness
75
+
76
+ When routing work:
77
+ - Free: Mimir, Heimdall (DeepSeek V4 Flash - no MiniMax cost)
78
+ - Mid: Thor, Hermod (MiniMax-M2.7)
79
+ - High: Tyr, Forseti (MiniMax-M3)
80
+ - Ultra: Vidarr (GPT-5.5 via OpenAI-compatible endpoint)
@@ -0,0 +1,55 @@
1
+ ---
2
+ name: obsidian
3
+ description: Use the Bizar Memory Service for persistent project knowledge - local Obsidian-compatible Markdown + Git-shared sync. Read vault entries before non-trivial decisions; write after meaningful work. Three layers: Markdown (truth) → Git (collaboration) → LightRAG (derived index, Phase 2).
4
+ ---
5
+
6
+ # Bizar Memory Service (Obsidian)
7
+
8
+ Three-layer persistent memory for project knowledge.
9
+
10
+ ## Architecture
11
+
12
+ 1. **Markdown (truth)** - Obsidian-compatible `.md` files with YAML frontmatter, wikilinks, and callouts. Stored in per-project vaults under `~/.config/opencode/memory/<project>/`.
13
+ 2. **Git (collaboration)** - Vaults are Git-tracked and synced. The vault path is unique per project, enabling team sharing via normal Git workflow.
14
+ 3. **LightRAG (derived index, Phase 2)** - When the LightRAG server runs, the memory service indexes all vault entries for fast full-text retrieval.
15
+
16
+ ## Vault Discovery
17
+
18
+ At session start, call `obsidian_list_vaults` (via the Obsidian MCP tool or CLI) to find available vaults. Match by project name. The default vault is for cross-project knowledge only.
19
+
20
+ ## Vault Structure
21
+
22
+ ```
23
+ ~/.config/opencode/memory/<project>/
24
+ .obsidian/ # Obsidian config (workspace.json etc.)
25
+ index.md # Entry point: links to recent, important, pinned notes
26
+ projects/ # Project-specific notes
27
+ decisions/ # ADRs and architectural decisions
28
+ references/ # External knowledge captured for this project
29
+ daily/ # Daily notes (journal-style)
30
+ ```
31
+
32
+ ## Adding Knowledge
33
+
34
+ After meaningful work, write a note:
35
+
36
+ - Use frontmatter: `created:`, `updated:`, `tags:`, `project:`
37
+ - Link related notes with `[[wikilinks]]`
38
+ - Keep notes small and focused (one concept per note)
39
+ - Update `index.md` if adding a significant new area
40
+
41
+ ## Querying Knowledge
42
+
43
+ Use the memory service to find relevant context before making non-trivial decisions:
44
+ - `bizar memory search "<topic>"` - full-text search across vault
45
+ - `bizar memory status` - shows vault path, last sync, index state
46
+
47
+ ## LightRAG Integration
48
+
49
+ When LightRAG is enabled (v4.5.0+), it indexes vault content automatically. Query with `bizar memory search` - this routes to LightRAG for natural-language queries. For simple lookups, direct file reading is faster.
50
+
51
+ ## Common Gotchas
52
+
53
+ - The vault is git-tracked but not auto-committed. Commit after meaningful knowledge additions.
54
+ - Wikilinks work within Obsidian but are just plain links in plain Markdown viewers.
55
+ - Heavy media files (images, PDFs) should be stored outside the vault or Git LFS-tracked.
@@ -0,0 +1,75 @@
1
+ ---
2
+ name: providers
3
+ description: How the provider subsystem works in BizarHarness - catalog management, backup keys, auto-add wizard, and provider store.
4
+ ---
5
+
6
+ # Provider Subsystem
7
+
8
+ The provider subsystem manages LLM API credentials and model routing. It is composed of the providers store, the config router, and the providers UI.
9
+
10
+ ## Core Concepts
11
+
12
+ - **Provider:** A named API source (e.g., `minimax`, `openai`, `anthropic`).
13
+ - **Catalog:** The list of all known/available providers.
14
+ - **Active provider:** The currently selected provider for a given model tier.
15
+ - **Backup keys:** Additional API keys for a provider, used in rotation on 429/402/5xx.
16
+
17
+ ## Provider Store
18
+
19
+ `bizar-dash/src/server/providers-store.mjs` manages:
20
+ - Provider credentials (API keys stored encrypted at rest)
21
+ - Active/inactive state per provider
22
+ - Priority ordering
23
+ - Backup key configuration
24
+
25
+ ## Provider Config File
26
+
27
+ Providers are configured via `~/.config/opencode/providers.json` or via the dashboard UI:
28
+
29
+ ```json
30
+ {
31
+ "providers": [
32
+ {
33
+ "id": "minimax",
34
+ "name": "MiniMax",
35
+ "apiKeys": ["sk-..."],
36
+ "active": true,
37
+ "priority": 1
38
+ }
39
+ ]
40
+ }
41
+ ```
42
+
43
+ ## Backup Keys (Multi-Key Rotation)
44
+
45
+ Configure additional keys for a provider:
46
+
47
+ ```bash
48
+ # Via env var (comma-separated)
49
+ export MINIMAX_API_KEYS="key1,key2,key3"
50
+
51
+ # Via providers.json
52
+ {
53
+ "providers": [{
54
+ "id": "minimax",
55
+ "apiKeys": ["key1", "key2", "key3"]
56
+ }]
57
+ }
58
+ ```
59
+
60
+ ## Auto-Add Wizard
61
+
62
+ When the active provider fails with 401/403, the system can prompt the user to add a new key. The wizard:
63
+ 1. Detects auth failure
64
+ 2. Opens a modal prompting for a new key
65
+ 3. Validates the key by making a test request
66
+ 4. Adds to backup keys or replaces the failed key
67
+
68
+ ## Provider API Endpoints
69
+
70
+ - `GET /api/providers` - list all providers with status
71
+ - `POST /api/providers` - add a new provider
72
+ - `PUT /api/providers/:id` - update provider config
73
+ - `DELETE /api/providers/:id` - remove a provider
74
+ - `POST /api/providers/:id/keys` - add a backup key
75
+ - `POST /api/providers/rotate` - force rotation to next key