@wootsup/mcp 0.1.0-rc.9 → 0.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 (240) hide show
  1. package/CHANGELOG.md +148 -83
  2. package/README.md +36 -32
  3. package/SECURITY.md +15 -6
  4. package/dist/auth/keychain.d.ts +27 -1
  5. package/dist/auth/keychain.js +48 -2
  6. package/dist/auth/keychain.js.map +1 -1
  7. package/dist/cli-hint.d.ts +22 -0
  8. package/dist/cli-hint.js +55 -0
  9. package/dist/cli-hint.js.map +1 -0
  10. package/dist/index.d.ts +19 -0
  11. package/dist/index.js +163 -22
  12. package/dist/index.js.map +1 -1
  13. package/dist/install-skill.js +1 -1
  14. package/dist/modules/apimapper/cache.d.ts +2 -2
  15. package/dist/modules/apimapper/cache.js +119 -29
  16. package/dist/modules/apimapper/cache.js.map +1 -1
  17. package/dist/modules/apimapper/client.d.ts +102 -1
  18. package/dist/modules/apimapper/client.js +631 -297
  19. package/dist/modules/apimapper/client.js.map +1 -1
  20. package/dist/modules/apimapper/connections-format.d.ts +51 -0
  21. package/dist/modules/apimapper/connections-format.js +261 -0
  22. package/dist/modules/apimapper/connections-format.js.map +1 -0
  23. package/dist/modules/apimapper/connections-trim.d.ts +82 -0
  24. package/dist/modules/apimapper/connections-trim.js +224 -0
  25. package/dist/modules/apimapper/connections-trim.js.map +1 -0
  26. package/dist/modules/apimapper/connections.d.ts +14 -2
  27. package/dist/modules/apimapper/connections.js +612 -153
  28. package/dist/modules/apimapper/connections.js.map +1 -1
  29. package/dist/modules/apimapper/credential-sanitizer.d.ts +5 -0
  30. package/dist/modules/apimapper/credential-sanitizer.js +60 -1
  31. package/dist/modules/apimapper/credential-sanitizer.js.map +1 -1
  32. package/dist/modules/apimapper/credentials-format.d.ts +21 -0
  33. package/dist/modules/apimapper/credentials-format.js +145 -0
  34. package/dist/modules/apimapper/credentials-format.js.map +1 -0
  35. package/dist/modules/apimapper/credentials.d.ts +12 -2
  36. package/dist/modules/apimapper/credentials.js +226 -73
  37. package/dist/modules/apimapper/credentials.js.map +1 -1
  38. package/dist/modules/apimapper/diagnose.d.ts +54 -2
  39. package/dist/modules/apimapper/diagnose.js +213 -12
  40. package/dist/modules/apimapper/diagnose.js.map +1 -1
  41. package/dist/modules/apimapper/elicitation.d.ts +54 -0
  42. package/dist/modules/apimapper/elicitation.js +90 -0
  43. package/dist/modules/apimapper/elicitation.js.map +1 -0
  44. package/dist/modules/apimapper/flows-format.d.ts +50 -0
  45. package/dist/modules/apimapper/flows-format.js +318 -0
  46. package/dist/modules/apimapper/flows-format.js.map +1 -0
  47. package/dist/modules/apimapper/flows.d.ts +13 -2
  48. package/dist/modules/apimapper/flows.js +312 -122
  49. package/dist/modules/apimapper/flows.js.map +1 -1
  50. package/dist/modules/apimapper/gateway/advanced-tool.d.ts +9 -0
  51. package/dist/modules/apimapper/gateway/advanced-tool.js +265 -0
  52. package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -0
  53. package/dist/modules/apimapper/gateway/capturing-server.d.ts +81 -0
  54. package/dist/modules/apimapper/gateway/capturing-server.js +87 -0
  55. package/dist/modules/apimapper/gateway/capturing-server.js.map +1 -0
  56. package/dist/modules/apimapper/gateway/essentials.d.ts +4 -0
  57. package/dist/modules/apimapper/gateway/essentials.js +35 -0
  58. package/dist/modules/apimapper/gateway/essentials.js.map +1 -0
  59. package/dist/modules/apimapper/gateway/test-support.d.ts +17 -0
  60. package/dist/modules/apimapper/gateway/test-support.js +43 -0
  61. package/dist/modules/apimapper/gateway/test-support.js.map +1 -0
  62. package/dist/modules/apimapper/get-skill.d.ts +3 -3
  63. package/dist/modules/apimapper/get-skill.js +47 -7
  64. package/dist/modules/apimapper/get-skill.js.map +1 -1
  65. package/dist/modules/apimapper/graph-builder.js +1 -1
  66. package/dist/modules/apimapper/graph-builder.js.map +1 -1
  67. package/dist/modules/apimapper/graph.d.ts +2 -2
  68. package/dist/modules/apimapper/graph.js +170 -35
  69. package/dist/modules/apimapper/graph.js.map +1 -1
  70. package/dist/modules/apimapper/index.d.ts +17 -1
  71. package/dist/modules/apimapper/index.js +68 -17
  72. package/dist/modules/apimapper/index.js.map +1 -1
  73. package/dist/modules/apimapper/inspect.d.ts +3 -2
  74. package/dist/modules/apimapper/inspect.js +97 -13
  75. package/dist/modules/apimapper/inspect.js.map +1 -1
  76. package/dist/modules/apimapper/library.d.ts +2 -2
  77. package/dist/modules/apimapper/library.js +665 -80
  78. package/dist/modules/apimapper/library.js.map +1 -1
  79. package/dist/modules/apimapper/license-format.d.ts +22 -0
  80. package/dist/modules/apimapper/license-format.js +149 -0
  81. package/dist/modules/apimapper/license-format.js.map +1 -0
  82. package/dist/modules/apimapper/license.d.ts +16 -2
  83. package/dist/modules/apimapper/license.js +62 -38
  84. package/dist/modules/apimapper/license.js.map +1 -1
  85. package/dist/modules/apimapper/local-sources.d.ts +2 -2
  86. package/dist/modules/apimapper/local-sources.js +44 -30
  87. package/dist/modules/apimapper/local-sources.js.map +1 -1
  88. package/dist/modules/apimapper/misc.d.ts +30 -2
  89. package/dist/modules/apimapper/misc.js +114 -49
  90. package/dist/modules/apimapper/misc.js.map +1 -1
  91. package/dist/modules/apimapper/node-schema.d.ts +52 -0
  92. package/dist/modules/apimapper/node-schema.js +70 -2
  93. package/dist/modules/apimapper/node-schema.js.map +1 -1
  94. package/dist/modules/apimapper/normalizers.d.ts +1 -0
  95. package/dist/modules/apimapper/normalizers.js +51 -0
  96. package/dist/modules/apimapper/normalizers.js.map +1 -1
  97. package/dist/modules/apimapper/onboarding.d.ts +78 -3
  98. package/dist/modules/apimapper/onboarding.js +428 -26
  99. package/dist/modules/apimapper/onboarding.js.map +1 -1
  100. package/dist/modules/apimapper/read-cache.d.ts +31 -2
  101. package/dist/modules/apimapper/read-cache.js +20 -6
  102. package/dist/modules/apimapper/read-cache.js.map +1 -1
  103. package/dist/modules/apimapper/render/_shared.d.ts +24 -0
  104. package/dist/modules/apimapper/render/_shared.js +84 -0
  105. package/dist/modules/apimapper/render/_shared.js.map +1 -0
  106. package/dist/modules/apimapper/render/dag.d.ts +18 -0
  107. package/dist/modules/apimapper/render/dag.js +70 -0
  108. package/dist/modules/apimapper/render/dag.js.map +1 -0
  109. package/dist/modules/apimapper/render/index.d.ts +2 -0
  110. package/dist/modules/apimapper/render/index.js +112 -0
  111. package/dist/modules/apimapper/render/index.js.map +1 -0
  112. package/dist/modules/apimapper/render/renderers/chart-bar.d.ts +2 -0
  113. package/dist/modules/apimapper/render/renderers/chart-bar.js +70 -0
  114. package/dist/modules/apimapper/render/renderers/chart-bar.js.map +1 -0
  115. package/dist/modules/apimapper/render/renderers/chart-line.d.ts +2 -0
  116. package/dist/modules/apimapper/render/renderers/chart-line.js +71 -0
  117. package/dist/modules/apimapper/render/renderers/chart-line.js.map +1 -0
  118. package/dist/modules/apimapper/render/renderers/diff.d.ts +2 -0
  119. package/dist/modules/apimapper/render/renderers/diff.js +154 -0
  120. package/dist/modules/apimapper/render/renderers/diff.js.map +1 -0
  121. package/dist/modules/apimapper/render/renderers/flow-diagram.d.ts +1 -0
  122. package/dist/modules/apimapper/render/renderers/flow-diagram.js +180 -0
  123. package/dist/modules/apimapper/render/renderers/flow-diagram.js.map +1 -0
  124. package/dist/modules/apimapper/render/renderers/json-tree.d.ts +2 -0
  125. package/dist/modules/apimapper/render/renderers/json-tree.js +87 -0
  126. package/dist/modules/apimapper/render/renderers/json-tree.js.map +1 -0
  127. package/dist/modules/apimapper/render/renderers/schema-diagram.d.ts +2 -0
  128. package/dist/modules/apimapper/render/renderers/schema-diagram.js +83 -0
  129. package/dist/modules/apimapper/render/renderers/schema-diagram.js.map +1 -0
  130. package/dist/modules/apimapper/render/renderers/table.d.ts +2 -0
  131. package/dist/modules/apimapper/render/renderers/table.js +75 -0
  132. package/dist/modules/apimapper/render/renderers/table.js.map +1 -0
  133. package/dist/modules/apimapper/render/schemas.d.ts +23 -0
  134. package/dist/modules/apimapper/render/schemas.js +56 -0
  135. package/dist/modules/apimapper/render/schemas.js.map +1 -0
  136. package/dist/modules/apimapper/render/secret-masking.d.ts +5 -0
  137. package/dist/modules/apimapper/render/secret-masking.js +51 -0
  138. package/dist/modules/apimapper/render/secret-masking.js.map +1 -0
  139. package/dist/modules/apimapper/render/sidecar.d.ts +21 -0
  140. package/dist/modules/apimapper/render/sidecar.js +66 -0
  141. package/dist/modules/apimapper/render/sidecar.js.map +1 -0
  142. package/dist/modules/apimapper/render/token-cap.d.ts +21 -0
  143. package/dist/modules/apimapper/render/token-cap.js +57 -0
  144. package/dist/modules/apimapper/render/token-cap.js.map +1 -0
  145. package/dist/modules/apimapper/schema.d.ts +2 -2
  146. package/dist/modules/apimapper/schema.js +92 -33
  147. package/dist/modules/apimapper/schema.js.map +1 -1
  148. package/dist/modules/apimapper/settings-format.d.ts +23 -0
  149. package/dist/modules/apimapper/settings-format.js +135 -0
  150. package/dist/modules/apimapper/settings-format.js.map +1 -0
  151. package/dist/modules/apimapper/settings.d.ts +2 -2
  152. package/dist/modules/apimapper/settings.js +100 -42
  153. package/dist/modules/apimapper/settings.js.map +1 -1
  154. package/dist/modules/apimapper/sites-tools.d.ts +29 -0
  155. package/dist/modules/apimapper/sites-tools.js +165 -0
  156. package/dist/modules/apimapper/sites-tools.js.map +1 -0
  157. package/dist/modules/apimapper/skill-resources.d.ts +2 -2
  158. package/dist/modules/apimapper/skill-resources.js.map +1 -1
  159. package/dist/modules/apimapper/token-baseline.harness.d.ts +91 -0
  160. package/dist/modules/apimapper/token-baseline.harness.js +291 -0
  161. package/dist/modules/apimapper/token-baseline.harness.js.map +1 -0
  162. package/dist/modules/apimapper/tool-result.d.ts +46 -0
  163. package/dist/modules/apimapper/tool-result.js +63 -0
  164. package/dist/modules/apimapper/tool-result.js.map +1 -0
  165. package/dist/modules/apimapper/toolslist-size.d.ts +56 -0
  166. package/dist/modules/apimapper/toolslist-size.js +192 -0
  167. package/dist/modules/apimapper/toolslist-size.js.map +1 -0
  168. package/dist/modules/apimapper/types.d.ts +44 -8
  169. package/dist/modules/apimapper/types.js +26 -1
  170. package/dist/modules/apimapper/types.js.map +1 -1
  171. package/dist/modules/apimapper/use-profile.d.ts +21 -0
  172. package/dist/modules/apimapper/use-profile.js +56 -2
  173. package/dist/modules/apimapper/use-profile.js.map +1 -1
  174. package/dist/modules/apimapper/whitelist-drift.d.ts +85 -0
  175. package/dist/modules/apimapper/whitelist-drift.js +360 -0
  176. package/dist/modules/apimapper/whitelist-drift.js.map +1 -0
  177. package/dist/modules/apimapper/workflows.d.ts +2 -2
  178. package/dist/modules/apimapper/workflows.js +202 -20
  179. package/dist/modules/apimapper/workflows.js.map +1 -1
  180. package/dist/modules/apimapper/yootheme-binding.d.ts +35 -0
  181. package/dist/modules/apimapper/yootheme-binding.js +186 -0
  182. package/dist/modules/apimapper/yootheme-binding.js.map +1 -0
  183. package/dist/platform/index.d.ts +56 -0
  184. package/dist/platform/index.js +195 -7
  185. package/dist/platform/index.js.map +1 -1
  186. package/dist/setup/detect-clients.d.ts +40 -1
  187. package/dist/setup/detect-clients.js +148 -1
  188. package/dist/setup/detect-clients.js.map +1 -1
  189. package/dist/setup/probe-handshake.js +40 -7
  190. package/dist/setup/probe-handshake.js.map +1 -1
  191. package/dist/setup/remove-config.d.ts +8 -0
  192. package/dist/setup/remove-config.js +145 -0
  193. package/dist/setup/remove-config.js.map +1 -0
  194. package/dist/setup/uninstall.d.ts +34 -0
  195. package/dist/setup/uninstall.js +147 -0
  196. package/dist/setup/uninstall.js.map +1 -0
  197. package/dist/setup-cli.d.ts +60 -0
  198. package/dist/setup-cli.js +155 -5
  199. package/dist/setup-cli.js.map +1 -1
  200. package/dist/sites/loader.d.ts +41 -0
  201. package/dist/sites/loader.js +119 -0
  202. package/dist/sites/loader.js.map +1 -0
  203. package/dist/sites/schema.d.ts +69 -0
  204. package/dist/sites/schema.js +71 -0
  205. package/dist/sites/schema.js.map +1 -0
  206. package/dist/sites/secret-resolver.d.ts +47 -0
  207. package/dist/sites/secret-resolver.js +150 -0
  208. package/dist/sites/secret-resolver.js.map +1 -0
  209. package/dist/skill-instructions.d.ts +1 -1
  210. package/dist/skill-instructions.js +5 -0
  211. package/dist/skill-instructions.js.map +1 -1
  212. package/dist/transports/stdio.js +4 -4
  213. package/dist/transports/stdio.js.map +1 -1
  214. package/dist/uninstall-skill.d.ts +27 -0
  215. package/dist/uninstall-skill.js +89 -0
  216. package/dist/uninstall-skill.js.map +1 -0
  217. package/docs/architecture.md +22 -22
  218. package/docs/customgraph-internal-migration.md +4 -4
  219. package/docs/security.md +2 -21
  220. package/docs/tools.md +40 -12
  221. package/manifest.json +77 -70
  222. package/package.json +68 -60
  223. package/skills/apimapper/SKILL.md +53 -7
  224. package/skills/apimapper/reference/conditional-style-multi-items.md +114 -0
  225. package/skills/apimapper/reference/jmespath-pitfalls.md +108 -0
  226. package/skills/apimapper/reference/joomla.md +1 -1
  227. package/skills/apimapper/reference/library-template-discovery.md +65 -0
  228. package/skills/apimapper/reference/merge-two-sources-on-key.md +99 -0
  229. package/skills/apimapper/reference/render.md +132 -0
  230. package/skills/apimapper/reference/troubleshooting.md +21 -1
  231. package/skills/apimapper/reference/yootheme.md +1 -1
  232. package/dist/auth/oauth-provider.d.ts +0 -68
  233. package/dist/auth/oauth-provider.js +0 -232
  234. package/dist/auth/oauth-provider.js.map +0 -1
  235. package/dist/server-http.d.ts +0 -22
  236. package/dist/server-http.js +0 -159
  237. package/dist/server-http.js.map +0 -1
  238. package/dist/transports/http.d.ts +0 -29
  239. package/dist/transports/http.js +0 -267
  240. package/dist/transports/http.js.map +0 -1
