Add git event types to ClientMessage and SSEEvent
This commit is contained in:
parent
0489864652
commit
3b5e636730
2 changed files with 20 additions and 0 deletions
|
|
@ -47,6 +47,8 @@ function createDefaultSessionState(): SessionState {
|
||||||
mode: "normal",
|
mode: "normal",
|
||||||
model: null,
|
model: null,
|
||||||
idle_since: null,
|
idle_since: null,
|
||||||
|
git_branch: null,
|
||||||
|
git_files_json: null,
|
||||||
dirty: false,
|
dirty: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
18
src/types.ts
18
src/types.ts
|
|
@ -136,6 +136,16 @@ export type ClientMessage =
|
||||||
tool_timestamps: number[];
|
tool_timestamps: number[];
|
||||||
session_start: number;
|
session_start: number;
|
||||||
idle_since: number | null;
|
idle_since: number | null;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
type: "git";
|
||||||
|
branch: string;
|
||||||
|
files: Array<{
|
||||||
|
path: string;
|
||||||
|
status: string;
|
||||||
|
additions: number;
|
||||||
|
deletions: number;
|
||||||
|
}>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ServerMessage =
|
export type ServerMessage =
|
||||||
|
|
@ -191,6 +201,12 @@ export type SSEEvent =
|
||||||
mode: "normal" | "auto_accept" | "plan";
|
mode: "normal" | "auto_accept" | "plan";
|
||||||
model: string | null;
|
model: string | null;
|
||||||
idle_since: number | null;
|
idle_since: number | null;
|
||||||
|
}
|
||||||
|
| {
|
||||||
|
type: "git";
|
||||||
|
session_id: number;
|
||||||
|
branch: string;
|
||||||
|
files_json: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
// Session state tracking (in-memory)
|
// Session state tracking (in-memory)
|
||||||
|
|
@ -212,5 +228,7 @@ export interface SessionState {
|
||||||
mode: "normal" | "auto_accept" | "plan";
|
mode: "normal" | "auto_accept" | "plan";
|
||||||
model: string | null;
|
model: string | null;
|
||||||
idle_since: number | null;
|
idle_since: number | null;
|
||||||
|
git_branch: string | null;
|
||||||
|
git_files_json: string | null;
|
||||||
dirty: boolean;
|
dirty: boolean;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue