@walkeros/mcp 4.7.1 → 4.7.2-next-1791147139360

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/README.md CHANGED
@@ -129,7 +129,7 @@ The server registers 19 tools.
129
129
  | `walkeros://reference/flow-schema` | Flow configuration structure and connection rules |
130
130
  | `walkeros://reference/event-model` | Event naming, properties, and auto-populated fields |
131
131
  | `walkeros://reference/mapping` | Mapping syntax: data, map, loop, set, condition, policy |
132
- | `walkeros://reference/consent` | The consent model at destination, rule, and field level |
132
+ | `walkeros://reference/consent` | The consent model at destination and field level |
133
133
  | `walkeros://reference/variables` | Variable patterns: `$var`, `$env`, `$secret`, `$code`, `$store` |
134
134
  | `walkeros://reference/contract` | Event schemas, wildcards, and inheritance |
135
135
  | `walkeros://reference/openapi` | The live OpenAPI 3.1 document of the app this server talks to |
package/dist/index.d.ts CHANGED
@@ -828,8 +828,8 @@ declare class HttpToolClient implements ToolClient {
828
828
  /**
829
829
  * Observe session lifecycle over the CLI's authenticated boundary. The trio
830
830
  * routes through the same `apiFetch` as every other method here, so token
831
- * resolution, base URL, and `ApiError` shaping (which `isAuthError` reads)
832
- * stay identical to the rest of the client.
831
+ * resolution, base URL, and `ApiError` shaping (which
832
+ * `isAuthenticationError` reads) stay identical to the rest of the client.
833
833
  */
834
834
  startObserveSession(options: StartObserveSessionOptions): Promise<ObserveSessionResult>;
835
835
  getObserveSession(options: ObserveSessionRef): Promise<ObserveSessionResult>;
package/dist/index.js CHANGED
@@ -282,16 +282,15 @@ import { z as z3 } from "zod";
282
282
  import { mcpResult as mcpResult2, mcpError as mcpError3 } from "@walkeros/core";
283
283
 
284
284
  // src/types.ts
285
- function isAuthError(error) {
285
+ function isAuthenticationError(error) {
286
286
  if (!(error instanceof Error)) return false;
287
- const msg = error.message.toLowerCase();
288
- if (msg.includes("unauthorized") || msg.includes("forbidden") || msg.includes("invalid token") || msg.includes("token expired") || msg.includes("not authenticated")) {
289
- return true;
290
- }
291
- const code = error.code;
292
- if (!code) return false;
293
- const upperCode = code.toUpperCase();
294
- return upperCode === "UNAUTHORIZED" || upperCode === "FORBIDDEN" || upperCode === "401" || upperCode === "403" || upperCode.startsWith("AUTH_");
287
+ if ("status" in error && error.status === 401) return true;
288
+ return "code" in error && error.code === "UNAUTHORIZED";
289
+ }
290
+ function isAccessRefusal(error) {
291
+ if (!(error instanceof Error)) return false;
292
+ if ("status" in error && error.status === 403) return true;
293
+ return "code" in error && (error.code === "FORBIDDEN" || error.code === "INSUFFICIENT_SCOPE");
295
294
  }
296
295
  var AUTH_HINT = 'Are you logged in? Use auth(action: "status") to check.';
297
296
 
@@ -579,7 +578,10 @@ async function projectManageHandlerBody(client, input) {
579
578
  );
580
579
  }
581
580
  } catch (error) {
582
- return mcpError3(error, isAuthError(error) ? AUTH_HINT : void 0);
581
+ return mcpError3(
582
+ error,
583
+ isAuthenticationError(error) ? AUTH_HINT : void 0
584
+ );
583
585
  }
584
586
  }
585
587
  function registerProjectManageTool(server, client) {
@@ -1152,7 +1154,10 @@ async function flowManageHandlerBody(client, input) {
1152
1154
  );
1153
1155
  }
1154
1156
  } catch (error) {
1155
- return mcpError4(error, isAuthError(error) ? AUTH_HINT : void 0);
1157
+ return mcpError4(
1158
+ error,
1159
+ isAuthenticationError(error) ? AUTH_HINT : void 0
1160
+ );
1156
1161
  }
1157
1162
  }
1158
1163
  function registerFlowManageTool(server, client) {
@@ -1414,7 +1419,10 @@ async function deployManageHandlerBody(client, input) {
1414
1419
  );
1415
1420
  }
1416
1421
  } catch (error) {
1417
- return mcpError5(error, isAuthError(error) ? AUTH_HINT : void 0);
1422
+ return mcpError5(
1423
+ error,
1424
+ isAuthenticationError(error) ? AUTH_HINT : void 0
1425
+ );
1418
1426
  }
1419
1427
  }
