SDK: support select_option and extract (#3850)

This commit is contained in:
Stanislav Novosad
2025-10-30 09:05:20 -06:00
committed by GitHub
parent ac069838c7
commit af9a5f31e4
21 changed files with 774 additions and 124 deletions

View File

@@ -0,0 +1,27 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../../index.js";
/**
* @example
* {
* "x-user-agent": "x-user-agent",
* url: "url",
* action: {
* type: "ai_click"
* }
* }
*/
export interface RunSdkActionRequest {
"x-user-agent"?: string;
/** The URL where the action should be executed */
url: string;
/** The browser session ID */
browser_session_id?: string;
/** The browser address */
browser_address?: string;
/** Optional workflow run ID to continue an existing workflow run */
workflow_run_id?: string;
/** The action to execute with its specific parameters */
action: Skyvern.SdkAction;
}

View File

@@ -7,6 +7,7 @@ export type { GetRunArtifactsRequest } from "./GetRunArtifactsRequest.js";
export type { GetScriptsRequest } from "./GetScriptsRequest.js";
export type { GetWorkflowsRequest } from "./GetWorkflowsRequest.js";
export type { LoginRequest } from "./LoginRequest.js";
export type { RunSdkActionRequest } from "./RunSdkActionRequest.js";
export type { RunTaskRequest } from "./RunTaskRequest.js";
export type { RunWorkflowRequest } from "./RunWorkflowRequest.js";
export type { TotpCodeCreate } from "./TotpCodeCreate.js";

View File

@@ -0,0 +1,19 @@
// This file was auto-generated by Fern from our API Definition.
export interface ClickAction {
/** CSS selector for the element */
selector?: string;
/** The intention or goal of the click */
intention?: string;
/** Additional context data */
data?: ClickAction.Data;
/** Timeout in milliseconds */
timeout?: number;
}
export namespace ClickAction {
/**
* Additional context data
*/
export type Data = string | Record<string, unknown>;
}

View File

@@ -0,0 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
export interface ExtractAction {
/** Extraction prompt */
prompt?: string;
/** Schema for extraction */
extract_schema?: ExtractAction.ExtractSchema;
/** Error code mapping for extraction */
error_code_mapping?: Record<string, string | undefined>;
/** The intention or goal of the extraction */
intention?: string;
/** Additional context data */
data?: ExtractAction.Data;
}
export namespace ExtractAction {
/**
* Schema for extraction
*/
export type ExtractSchema = Record<string, unknown> | unknown[] | string;
/**
* Additional context data
*/
export type Data = string | Record<string, unknown>;
}

View File

@@ -0,0 +1,25 @@
// This file was auto-generated by Fern from our API Definition.
export interface InputTextAction {
/** CSS selector for the element */
selector?: string;
/** Value to input */
value?: string;
/** The intention or goal of the input */
intention?: string;
/** Additional context data */
data?: InputTextAction.Data;
/** TOTP identifier for input_text actions */
totp_identifier?: string;
/** TOTP URL for input_text actions */
totp_url?: string;
/** Timeout in milliseconds */
timeout?: number;
}
export namespace InputTextAction {
/**
* Additional context data
*/
export type Data = string | Record<string, unknown>;
}

View File

@@ -0,0 +1,15 @@
// This file was auto-generated by Fern from our API Definition.
export interface RunSdkActionResponse {
/** The workflow run ID used for this action */
workflow_run_id: string;
/** The result from the action (e.g., selector, value, extracted data) */
result?: RunSdkActionResponse.Result;
}
export namespace RunSdkActionResponse {
/**
* The result from the action (e.g., selector, value, extracted data)
*/
export type Result = string | Record<string, unknown> | unknown[] | number | boolean;
}

View File

@@ -0,0 +1,27 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export type SdkAction =
| Skyvern.SdkAction.AiClick
| Skyvern.SdkAction.AiInputText
| Skyvern.SdkAction.AiSelectOption
| Skyvern.SdkAction.Extract;
export namespace SdkAction {
export interface AiClick extends Skyvern.ClickAction {
type: "ai_click";
}
export interface AiInputText extends Skyvern.InputTextAction {
type: "ai_input_text";
}
export interface AiSelectOption extends Skyvern.SelectOptionAction {
type: "ai_select_option";
}
export interface Extract extends Skyvern.ExtractAction {
type: "extract";
}
}

View File

@@ -0,0 +1,21 @@
// This file was auto-generated by Fern from our API Definition.
export interface SelectOptionAction {
/** CSS selector for the element */
selector?: string;
/** Value to select */
value?: string;
/** The intention or goal of the selection */
intention?: string;
/** Additional context data */
data?: SelectOptionAction.Data;
/** Timeout in milliseconds */
timeout?: number;
}
export namespace SelectOptionAction {
/**
* Additional context data
*/
export type Data = string | Record<string, unknown>;
}

View File

@@ -19,6 +19,7 @@ export * from "./BitwardenSensitiveInformationParameter.js";
export * from "./BitwardenSensitiveInformationParameterYaml.js";
export * from "./BlockType.js";
export * from "./BrowserSessionResponse.js";
export * from "./ClickAction.js";
export * from "./CodeBlock.js";
export * from "./CodeBlockParametersItem.js";
export * from "./CodeBlockYaml.js";
@@ -33,6 +34,7 @@ export * from "./CredentialTypeOutput.js";
export * from "./CreditCardCredentialResponse.js";
export * from "./DownloadToS3Block.js";
export * from "./DownloadToS3BlockYaml.js";
export * from "./ExtractAction.js";
export * from "./ExtractionBlock.js";
export * from "./ExtractionBlockParametersItem.js";
export * from "./ExtractionBlockYaml.js";
@@ -62,6 +64,7 @@ export * from "./HumanInteractionBlock.js";
export * from "./HumanInteractionBlockParametersItem.js";
export * from "./HumanInteractionBlockYaml.js";
export * from "./InputOrSelectContext.js";
export * from "./InputTextAction.js";
export * from "./LoginBlock.js";
export * from "./LoginBlockParametersItem.js";
export * from "./LoginBlockYaml.js";
@@ -80,11 +83,14 @@ export * from "./PdfParserBlock.js";
export * from "./PdfParserBlockYaml.js";
export * from "./ProxyLocation.js";
export * from "./RunEngine.js";
export * from "./RunSdkActionResponse.js";
export * from "./RunStatus.js";
export * from "./Script.js";
export * from "./ScriptFileCreate.js";
export * from "./ScriptRunResponse.js";
export * from "./SdkAction.js";
export * from "./SelectOption.js";
export * from "./SelectOptionAction.js";
export * from "./SendEmailBlock.js";
export * from "./SendEmailBlockYaml.js";
export * from "./SkyvernForgeSdkSchemasCredentialsCredentialType.js";