Skip to content

Commit 60ebe73

Browse files
committed
defaults for copilot
1 parent 2fd516c commit 60ebe73

File tree

1 file changed

+12
-0
lines changed
  • apps/sim/lib/copilot/tools/server/workflow/edit-workflow

1 file changed

+12
-0
lines changed

apps/sim/lib/copilot/tools/server/workflow/edit-workflow/builders.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,18 @@ export function createBlockFromParams(
130130
}
131131
})
132132

133+
const canonicalIndex = buildCanonicalIndex(blockConfig.subBlocks)
134+
const defaultModes: Record<string, 'basic' | 'advanced'> = {}
135+
for (const group of Object.values(canonicalIndex.groupsById)) {
136+
if (isCanonicalPair(group)) {
137+
defaultModes[group.canonicalId] = 'basic'
138+
}
139+
}
140+
if (Object.keys(defaultModes).length > 0) {
141+
if (!blockState.data) blockState.data = {}
142+
blockState.data.canonicalModes = defaultModes
143+
}
144+
133145
if (validatedInputs) {
134146
updateCanonicalModesForInputs(blockState, Object.keys(validatedInputs), blockConfig)
135147
}

0 commit comments

Comments
 (0)