@browserbasehq/orca 3.0.2-zod345 → 3.0.2-zod346
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.
- package/dist/index.d.ts +2 -2
- package/dist/index.js +124 -86
- package/package.json +6 -5
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { ZodTypeAny, z, ZodObject, ZodRawShape, ZodError } from 'zod';
|
|
2
2
|
import * as z3 from 'zod/v3';
|
|
3
|
-
import { zodToJsonSchema } from 'zod-to-json-schema';
|
|
4
3
|
import { ClientOptions as ClientOptions$2 } from '@anthropic-ai/sdk';
|
|
5
4
|
import { LanguageModelV2 } from '@ai-sdk/provider';
|
|
6
5
|
import { ClientOptions as ClientOptions$1 } from 'openai';
|
|
@@ -27,7 +26,7 @@ declare const isZod4Schema: (schema: StagehandZodSchema) => schema is ZodTypeAny
|
|
|
27
26
|
};
|
|
28
27
|
declare const isZod3Schema: (schema: StagehandZodSchema) => schema is z3.ZodTypeAny;
|
|
29
28
|
type JsonSchemaDocument = Record<string, unknown>;
|
|
30
|
-
declare function toJsonSchema(schema: StagehandZodSchema
|
|
29
|
+
declare function toJsonSchema(schema: StagehandZodSchema): JsonSchemaDocument;
|
|
31
30
|
|
|
32
31
|
type AnthropicJsonSchemaObject = {
|
|
33
32
|
definitions?: {
|
|
@@ -2104,6 +2103,7 @@ interface JsonSchemaProperty {
|
|
|
2104
2103
|
minimum?: number;
|
|
2105
2104
|
maximum?: number;
|
|
2106
2105
|
description?: string;
|
|
2106
|
+
format?: string;
|
|
2107
2107
|
}
|
|
2108
2108
|
interface JsonSchema extends JsonSchemaProperty {
|
|
2109
2109
|
type: string;
|
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-
|
|
88
|
+
STAGEHAND_VERSION = "3.0.2-zod346";
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
91
|
|
|
@@ -7965,17 +7965,96 @@ var import_v3 = __toESM(require("zod/v3"));
|
|
|
7965
7965
|
|
|
7966
7966
|
// lib/v3/zodCompat.ts
|
|
7967
7967
|
var import_zod = require("zod");
|
|
7968
|
-
var import_zod_to_json_schema = require("zod-to-json-schema");
|
|
7969
7968
|
var isZod4Schema = (schema) => typeof schema._zod !== "undefined";
|
|
7970
7969
|
var isZod3Schema = (schema) => !isZod4Schema(schema);
|
|
7971
|
-
function
|
|
7972
|
-
|
|
7973
|
-
|
|
7970
|
+
function ZodToJsonSchema(schema) {
|
|
7971
|
+
const _def = schema._def;
|
|
7972
|
+
if (!_def) {
|
|
7973
|
+
return { type: "null" };
|
|
7974
|
+
}
|
|
7975
|
+
const typeName = _def.typeName;
|
|
7976
|
+
switch (typeName) {
|
|
7977
|
+
case "ZodObject": {
|
|
7978
|
+
const shape = typeof _def.shape === "function" ? _def.shape() : _def.shape;
|
|
7979
|
+
const properties = {};
|
|
7980
|
+
const required = [];
|
|
7981
|
+
for (const [key, value] of Object.entries(shape)) {
|
|
7982
|
+
properties[key] = ZodToJsonSchema(value);
|
|
7983
|
+
const valueDef = value._def;
|
|
7984
|
+
if ((valueDef == null ? void 0 : valueDef.typeName) !== "ZodOptional") {
|
|
7985
|
+
required.push(key);
|
|
7986
|
+
}
|
|
7987
|
+
}
|
|
7988
|
+
return {
|
|
7989
|
+
type: "object",
|
|
7990
|
+
properties,
|
|
7991
|
+
required,
|
|
7992
|
+
additionalProperties: _def.unknownKeys === "passthrough"
|
|
7993
|
+
};
|
|
7994
|
+
}
|
|
7995
|
+
case "ZodArray": {
|
|
7996
|
+
const itemType = _def.type;
|
|
7997
|
+
return {
|
|
7998
|
+
type: "array",
|
|
7999
|
+
items: ZodToJsonSchema(itemType)
|
|
8000
|
+
};
|
|
8001
|
+
}
|
|
8002
|
+
case "ZodString": {
|
|
8003
|
+
const result = { type: "string" };
|
|
8004
|
+
const checks = _def.checks;
|
|
8005
|
+
if (checks) {
|
|
8006
|
+
for (const check of checks) {
|
|
8007
|
+
if (check.kind === "url") {
|
|
8008
|
+
result.format = "url";
|
|
8009
|
+
break;
|
|
8010
|
+
}
|
|
8011
|
+
}
|
|
8012
|
+
}
|
|
8013
|
+
return result;
|
|
8014
|
+
}
|
|
8015
|
+
case "ZodNumber":
|
|
8016
|
+
return { type: "number" };
|
|
8017
|
+
case "ZodBoolean":
|
|
8018
|
+
return { type: "boolean" };
|
|
8019
|
+
case "ZodOptional":
|
|
8020
|
+
return ZodToJsonSchema(_def.innerType);
|
|
8021
|
+
case "ZodNullable": {
|
|
8022
|
+
const innerSchema = ZodToJsonSchema(_def.innerType);
|
|
8023
|
+
return __spreadProps(__spreadValues({}, innerSchema), {
|
|
8024
|
+
nullable: true
|
|
8025
|
+
});
|
|
8026
|
+
}
|
|
8027
|
+
case "ZodEnum":
|
|
8028
|
+
return {
|
|
8029
|
+
type: "string",
|
|
8030
|
+
enum: _def.values
|
|
8031
|
+
};
|
|
8032
|
+
case "ZodLiteral":
|
|
8033
|
+
return {
|
|
8034
|
+
type: typeof _def.value,
|
|
8035
|
+
const: _def.value
|
|
8036
|
+
};
|
|
8037
|
+
case "ZodUnion":
|
|
8038
|
+
return {
|
|
8039
|
+
anyOf: _def.options.map((opt) => ZodToJsonSchema(opt))
|
|
8040
|
+
};
|
|
8041
|
+
default:
|
|
8042
|
+
console.warn(`Unknown Zod type: ${typeName}`);
|
|
8043
|
+
return { type: "null" };
|
|
7974
8044
|
}
|
|
7975
|
-
|
|
7976
|
-
|
|
7977
|
-
|
|
7978
|
-
|
|
8045
|
+
}
|
|
8046
|
+
function toJsonSchema(schema) {
|
|
8047
|
+
if (!isZod4Schema(schema)) {
|
|
8048
|
+
const result = __spreadValues({
|
|
8049
|
+
$schema: "http://json-schema.org/draft-07/schema#"
|
|
8050
|
+
}, ZodToJsonSchema(schema));
|
|
8051
|
+
return result;
|
|
8052
|
+
}
|
|
8053
|
+
const zodWithJsonSchema = import_zod.z;
|
|
8054
|
+
if (zodWithJsonSchema.toJSONSchema) {
|
|
8055
|
+
return zodWithJsonSchema.toJSONSchema(schema);
|
|
8056
|
+
}
|
|
8057
|
+
throw new Error("Zod v4 toJSONSchema method not found");
|
|
7979
8058
|
}
|
|
7980
8059
|
|
|
7981
8060
|
// lib/utils.ts
|
|
@@ -8575,6 +8654,13 @@ function jsonSchemaToZod(schema) {
|
|
|
8575
8654
|
return import_zod2.z.string().refine((val) => schema.enum.includes(val));
|
|
8576
8655
|
}
|
|
8577
8656
|
let zodString = import_zod2.z.string();
|
|
8657
|
+
if (schema.format === "uri" || schema.format === "url") {
|
|
8658
|
+
zodString = zodString.url();
|
|
8659
|
+
} else if (schema.format === "email") {
|
|
8660
|
+
zodString = zodString.email();
|
|
8661
|
+
} else if (schema.format === "uuid") {
|
|
8662
|
+
zodString = zodString.uuid();
|
|
8663
|
+
}
|
|
8578
8664
|
if (schema.description) {
|
|
8579
8665
|
zodString = zodString.describe(schema.description);
|
|
8580
8666
|
}
|
|
@@ -11324,11 +11410,6 @@ var ExtractHandler = class {
|
|
|
11324
11410
|
logger: v3Logger,
|
|
11325
11411
|
logInferenceToFile: this.logInferenceToFile
|
|
11326
11412
|
});
|
|
11327
|
-
console.log("transformedSchema", transformedSchema);
|
|
11328
|
-
console.log(
|
|
11329
|
-
"transformedSchema",
|
|
11330
|
-
JSON.stringify(transformedSchema, null, 2)
|
|
11331
|
-
);
|
|
11332
11413
|
const _c = extractionResponse, {
|
|
11333
11414
|
metadata: { completed },
|
|
11334
11415
|
prompt_tokens,
|
|
@@ -19699,7 +19780,7 @@ var getRefs = (options) => {
|
|
|
19699
19780
|
)
|
|
19700
19781
|
});
|
|
19701
19782
|
};
|
|
19702
|
-
var
|
|
19783
|
+
var zodToJsonSchema = (schema, options) => {
|
|
19703
19784
|
var _a;
|
|
19704
19785
|
const refs = getRefs(options);
|
|
19705
19786
|
let definitions = typeof options === "object" && options.definitions ? Object.entries(options.definitions).reduce(
|
|
@@ -19744,7 +19825,7 @@ var zodToJsonSchema2 = (schema, options) => {
|
|
|
19744
19825
|
combined.$schema = "http://json-schema.org/draft-07/schema#";
|
|
19745
19826
|
return combined;
|
|
19746
19827
|
};
|
|
19747
|
-
var zod_to_json_schema_default =
|
|
19828
|
+
var zod_to_json_schema_default = zodToJsonSchema;
|
|
19748
19829
|
function zod3Schema(zodSchema2, options) {
|
|
19749
19830
|
var _a;
|
|
19750
19831
|
const useReferences = (_a = options == null ? void 0 : options.useReferences) != null ? _a : false;
|
|
@@ -39351,7 +39432,7 @@ var CdpConnection = class _CdpConnection {
|
|
|
39351
39432
|
yield this.send("Target.setAutoAttach", {
|
|
39352
39433
|
autoAttach: true,
|
|
39353
39434
|
flatten: true,
|
|
39354
|
-
waitForDebuggerOnStart:
|
|
39435
|
+
waitForDebuggerOnStart: false,
|
|
39355
39436
|
filter: [
|
|
39356
39437
|
{ type: "worker", exclude: true },
|
|
39357
39438
|
{ type: "shared_worker", exclude: true },
|
|
@@ -39534,12 +39615,15 @@ init_logger();
|
|
|
39534
39615
|
// lib/v3/dom/build/scriptV3Content.ts
|
|
39535
39616
|
var v3ScriptContent = '(()=>{function b(_={}){let S=n=>{let{hostToRoot:l}=n,m=t=>{let o=[];if(t instanceof Document)return t.documentElement&&o.push(t.documentElement),o;if(t instanceof ShadowRoot||t instanceof DocumentFragment)return o.push(...Array.from(t.children)),o;if(t instanceof Element){o.push(...Array.from(t.children));let a=t.shadowRoot;a&&o.push(...Array.from(a.children));let r=l.get(t);return r&&o.push(...Array.from(r.children)),o}return o},v=t=>{let o=[],a=[...m(t)];for(;a.length;){let r=a.shift();o.push(r),a.push(...m(r))}return o},y=t=>{let o=String(t||"").trim();if(!o)return null;let a=o.replace(/^xpath=/i,""),r=[];{let e=0;for(;e<a.length;){let d="child";a.startsWith("//",e)?(d="desc",e+=2):a[e]==="/"&&(d="child",e+=1);let h=e;for(;e<a.length&&a[e]!=="/";)e++;let u=a.slice(h,e).trim();if(!u)continue;let p=u.match(/^(.*?)(\\[(\\d+)\\])?$/u),i=(p?.[1]??u).trim(),c=p?.[3]?Math.max(1,Number(p[3])):null,R=i===""?"*":i.toLowerCase();r.push({axis:d,raw:u,tag:R,index:c})}}n.debug&&console.info("[v3-piercer][resolve] start",{url:location.href,steps:r.map(e=>({axis:e.axis,raw:e.raw,tag:e.tag,index:e.index}))});let g=[document];for(let e of r){let d=e.index,h=null;for(let u of g){let p=e.axis==="child"?m(u):v(u),i=[];for(let c of p)(e.tag==="*"||c.localName===e.tag)&&i.push(c);if(n.debug&&console.info("[v3-piercer][resolve] step",{axis:e.axis,tag:e.tag,index:d,poolCount:p.length,matchesCount:i.length}),!!i.length){if(d!=null){let c=d-1;h=c>=0&&c<i.length?i[c]:null}else h=i[0];if(h)break}}if(!h)return n.debug&&console.info("[v3-piercer][resolve] no-match",{step:e.raw}),null;g=[h]}let E=g.length?g[0]:null;return n.debug&&console.info("[v3-piercer][resolve] done",{found:!!E,tag:E?.localName??""}),E};window.__stagehandV3__={getClosedRoot:t=>l.get(t),stats:()=>({installed:!0,url:location.href,isTop:window.top===window,open:n.openCount,closed:n.closedCount}),resolveSimpleXPath:y}},f=Element.prototype.attachShadow;if(f.__v3Patched&&f.__v3State){f.__v3State.debug=!0,S(f.__v3State);return}let s={hostToRoot:new WeakMap,openCount:0,closedCount:0,debug:!0},x=f,w=function(n){let l=n?.mode??"open",m=x.call(this,n);try{s.hostToRoot.set(this,m),l==="closed"?s.closedCount++:s.openCount++,s.debug&&console.info("[v3-piercer] attachShadow",{tag:this.tagName?.toLowerCase()??"",mode:l,url:location.href})}catch{}return m};if(w.__v3Patched=!0,w.__v3State=s,Object.defineProperty(Element.prototype,"attachShadow",{configurable:!0,writable:!0,value:w}),_.tagExisting)try{let n=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT);for(;n.nextNode();){let l=n.currentNode;l.shadowRoot&&(s.hostToRoot.set(l,l.shadowRoot),s.openCount++)}}catch{}window.__stagehandV3Injected=!0,S(s),s.debug&&console.info("[v3-piercer] installed",{url:location.href,isTop:window.top===window,readyState:document.readyState})}b({debug:!0,tagExisting:!1});})();\n';
|
|
39536
39617
|
|
|
39618
|
+
// lib/v3/dom/build/reRenderScriptContent.ts
|
|
39619
|
+
var reRenderScriptContent = '(()=>{function s(){try{let o=window.__stagehandV3__;if(!o||typeof o.getClosedRoot!="function")return;let t=[],r=document.createTreeWalker(document,NodeFilter.SHOW_ELEMENT);for(;r.nextNode();){let e=r.currentNode,n=e.tagName?.toLowerCase()??"";if(!n.includes("-")||typeof customElements?.get!="function"||!customElements.get(n))continue;let c=!!e.shadowRoot,i=!!o.getClosedRoot(e);c||i||t.push(e)}for(let e of t)try{let n=e.cloneNode(!0);e.replaceWith(n)}catch{}o.stats&&t.length&&console.info("[v3-piercer] rerender",{count:t.length})}catch(o){console.info("[v3-piercer] rerender error",{message:String(o??"")})}}s();})();\n';
|
|
39620
|
+
|
|
39537
39621
|
// lib/v3/understudy/piercer.ts
|
|
39538
39622
|
function installV3PiercerIntoSession(session) {
|
|
39539
39623
|
return __async(this, null, function* () {
|
|
39540
39624
|
var _a, _b;
|
|
39541
|
-
yield session.send("Page.enable").catch(() =>
|
|
39542
|
-
|
|
39625
|
+
const pageEnabled = yield session.send("Page.enable").then(() => true).catch(() => false);
|
|
39626
|
+
if (!pageEnabled) return false;
|
|
39543
39627
|
yield session.send("Runtime.enable").catch(() => {
|
|
39544
39628
|
});
|
|
39545
39629
|
try {
|
|
@@ -39549,7 +39633,7 @@ function installV3PiercerIntoSession(session) {
|
|
|
39549
39633
|
);
|
|
39550
39634
|
} catch (e) {
|
|
39551
39635
|
const msg = String((_b = (_a = e == null ? void 0 : e.message) != null ? _a : e) != null ? _b : "");
|
|
39552
|
-
if (msg.includes("Session with given id not found")) return;
|
|
39636
|
+
if (msg.includes("Session with given id not found")) return false;
|
|
39553
39637
|
}
|
|
39554
39638
|
yield session.send("Runtime.evaluate", {
|
|
39555
39639
|
expression: v3ScriptContent,
|
|
@@ -39557,6 +39641,13 @@ function installV3PiercerIntoSession(session) {
|
|
|
39557
39641
|
awaitPromise: true
|
|
39558
39642
|
}).catch(() => {
|
|
39559
39643
|
});
|
|
39644
|
+
yield session.send("Runtime.evaluate", {
|
|
39645
|
+
expression: reRenderScriptContent,
|
|
39646
|
+
returnByValue: true,
|
|
39647
|
+
awaitPromise: false
|
|
39648
|
+
}).catch(() => {
|
|
39649
|
+
});
|
|
39650
|
+
return true;
|
|
39560
39651
|
});
|
|
39561
39652
|
}
|
|
39562
39653
|
|
|
@@ -39663,9 +39754,12 @@ var V3Context = class _V3Context {
|
|
|
39663
39754
|
ensurePiercer(session) {
|
|
39664
39755
|
return __async(this, null, function* () {
|
|
39665
39756
|
const key = this.sessionKey(session);
|
|
39666
|
-
if (this._piercerInstalled.has(key)) return;
|
|
39667
|
-
yield installV3PiercerIntoSession(session);
|
|
39668
|
-
|
|
39757
|
+
if (this._piercerInstalled.has(key)) return true;
|
|
39758
|
+
const installed = yield installV3PiercerIntoSession(session);
|
|
39759
|
+
if (installed) {
|
|
39760
|
+
this._piercerInstalled.add(key);
|
|
39761
|
+
}
|
|
39762
|
+
return installed;
|
|
39669
39763
|
});
|
|
39670
39764
|
}
|
|
39671
39765
|
/** Mark a page target as the most-recent one (active). */
|
|
@@ -39803,11 +39897,7 @@ var V3Context = class _V3Context {
|
|
|
39803
39897
|
this.conn.on(
|
|
39804
39898
|
"Target.attachedToTarget",
|
|
39805
39899
|
(evt) => __async(this, null, function* () {
|
|
39806
|
-
yield this.onAttachedToTarget(
|
|
39807
|
-
evt.targetInfo,
|
|
39808
|
-
evt.sessionId,
|
|
39809
|
-
evt.waitingForDebugger === true
|
|
39810
|
-
);
|
|
39900
|
+
yield this.onAttachedToTarget(evt.targetInfo, evt.sessionId);
|
|
39811
39901
|
})
|
|
39812
39902
|
);
|
|
39813
39903
|
this.conn.on(
|
|
@@ -39860,29 +39950,20 @@ var V3Context = class _V3Context {
|
|
|
39860
39950
|
* if the parent is known; otherwise stage until parent `frameAttached`.
|
|
39861
39951
|
* - Resume the target only after listeners are wired.
|
|
39862
39952
|
*/
|
|
39863
|
-
onAttachedToTarget(info, sessionId
|
|
39953
|
+
onAttachedToTarget(info, sessionId) {
|
|
39864
39954
|
return __async(this, null, function* () {
|
|
39865
39955
|
var _a;
|
|
39866
39956
|
const session = this.conn.getSession(sessionId);
|
|
39867
39957
|
if (!session) return;
|
|
39868
39958
|
if (this._sessionInit.has(sessionId)) return;
|
|
39869
39959
|
this._sessionInit.add(sessionId);
|
|
39870
|
-
const pageEnabled = yield session.send("Page.enable").then(() => true).catch(() => false);
|
|
39871
|
-
if (!pageEnabled) {
|
|
39872
|
-
if (waitingForDebugger) {
|
|
39873
|
-
yield session.send("Runtime.runIfWaitingForDebugger").catch(() => {
|
|
39874
|
-
});
|
|
39875
|
-
}
|
|
39876
|
-
return;
|
|
39877
|
-
}
|
|
39878
|
-
yield session.send("Page.setLifecycleEventsEnabled", { enabled: true }).catch(() => {
|
|
39879
|
-
});
|
|
39880
39960
|
yield session.send("Runtime.runIfWaitingForDebugger").catch(() => {
|
|
39881
39961
|
});
|
|
39882
39962
|
executionContexts.attachSession(session);
|
|
39883
|
-
yield
|
|
39963
|
+
const piercerReady = yield this.ensurePiercer(session);
|
|
39964
|
+
if (!piercerReady) return;
|
|
39965
|
+
yield session.send("Page.setLifecycleEventsEnabled", { enabled: true }).catch(() => {
|
|
39884
39966
|
});
|
|
39885
|
-
yield this.ensurePiercer(session);
|
|
39886
39967
|
if (isTopLevelPage(info)) {
|
|
39887
39968
|
const page = yield Page.create(
|
|
39888
39969
|
this.conn,
|
|
@@ -39906,10 +39987,6 @@ var V3Context = class _V3Context {
|
|
|
39906
39987
|
page.seedCurrentUrl((_a = pendingSeedUrl != null ? pendingSeedUrl : info.url) != null ? _a : "");
|
|
39907
39988
|
this._pushActive(info.targetId);
|
|
39908
39989
|
this.installFrameEventBridges(sessionId, page);
|
|
39909
|
-
if (waitingForDebugger) {
|
|
39910
|
-
yield session.send("Runtime.runIfWaitingForDebugger").catch(() => {
|
|
39911
|
-
});
|
|
39912
|
-
}
|
|
39913
39990
|
return;
|
|
39914
39991
|
}
|
|
39915
39992
|
try {
|
|
@@ -39937,51 +40014,13 @@ var V3Context = class _V3Context {
|
|
|
39937
40014
|
owner.adoptOopifSession(session, childMainId);
|
|
39938
40015
|
this.sessionOwnerPage.set(sessionId, owner);
|
|
39939
40016
|
this.installFrameEventBridges(sessionId, owner);
|
|
40017
|
+
void executionContexts.waitForMainWorld(session, childMainId).catch(() => {
|
|
40018
|
+
});
|
|
39940
40019
|
} else {
|
|
39941
40020
|
this.pendingOopifByMainFrame.set(childMainId, sessionId);
|
|
39942
40021
|
}
|
|
39943
40022
|
} catch (e) {
|
|
39944
40023
|
}
|
|
39945
|
-
if (info.type === "iframe" && !waitingForDebugger) {
|
|
39946
|
-
try {
|
|
39947
|
-
yield session.send("Page.setLifecycleEventsEnabled", { enabled: true }).catch(() => {
|
|
39948
|
-
});
|
|
39949
|
-
const loadWait = new Promise((resolve2) => {
|
|
39950
|
-
const handler = (evt) => {
|
|
39951
|
-
if (evt.name === "load") {
|
|
39952
|
-
session.off("Page.lifecycleEvent", handler);
|
|
39953
|
-
resolve2();
|
|
39954
|
-
}
|
|
39955
|
-
};
|
|
39956
|
-
session.on("Page.lifecycleEvent", handler);
|
|
39957
|
-
});
|
|
39958
|
-
yield session.send("Runtime.evaluate", {
|
|
39959
|
-
expression: "location.reload()",
|
|
39960
|
-
returnByValue: true,
|
|
39961
|
-
awaitPromise: false
|
|
39962
|
-
}).catch(() => {
|
|
39963
|
-
});
|
|
39964
|
-
yield Promise.race([
|
|
39965
|
-
loadWait,
|
|
39966
|
-
new Promise((r) => setTimeout(r, 3e3))
|
|
39967
|
-
]);
|
|
39968
|
-
yield this.ensurePiercer(session);
|
|
39969
|
-
} catch (e) {
|
|
39970
|
-
v3Logger({
|
|
39971
|
-
category: "ctx",
|
|
39972
|
-
message: "child reload attempt failed (continuing)",
|
|
39973
|
-
level: 2,
|
|
39974
|
-
auxiliary: {
|
|
39975
|
-
sessionId: { value: String(sessionId), type: "string" },
|
|
39976
|
-
err: { value: String(e), type: "string" }
|
|
39977
|
-
}
|
|
39978
|
-
});
|
|
39979
|
-
}
|
|
39980
|
-
}
|
|
39981
|
-
if (waitingForDebugger) {
|
|
39982
|
-
yield session.send("Runtime.runIfWaitingForDebugger").catch(() => {
|
|
39983
|
-
});
|
|
39984
|
-
}
|
|
39985
40024
|
});
|
|
39986
40025
|
}
|
|
39987
40026
|
/**
|
|
@@ -40261,7 +40300,6 @@ var StagehandAPIClient = class {
|
|
|
40261
40300
|
frameId
|
|
40262
40301
|
}) {
|
|
40263
40302
|
const jsonSchema2 = zodSchema2 ? toJsonSchema(zodSchema2) : void 0;
|
|
40264
|
-
console.log("jsonSchema", JSON.stringify(jsonSchema2, null, 2));
|
|
40265
40303
|
const args = {
|
|
40266
40304
|
schema: jsonSchema2,
|
|
40267
40305
|
instruction,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@browserbasehq/orca",
|
|
3
|
-
"version": "3.0.2-
|
|
3
|
+
"version": "3.0.2-zod346",
|
|
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",
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"deepmerge": "^4.3.1",
|
|
26
26
|
"dotenv": "^16.4.5",
|
|
27
|
-
"zod": "^
|
|
27
|
+
"zod": "^4.1.8"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@ai-sdk/provider": "^2.0.0",
|
|
@@ -40,8 +40,7 @@
|
|
|
40
40
|
"pino": "^9.6.0",
|
|
41
41
|
"pino-pretty": "^13.0.0",
|
|
42
42
|
"playwright": "^1.52.0",
|
|
43
|
-
"ws": "^8.18.0"
|
|
44
|
-
"zod-to-json-schema": "^3.24.5"
|
|
43
|
+
"ws": "^8.18.0"
|
|
45
44
|
},
|
|
46
45
|
"optionalDependencies": {
|
|
47
46
|
"@ai-sdk/anthropic": "^2.0.34",
|
|
@@ -69,6 +68,7 @@
|
|
|
69
68
|
"tsup": "^8.2.1",
|
|
70
69
|
"tsx": "^4.10.5",
|
|
71
70
|
"typescript": "^5.2.2",
|
|
71
|
+
"vitest": "^4.0.8",
|
|
72
72
|
"zod": "^4.1.8"
|
|
73
73
|
},
|
|
74
74
|
"repository": {
|
|
@@ -92,6 +92,7 @@
|
|
|
92
92
|
"e2e:local": "playwright test --config=lib/v3/tests/v3.local.playwright.config.ts",
|
|
93
93
|
"e2e:bb": "playwright test --config=lib/v3/tests/v3.bb.playwright.config.ts",
|
|
94
94
|
"lint": "cd ../.. && prettier --check packages/core && cd packages/core && eslint .",
|
|
95
|
-
"format": "prettier --write ."
|
|
95
|
+
"format": "prettier --write .",
|
|
96
|
+
"test:vitest": "pnpm run build-js && vitest run --config vitest.config.ts"
|
|
96
97
|
}
|
|
97
98
|
}
|