Beautiful, AI-native markdown IDE and LLM wiki
TypeScript 2nd-brainagent-skillsclaudecodexcompany-braindocsknowledge-knowledge-baseknowledge-managementllmllm-wikillm-wiki-karpathymarkdownmarkdown-editormdmdxnotespkmsecond-brainskills
Upgrade Zod to 4.6.7 and use zod/compile in OK server processes (#7691)
Dimitri POSTOLOV090529a746de
diff --git a/.changeset/zod-compiled-validation.md b/.changeset/zod-compiled-validation.mdnew file mode 100644index 000000000..17498103c--- /dev/null+++ b/.changeset/zod-compiled-validation.md@@ -0,0 +1,5 @@+---+'@inkeep/open-knowledge': patch+---++Large projects list documents and pages faster, and the server uses about 40 MB less memory.diff --git a/THIRD_PARTY_NOTICES.md b/THIRD_PARTY_NOTICES.mdindex 9db979676..00d8e0d9e 100644--- a/THIRD_PARTY_NOTICES.md+++ b/THIRD_PARTY_NOTICES.md@@ -6005,7 +6005,7 @@ Homepage: https://github.com/sindresorhus/yoctocolorsCopyright (c) Sindre Sorhus <[email protected]> (https://sindresorhus.com)-### `[email protected]`+### `[email protected]`Homepage: https://zod.devCopyright (c) 2025 Colin McDonnelldiff --git a/docs/package.json b/docs/package.jsonindex 53cc5aa28..74fefc6ce 100644--- a/docs/package.json+++ b/docs/package.json@@ -49,7 +49,7 @@"unified": "^11.0.5","unist-util-visit": "^5.1.0","yaml": "^2.8.2",- "zod": "^4.3.6"+ "zod": "^4.6.7"},"devDependencies": {"@tailwindcss/postcss": "^4",diff --git a/packages/app/BUNDLE-SIZE.md b/packages/app/BUNDLE-SIZE.mdindex 609f972df..6d1f8155d 100644--- a/packages/app/BUNDLE-SIZE.md+++ b/packages/app/BUNDLE-SIZE.md@@ -123,3 +123,5 @@ Combined-chunks 9.17->9.18 MB for keeping the edited side of engine-less files,Combined-chunks 9.18->9.19 MB for moving docked chat history to either side of the conversation (#7294): the Agents strip's row menu with its Move chat history item, the palette's side-aware move commands, and their strings compiled into each of the 13 locale catalogs. Measured on one machine, `main` at `450b65e` alone builds to 9,178,809 B, 1,191 B under the 9,180,000 B ceiling, and the branch merged with it to 9,180,163 B, so the branch adds 1,354 B and lands 163 B over; the merge queue measured the same 9,180,163 B. The main app bundle went from 482.47 kB on `main` to 482.26 kB on the branch against its 487 kB limit, and CSS stayed at 8.36 kB against 59 kB, so the growth sits outside the main app bundle. The 10 kB ratchet to 9,190,000 B leaves 9,837 B of headroom over the branch build. No reclamation lever beyond the lazy-load levers above.Combined-chunks 9.19->9.20 MB for the attachment folder field with `{{filename}}`: one path input with its variable highlight, the live example and its errors, the zod input schema and per-document folder helpers that the field shares with the server, the translated upload refusal copy, and their strings compiled into every locale catalog. The chat-history entry above measured the tree before this field at 9,180,163 B. Merged with `main` at `33ac0b4`, the branch measures 9,191,157 B locally, 1,157 B over the 9.19 MB ceiling. The 10 kB ratchet leaves 8,843 B of headroom locally, or about 8.2 kB with the ~600 B that CI adds over a local build. The main app bundle measured 482.29 kB against its 487 kB limit and CSS 8.36 kB against 59 kB, because the settings dialog body is a lazy chunk. No reclamation lever beyond the lazy-load levers above.++Combined-chunks 9.20->9.21 MB for the Zod upgrade from 4.4.3 to 4.6.7 (#7691). The app takes only the larger Zod core, because the `zod/compile` side effect loads in the CLI and the desktop server process, never in the browser. Measured on one machine, `main` at `8fc6a56` builds to 9,195,153 B and the branch merged with it to 9,202,392 B. The upgrade adds 7,239 B and lands 2,392 B over the 9.20 MB ceiling, and CI measured the same 9,202,392 B. The shared `schemas` chunk that holds Zod grows 7,304 B, and the other chunks move by a few bytes each. The main app bundle moved 2 B to 482.86 kB against its 487 kB limit, and CSS stayed at 8.36 kB against 59 kB. The 10 kB ratchet leaves 7,608 B of headroom. No reclamation lever beyond the lazy-load levers above.diff --git a/packages/app/package.json b/packages/app/package.jsonindex e4328e48a..0aa5ceef6 100644--- a/packages/app/package.json+++ b/packages/app/package.json@@ -77,7 +77,7 @@{"name": "all JS chunks combined (gzipped)","path": "dist/assets/*.js",- "limit": "9.20 MB",+ "limit": "9.21 MB","gzip": true,"running": false},@@ -197,7 +197,7 @@"y-indexeddb": "9.0.12","yaml": "^2.8.3","yjs": "^13.6.30",- "zod": "^4.3.6"+ "zod": "^4.6.7"},"devDependencies": {"@axe-core/playwright": "^4.11.1",diff --git a/packages/cli/package.json b/packages/cli/package.jsonindex 9b8c9f1aa..4bf9b60b6 100644--- a/packages/cli/package.json+++ b/packages/cli/package.json@@ -76,7 +76,7 @@"yaml": "^2.7.1","yazl": "^3.3.1","yjs": "^13.6.30",- "zod": "^4.3.6"+ "zod": "^4.6.7"},"optionalDependencies": {"@parcel/watcher": "^2.5.6"diff --git a/packages/cli/scripts/check-published-dts.mjs b/packages/cli/scripts/check-published-dts.mjsindex 2baf936d5..743142c25 100644--- a/packages/cli/scripts/check-published-dts.mjs+++ b/packages/cli/scripts/check-published-dts.mjs@@ -30,11 +30,14 @@ export const PINNED_THIRD_PARTY_INLINING_ARTIFACTS = [},];+export const ZOD_APPLY_UNKNOWN_ADDITION = 1;+export const ZOD_VALIDATE_UNKNOWN_ADDITION = 2;+export const PUBLISHED_SURFACE_BASELINE = {capturedFrom:- "TypeScript 5.9.3, counted trivia-free: comments and string literals excluded. Recorded in the internal evidence tree's dts-baseline-5.9.3/index.tokens.txt, which this package does not ship. Raising a ceiling is a reviewed edit against that token stream, not a regeneration from the artifact that just failed. If you are an outside contributor and a ceiling blocks you, say so on the pull request and ask a maintainer to check it against that token stream: these numbers are a pre-change capture you cannot see, not a budget to raise.",+ "TypeScript 5.9.3 plus one reviewed unknown for Zod 4.5's variadic ZodType.apply type arguments and two reviewed input parameters for Zod 4.6's validate and validateAsync methods, counted trivia-free: comments and string literals excluded. Recorded in the internal evidence tree's dts-baseline-5.9.3/index.tokens.txt, which this package does not ship. Raising a ceiling is a reviewed edit against that token stream, not a regeneration from the artifact that just failed. If you are an outside contributor and a ceiling blocks you, say so on the pull request and ask a maintainer to check it against that token stream: these numbers are a pre-change capture you cannot see, not a budget to raise.",anyCeiling: 202,- unknownCeiling: 128,+ unknownCeiling: 128 + ZOD_APPLY_UNKNOWN_ADDITION + ZOD_VALIDATE_UNKNOWN_ADDITION,exportedSymbols: ['ALL_EDITOR_IDS','BundleExtraFile',@@ -334,7 +337,7 @@ export function checkSurface(surface, baseline) {}if (surface.unknownCount > baseline.unknownCeiling) {violations.push(- `\`unknown\` occurs ${surface.unknownCount} times outside comments and string literals, above the ${baseline.unknownCeiling} the 5.9.3 token stream recorded. Same two causes and the same remedy as the \`any\` ceiling above.`,+ `\`unknown\` occurs ${surface.unknownCount} times outside comments and string literals, above its ceiling of ${baseline.unknownCeiling}: the count the 5.9.3 token stream recorded plus the reviewed additions that capturedFrom names. Same two causes and the same remedy as the \`any\` ceiling above.`,);}return violations;diff --git a/packages/cli/src/bin.ts b/packages/cli/src/bin.tsindex 7b10de442..78bbe39c8 100644--- a/packages/cli/src/bin.ts+++ b/packages/cli/src/bin.ts@@ -16,4 +16,6 @@ if (helperOperation === 'get') {if (helperOperation !== null) {process.exit(await handleCredentialUpdate(helperOperation, process.stdin));}++await import('zod/compile');await import('./cli.ts');diff --git a/packages/cli/tests/support/zod-compile.test-helper.ts b/packages/cli/tests/support/zod-compile.test-helper.tsnew file mode 100644index 000000000..39c97c40d--- /dev/null+++ b/packages/cli/tests/support/zod-compile.test-helper.ts@@ -0,0 +1 @@+import 'zod/compile';diff --git a/packages/cli/vitest.config.ts b/packages/cli/vitest.config.tsindex 4f9920914..f67a6fd9f 100644--- a/packages/cli/vitest.config.ts+++ b/packages/cli/vitest.config.ts@@ -21,6 +21,7 @@ export default defineConfig({...okVitestBase.test,setupFiles: [...okVitestBase.test.setupFiles,+ fileURLToPath(new URL('./tests/support/zod-compile.test-helper.ts', import.meta.url)),serverAuthorityRegistrySetup,fileURLToPath(new URL('./tests/support/windows-process-start-reader.test-helper.ts', import.meta.url),diff --git a/packages/core/package.json b/packages/core/package.jsonindex 634423551..ea38450b9 100644--- a/packages/core/package.json+++ b/packages/core/package.json@@ -915,7 +915,7 @@"vfile-message": "^4.0.3","yaml": "^2.7.1","yjs": "^13.6.30",- "zod": "^4.3.6"+ "zod": "^4.6.7"},"scripts": {"build": "node scripts/build-output.mjs build",diff --git a/packages/core/src/schemas/api/document-read.test.ts b/packages/core/src/schemas/api/document-read.test.tsindex 315a1634a..e59faf97a 100644--- a/packages/core/src/schemas/api/document-read.test.ts+++ b/packages/core/src/schemas/api/document-read.test.ts@@ -1,4 +1,5 @@import { describe, expect, test } from 'vitest';+import { z } from 'zod';import {BacklinkCountsSuccessSchema,BacklinkEntrySchema,@@ -754,3 +755,12 @@ describe('LinkGraphSuccessSchema', () => {).toBe(true);});});++describe('hot list schemas under zod/compile', () => {+ test.each([+ ['DocumentListSuccessSchema', DocumentListSuccessSchema],+ ['LinkGraphSuccessSchema', LinkGraphSuccessSchema],+ ])('%s compiles as a whole schema in strict mode', (_name, schema) => {+ expect(() => z.compile(schema, { strict: true })).not.toThrow();+ });+});diff --git a/packages/core/src/schemas/api/pages.test.ts b/packages/core/src/schemas/api/pages.test.tsindex e3ad5b889..e06c36f34 100644--- a/packages/core/src/schemas/api/pages.test.ts+++ b/packages/core/src/schemas/api/pages.test.ts@@ -1,4 +1,5 @@import { describe, expect, test } from 'vitest';+import { z } from 'zod';import {CreateFolderRequestSchema,CreateFolderSuccessSchema,@@ -364,3 +365,9 @@ describe('RollbackSuccessSchema', () => {).toBe(true);});});++describe('PagesSuccessSchema under zod/compile', () => {+ test('compiles as a whole schema in strict mode', () => {+ expect(() => z.compile(PagesSuccessSchema, { strict: true })).not.toThrow();+ });+});diff --git a/packages/core/src/schemas/api/tags-search.test.ts b/packages/core/src/schemas/api/tags-search.test.tsindex 21f5ccdd9..17820462c 100644--- a/packages/core/src/schemas/api/tags-search.test.ts+++ b/packages/core/src/schemas/api/tags-search.test.ts@@ -1,4 +1,5 @@import { describe, expect, test } from 'vitest';+import { z } from 'zod';import {canonicalTemplateName,classifySemanticProviderError,@@ -10,6 +11,7 @@ import {isSkillSourceStateCode,normalizeApiWarnings,SearchSemanticStatusSchema,+ SearchSuccessSchema,SemanticIndexStatusSchema,SKILL_MOVE_RETAINED_DESTINATION,SKILL_MOVE_STATE_CODES,@@ -340,3 +342,9 @@ describe('templateRenameTarget', () => {expect(templateRenameTarget('cafe\u{0301}', 'caf\u{00E9}')).toBe('caf\u{00E9}');});});++describe('SearchSuccessSchema under zod/compile', () => {+ test('compiles as a whole schema in strict mode', () => {+ expect(() => z.compile(SearchSuccessSchema, { strict: true })).not.toThrow();+ });+});diff --git a/packages/desktop/package.json b/packages/desktop/package.jsonindex d19feeafd..7737de5a5 100644--- a/packages/desktop/package.json+++ b/packages/desktop/package.json@@ -46,7 +46,8 @@"electron-updater": "6.8.4","pino": "^10.3.1","semver": "^7.7.4",- "yaml": "^2.8.3"+ "yaml": "^2.8.3",+ "zod": "^4.6.7"},"optionalDependencies": {"node-pty": "1.2.0-beta.15"diff --git a/packages/desktop/src/utility/server-entry.ts b/packages/desktop/src/utility/server-entry.tsindex 4f1d37bf9..905efa202 100644--- a/packages/desktop/src/utility/server-entry.ts+++ b/packages/desktop/src/utility/server-entry.ts@@ -114,6 +114,10 @@ export interface SetupUtilityDeps {readInitCounters?: () => UtilityInitCounters;}+function afterZodCompile<T>(load: () => Promise<T>): Promise<T> {+ return import('zod/compile').then(load);+}+function readOwnInitCounters(): UtilityInitCounters {const cpu = process.cpuUsage();return {@@ -231,8 +235,8 @@ export function setupUtility(deps: SetupUtilityDeps): UtilityHandle {markInitPhase('init-received');const [server, cli, serverNamespace] = await Promise.all([deps.importServer(),- import('@inkeep/open-knowledge'),- import('@inkeep/open-knowledge-server'),+ afterZodCompile(() => import('@inkeep/open-knowledge')),+ afterZodCompile(() => import('@inkeep/open-knowledge-server')),]);markInitPhase('imports-resolved');cli.registerWindowsProcessStartReader(serverNamespace.getLogger('process-start'));@@ -447,9 +451,9 @@ export async function resolveDesktopServerRuntime(projectDir: string): Promise<{serverRuntime: ServerRuntimeConfig;}> {const [{ loadConfig }, { resolveServerRuntimeConfig }, { ConfigSchema }] = await Promise.all([- import('@inkeep/open-knowledge'),- import('@inkeep/open-knowledge-core'),- import('@inkeep/open-knowledge-server'),+ afterZodCompile(() => import('@inkeep/open-knowledge')),+ afterZodCompile(() => import('@inkeep/open-knowledge-core')),+ afterZodCompile(() => import('@inkeep/open-knowledge-server')),]);let config: Config;let configValid: boolean;@@ -481,7 +485,9 @@ async function defaultPrepareBootEnvironment(onPhase?: (phase: UtilityInitPhase) => void,): Promise<PreparedBootEnvironment> {const projectDir = ipcOpts.projectDir ?? ipcOpts.contentDir;- const { ensureProjectGit, initContent } = await import('@inkeep/open-knowledge-server');+ const { ensureProjectGit, initContent } = await afterZodCompile(+ () => import('@inkeep/open-knowledge-server'),+ );const degradedHints: string[] = [];if (ipcOpts.didEnsureGit !== true) {@@ -543,7 +549,7 @@ if ((process as NodeJS.Process & { parentPort?: unknown }).parentPort) {setupUtility({parentPort: (process as NodeJS.Process & { parentPort: SetupUtilityDeps['parentPort'] }).parentPort,- importServer: () => import('@inkeep/open-knowledge-server'),+ importServer: () => afterZodCompile(() => import('@inkeep/open-knowledge-server')),exit: (code) => process.exit(code),parentPid: process.ppid,killProbe: (pid, signal) => {diff --git a/packages/server/package.json b/packages/server/package.jsonindex ef49ef9b2..397bbb29e 100644--- a/packages/server/package.json+++ b/packages/server/package.json@@ -77,7 +77,7 @@"yauzl": "^3.2.0","yazl": "^3.3.1","yjs": "^13.6.30",- "zod": "^4.3.6"+ "zod": "^4.6.7"},"optionalDependencies": {"@parcel/watcher": "^2.5.6"diff --git a/packages/server/src/mcp/json-schema-dialect.test.ts b/packages/server/src/mcp/json-schema-dialect.test.tsindex e736d5da1..296c8c15b 100644--- a/packages/server/src/mcp/json-schema-dialect.test.ts+++ b/packages/server/src/mcp/json-schema-dialect.test.ts@@ -24,6 +24,38 @@ function buildServer(): McpServer {return server;}+function buildNullableServer(): McpServer {+ const server = new McpServer({ name: 'json-schema-dialect-test', version: '0.0.0' });+ server.registerTool(+ 'nullable_like',+ {+ description: 'Nullable fields at the top level, inside an object and inside an array item.',+ inputSchema: { cursor: z.string().nullable() },+ outputSchema: {+ label: z.string().nullable(),+ nested: z.object({ count: z.number().nullable() }),+ items: z.array(z.string().nullable()),+ },+ },+ async () => ({+ content: [{ type: 'text' as const, text: 'ok' }],+ structuredContent: { label: null, nested: { count: null }, items: [null] },+ }),+ );+ return server;+}++function typeArrayPaths(node: unknown, path = ''): string[] {+ if (typeof node !== 'object' || node === null) return [];+ if (Array.isArray(node))+ return node.flatMap((entry, index) => typeArrayPaths(entry, `${path}[${index}]`));+ return Object.entries(node).flatMap(([key, value]) =>+ key === 'type' && Array.isArray(value)+ ? [path]+ : typeArrayPaths(value, path ? `${path}.${key}` : key),+ );+}+async function listToolsOverWire(server: McpServer) {const [clientTransport, serverTransport] = InMemoryTransport.createLinkedPair();const client = new Client({ name: 'test-client', version: '0.0.0' });@@ -50,7 +82,7 @@ describe('installJsonSchemaDialect', () => {expect(tools[0]?.outputSchema?.$schema).toBe(JSON_SCHEMA_DIALECT_2020_12);});- test('leaves the rest of the schema untouched', async () => {+ test('leaves a schema with no type arrays unchanged apart from $schema', async () => {const before = (await listToolsOverWire(buildServer())).tools[0];const server = buildServer();installJsonSchemaDialect(server);@@ -64,6 +96,37 @@ describe('installJsonSchemaDialect', () => {expect(strip(after?.outputSchema)).toEqual(strip(before?.outputSchema));});+ test('the SDK serves nullable fields as type arrays on Zod 4.6, which the split guards', async () => {+ const { tools } = await listToolsOverWire(buildNullableServer());+ expect(typeArrayPaths(tools[0]?.inputSchema)).not.toEqual([]);+ expect(typeArrayPaths(tools[0]?.outputSchema)).not.toEqual([]);+ });++ test('serves every nullable field as anyOf of bare types, nested ones included', async () => {+ const server = buildNullableServer();+ installJsonSchemaDialect(server);++ const { tools } = await listToolsOverWire(server);+ const input = tools[0]?.inputSchema as { properties: Record<string, unknown> };+ const output = tools[0]?.outputSchema as {+ properties: {+ label: unknown;+ nested: { properties: { count: unknown } };+ items: { items: unknown };+ };+ };+ expect(typeArrayPaths(input)).toEqual([]);+ expect(typeArrayPaths(output)).toEqual([]);+ expect(input.properties.cursor).toEqual({ anyOf: [{ type: 'string' }, { type: 'null' }] });+ expect(output.properties.label).toEqual({ anyOf: [{ type: 'string' }, { type: 'null' }] });+ expect(output.properties.nested.properties.count).toEqual({+ anyOf: [{ type: 'number' }, { type: 'null' }],+ });+ expect(output.properties.items.items).toEqual({+ anyOf: [{ type: 'string' }, { type: 'null' }],+ });+ });+test('is idempotent', async () => {const server = buildServer();installJsonSchemaDialect(server);diff --git a/packages/server/src/mcp/json-schema-dialect.ts b/packages/server/src/mcp/json-schema-dialect.tsindex 4ebb68b04..48ec120e7 100644--- a/packages/server/src/mcp/json-schema-dialect.ts+++ b/packages/server/src/mcp/json-schema-dialect.ts@@ -7,6 +7,53 @@ const LIST_TOOLS_METHOD = 'tools/list';type RequestHandler = (request: unknown, extra: unknown) => ServerResult | Promise<ServerResult>;+const SUBSCHEMA_KEYWORDS = [+ 'items',+ 'contains',+ 'not',+ 'propertyNames',+ 'if',+ 'then',+ 'else',+ 'additionalProperties',+ 'unevaluatedProperties',+ 'additionalItems',+ 'unevaluatedItems',+ 'contentSchema',+] as const;+const SUBSCHEMA_LIST_KEYWORDS = ['allOf', 'anyOf', 'oneOf', 'prefixItems', 'items'] as const;+const SUBSCHEMA_MAP_KEYWORDS = [+ 'properties',+ 'patternProperties',+ 'dependentSchemas',+ '$defs',+ 'definitions',+] as const;++type JsonSchemaNode = { [keyword: string]: unknown };++function isSchemaNode(value: unknown): value is JsonSchemaNode {+ return typeof value === 'object' && value !== null && !Array.isArray(value);+}++function splitTypeArrays(schema: unknown): void {+ if (!isSchemaNode(schema)) return;+ const { type } = schema;+ if (Array.isArray(type) && type.length > 1 && schema.anyOf === undefined) {+ delete schema.type;+ schema.anyOf = type.map((member) => ({ type: member }));+ }+ for (const keyword of SUBSCHEMA_KEYWORDS) splitTypeArrays(schema[keyword]);+ for (const keyword of SUBSCHEMA_LIST_KEYWORDS) {+ const list = schema[keyword];+ if (Array.isArray(list)) for (const entry of list) splitTypeArrays(entry);+ }+ for (const keyword of SUBSCHEMA_MAP_KEYWORDS) {+ const map = schema[keyword];+ if (isSchemaNode(map)) for (const entry of Object.values(map)) splitTypeArrays(entry);+ }+}+interface ListToolsShape {tools?: Array<{inputSchema?: { $schema?: string };@@ -34,8 +81,14 @@ export function installJsonSchemaDialect(server: McpServer): void {server.server.setRequestHandler(ListToolsRequestSchema, async (request, extra) => {const result = await original(request, extra);for (const tool of (result as ListToolsShape).tools ?? []) {- if (tool.inputSchema) tool.inputSchema.$schema = JSON_SCHEMA_DIALECT_2020_12;- if (tool.outputSchema) tool.outputSchema.$schema = JSON_SCHEMA_DIALECT_2020_12;+ if (tool.inputSchema) {+ splitTypeArrays(tool.inputSchema);+ tool.inputSchema.$schema = JSON_SCHEMA_DIALECT_2020_12;+ }+ if (tool.outputSchema) {+ splitTypeArrays(tool.outputSchema);+ tool.outputSchema.$schema = JSON_SCHEMA_DIALECT_2020_12;+ }}return result;});diff --git a/packages/server/tests/support/zod-compile.test-helper.ts b/packages/server/tests/support/zod-compile.test-helper.tsnew file mode 100644index 000000000..39c97c40d--- /dev/null+++ b/packages/server/tests/support/zod-compile.test-helper.ts@@ -0,0 +1 @@+import 'zod/compile';diff --git a/packages/server/tests/support/zod-compile.test.ts b/packages/server/tests/support/zod-compile.test.tsnew file mode 100644index 000000000..1cf9c1adf--- /dev/null+++ b/packages/server/tests/support/zod-compile.test.ts@@ -0,0 +1,6 @@+import { expect, test } from 'vitest';+import { z } from 'zod';++test('the server test setup runs Zod in compile mode', () => {+ expect(z.config().postProcessor).toBeTypeOf('function');+});diff --git a/packages/server/vitest.config.ts b/packages/server/vitest.config.tsindex 1a701000f..5fab99c4e 100644--- a/packages/server/vitest.config.ts+++ b/packages/server/vitest.config.ts@@ -5,12 +5,15 @@ import { okVitestBase } from '../../test-support/vitest.base';const serverAuthorityRegistrySetup = fileURLToPath(new URL('../../test-support/server-authority-registry.setup.ts', import.meta.url),);+const zodCompileSetup = fileURLToPath(+ new URL('./tests/support/zod-compile.test-helper.ts', import.meta.url),+);export default defineConfig({...okVitestBase,test: {...okVitestBase.test,- setupFiles: [...okVitestBase.test.setupFiles, serverAuthorityRegistrySetup],+ setupFiles: [...okVitestBase.test.setupFiles, zodCompileSetup, serverAuthorityRegistrySetup],exclude: [...okVitestBase.test.exclude, '**/*.network.test.ts', '.ok-skill-publish-*'],},});diff --git a/packages/server/vitest.mcp-inspector.config.ts b/packages/server/vitest.mcp-inspector.config.tsindex e9dffe414..0ca34f723 100644--- a/packages/server/vitest.mcp-inspector.config.ts+++ b/packages/server/vitest.mcp-inspector.config.ts@@ -1,3 +1,4 @@+import { fileURLToPath } from 'node:url';import { defineConfig } from 'vitest/config';import { okVitestBase } from '../../test-support/vitest.base';@@ -5,6 +6,10 @@ export default defineConfig({...okVitestBase,test: {...okVitestBase.test,+ setupFiles: [+ ...okVitestBase.test.setupFiles,+ fileURLToPath(new URL('./tests/support/zod-compile.test-helper.ts', import.meta.url)),+ ],include: ['src/mcp/mcp-inspector-portability.network.test.ts'],},});diff --git a/packages/server/vitest.network.config.ts b/packages/server/vitest.network.config.tsindex 6821fc031..ccaae0603 100644--- a/packages/server/vitest.network.config.ts+++ b/packages/server/vitest.network.config.ts@@ -1,3 +1,4 @@+import { fileURLToPath } from 'node:url';import { defineConfig } from 'vitest/config';import { okVitestBase } from '../../test-support/vitest.base';@@ -5,6 +6,10 @@ export default defineConfig({...okVitestBase,test: {...okVitestBase.test,+ setupFiles: [+ ...okVitestBase.test.setupFiles,+ fileURLToPath(new URL('./tests/support/zod-compile.test-helper.ts', import.meta.url)),+ ],include: ['src/acp/*.network.test.ts'],fileParallelism: false,},diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 4257726cd..4c1fcb2be 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -235,10 +235,10 @@ importers:dependencies:'@hookform/resolvers':specifier: ^5.4.0'@inkeep/cxkit-react':specifier: ^0.5.117- version: 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ version: 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@inkeep/open-knowledge-core':specifier: workspace:*version: link:../packages/core@@ -324,8 +324,8 @@ importers:specifier: ^2.8.2version: 2.9.0zod:- specifier: ^4.3.6- version: 4.4.3+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@tailwindcss/postcss':specifier: ^4@@ -458,7 +458,7 @@ importers:version: 4.0.0-rc.1(patch_hash=ccc5d9846f114c5d0feb696dbe4a9432804b6f5de734bb70d2d6f138b2353b95)([email protected]([email protected]))([email protected])'@hookform/resolvers':specifier: ^5.0.0'@inkeep/open-knowledge-core':specifier: workspace:*version: link:../core@@ -700,8 +700,8 @@ importers:specifier: ^13.6.30version: 13.6.31zod:- specifier: ^4.3.6- version: 4.4.3+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@axe-core/playwright':specifier: ^4.11.1@@ -846,7 +846,7 @@ importers:version: 5.2.1(@types/[email protected])'@modelcontextprotocol/sdk':specifier: ^1.28.0- version: 1.29.0([email protected])([email protected])+ version: 1.29.0([email protected])([email protected])'@napi-rs/keyring':specifier: ^1.3.0version: 1.3.0@@ -893,8 +893,8 @@ importers:specifier: ^13.6.30version: 13.6.31zod:- specifier: ^4.3.6- version: 4.4.3+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@inkeep/open-knowledge-app':specifier: workspace:*@@ -941,7 +941,7 @@ importers:dependencies:'@agentclientprotocol/sdk':specifier: ^1.1.0- version: 1.2.1([email protected])+ version: 1.2.1([email protected])'@handlewithcare/remark-prosemirror':specifier: 0.1.5version: 0.1.5(patch_hash=a6b60cc8640e04973be2c8123e0dbd73156b54388a57cd2b76191c2fd8ac2865)([email protected])@@ -1114,8 +1114,8 @@ importers:specifier: ^13.6.30version: 13.6.31zod:- specifier: ^4.3.6- version: 4.4.3+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@standard-schema/spec':specifier: ^1.1.0@@ -1225,6 +1225,9 @@ importers:yaml:specifier: ^2.8.3version: 2.9.0+ zod:+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@electron/fuses':specifier: ^2.1.1@@ -1288,7 +1291,7 @@ importers:dependencies:'@agentclientprotocol/sdk':specifier: ^1.1.0- version: 1.2.1([email protected])+ version: 1.2.1([email protected])'@hocuspocus/server':specifier: 4.0.0-rc.1@@ -1300,7 +1303,7 @@ importers:version: link:../core'@modelcontextprotocol/sdk':specifier: ^1.28.0- version: 1.29.0([email protected])([email protected])+ version: 1.29.0([email protected])([email protected])'@opentelemetry/api':specifier: ^1.9.0version: 1.9.1@@ -1413,8 +1416,8 @@ importers:specifier: ^13.6.30version: 13.6.31zod:- specifier: ^4.3.6- version: 4.4.3+ specifier: ^4.6.7+ version: 4.6.7devDependencies:'@types/mdast':specifier: ^4.0.4@@ -12606,6 +12609,9 @@ packages:resolution: {integrity: sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ==}+ resolution: {integrity: sha512-g8W2D2kU6a8untc053fX1uVBKzM7yqAxW/3zwk83+6RyF2+SKOuV+c0wBDhUwzV1PaGapmZH+rmcUzPf+3CGwg==}+resolution: {integrity: sha512-XE96n56IQpJM7NAoXswY3XRLcWFW83xe0BiAOeMD7K5k5xecOeul3Qcpx6GqEeeHNkW5DWL5zOyTbEfB4eti8w==}@@ -12631,9 +12637,9 @@ snapshots:'@adobe/[email protected]': {}- '@agentclientprotocol/[email protected]([email protected])':+ '@agentclientprotocol/[email protected]([email protected])':dependencies:- zod: 4.4.3+ zod: 4.6.7'@alloc/[email protected]': {}@@ -13740,11 +13746,11 @@ snapshots:dependencies:hono: 4.12.34dependencies:'@standard-schema/utils': 0.3.0react-hook-form: 7.81.0([email protected])- zod: 4.4.3+ zod: 4.6.7'@humanfs/[email protected]':dependencies:@@ -13982,7 +13988,7 @@ snapshots:'@inkeep/[email protected]': {}- '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':dependencies:'@inkeep/cxkit-color-mode': 0.5.119'@inkeep/cxkit-theme': 0.5.119@@ -14023,7 +14029,7 @@ snapshots:lucide-react: 0.503.0([email protected])marked: 15.0.12merge-anything: 5.1.7- openai: 4.78.1([email protected])+ openai: 4.78.1([email protected])prism-react-renderer: 2.4.1([email protected])react: 19.2.5react-dom: 19.2.5([email protected])@@ -14044,9 +14050,9 @@ snapshots:- supports-color- zod- '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':dependencies:- '@inkeep/cxkit-styled': 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@inkeep/cxkit-styled': 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])'@radix-ui/react-use-controllable-state': 1.2.3(@types/[email protected])([email protected])lucide-react: 0.503.0([email protected])transitivePeerDependencies:@@ -14058,9 +14064,9 @@ snapshots:- supports-color- zod- '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':+ '@inkeep/[email protected](@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])':dependencies:- '@inkeep/cxkit-primitives': 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])+ '@inkeep/cxkit-primitives': 0.5.119(@types/[email protected](@types/[email protected]))(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])([email protected])class-variance-authority: 0.7.1clsx: 2.1.1merge-anything: 5.1.7@@ -14636,7 +14642,7 @@ snapshots:transitivePeerDependencies:- supports-colordependencies:'@hono/node-server': 1.19.17([email protected])ajv: 8.20.0@@ -14653,8 +14659,8 @@ snapshots:json-schema-typed: 8.0.2pkce-challenge: 5.0.1raw-body: 3.0.2- zod: 4.4.3- zod-to-json-schema: 3.25.2([email protected])+ zod: 4.6.7+ zod-to-json-schema: 3.25.2([email protected])transitivePeerDependencies:- supports-color@@ -19889,7 +19895,7 @@ snapshots:unist-util-remove-position: 5.0.0unist-util-visit: 5.1.0vfile: 6.0.3- zod: 4.4.3+ zod: 4.6.7optionalDependencies:next: 16.3.8(@babel/[email protected]([email protected]))(@opentelemetry/[email protected])(@playwright/[email protected])(@types/[email protected])([email protected]([email protected]))([email protected])([email protected])react: 19.2.5@@ -21980,7 +21986,7 @@ snapshots:is-docker: 2.2.1is-wsl: 2.2.0dependencies:'@types/node': 24.13.3'@types/node-fetch': 2.6.13@@ -21990,7 +21996,7 @@ snapshots:formdata-node: 4.4.1node-fetch: 2.7.0optionalDependencies:- zod: 4.4.3+ zod: 4.6.7transitivePeerDependencies:- encoding@@ -24834,14 +24840,16 @@ snapshots:dependencies:zod: 3.25.76dependencies:- zod: 4.4.3+ zod: 4.6.7+ [email protected]: {}+