@@ -266,6 +266,7 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
266266 type : 'dropdown' as SubBlockType ,
267267 options : [
268268 { label : 'Read' , id : 'file_parser_v3' } ,
269+ { label : 'Get' , id : 'file_get' } ,
269270 { label : 'Write' , id : 'file_write' } ,
270271 { label : 'Append' , id : 'file_append' } ,
271272 ] ,
@@ -294,6 +295,28 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
294295 required : { field : 'operation' , value : 'file_parser_v3' } ,
295296 condition : { field : 'operation' , value : 'file_parser_v3' } ,
296297 } ,
298+ {
299+ id : 'getFile' ,
300+ title : 'File' ,
301+ type : 'file-upload' as SubBlockType ,
302+ canonicalParamId : 'getFileInput' ,
303+ acceptedTypes : '*' ,
304+ placeholder : 'Select a workspace file' ,
305+ multiple : false ,
306+ mode : 'basic' ,
307+ condition : { field : 'operation' , value : 'file_get' } ,
308+ required : { field : 'operation' , value : 'file_get' } ,
309+ } ,
310+ {
311+ id : 'getFileId' ,
312+ title : 'File ID' ,
313+ type : 'short-input' as SubBlockType ,
314+ canonicalParamId : 'getFileInput' ,
315+ placeholder : 'Workspace file ID' ,
316+ mode : 'advanced' ,
317+ condition : { field : 'operation' , value : 'file_get' } ,
318+ required : { field : 'operation' , value : 'file_get' } ,
319+ } ,
297320 {
298321 id : 'fileName' ,
299322 title : 'File Name' ,
@@ -349,7 +372,7 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
349372 } ,
350373 ] ,
351374 tools : {
352- access : [ 'file_parser_v3' , 'file_write' , 'file_append' ] ,
375+ access : [ 'file_parser_v3' , 'file_get' , ' file_write', 'file_append' ] ,
353376 config : {
354377 tool : ( params ) => params . operation || 'file_parser_v3' ,
355378 params : ( params ) => {
@@ -390,6 +413,25 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
390413 }
391414 }
392415
416+ if ( operation === 'file_get' ) {
417+ const getInput = params . getFileInput
418+ if ( ! getInput ) {
419+ throw new Error ( 'File is required for get' )
420+ }
421+
422+ if ( typeof getInput === 'string' ) {
423+ return {
424+ fileId : getInput . trim ( ) ,
425+ workspaceId : params . _context ?. workspaceId ,
426+ }
427+ }
428+
429+ return {
430+ fileInput : normalizeFileInput ( getInput , { single : true } ) ,
431+ workspaceId : params . _context ?. workspaceId ,
432+ }
433+ }
434+
393435 const fileInput = params . fileInput
394436 if ( ! fileInput ) {
395437 logger . error ( 'No file input provided' )
@@ -428,9 +470,13 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
428470 } ,
429471 } ,
430472 inputs : {
431- operation : { type : 'string' , description : 'Operation to perform (read, write, or append)' } ,
473+ operation : {
474+ type : 'string' ,
475+ description : 'Operation to perform (read, get, write, or append)' ,
476+ } ,
432477 fileInput : { type : 'json' , description : 'File input for read' } ,
433478 fileType : { type : 'string' , description : 'File type for read' } ,
479+ getFileInput : { type : 'json' , description : 'Selected file or workspace file ID for get' } ,
434480 fileName : { type : 'string' , description : 'Name for a new file (write)' } ,
435481 content : { type : 'string' , description : 'File content to write' } ,
436482 contentType : { type : 'string' , description : 'MIME content type for write' } ,
@@ -446,6 +492,10 @@ export const FileV3Block: BlockConfig<FileParserV3Output> = {
446492 type : 'string' ,
447493 description : 'All file contents merged into a single text string (read)' ,
448494 } ,
495+ file : {
496+ type : 'file' ,
497+ description : 'Workspace file object (get)' ,
498+ } ,
449499 id : {
450500 type : 'string' ,
451501 description : 'File ID (write)' ,
0 commit comments