@respira/wordpress-mcp-server 8.2.10 → 8.3.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/README.md +24 -4
  3. package/TOOL_CATALOG.md +10 -1
  4. package/dist/__tests__/builder-slug-path.test.d.ts +2 -0
  5. package/dist/__tests__/builder-slug-path.test.d.ts.map +1 -0
  6. package/dist/__tests__/builder-slug-path.test.js +70 -0
  7. package/dist/__tests__/builder-slug-path.test.js.map +1 -0
  8. package/dist/__tests__/config-origin-in-errors.test.d.ts +2 -0
  9. package/dist/__tests__/config-origin-in-errors.test.d.ts.map +1 -0
  10. package/dist/__tests__/config-origin-in-errors.test.js +64 -0
  11. package/dist/__tests__/config-origin-in-errors.test.js.map +1 -0
  12. package/dist/agent-signature.d.ts.map +1 -1
  13. package/dist/agent-signature.js +28 -0
  14. package/dist/agent-signature.js.map +1 -1
  15. package/dist/config.d.ts +1 -16
  16. package/dist/config.d.ts.map +1 -1
  17. package/dist/config.js +63 -0
  18. package/dist/config.js.map +1 -1
  19. package/dist/server.d.ts.map +1 -1
  20. package/dist/server.js +175 -4
  21. package/dist/server.js.map +1 -1
  22. package/dist/wordpress-client.d.ts +19 -0
  23. package/dist/wordpress-client.d.ts.map +1 -1
  24. package/dist/wordpress-client.js +44 -6
  25. package/dist/wordpress-client.js.map +1 -1
  26. package/package.json +2 -2
  27. package/skills/build-oxygen6-page/SKILL.md +19 -2
  28. package/skills/design-system-synthesizer/SKILL.md +38 -15
  29. package/skills/design-system-synthesizer/metadata.json +12 -3
  30. package/skills/html-to-bricks/SKILL.md +11 -5
  31. package/skills/html-to-bricks/metadata.json +9 -3
  32. package/skills/page-template-library/SKILL.md +8 -4
  33. package/skills/page-template-library/metadata.json +9 -3
  34. package/tool-capabilities.json +112 -4
package/CHANGELOG.md CHANGED
@@ -5,6 +5,31 @@ All notable changes to Respira WordPress MCP Server will be documented in this f
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [8.3.0] - 2026-08-13
9
+
10
+ ### Added
11
+
12
+ - **A site can now hold one design direction, and every builder obeys it.** Nine new tools. `wordpress_save_design_direction`, `wordpress_get_design_direction`, `wordpress_list_design_directions`, `wordpress_activate_design_direction` and `wordpress_delete_design_direction` manage the direction itself: palette, font pairs, spacing, and plain-language guidance including the don'ts, saved on the site with real revisions. Activation refuses a direction that lacks the minimum to be real (background, ink, accent, a font pair) and names exactly which paths are missing. Values the agent inferred rather than found stay marked as inferred until confirmed.
13
+ - **`wordpress_import_design_tokens`** reads DTCG 2025.10, Tokens Studio exports, Tailwind configs, or a plain `:root` CSS block into the direction. Dry-run by default, so what would change is visible before anything is written.
14
+ - **`wordpress_apply_design_direction`** pushes the direction's tokens into each builder's own stores: Bricks global colors, the Elementor kit, Oxygen variables, nine builders in all. Approval-gated, with a per-builder report of what was written where. **`wordpress_export_design_direction`** returns strict DTCG, so a direction is portable, never captive.
15
+ - **`wordpress_check_design`** reads what a build produced and says whether it is done. Nine deterministic rules: colors and fonts outside the direction, filler copy, placeholder names, the familiar AI tells, and probes generated from the direction's own don'ts, each citing the line it enforces. Waivers set on the direction are honored and stay visible in the result. The response also lists what cannot be judged without seeing the rendered page, rather than pretending a text scan saw it.
16
+
17
+ ### Changed
18
+
19
+ - **Page builds stop treating the direction as advisory.** `build_page` resolves hardcoded values against the active direction and reports anything that fell outside it, and the build skills run `wordpress_check_design` before calling a page finished.
20
+
21
+ ## [8.2.11] - 2026-08-12
22
+
23
+ ### Fixed
24
+
25
+ - **A leftover config file could beat the credentials in your client entry, silently.** `~/.respira/config.json` outranks `WORDPRESS_URL` and `WORDPRESS_API_KEY`, which is deliberate: an explicit file is the more considered of the two. Doing it without saying so was not. A customer followed setup instructions to add those variables to his VS Code entry, still had a config.json from an earlier attempt, and got a connector that started cleanly, listed its tools, and talked to a site he had not chosen. Nothing on screen connected the symptom to the cause, and he spent a week on it. When both are present the server now names the address it is ignoring, the address it is using, and how to change which one wins. A setup with only one source of credentials stays silent.
26
+ - **Six builders made `get_page_outline` unroutable on every site that used them.** Display names with spaces were being sent where route slugs belong.
27
+
28
+ ### Changed
29
+
30
+ - **A site that cannot be found now says which config the server actually read.** `RESPIRA_CONFIG_B64`, `RESPIRA_CONFIG_FILE`, or the default file, named in the error, because "site not found" is unactionable when three sources can supply it.
31
+ - **`claude mcp add` now suggests `-s user`,** so a connection follows the machine rather than the folder it was created in.
32
+
8
33
  ## [8.2.10] - 2026-08-12
