@walkeros/mcp 4.0.0 → 4.0.1-next-1778183328892

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/stdio.js CHANGED
@@ -643,7 +643,7 @@ async function flowExamplesHandlerBody(input) {
643
643
  };
644
644
  if (examples.length === 0) {
645
645
  hints.warnings = [
646
- "No examples found. Add examples to step definitions in your flow config for testing."
646
+ "No examples found. Add examples to step entries in your flow config for testing."
647
647
  ];
648
648
  }
649
649
  return mcpResult5(result, hints);
@@ -679,7 +679,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
679
679
  var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
680
680
  var WALKEROS_JSON_PATH = "dist/walkerOS.json";
681
681
  var CACHE_TTL = 5 * 60 * 1e3;
682
- var CLIENT_HEADER = "walkeros-mcp/4.0.0";
682
+ var CLIENT_HEADER = "walkeros-mcp/4.0.1-next-1778183328892";
683
683
  var cache;
684
684
  function normalizePlatform(platform) {
685
685
  if (platform == null) return [];
@@ -1006,7 +1006,7 @@ var inputSchema6 = {
1006
1006
  };
1007
1007
  var outputSchema = {
1008
1008
  version: z6.number().describe("Flow config version"),
1009
- flows: z6.record(z6.string(), z6.unknown()).describe("Flow definitions")
1009
+ flows: z6.record(z6.string(), z6.unknown()).describe("Flow entries")
1010
1010
  };
1011
1011
  var annotations6 = {
1012
1012
  readOnlyHint: true,
@@ -1121,7 +1121,7 @@ async function feedbackHandlerBody(client, input) {
1121
1121
  const isAnonymous = explicitAnonymous ?? anonymous ?? true;
1122
1122
  await client.submitFeedback(text, {
1123
1123
  anonymous: isAnonymous,
1124
- version: "4.0.0"
1124
+ version: "4.0.1-next-1778183328892"
1125
1125
  });
1126
1126
  return mcpResult8({ ok: true });
1127
1127
  } catch (error) {
@@ -2153,7 +2153,7 @@ function registerReferenceResources(server) {
2153
2153
  "variables",
2154
2154
  "walkeros://reference/variables",
2155
2155
  {
2156
- description: "walkerOS variable patterns: $var, $env, $def, $contract, $code, $store, $secret substitution",
2156
+ description: "walkerOS variable patterns: $var, $env, $contract, $code, $store, $secret substitution",
2157
2157
  mimeType: "application/json"
2158
2158
  },
2159
2159
  async () => ({
@@ -2164,31 +2164,35 @@ function registerReferenceResources(server) {
2164
2164
  {
2165
2165
  separatorRule: "`.` for names and paths; `:` for literal values or raw-code payloads.",
2166
2166
  patterns: {
2167
- "$var.name": "Variable substitution \u2014 cascade: step settings > flow settings > config variables",
2168
- "$env.NAME": "Environment variable \u2014 $env.GA_ID reads process.env.GA_ID",
2169
- "$env.NAME:default": "Environment variable with fallback \u2014 $env.GA_ID:G-DEFAULT (the `:` is the literal default separator)",
2170
- "$def.name": "Definition reference \u2014 reusable config blocks from definitions section",
2171
- "$def.name.path.deep": "Nested definition access \u2014 $def.ga4Events.purchase",
2172
- "$contract.name": "Contract reference \u2014 links to named contract for validation",
2173
- "$contract.name.path": "Nested contract access \u2014 $contract.ecommerce.product",
2174
- "$code:(expr)": "Inline JavaScript \u2014 $code:(event) => event.data.price * 100 (the `:` carries the raw-code payload)",
2175
- "$store.storeId": "Store injection in env values \u2014 wires runtime store access",
2176
- "$secret.NAME": "Secret injection \u2014 resolved server-side at deploy/runtime"
2167
+ "$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.",
2168
+ "$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.",
2169
+ "$env.NAME": "Environment variable. $env.GA_ID reads process.env.GA_ID.",
2170
+ "$env.NAME:default": "Environment variable with fallback. $env.GA_ID:G-DEFAULT (the `:` is the literal default separator).",
2171
+ "$contract.name": "Contract reference. Links to a named contract for validation.",
2172
+ "$contract.name.path": "Nested contract access. $contract.ecommerce.product.",
2173
+ "$code:(expr)": "Inline JavaScript. $code:(event) => event.data.price * 100 (the `:` carries the raw-code payload).",
2174
+ "$store.storeId": "Store injection in env values. Wires runtime store access.",
2175
+ "$secret.NAME": "Secret injection. Resolved server-side at deploy/runtime."
2177
2176
  },
2178
2177
  cascade: {
2179
2178
  priority: [
2180
- "1. Step-level settings (highest)",
2181
- "2. Flow-level settings",
2179
+ "1. Step-level variables (highest)",
2180
+ "2. Flow-level variables",
2182
2181
  "3. Config-level variables (lowest)"
2183
2182
  ],
2184
2183
  example: {
2185
- variables: { apiKey: "default-key" },
2184
+ variables: {
2185
+ apiUrl: "https://x.io",
2186
+ mapping: { id: "data.id" }
2187
+ },
2186
2188
  flows: {
2187
2189
  production: {
2188
2190
  destinations: {
2189
2191
  api: {
2190
- config: { key: "$var.apiKey" },
2191
- settings: { apiKey: "prod-key" }
2192
+ config: {
2193
+ url: "$var.apiUrl",
2194
+ idPath: "$var.mapping.id"
2195
+ }
2192
2196
  }
2193
2197
  }
2194
2198
  }
@@ -2382,7 +2386,7 @@ function registerSetupMappingPrompt(server) {
2382
2386
  "",
2383
2387
  'Mapping uses nested entity \u2192 action keys. Event "product add" maps to `{ "product": { "add": Rule } }`. Wildcards: `{ "*": { "view": Rule } }`.',
2384
2388
  "",
2385
- "Use $def references for shared mapping patterns across destinations.",
2389
+ "Extract shared mapping shapes into variables, reference via $var.name (deep paths supported).",
2386
2390
  "",
2387
2391
  "Policy and consent in mapping:",
2388
2392
  "- config.policy runs BEFORE mapping rules \u2014 use it to inject or redact fields on the event.",
@@ -2442,54 +2446,6 @@ function registerManageContractPrompt(server) {
2442
2446
  );
2443
2447
  }
2444
2448
 
2445
- // src/prompts/use-definitions.ts
2446
- import { z as z15 } from "zod";
2447
- function registerUseDefinitionsPrompt(server) {
2448
- server.registerPrompt(
2449
- "use-definitions",
2450
- {
2451
- description: "Extract shared patterns into definitions and variables for DRY, environment-aware flow configurations.",
2452
- argsSchema: {
2453
- flowPath: z15.string().optional().describe("Path to the flow.json file to analyze")
2454
- }
2455
- },
2456
- async ({ flowPath }) => ({
2457
- messages: [
2458
- {
2459
- role: "user",
2460
- content: {
2461
- type: "text",
2462
- text: [
2463
- `Help me extract shared patterns into definitions and variables${flowPath ? ` in ${flowPath}` : ""}.`,
2464
- "",
2465
- "Follow these steps:",
2466
- "1. Read the walkeros://reference/variables resource to understand variable syntax.",
2467
- "2. Analyze the flow config for repeated patterns (same mapping blocks, same config values).",
2468
- "3. Extract repeated mapping patterns into the `definitions` section with `$def.name` references.",
2469
- "4. Extract environment-specific values into `variables` with `$var.name` references.",
2470
- "5. Show the cascade priority: step > settings > config.",
2471
- "6. Use flow_validate to verify the result.",
2472
- "",
2473
- "Variable types:",
2474
- "- `$var.name` \u2014 variable substitution (cascade: step > settings > config)",
2475
- "- `$env.NAME` and `$env.NAME:default` \u2014 environment variables",
2476
- "- `$def.name` and `$def.name.path.deep` \u2014 definition references",
2477
- "- `$contract.name` \u2014 contract references",
2478
- "- `$code:(expr)` \u2014 inline JavaScript functions",
2479
- "- `$store.storeId` \u2014 store injection in env values",
2480
- "",
2481
- "Look for:",
2482
- "- Same API keys or URLs across multiple destinations \u2192 $var or $env",
2483
- "- Identical mapping rules in multiple destinations \u2192 $def",
2484
- "- Environment-specific values (dev/staging/prod) \u2192 $var with overrides"
2485
- ].join("\n")
2486
- }
2487
- }
2488
- ]
2489
- })
2490
- );
2491
- }
2492
-
2493
2449
  // src/instructions.ts
2494
2450
  var SERVER_INSTRUCTIONS = `walkerOS is an open-source, privacy-first event data collection platform. Define event pipelines as code using JSON flow configurations.
2495
2451
 
@@ -2543,7 +2499,7 @@ Every component in a flow is a **step**: sources capture events, transformers pr
2543
2499
 
2544
2500
  - **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 } }\`.
2545
2501
  - **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.
2546
- - **Variables** ($var, $env, $def, $code, $store) enable DRY, environment-aware config. Use the \`use-definitions\` prompt to extract shared patterns.
2502
+ - **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\`.
2547
2503
  - **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.
2548
2504
 
2549
2505
  ## Simulation Tips
@@ -2652,7 +2608,6 @@ function createWalkerOSMcpServer(opts) {
2652
2608
  registerAddStepPrompt(server);
2653
2609
  registerSetupMappingPrompt(server);
2654
2610
  registerManageContractPrompt(server);
2655
- registerUseDefinitionsPrompt(server);
2656
2611
  wrapRegisteredToolsWithTelemetry(server);
2657
2612
  const priorOnInitialized = server.server.oninitialized;
2658
2613
  server.server.oninitialized = () => {
@@ -2800,7 +2755,7 @@ var HttpToolClient = class {
2800
2755
  };
2801
2756
 
2802
2757
  // src/stdio.ts
2803
- setClientContext({ type: "mcp", version: "4.0.0" });
2758
+ setClientContext({ type: "mcp", version: "4.0.1-next-1778183328892" });
2804
2759
  process.on("uncaughtException", (err) => {
2805
2760
  const emitter = getMcpEmitterSingleton();
2806
2761
  if (emitter) {
@@ -2820,7 +2775,7 @@ process.on("unhandledRejection", (reason) => {
2820
2775
  async function main() {
2821
2776
  const server = createWalkerOSMcpServer({
2822
2777
  client: new HttpToolClient(),
2823
- version: "4.0.0"
2778
+ version: "4.0.1-next-1778183328892"
2824
2779
  });
2825
2780
  const transport = new StdioServerTransport();
2826
2781
  await server.connect(transport);
@@ -2830,7 +2785,7 @@ main().catch(async (error) => {
2830
2785
  try {
2831
2786
  const emitter = await createMcpEmitter({
2832
2787
  clientInfo: void 0,
2833
- packageVersion: "4.0.0"
2788
+ packageVersion: "4.0.1-next-1778183328892"
2834
2789
  });
2835
2790
  await emitter.emitError("startup");
2836
2791
  } catch {