Fern: generated SDK post processing (#3840)

This commit is contained in:
Stanislav Novosad
2025-10-28 18:14:54 -06:00
committed by GitHub
parent d1008959b0
commit 12e83cdf9a
15 changed files with 182 additions and 10 deletions

View File

@@ -3,3 +3,13 @@
CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') CURRENT_VERSION=$(grep '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/')
fern generate --group python-sdk --log-level debug --version "$CURRENT_VERSION" --preview fern generate --group python-sdk --log-level debug --version "$CURRENT_VERSION" --preview
cp -rf fern/.preview/fern-python-sdk/src/skyvern/* skyvern/client/ cp -rf fern/.preview/fern-python-sdk/src/skyvern/* skyvern/client/
# Post-processing: Patch version.py to handle missing metadata gracefully
VERSION_FILE="skyvern/client/version.py"
if [ -f "$VERSION_FILE" ]; then
sed -i.bak 's/__version__ = metadata\.version("skyvern")/try:\
__version__ = metadata.version("skyvern")\
except Exception:\
__version__ = "0.0.0"/' "$VERSION_FILE"
rm -f "${VERSION_FILE}.bak"
fi

View File

@@ -10,3 +10,8 @@ fern generate --group ts-sdk --log-level debug --version "$CURRENT_VERSION" --pr
&& node scripts/rename-to-esm-files.js dist/esm) && node scripts/rename-to-esm-files.js dist/esm)
cp -rf fern/.preview/fern-typescript-sdk/* skyvern-ts/client/ cp -rf fern/.preview/fern-typescript-sdk/* skyvern-ts/client/
# Post-processing: Update repository references the monorepo
sed -i.bak 's|Skyvern-AI/skyvern-typescript|Skyvern-AI/skyvern|g' skyvern-ts/client/package.json
sed -i.bak 's|https://github.com/Skyvern-AI/skyvern-typescript/blob/HEAD/./reference.md|https://www.skyvern.com/docs/api-reference/api-reference|g' skyvern-ts/client/README.md
rm -f skyvern-ts/client/package.json.bak skyvern-ts/client/README.md.bak

View File

@@ -13,7 +13,7 @@ npm i -s @skyvern/client
## Reference ## Reference
A full reference for this library is available [here](https://github.com/Skyvern-AI/skyvern-typescript/blob/HEAD/./reference.md). A full reference for this library is available [here](https://www.skyvern.com/docs/api-reference/api-reference).
## Usage ## Usage

View File

@@ -1843,9 +1843,9 @@
} }
}, },
"node_modules/electron-to-chromium": { "node_modules/electron-to-chromium": {
"version": "1.5.240", "version": "1.5.241",
"resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.240.tgz", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.241.tgz",
"integrity": "sha512-OBwbZjWgrCOH+g6uJsA2/7Twpas2OlepS9uvByJjR2datRDuKGYeD+nP8lBBks2qnB7bGJNHDUx7c/YLaT3QMQ==", "integrity": "sha512-ILMvKX/ZV5WIJzzdtuHg8xquk2y0BOGlFOxBVwTpbiXqWIH0hamG45ddU4R3PQ0gYu+xgo0vdHXHli9sHIGb4w==",
"dev": true, "dev": true,
"license": "ISC" "license": "ISC"
}, },
@@ -3044,9 +3044,9 @@
} }
}, },
"node_modules/vite-node/node_modules/@types/node": { "node_modules/vite-node/node_modules/@types/node": {
"version": "24.9.1", "version": "24.9.2",
"resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.1.tgz", "resolved": "https://registry.npmjs.org/@types/node/-/node-24.9.2.tgz",
"integrity": "sha512-QoiaXANRkSXK6p0Duvt56W208du4P9Uye9hWLWgGMDTEoKPhuenzNcC4vGUmrNkiOKTlIrBoyNQYNpSwfEZXSg==", "integrity": "sha512-uWN8YqxXxqFMX2RqGOrumsKeti4LlmIMIyV0lgut4jx7KQBcBiW6vkDtIBvHnHIquwNfJhk8v2OtmO8zXWHfPA==",
"dev": true, "dev": true,
"license": "MIT", "license": "MIT",
"optional": true, "optional": true,

View File

@@ -2,7 +2,7 @@
"name": "@skyvern/client", "name": "@skyvern/client",
"version": "0.2.20", "version": "0.2.20",
"private": false, "private": false,
"repository": "github:Skyvern-AI/skyvern-typescript", "repository": "github:Skyvern-AI/skyvern",
"type": "commonjs", "type": "commonjs",
"main": "./dist/cjs/index.js", "main": "./dist/cjs/index.js",
"module": "./dist/esm/index.mjs", "module": "./dist/esm/index.mjs",

View File

@@ -13,6 +13,7 @@ export const ActionType = {
Terminate: "terminate", Terminate: "terminate",
Complete: "complete", Complete: "complete",
ReloadPage: "reload_page", ReloadPage: "reload_page",
ClosePage: "close_page",
Extract: "extract", Extract: "extract",
VerificationCode: "verification_code", VerificationCode: "verification_code",
GotoUrl: "goto_url", GotoUrl: "goto_url",

View File

@@ -21,5 +21,6 @@ export const BlockType = {
GotoUrl: "goto_url", GotoUrl: "goto_url",
PdfParser: "pdf_parser", PdfParser: "pdf_parser",
HttpRequest: "http_request", HttpRequest: "http_request",
HumanInteraction: "human_interaction",
} as const; } as const;
export type BlockType = (typeof BlockType)[keyof typeof BlockType]; export type BlockType = (typeof BlockType)[keyof typeof BlockType];

View File

@@ -13,6 +13,7 @@ export type ForLoopBlockLoopBlocksItem =
| Skyvern.ForLoopBlockLoopBlocksItem.ForLoop | Skyvern.ForLoopBlockLoopBlocksItem.ForLoop
| Skyvern.ForLoopBlockLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockLoopBlocksItem.GotoUrl
| Skyvern.ForLoopBlockLoopBlocksItem.HttpRequest | Skyvern.ForLoopBlockLoopBlocksItem.HttpRequest
| Skyvern.ForLoopBlockLoopBlocksItem.HumanInteraction
| Skyvern.ForLoopBlockLoopBlocksItem.Login | Skyvern.ForLoopBlockLoopBlocksItem.Login
| Skyvern.ForLoopBlockLoopBlocksItem.Navigation | Skyvern.ForLoopBlockLoopBlocksItem.Navigation
| Skyvern.ForLoopBlockLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockLoopBlocksItem.PdfParser
@@ -65,6 +66,10 @@ export namespace ForLoopBlockLoopBlocksItem {
block_type: "http_request"; block_type: "http_request";
} }
export interface HumanInteraction extends Skyvern.HumanInteractionBlock {
block_type: "human_interaction";
}
export interface Login extends Skyvern.LoginBlock { export interface Login extends Skyvern.LoginBlock {
block_type: "login"; block_type: "login";
} }

View File

@@ -18,6 +18,7 @@ export type ForLoopBlockYamlLoopBlocksItem =
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Extraction | Skyvern.ForLoopBlockYamlLoopBlocksItem.Extraction
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Login | Skyvern.ForLoopBlockYamlLoopBlocksItem.Login
| Skyvern.ForLoopBlockYamlLoopBlocksItem.Wait | Skyvern.ForLoopBlockYamlLoopBlocksItem.Wait
| Skyvern.ForLoopBlockYamlLoopBlocksItem.HumanInteraction
| Skyvern.ForLoopBlockYamlLoopBlocksItem.FileDownload | Skyvern.ForLoopBlockYamlLoopBlocksItem.FileDownload
| Skyvern.ForLoopBlockYamlLoopBlocksItem.GotoUrl | Skyvern.ForLoopBlockYamlLoopBlocksItem.GotoUrl
| Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser | Skyvern.ForLoopBlockYamlLoopBlocksItem.PdfParser
@@ -85,6 +86,10 @@ export namespace ForLoopBlockYamlLoopBlocksItem {
block_type: "wait"; block_type: "wait";
} }
export interface HumanInteraction extends Skyvern.HumanInteractionBlockYaml {
block_type: "human_interaction";
}
export interface FileDownload extends Skyvern.FileDownloadBlockYaml { export interface FileDownload extends Skyvern.FileDownloadBlockYaml {
block_type: "file_download"; block_type: "file_download";
} }

View File

@@ -0,0 +1,55 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
/**
* A block for human/agent interaction.
*
* For the first pass at this, the implicit behaviour is that the user is given a single binary
* choice (a go//no-go).
*
* If the human:
* - chooses positively, the workflow continues
* - chooses negatively, the workflow is terminated
* - does not respond within the timeout period, the workflow terminates
*/
export interface HumanInteractionBlock {
label: string;
output_parameter: Skyvern.OutputParameter;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
disable_cache?: boolean;
task_type?: string;
url?: string;
title?: string;
engine?: Skyvern.RunEngine;
complete_criterion?: string;
terminate_criterion?: string;
navigation_goal?: string;
data_extraction_goal?: string;
data_schema?: HumanInteractionBlock.DataSchema;
error_code_mapping?: Record<string, string | undefined>;
max_retries?: number;
max_steps_per_run?: number;
parameters?: Skyvern.HumanInteractionBlockParametersItem[];
complete_on_download?: boolean;
download_suffix?: string;
totp_verification_url?: string;
totp_identifier?: string;
cache_actions?: boolean;
complete_verification?: boolean;
include_action_history_in_verification?: boolean;
download_timeout?: number;
instructions?: string;
positive_descriptor?: string;
negative_descriptor?: string;
timeout_seconds?: number;
sender?: string;
recipients?: string[];
subject?: string;
body?: string;
}
export namespace HumanInteractionBlock {
export type DataSchema = Record<string, unknown> | unknown[] | string;
}

View File

@@ -0,0 +1,62 @@
// This file was auto-generated by Fern from our API Definition.
import type * as Skyvern from "../index.js";
export type HumanInteractionBlockParametersItem =
| Skyvern.HumanInteractionBlockParametersItem.AwsSecret
| Skyvern.HumanInteractionBlockParametersItem.AzureSecret
| Skyvern.HumanInteractionBlockParametersItem.AzureVaultCredential
| Skyvern.HumanInteractionBlockParametersItem.BitwardenCreditCardData
| Skyvern.HumanInteractionBlockParametersItem.BitwardenLoginCredential
| Skyvern.HumanInteractionBlockParametersItem.BitwardenSensitiveInformation
| Skyvern.HumanInteractionBlockParametersItem.Context
| Skyvern.HumanInteractionBlockParametersItem.Credential
| Skyvern.HumanInteractionBlockParametersItem.Onepassword
| Skyvern.HumanInteractionBlockParametersItem.Output
| Skyvern.HumanInteractionBlockParametersItem.Workflow;
export namespace HumanInteractionBlockParametersItem {
export interface AwsSecret extends Skyvern.AwsSecretParameter {
parameter_type: "aws_secret";
}
export interface AzureSecret extends Skyvern.AzureSecretParameter {
parameter_type: "azure_secret";
}
export interface AzureVaultCredential extends Skyvern.AzureVaultCredentialParameter {
parameter_type: "azure_vault_credential";
}
export interface BitwardenCreditCardData extends Skyvern.BitwardenCreditCardDataParameter {
parameter_type: "bitwarden_credit_card_data";
}
export interface BitwardenLoginCredential extends Skyvern.BitwardenLoginCredentialParameter {
parameter_type: "bitwarden_login_credential";
}
export interface BitwardenSensitiveInformation extends Skyvern.BitwardenSensitiveInformationParameter {
parameter_type: "bitwarden_sensitive_information";
}
export interface Context extends Skyvern.ContextParameter {
parameter_type: "context";
}
export interface Credential extends Skyvern.CredentialParameter {
parameter_type: "credential";
}
export interface Onepassword extends Skyvern.OnePasswordCredentialParameter {
parameter_type: "onepassword";
}
export interface Output extends Skyvern.OutputParameter {
parameter_type: "output";
}
export interface Workflow extends Skyvern.WorkflowParameter {
parameter_type: "workflow";
}
}

View File

@@ -0,0 +1,15 @@
// This file was auto-generated by Fern from our API Definition.
export interface HumanInteractionBlockYaml {
label: string;
continue_on_failure?: boolean;
model?: Record<string, unknown>;
instructions?: string;
positive_descriptor?: string;
negative_descriptor?: string;
timeout_seconds: number;
sender: string;
recipients: string[];
subject: string;
body: string;
}

View File

@@ -13,6 +13,7 @@ export type WorkflowDefinitionBlocksItem =
| Skyvern.WorkflowDefinitionBlocksItem.ForLoop | Skyvern.WorkflowDefinitionBlocksItem.ForLoop
| Skyvern.WorkflowDefinitionBlocksItem.GotoUrl | Skyvern.WorkflowDefinitionBlocksItem.GotoUrl
| Skyvern.WorkflowDefinitionBlocksItem.HttpRequest | Skyvern.WorkflowDefinitionBlocksItem.HttpRequest
| Skyvern.WorkflowDefinitionBlocksItem.HumanInteraction
| Skyvern.WorkflowDefinitionBlocksItem.Login | Skyvern.WorkflowDefinitionBlocksItem.Login
| Skyvern.WorkflowDefinitionBlocksItem.Navigation | Skyvern.WorkflowDefinitionBlocksItem.Navigation
| Skyvern.WorkflowDefinitionBlocksItem.PdfParser | Skyvern.WorkflowDefinitionBlocksItem.PdfParser
@@ -65,6 +66,10 @@ export namespace WorkflowDefinitionBlocksItem {
block_type: "http_request"; block_type: "http_request";
} }
export interface HumanInteraction extends Skyvern.HumanInteractionBlock {
block_type: "human_interaction";
}
export interface Login extends Skyvern.LoginBlock { export interface Login extends Skyvern.LoginBlock {
block_type: "login"; block_type: "login";
} }

