mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-06 10:30:44 +00:00
refactor: trim core config schema exports
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user