# File System API reference

> Exports of @anymux/file-system.

Source: https://anymux-docs.n.yatsyk.com/docs/file-system/jsdoc

## Classes

### Dirent

A representation of a directory entry, which can be a file or a subdirectory
within the directory, as returned by reading from an `fs.Dir`. The
directory entry is a combination of the file name and file type pairs.

Additionally, when {@link readdir} or {@link readdirSync} is called with
the `withFileTypes` option set to `true`, the resulting array is filled with `fs.Dirent` objects, rather than strings or `Buffer` s.

```ts
class Dirent
```

- `isFile(): boolean` — Returns `true` if the `fs.Dirent` object describes a regular file.
- `isDirectory(): boolean` — Returns `true` if the `fs.Dirent` object describes a file system
directory.
- `isBlockDevice(): boolean` — Returns `true` if the `fs.Dirent` object describes a block device.
- `isCharacterDevice(): boolean` — Returns `true` if the `fs.Dirent` object describes a character device.
- `isSymbolicLink(): boolean` — Returns `true` if the `fs.Dirent` object describes a symbolic link.
- `isFIFO(): boolean` — Returns `true` if the `fs.Dirent` object describes a first-in-first-out
(FIFO) pipe.
- `isSocket(): boolean` — Returns `true` if the `fs.Dirent` object describes a socket.
- `name: Name` — The file name that this `fs.Dirent` object refers to. The type of this
value is determined by the `options.encoding` passed to  or .
- `parentPath: string` — The path to the parent directory of the file this `fs.Dirent` object refers to.
- `path: string` — Alias for `dirent.parentPath`.

### MemoryFileSystem

```ts
class MemoryFileSystem
```