View File

@@ -13,6 +13,7 @@ export type WorkflowDefinitionYamlBlocksItem =
| Skyvern.WorkflowDefinitionYamlBlocksItem.ForLoop | Skyvern.WorkflowDefinitionYamlBlocksItem.ForLoop
| Skyvern.WorkflowDefinitionYamlBlocksItem.GotoUrl | Skyvern.WorkflowDefinitionYamlBlocksItem.GotoUrl
| Skyvern.WorkflowDefinitionYamlBlocksItem.HttpRequest | Skyvern.WorkflowDefinitionYamlBlocksItem.HttpRequest
| Skyvern.WorkflowDefinitionYamlBlocksItem.HumanInteraction
| Skyvern.WorkflowDefinitionYamlBlocksItem.Login | Skyvern.WorkflowDefinitionYamlBlocksItem.Login
| Skyvern.WorkflowDefinitionYamlBlocksItem.Navigation | Skyvern.WorkflowDefinitionYamlBlocksItem.Navigation
| Skyvern.WorkflowDefinitionYamlBlocksItem.PdfParser | Skyvern.WorkflowDefinitionYamlBlocksItem.PdfParser
@@ -65,6 +66,10 @@ export namespace WorkflowDefinitionYamlBlocksItem {
block_type: "http_request"; block_type: "http_request";
} }
export interface HumanInteraction extends Skyvern.HumanInteractionBlockYaml {
block_type: "human_interaction";
}
export interface Login extends Skyvern.LoginBlockYaml { export interface Login extends Skyvern.LoginBlockYaml {
block_type: "login"; block_type: "login";
} }

View File

@@ -58,6 +58,9 @@ export * from "./HttpRequestBlock.js";
export * from "./HttpRequestBlockParametersItem.js"; export * from "./HttpRequestBlockParametersItem.js";
export * from "./HttpRequestBlockYaml.js"; export * from "./HttpRequestBlockYaml.js";
export * from "./HttpValidationError.js"; export * from "./HttpValidationError.js";
export * from "./HumanInteractionBlock.js";
export * from "./HumanInteractionBlockParametersItem.js";
export * from "./HumanInteractionBlockYaml.js";
export * from "./InputOrSelectContext.js"; export * from "./InputOrSelectContext.js";
export * from "./LoginBlock.js"; export * from "./LoginBlock.js";
export * from "./LoginBlockParametersItem.js"; export * from "./LoginBlockParametersItem.js";