Skip to content

Commit

Permalink
🔄 synced local 'skyvern-frontend/src/' with remote 'skyvern-frontend/…
Browse files Browse the repository at this point in the history
…src/'

<!-- ELLIPSIS_HIDDEN -->

> [!IMPORTANT]
> Add `completeCriterion` and `terminateCriterion` fields to `TaskNode` for enhanced task completion criteria handling.
>
>   - **Behavior**:
>     - Add `completeCriterion` and `terminateCriterion` fields to `TaskNode` in `TaskNode.tsx`.
>     - Render `completeCriterion` input in `TaskNode` UI.
>   - **Data Handling**:
>     - Update `TaskNodeData` type in `types.ts` to include `completeCriterion` and `terminateCriterion`.
>     - Modify `convertToNode()` and `getWorkflowBlock()` in `workflowEditorUtils.ts` to handle new fields.
>   - **YAML Conversion**:
>     - Update `TaskBlockYAML` type in `workflowYamlTypes.ts` to include `completeCriterion` and `terminateCriterion`.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis" src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=Skyvern-AI%2Fskyvern-cloud&utm_source=github&utm_medium=referral)<sup> for c2e67dce21e523632dd4fc381e5e01ad4999cc88. It will automatically update as commits are pushed.</sup>

<!-- ELLIPSIS_HIDDEN -->
  • Loading branch information
wintonzheng committed Dec 13, 2024
1 parent 31c1993 commit 88ed706
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ function LoginNode({ id, data }: NodeProps<LoginNode>) {
}

return (
<div className="relative">
<div>
<Handle
type="source"
position={Position.Bottom}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ function NavigationNode({ id, data }: NodeProps<NavigationNode>) {
}

return (
<div className="relative">
<div>
<Handle
type="source"
position={Position.Bottom}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
url: data.url,
navigationGoal: data.navigationGoal,
dataExtractionGoal: data.dataExtractionGoal,
completeCriterion: data.completeCriterion,
terminateCriterion: data.terminateCriterion,
dataSchema: data.dataSchema,
maxRetries: data.maxRetries,
maxStepsOverride: data.maxStepsOverride,
Expand All @@ -72,7 +74,7 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
}

return (
<div className="relative">
<div>
<Handle
type="source"
position={Position.Bottom}
Expand Down Expand Up @@ -223,6 +225,20 @@ function TaskNode({ id, data }: NodeProps<TaskNode>) {
<AccordionTrigger>Advanced Settings</AccordionTrigger>
<AccordionContent className="pl-6 pr-1 pt-1">
<div className="space-y-4">
<div className="space-y-2">
<Label className="text-xs text-slate-300">
Complete if...
</Label>
<WorkflowBlockInputTextarea
nodeId={id}
onChange={(value) => {
handleChange("completeCriterion", value);
}}
value={inputs.completeCriterion}
className="nopan text-xs"
/>
</div>
<Separator />
<div className="flex items-center justify-between">
<div className="flex gap-2">
<Label className="text-xs font-normal text-slate-300">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ export type TaskNodeData = NodeBaseData & {
dataExtractionGoal: string;
errorCodeMapping: string;
dataSchema: string;
completeCriterion: string;
terminateCriterion: string;
maxRetries: number | null;
maxStepsOverride: number | null;
allowDownloads: boolean;
Expand All @@ -25,6 +27,8 @@ export const taskNodeDefaultData: TaskNodeData = {
dataExtractionGoal: "",
errorCodeMapping: "null",
dataSchema: "null",
completeCriterion: "",
terminateCriterion: "",
maxRetries: null,
maxStepsOverride: null,
allowDownloads: false,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,8 @@ function convertToNode(
totpIdentifier: block.totp_identifier ?? null,
totpVerificationUrl: block.totp_verification_url ?? null,
cacheActions: block.cache_actions,
completeCriterion: block.complete_criterion ?? "",
terminateCriterion: block.terminate_criterion ?? "",
},
};
}
Expand Down Expand Up @@ -802,6 +804,8 @@ function getWorkflowBlock(node: WorkflowBlockNode): BlockYAML {
title: node.data.label,
navigation_goal: node.data.navigationGoal,
data_extraction_goal: node.data.dataExtractionGoal,
complete_criterion: node.data.completeCriterion,
terminate_criterion: node.data.terminateCriterion,
data_schema: JSONParseSafe(node.data.dataSchema),
error_code_mapping: JSONParseSafe(node.data.errorCodeMapping) as Record<
string,
Expand Down Expand Up @@ -1427,6 +1431,8 @@ function convertBlocksToBlockYAML(
url: block.url,
navigation_goal: block.navigation_goal,
data_extraction_goal: block.data_extraction_goal,
complete_criterion: block.complete_criterion,
terminate_criterion: block.terminate_criterion,
data_schema: block.data_schema,
error_code_mapping: block.error_code_mapping,
max_retries: block.max_retries,
Expand Down
2 changes: 2 additions & 0 deletions skyvern-frontend/src/routes/workflows/types/workflowTypes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ export type TaskBlock = WorkflowBlockBase & {
navigation_goal: string | null;
data_extraction_goal: string | null;
data_schema: Record<string, unknown> | null;
complete_criterion: string | null;
terminate_criterion: string | null;
error_code_mapping: Record<string, string> | null;
max_retries?: number;
max_steps_per_run?: number | null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export type TaskBlockYAML = BlockYAMLBase & {
totp_verification_url?: string | null;
totp_identifier?: string | null;
cache_actions: boolean;
complete_criterion: string | null;
terminate_criterion: string | null;
};

export type ValidationBlockYAML = BlockYAMLBase & {
Expand Down

0 comments on commit 88ed706

Please sign in to comment.