cdp-toolkit 1.11.0 → 2.1.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/dist/cli.js CHANGED
@@ -6020,6 +6020,9 @@ function mapBidiError(e) {
6020
6020
  return driverError2("timeout", e.message);
6021
6021
  if (!code && /(disposed|not open|connection closed)/i.test(e.message))
6022
6022
  return driverError2("disconnected", e.message);
6023
+ if (/NS_ERROR_FILE_ACCESS_DENIED/i.test(e.message)) {
6024
+ return driverError2("page-error", `${e.message} — the browser process was not allowed to open this file:// path. For a snap- or AppArmor-confined Firefox (Ubuntu default) that is kernel-level and no preference fixes it: serve the directory over a local http server (e.g. python3 -m http.server) and navigate to the http://127.0.0.1:<port>/ URL instead. If this Firefox was launched by cdp-toolkit and still fails, please report it at https://github.com/sblattj/cdp-toolkit/issues.`);
6025
+ }
6023
6026
  return driverError2("page-error", e.message);
6024
6027
  }
6025
6028
  return driverError2("page-error", e instanceof Error ? e.message : String(e));
@@ -6416,7 +6419,10 @@ class BidiPageDriver {
6416
6419
  const sendOpts = opts.timeoutMs !== undefined ? { timeoutMs: opts.timeoutMs } : {};
6417
6420
  try {
6418
6421
  if (reload) {
6419
- const r2 = await this.conn.send("browsingContext.reload", { context: this.contextId, ignoreCache: opts.ignoreCache === true, wait }, sendOpts);
6422
+ if (opts.ignoreCache === true) {
6423
+ throw driverError2("unsupported", "navigate: ignoreCache:true (hard reload) is not supported on the Firefox WebDriver-BiDi backend — Firefox rejects the ignoreCache argument outright. A plain reload (reload:true, no ignoreCache) works.");
6424
+ }
6425
+ const r2 = await this.conn.send("browsingContext.reload", { context: this.contextId, wait }, sendOpts);
6420
6426
  return { url: r2.url, contextId: this.contextId, reloaded: true, waitedFor: waitUntil };
6421
6427
  }
6422
6428
  if (history) {
@@ -7101,7 +7107,7 @@ function createFirefoxDriverForEndpoint(wsUrl, opts) {
7101
7107
 
7102
7108
  // src/bidi/launch.ts
7103
7109
  import { spawn as spawn3 } from "node:child_process";
7104
- import { existsSync, mkdtempSync, rmSync } from "node:fs";
7110
+ import { existsSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
7105
7111
  import { createConnection, createServer } from "node:net";
7106
7112
  import { tmpdir } from "node:os";
7107
7113
  import { join as join11 } from "node:path";
@@ -7178,11 +7184,37 @@ function waitForExit(proc, deadlineMs) {
7178
7184
  });
7179
7185
  });
7180
7186
  }
7187
+ var LAUNCH_USER_JS_PREFS = {
7188
+ "remote.prefs.recommended": true,
7189
+ "security.fileuri.strict_origin_policy": false,
7190
+ "dom.file.createInChild": true
7191
+ };
7192
+ function writeLaunchUserJs(profilePath) {
7193
+ const target = join11(profilePath, "user.js");
7194
+ const existing = existsSync(target) ? readFileSync(target, "utf8") : "";
7195
+ const present = new Set;
7196
+ for (const line of existing.split(`
7197
+ `)) {
7198
+ const m = /^user_pref\("([^"]+)"\s*,/.exec(line.trim());
7199
+ if (m)
7200
+ present.add(m[1]);
7201
+ }
7202
+ const additions = Object.entries(LAUNCH_USER_JS_PREFS).filter(([k]) => !present.has(k)).map(([k, v]) => `user_pref("${k}", ${JSON.stringify(v)});`);
7203
+ const content = (existing.length > 0 ? existing.replace(/\n*$/, `
7204
+ `) : "") + additions.join(`
7205
+ `) + (additions.length > 0 ? `
7206
+ ` : "");
7207
+ if (content !== existing)
7208
+ writeFileSync(target, content, "utf-8");
7209
+ return content;
7210
+ }
7181
7211
  async function launchFirefox(opts = {}) {
7182
7212
  const binary = resolveBinary();
7183
7213
  const port = await pickPort(opts.port);
7184
7214
  const isThrowaway = opts.profilePath === undefined;
7185
7215
  const profilePath = opts.profilePath ?? mkdtempSync(join11(tmpdir(), "cdp-toolkit-ff-profile-"));
7216
+ if (isThrowaway)
7217
+ writeLaunchUserJs(profilePath);
7186
7218
  const args = ["--profile", profilePath, "--remote-debugging-port", String(port), "--no-remote"];
7187
7219
  if (opts.headless)
7188
7220
  args.push("--headless");
@@ -7536,21 +7568,21 @@ var FIREFOX_TOOLS = {
7536
7568
  var MANIFEST = [
7537
7569
  {
7538
7570
  name: "list_pages",
7539
- description: "Enumerate browser page targets (GET /json/list); page-type tabs only unless all=true. Each entry carries its targetId plus an origin field: 'agent' means this toolkit created it (also carries the creating label/createdAt, and stays 'agent' after the lease is released or the creator dies, making stray agent tabs findable), 'unknown' means no creation record - it never says 'human', the honest word for any tab it did not create; a record that exists but won't read adds originUnreadable. An entry under an active, readable lease also carries a 'lease' object {label,pid,idleMs,expiresAt,stale}, with idleMs and expiresAt computed fresh every call (never off disk), independent of probe. Under CDP_REQUIRE_LEASE this call also reaps abandoned agent tabs into an additive reaped array - but a lease reads reclaimable the moment its TTL elapses, while the tab is CLOSED only after a further grace (CDP_REAP_GRACE_MS, default 2700000ms/45min, so 60min total after last use); a dead-pid lease is reaped at once, a tab with no lease never. With probe, each page-type entry also gets 'responsive' (and humanActiveMs where human input is seen); both are absent, never false/null, without probe.",
7571
+ description: "List browser page targets; optionally include non-page targets and probe responsiveness.",
7540
7572
  inputSchema: {
7541
7573
  type: "object",
7542
7574
  properties: {
7543
7575
  lease: {
7544
7576
  type: "string",
7545
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7577
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7546
7578
  },
7547
7579
  all: {
7548
7580
  type: "boolean",
7549
- description: "Include non-page targets (service/shared workers, background pages); default false lists page-type tabs only."
7581
+ description: "Include non-page targets."
7550
7582
  },
7551
7583
  probe: {
7552
7584
  type: "boolean",
7553
- description: "Ping each page-type renderer before returning, one bounded 500ms check per target and never more, so a wedged tab can't stall the listing. Adds 'responsive' (false on timeout/exception/unreachable, never an error for the whole call) and, where the same round trip finds human input, humanActiveMs. Default false. On a backend that cannot answer the ping, responsive is absent too (not false)."
7585
+ description: "Probe renderer responsiveness."
7554
7586
  }
7555
7587
  },
7556
7588
  required: [],
@@ -7559,29 +7591,29 @@ var MANIFEST = [
7559
7591
  },
7560
7592
  {
7561
7593
  name: "new_page",
7562
- description: "Open a new browser tab via Target.createTarget and return {targetId,url}. Defaults to about:blank; navigation is not awaited here (use navigate_page to load and wait).",
7594
+ description: "Open a browser tab, optionally claim it; navigation is not awaited.",
7563
7595
  inputSchema: {
7564
7596
  type: "object",
7565
7597
  properties: {
7566
7598
  lease: {
7567
7599
  type: "string",
7568
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7600
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7569
7601
  },
7570
7602
  url: {
7571
7603
  type: "string",
7572
- description: "URL to open in the new tab; defaults to about:blank."
7604
+ description: "URL value."
7573
7605
  },
7574
7606
  claim: {
7575
7607
  type: "boolean",
7576
- description: "Claim the new tab atomically and return a lease token alongside {targetId,url}. Under CDP_REQUIRE_LEASE the tab is claimed and a lease returned even without claim:true; claim:true makes it an EXPLICIT lease that demands its token on every later call, even from this process. Default false."
7608
+ description: "Claim the new tab."
7577
7609
  },
7578
7610
  label: {
7579
7611
  type: "string",
7580
- description: "Agent label recorded on the lease when the tab is claimed; surfaced in conflict errors and list_leases. Defaults to pid-<pid>."
7612
+ description: "Agent lease label."
7581
7613
  },
7582
7614
  ttlMs: {
7583
7615
  type: "number",
7584
- description: "How long a claimed lease survives without use before it is reclaimable. Defaults to CDP_LEASE_TTL_MS, else 900000 (15min); every checked call refreshes it. Ignored when not claiming."
7616
+ description: "Lease TTL in milliseconds."
7585
7617
  }
7586
7618
  },
7587
7619
  required: [],
@@ -7590,17 +7622,17 @@ var MANIFEST = [
7590
7622
  },
7591
7623
  {
7592
7624
  name: "close_page",
7593
- description: "Close a page target via Target.closeTarget. Requires an explicit, resolvable target; errors rather than guessing when the selector matches nothing.",
7625
+ description: "Close a selected page; target must resolve explicitly.",
7594
7626
  inputSchema: {
7595
7627
  type: "object",
7596
7628
  properties: {
7597
7629
  lease: {
7598
7630
  type: "string",
7599
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7631
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7600
7632
  },
7601
7633
  target: {
7602
7634
  type: "string",
7603
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7635
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7604
7636
  }
7605
7637
  },
7606
7638
  required: [
@@ -7611,17 +7643,17 @@ var MANIFEST = [
7611
7643
  },
7612
7644
  {
7613
7645
  name: "select_page",
7614
- description: "Activate/focus a page target via Target.activateTarget and persist its bare targetId to the selected-state file (CDP_STATE_DIR/selected). Requires an explicit, resolvable target.",
7646
+ description: "Focus a selected page and persist it as active; target must resolve explicitly.",
7615
7647
  inputSchema: {
7616
7648
  type: "object",
7617
7649
  properties: {
7618
7650
  lease: {
7619
7651
  type: "string",
7620
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7652
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7621
7653
  },
7622
7654
  target: {
7623
7655
  type: "string",
7624
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7656
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7625
7657
  }
7626
7658
  },
7627
7659
  required: [
@@ -7632,25 +7664,25 @@ var MANIFEST = [
7632
7664
  },
7633
7665
  {
7634
7666
  name: "navigate_page",
7635
- description: "Navigate a target page to a URL (Page.navigate), reload it (reload:true), OR go back/forward in its session history (history:'back'|'forward'), then wait for the load milestone with a bounded timeout so a wedged renderer can't hang. Exactly one of url / reload / history per call. Returns {url,frameId,waitedFor} (plus reloaded:true on a reload, traversed:'back'|'forward' on a history move); waitUntil supports 'load'|'domcontentloaded' only (no 'networkidle'), and there is no auto-snapshot of the new page. Pass reload:true with ignoreCache:true for a hard reload that refetches every subresource (e.g. to pick up a freshly-deployed, non-content-hashed bundle the HTTP cache would serve stale).",
7667
+ description: "Navigate, reload, or traverse page history; choose exactly one operation.",
7636
7668
  inputSchema: {
7637
7669
  type: "object",
7638
7670
  properties: {
7639
7671
  lease: {
7640
7672
  type: "string",
7641
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7673
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7642
7674
  },
7643
7675
  target: {
7644
7676
  type: "string",
7645
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7677
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7646
7678
  },
7647
7679
  url: {
7648
7680
  type: "string",
7649
- description: "Destination URL to navigate to. Required unless reload:true."
7681
+ description: "URL value."
7650
7682
  },
7651
7683
  reload: {
7652
7684
  type: "boolean",
7653
- description: "Reload the current page (Page.reload) instead of navigating to url. Default false."
7685
+ description: "Reload before capture."
7654
7686
  },
7655
7687
  history: {
7656
7688
  type: "string",
@@ -7658,11 +7690,11 @@ var MANIFEST = [
7658
7690
  "back",
7659
7691
  "forward"
7660
7692
  ],
7661
- description: "Traverse this tab's session history instead of loading a url: 'back' and 'forward' are the browser's Back and Forward buttons. Mutually exclusive with 'url' and 'reload' — passing two of the three is refused by name, not resolved by precedence. Works on BOTH backends and waits for the same load milestone as an ordinary navigation. Going back from the first entry, or forward from the last, is an ERROR naming the direction — never a silent no-op. The result carries traversed:'back'|'forward' alongside the resulting url."
7693
+ description: "History direction."
7662
7694
  },
7663
7695
  ignoreCache: {
7664
7696
  type: "boolean",
7665
- description: "On reload, bypass the HTTP cache (hard reload) so subresources are refetched. Ignored unless reload:true. Default false."
7697
+ description: "Bypass cache on reload."
7666
7698
  },
7667
7699
  waitUntil: {
7668
7700
  type: "string",
@@ -7670,11 +7702,11 @@ var MANIFEST = [
7670
7702
  "load",
7671
7703
  "domcontentloaded"
7672
7704
  ],
7673
- description: "Which load milestone to wait for. Defaults to 'load'. No 'networkidle' support."
7705
+ description: "Load milestone."
7674
7706
  },
7675
7707
  timeoutMs: {
7676
7708
  type: "number",
7677
- description: "Override the navigation timeout in milliseconds."
7709
+ description: "Timeout in milliseconds."
7678
7710
  }
7679
7711
  },
7680
7712
  additionalProperties: false
@@ -7682,29 +7714,29 @@ var MANIFEST = [
7682
7714
  },
7683
7715
  {
7684
7716
  name: "wait_for",
7685
- description: "Poll the target until the substring appears in document.body.innerText (Runtime.evaluate on a fixed interval), or throw on timeout. Text-substring only -- no aria/role/selector or event variants; throws rather than returning {found:false}.",
7717
+ description: "Wait for a text substring in document.body.innerText; timeout throws.",
7686
7718
  inputSchema: {
7687
7719
  type: "object",
7688
7720
  properties: {
7689
7721
  lease: {
7690
7722
  type: "string",
7691
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7723
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7692
7724
  },
7693
7725
  target: {
7694
7726
  type: "string",
7695
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7727
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7696
7728
  },
7697
7729
  text: {
7698
7730
  type: "string",
7699
- description: "Substring to wait for in document.body.innerText. Required."
7731
+ description: "Text substring."
7700
7732
  },
7701
7733
  timeoutMs: {
7702
7734
  type: "number",
7703
- description: "Total time budget in ms. Default 15000."
7735
+ description: "Timeout in milliseconds."
7704
7736
  },
7705
7737
  pollMs: {
7706
7738
  type: "number",
7707
- description: "Poll interval in ms. Default 250."
7739
+ description: "Polling interval in milliseconds."
7708
7740
  }
7709
7741
  },
7710
7742
  required: [
@@ -7715,37 +7747,37 @@ var MANIFEST = [
7715
7747
  },
7716
7748
  {
7717
7749
  name: "evaluate_script",
7718
- description: "Run arbitrary JavaScript in the target's main-world context over raw CDP and return the evaluated value (returnByValue). With no 'args', 'expression' is a raw expression; with 'args' it must be a function literal (arrow or classic) invoked on globalThis with args passed positionally. A thrown exception surfaces as an error; non-serializable returns (DOM nodes, functions) come back as their CDP description string. savePath writes the value to a JSON file instead -- the response then carries only {path,bytes,type,target} and the value never appears in it, the way to read a credential (a JWT/session token from localStorage) without putting the secret in the transcript. This is the one tool that EVALUATES inside an MV3 extension's background SERVICE WORKER rather than OBSERVING it (Chrome, Capability 'worker.targets'): a worker: target reads chrome.storage.local, chrome.runtime and the worker's own globals directly, with an idle-evicted worker started first (see 'wake').",
7750
+ description: "Evaluate JavaScript in a page or Chrome worker; args require a function literal.",
7719
7751
  inputSchema: {
7720
7752
  type: "object",
7721
7753
  properties: {
7722
7754
  lease: {
7723
7755
  type: "string",
7724
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7756
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7725
7757
  },
7726
7758
  target: {
7727
7759
  type: "string",
7728
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', '<targetId>'; plus 'worker:<substring>' to reach a service/shared worker (e.g. an MV3 extension background worker). The worker: arm is CHROME-ONLY (Capability 'worker.targets'). Grammar: see server instructions."
7760
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7729
7761
  },
7730
7762
  wake: {
7731
7763
  type: "boolean",
7732
- description: "Worker targets only, when starting a capture. Default true: an idle-evicted MV3 service worker exists in no target listing, so it is started first (ServiceWorker.startWorker) and re-confirmed; false fails fast. Rejected on a page target, a bare target id, or a read-only call. See server instructions."
7764
+ description: "Wake worker before capture."
7733
7765
  },
7734
7766
  expression: {
7735
7767
  type: "string",
7736
- description: "JavaScript to run. Evaluated as an expression when 'args' is omitted; must be a function literal (arrow or classic) whose parameters receive 'args' when provided. REQUIRED -- the code always goes in this key, never in 'function', 'code', 'js', 'script', 'fn' or 'body'; a call using one of those is rejected with an error naming the wrong key."
7768
+ description: "JavaScript expression or function."
7737
7769
  },
7738
7770
  awaitPromise: {
7739
7771
  type: "boolean",
7740
- description: "Await the result if it is a Promise. Default true."
7772
+ description: "Await Promise results."
7741
7773
  },
7742
7774
  args: {
7743
7775
  type: "array",
7744
- description: "Positional JSON-serializable arguments passed to the expression (treated as a function). No live element/page handle is bound."
7776
+ description: "Positional JSON arguments."
7745
7777
  },
7746
7778
  savePath: {
7747
7779
  type: "string",
7748
- description: "Write the evaluated value to this file as JSON and KEEP IT OUT OF THE RESPONSE: the result is {path,bytes,type,target} only, with no copy, preview or truncation of the value -- read credentials without putting them in a transcript. An absolute path (starting with /) is used as-is; a relative path resolves under the artifact dir (/tmp/cdp-toolkit); missing parents are created. Omit to get the value back inline."
7780
+ description: "Output file path."
7749
7781
  }
7750
7782
  },
7751
7783
  required: [
@@ -7756,29 +7788,29 @@ var MANIFEST = [
7756
7788
  },
7757
7789
  {
7758
7790
  name: "list_cookies",
7759
- description: "Read the target page's cookie store INCLUDING httpOnly cookies, which document.cookie (and therefore evaluate_script) cannot see. Page-scoped, not browser-wide: returns cookies of the resolved tab, so point at a page on the site you want. Each cookie carries name, value, domain, path, expires (Unix seconds, -1 for a session cookie), size, httpOnly, secure, sameSite ('strict'|'lax'|'none'|'default'), session. Filter with 'domain' and/or 'name'. Pass 'savePath' to write the array to a JSON file instead: the response is then {path,bytes,count,target} with no cookie value in any form, the way to capture a session cookie without putting the credential in the transcript.",
7791
+ description: "Read cookies for a selected page, including httpOnly values; savePath keeps values out of the response.",
7760
7792
  inputSchema: {
7761
7793
  type: "object",
7762
7794
  properties: {
7763
7795
  lease: {
7764
7796
  type: "string",
7765
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7797
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7766
7798
  },
7767
7799
  target: {
7768
7800
  type: "string",
7769
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7801
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7770
7802
  },
7771
7803
  domain: {
7772
7804
  type: "string",
7773
- description: "Keep only cookies for this domain. A leading dot is ignored on both sides and subdomains match too, so 'example.test' matches '.example.test' and 'app.example.test'. No wildcards."
7805
+ description: "Cookie domain."
7774
7806
  },
7775
7807
  name: {
7776
7808
  type: "string",
7777
- description: "Keep only the cookie with exactly this name. Exact match, not a substring."
7809
+ description: "Cookie name."
7778
7810
  },
7779
7811
  savePath: {
7780
7812
  type: "string",
7781
- description: "Write the cookie array here as JSON and KEEP THE VALUES OUT OF THE RESPONSE: the result is {path,bytes,count,target} only, with no preview or truncation of any value. An absolute path (starting with /) is used as-is; a relative path resolves under the artifact dir (/tmp/cdp-toolkit); missing parents are created. Omit to get the cookies back inline."
7813
+ description: "Output file path."
7782
7814
  }
7783
7815
  },
7784
7816
  required: [],
@@ -7787,49 +7819,49 @@ var MANIFEST = [
7787
7819
  },
7788
7820
  {
7789
7821
  name: "set_cookie",
7790
- description: "Write one cookie into the target page's cookie store, INCLUDING httpOnly or secure cookies that document.cookie (and therefore evaluate_script) cannot create. Either 'url' or 'domain' is REQUIRED: the call is refused when neither is given, rather than guessing the page origin. The response is {set:true,target} and never echoes the value back. A 'set:true' is earned, not assumed: Chrome raises an error when it declines the cookie (a domain the url does not belong to, a secure cookie on an insecure origin, an oversized value). On Firefox 'domain' is derived from 'url' when only the url was given (BiDi has no url parameter), and a url with no host such as about:blank or a data URL is an error, not a silent no-op. Read the result back with list_cookies when you need proof.",
7822
+ description: "Set one page cookie, including httpOnly or secure flags; provide url or domain.",
7791
7823
  inputSchema: {
7792
7824
  type: "object",
7793
7825
  properties: {
7794
7826
  lease: {
7795
7827
  type: "string",
7796
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7828
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7797
7829
  },
7798
7830
  target: {
7799
7831
  type: "string",
7800
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7832
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7801
7833
  },
7802
7834
  name: {
7803
7835
  type: "string",
7804
- description: "Cookie name. Required and non-empty."
7836
+ description: "Cookie name."
7805
7837
  },
7806
7838
  value: {
7807
7839
  type: "string",
7808
- description: "Cookie value. Required. It is not echoed back in the response."
7840
+ description: "Cookie value."
7809
7841
  },
7810
7842
  url: {
7811
7843
  type: "string",
7812
- description: "URL the cookie is set for, e.g. 'https://example.com/'. Chrome derives domain, path and secure from it; Firefox derives only the domain from its host. Give this or 'domain'."
7844
+ description: "URL value."
7813
7845
  },
7814
7846
  domain: {
7815
7847
  type: "string",
7816
- description: "Cookie domain, e.g. 'example.com' or '.example.com' for subdomains. Give this or 'url'. When both are given, this wins on Firefox and Chrome applies its own url plus domain consistency rule."
7848
+ description: "Cookie domain."
7817
7849
  },
7818
7850
  path: {
7819
7851
  type: "string",
7820
- description: "Cookie path, passed through exactly as given and NOT defaulted to '/': with a 'url' Chrome derives the path from it, so an invented default here would widen a cookie you meant to scope narrowly."
7852
+ description: "Cookie path."
7821
7853
  },
7822
7854
  expires: {
7823
7855
  type: "number",
7824
- description: "Expiry as Unix time in SECONDS, matching what list_cookies reports. Omit for a session cookie, which is what both backends do when no expiry is supplied."
7856
+ description: "Expiry Unix time in seconds."
7825
7857
  },
7826
7858
  httpOnly: {
7827
7859
  type: "boolean",
7828
- description: "Set the httpOnly flag, making the cookie invisible to document.cookie. Only a protocol write like this one can create such a cookie."
7860
+ description: "Set HttpOnly flag."
7829
7861
  },
7830
7862
  secure: {
7831
7863
  type: "boolean",
7832
- description: "Set the secure flag. Chrome declines a secure cookie on an insecure origin, and that refusal surfaces as an error."
7864
+ description: "Set Secure flag."
7833
7865
  },
7834
7866
  sameSite: {
7835
7867
  type: "string",
@@ -7839,7 +7871,7 @@ var MANIFEST = [
7839
7871
  "none",
7840
7872
  "default"
7841
7873
  ],
7842
- description: "SameSite attribute, lowercase, matching what list_cookies reports. 'default' means the attribute is not set at all."
7874
+ description: "SameSite attribute."
7843
7875
  }
7844
7876
  },
7845
7877
  required: [
@@ -7851,33 +7883,33 @@ var MANIFEST = [
7851
7883
  },
7852
7884
  {
7853
7885
  name: "delete_cookies",
7854
- description: "Delete the named cookie from the target page's cookie store, httpOnly cookies included. Both 'name' and one of 'url' or 'domain' are REQUIRED: without a site constraint it would delete by name across the whole partition, so it is refused with an error instead. Narrow further with 'path'. The response is {deleted:true,target} and carries NO count, because neither protocol reports how many cookies it removed and a number here would be invented; call list_cookies before and after for a real count. 'deleted:true' means the backend accepted and performed the deletion, not that a matching cookie existed, since deleting an absent cookie succeeds on both backends.",
7886
+ description: "Delete a named page cookie; provide name and url or domain.",
7855
7887
  inputSchema: {
7856
7888
  type: "object",
7857
7889
  properties: {
7858
7890
  lease: {
7859
7891
  type: "string",
7860
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7892
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7861
7893
  },
7862
7894
  target: {
7863
7895
  type: "string",
7864
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7896
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7865
7897
  },
7866
7898
  name: {
7867
7899
  type: "string",
7868
- description: "Exact cookie name to delete. Required and non-empty. No wildcards: this removes a named cookie, not a swathe of them."
7900
+ description: "Cookie name."
7869
7901
  },
7870
7902
  url: {
7871
7903
  type: "string",
7872
- description: "Delete cookies matching this URL, e.g. 'https://example.com/'. Give this or 'domain'. On Firefox only the host is used, because BiDi's filter has no url field."
7904
+ description: "URL value."
7873
7905
  },
7874
7906
  domain: {
7875
7907
  type: "string",
7876
- description: "Delete cookies with this exact domain. Give this or 'url'."
7908
+ description: "Cookie domain."
7877
7909
  },
7878
7910
  path: {
7879
7911
  type: "string",
7880
- description: "Narrow the deletion to cookies with this exact path. Omit to match any path allowed by the other constraints."
7912
+ description: "Cookie path."
7881
7913
  }
7882
7914
  },
7883
7915
  required: [
@@ -7888,21 +7920,21 @@ var MANIFEST = [
7888
7920
  },
7889
7921
  {
7890
7922
  name: "take_snapshot",
7891
- description: "Captures the page's accessibility tree as an indented text tree, each line prefixed [uid] (a CDP backendDOMNodeId). Every interaction tool (click/hover/fill/etc.) resolves that uid via DOM.resolveNode — run this first to discover uids to act on.",
7923
+ description: "Capture the page accessibility tree with interaction UIDs.",
7892
7924
  inputSchema: {
7893
7925
  type: "object",
7894
7926
  properties: {
7895
7927
  lease: {
7896
7928
  type: "string",
7897
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7929
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7898
7930
  },
7899
7931
  target: {
7900
7932
  type: "string",
7901
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7933
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7902
7934
  },
7903
7935
  interactiveOnly: {
7904
7936
  type: "boolean",
7905
- description: "When true, emit only interactive/meaningful nodes as a flat list; default false returns the full hierarchical tree."
7937
+ description: "Only interactive nodes."
7906
7938
  }
7907
7939
  },
7908
7940
  required: [],
@@ -7911,25 +7943,25 @@ var MANIFEST = [
7911
7943
  },
7912
7944
  {
7913
7945
  name: "click",
7914
- description: "Click an element via a synthetic mouse press/release at its scrolled-into-view center. Give exactly one of uid or selector. modifiers (Alt/Control/Meta/Shift) throws on the Firefox backend — use --browser chrome for a modifier-click. clickCount:3 triple-clicks (selects a line/paragraph in most editors).",
7946
+ description: "Click an element by UID or CSS selector; provide exactly one.",
7915
7947
  inputSchema: {
7916
7948
  type: "object",
7917
7949
  properties: {
7918
7950
  lease: {
7919
7951
  type: "string",
7920
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
7952
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7921
7953
  },
7922
7954
  target: {
7923
7955
  type: "string",
7924
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
7956
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7925
7957
  },
7926
7958
  uid: {
7927
7959
  type: "number",
7928
- description: "CDP backendDOMNodeId of the element to click, from take_snapshot. Exactly one of uid or selector."
7960
+ description: "Element backendDOMNodeId."
7929
7961
  },
7930
7962
  selector: {
7931
7963
  type: "string",
7932
- description: "CSS selector for the element to click (document.querySelector). Exactly one of uid or selector."
7964
+ description: "CSS selector."
7933
7965
  },
7934
7966
  button: {
7935
7967
  type: "string",
@@ -7938,11 +7970,11 @@ var MANIFEST = [
7938
7970
  "right",
7939
7971
  "middle"
7940
7972
  ],
7941
- description: "Mouse button: 'left' (default), 'right', or 'middle'."
7973
+ description: "Mouse button."
7942
7974
  },
7943
7975
  clickCount: {
7944
7976
  type: "number",
7945
- description: "Number of clicks: 1 (default), 2 = double-click, 3 = triple-click."
7977
+ description: "Click count."
7946
7978
  },
7947
7979
  modifiers: {
7948
7980
  type: "array",
@@ -7955,7 +7987,7 @@ var MANIFEST = [
7955
7987
  "Shift"
7956
7988
  ]
7957
7989
  },
7958
- description: "Modifier keys held for the click's press and release, e.g. ['Shift']. Non-empty on the Firefox backend throws — not supported over BiDi."
7990
+ description: "Modifier keys: Control|Ctrl|Shift|Alt|Meta|Cmd."
7959
7991
  }
7960
7992
  },
7961
7993
  required: [],
@@ -7964,25 +7996,25 @@ var MANIFEST = [
7964
7996
  },
7965
7997
  {
7966
7998
  name: "hover",
7967
- description: "Hovers the mouse over an element by dispatching a mouseMoved event at its scrolled-into-view center, firing framework hover handlers. Give exactly one of uid or selector.",
7999
+ description: "Hover an element by UID or CSS selector; provide exactly one.",
7968
8000
  inputSchema: {
7969
8001
  type: "object",
7970
8002
  properties: {
7971
8003
  lease: {
7972
8004
  type: "string",
7973
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8005
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
7974
8006
  },
7975
8007
  target: {
7976
8008
  type: "string",
7977
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8009
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
7978
8010
  },
7979
8011
  uid: {
7980
8012
  type: "number",
7981
- description: "CDP backendDOMNodeId of the element to hover, from take_snapshot. Exactly one of uid or selector."
8013
+ description: "Element backendDOMNodeId."
7982
8014
  },
7983
8015
  selector: {
7984
8016
  type: "string",
7985
- description: "CSS selector for the element to hover (document.querySelector). Exactly one of uid or selector."
8017
+ description: "CSS selector."
7986
8018
  }
7987
8019
  },
7988
8020
  required: [],
@@ -7991,67 +8023,67 @@ var MANIFEST = [
7991
8023
  },
7992
8024
  {
7993
8025
  name: "drag",
7994
- description: "Drags from a source element to a destination or by an offset. mode:'mouse' (default) dispatches synthetic mouse press/move/release; at the default steps:2 an HTML5 drop zone (dragover preventDefault) gets ZERO dragover events and refuses the drop. mode:'html5' replays real dragstart/dragEnter/dragOver/drop with the page's own dataTransfer instead — deterministic regardless of pointer path, but CHROME-ONLY (rejected with a clear error on the Firefox backend). 'from' takes uid or selector; destination is exactly one of 'to' (uid/selector/x+y) or 'by' ({dx,dy} offset — sliders, map panning, resize handles).",
8026
+ description: "Drag from an element to a destination or offset; html5 mode is Chrome-only.",
7995
8027
  inputSchema: {
7996
8028
  type: "object",
7997
8029
  properties: {
7998
8030
  lease: {
7999
8031
  type: "string",
8000
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8032
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8001
8033
  },
8002
8034
  target: {
8003
8035
  type: "string",
8004
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8036
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8005
8037
  },
8006
8038
  from: {
8007
8039
  type: "object",
8008
- description: "Source element to drag from. Exactly one of uid or selector.",
8040
+ description: "Drag source.",
8009
8041
  properties: {
8010
8042
  uid: {
8011
8043
  type: "number",
8012
- description: "CDP backendDOMNodeId of the source element, obtained from take_snapshot."
8044
+ description: "Element backendDOMNodeId."
8013
8045
  },
8014
8046
  selector: {
8015
8047
  type: "string",
8016
- description: "CSS selector for the source element (resolved via document.querySelector)."
8048
+ description: "CSS selector."
8017
8049
  }
8018
8050
  },
8019
8051
  additionalProperties: false
8020
8052
  },
8021
8053
  to: {
8022
8054
  type: "object",
8023
- description: "Where the drag ends: exactly one of uid, selector, or x+y. Mutually exclusive with 'by'; exactly one of to/by required.",
8055
+ description: "Drag destination.",
8024
8056
  properties: {
8025
8057
  uid: {
8026
8058
  type: "number",
8027
- description: "CDP backendDOMNodeId of the destination element, obtained from take_snapshot."
8059
+ description: "Element backendDOMNodeId."
8028
8060
  },
8029
8061
  selector: {
8030
8062
  type: "string",
8031
- description: "CSS selector for the destination element (resolved via document.querySelector)."
8063
+ description: "CSS selector."
8032
8064
  },
8033
8065
  x: {
8034
8066
  type: "number",
8035
- description: "Absolute viewport x-coordinate to drop at. Must be given together with 'y'. Use this when there is no droppable element to name (a canvas, a slider track)."
8067
+ description: "Viewport x-coordinate."
8036
8068
  },
8037
8069
  y: {
8038
8070
  type: "number",
8039
- description: "Absolute viewport y-coordinate to drop at. Must be given together with 'x'."
8071
+ description: "Viewport y-coordinate."
8040
8072
  }
8041
8073
  },
8042
8074
  additionalProperties: false
8043
8075
  },
8044
8076
  by: {
8045
8077
  type: "object",
8046
- description: "Offset from the source element's center: at least one of dx/dy (other defaults to 0). Mutually exclusive with 'to'; exactly one of to/by required. For sliders (by:{dx:40}), map panning, resize handles.",
8078
+ description: "Drag offset.",
8047
8079
  properties: {
8048
8080
  dx: {
8049
8081
  type: "number",
8050
- description: "Horizontal offset in CSS pixels; positive drags RIGHT."
8082
+ description: "Horizontal drag offset."
8051
8083
  },
8052
8084
  dy: {
8053
8085
  type: "number",
8054
- description: "Vertical offset in CSS pixels; positive drags DOWN."
8086
+ description: "Vertical drag offset."
8055
8087
  }
8056
8088
  },
8057
8089
  additionalProperties: false
@@ -8062,11 +8094,11 @@ var MANIFEST = [
8062
8094
  "mouse",
8063
8095
  "html5"
8064
8096
  ],
8065
- description: "'mouse' (default): synthetic mouse press/move/release — at steps:2 an HTML5 drop zone sees zero dragover events and refuses the drop. 'html5': real HTML5 drag-and-drop, deterministic regardless of pointer path, CHROME-ONLY (rejected on Firefox)."
8097
+ description: "Drag mode."
8066
8098
  },
8067
8099
  steps: {
8068
8100
  type: "number",
8069
- description: "Number of interpolated mouse-move events between source and destination, evenly spaced, last landing on the destination. Integer 1-500, default 2. Raise for DnD libraries with a movement threshold or per-frame sampling."
8101
+ description: "Interpolation steps."
8070
8102
  }
8071
8103
  },
8072
8104
  required: [
@@ -8077,41 +8109,41 @@ var MANIFEST = [
8077
8109
  },
8078
8110
  {
8079
8111
  name: "scroll",
8080
- description: "Dispatches a wheel/scroll event at an anchor point — element (uid/selector) or x+y, scrolled into view first if an element; omit all three for viewport center. At least one of deltaX/deltaY required: positive deltaY scrolls DOWN, positive deltaX scrolls RIGHT (wheel-event convention — easy to invert). Returns the resolved anchor {x,y} plus the delta actually dispatched.",
8112
+ description: "Dispatch a wheel event at an element or coordinate anchor; provide deltaX or deltaY.",
8081
8113
  inputSchema: {
8082
8114
  type: "object",
8083
8115
  properties: {
8084
8116
  lease: {
8085
8117
  type: "string",
8086
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8118
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8087
8119
  },
8088
8120
  target: {
8089
8121
  type: "string",
8090
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8122
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8091
8123
  },
8092
8124
  uid: {
8093
8125
  type: "number",
8094
- description: "CDP backendDOMNodeId of the element to scroll into view and anchor at, from take_snapshot. At most one of uid, selector, or x+y."
8126
+ description: "Element backendDOMNodeId."
8095
8127
  },
8096
8128
  selector: {
8097
8129
  type: "string",
8098
- description: "CSS selector for the element to anchor at (document.querySelector). At most one of uid, selector, or x+y."
8130
+ description: "CSS selector."
8099
8131
  },
8100
8132
  x: {
8101
8133
  type: "number",
8102
- description: "Absolute viewport x-coordinate to anchor at; must be given with y. At most one of uid, selector, or x+y."
8134
+ description: "Viewport x-coordinate."
8103
8135
  },
8104
8136
  y: {
8105
8137
  type: "number",
8106
- description: "Absolute viewport y-coordinate to anchor at; must be given with x. At most one of uid, selector, or x+y."
8138
+ description: "Viewport y-coordinate."
8107
8139
  },
8108
8140
  deltaX: {
8109
8141
  type: "number",
8110
- description: "Horizontal scroll delta; positive scrolls RIGHT. At least one of deltaX/deltaY required."
8142
+ description: "Horizontal scroll delta."
8111
8143
  },
8112
8144
  deltaY: {
8113
8145
  type: "number",
8114
- description: "Vertical scroll delta; positive scrolls DOWN. At least one of deltaX/deltaY required."
8146
+ description: "Vertical scroll delta."
8115
8147
  }
8116
8148
  },
8117
8149
  required: [],
@@ -8120,17 +8152,17 @@ var MANIFEST = [
8120
8152
  },
8121
8153
  {
8122
8154
  name: "dispatch_mouse",
8123
- description: "Dispatches one raw mouse event (move/down/up) at absolute viewport coordinates — the toolkit's lowest-level input primitive. Compose move/down/move/up calls yourself for anything click/drag's fixed sequences can't reach: canvas drag-painting, marquee/rubber-band selection, custom hit-testing widgets. Chrome-only: absent from tools/list under the Firefox backend, never present-and-throwing.",
8155
+ description: "Dispatch one raw mouse event at viewport coordinates; Chrome-only.",
8124
8156
  inputSchema: {
8125
8157
  type: "object",
8126
8158
  properties: {
8127
8159
  lease: {
8128
8160
  type: "string",
8129
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8161
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8130
8162
  },
8131
8163
  target: {
8132
8164
  type: "string",
8133
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8165
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8134
8166
  },
8135
8167
  action: {
8136
8168
  type: "string",
@@ -8139,15 +8171,15 @@ var MANIFEST = [
8139
8171
  "down",
8140
8172
  "up"
8141
8173
  ],
8142
- description: "Which raw event to dispatch: 'move' (mouseMoved), 'down' (mousePressed), or 'up' (mouseReleased)."
8174
+ description: "Mouse action."
8143
8175
  },
8144
8176
  x: {
8145
8177
  type: "number",
8146
- description: "Viewport x-coordinate. Required every call — CDP has no 'current pointer position' to default from."
8178
+ description: "Viewport x-coordinate."
8147
8179
  },
8148
8180
  y: {
8149
8181
  type: "number",
8150
- description: "Viewport y-coordinate. Required every call."
8182
+ description: "Viewport y-coordinate."
8151
8183
  },
8152
8184
  button: {
8153
8185
  type: "string",
@@ -8156,11 +8188,11 @@ var MANIFEST = [
8156
8188
  "right",
8157
8189
  "middle"
8158
8190
  ],
8159
- description: "Mouse button: 'left' (default), 'right', or 'middle'."
8191
+ description: "Mouse button."
8160
8192
  },
8161
8193
  clickCount: {
8162
8194
  type: "number",
8163
- description: "Click-run length for a 'down' or 'up' event (2 = second half of a double-click, 3 = triple-click). Ignored for 'move'; defaults to 1."
8195
+ description: "Click count."
8164
8196
  },
8165
8197
  modifiers: {
8166
8198
  type: "array",
@@ -8173,7 +8205,7 @@ var MANIFEST = [
8173
8205
  "Shift"
8174
8206
  ]
8175
8207
  },
8176
- description: "Modifier keys held for this one event, e.g. ['Shift']."
8208
+ description: "Modifier keys: Control|Ctrl|Shift|Alt|Meta|Cmd."
8177
8209
  }
8178
8210
  },
8179
8211
  required: [
@@ -8186,25 +8218,25 @@ var MANIFEST = [
8186
8218
  },
8187
8219
  {
8188
8220
  name: "wait_for_download",
8189
- description: "Wait for a file download to finish and return it as a real file on disk: {path,suggestedFilename,bytes,url,target}, written under the artifact dir's downloads/. ORDERING RULE, not optional: capture must be ARMED BEFORE the click that starts the download — call wait_for_download{arm:true} first (returns {armed:true,downloadPath,pending}), then click, then call again to collect the file. The download-behavior override is per-connection state Chrome REVERTS the moment the arming client disconnects, and an unarmed headless Chrome denies the download outright, so one triggered before arming is lost. SIDE EFFECT, browser-global: arming redirects EVERY download in this browser (all tabs, all origins) into the toolkit's downloads dir until this server exits — they no longer land in the user's normal Downloads folder. The arm lives on a connection this server holds open (an MCP-server capability): under the one-shot CLI the connection dies with the process and nothing is captured. Chrome-only (capability 'browser.downloads'): absent from tools/list under Firefox.",
8221
+ description: "Arm or collect a browser download; arm capture before triggering the download.",
8190
8222
  inputSchema: {
8191
8223
  type: "object",
8192
8224
  properties: {
8193
8225
  lease: {
8194
8226
  type: "string",
8195
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8227
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8196
8228
  },
8197
8229
  target: {
8198
8230
  type: "string",
8199
- description: "Names the tab for the lease check and the echoed target — a download is browser-scoped, so this does not pick which download is returned. Grammar: server instructions."
8231
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8200
8232
  },
8201
8233
  arm: {
8202
8234
  type: "boolean",
8203
- description: "Arm download capture and return immediately instead of waiting: {armed:true,downloadPath,pending}. Call this BEFORE the click that triggers the download. 'pending' counts downloads that already completed and have not been collected yet, so an arm call doubles as a peek."
8235
+ description: "Arm download capture."
8204
8236
  },
8205
8237
  timeoutMs: {
8206
8238
  type: "number",
8207
- description: "How long to wait for a download to complete, in milliseconds. Default 30000. Ignored with arm:true. A download that already completed and was not yet collected is returned immediately, so this only bounds the wait for one still in flight."
8239
+ description: "Timeout in milliseconds."
8208
8240
  }
8209
8241
  },
8210
8242
  required: [],
@@ -8213,32 +8245,32 @@ var MANIFEST = [
8213
8245
  },
8214
8246
  {
8215
8247
  name: "grant_permissions",
8216
- description: "Grant browser permissions for an origin up front, so a page asking for geolocation / notifications / clipboard gets an answer instead of a prompt no agent can click. 'permissions' takes CDP PermissionType values ('geolocation','notifications','clipboardReadWrite','camera',...); an unknown name is refused by Chrome, quoting the bad value. Returns {granted,origin,target}, or {reset:true,target} for a reset-only call. Grants are keyed by ORIGIN, not by tab: every tab on that origin is affected, including ones opened later. reset:true clears this server's previous grants first (or instead, when no permissions are given) — CDP's reset is not origin-scoped, so it clears them for every origin at once. The grant lives on a connection this server holds open and Chrome DISCARDS IT when that connection closes: an MCP-server capability, so under the one-shot CLI the grant dies with the process. Chrome-only (capability 'browser.permissions'): absent from tools/list under Firefox, never present-and-throwing.",
8248
+ description: "Grant or reset browser permissions; permissions are origin-scoped and Chrome-only.",
8217
8249
  inputSchema: {
8218
8250
  type: "object",
8219
8251
  properties: {
8220
8252
  lease: {
8221
8253
  type: "string",
8222
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8254
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8223
8255
  },
8224
8256
  target: {
8225
8257
  type: "string",
8226
- description: "Also the origin source when 'origin' is omitted. Grammar: server instructions."
8258
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8227
8259
  },
8228
8260
  permissions: {
8229
8261
  type: "array",
8230
8262
  items: {
8231
8263
  type: "string"
8232
8264
  },
8233
- description: "CDP PermissionType values to grant, e.g. ['geolocation'] or ['clipboardReadWrite','clipboardSanitizedWrite']. Required unless reset:true. An empty array is refused rather than treated as a successful no-op."
8265
+ description: "CDP PermissionType values, e.g. geolocation|notifications|clipboardReadWrite."
8234
8266
  },
8235
8267
  origin: {
8236
8268
  type: "string",
8237
- description: "Origin the grant applies to, e.g. 'https://example.com'. Defaults to the target tab's own origin. Required explicitly when that tab has no grantable origin (data:, blob:, about:blank all serialize to the opaque origin 'null'), which is refused with a message naming the tab's url."
8269
+ description: "Permission origin."
8238
8270
  },
8239
8271
  reset: {
8240
8272
  type: "boolean",
8241
- description: "Clear this server's previous permission grants (Browser.resetPermissions). With 'permissions' it resets FIRST and then grants, so the result is exactly the listed permissions; on its own it is a reset-only call answering {reset:true}. Not scoped to 'origin': CDP resets every origin at once."
8273
+ description: "Reset permission grants."
8242
8274
  }
8243
8275
  },
8244
8276
  required: [],
@@ -8247,25 +8279,25 @@ var MANIFEST = [
8247
8279
  },
8248
8280
  {
8249
8281
  name: "fill",
8250
- description: "Fills an element by focusing it, clearing existing content, then inserting value via Input.insertText (atomic paste-like commit, not per-character keystrokes — won't fire per-keypress handlers). Give exactly one of uid or selector.",
8282
+ description: "Replace an element contents; provide exactly one of UID or selector.",
8251
8283
  inputSchema: {
8252
8284
  type: "object",
8253
8285
  properties: {
8254
8286
  lease: {
8255
8287
  type: "string",
8256
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8288
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8257
8289
  },
8258
8290
  target: {
8259
8291
  type: "string",
8260
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8292
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8261
8293
  },
8262
8294
  uid: {
8263
8295
  type: "number",
8264
- description: "CDP backendDOMNodeId of the field to fill, from take_snapshot. Exactly one of uid or selector."
8296
+ description: "Element backendDOMNodeId."
8265
8297
  },
8266
8298
  selector: {
8267
8299
  type: "string",
8268
- description: "CSS selector for the field to fill (document.querySelector). Exactly one of uid or selector."
8300
+ description: "CSS selector."
8269
8301
  },
8270
8302
  value: {
8271
8303
  type: "string",
@@ -8280,35 +8312,35 @@ var MANIFEST = [
8280
8312
  },
8281
8313
  {
8282
8314
  name: "fill_form",
8283
- description: "Fills multiple form fields in one call; each is focused, cleared, then set via Input.insertText (overwrites existing content, same as fill). Each entry in the non-empty 'fields' array takes exactly one of uid or selector plus a string value.",
8315
+ description: "Fill multiple elements atomically; each field needs a UID or selector.",
8284
8316
  inputSchema: {
8285
8317
  type: "object",
8286
8318
  properties: {
8287
8319
  lease: {
8288
8320
  type: "string",
8289
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8321
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8290
8322
  },
8291
8323
  target: {
8292
8324
  type: "string",
8293
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8325
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8294
8326
  },
8295
8327
  fields: {
8296
8328
  type: "array",
8297
- description: "Non-empty array of fields to fill, each with exactly one of uid or selector plus a string value.",
8329
+ description: "Form fields to fill.",
8298
8330
  items: {
8299
8331
  type: "object",
8300
8332
  properties: {
8301
8333
  uid: {
8302
8334
  type: "number",
8303
- description: "CDP backendDOMNodeId of the field, obtained from take_snapshot. Provide exactly one of uid or selector."
8335
+ description: "Element backendDOMNodeId."
8304
8336
  },
8305
8337
  selector: {
8306
8338
  type: "string",
8307
- description: "CSS selector for the field (resolved via document.querySelector). Provide exactly one of uid or selector."
8339
+ description: "CSS selector."
8308
8340
  },
8309
8341
  value: {
8310
8342
  type: "string",
8311
- description: "The text value to set; the field is cleared first so this overwrites existing content."
8343
+ description: "Text value to set; the field is cleared first, overwriting existing content."
8312
8344
  }
8313
8345
  },
8314
8346
  required: [
@@ -8326,29 +8358,29 @@ var MANIFEST = [
8326
8358
  },
8327
8359
  {
8328
8360
  name: "type_text",
8329
- description: "Focuses an element and appends text via Input.insertText without clearing first — closest primitive to typing, but still atomic (not per-character keystrokes). Give exactly one of uid or selector.",
8361
+ description: "Append text to an element; input is atomic and does not clear existing content.",
8330
8362
  inputSchema: {
8331
8363
  type: "object",
8332
8364
  properties: {
8333
8365
  lease: {
8334
8366
  type: "string",
8335
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8367
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8336
8368
  },
8337
8369
  target: {
8338
8370
  type: "string",
8339
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8371
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8340
8372
  },
8341
8373
  uid: {
8342
8374
  type: "number",
8343
- description: "CDP backendDOMNodeId of the element to type into, from take_snapshot. Exactly one of uid or selector."
8375
+ description: "Element backendDOMNodeId."
8344
8376
  },
8345
8377
  selector: {
8346
8378
  type: "string",
8347
- description: "CSS selector for the element to type into (document.querySelector). Exactly one of uid or selector."
8379
+ description: "CSS selector."
8348
8380
  },
8349
8381
  text: {
8350
8382
  type: "string",
8351
- description: "Text to insert; appended to existing content rather than overwriting it."
8383
+ description: "Text substring."
8352
8384
  }
8353
8385
  },
8354
8386
  required: [
@@ -8359,25 +8391,25 @@ var MANIFEST = [
8359
8391
  },
8360
8392
  {
8361
8393
  name: "press_key",
8362
- description: "Dispatches a keyDown/keyUp pair for one key with optional modifiers. 'key' is a named key (Enter, Tab, Escape, ArrowDown, Backspace, etc.) or a single printable character — the named-key table is curated, with no F-keys, numpad, or IME support.",
8394
+ description: "Press one named key or printable character with modifiers; no F-keys or IME.",
8363
8395
  inputSchema: {
8364
8396
  type: "object",
8365
8397
  properties: {
8366
8398
  lease: {
8367
8399
  type: "string",
8368
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8400
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8369
8401
  },
8370
8402
  target: {
8371
8403
  type: "string",
8372
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8404
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8373
8405
  },
8374
8406
  key: {
8375
8407
  type: "string",
8376
- description: "Key to press: a named key (Enter, Tab, Escape, ArrowDown, Backspace, ...) or a single printable character."
8408
+ description: "Named key or printable character; e.g. Enter|Tab|Escape|ArrowDown|Backspace."
8377
8409
  },
8378
8410
  modifiers: {
8379
8411
  type: "array",
8380
- description: "Modifier names held during the press: 'Control'/'Ctrl', 'Shift', 'Alt', 'Meta'/'Cmd'.",
8412
+ description: "Modifier keys: Control|Ctrl|Shift|Alt|Meta|Cmd.",
8381
8413
  items: {
8382
8414
  type: "string"
8383
8415
  }
@@ -8391,32 +8423,32 @@ var MANIFEST = [
8391
8423
  },
8392
8424
  {
8393
8425
  name: "upload_file",
8394
- description: "Attaches one or more files to an <input type=file> element via DOM.setFileInputFiles. Give exactly one of uid or selector for the input; 'files' is an array of absolute path(s) — wrap a single path in an array too.",
8426
+ description: "Attach absolute file paths to a file input; provide an array.",
8395
8427
  inputSchema: {
8396
8428
  type: "object",
8397
8429
  properties: {
8398
8430
  lease: {
8399
8431
  type: "string",
8400
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8432
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8401
8433
  },
8402
8434
  target: {
8403
8435
  type: "string",
8404
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8436
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8405
8437
  },
8406
8438
  uid: {
8407
8439
  type: "number",
8408
- description: "CDP backendDOMNodeId of the file input element, from take_snapshot. Exactly one of uid or selector."
8440
+ description: "Element backendDOMNodeId."
8409
8441
  },
8410
8442
  selector: {
8411
8443
  type: "string",
8412
- description: "CSS selector for the file input element (document.querySelector). Exactly one of uid or selector."
8444
+ description: "CSS selector."
8413
8445
  },
8414
8446
  files: {
8415
8447
  type: "array",
8416
8448
  items: {
8417
8449
  type: "string"
8418
8450
  },
8419
- description: 'Absolute path(s) to attach to the <input type=file>, as an array — wrap a single path too, e.g. ["/tmp/a.pdf"]. Array-only because some model APIs (Google Gemini function calling) reject union-typed parameters.'
8451
+ description: "Absolute file paths."
8420
8452
  }
8421
8453
  },
8422
8454
  required: [
@@ -8427,17 +8459,17 @@ var MANIFEST = [
8427
8459
  },
8428
8460
  {
8429
8461
  name: "take_screenshot",
8430
- description: "Captures the viewport (default), the full scrollable page (fullPage), or one element (uid or selector, mutually exclusive) via CDP Page.captureScreenshot. Past 16384 device px per side Chrome can hang rather than refuse, so size is checked first via Page.getLayoutMetrics; an oversized capture is auto-tiled into vertical bands stitched losslessly into one PNG (see tile) instead of wedging the tab. Writes PNG/JPEG to /tmp/cdp-toolkit (override savePath, dir auto-created); returns {path,bytes,format,target,scale} plus width/height measured from the encoded bytes (omitted if undecodable). renderSize/renderRestored(+renderRestoreError) accompany a renderWidth/renderHeight capture, tiled/bands a banded one. returnBase64 adds raw bytes to the result but is refused on a banded capture. quality applies to jpeg only.",
8462
+ description: "Capture a viewport, full page, or element to PNG/JPEG; oversized captures may be tiled.",
8431
8463
  inputSchema: {
8432
8464
  type: "object",
8433
8465
  properties: {
8434
8466
  lease: {
8435
8467
  type: "string",
8436
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8468
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8437
8469
  },
8438
8470
  target: {
8439
8471
  type: "string",
8440
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8472
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8441
8473
  },
8442
8474
  format: {
8443
8475
  type: "string",
@@ -8445,47 +8477,47 @@ var MANIFEST = [
8445
8477
  "png",
8446
8478
  "jpeg"
8447
8479
  ],
8448
- description: "Image format, default png. quality applies only to jpeg."
8480
+ description: "Image/frame format."
8449
8481
  },
8450
8482
  quality: {
8451
8483
  type: "number",
8452
- description: "JPEG quality 0-100, default 80; ignored for png."
8484
+ description: "JPEG quality 0-100."
8453
8485
  },
8454
8486
  fullPage: {
8455
8487
  type: "boolean",
8456
- description: "Capture the full scrollable height (via Page.getLayoutMetrics), not just the viewport."
8488
+ description: "Capture full scrollable page."
8457
8489
  },
8458
8490
  scale: {
8459
8491
  type: "number",
8460
- description: "Output-pixel multiplier for this capture only (0<scale<=8, default 1): output px = ceil(css px x scale x devicePixelRatio); the page is never told anything changed. Chrome only (screenshot.scale) — Firefox BiDi has no scale param, use emulate{deviceScaleFactor} then scale:1. A projection over 16384 device px/side is refused up front, naming the largest scale that fits."
8492
+ description: "Output scale (0<scale<=8)."
8461
8493
  },
8462
8494
  renderWidth: {
8463
8495
  type: "number",
8464
- description: "Emulates this viewport width (CSS px, 1-16384) for one capture, then restores it. Required with renderHeight. Unlike scale, this changes what the page believes (media queries re-flow) — e.g. capture a responsive page at 1920x1080 from a differently-sized tab. Restore only works for an override this toolkit itself set; check result.renderRestored (false = still emulated, fix via emulate). Works on both backends (capability screenshot.renderSize)."
8496
+ description: "Rendered viewport width."
8465
8497
  },
8466
8498
  renderHeight: {
8467
8499
  type: "number",
8468
- description: "Emulates this viewport height (CSS px, 1-16384) for one capture. Required with renderWidth — a viewport is two numbers. A narrow renderWidth often reflows pages TALLER, which is the usual way a render-size capture trips the 16384px encode limit."
8500
+ description: "Rendered viewport height."
8469
8501
  },
8470
8502
  tile: {
8471
8503
  type: "boolean",
8472
- description: "Whether to allow vertical-band stitching: omitted=AUTO (band only if a single shot wouldn't fit), false=never band (refuse instead), true=always band (Chrome-only capability). Banded output is PNG-only, can't returnBase64, and only bands on HEIGHT (oversized WIDTH is refused, not split). Bands are a faithful crop, but lazy/virtualized content the real viewport never scrolled to renders blank."
8504
+ description: "Vertical-band stitching."
8473
8505
  },
8474
8506
  uid: {
8475
8507
  type: "number",
8476
- description: "Element to clip to: a backendDOMNodeId from take_snapshot. Mutually exclusive with selector."
8508
+ description: "Element backendDOMNodeId."
8477
8509
  },
8478
8510
  selector: {
8479
8511
  type: "string",
8480
- description: "CSS selector to clip the capture to. Mutually exclusive with uid."
8512
+ description: "CSS selector."
8481
8513
  },
8482
8514
  savePath: {
8483
8515
  type: "string",
8484
- description: "Override the output path (default /tmp/cdp-toolkit/screenshot-<id>-<stamp>.<ext>, stamped at capture START). Directory is created from this path's dirname."
8516
+ description: "Output file path."
8485
8517
  },
8486
8518
  returnBase64: {
8487
8519
  type: "boolean",
8488
- description: "Also return raw base64 bytes in the result. Refused on a banded capture (see tile) — a stitched image can run to hundreds of MB; read the file at the returned path instead."
8520
+ description: "Return base64 bytes."
8489
8521
  }
8490
8522
  },
8491
8523
  required: [],
@@ -8494,49 +8526,49 @@ var MANIFEST = [
8494
8526
  },
8495
8527
  {
8496
8528
  name: "emulate",
8497
- description: "Applies any subset of Chrome emulation overrides in one call: device metrics (width+height together, +deviceScaleFactor/mobile), userAgent, cpuThrottlingRate(>=1), media type+features, networkConditions. Device-metrics overrides PERSIST on the target until cleared or the renderer navigates/reloads; every other override is session-scoped and resets when this call's connection closes. clearOverrides:true resets everything (ignoring other fields) and, as of 1.9.2, genuinely clears a device-metrics override set by a DIFFERENT process — Chrome's clearDeviceMetricsOverride is normally a no-op unless the clearing connection also set the override, so the driver re-asserts the tab's current size first, then clears, throwing rather than reporting cleared:true if it can't verify.",
8529
+ description: "Apply browser emulation overrides; width and height must be paired.",
8498
8530
  inputSchema: {
8499
8531
  type: "object",
8500
8532
  properties: {
8501
8533
  lease: {
8502
8534
  type: "string",
8503
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8535
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8504
8536
  },
8505
8537
  target: {
8506
8538
  type: "string",
8507
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8539
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8508
8540
  },
8509
8541
  width: {
8510
8542
  type: "number",
8511
- description: "Device-metrics viewport width in CSS px. Must be paired with height."
8543
+ description: "Viewport width; pair with height."
8512
8544
  },
8513
8545
  height: {
8514
8546
  type: "number",
8515
- description: "Device-metrics viewport height in CSS px. Must be paired with width."
8547
+ description: "Viewport height; pair with width."
8516
8548
  },
8517
8549
  deviceScaleFactor: {
8518
8550
  type: "number",
8519
- description: "Device pixel ratio for the device-metrics override; 0 = platform default."
8551
+ description: "Device pixel ratio."
8520
8552
  },
8521
8553
  mobile: {
8522
8554
  type: "boolean",
8523
- description: "Emulate a mobile device (viewport meta, scrollbars, etc.) for the device-metrics override."
8555
+ description: "Mobile emulation."
8524
8556
  },
8525
8557
  userAgent: {
8526
8558
  type: "string",
8527
- description: "User-Agent string override (Emulation.setUserAgentOverride)."
8559
+ description: "User-Agent override."
8528
8560
  },
8529
8561
  cpuThrottlingRate: {
8530
8562
  type: "number",
8531
- description: "CPU throttling multiplier: 1=none, 2=2x slower, etc. Must be >=1."
8563
+ description: "CPU throttling rate (>=1)."
8532
8564
  },
8533
8565
  media: {
8534
8566
  type: "string",
8535
- description: "Emulated CSS media type: 'screen' | 'print' | '' (clear)."
8567
+ description: "CSS media: screen|print|blank."
8536
8568
  },
8537
8569
  mediaFeatures: {
8538
8570
  type: "array",
8539
- description: "Emulated media features, e.g. [{name:'prefers-color-scheme', value:'dark'}].",
8571
+ description: "CSS media feature overrides.",
8540
8572
  items: {
8541
8573
  type: "object",
8542
8574
  properties: {
@@ -8546,7 +8578,7 @@ var MANIFEST = [
8546
8578
  },
8547
8579
  value: {
8548
8580
  type: "string",
8549
- description: "Media feature value, e.g. 'dark'."
8581
+ description: "Feature value, e.g. 'dark'."
8550
8582
  }
8551
8583
  },
8552
8584
  required: [
@@ -8558,34 +8590,34 @@ var MANIFEST = [
8558
8590
  },
8559
8591
  networkConditions: {
8560
8592
  type: "object",
8561
- description: "Network overrides applied via Network.emulateNetworkConditions.",
8593
+ description: "Network condition overrides.",
8562
8594
  properties: {
8563
8595
  offline: {
8564
8596
  type: "boolean",
8565
- description: "True to simulate offline."
8597
+ description: "Simulate offline."
8566
8598
  },
8567
8599
  latency: {
8568
8600
  type: "number",
8569
- description: "Additional round-trip latency in milliseconds."
8601
+ description: "Network latency in milliseconds."
8570
8602
  },
8571
8603
  downloadThroughput: {
8572
8604
  type: "number",
8573
- description: "Max download throughput in bytes/sec (-1 = no limit)."
8605
+ description: "Download throughput; -1 unlimited."
8574
8606
  },
8575
8607
  uploadThroughput: {
8576
8608
  type: "number",
8577
- description: "Max upload throughput in bytes/sec (-1 = no limit)."
8609
+ description: "Upload throughput; -1 unlimited."
8578
8610
  },
8579
8611
  connectionType: {
8580
8612
  type: "string",
8581
- description: "Connection type: 'none' | 'cellular2g' | 'cellular3g' | 'cellular4g' | 'bluetooth' | 'ethernet' | 'wifi' | 'wimax' | 'other'."
8613
+ description: "Connection: none|cellular2g|cellular3g|cellular4g|bluetooth|ethernet|wifi|wimax|other."
8582
8614
  }
8583
8615
  },
8584
8616
  additionalProperties: false
8585
8617
  },
8586
8618
  clearOverrides: {
8587
8619
  type: "boolean",
8588
- description: "Reset every override (metrics, UA, CPU, media, network) to browser default; ignores all other fields when true."
8620
+ description: "Clear all emulation overrides."
8589
8621
  }
8590
8622
  },
8591
8623
  required: [],
@@ -8594,33 +8626,33 @@ var MANIFEST = [
8594
8626
  },
8595
8627
  {
8596
8628
  name: "resize_page",
8597
- description: "Sets the page's device-metrics width/height (the narrow case of emulate), optionally deviceScaleFactor/mobile, then verifies by reading back window.innerWidth/innerHeight after applying. Requires positive width and height. The override PERSISTS on the target until cleared (emulate{clearOverrides:true}) or the renderer navigates/reloads.",
8629
+ description: "Set and verify page viewport metrics; width and height are required.",
8598
8630
  inputSchema: {
8599
8631
  type: "object",
8600
8632
  properties: {
8601
8633
  lease: {
8602
8634
  type: "string",
8603
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8635
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8604
8636
  },
8605
8637
  target: {
8606
8638
  type: "string",
8607
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8639
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8608
8640
  },
8609
8641
  width: {
8610
8642
  type: "number",
8611
- description: "Viewport width in CSS px (required, must be positive)."
8643
+ description: "Viewport width; pair with height."
8612
8644
  },
8613
8645
  height: {
8614
8646
  type: "number",
8615
- description: "Viewport height in CSS px (required, must be positive)."
8647
+ description: "Viewport height; pair with width."
8616
8648
  },
8617
8649
  deviceScaleFactor: {
8618
8650
  type: "number",
8619
- description: "Device pixel ratio; 0 = platform default."
8651
+ description: "Device pixel ratio."
8620
8652
  },
8621
8653
  mobile: {
8622
8654
  type: "boolean",
8623
- description: "Emulate a mobile device for the device-metrics override."
8655
+ description: "Mobile emulation."
8624
8656
  }
8625
8657
  },
8626
8658
  required: [
@@ -8632,33 +8664,33 @@ var MANIFEST = [
8632
8664
  },
8633
8665
  {
8634
8666
  name: "handle_dialog",
8635
- description: "Wait for the next JavaScript dialog (alert/confirm/prompt/beforeunload) on a page and respond via Page.handleJavaScriptDialog, accepting or dismissing it. Default mode resolves with the first handled dialog or throws on timeout; set autoMs to handle every dialog opening during a fixed window and resolve with the list. Trigger the dialog out-of-band (e.g. click a button) — a blocking dialog freezes the renderer, so it cannot be triggered inline.",
8667
+ description: "Handle the next JavaScript dialog; autoMs switches to timed multi-dialog mode.",
8636
8668
  inputSchema: {
8637
8669
  type: "object",
8638
8670
  properties: {
8639
8671
  lease: {
8640
8672
  type: "string",
8641
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8673
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8642
8674
  },
8643
8675
  target: {
8644
8676
  type: "string",
8645
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8677
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8646
8678
  },
8647
8679
  accept: {
8648
8680
  type: "boolean",
8649
- description: "Whether to accept (OK) or dismiss (Cancel) the dialog."
8681
+ description: "Accept or dismiss dialog."
8650
8682
  },
8651
8683
  promptText: {
8652
8684
  type: "string",
8653
- description: "Text to enter for a prompt() dialog when accepting."
8685
+ description: "Prompt response text."
8654
8686
  },
8655
8687
  timeoutMs: {
8656
8688
  type: "number",
8657
- description: "How long to wait for the next dialog, in milliseconds (default 15000)."
8689
+ description: "Timeout in milliseconds."
8658
8690
  },
8659
8691
  autoMs: {
8660
8692
  type: "number",
8661
- description: "Auto-handle mode: keep handling every dialog that opens for this many milliseconds, then resolve with the list of handled dialogs (an empty list is valid; never throws on 'no dialog')."
8693
+ description: "Multi-dialog window in milliseconds."
8662
8694
  }
8663
8695
  },
8664
8696
  required: [
@@ -8669,29 +8701,29 @@ var MANIFEST = [
8669
8701
  },
8670
8702
  {
8671
8703
  name: "list_console_messages",
8672
- description: "Read console output (logs, warnings, exceptions) captured for the target. Reads the existing shared buffer by default (empty if no capture ran); reload:true reloads and records a fresh capture (console+network together, so a network reload never wipes console history). WORKER capture (Chrome, Capability 'worker.targets'): a worker: target records an MV3 background service worker -- its console.log arrives as Runtime.consoleAPICalled, its outbound requests from CDP's Network domain on the worker's own session -- so the two tricks callers try first fail for plain JS reasons, not worker ones: a value bound at module top level is not visible from evaluate_script's global scope, and assigning self.fetch cannot rebind a fetch the module already captured. A worker has no reload: reload:true means 'listen for durationMs while it runs', so trigger its work (tool call, message, alarm) during the window; a worker woken by the call already ran its top-level code, so a startup message can be missed. SIDE EFFECT: the CDP session KEEPS THE WORKER ALIVE for the capture (an idle MV3 worker is evicted in seconds); Chrome resumes evicting after.",
8704
+ description: "Read or recapture console messages for a page or worker; worker capture is Chrome-only.",
8673
8705
  inputSchema: {
8674
8706
  type: "object",
8675
8707
  properties: {
8676
8708
  lease: {
8677
8709
  type: "string",
8678
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8710
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8679
8711
  },
8680
8712
  target: {
8681
8713
  type: "string",
8682
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', '<targetId>'; plus 'worker:<substring>' to reach a service/shared worker (e.g. an MV3 extension background worker). The worker: arm is CHROME-ONLY (Capability 'worker.targets'). Grammar: see server instructions."
8714
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8683
8715
  },
8684
8716
  reload: {
8685
8717
  type: "boolean",
8686
- description: "Record fresh by reloading the page and capturing a window. Default false (read existing buffer). With a worker: target nothing reloads -- records for durationMs while the worker runs and keeps it alive until the capture stops."
8718
+ description: "Reload before capture."
8687
8719
  },
8688
8720
  durationMs: {
8689
8721
  type: "number",
8690
- description: "Capture window for reload mode, in ms. Default 2500."
8722
+ description: "Capture duration in milliseconds."
8691
8723
  },
8692
8724
  wake: {
8693
8725
  type: "boolean",
8694
- description: "Worker targets only, when starting a capture. Default true: an idle-evicted MV3 service worker exists in no target listing, so it is started first (ServiceWorker.startWorker) and re-confirmed; false fails fast. Rejected on a page target, a bare target id, or a read-only call. See server instructions."
8726
+ description: "Wake worker before capture."
8695
8727
  }
8696
8728
  },
8697
8729
  required: [],
@@ -8700,21 +8732,21 @@ var MANIFEST = [
8700
8732
  },
8701
8733
  {
8702
8734
  name: "get_console_message",
8703
- description: "Return one console entry by zero-based index from the target's existing console buffer. Throws if the index is out of range; run list_console_messages (optionally reload:true) first to populate the buffer.",
8735
+ description: "Return one console entry by zero-based index from the existing buffer.",
8704
8736
  inputSchema: {
8705
8737
  type: "object",
8706
8738
  properties: {
8707
8739
  lease: {
8708
8740
  type: "string",
8709
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8741
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8710
8742
  },
8711
8743
  target: {
8712
8744
  type: "string",
8713
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8745
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8714
8746
  },
8715
8747
  index: {
8716
8748
  type: "number",
8717
- description: "Zero-based index into the parsed console entries. Default 0."
8749
+ description: "Zero-based entry index."
8718
8750
  }
8719
8751
  },
8720
8752
  required: [],
@@ -8723,33 +8755,33 @@ var MANIFEST = [
8723
8755
  },
8724
8756
  {
8725
8757
  name: "list_network_requests",
8726
- description: "Return correlated network rows (one per requestId; status/headers/state) for the target. Reads the existing buffer by default; reload:true records a fresh both-domains capture window. filterUrl keeps only URLs containing a substring. WORKER capture (Chrome, Capability 'worker.targets'): a worker: target records an MV3 background service worker's outbound requests from CDP's Network domain on the worker's own session -- what the code ACTUALLY SENT -- so the two tricks callers try first fail for plain JS reasons, not worker ones: a value bound at module top level is not visible from evaluate_script's global scope, and assigning self.fetch cannot rebind a fetch the module already captured. A worker has no reload: reload:true means 'listen for durationMs while it runs', so trigger its work (tool call, message, alarm) during the window; a worker woken by the call already ran its top-level code, so a startup request can be missed. SIDE EFFECT: the CDP session KEEPS THE WORKER ALIVE for the capture (an idle MV3 worker is evicted in seconds); Chrome resumes evicting after.",
8758
+ description: "Read or recapture correlated network requests; worker capture is Chrome-only.",
8727
8759
  inputSchema: {
8728
8760
  type: "object",
8729
8761
  properties: {
8730
8762
  lease: {
8731
8763
  type: "string",
8732
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8764
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8733
8765
  },
8734
8766
  target: {
8735
8767
  type: "string",
8736
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', '<targetId>'; plus 'worker:<substring>' to reach a service/shared worker (e.g. an MV3 extension background worker). The worker: arm is CHROME-ONLY (Capability 'worker.targets'). Grammar: see server instructions."
8768
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8737
8769
  },
8738
8770
  reload: {
8739
8771
  type: "boolean",
8740
- description: "Record fresh by reloading the page and capturing a window. Default false (read existing buffer). With a worker: target nothing reloads -- records for durationMs while the worker runs and keeps it alive until the capture stops."
8772
+ description: "Reload before capture."
8741
8773
  },
8742
8774
  durationMs: {
8743
8775
  type: "number",
8744
- description: "Capture window for reload mode, in ms. Default 2500."
8776
+ description: "Capture duration in milliseconds."
8745
8777
  },
8746
8778
  filterUrl: {
8747
8779
  type: "string",
8748
- description: "Return only requests whose URL contains this substring."
8780
+ description: "URL substring filter."
8749
8781
  },
8750
8782
  wake: {
8751
8783
  type: "boolean",
8752
- description: "Worker targets only, when starting a capture. Default true: an idle-evicted MV3 service worker exists in no target listing, so it is started first (ServiceWorker.startWorker) and re-confirmed; false fails fast. Rejected on a page target, a bare target id, or a read-only call. See server instructions."
8784
+ description: "Wake worker before capture."
8753
8785
  }
8754
8786
  },
8755
8787
  required: [],
@@ -8758,37 +8790,37 @@ var MANIFEST = [
8758
8790
  },
8759
8791
  {
8760
8792
  name: "get_network_request",
8761
- description: "Return one network request (matched by exact requestId, else url substring) with status/headers. Requires requestId or url (throws otherwise). includeBody:true drives a fresh capture (page reload, or worker listen window) matched by url ONLY -- a fresh capture re-mints requestIds, so a carried-over requestId returns metadata plus bodyUnavailableReason. WORKER capture (Chrome, Capability 'worker.targets'): a worker: target records an MV3 background service worker's outbound requests from CDP's Network domain on the worker's own session -- what the code ACTUALLY SENT -- so the two tricks callers try first fail for plain JS reasons, not worker ones: a value bound at module top level is not visible from evaluate_script's global scope, and assigning self.fetch cannot rebind a fetch the module already captured. A worker has no reload: reload means 'listen for durationMs while it runs', so trigger its work (tool call, message, alarm) during the window; a worker woken by the call already ran its top-level code, so a startup request can be missed. SIDE EFFECT: the CDP session KEEPS THE WORKER ALIVE for the capture (an idle MV3 worker is evicted in seconds); Chrome resumes evicting after.",
8793
+ description: "Return a network request by ID or URL; body capture requires URL.",
8762
8794
  inputSchema: {
8763
8795
  type: "object",
8764
8796
  properties: {
8765
8797
  lease: {
8766
8798
  type: "string",
8767
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8799
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8768
8800
  },
8769
8801
  target: {
8770
8802
  type: "string",
8771
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', '<targetId>'; plus 'worker:<substring>' to reach a service/shared worker (e.g. an MV3 extension background worker). The worker: arm is CHROME-ONLY (Capability 'worker.targets'). Grammar: see server instructions."
8803
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8772
8804
  },
8773
8805
  requestId: {
8774
8806
  type: "string",
8775
- description: "Match by exact requestId (metadata only; cannot fetch a body, since a reload re-mints requestIds)."
8807
+ description: "Exact request ID."
8776
8808
  },
8777
8809
  url: {
8778
8810
  type: "string",
8779
- description: "Match by URL substring (first match). Required for body fetch (includeBody), since url is stable across reload."
8811
+ description: "URL value."
8780
8812
  },
8781
8813
  includeBody: {
8782
8814
  type: "boolean",
8783
- description: "Also fetch the response body; drives a fresh capture and requires the url selector."
8815
+ description: "Include response body."
8784
8816
  },
8785
8817
  durationMs: {
8786
8818
  type: "number",
8787
- description: "Capture window for the body-fetch reload, in ms. Default 2500."
8819
+ description: "Capture duration in milliseconds."
8788
8820
  },
8789
8821
  wake: {
8790
8822
  type: "boolean",
8791
- description: "Worker targets only, when starting a capture. Default true: an idle-evicted MV3 service worker exists in no target listing, so it is started first (ServiceWorker.startWorker) and re-confirmed; false fails fast. Rejected on a page target, a bare target id, or a read-only call. See server instructions."
8823
+ description: "Wake worker before capture."
8792
8824
  }
8793
8825
  },
8794
8826
  required: [],
@@ -8797,24 +8829,24 @@ var MANIFEST = [
8797
8829
  },
8798
8830
  {
8799
8831
  name: "performance_start_trace",
8800
- description: "Starts a CDP trace recording on the target and holds the recording connection in-process; you MUST call performance_stop_trace from the SAME PROCESS to end it, or use performance_trace instead for a robust cross-call trace. Throws if a trace is already in progress for this target.",
8832
+ description: "Start an in-process trace; stop it from the same process.",
8801
8833
  inputSchema: {
8802
8834
  type: "object",
8803
8835
  properties: {
8804
8836
  lease: {
8805
8837
  type: "string",
8806
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8838
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8807
8839
  },
8808
8840
  target: {
8809
8841
  type: "string",
8810
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8842
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8811
8843
  },
8812
8844
  categories: {
8813
8845
  type: "array",
8814
8846
  items: {
8815
8847
  type: "string"
8816
8848
  },
8817
- description: "Trace categories to record. Defaults to timeline + user-timing + loading + disabled-by-default timeline tracks carrying LCP/LayoutShift/RunTask."
8849
+ description: "Trace categories."
8818
8850
  }
8819
8851
  },
8820
8852
  required: [],
@@ -8823,17 +8855,17 @@ var MANIFEST = [
8823
8855
  },
8824
8856
  {
8825
8857
  name: "performance_stop_trace",
8826
- description: "Stops the in-process trace started by performance_start_trace and writes it as JSON under /tmp/cdp-toolkit, returning {path,bytes,events,metrics}. Throws if no live trace exists in THIS process (e.g. start ran in a different process) — use performance_trace instead. The target arg is accepted only for API symmetry; at most one trace is ever live per process.",
8858
+ description: "Stop the in-process trace and write JSON; a live trace is required.",
8827
8859
  inputSchema: {
8828
8860
  type: "object",
8829
8861
  properties: {
8830
8862
  lease: {
8831
8863
  type: "string",
8832
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8864
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8833
8865
  },
8834
8866
  target: {
8835
8867
  type: "string",
8836
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8868
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8837
8869
  }
8838
8870
  },
8839
8871
  required: [],
@@ -8842,17 +8874,17 @@ var MANIFEST = [
8842
8874
  },
8843
8875
  {
8844
8876
  name: "performance_analyze_insight",
8845
- description: "Reads a trace JSON file (from performance_trace/performance_stop_trace) at tracePath and returns headline metrics: FCP/LCP/CLS/TBT, long tasks, layout shifts. Requires an EXPLICIT tracePath — there is no implicit 'latest trace'. Numbers approximate DevTools's insight analyzer (no main-thread attribution or frame-scoped LCP).",
8877
+ description: "Analyze a trace JSON file for key performance metrics; tracePath is required.",
8846
8878
  inputSchema: {
8847
8879
  type: "object",
8848
8880
  properties: {
8849
8881
  lease: {
8850
8882
  type: "string",
8851
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8883
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8852
8884
  },
8853
8885
  tracePath: {
8854
8886
  type: "string",
8855
- description: "Path to a trace JSON file (bare array or {traceEvents:[...]}) written by performance_trace or performance_stop_trace. Required."
8887
+ description: "Trace JSON file path."
8856
8888
  }
8857
8889
  },
8858
8890
  required: [],
@@ -8861,36 +8893,36 @@ var MANIFEST = [
8861
8893
  },
8862
8894
  {
8863
8895
  name: "performance_trace",
8864
- description: "RECOMMENDED entry point: one-shot trace that starts tracing, optionally reloads or navigates the page, waits durationMs (default 3000ms), stops, and writes JSON under /tmp/cdp-toolkit — returns {path,bytes,events,metrics,target}. Holds one connection open for the whole window, so unlike start/stop it is NOT limited to a single process.",
8896
+ description: "Run a one-shot trace with optional navigation and write JSON; durationMs controls capture time.",
8865
8897
  inputSchema: {
8866
8898
  type: "object",
8867
8899
  properties: {
8868
8900
  lease: {
8869
8901
  type: "string",
8870
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8902
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8871
8903
  },
8872
8904
  target: {
8873
8905
  type: "string",
8874
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8906
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8875
8907
  },
8876
8908
  durationMs: {
8877
8909
  type: "number",
8878
- description: "How long to record after the optional reload/navigate, in ms. Default 3000."
8910
+ description: "Capture duration in milliseconds."
8879
8911
  },
8880
8912
  reload: {
8881
8913
  type: "boolean",
8882
- description: "Reload the page after starting the trace, to capture full navigation timing."
8914
+ description: "Reload before capture."
8883
8915
  },
8884
8916
  navigateTo: {
8885
8917
  type: "string",
8886
- description: "Navigate to this URL after starting the trace (alternative to reload)."
8918
+ description: "Navigation URL."
8887
8919
  },
8888
8920
  categories: {
8889
8921
  type: "array",
8890
8922
  items: {
8891
8923
  type: "string"
8892
8924
  },
8893
- description: "Trace categories to record. Defaults to timeline + user-timing + loading + disabled-by-default timeline tracks carrying LCP/LayoutShift/RunTask."
8925
+ description: "Trace categories."
8894
8926
  }
8895
8927
  },
8896
8928
  required: [],
@@ -8899,17 +8931,17 @@ var MANIFEST = [
8899
8931
  },
8900
8932
  {
8901
8933
  name: "start_screen_recording",
8902
- description: "Starts recording the target tab to video via CDP Page.startScreencast, holding one persistent connection and spooling every frame to disk — MUST be paired with stop_screen_recording WITHIN THE SAME PROCESS (frames are connection-scoped and cannot be reattached from another process, so this only works under the MCP server, not the one-process-per-call CLI). Chrome only: WebDriver BiDi has no screencast primitive, so both tools are absent under --browser firefox. Frames arrive ON REPAINT not on a clock (variable rate); each is timestamped into a ledger that stop_screen_recording turns into per-frame display durations, so a still page holds one long frame instead of racing. ffmpeg is probed here (not at stop) so a missing encoder fails before frames are captured and thrown away. Throws if the target already has a recording in progress; different targets record concurrently.",
8934
+ description: "Start a tab screen recording; stop it from the same process.",
8903
8935
  inputSchema: {
8904
8936
  type: "object",
8905
8937
  properties: {
8906
8938
  lease: {
8907
8939
  type: "string",
8908
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8940
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8909
8941
  },
8910
8942
  target: {
8911
8943
  type: "string",
8912
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
8944
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8913
8945
  },
8914
8946
  format: {
8915
8947
  type: "string",
@@ -8917,27 +8949,27 @@ var MANIFEST = [
8917
8949
  "jpeg",
8918
8950
  "png"
8919
8951
  ],
8920
- description: "Frame format, default jpeg (much smaller per repaint); png is lossless. quality applies to jpeg only."
8952
+ description: "Image/frame format."
8921
8953
  },
8922
8954
  quality: {
8923
8955
  type: "number",
8924
- description: "JPEG frame quality 0-100. Ignored for png; omitted leaves Chrome's own default."
8956
+ description: "JPEG quality 0-100."
8925
8957
  },
8926
8958
  maxWidth: {
8927
8959
  type: "number",
8928
- description: "Caps the streamed frame width in px; also pins frame size if the viewport may change mid-recording."
8960
+ description: "Maximum frame width."
8929
8961
  },
8930
8962
  maxHeight: {
8931
8963
  type: "number",
8932
- description: "Caps the streamed frame height in px."
8964
+ description: "Maximum frame height."
8933
8965
  },
8934
8966
  everyNthFrame: {
8935
8967
  type: "number",
8936
- description: "Capture only every Nth repaint (1=every frame), to shrink spool size on a busy page; per-frame durations keep playback at wallclock speed either way."
8968
+ description: "Capture every Nth frame."
8937
8969
  },
8938
8970
  bringToFront: {
8939
8971
  type: "boolean",
8940
- description: "Activate the tab (Page.bringToFront) before recording, default false. A backgrounded/occluded tab may never repaint, yielding a 0-frame recording."
8972
+ description: "Activate tab before recording."
8941
8973
  }
8942
8974
  },
8943
8975
  required: [],
@@ -8946,21 +8978,21 @@ var MANIFEST = [
8946
8978
  },
8947
8979
  {
8948
8980
  name: "stop_screen_recording",
8949
- description: "Stops the recording started by start_screen_recording, assembling spooled frames into an MP4 via ffmpeg with PER-FRAME durations (frame N held until N+1 painted; last frame held until this call) — capped at 25fps by ffmpeg's concat demuxer, so frames under 40ms apart are deliberately coalesced (frameCount=captured, encodedFrames=what reached the video, never silently dropped). Returns {path,bytes,durationMs,frameCount,encodedFrames,codec,encoder,width,height,droppedFrames,target}; durationMs sums encoded durations, the file runs one 40ms step longer (final frame repeated). Encoder ladder (probed at start): hevc_videotoolbox>h264_videotoolbox>libx265>libx264 (+hvc1 tag, faststart, yuv420p, even dims). target: omit with one recording in flight, required with several (avoids guessing which to stop). Throws if nothing is recording in this process, or if 0 frames arrived (no silent empty video). On ffmpeg failure the spooled frames are KEPT — spool path + exact command are in the error.",
8981
+ description: "Stop a screen recording and encode MP4; target is required when multiple recordings exist.",
8950
8982
  inputSchema: {
8951
8983
  type: "object",
8952
8984
  properties: {
8953
8985
  lease: {
8954
8986
  type: "string",
8955
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
8987
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8956
8988
  },
8957
8989
  target: {
8958
8990
  type: "string",
8959
- description: "Which recording to stop — 'active' valid only when exactly one recording is in flight. Grammar: server instructions."
8991
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8960
8992
  },
8961
8993
  savePath: {
8962
8994
  type: "string",
8963
- description: "Override the output path (default /tmp/cdp-toolkit/screen-recording-<targetIdShort>-<stamp>.mp4)."
8995
+ description: "Output file path."
8964
8996
  }
8965
8997
  },
8966
8998
  required: [],
@@ -8969,21 +9001,21 @@ var MANIFEST = [
8969
9001
  },
8970
9002
  {
8971
9003
  name: "take_heapsnapshot",
8972
- description: "Captures a V8 heap snapshot of the target page over CDP and writes it as a .heapsnapshot JSON file (loadable in the DevTools Memory panel) under /tmp/cdp-toolkit unless savePath is given. Returns {path,bytes,chunks,target} only — does NOT parse or summarize the snapshot.",
9004
+ description: "Capture a V8 heap snapshot to JSON; the snapshot is not parsed.",
8973
9005
  inputSchema: {
8974
9006
  type: "object",
8975
9007
  properties: {
8976
9008
  lease: {
8977
9009
  type: "string",
8978
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
9010
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
8979
9011
  },
8980
9012
  target: {
8981
9013
  type: "string",
8982
- description: "Page selector: 'active' (default), 'index:N', 'url:<substr>', 'title:<substr>', 'label:<name>', or a 32-hex '<targetId>'. Grammar: see server instructions."
9014
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
8983
9015
  },
8984
9016
  savePath: {
8985
9017
  type: "string",
8986
- description: "Override the output path. Absolute paths (starting with /) are used as-is; relative paths resolve under the artifact dir (/tmp/cdp-toolkit). Defaults to an auto-named take_heapsnapshot-<targetId>-<timestamp>.heapsnapshot file."
9018
+ description: "Output file path."
8987
9019
  }
8988
9020
  },
8989
9021
  required: [],
@@ -8992,28 +9024,28 @@ var MANIFEST = [
8992
9024
  },
8993
9025
  {
8994
9026
  name: "lighthouse_audit",
8995
- description: "Runs a Lighthouse audit against a URL by shelling out to `npx --yes lighthouse` (the toolkit's only non-CDP tool) — it attaches to the already-running Chrome and audits its OWN about:blank tab, NOT any live user tab you've navigated. Writes a JSON report under /tmp/cdp-toolkit; returns {path,bytes} plus per-category scores (0..1 or null).",
9027
+ description: "Run Lighthouse against a URL in its own tab; it does not audit a user tab.",
8996
9028
  inputSchema: {
8997
9029
  type: "object",
8998
9030
  properties: {
8999
9031
  lease: {
9000
9032
  type: "string",
9001
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
9033
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
9002
9034
  },
9003
9035
  url: {
9004
9036
  type: "string",
9005
- description: "The URL to audit. Required — never points at a user tab implicitly."
9037
+ description: "URL value."
9006
9038
  },
9007
9039
  categories: {
9008
9040
  type: "array",
9009
9041
  items: {
9010
9042
  type: "string"
9011
9043
  },
9012
- description: 'Lighthouse categories to run (--only-categories). Defaults to the full set, e.g. ["performance"] or ["performance","accessibility","seo"].'
9044
+ description: "Lighthouse categories to run (--only-categories)."
9013
9045
  },
9014
9046
  savePath: {
9015
9047
  type: "string",
9016
- description: "Override the report output path; defaults to a timestamped file under /tmp/cdp-toolkit."
9048
+ description: "Output file path."
9017
9049
  },
9018
9050
  formFactor: {
9019
9051
  type: "string",
@@ -9021,11 +9053,11 @@ var MANIFEST = [
9021
9053
  "desktop",
9022
9054
  "mobile"
9023
9055
  ],
9024
- description: '"desktop" (default, uses --preset=desktop to avoid heavy mobile throttling) or "mobile".'
9056
+ description: "Lighthouse form factor."
9025
9057
  },
9026
9058
  timeoutMs: {
9027
9059
  type: "number",
9028
- description: "Overall budget for the lighthouse process, in ms. Default 120000."
9060
+ description: "Timeout in milliseconds."
9029
9061
  }
9030
9062
  },
9031
9063
  required: [
@@ -9036,21 +9068,21 @@ var MANIFEST = [
9036
9068
  },
9037
9069
  {
9038
9070
  name: "mock_request",
9039
- description: "Register a mock rule on a target's persistent fake-backend session (CDP Fetch domain): match requests by urlPattern and fulfill with a canned response, fail (abort), or continue -- optionally with fault injection (delayMs/failRate). The session survives reloads/navigations and lives until clear_mocks; call repeatedly to mock several endpoints on one target. reload:true applies it immediately. Persistent across calls only via the MCP server, not the one-shot CLI.",
9071
+ description: "Register a persistent request mock; urlPattern is required.",
9040
9072
  inputSchema: {
9041
9073
  type: "object",
9042
9074
  properties: {
9043
9075
  lease: {
9044
9076
  type: "string",
9045
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
9077
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
9046
9078
  },
9047
9079
  target: {
9048
9080
  type: "string",
9049
- description: "Which page's mock session. Defaults to the active page. Grammar: server instructions."
9081
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
9050
9082
  },
9051
9083
  urlPattern: {
9052
9084
  type: "string",
9053
- description: `CDP Fetch urlPattern glob: '*' any run of chars, '?' exactly one, '\\' escapes. Only matching URLs are paused. e.g. "*/api/users*".`
9085
+ description: "URL glob (*, ?; \\ escapes)."
9054
9086
  },
9055
9087
  action: {
9056
9088
  type: "string",
@@ -9063,39 +9095,39 @@ var MANIFEST = [
9063
9095
  },
9064
9096
  status: {
9065
9097
  type: "number",
9066
- description: "fulfill: HTTP status for the canned response. Default 200."
9098
+ description: "Mock HTTP status."
9067
9099
  },
9068
9100
  body: {
9069
9101
  type: "string",
9070
- description: "fulfill: response body string (base64-encoded for CDP internally)."
9102
+ description: "Mock response body."
9071
9103
  },
9072
9104
  contentType: {
9073
9105
  type: "string",
9074
- description: 'fulfill: Content-Type header. Default "application/json".'
9106
+ description: "Response Content-Type."
9075
9107
  },
9076
9108
  headers: {
9077
9109
  type: "object",
9078
- description: 'fulfill: extra response headers (name->value); override Content-Type case-insensitively. Add "Access-Control-Allow-Origin" for cross-origin fetches.'
9110
+ description: "Extra response headers."
9079
9111
  },
9080
9112
  errorReason: {
9081
9113
  type: "string",
9082
- description: 'fail: CDP Network.ErrorReason, e.g. "Failed" (default), "BlockedByClient", "ConnectionRefused", "TimedOut".'
9114
+ description: "CDP Network.ErrorReason, e.g. Failed|BlockedByClient|ConnectionRefused|TimedOut."
9083
9115
  },
9084
9116
  method: {
9085
9117
  type: "string",
9086
- description: 'Only mock this HTTP method (e.g. "POST"); others pass through.'
9118
+ description: "HTTP method."
9087
9119
  },
9088
9120
  delayMs: {
9089
9121
  type: "number",
9090
- description: "Fault injection: artificial latency in ms before responding."
9122
+ description: "Artificial delay in milliseconds."
9091
9123
  },
9092
9124
  failRate: {
9093
9125
  type: "number",
9094
- description: "Fault injection: probability 0..1 of failing a matched request regardless of action."
9126
+ description: "Failure probability 0..1."
9095
9127
  },
9096
9128
  reload: {
9097
9129
  type: "boolean",
9098
- description: "Reload the target after arming so the mock catches traffic immediately."
9130
+ description: "Reload before capture."
9099
9131
  }
9100
9132
  },
9101
9133
  required: [
@@ -9106,13 +9138,13 @@ var MANIFEST = [
9106
9138
  },
9107
9139
  {
9108
9140
  name: "list_mocks",
9109
- description: "List active fake-backend sessions (one per target) with their rules and hit counts. Prunes sessions whose tab has closed.",
9141
+ description: "List active request-mocking sessions and hit counts.",
9110
9142
  inputSchema: {
9111
9143
  type: "object",
9112
9144
  properties: {
9113
9145
  lease: {
9114
9146
  type: "string",
9115
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
9147
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
9116
9148
  },
9117
9149
  target: {
9118
9150
  type: "string",
@@ -9125,17 +9157,17 @@ var MANIFEST = [
9125
9157
  },
9126
9158
  {
9127
9159
  name: "clear_mocks",
9128
- description: "Tear down fake-backend sessions (Fetch.disable + close the connection). Clears the resolved target's session by default, or every active session with all:true.",
9160
+ description: "Clear the selected or all request-mocking sessions.",
9129
9161
  inputSchema: {
9130
9162
  type: "object",
9131
9163
  properties: {
9132
9164
  lease: {
9133
9165
  type: "string",
9134
- description: "Lease token from claim_page. Omit for a tab this process holds; required for a tab held by another process or one claimed explicitly. Auto-acquired under CDP_REQUIRE_LEASE (then pass target, not lease). See server instructions."
9166
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
9135
9167
  },
9136
9168
  target: {
9137
9169
  type: "string",
9138
- description: "Which page's mock session to clear. Defaults to the active page; ignored when all:true. Grammar: server instructions."
9170
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
9139
9171
  },
9140
9172
  all: {
9141
9173
  type: "boolean",
@@ -9148,29 +9180,29 @@ var MANIFEST = [
9148
9180
  },
9149
9181
  {
9150
9182
  name: "claim_page",
9151
- description: "Take exclusive ownership of a browser tab, returning an opaque lease token (needed once under CDP_REQUIRE_LEASE for any tab you drive). Two modes: FRESH TAB (no target - opens one, optionally at url, and claims it: 'give me my own tab' in one call) and TAKEOVER (target - claims an already-open tab, e.g. the human's, resolving the selector against the live page list, creating nothing). The opened flag is true only when this call created the tab, and release_page consults that record, so a taken-over tab is left open on release. Refused from the CLI (its per-call process would make the lease instantly reclaimable). The answer carries humanActiveMs, ms since input this server did not dispatch; null is NO DATA (no activity beacon, or every input was this server's own) and never means 'no human'; absent on a backend that cannot answer. On takeover of a tab a human used within 30s it adds contention, a warning - but THE CLAIM IS NEVER REFUSED FOR THIS: takeover is its purpose, you already hold the lease; it only warns you're fighting a live person, so open your own tab or ask first. Limits: input inside a cross-origin iframe is invisible, and a second MCP server's clicks read as human.",
9183
+ description: "Claim an existing tab or open a fresh one; CLI use is refused.",
9152
9184
  inputSchema: {
9153
9185
  type: "object",
9154
9186
  properties: {
9155
9187
  target: {
9156
9188
  type: "string",
9157
- description: "Take over an already-open tab (e.g. one the human has open). Resolved against the LIVE page list only, so it never opens a tab — a selector matching nothing is an error. Left open on release. Refused if another live process holds it (including a lease auto-acquired under CDP_REQUIRE_LEASE): takes over unleased human tabs, never steals from a live agent. Mutually exclusive with targetId. Selector grammar: server instructions."
9189
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
9158
9190
  },
9159
9191
  targetId: {
9160
9192
  type: "string",
9161
- description: "Exact target id (not a selector) of an already-open page to claim instead of opening one. Back-compat only; prefer target, which also accepts an exact id. Mutually exclusive with target."
9193
+ description: "Exact target ID."
9162
9194
  },
9163
9195
  url: {
9164
9196
  type: "string",
9165
- description: "When opening a fresh tab, navigate it here. Ignored when target or targetId is given."
9197
+ description: "URL value."
9166
9198
  },
9167
9199
  label: {
9168
9200
  type: "string",
9169
- description: "Agent label recorded on the lease; surfaced in conflict errors and list_leases. Defaults to pid-<pid>."
9201
+ description: "Agent lease label."
9170
9202
  },
9171
9203
  ttlMs: {
9172
9204
  type: "number",
9173
- description: "How long the lease survives without use before it is reclaimable. Defaults to CDP_LEASE_TTL_MS, else 900000 (15min); every checked call refreshes it."
9205
+ description: "Lease TTL in milliseconds."
9174
9206
  }
9175
9207
  },
9176
9208
  required: [],
@@ -9179,21 +9211,21 @@ var MANIFEST = [
9179
9211
  },
9180
9212
  {
9181
9213
  name: "release_page",
9182
- description: "Give a lease back, closing the tab only if this toolkit opened it. Take exactly one of lease (the token) or target (a selector for a tab this process holds - use this to release a lease the gate acquired for you automatically, since that path never handed you a token). A tab with a creation record from this toolkit is closed; a tab that was already open and merely claimed is released and left alone - override either way with close. Idempotent: an already-released, reclaimed, or expired lease reports released:false and closes nothing (by then the tab may belong to another agent). Answers {released, closed, targetId}.",
9214
+ description: "Release a page lease and optionally close its tab; provide lease or target.",
9183
9215
  inputSchema: {
9184
9216
  type: "object",
9185
9217
  properties: {
9186
9218
  lease: {
9187
9219
  type: "string",
9188
- description: "Token from claim_page / new_page{claim:true}. Mutually exclusive with 'target'. Under CDP_REQUIRE_LEASE an auto-acquired lease never produced a token — give 'target' instead."
9220
+ description: "Lease token; omit for a tab this process already holds. See server instructions."
9189
9221
  },
9190
9222
  target: {
9191
9223
  type: "string",
9192
- description: "A tab THIS process holds (grammar: server instructions). Mutually exclusive with 'lease'. Refused if another process holds the tab."
9224
+ description: "Page selector (index:/url:/title:/label:/targetId, default active); grammar in server instructions."
9193
9225
  },
9194
9226
  close: {
9195
9227
  type: "boolean",
9196
- description: "Force the close decision instead of letting the creation record decide: true closes even a tab this toolkit did not open; false keeps an agent-created tab open. Omit to close only tabs this toolkit created."
9228
+ description: "Override close behavior."
9197
9229
  }
9198
9230
  },
9199
9231
  required: [],
@@ -9202,7 +9234,7 @@ var MANIFEST = [
9202
9234
  },
9203
9235
  {
9204
9236
  name: "list_leases",
9205
- description: "Enumerate every active lease for diagnosis - backend, target id, label, pid, createdAt, lastUsedAt, ttlMs, whether the owning process is alive, and whether the lease is reclaimable and why. No token required; it never returns the lease nonce, so it cannot be used to forge one. An unreadable or unparseable lease row instead carries unreadable, with label, pid and timestamps zeroed and stale forced false (an unreadable lease must never read as free to take). Under CDP_REQUIRE_LEASE it reaps abandoned agent tabs exactly as list_pages does, into an additive reaped array, omitting their rows. Where the tab can answer, a row also carries humanActiveMs, ms since input this server did not dispatch - note lastUsedAt tracks TOOLKIT calls only, so a tab a person has typed in for ten minutes looks idle, which is what this exposes; the field is absent, never null, when the tab cannot answer, and that absence means 'no answer', never 'nobody is there'. idleMs (now - lastUsedAt) and expiresAt (lastUsedAt + ttlMs) are computed fresh each call and omitted on an unreadable row.",
9237
+ description: "List active leases for diagnosis without exposing lease tokens.",
9206
9238
  inputSchema: {
9207
9239
  type: "object",
9208
9240
  properties: {},