char-slop/berry
multipurpose self-modifiable agentic harness
git clone https://git.t4t.associates/char-slop/berry
6331fb8
main
1export type ElementInfo = { 2ref :string ; 3role :string ; 4name :string ; 5value ?:string ; 6disabled ?:boolean ; 7checked ?:boolean ; 8options ?:{ label :string ; value :string ; selected :boolean }[]; 9}; 10 11export type Snapshot = { 12tab :string ; 13url :string ; 14title :string ; 15text :string ; 16elements :ElementInfo []; 17truncated :boolean ; 18frames :{ url :string ; title :string }[]; 19diagnostics :string []; 20}; 21 22export type Image = { type :"image" ; data :string ; mimeType :"image/png" }; 23export type Crop = { x :number ; y :number ; width :number ; height :number }; 24export type Action = 25| { action :"open" ; url :string } 26| { action :"tabs" } 27| { action :"snapshot" ; tab :string } 28| { action :"click" ; tab :string ; ref :string } 29| { action :"fill" ; tab :string ; ref :string ; text :string } 30| { action :"select" ; tab :string ; ref :string ; value :string } 31| { action :"press" ; tab :string ; key :string ; ref ?:string } 32| { action :"scroll" ; tab :string ; x :number ; y :number } 33| { action :"navigate" ; tab :string ; url :string } 34| { action :"back" | "forward" | "reload" ; tab :string } 35| { action :"wait" ; tab :string ; ms :number } 36| { action :"close" ; tab :string } 37| { action :"reset" }; 38 39export type Event = 40| { type :"observed" ; version :1 ; action :string ; snapshot :Snapshot ; at :number } 41| { type :"closed" ; version :1 ; tab :string ; at :number } 42| { type :"reset" ; version :1 ; at :number }; 43 44export type State = { 45tabs :Snapshot []; 46history :{ action :string ; tab :string ; url :string ; at :number }[]; 47}; 48 49export type BrowserViewData = { 50active :boolean ; 51tabs :Snapshot []; 52history :State [ "history" ]; 53screenshots :{ tab :string ; image :Image }[]; 54};