@mindstudio-ai/remy 0.1.231 → 0.1.232

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/headless.js CHANGED
@@ -2882,6 +2882,19 @@ ${partial}` : "[INTERRUPTED] Tool execution was stopped.";
2882
2882
  }
2883
2883
  };
2884
2884
 
2885
+ // src/toolResultCap.ts
2886
+ var MAX_TOOL_RESULT_BYTES = 256 * 1024;
2887
+ function capToolResult(result) {
2888
+ const total = Buffer.byteLength(result, "utf-8");
2889
+ if (total <= MAX_TOOL_RESULT_BYTES) {
2890
+ return result;
2891
+ }
2892
+ const head = Buffer.from(result, "utf-8").subarray(0, MAX_TOOL_RESULT_BYTES).toString("utf-8");
2893
+ return head + `
2894
+
2895
+ (tool result truncated at ${(MAX_TOOL_RESULT_BYTES / 1024).toFixed(0)}KB of ${(total / 1024).toFixed(0)}KB \u2014 too large to keep in context. Narrow the call (select fewer fields, paginate, or query a subset) instead of fetching everything.)`;
2896
+ }
2897
+
2885
2898
  // src/statusWatcher.ts
2886
2899
  function startStatusWatcher(config) {
2887
2900
  const { apiConfig, getContext, onStatus, interval = 5e3, signal } = config;
@@ -3407,7 +3420,7 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
3407
3420
  subAgentMessages
3408
3421
  );
3409
3422
  }
3410
- safeSettle(result, result.startsWith("Error"));
3423
+ safeSettle(capToolResult(result), result.startsWith("Error"));
3411
3424
  } catch (err) {
3412
3425
  safeSettle(`Error: ${err.message}`, true);
3413
3426
  }
@@ -3595,9 +3608,10 @@ var BROWSER_TOOLS = [
3595
3608
  "evaluate",
3596
3609
  "styles",
3597
3610
  "screenshotFullPage",
3598
- "screenshotViewport"
3611
+ "screenshotViewport",
3612
+ "setViewport"
3599
3613
  ],
3600
- description: "snapshot: accessibility tree of the page (waits for network to settle). click: click an element (animated cursor, full event sequence). type: type text into input (one char at a time, works with React/Vue/Svelte). select: select a dropdown option by text. wait: wait for an element to appear (polls 100ms, waits for network). navigate: navigate to a URL within the app (waits for load, subsequent steps run on new page). evaluate: run JS in the page. styles: read computed CSS styles from elements (pass properties array with camelCase names, or omit for defaults). screenshotFullPage: full-page viewport-stitched screenshot (returns CDN url with dimensions). screenshotViewport: screenshot of just the visible viewport \u2014 pass `scrollToSelector` (or `scrollY`) on this step to scroll a section into view and capture it in one atomic step (no separate scroll needed)."
3614
+ description: 'snapshot: accessibility tree of the page (waits for network to settle). click: click an element (animated cursor, full event sequence). type: type text into input (one char at a time, works with React/Vue/Svelte). select: select a dropdown option by text. wait: wait for an element to appear (polls 100ms, waits for network). navigate: navigate to a URL within the app (waits for load, subsequent steps run on new page). evaluate: run JS in the page. styles: read computed CSS styles from elements (pass properties array with camelCase names, or omit for defaults). screenshotFullPage: full-page viewport-stitched screenshot (returns CDN url with dimensions). screenshotViewport: screenshot of just the visible viewport \u2014 pass `scrollToSelector` (or `scrollY`) on this step to scroll a section into view and capture it in one atomic step (no separate scroll needed). setViewport: switch the browser between desktop and mobile rendering (pass `mode`: "desktop" or "mobile"). Reloads the page so responsive layouts, media queries, and matchMedia re-evaluate \u2014 use it to QA mobile/responsive views.'
3601
3615
  },
3602
3616
  ref: {
3603
3617
  type: "string",
@@ -3651,6 +3665,11 @@ var BROWSER_TOOLS = [
3651
3665
  scrollY: {
3652
3666
  type: "number",
3653
3667
  description: "For screenshotViewport: absolute Y offset to scroll to before the shot, when no selector is available."
3668
+ },
3669
+ mode: {
3670
+ type: "string",
3671
+ enum: ["desktop", "mobile"],
3672
+ description: 'For setViewport: the rendering mode to switch to. "mobile" emulates a phone (narrow width, touch, device pixel ratio); "desktop" is the standard wide viewport.'
3654
3673
  }
3655
3674
  },
3656
3675
  required: ["command"]
@@ -3700,6 +3719,14 @@ var log7 = createLogger("browser-automation");
3700
3719
  async function runBrowserAutomation(task, context, opts) {
3701
3720
  const release = await acquireBrowserLock();
3702
3721
  try {
3722
+ try {
3723
+ await sidecarRequest(
3724
+ "/set-viewport",
3725
+ { mode: "default" },
3726
+ { timeout: 2e4 }
3727
+ );
3728
+ } catch {
3729
+ }
3703
3730
  let lastBrowserCommandViewport;
3704
3731
  const result = await runSubAgent({
3705
3732
  system: getBrowserAutomationPrompt(),
@@ -6401,21 +6428,6 @@ function triggerBrandExtraction(apiConfig, model) {
6401
6428
  // src/session.ts
6402
6429
  import fs22 from "fs";
6403
6430
  import path11 from "path";
6404
-
6405
- // src/toolResultCap.ts
6406
- var MAX_TOOL_RESULT_BYTES = 256 * 1024;
6407
- function capToolResult(result) {
6408
- const total = Buffer.byteLength(result, "utf-8");
6409
- if (total <= MAX_TOOL_RESULT_BYTES) {
6410
- return result;
6411
- }
6412
- const head = Buffer.from(result, "utf-8").subarray(0, MAX_TOOL_RESULT_BYTES).toString("utf-8");
6413
- return head + `
6414
-
6415
- (tool result truncated at ${(MAX_TOOL_RESULT_BYTES / 1024).toFixed(0)}KB of ${(total / 1024).toFixed(0)}KB \u2014 too large to keep in context. Narrow the call (select fewer fields, paginate, or query a subset) instead of fetching everything.)`;
6416
- }
6417
-
6418
- // src/session.ts
6419
6431
  var log12 = createLogger("session");
6420
6432
  var SESSION_FILE = ".remy-session.json";
6421
6433
  var ARCHIVE_DIR = ".logs/sessions";
package/dist/index.js CHANGED
@@ -3513,6 +3513,25 @@ ${partial}` : "[INTERRUPTED] Tool execution was stopped.";
3513
3513
  }
