@wootsup/mcp 0.1.0 → 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 (131) hide show
  1. package/CHANGELOG.md +148 -83
  2. package/README.md +31 -27
  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.js +97 -22
  11. package/dist/index.js.map +1 -1
  12. package/dist/install-skill.js +1 -1
  13. package/dist/modules/apimapper/cache.js +25 -17
  14. package/dist/modules/apimapper/cache.js.map +1 -1
  15. package/dist/modules/apimapper/client.d.ts +62 -1
  16. package/dist/modules/apimapper/client.js +555 -291
  17. package/dist/modules/apimapper/client.js.map +1 -1
  18. package/dist/modules/apimapper/connections.js +230 -75
  19. package/dist/modules/apimapper/connections.js.map +1 -1
  20. package/dist/modules/apimapper/credential-sanitizer.d.ts +5 -0
  21. package/dist/modules/apimapper/credential-sanitizer.js +60 -1
  22. package/dist/modules/apimapper/credential-sanitizer.js.map +1 -1
  23. package/dist/modules/apimapper/credentials.js +19 -47
  24. package/dist/modules/apimapper/credentials.js.map +1 -1
  25. package/dist/modules/apimapper/diagnose.js +21 -2
  26. package/dist/modules/apimapper/diagnose.js.map +1 -1
  27. package/dist/modules/apimapper/flows.js +60 -77
  28. package/dist/modules/apimapper/flows.js.map +1 -1
  29. package/dist/modules/apimapper/gateway/advanced-tool.js +56 -5
  30. package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -1
  31. package/dist/modules/apimapper/gateway/essentials.d.ts +1 -1
  32. package/dist/modules/apimapper/gateway/essentials.js +8 -1
  33. package/dist/modules/apimapper/gateway/essentials.js.map +1 -1
  34. package/dist/modules/apimapper/get-skill.d.ts +1 -1
  35. package/dist/modules/apimapper/get-skill.js +44 -6
  36. package/dist/modules/apimapper/get-skill.js.map +1 -1
  37. package/dist/modules/apimapper/graph.js +40 -36
  38. package/dist/modules/apimapper/graph.js.map +1 -1
  39. package/dist/modules/apimapper/index.js +2 -0
  40. package/dist/modules/apimapper/index.js.map +1 -1
  41. package/dist/modules/apimapper/library.js +425 -83
  42. package/dist/modules/apimapper/library.js.map +1 -1
  43. package/dist/modules/apimapper/license.js +12 -36
  44. package/dist/modules/apimapper/license.js.map +1 -1
  45. package/dist/modules/apimapper/local-sources.js +20 -34
  46. package/dist/modules/apimapper/local-sources.js.map +1 -1
  47. package/dist/modules/apimapper/misc.js +13 -27
  48. package/dist/modules/apimapper/misc.js.map +1 -1
  49. package/dist/modules/apimapper/onboarding.d.ts +30 -1
  50. package/dist/modules/apimapper/onboarding.js +114 -19
  51. package/dist/modules/apimapper/onboarding.js.map +1 -1
  52. package/dist/modules/apimapper/schema.js +9 -18
  53. package/dist/modules/apimapper/schema.js.map +1 -1
  54. package/dist/modules/apimapper/settings.js +49 -52
  55. package/dist/modules/apimapper/settings.js.map +1 -1
  56. package/dist/modules/apimapper/sites-tools.d.ts +29 -0
  57. package/dist/modules/apimapper/sites-tools.js +165 -0
  58. package/dist/modules/apimapper/sites-tools.js.map +1 -0
  59. package/dist/modules/apimapper/tool-result.d.ts +46 -0
  60. package/dist/modules/apimapper/tool-result.js +63 -0
  61. package/dist/modules/apimapper/tool-result.js.map +1 -0
  62. package/dist/modules/apimapper/toolslist-size.d.ts +11 -10
  63. package/dist/modules/apimapper/toolslist-size.js +16 -14
  64. package/dist/modules/apimapper/toolslist-size.js.map +1 -1
  65. package/dist/modules/apimapper/types.d.ts +21 -0
  66. package/dist/modules/apimapper/types.js.map +1 -1
  67. package/dist/modules/apimapper/whitelist-drift.d.ts +85 -0
  68. package/dist/modules/apimapper/whitelist-drift.js +360 -0
  69. package/dist/modules/apimapper/whitelist-drift.js.map +1 -0
  70. package/dist/modules/apimapper/workflows.js +82 -27
  71. package/dist/modules/apimapper/workflows.js.map +1 -1
  72. package/dist/modules/apimapper/yootheme-binding.d.ts +35 -0
  73. package/dist/modules/apimapper/yootheme-binding.js +186 -0
  74. package/dist/modules/apimapper/yootheme-binding.js.map +1 -0
  75. package/dist/platform/index.d.ts +56 -0
  76. package/dist/platform/index.js +151 -2
  77. package/dist/platform/index.js.map +1 -1
  78. package/dist/setup/detect-clients.d.ts +40 -1
  79. package/dist/setup/detect-clients.js +148 -1
  80. package/dist/setup/detect-clients.js.map +1 -1
  81. package/dist/setup/probe-handshake.js +40 -7
  82. package/dist/setup/probe-handshake.js.map +1 -1
  83. package/dist/setup/remove-config.d.ts +8 -0
  84. package/dist/setup/remove-config.js +145 -0
  85. package/dist/setup/remove-config.js.map +1 -0
  86. package/dist/setup/uninstall.d.ts +34 -0
  87. package/dist/setup/uninstall.js +147 -0
  88. package/dist/setup/uninstall.js.map +1 -0
  89. package/dist/setup-cli.d.ts +7 -0
  90. package/dist/setup-cli.js +29 -1
  91. package/dist/setup-cli.js.map +1 -1
  92. package/dist/sites/loader.d.ts +41 -0
  93. package/dist/sites/loader.js +119 -0
  94. package/dist/sites/loader.js.map +1 -0
  95. package/dist/sites/schema.d.ts +69 -0
  96. package/dist/sites/schema.js +71 -0
  97. package/dist/sites/schema.js.map +1 -0
  98. package/dist/sites/secret-resolver.d.ts +47 -0
  99. package/dist/sites/secret-resolver.js +150 -0
  100. package/dist/sites/secret-resolver.js.map +1 -0
  101. package/dist/skill-instructions.d.ts +1 -1
  102. package/dist/skill-instructions.js +5 -0
  103. package/dist/skill-instructions.js.map +1 -1
  104. package/dist/transports/stdio.js +4 -4
  105. package/dist/transports/stdio.js.map +1 -1
  106. package/dist/uninstall-skill.d.ts +27 -0
  107. package/dist/uninstall-skill.js +89 -0
  108. package/dist/uninstall-skill.js.map +1 -0
  109. package/docs/architecture.md +21 -21
  110. package/docs/customgraph-internal-migration.md +4 -4
  111. package/docs/security.md +2 -21
  112. package/docs/tools.md +40 -12
  113. package/manifest.json +77 -79
  114. package/package.json +68 -65
  115. package/skills/apimapper/SKILL.md +53 -7
  116. package/skills/apimapper/reference/conditional-style-multi-items.md +114 -0
  117. package/skills/apimapper/reference/jmespath-pitfalls.md +108 -0
  118. package/skills/apimapper/reference/joomla.md +1 -1
  119. package/skills/apimapper/reference/library-template-discovery.md +65 -0
  120. package/skills/apimapper/reference/merge-two-sources-on-key.md +99 -0
  121. package/skills/apimapper/reference/troubleshooting.md +20 -0
  122. package/skills/apimapper/reference/yootheme.md +1 -1
  123. package/dist/auth/oauth-provider.d.ts +0 -68
  124. package/dist/auth/oauth-provider.js +0 -232
  125. package/dist/auth/oauth-provider.js.map +0 -1
  126. package/dist/server-http.d.ts +0 -22
  127. package/dist/server-http.js +0 -159
  128. package/dist/server-http.js.map +0 -1
  129. package/dist/transports/http.d.ts +0 -29
  130. package/dist/transports/http.js +0 -267
  131. package/dist/transports/http.js.map +0 -1
