@frontmcp/react 1.0.4 → 1.1.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.
- package/components/mcpComponent.d.ts +2 -3
- package/components/mcpComponent.d.ts.map +1 -1
- package/esm/index.mjs +5 -5
- package/esm/package.json +6 -6
- package/hooks/useDynamicTool.d.ts +1 -1
- package/hooks/useDynamicTool.d.ts.map +1 -1
- package/index.js +4 -4
- package/package.json +6 -6
- package/utils/zodToJsonSchema.d.ts +8 -1
- package/utils/zodToJsonSchema.d.ts.map +1 -1
|
@@ -12,9 +12,8 @@
|
|
|
12
12
|
* - Lazy loading via () => import(...)
|
|
13
13
|
* - Table mode (columns option with null component)
|
|
14
14
|
*/
|
|
15
|
-
import React from 'react';
|
|
16
|
-
import
|
|
17
|
-
import { z } from 'zod';
|
|
15
|
+
import React, { type ComponentType, type ReactElement, type ReactNode } from 'react';
|
|
16
|
+
import { z } from '@frontmcp/lazy-zod';
|
|
18
17
|
import type { McpColumnDef } from '../types';
|
|
19
18
|
/** Brand applied by mcpLazy to distinguish lazy imports from zero-arg components. */
|
|
20
19
|
type McpLazyBrand = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpComponent.d.ts","sourceRoot":"","sources":["../../src/components/mcpComponent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,
|
|
1
|
+
{"version":3,"file":"mcpComponent.d.ts","sourceRoot":"","sources":["../../src/components/mcpComponent.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,EAAmC,KAAK,aAAa,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEtH,OAAO,EAAE,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAIvC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAM7C,qFAAqF;AACrF,KAAK,YAAY,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B,oBAAoB,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAqGlC"}
|
package/esm/index.mjs
CHANGED
|
@@ -980,12 +980,12 @@ function useStoreResource(uri, options) {
|
|
|
980
980
|
}
|
|
981
981
|
|
|
982
982
|
// libs/react/src/hooks/useDynamicTool.ts
|
|
983
|
-
import { useContext as useContext2, useEffect as useEffect6,
|
|
983
|
+
import { useContext as useContext2, useEffect as useEffect6, useMemo as useMemo2, useRef as useRef3 } from "react";
|
|
984
984
|
|
|
985
985
|
// libs/react/src/utils/zodToJsonSchema.ts
|
|
986
|
-
import { toJSONSchema } from "zod
|
|
986
|
+
import { forceMaterialize, toJSONSchema } from "@frontmcp/lazy-zod";
|
|
987
987
|
function zodToJsonSchema(schema) {
|
|
988
|
-
return toJSONSchema(schema);
|
|
988
|
+
return toJSONSchema(forceMaterialize(schema));
|
|
989
989
|
}
|
|
990
990
|
|
|
991
991
|
// libs/react/src/hooks/useDynamicTool.ts
|
|
@@ -1557,8 +1557,8 @@ function AgentSearch({
|
|
|
1557
1557
|
}
|
|
1558
1558
|
|
|
1559
1559
|
// libs/react/src/components/mcpComponent.tsx
|
|
1560
|
-
import React9, {
|
|
1561
|
-
import { z } from "zod";
|
|
1560
|
+
import React9, { Suspense, useCallback as useCallback12, useState as useState9 } from "react";
|
|
1561
|
+
import { z } from "@frontmcp/lazy-zod";
|
|
1562
1562
|
var MCP_LAZY_MARKER = /* @__PURE__ */ Symbol.for("frontmcp:lazy");
|
|
1563
1563
|
function mcpLazy(factory) {
|
|
1564
1564
|
return Object.assign(factory, { [MCP_LAZY_MARKER]: true });
|
package/esm/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "React hooks, components, and AI SDK integration for FrontMCP",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"react": "^18.0.0 || ^19.0.0",
|
|
90
90
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
91
|
-
"@frontmcp/sdk": "1.0
|
|
92
|
-
"@frontmcp/utils": "1.0
|
|
91
|
+
"@frontmcp/sdk": "1.1.0",
|
|
92
|
+
"@frontmcp/utils": "1.1.0",
|
|
93
93
|
"react-router-dom": "^7.0.0",
|
|
94
|
-
"zod": "
|
|
94
|
+
"@frontmcp/lazy-zod": "1.1.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependenciesMeta": {
|
|
97
97
|
"react-router-dom": {
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@frontmcp/sdk": "1.0
|
|
106
|
-
"@frontmcp/utils": "1.0
|
|
105
|
+
"@frontmcp/sdk": "1.1.0",
|
|
106
|
+
"@frontmcp/utils": "1.1.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"typescript": "^5.9.3"
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
* Supports both JSON Schema and zod-based schemas. When a zod schema
|
|
8
8
|
* is provided, input is validated before reaching the execute callback.
|
|
9
9
|
*/
|
|
10
|
+
import type { z } from '@frontmcp/lazy-zod';
|
|
10
11
|
import type { CallToolResult } from '@frontmcp/sdk';
|
|
11
|
-
import type { z } from 'zod';
|
|
12
12
|
export interface UseDynamicToolSchemaOptions<S extends z.ZodObject<z.ZodRawShape>> {
|
|
13
13
|
name: string;
|
|
14
14
|
description: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useDynamicTool.d.ts","sourceRoot":"","sources":["../../src/hooks/useDynamicTool.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;
|
|
1
|
+
{"version":3,"file":"useDynamicTool.d.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CAAC,CAAC,GAC9B,+BAA+B,CAAC;AAEpC,wBAAgB,cAAc,CAAC,CAAC,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW,CAAC,EAAE,OAAO,EAAE,qBAAqB,CAAC,CAAC,CAAC,GAAG,IAAI,CA2D5G"}
|
package/index.js
CHANGED
|
@@ -1059,9 +1059,9 @@ function useStoreResource(uri, options) {
|
|
|
1059
1059
|
var import_react10 = require("react");
|
|
1060
1060
|
|
|
1061
1061
|
// libs/react/src/utils/zodToJsonSchema.ts
|
|
1062
|
-
var
|
|
1062
|
+
var import_lazy_zod = require("@frontmcp/lazy-zod");
|
|
1063
1063
|
function zodToJsonSchema(schema) {
|
|
1064
|
-
return (0,
|
|
1064
|
+
return (0, import_lazy_zod.toJSONSchema)((0, import_lazy_zod.forceMaterialize)(schema));
|
|
1065
1065
|
}
|
|
1066
1066
|
|
|
1067
1067
|
// libs/react/src/hooks/useDynamicTool.ts
|
|
@@ -1634,7 +1634,7 @@ function AgentSearch({
|
|
|
1634
1634
|
|
|
1635
1635
|
// libs/react/src/components/mcpComponent.tsx
|
|
1636
1636
|
var import_react20 = __toESM(require("react"));
|
|
1637
|
-
var
|
|
1637
|
+
var import_lazy_zod2 = require("@frontmcp/lazy-zod");
|
|
1638
1638
|
var MCP_LAZY_MARKER = /* @__PURE__ */ Symbol.for("frontmcp:lazy");
|
|
1639
1639
|
function mcpLazy(factory) {
|
|
1640
1640
|
return Object.assign(factory, { [MCP_LAZY_MARKER]: true });
|
|
@@ -1686,7 +1686,7 @@ function mcpComponent(component, options) {
|
|
|
1686
1686
|
}
|
|
1687
1687
|
let toolSchema;
|
|
1688
1688
|
if (isTableMode) {
|
|
1689
|
-
toolSchema =
|
|
1689
|
+
toolSchema = import_lazy_zod2.z.object({ rows: import_lazy_zod2.z.array(schema) });
|
|
1690
1690
|
} else {
|
|
1691
1691
|
toolSchema = schema;
|
|
1692
1692
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@frontmcp/react",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.0",
|
|
4
4
|
"description": "React hooks, components, and AI SDK integration for FrontMCP",
|
|
5
5
|
"author": "AgentFront <info@agentfront.dev>",
|
|
6
6
|
"homepage": "https://docs.agentfront.dev",
|
|
@@ -88,10 +88,10 @@
|
|
|
88
88
|
"peerDependencies": {
|
|
89
89
|
"react": "^18.0.0 || ^19.0.0",
|
|
90
90
|
"react-dom": "^18.0.0 || ^19.0.0",
|
|
91
|
-
"@frontmcp/sdk": "1.0
|
|
92
|
-
"@frontmcp/utils": "1.0
|
|
91
|
+
"@frontmcp/sdk": "1.1.0",
|
|
92
|
+
"@frontmcp/utils": "1.1.0",
|
|
93
93
|
"react-router-dom": "^7.0.0",
|
|
94
|
-
"zod": "
|
|
94
|
+
"@frontmcp/lazy-zod": "1.1.0"
|
|
95
95
|
},
|
|
96
96
|
"peerDependenciesMeta": {
|
|
97
97
|
"react-router-dom": {
|
|
@@ -102,8 +102,8 @@
|
|
|
102
102
|
}
|
|
103
103
|
},
|
|
104
104
|
"dependencies": {
|
|
105
|
-
"@frontmcp/sdk": "1.0
|
|
106
|
-
"@frontmcp/utils": "1.0
|
|
105
|
+
"@frontmcp/sdk": "1.1.0",
|
|
106
|
+
"@frontmcp/utils": "1.1.0"
|
|
107
107
|
},
|
|
108
108
|
"devDependencies": {
|
|
109
109
|
"typescript": "^5.9.3"
|
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Keeps the zod dependency isolated so the rest of the React SDK only
|
|
5
5
|
* deals with plain JSON Schema objects.
|
|
6
|
+
*
|
|
7
|
+
* NOTE: `forceMaterialize` is required before handing a schema to
|
|
8
|
+
* `toJSONSchema`. Zod's converter walks the schema tree via internal
|
|
9
|
+
* `_def` properties and mutates intermediate state; the lazy-zod Proxy
|
|
10
|
+
* intercepts `_def` in a way that breaks those mutations (manifests as
|
|
11
|
+
* `TypeError: Cannot set properties of undefined`). Materializing first
|
|
12
|
+
* gives the converter real zod nodes to work with.
|
|
6
13
|
*/
|
|
7
|
-
import type
|
|
14
|
+
import { type z } from '@frontmcp/lazy-zod';
|
|
8
15
|
export declare function zodToJsonSchema(schema: z.ZodType): Record<string, unknown>;
|
|
9
16
|
//# sourceMappingURL=zodToJsonSchema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zodToJsonSchema.d.ts","sourceRoot":"","sources":["../../src/utils/zodToJsonSchema.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"zodToJsonSchema.d.ts","sourceRoot":"","sources":["../../src/utils/zodToJsonSchema.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAkC,KAAK,CAAC,EAAE,MAAM,oBAAoB,CAAC;AAE5E,wBAAgB,eAAe,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAE1E"}
|