{"draft":null,"from":175,"to":318,"files":[{"path":"server/src/engine-project.ts","added":49,"removed":4,"diff":"--- a/server/src/engine-project.ts\n+++ b/server/src/engine-project.ts\n@@ -9,6 +9,7 @@\n import { type Entry, type ProjectStore as LogStore, MemoryStore, Project } from \"../../worker/project/project.ts\";\n import type { EditBody, ProjectCalls, ProjectHistory } from \"../../worker/project/project-api.ts\";\n import { where } from \"../../worker/project/where.ts\";\n+import type { PushSnapshotMetadata } from \"./push-snapshot.ts\";\n \n /** The parts of a Durable Object's storage the log and blob store use, declared structurally so tests can stand in. */\n export interface SqliteStorage {\n@@ -495,8 +496,12 @@\n \t\t\t...(folder !== undefined ? { folder } : {}),\n \t\t});\n \t}\n-\twhy(file: string, line: number, draft?: string, agent?: string) {\n-\t\treturn why(this.project, file, line, { ...(draft ? { draft } : {}), ...(agent ? { agent } : {}) });\n+\twhy(file: string, line: number, draft?: string, agent?: string, version?: number) {\n+\t\treturn why(this.project, file, line, {\n+\t\t\t...(draft ? { draft } : {}),\n+\t\t\t...(agent ? { agent } : {}),\n+\t\t\t...(version !== undefined ? { version } : {}),\n+\t\t});\n \t}\n \twhere() {\n \t\treturn where(this.project);\n@@ -518,9 +523,13 @@\n \tfileAt(path: string, version: number, draft: string | null, agent?: string) {\n \t\treturn this.project.fileAt(path, version, { draft, ...(agent ? { agent } : {}) });\n \t}\n-\tcompare(from: number, to: number, draft: string | null, agent?: string) {\n-\t\treturn this.project.compare(from, to, { draft, ...(agent ? { agent } : {}) });\n+\tcompare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean) {\n+\t\tconst where = { draft, ...(agent ? { agent } : {}) };\n+\t\treturn summary ? this.project.compareSummary(from, to, where) : this.project.compare(from, to, where);\n \t}\n+\twithout(version: number, versions: readonly number[]) {\n+\t\treturn this.project.without(version, versions);\n+\t}\n \tshow(version: number, draft: string | null, agent?: string) {\n \t\treturn this.project.show(version, { draft, ...(agent ? { agent } : {}) });\n \t}\n@@ -563,6 +572,10 @@\n \tannouncePerson(person: { id: string; name: string }, text: string, to?: string[]) {\n \t\treturn this.project.announcePerson(person, text, to, Date.now());\n \t}\n+\t/** A seat's earlier chat hears that another chat used the seat (277, groups); as abso's worker has it. */\n+\tseatNotice(agent: string, place: string, key: string) {\n+\t\treturn this.project.seatNotice(agent, place, key);\n+\t}\n \tstarting(agent: string, text: string | null, files?: string[], options: { issue?: unknown; done?: unknown } = {}) {\n \t\treturn this.project.starting(agent, text, files, Date.now(), options);\n \t}\n@@ -807,6 +820,38 @@\n \tfilesAt(version: number) {\n \t\treturn this.project.viewAt(version).files();\n \t}\n+\tfileTextAt(version: number, path: string): string {\n+\t\treturn this.project.viewAt(version).text(path);\n+\t}\n+\t/** One scoped batch: at most 64 files and 64 Ki characters plus one whole file. */\n+\tfileTextsAt(version: number, paths: readonly string[]): Record<string, string> {\n+\t\tconst view = this.project.viewAt(version);\n+\t\tconst files: Record<string, string> = Object.create(null);\n+\t\tlet characters = 0;\n+\t\tfor (const path of paths.slice(0, 64)) {\n+\t\t\tconst text = view.attrs(path).link !== null ? \"\" : view.text(path);\n+\t\t\tfiles[path] = text;\n+\t\t\tcharacters += text.length;\n+\t\t\tif (characters >= 65536) break;\n+\t\t}\n+\t\treturn files;\n+\t}\n+\t/** Capture metadata now; each text read reopens the captured version in a fresh host scope. */\n+\tsharedPushMetadata(): PushSnapshotMetadata {\n+\t\tconst version = this.project.version;\n+\t\tconst view = this.project.viewAt(version);\n+\t\tconst paths: string[] = [];\n+\t\tconst modes: PushSnapshotMetadata[\"modes\"] = Object.create(null);\n+\t\tconst blobs: Record<string, string> = Object.create(null);\n+\t\tfor (const path of view.paths()) {\n+\t\t\tconst attrs = view.attrs(path);\n+\t\t\tmodes[path] = { exec: attrs.exec, link: attrs.link };\n+\t\t\tif (attrs.blob !== null) blobs[path] = attrs.blob;\n+\t\t\telse paths.push(path);\n+\t\t}\n+\t\tconst by = version > 0 ? this.project.published(version) : undefined;\n+\t\treturn { version, paths, modes, blobs, ...(by ? { last: { agent: by.agent, message: by.message } } : {}) };\n+\t}\n \tblobsAt(version: number) {\n \t\treturn this.project.viewAt(version).blobs();\n \t}"}],"unmatched":[]}