@valbuild/mcp 0.143.1 → 0.144.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/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @valbuild/mcp
2
2
 
3
+ ## 0.144.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`a84271c`](https://github.com/valbuild/val/commit/a84271c534822071c1e428cf9990602459682d25), [`860ab2b`](https://github.com/valbuild/val/commit/860ab2b87333daf95a48215b0e4a1b44f441c878)]:
8
+ - @valbuild/core@0.144.0
9
+ - @valbuild/shared@0.144.0
10
+ - @valbuild/server@0.144.0
11
+
3
12
  ## 0.143.1
4
13
 
5
14
  ### Patch Changes
package/README.md CHANGED
@@ -39,7 +39,7 @@ Writing:
39
39
  | `create_patch` | change a value at a path |
40
40
  | `duplicate_source` | copy an array item or record entry |
41
41
  | `empty_at_path` | build an empty value the schema accepts, to fill in |
42
- | `remove_image_gallery_entry` | drop an image from an `s.imageset()` gallery |
42
+ | `remove_image_gallery_entry` | drop an image from an `s.imagedir()` gallery |
43
43
  | `upload_image` | add one — see below |
44
44
 
45
45
  Every write is validated against the schema before it is stored, and refused
@@ -70,7 +70,7 @@ const { valMcpAuthorize, valMcpTools } = initValMcp(valModules, config, {
70
70
  Leave `extraTools` out and everything else still works — an agent can then read,
71
71
  validate and edit content, but not add an image.
72
72
 
73
- Remotely stored images (`s.imageset({...}).remote()`) work through the same tool.
73
+ Remotely stored images (`s.imagedir(dir, {...}).remote()`) work through the same tool.
74
74
  Adding one uploads nothing to Val's content host — the bytes go into the patch
75
75
  store, and the push happens at publish — so the only thing it needs is the
76
76
  project's bucket list, read with your app's own credential (its API key, or the
@@ -1661,7 +1661,7 @@ function writeTools() {
1661
1661
  title: "Remove an image gallery entry",
1662
1662
  description: "Remove one image from an image gallery module by its file path. This deletes the entry and the file it refers to.",
1663
1663
  inputSchema: zod.z.object({
1664
- moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imageset() or s.fileset()."),
1664
+ moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imagedir() or s.filedir()."),
1665
1665
  filePath: zod.z.string().describe('The gallery key to remove, e.g. "/public/val/photo_a1b2c.jpg".')
1666
1666
  }),
1667
1667
  // Destructive: it removes content and the underlying file, so a host
@@ -2494,7 +2494,7 @@ function createValImageTools(processor, options) {
2494
2494
  return [defineTool({
2495
2495
  name: "upload_image",
2496
2496
  title: "Upload an image",
2497
- description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imageset()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2497
+ description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imagedir()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2498
2498
  inputSchema: zod.z.object({
2499
2499
  moduleFilePath: ModuleFilePathSchema,
2500
2500
  path: zod.z.array(zod.z.string())["default"]([]).describe('Path of the image field within the module, e.g. ["hero","image"]. Leave empty when the module itself is an image gallery — the image is then added to it under a generated key.'),
@@ -2745,7 +2745,7 @@ function resolveTarget(deps, moduleSchema, fieldPath) {
2745
2745
  if (moduleSchema.type !== "record" || moduleSchema.mediaType !== "images") {
2746
2746
  // A video set is a record keyed by file paths too; naming it is what
2747
2747
  // stops a caller from retrying with the same module and a field path.
2748
- var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videoset())" : "a ".concat(moduleSchema.type);
2748
+ var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videodir())" : "a ".concat(moduleSchema.type);
2749
2749
  return {
2750
2750
  status: "error",
2751
2751
  result: err("invalid-args", "The module is not an image gallery (it is ".concat(what, "), so an image cannot be added to it directly. Give a path to the image field within it."))
@@ -2844,8 +2844,8 @@ function galleryEntryImageSchema(gallery) {
2844
2844
  /**
2845
2845
  * Does this gallery insist on alt text?
2846
2846
  *
2847
- * `s.imageset()` gives `alt` a nullable string by default, and an entry written
2848
- * without one stores `null`. A gallery that passed its own — `s.imageset({ alt:
2847
+ * `s.imagedir()` gives `alt` a nullable string by default, and an entry written
2848
+ * without one stores `null`. A gallery that passed its own — `s.imagedir(dir, { alt:
2849
2849
  * s.string().minLength(4) })`, which the example app does — has made it
2850
2850
  * required, and an upload with no `alt` cannot satisfy it however it is
2851
2851
  * written. Asked here so the caller is told what to pass, rather than shown a
@@ -3373,7 +3373,7 @@ var packageJson = {
3373
3373
  "./package.json": "./package.json"
3374
3374
  },
3375
3375
  types: "dist/valbuild-mcp.cjs.d.ts",
3376
- version: "0.143.1",
3376
+ version: "0.144.0",
3377
3377
  scripts: {
3378
3378
  typecheck: "tsc --noEmit",
3379
3379
  test: "jest",
@@ -1661,7 +1661,7 @@ function writeTools() {
1661
1661
  title: "Remove an image gallery entry",
1662
1662
  description: "Remove one image from an image gallery module by its file path. This deletes the entry and the file it refers to.",
1663
1663
  inputSchema: zod.z.object({
1664
- moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imageset() or s.fileset()."),
1664
+ moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imagedir() or s.filedir()."),
1665
1665
  filePath: zod.z.string().describe('The gallery key to remove, e.g. "/public/val/photo_a1b2c.jpg".')
1666
1666
  }),
1667
1667
  // Destructive: it removes content and the underlying file, so a host
@@ -2494,7 +2494,7 @@ function createValImageTools(processor, options) {
2494
2494
  return [defineTool({
2495
2495
  name: "upload_image",
2496
2496
  title: "Upload an image",
2497
- description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imageset()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2497
+ description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imagedir()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2498
2498
  inputSchema: zod.z.object({
2499
2499
  moduleFilePath: ModuleFilePathSchema,
2500
2500
  path: zod.z.array(zod.z.string())["default"]([]).describe('Path of the image field within the module, e.g. ["hero","image"]. Leave empty when the module itself is an image gallery — the image is then added to it under a generated key.'),
@@ -2745,7 +2745,7 @@ function resolveTarget(deps, moduleSchema, fieldPath) {
2745
2745
  if (moduleSchema.type !== "record" || moduleSchema.mediaType !== "images") {
2746
2746
  // A video set is a record keyed by file paths too; naming it is what
2747
2747
  // stops a caller from retrying with the same module and a field path.
2748
- var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videoset())" : "a ".concat(moduleSchema.type);
2748
+ var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videodir())" : "a ".concat(moduleSchema.type);
2749
2749
  return {
2750
2750
  status: "error",
2751
2751
  result: err("invalid-args", "The module is not an image gallery (it is ".concat(what, "), so an image cannot be added to it directly. Give a path to the image field within it."))
@@ -2844,8 +2844,8 @@ function galleryEntryImageSchema(gallery) {
2844
2844
  /**
2845
2845
  * Does this gallery insist on alt text?
2846
2846
  *
2847
- * `s.imageset()` gives `alt` a nullable string by default, and an entry written
2848
- * without one stores `null`. A gallery that passed its own — `s.imageset({ alt:
2847
+ * `s.imagedir()` gives `alt` a nullable string by default, and an entry written
2848
+ * without one stores `null`. A gallery that passed its own — `s.imagedir(dir, { alt:
2849
2849
  * s.string().minLength(4) })`, which the example app does — has made it
2850
2850
  * required, and an upload with no `alt` cannot satisfy it however it is
2851
2851
  * written. Asked here so the caller is told what to pass, rather than shown a
@@ -3373,7 +3373,7 @@ var packageJson = {
3373
3373
  "./package.json": "./package.json"
3374
3374
  },
3375
3375
  types: "dist/valbuild-mcp.cjs.d.ts",
3376
- version: "0.143.1",
3376
+ version: "0.144.0",
3377
3377
  scripts: {
3378
3378
  typecheck: "tsc --noEmit",
3379
3379
  test: "jest",
@@ -1652,7 +1652,7 @@ function writeTools() {
1652
1652
  title: "Remove an image gallery entry",
1653
1653
  description: "Remove one image from an image gallery module by its file path. This deletes the entry and the file it refers to.",
1654
1654
  inputSchema: z.object({
1655
- moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imageset() or s.fileset()."),
1655
+ moduleFilePath: ModuleFilePathSchema$1.describe("The gallery module, i.e. one declared with s.imagedir() or s.filedir()."),
1656
1656
  filePath: z.string().describe('The gallery key to remove, e.g. "/public/val/photo_a1b2c.jpg".')
1657
1657
  }),
1658
1658
  // Destructive: it removes content and the underlying file, so a host
@@ -2485,7 +2485,7 @@ function createValImageTools(processor, options) {
2485
2485
  return [defineTool({
2486
2486
  name: "upload_image",
2487
2487
  title: "Upload an image",
2488
- description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imageset()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2488
+ description: "Upload an image file and put it in an image field, or add it to an image gallery module (one declared with s.imagedir()). Give it either imageFilePath — a path to a file on the machine this app runs on — or imageBase64. The image is re-encoded first if the schema asks for that. Works for remotely stored images too (s.image().remote()), which need the project to be connected to Val Build.",
2489
2489
  inputSchema: z.object({
2490
2490
  moduleFilePath: ModuleFilePathSchema,
2491
2491
  path: z.array(z.string())["default"]([]).describe('Path of the image field within the module, e.g. ["hero","image"]. Leave empty when the module itself is an image gallery — the image is then added to it under a generated key.'),
@@ -2736,7 +2736,7 @@ function resolveTarget(deps, moduleSchema, fieldPath) {
2736
2736
  if (moduleSchema.type !== "record" || moduleSchema.mediaType !== "images") {
2737
2737
  // A video set is a record keyed by file paths too; naming it is what
2738
2738
  // stops a caller from retrying with the same module and a field path.
2739
- var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videoset())" : "a ".concat(moduleSchema.type);
2739
+ var what = moduleSchema.type === "record" && moduleSchema.mediaType === "videos" ? "a video set (s.videodir())" : "a ".concat(moduleSchema.type);
2740
2740
  return {
2741
2741
  status: "error",
2742
2742
  result: err("invalid-args", "The module is not an image gallery (it is ".concat(what, "), so an image cannot be added to it directly. Give a path to the image field within it."))
@@ -2835,8 +2835,8 @@ function galleryEntryImageSchema(gallery) {
2835
2835
  /**
2836
2836
  * Does this gallery insist on alt text?
2837
2837
  *
2838
- * `s.imageset()` gives `alt` a nullable string by default, and an entry written
2839
- * without one stores `null`. A gallery that passed its own — `s.imageset({ alt:
2838
+ * `s.imagedir()` gives `alt` a nullable string by default, and an entry written
2839
+ * without one stores `null`. A gallery that passed its own — `s.imagedir(dir, { alt:
2840
2840
  * s.string().minLength(4) })`, which the example app does — has made it
2841
2841
  * required, and an upload with no `alt` cannot satisfy it however it is
2842
2842
  * written. Asked here so the caller is told what to pass, rather than shown a
@@ -3364,7 +3364,7 @@ var packageJson = {
3364
3364
  "./package.json": "./package.json"
3365
3365
  },
3366
3366
  types: "dist/valbuild-mcp.cjs.d.ts",
3367
- version: "0.143.1",
3367
+ version: "0.144.0",
3368
3368
  scripts: {
3369
3369
  typecheck: "tsc --noEmit",
3370
3370
  test: "jest",
package/package.json CHANGED
@@ -20,7 +20,7 @@
20
20
  "./package.json": "./package.json"
21
21
  },
22
22
  "types": "dist/valbuild-mcp.cjs.d.ts",
23
- "version": "0.143.1",
23
+ "version": "0.144.0",
24
24
  "preconstruct": {
25
25
  "entrypoints": [
26
26
  "./index.ts",
@@ -31,9 +31,9 @@
31
31
  "dependencies": {
32
32
  "minimatch": "^10.2.6",
33
33
  "zod": "^4.4.3",
34
- "@valbuild/core": "0.143.0",
35
- "@valbuild/server": "0.143.1",
36
- "@valbuild/shared": "0.143.0"
34
+ "@valbuild/core": "0.144.0",
35
+ "@valbuild/shared": "0.144.0",
36
+ "@valbuild/server": "0.144.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@prettier/sync": "^0.6.1",