9
34
 
10
35
  ### Fixed
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  <h1 align="center">Respira WordPress MCP Server</h1>
8
8
 
9
9
  <p align="center">
10
- <strong>198 MCP tools, 303 with the WooCommerce add-on. 17 page builders and the native Site Editor. MCP 2026-07-28 with legacy-client support.</strong><br>
10
+ <strong>210 MCP tools, 315 with the WooCommerce add-on. 17 page builders and the native Site Editor. MCP 2026-07-28 with legacy-client support.</strong><br>
11
11
  Element-level editing, full page creation, HTML-to-builder conversion with rendering fidelity validation, per-site tool governance, storefront design intelligence, stock images, bulk operations — all through one MCP server.
12
12
  </p>
13
13
 
@@ -132,7 +132,7 @@ Every successful tool response includes `structuredContent`, the raw JSON object
132
132
 
133
133
  ### v6.0 "Storefront" — Context-Aware Tool Filtering
134
134
 
135
- The MCP server exposes 198 core tools and 103 WooCommerce add-on tools. It automatically filters the list based on the site's detected builder and active plugins, so clients receive only the useful subset. Fail-open: if detection fails, the full list is returned.
135
+ The MCP server exposes 210 core tools and 105 WooCommerce add-on tools. It automatically filters the list based on the site's detected builder and active plugins, so clients receive only the useful subset. Fail-open: if detection fails, the full list is returned.
136
136
 
137
137
  | Capability | Respira | Typical WordPress MCP servers |
138
138
  |---|---|---|
@@ -279,7 +279,7 @@ Unknown tool names now return a proper `CallToolResult` with `isError: true` and
279
279
  ## v6.0 "Storefront" — What's New
280
280
 
281
281
  ### Context-Aware Tool Filtering
282
- The MCP server automatically filters its 198 core and 103 WooCommerce tools based on the site's detected builder and active plugins. Less noise, faster AI responses, lower token usage. Fail-open: if detection fails, the full list is returned.
282
+ The MCP server automatically filters its 210 core and 105 WooCommerce tools based on the site's detected builder and active plugins. Less noise, faster AI responses, lower token usage. Fail-open: if detection fails, the full list is returned.
283
283
 
284
284
  ### Flatsome UX Builder (Builder #12)
285
285
  Full round-trip shortcode editing, element-level precision, declarative page creation, and 55-element intelligence. Detected by active theme — mixed-builder sites handled per-page.
@@ -390,6 +390,26 @@ These are Respira-native WordPress operations, not a copied generic tool catalog
390
390
  | `wordpress_update_site_navigation` | Target one link/submenu while preserving unknown extension blocks |
391
391
  | `wordpress_delete_site_navigation` | Delete through approval; referenced navigation is refused by default |
392
392
 
393
+ ### Design Direction (9 tools)
394
+
395
+ One saved design direction per site — identity, DTCG-subset tokens, dials, guidance, waivers — that agents read before building anything. Readiness is computed on every response: `ready` needs the bg + ink + accent color roles plus a heading/body font pair, and activation refuses a direction that is not ready. The direction document is site data, not instructions.
396
+
397
+ The token standard lane: import any token format (DTCG 2025.10 lenient, Tokens Studio, Tailwind, pasted `:root{}` CSS) into a draft, activate once ready, apply into the builder's NATIVE token store, export as strict DTCG 2025.10 with per-builder mapping metadata under `$extensions["press.respira"]`.
398
+
399
+ The design check closes the loop: `wordpress_check_design` runs deterministic slop-and-drift rules (no rendering) against draft content or a saved post, honors the direction's waivers, and lists what only the planned rendered check can verify — run it after building, before treating the work as done.
400
+
401
+ | Tool | Description |
402
+ |---|---|
403
+ | `wordpress_get_design_direction` | Read the active direction (or one by id) with computed readiness |
404
+ | `wordpress_list_design_directions` | List saved directions with readiness and the active flag |
405
+ | `wordpress_save_design_direction` | Save or update a schema-validated DRAFT; response reports readiness |
406
+ | `wordpress_activate_design_direction` | Activate through approval; refuses a not-ready direction |
407
+ | `wordpress_delete_design_direction` | Trash through approval; clears the active pointer if needed |
408
+ | `wordpress_import_design_tokens` | Import DTCG / Tokens Studio / Tailwind / CSS tokens into a draft; dry-run by default, returns the readiness delta, never activates |
409
+ | `wordpress_apply_design_direction` | Push the direction's tokens into the resolved builder's native store through approval; snapshot first, per-builder report persisted |
410
+ | `wordpress_export_design_direction` | Export strict DTCG 2025.10 with roles + per-builder apply reports in `$extensions["press.respira"]` |
411
+ | `wordpress_check_design` | Read-only deterministic design check: off-palette colors/fonts vs the direction, filler copy, placeholder names, AI-default palettes, triggered donts; run after building, before done |
412
+
393
413
  ### Bricks Deep Intelligence (20 tools) — NEW in v5.4
