From caa697e4cbcc8b578884426603dc9881de9ce3ca Mon Sep 17 00:00:00 2001 From: Peter Steinberger Date: Sat, 2 May 2026 02:32:23 +0100 Subject: [PATCH] refactor: trim core config schema exports --- src/config/zod-schema.core.ts | 34 ++++++++++++++-------------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/src/config/zod-schema.core.ts b/src/config/zod-schema.core.ts index 04c284aac3c..94836170364 100644 --- a/src/config/zod-schema.core.ts +++ b/src/config/zod-schema.core.ts @@ -182,9 +182,9 @@ export const SecretsConfigSchema = z .strict() .optional(); -export const ModelApiSchema = z.enum(MODEL_APIS); +const ModelApiSchema = z.enum(MODEL_APIS); -export const ModelCompatSchema = z +const ModelCompatSchema = z .object({ supportsStore: z.boolean().optional(), supportsPromptCacheKey: z.boolean().optional(), @@ -305,7 +305,7 @@ const ConfiguredModelProviderRequestSchema = z .strict() .optional(); -export const ModelDefinitionSchema = z +const ModelDefinitionSchema = z .object({ id: z.string().min(1), name: z.string().min(1), @@ -349,7 +349,7 @@ export const ModelDefinitionSchema = z }) .strict(); -export const ModelProviderSchema = z +const ModelProviderSchema = z .object({ baseUrl: z.string().min(1), apiKey: SecretInputSchema.optional().register(sensitive), @@ -410,7 +410,7 @@ export const IdentitySchema = z .strict() .optional(); -export const QueueModeSchema = z.union([ +const QueueModeSchema = z.union([ z.literal("steer"), z.literal("followup"), z.literal("collect"), @@ -419,11 +419,7 @@ export const QueueModeSchema = z.union([ z.literal("queue"), z.literal("interrupt"), ]); -export const QueueDropSchema = z.union([ - z.literal("old"), - z.literal("new"), - z.literal("summarize"), -]); +const QueueDropSchema = z.union([z.literal("old"), z.literal("new"), z.literal("summarize")]); export const ReplyToModeSchema = z.union([ z.literal("off"), z.literal("first"), @@ -684,7 +680,7 @@ export const RetryConfigSchema = z .strict() .optional(); -export const QueueModeBySurfaceSchema = z +const QueueModeBySurfaceSchema = z .object({ whatsapp: QueueModeSchema.optional(), telegram: QueueModeSchema.optional(), @@ -700,9 +696,7 @@ export const QueueModeBySurfaceSchema = z .strict() .optional(); -export const DebounceMsBySurfaceSchema = z - .record(z.string(), z.number().int().nonnegative()) - .optional(); +const DebounceMsBySurfaceSchema = z.record(z.string(), z.number().int().nonnegative()).optional(); export const QueueSchema = z .object({ @@ -747,13 +741,13 @@ export const ExecutableTokenSchema = z .string() .refine(isSafeExecutableValue, "expected safe executable name or path"); -export const MediaUnderstandingScopeSchema = createAllowDenyChannelRulesSchema(); +const MediaUnderstandingScopeSchema = createAllowDenyChannelRulesSchema(); -export const MediaUnderstandingCapabilitiesSchema = z +const MediaUnderstandingCapabilitiesSchema = z .array(z.union([z.literal("image"), z.literal("audio"), z.literal("video")])) .optional(); -export const MediaUnderstandingAttachmentsSchema = z +const MediaUnderstandingAttachmentsSchema = z .object({ mode: z.union([z.literal("first"), z.literal("all")]).optional(), maxAttachments: z.number().int().positive().optional(), @@ -789,7 +783,7 @@ const MediaUnderstandingRuntimeFields = { request: ConfiguredProviderRequestSchema, }; -export const MediaUnderstandingModelSchema = z +const MediaUnderstandingModelSchema = z .object({ provider: z.string().optional(), model: z.string().optional(), @@ -806,7 +800,7 @@ export const MediaUnderstandingModelSchema = z .strict() .optional(); -export const ToolsMediaUnderstandingSchema = z +const ToolsMediaUnderstandingSchema = z .object({ enabled: z.boolean().optional(), scope: MediaUnderstandingScopeSchema, @@ -848,7 +842,7 @@ type _ToolsMediaAsyncCompletionTypeAssignableToSchema = AssertAssignable< ToolsMediaConfigFromSchema["asyncCompletion"] >; -export const LinkModelSchema = z +const LinkModelSchema = z .object({ type: z.literal("cli").optional(), command: z.string().min(1),