@respira/wordpress-mcp-server 7.5.6 → 7.6.1

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;AAqBH,OAAO,KAAK,EAAE,mBAAmB,EAAe,MAAM,kBAAkB,CAAC;AAsQzE,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;IACpC,iFAAiF;IACjF,OAAO,CAAC,iBAAiB,CAAK;IAC9B,iFAAiF;IACjF,OAAO,CAAC,mBAAmB,CAAgC;IAE3D,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;IAmVvE,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;IAiJzB;;;;;;;;;OASG;YACW,kBAAkB;IAiHhC;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;YACW,qBAAqB;YAiBrB,kBAA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AAoB;YAyBd,QAAQ;IAs2FtB;;;;;;OAMG;IACH;;;;;;;;;;;;;oDAagD;IAChD,OAAO,CAAC,mBAAmB,CAAoD;IAC/E,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,gBAAgB,CAAU;IAClD,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,wBAAwB,CAAU;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,yBAAyB,CAAS;IAC1D;;mDAE+C;IAC/C,OAAO,CAAC,0BAA0B,CAAoC;IAEtE;;;;;;;;OAQG;YACW,0BAA0B;YAyC1B,oBAAoB;YA6CpB,2BAA2B;IAQzC;;;;OAIG;YACW,cAAc;IAQ5B,OAAO,CAAC,mBAAmB;IA2uC3B;;;;;;;;;;;;OAYG;IACH,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAe3C;IAEF;;;;OAIG;IACH,OAAO,CAAC,0BAA0B;YAmCpB,cAAc;IA4G5B,oEAAoE;IACpE,OAAO,CAAC,iBAAiB;IAoBzB;;;;;;;;;;;;;;;;;;;OAmBG;IACH,OAAO,CAAC,eAAe;YAuCT,gBAAgB;IA+oC9B;;OAEG;IACH,OAAO,CAAC,iBAAiB;IAwUzB;;OAEG;IACH,OAAO,CAAC,sBAAsB;IA6UxB,GAAG;CAyCV"}
package/dist/server.js CHANGED
@@ -428,8 +428,6 @@ Use respira_get_builder_info first to detect which builder is active. Then use t
428
428
  - Content format: Array of sections containing columns containing widgets
429
429
  - Each widget has a widgetType (e.g. "heading", "text-editor", "image", "button") and settings object
430
430
  - Dynamic schemas: Respira reads Elementor's control registry at runtime, so it knows the exact settings, types, and valid values for every widget
431
- - This includes registered third-party/theme widgets. For an existing custom widget: list_elementor_widgets -> get_elementor_widget_schema -> find_element by content/type -> update_element by the returned stable id with only changed settings -> find_element again to verify
432
- - Never use extract_builder_content + inject_builder_content or rewrite _elementor_data for a single-widget edit. Widget source code is only a fallback when its rendering semantics are not represented in the registered controls
433
431
  - Settings validator catches typos: "Unknown setting 'titel'. Did you mean 'title'?"
434
432
  - Responsive: settings support _mobile and _tablet suffixes (e.g. "align" for desktop, "align_mobile" for mobile)
435
433
  - respira_find_element works with Elementor widget IDs, types, CSS classes, and text content
@@ -1940,6 +1938,102 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
1940
1938
  required: ['post_id'],
1941
1939
  },
1942
1940
  },