@@ -0,0 +1,108 @@
1
+ # JMESPath Pitfalls
2
+
3
+ The nine traps that bite every Transform JMESPath expression in API Mapper, plus the date-primitive functions added in 2.0.8 that finally make weekday-name ↔ ISO-datetime joins tractable.
4
+
5
+ ## The 9 traps
6
+
7
+ 1. **Top-level vs item-level scope.** A flat `[].name` projects across items; bare `name` reads the wrapper object. Mixing the two is the most common cause of `null` everywhere.
8
+ 2. **Implicit numeric coercion.** `[?price > 100]` reads `price` as a string when the API returns a string. Cast first with `to_number(price) > \`100\`` or normalize upstream.
9
+ 3. **`@` vs nothing.** Inside multi-select hashes the `@` refers to the current item — `{name: @.name}` is shorthand. Forgetting `@` inside a filter expression (`[?@.x == 'y']`) is silently parsed as a function call.
10
+ 4. **String-quoted literals.** JSON literals use backticks: `\`100\``, `\`true\``, `\`null\``. Single-quoted strings (`'red'`) are raw strings. Mixing them up yields lexer errors that the engine reports far from the actual typo.
11
+ 5. **`null` propagation through pipes.** `items | [].name | [?contains(@, 'foo')]` returns `null` (not `[]`) when an item has no `name`. Wrap with `coalesce_empty(@, '')` or filter `not_null(@)`.
12
+ 6. **`length()` on null.** Vendor `length(null)` throws. Use `length(@.items || \`[]\`)` to default.
13
+ 7. **Backslash-escapes inside raw strings.** Single-quoted strings do NOT honour `\n` / `\t`. To embed a literal `'` use `'\\''` (close, escape, open).
14
+ 8. **Empty-array vs missing-key.** `[?tags]` keeps items whose `tags` is non-empty AND non-null. To match items with the *key* present regardless of value, use `[?contains(keys(@), 'tags')]`.
15
+ 9. **Multi-projection collapse on header-skip slices.** `[1:][*].{weekday: [0], open: [1]}` looks like "slice off the header row, then map each remaining row into a hash", but JMESPath parses `[1:][*]` as a *chained multi-projection* that flattens row boundaries before the hash runs. The fix is one pipe: `[1:] | [*].{weekday: [0], open: [1]}`. See "Symptom / Cause / Fix" below.
16
+
17
+ ### Pitfall 9 in detail (header-skip slice → hash projection)
18
+
19
+ **Symptom.** Output schema auto-detection returns flat columns prefixed with the row index, like:
20
+
21
+ ```
22
+ 0_weekday, 0_open, 0_close,
23
+ 1_weekday, 1_open, 1_close,
24
+ 2_weekday, 2_open, 2_close, ...
25
+ ```
26
+
27
+ Each row also reads as `null` in the actual data preview. Every binding in the Multi-Items element lands on the wrapper object instead of the row.
28
+
29
+ **Cause.** `[1:][*]` is two consecutive projections. JMESPath flattens them: the inner array index dissolves, so the trailing `.{weekday: [0], ...}` operates on the wrapper object's positional slots, not on each row. The auto-detected schema reflects that flattened shape.
30
+
31
+ **Fix.** Insert a pipe between the slice and the hash projection so the second stage starts fresh:
32
+
33
+ ```jmespath
34
+ # Working — pipe resets the projection so [*] iterates row-by-row
35
+ [1:] | [*].{
36
+ weekday: [0],
37
+ open: [1],
38
+ close: [2]
39
+ }
40
+ ```
41
+
42
+ This recipe is the canonical shape for "Google Sheets export with a header row" sources. If you find yourself debugging `0_*` / `1_*` / `2_*` column names in the YOOtheme source field picker, this is almost always the cause.
43
+
44
+ ## Date-primitive functions (new in 2.0.8)
45
+
46
+ JMESPath has no built-in date support. API Mapper ships four custom date primitives so weekday-name ↔ ISO-datetime joins (Calendly → Sheet schedule, HubSpot meeting-times → office-hours, etc.) become possible without exporting to a sidecar service.
47
+
48
+ | Function | Signature | Returns |
49
+ |----------|-----------|---------|
50
+ | `date_weekday` | `date_weekday(iso_string [, tz])` | English weekday name `"Monday"`..`"Sunday"`, or `null` on bad input |
51
+ | `date_iso_to_time` | `date_iso_to_time(iso_string [, tz])` | `"HH:MM"` 24-hour time, or `null` |
52
+ | `date_iso_to_date` | `date_iso_to_date(iso_string [, tz])` | `"YYYY-MM-DD"` calendar date, or `null` |
53
+ | `time_in_window` | `time_in_window(time, from, to)` | `true` if `time` is in `[from, to)`. Supports cross-midnight when `from > to`. `false` on any malformed input |
54
+
55
+ ### Timezone rules
56
+
57
+ - `tz` is an IANA timezone string (`"Europe/Berlin"`, `"America/New_York"`, `"UTC"`).
58
+ - If `tz` is omitted, the offset already encoded in the input string is preserved. A Calendly payload `"2026-06-04T09:00:00+02:00"` returns `"09:00"` from `date_iso_to_time(@, )` (no second arg) — i.e. the customer's local time.
59
+ - If `tz` IS supplied, the datetime is shifted into that zone first.
60
+ - An unknown timezone (typo, mistaken country code) returns `null`. This is the same graceful-failure mode as malformed datetimes — one bad row never crashes the flow.
61
+
62
+ ### The Maria recipe (Calendly + Sheet weekday-join)
63
+
64
+ ```
65
+ # Source A — Calendly available_times
66
+ [].{
67
+ day: date_weekday(start_time, 'Europe/Berlin'),
68
+ local_time: date_iso_to_time(start_time, 'Europe/Berlin'),
69
+ start_time: start_time
70
+ }
71
+ ```
72
+
73
+ Now each Calendly slot carries a Sheet-comparable `day` (e.g. `"Wednesday"`) AND a comparable `local_time` (e.g. `"09:30"`). See `merge-two-sources-on-key` for the full join pattern.
74
+
75
+ ### Slot-against-business-hours filter
76
+
77
+ ```
78
+ [?time_in_window(date_iso_to_time(start_time, 'Europe/Berlin'),
79
+ '09:00', '17:00')]
80
+ ```
81
+
82
+ Cross-midnight windows (bars, support shifts):
83
+
84
+ ```
85
+ [?time_in_window(local_time, '22:00', '02:00')] # 10pm..2am
86
+ ```
87
+
88
+ ## Depth-cap warning
89
+
90
+ JMESPath expression depth is capped at **10 levels** of bracket / pipe nesting. Above that, the engine returns `expression too deeply nested (N levels)`.
91
+
92
+ **As of 2.0.8 this is caught at flow-write time** (HTTP 422 on `flow_create` / `flow_update`) with per-node `jmespathErrors`. The response payload looks like:
93
+
94
+ ```json
95
+ {
96
+ "success": false,
97
+ "error": "1 JMESPath expression exceeded the depth limit of 10",
98
+ "jmespathErrors": { "t1": "JMESPath expression too deeply nested (13 levels). Maximum: 10" },
99
+ "status": 422
100
+ }
101
+ ```
102
+
103
+ If you hit this, the cure is almost always to split the expression into TWO transform nodes piped together — that resets the depth counter and is easier to debug.
104
+
105
+ ## See also
106
+
107
+ - `merge-two-sources-on-key` — joining two sources on a shared key, with date-primitive bridging.
108
+ - `troubleshooting` — broader error triage.
@@ -70,7 +70,7 @@ Joomla extensions install as a `.zip` (system plugin). The MCP server bundles a
70
70
  To verify the plugin is loaded:
