@browserbasehq/orca 3.0.1 → 3.0.2
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 +43 -7
- package/dist/index.js +560 -318
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -199,11 +199,7 @@ declare class CdpConnection implements CDPSessionLike {
|
|
|
199
199
|
close(): Promise<void>;
|
|
200
200
|
getSession(sessionId: string): CdpSession | undefined;
|
|
201
201
|
attachToTarget(targetId: string): Promise<CdpSession>;
|
|
202
|
-
getTargets(): Promise<
|
|
203
|
-
targetId: string;
|
|
204
|
-
type: string;
|
|
205
|
-
url: string;
|
|
206
|
-
}>>;
|
|
202
|
+
getTargets(): Promise<Protocol.Target.TargetInfo[]>;
|
|
207
203
|
private onMessage;
|
|
208
204
|
_sendViaSession<R = unknown>(sessionId: string, method: string, params?: object): Promise<R>;
|
|
209
205
|
_onSessionEvent(sessionId: string, event: string, handler: EventHandler): void;
|
|
@@ -723,6 +719,14 @@ declare class Response$1 {
|
|
|
723
719
|
* richer metadata.
|
|
724
720
|
*/
|
|
725
721
|
applyExtraInfo(event: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
|
|
722
|
+
/**
|
|
723
|
+
* Internal helper for creating a Response object from a Serializable
|
|
724
|
+
* goto response from the Stagehand API
|
|
725
|
+
*/
|
|
726
|
+
static fromSerializable(serialized: SerializableResponse, context: {
|
|
727
|
+
page: Page;
|
|
728
|
+
session: CDPSessionLike;
|
|
729
|
+
}): Response$1;
|
|
726
730
|
/** Marks the response as finished and resolves the `finished()` promise. */
|
|
727
731
|
markFinished(error: Error | null): void;
|
|
728
732
|
}
|
|
@@ -745,7 +749,7 @@ declare class StagehandAPIClient {
|
|
|
745
749
|
observe({ instruction, options, frameId, }: APIObserveParameters): Promise<Action[]>;
|
|
746
750
|
goto(url: string, options?: {
|
|
747
751
|
waitUntil?: "load" | "domcontentloaded" | "networkidle";
|
|
748
|
-
}, frameId?: string): Promise<
|
|
752
|
+
}, frameId?: string): Promise<SerializableResponse | null>;
|
|
749
753
|
agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
|
|
750
754
|
end(): Promise<Response>;
|
|
751
755
|
getReplayMetrics(): Promise<StagehandMetrics>;
|
|
@@ -1500,6 +1504,9 @@ declare class ExperimentalApiConflictError extends StagehandError {
|
|
|
1500
1504
|
declare class ExperimentalNotConfiguredError extends StagehandError {
|
|
1501
1505
|
constructor(featureName: string);
|
|
1502
1506
|
}
|
|
1507
|
+
declare class CuaModelRequiredError extends StagehandError {
|
|
1508
|
+
constructor(availableModels: readonly string[]);
|
|
1509
|
+
}
|
|
1503
1510
|
declare class ZodSchemaValidationError extends Error {
|
|
1504
1511
|
readonly received: unknown;
|
|
1505
1512
|
readonly issues: ReturnType<ZodError["format"]>;
|
|
@@ -1522,6 +1529,24 @@ declare class StagehandShadowSegmentEmptyError extends StagehandError {
|
|
|
1522
1529
|
declare class StagehandShadowSegmentNotFoundError extends StagehandError {
|
|
1523
1530
|
constructor(segment: string, hint?: string);
|
|
1524
1531
|
}
|
|
1532
|
+
declare class ElementNotVisibleError extends StagehandError {
|
|
1533
|
+
constructor(selector: string);
|
|
1534
|
+
}
|
|
1535
|
+
declare class ResponseBodyError extends StagehandError {
|
|
1536
|
+
constructor(message: string);
|
|
1537
|
+
}
|
|
1538
|
+
declare class ResponseParseError extends StagehandError {
|
|
1539
|
+
constructor(message: string);
|
|
1540
|
+
}
|
|
1541
|
+
declare class TimeoutError extends StagehandError {
|
|
1542
|
+
constructor(operation: string, timeoutMs: number);
|
|
1543
|
+
}
|
|
1544
|
+
declare class PageNotFoundError extends StagehandError {
|
|
1545
|
+
constructor(identifier: string);
|
|
1546
|
+
}
|
|
1547
|
+
declare class ConnectionTimeoutError extends StagehandError {
|
|
1548
|
+
constructor(message: string);
|
|
1549
|
+
}
|
|
1525
1550
|
|
|
1526
1551
|
declare class AISdkClient extends LLMClient {
|
|
1527
1552
|
type: "aisdk";
|
|
@@ -1569,6 +1594,16 @@ interface APIObserveParameters {
|
|
|
1569
1594
|
options?: ObserveOptions;
|
|
1570
1595
|
frameId?: string;
|
|
1571
1596
|
}
|
|
1597
|
+
interface SerializableResponse {
|
|
1598
|
+
requestId: string;
|
|
1599
|
+
frameId?: string;
|
|
1600
|
+
loaderId?: string;
|
|
1601
|
+
response: Protocol.Network.Response;
|
|
1602
|
+
fromServiceWorkerFlag?: boolean;
|
|
1603
|
+
finishedSettled?: boolean;
|
|
1604
|
+
extraInfoHeaders?: Protocol.Network.Headers | null;
|
|
1605
|
+
extraInfoHeadersText?: string;
|
|
1606
|
+
}
|
|
1572
1607
|
|
|
1573
1608
|
/**
|
|
1574
1609
|
* Represents a path through a Zod schema from the root object down to a
|
|
@@ -1672,6 +1707,7 @@ declare class V3Context {
|
|
|
1672
1707
|
* We poll internal maps that bootstrap/onAttachedToTarget populate.
|
|
1673
1708
|
*/
|
|
1674
1709
|
private waitForFirstTopLevelPage;
|
|
1710
|
+
private waitForInitialTopLevelTargets;
|
|
1675
1711
|
private ensurePiercer;
|
|
1676
1712
|
/** Mark a page target as the most-recent one (active). */
|
|
1677
1713
|
private _pushActive;
|
|
@@ -2058,4 +2094,4 @@ declare class V3Evaluator {
|
|
|
2058
2094
|
private _evaluateWithMultipleScreenshots;
|
|
2059
2095
|
}
|
|
2060
2096
|
|
|
2061
|
-
export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, type Action, type ActionExecutionResult, type AgentAction, type AgentConfig, type AgentExecuteOptions, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentType, AnnotatedScreenshotText, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClientOptions, type ComputerCallItem, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, type FunctionCallItem, HandlerNotInitializedError, type HistoryEntry, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaProperty, LLMClient, type LLMResponse, LLMResponseError, type LLMTool, LOG_LEVEL_NAMES, type LoadState, type LocalBrowserLaunchOptions, type LogLevel, type LogLine, type Logger, MCPConnectionError, MissingEnvironmentVariableError, MissingLLMConfigurationError, type ModelConfiguration, type ModelProvider, type ObserveOptions, Page, Response$1 as Response, type ResponseInputItem, type ResponseItem, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, type ToolUseItem, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, jsonSchemaToZod, loadApiKeyFromEnv, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, transformSchema, trimTrailingTextNode, validateZodSchema };
|
|
2097
|
+
export { type AISDKCustomProvider, type AISDKProvider, AISdkClient, AVAILABLE_CUA_MODELS, type ActOptions, type ActResult, type Action, type ActionExecutionResult, type AgentAction, type AgentConfig, type AgentExecuteOptions, type AgentExecutionOptions, type AgentHandlerOptions, type AgentInstance, type AgentModelConfig, AgentProvider, type AgentProviderType, type AgentResult, AgentScreenshotProviderError, type AgentType, AnnotatedScreenshotText, type AnthropicContentBlock, type AnthropicJsonSchemaObject, type AnthropicMessage, type AnthropicTextBlock, type AnthropicToolResult, type AnyPage, type AvailableCuaModel, type AvailableModel, BrowserbaseSessionNotFoundError, CaptchaTimeoutError, type ChatCompletionOptions, type ChatMessage, type ChatMessageContent, type ChatMessageImageContent, type ChatMessageTextContent, type ClientOptions, type ComputerCallItem, ConnectionTimeoutError, type ConsoleListener, ConsoleMessage, ContentFrameNotFoundError, type CreateChatCompletionOptions, CreateChatCompletionResponseError, CuaModelRequiredError, ElementNotVisibleError, ExperimentalApiConflictError, ExperimentalNotConfiguredError, type ExtractOptions, type ExtractResult, type FunctionCallItem, HandlerNotInitializedError, type HistoryEntry, InvalidAISDKModelFormatError, type JsonSchema, type JsonSchemaProperty, LLMClient, type LLMResponse, LLMResponseError, type LLMTool, LOG_LEVEL_NAMES, type LoadState, type LocalBrowserLaunchOptions, type LogLevel, type LogLine, type Logger, MCPConnectionError, MissingEnvironmentVariableError, MissingLLMConfigurationError, type ModelConfiguration, type ModelProvider, type ObserveOptions, Page, PageNotFoundError, Response$1 as Response, ResponseBodyError, type ResponseInputItem, type ResponseItem, ResponseParseError, V3 as Stagehand, StagehandAPIError, StagehandAPIUnauthorizedError, StagehandClickError, StagehandDefaultError, StagehandDomProcessError, StagehandElementNotFoundError, StagehandEnvironmentError, StagehandError, StagehandEvalError, StagehandHttpError, StagehandIframeError, StagehandInitError, StagehandInvalidArgumentError, type StagehandMetrics, StagehandMissingArgumentError, StagehandNotInitializedError, StagehandResponseBodyError, StagehandResponseParseError, StagehandServerError, StagehandShadowRootMissingError, StagehandShadowSegmentEmptyError, StagehandShadowSegmentNotFoundError, TimeoutError, type ToolUseItem, UnsupportedAISDKModelProviderError, UnsupportedModelError, UnsupportedModelProviderError, V3, type V3Env, V3Evaluator, V3FunctionName, type V3Options, XPathResolutionError, ZodSchemaValidationError, connectToMCPServer, defaultExtractSchema, getZodType, injectUrls, isRunningInBun, jsonSchemaToZod, loadApiKeyFromEnv, modelToAgentProviderMap, pageTextSchema, providerEnvVarMap, toGeminiSchema, transformSchema, trimTrailingTextNode, validateZodSchema };
|