@bettercms-ai/mcp 0.77.0 → 0.78.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/dist/index.js CHANGED
@@ -2697,6 +2697,7 @@ ${JSON.stringify(STRUCTURE_EXAMPLE_PAYLOAD, null, 2)}
2697
2697
  `;
2698
2698
 
2699
2699
  // src/entry-merge.ts
2700
+ var mergesEntry = (args) => args.merge !== false && args.data !== void 0;
2700
2701
  function planEntryMerge(stored, patch, callerIfMatch) {
2701
2702
  const data = { ...stored.data ?? {}, ...patch };
2702
2703
  const ifMatch = callerIfMatch ?? (typeof stored.optimisticVersion === "number" ? stored.optimisticVersion : void 0);
@@ -3537,7 +3538,7 @@ var MODEL_UPDATE_KEYS = [
3537
3538
  "override"
3538
3539
  ];
3539
3540
  var ENTRY_META_NOTE = "SEO is native: set this entry's metaTitle, metaDescription, noindex, canonical, og, twitter, schemaType or schema in `meta` (never as model fields). `meta` MERGES into what is stored: a key you leave out is kept, null or an empty string clears it.";
3540
- var ENTRY_MERGE_NOTE = "true = keep the fields you leave out: the entry is read, `data` is laid over its stored data by top-level key (a group or repeater value replaces that whole key) and written at the version read. Default false: `data` REPLACES the whole object.";
3541
+ var ENTRY_MERGE_NOTE = "Default true: keep the fields you leave out. The entry is read, `data` is laid over its stored data by top-level key (a group or repeater value replaces that whole key) and written at the version read. false = `data` REPLACES the whole object, deleting every field you leave out.";
3541
3542
  var ENTRY_IF_MATCH_NOTE = "optimisticVersion from get_content_entry: the write applies only at that version, and a 409 means it changed since: read it again and re-apply. With merge it defaults to the version merge read.";
3542
3543
  var ENTRY_SCHEDULED_AT_NOTE = "ISO datetime to publish this draft at (needs publish permission); null cancels. An edit that omits scheduledAt CANCELS a pending publish schedule, so send it again with every edit made before it fires.";
3543
3544
  var ENTRY_UNPUBLISH_AT_NOTE = "ISO datetime at which the published entry returns to draft; null cancels. Omitting it never cancels it.";
@@ -5827,12 +5828,12 @@ ${notes.join("\n")}` : summary, created);
5827
5828
  name: "update_content_entry",
5828
5829
  config: {
5829
5830
  title: "Update a content entry's values",
5830
- description: "Update a content entry's `data` (field values) and/or status by id. `data` is keyed by field key; a nested 'array' (zone) value is an object { nonRepeatable: {\u2026}, repeatable: [{\u2026}] }, a primitive 'array' is a plain list; an image value may carry this placement's focal {x,y} and crop {top,right,bottom,left} (0\u20131). Use this to edit an existing entry; for a singleton page prefer set_page_content. \u{1F534} `data` REPLACES the entry's whole value object: an optional field you leave out is DELETED, and a required one you leave out fails the whole write. To change one field, pass merge:true, or read the entry (get_content_entry), change that key and send the whole object back. " + FIELD_LOCKED_NOTE + " " + ENTRY_META_NOTE,
5831
+ description: "Update a content entry's `data` (field values) and/or status by id. `data` is keyed by field key; a nested 'array' (zone) value is an object { nonRepeatable: {\u2026}, repeatable: [{\u2026}] }, a primitive 'array' is a plain list; an image value may carry this placement's focal {x,y} and crop {top,right,bottom,left} (0\u20131). Use this to edit an existing entry; for a singleton page prefer set_page_content. `data` MERGES into the stored values by top-level key: a field you leave out is kept, null clears one, and a group or repeater value replaces that whole key. \u{1F534} merge:false REPLACES the whole value object instead: an optional field you leave out is DELETED, and a required one you leave out fails the whole write. " + FIELD_LOCKED_NOTE + " " + ENTRY_META_NOTE,
5831
5832
  inputSchema: updateEntryInput.shape
5832
5833
  },
5833
5834
  handler: guard(
5834
5835
  async (args) => withClient(async (client) => {
5835
- const write = args.merge === true && args.data !== void 0 ? planEntryMerge(await client.getEntry(args.entryId), args.data, args.ifMatch) : { data: args.data, ifMatch: args.ifMatch };
5836
+ const write = mergesEntry(args) ? planEntryMerge(await client.getEntry(args.entryId), args.data, args.ifMatch) : { data: args.data, ifMatch: args.ifMatch };
5836
5837
  const input = {
5837
5838
  ...write.data !== void 0 ? { data: write.data } : {},
5838
5839
  ...args.status !== void 0 ? { status: args.status } : {},