zudoku 0.82.5 → 0.83.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,14 +15,12 @@ export declare const getRoutesByOptions: (options: ZudokuContextOptions, enableS
15
15
  middleware?: import("react-router").MiddlewareFunction[];
16
16
  loader?: import("react-router").LoaderFunction | boolean;
17
17
  action?: import("react-router").ActionFunction | boolean;
18
- hasErrorBoundary?: boolean;
19
18
  shouldRevalidate?: import("react-router").ShouldRevalidateFunction;
20
19
  handle?: any;
21
20
  lazy?: {
22
21
  middleware?: (() => Promise<import("react-router").MiddlewareFunction<unknown>[] | null | undefined>) | undefined;
23
- loader?: (() => Promise<boolean | import("react-router").LoaderFunction<any> | null | undefined>) | undefined;
24
- action?: (() => Promise<boolean | import("react-router").ActionFunction<any> | null | undefined>) | undefined;
25
- hasErrorBoundary?: (() => Promise<boolean | null | undefined>) | undefined;
22
+ loader?: (() => Promise<boolean | import("react-router").LoaderFunction<Readonly<import("react-router").RouterContextProvider>> | null | undefined>) | undefined;
23
+ action?: (() => Promise<boolean | import("react-router").ActionFunction<Readonly<import("react-router").RouterContextProvider>> | null | undefined>) | undefined;
26
24
  shouldRevalidate?: (() => Promise<import("react-router").ShouldRevalidateFunction | null | undefined>) | undefined;
27
25
  handle?: (() => Promise<any>) | undefined;
28
26
  Component?: (() => Promise<import("react").ComponentType<{}> | null | undefined>) | undefined;
@@ -32,11 +30,11 @@ export declare const getRoutesByOptions: (options: ZudokuContextOptions, enableS
32
30
  HydrateFallback?: (() => Promise<import("react").ComponentType<{}> | null | undefined>) | undefined;
33
31
  hydrateFallbackElement?: (() => Promise<import("react").ReactNode>) | undefined;
34
32
  } | import("react-router").LazyRouteFunction<import("react-router").BaseRouteObject>;
35
- Component?: React.ComponentType | null;
36
- element?: React.ReactNode | null;
37
- ErrorBoundary?: React.ComponentType | null;
38
- HydrateFallback?: React.ComponentType | null;
39
- hydrateFallbackElement?: React.ReactNode | null;
33
+ Component?: import("react").ComponentType | null;
34
+ element?: import("react").ReactNode | null;
35
+ ErrorBoundary?: import("react").ComponentType | null;
36
+ HydrateFallback?: import("react").ComponentType | null;
37
+ hydrateFallbackElement?: import("react").ReactNode | null;
40
38
  children?: undefined;
41
39
  index: true;
42
40
  } | {
@@ -47,14 +45,12 @@ export declare const getRoutesByOptions: (options: ZudokuContextOptions, enableS
47
45
  middleware?: import("react-router").MiddlewareFunction[];
48
46
  loader?: import("react-router").LoaderFunction | boolean;
49
47
  action?: import("react-router").ActionFunction | boolean;
50
- hasErrorBoundary?: boolean;
51
48
  shouldRevalidate?: import("react-router").ShouldRevalidateFunction;
52
49
  handle?: any;
53
50
  lazy?: {
54
51
  middleware?: (() => Promise<import("react-router").MiddlewareFunction<unknown>[] | null | undefined>) | undefined;
55
- loader?: (() => Promise<boolean | import("react-router").LoaderFunction<any> | null | undefined>) | undefined;
56
- action?: (() => Promise<boolean | import("react-router").ActionFunction<any> | null | undefined>) | undefined;
57
- hasErrorBoundary?: (() => Promise<boolean | null | undefined>) | undefined;
52
+ loader?: (() => Promise<boolean | import("react-router").LoaderFunction<Readonly<import("react-router").RouterContextProvider>> | null | undefined>) | undefined;
53
+ action?: (() => Promise<boolean | import("react-router").ActionFunction<Readonly<import("react-router").RouterContextProvider>> | null | undefined>) | undefined;
58
54
  shouldRevalidate?: (() => Promise<import("react-router").ShouldRevalidateFunction | null | undefined>) | undefined;
59
55
  handle?: (() => Promise<any>) | undefined;
60
56
  Component?: (() => Promise<import("react").ComponentType<{}> | null | undefined>) | undefined;
@@ -64,11 +60,11 @@ export declare const getRoutesByOptions: (options: ZudokuContextOptions, enableS
64
60
  HydrateFallback?: (() => Promise<import("react").ComponentType<{}> | null | undefined>) | undefined;
65
61
  hydrateFallbackElement?: (() => Promise<import("react").ReactNode>) | undefined;
66
62
  } | import("react-router").LazyRouteFunction<import("react-router").BaseRouteObject>;
67
- Component?: React.ComponentType | null;
68
- element?: React.ReactNode | null;
69
- ErrorBoundary?: React.ComponentType | null;
70
- HydrateFallback?: React.ComponentType | null;
71
- hydrateFallbackElement?: React.ReactNode | null;
63
+ Component?: import("react").ComponentType | null;
64
+ element?: import("react").ReactNode | null;
65
+ ErrorBoundary?: import("react").ComponentType | null;
66
+ HydrateFallback?: import("react").ComponentType | null;
67
+ hydrateFallbackElement?: import("react").ReactNode | null;
72
68
  children?: RouteObject[];
73
69
  index?: false;
74
70
  })[];
package/package.json CHANGED
@@ -1,9 +1,9 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.82.5",
3
+ "version": "0.83.0",
4
4
  "type": "module",
5
5
  "engines": {
6
- "node": ">=20.19.0 <21.0.0 || >=22.12.0"
6
+ "node": ">=22.22.0"
7
7
  },
8
8
  "sideEffects": [
9
9
  "**/*.css",
@@ -223,10 +223,9 @@
223
223
  "@tanstack/react-query": "5.101.4",
224
224
  "@types/react": "19.2.17",
225
225
  "@types/react-dom": "19.2.3",
226
+ "@unhead/react": "3.2.3",
226
227
  "@vitejs/plugin-react": "6.0.4",
227
228
  "@x0k/json-schema-merge": "1.0.4",
228
- "@unhead/react": "3.2.3",
229
- "@zuplo/mcp": "0.0.32",
230
229
  "bs58": "6.0.0",
231
230
  "class-variance-authority": "0.7.1",
232
231
  "clsx": "2.1.1",
@@ -271,7 +270,7 @@
271
270
  "react-hook-form": "7.83.0",
272
271
  "react-is": "19.2.8",
273
272
  "react-markdown": "10.1.0",
274
- "react-router": "7.18.1",
273
+ "react-router": "8.3.0",
275
274
  "rehype-mdx-import-media": "1.4.0",
276
275
  "rehype-raw": "7.0.0",
277
276
  "rehype-slug": "6.0.0",
@@ -308,7 +307,7 @@
308
307
  "@types/estree": "1.0.9",
309
308
  "@types/glob-parent": "5.1.3",
310
309
  "@types/har-format": "^1.2.16",
311
- "@types/hast": "3.0.4",
310
+ "@types/hast": "3.0.5",
312
311
  "@types/json-schema": "7.0.15",
313
312
  "@types/mdast": "4.0.4",
314
313
  "@types/mdx": "2.0.14",
@@ -332,8 +331,8 @@
332
331
  "@supabase/supabase-js": "^2.49.4",
333
332
  "firebase": "^12.6.0",
334
333
  "mermaid": "^11.0.0",
335
- "react": ">=19.2.0",
336
- "react-dom": ">=19.2.0"
334
+ "react": ">=19.2.7",
335
+ "react-dom": ">=19.2.7"
337
336
  },
338
337
  "peerDependenciesMeta": {
339
338
  "@azure/msal-browser": {
@@ -1,13 +1,5 @@
1
1
  import fs from "node:fs/promises";
2
2
  import path from "node:path";
3
- import type {
4
- ExtensionMcpServer,
5
- ExtensionMcpServerTool,
6
- } from "@zuplo/mcp/openapi/types";
7
- import {
8
- DEFAULT_MCP_SERVER_NAME,
9
- DEFAULT_MCP_SERVER_VERSION,
10
- } from "@zuplo/mcp/server";
11
3
  import type { OpenAPIV3_1 } from "openapi-types";
12
4
  import type { ProcessorArg } from "../config/validators/BuildSchema.js";
13
5
  import { traverse, traverseAsync } from "../lib/util/traverse.js";
@@ -18,6 +10,37 @@ const MCP_TAG_NAME = "MCP";
18
10
  const MCP_TAG_DESCRIPTION =
19
11
  "Model Context Protocol (MCP) server endpoints for AI tool integration";
20
12
 
13
+ // What the Zuplo MCP runtime advertises when the handler leaves `name` and
14
+ // `version` unset. Mirrored here so the documented server identity matches what
15
+ // MCP clients see during initialization.
16
+ const DEFAULT_MCP_SERVER_NAME = "MCP Server";
17
+ const DEFAULT_MCP_SERVER_VERSION = "0.0.0";
18
+
19
+ // `x-mcp-server` is an OpenAPI extension rather than an MCP protocol message,
20
+ // so its shape is described here instead of being pulled from an MCP SDK.
21
+ // `name` and `version` mirror the spec's `Implementation`: they are what
22
+ // clients read back during initialization. `security` and `securitySchemes`
23
+ // carry the auth requirements of the operations the server exposes, so install
24
+ // snippets can show the right credentials.
25
+ type ExtensionMcpServer = {
26
+ name: string;
27
+ version: string;
28
+ tools?: ExtensionMcpServerTool[];
29
+ security?: OpenAPIV3_1.SecurityRequirementObject[];
30
+ securitySchemes?: Record<string, OpenAPIV3_1.SecuritySchemeObject>;
31
+ };
32
+
33
+ // Tool metadata for an `x-mcp-server` tool list. Deviates from the spec's
34
+ // `Tool` in two places: `description` is required because the extractor always
35
+ // resolves one, and `inputSchema` is loose because Zudoku documents only the
36
+ // request body rather than the full JSON Schema object the spec expects — see
37
+ // the TODO in extractOperationSchema.
38
+ type ExtensionMcpServerTool = {
39
+ name: string;
40
+ description: string;
41
+ inputSchema?: object;
42
+ };
43
+
21
44
  // Reads a non-empty string from an untyped handler option, returning undefined
22
45
  // for missing, blank, or non-string values so callers can fall back to a
23
46
  // default.
@@ -243,16 +266,15 @@ export const enrichWithZuploMcpServerData = ({
243
266
  mcpExtension.tools = allTools;
244
267
  }
245
268
 
246
- node["x-mcp-server"] = mcpExtension;
247
-
248
269
  // Add security from referenced operations to x-mcp-server
249
270
  const dedupedSecurity = deduplicateSecurity(allSecurity);
250
271
  if (dedupedSecurity.length > 0) {
251
- const ext = node["x-mcp-server"] as RecordAny;
252
- ext.security = dedupedSecurity;
253
- ext.securitySchemes = { ...securitySchemes };
272
+ mcpExtension.security = dedupedSecurity;
273
+ mcpExtension.securitySchemes = { ...securitySchemes };
254
274
  }
255
275
 
276
+ node["x-mcp-server"] = mcpExtension;
277
+
256
278
  // Assign default MCP tag if the operation has no tags
257
279
  if (!operation.tags || operation.tags.length === 0) {
258
280
  assignedDefaultMcpTag = true;