chromiumfish 0.2.0 → 0.2.1

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/README.md CHANGED
@@ -62,13 +62,11 @@ and connects over CDP; `runTask` drives it from a plain-language goal.
62
62
  ```ts
63
63
  import { withAgent } from "chromiumfish";
64
64
 
65
- // LLM config from a nearby .env: OPENAI_API_BASE / OPENAI_API_KEY / OPENAI_API_MODEL
66
- const url = await withAgent({ typing: "human" }, (agent) =>
67
- agent
68
- .runTask("Search DuckDuckGo for 'chromiumfish' and give me the first result's URL.")
69
- .then((r) => r.finalText),
65
+ // LLM config: a nearby .env (OPENAI_API_*), or pass apiKey/apiBase/model here.
66
+ const result = await withAgent({ typing: "human" }, (agent) =>
67
+ agent.runTask("Search DuckDuckGo for 'chromiumfish' and give me the first result's URL."),
70
68
  );
71
- console.log(url);
69
+ console.log(result.finalText);
72
70
  ```
73
71
 
74
72
  `withAgent` shuts the browser down for you; use `launchAgent` directly if you
@@ -78,6 +76,7 @@ want to manage the lifecycle (`const { agent, close } = await launchAgent()`).
78
76
  |--------|---------|-------------|
79
77
  | `typing` | `"human"` | Typing speed: `"human"` (~75 WPM, natural), `"fast"`, `"instant"`, or a custom `[keyDown, keyUp, longMultiplier]` triple (numbers = ms). |
80
78
  | `model` | env | Model for the session (overrides `OPENAI_API_MODEL`); `runTask({ model })` overrides per task. |
79
+ | `apiKey` / `apiBase` | env | LLM key / base URL (override `OPENAI_API_KEY` / `OPENAI_API_BASE`). |
81
80
  | `chrome` | `CHROME_BIN` / cached build | Path to the ChromiumFish binary. |
82
81
  | `port` | `9222` | DevTools remote-debugging port. |
83
82
  | `extraArgs` | — | Extra Chromium flags. |
