authorgravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-08 23:19:01-08:00
committergravatar for julius0216@outlook.comJulius Marminge <julius0216@outlook.com> 2026-02-11 09:00:18-08:00
log59448593d8e6b067e1691150f1925107114f3cc7
tree5526c60e0d063f1d335166a50419b477663b1c63
parent3047974fdc759674eeac3969456656e3b8bf40d1

Add git checkout support and clear errors on success

Wire up git:checkout IPC channel across the full stack so branch selection actually checks out the branch. Clear error banners when a subsequent checkout or branch creation succeeds. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

2 files changed, 8 insertions(+), 0 deletions(-)

packages/contracts/src/git.ts+6
...@@ -22,6 +22,11 @@ export const gitCreateBranchInputSchema = z.object({...@@ -22,6 +22,11 @@ export const gitCreateBranchInputSchema = z.object({
22 branch: z.string().min(1),22 branch: z.string().min(1),
23});23});
2424
25export const gitCheckoutInputSchema = z.object({
26 cwd: z.string().min(1),
27 branch: z.string().min(1),
28});
29
25export const gitInitInputSchema = z.object({30export const gitInitInputSchema = z.object({
26 cwd: z.string().min(1),31 cwd: z.string().min(1),
27});32});
...@@ -50,6 +55,7 @@ export type GitRemoveWorktreeInput = z.infer<...@@ -50,6 +55,7 @@ export type GitRemoveWorktreeInput = z.infer<
50 typeof gitRemoveWorktreeInputSchema55 typeof gitRemoveWorktreeInputSchema
51>;56>;
52export type GitCreateBranchInput = z.infer<typeof gitCreateBranchInputSchema>;57export type GitCreateBranchInput = z.infer<typeof gitCreateBranchInputSchema>;
58export type GitCheckoutInput = z.infer<typeof gitCheckoutInputSchema>;
53export type GitInitInput = z.infer<typeof gitInitInputSchema>;59export type GitInitInput = z.infer<typeof gitInitInputSchema>;
5460
55export interface GitListBranchesResult {61export interface GitListBranchesResult {
packages/contracts/src/ipc.ts+2
...@@ -1,5 +1,6 @@...@@ -1,5 +1,6 @@
1import type { AgentConfig, AgentExit, OutputChunk } from "./agent";1import type { AgentConfig, AgentExit, OutputChunk } from "./agent";
2import type {2import type {
3 GitCheckoutInput,
3 GitCreateBranchInput,4 GitCreateBranchInput,
4 GitCreateWorktreeInput,5 GitCreateWorktreeInput,
5 GitCreateWorktreeResult,6 GitCreateWorktreeResult,
...@@ -76,6 +77,7 @@ export interface NativeApi {...@@ -76,6 +77,7 @@ export interface NativeApi {
76 createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;77 createWorktree: (input: GitCreateWorktreeInput) => Promise<GitCreateWorktreeResult>;
77 removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;78 removeWorktree: (input: GitRemoveWorktreeInput) => Promise<void>;
78 createBranch: (input: GitCreateBranchInput) => Promise<void>;79 createBranch: (input: GitCreateBranchInput) => Promise<void>;
80 checkout: (input: GitCheckoutInput) => Promise<void>;
79 init: (input: GitInitInput) => Promise<void>;81 init: (input: GitInitInput) => Promise<void>;
80 };82 };
81}83}