@browserbasehq/orca 3.7.0-preview.1 → 3.7.2-preview.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.
Files changed (127) hide show
  1. package/dist/cjs/lib/modelUtils.d.ts +10 -0
  2. package/dist/cjs/lib/modelUtils.js +11 -0
  3. package/dist/cjs/lib/modelUtils.js.map +1 -1
  4. package/dist/cjs/lib/v3/agent/AgentProvider.js +3 -0
  5. package/dist/cjs/lib/v3/agent/AgentProvider.js.map +1 -1
  6. package/dist/cjs/lib/v3/agent/tools/click.js +15 -4
  7. package/dist/cjs/lib/v3/agent/tools/click.js.map +1 -1
  8. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js +12 -4
  9. package/dist/cjs/lib/v3/agent/tools/fillFormVision.js.map +1 -1
  10. package/dist/cjs/lib/v3/agent/tools/type.js +12 -3
  11. package/dist/cjs/lib/v3/agent/tools/type.js.map +1 -1
  12. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js +3 -1
  13. package/dist/cjs/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  14. package/dist/cjs/lib/v3/api.d.ts +1 -1
  15. package/dist/cjs/lib/v3/api.js +11 -1
  16. package/dist/cjs/lib/v3/api.js.map +1 -1
  17. package/dist/cjs/lib/v3/cache/AgentCache.js +6 -1
  18. package/dist/cjs/lib/v3/cache/AgentCache.js.map +1 -1
  19. package/dist/cjs/lib/v3/external_clients/aisdk.js +2 -0
  20. package/dist/cjs/lib/v3/external_clients/aisdk.js.map +1 -1
  21. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js +20 -0
  22. package/dist/cjs/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -1
  23. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js +5 -4
  24. package/dist/cjs/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  25. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js +32 -0
  26. package/dist/cjs/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  27. package/dist/cjs/lib/v3/index.d.ts +1 -1
  28. package/dist/cjs/lib/v3/llm/LLMProvider.js +9 -2
  29. package/dist/cjs/lib/v3/llm/LLMProvider.js.map +1 -1
  30. package/dist/cjs/lib/v3/llm/aisdk.js +2 -0
  31. package/dist/cjs/lib/v3/llm/aisdk.js.map +1 -1
  32. package/dist/cjs/lib/v3/llm/providerOptions.d.ts +7 -0
  33. package/dist/cjs/lib/v3/llm/providerOptions.js +9 -0
  34. package/dist/cjs/lib/v3/llm/providerOptions.js.map +1 -0
  35. package/dist/cjs/lib/v3/types/private/agent.d.ts +1 -1
  36. package/dist/cjs/lib/v3/types/private/agent.js +1 -0
  37. package/dist/cjs/lib/v3/types/private/agent.js.map +1 -1
  38. package/dist/cjs/lib/v3/types/public/agent.d.ts +1 -1
  39. package/dist/cjs/lib/v3/types/public/agent.js +3 -0
  40. package/dist/cjs/lib/v3/types/public/agent.js.map +1 -1
  41. package/dist/cjs/lib/v3/types/public/api.d.ts +53 -0
  42. package/dist/cjs/lib/v3/types/public/api.js +8 -0
  43. package/dist/cjs/lib/v3/types/public/api.js.map +1 -1
  44. package/dist/cjs/lib/v3/types/public/model.d.ts +7 -0
  45. package/dist/cjs/lib/v3/types/public/model.js.map +1 -1
  46. package/dist/cjs/lib/v3/types/public/options.d.ts +13 -0
  47. package/dist/cjs/lib/v3/types/public/options.js.map +1 -1
  48. package/dist/cjs/lib/v3/understudy/a11y/snapshot/capture.js +4 -3
  49. package/dist/cjs/lib/v3/understudy/a11y/snapshot/capture.js.map +1 -1
  50. package/dist/cjs/lib/v3/understudy/locator.d.ts +12 -0
  51. package/dist/cjs/lib/v3/understudy/locator.js +44 -0
  52. package/dist/cjs/lib/v3/understudy/locator.js.map +1 -1
  53. package/dist/cjs/lib/v3/understudy/page.d.ts +15 -0
  54. package/dist/cjs/lib/v3/understudy/page.js +50 -0
  55. package/dist/cjs/lib/v3/understudy/page.js.map +1 -1
  56. package/dist/cjs/lib/v3/v3.d.ts +8 -0
  57. package/dist/cjs/lib/v3/v3.js +50 -3
  58. package/dist/cjs/lib/v3/v3.js.map +1 -1
  59. package/dist/cjs/lib/v3/verifier/types.d.ts +3 -2
  60. package/dist/cjs/lib/v3/verifier/types.js.map +1 -1
  61. package/dist/cjs/lib/version.d.ts +1 -1
  62. package/dist/cjs/lib/version.js +1 -1
  63. package/dist/cjs/lib/version.js.map +1 -1
  64. package/dist/esm/lib/modelUtils.d.ts +10 -0
  65. package/dist/esm/lib/modelUtils.js +9 -0
  66. package/dist/esm/lib/modelUtils.js.map +1 -1
  67. package/dist/esm/lib/v3/agent/AgentProvider.js +3 -0
  68. package/dist/esm/lib/v3/agent/AgentProvider.js.map +1 -1
  69. package/dist/esm/lib/v3/agent/tools/click.js +15 -4
  70. package/dist/esm/lib/v3/agent/tools/click.js.map +1 -1
  71. package/dist/esm/lib/v3/agent/tools/fillFormVision.js +12 -4
  72. package/dist/esm/lib/v3/agent/tools/fillFormVision.js.map +1 -1
  73. package/dist/esm/lib/v3/agent/tools/type.js +12 -3
  74. package/dist/esm/lib/v3/agent/tools/type.js.map +1 -1
  75. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js +3 -1
  76. package/dist/esm/lib/v3/agent/utils/handleDoneToolCall.js.map +1 -1
  77. package/dist/esm/lib/v3/api.d.ts +1 -1
  78. package/dist/esm/lib/v3/api.js +11 -1
  79. package/dist/esm/lib/v3/api.js.map +1 -1
  80. package/dist/esm/lib/v3/cache/AgentCache.js +6 -1
  81. package/dist/esm/lib/v3/cache/AgentCache.js.map +1 -1
  82. package/dist/esm/lib/v3/external_clients/aisdk.js +2 -0
  83. package/dist/esm/lib/v3/external_clients/aisdk.js.map +1 -1
  84. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js +20 -0
  85. package/dist/esm/lib/v3/handlers/handlerUtils/actHandlerUtils.js.map +1 -1
  86. package/dist/esm/lib/v3/handlers/v3AgentHandler.js +5 -4
  87. package/dist/esm/lib/v3/handlers/v3AgentHandler.js.map +1 -1
  88. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js +32 -0
  89. package/dist/esm/lib/v3/handlers/v3CuaAgentHandler.js.map +1 -1
  90. package/dist/esm/lib/v3/index.d.ts +1 -1
  91. package/dist/esm/lib/v3/llm/LLMProvider.js +9 -2
  92. package/dist/esm/lib/v3/llm/LLMProvider.js.map +1 -1
  93. package/dist/esm/lib/v3/llm/aisdk.js +2 -0
  94. package/dist/esm/lib/v3/llm/aisdk.js.map +1 -1
  95. package/dist/esm/lib/v3/llm/providerOptions.d.ts +7 -0
  96. package/dist/esm/lib/v3/llm/providerOptions.js +6 -0
  97. package/dist/esm/lib/v3/llm/providerOptions.js.map +1 -0
  98. package/dist/esm/lib/v3/types/private/agent.d.ts +1 -1
  99. package/dist/esm/lib/v3/types/private/agent.js +1 -0
  100. package/dist/esm/lib/v3/types/private/agent.js.map +1 -1
  101. package/dist/esm/lib/v3/types/public/agent.d.ts +1 -1
  102. package/dist/esm/lib/v3/types/public/agent.js +3 -0
  103. package/dist/esm/lib/v3/types/public/agent.js.map +1 -1
  104. package/dist/esm/lib/v3/types/public/api.d.ts +53 -0
  105. package/dist/esm/lib/v3/types/public/api.js +8 -0
  106. package/dist/esm/lib/v3/types/public/api.js.map +1 -1
  107. package/dist/esm/lib/v3/types/public/model.d.ts +7 -0
  108. package/dist/esm/lib/v3/types/public/model.js.map +1 -1
  109. package/dist/esm/lib/v3/types/public/options.d.ts +13 -0
  110. package/dist/esm/lib/v3/types/public/options.js.map +1 -1
  111. package/dist/esm/lib/v3/understudy/a11y/snapshot/capture.js +4 -3
  112. package/dist/esm/lib/v3/understudy/a11y/snapshot/capture.js.map +1 -1
  113. package/dist/esm/lib/v3/understudy/locator.d.ts +12 -0
  114. package/dist/esm/lib/v3/understudy/locator.js +44 -0
  115. package/dist/esm/lib/v3/understudy/locator.js.map +1 -1
  116. package/dist/esm/lib/v3/understudy/page.d.ts +15 -0
  117. package/dist/esm/lib/v3/understudy/page.js +50 -0
  118. package/dist/esm/lib/v3/understudy/page.js.map +1 -1
  119. package/dist/esm/lib/v3/v3.d.ts +8 -0
  120. package/dist/esm/lib/v3/v3.js +51 -4
  121. package/dist/esm/lib/v3/v3.js.map +1 -1
  122. package/dist/esm/lib/v3/verifier/types.d.ts +3 -2
  123. package/dist/esm/lib/v3/verifier/types.js.map +1 -1
  124. package/dist/esm/lib/version.d.ts +1 -1
  125. package/dist/esm/lib/version.js +1 -1
  126. package/dist/esm/lib/version.js.map +1 -1
  127. package/package.json +1 -1
