@walkeros/collector 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/CHANGELOG.md ADDED
@@ -0,0 +1,865 @@
1
+ # @walkeros/collector
2
+
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - e155ff8: Collector and destination buffers are now size-bounded with FIFO
8
+ drop-oldest eviction. Defaults: collector `queueMax: 1000`, destination
9
+ `queueMax: 1000`, destination `dlqMax: 100`. Set either knob to override per
10
+ scope. Drop counts surface in `collector.status.dropped` and
11
+ `collector.status.destinations[id]`.
12
+ - b276173: **Breaking:** `code: "<exportName>"` is no longer accepted on any
13
+ step. Replace with `import: "<exportName>"` alongside `package`.
14
+
15
+ **New:** Every step (source, transformer, destination, store) accepts
16
+ `import?: string`. With `package`, it selects a named export. `package` alone
17
+ still loads the default export. Inline code stays
18
+ `code: { push, type?, init? }`. Empty steps are valid no-ops. `flow_validate`
19
+ and the CLI bundler raise `OBSOLETE_CODE_STRING` on the legacy shape with a
20
+ precise rename hint.
21
+
22
+ - dd9f5ad: Pass-through transformer steps + closed-schema validation.
23
+
24
+ **Validation:** `validateTransformerEntry` in `@walkeros/core` is now the
25
+ single source of truth. Bundler, `flow_validate`, and collector runtime all
26
+ delegate. Closed schema: unknown top-level keys are errors. `code` + `package`
27
+ together is a `CONFLICT`.
28
+
29
+ **Pass-through steps:** A transformer entry with no `code` and no `package` is
30
+ valid; the collector synthesizes its push. Three variants:
31
+ - before/next chain only (named hop)
32
+ - cache only (e.g. dedup)
33
+ - mapping only (event-to-event transform via `Mapping.Config`)
34
+
35
+ **Mapping at the transformer position:** new `mapping?: Mapping.Config` field
36
+ on `Transformer.Config` / `InitTransformer`. Same shape as
37
+ `Destination.Config.mapping`, event-to-event semantic. `data` / `silent` are
38
+ ignored at the transformer position with a one-time warning.
39
+
40
+ **Engine tag:** synthesized instance now uses `type: 'pass'` (was `'path'`).
41
+ Hard cut.
42
+
43
+ **Runtime fixes:**
44
+ - `compileNext` handles mixed-shape `next` arrays (`["a", { case }]`) via a
45
+ new `'sequence'` variant.
46
+ - A destination's `before` referencing a pass-through transformer now walks
47
+ that transformer's own `before` / `next`.
48
+ - `cache.stop: true` at a pre-collector transformer halts the pipeline
49
+ (matches `cache.mdx`).
50
+
51
+ **Migration:** Typo keys on a step now fail validation.
52
+ `instance.type === 'path'` consumers must read `'pass'`. `runTransformerChain`
53
+ consumers should branch on the new `stopped` flag.
54
+
55
+ - adeebea: Route grammar: rename `case` to `one` (first-match dispatch) and add
56
+ `many` (all-match parallel fan-out, pre-collector only). `many` terminates the
57
+ main chain and is rejected at post-collector positions (`destination.before`,
58
+ `destination.next`); use multiple destinations for post-collector fan-out.
59
+ `RouteCaseConfig` is renamed to `RouteOneConfig`; no aliases.
60
+ - 13aaeaa: `Source.Context` no longer exposes `setIngest` or `setRespond`.
61
+ Server sources handling concurrent inbound requests must call
62
+ `context.withScope(rawScope, respond, body)` to bind per-request ingest and
63
+ respond. Browser and other single-scope sources keep working without changes.
64
+ - adeebea: Add `Flow.Store.cache` for store-level caching: read-through +
65
+ write-through wrapper with single-flight dedup, recursive composition via
66
+ `cache.store`, and per-wrapper counters. `CacheRule` is now a discriminated
67
+ union (`EventCacheRule | StoreCacheRule`); schema rejects inert fields in
68
+ store contexts.
69
+
70
+ Built-in `__cache` upgraded with LRU, `maxEntries: 10000`, batched eviction,
71
+ and active TTL sweep.
72
+
73
+ **Breaking:** `@walkeros/store-memory` is removed. Its logic is absorbed into
74
+ `__cache`. Migration: drop the store declaration, or omit `cache.store` to use
75
+ the built-in tier. `flow_validate` flags legacy references.
76
+
77
+ - fd6076e: Walker commands `destination`, `hook`, and `on` now take a single
78
+ Init object: `elb('walker destination', { code, config })`,
79
+ `elb('walker hook', { name, fn })`, `elb('walker on', { type, rules })`. The
80
+ previous positional forms and the `{ push }` shorthand are removed; the
81
+ `options` argument is gone from `collector.command`, `addDestination`, and
82
+ `commonHandleCommand`.
83
+
84
+ ### Patch Changes
85
+
86
+ - e155ff8: Cache reads through `checkCache` are now correct against async stores
87
+ (filesystem, Redis, any store with an async `get`). Previously a custom async
88
+ store could silently miss the cache.
89
+
90
+ `checkCache` returns a Promise. External callers must add `await`.
91
+
92
+ - 1a8f2d7: Flow v4 routing & cache cleanup.
93
+
94
+ **Cache:**
95
+ - `cache.full` is renamed to `cache.stop`. Search-and-replace.
96
+ - `cacheRule.match` is now optional. Omitted means always-match. The literal
97
+ `'*'` is dropped from the schema and the TypeScript types; `compileMatcher`
98
+ still tolerates the string at runtime for migration.
99
+ - New `cache.namespace?: string` field. Omit to write keys directly to the
100
+ store. Same store + same key + same namespace = same cache entry.
101
+ - Implicit per-step namespace prefixes (`s:`, `t:`, `d:`) are removed. If you
102
+ relied on them to separate same-keyed caches across
103
+ sources/transformers/destinations using the same store, set
104
+ `cache.namespace` explicitly.
105
+
106
+ **Routing:**
107
+ - Unified recursive `Route` type. A Route is `string | Route[] | RouteConfig`.
108
+ - New `case` operator replaces the legacy `Route[]` first-match shape. The
109
+ legacy shape is compiled as an implicit `{ case: [...] }` for runtime
110
+ compatibility, but new configs should use `case` explicitly.
111
+ - `RouteConfig` is a disjoint union enforced at the TypeScript type level via
112
+ `never` fields: a single RouteConfig sets at most one of `next` / `case`. A
113
+ bare `{ match }` is a gate (pass-through when the match fires, fall-through
114
+ when it fails). JSON Schema validation currently emits `anyOf` and does not
115
+ enforce disjointness at runtime — see follow-up notes.
116
+ - Sequence sugar (`next: [A, B, C]`) is preserved.
117
+
118
+ **Path:**
119
+ - A transformer entry with no `code` is a `path` — a code-less passthrough.
120
+ The engine synthesizes `(e) => ({ event: e })`. Use paths to name and share
121
+ `before` chains across destinations. Validation: a path must declare at
122
+ least one of `package`, `before`, `next`, or `cache`.
123
+
124
+ **Schema & tooling:**
125
+ - Updated Zod schemas (cache, route, matcher).
126
+ - Updated MCP tool descriptions and resource references.
127
+ - Updated `flow_validate` to enforce the new constraints (`EMPTY_TRANSFORMER`
128
+ error code added).
129
+
130
+ **Migration:** Hard cut at the schema/type level. Configs using `cache.full`
131
+ will fail validation — rename to `stop`. Configs using `match: "*"` will fail
132
+ validation — omit `match`. Configs using `Route[]` first-match still work at
133
+ runtime (compiled as implicit `case`) but new configs should use `case`
134
+ explicitly.
135
+
136
+ `$schema: "v4"` is preserved. No version bump.
137
+
138
+ - e800974: `Status.dropped` is now keyed by stepId, so operators can see at a
139
+ glance which step dropped events. Read with
140
+ `status.dropped["collector"]?.queue` or
141
+ `status.dropped["destination.<id>"]?.queue` / `.dlq`, or build the key with
142
+ the new `stepId()` helper exported from `@walkeros/core`. Breaking change: the
143
+ previous flat shape (`status.dropped.queue` / `.queuePush` / `.dlq`) and the
144
+ per-destination `dropped` field on `DestinationStatus` are removed.
145
+ - 6cdc362: Add `@walkeros/transformer-ga4`: GA4 Measurement Protocol v2 decoder
146
+ transformer with default mappings for 33 standard events. Server-side use via
147
+ `source-express` in the `before` chain.
148
+
149
+ Also: fix collector to preserve fan-out in `source.before` chains. Previously,
150
+ when a before-transformer returned an array of events, only the first
151
+ survived. This enables vendor-protocol decoders (GA4, Segment, Snowplow, etc.)
152
+ to fan a batched request into N walkerOS events.
153
+
154
+ - e800974: Internal pipeline failures in mapping, source startup, transformer
155
+ init, and destination init now log via the scoped logger and increment
156
+ `collector.status.failed`. Previously silent. User-supplied callbacks (mapping
157
+ `condition`/`fn`/`validate`, `on` subscriptions) log on throw but do not
158
+ affect `status.failed`. A source whose `init()` throws now stays
159
+ `config.init === false` instead of being marked initialized.
160
+ - Updated dependencies [e155ff8]
161
+ - Updated dependencies [e800974]
162
+ - Updated dependencies [e155ff8]
163
+ - Updated dependencies [1a8f2d7]
164
+ - Updated dependencies [1a8f2d7]
165
+ - Updated dependencies [b276173]
166
+ - Updated dependencies [dd9f5ad]
167
+ - Updated dependencies [c60ef35]
168
+ - Updated dependencies [adeebea]
169
+ - Updated dependencies [13aaeaa]
170
+ - Updated dependencies [e800974]
171
+ - Updated dependencies [adeebea]
172
+ - Updated dependencies [e800974]
173
+ - Updated dependencies [e800974]
174
+ - Updated dependencies [058f7ed]
175
+ - Updated dependencies [28a8ac2]
176
+ - Updated dependencies [fd6076e]
177
+ - @walkeros/core@4.1.0
178
+
179
+ ## 4.0.2
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [a6a0ea7]
184
+ - @walkeros/core@4.0.2
185
+
186
+ ## 4.0.1
187
+
188
+ ### Patch Changes
189
+
190
+ - cb265eb: Surface destination init errors in logs at ERROR level. Previously,
191
+ two layers swallowed errors silently: the gcp destination's init catch only
192
+ logged for `isNotFound` errors and re-threw everything else without logging;
193
+ the collector wrapped `destinationInit` with `tryCatchAsync` (no `onError`),
194
+ which silently returned `undefined` on a thrown error and treated the
195
+ destination as not-initialized. Combined effect: a real init failure (e.g.,
196
+ the recent `streamType` regression in BigQuery Storage Write API call) showed
197
+ only `[gcp-bigquery] init` in DEBUG logs and nothing else, regardless of log
198
+ level.
199
+
200
+ Now: gcp's init catch logs every error at ERROR before re-throwing (with
201
+ consistent `error:` context key), AND the collector logs at ERROR via
202
+ `logger.scope(destType).error('Destination init threw', { error })` if init
203
+ throws or rejects. Failures are never silent. Mocks updated to enforce the new
204
+ shapes; tests cover both sync-throw and async-rejection variants.
205
+
206
+ - 1524275: Source lifecycle redesign: factory + eager `init` + collector-gated
207
+ `on()`
208
+
209
+ Source factories must now be side-effect-free. The collector calls
210
+ `Instance.init()` on each source eagerly after all factories register.
211
+ `require` no longer gates code execution. It gates `on(type)` delivery (events
212
+ queue in `Instance.queueOn` until the source is started, then replay).
213
+ `collector.pending.sources` has been removed; per-source state lives on
214
+ `Source.Instance` (`queueOn`) and `Source.Config` (`init`, `require`).
215
+
216
+ Migration: any source factory with side effects (queue draining, walker
217
+ command emission, listener attachment) should move those into the returned
218
+ Instance's optional `init` method. Tests asserting on
219
+ `collector.pending.sources` should read `collector.sources[id]` and inspect
220
+ `config.init` / `config.require` instead.
221
+
222
+ Fixes the elbLayer queue replay clobbering fresh consent/user state,
223
+ late-activated sources missing `walker run`, and inter-source require chains
224
+ racing when a non-required source's init fired a state-mutating walker command
225
+ before later require-gated sources had been registered.
226
+
227
+ - Updated dependencies [381dfe7]
228
+ - Updated dependencies [1524275]
229
+ - Updated dependencies [03d7055]
230
+ - @walkeros/core@4.0.1
231
+
232
+ ## 4.0.0
233
+
234
+ ### Major Changes
235
+
236
+ - 93ea9c4: Event model v4: breaking changes to the `Event`, `Source`, and
237
+ `Entity` shapes.
238
+ - `event.id` is now a W3C span_id (16 lowercase hex chars), generated by the
239
+ collector. Reference: W3C Trace Context (W3C Recommendation, January 2020).
240
+ - `event.version`, `event.group`, `event.count` are removed.
241
+ - `source.type` is now the source kind (e.g. `browser`, `gtag`, `mcp`, `cli`).
242
+ New `source.platform` holds the runtime (`web` | `server` | `app` | ...).
243
+ - `source.id` and `source.previous_id` are removed.
244
+ - Browser source now sets `source.url` and `source.referrer`.
245
+ - MCP source sets `source.tool` per emission. CLI source sets
246
+ `source.command`.
247
+ - `Entity.nested` and `Entity.context` are now optional. Root `event.nested`
248
+ and `event.context` remain required.
249
+ - Each source self-registers via TypeScript module augmentation of `SourceMap`
250
+ in `@walkeros/core`.
251
+ - App-side coordination (`/workspaces/developer/app`) is a follow-up plan, not
252
+ part of this release. Telemetry from v4 CLI/MCP will not validate against
253
+ the existing app schema until that follow-up ships.
254
+ - `Mapping.Rule.skip` is renamed to `Mapping.Rule.silent`. Customer flow.json
255
+ configs using `skip: true` in mapping rules must rename to `silent: true`.
256
+ Hard cut: no legacy alias, the field is gone.
257
+
258
+ - 1ef33d9: **BREAKING:** Unified callback signatures across mapping and on.\*
259
+ subscriptions.
260
+
261
+ Every callback in walkerOS now reads `(data, context) => result`. Sources,
262
+ transformers, destinations, and stores already conformed; mapping and on.\*
263
+ join the family in v4.1.
264
+
265
+ ### Mapping callbacks
266
+
267
+ `fn`, `condition`, and `validate` now share a single shape:
268
+
269
+ `(value, context: Mapping.Context) => result`
270
+
271
+ `Mapping.Options` is removed. Replaced by `Mapping.Context`:
272
+
273
+ ```ts
274
+ interface Context {
275
+ event: WalkerOS.DeepPartialEvent;
276
+ mapping: Value | Rule;
277
+ collector: Collector.Instance; // required
278
+ logger: Logger.Instance; // required
279
+ consent?: WalkerOS.Consent; // resolved consent
280
+ }
281
+ ```
282
+
283
+ Rule-level `condition` is now `(event, context) => boolean`.
284
+ `Mapping.Options.props` is removed (no production callers).
285
+
286
+ #### Mapping upgrade
287
+
288
+ ```ts
289
+ // before
290
+ const fn: Mapping.Fn = (value, mapping, options) => /* … */;
291
+ const cond: Mapping.Condition = (value, mapping, collector) => /* … */;
292
+ const val: Mapping.Validate = (value) => /* … */;
293
+
294
+ // after
295
+ const fn: Mapping.Fn = (value, context) => /* … */;
296
+ const cond: Mapping.Condition = (value, context) => /* … */;
297
+ const val: Mapping.Validate = (value, context) => /* … */;
298
+ ```
299
+
300
+ In `$code:` strings (flow.json):
301
+
302
+ ```json
303
+ // before
304
+ "fn": "$code:(value, mapping, options) => …"
305
+ "condition": "$code:(value, mapping, collector) => …"
306
+
307
+ // after
308
+ "fn": "$code:(value, context) => …"
309
+ "condition": "$code:(value, context) => …"
310
+ ```
311
+
312
+ `context.mapping` replaces the second positional arg; `context.collector`,
313
+ `context.logger`, and `context.consent` are all available.
314
+
315
+ One-arg callbacks like `(value) => value.toUpperCase()` continue to work
316
+ unchanged.
317
+
318
+ ### On.\* subscription callbacks
319
+
320
+ `walker.on('consent', …)`, `walker.on('ready', …)`, etc. now receive
321
+ `(data, context: On.Context) => void | Promise<void>`. The legacy `Context`
322
+ interface, `*Config` aliases, and `Options` discriminated union are removed.
323
+
324
+ ```ts
325
+ interface Context {
326
+ collector: Collector.Instance; // required
327
+ logger: Logger.Instance; // required
328
+ }
329
+
330
+ type Fn<TData = unknown> = (
331
+ data: TData,
332
+ context: Context,
333
+ ) => void | Promise<void>;
334
+
335
+ type ConsentFn = Fn<WalkerOS.Consent>;
336
+ type SessionFn = Fn<Collector.SessionData | undefined>;
337
+ type UserFn = Fn<WalkerOS.User>;
338
+ type ReadyFn = Fn<void>;
339
+ type RunFn = Fn<void>;
340
+ type GenericFn = Fn<unknown>;
341
+ ```
342
+
343
+ The new `On.Subscription` alias is the registerable union for
344
+ `walker.on(action, X)`.
345
+
346
+ #### On.\* upgrade
347
+
348
+ ```ts
349
+ // before
350
+ walker.on('consent', { marketing: (collector, consent) => /* … */ });
351
+ walker.on('ready', (collector) => /* … */);
352
+ walker.on('session', (collector, session) => /* … */);
353
+
354
+ // after
355
+ walker.on('consent', { marketing: (consent, ctx) => /* … */ });
356
+ walker.on('ready', (_, ctx) => /* … */);
357
+ walker.on('session', (session, ctx) => /* … */);
358
+ ```
359
+
360
+ `ctx.collector` replaces the positional first arg; `ctx.logger` is also
361
+ available.
362
+
363
+ ### Why both at once
364
+
365
+ Both refactors follow the same `(data, context)` pattern. Shipping them in one
366
+ release means consumers do one search-and-replace pass instead of two, and the
367
+ codebase reaches full callback-signature consistency in v4.1.
368
+
369
+ ### Minor Changes
370
+
371
+ - 8e06b1f: **BREAKING:** Unified reference syntax: `$store:id` and
372
+ `$secret:NAME` now use the dot separator: `$store.id` and `$secret.NAME`.
373
+
374
+ The coherent rule across every walkerOS reference is:
375
+ - **`.`** key or path (resolver looks up or walks what follows)
376
+ - **`:`** literal value or raw-code payload (resolver uses what follows
377
+ verbatim)
378
+
379
+ `$var.`, `$def.`, `$env.NAME[:default]`, `$contract.`, and `$code:(…)` are
380
+ unchanged, they already fit the rule.
381
+
382
+ Every shipped example, published `walkerOS.json` metadata, doc page, and skill
383
+ has been updated. A new canonical reference-syntax guide lives at
384
+ `/docs/guides/reference-syntax`. Regex constants (`REF_VAR`, `REF_DEF`,
385
+ `REF_ENV`, `REF_CONTRACT`, `REF_STORE`, `REF_SECRET`, `REF_CODE_PREFIX`) are
386
+ exported from `@walkeros/core` import these instead of hand-rolling regexes.
387
+
388
+ ### Upgrade
389
+
390
+ Search-and-replace across your flow configs:
391
+
392
+ ```
393
+ $store:<id> → $store.<id>
394
+ $secret:<NAME> → $secret.<NAME>
395
+ ```
396
+
397
+ Everything else stays the same. Your `$var.*`, `$def.*`, `$env.*`,
398
+ `$contract.*`, and `$code:*` references need no changes.
399
+
400
+ ### Patch Changes
401
+
402
+ - Updated dependencies [93ea9c4]
403
+ - Updated dependencies [465775c]
404
+ - Updated dependencies [942a7fe]
405
+ - Updated dependencies [cfc7469]
406
+ - Updated dependencies [8e06b1f]
407
+ - Updated dependencies [3d50dd6]
408
+ - Updated dependencies [1ef33d9]
409
+ - @walkeros/core@4.0.0
410
+
411
+ ## 3.4.2
412
+
413
+ ### Patch Changes
414
+
415
+ - @walkeros/core@3.4.2
416
+
417
+ ## 3.4.1
418
+
419
+ ### Patch Changes
420
+
421
+ - 75aa26b: `useHooks` now isolates hook failures. A pre-hook that throws no
422
+ longer crashes the pipeline — the wrapped function is called directly and a
423
+ warning is logged. A post-hook that throws leaves the original result in
424
+ place. Added optional 4th `logger` parameter so warnings route through the
425
+ walkerOS Logger (falls back to `console.warn` when no logger is provided). All
426
+ collector call sites now pass `collector.logger`.
427
+ - Updated dependencies [12adf24]
428
+ - Updated dependencies [75aa26b]
429
+ - @walkeros/core@3.4.1
430
+
431
+ ## 3.4.0
432
+
433
+ ### Patch Changes
434
+
435
+ - Updated dependencies [74940cc]
436
+ - Updated dependencies [525f5d9]
437
+ - @walkeros/core@3.4.0
438
+
439
+ ## 3.3.1
440
+
441
+ ### Patch Changes
442
+
443
+ - b10144a: Collector auto-generated destination keys now use lowercase letters
444
+ only (a-z, length 5) instead of base-36 (0-9a-z, length 4). `getId` gains an
445
+ optional charset parameter; default behavior is unchanged so session IDs and
446
+ other existing callers stay bit-for-bit identical.
447
+ - 206185a: Fix infinite recursion when registering `on('consent', ...)`
448
+ handlers. The collector's `on()` helper previously re-broadcast to all source
449
+ `on` handlers, causing self-re-registering consent handlers to recurse
450
+ unbounded and crash the tab. `on()` now fires only the newly-registered
451
+ callback against current state.
452
+ - 50e5d09: Fix release pipeline to embed the correct `__VERSION__` in published
453
+ packages.
454
+ - 32ff626: Fix race in source cache MISS wrapper: `applyUpdate` promise was
455
+ fire-and-forget, so a source fallback (e.g. express GIF default) could win
456
+ `createRespond`'s first-call-wins race on the first request. `wrappedPush` now
457
+ awaits the pending update before returning.
458
+ - @walkeros/core@3.3.1
459
+
460
+ ## 3.3.0
461
+
462
+ ### Minor Changes
463
+
464
+ - 08c365a: Add `include` as a first-class field on `Destination.Config`
465
+ (destination-level) and `Mapping.Rule` (per-event override). The collector
466
+ resolves `include` in `processEventMapping` before calling `push()`,
467
+ flattening specified event sections into prefixed key-value pairs (e.g.
468
+ `data_price: 420`) and merging them as the bottom layer of `context.data`.
469
+
470
+ Rule-level `include` replaces config-level (not additive). Merge priority:
471
+ include (bottom) → config.data → rule.data (top, wins on conflict). The
472
+ `context` section correctly extracts `[0]` from OrderedProperties tuples.
473
+
474
+ New export: `flattenIncludeSections(event, sections)` from `@walkeros/core`.
475
+
476
+ - 08c365a: Add `skip?: boolean` to `Mapping.Rule` as a universal sibling of
477
+ `ignore`. Destinations can now honor a rule-level `skip` to process
478
+ `settings.*` side effects (identify, revenue, group, etc.) while omitting
479
+ their default forwarding call (`track()`, `capture()`, `event()`). Replaces
480
+ destination-specific `settings.skipTrack` / `settings.skipEvent` toggles.
481
+
482
+ `processEventMapping()` now returns an explicit `skip: boolean` field
483
+ alongside `ignore`. The collector does not short-circuit on `skip` — it still
484
+ calls `destination.push()` so the destination can run its side effects. The
485
+ destination implementation reads `context.rule?.skip` and gates its default
486
+ forwarding call on `!skip`.
487
+
488
+ `ignore: true` still wins when both flags are set on the same rule.
489
+
490
+ ### Patch Changes
491
+
492
+ - Updated dependencies [2849acb]
493
+ - Updated dependencies [08c365a]
494
+ - Updated dependencies [08c365a]
495
+ - Updated dependencies [08c365a]
496
+ - Updated dependencies [08c365a]
497
+ - @walkeros/core@3.3.0
498
+
499
+ ## 3.2.0
500
+
501
+ ### Minor Changes
502
+
503
+ - eb865e1: Add chainPath to ingest metadata and support path-specific mocks via
504
+ --mock destination.ga4.before.redact='...'
505
+ - c0a53f9: Flow graph architecture: symmetric before/next hooks, mutable Ingest,
506
+ per-destination isolation.
507
+ - Add symmetric `before`/`next` to all step types (sources, transformers,
508
+ destinations)
509
+ - Add `Ingest` interface with mutable `_meta` tracking (hops, path)
510
+ - Parameterize `Transformer.Fn<T, E>` and `Result<E>` on event type
511
+ - Support `Result[]` return from transformers for fan-out
512
+ - Remove `Object.freeze(ingest)` — ingest is fully mutable
513
+ - Upgrade `setIngest` to create typed `Ingest` with `_meta`
514
+ - Clone ingest per destination to prevent cross-contamination
515
+ - Add `createMockContext` test utility for context construction
516
+
517
+ - f007c9f: Wire initConfig.hooks into collector instance. Simulation uses
518
+ prePush/postDestinationPush hooks for event capture. Hooks are wired by
519
+ startFlow before events fire.
520
+ - bf2dc5b: Add conditional routing and native cache as built-in config
521
+ properties on sources, transformers, and destinations.
522
+
523
+ **Routing:** NextRule[] in next/before properties enables conditional step
524
+ chaining, replacing @walkeros/transformer-router.
525
+
526
+ **Cache:**
527
+ - Cache rules use the same match syntax as routing (MatchExpression)
528
+ - Source cache: full pipeline caching with respond interception
529
+ - Transformer cache: step-level memoization, chain continues
530
+ - Destination cache: event deduplication
531
+ - Update rules modify cached results on read via getMappingValue
532
+ - Default per-collector memory store with namespaced keys
533
+
534
+ compileMatcher upgraded to use getByPath for scoped dot-paths (ingest.method,
535
+ event.name). Removed @walkeros/server-transformer-cache (replaced by native
536
+ cache).
537
+
538
+ - da0b640: Add include/exclude destination filter to collector.push PushOptions.
539
+ Sources can now control which destinations receive their events. Destination
540
+ simulation uses the full collector pipeline with include filter, giving
541
+ production-identical event enrichment, consent, and mapping.
542
+ - a5d25bc: Transformer respond wrappers now propagate through the pipeline
543
+ - 884527d: Unify simulation for sources, destinations, and transformers through
544
+ the push command.
545
+ - All step types simulate via `push` with auto-env loading and call tracking
546
+ - Add `--simulate transformer.X` to invoke a transformer directly with an
547
+ event
548
+ - Before chains run as mandatory preparation; next chains are skipped
549
+ - Source simulation captures at the collector.push boundary, preserving the
550
+ full before chain
551
+ - Hooks (prePush/postDestinationPush) capture events instead of manual
552
+ overrides
553
+ - Timer interception flushes setTimeout/setInterval deterministically for
554
+ async patterns (debounced batches, detached Promise chains)
555
+ - MCP migrated to the push-based simulation pipeline
556
+ - Legacy simulate code removed
557
+
558
+ ### Patch Changes
559
+
560
+ - 8cdc0bb: Generalize queue flush: refresh user/globals/consent on queued events
561
+ and flush after any state mutation command
562
+ - 9a99298: Add useHooks wrapping to store get/set/delete operations
563
+ - Updated dependencies [eb865e1]
564
+ - Updated dependencies [c0a53f9]
565
+ - Updated dependencies [f007c9f]
566
+ - Updated dependencies [bf2dc5b]
567
+ - Updated dependencies [da0b640]
568
+ - @walkeros/core@3.2.0
569
+
570
+ ## 3.1.1
571
+
572
+ ### Patch Changes
573
+
574
+ - @walkeros/core@3.1.1
575
+
576
+ ## 3.1.0
577
+
578
+ ### Minor Changes
579
+
580
+ - df990d4: Unified source simulation input. All source simulation uses
581
+ SourceInput { content, trigger?, env? } — one format for CLI, MCP, and tests.
582
+ Removes legacy runSourceLegacy and deprecated SimulateSource fields. CLI gains
583
+ --step flag. MCP flow_simulate drops example parameter (use flow_examples to
584
+ discover, then provide event). flow_examples now returns trigger metadata.
585
+ StepExample Zod schema aligned with TypeScript type.
586
+
587
+ ### Patch Changes
588
+
589
+ - a9149e4: Add createTrigger to browser source examples following unified
590
+ Trigger.CreateFn interface. Step examples migrated to HTML content format with
591
+ trigger metadata. Collector simulate.ts updated with dual-path support for
592
+ createTrigger and legacy triggers.
593
+ - Updated dependencies [dfc6738]
594
+ - Updated dependencies [966342b]
595
+ - Updated dependencies [bee8ba7]
596
+ - Updated dependencies [966342b]
597
+ - Updated dependencies [df990d4]
598
+ - @walkeros/core@3.1.0
599
+
600
+ ## 3.0.2
601
+
602
+ ### Patch Changes
603
+
604
+ - @walkeros/core@3.0.2
605
+
606
+ ## 3.0.1
607
+
608
+ ### Patch Changes
609
+
610
+ - @walkeros/core@3.0.1
611
+
612
+ ## 3.0.0
613
+
614
+ ### Minor Changes
615
+
616
+ - b6c8fa8: Add stores as a first-class component type in Flow.Config. Stores get
617
+ their own `stores` section in flow settings, a `collector.stores` registry,
618
+ and `$store:storeId` env wiring in the bundler. Includes `storeMemoryInit` for
619
+ Flow.Config compatibility and type widening in cache/file transformers.
620
+
621
+ ### Patch Changes
622
+
623
+ - 499e27a: Fix double-queuing of denied events when all events lack consent
624
+ - 499e27a: Add sideEffects declarations to all packages for bundler tree-shaking
625
+ support.
626
+ - a2aa491: Fix store reference resolution: env values from `$store:` now
627
+ correctly resolve to initialized Store.Instance during transformer/destination
628
+ push. Preserve config.env across transformer init lifecycle.
629
+ - Updated dependencies [2b259b6]
630
+ - Updated dependencies [2614014]
631
+ - Updated dependencies [6ae0ee3]
632
+ - Updated dependencies [37299a9]
633
+ - Updated dependencies [499e27a]
634
+ - Updated dependencies [0e5eede]
635
+ - Updated dependencies [d11f574]
636
+ - Updated dependencies [d11f574]
637
+ - Updated dependencies [1fe337a]
638
+ - Updated dependencies [5cb84c1]
639
+ - Updated dependencies [23f218a]
640
+ - Updated dependencies [499e27a]
641
+ - Updated dependencies [c83d909]
642
+ - Updated dependencies [b6c8fa8]
643
+ - @walkeros/core@3.0.0
644
+
645
+ ## 2.1.1
646
+
647
+ ### Patch Changes
648
+
649
+ - fab477d: Replace union transformer return type with unified
650
+ `Transformer.Result` object. Transformers now return `{ event }` instead of
651
+ naked events, and can optionally include `respond` (for wrapping) or `next`
652
+ (for branching). The `BranchResult` type and `__branch` discriminant are
653
+ removed.
654
+ - Updated dependencies [fab477d]
655
+ - @walkeros/core@2.1.1
656
+
657
+ ## 2.1.0
658
+
659
+ ### Minor Changes
660
+
661
+ - 2bbe8c8: Add destroy lifecycle method to all step types (sources,
662
+ destinations, transformers) and shutdown command to collector
663
+ - 3eb6416: Add unified `env.respond` capability. Any step (transformer,
664
+ destination) can now customize HTTP responses via
665
+ `env.respond({ body, status?, headers? })`. Sources configure the response
666
+ handler — Express source uses createRespond for idempotent first-call-wins
667
+ semantics. CLI serve mode removed (superseded by response-capable flows).
668
+ - 026c412: Unified simulation API: single simulate() function replaces
669
+ simulateSource/simulateDestination/simulateTransformer/simulateFlow. Built-in
670
+ call tracking for destinations via wrapEnv. No bundling required for
671
+ simulation.
672
+
673
+ ### Patch Changes
674
+
675
+ - 02a7958: Add WARN log level (ERROR=0, WARN=1, INFO=2, DEBUG=3). Logger
676
+ instances expose `warn()` method routed to `console.warn` and `json()` method
677
+ for structured output. Config accepts optional `jsonHandler`. MockLogger
678
+ includes both as jest mocks. CLI logger unified with core logger via
679
+ `createCLILogger()` factory.
680
+ - Updated dependencies [7fc4cee]
681
+ - Updated dependencies [7fc4cee]
682
+ - Updated dependencies [cb2da05]
683
+ - Updated dependencies [2bbe8c8]
684
+ - Updated dependencies [3eb6416]
685
+ - Updated dependencies [02a7958]
686
+ - Updated dependencies [97df0b2]
687
+ - Updated dependencies [97df0b2]
688
+ - Updated dependencies [026c412]
689
+ - Updated dependencies [7d38d9d]
690
+ - @walkeros/core@2.1.0
691
+
692
+ ## 2.0.1
693
+
694
+ ## 2.0.0
695
+
696
+ ### Minor Changes
697
+
698
+ - 32bfc92: Add transformer chain branching support
699
+
700
+ ### Patch Changes
701
+
702
+ - Updated dependencies [7b2d750]
703
+ - @walkeros/core@1.4.0
704
+
705
+ ## 1.2.0
706
+
707
+ ### Minor Changes
708
+
709
+ - a4cc1ea: Add collector.status for per-source and per-destination delivery
710
+ tracking
711
+
712
+ ### Patch Changes
713
+
714
+ - 9599e60: Fix silent event loss when destination processes queued events with
715
+ mixed consent states
716
+ - Updated dependencies [a4cc1ea]
717
+ - @walkeros/core@1.3.0
718
+
719
+ ## 1.1.3
720
+
721
+ ### Patch Changes
722
+
723
+ - e9c9faa: Fix transformer chain next property not being preserved during
724
+ initialization
725
+
726
+ The `initTransformers` function was not calling `extractChainProperty` to
727
+ merge the definition-level `next` value into the transformer's config. This
728
+ caused `walkChain` to only resolve the first transformer in any chain,
729
+ breaking `destination.before` chains like
730
+ `filter -> fingerprint -> geo -> sessionEnricher`.
731
+
732
+ ## 1.1.2
733
+
734
+ ### Patch Changes
735
+
736
+ - 7ad6cfb: Fix transformer chains computed on-demand instead of pre-computed
737
+
738
+ Transformer chains configured via `destination.before` now work correctly.
739
+ Previously, chains were pre-computed at initialization but the resolution
740
+ function was never called, causing `before` configuration to be silently
741
+ ignored.
742
+
743
+ **What changed:**
744
+ - Chains now compute at push time from `destination.config.before`
745
+ - Removed unused `collector.transformerChain` state
746
+ - Removed dead `resolveTransformerGraph()` function
747
+ - Dynamic destinations now support `before` property
748
+
749
+ - Updated dependencies [7ad6cfb]
750
+ - @walkeros/core@1.2.2
751
+
752
+ ## 1.1.1
753
+
754
+ ### Patch Changes
755
+
756
+ - Updated dependencies [6256c12]
757
+ - @walkeros/core@1.2.1
758
+
759
+ ## 1.1.0
760
+
761
+ ### Minor Changes
762
+
763
+ - f39d9fb: Add array support for transformer chain configuration
764
+
765
+ Enables explicit control over transformer chain order by accepting arrays for
766
+ `next` and `before` properties, bypassing automatic chain resolution.
767
+
768
+ **Array chain behavior:**
769
+
770
+ | Syntax | Behavior |
771
+ | -------------------------------- | ------------------------------------------------------ |
772
+ | `"next": "validate"` | Walks chain via each transformer's `next` property |
773
+ | `"next": ["validate", "enrich"]` | Uses exact order specified, ignores transformer `next` |
774
+
775
+ **Example:**
776
+
777
+ ```json
778
+ {
779
+ "sources": {
780
+ "http": {
781
+ "package": "@walkeros/server-source-express",
782
+ "next": ["validate", "enrich", "redact"]
783
+ }
784
+ },
785
+ "destinations": {
786
+ "analytics": {
787
+ "package": "@walkeros/server-destination-gcp",
788
+ "before": ["format", "anonymize"]
789
+ }
790
+ }
791
+ }
792
+ ```
793
+
794
+ When walking a chain encounters an array `next`, it appends all items and
795
+ stops (does not recursively resolve those transformers' `next` properties).
796
+
797
+ - 888bbdf: Add inline code syntax for sources, transformers, and destinations
798
+
799
+ Enables defining custom logic directly in flow.json using `code` objects
800
+ instead of requiring external packages. This is ideal for simple one-liner
801
+ transformations.
802
+
803
+ **Example:**
804
+
805
+ ```json
806
+ {
807
+ "transformers": {
808
+ "enrich": {
809
+ "code": {
810
+ "push": "$code:(event) => ({ ...event, data: { ...event.data, enriched: true } })"
811
+ },
812
+ "config": {}
813
+ }
814
+ }
815
+ }
816
+ ```
817
+
818
+ **Code object properties:**
819
+ - `push` - The push function with `$code:` prefix (required)
820
+ - `type` - Optional instance type identifier
821
+ - `init` - Optional init function with `$code:` prefix
822
+
823
+ **Rules:**
824
+ - Use `package` OR `code`, never both (CLI validates this)
825
+ - `config` stays separate from `code`
826
+ - `$code:` prefix outputs raw JavaScript at bundle time
827
+
828
+ ### Patch Changes
829
+
830
+ - Updated dependencies [f39d9fb]
831
+ - Updated dependencies [888bbdf]
832
+ - @walkeros/core@1.2.0
833
+
834
+ ## 1.0.1
835
+
836
+ ### Patch Changes
837
+
838
+ - b65b773: Queue on() events until destination init completes
839
+
840
+ Destinations now receive `on('consent')` and other lifecycle events only after
841
+ `init()` has completed. Previously, `on()` was called before `init()`,
842
+ requiring workarounds like gtag's `initializeGtag()` call inside its `on()`
843
+ handler.
844
+
845
+ Also renamed queue properties for clarity:
846
+ - `destination.queue` → `destination.queuePush`
847
+ - `destination.onQueue` → `destination.queueOn`
848
+
849
+ - Updated dependencies [b65b773]
850
+ - Updated dependencies [20eca6e]
851
+ - @walkeros/core@1.1.0
852
+
853
+ ## 1.0.0
854
+
855
+ ### Major Changes
856
+
857
+ - 67c9e1d: Hello World! walkerOS v1.0.0
858
+
859
+ Open-source event data collection. Collect event data for digital analytics in
860
+ a unified and privacy-centric way.
861
+
862
+ ### Patch Changes
863
+
864
+ - Updated dependencies [67c9e1d]
865
+ - @walkeros/core@1.0.0