@browserbasehq/orca 3.0.2-zod351 → 3.0.2-zod352

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.js +26 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -85,7 +85,7 @@ var __async = (__this, __arguments, generator) => {
85
85
  var STAGEHAND_VERSION;
86
86
  var init_version = __esm({
87
87
  "lib/version.ts"() {
88
- STAGEHAND_VERSION = "3.0.2-zod351";
88
+ STAGEHAND_VERSION = "3.0.2-zod352";
89
89
  }
90
90
  });
91
91
 
@@ -11376,7 +11376,7 @@ var ExtractHandler = class {
11376
11376
  const { instruction, schema, page, selector, timeout, model } = params;
11377
11377
  const llmClient = this.resolveLlmClient(model);
11378
11378
  const doExtract = () => __async(this, null, function* () {
11379
- var _a, _b, _d;
11379
+ var _a, _b, _c, _d, _f;
11380
11380
  const noArgs = !instruction && !schema;
11381
11381
  if (noArgs) {
11382
11382
  const focusSelector2 = (_a = selector == null ? void 0 : selector.replace(/^xpath=/i, "")) != null ? _a : "";
@@ -11413,6 +11413,27 @@ var ExtractHandler = class {
11413
11413
  [WRAP_KEY]: baseSchema
11414
11414
  });
11415
11415
  const [transformedSchema, urlFieldPaths] = transformUrlStringsToNumericIds(objectSchema);
11416
+ try {
11417
+ const getShape = (s) => {
11418
+ var _a2, _b2, _c2;
11419
+ const v4Shape = (_b2 = (_a2 = s._zod) == null ? void 0 : _a2.def) == null ? void 0 : _b2.shape;
11420
+ if (v4Shape) return v4Shape;
11421
+ const v3ShapeGetter = (_c2 = s._def) == null ? void 0 : _c2.shape;
11422
+ return typeof v3ShapeGetter === "function" ? v3ShapeGetter() : void 0;
11423
+ };
11424
+ const beforeKeys = Object.keys((_c = getShape(objectSchema)) != null ? _c : {});
11425
+ const afterKeys = Object.keys((_d = getShape(transformedSchema)) != null ? _d : {});
11426
+ v3Logger({
11427
+ category: "extraction",
11428
+ message: "Schema fields before/after URL transform",
11429
+ level: 2,
11430
+ auxiliary: {
11431
+ before: { value: JSON.stringify(beforeKeys), type: "object" },
11432
+ after: { value: JSON.stringify(afterKeys), type: "object" }
11433
+ }
11434
+ });
11435
+ } catch (e) {
11436
+ }
11416
11437
  const extractionResponse = yield extract({
11417
11438
  instruction,
11418
11439
  domElements: combinedTree,
@@ -11422,14 +11443,14 @@ var ExtractHandler = class {
11422
11443
  logger: v3Logger,
11423
11444
  logInferenceToFile: this.logInferenceToFile
11424
11445
  });
11425
- const _c = extractionResponse, {
11446
+ const _e = extractionResponse, {
11426
11447
  metadata: { completed },
11427
11448
  prompt_tokens,
11428
11449
  completion_tokens,
11429
11450
  reasoning_tokens = 0,
11430
11451
  cached_input_tokens = 0,
11431
11452
  inference_time_ms
11432
- } = _c, rest = __objRest(_c, [
11453
+ } = _e, rest = __objRest(_e, [
11433
11454
  "metadata",
11434
11455
  "prompt_tokens",
11435
11456
  "completion_tokens",
@@ -11454,7 +11475,7 @@ var ExtractHandler = class {
11454
11475
  }
11455
11476
  }
11456
11477
  });
11457
- (_d = this.onMetrics) == null ? void 0 : _d.call(
11478
+ (_f = this.onMetrics) == null ? void 0 : _f.call(
11458
11479
  this,
11459
11480
  "EXTRACT" /* EXTRACT */,
11460
11481
  prompt_tokens,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@browserbasehq/orca",
3
- "version": "3.0.2-zod351",
3
+ "version": "3.0.2-zod352",
4
4
  "description": "An AI web browsing framework focused on simplicity and extensibility.",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",