feat(schedules): add workspace modes and worktree management

This commit is contained in:
Chris Scott committed 2026-10-06 10:16:34 -04:00
1 parent c06075651d
commit 6ec3f3bd91
90 files changed
+2084 -801

No files matched your search

+18 -2
View File
@@ -87,8 +87,24 @@ export function getBranchNameError(name: string): string | null {
return null
}
export function isWorktreeSibling(sibling: { worktreeStrategy?: string }): boolean {
return sibling.worktreeStrategy !== undefined
/**
* Who owns a repo worktree: OpenCode, a schedule, or nobody (a plain git worktree).
*/
export type RepoWorktreeSource = 'opencode' | 'schedule' | 'git'
/**
* The schedule a worktree belongs to. `runId` is null for the schedule's shared worktree,
* and `inUse` is true while a running run works in it.
*/
export interface RepoWorktreeSchedule {
repoId: number
jobId: number
runId: number | null
inUse: boolean
}
export function isWorktreeSibling(sibling: { worktreeSource?: RepoWorktreeSource }): boolean {
return sibling.worktreeSource !== undefined
}
export function getRepoBaseDirectoryName(repo: { localPath: string; branch?: string; isWorktree?: boolean }): string {