@agentproto/adapter-browser-camofox

中文文档
0.2.6发布于 2026/11/01Apache-2.0TypeScriptES Module构建来源已验证近 30 天下载 4959

Camofox browser provider for agentproto: a defineBrowser provider over the camofox stealth-Firefox REST server, with an idempotent launch, a health mapping, and a BrowserDriver.

原始使用文档
文档目录4 节
  1. What it does
  2. Auth
  3. Environment
  4. Server origin and license

@agentproto/adapter-browser-camofox

The camofox browser provider for @agentproto/driver-browser: an idempotent launcher, a REST client and a BrowserDriver for the camofox server, a stealth Firefox (Camoufox) behind a small REST API.

import { camofox } from "@agentproto/adapter-browser-camofox"

const instance = await camofox.launch({ port: 9377 }, { log: console.log })
console.log(instance.wasAlreadyRunning) // true when a healthy server was already up
const driver = await instance.attach({ initialUrl: "https://example.com" })
await driver.close()
await instance.stop()

What it does

  • launch() probes GET /health. Any camofox answer, including a 503 while the browser is launching or crash-looping, counts as a running server, so no second one is spawned and wasAlreadyRunning is true. Only when nothing answers does it start one: launchCmd, then CAMOFOX_SERVE_CMD, then launchctl start <label> on macOS. A spawned server gets CAMOFOX_PORT.
  • health() maps /health onto the kit's lifecycle fields (bootId, startedAt, browserState, launchedAt, lastLaunchMs, lastRestartReason). A 503 with browserState: "crash-looping" is a state (ok: false), not a thrown error.
  • The driver has no CDP: listRequests, getRequestBody and send throw BrowserUnsupportedError (capability cdp), as does a full-page screenshot.
  • The REST client throws CamofoxHttpError on any non-2xx answer.

Auth

Set CAMOFOX_API_KEY (or pass apiKey) and every request carries Authorization: Bearer <key>. The key is never logged and is scrubbed from error text. /health stays unauthenticated on the server.

Environment

VariableUse
CAMOFOX_URLServer origin when a launch gives no baseUrl or port. Default http://127.0.0.1:9377.
CAMOFOX_API_KEYBearer key.
CAMOFOX_SERVE_CMDShell command that starts the server (required off macOS).
CAMOFOX_NATIVE_VIDEOtrue when the server records video natively.
BUREAU_BEHAVIORDefault pacing profile for attached drivers.

Server origin and license

The camofox server is jo-inc/camofox-browser, MIT licensed, copyright Jo, Inc. Our patches live in the fork bureau-sh/camofox-browser; the HTTP contract this package targets is that fork's docs/BUREAU-API.md. This package only talks to the server over HTTP and contains none of its code. This package is Apache-2.0.

版本与发布记录

@agentproto/adapter-browser-camofox 共发布 8 个版本,首次发布于 2026/09/30;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.2.6latest2026/11/016 天前
0.2.52026/10/2711 天前
0.2.42026/10/1919 天前
0.2.32026/10/1821 天前
0.2.22026/10/1029 天前
0.2.12026/10/0929 天前

关于 @agentproto/adapter-browser-camofox 的常见问题

@agentproto/adapter-browser-camofox 是什么?

Camofox browser provider for agentproto: a defineBrowser provider over the camofox stealth-Firefox REST server, with an idempotent launch, a health mapping, and a BrowserDriver.

如何安装 @agentproto/adapter-browser-camofox?

在项目目录运行 npm install @agentproto/adapter-browser-camofox,或使用 pnpm add / yarn add / bun add。

@agentproto/adapter-browser-camofox 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@agentproto/adapter-browser-camofox 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@agentproto/adapter-browser-camofox 可以商用吗?

@agentproto/adapter-browser-camofox 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@agentproto/adapter-browser-camofox 的下载量有多少?

根据 npm 官方下载统计,@agentproto/adapter-browser-camofox 在 2026/10/05 – 2026/11/03 这 30 天内被下载 4,959 次,日均约 165 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@agentproto/adapter-browser-camofox 还在维护吗?

最新版本 0.2.6 发布于 2026/11/01(6 天前);至今共发布 8 个版本,其中过去 12 个月发布了 8 个;首次发布于 2026/09/30。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。