char-slop/berry
multipurpose self-modifiable agentic harness
git clone https://git.t4t.associates/char-slop/berry
15e7101
main
1import type { FileDiff } from "./types.ts" ; 2 3/** 4* Where an edit lands: the working copy, or with `change` a jj commit, whose `identity` is then its commit id, which 5* every rewrite changes. 6*/ 7export type WorkingCopy = { 8machine :string ; 9root :string ; 10vcs :"jj" | "git" ; 11identity :string ; 12change ?:string ; 13}; 14 15export type OpenFile = { 16working :WorkingCopy ; 17file :FileDiff ; 18original :string ; 19content :string ; 20version :string ; 21}; 22 23export type Save = { 24session :string ; 25id :string ; 26working :WorkingCopy ; 27path :string ; 28version :string ; 29content :string ; 30/** Save a commit even though its descendants then conflict. */ 31force ?:boolean ; 32}; 33 34export type Saved = { 35id :string ; 36working :WorkingCopy ; 37path :string ; 38version :string ; 39patch :string ; 40}; 41 42export type Event = 43| { type :"saved" ; session :string ; save :Saved } 44| { type :"finished" ; session :string ; timestamp :number ; paths :string [] }; 45 46export type Session = { saves :Saved []; finished :number | null }; 47export type State = { sessions :Record < string , Session > };