71
71
  ```
72
72
  apimapper_health
73
- # → { platform: "joomla", version: "2.0.7", plugin: "enabled" }
73
+ # → { platform: "joomla", version: "2.0.13", plugin: "enabled" }
74
74
  ```
75
75
 
76
76
  If `plugin: "disabled"`, enable via Joomla admin → Extensions → Plugins → search "API Mapper".
@@ -0,0 +1,65 @@
1
+ # Library template discovery
2
+
3
+ Inspect a library template's contract BEFORE you activate it, so the connection
4
+ lands fully configured the first time.
5
+
6
+ ## Why this matters
7
+
8
+ The library is the mandatory first stop for any new API (see the library-first
9
+ guard below). But before you call `apimapper_library_activate`, you want to know
10
+ what the template actually declares: which base URL and endpoints it ships, which
11
+ auth scheme it needs, and which placeholder values (`extra_fields`) you must pass.
12
+ Activating blind is the single most common cause of an empty source that is hard
13
+ to debug from downstream tool calls.
14
+
15
+ ## The discovery sequence
16
+
17
+ ```
18
+ apimapper_library_featured({}) # 1. the curated short-list
19
+ apimapper_library_list({ query: '<api-name>' }) # 2. search the full catalog by name
20
+ apimapper_library_connection_detail({ id: '<id>' }) # 3. read the template's full contract
21
+ apimapper_credential_list({}) # 4. find a matching credential (auth-protected templates)
22
+ apimapper_library_activate({ id, credential_id, extra_fields }) # 5. activate, fully configured
23
+ ```
24
+
25
+ Steps 1-2 are routed first-class; step 3 routes through the gateway:
26
+ `apimapper_advanced({ tool: 'apimapper_library_connection_detail', arguments: { id } })`.
27
+
28
+ ## What `library_connection_detail` tells you
29
+
30
+ Read these fields off the returned template before activating:
31
+
32
+ | Field | What to do with it |
33
+ |-------|--------------------|
34
+ | `base_url` | The upstream host. Confirms which API the template targets. |
35
+ | `endpoints` | The named requests the template ships (list/detail/search). The activated connection exposes these. |
36
+ | `auth` scheme | `none`, `bearer`, `api_key`, or `oauth`. Tells you whether step 4 (credential) is required. |
37
+ | `extra_fields` | The placeholder values YOU must supply at activation time (e.g. `spreadsheet_id` for Google Sheets, `api_key` for Pexels). Required `extra_fields` left unset land a broken connection. |
38
+
39
+ ## Then activate, not create
40
+
41
+ Once you have read the contract:
42
+
43
+ - **Auth-protected template** (Google Sheets, Notion, Airtable, Pexels,
44
+ OpenWeatherMap, Calendly, GitHub, ...): call `apimapper_credential_list({})`
45
+ first, then pass the right `credential_id` explicitly to `library_activate`.
46
+ The activation auto-links a credential only when exactly ONE matching one
47
+ exists for the provider; otherwise it returns a structured
48
+ `credential_required` / `credential_ambiguous` error listing the candidates.
49
+ - Pass any required `extra_fields` the template declared in step 3.
50
+
51
+ ## The library-first guard (why you discover instead of hand-rolling)
52
+
53
+ `apimapper_connection_create` is the fallback for niche or unknown APIs ONLY. The
54
+ server enforces this: a custom `connection_create` whose endpoint host is covered
55
+ by a curated template is rejected with HTTP 409 `error_code:
56
+ library_template_available`. The error names the template and the exact
57
+ `apimapper_library_activate({ id })` call to run instead, with a structured
58
+ `library_suggestion`. Always inspect-then-activate before reaching for a custom
59
+ connection.
60
+
61
+ ## Cross-references
62
+
63
+ - `apimapper_get_skill({ topic: 'getting-started' })` — Step 1 (mandatory): check the library first.
64
+ - `apimapper_get_skill({ topic: 'oauth' })` — wiring OAuth-protected templates.
65
+ - `apimapper_library_connection_detail` — the tool this topic is about.
@@ -0,0 +1,99 @@
1
+ # Merge two sources on a shared key
2
+
3
+ Join items from two sources on a shared key, optionally filter the join, surface the result as one Source for YOOtheme.
4
+
5
+ ## When to use
6
+
7
+ - You have two APIs whose rows belong together but live behind separate endpoints (orders + customers, Calendly slots + Sheet schedule, GitHub issues + sprint planning).
8
+ - The keys you want to join on either (a) are already string-equal, or (b) need a small Transform to be made comparable (e.g. ISO datetime → weekday name).
9
+
10
+ ## The canonical recipe
11
+
12
+ ```
13
+ Source-A ─┐
14
+ ├─► Merge (mode: join, key: <field>) ─► Filter ─► Output
15
+ Source-B ─┘
16
+ ```
17
+
18
+ 1. Drag both Source nodes onto the canvas, wire them up.
19
+ 2. Drag a Merge node between them. Set:
20
+ - `mode: join` — emit one row per Source-A item, with Source-B fields nested under `b`.
21
+ - `key`: the field name present on BOTH sides (e.g. `weekday`).
22
+ 3. (Optional) drag a Filter node after Merge — typical predicate uses both A- and B-side fields.
23
+ 4. Wire to Output (YOOtheme Source) and Publish.
24
+
25
+ ## When the keys aren't string-equal — date-primitive bridging
26
+
27
+ This is the case Cold-AI #5 walk-through hit: Calendly emits `start_time` as ISO-UTC (`"2026-06-04T09:00:00+00:00"`), but the customer's Sheet schedule is keyed on weekday names (`"Wednesday"`). The keys aren't comparable as-is.
28
+
29
+ **Fix:** insert a Transform node BEFORE Merge on the Calendly side that derives a Sheet-compatible key.
30
+
31
+ ### Maria's flow (Calendly + Google Sheet schedule)
32
+
33
+ ```
34
+ Calendly available_times ─► Transform (project day+local_time) ─┐
35
+ ├─► Merge (key: day) ─► Filter ─► Output
36
+ Google Sheet schedule ──────────────────────────────────────┘
37
+ ```
38
+
39
+ #### Step 1 — Transform on the Calendly side
40
+
41
+ ```
42
+ [].{
43
+ day: date_weekday(start_time, 'Europe/Berlin'),
44
+ local_time: date_iso_to_time(start_time, 'Europe/Berlin'),
45
+ start_time: start_time
46
+ }
47
+ ```
48
+
49
+ Each Calendly row now carries:
50
+
51
+ | field | value |
52
+ |-------|-------|
53
+ | `day` | `"Wednesday"` — Sheet-comparable |
54
+ | `local_time` | `"09:00"` — comparable to Sheet's `open`/`close` |
55
+ | `start_time` | original ISO datetime (preserved for downstream rendering) |
56
+
57
+ #### Step 2 — Merge on `day`
58
+
59
+ Merge mode `join`, key `day`. Sheet row arrives as `b` on each Calendly row:
60
+
61
+ ```json
62
+ {
63
+ "day": "Wednesday",
64
+ "local_time": "09:00",
65
+ "start_time": "2026-06-03T07:00:00+00:00",
66
+ "b": { "weekday": "Wednesday", "open": "09:00", "close": "17:00" }
67
+ }
68
+ ```
69
+
70
+ #### Step 3 — Filter to slots inside business hours
71
+
72
+ ```
73
+ [?time_in_window(local_time, b.open, b.close)]
74
+ ```
75
+
76
+ `time_in_window` is left-closed, right-open ([from, to)) — a 17:00 close-time does NOT include a 17:00 slot. Cross-midnight windows (e.g. bar `22:00..02:00`) are also handled.
77
+
78
+ #### Step 4 — Output
79
+
80
+ Wire to a YOOtheme Output. Slots that survive Steps 1-3 become the rows of a YOOtheme Source named e.g. `BookableSlots`.
81
+
82
+ ## Other date-bridge patterns
83
+
84
+ | Customer scenario | Source-A key | Source-B key | Bridge |
85
+ |-------------------|--------------|--------------|--------|
86
+ | HubSpot meetings ↔ office-hours | ISO datetime | weekday name | `date_weekday(@.start, tz)` |
87
+ | Stripe invoices ↔ month-rollup | ISO datetime | `"YYYY-MM"` | `substring(date_iso_to_date(@.created, tz), 0, 7)` |
88
+ | GitHub issues ↔ daily-standup notes | ISO datetime | `"YYYY-MM-DD"` | `date_iso_to_date(@.updated_at, tz)` |
89
+
90
+ ## Pitfalls
91
+
92
+ - **Timezone matters.** A slot at `2026-06-04T23:30:00Z` is Wednesday in UTC but Thursday in Berlin. Always supply the second `tz` arg matching the customer's business timezone.
93
+ - **`null` rows propagate.** A Calendly row with a malformed `start_time` projects to `{day: null, local_time: null, start_time: <bad>}`. The Merge will silently emit it under a `null` key — pre-filter with `[?day]` if you need to drop them.
94
+ - **Depth limit.** Don't try to do the whole projection + merge + filter inside ONE expression. JMESPath caps depth at 10. Two transform nodes piped is cleaner and stays under the limit.
95
+
96
+ ## See also
97
+
98
+ - `jmespath-pitfalls` — full pitfall catalogue + date-primitive function reference.
99
+ - `yootheme` — how the published Source appears in YOOtheme Builder.
@@ -79,6 +79,26 @@ If `apimapper_diagnose` is unavailable in your version, run the manual checks be
79
79
  ### "Source not appearing in YOOtheme Builder"
