@walkeros/mcp 3.1.0 → 3.1.1
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/dist/index.js +54 -94
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.js
CHANGED
|
@@ -114,7 +114,6 @@ function registerFlowValidateTool(server2) {
|
|
|
114
114
|
flow,
|
|
115
115
|
path
|
|
116
116
|
});
|
|
117
|
-
const summary = result.valid ? "Valid" : `Invalid: ${result.errors.length} errors, ${result.warnings.length} warnings`;
|
|
118
117
|
const hints = result.valid ? {
|
|
119
118
|
next: [
|
|
120
119
|
"Use flow_simulate to test event flow",
|
|
@@ -126,7 +125,7 @@ function registerFlowValidateTool(server2) {
|
|
|
126
125
|
"Read walkeros://reference/flow-schema for correct structure"
|
|
127
126
|
]
|
|
128
127
|
};
|
|
129
|
-
return mcpResult(result,
|
|
128
|
+
return mcpResult(result, hints);
|
|
130
129
|
} catch (error) {
|
|
131
130
|
return mcpError(
|
|
132
131
|
error,
|
|
@@ -172,16 +171,15 @@ function registerFlowBundleTool(server2) {
|
|
|
172
171
|
content,
|
|
173
172
|
flowName: flow
|
|
174
173
|
});
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
});
|
|
174
|
+
return mcpResult2(
|
|
175
|
+
{ success: true, ...result2 },
|
|
176
|
+
{
|
|
177
|
+
next: [
|
|
178
|
+
"Use flow_simulate to test",
|
|
179
|
+
"Use api({ action: 'deploy' }) to publish"
|
|
180
|
+
]
|
|
181
|
+
}
|
|
182
|
+
);
|
|
185
183
|
}
|
|
186
184
|
const result = await bundle(configPath, {
|
|
187
185
|
flowName: flow,
|
|
@@ -191,7 +189,6 @@ function registerFlowBundleTool(server2) {
|
|
|
191
189
|
if (!result) {
|
|
192
190
|
return mcpResult2(
|
|
193
191
|
{ success: false, message: "Bundle produced no output" },
|
|
194
|
-
"Bundle produced no output",
|
|
195
192
|
{
|
|
196
193
|
warnings: [
|
|
197
194
|
"The build returned no result. The flow may be empty or misconfigured."
|
|
@@ -201,25 +198,21 @@ function registerFlowBundleTool(server2) {
|
|
|
201
198
|
);
|
|
202
199
|
}
|
|
203
200
|
const output_ = result;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
201
|
+
return mcpResult2(
|
|
202
|
+
{ success: true, ...output_ },
|
|
203
|
+
{
|
|
204
|
+
next: [
|
|
205
|
+
"Use flow_simulate to test",
|
|
206
|
+
"Use api({ action: 'deploy' }) to publish"
|
|
207
|
+
]
|
|
208
|
+
}
|
|
209
|
+
);
|
|
213
210
|
} catch (error) {
|
|
214
211
|
return mcpError2(error, "Run flow_validate for detailed error messages");
|
|
215
212
|
}
|
|
216
213
|
}
|
|
217
214
|
);
|
|
218
215
|
}
|
|
219
|
-
function formatBytes(bytes) {
|
|
220
|
-
if (bytes < 1024) return `${bytes} B`;
|
|
221
|
-
return `${(bytes / 1024).toFixed(1)} KB`;
|
|
222
|
-
}
|
|
223
216
|
|
|
224
217
|
// src/tools/simulate.ts
|
|
225
218
|
import { z as z3 } from "zod";
|
|
@@ -274,7 +267,6 @@ function registerFlowSimulateTool(server2) {
|
|
|
274
267
|
capturedEvents: raw.capturedEvents,
|
|
275
268
|
duration: raw.duration
|
|
276
269
|
},
|
|
277
|
-
summary2,
|
|
278
270
|
{
|
|
279
271
|
next: eventCount > 0 ? [
|
|
280
272
|
"Use flow_simulate with a destination step to test downstream processing"
|
|
@@ -318,7 +310,7 @@ function registerFlowSimulateTool(server2) {
|
|
|
318
310
|
destinations: destCount > 0 ? destinations : void 0,
|
|
319
311
|
duration: raw.duration
|
|
320
312
|
};
|
|
321
|
-
return mcpResult3(result,
|
|
313
|
+
return mcpResult3(result, {
|
|
322
314
|
next: ["Use flow_bundle to build for production"],
|
|
323
315
|
...warnings.length > 0 ? { warnings } : {}
|
|
324
316
|
});
|
|
@@ -369,8 +361,7 @@ function registerFlowPushTool(server2) {
|
|
|
369
361
|
"Check destination configuration and connectivity."
|
|
370
362
|
);
|
|
371
363
|
}
|
|
372
|
-
|
|
373
|
-
return mcpResult4(result, summary);
|
|
364
|
+
return mcpResult4(result);
|
|
374
365
|
} catch (error) {
|
|
375
366
|
return mcpError4(
|
|
376
367
|
error,
|
|
@@ -456,23 +447,20 @@ function registerFlowExamplesTool(server2) {
|
|
|
456
447
|
}
|
|
457
448
|
}
|
|
458
449
|
}
|
|
459
|
-
const stepSet = new Set(examples.map((e) => e.step));
|
|
460
450
|
const result = {
|
|
461
451
|
flow: flowName,
|
|
462
452
|
count: examples.length,
|
|
463
453
|
examples
|
|
464
454
|
};
|
|
465
|
-
const totalExamples = examples.length;
|
|
466
|
-
const summary = `${totalExamples} examples across ${stepSet.size} steps`;
|
|
467
455
|
const hints = {
|
|
468
456
|
next: ["Use flow_simulate with step and event to simulate"]
|
|
469
457
|
};
|
|
470
|
-
if (
|
|
458
|
+
if (examples.length === 0) {
|
|
471
459
|
hints.warnings = [
|
|
472
460
|
"No examples found. Add examples to step definitions in your flow config for testing."
|
|
473
461
|
];
|
|
474
462
|
}
|
|
475
|
-
return mcpResult5(result,
|
|
463
|
+
return mcpResult5(result, hints);
|
|
476
464
|
} catch (error) {
|
|
477
465
|
return mcpError5(error, "Check configPath \u2014 expected a flow.json file");
|
|
478
466
|
}
|
|
@@ -594,8 +582,7 @@ function registerPackageSearchTool(server2) {
|
|
|
594
582
|
if (!packageName) {
|
|
595
583
|
const catalog = await fetchCatalog({ type, platform });
|
|
596
584
|
const result = { catalog, count: catalog.length };
|
|
597
|
-
|
|
598
|
-
return mcpResult6(result, summary, {
|
|
585
|
+
return mcpResult6(result, {
|
|
599
586
|
next: ["Use package_get for schemas and examples"]
|
|
600
587
|
});
|
|
601
588
|
}
|
|
@@ -610,8 +597,7 @@ function registerPackageSearchTool(server2) {
|
|
|
610
597
|
hintKeys: info.hintKeys,
|
|
611
598
|
exampleSummaries: info.exampleSummaries
|
|
612
599
|
};
|
|
613
|
-
|
|
614
|
-
return mcpResult6(result, summary, {
|
|
600
|
+
return mcpResult6(result, {
|
|
615
601
|
next: ["Use package_get for schemas and examples"]
|
|
616
602
|
});
|
|
617
603
|
} catch (error) {
|
|
@@ -685,10 +671,7 @@ function registerGetPackageSchemaTool(server2) {
|
|
|
685
671
|
} else {
|
|
686
672
|
result.exampleSummaries = info.exampleSummaries;
|
|
687
673
|
}
|
|
688
|
-
|
|
689
|
-
const exampleCount = info.exampleSummaries.length;
|
|
690
|
-
const summary = `${info.packageName} \u2014 ${schemaCount} schemas, ${exampleCount} examples`;
|
|
691
|
-
return mcpResult6(result, summary);
|
|
674
|
+
return mcpResult6(result);
|
|
692
675
|
} catch (error) {
|
|
693
676
|
return mcpError6(
|
|
694
677
|
error,
|
|
@@ -754,16 +737,12 @@ function registerFlowLoadTool(server2) {
|
|
|
754
737
|
try {
|
|
755
738
|
if (source) {
|
|
756
739
|
const config = await loadJsonConfig2(source);
|
|
757
|
-
return mcpResult7(
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
"Use add-step prompt to modify"
|
|
764
|
-
]
|
|
765
|
-
}
|
|
766
|
-
);
|
|
740
|
+
return mcpResult7(config, {
|
|
741
|
+
next: [
|
|
742
|
+
"Use flow_validate to check",
|
|
743
|
+
"Use add-step prompt to modify"
|
|
744
|
+
]
|
|
745
|
+
});
|
|
767
746
|
}
|
|
768
747
|
if (!platform) {
|
|
769
748
|
return mcpError7(
|
|
@@ -773,16 +752,12 @@ function registerFlowLoadTool(server2) {
|
|
|
773
752
|
);
|
|
774
753
|
}
|
|
775
754
|
const skeleton = platform === "web" ? WEB_SKELETON : SERVER_SKELETON;
|
|
776
|
-
return mcpResult7(
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
"Use add-step prompt to add sources and destinations"
|
|
783
|
-
]
|
|
784
|
-
}
|
|
785
|
-
);
|
|
755
|
+
return mcpResult7(skeleton, {
|
|
756
|
+
next: [
|
|
757
|
+
"Read walkeros://reference/flow-schema for config structure",
|
|
758
|
+
"Use add-step prompt to add sources and destinations"
|
|
759
|
+
]
|
|
760
|
+
});
|
|
786
761
|
} catch (error) {
|
|
787
762
|
const msg = error instanceof Error ? error.message : "";
|
|
788
763
|
if (msg.includes("not found") || msg.includes("ENOENT"))
|
|
@@ -827,7 +802,6 @@ function registerFeedbackTool(server2) {
|
|
|
827
802
|
if (anonymous === void 0 && explicitAnonymous === void 0) {
|
|
828
803
|
return mcpResult8(
|
|
829
804
|
{ needsConsent: true },
|
|
830
|
-
'Before sending feedback, ask the user: "Would you like to include your user and project info with feedback? This is a one-time choice." Then call feedback again with the anonymous parameter set.',
|
|
831
805
|
{
|
|
832
806
|
next: [
|
|
833
807
|
"Ask the user if they want to include their info",
|
|
@@ -842,8 +816,8 @@ function registerFeedbackTool(server2) {
|
|
|
842
816
|
writeConfig({ ...base, anonymousFeedback: anonymous });
|
|
843
817
|
}
|
|
844
818
|
const isAnonymous = explicitAnonymous ?? anonymous ?? true;
|
|
845
|
-
await feedback(text, { anonymous: isAnonymous, version: "3.1.
|
|
846
|
-
return mcpResult8({ ok: true }
|
|
819
|
+
await feedback(text, { anonymous: isAnonymous, version: "3.1.1" });
|
|
820
|
+
return mcpResult8({ ok: true });
|
|
847
821
|
} catch (error) {
|
|
848
822
|
return mcpError8(error);
|
|
849
823
|
}
|
|
@@ -956,40 +930,33 @@ function registerApiTool(server2) {
|
|
|
956
930
|
} = params;
|
|
957
931
|
try {
|
|
958
932
|
let data;
|
|
959
|
-
let summary;
|
|
960
933
|
switch (action) {
|
|
961
934
|
// Auth
|
|
962
935
|
case "whoami": {
|
|
963
936
|
data = await whoami();
|
|
964
|
-
summary = `Authenticated as ${data.email}`;
|
|
965
937
|
break;
|
|
966
938
|
}
|
|
967
939
|
// Projects
|
|
968
940
|
case "project.list": {
|
|
969
941
|
data = await listProjects();
|
|
970
|
-
summary = `${(data.projects ?? []).length} projects`;
|
|
971
942
|
break;
|
|
972
943
|
}
|
|
973
944
|
case "project.get": {
|
|
974
945
|
data = await getProject({ projectId });
|
|
975
|
-
summary = `Project "${data.name}"`;
|
|
976
946
|
break;
|
|
977
947
|
}
|
|
978
948
|
case "project.create": {
|
|
979
949
|
if (!name) throw new Error("name required for project.create");
|
|
980
950
|
data = await createProject({ name });
|
|
981
|
-
summary = `Created project "${name}"`;
|
|
982
951
|
break;
|
|
983
952
|
}
|
|
984
953
|
case "project.update": {
|
|
985
954
|
if (!name) throw new Error("name required for project.update");
|
|
986
955
|
data = await updateProject({ projectId, name });
|
|
987
|
-
summary = `Updated project "${name}"`;
|
|
988
956
|
break;
|
|
989
957
|
}
|
|
990
958
|
case "project.delete": {
|
|
991
959
|
data = await deleteProject({ projectId });
|
|
992
|
-
summary = `Deleted project ${projectId ?? "default"}`;
|
|
993
960
|
break;
|
|
994
961
|
}
|
|
995
962
|
// Flows
|
|
@@ -1000,20 +967,17 @@ function registerApiTool(server2) {
|
|
|
1000
967
|
order,
|
|
1001
968
|
includeDeleted
|
|
1002
969
|
});
|
|
1003
|
-
summary = `${(data.flows ?? []).length} flows`;
|
|
1004
970
|
break;
|
|
1005
971
|
}
|
|
1006
972
|
case "flow.get": {
|
|
1007
973
|
if (!flowId) throw new Error("flowId required for flow.get");
|
|
1008
974
|
data = await getFlow({ flowId, projectId, fields });
|
|
1009
|
-
summary = `Flow "${data.name}" (${flowId})`;
|
|
1010
975
|
break;
|
|
1011
976
|
}
|
|
1012
977
|
case "flow.create": {
|
|
1013
978
|
if (!name) throw new Error("name required for flow.create");
|
|
1014
979
|
if (!content) throw new Error("content required for flow.create");
|
|
1015
980
|
data = await createFlow({ name, content, projectId });
|
|
1016
|
-
summary = `Created flow "${name}" (${data.id})`;
|
|
1017
981
|
break;
|
|
1018
982
|
}
|
|
1019
983
|
case "flow.update": {
|
|
@@ -1025,19 +989,16 @@ function registerApiTool(server2) {
|
|
|
1025
989
|
projectId,
|
|
1026
990
|
mergePatch: patch ?? true
|
|
1027
991
|
});
|
|
1028
|
-
summary = `Updated flow ${flowId}`;
|
|
1029
992
|
break;
|
|
1030
993
|
}
|
|
1031
994
|
case "flow.delete": {
|
|
1032
995
|
if (!flowId) throw new Error("flowId required for flow.delete");
|
|
1033
996
|
data = await deleteFlow({ flowId, projectId });
|
|
1034
|
-
summary = `Deleted flow ${flowId}`;
|
|
1035
997
|
break;
|
|
1036
998
|
}
|
|
1037
999
|
case "flow.duplicate": {
|
|
1038
1000
|
if (!flowId) throw new Error("flowId required for flow.duplicate");
|
|
1039
1001
|
data = await duplicateFlow({ flowId, name, projectId });
|
|
1040
|
-
summary = `Duplicated flow ${flowId}`;
|
|
1041
1002
|
break;
|
|
1042
1003
|
}
|
|
1043
1004
|
// Deploy
|
|
@@ -1098,12 +1059,13 @@ function registerApiTool(server2) {
|
|
|
1098
1059
|
const st = data.status;
|
|
1099
1060
|
const deployData = data;
|
|
1100
1061
|
if (st === "failed") {
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1062
|
+
return mcpResult9(
|
|
1063
|
+
{ action, ok: false, data },
|
|
1064
|
+
{
|
|
1065
|
+
next: ["Run flow_validate to check your configuration"]
|
|
1066
|
+
}
|
|
1067
|
+
);
|
|
1105
1068
|
} else {
|
|
1106
|
-
summary = `Deployed flow ${flowId} \u2014 status: ${st}`;
|
|
1107
1069
|
const publicUrl = deployData.publicUrl;
|
|
1108
1070
|
const containerUrl = deployData.containerUrl;
|
|
1109
1071
|
const deployType = deployData.type;
|
|
@@ -1116,9 +1078,12 @@ function registerApiTool(server2) {
|
|
|
1116
1078
|
nextHints.push(`Test: curl ${containerUrl}/health`);
|
|
1117
1079
|
}
|
|
1118
1080
|
if (nextHints.length > 0) {
|
|
1119
|
-
return mcpResult9(
|
|
1120
|
-
|
|
1121
|
-
|
|
1081
|
+
return mcpResult9(
|
|
1082
|
+
{ action, ok: true, data },
|
|
1083
|
+
{
|
|
1084
|
+
next: nextHints
|
|
1085
|
+
}
|
|
1086
|
+
);
|
|
1122
1087
|
}
|
|
1123
1088
|
}
|
|
1124
1089
|
break;
|
|
@@ -1134,7 +1099,6 @@ function registerApiTool(server2) {
|
|
|
1134
1099
|
} catch {
|
|
1135
1100
|
data = await getDeploymentBySlug({ slug: flowId });
|
|
1136
1101
|
}
|
|
1137
|
-
summary = `Deployment ${data.slug ?? flowId} \u2014 ${data.status}`;
|
|
1138
1102
|
break;
|
|
1139
1103
|
}
|
|
1140
1104
|
case "deployment.list": {
|
|
@@ -1143,7 +1107,6 @@ function registerApiTool(server2) {
|
|
|
1143
1107
|
type,
|
|
1144
1108
|
status
|
|
1145
1109
|
});
|
|
1146
|
-
summary = `${(data.deployments ?? []).length} deployments`;
|
|
1147
1110
|
break;
|
|
1148
1111
|
}
|
|
1149
1112
|
case "deployment.create": {
|
|
@@ -1152,14 +1115,12 @@ function registerApiTool(server2) {
|
|
|
1152
1115
|
"type (web/server) required for deployment.create"
|
|
1153
1116
|
);
|
|
1154
1117
|
data = await createDep({ type, label: name, projectId });
|
|
1155
|
-
summary = `Created ${type} deployment ${data.slug}`;
|
|
1156
1118
|
break;
|
|
1157
1119
|
}
|
|
1158
1120
|
case "deployment.delete": {
|
|
1159
1121
|
if (!flowId)
|
|
1160
1122
|
throw new Error("flowId (slug) required for deployment.delete");
|
|
1161
1123
|
data = await deleteDep({ slug: flowId });
|
|
1162
|
-
summary = `Deleted deployment ${flowId}`;
|
|
1163
1124
|
break;
|
|
1164
1125
|
}
|
|
1165
1126
|
default:
|
|
@@ -1167,7 +1128,7 @@ function registerApiTool(server2) {
|
|
|
1167
1128
|
`Unknown action: ${action}. Use one of: ${ACTIONS.join(", ")}`
|
|
1168
1129
|
);
|
|
1169
1130
|
}
|
|
1170
|
-
return mcpResult9({ action, ok: true, data }
|
|
1131
|
+
return mcpResult9({ action, ok: true, data });
|
|
1171
1132
|
} catch (error) {
|
|
1172
1133
|
const msg = error instanceof Error ? error.message : "";
|
|
1173
1134
|
const name2 = error instanceof Error ? error.name : "";
|
|
@@ -1178,7 +1139,6 @@ function registerApiTool(server2) {
|
|
|
1178
1139
|
ok: true,
|
|
1179
1140
|
data: { status: "deploying", flowId }
|
|
1180
1141
|
},
|
|
1181
|
-
`Deploy in progress (timed out waiting). Use deployment.list with projectId to check status.`,
|
|
1182
1142
|
{
|
|
1183
1143
|
next: [
|
|
1184
1144
|
'Use api(action: "deployment.list") to check current status'
|
|
@@ -1660,7 +1620,7 @@ function registerUseDefinitionsPrompt(server2) {
|
|
|
1660
1620
|
var server = new McpServer(
|
|
1661
1621
|
{
|
|
1662
1622
|
name: "walkeros-flow",
|
|
1663
|
-
version: "3.1.
|
|
1623
|
+
version: "3.1.1"
|
|
1664
1624
|
},
|
|
1665
1625
|
{
|
|
1666
1626
|
instructions: `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/tools/validate.ts","../src/schemas/output.ts","../src/tools/bundle.ts","../src/tools/simulate.ts","../src/tools/push.ts","../src/tools/examples.ts","../src/tools/package.ts","../src/catalog.ts","../src/tools/flow-load.ts","../src/tools/feedback.ts","../src/tools/api.ts","../src/schemas/api-output.ts","../src/resources/package-schemas.ts","../src/resources/references.ts","../src/prompts/add-step.ts","../src/prompts/setup-mapping.ts","../src/prompts/manage-contract.ts","../src/prompts/use-definitions.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nimport { registerFlowValidateTool } from './tools/validate.js';\nimport { registerFlowBundleTool } from './tools/bundle.js';\nimport { registerFlowSimulateTool } from './tools/simulate.js';\nimport { registerFlowPushTool } from './tools/push.js';\nimport { registerFlowExamplesTool } from './tools/examples.js';\nimport {\n registerPackageSearchTool,\n registerGetPackageSchemaTool,\n} from './tools/package.js';\nimport { registerFlowLoadTool } from './tools/flow-load.js';\nimport { registerFeedbackTool } from './tools/feedback.js';\nimport { registerApiTool } from './tools/api.js';\nimport { registerPackageSchemaResources } from './resources/package-schemas.js';\nimport { registerReferenceResources } from './resources/references.js';\nimport { registerAddStepPrompt } from './prompts/add-step.js';\nimport { registerSetupMappingPrompt } from './prompts/setup-mapping.js';\nimport { registerManageContractPrompt } from './prompts/manage-contract.js';\nimport { registerUseDefinitionsPrompt } from './prompts/use-definitions.js';\n\ndeclare const __VERSION__: string;\n\nconst server = new McpServer(\n {\n name: 'walkeros-flow',\n version: __VERSION__,\n },\n {\n instructions: `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.\n\n## Architecture: Source → Collector → Destination(s)\n\nEvery component in a flow is a **step**: sources capture events, transformers process them, destinations deliver them, stores provide shared state. Steps connect via \\`next\\` (pre-collector) and \\`before\\` (post-collector) chains.\n\n## Flow Config Structure\n\nEvery flow config follows this shape:\n\n\\`\\`\\`json\n{\n \"version\": 3,\n \"flows\": {\n \"default\": {\n \"web\": {},\n \"sources\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": {} } },\n \"destinations\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": { \"settings\": {} } } }\n }\n }\n}\n\\`\\`\\`\n\nEvent format: \\`{ name: \"entity action\", data: {...}, entity: \"...\", action: \"...\" }\\`. Sources convert raw input into this format.\n\nKey rules:\n- \\`version: 3\\` is required\n- Each flow must have exactly one of \\`web: {}\\` or \\`server: {}\\`\n- Destination settings go inside \\`config.settings\\`, not directly on the destination\n- Read \\`walkeros://reference/flow-schema\\` for the full annotated structure\n\n## Getting Started\n\n1. \\`flow_load({ platform: \"web\" })\\` or \\`flow_load({ source: \"./flow.json\" })\\` — create or load a flow (also accepts inline JSON strings or URLs)\n2. \\`package_search({ type: \"destination\", platform: \"web\" })\\` — discover available packages\n3. Use the \\`add-step\\` prompt to add sources, destinations, transformers, or stores\n4. Use the \\`setup-mapping\\` prompt to configure event transformations\n5. \\`flow_validate({ type: \"flow\", input: \"flow.json\" })\\` — verify configuration\n6. \\`flow_simulate({ configPath: \"flow.json\", event: \"...\" })\\` — test with mocked API calls\n7. \\`flow_bundle({ configPath: \"flow.json\" })\\` — build deployable JavaScript\n8. \\`api({ action: \"deploy\", id: \"cfg_...\" })\\` — deploy to walkerOS cloud (requires WALKEROS_TOKEN env var; unavailable without it)\n\nIf validation fails, fix the reported errors and re-validate. Do not skip validation.\n\n## Reference Resources\n\nRead these before constructing configs manually: \\`walkeros://reference/flow-schema\\`, \\`walkeros://reference/mapping\\`, \\`walkeros://reference/event-model\\`, \\`walkeros://reference/consent\\`, \\`walkeros://reference/variables\\`, \\`walkeros://reference/contract\\`, \\`walkeros://reference/examples\\`.\n\n## Key Concepts\n\n- **Steps** are sources, destinations, transformers, or stores — each backed by an npm package. Use \\`package_search\\` to browse, \\`package_get\\` for schemas and examples. \\`package_get\\` returns \\`schemas.config\\` — a merged JSON Schema combining base config fields (consent, require, logger, mapping, etc.) with the package's typed settings. Non-config schemas (mapping rules, utility schemas) remain as sibling keys.\n- **Mapping** transforms events using data/map/loop/set/condition rules. Same syntax on sources and destinations. Mapping rules use NESTED entity → action keying: event name \"product add\" maps to \\`{ \"product\": { \"add\": Rule } }\\`. Wildcards: \\`{ \"*\": { \"view\": Rule } }\\`.\n- **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.\n- **Variables** (\\$var, \\$env, \\$def, \\$code, \\$store) enable DRY, environment-aware config. Use the \\`use-definitions\\` prompt to extract shared patterns.\n- **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.`,\n },\n);\n\nregisterFlowValidateTool(server);\nregisterFlowBundleTool(server);\nregisterFlowSimulateTool(server);\nregisterFlowPushTool(server);\nregisterFlowExamplesTool(server);\nregisterPackageSearchTool(server);\nregisterGetPackageSchemaTool(server);\nregisterFlowLoadTool(server);\nregisterFeedbackTool(server);\nregisterPackageSchemaResources(server);\nregisterReferenceResources(server);\nregisterAddStepPrompt(server);\nregisterSetupMappingPrompt(server);\nregisterManageContractPrompt(server);\nregisterUseDefinitionsPrompt(server);\n\nif (process.env.WALKEROS_TOKEN) {\n registerApiTool(server);\n}\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('walkerOS Flow MCP server running on stdio');\n}\n\nmain().catch((error) => {\n console.error('Failed to start Flow MCP server:', error);\n process.exit(1);\n});\n","import { validate } from '@walkeros/cli';\nimport type { ValidateResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ValidateOutputShape } from '../schemas/output.js';\n\nexport function registerFlowValidateTool(server: McpServer) {\n server.registerTool(\n 'flow_validate',\n {\n title: 'Validate Flow',\n description:\n 'Validate walkerOS events, flow configurations, mapping rules, or data contracts. ' +\n 'Accepts JSON strings, file paths, or URLs as input. ' +\n 'Returns validation results with errors, warnings, and details.',\n inputSchema: schemas.ValidateInputShape,\n outputSchema: ValidateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ type, input, flow, path }) => {\n try {\n const result: ValidateResult = await validate(type, input, {\n flow,\n path,\n });\n const summary = result.valid\n ? 'Valid'\n : `Invalid: ${result.errors.length} errors, ${result.warnings.length} warnings`;\n const hints = result.valid\n ? {\n next: [\n 'Use flow_simulate to test event flow',\n 'Use flow_bundle to build',\n ],\n }\n : {\n next: [\n 'Fix errors above, then run flow_validate again',\n 'Read walkeros://reference/flow-schema for correct structure',\n ],\n };\n return mcpResult(result, summary, hints);\n } catch (error) {\n return mcpError(\n error,\n 'Check the input parameter — expected a JSON string, file path, or URL',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\n\n// CLI tool output shapes\nexport const ValidateOutputShape = {\n valid: z.boolean().describe('Whether validation passed'),\n type: z\n .union([\n z.enum(['contract', 'entry', 'event', 'flow', 'mapping']),\n z.string().regex(/^(destinations|sources|transformers)\\.\\w+$/),\n ])\n .describe('What was validated'),\n errors: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n value: z.unknown().optional(),\n code: z.string().optional(),\n }),\n )\n .describe('Validation errors'),\n warnings: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n suggestion: z.string().optional(),\n }),\n )\n .describe('Validation warnings'),\n details: z\n .record(z.string(), z.unknown())\n .describe('Additional validation details'),\n};\n\nexport const BundleOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n totalSize: z.number().optional().describe('Total bundle size in bytes'),\n buildTime: z.number().optional().describe('Build time in milliseconds'),\n packages: z\n .array(\n z.object({\n name: z.string(),\n size: z.number(),\n }),\n )\n .optional()\n .describe('Per-package size breakdown'),\n treeshakingEffective: z\n .boolean()\n .optional()\n .describe('Whether tree-shaking was effective'),\n message: z.string().optional().describe('Status message'),\n};\n\nexport const SimulateOutputShape = {\n success: z.boolean().describe('Whether simulation succeeded'),\n error: z.string().optional().describe('Error message if failed'),\n summary: z.string().describe('One-line result summary'),\n destinations: z\n .record(\n z.string(),\n z.object({\n received: z\n .boolean()\n .describe('Whether destination received the event'),\n calls: z.number().describe('Number of API calls made'),\n payload: z\n .unknown()\n .optional()\n .describe('Full payload (only when verbose: true)'),\n }),\n )\n .optional()\n .describe('Per-destination results'),\n capturedEvents: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Events captured by source simulation'),\n duration: z.number().optional().describe('Simulation duration in ms'),\n};\n\nexport const PushOutputShape = {\n success: z.boolean().describe('Whether push succeeded'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n duration: z.number().describe('Push duration in milliseconds'),\n error: z.string().optional().describe('Error message if push failed'),\n};\n\n// Examples List output shape\nexport const ExamplesListOutputShape = {\n flow: z.string().describe('Flow name'),\n count: z.number().describe('Number of examples found'),\n examples: z\n .array(\n z.object({\n step: z.string().describe('Step location (e.g., \"destination.gtag\")'),\n stepType: z\n .enum(['source', 'transformer', 'destination'])\n .describe('Step type'),\n stepName: z.string().describe('Step name'),\n exampleName: z.string().describe('Example name'),\n hasIn: z.boolean().describe('Whether the example has an input value'),\n hasOut: z.boolean().describe('Whether the example has an output value'),\n hasMapping: z\n .boolean()\n .describe('Whether the example has a mapping configuration'),\n hasTrigger: z\n .boolean()\n .describe('Whether the example has trigger metadata'),\n in: z.unknown().optional().describe('Input event data'),\n out: z.unknown().optional().describe('Expected output data'),\n mapping: z\n .unknown()\n .optional()\n .describe('Mapping configuration for destinations'),\n trigger: z\n .object({\n type: z.string().optional(),\n options: z.unknown().optional(),\n })\n .optional()\n .describe('Trigger metadata for source simulation'),\n }),\n )\n .describe('Step examples'),\n};\n","import { z } from 'zod';\nimport { bundle, bundleRemote } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { BundleOutputShape } from '../schemas/output.js';\n\nexport function registerFlowBundleTool(server: McpServer) {\n server.registerTool(\n 'flow_bundle',\n {\n title: 'Bundle Flow',\n description:\n 'Bundle a walkerOS flow configuration into deployable JavaScript. ' +\n 'Resolves all destinations, sources, and transformers, then outputs ' +\n 'a tree-shaken production bundle. Returns bundle statistics. ' +\n 'Set remote: true to use the walkerOS cloud service instead of local build tools.',\n inputSchema: {\n ...schemas.BundleInputShape,\n remote: z\n .boolean()\n .optional()\n .describe(\n 'Use remote cloud bundling (requires WALKEROS_TOKEN). Default: false (local)',\n ),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON content (required when remote: true)'),\n },\n outputSchema: BundleOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, flow, stats, output, remote, content }) => {\n try {\n if (remote) {\n if (!content)\n throw new Error('content is required when remote: true');\n const result = await bundleRemote({\n content: content as Record<string, unknown>,\n flowName: flow,\n });\n const r = result as Record<string, unknown>;\n const size = r.totalSize ?? r.size;\n const time = r.buildTime;\n const summary = `Bundled${size ? ` (${formatBytes(size as number)}` : ''}${time ? `, ${time}ms)` : size ? ')' : ''}`;\n return mcpResult({ success: true, ...result }, summary, {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n });\n }\n\n const result = await bundle(configPath, {\n flowName: flow,\n stats: stats ?? true,\n buildOverrides: output ? { output } : undefined,\n });\n\n if (!result) {\n return mcpResult(\n { success: false, message: 'Bundle produced no output' },\n 'Bundle produced no output',\n {\n warnings: [\n 'The build returned no result. The flow may be empty or misconfigured.',\n ],\n next: ['Run flow_validate to check your configuration'],\n },\n );\n }\n\n const output_ = result as unknown as Record<string, unknown>;\n\n const size = output_.totalSize as number | undefined;\n const time = output_.buildTime as number | undefined;\n const summary = `Bundled${size ? ` (${formatBytes(size)}` : ''}${time ? `, ${time}ms)` : size ? ')' : ''}`;\n\n return mcpResult({ success: true, ...output_ }, summary, {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n });\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n\nfunction formatBytes(bytes: number): string {\n if (bytes < 1024) return `${bytes} B`;\n return `${(bytes / 1024).toFixed(1)} KB`;\n}\n","import { z } from 'zod';\nimport { simulate } from '@walkeros/cli';\nimport type { SimulationResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { SimulateOutputShape } from '../schemas/output.js';\n\ninterface DestinationSummary {\n received: boolean;\n calls: number;\n payload?: unknown;\n}\n\nexport function registerFlowSimulateTool(server: McpServer) {\n server.registerTool(\n 'flow_simulate',\n {\n title: 'Simulate Flow',\n description:\n 'Simulate events through a walkerOS flow without making real API calls. ' +\n 'For destinations: event is a walkerOS event { name: \"entity action\", data: {...} }. ' +\n 'For sources: event is { content: ..., trigger?: { type?, options? }, env?: {...} }. ' +\n 'Use step to target a specific step. ' +\n 'Use flow_examples to discover available test data.',\n inputSchema: {\n configPath: schemas.SimulateInputShape.configPath,\n event: z\n .union([z.record(z.string(), z.unknown()), z.string()])\n .optional()\n .describe(\n 'For destinations: { name, data }. For sources: { content, trigger?, env? }. ' +\n 'Can also be a JSON string or file path.',\n ),\n flow: schemas.SimulateInputShape.flow,\n platform: schemas.SimulateInputShape.platform,\n step: schemas.SimulateInputShape.step,\n verbose: z\n .boolean()\n .optional()\n .describe('Include full payload per destination (default: false)'),\n },\n outputSchema: SimulateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, event, flow, platform, step, verbose }) => {\n try {\n if (!event) {\n throw new Error(\n 'event is required. For sources provide { content, trigger? }, for destinations provide { name, data }.',\n );\n }\n\n const raw: SimulationResult = await simulate(configPath, event, {\n json: true,\n flow,\n platform,\n step,\n });\n\n // Source simulation returns capturedEvents\n if (raw.capturedEvents) {\n const eventCount = raw.capturedEvents.length;\n const summary = `Source captured ${eventCount} event${eventCount !== 1 ? 's' : ''}`;\n\n return mcpResult(\n {\n success: raw.success,\n error: raw.error,\n summary,\n capturedEvents: raw.capturedEvents,\n duration: raw.duration,\n },\n summary,\n {\n next:\n eventCount > 0\n ? [\n 'Use flow_simulate with a destination step to test downstream processing',\n ]\n : [\n 'Check source package examples with package_get, verify trigger type matches',\n ],\n },\n );\n }\n\n // Destination/transformer simulation\n const destinations: Record<string, DestinationSummary> = {};\n\n if (raw.usage) {\n for (const [name, calls] of Object.entries(raw.usage)) {\n const summary: DestinationSummary = {\n received: calls.length > 0,\n calls: calls.length,\n };\n if (verbose && calls.length > 0) {\n summary.payload = calls[calls.length - 1];\n }\n destinations[name] = summary;\n }\n }\n\n const destCount = Object.keys(destinations).length;\n const receivedCount = Object.values(destinations).filter(\n (d) => d.received,\n ).length;\n\n const warnings: string[] = [];\n if (destCount === 0) {\n warnings.push('No destinations found in flow configuration.');\n }\n if (destCount > 0 && receivedCount === 0) {\n warnings.push(\n 'No destinations received the event. Check: mapping keys use nested entity→action structure, event name matches, consent is granted.',\n );\n }\n\n const summary = `${receivedCount}/${destCount} destinations received the event`;\n\n const result = {\n success: raw.success,\n error: raw.error,\n summary,\n destinations: destCount > 0 ? destinations : undefined,\n duration: raw.duration,\n };\n\n return mcpResult(result, summary, {\n next: ['Use flow_bundle to build for production'],\n ...(warnings.length > 0 ? { warnings } : {}),\n });\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { push } from '@walkeros/cli';\nimport type { PushResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { PushOutputShape } from '../schemas/output.js';\n\nexport function registerFlowPushTool(server: McpServer) {\n server.registerTool(\n 'flow_push',\n {\n title: 'Push Events',\n description:\n 'Push a real event through a walkerOS flow to actual destinations. ' +\n 'Makes real API calls to real endpoints. ' +\n 'Best suited for server-side flows — web flows should use flow_simulate for testing.',\n inputSchema: {\n configPath: schemas.PushInputShape.configPath,\n event: z\n .record(z.string(), z.unknown())\n .describe(\n 'Event object, e.g. { name: \"page view\", data: { title: \"Home\" } }',\n ),\n flow: schemas.PushInputShape.flow,\n platform: schemas.PushInputShape.platform,\n },\n outputSchema: PushOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n const result: PushResult = await push(configPath, event, {\n json: true,\n flow,\n platform,\n });\n\n if (!result.success) {\n return mcpError(\n new Error(result.error || 'Push failed'),\n 'Check destination configuration and connectivity.',\n );\n }\n\n const summary = `Pushed event${result.duration ? ` (${result.duration}ms)` : ''}`;\n\n return mcpResult(result, summary);\n } catch (error) {\n return mcpError(\n error,\n 'Check configPath and event format. For web flows, use flow_simulate.',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport type { Flow } from '@walkeros/core';\nimport { ExamplesListOutputShape } from '../schemas/output.js';\n\nexport function registerFlowExamplesTool(server: McpServer) {\n server.registerTool(\n 'flow_examples',\n {\n title: 'Flow Examples',\n description:\n 'List all step examples in a walkerOS flow configuration. ' +\n 'Shows example names, step locations, and in/out shapes. ' +\n 'Use this to discover available test fixtures and simulation data.',\n inputSchema: {\n configPath: z\n .string()\n .min(1)\n .describe(\n 'Path to flow configuration file, URL, or inline JSON string',\n ),\n flow: z\n .string()\n .optional()\n .describe('Flow name for multi-flow configs'),\n step: z\n .string()\n .optional()\n .describe('Filter to a specific step (e.g., \"destination.gtag\")'),\n full: z\n .boolean()\n .optional()\n .describe(\n 'Return full in/out/mapping data for each example (default: false, returns metadata only)',\n ),\n },\n outputSchema: ExamplesListOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, flow, step, full }) => {\n try {\n const rawConfig = await loadJsonConfig<Flow.Config>(configPath);\n\n // Resolve flow name\n const flowNames = Object.keys(rawConfig.flows || {});\n const flowName =\n flow || (flowNames.length === 1 ? flowNames[0] : undefined);\n\n if (!flowName) {\n throw new Error(\n `Multiple flows found. Specify flow parameter. Available: ${flowNames.join(', ')}`,\n );\n }\n\n const flowSettings = rawConfig.flows[flowName];\n if (!flowSettings) {\n throw new Error(`Flow \"${flowName}\" not found`);\n }\n\n // Collect all examples\n const examples: Array<{\n step: string;\n stepType: string;\n stepName: string;\n exampleName: string;\n hasIn: boolean;\n hasOut: boolean;\n hasMapping: boolean;\n hasTrigger: boolean;\n in?: unknown;\n out?: unknown;\n mapping?: unknown;\n trigger?: unknown;\n }> = [];\n\n const stepTypes = [\n { key: 'sources' as const, type: 'source' },\n { key: 'transformers' as const, type: 'transformer' },\n { key: 'destinations' as const, type: 'destination' },\n ];\n\n for (const { key, type } of stepTypes) {\n const refs = flowSettings[key] || {};\n for (const [name, ref] of Object.entries(refs)) {\n if (!ref.examples) continue;\n\n // Apply step filter\n if (step && `${type}.${name}` !== step) continue;\n\n for (const [exName, ex] of Object.entries(\n ref.examples as Flow.StepExamples,\n )) {\n examples.push({\n step: `${type}.${name}`,\n stepType: type,\n stepName: name,\n exampleName: exName,\n hasIn: ex.in !== undefined,\n hasOut: ex.out !== undefined,\n hasMapping: ex.mapping !== undefined,\n hasTrigger: ex.trigger !== undefined,\n ...(full\n ? {\n in: ex.in,\n out: ex.out,\n mapping: ex.mapping,\n trigger: ex.trigger,\n }\n : {}),\n });\n }\n }\n }\n\n // Count unique steps\n const stepSet = new Set(examples.map((e) => e.step));\n\n const result = {\n flow: flowName,\n count: examples.length,\n examples,\n };\n\n const totalExamples = examples.length;\n const summary = `${totalExamples} examples across ${stepSet.size} steps`;\n const hints: { next: string[]; warnings?: string[] } = {\n next: ['Use flow_simulate with step and event to simulate'],\n };\n if (totalExamples === 0) {\n hints.warnings = [\n 'No examples found. Add examples to step definitions in your flow config for testing.',\n ];\n }\n return mcpResult(result, summary, hints);\n } catch (error) {\n return mcpError(error, 'Check configPath — expected a flow.json file');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n fetchPackage,\n mergeConfigSchema,\n mcpResult,\n mcpError,\n} from '@walkeros/core';\nimport { fetchCatalog, normalizePlatform } from '../catalog.js';\n\nexport function registerPackageSearchTool(server: McpServer) {\n server.registerTool(\n 'package_search',\n {\n title: 'Search Package',\n description:\n 'Browse walkerOS packages or look up a specific one. Without package name: returns catalog ' +\n 'filtered by type/platform. With package name: returns metadata, hint keys, and example summaries.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Exact npm package name for detailed lookup (e.g., @walkeros/web-destination-snowplow)',\n ),\n type: z\n .enum(['source', 'destination', 'transformer', 'store'])\n .optional()\n .describe('Filter by package type (browse mode)'),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Filter by platform (browse mode, includes universal packages)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version for detailed lookup (default: latest)'),\n },\n // No outputSchema: browse mode returns {catalog, count}, lookup returns metadata — incompatible shapes\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ package: packageName, type, platform, version }) => {\n // Browse mode: no package specified → return catalog\n if (!packageName) {\n const catalog = await fetchCatalog({ type, platform });\n const result = { catalog, count: catalog.length };\n const summary = `${catalog.length} packages found`;\n return mcpResult(result, summary, {\n next: ['Use package_get for schemas and examples'],\n });\n }\n\n // Lookup mode: fetch specific package details\n try {\n const info = await fetchPackage(packageName, { version });\n\n const result = {\n package: info.packageName,\n version: info.version,\n description: info.description,\n type: info.type,\n platform: normalizePlatform(info.platform),\n hintKeys: info.hintKeys,\n exampleSummaries: info.exampleSummaries,\n };\n\n const summary = `${info.packageName} v${info.version}`;\n return mcpResult(result, summary, {\n next: ['Use package_get for schemas and examples'],\n });\n } catch (error) {\n return mcpError(\n error,\n 'Package not found. Use package_search without parameters to browse available packages.',\n );\n }\n },\n );\n}\n\nexport function registerGetPackageSchemaTool(server: McpServer) {\n server.registerTool(\n 'package_get',\n {\n title: 'Get Package',\n description:\n 'Fetch walkerOS package details from npm. By default returns schemas + hint texts + example summaries (lightweight). ' +\n 'Use section parameter to get full content: \"hints\" (with code blocks), \"examples\" (full in/out data), ' +\n 'or \"all\" (everything). Use package_search first to browse available packages.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .describe(\n 'Exact npm package name (e.g., @walkeros/web-destination-snowplow)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version (default: latest)'),\n section: z\n .enum(['hints', 'examples', 'all'])\n .optional()\n .describe(\n 'Section to expand with full content. Default: summary view with schemas + hint texts + example descriptions',\n ),\n },\n // No outputSchema — removed to avoid SDK -32602 crashes on unexpected field values\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ package: packageName, version, section }) => {\n try {\n const info = await fetchPackage(packageName, { version });\n\n // Build merged schemas: base config + package settings → schemas.config\n const mergedSchemas: Record<string, unknown> = {};\n\n if (info.type) {\n mergedSchemas.config = mergeConfigSchema(\n info.type as 'source' | 'destination' | 'transformer' | 'store',\n info.schemas as Record<string, Record<string, unknown>>,\n );\n }\n\n // Keep non-settings schemas as siblings (mapping, ga4, tagger, etc.)\n for (const [key, value] of Object.entries(info.schemas)) {\n if (key !== 'settings') {\n mergedSchemas[key] = value;\n }\n }\n\n const result: Record<string, unknown> = {\n package: info.packageName,\n version: info.version,\n type: info.type,\n platform: normalizePlatform(info.platform),\n schemas: mergedSchemas,\n };\n\n // Hints\n if (info.hints) {\n if (section === 'hints' || section === 'all') {\n result.hints = info.hints;\n } else {\n const hintSummary: Record<string, { text: string }> = {};\n for (const [key, hint] of Object.entries(info.hints)) {\n const h = hint as { text: string };\n hintSummary[key] = { text: h.text };\n }\n result.hints = hintSummary;\n }\n }\n\n // Examples\n if (section === 'examples' || section === 'all') {\n result.examples = info.examples;\n } else {\n result.exampleSummaries = info.exampleSummaries;\n }\n\n const schemaCount = Object.keys(info.schemas).length;\n const exampleCount = info.exampleSummaries.length;\n const summary = `${info.packageName} — ${schemaCount} schemas, ${exampleCount} examples`;\n\n return mcpResult(result, summary);\n } catch (error) {\n return mcpError(\n error,\n 'Use package_search to browse available package names.',\n );\n }\n },\n );\n}\n","const NPM_SEARCH_URL = 'https://registry.npmjs.org/-/v1/search';\nconst JSDELIVR_BASE = 'https://cdn.jsdelivr.net/npm';\nconst WALKEROS_JSON_PATH = 'dist/walkerOS.json';\nconst CACHE_TTL = 5 * 60 * 1000;\n\nexport interface CatalogEntry {\n name: string;\n version: string;\n description?: string;\n type: string;\n platform: string[];\n}\n\nlet cache: { entries: CatalogEntry[]; timestamp: number } | undefined;\n\nexport function clearCatalogCache() {\n cache = undefined;\n}\n\nexport function normalizePlatform(platform?: unknown): string[] {\n if (platform == null) return [];\n if (typeof platform === 'string') {\n return platform === 'universal' ? ['web', 'server'] : [platform];\n }\n if (Array.isArray(platform)) {\n return platform.filter((v): v is string => typeof v === 'string');\n }\n return [];\n}\n\nexport async function fetchCatalog(filters?: {\n type?: string;\n platform?: string;\n}): Promise<CatalogEntry[]> {\n if (cache && Date.now() - cache.timestamp < CACHE_TTL) {\n return applyFilters(cache.entries, filters);\n }\n\n let entries: CatalogEntry[];\n try {\n entries = await fetchFromNpm();\n } catch {\n return [];\n }\n\n cache = { entries, timestamp: Date.now() };\n\n return applyFilters(entries, filters);\n}\n\nasync function fetchFromNpm(): Promise<CatalogEntry[]> {\n const res = await fetch(`${NPM_SEARCH_URL}?text=@walkeros/&size=250`, {\n signal: AbortSignal.timeout(10000),\n });\n if (!res.ok) throw new Error(`npm search failed: ${res.status}`);\n\n const data = (await res.json()) as {\n objects: Array<{\n package: { name: string; version: string; description?: string };\n }>;\n };\n\n const metaResults = await Promise.allSettled(\n data.objects.map((obj) => enrichWithMeta(obj.package)),\n );\n\n return metaResults\n .filter(\n (r): r is PromiseFulfilledResult<CatalogEntry | undefined> =>\n r.status === 'fulfilled',\n )\n .map((r) => r.value)\n .filter((entry): entry is CatalogEntry => entry !== undefined);\n}\n\nasync function enrichWithMeta(pkg: {\n name: string;\n version: string;\n description?: string;\n}): Promise<CatalogEntry | undefined> {\n try {\n const res = await fetch(\n `${JSDELIVR_BASE}/${pkg.name}@${pkg.version}/${WALKEROS_JSON_PATH}`,\n { signal: AbortSignal.timeout(5000) },\n );\n if (!res.ok) return undefined;\n\n const json = (await res.json()) as { $meta?: Record<string, unknown> };\n const meta = json.$meta;\n if (!meta || typeof meta.type !== 'string') return undefined;\n\n return {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n type: meta.type,\n platform: normalizePlatform(meta.platform),\n };\n } catch {\n return undefined;\n }\n}\n\nfunction applyFilters(\n entries: CatalogEntry[],\n filters?: { type?: string; platform?: string },\n): CatalogEntry[] {\n let results = entries;\n if (filters?.type) {\n results = results.filter((e) => e.type === filters.type);\n }\n if (filters?.platform) {\n // Empty platform means platform-agnostic → matches any filter\n results = results.filter(\n (e) => e.platform.length === 0 || e.platform.includes(filters.platform!),\n );\n }\n return results;\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\n\nconst WEB_SKELETON = {\n version: 3,\n flows: {\n default: {\n web: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nconst SERVER_SKELETON = {\n version: 3,\n flows: {\n default: {\n server: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nexport function registerFlowLoadTool(server: McpServer) {\n server.registerTool(\n 'flow_load',\n {\n title: 'Load or Create Flow',\n description:\n 'Load an existing flow configuration from a local file path, URL, or walkerOS API (by flow ID). ' +\n 'Or create a new empty flow by specifying a platform (web or server). ' +\n 'Use the add-step prompt to add sources, destinations, transformers, or stores to the flow.',\n inputSchema: {\n source: z\n .string()\n .optional()\n .describe(\n 'Flow source: local file path (./flow.json), URL (https://...), ' +\n 'inline JSON string, or API flow ID (cfg_...). Omit to create a new flow.',\n ),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Platform for new flows. Required when source is omitted. ' +\n 'web = browser tracking, server = Node.js HTTP.',\n ),\n },\n outputSchema: {\n version: z.number().describe('Flow config version'),\n flows: z.record(z.string(), z.unknown()).describe('Flow definitions'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ source, platform }) => {\n try {\n if (source) {\n const config = await loadJsonConfig(source);\n return mcpResult(\n config,\n `Loaded flow from ${source}. Use flow_validate to check, or add-step prompt to modify.`,\n {\n next: [\n 'Use flow_validate to check',\n 'Use add-step prompt to modify',\n ],\n },\n );\n }\n\n if (!platform) {\n return mcpError(\n new Error(\n 'Provide source (file path, URL, or flow ID) to load existing flow, ' +\n 'or platform (web/server) to create a new one.',\n ),\n );\n }\n\n const skeleton = platform === 'web' ? WEB_SKELETON : SERVER_SKELETON;\n return mcpResult(\n skeleton,\n `Created empty ${platform} flow. Use the add-step prompt to add sources, destinations, and transformers.`,\n {\n next: [\n 'Read walkeros://reference/flow-schema for config structure',\n 'Use add-step prompt to add sources and destinations',\n ],\n },\n );\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n if (msg.includes('not found') || msg.includes('ENOENT'))\n return mcpError(\n error,\n 'Check configPath — expected a flow.json file',\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { feedback, readConfig, writeConfig } from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\n\ndeclare const __VERSION__: string;\n\nexport function registerFeedbackTool(server: McpServer) {\n server.registerTool(\n 'feedback',\n {\n title: 'Send Feedback',\n description: 'Send feedback about walkerOS',\n inputSchema: {\n text: z.string().describe('Your feedback text'),\n anonymous: z\n .boolean()\n .optional()\n .describe(\n 'Include user/project info? false = include, true = anonymous. Only needed on first call if not yet configured.',\n ),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async (params) => {\n try {\n const { text, anonymous: explicitAnonymous } = params;\n\n const config = readConfig();\n let anonymous = config?.anonymousFeedback;\n\n // First time: need user's consent choice\n if (anonymous === undefined && explicitAnonymous === undefined) {\n return mcpResult(\n { needsConsent: true },\n 'Before sending feedback, ask the user: \"Would you like to include your user and project info with feedback? This is a one-time choice.\" Then call feedback again with the anonymous parameter set.',\n {\n next: [\n 'Ask the user if they want to include their info',\n 'Call feedback again with anonymous: true or false',\n ],\n },\n );\n }\n\n // Store preference if this is the first time\n if (anonymous === undefined && explicitAnonymous !== undefined) {\n anonymous = explicitAnonymous;\n const base = config ?? { token: '', email: '', appUrl: '' };\n writeConfig({ ...base, anonymousFeedback: anonymous });\n }\n\n // Use explicit override if provided, otherwise use stored value\n const isAnonymous = explicitAnonymous ?? anonymous ?? true;\n\n await feedback(text, { anonymous: isAnonymous, version: __VERSION__ });\n\n return mcpResult({ ok: true }, 'Feedback sent. Thanks!');\n } catch (error) {\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ServerNotification } from '@modelcontextprotocol/sdk/types.js';\nimport {\n whoami,\n listProjects,\n getProject,\n createProject,\n updateProject,\n deleteProject,\n listFlows,\n getFlow,\n createFlow,\n updateFlow,\n deleteFlow,\n duplicateFlow,\n deploy,\n getDeployment,\n listDeployments,\n getDeploymentBySlug,\n createDeployment as createDep,\n deleteDeployment as deleteDep,\n} from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ApiOutputShape } from '../schemas/api-output.js';\n\nconst ACTIONS = [\n 'whoami',\n 'project.list',\n 'project.get',\n 'project.create',\n 'project.update',\n 'project.delete',\n 'flow.list',\n 'flow.get',\n 'flow.create',\n 'flow.update',\n 'flow.delete',\n 'flow.duplicate',\n 'deploy',\n 'deployment.get',\n 'deployment.list',\n 'deployment.create',\n 'deployment.delete',\n] as const;\n\nexport function registerApiTool(server: McpServer) {\n server.registerTool(\n 'api',\n {\n title: 'walkerOS Cloud API',\n description:\n 'Manage walkerOS cloud projects, flows, and deployments. Requires WALKEROS_TOKEN env var.\\n\\n' +\n 'Actions:\\n' +\n '- whoami — verify token, get user info\\n' +\n '- project.list/get/create/update/delete — manage projects\\n' +\n '- flow.list/get/create/update/delete/duplicate — manage flow configs\\n' +\n '- deploy — deploy a flow (auto-detects web/server)\\n' +\n '- deployment.get/list/create/delete — manage deployments\\n\\n' +\n 'Parameters vary by action. content = Flow.Config JSON for flow.create/update.',\n inputSchema: {\n action: z.enum(ACTIONS).describe('API action to perform'),\n projectId: z\n .string()\n .optional()\n .describe(\n 'Project ID (proj_...). Required for: project.get/update/delete, flow.create, flow.list. ' +\n 'Falls back to WALKEROS_PROJECT_ID env var.',\n ),\n flowId: z\n .string()\n .optional()\n .describe(\n 'Flow ID (flow_...) or config ID (cfg_...). Required for: ' +\n 'flow.get, flow.update, flow.delete, flow.duplicate, deploy. ' +\n 'For deployment.get/delete: can be a deployment slug.',\n ),\n name: z\n .string()\n .optional()\n .describe('Name for create/update operations'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON for flow operations'),\n patch: z\n .boolean()\n .optional()\n .describe('Use merge-patch for flow.update (default: true)'),\n wait: z\n .boolean()\n .optional()\n .describe('Wait for deploy to complete (default: true)'),\n flowName: z\n .string()\n .optional()\n .describe('Flow name for multi-settings flows'),\n fields: z\n .array(z.string())\n .optional()\n .describe('Dot-path field selectors for flow.get'),\n type: z\n .enum(['web', 'server'])\n .optional()\n .describe('Deployment type for deployment.create'),\n sort: z.string().optional().describe('Sort field for list operations'),\n order: z.enum(['asc', 'desc']).optional().describe('Sort order'),\n status: z\n .string()\n .optional()\n .describe('Status filter for deployment.list'),\n includeDeleted: z\n .boolean()\n .optional()\n .describe('Include deleted items in lists'),\n },\n outputSchema: ApiOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async (params, extra) => {\n const {\n action,\n projectId,\n flowId,\n name,\n content,\n patch,\n wait,\n flowName,\n fields,\n type,\n sort,\n order,\n status,\n includeDeleted,\n } = params;\n\n try {\n let data: unknown;\n let summary: string;\n\n switch (action) {\n // Auth\n case 'whoami': {\n data = await whoami();\n summary = `Authenticated as ${(data as Record<string, unknown>).email}`;\n break;\n }\n\n // Projects\n case 'project.list': {\n data = await listProjects();\n summary = `${(((data as Record<string, unknown>).projects as unknown[]) ?? []).length} projects`;\n break;\n }\n case 'project.get': {\n data = await getProject({ projectId });\n summary = `Project \"${(data as Record<string, unknown>).name}\"`;\n break;\n }\n case 'project.create': {\n if (!name) throw new Error('name required for project.create');\n data = await createProject({ name });\n summary = `Created project \"${name}\"`;\n break;\n }\n case 'project.update': {\n if (!name) throw new Error('name required for project.update');\n data = await updateProject({ projectId, name });\n summary = `Updated project \"${name}\"`;\n break;\n }\n case 'project.delete': {\n data = await deleteProject({ projectId });\n summary = `Deleted project ${projectId ?? 'default'}`;\n break;\n }\n\n // Flows\n case 'flow.list': {\n data = await listFlows({\n projectId,\n sort: sort as 'name' | 'updated_at' | 'created_at' | undefined,\n order: order as 'asc' | 'desc' | undefined,\n includeDeleted,\n });\n summary = `${(((data as Record<string, unknown>).flows as unknown[]) ?? []).length} flows`;\n break;\n }\n case 'flow.get': {\n if (!flowId) throw new Error('flowId required for flow.get');\n data = await getFlow({ flowId, projectId, fields });\n summary = `Flow \"${(data as Record<string, unknown>).name}\" (${flowId})`;\n break;\n }\n case 'flow.create': {\n if (!name) throw new Error('name required for flow.create');\n if (!content) throw new Error('content required for flow.create');\n data = await createFlow({ name, content, projectId });\n summary = `Created flow \"${name}\" (${(data as Record<string, unknown>).id})`;\n break;\n }\n case 'flow.update': {\n if (!flowId) throw new Error('flowId required for flow.update');\n data = await updateFlow({\n flowId,\n name,\n content,\n projectId,\n mergePatch: patch ?? true,\n });\n summary = `Updated flow ${flowId}`;\n break;\n }\n case 'flow.delete': {\n if (!flowId) throw new Error('flowId required for flow.delete');\n data = await deleteFlow({ flowId, projectId });\n summary = `Deleted flow ${flowId}`;\n break;\n }\n case 'flow.duplicate': {\n if (!flowId) throw new Error('flowId required for flow.duplicate');\n data = await duplicateFlow({ flowId, name, projectId });\n summary = `Duplicated flow ${flowId}`;\n break;\n }\n\n // Deploy\n case 'deploy': {\n if (!flowId) throw new Error('flowId required for deploy');\n const progressToken = extra._meta?.progressToken;\n const DEPLOY_TIMEOUT_MS = 90_000;\n const timeoutSignal = AbortSignal.timeout(DEPLOY_TIMEOUT_MS);\n const combinedAbort = new AbortController();\n const onAbort = () => combinedAbort.abort();\n timeoutSignal.addEventListener('abort', onAbort);\n extra.signal?.addEventListener('abort', onAbort);\n data = await deploy({\n flowId,\n projectId,\n wait: wait ?? true,\n flowName,\n timeout: DEPLOY_TIMEOUT_MS,\n onStatus: (s: string, sub: string | null) => {\n if (!progressToken) return;\n const key = sub ? `${s}:${sub}` : s;\n const stages: Record<\n string,\n { progress: number; label: string }\n > = {\n 'bundling:building': {\n progress: 20,\n label: 'Building bundle...',\n },\n 'deploying:publishing': {\n progress: 60,\n label: 'Publishing to CDN...',\n },\n 'deploying:provisioning': {\n progress: 60,\n label: 'Provisioning container...',\n },\n 'deploying:starting': {\n progress: 80,\n label: 'Starting container...',\n },\n published: { progress: 100, label: 'Published' },\n active: { progress: 100, label: 'Active' },\n failed: { progress: 100, label: 'Failed' },\n };\n const stage = stages[key] ??\n stages[s] ?? { progress: 10, label: key };\n extra.sendNotification({\n method: 'notifications/progress',\n params: {\n progressToken,\n progress: stage.progress,\n total: 100,\n message: stage.label,\n },\n } as ServerNotification);\n },\n signal: combinedAbort.signal,\n });\n timeoutSignal.removeEventListener('abort', onAbort);\n extra.signal?.removeEventListener('abort', onAbort);\n const st = (data as Record<string, unknown>).status;\n const deployData = data as Record<string, unknown>;\n if (st === 'failed') {\n const msg = `Deploy failed: ${deployData.errorMessage ?? 'unknown error'}`;\n return mcpResult({ action, ok: false, data }, msg, {\n next: ['Run flow_validate to check your configuration'],\n });\n } else {\n summary = `Deployed flow ${flowId} — status: ${st}`;\n const publicUrl = deployData.publicUrl as string | undefined;\n const containerUrl = deployData.containerUrl as\n | string\n | undefined;\n const deployType = deployData.type as string | undefined;\n const nextHints: string[] = [];\n if (deployType === 'web' && publicUrl) {\n nextHints.push(`Bundle at ${publicUrl}`);\n nextHints.push(`Add <script src='${publicUrl}'></script>`);\n } else if (deployType === 'server' && containerUrl) {\n nextHints.push(`Container at ${containerUrl}`);\n nextHints.push(`Test: curl ${containerUrl}/health`);\n }\n if (nextHints.length > 0) {\n return mcpResult({ action, ok: true, data }, summary, {\n next: nextHints,\n });\n }\n }\n break;\n }\n\n // Deployments\n case 'deployment.get': {\n if (!flowId)\n throw new Error(\n 'flowId (flowId or slug) required for deployment.get',\n );\n try {\n data = await getDeployment({ flowId, flowName });\n } catch {\n data = await getDeploymentBySlug({ slug: flowId });\n }\n summary = `Deployment ${(data as Record<string, unknown>).slug ?? flowId} — ${(data as Record<string, unknown>).status}`;\n break;\n }\n case 'deployment.list': {\n data = await listDeployments({\n projectId,\n type: type as 'web' | 'server' | undefined,\n status,\n });\n summary = `${(((data as Record<string, unknown>).deployments as unknown[]) ?? []).length} deployments`;\n break;\n }\n case 'deployment.create': {\n if (!type)\n throw new Error(\n 'type (web/server) required for deployment.create',\n );\n data = await createDep({ type, label: name, projectId });\n summary = `Created ${type} deployment ${(data as Record<string, unknown>).slug}`;\n break;\n }\n case 'deployment.delete': {\n if (!flowId)\n throw new Error('flowId (slug) required for deployment.delete');\n data = await deleteDep({ slug: flowId });\n summary = `Deleted deployment ${flowId}`;\n break;\n }\n\n default:\n throw new Error(\n `Unknown action: ${action}. Use one of: ${ACTIONS.join(', ')}`,\n );\n }\n\n return mcpResult({ action, ok: true, data }, summary);\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n const name = error instanceof Error ? error.name : '';\n\n // Deploy timeout — return helpful status instead of raw error\n if (\n action === 'deploy' &&\n (name === 'AbortError' ||\n name === 'TimeoutError' ||\n msg.includes('abort'))\n ) {\n return mcpResult(\n {\n action,\n ok: true,\n data: { status: 'deploying', flowId },\n },\n `Deploy in progress (timed out waiting). Use deployment.list with projectId to check status.`,\n {\n next: [\n 'Use api(action: \"deployment.list\") to check current status',\n ],\n },\n );\n }\n\n if (\n msg.includes('401') ||\n msg.includes('403') ||\n msg.includes('Unauthorized')\n )\n return mcpError(\n error,\n 'Set WALKEROS_TOKEN env var or check token expiry',\n );\n if (msg.includes('required'))\n return mcpError(\n error,\n `See api tool description for ${action} parameters.`,\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\n\nexport const ApiOutputShape = {\n action: z.string().describe('Action that was executed'),\n ok: z.boolean().describe('Whether the action succeeded'),\n data: z.unknown().describe('Action-specific result data'),\n};\n","import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackageSchema } from '@walkeros/core';\nimport { fetchCatalog } from '../catalog.js';\n\nexport function registerPackageSchemaResources(server: McpServer) {\n const template = new ResourceTemplate('walkeros://schema/{packageName}', {\n list: async () => {\n const catalog = await fetchCatalog();\n return {\n resources: catalog.map((pkg) => ({\n uri: `walkeros://schema/${encodeURIComponent(pkg.name)}`,\n name: pkg.name,\n description: `Schema and examples for ${pkg.name}`,\n mimeType: 'application/json' as const,\n })),\n };\n },\n });\n\n server.registerResource(\n 'package-schema',\n template,\n {\n title: 'walkerOS Package Schema',\n description:\n 'JSON Schema and configuration examples for walkerOS packages',\n mimeType: 'application/json',\n },\n async (uri, { packageName }) => {\n const info = await fetchPackageSchema(\n decodeURIComponent(packageName as string),\n );\n return {\n contents: [\n {\n uri: uri.toString(),\n mimeType: 'application/json' as const,\n text: JSON.stringify(info, null, 2),\n },\n ],\n };\n },\n );\n}\n","/**\n * Reference resources — pure schema and structural data only.\n *\n * Design principle: resources are loaded into context and should contain\n * only schemas, type definitions, and structural references. Behavioral\n * guidance, tutorials, and step-by-step instructions belong in prompts.\n * Vendor-specific examples belong in packages (fetched via package_get).\n */\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { schemas } from '@walkeros/core/dev';\nimport { fetchCatalog } from '../catalog.js';\n\nexport function registerReferenceResources(server: McpServer) {\n // Flow Schema reference (generated from Zod)\n server.resource(\n 'flow-schema',\n 'walkeros://reference/flow-schema',\n {\n description:\n 'JSON Schema for Flow.Config — the complete flow configuration structure',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/flow-schema',\n text: JSON.stringify(schemas.configJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Event Model reference (generated from Zod)\n server.resource(\n 'event-model',\n 'walkeros://reference/event-model',\n {\n description:\n 'JSON Schema for walkerOS events: entity-action naming, data, context, globals, user, consent',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/event-model',\n text: JSON.stringify(schemas.eventJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Mapping reference (generated from Zod — composite of related schemas)\n server.resource(\n 'mapping',\n 'walkeros://reference/mapping',\n {\n description:\n 'JSON Schemas for walkerOS mapping: rules, valueConfig, rule, policy',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/mapping',\n text: JSON.stringify(\n {\n rules: schemas.rulesJsonSchema,\n valueConfig: schemas.valueConfigJsonSchema,\n rule: schemas.ruleJsonSchema,\n policy: schemas.policyJsonSchema,\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Consent reference (generated from Zod)\n server.resource(\n 'consent',\n 'walkeros://reference/consent',\n {\n description:\n 'JSON Schema for walkerOS consent: destination-level, rule-level, and field-level consent gating',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/consent',\n text: JSON.stringify(schemas.consentJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Variables reference (hand-maintained — runtime interpolation patterns not captured in Zod schemas)\n server.resource(\n 'variables',\n 'walkeros://reference/variables',\n {\n description:\n 'walkerOS variable patterns: $var, $env, $def, $contract, $code, $store substitution',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/variables',\n text: JSON.stringify(\n {\n patterns: {\n '$var.name':\n 'Variable substitution — cascade: step settings > flow settings > config variables',\n '$env.NAME':\n 'Environment variable — $env.GA_ID reads process.env.GA_ID',\n '$env.NAME:default':\n 'Environment variable with fallback — $env.GA_ID:G-DEFAULT',\n '$def.name':\n 'Definition reference — reusable config blocks from definitions section',\n '$def.name.path.deep':\n 'Nested definition access — $def.ga4Events.purchase',\n '$contract.name':\n 'Contract reference — links to named contract for validation',\n '$contract.name.path':\n 'Nested contract access — $contract.ecommerce.product',\n '$code:(expr)':\n 'Inline JavaScript — $code:(event) => event.data.price * 100',\n '$store:storeId':\n 'Store injection in env values — wires runtime store access',\n },\n cascade: {\n priority: [\n '1. Step-level settings (highest)',\n '2. Flow-level settings',\n '3. Config-level variables (lowest)',\n ],\n example: {\n variables: { apiKey: 'default-key' },\n flows: {\n production: {\n destinations: {\n api: {\n config: { key: '$var.apiKey' },\n settings: { apiKey: 'prod-key' },\n },\n },\n },\n },\n },\n },\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Contract reference (generated from Zod)\n server.resource(\n 'contract',\n 'walkeros://reference/contract',\n {\n description:\n 'JSON Schema for walkerOS contracts: event schema validation with entity-action keying',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/contract',\n text: JSON.stringify(schemas.contractJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Examples reference (loaded from @walkeros/cli at runtime)\n server.resource(\n 'examples',\n 'walkeros://reference/examples',\n {\n description:\n 'Complete flow config example: web + server flows, mapping, contracts, step examples',\n mimeType: 'application/json',\n },\n async () => {\n let example: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const examplePath =\n require.resolve('@walkeros/cli/examples/flow-complete.json');\n example = readFileSync(examplePath, 'utf-8');\n } catch {\n example = JSON.stringify({ error: 'Example not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/examples',\n text: example,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // API reference (OpenAPI spec)\n server.resource(\n 'api',\n 'walkeros://reference/api',\n {\n description: 'walkerOS cloud API — OpenAPI 3.1 specification',\n mimeType: 'application/json',\n },\n async () => {\n let openApiSpec: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const specPath = require.resolve('@walkeros/cli/openapi/spec.json');\n openApiSpec = readFileSync(specPath, 'utf-8');\n } catch {\n openApiSpec = JSON.stringify({ error: 'OpenAPI spec not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/api',\n text: openApiSpec,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // Packages catalog resource\n server.resource(\n 'packages',\n 'walkeros://reference/packages',\n {\n description:\n 'Complete walkerOS package catalog — all sources, destinations, transformers, and stores',\n mimeType: 'application/json',\n },\n async () => {\n const catalog = await fetchCatalog();\n return {\n contents: [\n {\n uri: 'walkeros://reference/packages',\n text: JSON.stringify(catalog, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerAddStepPrompt(server: McpServer) {\n server.registerPrompt(\n 'add-step',\n {\n description:\n 'Add a source, destination, transformer, or store step to a flow configuration. ' +\n 'Guides through package selection, config scaffolding, and wiring.',\n argsSchema: {\n stepType: z\n .string()\n .optional()\n .describe(\n 'Type of step to add: source, destination, transformer, or store',\n ),\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to modify'),\n },\n },\n async ({ stepType, flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me add a ${stepType || 'new'} step to my flow${flowPath ? ` at ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n `1. ${stepType ? '' : 'Ask what type of step (source, destination, transformer, store). Then '}Use package_search to browse available packages for the selected type and platform.`,\n '2. Use package_get to read the package\\'s config schema (schemas.config contains the full config shape: base fields like consent/require/logger + package-specific settings). Use section=\"hints\" for additional guidance.',\n '3. Use package_get with section=\"examples\" to see working configuration examples.',\n '4. Scaffold the step config using the package schemas — include required settings with placeholder values.',\n '5. Wire the step into the flow: add to packages section (with version if needed), connect via next/before chains if needed.',\n '6. For destinations: configure mapping using nested entity → action keys. Event \"product add\" maps to `{ \"product\": { \"add\": { name: \"AddToCart\" } } }`. Use the setup-mapping prompt for guidance.',\n '7. Use flow_validate to verify the result.',\n '8. For server sources: check if the package supports `ingest` configuration via package_get. Ingest extracts request metadata (IP, user-agent, headers) using mapping syntax. Transformers like fingerprint depend on ingest data.',\n '9. When adding a transformer that uses ingest fields, verify the source has `ingest` configured — otherwise ingest fields resolve to empty values.',\n '',\n 'Important:',\n '- Read the walkeros://reference/flow-schema resource to understand connection rules.',\n '- Sources connect to pre-collector transformers via `next`.',\n '- Destinations connect to post-collector transformers via `before`.',\n '- Stores are passive — referenced via `$store:storeName` in env values.',\n '- Use variables ($var) for values that change between environments.',\n '- For required settings without defaults in the package schema, ask the user which value to use. Do not guess credentials, IDs, or environment-specific values.',\n '- If $meta.exports lists named exports, set the `code` field on the step to the chosen export name. If only one export exists, use it automatically.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerSetupMappingPrompt(server: McpServer) {\n server.registerPrompt(\n 'setup-mapping',\n {\n description:\n 'Set up event mapping for any step in a flow. Teaches mapping syntax and uses package examples as templates.',\n argsSchema: {\n stepName: z\n .string()\n .optional()\n .describe('Step name in the flow (e.g., \"gtag\", \"meta\", \"express\")'),\n },\n },\n async ({ stepName }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me set up mapping${stepName ? ` for the \"${stepName}\" step` : ''}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/mapping resource for syntax reference.',\n `2. ${stepName ? `Identify the package for \"${stepName}\" in the flow, then u` : 'U'}se package_get with section=\"examples\" to see the source output shape — mapping keys must match the actual events the source emits.`,\n '3. Ask whether this is source mapping (raw input → walkerOS events) or destination mapping (walkerOS events → vendor format).',\n '4. Ask which events to map (one at a time, not all at once).',\n '5. Generate one mapping rule using the package examples as templates. Validate it with flow_validate before moving to the next.',\n '6. Repeat for each event.',\n '',\n 'Mapping uses nested entity → action keys. Event \"product add\" maps to `{ \"product\": { \"add\": Rule } }`. Wildcards: `{ \"*\": { \"view\": Rule } }`.',\n '',\n 'Use $def references for shared mapping patterns across destinations.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerManageContractPrompt(server: McpServer) {\n server.registerPrompt(\n 'manage-contract',\n {\n description:\n 'Create or update event contracts for a flow. Can generate contracts from existing mappings or scaffold mappings from contracts.',\n argsSchema: {\n direction: z\n .string()\n .optional()\n .describe(\n 'Direction: \"from-mappings\" (extract contract from existing mappings), ' +\n '\"from-scratch\" (create new contract), or \"to-mappings\" (scaffold mappings from contract)',\n ),\n },\n },\n async ({ direction }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me ${direction === 'to-mappings' ? 'scaffold mappings from a contract' : direction === 'from-mappings' ? 'generate a contract from existing mappings' : 'manage event contracts'}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/contract resource to understand contract structure.',\n direction === 'from-mappings'\n ? '2. Read all destination mappings in the flow, extract referenced event fields, and generate a contract with those as required properties.'\n : direction === 'to-mappings'\n ? '2. Read the contract from the flow, then scaffold mapping stubs for each destination based on the contract fields.'\n : '2. Ask for entity-action names and required properties, or ask whether to generate from existing mappings.',\n '3. Use entity-action keying with wildcards (*.*, *.action, entity.*) for broad rules.',\n '4. Define JSON Schema for events, globals, context, custom, user, and consent.',\n '5. Use flow_validate to verify the contract.',\n '',\n 'Contracts and mappings are bidirectional:',\n '- **Contract → Mappings**: contract defines what events look like, mappings are scaffolded to match.',\n '- **Mappings → Contract**: existing mappings reveal which fields are used, contract formalizes them.',\n '',\n 'For server flows: if the contract references fields populated by ingest (e.g., user fingerprint hash), verify the source config.ingest extracts the needed request metadata.',\n '',\n 'Use $contract.name references to link contracts in the flow.',\n 'Contracts support extends for inheritance between event types.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerUseDefinitionsPrompt(server: McpServer) {\n server.registerPrompt(\n 'use-definitions',\n {\n description:\n 'Extract shared patterns into definitions and variables for DRY, environment-aware flow configurations.',\n argsSchema: {\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to analyze'),\n },\n },\n async ({ flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me extract shared patterns into definitions and variables${flowPath ? ` in ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/variables resource to understand variable syntax.',\n '2. Analyze the flow config for repeated patterns (same mapping blocks, same config values).',\n '3. Extract repeated mapping patterns into the `definitions` section with `$def.name` references.',\n '4. Extract environment-specific values into `variables` with `$var.name` references.',\n '5. Show the cascade priority: step > settings > config.',\n '6. Use flow_validate to verify the result.',\n '',\n 'Variable types:',\n '- `$var.name` — variable substitution (cascade: step > settings > config)',\n '- `$env.NAME` and `$env.NAME:default` — environment variables',\n '- `$def.name` and `$def.name.path.deep` — definition references',\n '- `$contract.name` — contract references',\n '- `$code:(expr)` — inline JavaScript functions',\n '- `$store:storeId` — store injection in env values',\n '',\n 'Look for:',\n '- Same API keys or URLs across multiple destinations → $var or $env',\n '- Identical mapping rules in multiple destinations → $def',\n '- Environment-specific values (dev/staging/prod) → $var with overrides',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;;;ACDrC,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAExB,SAAS,WAAW,gBAAgB;;;ACJpC,SAAS,SAAS;AAGX,IAAM,sBAAsB;AAAA,EACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,2BAA2B;AAAA,EACvD,MAAM,EACH,MAAM;AAAA,IACL,EAAE,KAAK,CAAC,YAAY,SAAS,SAAS,QAAQ,SAAS,CAAC;AAAA,IACxD,EAAE,OAAO,EAAE,MAAM,4CAA4C;AAAA,EAC/D,CAAC,EACA,SAAS,oBAAoB;AAAA,EAChC,QAAQ,EACL;AAAA,IACC,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,OAAO;AAAA,MACf,SAAS,EAAE,OAAO;AAAA,MAClB,OAAO,EAAE,QAAQ,EAAE,SAAS;AAAA,MAC5B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,CAAC;AAAA,EACH,EACC,SAAS,mBAAmB;AAAA,EAC/B,UAAU,EACP;AAAA,IACC,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,OAAO;AAAA,MACf,SAAS,EAAE,OAAO;AAAA,MAClB,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,IAClC,CAAC;AAAA,EACH,EACC,SAAS,qBAAqB;AAAA,EACjC,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAC9B,SAAS,+BAA+B;AAC7C;AAEO,IAAM,oBAAoB;AAAA,EAC/B,SAAS,EAAE,QAAQ,EAAE,SAAS,4BAA4B;AAAA,EAC1D,WAAW,EAAE,OAA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A;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAuDhB;AACF;AAEA,yBAAyB,MAAM;AAC/B,uBAAuB,MAAM;AAC7B,yBAAyB,MAAM;AAC/B,qBAAqB,MAAM;AAC3B,yBAAyB,MAAM;AAC/B,0BAA0B,MAAM;AAChC,6BAA6B,MAAM;AACnC,qBAAqB,MAAM;AAC3B,qBAAqB,MAAM;AAC3B,+BAA+B,MAAM;AACrC,2BAA2B,MAAM;AACjC,sBAAsB,MAAM;AAC5B,2BAA2B,MAAM;AACjC,6BAA6B,MAAM;AACnC,6BAA6B,MAAM;AAEnC,IAAI,QAAQ,IAAI,gBAAgB;AAC9B,kBAAgB,MAAM;AACxB;AAEA,eAAe,OAAO;AACpB,QAAM,YAAY,IAAI,qBAAqB;AAC3C,QAAM,OAAO,QAAQ,SAAS;AAC9B,UAAQ,MAAM,2CAA2C;AAC3D;AAEA,KAAK,EAAE,MAAM,CAAC,UAAU;AACtB,UAAQ,MAAM,oCAAoC,KAAK;AACvD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["server","z","schemas","mcpResult","mcpError","server","schemas","z","result","size","time","summary","mcpResult","mcpError","z","schemas","mcpResult","mcpError","server","schemas","z","summary","mcpResult","mcpError","z","schemas","mcpResult","mcpError","server","schemas","z","mcpError","mcpResult","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","loadJsonConfig","mcpResult","mcpError","server","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","server","z","mcpResult","name","mcpError","server","schemas","server","schemas","require","z","server","z","server","z","server","z","server"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/tools/validate.ts","../src/schemas/output.ts","../src/tools/bundle.ts","../src/tools/simulate.ts","../src/tools/push.ts","../src/tools/examples.ts","../src/tools/package.ts","../src/catalog.ts","../src/tools/flow-load.ts","../src/tools/feedback.ts","../src/tools/api.ts","../src/schemas/api-output.ts","../src/resources/package-schemas.ts","../src/resources/references.ts","../src/prompts/add-step.ts","../src/prompts/setup-mapping.ts","../src/prompts/manage-contract.ts","../src/prompts/use-definitions.ts"],"sourcesContent":["import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';\n\nimport { registerFlowValidateTool } from './tools/validate.js';\nimport { registerFlowBundleTool } from './tools/bundle.js';\nimport { registerFlowSimulateTool } from './tools/simulate.js';\nimport { registerFlowPushTool } from './tools/push.js';\nimport { registerFlowExamplesTool } from './tools/examples.js';\nimport {\n registerPackageSearchTool,\n registerGetPackageSchemaTool,\n} from './tools/package.js';\nimport { registerFlowLoadTool } from './tools/flow-load.js';\nimport { registerFeedbackTool } from './tools/feedback.js';\nimport { registerApiTool } from './tools/api.js';\nimport { registerPackageSchemaResources } from './resources/package-schemas.js';\nimport { registerReferenceResources } from './resources/references.js';\nimport { registerAddStepPrompt } from './prompts/add-step.js';\nimport { registerSetupMappingPrompt } from './prompts/setup-mapping.js';\nimport { registerManageContractPrompt } from './prompts/manage-contract.js';\nimport { registerUseDefinitionsPrompt } from './prompts/use-definitions.js';\n\ndeclare const __VERSION__: string;\n\nconst server = new McpServer(\n {\n name: 'walkeros-flow',\n version: __VERSION__,\n },\n {\n instructions: `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.\n\n## Architecture: Source → Collector → Destination(s)\n\nEvery component in a flow is a **step**: sources capture events, transformers process them, destinations deliver them, stores provide shared state. Steps connect via \\`next\\` (pre-collector) and \\`before\\` (post-collector) chains.\n\n## Flow Config Structure\n\nEvery flow config follows this shape:\n\n\\`\\`\\`json\n{\n \"version\": 3,\n \"flows\": {\n \"default\": {\n \"web\": {},\n \"sources\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": {} } },\n \"destinations\": { \"<name>\": { \"package\": \"<npm-package>\", \"config\": { \"settings\": {} } } }\n }\n }\n}\n\\`\\`\\`\n\nEvent format: \\`{ name: \"entity action\", data: {...}, entity: \"...\", action: \"...\" }\\`. Sources convert raw input into this format.\n\nKey rules:\n- \\`version: 3\\` is required\n- Each flow must have exactly one of \\`web: {}\\` or \\`server: {}\\`\n- Destination settings go inside \\`config.settings\\`, not directly on the destination\n- Read \\`walkeros://reference/flow-schema\\` for the full annotated structure\n\n## Getting Started\n\n1. \\`flow_load({ platform: \"web\" })\\` or \\`flow_load({ source: \"./flow.json\" })\\` — create or load a flow (also accepts inline JSON strings or URLs)\n2. \\`package_search({ type: \"destination\", platform: \"web\" })\\` — discover available packages\n3. Use the \\`add-step\\` prompt to add sources, destinations, transformers, or stores\n4. Use the \\`setup-mapping\\` prompt to configure event transformations\n5. \\`flow_validate({ type: \"flow\", input: \"flow.json\" })\\` — verify configuration\n6. \\`flow_simulate({ configPath: \"flow.json\", event: \"...\" })\\` — test with mocked API calls\n7. \\`flow_bundle({ configPath: \"flow.json\" })\\` — build deployable JavaScript\n8. \\`api({ action: \"deploy\", id: \"cfg_...\" })\\` — deploy to walkerOS cloud (requires WALKEROS_TOKEN env var; unavailable without it)\n\nIf validation fails, fix the reported errors and re-validate. Do not skip validation.\n\n## Reference Resources\n\nRead these before constructing configs manually: \\`walkeros://reference/flow-schema\\`, \\`walkeros://reference/mapping\\`, \\`walkeros://reference/event-model\\`, \\`walkeros://reference/consent\\`, \\`walkeros://reference/variables\\`, \\`walkeros://reference/contract\\`, \\`walkeros://reference/examples\\`.\n\n## Key Concepts\n\n- **Steps** are sources, destinations, transformers, or stores — each backed by an npm package. Use \\`package_search\\` to browse, \\`package_get\\` for schemas and examples. \\`package_get\\` returns \\`schemas.config\\` — a merged JSON Schema combining base config fields (consent, require, logger, mapping, etc.) with the package's typed settings. Non-config schemas (mapping rules, utility schemas) remain as sibling keys.\n- **Mapping** transforms events using data/map/loop/set/condition rules. Same syntax on sources and destinations. Mapping rules use NESTED entity → action keying: event name \"product add\" maps to \\`{ \"product\": { \"add\": Rule } }\\`. Wildcards: \\`{ \"*\": { \"view\": Rule } }\\`.\n- **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.\n- **Variables** (\\$var, \\$env, \\$def, \\$code, \\$store) enable DRY, environment-aware config. Use the \\`use-definitions\\` prompt to extract shared patterns.\n- **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.`,\n },\n);\n\nregisterFlowValidateTool(server);\nregisterFlowBundleTool(server);\nregisterFlowSimulateTool(server);\nregisterFlowPushTool(server);\nregisterFlowExamplesTool(server);\nregisterPackageSearchTool(server);\nregisterGetPackageSchemaTool(server);\nregisterFlowLoadTool(server);\nregisterFeedbackTool(server);\nregisterPackageSchemaResources(server);\nregisterReferenceResources(server);\nregisterAddStepPrompt(server);\nregisterSetupMappingPrompt(server);\nregisterManageContractPrompt(server);\nregisterUseDefinitionsPrompt(server);\n\nif (process.env.WALKEROS_TOKEN) {\n registerApiTool(server);\n}\n\nasync function main() {\n const transport = new StdioServerTransport();\n await server.connect(transport);\n console.error('walkerOS Flow MCP server running on stdio');\n}\n\nmain().catch((error) => {\n console.error('Failed to start Flow MCP server:', error);\n process.exit(1);\n});\n","import { validate } from '@walkeros/cli';\nimport type { ValidateResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ValidateOutputShape } from '../schemas/output.js';\n\nexport function registerFlowValidateTool(server: McpServer) {\n server.registerTool(\n 'flow_validate',\n {\n title: 'Validate Flow',\n description:\n 'Validate walkerOS events, flow configurations, mapping rules, or data contracts. ' +\n 'Accepts JSON strings, file paths, or URLs as input. ' +\n 'Returns validation results with errors, warnings, and details.',\n inputSchema: schemas.ValidateInputShape,\n outputSchema: ValidateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ type, input, flow, path }) => {\n try {\n const result: ValidateResult = await validate(type, input, {\n flow,\n path,\n });\n const hints = result.valid\n ? {\n next: [\n 'Use flow_simulate to test event flow',\n 'Use flow_bundle to build',\n ],\n }\n : {\n next: [\n 'Fix errors above, then run flow_validate again',\n 'Read walkeros://reference/flow-schema for correct structure',\n ],\n };\n return mcpResult(result, hints);\n } catch (error) {\n return mcpError(\n error,\n 'Check the input parameter — expected a JSON string, file path, or URL',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\n\n// CLI tool output shapes\nexport const ValidateOutputShape = {\n valid: z.boolean().describe('Whether validation passed'),\n type: z\n .union([\n z.enum(['contract', 'entry', 'event', 'flow', 'mapping']),\n z.string().regex(/^(destinations|sources|transformers)\\.\\w+$/),\n ])\n .describe('What was validated'),\n errors: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n value: z.unknown().optional(),\n code: z.string().optional(),\n }),\n )\n .describe('Validation errors'),\n warnings: z\n .array(\n z.object({\n path: z.string(),\n message: z.string(),\n suggestion: z.string().optional(),\n }),\n )\n .describe('Validation warnings'),\n details: z\n .record(z.string(), z.unknown())\n .describe('Additional validation details'),\n};\n\nexport const BundleOutputShape = {\n success: z.boolean().describe('Whether bundling succeeded'),\n totalSize: z.number().optional().describe('Total bundle size in bytes'),\n buildTime: z.number().optional().describe('Build time in milliseconds'),\n packages: z\n .array(\n z.object({\n name: z.string(),\n size: z.number(),\n }),\n )\n .optional()\n .describe('Per-package size breakdown'),\n treeshakingEffective: z\n .boolean()\n .optional()\n .describe('Whether tree-shaking was effective'),\n message: z.string().optional().describe('Status message'),\n};\n\nexport const SimulateOutputShape = {\n success: z.boolean().describe('Whether simulation succeeded'),\n error: z.string().optional().describe('Error message if failed'),\n summary: z.string().describe('One-line result summary'),\n destinations: z\n .record(\n z.string(),\n z.object({\n received: z\n .boolean()\n .describe('Whether destination received the event'),\n calls: z.number().describe('Number of API calls made'),\n payload: z\n .unknown()\n .optional()\n .describe('Full payload (only when verbose: true)'),\n }),\n )\n .optional()\n .describe('Per-destination results'),\n capturedEvents: z\n .array(z.record(z.string(), z.unknown()))\n .optional()\n .describe('Events captured by source simulation'),\n duration: z.number().optional().describe('Simulation duration in ms'),\n};\n\nexport const PushOutputShape = {\n success: z.boolean().describe('Whether push succeeded'),\n elbResult: z.unknown().optional().describe('Push result from the collector'),\n duration: z.number().describe('Push duration in milliseconds'),\n error: z.string().optional().describe('Error message if push failed'),\n};\n\n// Examples List output shape\nexport const ExamplesListOutputShape = {\n flow: z.string().describe('Flow name'),\n count: z.number().describe('Number of examples found'),\n examples: z\n .array(\n z.object({\n step: z.string().describe('Step location (e.g., \"destination.gtag\")'),\n stepType: z\n .enum(['source', 'transformer', 'destination'])\n .describe('Step type'),\n stepName: z.string().describe('Step name'),\n exampleName: z.string().describe('Example name'),\n hasIn: z.boolean().describe('Whether the example has an input value'),\n hasOut: z.boolean().describe('Whether the example has an output value'),\n hasMapping: z\n .boolean()\n .describe('Whether the example has a mapping configuration'),\n hasTrigger: z\n .boolean()\n .describe('Whether the example has trigger metadata'),\n in: z.unknown().optional().describe('Input event data'),\n out: z.unknown().optional().describe('Expected output data'),\n mapping: z\n .unknown()\n .optional()\n .describe('Mapping configuration for destinations'),\n trigger: z\n .object({\n type: z.string().optional(),\n options: z.unknown().optional(),\n })\n .optional()\n .describe('Trigger metadata for source simulation'),\n }),\n )\n .describe('Step examples'),\n};\n","import { z } from 'zod';\nimport { bundle, bundleRemote } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { BundleOutputShape } from '../schemas/output.js';\n\nexport function registerFlowBundleTool(server: McpServer) {\n server.registerTool(\n 'flow_bundle',\n {\n title: 'Bundle Flow',\n description:\n 'Bundle a walkerOS flow configuration into deployable JavaScript. ' +\n 'Resolves all destinations, sources, and transformers, then outputs ' +\n 'a tree-shaken production bundle. Returns bundle statistics. ' +\n 'Set remote: true to use the walkerOS cloud service instead of local build tools.',\n inputSchema: {\n ...schemas.BundleInputShape,\n remote: z\n .boolean()\n .optional()\n .describe(\n 'Use remote cloud bundling (requires WALKEROS_TOKEN). Default: false (local)',\n ),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON content (required when remote: true)'),\n },\n outputSchema: BundleOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, flow, stats, output, remote, content }) => {\n try {\n if (remote) {\n if (!content)\n throw new Error('content is required when remote: true');\n const result = await bundleRemote({\n content: content as Record<string, unknown>,\n flowName: flow,\n });\n return mcpResult(\n { success: true, ...result },\n {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n },\n );\n }\n\n const result = await bundle(configPath, {\n flowName: flow,\n stats: stats ?? true,\n buildOverrides: output ? { output } : undefined,\n });\n\n if (!result) {\n return mcpResult(\n { success: false, message: 'Bundle produced no output' },\n {\n warnings: [\n 'The build returned no result. The flow may be empty or misconfigured.',\n ],\n next: ['Run flow_validate to check your configuration'],\n },\n );\n }\n\n const output_ = result as unknown as Record<string, unknown>;\n\n return mcpResult(\n { success: true, ...output_ },\n {\n next: [\n 'Use flow_simulate to test',\n \"Use api({ action: 'deploy' }) to publish\",\n ],\n },\n );\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { simulate } from '@walkeros/cli';\nimport type { SimulationResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { SimulateOutputShape } from '../schemas/output.js';\n\ninterface DestinationSummary {\n received: boolean;\n calls: number;\n payload?: unknown;\n}\n\nexport function registerFlowSimulateTool(server: McpServer) {\n server.registerTool(\n 'flow_simulate',\n {\n title: 'Simulate Flow',\n description:\n 'Simulate events through a walkerOS flow without making real API calls. ' +\n 'For destinations: event is a walkerOS event { name: \"entity action\", data: {...} }. ' +\n 'For sources: event is { content: ..., trigger?: { type?, options? }, env?: {...} }. ' +\n 'Use step to target a specific step. ' +\n 'Use flow_examples to discover available test data.',\n inputSchema: {\n configPath: schemas.SimulateInputShape.configPath,\n event: z\n .union([z.record(z.string(), z.unknown()), z.string()])\n .optional()\n .describe(\n 'For destinations: { name, data }. For sources: { content, trigger?, env? }. ' +\n 'Can also be a JSON string or file path.',\n ),\n flow: schemas.SimulateInputShape.flow,\n platform: schemas.SimulateInputShape.platform,\n step: schemas.SimulateInputShape.step,\n verbose: z\n .boolean()\n .optional()\n .describe('Include full payload per destination (default: false)'),\n },\n outputSchema: SimulateOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, event, flow, platform, step, verbose }) => {\n try {\n if (!event) {\n throw new Error(\n 'event is required. For sources provide { content, trigger? }, for destinations provide { name, data }.',\n );\n }\n\n const raw: SimulationResult = await simulate(configPath, event, {\n json: true,\n flow,\n platform,\n step,\n });\n\n // Source simulation returns capturedEvents\n if (raw.capturedEvents) {\n const eventCount = raw.capturedEvents.length;\n const summary = `Source captured ${eventCount} event${eventCount !== 1 ? 's' : ''}`;\n\n return mcpResult(\n {\n success: raw.success,\n error: raw.error,\n summary,\n capturedEvents: raw.capturedEvents,\n duration: raw.duration,\n },\n {\n next:\n eventCount > 0\n ? [\n 'Use flow_simulate with a destination step to test downstream processing',\n ]\n : [\n 'Check source package examples with package_get, verify trigger type matches',\n ],\n },\n );\n }\n\n // Destination/transformer simulation\n const destinations: Record<string, DestinationSummary> = {};\n\n if (raw.usage) {\n for (const [name, calls] of Object.entries(raw.usage)) {\n const summary: DestinationSummary = {\n received: calls.length > 0,\n calls: calls.length,\n };\n if (verbose && calls.length > 0) {\n summary.payload = calls[calls.length - 1];\n }\n destinations[name] = summary;\n }\n }\n\n const destCount = Object.keys(destinations).length;\n const receivedCount = Object.values(destinations).filter(\n (d) => d.received,\n ).length;\n\n const warnings: string[] = [];\n if (destCount === 0) {\n warnings.push('No destinations found in flow configuration.');\n }\n if (destCount > 0 && receivedCount === 0) {\n warnings.push(\n 'No destinations received the event. Check: mapping keys use nested entity→action structure, event name matches, consent is granted.',\n );\n }\n\n const summary = `${receivedCount}/${destCount} destinations received the event`;\n\n const result = {\n success: raw.success,\n error: raw.error,\n summary,\n destinations: destCount > 0 ? destinations : undefined,\n duration: raw.duration,\n };\n\n return mcpResult(result, {\n next: ['Use flow_bundle to build for production'],\n ...(warnings.length > 0 ? { warnings } : {}),\n });\n } catch (error) {\n return mcpError(error, 'Run flow_validate for detailed error messages');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { push } from '@walkeros/cli';\nimport type { PushResult } from '@walkeros/cli';\nimport { schemas } from '@walkeros/cli/dev';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { PushOutputShape } from '../schemas/output.js';\n\nexport function registerFlowPushTool(server: McpServer) {\n server.registerTool(\n 'flow_push',\n {\n title: 'Push Events',\n description:\n 'Push a real event through a walkerOS flow to actual destinations. ' +\n 'Makes real API calls to real endpoints. ' +\n 'Best suited for server-side flows — web flows should use flow_simulate for testing.',\n inputSchema: {\n configPath: schemas.PushInputShape.configPath,\n event: z\n .record(z.string(), z.unknown())\n .describe(\n 'Event object, e.g. { name: \"page view\", data: { title: \"Home\" } }',\n ),\n flow: schemas.PushInputShape.flow,\n platform: schemas.PushInputShape.platform,\n },\n outputSchema: PushOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async ({ configPath, event, flow, platform }) => {\n try {\n const result: PushResult = await push(configPath, event, {\n json: true,\n flow,\n platform,\n });\n\n if (!result.success) {\n return mcpError(\n new Error(result.error || 'Push failed'),\n 'Check destination configuration and connectivity.',\n );\n }\n\n return mcpResult(result);\n } catch (error) {\n return mcpError(\n error,\n 'Check configPath and event format. For web flows, use flow_simulate.',\n );\n }\n },\n );\n}\n","import { z } from 'zod';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport type { Flow } from '@walkeros/core';\nimport { ExamplesListOutputShape } from '../schemas/output.js';\n\nexport function registerFlowExamplesTool(server: McpServer) {\n server.registerTool(\n 'flow_examples',\n {\n title: 'Flow Examples',\n description:\n 'List all step examples in a walkerOS flow configuration. ' +\n 'Shows example names, step locations, and in/out shapes. ' +\n 'Use this to discover available test fixtures and simulation data.',\n inputSchema: {\n configPath: z\n .string()\n .min(1)\n .describe(\n 'Path to flow configuration file, URL, or inline JSON string',\n ),\n flow: z\n .string()\n .optional()\n .describe('Flow name for multi-flow configs'),\n step: z\n .string()\n .optional()\n .describe('Filter to a specific step (e.g., \"destination.gtag\")'),\n full: z\n .boolean()\n .optional()\n .describe(\n 'Return full in/out/mapping data for each example (default: false, returns metadata only)',\n ),\n },\n outputSchema: ExamplesListOutputShape,\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ configPath, flow, step, full }) => {\n try {\n const rawConfig = await loadJsonConfig<Flow.Config>(configPath);\n\n // Resolve flow name\n const flowNames = Object.keys(rawConfig.flows || {});\n const flowName =\n flow || (flowNames.length === 1 ? flowNames[0] : undefined);\n\n if (!flowName) {\n throw new Error(\n `Multiple flows found. Specify flow parameter. Available: ${flowNames.join(', ')}`,\n );\n }\n\n const flowSettings = rawConfig.flows[flowName];\n if (!flowSettings) {\n throw new Error(`Flow \"${flowName}\" not found`);\n }\n\n // Collect all examples\n const examples: Array<{\n step: string;\n stepType: string;\n stepName: string;\n exampleName: string;\n hasIn: boolean;\n hasOut: boolean;\n hasMapping: boolean;\n hasTrigger: boolean;\n in?: unknown;\n out?: unknown;\n mapping?: unknown;\n trigger?: unknown;\n }> = [];\n\n const stepTypes = [\n { key: 'sources' as const, type: 'source' },\n { key: 'transformers' as const, type: 'transformer' },\n { key: 'destinations' as const, type: 'destination' },\n ];\n\n for (const { key, type } of stepTypes) {\n const refs = flowSettings[key] || {};\n for (const [name, ref] of Object.entries(refs)) {\n if (!ref.examples) continue;\n\n // Apply step filter\n if (step && `${type}.${name}` !== step) continue;\n\n for (const [exName, ex] of Object.entries(\n ref.examples as Flow.StepExamples,\n )) {\n examples.push({\n step: `${type}.${name}`,\n stepType: type,\n stepName: name,\n exampleName: exName,\n hasIn: ex.in !== undefined,\n hasOut: ex.out !== undefined,\n hasMapping: ex.mapping !== undefined,\n hasTrigger: ex.trigger !== undefined,\n ...(full\n ? {\n in: ex.in,\n out: ex.out,\n mapping: ex.mapping,\n trigger: ex.trigger,\n }\n : {}),\n });\n }\n }\n }\n\n const result = {\n flow: flowName,\n count: examples.length,\n examples,\n };\n\n const hints: { next: string[]; warnings?: string[] } = {\n next: ['Use flow_simulate with step and event to simulate'],\n };\n if (examples.length === 0) {\n hints.warnings = [\n 'No examples found. Add examples to step definitions in your flow config for testing.',\n ];\n }\n return mcpResult(result, hints);\n } catch (error) {\n return mcpError(error, 'Check configPath — expected a flow.json file');\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport {\n fetchPackage,\n mergeConfigSchema,\n mcpResult,\n mcpError,\n} from '@walkeros/core';\nimport { fetchCatalog, normalizePlatform } from '../catalog.js';\n\nexport function registerPackageSearchTool(server: McpServer) {\n server.registerTool(\n 'package_search',\n {\n title: 'Search Package',\n description:\n 'Browse walkerOS packages or look up a specific one. Without package name: returns catalog ' +\n 'filtered by type/platform. With package name: returns metadata, hint keys, and example summaries.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .optional()\n .describe(\n 'Exact npm package name for detailed lookup (e.g., @walkeros/web-destination-snowplow)',\n ),\n type: z\n .enum(['source', 'destination', 'transformer', 'store'])\n .optional()\n .describe('Filter by package type (browse mode)'),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Filter by platform (browse mode, includes universal packages)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version for detailed lookup (default: latest)'),\n },\n // No outputSchema: browse mode returns {catalog, count}, lookup returns metadata — incompatible shapes\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: false,\n },\n },\n async ({ package: packageName, type, platform, version }) => {\n // Browse mode: no package specified → return catalog\n if (!packageName) {\n const catalog = await fetchCatalog({ type, platform });\n const result = { catalog, count: catalog.length };\n return mcpResult(result, {\n next: ['Use package_get for schemas and examples'],\n });\n }\n\n // Lookup mode: fetch specific package details\n try {\n const info = await fetchPackage(packageName, { version });\n\n const result = {\n package: info.packageName,\n version: info.version,\n description: info.description,\n type: info.type,\n platform: normalizePlatform(info.platform),\n hintKeys: info.hintKeys,\n exampleSummaries: info.exampleSummaries,\n };\n\n return mcpResult(result, {\n next: ['Use package_get for schemas and examples'],\n });\n } catch (error) {\n return mcpError(\n error,\n 'Package not found. Use package_search without parameters to browse available packages.',\n );\n }\n },\n );\n}\n\nexport function registerGetPackageSchemaTool(server: McpServer) {\n server.registerTool(\n 'package_get',\n {\n title: 'Get Package',\n description:\n 'Fetch walkerOS package details from npm. By default returns schemas + hint texts + example summaries (lightweight). ' +\n 'Use section parameter to get full content: \"hints\" (with code blocks), \"examples\" (full in/out data), ' +\n 'or \"all\" (everything). Use package_search first to browse available packages.',\n inputSchema: {\n package: z\n .string()\n .min(1)\n .describe(\n 'Exact npm package name (e.g., @walkeros/web-destination-snowplow)',\n ),\n version: z\n .string()\n .optional()\n .describe('Package version (default: latest)'),\n section: z\n .enum(['hints', 'examples', 'all'])\n .optional()\n .describe(\n 'Section to expand with full content. Default: summary view with schemas + hint texts + example descriptions',\n ),\n },\n // No outputSchema — removed to avoid SDK -32602 crashes on unexpected field values\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ package: packageName, version, section }) => {\n try {\n const info = await fetchPackage(packageName, { version });\n\n // Build merged schemas: base config + package settings → schemas.config\n const mergedSchemas: Record<string, unknown> = {};\n\n if (info.type) {\n mergedSchemas.config = mergeConfigSchema(\n info.type as 'source' | 'destination' | 'transformer' | 'store',\n info.schemas as Record<string, Record<string, unknown>>,\n );\n }\n\n // Keep non-settings schemas as siblings (mapping, ga4, tagger, etc.)\n for (const [key, value] of Object.entries(info.schemas)) {\n if (key !== 'settings') {\n mergedSchemas[key] = value;\n }\n }\n\n const result: Record<string, unknown> = {\n package: info.packageName,\n version: info.version,\n type: info.type,\n platform: normalizePlatform(info.platform),\n schemas: mergedSchemas,\n };\n\n // Hints\n if (info.hints) {\n if (section === 'hints' || section === 'all') {\n result.hints = info.hints;\n } else {\n const hintSummary: Record<string, { text: string }> = {};\n for (const [key, hint] of Object.entries(info.hints)) {\n const h = hint as { text: string };\n hintSummary[key] = { text: h.text };\n }\n result.hints = hintSummary;\n }\n }\n\n // Examples\n if (section === 'examples' || section === 'all') {\n result.examples = info.examples;\n } else {\n result.exampleSummaries = info.exampleSummaries;\n }\n\n return mcpResult(result);\n } catch (error) {\n return mcpError(\n error,\n 'Use package_search to browse available package names.',\n );\n }\n },\n );\n}\n","const NPM_SEARCH_URL = 'https://registry.npmjs.org/-/v1/search';\nconst JSDELIVR_BASE = 'https://cdn.jsdelivr.net/npm';\nconst WALKEROS_JSON_PATH = 'dist/walkerOS.json';\nconst CACHE_TTL = 5 * 60 * 1000;\n\nexport interface CatalogEntry {\n name: string;\n version: string;\n description?: string;\n type: string;\n platform: string[];\n}\n\nlet cache: { entries: CatalogEntry[]; timestamp: number } | undefined;\n\nexport function clearCatalogCache() {\n cache = undefined;\n}\n\nexport function normalizePlatform(platform?: unknown): string[] {\n if (platform == null) return [];\n if (typeof platform === 'string') {\n return platform === 'universal' ? ['web', 'server'] : [platform];\n }\n if (Array.isArray(platform)) {\n return platform.filter((v): v is string => typeof v === 'string');\n }\n return [];\n}\n\nexport async function fetchCatalog(filters?: {\n type?: string;\n platform?: string;\n}): Promise<CatalogEntry[]> {\n if (cache && Date.now() - cache.timestamp < CACHE_TTL) {\n return applyFilters(cache.entries, filters);\n }\n\n let entries: CatalogEntry[];\n try {\n entries = await fetchFromNpm();\n } catch {\n return [];\n }\n\n cache = { entries, timestamp: Date.now() };\n\n return applyFilters(entries, filters);\n}\n\nasync function fetchFromNpm(): Promise<CatalogEntry[]> {\n const res = await fetch(`${NPM_SEARCH_URL}?text=@walkeros/&size=250`, {\n signal: AbortSignal.timeout(10000),\n });\n if (!res.ok) throw new Error(`npm search failed: ${res.status}`);\n\n const data = (await res.json()) as {\n objects: Array<{\n package: { name: string; version: string; description?: string };\n }>;\n };\n\n const metaResults = await Promise.allSettled(\n data.objects.map((obj) => enrichWithMeta(obj.package)),\n );\n\n return metaResults\n .filter(\n (r): r is PromiseFulfilledResult<CatalogEntry | undefined> =>\n r.status === 'fulfilled',\n )\n .map((r) => r.value)\n .filter((entry): entry is CatalogEntry => entry !== undefined);\n}\n\nasync function enrichWithMeta(pkg: {\n name: string;\n version: string;\n description?: string;\n}): Promise<CatalogEntry | undefined> {\n try {\n const res = await fetch(\n `${JSDELIVR_BASE}/${pkg.name}@${pkg.version}/${WALKEROS_JSON_PATH}`,\n { signal: AbortSignal.timeout(5000) },\n );\n if (!res.ok) return undefined;\n\n const json = (await res.json()) as { $meta?: Record<string, unknown> };\n const meta = json.$meta;\n if (!meta || typeof meta.type !== 'string') return undefined;\n\n return {\n name: pkg.name,\n version: pkg.version,\n description: pkg.description,\n type: meta.type,\n platform: normalizePlatform(meta.platform),\n };\n } catch {\n return undefined;\n }\n}\n\nfunction applyFilters(\n entries: CatalogEntry[],\n filters?: { type?: string; platform?: string },\n): CatalogEntry[] {\n let results = entries;\n if (filters?.type) {\n results = results.filter((e) => e.type === filters.type);\n }\n if (filters?.platform) {\n // Empty platform means platform-agnostic → matches any filter\n results = results.filter(\n (e) => e.platform.length === 0 || e.platform.includes(filters.platform!),\n );\n }\n return results;\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { loadJsonConfig } from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\n\nconst WEB_SKELETON = {\n version: 3,\n flows: {\n default: {\n web: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nconst SERVER_SKELETON = {\n version: 3,\n flows: {\n default: {\n server: {},\n packages: {},\n sources: {},\n destinations: {},\n },\n },\n};\n\nexport function registerFlowLoadTool(server: McpServer) {\n server.registerTool(\n 'flow_load',\n {\n title: 'Load or Create Flow',\n description:\n 'Load an existing flow configuration from a local file path, URL, or walkerOS API (by flow ID). ' +\n 'Or create a new empty flow by specifying a platform (web or server). ' +\n 'Use the add-step prompt to add sources, destinations, transformers, or stores to the flow.',\n inputSchema: {\n source: z\n .string()\n .optional()\n .describe(\n 'Flow source: local file path (./flow.json), URL (https://...), ' +\n 'inline JSON string, or API flow ID (cfg_...). Omit to create a new flow.',\n ),\n platform: z\n .enum(['web', 'server'])\n .optional()\n .describe(\n 'Platform for new flows. Required when source is omitted. ' +\n 'web = browser tracking, server = Node.js HTTP.',\n ),\n },\n outputSchema: {\n version: z.number().describe('Flow config version'),\n flows: z.record(z.string(), z.unknown()).describe('Flow definitions'),\n },\n annotations: {\n readOnlyHint: true,\n destructiveHint: false,\n idempotentHint: true,\n openWorldHint: true,\n },\n },\n async ({ source, platform }) => {\n try {\n if (source) {\n const config = await loadJsonConfig(source);\n return mcpResult(config, {\n next: [\n 'Use flow_validate to check',\n 'Use add-step prompt to modify',\n ],\n });\n }\n\n if (!platform) {\n return mcpError(\n new Error(\n 'Provide source (file path, URL, or flow ID) to load existing flow, ' +\n 'or platform (web/server) to create a new one.',\n ),\n );\n }\n\n const skeleton = platform === 'web' ? WEB_SKELETON : SERVER_SKELETON;\n return mcpResult(skeleton, {\n next: [\n 'Read walkeros://reference/flow-schema for config structure',\n 'Use add-step prompt to add sources and destinations',\n ],\n });\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n if (msg.includes('not found') || msg.includes('ENOENT'))\n return mcpError(\n error,\n 'Check configPath — expected a flow.json file',\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { feedback, readConfig, writeConfig } from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\n\ndeclare const __VERSION__: string;\n\nexport function registerFeedbackTool(server: McpServer) {\n server.registerTool(\n 'feedback',\n {\n title: 'Send Feedback',\n description: 'Send feedback about walkerOS',\n inputSchema: {\n text: z.string().describe('Your feedback text'),\n anonymous: z\n .boolean()\n .optional()\n .describe(\n 'Include user/project info? false = include, true = anonymous. Only needed on first call if not yet configured.',\n ),\n },\n annotations: {\n readOnlyHint: false,\n destructiveHint: false,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async (params) => {\n try {\n const { text, anonymous: explicitAnonymous } = params;\n\n const config = readConfig();\n let anonymous = config?.anonymousFeedback;\n\n // First time: need user's consent choice\n if (anonymous === undefined && explicitAnonymous === undefined) {\n return mcpResult(\n { needsConsent: true },\n {\n next: [\n 'Ask the user if they want to include their info',\n 'Call feedback again with anonymous: true or false',\n ],\n },\n );\n }\n\n // Store preference if this is the first time\n if (anonymous === undefined && explicitAnonymous !== undefined) {\n anonymous = explicitAnonymous;\n const base = config ?? { token: '', email: '', appUrl: '' };\n writeConfig({ ...base, anonymousFeedback: anonymous });\n }\n\n // Use explicit override if provided, otherwise use stored value\n const isAnonymous = explicitAnonymous ?? anonymous ?? true;\n\n await feedback(text, { anonymous: isAnonymous, version: __VERSION__ });\n\n return mcpResult({ ok: true });\n } catch (error) {\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { ServerNotification } from '@modelcontextprotocol/sdk/types.js';\nimport {\n whoami,\n listProjects,\n getProject,\n createProject,\n updateProject,\n deleteProject,\n listFlows,\n getFlow,\n createFlow,\n updateFlow,\n deleteFlow,\n duplicateFlow,\n deploy,\n getDeployment,\n listDeployments,\n getDeploymentBySlug,\n createDeployment as createDep,\n deleteDeployment as deleteDep,\n} from '@walkeros/cli';\nimport { mcpResult, mcpError } from '@walkeros/core';\nimport { ApiOutputShape } from '../schemas/api-output.js';\n\nconst ACTIONS = [\n 'whoami',\n 'project.list',\n 'project.get',\n 'project.create',\n 'project.update',\n 'project.delete',\n 'flow.list',\n 'flow.get',\n 'flow.create',\n 'flow.update',\n 'flow.delete',\n 'flow.duplicate',\n 'deploy',\n 'deployment.get',\n 'deployment.list',\n 'deployment.create',\n 'deployment.delete',\n] as const;\n\nexport function registerApiTool(server: McpServer) {\n server.registerTool(\n 'api',\n {\n title: 'walkerOS Cloud API',\n description:\n 'Manage walkerOS cloud projects, flows, and deployments. Requires WALKEROS_TOKEN env var.\\n\\n' +\n 'Actions:\\n' +\n '- whoami — verify token, get user info\\n' +\n '- project.list/get/create/update/delete — manage projects\\n' +\n '- flow.list/get/create/update/delete/duplicate — manage flow configs\\n' +\n '- deploy — deploy a flow (auto-detects web/server)\\n' +\n '- deployment.get/list/create/delete — manage deployments\\n\\n' +\n 'Parameters vary by action. content = Flow.Config JSON for flow.create/update.',\n inputSchema: {\n action: z.enum(ACTIONS).describe('API action to perform'),\n projectId: z\n .string()\n .optional()\n .describe(\n 'Project ID (proj_...). Required for: project.get/update/delete, flow.create, flow.list. ' +\n 'Falls back to WALKEROS_PROJECT_ID env var.',\n ),\n flowId: z\n .string()\n .optional()\n .describe(\n 'Flow ID (flow_...) or config ID (cfg_...). Required for: ' +\n 'flow.get, flow.update, flow.delete, flow.duplicate, deploy. ' +\n 'For deployment.get/delete: can be a deployment slug.',\n ),\n name: z\n .string()\n .optional()\n .describe('Name for create/update operations'),\n content: z\n .record(z.string(), z.unknown())\n .optional()\n .describe('Flow.Config JSON for flow operations'),\n patch: z\n .boolean()\n .optional()\n .describe('Use merge-patch for flow.update (default: true)'),\n wait: z\n .boolean()\n .optional()\n .describe('Wait for deploy to complete (default: true)'),\n flowName: z\n .string()\n .optional()\n .describe('Flow name for multi-settings flows'),\n fields: z\n .array(z.string())\n .optional()\n .describe('Dot-path field selectors for flow.get'),\n type: z\n .enum(['web', 'server'])\n .optional()\n .describe('Deployment type for deployment.create'),\n sort: z.string().optional().describe('Sort field for list operations'),\n order: z.enum(['asc', 'desc']).optional().describe('Sort order'),\n status: z\n .string()\n .optional()\n .describe('Status filter for deployment.list'),\n includeDeleted: z\n .boolean()\n .optional()\n .describe('Include deleted items in lists'),\n },\n outputSchema: ApiOutputShape,\n annotations: {\n readOnlyHint: false,\n destructiveHint: true,\n idempotentHint: false,\n openWorldHint: true,\n },\n },\n async (params, extra) => {\n const {\n action,\n projectId,\n flowId,\n name,\n content,\n patch,\n wait,\n flowName,\n fields,\n type,\n sort,\n order,\n status,\n includeDeleted,\n } = params;\n\n try {\n let data: unknown;\n\n switch (action) {\n // Auth\n case 'whoami': {\n data = await whoami();\n break;\n }\n\n // Projects\n case 'project.list': {\n data = await listProjects();\n break;\n }\n case 'project.get': {\n data = await getProject({ projectId });\n break;\n }\n case 'project.create': {\n if (!name) throw new Error('name required for project.create');\n data = await createProject({ name });\n break;\n }\n case 'project.update': {\n if (!name) throw new Error('name required for project.update');\n data = await updateProject({ projectId, name });\n break;\n }\n case 'project.delete': {\n data = await deleteProject({ projectId });\n break;\n }\n\n // Flows\n case 'flow.list': {\n data = await listFlows({\n projectId,\n sort: sort as 'name' | 'updated_at' | 'created_at' | undefined,\n order: order as 'asc' | 'desc' | undefined,\n includeDeleted,\n });\n break;\n }\n case 'flow.get': {\n if (!flowId) throw new Error('flowId required for flow.get');\n data = await getFlow({ flowId, projectId, fields });\n break;\n }\n case 'flow.create': {\n if (!name) throw new Error('name required for flow.create');\n if (!content) throw new Error('content required for flow.create');\n data = await createFlow({ name, content, projectId });\n break;\n }\n case 'flow.update': {\n if (!flowId) throw new Error('flowId required for flow.update');\n data = await updateFlow({\n flowId,\n name,\n content,\n projectId,\n mergePatch: patch ?? true,\n });\n break;\n }\n case 'flow.delete': {\n if (!flowId) throw new Error('flowId required for flow.delete');\n data = await deleteFlow({ flowId, projectId });\n break;\n }\n case 'flow.duplicate': {\n if (!flowId) throw new Error('flowId required for flow.duplicate');\n data = await duplicateFlow({ flowId, name, projectId });\n break;\n }\n\n // Deploy\n case 'deploy': {\n if (!flowId) throw new Error('flowId required for deploy');\n const progressToken = extra._meta?.progressToken;\n const DEPLOY_TIMEOUT_MS = 90_000;\n const timeoutSignal = AbortSignal.timeout(DEPLOY_TIMEOUT_MS);\n const combinedAbort = new AbortController();\n const onAbort = () => combinedAbort.abort();\n timeoutSignal.addEventListener('abort', onAbort);\n extra.signal?.addEventListener('abort', onAbort);\n data = await deploy({\n flowId,\n projectId,\n wait: wait ?? true,\n flowName,\n timeout: DEPLOY_TIMEOUT_MS,\n onStatus: (s: string, sub: string | null) => {\n if (!progressToken) return;\n const key = sub ? `${s}:${sub}` : s;\n const stages: Record<\n string,\n { progress: number; label: string }\n > = {\n 'bundling:building': {\n progress: 20,\n label: 'Building bundle...',\n },\n 'deploying:publishing': {\n progress: 60,\n label: 'Publishing to CDN...',\n },\n 'deploying:provisioning': {\n progress: 60,\n label: 'Provisioning container...',\n },\n 'deploying:starting': {\n progress: 80,\n label: 'Starting container...',\n },\n published: { progress: 100, label: 'Published' },\n active: { progress: 100, label: 'Active' },\n failed: { progress: 100, label: 'Failed' },\n };\n const stage = stages[key] ??\n stages[s] ?? { progress: 10, label: key };\n extra.sendNotification({\n method: 'notifications/progress',\n params: {\n progressToken,\n progress: stage.progress,\n total: 100,\n message: stage.label,\n },\n } as ServerNotification);\n },\n signal: combinedAbort.signal,\n });\n timeoutSignal.removeEventListener('abort', onAbort);\n extra.signal?.removeEventListener('abort', onAbort);\n const st = (data as Record<string, unknown>).status;\n const deployData = data as Record<string, unknown>;\n if (st === 'failed') {\n return mcpResult(\n { action, ok: false, data },\n {\n next: ['Run flow_validate to check your configuration'],\n },\n );\n } else {\n const publicUrl = deployData.publicUrl as string | undefined;\n const containerUrl = deployData.containerUrl as\n | string\n | undefined;\n const deployType = deployData.type as string | undefined;\n const nextHints: string[] = [];\n if (deployType === 'web' && publicUrl) {\n nextHints.push(`Bundle at ${publicUrl}`);\n nextHints.push(`Add <script src='${publicUrl}'></script>`);\n } else if (deployType === 'server' && containerUrl) {\n nextHints.push(`Container at ${containerUrl}`);\n nextHints.push(`Test: curl ${containerUrl}/health`);\n }\n if (nextHints.length > 0) {\n return mcpResult(\n { action, ok: true, data },\n {\n next: nextHints,\n },\n );\n }\n }\n break;\n }\n\n // Deployments\n case 'deployment.get': {\n if (!flowId)\n throw new Error(\n 'flowId (flowId or slug) required for deployment.get',\n );\n try {\n data = await getDeployment({ flowId, flowName });\n } catch {\n data = await getDeploymentBySlug({ slug: flowId });\n }\n break;\n }\n case 'deployment.list': {\n data = await listDeployments({\n projectId,\n type: type as 'web' | 'server' | undefined,\n status,\n });\n break;\n }\n case 'deployment.create': {\n if (!type)\n throw new Error(\n 'type (web/server) required for deployment.create',\n );\n data = await createDep({ type, label: name, projectId });\n break;\n }\n case 'deployment.delete': {\n if (!flowId)\n throw new Error('flowId (slug) required for deployment.delete');\n data = await deleteDep({ slug: flowId });\n break;\n }\n\n default:\n throw new Error(\n `Unknown action: ${action}. Use one of: ${ACTIONS.join(', ')}`,\n );\n }\n\n return mcpResult({ action, ok: true, data });\n } catch (error) {\n const msg = error instanceof Error ? error.message : '';\n const name = error instanceof Error ? error.name : '';\n\n // Deploy timeout — return helpful status instead of raw error\n if (\n action === 'deploy' &&\n (name === 'AbortError' ||\n name === 'TimeoutError' ||\n msg.includes('abort'))\n ) {\n return mcpResult(\n {\n action,\n ok: true,\n data: { status: 'deploying', flowId },\n },\n {\n next: [\n 'Use api(action: \"deployment.list\") to check current status',\n ],\n },\n );\n }\n\n if (\n msg.includes('401') ||\n msg.includes('403') ||\n msg.includes('Unauthorized')\n )\n return mcpError(\n error,\n 'Set WALKEROS_TOKEN env var or check token expiry',\n );\n if (msg.includes('required'))\n return mcpError(\n error,\n `See api tool description for ${action} parameters.`,\n );\n return mcpError(error);\n }\n },\n );\n}\n","import { z } from 'zod';\n\nexport const ApiOutputShape = {\n action: z.string().describe('Action that was executed'),\n ok: z.boolean().describe('Whether the action succeeded'),\n data: z.unknown().describe('Action-specific result data'),\n};\n","import { ResourceTemplate } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { fetchPackageSchema } from '@walkeros/core';\nimport { fetchCatalog } from '../catalog.js';\n\nexport function registerPackageSchemaResources(server: McpServer) {\n const template = new ResourceTemplate('walkeros://schema/{packageName}', {\n list: async () => {\n const catalog = await fetchCatalog();\n return {\n resources: catalog.map((pkg) => ({\n uri: `walkeros://schema/${encodeURIComponent(pkg.name)}`,\n name: pkg.name,\n description: `Schema and examples for ${pkg.name}`,\n mimeType: 'application/json' as const,\n })),\n };\n },\n });\n\n server.registerResource(\n 'package-schema',\n template,\n {\n title: 'walkerOS Package Schema',\n description:\n 'JSON Schema and configuration examples for walkerOS packages',\n mimeType: 'application/json',\n },\n async (uri, { packageName }) => {\n const info = await fetchPackageSchema(\n decodeURIComponent(packageName as string),\n );\n return {\n contents: [\n {\n uri: uri.toString(),\n mimeType: 'application/json' as const,\n text: JSON.stringify(info, null, 2),\n },\n ],\n };\n },\n );\n}\n","/**\n * Reference resources — pure schema and structural data only.\n *\n * Design principle: resources are loaded into context and should contain\n * only schemas, type definitions, and structural references. Behavioral\n * guidance, tutorials, and step-by-step instructions belong in prompts.\n * Vendor-specific examples belong in packages (fetched via package_get).\n */\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\nimport { schemas } from '@walkeros/core/dev';\nimport { fetchCatalog } from '../catalog.js';\n\nexport function registerReferenceResources(server: McpServer) {\n // Flow Schema reference (generated from Zod)\n server.resource(\n 'flow-schema',\n 'walkeros://reference/flow-schema',\n {\n description:\n 'JSON Schema for Flow.Config — the complete flow configuration structure',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/flow-schema',\n text: JSON.stringify(schemas.configJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Event Model reference (generated from Zod)\n server.resource(\n 'event-model',\n 'walkeros://reference/event-model',\n {\n description:\n 'JSON Schema for walkerOS events: entity-action naming, data, context, globals, user, consent',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/event-model',\n text: JSON.stringify(schemas.eventJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Mapping reference (generated from Zod — composite of related schemas)\n server.resource(\n 'mapping',\n 'walkeros://reference/mapping',\n {\n description:\n 'JSON Schemas for walkerOS mapping: rules, valueConfig, rule, policy',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/mapping',\n text: JSON.stringify(\n {\n rules: schemas.rulesJsonSchema,\n valueConfig: schemas.valueConfigJsonSchema,\n rule: schemas.ruleJsonSchema,\n policy: schemas.policyJsonSchema,\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Consent reference (generated from Zod)\n server.resource(\n 'consent',\n 'walkeros://reference/consent',\n {\n description:\n 'JSON Schema for walkerOS consent: destination-level, rule-level, and field-level consent gating',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/consent',\n text: JSON.stringify(schemas.consentJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Variables reference (hand-maintained — runtime interpolation patterns not captured in Zod schemas)\n server.resource(\n 'variables',\n 'walkeros://reference/variables',\n {\n description:\n 'walkerOS variable patterns: $var, $env, $def, $contract, $code, $store substitution',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/variables',\n text: JSON.stringify(\n {\n patterns: {\n '$var.name':\n 'Variable substitution — cascade: step settings > flow settings > config variables',\n '$env.NAME':\n 'Environment variable — $env.GA_ID reads process.env.GA_ID',\n '$env.NAME:default':\n 'Environment variable with fallback — $env.GA_ID:G-DEFAULT',\n '$def.name':\n 'Definition reference — reusable config blocks from definitions section',\n '$def.name.path.deep':\n 'Nested definition access — $def.ga4Events.purchase',\n '$contract.name':\n 'Contract reference — links to named contract for validation',\n '$contract.name.path':\n 'Nested contract access — $contract.ecommerce.product',\n '$code:(expr)':\n 'Inline JavaScript — $code:(event) => event.data.price * 100',\n '$store:storeId':\n 'Store injection in env values — wires runtime store access',\n },\n cascade: {\n priority: [\n '1. Step-level settings (highest)',\n '2. Flow-level settings',\n '3. Config-level variables (lowest)',\n ],\n example: {\n variables: { apiKey: 'default-key' },\n flows: {\n production: {\n destinations: {\n api: {\n config: { key: '$var.apiKey' },\n settings: { apiKey: 'prod-key' },\n },\n },\n },\n },\n },\n },\n },\n null,\n 2,\n ),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Contract reference (generated from Zod)\n server.resource(\n 'contract',\n 'walkeros://reference/contract',\n {\n description:\n 'JSON Schema for walkerOS contracts: event schema validation with entity-action keying',\n mimeType: 'application/json',\n },\n async () => ({\n contents: [\n {\n uri: 'walkeros://reference/contract',\n text: JSON.stringify(schemas.contractJsonSchema, null, 2),\n mimeType: 'application/json',\n },\n ],\n }),\n );\n\n // Examples reference (loaded from @walkeros/cli at runtime)\n server.resource(\n 'examples',\n 'walkeros://reference/examples',\n {\n description:\n 'Complete flow config example: web + server flows, mapping, contracts, step examples',\n mimeType: 'application/json',\n },\n async () => {\n let example: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const examplePath =\n require.resolve('@walkeros/cli/examples/flow-complete.json');\n example = readFileSync(examplePath, 'utf-8');\n } catch {\n example = JSON.stringify({ error: 'Example not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/examples',\n text: example,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // API reference (OpenAPI spec)\n server.resource(\n 'api',\n 'walkeros://reference/api',\n {\n description: 'walkerOS cloud API — OpenAPI 3.1 specification',\n mimeType: 'application/json',\n },\n async () => {\n let openApiSpec: string;\n try {\n const { readFileSync } = await import('fs');\n const { createRequire } = await import('module');\n const require = createRequire(import.meta.url);\n const specPath = require.resolve('@walkeros/cli/openapi/spec.json');\n openApiSpec = readFileSync(specPath, 'utf-8');\n } catch {\n openApiSpec = JSON.stringify({ error: 'OpenAPI spec not found' });\n }\n return {\n contents: [\n {\n uri: 'walkeros://reference/api',\n text: openApiSpec,\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n\n // Packages catalog resource\n server.resource(\n 'packages',\n 'walkeros://reference/packages',\n {\n description:\n 'Complete walkerOS package catalog — all sources, destinations, transformers, and stores',\n mimeType: 'application/json',\n },\n async () => {\n const catalog = await fetchCatalog();\n return {\n contents: [\n {\n uri: 'walkeros://reference/packages',\n text: JSON.stringify(catalog, null, 2),\n mimeType: 'application/json',\n },\n ],\n };\n },\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerAddStepPrompt(server: McpServer) {\n server.registerPrompt(\n 'add-step',\n {\n description:\n 'Add a source, destination, transformer, or store step to a flow configuration. ' +\n 'Guides through package selection, config scaffolding, and wiring.',\n argsSchema: {\n stepType: z\n .string()\n .optional()\n .describe(\n 'Type of step to add: source, destination, transformer, or store',\n ),\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to modify'),\n },\n },\n async ({ stepType, flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me add a ${stepType || 'new'} step to my flow${flowPath ? ` at ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n `1. ${stepType ? '' : 'Ask what type of step (source, destination, transformer, store). Then '}Use package_search to browse available packages for the selected type and platform.`,\n '2. Use package_get to read the package\\'s config schema (schemas.config contains the full config shape: base fields like consent/require/logger + package-specific settings). Use section=\"hints\" for additional guidance.',\n '3. Use package_get with section=\"examples\" to see working configuration examples.',\n '4. Scaffold the step config using the package schemas — include required settings with placeholder values.',\n '5. Wire the step into the flow: add to packages section (with version if needed), connect via next/before chains if needed.',\n '6. For destinations: configure mapping using nested entity → action keys. Event \"product add\" maps to `{ \"product\": { \"add\": { name: \"AddToCart\" } } }`. Use the setup-mapping prompt for guidance.',\n '7. Use flow_validate to verify the result.',\n '8. For server sources: check if the package supports `ingest` configuration via package_get. Ingest extracts request metadata (IP, user-agent, headers) using mapping syntax. Transformers like fingerprint depend on ingest data.',\n '9. When adding a transformer that uses ingest fields, verify the source has `ingest` configured — otherwise ingest fields resolve to empty values.',\n '',\n 'Important:',\n '- Read the walkeros://reference/flow-schema resource to understand connection rules.',\n '- Sources connect to pre-collector transformers via `next`.',\n '- Destinations connect to post-collector transformers via `before`.',\n '- Stores are passive — referenced via `$store:storeName` in env values.',\n '- Use variables ($var) for values that change between environments.',\n '- For required settings without defaults in the package schema, ask the user which value to use. Do not guess credentials, IDs, or environment-specific values.',\n '- If $meta.exports lists named exports, set the `code` field on the step to the chosen export name. If only one export exists, use it automatically.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerSetupMappingPrompt(server: McpServer) {\n server.registerPrompt(\n 'setup-mapping',\n {\n description:\n 'Set up event mapping for any step in a flow. Teaches mapping syntax and uses package examples as templates.',\n argsSchema: {\n stepName: z\n .string()\n .optional()\n .describe('Step name in the flow (e.g., \"gtag\", \"meta\", \"express\")'),\n },\n },\n async ({ stepName }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me set up mapping${stepName ? ` for the \"${stepName}\" step` : ''}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/mapping resource for syntax reference.',\n `2. ${stepName ? `Identify the package for \"${stepName}\" in the flow, then u` : 'U'}se package_get with section=\"examples\" to see the source output shape — mapping keys must match the actual events the source emits.`,\n '3. Ask whether this is source mapping (raw input → walkerOS events) or destination mapping (walkerOS events → vendor format).',\n '4. Ask which events to map (one at a time, not all at once).',\n '5. Generate one mapping rule using the package examples as templates. Validate it with flow_validate before moving to the next.',\n '6. Repeat for each event.',\n '',\n 'Mapping uses nested entity → action keys. Event \"product add\" maps to `{ \"product\": { \"add\": Rule } }`. Wildcards: `{ \"*\": { \"view\": Rule } }`.',\n '',\n 'Use $def references for shared mapping patterns across destinations.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerManageContractPrompt(server: McpServer) {\n server.registerPrompt(\n 'manage-contract',\n {\n description:\n 'Create or update event contracts for a flow. Can generate contracts from existing mappings or scaffold mappings from contracts.',\n argsSchema: {\n direction: z\n .string()\n .optional()\n .describe(\n 'Direction: \"from-mappings\" (extract contract from existing mappings), ' +\n '\"from-scratch\" (create new contract), or \"to-mappings\" (scaffold mappings from contract)',\n ),\n },\n },\n async ({ direction }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me ${direction === 'to-mappings' ? 'scaffold mappings from a contract' : direction === 'from-mappings' ? 'generate a contract from existing mappings' : 'manage event contracts'}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/contract resource to understand contract structure.',\n direction === 'from-mappings'\n ? '2. Read all destination mappings in the flow, extract referenced event fields, and generate a contract with those as required properties.'\n : direction === 'to-mappings'\n ? '2. Read the contract from the flow, then scaffold mapping stubs for each destination based on the contract fields.'\n : '2. Ask for entity-action names and required properties, or ask whether to generate from existing mappings.',\n '3. Use entity-action keying with wildcards (*.*, *.action, entity.*) for broad rules.',\n '4. Define JSON Schema for events, globals, context, custom, user, and consent.',\n '5. Use flow_validate to verify the contract.',\n '',\n 'Contracts and mappings are bidirectional:',\n '- **Contract → Mappings**: contract defines what events look like, mappings are scaffolded to match.',\n '- **Mappings → Contract**: existing mappings reveal which fields are used, contract formalizes them.',\n '',\n 'For server flows: if the contract references fields populated by ingest (e.g., user fingerprint hash), verify the source config.ingest extracts the needed request metadata.',\n '',\n 'Use $contract.name references to link contracts in the flow.',\n 'Contracts support extends for inheritance between event types.',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n","import { z } from 'zod';\nimport type { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n\nexport function registerUseDefinitionsPrompt(server: McpServer) {\n server.registerPrompt(\n 'use-definitions',\n {\n description:\n 'Extract shared patterns into definitions and variables for DRY, environment-aware flow configurations.',\n argsSchema: {\n flowPath: z\n .string()\n .optional()\n .describe('Path to the flow.json file to analyze'),\n },\n },\n async ({ flowPath }) => ({\n messages: [\n {\n role: 'user' as const,\n content: {\n type: 'text' as const,\n text: [\n `Help me extract shared patterns into definitions and variables${flowPath ? ` in ${flowPath}` : ''}.`,\n '',\n 'Follow these steps:',\n '1. Read the walkeros://reference/variables resource to understand variable syntax.',\n '2. Analyze the flow config for repeated patterns (same mapping blocks, same config values).',\n '3. Extract repeated mapping patterns into the `definitions` section with `$def.name` references.',\n '4. Extract environment-specific values into `variables` with `$var.name` references.',\n '5. Show the cascade priority: step > settings > config.',\n '6. Use flow_validate to verify the result.',\n '',\n 'Variable types:',\n '- `$var.name` — variable substitution (cascade: step > settings > config)',\n '- `$env.NAME` and `$env.NAME:default` — environment variables',\n '- `$def.name` and `$def.name.path.deep` — definition references',\n '- `$contract.name` — contract references',\n '- `$code:(expr)` — inline JavaScript functions',\n '- `$store:storeId` — store injection in env values',\n '',\n 'Look for:',\n '- Same API keys or URLs across multiple destinations → $var or $env',\n '- Identical mapping rules in multiple destinations → $def',\n '- Environment-specific values (dev/staging/prod) → $var with overrides',\n ].join('\\n'),\n },\n },\n ],\n }),\n );\n}\n"],"mappings":";;;AAAA,SAAS,iBAAiB;AAC1B,SAAS,4BAA4B;;;ACDrC,SAAS,gBAAgB;AAEzB,SAAS,eAAe;AAExB,SAAS,WAAW,gBAAgB;;;ACJpC,SAAS,SAAS;AAGX,IAAM,sBAAsB;AAAA,EACjC,OAAO,EAAE,QAAQ,EAAE,SAAS,2BAA2B;AAAA,EACvD,MAAM,EACH,MAAM;AAAA,IACL,EAAE,KAAK,CAAC,YAAY,SAAS,SAAS,QAAQ,SAAS,CAAC;AAAA,IACxD,EAAE,OAAO,EAAE,MAAM,4CAA4C;AAAA,EAC/D,CAAC,EACA,SAAS,oBAAoB;AAAA,EAChC,QAAQ,EACL;AAAA,IACC,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,OAAO;AAAA,MACf,SAAS,EAAE,OAAO;AAAA,MAClB,OAAO,EAAE,QAAQ,EAAE,SAAS;AAAA,MAC5B,MAAM,EAAE,OAAO,EAAE,SAAS;AAAA,IAC5B,CAAC;AAAA,EACH,EACC,SAAS,mBAAmB;AAAA,EAC/B,UAAU,EACP;AAAA,IACC,EAAE,OAAO;AAAA,MACP,MAAM,EAAE,OAAO;AAAA,MACf,SAAS,EAAE,OAAO;AAAA,MAClB,YAAY,EAAE,OAAO,EAAE,SAAS;AAAA,IAClC,CAAC;AAAA,EACH,EACC,SAAS,qBAAqB;AAAA,EACjC,SAAS,EACN,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAC9B,SAAS,+BAA+B;AAC7C;AAEO,IAAM,oBAAoB;AAAA,EAC/B,SAAS,EAAE,QAAQ,EAAE,SAAS,4BAA4B;AAAA,EAC1D,WAAW,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,4BAA4B;AAAA,EACtE,W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AAQ,MAAM,oCAAoC,KAAK;AACvD,UAAQ,KAAK,CAAC;AAChB,CAAC;","names":["server","z","schemas","mcpResult","mcpError","server","schemas","z","result","mcpResult","mcpError","z","schemas","mcpResult","mcpError","server","schemas","z","summary","mcpResult","mcpError","z","schemas","mcpResult","mcpError","server","schemas","z","mcpError","mcpResult","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","loadJsonConfig","mcpResult","mcpError","server","z","mcpResult","mcpError","server","z","mcpResult","mcpError","z","server","z","mcpResult","name","mcpError","server","schemas","server","schemas","require","z","server","z","server","z","server","z","server"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@walkeros/mcp",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.1",
|
|
4
4
|
"description": "MCP server for walkerOS flow development - discover packages, scaffold configs, validate, bundle, simulate, and test event pipelines",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
34
|
-
"@walkeros/cli": "^3.1.
|
|
35
|
-
"@walkeros/core": "^3.1.
|
|
34
|
+
"@walkeros/cli": "^3.1.1",
|
|
35
|
+
"@walkeros/core": "^3.1.1"
|
|
36
36
|
},
|
|
37
37
|
"peerDependencies": {
|
|
38
38
|
"zod": "^4.0"
|