mirror of
https://github.com/stablyai/orca.git
synced 2026-11-15 02:17:31 +00:00
* perf(mobile): trim the page bundle back under its old budget * build(mobile): simplify the route entry anchors and zod table guard * fix(mobile): import zod as a type in the RPC result reader
12 lines
426 B
TypeScript
12 lines
426 B
TypeScript
import * as z from 'zod'
|
|
import { normalizeStoredTaskSourceContext, type TaskSourceContext } from './task-source-context'
|
|
|
|
export const TaskSourceContextSchema = z.unknown().transform((value, ctx): TaskSourceContext => {
|
|
const normalized = normalizeStoredTaskSourceContext(value)
|
|
if (!normalized) {
|
|
ctx.addIssue({ code: 'custom', message: 'Invalid task source context' })
|
|
return z.NEVER
|
|
}
|
|
return normalized
|
|
})
|