80
80
  - Flow is saved but not **published**. See `skill://apimapper/yootheme` step 4.
81
81
 
82
+ ### "YOOtheme Builder source list missing newly-published flow"
83
+
84
+ Symptom: A flow was just published with `apimapper_flow_full_recompile_publish`, but
85
+ YOOtheme Builder's source dropdown (or `yootheme_builder_sources_list` from the
86
+ sibling MCP) doesn't show it. The schema cache went stale.
87
+
88
+ Fix (one of):
89
+
90
+ - `apimapper_cache_invalidate({ scope: "yootheme.schema" })` — explicit flush of the
91
+ YOOtheme GraphQL schema cache files (`schema-*.{php,gql,error.gql}`). Direct-file
92
+ surface, bypasses the InvalidationBus.
93
+ - `apimapper_flow_full_recompile_publish({ id: ..., autofix: true })` — re-publish
94
+ with autofix. Since 2.0.8 (Wave-12 F8) this clears the schema-`.php`/`.gql`/`.error.gql`
95
+ triplets correctly.
96
+
97
+ Root cause was a glob-pattern gap in `YOOthemeSchemaCacheBuster` pre-2.0.8 — the
98
+ `.gql` file was the source-of-truth for YT's `LoadSourceSchema::handle()`, but only
99
+ `.php` files were unlinked. The `yootheme.schema` scope is the manual escape hatch
100
+ for customers still on cached state from before the fix landed.
101
+
82
102
  ### "Source shows but fields are empty"
