import type { FileDiff } from "./types.ts"; /** * Where an edit lands: the working copy, or with `change` a jj commit, whose `identity` is then its commit id, which * every rewrite changes. */ export type WorkingCopy = { machine: string; root: string; vcs: "jj" | "git"; identity: string; change?: string; }; export type OpenFile = { working: WorkingCopy; file: FileDiff; original: string; content: string; version: string; }; export type Save = { session: string; id: string; working: WorkingCopy; path: string; version: string; content: string; /** Save a commit even though its descendants then conflict. */ force?: boolean; }; export type Saved = { id: string; working: WorkingCopy; path: string; version: string; patch: string; }; export type Event = | { type: "saved"; session: string; save: Saved } | { type: "finished"; session: string; timestamp: number; paths: string[] }; export type Session = { saves: Saved[]; finished: number | null }; export type State = { sessions: Record };