@walkeros/core 4.3.2 → 4.4.0-next-1785239495233

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # @walkeros/core
2
2
 
3
+ ## 4.4.0-next-1785239495233
4
+
5
+ ### Minor Changes
6
+
7
+ - 393b942: Journeys now assemble per event: one journey per event, identified by
8
+ that event's id, with the run trace carried as a handle so every event of one
9
+ page load or container run still groups together. A `$flow` crossing that
10
+ decodes into several events yields one journey per event, linked by
11
+ `parentEventId`, instead of folding them into a single row. A new optional
12
+ `unattributed` summary reports records the assembly could not attribute to any
13
+ event instead of dropping them silently.
14
+
15
+ ### Patch Changes
16
+
17
+ - 6c89afb: Fixed journey assembly dropping records when several runtime
18
+ instances (page reloads, container restarts) reported overlapping sequence
19
+ numbers. Every instance's records now survive into journeys and gap detection
20
+ stays truthful. Each journey hop also carries the `release` of the runtime
21
+ that produced it.
22
+
3
23
  ## 4.3.2
4
24
 
5
25
  ## 4.3.1
package/dist/index.d.mts CHANGED
@@ -3285,10 +3285,13 @@ interface SendResponse {
3285
3285
  }
3286
3286
 
3287
3287
  /**
3288
- * Journey types describe the assembled, cross-runtime life of one traced event
3289
- * as reconstructed from raw `FlowState` records by `assembleJourneys`. The
3290
- * assembler is pure and presentation-free: no session scoping, no display copy,
3291
- * no formatting. Presenters map a `Journey` into their own view shapes.
3288
+ * Journey types describe the assembled, cross-runtime life of ONE EVENT as
3289
+ * reconstructed from raw `FlowState` records by `assembleJourneys`. The unit is
3290
+ * the event (`FlowState.eventId`, a W3C span id), not the run: a `traceId` is
3291
+ * run-scoped and covers every event of a page load or container run, so it is
3292
+ * carried as the run handle for optional grouping rather than as the identity.
3293
+ * The assembler is pure and presentation-free: no session scoping, no display
3294
+ * copy, no formatting. Presenters map a `Journey` into their own view shapes.
3292
3295
  *
3293
3296
  * Optional fields are populated only when the underlying records carry the
3294
3297
  * corresponding data (e.g. trace-level payloads, consent snapshots, vendor
@@ -3297,11 +3300,16 @@ interface SendResponse {
3297
3300
  /** Runtime that produced a hop: the non-empty subset of `FlowState.platform`. */
3298
3301
  type JourneyPlatform = 'web' | 'server';
3299
3302
  /**
3300
- * How a journey's records were correlated into one journey. `trace` groups by
3301
- * the shared `traceId`; `legacy` is the fallback for records that predate trace
3302
- * propagation and are grouped by their `eventId` alone.
3303
+ * How a journey's records were correlated into one journey. `event` is the only
3304
+ * value the assembler produces: records group by their `eventId`, with $flow
3305
+ * crossing continuations joined through `parentEventId`.
3306
+ *
3307
+ * @remarks `trace` (grouped by the run-scoped `traceId`) and `legacy` (grouped
3308
+ * by `eventId` when no trace was propagated) are retained so envelopes
3309
+ * serialized by older assemblers still type. Neither is produced any more; both
3310
+ * are removal candidates in the next major.
3303
3311
  */
3304
- type JourneyCorrelation = 'trace' | 'legacy';
3312
+ type JourneyCorrelation = 'event' | 'trace' | 'legacy';
3305
3313
  /**
3306
3314
  * Collapsed outcome of a single hop, derived from its terminal phase. `pending`
3307
3315
  * covers a hop still in `in`/`init`/`flush` (no terminal phase observed yet);
@@ -3359,7 +3367,13 @@ interface AssembleJourneysOptions {
3359
3367
  /** Wall-clock reference (epoch ms) for settle evaluation. Defaults to now. */
3360
3368
  now?: number;
3361
3369
  }