@@ -126,6 +126,7 @@ let Page = (() => {
126
126
  let _waitForSelector_decorators;
127
127
  let _evaluate_decorators;
128
128
  let _click_decorators;
129
+ let _tap_decorators;
129
130
  let _hover_decorators;
130
131
  let _scroll_decorators;
131
132
  let _dragAndDrop_decorators;
@@ -155,6 +156,7 @@ let Page = (() => {
155
156
  })];
156
157
  _evaluate_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({ eventType: "PageEvaluate" })];
157
158
  _click_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({ eventType: "PageClick" })];
159
+ _tap_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({ eventType: "PageTap" })];
158
160
  _hover_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({ eventType: "PageHover" })];
159
161
  _scroll_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({ eventType: "PageScroll" })];
160
162
  _dragAndDrop_decorators = [FlowLogger_js_1.FlowLogger.wrapWithLogging({
@@ -175,6 +177,7 @@ let Page = (() => {
175
177
  __esDecorate(this, null, _waitForSelector_decorators, { kind: "method", name: "waitForSelector", static: false, private: false, access: { has: obj => "waitForSelector" in obj, get: obj => obj.waitForSelector }, metadata: _metadata }, null, _instanceExtraInitializers);
176
178
  __esDecorate(this, null, _evaluate_decorators, { kind: "method", name: "evaluate", static: false, private: false, access: { has: obj => "evaluate" in obj, get: obj => obj.evaluate }, metadata: _metadata }, null, _instanceExtraInitializers);
177
179
  __esDecorate(this, null, _click_decorators, { kind: "method", name: "click", static: false, private: false, access: { has: obj => "click" in obj, get: obj => obj.click }, metadata: _metadata }, null, _instanceExtraInitializers);
180
+ __esDecorate(this, null, _tap_decorators, { kind: "method", name: "tap", static: false, private: false, access: { has: obj => "tap" in obj, get: obj => obj.tap }, metadata: _metadata }, null, _instanceExtraInitializers);
178
181
  __esDecorate(this, null, _hover_decorators, { kind: "method", name: "hover", static: false, private: false, access: { has: obj => "hover" in obj, get: obj => obj.hover }, metadata: _metadata }, null, _instanceExtraInitializers);
179
182
  __esDecorate(this, null, _scroll_decorators, { kind: "method", name: "scroll", static: false, private: false, access: { has: obj => "scroll" in obj, get: obj => obj.scroll }, metadata: _metadata }, null, _instanceExtraInitializers);
180
183
  __esDecorate(this, null, _dragAndDrop_decorators, { kind: "method", name: "dragAndDrop", static: false, private: false, access: { has: obj => "dragAndDrop" in obj, get: obj => obj.dragAndDrop }, metadata: _metadata }, null, _instanceExtraInitializers);
@@ -1523,6 +1526,53 @@ let Page = (() => {
1523
1526
  await Promise.all(dispatches);
1524
1527
  return xpathResult ?? "";
1525
1528
  }
1529
+ /**
1530
+ * Tap at absolute page coordinates (CSS pixels) with a real (trusted) touch.
1531
+ * Mirrors {@link click} but synthesizes touch input via `Input.dispatchTouchEvent`
1532
+ * instead of mouse input, so mobile layouts that gate their handlers on
1533
+ * touch/pointer events (`pointerType: "touch"`) — where a synthesized mouse click
1534
+ * never registers — respond correctly. Coordinates are relative to the viewport
1535
+ * origin (top-left). Does not scroll.
1536
+ *
1537
+ * Does not require touch emulation: CDP delivers a trusted touch sequence even on
1538
+ * a session reporting `maxTouchPoints: 0`. Whether the agent *chooses* this over
1539
+ * {@link click} is decided by `V3.usesTouch`.
1540
+ */
1541
+ async tap(x, y, options) {
1542
+ let xpathResult;
1543
+ if (options?.returnXpath) {
1544
+ // Resolve the deepest node at the tap coordinates so a recorded/replayed
1545
+ // step can target it by XPath, mirroring click's returnXpath path.
1546
+ try {
1547
+ const hit = await (0, index_js_1.resolveXpathForLocation)(this, x, y);
1548
+ if (hit) {
1549
+ xpathResult = hit.absoluteXPath;
1550
+ }
1551
+ }
1552
+ catch {
1553
+ // best-effort; fall through if resolution fails
1554
+ }
1555
+ }
1556
+ // Keep the cursor overlay in sync with the action, like every other
1557
+ // coordinate action (click/hover/drag), even though touch has no cursor.
1558
+ await this.updateCursor(x, y);
1559
+ // Dispatch touchStart/touchEnd as one pipelined burst, the same way click
1560
+ // batches press/release. CDP processes commands on a session in the order
1561
+ // they were written, so the pair still arrives ordered; awaiting each in
1562
+ // turn only adds a round trip of latency (a full network RTT when the
1563
+ // browser is remote).
1564
+ await Promise.all([
1565
+ this.mainSession.send("Input.dispatchTouchEvent", {
1566
+ type: "touchStart",
1567
+ touchPoints: [{ x, y }],
1568
+ }),
1569
+ this.mainSession.send("Input.dispatchTouchEvent", {
1570
+ type: "touchEnd",
1571
+ touchPoints: [],
1572
+ }),
1573
+ ]);
1574
+ return xpathResult ?? "";
1575
+ }
1526
1576
  /**
1527
1577
  * Hover at absolute page coordinates (CSS pixels).
1528
1578
  * Dispatches mouseMoved via CDP Input domain on the top-level page target's