@browserbasehq/orca 3.0.0-preview.0 → 3.0.0-preview.3
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 +761 -593
- package/dist/index.js +25775 -24553
- package/package.json +35 -74
- package/README.md +0 -165
- package/dist/lib/api.d.ts +0 -23
- package/dist/lib/dom/build/scriptContent.d.ts +0 -1
- package/dist/lib/inference.d.ts +0 -71
- package/dist/lib/inferenceLogUtils.d.ts +0 -12
- package/dist/lib/logger.d.ts +0 -54
- package/dist/lib/prompt.d.ts +0 -12
- package/dist/lib/utils.d.ts +0 -65
- package/dist/lib/v3/agent/AgentClient.d.ts +0 -18
- package/dist/lib/v3/agent/AgentProvider.d.ts +0 -18
- package/dist/lib/v3/agent/AnthropicCUAClient.d.ts +0 -55
- package/dist/lib/v3/agent/OpenAICUAClient.d.ts +0 -64
- package/dist/lib/v3/agent/StagehandAgent.d.ts +0 -15
- package/dist/lib/v3/agent/tools/index.d.ts +0 -229
- package/dist/lib/v3/agent/tools/v3-act.d.ts +0 -29
- package/dist/lib/v3/agent/tools/v3-ariaTree.d.ts +0 -11
- package/dist/lib/v3/agent/tools/v3-close.d.ts +0 -24
- package/dist/lib/v3/agent/tools/v3-extract.d.ts +0 -38
- package/dist/lib/v3/agent/tools/v3-fillform.d.ts +0 -37
- package/dist/lib/v3/agent/tools/v3-goto.d.ts +0 -29
- package/dist/lib/v3/agent/tools/v3-navback.d.ts +0 -17
- package/dist/lib/v3/agent/tools/v3-screenshot.d.ts +0 -13
- package/dist/lib/v3/agent/tools/v3-scroll.d.ts +0 -23
- package/dist/lib/v3/agent/tools/v3-wait.d.ts +0 -19
- package/dist/lib/v3/agent/utils/cuaKeyMapping.d.ts +0 -10
- package/dist/lib/v3/agent/utils/imageCompression.d.ts +0 -18
- package/dist/lib/v3/agent/utils/messageProcessing.d.ts +0 -13
- package/dist/lib/v3/dom/build/scriptV3Content.d.ts +0 -1
- package/dist/lib/v3/dom/genDomScripts.d.ts +0 -1
- package/dist/lib/v3/dom/index.d.ts +0 -1
- package/dist/lib/v3/dom/piercer.entry.d.ts +0 -1
- package/dist/lib/v3/dom/piercer.runtime.d.ts +0 -25
- package/dist/lib/v3/handlers/actHandler.d.ts +0 -18
- package/dist/lib/v3/handlers/extractHandler.d.ts +0 -29
- package/dist/lib/v3/handlers/handlerUtils/actHandlerUtils.d.ts +0 -18
- package/dist/lib/v3/handlers/observeHandler.d.ts +0 -15
- package/dist/lib/v3/handlers/v3AgentHandler.d.ts +0 -17
- package/dist/lib/v3/handlers/v3CuaAgentHandler.d.ts +0 -26
- package/dist/lib/v3/index.d.ts +0 -10
- package/dist/lib/v3/launch/browserbase.d.ts +0 -8
- package/dist/lib/v3/launch/local.d.ts +0 -13
- package/dist/lib/v3/llm/AnthropicClient.d.ts +0 -16
- package/dist/lib/v3/llm/CerebrasClient.d.ts +0 -17
- package/dist/lib/v3/llm/GoogleClient.d.ts +0 -19
- package/dist/lib/v3/llm/GroqClient.d.ts +0 -17
- package/dist/lib/v3/llm/LLMClient.d.ts +0 -99
- package/dist/lib/v3/llm/LLMProvider.d.ts +0 -10
- package/dist/lib/v3/llm/OpenAIClient.d.ts +0 -15
- package/dist/lib/v3/llm/aisdk.d.ts +0 -15
- package/dist/lib/v3/logger.d.ts +0 -48
- package/dist/lib/v3/mcp/connection.d.ts +0 -11
- package/dist/lib/v3/mcp/utils.d.ts +0 -3
- package/dist/lib/v3/tests/default-page-tracking.spec.d.ts +0 -1
- package/dist/lib/v3/tests/perform-understudy-method.spec.d.ts +0 -1
- package/dist/lib/v3/tests/shadow-iframe.spec.d.ts +0 -1
- package/dist/lib/v3/tests/timeouts.spec.d.ts +0 -1
- package/dist/lib/v3/tests/v3.config.d.ts +0 -4
- package/dist/lib/v3/tests/v3.playwright.config.d.ts +0 -2
- package/dist/lib/v3/tests/xpath-for-location-deep.spec.d.ts +0 -1
- package/dist/lib/v3/types/act.d.ts +0 -10
- package/dist/lib/v3/types/agent.d.ts +0 -132
- package/dist/lib/v3/types/api.d.ts +0 -40
- package/dist/lib/v3/types/cache.d.ts +0 -71
- package/dist/lib/v3/types/context.d.ts +0 -2
- package/dist/lib/v3/types/evals.d.ts +0 -71
- package/dist/lib/v3/types/evaluator.d.ts +0 -40
- package/dist/lib/v3/types/llm.d.ts +0 -11
- package/dist/lib/v3/types/log.d.ts +0 -23
- package/dist/lib/v3/types/model.d.ts +0 -20
- package/dist/lib/v3/types/playwright.d.ts +0 -6
- package/dist/lib/v3/types/stagehand.d.ts +0 -113
- package/dist/lib/v3/types/stagehandApiErrors.d.ts +0 -18
- package/dist/lib/v3/types/stagehandErrors.d.ts +0 -104
- package/dist/lib/v3/types.d.ts +0 -176
- package/dist/lib/v3/understudy/a11y/snapshot.d.ts +0 -71
- package/dist/lib/v3/understudy/cdp.d.ts +0 -58
- package/dist/lib/v3/understudy/context.d.ts +0 -120
- package/dist/lib/v3/understudy/deepLocator.d.ts +0 -69
- package/dist/lib/v3/understudy/executionContextRegistry.d.ts +0 -15
- package/dist/lib/v3/understudy/frame.d.ts +0 -63
- package/dist/lib/v3/understudy/frameLocator.d.ts +0 -46
- package/dist/lib/v3/understudy/frameRegistry.d.ts +0 -100
- package/dist/lib/v3/understudy/locator.d.ts +0 -196
- package/dist/lib/v3/understudy/page.d.ts +0 -241
- package/dist/lib/v3/understudy/piercer.d.ts +0 -4
- package/dist/lib/v3/v3.d.ts +0 -156
- package/dist/lib/version.d.ts +0 -5
package/dist/lib/v3/v3.d.ts
DELETED
|
@@ -1,156 +0,0 @@
|
|
|
1
|
-
import { V3Options, ActOptions, ObserveOptions, V3Metrics, V3FunctionName, ExtractOptions } from "@/lib/v3/types";
|
|
2
|
-
import { V3Context } from "@/lib/v3/understudy/context";
|
|
3
|
-
import { LLMClient } from "./llm/LLMClient";
|
|
4
|
-
import { z } from "zod/v3";
|
|
5
|
-
import type { ZodTypeAny } from "zod/v3";
|
|
6
|
-
import { Action, ActResult, HistoryEntry, AgentConfig } from "./types/stagehand";
|
|
7
|
-
import { AgentExecuteOptions, AgentResult } from "./types/agent";
|
|
8
|
-
import { LogLine } from "./types/log";
|
|
9
|
-
import { defaultExtractSchema, pageTextSchema } from "./types";
|
|
10
|
-
import type { AgentReplayStep } from "./types/cache";
|
|
11
|
-
/**
|
|
12
|
-
* V3
|
|
13
|
-
*
|
|
14
|
-
* Purpose:
|
|
15
|
-
* A high-level orchestrator for Stagehand V3. Abstracts away whether the browser
|
|
16
|
-
* runs **locally via Chrome** or remotely on **Browserbase**, and exposes simple
|
|
17
|
-
* entrypoints (`act`, `extract`, `observe`) that delegate to the corresponding
|
|
18
|
-
* handler classes.
|
|
19
|
-
*
|
|
20
|
-
* Responsibilities:
|
|
21
|
-
* - Bootstraps Chrome or Browserbase, ensures a working CDP WebSocket, and builds a `V3Context`.
|
|
22
|
-
* - Manages lifecycle: init, context access, cleanup.
|
|
23
|
-
* - Bridges external page objects (Playwright/Puppeteer) into internal frameIds for handlers.
|
|
24
|
-
* - Provides a stable API surface for downstream code regardless of runtime environment.
|
|
25
|
-
*/
|
|
26
|
-
export declare class V3 {
|
|
27
|
-
private readonly opts;
|
|
28
|
-
private state;
|
|
29
|
-
private actHandler;
|
|
30
|
-
private extractHandler;
|
|
31
|
-
private observeHandler;
|
|
32
|
-
private ctx;
|
|
33
|
-
llmClient: LLMClient;
|
|
34
|
-
private modelName;
|
|
35
|
-
private modelClientOptions;
|
|
36
|
-
private llmProvider;
|
|
37
|
-
private readonly domSettleTimeoutMs?;
|
|
38
|
-
private _isClosing;
|
|
39
|
-
private _onCdpClosed;
|
|
40
|
-
readonly experimental: boolean;
|
|
41
|
-
readonly logInferenceToFile: boolean;
|
|
42
|
-
private externalLogger?;
|
|
43
|
-
verbose: 0 | 1 | 2;
|
|
44
|
-
private _history;
|
|
45
|
-
private readonly instanceId;
|
|
46
|
-
private static _processGuardsInstalled;
|
|
47
|
-
private static _instances;
|
|
48
|
-
private cacheDir?;
|
|
49
|
-
private _agentReplayRecording;
|
|
50
|
-
v3Metrics: V3Metrics;
|
|
51
|
-
/**
|
|
52
|
-
* Async property for metrics so callers can `await v3.metrics`.
|
|
53
|
-
* Returning a Promise future-proofs async aggregation/storage.
|
|
54
|
-
*/
|
|
55
|
-
get metrics(): Promise<V3Metrics>;
|
|
56
|
-
private cloneForCache;
|
|
57
|
-
private beginAgentReplayRecording;
|
|
58
|
-
private endAgentReplayRecording;
|
|
59
|
-
private discardAgentReplayRecording;
|
|
60
|
-
private isAgentReplayRecording;
|
|
61
|
-
isAgentReplayActive(): boolean;
|
|
62
|
-
recordAgentReplayStep(step: AgentReplayStep): void;
|
|
63
|
-
/**
|
|
64
|
-
* Async property for history so callers can `await v3.history`.
|
|
65
|
-
* Returns a frozen copy to avoid external mutation.
|
|
66
|
-
*/
|
|
67
|
-
get history(): Promise<ReadonlyArray<HistoryEntry>>;
|
|
68
|
-
addToHistory(method: HistoryEntry["method"], parameters: unknown, result?: unknown): void;
|
|
69
|
-
updateMetrics(functionName: V3FunctionName, promptTokens: number, completionTokens: number, inferenceTimeMs: number): void;
|
|
70
|
-
private updateTotalMetrics;
|
|
71
|
-
constructor(opts: V3Options);
|
|
72
|
-
private _immediateShutdown;
|
|
73
|
-
private static _installProcessGuards;
|
|
74
|
-
/**
|
|
75
|
-
* Entrypoint: initializes handlers, launches Chrome or Browserbase,
|
|
76
|
-
* and sets up a CDP context.
|
|
77
|
-
*/
|
|
78
|
-
init(): Promise<void>;
|
|
79
|
-
/** Apply post-connect local browser options that require CDP. */
|
|
80
|
-
private _applyPostConnectLocalOptions;
|
|
81
|
-
/**
|
|
82
|
-
* Run an "act" instruction through the ActHandler.
|
|
83
|
-
*
|
|
84
|
-
* New API:
|
|
85
|
-
* - act(instruction: string, options?: ActOptions)
|
|
86
|
-
* - act(action: Action, options?: ActOptions)
|
|
87
|
-
*/
|
|
88
|
-
act(instruction: string, options?: ActOptions): Promise<ActResult>;
|
|
89
|
-
act(action: Action, options?: ActOptions): Promise<ActResult>;
|
|
90
|
-
/**
|
|
91
|
-
* Run an "extract" instruction through the ExtractHandler.
|
|
92
|
-
*
|
|
93
|
-
* Accepted forms:
|
|
94
|
-
* - extract() → pageText
|
|
95
|
-
* - extract(options) → pageText
|
|
96
|
-
* - extract(instruction) → defaultExtractSchema
|
|
97
|
-
* - extract(instruction, schema) → schema-inferred
|
|
98
|
-
* - extract(instruction, schema, options)
|
|
99
|
-
*/
|
|
100
|
-
extract(): Promise<z.infer<typeof pageTextSchema>>;
|
|
101
|
-
extract(options: ExtractOptions): Promise<z.infer<typeof pageTextSchema>>;
|
|
102
|
-
extract(instruction: string, options?: ExtractOptions): Promise<z.infer<typeof defaultExtractSchema>>;
|
|
103
|
-
extract<T extends ZodTypeAny>(instruction: string, schema: T, options?: ExtractOptions): Promise<z.infer<T>>;
|
|
104
|
-
/**
|
|
105
|
-
* Run an "observe" instruction through the ObserveHandler.
|
|
106
|
-
*/
|
|
107
|
-
observe(): Promise<Action[]>;
|
|
108
|
-
observe(options: ObserveOptions): Promise<Action[]>;
|
|
109
|
-
observe(instruction: string, options?: ObserveOptions): Promise<Action[]>;
|
|
110
|
-
/** Return the browser-level CDP WebSocket endpoint. */
|
|
111
|
-
connectURL(): string;
|
|
112
|
-
/** Expose the current CDP-backed context. */
|
|
113
|
-
get context(): V3Context;
|
|
114
|
-
/** Best-effort cleanup of context and launched resources. */
|
|
115
|
-
close(opts?: {
|
|
116
|
-
force?: boolean;
|
|
117
|
-
}): Promise<void>;
|
|
118
|
-
/** Guard: ensure Browserbase credentials exist in options. */
|
|
119
|
-
private requireBrowserbaseCreds;
|
|
120
|
-
get logger(): (logLine: LogLine) => void;
|
|
121
|
-
/**
|
|
122
|
-
* Normalize a Playwright/Puppeteer page object into its top frame id,
|
|
123
|
-
* so handlers can resolve it to a `Page` within our V3Context.
|
|
124
|
-
*/
|
|
125
|
-
private resolveTopFrameId;
|
|
126
|
-
private isPlaywrightPage;
|
|
127
|
-
private isPatchrightPage;
|
|
128
|
-
private isPuppeteerPage;
|
|
129
|
-
private normalizeToV3Page;
|
|
130
|
-
private buildActCacheKey;
|
|
131
|
-
private safeGetPageUrl;
|
|
132
|
-
private readActCacheEntry;
|
|
133
|
-
private writeActCacheEntry;
|
|
134
|
-
private sanitizeAgentExecuteOptions;
|
|
135
|
-
private buildAgentCacheSignature;
|
|
136
|
-
private buildAgentCacheKey;
|
|
137
|
-
private readAgentCacheEntry;
|
|
138
|
-
private writeAgentCacheEntry;
|
|
139
|
-
private replayAgentCacheEntry;
|
|
140
|
-
private executeAgentReplayStep;
|
|
141
|
-
private replayAgentActStep;
|
|
142
|
-
private replayAgentFillFormStep;
|
|
143
|
-
private replayAgentGotoStep;
|
|
144
|
-
private replayAgentScrollStep;
|
|
145
|
-
private replayAgentWaitStep;
|
|
146
|
-
private replayAgentNavBackStep;
|
|
147
|
-
private replayCachedActions;
|
|
148
|
-
private runWithActTimeout;
|
|
149
|
-
/**
|
|
150
|
-
* Create a v3 agent instance (AISDK tool-based) with execute().
|
|
151
|
-
* Mirrors the v2 Stagehand.agent() tool mode (no CUA provider here).
|
|
152
|
-
*/
|
|
153
|
-
agent(options?: AgentConfig): {
|
|
154
|
-
execute: (instructionOrOptions: string | AgentExecuteOptions) => Promise<AgentResult>;
|
|
155
|
-
};
|
|
156
|
-
}
|