@revturbine/sdk 0.11.12 → 0.11.13

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
@@ -47,6 +47,55 @@ also require a changelog entry.
47
47
 
48
48
  ---
49
49
 
50
+ ## 0.11.13
51
+
52
+ ### Slot lifecycle events carry the slot's `route` (BL-0207, ruling D-30)
53
+
54
+ **What changed.** Every slot lifecycle event (`slot_evaluated`, `slot_filled`,
55
+ `slot_empty`, `slot_suppressed`, `slot_error`) now carries `route`: the app
56
+ route the slot rendered on. Ingestion-driven surface-slot discovery reads it
57
+ and persists it on the discovered slot. There is no SDK write to any CRUD
58
+ route. The field is additive and optional in the scaffold contract
59
+ (`slotContextBase.route`).
60
+
61
+ A route is a **path, never a URL**. It has no origin, query string or
62
+ fragment. The React layer computes it at emission time:
63
+
64
+ - **Default:** `window.location.pathname`, with identifier-like segments
65
+ templated to `:id`. That covers numbers, UUIDs, long hex, prefixed ids like
66
+ `cus_…`, long opaque tokens and email-shaped values, raw or
67
+ percent-encoded. For example, `/accounts/4821/billing?coupon=X` reports
68
+ `/accounts/:id/billing`.
69
+ - **`<RevTurbineRoute route={…}>`** (new, renderless) declares the framework
70
+ route pattern for its subtree, and the innermost boundary wins.
71
+ - **Next.js App Router:** build the pattern with the new pure helper
72
+ `routePatternFromParams(usePathname(), useParams())`, which gives
73
+ `/projects/[projectId]/settings`. The SDK does not import `next/navigation`.
74
+
75
+ Also new:
76
+
77
+ - **Headless exports:** `normalizeSlotRoute`, `routePatternFromParams`,
78
+ `currentBrowserRoute`, `isIdentifierLikeSegment` and `SLOT_ROUTE_MAX_LENGTH`
79
+ (512).
80
+ - **React hook:** `useSlotRoute()`.
81
+ - **Headless controller option:** `PlacementControllerOptions.route` accepts a
82
+ string or a getter. When it is omitted, a headless controller emits
83
+ `route: null`.
84
+
85
+ **Landed in:** 0.11.13 (`web-sdk` only; `server-python`/`server-rust` bumped
86
+ in lockstep with no behavior change — no port emits slot events). The
87
+ `@revt-eng/*` pins move to `0.1.366` (the scaffold contract: `slotContextBase.route`,
88
+ `SurfaceSlotSchema.route`, and the `SurfaceSlotStatus` = `live | idle`
89
+ vocabulary), and the vendored port types are re-synced — `SurfaceSlot.status`
90
+ is now `SurfaceSlotStatus` (`live`/`idle`, default `idle`) in both ports.
91
+ **Fail-closed in:** n/a (additive telemetry field).
92
+ **Proving test:**
93
+ - `web-sdk/slot-route.test.ts`: normalization, PII/query stripping, the
94
+ Next.js params recipe, and controller emission including the
95
+ throwing-getter case.
96
+ - `web-sdk/react/usePlacement.route.test.tsx`: the plain-DOM pathname case and
97
+ the `<RevTurbineRoute>` Next.js pattern case.
98
+
50
99
  ## 0.11.12
51
100
 
52
101
  ### `builtin_dimensions` now reaches the browser SDK from the client-context fetch (BL-0312, plan 279 TASK-5)
@@ -226,11 +226,11 @@ declare const UserPlanContextSchema: z.ZodObject<{
226
226
  */
227
227
  declare const UserBuiltinDimensionsSchema: z.ZodObject<{
228
228
  activity_level: z.ZodOptional<z.ZodEnum<{
229
- inactive: "inactive";
230
229
  new: "new";
231
230
  high: "high";
232
231
  medium: "medium";
233
232
  low: "low";
233
+ inactive: "inactive";
234
234
  }>>;
235
235
  subscription_state: z.ZodOptional<z.ZodEnum<{
236
236
  trial: "trial";