File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
apps/sim/lib/copilot/orchestrator/tool-executor Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff 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
109110const logger = createLogger ( 'CopilotToolExecutor' )
111+ const VALID_OPEN_RESOURCE_TYPES = new Set < OpenResourceType > ( [
112+ 'workflow' ,
113+ 'table' ,
114+ 'knowledgebase' ,
115+ 'file' ,
116+ ] )
110117
111118function 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 }
You can’t perform that action at this time.
0 commit comments