394
414
  | Tool | Description |
395
415
  |---|---|
@@ -824,6 +844,6 @@ MIT © [Respira](https://respira.press)
824
844
  ---
825
845
 
826
846
  <p align="center">
827
- <strong>198 core tools, 303 with WooCommerce. 17 builders. The AI infrastructure layer for WordPress.</strong><br>
847
+ <strong>210 core tools, 315 with WooCommerce. 17 builders. The AI infrastructure layer for WordPress.</strong><br>
828
848
  <a href="https://respira.press">respira.press</a>
829
849
  </p>
package/TOOL_CATALOG.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  <!-- Generated by scripts/check-tool-registry-parity.mjs. Do not edit by hand. -->
4
4
 
5
- Generated catalog: **174 core tools**, **105 WooCommerce tools**, **279 total**.
5
+ Generated catalog: **183 core tools**, **105 WooCommerce tools**, **288 total**.
6
6
 
7
7
  The runtime applies site context and per-site governance, so an individual connection may expose a smaller relevant subset.
8
8
 
@@ -10,6 +10,7 @@ The runtime applies site context and per-site governance, so an individual conne
10
10
 
11
11
  - `respira_duplicate_with_translations` — write; hosted/stdio
12
12
  - `wordpress_abilities_gap_report` — read; hosted/stdio
13
+ - `wordpress_activate_design_direction` — write; native + hosted
13
14
  - `wordpress_activate_plugin` — write; native + hosted
14
15
  - `wordpress_analyze_aeo` — read; native + hosted
15
16
  - `wordpress_analyze_images` — read; native + hosted
@@ -21,12 +22,14 @@ The runtime applies site context and per-site governance, so an individual conne
21
22
  - `wordpress_append_theme_file` — read; hosted/stdio
22
23
  - `wordpress_apply_accessibility_fixes` — write; hosted/stdio
23
24
  - `wordpress_apply_builder_patch` — write; native + hosted
25
+ - `wordpress_apply_design_direction` — write; native + hosted
24
26
  - `wordpress_assign_menu_location` — write; native + hosted
25
27
  - `wordpress_batch_update` — write; native + hosted
26
28
  - `wordpress_begin_session` — read; hosted/stdio
27
29
  - `wordpress_build_mega_menu` — write; native + hosted
28
30
  - `wordpress_build_page` — write; native + hosted
29
31
  - `wordpress_bulk_pages_operation` — write; native + hosted
32
+ - `wordpress_check_design` — read; native + hosted
30
33
  - `wordpress_check_seo_issues` — read; native + hosted
31
34
  - `wordpress_check_structured_data` — read; native + hosted
32
35
  - `wordpress_convert_html_to_builder` — write; native + hosted
@@ -52,6 +55,7 @@ The runtime applies site context and per-site governance, so an individual conne
52
55
  - `wordpress_delete_acf_field_group` — write; hosted/stdio
53
56
  - `wordpress_delete_comment` — write; native + hosted
54
57
  - `wordpress_delete_custom_post` — write; native + hosted
58
+ - `wordpress_delete_design_direction` — write; native + hosted
55
59
  - `wordpress_delete_design_token` — write; native + hosted
56
60
  - `wordpress_delete_media` — write; native + hosted
57
61
  - `wordpress_delete_menu` — write; native + hosted
@@ -71,6 +75,7 @@ The runtime applies site context and per-site governance, so an individual conne
71
75
  - `wordpress_diff_snapshots` — read; native + hosted
72
76
  - `wordpress_duplicate_element` — write; native + hosted
73
77
  - `wordpress_end_session` — read; hosted/stdio
78
+ - `wordpress_export_design_direction` — read; native + hosted
74
79
  - `wordpress_extract_builder_content` — read; native + hosted
75
80
  - `wordpress_find_builder_targets` — read; native + hosted
76
81
  - `wordpress_find_element` — read; native + hosted
@@ -83,6 +88,7 @@ The runtime applies site context and per-site governance, so an individual conne
83
88
  - `wordpress_get_comment` — read; native + hosted
84
89
  - `wordpress_get_core_web_vitals` — read; native + hosted
85
90
  - `wordpress_get_custom_post` — read; native + hosted
91
+ - `wordpress_get_design_direction` — read; native + hosted
86
92
  - `wordpress_get_divi_migration_readiness` — read; hosted/stdio
87
93
  - `wordpress_get_media` — read; native + hosted
88
94
  - `wordpress_get_menu` — read; native + hosted
@@ -102,6 +108,7 @@ The runtime applies site context and per-site governance, so an individual conne
102
108
  - `wordpress_get_theme_docs` — read; native + hosted
103
109
  - `wordpress_get_translations` — read; native + hosted
104
110
  - `wordpress_get_user` — read; native + hosted
111
+ - `wordpress_import_design_tokens` — write; native + hosted
105
112
  - `wordpress_inject_builder_content` — write; native + hosted
106
113
  - `wordpress_install_plugin` — write; native + hosted
107
114
  - `wordpress_invoke_ability` — write; hosted/stdio
@@ -112,6 +119,7 @@ The runtime applies site context and per-site governance, so an individual conne
112
119
  - `wordpress_list_custom_post_types` — read; hosted/stdio
113
120
  - `wordpress_list_custom_posts` — read; native + hosted
114
121
  - `wordpress_list_custom_taxonomies` — read; hosted/stdio
122
+ - `wordpress_list_design_directions` — read; native + hosted
115
123
  - `wordpress_list_design_tokens` — read; native + hosted
116
124
  - `wordpress_list_media` — read; native + hosted
117
125
  - `wordpress_list_memory` — read; native + hosted
@@ -148,6 +156,7 @@ The runtime applies site context and per-site governance, so an individual conne
148
156
  - `wordpress_restore_snapshot` — write; native + hosted
149
157
  - `wordpress_run_pagespeed_audit` — read; hosted/stdio
150
158
  - `wordpress_run_security_audit` — read; native + hosted
159
+ - `wordpress_save_design_direction` — write; native + hosted
151
160
  - `wordpress_scan_page_accessibility` — read; hosted/stdio
152
161
  - `wordpress_search_abilities` — read; native + hosted
153
162
  - `wordpress_search_docs` — read; hosted/stdio
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=builder-slug-path.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-slug-path.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/builder-slug-path.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,70 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import axios from 'axios';
4
+ import { WordPressClient } from '../wordpress-client.js';
5
+ // The REST routes are /builder/(?P<builder>[a-zA-Z0-9_-]+)/..., which cannot
6
+ // express a space, but builder-info reports DISPLAY names and six adapters have
7
+ // one. Auto-detect lowercased the display name straight into the path, so on
8
+ // those sites the URL was unroutable and the agent was told "No route was found
9
+ // matching the URL and request method". Verified live against WordPress before
10
+ // the fix:
11
+ // /builder/beaver/outline/2 -> 401 (route matched, key missing)
12
+ // /builder/beaver%20builder/... -> 404 rest_no_route
13
+ //
14
+ // Asserted on the URL that actually goes on the wire, not on the private
15
+ // helper, so this keeps holding if the normalisation moves.
16
+ async function outlineUrlFor(displayName) {
17
+ const saved = axios.defaults.adapter;
18
+ const seen = [];
19
+ try {
20
+ axios.defaults.adapter = ((config) => {
21
+ const url = config.url || '';
22
+ const full = url.startsWith('http') ? url : `${config.baseURL || ''}${url}`;
23
+ seen.push(full);
24
+ const json = (data) => Promise.resolve({
25
+ status: 200, statusText: 'OK', headers: { 'content-type': 'application/json' },
26
+ config, data, request: {},
27
+ });
28
+ if (/context\/builder-info/.test(full)) {
29
+ return json({ active_builder: { name: displayName, version: '1.0' }, builders: {} });
30
+ }
31
+ if (/\/status/.test(full))
32
+ return json({ ok: true });
33
+ return json({ rows: [] });
34
+ });
35
+ const client = new WordPressClient({ name: 't', url: 'https://example.com', apiKey: 'k' });
36
+ await client.getPageOutline('', 42);
37
+ return seen.find((u) => u.includes('/outline/')) || '';
38
+ }
39
+ finally {
40
+ axios.defaults.adapter = saved;
41
+ }
42
+ }
43
+ test('a display name with a space becomes a routable slug on the wire', async () => {
44
+ const url = await outlineUrlFor('Beaver Builder');
45
+ assert.ok(url.includes('/builder/beaver/outline/42'), `got: ${url}`);
46
+ assert.ok(!/%20|\s/.test(url), `URL must not carry a space: ${url}`);
47
+ });
48
+ test('every spaced display name produces a segment the route can match', async () => {
49
+ const cases = [
50
+ ['Beaver Builder', 'beaver'],
51
+ ['Flatsome UX Builder', 'flatsome'],
52
+ ['Kadence Blocks', 'kadence'],
53
+ ['Oxygen 6', 'oxygen6'],
54
+ ['Thrive Architect', 'thrive'],
55
+ ['Visual Composer', 'visual-composer'],
56
+ ];
57
+ for (const [name, expected] of cases) {
58
+ const url = await outlineUrlFor(name);
59
+ assert.ok(url.includes(`/builder/${expected}/outline/42`), `${name} -> ${url}`);
60
+ const segment = (url.match(/\/builder\/([^/]+)\/outline\//) || [])[1] || '';
61
+ assert.match(segment, /^[a-zA-Z0-9_-]+$/, `${name} produced an unroutable segment: ${segment}`);
62
+ }
63
+ });
64
+ test('single-word names still pass through unchanged', async () => {
65
+ for (const name of ['Divi', 'Elementor', 'Bricks', 'Gutenberg']) {
66
+ const url = await outlineUrlFor(name);
67
+ assert.ok(url.includes(`/builder/${name.toLowerCase()}/outline/42`), `${name} -> ${url}`);
68
+ }
69
+ });
70
+ //# sourceMappingURL=builder-slug-path.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"builder-slug-path.test.js","sourceRoot":"","sources":["../../src/__tests__/builder-slug-path.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAEzD,6EAA6E;AAC7E,gFAAgF;AAChF,6EAA6E;AAC7E,gFAAgF;AAChF,+EAA+E;AAC/E,WAAW;AACX,wEAAwE;AACxE,yDAAyD;AACzD,EAAE;AACF,yEAAyE;AACzE,4DAA4D;AAC5D,KAAK,UAAU,aAAa,CAAC,WAAmB;IAC9C,MAAM,KAAK,GAAG,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC;IACrC,MAAM,IAAI,GAAa,EAAE,CAAC;IAC1B,IAAI,CAAC;QACH,KAAK,CAAC,QAAQ,CAAC,OAAO,GAAG,CAAC,CAAC,MAAW,EAAE,EAAE;YACxC,MAAM,GAAG,GAAW,MAAM,CAAC,GAAG,IAAI,EAAE,CAAC;YACrC,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,CAAC;IAClG,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,gDAAgD,EAAE,KAAK,IAAI,EAAE;IAChE,KAAK,MAAM,IAAI,IAAI,CAAC,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,WAAW,CAAC,EAAE,CAAC;QAChE,MAAM,GAAG,GAAG,MAAM,aAAa,CAAC,IAAI,CAAC,CAAC;QACtC,MAAM,CAAC,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,GAAG,IAAI,OAAO,GAAG,EAAE,CAAC,CAAC;IAC5F,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=config-origin-in-errors.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-origin-in-errors.test.d.ts","sourceRoot":"","sources":["../../src/__tests__/config-origin-in-errors.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,64 @@
1
+ import assert from 'node:assert/strict';
2
+ import test from 'node:test';
3
+ import { describeConfigOrigin } from '../config.js';
4
+ // "Site not found. Available: env-site" is true and useless: the question is
5
+ // which config the process read. A workspace .mcp.json or a RESPIRA_CONFIG_B64
6
+ // in the client entry silently outranks the file someone just edited. 703
7
+ // respira_site_id_not_found events, and an hour lost on this repo.
8
+ const withEnv = (env, fn) => {
9
+ const saved = {};
10
+ for (const k of Object.keys(env)) {
11
+ saved[k] = process.env[k];
12
+ if (env[k] === undefined)
13
+ delete process.env[k];
14
+ else
15
+ process.env[k] = env[k];
16
+ }
17
+ try {
18
+ fn();
19
+ }
20
+ finally {
21
+ for (const k of Object.keys(saved)) {
22
+ if (saved[k] === undefined)
23
+ delete process.env[k];
24
+ else
25
+ process.env[k] = saved[k];
26
+ }
27
+ }
28
+ };
29
+ test('names the env variable when RESPIRA_CONFIG_B64 is what won', () => {
30
+ withEnv({ RESPIRA_CONFIG_B64: 'e30=', RESPIRA_CONFIG_FILE: undefined }, () => {
31
+ const s = describeConfigOrigin();
32
+ assert.match(s, /RESPIRA_CONFIG_B64/);
33
+ assert.match(s, /overrides any config file/i);
34
+ assert.match(s, /restarted/i, 'must say a restart is needed, or the fix looks like it did not work');
35
+ });
36
+ });
37
+ test('names the explicit file path when RESPIRA_CONFIG_FILE is what won', () => {
38
+ withEnv({ RESPIRA_CONFIG_B64: undefined, RESPIRA_CONFIG_FILE: '/tmp/some-config.json' }, () => {
39
+ const s = describeConfigOrigin();
40
+ assert.match(s, /RESPIRA_CONFIG_FILE/);
41
+ assert.ok(s.includes('/tmp/some-config.json'), `must name the path: ${s}`);
42
+ });
43
+ });
44
+ test('names the default path, and warns the env var may be overriding it', () => {
45
+ withEnv({ RESPIRA_CONFIG_B64: undefined, RESPIRA_CONFIG_FILE: undefined }, () => {
46
+ const s = describeConfigOrigin();
47
+ assert.match(s, /config\.json/);
48
+ assert.match(s, /RESPIRA_CONFIG_B64/, 'the default case must point at the thing that outranks it');
49
+ });
50
+ });
51
+ test('always actionable: never an empty or bare sentence', () => {
52
+ for (const env of [
53
+ { RESPIRA_CONFIG_B64: 'e30=', RESPIRA_CONFIG_FILE: undefined },
54
+ { RESPIRA_CONFIG_B64: undefined, RESPIRA_CONFIG_FILE: '/x/y.json' },
55
+ { RESPIRA_CONFIG_B64: undefined, RESPIRA_CONFIG_FILE: undefined },
56
+ ]) {
57
+ withEnv(env, () => {
58
+ const s = describeConfigOrigin();
59
+ assert.ok(s.length > 60, `too terse to help: ${s}`);
60
+ assert.match(s, /read its sites from/);
61
+ });
62
+ }
63
+ });
64
+ //# sourceMappingURL=config-origin-in-errors.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-origin-in-errors.test.js","sourceRoot":"","sources":["../../src/__tests__/config-origin-in-errors.test.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,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AChB,MAAM,CAAC,GAAG,oBAAoB,EAAE,CAAC;YACjC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,EAAE,EAAE,sBAAsB,CAAC,EAAE,CAAC,CAAC;YACpD,MAAM,CAAC,KAAK,CAAC,CAAC,EAAE,qBAAqB,CAAC,CAAC;QACzC,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"agent-signature.d.ts","sourceRoot":"","sources":["../src/agent-signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;CACzD;AAkCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAQvE;AAwGD,wBAAgB,2BAA2B,IAAI,qBAAqB,CA4BnE;AAED,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAa/D"}
1
+ {"version":3,"file":"agent-signature.d.ts","sourceRoot":"","sources":["../src/agent-signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAMH,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,KAAK,GAAG,aAAa,GAAG,WAAW,GAAG,SAAS,CAAC;CACzD;AAkCD,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,OAAO,GAAG,IAAI,CAQvE;AAgHD,wBAAgB,2BAA2B,IAAI,qBAAqB,CA4BnE;AAiBD,wBAAgB,sBAAsB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAkB/D"}
@@ -115,6 +115,14 @@ function detectClientFromHeuristics() {
115
115
  return 'cowork';
116
116
  if (fingerprint.includes('cursor'))
117
117
  return 'cursor';
118
+ // claude-code is a RUNTIME, not a place. The same bucket covers a bare
119
+ // terminal, the IDE extension, and per-workspace tools like Conductor, whose
120
+ // config story is completely different (there, every workspace is its own
121
+ // directory, so a locally-scoped `claude mcp add` connects one and not the
122
+ // next). CLAUDE_CODE_ENTRYPOINT already distinguishes them and we were
123
+ // throwing it away, which is why "558 sites on claude-code" could not answer
124
+ // any question about setup. Keep the bucket stable for continuity and carry
125
+ // the entrypoint alongside it.
118
126
  if (process.env.CLAUDECODE || process.env.CLAUDE_CODE_ENTRYPOINT)
119
127
  return 'claude-code';
120
128
  if (parentCommand.includes('claude.app') || parentCommand.includes('claude.exe') ||
@@ -184,6 +192,22 @@ export function detectRespiraAgentSignature() {
184
192
  source: explicitClient ? 'env' : client === 'unknown' ? 'default' : 'heuristic',
185
193
  };
186
194
  }
195
+ /**
196
+ * Where the Claude Code runtime is running: `cli`, the IDE extension, and so
197
+ * on. Claude Code is a runtime rather than a place, and the setup story differs by
198
+ * host: a per-workspace tool gives every workspace its own directory, so a
199
+ * locally-scoped `claude mcp add` connects one and not the next. Without this,
200
+ * every one of those hosts collapses into a single bucket and no question
201
+ * about setup can be answered from telemetry. Env value only, never a path.
202
+ */
203
+ function detectAgentSurface() {
204
+ const entry = sanitizeHeaderToken(process.env.CLAUDE_CODE_ENTRYPOINT);
205
+ if (entry)
206
+ return entry;
207
+ if (process.env.CLAUDECODE)
208
+ return 'cli';
209
+ return null;
210
+ }
187
211
  export function getRespiraAgentHeaders() {
188
212
  const signature = detectRespiraAgentSignature();
189
213
  const headers = {
@@ -191,6 +215,10 @@ export function getRespiraAgentHeaders() {
191
215
  'X-Respira-Agent-Transport': signature.transport,
192
216
  'X-Respira-Agent-Source': signature.source,
193
217
  };
218
+ const surface = detectAgentSurface();
219
+ if (surface) {
220
+ headers['X-Respira-Agent-Surface'] = surface;
221
+ }
194
222
  if (signature.version) {
195
223
  headers['X-Respira-Agent-Version'] = signature.version;
196
224
  }
@@ -1 +1 @@
1
- {"version":3,"file":"agent-signature.js","sourceRoot":"","sources":["../src/agent-signature.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAE9C,MAAM,gBAAgB,GAAG,EAAE,CAAC;AAS5B;;;;;;;;GAQG;AACH,IAAI,aAAa,GAAsD,IAAI,CAAC;AAE5E,2EAA2E;AAC3E,SAAS,uBAAuB,CAAC,GAAW;IAC1C,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IACnC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1C,IAAI,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,aAAa,CAAC;QAAE,OAAO,aAAa,CAAC;IACjF,yEAAyE;IACzE,uDAAuD;IACvD,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,gBAAgB,CAAC;IAClD,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,QAAQ,CAAC;IAC1C,IAAI,CAAC,CAAC,QAAQ,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC;QAAE,OAAO,UAAU,CAAC;IACvE,IAAI,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC;QAAE,OAAO,OAAO,CAAC;IACxC,IAAI,CAAC,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;QAAE,OAAO,SAAS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,OAAO;QACL,MAAM;QACN,OAAO,EAAE,aAAa,CAAC,MAAM,CAAC;QAC9B,SAAS;QACT,MAAM,EAAE,cAAc,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,WAAW;KAChF,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,kBAAkB;IACzB,MAAM,KAAK,GAAG,mBAAmB,CAAC,OAAO,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAC;IACtE,IAAI,KAAK;QAAE,OAAO,KAAK,CAAC;IACxB,IAAI,OAAO,CAAC,GAAG,CAAC,UAAU;QAAE,OAAO,KAAK,CAAC;IACzC,OAAO,IAAI,CAAC;AACd,CAAC;AAED,MAAM,UAAU,sBAAsB;IACpC,MAAM,SAAS,GAAG,2BAA2B,EAAE,CAAC;IAChD,MAAM,OAAO,GAA2B;QACtC,wBAAwB,EAAE,SAAS,CAAC,MAAM;QAC1C,2BAA2B,EAAE,SAAS,CAAC,SAAS;QAChD,wBAAwB,EAAE,SAAS,CAAC,MAAM;KAC3C,CAAC;IAEF,MAAM,OAAO,GAAG,kBAAkB,EAAE,CAAC;IACrC,IAAI,OAAO,EAAE,CAAC;QACZ,OAAO,CAAC,yBAAyB,CAAC,GAAG,OAAO,CAAC;IAC/C,CAAC;IAED,IAAI,SAAS,CAAC,OAAO,EAAE,CAAC;QACtB,OAAO,CAAC,yBAAyB,CAAC,GAAG,SAAS,CAAC,OAAO,CAAC;IACzD,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
package/dist/config.d.ts CHANGED
@@ -135,22 +135,7 @@ export declare function setDefaultSite(siteId: string): void;
135
135
  * Test connection to a WordPress site
136
136
  */
137
137
  export declare function testConnection(siteId: string): Promise<void>;
138
- /**
139
- * Describe the configuration this process is ACTUALLY running on.
140
- *
141
- * Resolution order is RESPIRA_CONFIG_B64, then RESPIRA_CONFIG_FILE, then
142
- * ~/.respira/config.json. Only the winner matters, and until now nothing
143
- * reported which one won. That gap is the common factor behind three separate
144
- * customer incidents whose mechanisms were all different: a redeem that wrote a
145
- * file an env var was already overriding, a Desktop bundle installed alongside
146
- * an older npx entry that kept winning, and a licence lapse that left the keys
147
- * in the winning config dead.
148
- *
149
- * Deliberately reports the config PATH but never the tokens. A customer pastes
150
- * this output into a support thread.
151
- *
152
- * @param sites Sites the running server actually resolved.
153
- */
138
+ export declare function describeConfigOrigin(): string;
154
139
  export declare function describeEffectiveConfig(sites: Array<{
155
140
  id?: string;
156
141
  url?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAE3E,eAAO,MAAM,UAAU,QAA8B,CAAC;AACtD,eAAO,MAAM,WAAW,QAAkC,CAAC;AAE3D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAmBpD;AAED,+EAA+E;AAC/E,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAErD;AAaD;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,kBAAkB,CAChC,aAAa,EAAE,mBAAmB,EAAE,EACpC,QAAQ,EAAE,mBAAmB,EAAE,GAC9B,mBAAmB,EAAE,CAkBvB;AAED,wBAAgB,gBAAgB,CAAC,GAAG,GAAE,MAAM,CAAC,UAAwB,GAAG,OAAO,CAG9E;AAwED;;;;;;;;;;;;GAYG;AACH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAyCvE;AAgDD,wBAAgB,eAAe,CAAC,MAAM,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,E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,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAC;IACxB,QAAQ,CAAC,EAAE,oBAAoB,EAAE,CAAC;IAClC,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA4C1B"}
package/dist/config.js CHANGED
@@ -580,6 +580,13 @@ export function loadConfig() {
580
580
  // A real config file wins, but the first-run placeholder must not shadow
581
581
  // real WORDPRESS_URL / RESPIRA_* / --wordpress-url credentials set below.
582
582
  if (!isPlaceholderConfig(fileConfig)) {
583
+ // Say so when the file is quietly beating credentials the user set in
584
+ // their client entry. Silence here reads as "the env block is wrong":
585
+ // a customer spent a week on a VS Code connector that started cleanly
586
+ // and talked to nothing, because a config.json left over from an
587
+ // earlier attempt outranked the WORDPRESS_URL he had just been told to
588
+ // add. The precedence is deliberate; hiding it is not.
589
+ warnIfFileShadowsEnvCredentials(CONFIG_FILE, fileConfig);
583
590
  return fileConfig;
584
591
  }
585
592
  }
@@ -703,6 +710,62 @@ export async function testConnection(siteId) {
703
710
  *
704
711
  * @param sites Sites the running server actually resolved.
705
712
  */
713
+ /**
714
+ * One sentence naming the config this process actually read, for errors.
715
+ *
716
+ * describeEffectiveConfig returns the full structured picture, but it only ever
717
+ * surfaced inside diagnose_connection. The moment people are confused is the
718
+ * moment a site id does not resolve, and there the message was "not found.
719
+ * Available: env-site" — true, and useless, because the real question is WHICH
720
+ * config won. A workspace `.mcp.json`, or a RESPIRA_CONFIG_B64 pasted into the
721
+ * client entry, silently outranks the file the operator just edited, and
722
+ * nothing said so.
723
+ *
724
+ * That is 703 respira_site_id_not_found events in telemetry, and it cost this
725
+ * project an hour today when a workspace `.mcp.json` pinned the server to
726
+ * env-mode and hid a multi-site config that was sitting right there.
727
+ */
728
+ /**
729
+ * Warn when ~/.respira/config.json outranks credentials set in the client entry.
730
+ *
731
+ * The precedence is intentional: an explicit file is the more deliberate of the
732
+ * two. What was not intentional is doing it silently. A user who has just been
733
+ * told to add WORDPRESS_URL and WORDPRESS_API_KEY to their MCP client, and who
734
+ * still has a config.json from an earlier attempt, gets a server that starts
735
+ * cleanly, lists its tools, and reaches a site they did not choose. There is
736
+ * nothing on screen connecting the symptom to the cause.
737
+ *
738
+ * Only fires when BOTH are present, so a normal single-source setup stays quiet.
739
+ *
740
+ * @param filePath The config file that won.
741
+ * @param fileConfig What it resolved to, used to name the site actually in use.
742
+ */
743
+ function warnIfFileShadowsEnvCredentials(filePath, fileConfig) {
744
+ const envUrl = (process.env.WORDPRESS_URL || process.env.RESPIRA_URL || '').trim();
745
+ const envKey = (process.env.WORDPRESS_API_KEY || process.env.RESPIRA_API_KEY || '').trim();
746
+ if (!envUrl || !envKey)
747
+ return;
748
+ const inUse = fileConfig.sites?.[0]?.url || 'the site in that file';
749
+ const which = process.env.WORDPRESS_URL ? 'WORDPRESS_URL' : 'RESPIRA_URL';
750
+ console.error(`Warning: ${which} is set to ${envUrl}, but ${filePath} exists and takes precedence, ` +
751
+ `so Respira is using ${inUse} instead. ` +
752
+ `Delete or rename that file to use the address from your client entry, ` +
753
+ `or edit the file to point at the site you want.`);
754
+ }
755
+ export function describeConfigOrigin() {
756
+ const b64 = process.env.RESPIRA_CONFIG_B64?.trim();
757
+ const explicitFile = process.env.RESPIRA_CONFIG_FILE?.trim();
758
+ if (b64) {
759
+ return ('This server read its sites from the RESPIRA_CONFIG_B64 environment variable, ' +
760
+ 'set in your MCP client entry, which overrides any config file on disk. ' +
761
+ 'If you expected a different set of sites, that variable is what to change, ' +
762
+ 'and the client has to be restarted afterwards.');
763
+ }
764
+ if (explicitFile) {
765
+ return `This server read its sites from RESPIRA_CONFIG_FILE (${expandHomePath(explicitFile)}). If you edited a different file, this is the one in effect.`;
766
+ }
767
+ return `This server read its sites from ${expandHomePath('~/.respira/config.json')}. If you edited a different file, or set RESPIRA_CONFIG_B64 in your client entry, this is not the config in effect.`;
768
+ }
706
769
  export function describeEffectiveConfig(sites) {
707
770
  const b64 = process.env.RESPIRA_CONFIG_B64?.trim();
708
771
  const explicitFile = process.env.RESPIRA_CONFIG_FILE?.trim();