char-slop/berry
multipurpose self-modifiable agentic harness
git clone https://git.t4t.associates/char-slop/berry
9b84ad5
main
1// What the server sends the view. 2 3import type { FileDiff } from "./patch.ts" ; 4 5export type { FileDiff , Hunk } from "./patch.ts" ; 6 7/** An id as jj shows it: the shortest unique prefix, then a few more characters. */ 8export type Id = { full :string ; prefix :string ; rest :string }; 9 10/** A commit, or jj's change, in the log. */ 11export type Revision = { 12/** What the view's route names it by: jj's change id or git's commit hash, or `""` for the working copy. */ 13route :string ; 14/** jj's change id. */ 15change :Id | null ; 16/** `null` for git's working tree, which is not one yet. */ 17commit :Id | null ; 18description :string ; 19author :{ name :string ; string ; timestamp :string } | null ; 20/** Bookmarks, branches and tags at it. */ 21refs :string []; 22workingCopy :boolean ; 23empty :boolean ; 24immutable :boolean ; 25conflict :boolean ; 26}; 27 28/** A file's change as it is sent: left out, but for its key, when the view has it already. */ 29export type Sent = { key :string ; diff :FileDiff | null }; 30 31/** A repository's recent history, and one revision's changes. */ 32export type Shown = { 33vcs :"jj" | "git" ; 34root :string ; 35/** From the working copy back. */ 36log :Revision []; 37revision :Revision ; 38files :FileDiff []; 39/** Untracked files in git's working tree past those shown. */ 40omitted :number ; 41}; 42 43/** What the view is sent: what it shows, but each file's change only if it did not have that already. */ 44export type Reply = Omit < Shown , "files" > & { files :Sent [] };