import { l as ArtifactClient } from "./shared-C9CTqSgh.js"; import { bt as MkdirOptions, n as GitClient, vt as WriteFileContent, xt as Database, yt as WriteFileOptions } from "./shared-BTtKnEVB.js"; //#region ../dofs/dist/fs/find.d.ts interface WorkspaceFoundEntry { path: string; type: "file" | "dir"; } interface FindOptions { /** Maximum matching entries to return. */ limit?: number; /** Matching entries to skip in traversal order. */ offset?: number; /** * Glob patterns whose matches are left out of the result. Matched * against the same directory-relative path as the inclusion glob and * applied first, so an exclusion always wins. An excluded directory * is pruned: neither it nor anything below it is visited. */ exclude?: string[]; } //#endregion //#region ../dofs/dist/fs/grep.d.ts interface WorkspaceGrepContextLine { line: number; text: string; isMatch: boolean; } interface WorkspaceGrepMatch { path: string; line: number; text: string; context?: WorkspaceGrepContextLine[]; } interface GrepOptions { /** Ignore letter case. Defaults to false. */ ignoreCase?: boolean; /** Interpret the pattern as a regular expression. Defaults to false. */ regex?: boolean; /** Lines of context to include before and after each match. */ context?: number; /** Maximum matches to return. */ limit?: number; /** Matching lines to skip before collecting results. */ offset?: number; /** Glob relative to a searched directory that limits files. */ include?: string; /** * Glob patterns whose matches are not searched. Matched against the * same directory-relative path as the inclusion glob and applied * first, so an exclusion always wins. An excluded directory is * pruned: neither it nor anything below it is read. */ exclude?: string[]; } //#endregion //#region ../dofs/dist/fs/readdir.d.ts interface WorkspaceDirentResult { name: string; parentPath: string; size: number; mtime: number; isFile: boolean; isDirectory: boolean; isSymbolicLink: boolean; } interface ReaddirOptions { /** Maximum entries to return. */ limit?: number; /** Number of entries to skip in name order. */ offset?: number; } //#endregion //#region ../dofs/dist/fs/readFile.d.ts interface ReadFileOptions { encoding?: "utf8"; /** First byte to return. Defaults to 0. */ byteOffset?: number; /** Maximum bytes to return. Defaults to the rest of the file. */ byteLength?: number; } //#endregion //#region ../dofs/dist/fs/rm.d.ts interface RmOptions { recursive?: boolean; force?: boolean; } //#endregion //#region ../dofs/dist/fs/stat.d.ts interface WorkspaceStatResult { name: string; inode: number; mode: number; mtime: number; size: number; isFile: boolean; isDirectory: boolean; isSymbolicLink: boolean; } //#endregion //#region ../dofs/dist/fs/filesystem.d.ts interface WorkspaceFilesystemOptions { now?: () => number; } declare class WorkspaceFilesystem { readonly db: Database; readonly now: () => number; constructor(db: Database, options?: WorkspaceFilesystemOptions); readFile(path: string): Promise>; readFile(path: string, encoding: "utf8"): Promise; readFile(path: string, options: ReadFileOptions & { encoding?: undefined; }): Promise>; readFile(path: string, options: ReadFileOptions & { encoding: "utf8"; }): Promise; readFile(path: string, options: ReadFileOptions): Promise>; stat(path: string): Promise; lstat(path: string): Promise; readlink(path: string): Promise; readdir(path: string, options?: ReaddirOptions): Promise; find(directory: string, pattern?: string, options?: FindOptions): Promise; ls(prefix: string): Promise; grep(pattern: string, path: string, options?: GrepOptions): Promise; writeFile(path: string, content: WriteFileContent, options?: WriteFileOptions): Promise; mkdir(path: string, options?: MkdirOptions): Promise; rm(path: string, options?: RmOptions): Promise; rename(oldPath: string, newPath: string): Promise; chmod(path: string, mode: number): Promise; symlink(target: string, path: string): Promise; } //#endregion //#region ../dofs/dist/sync/changes.d.ts type ChangeEntry = { kind: "file"; rev: number; path: string; mode: number; mtime: number; size: number; chunks: { hash: Uint8Array; size: number; }[]; } | { kind: "dir"; rev: number; path: string; mode: number; mtime: number; } | { kind: "symlink"; rev: number; path: string; target: string; mode: number; mtime: number; } | { kind: "delete"; rev: number; path: string; prior?: string; }; //#endregion //#region ../dofs/dist/sync/watermarks.d.ts type ChangeCursor = { rev: number; path: string | null; }; //#endregion //#region ../rpc/dist/interface.d.ts interface SyncRPC { push(input: { senderRev: number; senderCursor?: ChangeCursor; changes: ReadableStream; }): Promise<{ rev: number; applied?: number; appliedPushCursor: ChangeCursor; }>; fetchChanges(input: { after?: ChangeCursor; through?: ChangeCursor; ignore?: string[]; }): Promise<{ currentCursor: ChangeCursor; appliedPushCursor: ChangeCursor; stream: ReadableStream; }>; watermarks(input?: { settle?: boolean; }): Promise<{ currentRev: number; pushRev: number; fetchCursor: ChangeCursor; }>; readEntry(path: string): Promise; hasObjects(hashes: Uint8Array[]): Promise; fetchObjects(hashes: Uint8Array[]): ReadableStream<{ hash: Uint8Array; bytes: Uint8Array; }>; fetchChangePack?(input: { after?: ChangeCursor; through?: ChangeCursor; ignore?: string[]; maxEntries: number; maxBytes: number; generation: string; }): Promise<{ cursor: ChangeCursor; drained: boolean; entryCount: number; appliedPushCursor: ChangeCursor; stream: ReadableStream; }>; applyChangePack?(input: { generation: string; stream: ReadableStream; }): Promise<{ appliedPushCursor: ChangeCursor; applied: number; entryCount: number; }>; pushObjects(objects: ReadableStream<{ hash: Uint8Array; bytes: Uint8Array; }>): Promise; } interface ShellRPC { exec(input: { source: string; cwd?: string; id?: string; input?: unknown; timeoutMs?: number; env?: Record; stdin?: Uint8Array; }): Promise<{ id: string; events: ReadableStream; }>; getExec(input: { id: string; after?: number | "tail"; }): Promise<{ id: string; events: ReadableStream; }>; killExec(input: { id: string; signal?: "SIGTERM" | "SIGKILL" | "SIGINT" | "SIGHUP"; }): Promise; disposeExec(input: { id: string; }): Promise; } interface WorkspaceRPC { sync: SyncRPC; shell: ShellRPC; } type ExecEvent = { id: string; seq: number; name: "stdout"; value: Uint8Array; } | { id: string; seq: number; name: "stderr"; value: Uint8Array; } | { id: string; seq: number; name: "exit"; code: number; result?: unknown; }; //#endregion //#region src/backend.d.ts interface WorkspaceBackendHost { readonly db: Database; readonly fs: WorkspaceFilesystem; readonly git: GitClient; readonly artifacts: ArtifactClient; } interface WorkspaceBackend { readonly id: string; readonly type: string; readonly callable?: boolean; readonly description?: string; connect(host: WorkspaceBackendHost): Promise; } interface BackendHandle { rpc: WorkspaceRPC; runtimeId?: string; sync?: "remote" | "none"; ignore?: { readonly patterns: readonly string[]; readonly root: string | undefined; readonly supported: boolean; }; closed?: Promise; close(): Promise; } //#endregion export { WorkspaceFilesystem as a, ReadFileOptions as c, GrepOptions as d, WorkspaceGrepMatch as f, ChangeCursor as i, ReaddirOptions as l, WorkspaceFoundEntry as m, WorkspaceBackend as n, WorkspaceStatResult as o, FindOptions as p, WorkspaceBackendHost as r, RmOptions as s, BackendHandle as t, WorkspaceDirentResult as u }; //# sourceMappingURL=shared-C-sNJ-xg.d.ts.map