🤯 LobeHub - Super-Agents on Your Team. Add super-agents to the chats your team already uses.They take on work by themselves and get better every week.
TypeScript agentagent-collaborationagent-harnessloop-engineeringmcppersonal-assistantproactive-agentskillssuper-agenttask-management
♻️ refactor(zod): collapse .nullable().optional() into .nullish() (#16156)
Arvin Xuea597c9bffc3
diff --git a/apps/server/src/routers/async/image.ts b/apps/server/src/routers/async/image.tsindex 41da3379576..f740d49dbdc 100644--- a/apps/server/src/routers/async/image.ts+++ b/apps/server/src/routers/async/image.ts@@ -54,7 +54,7 @@ const createImageInputSchema = z.object({height: z.number().optional(),imageUrls: z.array(z.string()).optional(),prompt: z.string(),- seed: z.number().nullable().optional(),+ seed: z.number().nullish(),steps: z.number().optional(),width: z.number().optional(),})diff --git a/apps/server/src/routers/lambda/_schema/context.ts b/apps/server/src/routers/lambda/_schema/context.tsindex 84e32e86af3..5881dd3fc56 100644--- a/apps/server/src/routers/lambda/_schema/context.ts+++ b/apps/server/src/routers/lambda/_schema/context.ts@@ -9,10 +9,10 @@ import { z } from 'zod';*/export const conversationContextSchema = z.object({agentId: z.string().optional(),- groupId: z.string().nullable().optional(),- sessionId: z.string().nullable().optional(),- threadId: z.string().nullable().optional(),- topicId: z.string().nullable().optional(),+ groupId: z.string().nullish(),+ sessionId: z.string().nullish(),+ threadId: z.string().nullish(),+ topicId: z.string().nullish(),});/**@@ -21,10 +21,10 @@ export const conversationContextSchema = z.object({*/export const basicContextSchema = z.object({agentId: z.string().optional(),- groupId: z.string().nullable().optional(),- sessionId: z.string().nullable().optional(),- threadId: z.string().nullable().optional(),- topicId: z.string().nullable().optional(),+ groupId: z.string().nullish(),+ sessionId: z.string().nullish(),+ threadId: z.string().nullish(),+ topicId: z.string().nullish(),});export type ConversationContextInput = z.infer<typeof conversationContextSchema>;diff --git a/apps/server/src/routers/lambda/_schema/documentHistory.ts b/apps/server/src/routers/lambda/_schema/documentHistory.tsindex 1d2e4691021..c3e922bccca 100644--- a/apps/server/src/routers/lambda/_schema/documentHistory.ts+++ b/apps/server/src/routers/lambda/_schema/documentHistory.ts@@ -43,7 +43,7 @@ export const updateDocumentInputSchema = z.object({id: z.string(),lockOwnerId: z.string().optional(),metadata: z.record(z.any()).optional(),- parentId: z.string().nullable().optional(),+ parentId: z.string().nullish(),restoreFromHistoryId: z.string().optional(),saveSource: documentHistorySaveSourceSchema.optional(),title: z.string().optional(),diff --git a/apps/server/src/routers/lambda/agentDocument.ts b/apps/server/src/routers/lambda/agentDocument.tsindex 45df9546a89..c68f25fe64f 100644--- a/apps/server/src/routers/lambda/agentDocument.ts+++ b/apps/server/src/routers/lambda/agentDocument.ts@@ -91,7 +91,7 @@ const mountedSkillNamespaceSchema = z.literal('agent');const agentDocumentToolContextSchema = z.object({messageId: z.string(),operationId: z.string().optional(),- taskId: z.string().nullable().optional(),+ taskId: z.string().nullish(),toolCallId: z.string(),topicId: z.string().optional(),});diff --git a/apps/server/src/routers/lambda/aiAgent.ts b/apps/server/src/routers/lambda/aiAgent.tsindex 11408c51c32..a99cfb3cbf5 100644--- a/apps/server/src/routers/lambda/aiAgent.ts+++ b/apps/server/src/routers/lambda/aiAgent.ts@@ -138,21 +138,21 @@ const ExecAgentSchema = zappContext: z.object({defaultTaskAssigneeAgentId: z.string().optional(),- documentId: z.string().optional().nullable(),+ documentId: z.string().nullish(),/** The agent being edited when scope is 'agent_builder' (not the builder builtin itself). */editingAgentId: z.string().optional(),- groupId: z.string().optional().nullable(),+ groupId: z.string().nullish(),initialTopicMetadata: z.object({repos: z.array(z.string()).optional(),workingDirectory: z.string().optional(),}).optional(),- scope: z.string().optional().nullable(),+ scope: z.string().nullish(),sessionId: z.string().optional(),- taskId: z.string().optional().nullable(),- threadId: z.string().optional().nullable(),- topicId: z.string().optional().nullable(),+ taskId: z.string().nullish(),+ threadId: z.string().nullish(),+ topicId: z.string().nullish(),}).optional(),/** Whether to auto-start execution after creating operation */@@ -225,7 +225,7 @@ const ExecGroupAgentSchema = z.object({}).optional(),/** Existing topic ID */- topicId: z.string().optional().nullable(),+ topicId: z.string().nullish(),});/**diff --git a/apps/server/src/routers/lambda/apiKey.ts b/apps/server/src/routers/lambda/apiKey.tsindex 5431bbce36d..515546dd732 100644--- a/apps/server/src/routers/lambda/apiKey.ts+++ b/apps/server/src/routers/lambda/apiKey.ts@@ -22,7 +22,7 @@ export const apiKeyRouter = router({.use(withScopedPermission('api_key:create')).input(z.object({- expiresAt: z.date().optional().nullable(),+ expiresAt: z.date().nullish(),name: z.string(),}),)@@ -67,7 +67,7 @@ export const apiKeyRouter = router({value: z.object({description: z.string().optional(),enabled: z.boolean().optional(),- expiresAt: z.date().optional().nullable(),+ expiresAt: z.date().nullish(),name: z.string().optional(),}),}),diff --git a/apps/server/src/routers/lambda/connector.ts b/apps/server/src/routers/lambda/connector.tsindex fd963038e11..edc70d69983 100644--- a/apps/server/src/routers/lambda/connector.ts+++ b/apps/server/src/routers/lambda/connector.ts@@ -130,8 +130,7 @@ export const connectorRouter = router({.input(z.object({ id: z.string().uuid() })).query(async ({ input, ctx }) => {const connector = await ctx.connectorModel.findById(input.id);- if (!connector)- throw new TRPCError({ code: 'NOT_FOUND', message: 'Connector not found' });+ if (!connector) throw new TRPCError({ code: 'NOT_FOUND', message: 'Connector not found' });const { oidcConfig, credentials, ...rest } = connector;const safeOidcConfig = oidcConfig ? { ...oidcConfig, clientSecret: undefined } : oidcConfig;@@ -287,7 +286,7 @@ export const connectorRouter = router({.partial().omit({ identifier: true, sourceType: true })// Allow `null` here so an edit can clear credentials (switch to no-auth).- .extend({ credentials: connectorCredentialsInputSchema.nullable().optional() }),+ .extend({ credentials: connectorCredentialsInputSchema.nullish() }),}),).mutation(async ({ input, ctx }) => {diff --git a/apps/server/src/routers/lambda/device.ts b/apps/server/src/routers/lambda/device.tsindex 3d3ab1dd3be..c1980f937fa 100644--- a/apps/server/src/routers/lambda/device.ts+++ b/apps/server/src/routers/lambda/device.ts@@ -683,9 +683,9 @@ export const deviceRouter = router({.input(z.object({deviceId: z.string().min(1).max(64),- hostname: z.string().nullable().optional(),+ hostname: z.string().nullish(),identitySource: z.enum(['machine-id', 'fallback']),- platform: z.string().max(20).nullable().optional(),+ platform: z.string().max(20).nullish(),}),).mutation(async ({ ctx, input }) => {@@ -702,9 +702,9 @@ export const deviceRouter = router({.use(serverDatabase).input(z.object({- defaultCwd: z.string().nullable().optional(),+ defaultCwd: z.string().nullish(),deviceId: z.string(),- friendlyName: z.string().max(100).nullable().optional(),+ friendlyName: z.string().max(100).nullish(),workingDirs: z.array(z.object({ path: z.string(), repoType: z.enum(['git', 'github']).optional() })).max(20)@@ -743,9 +743,9 @@ export const deviceRouter = router({.input(z.object({deviceId: z.string().min(1).max(64),- hostname: z.string().nullable().optional(),+ hostname: z.string().nullish(),identitySource: z.enum(['machine-id', 'fallback']),- platform: z.string().max(20).nullable().optional(),+ platform: z.string().max(20).nullish(),}),).mutation(async ({ ctx, input }) => {@@ -767,9 +767,9 @@ export const deviceRouter = router({updateDevice: deviceProcedure.input(z.object({- defaultCwd: z.string().nullable().optional(),+ defaultCwd: z.string().nullish(),deviceId: z.string(),- friendlyName: z.string().max(100).nullable().optional(),+ friendlyName: z.string().max(100).nullish(),workingDirs: z.array(z.object({ path: z.string(), repoType: z.enum(['git', 'github']).optional() })).max(20)diff --git a/apps/server/src/routers/lambda/file.ts b/apps/server/src/routers/lambda/file.tsindex a95e97c7b9b..7b302f06b82 100644--- a/apps/server/src/routers/lambda/file.ts+++ b/apps/server/src/routers/lambda/file.ts@@ -649,7 +649,7 @@ export const fileRouter = router({id: z.string(),metadata: z.record(z.string(), z.any()).optional(),name: z.string().optional(),- parentId: z.string().nullable().optional(),+ parentId: z.string().nullish(),}),).mutation(async ({ ctx, input }) => {diff --git a/apps/server/src/routers/lambda/generationTopic.ts b/apps/server/src/routers/lambda/generationTopic.tsindex acf5de8a503..aebf8528bf4 100644--- a/apps/server/src/routers/lambda/generationTopic.ts+++ b/apps/server/src/routers/lambda/generationTopic.ts@@ -26,8 +26,8 @@ const generationTopicProcedure = wsCompatProcedure.use(serverDatabase).use(asyncconst updateTopicSchema = z.object({id: z.string(),value: z.object({- coverUrl: z.string().nullable().optional(),- title: z.string().nullable().optional(),+ coverUrl: z.string().nullish(),+ title: z.string().nullish(),}),});diff --git a/apps/server/src/routers/lambda/image/index.ts b/apps/server/src/routers/lambda/image/index.tsindex 074b9848458..47e0421ed68 100644--- a/apps/server/src/routers/lambda/image/index.ts+++ b/apps/server/src/routers/lambda/image/index.ts@@ -54,7 +54,7 @@ const createImageInputSchema = z.object({height: z.number().optional(),imageUrls: z.array(z.string()).optional(),prompt: z.string(),- seed: z.number().nullable().optional(),+ seed: z.number().nullish(),steps: z.number().optional(),width: z.number().optional(),})diff --git a/apps/server/src/routers/lambda/message.ts b/apps/server/src/routers/lambda/message.tsindex a4e1a2215f4..4bee704054e 100644--- a/apps/server/src/routers/lambda/message.ts+++ b/apps/server/src/routers/lambda/message.ts@@ -71,9 +71,9 @@ export const messageRouter = router({.input(z.object({agentId: z.string(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),messageGroupId: z.string(),- threadId: z.string().nullable().optional(),+ threadId: z.string().nullish(),topicId: z.string(),}),)@@ -139,9 +139,9 @@ export const messageRouter = router({.input(z.object({agentId: z.string(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),messageIds: z.array(z.string()),- threadId: z.string().nullable().optional(),+ threadId: z.string().nullish(),topicId: z.string(),}),)@@ -184,9 +184,9 @@ export const messageRouter = router({z.object({agentId: z.string(),content: z.string(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),messageGroupId: z.string(),- threadId: z.string().nullable().optional(),+ threadId: z.string().nullish(),topicId: z.string(),}),)@@ -209,13 +209,13 @@ export const messageRouter = router({.use(serverDatabase).input(z.object({- agentId: z.string().nullable().optional(),+ agentId: z.string().nullish(),current: z.number().optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),pageSize: z.number().optional(),- sessionId: z.string().nullable().optional(),- threadId: z.string().nullable().optional(),- topicId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),+ threadId: z.string().nullish(),+ topicId: z.string().nullish(),topicShareId: z.string().optional(),}),)@@ -320,7 +320,7 @@ export const messageRouter = router({.input(z.object({- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),}).extend(basicContextSchema.shape),)@@ -345,7 +345,7 @@ export const messageRouter = router({.input(z.object({groupId: z.string(),- topicId: z.string().nullable().optional(),+ topicId: z.string().nullish(),}),).mutation(async ({ input, ctx }) => {@@ -418,8 +418,8 @@ export const messageRouter = router({z.object({context: z.object({agentId: z.string(),- groupId: z.string().nullable().optional(),- threadId: z.string().nullable().optional(),+ groupId: z.string().nullish(),+ threadId: z.string().nullish(),topicId: z.string(),}),expanded: z.boolean().optional(),diff --git a/apps/server/src/routers/lambda/task.ts b/apps/server/src/routers/lambda/task.tsindex 1f2d9d70d94..90816f2091c 100644--- a/apps/server/src/routers/lambda/task.ts+++ b/apps/server/src/routers/lambda/task.ts@@ -68,9 +68,9 @@ const createSchema = z.object({});const updateSchema = z.object({- assigneeAgentId: z.string().nullable().optional(),- assigneeUserId: z.string().nullable().optional(),- automationMode: z.enum(['heartbeat', 'schedule']).nullable().optional(),+ assigneeAgentId: z.string().nullish(),+ assigneeUserId: z.string().nullish(),+ automationMode: z.enum(['heartbeat', 'schedule']).nullish(),config: z.record(z.unknown()).optional(),context: z.record(z.unknown()).optional(),description: z.string().optional(),@@ -85,13 +85,13 @@ const updateSchema = z.object({message: 'heartbeatInterval must be 0 (disabled) or at least 600 seconds (10 minutes)',}).optional(),- heartbeatTimeout: z.number().min(1).nullable().optional(),+ heartbeatTimeout: z.number().min(1).nullish(),instruction: z.string().optional(),name: z.string().optional(),- parentTaskId: z.string().nullable().optional(),+ parentTaskId: z.string().nullish(),priority: z.number().min(0).max(4).optional(),- schedulePattern: z.string().nullable().optional(),- scheduleTimezone: z.string().nullable().optional(),+ schedulePattern: z.string().nullish(),+ scheduleTimezone: z.string().nullish(),});const listSchema = z.object({@@ -99,7 +99,7 @@ const listSchema = z.object({limit: z.number().min(1).max(100).default(50),offset: z.number().min(0).default(0),parentIdentifier: z.string().optional(),- parentTaskId: z.string().nullable().optional(),+ parentTaskId: z.string().nullish(),priorities: z.array(z.number().min(0).max(4)).max(5).optional(),statuses: z.array(z.enum(TASK_STATUSES)).max(10).optional(),});@@ -117,7 +117,7 @@ const groupListSchema = z.object({).min(1).max(10),- parentTaskId: z.string().nullable().optional(),+ parentTaskId: z.string().nullish(),});// Helper: resolve id/identifier and throw if not founddiff --git a/apps/server/src/routers/lambda/topic.ts b/apps/server/src/routers/lambda/topic.tsindex 51a101e2d61..feddb4c7f66 100644--- a/apps/server/src/routers/lambda/topic.ts+++ b/apps/server/src/routers/lambda/topic.ts@@ -153,7 +153,7 @@ export const topicRouter = router({.input(z.object({agentId: z.string().optional(),- id: z.string().nullable().optional(),+ id: z.string().nullish(),}),).mutation(async ({ input, ctx }) => {@@ -193,7 +193,7 @@ export const topicRouter = router({z.object({agentId: z.string().optional(),- containerId: z.string().nullable().optional(),+ containerId: z.string().nullish(),endDate: z.string().optional(),range: z.tuple([z.string(), z.string()]).optional(),startDate: z.string().optional(),@@ -210,7 +210,7 @@ export const topicRouter = router({z.object({favorite: z.boolean().optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),messages: z.array(z.string()).optional(),title: z.string(),trigger: z.string().optional(),@@ -278,15 +278,15 @@ export const topicRouter = router({getTopics: topicProcedure.input(z.object({- agentId: z.string().nullable().optional(),+ agentId: z.string().nullish(),current: z.number().optional(),excludeStatuses: z.array(z.string()).optional(),excludeTriggers: z.array(z.string()).optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),includeTriggers: z.array(z.string()).optional(),isInbox: z.boolean().optional(),pageSize: z.number().max(100).optional(),- sessionId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),/*** Server-side ordering. Defaults to `updatedAt`; `status` orders by* status priority for the sidebar "group by status" mode.@@ -390,7 +390,7 @@ export const topicRouter = router({z.object({agentId: z.string(),data: z.string(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),}),).mutation(async ({ input, ctx }) => {@@ -556,9 +556,9 @@ export const topicRouter = router({.input(z.object({agentId: z.string().optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),keywords: z.string(),- sessionId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),}),).query(async ({ input, ctx }) => {@@ -604,7 +604,7 @@ export const topicRouter = router({id: z.string(),value: z.object({agentId: z.string().optional(),- completedAt: z.date().nullable().optional(),+ completedAt: z.date().nullish(),favorite: z.boolean().optional(),historySummary: z.string().optional(),messages: z.array(z.string()).optional(),@@ -615,7 +615,7 @@ export const topicRouter = router({}).optional(),sessionId: z.string().optional(),- status: chatTopicStatusSchema.nullable().optional(),+ status: chatTopicStatusSchema.nullish(),title: z.string().optional(),}),}),@@ -692,7 +692,7 @@ export const topicRouter = router({.optional(),operationId: z.string(),scope: z.string().optional(),- threadId: z.string().nullable().optional(),+ threadId: z.string().nullish(),}).nullable().optional(),diff --git a/apps/server/src/routers/lambda/verify.ts b/apps/server/src/routers/lambda/verify.tsindex cbdb39276e9..b5c414485fe 100644--- a/apps/server/src/routers/lambda/verify.ts+++ b/apps/server/src/routers/lambda/verify.ts@@ -65,8 +65,8 @@ const checkItemSchema = z.object({index: z.number(),onFail: onFailSchema,required: z.boolean(),- sourceCriterionId: z.string().nullable().optional(),- sourceRubricId: z.string().nullable().optional(),+ sourceCriterionId: z.string().nullish(),+ sourceRubricId: z.string().nullish(),title: z.string(),verifierConfig: z.record(z.unknown()),verifierType: verifierTypeSchema,@@ -160,8 +160,8 @@ export const verifyRouter = router({z.object({id: z.string(),value: z.object({- description: z.string().nullable().optional(),- documentId: z.string().nullable().optional(),+ description: z.string().nullish(),+ documentId: z.string().nullish(),onFail: onFailSchema.optional(),required: z.boolean().optional(),title: z.string().optional(),@@ -214,7 +214,7 @@ export const verifyRouter = router({id: z.string(),value: z.object({config: rubricConfigSchema.optional(),- description: z.string().nullable().optional(),+ description: z.string().nullish(),title: z.string().optional(),}),}),@@ -239,7 +239,7 @@ export const verifyRouter = router({modelConfig: modelConfigSchema.optional(),operationId: z.string(),verifyCriteriaIds: z.array(z.string()).optional(),- verifyRubricId: z.string().nullable().optional(),+ verifyRubricId: z.string().nullish(),}),).mutation(async ({ ctx, input }) => ctx.planGenerator.generateDraftPlan(input)),diff --git a/apps/server/src/routers/lambda/video/index.ts b/apps/server/src/routers/lambda/video/index.tsindex 5f098fcc188..0b695ae8f00 100644--- a/apps/server/src/routers/lambda/video/index.ts+++ b/apps/server/src/routers/lambda/video/index.ts@@ -63,12 +63,12 @@ const createVideoInputSchema = z.object({aspectRatio: z.string().optional(),cameraFixed: z.boolean().optional(),duration: z.number().optional(),- endImageUrl: z.string().nullable().optional(),+ endImageUrl: z.string().nullish(),generateAudio: z.boolean().optional(),- imageUrl: z.string().nullable().optional(),+ imageUrl: z.string().nullish(),prompt: z.string(),resolution: z.string().optional(),- seed: z.number().nullable().optional(),+ seed: z.number().nullish(),}).passthrough(),provider: z.string(),diff --git a/apps/server/src/routers/mobile/topic.ts b/apps/server/src/routers/mobile/topic.tsindex cf178663e71..f5954cf32b2 100644--- a/apps/server/src/routers/mobile/topic.ts+++ b/apps/server/src/routers/mobile/topic.ts@@ -51,7 +51,7 @@ export const topicRouter = router({}),batchDeleteBySessionId: topicDeleteProcedure- .input(z.object({ id: z.string().nullable().optional() }))+ .input(z.object({ id: z.string().nullish() })).mutation(async ({ input, ctx }) => {return ctx.topicModel.batchDeleteBySessionId(input.id);}),@@ -82,9 +82,9 @@ export const topicRouter = router({.input(z.object({favorite: z.boolean().optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),messages: z.array(z.string()).optional(),- sessionId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),title: z.string(),}),)@@ -97,7 +97,7 @@ export const topicRouter = router({getTopics: topicProcedure.input(z.object({- containerId: z.string().nullable().optional(),+ containerId: z.string().nullish(),current: z.number().optional(),pageSize: z.number().optional(),}),@@ -127,9 +127,9 @@ export const topicRouter = router({searchTopics: topicProcedure.input(z.object({- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),keywords: z.string(),- sessionId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),}),).query(async ({ input, ctx }) => {diff --git a/packages/database/src/schemas/agent.ts b/packages/database/src/schemas/agent.tsindex 5a7c3de5406..439ccb822ec 100644--- a/packages/database/src/schemas/agent.ts+++ b/packages/database/src/schemas/agent.ts@@ -92,9 +92,9 @@ export const agents = pgTable(/** @deprecated Use CreateAgentSchema from @lobechat/types instead */export const insertAgentSchema = createInsertSchema(agents, {- agencyConfig: z.custom<LobeAgentAgencyConfig>().nullable().optional(),+ agencyConfig: z.custom<LobeAgentAgencyConfig>().nullish(),// Override chatConfig type to use the proper schema- chatConfig: AgentChatConfigSchema.nullable().optional(),+ chatConfig: AgentChatConfigSchema.nullish(),});export type NewAgent = typeof agents.$inferInsert;diff --git a/packages/memory-user-memory/src/schemas/activity.ts b/packages/memory-user-memory/src/schemas/activity.tsindex 7c647e8c45d..98b3668f629 100644--- a/packages/memory-user-memory/src/schemas/activity.ts+++ b/packages/memory-user-memory/src/schemas/activity.ts@@ -7,32 +7,32 @@ import { z } from 'zod';import { MemoryTypeSchema } from './common';const ActivityAssociatedLocationSchema = z.object({- address: z.string().optional().nullable(),- extra: z.string().nullable().optional(),+ address: z.string().nullish(),+ extra: z.string().nullish(),name: z.string().optional(),- tags: z.array(z.string()).optional().nullable(),+ tags: z.array(z.string()).nullish(),type: z.string().optional(),});const ActivityAssociationSchema = z.object({- extra: z.string().nullable().optional(),+ extra: z.string().nullish(),name: z.string(),type: z.string().optional(),});export const WithActivitySchema = z.object({- associatedLocations: z.array(ActivityAssociatedLocationSchema).optional().nullable(),- associatedObjects: z.array(ActivityAssociationSchema).optional().nullable(),- associatedSubjects: z.array(ActivityAssociationSchema).optional().nullable(),- endsAt: z.string().optional().nullable(),- feedback: z.string().optional().nullable(),- metadata: z.record(z.unknown()).optional().nullable(),+ associatedLocations: z.array(ActivityAssociatedLocationSchema).nullish(),+ associatedObjects: z.array(ActivityAssociationSchema).nullish(),+ associatedSubjects: z.array(ActivityAssociationSchema).nullish(),+ endsAt: z.string().nullish(),+ feedback: z.string().nullish(),+ metadata: z.record(z.unknown()).nullish(),narrative: z.string(),- notes: z.string().optional().nullable(),- startsAt: z.string().optional().nullable(),- status: z.string().optional().nullable(),- tags: z.array(z.string()).optional().nullable(),- timezone: z.string().optional().nullable(),+ notes: z.string().nullish(),+ startsAt: z.string().nullish(),+ status: z.string().nullish(),+ tags: z.array(z.string()).nullish(),+ timezone: z.string().nullish(),type: z.union([z.nativeEnum(ActivityTypeEnum), z.string()]).optional(),});@@ -40,7 +40,7 @@ export const ActivityMemoryItemSchema = z.object({details: z.string(),memoryCategory: z.string(),memoryType: MemoryTypeSchema,- sourceIds: z.array(z.string()).optional().nullable(),+ sourceIds: z.array(z.string()).nullish(),summary: z.string(),tags: z.array(z.string()),title: z.string(),diff --git a/packages/model-bank/src/standard-parameters/index.ts b/packages/model-bank/src/standard-parameters/index.tsindex 967fcc33f74..0524794ebaf 100644--- a/packages/model-bank/src/standard-parameters/index.ts+++ b/packages/model-bank/src/standard-parameters/index.ts@@ -64,7 +64,7 @@ export const ModelParamsMetaSchema = z.object({imageUrl: z.object({- default: z.string().nullable().optional(),+ default: z.string().nullish(),description: z.string().optional(),maxFileSize: z.number().optional(),type: z.tuple([z.literal('string'), z.literal('null')]).optional(),diff --git a/packages/model-bank/src/standard-parameters/video.ts b/packages/model-bank/src/standard-parameters/video.tsindex 73dfe351f49..708a1d3d978 100644--- a/packages/model-bank/src/standard-parameters/video.ts+++ b/packages/model-bank/src/standard-parameters/video.ts@@ -32,7 +32,7 @@ export const VideoModelParamsMetaSchema = z.object({.object({/** Aspect ratio (width/height) constraints */aspectRatio: z.object({ max: z.number().optional(), min: z.number().optional() }).optional(),- default: z.string().nullable().optional(),+ default: z.string().nullish(),description: z.string().optional(),height: z.object({ max: z.number().optional(), min: z.number().optional() }).optional(),maxFileSize: z.number().optional(),@@ -59,7 +59,7 @@ export const VideoModelParamsMetaSchema = z.object({.object({/** Aspect ratio (width/height) constraints */aspectRatio: z.object({ max: z.number().optional(), min: z.number().optional() }).optional(),- default: z.string().nullable().optional(),+ default: z.string().nullish(),description: z.string().optional(),height: z.object({ max: z.number().optional(), min: z.number().optional() }).optional(),maxFileSize: z.number().optional(),diff --git a/packages/model-bank/src/types/aiModel.ts b/packages/model-bank/src/types/aiModel.tsindex 39f33f0cff1..0697d9a20c9 100644--- a/packages/model-bank/src/types/aiModel.ts+++ b/packages/model-bank/src/types/aiModel.ts@@ -519,8 +519,8 @@ export const UpdateAiModelSchema = z.object({deploymentName: z.string().optional(),}).optional(),- contextWindowTokens: z.number().nullable().optional(),- displayName: z.string().nullable().optional(),+ contextWindowTokens: z.number().nullish(),+ displayName: z.string().nullish(),settings: AiModelSettingsSchema.optional(),type: AiModelTypeSchema.optional(),});diff --git a/packages/openapi/src/types/file.type.ts b/packages/openapi/src/types/file.type.tsindex fb9ebb7e64c..cbdaf8e9f26 100644--- a/packages/openapi/src/types/file.type.ts+++ b/packages/openapi/src/types/file.type.ts@@ -180,7 +180,9 @@ export interface BatchGetFilesRequest {}export const BatchGetFilesRequestSchema = z.object({- fileIds: z.array(z.string().min(1, 'File ID cannot be empty')).min(1, 'File ID list cannot be empty'),+ fileIds: z+ .array(z.string().min(1, 'File ID cannot be empty'))+ .min(1, 'File ID list cannot be empty'),});/**@@ -370,5 +372,5 @@ export interface UpdateFileRequest {}export const UpdateFileSchema = z.object({- knowledgeBaseId: z.string().nullable().optional(),+ knowledgeBaseId: z.string().nullish(),});diff --git a/packages/openapi/src/types/provider.type.ts b/packages/openapi/src/types/provider.type.tsindex 0bfa87406f9..ce57c4188a6 100644--- a/packages/openapi/src/types/provider.type.ts+++ b/packages/openapi/src/types/provider.type.ts@@ -53,16 +53,16 @@ export type ProviderListQuerySchemaType = z.infer<typeof ProviderListQuerySchema// ==================== Provider Mutation Schemas ====================const ProviderPayloadBaseSchema = z.object({- checkModel: z.string().nullable().optional(),+ checkModel: z.string().nullish(),config: z.record(z.unknown()).optional(),- description: z.string().nullable().optional(),+ description: z.string().nullish(),enabled: z.boolean().optional(),- fetchOnClient: z.boolean().nullable().optional(),+ fetchOnClient: z.boolean().nullish(),keyVaults: z.record(z.string()).optional(),- logo: z.string().nullable().optional(),- name: z.string().min(1, 'Provider name cannot be empty').nullable().optional(),+ logo: z.string().nullish(),+ name: z.string().min(1, 'Provider name cannot be empty').nullish(),settings: z.record(z.unknown()).optional(),- sort: z.number().int().nullable().optional(),+ sort: z.number().int().nullish(),source: z.enum(['builtin', 'custom']).optional(),});@@ -71,7 +71,7 @@ export const CreateProviderRequestSchema = ProviderPayloadBaseSchema.extend({});export const UpdateProviderRequestSchema = ProviderPayloadBaseSchema.extend({- keyVaults: z.record(z.string()).nullable().optional(),+ keyVaults: z.record(z.string()).nullish(),});export type CreateProviderRequestSchemaType = z.infer<typeof CreateProviderRequestSchema>;@@ -105,7 +105,10 @@ export type UpdateProviderResponse = ProviderDetailResponse;// ==================== Provider Param Schemas ====================export const ProviderIdParamSchema = z.object({- id: z.string().min(1, 'Provider ID cannot be empty').max(64, 'Provider ID cannot exceed 64 characters'),+ id: z+ .string()+ .min(1, 'Provider ID cannot be empty')+ .max(64, 'Provider ID cannot exceed 64 characters'),});export type ProviderIdParam = z.infer<typeof ProviderIdParamSchema>;diff --git a/packages/types/src/agent/item.ts b/packages/types/src/agent/item.tsindex 9071949a6a0..09411b76e76 100644--- a/packages/types/src/agent/item.ts+++ b/packages/types/src/agent/item.ts@@ -104,25 +104,25 @@ export type LobeAgentConfigKeys =*/export const CreateAgentSchema = z.object({agencyConfig: z.custom<LobeAgentAgencyConfig>().optional(),- avatar: z.string().nullable().optional(),- backgroundColor: z.string().nullable().optional(),+ avatar: z.string().nullish(),+ backgroundColor: z.string().nullish(),chatConfig: AgentChatConfigSchema.optional(),- description: z.string().nullable().optional(),+ description: z.string().nullish(),editorData: z.unknown().optional(),fewShots: z.unknown().optional(),- marketIdentifier: z.string().nullable().optional(),- model: z.string().nullable().optional(),- openingMessage: z.string().nullable().optional(),+ marketIdentifier: z.string().nullish(),+ model: z.string().nullish(),+ openingMessage: z.string().nullish(),openingQuestions: z.array(z.string()).optional(),params: z.record(z.unknown()).optional(),plugins: z.array(z.string()).optional(),- provider: z.string().nullable().optional(),- sessionGroupId: z.string().nullable().optional(),- systemRole: z.string().nullable().optional(),+ provider: z.string().nullish(),+ sessionGroupId: z.string().nullish(),+ systemRole: z.string().nullish(),tags: z.array(z.string()).optional(),- title: z.string().nullable().optional(),+ title: z.string().nullish(),tts: z.custom<LobeAgentTTSConfig>().optional(),- virtual: z.boolean().nullable().optional(),+ virtual: z.boolean().nullish(),});export type CreateAgentConfig = z.infer<typeof CreateAgentSchema>;diff --git a/packages/types/src/agentGroup/index.ts b/packages/types/src/agentGroup/index.tsindex b91a08a6052..8b37edba3d9 100644--- a/packages/types/src/agentGroup/index.ts+++ b/packages/types/src/agentGroup/index.ts@@ -34,18 +34,18 @@ export const ChatGroupConfigSchema = z.object({// Zod schema for inserting ChatGroupexport const InsertChatGroupSchema = z.object({- avatar: z.string().optional().nullable(),- backgroundColor: z.string().optional().nullable(),- clientId: z.string().optional().nullable(),- config: ChatGroupConfigSchema.optional().nullable(),- content: z.string().optional().nullable(),- description: z.string().optional().nullable(),- editorData: z.record(z.string(), z.any()).optional().nullable(),- groupId: z.string().optional().nullable(),+ avatar: z.string().nullish(),+ backgroundColor: z.string().nullish(),+ clientId: z.string().nullish(),+ config: ChatGroupConfigSchema.nullish(),+ content: z.string().nullish(),+ description: z.string().nullish(),+ editorData: z.record(z.string(), z.any()).nullish(),+ groupId: z.string().nullish(),id: z.string().optional(),- marketIdentifier: z.string().optional().nullable(),- pinned: z.boolean().optional().nullable(),- title: z.string().optional().nullable(),+ marketIdentifier: z.string().nullish(),+ pinned: z.boolean().nullish(),+ title: z.string().nullish(),});export type InsertChatGroup = z.infer<typeof InsertChatGroupSchema>;diff --git a/packages/types/src/aiProvider.ts b/packages/types/src/aiProvider.tsindex 5cf74da2034..490c0cb0d2f 100644--- a/packages/types/src/aiProvider.ts+++ b/packages/types/src/aiProvider.ts@@ -332,8 +332,8 @@ export interface AiProviderDetailItem {// Updateexport const UpdateAiProviderSchema = z.object({config: z.object({}).passthrough().optional(),- description: z.string().nullable().optional(),- logo: z.string().nullable().optional(),+ description: z.string().nullish(),+ logo: z.string().nullish(),name: z.string(),sdkType: z.enum(AiProviderSdkTypes).optional(),settings: AiProviderSettingsSchema.optional(),@@ -348,7 +348,7 @@ export const UpdateAiProviderConfigSchema = z.object({enableResponseApi: z.boolean().optional(),}).optional(),- fetchOnClient: z.boolean().nullable().optional(),+ fetchOnClient: z.boolean().nullish(),keyVaults: z.record(z.string(),diff --git a/packages/types/src/files/list.ts b/packages/types/src/files/list.tsindex 5134b9c3534..a730729d953 100644--- a/packages/types/src/files/list.ts+++ b/packages/types/src/files/list.ts@@ -48,8 +48,8 @@ export const QueryFileListSchema = z.object({knowledgeBaseId: z.string().optional(),limit: z.number().int().positive().default(50),offset: z.number().int().min(0).default(0),- parentId: z.string().nullable().optional(),- q: z.string().nullable().optional(),+ parentId: z.string().nullish(),+ q: z.string().nullish(),showFilesInKnowledgeBase: z.boolean().default(false),sortType: z.enum(['desc', 'asc']).optional(),sorter: z.enum(['createdAt', 'size']).optional(),diff --git a/packages/types/src/message/db/params.ts b/packages/types/src/message/db/params.tsindex 872ee0db427..7d33658139f 100644--- a/packages/types/src/message/db/params.ts+++ b/packages/types/src/message/db/params.ts@@ -126,8 +126,8 @@ export interface NewMessageQueryParams {export const UpdateMessageParamsSchema = z.object({content: z.string().optional(),- editorData: z.record(z.any()).nullable().optional(),- error: ChatMessageErrorSchema.nullable().optional(),+ editorData: z.record(z.any()).nullish(),+ error: ChatMessageErrorSchema.nullish(),imageList: z.array(ChatImageItemSchema).optional(),metadata: MessageMetadataSchema.optional(),model: z.string().optional(),@@ -137,7 +137,7 @@ export const UpdateMessageParamsSchema = zrole: z.string().optional(),search: GroundingSearchSchema.optional(),toolCalls: z.array(MessageToolCallSchema).optional(),- tools: z.array(ChatToolPayloadSchema).nullable().optional(),+ tools: z.array(ChatToolPayloadSchema).nullish(),traceId: z.string().optional(),usage: ModelUsageSchema.optional(),})diff --git a/packages/types/src/message/ui/params.ts b/packages/types/src/message/ui/params.tsindex 61c48bb4fef..561e4eda60f 100644--- a/packages/types/src/message/ui/params.ts+++ b/packages/types/src/message/ui/params.ts@@ -197,24 +197,24 @@ export const CreateNewMessageParamsSchema = z/*** @deprecated Use agentId instead. Will be resolved to agentId in the router.*/- sessionId: z.string().nullable().optional(),+ sessionId: z.string().nullish(),// Tool relatedtool_call_id: z.string().optional(),plugin: ChatPluginPayloadSchema.optional(),// GroupingparentId: z.string().optional(),- groupId: z.string().nullable().optional(),+ groupId: z.string().nullish(),// Context- topicId: z.string().nullable().optional(),- threadId: z.string().nullable().optional(),- targetId: z.string().nullable().optional(),+ topicId: z.string().nullish(),+ threadId: z.string().nullish(),+ targetId: z.string().nullish(),// Model info- model: z.string().nullable().optional(),- provider: z.string().nullable().optional(),+ model: z.string().nullish(),+ provider: z.string().nullish(),// Contentfiles: z.array(z.string()).optional(),// Error handling- error: ChatMessageErrorSchema.nullable().optional(),+ error: ChatMessageErrorSchema.nullish(),// MetadatatraceId: z.string().optional(),fileChunks: z.array(SemanticSearchChunkSchema).optional(),diff --git a/packages/types/src/user/preference.ts b/packages/types/src/user/preference.tsindex 2b9699ac282..bf417c5afa3 100644--- a/packages/types/src/user/preference.ts+++ b/packages/types/src/user/preference.ts@@ -161,7 +161,7 @@ export const UserPreferenceSchema = zguide: UserGuideSchema.optional(),hideSyncAlert: z.boolean().optional(),lab: UserLabSchema.optional(),- lastWorkspaceId: z.string().nullable().optional(),+ lastWorkspaceId: z.string().nullish(),telemetry: z.boolean().nullable(),topicGroupMode: z.enum(['byTime', 'byProject', 'flat', 'byStatus']).optional(),topicIncludeCompleted: z.boolean().optional(),