`state load` always fails with "Cannot load state while browser is running" even when no browser is running, making the command completely unusable (#526). The daemon's auto-launch logic starts a browser before `state_load` gets to handle the command. This adds `state_load` to the exclusion list alongside `launch` and `close`, so `handleStateLoad` can perform its own launch with the state file.
2.1 KiB
AGENTS.md
Instructions for AI coding agents working with this codebase.
Package Manager
This project uses pnpm. Always use pnpm instead of npm or yarn for installing dependencies, running scripts, etc. (e.g., pnpm install, pnpm run build).
Code Style
- Do not use emojis in code, output, or documentation. Unicode symbols (✓, ✗, →, ⚠) are acceptable.
- CLI colored output uses
cli/src/color.rs. This module respects theNO_COLORenvironment variable. Never use hardcoded ANSI color codes. - CLI flags must always use kebab-case (e.g.,
--auto-connect,--allow-file-access). Never use camelCase for flags (e.g.,--autoConnectis wrong).
Documentation
When adding or changing user-facing features (new flags, commands, behaviors, environment variables, etc.), update all of the following:
cli/src/output.rs----helpoutput (flags list, examples, environment variables)README.md-- Options table, relevant feature sections, examplesskills/agent-browser/SKILL.md-- so AI agents know about the featuredocs/src/app/-- the Next.js docs site (MDX pages)- Inline doc comments in the relevant source files
This applies to changes that either human users or AI agents would need to know about. Do not skip any of these locations.
Source Code Reference
Source code for dependencies is available in opensrc/ for deeper understanding of implementation details.
See opensrc/sources.json for the list of available packages and their versions.
Use this source code when you need to understand how a package works internally, not just its types/interface.
Fetching Additional Source Code
To fetch source code for a package or repository you need to understand, run:
npx opensrc <package> # npm package (e.g., npx opensrc zod)
npx opensrc pypi:<package> # Python package (e.g., npx opensrc pypi:requests)
npx opensrc crates:<package> # Rust crate (e.g., npx opensrc crates:serde)
npx opensrc <owner>/<repo> # GitHub repo (e.g., npx opensrc vercel/ai)