cdp-toolkit 1.9.5 → 1.10.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/CHANGELOG.md CHANGED
@@ -5,6 +5,60 @@ All notable changes to cdp-toolkit are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project follows [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.10.0] - 2026-08-18
9
+
10
+ **MCP context-rot reduction: the `tools/list` payload every consuming agent loads is cut ~24% (≈26,600 → ≈20,150 tokens), with NO change to tool behavior, names, parameters, or schema shapes** — the trim touched `description` strings only and was proven shape-identical to the prior manifest (a strip-descriptions deep-equal check gates the regeneration).
11
+
12
+ ### Added
13
+
14
+ - **Server `instructions` block** (MCP `initialize` result). The conventions previously re-stated inside every tool schema — the target-selector grammar, the lease-token model, the Chrome-only MV3 `worker:`/`wake` arm, and the `origin` vocabulary — are now stated once here, loaded a single time at session start. Front-loaded and kept under Claude Code's 2 KB instructions cap so nothing critical is clipped.
15
+
16
+ ### Changed
17
+
18
+ - **Deduplicated the shared parameter blurbs.** The 453-character `lease` description was copy-pasted onto 42 tools (~5,900 tokens of pure duplication) and the `target` selector was written 17 different ways; both now collapse to short, consistent pointers at the server `instructions`. Every per-tool description was tightened for signal density with each tool's load-bearing footgun front-loaded — the "declared-not-discovered" warnings are all preserved, just terser (e.g. `list_pages` 2,702 → 1,188 chars, `claim_page` 2,058 → 1,198).
19
+
20
+ ### Fixed
21
+
22
+ - **`list_pages`'s description exceeded Claude Code's 2 KB per-description cap and was being silently truncated from the end** (dropping its `responsive`/`humanActiveMs` tail). Every tool description is now ≤ 2 KB.
23
+
24
+ ## [1.9.7] - 2026-08-14
25
+
26
+ ### Fixed
27
+
28
+ - **A dropped Firefox WebDriver BiDi connection is now re-dialed instead of erroring
29
+ permanently.** The backend memoizes one `BidiConnection` per endpoint, and `getConnection`
30
+ (`src/bidi/driver.ts`) returned the cached one unconditionally; once its socket dropped —
31
+ a Firefox restart, an idle/network drop, or a lost BiDi session slot — every later call
32
+ rejected forever with `connection not open`, for the entire life of the MCP server.
33
+ `getConnection` now evicts a dead cached connection (via a new `BidiConnection.isOpen`
34
+ getter) and re-creates the session on the next call, so Firefox tools recover on their own
35
+ instead of needing a server restart.
36
+ - **Firefox launch mode no longer returns the hardcoded macOS Firefox path on Linux.**
37
+ `resolveBinary` (`src/bidi/launch.ts`) returned the first truthy candidate without checking
38
+ it existed, so on Linux it handed back `/Applications/Firefox.app/Contents/MacOS/firefox`
39
+ and never fell back to `firefox` on `PATH` — `ENOENT` at spawn, in launch mode only. An
40
+ absolute candidate (`FIREFOX_BIN`, the macOS path) is now only returned if it exists on this
41
+ box; the bare `firefox` name is left for `spawn` to resolve against `PATH`.
42
+ - **Recorder artifact directory is now resolved per call, so `CDP_ARTIFACT_DIR` is honored at
43
+ runtime instead of being frozen at import time.** The buffer directory in `src/tools/recorder.ts`
44
+ was a module-level `const` bound the moment the module loaded, so a caller (or a test) that set
45
+ `CDP_ARTIFACT_DIR` afterward was ignored and `recFile`/`captureFile` still pointed at
46
+ `/tmp/cdp-toolkit`. On a clean CI runner that path does not exist, so the first buffer
47
+ `writeFile` threw `ENOENT` and the worker-capture suite failed there while passing on any box
48
+ where `/tmp/cdp-toolkit` happened to exist. It now reads the env var per call through a local
49
+ `artifactDir()` helper — the same "read per call, not at module load" pattern as `leaseDir()` in
50
+ `src/leases.ts` — so the directory is resolved at write time and a redirect takes effect.
51
+
52
+ ## [1.9.6] - 2026-08-13
53
+
54
+ **Fix: `upload_file`'s `files` parameter is now declared array-only in the tool manifest** (was
55
+ `"type": ["string","array"]`). Google's Gemini function-calling API rejects union-typed parameter
56
+ schemas — the `any_of` branch's untyped `items` fails its `$type == Type.ARRAY` predicate — which
57
+ hard-fails the entire `GenerateContentRequest` and kills any Gemini-backed agent session the
58
+ moment this manifest is included in its toolset (observed as subagents returning empty results on
59
+ every dispatch). Runtime behavior is unchanged: the handler still accepts and wraps a bare string
60
+ for direct CDP/CLI callers; MCP/model callers now pass `[path]` per the declared schema.
61
+
8
62
  ## [1.9.5] - 2026-08-11
9
63
 
10
64
  **Documentation and stale code-comment clarifications; NO behavior changes since 1.9.4.** Two