@wootsup/mcp 0.1.0-rc.9 → 0.1.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 (171) hide show
  1. package/README.md +7 -7
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.js +71 -5
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/apimapper/cache.d.ts +2 -2
  6. package/dist/modules/apimapper/cache.js +107 -25
  7. package/dist/modules/apimapper/cache.js.map +1 -1
  8. package/dist/modules/apimapper/client.d.ts +40 -0
  9. package/dist/modules/apimapper/client.js +82 -12
  10. package/dist/modules/apimapper/client.js.map +1 -1
  11. package/dist/modules/apimapper/connections-format.d.ts +51 -0
  12. package/dist/modules/apimapper/connections-format.js +261 -0
  13. package/dist/modules/apimapper/connections-format.js.map +1 -0
  14. package/dist/modules/apimapper/connections-trim.d.ts +82 -0
  15. package/dist/modules/apimapper/connections-trim.js +224 -0
  16. package/dist/modules/apimapper/connections-trim.js.map +1 -0
  17. package/dist/modules/apimapper/connections.d.ts +14 -2
  18. package/dist/modules/apimapper/connections.js +447 -143
  19. package/dist/modules/apimapper/connections.js.map +1 -1
  20. package/dist/modules/apimapper/credentials-format.d.ts +21 -0
  21. package/dist/modules/apimapper/credentials-format.js +145 -0
  22. package/dist/modules/apimapper/credentials-format.js.map +1 -0
  23. package/dist/modules/apimapper/credentials.d.ts +12 -2
  24. package/dist/modules/apimapper/credentials.js +253 -72
  25. package/dist/modules/apimapper/credentials.js.map +1 -1
  26. package/dist/modules/apimapper/diagnose.d.ts +54 -2
  27. package/dist/modules/apimapper/diagnose.js +193 -11
  28. package/dist/modules/apimapper/diagnose.js.map +1 -1
  29. package/dist/modules/apimapper/elicitation.d.ts +54 -0
  30. package/dist/modules/apimapper/elicitation.js +90 -0
  31. package/dist/modules/apimapper/elicitation.js.map +1 -0
  32. package/dist/modules/apimapper/flows-format.d.ts +50 -0
  33. package/dist/modules/apimapper/flows-format.js +318 -0
  34. package/dist/modules/apimapper/flows-format.js.map +1 -0
  35. package/dist/modules/apimapper/flows.d.ts +13 -2
  36. package/dist/modules/apimapper/flows.js +325 -118
  37. package/dist/modules/apimapper/flows.js.map +1 -1
  38. package/dist/modules/apimapper/gateway/advanced-tool.d.ts +9 -0
  39. package/dist/modules/apimapper/gateway/advanced-tool.js +214 -0
  40. package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -0
  41. package/dist/modules/apimapper/gateway/capturing-server.d.ts +81 -0
  42. package/dist/modules/apimapper/gateway/capturing-server.js +87 -0
  43. package/dist/modules/apimapper/gateway/capturing-server.js.map +1 -0
  44. package/dist/modules/apimapper/gateway/essentials.d.ts +4 -0
  45. package/dist/modules/apimapper/gateway/essentials.js +28 -0
  46. package/dist/modules/apimapper/gateway/essentials.js.map +1 -0
  47. package/dist/modules/apimapper/gateway/test-support.d.ts +17 -0
  48. package/dist/modules/apimapper/gateway/test-support.js +43 -0
  49. package/dist/modules/apimapper/gateway/test-support.js.map +1 -0
  50. package/dist/modules/apimapper/get-skill.d.ts +3 -3
  51. package/dist/modules/apimapper/get-skill.js +4 -2
  52. package/dist/modules/apimapper/get-skill.js.map +1 -1
  53. package/dist/modules/apimapper/graph-builder.js +1 -1
  54. package/dist/modules/apimapper/graph-builder.js.map +1 -1
  55. package/dist/modules/apimapper/graph.d.ts +2 -2
  56. package/dist/modules/apimapper/graph.js +165 -34
  57. package/dist/modules/apimapper/graph.js.map +1 -1
  58. package/dist/modules/apimapper/index.d.ts +17 -1
  59. package/dist/modules/apimapper/index.js +66 -17
  60. package/dist/modules/apimapper/index.js.map +1 -1
  61. package/dist/modules/apimapper/inspect.d.ts +3 -2
  62. package/dist/modules/apimapper/inspect.js +97 -13
  63. package/dist/modules/apimapper/inspect.js.map +1 -1
  64. package/dist/modules/apimapper/library.d.ts +2 -2
  65. package/dist/modules/apimapper/library.js +303 -60
  66. package/dist/modules/apimapper/library.js.map +1 -1
  67. package/dist/modules/apimapper/license-format.d.ts +22 -0
  68. package/dist/modules/apimapper/license-format.js +149 -0
  69. package/dist/modules/apimapper/license-format.js.map +1 -0
  70. package/dist/modules/apimapper/license.d.ts +16 -2
  71. package/dist/modules/apimapper/license.js +85 -37
  72. package/dist/modules/apimapper/license.js.map +1 -1
  73. package/dist/modules/apimapper/local-sources.d.ts +2 -2
  74. package/dist/modules/apimapper/local-sources.js +58 -30
  75. package/dist/modules/apimapper/local-sources.js.map +1 -1
  76. package/dist/modules/apimapper/misc.d.ts +30 -2
  77. package/dist/modules/apimapper/misc.js +129 -50
  78. package/dist/modules/apimapper/misc.js.map +1 -1
  79. package/dist/modules/apimapper/node-schema.d.ts +52 -0
  80. package/dist/modules/apimapper/node-schema.js +70 -2
  81. package/dist/modules/apimapper/node-schema.js.map +1 -1
  82. package/dist/modules/apimapper/normalizers.d.ts +1 -0
  83. package/dist/modules/apimapper/normalizers.js +51 -0
  84. package/dist/modules/apimapper/normalizers.js.map +1 -1
  85. package/dist/modules/apimapper/onboarding.d.ts +48 -2
  86. package/dist/modules/apimapper/onboarding.js +324 -17
  87. package/dist/modules/apimapper/onboarding.js.map +1 -1
  88. package/dist/modules/apimapper/read-cache.d.ts +31 -2
  89. package/dist/modules/apimapper/read-cache.js +20 -6
  90. package/dist/modules/apimapper/read-cache.js.map +1 -1
  91. package/dist/modules/apimapper/render/_shared.d.ts +24 -0
  92. package/dist/modules/apimapper/render/_shared.js +84 -0
  93. package/dist/modules/apimapper/render/_shared.js.map +1 -0
  94. package/dist/modules/apimapper/render/dag.d.ts +18 -0
  95. package/dist/modules/apimapper/render/dag.js +70 -0
  96. package/dist/modules/apimapper/render/dag.js.map +1 -0
  97. package/dist/modules/apimapper/render/index.d.ts +2 -0
  98. package/dist/modules/apimapper/render/index.js +112 -0
  99. package/dist/modules/apimapper/render/index.js.map +1 -0
  100. package/dist/modules/apimapper/render/renderers/chart-bar.d.ts +2 -0
  101. package/dist/modules/apimapper/render/renderers/chart-bar.js +70 -0
  102. package/dist/modules/apimapper/render/renderers/chart-bar.js.map +1 -0
  103. package/dist/modules/apimapper/render/renderers/chart-line.d.ts +2 -0
  104. package/dist/modules/apimapper/render/renderers/chart-line.js +71 -0
  105. package/dist/modules/apimapper/render/renderers/chart-line.js.map +1 -0
  106. package/dist/modules/apimapper/render/renderers/diff.d.ts +2 -0
  107. package/dist/modules/apimapper/render/renderers/diff.js +154 -0
  108. package/dist/modules/apimapper/render/renderers/diff.js.map +1 -0
  109. package/dist/modules/apimapper/render/renderers/flow-diagram.d.ts +1 -0
  110. package/dist/modules/apimapper/render/renderers/flow-diagram.js +180 -0
  111. package/dist/modules/apimapper/render/renderers/flow-diagram.js.map +1 -0
  112. package/dist/modules/apimapper/render/renderers/json-tree.d.ts +2 -0
  113. package/dist/modules/apimapper/render/renderers/json-tree.js +87 -0
  114. package/dist/modules/apimapper/render/renderers/json-tree.js.map +1 -0
  115. package/dist/modules/apimapper/render/renderers/schema-diagram.d.ts +2 -0
  116. package/dist/modules/apimapper/render/renderers/schema-diagram.js +83 -0
  117. package/dist/modules/apimapper/render/renderers/schema-diagram.js.map +1 -0
  118. package/dist/modules/apimapper/render/renderers/table.d.ts +2 -0
  119. package/dist/modules/apimapper/render/renderers/table.js +75 -0
  120. package/dist/modules/apimapper/render/renderers/table.js.map +1 -0
  121. package/dist/modules/apimapper/render/schemas.d.ts +23 -0
  122. package/dist/modules/apimapper/render/schemas.js +56 -0
  123. package/dist/modules/apimapper/render/schemas.js.map +1 -0
  124. package/dist/modules/apimapper/render/secret-masking.d.ts +5 -0
  125. package/dist/modules/apimapper/render/secret-masking.js +51 -0
  126. package/dist/modules/apimapper/render/secret-masking.js.map +1 -0
  127. package/dist/modules/apimapper/render/sidecar.d.ts +21 -0
  128. package/dist/modules/apimapper/render/sidecar.js +66 -0
  129. package/dist/modules/apimapper/render/sidecar.js.map +1 -0
  130. package/dist/modules/apimapper/render/token-cap.d.ts +21 -0
  131. package/dist/modules/apimapper/render/token-cap.js +57 -0
  132. package/dist/modules/apimapper/render/token-cap.js.map +1 -0
  133. package/dist/modules/apimapper/schema.d.ts +2 -2
  134. package/dist/modules/apimapper/schema.js +100 -32
  135. package/dist/modules/apimapper/schema.js.map +1 -1
  136. package/dist/modules/apimapper/settings-format.d.ts +23 -0
  137. package/dist/modules/apimapper/settings-format.js +135 -0
  138. package/dist/modules/apimapper/settings-format.js.map +1 -0
  139. package/dist/modules/apimapper/settings.d.ts +2 -2
  140. package/dist/modules/apimapper/settings.js +101 -40
  141. package/dist/modules/apimapper/settings.js.map +1 -1
  142. package/dist/modules/apimapper/skill-resources.d.ts +2 -2
  143. package/dist/modules/apimapper/skill-resources.js.map +1 -1
  144. package/dist/modules/apimapper/token-baseline.harness.d.ts +91 -0
  145. package/dist/modules/apimapper/token-baseline.harness.js +291 -0
  146. package/dist/modules/apimapper/token-baseline.harness.js.map +1 -0
  147. package/dist/modules/apimapper/toolslist-size.d.ts +55 -0
  148. package/dist/modules/apimapper/toolslist-size.js +190 -0
  149. package/dist/modules/apimapper/toolslist-size.js.map +1 -0
  150. package/dist/modules/apimapper/types.d.ts +23 -8
  151. package/dist/modules/apimapper/types.js +26 -1
  152. package/dist/modules/apimapper/types.js.map +1 -1
  153. package/dist/modules/apimapper/use-profile.d.ts +21 -0
  154. package/dist/modules/apimapper/use-profile.js +56 -2
  155. package/dist/modules/apimapper/use-profile.js.map +1 -1
  156. package/dist/modules/apimapper/workflows.d.ts +2 -2
  157. package/dist/modules/apimapper/workflows.js +143 -16
  158. package/dist/modules/apimapper/workflows.js.map +1 -1
  159. package/dist/platform/index.js +44 -5
  160. package/dist/platform/index.js.map +1 -1
  161. package/dist/setup-cli.d.ts +53 -0
  162. package/dist/setup-cli.js +126 -4
  163. package/dist/setup-cli.js.map +1 -1
  164. package/docs/architecture.md +1 -1
  165. package/docs/tools.md +1 -1
  166. package/manifest.json +12 -3
  167. package/package.json +9 -4
  168. package/skills/apimapper/SKILL.md +1 -1
  169. package/skills/apimapper/reference/render.md +132 -0
  170. package/skills/apimapper/reference/troubleshooting.md +1 -1
  171. package/skills/apimapper/reference/yootheme.md +1 -1
