File size: 1,387 Bytes
5b5da0e
 
 
 
 
 
fd0a8b6
cae0460
fd0a8b6
5b5da0e
 
 
 
 
 
 
 
 
 
 
 
ad23973
ea9d6ed
5b5da0e
 
bd25310
 
 
5b5da0e
 
 
 
bd25310
5b5da0e
 
 
 
 
 
 
 
 
 
 
fd0a8b6
5b5da0e
 
 
 
b53cd8f
 
5b5da0e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
export type SessionState = 'working' | 'waiting' | 'idle' | 'stopped';

export interface Session {
  id: string;
  name: string;
  cli: string;
  // Workspace-relative folder the agent runs in. Independent of `name` —
  // renaming never moves anything on disk. ''/null = the workspace root.
  path: string | null;
  createdAt: string;
  everStarted: boolean;
  running: boolean;
  state: SessionState;
}

export interface Cli {
  id: string;
  label: string;
  color: string;
  available: boolean;
  ready?: boolean;
  version?: string | null;
  setup?: string | null; // how to configure it (shown on the "needs setup" hint)
}

// Pane arrangement for a group's tiles. Absent/null = auto (grow with agents).
export interface GridSpec { cols: number; rows: number }

export interface Group {
  id: string;
  name: string;
  sessionIds: string[];
  layout?: GridSpec | null;
  createdAt?: string;
}

export interface Tree {
  order: string[]; // refs: "g:<id>" | "s:<id>"
  groups: Group[];
  sessions: Session[];
}

export const STATE_LABEL: Record<SessionState, string> = {
  working: 'working',
  waiting: 'your turn',
  idle: 'idle',
  stopped: 'stopped',
};

export type OverviewFilter = 'all' | 'waiting' | 'working' | 'quiet';

export type MoveTarget =
  | { kind: 'into'; groupId: string }
  | { kind: 'pair'; sessionId: string }
  | { kind: 'before' | 'after'; ref: string };