83
103
  - Field-name case mismatch. YOOtheme expects lowercase keys.
84
104
  - Fix: Transform projection should lowercase: `[*].{title: name, image: cover_url}`.
@@ -81,7 +81,7 @@ Same flow can ALSO emit a Shortcode output (`output_type="shortcode"`). Use this
81
81
  - Using outside YOOtheme (page builders, plugins)
82
82
  - Quick previews in admin
83
83
 
84
- Shortcode currently supports a subset of the YOOtheme render-time features. See `wootsup.com/docs/mcp/` (the shortcode subpage will land in Phase 2 — track via GitHub issues).
84
+ Shortcode currently supports a subset of the YOOtheme render-time features. See `https://wootsup.com/docs/mcp/api-mapper/` (the shortcode subpage will land in a later release).
85
85
 
86
86
  ## Common pitfalls
87
87
 
@@ -1,68 +0,0 @@
1
- export interface OAuthClientRegistration {
2
- client_id: string;
3
- client_id_issued_at: number;
4
- redirect_uris: string[];
5
- client_name?: string;
6
- token_endpoint_auth_method: "none";
7
- grant_types: ["authorization_code", "refresh_token"];
8
- response_types: ["code"];
9
- }
10
- export interface IssueCodeArgs {
11
- client_id: string;
12
- redirect_uri: string;
13
- code_challenge: string;
14
- code_challenge_method: "S256" | "plain";
15
- scope: string;
16
- state?: string;
17
- }
18
- export interface ExchangeCodeArgs {
19
- client_id: string;
20
- code: string;
21
- redirect_uri: string;
22
- code_verifier: string;
23
- }
24
- export interface RefreshArgs {
25
- client_id: string;
26
- refresh_token: string;
27
- }
28
- export interface TokenResponse {
29
- access_token: string;
30
- token_type: "Bearer";
31
- expires_in: number;
32
- refresh_token: string;
33
- scope: string;
34
- }
35
- export interface AccessTokenInfo {
36
- client_id: string;
37
- scope: string;
38
- expires_at: number;
39
- }
40
- export interface OAuthProviderOptions {
41
- /** Clock function returning unix seconds. Default: Date.now()/1000. */
42
- now?: () => number;
43
- /** Authorization code TTL (default 600s = 10 min). */
44
- codeTtlSeconds?: number;
45
- /** Access token TTL (default 86400s = 24 h). */
46
- tokenTtlSeconds?: number;
47
- /** Refresh token TTL (default 604800s = 7 d). */
48
- refreshTtlSeconds?: number;
49
- }
50
- export interface OAuthProvider {
51
- registerClient(args: {
52
- redirect_uris: string[];
53
- client_name?: string;
54
- }): OAuthClientRegistration;
55
- getClient(client_id: string): OAuthClientRegistration | null;
56
- issueCode(args: IssueCodeArgs): string;
57
- exchangeCode(args: ExchangeCodeArgs): TokenResponse;
58
- refreshToken(args: RefreshArgs): TokenResponse;
59
- verifyAccessToken(token: string): AccessTokenInfo | null;
60
- sweep(): number;
61
- stats(): {
62
- clients: number;
63
- codes: number;
64
- tokens: number;
65
- refreshes: number;
66
- };
67
- }
68
- export declare function createOAuthProvider(options?: OAuthProviderOptions): OAuthProvider;
@@ -1,232 +0,0 @@
1
- // src/auth/oauth-provider.ts — Phase 9.2.
2
- //
3
- // Minimal in-memory OAuth 2.0 Authorization-Code + PKCE + Dynamic Client
4
- // Registration (DCR) provider for the remote HTTP MCP transport.
5
- //
6
- // References:
7
- // - RFC 6749 (OAuth 2.0)
8
- // - RFC 7636 (PKCE)
9
- // - RFC 7591 (Dynamic Client Registration)
10
- // - workers-oauth-provider (Cloudflare reference, in-memory variant)
11
- //
12
- // Storage backend is process-local Maps with TTL-based expiry — the
13
- // hosted production service (mcp.wootsup.com) is expected to swap in a
14
- // persistent backend, but for unit/integration tests + the local DXT
15
- // bundle, in-memory is sufficient.
16
- //
17
- // Security notes:
18
- // - Tokens are 32 random bytes hex-encoded (no JWT — keeps the surface
19
- // tiny and prevents misuse of unverified payloads).
20
- // - Authorization codes are 32 random bytes hex; single-use; bound to
21
- // client_id + redirect_uri + code_challenge.
22
- // - PKCE S256 is REQUIRED; "plain" is rejected.
23
- // - On refresh, the old refresh token is invalidated (rotation).
24
- import { randomBytes, createHash, timingSafeEqual } from "node:crypto";
25
- // ── Helpers ────────────────────────────────────────────────────────────
26
- function randomId(prefix) {
27
- return `${prefix}${randomBytes(12).toString("hex")}`;
28
- }
29
- function randomOpaque() {
30
- return randomBytes(32).toString("hex");
31
- }
32
- /** Constant-time compare to thwart timing oracles on token / verifier lookups. */
33
- function safeEquals(a, b) {
34
- const ba = Buffer.from(a);
35
- const bb = Buffer.from(b);
36
- if (ba.length !== bb.length)
37
- return false;
38
- return timingSafeEqual(ba, bb);
39
- }
40
- function s256(input) {
41
- return createHash("sha256").update(input).digest("base64url");
42
- }
43
- // ── Factory ────────────────────────────────────────────────────────────
44
- export function createOAuthProvider(options = {}) {
45
- const now = options.now ?? (() => Math.floor(Date.now() / 1000));
46
- const codeTtl = options.codeTtlSeconds ?? 600;
47
- const tokenTtl = options.tokenTtlSeconds ?? 86_400;
48
- const refreshTtl = options.refreshTtlSeconds ?? 7 * 86_400;
49
- const clients = new Map();
50
- const codes = new Map();
51
- const tokens = new Map();
52
- const refreshes = new Map();
53
- function registerClient(args) {
54
- if (!Array.isArray(args.redirect_uris) || args.redirect_uris.length === 0) {
55
- throw new Error("invalid_redirect_uri: at least one redirect_uri required");
56
- }
57
- for (const uri of args.redirect_uris) {
58
- if (typeof uri !== "string" || uri.length === 0) {
59
- throw new Error("invalid_redirect_uri");
60
- }
61
- }
62
- const reg = {
63
- client_id: randomId("cli_"),
64
- client_id_issued_at: now(),
65
- redirect_uris: [...args.redirect_uris],
66
- client_name: args.client_name,
67
- token_endpoint_auth_method: "none", // public client (mobile/native/AI)
68
- grant_types: ["authorization_code", "refresh_token"],
69
- response_types: ["code"],
70
- };
71
- clients.set(reg.client_id, reg);
72
- return reg;
73
- }
74
- function getClient(client_id) {
75
- return clients.get(client_id) ?? null;
76
- }
77
- function issueCode(args) {
78
- const client = clients.get(args.client_id);
79
- if (!client)
80
- throw new Error("unknown_client");
81
- if (!client.redirect_uris.includes(args.redirect_uri)) {
82
- throw new Error("invalid_redirect_uri");
83
- }
84
- if (!args.code_challenge || typeof args.code_challenge !== "string") {
85
- throw new Error("invalid_request: code_challenge required");
86
- }
87
- if (args.code_challenge_method !== "S256") {
88
- // Reject "plain" — S256 is mandatory for safety.
89
- throw new Error("invalid_request: code_challenge_method must be S256");
90
- }
91
- const code = randomId("code_");
92
- codes.set(code, {
93
- client_id: args.client_id,
94
- redirect_uri: args.redirect_uri,
95
- code_challenge: args.code_challenge,
96
- code_challenge_method: args.code_challenge_method,
97
- scope: args.scope,
98
- expires_at: now() + codeTtl,
99
- used: false,
100
- });
101
- return code;
102
- }
103
- function exchangeCode(args) {
104
- const rec = codes.get(args.code);
105
- if (!rec)
106
- throw new Error("invalid_grant: code not found");
107
- if (rec.used)
108
- throw new Error("invalid_grant: code already used");
109
- if (rec.expires_at < now())
110
- throw new Error("invalid_grant: code expired");
111
- if (rec.client_id !== args.client_id) {
112
- throw new Error("invalid_grant: client_id mismatch");
113
- }
114
- if (rec.redirect_uri !== args.redirect_uri) {
115
- throw new Error("invalid_grant: redirect_uri mismatch");
116
- }
117
- const challengeFromVerifier = s256(args.code_verifier);
118
- if (!safeEquals(challengeFromVerifier, rec.code_challenge)) {
119
- throw new Error("invalid_grant: code_verifier mismatch");
120
- }
121
- rec.used = true;
122
- const accessToken = randomOpaque();
123
- const refreshToken = randomOpaque();
124
- tokens.set(accessToken, {
125
- client_id: rec.client_id,
126
- scope: rec.scope,
127
- expires_at: now() + tokenTtl,
128
- });
129
- refreshes.set(refreshToken, {
130
- client_id: rec.client_id,
131
- scope: rec.scope,
132
- expires_at: now() + refreshTtl,
133
- revoked: false,
134
- });
135
- return {
136
- access_token: accessToken,
137
- refresh_token: refreshToken,
138
- token_type: "Bearer",
139
- expires_in: tokenTtl,
140
- scope: rec.scope,
141
- };
142
- }
143
- function refreshToken(args) {
144
- const rec = refreshes.get(args.refresh_token);
145
- if (!rec)
146
- throw new Error("invalid_grant: refresh_token not found");
147
- if (rec.revoked)
148
- throw new Error("invalid_grant: refresh_token revoked");
149
- if (rec.expires_at < now()) {
150
- throw new Error("invalid_grant: refresh_token expired");
151
- }
152
- if (rec.client_id !== args.client_id) {
153
- throw new Error("invalid_grant: client_id mismatch");
154
- }
155
- // Rotate: revoke the old refresh token, mint a new pair.
156
- rec.revoked = true;
157
- const accessToken = randomOpaque();
158
- const newRefresh = randomOpaque();
159
- tokens.set(accessToken, {
160
- client_id: rec.client_id,
161
- scope: rec.scope,
162
- expires_at: now() + tokenTtl,
163
- });
164
- refreshes.set(newRefresh, {
165
- client_id: rec.client_id,
166
- scope: rec.scope,
167
- expires_at: now() + refreshTtl,
168
- revoked: false,
169
- });
170
- return {
171
- access_token: accessToken,
172
- refresh_token: newRefresh,
173
- token_type: "Bearer",
174
- expires_in: tokenTtl,
175
- scope: rec.scope,
176
- };
177
- }
178
- function verifyAccessToken(token) {
179
- const rec = tokens.get(token);
180
- if (!rec)
181
- return null;
182
- if (rec.expires_at < now())
183
- return null;
184
- return {
185
- client_id: rec.client_id,
186
- scope: rec.scope,
187
- expires_at: rec.expires_at,
188
- };
189
- }
190
- function sweep() {
191
- const t = now();
192
- let evicted = 0;
193
- for (const [k, v] of codes) {
194
- if (v.expires_at < t || v.used) {
195
- codes.delete(k);
196
- evicted++;
197
- }
198
- }
199
- for (const [k, v] of tokens) {
200
- if (v.expires_at < t) {
201
- tokens.delete(k);
202
- evicted++;
203
- }
204
- }
205
- for (const [k, v] of refreshes) {
206
- if (v.expires_at < t || v.revoked) {
207
- refreshes.delete(k);
208
- evicted++;
209
- }
210
- }
211
- return evicted;
212
- }
213
- function stats() {
214
- return {
215
- clients: clients.size,
216
- codes: codes.size,
217
- tokens: tokens.size,
218
- refreshes: refreshes.size,
219
- };
220
- }
221
- return {
222
- registerClient,
223
- getClient,
224
- issueCode,
225
- exchangeCode,
226
- refreshToken,
227
- verifyAccessToken,
228
- sweep,
229
- stats,
230
- };
231
- }
232
- //# sourceMappingURL=oauth-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"oauth-provider.js","sourceRoot":"","sources":["../../src/auth/oauth-provider.ts"],"names":[],"mappings":"AAAA,0CAA0C;AAC1C,EAAE;AACF,yEAAyE;AACzE,iEAAiE;AACjE,EAAE;AACF,cAAc;AACd,yBAAyB;AACzB,oBAAoB;AACpB,2CAA2C;AAC3C,qEAAqE;AACrE,EAAE;AACF,oEAAoE;AACpE,uEAAuE;AACvE,qEAAqE;AACrE,mCAAmC;AACnC,EAAE;AACF,kBAAkB;AAClB,uEAAuE;AACvE,sDAAsD;AACtD,sEAAsE;AACtE,+CAA+C;AAC/C,gDAAgD;AAChD,iEAAiE;AAEjE,OAAO,EAAE,WAAW,EAAE,U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AAC,IAAI;YACrB,KAAK,EAAE,KAAK,CAAC,IAAI;YACjB,MAAM,EAAE,MAAM,CAAC,IAAI;YACnB,SAAS,EAAE,SAAS,CAAC,IAAI;SAC1B,CAAC;IACJ,CAAC;IAED,OAAO;QACL,cAAc;QACd,SAAS;QACT,SAAS;QACT,YAAY;QACZ,YAAY;QACZ,iBAAiB;QACjB,KAAK;QACL,KAAK;KACN,CAAC;AACJ,CAAC"}
@@ -1,22 +0,0 @@
1
- #!/usr/bin/env node
2
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
- import { type ModuleStatus } from "@getimo/mcp-toolkit";
4
- import { type McpHandler, type HttpTransportServer } from "./transports/http.js";
5
- import { type OAuthProvider } from "./auth/oauth-provider.js";
6
- export interface BootOptions {
7
- /** TCP port. Default: process.env.APIMAPPER_HTTP_PORT or 8901. */
8
- port?: number;
9
- /** Public URL hint for OAuth metadata. */
10
- publicBaseUrl?: string;
11
- /** Pluggable MCP handler — defaults to a stub that returns the original JSON-RPC id with an empty result. */
12
- mcpHandler?: McpHandler;
13
- }
14
- export interface BootedHttpServer extends HttpTransportServer {
15
- oauth: OAuthProvider;
16
- }
17
- /** Test-only — exposes the server + module load status for assertions. */
18
- export declare function _testGetMcpServer(): {
19
- server: McpServer | null;
20
- modules: ModuleStatus[];
21
- };
22
- export declare function bootHttpServer(options?: BootOptions): Promise<BootedHttpServer>;