@wootsup/mcp 0.1.0-rc.8 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (171) hide show
  1. package/README.md +7 -7
  2. package/dist/index.d.ts +19 -0
  3. package/dist/index.js +72 -6
  4. package/dist/index.js.map +1 -1
  5. package/dist/modules/apimapper/cache.d.ts +2 -2
  6. package/dist/modules/apimapper/cache.js +107 -25
  7. package/dist/modules/apimapper/cache.js.map +1 -1
  8. package/dist/modules/apimapper/client.d.ts +40 -0
  9. package/dist/modules/apimapper/client.js +82 -12
  10. package/dist/modules/apimapper/client.js.map +1 -1
  11. package/dist/modules/apimapper/connections-format.d.ts +51 -0
  12. package/dist/modules/apimapper/connections-format.js +261 -0
  13. package/dist/modules/apimapper/connections-format.js.map +1 -0
  14. package/dist/modules/apimapper/connections-trim.d.ts +82 -0
  15. package/dist/modules/apimapper/connections-trim.js +224 -0
  16. package/dist/modules/apimapper/connections-trim.js.map +1 -0
  17. package/dist/modules/apimapper/connections.d.ts +14 -2
  18. package/dist/modules/apimapper/connections.js +447 -143
  19. package/dist/modules/apimapper/connections.js.map +1 -1
  20. package/dist/modules/apimapper/credentials-format.d.ts +21 -0
  21. package/dist/modules/apimapper/credentials-format.js +145 -0
  22. package/dist/modules/apimapper/credentials-format.js.map +1 -0
  23. package/dist/modules/apimapper/credentials.d.ts +12 -2
  24. package/dist/modules/apimapper/credentials.js +253 -72
  25. package/dist/modules/apimapper/credentials.js.map +1 -1
  26. package/dist/modules/apimapper/diagnose.d.ts +54 -2
  27. package/dist/modules/apimapper/diagnose.js +193 -11
  28. package/dist/modules/apimapper/diagnose.js.map +1 -1
  29. package/dist/modules/apimapper/elicitation.d.ts +54 -0
  30. package/dist/modules/apimapper/elicitation.js +90 -0
  31. package/dist/modules/apimapper/elicitation.js.map +1 -0
  32. package/dist/modules/apimapper/flows-format.d.ts +50 -0
  33. package/dist/modules/apimapper/flows-format.js +318 -0
  34. package/dist/modules/apimapper/flows-format.js.map +1 -0
  35. package/dist/modules/apimapper/flows.d.ts +13 -2
  36. package/dist/modules/apimapper/flows.js +325 -118
  37. package/dist/modules/apimapper/flows.js.map +1 -1
  38. package/dist/modules/apimapper/gateway/advanced-tool.d.ts +9 -0
  39. package/dist/modules/apimapper/gateway/advanced-tool.js +214 -0
  40. package/dist/modules/apimapper/gateway/advanced-tool.js.map +1 -0
  41. package/dist/modules/apimapper/gateway/capturing-server.d.ts +81 -0
  42. package/dist/modules/apimapper/gateway/capturing-server.js +87 -0
  43. package/dist/modules/apimapper/gateway/capturing-server.js.map +1 -0
  44. package/dist/modules/apimapper/gateway/essentials.d.ts +4 -0
  45. package/dist/modules/apimapper/gateway/essentials.js +28 -0
  46. package/dist/modules/apimapper/gateway/essentials.js.map +1 -0
  47. package/dist/modules/apimapper/gateway/test-support.d.ts +17 -0
  48. package/dist/modules/apimapper/gateway/test-support.js +43 -0
  49. package/dist/modules/apimapper/gateway/test-support.js.map +1 -0
  50. package/dist/modules/apimapper/get-skill.d.ts +3 -3
  51. package/dist/modules/apimapper/get-skill.js +4 -2
  52. package/dist/modules/apimapper/get-skill.js.map +1 -1
  53. package/dist/modules/apimapper/graph-builder.js +1 -1
  54. package/dist/modules/apimapper/graph-builder.js.map +1 -1
  55. package/dist/modules/apimapper/graph.d.ts +2 -2
  56. package/dist/modules/apimapper/graph.js +165 -34
  57. package/dist/modules/apimapper/graph.js.map +1 -1
  58. package/dist/modules/apimapper/index.d.ts +17 -1
  59. package/dist/modules/apimapper/index.js +66 -17
  60. package/dist/modules/apimapper/index.js.map +1 -1
  61. package/dist/modules/apimapper/inspect.d.ts +3 -2
  62. package/dist/modules/apimapper/inspect.js +97 -13
  63. package/dist/modules/apimapper/inspect.js.map +1 -1
  64. package/dist/modules/apimapper/library.d.ts +2 -2
  65. package/dist/modules/apimapper/library.js +303 -60
  66. package/dist/modules/apimapper/library.js.map +1 -1
  67. package/dist/modules/apimapper/license-format.d.ts +22 -0
  68. package/dist/modules/apimapper/license-format.js +149 -0
  69. package/dist/modules/apimapper/license-format.js.map +1 -0
  70. package/dist/modules/apimapper/license.d.ts +16 -2
  71. package/dist/modules/apimapper/license.js +85 -37
  72. package/dist/modules/apimapper/license.js.map +1 -1
  73. package/dist/modules/apimapper/local-sources.d.ts +2 -2
  74. package/dist/modules/apimapper/local-sources.js +58 -30
  75. package/dist/modules/apimapper/local-sources.js.map +1 -1
  76. package/dist/modules/apimapper/misc.d.ts +30 -2
  77. package/dist/modules/apimapper/misc.js +129 -50
  78. package/dist/modules/apimapper/misc.js.map +1 -1
  79. package/dist/modules/apimapper/node-schema.d.ts +52 -0
  80. package/dist/modules/apimapper/node-schema.js +70 -2
  81. package/dist/modules/apimapper/node-schema.js.map +1 -1
  82. package/dist/modules/apimapper/normalizers.d.ts +1 -0
  83. package/dist/modules/apimapper/normalizers.js +51 -0
  84. package/dist/modules/apimapper/normalizers.js.map +1 -1
  85. package/dist/modules/apimapper/onboarding.d.ts +48 -2
  86. package/dist/modules/apimapper/onboarding.js +324 -17
  87. package/dist/modules/apimapper/onboarding.js.map +1 -1
  88. package/dist/modules/apimapper/read-cache.d.ts +31 -2
  89. package/dist/modules/apimapper/read-cache.js +20 -6
  90. package/dist/modules/apimapper/read-cache.js.map +1 -1
  91. package/dist/modules/apimapper/render/_shared.d.ts +24 -0
  92. package/dist/modules/apimapper/render/_shared.js +84 -0
  93. package/dist/modules/apimapper/render/_shared.js.map +1 -0
  94. package/dist/modules/apimapper/render/dag.d.ts +18 -0
  95. package/dist/modules/apimapper/render/dag.js +70 -0
  96. package/dist/modules/apimapper/render/dag.js.map +1 -0
  97. package/dist/modules/apimapper/render/index.d.ts +2 -0
  98. package/dist/modules/apimapper/render/index.js +112 -0
  99. package/dist/modules/apimapper/render/index.js.map +1 -0
  100. package/dist/modules/apimapper/render/renderers/chart-bar.d.ts +2 -0
  101. package/dist/modules/apimapper/render/renderers/chart-bar.js +70 -0
  102. package/dist/modules/apimapper/render/renderers/chart-bar.js.map +1 -0
  103. package/dist/modules/apimapper/render/renderers/chart-line.d.ts +2 -0
  104. package/dist/modules/apimapper/render/renderers/chart-line.js +71 -0
  105. package/dist/modules/apimapper/render/renderers/chart-line.js.map +1 -0
  106. package/dist/modules/apimapper/render/renderers/diff.d.ts +2 -0
  107. package/dist/modules/apimapper/render/renderers/diff.js +154 -0
  108. package/dist/modules/apimapper/render/renderers/diff.js.map +1 -0
  109. package/dist/modules/apimapper/render/renderers/flow-diagram.d.ts +1 -0
  110. package/dist/modules/apimapper/render/renderers/flow-diagram.js +180 -0
  111. package/dist/modules/apimapper/render/renderers/flow-diagram.js.map +1 -0
  112. package/dist/modules/apimapper/render/renderers/json-tree.d.ts +2 -0
  113. package/dist/modules/apimapper/render/renderers/json-tree.js +87 -0
  114. package/dist/modules/apimapper/render/renderers/json-tree.js.map +1 -0
  115. package/dist/modules/apimapper/render/renderers/schema-diagram.d.ts +2 -0
  116. package/dist/modules/apimapper/render/renderers/schema-diagram.js +83 -0
  117. package/dist/modules/apimapper/render/renderers/schema-diagram.js.map +1 -0
  118. package/dist/modules/apimapper/render/renderers/table.d.ts +2 -0
  119. package/dist/modules/apimapper/render/renderers/table.js +75 -0
  120. package/dist/modules/apimapper/render/renderers/table.js.map +1 -0
  121. package/dist/modules/apimapper/render/schemas.d.ts +23 -0
  122. package/dist/modules/apimapper/render/schemas.js +56 -0
  123. package/dist/modules/apimapper/render/schemas.js.map +1 -0
  124. package/dist/modules/apimapper/render/secret-masking.d.ts +5 -0
  125. package/dist/modules/apimapper/render/secret-masking.js +51 -0
  126. package/dist/modules/apimapper/render/secret-masking.js.map +1 -0
  127. package/dist/modules/apimapper/render/sidecar.d.ts +21 -0
  128. package/dist/modules/apimapper/render/sidecar.js +66 -0
  129. package/dist/modules/apimapper/render/sidecar.js.map +1 -0
  130. package/dist/modules/apimapper/render/token-cap.d.ts +21 -0
  131. package/dist/modules/apimapper/render/token-cap.js +57 -0
  132. package/dist/modules/apimapper/render/token-cap.js.map +1 -0
  133. package/dist/modules/apimapper/schema.d.ts +2 -2
  134. package/dist/modules/apimapper/schema.js +100 -32
  135. package/dist/modules/apimapper/schema.js.map +1 -1
  136. package/dist/modules/apimapper/settings-format.d.ts +23 -0
  137. package/dist/modules/apimapper/settings-format.js +135 -0
  138. package/dist/modules/apimapper/settings-format.js.map +1 -0
  139. package/dist/modules/apimapper/settings.d.ts +2 -2
  140. package/dist/modules/apimapper/settings.js +101 -40
  141. package/dist/modules/apimapper/settings.js.map +1 -1
  142. package/dist/modules/apimapper/skill-resources.d.ts +2 -2
  143. package/dist/modules/apimapper/skill-resources.js.map +1 -1
  144. package/dist/modules/apimapper/token-baseline.harness.d.ts +91 -0
  145. package/dist/modules/apimapper/token-baseline.harness.js +291 -0
  146. package/dist/modules/apimapper/token-baseline.harness.js.map +1 -0
  147. package/dist/modules/apimapper/toolslist-size.d.ts +55 -0
  148. package/dist/modules/apimapper/toolslist-size.js +190 -0
  149. package/dist/modules/apimapper/toolslist-size.js.map +1 -0
  150. package/dist/modules/apimapper/types.d.ts +23 -8
  151. package/dist/modules/apimapper/types.js +26 -1
  152. package/dist/modules/apimapper/types.js.map +1 -1
  153. package/dist/modules/apimapper/use-profile.d.ts +21 -0
  154. package/dist/modules/apimapper/use-profile.js +56 -2
  155. package/dist/modules/apimapper/use-profile.js.map +1 -1
  156. package/dist/modules/apimapper/workflows.d.ts +2 -2
  157. package/dist/modules/apimapper/workflows.js +143 -16
  158. package/dist/modules/apimapper/workflows.js.map +1 -1
  159. package/dist/platform/index.js +44 -5
  160. package/dist/platform/index.js.map +1 -1
  161. package/dist/setup-cli.d.ts +53 -0
  162. package/dist/setup-cli.js +135 -6
  163. package/dist/setup-cli.js.map +1 -1
  164. package/docs/architecture.md +1 -1
  165. package/docs/tools.md +1 -1
  166. package/manifest.json +12 -3
  167. package/package.json +9 -4
  168. package/skills/apimapper/SKILL.md +1 -1
  169. package/skills/apimapper/reference/render.md +132 -0
  170. package/skills/apimapper/reference/troubleshooting.md +1 -1
  171. package/skills/apimapper/reference/yootheme.md +1 -1