3514
3514
  });
3515
3515
 
3516
+ // src/toolResultCap.ts
3517
+ function capToolResult(result) {
3518
+ const total = Buffer.byteLength(result, "utf-8");
3519
+ if (total <= MAX_TOOL_RESULT_BYTES) {
3520
+ return result;
3521
+ }
3522
+ const head = Buffer.from(result, "utf-8").subarray(0, MAX_TOOL_RESULT_BYTES).toString("utf-8");
3523
+ return head + `
3524
+
3525
+ (tool result truncated at ${(MAX_TOOL_RESULT_BYTES / 1024).toFixed(0)}KB of ${(total / 1024).toFixed(0)}KB \u2014 too large to keep in context. Narrow the call (select fewer fields, paginate, or query a subset) instead of fetching everything.)`;
3526
+ }
3527
+ var MAX_TOOL_RESULT_BYTES;
3528
+ var init_toolResultCap = __esm({
3529
+ "src/toolResultCap.ts"() {
3530
+ "use strict";
3531
+ MAX_TOOL_RESULT_BYTES = 256 * 1024;
3532
+ }
3533
+ });
3534
+
3516
3535
  // src/statusWatcher.ts
3517
3536
  function startStatusWatcher(config) {
3518
3537
  const { apiConfig, getContext, onStatus, interval = 5e3, signal } = config;
@@ -4053,7 +4072,7 @@ ${partial}` : "[INTERRUPTED] Agent was interrupted before producing output.",
4053
4072
  subAgentMessages
4054
4073
  );
4055
4074
  }
4056
- safeSettle(result, result.startsWith("Error"));
4075
+ safeSettle(capToolResult(result), result.startsWith("Error"));
4057
4076
  } catch (err) {
4058
4077
  safeSettle(`Error: ${err.message}`, true);
4059
4078
  }
@@ -4189,6 +4208,7 @@ var init_runner = __esm({
4189
4208
  init_logger();
4190
4209
  init_usageLedger();
4191
4210
  init_toolRegistry();
4211
+ init_toolResultCap();
4192
4212
  init_statusWatcher();
4193
4213
  init_cleanMessages();
4194
4214
  log7 = createLogger("sub-agent");
@@ -4258,9 +4278,10 @@ var init_tools = __esm({
4258
4278
  "evaluate",
4259
4279
  "styles",
4260
4280
  "screenshotFullPage",
4261
- "screenshotViewport"
4281
+ "screenshotViewport",
4282
+ "setViewport"
4262
4283
  ],
4263
- description: "snapshot: accessibility tree of the page (waits for network to settle). click: click an element (animated cursor, full event sequence). type: type text into input (one char at a time, works with React/Vue/Svelte). select: select a dropdown option by text. wait: wait for an element to appear (polls 100ms, waits for network). navigate: navigate to a URL within the app (waits for load, subsequent steps run on new page). evaluate: run JS in the page. styles: read computed CSS styles from elements (pass properties array with camelCase names, or omit for defaults). screenshotFullPage: full-page viewport-stitched screenshot (returns CDN url with dimensions). screenshotViewport: screenshot of just the visible viewport \u2014 pass `scrollToSelector` (or `scrollY`) on this step to scroll a section into view and capture it in one atomic step (no separate scroll needed)."
4284
+ description: 'snapshot: accessibility tree of the page (waits for network to settle). click: click an element (animated cursor, full event sequence). type: type text into input (one char at a time, works with React/Vue/Svelte). select: select a dropdown option by text. wait: wait for an element to appear (polls 100ms, waits for network). navigate: navigate to a URL within the app (waits for load, subsequent steps run on new page). evaluate: run JS in the page. styles: read computed CSS styles from elements (pass properties array with camelCase names, or omit for defaults). screenshotFullPage: full-page viewport-stitched screenshot (returns CDN url with dimensions). screenshotViewport: screenshot of just the visible viewport \u2014 pass `scrollToSelector` (or `scrollY`) on this step to scroll a section into view and capture it in one atomic step (no separate scroll needed). setViewport: switch the browser between desktop and mobile rendering (pass `mode`: "desktop" or "mobile"). Reloads the page so responsive layouts, media queries, and matchMedia re-evaluate \u2014 use it to QA mobile/responsive views.'
4264
4285
  },
4265
4286
  ref: {
4266
4287
  type: "string",
@@ -4314,6 +4335,11 @@ var init_tools = __esm({
4314
4335
  scrollY: {
4315
4336
  type: "number",
4316
4337
  description: "For screenshotViewport: absolute Y offset to scroll to before the shot, when no selector is available."
4338
+ },
4339
+ mode: {
4340
+ type: "string",
4341
+ enum: ["desktop", "mobile"],
4342
+ description: 'For setViewport: the rendering mode to switch to. "mobile" emulates a phone (narrow width, touch, device pixel ratio); "desktop" is the standard wide viewport.'
4317
4343
  }
4318
4344
  },
4319
4345
  required: ["command"]
@@ -4371,6 +4397,14 @@ var init_prompt2 = __esm({
4371
4397
  async function runBrowserAutomation(task, context, opts) {
4372
4398
  const release = await acquireBrowserLock();
4373
4399
  try {
4400
+ try {
4401
+ await sidecarRequest(
4402
+ "/set-viewport",
4403
+ { mode: "default" },
4404
+ { timeout: 2e4 }
4405
+ );
4406
+ } catch {
4407
+ }
4374
4408
  let lastBrowserCommandViewport;
4375
4409
  const result = await runSubAgent({
4376
4410
  system: getBrowserAutomationPrompt(),
@@ -6755,25 +6789,6 @@ var init_tools7 = __esm({
6755
6789
  }
6756
6790
  });
6757
6791
 
6758
- // src/toolResultCap.ts
6759
- function capToolResult(result) {
6760
- const total = Buffer.byteLength(result, "utf-8");
6761
- if (total <= MAX_TOOL_RESULT_BYTES) {
6762
- return result;
6763
- }
6764
- const head = Buffer.from(result, "utf-8").subarray(0, MAX_TOOL_RESULT_BYTES).toString("utf-8");
6765
- return head + `
6766
-
6767
- (tool result truncated at ${(MAX_TOOL_RESULT_BYTES / 1024).toFixed(0)}KB of ${(total / 1024).toFixed(0)}KB \u2014 too large to keep in context. Narrow the call (select fewer fields, paginate, or query a subset) instead of fetching everything.)`;
6768
- }
6769
- var MAX_TOOL_RESULT_BYTES;
6770
- var init_toolResultCap = __esm({
6771
- "src/toolResultCap.ts"() {
6772
- "use strict";
6773
- MAX_TOOL_RESULT_BYTES = 256 * 1024;
6774
- }
6775
- });
6776
-
6777
6792
  // src/session.ts
6778
6793
  import fs20 from "fs";
6779
6794
  import path9 from "path";
@@ -44,6 +44,7 @@ Note: the snapshot concatenates inline text and strips whitespace. If you need t
44
44
  - `evaluate`: Run arbitrary JavaScript in the page and return the result.
45
45
  - `styles`: Read computed CSS styles from page elements. Pass a `properties` array with camelCase CSS property names (e.g., `["backgroundColor", "borderRadius", "fontSize"]`). Omit `properties` for a default set covering colors, typography, spacing, borders, shadows, dimensions, and layout. Uses the same targeting as click/type (ref, text, role, label, selector). Omit the target to get styles for all elements from the last snapshot.
46
46
  - `screenshotViewport`: Take a screenshot of the visible viewport. Returns CDN url with full text analysis and dimensions. To capture a specific section, set `scrollToSelector` (a CSS selector) — or `scrollY` (an absolute offset) — on this same step; it scrolls the target into view and captures it atomically, so you do NOT need a separate scroll step. Do not use if you can get what you need with other tools - only use when you need to visually see the viewport.
47
+ - `setViewport`: Switch the browser between desktop and mobile rendering. Set `mode` to `"desktop"` or `"mobile"`. Mobile emulates a phone (390-wide, touch, device pixel ratio 2); desktop is the standard wide viewport. This reloads the page so media queries, responsive layouts, and `matchMedia` re-evaluate — the reload clears in-page state, so switch before you set up the state you want to inspect. The mode persists across navigations within a run. Each run starts in the app's default mode, so only use this when you need to check the other one.
47
48
 
48
49
  ### Element targeting (tried in order)
49
50
 
@@ -118,6 +119,16 @@ Capture a specific below-the-fold section (scroll + capture in one atomic step):
118
119
  }
119
120
  ```
120
121
 
122
+ Check the mobile layout of a page:
123
+ ```json
124
+ {
125
+ "steps": [
126
+ { "command": "setViewport", "mode": "mobile" },
127
+ { "command": "screenshotViewport" }
128
+ ]
129
+ }
130
+ ```
131
+
121
132
  Navigate to a sub-page and interact with it:
122
133
  ```json
123
134
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mindstudio-ai/remy",
3
- "version": "0.1.231",
3
+ "version": "0.1.232",
4
4
  "description": "Remy coding agent",
5
5
  "repository": {
6
6
  "type": "git",