Skip to content

Commit 6331c3f

Browse files
committed
Prefer interfaces for chrome snapshot object shapes
1 parent b6d7fd3 commit 6331c3f

1 file changed

Lines changed: 18 additions & 18 deletions

File tree

src/tui/chrome-state.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ import type { ChromeZoneContent } from "./shell.js";
5050
export const AGENTS_PANEL_LINGER_MS = 4_000;
5151

5252
/** Subagent row shape for the agents chrome panel (store-agnostic). */
53-
export type ChromeAgentSession = {
53+
export interface ChromeAgentSession {
5454
readonly agentId: string;
5555
readonly description: string;
5656
readonly status: "running" | "done" | "failed" | "cancelled";
@@ -72,29 +72,29 @@ export type ChromeAgentSession = {
7272
* window on the strip (`AGENTS_PANEL_LINGER_MS`); absent → no linger paint.
7373
*/
7474
readonly finishedAt?: number;
75-
};
75+
}
7676

7777
/** Lightweight task row: title + status, as written by the task tool. */
78-
export type ChromeTaskRow = {
78+
export interface ChromeTaskRow {
7979
readonly title: string;
8080
readonly status: "todo" | "doing" | "done" | "cancelled";
81-
};
81+
}
8282

8383
/**
8484
* One rendered task-panel row. `status` is null for a non-task row (the
8585
* "+N more" trailer, or a bare-string task input with no structured status)
8686
* so the renderer knows not to paint a status marker for it.
8787
*/
88-
export type TaskPanelRow = {
88+
export interface TaskPanelRow {
8989
readonly label: string;
9090
readonly status: "todo" | "doing" | "done" | "cancelled" | null;
91-
};
91+
}
9292

9393
/**
9494
* Full live chrome snapshot. Missing / null fields hide that zone.
9595
* Prefer pushing a complete snapshot on every update.
9696
*/
97-
export type ChromeLiveState = {
97+
export interface ChromeLiveState {
9898
/**
9999
* Task list: the structured rows the task tool writes. Distinct from
100100
* `agents` — a task is a unit of work with a status, not an executor.
@@ -110,7 +110,7 @@ export type ChromeLiveState = {
110110
readonly agentId: string;
111111
readonly description: string;
112112
} | null;
113-
};
113+
}
114114

115115
/**
116116
* One rendered agents-panel row. `stalled` is a fact the formatter already
@@ -119,7 +119,7 @@ export type ChromeLiveState = {
119119
* marker, agentId + description) is the part the renderer may ellipsize under
120120
* width pressure; `tail` (clock/tool) must never be trimmed away.
121121
*/
122-
export type AgentPanelRow = {
122+
export interface AgentPanelRow {
123123
readonly label: string;
124124
readonly tail: string;
125125
readonly stalled: boolean;
@@ -133,7 +133,7 @@ export type AgentPanelRow = {
133133
* terminal linger uses done/error/dim. Absent ⇒ treat as live running.
134134
*/
135135
readonly status?: "running" | "done" | "failed" | "cancelled";
136-
};
136+
}
137137

138138
/**
139139
* Board paint order for main's `LaneState` vocabulary — trouble first so an
@@ -143,12 +143,12 @@ export type AgentPanelRow = {
143143
const BOARD_LANE_ORDER: readonly LaneState[] = ["stalled", "in_tool", "working"];
144144

145145
/** Always-populated result for setChromeZones (null = hide zone). */
146-
export type FormattedChromeZones = {
146+
export interface FormattedChromeZones {
147147
/** One row per rendered task-panel line (null = hide zone, zero rows). */
148148
readonly task: readonly TaskPanelRow[] | null;
149149
/** One row per rendered agents-panel line (null = hide zone, zero rows). */
150150
readonly agents: readonly AgentPanelRow[] | null;
151-
};
151+
}
152152

153153
/**
154154
* Format structured live state into chrome zone rows for setChromeZones.
@@ -479,16 +479,16 @@ export function annotateAgentTools(
479479
// ---------------------------------------------------------------------------
480480

481481
/** manage_tasks / Task-shaped row (title + status). */
482-
export type ChromeSessionTask = {
482+
export interface ChromeSessionTask {
483483
readonly title: string;
484484
readonly status: "todo" | "doing" | "done" | "cancelled";
485-
};
485+
}
486486

487487
/**
488488
* SubAgentSession-shaped strip row. `agentId` preferred; falls back to `id`
489489
* when the store only exposes a session id.
490490
*/
491-
export type ChromeSessionAgent = {
491+
export interface ChromeSessionAgent {
492492
readonly agentId?: string;
493493
readonly id?: string;
494494
readonly description: string;
@@ -499,16 +499,16 @@ export type ChromeSessionAgent = {
499499
readonly startedAt?: number;
500500
readonly lastActivityAt?: number;
501501
readonly finishedAt?: number;
502-
};
502+
}
503503

504504
/**
505505
* Live session bags the product host already holds. Missing fields omit zones.
506506
*/
507-
export type ChromeSessionInput = {
507+
export interface ChromeSessionInput {
508508
readonly tasks?: readonly ChromeSessionTask[] | null;
509509
readonly agents?: readonly ChromeSessionAgent[] | null;
510510
readonly observe?: ChromeLiveState["observe"];
511-
};
511+
}
512512

513513
/**
514514
* Map real session shapes (tasks / subagent store) into ChromeLiveState for

0 commit comments

Comments
 (0)