import { SearchableWorkspace, WatchableWorkspace, ReadOptions, FileStat, FileEntry, GrepOptions, GrepMatch, GlobOptions, FileChangeHandler, WorkspaceProvider } from '@agentxjs/core/workspace'; /** * LocalWorkspace - Node.js implementation of Workspace * * Uses fs/promises for file operations. * All paths are resolved relative to the workspace root. * Path safety: prevents access outside the root directory. */ /** * LocalWorkspace - File operations backed by local filesystem * * Implements SearchableWorkspace (grep + glob included). * * @example * ```typescript * const workspace = new LocalWorkspace("/path/to/project"); * const content = await workspace.read("src/index.ts"); * await workspace.write("output.txt", "Hello"); * ``` */ declare class LocalWorkspace implements SearchableWorkspace, WatchableWorkspace { readonly root: string; constructor(root: string); /** * Resolve a relative path to an absolute path within the workspace. * Throws if the resolved path escapes the workspace root. */ private resolvePath; read(path: string, options?: ReadOptions): Promise; write(path: string, content: string): Promise; exists(path: string): Promise; stat(path: string): Promise; remove(path: string): Promise; list(path?: string): Promise; mkdir(path: string): Promise; grep(pattern: string, options?: GrepOptions): Promise; glob(pattern: string, options?: GlobOptions): Promise; watch(handler: FileChangeHandler): () => void; } /** * LocalWorkspaceProvider - Creates LocalWorkspace instances by ID * * Maps workspaceId to a subdirectory under the base path. * Each agent gets its own isolated directory. */ /** * LocalWorkspaceProvider — maps workspaceId to local filesystem directories * * @example * ```typescript * const provider = new LocalWorkspaceProvider("~/.deepractice/agentx/workspaces"); * const workspace = await provider.create("ws_abc123"); * // workspace.root = ~/.deepractice/agentx/workspaces/ws_abc123 * ``` */ declare class LocalWorkspaceProvider implements WorkspaceProvider { private readonly basePath; constructor(basePath: string); create(workspaceId: string): Promise; } export { LocalWorkspace, LocalWorkspaceProvider };