@@ -0,0 +1,318 @@
1
+ // src/modules/apimapper/flows-format.ts — W3.1 structuredContent helpers
2
+ //
3
+ // rc.13 Welle 3 (2026-05-20) — extracted from flows.ts when the migration to
4
+ // the toolkit's structuredContent builders pushed the tool-registration
5
+ // module past the ~600-line review threshold (a LOW finding observed on the
6
+ // library.ts migration; the same split was applied to connections-format.ts).
7
+ // flows.ts keeps the lean tool-registration surface; the column constants,
8
+ // row maps, detail/timeline builders and next-step strings live here.
9
+ //
10
+ // - T1 (W3.2): flow_list carries explicit compactColumns + compactMap.
11
+ // - IA-7 (W3.7): a human-readable NAME column; the opaque `id` column the
12
+ // LLM still needs for follow-up calls is marked llmOnly (ASCII text only,
13
+ // excluded from the Rich Card UI payload).
14
+ // - IA-10 (W3.9): every migrated tool carries actionable next-step guidance
15
+ // in the LLM-readable text (table footer / detail "Next steps" group).
16
+ import { detailResult, timelineResult, } from "@getimo/mcp-toolkit";
17
+ import { buildFlowVisualization } from "./render/sidecar.js";
18
+ // ── flow_list table shape ─────────────────────────────────────────────
19
+ // IA-7: NAME is the human-readable label. ID is opaque but the LLM needs it
20
+ // for follow-up calls (flow_get / flow_compile / flow_trace), so it stays in
21
+ // the ASCII text — `llmOnly: true` keeps it out of the Rich Card UI payload.
22
+ export const FLOW_TABLE_COLUMNS = [
23
+ // Width 36 accommodates 30+ char IDs (e.g. legacy template flows like
24
+ // flow_calendly_jla_229fcbce95b7 = 30 chars). Truncation produces orphan
25
+ // IDs that downstream tools fail to resolve via flow_get; +6 headroom
26
+ // matches the longest historical IDs.
27
+ { key: "id", label: "ID", width: 36, llmOnly: true },
28
+ { key: "name", label: "NAME", width: 32 },
29
+ { key: "source", label: "SRC", width: 10 },
30
+ { key: "nodes", label: "N", width: 4 },
31
+ { key: "compiled", label: "C", width: 3 },
32
+ { key: "types", label: "TYPES", width: 36 },
33
+ ];
34
+ // T1 (W3.2): reduced column set for 21+ flows — id (llmOnly) + name + the
35
+ // two fields that anchor identity at a glance (source + compiled state).
36
+ // NODES count and TYPES are dropped at compact level to keep the row narrow.
37
+ export const FLOW_COMPACT_COLUMNS = [
38
+ { key: "id", label: "ID", width: 36, llmOnly: true },
39
+ { key: "name", label: "NAME", width: 32 },
40
+ { key: "source", label: "SRC", width: 10 },
41
+ { key: "compiled", label: "C", width: 3 },
42
+ ];
43
+ /**
44
+ * Derive `is_compiled` from REST shape: the backend returns `compiledAt`
45
+ * (ISO timestamp string or null) and a `compiled` array of artifacts.
46
+ * Either indicates the flow has been compiled. Shared between the row map
47
+ * and the in-memory `compiled` filter so display + filtering stay uniform.
48
+ */
49
+ export function isFlowCompiled(f) {
50
+ if (typeof f.is_compiled === "boolean")
51
+ return f.is_compiled;
52
+ const raw = f;
53
+ if (typeof raw.compiledAt === "string" && raw.compiledAt.length > 0)
54
+ return true;
55
+ if (Array.isArray(raw.compiled) && raw.compiled.length > 0)
56
+ return true;
57
+ return false;
58
+ }
59
+ /** Standard row map: full Flow → table row. */
60
+ export function mapFlowRow(f) {
61
+ const flow = f;
62
+ return {
63
+ id: String(flow.id ?? ""),
64
+ name: String(flow.name ?? ""),
65
+ source: flow.source || "—",
66
+ nodes: flow.node_count ?? "?",
67
+ compiled: isFlowCompiled(flow) ? "✓" : "✗",
68
+ types: (flow.node_types || []).join(","),
69
+ };
70
+ }
71
+ /** T1 compact row map: only the columns FLOW_COMPACT_COLUMNS renders. */
72
+ export function compactFlowRow(f) {
73
+ const flow = f;
74
+ return {
75
+ id: String(flow.id ?? ""),
76
+ name: String(flow.name ?? ""),
77
+ source: flow.source || "—",
78
+ compiled: isFlowCompiled(flow) ? "✓" : "✗",
79
+ };
80
+ }
81
+ // IA-10: actionable next-step guidance, kept in the table footer so it is
82
+ // VISIBLE in the LLM-readable text of the flow list.
83
+ export const FLOW_LIST_NEXT_STEPS = "Next: apimapper_flow_get({ id }) for the full node/edge structure · " +
84
+ "apimapper_flow_compile({ id }) to publish to YOOtheme · " +
85
+ "apimapper_flow_trace({ id }) to inspect the last run.";
86
+ /** Compact str-coerce: scalars → string, everything else → null. */
87
+ function str(v) {
88
+ return typeof v === "string"
89
+ ? v
90
+ : typeof v === "number" || typeof v === "boolean"
91
+ ? String(v)
92
+ : null;
93
+ }
94
+ /**
95
+ * Build a structured detail view for one flow (flow_get).
96
+ *
97
+ * IA-7: technical IDs are copyable code entries. IA-10: a dedicated "Next
98
+ * steps" group carries the actionable follow-up calls. The W2 flow
99
+ * visualization (an ASCII diagram) is routed via `appendText` — it reaches
100
+ * the LLM-readable output but is intentionally kept OUT of the Rich Card
101
+ * groups payload, exactly as the toolkit documents `appendText` for
102
+ * technical detail that would clutter the visual display.
103
+ */
104
+ export function buildFlowDetail(id, flow) {
105
+ const f = flow;
106
+ const overviewAll = [
107
+ { key: "id", label: "ID", value: str(f.id) ?? id, format: "code", copyable: true },
108
+ { key: "name", label: "Name", value: str(f.name) },
109
+ { key: "description", label: "Description", value: str(f.description) },
110
+ { key: "source", label: "Source", value: str(f.source) },
111
+ ];
112
+ const overview = overviewAll.filter((e) => e.value !== null);
113
+ // Structure fields are scalar-only; node/edge arrays flatten to counts.
114
+ const nodes = Array.isArray(f.nodes) ? f.nodes : [];
115
+ const edges = Array.isArray(f.edges) ? f.edges : [];
116
+ const nodeTypes = Array.isArray(f.node_types) ? f.node_types : [];
117
+ const structureAll = [
118
+ {
119
+ key: "node_count",
120
+ label: "Nodes",
121
+ value: typeof f.node_count === "number" ? f.node_count : nodes.length,
122
+ },
123
+ { key: "edge_count", label: "Edges", value: edges.length },
124
+ {
125
+ key: "node_types",
126
+ label: "Node types",
127
+ value: nodeTypes.length > 0 ? nodeTypes.join(", ") : null,
128
+ },
129
+ {
130
+ key: "is_compiled",
131
+ label: "Compiled",
132
+ value: isFlowCompiled(flow),
133
+ format: "boolean",
134
+ },
135
+ { key: "version", label: "Version", value: typeof f.version === "number" ? f.version : null },
136
+ { key: "updated_at", label: "Updated", value: str(f.updated_at), format: "date" },
137
+ ];
138
+ const structure = structureAll.filter((e) => e.value !== null);
139
+ const groups = [{ label: "Flow", entries: overview }];
140
+ if (structure.length > 0)
141
+ groups.push({ label: "Structure", entries: structure });
142
+ groups.push({
143
+ // IA-10 (W3.9): actionable next steps in a dedicated group — visible in
144
+ // the LLM-readable detail text.
145
+ label: "Next steps",
146
+ entries: [
147
+ {
148
+ key: "compile",
149
+ label: "Publish",
150
+ value: `apimapper_flow_compile({ id: '${id}' }) — compile + publish to the YOOtheme dropdown`,
151
+ },
152
+ {
153
+ key: "trace",
154
+ label: "Debug",
155
+ value: `apimapper_flow_trace({ id: '${id}' }) — inspect the last run's per-step timing`,
156
+ },
157
+ {
158
+ key: "update",
159
+ label: "Edit",
160
+ value: `apimapper_flow_update({ id: '${id}', patch: { … } }) — modify nodes/edges`,
161
+ },
162
+ ],
163
+ });
164
+ // W2 sidecar: render the flow diagram from the flow's own nodes + edges.
165
+ // buildFlowVisualization returns null when the ENV opt-out is set or the
166
+ // shape is not renderable — in that case no appendText is attached.
167
+ const viz = buildFlowVisualization({
168
+ nodes: f.nodes,
169
+ edges: f.edges,
170
+ id: str(f.id) ?? id,
171
+ name: str(f.name) ?? undefined,
172
+ });
173
+ // F-LS-07 (W3.1 Stage 2): live-smoke (2026-05-20) showed that callers
174
+ // needed a second tool call to inspect exact edge wiring + node data
175
+ // attributes (e.g. connectionId on a source). The Structure group carries
176
+ // only counts; this block surfaces the raw nodes+edges JSON behind a clear
177
+ // header so the LLM can read the wiring inline. `compiled` artifacts stay
178
+ // out of the appendText — they are large enough to blow the token cap and
179
+ // already reachable via apimapper_flow_compile.
180
+ const structureBlock = "Flow structure (JSON):\n" +
181
+ "```json\n" +
182
+ JSON.stringify({ nodes, edges }, null, 2) +
183
+ "\n```";
184
+ // F-LS-08b (W3.1 Stage 3): when the W2 sidecar produced a diagram, prepend
185
+ // a clear "pre-rendered" header so the LLM treats the ASCII block as a
186
+ // ready-to-show artifact and re-uses it directly rather than calling
187
+ // apimapper_render({type:'flow-diagram', ...}) again. Live-smoke
188
+ // (2026-05-20) showed callers re-rendering the same diagram. The header
189
+ // still leaves the apimapper_render door open for layout-variant requests.
190
+ const diagramHeader = viz
191
+ ? "[Pre-rendered ASCII flow-diagram below — re-use this directly. " +
192
+ "Call apimapper_render({ type: 'flow-diagram', data }) only if a " +
193
+ "different layout is needed.]\n\n"
194
+ : "";
195
+ const appendParts = [];
196
+ if (viz)
197
+ appendParts.push(diagramHeader + viz.diagram);
198
+ appendParts.push(structureBlock);
199
+ const appendText = appendParts.join("\n\n");
200
+ return detailResult({
201
+ title: str(f.name) ?? id,
202
+ subtitle: str(f.source) ?? undefined,
203
+ badge: isFlowCompiled(flow)
204
+ ? { text: "Compiled", variant: "success" }
205
+ : { text: "Draft", variant: "secondary" },
206
+ groups,
207
+ // The ASCII diagram + structure JSON are LLM-readable detail, not Rich
208
+ // Card content (the Rich Card payload mirrors the `groups`).
209
+ appendText,
210
+ });
211
+ }
212
+ /**
213
+ * Build a structured timeline view for a flow execution trace (flow_trace).
214
+ *
215
+ * The trace's per-step timing map naturally onto timeline events: each step
216
+ * becomes one event with its node id as the title, the item count + duration
217
+ * as the detail, and a relative `[step N]` time label (the trace carries no
218
+ * wall-clock per step, only durations). Shapes vary across backend versions,
219
+ * so every field read is defensive.
220
+ */
221
+ export function buildFlowTraceTimeline(id, steps, totalMs) {
222
+ const num = (v) => typeof v === "number" && Number.isFinite(v) ? v : undefined;
223
+ const events = steps.map((raw, idx) => {
224
+ const s = raw && typeof raw === "object" ? raw : {};
225
+ const nodeId = str(s.node_id) ?? str(s.nodeId) ?? str(s.id) ?? str(s.node) ?? `step ${idx + 1}`;
226
+ const itemCount = num(s.item_count) ?? num(s.itemCount) ?? num(s.count);
227
+ const durationMs = num(s.duration_ms) ?? num(s.durationMs) ?? num(s.fetch_ms) ?? num(s.fetchMs) ?? num(s.ms);
228
+ const stepType = str(s.type) ?? str(s.node_type);
229
+ const detailParts = [];
230
+ if (itemCount !== undefined)
231
+ detailParts.push(`${itemCount} items`);
232
+ if (durationMs !== undefined)
233
+ detailParts.push(`${durationMs} ms`);
234
+ const stepError = str(s.error);
235
+ if (stepError)
236
+ detailParts.push(`error: ${stepError}`);
237
+ return {
238
+ id: `step-${idx}`,
239
+ time: `step ${idx + 1}`,
240
+ title: stepType ? `${nodeId} (${stepType})` : nodeId,
241
+ detail: detailParts.length > 0 ? detailParts.join(" · ") : undefined,
242
+ type: stepError ? "error" : "system",
243
+ source: nodeId,
244
+ };
245
+ });
246
+ const totalLabel = typeof totalMs === "number" ? ` · ${totalMs} ms total` : "";
247
+ return timelineResult({
248
+ title: `Trace: ${id} — ${steps.length} step${steps.length === 1 ? "" : "s"}${totalLabel}`,
249
+ events,
250
+ });
251
+ }
252
+ /**
253
+ * Build a structured detail view for a flow-import-bundle validation result
254
+ * (flow_import_validate). The REST result is a flat validation envelope
255
+ * ({valid, flowName, exportedFrom, connectionReferences}) — detailResult is
256
+ * the clean fit. Array fields flatten to a count + per-item entries (note 4).
257
+ * IA-10: a dedicated "Next steps" group carries the import/abort guidance.
258
+ */
259
+ export function buildImportValidateDetail(opts) {
260
+ const refs = opts.connectionReferences;
261
+ const summary = [
262
+ { key: "valid", label: "Valid", value: opts.valid, format: "boolean" },
263
+ { key: "flow_name", label: "Flow name", value: opts.flowName ?? null },
264
+ {
265
+ key: "exported_from",
266
+ label: "Exported from",
267
+ value: opts.exportedFrom ?? null,
268
+ },
269
+ ];
270
+ // Array field → count + per-item label entries (detailResult is scalar-only).
271
+ const refEntries = [
272
+ { key: "ref_count", label: "Connection references", value: refs.length },
273
+ ...refs.map((ref, idx) => {
274
+ const r = ref && typeof ref === "object" ? ref : {};
275
+ const label = str(r.name) ?? str(r.id) ?? `reference ${idx + 1}`;
276
+ return {
277
+ key: `ref_${idx}`,
278
+ label: ` ${str(r.id) ?? idx + 1}`,
279
+ value: label,
280
+ };
281
+ }),
282
+ ];
283
+ const groups = [
284
+ { label: "Validation", entries: summary.filter((e) => e.value !== null) },
285
+ { label: "References", entries: refEntries },
286
+ {
287
+ label: "Next steps",
288
+ entries: opts.valid
289
+ ? [
290
+ {
291
+ key: "import",
292
+ label: "Import",
293
+ value: "apimapper_flow_import({ bundle }) — the bundle validated; safe to import",
294
+ },
295
+ {
296
+ key: "credentials",
297
+ label: "Re-link auth",
298
+ value: "Auth-protected references need a credential on the target site — apimapper_credential_list({})",
299
+ },
300
+ ]
301
+ : [
302
+ {
303
+ key: "fix",
304
+ label: "Fix",
305
+ value: "The bundle did not validate — review the missing connections / schema mismatches above before importing",
306
+ },
307
+ ],
308
+ },
309
+ ];
310
+ return detailResult({
311
+ title: opts.flowName ? `Import bundle: ${opts.flowName}` : "Import bundle validation",
312
+ badge: opts.valid
313
+ ? { text: "Valid", variant: "success" }
314
+ : { text: "Invalid", variant: "destructive" },
315
+ groups,
316
+ });
317
+ }
318
+ //# sourceMappingURL=flows-format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"flows-format.js","sourceRoot":"","sources":["../../../src/modules/apimapper/flows-format.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,EAAE;AACF,6EAA6E;AAC7E,wEAAwE;AACxE,4EAA4E;AAC5E,8EAA8E;AAC9E,2EAA2E;AAC3E,sEAAsE;AACtE,EAAE;AACF,yEAAyE;AACzE,4EAA4E;AAC5E,8EAA8E;AAC9E,+CAA+C;AAC/C,8EAA8E;AAC9E,2EAA2E;AAC3E,OAAO,EACL,YAAY,EACZ,cAAc,GAKf,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,yEAAyE;AACzE,4EAA4E;AAC5E,6EAA6E;AAC7E,6EAA6E;AAC7E,MAAM,CAAC,MAAM,kBAAkB,GAAkB;IAC/C,sEAAsE;IACtE,yEAAyE;IACzE,sEAAsE;IACtE,sCAAsC;IACtC,EAAE,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,EA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BACF;gBACH,CAAC,CAAC;oBACE;wBACE,GAAG,EAAE,KAAK;wBACV,KAAK,EAAE,KAAK;wBACZ,KAAK,EACH,yGAAyG;qBAC5G;iBACF;SACN;KACF,CAAC;IAEF,OAAO,YAAY,CAAC;QAClB,KAAK,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,kBAAkB,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,0BAA0B;QACrF,KAAK,EAAE,IAAI,CAAC,KAAK;YACf,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;YACvC,CAAC,CAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE;QAC/C,MAAM;KACP,CAAC,CAAC;AACL,CAAC"}
@@ -1,2 +1,13 @@
1
- import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
2
- export declare function registerFlowTools(server: McpServer): void;
1
+ import type { ToolRegistrar } from "./gateway/capturing-server.js";
2
+ import { type McpServerWithElicitation } from "./elicitation.js";
3
+ /**
4
+ * Register the flow CRUD + compile + detect-schema + trace + export/import
5
+ * tools.
6
+ *
7
+ * @param server the tool registrar (essentials forward, rest captured).
8
+ * @param elicitation optional elicitation capability (the real McpServer, or
9
+ * any `{ server: { elicitInput } }`). Supplied only by the host wiring in
10
+ * index.ts. When omitted, `flow_compile` falls back to a structured error
11
+ * on genuine flow ambiguity instead of prompting.
12
+ */
13
+ export declare function registerFlowTools(server: ToolRegistrar, elicitation?: McpServerWithElicitation): void;