@walkeros/mcp 4.6.1 → 4.7.0-next-1790187973605

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
@@ -378,7 +378,7 @@ var inputSchema3 = {
378
378
  // Override the (optional) CLI `step` shape: the simulate handler hard-requires
379
379
  // a target step (no all-steps mode), so the registered schema must be honest.
380
380
  step: z2.string().describe(
381
- 'Required. Target step as "type.name" \u2014 e.g. "source.demo", "destination.gtag", "transformer.router".'
381
+ 'Required. Target step as "type.name", e.g. "source.demo", "collector.default", "destination.gtag", "transformer.router". A collector step runs enrichment and then collector.next, returning every event the destinations would receive (none after a stop).'
382
382
  ),
383
383
  verbose: z2.boolean().optional().describe("Include full payload per destination (default: false)"),
384
384
  ingest: z2.record(z2.string(), z2.unknown()).optional().describe(
@@ -651,7 +651,7 @@ var NPM_SEARCH_URL = "https://registry.npmjs.org/-/v1/search";
651
651
  var JSDELIVR_BASE = "https://cdn.jsdelivr.net/npm";
652
652
  var WALKEROS_JSON_PATH = "dist/walkerOS.json";
653
653
  var CACHE_TTL = 5 * 60 * 1e3;
654
- var CLIENT_HEADER = "walkeros-mcp/4.6.1";
654
+ var CLIENT_HEADER = "walkeros-mcp/4.7.0-next-1790187973605";
655
655
  function getPackageBaseUrl() {
656
656
  return process.env.WALKEROS_APP_URL || void 0;
657
657
  }
@@ -1421,7 +1421,7 @@ async function feedbackHandlerBody(client, input) {
1421
1421
  const isAnonymous = explicitAnonymous ?? anonymous ?? true;
1422
1422
  await client.submitFeedback(text, {
1423
1423
  anonymous: isAnonymous,
1424
- version: "4.6.1"
1424
+ version: "4.7.0-next-1790187973605"
1425
1425
  });
1426
1426
  return mcpResult8({ ok: true });
1427
1427
  } catch (error) {
@@ -23158,7 +23158,7 @@ var HUB_MANAGE_INPUT_SCHEMA = {
23158
23158
  'One frame (frm_...), the named rectangle a note hangs on. Action "knowledge" only. Narrower than pageKey, since a page holds several frames.'
23159
23159
  ),
23160
23160
  markId: z15.string().min(1).max(MAX_MARK_ID_LENGTH).optional().describe(
23161
- 'One mark within "frameId". Action "knowledge" only, and refused without frameId, since a mark id alone addresses nothing. Naming a mark is also what attaches the message bodies.'
23161
+ 'One tag within "frameId", by its tag id (the id of an entry in frame_manage marks.tags). Action "knowledge" only, and refused without frameId, since a mark id alone addresses nothing. Naming a mark is also what attaches the message bodies.'
23162
23162
  )
23163
23163
  };
23164
23164
  var annotations16 = {
@@ -23694,7 +23694,7 @@ import { mcpResult as mcpResult18, mcpError as mcpError17 } from "@walkeros/core
23694
23694
  var FRAME_ID_PATTERN2 = /^frm_[A-Za-z0-9_-]{21}$/;
23695
23695
  var MAX_PAGE_KEY_CHARS = 1024;
23696
23696
  var TITLE17 = "Frames";
23697
- var FRAME_MANAGE_DESCRIPTION = 'Read the frames of a measurement plan: named rectangles with marks inside them, drawn in Tag Mode or in the app. Actions: list (every frame of the project, without marks), page (the frames of one page at any depth, with marks), get (one frame with its marks). Read-only: frames are drawn and edited in Tag Mode or the app, never here. A frame name is documentation; the marks inside it carry the meaning. A frame that extends another stores only what it adds. Use hub_manage action "knowledge" with a frameId or markId to read what people wrote on a frame. A markId is an id read from the marks of a frame here: mark ids come back literal so they can be passed straight back, while the text around them is wrapped as data. An entity action is an object carrying its id beside the raw attribute text, because the id is the address and the raw text is not.';
23697
+ var FRAME_MANAGE_DESCRIPTION = 'Read the frames of a measurement plan: named rectangles with marks inside them, drawn in Tag Mode or in the app. Actions: list (every frame of the project, without marks), page (the frames of one page at any depth, with marks), get (one frame with its marks). Read-only: frames are drawn and edited in Tag Mode or the app, never here. A frame name is documentation; the marks inside it carry the meaning. A frame that extends another stores only what it adds, so its tags may carry only the fields they change. Marks are { tags, note }: tags is one flat list of tags, each with an id, a kind such as entity, property or action, a name, and a parentId naming the tag it sits under; note is the frame\u2019s own description and thread. Use hub_manage action "knowledge" with a frameId or markId to read what people wrote on a frame. A markId is a tag id: a tag\u2019s id, parentId and threadRef come back literal when they have the shape the app mints, so they can be passed straight back; every other string value in the marks is wrapped as data, and so is an object key that is not a plain identifier.';
23698
23698
  var FRAME_MANAGE_INPUT_SCHEMA = {
23699
23699
  action: z16.enum(["list", "page", "get"]).describe(
23700
23700
  "list the project\u2019s frames, read one page with marks, or read one frame"
@@ -23718,8 +23718,8 @@ var annotations17 = {
23718
23718
  var FRAME_HINT_OPEN_PAGE_OR_GET = 'Use action "page" with a pageKey (a frame\u2019s source.key) to read a page with marks, or action "get" with a frameId.';
23719
23719
  var FRAME_HINT_NAMES_ARE_DOCUMENTATION = "Frame names are documentation; the marks inside a frame carry the meaning.";
23720
23720
  var FRAME_HINT_NONE_YET = "This project has no frames yet. Frames are drawn in Tag Mode or the app, not through this tool.";
23721
- var FRAME_HINT_MARK_SPACE = "Marks are in their frame\u2019s own 0..1 space; a child frame sits inside its parent through placements[].rect.";
23722
- var FRAME_HINT_READ_KNOWLEDGE = 'Use hub_manage action "knowledge" with frameId (and markId) to read what people wrote here. A markId is an id from these marks, and an entity action is addressed by its own id, never by its raw text.';
23721
+ var FRAME_HINT_MARK_SPACE = "Tag geometry is fractional: a rect is 0..1 of its frame, and an at is 0..1 of its parent tag\u2019s box, or of the frame for a root tag; a child frame sits inside its parent through placements[].rect.";
23722
+ var FRAME_HINT_READ_KNOWLEDGE = 'Use hub_manage action "knowledge" with frameId (and markId) to read what people wrote here. A markId is a tag id from these marks, and a tag\u2019s threadRef is the id of its thread entry there.';
23723
23723
  var FRAME_HINT_NONE_ON_PAGE = 'No frames on this page. Check the pageKey against the source.key values from action "list".';
23724
23724
  var FRAME_HINT_EXTENDS_BASE = "This frame extends another and stores only what it adds; read the base frame (extends) for the rest.";
23725
23725
  var FRAME_NOT_FOUND_HINT = 'Use action "list" or "page" to find frame ids.';
@@ -23755,67 +23755,59 @@ function serializeLean(frame) {
23755
23755
  function isRecord2(value) {
23756
23756
  return typeof value === "object" && value !== null && !Array.isArray(value);
23757
23757
  }
23758
- function actionMarkId(entityId, raw) {
23759
- return `${entityId}#action.${raw}`;
23760
- }
23761
- var MARK_ADDRESS_KEYS = /* @__PURE__ */ new Set([
23762
- // The mark id itself, and a component of the data and action addresses.
23763
- "id",
23764
- // The first half of an ambient address, `ambient.<kind>.<key>`, and the
23765
- // discriminator a reader branches on.
23766
- "kind",
23767
- // An entity's pointer at another entity, which is that entity's mark id.
23768
- "link",
23769
- // The thread a note became, which action "note_add" takes as threadId.
23770
- "threadRef"
23758
+ var TAG_ID_PATTERN = /^[A-Za-z0-9_-]+(?:\/[A-Za-z0-9_-]+)*(?:#(?:data\.v?[0-9]+|action\.[0-9]+|context\.[0-9]+|[0-9]+))?$/;
23759
+ var MAX_TAG_ID_CHARS = 200;
23760
+ var THREAD_ID_PATTERN = /^thr_[a-z0-9]{21}$/;
23761
+ var isTagId = (value) => value.length <= MAX_TAG_ID_CHARS && TAG_ID_PATTERN.test(value);
23762
+ var isThreadId = (value) => THREAD_ID_PATTERN.test(value);
23763
+ var TAG_ADDRESSES = /* @__PURE__ */ new Map([
23764
+ // The tag id: the markId `hub_manage` action "knowledge" takes, which the
23765
+ // app joins to the frame id as the anchor key `<frameId>:<markId>`.
23766
+ ["id", isTagId],
23767
+ // The tag this one sits under, which is that tag's id: the only relation
23768
+ // between tags, so a reader joins it to `id` to rebuild the tree, and it is
23769
+ // a markId in its own right.
23770
+ ["parentId", isTagId],
23771
+ // The hub thread this tag's note thread became: the `id` of the thread
23772
+ // entry `hub_manage` action "knowledge" returns for this tag.
23773
+ ["threadRef", isThreadId]
23771
23774
  ]);
23772
- var MARK_ADDRESS_LIST_KEYS = /* @__PURE__ */ new Set([
23773
- // The entities a context band covers, by their mark ids.
23774
- "covers"
23775
- ]);
23776
- var MARK_PAGE_DATA_KEYS = /* @__PURE__ */ new Set(["anchor", "actionAnchors"]);
23777
- function isProseKeyedRecord(key, owner) {
23778
- return key === "data" && typeof owner.kind !== "string";
23779
- }
23780
- function walkMarks(value, inPageData = false) {
23775
+ var NOTE_ADDRESSES = /* @__PURE__ */ new Map(
23776
+ [["threadRef", isThreadId]]
23777
+ );
23778
+ var MARK_KEY_PATTERN = /^[A-Za-z_$][A-Za-z0-9_$-]{0,63}$/;
23779
+ var markKey = (key) => MARK_KEY_PATTERN.test(key) ? key : wrapUserData(key);
23780
+ function walkText(value) {
23781
23781
  if (typeof value === "string") return wrapUserData(value);
23782
- if (Array.isArray(value)) {
23783
- return value.map((item) => walkMarks(item, inPageData));
23784
- }
23782
+ if (Array.isArray(value)) return value.map(walkText);
23785
23783
  if (!isRecord2(value)) return value;
23786
- const entityId = typeof value.id === "string" ? value.id : void 0;
23787
23784
  const out = {};
23788
23785
  for (const [key, child] of Object.entries(value)) {
23789
- if (MARK_PAGE_DATA_KEYS.has(key)) {
23790
- out[key] = walkMarks(child, true);
23791
- } else if (!inPageData && isRecord2(child) && isProseKeyedRecord(key, value)) {
23792
- out[key] = proseKeyedPairs(child);
23786
+ out[markKey(key)] = walkText(child);
23787
+ }
23788
+ return out;
23789
+ }
23790
+ function walkMarks(marks) {
23791
+ const out = {};
23792
+ for (const [key, value] of Object.entries(marks)) {
23793
+ if (key === "tags" && Array.isArray(value)) {
23794
+ out[key] = value.map((tag) => walkAddressed(tag, TAG_ADDRESSES));
23795
+ } else if (key === "note") {
23796
+ out[key] = walkAddressed(value, NOTE_ADDRESSES);
23793
23797
  } else {
23794
- out[key] = walkMarkEntry(key, child, entityId, inPageData);
23798
+ out[markKey(key)] = walkText(value);
23795
23799
  }
23796
23800
  }
23797
23801
  return out;
23798
23802
  }
23799
- function proseKeyedPairs(record) {
23800
- return Object.entries(record).map(([key, value]) => ({
23801
- key: wrapUserData(key),
23802
- value: walkMarks(value)
23803
- }));
23804
- }
23805
- function walkMarkEntry(key, child, entityId, inPageData) {
23806
- if (inPageData) return walkMarks(child, true);
23807
- if (MARK_ADDRESS_KEYS.has(key) && typeof child === "string") return child;
23808
- if (MARK_ADDRESS_LIST_KEYS.has(key) && Array.isArray(child)) {
23809
- return child.map(
23810
- (item) => typeof item === "string" ? item : walkMarks(item)
23811
- );
23812
- }
23813
- if (key === "actions" && entityId !== void 0 && Array.isArray(child)) {
23814
- return child.map(
23815
- (raw) => typeof raw === "string" ? { id: actionMarkId(entityId, raw), raw: wrapUserData(raw) } : walkMarks(raw)
23816
- );
23803
+ function walkAddressed(value, addresses) {
23804
+ if (!isRecord2(value)) return walkText(value);
23805
+ const out = {};
23806
+ for (const [key, field] of Object.entries(value)) {
23807
+ const isAddress = addresses.get(key);
23808
+ out[markKey(key)] = isAddress !== void 0 && typeof field === "string" && isAddress(field) ? field : walkText(field);
23817
23809
  }
23818
- return walkMarks(child);
23810
+ return out;
23819
23811
  }
23820
23812
  function serializeFrame(frame) {
23821
23813
  return {
@@ -24224,9 +24216,10 @@ function registerAddStepPrompt(server) {
24224
24216
  "",
24225
24217
  "Important:",
24226
24218
  "- Read the walkeros://reference/flow-schema resource to understand connection rules.",
24227
- "- Sources connect to pre-collector transformers via `next`.",
24228
- "- Destinations connect to post-collector transformers via `before`.",
24229
- '- 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.',
24219
+ "- Sources connect to transformers via `next` (runs before the collector).",
24220
+ "- The collector connects to transformers via `collector.next` (runs once per event before the destination fan-out, for every destination).",
24221
+ "- Destinations connect to transformers via `before` (runs for that destination only; put per-destination filtering here).",
24222
+ '- Routing uses one grammar in every chain field: string IDs, sequences (`["a", "b"]`, where a member\'s own `next` runs right after it), or RouteConfig (`{ match?, next }` for a gated link, `{ match?, one: [...] }` for first-match dispatch, `{ match?, many: [...] }` to fork each match into its own copy that finishes the rest of the path, `{ match?, stop: true }` to drop). A `stop` in `collector.next` drops the event for all destinations. Omit `match` for always-match.',
24230
24223
  "- 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`.",
24231
24224
  "- 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.",
24232
24225
  "- 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.",
@@ -24365,7 +24358,7 @@ var SERVER_INSTRUCTIONS = `walkerOS is an open-source, privacy-first event data
24365
24358
 
24366
24359
  ## Architecture: Source \u2192 Collector \u2192 Destination(s)
24367
24360
 
24368
- Every 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.
24361
+ Every component in a flow is a **step**: sources capture events, transformers process them, destinations deliver them, stores provide shared state. Steps connect via chains: \`source.next\` runs before the collector, \`collector.next\` runs once per event before the destination fan-out (all destinations), and \`destination.before\` runs for one destination.
24369
24362
 
24370
24363
  ## Flow Config Structure
24371
24364
 
@@ -24393,11 +24386,11 @@ Every component in a flow is a **step**: sources capture events, transformers pr
24393
24386
  - **Contracts** define event schemas using entity-action keying. Can generate FROM mappings or scaffold mappings FROM contracts.
24394
24387
  - **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\`.
24395
24388
  - **Consent** gates destinations, mapping rules, and individual fields. Privacy-first by design.
24396
- - **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).
24389
+ - **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).
24397
24390
  - **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\`.
24398
24391
  - **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.
24399
24392
  - **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.
24400
- - **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). Set \`cache.namespace\` to prefix keys; omit it to write keys directly. \`CacheRule.match\` is optional, omit for always-match.
24393
+ - **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.
24401
24394
 
24402
24395
  ## Simulation Tips
24403
24396
 
@@ -24990,7 +24983,7 @@ function createLocalRuntime() {
24990
24983
  }
24991
24984
 
24992
24985
  // src/stdio.ts
24993
- setClientContext({ type: "mcp", version: "4.6.1" });
24986
+ setClientContext({ type: "mcp", version: "4.7.0-next-1790187973605" });
24994
24987
  process.on("uncaughtException", (err) => {
24995
24988
  const emitter = getMcpEmitterSingleton();
24996
24989
  if (emitter) {
@@ -25010,7 +25003,7 @@ process.on("unhandledRejection", (reason) => {
25010
25003
  async function main() {
25011
25004
  const server = createWalkerOSMcpServer({
25012
25005
  client: new HttpToolClient(),
25013
- version: "4.6.1",
25006
+ version: "4.7.0-next-1790187973605",
25014
25007
  runtime: createLocalRuntime()
25015
25008
  });
25016
25009
  const transport = new StdioServerTransport();
@@ -25021,7 +25014,7 @@ main().catch(async (error) => {
25021
25014
  try {
25022
25015
  const emitter = await createMcpEmitter({
25023
25016
  clientInfo: void 0,
25024
- packageVersion: "4.6.1"
25017
+ packageVersion: "4.7.0-next-1790187973605"
25025
25018
  });
25026
25019
  await emitter.emitError("startup");
25027
25020
  } catch {