@wootsup/mcp 0.1.0 → 0.4.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 +157 -83
- package/README.md +31 -27
- 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/catalog/build-catalog.d.ts +31 -0
- package/dist/catalog/build-catalog.js +68 -0
- package/dist/catalog/build-catalog.js.map +1 -0
- 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.js +129 -22
- package/dist/index.js.map +1 -1
- package/dist/install-skill.js +1 -1
- package/dist/modules/apimapper/auto-layout.d.ts +21 -0
- package/dist/modules/apimapper/auto-layout.js +54 -0
- package/dist/modules/apimapper/auto-layout.js.map +1 -0
- package/dist/modules/apimapper/cache.js +25 -17
- package/dist/modules/apimapper/cache.js.map +1 -1
- package/dist/modules/apimapper/client.d.ts +115 -4
- package/dist/modules/apimapper/client.js +699 -304
- package/dist/modules/apimapper/client.js.map +1 -1
- package/dist/modules/apimapper/connections-format.d.ts +31 -1
- package/dist/modules/apimapper/connections-format.js +97 -5
- package/dist/modules/apimapper/connections-format.js.map +1 -1
- package/dist/modules/apimapper/connections.d.ts +9 -7
- package/dist/modules/apimapper/connections.js +449 -127
- 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.js +105 -61
- package/dist/modules/apimapper/credentials.js.map +1 -1
- package/dist/modules/apimapper/diagnose.js +21 -2
- package/dist/modules/apimapper/diagnose.js.map +1 -1
- package/dist/modules/apimapper/elicitation.d.ts +29 -0
- package/dist/modules/apimapper/elicitation.js +62 -0
- package/dist/modules/apimapper/elicitation.js.map +1 -1
- package/dist/modules/apimapper/example-extract.d.ts +13 -0
- package/dist/modules/apimapper/example-extract.js +111 -0
- package/dist/modules/apimapper/example-extract.js.map +1 -0
- package/dist/modules/apimapper/filter-operators.d.ts +24 -0
- package/dist/modules/apimapper/filter-operators.js +103 -0
- package/dist/modules/apimapper/filter-operators.js.map +1 -0
- package/dist/modules/apimapper/flows-format.js +92 -22
- package/dist/modules/apimapper/flows-format.js.map +1 -1
- package/dist/modules/apimapper/flows.d.ts +8 -7
- package/dist/modules/apimapper/flows.js +275 -120
- package/dist/modules/apimapper/flows.js.map +1 -1
- package/dist/modules/apimapper/gateway/advanced-read-tool.d.ts +9 -0
- package/dist/modules/apimapper/gateway/advanced-read-tool.js +172 -0
- package/dist/modules/apimapper/gateway/advanced-read-tool.js.map +1 -0
- package/dist/modules/apimapper/gateway/advanced-tool.js +66 -106
- package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -1
- package/dist/modules/apimapper/gateway/collect-module-tools.d.ts +17 -0
- package/dist/modules/apimapper/gateway/collect-module-tools.js +44 -0
- package/dist/modules/apimapper/gateway/collect-module-tools.js.map +1 -0
- package/dist/modules/apimapper/gateway/essentials.d.ts +1 -1
- package/dist/modules/apimapper/gateway/essentials.js +21 -2
- package/dist/modules/apimapper/gateway/essentials.js.map +1 -1
- package/dist/modules/apimapper/gateway/gateway-shared.d.ts +21 -0
- package/dist/modules/apimapper/gateway/gateway-shared.js +124 -0
- package/dist/modules/apimapper/gateway/gateway-shared.js.map +1 -0
- package/dist/modules/apimapper/gateway/test-support.d.ts +1 -17
- package/dist/modules/apimapper/gateway/test-support.js +4 -33
- package/dist/modules/apimapper/gateway/test-support.js.map +1 -1
- package/dist/modules/apimapper/get-skill-cores.d.ts +4 -0
- package/dist/modules/apimapper/get-skill-cores.js +220 -0
- package/dist/modules/apimapper/get-skill-cores.js.map +1 -0
- package/dist/modules/apimapper/get-skill.d.ts +1 -1
- package/dist/modules/apimapper/get-skill.js +74 -9
- package/dist/modules/apimapper/get-skill.js.map +1 -1
- package/dist/modules/apimapper/graph-builder.d.ts +85 -2
- package/dist/modules/apimapper/graph-builder.js +151 -15
- package/dist/modules/apimapper/graph-builder.js.map +1 -1
- package/dist/modules/apimapper/graph.js +152 -48
- package/dist/modules/apimapper/graph.js.map +1 -1
- package/dist/modules/apimapper/index.js +27 -13
- package/dist/modules/apimapper/index.js.map +1 -1
- package/dist/modules/apimapper/jmespath-test.d.ts +4 -0
- package/dist/modules/apimapper/jmespath-test.js +152 -0
- package/dist/modules/apimapper/jmespath-test.js.map +1 -0
- package/dist/modules/apimapper/library.js +553 -88
- package/dist/modules/apimapper/library.js.map +1 -1
- package/dist/modules/apimapper/license.js +12 -36
- package/dist/modules/apimapper/license.js.map +1 -1
- package/dist/modules/apimapper/list-footer.d.ts +27 -0
- package/dist/modules/apimapper/list-footer.js +57 -0
- package/dist/modules/apimapper/list-footer.js.map +1 -0
- package/dist/modules/apimapper/local-sources.js +100 -57
- package/dist/modules/apimapper/local-sources.js.map +1 -1
- package/dist/modules/apimapper/mcp-client-identity.d.ts +32 -0
- package/dist/modules/apimapper/mcp-client-identity.js +70 -0
- package/dist/modules/apimapper/mcp-client-identity.js.map +1 -0
- package/dist/modules/apimapper/merge-constants.d.ts +6 -0
- package/dist/modules/apimapper/merge-constants.js +26 -0
- package/dist/modules/apimapper/merge-constants.js.map +1 -0
- package/dist/modules/apimapper/misc.js +13 -27
- package/dist/modules/apimapper/misc.js.map +1 -1
- package/dist/modules/apimapper/node-schema.d.ts +52 -2
- package/dist/modules/apimapper/node-schema.js +95 -4
- package/dist/modules/apimapper/node-schema.js.map +1 -1
- package/dist/modules/apimapper/onboarding.d.ts +59 -1
- package/dist/modules/apimapper/onboarding.js +231 -28
- package/dist/modules/apimapper/onboarding.js.map +1 -1
- package/dist/modules/apimapper/read-cache.d.ts +16 -3
- package/dist/modules/apimapper/read-cache.js +59 -4
- package/dist/modules/apimapper/read-cache.js.map +1 -1
- package/dist/modules/apimapper/render/index.js +26 -5
- package/dist/modules/apimapper/render/index.js.map +1 -1
- package/dist/modules/apimapper/resource-id.d.ts +13 -0
- package/dist/modules/apimapper/resource-id.js +69 -0
- package/dist/modules/apimapper/resource-id.js.map +1 -0
- package/dist/modules/apimapper/schema.js +9 -18
- package/dist/modules/apimapper/schema.js.map +1 -1
- package/dist/modules/apimapper/settings.js +49 -52
- 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/tool-result.d.ts +66 -0
- package/dist/modules/apimapper/tool-result.js +125 -0
- package/dist/modules/apimapper/tool-result.js.map +1 -0
- package/dist/modules/apimapper/toolslist-size.d.ts +12 -11
- package/dist/modules/apimapper/toolslist-size.js +34 -21
- package/dist/modules/apimapper/toolslist-size.js.map +1 -1
- package/dist/modules/apimapper/types.d.ts +34 -0
- package/dist/modules/apimapper/types.js +1 -1
- package/dist/modules/apimapper/types.js.map +1 -1
- package/dist/modules/apimapper/whitelist-drift.d.ts +85 -0
- package/dist/modules/apimapper/whitelist-drift.js +375 -0
- package/dist/modules/apimapper/whitelist-drift.js.map +1 -0
- package/dist/modules/apimapper/workflows.js +302 -58
- 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 +267 -0
- package/dist/modules/apimapper/yootheme-binding.js.map +1 -0
- package/dist/platform/index.d.ts +56 -0
- package/dist/platform/index.js +158 -2
- package/dist/platform/index.js.map +1 -1
- package/dist/proxy/bridge.d.ts +35 -0
- package/dist/proxy/bridge.js +129 -0
- package/dist/proxy/bridge.js.map +1 -0
- package/dist/proxy/mode.d.ts +9 -0
- package/dist/proxy/mode.js +20 -0
- package/dist/proxy/mode.js.map +1 -0
- 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-auth.d.ts +51 -0
- package/dist/setup/probe-auth.js +141 -0
- package/dist/setup/probe-auth.js.map +1 -0
- 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 +16 -0
- package/dist/setup-cli.js +63 -1
- package/dist/setup-cli.js.map +1 -1
- package/dist/sites/loader.d.ts +48 -0
- package/dist/sites/loader.js +134 -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 +14 -1
- package/dist/skill-instructions.js +35 -6
- 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 +21 -21
- package/docs/customgraph-internal-migration.md +4 -4
- package/docs/security.md +2 -21
- package/docs/tools.md +40 -12
- package/manifest.json +77 -79
- package/package.json +69 -65
- package/skills/apimapper/SKILL.md +128 -7
- package/skills/apimapper/reference/conditional-style-multi-items.md +114 -0
- package/skills/apimapper/reference/dynamize-existing-layout.md +158 -0
- package/skills/apimapper/reference/jmespath-cookbook.md +241 -0
- package/skills/apimapper/reference/jmespath-pitfalls.md +189 -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 +204 -0
- package/skills/apimapper/reference/oauth.md +143 -52
- package/skills/apimapper/reference/troubleshooting.md +22 -2
- package/skills/apimapper/reference/yootheme-source-to-builder-handoff.md +348 -0
- package/skills/apimapper/reference/yootheme.md +75 -44
- 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,13 +1,22 @@
|
|
|
1
1
|
// src/modules/apimapper/get-skill.ts — Phase 7.4.
|
|
2
2
|
//
|
|
3
|
-
// apimapper_get_skill: returns the markdown content of one of the
|
|
4
|
-
// skill docs
|
|
5
|
-
//
|
|
3
|
+
// apimapper_get_skill: returns the markdown content of one of the bundled
|
|
4
|
+
// skill docs (the canonical set lives in SKILL_TOPICS below). Sibling to
|
|
5
|
+
// skill://apimapper/<topic> resources (Phase 7.3) for clients that prefer
|
|
6
|
+
// tool-call discovery over resource discovery.
|
|
7
|
+
//
|
|
8
|
+
// SINGLE SOURCE OF TRUTH: SKILL_TOPICS is the canonical topic list. The two
|
|
9
|
+
// other surfaces that advertise topics — SKILL_TOPIC_POINTER in
|
|
10
|
+
// ../../skill-instructions.ts (the server `instructions` field) and the
|
|
11
|
+
// apimapper_get_skill cross-reference in gateway/advanced-tool.ts — MUST stay
|
|
12
|
+
// identical to this list. topic-sync.test.ts pins all three against each other
|
|
13
|
+
// so they can never drift again (Wave-B audit C2, 2026-06-03).
|
|
6
14
|
import { z } from "zod";
|
|
7
|
-
import { readFileSync } from "node:fs";
|
|
15
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
8
16
|
import { fileURLToPath } from "node:url";
|
|
9
17
|
import { dirname, join, resolve } from "node:path";
|
|
10
18
|
import { readOnly } from "@getimo/mcp-toolkit";
|
|
19
|
+
import { SKILL_CORES, FULL_DOC_POINTER } from "./get-skill-cores.js";
|
|
11
20
|
export const SKILL_TOPICS = [
|
|
12
21
|
"getting-started",
|
|
13
22
|
"oauth",
|
|
@@ -15,6 +24,13 @@ export const SKILL_TOPICS = [
|
|
|
15
24
|
"joomla",
|
|
16
25
|
"troubleshooting",
|
|
17
26
|
"render",
|
|
27
|
+
"jmespath-pitfalls",
|
|
28
|
+
"jmespath-cookbook",
|
|
29
|
+
"merge-two-sources-on-key",
|
|
30
|
+
"conditional-style-multi-items",
|
|
31
|
+
"library-template-discovery",
|
|
32
|
+
"yootheme-source-to-builder-handoff",
|
|
33
|
+
"dynamize-existing-layout",
|
|
18
34
|
];
|
|
19
35
|
const TOPIC_TO_FILE = {
|
|
20
36
|
"getting-started": "SKILL.md",
|
|
@@ -23,26 +39,62 @@ const TOPIC_TO_FILE = {
|
|
|
23
39
|
joomla: "reference/joomla.md",
|
|
24
40
|
troubleshooting: "reference/troubleshooting.md",
|
|
25
41
|
render: "reference/render.md",
|
|
42
|
+
"jmespath-pitfalls": "reference/jmespath-pitfalls.md",
|
|
43
|
+
"jmespath-cookbook": "reference/jmespath-cookbook.md",
|
|
44
|
+
"merge-two-sources-on-key": "reference/merge-two-sources-on-key.md",
|
|
45
|
+
"conditional-style-multi-items": "reference/conditional-style-multi-items.md",
|
|
46
|
+
"library-template-discovery": "reference/library-template-discovery.md",
|
|
47
|
+
"yootheme-source-to-builder-handoff": "reference/yootheme-source-to-builder-handoff.md",
|
|
48
|
+
"dynamize-existing-layout": "reference/dynamize-existing-layout.md",
|
|
26
49
|
};
|
|
27
50
|
function defaultSkillsRoot() {
|
|
28
|
-
//
|
|
51
|
+
// Resolve the dir that CONTAINS `skills/apimapper/`. The module layout differs
|
|
52
|
+
// between build targets:
|
|
53
|
+
// - source/npm: this file is at <root>/src|dist/modules/apimapper/get-skill →
|
|
54
|
+
// the root is THREE levels up.
|
|
55
|
+
// - Claude Desktop .dxt: esbuild bundles everything into dist/index.js, so at
|
|
56
|
+
// runtime `here` = <extracted>/dist and the root holding skills/ is just ONE
|
|
57
|
+
// level up. The old hard-coded 3-up overshot past the extracted dir (it
|
|
58
|
+
// landed in ~/Library/Application Support/Claude/) → every apimapper_get_skill
|
|
59
|
+
// call returned ENOENT even though skills/ WAS bundled. (Bug found in the
|
|
60
|
+
// 2026-06-04 Claude Desktop session.)
|
|
61
|
+
// Probe candidate roots and return the first that actually holds the bundled
|
|
62
|
+
// skills; fall back to the npm 3-up layout to preserve prior behaviour.
|
|
29
63
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
30
|
-
|
|
64
|
+
const candidates = [
|
|
65
|
+
resolve(here, "..", "..", ".."), // source / npm: …/dist/modules/apimapper → root
|
|
66
|
+
resolve(here, ".."), // .dxt bundle: …/dist → extracted root
|
|
67
|
+
resolve(here, "..", ".."), // safety net
|
|
68
|
+
here,
|
|
69
|
+
];
|
|
70
|
+
for (const candidate of candidates) {
|
|
71
|
+
if (existsSync(join(candidate, "skills", "apimapper", "SKILL.md"))) {
|
|
72
|
+
return candidate;
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return candidates[0];
|
|
31
76
|
}
|
|
32
77
|
export function registerGetSkillTool(server, rootDir) {
|
|
33
78
|
const baseDir = rootDir ?? defaultSkillsRoot();
|
|
34
79
|
server.registerTool("apimapper_get_skill", {
|
|
35
80
|
title: "Get Skill Doc",
|
|
36
|
-
description: "Returns
|
|
81
|
+
description: "Returns a condensed CORE for a bundled API Mapper skill doc (the recipe + " +
|
|
82
|
+
"key patterns, ~2 KB). Pass `full: true` for the long form (prose, every example, pitfalls). " +
|
|
37
83
|
`Topics: ${SKILL_TOPICS.join(", ")}. Sibling to skill://apimapper/<topic> resources.` +
|
|
38
|
-
"\n\nExample:\n apimapper_get_skill({ topic: 'getting-started' })"
|
|
84
|
+
"\n\nExample:\n apimapper_get_skill({ topic: 'getting-started' }) // core\n" +
|
|
85
|
+
" apimapper_get_skill({ topic: 'merge-two-sources-on-key', full: true }) // long form",
|
|
39
86
|
inputSchema: {
|
|
40
87
|
topic: z
|
|
41
88
|
.enum(SKILL_TOPICS)
|
|
42
89
|
.describe(`Which doc to fetch — one of: ${SKILL_TOPICS.join(", ")}`),
|
|
90
|
+
full: z
|
|
91
|
+
.boolean()
|
|
92
|
+
.default(false)
|
|
93
|
+
.describe("Default false → the condensed core (recipe + patterns, ~2 KB). " +
|
|
94
|
+
"true → the full long-form markdown (prose, every example, pitfalls)."),
|
|
43
95
|
},
|
|
44
96
|
annotations: readOnly({ title: "Get Skill Resource", openWorld: false }),
|
|
45
|
-
}, async ({ topic }) => {
|
|
97
|
+
}, async ({ topic, full }) => {
|
|
46
98
|
// Defensive runtime check — zod already validates at the MCP layer, but
|
|
47
99
|
// a direct unit-test invocation can bypass validation, and we want to
|
|
48
100
|
// produce a helpful structured error rather than crash on undefined.
|
|
@@ -58,6 +110,19 @@ export function registerGetSkillTool(server, rootDir) {
|
|
|
58
110
|
],
|
|
59
111
|
};
|
|
60
112
|
}
|
|
113
|
+
// F196: the DEFAULT response is the condensed core. The core carries the
|
|
114
|
+
// recipe + load-bearing patterns and a pointer to the long form. Direct
|
|
115
|
+
// unit-test calls may omit `full`, so treat anything non-true as core.
|
|
116
|
+
if (full !== true) {
|
|
117
|
+
return {
|
|
118
|
+
content: [
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: SKILL_CORES[topic] + FULL_DOC_POINTER,
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
}
|
|
61
126
|
const filePath = join(baseDir, "skills", "apimapper", TOPIC_TO_FILE[topic]);
|
|
62
127
|
let text;
|
|
63
128
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-skill.js","sourceRoot":"","sources":["../../../src/modules/apimapper/get-skill.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,4EAA4E;A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,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;YACjE,OAAO;gBACL,OAAO,EAAE,IAAI;gBACb,OAAO,EAAE;oBACP;wBACE,IAAI,EAAE,MAAe;wBACrB,IAAI,EACF,uCAAuC,KAAK,MAAM,OAAO,IAAI;4BAC7D,wDAAwD;4BACxD,iBAAiB,YAAY,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG;qBAC9C;iBACF;aACF,CAAC;QACJ,CAAC;QAED,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAe;oBACrB,IAAI;iBACL;aACF;SACF,CAAC;IACJ,CAAC,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,6 +1,33 @@
|
|
|
1
1
|
import type { FlowNode, FlowEdge } from "./types.js";
|
|
2
|
+
/**
|
|
3
|
+
* Local-source descriptor (F25, 2026-06-10): a CMS-native content source
|
|
4
|
+
* (WordPress posts / Joomla articles) queried straight from the platform DB —
|
|
5
|
+
* no Connection. Mirrors the `local-source` node-schema (`data.contentType`,
|
|
6
|
+
* `data.limit`, `data.filters`).
|
|
7
|
+
*/
|
|
8
|
+
export interface LocalSourceDescriptor {
|
|
9
|
+
/**
|
|
10
|
+
* Fully-qualified content type, e.g. `wordpress/post`, `wordpress/page`,
|
|
11
|
+
* `joomla/article`. The bare `post` is NOT accepted — the PHP save-time guard
|
|
12
|
+
* (F26) and the executor (C5) reject under-qualified types.
|
|
13
|
+
*/
|
|
14
|
+
content_type: string;
|
|
15
|
+
/** Max items to fetch (clamped to the tier maximum server-side). */
|
|
16
|
+
limit?: number;
|
|
17
|
+
/** Server-side filters (e.g. `{ category: "news" }`). */
|
|
18
|
+
filters?: Record<string, unknown>;
|
|
19
|
+
}
|
|
2
20
|
export interface SourceSpec {
|
|
3
|
-
|
|
21
|
+
/**
|
|
22
|
+
* Connection ID for an API source. Mutually exclusive with `local_source`:
|
|
23
|
+
* exactly ONE of `connection` / `local_source` must be set per source.
|
|
24
|
+
*/
|
|
25
|
+
connection?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Local-source descriptor for a CMS-native source. Mutually exclusive with
|
|
28
|
+
* `connection`. F25 (2026-06-10).
|
|
29
|
+
*/
|
|
30
|
+
local_source?: LocalSourceDescriptor;
|
|
4
31
|
endpoint?: string;
|
|
5
32
|
template_fields?: Record<string, string>;
|
|
6
33
|
items_path?: string;
|
|
@@ -15,6 +42,28 @@ export interface MergeSpec {
|
|
|
15
42
|
export interface TransformSpec {
|
|
16
43
|
expression?: string;
|
|
17
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* A single filter condition. `value` is omitted for value-less operators
|
|
47
|
+
* (`exists`/`not_exists`/`empty`/`not_empty`). F54 (2026-06-10).
|
|
48
|
+
*/
|
|
49
|
+
export interface FilterCondition {
|
|
50
|
+
field: string;
|
|
51
|
+
operator: string;
|
|
52
|
+
value?: unknown;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* One-shot filter descriptor (F54). Two shapes are accepted:
|
|
56
|
+
* - inline single condition: `{ field, operator, value }`
|
|
57
|
+
* - explicit list: `{ conditions: [...], logic? }`
|
|
58
|
+
* The inline form is normalised into a one-element `conditions` array.
|
|
59
|
+
*/
|
|
60
|
+
export interface FilterSpec {
|
|
61
|
+
field?: string;
|
|
62
|
+
operator?: string;
|
|
63
|
+
value?: unknown;
|
|
64
|
+
conditions?: FilterCondition[];
|
|
65
|
+
logic?: "and" | "or";
|
|
66
|
+
}
|
|
18
67
|
export interface OutputSpec {
|
|
19
68
|
type?: "yootheme" | "shortcode";
|
|
20
69
|
name: string;
|
|
@@ -23,9 +72,33 @@ export interface OutputSpec {
|
|
|
23
72
|
export interface BuildFlowGraphInput {
|
|
24
73
|
sources: SourceSpec[];
|
|
25
74
|
merge?: MergeSpec;
|
|
26
|
-
|
|
75
|
+
filter?: FilterSpec;
|
|
76
|
+
/**
|
|
77
|
+
* F181 (2026-06-12): a single `TransformSpec` OR an array of them. An array
|
|
78
|
+
* is chained source(s) → [merge →] [filter →] t1 → t2 → … → output, each
|
|
79
|
+
* transform's output feeding the next. This is the canonical remedy for the
|
|
80
|
+
* JMESPath depth cap (10): a too-deeply-nested reshape is split into two (or
|
|
81
|
+
* more) chained transforms — the pipe between nodes resets the depth counter.
|
|
82
|
+
* A bare object and a one-element array produce an identical graph; an empty
|
|
83
|
+
* array is treated as no transform at all (back-compat with `undefined`).
|
|
84
|
+
*/
|
|
85
|
+
transform?: TransformSpec | TransformSpec[];
|
|
27
86
|
output: OutputSpec;
|
|
28
87
|
}
|
|
88
|
+
/**
|
|
89
|
+
* Normalise a {@link FilterSpec} into a validated `{ conditions, logic }`
|
|
90
|
+
* payload for the filter node, throwing a HARD error on any invalid condition
|
|
91
|
+
* (F53). This is the build chokepoint: rejecting here means the agent learns
|
|
92
|
+
* immediately, instead of shipping a flow that silently yields 0 rows at
|
|
93
|
+
* render time.
|
|
94
|
+
*
|
|
95
|
+
* @throws Error when a condition is missing `field`, uses an unknown operator,
|
|
96
|
+
* or omits a required `value`.
|
|
97
|
+
*/
|
|
98
|
+
export declare function normalizeFilterSpec(filter: FilterSpec): {
|
|
99
|
+
conditions: FilterCondition[];
|
|
100
|
+
logic: "and" | "or";
|
|
101
|
+
};
|
|
29
102
|
export interface BuildFlowGraphResult {
|
|
30
103
|
nodes: FlowNode[];
|
|
31
104
|
edges: FlowEdge[];
|
|
@@ -43,5 +116,15 @@ export interface BuildFlowGraphResult {
|
|
|
43
116
|
* - sources.length === 0
|
|
44
117
|
* - sources.length >= 2 without `merge`
|
|
45
118
|
* - merge.strategy === "join" without `joinKey`
|
|
119
|
+
* - a source with NEITHER `connection` nor `local_source` (F25)
|
|
120
|
+
* - a source with BOTH `connection` and `local_source` (F25)
|
|
121
|
+
* - a `local_source` with an empty `content_type` (F25)
|
|
122
|
+
* - a `filter` condition with an unknown operator / missing field / missing
|
|
123
|
+
* required value (F53/F54)
|
|
124
|
+
*
|
|
125
|
+
* Node order is deterministic left-to-right: sources → merge? → filter? →
|
|
126
|
+
* transform? → output. The filter sits AFTER merge (so it filters the joined
|
|
127
|
+
* rows) and BEFORE transform (so a derived/coerced field a Transform produces
|
|
128
|
+
* is NOT yet visible — filter on raw fields, then reshape).
|
|
46
129
|
*/
|
|
47
130
|
export declare function buildFlowGraph(input: BuildFlowGraphInput): BuildFlowGraphResult;
|
|
@@ -5,6 +5,50 @@
|
|
|
5
5
|
// isolation and reusable from future tooling (Joomla parity, MCP composite
|
|
6
6
|
// tools beyond setup_with_sources, etc.).
|
|
7
7
|
import { normalizeMergeStrategy } from "./normalizers.js";
|
|
8
|
+
import { isValidFilterOperator, operatorNeedsValue, unknownOperatorMessage, } from "./filter-operators.js";
|
|
9
|
+
/**
|
|
10
|
+
* Normalise a {@link FilterSpec} into a validated `{ conditions, logic }`
|
|
11
|
+
* payload for the filter node, throwing a HARD error on any invalid condition
|
|
12
|
+
* (F53). This is the build chokepoint: rejecting here means the agent learns
|
|
13
|
+
* immediately, instead of shipping a flow that silently yields 0 rows at
|
|
14
|
+
* render time.
|
|
15
|
+
*
|
|
16
|
+
* @throws Error when a condition is missing `field`, uses an unknown operator,
|
|
17
|
+
* or omits a required `value`.
|
|
18
|
+
*/
|
|
19
|
+
export function normalizeFilterSpec(filter) {
|
|
20
|
+
// Accept either the inline single-condition form or an explicit list.
|
|
21
|
+
let conditions;
|
|
22
|
+
if (Array.isArray(filter.conditions) && filter.conditions.length > 0) {
|
|
23
|
+
conditions = filter.conditions;
|
|
24
|
+
}
|
|
25
|
+
else if (typeof filter.field === "string") {
|
|
26
|
+
conditions = [{ field: filter.field, operator: filter.operator ?? "equals", value: filter.value }];
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
throw new Error("filter requires either an inline `{ field, operator, value }` or a non-empty `conditions` array");
|
|
30
|
+
}
|
|
31
|
+
const validated = conditions.map((c, i) => {
|
|
32
|
+
if (typeof c.field !== "string" || c.field === "") {
|
|
33
|
+
throw new Error(`filter.conditions[${i}]: \`field\` is required (non-empty string)`);
|
|
34
|
+
}
|
|
35
|
+
const operator = c.operator;
|
|
36
|
+
if (typeof operator !== "string" || !isValidFilterOperator(operator)) {
|
|
37
|
+
throw new Error(`filter.conditions[${i}]: ${unknownOperatorMessage(String(operator))}`);
|
|
38
|
+
}
|
|
39
|
+
if (operatorNeedsValue(operator) && (c.value === undefined || c.value === null)) {
|
|
40
|
+
throw new Error(`filter.conditions[${i}]: operator "${operator}" requires a \`value\` (only ` +
|
|
41
|
+
`exists/not_exists/empty/not_empty are value-less).`);
|
|
42
|
+
}
|
|
43
|
+
// Re-emit a clean condition (drop stray keys, keep value only when present
|
|
44
|
+
// so value-less operators serialise minimally — matches FilterStep.php).
|
|
45
|
+
const out = { field: c.field, operator };
|
|
46
|
+
if (c.value !== undefined)
|
|
47
|
+
out.value = c.value;
|
|
48
|
+
return out;
|
|
49
|
+
});
|
|
50
|
+
return { conditions: validated, logic: filter.logic === "or" ? "or" : "and" };
|
|
51
|
+
}
|
|
8
52
|
/**
|
|
9
53
|
* Build a complete React-Flow graph from declarative source/merge/transform
|
|
10
54
|
* /output specs. Layout is deterministic (left-to-right columns).
|
|
@@ -13,9 +57,19 @@ import { normalizeMergeStrategy } from "./normalizers.js";
|
|
|
13
57
|
* - sources.length === 0
|
|
14
58
|
* - sources.length >= 2 without `merge`
|
|
15
59
|
* - merge.strategy === "join" without `joinKey`
|
|
60
|
+
* - a source with NEITHER `connection` nor `local_source` (F25)
|
|
61
|
+
* - a source with BOTH `connection` and `local_source` (F25)
|
|
62
|
+
* - a `local_source` with an empty `content_type` (F25)
|
|
63
|
+
* - a `filter` condition with an unknown operator / missing field / missing
|
|
64
|
+
* required value (F53/F54)
|
|
65
|
+
*
|
|
66
|
+
* Node order is deterministic left-to-right: sources → merge? → filter? →
|
|
67
|
+
* transform? → output. The filter sits AFTER merge (so it filters the joined
|
|
68
|
+
* rows) and BEFORE transform (so a derived/coerced field a Transform produces
|
|
69
|
+
* is NOT yet visible — filter on raw fields, then reshape).
|
|
16
70
|
*/
|
|
17
71
|
export function buildFlowGraph(input) {
|
|
18
|
-
const { sources, merge, transform, output } = input;
|
|
72
|
+
const { sources, merge, filter, transform, output } = input;
|
|
19
73
|
if (sources.length === 0) {
|
|
20
74
|
throw new Error("buildFlowGraph: at least one source is required");
|
|
21
75
|
}
|
|
@@ -25,17 +79,63 @@ export function buildFlowGraph(input) {
|
|
|
25
79
|
if (merge && (merge.strategy === "join") && !merge.joinKey) {
|
|
26
80
|
throw new Error("buildFlowGraph: merge.joinKey is required for strategy=join");
|
|
27
81
|
}
|
|
82
|
+
// F25 (2026-06-10): validate the connection-vs-local discriminator on every
|
|
83
|
+
// source up-front so the error names the offending index, instead of a
|
|
84
|
+
// confusing downstream compile failure on a half-built node.
|
|
85
|
+
sources.forEach((s, i) => {
|
|
86
|
+
const hasConnection = typeof s.connection === "string" && s.connection !== "";
|
|
87
|
+
const hasLocal = !!s.local_source;
|
|
88
|
+
if (!hasConnection && !hasLocal) {
|
|
89
|
+
throw new Error(`buildFlowGraph: source[${i}] must set either \`connection\` or \`local_source\``);
|
|
90
|
+
}
|
|
91
|
+
if (hasConnection && hasLocal) {
|
|
92
|
+
throw new Error(`buildFlowGraph: source[${i}] must set \`connection\` or \`local_source\`, not both`);
|
|
93
|
+
}
|
|
94
|
+
if (hasLocal && (typeof s.local_source.content_type !== "string" || s.local_source.content_type === "")) {
|
|
95
|
+
throw new Error(`buildFlowGraph: source[${i}].local_source.content_type is required (non-empty)`);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
// F53/F54: validate + normalise the filter spec up-front so an unknown
|
|
99
|
+
// operator / missing field / missing value throws BEFORE we build any node
|
|
100
|
+
// (mirrors the source-validation pattern above — fail fast, name the issue).
|
|
101
|
+
const filterPayload = filter ? normalizeFilterSpec(filter) : null;
|
|
28
102
|
const nodes = [];
|
|
29
103
|
const edges = [];
|
|
30
104
|
const baseX = 100;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
//
|
|
105
|
+
// Column / row pitch for the auto-laid-out graph. Canvas node cards are
|
|
106
|
+
// `min-w-[220px] max-w-[300px]` (admin-ui BaseNode), so the pitch MUST exceed
|
|
107
|
+
// the max card width or programmatically-created nodes overlap / touch with no
|
|
108
|
+
// breathing room (reported 2026-06-14). Pitch = max card width (300) + a
|
|
109
|
+
// comfortable gutter so adjacent nodes never crowd, regardless of card width.
|
|
110
|
+
const colWidth = 400; // 300 max card + 100 horizontal gutter
|
|
111
|
+
const rowHeight = 240; // stacked merge sources: card height + vertical gutter
|
|
112
|
+
// Sources column. Each descriptor emits EITHER a connection `source` node OR
|
|
113
|
+
// a CMS-native `local-source` node (F25). Both share the `source-{n}` id
|
|
114
|
+
// convention so the merge/transform/output wiring below is source-kind-blind.
|
|
34
115
|
sources.forEach((s, i) => {
|
|
116
|
+
const id = `source-${i + 1}`;
|
|
117
|
+
const position = { x: baseX, y: 100 + i * rowHeight };
|
|
118
|
+
if (s.local_source) {
|
|
119
|
+
const ls = s.local_source;
|
|
120
|
+
nodes.push({
|
|
121
|
+
id,
|
|
122
|
+
type: "local-source",
|
|
123
|
+
position,
|
|
124
|
+
data: {
|
|
125
|
+
label: s.label || `Source ${i + 1}`,
|
|
126
|
+
contentType: ls.content_type,
|
|
127
|
+
// Only forward limit/filters when provided so the node data stays
|
|
128
|
+
// minimal (executor defaults limit; filters default to []).
|
|
129
|
+
...(ls.limit !== undefined ? { limit: ls.limit } : {}),
|
|
130
|
+
...(ls.filters !== undefined ? { filters: ls.filters } : {}),
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
35
135
|
nodes.push({
|
|
36
|
-
id
|
|
136
|
+
id,
|
|
37
137
|
type: "source",
|
|
38
|
-
position
|
|
138
|
+
position,
|
|
39
139
|
data: {
|
|
40
140
|
label: s.label || `Source ${i + 1}`,
|
|
41
141
|
connectionId: s.connection,
|
|
@@ -75,32 +175,68 @@ export function buildFlowGraph(input) {
|
|
|
75
175
|
});
|
|
76
176
|
lastNodeId = mergeId;
|
|
77
177
|
}
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
|
|
178
|
+
// F54: Filter column — sits AFTER merge, BEFORE transform. `col` tracks the
|
|
179
|
+
// next free left-to-right column so positions stay non-overlapping whether
|
|
180
|
+
// or not a filter/transform is present.
|
|
181
|
+
let col = 2;
|
|
182
|
+
if (filterPayload) {
|
|
183
|
+
const filterId = "filter-1";
|
|
184
|
+
nodes.push({
|
|
185
|
+
id: filterId,
|
|
186
|
+
type: "filter",
|
|
187
|
+
position: { x: baseX + col * colWidth, y: 200 },
|
|
188
|
+
data: {
|
|
189
|
+
label: "Filter",
|
|
190
|
+
conditions: filterPayload.conditions,
|
|
191
|
+
logic: filterPayload.logic,
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
edges.push({
|
|
195
|
+
id: `e-${lastNodeId}-filter`,
|
|
196
|
+
source: lastNodeId,
|
|
197
|
+
target: filterId,
|
|
198
|
+
});
|
|
199
|
+
lastNodeId = filterId;
|
|
200
|
+
col += 1;
|
|
201
|
+
}
|
|
202
|
+
// Transform column(s). F181: a bare TransformSpec is treated as a
|
|
203
|
+
// one-element chain; an array chains each transform's output into the next
|
|
204
|
+
// (source(s) → [merge →] [filter →] t1 → t2 → … → output). An empty array
|
|
205
|
+
// (or omitted transform) emits no transform node — identical to the legacy
|
|
206
|
+
// no-transform graph. The pipe between two chained transform nodes resets the
|
|
207
|
+
// JMESPath depth counter, so splitting a depth-cap-overflowing expression
|
|
208
|
+
// into N shallow transforms is now expressible in one composite call.
|
|
209
|
+
const transformChain = transform === undefined
|
|
210
|
+
? []
|
|
211
|
+
: Array.isArray(transform)
|
|
212
|
+
? transform
|
|
213
|
+
: [transform];
|
|
214
|
+
transformChain.forEach((t, i) => {
|
|
215
|
+
const transformId = `transform-${i + 1}`;
|
|
81
216
|
nodes.push({
|
|
82
217
|
id: transformId,
|
|
83
218
|
type: "transform",
|
|
84
|
-
position: { x: baseX +
|
|
219
|
+
position: { x: baseX + (col + i) * colWidth, y: 200 },
|
|
85
220
|
data: {
|
|
86
|
-
label: "Transform",
|
|
87
|
-
expression:
|
|
221
|
+
label: transformChain.length > 1 ? `Transform ${i + 1}` : "Transform",
|
|
222
|
+
expression: t.expression ?? "[*]",
|
|
88
223
|
},
|
|
89
224
|
});
|
|
90
225
|
edges.push({
|
|
91
|
-
id: `e-${lastNodeId}
|
|
226
|
+
id: `e-${lastNodeId}-${transformId}`,
|
|
92
227
|
source: lastNodeId,
|
|
93
228
|
target: transformId,
|
|
94
229
|
});
|
|
95
230
|
lastNodeId = transformId;
|
|
96
|
-
}
|
|
231
|
+
});
|
|
232
|
+
col += transformChain.length;
|
|
97
233
|
// Output column
|
|
98
234
|
const outputId = "output-1";
|
|
99
235
|
const outputType = output.type === "shortcode" ? "output-shortcode" : "output-yootheme";
|
|
100
236
|
nodes.push({
|
|
101
237
|
id: outputId,
|
|
102
238
|
type: outputType,
|
|
103
|
-
position: { x: baseX +
|
|
239
|
+
position: { x: baseX + col * colWidth, y: 200 },
|
|
104
240
|
data: {
|
|
105
241
|
label: output.name,
|
|
106
242
|
name: output.name,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-builder.js","sourceRoot":"","sources":["../../../src/modules/apimapper/graph-builder.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0CAA0C;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"graph-builder.js","sourceRoot":"","sources":["../../../src/modules/apimapper/graph-builder.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,8EAA8E;AAC9E,EAAE;AACF,2EAA2E;AAC3E,2EAA2E;AAC3E,0CAA0C;AAG1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,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