mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
feat(walkthrough): plan-then-explain generation with selectable diff sources
This commit is contained in:
1 parent
aeea96b466
commit
88b3543dc1
35 files changed
+2583
-609
No files matched your search
@@ -1,12 +1,22 @@
|
||||
import { z } from 'zod'
|
||||
import { getBranchNameError } from '../utils/repo'
|
||||
|
||||
const branchNameSchema = z.string().trim().superRefine((value, ctx) => {
|
||||
function addBranchNameIssue(value: string, ctx: z.RefinementCtx) {
|
||||
const error = getBranchNameError(value)
|
||||
if (error) {
|
||||
ctx.addIssue({ code: 'custom', message: error })
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
const branchNameSchema = z.string().trim().superRefine(addBranchNameIssue)
|
||||
|
||||
export const gitRefSchema = z
|
||||
.string()
|
||||
.trim()
|
||||
.min(1)
|
||||
.max(200)
|
||||
.regex(/^\S+$/)
|
||||
.superRefine(addBranchNameIssue)
|
||||
|
||||
export const RenameBranchRequestSchema = z.object({
|
||||
from: branchNameSchema,
|
||||
|
||||
Reference in new issue
Block a user