@polderlabs/bizar 3.21.0 → 3.22.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/cli/bin.mjs +5 -0
- package/cli/heads-up.mjs +295 -0
- package/cli/init.mjs +34 -0
- package/cli/update.mjs +218 -6
- package/config/agents/_shared/AGENT_BASELINE.md +35 -0
- package/config/opencode.json +11 -23
- package/config/skills/glyph/SKILL.md +174 -0
- package/config/skills/obsidian/SKILL.md +101 -0
- package/config/skills/read-the-damn-docs/SKILL.md +113 -0
- package/install.sh +245 -2
- package/package.json +1 -1
package/install.sh
CHANGED
|
@@ -77,6 +77,21 @@ section() {
|
|
|
77
77
|
echo -e "${BOLD}${CYAN}── $1 ──${NC}"
|
|
78
78
|
}
|
|
79
79
|
|
|
80
|
+
# ── verify_dependencies: final check that all required tools are on PATH ─
|
|
81
|
+
verify_dependencies() {
|
|
82
|
+
local missing=()
|
|
83
|
+
for cmd in node uv uvx bun jq sqlite3 gh opencode python3 make g++; do
|
|
84
|
+
if ! command -v "$cmd" &>/dev/null; then
|
|
85
|
+
missing+=("$cmd")
|
|
86
|
+
fi
|
|
87
|
+
done
|
|
88
|
+
if [ ${#missing[@]} -gt 0 ]; then
|
|
89
|
+
echo -e " ${RED}✗${NC} missing required commands: ${missing[*]}"
|
|
90
|
+
return 1
|
|
91
|
+
fi
|
|
92
|
+
return 0
|
|
93
|
+
}
|
|
94
|
+
|
|
80
95
|
# ── Pre-flight: which tools are missing? ───────────────────────────────
|
|
81
96
|
section "Pre-flight: checking system tools"
|
|
82
97
|
|
|
@@ -84,11 +99,19 @@ have_cmd() { command -v "$1" >/dev/null 2>&1; }
|
|
|
84
99
|
have_file() { [ -e "$1" ]; }
|
|
85
100
|
|
|
86
101
|
MISSING=()
|
|
102
|
+
have_cmd node || MISSING+=("node")
|
|
87
103
|
have_cmd uv || MISSING+=("uv")
|
|
104
|
+
have_cmd uvx || MISSING+=("uvx")
|
|
88
105
|
have_cmd "$PYTHON_BIN" || MISSING+=("$PYTHON_BIN")
|
|
89
106
|
have_cmd jq || MISSING+=("jq")
|
|
90
107
|
have_cmd npx || MISSING+=("npx")
|
|
91
108
|
have_cmd git || MISSING+=("git")
|
|
109
|
+
have_cmd bun || MISSING+=("bun")
|
|
110
|
+
have_cmd gh || MISSING+=("gh")
|
|
111
|
+
have_cmd opencode || MISSING+=("opencode")
|
|
112
|
+
have_cmd sqlite3 || MISSING+=("sqlite3")
|
|
113
|
+
have_cmd make || MISSING+=("make")
|
|
114
|
+
have_cmd g++ || MISSING+=("g++")
|
|
92
115
|
|
|
93
116
|
# Chrome detection: prefer chrome-headless-shell from puppeteer cache, then
|
|
94
117
|
# system chromium / chrome / google-chrome. We don't require Chrome — the
|
|
@@ -236,6 +259,122 @@ if [ -n "$CHROME_BIN" ] || [ -z "$CHROME_BIN" ]; then
|
|
|
236
259
|
fi
|
|
237
260
|
fi
|
|
238
261
|
|
|
262
|
+
# ── Native build deps (better-sqlite3 compiles, etc.) ─────────────────
|
|
263
|
+
section "Install native build dependencies"
|
|
264
|
+
|
|
265
|
+
if [ "${NO_SUDO:-}" != "1" ] && have_cmd apt-get; then
|
|
266
|
+
echo -e " ${CYAN}→${NC} Installing build-essential, python3, sqlite3-dev..."
|
|
267
|
+
if sudo -n apt-get install -y --no-install-recommends \
|
|
268
|
+
build-essential python3 sqlite3 libsqlite3-dev \
|
|
269
|
+
2>/dev/null; then
|
|
270
|
+
note "native build deps installed (build-essential, python3, sqlite3-dev)"
|
|
271
|
+
else
|
|
272
|
+
warn "apt install of native build deps failed (needs sudo). Install manually:"
|
|
273
|
+
warn " sudo apt-get install -y build-essential python3 sqlite3 libsqlite3-dev"
|
|
274
|
+
fi
|
|
275
|
+
else
|
|
276
|
+
note "native build deps check skipped (NO_SUDO=1 or non-apt system)"
|
|
277
|
+
fi
|
|
278
|
+
|
|
279
|
+
# ── Skills CLI (for skills.sh domain skills) ──────────────────────────
|
|
280
|
+
section "Install skills CLI"
|
|
281
|
+
|
|
282
|
+
if ! have_cmd skills; then
|
|
283
|
+
if have_cmd npm; then
|
|
284
|
+
echo -e " ${CYAN}→${NC} Installing skills CLI via npm..."
|
|
285
|
+
if npm install -g skills >/dev/null 2>&1; then
|
|
286
|
+
note "skills CLI installed at $(command -v skills 2>/dev/null || echo 'npm global')"
|
|
287
|
+
else
|
|
288
|
+
warn "skills CLI install failed (run manually: npm install -g skills)"
|
|
289
|
+
fi
|
|
290
|
+
else
|
|
291
|
+
warn "npm not found — cannot install skills CLI"
|
|
292
|
+
fi
|
|
293
|
+
else
|
|
294
|
+
note "skills CLI already installed"
|
|
295
|
+
fi
|
|
296
|
+
|
|
297
|
+
# ── Bun (JavaScript runtime, for plugin tests) ────────────────────────
|
|
298
|
+
section "Install Bun"
|
|
299
|
+
|
|
300
|
+
if ! have_cmd bun; then
|
|
301
|
+
echo -e " ${CYAN}→${NC} Installing Bun..."
|
|
302
|
+
if have_cmd curl; then
|
|
303
|
+
if curl -fsSL https://bun.sh/install | bash >/dev/null 2>&1; then
|
|
304
|
+
export PATH="$HOME/.bun/bin:$PATH"
|
|
305
|
+
if have_cmd bun; then
|
|
306
|
+
note "Bun installed at $(command -v bun)"
|
|
307
|
+
else
|
|
308
|
+
warn "Bun installer ran but bun not on PATH — try 'export PATH=\$HOME/.bun/bin:\$PATH'"
|
|
309
|
+
fi
|
|
310
|
+
else
|
|
311
|
+
warn "Bun installer failed — install manually: https://bun.sh"
|
|
312
|
+
fi
|
|
313
|
+
else
|
|
314
|
+
warn "curl not found — install Bun manually: https://bun.sh"
|
|
315
|
+
fi
|
|
316
|
+
else
|
|
317
|
+
note "Bun $(bun --version 2>/dev/null | head -1)"
|
|
318
|
+
fi
|
|
319
|
+
|
|
320
|
+
# ── GitHub CLI (gh, for PR/issue operations) ──────────────────────────
|
|
321
|
+
section "Install GitHub CLI"
|
|
322
|
+
|
|
323
|
+
if ! have_cmd gh; then
|
|
324
|
+
case "$(uname -s 2>/dev/null || echo unknown)" in
|
|
325
|
+
Linux)
|
|
326
|
+
if have_cmd apt-get; then
|
|
327
|
+
echo -e " ${CYAN}→${NC} Installing gh via apt..."
|
|
328
|
+
if sudo -n apt-get install -y gh >/dev/null 2>&1; then
|
|
329
|
+
note "gh installed (apt)"
|
|
330
|
+
else
|
|
331
|
+
warn "apt install gh failed. Install manually: https://cli.github.com/"
|
|
332
|
+
fi
|
|
333
|
+
elif have_cmd dnf; then
|
|
334
|
+
sudo -n dnf install -y gh >/dev/null 2>&1 && note "gh installed (dnf)" || warn "dnf install gh failed"
|
|
335
|
+
elif have_cmd pacman; then
|
|
336
|
+
sudo -n pacman -S --noconfirm gh >/dev/null 2>&1 && note "gh installed (pacman)" || warn "pacman install gh failed"
|
|
337
|
+
else
|
|
338
|
+
warn "no known package manager — install gh manually: https://cli.github.com/"
|
|
339
|
+
fi
|
|
340
|
+
;;
|
|
341
|
+
Darwin)
|
|
342
|
+
if have_cmd brew; then
|
|
343
|
+
brew install gh >/dev/null 2>&1 && note "gh installed (brew)" || warn "brew install gh failed"
|
|
344
|
+
else
|
|
345
|
+
warn "no brew — install gh manually: https://cli.github.com/"
|
|
346
|
+
fi
|
|
347
|
+
;;
|
|
348
|
+
*)
|
|
349
|
+
warn "unknown OS — install gh manually: https://cli.github.com/"
|
|
350
|
+
;;
|
|
351
|
+
esac
|
|
352
|
+
else
|
|
353
|
+
note "gh $(gh --version 2>/dev/null | head -1)"
|
|
354
|
+
fi
|
|
355
|
+
|
|
356
|
+
# ── opencode CLI (via curl installer) ────────────────────────────────
|
|
357
|
+
section "Install opencode CLI"
|
|
358
|
+
|
|
359
|
+
if ! have_cmd opencode; then
|
|
360
|
+
echo -e " ${CYAN}→${NC} Installing opencode CLI..."
|
|
361
|
+
if have_cmd curl; then
|
|
362
|
+
if curl -fsSL https://opencode.ai/install.sh | sh >/dev/null 2>&1; then
|
|
363
|
+
if have_cmd opencode; then
|
|
364
|
+
note "opencode CLI installed at $(command -v opencode)"
|
|
365
|
+
else
|
|
366
|
+
warn "opencode installer ran but binary not on PATH"
|
|
367
|
+
fi
|
|
368
|
+
else
|
|
369
|
+
warn "opencode installer failed — install manually: https://opencode.ai"
|
|
370
|
+
fi
|
|
371
|
+
else
|
|
372
|
+
warn "curl not found — install opencode manually: https://opencode.ai"
|
|
373
|
+
fi
|
|
374
|
+
else
|
|
375
|
+
note "opencode CLI already installed"
|
|
376
|
+
fi
|
|
377
|
+
|
|
239
378
|
# ── npm packages (BizarHarness, optional @polderlabs/bizar-dash peer) ───
|
|
240
379
|
section "Install BizarHarness npm packages"
|
|
241
380
|
|
|
@@ -368,13 +507,108 @@ fi
|
|
|
368
507
|
section "Install bundled skills"
|
|
369
508
|
|
|
370
509
|
mkdir -p "$SKILLS_DIR"
|
|
371
|
-
|
|
510
|
+
# Core skills — bundled from config/skills/ in the repo.
|
|
511
|
+
for skill in bizar self-improvement cpp-coding-standards cpp-testing embedded-esp-idf \
|
|
512
|
+
obsidian glyph read-the-damn-docs; do
|
|
372
513
|
if [ -d "$REPO_DIR/config/skills/$skill" ]; then
|
|
373
514
|
mkdir -p "$SKILLS_DIR/$skill"
|
|
374
515
|
cp -R "$REPO_DIR/config/skills/$skill/." "$SKILLS_DIR/$skill/"
|
|
375
516
|
note "skill: $skill"
|
|
376
517
|
else
|
|
377
|
-
|
|
518
|
+
# Fallback: write inline SKILL.md so install.sh remains self-contained.
|
|
519
|
+
mkdir -p "$SKILLS_DIR/$skill"
|
|
520
|
+
case "$skill" in
|
|
521
|
+
obsidian)
|
|
522
|
+
cat > "$SKILLS_DIR/$skill/SKILL.md" << 'OBSIDIAN_SKILL'
|
|
523
|
+
---
|
|
524
|
+
name: obsidian
|
|
525
|
+
description: Interact with the Obsidian vault for persistent per-project memory. Use when searching notes, creating notes, writing wikilinks, using callouts, setting properties, or managing the project's obsidian knowledge bank.
|
|
526
|
+
---
|
|
527
|
+
|
|
528
|
+
# Obsidian Vault
|
|
529
|
+
|
|
530
|
+
Per-project persistent memory for Bizar agents. Every project gets its own vault bank, keyed by project name.
|
|
531
|
+
|
|
532
|
+
## Operations
|
|
533
|
+
|
|
534
|
+
- **Search vault**: `obsidian_search` with `bank_id: "<project-name>"` — use before writing code that might have prior context
|
|
535
|
+
- **Create/update notes**: `obsidian_write` with bank_id — store decisions, ADRs, architecture notes
|
|
536
|
+
- **Append to notes**: `obsidian_append` — add to existing notes
|
|
537
|
+
- **List notes**: `obsidian_list_notes` with optional directory prefix
|
|
538
|
+
|
|
539
|
+
## Conventions
|
|
540
|
+
|
|
541
|
+
- Use `bank_id: "<project-name>"` determined from the project root (the directory name)
|
|
542
|
+
- Use wikilinks `[[Note Name]]` for cross-references within the vault
|
|
543
|
+
- Use frontmatter for structured properties (tags, status, date)
|
|
544
|
+
- Store ADRs under `adr/` prefix
|
|
545
|
+
- Store implementation notes under `notes/` prefix
|
|
546
|
+
OBSIDIAN_SKILL
|
|
547
|
+
note "skill: $skill (inline)"
|
|
548
|
+
;;
|
|
549
|
+
glyph)
|
|
550
|
+
cat > "$SKILLS_DIR/$skill/SKILL.md" << 'GLYPH_SKILL'
|
|
551
|
+
---
|
|
552
|
+
name: glyph
|
|
553
|
+
description: Work with the project knowledge graph (graphify). Query the graph before searching source files for structural and relationship questions. Use for architecture discovery, dependency mapping, and cross-module understanding.
|
|
554
|
+
---
|
|
555
|
+
|
|
556
|
+
# Glyph — Knowledge Graph
|
|
557
|
+
|
|
558
|
+
Graph-based codebase navigation using graphify (`.bizar/graph/`). Maps source files, functions, types, and their relationships into a queryable graph with community detection.
|
|
559
|
+
|
|
560
|
+
## Commands
|
|
561
|
+
|
|
562
|
+
```bash
|
|
563
|
+
bizar graph status # node/edge/community counts
|
|
564
|
+
bizar graph query <term> # BFS traversal from a concept
|
|
565
|
+
bizar graph path <A> <B> # shortest path between two concepts
|
|
566
|
+
bizar graph explain <X> # all nodes related to X
|
|
567
|
+
bizar graph update # incremental rebuild
|
|
568
|
+
bizar graph build # full rebuild
|
|
569
|
+
```
|
|
570
|
+
|
|
571
|
+
## When to Use
|
|
572
|
+
|
|
573
|
+
- Before reading a large file: `bizar graph explain "<module>"`
|
|
574
|
+
- Mapping unfamiliar code: `bizar graph query "<feature>"`
|
|
575
|
+
- Debugging cross-module: `bizar graph path "<symptom>" "<root-cause>"`
|
|
576
|
+
- Before grep: check the graph first — may point directly to the file
|
|
577
|
+
GLYPH_SKILL
|
|
578
|
+
note "skill: $skill (inline)"
|
|
579
|
+
;;
|
|
580
|
+
read-the-damn-docs)
|
|
581
|
+
cat > "$SKILLS_DIR/$skill/SKILL.md" << 'RTDD_SKILL'
|
|
582
|
+
---
|
|
583
|
+
name: read-the-damn-docs
|
|
584
|
+
description: Before writing code, read the official documentation. Use websearch/webfetch to find docs for any API, library, framework, or tool. Never guess API signatures, parameter names, or return types.
|
|
585
|
+
---
|
|
586
|
+
|
|
587
|
+
# Read the Damn Docs
|
|
588
|
+
|
|
589
|
+
Discipline: always check official documentation before writing code against an unfamiliar API.
|
|
590
|
+
|
|
591
|
+
## Rules
|
|
592
|
+
|
|
593
|
+
1. **Search docs first**: Before using any function/API/component you haven't used recently, `websearch` or `webfetch` the official docs
|
|
594
|
+
2. **No guessing**: Never invent parameter names, return types, or method signatures from training data alone
|
|
595
|
+
3. **Read error messages**: When something fails, read the full error and search docs for the exact error text
|
|
596
|
+
4. **Version matters**: Note the library/tool version and use docs matching that version
|
|
597
|
+
5. **Check examples**: Most good docs have worked examples — find and follow them
|
|
598
|
+
|
|
599
|
+
## When to Apply
|
|
600
|
+
|
|
601
|
+
- Adding a new dependency — read its install/setup docs
|
|
602
|
+
- Using an unfamiliar API method — check signature and return type
|
|
603
|
+
- Debugging an error you don't understand — search docs + error message
|
|
604
|
+
- Configuring a tool — read the official config reference
|
|
605
|
+
RTDD_SKILL
|
|
606
|
+
note "skill: $skill (inline)"
|
|
607
|
+
;;
|
|
608
|
+
*)
|
|
609
|
+
warn "skill source missing: $skill (no inline fallback)"
|
|
610
|
+
;;
|
|
611
|
+
esac
|
|
378
612
|
fi
|
|
379
613
|
done
|
|
380
614
|
|
|
@@ -545,6 +779,15 @@ JSON
|
|
|
545
779
|
echo "$STATE_JSON" > "$BIZAR_STATE_FILE"
|
|
546
780
|
note "install-state written to $BIZAR_STATE_FILE"
|
|
547
781
|
|
|
782
|
+
# ── Final dependency verification ────────────────────────────────────
|
|
783
|
+
section "Verify all dependencies"
|
|
784
|
+
|
|
785
|
+
if verify_dependencies; then
|
|
786
|
+
note "all required tools available on PATH"
|
|
787
|
+
else
|
|
788
|
+
err "some required tools are missing — see list above"
|
|
789
|
+
fi
|
|
790
|
+
|
|
548
791
|
# ── Final status banner ──────────────────────────────────────────────
|
|
549
792
|
section "Install complete"
|
|
550
793
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@polderlabs/bizar",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.22.0",
|
|
4
4
|
"description": "Norse-pantheon multi-agent system for opencode — 13 agents across 4 cost tiers with cost-aware routing, plans, and a configurable agent harness.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|