@decocms/bindings 1.0.3 → 1.0.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@decocms/bindings",
3
- "version": "1.0.3",
3
+ "version": "1.0.4",
4
4
  "type": "module",
5
5
  "scripts": {
6
6
  "check": "tsc --noEmit",
@@ -8,8 +8,8 @@
8
8
  },
9
9
  "dependencies": {
10
10
  "@modelcontextprotocol/sdk": "1.25.1",
11
- "zod": "^3.25.76",
12
- "zod-from-json-schema": "^0.0.5"
11
+ "zod": "^4.0.0",
12
+ "zod-from-json-schema": "^0.5.2"
13
13
  },
14
14
  "exports": {
15
15
  ".": "./src/index.ts",
@@ -1,4 +1,5 @@
1
- import { z, type ZodType } from "zod";
1
+ import { z } from "zod";
2
+ import type { ZodType } from "zod";
2
3
  import type { ToolBinder } from "../core/binder";
3
4
 
4
5
  /**
@@ -178,7 +179,7 @@ export function createCollectionUpdateInputSchema<T extends z.ZodTypeAny>(
178
179
  ) {
179
180
  return z.object({
180
181
  id: z.string().describe("ID of the entity to update"),
181
- data: (entitySchema as unknown as z.AnyZodObject)
182
+ data: (entitySchema as unknown as z.ZodObject<z.ZodRawShape>)
182
183
  .partial()
183
184
  .describe("Partial entity data to update"),
184
185
  });
@@ -331,7 +332,7 @@ type ToolBinding<
331
332
  export type CollectionBinding<
332
333
  TEntitySchema,
333
334
  TUpperName extends Uppercase<string> = Uppercase<string>,
334
- TEntity = TEntitySchema extends z.AnyZodObject
335
+ TEntity = TEntitySchema extends z.ZodObject<z.ZodRawShape>
335
336
  ? z.infer<TEntitySchema>
336
337
  : TEntitySchema,
337
338
  > = [
@@ -369,7 +370,7 @@ export type CollectionBinding<
369
370
  * Type helper to extract tool names from a collection binding
370
371
  */
371
372
  export type CollectionTools<
372
- TEntitySchema extends z.AnyZodObject,
373
+ TEntitySchema extends z.ZodObject<z.ZodRawShape>,
373
374
  TUpperName extends Uppercase<string> = Uppercase<string>,
374
375
  > = CollectionBinding<TEntitySchema, TUpperName>[number]["name"];
375
376
 
@@ -24,8 +24,8 @@ const RegistryToolSchema = z.object({
24
24
  id: z.string(),
25
25
  name: z.string(),
26
26
  description: z.string().optional(),
27
- inputSchema: z.record(z.unknown()),
28
- outputSchema: z.record(z.unknown()).optional(),
27
+ inputSchema: z.record(z.string(), z.unknown()),
28
+ outputSchema: z.record(z.string(), z.unknown()).optional(),
29
29
  });
30
30
 
31
31
  /**
@@ -44,7 +44,7 @@ export const MCPRegistryServerSchema = BaseCollectionEntitySchema.extend({
44
44
  scopeName: z.string(),
45
45
  appName: z.string(),
46
46
  friendlyName: z.string().nullable().optional(),
47
- metadata: z.record(z.unknown()).nullable().optional(),
47
+ metadata: z.record(z.string(), z.unknown()).nullable().optional(),
48
48
  publishedAt: z.string().datetime().optional(),
49
49
  updatedAt: z.string().datetime().optional(),
50
50
  tools: z
@@ -58,7 +58,7 @@ export const MCPRegistryServerSchema = BaseCollectionEntitySchema.extend({
58
58
  .optional(),
59
59
  server: z.object({
60
60
  $schema: z.string().optional(),
61
- _meta: z.record(z.unknown()).optional(),
61
+ _meta: z.record(z.string(), z.unknown()).optional(),
62
62
  name: z.string().describe("The server name (scope/app)"),
63
63
  title: z.string().optional().describe("User-friendly title"),
64
64
  description: z.string().optional().describe("Server description"),
@@ -108,7 +108,7 @@ const JsonSchemaSchema: z.ZodType<JsonSchema> = z.lazy(() =>
108
108
  z
109
109
  .object({
110
110
  type: z.string().optional(),
111
- properties: z.record(z.unknown()).optional(),
111
+ properties: z.record(z.string(), z.unknown()).optional(),
112
112
  required: z.array(z.string()).optional(),
113
113
  description: z.string().optional(),
114
114
  additionalProperties: z.boolean().optional(),
@@ -128,7 +128,7 @@ export const StepSchema = z.object({
128
128
  description: z.string().optional().describe("What this step does"),
129
129
  action: StepActionSchema,
130
130
  input: z
131
- .record(z.unknown())
131
+ .record(z.string(), z.unknown())
132
132
  .optional()
133
133
  .describe(
134
134
  "Data passed to the action. Use @ref for dynamic values: @input.field (workflow input), @stepName.field (previous step output), @item/@index (loop context). Example: { 'userId': '@input.user_id', 'data': '@fetch.result' }",
@@ -175,7 +175,7 @@ export const WorkflowExecutionSchema = BaseCollectionEntitySchema.extend({
175
175
  "Current status of the workflow execution",
176
176
  ),
177
177
  input: z
178
- .record(z.unknown())
178
+ .record(z.string(), z.unknown())
179
179
  .optional()
180
180
  .describe("Input data for the workflow execution"),
181
181
  output: z