@browserbasehq/orca 3.7.1-preview.0 → 3.7.2-preview.1

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 (83) hide show
  1. package/dist/cjs/lib/v3/agent/tools/click.js +16 -5
  2. package/dist/cjs/lib/v3/agent/tools/click.js.map +1 -1
  3. package/dist/cjs/lib/v3/agent/tools/clickAndHold.js +1 -1
  4. package/dist/cjs/lib/v3/agent/tools/clickAndHold.js.map +1 -1
  5. package/dist/cjs/lib/v3/agent/tools/dragAndDrop.js +2 -2
  6. package/dist/cjs/lib/v3/agent/tools/dragAndDrop.js.map +1 -1
  7. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js +18 -7
  8. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js.map +1 -1
  9. package/dist/cjs/lib/v3/agent/tools/scroll.js +1 -1
  10. package/dist/cjs/lib/v3/agent/tools/scroll.js.map +1 -1
  11. package/dist/cjs/lib/v3/agent/tools/type.js +13 -4
  12. package/dist/cjs/lib/v3/agent/tools/type.js.map +1 -1
  13. package/dist/cjs/lib/v3/agent/utils/coordinateNormalization.d.ts +5 -2
  14. package/dist/cjs/lib/v3/agent/utils/coordinateNormalization.js +5 -7
  15. package/dist/cjs/lib/v3/agent/utils/coordinateNormalization.js.map +1 -1
  16. package/dist/cjs/lib/v3/api.d.ts +1 -1
  17. package/dist/cjs/lib/v3/api.js +2 -1
  18. package/dist/cjs/lib/v3/api.js.map +1 -1
  19. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js +20 -0
  20. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -1
  21. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +34 -20
  22. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  23. package/dist/cjs/lib/v3/llm/aisdk.js +3 -3
  24. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
  25. package/dist/cjs/lib/v3/types/public/api.d.ts +53 -0
  26. package/dist/cjs/lib/v3/types/public/api.js +8 -0
  27. package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
  28. package/dist/cjs/lib/v3/types/public/options.d.ts +13 -0
  29. package/dist/cjs/lib/v3/types/public/options.js.map +1 -1
  30. package/dist/cjs/lib/v3/understudy/locator.d.ts +12 -0
  31. package/dist/cjs/lib/v3/understudy/locator.js +44 -0
  32. package/dist/cjs/lib/v3/understudy/locator.js.map +1 -1
  33. package/dist/cjs/lib/v3/understudy/page.d.ts +15 -0
  34. package/dist/cjs/lib/v3/understudy/page.js +50 -0
  35. package/dist/cjs/lib/v3/understudy/page.js.map +1 -1
  36. package/dist/cjs/lib/v3/v3.d.ts +14 -0
  37. package/dist/cjs/lib/v3/v3.js +39 -13
  38. package/dist/cjs/lib/v3/v3.js.map +1 -1
  39. package/dist/cjs/lib/version.d.ts +1 -1
  40. package/dist/cjs/lib/version.js +1 -1
  41. package/dist/cjs/lib/version.js.map +1 -1
  42. package/dist/esm/lib/v3/agent/tools/click.js +16 -5
  43. package/dist/esm/lib/v3/agent/tools/click.js.map +1 -1
  44. package/dist/esm/lib/v3/agent/tools/clickAndHold.js +1 -1
  45. package/dist/esm/lib/v3/agent/tools/clickAndHold.js.map +1 -1
  46. package/dist/esm/lib/v3/agent/tools/dragAndDrop.js +2 -2
  47. package/dist/esm/lib/v3/agent/tools/dragAndDrop.js.map +1 -1
  48. package/dist/esm/lib/v3/agent/tools/fillFormVision.js +19 -8
  49. package/dist/esm/lib/v3/agent/tools/fillFormVision.js.map +1 -1
  50. package/dist/esm/lib/v3/agent/tools/scroll.js +1 -1
  51. package/dist/esm/lib/v3/agent/tools/scroll.js.map +1 -1
  52. package/dist/esm/lib/v3/agent/tools/type.js +13 -4
  53. package/dist/esm/lib/v3/agent/tools/type.js.map +1 -1
  54. package/dist/esm/lib/v3/agent/utils/coordinateNormalization.d.ts +5 -2
  55. package/dist/esm/lib/v3/agent/utils/coordinateNormalization.js +5 -7
  56. package/dist/esm/lib/v3/agent/utils/coordinateNormalization.js.map +1 -1
  57. package/dist/esm/lib/v3/api.d.ts +1 -1
  58. package/dist/esm/lib/v3/api.js +2 -1
  59. package/dist/esm/lib/v3/api.js.map +1 -1
  60. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js +20 -0
  61. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -1
  62. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +34 -20
  63. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  64. package/dist/esm/lib/v3/llm/aisdk.js +3 -3
  65. package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
  66. package/dist/esm/lib/v3/types/public/api.d.ts +53 -0
  67. package/dist/esm/lib/v3/types/public/api.js +8 -0
  68. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  69. package/dist/esm/lib/v3/types/public/options.d.ts +13 -0
  70. package/dist/esm/lib/v3/types/public/options.js.map +1 -1
  71. package/dist/esm/lib/v3/understudy/locator.d.ts +12 -0
  72. package/dist/esm/lib/v3/understudy/locator.js +44 -0
  73. package/dist/esm/lib/v3/understudy/locator.js.map +1 -1
  74. package/dist/esm/lib/v3/understudy/page.d.ts +15 -0
  75. package/dist/esm/lib/v3/understudy/page.js +50 -0
  76. package/dist/esm/lib/v3/understudy/page.js.map +1 -1
  77. package/dist/esm/lib/v3/v3.d.ts +14 -0
  78. package/dist/esm/lib/v3/v3.js +39 -13
  79. package/dist/esm/lib/v3/v3.js.map +1 -1
  80. package/dist/esm/lib/version.d.ts +1 -1
  81. package/dist/esm/lib/version.js +1 -1
  82. package/dist/esm/lib/version.js.map +1 -1
  83. package/package.json +1 -1
