import { a as FileSystemDirent, c as MkdirOptions, d as WriteFileOptions, i as FileSystem, l as ReadFileOptions, n as CpOptions, o as FsStat, r as FileContent, s as InitialFiles, t as BufferEncoding, u as RmOptions } from "./interface-CjgTx0Yc.js"; import { a as SqlParam, c as WorkspaceChangeEvent, d as WorkspaceOptions, i as SqlBackend, l as WorkspaceChangeType, n as FileInfo, o as SqlSource, r as FileStat, s as Workspace, t as EntryType, u as WorkspaceFsLike } from "./filesystem-BKxpZmkl.js"; import { A as StateStat, C as StateMkdirOptions, D as StateReplaceResult, E as StateReplaceInFilesResult, M as StateTreeNode, N as StateTreeOptions, O as StateRmOptions, P as StateTreeSummary, S as StateJsonWriteOptions, T as StateReplaceInFilesOptions, _ as StateFindEntry, a as StateArchiveExtractResult, b as StateJsonUpdateOperation, c as StateCapabilities, d as StateDirent, f as StateEdit, g as StateFileSearchResult, h as StateFileDetection, i as StateArchiveEntry, j as StateTextMatch, k as StateSearchOptions, l as StateCompressionResult, m as StateEditPlan, n as StateApplyEditsResult, o as StateBackend, p as StateEditInstruction, r as StateArchiveCreateResult, s as StateBatchOperationError, t as StateApplyEditsOptions, u as StateCopyOptions, v as StateFindOptions, w as StateMoveOptions, x as StateJsonUpdateResult, y as StateHashOptions } from "./backend-CuDV4ny1.js"; //#region src/fs/in-memory-fs.d.ts declare class InMemoryFs implements FileSystem { private tree; constructor(initialFiles?: InitialFiles); writeFileSync( path: string, content: FileContent, options?: WriteFileOptions | BufferEncoding, metadata?: { mode?: number; mtime?: Date; } ): void; writeFileLazy( path: string, lazy: () => string | Uint8Array | Promise, metadata?: { mode?: number; mtime?: Date; } ): void; mkdirSync(path: string, options?: MkdirOptions): void; readFile( path: string, options?: ReadFileOptions | BufferEncoding ): Promise; readFileBytes(path: string): Promise; writeFile( path: string, content: string, options?: WriteFileOptions | BufferEncoding ): Promise; writeFileBytes(path: string, content: Uint8Array): Promise; appendFile(path: string, content: string | Uint8Array): Promise; exists(path: string): Promise; stat(path: string): Promise; lstat(path: string): Promise; mkdir(path: string, options?: MkdirOptions): Promise; readdir(path: string): Promise; readdirWithFileTypes(path: string): Promise; rm(path: string, options?: RmOptions): Promise; cp(src: string, dest: string, options?: CpOptions): Promise; mv(src: string, dest: string): Promise; symlink(target: string, linkPath: string): Promise; link(existingPath: string, newPath: string): Promise; readlink(path: string): Promise; realpath(path: string): Promise; resolvePath(base: string, path: string): string; glob(pattern: string): Promise; chmod(path: string, mode: number): Promise; utimes(path: string, _atime: Date, mtime: Date): Promise; private resolveNode; private locate; private canonicalize; private insertContent; private insertLazy; private forceLazy; private scaffold; private placeNode; private deepClone; private gather; private missing; } //#endregion //#region src/helpers.d.ts declare function searchTextContent( content: string, query: string, options?: StateSearchOptions ): StateTextMatch[]; //#endregion //#region src/memory.d.ts interface FileSystemStateBackendOptions { files?: InitialFiles; fs?: FileSystem; } declare class FileSystemStateBackend implements StateBackend { readonly fs: FileSystem; constructor(fsOrOptions?: FileSystem | FileSystemStateBackendOptions); getCapabilities(): Promise; readFile(path: string): Promise; readFileBytes(path: string): Promise; writeFile(path: string, content: string): Promise; writeFileBytes(path: string, content: Uint8Array): Promise; appendFile(path: string, content: string | Uint8Array): Promise; readJson(path: string): Promise; writeJson( path: string, value: unknown, options?: StateJsonWriteOptions ): Promise; queryJson(path: string, query: string): Promise; updateJson( path: string, operations: StateJsonUpdateOperation[] ): Promise; exists(path: string): Promise; stat(path: string): Promise; lstat(path: string): Promise; mkdir(path: string, options?: StateMkdirOptions): Promise; readdir(path: string): Promise; readdirWithFileTypes(path: string): Promise; find(path: string, options?: StateFindOptions): Promise; walkTree(path: string, options?: StateTreeOptions): Promise; summarizeTree( path: string, options?: StateTreeOptions ): Promise; searchText( path: string, query: string, options?: StateSearchOptions ): Promise>; searchFiles( pattern: string, query: string, options?: StateSearchOptions ): Promise; replaceInFile( path: string, search: string, replacement: string, options?: StateSearchOptions ): Promise; replaceInFiles( pattern: string, search: string, replacement: string, options?: StateReplaceInFilesOptions ): Promise; rm(path: string, options?: StateRmOptions): Promise; cp(src: string, dest: string, options?: StateCopyOptions): Promise; mv(src: string, dest: string, options?: StateMoveOptions): Promise; symlink(target: string, linkPath: string): Promise; readlink(path: string): Promise; realpath(path: string): Promise; resolvePath(base: string, path: string): Promise; glob(pattern: string): Promise; diff(pathA: string, pathB: string): Promise; diffContent(path: string, newContent: string): Promise; createArchive( path: string, sources: string[] ): Promise; listArchive(path: string): Promise; extractArchive( path: string, destination: string ): Promise; compressFile( path: string, destination?: string ): Promise; decompressFile( path: string, destination?: string ): Promise; hashFile(path: string, options?: StateHashOptions): Promise; detectFile(path: string): Promise; removeTree(path: string): Promise; copyTree(src: string, dest: string): Promise; moveTree(src: string, dest: string): Promise; planEdits(instructions: StateEditInstruction[]): Promise; applyEditPlan( plan: StateEditPlan, options?: StateApplyEditsOptions ): Promise; applyEdits( edits: StateEdit[], options?: StateApplyEditsOptions ): Promise; private tryStat; private getFilePaths; private deleteFile; private createTreeOps; private collectArchiveEntries; } declare function createMemoryStateBackend( options?: FileSystemStateBackendOptions ): FileSystemStateBackend; //#endregion //#region src/workspace.d.ts declare class WorkspaceFileSystem implements FileSystem { private readonly ws; constructor(ws: WorkspaceFsLike); readFile(path: string): Promise; readFileBytes(path: string): Promise; writeFile(path: string, content: string): Promise; writeFileBytes(path: string, content: Uint8Array): Promise; appendFile(path: string, content: string | Uint8Array): Promise; exists(path: string): Promise; stat(path: string): Promise; lstat(path: string): Promise; mkdir( path: string, options?: { recursive?: boolean; } ): Promise; readdir(path: string): Promise; readdirWithFileTypes(path: string): Promise; rm( path: string, options?: { recursive?: boolean; force?: boolean; } ): Promise; cp( src: string, dest: string, options?: { recursive?: boolean; } ): Promise; mv(src: string, dest: string): Promise; symlink(target: string, linkPath: string): Promise; readlink(path: string): Promise; realpath(path: string, _depth?: number): Promise; resolvePath(base: string, path: string): string; glob(pattern: string): Promise; } /** * Wrap a `Workspace` (or any `WorkspaceFsLike` — e.g. a cross-DO proxy * forwarding each call to a parent agent's workspace over RPC) in a * `FileSystemStateBackend` suitable for codemode's `state.*` sandbox * API. The backend reuses `WorkspaceFileSystem` as its adapter, so * every caller gets identical ENOENT and stat-normalization semantics. */ declare function createWorkspaceStateBackend( workspace: WorkspaceFsLike ): FileSystemStateBackend; //#endregion //#region src/prompt.d.ts /** * TypeScript declaration for the `state` object injected into every isolate * execution. Export this string in prompts so the LLM knows the exact API it * can call. * * Usage: * import { STATE_TYPES, STATE_SYSTEM_PROMPT } from "@cloudflare/shell"; * * system: STATE_SYSTEM_PROMPT.replace("{{types}}", STATE_TYPES) */ declare const STATE_TYPES: string; /** * System-prompt template for using the `state` runtime. * Replace `{{types}}` with `STATE_TYPES` before passing to the model. * * Example: * import { STATE_TYPES, STATE_SYSTEM_PROMPT } from "@cloudflare/shell"; * const system = STATE_SYSTEM_PROMPT.replace("{{types}}", STATE_TYPES); */ declare const STATE_SYSTEM_PROMPT: string; //#endregion export { type EntryType, type FileInfo, type FileStat, type FileSystem, FileSystemStateBackend, type FileSystemStateBackendOptions, type FsStat, InMemoryFs, type InitialFiles, STATE_SYSTEM_PROMPT, STATE_TYPES, type SqlBackend, type SqlParam, type SqlSource, type StateBackend, StateBatchOperationError, Workspace, type WorkspaceChangeEvent, type WorkspaceChangeType, WorkspaceFileSystem, type WorkspaceFsLike, type WorkspaceOptions, createMemoryStateBackend, createWorkspaceStateBackend }; //# sourceMappingURL=index.d.ts.map