@walkeros/mcp 4.1.0-next-1778668930820 → 4.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.1.0-next-1778668930820"
963
+ version: "4.1.0"
964
964
  });
965
965
  return mcpResult5({ ok: true });
966
966
  } catch (error) {
@@ -984,7 +984,7 @@ function registerFeedbackTool(server, client) {
984
984
  }
985
985
 
986
986
  // src/tools/validate.ts
987
- import { validate } from "@walkeros/cli";
987
+ import { validate, loadJsonConfig } from "@walkeros/cli";
988
988
  import { schemas } from "@walkeros/cli/dev";
989
989
  import { mcpResult as mcpResult6, mcpError as mcpError6 } from "@walkeros/core";
990
990
 
@@ -1077,6 +1077,34 @@ var ExamplesListOutputShape = {
1077
1077
  };
1078
1078
 
1079
1079
  // src/tools/validate.ts
1080
+ var DEPRECATED_STORE_PACKAGE = "@walkeros/store-memory";
1081
+ function detectDeprecatedStorePackages(config) {
1082
+ const errors = [];
1083
+ if (!config || typeof config !== "object") return errors;
1084
+ const flows = config.flows;
1085
+ if (!flows || typeof flows !== "object") return errors;
1086
+ for (const [flowName, flowEntry] of Object.entries(
1087
+ flows
1088
+ )) {
1089
+ if (!flowEntry || typeof flowEntry !== "object") continue;
1090
+ const stores = flowEntry.stores;
1091
+ if (!stores || typeof stores !== "object") continue;
1092
+ for (const [storeId, storeEntry] of Object.entries(
1093
+ stores
1094
+ )) {
1095
+ if (!storeEntry || typeof storeEntry !== "object") continue;
1096
+ const pkg = storeEntry.package;
1097
+ if (pkg === DEPRECATED_STORE_PACKAGE) {
1098
+ errors.push({
1099
+ path: `flows.${flowName}.stores.${storeId}`,
1100
+ message: `Store "${storeId}" uses ${DEPRECATED_STORE_PACKAGE}, which has been removed. Use the built-in cache by omitting cache.store, or remove the store declaration if it was only used as a cache target.`,
1101
+ code: "DEPRECATED_PACKAGE"
1102
+ });
1103
+ }
1104
+ }
1105
+ }
1106
+ return errors;
1107
+ }
1080
1108
  function wrapIssueMessages(result) {
1081
1109
  return {
1082
1110
  ...result,
@@ -1121,7 +1149,22 @@ async function flowValidateHandlerBody(input) {
1121
1149
  flow,
1122
1150
  path
1123
1151
  });
1124
- const hints = result.valid ? {
1152
+ let augmented = result;
1153
+ if (type === "flow" && typeof validateInput === "string") {
1154
+ try {
1155
+ const config = await loadJsonConfig(validateInput);
1156
+ const deprecatedErrors = detectDeprecatedStorePackages(config);
1157
+ if (deprecatedErrors.length > 0) {
1158
+ augmented = {
1159
+ ...result,
1160
+ valid: false,
1161
+ errors: [...result.errors, ...deprecatedErrors]
1162
+ };
1163
+ }
1164
+ } catch {
1165
+ }
1166
+ }
1167
+ const hints = augmented.valid ? {
1125
1168
  next: [
1126
1169
  "Use flow_simulate to test event flow",
1127
1170
  "Use flow_bundle to build"
@@ -1132,7 +1175,7 @@ async function flowValidateHandlerBody(input) {
1132
1175
  "Read walkeros://reference/flow-schema for correct structure"
1133
1176
  ]
1134
1177
  };
1135
- return mcpResult6(wrapIssueMessages(result), hints);
1178
+ return mcpResult6(wrapIssueMessages(augmented), hints);
1136
1179
  } catch (error) {
1137
1180
  return mcpError6(
1138
1181
  error,
@@ -1499,7 +1542,7 @@ function registerFlowPushTool(server) {
1499
1542
 
1500
1543
  // src/tools/examples.ts
1501
1544
  import { z as z9 } from "zod";
1502
- import { loadJsonConfig } from "@walkeros/cli";
1545
+ import { loadJsonConfig as loadJsonConfig2 } from "@walkeros/cli";
1503
1546
  import { mcpResult as mcpResult10, mcpError as mcpError10 } from "@walkeros/core";
1504
1547
  var TITLE10 = "Flow Examples";
1505
1548
  var DESCRIPTION10 = "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.";
@@ -1533,7 +1576,7 @@ function createFlowExamplesToolSpec() {
1533
1576
  async function flowExamplesHandlerBody(input) {
1534
1577
  const { configPath, flow, step, full, includeHidden } = input ?? {};
1535
1578
  try {
1536
- const rawConfig = await loadJsonConfig(configPath);
1579
+ const rawConfig = await loadJsonConfig2(configPath);
1537
1580
  const flowNames = Object.keys(rawConfig.flows || {});
1538
1581
  const flowName = flow || (flowNames.length === 1 ? flowNames[0] : void 0);
1539
1582
  if (!flowName) {
@@ -1620,7 +1663,7 @@ function registerFlowExamplesTool(server) {
1620
1663
 
1621
1664
  // src/tools/flow-load.ts
1622
1665
  import { z as z10 } from "zod";
1623
- import { loadJsonConfig as loadJsonConfig2 } from "@walkeros/cli";
1666
+ import { loadJsonConfig as loadJsonConfig3 } from "@walkeros/cli";
1624
1667
  import { mcpResult as mcpResult11, mcpError as mcpError11 } from "@walkeros/core";
1625
1668
  var KEEP_LITERAL2 = /* @__PURE__ */ new Set([
1626
1669
  "id",
@@ -1687,7 +1730,7 @@ async function flowLoadHandlerBody(input) {
1687
1730
  const { source, platform } = input ?? {};
1688
1731
  try {
1689
1732
  if (source) {
1690
- const config = await loadJsonConfig2(source);
1733
+ const config = await loadJsonConfig3(source);
1691
1734
  return mcpResult11(redactNestedStrings(config, { skip: keepLiteral2 }), {
1692
1735
  next: ["Use flow_validate to check", "Use add-step prompt to modify"]
1693
1736
  });
@@ -1741,7 +1784,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
1741
1784
  var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
1742
1785
  var WALKEROS_JSON_PATH = "dist/walkerOS.json";
1743
1786
  var CACHE_TTL = 5 * 60 * 1e3;
1744
- var CLIENT_HEADER = "walkeros-mcp/4.1.0-next-1778668930820";
1787
+ var CLIENT_HEADER = "walkeros-mcp/4.1.0";
1745
1788
  var cache;
1746
1789
  function normalizePlatform(platform) {
1747
1790
  if (platform == null) return [];
@@ -2341,7 +2384,7 @@ function registerAddStepPrompt(server) {
2341
2384
  "- Read the walkeros://reference/flow-schema resource to understand connection rules.",
2342
2385
  "- Sources connect to pre-collector transformers via `next`.",
2343
2386
  "- Destinations connect to post-collector transformers via `before`.",
2344
- '- Routing supports string IDs, sequences (`["a", "b"]`), or RouteConfig (`{ match?, next }` for gated single-target or `{ match?, case: [...] }` for first-match dispatch). Omit `match` for always-match.',
2387
+ '- Routing supports string IDs, sequences (`["a", "b"]`), or RouteConfig (`{ match?, next }` for gated single-target or `{ match?, one: [...] }` for first-match dispatch). Use `many` (instead of `one`) when every matching entry should run as an independent parallel flow \u2014 restricted to pre-collector positions. Omit `match` for always-match.',
2345
2388
  "- A transformer entry can be code-bearing (`code`), package-bearing (`package`), or a **pass-through step** (no `code`, no `package`). Pass-through synthesis is automatic at runtime. Three flavors of pass-through: `before`/`next`-only (named hop reusable across destinations), `cache`-only (dedup, rate-limit), or `mapping`-only (declarative event-to-event transform). A pass-through must declare at least one of `before`, `next`, `cache`, or `mapping`.",
2346
2389
  "- The `mapping` field on a transformer step uses the same `Mapping.Config` shape as destinations, but the semantic is event-to-event (mutates the event in place via `policy`, per-rule `policy`, `mapping[].name` for renames, `mapping[].ignore` to drop). Vendor-payload fields (`data`, `silent`) are no-ops at this position.",
2347
2390
  "- Closed schema: unknown top-level keys on a transformer step are errors (catches typos like `dedup` instead of `cache`). `code` + `package` together is a conflict.",
@@ -2502,7 +2545,7 @@ Every component in a flow is a **step**: sources capture events, transformers pr
2502
2545
  - **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.
2503
2546
  - **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\`.
2504
2547
  - **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.
2505
- - **Routing** wires steps via \`next\` (pre-collector) and \`before\` (post-collector). A route is a string ID, a sequence (\`["a", "b"]\`), or a RouteConfig (\`{ match?, next }\` or \`{ match?, case: [...] }\`). The \`case\` operator dispatches first-match against an ordered list. The optional \`match\` field is omitted to mean always-match (no wildcard literal).
2548
+ - **Routing** wires steps via \`next\` (pre-collector) and \`before\` (post-collector). A route is a string ID, a sequence (\`["a", "b"]\`), or a RouteConfig (\`{ match?, next }\` or \`{ match?, one: [...] }\`). The \`one\` operator dispatches first-match against an ordered list of branches. Use \`many\` (instead of \`one\`) when every matching entry should run as an independent parallel flow \u2014 restricted to pre-collector positions. The optional \`match\` field is omitted to mean always-match (no wildcard literal).
2506
2549
  - **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\`.
2507
2550
  - **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.
2508
2551
  - **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.