@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.
- package/CHANGELOG.md +148 -83
- package/README.md +36 -32
- package/SECURITY.md +15 -6
- package/dist/auth/keychain.d.ts +27 -1
- package/dist/auth/keychain.js +48 -2
- package/dist/auth/keychain.js.map +1 -1
- package/dist/cli-hint.d.ts +22 -0
- package/dist/cli-hint.js +55 -0
- package/dist/cli-hint.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.js +163 -22
- package/dist/index.js.map +1 -1
- package/dist/install-skill.js +1 -1
- package/dist/modules/apimapper/cache.d.ts +2 -2
- package/dist/modules/apimapper/cache.js +119 -29
- package/dist/modules/apimapper/cache.js.map +1 -1
- package/dist/modules/apimapper/client.d.ts +102 -1
- package/dist/modules/apimapper/client.js +631 -297
- package/dist/modules/apimapper/client.js.map +1 -1
- package/dist/modules/apimapper/connections-format.d.ts +51 -0
- package/dist/modules/apimapper/connections-format.js +261 -0
- package/dist/modules/apimapper/connections-format.js.map +1 -0
- package/dist/modules/apimapper/connections-trim.d.ts +82 -0
- package/dist/modules/apimapper/connections-trim.js +224 -0
- package/dist/modules/apimapper/connections-trim.js.map +1 -0
- package/dist/modules/apimapper/connections.d.ts +14 -2
- package/dist/modules/apimapper/connections.js +612 -153
- package/dist/modules/apimapper/connections.js.map +1 -1
- package/dist/modules/apimapper/credential-sanitizer.d.ts +5 -0
- package/dist/modules/apimapper/credential-sanitizer.js +60 -1
- package/dist/modules/apimapper/credential-sanitizer.js.map +1 -1
- package/dist/modules/apimapper/credentials-format.d.ts +21 -0
- package/dist/modules/apimapper/credentials-format.js +145 -0
- package/dist/modules/apimapper/credentials-format.js.map +1 -0
- package/dist/modules/apimapper/credentials.d.ts +12 -2
- package/dist/modules/apimapper/credentials.js +226 -73
- package/dist/modules/apimapper/credentials.js.map +1 -1
- package/dist/modules/apimapper/diagnose.d.ts +54 -2
- package/dist/modules/apimapper/diagnose.js +213 -12
- package/dist/modules/apimapper/diagnose.js.map +1 -1
- package/dist/modules/apimapper/elicitation.d.ts +54 -0
- package/dist/modules/apimapper/elicitation.js +90 -0
- package/dist/modules/apimapper/elicitation.js.map +1 -0
- package/dist/modules/apimapper/flows-format.d.ts +50 -0
- package/dist/modules/apimapper/flows-format.js +318 -0
- package/dist/modules/apimapper/flows-format.js.map +1 -0
- package/dist/modules/apimapper/flows.d.ts +13 -2
- package/dist/modules/apimapper/flows.js +312 -122
- package/dist/modules/apimapper/flows.js.map +1 -1
- package/dist/modules/apimapper/gateway/advanced-tool.d.ts +9 -0
- package/dist/modules/apimapper/gateway/advanced-tool.js +265 -0
- package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -0
- package/dist/modules/apimapper/gateway/capturing-server.d.ts +81 -0
- package/dist/modules/apimapper/gateway/capturing-server.js +87 -0
- package/dist/modules/apimapper/gateway/capturing-server.js.map +1 -0
- package/dist/modules/apimapper/gateway/essentials.d.ts +4 -0
- package/dist/modules/apimapper/gateway/essentials.js +35 -0
- package/dist/modules/apimapper/gateway/essentials.js.map +1 -0
- package/dist/modules/apimapper/gateway/test-support.d.ts +17 -0
- package/dist/modules/apimapper/gateway/test-support.js +43 -0
- package/dist/modules/apimapper/gateway/test-support.js.map +1 -0
- package/dist/modules/apimapper/get-skill.d.ts +3 -3
- package/dist/modules/apimapper/get-skill.js +47 -7
- package/dist/modules/apimapper/get-skill.js.map +1 -1
- package/dist/modules/apimapper/graph-builder.js +1 -1
- package/dist/modules/apimapper/graph-builder.js.map +1 -1
- package/dist/modules/apimapper/graph.d.ts +2 -2
- package/dist/modules/apimapper/graph.js +170 -35
- package/dist/modules/apimapper/graph.js.map +1 -1
- package/dist/modules/apimapper/index.d.ts +17 -1
- package/dist/modules/apimapper/index.js +68 -17
- package/dist/modules/apimapper/index.js.map +1 -1
- package/dist/modules/apimapper/inspect.d.ts +3 -2
- package/dist/modules/apimapper/inspect.js +97 -13
- package/dist/modules/apimapper/inspect.js.map +1 -1
- package/dist/modules/apimapper/library.d.ts +2 -2
- package/dist/modules/apimapper/library.js +665 -80
- package/dist/modules/apimapper/library.js.map +1 -1
- package/dist/modules/apimapper/license-format.d.ts +22 -0
- package/dist/modules/apimapper/license-format.js +149 -0
- package/dist/modules/apimapper/license-format.js.map +1 -0
- package/dist/modules/apimapper/license.d.ts +16 -2
- package/dist/modules/apimapper/license.js +62 -38
- package/dist/modules/apimapper/license.js.map +1 -1
- package/dist/modules/apimapper/local-sources.d.ts +2 -2
- package/dist/modules/apimapper/local-sources.js +44 -30
- package/dist/modules/apimapper/local-sources.js.map +1 -1
- package/dist/modules/apimapper/misc.d.ts +30 -2
- package/dist/modules/apimapper/misc.js +114 -49
- package/dist/modules/apimapper/misc.js.map +1 -1
- package/dist/modules/apimapper/node-schema.d.ts +52 -0
- package/dist/modules/apimapper/node-schema.js +70 -2
- package/dist/modules/apimapper/node-schema.js.map +1 -1
- package/dist/modules/apimapper/normalizers.d.ts +1 -0
- package/dist/modules/apimapper/normalizers.js +51 -0
- package/dist/modules/apimapper/normalizers.js.map +1 -1
- package/dist/modules/apimapper/onboarding.d.ts +78 -3
- package/dist/modules/apimapper/onboarding.js +428 -26
- package/dist/modules/apimapper/onboarding.js.map +1 -1
- package/dist/modules/apimapper/read-cache.d.ts +31 -2
- package/dist/modules/apimapper/read-cache.js +20 -6
- package/dist/modules/apimapper/read-cache.js.map +1 -1
- package/dist/modules/apimapper/render/_shared.d.ts +24 -0
- package/dist/modules/apimapper/render/_shared.js +84 -0
- package/dist/modules/apimapper/render/_shared.js.map +1 -0
- package/dist/modules/apimapper/render/dag.d.ts +18 -0
- package/dist/modules/apimapper/render/dag.js +70 -0
- package/dist/modules/apimapper/render/dag.js.map +1 -0
- package/dist/modules/apimapper/render/index.d.ts +2 -0
- package/dist/modules/apimapper/render/index.js +112 -0
- package/dist/modules/apimapper/render/index.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/chart-bar.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/chart-bar.js +70 -0
- package/dist/modules/apimapper/render/renderers/chart-bar.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/chart-line.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/chart-line.js +71 -0
- package/dist/modules/apimapper/render/renderers/chart-line.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/diff.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/diff.js +154 -0
- package/dist/modules/apimapper/render/renderers/diff.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/flow-diagram.d.ts +1 -0
- package/dist/modules/apimapper/render/renderers/flow-diagram.js +180 -0
- package/dist/modules/apimapper/render/renderers/flow-diagram.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/json-tree.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/json-tree.js +87 -0
- package/dist/modules/apimapper/render/renderers/json-tree.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/schema-diagram.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/schema-diagram.js +83 -0
- package/dist/modules/apimapper/render/renderers/schema-diagram.js.map +1 -0
- package/dist/modules/apimapper/render/renderers/table.d.ts +2 -0
- package/dist/modules/apimapper/render/renderers/table.js +75 -0
- package/dist/modules/apimapper/render/renderers/table.js.map +1 -0
- package/dist/modules/apimapper/render/schemas.d.ts +23 -0
- package/dist/modules/apimapper/render/schemas.js +56 -0
- package/dist/modules/apimapper/render/schemas.js.map +1 -0
- package/dist/modules/apimapper/render/secret-masking.d.ts +5 -0
- package/dist/modules/apimapper/render/secret-masking.js +51 -0
- package/dist/modules/apimapper/render/secret-masking.js.map +1 -0
- package/dist/modules/apimapper/render/sidecar.d.ts +21 -0
- package/dist/modules/apimapper/render/sidecar.js +66 -0
- package/dist/modules/apimapper/render/sidecar.js.map +1 -0
- package/dist/modules/apimapper/render/token-cap.d.ts +21 -0
- package/dist/modules/apimapper/render/token-cap.js +57 -0
- package/dist/modules/apimapper/render/token-cap.js.map +1 -0
- package/dist/modules/apimapper/schema.d.ts +2 -2
- package/dist/modules/apimapper/schema.js +92 -33
- package/dist/modules/apimapper/schema.js.map +1 -1
- package/dist/modules/apimapper/settings-format.d.ts +23 -0
- package/dist/modules/apimapper/settings-format.js +135 -0
- package/dist/modules/apimapper/settings-format.js.map +1 -0
- package/dist/modules/apimapper/settings.d.ts +2 -2
- package/dist/modules/apimapper/settings.js +100 -42
- package/dist/modules/apimapper/settings.js.map +1 -1
- package/dist/modules/apimapper/sites-tools.d.ts +29 -0
- package/dist/modules/apimapper/sites-tools.js +165 -0
- package/dist/modules/apimapper/sites-tools.js.map +1 -0
- package/dist/modules/apimapper/skill-resources.d.ts +2 -2
- package/dist/modules/apimapper/skill-resources.js.map +1 -1
- package/dist/modules/apimapper/token-baseline.harness.d.ts +91 -0
- package/dist/modules/apimapper/token-baseline.harness.js +291 -0
- package/dist/modules/apimapper/token-baseline.harness.js.map +1 -0
- package/dist/modules/apimapper/tool-result.d.ts +46 -0
- package/dist/modules/apimapper/tool-result.js +63 -0
- package/dist/modules/apimapper/tool-result.js.map +1 -0
- package/dist/modules/apimapper/toolslist-size.d.ts +56 -0
- package/dist/modules/apimapper/toolslist-size.js +192 -0
- package/dist/modules/apimapper/toolslist-size.js.map +1 -0
- package/dist/modules/apimapper/types.d.ts +44 -8
- package/dist/modules/apimapper/types.js +26 -1
- package/dist/modules/apimapper/types.js.map +1 -1
- package/dist/modules/apimapper/use-profile.d.ts +21 -0
- package/dist/modules/apimapper/use-profile.js +56 -2
- package/dist/modules/apimapper/use-profile.js.map +1 -1
- package/dist/modules/apimapper/whitelist-drift.d.ts +85 -0
- package/dist/modules/apimapper/whitelist-drift.js +360 -0
- package/dist/modules/apimapper/whitelist-drift.js.map +1 -0
- package/dist/modules/apimapper/workflows.d.ts +2 -2
- package/dist/modules/apimapper/workflows.js +202 -20
- package/dist/modules/apimapper/workflows.js.map +1 -1
- package/dist/modules/apimapper/yootheme-binding.d.ts +35 -0
- package/dist/modules/apimapper/yootheme-binding.js +186 -0
- package/dist/modules/apimapper/yootheme-binding.js.map +1 -0
- package/dist/platform/index.d.ts +56 -0
- package/dist/platform/index.js +195 -7
- package/dist/platform/index.js.map +1 -1
- package/dist/setup/detect-clients.d.ts +40 -1
- package/dist/setup/detect-clients.js +148 -1
- package/dist/setup/detect-clients.js.map +1 -1
- package/dist/setup/probe-handshake.js +40 -7
- package/dist/setup/probe-handshake.js.map +1 -1
- package/dist/setup/remove-config.d.ts +8 -0
- package/dist/setup/remove-config.js +145 -0
- package/dist/setup/remove-config.js.map +1 -0
- package/dist/setup/uninstall.d.ts +34 -0
- package/dist/setup/uninstall.js +147 -0
- package/dist/setup/uninstall.js.map +1 -0
- package/dist/setup-cli.d.ts +60 -0
- package/dist/setup-cli.js +155 -5
- package/dist/setup-cli.js.map +1 -1
- package/dist/sites/loader.d.ts +41 -0
- package/dist/sites/loader.js +119 -0
- package/dist/sites/loader.js.map +1 -0
- package/dist/sites/schema.d.ts +69 -0
- package/dist/sites/schema.js +71 -0
- package/dist/sites/schema.js.map +1 -0
- package/dist/sites/secret-resolver.d.ts +47 -0
- package/dist/sites/secret-resolver.js +150 -0
- package/dist/sites/secret-resolver.js.map +1 -0
- package/dist/skill-instructions.d.ts +1 -1
- package/dist/skill-instructions.js +5 -0
- package/dist/skill-instructions.js.map +1 -1
- package/dist/transports/stdio.js +4 -4
- package/dist/transports/stdio.js.map +1 -1
- package/dist/uninstall-skill.d.ts +27 -0
- package/dist/uninstall-skill.js +89 -0
- package/dist/uninstall-skill.js.map +1 -0
- package/docs/architecture.md +22 -22
- package/docs/customgraph-internal-migration.md +4 -4
- package/docs/security.md +2 -21
- package/docs/tools.md +40 -12
- package/manifest.json +77 -70
- package/package.json +68 -60
- package/skills/apimapper/SKILL.md +53 -7
- package/skills/apimapper/reference/conditional-style-multi-items.md +114 -0
- package/skills/apimapper/reference/jmespath-pitfalls.md +108 -0
- package/skills/apimapper/reference/joomla.md +1 -1
- package/skills/apimapper/reference/library-template-discovery.md +65 -0
- package/skills/apimapper/reference/merge-two-sources-on-key.md +99 -0
- package/skills/apimapper/reference/render.md +132 -0
- package/skills/apimapper/reference/troubleshooting.md +21 -1
- package/skills/apimapper/reference/yootheme.md +1 -1
- package/dist/auth/oauth-provider.d.ts +0 -68
- package/dist/auth/oauth-provider.js +0 -232
- package/dist/auth/oauth-provider.js.map +0 -1
- package/dist/server-http.d.ts +0 -22
- package/dist/server-http.js +0 -159
- package/dist/server-http.js.map +0 -1
- package/dist/transports/http.d.ts +0 -29
- package/dist/transports/http.js +0 -267
- package/dist/transports/http.js.map +0 -1
|
@@ -1,6 +1,37 @@
|
|
|
1
1
|
import { type ApiResponse } from "@getimo/mcp-toolkit";
|
|
2
2
|
import { type Platform } from "../../platform/index.js";
|
|
3
|
+
import { type SitesRegistry } from "../../sites/loader.js";
|
|
4
|
+
/**
|
|
5
|
+
* WordPress / Joomla site base URL.
|
|
6
|
+
*
|
|
7
|
+
* Env-var precedence: `APIMAPPER_WP_BASE` → `APIMAPPER_SITE_URL` (alias
|
|
8
|
+
* written by the DXT setup wizard) → empty string.
|
|
9
|
+
*
|
|
10
|
+
* The SITE_URL → WP_BASE bridge is handled exactly once, above, via
|
|
11
|
+
* `process.env.APIMAPPER_WP_BASE = process.env.APIMAPPER_SITE_URL`. This
|
|
12
|
+
* keeps a single source of truth in `process.env` so any consumer
|
|
13
|
+
* (including child processes spawned later, R7 verify scripts, and
|
|
14
|
+
* legacy CustomGraph internal code) sees the same value — not just
|
|
15
|
+
* this module's exported `WP_BASE` constant.
|
|
16
|
+
*
|
|
17
|
+
* Empty default is intentional (F-43, 2026-05-19): a freshly-installed
|
|
18
|
+
* customer who has not run the setup wizard must NOT silently inherit
|
|
19
|
+
* the WootsUp dev URL — that leaked the vendor's setup hostname into
|
|
20
|
+
* customer error logs and confused triage. In production (NODE_ENV
|
|
21
|
+
* === "production") an empty value causes a fail-fast exit below.
|
|
22
|
+
*
|
|
23
|
+
* Trailing slash is normalised away so downstream `${WP_BASE}/...` joins
|
|
24
|
+
* never produce double-slashes.
|
|
25
|
+
*/
|
|
3
26
|
export declare const WP_BASE: string;
|
|
27
|
+
/**
|
|
28
|
+
* WordPress username for legacy Application-Password Basic auth.
|
|
29
|
+
*
|
|
30
|
+
* Empty default is intentional (F-44, 2026-05-19): the previous "getimo"
|
|
31
|
+
* default leaked a personal username into customer 401 logs. Customers
|
|
32
|
+
* using the modern Bearer-token flow (`amk_live_...`) don't need this
|
|
33
|
+
* value at all; legacy users must set `APIMAPPER_WP_USER` explicitly.
|
|
34
|
+
*/
|
|
4
35
|
export declare const WP_USER: string;
|
|
5
36
|
export declare const WP_APP_PASS: string;
|
|
6
37
|
/**
|
|
@@ -15,12 +46,21 @@ export declare function sanitizeErrorString(s: string): string;
|
|
|
15
46
|
* The underlying toolkit `ApiResponse` only carries `{success, data?, error?}`.
|
|
16
47
|
* We wrap each call so we capture the HTTP code via `fetch` and merge.
|
|
17
48
|
*/
|
|
18
|
-
export type ApiErrorCode = "auth" | "not_found" | "rate_limit" | "server" | "network" | "unknown";
|
|
49
|
+
export type ApiErrorCode = "auth" | "not_found" | "conflict" | "rate_limit" | "server" | "network" | "unknown";
|
|
19
50
|
export interface ExtApiResponse<T = unknown> extends ApiResponse<T> {
|
|
20
51
|
status?: number;
|
|
21
52
|
errorCode?: ApiErrorCode;
|
|
22
53
|
/** When true, response was 2xx but payload had `success: false` — semantically failed. */
|
|
23
54
|
payloadFailed?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* W2-3 (H-3, 2026-05-28): the parsed JSON body when the server returned a
|
|
57
|
+
* non-2xx response. Carries domain-specific fields like
|
|
58
|
+
* `compiler_error_code` (FlowHandler::compile) that the caller-side autofix
|
|
59
|
+
* branches on. `undefined` when the error response wasn't JSON, or when the
|
|
60
|
+
* call succeeded. Do NOT use as a "did the request succeed" check;
|
|
61
|
+
* `success` is the source of truth for that.
|
|
62
|
+
*/
|
|
63
|
+
errorBody?: Record<string, unknown>;
|
|
24
64
|
}
|
|
25
65
|
interface RequestOpts {
|
|
26
66
|
/**
|
|
@@ -65,6 +105,67 @@ export interface PlatformClient {
|
|
|
65
105
|
* All errors are sanitised via `sanitizeErrorString()` before being returned.
|
|
66
106
|
*/
|
|
67
107
|
export declare function createPlatformClient(platform: Platform): PlatformClient;
|
|
108
|
+
export declare const PLATFORM_KIND: "wordpress" | "joomla";
|
|
109
|
+
/**
|
|
110
|
+
* Network platform auto-detect. Concurrently probes the WordPress REST identity
|
|
111
|
+
* endpoint and the Joomla com_ajax getIdentity task with the same auth header,
|
|
112
|
+
* and decides which CMS is actually running at WP_BASE:
|
|
113
|
+
*
|
|
114
|
+
* - Joomla wins if its probe is HTTP 200 AND the body parses to
|
|
115
|
+
* `{success:true, data:[{success:true, …}]}` (or `data[0].platform` set).
|
|
116
|
+
* - WordPress wins if its probe is HTTP 200 AND the body is a JSON object
|
|
117
|
+
* that is NOT a `{success:false}` error envelope.
|
|
118
|
+
* - If both look OK (shouldn't happen on a single CMS), prefer the one whose
|
|
119
|
+
* reported identity `.platform` matches its own kind; else WordPress.
|
|
120
|
+
* - If neither answers → return "wordpress" (graceful fallback — no worse
|
|
121
|
+
* than the pre-Phase-1 silent default).
|
|
122
|
+
*
|
|
123
|
+
* All fetch errors are swallowed → fallback. The token is sent on the wire but
|
|
124
|
+
* never logged. Short timeout so a blocked probe host can't stall startup.
|
|
125
|
+
*
|
|
126
|
+
* Phase 3 (2026-06-03): accepts optional `(baseUrl, token)` overrides so a
|
|
127
|
+
* per-site probe (sites-file path) can target the entry's own URL + token. The
|
|
128
|
+
* no-arg call preserves the env-path behaviour exactly (module WP_BASE +
|
|
129
|
+
* probeAuthHeader()).
|
|
130
|
+
*/
|
|
131
|
+
export declare function probePlatform(baseUrl?: string, token?: string): Promise<"wordpress" | "joomla">;
|
|
132
|
+
/**
|
|
133
|
+
* Lazily load + memoize the sites-file registry from APIMAPPER_SITES_FILE.
|
|
134
|
+
* Returns `null` when the env var is unset/empty, the file is absent, or it has
|
|
135
|
+
* zero sites — in all those cases the caller falls through to the env path.
|
|
136
|
+
* A malformed / schema-invalid file throws `SitesFileError` (loud-fail at first
|
|
137
|
+
* use rather than silently degrading multi-site to single-site).
|
|
138
|
+
*/
|
|
139
|
+
export declare function getSitesRegistry(): SitesRegistry | null;
|
|
140
|
+
/**
|
|
141
|
+
* The currently-active site_id, or `null` when none has been explicitly set
|
|
142
|
+
* (the file's default entry is then used) or when no sites-file is loaded.
|
|
143
|
+
*/
|
|
144
|
+
export declare function getActiveSiteId(): string | null;
|
|
145
|
+
/**
|
|
146
|
+
* Switch the active site. Validates that `id` exists in the loaded sites-file
|
|
147
|
+
* registry, updates the in-memory pointer, and resets the resolution memo so
|
|
148
|
+
* the next `request()` re-resolves (URL + token + platform) against the new
|
|
149
|
+
* site. Throws when no sites-file is loaded or the id is unknown — the pointer
|
|
150
|
+
* is NOT changed on error.
|
|
151
|
+
*/
|
|
152
|
+
export declare function setActiveSite(id: string): void;
|
|
153
|
+
/**
|
|
154
|
+
* Drop the memoized platform resolution (and the cached sites-file registry +
|
|
155
|
+
* active-site pointer) so the next `request()` re-resolves from scratch —
|
|
156
|
+
* re-reading APIMAPPER_SITES_FILE, re-running the env-check / network probe.
|
|
157
|
+
*
|
|
158
|
+
* Production callers: invoke after deliberately changing the active selection
|
|
159
|
+
* outside `setActiveSite()` (the tool wiring uses `setActiveSite`, which already
|
|
160
|
+
* resets the memo). Safe to call any time.
|
|
161
|
+
*/
|
|
162
|
+
export declare function resetPlatformResolution(): void;
|
|
163
|
+
/**
|
|
164
|
+
* Test-only alias of {@link resetPlatformResolution}, kept for the existing
|
|
165
|
+
* Phase-1 client tests that reference it by this name. New code should call
|
|
166
|
+
* `resetPlatformResolution()`.
|
|
167
|
+
*/
|
|
168
|
+
export declare function __resetPlatformResolutionForTests(): void;
|
|
68
169
|
/**
|
|
69
170
|
* Issue a request through the toolkit HTTP client + capture HTTP status.
|
|
70
171
|
*
|