@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
@@ -123,6 +123,7 @@ let Page = (() => {
123
123
  let _waitForSelector_decorators;
124
124
  let _evaluate_decorators;
125
125
  let _click_decorators;
126
+ let _tap_decorators;
126
127
  let _hover_decorators;
127
128
  let _scroll_decorators;
128
129
  let _dragAndDrop_decorators;
@@ -152,6 +153,7 @@ let Page = (() => {
152
153
  })];
153
154
  _evaluate_decorators = [FlowLogger.wrapWithLogging({ eventType: "PageEvaluate" })];
154
155
  _click_decorators = [FlowLogger.wrapWithLogging({ eventType: "PageClick" })];
156
+ _tap_decorators = [FlowLogger.wrapWithLogging({ eventType: "PageTap" })];
155
157
  _hover_decorators = [FlowLogger.wrapWithLogging({ eventType: "PageHover" })];
156
158
  _scroll_decorators = [FlowLogger.wrapWithLogging({ eventType: "PageScroll" })];
157
159
  _dragAndDrop_decorators = [FlowLogger.wrapWithLogging({
@@ -172,6 +174,7 @@ let Page = (() => {
172
174
  __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);
173
175
  __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);
174
176
  __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);
177
+ __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);
175
178
  __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);
176
179
  __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);
177
180
  __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);
@@ -1520,6 +1523,53 @@ let Page = (() => {
1520
1523
  await Promise.all(dispatches);
1521
1524
  return xpathResult ?? "";
1522
1525
  }
1526
+ /**
1527
+ * Tap at absolute page coordinates (CSS pixels) with a real (trusted) touch.
1528
+ * Mirrors {@link click} but synthesizes touch input via `Input.dispatchTouchEvent`
1529
+ * instead of mouse input, so mobile layouts that gate their handlers on
1530
+ * touch/pointer events (`pointerType: "touch"`) — where a synthesized mouse click
1531
+ * never registers — respond correctly. Coordinates are relative to the viewport
1532
+ * origin (top-left). Does not scroll.
1533
+ *
1534
+ * Does not require touch emulation: CDP delivers a trusted touch sequence even on
1535
+ * a session reporting `maxTouchPoints: 0`. Whether the agent *chooses* this over
1536
+ * {@link click} is decided by `V3.usesTouch`.
1537
+ */
1538
+ async tap(x, y, options) {
1539
+ let xpathResult;
1540
+ if (options?.returnXpath) {
1541
+ // Resolve the deepest node at the tap coordinates so a recorded/replayed
1542
+ // step can target it by XPath, mirroring click's returnXpath path.
1543
+ try {
1544
+ const hit = await resolveXpathForLocation(this, x, y);
1545
+ if (hit) {
1546
+ xpathResult = hit.absoluteXPath;
1547
+ }
1548
+ }
1549
+ catch {
1550
+ // best-effort; fall through if resolution fails
1551
+ }
1552
+ }
1553
+ // Keep the cursor overlay in sync with the action, like every other
1554
+ // coordinate action (click/hover/drag), even though touch has no cursor.
1555
+ await this.updateCursor(x, y);
1556
+ // Dispatch touchStart/touchEnd as one pipelined burst, the same way click
1557
+ // batches press/release. CDP processes commands on a session in the order
1558
+ // they were written, so the pair still arrives ordered; awaiting each in
1559
+ // turn only adds a round trip of latency (a full network RTT when the
1560
+ // browser is remote).
1561
+ await Promise.all([
1562
+ this.mainSession.send("Input.dispatchTouchEvent", {
1563
+ type: "touchStart",
1564
+ touchPoints: [{ x, y }],
1565
+ }),
1566
+ this.mainSession.send("Input.dispatchTouchEvent", {
1567
+ type: "touchEnd",
1568
+ touchPoints: [],
1569
+ }),
1570
+ ]);
1571
+ return xpathResult ?? "";
1572
+ }
1523
1573
  /**
1524
1574
  * Hover at absolute page coordinates (CSS pixels).
1525
1575
  * Dispatches mouseMoved via CDP Input domain on the top-level page target's