The open alternative to Salesforce, designed for AI.
TypeScript crmcrm-systemcustomergood-first-issuegraphqlhacktoberfestjavascriptmarketingmonoreponestjsopen-sourcepostgresqlreactreactjssalestypescriptweb
chore(security): bump zod 4 to 4.6.7 (#28959)
BOHEUS1e484144303b
diff --git a/packages/twenty-apps/public/call-recorder/package.json b/packages/twenty-apps/public/call-recorder/package.jsonindex b7ab4e69d75..a68f82d897f 100644--- a/packages/twenty-apps/public/call-recorder/package.json+++ b/packages/twenty-apps/public/call-recorder/package.json@@ -42,6 +42,6 @@"use-debounce": "^10.0.0","vite-tsconfig-paths": "^4.2.1","vitest": "^4.1.12",- "zod": "^4.1.11"+ "zod": "^4.6.6"}}diff --git a/packages/twenty-apps/public/call-recorder/yarn.lock b/packages/twenty-apps/public/call-recorder/yarn.lockindex 9dc7d0b70bc..75b46a0aa52 100644--- a/packages/twenty-apps/public/call-recorder/yarn.lock+++ b/packages/twenty-apps/public/call-recorder/yarn.lock@@ -1364,7 +1364,7 @@ __metadata:use-debounce: "npm:^10.0.0"vite-tsconfig-paths: "npm:^4.2.1"vitest: "npm:^4.1.12"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -4021,9 +4021,9 @@ __metadata:languageName: nodelinkType: hard-"zod@npm:^4.1.11":- version: 4.5.2- resolution: "zod@npm:4.5.2"- checksum: 10c0/e54a27401dc7993f96232b5a4e889017bb6a00d8d23a2258f40704076243ed9659d09ea3ae074538fb548e960c4d6380301f879fca6bd31547b7b69745abf0f5+"zod@npm:^4.1.11, zod@npm:^4.6.6":+ version: 4.6.7+ resolution: "zod@npm:4.6.7"+ checksum: 10c0/4ce2eb14034317b7254e347ca37b5ad591cf8333147030cf05b9b5d31692d45073f7f2747aa50cf8c6b29012194d2b22978cecc89969cf34a0d18e89d0ee7d7blanguageName: nodelinkType: harddiff --git a/packages/twenty-apps/public/slack/package.json b/packages/twenty-apps/public/slack/package.jsonindex 8fc204ab0c8..ab33c6c997f 100644--- a/packages/twenty-apps/public/slack/package.json+++ b/packages/twenty-apps/public/slack/package.json@@ -47,6 +47,6 @@"typescript": "^5.9.3","vite-tsconfig-paths": "^4.2.1","vitest": "^4.1.12",- "zod": "^4.1.11"+ "zod": "^4.6.6"}}diff --git a/packages/twenty-apps/public/slack/yarn.lock b/packages/twenty-apps/public/slack/yarn.lockindex a14c2c81ed4..f3aba6127fb 100644--- a/packages/twenty-apps/public/slack/yarn.lock+++ b/packages/twenty-apps/public/slack/yarn.lock@@ -1408,7 +1408,7 @@ __metadata:typescript: "npm:^5.9.3"vite-tsconfig-paths: "npm:^4.2.1"vitest: "npm:^4.1.12"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -4402,9 +4402,9 @@ __metadata:languageName: nodelinkType: hard-"zod@npm:^4.1.11":- version: 4.4.3- resolution: "zod@npm:4.4.3"- checksum: 10c0/7ea31b558e88f9faf44f31dd185e2e1cbf51fed3081787fb96cc2534749b50c0acfc6da7f0922a7353ed092dd358c7d50c28ea96c94d04af64191bd33152eca3+"zod@npm:^4.1.11, zod@npm:^4.6.6":+ version: 4.6.7+ resolution: "zod@npm:4.6.7"+ checksum: 10c0/4ce2eb14034317b7254e347ca37b5ad591cf8333147030cf05b9b5d31692d45073f7f2747aa50cf8c6b29012194d2b22978cecc89969cf34a0d18e89d0ee7d7blanguageName: nodelinkType: harddiff --git a/packages/twenty-companion/package.json b/packages/twenty-companion/package.jsonindex a4fc43e5e43..398415b4e04 100644--- a/packages/twenty-companion/package.json+++ b/packages/twenty-companion/package.json@@ -34,7 +34,7 @@"react": "^19.2.0","react-dom": "^19.2.0","twenty-ui": "workspace:*",- "zod": "^4.1.0"+ "zod": "^4.6.6"},"devDependencies": {"@electron/packager": "^20.3.0",diff --git a/packages/twenty-front-component-renderer/package.json b/packages/twenty-front-component-renderer/package.jsonindex 8226416482b..913097802ae 100644--- a/packages/twenty-front-component-renderer/package.json+++ b/packages/twenty-front-component-renderer/package.json@@ -29,7 +29,7 @@"react": "^19.2.0","react-dom": "^19.2.0","react-error-boundary": "^4.0.11",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"devDependencies": {"@chakra-ui/react": "^3.33.0",diff --git a/packages/twenty-front/package.json b/packages/twenty-front/package.jsonindex b77a31058f1..6a475891718 100644--- a/packages/twenty-front/package.json+++ b/packages/twenty-front/package.json@@ -148,7 +148,7 @@"xlsx-ugnis": "^0.19.3","y-protocols": "^1.0.6","yjs": "^13.6.27",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"devDependencies": {"@argos-ci/storybook": "6.2.3",diff --git a/packages/twenty-front/src/modules/ai/utils/tool-display/unwrapToolInput.ts b/packages/twenty-front/src/modules/ai/utils/tool-display/unwrapToolInput.tsindex 028b8bd890e..156c2924990 100644--- a/packages/twenty-front/src/modules/ai/utils/tool-display/unwrapToolInput.ts+++ b/packages/twenty-front/src/modules/ai/utils/tool-display/unwrapToolInput.ts@@ -5,7 +5,7 @@ import { type ToolInput } from '@/ai/types/ToolInput';// Coercing would turn a missing name into the tool name "undefined".const ExecuteToolSchema = z.object({toolName: z.string().min(1),- arguments: z.unknown(),+ arguments: z.unknown().optional(),});export const unwrapToolInput = ({diff --git a/packages/twenty-front/src/modules/object-core/agents/validation-schemas/__tests__/coreAgentFormSchema.test.ts b/packages/twenty-front/src/modules/object-core/agents/validation-schemas/__tests__/coreAgentFormSchema.test.tsindex 9096813048e..f033a96f542 100644--- a/packages/twenty-front/src/modules/object-core/agents/validation-schemas/__tests__/coreAgentFormSchema.test.ts+++ b/packages/twenty-front/src/modules/object-core/agents/validation-schemas/__tests__/coreAgentFormSchema.test.ts@@ -13,14 +13,14 @@ describe('coreAgentFormSchema', () => {i18n.load('fr-FR', { [errorMessage.id]: 'Le modèle est requis' });i18n.activate(SOURCE_LOCALE);- const sourceResult = coreAgentFormSchema.shape.modelId.safeParse('');+ const sourceMessage =+ coreAgentFormSchema.shape.modelId.safeParse('').error?.issues[0].message;i18n.activate('fr-FR');- const translatedResult = coreAgentFormSchema.shape.modelId.safeParse('');+ const translatedMessage =+ coreAgentFormSchema.shape.modelId.safeParse('').error?.issues[0].message;- expect(sourceResult.error?.issues[0].message).toBe(errorMessage.message);- expect(translatedResult.error?.issues[0].message).toBe(- 'Le modèle est requis',- );+ expect(sourceMessage).toBe(errorMessage.message);+ expect(translatedMessage).toBe('Le modèle est requis');});});diff --git a/packages/twenty-front/src/modules/object-metadata/validation-schemas/indexMetadataItemSchema.ts b/packages/twenty-front/src/modules/object-metadata/validation-schemas/indexMetadataItemSchema.tsindex 70c8f5918e5..86aab71d84a 100644--- a/packages/twenty-front/src/modules/object-metadata/validation-schemas/indexMetadataItemSchema.ts+++ b/packages/twenty-front/src/modules/object-metadata/validation-schemas/indexMetadataItemSchema.ts@@ -15,5 +15,5 @@ export const indexMetadataItemSchema = z.object({indexWhereClause: z.string().nullable(),isUnique: z.boolean(),isCustom: z.boolean().nullable().optional(),- objectMetadata: z.any(),+ objectMetadata: z.any().optional(),}) satisfies z.ZodType<IndexMetadataItem>;diff --git a/packages/twenty-front/src/modules/settings/data-model/fields/preview/utils/getMultiSelectFieldPreviewValue.ts b/packages/twenty-front/src/modules/settings/data-model/fields/preview/utils/getMultiSelectFieldPreviewValue.tsindex ceeb134ef23..1f1cfd596d8 100644--- a/packages/twenty-front/src/modules/settings/data-model/fields/preview/utils/getMultiSelectFieldPreviewValue.ts+++ b/packages/twenty-front/src/modules/settings/data-model/fields/preview/utils/getMultiSelectFieldPreviewValue.ts@@ -3,7 +3,7 @@ import { isNonEmptyString } from '@sniptt/guards';import { type FieldMetadataItem } from '@/object-metadata/types/FieldMetadataItem';import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/types/FieldMetadata';import { multiSelectFieldDefaultValueSchema } from '@/object-record/record-field/ui/validation-schemas/multiSelectFieldDefaultValueSchema';-import { isDefined, isNonEmptyArray } from 'twenty-shared/utils';+import { isDefined } from 'twenty-shared/utils';import { FieldMetadataType } from '~/generated-metadata/graphql';import { stripSimpleQuotesFromString } from '~/utils/string/stripSimpleQuotesFromString';@@ -30,7 +30,7 @@ export const getMultiSelectFieldPreviewValue = ({(value) =>value?.map(stripSimpleQuotesFromString).filter(isNonEmptyString) ?? [],)- .refine(isNonEmptyArray)+ .refine((value) => value.length > 0).catch(allOptionValues).parse(fieldMetadataItem.defaultValue);};diff --git a/packages/twenty-front/src/utils/validation-schemas/__tests__/simpleQuotesStringSchema.test.ts b/packages/twenty-front/src/utils/validation-schemas/__tests__/simpleQuotesStringSchema.test.tsindex 4d2a36705d5..44720686ad6 100644--- a/packages/twenty-front/src/utils/validation-schemas/__tests__/simpleQuotesStringSchema.test.ts+++ b/packages/twenty-front/src/utils/validation-schemas/__tests__/simpleQuotesStringSchema.test.ts@@ -44,14 +44,14 @@ describe('simpleQuotesStringSchema', () => {});i18n.activate(SOURCE_LOCALE);- const sourceResult = simpleQuotesStringSchema.safeParse('unquoted');+ const sourceMessage =+ simpleQuotesStringSchema.safeParse('unquoted').error?.issues[0].message;i18n.activate('fr-FR');- const translatedResult = simpleQuotesStringSchema.safeParse('unquoted');+ const translatedMessage =+ simpleQuotesStringSchema.safeParse('unquoted').error?.issues[0].message;- expect(sourceResult.error?.issues[0].message).toBe(errorMessage.message);- expect(translatedResult.error?.issues[0].message).toBe(- 'Entourez le texte de guillemets simples',- );+ expect(sourceMessage).toBe(errorMessage.message);+ expect(translatedMessage).toBe('Entourez le texte de guillemets simples');});});diff --git a/packages/twenty-server/package.json b/packages/twenty-server/package.jsonindex 39f37708817..fbbf21d4da9 100644--- a/packages/twenty-server/package.json+++ b/packages/twenty-server/package.json@@ -170,7 +170,7 @@"typeorm": "patch:[email protected]#./patches/typeorm+0.3.31.patch","unzipper": "^0.12.3","uuid": "^11.1.1",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"devDependencies": {"@jest/test-result": "29.7.0",diff --git a/packages/twenty-server/src/engine/core-modules/record-crud/utils/__tests__/to-tool-json-schema.util.spec.ts b/packages/twenty-server/src/engine/core-modules/record-crud/utils/__tests__/to-tool-json-schema.util.spec.tsnew file mode 100644index 00000000000..cb959821120--- /dev/null+++ b/packages/twenty-server/src/engine/core-modules/record-crud/utils/__tests__/to-tool-json-schema.util.spec.ts@@ -0,0 +1,65 @@+import { z } from 'zod';++import { toToolJsonSchema } from 'src/engine/core-modules/record-crud/utils/to-tool-json-schema.util';++describe('toToolJsonSchema', () => {+ it('inlines described optional fields instead of hoisting them into $defs', () => {+ const schema = z.object({+ includeRules: z.boolean().optional().describe('Include rules'),+ });++ expect(toToolJsonSchema(schema)).toEqual({+ type: 'object',+ properties: {+ includeRules: { type: 'boolean', description: 'Include rules' },+ },+ });+ });++ it('emits discriminated unions as anyOf', () => {+ const schema = z.discriminatedUnion('kind', [+ z.object({ kind: z.literal('a') }),+ z.object({ kind: z.literal('b') }),+ ]);++ const result = toToolJsonSchema(schema);++ expect(result).not.toHaveProperty('oneOf');+ expect(result).toHaveProperty('anyOf', [+ expect.objectContaining({+ properties: { kind: { type: 'string', const: 'a' } },+ }),+ expect.objectContaining({+ properties: { kind: { type: 'string', const: 'b' } },+ }),+ ]);+ });++ it('shares only schemas that declare an id', () => {+ const filterSchema = z+ .object({ field: z.string() })+ .meta({ id: 'testFilter' });+ const schema = z.object({+ first: filterSchema,+ second: filterSchema.optional(),+ label: z.string(),+ });++ expect(toToolJsonSchema(schema)).toEqual({+ type: 'object',+ properties: {+ first: { $ref: '#/$defs/testFilter' },+ second: { $ref: '#/$defs/testFilter' },+ label: { type: 'string' },+ },+ required: ['first', 'label'],+ $defs: {+ testFilter: {+ type: 'object',+ properties: { field: { type: 'string' } },+ required: ['field'],+ },+ },+ });+ });+});diff --git a/packages/twenty-server/src/engine/core-modules/record-crud/utils/to-tool-json-schema.util.ts b/packages/twenty-server/src/engine/core-modules/record-crud/utils/to-tool-json-schema.util.tsindex 77adc6e49fd..0b47f6ef7a1 100644--- a/packages/twenty-server/src/engine/core-modules/record-crud/utils/to-tool-json-schema.util.ts+++ b/packages/twenty-server/src/engine/core-modules/record-crud/utils/to-tool-json-schema.util.ts@@ -1,9 +1,9 @@+import { isDefined } from 'twenty-shared/utils';import { z } from 'zod';export const toToolJsonSchema = (schema: z.ZodTypeAny): object => {const result = z.toJSONSchema(schema, {io: 'input',- reused: 'ref',override(ctx) {if (!ctx.jsonSchema) {return;@@ -17,6 +17,11 @@ export const toToolJsonSchema = (schema: z.ZodTypeAny): object => {if (ctx.jsonSchema.format && ctx.jsonSchema.pattern) {delete ctx.jsonSchema.pattern;}++ if (isDefined(ctx.jsonSchema.oneOf)) {+ ctx.jsonSchema.anyOf = ctx.jsonSchema.oneOf;+ delete ctx.jsonSchema.oneOf;+ }},}) as Record<string, unknown>;diff --git a/packages/twenty-server/src/engine/metadata-modules/ai/ai-models/__tests__/ai-provider-model-config.schema.spec.ts b/packages/twenty-server/src/engine/metadata-modules/ai/ai-models/__tests__/ai-provider-model-config.schema.spec.tsindex 4225707bf04..785fc842902 100644--- a/packages/twenty-server/src/engine/metadata-modules/ai/ai-models/__tests__/ai-provider-model-config.schema.spec.ts+++ b/packages/twenty-server/src/engine/metadata-modules/ai/ai-models/__tests__/ai-provider-model-config.schema.spec.ts@@ -95,7 +95,7 @@ describe('aiProviderModelConfigSchema', () => {},}),),- ).toContain('benchmarkByEffort.turbo');+ ).toContain('benchmarkByEffort');});it('accepts an evaluation model declaring its question types and both token costs', () => {diff --git a/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts b/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.tsindex 857c7d5d51f..a2e454309b7 100644--- a/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts+++ b/packages/twenty-server/src/modules/dashboard/tools/schemas/widget.schema.ts@@ -162,7 +162,8 @@ export const chartFilterSchema = z}).describe('Filter restricting which records are included in this chart. All filtered fields must belong to the widget object.',- );+ )+ .meta({ id: 'chartFilter' });const displayDataLabelSchema = z.boolean().optional();const displayLegendSchema = z.boolean().optional();diff --git a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snapindex feda301ebff..7568ce265ab 100644--- a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap+++ b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-agent-tools.integration-spec.ts.snap@@ -17,29 +17,6 @@ Before creating it, present the plan to the user (prompt, role, triggers) and geGive the agent a role with the least access it needs (use list_roles to find one); without a role it cannot read or write records.Write the prompt as standing instructions for every run, and put what to do for a specific trigger in that trigger's instructions.","inputSchema": {- "$defs": {- "__schema0": {- "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",- "format": "uuid",- "type": "string",- },- "__schema1": {- "description": "Whether the trigger starts runs. Defaults to true.",- "type": "boolean",- },- "__schema2": {- "anyOf": [- {- "maxLength": 10000,- "type": "string",- },- {- "type": "null",- },- ],- "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",- },- },"properties": {"description": {"description": "Optional short description",@@ -75,13 +52,25 @@ Write the prompt as standing instructions for every run, and put what to do for{"properties": {"id": {- "$ref": "#/$defs/__schema0",+ "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",+ "format": "uuid",+ "type": "string",},"instructions": {- "$ref": "#/$defs/__schema2",+ "anyOf": [+ {+ "maxLength": 10000,+ "type": "string",+ },+ {+ "type": "null",+ },+ ],+ "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",},"isActive": {- "$ref": "#/$defs/__schema1",+ "description": "Whether the trigger starts runs. Defaults to true.",+ "type": "boolean",},"settings": {"properties": {@@ -122,13 +111,25 @@ Write the prompt as standing instructions for every run, and put what to do for{"properties": {"id": {- "$ref": "#/$defs/__schema0",+ "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",+ "format": "uuid",+ "type": "string",},"instructions": {- "$ref": "#/$defs/__schema2",+ "anyOf": [+ {+ "maxLength": 10000,+ "type": "string",+ },+ {+ "type": "null",+ },+ ],+ "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",},"isActive": {- "$ref": "#/$defs/__schema1",+ "description": "Whether the trigger starts runs. Defaults to true.",+ "type": "boolean",},"settings": {"properties": {@@ -173,29 +174,6 @@ Write the prompt as standing instructions for every run, and put what to do forTo pause an agent without deleting it, set isActive to false on its triggers. Confirm changes to the role or triggers with the user first.","inputSchema": {- "$defs": {- "__schema0": {- "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",- "format": "uuid",- "type": "string",- },- "__schema1": {- "description": "Whether the trigger starts runs. Defaults to true.",- "type": "boolean",- },- "__schema2": {- "anyOf": [- {- "maxLength": 10000,- "type": "string",- },- {- "type": "null",- },- ],- "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",- },- },"properties": {"description": {"type": "string",@@ -238,13 +216,25 @@ To pause an agent without deleting it, set isActive to false on its triggers. Co{"properties": {"id": {- "$ref": "#/$defs/__schema0",+ "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",+ "format": "uuid",+ "type": "string",},"instructions": {- "$ref": "#/$defs/__schema2",+ "anyOf": [+ {+ "maxLength": 10000,+ "type": "string",+ },+ {+ "type": "null",+ },+ ],+ "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",},"isActive": {- "$ref": "#/$defs/__schema1",+ "description": "Whether the trigger starts runs. Defaults to true.",+ "type": "boolean",},"settings": {"properties": {@@ -285,13 +275,25 @@ To pause an agent without deleting it, set isActive to false on its triggers. Co{"properties": {"id": {- "$ref": "#/$defs/__schema0",+ "description": "Id of an existing trigger, as returned by list_agents. Pass it to keep that trigger when updating; omit it for a new trigger.",+ "format": "uuid",+ "type": "string",},"instructions": {- "$ref": "#/$defs/__schema2",+ "anyOf": [+ {+ "maxLength": 10000,+ "type": "string",+ },+ {+ "type": "null",+ },+ ],+ "description": "What the agent should do when this trigger fires, on top of its prompt (e.g. 'Post a summary of the new deal in a note on the company').",},"isActive": {- "$ref": "#/$defs/__schema1",+ "description": "Whether the trigger starts runs. Defaults to true.",+ "type": "boolean",},"settings": {"properties": {diff --git a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-navigation-menu-item-tools.integration-spec.ts.snap b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-navigation-menu-item-tools.integration-spec.ts.snapindex 1acc87911dd..1c910ce4e10 100644--- a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-navigation-menu-item-tools.integration-spec.ts.snap+++ b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-navigation-menu-item-tools.integration-spec.ts.snap@@ -56,63 +56,38 @@ Type chooses the variant:Note: creating a new custom object via create_object_metadata already auto-creates an OBJECT navigation menu item — do not double-create.","inputSchema": {- "$defs": {- "__schema0": {- "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",- "enum": [- "workspace",- "user",- ],- "type": "string",- },- "__schema1": {- "description": "Label shown in the sidebar.",- "minLength": 1,- "type": "string",- },- "__schema2": {- "description": "Icon identifier (e.g. "IconStar", "IconFolder")",- "type": "string",- },- "__schema3": {- "description": "Optional hex colour",- "type": "string",- },- "__schema4": {- "description": "Position among siblings; defaults to the end.",- "type": "number",- },- "__schema5": {- "description": "Parent folder id, if the item should live inside a folder.",- "format": "uuid",- "type": "string",- },- "__schema6": {- "description": "Optional custom label. If omitted, the sidebar shows the target's own name (object's plural label / view name / record identifier). Only pass this if the user explicitly wants a different label.",- "minLength": 1,- "type": "string",- },- },"anyOf": [{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"name": {- "$ref": "#/$defs/__schema1",+ "description": "Label shown in the sidebar.",+ "minLength": 1,+ "type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"type": {"const": "FOLDER",@@ -129,13 +104,17 @@ Note: creating a new custom object via create_object_metadata already auto-creat{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"link": {"description": "Target URL",@@ -143,13 +122,21 @@ Note: creating a new custom object via create_object_metadata already auto-creat"type": "string",},"name": {- "$ref": "#/$defs/__schema1",+ "description": "Label shown in the sidebar.",+ "minLength": 1,+ "type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"type": {"const": "LINK",@@ -167,22 +154,34 @@ Note: creating a new custom object via create_object_metadata already auto-creat{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"name": {- "$ref": "#/$defs/__schema6",+ "description": "Optional custom label. If omitted, the sidebar shows the target's own name (object's plural label / view name / record identifier). Only pass this if the user explicitly wants a different label.",+ "minLength": 1,+ "type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"targetObjectMetadataId": {"description": "Id of the object to pin",@@ -204,22 +203,34 @@ Note: creating a new custom object via create_object_metadata already auto-creat{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"name": {- "$ref": "#/$defs/__schema6",+ "description": "Optional custom label. If omitted, the sidebar shows the target's own name (object's plural label / view name / record identifier). Only pass this if the user explicitly wants a different label.",+ "minLength": 1,+ "type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"type": {"const": "VIEW",@@ -241,22 +252,34 @@ Note: creating a new custom object via create_object_metadata already auto-creat{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"name": {- "$ref": "#/$defs/__schema6",+ "description": "Optional custom label. If omitted, the sidebar shows the target's own name (object's plural label / view name / record identifier). Only pass this if the user explicitly wants a different label.",+ "minLength": 1,+ "type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"targetObjectMetadataId": {"description": "Id of the record's object metadata",@@ -284,26 +307,38 @@ Note: creating a new custom object via create_object_metadata already auto-creat{"properties": {"color": {- "$ref": "#/$defs/__schema3",+ "description": "Optional hex colour",+ "type": "string",},"folderId": {- "$ref": "#/$defs/__schema5",+ "description": "Parent folder id, if the item should live inside a folder.",+ "format": "uuid",+ "type": "string",},"icon": {- "$ref": "#/$defs/__schema2",+ "description": "Icon identifier (e.g. "IconStar", "IconFolder")",+ "type": "string",},"name": {- "$ref": "#/$defs/__schema1",+ "description": "Label shown in the sidebar.",+ "minLength": 1,+ "type": "string",},"pageLayoutId": {"description": "Id of the page layout to pin","type": "string",},"position": {- "$ref": "#/$defs/__schema4",+ "description": "Position among siblings; defaults to the end.",+ "type": "number",},"scope": {- "$ref": "#/$defs/__schema0",+ "description": "'user' creates a personal favorite, visible only to the current user. 'workspace' creates a shared navigation menu item visible to everyone (requires the LAYOUTS permission). Twenty has no separate Favorites concept — favorites are just navigation menu items with scope=user.",+ "enum": [+ "workspace",+ "user",+ ],+ "type": "string",},"type": {"const": "PAGE_LAYOUT",@@ -331,15 +366,11 @@ Note: creating a new custom object via create_object_metadata already auto-creat"type": "string",},"folderId": {- "anyOf": [- {- "type": "string",- },- {- "type": "null",- },- ],"description": "Move into a different folder. Pass null to move to the top level.",+ "type": [+ "string",+ "null",+ ],},"icon": {"description": "New icon identifier",diff --git a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-role-tools.integration-spec.ts.snap b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-role-tools.integration-spec.ts.snapindex b94e9ba9f43..77f694524fd 100644--- a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-role-tools.integration-spec.ts.snap+++ b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-role-tools.integration-spec.ts.snap@@ -302,15 +302,11 @@ IMPORTANT: this replaces the full rule set for the role + object. Predicates or"description": "Parent group id for nested groups",},"positionInRowLevelPermissionPredicateGroup": {- "anyOf": [- {- "type": "number",- },- {- "type": "null",- },- ],"description": "Position of this group within its parent",+ "type": [+ "number",+ "null",+ ],},},"required": [@@ -357,15 +353,11 @@ IMPORTANT: this replaces the full rule set for the role + object. Predicates or"type": "string",},"positionInRowLevelPermissionPredicateGroup": {- "anyOf": [- {- "type": "number",- },- {- "type": "null",- },- ],"description": "Position of this predicate within its group",+ "type": [+ "number",+ "null",+ ],},"rowLevelPermissionPredicateGroupId": {"anyOf": [@@ -380,15 +372,11 @@ IMPORTANT: this replaces the full rule set for the role + object. Predicates or"description": "Id of the predicate group this predicate belongs to",},"subFieldName": {- "anyOf": [- {- "type": "string",- },- {- "type": "null",- },- ],"description": "Sub-field for composite fields (e.g. "firstName" of a FULL_NAME field)",+ "type": [+ "string",+ "null",+ ],},"value": {"anyOf": [@@ -433,15 +421,11 @@ IMPORTANT: this replaces the full rule set for the role + object. Predicates or"description": "Dynamic comparison: id of a field on the workspaceMember object whose value for the CURRENT user is substituted at query time. Use the workspaceMember "id" field to express "matches the current user", or a many-to-one relation field to compare against a relation on the record pointing at the same object.",},"workspaceMemberSubFieldName": {- "anyOf": [- {- "type": "string",- },- {- "type": "null",- },- ],"description": "Sub-field of the workspace member field when it is a composite field",+ "type": [+ "string",+ "null",+ ],},},"required": [diff --git a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-view-tools.integration-spec.ts.snap b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-view-tools.integration-spec.ts.snapindex b4bba600e87..6b10c0985e9 100644--- a/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-view-tools.integration-spec.ts.snap+++ b/packages/twenty-server/test/integration/ai/suites/__snapshots__/mcp-view-tools.integration-spec.ts.snap@@ -103,17 +103,6 @@ This means you never need to fetch child ids to edit a view — just pass the deVIEW TYPES: TABLE (default), LIST, KANBAN (requires mainGroupByFieldName, a SELECT field), CALENDAR (requires calendarFieldName + calendarLayout).","inputSchema": {- "$defs": {- "__schema0": {- "description": "Field name (e.g. "amount", "stage"). Resolved to a UUID server-side. Provide this or fieldMetadataId.",- "type": "string",- },- "__schema1": {- "description": "Field UUID. Alternative to fieldName; takes precedence when both are given.",- "format": "uuid",- "type": "string",- },- },"properties": {"calendarEndFieldName": {"description": "Optional end date field name for the calendar. It must match the type of calendarFieldName.",@@ -137,10 +126,13 @@ VIEW TYPES: TABLE (default), LIST, KANBAN (requires mainGroupByFieldName, a SELE"items": {"properties": {"fieldMetadataId": {- "$ref": "#/$defs/__schema1",+ "description": "Field UUID. Alternative to fieldName; takes precedence when both are given.",+ "format": "uuid",+ "type": "string",},"fieldName": {- "$ref": "#/$defs/__schema0",+ "description": "Field name (e.g. "amount", "stage"). Resolved to a UUID server-side. Provide this or fieldMetadataId.",+ "type": "string",},"isVisible": {"default": true,@@ -162,10 +154,13 @@ VIEW TYPES: TABLE (default), LIST, KANBAN (requires mainGroupByFieldName, a SELE"items": {"properties": {"fieldMetadataId": {- "$ref": "#/$defs/__schema1",+ "description": "Field UUID. Alternative to fieldName; takes precedence when both are given.",+ "format": "uuid",+ "type": "string",},"fieldName": {- "$ref": "#/$defs/__schema0",+ "description": "Field name (e.g. "amount", "stage"). Resolved to a UUID server-side. Provide this or fieldMetadataId.",+ "type": "string",},"operand": {"description": "Filter operator. Must be valid for the field type (e.g. SELECT: IS, IS_NOT; CURRENCY: GREATER_THAN_OR_EQUAL, LESS_THAN_OR_EQUAL; TEXT: CONTAINS).",@@ -286,10 +281,13 @@ VIEW TYPES: TABLE (default), LIST, KANBAN (requires mainGroupByFieldName, a SELE"type": "string",},"fieldMetadataId": {- "$ref": "#/$defs/__schema1",+ "description": "Field UUID. Alternative to fieldName; takes precedence when both are given.",+ "format": "uuid",+ "type": "string",},"fieldName": {- "$ref": "#/$defs/__schema0",+ "description": "Field name (e.g. "amount", "stage"). Resolved to a UUID server-side. Provide this or fieldMetadataId.",+ "type": "string",},},"type": "object",diff --git a/packages/twenty-shared/package.json b/packages/twenty-shared/package.jsonindex 8a8195fd1df..30e3223a80d 100644--- a/packages/twenty-shared/package.json+++ b/packages/twenty-shared/package.json@@ -60,7 +60,7 @@"temporal-polyfill": "^0.3.0","transliteration": "^2.3.5","uuid": "^11.1.1",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"exports": {".": {diff --git a/packages/twenty-shared/src/utils/tiptap/email-document-schema.ts b/packages/twenty-shared/src/utils/tiptap/email-document-schema.tsindex af26ab06ff5..2dc2c32df11 100644--- a/packages/twenty-shared/src/utils/tiptap/email-document-schema.ts+++ b/packages/twenty-shared/src/utils/tiptap/email-document-schema.ts@@ -13,6 +13,7 @@ const styleAttributeSchema = z.max(40),z.string().max(400),)+ .meta({ id: 'emailStyleAttribute' }).optional();const markSchema = z.discriminatedUnion('type', [@@ -41,21 +42,25 @@ const hardBreakNodeSchema = z.looseObject({type: z.literal(TIPTAP_NODE_TYPES.HARD_BREAK),});-const inlineNodeSchema = z.discriminatedUnion('type', [- textNodeSchema,- variableTagNodeSchema,- hardBreakNodeSchema,-]);+const inlineNodeSchema = z+ .discriminatedUnion('type', [+ textNodeSchema,+ variableTagNodeSchema,+ hardBreakNodeSchema,+ ])+ .meta({ id: 'emailInlineNode' });const blockContentSchema = z.array(z.lazy((): z.ZodType<EmailDocumentNode> => blockNodeSchema),);-const paragraphNodeSchema = z.looseObject({- type: z.literal(TIPTAP_NODE_TYPES.PARAGRAPH),- attrs: z.looseObject({ style: styleAttributeSchema.nullable() }).optional(),- content: z.array(inlineNodeSchema).optional(),-});+const paragraphNodeSchema = z+ .looseObject({+ type: z.literal(TIPTAP_NODE_TYPES.PARAGRAPH),+ attrs: z.looseObject({ style: styleAttributeSchema.nullable() }).optional(),+ content: z.array(inlineNodeSchema).optional(),+ })+ .meta({ id: 'emailParagraphNode' });const headingNodeSchema = z.looseObject({type: z.literal(TIPTAP_NODE_TYPES.HEADING),@@ -66,11 +71,13 @@ const headingNodeSchema = z.looseObject({content: z.array(inlineNodeSchema).optional(),});-const listItemNodeSchema = z.looseObject({- type: z.literal(TIPTAP_NODE_TYPES.LIST_ITEM),- attrs: z.looseObject({}).optional(),- content: blockContentSchema.min(1),-});+const listItemNodeSchema = z+ .looseObject({+ type: z.literal(TIPTAP_NODE_TYPES.LIST_ITEM),+ attrs: z.looseObject({}).optional(),+ content: blockContentSchema.min(1),+ })+ .meta({ id: 'emailListItemNode' });const bulletListNodeSchema = z.looseObject({type: z.literal(TIPTAP_NODE_TYPES.BULLET_LIST),@@ -152,20 +159,22 @@ const htmlDocumentNodeSchema = z.looseObject({attrs: z.looseObject({ html: z.string() }),});-const blockNodeSchema = z.discriminatedUnion('type', [- paragraphNodeSchema,- headingNodeSchema,- bulletListNodeSchema,- orderedListNodeSchema,- blockquoteNodeSchema,- imageNodeSchema,- sectionNodeSchema,- columnsNodeSchema,- buttonNodeSchema,- dividerNodeSchema,- htmlNodeSchema,- htmlDocumentNodeSchema,-]);+const blockNodeSchema = z+ .discriminatedUnion('type', [+ paragraphNodeSchema,+ headingNodeSchema,+ bulletListNodeSchema,+ orderedListNodeSchema,+ blockquoteNodeSchema,+ imageNodeSchema,+ sectionNodeSchema,+ columnsNodeSchema,+ buttonNodeSchema,+ dividerNodeSchema,+ htmlNodeSchema,+ htmlDocumentNodeSchema,+ ])+ .meta({ id: 'emailBlockNode' });const canvasThemeAttributeSchema = z.looseObject({pageBackground: z.string().optional(),diff --git a/packages/twenty-ui/.size-limit.json b/packages/twenty-ui/.size-limit.jsonindex d5c16f3f503..3aa43cafd89 100644--- a/packages/twenty-ui/.size-limit.json+++ b/packages/twenty-ui/.size-limit.json@@ -13,7 +13,7 @@{"name": "components","path": "dist/components.mjs",- "limit": "215 kB"+ "limit": "256 kB"},{"name": "components/code-editor",diff --git a/packages/twenty-ui/package.json b/packages/twenty-ui/package.jsonindex fe1ed40327f..59ca6f64e85 100644--- a/packages/twenty-ui/package.json+++ b/packages/twenty-ui/package.json@@ -83,7 +83,7 @@"clsx": "^2.1.1","react-datepicker": "^9.1.0","type-fest": "^4.10.1",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"peerDependencies": {"@monaco-editor/react": "^4.7.0",diff --git a/packages/twenty-website/package.json b/packages/twenty-website/package.jsonindex 7ba51556ace..95e74878314 100644--- a/packages/twenty-website/package.json+++ b/packages/twenty-website/package.json@@ -34,7 +34,7 @@"three": "^0.184.0","twenty-shared": "workspace:*","twenty-ui": "workspace:*",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"devDependencies": {"@babel/plugin-transform-export-namespace-from": "^7.24.6",diff --git a/packages/twenty-zapier/package.json b/packages/twenty-zapier/package.jsonindex 2ef165ec09b..f3b508bcf1c 100644--- a/packages/twenty-zapier/package.json+++ b/packages/twenty-zapier/package.json@@ -17,7 +17,7 @@"dotenv": "^16.4.5","libphonenumber-js": "^1.10.26","zapier-platform-core": "19.0.0",- "zod": "^4.1.11"+ "zod": "^4.6.6"},"devDependencies": {"@types/jest": "^30.0.0",diff --git a/yarn.lock b/yarn.lockindex 4139cbf6694..b2bc21b83c1 100644--- a/yarn.lock+++ b/yarn.lock@@ -19436,7 +19436,7 @@ __metadata:vite: "npm:^7.3.7"vite-plugin-svgr: "npm:^4.3.0"vitest: "npm:^4.1.12"- zod: "npm:^4.1.0"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -47520,7 +47520,7 @@ __metadata:twenty-sdk: "workspace:*"twenty-shared: "workspace:*"twenty-ui: "workspace:*"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -47700,7 +47700,7 @@ __metadata:xlsx-ugnis: "npm:^0.19.3"y-protocols: "npm:^1.0.6"yjs: "npm:^13.6.27"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -47983,7 +47983,7 @@ __metadata:typeorm: "patch:[email protected]#./patches/typeorm+0.3.31.patch"unzipper: "npm:^0.12.3"uuid: "npm:^11.1.1"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -48034,7 +48034,7 @@ __metadata:uuid: "npm:^11.1.1"vite: "npm:^8.0.0"vite-plugin-dts: "npm:^4.5.4"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -48094,7 +48094,7 @@ __metadata:vite-plugin-sass-dts: "npm:^1.3.31"vite-plugin-svgr: "npm:^4.3.0"vitest: "npm:^4.1.12"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"peerDependencies:"@monaco-editor/react": ^4.7.0monaco-editor: ">= 0.25.0 < 1"@@ -48162,7 +48162,7 @@ __metadata:twenty-shared: "workspace:*"twenty-ui: "workspace:*"wrangler: "npm:^4.151.0"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -48183,7 +48183,7 @@ __metadata:vite-plugin-dts: "npm:^4.5.4"zapier-platform-cli: "npm:^19.0.0"zapier-platform-core: "npm:19.0.0"- zod: "npm:^4.1.11"+ zod: "npm:^4.6.6"languageName: unknownlinkType: soft@@ -51271,28 +51271,7 @@ __metadata:languageName: nodelinkType: hard-"zod@npm:^4.1.0":- version: 4.6.2- resolution: "zod@npm:4.6.2"- checksum: 10c0/0d0dc2dc37c62e8777bb2d691e7fb8a0c80cc57e343df69fa62a57f26e0ac20107b14afda34f3bed98b27e5378eee2bbc7c5d23c203c3602690148a014dec7cd- languageName: node- linkType: hard--"zod@npm:^4.1.11":- version: 4.1.11- resolution: "zod@npm:4.1.11"- checksum: 10c0/ce6a4c4acfbf51d7dd0f2669c82f207d62a1f00264eef608994b94eb99d86a74c99f59b0dd3e61ef82909ee136631378b709e0908f0a02a2d5c21d0c497de5db- languageName: node- linkType: hard--"zod@npm:^4.4.3":- version: 4.5.4- resolution: "zod@npm:4.5.4"- checksum: 10c0/511a2a4d1a6f875dfdd70a1586989a8b14ef126776cd6218a2c760b9f65f14ef389ec20d92ee1aa4fcb4566d4ff3fa012956044f9dc503510d82e4c756a8ba92- languageName: node- linkType: hard--"zod@npm:^4.6.7":+"zod@npm:^4.4.3, zod@npm:^4.6.6, zod@npm:^4.6.7":version: 4.6.7resolution: "zod@npm:4.6.7"checksum: 10c0/4ce2eb14034317b7254e347ca37b5ad591cf8333147030cf05b9b5d31692d45073f7f2747aa50cf8c6b29012194d2b22978cecc89969cf34a0d18e89d0ee7d7b