{"file":"server/src/memory-fs.ts","version":318,"total":258,"from":1,"to":258,"lines":[{"n":1,"text":"// From Cloudflare's isomorphic-git example, with fixes isomorphic-git 1.43","atom":"a1486","author":"speed","version":150},{"n":2,"text":"// needs: errors carry .code (isomorphic-git checks err.code === \"ENOENT\"),","atom":"a1486","author":"speed","version":150},{"n":3,"text":"// stats are plain fields it can normalize in place, and the executable bit","atom":"a1486","author":"speed","version":150},{"n":4,"text":"// and symbolic links are kept (#27), so a checkout of a repo with either works.","atom":"a1486","author":"speed","version":150},{"n":5,"text":"","atom":"a1486","author":"speed","version":150},{"n":6,"text":"function fsError(code: string, path: string): Error {","atom":"a1486","author":"speed","version":150},{"n":7,"text":"\treturn Object.assign(new Error(`${code}: ${path}`), { code });","atom":"a1486","author":"speed","version":150},{"n":8,"text":"}","atom":"a1486","author":"speed","version":150},{"n":9,"text":"","atom":"a1486","author":"speed","version":150},{"n":10,"text":"type Entry =","atom":"a1486","author":"speed","version":150},{"n":11,"text":"\t| { kind: \"dir\"; children: Set<string>; mtimeMs: number }","atom":"a1486","author":"speed","version":150},{"n":12,"text":"\t| { kind: \"file\"; data: Uint8Array; byteLength?: number; exec: boolean; mtimeMs: number }","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":13,"text":"\t| { kind: \"link\"; target: string; mtimeMs: number };","atom":"a1486","author":"speed","version":150},{"n":14,"text":"","atom":"a1486","author":"speed","version":150},{"n":15,"text":"const enc = new TextEncoder();","atom":"a1486","author":"speed","version":150},{"n":16,"text":"","atom":"a1486","author":"speed","version":150},{"n":17,"text":"/** Optional scratch storage for file contents; directory metadata remains in memory. */","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":18,"text":"export interface FileContents {","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":19,"text":"\twrite(path: string, bytes: Uint8Array): void;","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":20,"text":"\tread(path: string): Uint8Array;","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":21,"text":"\tremove(path: string): void;","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":22,"text":"}","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":23,"text":"","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":24,"text":"/** Plain fields, not getters: isomorphic-git writes to them when it normalizes stats. */","atom":"a1486","author":"speed","version":150},{"n":25,"text":"class MemoryStats {","atom":"a1486","author":"speed","version":150},{"n":26,"text":"\tsize: number;","atom":"a1486","author":"speed","version":150},{"n":27,"text":"\tmtimeMs: number;","atom":"a1486","author":"speed","version":150},{"n":28,"text":"\tctimeMs: number;","atom":"a1486","author":"speed","version":150},{"n":29,"text":"\tmode: number;","atom":"a1486","author":"speed","version":150},{"n":30,"text":"\tprivate kind: Entry[\"kind\"];","atom":"a1486","author":"speed","version":150},{"n":31,"text":"","atom":"a1486","author":"speed","version":150},{"n":32,"text":"\tconstructor(entry: Entry) {","atom":"a1486","author":"speed","version":150},{"n":33,"text":"\t\tthis.kind = entry.kind;","atom":"a1486","author":"speed","version":150},{"n":34,"text":"\t\tthis.size =","atom":"a1486","author":"speed","version":150},{"n":35,"text":"\t\t\tentry.kind === \"file\"","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":36,"text":"\t\t\t\t? (entry.byteLength ?? entry.data.byteLength)","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":37,"text":"\t\t\t\t: entry.kind === \"link\"","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":38,"text":"\t\t\t\t\t? enc.encode(entry.target).byteLength","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":39,"text":"\t\t\t\t\t: 0;","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":40,"text":"\t\tthis.mtimeMs = entry.mtimeMs;","atom":"a1486","author":"speed","version":150},{"n":41,"text":"\t\tthis.ctimeMs = entry.mtimeMs;","atom":"a1486","author":"speed","version":150},{"n":42,"text":"\t\tthis.mode = entry.kind === \"dir\" ? 0o040000 : entry.kind === \"link\" ? 0o120000 : entry.exec ? 0o100755 : 0o100644;","atom":"a1486","author":"speed","version":150},{"n":43,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":44,"text":"","atom":"a1486","author":"speed","version":150},{"n":45,"text":"\tisFile() {","atom":"a1486","author":"speed","version":150},{"n":46,"text":"\t\treturn this.kind === \"file\";","atom":"a1486","author":"speed","version":150},{"n":47,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":48,"text":"","atom":"a1486","author":"speed","version":150},{"n":49,"text":"\tisDirectory() {","atom":"a1486","author":"speed","version":150},{"n":50,"text":"\t\treturn this.kind === \"dir\";","atom":"a1486","author":"speed","version":150},{"n":51,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":52,"text":"","atom":"a1486","author":"speed","version":150},{"n":53,"text":"\tisSymbolicLink() {","atom":"a1486","author":"speed","version":150},{"n":54,"text":"\t\treturn this.kind === \"link\";","atom":"a1486","author":"speed","version":150},{"n":55,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":56,"text":"}","atom":"a1486","author":"speed","version":150},{"n":57,"text":"","atom":"a1486","author":"speed","version":150},{"n":58,"text":"export class MemoryFS {","atom":"a1486","author":"speed","version":150},{"n":59,"text":"\tprivate readonly contents?: FileContents;","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":60,"text":"\tconstructor(contents?: FileContents) {","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":61,"text":"\t\tthis.contents = contents;","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":62,"text":"\t}","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":63,"text":"\tencoder = new TextEncoder();","atom":"a1486","author":"speed","version":150},{"n":64,"text":"\tdecoder = new TextDecoder();","atom":"a1486","author":"speed","version":150},{"n":65,"text":"\tentries = new Map<string, Entry>([[\"/\", { kind: \"dir\", children: new Set(), mtimeMs: Date.now() }]]);","atom":"a1486","author":"speed","version":150},{"n":66,"text":"","atom":"a1486","author":"speed","version":150},{"n":67,"text":"\tpromises = {","atom":"a1486","author":"speed","version":150},{"n":68,"text":"\t\treadFile: this.readFile.bind(this),","atom":"a1486","author":"speed","version":150},{"n":69,"text":"\t\twriteFile: this.writeFile.bind(this),","atom":"a1486","author":"speed","version":150},{"n":70,"text":"\t\tunlink: this.unlink.bind(this),","atom":"a1486","author":"speed","version":150},{"n":71,"text":"\t\treaddir: this.readdir.bind(this),","atom":"a1486","author":"speed","version":150},{"n":72,"text":"\t\tmkdir: this.mkdir.bind(this),","atom":"a1486","author":"speed","version":150},{"n":73,"text":"\t\trmdir: this.rmdir.bind(this),","atom":"a1486","author":"speed","version":150},{"n":74,"text":"\t\tstat: this.stat.bind(this),","atom":"a1486","author":"speed","version":150},{"n":75,"text":"\t\tlstat: this.lstat.bind(this),","atom":"a1486","author":"speed","version":150},{"n":76,"text":"\t\treadlink: this.readlink.bind(this),","atom":"a1486","author":"speed","version":150},{"n":77,"text":"\t\tsymlink: this.symlink.bind(this),","atom":"a1486","author":"speed","version":150},{"n":78,"text":"\t\tchmod: this.chmod.bind(this),","atom":"a1486","author":"speed","version":150},{"n":79,"text":"\t};","atom":"a1486","author":"speed","version":150},{"n":80,"text":"","atom":"a1486","author":"speed","version":150},{"n":81,"text":"\tnormalize(input: string) {","atom":"a1486","author":"speed","version":150},{"n":82,"text":"\t\tconst segments: string[] = [];","atom":"a1486","author":"speed","version":150},{"n":83,"text":"","atom":"a1486","author":"speed","version":150},{"n":84,"text":"\t\tfor (const part of input.split(\"/\")) {","atom":"a1486","author":"speed","version":150},{"n":85,"text":"\t\t\tif (!part || part === \".\") {","atom":"a1486","author":"speed","version":150},{"n":86,"text":"\t\t\t\tcontinue;","atom":"a1486","author":"speed","version":150},{"n":87,"text":"\t\t\t}","atom":"a1486","author":"speed","version":150},{"n":88,"text":"","atom":"a1486","author":"speed","version":150},{"n":89,"text":"\t\t\tif (part === \"..\") {","atom":"a1486","author":"speed","version":150},{"n":90,"text":"\t\t\t\tsegments.pop();","atom":"a1486","author":"speed","version":150},{"n":91,"text":"\t\t\t\tcontinue;","atom":"a1486","author":"speed","version":150},{"n":92,"text":"\t\t\t}","atom":"a1486","author":"speed","version":150},{"n":93,"text":"","atom":"a1486","author":"speed","version":150},{"n":94,"text":"\t\t\tsegments.push(part);","atom":"a1486","author":"speed","version":150},{"n":95,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":96,"text":"","atom":"a1486","author":"speed","version":150},{"n":97,"text":"\t\treturn `/${segments.join(\"/\")}` || \"/\";","atom":"a1486","author":"speed","version":150},{"n":98,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":99,"text":"","atom":"a1486","author":"speed","version":150},{"n":100,"text":"\tparent(path: string) {","atom":"a1486","author":"speed","version":150},{"n":101,"text":"\t\tconst normalized = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":102,"text":"\t\tif (normalized === \"/\") {","atom":"a1486","author":"speed","version":150},{"n":103,"text":"\t\t\treturn \"/\";","atom":"a1486","author":"speed","version":150},{"n":104,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":105,"text":"","atom":"a1486","author":"speed","version":150},{"n":106,"text":"\t\tconst parts = normalized.split(\"/\").filter(Boolean);","atom":"a1486","author":"speed","version":150},{"n":107,"text":"\t\tparts.pop();","atom":"a1486","author":"speed","version":150},{"n":108,"text":"\t\treturn parts.length ? `/${parts.join(\"/\")}` : \"/\";","atom":"a1486","author":"speed","version":150},{"n":109,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":110,"text":"","atom":"a1486","author":"speed","version":150},{"n":111,"text":"\tbasename(path: string) {","atom":"a1486","author":"speed","version":150},{"n":112,"text":"\t\treturn this.normalize(path).split(\"/\").filter(Boolean).pop() ?? \"\";","atom":"a1486","author":"speed","version":150},{"n":113,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":114,"text":"","atom":"a1486","author":"speed","version":150},{"n":115,"text":"\tgetEntry(path: string) {","atom":"a1486","author":"speed","version":150},{"n":116,"text":"\t\treturn this.entries.get(this.normalize(path));","atom":"a1486","author":"speed","version":150},{"n":117,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":118,"text":"","atom":"a1486","author":"speed","version":150},{"n":119,"text":"\trequireEntry(path: string) {","atom":"a1486","author":"speed","version":150},{"n":120,"text":"\t\tconst entry = this.getEntry(path);","atom":"a1486","author":"speed","version":150},{"n":121,"text":"\t\tif (!entry) {","atom":"a1486","author":"speed","version":150},{"n":122,"text":"\t\t\tthrow fsError(\"ENOENT\", path);","atom":"a1486","author":"speed","version":150},{"n":123,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":124,"text":"","atom":"a1486","author":"speed","version":150},{"n":125,"text":"\t\treturn entry;","atom":"a1486","author":"speed","version":150},{"n":126,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":127,"text":"","atom":"a1486","author":"speed","version":150},{"n":128,"text":"\trequireDir(path: string) {","atom":"a1486","author":"speed","version":150},{"n":129,"text":"\t\tconst entry = this.requireEntry(path);","atom":"a1486","author":"speed","version":150},{"n":130,"text":"\t\tif (entry.kind !== \"dir\") {","atom":"a1486","author":"speed","version":150},{"n":131,"text":"\t\t\tthrow fsError(\"ENOTDIR\", path);","atom":"a1486","author":"speed","version":150},{"n":132,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":133,"text":"","atom":"a1486","author":"speed","version":150},{"n":134,"text":"\t\treturn entry;","atom":"a1486","author":"speed","version":150},{"n":135,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":136,"text":"","atom":"a1486","author":"speed","version":150},{"n":137,"text":"\tasync mkdir(path: string, options?: { recursive?: boolean } | number) {","atom":"a1486","author":"speed","version":150},{"n":138,"text":"\t\tconst target = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":139,"text":"\t\tif (target === \"/\") {","atom":"a1486","author":"speed","version":150},{"n":140,"text":"\t\t\treturn;","atom":"a1486","author":"speed","version":150},{"n":141,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":142,"text":"","atom":"a1486","author":"speed","version":150},{"n":143,"text":"\t\tconst recursive = typeof options === \"object\" && options !== null && options.recursive;","atom":"a1486","author":"speed","version":150},{"n":144,"text":"\t\tconst parent = this.parent(target);","atom":"a1486","author":"speed","version":150},{"n":145,"text":"","atom":"a1486","author":"speed","version":150},{"n":146,"text":"\t\tif (!this.entries.has(parent)) {","atom":"a1486","author":"speed","version":150},{"n":147,"text":"\t\t\tif (!recursive) {","atom":"a1486","author":"speed","version":150},{"n":148,"text":"\t\t\t\tthrow fsError(\"ENOENT\", parent);","atom":"a1486","author":"speed","version":150},{"n":149,"text":"\t\t\t}","atom":"a1486","author":"speed","version":150},{"n":150,"text":"","atom":"a1486","author":"speed","version":150},{"n":151,"text":"\t\t\tawait this.mkdir(parent, { recursive: true });","atom":"a1486","author":"speed","version":150},{"n":152,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":153,"text":"","atom":"a1486","author":"speed","version":150},{"n":154,"text":"\t\tif (this.entries.has(target)) {","atom":"a1486","author":"speed","version":150},{"n":155,"text":"\t\t\treturn;","atom":"a1486","author":"speed","version":150},{"n":156,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":157,"text":"","atom":"a1486","author":"speed","version":150},{"n":158,"text":"\t\tthis.entries.set(target, {","atom":"a1486","author":"speed","version":150},{"n":159,"text":"\t\t\tkind: \"dir\",","atom":"a1486","author":"speed","version":150},{"n":160,"text":"\t\t\tchildren: new Set(),","atom":"a1486","author":"speed","version":150},{"n":161,"text":"\t\t\tmtimeMs: Date.now(),","atom":"a1486","author":"speed","version":150},{"n":162,"text":"\t\t});","atom":"a1486","author":"speed","version":150},{"n":163,"text":"","atom":"a1486","author":"speed","version":150},{"n":164,"text":"\t\tthis.requireDir(parent).children.add(this.basename(target));","atom":"a1486","author":"speed","version":150},{"n":165,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":166,"text":"","atom":"a1486","author":"speed","version":150},{"n":167,"text":"\t/** options.mode with any execute bit (isomorphic-git passes 0o777 for 100755) makes the file executable. */","atom":"a1486","author":"speed","version":150},{"n":168,"text":"\tasync writeFile(path: string, data: string | Uint8Array | ArrayBuffer, options?: string | { mode?: number }) {","atom":"a1486","author":"speed","version":150},{"n":169,"text":"\t\tconst target = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":170,"text":"\t\tawait this.mkdir(this.parent(target), { recursive: true });","atom":"a1486","author":"speed","version":150},{"n":171,"text":"","atom":"a1486","author":"speed","version":150},{"n":172,"text":"\t\tconst bytes =","atom":"a1486","author":"speed","version":150},{"n":173,"text":"\t\t\ttypeof data === \"string\" ? this.encoder.encode(data) : data instanceof Uint8Array ? data : new Uint8Array(data);","atom":"a1486","author":"speed","version":150},{"n":174,"text":"\t\tconst mode = typeof options === \"object\" && options !== null ? options.mode : undefined;","atom":"a1486","author":"speed","version":150},{"n":175,"text":"\t\tthis.contents?.write(target, bytes);","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":176,"text":"","atom":"a1486","author":"speed","version":150},{"n":177,"text":"\t\tthis.entries.set(target, {","atom":"a1486","author":"speed","version":150},{"n":178,"text":"\t\t\tkind: \"file\",","atom":"a1486","author":"speed","version":150},{"n":179,"text":"\t\t\tdata: this.contents ? new Uint8Array(0) : bytes,","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":180,"text":"\t\t\t...(this.contents ? { byteLength: bytes.byteLength } : {}),","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":181,"text":"\t\t\texec: mode !== undefined && (mode & 0o111) !== 0,","atom":"a1486","author":"speed","version":150},{"n":182,"text":"\t\t\tmtimeMs: Date.now(),","atom":"a1486","author":"speed","version":150},{"n":183,"text":"\t\t});","atom":"a1486","author":"speed","version":150},{"n":184,"text":"","atom":"a1486","author":"speed","version":150},{"n":185,"text":"\t\tthis.requireDir(this.parent(target)).children.add(this.basename(target));","atom":"a1486","author":"speed","version":150},{"n":186,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":187,"text":"","atom":"a1486","author":"speed","version":150},{"n":188,"text":"\tasync readFile(path: string, options?: string | { encoding?: string }) {","atom":"a1486","author":"speed","version":150},{"n":189,"text":"\t\tconst entry = this.requireEntry(path);","atom":"a1486","author":"speed","version":150},{"n":190,"text":"\t\tif (entry.kind === \"dir\") {","atom":"a1486","author":"speed","version":150},{"n":191,"text":"\t\t\tthrow fsError(\"EISDIR\", path);","atom":"a1486","author":"speed","version":150},{"n":192,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":193,"text":"","atom":"a1486","author":"speed","version":150},{"n":194,"text":"\t\tconst data =","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":195,"text":"\t\t\tentry.kind === \"link\"","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":196,"text":"\t\t\t\t? this.encoder.encode(entry.target)","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":197,"text":"\t\t\t\t: this.contents","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":198,"text":"\t\t\t\t\t? this.contents.read(this.normalize(path))","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":199,"text":"\t\t\t\t\t: entry.data;","atom":"a1986","author":"codex-capacity-chair","version":180},{"n":200,"text":"\t\tconst encoding = typeof options === \"string\" ? options : options?.encoding;","atom":"a1486","author":"speed","version":150},{"n":201,"text":"\t\treturn encoding ? this.decoder.decode(data) : data;","atom":"a1486","author":"speed","version":150},{"n":202,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":203,"text":"","atom":"a1486","author":"speed","version":150},{"n":204,"text":"\tasync readdir(path: string) {","atom":"a1486","author":"speed","version":150},{"n":205,"text":"\t\treturn [...this.requireDir(path).children].sort();","atom":"a1486","author":"speed","version":150},{"n":206,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":207,"text":"","atom":"a1486","author":"speed","version":150},{"n":208,"text":"\tasync unlink(path: string) {","atom":"a1486","author":"speed","version":150},{"n":209,"text":"\t\tconst target = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":210,"text":"\t\tconst entry = this.requireEntry(target);","atom":"a1486","author":"speed","version":150},{"n":211,"text":"\t\tif (entry.kind === \"dir\") {","atom":"a1486","author":"speed","version":150},{"n":212,"text":"\t\t\tthrow fsError(\"EISDIR\", path);","atom":"a1486","author":"speed","version":150},{"n":213,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":214,"text":"","atom":"a1486","author":"speed","version":150},{"n":215,"text":"\t\tif (entry.kind === \"file\") this.contents?.remove(target);","atom":"a1983","author":"codex-capacity-chair","version":180},{"n":216,"text":"\t\tthis.entries.delete(target);","atom":"a1486","author":"speed","version":150},{"n":217,"text":"\t\tthis.requireDir(this.parent(target)).children.delete(this.basename(target));","atom":"a1486","author":"speed","version":150},{"n":218,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":219,"text":"","atom":"a1486","author":"speed","version":150},{"n":220,"text":"\tasync rmdir(path: string) {","atom":"a1486","author":"speed","version":150},{"n":221,"text":"\t\tconst target = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":222,"text":"\t\tconst entry = this.requireDir(target);","atom":"a1486","author":"speed","version":150},{"n":223,"text":"\t\tif (entry.children.size > 0) {","atom":"a1486","author":"speed","version":150},{"n":224,"text":"\t\t\tthrow fsError(\"ENOTEMPTY\", path);","atom":"a1486","author":"speed","version":150},{"n":225,"text":"\t\t}","atom":"a1486","author":"speed","version":150},{"n":226,"text":"","atom":"a1486","author":"speed","version":150},{"n":227,"text":"\t\tthis.entries.delete(target);","atom":"a1486","author":"speed","version":150},{"n":228,"text":"\t\tthis.requireDir(this.parent(target)).children.delete(this.basename(target));","atom":"a1486","author":"speed","version":150},{"n":229,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":230,"text":"","atom":"a1486","author":"speed","version":150},{"n":231,"text":"\tasync stat(path: string) {","atom":"a1486","author":"speed","version":150},{"n":232,"text":"\t\treturn new MemoryStats(this.requireEntry(path));","atom":"a1486","author":"speed","version":150},{"n":233,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":234,"text":"","atom":"a1486","author":"speed","version":150},{"n":235,"text":"\t/** Links aren't followed anywhere here, so lstat and stat agree. */","atom":"a1486","author":"speed","version":150},{"n":236,"text":"\tasync lstat(path: string) {","atom":"a1486","author":"speed","version":150},{"n":237,"text":"\t\treturn this.stat(path);","atom":"a1486","author":"speed","version":150},{"n":238,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":239,"text":"","atom":"a1486","author":"speed","version":150},{"n":240,"text":"\tasync readlink(path: string): Promise<string> {","atom":"a1486","author":"speed","version":150},{"n":241,"text":"\t\tconst entry = this.requireEntry(path);","atom":"a1486","author":"speed","version":150},{"n":242,"text":"\t\tif (entry.kind !== \"link\") throw fsError(\"EINVAL\", path);","atom":"a1486","author":"speed","version":150},{"n":243,"text":"\t\treturn entry.target;","atom":"a1486","author":"speed","version":150},{"n":244,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":245,"text":"","atom":"a1486","author":"speed","version":150},{"n":246,"text":"\tasync symlink(target: string, path: string): Promise<void> {","atom":"a1486","author":"speed","version":150},{"n":247,"text":"\t\tconst at = this.normalize(path);","atom":"a1486","author":"speed","version":150},{"n":248,"text":"\t\tif (this.entries.has(at)) throw fsError(\"EEXIST\", path);","atom":"a1486","author":"speed","version":150},{"n":249,"text":"\t\tawait this.mkdir(this.parent(at), { recursive: true });","atom":"a1486","author":"speed","version":150},{"n":250,"text":"\t\tthis.entries.set(at, { kind: \"link\", target, mtimeMs: Date.now() });","atom":"a1486","author":"speed","version":150},{"n":251,"text":"\t\tthis.requireDir(this.parent(at)).children.add(this.basename(at));","atom":"a1486","author":"speed","version":150},{"n":252,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":253,"text":"","atom":"a1486","author":"speed","version":150},{"n":254,"text":"\tasync chmod(path: string, mode: number): Promise<void> {","atom":"a1486","author":"speed","version":150},{"n":255,"text":"\t\tconst entry = this.requireEntry(path);","atom":"a1486","author":"speed","version":150},{"n":256,"text":"\t\tif (entry.kind === \"file\") entry.exec = (mode & 0o111) !== 0;","atom":"a1486","author":"speed","version":150},{"n":257,"text":"\t}","atom":"a1486","author":"speed","version":150},{"n":258,"text":"}","atom":"a1486","author":"speed","version":150}],"atoms":[{"atom":"a1486","author":"speed","message":"","time":1791907425388,"timeIso":"2026-10-13T16:03:45.388Z","publish":{"draft":null,"version":150,"agent":"speed","message":"Open server: the project Worker, Durable Object and Artifacts (issue 17)","time":1791907522179,"timeIso":"2026-10-13T16:05:22.179Z"}},{"atom":"a1983","author":"codex-capacity-chair","message":"","time":1791974111170,"timeIso":"2026-10-14T10:35:11.170Z","publish":{"draft":null,"version":180,"agent":"codex-capacity-chair","message":"Keep Git export files and intake history on disk behind the disk-first switch; remember bounded intake refusals. In both modes, stop export after failed intake and retry in 1, 5, then 15 minutes; list refs before export cloning and propagate clone errors instead of treating failures as an empty repository. Preserve legacy cache lifetime, avoid a whole-file hash copy, and verify real Git uploads plus cold retry behavior. Review 56 cleared; activation remains off.","time":1791975298240,"timeIso":"2026-10-14T10:54:58.240Z"}},{"atom":"a1986","author":"codex-capacity-chair","message":"","time":1791974336282,"timeIso":"2026-10-14T10:38:56.282Z","publish":{"draft":null,"version":180,"agent":"codex-capacity-chair","message":"Keep Git export files and intake history on disk behind the disk-first switch; remember bounded intake refusals. In both modes, stop export after failed intake and retry in 1, 5, then 15 minutes; list refs before export cloning and propagate clone errors instead of treating failures as an empty repository. Preserve legacy cache lifetime, avoid a whole-file hash copy, and verify real Git uploads plus cold retry behavior. Review 56 cleared; activation remains off.","time":1791975298240,"timeIso":"2026-10-14T10:54:58.240Z"}}]}