docs(command): restore zod async comments

kit/effectify-command-review
Kit Langton 2026-03-21 19:58:38 -04:00
parent 7053c58d35
commit addc33212b
1 changed files with 3 additions and 0 deletions

View File

@ -38,6 +38,8 @@ export namespace Command {
agent: z.string().optional(),
model: z.string().optional(),
source: z.enum(["command", "mcp", "skill"]).optional(),
// workaround for zod not supporting async functions natively so we use getters
// https://zod.dev/v4/changelog?id=zfunction
template: z.promise(z.string()).or(z.string()),
subtask: z.boolean().optional(),
hints: z.array(z.string()),
@ -46,6 +48,7 @@ export namespace Command {
ref: "Command",
})
// for some reason zod is inferring `string` for z.promise(z.string()).or(z.string()) so we have to manually override it
export type Info = Omit<z.infer<typeof Info>, "template"> & { template: Promise<string> | string }
export function hints(template: string) {