replicas-cli 0.3.217 → 0.3.218

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.
Files changed (2) hide show
  1. package/dist/index.cjs +4 -4
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -19900,7 +19900,7 @@ var init_visuals = __esm({
19900
19900
  VISUAL_COLUMN_WIDTH = 760;
19901
19901
  VISUAL_PHONE_WIDTH = 390;
19902
19902
  VISUAL_MIN_HEIGHT = 24;
19903
- VISUAL_MAX_HEIGHT = 4e3;
19903
+ VISUAL_MAX_HEIGHT = 2e4;
19904
19904
  VISUAL_FONT_PATH = "/fonts/GeneralSans-Variable.woff2";
19905
19905
  FONT_SANS = '"General Sans", system-ui, -apple-system, "Segoe UI", sans-serif';
19906
19906
  FONT_MONO = '"Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace';
@@ -38371,7 +38371,7 @@ async function inspect(html, source) {
38371
38371
  const resize = (width, height) => page.send("Emulation.setDeviceMetricsOverride", { width, height, deviceScaleFactor: 1, mobile: false });
38372
38372
  const screenshot = async (appearance, width) => {
38373
38373
  await load(appearance, width, 600);
38374
- await resize(width, clampVisualHeight(await settledHeight(page)));
38374
+ await resize(width, clampVisualHeight(Math.min(MAX_SCREENSHOT_HEIGHT, await settledHeight(page))));
38375
38375
  const { data } = await page.send("Page.captureScreenshot", { format: "png" });
38376
38376
  import_fs10.default.mkdirSync(SCREENSHOT_DIR, { recursive: true });
38377
38377
  const file2 = import_path9.default.join(SCREENSHOT_DIR, `${import_path9.default.basename(source, import_path9.default.extname(source))}-${appearance}-${width}.png`);
@@ -38411,7 +38411,6 @@ function warnings(inspection) {
38411
38411
  return [
38412
38412
  ...inspection.viewportDependent ? [VIEWPORT_DEPENDENT_FIX] : [],
38413
38413
  ...inspection.overflowWidths.length > 0 ? [`Content overflows horizontally at ${inspection.overflowWidths.join("px, ")}px. Let it wrap or stack at narrow widths.`] : [],
38414
- ...inspection.heights.some(([, height]) => height > VISUAL_MAX_HEIGHT) ? [`The page is taller than ${VISUAL_MAX_HEIGHT}px at some widths, so chat cuts off the bottom. Make it shorter or split it into several visuals.`] : [],
38415
38414
  ...inspection.background ? [`The page paints its own background (${inspection.background}) on html or body. Leave them transparent so it sits on the chat background.`] : []
38416
38415
  ];
38417
38416
  }
@@ -38469,7 +38468,7 @@ Next: publish with \`replicas visualize ${file2} --title "<short title>"\`.`);
38469
38468
  console.log("\nNext: paste the ![\u2026](\u2026) line on its own line where the visual belongs in your final reply. The user sees the visual itself, so don't introduce or restate it; add only what it doesn't say. The Forge link is for posting outside Replicas chat (PRs, Slack, Linear); leave it out of your chat reply.");
38470
38469
  });
38471
38470
  }
38472
- var import_fs10, import_http3, import_path9, MIB, MAX_IMAGE_BYTES, MAX_PAGE_BYTES, LOAD_TIMEOUT_MS, SCREENSHOT_DIR, LOCAL_IMAGE, webAppUrl, VIEWPORT_DEPENDENT_FIX, consoleErrors;
38471
+ var import_fs10, import_http3, import_path9, MIB, MAX_IMAGE_BYTES, MAX_PAGE_BYTES, LOAD_TIMEOUT_MS, MAX_SCREENSHOT_HEIGHT, SCREENSHOT_DIR, LOCAL_IMAGE, webAppUrl, VIEWPORT_DEPENDENT_FIX, consoleErrors;
38473
38472
  var init_visualize = __esm({
38474
38473
  "src/commands/visualize.ts"() {
38475
38474
  "use strict";
@@ -38488,6 +38487,7 @@ var init_visualize = __esm({
38488
38487
  MAX_IMAGE_BYTES = 10 * MIB;
38489
38488
  MAX_PAGE_BYTES = 25 * MIB;
38490
38489
  LOAD_TIMEOUT_MS = 1e4;
38490
+ MAX_SCREENSHOT_HEIGHT = 4e3;
38491
38491
  SCREENSHOT_DIR = "/tmp/replicas-visualize";
38492
38492
  LOCAL_IMAGE = /(["'`])(\/(?!\/)[^"'`\r\n]*?\.(?:png|jpe?g|gif|webp|avif|svg))\1|url\(\s*(\/(?!\/)[^\s"'`()]*?\.(?:png|jpe?g|gif|webp|avif|svg))\s*\)/gi;
38493
38493
  webAppUrl = () => process.env.REPLICAS_WEB_URL || DEFAULT_WEB_APP_URL;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "replicas-cli",
3
- "version": "0.3.217",
3
+ "version": "0.3.218",
4
4
  "description": "CLI for managing Replicas workspaces - SSH into cloud dev environments with automatic port forwarding",
5
5
  "main": "dist/index.cjs",
6
6
  "bin": {