1941
+ {
1942
+ name: 'wordpress_get_translations',
1943
+ description: 'List every language copy of a page/post in its WPML translation group. Returns each translation with its id, language code, status, title, and url. Call this before create_translation (to see what already exists) or update_translation (to find the translated post id).',
1944
+ inputSchema: {
1945
+ type: 'object',
1946
+ properties: {
1947
+ id: { type: 'number', description: 'WordPress post/page ID (any language version).' },
1948
+ type: { type: 'string', description: 'Post type slug: "page" (default), "post", or a CPT.' },
1949
+ },
1950
+ required: ['id'],
1951
+ },
1952
+ },
1953
+ {
1954
+ name: 'wordpress_create_translation',
1955
+ description: 'Create a WPML translation of a source page/post in a target language, JOINING the source\'s existing translation group (so WPML treats it as a real translation, not a separate page). Divi and other builder content is carried across into the new copy automatically. Returns 409 if a translation in that language already exists (use update_translation instead). Use respira_get_site_context to confirm WPML is active and see available language codes.',
1956
+ inputSchema: {
1957
+ type: 'object',
1958
+ properties: {
1959
+ source_id: { type: 'number', description: 'ID of the source page/post to translate.' },
1960
+ target_language: { type: 'string', description: 'Target language code, e.g. "de", "nl", "fr".' },
1961
+ title: { type: 'string', description: 'Optional title for the new translation. Defaults to the source title.' },
1962
+ type: { type: 'string', description: 'Post type slug: "page" (default), "post", or a CPT.' },
1963
+ },
1964
+ required: ['source_id', 'target_language'],
1965
+ },
1966
+ },
1967
+ {
1968
+ name: 'wordpress_update_translation',
1969
+ description: 'Update an existing WPML translation of a source post: set its title and/or raw post_content. Resolves the translated post within the source\'s group and snapshots it before writing. For structured Divi/builder edits to the translated copy, use respira_apply_builder_patch on the returned translation_id instead.',
1970
+ inputSchema: {
1971
+ type: 'object',
1972
+ properties: {
1973
+ source_id: { type: 'number', description: 'ID of any page/post in the translation group.' },
1974
+ target_language: { type: 'string', description: 'Language code of the translation to edit, e.g. "de", "nl".' },
1975
+ title: { type: 'string', description: 'Optional new title for the translation.' },
1976
+ content: { type: 'string', description: 'Optional raw post_content for the translation.' },
1977
+ type: { type: 'string', description: 'Post type slug: "page" (default), "post", or a CPT.' },
1978
+ },
1979
+ required: ['source_id', 'target_language'],
1980
+ },
1981
+ },
1982
+ {
1983
+ name: 'wordpress_list_theme_builder_templates',
1984
+ description: 'List the Divi Theme Builder global templates on the site (headers, footers, and body layouts). Each entry carries a layout_id you pass to update_theme_builder_template or apply_builder_patch to edit it, its kind (header/footer/body), name, and where it is assigned. Use this to find a global header before editing it (e.g. to build a mega menu). Works on Divi 4 and Divi 5.',
1985
+ inputSchema: {
1986
+ type: 'object',
1987
+ properties: {},
1988
+ },
1989
+ },
1990
+ {
1991
+ name: 'wordpress_create_theme_builder_template',
1992
+ description: 'Create a Divi global header, footer, or body Theme Builder template, with optional page assignments. Snapshot-protected (reversible within a session). Pass structure as a Divi 4 shortcode string, or a Divi 5 block/node array. Works on Divi 4 and Divi 5.',
1993
+ inputSchema: {
1994
+ type: 'object',
1995
+ properties: {
1996
+ kind: { type: 'string', description: 'header, footer, or body.', enum: ['header', 'footer', 'body'] },
1997
+ name: { type: 'string', description: 'Template name.' },
1998
+ assignments: {
1999
+ type: 'object',
2000
+ description: 'Where it applies. {"all_pages": true} for site-wide, or {"post_types": ["page"], "excluded_ids": [12, 34]}.',
2001
+ },
2002
+ structure: { description: 'Divi 4 shortcode string, or a Divi 5 block/node array.' },
2003
+ },
2004
+ required: ['kind', 'name'],
2005
+ },
2006
+ },
2007
+ {
2008
+ name: 'wordpress_update_theme_builder_template',
2009
+ description: 'Replace the content of an existing Divi Theme Builder layout (a global header, footer, or body) by its layout_id (from list_theme_builder_templates). Snapshot-protected. For a targeted single-module edit, use apply_builder_patch on the same layout_id instead. Works on Divi 4 and Divi 5.',
2010
+ inputSchema: {
2011
+ type: 'object',
2012
+ properties: {
2013
+ layout_id: { type: 'number', description: 'The et_*_layout post id from list_theme_builder_templates.' },
2014
+ structure: { description: 'Divi 4 shortcode string, or a Divi 5 block/node array (the new content).' },
2015
+ },
2016
+ required: ['layout_id', 'structure'],
2017
+ },
2018
+ },
2019
+ {
2020
+ name: 'wordpress_build_mega_menu',
2021
+ description: 'Build a complete Divi mega menu in one call. Creates (or reuses) a nav menu, adds a top-level item carrying Divi\'s "mega-menu" CSS class, turns each column into a child item and each link into a grandchild, and optionally assigns the menu to a theme location. Divi then renders the top item as a full-width mega menu. Works on Divi 4 and Divi 5.',
2022
+ inputSchema: {
2023
+ type: 'object',
2024
+ properties: {
2025
+ menu_name: { type: 'string', description: 'Name of the menu to create or reuse.' },
2026
+ top_label: { type: 'string', description: 'Label of the top-level mega-menu item (e.g. "Products").' },
2027
+ top_url: { type: 'string', description: 'Optional URL for the top item. Defaults to "#".' },
2028
+ columns: {
2029
+ type: 'array',
2030
+ description: 'The mega-menu columns: [ { "label": "Plugins", "url": "#", "links": [ { "label": "Respira", "url": "/respira" } ] } ].',
2031
+ },
2032
+ location: { type: 'string', description: 'Optional theme menu location slug to assign, e.g. "primary-menu".' },
2033
+ },
2034
+ required: ['menu_name', 'top_label', 'columns'],
2035
+ },
2036
+ },
1943
2037
  {
1944
2038
  name: 'wordpress_update_post',
1945
2039
  description: 'Update a post. Supports author reassignment, taxonomy terms (categories/tags/custom), and featured media. When direct editing is enabled and you target an original post, Respira returns a confirmation_required preflight by default so you can choose live/original or duplicate.',
@@ -6103,6 +6197,45 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
6103
6197
  suffix: args.suffix ?? null,
6104
6198
  type: args.type ?? 'page',
6105
6199
  });
