mnemos-coder
Version:
CLI-based coding agent with graph-based execution loop and terminal UI
87 lines • 2.44 kB
TypeScript
/**
* Sandbox manager for creating isolated test environments
*/
export interface SandboxOptions {
preserveFiles?: string[];
timeoutMs?: number;
maxSizeBytes?: number;
allowedOperations?: ('read' | 'write' | 'execute' | 'network')[];
}
export interface SandboxInfo {
id: string;
path: string;
created: number;
sourceProject?: string;
options: SandboxOptions;
}
export declare class SandboxManager {
private basePath?;
private sandboxes;
private cleanupTimers;
constructor(basePath?: string | undefined);
/**
* Create a new sandbox environment
*/
createSandbox(sourceProject?: string, options?: SandboxOptions): Promise<string>;
/**
* Get sandbox information
*/
getSandbox(idOrPath: string): SandboxInfo | undefined;
/**
* List all active sandboxes
*/
listSandboxes(): SandboxInfo[];
/**
* Check sandbox resource usage
*/
checkSandboxUsage(sandboxId: string): Promise<{
sizeBytes: number;
fileCount: number;
ageMs: number;
withinLimits: boolean;
}>;
/**
* Create a snapshot of sandbox state
*/
createSnapshot(sandboxId: string, name?: string): Promise<string>;
/**
* Restore sandbox from snapshot
*/
restoreSnapshot(sandboxId: string, snapshotName: string): Promise<void>;
/**
* Execute a command safely in sandbox
*/
executeInSandbox(sandboxId: string, command: string, options?: {
timeout?: number;
captureOutput?: boolean;
allowNetwork?: boolean;
}): Promise<{
success: boolean;
output: string;
error?: string;
duration: number;
}>;
/**
* Validate sandbox safety before operations
*/
validateSandbox(sandboxId: string): Promise<{
valid: boolean;
issues: string[];
recommendations: string[];
}>;
/**
* Clean up sandbox environment
*/
cleanup(sandboxId?: string): Promise<void>;
private copyProjectToSandbox;
private createMinimalProject;
private copyDirectory;
private calculateDirectoryStats;
private findSuspiciousFiles;
private checkPermissions;
private cleanupSandbox;
private removeRecursive;
private writeSandboxMetadata;
}
export declare function createSandboxManager(basePath?: string): SandboxManager;
//# sourceMappingURL=SandboxManager.d.ts.map