@@ -3,7 +3,7 @@ import { DropboxIcon } from '@/components/icons'
33import { getScopesForService } from '@/lib/oauth/utils'
44import type { BlockConfig , BlockMeta } from '@/blocks/types'
55import { AuthMode , IntegrationType } from '@/blocks/types'
6- import { normalizeFileInput } from '@/blocks/utils'
6+ import { normalizeFileInput , toolCallArg } from '@/blocks/utils'
77
88/*
99 * Canonical basic/advanced pair for the upload source, shared by the card
@@ -190,6 +190,14 @@ export const DropboxBlock = {
190190 placeholder : '500' ,
191191 condition : { field : 'operation' , value : 'dropbox_list_folder' } ,
192192 } ,
193+ {
194+ id : 'listFolderCursor' ,
195+ title : 'Cursor' ,
196+ type : 'short-input' ,
197+ placeholder : 'Cursor from a previous call, to fetch the next page' ,
198+ condition : { field : 'operation' , value : 'dropbox_list_folder' } ,
199+ mode : 'advanced' ,
200+ } ,
193201 {
194202 id : 'path' ,
195203 title : 'Folder Path' ,
@@ -347,6 +355,14 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
347355 placeholder : '100' ,
348356 condition : { field : 'operation' , value : 'dropbox_search' } ,
349357 } ,
358+ {
359+ id : 'searchCursor' ,
360+ title : 'Cursor' ,
361+ type : 'short-input' ,
362+ placeholder : 'Cursor from a previous call, to fetch the next page' ,
363+ condition : { field : 'operation' , value : 'dropbox_search' } ,
364+ mode : 'advanced' ,
365+ } ,
350366 {
351367 id : 'path' ,
352368 title : 'Path' ,
@@ -459,8 +475,15 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
459475 return 'dropbox_upload'
460476 }
461477 } ,
462- params : ( params ) => {
478+ params : ( params , context ) => {
463479 const result : Record < string , unknown > = { }
480+ const operation = params . operation ?? context ?. operation
481+ // `cursor` is List Shared Links' field; List Folder and Search page with their own
482+ if ( operation === 'dropbox_list_folder' ) {
483+ result . cursor = params . listFolderCursor || toolCallArg ( context , params . cursor )
484+ } else if ( operation === 'dropbox_search' ) {
485+ result . cursor = params . searchCursor || toolCallArg ( context , params . cursor )
486+ }
464487 if ( params . limit ) result . limit = Number ( params . limit )
465488 if ( params . maxResults ) result . maxResults = Number ( params . maxResults )
466489 const normalizedFile = normalizeFileInput ( params . file , { single : true } )
@@ -494,6 +517,11 @@ Return ONLY the timestamp string - no explanations, no quotes, no extra text.`,
494517 maxResults : { type : 'number' , description : 'Maximum search results' } ,
495518 directOnly : { type : 'boolean' , description : 'Only return direct links, not parent folders' } ,
496519 cursor : { type : 'string' , description : 'Fetch the next page of shared links (pagination)' } ,
520+ listFolderCursor : {
521+ type : 'string' ,
522+ description : 'Fetch the next page of folder entries (pagination)' ,
523+ } ,
524+ searchCursor : { type : 'string' , description : 'Fetch the next page of search results' } ,
497525 beforeRev : { type : 'string' , description : 'Fetch revisions before this one (pagination)' } ,
498526 rev : { type : 'string' , description : 'Revision identifier to restore' } ,
499527 } ,
0 commit comments