1420
1428
  function registerDeployTool(server, client) {
@@ -1546,7 +1554,10 @@ async function secretManageHandlerBody(client, input) {
1546
1554
  );
1547
1555
  }
1548
1556
  } catch (error) {
1549
- return mcpError6(error, isAuthError(error) ? AUTH_HINT : void 0);
1557
+ return mcpError6(
1558
+ error,
1559
+ isAuthenticationError(error) ? AUTH_HINT : void 0
1560
+ );
1550
1561
  }
1551
1562
  }
1552
1563
  function registerSecretManageTool(server, client) {
@@ -1661,7 +1672,10 @@ async function observeJourneysHandlerBody(client, input) {
1661
1672
  ]
1662
1673
  });
1663
1674
  } catch (error) {
1664
- return mcpError7(error, isAuthError(error) ? AUTH_HINT : void 0);
1675
+ return mcpError7(
1676
+ error,
1677
+ isAuthenticationError(error) ? AUTH_HINT : void 0
1678
+ );
1665
1679
  }
1666
1680
  }
1667
1681
  function registerObserveJourneysTool(server, client) {
@@ -1681,6 +1695,28 @@ function registerObserveJourneysTool(server, client) {
1681
1695
  // src/tools/observe-session.ts
1682
1696
  import { z as z8 } from "zod";
1683
1697
  import { mcpResult as mcpResult7, mcpError as mcpError8 } from "@walkeros/core";
1698
+
1699
+ // src/tools/feature-gate.ts
1700
+ var FEATURE_NOT_AVAILABLE = "FEATURE_NOT_AVAILABLE";
1701
+ function codeOf(error) {
1702
+ if (!(error instanceof Error) || !("code" in error)) return void 0;
1703
+ const code = error.code;
1704
+ return typeof code === "string" ? code : void 0;
1705
+ }
1706
+ function isFeatureDenial(error) {
1707
+ return codeOf(error) === FEATURE_NOT_AVAILABLE;
1708
+ }
1709
+ function featureDenialHint(feature) {
1710
+ return `The "${feature}" feature is not enabled for this project. Tell the person that "${feature}" needs a plan or project entitlement that unlocks it, which is changed in the app, not through this tool.`;
1711
+ }
1712
+ function errorHint(error, feature, notFoundHint) {
1713
+ if (isFeatureDenial(error)) return featureDenialHint(feature);
1714
+ if (isAuthenticationError(error)) return AUTH_HINT;
1715
+ if (codeOf(error) === "NOT_FOUND") return notFoundHint;
1716
+ return void 0;
1717
+ }
1718
+
1719
+ // src/tools/observe-session.ts
1684
1720
  var TITLE7 = "Observe Session";
1685
1721
  var DESCRIPTION7 = "Open, inspect, or end an Observe session: a time-boxed window on one flow that runtimes attach to as arms. A preview arm streams from a browser, a container arm runs server-side, and both feed ONE shared journeys feed. start opens the window (arms picks which runtimes attach), status reports per-arm state plus recordsReceived and expiresAt, stop ends the whole session including every arm. A flow has at most one session, so status/stop resolve it from flowId when sessionId is omitted. Read the events with observe_journeys; this tool never returns event data and never judges whether events are correct.";
1686
1722
  var HINT_SIMULATE_FIRST = "Simulate before preview: flow_simulate checks mapping with no browser.";
@@ -1838,7 +1874,8 @@ async function resolveSessionId(client, options) {
1838
1874
  });
1839
1875
  return result.sessionId;
1840
1876
  } catch (error) {
1841
- if (isAuthError(error)) throw error;
1877
+ if (isAuthenticationError(error) || isAccessRefusal(error) || isFeatureDenial(error))
1878
+ throw error;
1842
1879
  const detail = error instanceof Error ? error.message : String(error);
1843
1880
  throw new SessionResolutionError(
1844
1881
  `${SESSION_RESOLUTION_FAILED} (${detail})`,
@@ -1967,7 +2004,10 @@ async function observeSessionHandlerBody(client, input) {
1967
2004
  );
1968
2005
  }
1969
2006
  } catch (error) {
1970
- return mcpError8(error, isAuthError(error) ? AUTH_HINT : void 0);
2007
+ return mcpError8(
2008
+ error,
2009
+ isAuthenticationError(error) ? AUTH_HINT : void 0
2010
+ );
1971
2011
  }
1972
2012
  }
