Skip to content

Commit 2affc59

Browse files
committed
address comment
1 parent 609c6ce commit 2affc59

File tree

1 file changed

+11
-0
lines changed
  • apps/sim/lib/copilot/orchestrator/tool-executor

1 file changed

+11
-0
lines changed

apps/sim/lib/copilot/orchestrator/tool-executor/index.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ import type {
6969
MoveFolderParams,
7070
MoveWorkflowParams,
7171
OpenResourceParams,
72+
OpenResourceType,
7273
RenameFolderParams,
7374
RenameWorkflowParams,
7475
RunBlockParams,
@@ -107,6 +108,12 @@ import {
107108
} from './workflow-tools'
108109

109110
const logger = createLogger('CopilotToolExecutor')
111+
const VALID_OPEN_RESOURCE_TYPES = new Set<OpenResourceType>([
112+
'workflow',
113+
'table',
114+
'knowledgebase',
115+
'file',
116+
])
110117

111118
function validateOpenResourceParams(
112119
params: OpenResourceParams
@@ -115,6 +122,10 @@ function validateOpenResourceParams(
115122
return { success: false, error: 'type is required' }
116123
}
117124

125+
if (!VALID_OPEN_RESOURCE_TYPES.has(params.type)) {
126+
return { success: false, error: `Invalid resource type: ${params.type}` }
127+
}
128+
118129
if (!params.id) {
119130
return { success: false, error: `${params.type} resources require \`id\`` }
120131
}

0 commit comments

Comments
 (0)