@poncho-ai/browser 0.6.21 → 0.6.23

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.
@@ -1,5 +1,5 @@
1
1
 
2
- > @poncho-ai/browser@0.6.21 build /home/runner/work/poncho-ai/poncho-ai/packages/browser
2
+ > @poncho-ai/browser@0.6.23 build /home/runner/work/poncho-ai/poncho-ai/packages/browser
3
3
  > tsup src/index.ts --format esm --dts
4
4
 
5
5
  CLI Building entry: src/index.ts
@@ -7,8 +7,8 @@
7
7
  CLI tsup v8.5.1
8
8
  CLI Target: es2022
9
9
  ESM Build start
10
- ESM dist/index.js 46.07 KB
11
- ESM ⚡️ Build success in 67ms
10
+ ESM dist/index.js 46.85 KB
11
+ ESM ⚡️ Build success in 85ms
12
12
  DTS Build start
13
- DTS ⚡️ Build success in 5074ms
13
+ DTS ⚡️ Build success in 5359ms
14
14
  DTS dist/index.d.ts 13.69 KB
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @poncho-ai/browser
2
2
 
3
+ ## 0.6.23
4
+
5
+ ### Patch Changes
6
+
7
+ - [`2d518d1`](https://github.com/cesr/poncho-ai/commit/2d518d1666e69d63a94be8a781d11d0569e6af7b) Thanks [@cesr](https://github.com/cesr)! - Force the configured viewport on remote browsers (cloud provider / cdpUrl).
8
+ `launchOpts.viewport` is only honored when launching a local context, so a
9
+ Browserbase/Kernel/CDP session rendered at the provider's large default — the
10
+ page looked huge, content tiny, scrolling appeared broken, and tap coordinates
11
+ mismatched the frame after reconnect. After connecting, call
12
+ `setViewport(width, height)` so the page renders at the intended size and frames
13
+ - input stay consistent.
14
+
15
+ ## 0.6.22
16
+
17
+ ### Patch Changes
18
+
19
+ - [`3588b19`](https://github.com/cesr/poncho-ai/commit/3588b19cf8e8fb112df3642b93e8a6aa4d4e3021) Thanks [@cesr](https://github.com/cesr)! - Steer the agent to use `browser_open` only as a last resort. The description now
20
+ tells it to prefer `web_fetch` for reading pages and a dedicated API/MCP
21
+ integration when one exists, and to reach for the browser only when those can't
22
+ do the job — a page web_fetch can't render, or operating a site/web app that has
23
+ no API and no MCP (e.g. logging in and clicking through a UI). Reinforces that
24
+ credentials are entered by the user in the live view, never asked for in chat.
25
+
3
26
  ## 0.6.21
4
27
 
5
28
  ### Patch Changes
package/dist/index.js CHANGED
@@ -427,6 +427,13 @@ var BrowserSession = class {
427
427
  launchOpts.args = baseArgs;
428
428
  }
429
429
  await mgr.launch(launchOpts);
430
+ if (this.isRemote) {
431
+ try {
432
+ await mgr.setViewport(viewport.width ?? 1280, viewport.height ?? 720);
433
+ } catch (e) {
434
+ console.warn(`[poncho][browser] setViewport failed: ${e?.message ?? e}`);
435
+ }
436
+ }
430
437
  this._contextStealthInstalled = false;
431
438
  this._uaOverrideApplied.clear();
432
439
  if (this.stealthEnabled) {
@@ -1079,7 +1086,7 @@ function createBrowserTools(getSession) {
1079
1086
  return [
1080
1087
  {
1081
1088
  name: "browser_open",
1082
- description: "Open a URL in a headless browser. Returns the page title. Use this to navigate to websites and web applications. To open files from the virtual filesystem, use /api/vfs/{path} (e.g. /api/vfs/downloads/report.pdf).",
1089
+ description: "Open a URL in a real browser whose live view the user can watch and interact with. Returns the page title. This is a HEAVY, last-resort tool \u2014 prefer cheaper options first: use `web_fetch` to read page content, and use a dedicated API or MCP integration when one exists for the service. Only reach for the browser when those can't do the job: a page `web_fetch` can't render (JS-heavy/SPA), or a task that requires operating a site or web app that has no API and no MCP integration (e.g. logging in and clicking through a UI). When a site needs credentials, navigate to its login page and let the user sign in directly in the live view \u2014 never ask for passwords in chat. To open files from the virtual filesystem, use /api/vfs/{path} (e.g. /api/vfs/downloads/report.pdf).",
1083
1090
  inputSchema: {
1084
1091
  type: "object",
1085
1092
  properties: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@poncho-ai/browser",
3
- "version": "0.6.21",
3
+ "version": "0.6.23",
4
4
  "description": "Browser automation for Poncho agents, powered by agent-browser",
5
5
  "repository": {
6
6
  "type": "git",
package/src/session.ts CHANGED
@@ -365,6 +365,18 @@ export class BrowserSession {
365
365
 
366
366
  await mgr.launch(launchOpts as Parameters<BrowserManagerInstance["launch"]>[0]);
367
367
 
368
+ // Remote browsers (cloud provider / cdpUrl) ignore launchOpts.viewport —
369
+ // that's only applied when launching a local context — so the page renders
370
+ // at the provider's (often huge) default and the screencast shows it shrunk.
371
+ // Force our configured viewport on the connected page.
372
+ if (this.isRemote) {
373
+ try {
374
+ await mgr.setViewport(viewport.width ?? 1280, viewport.height ?? 720);
375
+ } catch (e) {
376
+ console.warn(`[poncho][browser] setViewport failed: ${(e as Error)?.message ?? e}`);
377
+ }
378
+ }
379
+
368
380
  // Reset stealth tracking for fresh browser
369
381
  this._contextStealthInstalled = false;
370
382
  this._uaOverrideApplied.clear();
package/src/tools.ts CHANGED
@@ -10,7 +10,10 @@ export function createBrowserTools(
10
10
  {
11
11
  name: "browser_open",
12
12
  description:
13
- "Open a URL in a headless browser. Returns the page title. Use this to navigate to websites and web applications. " +
13
+ "Open a URL in a real browser whose live view the user can watch and interact with. Returns the page title. " +
14
+ "This is a HEAVY, last-resort tool — prefer cheaper options first: use `web_fetch` to read page content, and use a dedicated API or MCP integration when one exists for the service. " +
15
+ "Only reach for the browser when those can't do the job: a page `web_fetch` can't render (JS-heavy/SPA), or a task that requires operating a site or web app that has no API and no MCP integration (e.g. logging in and clicking through a UI). " +
16
+ "When a site needs credentials, navigate to its login page and let the user sign in directly in the live view — never ask for passwords in chat. " +
14
17
  "To open files from the virtual filesystem, use /api/vfs/{path} (e.g. /api/vfs/downloads/report.pdf).",
15
18
  inputSchema: {
16
19
  type: "object",