viyv-browser-mcp 0.5.9 → 0.6.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/index.js CHANGED
@@ -54,8 +54,8 @@ var LIMITS = {
54
54
  EVENT_BUFFER_MAX_BYTES: 10 * 1024 * 1024,
55
55
  /** Message buffer during disconnection */
56
56
  MESSAGE_BUFFER_MAX: 1e3,
57
- /** Default screenshot JPEG quality */
58
- SCREENSHOT_JPEG_QUALITY: 80,
57
+ /** Default screenshot quality (WebP/JPEG) */
58
+ SCREENSHOT_DEFAULT_QUALITY: 70,
59
59
  /** Console buffer per tab */
60
60
  CONSOLE_BUFFER_MAX: 1e3,
61
61
  /** Network buffer per tab */
@@ -1084,7 +1084,7 @@ Returns elements with ref IDs that can be used with click, form_input, etc.`;
1084
1084
  var SCREENSHOT_DESCRIPTION = `Take a screenshot of a tab.
1085
1085
 
1086
1086
  Returns image as an MCP ImageContent block, plus metadata (imageId) as text.
1087
- Default format is JPEG with quality 80.
1087
+ Default format is WebP with quality 70 (smaller than JPEG with equivalent visual quality).
1088
1088
 
1089
1089
  IMPORTANT - Token-efficient alternatives (prefer these when possible):
1090
1090
  - read_page: Get accessibility tree with element text, values, and states
@@ -1933,8 +1933,8 @@ var screenshotTool = {
1933
1933
  description: SCREENSHOT_DESCRIPTION,
1934
1934
  inputSchema: z.object({
1935
1935
  tabId: z.coerce.number().describe("Tab ID to capture"),
1936
- format: z.enum(["jpeg", "png"]).optional().describe("Image format (default: jpeg)"),
1937
- quality: z.coerce.number().min(1).max(100).optional().describe("JPEG quality (default: 80)"),
1936
+ format: z.enum(["jpeg", "png", "webp"]).optional().describe("Image format (default: webp)"),
1937
+ quality: z.coerce.number().min(1).max(100).optional().describe("Image quality for jpeg/webp (default: 70)"),
1938
1938
  region: z.tuple([z.coerce.number(), z.coerce.number(), z.coerce.number(), z.coerce.number()]).optional().describe("Capture region [x0, y0, x1, y1]"),
1939
1939
  ref: z.string().optional().describe(
1940
1940
  "Element reference ID from read_page or find. Captures only that element with padding. Ignored if region is also provided."
@@ -3748,7 +3748,7 @@ async function callExtensionTool(tool, input) {
3748
3748
  const pauseNote = formatDialogPaused(result);
3749
3749
  if (tool === "screenshot" && typeof result.data === "string") {
3750
3750
  const { data, ...metadata } = result;
3751
- const mimeType = metadata.format === "png" ? "image/png" : "image/jpeg";
3751
+ const mimeType = metadata.format === "png" ? "image/png" : metadata.format === "webp" ? "image/webp" : "image/jpeg";
3752
3752
  const content = [
3753
3753
  { type: "image", data, mimeType },
3754
3754
  { type: "text", text: JSON.stringify(metadata) }