FileSystem
Configure the React Native native file-system tools to list, read, download, push, copy, move, and delete files inside approved roots.
Register the Suite
await Ansight.initializeAndActivate(
Ansight.createOptionsBuilder()
.withFileSystemTools({
additionalRoots: [{ alias: "exports", path: "/tmp/app-exports" }],
})
.withReadOnlyToolAccess()
.build(),
);
Registration API
withFileSystemTools(options): configures native file-system tool options.remoteTools.fileSystem.additionalRoots: exposes additional approved roots.
Specific Concerns
- All access is constrained to approved native roots.
- File contents are sensitive even when only read tools are enabled.
- Write tools require
withReadWriteToolAccess()orwithAllToolAccess(). - Delete tools require
withAllToolAccess().
Tool Matrix
| Name | Id | Scope | Description | Security |
|---|---|---|---|---|
List Directory | files.list_directory | Read | Lists files and folders inside approved roots. | Moderate |
Read File | files.read_file | Read | Reads a constrained file. | High |
Get File Checksum | files.get_file_checksum | Read | Computes file checksums. | Moderate |
Download File | files.download_file | Read | Downloads chunks through JSON fallback. | High |
Begin Binary Download | files.begin_binary_download | Read | Starts binary download for a constrained file. | High |
Push File | files.push_file | Write | Writes caller-provided content into an approved root. | High |
Copy File | files.copy_file | Write | Copies a constrained file. | High |
Move File | files.move_file | Write | Moves or renames a constrained file. | High |
Delete File | files.delete_file | Delete | Deletes a constrained file. | Critical |
Tool Details
Use read tools for inspection and download. Enable write and delete tools only for specific local repair workflows.