1973
2013
  function registerObserveSessionTool(server, client) {
@@ -1987,28 +2027,6 @@ function registerObserveSessionTool(server, client) {
1987
2027
  // src/tools/hub-manage.ts
1988
2028
  import { z as z9 } from "zod";
1989
2029
  import { mcpResult as mcpResult8, mcpError as mcpError9 } from "@walkeros/core";
1990
-
1991
- // src/tools/feature-gate.ts
1992
- var FEATURE_NOT_AVAILABLE = "FEATURE_NOT_AVAILABLE";
1993
- function codeOf(error) {
1994
- if (!(error instanceof Error) || !("code" in error)) return void 0;
1995
- const code = error.code;
1996
- return typeof code === "string" ? code : void 0;
1997
- }
1998
- function isFeatureDenial(error) {
1999
- return codeOf(error) === FEATURE_NOT_AVAILABLE;
2000
- }
2001
- function featureDenialHint(feature) {
2002
- return `The "${feature}" feature is not enabled for this project. Tell the person that "${feature}" needs a plan or project entitlement that unlocks it, which is changed in the app, not through this tool.`;
2003
- }
2004
- function errorHint(error, feature, notFoundHint) {
2005
- if (isFeatureDenial(error)) return featureDenialHint(feature);
2006
- if (isAuthError(error)) return AUTH_HINT;
2007
- if (codeOf(error) === "NOT_FOUND") return notFoundHint;
2008
- return void 0;
2009
- }
2010
-
2011
- // src/tools/hub-manage.ts
2012
2030
  var MAX_ANNOTATION_TEXT_LENGTH = 4e3;
2013
2031
  var MAX_ANCHOR_KEY_LENGTH = 255;
2014
2032
  var MAX_ANCHOR_LABEL_LENGTH = 255;
@@ -2881,7 +2899,7 @@ async function feedbackHandlerBody(client, input) {
2881
2899
  const isAnonymous = explicitAnonymous ?? anonymous ?? true;
2882
2900
  await client.submitFeedback(text, {
2883
2901
  anonymous: isAnonymous,
2884
- version: "4.7.1"
2902
+ version: "4.7.2-next-1791147139360"
2885
2903
  });
2886
2904
  return mcpResult10({ ok: true });
2887
2905
  } catch (error) {
@@ -3673,7 +3691,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
3673
3691
  var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
3674
3692
  var WALKEROS_JSON_PATH = "dist/walkerOS.json";
3675
3693
  var CACHE_TTL = 5 * 60 * 1e3;
3676
- var CLIENT_HEADER = "walkeros-mcp/4.7.1";
3694
+ var CLIENT_HEADER = "walkeros-mcp/4.7.2-next-1791147139360";
3677
3695
  function getPackageBaseUrl() {
3678
3696
  return process.env.WALKEROS_APP_URL || void 0;
3679
3697
  }
@@ -4091,7 +4109,10 @@ async function flowLoadHandlerBody(client, runtime, input) {
4091
4109
  }
4092
4110
  );
4093
4111
  } catch (error) {
4094
- return mcpError18(error, isAuthError(error) ? AUTH_HINT : void 0);
4112
+ return mcpError18(
4113
+ error,
4114
+ isAuthenticationError(error) ? AUTH_HINT : void 0
4115
+ );
4095
4116
  }
4096
4117
  }