3362
- /** The originating event of a journey, taken from its entry collector hop. */
3370
+ /**
3371
+ * The originating event of a journey, taken from its entry collector hop.
3372
+ * `eventId` always equals the journey's `id`, by construction: the entry is
3373
+ * chosen from the originating arm's records alone, so a crossing's far arm can
3374
+ * never supply it, and `name` therefore always describes the event the journey
3375
+ * is named after rather than the far arm's rendering of it.
3376
+ */
3363
3377
  interface JourneyEntry {
3364
3378
  /** Originating event's id (W3C span-id). */
3365
3379
  eventId: string;
@@ -3457,6 +3471,8 @@ interface JourneyHop {
3457
3471
  * non-terminal and is not a confirmation.
3458
3472
  */
3459
3473
  flushConfirmed?: boolean;
3474
+ /** Release provenance of the runtime that produced this hop's records, when stamped. */
3475
+ release?: string;
3460
3476
  /** Free-form metadata carried by the hop's records. */
3461
3477
  meta?: Record<string, unknown>;
3462
3478
  }
@@ -3480,13 +3496,42 @@ interface JourneyGap {
3480
3496
  /** First `seq` observed after the gap. */
3481
3497
  beforeSeq: number;
3482
3498
  }
3499
+ /**
3500
+ * Records that carried a `traceId` (so they belonged to a real event run) but
3501
+ * could not be attributed to any event, grouped per platform. Emitted by
3502
+ * runtimes that predate the early span-id mint, whose `collector.push` records
3503
+ * carry no event id. Records that carry no `traceId` (destination `init`, store
3504
+ * lifecycle) belong to no event by design and are never counted here, so a
3505
+ * nonzero value always means information was lost.
3506
+ */
3507
+ interface JourneyUnattributed {
3508
+ /** Poster runtime the records came from, when stamped. */
3509
+ platform?: JourneyPlatform;
3510
+ /** How many records were dropped from grouping. */
3511
+ count: number;
3512
+ /** Wall-clock lower bound of the dropped records (epoch ms). */
3513
+ fromMs: number;
3514
+ /** Wall-clock upper bound of the dropped records (epoch ms). */
3515
+ toMs: number;
3516
+ /** Distinct stepIds the dropped records came from, sorted. */
3517
+ stepIds: string[];
3518
+ }
3483
3519
  /** One reconstructed event lifetime across the pipeline. */
3484
3520
  interface Journey {
3485
- /** `traceId` when trace-correlated, else `event:<eventId>`. */
3521
+ /**
3522
+ * The originating event's id (bare W3C span-id). For a $flow crossing, the
3523
+ * id of the arm the crossing started from.
3524
+ */
3486
3525
  id: string;
3487
- /** How the journey's records were correlated. */
3526
+ /** How the journey's records were correlated. Always `event`. */
3488
3527
  correlation: JourneyCorrelation;
3489
- /** Shared trace id, when trace-correlated. */
3528
+ /**
3529
+ * Run handle of the originating arm: the run-scoped trace every event of one
3530
+ * page load or container run shares. Presenters group rows by it; it is not
3531
+ * the journey's identity. When the originating arm's records carry no trace
3532
+ * (an emitter predating trace propagation), the first trace among the
3533
+ * journey's remaining records stands in rather than dropping the handle.
3534
+ */
3490
3535
  traceId?: string;
3491
3536
  /** Originating event of the journey. */
3492
3537
  entry: JourneyEntry;
@@ -3516,6 +3561,12 @@ interface JourneyAssembly {
3516
3561
  journeys: Journey[];
3517
3562
  /** Session-level per-platform loss windows. */
3518
3563
  gaps: JourneyGap[];
3564
+ /**
3565
+ * Records that belonged to an event run but could not be attributed to any
3566
+ * event, per platform. Absent when there are none. Computed over every input
3567
+ * record, so callers that cap `journeys` still report the full figure.
3568
+ */
3569
+ unattributed?: JourneyUnattributed[];
3519
3570
  }
3520
3571
 
3521
3572
  /**
@@ -4607,8 +4658,13 @@ declare const OBSERVE_STORAGE_KEY = "elbObserve";
4607
4658
  declare function browserSwapActivator(cfg: SwapActivatorConfig): Promise<boolean>;
4608
4659
 
4609
4660
  /**
4610
- * Pure assembly of raw `FlowState` records into cross-runtime journeys. The
4611
- * function is idempotent (duplicate records are deduped first) and
4661
+ * Pure assembly of raw `FlowState` records into cross-runtime journeys, one per
4662
+ * EVENT. Records group by their `eventId`; a `traceId` is run-scoped and covers
4663
+ * every event of a page load or container run, so it is carried as the run
4664
+ * handle rather than used to group. Records naming no event are excluded from
4665
+ * grouping and reported in `unattributed` when they carried a run trace.
4666
+ *
4667
+ * The function is idempotent (duplicate records are deduped first) and
4612
4668
  * deterministic (output does not depend on input order; `options.now` supplies
4613
4669
  * the settle reference so tests never depend on the wall clock). It resolves
4614
4670
  * completeness (`pending`/`complete`/`partial`) against the settle window and,
@@ -5171,4 +5227,4 @@ declare const REF_CODE_PREFIX = "$code:";
5171
5227
  */
5172
5228
  declare function scanFlowRefs(value: unknown, into?: Set<string>): Set<string>;
5173
5229
 
5174
- export { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };
5230
+ export { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JourneyUnattributed, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };
package/dist/index.d.ts CHANGED
@@ -3285,10 +3285,13 @@ interface SendResponse {
3285
3285
  }
3286
3286
 
3287
3287
  /**
3288
- * Journey types describe the assembled, cross-runtime life of one traced event
3289
- * as reconstructed from raw `FlowState` records by `assembleJourneys`. The
3290
- * assembler is pure and presentation-free: no session scoping, no display copy,
3291
- * no formatting. Presenters map a `Journey` into their own view shapes.
3288
+ * Journey types describe the assembled, cross-runtime life of ONE EVENT as
3289
+ * reconstructed from raw `FlowState` records by `assembleJourneys`. The unit is
3290
+ * the event (`FlowState.eventId`, a W3C span id), not the run: a `traceId` is
3291
+ * run-scoped and covers every event of a page load or container run, so it is
3292
+ * carried as the run handle for optional grouping rather than as the identity.
3293
+ * The assembler is pure and presentation-free: no session scoping, no display
3294
+ * copy, no formatting. Presenters map a `Journey` into their own view shapes.
3292
3295
  *
3293
3296
  * Optional fields are populated only when the underlying records carry the
3294
3297
  * corresponding data (e.g. trace-level payloads, consent snapshots, vendor
@@ -3297,11 +3300,16 @@ interface SendResponse {
3297
3300
  /** Runtime that produced a hop: the non-empty subset of `FlowState.platform`. */
3298
3301
  type JourneyPlatform = 'web' | 'server';
3299
3302
  /**
3300
- * How a journey's records were correlated into one journey. `trace` groups by
3301
- * the shared `traceId`; `legacy` is the fallback for records that predate trace
3302
- * propagation and are grouped by their `eventId` alone.
3303
+ * How a journey's records were correlated into one journey. `event` is the only
3304
+ * value the assembler produces: records group by their `eventId`, with $flow
3305
+ * crossing continuations joined through `parentEventId`.
3306
+ *
3307
+ * @remarks `trace` (grouped by the run-scoped `traceId`) and `legacy` (grouped
3308
+ * by `eventId` when no trace was propagated) are retained so envelopes
3309
+ * serialized by older assemblers still type. Neither is produced any more; both
3310
+ * are removal candidates in the next major.
3303
3311
  */
3304
- type JourneyCorrelation = 'trace' | 'legacy';
3312
+ type JourneyCorrelation = 'event' | 'trace' | 'legacy';
3305
3313
  /**
3306
3314
  * Collapsed outcome of a single hop, derived from its terminal phase. `pending`
3307
3315
  * covers a hop still in `in`/`init`/`flush` (no terminal phase observed yet);
@@ -3359,7 +3367,13 @@ interface AssembleJourneysOptions {
3359
3367
  /** Wall-clock reference (epoch ms) for settle evaluation. Defaults to now. */
3360
3368
  now?: number;
3361
3369
  }
3362
- /** The originating event of a journey, taken from its entry collector hop. */
3370
+ /**
3371
+ * The originating event of a journey, taken from its entry collector hop.
3372
+ * `eventId` always equals the journey's `id`, by construction: the entry is
3373
+ * chosen from the originating arm's records alone, so a crossing's far arm can
3374
+ * never supply it, and `name` therefore always describes the event the journey
3375
+ * is named after rather than the far arm's rendering of it.
3376
+ */
3363
3377
  interface JourneyEntry {
3364
3378
  /** Originating event's id (W3C span-id). */
3365
3379
  eventId: string;
@@ -3457,6 +3471,8 @@ interface JourneyHop {
3457
3471
  * non-terminal and is not a confirmation.
3458
3472
  */
3459
3473
  flushConfirmed?: boolean;
3474
+ /** Release provenance of the runtime that produced this hop's records, when stamped. */
3475
+ release?: string;
3460
3476
  /** Free-form metadata carried by the hop's records. */
3461
3477
  meta?: Record<string, unknown>;
3462
3478
  }
@@ -3480,13 +3496,42 @@ interface JourneyGap {
3480
3496
  /** First `seq` observed after the gap. */
3481
3497
  beforeSeq: number;
3482
3498
  }
3499
+ /**
3500
+ * Records that carried a `traceId` (so they belonged to a real event run) but
3501
+ * could not be attributed to any event, grouped per platform. Emitted by
3502
+ * runtimes that predate the early span-id mint, whose `collector.push` records
3503
+ * carry no event id. Records that carry no `traceId` (destination `init`, store
3504
+ * lifecycle) belong to no event by design and are never counted here, so a
3505
+ * nonzero value always means information was lost.
3506
+ */
3507
+ interface JourneyUnattributed {
3508
+ /** Poster runtime the records came from, when stamped. */
3509
+ platform?: JourneyPlatform;
3510
+ /** How many records were dropped from grouping. */
3511
+ count: number;
3512
+ /** Wall-clock lower bound of the dropped records (epoch ms). */
3513
+ fromMs: number;
3514
+ /** Wall-clock upper bound of the dropped records (epoch ms). */
3515
+ toMs: number;
3516
+ /** Distinct stepIds the dropped records came from, sorted. */
3517
+ stepIds: string[];
3518
+ }
3483
3519
  /** One reconstructed event lifetime across the pipeline. */
3484
3520
  interface Journey {
3485
- /** `traceId` when trace-correlated, else `event:<eventId>`. */
3521
+ /**
3522
+ * The originating event's id (bare W3C span-id). For a $flow crossing, the
3523
+ * id of the arm the crossing started from.
3524
+ */
3486
3525
  id: string;
3487
- /** How the journey's records were correlated. */
3526
+ /** How the journey's records were correlated. Always `event`. */
3488
3527
  correlation: JourneyCorrelation;
3489
- /** Shared trace id, when trace-correlated. */
3528
+ /**
3529
+ * Run handle of the originating arm: the run-scoped trace every event of one
3530
+ * page load or container run shares. Presenters group rows by it; it is not
3531
+ * the journey's identity. When the originating arm's records carry no trace
3532
+ * (an emitter predating trace propagation), the first trace among the
3533
+ * journey's remaining records stands in rather than dropping the handle.
3534
+ */
3490
3535
  traceId?: string;
3491
3536
  /** Originating event of the journey. */
3492
3537
  entry: JourneyEntry;
@@ -3516,6 +3561,12 @@ interface JourneyAssembly {
3516
3561
  journeys: Journey[];
3517
3562
  /** Session-level per-platform loss windows. */
3518
3563
  gaps: JourneyGap[];
3564
+ /**
3565
+ * Records that belonged to an event run but could not be attributed to any
3566
+ * event, per platform. Absent when there are none. Computed over every input
3567
+ * record, so callers that cap `journeys` still report the full figure.
3568
+ */
3569
+ unattributed?: JourneyUnattributed[];
3519
3570
  }
3520
3571
 
3521
3572
  /**
@@ -4607,8 +4658,13 @@ declare const OBSERVE_STORAGE_KEY = "elbObserve";
4607
4658
  declare function browserSwapActivator(cfg: SwapActivatorConfig): Promise<boolean>;
4608
4659
 
4609
4660
  /**
4610
- * Pure assembly of raw `FlowState` records into cross-runtime journeys. The
4611
- * function is idempotent (duplicate records are deduped first) and
4661
+ * Pure assembly of raw `FlowState` records into cross-runtime journeys, one per
4662
+ * EVENT. Records group by their `eventId`; a `traceId` is run-scoped and covers
4663
+ * every event of a page load or container run, so it is carried as the run
4664
+ * handle rather than used to group. Records naming no event are excluded from
4665
+ * grouping and reported in `unattributed` when they carried a run trace.
4666
+ *
4667
+ * The function is idempotent (duplicate records are deduped first) and
4612
4668
  * deterministic (output does not depend on input order; `options.now` supplies
4613
4669
  * the settle reference so tests never depend on the wall clock). It resolves
4614
4670
  * completeness (`pending`/`complete`/`partial`) against the settle window and,
@@ -5171,4 +5227,4 @@ declare const REF_CODE_PREFIX = "$code:";
5171
5227
  */
5172
5228
  declare function scanFlowRefs(value: unknown, into?: Set<string>): Set<string>;
5173
5229
 
5174
- export { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };
5230
+ export { type ActivationGrant, type AssembleJourneysOptions, type BatchedPosterOptions, type BreakerState, CLOCK_SKEW_MS, cache as Cache, type CacheEnvelope, type CacheResult, type ClickIdEntry, collector as Collector, type CompiledCache, Const, context as Context, type Credential, type Debounced, destination as Destination, type DestroyContext, type DestroyFn, type DroppedCounters, ENV_MARKER_PREFIX, elb as Elb, type EmitFn, type ExampleSummary, FatalError, Flow, type FlowConfigResolver, type FlowState, type FlowStateBatch, type FlowStatePhase, type FlowStepType, type GetStore, hint as Hint, hooks as Hooks, type Ingest, type IngestEnvelope, type IngestMeta, type Journey, type JourneyAssembly, type JourneyBranch, type JourneyCorrelation, type JourneyEntry, type JourneyGap, type JourneyHop, type JourneyHopStatus, type JourneyPlatform, type JourneyStatus, type JourneyTopology, type JourneyTopologyNode, type JourneyUnattributed, type JsonSchema, Level, lifecycle as Lifecycle, type LifecycleContext, logger as Logger, MAX_SESSION_MS, mapping as Mapping, type MarketingParameters, matcher as Matcher, type MockLogger, OBSERVE_ENV_KEY, OBSERVE_STORAGE_KEY, type Observe, type ObserveCredential, type ObserveServer, type ObserveWeb, type ObserverFn, on as On, type ParsedGrant, type ParsedTraceparent, type PosterFetch, type PosterResponse, type PreviewCrypto, type PreviewFailure, type PreviewKey, type PreviewSubtle, REF_CODE_PREFIX, REF_CONTRACT, REF_ENV, REF_FLOW, REF_SECRET, REF_STORE, REF_VAR_FULL, REF_VAR_INLINE, request as Request, type ResolveContractsOptions, type ResolveOptions, type RespondFn, type RespondOptions, SECRET_MARKER_PREFIX, SESSION_STORAGE_KEY, STEP_OPERATIVE_FIELDS, type ScheduleOptions, type SendDataValue, type SendHeaders, type SendResponse, type ServiceAccount, type SetupFn, simulation as Simulation, source as Source, type State, type StepEntryErrorCode, type StepEntryValidation, type StepKind, type StorageType, store as Store, StoreCodecError, type SwapActivatorConfig, type TelemetryLevel, type TelemetryOptions, type TelemetryOptionsSupplier, transformer as Transformer, trigger as Trigger, URL_WINDOW_MS, type ValidateEvents, type VerifyParams, type VerifyResult, walkeros as WalkerOS, type WalkerOSPackage, type WalkerOSPackageInfo, type WalkerOSPackageMeta, anonymizeIP, applyState, applyUpdate, assembleJourneys, assign, branch, browserSwapActivator, buildCacheContext, castToProperty, castValue, checkCache, clone, compileCache, compileMatcher, compileState, createBatchedPoster, createDestination, createEvent, createIngest, createLogger, createMockContext, createMockLogger, createRespond, createTelemetryObserver, debounce, deepMerge, defaultClickIds, deleteByPath, deserializeStoreValue, emitStep, fetchPackage, fetchPackageSchema, filterValues, flattenIncludeSections, formatOut, getBrowser, getBrowserVersion, getByPath, getDeviceType, getEvent, getFlowSettings, getGrantedConsent, getHeaders, getId, getMappingEvent, getMappingValue, getMarketingParameters, getNextSteps, getOS, getOSVersion, getPlatform, getSpanId, getTraceId, getTraceUntil, isArguments, isArray, isBoolean, isCommand, isDefined, isElementOrDocument, isEnvObserve, isFunction, isNumber, isObject, isPathStepEntry, isPropertyType, isRouteArray, isRouteConfigEntry, isSameType, isSampled, isStoreValue, isString, mcpError, mcpResult, mergeContractSchemas, mergeMappingRule, mockEnv, observeFromEnv, packageNameToVariable, parseCallPath, parseGrant, parseObserveCredential, parseTraceparent, parseUserAgent, processEventMapping, readCacheEnvelope, requestToData, requestToParameter, resolveContracts, resolveSetup, resolveTelemetryOptions, scanFlowRefs, serializeStoreValue, setByPath, setTraceUntil, stepId, storeCache, throttle, throwError, transformData, traverseEnv, trim, tryCatch, tryCatchAsync, useHooks, validateStepEntry, verifyActivation, walkPath, wrapCacheEnvelope, wrapCondition, wrapFn, wrapValidate };