Commit 1226ccd
committed
feat(files): folder operations for the File block, and folders as scope
Adds folder operations to file_v5 and the agent tool surface, and makes a folder
a scope on the file operations that already existed rather than a second set of
operations beside them.
New operations: List, Create Folder, Move Folder, Delete Folder, Restore Folder,
and Move File. List answers "what is in here" — subfolders and files together,
direct children by default, the whole subtree under Recursive, subject to Max
Depth and Search. Entries are a discriminated union on kind, and the listing is
capped with a truncated flag rather than unbounded now that it includes files.
Read, Get Content, Compress and Append gain an optional Folder above their file
picker. It narrows what the picker offers; on the three read operations it also
stands for that folder's files when none are picked, resolved when the workflow
runs so a file added later is included. Append only narrows the picker, but the
folder does travel when the advanced entry supplies a name rather than an id,
because a name is only unique inside a folder. Write gains a folder destination,
placed above File Name because it names where before it names what.
Two things are worth a reviewer's attention.
Path handling. Two spellings circulate: the stored display path, which
backslash-escapes a slash inside a folder name, and the canonical
percent-encoded path the tools take. A folder genuinely named "Q3/Q4" is one
level in both and two if either is split on "/". folderPathSegments picks the
parser by the leading slash the canonical form always carries, and
resolveFolderIdsForPaths, isFileInFolderScope and selectDirectoryEntries are
pure and tested against exactly that case. Where a folder is known, the code
resolves by id and never builds a path-shaped reference at all.
Delete Folder's recursive flag is a guard, not a scope. Without it, deleting a
non-empty folder fails, and it is user-only so a model asked to clean up a
folder cannot set it on a guess. This is deliberately the inverse of the read
family's Include Subfolders, which is a scope and defaults on.
Five file operations widen from copilot-only delegation to admit the executor,
each justified by a tool in this change: files.list and files.folders.list for
file_list, and files.folders.update / delete / restore for their tools. Principal
kinds are unchanged and copilot keeps every operation it had.1 parent 65a58a8 commit 1226ccd
46 files changed
Lines changed: 4114 additions & 153 deletions
File tree
- apps
- docs/content/docs/integrations
- sim
- app/workspace/[workspaceId]/w
- [workflowId]/components
- panel/components/editor/components/sub-block
- components
- file-upload
- sim-folder-tree-selector
- hooks
- workflow-block
- components/preview/components/preview-workflow/components/block
- blocks
- blocks
- lib
- api/contracts/tools
- folders
- internal
- file
- tool-operations
- uploads/contexts/workspace
- workflows
- comparison
- subblocks
- workspace-files
- application
- tools
- file
- generated
- packages/workflow-types/src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
47 | 49 | | |
48 | 50 | | |
49 | 51 | | |
| |||
61 | 63 | | |
62 | 64 | | |
63 | 65 | | |
| 66 | + | |
| 67 | + | |
64 | 68 | | |
65 | 69 | | |
66 | 70 | | |
| |||
125 | 129 | | |
126 | 130 | | |
127 | 131 | | |
| 132 | + | |
128 | 133 | | |
129 | 134 | | |
130 | 135 | | |
| |||
148 | 153 | | |
149 | 154 | | |
150 | 155 | | |
| 156 | + | |
151 | 157 | | |
152 | 158 | | |
153 | 159 | | |
| |||
169 | 175 | | |
170 | 176 | | |
171 | 177 | | |
| 178 | + | |
| 179 | + | |
172 | 180 | | |
173 | 181 | | |
174 | 182 | | |
| |||
223 | 231 | | |
224 | 232 | | |
225 | 233 | | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
226 | 344 | | |
Lines changed: 93 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
17 | 19 | | |
18 | 20 | | |
19 | 21 | | |
| |||
45 | 47 | | |
46 | 48 | | |
47 | 49 | | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
48 | 55 | | |
49 | 56 | | |
50 | 57 | | |
| |||
55 | 62 | | |
56 | 63 | | |
57 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
58 | 91 | | |
59 | 92 | | |
60 | 93 | | |
61 | 94 | | |
62 | 95 | | |
63 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
64 | 115 | | |
65 | 116 | | |
66 | 117 | | |
| |||
180 | 231 | | |
181 | 232 | | |
182 | 233 | | |
| 234 | + | |
183 | 235 | | |
184 | 236 | | |
185 | 237 | | |
| |||
274 | 326 | | |
275 | 327 | | |
276 | 328 | | |
277 | | - | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
278 | 363 | | |
279 | 364 | | |
280 | 365 | | |
| |||
486 | 571 | | |
487 | 572 | | |
488 | 573 | | |
| 574 | + | |
| 575 | + | |
489 | 576 | | |
490 | 577 | | |
491 | 578 | | |
| |||
620 | 707 | | |
621 | 708 | | |
622 | 709 | | |
623 | | - | |
| 710 | + | |
624 | 711 | | |
625 | 712 | | |
626 | 713 | | |
627 | | - | |
| 714 | + | |
628 | 715 | | |
629 | 716 | | |
630 | 717 | | |
| |||
638 | 725 | | |
639 | 726 | | |
640 | 727 | | |
641 | | - | |
| 728 | + | |
642 | 729 | | |
643 | 730 | | |
644 | 731 | | |
645 | | - | |
| 732 | + | |
646 | 733 | | |
647 | 734 | | |
648 | 735 | | |
649 | 736 | | |
650 | 737 | | |
651 | | - | |
| 738 | + | |
652 | 739 | | |
653 | 740 | | |
654 | 741 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
26 | 27 | | |
27 | 28 | | |
28 | 29 | | |
| |||
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments