@browserbasehq/stagehand 3.0.2-alpha-b9bf78453a2bf531b3069e5e185784839af082aa → 3.1.0-alpha-7e72adfd7e4af5ec49ac2f552e7f1f57c1acc554
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 +41 -2
- package/dist/index.js +505 -316
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -723,6 +723,14 @@ declare class Response$1 {
|
|
|
723
723
|
* richer metadata.
|
|
724
724
|
*/
|
|
725
725
|
applyExtraInfo(event: Protocol.Network.ResponseReceivedExtraInfoEvent): void;
|
|
726
|
+
/**
|
|
727
|
+
* Internal helper for creating a Response object from a Serializable
|
|
728
|
+
* goto response from the Stagehand API
|
|
729
|
+
*/
|
|
730
|
+
static fromSerializable(serialized: SerializableResponse, context: {
|
|
731
|
+
page: Page;
|
|
732
|
+
session: CDPSessionLike;
|
|
733
|
+
}): Response$1;
|
|
726
734
|
/** Marks the response as finished and resolves the `finished()` promise. */
|
|
727
735
|
markFinished(error: Error | null): void;
|
|
728
736
|
}
|
|
@@ -745,7 +753,7 @@ declare class StagehandAPIClient {
|
|
|
745
753
|
observe({ instruction, options, frameId, }: APIObserveParameters): Promise<Action[]>;
|
|
746
754
|
goto(url: string, options?: {
|
|
747
755
|
waitUntil?: "load" | "domcontentloaded" | "networkidle";
|
|
748
|
-
}, frameId?: string): Promise<
|
|
756
|
+
}, frameId?: string): Promise<SerializableResponse | null>;
|
|
749
757
|
agentExecute(agentConfig: AgentConfig, executeOptions: AgentExecuteOptions | string, frameId?: string): Promise<AgentResult>;
|
|
750
758
|
end(): Promise<Response>;
|
|
751
759
|
getReplayMetrics(): Promise<StagehandMetrics>;
|
|
@@ -1500,6 +1508,9 @@ declare class ExperimentalApiConflictError extends StagehandError {
|
|
|
1500
1508
|
declare class ExperimentalNotConfiguredError extends StagehandError {
|
|
1501
1509
|
constructor(featureName: string);
|
|
1502
1510
|
}
|
|
1511
|
+
declare class CuaModelRequiredError extends StagehandError {
|
|
1512
|
+
constructor(availableModels: readonly string[]);
|
|
1513
|
+
}
|
|
1503
1514
|
declare class ZodSchemaValidationError extends Error {
|
|
1504
1515
|
readonly received: unknown;
|
|
1505
1516
|
readonly issues: ReturnType<ZodError["format"]>;
|
|
@@ -1522,6 +1533,24 @@ declare class StagehandShadowSegmentEmptyError extends StagehandError {
|
|
|
1522
1533
|
declare class StagehandShadowSegmentNotFoundError extends StagehandError {
|
|
1523
1534
|
constructor(segment: string, hint?: string);
|
|
1524
1535
|
}
|
|
1536
|
+
declare class ElementNotVisibleError extends StagehandError {
|
|
1537
|
+
constructor(selector: string);
|
|
1538
|
+
}
|
|
1539
|
+
declare class ResponseBodyError extends StagehandError {
|
|
1540
|
+
constructor(message: string);
|
|
1541
|
+
}
|
|
1542
|
+
declare class ResponseParseError extends StagehandError {
|
|
1543
|
+
constructor(message: string);
|
|
1544
|
+
}
|
|
1545
|
+
declare class TimeoutError extends StagehandError {
|
|
1546
|
+
constructor(operation: string, timeoutMs: number);
|
|
1547
|
+
}
|
|
1548
|
+
declare class PageNotFoundError extends StagehandError {
|
|
1549
|
+
constructor(identifier: string);
|
|
1550
|
+
}
|
|
1551
|
+
declare class ConnectionTimeoutError extends StagehandError {
|
|
1552
|
+
constructor(message: string);
|
|
1553
|
+
}
|
|
1525
1554
|
|
|
1526
1555
|
declare class AISdkClient extends LLMClient {
|
|
1527
1556
|
type: "aisdk";
|
|
@@ -1569,6 +1598,16 @@ interface APIObserveParameters {
|
|
|
1569
1598
|
options?: ObserveOptions;
|
|
1570
1599
|
frameId?: string;
|
|
1571
1600
|
}
|
|
1601
|
+
interface SerializableResponse {
|
|
1602
|
+
requestId: string;
|
|
1603
|
+
frameId?: string;
|
|
1604
|
+
loaderId?: string;
|
|
1605
|
+
response: Protocol.Network.Response;
|
|
1606
|
+
fromServiceWorkerFlag?: boolean;
|
|
1607
|
+
finishedSettled?: boolean;
|
|
1608
|
+
extraInfoHeaders?: Protocol.Network.Headers | null;
|
|
1609
|
+
extraInfoHeadersText?: string;
|
|
1610
|
+
}
|
|
1572
1611
|
|
|
1573
1612
|
/**
|
|
1574
1613
|
* Represents a path through a Zod schema from the root object down to a
|
|
@@ -2058,4 +2097,4 @@ declare class V3Evaluator {
|
|
|
2058
2097
|
private _evaluateWithMultipleScreenshots;
|
|
2059
2098
|
}
|
|
2060
2099
|
|
|
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 };
|
|
2100
|
+
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 };
|