@respira/wordpress-mcp-server 6.19.4 → 6.19.6

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.
@@ -1 +1 @@
1
- {"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAoBH,OAAO,KAAK,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAiLzE,qBAAa,sBAAsB;IACjC,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,WAAW,CAAgC;IACnD,OAAO,CAAC,KAAK,CAA2C;IACxD,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,cAAc,CAAwB;IAC9C,OAAO,CAAC,YAAY,CAA4B;IAChD,8EAA8E;IAC9E,OAAO,CAAC,YAAY,CAA4B;IAChD,8EAA8E;IAC9E,OAAO,CAAC,mBAAmB,CAAS;IAEpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,kBAAkB,CAAsB;IAEhE;;;OAGG;IACH,OAAO,CAAC,iBAAiB;IAWzB;;;OAGG;IACH,OAAO,CAAC,iBAAiB;gBA4Bb,WAAW,EAAE,mBAAmB,EAAE,EAAE,YAAY,CAAC,EAAE,MAAM,EAAE;IAmUvE,OAAO,CAAC,cAAc;IAItB;;;;;;;;;OASG;IACH,OAAO,CAAC,oBAAoB;IAkB5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;IA4BrB,gEAAgE;IAChE,OAAO,CAAC,aAAa;IAUrB;;;;;;OAMG;YACW,UAAU;IA2CxB;;;;;;;;;;;;;;OAcG;YACW,WAAW;IAyIzB;;;;;;;;;OASG;YACW,kBAAkB;IA6FhC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,aAAa;YAuOP,kBAAkB;YA6BlB,yBAAyB;IASvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAyBd,QAAQ;IA28EtB;;;;;;OAMG;IACH,yEA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C,oBAAoB;IAkB5B;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,aAAa;IA4BrB,gEAAgE;IAChE,OAAO,CAAC,aAAa;IAUrB;;;;;;OAMG;YACW,UAAU;IA2CxB;;;;;;;;;;;;;;OAcG;YACW,WAAW;IAyIzB;;;;;;;;;OASG;YACW,kBAAkB;IA6FhC,OAAO,CAAC,eAAe;IAmBvB,OAAO,CAAC,aAAa;YAuOP,kBAAkB;YA6BlB,yBAAyB;IASvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAyBd,QAAQ;IA28EtB;;;;;;OAMG;IACH,yEAAyE;IACzE,OAAO,CAAC,mBAAmB,CAAoD;IAC/E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAU;YAEpC,oBAAoB;YAqDpB,2BAA2B;IAazC;;;;OAIG;YACW,cAAc;IAY5B,OAAO,CAAC,mBAAmB;IAwT3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAe3C;IAEF;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;YAmCpB,cAAc;IAqG5B;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,eAAe;YAuCT,gBAAgB;IAkwB9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAwTzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA6UxB,GAAG;CAyCV"}
package/dist/server.js CHANGED
@@ -4800,10 +4800,22 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
4800
4800
  // top of the response payload (above `changes`) and prepend the
4801
4801
  // warning_hint to the message so the agent sees it before any
4802
4802
  // other content. The dashboard shows 81% in-session retry rate
4803
- // on this tool exactly the silent-fail signature where agents
4804
- // ignore deeply-nested signals and just retry. Front-load.
4805
- const { post_id, ...rest } = args;
4806
- const r = await client.callRestV2('POST', `/builder/elements/update/${post_id}`, rest);
4803
+ // on this tool (exactly the silent-fail signature where agents
4804
+ // ignore deeply-nested signals and just retry). Front-load.
4805
+ //
4806
+ // v6.19.5: the MCP schema exposes both snake_case `edit_target`
4807
+ // and the legacy camelCase `editTarget` (issue
4808
+ // respira-press/respira-wordpress-mcp#3). The plugin's REST args
4809
+ // whitelist still only accepts `editTarget`, so translate before
4810
+ // dispatching. Callers passing both will see edit_target take
4811
+ // precedence. confirm_live_edit is forwarded as-is.
4812
+ const { post_id, edit_target, editTarget, ...rest } = args;
4813
+ const resolvedEditTarget = edit_target ?? editTarget;
4814
+ const payload = { ...rest };
4815
+ if (resolvedEditTarget !== undefined) {
4816
+ payload.editTarget = resolvedEditTarget;
4817
+ }
4818
+ const r = await client.callRestV2('POST', `/builder/elements/update/${post_id}`, payload);
4807
4819
  if (r && typeof r === 'object' && r.warning === 'write_was_noop') {
4808
4820
  const hint = r.warning_hint || 'Write succeeded at the API layer but post_content did not change. Verify with respira_extract_builder_content and escalate to the user instead of retrying.';
4809
4821
  const original = typeof r.message === 'string' ? r.message : '';
@@ -4922,7 +4934,7 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
4922
4934
  },