4097
4118
  try {
@@ -4602,7 +4623,7 @@ function registerReferenceResources(server, client) {
4602
4623
  "consent",
4603
4624
  "walkeros://reference/consent",
4604
4625
  {
4605
- description: "JSON Schema for walkerOS consent: destination-level, rule-level, and field-level consent gating",
4626
+ description: "JSON Schema for walkerOS consent: destination-level and field-level consent gating",
4606
4627
  mimeType: "application/json"
4607
4628
  },
4608
4629
  async () => ({
@@ -4844,7 +4865,7 @@ function registerSetupMappingPrompt(server) {
4844
4865
  "Policy and consent in mapping:",
4845
4866
  "- config.policy runs BEFORE mapping rules \u2014 use it to inject or redact fields on the event.",
4846
4867
  "- rule.policy runs after config.policy but before data transformation \u2014 use for event-specific pre-processing.",
4847
- "- config.consent gates ALL events to this destination. rule.consent gates specific event types.",
4868
+ "- config.consent gates ALL events to this destination. rule.consent is not enforced yet.",
4848
4869
  "- Individual value configs support consent: { marketing: true } for field-level gating."
4849
4870
  ].join("\n")
4850
4871
  }
@@ -4959,10 +4980,10 @@ Every component in a flow is a **step**: sources capture events, transformers pr
4959
4980
  - **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 } }\`.
4960
4981
  - **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.
4961
4982
  - **Variables** ($var, $env, $secret, $code, $store) enable DRY, environment-aware config. \`$var.name\` is a reusable flow variable from the top-level \`variables\` block; whole-string refs preserve native type (object/array/scalar), inline interpolation requires a scalar, deep paths via \`$var.name.deep.path\`. \`$env.NAME[:default]\` is an environment variable resolved at bundle/deploy time (non-secret config only). \`$secret.NAME\` is a managed secret the deploy pipeline injects into the server runner at runtime; credentials, tokens, and private keys must use \`$secret\`, not \`$env\`.
4962
- - **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.
4983
+ - **Consent** gates destinations (\`config.consent\`) and individual fields (a value's \`consent\`). A mapping rule's \`consent\` is not enforced yet. Privacy-first by design.
4963
4984
  - **Routing** uses one grammar in every chain field (\`source.before\`, \`source.next\`, \`transformer.before\`, \`transformer.next\`, \`collector.next\`, \`destination.before\`, \`destination.next\`). A route is a string ID, a sequence (\`["a", "b"]\`), or a RouteConfig: \`{ match?, next }\`, \`{ match?, one: [...] }\` (first match wins), \`{ match?, many: [...] }\` (every match becomes its own copy of the event with its own id and finishes the rest of the path on its own, never merged), or \`{ match?, stop: true }\` (ends that copy). In a sequence, a member's own \`next\` runs right after it, then the sequence continues. \`match\` reads \`{ ingest, event }\` and each route is evaluated when the event reaches it. A \`stop\` in \`collector.next\` drops the event for every destination; per-destination filtering belongs in \`destination.before\`. An array of only route configs is an implicit \`one\`. The optional \`match\` field is omitted to mean always-match (no wildcard literal).
4964
4985
  - **Pass-through steps** are transformer entries with no \`code\` and no \`package\`. The runtime synthesizes the push for them automatically. Three flavors share this shape: a \`before\` / \`next\`-only step (named hop reusable across destinations), a \`cache\`-only step (dedup, rate-limit), and a \`mapping\`-only step (declarative event-to-event transform). A pass-through must declare at least one of \`before\`, \`next\`, \`cache\`, or \`mapping\`.
4965
- - **Mapping at the transformer position** uses the same \`Mapping.Config\` shape as destinations, but the semantic is event-to-event: \`policy\` and per-rule \`policy\`, \`mapping[].name\` (rename), \`mapping[].ignore\` (drop from chain), \`consent\`, and \`include\` apply. Vendor-payload fields (\`data\`, \`silent\`, \`mapping[].data\`) are no-ops at this position.
4986
+ - **Mapping at the transformer position** uses the same \`Mapping.Config\` shape as destinations, but the semantic is event-to-event: \`policy\` and per-rule \`policy\`, \`mapping[].name\` (rename), \`mapping[].ignore\` (drop from chain), and \`include\` apply. \`consent\` is not enforced at this position. Vendor-payload fields (\`data\`, \`silent\`, \`mapping[].data\`) are no-ops at this position.
4966
4987
  - **Closed-schema rule on transformer entries:** known keys only. Operative keys are \`code\`, \`package\`, \`before\`, \`next\`, \`cache\`, \`mapping\`. Combined with structural keys (\`config\`, \`env\`, \`validate\`, \`disabled\`, \`id\`, etc.). Unknown top-level keys on a transformer step are errors (catches typos like \`dedup: {}\` instead of nested under \`cache\`). \`code\` + \`package\` together is a conflict.
4967
4988
  - **Cache** memoizes step output on a configured store. Set \`cache.stop: true\` to short-circuit the chain on HIT (sources default to stop-on-HIT); in a source chain or \`collector.next\` that halts the event for all destinations. Set \`cache.namespace\` to prefix keys; omit it to write keys directly. \`CacheRule.match\` is optional, omit for always-match.
4968
4989
 
@@ -5241,8 +5262,8 @@ var HttpToolClient = class {
5241
5262
  /**
5242
5263
  * Observe session lifecycle over the CLI's authenticated boundary. The trio
5243
5264
  * routes through the same `apiFetch` as every other method here, so token
5244
- * resolution, base URL, and `ApiError` shaping (which `isAuthError` reads)
5245
- * stay identical to the rest of the client.
5265
+ * resolution, base URL, and `ApiError` shaping (which
5266
+ * `isAuthenticationError` reads) stay identical to the rest of the client.
5246
5267
  */
5247
5268
  async startObserveSession(options) {
5248
5269
  return startObserveSession(options);
@@ -5333,7 +5354,7 @@ var HttpToolClient = class {
5333
5354
  async checkContract() {
5334
5355
  return compareContract({
5335
5356
  baseUrl: this.appBaseUrl(),
5336
- client: { type: "mcp", version: "4.7.1" }
5357
+ client: { type: "mcp", version: "4.7.2-next-1791147139360" }
5337
5358
  });
5338
5359
  }
5339
5360
  /** The live public OpenAPI document of `appBaseUrl()`, without a credential. */