Skip to content
This repository was archived by the owner on Oct 17, 2026. It is now read-only.

Commit c89cbe2

Browse files
author
vlgalib
committed
chore(release): v0.6.1
1 parent 2e9ef4b commit c89cbe2

12 files changed

Lines changed: 329 additions & 30 deletions

File tree

‎AGENTS.md‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,12 @@ When asked to finish setup in a workspace:
3333
4. **Env keys** (without printing values — see [bob.env.example](bob.env.example)):
3434
- `FIRECRAWL_API_KEY` — required for the Firecrawl CLI skill
3535
- `CONTEXT7_API_KEY` — optional, on-demand via `skill("explore/context7")`
36-
- `AGENT_BROWSER_SESSION`, `GREP_APP_API_KEY`, `OLLAMA_*` — optional
37-
5. **Verify**: `opencode debug config`, `hiai-opencode doctor`, `hiai-opencode mcp-status`.
36+
- `AGENT_BROWSER_SESSION`, `AGENT_BROWSER_ENGINE`, `GREP_APP_API_KEY`, `OLLAMA_*` — optional
37+
5. **Browser tooling** (required for the `/agent-browser` skill — details in [Browser automation](#browser-automation)):
38+
- Install the CLI: `bun add -g agent-browser && agent-browser install` — `agent-browser install` provisions only the **Chrome fallback** engine.
39+
- Lightpanda is **optional** and **headless-only**: install via the official user-level installer (not `cargo`) — `curl -fsSL https://pkg.lightpanda.io/install.sh | bash` (site: https://lightpanda.io).
40+
- Engine rules: Lightpanda is auto-preferred when its binary is installed; Chrome is the fallback; an explicit `AGENT_BROWSER_ENGINE=chrome|lightpanda` overrides auto-selection.
41+
6. **Verify**: `opencode debug config`, `hiai-opencode doctor`, `hiai-opencode mcp-status`; for browser tooling confirm `agent-browser --version` and, if Lightpanda was installed, `lightpanda version`.
3842

3943
Operating rules: keep OpenCode plugins separate from MCP servers; never add MCP server packages to the `plugin` array; never print/invent/commit API keys; prefer user-level or project-local installs (no sudo).
4044

@@ -101,7 +105,7 @@ Use [bob.env.example](bob.env.example) as the canonical template. Model provider
101105
| `FIRECRAWL_API_KEY` | Firecrawl CLI skill (web scraping) |
102106
| `CONTEXT7_API_KEY` | On-demand library docs via `skill("explore/context7")` |
103107
| `AGENT_BROWSER_SESSION` | Browser automation session name |
104-
| `AGENT_BROWSER_ENGINE` | Browser engine — `chrome` (default) \| `lightpanda` (optional, headless-only) |
108+
| `AGENT_BROWSER_ENGINE` | Browser engine — auto-selects `lightpanda` when its binary is installed; `chrome` is the fallback; an explicit `chrome` \| `lightpanda` value overrides auto-selection |
105109
| `GREP_APP_API_KEY` | Optional grep.app search |
106110
| `OLLAMA_BASE_URL`, `OLLAMA_MODEL` | Local Ollama models |
107111
| `HIAI_OPENCODE_AUTO_EXPORT_MCP` | `if-missing` (default) \| `always` \| `off` |
@@ -153,17 +157,23 @@ The plugin can't find its bundled config. Run `bun run build` to populate `dist/
153157
Firecrawl is a CLI skill, not an MCP server. The env var must be in the shell that runs the CLI skill — `export FIRECRAWL_API_KEY=fc-...` before starting OpenCode, or set it in `bob.env`. It is NOT configured in the `mcp` block.
154158

155159
### Browser automation
156-
Use the `/agent-browser` skill (not MCP). Install: `bun add -g agent-browser && agent-browser install`. Uses native Chrome via CDP — no Playwright. Key env: `AGENT_BROWSER_HEADED=1`, `AGENT_BROWSER_SESSION=name`. Pattern: `snapshot -i --json` → @eN refs → `click @e2`. Repo: https://github.com/vercel-labs/agent-browser
160+
Use the `/agent-browser` skill (not MCP). Install: `bun add -g agent-browser && agent-browser install`. Uses CDP against Lightpanda (preferred when installed) or Chrome (fallback) — no Playwright. Key env: `AGENT_BROWSER_HEADED=1`, `AGENT_BROWSER_SESSION=name`. Pattern: `snapshot -i --json` → @eN refs → `click @e2`. Repo: https://github.com/vercel-labs/agent-browser
157161

158-
`agent-browser install` only sets up the **default engine (Chrome)** — it does **not** install Lightpanda.
162+
`agent-browser install` only provisions the **fallback engine (Chrome)** — it does **not** install Lightpanda, and neither does the npm plugin (no binary auto-download).
159163

160-
**Lightpanda (optional, headless-only):** install via the official one-liner (not `cargo`):
164+
**Engine auto-selection:** if the `lightpanda` binary is installed and `AGENT_BROWSER_ENGINE` is **not** set, the runtime prefers **Lightpanda** (headless-only). **Chrome is the fallback** — used when Lightpanda is absent, or when an explicit override forces it.
165+
166+
**Lightpanda (optional, headless-only):** separate user-level install via the official installer (not `cargo`):
161167

162168
```bash
163169
curl -fsSL https://pkg.lightpanda.io/install.sh | bash
164170
```
165171

166-
Select it per-run with the CLI flag `agent-browser --engine lightpanda open <url>`, or set `AGENT_BROWSER_ENGINE=lightpanda` for the whole session. Headed mode (`AGENT_BROWSER_HEADED=1`) works only with Chrome — Lightpanda is headless-only. Chrome remains the default and fallback engine.
172+
**Explicit override** (beats auto-selection) — env var for the whole session, or CLI flag per run:
173+
- `AGENT_BROWSER_ENGINE=chrome` / `agent-browser --engine chrome open <url>` — force Chrome
174+
- `AGENT_BROWSER_ENGINE=lightpanda` / `agent-browser --engine lightpanda open <url>` — force Lightpanda
175+
176+
Headed mode (`AGENT_BROWSER_HEADED=1`) works only with Chrome — Lightpanda is headless-only.
167177

168178
### Agent prompt correct in source but wrong at runtime
169179
The runtime prompt is assembled in layers: (1) `src/agents/<agent>.ts`, (2) `src/prompt-library/*.ts` imports, (3) runtime hooks (closure-injector, caveman-system-injector), (4) `hooks.config` in [src/index.ts](src/index.ts) applies model/visibility/permissions. Inspect `hooks.config` first when runtime output diverges from source.

‎ARCHITECTURE.md‎

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,18 @@ CLI skills (not MCP, invoked via `skill("...")` or shell):
186186

187187
- `firecrawl` — web scraping (requires `FIRECRAWL_API_KEY`)
188188
- `context7` — on-demand library docs via `skill("explore/context7")`
189-
- `agent-browser` — browser automation via Chrome CDP (uses `/agent-browser` skill)
189+
- `agent-browser` — browser automation via CDP on Lightpanda (preferred when installed) or Chrome (fallback) (uses `/agent-browser` skill)
190+
191+
### Browser engine selection
192+
193+
The external `agent-browser` CLI owns launching the browser engine — the plugin never starts, downloads, or embeds one. The plugin's only engine logic is a small availability-aware selection step in [src/shared/agent-browser-engine.ts](src/shared/agent-browser-engine.ts): `applyAgentBrowserEngineDefault()` (invoked from [src/index.ts](src/index.ts) before agent creation) checks whether a `lightpanda` binary exists on `$PATH` and, if so while `AGENT_BROWSER_ENGINE` is unset, sets the variable to `lightpanda`. Otherwise the variable is left **unset** so upstream `agent-browser` falls back to its own default engine, **Chrome** — the plugin never hardcodes Chrome, and the Chrome fallback remains.
194+
195+
- **Auto-selection:** if the `lightpanda` binary is on `$PATH` and `AGENT_BROWSER_ENGINE` is **not** set, the plugin sets `AGENT_BROWSER_ENGINE=lightpanda`, so upstream prefers **Lightpanda** (headless-only).
196+
- **Fallback:** **Chrome**, `agent-browser`'s own default engine, provisioned by `agent-browser install`.
197+
- **Explicit override** beats auto-selection: `AGENT_BROWSER_ENGINE=chrome|lightpanda` (env, whole session) or `agent-browser --engine chrome|lightpanda open <url>` (CLI flag, per run). An explicit value is always honored verbatim.
198+
- **Install boundary:** Lightpanda is a separate **user-level** install via its official installer (`curl -fsSL https://pkg.lightpanda.io/install.sh | bash`, not `cargo`). Neither the npm plugin nor `agent-browser install` downloads the Lightpanda binary — the plugin only detects an already-installed binary on `$PATH`.
199+
200+
Headed mode (`AGENT_BROWSER_HEADED=1`) works only with Chrome.
190201

191202
## MCP
192203

‎CHANGELOG.md‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,28 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [0.6.1] — 2026-08-13
9+
10+
### 🌐 Runtime Lightpanda auto-selection
11+
12+
- **New availability-aware engine default.** `applyAgentBrowserEngineDefault()` (`src/shared/agent-browser-engine.ts`), invoked from the plugin entry before agents are created, checks whether a `lightpanda` binary is on `$PATH` and — while `AGENT_BROWSER_ENGINE` is unset — sets the variable to `lightpanda`. Otherwise the variable stays **unset** so upstream `agent-browser` falls back to its own default engine, **Chrome**; the plugin never hardcodes Chrome.
13+
- **Explicit override always wins:** `AGENT_BROWSER_ENGINE=chrome|lightpanda` (env, whole session) or `agent-browser --engine chrome|lightpanda open <url>` (CLI flag, per run) beats auto-selection; `chrome` forces the fallback engine even when Lightpanda is installed.
14+
- **Install boundary clarified:** Lightpanda is a separate **user-level** install via its official installer (`curl -fsSL https://pkg.lightpanda.io/install.sh | bash`, not `cargo`). Neither the npm plugin nor `agent-browser install` downloads the Lightpanda binary — `agent-browser install` provisions Chrome only; the plugin detects an already-installed binary on `$PATH`, it never downloads or embeds an engine.
15+
- New unit tests for PATH discovery and the auto-selection default (`src/shared/agent-browser-engine.test.ts`).
16+
17+
### 🖥️ CLI doctor diagnostics
18+
19+
- **`hiai-opencode mcp-status` now reports the browser-engine state:** a **Lightpanda engine** check (ok when the binary is on PATH; info when missing, with the install one-liner hint) and an **Agent-browser effective engine** check that traces the resolution chain — explicit `AGENT_BROWSER_ENGINE` → auto-selected Lightpanda on PATH → Chrome fallback.
20+
- **New info status level (ℹ️)** for non-blocking diagnostics alongside ok/warn/error.
21+
- **`hiai-opencode diagnose` now includes `AGENT_BROWSER_ENGINE`** in the environment snapshot.
22+
23+
### 📚 Docs & install guidance
24+
25+
- **Engine auto-selection documented consistently** across `README.md`, `ARCHITECTURE.md`, `AGENTS.md`, `bob.env.example`, and the vision skills: the runtime prefers **Lightpanda** (headless-only) when its binary is installed and `AGENT_BROWSER_ENGINE` is unset; **Chrome** is the fallback.
26+
- **README gains a dedicated "Install browser automation" step** (optional): `bun add -g agent-browser && agent-browser install` provisions the Chrome fallback, Lightpanda installs via its official one-liner, and engine overrides plus the headed-mode caveat (`AGENT_BROWSER_HEADED=1` is Chrome-only) are spelled out.
27+
- **`AGENTS.md` bootstrap checklist and browser-automation troubleshooting** now cover Lightpanda installation, engine auto-selection rules, and explicit overrides; **`ARCHITECTURE.md`** gains a "Browser engine selection" section describing the plugin's engine boundary (detect, never launch/download/embed).
28+
- `bob.env.example` now shows `AGENT_BROWSER_ENGINE` as an explicit override example (both `lightpanda` and `chrome`), with no secrets added.
29+
830
## [0.6.0] — 2026-08-10
931

1032
### 📁 Ancestor-directory config discovery (bob.json / bob.env)

‎README.md‎

Lines changed: 29 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Most AI coding tools drop you into one big context window and hope the model sel
2222
- 🔍 **Diagnostics are mandatory, not optional.** Edit a file and the completion gate blocks until `lsp_diagnostics` has run clean and any failing `test` / `lint` / `typecheck` passes.
2323
- 🧠 **A real team, not a monologue.** Bob routes by category — quick work to a cheap executor, hard implementation to a Senior Engineer, architecture to a Principal Architect, UI to a Designer, docs to a Writer.
2424
- 🗜️ **Context that survives compaction.** Long sessions compact gracefully — in-memory gate state (failed quality check, pending diagnostics, unreviewed changes) is re-injected into the compaction context so the post-compaction agent still knows what blocks completion.
25-
- ⚡ **No external services.** Everything is local: SQLite memory (Bun), LSP via `npx`, browser via Chrome CDP. Zero cloud dependencies, zero data leaves your machine.
25+
- ⚡ **No external services.** Everything is local: SQLite memory (Bun), LSP via `npx`, browser via local Lightpanda/Chrome CDP. Zero cloud dependencies, zero data leaves your machine.
2626
- 🪝 **One line to install.** No separate MCP server config, no manual wiring — `opencode plugin @hiai-gg/hiai-opencode@latest --global`.
2727

2828
---
@@ -54,7 +54,25 @@ cp bob.env.example bob.env
5454
# Edit bob.env — add FIRECRAWL_API_KEY for web scraping (optional)
5555
```
5656

57-
### 4. Verify
57+
### 4. (Optional) Install browser automation
58+
59+
Vision's browser tools talk to a local engine over CDP. Engine selection is automatic: **Lightpanda** when its binary is on your PATH, **Chrome** otherwise.
60+
61+
Install the CLI and provision the Chrome fallback:
62+
63+
```bash
64+
bun add -g agent-browser && agent-browser install
65+
```
66+
67+
**Lightpanda** ([lightpanda.io](https://lightpanda.io)) — optional, preferred when installed, headless-only. Separate user-level install via the official installer, not `cargo`:
68+
69+
```bash
70+
curl -fsSL https://pkg.lightpanda.io/install.sh | bash
71+
```
72+
73+
Force an engine per session with `AGENT_BROWSER_ENGINE=chrome|lightpanda`, or per run with `agent-browser --engine chrome|lightpanda open <url>`. Headed mode (`AGENT_BROWSER_HEADED=1`) works only with Chrome.
74+
75+
### 5. Verify
5876

5977
```bash
6078
opencode debug config
@@ -72,7 +90,12 @@ Paste this into a fresh session:
7290
Read AGENTS.md and finish hiai-opencode setup for this workspace.
7391
Check that @hiai-gg/hiai-opencode is registered, enable MCP services that can run here
7492
(sequential-thinking: node/npx; grep_app: no key), verify with opencode debug config
75-
and hiai-opencode doctor. Report missing keys without printing secret values.
93+
and hiai-opencode doctor.
94+
Install and configure browser automation for Vision as documented in AGENTS.md:
95+
bun add -g agent-browser && agent-browser install, plus Lightpanda via its official
96+
installer when possible. Verify with agent-browser --version and lightpanda version
97+
(if installed), then run hiai-opencode doctor again.
98+
Report missing keys without printing secret values.
7699
```
77100

78101
---
@@ -99,13 +122,15 @@ Bob routes work; the rest execute. Three are visible in the picker (you can invo
99122
### Tools — 35 registered
100123

101124
- **LSP (6)** — `lsp_diagnostics`, `lsp_goto_definition`, `lsp_find_references`, `lsp_symbols`, `lsp_prepare_rename`, `lsp_rename`. TypeScript, Svelte, ESLint, Python, Bash.
102-
- **Agent Browser (14)** — Navigate, snapshot, click, fill, screenshot, eval, console, and more. Native Chrome via CDP — no Playwright. Restricted to Vision/General agents.
125+
- **Agent Browser (14)** — Navigate, snapshot, click, fill, screenshot, eval, console, and more. CDP via Lightpanda (preferred when installed) or Chrome (fallback) — no Playwright. Restricted to Vision/General agents.
103126
- **Memory (1)** — `hiai_memory_search`: BM25-ranked SQLite FTS5 search over MEMORY.md, checkpoints, notes, and task progress.
104127
- **Session Manager (4)** — List, read, search, and inspect sessions.
105128
- **Worktree (4)** — `hiai_worktree_create`/`_list`/`_remove`/`_status` for isolated parallel work.
106129
- **Skills (1)** — `skill("build/shadcn-ui")`, `skill("explore/context7")`, etc.
107130
- **Firecrawl (3)** — Web scrape, search, sitemap (CLI skill, requires `FIRECRAWL_API_KEY`).
108131

132+
**Browser engines (auto-selected):** the runtime prefers **Lightpanda** ([lightpanda.io](https://lightpanda.io); headless-only) when its binary is on your PATH and `AGENT_BROWSER_ENGINE` is unset; **Chrome** is the fallback. Override per session with `AGENT_BROWSER_ENGINE=chrome|lightpanda`, or per run with `agent-browser --engine chrome|lightpanda open <url>`. Headed mode (`AGENT_BROWSER_HEADED=1`) works only with Chrome. Lightpanda installs separately via its official installer (not `cargo`) — neither the npm plugin nor `agent-browser install` downloads it. See [Install](#install).
133+
109134
### MCP servers — 2, zero-config
110135

111136
| Server | Type | Use |

‎assets/cli/hiai-opencode.mjs‎

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,40 @@ function checkAgentBrowser() {
236236
}
237237
}
238238

239+
// Resolve the effective agent-browser engine using the documented priority:
240+
// 1. explicit AGENT_BROWSER_ENGINE wins;
241+
// 2. otherwise lightpanda if its binary is on PATH;
242+
// 3. otherwise Chrome (the default and fallback engine).
243+
// Presence detection only — never installs or touches the network.
244+
function detectAgentBrowserEngine() {
245+
const explicit = process.env.AGENT_BROWSER_ENGINE?.trim().toLowerCase() || ""
246+
const lightpandaPresent = hasBinary("lightpanda")
247+
const effective = explicit || (lightpandaPresent ? "lightpanda" : "chrome")
248+
return { explicit, lightpandaPresent, effective }
249+
}
250+
251+
function checkLightpandaPresence() {
252+
const { lightpandaPresent } = detectAgentBrowserEngine()
253+
if (lightpandaPresent) {
254+
return { level: "ok", detail: "lightpanda binary found on PATH" }
255+
}
256+
// Missing Lightpanda is non-blocking (info): Chrome is the fallback engine.
257+
return {
258+
level: "info",
259+
detail: "lightpanda not installed — Chrome fallback in effect (optional: curl -fsSL https://pkg.lightpanda.io/install.sh | bash)",
260+
}
261+
}
262+
263+
function checkAgentBrowserEngine() {
264+
const { explicit, lightpandaPresent, effective } = detectAgentBrowserEngine()
265+
const source = explicit
266+
? `explicit AGENT_BROWSER_ENGINE=${explicit}`
267+
: lightpandaPresent
268+
? "auto (lightpanda binary on PATH)"
269+
: "fallback (lightpanda not found)"
270+
return { level: "info", detail: `effective engine=${effective} [${source}]` }
271+
}
272+
239273
function checkOpenCodePluginRegistration() {
240274
for (const path of candidateOpenCodeConfigPaths()) {
241275
if (!existsSync(path)) continue
@@ -787,6 +821,7 @@ function hasEnvOrAuth(config, envName, authKey) {
787821
function statusIcon(level) {
788822
if (level === "ok") return "✅"
789823
if (level === "warn") return "⚠️ "
824+
if (level === "info") return "ℹ️ "
790825
return "❌"
791826
}
792827

@@ -879,6 +914,14 @@ async function mcpStatus(options = {}) {
879914
track(agentBrowser.level)
880915
outInfo(`${statusIcon(agentBrowser.level)} Agent-browser CLI - ${agentBrowser.detail}`)
881916

917+
const lightpanda = checkLightpandaPresence()
918+
track(lightpanda.level)
919+
outInfo(`${statusIcon(lightpanda.level)} Lightpanda engine - ${lightpanda.detail}`)
920+
921+
const engine = checkAgentBrowserEngine()
922+
track(engine.level)
923+
outInfo(`${statusIcon(engine.level)} Agent-browser effective engine - ${engine.detail}`)
924+
882925
outInfo("")
883926
outInfo("MCP Tool Probes:")
884927
const probeResults = await probeMcpServers(config)
@@ -920,6 +963,7 @@ async function runDiagnose(outputPath) {
920963
"HIAI_OPENCODE_EXPORT_MCP_MODE",
921964
"CONTEXT7_API_KEY",
922965
"AGENT_BROWSER_SESSION",
966+
"AGENT_BROWSER_ENGINE",
923967
"GREP_APP_API_KEY",
924968
"OLLAMA_BASE_URL",
925969
"OLLAMA_MODEL",

0 commit comments

Comments
 (0)