@@ -73,6 +73,14 @@ export declare class V3 {
73
73
  * @deprecated Use `isVerified` instead. This alias will be removed in a future version.
74
74
  */
75
75
  get isAdvancedStealth(): boolean;
76
+ /**
77
+ * Whether coordinate pointer actions should actuate as touch instead of mouse.
78
+ *
79
+ * Explicit opt-in via the `useTouch` option — no session-derived or probed
80
+ * detection, so the answer is known before the first action, is stable for the
81
+ * whole run, and never surprises a caller who didn't ask for touch.
82
+ */
83
+ get usesTouch(): boolean;
76
84
  /**
77
85
  * Returns the configured viewport dimensions from launch options.
78
86
  * Falls back to default 1288x711 if not configured.
@@ -81,6 +89,12 @@ export declare class V3 {
81
89
  width: number;
82
90
  height: number;
83
91
  };
92
+ get hasConfiguredViewport(): boolean;
93
+ private rawConfiguredViewport;
94
+ resolveViewport(): Promise<{
95
+ width: number;
96
+ height: number;
97
+ }>;
84
98
  private _onCdpClosed;
85
99
  readonly experimental: boolean;
86
100
  readonly logInferenceToFile: boolean;
@@ -231,27 +231,52 @@ let V3 = (() => {
231
231
  get isAdvancedStealth() {
232
232
  return this.isVerified;
233
233
  }
234
+ /**
235
+ * Whether coordinate pointer actions should actuate as touch instead of mouse.
236
+ *
237
+ * Explicit opt-in via the `useTouch` option — no session-derived or probed
238
+ * detection, so the answer is known before the first action, is stable for the
239
+ * whole run, and never surprises a caller who didn't ask for touch.
240
+ */
241
+ get usesTouch() {
242
+ return this.opts.useTouch === true;
243
+ }
234
244
  /**
235
245
  * Returns the configured viewport dimensions from launch options.
236
246
  * Falls back to default 1288x711 if not configured.
237
247
  */
238
248
  get configuredViewport() {
239
- const defaultWidth = 1288;
240
- const defaultHeight = 711;
241
- if (this.opts.env === "BROWSERBASE") {
242
- const vp = this.opts.browserbaseSessionCreateParams?.browserSettings?.viewport;
243
- return {
244
- width: vp?.width ?? defaultWidth,
245
- height: vp?.height ?? defaultHeight,
246
- };
247
- }
248
- // LOCAL env
249
- const vp = this.opts.localBrowserLaunchOptions?.viewport;
249
+ const viewport = this.rawConfiguredViewport();
250
250
  return {
251
- width: vp?.width ?? defaultWidth,
252
- height: vp?.height ?? defaultHeight,
251
+ width: viewport?.width ?? 1288,
252
+ height: viewport?.height ?? 711,
253
253
  };
254
254
  }
255
+ get hasConfiguredViewport() {
256
+ return this.rawConfiguredViewport() !== undefined;
257
+ }
258
+ rawConfiguredViewport() {
259
+ if (this.opts.env === "BROWSERBASE") {
260
+ return this.opts.browserbaseSessionCreateParams?.browserSettings
261
+ ?.viewport;
262
+ }
263
+ return this.opts.localBrowserLaunchOptions?.viewport;
264
+ }
265
+ async resolveViewport() {
266
+ const configured = this.rawConfiguredViewport();
267
+ if (configured)
268
+ return this.configuredViewport;
269
+ try {
270
+ const page = await this.context.awaitActivePage();
271
+ const { width, height } = await page.mainFrame().evaluate("({ width: window.innerWidth, height: window.innerHeight })");
272
+ if (width && height)
273
+ return { width, height };
274
+ }
275
+ catch {
276
+ //
277
+ }
278
+ return this.configuredViewport;
279
+ }
255
280
  _onCdpClosed = (why) => {
256
281
  if (this.state.kind === "BROWSERBASE") {
257
282
  void this._logBrowserbaseSessionStatus();
@@ -899,6 +924,7 @@ let V3 = (() => {
899
924
  verbose: this.verbose,
900
925
  systemPrompt: this.opts.systemPrompt,
901
926
  selfHeal: this.opts.selfHeal,
927
+ useTouch: this.opts.useTouch,
902
928
  browserbaseSessionCreateParams: createSessionPayload,
903
929
  browserbaseSessionID: this.opts.browserbaseSessionID,
904
930
  });