No code has been generated yet.
@@ -110,6 +101,19 @@ function WorkflowRunCode(props?: Props) {
);
}
+ if (!showCacheKeyValueSelector || !cacheKey || cacheKey === "") {
+ return (
+
+ );
+ }
+
const cacheKeyValueSet = new Set([...(cacheKeyValues?.values ?? [])]);
const cacheKeyValueForWorkflowRun = constructCacheKeyValue({
@@ -123,87 +127,52 @@ function WorkflowRunCode(props?: Props) {
}
return (
-
- {isGeneratingCode && (
-
-
- Generating code...
-
-
-
-
+
+
+
+
+
- )}
- {couldBeGeneratingCode && (
-
- )}
- {showCacheKeyValueSelector && cacheKey && cacheKey !== "" && (
-
-
-
-
-
-
-
- )}
- {(isGeneratingCode || (code && code.length > 0)) && (
-
- )}
+
+
+
);
}
diff --git a/skyvern-frontend/src/store/UiStore.ts b/skyvern-frontend/src/store/UiStore.ts
deleted file mode 100644
index 117742b8..00000000
--- a/skyvern-frontend/src/store/UiStore.ts
+++ /dev/null
@@ -1,69 +0,0 @@
-/**
- * UI Store: put UI-only state here, that needs to be shared across components, tabs, and
- * potentially browser refreshes.
- */
-
-import { create } from "zustand";
-
-const namespace = "skyvern.ui" as const;
-
-const write = (key: string, value: unknown) => {
- try {
- const serialized = JSON.stringify(value);
- localStorage.setItem(makeKey(key), serialized);
- } catch (error) {
- console.error("Error writing to localStorage:", error);
- }
-};
-
-const read =
(
- key: string,
- validator: (v: T) => boolean,
- defaultValue: T,
-): T => {
- try {
- const serialized = localStorage.getItem(makeKey(key));
-
- if (serialized === null) {
- return defaultValue;
- }
-
- const value = JSON.parse(serialized) as T;
-
- if (validator(value)) {
- return value;
- }
-
- return defaultValue;
- } catch (error) {
- return defaultValue;
- }
-};
-
-const makeKey = (name: string) => {
- return `${namespace}.${name}`;
-};
-
-type UiStore = {
- highlightGenerateCodeToggle: boolean;
- setHighlightGenerateCodeToggle: (v: boolean) => void;
-};
-
-/**
- * There's gotta be a way to remove this boilerplate and keep type-safety (no time)...
- */
-const useUiStore = create((set) => {
- return {
- highlightGenerateCodeToggle: read(
- makeKey("highlightGenerateCodeToggle"),
- (v) => typeof v === "boolean",
- false,
- ),
- setHighlightGenerateCodeToggle: (v: boolean) => {
- set({ highlightGenerateCodeToggle: v });
- write(makeKey("highlightGenerateCodeToggle"), v);
- },
- };
-});
-
-export { useUiStore };
diff --git a/skyvern/forge/sdk/schemas/task_v2.py b/skyvern/forge/sdk/schemas/task_v2.py
index e0c09b43..d162929f 100644
--- a/skyvern/forge/sdk/schemas/task_v2.py
+++ b/skyvern/forge/sdk/schemas/task_v2.py
@@ -157,6 +157,7 @@ class TaskV2Request(BaseModel):
extra_http_headers: dict[str, str] | None = None
browser_address: str | None = None
generate_script: bool = False
+ ai_fallback: bool = False
@field_validator("url", "webhook_callback_url", "totp_verification_url")
@classmethod