chrome-relay 0.5.15 → 0.5.16
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 +33 -10
- package/dist/index.js +1 -1
- package/dist/native-host.js +1 -1
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -234,6 +234,16 @@ function parseChromeHoverArgs(input) {
|
|
|
234
234
|
const target = parseTargetArgs(obj, TOOL_NAMES.HOVER);
|
|
235
235
|
const x = optNumber(obj, "x", TOOL_NAMES.HOVER);
|
|
236
236
|
const y = optNumber(obj, "y", TOOL_NAMES.HOVER);
|
|
237
|
+
if (x !== void 0 !== (y !== void 0)) {
|
|
238
|
+
throw new RelayError({
|
|
239
|
+
code: "invalid_arguments",
|
|
240
|
+
message: "chrome_hover: pass BOTH x and y, or neither (selector mode).",
|
|
241
|
+
tool: TOOL_NAMES.HOVER,
|
|
242
|
+
phase: "parse_arguments",
|
|
243
|
+
details: { received: { x: obj.x, y: obj.y } },
|
|
244
|
+
retryable: false
|
|
245
|
+
});
|
|
246
|
+
}
|
|
237
247
|
if (x !== void 0 && y !== void 0) {
|
|
238
248
|
return { ...target, kind: "coords", x, y };
|
|
239
249
|
}
|
|
@@ -831,7 +841,7 @@ var init_args = __esm({
|
|
|
831
841
|
});
|
|
832
842
|
|
|
833
843
|
// ../protocol/dist/limits.js
|
|
834
|
-
var DEFAULT_TOOL_CALL_TIMEOUT_MS, DEFAULT_PING_TIMEOUT_MS, DEFAULT_READY_TIMEOUT_MS, DEFAULT_EVAL_TIMEOUT_MS, DEFAULT_BODY_PREVIEW_BYTES, NETWORK_BUFFER_MAX_ENTRIES, NETWORK_BUFFER_MAX_BYTES, CONSOLE_BUFFER_MAX_ENTRIES, CONSOLE_BUFFER_MAX_BYTES;
|
|
844
|
+
var DEFAULT_TOOL_CALL_TIMEOUT_MS, DEFAULT_PING_TIMEOUT_MS, DEFAULT_READY_TIMEOUT_MS, DEFAULT_EVAL_TIMEOUT_MS, DEFAULT_BODY_PREVIEW_BYTES, NETWORK_BUFFER_MAX_ENTRIES, NETWORK_BUFFER_MAX_BYTES, CONSOLE_BUFFER_MAX_ENTRIES, CONSOLE_BUFFER_MAX_BYTES, CONSOLE_ENTRY_TEXT_MAX_CHARS, CONSOLE_ENTRY_STACK_MAX_CHARS;
|
|
835
845
|
var init_limits = __esm({
|
|
836
846
|
"../protocol/dist/limits.js"() {
|
|
837
847
|
"use strict";
|
|
@@ -844,6 +854,8 @@ var init_limits = __esm({
|
|
|
844
854
|
NETWORK_BUFFER_MAX_BYTES = 512 * 1024;
|
|
845
855
|
CONSOLE_BUFFER_MAX_ENTRIES = 200;
|
|
846
856
|
CONSOLE_BUFFER_MAX_BYTES = 256 * 1024;
|
|
857
|
+
CONSOLE_ENTRY_TEXT_MAX_CHARS = 1e3;
|
|
858
|
+
CONSOLE_ENTRY_STACK_MAX_CHARS = 1e3;
|
|
847
859
|
}
|
|
848
860
|
});
|
|
849
861
|
|
|
@@ -853,6 +865,8 @@ __export(dist_exports, {
|
|
|
853
865
|
CHROME_WEB_STORE_EXTENSION_ID: () => CHROME_WEB_STORE_EXTENSION_ID,
|
|
854
866
|
CONSOLE_BUFFER_MAX_BYTES: () => CONSOLE_BUFFER_MAX_BYTES,
|
|
855
867
|
CONSOLE_BUFFER_MAX_ENTRIES: () => CONSOLE_BUFFER_MAX_ENTRIES,
|
|
868
|
+
CONSOLE_ENTRY_STACK_MAX_CHARS: () => CONSOLE_ENTRY_STACK_MAX_CHARS,
|
|
869
|
+
CONSOLE_ENTRY_TEXT_MAX_CHARS: () => CONSOLE_ENTRY_TEXT_MAX_CHARS,
|
|
856
870
|
DEFAULT_BODY_PREVIEW_BYTES: () => DEFAULT_BODY_PREVIEW_BYTES,
|
|
857
871
|
DEFAULT_EVAL_TIMEOUT_MS: () => DEFAULT_EVAL_TIMEOUT_MS,
|
|
858
872
|
DEFAULT_EXTENSION_ID: () => DEFAULT_EXTENSION_ID,
|
|
@@ -1009,7 +1023,7 @@ var init_dist = __esm({
|
|
|
1009
1023
|
import { Command } from "commander";
|
|
1010
1024
|
|
|
1011
1025
|
// src/index.ts
|
|
1012
|
-
var CHROME_RELAY_VERSION = true ? "0.5.
|
|
1026
|
+
var CHROME_RELAY_VERSION = true ? "0.5.16" : "0.0.0-dev";
|
|
1013
1027
|
|
|
1014
1028
|
// src/commands/shared.ts
|
|
1015
1029
|
init_dist();
|
|
@@ -1248,6 +1262,15 @@ async function runDoctor() {
|
|
|
1248
1262
|
|
|
1249
1263
|
// src/release-notes.ts
|
|
1250
1264
|
var RELEASE_NOTES = {
|
|
1265
|
+
"0.5.16": [
|
|
1266
|
+
"chrome_hover now rejects partial-coordinate intent (`--x 10` without `--y`, or vice versa) instead of silently falling through to selector-mode and losing the half-passed coordinate. CLI forwards even partial input so the protocol parser sees it.",
|
|
1267
|
+
"Network body errors are now structured RelayError instead of plain Error. `getBody` for a request that's not in the buffer \u2192 `target_not_found`; CDP failure (Chrome GC'd the body, permission denied, etc.) \u2192 `cdp_error` with the original message under `details.underlying`. Agents can branch on the code instead of pattern-matching the message.",
|
|
1268
|
+
"Console truncation cap (1000 chars) consolidated into limits.ts as CONSOLE_ENTRY_TEXT_MAX_CHARS / CONSOLE_ENTRY_STACK_MAX_CHARS. 4 hardcoded sites in console-buffer.ts now reference the constants.",
|
|
1269
|
+
"CLI help text interpolates limits from @chrome-relay/protocol. `chrome-relay network --help` and `chrome-relay console --help` no longer hardcode '200' or '256 KB' \u2014 they read from NETWORK_BUFFER_MAX_ENTRIES / CONSOLE_BUFFER_MAX_ENTRIES / CONSOLE_BUFFER_MAX_BYTES. Future bumps propagate without manual edits.",
|
|
1270
|
+
"Removed the PER_TAB_MAX / PER_TAB_MAX_BYTES alias indirection in network-buffer.ts and console-buffer.ts. The protocol constants have good names; aliasing them was leftover from before they existed.",
|
|
1271
|
+
"Softened the over-claiming parser comments in args/index.ts and shared.ts \u2014 they correctly describe the extension as the trust boundary that runs the parsers (CLI doesn't pre-validate today; that's a documented future PR).",
|
|
1272
|
+
"Tests: +1 hover partial-coord + 2 network getBody structured-error coverage. Total 417 (was 416)."
|
|
1273
|
+
],
|
|
1251
1274
|
"0.5.15": [
|
|
1252
1275
|
"Tab-id coercion is now strict against blank strings. `--tabs '1,,3'` (or `[\"\"]`, or `[' ']`) used to silently become `[1, 0, 3]` because Number('') === 0 \u2014 and tab 0 is a real Chrome target. Now throws RelayError(invalid_arguments). Affects chrome_group create/add/remove, chrome_switch_tab, chrome_close_tabs.",
|
|
1253
1276
|
"Numeric range validation added across the parsers. `optPositiveNumber` (> 0) and `optNonNegativeNumber` (>= 0) helpers reject out-of-range values at the parser boundary instead of letting nonsense through to CDP / handler logic. Affects: chrome_evaluate timeoutMs, chrome_screenshot maxEdge + padding, chrome_screencast quality/maxWidth/maxHeight/everyNthFrame, chrome_network body head.",
|
|
@@ -1598,10 +1621,8 @@ tooltip appearance, etc.) that a bare click would skip past too quickly.
|
|
|
1598
1621
|
).action(async (selector, opts) => {
|
|
1599
1622
|
const extras = {};
|
|
1600
1623
|
if (selector) extras.selector = selector;
|
|
1601
|
-
if (typeof opts.x === "number"
|
|
1602
|
-
|
|
1603
|
-
extras.y = opts.y;
|
|
1604
|
-
}
|
|
1624
|
+
if (typeof opts.x === "number") extras.x = opts.x;
|
|
1625
|
+
if (typeof opts.y === "number") extras.y = opts.y;
|
|
1605
1626
|
await run("chrome_hover", withBase(opts, extras));
|
|
1606
1627
|
});
|
|
1607
1628
|
}
|
|
@@ -1857,6 +1878,8 @@ Notes:
|
|
|
1857
1878
|
}
|
|
1858
1879
|
|
|
1859
1880
|
// src/commands/sessions.ts
|
|
1881
|
+
init_dist();
|
|
1882
|
+
var CONSOLE_BUFFER_MAX_KB = Math.round(CONSOLE_BUFFER_MAX_BYTES / 1024);
|
|
1860
1883
|
function netFilterOpts(cmd) {
|
|
1861
1884
|
return cmd.option("--filter <substr>", "url substring filter").option("--status <bucket>", "ok | redirect | client_error | server_error | failed").option("--method <verb>", "exact method, e.g. POST").option("--limit <n>", "cap response length", (v) => Number(v));
|
|
1862
1885
|
}
|
|
@@ -1984,13 +2007,13 @@ Notes:
|
|
|
1984
2007
|
await run("chrome_group", { action: "remove", tabIds: String(opts.tabs) });
|
|
1985
2008
|
});
|
|
1986
2009
|
const network = tabOpt(netFilterOpts(
|
|
1987
|
-
program.command("network").description(
|
|
2010
|
+
program.command("network").description(`Capture HTTP request/response metadata. Ring buffer, last ${NETWORK_BUFFER_MAX_ENTRIES} per tab.`)
|
|
1988
2011
|
)).addHelpText(
|
|
1989
2012
|
"after",
|
|
1990
2013
|
`
|
|
1991
2014
|
|
|
1992
2015
|
Examples:
|
|
1993
|
-
chrome-relay network --tab 123 # last
|
|
2016
|
+
chrome-relay network --tab 123 # last ${NETWORK_BUFFER_MAX_ENTRIES} requests
|
|
1994
2017
|
chrome-relay network --tab 123 --filter api.example.com # url substring
|
|
1995
2018
|
chrome-relay network --tab 123 --status failed
|
|
1996
2019
|
chrome-relay network --tab 123 --method POST
|
|
@@ -2045,7 +2068,7 @@ Notes:
|
|
|
2045
2068
|
await run("chrome_network", withBase(opts, { action: "clear" }));
|
|
2046
2069
|
});
|
|
2047
2070
|
tabOpt(
|
|
2048
|
-
program.command("console").description(
|
|
2071
|
+
program.command("console").description(`Read console.log/warn/error + page exceptions (ring buffer, last ${CONSOLE_BUFFER_MAX_ENTRIES}).`).option("--level <levels>", "comma-separated: log,info,warn,error,debug,exception").option("--since <id>", "only return entries with id > since (live-tail-ish)", (v) => Number(v)).option("--limit <n>", "cap response length", (v) => Number(v)).option("--clear", "wipe the buffer (no read)").addHelpText(
|
|
2049
2072
|
"after",
|
|
2050
2073
|
`
|
|
2051
2074
|
|
|
@@ -2056,7 +2079,7 @@ Examples:
|
|
|
2056
2079
|
chrome-relay console --tab 123 --clear
|
|
2057
2080
|
|
|
2058
2081
|
Notes:
|
|
2059
|
-
Ring buffer holds the last
|
|
2082
|
+
Ring buffer holds the last ${CONSOLE_BUFFER_MAX_ENTRIES} entries per tab (or ${CONSOLE_BUFFER_MAX_KB} KB, whichever first).
|
|
2060
2083
|
Wipes on tab close. First call on a tab subscribes; subsequent calls are
|
|
2061
2084
|
instant in-memory reads.
|
|
2062
2085
|
`
|
package/dist/index.js
CHANGED
package/dist/native-host.js
CHANGED
|
@@ -56,7 +56,7 @@ function toBridgeError(unknownErr, fallbackTool) {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
// src/index.ts
|
|
59
|
-
var CHROME_RELAY_VERSION = true ? "0.5.
|
|
59
|
+
var CHROME_RELAY_VERSION = true ? "0.5.16" : "0.0.0-dev";
|
|
60
60
|
|
|
61
61
|
// src/release-notes.ts
|
|
62
62
|
function compareSemver(a, b) {
|