+ {/* Header */}
+
+
+
+ #{ruleEditorProps.operationIndex + 1}
+
+
+ {getOperationSummary(operation, ruleEditorProps.operationIndex)}
+
+
+
+
+
+
+
+
+ {/* Operation type + path */}
+
+
+
+
+
+ {(meta.path || meta.pathOptional) && (
+
+
+
+ ruleEditorProps.updateOperation(operation.id, {
+ path: e.target.value,
+ })
+ }
+ placeholder={getModePathPlaceholder(mode)}
+ className='h-9'
+ />
+
+ )}
+
+
+ {/* Mode description */}
+ {MODE_DESCRIPTIONS[mode] && (
+
+ {t(MODE_DESCRIPTIONS[mode])}
+
+ )}
+
+ {/* Description */}
+
+
+
+
+ {operation.description.length}/180
+
+
+
+ ruleEditorProps.updateOperation(operation.id, {
+ description: e.target.value,
+ })
+ }
+ placeholder={t(
+ 'e.g. Clean tool parameters to avoid upstream validation errors'
+ )}
+ maxLength={180}
+ className='h-9'
+ />
+
+
+ {/* Value section */}
+ {meta.value &&
+ (mode === 'return_error' && ruleEditorProps.returnErrorDraft ? (
+
+ ) : mode === 'prune_objects' && ruleEditorProps.pruneObjectsDraft ? (
+
+ ) : (
+
+
+
+ {operation.value_text.trim().startsWith('{') && (
+
+ )}
+
+
+ ))}
+
+ {/* keep_origin */}
+ {meta.keepOrigin && (
+
+
+ {t('Keep original value (skip if target exists)')}
+
+
+ ruleEditorProps.updateOperation(operation.id, {
+ keep_origin: checked,
+ })
+ }
+ />
+
+ )}
+
+ {/* sync_fields */}
+ {mode === 'sync_fields' && syncFromTarget && syncToTarget ? (
+
+ ) : (meta.from || meta.to !== undefined) && mode !== 'sync_fields' ? (
+
+ ) : null}
+
+ {/* Conditions */}
+
+
+
+ {t('Conditions')}
+
+
+
+ {conditions.length > 0 && (
+ <>
+
+
+ >
+ )}
+
+
+
+
+ {conditions.length === 0 ? (
+
+ {t('When no conditions are set, the operation always executes.')}
+
+ ) : (
+
+ {conditions.map((condition, conditionIndex) => (
+
+ ruleEditorProps.setExpandedConditions((prev) => ({
+ ...prev,
+ [condition.id]: expanded,
+ }))
+ }
+ updateCondition={ruleEditorProps.updateCondition}
+ removeCondition={ruleEditorProps.removeCondition}
+ />
+ ))}
+
+ )}
+
+
+