UNPKG

aiwg

Version:

Deployment tool and support utility for AI context. Copies agents, skills, commands, rules, and behaviors into the paths each AI platform reads (Claude Code, Codex, Copilot, Cursor, Warp, OpenClaw, and 6 more) so one source of truth works across 10 platfo

35 lines 1.46 kB
/** * Filesystem Storage Adapter * * The default backend. Wraps `fs.promises` and honors per-subsystem root * overrides from `storage.config`. Output is byte-identical to the * pre-abstraction direct-fs calls so consumer migrations stay safe. * * @design @.aiwg/architecture/storage-design.md (§5.1) * @issue #934 * @issue #956 */ import type { StorageAdapter, StorageEntry, WriteMeta } from '../types.js'; export declare class FilesystemAdapter implements StorageAdapter { /** Absolute path where this subsystem's content lives. */ private readonly root; constructor(root: string); /** * Path traversal guard. Rejects `..`, leading `/`, leading `~`, and * backslashes (which on POSIX would be treated as filename chars but * are almost always a Windows-vs-POSIX bug). Also rejects empty paths. */ private resolveSafe; read(path: string): Promise<string | null>; write(path: string, content: string, _meta?: WriteMeta): Promise<void>; /** * Atomic append. Uses fs.appendFile, which opens with O_APPEND so the * kernel guarantees atomicity for writes ≤ PIPE_BUF (4096 bytes on * Linux). Concurrent appenders interleave at line granularity rather * than racing read-then-write. See #976. */ append(path: string, content: string): Promise<void>; list(prefix: string): Promise<StorageEntry[]>; delete(path: string): Promise<void>; } //# sourceMappingURL=fs.d.ts.map