char-slop/berry

multipurpose self-modifiable agentic harness

git clone https://git.t4t.associates/char-slop/berry

Charlotte Somadd crop info to browser_screenshot tool6331fb8

main
1.7 KiB54 linesraw
1export type ElementInfo = {
2  ref: string;
3  role: string;
4  name: string;
5  value?: string;
6  disabled?: boolean;
7  checked?: boolean;
8  options?: { label: string; value: string; selected: boolean }[];
9};
10
11export type Snapshot = {
12  tab: string;
13  url: string;
14  title: string;
15  text: string;
16  elements: ElementInfo[];
17  truncated: boolean;
18  frames: { url: string; title: string }[];
19  diagnostics: 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 = {
45  tabs: Snapshot[];
46  history: { action: string; tab: string; url: string; at: number }[];
47};
48
49export type BrowserViewData = {
50  active: boolean;
51  tabs: Snapshot[];
52  history: State["history"];
53  screenshots: { tab: string; image: Image }[];
54};