list()
List entries in a directory.| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | Yes | — | Workspace external ID |
path | string | No | / | Directory path to list |
Promise<VirtualFile[]>
| Field | Type | Description |
|---|---|---|
id | string | Unique file identifier |
name | string | File or directory name |
path | string | Full path |
type | string | MIME type |
is_folder | boolean | Whether this is a directory |
size | number | File size in bytes |
modified_at | string | undefined | ISO 8601 last modified timestamp |
child_count | number | undefined | Number of children (directories only) |
metadata | Record<string, unknown> | undefined | Provider-specific metadata |
read()
Read file contents as a string.| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace external ID |
path | string | Yes | File path |
offset | number | No | Byte offset to start reading from |
length | number | No | Number of bytes to read |
Promise<string> — the file contents.
tree()
Get a recursive directory tree. Supports pagination for large directories.| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
workspaceId | string | Yes | — | Workspace external ID |
path | string | No | / | Root path for the tree |
maxKeys | number | No | — | Maximum entries to return |
continuationToken | string | No | — | Token from a previous truncated response |
Promise<TreeListing>
| Field | Type | Description |
|---|---|---|
path | string | Root path of the tree |
entries | VirtualFile[] | Files and directories |
truncated | boolean | Whether more entries are available |
continuation_token | string | undefined | Token for the next page |
stat()
Get metadata for a single file or directory without reading its contents.| Parameter | Type | Required | Description |
|---|---|---|---|
workspaceId | string | Yes | Workspace external ID |
path | string | Yes | File or directory path |
Promise<VirtualFile>