- `promises: this`
- `constants: FSConstants`
- `constructor(): MemoryFileSystem`
- `init(): Promise<void>`
- `readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>`
- `writeFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>`
- `copyFile(src: string, dest: string, mode?: number): Promise<void>`
- `appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>`
- `mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>`
- `readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>`
- `readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>`
- `readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: boolean; recursive?: boolean; }): Promise<string[] | Dirent[]>`
- `rmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>`
- `stat(path: string, options?: { bigint?: false; }): Promise<Stats>`
- `stat(path: string, options: { bigint: true; }): Promise<BigIntStats>`
- `stat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>`
- `lstat(path: string, options?: { bigint?: false; }): Promise<Stats>`
- `lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>`
- `lstat(path: string, options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>`
- `rename(oldPath: string, newPath: string): Promise<void>`
- `unlink(path: string): Promise<void>`
- `exists(path: string): Promise<boolean>`
- `access(path: string, mode?: number): Promise<void>`
- `chmod(path: string, mode: string | number): Promise<void>`
- `chown(path: string, uid: number, gid: number): Promise<void>`
- `readlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `symlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>`
- `link(existingPath: string, newPath: string): Promise<void>`
- `truncate(path: string, len?: number): Promise<void>`
- `utimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>`
- `open(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>`
- `opendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>`
- `realpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `cp(src: string, dest: string, options?: { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise<boolean>; force?: boolean; mode?: number; preserveTimestamps?: boolean; recursive?: boolean; verbatimSymlinks?: boolean; }): Promise<void>`
- `mkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>`
- `statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>`
- `statfs(path: string, options?: { bigint?: boolean; }): Promise<StatFs | BigIntStatFs>`
- `lutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `lchown(path: string, uid: number, gid: number): Promise<void>`
- `lchmod(path: string, mode: string | number): Promise<void>`
- `createReadStream(path: string, options?: ReadStreamOptions): ReadStream`
- `createWriteStream(path: string, options?: WriteStreamOptions): WriteStream`
- `watch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher`
- `isImplemented(method: string): boolean`
- `_getNode(path: string): MemoryNode | undefined`

### MemoryStats

```ts
class MemoryStats
```

- `dev: number`
- `ino: number`
- `mode: number`
- `nlink: number`
- `uid: number`
- `gid: number`
- `rdev: number`
- `size: number`
- `blksize: number`
- `blocks: number`
- `atime: Date`
- `mtime: Date`
- `ctime: Date`
- `birthtime: Date`
- `isFile(): boolean`
- `isDirectory(): boolean`
- `isBlockDevice(): boolean`
- `isCharacterDevice(): boolean`
- `isSymbolicLink(): boolean`
- `isFIFO(): boolean`
- `isSocket(): boolean`

### MemoryBigIntStats

```ts
class MemoryBigIntStats
```

- `constructor(stats: MemoryStats): MemoryBigIntStats`
- `isFile(): boolean`
- `isDirectory(): boolean`
- `isBlockDevice(): boolean`
- `isCharacterDevice(): boolean`
- `isSymbolicLink(): boolean`
- `isFIFO(): boolean`
- `isSocket(): boolean`

### MemoryDirent

```ts
class MemoryDirent
```

- `name: string`
- `constructor(name: string, type: "file" | "directory"): MemoryDirent`
- `isFile(): boolean`
- `isDirectory(): boolean`
- `isBlockDevice(): boolean`
- `isCharacterDevice(): boolean`
- `isSymbolicLink(): boolean`
- `isFIFO(): boolean`
- `isSocket(): boolean`

### MemoryFileHandle

```ts
class MemoryFileHandle
```

- `fd: number`
- `constructor(fd: number, path: string, fs: MemoryFileSystem, node: MemoryNode, canRead: boolean, canWrite: boolean, append: boolean): MemoryFileHandle`
- `appendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>`
- `chmod(mode: number): Promise<void>`
- `chown(uid: number, gid: number): Promise<void>`
- `close(): Promise<void>`
- `createReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream`
- `createWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStream`
- `datasync(): Promise<void>`
- `read(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>`
- `readFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>`
- `readLines(options?: { encoding?: BufferEncoding; }): any`
- `stat(options?: { bigint?: false; }): Promise<Stats>`
- `stat(options: { bigint: true; }): Promise<BigIntStats>`
- `stat(options?: { bigint?: boolean; }): Promise<Stats | BigIntStats>`
- `sync(): Promise<void>`
- `truncate(len?: number): Promise<void>`
- `utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `write(bufferOrData: Buffer | Uint8Array | string, offsetOrPosition?: number | null, lengthOrEncoding?: number | BufferEncoding, position?: number | null): Promise<{ bytesWritten: number; buffer: any; }>`
- `writeFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>`
- `[Symbol.asyncDispose](): Promise<void>`

### MemoryDir

```ts
class MemoryDir
```

- `path: string`
- `constructor(path: string, entries: Dirent[]): MemoryDir`
- `close(): Promise<void>`
- `read(): Promise<Dirent | null>`
- `[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>`

### MemoryWatcher

```ts
class MemoryWatcher
```

- `constructor(path: string): MemoryWatcher`
- `close(): Promise<void>`
- `addListener(event: string | symbol, listener: (...args: any[]) => void): this`
- `on(event: string | symbol, listener: (...args: any[]) => void): this`
- `once(event: string | symbol, listener: (...args: any[]) => void): this`
- `removeListener(event: string | symbol, listener: (...args: any[]) => void): this`
- `off(event: string | symbol, listener: (...args: any[]) => void): this`
- `removeAllListeners(event?: string | symbol): this`
- `setMaxListeners(n: number): this`
- `getMaxListeners(): number`
- `listeners(event: string | symbol): Function[]`
- `rawListeners(event: string | symbol): Function[]`
- `emit(event: string | symbol, ...args: any[]): boolean`
- `listenerCount(event: string | symbol): number`
- `prependListener(event: string | symbol, listener: (...args: any[]) => void): this`
- `prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this`
- `eventNames(): Array<string | symbol>`

### MemoryReadStream

```ts
class MemoryReadStream
```

- `constructor(content: Buffer): MemoryReadStream`
- `_read(size: number): void`
- `close(): void`

### MemoryWriteStream

```ts
class MemoryWriteStream
```

- `constructor(onFinish: (content: Buffer) => void): MemoryWriteStream`
- `_write(chunk: Buffer, encoding: string, callback: (error?: Error) => void): void`
- `_final(callback: (error?: Error) => void): void`
- `close(): void`

## Functions

### createNodeError

Creates a Node.js compatible error with all required properties

```ts
createNodeError(code: string, message: string, path: string, syscall: string, errno?: number): NodeJS.ErrnoException
```

### normalizePath

```ts
normalizePath(path: string): string
```

### notifyWatchers

```ts
notifyWatchers(watchersMap: Map<string, Set<WatchListener>>, path: string, eventType: string): void
```

### parseFlags

```ts
parseFlags(flags: string): number
```

## Types

### CapabilityType

Provider capability types

```ts
type CapabilityType = 'file-system' | 'object-storage' | 'git-repo' | 'git-host' | 'media' | 'contacts' | 'calendar'
```

### PullRequestState

Pull request state.

```ts
type PullRequestState = 'open' | 'closed' | 'merged'
```

### IssueState

Issue state.

```ts
type IssueState = 'open' | 'closed'
```

### WatchOptions

```ts
type WatchOptions = {
  encoding?: BufferEncoding;
  persistent?: boolean;
  recursive?: boolean;
}
```

### WatchListener

```ts
type WatchListener = (eventType: string, filename: string) => void
```

### ReadStreamOptions

```ts
type ReadStreamOptions = {
  encoding?: BufferEncoding;
  start?: number;
  end?: number;
}
```

### WriteStreamOptions

```ts
type WriteStreamOptions = {
  encoding?: BufferEncoding;
  flags?: string;
  mode?: number;
}
```

## Interfaces

### ReadStream

```ts
interface ReadStream
```

- `close(): void`

### WriteStream

```ts
interface WriteStream
```

- `close(): void`

### FSWatcher

```ts
interface FSWatcher
```

- `close(): Promise<void>`

### FSConstants

```ts
interface FSConstants
```

- `F_OK: 0` — File is visible to the calling process
- `R_OK: 4` — File can be read by the calling process
- `W_OK: 2` — File can be written by the calling process
- `X_OK: 1` — File can be executed by the calling process
- `COPYFILE_EXCL: 1` — Flag for copyFile: fail if dest exists
- `O_RDONLY: 0` — Open for reading only
- `O_WRONLY: 1` — Open for writing only
- `O_RDWR: 2` — Open for reading and writing
- `O_CREAT: 64` — Create file if it does not exist
- `O_EXCL: 128` — Fail if O_CREAT and file exists
- `O_TRUNC: 512` — Truncate file to zero length
- `O_APPEND: 1024` — Append to end of file

### IFileHandle

```ts
interface IFileHandle
```

- `fd: number` — The numeric file descriptor
- `appendFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>`
- `chmod(mode: number): Promise<void>`
- `chown(uid: number, gid: number): Promise<void>`
- `close(): Promise<void>`
- `createReadStream(options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream`
- `createWriteStream(options?: { encoding?: BufferEncoding; start?: number; }): WriteStream`
- `datasync(): Promise<void>`
- `read(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesRead: number; buffer: Buffer | Uint8Array; }>`
- `readFile(options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>`
- `readLines(options?: { encoding?: BufferEncoding; }): any`
- `stat(options?: { bigint?: false; }): Promise<Stats>`
- `stat(options: { bigint: true; }): Promise<BigIntStats>`
- `sync(): Promise<void>`
- `truncate(len?: number): Promise<void>`
- `utimes(atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `write(buffer: Buffer | Uint8Array, offset?: number, length?: number, position?: number | null): Promise<{ bytesWritten: number; buffer: Buffer | Uint8Array; }>`
- `write(data: string, position?: number | null, encoding?: BufferEncoding): Promise<{ bytesWritten: number; buffer: string; }>`
- `writeFile(data: string | Uint8Array, options?: { encoding?: BufferEncoding; }): Promise<void>`
- `[Symbol.asyncDispose](): Promise<void>`

### IDir

```ts
interface IDir
```

- `path: string`
- `close(): Promise<void>`
- `read(): Promise<Dirent | null>`
- `[Symbol.asyncIterator](): AsyncIterableIterator<Dirent>`

### StatFs

```ts
interface StatFs
```

- `bsize: number` — Optimal transfer block size
- `blocks: number` — Total data blocks in filesystem
- `bfree: number` — Free blocks in filesystem
- `bavail: number` — Available blocks for unprivileged users
- `files: number` — Total file nodes in filesystem
- `ffree: number` — Free file nodes in filesystem
- `type: number` — Filesystem type

### BigIntStatFs

```ts
interface BigIntStatFs
```

- `bsize: bigint`
- `blocks: bigint`
- `bfree: bigint`
- `bavail: bigint`
- `files: bigint`
- `ffree: bigint`
- `type: bigint`

### IFileSystem

```ts
interface IFileSystem
```

- `promises: this`
- `constants: FSConstants`
- `readFile(path: string, options?: { encoding?: BufferEncoding; flag?: string; } | BufferEncoding): Promise<Buffer | string>`
- `writeFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>`
- `appendFile(path: string, data: Buffer | string | Uint8Array, options?: { encoding?: BufferEncoding; mode?: number; flag?: string; }): Promise<void>`
- `copyFile(src: string, dest: string, mode?: number): Promise<void>`
- `mkdir(path: string, options?: { recursive?: boolean; mode?: number; }): Promise<string | undefined>`
- `readdir(path: string, options?: { encoding?: BufferEncoding; withFileTypes?: false; recursive?: boolean; }): Promise<string[]>`
- `readdir(path: string, options: { encoding?: BufferEncoding; withFileTypes: true; recursive?: boolean; }): Promise<Dirent[]>`
- `rmdir(path: string, options?: { maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>`
- `stat(path: string, options?: { bigint?: false; }): Promise<Stats>`
- `stat(path: string, options: { bigint: true; }): Promise<BigIntStats>`
- `lstat(path: string, options?: { bigint?: false; }): Promise<Stats>`
- `lstat(path: string, options: { bigint: true; }): Promise<BigIntStats>`
- `access(path: string, mode?: number): Promise<void>`
- `rename(oldPath: string, newPath: string): Promise<void>`
- `unlink(path: string): Promise<void>`
- `truncate(path: string, len?: number): Promise<void>`
- `utimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `chmod(path: string, mode: string | number): Promise<void>`
- `chown(path: string, uid: number, gid: number): Promise<void>`
- `readlink(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `symlink(target: string, path: string, type?: "dir" | "file" | "junction"): Promise<void>`
- `link(existingPath: string, newPath: string): Promise<void>`
- `createReadStream(path: string, options?: { encoding?: BufferEncoding; start?: number; end?: number; }): ReadStream`
- `createWriteStream(path: string, options?: { encoding?: BufferEncoding; flags?: string; mode?: number; }): WriteStream`
- `watch(path: string, options?: { encoding?: BufferEncoding; persistent?: boolean; recursive?: boolean; }): FSWatcher`
- `rm(path: string, options?: { force?: boolean; maxRetries?: number; recursive?: boolean; retryDelay?: number; }): Promise<void>`
- `open(path: string, flags?: string | number, mode?: number): Promise<IFileHandle>`
- `opendir(path: string, options?: { encoding?: BufferEncoding; bufferSize?: number; recursive?: boolean; }): Promise<IDir>`
- `realpath(path: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `cp(src: string, dest: string, options?: { dereference?: boolean; errorOnExist?: boolean; filter?: (src: string, dest: string) => boolean | Promise<boolean>; force?: boolean; mode?: number; preserveTimestamps?: boolean; recursive?: boolean; verbatimSymlinks?: boolean; }): Promise<void>`
- `mkdtemp(prefix: string, options?: { encoding?: BufferEncoding; }): Promise<string>`
- `statfs(path: string, options?: { bigint?: false; }): Promise<StatFs>`
- `statfs(path: string, options: { bigint: true; }): Promise<BigIntStatFs>`
- `lutimes(path: string, atime: string | number | Date, mtime: string | number | Date): Promise<void>`
- `lchown(path: string, uid: number, gid: number): Promise<void>`
- `lchmod(path: string, mode: string | number): Promise<void>`
- `exists(path: string): Promise<boolean>`
- `isImplemented(method: string): boolean`
- `init(options?: { encoding?: string; }): Promise<void>`

### Stats

A `fs.Stats` object provides information about a file.

Objects returned from {@link stat}, {@link lstat}, {@link fstat}, and
their synchronous counterparts are of this type.
If `bigint` in the `options` passed to those methods is true, the numeric values
will be `bigint` instead of `number`, and the object will contain additional
nanosecond-precision properties suffixed with `Ns`. `Stat` objects are not to be created directly using the `new` keyword.

```console
Stats {
  dev: 2114,
  ino: 48064969,
  mode: 33188,
  nlink: 1,
  uid: 85,
  gid: 100,
  rdev: 0,
  size: 527,
  blksize: 4096,
  blocks: 8,
  atimeMs: 1318289051000.1,
  mtimeMs: 1318289051000.1,
  ctimeMs: 1318289051000.1,
  birthtimeMs: 1318289051000.1,
  atime: Mon, 10 Oct 2011 23:24:11 GMT,
  mtime: Mon, 10 Oct 2011 23:24:11 GMT,
  ctime: Mon, 10 Oct 2011 23:24:11 GMT,
  birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
```

`bigint` version:

```console
BigIntStats {
  dev: 2114n,
  ino: 48064969n,
  mode: 33188n,
  nlink: 1n,
  uid: 85n,
  gid: 100n,
  rdev: 0n,
  size: 527n,
  blksize: 4096n,
  blocks: 8n,
  atimeMs: 1318289051000n,
  mtimeMs: 1318289051000n,
  ctimeMs: 1318289051000n,
  birthtimeMs: 1318289051000n,
  atimeNs: 1318289051000000000n,
  mtimeNs: 1318289051000000000n,
  ctimeNs: 1318289051000000000n,
  birthtimeNs: 1318289051000000000n,
  atime: Mon, 10 Oct 2011 23:24:11 GMT,
  mtime: Mon, 10 Oct 2011 23:24:11 GMT,
  ctime: Mon, 10 Oct 2011 23:24:11 GMT,
  birthtime: Mon, 10 Oct 2011 23:24:11 GMT }
```

```ts
interface Stats
```

### BigIntStats

```ts
interface BigIntStats
```

- `atimeNs: bigint`
- `mtimeNs: bigint`
- `ctimeNs: bigint`
- `birthtimeNs: bigint`

### IProvider

Base interface for all AnyMux providers.
A provider exposes one or more capabilities (file-system, object-storage, git-repo, git-host).

```ts
interface IProvider
```

- `id: string` — Unique identifier for this provider instance
- `name: string` — Human-readable display name
- `capabilities: readonly CapabilityType[]` — List of capabilities this provider supports
- `<T>(type: CapabilityType): T | undefined` — Get a capability by type.
Returns undefined if the capability is not supported.
- `hasCapability(type: CapabilityType): boolean` — Check if this provider supports a given capability.
- `initialize(): Promise<void>` — Initialize the provider (e.g., authenticate, establish connections).
- `dispose(): Promise<void>` — Dispose of the provider and release resources.

### ObjectMetadata

Metadata associated with a stored object.

```ts
interface ObjectMetadata
```

- `size: number` — Size in bytes
- `lastModified: Date` — Last modified date
- `contentType: string` — Content type (MIME)
- `etag: string` — ETag for conditional operations
- `metadata: Record<string, string>` — Custom metadata key-value pairs

### ListObjectsOptions

Options for listing objects.

```ts
interface ListObjectsOptions
```

- `prefix: string` — Filter by key prefix
- `delimiter: string` — Delimiter for virtual directory grouping
- `maxKeys: number` — Maximum number of results
- `continuationToken: string` — Continuation token for pagination

### ListObjectsResult

Result of a list objects operation.

```ts
interface ListObjectsResult
```

- `objects: { key: string; metadata: ObjectMetadata; }[]` — Object keys and metadata
- `commonPrefixes: string[]` — Common prefixes (virtual directories) when delimiter is used
- `isTruncated: boolean` — Whether more results are available
- `nextContinuationToken: string` — Token to fetch next page

### PutObjectOptions

Options for put operations.

```ts
interface PutObjectOptions
```

- `contentType: string` — Content type (MIME)
- `metadata: Record<string, string>` — Custom metadata
- `cacheControl: string` — Cache-Control header

### PresignedUrlOptions

Options for generating presigned URLs.

```ts
interface PresignedUrlOptions
```

- `expiresIn: number` — Expiration time in seconds (default: 3600)
- `method: "GET" | "PUT"` — HTTP method for the presigned URL

### BucketInfo

Bucket information.

```ts
interface BucketInfo
```

- `name: string`
- `creationDate: Date`

### IObjectStorage

Universal object storage interface.
Abstracts S3-compatible APIs, GCS, Azure Blob Storage, etc.

```ts
interface IObjectStorage
```

- `listBuckets(): Promise<BucketInfo[]>`
- `createBucket(name: string): Promise<void>`
- `deleteBucket(name: string): Promise<void>`
- `bucketExists(name: string): Promise<boolean>`
- `getObject(bucket: string, key: string): Promise<Buffer>`
- `putObject(bucket: string, key: string, data: Buffer | Uint8Array | string, options?: PutObjectOptions): Promise<void>`
- `deleteObject(bucket: string, key: string): Promise<void>`
- `headObject(bucket: string, key: string): Promise<ObjectMetadata>`
- `copyObject(sourceBucket: string, sourceKey: string, destBucket: string, destKey: string): Promise<void>`
- `listObjects(bucket: string, options?: ListObjectsOptions): Promise<ListObjectsResult>`
- `getPresignedUrl(bucket: string, key: string, options?: PresignedUrlOptions): Promise<string>`
- `objectExists(bucket: string, key: string): Promise<boolean>`

### GitCommit

Git commit information.

```ts
interface GitCommit
```

- `sha: string`
- `message: string`
- `author: { name: string; email: string; date: Date; }`
- `committer: { name: string; email: string; date: Date; }`
- `parents: string[]`

### GitBranch

Git branch information.

```ts
interface GitBranch
```

- `name: string`
- `sha: string`
- `isDefault: boolean`
- `isProtected: boolean`

### GitTag

Git tag information.

```ts
interface GitTag
```

- `name: string`
- `sha: string`
- `message: string`

### GitDiffEntry

A single file diff entry.

```ts
interface GitDiffEntry
```

- `path: string`
- `status: "added" | "modified" | "deleted" | "renamed"`
- `additions: number`
- `deletions: number`
- `patch: string`
- `previousPath: string`

### ListCommitsOptions

Options for listing commits.

```ts
interface ListCommitsOptions
```

- `ref: string` — Branch or ref to list commits from
- `maxCount: number` — Maximum number of commits
- `path: string` — Only commits affecting this path
- `since: Date` — Commits after this date
- `until: Date` — Commits before this date

### IGitRepo

Git repository interface.
Provides read/write access to Git data: branches, commits, tags, diffs.

```ts
interface IGitRepo
```

- `listBranches(): Promise<GitBranch[]>`
- `getBranch(name: string): Promise<GitBranch>`
- `createBranch(name: string, sha: string): Promise<GitBranch>`
- `deleteBranch(name: string): Promise<void>`
- `listCommits(options?: ListCommitsOptions): Promise<GitCommit[]>`
- `getCommit(sha: string): Promise<GitCommit>`
- `listTags(): Promise<GitTag[]>`
- `createTag(name: string, sha: string, message?: string): Promise<GitTag>`
- `deleteTag(name: string): Promise<void>`
- `diff(base: string, head: string): Promise<GitDiffEntry[]>`
- `resolveRef(ref: string): Promise<string>`

### PullRequest

Pull request information.

```ts
interface PullRequest
```

- `number: number`
- `title: string`
- `body: string`
- `state: PullRequestState`
- `head: { ref: string; sha: string; }`
- `base: { ref: string; sha: string; }`
- `author: string`
- `createdAt: Date`
- `updatedAt: Date`
- `mergedAt: Date`
- `labels: string[]`
- `reviewers: string[]`

### Issue

Issue information.

```ts
interface Issue
```

- `number: number`
- `title: string`
- `body: string`
- `state: IssueState`
- `author: string`
- `createdAt: Date`
- `updatedAt: Date`
- `labels: string[]`
- `assignees: string[]`

### Review

Review information.

```ts
interface Review
```

- `id: number`
- `author: string`
- `state: "approved" | "changes_requested" | "commented" | "pending"`
- `body: string`
- `submittedAt: Date`

### Release

Release information.

```ts
interface Release
```

- `id: number`
- `tagName: string`
- `name: string`
- `body: string`
- `draft: boolean`
- `prerelease: boolean`
- `createdAt: Date`
- `publishedAt: Date`

### PipelineRun

Pipeline / CI run information.

```ts
interface PipelineRun
```

- `id: number`
- `name: string`
- `status: "queued" | "in_progress" | "completed"`
- `conclusion: "success" | "failure" | "cancelled" | "skipped"`
- `branch: string`
- `sha: string`
- `createdAt: Date`
- `updatedAt: Date`
- `url: string`

### ListPullRequestsOptions

Options for listing pull requests.

```ts
interface ListPullRequestsOptions
```

- `state: PullRequestState | "all"`
- `head: string`
- `base: string`
- `sort: "created" | "updated" | "popularity"`
- `direction: "asc" | "desc"`
- `maxResults: number`

### ListIssuesOptions

Options for listing issues.

```ts
interface ListIssuesOptions
```

- `state: IssueState | "all"`
- `labels: string[]`
- `assignee: string`
- `sort: "created" | "updated" | "comments"`
- `direction: "asc" | "desc"`
- `maxResults: number`

### CreatePullRequestOptions

Options for creating a pull request.

```ts
interface CreatePullRequestOptions
```

- `title: string`
- `body: string`
- `head: string`
- `base: string`
- `draft: boolean`
- `labels: string[]`
- `reviewers: string[]`

### CreateIssueOptions

Options for creating an issue.

```ts
interface CreateIssueOptions
```

- `title: string`
- `body: string`
- `labels: string[]`
- `assignees: string[]`

### IGitHost

Git hosting platform interface.
Abstracts GitHub, GitLab, Bitbucket, etc. for PRs, issues, reviews, CI, releases.

```ts
interface IGitHost
```

- `listPullRequests(options?: ListPullRequestsOptions): Promise<PullRequest[]>`
- `getPullRequest(number: number): Promise<PullRequest>`
- `createPullRequest(options: CreatePullRequestOptions): Promise<PullRequest>`
- `updatePullRequest(number: number, updates: Partial<Pick<PullRequest, "title" | "body" | "state" | "labels">>): Promise<PullRequest>`
- `mergePullRequest(number: number, options?: { method?: "merge" | "squash" | "rebase"; commitMessage?: string; }): Promise<void>`
- `listIssues(options?: ListIssuesOptions): Promise<Issue[]>`
- `getIssue(number: number): Promise<Issue>`
- `createIssue(options: CreateIssueOptions): Promise<Issue>`
- `updateIssue(number: number, updates: Partial<Pick<Issue, "title" | "body" | "state" | "labels" | "assignees">>): Promise<Issue>`
- `listReviews(pullRequestNumber: number): Promise<Review[]>`
- `createReview(pullRequestNumber: number, review: { body: string; event: "approve" | "request_changes" | "comment"; }): Promise<Review>`
- `listReleases(): Promise<Release[]>`
- `createRelease(options: { tagName: string; name: string; body: string; draft?: boolean; prerelease?: boolean; }): Promise<Release>`
- `listPipelineRuns(options?: { branch?: string; status?: string; }): Promise<PipelineRun[]>`
- `getPipelineRun(id: number): Promise<PipelineRun>`

### MemoryNode

```ts
interface MemoryNode
```

- `type: "file" | "directory"`
- `name: string`
- `children: Map<string, MemoryNode>`
- `content: Buffer<ArrayBufferLike>`
- `stats: MemoryStats`
- `parent: MemoryNode`
- `linkTarget: string`
- `isSymlink: boolean`

### Watcher

```ts
interface Watcher
```

- `close(): void`

## Constants

### NodeErrors

Factory functions for common Node.js filesystem errors

```ts
const NodeErrors: { ENOENT: (path: string, syscall: string) => NodeJS.ErrnoException; EACCES: (path: string, syscall: string) => NodeJS.ErrnoException; EEXIST: (path: string, syscall: string) => NodeJS.ErrnoException; ENOTDIR: (path: string, syscall: string) => NodeJS.ErrnoException; EISDIR: (path: string, syscall: string) => NodeJS.ErrnoException; ENOTEMPTY: (path: string, syscall: string) => NodeJS.ErrnoException; ENOSYS: (syscall: string) => NodeJS.ErrnoException; EINVAL: (path: string, syscall: string) => NodeJS.ErrnoException; EBADF: (syscall: string) => NodeJS.ErrnoException; EPERM: (path: string, syscall: string) => NodeJS.ErrnoException; ELOOP: (path: string, syscall: string) => NodeJS.ErrnoException; EXDEV: (path: string, syscall: string) => NodeJS.ErrnoException; }
```