@@ -9,7 +9,10 @@
9
9
  // Step 3 — verify token.iss matches the probed site_url (anti-phishing).
10
10
  // Step 4 — verify identity.capabilities includes the minimum we need
11
11
  // (currently: 'flows' + 'library').
12
- // Step 5 — verify token.scope includes at least 'read'.
12
+ // Step 5 — verify token.scope COVERS at least 'read'. The check uses
13
+ // the read ⊂ write ⊂ admin hierarchy: an admin-only token
14
+ // (or a write-only token) passes because both subsume read.
15
+ // See `hasScope()` for the canonical hierarchy mirror.
13
16
  //
14
17
  // Output structure: { ready, checks[], recommendation, blockers[] }.
15
18
  //
@@ -20,10 +23,128 @@
20
23
  // Network-tolerant: any unexpected fetch error is captured into a check
21
24
  // but the function never throws.
22
25
  import { z } from "zod";
23
- import { formatResult, readOnly } from "@getimo/mcp-toolkit";
26
+ import { detailResult, readOnly } from "@getimo/mcp-toolkit";
24
27
  import { inspectToken } from "./inspect.js";
25
28
  const REQUIRED_CAPABILITIES = ["flows", "library"];
26
29
  const MIN_SCOPE = "read";
30
+ /**
31
+ * Scope hierarchy enforced by the PHP MCP authentication layer.
32
+ *
33
+ * Mirrors {@see \ApiMapper\WordPress\Admin\Controller\RestControllerTrait::checkBearerOrPermissions}
34
+ * (src/modules/admin-wordpress/src/Admin/Controller/RestControllerTrait.php
35
+ * lines 133-134 and 248-249), which grants access if the token carries
36
+ * either the explicitly requested scope OR the all-covering `admin`
37
+ * scope.
38
+ *
39
+ * The scope strings the server emits today are exactly three:
40
+ * - "read" : GET / HEAD / OPTIONS
41
+ * - "write" : POST / PUT / PATCH (implies read for diagnosis purposes;
42
+ * a writer can also read)
43
+ * - "admin" : DELETE (implies write + read; admin can do anything)
44
+ *
45
+ * `hasScope()` is the authoritative scope-check helper used by the
46
+ * pre-flight diagnose tool. Plain `scopes.includes(required)` (the
47
+ * pre-W2-4 implementation) is INCORRECT because an admin-only token
48
+ * would fail the `read` check even though admin strictly subsumes read
49
+ * at the server. That false-positive flagged production admin-scope
50
+ * tokens with `scope-too-narrow` (audit finding H-4, 2026-05-27).
51
+ *
52
+ * The set of recognised scopes is closed: any string not in
53
+ * {read, write, admin} is treated literally (no implication), so a
54
+ * future custom scope cannot accidentally inherit privileges it was not
55
+ * granted. If a fourth scope is ever introduced, extend `SCOPE_IMPLIES`
56
+ * below; do NOT loosen the literal-match fallback.
57
+ */
58
+ const SCOPE_IMPLIES = {
59
+ read: new Set(["read"]),
60
+ write: new Set(["read", "write"]),
61
+ admin: new Set(["read", "write", "admin"]),
62
+ };
63
+ /**
64
+ * Check whether a token's scope set covers a required scope, respecting
65
+ * the read ⊂ write ⊂ admin hierarchy. Returns true iff the token holds
66
+ * a scope that implies (or equals) the required one.
67
+ *
68
+ * @param tokenScopes - The `scope` array decoded from the token payload.
69
+ * @param required - The scope this caller needs (e.g. "read").
70
+ */
71
+ export function hasScope(tokenScopes, required) {
72
+ for (const held of tokenScopes) {
73
+ const implications = SCOPE_IMPLIES[held];
74
+ if (implications !== undefined && implications.has(required)) {
75
+ return true;
76
+ }
77
+ // Literal-match fallback for scopes outside the known hierarchy.
78
+ if (held === required) {
79
+ return true;
80
+ }
81
+ }
82
+ return false;
83
+ }
84
+ /**
85
+ * F-05: Hard wall-clock cap on every identity probe.
86
+ *
87
+ * Without this, a non-responsive target server can stall the diagnosis
88
+ * indefinitely — the setup wizard appears to hang and the user has no
89
+ * cancel affordance. 5 seconds is a generous-but-bounded budget: real
90
+ * WP/Joomla identity endpoints respond in <500ms typically; a 5s ceiling
91
+ * surfaces "this server isn't responding" within a UX-acceptable window.
92
+ *
93
+ * Exported for tests that may want to override or assert on the value.
94
+ */
95
+ export const PROBE_TIMEOUT_MS = 5_000;
96
+ /**
97
+ * Wrapper around `fetch()` that hard-binds an `AbortSignal.timeout()` to
98
+ * each request. Used by both WordPress and Joomla identity probes so the
99
+ * timeout policy is enforced in exactly one place (no DRY drift).
100
+ *
101
+ * Exported (W1.9 / F-15) so the `apimapper_health` downstream probe of
102
+ * api.wootsup.com can reuse the same primitive — the timeout contract is
103
+ * generic (URL/init/timeoutMs), not diagnose-specific, so a re-export
104
+ * avoids duplicating the AbortSignal.timeout wiring across files. If a
105
+ * future third consumer materialises, the function moves to a shared
106
+ * `http-utils.ts` module; today, two callers in the same module folder
107
+ * does not warrant a new file.
108
+ *
109
+ * If the caller passes a `signal` in `init`, it is silently overridden —
110
+ * the probe contract is "you get a timeout, full stop". A future caller
111
+ * that wants both timeout AND user-cancellation should compose signals
112
+ * via `AbortSignal.any([userSignal, AbortSignal.timeout(ms)])`, but that
113
+ * is intentionally out of scope here.
114
+ *
115
+ * On timeout the underlying fetch rejects with `DOMException("...",
116
+ * "TimeoutError")` (or `"AbortError"` on older runtimes). The caller is
117
+ * expected to narrow on `error.name` to surface a "timeout after Nms"
118
+ * message rather than a generic transport failure.
119
+ *
120
+ * @param url - URL to fetch.
121
+ * @param init - Optional RequestInit. Any `signal` field is overridden.
122
+ * @param timeoutMs - Timeout in milliseconds. Must be a finite, positive
123
+ * integer; falls back to {@link PROBE_TIMEOUT_MS} otherwise.
124
+ * @returns The Response on success.
125
+ */
126
+ export async function fetchWithTimeout(url, init = {}, timeoutMs = PROBE_TIMEOUT_MS) {
127
+ const effectiveMs = Number.isFinite(timeoutMs) && timeoutMs > 0 ? timeoutMs : PROBE_TIMEOUT_MS;
128
+ return fetch(url, { ...init, signal: AbortSignal.timeout(effectiveMs) });
129
+ }
130
+ /**
131
+ * Map an unknown thrown value from a probe `fetch()` call to a
132
+ * user-facing error string. Distinguishes `AbortError` / `TimeoutError`
133
+ * (from `AbortSignal.timeout`) from generic transport failures so the
134
+ * surfaced message answers "did we time out or did the network refuse?".
135
+ *
136
+ * @param e - Unknown error caught from a fetch invocation.
137
+ * @returns Stable error string suitable for `ProbeResult.error`.
138
+ */
139
+ function describeProbeError(e) {
140
+ if (e instanceof Error) {
141
+ if (e.name === "AbortError" || e.name === "TimeoutError") {
142
+ return `timeout after ${PROBE_TIMEOUT_MS}ms`;
143
+ }
144
+ return e.message;
145
+ }
146
+ return String(e);
147
+ }
27
148
  /** Read site URL from an identity payload, tolerating both `site_url` and `siteurl`. */
