Skip to content

Commit b45ac29

Browse files
refactor: update package.json scripts and dependencies; migrate zod imports to v3 in schema files; enhance tool registration with titles and descriptions
1 parent 9259964 commit b45ac29

36 files changed

+1274
-1320
lines changed

package.json

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,11 @@
99
"start": "concurrently \"npm run dev:local\" \"npm run inspector:local\"",
1010
"dev:local": "npm run build:watch",
1111
"inspector:local": "npx @modelcontextprotocol/inspector -- nodemon --env-file=.env -q --watch dist dist/index.js",
12-
"dev:cf": "wrangler dev src/index.worker.ts",
13-
"inspector:cf": "npx @modelcontextprotocol/inspector",
14-
"deploy:cf": "npm run build && wrangler deploy",
15-
"types:cf": "wrangler types",
16-
"build": "tsup src/index.ts src/index.worker.ts --external=cloudflare:workers --dts --clean",
17-
"build:watch": "tsup src/index.ts src/index.worker.ts --external=cloudflare:workers --dts --watch"
12+
"build": "tsup src/index.ts",
13+
"build:watch": "tsup src/index.ts --watch"
1814
},
1915
"dependencies": {
20-
"@modelcontextprotocol/sdk": "^1.8.0",
21-
"agents": "^0.0.59",
16+
"@modelcontextprotocol/sdk": "1.24.0",
2217
"cors": "^2.8.5",
2318
"express": "^5.1.0",
2419
"socket.io": "^4.8.1",

src/schemas/CollectionItemPostSingleSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const CollectionItemPostSingleSchema = z.object({
44
id: z.string().optional(),

src/schemas/CollectionItemWithIdInputSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const CollectionItemWithIdInputSchema = z
44
.object({
Lines changed: 31 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

3-
export const ComponentDomWriteNodesItemSchema = z.union([
4-
z.object({
5-
nodeId: z.string().describe("Unique identifier for the node."),
6-
text: z.string().describe("HTML content of the node, including the HTML tag."),
7-
}).describe("Text node to be updated."),
8-
z.object({
9-
nodeId: z.string().describe("Unique identifier for the node."),
10-
propertyOverrides: z.array(
11-
z.object({
12-
propertyId: z.string().describe("Unique identifier for the property."),
13-
text: z.string().describe("Value used to override a component property."),
3+
export const ComponentDomWriteNodesItemSchema = z
4+
.union([
5+
z
6+
.object({
7+
nodeId: z.string().describe("Unique identifier for the node."),
8+
text: z
9+
.string()
10+
.describe("HTML content of the node, including the HTML tag."),
1411
})
15-
).describe("Properties to override for this locale's component instances."),
16-
}).describe("Update text property overrides of a component instance."),
17-
]).array();
12+
.describe("Text node to be updated."),
13+
z
14+
.object({
15+
nodeId: z.string().describe("Unique identifier for the node."),
16+
propertyOverrides: z
17+
.array(
18+
z.object({
19+
propertyId: z
20+
.string()
21+
.describe("Unique identifier for the property."),
22+
text: z
23+
.string()
24+
.describe("Value used to override a component property."),
25+
})
26+
)
27+
.describe(
28+
"Properties to override for this locale's component instances."
29+
),
30+
})
31+
.describe("Update text property overrides of a component instance."),
32+
])
33+
.array();
Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

3-
export const ComponentPropertyUpdateSchema = z.array(
4-
z.object({
5-
propertyId: z.string().describe("Unique identifier for the property."),
6-
text: z.string().describe("New value for the property in this locale."),
7-
})
8-
).describe("Array of properties to update for this component.");
3+
export const ComponentPropertyUpdateSchema = z
4+
.array(
5+
z.object({
6+
propertyId: z.string().describe("Unique identifier for the property."),
7+
text: z.string().describe("New value for the property in this locale."),
8+
})
9+
)
10+
.describe("Array of properties to update for this component.");

src/schemas/DEElementIDSchema.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,14 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const DEElementIDSchema = {
44
id: z
55
.object({
66
component: z
77
.string()
8-
.describe(
9-
"The component id of the element to perform action on."
10-
),
8+
.describe("The component id of the element to perform action on."),
119
element: z
1210
.string()
13-
.describe(
14-
"The element id of the element to perform action on."
15-
),
11+
.describe("The element id of the element to perform action on."),
1612
})
1713
.describe(
1814
"The id of the element to perform action on, you can find it from id field on element. e.g id:{component:123,element:456}."

src/schemas/DEElementSchema.ts

Lines changed: 12 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const DEElementSchema = z.object({
44
type: z
@@ -30,9 +30,7 @@ export const DEElementSchema = z.object({
3030
),
3131
set_text: z
3232
.object({
33-
text: z
34-
.string()
35-
.describe("The text to set on the element."),
33+
text: z.string().describe("The text to set on the element."),
3634
})
3735
.optional()
3836
.describe(
@@ -41,20 +39,9 @@ export const DEElementSchema = z.object({
4139
set_link: z
4240
.object({
4341
link_type: z
44-
.enum([
45-
"url",
46-
"file",
47-
"page",
48-
"element",
49-
"email",
50-
"phone",
51-
])
52-
.describe(
53-
"The type of link to set on the element."
54-
),
55-
link: z
56-
.string()
57-
.describe("The link to set on the element."),
42+
.enum(["url", "file", "page", "element", "email", "phone"])
43+
.describe("The type of link to set on the element."),
44+
link: z.string().describe("The link to set on the element."),
5845
})
5946
.optional()
6047
.describe(
@@ -66,21 +53,15 @@ export const DEElementSchema = z.object({
6653
.number()
6754
.min(1)
6855
.max(6)
69-
.describe(
70-
"The heading level to set on the element."
71-
),
56+
.describe("The heading level to set on the element."),
7257
})
7358
.optional()
74-
.describe(
75-
"Set heading level on the element. only valid for heading."
76-
),
59+
.describe("Set heading level on the element. only valid for heading."),
7760
set_image_asset: z
7861
.object({
7962
image_asset_id: z
8063
.string()
81-
.describe(
82-
"The image asset id to set on the element."
83-
),
64+
.describe("The image asset id to set on the element."),
8465
alt_text: z
8566
.string()
8667
.optional()
@@ -89,9 +70,7 @@ export const DEElementSchema = z.object({
8970
),
9071
})
9172
.optional()
92-
.describe(
93-
"Set image asset on the element. only valid for image."
94-
),
73+
.describe("Set image asset on the element. only valid for image."),
9574
set_dom_config: z
9675
.object({
9776
dom_tag: z
@@ -101,24 +80,14 @@ export const DEElementSchema = z.object({
10180
),
10281
})
10382
.optional()
104-
.describe(
105-
"Set DOM config on the element. only valid for DOM element."
106-
),
83+
.describe("Set DOM config on the element. only valid for DOM element."),
10784
set_attributes: z
10885
.object({
10986
attributes: z
11087
.array(
11188
z.object({
112-
name: z
113-
.string()
114-
.describe(
115-
"The name of the attribute to set."
116-
),
117-
value: z
118-
.string()
119-
.describe(
120-
"The value of the attribute to set."
121-
),
89+
name: z.string().describe("The name of the attribute to set."),
90+
value: z.string().describe("The value of the attribute to set."),
12291
})
12392
)
12493
.describe("The attributes to set on the element."),

src/schemas/OptionFieldSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import z from "zod";
1+
import z from "zod/v3";
22

33
export const OptionFieldSchema = z.object({
44
id: z.string().optional().describe("Unique identifier for the Field."),

src/schemas/ReferenceFieldSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const ReferenceFieldSchema = z.object({
44
id: z.string().optional().describe("Unique identifier for the Field."),

src/schemas/RegisterInlineSiteScriptSchema.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { z } from "zod";
1+
import { z } from "zod/v3";
22

33
export const RegisterInlineSiteScriptSchema = z
44
.object({

0 commit comments

Comments
 (0)