4923
4935
  {
4924
4936
  name: 'wordpress_update_element',
4925
- description: 'Update settings or content on a specific element in a page. This is the PRIMARY tool for making content changes — use it for text edits, style changes, image swaps, link updates, etc. Works with all 12 page builders. First use find_element to locate the element, then pass the same identifier here with the updates object containing the new values. On WPBakery + Uncode pages, prefer identifier_type "uncode_shortcode_id" for stable round-trip matching. Response includes target_id, original_id, edit_target ("live" or "duplicate"), is_duplicate, duplicate_created and post_status so the caller can never mistake a duplicate-routed write for a live-page change.',
4937
+ description: 'Update settings or content on a specific element in a page. This is the PRIMARY tool for making content changes (text edits, style changes, image swaps, link updates, etc.). Works with all 12 page builders. First use find_element to locate the element, then pass the same identifier here with the updates object containing the new values. On WPBakery + Uncode pages, prefer identifier_type "uncode_shortcode_id" for stable round-trip matching. Response includes target_id, original_id, edit_target ("live" or "duplicate"), is_duplicate, duplicate_created and post_status so the caller can never mistake a duplicate-routed write for a live-page change.\n\nLive-edit confirmation: when respira_allow_direct_edit=1 AND the post is a published original, the first call returns `status: "confirmation_required"` with a `next_call_examples` payload. Re-call with the suggested `edit_target` (and `confirm_live_edit: true` for the live path) to acknowledge. Both params are exposed at the top level here so autonomous flows can complete the handshake through MCP without polluting the `updates` object.',
4926
4938
  inputSchema: {
4927
4939
  type: 'object',
4928
4940
  properties: {
@@ -4934,12 +4946,21 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
4934
4946
  identifier_value: { type: 'string', description: 'Value to match' },
4935
4947
  updates: {
4936
4948
  type: 'object',
4937
- description: 'Key-value pairs of settings to update on the matched element',
4949
+ description: 'Key-value pairs of settings to update on the matched element. Do NOT put `edit_target` or `confirm_live_edit` in this object; pass them as top-level params (otherwise they get persisted as element settings).',
4950
+ },
4951
+ edit_target: {
4952
+ type: 'string',
4953
+ enum: ['live', 'duplicate'],
4954
+ description: 'Where to apply the write. "duplicate" (default) routes the edit to the Respira duplicate of the original (or auto-creates one) so changes go through the Respira → Changes approval flow before they reach the public page. "live" writes straight to the published original (requires Respira → Settings → Allow direct edit, or the original to be a draft / existing Respira duplicate). The response always reports the resolved target so you know exactly which post received the write.',
4938
4955
  },
4939
4956
  editTarget: {
4940
4957
  type: 'string',
4941
4958
  enum: ['live', 'duplicate'],
4942
- description: 'Optional. "duplicate" (default) routes the write to the Respira duplicate of the post (or auto-creates one) so changes go through the Respira → Changes approval flow before they reach the public page. "live" writes straight to the published original — requires Respira → Settings → Allow direct edit, or the post to be a draft / existing Respira duplicate. The response always reports the resolved target so you know exactly which post received the write.',
4959
+ description: 'Deprecated camelCase alias of edit_target. Prefer edit_target. Kept for back-compat with pre-v6.19.5 callers.',
4960
+ },
4961
+ confirm_live_edit: {
4962
+ type: 'boolean',
4963
+ description: 'Required when responding to a `confirmation_required` reply on the live path. Pass `true` alongside `edit_target: "live"` to acknowledge the published-original write. Has no effect when `edit_target` is `duplicate` or omitted.',
4943
4964
  },
4944
4965
  },
4945
4966
  required: ['post_id', 'identifier_type', 'identifier_value', 'updates'],