feat(ocm-move): plan worktree mirror targets and stream move progress (#345)

* feat(ocm-move): plan worktree mirror targets and stream move progress

- Plan/ensure mirror targets per branch via new internal endpoints, creating a worktree repo when the target branch is not checked out in the source repo
- Skip branches checked out in other worktrees during bundle import and reset/clean before checkout on both server and CLI
- Rewrite workspace paths in message.updated events when replaying moved sessions
- Stream live move progress (bundle, upload, import, patch, replay) in the TUI
- Prefer branch-matched repos when moving sessions and share push-divergence descriptions

* chore(ocm-cli): bump version to 0.2.7

* fix(ocm): harden worktree mirror synchronization

* fix(ocm): protect active branch during branchless pull
This commit is contained in:
Chris Scott authored and GitHub committed 2026-09-01 22:14:48 -04:00
1 parent 4ed3460759
commit 68d586f183
23 files changed
+2026 -158

No files matched your search

+31
View File
@@ -110,3 +110,34 @@ export const AssistantModeInitRequestSchema = z.object({
overwriteAgentsMd: z.boolean().optional(),
overwriteOpenCodeConfig: z.boolean().optional(),
})
export const MirrorTargetBranchRequestSchema = z.object({
branch: z.string().trim().min(1),
})
export type MirrorTargetBranchRequest = z.infer<typeof MirrorTargetBranchRequestSchema>
const MirrorTargetPlanBaseSchema = z.object({
fullPath: z.string().min(1),
localPath: z.string().min(1),
branch: z.string().min(1),
currentBranch: z.string().min(1).nullable(),
})
export const MirrorTargetPlanResponseSchema = z.discriminatedUnion('kind', [
MirrorTargetPlanBaseSchema.extend({ kind: z.literal('new'), repoId: z.literal(null) }),
MirrorTargetPlanBaseSchema.extend({ kind: z.literal('in-place'), repoId: z.number().int().positive() }),
MirrorTargetPlanBaseSchema.extend({ kind: z.literal('existing'), repoId: z.number().int().positive() }),
])
export type MirrorTargetPlanResponse = z.infer<typeof MirrorTargetPlanResponseSchema>
export const MirrorTargetEnsureResponseSchema = z.object({
repoId: z.number().int().positive(),
fullPath: z.string().min(1),
localPath: z.string().min(1),
branch: z.string().min(1),
created: z.boolean(),
})
export type MirrorTargetEnsureResponse = z.infer<typeof MirrorTargetEnsureResponseSchema>