Filesystem adapter
This adapter gives coding flows sandboxed filesystem access. It can read, write,
edit, delete, list, glob, and grep files, and all of these are confined to a
workspace root. Every action requires workspaceRoot, which is an absolute
path to the project folder. All path and pattern values are confined to that
folder, and any access outside it is refused.
read-file
Section titled “read-file”| Required field | Type | Description |
|---|---|---|
workspaceRoot | string | Absolute path to the project folder |
path | string | File path relative to workspaceRoot |
read_main[action: "Read main"] { adapter: "fs" actionId: "read-file" workspaceRoot: "/Users/me/project" path: "src/main.rs"}write-file
Section titled “write-file”Create or overwrite a file (parent directories auto-created).
| Required field | Type | Description |
|---|---|---|
workspaceRoot | string | Absolute path to the project folder |
path | string | File path relative to workspaceRoot |
content | string | Full file contents to write |
write_cfg[action: "Write config"] { adapter: "fs" actionId: "write-file" workspaceRoot: "/Users/me/project" path: "config/app.toml" content: "debug = true"}edit-file
Section titled “edit-file”Replace an exact substring in a file (must be unique unless replaceAll).
| Field | Type | Description |
|---|---|---|
workspaceRoot (required) | string | Absolute path to the project folder |
path (required) | string | File path relative to workspaceRoot |
oldString (required) | string | Exact text to replace; must occur once unless replaceAll |
newString (required) | string | Replacement text |
replaceAll (optional) | bool | Replace every occurrence (default false) |
bump[action: "Bump version"] { adapter: "fs" actionId: "edit-file" workspaceRoot: "/Users/me/project" path: "Cargo.toml" oldString: "version = \"0.1.0\"" newString: "version = \"0.2.0\""}delete-file
Section titled “delete-file”Delete a single file inside the workspace. This works on a file, not a directory. Deletions are flagged by the destructive-action gate.
rm_lock[action: "Remove lockfile"] { adapter: "fs" actionId: "delete-file" workspaceRoot: "/Users/me/project" path: "package-lock.json"}list-dir
Section titled “list-dir”List the immediate files and subdirectories of a directory. Optional path
defaults to the workspace root itself.
ls_src[action: "List src"] { adapter: "fs" actionId: "list-dir" workspaceRoot: "/Users/me/project" path: "src"}List files matching a glob pattern.
find_rs[action: "Find Rust files"] { adapter: "fs" actionId: "glob" workspaceRoot: "/Users/me/project" pattern: "src/**/*.rs"}Search file contents by regex, per line. Optional glob restricts the search
to matching files (default **/*).
find_todo[action: "Find TODOs"] { adapter: "fs" actionId: "grep" workspaceRoot: "/Users/me/project" pattern: "TODO|FIXME" glob: "src/**/*.rs"}