@walkeros/mcp 4.0.0 → 4.1.0-next-1778155282668

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 CHANGED
@@ -960,7 +960,7 @@ async function feedbackHandlerBody(client, input) {
960
960
  const isAnonymous = explicitAnonymous ?? anonymous ?? true;
961
961
  await client.submitFeedback(text, {
962
962
  anonymous: isAnonymous,
963
- version: "4.0.0"
963
+ version: "4.1.0-next-1778155282668"
964
964
  });
965
965
  return mcpResult5({ ok: true });
966
966
  } catch (error) {
@@ -1592,7 +1592,7 @@ async function flowExamplesHandlerBody(input) {
1592
1592
  };
1593
1593
  if (examples.length === 0) {
1594
1594
  hints.warnings = [
1595
- "No examples found. Add examples to step definitions in your flow config for testing."
1595
+ "No examples found. Add examples to step entries in your flow config for testing."
1596
1596
  ];
1597
1597
  }
1598
1598
  return mcpResult10(result, hints);
@@ -1665,7 +1665,7 @@ var inputSchema11 = {
1665
1665
  };
1666
1666
  var outputSchema = {
1667
1667
  version: z10.number().describe("Flow config version"),
1668
- flows: z10.record(z10.string(), z10.unknown()).describe("Flow definitions")
1668
+ flows: z10.record(z10.string(), z10.unknown()).describe("Flow entries")
1669
1669
  };
1670
1670
  var annotations11 = {
1671
1671
  readOnlyHint: true,
@@ -1741,7 +1741,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
1741
1741
  var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
1742
1742
  var WALKEROS_JSON_PATH = "dist/walkerOS.json";
1743
1743
  var CACHE_TTL = 5 * 60 * 1e3;
1744
- var CLIENT_HEADER = "walkeros-mcp/4.0.0";
1744
+ var CLIENT_HEADER = "walkeros-mcp/4.1.0-next-1778155282668";
1745
1745
  var cache;
1746
1746
  function normalizePlatform(platform) {
1747
1747
  if (platform == null) return [];
@@ -2150,7 +2150,7 @@ function registerReferenceResources(server) {
2150
2150
  "variables",
2151
2151
  "walkeros://reference/variables",
2152
2152
  {
2153
- description: "walkerOS variable patterns: $var, $env, $def, $contract, $code, $store, $secret substitution",
2153
+ description: "walkerOS variable patterns: $var, $env, $contract, $code, $store, $secret substitution",
2154
2154
  mimeType: "application/json"
2155
2155
  },
2156
2156
  async () => ({
@@ -2161,31 +2161,35 @@ function registerReferenceResources(server) {
2161
2161
  {
2162
2162
  separatorRule: "`.` for names and paths; `:` for literal values or raw-code payloads.",
2163
2163
  patterns: {
2164
- "$var.name": "Variable substitution \u2014 cascade: step settings > flow settings > config variables",
2165
- "$env.NAME": "Environment variable \u2014 $env.GA_ID reads process.env.GA_ID",
2166
- "$env.NAME:default": "Environment variable with fallback \u2014 $env.GA_ID:G-DEFAULT (the `:` is the literal default separator)",
2167
- "$def.name": "Definition reference \u2014 reusable config blocks from definitions section",
2168
- "$def.name.path.deep": "Nested definition access \u2014 $def.ga4Events.purchase",
2169
- "$contract.name": "Contract reference \u2014 links to named contract for validation",
2170
- "$contract.name.path": "Nested contract access \u2014 $contract.ecommerce.product",
2171
- "$code:(expr)": "Inline JavaScript \u2014 $code:(event) => event.data.price * 100 (the `:` carries the raw-code payload)",
2172
- "$store.storeId": "Store injection in env values \u2014 wires runtime store access",
2173
- "$secret.NAME": "Secret injection \u2014 resolved server-side at deploy/runtime"
2164
+ "$var.name": "Variable reference. Whole-string preserves native type (object, array, scalar). Inline interpolation requires a scalar. Reusable fragments (mapping templates, matcher lists, consent objects) live in the variables block and are referenced by name.",
2165
+ "$var.name.deep.path": "Deep-path access into a structured variable. Walks nested keys/indices. Whole-string preserves type at the leaf; inline still requires a scalar leaf.",
2166
+ "$env.NAME": "Environment variable. $env.GA_ID reads process.env.GA_ID.",
2167
+ "$env.NAME:default": "Environment variable with fallback. $env.GA_ID:G-DEFAULT (the `:` is the literal default separator).",
2168
+ "$contract.name": "Contract reference. Links to a named contract for validation.",
2169
+ "$contract.name.path": "Nested contract access. $contract.ecommerce.product.",
2170
+ "$code:(expr)": "Inline JavaScript. $code:(event) => event.data.price * 100 (the `:` carries the raw-code payload).",
2171
+ "$store.storeId": "Store injection in env values. Wires runtime store access.",
2172
+ "$secret.NAME": "Secret injection. Resolved server-side at deploy/runtime."
2174
2173
  },
2175
2174
  cascade: {
2176
2175
  priority: [
2177
- "1. Step-level settings (highest)",
2178
- "2. Flow-level settings",
2176
+ "1. Step-level variables (highest)",
2177
+ "2. Flow-level variables",
2179
2178
  "3. Config-level variables (lowest)"
2180
2179
  ],
2181
2180
  example: {
2182
- variables: { apiKey: "default-key" },
2181
+ variables: {
2182
+ apiUrl: "https://x.io",
2183
+ mapping: { id: "data.id" }
2184
+ },
2183
2185
  flows: {
2184
2186
  production: {
2185
2187
  destinations: {
2186
2188
  api: {
2187
- config: { key: "$var.apiKey" },
2188
- settings: { apiKey: "prod-key" }
2189
+ config: {
2190
+ url: "$var.apiUrl",
2191
+ idPath: "$var.mapping.id"
2192
+ }
2189
2193
  }
2190
2194
  }
2191
2195
  }
@@ -2379,7 +2383,7 @@ function registerSetupMappingPrompt(server) {
2379
2383
  "",
2380
2384
  'Mapping uses nested entity \u2192 action keys. Event "product add" maps to `{ "product": { "add": Rule } }`. Wildcards: `{ "*": { "view": Rule } }`.',
2381
2385
  "",
2382
- "Use $def references for shared mapping patterns across destinations.",
2386
+ "Extract shared mapping shapes into variables, reference via $var.name (deep paths supported).",
2383
2387
  "",
2384
2388
  "Policy and consent in mapping:",
2385
2389
  "- config.policy runs BEFORE mapping rules \u2014 use it to inject or redact fields on the event.",
@@ -2439,54 +2443,6 @@ function registerManageContractPrompt(server) {
2439
2443
  );
2440
2444
  }
2441
2445
 
2442
- // src/prompts/use-definitions.ts
2443
- import { z as z15 } from "zod";
2444
- function registerUseDefinitionsPrompt(server) {
2445
- server.registerPrompt(
2446
- "use-definitions",
2447
- {
2448
- description: "Extract shared patterns into definitions and variables for DRY, environment-aware flow configurations.",
2449
- argsSchema: {
2450
- flowPath: z15.string().optional().describe("Path to the flow.json file to analyze")
2451
- }
2452
- },
2453
- async ({ flowPath }) => ({
2454
- messages: [
2455
- {
2456
- role: "user",
2457
- content: {
2458
- type: "text",
2459
- text: [
2460
- `Help me extract shared patterns into definitions and variables${flowPath ? ` in ${flowPath}` : ""}.`,
2461
- "",
2462
- "Follow these steps:",
2463
- "1. Read the walkeros://reference/variables resource to understand variable syntax.",
2464
- "2. Analyze the flow config for repeated patterns (same mapping blocks, same config values).",
2465
- "3. Extract repeated mapping patterns into the `definitions` section with `$def.name` references.",
2466
- "4. Extract environment-specific values into `variables` with `$var.name` references.",
2467
- "5. Show the cascade priority: step > settings > config.",
2468
- "6. Use flow_validate to verify the result.",
2469
- "",
2470
- "Variable types:",
2471
- "- `$var.name` \u2014 variable substitution (cascade: step > settings > config)",
2472
- "- `$env.NAME` and `$env.NAME:default` \u2014 environment variables",
2473
- "- `$def.name` and `$def.name.path.deep` \u2014 definition references",
2474
- "- `$contract.name` \u2014 contract references",
2475
- "- `$code:(expr)` \u2014 inline JavaScript functions",
2476
- "- `$store.storeId` \u2014 store injection in env values",
2477
- "",
2478
- "Look for:",
2479
- "- Same API keys or URLs across multiple destinations \u2192 $var or $env",
2480
- "- Identical mapping rules in multiple destinations \u2192 $def",
2481
- "- Environment-specific values (dev/staging/prod) \u2192 $var with overrides"
2482
- ].join("\n")
2483
- }
2484
- }
2485
- ]
2486
- })
2487
- );
2488
- }
2489
-
2490
2446
  // src/instructions.ts
2491
2447
  var SERVER_INSTRUCTIONS = `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.
2492
2448
 
@@ -2540,7 +2496,7 @@ Every component in a flow is a **step**: sources capture events, transformers pr
2540
2496
 
2541
2497
  - **Mapping** transforms events using data/map/loop/set/condition rules. Same syntax on sources and destinations. Mapping rules use NESTED entity \u2192 action keying: event name "product add" maps to \`{ "product": { "add": Rule } }\`. Wildcards: \`{ "*": { "view": Rule } }\`.
2542
2498
  - **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.
2543
- - **Variables** ($var, $env, $def, $code, $store) enable DRY, environment-aware config. Use the \`use-definitions\` prompt to extract shared patterns.
2499
+ - **Variables** ($var, $env, $code, $store) enable DRY, environment-aware config. Whole-string \`$var.name\` references preserve native type (object/array/scalar); inline interpolation requires a scalar. Deep paths via \`$var.name.deep.path\`.
2544
2500
  - **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.
2545
2501
 
2546
2502
  ## Simulation Tips
@@ -2646,7 +2602,6 @@ function createWalkerOSMcpServer(opts) {
2646
2602
  registerAddStepPrompt(server);
2647
2603
  registerSetupMappingPrompt(server);
2648
2604
  registerManageContractPrompt(server);
2649
- registerUseDefinitionsPrompt(server);
2650
2605
  wrapRegisteredToolsWithTelemetry(server);
2651
2606
  const priorOnInitialized = server.server.oninitialized;
2652
2607
  server.server.oninitialized = () => {
@@ -2815,7 +2770,7 @@ function createStreamableHttpHandler(server, opts = {}) {
2815
2770
  }
2816
2771
 
2817
2772
  // src/tool-definitions.ts
2818
- import { z as z16 } from "zod";
2773
+ import { z as z15 } from "zod";
2819
2774
  import { schemas as schemas6 } from "@walkeros/cli/dev";
2820
2775
  var TOOL_DEFINITIONS = [
2821
2776
  {
@@ -2823,8 +2778,8 @@ var TOOL_DEFINITIONS = [
2823
2778
  title: "Authentication",
2824
2779
  description: "Manage walkerOS authentication. Check login status, log in via device code flow, or log out. No terminal or browser required, the MCP client handles the authorization URL.",
2825
2780
  inputSchema: {
2826
- action: z16.enum(["status", "login", "logout"]),
2827
- deviceCode: z16.string().optional()
2781
+ action: z15.enum(["status", "login", "logout"]),
2782
+ deviceCode: z15.string().optional()
2828
2783
  },
2829
2784
  annotations: {
2830
2785
  readOnlyHint: false,
@@ -2838,7 +2793,7 @@ var TOOL_DEFINITIONS = [
2838
2793
  title: "Project Management",
2839
2794
  description: "Manage walkerOS projects. List, create, update, delete projects, or set a default project for CLI operations.",
2840
2795
  inputSchema: {
2841
- action: z16.enum([
2796
+ action: z15.enum([
2842
2797
  "list",
2843
2798
  "get",
2844
2799
  "create",
@@ -2846,8 +2801,8 @@ var TOOL_DEFINITIONS = [
2846
2801
  "delete",
2847
2802
  "set_default"
2848
2803
  ]),
2849
- projectId: z16.string().optional(),
2850
- name: z16.string().optional()
2804
+ projectId: z15.string().optional(),
2805
+ name: z15.string().optional()
2851
2806
  },
2852
2807
  annotations: {
2853
2808
  readOnlyHint: false,
@@ -2861,7 +2816,7 @@ var TOOL_DEFINITIONS = [
2861
2816
  title: "Flow Management",
2862
2817
  description: "Manage walkerOS flows and their previews. List/get/create/update/delete/duplicate flows, or create/inspect/delete preview bundles for testing flow changes on live sites.",
2863
2818
  inputSchema: {
2864
- action: z16.enum([
2819
+ action: z15.enum([
2865
2820
  "list",
2866
2821
  "get",
2867
2822
  "create",
@@ -2873,19 +2828,19 @@ var TOOL_DEFINITIONS = [
2873
2828
  "preview_create",
2874
2829
  "preview_delete"
2875
2830
  ]),
2876
- flowId: z16.string().optional(),
2877
- projectId: z16.string().optional(),
2878
- name: z16.string().optional(),
2879
- content: z16.record(z16.string(), z16.unknown()).optional(),
2880
- patch: z16.boolean().optional(),
2881
- fields: z16.array(z16.string()).optional(),
2882
- sort: z16.enum(["name", "updated_at", "created_at"]).optional(),
2883
- order: z16.enum(["asc", "desc"]).optional(),
2884
- includeDeleted: z16.boolean().optional(),
2885
- previewId: z16.string().optional(),
2886
- flowName: z16.string().optional(),
2887
- flowSettingsId: z16.string().optional(),
2888
- siteUrl: z16.string().optional()
2831
+ flowId: z15.string().optional(),
2832
+ projectId: z15.string().optional(),
2833
+ name: z15.string().optional(),
2834
+ content: z15.record(z15.string(), z15.unknown()).optional(),
2835
+ patch: z15.boolean().optional(),
2836
+ fields: z15.array(z15.string()).optional(),
2837
+ sort: z15.enum(["name", "updated_at", "created_at"]).optional(),
2838
+ order: z15.enum(["asc", "desc"]).optional(),
2839
+ includeDeleted: z15.boolean().optional(),
2840
+ previewId: z15.string().optional(),
2841
+ flowName: z15.string().optional(),
2842
+ flowSettingsId: z15.string().optional(),
2843
+ siteUrl: z15.string().optional()
2889
2844
  },
2890
2845
  annotations: {
2891
2846
  readOnlyHint: false,
@@ -2899,14 +2854,14 @@ var TOOL_DEFINITIONS = [
2899
2854
  title: "Deploy Management",
2900
2855
  description: "Deploy walkerOS flows and manage deployments. For get/delete actions pass flowId (required) plus optional slug to disambiguate when a flow has multiple active deployments. If a flow has >=2 active deployments and no slug is supplied, the tool returns a MULTIPLE_DEPLOYMENTS error with a details[] list showing each deployment's slug, type, status, and updatedAt.",
2901
2856
  inputSchema: {
2902
- action: z16.enum(["deploy", "list", "get", "delete"]),
2903
- projectId: z16.string().optional(),
2904
- flowId: z16.string().optional(),
2905
- slug: z16.string().optional(),
2906
- type: z16.enum(["web", "server"]).optional(),
2907
- status: z16.string().optional(),
2908
- wait: z16.boolean().optional(),
2909
- flowName: z16.string().optional()
2857
+ action: z15.enum(["deploy", "list", "get", "delete"]),
2858
+ projectId: z15.string().optional(),
2859
+ flowId: z15.string().optional(),
2860
+ slug: z15.string().optional(),
2861
+ type: z15.enum(["web", "server"]).optional(),
2862
+ status: z15.string().optional(),
2863
+ wait: z15.boolean().optional(),
2864
+ flowName: z15.string().optional()
2910
2865
  },
2911
2866
  annotations: {
2912
2867
  readOnlyHint: false,
@@ -2933,8 +2888,8 @@ var TOOL_DEFINITIONS = [
2933
2888
  description: "Bundle a walkerOS flow configuration into deployable JavaScript. Resolves all destinations, sources, and transformers, then outputs a tree-shaken production bundle. Returns bundle statistics. Set remote: true to use the walkerOS cloud service instead of local build tools.",
2934
2889
  inputSchema: {
2935
2890
  ...schemas6.BundleInputShape,
2936
- remote: z16.boolean().optional(),
2937
- content: z16.record(z16.string(), z16.unknown()).optional()
2891
+ remote: z15.boolean().optional(),
2892
+ content: z15.record(z15.string(), z15.unknown()).optional()
2938
2893
  },
2939
2894
  annotations: {
2940
2895
  readOnlyHint: false,
@@ -2949,11 +2904,11 @@ var TOOL_DEFINITIONS = [
2949
2904
  description: 'Simulate events through a walkerOS flow without making real API calls. For destinations: event is a walkerOS event { name: "entity action", data: {...} }. For sources: event is { content: ..., trigger?: { type?, options? }, env?: {...} }. Use step to target a specific step. Use flow_examples to discover available test data. IMPORTANT: Destinations with require (e.g. require: ["consent"]) stay pending until that collector event fires, simulation will error "not found" if require is not satisfied. Remove require from config or provide consent/user events before simulating. Separately, destinations with consent (e.g. consent: { marketing: true }) only receive events where the event includes matching consent. Mapping transforms event names and data at the destination level. Policy redacts or injects fields before mapping runs.',
2950
2905
  inputSchema: {
2951
2906
  configPath: schemas6.SimulateInputShape.configPath,
2952
- event: z16.union([z16.record(z16.string(), z16.unknown()), z16.string()]).optional(),
2907
+ event: z15.union([z15.record(z15.string(), z15.unknown()), z15.string()]).optional(),
2953
2908
  flow: schemas6.SimulateInputShape.flow,
2954
2909
  platform: schemas6.SimulateInputShape.platform,
2955
2910
  step: schemas6.SimulateInputShape.step,
2956
- verbose: z16.boolean().optional()
2911
+ verbose: z15.boolean().optional()
2957
2912
  },
2958
2913
  annotations: {
2959
2914
  readOnlyHint: true,
@@ -2968,7 +2923,7 @@ var TOOL_DEFINITIONS = [
2968
2923
  description: "Push a real event through a walkerOS flow to actual destinations. Makes real API calls to real endpoints. Best suited for server-side flows, web flows should use flow_simulate for testing.",
2969
2924
  inputSchema: {
2970
2925
  configPath: schemas6.PushInputShape.configPath,
2971
- event: z16.record(z16.string(), z16.unknown()),
2926
+ event: z15.record(z15.string(), z15.unknown()),
2972
2927
  flow: schemas6.PushInputShape.flow,
2973
2928
  platform: schemas6.PushInputShape.platform
2974
2929
  },
@@ -2984,11 +2939,11 @@ var TOOL_DEFINITIONS = [
2984
2939
  title: "Flow Examples",
2985
2940
  description: "List all step examples in a walkerOS flow configuration. Shows example names, step locations, and in/out shapes. Use this to discover available test fixtures and simulation data.",
2986
2941
  inputSchema: {
2987
- configPath: z16.string().min(1),
2988
- flow: z16.string().optional(),
2989
- step: z16.string().optional(),
2990
- full: z16.boolean().optional(),
2991
- includeHidden: z16.boolean().optional()
2942
+ configPath: z15.string().min(1),
2943
+ flow: z15.string().optional(),
2944
+ step: z15.string().optional(),
2945
+ full: z15.boolean().optional(),
2946
+ includeHidden: z15.boolean().optional()
2992
2947
  },
2993
2948
  annotations: {
2994
2949
  readOnlyHint: true,
@@ -3002,8 +2957,8 @@ var TOOL_DEFINITIONS = [
3002
2957
  title: "Load or Create Flow",
3003
2958
  description: "Load an existing flow configuration from a local file path, URL, or walkerOS API (by flow ID). Or create a new empty flow by specifying a platform (web or server). Use the add-step prompt to add sources, destinations, transformers, or stores to the flow.",
3004
2959
  inputSchema: {
3005
- source: z16.string().optional(),
3006
- platform: z16.enum(["web", "server"]).optional()
2960
+ source: z15.string().optional(),
2961
+ platform: z15.enum(["web", "server"]).optional()
3007
2962
  },
3008
2963
  annotations: {
3009
2964
  readOnlyHint: true,
@@ -3017,10 +2972,10 @@ var TOOL_DEFINITIONS = [
3017
2972
  title: "Search Package",
3018
2973
  description: "Start here for package discovery. Never guess package names, use this tool first to find exact names. Without package name: returns catalog filtered by type/platform. With package name: returns metadata, hint keys, and example summaries.",
3019
2974
  inputSchema: {
3020
- package: z16.string().min(1).optional(),
3021
- type: z16.enum(["source", "destination", "transformer", "store"]).optional(),
3022
- platform: z16.enum(["web", "server"]).optional(),
3023
- version: z16.string().optional()
2975
+ package: z15.string().min(1).optional(),
2976
+ type: z15.enum(["source", "destination", "transformer", "store"]).optional(),
2977
+ platform: z15.enum(["web", "server"]).optional(),
2978
+ version: z15.string().optional()
3024
2979
  },
3025
2980
  annotations: {
3026
2981
  readOnlyHint: true,
@@ -3034,9 +2989,9 @@ var TOOL_DEFINITIONS = [
3034
2989
  title: "Get Package",
3035
2990
  description: 'Requires exact package name, do not guess names, use package_search first to find them. Returns schemas + hint texts + example summaries by default (lightweight). Use section parameter for full content: "hints" (with code blocks), "examples" (full in/out data), or "all".',
3036
2991
  inputSchema: {
3037
- package: z16.string().min(1),
3038
- version: z16.string().optional(),
3039
- section: z16.enum(["hints", "examples", "all"]).optional()
2992
+ package: z15.string().min(1),
2993
+ version: z15.string().optional(),
2994
+ section: z15.enum(["hints", "examples", "all"]).optional()
3040
2995
  },
3041
2996
  annotations: {
3042
2997
  readOnlyHint: true,
@@ -3050,8 +3005,8 @@ var TOOL_DEFINITIONS = [
3050
3005
  title: "Send Feedback",
3051
3006
  description: "Send feedback about walkerOS",
3052
3007
  inputSchema: {
3053
- text: z16.string(),
3054
- anonymous: z16.boolean().optional()
3008
+ text: z15.string(),
3009
+ anonymous: z15.boolean().optional()
3055
3010
  },
3056
3011
  annotations: {
3057
3012
  readOnlyHint: false,