@@ -0,0 +1,192 @@
1
+ // toolslist-size.ts — W3 Stage-5 token-Δ measurement (Task B)
2
+ //
3
+ // Measures the `tools/list` catalog overhead — the static tool descriptions +
4
+ // JSON schemas an MCP client receives once per session, before any tool is
5
+ // called. This is the DOMINANT token cost center of an API Mapper session.
6
+ //
7
+ // Two figures, both derived from the CURRENT build (canonical counts asserted
8
+ // live in gateway/gateway.test.ts — A2, 2026-06-03):
9
+ //
10
+ // - POST-W3 `tools/list` — the 19 surface tools the server now exposes
11
+ // (15 module essentials + `apimapper_advanced`
12
+ // + the 3 src/index.ts top-level tools).
13
+ // - PRE-W3-equivalent `tools/list` — what `tools/list` WOULD be if all 79
14
+ // tools were exposed flat (the pre-Gateway
15
+ // state): the 19 surface tools minus the
16
+ // gateway tool, plus the 60 advanced-registry
17
+ // tool configs — 78 flat tools. (Pre-W3 the
18
+ // `apimapper_advanced` gateway did not exist.)
19
+ //
20
+ // Per-tool serialization mirrors what the MCP SDK puts on the wire for one
21
+ // `tools/list` entry: `{ name, description, inputSchema, annotations }`, where
22
+ // `inputSchema` is the JSON Schema projected from the tool's Zod raw-shape
23
+ // (the same `z.toJSONSchema` projection `gateway/advanced-tool.ts` uses for
24
+ // discovery mode). `title` and `_meta` are omitted: they are small, present on
25
+ // both sides, and cancel out in the delta — keeping the measurement focused on
26
+ // the description + schema payload that actually scales with the tool count.
27
+ //
28
+ // Determinism: given the same build, every figure is byte-for-byte identical.
29
+ // Pinned by toolslist-size.test.ts.
30
+ import * as os from "node:os";
31
+ import * as path from "node:path";
32
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
33
+ import { loadModules } from "@getimo/mcp-toolkit";
34
+ import { z } from "zod";
35
+ import { apimapperRestModule } from "./index.js";
36
+ import { collectModuleTools } from "./gateway/test-support.js";
37
+ import { registerListProfilesTool, registerUseProfileTool, } from "./use-profile.js";
38
+ import { ProfileStore } from "../../auth/profiles.js";
39
+ /**
40
+ * Reads a tool config's `inputSchema` as a Zod raw-shape. Mirrors `shapeOf`
41
+ * in `gateway/advanced-tool.ts` — a registered `inputSchema` is the raw shape
42
+ * object; a zero-arg tool has none.
43
+ */
44
+ function shapeOf(inputSchema) {
45
+ if (inputSchema && typeof inputSchema === "object") {
46
+ return inputSchema;
47
+ }
48
+ return {};
49
+ }
50
+ /**
51
+ * Projects one tool to its `tools/list` JSON-Schema-bearing catalog entry.
52
+ * The `inputSchema` is JSON-Schema-projected the same way the SDK and the
53
+ * gateway's discovery mode do, so the byte count reflects the real wire shape.
54
+ */
55
+ export function toCatalogEntry(name, tool) {
56
+ let inputSchema;
57
+ try {
58
+ inputSchema = z.toJSONSchema(z.object(shapeOf(tool.inputSchema)));
59
+ }
60
+ catch {
61
+ // A schema that cannot be JSON-projected still yields a usable entry; the
62
+ // description carries the rest. Matches the gateway discovery-mode guard.
63
+ inputSchema = { type: "object" };
64
+ }
65
+ return {
66
+ name,
67
+ description: tool.description,
68
+ inputSchema,
69
+ annotations: tool.annotations,
70
+ };
71
+ }
72
+ /**
73
+ * Serializes a list of catalog entries and tallies the UTF-8 byte length of
74
+ * each entry's `JSON.stringify`. The total is the `tools/list` payload size
75
+ * for that surface.
76
+ */
77
+ function measure(entries) {
78
+ const perTool = entries
79
+ .map((entry) => ({
80
+ name: entry.name,
81
+ bytes: Buffer.byteLength(JSON.stringify(entry), "utf8"),
82
+ }))
83
+ .sort((a, b) => a.name.localeCompare(b.name));
84
+ const totalBytes = perTool.reduce((sum, t) => sum + t.bytes, 0);
85
+ return { toolCount: perTool.length, totalBytes, perTool };
86
+ }
87
+ /** A no-op keychain: registration stores the dep but never invokes it here. */
88
+ const STUB_KEYCHAIN = {
89
+ set: async () => undefined,
90
+ get: async () => null,
91
+ delete: async () => undefined,
92
+ };
93
+ /**
94
+ * Captures the 3 top-level tools registered in `src/index.ts` —
95
+ * `apimapper_rest_modules_status`, `apimapper_use_profile`,
96
+ * `apimapper_list_profiles` — by replaying their registration against a
97
+ * recording registrar. `src/index.ts` registers these directly on the
98
+ * McpServer (not via the module / CapturingServer), so they must be added to
99
+ * the catalog explicitly for an accurate `tools/list` count.
100
+ *
101
+ * The use-profile registrations only *store* their `{ store, keychain }` deps;
102
+ * they are never invoked at registration time, so a real `ProfileStore` over a
103
+ * throwaway dir + a stub keychain is sufficient to capture the configs.
104
+ */
105
+ function captureTopLevelTools() {
106
+ const captured = new Map();
107
+ const recorder = {
108
+ registerTool(name, config) {
109
+ const cfg = config;
110
+ captured.set(name, {
111
+ handler: () => ({ content: [] }),
112
+ description: cfg.description,
113
+ inputSchema: cfg.inputSchema,
114
+ annotations: cfg.annotations,
115
+ });
116
+ },
117
+ };
118
+ // apimapper_rest_modules_status — registered inline in src/index.ts. Its
119
+ // config is replicated here verbatim (zero-arg readOnly status tool). The
120
+ // toolslist-size.test.ts cross-checks the captured name set, so drift
121
+ // between this replica and src/index.ts surfaces as a failing pin.
122
+ recorder.registerTool("apimapper_rest_modules_status", {
123
+ title: "Adapter Modules Status",
124
+ description: "Module-loading status for this MCP adapter (which sub-modules registered cleanly). " +
125
+ "For runtime connectivity + auth checks against the API Mapper REST surface, use apimapper_health.",
126
+ inputSchema: {},
127
+ annotations: { readOnlyHint: true, openWorldHint: false, title: "MCP Modules Status" },
128
+ });
129
+ // apimapper_use_profile + apimapper_list_profiles — registered via the
130
+ // use-profile module functions. Replaying the real registration functions
131
+ // captures their exact live config (description + Zod inputSchema).
132
+ // F-1.1 (Pass-1 consolidation): platform-portable temp path. The store is a
133
+ // throwaway used purely for tool-list shape capture during the measurement.
134
+ const store = new ProfileStore(path.join(os.tmpdir(), "__w3_toolslist_measure__"));
135
+ registerUseProfileTool(recorder, { store, keychain: STUB_KEYCHAIN });
136
+ registerListProfilesTool(recorder, { store, keychain: STUB_KEYCHAIN });
137
+ return captured;
138
+ }
139
+ /**
140
+ * Builds the full 79-tool catalog from the current build and measures the
141
+ * post-W3 vs pre-W3-equivalent `tools/list` payload sizes.
142
+ *
143
+ * Surface composition (verified against `gateway/essentials.ts` + `src/index.ts`,
144
+ * pinned live in `gateway/gateway.test.ts` — A2):
145
+ * - module tools : 15 essentials + `apimapper_advanced` = 16 (on the real
146
+ * McpServer) + 60 advanced (gateway registry) = 76
147
+ * - top-level tools: rest_modules_status + use_profile + list_profiles = 3
148
+ * total = 79
149
+ *
150
+ * POST-W3 `tools/list` = the 16 module-real tools + the 3 top-level tools = 19.
151
+ * PRE-W3 flat `tools/list` = the 18 non-gateway surface tools + the 60 advanced
152
+ * tools = 78 (the `apimapper_advanced` gateway did not exist pre-W3).
153
+ */
154
+ export async function measureToolsList() {
155
+ const server = new McpServer({
156
+ name: "toolslist-size-measure",
157
+ version: "0.0.0",
158
+ });
159
+ await loadModules(server, [apimapperRestModule]);
160
+ // collectModuleTools unifies the real-server essentials (incl. the gateway
161
+ // tool) with the captured advanced-registry tools.
162
+ const moduleTools = collectModuleTools(server, apimapperRestModule);
163
+ const topLevelTools = captureTopLevelTools();
164
+ const advancedRegistry = apimapperRestModule.getAdvancedRegistry();
165
+ const advancedNames = new Set(advancedRegistry ? advancedRegistry.keys() : []);
166
+ // POST-W3 surface: every tool in `tools/list` today — module-real tools that
167
+ // are NOT in the advanced registry (i.e. essentials + the gateway) plus the
168
+ // 3 top-level tools.
169
+ const postEntries = [];
170
+ for (const [name, tool] of Object.entries(moduleTools)) {
171
+ if (advancedNames.has(name))
172
+ continue; // advanced — gated behind the gateway
173
+ postEntries.push(toCatalogEntry(name, tool));
174
+ }
175
+ for (const [name, tool] of topLevelTools) {
176
+ postEntries.push(toCatalogEntry(name, tool));
177
+ }
178
+ // PRE-W3-equivalent flat surface: the post-W3 surface MINUS the gateway tool
179
+ // (it did not exist pre-W3) PLUS every advanced tool exposed flat.
180
+ const preEntries = postEntries.filter((e) => e.name !== "apimapper_advanced");
181
+ for (const [name, tool] of Object.entries(moduleTools)) {
182
+ if (!advancedNames.has(name))
183
+ continue; // only the advanced tools
184
+ preEntries.push(toCatalogEntry(name, tool));
185
+ }
186
+ const postW3 = measure(postEntries);
187
+ const preW3Flat = measure(preEntries);
188
+ const bytesSaved = preW3Flat.totalBytes - postW3.totalBytes;
189
+ const fractionSaved = preW3Flat.totalBytes > 0 ? bytesSaved / preW3Flat.totalBytes : 0;
190
+ return { postW3, preW3Flat, bytesSaved, fractionSaved };
191
+ }
192
+ //# sourceMappingURL=toolslist-size.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolslist-size.js","s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,IAAI,EAAE,IAAI,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC;QACvD,IAAI,CAAC,aAAa,CAAC,GAAG,CAAC,IAAI,CAAC;YAAE,SAAS,CAAC,0BAA0B;QAClE,UAAU,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;IAC9C,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC,CAAC;IACpC,MAAM,SAAS,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IACtC,MAAM,UAAU,GAAG,SAAS,CAAC,UAAU,GAAG,MAAM,CAAC,UAAU,CAAC;IAC5D,MAAM,aAAa,GACjB,SAAS,CAAC,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IAEnE,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,aAAa,EAAE,CAAC;AAC1D,CAAC"}
@@ -39,6 +39,27 @@ export interface Credential {
39
39
  auth_type: string;
40
40
  oauth_provider?: string | null;
41
41
  oauth_token_expires_at?: string | null;
42
+ /**
43
+ * Wave-12 F1 (Cold-AI #6) — canonical token-validity surface emitted by the
44
+ * PHP `/credentials` endpoint (`CredentialRepository::calculateStatus`).
45
+ * Values: 'active' | 'expiring' | 'expired' | 'broken'.
46
+ *
47
+ * - 'active' covers credentials with a refresh-token even if their
48
+ * short-lived access token's `oauth_token_expires_at` is in the past —
49
+ * they auto-renew on next use.
50
+ * - 'expired' is the only state where the customer truly needs to reconnect.
51
+ *
52
+ * The onboarding suggestion engine MUST prefer this field over the raw
53
+ * `oauth_token_expires_at` heuristic to avoid false-positive reconnect
54
+ * prompts for refreshable tokens (Google, GitHub, etc.).
55
+ */
56
+ status?: "active" | "expiring" | "expired" | "broken" | string | null;
57
+ /**
58
+ * Hard-expiry timestamp emitted ONLY for credentials WITHOUT a refresh-token
59
+ * (e.g. Meta/Instagram 60-day expiry). When this field is null/absent on an
60
+ * OAuth credential, the token is auto-refreshable and not user-visibly expirable.
61
+ */
62
+ token_hard_expires_at?: string | null;
42
63
  provider?: string | null;
43
64
  created_at?: string;
44
65
  updated_at?: string;
@@ -53,14 +74,8 @@ export interface FlowNode {
53
74
  data?: Record<string, unknown>;
54
75
  [k: string]: unknown;
55
76
  }
56
- export interface FlowEdge {
57
- id: string;
58
- source: string;
59
- target: string;
60
- sourceHandle?: string;
61
- targetHandle?: string;
62
- [k: string]: unknown;
63
- }
77
+ import type { FlowEdge } from "./node-schema.js";
78
+ export type { FlowEdge };
64
79
  export interface Flow {
65
80
  id: string;
66
81
  name: string;
@@ -109,3 +124,24 @@ export interface LicenseStatus {
109
124
  activation_count?: number;
110
125
  max_activations?: number;
111
126
  }
127
+ /**
128
+ * Bridge a typed-domain array to the toolkit's structurally-typed table-row
129
+ * shape.
130
+ *
131
+ * The mcp-core `tableResult()` (and other table builders) accept
132
+ * `Record<string, unknown>[]` for ASCII-table serialization. Our domain
133
+ * interfaces (`Connection`, `Credential`, `Flow`, `LibraryItem`, …) are
134
+ * nominal types without an index signature, so they are not structurally
135
+ * assignable to `Record<string, unknown>` even though every concrete row
136
+ * happens to satisfy it at runtime.
137
+ *
138
+ * Rather than scatter `items as unknown as Record<string, unknown>[]`
139
+ * across call-sites — each one looking like a code smell — this is the
140
+ * single documented interop point. Call-sites stay cast-free and the
141
+ * narrowing decision lives in ONE place that reviewers can audit.
142
+ *
143
+ * This is NOT a license to widen domain types — fields used downstream
144
+ * (column `key`s in the table config) are still type-checked against the
145
+ * domain interface separately.
146
+ */
147
+ export declare function toRows<T extends object>(items: readonly T[]): Record<string, unknown>[];
@@ -10,5 +10,30 @@
10
10
  // - LocalSource wire fmt = camelCase (contentType) with "platform/type" id ("wordpress/posts")
11
11
  //
12
12
  // These types reflect the actual REST contract verified against the PHP controllers.
13
- export {};
13
+ // =============================================================================
14
+ // Domain → toolkit interop bridge (F-1.2 — Pass-1 consolidation)
15
+ // =============================================================================
16
+ /**
17
+ * Bridge a typed-domain array to the toolkit's structurally-typed table-row
18
+ * shape.
19
+ *
20
+ * The mcp-core `tableResult()` (and other table builders) accept
21
+ * `Record<string, unknown>[]` for ASCII-table serialization. Our domain
22
+ * interfaces (`Connection`, `Credential`, `Flow`, `LibraryItem`, …) are
23
+ * nominal types without an index signature, so they are not structurally
24
+ * assignable to `Record<string, unknown>` even though every concrete row
25
+ * happens to satisfy it at runtime.
26
+ *
27
+ * Rather than scatter `items as unknown as Record<string, unknown>[]`
28
+ * across call-sites — each one looking like a code smell — this is the
29
+ * single documented interop point. Call-sites stay cast-free and the
30
+ * narrowing decision lives in ONE place that reviewers can audit.
31
+ *
32
+ * This is NOT a license to widen domain types — fields used downstream
33
+ * (column `key`s in the table config) are still type-checked against the
34
+ * domain interface separately.
35
+ */
36
+ export function toRows(items) {
37
+ return items;
38
+ }
14
39
  //# sourceMappingURL=types.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/apimapper/types.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,yEAAyE;AACzE,iGAAiG;AACjG,oFAAoF;AACpF,wEAAwE;AACxE,iFAAiF;AACjF,sEAAsE;AACtE,6EAA6E;AAC7E,mGAAmG;AACnG,EAAE;AACF,qFAAqF"}
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/modules/apimapper/types.ts"],"names":[],"mappings":"AAAA,oFAAoF;AACpF,EAAE;AACF,yEAAyE;AACzE,iGAAiG;AACjG,oFAAoF;AACpF,wEAAwE;AACxE,iFAAiF;AACjF,sEAAsE;AACtE,6EAA6E;AAC7E,mGAAmG;AACnG,EAAE;AACF,qFAAqF;AAmJrF,gFAAgF;AAChF,iEAAiE;AACjE,gFAAgF;AAEhF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,MAAM,CAAmB,KAAmB;IAC1D,OAAO,KAAwD,CAAC;AAClE,CAAC"}
@@ -31,4 +31,25 @@ export interface UseProfileDeps {
31
31
  */
32
32
  export declare function defaultProbeIdentity(profile: Profile, token: string): Promise<IdentityProbeResult>;
33
33
  export declare function registerUseProfileTool(server: ToolRegistrar | McpServer, deps: UseProfileDeps): void;
34
+ /**
35
+ * Dependencies for `registerListProfilesTool`. Matches the
36
+ * `UseProfileDeps` shape so callers can pass the same object — `keychain`
37
+ * is currently unused but kept in the signature for symmetry with
38
+ * apimapper_use_profile (so the wiring in src/index.ts is consistent and
39
+ * the contract can evolve without breaking callers).
40
+ */
41
+ export interface ListProfilesDeps {
42
+ store: ProfileStore;
43
+ keychain: Keychain;
44
+ }
45
+ /**
46
+ * Register the `apimapper_list_profiles` tool. Read-only — returns the
47
+ * configured profile registry with an `is_active` flag derived from the
48
+ * ProfileStore active pointer.
49
+ *
50
+ * Closes the broken xref in `apimapper_use_profile`'s "profile not found"
51
+ * hint, which previously pointed AI clients at this tool when it did not
52
+ * yet exist.
53
+ */
54
+ export declare function registerListProfilesTool(server: ToolRegistrar | McpServer, deps: ListProfilesDeps): void;
34
55
  export {};
@@ -12,7 +12,7 @@
12
12
  // Dependencies (store/keychain/probe) are injected for testability — the
13
13
  // real wire-through happens in src/index.ts where the server is constructed.
14
14
  import { z } from "zod";
15
- import { formatResult, readOnly } from "@getimo/mcp-toolkit";
15
+ import { formatResult, mutating, readOnly } from "@getimo/mcp-toolkit";
16
16
  import { createPlatform, } from "../../platform/index.js";
17
17
  import { createPlatformClient } from "./client.js";
18
18
  // ── Real probe (used in production) ──────────────────────────────────────
@@ -85,7 +85,16 @@ export function registerUseProfileTool(server, deps) {
85
85
  .default(false)
86
86
  .describe("Skip the live /identity probe. Use for offline activation when the site is unreachable."),
87
87
  },
88
- annotations: readOnly(),
88
+ // A6-P2 (W1.26 follow-up): handler writes ProfileStore state
89
+ // (`store.setActive` + `store.update(lastVerifiedIdentity)`), so the
90
+ // tool is NOT read-only per MCP spec ("readOnlyHint: does not modify
91
+ // its environment"). `mutating()` correctly carries
92
+ // `idempotentHint: true` — re-activating the same profile is a no-op
93
+ // beyond refreshing the verified-identity timestamp.
94
+ // W1.26.b: closed-world — effects are bounded to the local profile
95
+ // registry; identity probe is an internal Bearer + /identity call,
96
+ // not a third-party service mutation.
97
+ annotations: mutating({ title: "Switch Active Profile", openWorld: false }),
89
98
  }, async (args) => {
90
99
  const { name, noProbe = false } = args;
91
100
  // ── 1. Profile lookup ────────────────────────────────────────────
@@ -177,4 +186,49 @@ export function registerUseProfileTool(server, deps) {
177
186
  return formatResult(payload, false, { maxChars: 3000 });
178
187
  });
179
188
  }
189
+ /**
190
+ * Register the `apimapper_list_profiles` tool. Read-only — returns the
191
+ * configured profile registry with an `is_active` flag derived from the
192
+ * ProfileStore active pointer.
193
+ *
194
+ * Closes the broken xref in `apimapper_use_profile`'s "profile not found"
195
+ * hint, which previously pointed AI clients at this tool when it did not
196
+ * yet exist.
197
+ */
198
+ export function registerListProfilesTool(server, deps) {
199
+ const registrar = server;
200
+ registrar.registerTool("apimapper_list_profiles", {
201
+ title: "List Configured Profiles",
202
+ description: "List all configured site profiles (name, siteUrl, platform) with an " +
203
+ "is_active flag indicating which one is currently active. " +
204
+ "Use this to discover available profile names before calling " +
205
+ "apimapper_use_profile to switch the active profile. " +
206
+ "Read-only — does not contact any site." +
207
+ "\n\nResponse shape:\n" +
208
+ " { profile_count, active_profile, profiles: [{ name, siteUrl, platform, is_active, lastVerifiedAt? }] }",
209
+ inputSchema: {},
210
+ annotations: readOnly({ title: "List Configured Profiles", openWorld: false }),
211
+ }, async () => {
212
+ const all = await deps.store.list();
213
+ const active = await deps.store.getActive();
214
+ const activeName = active?.name ?? null;
215
+ const profiles = all.map((p) => {
216
+ const entry = {
217
+ name: p.name,
218
+ siteUrl: p.siteUrl,
219
+ platform: p.platform,
220
+ is_active: p.name === activeName,
221
+ };
222
+ if (p.lastVerifiedIdentity) {
223
+ entry.lastVerifiedAt = "set";
224
+ }
225
+ return entry;
226
+ });
227
+ return formatResult({
228
+ profile_count: profiles.length,
229
+ active_profile: activeName,
230
+ profiles,
231
+ }, false, { maxChars: 3000 });
232
+ });
233
+ }
180
234
  //# sourceMappingURL=use-profile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"use-profile.js","sourceRoot":"","sources":["../../../src/modules/apimapper/use-profile.ts"],"names":[],"mappings":"AAAA,oDAAoD;AACpD,EAAE;AACF,8EAA8E;AAC9E,0EAA0E;AAC1E,iEAAiE;AACjE,EAAE;AACF,8EAA8E;AAC9E,6EAA6E;AAC7E,wEAAwE;AACxE,6EAA6E;AAC7E,EAAE;AACF,yEAAyE;AACzE,6EAA6E;AAG7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,YAAY,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAG7D,OAAO,EACL,cAAc,GAGf,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA+BnD,4EAA4E;AAE5E;;;;;;;GAOG;AACH,MAAM,CAAC,KAAK,UAAU,oBAAoB,CACxC,OAAgB,EAChB,KAAa;IAEb,MAAM,QAAQ,GAAa,cAAc,CAAC;QACxC,IAAI,EAAE,OAAO,CAAC,QAAwB;QACtC,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,KAAK;KACN,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,oBAAoB,CAAC,QAAQ,CAAC,CAAC;IAC9C,MAAM,CAAC,GAAG,MAAM,MAAM,CAAC,OAAO,CAAU,UAAU,CAAC,CAAC;IACpD,IAAI,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CAAC,CAAC,CAAC,KAAK,IAAI,uBAAuB,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,iBAAiB,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;AACnC,CAAC;AAED,SAAS,iBAAiB,CAA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0B;QACjC,WAAW,EACT,sEAAsE;YACtE,2DAA2D;YAC3D,8DAA8D;YAC9D,sDAAsD;YACtD,wCAAwC;YACxC,uBAAuB;YACvB,0GAA0G;QAC5G,WAAW,EAAE,EAAE;QACf,WAAW,EAAE,QAAQ,CAAC,EAAE,KAAK,EAAE,0BAA0B,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;KAC/E,EACD,KAAK,IAAI,EAAE;QACT,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;QACpC,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,SAAS,EAAE,CAAC;QAC5C,MAAM,UAAU,GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,CAAC;QAExC,MAAM,QAAQ,GAAoB,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;YAC9C,MAAM,KAAK,GAAkB;gBAC3B,IAAI,EAAE,CAAC,CAAC,IAAI;gBACZ,OAAO,EAAE,CAAC,CAAC,OAAO;gBAClB,QAAQ,EAAE,CAAC,CAAC,QAAQ;gBACpB,SAAS,EAAE,CAAC,CAAC,IAAI,KAAK,UAAU;aACjC,CAAC;YACF,IAAI,CAAC,CAAC,oBAAoB,EAAE,CAAC;gBAC3B,KAAK,CAAC,cAAc,GAAG,KAAK,CAAC;YAC/B,CAAC;YACD,OAAO,KAAK,CAAC;QACf,CAAC,CAAC,CAAC;QAEH,OAAO,YAAY,CACjB;YACE,aAAa,EAAE,QAAQ,CAAC,MAAM;YAC9B,cAAc,EAAE,UAAU;YAC1B,QAAQ;SACT,EACD,KAAK,EACL,EAAE,QAAQ,EAAE,IAAI,EAAE,CACnB,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,85 @@
1
+ /** How a tool's request body relates to the PHP route. */
2
+ export type ToolBodyKind = "structured" | "envelope";
3
+ /** One body-sending tool's route binding. */
4
+ export interface ToolWireBinding {
5
+ /** HTTP method + normalised path, e.g. "POST /connections". Joins the manifest. */
6
+ route: string;
7
+ /** The literal wire body keys the tool sends (envelope tools list their wrapper key). */
8
+ bodyKeys: readonly string[];
9
+ kind: ToolBodyKind;
10
+ }
11
+ /**
12
+ * Curated bridge: body-sending tool → route + wire body keys.
13
+ *
14
+ * ONLY tools that send a request body appear here. Read-only (GET) tools and
15
+ * path/query-only tools carry no body-drift surface and are listed in the
16
+ * manifest's `_local_tools` (when they hit no route at all) or are simply
17
+ * absent (when they hit a GET route — GET routes never drift on body keys).
18
+ *
19
+ * `envelope` tools forward a free-form record (`patch` / `pipeline` / a settings
20
+ * map) whose individual keys are validated on the PHP side (e.g.
21
+ * ConnectionAdminController::ALLOWED_PATCH_KEYS). Their wrapper key is recorded
22
+ * so the test confirms the tool is accounted for; per-key validation lives in
23
+ * the PHP layer and is covered by PHP-side tests.
24
+ */
25
+ export declare const TOOL_WIRE_MAP: Readonly<Record<string, ToolWireBinding>>;
26
+ /** The PHP-accepted-params manifest fixture shape. */
27
+ export interface PhpAcceptedManifest {
28
+ /** "<METHOD> <path>" → accepted request-body keys. */
29
+ routes: Record<string, string[]>;
30
+ /** tool → { wire-key → justification } for keys the PHP route does not read. */
31
+ _allowed_drift: Record<string, Record<string, string>>;
32
+ /** tool → reason: tools with no REST route (purely client-side / aggregate). */
33
+ _local_tools: Record<string, string>;
34
+ /** route → { php-key → reason } for keys PHP accepts that no tool sends. */
35
+ _inverse_ignore?: Record<string, Record<string, string>>;
36
+ _meta?: Record<string, unknown>;
37
+ }
38
+ /** A single forward-direction drift: a wire key the PHP route does not accept. */
39
+ export interface DriftFinding {
40
+ tool: string;
41
+ route: string;
42
+ key: string;
43
+ }
44
+ /** A single inverse-direction advisory: a PHP-accepted key no tool sends. */
45
+ export interface InverseFinding {
46
+ route: string;
47
+ key: string;
48
+ }
49
+ export interface DriftReport {
50
+ /** Dangerous direction: tool sends a key PHP neither accepts nor allow-lists. */
51
+ drift: DriftFinding[];
52
+ /** Advisory: PHP accepts a key no tool sends (minus `_inverse_ignore`). */
53
+ inverse: InverseFinding[];
54
+ /** Live tools missing from BOTH TOOL_WIRE_MAP and `_local_tools` (coverage gap). */
55
+ uncovered: string[];
56
+ /** Entries in TOOL_WIRE_MAP / `_local_tools` no longer present in the live surface. */
57
+ stale: string[];
58
+ }
59
+ /**
60
+ * Resolve the committed fixture path. From this module
61
+ * (`<pkg>/{src,dist}/modules/apimapper/whitelist-drift.{ts,js}`) the package
62
+ * root is three directories up; the fixture is `tests/fixtures/...` under it.
63
+ * The depth is identical for the source layout (vitest/tsx) and the built
64
+ * `dist/` layout, so the same relative offset works in both.
65
+ */
66
+ export declare function manifestPath(): string;
67
+ /** Load + validate the committed PHP-accepted-params manifest. */
68
+ export declare function loadManifest(path?: string): PhpAcceptedManifest;
69
+ /**
70
+ * Enumerate every registered MCP tool name. Mirrors the runtime tool surface:
71
+ * - module essentials forwarded to a real McpServer,
72
+ * - the gateway-captured advanced tools,
73
+ * - the profile / status tools registered in src/index.ts AFTER module load.
74
+ *
75
+ * The src/index.ts trio is appended explicitly: they are registered on the real
76
+ * server outside the module's register(), so a module-only enumeration would
77
+ * miss them. They are pure local/profile tools (no REST body) and live in
78
+ * `_local_tools`; listing them here keeps the coverage check honest.
79
+ */
80
+ export declare function collectLiveTools(): string[];
81
+ /**
82
+ * Compute the drift report from the live tool surface + the curated wire map +
83
+ * the PHP-accepted manifest. Pure — no I/O.
84
+ */
85
+ export declare function computeDrift(liveTools: readonly string[], manifest: PhpAcceptedManifest): DriftReport;