@wootsup/mcp 0.1.0-rc.8 → 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 +72 -6
  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 +135 -6
  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
@@ -1,4 +1,5 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
1
+ import type { ToolRegistrar } from "./gateway/capturing-server.js";
2
+ import { type StructuredCallToolResult } from "@getimo/mcp-toolkit";
2
3
  import type { Connection, Flow, LibraryItem, LicenseStatus } from "./types.js";
3
4
  export type SuggestionType = "activate-template" | "publish-flow" | "reconnect-oauth";
4
5
  export interface OnboardingSuggestion {
@@ -13,6 +14,13 @@ export interface OnboardingSubError {
13
14
  export interface OnboardingReport {
14
15
  site: {
15
16
  wp_base: string;
17
+ /**
18
+ * rc.10 B (2026-05-19) — platform inferred from WP_BASE shape so the
19
+ * AI knows which surface it is talking to without a follow-up call.
20
+ */
21
+ platform: "wordpress" | "joomla" | "unknown";
22
+ plugin_version?: string;
23
+ api_version?: string;
16
24
  };
17
25
  license: Partial<LicenseStatus> & {
18
26
  available: boolean;
@@ -27,8 +35,22 @@ export interface OnboardingReport {
27
35
  draft: number;
28
36
  items: Array<Pick<Flow, "id" | "name" | "source" | "is_compiled" | "node_count">>;
29
37
  };
38
+ /**
39
+ * rc.10 B (2026-05-19) — extended library brief so the AI sees the FULL
40
+ * catalog shape from a single onboarding call. Previously the report
41
+ * only included `popular[5]` which the AI mistook for the entire library,
42
+ * triggering 29× discovery-loop calls in the Maria-walkthrough logs.
43
+ */
30
44
  library: {
45
+ total_count: number;
46
+ categories: Array<{
47
+ id: string;
48
+ name: string;
49
+ count: number;
50
+ }>;
51
+ featured: Array<Pick<LibraryItem, "id" | "name" | "category">>;
31
52
  popular: Array<Pick<LibraryItem, "id" | "name" | "category">>;
53
+ hint: string;
32
54
  };
33
55
  suggestions: OnboardingSuggestion[];
34
56
  errors: OnboardingSubError[];
@@ -48,4 +70,28 @@ export declare function deriveSuggestions(args: {
48
70
  * Never throws. Sub-call failures land in `errors[]`.
49
71
  */
50
72
  export declare function buildOnboardingReport(): Promise<OnboardingReport>;
51
- export declare function registerOnboardingTool(server: McpServer): void;
73
+ /**
74
+ * W3.1 (rc.13 Welle 3) — render an OnboardingReport as a `detailResult`.
75
+ *
76
+ * Onboarding is the largest baseline payload and the #1 token-reduction
77
+ * lever for Welle 3. The migration is purely additive — every fact the AI
78
+ * received under the previous `formatResult(report)` JSON dump is still in
79
+ * the output — but the shape is split for both token-efficiency and Rich
80
+ * Card rendering:
81
+ *
82
+ * - `groups` — the scalar summary: site status, license tier, and the
83
+ * connection / flow / library counts. This is what the Rich Card
84
+ * "detail" component renders, and detailResult flattens it to compact
85
+ * `label: value` lines for the LLM (far cheaper than pretty-printed
86
+ * JSON).
87
+ * - `appendText` — the verbose nested sections (connection list, flow
88
+ * list, full category breakdown, featured + popular catalog, the
89
+ * anti-iteration hint, suggestions, and any sub-call errors). The
90
+ * toolkit documents `appendText` as "appended to the LLM output but
91
+ * NOT shown in the Rich Card" — exactly right for catalog/suggestion
92
+ * detail that would clutter the card yet the AI still needs verbatim.
93
+ *
94
+ * Pure function — no I/O — so the test suite pins it directly.
95
+ */
96
+ export declare function buildOnboardingDetail(report: OnboardingReport): StructuredCallToolResult;
97
+ export declare function registerOnboardingTool(server: ToolRegistrar): void;
@@ -13,8 +13,25 @@
13
13
  // from the aggregated payload. Rules are simple and intentionally narrow —
14
14
  // the goal is "show the user a sensible first step", not "complete agent
15
15
  // reasoning". When in doubt, suggest nothing.
16
- import { formatResult, readOnly } from "@getimo/mcp-toolkit";
16
+ //
17
+ // rc.13 Welle 3 (2026-05-21) — W3.1 heavy-tool migration. The tool output
18
+ // moves from `formatResult(report)` (pretty-printed JSON dump) to
19
+ // `detailResult`: a scalar summary (site / license / counts) renders as
20
+ // `groups`; the verbose nested sections (connection + flow lists, full
21
+ // category breakdown, featured + popular catalog, the anti-iteration hint,
22
+ // suggestions, errors) go into `appendText`. Migration is purely additive —
23
+ // every fact the AI received before is still in the output — and the flat
24
+ // key-value rendering is a token win on the #1 baseline payload.
25
+ // `buildOnboardingReport` itself is unchanged: it stays a pure data
26
+ // assembler so its callers and pin-tests are untouched.
27
+ import { detailResult, readOnly, } from "@getimo/mcp-toolkit";
17
28
  import { request, WP_BASE } from "./client.js";
29
+ // F-LS-04 (live-smoke 2026-05-20) — the PHP /connections endpoint emits
30
+ // camelCase keys (authType, credentialId). The onboarding allConns list +
31
+ // the expired-OAuth filter both read snake_case (auth_type, credential_id).
32
+ // Without this bridge, every connection in the report appears as auth=none
33
+ // with credential_id=null, and the reconnect-oauth suggestion never fires.
34
+ import { normalizeConnectionFromWire } from "./normalizers.js";
18
35
  async function safeRequest(tool, path) {
19
36
  try {
20
37
  const r = await request(path);
@@ -69,17 +86,77 @@ export function deriveSuggestions(args) {
69
86
  }
70
87
  return out;
71
88
  }
89
+ /**
90
+ * rc.10 B (2026-05-19) — Infer the host platform from the configured
91
+ * WP_BASE URL. WordPress installs typically end in `/wp-json/...` or
92
+ * contain `/wordpress/`; Joomla installs expose `option=com_…` or
93
+ * `/administrator/`. We only return `unknown` when neither pattern
94
+ * matches — the AI then has explicit signal that something is off.
95
+ *
96
+ * L-4 (W3F-5): this is the FALLBACK when the live `/identity` call
97
+ * couldn't be reached or returned an unrecognised value. The canonical
98
+ * source of truth is the server-side identity payload (`.platform`),
99
+ * which `buildOnboardingReport` queries first.
100
+ */
101
+ function detectPlatform(baseUrl) {
102
+ const u = baseUrl.toLowerCase();
103
+ if (/\/wp-json|\/wordpress|wp\-content/.test(u) || /\bwordpress\b/.test(u)) {
104
+ return "wordpress";
105
+ }
106
+ if (/option=com_|\/administrator|\bjoomla\b/.test(u)) {
107
+ return "joomla";
108
+ }
109
+ return "unknown";
110
+ }
111
+ /**
112
+ * L-4 (W3F-5): map an `/identity.platform` string to the OnboardingReport
113
+ * enum. Server emits `"wordpress"` / `"joomla"`; anything else is treated
114
+ * as `"unknown"` (the same conservative default the URL heuristic uses).
115
+ */
116
+ function normaliseIdentityPlatform(raw) {
117
+ if (typeof raw !== "string")
118
+ return null;
119
+ const v = raw.trim().toLowerCase();
120
+ if (v === "wordpress")
121
+ return "wordpress";
122
+ if (v === "joomla")
123
+ return "joomla";
124
+ if (v === "")
125
+ return null;
126
+ return "unknown";
127
+ }
72
128
  /**
73
129
  * Run the five sub-calls in parallel + assemble an OnboardingReport.
74
130
  * Never throws. Sub-call failures land in `errors[]`.
75
131
  */
76
132
  export async function buildOnboardingReport() {
77
- const [health, license, connections, flows, popular] = await Promise.allSettled([
78
- safeRequest("apimapper_health", "/connections"),
133
+ // rc.10 B (2026-05-19) added /library/categories and /library/featured
134
+ // in parallel so a single onboarding call returns the full catalog brief.
135
+ // ~30 ms extra wall-clock (parallel) saves 5-10s of nachgelagerte
136
+ // discovery calls.
137
+ //
138
+ // F-LS-01 (live-smoke 2026-05-20) — removed the apimapper_health parallel
139
+ // call. /wp-json/api-mapper/v1/health does NOT exist on the WP backend
140
+ // (route-list audit: 0 matches; only /connections/health-check and
141
+ // /admin/health-warnings exist). Its only consumer was the
142
+ // plugin_version / api_version derivation, which was already always
143
+ // undefined because of the same 404. Removing the call drops the
144
+ // spurious apimapper_health entry from errors[] so the AI no longer
145
+ // chases a phantom outage on a fresh install.
146
+ // L-4 (W3F-5): `/identity` is included in the parallel batch so the
147
+ // platform string is sourced from the server, not from a URL regex.
148
+ // The endpoint is public on both WordPress and Joomla — even an
149
+ // unauthenticated probe answers — so the call is safe to fire on
150
+ // every onboarding. A failure here drops us back to the legacy URL
151
+ // heuristic via `detectPlatform()`.
152
+ const [identity, license, connections, flows, popular, featured, categories] = await Promise.allSettled([
153
+ safeRequest("apimapper_identity", "/identity"),
79
154
  safeRequest("apimapper_license_status", "/license"),
80
155
  safeRequest("apimapper_connection_list", "/connections"),
81
156
  safeRequest("apimapper_flow_list", "/flows"),
82
157
  safeRequest("apimapper_library_popular", "/library/popular?limit=5"),
158
+ safeRequest("apimapper_library_featured", "/library/featured?limit=5"),
159
+ safeRequest("apimapper_library_categories", "/library/categories"),
83
160
  ]);
84
161
  const errors = [];
85
162
  // Helper that pulls .value from a settled promise + records any error.
@@ -95,12 +172,34 @@ export async function buildOnboardingReport() {
95
172
  }
96
173
  return s.value.data;
97
174
  };
98
- void take(health); // health call is just used to populate errors[]; data unused
175
+ const identityData = take(identity);
99
176
  const licenseData = take(license);
100
177
  const connData = take(connections);
101
178
  const flowData = take(flows);
102
179
  const popularData = take(popular);
103
- const allConns = Array.isArray(connData?.connections) ? connData.connections : [];
180
+ const featuredData = take(featured);
181
+ const categoriesData = take(categories);
182
+ // L-4 (W3F-5): canonical platform from /identity if present + valid;
183
+ // otherwise fall back to the URL-shape heuristic. The result is the
184
+ // same union the OnboardingReport.site.platform type expects.
185
+ const platformFromIdentity = identityData
186
+ ? normaliseIdentityPlatform(identityData.platform)
187
+ : null;
188
+ const sitePlatform = platformFromIdentity ?? detectPlatform(WP_BASE);
189
+ // L-4 follow-up: surface the upstream `plugin_version` so the
190
+ // onboarding report carries it even though we removed the
191
+ // /health-based probe at F-LS-01. /identity returns this field on
192
+ // both platforms.
193
+ const pluginVersionFromIdentity = identityData && typeof identityData.plugin_version === "string"
194
+ ? identityData.plugin_version
195
+ : undefined;
196
+ // F-LS-04 — bridge camelCase /connections wire-shape to snake_case so the
197
+ // downstream c.auth_type + c.credential_id reads (both here in the
198
+ // expired-OAuth filter and in the connection-items map below) see the
199
+ // real upstream values instead of undefined.
200
+ const allConns = Array.isArray(connData?.connections)
201
+ ? connData.connections.map((c) => normalizeConnectionFromWire(c))
202
+ : [];
104
203
  const allFlows = Array.isArray(flowData?.flows) ? flowData.flows : [];
105
204
  // F-A6-15: PHP /library/popular returns `connections`; tolerate legacy `items`.
106
205
  const popItems = Array.isArray(popularData?.connections)
@@ -108,6 +207,21 @@ export async function buildOnboardingReport() {
108
207
  : Array.isArray(popularData?.items)
109
208
  ? popularData.items
110
209
  : [];
210
+ const featuredItems = Array.isArray(featuredData?.connections)
211
+ ? featuredData.connections
212
+ : Array.isArray(featuredData?.items)
213
+ ? featuredData.items
214
+ : [];
215
+ // rc.10 B — categories shape: {categories: [{id, name, count}, ...]}.
216
+ // When the call fails or shape is unexpected, fall back to an empty list;
217
+ // total_count then falls back to popItems.length so the AI still gets a
218
+ // best-effort number.
219
+ const categoryRows = Array.isArray(categoriesData?.categories)
220
+ ? categoriesData.categories.filter((c) => typeof c?.id === "string" && typeof c?.name === "string" && typeof c?.count === "number")
221
+ : [];
222
+ const libraryTotalCount = categoryRows.length > 0
223
+ ? categoryRows.reduce((sum, c) => sum + c.count, 0)
224
+ : popItems.length;
111
225
  // ── Conditional second-stage call: credentials, only if any conn has an oauth creds.
112
226
  const oauthCredIds = allConns
113
227
  .filter((c) => (c.auth_type || "").startsWith("oauth2") && c.credential_id)
@@ -139,21 +253,52 @@ export async function buildOnboardingReport() {
139
253
  expiredOauthCredentialIds,
140
254
  popular: popItems,
141
255
  });
142
- // License: licenseData is the raw /license response; surface known fields.
256
+ // License: the raw /license response is
257
+ // { success, license: { tier, is_valid, expires_at, beta_channel, ... } }
258
+ // — unwrap one level. F-LS-02 (live-smoke 2026-05-20): previously read
259
+ // o.tier / o.status from the OUTER envelope, which never has those
260
+ // fields, so tier/status were always undefined. Status is derived from
261
+ // is_valid:boolean → "valid"/"invalid"; if a future backend version
262
+ // emits a flat shape (no inner license envelope) the same mapper still
263
+ // works because `inner` falls back to `outer`. A legacy `status` string
264
+ // on `inner` wins over the is_valid derivation, so existing wire
265
+ // shapes that emit a precomputed status are still respected.
143
266
  const licMap = (() => {
144
267
  if (!licenseData || typeof licenseData !== "object")
145
268
  return { available: false };
146
- const o = licenseData;
269
+ const outer = licenseData;
270
+ const inner = outer.license && typeof outer.license === "object"
271
+ ? outer.license
272
+ : outer; // forward-compat: backend may flatten in future
273
+ const derivedStatus = typeof inner.is_valid === "boolean"
274
+ ? inner.is_valid
275
+ ? "valid"
276
+ : "invalid"
277
+ : undefined;
147
278
  return {
148
279
  available: true,
149
- status: typeof o.status === "string" ? o.status : undefined,
150
- tier: typeof o.tier === "string" ? o.tier : undefined,
151
- expires_at: typeof o.expires_at === "string" ? o.expires_at : null,
152
- beta_channel: typeof o.beta_channel === "boolean" ? o.beta_channel : undefined,
280
+ status: typeof inner.status === "string" ? inner.status : derivedStatus,
281
+ tier: typeof inner.tier === "string" ? inner.tier : undefined,
282
+ expires_at: typeof inner.expires_at === "string" ? inner.expires_at : null,
283
+ beta_channel: typeof inner.beta_channel === "boolean" ? inner.beta_channel : undefined,
153
284
  };
154
285
  })();
286
+ // rc.10 B — free-text hint that lives ADJACENT to the library data
287
+ // so the LLM reads it in the natural flow. `next_tools[]` arrays are
288
+ // ignored by most agents; prose anchored to numbers is not.
289
+ const libraryHint = `Catalog has ${libraryTotalCount} templates across ${categoryRows.length} categories. ` +
290
+ `Skip pagination and category-iteration: a single library_list({}) call returns the ` +
291
+ `complete catalog. Use the categories list above to filter results client-side rather ` +
292
+ `than calling library_list({category}) per slug.`;
155
293
  return {
156
- site: { wp_base: WP_BASE },
294
+ site: {
295
+ wp_base: WP_BASE,
296
+ platform: sitePlatform,
297
+ // L-4 (W3F-5): plugin_version is now sourced from /identity (which
298
+ // exposes it on both WordPress and Joomla). Undefined when the
299
+ // probe failed or the field was missing.
300
+ ...(pluginVersionFromIdentity ? { plugin_version: pluginVersionFromIdentity } : {}),
301
+ },
157
302
  license: licMap,
158
303
  connections: {
159
304
  count: allConns.length,
@@ -178,29 +323,191 @@ export async function buildOnboardingReport() {
178
323
  })),
179
324
  },
180
325
  library: {
326
+ total_count: libraryTotalCount,
327
+ categories: categoryRows,
328
+ featured: featuredItems.slice(0, 5).map((f) => ({
329
+ id: f.id,
330
+ name: f.name,
331
+ category: f.category,
332
+ })),
181
333
  popular: popItems.slice(0, 5).map((p) => ({
182
334
  id: p.id,
183
335
  name: p.name,
184
336
  category: p.category,
185
337
  })),
338
+ hint: libraryHint,
186
339
  },
187
340
  suggestions,
188
341
  errors,
189
342
  };
190
343
  }
344
+ // ── structuredContent builder ──────────────────────────────────────────
345
+ /**
346
+ * W3.1 (rc.13 Welle 3) — render an OnboardingReport as a `detailResult`.
347
+ *
348
+ * Onboarding is the largest baseline payload and the #1 token-reduction
349
+ * lever for Welle 3. The migration is purely additive — every fact the AI
350
+ * received under the previous `formatResult(report)` JSON dump is still in
351
+ * the output — but the shape is split for both token-efficiency and Rich
352
+ * Card rendering:
353
+ *
354
+ * - `groups` — the scalar summary: site status, license tier, and the
355
+ * connection / flow / library counts. This is what the Rich Card
356
+ * "detail" component renders, and detailResult flattens it to compact
357
+ * `label: value` lines for the LLM (far cheaper than pretty-printed
358
+ * JSON).
359
+ * - `appendText` — the verbose nested sections (connection list, flow
360
+ * list, full category breakdown, featured + popular catalog, the
361
+ * anti-iteration hint, suggestions, and any sub-call errors). The
362
+ * toolkit documents `appendText` as "appended to the LLM output but
363
+ * NOT shown in the Rich Card" — exactly right for catalog/suggestion
364
+ * detail that would clutter the card yet the AI still needs verbatim.
365
+ *
366
+ * Pure function — no I/O — so the test suite pins it directly.
367
+ */
368
+ export function buildOnboardingDetail(report) {
369
+ const siteEntries = [
370
+ { key: "wp_base", label: "Site URL", value: report.site.wp_base, format: "code", copyable: true },
371
+ { key: "platform", label: "Platform", value: report.site.platform, format: "badge" },
372
+ ];
373
+ if (report.site.plugin_version) {
374
+ siteEntries.push({
375
+ key: "plugin_version",
376
+ label: "Plugin version",
377
+ value: report.site.plugin_version,
378
+ });
379
+ }
380
+ if (report.site.api_version) {
381
+ siteEntries.push({
382
+ key: "api_version",
383
+ label: "API version",
384
+ value: report.site.api_version,
385
+ });
386
+ }
387
+ const licenseEntries = report.license.available
388
+ ? [
389
+ { key: "tier", label: "Tier", value: report.license.tier ?? "—", format: "badge" },
390
+ { key: "status", label: "Status", value: report.license.status ?? "—", format: "status" },
391
+ { key: "expires_at", label: "Expires", value: report.license.expires_at ?? "—", format: "date" },
392
+ ]
393
+ : [{ key: "available", label: "License", value: "unavailable", format: "status" }];
394
+ const countEntries = [
395
+ { key: "connections", label: "Connections", value: report.connections.count },
396
+ { key: "flows", label: "Flows", value: report.flows.count },
397
+ { key: "flows_published", label: "Flows published", value: report.flows.published },
398
+ { key: "flows_draft", label: "Flows draft", value: report.flows.draft },
399
+ { key: "library_templates", label: "Library templates", value: report.library.total_count },
400
+ { key: "library_categories", label: "Library categories", value: report.library.categories.length },
401
+ { key: "suggestions", label: "Suggested next steps", value: report.suggestions.length },
402
+ { key: "errors", label: "Sub-call errors", value: report.errors.length },
403
+ ];
404
+ const groups = [
405
+ { label: "Site", entries: siteEntries },
406
+ { label: "License", entries: licenseEntries },
407
+ { label: "Counts", entries: countEntries },
408
+ ];
409
+ const appendText = buildOnboardingAppendText(report);
410
+ const errorCount = report.errors.length;
411
+ const badge = errorCount > 0
412
+ ? { text: `${errorCount} sub-call error${errorCount === 1 ? "" : "s"}`, variant: "warning" }
413
+ : { text: "all checks ok", variant: "success" };
414
+ return detailResult({
415
+ title: "Onboarding briefing",
416
+ subtitle: `${report.site.platform} install — ${report.connections.count} connection(s), ${report.flows.count} flow(s)`,
417
+ badge,
418
+ groups,
419
+ appendText,
420
+ });
421
+ }
422
+ /**
423
+ * W3.1 — assemble the verbose `appendText` block: every nested section the
424
+ * scalar `groups` cannot carry. Anchored to plain prose + line lists so the
425
+ * LLM reads it in natural order. Nothing here is dropped relative to the
426
+ * old JSON dump — only re-shaped from `{...}` to readable lines.
427
+ */
428
+ function buildOnboardingAppendText(report) {
429
+ const lines = [];
430
+ // Connections detail.
431
+ lines.push(`Connections (${report.connections.count}):`);
432
+ if (report.connections.items.length === 0) {
433
+ lines.push(" (none)");
434
+ }
435
+ else {
436
+ for (const c of report.connections.items) {
437
+ lines.push(` - ${c.name} [id=${c.id}] source=${c.source ?? "—"} auth=${c.auth_type ?? "none"}` +
438
+ (c.credential_id ? ` credential=${c.credential_id}` : ""));
439
+ }
440
+ }
441
+ // Flows detail.
442
+ lines.push("", `Flows (${report.flows.count}; ${report.flows.published} published, ${report.flows.draft} draft):`);
443
+ if (report.flows.items.length === 0) {
444
+ lines.push(" (none)");
445
+ }
446
+ else {
447
+ for (const f of report.flows.items) {
448
+ lines.push(` - ${f.name} [id=${f.id}] source=${f.source ?? "—"} ` +
449
+ `${f.is_compiled ? "published" : "draft"} nodes=${f.node_count ?? "?"}`);
450
+ }
451
+ }
452
+ // Library catalog detail.
453
+ lines.push("", `Library: ${report.library.total_count} templates across ${report.library.categories.length} categories.`);
454
+ if (report.library.categories.length > 0) {
455
+ lines.push(" Categories:");
456
+ for (const cat of report.library.categories) {
457
+ lines.push(` - ${cat.name} [id=${cat.id}] (${cat.count})`);
458
+ }
459
+ }
460
+ if (report.library.featured.length > 0) {
461
+ lines.push(" Featured:");
462
+ for (const f of report.library.featured) {
463
+ lines.push(` - ${f.name} [id=${f.id}] category=${f.category ?? "—"}`);
464
+ }
465
+ }
466
+ if (report.library.popular.length > 0) {
467
+ lines.push(" Popular:");
468
+ for (const p of report.library.popular) {
469
+ lines.push(` - ${p.name} [id=${p.id}] category=${p.category ?? "—"}`);
470
+ }
471
+ }
472
+ lines.push(` ${report.library.hint}`);
473
+ // Suggested next steps.
474
+ lines.push("", `Suggested next steps (${report.suggestions.length}):`);
475
+ if (report.suggestions.length === 0) {
476
+ lines.push(" (none)");
477
+ }
478
+ else {
479
+ for (const s of report.suggestions) {
480
+ lines.push(` - [${s.type}] ${s.label}\n → ${s.action}`);
481
+ }
482
+ }
483
+ // Sub-call errors.
484
+ if (report.errors.length > 0) {
485
+ lines.push("", `Sub-call errors (${report.errors.length}):`);
486
+ for (const e of report.errors) {
487
+ lines.push(` - ${e.tool}: ${e.error}`);
488
+ }
489
+ }
490
+ return lines.join("\n");
491
+ }
191
492
  // ── MCP tool registration ──────────────────────────────────────────────
192
493
  export function registerOnboardingTool(server) {
193
494
  server.registerTool("apimapper_onboarding", {
194
495
  title: "Onboarding Report (Composite)",
195
- description: "Aggregate health, license, connections, flows, and popular library items into a single " +
196
- "onboarding report with suggested next actions. Run this first when meeting a new install — " +
197
- "tolerates partial failures and never throws." +
496
+ description: "ONE-SHOT BRIEFING run this FIRST when meeting a new install. Aggregates site platform, " +
497
+ "license tier, connections, flows, and a complete library brief (total_count + categories + " +
498
+ "featured + popular + free-text hint) into a single response. After this call you have full " +
499
+ "orientation; do NOT chain apimapper_library_categories or apimapper_library_list to " +
500
+ "rediscover what is already in the report. Tolerates partial failures and never throws." +
198
501
  "\n\nExample:\n apimapper_onboarding({})",
199
502
  inputSchema: {},
200
- annotations: readOnly(),
503
+ annotations: readOnly({ title: "Onboarding Walkthrough", openWorld: true }),
201
504
  }, async () => {
202
505
  const report = await buildOnboardingReport();
203
- return formatResult(report, false, { maxChars: 6000 });
506
+ // W3.1 (rc.13 Welle 3) — detailResult: scalar summary in `groups`,
507
+ // verbose catalog/suggestion/error detail in `appendText`. The flat
508
+ // key-value rendering replaces the pretty-printed JSON dump — a token
509
+ // win on the largest baseline payload, with nothing lost.
510
+ return buildOnboardingDetail(report);
204
511
  });
205
512
  }
206
513
  //# sourceMappingURL=onboarding.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"onboarding.js","sourceRoot":"","sources":["../../../src/modules/apimapper/onboarding.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAClE,EAAE;AACF,uEAAuE;AACvE,2EAA2E;AAC3E,0EAA0E;AAC1E,qDAAqD;AACrD,EAAE;AACF,0EAA0E;AAC1E,uEAAuE;AACvE,iDAAiD;AACjD,EAAE;AACF,yEAAyE;AACzE,2EAA2E;AAC3E,yEAAyE;AACzE,8CAA8C;AAG9C,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAmD/C,KAAK,UAAU,WAAW,CACxB,IAAY,EACZ,IAAY;IAEZ,IAAI,CAAC;QACH,MAAM,CAAC,GAAG,MAAM,OAAO,CAAI,IAAI,CAAC,CAAC;QACjC,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;YACf,OAAO,EAAE,IAAI,EAAE,IAAI,EAA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C,EAAE,KAAK,EAAE,wBAAwB,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;KAC5E,EACD,KAAK,IAAI,EAAE;QACT,MAAM,MAAM,GAAG,MAAM,qBAAqB,EAAE,CAAC;QAC7C,mEAAmE;QACnE,oEAAoE;QACpE,sEAAsE;QACtE,0DAA0D;QAC1D,OAAO,qBAAqB,CAAC,MAAM,CAAC,CAAC;IACvC,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -1,5 +1,27 @@
1
1
  export declare const READ_CACHE_TTL_MS = 60000;
2
2
  export declare const READ_CACHE_MAX_ENTRIES = 200;
3
+ /**
4
+ * Per-entry opts that influence the cache key. Currently only `sanitize`
5
+ * but kept as an object so future flags (e.g. shape variants) can be added
6
+ * without breaking the existing call-sites.
7
+ */
8
+ export interface CacheKeyOpts {
9
+ /**
10
+ * When the request will run its response through `sanitizeSecrets()`,
11
+ * the cached payload looks materially different (redacted) vs the raw
12
+ * variant. Without this bit in the key, two callers with different
13
+ * `sanitize` flags would see each other's responses — a Defense-in-Depth
14
+ * gap (F-02, A5). Default = false (raw) preserves prior behaviour.
15
+ *
16
+ * Contract: `undefined` and explicit `false` are intentionally equivalent
17
+ * (both map to the `R` (raw) cache slot — see read-cache.test.ts
18
+ * "default behaviour (no flag) treats as sanitize=false" for the pinned
19
+ * contract). Only literal `true` selects the `S` (sanitized) slot —
20
+ * non-boolean truthy values (e.g. `1`, `"yes"`) map to `R` per strict-
21
+ * equality guard in `cacheKey()`.
22
+ */
23
+ sanitize?: boolean;
24
+ }
3
25
  /**
4
26
  * Is the request eligible for caching? GET only, and the path must
5
27
  * match at least one allowlist prefix. We compare against the path-
@@ -10,15 +32,22 @@ export declare function isCacheableRequest(method: string, url: string): boolean
10
32
  /**
11
33
  * Retrieve a cached entry. Returns undefined on miss or expired entry —
12
34
  * expired entries are also evicted to keep the store small.
35
+ *
36
+ * The optional `opts.sanitize` bit must match the value used at `setCached`
37
+ * time, otherwise this is a miss (intentional — sanitized and raw variants
38
+ * are isolated, see F-02).
13
39
  */
14
- export declare function getCached<T = unknown>(method: string, url: string): T | undefined;
40
+ export declare function getCached<T = unknown>(method: string, url: string, opts?: CacheKeyOpts): T | undefined;
15
41
  /**
16
42
  * Store an entry. Caps the store at READ_CACHE_MAX_ENTRIES — when full,
17
43
  * we drop the OLDEST entry first (by storedAt). This is FIFO rather than
18
44
  * LRU; LRU would require an access-time update on every read which is
19
45
  * not worth it at 200-entry scale.
46
+ *
47
+ * The optional `opts.sanitize` bit becomes part of the cache key so the
48
+ * sanitized variant cannot leak into a raw-mode call (F-02, A5 D-i-D).
20
49
  */
21
- export declare function setCached<T = unknown>(method: string, url: string, data: T): void;
50
+ export declare function setCached<T = unknown>(method: string, url: string, data: T, opts?: CacheKeyOpts): void;
22
51
  /**
23
52
  * Invalidate cache entries whose request path overlaps with the mutated
24
53
  * resource. Conservative — clears every entry whose key includes the