28
149
  function readSiteUrl(data) {
29
150
  return data?.site_url ?? data?.siteurl ?? "";
@@ -36,7 +157,7 @@ function stripSlash(s) {
36
157
  async function probeWordPress(siteUrl) {
37
158
  const url = `${stripSlash(siteUrl)}/wp-json/api-mapper/v1/identity`;
38
159
  try {
39
- const res = await fetch(url, {
160
+ const res = await fetchWithTimeout(url, {
40
161
  method: "GET",
41
162
  headers: { Accept: "application/json" },
42
163
  });
@@ -58,7 +179,7 @@ async function probeWordPress(siteUrl) {
58
179
  return {
59
180
  ok: false,
60
181
  probedUrl: url,
61
- error: e instanceof Error ? e.message : String(e),
182
+ error: describeProbeError(e),
62
183
  };
63
184
  }
64
185
  }
@@ -66,7 +187,7 @@ async function probeWordPress(siteUrl) {
66
187
  async function probeJoomla(siteUrl) {
67
188
  const url = `${stripSlash(siteUrl)}/index.php?option=com_ajax&plugin=apimapper&task=getIdentity&format=json`;
68
189
  try {
69
- const res = await fetch(url, {
190
+ const res = await fetchWithTimeout(url, {
70
191
  method: "GET",
71
192
  headers: { Accept: "application/json" },
72
193
  });
@@ -93,7 +214,7 @@ async function probeJoomla(siteUrl) {
93
214
  return {
94
215
  ok: false,
95
216
  probedUrl: url,
96
- error: e instanceof Error ? e.message : String(e),
217
+ error: describeProbeError(e),
97
218
  };
98
219
  }
99
220
  }
@@ -242,12 +363,20 @@ export async function diagnoseSite(token, siteUrl) {
242
363
  });
243
364
  }
244
365
  // ── Step 5: scope check ─────────────────────────────────────────────
366
+ //
367
+ // W2-4 (H-4, 2026-05-27): use the hierarchy-aware `hasScope` helper
368
+ // instead of plain `scopes.includes('read')`. The previous narrow
369
+ // check produced a false-positive `scope-too-narrow` blocker for
370
+ // admin-only tokens. Admin strictly subsumes write+read at the server,
371
+ // so an admin token is more than sufficient for any read operation.
372
+ // See `hasScope()` and `SCOPE_IMPLIES` above for the canonical
373
+ // hierarchy mirror.
245
374
  const scopes = tokenInfo.payload.scope ?? [];
246
- if (!scopes.includes(MIN_SCOPE)) {
375
+ if (!hasScope(scopes, MIN_SCOPE)) {
247
376
  checks.push({
248
377
  name: "scope-sufficient",
249
378
  passed: false,
250
- detail: `token.scope=[${scopes.join(",")}] missing '${MIN_SCOPE}'`,
379
+ detail: `token.scope=[${scopes.join(",")}] does not cover '${MIN_SCOPE}'`,
251
380
  });
252
381
  blockers.push("scope-too-narrow");
253
382
  }
@@ -255,7 +384,7 @@ export async function diagnoseSite(token, siteUrl) {
255
384
  checks.push({
256
385
  name: "scope-sufficient",
257
386
  passed: true,
258
- detail: `has '${MIN_SCOPE}' (full scope: ${scopes.join(",")})`,
387
+ detail: `covers '${MIN_SCOPE}' (full scope: ${scopes.join(",")})`,
259
388
  });
260
389
  }
261
390
  // ── Aggregate ───────────────────────────────────────────────────────
@@ -301,10 +430,63 @@ export function registerDiagnoseTool(server) {
301
430
  .url()
302
431
  .describe('Site URL the token is meant for (e.g., "https://example.com/wp")'),
303
432
  },
304
- annotations: readOnly(),
433
+ annotations: readOnly({ title: "Diagnose Site", openWorld: true }),
305
434
  }, async ({ token, siteUrl }) => {
306
435
  const result = await diagnoseSite(token, siteUrl);
307
- return formatResult(result, false, { maxChars: 4000 });
436
+ // W3.1 (rc.13 Welle 3) — detailResult: the {ready, checks[],
437
+ // recommendation, blockers[]} composite renders as a grouped detail.
438
+ // diagnose NEVER throws and NEVER routes to errorResult — a "not ready"
439
+ // outcome is a valid diagnosis, surfaced inside the detail card via the
440
+ // badge + a blockers group. detailResult groups are scalar-only, so the
441
+ // checks[] array is flattened to one entry per check and blockers[] to a
442
+ // count + a joined list.
443
+ const checkEntries = result.checks.map((c) => ({
444
+ key: c.name,
445
+ label: c.name,
446
+ value: `${c.passed ? "✓" : "✗"} ${c.detail}`,
447
+ format: "status",
448
+ }));
449
+ const blockerEntries = result.blockers.length > 0
450
+ ? [
451
+ {
452
+ key: "blocker_count",
453
+ label: "Blocker count",
454
+ value: result.blockers.length,
455
+ },
456
+ {
457
+ key: "blockers",
458
+ label: "Blockers",
459
+ value: result.blockers.join(", "),
460
+ },
461
+ ]
462
+ : [
463
+ {
464
+ key: "blockers",
465
+ label: "Blockers",
466
+ value: "none",
467
+ },
468
+ ];
469
+ return detailResult({
470
+ title: result.ready ? "Pre-flight: ready" : "Pre-flight: not ready",
471
+ subtitle: result.recommendation,
472
+ badge: result.ready
473
+ ? { text: "ready", variant: "success" }
474
+ : { text: "not ready", variant: "destructive" },
475
+ groups: [
476
+ { label: "Checks", entries: checkEntries },
477
+ { label: "Blockers", entries: blockerEntries },
478
+ {
479
+ label: "Recommendation",
480
+ entries: [
481
+ {
482
+ key: "recommendation",
483
+ label: "Recommendation",
484
+ value: result.recommendation,
485
+ },
486
+ ],
487
+ },
488
+ ],
489
+ });
308
490
  });
309
491
  }
310
492
  //# sourceMappingURL=diagnose.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../../src/modules/apimapper/diagnose.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,gEAAgE;AAChE,uEAAuE;AACvE,qEAAqE;AACrE,oFAAoF;AACpF,2EAA2E;AAC3E,uEAAuE;AACvE,+CAA+C;AAC/C,0DAA0D;AAC1D,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAC1D,yEAAyE;AACzE,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,iCAAiC;AAGjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAwB5C,MAAM,qBAAqB,GAAG,CAAC,OAAO,EAAE,SAAS,CAAU,CAAC;AAC5D,MAAM,SAAS,GAAG,MAAM,CAAC;AAWz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,YAAY,CACjB,oBAAoB,EACpB;QACE,KAAK,EAAE,kCAAkC;QACzC,WAAW,EACT,6FAA6F;YAC7F,8FAA8F;YAC9F,wFAAwF;YACxF,sHAAsH;QACxH,WAAW,EAAE;YACX,KAAK,EAAE,CAAC;iBACL,MAAM,EAAE;iBACR,GAAG,CAAC,CAAC,CAAC;iBACN,QAAQ,CAAC,6DAA6D,CAAC;YAC1E,OAAO,EAAE,CAAC;iBACP,MAAM,EAAE;iBACR,GAAG,EAAE;iBACL,QAAQ,CAAC,kEAAkE,CAAC;SAChF;QACD,WAAW,EAAE,QAAQ,EAAE;KACxB,EACD,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,EAAE;QAC3B,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,KAAK,EAAE,OAAO,CAAC,CAAC;QAClD,OAAO,YAAY,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC,CACF,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"diagnose.js","sourceRoot":"","sources":["../../../src/modules/apimapper/diagnose.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,gEAAgE;AAChE,uEAAuE;AACvE,qEAAqE;AACrE,oFAAoF;AACpF,2EAA2E;AAC3E,uEAAuE;AACvE,+CAA+C;AAC/C,uEAAuE;AACvE,qEAAqE;AACrE,uEAAuE;AACvE,kEAAkE;AAClE,EAAE;AACF,qEAAqE;AACrE,EAAE;AACF,0DAA0D;AAC1D,yEAAyE;AACzE,iEAAiE;AACjE,EAAE;AACF,wEAAwE;AACxE,iCAAiC;AAGjC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAwB5C,MA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,KAAK,EAAE,MAAM,CAAC,cAAc;yBAC7B;qBACF;iBACF;aACF;SACF,CAAC,CAAC;IACL,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,54 @@
1
+ import { type McpServerWithElicitation } from "@getimo/mcp-toolkit";
2
+ import type { CallToolResult } from "@modelcontextprotocol/sdk/types.js";
3
+ import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
4
+ export type { McpServerWithElicitation };
5
+ /**
6
+ * Build the `McpServerWithElicitation` capability object the toolkit's
7
+ * `elicitChoice` / `elicitConfirmation` consume, from the real `McpServer`.
8
+ *
9
+ * Why an adapter and not the bare `McpServer`:
10
+ * The toolkit's `McpServerWithElicitation.server.elicitInput` is typed with
11
+ * the loose `ElicitInputParams` (`mode: "form" | "url"`, `requestedSchema?:
12
+ * Record<string, unknown>`). The SDK's `Server.elicitInput` is the stricter
13
+ * discriminated `ElicitRequestFormParams | ElicitRequestURLParams` with a
14
+ * fully-typed `requestedSchema`. A real `McpServer` is therefore NOT
15
+ * structurally assignable to `McpServerWithElicitation` — the parameter
16
+ * types are contravariantly incompatible.
17
+ *
18
+ * The toolkit's `elicitChoice` / `elicitConfirmation` ALWAYS call with
19
+ * `mode: "form"` and a `requestedSchema` whose properties are plain
20
+ * `{ type: "string", enum: [...] }` / `{ type: "boolean" }` shapes — i.e.
21
+ * always a valid `ElicitRequestFormParams` at runtime. This adapter is the
22
+ * single, documented interop boundary that re-narrows the loose toolkit
23
+ * params to the SDK's form-params type. ONE cast, justified inline — the
24
+ * same pattern the W3.4 `CapturingServer` uses for its SDK-overload
25
+ * boundaries.
26
+ */
27
+ export declare function toElicitationCapability(realServer: McpServer): McpServerWithElicitation;
28
+ /**
29
+ * A disambiguation candidate. `id` is the value a tool needs (credential ID,
30
+ * flow ID); `label` is a human-readable name shown in the elicitation prompt
31
+ * and the fallback error list.
32
+ */
33
+ export interface ElicitationCandidate {
34
+ id: string;
35
+ label: string;
36
+ }
37
+ /**
38
+ * Render a candidate list as a readable bullet block for the structured
39
+ * fallback error — so a client without elicitation support still gets a
40
+ * fully actionable recovery path.
41
+ */
42
+ export declare function renderCandidateList(candidates: ElicitationCandidate[]): string;
43
+ /**
44
+ * Build the structured `errorResult` returned when elicitation is unavailable
45
+ * (unsupported client) or the user declined/cancelled. The error names every
46
+ * candidate and tells the caller exactly which parameter to supply on retry.
47
+ */
48
+ export declare function ambiguityFallbackError(opts: {
49
+ code: string;
50
+ paramName: string;
51
+ what: string;
52
+ candidates: ElicitationCandidate[];
53
+ extraDetails?: Record<string, unknown>;
54
+ }): CallToolResult;
@@ -0,0 +1,90 @@
1
+ // src/modules/apimapper/elicitation.ts — W3.6 targeted-elicitation support
2
+ //
3
+ // rc.13 Welle 3, Stage 4 (2026-05-20). Three tools gain targeted
4
+ // disambiguation: when the input that selects one of several candidates is
5
+ // missing AND there is genuine ambiguity (>1 candidate), the tool asks the
6
+ // user to pick — through the MCP elicitation channel — instead of guessing.
7
+ //
8
+ // Architecture (design-doc §W3.6, adapted for the W3.4 Gateway refactor):
9
+ // The 18 `registerXTools` functions receive a `ToolRegistrar` (the
10
+ // `registerTool` + `registerResource` subsurface), NOT the full McpServer.
11
+ // The toolkit's `elicitChoice(server, …)` needs `{ server: { elicitInput } }`
12
+ // — the real McpServer's `.server.elicitInput`. The real McpServer IS in
13
+ // scope in `apimapperRestModule.register(server)`; it is passed as an extra
14
+ // parameter to ONLY the 3 elicitation-aware modules (Option A). A real
15
+ // `McpServer` already satisfies `McpServerWithElicitation` structurally
16
+ // (it has `readonly server: Server` and `Server.elicitInput`), so the
17
+ // parameter is passed cast-free. The parameter is OPTIONAL: when the host
18
+ // wiring omits it (or a test drives the handler in isolation), the tool
19
+ // behaves exactly as for a client without elicitation support — it returns
20
+ // the structured `errorResult` fallback.
21
+ //
22
+ // MANDATORY non-elicitation fallback: `elicitChoice` returns `null` on a
23
+ // client without elicitation support, on decline, and on cancel. Every call
24
+ // site MUST then return a structured `errorResult` listing the candidates
25
+ // with a recovery hint — never hang, never guess, never silently pick.
26
+ import { errorResult, } from "@getimo/mcp-toolkit";
27
+ /**
28
+ * Build the `McpServerWithElicitation` capability object the toolkit's
29
+ * `elicitChoice` / `elicitConfirmation` consume, from the real `McpServer`.
30
+ *
31
+ * Why an adapter and not the bare `McpServer`:
32
+ * The toolkit's `McpServerWithElicitation.server.elicitInput` is typed with
33
+ * the loose `ElicitInputParams` (`mode: "form" | "url"`, `requestedSchema?:
34
+ * Record<string, unknown>`). The SDK's `Server.elicitInput` is the stricter
35
+ * discriminated `ElicitRequestFormParams | ElicitRequestURLParams` with a
36
+ * fully-typed `requestedSchema`. A real `McpServer` is therefore NOT
37
+ * structurally assignable to `McpServerWithElicitation` — the parameter
38
+ * types are contravariantly incompatible.
39
+ *
40
+ * The toolkit's `elicitChoice` / `elicitConfirmation` ALWAYS call with
41
+ * `mode: "form"` and a `requestedSchema` whose properties are plain
42
+ * `{ type: "string", enum: [...] }` / `{ type: "boolean" }` shapes — i.e.
43
+ * always a valid `ElicitRequestFormParams` at runtime. This adapter is the
44
+ * single, documented interop boundary that re-narrows the loose toolkit
45
+ * params to the SDK's form-params type. ONE cast, justified inline — the
46
+ * same pattern the W3.4 `CapturingServer` uses for its SDK-overload
47
+ * boundaries.
48
+ */
49
+ export function toElicitationCapability(realServer) {
50
+ return {
51
+ server: {
52
+ elicitInput: (params) =>
53
+ // Cast: the toolkit only ever produces form-mode elicitation
54
+ // requests (verified: elicitChoice + elicitConfirmation both pass
55
+ // `mode: "form"` with a string/boolean `requestedSchema`). The loose
56
+ // `ElicitInputParams` is asserted to the SDK's `ElicitRequestFormParams`
57
+ // so the SDK's overloaded `elicitInput` accepts it. The runtime
58
+ // payload is exactly a valid form request — only the static type is
59
+ // widened on the toolkit side.
60
+ realServer.server.elicitInput(params),
61
+ },
62
+ };
63
+ }
64
+ /**
65
+ * Render a candidate list as a readable bullet block for the structured
66
+ * fallback error — so a client without elicitation support still gets a
67
+ * fully actionable recovery path.
68
+ */
69
+ export function renderCandidateList(candidates) {
70
+ return candidates.map((c) => ` • ${c.id} — ${c.label}`).join("\n");
71
+ }
72
+ /**
73
+ * Build the structured `errorResult` returned when elicitation is unavailable
74
+ * (unsupported client) or the user declined/cancelled. The error names every
75
+ * candidate and tells the caller exactly which parameter to supply on retry.
76
+ */
77
+ export function ambiguityFallbackError(opts) {
78
+ const list = renderCandidateList(opts.candidates);
79
+ return errorResult({
80
+ message: `Multiple ${opts.what} match — cannot pick automatically.`,
81
+ code: opts.code,
82
+ suggestion: `Retry with an explicit \`${opts.paramName}\` set to one of:\n${list}`,
83
+ details: {
84
+ [`candidate_${opts.paramName}s`]: opts.candidates.map((c) => c.id),
85
+ candidates: opts.candidates,
86
+ ...opts.extraDetails,
87
+ },
88
+ });
89
+ }
90
+ //# sourceMappingURL=elicitation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"elicitation.js","sourceRoot":"","sources":["../../../src/modules/apimapper/elicitation.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAC3E,EAAE;AACF,iEAAiE;AACjE,2EAA2E;AAC3E,2EAA2E;AAC3E,4EAA4E;AAC5E,EAAE;AACF,0EAA0E;AAC1E,qEAAqE;AACrE,6EAA6E;AAC7E,gFAAgF;AAChF,2EAA2E;AAC3E,8EAA8E;AAC9E,yEAAyE;AACzE,0EAA0E;AAC1E,wEAAwE;AACxE,4EAA4E;AAC5E,0EAA0E;AAC1E,6EAA6E;AAC7E,2CAA2C;AAC3C,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,0EAA0E;AAC1E,uEAAuE;AAEvE,OAAO,EACL,WAAW,GAGZ,MAAM,qBAAqB,CAAC;AAS7B;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,UAAU,uBAAuB,CACrC,UAAqB;IAErB,OAAO;QACL,MAAM,EAAE;YACN,WAAW,EAAE,CAAC,MAAyB,EAAE,EAAE;YACzC,6DAA6D;YAC7D,kEAAkE;YAClE,qEAAqE;YACrE,yEAAyE;YACzE,gEAAgE;YAChE,oEAAoE;YACpE,+BAA+B;YAC/B,UAAU,CAAC,MAAM,CAAC,WAAW,CAAC,MAAiC,CAAC;SACnE;KACF,CAAC;AACJ,CAAC;AAYD;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,UAAkC;IACpE,OAAO,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,OAAO,CAAC,CAAC,EAAE,MAAM,CAAC,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACtE,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,sBAAsB,CAAC,IAMtC;IACC,MAAM,IAAI,GAAG,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAClD,OAAO,WAAW,CAAC;QACjB,OAAO,EAAE,YAAY,IAAI,CAAC,IAAI,qCAAqC;QACnE,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,UAAU,EACR,4BAA4B,IAAI,CAAC,SAAS,sBAAsB,IAAI,EAAE;QACxE,OAAO,EAAE;YACP,CAAC,aAAa,IAAI,CAAC,SAAS,GAAG,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YAClE,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,GAAG,IAAI,CAAC,YAAY;SACrB;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,50 @@
1
+ import { type TableColumn } from "@getimo/mcp-toolkit";
2
+ import type { Flow } from "./types.js";
3
+ export declare const FLOW_TABLE_COLUMNS: TableColumn[];
4
+ export declare const FLOW_COMPACT_COLUMNS: TableColumn[];
5
+ /**
6
+ * Derive `is_compiled` from REST shape: the backend returns `compiledAt`
7
+ * (ISO timestamp string or null) and a `compiled` array of artifacts.
8
+ * Either indicates the flow has been compiled. Shared between the row map
9
+ * and the in-memory `compiled` filter so display + filtering stay uniform.
10
+ */
11
+ export declare function isFlowCompiled(f: Flow): boolean;
12
+ /** Standard row map: full Flow → table row. */
13
+ export declare function mapFlowRow(f: Record<string, unknown>): Record<string, unknown>;
14
+ /** T1 compact row map: only the columns FLOW_COMPACT_COLUMNS renders. */
15
+ export declare function compactFlowRow(f: Record<string, unknown>): Record<string, unknown>;
16
+ export declare const FLOW_LIST_NEXT_STEPS: string;
17
+ /**
18
+ * Build a structured detail view for one flow (flow_get).
19
+ *
20
+ * IA-7: technical IDs are copyable code entries. IA-10: a dedicated "Next
21
+ * steps" group carries the actionable follow-up calls. The W2 flow
22
+ * visualization (an ASCII diagram) is routed via `appendText` — it reaches
23
+ * the LLM-readable output but is intentionally kept OUT of the Rich Card
24
+ * groups payload, exactly as the toolkit documents `appendText` for
25
+ * technical detail that would clutter the visual display.
26
+ */
27
+ export declare function buildFlowDetail(id: string, flow: Flow): import("@getimo/mcp-toolkit").StructuredCallToolResult;
28
+ /**
29
+ * Build a structured timeline view for a flow execution trace (flow_trace).
30
+ *
31
+ * The trace's per-step timing map naturally onto timeline events: each step
32
+ * becomes one event with its node id as the title, the item count + duration
33
+ * as the detail, and a relative `[step N]` time label (the trace carries no
34
+ * wall-clock per step, only durations). Shapes vary across backend versions,
35
+ * so every field read is defensive.
36
+ */
37
+ export declare function buildFlowTraceTimeline(id: string, steps: unknown[], totalMs?: number): import("@getimo/mcp-toolkit").StructuredCallToolResult;
38
+ /**
39
+ * Build a structured detail view for a flow-import-bundle validation result
40
+ * (flow_import_validate). The REST result is a flat validation envelope
41
+ * ({valid, flowName, exportedFrom, connectionReferences}) — detailResult is
42
+ * the clean fit. Array fields flatten to a count + per-item entries (note 4).
43
+ * IA-10: a dedicated "Next steps" group carries the import/abort guidance.
44
+ */
45
+ export declare function buildImportValidateDetail(opts: {
46
+ valid: boolean;
47
+ flowName?: string;
48
+ exportedFrom?: string | null;
49
+ connectionReferences: unknown[];
50
+ }): import("@getimo/mcp-toolkit").StructuredCallToolResult;