package/dist/agent.d.ts CHANGED
@@ -52,6 +52,10 @@ export interface LaunchAgentOptions {
52
52
  port?: number;
53
53
  /** Path to the ChromiumFish binary; defaults to CHROME_BIN env or the cached build. */
54
54
  chrome?: string;
55
+ /** LLM API key (overrides OPENAI_API_KEY). */
56
+ apiKey?: string;
57
+ /** LLM base URL (overrides OPENAI_API_BASE). */
58
+ apiBase?: string;
55
59
  /** Model for this session (overrides OPENAI_API_MODEL). */
56
60
  model?: string;
57
61
  /** Typing cadence: "human" (default), "fast", "instant", or a [keyDown, keyUp, multiplier] triple. */
@@ -72,9 +76,10 @@ export interface AgentSession {
72
76
  /**
73
77
  * Launch a local ChromiumFish with the AI agent layer and connect to it.
74
78
  *
75
- * LLM config is read from OPENAI_API_BASE / OPENAI_API_KEY / OPENAI_API_MODEL
76
- * (a nearby .env is loaded automatically). Prefer {@link withAgent} for
77
- * automatic cleanup, or remember to call the returned `close()`.
79
+ * LLM config can be passed in-script (`apiKey` / `apiBase` / `model`) or left to
80
+ * OPENAI_API_KEY / OPENAI_API_BASE / OPENAI_API_MODEL (a nearby .env is loaded
81
+ * automatically); an explicit option wins over the env var. Prefer {@link withAgent}
82
+ * for automatic cleanup, or remember to call the returned `close()`.
78
83
  */
79
84
  export declare function launchAgent(opts?: LaunchAgentOptions): Promise<AgentSession>;
80
85
  /**
package/dist/agent.js CHANGED
@@ -350,12 +350,13 @@ function loadDotenv() {
350
350
  /**
351
351
  * Launch a local ChromiumFish with the AI agent layer and connect to it.
352
352
  *
353
- * LLM config is read from OPENAI_API_BASE / OPENAI_API_KEY / OPENAI_API_MODEL
354
- * (a nearby .env is loaded automatically). Prefer {@link withAgent} for
355
- * automatic cleanup, or remember to call the returned `close()`.
353
+ * LLM config can be passed in-script (`apiKey` / `apiBase` / `model`) or left to
354
+ * OPENAI_API_KEY / OPENAI_API_BASE / OPENAI_API_MODEL (a nearby .env is loaded
355
+ * automatically); an explicit option wins over the env var. Prefer {@link withAgent}
356
+ * for automatic cleanup, or remember to call the returned `close()`.
356
357
  */
357
358
  export async function launchAgent(opts = {}) {
358
- const { port = 9222, model = "", typing = "human", loadDotenv: doDotenv = true, extraArgs = [], timeoutMs = 30_000 } = opts;
359
+ const { port = 9222, apiKey = "", apiBase = "", model = "", typing = "human", loadDotenv: doDotenv = true, extraArgs = [], timeoutMs = 30_000 } = opts;
359
360
  if (doDotenv)
360
361
  loadDotenv();
361
362
  let chrome = opts.chrome ?? process.env.CHROME_BIN;
@@ -372,8 +373,8 @@ export async function launchAgent(opts = {}) {
372
373
  typingFlag(typing),
373
374
  "--no-first-run",
374
375
  "--no-default-browser-check",
375
- `--agent-llm-url=${process.env.OPENAI_API_BASE ?? ""}`,
376
- `--agent-llm-key=${process.env.OPENAI_API_KEY ?? ""}`,
376
+ `--agent-llm-url=${apiBase || (process.env.OPENAI_API_BASE ?? "")}`,
377
+ `--agent-llm-key=${apiKey || (process.env.OPENAI_API_KEY ?? "")}`,
377
378
  `--agent-model=${model || (process.env.OPENAI_API_MODEL ?? "")}`,
378
379
  ...extraArgs,
379
380
  ];
package/dist/version.d.ts CHANGED
@@ -6,9 +6,9 @@
6
6
  * SDK downloads by default; override it with `CHROMIUMFISH_VERSION`.
7
7
  */
8
8
  /** SDK package version (kept in sync with package.json). */
9
- export declare const SDK_VERSION = "0.1.4";
9
+ export declare const SDK_VERSION = "0.2.1";
10
10
  /** Default ChromiumFish browser build to fetch. Matches src/chrome/VERSION. */
11
- export declare const DEFAULT_BROWSER_VERSION = "150.0.7844";
11
+ export declare const DEFAULT_BROWSER_VERSION = "149.0.7827.115";
12
12
  /** Public repo hosting the release assets. */
13
13
  export declare const RELEASE_REPO = "arman-bd/chromiumfish";
14
14
  /**
@@ -30,7 +30,7 @@ export declare const GEOIP_FALLBACK_VERSION = "2026.06";
30
30
  * Reject version strings that aren't a plain build tag. Versions are
31
31
  * interpolated into filesystem cache paths and release URLs, so a crafted
32
32
  * value like `../../../etc` would escape the cache dir (path traversal).
33
- * Real tags are digits, dots, and hyphens (e.g. "150.0.7844", "2026.06",
33
+ * Real tags are digits, dots, and hyphens (e.g. "149.0.7827.115", "2026.06",
34
34
  * "latest").
35
35
  */
36
36
  export declare function assertSafeVersion(version: string): string;
package/dist/version.js CHANGED
@@ -6,9 +6,9 @@
6
6
  * SDK downloads by default; override it with `CHROMIUMFISH_VERSION`.
7
7
  */
8
8
  /** SDK package version (kept in sync with package.json). */
9
- export const SDK_VERSION = "0.1.4";
9
+ export const SDK_VERSION = "0.2.1";
10
10
  /** Default ChromiumFish browser build to fetch. Matches src/chrome/VERSION. */
11
- export const DEFAULT_BROWSER_VERSION = "150.0.7844";
11
+ export const DEFAULT_BROWSER_VERSION = "149.0.7827.115";
12
12
  /** Public repo hosting the release assets. */
13
13
  export const RELEASE_REPO = "arman-bd/chromiumfish";
14
14
  /**
@@ -30,7 +30,7 @@ export const GEOIP_FALLBACK_VERSION = "2026.06";
30
30
  * Reject version strings that aren't a plain build tag. Versions are
31
31
  * interpolated into filesystem cache paths and release URLs, so a crafted
32
32
  * value like `../../../etc` would escape the cache dir (path traversal).
33
- * Real tags are digits, dots, and hyphens (e.g. "150.0.7844", "2026.06",
33
+ * Real tags are digits, dots, and hyphens (e.g. "149.0.7827.115", "2026.06",
34
34
  * "latest").
35
35
  */
36
36
  export function assertSafeVersion(version) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "chromiumfish",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "Stealth Chromium build with a drop-in Playwright harness — fetches and launches the ChromiumFish browser.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",