API: @loopstack/sandbox-filesystem
Classes
SandboxCreateDirectory
Tool that creates a directory in a sandbox container, optionally creating parent directories.
import { SandboxCreateDirectory } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxCreateDirectory extends BaseTool<SandboxCreateDirectoryArgs, object, SandboxCreateDirectoryResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxCreateDirectoryArgs): Promise<ToolEnvelope<SandboxCreateDirectoryResult>>;
}SandboxDelete
Tool that deletes a file or directory in a sandbox container, with optional recursive and force flags.
import { SandboxDelete } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxDelete extends BaseTool<SandboxDeleteArgs, object, SandboxDeleteResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxDeleteArgs): Promise<ToolEnvelope<SandboxDeleteResult>>;
}SandboxExists
Tool that checks whether a path exists in a sandbox container and reports its type.
import { SandboxExists } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxExists extends BaseTool<SandboxExistsArgs, object, SandboxExistsResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxExistsArgs): Promise<ToolEnvelope<SandboxExistsResult>>;
}SandboxFileInfo
Tool that returns detailed metadata for a file or directory in a sandbox container — type, size, permissions, owner/group, and timestamps.
import { SandboxFileInfo } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxFileInfo extends BaseTool<SandboxFileInfoArgs, object, SandboxFileInfoResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxFileInfoArgs): Promise<ToolEnvelope<SandboxFileInfoResult>>;
}SandboxFilesystemModule
NestJS module that provides filesystem tools for operating inside Docker sandbox containers — read,
write, list, create-directory, delete, exists, and file-info (SandboxReadFile, SandboxWriteFile,
SandboxListDirectory, SandboxCreateDirectory, SandboxDelete, SandboxExists, SandboxFileInfo).
Registration:
SandboxFilesystemModule— bare import; registers all sandbox filesystem tools.
Requires: a running Docker daemon on the host; imports SandboxToolModule automatically, so the
container lifecycle tools (SandboxInit, SandboxCommand, SandboxDestroy) are available too.
import { SandboxFilesystemModule } from '@loopstack/sandbox-filesystem';export class SandboxFilesystemModule {
}SandboxListDirectory
Tool that lists files and directories in a sandbox container, optionally recursively, with type and size.
import { SandboxListDirectory } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxListDirectory extends BaseTool<SandboxListDirectoryArgs, object, SandboxListDirectoryResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxListDirectoryArgs): Promise<ToolEnvelope<SandboxListDirectoryResult>>;
}SandboxReadFile
Tool that reads a file’s contents from a sandbox container, as utf8 or base64.
import { SandboxReadFile } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxReadFile extends BaseTool<SandboxReadFileArgs, object, SandboxReadFileResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxReadFileArgs): Promise<ToolEnvelope<SandboxReadFileResult>>;
}SandboxWriteFile
Tool that writes content to a file in a sandbox container, optionally creating parent directories.
import { SandboxWriteFile } from '@loopstack/sandbox-filesystem';Provided by: SandboxFilesystemModule
export class SandboxWriteFile extends BaseTool<SandboxWriteFileArgs, object, SandboxWriteFileResult> {
constructor(sandboxCommand: SandboxCommand);
protected handle(args: SandboxWriteFileArgs): Promise<ToolEnvelope<SandboxWriteFileResult>>;
}Interfaces
SandboxCreateDirectoryResult
Result of SandboxCreateDirectory.
Reports the directory path and whether it was created.
import { SandboxCreateDirectoryResult } from '@loopstack/sandbox-filesystem';export interface SandboxCreateDirectoryResult {
path: string;
created: boolean;
}SandboxDeleteResult
Result of SandboxDelete.
Reports the target path and whether it was deleted.
import { SandboxDeleteResult } from '@loopstack/sandbox-filesystem';export interface SandboxDeleteResult {
path: string;
deleted: boolean;
}SandboxExistsResult
Result of SandboxExists.
Reports whether the path exists and, if so, its type (or null when absent).
import { SandboxExistsResult } from '@loopstack/sandbox-filesystem';export interface SandboxExistsResult {
path: string;
exists: boolean;
type: 'file' | 'directory' | 'symlink' | 'other' | null;
}SandboxFileInfoResult
Result of SandboxFileInfo.
Detailed metadata for a path — type, size, permissions, owner/group, and timestamps.
import { SandboxFileInfoResult } from '@loopstack/sandbox-filesystem';export interface SandboxFileInfoResult {
path: string;
name: string;
type: 'file' | 'directory' | 'symlink' | 'other';
size: number;
permissions: string;
owner: string;
group: string;
modifiedAt: string;
accessedAt: string;
createdAt: string;
}SandboxListDirectoryResult
Result of SandboxListDirectory.
Reports the listed directory path and its entries (name, type, size, path).
import { SandboxListDirectoryResult } from '@loopstack/sandbox-filesystem';export interface SandboxListDirectoryResult {
path: string;
entries: FileEntry[];
}SandboxReadFileResult
Result of SandboxReadFile.
Reports the file content and the encoding it was read with.
import { SandboxReadFileResult } from '@loopstack/sandbox-filesystem';export interface SandboxReadFileResult {
content: string;
encoding: string;
}SandboxWriteFileResult
Result of SandboxWriteFile.
Reports the written path and the number of bytes written.
import { SandboxWriteFileResult } from '@loopstack/sandbox-filesystem';export interface SandboxWriteFileResult {
path: string;
bytesWritten: number;
}Type Aliases
SandboxCreateDirectoryArgs
Args for SandboxCreateDirectory.
Identifies the container and target directory path, with an optional recursive flag.
import { SandboxCreateDirectoryArgs } from '@loopstack/sandbox-filesystem';export type SandboxCreateDirectoryArgs = z.infer<typeof inputSchema>;SandboxDeleteArgs
Args for SandboxDelete.
Identifies the container and target path, with optional recursive and force flags.
import { SandboxDeleteArgs } from '@loopstack/sandbox-filesystem';export type SandboxDeleteArgs = z.infer<typeof inputSchema>;SandboxExistsArgs
Args for SandboxExists.
Identifies the container and the path to check for existence.
import { SandboxExistsArgs } from '@loopstack/sandbox-filesystem';export type SandboxExistsArgs = z.infer<typeof inputSchema>;SandboxFileInfoArgs
Args for SandboxFileInfo.
Identifies the container and the path to inspect.
import { SandboxFileInfoArgs } from '@loopstack/sandbox-filesystem';export type SandboxFileInfoArgs = z.infer<typeof inputSchema>;SandboxListDirectoryArgs
Args for SandboxListDirectory.
Identifies the container and directory path, with an optional recursive flag.
import { SandboxListDirectoryArgs } from '@loopstack/sandbox-filesystem';export type SandboxListDirectoryArgs = z.infer<typeof inputSchema>;SandboxReadFileArgs
Args for SandboxReadFile.
Identifies the container, file path, and read encoding (utf8 or base64).
import { SandboxReadFileArgs } from '@loopstack/sandbox-filesystem';export type SandboxReadFileArgs = z.infer<typeof inputSchema>;SandboxWriteFileArgs
Args for SandboxWriteFile.
Identifies the container, target path, content, encoding, and whether to create parent directories.
import { SandboxWriteFileArgs } from '@loopstack/sandbox-filesystem';export type SandboxWriteFileArgs = z.infer<typeof inputSchema>;