Title: feat(tables): folder tools for the Table block, and folders as picker scope by mzxchandra · Pull Request #7496 · simstudioai/sim · GitHub
Open Graph Title: feat(tables): folder tools for the Table block, and folders as picker scope by mzxchandra · Pull Request #7496 · simstudioai/sim
X Title: feat(tables): folder tools for the Table block, and folders as picker scope by mzxchandra · Pull Request #7496 · simstudioai/sim
Description: Summary
Adds the six folder tools to the Table block, so an agent can organize tables and not just read them. Rebased onto staging now that the File folder work has landed (#7393).
Tables already had the folder machinery — the five folder operations, their application use cases, and a public v2 route — but no agent-callable tools, so a run could query a table's rows and could not file the table anywhere.
Six tools: table_list_folders, table_create_folder, table_update_folder, table_delete_folder, table_restore_folder, table_move.
Restore is addressed by the path the folder held when it was deleted rather than by id, because that is what restoreTableFolderUseCase takes. The response reports where the folder actually landed, which differs when its old parent is still archived or a live sibling has taken its name.
Executor admission
The folder operations delegated to Copilot only, so every one of these tools would have 403'd. Widened to toolReadOperation / toolWriteOperation(id, 'tables.use'):
Operation
Caller
tables.folders.list
table_list_folders
tables.folders.create
table_create_folder
tables.folders.update
table_update_folder
tables.folders.delete
table_delete_folder
tables.folders.restore
table_restore_folder
tables.update
table_move
table_move reuses updateTableUseCase with only folderPath set rather than growing a second way to move a table. It never sets name or description, so no executor path gains rename powers. check:actorless-executor-operations and check:capability-subject both pass: neither the folder use cases nor updateTableUseCase requires a human subject, so an actorless run (schedule, webhook, deployed API) reaches them without an opaque 500.
Dispatch
In-process, as new cases in executeTableTool. The dispatcher keyed every case to a routed contract, which these have no business inventing — there is no HTTP route for them — so it now carries a response schema, and the folder cases pass standalone schemas through parseInternalOperationInput, the path the Knowledge handler already takes.
Reusing the public v2 folder contracts was the alternative and was rejected: recursive there is a z.stringbool() shaped by URL query encoding, and this flag is the guard between deleting one empty folder and deleting a subtree.
None of the tools sends a workspaceId. The executor mints a delegated principal bound to the run's workspace and the operations read it from there, so accepting one would declare a field the server ignores. table_move is still scoped to its table, but through its own schema: getTableContract, which the older scoped tools use, requires the workspaceId these deliberately omit.
Agent-tool param mapping
A block used as an Agent tool is handed the tool's schema, not its own subblock ids (createLLMToolSchema(toolConfig, ...)), so a model answers with path / folderPath while the canvas stores folderRef / moveTargetRef. Reading only the canvas id dropped the model's answer — and because providers/utils.ts:664 merges with a spread ({ ...result, ...transformed }), returning undefined overwrites the model's value rather than leaving it alone. On move the tool then substituted the workspace root, turning "move into /Reports" into "move to the root" with a success result.
Canvas value wins where the author set one; the model's answer is the fallback, matching what columns already does in this block. update_folder branches on the canvas source instead, because its destination is composed rather than picked and an unset parent is a real destination (the root), not a missing one.
Block surface
Each folder path is a tree selector paired with a manual text entry so a
Open Graph Description: Summary Adds the six folder tools to the Table block, so an agent can organize tables and not just read them. Rebased onto staging now that the File folder work has landed (#7393). Tables already h...
X Description: Summary Adds the six folder tools to the Table block, so an agent can organize tables and not just read them. Rebased onto staging now that the File folder work has landed (#7393). Tables already h...
Opengraph URL: https://github.com/simstudioai/sim/pull/7496
X: @github
Domain: github.com
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /:user_id/:repository/pull/:id/files(.:format) |
| route-controller | pull_requests |
| route-action | files |
| fetch-nonce | v2:606df988-d00d-403b-4614-5b8bd650fbeb |
| current-catalog-service-hash | ae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b |
| request-id | 9674:2F3575:48C45F:6880C6:6AFB3EBD |
| html-safe-nonce | 438d0345ba194105dc8f1ff1ba9e534796169b1549e932f96f611220491b6f16 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5Njc0OjJGMzU3NTo0OEM0NUY6Njg4MEM2OjZBRkIzRUJEIiwidmlzaXRvcl9pZCI6IjgxNDIzOTAxODM5ODM3OTE4MDUiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 494a41d4fc72b2a38576959c8fdcc3339839ebdf9b572bb18adc1fb006dab385 |
| hovercard-subject-tag | pull_request:4447918663 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/simstudioai/sim/pull/7496/files |
| twitter:image | https://avatars.githubusercontent.com/u/129460234?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/129460234?s=400&v=4 |
| og:image:alt | Summary Adds the six folder tools to the Table block, so an agent can organize tables and not just read them. Rebased onto staging now that the File folder work has landed (#7393). Tables already h... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 2169b0dfbef67ed6b128074a5ed45bb7d5d1859783b10178b09a7765ad5f3693 |
| turbo-cache-control | no-preview |
| diff-view | unified |
| go-import | github.com/simstudioai/sim git https://github.com/simstudioai/sim.git |
| octolytics-dimension-user_id | 199344406 |
| octolytics-dimension-user_login | simstudioai |
| octolytics-dimension-repository_id | 912559512 |
| octolytics-dimension-repository_nwo | simstudioai/sim |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 912559512 |
| octolytics-dimension-repository_network_root_nwo | simstudioai/sim |
| turbo-body-classes | logged-out env-production page-responsive full-width |
| disable-turbo | true |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 3b4fc8df5ef1c6757e733a23e6b81b6725021823 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width