Lines 9–15 at 318 (were 9–14 at 175)
99import { type Entry, type ProjectStore as LogStore, MemoryStore, Project } from "../../worker/project/project.ts"; 1010import type { EditBody, ProjectCalls, ProjectHistory } from "../../worker/project/project-api.ts"; 1111import { where } from "../../worker/project/where.ts"; 12+import type { PushSnapshotMetadata } from "./push-snapshot.ts"; 1314/** The parts of a Durable Object's storage the log and blob store use, declared structurally so tests can stand in. */ 1415export interface SqliteStorage { Lines 496–507 at 318 (were 495–502 at 175)
495496 ...(folder !== undefined ? { folder } : {}), 498− why(file: string, line: number, draft?: string, agent?: string) {
499− return why(this.project, file, line, { ...(draft ? { draft } : {}), ...(agent ? { agent } : {}) });
499+ why(file: string, line: number, draft?: string, agent?: string, version?: number) { 500+ return why(this.project, file, line, { 501+ ...(draft ? { draft } : {}), 502+ ...(agent ? { agent } : {}), 503+ ...(version !== undefined ? { version } : {}), 502507 return where(this.project); Lines 523–535 at 318 (were 518–526 at 175)
518523 fileAt(path: string, version: number, draft: string | null, agent?: string) { 519524 return this.project.fileAt(path, version, { draft, ...(agent ? { agent } : {}) }); 521− compare(from: number, to: number, draft: string | null, agent?: string) {
522− return this.project.compare(from, to, { draft, ...(agent ? { agent } : {}) });
526+ compare(from: number, to: number, draft: string | null, agent?: string, summary?: boolean) { 527+ const where = { draft, ...(agent ? { agent } : {}) }; 528+ return summary ? this.project.compareSummary(from, to, where) : this.project.compare(from, to, where); 530+ without(version: number, versions: readonly number[]) { 531+ return this.project.without(version, versions); 524533 show(version: number, draft: string | null, agent?: string) { 525534 return this.project.show(version, { draft, ...(agent ? { agent } : {}) }); Lines 572–581 at 318 (were 563–568 at 175)
563572 announcePerson(person: { id: string; name: string }, text: string, to?: string[]) { 564573 return this.project.announcePerson(person, text, to, Date.now()); 575+ /** A seat's earlier chat hears that another chat used the seat (277, groups); as abso's worker has it. */ 576+ seatNotice(agent: string, place: string, key: string) { 577+ return this.project.seatNotice(agent, place, key); 566579 starting(agent: string, text: string | null, files?: string[], options: { issue?: unknown; done?: unknown } = {}) { 567580 return this.project.starting(agent, text, files, Date.now(), options); Lines 820–857 at 318 (were 807–812 at 175)
807820 filesAt(version: number) { 808821 return this.project.viewAt(version).files(); 823+ fileTextAt(version: number, path: string): string { 824+ return this.project.viewAt(version).text(path); 826+ /** One scoped batch: at most 64 files and 64 Ki characters plus one whole file. */ 827+ fileTextsAt(version: number, paths: readonly string[]): Record<string, string> { 828+ const view = this.project.viewAt(version); 829+ const files: Record<string, string> = Object.create(null); 831+ for (const path of paths.slice(0, 64)) { 832+ const text = view.attrs(path).link !== null ? "" : view.text(path); 834+ characters += text.length; 835+ if (characters >= 65536) break; 839+ /** Capture metadata now; each text read reopens the captured version in a fresh host scope. */ 840+ sharedPushMetadata(): PushSnapshotMetadata { 841+ const version = this.project.version; 842+ const view = this.project.viewAt(version); 843+ const paths: string[] = []; 844+ const modes: PushSnapshotMetadata["modes"] = Object.create(null); 845+ const blobs: Record<string, string> = Object.create(null); 846+ for (const path of view.paths()) { 847+ const attrs = view.attrs(path); 848+ modes[path] = { exec: attrs.exec, link: attrs.link }; 849+ if (attrs.blob !== null) blobs[path] = attrs.blob; 850+ else paths.push(path); 852+ const by = version > 0 ? this.project.published(version) : undefined; 853+ return { version, paths, modes, blobs, ...(by ? { last: { agent: by.agent, message: by.message } } : {}) }; 810855 blobsAt(version: number) { 811856 return this.project.viewAt(version).blobs();