6200
+ case 'wordpress_get_translations':
6201
+ return await client.getTranslations(args.id, args.type ?? 'page');
6202
+ case 'wordpress_create_translation':
6203
+ return await client.createTranslation({
6204
+ source_id: args.source_id,
6205
+ target_language: args.target_language,
6206
+ title: args.title ?? null,
6207
+ type: args.type ?? 'page',
6208
+ });
6209
+ case 'wordpress_update_translation':
6210
+ return await client.updateTranslation({
6211
+ source_id: args.source_id,
6212
+ target_language: args.target_language,
6213
+ title: args.title ?? null,
6214
+ content: args.content ?? null,
6215
+ type: args.type ?? 'page',
6216
+ });
6217
+ case 'wordpress_list_theme_builder_templates':
6218
+ return await client.listThemeBuilderTemplates();
6219
+ case 'wordpress_create_theme_builder_template':
6220
+ return await client.createThemeBuilderTemplate({
6221
+ kind: args.kind,
6222
+ name: args.name,
6223
+ assignments: args.assignments ?? null,
6224
+ structure: args.structure ?? null,
6225
+ });
6226
+ case 'wordpress_update_theme_builder_template':
6227
+ return await client.updateThemeBuilderTemplate({
6228
+ layout_id: args.layout_id,
6229
+ structure: args.structure,
6230
+ });
6231
+ case 'wordpress_build_mega_menu':
6232
+ return await client.buildMegaMenu({
6233
+ menu_name: args.menu_name,
6234
+ top_label: args.top_label,
6235
+ top_url: args.top_url ?? undefined,
6236
+ columns: args.columns,
6237
+ location: args.location ?? undefined,
6238
+ });
6106
6239
  case 'wordpress_update_post': {
6107
6240
  const approvalsUrl = client.getApprovalsUrl();
6108
6241
  const post = await client.updatePost(args.id, args);
@@ -6447,7 +6580,7 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
6447
6580
  case 'wordpress_update_media_batch':
6448
6581
  return await client.updateMediaBatch(args.items);
6449
6582
  case 'wordpress_delete_media':
6450
- return await client.deleteMedia(args.id, args.force, args.approval_token);
6583
+ return await client.deleteMedia(args.id);
6451
6584
  // Menu Management
6452
6585
  case 'wordpress_list_menus':
6453
6586
  return await client.listMenus();
@@ -6884,7 +7017,7 @@ Allowlist: css, scss, less, json. PHP / JS theme writes are intentionally out of
6884
7017
  },
6885
7018
  {
6886
7019
  name: 'wordpress_update_element',
6887
- description: 'Update settings or content on one specific element. This is the PRIMARY tool for targeted changes (text, style, image, link, or a custom Elementor widget) and avoids rewriting the full builder document. First use find_element, then target its stable id and send only changed settings. For an Elementor custom/third-party widget, call list_elementor_widgets and get_elementor_widget_schema first; never use extract+inject or rewrite _elementor_data for a one-widget edit. On WPBakery + Uncode, prefer identifier_type "uncode_shortcode_id". Re-read with find_element after writing. Response identifies the resolved live/duplicate target so it cannot be mistaken 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.',
7020
+ 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.',
6888
7021
  inputSchema: {
6889
7022
  type: 'object',
6890
7023
  properties: {