diff --git a/skyvern-frontend/src/api/types.ts b/skyvern-frontend/src/api/types.ts index 8d4fbee3..8f775630 100644 --- a/skyvern-frontend/src/api/types.ts +++ b/skyvern-frontend/src/api/types.ts @@ -147,6 +147,7 @@ export type CreateTaskRequest = { application?: string | null; include_action_history_in_verification?: boolean | null; max_screenshot_scrolls?: number | null; + browser_address?: string | null; }; export type User = { diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx index 19c85198..9e16ef2b 100644 --- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx +++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskForm.tsx @@ -90,6 +90,7 @@ function createTaskRequestObject( extracted_information_schema: extractedInformationSchema, extra_http_headers: extraHttpHeaders, totp_identifier: transform(formValues.totpIdentifier), + browser_address: transform(formValues.cdpAddress), error_code_mapping: errorCodeMapping, max_screenshot_scrolls: formValues.maxScreenshotScrolls, include_action_history_in_verification: @@ -127,6 +128,7 @@ function CreateNewTaskForm({ initialValues }: Props) { maxStepsOverride: initialValues.maxStepsOverride ?? null, proxyLocation: initialValues.proxyLocation ?? ProxyLocation.Residential, maxScreenshotScrolls: initialValues.maxScreenshotScrolls ?? null, + cdpAddress: initialValues.cdpAddress ?? null, }, }); const { errors } = useFormState({ control: form.control }); @@ -695,6 +697,35 @@ function CreateNewTaskForm({ initialValues }: Props) { )} /> + ( + +
+ +
+

Browser Address

+

+ The address of the Browser server to use for the + task run. +

+
+
+
+ + + + +
+
+
+ )} + /> )} diff --git a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx index c5fc6e99..095c7e07 100644 --- a/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx +++ b/skyvern-frontend/src/routes/tasks/create/CreateNewTaskFormPage.tsx @@ -64,6 +64,7 @@ function CreateNewTaskFormPage() { includeActionHistoryInVerification: null, maxScreenshotScrolls: null, extraHttpHeaders: null, + cdpAddress: null, }} /> @@ -137,6 +138,7 @@ function CreateNewTaskFormPage() { extraHttpHeaders: data.extra_http_headers ? JSON.stringify(data.extra_http_headers) : null, + cdpAddress: null, }} /> diff --git a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx index 6c63feb4..57a18d1d 100644 --- a/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx +++ b/skyvern-frontend/src/routes/tasks/create/PromptBox.tsx @@ -155,6 +155,7 @@ function PromptBox() { ProxyLocation.Residential, ); const [browserSessionId, setBrowserSessionId] = useState(null); + const [cdpAddress, setCdpAddress] = useState(null); const [publishWorkflow, setPublishWorkflow] = useState(false); const [totpIdentifier, setTotpIdentifier] = useState(""); const [maxStepsOverride, setMaxStepsOverride] = useState(null); @@ -175,6 +176,7 @@ function PromptBox() { webhook_callback_url: webhookCallbackUrl, proxy_location: proxyLocation, browser_session_id: browserSessionId, + browser_address: cdpAddress, totp_identifier: totpIdentifier, publish_workflow: publishWorkflow, max_screenshot_scrolls: maxScreenshotScrolls, @@ -412,6 +414,22 @@ function PromptBox() { }} /> +
+
+
Browser Address
+
+ The address of the Browser server to use for the task + run. +
+
+ { + setCdpAddress(event.target.value); + }} + /> +
2FA Identifier
diff --git a/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx b/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx index e9b01153..123ef149 100644 --- a/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx +++ b/skyvern-frontend/src/routes/tasks/create/retry/RetryTask.tsx @@ -48,6 +48,7 @@ function RetryTask() { extraHttpHeaders: task.request.extra_http_headers ? JSON.stringify(task.request.extra_http_headers) : null, + cdpAddress: task.request.browser_address ?? null, }} />
diff --git a/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts b/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts index fa52bf53..2c6e45ca 100644 --- a/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts +++ b/skyvern-frontend/src/routes/tasks/create/taskFormTypes.ts @@ -13,6 +13,7 @@ const createNewTaskFormSchemaBase = z.object({ extraHttpHeaders: z.string().or(z.null()), maxStepsOverride: z.number().or(z.null()).optional(), totpIdentifier: z.string().or(z.null()), + cdpAddress: z.string().or(z.null()), errorCodeMapping: z.string().or(z.null()), proxyLocation: z.nativeEnum(ProxyLocation).or(z.null()), includeActionHistoryInVerification: z.boolean().or(z.null()).default(false), diff --git a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx index 9391d1cb..23a655e4 100644 --- a/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx +++ b/skyvern-frontend/src/routes/workflows/RunWorkflowForm.tsx @@ -38,6 +38,7 @@ type Props = { initialSettings: { proxyLocation: ProxyLocation; webhookCallbackUrl: string; + cdpAddress: string | null; maxScreenshotScrolls: number | null; extraHttpHeaders: Record | null; }; @@ -81,6 +82,7 @@ type RunWorkflowRequestBody = { browser_session_id: string | null; max_screenshot_scrolls?: number | null; extra_http_headers?: Record | null; + browser_address?: string | null; }; function getRunWorkflowRequestBody( @@ -91,6 +93,7 @@ function getRunWorkflowRequestBody( webhookCallbackUrl, proxyLocation, browserSessionId, + cdpAddress, maxScreenshotScrolls, extraHttpHeaders, ...parameters @@ -107,6 +110,7 @@ function getRunWorkflowRequestBody( data: parsedParameters, proxy_location: proxyLocation, browser_session_id: bsi, + browser_address: cdpAddress, }; if (maxScreenshotScrolls) { @@ -133,6 +137,7 @@ type RunWorkflowFormType = Record & { webhookCallbackUrl: string; proxyLocation: ProxyLocation; browserSessionId: string | null; + cdpAddress: string | null; maxScreenshotScrolls: number | null; extraHttpHeaders: string | null; }; @@ -156,6 +161,7 @@ function RunWorkflowForm({ webhookCallbackUrl: initialSettings.webhookCallbackUrl, proxyLocation: initialSettings.proxyLocation, browserSessionId: browserSessionIdDefault, + cdpAddress: initialSettings.cdpAddress, maxScreenshotScrolls: initialSettings.maxScreenshotScrolls, extraHttpHeaders: initialSettings.extraHttpHeaders ? JSON.stringify(initialSettings.extraHttpHeaders) @@ -208,6 +214,7 @@ function RunWorkflowForm({ browserSessionId, maxScreenshotScrolls, extraHttpHeaders, + cdpAddress, ...parameters } = values; @@ -222,6 +229,7 @@ function RunWorkflowForm({ browserSessionId, maxScreenshotScrolls, extraHttpHeaders, + cdpAddress, }); } @@ -425,6 +433,42 @@ function RunWorkflowForm({ ); }} /> + { + return ( + +
+ +
+
+ Browser Address +
+

+ The address of the Browser server to use for the + workflow run. +

+
+
+
+ + + + +
+
+
+ ); + }} + />