feat(git): extend source control with worktrees, stashes, conflicts and identities

- Create a worktree from a new or existing branch
- Integrate a worktree branch into a target branch by merge commit or cherry-pick, with continue/abort on conflicts
- Delete a worktree with keep, delete-local, or delete-local-and-remote branch options, using safe branch deletion for unmerged branches
- Add a stash tab (list, push, apply, pop, drop) shared across a repository and its worktrees
- Rename and delete branches, optionally deleting the remote branch and updating scheduled base branches
- Detect in-progress merge, rebase, cherry-pick and revert operations and hand conflicts to an agent session
- Generate commit messages from staged changes with the default model
- Add a default git identity and saved per-repository identities written to git config
- Unify git error mapping behind a typed error and one route helper; consolidate git mutations and cache invalidation
- Update repository docs
This commit is contained in:
Chris Scott committed 2026-10-03 21:59:00 -04:00
1 parent 52b6147ed3
commit 53238a6324
89 files changed
+7704 -793

No files matched your search

+10
View File
@@ -11,7 +11,17 @@ export type GitErrorCode =
| 'DETACHED_HEAD'
| 'BRANCH_EXISTS'
| 'BRANCH_NOT_FOUND'
| 'BRANCH_CHECKED_OUT'
| 'BRANCH_IN_OTHER_WORKTREE'
| 'BRANCH_NOT_MERGED'
| 'STASH_CHANGED'
| 'UNCOMMITTED_CHANGES'
| 'NO_OPERATION_IN_PROGRESS'
| 'INTEGRATE_DETACHED_HEAD'
| 'INTEGRATE_INTO_SELF'
| 'INTEGRATE_TARGET_NOT_CHECKED_OUT'
| 'INTEGRATE_TARGET_NOT_MANAGED'
| 'INTEGRATE_NOTHING_TO_INTEGRATE'
| 'UNKNOWN'
export type ApiErrorCode = GitErrorCode | 'INVALID_JSON' | 'TIMEOUT'
+32 -1
View File
@@ -18,10 +18,26 @@ import {
DiscoverReposRequestSchema,
DiscoverReposResponseSchema,
UpdateRepoRequestSchema,
DeleteRepoRequestSchema,
DeleteRepoResultSchema,
RepoStatusSchema,
AssistantModeStatusSchema,
AssistantModeInitRequestSchema,
} from '../schemas/repo'
import {
RenameBranchRequestSchema,
DeleteBranchRequestSchema,
DeleteBranchResultSchema,
GitStashEntrySchema,
StashPushRequestSchema,
StashApplyRequestSchema,
StashDropRequestSchema,
GitOperationKindSchema,
GitOperationStateSchema,
IntegrateBranchRequestSchema,
IntegrateBranchResultSchema,
RepoGitIdentitySchema,
} from '../schemas/git'
import {
FileInfoSchema,
CreateFileRequestSchema,
@@ -73,9 +89,24 @@ export type DiscoverReposRequest = z.infer<typeof DiscoverReposRequestSchema>
export type DiscoverReposResponse = z.infer<typeof DiscoverReposResponseSchema>
export type RepoStatus = z.infer<typeof RepoStatusSchema>
export type UpdateRepoRequest = z.infer<typeof UpdateRepoRequestSchema>
export type DeleteRepoRequest = z.infer<typeof DeleteRepoRequestSchema>
export type DeleteRepoResult = z.infer<typeof DeleteRepoResultSchema>
export type AssistantModeStatus = z.infer<typeof AssistantModeStatusSchema>
export type AssistantModeInitRequest = z.infer<typeof AssistantModeInitRequestSchema>
export type RenameBranchRequest = z.infer<typeof RenameBranchRequestSchema>
export type DeleteBranchRequest = z.infer<typeof DeleteBranchRequestSchema>
export type DeleteBranchResult = z.infer<typeof DeleteBranchResultSchema>
export type GitStashEntry = z.infer<typeof GitStashEntrySchema>
export type StashPushRequest = z.infer<typeof StashPushRequestSchema>
export type StashApplyRequest = z.infer<typeof StashApplyRequestSchema>
export type StashDropRequest = z.infer<typeof StashDropRequestSchema>
export type GitOperationKind = z.infer<typeof GitOperationKindSchema>
export type GitOperationState = z.infer<typeof GitOperationStateSchema>
export type IntegrateBranchRequest = z.infer<typeof IntegrateBranchRequestSchema>
export type IntegrateBranchResult = z.infer<typeof IntegrateBranchResultSchema>
export type RepoGitIdentity = z.infer<typeof RepoGitIdentitySchema>
export type FileInfo = z.infer<typeof FileInfoSchema>
export type CreateFileRequest = z.infer<typeof CreateFileRequestSchema>
export type RenameFileRequest = z.infer<typeof RenameFileRequestSchema>
@@ -111,7 +142,7 @@ export interface SuccessResponse {
}
export type { SSHHostKeyRequest, SSHHostKeyResponse, TrustedSSHHost } from '../schemas/ssh'
export type { GitCredential } from '../schemas/settings'
export type { GitCredential, GitIdentityProfile } from '../schemas/settings'
export type {
ProviderApiConfig,
ModelConfig,