add linter and packed output

This commit is contained in:
2026-03-31 19:32:27 -07:00
parent 10f8eee25c
commit cd2722f845
9 changed files with 1287 additions and 11 deletions

View File

@@ -20,12 +20,13 @@ function getInputEntries(definition) {
];
}
function sanitizeWidgetValues(widgetValues, definition) {
function sanitizeWidgetValues(widgetValues, definition, preservedPaths) {
const nextValues = { ...(widgetValues || {}) };
getInputEntries(definition).forEach(([inputName, inputDef]) => {
const type = getSocketType(inputDef);
if (type === 'FILE_PICKER' || type === 'FOLDER_PICKER') {
if (preservedPaths && preservedPaths.has(nextValues[inputName])) return;
nextValues[inputName] = '';
}
});
@@ -33,7 +34,7 @@ function sanitizeWidgetValues(widgetValues, definition) {
return nextValues;
}
export function hydrateWorkflowState(data, defs = {}) {
export function hydrateWorkflowState(data, defs = {}, { preservedPaths } = {}) {
const loadedNodes = Array.isArray(data?.nodes) ? data.nodes : [];
const loadedEdges = Array.isArray(data?.edges) ? data.edges : [];
@@ -52,7 +53,7 @@ export function hydrateWorkflowState(data, defs = {}) {
data: {
...node.data,
label: node.data?.label || node.data?.className || 'Node',
widgetValues: sanitizeWidgetValues(node.data?.widgetValues, definition),
widgetValues: sanitizeWidgetValues(node.data?.widgetValues, definition, preservedPaths),
runtimeValues: sanitizeRuntimeValuesForPersistence(
node.data?.className,
node.data?.runtimeValues,