@respira/wordpress-mcp-server 6.19.0 → 6.19.2

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;YAuNP,kBAAkB;YA6BlB,yBAAyB;IASvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAyBd,QAAQ;IAg/EtB;;;;;;OAMG;IACH,yE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AC,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;YAuNP,kBAAkB;YA6BlB,yBAAyB;IASvC;;;OAGG;IACH,OAAO,CAAC,oBAAoB;YAyBd,QAAQ;IAg/EtB;;;;;;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;IA0sB9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAgSzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA6UxB,GAAG;CAyCV"}
package/dist/server.js CHANGED
@@ -1845,7 +1845,7 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
1845
1845
  },
1846
1846
  {
1847
1847
  name: 'wordpress_inject_builder_content',
1848
- description: 'REPLACE (or append to) the entire page builder layout. WARNING: By default this REPLACES all existing content use mode:"append" to add content without destroying existing elements. For editing a single module, use wordpress_update_module instead. Use exactly: gutenberg, divi, elementor, bricks, beaver, oxygen, breakdance, brizy, thrive, visual-composer, wpbakery. For Divi, divi_version is required ("4" or "5"). Starting in plugin v7.0.16, calling this against a page that already has content with mode="replace" (the default) without also passing confirm_replace=true returns a 409 respira_replace_confirmation_required pass mode="append" to add to existing content, pass mode="replace" AND confirm_replace=true to overwrite, or pass edit_target="live" to overwrite the live page directly (plugin v7.0.22+ accepts an authorized live edit as the confirmation). The gate prevents silent data loss.\n\nNested Divi 5 content shape canonical: `content: [{ type: "section", settings: {...}, children: [{ type: "row", children: [{ type: "column", children: [{ type: "heading", settings: {...} }, ...] }] }] }]`. Plugin v7.0.32 also accepts `rows / cols / columns / modules / elements / innerBlocks` as aliases for `children` on Divi (Divi-vocabulary; soft warning surfaces in response.warnings). Plugin v7.0.32 hard-errors with `respira_children_dropped` (HTTP 500) if any container payload declares children but the emit produced fewer innerBlocks silent data-loss is no longer possible.',
1848
+ description: 'REPLACE (or append to) the entire page builder layout. WARNING: By default this REPLACES all existing content (use mode:"append" to add content without destroying existing elements). For editing a single module, use wordpress_update_module instead. Use exactly: gutenberg, divi, elementor, bricks, beaver, oxygen, breakdance, brizy, thrive, visual-composer, wpbakery. For Divi, divi_version is required ("4" or "5"). Starting in plugin v7.0.16, calling this against a page that already has content with mode="replace" (the default) without also passing confirm_replace=true returns a 409 respira_replace_confirmation_required. Pass mode="append" to add to existing content, pass mode="replace" AND confirm_replace=true to overwrite, or pass edit_target="live" to overwrite the live page directly (plugin v7.0.22+ accepts an authorized live edit as the confirmation). The gate prevents silent data loss.\n\nNested Divi 5 content shape (canonical): `content: [{ type: "section", settings: {...}, children: [{ type: "row", children: [{ type: "column", children: [{ type: "heading", settings: {...} }, ...] }] }] }]`. Plugin v7.0.32 also accepts `rows / cols / columns / modules / elements / innerBlocks` as aliases for `children` on Divi (Divi-vocabulary; soft warning surfaces in response.warnings). Plugin v7.0.32 hard-errors with `respira_children_dropped` (HTTP 500) if any container payload declares children but the emit produced fewer innerBlocks (silent data-loss is no longer possible).\n\nDivi render-critical attrs (the plugin returns `respira_divi_required_attrs_missing` if any are absent, because the module would render empty): `divi/heading` requires `title`; `divi/text` requires `content`; `divi/code` requires `raw_content`; `divi/blurb` requires `title`; `divi/team-member` requires `name`; `divi/testimonial` requires `author`; `divi/cta` requires `title`; `divi/pricing-table` requires `title` and `sum`; `divi/number-counter` requires `number`; `divi/button` requires `button_text`. Set each via the module\'s `settings` object.',
1849
1849
  inputSchema: {
1850
1850
  type: 'object',
1851
1851
  properties: {
@@ -2103,7 +2103,7 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
2103
2103
  },
2104
2104
  {
2105
2105
  name: 'wordpress_read_theme_file',
2106
- description: 'Read the contents of a theme stylesheet on disk (CSS / SCSS / LESS / JSON only). Path is relative to wp-content/themes, e.g. `vds/css/custom.css`. Useful for diffing before a write and for handing the existing stylesheet to an LLM as context. Requires plugin v7.0.42+ and the user behind the API key must have the WP `edit_themes` capability. Returns content, content_md5, byte_size, mtime, theme_role (active_stylesheet | active_template | other), is_writable.',
2106
+ description: 'Read the contents of a theme stylesheet on disk. ONLY these extensions are accepted: `.css`, `.scss`, `.less`, `.json`. Any other extension (`.php`, `.html`, `.twig`, `.js`, `.svg`, `.md`, `.txt`, etc.) returns `respira_theme_file_extension_not_allowed` and the tool does NOT support reading them. PHP/HTML theme files are out of scope on purpose; ask the human to edit those by hand or via a code editor over SFTP. Path is relative to wp-content/themes, e.g. `vds/css/custom.css`. Useful for diffing before a write and for handing the existing stylesheet to an LLM as context. Requires plugin v7.0.42+ and the user behind the API key must have the WP `edit_themes` capability. Returns content, content_md5, byte_size, mtime, theme_role (active_stylesheet | active_template | other), is_writable.',
2107
2107
  inputSchema: {
2108
2108
  type: 'object',
2109
2109
  properties: {
@@ -4218,9 +4218,38 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
4218
4218
  // resolveClient may throw if no site is configured; the dispatch
4219
4219
  // would also have thrown in that case. Telemetry just gets no site.
4220
4220
  }
4221
- const errorCode = dispatchError instanceof Error
4222
- ? dispatchError.name.slice(0, 80)
4223
- : dispatchError != null ? 'unknown_error' : null;
4221
+ // Classify the error for the mcp_tool_events telemetry. Most call
4222
+ // paths go through wordpress-client.handleError which stamps a
4223
+ // specific .name (respira_*, rest_*, http_<status>, network_*).
4224
+ // But several tool wrappers (find_element, inject_builder_content,
4225
+ // upload_media, batch_update, update_custom_post and a handful of
4226
+ // others) wrap and rethrow with plain `new Error(...)`, which
4227
+ // leaves the JS default name of literal 'Error'. The
4228
+ // admin/mcp-quality dashboard then groups all of those under one
4229
+ // opaque 'Error' bucket. That bucket was 37.4% of all failures
4230
+ // during the week of 2026-05-24, surfaced by the v6.19.0 QA pass.
4231
+ //
4232
+ // Two-stage fallback below: if the name is the default 'Error' (or
4233
+ // empty), first scan the message for an inline respira_* / rest_* /
4234
+ // http_<status> code and lift it; otherwise stamp a per-tool
4235
+ // `<tool>_unclassified` so the dashboard groups by tool instead of
4236
+ // collapsing everything into one bucket. Hard cap at 80 chars to
4237
+ // match the existing slice + the consent_log table contract.
4238
+ let errorCode = null;
4239
+ if (dispatchError instanceof Error) {
4240
+ const rawName = (dispatchError.name || '').slice(0, 80);
4241
+ if (rawName && rawName !== 'Error') {
4242
+ errorCode = rawName;
4243
+ }
4244
+ else {
4245
+ const msg = String(dispatchError.message || '');
4246
+ const inline = msg.match(/\b(respira_[a-z0-9_]+|rest_[a-z0-9_]+|http_\d{3}|network_[a-z0-9_]+)\b/i);
4247
+ errorCode = inline ? inline[1].toLowerCase().slice(0, 80) : `${canonical}_unclassified`.slice(0, 80);
4248
+ }
4249
+ }
4250
+ else if (dispatchError != null) {
4251
+ errorCode = 'unknown_error';
4252
+ }
4224
4253
  // v7.1: when an agent calls the universal ability proxy
4225
4254
  // (wordpress_invoke_ability), record the call under the underlying
4226
4255
  // ability name (`inhale_ability:<vendor>/<name>`) so the public