@40rty/ams-sdk 0.5.18 → 0.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -25,6 +25,7 @@ __export(src_exports3, {
25
25
  ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
26
26
  ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
27
27
  ATTACHMENT_ACCEPT: () => ATTACHMENT_ACCEPT,
28
+ ATTENTION_NAMESPACE: () => ATTENTION_NAMESPACE,
28
29
  AgentDirectiveSchema: () => AgentDirectiveSchema,
29
30
  AgentOutputSchema: () => AgentOutputSchema,
30
31
  AgentSessionSummarySchema: () => AgentSessionSummarySchema,
@@ -35,6 +36,7 @@ __export(src_exports3, {
35
36
  AttachmentRefSchema: () => AttachmentRefSchema,
36
37
  AttachmentRefsSchema: () => AttachmentRefsSchema,
37
38
  AttachmentUploadError: () => AttachmentUploadError,
39
+ AttentionSchema: () => AttentionSchema,
38
40
  AttributeDefSchema: () => AttributeDefSchema,
39
41
  AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
40
42
  AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
@@ -87,6 +89,7 @@ __export(src_exports3, {
87
89
  CanvasOutletProvider: () => CanvasOutletProvider,
88
90
  CanvasTailMount: () => CanvasTailMount,
89
91
  CanvasTailProvider: () => CanvasTailProvider,
92
+ CanvasTurnTailProvider: () => CanvasTurnTailProvider,
90
93
  CartAddSignalPayloadSchema: () => CartAddSignalPayloadSchema,
91
94
  CartDiscountCodeSchema: () => CartDiscountCodeSchema,
92
95
  CartLineSchema: () => CartLineSchema,
@@ -128,6 +131,7 @@ __export(src_exports3, {
128
131
  EXTEND_FLOW: () => EXTEND_FLOW,
129
132
  EXTRAS_PREFIX: () => EXTRAS_PREFIX,
130
133
  ElementIdContext: () => ElementIdContext,
134
+ ElementLayoutContext: () => ElementLayoutContext,
131
135
  EntryContextNamespaceSchema: () => EntryContextNamespaceSchema,
132
136
  EntryContextSchema: () => EntryContextSchema,
133
137
  EntryContextValueSchema: () => EntryContextValueSchema,
@@ -177,6 +181,7 @@ __export(src_exports3, {
177
181
  NullComponent: () => NullComponent,
178
182
  OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
179
183
  PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
184
+ POINTING_NAMESPACE: () => POINTING_NAMESPACE,
180
185
  PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
181
186
  PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
182
187
  PRESENCE_FLOW: () => PRESENCE_FLOW,
@@ -192,6 +197,7 @@ __export(src_exports3, {
192
197
  PackageReleaseSchema: () => PackageReleaseSchema,
193
198
  PageSchema: () => PageSchema,
194
199
  PatchSchema: () => PatchSchema,
200
+ PointedAtSchema: () => PointedAtSchema,
195
201
  PresenceRuntimeProvider: () => PresenceRuntimeProvider,
196
202
  ProductReviewDataSchema: () => ProductReviewDataSchema,
197
203
  ProductReviewHighlightSchema: () => ProductReviewHighlightSchema,
@@ -274,6 +280,7 @@ __export(src_exports3, {
274
280
  THREAD_ROW_ATTR: () => THREAD_ROW_ATTR,
275
281
  TRAFFIC_BUCKETS: () => TRAFFIC_BUCKETS,
276
282
  TURN_ASK_SIGNAL: () => TURN_ASK_SIGNAL,
283
+ TURN_TAIL_ATTR: () => TURN_TAIL_ATTR,
277
284
  ThreadHeadroom: () => ThreadHeadroom,
278
285
  ToolCallHintSchema: () => ToolCallHintSchema,
279
286
  TraceRecordSchema: () => TraceRecordSchema,
@@ -348,6 +355,8 @@ __export(src_exports3, {
348
355
  clearCartActionFailures: () => clearCartActionFailures,
349
356
  clearCodeDiscountSources: () => clearCodeDiscountSources,
350
357
  clearProductNameLookups: () => clearProductNameLookups,
358
+ clearShopCheckouts: () => clearShopCheckouts,
359
+ clearStoreArticleLookups: () => clearStoreArticleLookups,
351
360
  clearStoreThemeSources: () => clearStoreThemeSources,
352
361
  clearVariantChoice: () => clearVariantChoice,
353
362
  clientStateEntries: () => clientStateEntries,
@@ -508,6 +517,8 @@ __export(src_exports3, {
508
517
  registerProductNameLookup: () => registerProductNameLookup,
509
518
  registerServiceHydrators: () => registerServiceHydrators,
510
519
  registerSessionScopedClear: () => registerSessionScopedClear,
520
+ registerShopCheckout: () => registerShopCheckout,
521
+ registerStoreArticleLookup: () => registerStoreArticleLookup,
511
522
  registerStoreThemeSource: () => registerStoreThemeSource,
512
523
  registeredPageKinds: () => registeredPageKinds,
513
524
  registeredPresenceFactForms: () => registeredPresenceFactForms,
@@ -529,8 +540,10 @@ __export(src_exports3, {
529
540
  resolveProductVariant: () => resolveProductVariant,
530
541
  resolveScope: () => resolveScope,
531
542
  resolveServiceHydrators: () => resolveServiceHydrators,
543
+ resolveShopCheckout: () => resolveShopCheckout,
532
544
  resolveStanding: () => resolveStanding,
533
545
  resolveStorage: () => resolveStorage,
546
+ resolveStoreArticleLookup: () => resolveStoreArticleLookup,
534
547
  resolveStoreThemeSource: () => resolveStoreThemeSource,
535
548
  resolveSwatchColor: () => resolveSwatchColor,
536
549
  resolveType: () => resolveType,
@@ -582,6 +595,7 @@ __export(src_exports3, {
582
595
  turnAskSegments: () => turnAskSegments,
583
596
  turnEditedBlock: () => turnEditedBlock,
584
597
  turnOwnsView: () => turnOwnsView,
598
+ turnTailSlots: () => turnTailSlots,
585
599
  useAction: () => useAction,
586
600
  useAddToCart: () => useAddToCart,
587
601
  useAgentDriven: () => useAgentDriven,
@@ -591,6 +605,7 @@ __export(src_exports3, {
591
605
  useAgentPresenceFrame: () => useAgentPresenceFrame,
592
606
  useAgentPresenceFresh: () => useAgentPresenceFresh,
593
607
  useAnalyticsSink: () => useAnalyticsSink,
608
+ useAskAbout: () => useAskAbout,
594
609
  useAskStore: () => useAskStore,
595
610
  useBotCheckNotice: () => useBotCheckNotice,
596
611
  useCanvasActions: () => useCanvasActions,
@@ -601,6 +616,7 @@ __export(src_exports3, {
601
616
  useCanvasLeadTarget: () => useCanvasLeadTarget,
602
617
  useCanvasMotionStyle: () => useCanvasMotionStyle,
603
618
  useCanvasTail: () => useCanvasTail,
619
+ useCanvasTurnTail: () => useCanvasTurnTail,
604
620
  useCanvasViewBack: () => useCanvasViewBack,
605
621
  useCart: () => useCart,
606
622
  useCartActionFailures: () => useCartActionFailures,
@@ -639,6 +655,7 @@ __export(src_exports3, {
639
655
  useDockState: () => useDockState,
640
656
  useDocumentVisible: () => useDocumentVisible,
641
657
  useElementId: () => useElementId,
658
+ useElementLayout: () => useElementLayout,
642
659
  useExclusiveOverlay: () => useExclusiveOverlay,
643
660
  useExplicitTurnId: () => useExplicitTurnId,
644
661
  useExplicitTurnSelection: () => useExplicitTurnSelection,
@@ -691,6 +708,7 @@ __export(src_exports3, {
691
708
  useProductDetail: () => useProductDetail,
692
709
  useProductGridFilter: () => useProductGridFilter,
693
710
  useProductReviews: () => useProductReviews,
711
+ useProductSearch: () => useProductSearch,
694
712
  useProducts: () => useProducts,
695
713
  useProjection: () => useProjection,
696
714
  usePromptComposer: () => usePromptComposer,
@@ -712,8 +730,10 @@ __export(src_exports3, {
712
730
  useSessionState: () => useSessionState,
713
731
  useShellRegistry: () => useShellRegistry,
714
732
  useShellRoot: () => useShellRoot,
733
+ useShopCheckout: () => useShopCheckout,
715
734
  useSpaceLocale: () => useSpaceLocale,
716
735
  useStandingOfType: () => useStandingOfType,
736
+ useStoreArticles: () => useStoreArticles,
717
737
  useStoreCheckouts: () => useStoreCheckouts,
718
738
  useStream: () => useStream,
719
739
  useSuccessFlash: () => useSuccessFlash,
@@ -1526,6 +1546,7 @@ __export(src_exports, {
1526
1546
  ALLOWED_ATTACHMENT_TYPES: () => ALLOWED_ATTACHMENT_TYPES,
1527
1547
  ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
1528
1548
  ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
1549
+ ATTENTION_NAMESPACE: () => ATTENTION_NAMESPACE,
1529
1550
  AgentDirectiveSchema: () => AgentDirectiveSchema,
1530
1551
  AgentOutputSchema: () => AgentOutputSchema,
1531
1552
  AgentSessionSummarySchema: () => AgentSessionSummarySchema,
@@ -1533,6 +1554,7 @@ __export(src_exports, {
1533
1554
  AttachmentRefSchema: () => AttachmentRefSchema,
1534
1555
  AttachmentRefsSchema: () => AttachmentRefsSchema,
1535
1556
  AttachmentUploadError: () => AttachmentUploadError,
1557
+ AttentionSchema: () => AttentionSchema,
1536
1558
  AttributeDefSchema: () => AttributeDefSchema,
1537
1559
  AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
1538
1560
  AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
@@ -1612,6 +1634,7 @@ __export(src_exports, {
1612
1634
  NavigatePayloadSchema: () => NavigatePayloadSchema,
1613
1635
  OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
1614
1636
  PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
1637
+ POINTING_NAMESPACE: () => POINTING_NAMESPACE,
1615
1638
  PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
1616
1639
  PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
1617
1640
  PRESENCE_FLOW: () => PRESENCE_FLOW,
@@ -1622,6 +1645,7 @@ __export(src_exports, {
1622
1645
  PackageReleaseSchema: () => PackageReleaseSchema,
1623
1646
  PageSchema: () => PageSchema,
1624
1647
  PatchSchema: () => PatchSchema,
1648
+ PointedAtSchema: () => PointedAtSchema,
1625
1649
  ProjectionDirectiveSchema: () => ProjectionDirectiveSchema,
1626
1650
  ProjectionPreferencesSchema: () => ProjectionPreferencesSchema,
1627
1651
  ProjectionSetPayloadSchema: () => ProjectionSetPayloadSchema,
@@ -2380,27 +2404,58 @@ function chipsFromShowSignal(signal) {
2380
2404
  return parsed.data.actions;
2381
2405
  }
2382
2406
 
2383
- // ../spacestation/src/signal/turn-ask.ts
2407
+ // ../spacestation/src/signal/visitor-view.ts
2384
2408
  import { z as z14 } from "zod";
2409
+ var ATTENTION_NAMESPACE = "attention";
2410
+ var POINTING_NAMESPACE = "pointing";
2411
+ var Ref = z14.string().trim().min(1).max(200);
2412
+ var Label = z14.string().trim().min(1).max(160);
2413
+ var SeenSchema = z14.object({
2414
+ /** The entity's id as the agent knows it (a product id), when the thing is an entity. */
2415
+ ref: Ref.optional(),
2416
+ label: Label,
2417
+ /** One short fact the visitor can see on it ("$48", "sold out"). */
2418
+ note: z14.string().trim().max(80).optional()
2419
+ });
2420
+ var AttentionSchema = z14.object({
2421
+ /** On the visitor's screen now, in reading order. */
2422
+ onScreen: z14.array(SeenSchema).max(24),
2423
+ /** Where the visitor rested longest, most first. */
2424
+ lingered: z14.array(SeenSchema.extend({ seconds: z14.number().nonnegative() })).max(6),
2425
+ /** Sections the visitor has scrolled through, in order (titles the page showed). */
2426
+ passed: z14.array(Label).max(12)
2427
+ });
2428
+ var PointedAtSchema = z14.object({
2429
+ ref: Ref.optional(),
2430
+ /** What the element is ("Faherty linen shirt", "the page headline"). */
2431
+ label: Label,
2432
+ /** Which of its facets the visitor tapped ("price", "colour", "style", "section"). */
2433
+ field: z14.string().trim().min(1).max(40),
2434
+ /** That facet's value as shown ("$128", "Navy"). */
2435
+ value: z14.string().trim().max(160).optional()
2436
+ });
2437
+
2438
+ // ../spacestation/src/signal/turn-ask.ts
2439
+ import { z as z15 } from "zod";
2385
2440
  var TURN_ASK_SIGNAL = "turn.ask";
2386
2441
  var MIN_CHOICE_ANSWERS = 2;
2387
2442
  var MAX_CHOICE_ANSWERS = 4;
2388
- var AnswerPartSchema = z14.object({ answer: z14.string().trim().min(1) });
2389
- var PartSchema = z14.union([z14.string(), AnswerPartSchema]);
2443
+ var AnswerPartSchema = z15.object({ answer: z15.string().trim().min(1) });
2444
+ var PartSchema = z15.union([z15.string(), AnswerPartSchema]);
2390
2445
  function partsText(parts2) {
2391
2446
  return parts2.map((p) => typeof p === "string" ? p : p.answer).join("");
2392
2447
  }
2393
- var ModelTurnAskSchema = z14.object({
2394
- kind: z14.enum(["choice", "open"]),
2395
- parts: z14.array(PartSchema).min(1)
2448
+ var ModelTurnAskSchema = z15.object({
2449
+ kind: z15.enum(["choice", "open"]),
2450
+ parts: z15.array(PartSchema).min(1)
2396
2451
  }).refine((ask) => partsText(ask.parts).trim().length > 0, { message: "the question reads as nothing" }).refine((ask) => /\?["'”’*)\s]*$/.test(partsText(ask.parts)), { message: "an ask is a question" }).transform((ask) => {
2397
2452
  const answers = ask.parts.filter((p) => typeof p !== "string").length;
2398
2453
  if (ask.kind === "choice" && answers >= MIN_CHOICE_ANSWERS && answers <= MAX_CHOICE_ANSWERS) return ask;
2399
2454
  if (ask.kind === "open" && answers === 0) return ask;
2400
2455
  return { kind: "open", parts: [partsText(ask.parts)] };
2401
2456
  });
2402
- var PersistedQuestionSchema = z14.object({ question: z14.string().trim().min(1) }).transform((row) => ({ kind: "open", parts: [row.question.replace(/[[\]]/g, "")] }));
2403
- var TurnAskSchema = z14.union([ModelTurnAskSchema, PersistedQuestionSchema]);
2457
+ var PersistedQuestionSchema = z15.object({ question: z15.string().trim().min(1) }).transform((row) => ({ kind: "open", parts: [row.question.replace(/[[\]]/g, "")] }));
2458
+ var TurnAskSchema = z15.union([ModelTurnAskSchema, PersistedQuestionSchema]);
2404
2459
  function turnAskSegments(ask) {
2405
2460
  return ask.parts.map((p) => typeof p === "string" ? { kind: "text", text: p } : { kind: "answer", text: p.answer });
2406
2461
  }
@@ -2417,15 +2472,15 @@ function turnAskFromSignal(signal) {
2417
2472
  }
2418
2473
 
2419
2474
  // ../spacestation/src/types.ts
2420
- import { z as z15 } from "zod";
2475
+ import { z as z16 } from "zod";
2421
2476
  var PRESENCE_FACT_DISMISS_SIGNAL = "presence.fact_dismissed";
2422
2477
  var VISITOR_NAME_SIGNAL = "visitor.name_stated";
2423
2478
  var VISITOR_CONTEXT_SIGNAL = "visitor.context_stated";
2424
2479
  var PRESENCE_CANVAS_REFRESH_SIGNAL = "presence.canvas_refresh";
2425
2480
  var CLIENT_STATE_HELLO_SIGNAL = "state.hello";
2426
- var StateSnapshotFrameSchema = z15.object({
2427
- rev: z15.number(),
2428
- state: z15.record(z15.unknown())
2481
+ var StateSnapshotFrameSchema = z16.object({
2482
+ rev: z16.number(),
2483
+ state: z16.record(z16.unknown())
2429
2484
  });
2430
2485
  function stateSnapshotSignal(namespace) {
2431
2486
  return `${namespace}.snapshot`;
@@ -2489,36 +2544,36 @@ function settledBlocks(sizes) {
2489
2544
  }
2490
2545
 
2491
2546
  // ../spacestation/src/catalog/structural-baseline.ts
2492
- import { z as z16 } from "zod";
2493
- var agentTextProps = z16.object({
2494
- text: z16.string().optional().describe("Plain prose. Used by the streaming text.delta slot binding so the agent can flow words in without choosing emphasis spans up front."),
2495
- parts: z16.array(z16.object({
2496
- type: z16.enum(["text", "em"]).describe("text = sans body; em = italic emphasis."),
2497
- value: z16.string()
2547
+ import { z as z17 } from "zod";
2548
+ var agentTextProps = z17.object({
2549
+ text: z17.string().optional().describe("Plain prose. Used by the streaming text.delta slot binding so the agent can flow words in without choosing emphasis spans up front."),
2550
+ parts: z17.array(z17.object({
2551
+ type: z17.enum(["text", "em"]).describe("text = sans body; em = italic emphasis."),
2552
+ value: z17.string()
2498
2553
  })).optional().describe("Pre-segmented prose with mixed sans + italic spans. When present, takes precedence over `text`. Use sparingly \u2014 italic carries weight, save it for the human moment in the answer."),
2499
- size: z16.enum(["sm", "md", "lg"]).optional().describe("Visual scale. lg for hero prose at the top of a turn; md (default) for body; sm for trailing footnote prose.")
2554
+ size: z17.enum(["sm", "md", "lg"]).optional().describe("Visual scale. lg for hero prose at the top of a turn; md (default) for body; sm for trailing footnote prose.")
2500
2555
  });
2501
- var turnProps = z16.object({
2502
- prompt: z16.string().describe("The user's prompt for this turn, rendered as a quoted lede above the agent's response. Required so the conversation reads."),
2503
- index: z16.number().optional().describe("Turn index (0-based). When omitted the runtime infers from sibling turns."),
2504
- timestamp: z16.string().optional().describe("ISO timestamp for the small turn header. Omit to skip the header."),
2505
- thinking: z16.string().optional().describe("Short status line shown while the response streams in. Hidden once the first block lands.")
2556
+ var turnProps = z17.object({
2557
+ prompt: z17.string().describe("The user's prompt for this turn, rendered as a quoted lede above the agent's response. Required so the conversation reads."),
2558
+ index: z17.number().optional().describe("Turn index (0-based). When omitted the runtime infers from sibling turns."),
2559
+ timestamp: z17.string().optional().describe("ISO timestamp for the small turn header. Omit to skip the header."),
2560
+ thinking: z17.string().optional().describe("Short status line shown while the response streams in. Hidden once the first block lands.")
2506
2561
  });
2507
- var backdropProps = z16.object({
2508
- variant: z16.enum(["ridges", "sky", "video", "none"]).optional().describe(
2562
+ var backdropProps = z17.object({
2563
+ variant: z17.enum(["ridges", "sky", "video", "none"]).optional().describe(
2509
2564
  "Background variant. `ridges` = parallax silhouettes + sky gradient. `sky` = gradient + grain + vignette only. `video` = full-bleed autoplay-loop-muted video sourced from `videoUrl`. `none` = nothing rendered."
2510
2565
  ),
2511
- ridgeColor: z16.string().optional().describe("Hex color of the ridge silhouettes. Defaults to surface fg1."),
2512
- videoUrl: z16.string().optional().describe(
2566
+ ridgeColor: z17.string().optional().describe("Hex color of the ridge silhouettes. Defaults to surface fg1."),
2567
+ videoUrl: z17.string().optional().describe(
2513
2568
  'Direct mp4/webm URL for the `video` variant. Loaded with preload="metadata", muted, looped, playsInline.'
2514
2569
  ),
2515
- posterUrl: z16.string().optional().describe("Optional poster frame shown while video buffers.")
2570
+ posterUrl: z17.string().optional().describe("Optional poster frame shown while video buffers.")
2516
2571
  });
2517
2572
  var STRUCTURAL_BASELINE_CATALOG = {
2518
2573
  page: {
2519
2574
  type: "page",
2520
2575
  alwaysInclude: true,
2521
- propsSchema: z16.object({}),
2576
+ propsSchema: z17.object({}),
2522
2577
  layout: "fullbleed",
2523
2578
  progressLabel: "Composing the page"
2524
2579
  },
@@ -2571,7 +2626,7 @@ var STRUCTURAL_BASELINE_CATALOG = {
2571
2626
  var STRUCTURAL_BASELINE_TYPES = Object.keys(STRUCTURAL_BASELINE_CATALOG);
2572
2627
 
2573
2628
  // ../spacestation/src/catalog/resolved.ts
2574
- import { z as z17 } from "zod";
2629
+ import { z as z18 } from "zod";
2575
2630
  function resolved(schema, resolverKey, opts) {
2576
2631
  const meta = { resolverKey, ...opts };
2577
2632
  if (opts && opts.max === 1) {
@@ -2579,7 +2634,7 @@ function resolved(schema, resolverKey, opts) {
2579
2634
  writeResolvedMeta(tagged, meta);
2580
2635
  return tagged;
2581
2636
  }
2582
- const arraySchema = z17.array(schema);
2637
+ const arraySchema = z18.array(schema);
2583
2638
  writeResolvedMeta(arraySchema, meta);
2584
2639
  return arraySchema;
2585
2640
  }
@@ -2628,7 +2683,7 @@ function walk(schema, path, out, visited) {
2628
2683
  if (visited.has(schema)) return;
2629
2684
  const meta = readResolvedMeta(schema);
2630
2685
  if (meta !== void 0) {
2631
- const entitySchema = schema instanceof z17.ZodArray ? schema.element : schema;
2686
+ const entitySchema = schema instanceof z18.ZodArray ? schema.element : schema;
2632
2687
  out.push({ path, meta, schema: entitySchema });
2633
2688
  return;
2634
2689
  }
@@ -2640,18 +2695,18 @@ function walk(schema, path, out, visited) {
2640
2695
  return;
2641
2696
  }
2642
2697
  }
2643
- if (schema instanceof z17.ZodObject) {
2698
+ if (schema instanceof z18.ZodObject) {
2644
2699
  for (const [key, child] of Object.entries(schema.shape)) {
2645
2700
  walk(child, [...path, key], out, visited);
2646
2701
  }
2647
2702
  return;
2648
2703
  }
2649
- if (schema instanceof z17.ZodArray) {
2704
+ if (schema instanceof z18.ZodArray) {
2650
2705
  const element = schema.element;
2651
2706
  walk(element, [...path, "*"], out, visited);
2652
2707
  return;
2653
2708
  }
2654
- if (schema instanceof z17.ZodUnion || schema instanceof z17.ZodDiscriminatedUnion) {
2709
+ if (schema instanceof z18.ZodUnion || schema instanceof z18.ZodDiscriminatedUnion) {
2655
2710
  for (const opt of schema.options) {
2656
2711
  walk(opt, path, out, visited);
2657
2712
  }
@@ -2759,7 +2814,7 @@ function collectElementEntityRefs(element, catalog) {
2759
2814
  }
2760
2815
 
2761
2816
  // ../spacestation/src/catalog/prose.ts
2762
- import { z as z18 } from "zod";
2817
+ import { z as z19 } from "zod";
2763
2818
  function prose(schema) {
2764
2819
  const tagged = cloneSchema2(schema);
2765
2820
  writeProseMeta(tagged);
@@ -2800,17 +2855,17 @@ function walk2(schema, path, when, out, visited) {
2800
2855
  walk2(def.innerType, path, when, out, visited);
2801
2856
  return;
2802
2857
  }
2803
- if (schema instanceof z18.ZodObject) {
2858
+ if (schema instanceof z19.ZodObject) {
2804
2859
  for (const [key, child] of Object.entries(schema.shape)) {
2805
2860
  walk2(child, [...path, key], when, out, visited);
2806
2861
  }
2807
2862
  return;
2808
2863
  }
2809
- if (schema instanceof z18.ZodArray) {
2864
+ if (schema instanceof z19.ZodArray) {
2810
2865
  walk2(schema.element, [...path, "*"], when, out, visited);
2811
2866
  return;
2812
2867
  }
2813
- if (schema instanceof z18.ZodDiscriminatedUnion) {
2868
+ if (schema instanceof z19.ZodDiscriminatedUnion) {
2814
2869
  const key = schema.discriminator;
2815
2870
  for (const opt of schema.options) {
2816
2871
  const value = discriminatorValue(opt, key);
@@ -2819,7 +2874,7 @@ function walk2(schema, path, when, out, visited) {
2819
2874
  }
2820
2875
  return;
2821
2876
  }
2822
- if (schema instanceof z18.ZodUnion) {
2877
+ if (schema instanceof z19.ZodUnion) {
2823
2878
  for (const opt of schema.options) {
2824
2879
  walk2(opt, path, when, out, visited);
2825
2880
  }
@@ -2827,15 +2882,15 @@ function walk2(schema, path, when, out, visited) {
2827
2882
  }
2828
2883
  }
2829
2884
  function discriminatorValue(option, key) {
2830
- if (!(option instanceof z18.ZodObject)) return void 0;
2885
+ if (!(option instanceof z19.ZodObject)) return void 0;
2831
2886
  const field = option.shape[key];
2832
- if (!(field instanceof z18.ZodLiteral)) return void 0;
2887
+ if (!(field instanceof z19.ZodLiteral)) return void 0;
2833
2888
  const value = field.value;
2834
2889
  return typeof value === "string" ? value : void 0;
2835
2890
  }
2836
2891
 
2837
2892
  // ../spacestation/src/catalog/required-props.ts
2838
- import { z as z19 } from "zod";
2893
+ import { z as z20 } from "zod";
2839
2894
  function requiredTopLevelProps(schema) {
2840
2895
  const obj = unwrapToObject(schema);
2841
2896
  if (obj === void 0) return [];
@@ -2855,7 +2910,7 @@ function isEmptyPropValue(value) {
2855
2910
  return false;
2856
2911
  }
2857
2912
  function isOptionalSchema(schema) {
2858
- return schema instanceof z19.ZodOptional || schema instanceof z19.ZodDefault || schema instanceof z19.ZodNullable;
2913
+ return schema instanceof z20.ZodOptional || schema instanceof z20.ZodDefault || schema instanceof z20.ZodNullable;
2859
2914
  }
2860
2915
  function isOptionalTopLevelProp(schema, prop) {
2861
2916
  const obj = unwrapToObject(schema);
@@ -2864,12 +2919,12 @@ function isOptionalTopLevelProp(schema, prop) {
2864
2919
  return child !== void 0 && isOptionalSchema(child);
2865
2920
  }
2866
2921
  function unwrapToObject(schema) {
2867
- if (schema instanceof z19.ZodObject) return schema;
2922
+ if (schema instanceof z20.ZodObject) return schema;
2868
2923
  return void 0;
2869
2924
  }
2870
2925
 
2871
2926
  // ../spacestation/src/catalog/function-props.ts
2872
- import { z as z20 } from "zod";
2927
+ import { z as z21 } from "zod";
2873
2928
  function findFunctionPropPaths(schema) {
2874
2929
  if (schema === void 0) return [];
2875
2930
  const found = [];
@@ -2879,74 +2934,74 @@ function findFunctionPropPaths(schema) {
2879
2934
  function walk3(schema, path, found, visited) {
2880
2935
  if (visited.has(schema)) return;
2881
2936
  visited.add(schema);
2882
- if (schema instanceof z20.ZodFunction) {
2937
+ if (schema instanceof z21.ZodFunction) {
2883
2938
  found.push(path === "" ? "(root)" : path);
2884
2939
  return;
2885
2940
  }
2886
- if (schema instanceof z20.ZodObject) {
2941
+ if (schema instanceof z21.ZodObject) {
2887
2942
  for (const [key, child] of Object.entries(schema.shape)) {
2888
- if (child instanceof z20.ZodType) {
2943
+ if (child instanceof z21.ZodType) {
2889
2944
  walk3(child, path === "" ? key : `${path}.${key}`, found, visited);
2890
2945
  }
2891
2946
  }
2892
2947
  return;
2893
2948
  }
2894
- if (schema instanceof z20.ZodArray) {
2949
+ if (schema instanceof z21.ZodArray) {
2895
2950
  walk3(schema.element, `${path}[]`, found, visited);
2896
2951
  return;
2897
2952
  }
2898
- if (schema instanceof z20.ZodTuple) {
2953
+ if (schema instanceof z21.ZodTuple) {
2899
2954
  for (const [i, item] of schema.items.entries()) {
2900
- if (item instanceof z20.ZodType) walk3(item, `${path}[${i}]`, found, visited);
2955
+ if (item instanceof z21.ZodType) walk3(item, `${path}[${i}]`, found, visited);
2901
2956
  }
2902
2957
  const rest = schema._def.rest;
2903
- if (rest instanceof z20.ZodType) walk3(rest, `${path}[]`, found, visited);
2958
+ if (rest instanceof z21.ZodType) walk3(rest, `${path}[]`, found, visited);
2904
2959
  return;
2905
2960
  }
2906
- if (schema instanceof z20.ZodUnion || schema instanceof z20.ZodDiscriminatedUnion) {
2961
+ if (schema instanceof z21.ZodUnion || schema instanceof z21.ZodDiscriminatedUnion) {
2907
2962
  for (const option of schema.options) {
2908
- if (option instanceof z20.ZodType) walk3(option, path, found, visited);
2963
+ if (option instanceof z21.ZodType) walk3(option, path, found, visited);
2909
2964
  }
2910
2965
  return;
2911
2966
  }
2912
- if (schema instanceof z20.ZodIntersection) {
2967
+ if (schema instanceof z21.ZodIntersection) {
2913
2968
  walk3(schema._def.left, path, found, visited);
2914
2969
  walk3(schema._def.right, path, found, visited);
2915
2970
  return;
2916
2971
  }
2917
- if (schema instanceof z20.ZodRecord) {
2972
+ if (schema instanceof z21.ZodRecord) {
2918
2973
  walk3(schema.valueSchema, `${path}{}`, found, visited);
2919
2974
  return;
2920
2975
  }
2921
- if (schema instanceof z20.ZodMap) {
2976
+ if (schema instanceof z21.ZodMap) {
2922
2977
  walk3(schema.valueSchema, `${path}{}`, found, visited);
2923
2978
  return;
2924
2979
  }
2925
- if (schema instanceof z20.ZodSet) {
2980
+ if (schema instanceof z21.ZodSet) {
2926
2981
  walk3(schema._def.valueType, `${path}[]`, found, visited);
2927
2982
  return;
2928
2983
  }
2929
- if (schema instanceof z20.ZodOptional || schema instanceof z20.ZodNullable || schema instanceof z20.ZodBranded || schema instanceof z20.ZodReadonly || schema instanceof z20.ZodPromise) {
2984
+ if (schema instanceof z21.ZodOptional || schema instanceof z21.ZodNullable || schema instanceof z21.ZodBranded || schema instanceof z21.ZodReadonly || schema instanceof z21.ZodPromise) {
2930
2985
  walk3(schema.unwrap(), path, found, visited);
2931
2986
  return;
2932
2987
  }
2933
- if (schema instanceof z20.ZodDefault) {
2988
+ if (schema instanceof z21.ZodDefault) {
2934
2989
  walk3(schema.removeDefault(), path, found, visited);
2935
2990
  return;
2936
2991
  }
2937
- if (schema instanceof z20.ZodCatch) {
2992
+ if (schema instanceof z21.ZodCatch) {
2938
2993
  walk3(schema.removeCatch(), path, found, visited);
2939
2994
  return;
2940
2995
  }
2941
- if (schema instanceof z20.ZodEffects) {
2996
+ if (schema instanceof z21.ZodEffects) {
2942
2997
  walk3(schema.innerType(), path, found, visited);
2943
2998
  return;
2944
2999
  }
2945
- if (schema instanceof z20.ZodLazy) {
3000
+ if (schema instanceof z21.ZodLazy) {
2946
3001
  walk3(schema.schema, path, found, visited);
2947
3002
  return;
2948
3003
  }
2949
- if (schema instanceof z20.ZodPipeline) {
3004
+ if (schema instanceof z21.ZodPipeline) {
2950
3005
  walk3(schema._def.in, path, found, visited);
2951
3006
  walk3(schema._def.out, path, found, visited);
2952
3007
  return;
@@ -3265,47 +3320,47 @@ function getDescription(schema) {
3265
3320
  }
3266
3321
 
3267
3322
  // ../spacestation/src/catalog/wire/wire-schema.ts
3268
- import { z as z21 } from "zod";
3323
+ import { z as z22 } from "zod";
3269
3324
  var common = {
3270
- description: z21.string().optional(),
3271
- resolved: z21.object({
3272
- resolverKey: z21.string(),
3273
- min: z21.number().optional(),
3274
- max: z21.number().optional(),
3275
- renderFloor: z21.number().optional(),
3276
- derivedFrom: z21.string().optional()
3325
+ description: z22.string().optional(),
3326
+ resolved: z22.object({
3327
+ resolverKey: z22.string(),
3328
+ min: z22.number().optional(),
3329
+ max: z22.number().optional(),
3330
+ renderFloor: z22.number().optional(),
3331
+ derivedFrom: z22.string().optional()
3277
3332
  }).strict().optional(),
3278
- prose: z21.literal(true).optional()
3333
+ prose: z22.literal(true).optional()
3279
3334
  };
3280
- var WireSchemaSchema = z21.lazy(
3281
- () => z21.discriminatedUnion("t", [
3282
- z21.object({ ...common, t: z21.literal("string"), min: z21.number().optional(), max: z21.number().optional() }).strict(),
3283
- z21.object({
3335
+ var WireSchemaSchema = z22.lazy(
3336
+ () => z22.discriminatedUnion("t", [
3337
+ z22.object({ ...common, t: z22.literal("string"), min: z22.number().optional(), max: z22.number().optional() }).strict(),
3338
+ z22.object({
3284
3339
  ...common,
3285
- t: z21.literal("number"),
3286
- int: z21.literal(true).optional(),
3287
- min: z21.number().optional(),
3288
- minExclusive: z21.literal(true).optional(),
3289
- max: z21.number().optional(),
3290
- maxExclusive: z21.literal(true).optional()
3340
+ t: z22.literal("number"),
3341
+ int: z22.literal(true).optional(),
3342
+ min: z22.number().optional(),
3343
+ minExclusive: z22.literal(true).optional(),
3344
+ max: z22.number().optional(),
3345
+ maxExclusive: z22.literal(true).optional()
3291
3346
  }).strict(),
3292
- z21.object({ ...common, t: z21.literal("boolean") }).strict(),
3293
- z21.object({ ...common, t: z21.literal("unknown") }).strict(),
3294
- z21.object({ ...common, t: z21.literal("literal"), value: z21.union([z21.string(), z21.number(), z21.boolean()]) }).strict(),
3295
- z21.object({ ...common, t: z21.literal("enum"), values: z21.array(z21.string()).min(1) }).strict(),
3296
- z21.object({ ...common, t: z21.literal("array"), element: WireSchemaSchema, min: z21.number().optional(), max: z21.number().optional() }).strict(),
3297
- z21.object({ ...common, t: z21.literal("object"), shape: z21.record(WireSchemaSchema), unknownKeys: z21.enum(["strip", "passthrough", "strict"]) }).strict(),
3298
- z21.object({ ...common, t: z21.literal("union"), options: z21.array(WireSchemaSchema).min(2) }).strict(),
3299
- z21.object({ ...common, t: z21.literal("discriminatedUnion"), discriminator: z21.string(), options: z21.array(WireSchemaSchema).min(2) }).strict(),
3300
- z21.object({ ...common, t: z21.literal("record"), value: WireSchemaSchema }).strict(),
3301
- z21.object({ ...common, t: z21.literal("optional"), inner: WireSchemaSchema }).strict(),
3302
- z21.object({ ...common, t: z21.literal("nullable"), inner: WireSchemaSchema }).strict(),
3303
- z21.object({ ...common, t: z21.literal("default"), inner: WireSchemaSchema, value: z21.unknown() }).strict()
3347
+ z22.object({ ...common, t: z22.literal("boolean") }).strict(),
3348
+ z22.object({ ...common, t: z22.literal("unknown") }).strict(),
3349
+ z22.object({ ...common, t: z22.literal("literal"), value: z22.union([z22.string(), z22.number(), z22.boolean()]) }).strict(),
3350
+ z22.object({ ...common, t: z22.literal("enum"), values: z22.array(z22.string()).min(1) }).strict(),
3351
+ z22.object({ ...common, t: z22.literal("array"), element: WireSchemaSchema, min: z22.number().optional(), max: z22.number().optional() }).strict(),
3352
+ z22.object({ ...common, t: z22.literal("object"), shape: z22.record(WireSchemaSchema), unknownKeys: z22.enum(["strip", "passthrough", "strict"]) }).strict(),
3353
+ z22.object({ ...common, t: z22.literal("union"), options: z22.array(WireSchemaSchema).min(2) }).strict(),
3354
+ z22.object({ ...common, t: z22.literal("discriminatedUnion"), discriminator: z22.string(), options: z22.array(WireSchemaSchema).min(2) }).strict(),
3355
+ z22.object({ ...common, t: z22.literal("record"), value: WireSchemaSchema }).strict(),
3356
+ z22.object({ ...common, t: z22.literal("optional"), inner: WireSchemaSchema }).strict(),
3357
+ z22.object({ ...common, t: z22.literal("nullable"), inner: WireSchemaSchema }).strict(),
3358
+ z22.object({ ...common, t: z22.literal("default"), inner: WireSchemaSchema, value: z22.unknown() }).strict()
3304
3359
  ])
3305
3360
  );
3306
3361
 
3307
3362
  // ../spacestation/src/catalog/wire/schema-to-wire.ts
3308
- import { z as z22 } from "zod";
3363
+ import { z as z23 } from "zod";
3309
3364
  var UnsupportedSchemaError = class extends Error {
3310
3365
  constructor(path, what) {
3311
3366
  super(`Cannot publish the schema at ${path === "" ? "<root>" : path}: ${what}.`);
@@ -3343,7 +3398,7 @@ function arrayNode(schema, path) {
3343
3398
  return node;
3344
3399
  }
3345
3400
  function objectNode(schema, path) {
3346
- if (!(schema._def.catchall instanceof z22.ZodNever)) throw new UnsupportedSchemaError(path, "object .catchall() is not supported");
3401
+ if (!(schema._def.catchall instanceof z23.ZodNever)) throw new UnsupportedSchemaError(path, "object .catchall() is not supported");
3347
3402
  const shape = {};
3348
3403
  for (const [key, child] of Object.entries(schema.shape)) shape[key] = toNode(child, path === "" ? key : `${path}.${key}`);
3349
3404
  return { t: "object", shape, unknownKeys: schema._def.unknownKeys };
@@ -3354,19 +3409,19 @@ function literalNode(schema, path) {
3354
3409
  throw new UnsupportedSchemaError(path, "only string, number and boolean literals are supported");
3355
3410
  }
3356
3411
  function bare(schema, path) {
3357
- if (schema instanceof z22.ZodString) return stringNode(schema, path);
3358
- if (schema instanceof z22.ZodNumber) return numberNode(schema, path);
3359
- if (schema instanceof z22.ZodBoolean) return { t: "boolean" };
3360
- if (schema instanceof z22.ZodUnknown || schema instanceof z22.ZodAny) return { t: "unknown" };
3361
- if (schema instanceof z22.ZodLiteral) return literalNode(schema, path);
3362
- if (schema instanceof z22.ZodEnum) return { t: "enum", values: [...schema.options] };
3363
- if (schema instanceof z22.ZodArray) return arrayNode(schema, path);
3364
- if (schema instanceof z22.ZodObject) return objectNode(schema, path);
3365
- if (schema instanceof z22.ZodUnion) {
3412
+ if (schema instanceof z23.ZodString) return stringNode(schema, path);
3413
+ if (schema instanceof z23.ZodNumber) return numberNode(schema, path);
3414
+ if (schema instanceof z23.ZodBoolean) return { t: "boolean" };
3415
+ if (schema instanceof z23.ZodUnknown || schema instanceof z23.ZodAny) return { t: "unknown" };
3416
+ if (schema instanceof z23.ZodLiteral) return literalNode(schema, path);
3417
+ if (schema instanceof z23.ZodEnum) return { t: "enum", values: [...schema.options] };
3418
+ if (schema instanceof z23.ZodArray) return arrayNode(schema, path);
3419
+ if (schema instanceof z23.ZodObject) return objectNode(schema, path);
3420
+ if (schema instanceof z23.ZodUnion) {
3366
3421
  const options = schema.options;
3367
3422
  return { t: "union", options: options.map((option, i) => toNode(option, `${path}|${i}`)) };
3368
3423
  }
3369
- if (schema instanceof z22.ZodDiscriminatedUnion) {
3424
+ if (schema instanceof z23.ZodDiscriminatedUnion) {
3370
3425
  const options = schema.options;
3371
3426
  return {
3372
3427
  t: "discriminatedUnion",
@@ -3374,13 +3429,13 @@ function bare(schema, path) {
3374
3429
  options: options.map((option, i) => toNode(option, `${path}|${i}`))
3375
3430
  };
3376
3431
  }
3377
- if (schema instanceof z22.ZodRecord) {
3378
- if (!(schema.keySchema instanceof z22.ZodString)) throw new UnsupportedSchemaError(path, "only string-keyed records are supported");
3432
+ if (schema instanceof z23.ZodRecord) {
3433
+ if (!(schema.keySchema instanceof z23.ZodString)) throw new UnsupportedSchemaError(path, "only string-keyed records are supported");
3379
3434
  return { t: "record", value: toNode(schema.valueSchema, `${path}{}`) };
3380
3435
  }
3381
- if (schema instanceof z22.ZodOptional) return { t: "optional", inner: toNode(schema.unwrap(), path) };
3382
- if (schema instanceof z22.ZodNullable) return { t: "nullable", inner: toNode(schema.unwrap(), path) };
3383
- if (schema instanceof z22.ZodDefault) {
3436
+ if (schema instanceof z23.ZodOptional) return { t: "optional", inner: toNode(schema.unwrap(), path) };
3437
+ if (schema instanceof z23.ZodNullable) return { t: "nullable", inner: toNode(schema.unwrap(), path) };
3438
+ if (schema instanceof z23.ZodDefault) {
3384
3439
  return { t: "default", inner: toNode(schema._def.innerType, path), value: schema._def.defaultValue() };
3385
3440
  }
3386
3441
  throw new UnsupportedSchemaError(path, `${schema.constructor.name} is not supported`);
@@ -3398,35 +3453,35 @@ function schemaToWire(schema) {
3398
3453
  }
3399
3454
 
3400
3455
  // ../spacestation/src/catalog/wire/schema-from-wire.ts
3401
- import { z as z23 } from "zod";
3456
+ import { z as z24 } from "zod";
3402
3457
  function bare2(node) {
3403
3458
  switch (node.t) {
3404
3459
  case "string": {
3405
- let schema = z23.string();
3460
+ let schema = z24.string();
3406
3461
  if (node.min !== void 0) schema = schema.min(node.min);
3407
3462
  if (node.max !== void 0) schema = schema.max(node.max);
3408
3463
  return schema;
3409
3464
  }
3410
3465
  case "number": {
3411
- let schema = z23.number();
3466
+ let schema = z24.number();
3412
3467
  if (node.int === true) schema = schema.int();
3413
3468
  if (node.min !== void 0) schema = node.minExclusive === true ? schema.gt(node.min) : schema.gte(node.min);
3414
3469
  if (node.max !== void 0) schema = node.maxExclusive === true ? schema.lt(node.max) : schema.lte(node.max);
3415
3470
  return schema;
3416
3471
  }
3417
3472
  case "boolean":
3418
- return z23.boolean();
3473
+ return z24.boolean();
3419
3474
  case "unknown":
3420
- return z23.unknown();
3475
+ return z24.unknown();
3421
3476
  case "literal":
3422
- return z23.literal(node.value);
3477
+ return z24.literal(node.value);
3423
3478
  case "enum": {
3424
3479
  const [first, ...rest] = node.values;
3425
3480
  if (first === void 0) throw new Error("A wire enum needs at least one value.");
3426
- return z23.enum([first, ...rest]);
3481
+ return z24.enum([first, ...rest]);
3427
3482
  }
3428
3483
  case "array": {
3429
- let schema = z23.array(schemaFromWire(node.element));
3484
+ let schema = z24.array(schemaFromWire(node.element));
3430
3485
  if (node.min !== void 0) schema = schema.min(node.min);
3431
3486
  if (node.max !== void 0) schema = schema.max(node.max);
3432
3487
  return schema;
@@ -3434,7 +3489,7 @@ function bare2(node) {
3434
3489
  case "object": {
3435
3490
  const shape = {};
3436
3491
  for (const [key, child] of Object.entries(node.shape)) shape[key] = schemaFromWire(child);
3437
- const schema = z23.object(shape);
3492
+ const schema = z24.object(shape);
3438
3493
  if (node.unknownKeys === "passthrough") return schema.passthrough();
3439
3494
  if (node.unknownKeys === "strict") return schema.strict();
3440
3495
  return schema;
@@ -3442,30 +3497,30 @@ function bare2(node) {
3442
3497
  case "union": {
3443
3498
  const [first, second, ...rest] = node.options.map(schemaFromWire);
3444
3499
  if (first === void 0 || second === void 0) throw new Error("A wire union needs at least two options.");
3445
- return z23.union([first, second, ...rest]);
3500
+ return z24.union([first, second, ...rest]);
3446
3501
  }
3447
3502
  case "discriminatedUnion": {
3448
3503
  const options = node.options.map(schemaFromWire);
3449
3504
  const objects = [];
3450
3505
  for (const option of options) {
3451
- if (!(option instanceof z23.ZodObject)) throw new Error("Every option of a wire discriminated union must be an object.");
3506
+ if (!(option instanceof z24.ZodObject)) throw new Error("Every option of a wire discriminated union must be an object.");
3452
3507
  objects.push(option);
3453
3508
  }
3454
3509
  const [first, second, ...rest] = objects;
3455
3510
  if (first === void 0 || second === void 0) throw new Error("A wire discriminated union needs at least two options.");
3456
- return z23.discriminatedUnion(node.discriminator, [first, second, ...rest]);
3511
+ return z24.discriminatedUnion(node.discriminator, [first, second, ...rest]);
3457
3512
  }
3458
3513
  case "record":
3459
- return z23.record(schemaFromWire(node.value));
3514
+ return z24.record(schemaFromWire(node.value));
3460
3515
  // The static constructors, not the fluent `.optional()` / `.default()`:
3461
3516
  // those copy the inner schema's description onto the wrapper, which would
3462
3517
  // invent a description the original wrapper did not carry.
3463
3518
  case "optional":
3464
- return z23.optional(schemaFromWire(node.inner));
3519
+ return z24.optional(schemaFromWire(node.inner));
3465
3520
  case "nullable":
3466
- return z23.nullable(schemaFromWire(node.inner));
3521
+ return z24.nullable(schemaFromWire(node.inner));
3467
3522
  case "default":
3468
- return z23.ZodDefault.create(schemaFromWire(node.inner), { default: node.value });
3523
+ return z24.ZodDefault.create(schemaFromWire(node.inner), { default: node.value });
3469
3524
  }
3470
3525
  }
3471
3526
  function schemaFromWire(node) {
@@ -3476,38 +3531,38 @@ function schemaFromWire(node) {
3476
3531
  }
3477
3532
 
3478
3533
  // ../spacestation/src/catalog/wire/catalog-wire.ts
3479
- import { z as z24 } from "zod";
3480
- var WireCatalogEntrySchema = z24.object({
3481
- type: z24.string().min(1),
3534
+ import { z as z25 } from "zod";
3535
+ var WireCatalogEntrySchema = z25.object({
3536
+ type: z25.string().min(1),
3482
3537
  propsSchema: WireSchemaSchema.optional(),
3483
- examples: z24.array(z24.record(z24.unknown())).optional(),
3484
- renderedBy: z24.string().optional(),
3485
- alwaysInclude: z24.boolean().optional(),
3486
- asks: z24.boolean().optional(),
3487
- whenToUse: z24.string().optional(),
3488
- dontUseWhen: z24.string().optional(),
3489
- variants: z24.string().optional(),
3490
- dependencies: z24.string().optional(),
3491
- layout: z24.enum(["section", "fullbleed"]).optional(),
3492
- size: z24.enum(CANVAS_BLOCK_SIZES).optional(),
3493
- extendsPage: z24.boolean().optional(),
3494
- bindings: z24.array(
3495
- z24.object({
3496
- source: z24.string(),
3497
- prop: z24.string(),
3498
- accumulate: z24.enum(["replace", "append", "concat-text"]).optional(),
3499
- mountAt: z24.string().optional()
3538
+ examples: z25.array(z25.record(z25.unknown())).optional(),
3539
+ renderedBy: z25.string().optional(),
3540
+ alwaysInclude: z25.boolean().optional(),
3541
+ asks: z25.boolean().optional(),
3542
+ whenToUse: z25.string().optional(),
3543
+ dontUseWhen: z25.string().optional(),
3544
+ variants: z25.string().optional(),
3545
+ dependencies: z25.string().optional(),
3546
+ layout: z25.enum(["section", "fullbleed"]).optional(),
3547
+ size: z25.enum(CANVAS_BLOCK_SIZES).optional(),
3548
+ extendsPage: z25.boolean().optional(),
3549
+ bindings: z25.array(
3550
+ z25.object({
3551
+ source: z25.string(),
3552
+ prop: z25.string(),
3553
+ accumulate: z25.enum(["replace", "append", "concat-text"]).optional(),
3554
+ mountAt: z25.string().optional()
3500
3555
  })
3501
3556
  ).optional(),
3502
- defaultLayoutWeight: z24.number().optional(),
3503
- defaultMaxHeight: z24.enum(["sm", "md", "lg", "full"]).optional(),
3504
- category: z24.string().optional(),
3505
- progressLabel: z24.string().optional(),
3506
- isExperience: z24.boolean().optional(),
3507
- requires: z24.array(z24.string()).optional(),
3508
- provides: z24.array(z24.string()).optional()
3557
+ defaultLayoutWeight: z25.number().optional(),
3558
+ defaultMaxHeight: z25.enum(["sm", "md", "lg", "full"]).optional(),
3559
+ category: z25.string().optional(),
3560
+ progressLabel: z25.string().optional(),
3561
+ isExperience: z25.boolean().optional(),
3562
+ requires: z25.array(z25.string()).optional(),
3563
+ provides: z25.array(z25.string()).optional()
3509
3564
  }).strict();
3510
- var WireCatalogSchema = z24.record(WireCatalogEntrySchema);
3565
+ var WireCatalogSchema = z25.record(WireCatalogEntrySchema);
3511
3566
  function propsToWire(type, schema) {
3512
3567
  try {
3513
3568
  return schemaToWire(schema);
@@ -3532,7 +3587,7 @@ function catalogFromWire(wire) {
3532
3587
  continue;
3533
3588
  }
3534
3589
  const rebuilt = schemaFromWire(propsSchema);
3535
- if (!(rebuilt instanceof z24.ZodObject)) throw new Error(`Catalog type "${type}": propsSchema must be an object schema.`);
3590
+ if (!(rebuilt instanceof z25.ZodObject)) throw new Error(`Catalog type "${type}": propsSchema must be an object schema.`);
3536
3591
  const built = { ...data, propsSchema: rebuilt };
3537
3592
  out[type] = built;
3538
3593
  }
@@ -3540,31 +3595,31 @@ function catalogFromWire(wire) {
3540
3595
  }
3541
3596
 
3542
3597
  // ../spacestation/src/catalog/wire/package-release.ts
3543
- import { z as z28 } from "zod";
3598
+ import { z as z29 } from "zod";
3544
3599
 
3545
3600
  // ../spacestation/src/catalog/wire/brand-mark.ts
3546
- import { z as z25 } from "zod";
3601
+ import { z as z26 } from "zod";
3547
3602
  var BRAND_MARK_TYPES = ["svg", "png"];
3548
3603
  var BRAND_MARK_MAX_BYTES = 256 * 1024;
3549
3604
  var MAX_BASE64_LENGTH = Math.ceil(BRAND_MARK_MAX_BYTES / 3) * 4;
3550
- var BrandMarkUploadSchema = z25.object({
3551
- type: z25.enum(BRAND_MARK_TYPES),
3552
- data: z25.string().base64().min(1).max(MAX_BASE64_LENGTH, `a mark file is at most ${BRAND_MARK_MAX_BYTES / 1024} KB`)
3605
+ var BrandMarkUploadSchema = z26.object({
3606
+ type: z26.enum(BRAND_MARK_TYPES),
3607
+ data: z26.string().base64().min(1).max(MAX_BASE64_LENGTH, `a mark file is at most ${BRAND_MARK_MAX_BYTES / 1024} KB`)
3553
3608
  }).strict();
3554
- var BrandMarkStoredSchema = z25.object({
3555
- type: z25.enum(BRAND_MARK_TYPES),
3556
- sha256: z25.string().regex(/^[0-9a-f]{64}$/, "a stored mark is named by its sha256")
3609
+ var BrandMarkStoredSchema = z26.object({
3610
+ type: z26.enum(BRAND_MARK_TYPES),
3611
+ sha256: z26.string().regex(/^[0-9a-f]{64}$/, "a stored mark is named by its sha256")
3557
3612
  }).strict();
3558
- var BrandMarkFileSchema = z25.union([BrandMarkUploadSchema, BrandMarkStoredSchema]);
3613
+ var BrandMarkFileSchema = z26.union([BrandMarkUploadSchema, BrandMarkStoredSchema]);
3559
3614
  var BRAND_MARK_SLOTS = ["square", "wordmark"];
3560
- var BrandMarkSchema = z25.object({ square: BrandMarkFileSchema.optional(), wordmark: BrandMarkFileSchema.optional() }).strict().refine((mark) => mark.square !== void 0 || mark.wordmark !== void 0, "a mark names a square, a wordmark, or both");
3561
- var BrandMarkImageSchema = z25.object({ src: z25.string().min(1), type: z25.enum(BRAND_MARK_TYPES) }).strict();
3562
- var SpaceBrandMarkSchema = z25.object({ square: BrandMarkImageSchema.nullable(), wordmark: BrandMarkImageSchema.nullable() }).strict();
3615
+ var BrandMarkSchema = z26.object({ square: BrandMarkFileSchema.optional(), wordmark: BrandMarkFileSchema.optional() }).strict().refine((mark) => mark.square !== void 0 || mark.wordmark !== void 0, "a mark names a square, a wordmark, or both");
3616
+ var BrandMarkImageSchema = z26.object({ src: z26.string().min(1), type: z26.enum(BRAND_MARK_TYPES) }).strict();
3617
+ var SpaceBrandMarkSchema = z26.object({ square: BrandMarkImageSchema.nullable(), wordmark: BrandMarkImageSchema.nullable() }).strict();
3563
3618
 
3564
3619
  // ../spacestation/src/catalog/wire/sdk-compat.ts
3565
- import { z as z26 } from "zod";
3620
+ import { z as z27 } from "zod";
3566
3621
  var SDK_VERSION_PATTERN = /^\d{1,4}\.\d{1,4}\.\d{1,4}(-[0-9A-Za-z.]{1,32})?$/;
3567
- var SdkVersionSchema = z26.string().regex(SDK_VERSION_PATTERN, "an sdk version is major.minor.patch");
3622
+ var SdkVersionSchema = z27.string().regex(SDK_VERSION_PATTERN, "an sdk version is major.minor.patch");
3568
3623
  var OLDEST_SUPPORTED_SDK = "0.3.0";
3569
3624
  var SDK_SHIMS = {
3570
3625
  /** sdk ≤ 0.3 called the vertical verbs on `useCanvasActions()` — `legacy-canvas-actions.ts`. */
@@ -3610,10 +3665,10 @@ function sdkWindowProblem(builtWithSdk, platformSdk) {
3610
3665
  }
3611
3666
 
3612
3667
  // ../spacestation/src/catalog/wire/host-imports.ts
3613
- import { z as z27 } from "zod";
3614
- var SpecifierSchema = z27.string().min(1).max(200);
3615
- var HostImportsSchema = z27.record(SpecifierSchema, z27.array(z27.string().min(1).max(200)).max(5e3));
3616
- var HostExportsSchema = z27.record(SpecifierSchema, z27.array(z27.string()));
3668
+ import { z as z28 } from "zod";
3669
+ var SpecifierSchema = z28.string().min(1).max(200);
3670
+ var HostImportsSchema = z28.record(SpecifierSchema, z28.array(z28.string().min(1).max(200)).max(5e3));
3671
+ var HostExportsSchema = z28.record(SpecifierSchema, z28.array(z28.string()));
3617
3672
  function hostImportProblems(imports, provided) {
3618
3673
  const problems = [];
3619
3674
  for (const [specifier, names] of Object.entries(imports)) {
@@ -3636,15 +3691,15 @@ function hostImportsRefusal(commit) {
3636
3691
  var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
3637
3692
  var BUNDLE_ASSET_PATH = /^assets\/[A-Za-z0-9_-]+\.(woff2?|ttf|otf|png|jpe?g|svg|gif|webp)$/;
3638
3693
  var RELEASE_MESSAGE_MAX = 140;
3639
- var ReleaseMessageSchema = z28.string().trim().min(1, "say what this release changes").max(RELEASE_MESSAGE_MAX, `keep the message to one line of ${RELEASE_MESSAGE_MAX} characters or fewer`);
3640
- var PackageReleaseSchema = z28.object({
3694
+ var ReleaseMessageSchema = z29.string().trim().min(1, "say what this release changes").max(RELEASE_MESSAGE_MAX, `keep the message to one line of ${RELEASE_MESSAGE_MAX} characters or fewer`);
3695
+ var PackageReleaseSchema = z29.object({
3641
3696
  /** The id spaces name in `componentSources` — an npm-style package name. */
3642
- sourceId: z28.string().regex(/^(@[a-z0-9][a-z0-9-]*\/)?[a-z0-9][a-z0-9-]*$/, "sourceId must be an npm-style package name").refine((id) => !RESERVED_SCOPES.some((scope2) => id.startsWith(scope2)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
3643
- label: z28.string().min(1).max(120),
3697
+ sourceId: z29.string().regex(/^(@[a-z0-9][a-z0-9-]*\/)?[a-z0-9][a-z0-9-]*$/, "sourceId must be an npm-style package name").refine((id) => !RESERVED_SCOPES.some((scope2) => id.startsWith(scope2)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
3698
+ label: z29.string().min(1).max(120),
3644
3699
  /** The package's own version, as its repository states it — shown in the console. */
3645
- version: z28.string().min(1).max(40),
3700
+ version: z29.string().min(1).max(40),
3646
3701
  /** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
3647
- description: z28.string().min(1).max(500).optional(),
3702
+ description: z29.string().min(1).max(500).optional(),
3648
3703
  /**
3649
3704
  * The `@40rty/ams-sdk` version the brand project resolved when `forty
3650
3705
  * publish` built this release. A bundle takes the sdk from the page at
@@ -3664,7 +3719,7 @@ var PackageReleaseSchema = z28.object({
3664
3719
  hostImports: HostImportsSchema.optional(),
3665
3720
  catalog: WireCatalogSchema,
3666
3721
  /** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
3667
- manifests: z28.record(z28.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z28.string()),
3722
+ manifests: z29.record(z29.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z29.string()),
3668
3723
  /**
3669
3724
  * The brand's components, built — present when the PLATFORM hosts this
3670
3725
  * brand's spacefront, absent when the brand hosts it in its own app. One
@@ -3673,17 +3728,17 @@ var PackageReleaseSchema = z28.object({
3673
3728
  * images — base64, keyed by the path the stylesheet's `url()` names, beside
3674
3729
  * it). It is served to browsers; the platform's servers never run it.
3675
3730
  */
3676
- bundle: z28.object({
3677
- js: z28.string().min(1),
3678
- css: z28.string(),
3679
- assets: z28.record(z28.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z28.string().base64()).optional()
3731
+ bundle: z29.object({
3732
+ js: z29.string().min(1),
3733
+ css: z29.string(),
3734
+ assets: z29.record(z29.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z29.string().base64()).optional()
3680
3735
  }).strict().optional(),
3681
3736
  /**
3682
3737
  * The class the spacefront root carries while this package is the space's.
3683
3738
  * The package's own stylesheet styles under it. Absent = the platform's
3684
3739
  * default theme class.
3685
3740
  */
3686
- theme: z28.object({ themeClass: z28.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
3741
+ theme: z29.object({ themeClass: z29.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
3687
3742
  /**
3688
3743
  * The brand's mark (`brand-mark.ts`). Sent as the files themselves; the
3689
3744
  * platform stores them content-addressed at ingest and keeps only their
@@ -3696,7 +3751,7 @@ var PackageReleaseSchema = z28.object({
3696
3751
  * The package's own composition guidance for its own components — prompt
3697
3752
  * markdown the agent reads, gated on the capabilities it names (`requires`).
3698
3753
  */
3699
- promptSections: z28.array(z28.object({ id: z28.string().regex(/^[a-z0-9-]+$/), order: z28.number().int(), content: z28.string().min(1).max(2e4), requires: z28.array(z28.string()) }).strict()).max(10).optional(),
3754
+ promptSections: z29.array(z29.object({ id: z29.string().regex(/^[a-z0-9-]+$/), order: z29.number().int(), content: z29.string().min(1).max(2e4), requires: z29.array(z29.string()) }).strict()).max(10).optional(),
3700
3755
  /**
3701
3756
  * The brand's SPACE prompt — its `prompts/space.md`, verbatim: sections split
3702
3757
  * by `<!-- section:<id> -->` markers, the same format as the platform's
@@ -3704,17 +3759,17 @@ var PackageReleaseSchema = z28.object({
3704
3759
  * package. How the brand speaks, what it sells and what it never claims ship
3705
3760
  * with the brand, and a release changes them with no platform deploy.
3706
3761
  */
3707
- spacePrompt: z28.string().min(1).max(2e5).optional(),
3762
+ spacePrompt: z29.string().min(1).max(2e5).optional(),
3708
3763
  /**
3709
3764
  * Opaque per-vertical extension data (`BrandDefinition.config`): the
3710
3765
  * platform stays vertical-agnostic and the vertical's own code reads its keys.
3711
3766
  */
3712
- config: z28.record(z28.string(), z28.unknown()).optional(),
3767
+ config: z29.record(z29.string(), z29.unknown()).optional(),
3713
3768
  /**
3714
3769
  * Set by the platform, never by a publisher: this release is a DRAFT of the
3715
3770
  * package `of`, previewed on the space `space`. See `draftSourceId`.
3716
3771
  */
3717
- draft: z28.object({ of: z28.string().min(1), space: z28.string().min(1) }).strict().optional()
3772
+ draft: z29.object({ of: z29.string().min(1), space: z29.string().min(1) }).strict().optional()
3718
3773
  }).strict();
3719
3774
  var DRAFT_SEPARATOR = "--";
3720
3775
  function draftSourceId(sourceId, spaceSlug, developer) {
@@ -3733,49 +3788,49 @@ function parseReleasePreview(id) {
3733
3788
  }
3734
3789
 
3735
3790
  // ../spacestation/src/catalog/wire/package-bundle-ref.ts
3736
- import { z as z29 } from "zod";
3737
- var PackageBundleRefSchema = z29.object({
3738
- sourceId: z29.string(),
3739
- js: z29.string(),
3740
- css: z29.string(),
3791
+ import { z as z30 } from "zod";
3792
+ var PackageBundleRefSchema = z30.object({
3793
+ sourceId: z30.string(),
3794
+ js: z30.string(),
3795
+ css: z30.string(),
3741
3796
  /** The brand's name for itself, and its package's version. */
3742
- label: z29.string(),
3743
- version: z29.string(),
3797
+ label: z30.string(),
3798
+ version: z30.string(),
3744
3799
  /** The sdk the bundle was built against (`PackageRelease.builtWithSdk`) — absent for a legacy release. Picks its compat shims. */
3745
3800
  builtWithSdk: SdkVersionSchema.optional()
3746
3801
  });
3747
3802
 
3748
3803
  // ../spacestation/src/projection/projection.ts
3749
- import { z as z30 } from "zod";
3750
- var LateBoundValueSchema = z30.object({ fact: z30.literal(true) });
3751
- var DirectiveValueSchema = z30.union([
3752
- z30.string(),
3753
- z30.number(),
3754
- z30.boolean(),
3804
+ import { z as z31 } from "zod";
3805
+ var LateBoundValueSchema = z31.object({ fact: z31.literal(true) });
3806
+ var DirectiveValueSchema = z31.union([
3807
+ z31.string(),
3808
+ z31.number(),
3809
+ z31.boolean(),
3755
3810
  LateBoundValueSchema
3756
3811
  ]);
3757
3812
  function isLateBound(v) {
3758
3813
  return typeof v === "object" && v !== null && "fact" in v;
3759
3814
  }
3760
- var ProjectionDirectiveSchema = z30.object({
3815
+ var ProjectionDirectiveSchema = z31.object({
3761
3816
  /** Keep only items whose axis values all match. Keyed by axis name
3762
3817
  * (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
3763
- isolateTo: z30.record(DirectiveValueSchema).optional(),
3818
+ isolateTo: z31.record(DirectiveValueSchema).optional(),
3764
3819
  /** Isolate to EVERY axis the visitor has a stored fact for. The agent
3765
3820
  * emits this (it is vertical-agnostic — it cannot name axes); the
3766
3821
  * entity binding expands it against the entity's own axes + facts. */
3767
- isolateToFacts: z30.boolean().optional(),
3822
+ isolateToFacts: z31.boolean().optional(),
3768
3823
  /** Keep only items the entity binding reports as available. */
3769
- availableOnly: z30.boolean().optional(),
3824
+ availableOnly: z31.boolean().optional(),
3770
3825
  /** Cap the rendered count after filtering. */
3771
- limit: z30.number().int().positive().optional()
3826
+ limit: z31.number().int().positive().optional()
3772
3827
  });
3773
- var ProjectionPreferencesSchema = z30.record(
3774
- z30.union([ProjectionDirectiveSchema, z30.null()])
3828
+ var ProjectionPreferencesSchema = z31.record(
3829
+ z31.union([ProjectionDirectiveSchema, z31.null()])
3775
3830
  );
3776
3831
  var PROJECTION_SET_SIGNAL = "projection.set";
3777
- var ProjectionSetPayloadSchema = z30.object({
3778
- setAll: z30.union([ProjectionDirectiveSchema, z30.null()]).optional(),
3832
+ var ProjectionSetPayloadSchema = z31.object({
3833
+ setAll: z31.union([ProjectionDirectiveSchema, z31.null()]).optional(),
3779
3834
  set: ProjectionPreferencesSchema.optional()
3780
3835
  });
3781
3836
  function norm(v) {
@@ -3809,14 +3864,14 @@ function isActiveDirective(directive) {
3809
3864
  }
3810
3865
 
3811
3866
  // ../spacestation/src/host/host-page.ts
3812
- import { z as z31 } from "zod";
3867
+ import { z as z32 } from "zod";
3813
3868
  var VIEW_HOST_SIGNAL = "view.host";
3814
- var HostPayloadSchema = z31.object({
3869
+ var HostPayloadSchema = z32.object({
3815
3870
  page: PageSchema.nullable(),
3816
- maxSections: z31.number().int().positive().nullable(),
3817
- surface: z31.enum(["page", "slot"])
3871
+ maxSections: z32.number().int().positive().nullable(),
3872
+ surface: z32.enum(["page", "slot"])
3818
3873
  });
3819
- var HostClearedSchema = z31.object({ cleared: z31.literal(true) });
3874
+ var HostClearedSchema = z32.object({ cleared: z32.literal(true) });
3820
3875
  var HOST_CLEARED = { cleared: true };
3821
3876
  function hostFillsPage(host) {
3822
3877
  return host.surface === "page";
@@ -3830,23 +3885,23 @@ function pagePlace(page) {
3830
3885
  }
3831
3886
 
3832
3887
  // ../spacestation/src/focus/focus.ts
3833
- import { z as z32 } from "zod";
3888
+ import { z as z33 } from "zod";
3834
3889
  var VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
3835
- var FocusElementPayloadSchema = z32.object({
3836
- elementId: z32.string().min(1)
3890
+ var FocusElementPayloadSchema = z33.object({
3891
+ elementId: z33.string().min(1)
3837
3892
  });
3838
3893
 
3839
3894
  // ../spacestation/src/view/continuation.ts
3840
- import { z as z33 } from "zod";
3895
+ import { z as z34 } from "zod";
3841
3896
  var VIEW_EXTEND_SIGNAL = "view.extend";
3842
- var ViewExtendPayloadSchema = z33.object({
3843
- reason: z33.enum(["scroll_near_bottom"])
3897
+ var ViewExtendPayloadSchema = z34.object({
3898
+ reason: z34.enum(["scroll_near_bottom"])
3844
3899
  });
3845
3900
  var VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
3846
3901
  var CONTINUATION_ENABLED = false;
3847
3902
 
3848
3903
  // ../spacestation/src/attachment/attachment.ts
3849
- import { z as z34 } from "zod";
3904
+ import { z as z35 } from "zod";
3850
3905
  var ALLOWED_ATTACHMENT_TYPES = [
3851
3906
  "image/jpeg",
3852
3907
  "image/png",
@@ -3861,18 +3916,18 @@ function isAllowedAttachmentType(mime) {
3861
3916
  function isImageAttachment(mime) {
3862
3917
  return mime.startsWith("image/");
3863
3918
  }
3864
- var AttachmentRefSchema = z34.object({
3919
+ var AttachmentRefSchema = z35.object({
3865
3920
  // A UUID, as `storeAttachment` mints it: the id becomes a storage path segment,
3866
3921
  // so nothing else — no `/`, no `..` — may reach that lookup.
3867
- id: z34.string().uuid(),
3868
- mimeType: z34.string().refine(isAllowedAttachmentType, {
3922
+ id: z35.string().uuid(),
3923
+ mimeType: z35.string().refine(isAllowedAttachmentType, {
3869
3924
  message: "mimeType not on the attachment allow-list"
3870
3925
  }),
3871
- name: z34.string().min(1),
3872
- size: z34.number().int().positive().max(MAX_ATTACHMENT_BYTES),
3873
- url: z34.string().min(1)
3926
+ name: z35.string().min(1),
3927
+ size: z35.number().int().positive().max(MAX_ATTACHMENT_BYTES),
3928
+ url: z35.string().min(1)
3874
3929
  });
3875
- var AttachmentRefsSchema = z34.array(AttachmentRefSchema);
3930
+ var AttachmentRefsSchema = z35.array(AttachmentRefSchema);
3876
3931
 
3877
3932
  // ../spacestation/src/attachment/attachment-failure.ts
3878
3933
  var MAX_ATTACHMENT_MB = Math.round(MAX_ATTACHMENT_BYTES / (1024 * 1024));
@@ -3891,22 +3946,22 @@ function attachmentFailureOfStatus(status, mimeType) {
3891
3946
  }
3892
3947
 
3893
3948
  // ../spacestation/src/contracts/entry-context.ts
3894
- import { z as z35 } from "zod";
3949
+ import { z as z36 } from "zod";
3895
3950
  var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
3896
3951
  var ENTRY_CONTEXT_MAX_KEYS = 12;
3897
3952
  var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
3898
3953
  var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
3899
- var EntryContextValueSchema = z35.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
3900
- var EntryContextNameSchema = z35.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
3901
- var EntryContextNamespaceSchema = z35.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
3954
+ var EntryContextValueSchema = z36.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
3955
+ var EntryContextNameSchema = z36.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
3956
+ var EntryContextNamespaceSchema = z36.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
3902
3957
  message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
3903
3958
  });
3904
- var EntryContextSchema = z35.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
3959
+ var EntryContextSchema = z36.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
3905
3960
  message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
3906
3961
  });
3907
3962
 
3908
3963
  // ../spacestation/src/contracts/session-arrival.ts
3909
- import { z as z36 } from "zod";
3964
+ import { z as z37 } from "zod";
3910
3965
  var SURFACES = [
3911
3966
  "spacefront",
3912
3967
  "embed",
@@ -3916,11 +3971,11 @@ var SURFACES = [
3916
3971
  "playground",
3917
3972
  "automation"
3918
3973
  ];
3919
- var SurfaceSchema = z36.enum(SURFACES);
3974
+ var SurfaceSchema = z37.enum(SURFACES);
3920
3975
  var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
3921
- var ClickIdKindSchema = z36.enum(CLICK_ID_KINDS);
3976
+ var ClickIdKindSchema = z37.enum(CLICK_ID_KINDS);
3922
3977
  var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
3923
- var VisitorIdDurabilitySchema = z36.enum(VISITOR_ID_DURABILITIES);
3978
+ var VisitorIdDurabilitySchema = z37.enum(VISITOR_ID_DURABILITIES);
3924
3979
  var TRAFFIC_BUCKETS = [
3925
3980
  "paid_google",
3926
3981
  "paid_meta",
@@ -3932,10 +3987,10 @@ var TRAFFIC_BUCKETS = [
3932
3987
  "direct",
3933
3988
  "unknown"
3934
3989
  ];
3935
- var TrafficBucketSchema = z36.enum(TRAFFIC_BUCKETS);
3990
+ var TrafficBucketSchema = z37.enum(TRAFFIC_BUCKETS);
3936
3991
  var ARRIVAL_MAX_VALUE_CHARS = 200;
3937
- var ArrivalValueSchema = z36.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
3938
- var SessionArrivalSchema = z36.object({
3992
+ var ArrivalValueSchema = z37.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
3993
+ var SessionArrivalSchema = z37.object({
3939
3994
  utmSource: ArrivalValueSchema.optional(),
3940
3995
  utmMedium: ArrivalValueSchema.optional(),
3941
3996
  utmCampaign: ArrivalValueSchema.optional(),
@@ -4050,36 +4105,36 @@ var WIRE_PROTOCOL_PARAM = "protocol";
4050
4105
  var WIRE_PROTOCOL_UNSUPPORTED_CLOSE = 4426;
4051
4106
 
4052
4107
  // ../spacestation/src/catalog/attribute-registry.ts
4053
- import { z as z37 } from "zod";
4054
- var AttributeScopeBucketSchema = z37.object({
4055
- scope: z37.string(),
4056
- needles: z37.array(z37.string()).readonly(),
4057
- label: z37.string().optional()
4108
+ import { z as z38 } from "zod";
4109
+ var AttributeScopeBucketSchema = z38.object({
4110
+ scope: z38.string(),
4111
+ needles: z38.array(z38.string()).readonly(),
4112
+ label: z38.string().optional()
4058
4113
  });
4059
- var AttributeScopeConfigSchema = z37.object({
4060
- facet: z37.string(),
4061
- buckets: z37.array(AttributeScopeBucketSchema).readonly(),
4062
- emptyScope: z37.string(),
4063
- noMatchScope: z37.string(),
4064
- ignoreValues: z37.array(z37.string()).readonly(),
4065
- emptyScopeLabel: z37.string().optional(),
4066
- noMatchScopeLabel: z37.string().optional()
4114
+ var AttributeScopeConfigSchema = z38.object({
4115
+ facet: z38.string(),
4116
+ buckets: z38.array(AttributeScopeBucketSchema).readonly(),
4117
+ emptyScope: z38.string(),
4118
+ noMatchScope: z38.string(),
4119
+ ignoreValues: z38.array(z38.string()).readonly(),
4120
+ emptyScopeLabel: z38.string().optional(),
4121
+ noMatchScopeLabel: z38.string().optional()
4067
4122
  });
4068
- var AttributeDefBaseSchema = z37.object({
4069
- description: z37.string().optional(),
4070
- durable: z37.boolean().optional(),
4071
- label: z37.string().optional()
4123
+ var AttributeDefBaseSchema = z38.object({
4124
+ description: z38.string().optional(),
4125
+ durable: z38.boolean().optional(),
4126
+ label: z38.string().optional()
4072
4127
  });
4073
- var AttributeDefSchema = z37.discriminatedUnion("kind", [
4074
- AttributeDefBaseSchema.extend({ kind: z37.literal("enum"), values: z37.array(z37.string()) }),
4075
- AttributeDefBaseSchema.extend({ kind: z37.literal("free_text") }),
4076
- AttributeDefBaseSchema.extend({ kind: z37.literal("date_or_season") }),
4077
- AttributeDefBaseSchema.extend({ kind: z37.literal("money_or_band") }),
4128
+ var AttributeDefSchema = z38.discriminatedUnion("kind", [
4129
+ AttributeDefBaseSchema.extend({ kind: z38.literal("enum"), values: z38.array(z38.string()) }),
4130
+ AttributeDefBaseSchema.extend({ kind: z38.literal("free_text") }),
4131
+ AttributeDefBaseSchema.extend({ kind: z38.literal("date_or_season") }),
4132
+ AttributeDefBaseSchema.extend({ kind: z38.literal("money_or_band") }),
4078
4133
  AttributeDefBaseSchema.extend({
4079
- kind: z37.literal("number"),
4080
- min: z37.number().optional(),
4081
- max: z37.number().optional(),
4082
- unit: z37.string().optional()
4134
+ kind: z38.literal("number"),
4135
+ min: z38.number().optional(),
4136
+ max: z38.number().optional(),
4137
+ unit: z38.string().optional()
4083
4138
  })
4084
4139
  ]);
4085
4140
  var EXTRAS_PREFIX = "extras.";
@@ -4118,59 +4173,59 @@ function scopeOfAttributeKey(config, key) {
4118
4173
  }
4119
4174
 
4120
4175
  // ../spacestation/src/space/agent-directive.ts
4121
- import { z as z38 } from "zod";
4176
+ import { z as z39 } from "zod";
4122
4177
  var MAX_ACTIVE_AGENT_DIRECTIVES = 20;
4123
4178
  var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
4124
4179
  var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
4125
4180
  var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
4126
4181
  var AGENT_DIRECTIVE_STATUSES = ["proposed", "active", "rejected", "retired"];
4127
- var AgentDirectiveSchema = z38.object({
4128
- name: z38.string().trim().min(1).max(80),
4129
- kind: z38.enum(AGENT_DIRECTIVE_KINDS),
4130
- severity: z38.enum(AGENT_DIRECTIVE_SEVERITIES),
4182
+ var AgentDirectiveSchema = z39.object({
4183
+ name: z39.string().trim().min(1).max(80),
4184
+ kind: z39.enum(AGENT_DIRECTIVE_KINDS),
4185
+ severity: z39.enum(AGENT_DIRECTIVE_SEVERITIES),
4131
4186
  /** No bare URL: a URL is a hallucination surface, and a handle is not a
4132
4187
  * product name. */
4133
- text: z38.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
4188
+ text: z39.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
4134
4189
  }).strict();
4135
- var SpaceAgentDirectiveSchema = z38.object({
4136
- id: z38.string(),
4137
- position: z38.number().int(),
4138
- name: z38.string(),
4139
- kind: z38.enum(AGENT_DIRECTIVE_KINDS),
4140
- severity: z38.enum(AGENT_DIRECTIVE_SEVERITIES),
4141
- text: z38.string(),
4142
- source: z38.enum(AGENT_DIRECTIVE_SOURCES),
4143
- status: z38.enum(AGENT_DIRECTIVE_STATUSES),
4190
+ var SpaceAgentDirectiveSchema = z39.object({
4191
+ id: z39.string(),
4192
+ position: z39.number().int(),
4193
+ name: z39.string(),
4194
+ kind: z39.enum(AGENT_DIRECTIVE_KINDS),
4195
+ severity: z39.enum(AGENT_DIRECTIVE_SEVERITIES),
4196
+ text: z39.string(),
4197
+ source: z39.enum(AGENT_DIRECTIVE_SOURCES),
4198
+ status: z39.enum(AGENT_DIRECTIVE_STATUSES),
4144
4199
  /** Who wrote it; null for a lesson the system proposed. */
4145
- createdBy: z38.string().nullable(),
4200
+ createdBy: z39.string().nullable(),
4146
4201
  /** Why a mined lesson was proposed; null for a directive a person wrote. */
4147
- evidence: z38.record(z38.unknown()).nullable(),
4148
- decidedBy: z38.string().nullable(),
4149
- decidedAt: z38.string().nullable(),
4150
- createdAt: z38.string()
4202
+ evidence: z39.record(z39.unknown()).nullable(),
4203
+ decidedBy: z39.string().nullable(),
4204
+ decidedAt: z39.string().nullable(),
4205
+ createdAt: z39.string()
4151
4206
  });
4152
- var OutcomeTallySchema = z38.object({ turns: z38.number().int(), acted: z38.number().int() });
4207
+ var OutcomeTallySchema = z39.object({ turns: z39.number().int(), acted: z39.number().int() });
4153
4208
  var SpaceAgentDirectiveListItemSchema = SpaceAgentDirectiveSchema.extend({
4154
- impact: z38.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
4209
+ impact: z39.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
4155
4210
  });
4156
- var UpdateAgentDirectiveInputSchema = z38.object({
4211
+ var UpdateAgentDirectiveInputSchema = z39.object({
4157
4212
  name: AgentDirectiveSchema.shape.name.optional(),
4158
4213
  kind: AgentDirectiveSchema.shape.kind.optional(),
4159
4214
  severity: AgentDirectiveSchema.shape.severity.optional(),
4160
4215
  text: AgentDirectiveSchema.shape.text.optional(),
4161
- status: z38.enum(AGENT_DIRECTIVE_STATUSES).optional()
4216
+ status: z39.enum(AGENT_DIRECTIVE_STATUSES).optional()
4162
4217
  }).strict();
4163
- var ReorderAgentDirectivesInputSchema = z38.object({ ids: z38.array(z38.string()).min(1) }).strict();
4218
+ var ReorderAgentDirectivesInputSchema = z39.object({ ids: z39.array(z39.string()).min(1) }).strict();
4164
4219
 
4165
4220
  // ../spacestation/src/shell/bot-check-notice.ts
4166
- import { z as z39 } from "zod";
4167
- var BotCheckNoticeSchema = z39.object({
4221
+ import { z as z40 } from "zod";
4222
+ var BotCheckNoticeSchema = z40.object({
4168
4223
  /** Read in order: plain text, and links the notice must keep linked. */
4169
- segments: z39.array(z39.union([z39.string(), z39.object({ text: z39.string(), href: z39.string().url() })])).min(1)
4224
+ segments: z40.array(z40.union([z40.string(), z40.object({ text: z40.string(), href: z40.string().url() })])).min(1)
4170
4225
  });
4171
4226
 
4172
4227
  // ../spacestation/src/space/space-locale.ts
4173
- import { z as z40 } from "zod";
4228
+ import { z as z41 } from "zod";
4174
4229
  var DEFAULT_SPACE_LOCALE = "en-US";
4175
4230
  function isBcp47(tag) {
4176
4231
  try {
@@ -4180,7 +4235,7 @@ function isBcp47(tag) {
4180
4235
  throw err;
4181
4236
  }
4182
4237
  }
4183
- var SpaceLocaleSchema = z40.string().refine(isBcp47, { message: "locale must be a BCP 47 language tag, e.g. he-IL" });
4238
+ var SpaceLocaleSchema = z41.string().refine(isBcp47, { message: "locale must be a BCP 47 language tag, e.g. he-IL" });
4184
4239
  var RTL_SCRIPTS = /* @__PURE__ */ new Set(["Arab", "Hebr", "Thaa", "Syrc", "Nkoo", "Adlm", "Rohg", "Mand", "Samr"]);
4185
4240
  var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb", "syr"]);
4186
4241
  function textDirectionOf(locale) {
@@ -4270,30 +4325,30 @@ function hostingAllows(hosting, surface) {
4270
4325
  }
4271
4326
 
4272
4327
  // ../spacestation/src/space/trace.ts
4273
- import { z as z41 } from "zod";
4274
- var RunTokenUsageSchema = z41.object({
4275
- input_tokens: z41.number().optional(),
4276
- output_tokens: z41.number().optional(),
4277
- cache_read_tokens: z41.number().optional()
4328
+ import { z as z42 } from "zod";
4329
+ var RunTokenUsageSchema = z42.object({
4330
+ input_tokens: z42.number().optional(),
4331
+ output_tokens: z42.number().optional(),
4332
+ cache_read_tokens: z42.number().optional()
4278
4333
  });
4279
- var TraceRecordSchema = z41.object({
4280
- id: z41.string().uuid(),
4281
- spaceId: z41.string().uuid().nullable(),
4282
- sessionId: z41.string(),
4334
+ var TraceRecordSchema = z42.object({
4335
+ id: z42.string().uuid(),
4336
+ spaceId: z42.string().uuid().nullable(),
4337
+ sessionId: z42.string(),
4283
4338
  /** OTP-verified visitor email the session was unlocked with, or `null`
4284
4339
  * for an unlocked space / anonymous unlock. */
4285
- visitorEmail: z41.string().nullable(),
4286
- userPrompt: z41.string(),
4287
- branch: z41.string().nullable(),
4288
- responseText: z41.string().nullable(),
4289
- layout: z41.unknown().nullable(),
4290
- phaseTimings: z41.record(z41.number()).nullable(),
4291
- tokensByModel: z41.record(RunTokenUsageSchema).nullable(),
4292
- toolCalls: z41.array(z41.unknown()).nullable(),
4293
- diagnostics: z41.array(z41.unknown()).nullable(),
4294
- latencyFirstText: z41.number().int().nullable(),
4295
- latencyFirstPatch: z41.number().int().nullable(),
4296
- latencyTotal: z41.number().int().nullable(),
4340
+ visitorEmail: z42.string().nullable(),
4341
+ userPrompt: z42.string(),
4342
+ branch: z42.string().nullable(),
4343
+ responseText: z42.string().nullable(),
4344
+ layout: z42.unknown().nullable(),
4345
+ phaseTimings: z42.record(z42.number()).nullable(),
4346
+ tokensByModel: z42.record(RunTokenUsageSchema).nullable(),
4347
+ toolCalls: z42.array(z42.unknown()).nullable(),
4348
+ diagnostics: z42.array(z42.unknown()).nullable(),
4349
+ latencyFirstText: z42.number().int().nullable(),
4350
+ latencyFirstPatch: z42.number().int().nullable(),
4351
+ latencyTotal: z42.number().int().nullable(),
4297
4352
  /**
4298
4353
  * The CLIENT's turn id for this run, or `null`.
4299
4354
  *
@@ -4309,29 +4364,29 @@ var TraceRecordSchema = z41.object({
4309
4364
  * a turn whose ack the client never saw — none of which is evidence that a
4310
4365
  * visitor asked something and got nothing.
4311
4366
  */
4312
- turnId: z41.string().nullable(),
4367
+ turnId: z42.string().nullable(),
4313
4368
  /** Serialized `TraceTracker.exportState()` payload (parsed object) —
4314
4369
  * lets the inspector rehydrate this run verbatim after a reload. */
4315
- trackerState: z41.unknown().nullable(),
4316
- createdAt: z41.string()
4370
+ trackerState: z42.unknown().nullable(),
4371
+ createdAt: z42.string()
4317
4372
  });
4318
- var MillisecondsSchema = z41.number().nullable().transform((v) => v === null ? null : Math.round(v));
4319
- var CreateTraceInputSchema = z41.object({
4320
- spaceId: z41.string().uuid().nullable(),
4321
- sessionId: z41.string(),
4322
- visitorEmail: z41.string().nullable(),
4323
- userPrompt: z41.string(),
4324
- branch: z41.string().nullable(),
4325
- responseText: z41.string().nullable(),
4326
- layout: z41.unknown().nullable(),
4327
- phaseTimings: z41.record(z41.number()).nullable(),
4328
- tokensByModel: z41.record(RunTokenUsageSchema).nullable(),
4329
- toolCalls: z41.array(z41.unknown()).nullable(),
4330
- diagnostics: z41.array(z41.unknown()).nullable(),
4373
+ var MillisecondsSchema = z42.number().nullable().transform((v) => v === null ? null : Math.round(v));
4374
+ var CreateTraceInputSchema = z42.object({
4375
+ spaceId: z42.string().uuid().nullable(),
4376
+ sessionId: z42.string(),
4377
+ visitorEmail: z42.string().nullable(),
4378
+ userPrompt: z42.string(),
4379
+ branch: z42.string().nullable(),
4380
+ responseText: z42.string().nullable(),
4381
+ layout: z42.unknown().nullable(),
4382
+ phaseTimings: z42.record(z42.number()).nullable(),
4383
+ tokensByModel: z42.record(RunTokenUsageSchema).nullable(),
4384
+ toolCalls: z42.array(z42.unknown()).nullable(),
4385
+ diagnostics: z42.array(z42.unknown()).nullable(),
4331
4386
  latencyFirstText: MillisecondsSchema,
4332
4387
  latencyFirstPatch: MillisecondsSchema,
4333
4388
  latencyTotal: MillisecondsSchema,
4334
- trackerState: z41.unknown().nullable(),
4389
+ trackerState: z42.unknown().nullable(),
4335
4390
  /**
4336
4391
  * The CLIENT's turn id for this run, or `null`.
4337
4392
  *
@@ -4347,37 +4402,37 @@ var CreateTraceInputSchema = z41.object({
4347
4402
  * a turn whose ack the client never saw — none of which is evidence that a
4348
4403
  * visitor asked something and got nothing.
4349
4404
  */
4350
- turnId: z41.string().nullable()
4405
+ turnId: z42.string().nullable()
4351
4406
  });
4352
- var AgentSessionSummarySchema = z41.object({
4353
- sessionId: z41.string(),
4407
+ var AgentSessionSummarySchema = z42.object({
4408
+ sessionId: z42.string(),
4354
4409
  /** Turn rows only; background/secondary runs are excluded by the aggregate. */
4355
- turnCount: z41.number().int(),
4410
+ turnCount: z42.number().int(),
4356
4411
  /** The session's opening prompt — titles the row in the UI. */
4357
- firstPrompt: z41.string(),
4358
- startedAt: z41.string(),
4359
- lastRunAt: z41.string(),
4412
+ firstPrompt: z42.string(),
4413
+ startedAt: z42.string(),
4414
+ lastRunAt: z42.string(),
4360
4415
  /** Summed `latency_total` across the session's turns. */
4361
- totalLatencyMs: z41.number().int()
4416
+ totalLatencyMs: z42.number().int()
4362
4417
  });
4363
- var SessionTurnSchema = z41.object({
4364
- id: z41.string().uuid(),
4365
- userPrompt: z41.string(),
4366
- responseText: z41.string().nullable(),
4418
+ var SessionTurnSchema = z42.object({
4419
+ id: z42.string().uuid(),
4420
+ userPrompt: z42.string(),
4421
+ responseText: z42.string().nullable(),
4367
4422
  /** Full cumulative Spec committed by this turn — never a patch delta. */
4368
- layout: z41.unknown().nullable(),
4369
- createdAt: z41.string(),
4370
- latencyTotal: z41.number().int().nullable(),
4371
- phaseTimings: z41.record(z41.number()).nullable(),
4372
- tokensByModel: z41.record(z41.object({
4373
- input_tokens: z41.number().optional(),
4374
- output_tokens: z41.number().optional()
4423
+ layout: z42.unknown().nullable(),
4424
+ createdAt: z42.string(),
4425
+ latencyTotal: z42.number().int().nullable(),
4426
+ phaseTimings: z42.record(z42.number()).nullable(),
4427
+ tokensByModel: z42.record(z42.object({
4428
+ input_tokens: z42.number().optional(),
4429
+ output_tokens: z42.number().optional()
4375
4430
  })).nullable(),
4376
- toolCalls: z41.array(z41.unknown()).nullable(),
4377
- diagnostics: z41.array(z41.unknown()).nullable()
4431
+ toolCalls: z42.array(z42.unknown()).nullable(),
4432
+ diagnostics: z42.array(z42.unknown()).nullable()
4378
4433
  });
4379
- var SessionReplaySchema = z41.object({
4380
- turns: z41.array(SessionTurnSchema),
4434
+ var SessionReplaySchema = z42.object({
4435
+ turns: z42.array(SessionTurnSchema),
4381
4436
  /**
4382
4437
  * The session's own last-committed layout, read straight off the durable
4383
4438
  * session record (`sessions.blob.layout`) rather than derived from `turns`.
@@ -4388,20 +4443,20 @@ var SessionReplaySchema = z41.object({
4388
4443
  * a perfectly real layout; only this field can show it. Null exclusively
4389
4444
  * when the durable session row itself could not be read.
4390
4445
  */
4391
- sessionLayout: z41.record(z41.string(), z41.unknown()).nullable()
4446
+ sessionLayout: z42.record(z42.string(), z42.unknown()).nullable()
4392
4447
  });
4393
- var SessionTraceSchema = z41.object({
4394
- trackerState: z41.string().nullable()
4448
+ var SessionTraceSchema = z42.object({
4449
+ trackerState: z42.string().nullable()
4395
4450
  });
4396
- var LlmUsageDailySchema = z41.object({
4397
- day: z41.string(),
4451
+ var LlmUsageDailySchema = z42.object({
4452
+ day: z42.string(),
4398
4453
  /** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
4399
- environment: z41.string(),
4400
- feature: z41.string(),
4401
- model: z41.string(),
4402
- provider: z41.string(),
4454
+ environment: z42.string(),
4455
+ feature: z42.string(),
4456
+ model: z42.string(),
4457
+ provider: z42.string(),
4403
4458
  /** Masked tail of the key actually billed, or null when unknown/non-Google. */
4404
- keyFingerprint: z41.string().nullable(),
4459
+ keyFingerprint: z42.string().nullable(),
4405
4460
  /**
4406
4461
  * The space the call served, or null when it served none.
4407
4462
  *
@@ -4410,91 +4465,91 @@ var LlmUsageDailySchema = z41.object({
4410
4465
  * report that share rather than dropping it, or a per-space total reads as
4411
4466
  * the platform total.
4412
4467
  */
4413
- spaceId: z41.string().nullable(),
4468
+ spaceId: z42.string().nullable(),
4414
4469
  /**
4415
4470
  * The surface of the session the call served (`sessions.surface`), or null
4416
4471
  * when it served no session or the session predates surface recording.
4417
4472
  * `automation` is the eval harness — the signal that files an ordinary
4418
4473
  * `agent-turn` as testing spend rather than as a visitor's.
4419
4474
  */
4420
- surface: z41.string().nullable(),
4421
- inputTokens: z41.number(),
4422
- outputTokens: z41.number(),
4475
+ surface: z42.string().nullable(),
4476
+ inputTokens: z42.number(),
4477
+ outputTokens: z42.number(),
4423
4478
  /** Subset of inputTokens, never additional to it. */
4424
- cachedInputTokens: z41.number(),
4425
- reasoningTokens: z41.number(),
4426
- callCount: z41.number(),
4427
- errorCount: z41.number(),
4428
- estimatedCostUsd: z41.number().nullable()
4479
+ cachedInputTokens: z42.number(),
4480
+ reasoningTokens: z42.number(),
4481
+ callCount: z42.number(),
4482
+ errorCount: z42.number(),
4483
+ estimatedCostUsd: z42.number().nullable()
4429
4484
  });
4430
- var LlmUsageBySessionSchema = z41.object({
4431
- sessionId: z41.string(),
4432
- environment: z41.string(),
4433
- model: z41.string(),
4485
+ var LlmUsageBySessionSchema = z42.object({
4486
+ sessionId: z42.string(),
4487
+ environment: z42.string(),
4488
+ model: z42.string(),
4434
4489
  /** The space this session belongs to, or null for a session with no space. */
4435
- spaceId: z41.string().nullable(),
4490
+ spaceId: z42.string().nullable(),
4436
4491
  /** The session's surface — see `LlmUsageDailySchema.surface`. */
4437
- surface: z41.string().nullable(),
4492
+ surface: z42.string().nullable(),
4438
4493
  /** Label only — the first feature seen in the session. */
4439
- firstFeature: z41.string(),
4440
- startedAt: z41.string(),
4441
- endedAt: z41.string(),
4442
- inputTokens: z41.number(),
4443
- outputTokens: z41.number(),
4444
- cachedInputTokens: z41.number(),
4445
- reasoningTokens: z41.number(),
4446
- callCount: z41.number(),
4447
- errorCount: z41.number(),
4494
+ firstFeature: z42.string(),
4495
+ startedAt: z42.string(),
4496
+ endedAt: z42.string(),
4497
+ inputTokens: z42.number(),
4498
+ outputTokens: z42.number(),
4499
+ cachedInputTokens: z42.number(),
4500
+ reasoningTokens: z42.number(),
4501
+ callCount: z42.number(),
4502
+ errorCount: z42.number(),
4448
4503
  /** Priced server-side, like the daily rollup — the browser never carries a
4449
4504
  * rate table, so there is exactly one place a price can be wrong. Null when
4450
4505
  * the model is unpriced; never 0, which would read as free. */
4451
- estimatedCostUsd: z41.number().nullable()
4506
+ estimatedCostUsd: z42.number().nullable()
4452
4507
  });
4453
- var LlmSessionsDailySchema = z41.object({
4454
- day: z41.string(),
4455
- environment: z41.string(),
4456
- sessionCount: z41.number()
4508
+ var LlmSessionsDailySchema = z42.object({
4509
+ day: z42.string(),
4510
+ environment: z42.string(),
4511
+ sessionCount: z42.number()
4457
4512
  });
4458
4513
 
4459
4514
  // ../spacestation/src/space/session-queue.ts
4460
- import { z as z43 } from "zod";
4515
+ import { z as z44 } from "zod";
4461
4516
 
4462
4517
  // ../spacestation/src/space/session-activity.ts
4463
- import { z as z42 } from "zod";
4464
- var SessionActivityEventSchema = z42.object({
4465
- id: z42.string(),
4466
- kind: z42.string(),
4467
- occurredAt: z42.string(),
4468
- source: z42.string(),
4469
- surface: z42.string(),
4470
- payload: z42.record(z42.unknown())
4518
+ import { z as z43 } from "zod";
4519
+ var SessionActivityEventSchema = z43.object({
4520
+ id: z43.string(),
4521
+ kind: z43.string(),
4522
+ occurredAt: z43.string(),
4523
+ source: z43.string(),
4524
+ surface: z43.string(),
4525
+ payload: z43.record(z43.unknown())
4471
4526
  });
4472
- var SessionActivitySchema = z42.object({
4473
- events: z42.array(SessionActivityEventSchema),
4474
- hasMore: z42.boolean()
4527
+ var SessionActivitySchema = z43.object({
4528
+ events: z43.array(SessionActivityEventSchema),
4529
+ hasMore: z43.boolean()
4475
4530
  });
4476
4531
 
4477
4532
  // ../spacestation/src/space/session-queue.ts
4478
- var SessionVerdictSchema = z43.enum(["unreviewed", "viewed", "bug"]);
4479
- var RecordableVerdictSchema = z43.enum(["viewed", "bug"]);
4480
- var SessionReviewEventSchema = z43.object({
4481
- id: z43.string().uuid(),
4533
+ var SessionVerdictSchema = z44.enum(["unreviewed", "viewed", "bug"]);
4534
+ var RecordableVerdictSchema = z44.enum(["viewed", "bug"]);
4535
+ var SessionReviewEventSchema = z44.object({
4536
+ id: z44.string().uuid(),
4482
4537
  verdict: RecordableVerdictSchema,
4483
4538
  /** Account email of the operator who judged it. Attribution is the reason the
4484
4539
  * log is append-only rather than a mutable current-state row. */
4485
- reviewer: z43.string(),
4486
- note: z43.string().nullable(),
4487
- createdAt: z43.string()
4540
+ reviewer: z44.string(),
4541
+ note: z44.string().nullable(),
4542
+ createdAt: z44.string()
4488
4543
  });
4489
- var BugSeveritySchema = z43.enum(["high", "medium", "low"]);
4490
- var BugLocationSchema = z43.object({
4491
- elementId: z43.string().nullable(),
4544
+ var BugSeveritySchema = z44.enum(["high", "medium", "low"]);
4545
+ var BugLocationSchema = z44.object({
4546
+ elementId: z44.string().nullable(),
4492
4547
  /** Display only — the catalog component type, e.g. "productGrid". Null
4493
4548
  * alongside a null `elementId`. */
4494
- elementType: z43.string().nullable(),
4549
+ elementType: z44.string().nullable(),
4495
4550
  /** Fraction of the ELEMENT's own box. Null for a page anchor. */
4496
- offsetXPct: z43.number().min(0).max(100).nullable(),
4497
- offsetYPct: z43.number().min(0).max(100).nullable(),
4551
+ offsetXPct: z44.number().min(0).max(100).nullable(),
4552
+ offsetYPct: z44.number().min(0).max(100).nullable(),
4498
4553
  /**
4499
4554
  * ABSOLUTE document pixels, for a pin with no element under it. Null for an
4500
4555
  * element anchor.
@@ -4505,8 +4560,8 @@ var BugLocationSchema = z43.object({
4505
4560
  * on the page with it. Measured before this was fixed: growing the page 9%
4506
4561
  * slid a pin 32px, so a pin ran away from the cursor reaching for it.
4507
4562
  */
4508
- pageX: z43.number().nullable(),
4509
- pageY: z43.number().nullable()
4563
+ pageX: z44.number().nullable(),
4564
+ pageY: z44.number().nullable()
4510
4565
  }).refine(
4511
4566
  (loc) => {
4512
4567
  const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
@@ -4520,24 +4575,24 @@ var BugLocationSchema = z43.object({
4520
4575
  message: "location must be one complete anchor: an element (elementId + elementType + both offsets), a page position (pageX + pageY), or a legacy page fraction (both offsets)"
4521
4576
  }
4522
4577
  );
4523
- var SessionBugSchema = z43.object({
4524
- id: z43.string().uuid(),
4578
+ var SessionBugSchema = z44.object({
4579
+ id: z44.string().uuid(),
4525
4580
  /** 1-based turn the fault was observed on; null when the fault is session-wide. */
4526
- turnIndex: z43.number().int().nullable(),
4581
+ turnIndex: z44.number().int().nullable(),
4527
4582
  /** Where on that turn's canvas the pin was dropped; null for a bug filed
4528
4583
  * without pinning a spot. */
4529
4584
  location: BugLocationSchema.nullable(),
4530
- provider: z43.string(),
4531
- issueKey: z43.string().nullable(),
4532
- issueUrl: z43.string().nullable(),
4585
+ provider: z44.string(),
4586
+ issueKey: z44.string().nullable(),
4587
+ issueUrl: z44.string().nullable(),
4533
4588
  /** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
4534
4589
  * open text. Null until first synced. */
4535
- issueState: z43.string().nullable(),
4536
- title: z43.string(),
4537
- body: z43.string(),
4590
+ issueState: z44.string().nullable(),
4591
+ title: z44.string(),
4592
+ body: z44.string(),
4538
4593
  severity: BugSeveritySchema,
4539
- createdBy: z43.string(),
4540
- createdAt: z43.string(),
4594
+ createdBy: z44.string(),
4595
+ createdAt: z44.string(),
4541
4596
  /**
4542
4597
  * When this bug was resolved from the console; null means still OPEN.
4543
4598
  *
@@ -4546,60 +4601,60 @@ var SessionBugSchema = z43.object({
4546
4601
  * whether a particular fault is still live. The timestamp IS the state, so
4547
4602
  * no boolean can contradict it.
4548
4603
  */
4549
- resolvedAt: z43.string().nullable(),
4550
- resolvedBy: z43.string().nullable()
4604
+ resolvedAt: z44.string().nullable(),
4605
+ resolvedBy: z44.string().nullable()
4551
4606
  });
4552
- var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z43.string() });
4553
- var SessionCommentSchema = z43.object({
4554
- id: z43.string().uuid(),
4607
+ var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z44.string() });
4608
+ var SessionCommentSchema = z44.object({
4609
+ id: z44.string().uuid(),
4555
4610
  /** Set = a reply in that bug's thread. Null = a standalone comment pin. */
4556
- bugId: z43.string().uuid().nullable(),
4611
+ bugId: z44.string().uuid().nullable(),
4557
4612
  /** 1-based turn the comment was left on; null for a reply (it reads its
4558
4613
  * parent bug's turn). */
4559
- turnIndex: z43.number().int().nullable(),
4614
+ turnIndex: z44.number().int().nullable(),
4560
4615
  /** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
4561
4616
  location: BugLocationSchema.nullable(),
4562
- body: z43.string(),
4563
- createdBy: z43.string(),
4564
- createdAt: z43.string()
4617
+ body: z44.string(),
4618
+ createdBy: z44.string(),
4619
+ createdAt: z44.string()
4565
4620
  });
4566
- var CreateCommentInputSchema = z43.object({
4567
- bugId: z43.string().uuid().nullable(),
4568
- turnIndex: z43.number().int().positive().nullable(),
4621
+ var CreateCommentInputSchema = z44.object({
4622
+ bugId: z44.string().uuid().nullable(),
4623
+ turnIndex: z44.number().int().positive().nullable(),
4569
4624
  location: BugLocationSchema.nullable(),
4570
4625
  // Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
4571
4626
  // of three spaces, which renders as an empty bubble nobody can interpret.
4572
- body: z43.string().trim().min(1)
4627
+ body: z44.string().trim().min(1)
4573
4628
  }).refine((input) => input.bugId === null !== (input.location === null), {
4574
4629
  message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
4575
4630
  });
4576
- var UpdateCommentInputSchema = z43.object({
4577
- body: z43.string().trim().min(1).optional(),
4578
- bugId: z43.string().uuid().nullable().optional(),
4631
+ var UpdateCommentInputSchema = z44.object({
4632
+ body: z44.string().trim().min(1).optional(),
4633
+ bugId: z44.string().uuid().nullable().optional(),
4579
4634
  location: BugLocationSchema.nullable().optional()
4580
4635
  });
4581
4636
  var MOBILE_VIEWPORT_MAX = 720;
4582
- var SessionFormFactorSchema = z43.enum(["mobile", "desktop"]).nullable();
4637
+ var SessionFormFactorSchema = z44.enum(["mobile", "desktop"]).nullable();
4583
4638
  function formFactorFromViewport(width) {
4584
4639
  if (width === null) return null;
4585
4640
  return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
4586
4641
  }
4587
- var SessionSummarySchema = z43.object({
4588
- sessionId: z43.string(),
4642
+ var SessionSummarySchema = z44.object({
4643
+ sessionId: z44.string(),
4589
4644
  /** Stable per-browser id — the join key across a visitor's sessions. Null when
4590
4645
  * the session row is gone (pruned) or predates the `sessions` table. */
4591
- visitorId: z43.string().nullable(),
4646
+ visitorId: z44.string().nullable(),
4592
4647
  /** Provider-qualified identity anchor, present only once the visitor
4593
4648
  * identified themselves. Both null together means "not identified yet". */
4594
- identityProvider: z43.string().nullable(),
4595
- identityKey: z43.string().nullable(),
4649
+ identityProvider: z44.string().nullable(),
4650
+ identityKey: z44.string().nullable(),
4596
4651
  /** Team/test traffic. The queue hides these by default. */
4597
- isInternal: z43.boolean(),
4652
+ isInternal: z44.boolean(),
4598
4653
  /** Build that served the session. Null = not captured; a version filter must
4599
4654
  * therefore EXCLUDE it rather than let it match an arbitrary bucket. */
4600
- clientVersion: z43.string().nullable(),
4655
+ clientVersion: z44.string().nullable(),
4601
4656
  /** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
4602
- signalCounts: z43.record(z43.number()),
4657
+ signalCounts: z44.record(z44.number()),
4603
4658
  /**
4604
4659
  * Did this conversation ACQUIRE anything, and how many times?
4605
4660
  *
@@ -4616,7 +4671,7 @@ var SessionSummarySchema = z43.object({
4616
4671
  * predates the column — and renders as no mark at all. It never means zero:
4617
4672
  * zero is a real, recorded answer and the rail reports it as one.
4618
4673
  */
4619
- conversionAttempts: z43.number().int().nullable(),
4674
+ conversionAttempts: z44.number().int().nullable(),
4620
4675
  /**
4621
4676
  * The same attempts split by EVENT KIND, keyed by the kind's own name
4622
4677
  * (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
@@ -4632,7 +4687,7 @@ var SessionSummarySchema = z43.object({
4632
4687
  * kinds together, and one attempt id appearing under both would be counted
4633
4688
  * once there and twice here.
4634
4689
  */
4635
- conversionKinds: z43.record(z43.number()),
4690
+ conversionKinds: z44.record(z44.number()),
4636
4691
  /**
4637
4692
  * Every analytics funnel step this session reached, in funnel order — the
4638
4693
  * dashboard's own step ids, read by the same per-step predicates, so a queue
@@ -4640,20 +4695,20 @@ var SessionSummarySchema = z43.object({
4640
4695
  * set of strings for the reason `conversionKinds` is: the contract does not
4641
4696
  * learn what a step means. Empty only when read from a pre-column database.
4642
4697
  */
4643
- funnelSteps: z43.array(z43.string()),
4698
+ funnelSteps: z44.array(z44.string()),
4644
4699
  /**
4645
4700
  * The connector's opaque handle for what this session produced in its back
4646
4701
  * office — present only once a checkout actually reached the platform. The
4647
4702
  * console hands it to the back-office link registry; nothing else reads it.
4648
4703
  */
4649
- backOfficeRef: z43.string().nullable(),
4704
+ backOfficeRef: z44.string().nullable(),
4650
4705
  /**
4651
4706
  * The order this session produced, when the connector's back office reported
4652
4707
  * it (`session_orders`): its opaque id and the back office's own name for it.
4653
4708
  * Both null when no order is known — the cart handle above is then the door.
4654
4709
  */
4655
- orderRef: z43.string().nullable(),
4656
- orderLabel: z43.string().nullable(),
4710
+ orderRef: z44.string().nullable(),
4711
+ orderLabel: z44.string().nullable(),
4657
4712
  /**
4658
4713
  * Which shell this session rendered — the one thing about the CAPTURE a list
4659
4714
  * needs.
@@ -4666,12 +4721,12 @@ var SessionSummarySchema = z43.object({
4666
4721
  * on a desktop are not the same session.
4667
4722
  */
4668
4723
  formFactor: SessionFormFactorSchema,
4669
- turnCount: z43.number().int(),
4724
+ turnCount: z44.number().int(),
4670
4725
  /** The visitor's opening message — the single most informative field for
4671
4726
  * deciding whether a session is worth opening, hence the widest column. */
4672
- firstPrompt: z43.string(),
4673
- startedAt: z43.string(),
4674
- lastRunAt: z43.string(),
4727
+ firstPrompt: z44.string(),
4728
+ startedAt: z44.string(),
4729
+ lastRunAt: z44.string(),
4675
4730
  /**
4676
4731
  * The VISITOR's own IANA zone (`America/New_York`), read from their browser
4677
4732
  * at session create — what the two timestamps above should be read in.
@@ -4699,7 +4754,7 @@ var SessionSummarySchema = z43.object({
4699
4754
  * Client-asserted and never validated against a zone table, so every consumer
4700
4755
  * must tolerate an unknown name: `Intl` throws a RangeError on one.
4701
4756
  */
4702
- visitorTimeZone: z43.string().nullable(),
4757
+ visitorTimeZone: z44.string().nullable(),
4703
4758
  /**
4704
4759
  * Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
4705
4760
  * layout op reaching the visitor, and THE latency the project is managed on.
@@ -4707,31 +4762,31 @@ var SessionSummarySchema = z43.object({
4707
4762
  * `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
4708
4763
  * already reading. Null when no turn in the session recorded a patch.
4709
4764
  */
4710
- avgTtftMs: z43.number().int().nullable(),
4765
+ avgTtftMs: z44.number().int().nullable(),
4711
4766
  /** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
4712
4767
  * a budget: null on sessions older than the mark's recording. */
4713
- avgMainDoneMs: z43.number().int().nullable(),
4768
+ avgMainDoneMs: z44.number().int().nullable(),
4714
4769
  /** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
4715
4770
  * budget. On the row only to explain the gap to `totalLatencyMs`. */
4716
- avgChipGenMs: z43.number().int().nullable(),
4717
- totalLatencyMs: z43.number().int(),
4718
- durationMs: z43.number().int(),
4771
+ avgChipGenMs: z44.number().int().nullable(),
4772
+ totalLatencyMs: z44.number().int(),
4773
+ durationMs: z44.number().int(),
4719
4774
  /** Inferred from recent activity — nothing writes a session-end marker. A
4720
4775
  * live session streams and cannot be given a verdict until it ends. */
4721
- isLive: z43.boolean(),
4776
+ isLive: z44.boolean(),
4722
4777
  verdict: SessionVerdictSchema,
4723
- reviewedBy: z43.string().nullable(),
4724
- reviewedAt: z43.string().nullable(),
4778
+ reviewedBy: z44.string().nullable(),
4779
+ reviewedAt: z44.string().nullable(),
4725
4780
  /** Latest filed bug, flattened onto the row so the queue can show its live
4726
4781
  * state without a second request. */
4727
- bugIssueKey: z43.string().nullable(),
4728
- bugIssueUrl: z43.string().nullable(),
4729
- bugIssueState: z43.string().nullable()
4782
+ bugIssueKey: z44.string().nullable(),
4783
+ bugIssueUrl: z44.string().nullable(),
4784
+ bugIssueState: z44.string().nullable()
4730
4785
  });
4731
- var SessionQueuePageSchema = z43.object({
4732
- sessions: z43.array(SessionSummarySchema),
4733
- totalCount: z43.number().int(),
4734
- hiddenInternalCount: z43.number().int(),
4786
+ var SessionQueuePageSchema = z44.object({
4787
+ sessions: z44.array(SessionSummarySchema),
4788
+ totalCount: z44.number().int(),
4789
+ hiddenInternalCount: z44.number().int(),
4735
4790
  /**
4736
4791
  * Bounced sessions the queue left out — no turn and no add, the default.
4737
4792
  *
@@ -4741,61 +4796,61 @@ var SessionQueuePageSchema = z43.object({
4741
4796
  * `totalCount + hiddenBouncedCount` is that population, and this count is the
4742
4797
  * analytics dashboard's bounce over the same window.
4743
4798
  */
4744
- hiddenBouncedCount: z43.number().int()
4799
+ hiddenBouncedCount: z44.number().int()
4745
4800
  });
4746
- var SessionQueueFacetsSchema = z43.object({
4747
- review: z43.record(z43.number()),
4748
- version: z43.record(z43.number()),
4749
- turns: z43.record(z43.number()),
4750
- durationS: z43.record(z43.number()),
4801
+ var SessionQueueFacetsSchema = z44.object({
4802
+ review: z44.record(z44.number()),
4803
+ version: z44.record(z44.number()),
4804
+ turns: z44.record(z44.number()),
4805
+ durationS: z44.record(z44.number()),
4751
4806
  /** Sessions per funnel step reached — a session counts under every step it reached. */
4752
- funnel: z43.record(z43.number())
4807
+ funnel: z44.record(z44.number())
4753
4808
  });
4754
- var SessionCaptureSchema = z43.object({
4755
- viewportWidth: z43.number().int().nullable(),
4756
- viewportHeight: z43.number().int().nullable(),
4757
- userAgent: z43.string().nullable(),
4758
- locale: z43.string().nullable(),
4809
+ var SessionCaptureSchema = z44.object({
4810
+ viewportWidth: z44.number().int().nullable(),
4811
+ viewportHeight: z44.number().int().nullable(),
4812
+ userAgent: z44.string().nullable(),
4813
+ locale: z44.string().nullable(),
4759
4814
  /** Referrer at session create — separates agentic traffic from organic. */
4760
- referrer: z43.string().nullable()
4815
+ referrer: z44.string().nullable()
4761
4816
  });
4762
- var SessionCaptureInputSchema = z43.object({
4763
- viewportWidth: z43.number().int().positive().max(2e4).optional(),
4764
- viewportHeight: z43.number().int().positive().max(2e4).optional(),
4765
- userAgent: z43.string().max(1e3).optional(),
4766
- locale: z43.string().max(35).optional(),
4817
+ var SessionCaptureInputSchema = z44.object({
4818
+ viewportWidth: z44.number().int().positive().max(2e4).optional(),
4819
+ viewportHeight: z44.number().int().positive().max(2e4).optional(),
4820
+ userAgent: z44.string().max(1e3).optional(),
4821
+ locale: z44.string().max(35).optional(),
4767
4822
  /** IANA zone name from the visitor's browser. Bounded rather than validated:
4768
4823
  * the zone database grows, and refusing a name this build has not heard of
4769
4824
  * would drop a real session's capture over a table that is out of date. */
4770
- timeZone: z43.string().max(64).optional(),
4771
- referrer: z43.string().max(2048).optional(),
4772
- clientVersion: z43.string().max(100).optional(),
4773
- isInternal: z43.boolean().optional()
4825
+ timeZone: z44.string().max(64).optional(),
4826
+ referrer: z44.string().max(2048).optional(),
4827
+ clientVersion: z44.string().max(100).optional(),
4828
+ isInternal: z44.boolean().optional()
4774
4829
  });
4775
- var SessionDetailSchema = z43.object({
4830
+ var SessionDetailSchema = z44.object({
4776
4831
  session: SessionSummarySchema,
4777
4832
  capture: SessionCaptureSchema,
4778
4833
  /** Full verdict history, newest first. Verdicts are revisable, and a session
4779
4834
  * re-judged after a fix is the evidence the fix worked. */
4780
- reviews: z43.array(SessionReviewEventSchema),
4781
- bugs: z43.array(SessionBugSchema),
4782
- comments: z43.array(SessionCommentSchema),
4835
+ reviews: z44.array(SessionReviewEventSchema),
4836
+ bugs: z44.array(SessionBugSchema),
4837
+ comments: z44.array(SessionCommentSchema),
4783
4838
  /** Optional during API/console rolling deployment. Absent is unavailable,
4784
4839
  * not evidence of zero visitor activity. */
4785
4840
  activity: SessionActivitySchema.optional()
4786
4841
  });
4787
- var RecordVerdictInputSchema = z43.object({
4842
+ var RecordVerdictInputSchema = z44.object({
4788
4843
  verdict: RecordableVerdictSchema,
4789
- note: z43.string().max(2e3).optional()
4844
+ note: z44.string().max(2e3).optional()
4790
4845
  });
4791
- var FileBugInputSchema = z43.object({
4792
- turnIndex: z43.number().int().positive().nullable(),
4846
+ var FileBugInputSchema = z44.object({
4847
+ turnIndex: z44.number().int().positive().nullable(),
4793
4848
  /** Optional — a bug filed without dropping a pin has no location. */
4794
4849
  location: BugLocationSchema.nullable().optional(),
4795
- title: z43.string().min(1).max(300),
4796
- body: z43.string().min(1),
4850
+ title: z44.string().min(1).max(300),
4851
+ body: z44.string().min(1),
4797
4852
  severity: BugSeveritySchema,
4798
- payload: z43.record(z43.unknown())
4853
+ payload: z44.record(z44.unknown())
4799
4854
  });
4800
4855
 
4801
4856
  // ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
@@ -5092,6 +5147,8 @@ __export(src_exports2, {
5092
5147
  cartLinesForProduct: () => cartLinesForProduct,
5093
5148
  clearCodeDiscountSources: () => clearCodeDiscountSources,
5094
5149
  clearProductNameLookups: () => clearProductNameLookups,
5150
+ clearShopCheckouts: () => clearShopCheckouts,
5151
+ clearStoreArticleLookups: () => clearStoreArticleLookups,
5095
5152
  clearStoreThemeSources: () => clearStoreThemeSources,
5096
5153
  createUnavailableProduct: () => createUnavailableProduct,
5097
5154
  entityProjections: () => entityProjections,
@@ -5113,9 +5170,13 @@ __export(src_exports2, {
5113
5170
  readPdpCompanions: () => readPdpCompanions,
5114
5171
  registerCodeDiscountSource: () => registerCodeDiscountSource,
5115
5172
  registerProductNameLookup: () => registerProductNameLookup,
5173
+ registerShopCheckout: () => registerShopCheckout,
5174
+ registerStoreArticleLookup: () => registerStoreArticleLookup,
5116
5175
  registerStoreThemeSource: () => registerStoreThemeSource,
5117
5176
  resolveCodeDiscountSource: () => resolveCodeDiscountSource,
5118
5177
  resolveProductNameLookup: () => resolveProductNameLookup,
5178
+ resolveShopCheckout: () => resolveShopCheckout,
5179
+ resolveStoreArticleLookup: () => resolveStoreArticleLookup,
5119
5180
  resolveStoreThemeSource: () => resolveStoreThemeSource,
5120
5181
  scopedAttributeKey: () => scopedAttributeKey,
5121
5182
  selectedOptionsToRecord: () => selectedOptionsToRecord,
@@ -5123,60 +5184,60 @@ __export(src_exports2, {
5123
5184
  });
5124
5185
 
5125
5186
  // ../ecommerce/src/commerce-schemas.ts
5126
- import { z as z44 } from "zod";
5127
- var MoneySchema = z44.object({
5128
- amount: z44.number(),
5129
- currencyCode: z44.string()
5187
+ import { z as z45 } from "zod";
5188
+ var MoneySchema = z45.object({
5189
+ amount: z45.number(),
5190
+ currencyCode: z45.string()
5130
5191
  });
5131
- var ImageSchema = z44.object({
5132
- url: z44.string(),
5133
- altText: z44.string(),
5134
- width: z44.number().optional(),
5135
- height: z44.number().optional(),
5192
+ var ImageSchema = z45.object({
5193
+ url: z45.string(),
5194
+ altText: z45.string(),
5195
+ width: z45.number().optional(),
5196
+ height: z45.number().optional(),
5136
5197
  /** Responsive candidate set, resolved at the commerce-adapter boundary —
5137
5198
  * never computed in a component. Renderers use it as `<img srcSet>` paired
5138
5199
  * with a layout `sizes`. Absent for non-CDN / unsizable images. */
5139
- srcSet: z44.string().optional()
5200
+ srcSet: z45.string().optional()
5140
5201
  });
5141
- var AssetSchema = z44.object({
5202
+ var AssetSchema = z45.object({
5142
5203
  /** Opaque asset id — the `resolved()` ref the agent emitted. */
5143
- id: z44.string(),
5144
- url: z44.string(),
5145
- altText: z44.string(),
5146
- srcSet: z44.string().optional()
5204
+ id: z45.string(),
5205
+ url: z45.string(),
5206
+ altText: z45.string(),
5207
+ srcSet: z45.string().optional()
5147
5208
  });
5148
- var SelectedOptionSchema = z44.object({
5149
- name: z44.string(),
5150
- value: z44.string()
5209
+ var SelectedOptionSchema = z45.object({
5210
+ name: z45.string(),
5211
+ value: z45.string()
5151
5212
  });
5152
- var VideoSourceSchema = z44.object({
5153
- url: z44.string(),
5154
- mimeType: z44.string(),
5155
- width: z44.number().optional(),
5156
- height: z44.number().optional()
5213
+ var VideoSourceSchema = z45.object({
5214
+ url: z45.string(),
5215
+ mimeType: z45.string(),
5216
+ width: z45.number().optional(),
5217
+ height: z45.number().optional()
5157
5218
  });
5158
- var ProductVideoSchema = z44.object({
5159
- kind: z44.enum(["hosted", "external"]),
5219
+ var ProductVideoSchema = z45.object({
5220
+ kind: z45.enum(["hosted", "external"]),
5160
5221
  previewImage: ImageSchema.optional(),
5161
- altText: z44.string().default(""),
5222
+ altText: z45.string().default(""),
5162
5223
  /** `kind: 'hosted'` only — empty for external embeds. */
5163
- sources: z44.array(VideoSourceSchema).default([]),
5224
+ sources: z45.array(VideoSourceSchema).default([]),
5164
5225
  /** `kind: 'external'` only — iframe embed URL. */
5165
- embedUrl: z44.string().optional(),
5226
+ embedUrl: z45.string().optional(),
5166
5227
  /** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
5167
- host: z44.string().optional()
5228
+ host: z45.string().optional()
5168
5229
  });
5169
- var AvailabilityStatusSchema = z44.enum([
5230
+ var AvailabilityStatusSchema = z45.enum([
5170
5231
  "in_stock",
5171
5232
  "backorder",
5172
5233
  "preorder",
5173
5234
  "out_of_stock",
5174
5235
  "discontinued"
5175
5236
  ]);
5176
- var ProductVariantSchema = z44.object({
5177
- id: z44.string(),
5178
- title: z44.string(),
5179
- available: z44.boolean(),
5237
+ var ProductVariantSchema = z45.object({
5238
+ id: z45.string(),
5239
+ title: z45.string(),
5240
+ available: z45.boolean(),
5180
5241
  /**
5181
5242
  * Qualifies `available` with the fulfillment state behind it. Absent means
5182
5243
  * the backend did not say — which is NOT the same as in stock, and must not
@@ -5191,10 +5252,10 @@ var ProductVariantSchema = z44.object({
5191
5252
  availabilityStatus: AvailabilityStatusSchema.optional(),
5192
5253
  price: MoneySchema,
5193
5254
  compareAtPrice: MoneySchema.optional(),
5194
- selectedOptions: z44.array(SelectedOptionSchema).optional(),
5255
+ selectedOptions: z45.array(SelectedOptionSchema).optional(),
5195
5256
  image: ImageSchema.optional(),
5196
5257
  /** The merchant's stock-keeping code. Absent when the backend has none. */
5197
- sku: z44.string().optional()
5258
+ sku: z45.string().optional()
5198
5259
  });
5199
5260
  var MP4_MIME = "video/mp4";
5200
5261
  var HLS_MIME = "application/x-mpegURL";
@@ -5204,34 +5265,34 @@ function orderedVideoSources(video) {
5204
5265
  const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
5205
5266
  return [...mp4, ...hls];
5206
5267
  }
5207
- var SiblingProductSchema = z44.object({
5208
- id: z44.string(),
5209
- handle: z44.string(),
5210
- title: z44.string(),
5268
+ var SiblingProductSchema = z45.object({
5269
+ id: z45.string(),
5270
+ handle: z45.string(),
5271
+ title: z45.string(),
5211
5272
  /** The differentiating value across siblings — typically the color
5212
5273
  * label ("OLIVE", "STONE"). Rendered next to the swatch row. */
5213
- color: z44.string(),
5274
+ color: z45.string(),
5214
5275
  /** Swatch artwork. Hydrators populate from the sibling product's
5215
5276
  * first image; renderers crop / fit to the swatch tile. */
5216
5277
  swatchImage: ImageSchema.optional(),
5217
- available: z44.boolean().default(true),
5278
+ available: z45.boolean().default(true),
5218
5279
  /** Marks the sibling that IS the currently-rendered product. The
5219
5280
  * picker uses this to highlight the active swatch without an
5220
5281
  * external id comparison. */
5221
- current: z44.boolean().default(false)
5282
+ current: z45.boolean().default(false)
5222
5283
  });
5223
- var ProductSchema = z44.object({
5224
- id: z44.string(),
5225
- handle: z44.string().default(""),
5226
- title: z44.string(),
5227
- description: z44.string().default(""),
5228
- descriptionHtml: z44.string().optional(),
5229
- vendor: z44.string().default(""),
5230
- productType: z44.string().optional(),
5231
- tags: z44.array(z44.string()).default([]),
5284
+ var ProductSchema = z45.object({
5285
+ id: z45.string(),
5286
+ handle: z45.string().default(""),
5287
+ title: z45.string(),
5288
+ description: z45.string().default(""),
5289
+ descriptionHtml: z45.string().optional(),
5290
+ vendor: z45.string().default(""),
5291
+ productType: z45.string().optional(),
5292
+ tags: z45.array(z45.string()).default([]),
5232
5293
  price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
5233
5294
  compareAtPrice: MoneySchema.optional(),
5234
- images: z44.array(ImageSchema).default([]),
5295
+ images: z45.array(ImageSchema).default([]),
5235
5296
  /**
5236
5297
  * Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
5237
5298
  * catalog drops video media — it only surfaces through the Storefront
@@ -5239,21 +5300,21 @@ var ProductSchema = z44.object({
5239
5300
  * boundary. Default `[]` so renderers gate on `length > 0` without a
5240
5301
  * presence guard.
5241
5302
  */
5242
- videos: z44.array(ProductVideoSchema).default([]),
5243
- variants: z44.array(ProductVariantSchema).default([]),
5244
- availableForSale: z44.boolean().default(true),
5245
- options: z44.array(z44.object({
5246
- name: z44.string(),
5247
- values: z44.array(z44.string())
5303
+ videos: z45.array(ProductVideoSchema).default([]),
5304
+ variants: z45.array(ProductVariantSchema).default([]),
5305
+ availableForSale: z45.boolean().default(true),
5306
+ options: z45.array(z45.object({
5307
+ name: z45.string(),
5308
+ values: z45.array(z45.string())
5248
5309
  })).optional(),
5249
- collections: z44.array(z44.string()).optional(),
5310
+ collections: z45.array(z45.string()).optional(),
5250
5311
  /** See `SiblingProductSchema`. Default `[]` so renderers can check
5251
5312
  * `length > 1` to decide whether to draw the swatch row without a
5252
5313
  * presence guard. */
5253
- colorVariants: z44.array(SiblingProductSchema).default([]),
5254
- rating: z44.object({
5255
- value: z44.number(),
5256
- count: z44.number()
5314
+ colorVariants: z45.array(SiblingProductSchema).default([]),
5315
+ rating: z45.object({
5316
+ value: z45.number(),
5317
+ count: z45.number()
5257
5318
  }).optional(),
5258
5319
  /**
5259
5320
  * Product reviews surfaced from the brand's review store. SDK
@@ -5262,12 +5323,12 @@ var ProductSchema = z44.object({
5262
5323
  * review bodies. Renderers (`Reviews` component, `ProductDetail`,
5263
5324
  * etc.) consume directly.
5264
5325
  */
5265
- reviews: z44.array(z44.object({
5266
- author: z44.string(),
5267
- rating: z44.number(),
5268
- content: z44.string(),
5269
- date: z44.string(),
5270
- verified: z44.boolean().optional()
5326
+ reviews: z45.array(z45.object({
5327
+ author: z45.string(),
5328
+ rating: z45.number(),
5329
+ content: z45.string(),
5330
+ date: z45.string(),
5331
+ verified: z45.boolean().optional()
5271
5332
  })).optional(),
5272
5333
  /**
5273
5334
  * Ghost-entity flag — `true` when the Storefront API could not hydrate
@@ -5279,7 +5340,7 @@ var ProductSchema = z44.object({
5279
5340
  * Set exclusively by `createUnavailableProduct()` — never by the
5280
5341
  * Storefront mapper.
5281
5342
  */
5282
- unavailable: z44.boolean().default(false)
5343
+ unavailable: z45.boolean().default(false)
5283
5344
  });
5284
5345
  function createUnavailableProduct(gid) {
5285
5346
  return {
@@ -5301,68 +5362,68 @@ function createUnavailableProduct(gid) {
5301
5362
  function isGhostEntity(value) {
5302
5363
  return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
5303
5364
  }
5304
- var ReviewSchema = z44.object({
5305
- id: z44.string(),
5306
- productId: z44.string(),
5307
- author: z44.string(),
5308
- rating: z44.number(),
5309
- text: z44.string(),
5310
- date: z44.string(),
5311
- verified: z44.boolean()
5365
+ var ReviewSchema = z45.object({
5366
+ id: z45.string(),
5367
+ productId: z45.string(),
5368
+ author: z45.string(),
5369
+ rating: z45.number(),
5370
+ text: z45.string(),
5371
+ date: z45.string(),
5372
+ verified: z45.boolean()
5312
5373
  });
5313
- var ArticleSchema = z44.object({
5314
- id: z44.string(),
5315
- handle: z44.string().default(""),
5316
- title: z44.string(),
5317
- excerpt: z44.string().default(""),
5318
- content: z44.string().default(""),
5319
- contentHtml: z44.string().optional(),
5320
- author: z44.string().default(""),
5321
- publishedAt: z44.string().default(""),
5374
+ var ArticleSchema = z45.object({
5375
+ id: z45.string(),
5376
+ handle: z45.string().default(""),
5377
+ title: z45.string(),
5378
+ excerpt: z45.string().default(""),
5379
+ content: z45.string().default(""),
5380
+ contentHtml: z45.string().optional(),
5381
+ author: z45.string().default(""),
5382
+ publishedAt: z45.string().default(""),
5322
5383
  image: ImageSchema.optional(),
5323
- blogHandle: z44.string().default(""),
5324
- tags: z44.array(z44.string()).default([])
5384
+ blogHandle: z45.string().default(""),
5385
+ tags: z45.array(z45.string()).default([])
5325
5386
  });
5326
- var CmsPageSchema = z44.object({
5327
- id: z44.string(),
5328
- handle: z44.string().default(""),
5329
- title: z44.string(),
5330
- body: z44.string().default(""),
5331
- bodyHtml: z44.string().optional(),
5332
- bodySummary: z44.string().default(""),
5333
- updatedAt: z44.string().default(""),
5334
- seoTitle: z44.string().optional(),
5335
- seoDescription: z44.string().optional()
5387
+ var CmsPageSchema = z45.object({
5388
+ id: z45.string(),
5389
+ handle: z45.string().default(""),
5390
+ title: z45.string(),
5391
+ body: z45.string().default(""),
5392
+ bodyHtml: z45.string().optional(),
5393
+ bodySummary: z45.string().default(""),
5394
+ updatedAt: z45.string().default(""),
5395
+ seoTitle: z45.string().optional(),
5396
+ seoDescription: z45.string().optional()
5336
5397
  });
5337
- var CmsPolicySchema = z44.object({
5338
- id: z44.string(),
5398
+ var CmsPolicySchema = z45.object({
5399
+ id: z45.string(),
5339
5400
  /** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
5340
5401
  * 'shipping' | 'subscription' | 'warranty' | custom string. Open so
5341
5402
  * platforms with custom policy types can extend. */
5342
- kind: z44.string(),
5403
+ kind: z45.string(),
5343
5404
  /** Slug-shaped handle the platform exposes for storefront URLs
5344
5405
  * (e.g. `refund-policy`). Empty string when the backend doesn't
5345
5406
  * surface one. */
5346
- handle: z44.string().default(""),
5347
- title: z44.string(),
5348
- body: z44.string().default(""),
5349
- bodyHtml: z44.string().optional(),
5350
- url: z44.string().default("")
5407
+ handle: z45.string().default(""),
5408
+ title: z45.string(),
5409
+ body: z45.string().default(""),
5410
+ bodyHtml: z45.string().optional(),
5411
+ url: z45.string().default("")
5351
5412
  });
5352
- var CollectionSchema = z44.object({
5353
- id: z44.string(),
5354
- handle: z44.string().default(""),
5355
- title: z44.string(),
5356
- description: z44.string().default(""),
5413
+ var CollectionSchema = z45.object({
5414
+ id: z45.string(),
5415
+ handle: z45.string().default(""),
5416
+ title: z45.string(),
5417
+ description: z45.string().default(""),
5357
5418
  image: ImageSchema.optional(),
5358
- productCount: z44.number().int().nonnegative().optional()
5419
+ productCount: z45.number().int().nonnegative().optional()
5359
5420
  });
5360
- var CartLineSchema = z44.object({
5361
- id: z44.string(),
5362
- merchandiseId: z44.string(),
5363
- productId: z44.string(),
5364
- title: z44.string(),
5365
- variantTitle: z44.string().optional(),
5421
+ var CartLineSchema = z45.object({
5422
+ id: z45.string(),
5423
+ merchandiseId: z45.string(),
5424
+ productId: z45.string(),
5425
+ title: z45.string(),
5426
+ variantTitle: z45.string().optional(),
5366
5427
  /**
5367
5428
  * The variant's option axes as structured pairs (e.g.
5368
5429
  * `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
@@ -5371,10 +5432,10 @@ var CartLineSchema = z44.object({
5371
5432
  * single-variant products (the degenerate `Title: Default Title` axis
5372
5433
  * is normalized away at the adapter boundary).
5373
5434
  */
5374
- selectedOptions: z44.array(SelectedOptionSchema).optional(),
5375
- vendor: z44.string().optional(),
5376
- sku: z44.string().optional(),
5377
- quantity: z44.number().int().positive(),
5435
+ selectedOptions: z45.array(SelectedOptionSchema).optional(),
5436
+ vendor: z45.string().optional(),
5437
+ sku: z45.string().optional(),
5438
+ quantity: z45.number().int().positive(),
5378
5439
  unitPrice: MoneySchema,
5379
5440
  totalPrice: MoneySchema,
5380
5441
  image: ImageSchema.optional(),
@@ -5394,26 +5455,26 @@ var CartLineSchema = z44.object({
5394
5455
  * client-minted id the backend rejects, line-tap navigation is
5395
5456
  * suppressed, and the money never folds into a settled-looking total.
5396
5457
  */
5397
- pending: z44.boolean().optional()
5458
+ pending: z45.boolean().optional()
5398
5459
  });
5399
5460
  function isPendingCartLine(line) {
5400
5461
  return line.pending === true;
5401
5462
  }
5402
- var CartDiscountCodeSchema = z44.object({
5403
- code: z44.string(),
5404
- applicable: z44.boolean()
5463
+ var CartDiscountCodeSchema = z45.object({
5464
+ code: z45.string(),
5465
+ applicable: z45.boolean()
5405
5466
  });
5406
- var CartMessageSchema = z44.object({
5407
- kind: z44.enum(["error", "warning", "info"]),
5467
+ var CartMessageSchema = z45.object({
5468
+ kind: z45.enum(["error", "warning", "info"]),
5408
5469
  /** Machine code for branching; opaque and backend-defined. */
5409
- code: z44.string(),
5470
+ code: z45.string(),
5410
5471
  /** Human-readable text, meant to be shown as-is. */
5411
- content: z44.string()
5472
+ content: z45.string()
5412
5473
  });
5413
- var CartSchema = z44.object({
5414
- id: z44.string(),
5415
- lines: z44.array(CartLineSchema),
5416
- totalQuantity: z44.number().int().nonnegative(),
5474
+ var CartSchema = z45.object({
5475
+ id: z45.string(),
5476
+ lines: z45.array(CartLineSchema),
5477
+ totalQuantity: z45.number().int().nonnegative(),
5417
5478
  subtotal: MoneySchema,
5418
5479
  /**
5419
5480
  * Cart total after discounts (pre-shipping/tax). Absent when the
@@ -5423,11 +5484,11 @@ var CartSchema = z44.object({
5423
5484
  */
5424
5485
  total: MoneySchema.optional(),
5425
5486
  /** Discount codes currently attached to the cart. */
5426
- discountCodes: z44.array(CartDiscountCodeSchema).default([]),
5487
+ discountCodes: z45.array(CartDiscountCodeSchema).default([]),
5427
5488
  /** Notices the backend attached to this cart — see `CartMessageSchema`.
5428
5489
  * Empty when the backend said nothing or does not report them. */
5429
- messages: z44.array(CartMessageSchema).default([]),
5430
- checkoutUrl: z44.string().optional(),
5490
+ messages: z45.array(CartMessageSchema).default([]),
5491
+ checkoutUrl: z45.string().optional(),
5431
5492
  /**
5432
5493
  * Opaque handle this cart is known by in the connector's BACK OFFICE — the
5433
5494
  * value a space owner searches there to find the order this cart became.
@@ -5440,14 +5501,14 @@ var CartSchema = z44.object({
5440
5501
  * Absent when the platform has no such handle, or while the cart is still the
5441
5502
  * client's optimistic paint and its id is client-minted.
5442
5503
  */
5443
- backOfficeRef: z44.string().optional(),
5504
+ backOfficeRef: z45.string().optional(),
5444
5505
  /**
5445
5506
  * URL that recreates this cart on the merchant's own store website
5446
5507
  * (replace semantics — overwrites any cart the visitor already has
5447
5508
  * there). Populated by platform adapters that support it; absent when
5448
5509
  * the cart is empty or the URL cannot be built.
5449
5510
  */
5450
- storeCartUrl: z44.string().optional(),
5511
+ storeCartUrl: z45.string().optional(),
5451
5512
  /**
5452
5513
  * True while this cart exists only in the client's optimistic paint —
5453
5514
  * no backend cart has been created yet, so its `id` is client-minted and
@@ -5455,7 +5516,7 @@ var CartSchema = z44.object({
5455
5516
  * `CartLineSchema.pending`: the adapter never sets it, and callers that
5456
5517
  * need a real cart id read THIS rather than sniffing the id's shape.
5457
5518
  */
5458
- pending: z44.boolean().optional()
5519
+ pending: z45.boolean().optional()
5459
5520
  });
5460
5521
  function settledCart(cart) {
5461
5522
  if (cart === null || cart === void 0) return null;
@@ -5463,27 +5524,27 @@ function settledCart(cart) {
5463
5524
  }
5464
5525
 
5465
5526
  // ../ecommerce/src/review-schemas.ts
5466
- import { z as z45 } from "zod";
5527
+ import { z as z46 } from "zod";
5467
5528
  var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
5468
- var ProductReviewItemSchema = z45.object({
5469
- author: z45.string(),
5470
- rating: z45.number(),
5529
+ var ProductReviewItemSchema = z46.object({
5530
+ author: z46.string(),
5531
+ rating: z46.number(),
5471
5532
  /** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
5472
- title: z45.string().optional(),
5473
- content: z45.string(),
5474
- date: z45.string(),
5475
- verified: z45.boolean().optional(),
5533
+ title: z46.string().optional(),
5534
+ content: z46.string(),
5535
+ date: z46.string(),
5536
+ verified: z46.boolean().optional(),
5476
5537
  /**
5477
5538
  * Non-empty when the review was written for a grouped SIBLING product rather
5478
5539
  * than this one (brands pool reviews across a product line). A surface can
5479
5540
  * attribute it; empty / absent ⇒ the product's own review.
5480
5541
  */
5481
- writtenFor: z45.string().optional()
5542
+ writtenFor: z46.string().optional()
5482
5543
  });
5483
5544
  var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
5484
5545
  /** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
5485
5546
  * scored, NOT necessarily text that occurs in `content`. */
5486
- highlight: z45.string().optional(),
5547
+ highlight: z46.string().optional(),
5487
5548
  /**
5488
5549
  * `highlight` resolved back into `content` as a VERBATIM substring, so a
5489
5550
  * surface can mark it with a plain `indexOf` and no matcher of its own.
@@ -5498,29 +5559,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
5498
5559
  * Absent when the passage genuinely has no home in the body (one cut from the
5499
5560
  * title). A surface then marks NOTHING rather than guessing at a span.
5500
5561
  */
5501
- mark: z45.string().optional()
5562
+ mark: z46.string().optional()
5502
5563
  });
5503
- var ReviewAggregateSchema = z45.object({
5504
- value: z45.number(),
5505
- count: z45.number()
5564
+ var ReviewAggregateSchema = z46.object({
5565
+ value: z46.number(),
5566
+ count: z46.number()
5506
5567
  });
5507
- var ProductReviewDataSchema = z45.object({
5508
- id: z45.string(),
5568
+ var ProductReviewDataSchema = z46.object({
5569
+ id: z46.string(),
5509
5570
  /** The product's FULL retrieved set — what a filterable list renders. */
5510
- reviews: z45.array(ProductReviewItemSchema).default([]),
5571
+ reviews: z46.array(ProductReviewItemSchema).default([]),
5511
5572
  aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
5512
5573
  /** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
5513
- distribution: z45.array(z45.number()).default([]),
5574
+ distribution: z46.array(z46.number()).default([]),
5514
5575
  /**
5515
5576
  * The reviews that ANSWER the surface's intent, best first. Empty when no
5516
5577
  * intent was asked for — never a silent copy of `reviews`.
5517
5578
  */
5518
- highlights: z45.array(ProductReviewHighlightSchema).default([]),
5579
+ highlights: z46.array(ProductReviewHighlightSchema).default([]),
5519
5580
  /**
5520
5581
  * True when the review provider could not be read and nothing is indexed —
5521
5582
  * the empty lists mean "not loaded", NOT "this product has no reviews".
5522
5583
  */
5523
- unavailable: z45.boolean().optional()
5584
+ unavailable: z46.boolean().optional()
5524
5585
  });
5525
5586
  var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
5526
5587
 
@@ -5814,9 +5875,9 @@ function readPdpCompanions(config) {
5814
5875
  }
5815
5876
 
5816
5877
  // ../ecommerce/src/base-attributes.ts
5817
- import { z as z46 } from "zod";
5878
+ import { z as z47 } from "zod";
5818
5879
  var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
5819
- var BaseAttributesRecordSchema = z46.record(z46.string(), AttributeDefSchema);
5880
+ var BaseAttributesRecordSchema = z47.record(z47.string(), AttributeDefSchema);
5820
5881
  function buildBaseAttributesConfig(attributes) {
5821
5882
  return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
5822
5883
  }
@@ -5827,9 +5888,9 @@ function readBaseAttributesConfig(config) {
5827
5888
  }
5828
5889
 
5829
5890
  // ../ecommerce/src/bucket-labels.ts
5830
- import { z as z47 } from "zod";
5891
+ import { z as z48 } from "zod";
5831
5892
  var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
5832
- var BucketLabelsRecordSchema = z47.record(z47.string(), z47.string());
5893
+ var BucketLabelsRecordSchema = z48.record(z48.string(), z48.string());
5833
5894
  function buildBucketLabelsConfig(labels) {
5834
5895
  return { [BUCKET_LABELS_CONFIG_KEY]: labels };
5835
5896
  }
@@ -5855,20 +5916,52 @@ function clearProductNameLookups() {
5855
5916
  factories.length = 0;
5856
5917
  }
5857
5918
 
5858
- // ../ecommerce/src/code-discounts.ts
5919
+ // ../ecommerce/src/store-articles.ts
5859
5920
  var factories2 = [];
5860
- function registerCodeDiscountSource(factory) {
5921
+ function registerStoreArticleLookup(factory) {
5861
5922
  factories2.push(factory);
5862
5923
  }
5863
- function resolveCodeDiscountSource(options) {
5924
+ function resolveStoreArticleLookup(platformConfig) {
5864
5925
  for (const factory of factories2) {
5926
+ const lookup = factory(platformConfig);
5927
+ if (lookup !== void 0) return lookup;
5928
+ }
5929
+ return void 0;
5930
+ }
5931
+ function clearStoreArticleLookups() {
5932
+ factories2.length = 0;
5933
+ }
5934
+
5935
+ // ../ecommerce/src/shop-checkout.ts
5936
+ var factories3 = [];
5937
+ function registerShopCheckout(factory) {
5938
+ factories3.push(factory);
5939
+ }
5940
+ function resolveShopCheckout(platformConfig) {
5941
+ for (const factory of factories3) {
5942
+ const maker = factory(platformConfig);
5943
+ if (maker !== void 0) return maker;
5944
+ }
5945
+ return void 0;
5946
+ }
5947
+ function clearShopCheckouts() {
5948
+ factories3.length = 0;
5949
+ }
5950
+
5951
+ // ../ecommerce/src/code-discounts.ts
5952
+ var factories4 = [];
5953
+ function registerCodeDiscountSource(factory) {
5954
+ factories4.push(factory);
5955
+ }
5956
+ function resolveCodeDiscountSource(options) {
5957
+ for (const factory of factories4) {
5865
5958
  const source = factory(options);
5866
5959
  if (source !== void 0) return source;
5867
5960
  }
5868
5961
  return void 0;
5869
5962
  }
5870
5963
  function clearCodeDiscountSources() {
5871
- factories2.length = 0;
5964
+ factories4.length = 0;
5872
5965
  }
5873
5966
 
5874
5967
  // ../ecommerce/src/store-theme.ts
@@ -5878,19 +5971,19 @@ var StoreThemeAccessError = class extends Error {
5878
5971
  this.name = "StoreThemeAccessError";
5879
5972
  }
5880
5973
  };
5881
- var factories3 = [];
5974
+ var factories5 = [];
5882
5975
  function registerStoreThemeSource(factory) {
5883
- factories3.push(factory);
5976
+ factories5.push(factory);
5884
5977
  }
5885
5978
  function resolveStoreThemeSource(options) {
5886
- for (const factory of factories3) {
5979
+ for (const factory of factories5) {
5887
5980
  const source = factory(options);
5888
5981
  if (source !== void 0) return source;
5889
5982
  }
5890
5983
  return void 0;
5891
5984
  }
5892
5985
  function clearStoreThemeSources() {
5893
- factories3.length = 0;
5986
+ factories5.length = 0;
5894
5987
  }
5895
5988
 
5896
5989
  // ../ecommerce/src/installment-offer.ts
@@ -5992,6 +6085,7 @@ __export(shell_exports, {
5992
6085
  splitAnswer: () => splitAnswer,
5993
6086
  takeSubmitOrigin: () => takeSubmitOrigin,
5994
6087
  threadRowAttrs: () => threadRowAttrs,
6088
+ useAskAbout: () => useAskAbout,
5995
6089
  useBotCheckNotice: () => useBotCheckNotice,
5996
6090
  useComposerAttachments: () => useComposerAttachments,
5997
6091
  useComposerChipSelect: () => useComposerChipSelect,
@@ -6836,11 +6930,28 @@ function useComposerChipSelect() {
6836
6930
  );
6837
6931
  }
6838
6932
 
6839
- // src/shell/use-turn-ask-reply.ts
6933
+ // src/shell/use-ask-about.ts
6840
6934
  import * as React13 from "react";
6841
- function useTurnAskReply() {
6935
+ function useAskAbout() {
6842
6936
  const session = useFourtySession();
6843
6937
  return React13.useCallback(
6938
+ (text2, about) => {
6939
+ session.dispatchSuggestionAction({
6940
+ id: `about-${about.field}-${text2}`,
6941
+ label: text2,
6942
+ type: "message",
6943
+ payload: { text: text2, about, followUp: true }
6944
+ });
6945
+ },
6946
+ [session]
6947
+ );
6948
+ }
6949
+
6950
+ // src/shell/use-turn-ask-reply.ts
6951
+ import * as React14 from "react";
6952
+ function useTurnAskReply() {
6953
+ const session = useFourtySession();
6954
+ return React14.useCallback(
6844
6955
  (answer) => {
6845
6956
  session.dispatchSuggestionAction({ id: `ask-${answer}`, label: answer, type: "message", payload: { text: answer, followUp: true } });
6846
6957
  },
@@ -6849,14 +6960,14 @@ function useTurnAskReply() {
6849
6960
  }
6850
6961
 
6851
6962
  // src/shell/turn-ask-placement.tsx
6852
- import * as React14 from "react";
6963
+ import * as React15 from "react";
6853
6964
  import { jsx as jsx6 } from "react/jsx-runtime";
6854
- var TurnAskPlacementContext = React14.createContext("prose");
6965
+ var TurnAskPlacementContext = React15.createContext("prose");
6855
6966
  function TurnAskPlacementProvider({ placement, children }) {
6856
6967
  return /* @__PURE__ */ jsx6(TurnAskPlacementContext.Provider, { value: placement, children });
6857
6968
  }
6858
6969
  function useTurnAskPlacement() {
6859
- return React14.useContext(TurnAskPlacementContext);
6970
+ return React15.useContext(TurnAskPlacementContext);
6860
6971
  }
6861
6972
 
6862
6973
  // src/shell/use-go-home.ts
@@ -6873,10 +6984,10 @@ function useGoHome() {
6873
6984
  }
6874
6985
 
6875
6986
  // src/shell/use-menu-item-select.ts
6876
- import * as React15 from "react";
6987
+ import * as React16 from "react";
6877
6988
  function useMenuItemSelect() {
6878
6989
  const session = useFourtySession();
6879
- return React15.useCallback(
6990
+ return React16.useCallback(
6880
6991
  (item) => {
6881
6992
  const payload = item.action.payload === void 0 ? {} : item.action.payload;
6882
6993
  session.dispatchSuggestionAction({
@@ -6929,15 +7040,15 @@ function useThreadRows() {
6929
7040
  }
6930
7041
 
6931
7042
  // src/shell/conversation/use-conversation-page.ts
6932
- import * as React19 from "react";
7043
+ import * as React20 from "react";
6933
7044
 
6934
7045
  // src/canvas/use-is-seed-home.ts
6935
- import * as React16 from "react";
7046
+ import * as React17 from "react";
6936
7047
  function useIsSeedHome() {
6937
7048
  const layout = useDisplayedLayout();
6938
7049
  const turn = useTurn();
6939
7050
  const sessionState = useSessionState();
6940
- return React16.useMemo(() => {
7051
+ return React17.useMemo(() => {
6941
7052
  if (sessionState.seedLayout === null) return false;
6942
7053
  if (turn.index !== 0) return false;
6943
7054
  if (turn.userMessage !== "") return false;
@@ -7180,8 +7291,8 @@ var PRESENCE_LIFECYCLE = {
7180
7291
  };
7181
7292
 
7182
7293
  // ../spacestation/src/widgets/presence/profile.ts
7183
- import { z as z48 } from "zod";
7184
- var PresenceProfileSchema = z48.object({
7294
+ import { z as z49 } from "zod";
7295
+ var PresenceProfileSchema = z49.object({
7185
7296
  /**
7186
7297
  * How much the agent SPEAKS in presence.
7187
7298
  * - 'off' the faculty generates no prose at all. Zero tokens, and
@@ -7191,14 +7302,14 @@ var PresenceProfileSchema = z48.object({
7191
7302
  * - 'terse' one lead line per turn. The default — see below.
7192
7303
  * - 'full' a lead line plus asides beside individual elements.
7193
7304
  */
7194
- voice: z48.enum(["off", "terse", "full"]),
7305
+ voice: z49.enum(["off", "terse", "full"]),
7195
7306
  /**
7196
7307
  * Which source kinds this space surfaces. 'all' = every tool that declares a
7197
7308
  * `sourceKind`. An explicit list lets a space stay quiet about lookups its
7198
7309
  * visitors would find uninteresting (policy checks on a fashion space)
7199
7310
  * without the tool having to lie about what it is.
7200
7311
  */
7201
- sources: z48.union([z48.array(z48.string()), z48.literal("all")]),
7312
+ sources: z49.union([z49.array(z49.string()), z49.literal("all")]),
7202
7313
  /**
7203
7314
  * Which facts render.
7204
7315
  * - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
@@ -7207,7 +7318,7 @@ var PresenceProfileSchema = z48.object({
7207
7318
  * - 'all' shows stated facts too — for spaces where confirming the brief
7208
7319
  * back is itself the product (intake, configuration).
7209
7320
  */
7210
- facts: z48.enum(["inferred-only", "all"])
7321
+ facts: z49.enum(["inferred-only", "all"])
7211
7322
  });
7212
7323
  var DEFAULT_PRESENCE_PROFILE = {
7213
7324
  voice: "terse",
@@ -7474,10 +7585,10 @@ function useAgentPresence(flowId = PRESENCE_FLOW) {
7474
7585
  }
7475
7586
 
7476
7587
  // src/widgets/presence/use-forget-fact.ts
7477
- import * as React18 from "react";
7588
+ import * as React19 from "react";
7478
7589
 
7479
7590
  // src/widgets/presence/use-optimistic-flow-set.ts
7480
- import * as React17 from "react";
7591
+ import * as React18 from "react";
7481
7592
  function readKeys(data) {
7482
7593
  if (typeof data !== "object" || data === null || !("keys" in data)) return [];
7483
7594
  const raw = data.keys;
@@ -7486,8 +7597,8 @@ function readKeys(data) {
7486
7597
  function useOptimisticFlowSet(flowId) {
7487
7598
  const keys = readKeys(useAgentFlow(flowId));
7488
7599
  const joined = keys.join("\0");
7489
- const set = React17.useMemo(() => new Set(keys), [joined]);
7490
- return React17.useMemo(
7600
+ const set = React18.useMemo(() => new Set(keys), [joined]);
7601
+ return React18.useMemo(
7491
7602
  () => ({
7492
7603
  has: (key) => set.has(key),
7493
7604
  add: (key) => {
@@ -7503,7 +7614,7 @@ function useOptimisticFlowSet(flowId) {
7503
7614
  function useReconcileFlowSet(flowId, presentKeys) {
7504
7615
  const data = useAgentFlow(flowId);
7505
7616
  const presentJoined = presentKeys === null ? null : [...presentKeys].join("\0");
7506
- React17.useEffect(() => {
7617
+ React18.useEffect(() => {
7507
7618
  if (presentKeys === null) return;
7508
7619
  const keys = readKeys(data);
7509
7620
  if (keys.length === 0) return;
@@ -7525,7 +7636,7 @@ var useUndismissedFacts = useVisibleFactList;
7525
7636
  function useForgetFact() {
7526
7637
  const { sendImmediateSignal } = useFourtySession();
7527
7638
  const dismissed = useOptimisticFlowSet(DISMISSED_FLOW);
7528
- const forget = React18.useCallback(
7639
+ const forget = React19.useCallback(
7529
7640
  (f) => {
7530
7641
  dismissed.add(f.label);
7531
7642
  sendImmediateSignal({ type: PRESENCE_FACT_DISMISS_SIGNAL, payload: { label: f.label, value: f.value } });
@@ -7576,7 +7687,7 @@ function useConversationPage() {
7576
7687
  const presence = useConversationPresence();
7577
7688
  const suggestions = useSuggestionsWithDefaults();
7578
7689
  const followUp = useComposerChipSelect();
7579
- const onWelcomePage = React19.useMemo(
7690
+ const onWelcomePage = React20.useMemo(
7580
7691
  () => seedLayout !== null && JSON.stringify(layout) === JSON.stringify(seedLayout),
7581
7692
  [layout, seedLayout]
7582
7693
  );
@@ -7652,7 +7763,7 @@ function ThreadHeadroom() {
7652
7763
  }
7653
7764
 
7654
7765
  // src/shell/thread-scroll/use-pin-turn-to-top.ts
7655
- import * as React20 from "react";
7766
+ import * as React21 from "react";
7656
7767
 
7657
7768
  // src/canvas/dom-targets.ts
7658
7769
  var ACTIVE_PANEL_ATTR = "data-fourty-panel-active";
@@ -7676,14 +7787,21 @@ function firstMatch(scroller, selector) {
7676
7787
  }
7677
7788
  return null;
7678
7789
  }
7790
+ function elementWrapper(scroller, elementId) {
7791
+ const matches = Array.from(scroller.querySelectorAll(`${ACTIVE_PANEL_SELECTOR} [data-fourty-element="${CSS.escape(elementId)}"]`));
7792
+ for (let i = matches.length - 1; i >= 0; i--) {
7793
+ const match = matches[i];
7794
+ if (match instanceof HTMLElement) return match;
7795
+ }
7796
+ return null;
7797
+ }
7679
7798
  function findElementScrollTarget(scroller, elementId) {
7680
- const selector = `${ACTIVE_PANEL_SELECTOR} [data-fourty-element="${CSS.escape(elementId)}"]`;
7681
- const wrapper = firstMatch(scroller, selector);
7799
+ const wrapper = elementWrapper(scroller, elementId);
7682
7800
  if (wrapper === null) return null;
7683
7801
  return findScrollTarget(wrapper);
7684
7802
  }
7685
7803
  function findChangeAnchorTarget(scroller, anchor) {
7686
- const wrapper = firstMatch(scroller, `${ACTIVE_PANEL_SELECTOR} [data-fourty-element="${CSS.escape(anchor.elementId)}"]`);
7804
+ const wrapper = elementWrapper(scroller, anchor.elementId);
7687
7805
  if (wrapper === null) return null;
7688
7806
  const item = findChangeAnchorItem(scroller, anchor);
7689
7807
  if (item !== null) return item;
@@ -7691,7 +7809,7 @@ function findChangeAnchorTarget(scroller, anchor) {
7691
7809
  }
7692
7810
  function findChangeAnchorItem(scroller, anchor) {
7693
7811
  if (anchor.refId === void 0) return null;
7694
- const wrapper = firstMatch(scroller, `${ACTIVE_PANEL_SELECTOR} [data-fourty-element="${CSS.escape(anchor.elementId)}"]`);
7812
+ const wrapper = elementWrapper(scroller, anchor.elementId);
7695
7813
  if (wrapper === null) return null;
7696
7814
  return firstMatch(wrapper, `[data-flip-id="${CSS.escape(anchor.refId)}"]`);
7697
7815
  }
@@ -7829,7 +7947,7 @@ function pinTurnHead(scroller, row, options) {
7829
7947
 
7830
7948
  // src/shell/thread-scroll/use-pin-turn-to-top.ts
7831
7949
  function usePinTurnToTop({ scrollerRef, turnRef, turnId }) {
7832
- React20.useEffect(() => {
7950
+ React21.useEffect(() => {
7833
7951
  if (turnId === null) return;
7834
7952
  const scroller = scrollerRef.current;
7835
7953
  const row = turnRef.current;
@@ -7850,10 +7968,10 @@ function usePinTurnToTop({ scrollerRef, turnRef, turnId }) {
7850
7968
  }
7851
7969
 
7852
7970
  // src/shell/thread-scroll/use-scroll-has-more-below.ts
7853
- import * as React21 from "react";
7971
+ import * as React22 from "react";
7854
7972
  function useScrollHasMoreBelow(scroller, thresholdPx = 16) {
7855
- const [hasMore, setHasMore] = React21.useState(false);
7856
- React21.useEffect(() => {
7973
+ const [hasMore, setHasMore] = React22.useState(false);
7974
+ React22.useEffect(() => {
7857
7975
  if (scroller === null) return;
7858
7976
  const view = scroller.ownerDocument.defaultView;
7859
7977
  if (view === null) return;
@@ -7893,9 +8011,9 @@ function threadRowAttrs(key) {
7893
8011
  }
7894
8012
 
7895
8013
  // src/shell/thread-scroll/use-thread-jump-marks.ts
7896
- import * as React22 from "react";
8014
+ import * as React23 from "react";
7897
8015
  function useThreadJumpMarks(rows) {
7898
- return React22.useMemo(
8016
+ return React23.useMemo(
7899
8017
  () => rows.filter((row) => row.visitorText.length > 0).map((row) => ({
7900
8018
  key: row.key,
7901
8019
  label: row.visitorText,
@@ -7909,7 +8027,7 @@ function useThreadJumpMarks(rows) {
7909
8027
  }
7910
8028
 
7911
8029
  // src/shell/thread-scroll/use-thread-landing.ts
7912
- import * as React23 from "react";
8030
+ import * as React24 from "react";
7913
8031
 
7914
8032
  // src/shell/thread-scroll/settle-thread-row.ts
7915
8033
  var SETTLE_MS = 1200;
@@ -7973,11 +8091,11 @@ function settleThreadRow(scroller, rowKey, behavior = "smooth") {
7973
8091
  }
7974
8092
 
7975
8093
  // src/shell/thread-scroll/use-thread-landing.ts
7976
- var useIsomorphicLayoutEffect = typeof window === "undefined" ? React23.useEffect : React23.useLayoutEffect;
8094
+ var useIsomorphicLayoutEffect = typeof window === "undefined" ? React24.useEffect : React24.useLayoutEffect;
7977
8095
  function useThreadLanding(scroller, relandKey = 0) {
7978
8096
  const { turnId, seq } = useExplicitTurnSelection();
7979
- const openedWith = React23.useRef({ turnId, seq });
7980
- const landedRef = React23.useRef(null);
8097
+ const openedWith = React24.useRef({ turnId, seq });
8098
+ const landedRef = React24.useRef(null);
7981
8099
  useIsomorphicLayoutEffect(() => {
7982
8100
  if (scroller === null) return;
7983
8101
  if (turnId !== null) {
@@ -8032,22 +8150,22 @@ function useRegisterSignalHandlers(handlers) {
8032
8150
  var AGENT_ASK_SIGNAL = "agent_ask";
8033
8151
 
8034
8152
  // src/provider/use-clamp-toggle.ts
8035
- import React24 from "react";
8153
+ import React25 from "react";
8036
8154
 
8037
8155
  // src/shared/use-expandable.ts
8038
- import { useCallback as useCallback10, useState as useState5 } from "react";
8156
+ import { useCallback as useCallback11, useState as useState5 } from "react";
8039
8157
  function useExpandable(initial = false) {
8040
8158
  const [expanded, setExpanded] = useState5(initial);
8041
- const toggle = useCallback10(() => setExpanded((p) => !p), []);
8159
+ const toggle = useCallback11(() => setExpanded((p) => !p), []);
8042
8160
  return { expanded, toggle, setExpanded };
8043
8161
  }
8044
8162
 
8045
8163
  // src/provider/use-clamp-toggle.ts
8046
8164
  function useClampToggle(contentKey) {
8047
8165
  const { expanded, toggle } = useExpandable(false);
8048
- const [overflowing, setOverflowing] = React24.useState(false);
8049
- const ref = React24.useRef(null);
8050
- React24.useEffect(() => {
8166
+ const [overflowing, setOverflowing] = React25.useState(false);
8167
+ const ref = React25.useRef(null);
8168
+ React25.useEffect(() => {
8051
8169
  const el = ref.current;
8052
8170
  if (el === null) return;
8053
8171
  if (expanded) return;
@@ -8063,16 +8181,16 @@ function useClampToggle(contentKey) {
8063
8181
  }
8064
8182
 
8065
8183
  // src/provider/use-timed-flag.ts
8066
- import React25 from "react";
8184
+ import React26 from "react";
8067
8185
  function useTimedFlag(durationMs) {
8068
- const [flag, setFlag] = React25.useState(false);
8069
- const timerRef = React25.useRef(null);
8070
- React25.useEffect(() => {
8186
+ const [flag, setFlag] = React26.useState(false);
8187
+ const timerRef = React26.useRef(null);
8188
+ React26.useEffect(() => {
8071
8189
  return () => {
8072
8190
  if (timerRef.current !== null) window.clearTimeout(timerRef.current);
8073
8191
  };
8074
8192
  }, []);
8075
- const trigger = React25.useCallback(() => {
8193
+ const trigger = React26.useCallback(() => {
8076
8194
  if (timerRef.current !== null) window.clearTimeout(timerRef.current);
8077
8195
  setFlag(true);
8078
8196
  timerRef.current = window.setTimeout(() => {
@@ -8095,9 +8213,11 @@ __export(canvas_exports, {
8095
8213
  CanvasOutletProvider: () => CanvasOutletProvider,
8096
8214
  CanvasTailMount: () => CanvasTailMount,
8097
8215
  CanvasTailProvider: () => CanvasTailProvider,
8216
+ CanvasTurnTailProvider: () => CanvasTurnTailProvider,
8098
8217
  DEFAULT_GENERATION_STYLE: () => DEFAULT_GENERATION_STYLE,
8099
8218
  DEFAULT_GENERATION_TIMINGS: () => DEFAULT_GENERATION_TIMINGS,
8100
8219
  ElementIdContext: () => ElementIdContext,
8220
+ ElementLayoutContext: () => ElementLayoutContext,
8101
8221
  FadeTransition: () => FadeTransition,
8102
8222
  FourtyRuntimeProvider: () => FourtyRuntimeProvider,
8103
8223
  GENERATION_EASE: () => GENERATION_EASE,
@@ -8108,6 +8228,7 @@ __export(canvas_exports, {
8108
8228
  ItemTransitionGroup: () => ItemTransitionGroup,
8109
8229
  ShimmerSweep: () => ShimmerSweep,
8110
8230
  SpacefrontCanvas: () => SpacefrontCanvas,
8231
+ TURN_TAIL_ATTR: () => TURN_TAIL_ATTR,
8111
8232
  TransitionProvider: () => TransitionProvider,
8112
8233
  anchorLineOf: () => anchorLineOf,
8113
8234
  arraysEqual: () => arraysEqual,
@@ -8136,6 +8257,7 @@ __export(canvas_exports, {
8136
8257
  setNavScrollActive: () => setNavScrollActive,
8137
8258
  turnEditedBlock: () => turnEditedBlock,
8138
8259
  turnOwnsView: () => turnOwnsView,
8260
+ turnTailSlots: () => turnTailSlots,
8139
8261
  useAgentDriven: () => useAgentDriven,
8140
8262
  useCanvasActions: () => useCanvasActions,
8141
8263
  useCanvasArrangement: () => useCanvasArrangement,
@@ -8145,6 +8267,7 @@ __export(canvas_exports, {
8145
8267
  useCanvasLeadTarget: () => useCanvasLeadTarget,
8146
8268
  useCanvasMotionStyle: () => useCanvasMotionStyle,
8147
8269
  useCanvasTail: () => useCanvasTail,
8270
+ useCanvasTurnTail: () => useCanvasTurnTail,
8148
8271
  useCanvasViewBack: () => useCanvasViewBack,
8149
8272
  useComposerPlaceholder: () => useComposerPlaceholder,
8150
8273
  useComposerPlaceholderRotation: () => useComposerPlaceholderRotation,
@@ -8154,6 +8277,7 @@ __export(canvas_exports, {
8154
8277
  useCurrentMessageIndex: () => useCurrentMessageIndex,
8155
8278
  useDisplayedLayout: () => useDisplayedLayout,
8156
8279
  useElementId: () => useElementId,
8280
+ useElementLayout: () => useElementLayout,
8157
8281
  useExplicitTurnId: () => useExplicitTurnId,
8158
8282
  useExplicitTurnSelection: () => useExplicitTurnSelection,
8159
8283
  useFacts: () => useFacts,
@@ -8187,9 +8311,9 @@ __export(canvas_exports, {
8187
8311
  });
8188
8312
 
8189
8313
  // src/canvas/canvas-tail.tsx
8190
- import * as React26 from "react";
8314
+ import * as React27 from "react";
8191
8315
  import { jsx as jsx9 } from "react/jsx-runtime";
8192
- var CanvasTailContext = React26.createContext(null);
8316
+ var CanvasTailContext = React27.createContext(null);
8193
8317
  function CanvasTailProvider({
8194
8318
  tail,
8195
8319
  children
@@ -8197,7 +8321,7 @@ function CanvasTailProvider({
8197
8321
  return /* @__PURE__ */ jsx9(CanvasTailContext.Provider, { value: tail, children });
8198
8322
  }
8199
8323
  function useCanvasTail() {
8200
- return React26.useContext(CanvasTailContext);
8324
+ return React27.useContext(CanvasTailContext);
8201
8325
  }
8202
8326
  function CanvasTailMount({
8203
8327
  isActive
@@ -8264,13 +8388,13 @@ function ShimmerSweep({ durationS }) {
8264
8388
  }
8265
8389
 
8266
8390
  // src/canvas/TransitionContext.tsx
8267
- import React27, { createContext as createContext13, useContext as useContext13 } from "react";
8391
+ import React28, { createContext as createContext13, useContext as useContext13 } from "react";
8268
8392
  import { AnimatePresence, motion as motion2 } from "framer-motion";
8269
8393
  import { jsx as jsx11 } from "react/jsx-runtime";
8270
8394
  function FadeGroup({ children }) {
8271
8395
  return /* @__PURE__ */ jsx11(AnimatePresence, { mode: "popLayout", initial: false, children });
8272
8396
  }
8273
- var FadeItem = React27.forwardRef(function FadeItem2({ id, children, style, className }, ref) {
8397
+ var FadeItem = React28.forwardRef(function FadeItem2({ id, children, style, className }, ref) {
8274
8398
  return /* @__PURE__ */ jsx11(
8275
8399
  motion2.div,
8276
8400
  {
@@ -8298,15 +8422,16 @@ function useLayoutTransition() {
8298
8422
  }
8299
8423
 
8300
8424
  // src/canvas/canvas-arrangement.tsx
8301
- import React28, { createContext as createContext14, useContext as useContext14 } from "react";
8425
+ import React29, { createContext as createContext14, useContext as useContext14 } from "react";
8302
8426
  import { jsx as jsx12 } from "react/jsx-runtime";
8303
- var CanvasArrangementContext = createContext14({ arrangement: "stack", turnPages: false });
8427
+ var CanvasArrangementContext = createContext14({ arrangement: "stack", turnPages: false, stackedTurns: false });
8304
8428
  function CanvasArrangementProvider({
8305
8429
  arrangement,
8306
8430
  turnPages = false,
8431
+ stackedTurns = false,
8307
8432
  children
8308
8433
  }) {
8309
- const value = React28.useMemo(() => ({ arrangement, turnPages }), [arrangement, turnPages]);
8434
+ const value = React29.useMemo(() => ({ arrangement, turnPages, stackedTurns }), [arrangement, turnPages, stackedTurns]);
8310
8435
  return /* @__PURE__ */ jsx12(CanvasArrangementContext.Provider, { value, children });
8311
8436
  }
8312
8437
  function useCanvasArrangement() {
@@ -8314,56 +8439,85 @@ function useCanvasArrangement() {
8314
8439
  }
8315
8440
 
8316
8441
  // src/canvas/canvas-lead.tsx
8317
- import * as React29 from "react";
8442
+ import * as React30 from "react";
8318
8443
  import { jsx as jsx13 } from "react/jsx-runtime";
8319
8444
  var NO_LEAD = () => false;
8320
- var CanvasLeadContext = React29.createContext(null);
8445
+ var CanvasLeadContext = React30.createContext(null);
8321
8446
  function CanvasLeadProvider(props) {
8322
- const [target, setTarget] = React29.useState(null);
8323
- const [leadId, setLeadId] = React29.useState(null);
8447
+ const [target, setTarget] = React30.useState(null);
8448
+ const [leadId, setLeadId] = React30.useState(null);
8324
8449
  const listed = "types" in props ? props.types : props.except;
8325
8450
  const only = "types" in props;
8326
- const canLead = React29.useCallback((type) => listed.includes(type) === only, [listed, only]);
8327
- const value = React29.useMemo(() => ({ canLead, target, setTarget, leadId, setLeadId }), [canLead, target, leadId]);
8451
+ const canLead = React30.useCallback((type) => listed.includes(type) === only, [listed, only]);
8452
+ const value = React30.useMemo(() => ({ canLead, target, setTarget, leadId, setLeadId }), [canLead, target, leadId]);
8328
8453
  return /* @__PURE__ */ jsx13(CanvasLeadContext.Provider, { value, children: props.children });
8329
8454
  }
8330
8455
  function CanvasLeadSlot({ className }) {
8331
- const lead = React29.useContext(CanvasLeadContext);
8456
+ const lead = React30.useContext(CanvasLeadContext);
8332
8457
  if (lead === null) throw new Error("<CanvasLeadSlot> must be rendered inside <CanvasLeadProvider>.");
8333
8458
  const { setTarget } = lead;
8334
- const ref = React29.useCallback((el) => setTarget(el), [setTarget]);
8459
+ const ref = React30.useCallback((el) => setTarget(el), [setTarget]);
8335
8460
  return /* @__PURE__ */ jsx13("div", { ref, className, "data-fourty-canvas-lead": "" });
8336
8461
  }
8337
8462
  function useCanvasLead() {
8338
- const lead = React29.useContext(CanvasLeadContext);
8463
+ const lead = React30.useContext(CanvasLeadContext);
8339
8464
  return { present: lead !== null && lead.target !== null && lead.leadId !== null };
8340
8465
  }
8341
8466
  function useCanvasLeadTarget() {
8342
- const lead = React29.useContext(CanvasLeadContext);
8467
+ const lead = React30.useContext(CanvasLeadContext);
8343
8468
  const setLeadId = lead === null ? null : lead.setLeadId;
8344
- const report = React29.useCallback((id) => {
8469
+ const report = React30.useCallback((id) => {
8345
8470
  if (setLeadId !== null) setLeadId(id);
8346
8471
  }, [setLeadId]);
8347
8472
  if (lead === null) return { canLead: NO_LEAD, target: null, report };
8348
8473
  return { canLead: lead.canLead, target: lead.target, report };
8349
8474
  }
8350
8475
 
8351
- // src/canvas/canvas-motion-style.tsx
8352
- import { createContext as createContext16, useContext as useContext16 } from "react";
8476
+ // src/canvas/canvas-turn-tail.tsx
8477
+ import * as React31 from "react";
8353
8478
  import { jsx as jsx14 } from "react/jsx-runtime";
8354
- var CanvasMotionStyleContext = createContext16(null);
8479
+ var TURN_TAIL_ATTR = "data-fourty-turn-tail";
8480
+ var CanvasTurnTailContext = React31.createContext(null);
8481
+ function CanvasTurnTailProvider({
8482
+ tail,
8483
+ children
8484
+ }) {
8485
+ return /* @__PURE__ */ jsx14(CanvasTurnTailContext.Provider, { value: tail, children });
8486
+ }
8487
+ function useCanvasTurnTail() {
8488
+ return React31.useContext(CanvasTurnTailContext);
8489
+ }
8490
+ function turnTailSlots(keys, turnOf, newest) {
8491
+ const last = /* @__PURE__ */ new Map();
8492
+ keys.forEach((key, index) => {
8493
+ const turn = turnOf(key);
8494
+ if (turn !== void 0) last.set(turn, index);
8495
+ });
8496
+ const after = /* @__PURE__ */ new Map();
8497
+ for (const [turn, index] of last) after.set(index, turn);
8498
+ return { after, end: newest !== null && !last.has(newest) ? newest : null };
8499
+ }
8500
+
8501
+ // src/canvas/canvas-motion-style.tsx
8502
+ import { createContext as createContext17, useContext as useContext17 } from "react";
8503
+ import { jsx as jsx15 } from "react/jsx-runtime";
8504
+ var CanvasMotionStyleContext = createContext17(null);
8355
8505
  function CanvasMotionStyleProvider({ style, children }) {
8356
- return /* @__PURE__ */ jsx14(CanvasMotionStyleContext.Provider, { value: style, children });
8506
+ return /* @__PURE__ */ jsx15(CanvasMotionStyleContext.Provider, { value: style, children });
8357
8507
  }
8358
8508
  function useCanvasMotionStyle() {
8359
- return useContext16(CanvasMotionStyleContext);
8509
+ return useContext17(CanvasMotionStyleContext);
8360
8510
  }
8361
8511
 
8362
8512
  // src/canvas/ElementIdContext.ts
8363
- import { createContext as createContext17, useContext as useContext17 } from "react";
8364
- var ElementIdContext = createContext17(null);
8513
+ import { createContext as createContext18, useContext as useContext18 } from "react";
8514
+ var ElementIdContext = createContext18(null);
8365
8515
  function useElementId() {
8366
- return useContext17(ElementIdContext);
8516
+ return useContext18(ElementIdContext);
8517
+ }
8518
+ var ElementLayoutContext = createContext18(null);
8519
+ function useElementLayout() {
8520
+ return useContext18(ElementLayoutContext);
8367
8521
  }
8368
8522
 
8369
8523
  // src/canvas/generation-entrance.ts
@@ -8437,27 +8591,27 @@ var INITIAL_NAV_PRESENTATION = {
8437
8591
  };
8438
8592
 
8439
8593
  // src/canvas/use-canvas-actions.ts
8440
- import { useCallback as useCallback12 } from "react";
8594
+ import { useCallback as useCallback13 } from "react";
8441
8595
  function navigateActionId(page) {
8442
8596
  const id = Reflect.get(page, "id");
8443
8597
  return typeof id === "string" ? `navigate-${page.kind}-${id}` : `navigate-${page.kind}`;
8444
8598
  }
8445
8599
  function useCanvasActions() {
8446
8600
  const session = useOptionalFourtySession();
8447
- const dispatchAction = useCallback12(
8601
+ const dispatchAction = useCallback13(
8448
8602
  (action) => {
8449
8603
  if (!session) return;
8450
8604
  session.dispatchSuggestionAction(action);
8451
8605
  },
8452
8606
  [session]
8453
8607
  );
8454
- const navigate = useCallback12(
8608
+ const navigate = useCallback13(
8455
8609
  (page, label) => {
8456
8610
  dispatchAction({ id: navigateActionId(page), label, type: NAVIGATE_SIGNAL, payload: { page } });
8457
8611
  },
8458
8612
  [dispatchAction]
8459
8613
  );
8460
- const ask = useCallback12(
8614
+ const ask = useCallback13(
8461
8615
  (text2, label) => {
8462
8616
  dispatchAction({ id: `ask-${label}`, label, type: "message", payload: { text: text2 } });
8463
8617
  },
@@ -8623,22 +8777,22 @@ function deriveTurnChangeAnchor(prev, next) {
8623
8777
  }
8624
8778
 
8625
8779
  // src/canvas/canvas-outlet.tsx
8626
- import { createContext as createContext18, useContext as useContext18 } from "react";
8627
- import { jsx as jsx15 } from "react/jsx-runtime";
8628
- var CanvasOutletContext = createContext18(null);
8780
+ import { createContext as createContext19, useContext as useContext19 } from "react";
8781
+ import { jsx as jsx16 } from "react/jsx-runtime";
8782
+ var CanvasOutletContext = createContext19(null);
8629
8783
  function CanvasOutletProvider({ canvas, children }) {
8630
- return /* @__PURE__ */ jsx15(CanvasOutletContext.Provider, { value: canvas, children });
8784
+ return /* @__PURE__ */ jsx16(CanvasOutletContext.Provider, { value: canvas, children });
8631
8785
  }
8632
8786
  function SpacefrontCanvas() {
8633
- const Canvas = useContext18(CanvasOutletContext);
8787
+ const Canvas = useContext19(CanvasOutletContext);
8634
8788
  if (Canvas === null) {
8635
8789
  throw new Error("<SpacefrontCanvas> must be rendered inside <Spacefront> \u2014 no engine has provided a canvas.");
8636
8790
  }
8637
- return /* @__PURE__ */ jsx15(Canvas, {});
8791
+ return /* @__PURE__ */ jsx16(Canvas, {});
8638
8792
  }
8639
8793
 
8640
8794
  // src/canvas/item-motion/ItemTransitionGroup.tsx
8641
- import React31 from "react";
8795
+ import React33 from "react";
8642
8796
  import { AnimatePresence as AnimatePresence2, motion as motion3, useReducedMotion as useReducedMotion2 } from "framer-motion";
8643
8797
 
8644
8798
  // src/canvas/item-motion/classify-items.ts
@@ -8857,7 +9011,7 @@ function getActiveProfile() {
8857
9011
  }
8858
9012
 
8859
9013
  // src/canvas/item-motion/ItemTransitionGroup.tsx
8860
- import { jsx as jsx16 } from "react/jsx-runtime";
9014
+ import { jsx as jsx17 } from "react/jsx-runtime";
8861
9015
  var ITEM_IDENTITY_ATTR = "data-flip-id";
8862
9016
  function ItemTransitionGroup({
8863
9017
  items,
@@ -8872,14 +9026,14 @@ function ItemTransitionGroup({
8872
9026
  const profile = getActiveProfile();
8873
9027
  const animated = reduce !== true;
8874
9028
  const ids = items.map(getId);
8875
- const prevIdsRef = React31.useRef(null);
8876
- const lastChangeRef = React31.useRef(null);
9029
+ const prevIdsRef = React33.useRef(null);
9030
+ const lastChangeRef = React33.useRef(null);
8877
9031
  const prevIds = prevIdsRef.current;
8878
9032
  const freshChange = prevIds === null ? null : classifyItemChange(prevIds, ids);
8879
9033
  if (freshChange !== null) {
8880
9034
  lastChangeRef.current = freshChange;
8881
9035
  }
8882
- React31.useEffect(() => {
9036
+ React33.useEffect(() => {
8883
9037
  prevIdsRef.current = ids;
8884
9038
  });
8885
9039
  const activeChange = lastChangeRef.current;
@@ -8892,7 +9046,7 @@ function ItemTransitionGroup({
8892
9046
  const isGrid = itemClassName === void 0;
8893
9047
  const outerClassName = isGrid ? "h-full" : itemClassName;
8894
9048
  const innerClassName = isGrid ? "h-full" : void 0;
8895
- return /* @__PURE__ */ jsx16("div", { className, style, children: /* @__PURE__ */ jsx16(AnimatePresence2, { mode: "popLayout", initial: false, children: items.map((item) => {
9049
+ return /* @__PURE__ */ jsx17("div", { className, style, children: /* @__PURE__ */ jsx17(AnimatePresence2, { mode: "popLayout", initial: false, children: items.map((item) => {
8896
9050
  const id = getId(item);
8897
9051
  const identityAttr = { [ITEM_IDENTITY_ATTR]: id };
8898
9052
  const isEntering = activeChange !== null && activeChange.entered.includes(id);
@@ -8902,7 +9056,7 @@ function ItemTransitionGroup({
8902
9056
  // `itemClassName`/`itemStyle` size the wrapper for flex/snap
8903
9057
  // layouts (carousel); grid layouts leave them unset and get
8904
9058
  // `h-full` so the cell height reaches the card.
8905
- /* @__PURE__ */ jsx16(
9059
+ /* @__PURE__ */ jsx17(
8906
9060
  motion3.div,
8907
9061
  {
8908
9062
  ...identityAttr,
@@ -8911,7 +9065,7 @@ function ItemTransitionGroup({
8911
9065
  layout: animated ? "position" : void 0,
8912
9066
  layoutDependency,
8913
9067
  transition: animated ? layoutTransition : void 0,
8914
- children: /* @__PURE__ */ jsx16(
9068
+ children: /* @__PURE__ */ jsx17(
8915
9069
  motion3.div,
8916
9070
  {
8917
9071
  className: innerClassName,
@@ -8992,21 +9146,21 @@ __export(catalog_exports, {
8992
9146
  });
8993
9147
 
8994
9148
  // src/catalog/DebugContext.tsx
8995
- import { createContext as createContext19, useContext as useContext19 } from "react";
8996
- import { jsx as jsx17 } from "react/jsx-runtime";
8997
- var DebugContext = createContext19(false);
9149
+ import { createContext as createContext20, useContext as useContext20 } from "react";
9150
+ import { jsx as jsx18 } from "react/jsx-runtime";
9151
+ var DebugContext = createContext20(false);
8998
9152
  function DebugProvider({
8999
9153
  debug,
9000
9154
  children
9001
9155
  }) {
9002
- return /* @__PURE__ */ jsx17(DebugContext.Provider, { value: debug, children });
9156
+ return /* @__PURE__ */ jsx18(DebugContext.Provider, { value: debug, children });
9003
9157
  }
9004
9158
  function useDebug() {
9005
- return useContext19(DebugContext);
9159
+ return useContext20(DebugContext);
9006
9160
  }
9007
9161
 
9008
9162
  // src/catalog/HydrationStateContext.tsx
9009
- import { createContext as createContext20, useContext as useContext20 } from "react";
9163
+ import { createContext as createContext21, useContext as useContext21 } from "react";
9010
9164
  var DEFAULT_STATE = {
9011
9165
  hasResolvedFields: false,
9012
9166
  hydrating: false,
@@ -9016,47 +9170,47 @@ var DEFAULT_STATE = {
9016
9170
  pendingCount: 0,
9017
9171
  errors: []
9018
9172
  };
9019
- var HydrationStateContext = createContext20(DEFAULT_STATE);
9173
+ var HydrationStateContext = createContext21(DEFAULT_STATE);
9020
9174
  function useHydrationState() {
9021
- return useContext20(HydrationStateContext);
9175
+ return useContext21(HydrationStateContext);
9022
9176
  }
9023
9177
 
9024
9178
  // src/catalog/HydratorContext.tsx
9025
- import { createContext as createContext21, useContext as useContext21 } from "react";
9026
- import { jsx as jsx18 } from "react/jsx-runtime";
9027
- var HydratorContext = createContext21({});
9179
+ import { createContext as createContext22, useContext as useContext22 } from "react";
9180
+ import { jsx as jsx19 } from "react/jsx-runtime";
9181
+ var HydratorContext = createContext22({});
9028
9182
  function HydratorProvider({
9029
9183
  hydrators,
9030
9184
  children
9031
9185
  }) {
9032
- return /* @__PURE__ */ jsx18(HydratorContext.Provider, { value: hydrators, children });
9186
+ return /* @__PURE__ */ jsx19(HydratorContext.Provider, { value: hydrators, children });
9033
9187
  }
9034
9188
  function useHydrators() {
9035
- return useContext21(HydratorContext);
9189
+ return useContext22(HydratorContext);
9036
9190
  }
9037
9191
 
9038
9192
  // src/catalog/registry.tsx
9039
- import { createContext as createContext22, useContext as useContext22 } from "react";
9040
- import { jsx as jsx19 } from "react/jsx-runtime";
9041
- var RegistryContext = createContext22({});
9193
+ import { createContext as createContext23, useContext as useContext23 } from "react";
9194
+ import { jsx as jsx20 } from "react/jsx-runtime";
9195
+ var RegistryContext = createContext23({});
9042
9196
  function RegistryProvider({
9043
9197
  registry: registry2,
9044
9198
  children
9045
9199
  }) {
9046
- return /* @__PURE__ */ jsx19(RegistryContext.Provider, { value: registry2, children });
9200
+ return /* @__PURE__ */ jsx20(RegistryContext.Provider, { value: registry2, children });
9047
9201
  }
9048
9202
  function useRegistry() {
9049
- return useContext22(RegistryContext);
9203
+ return useContext23(RegistryContext);
9050
9204
  }
9051
- var PackageLookupContext = createContext22(null);
9205
+ var PackageLookupContext = createContext23(null);
9052
9206
  function PackageLookupProvider({
9053
9207
  lookup,
9054
9208
  children
9055
9209
  }) {
9056
- return /* @__PURE__ */ jsx19(PackageLookupContext.Provider, { value: lookup, children });
9210
+ return /* @__PURE__ */ jsx20(PackageLookupContext.Provider, { value: lookup, children });
9057
9211
  }
9058
9212
  function usePackageLookup() {
9059
- return useContext22(PackageLookupContext);
9213
+ return useContext23(PackageLookupContext);
9060
9214
  }
9061
9215
  function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
9062
9216
  return new Proxy(baseRegistry, {
@@ -9087,7 +9241,7 @@ function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
9087
9241
  }
9088
9242
 
9089
9243
  // src/catalog/render-inline.tsx
9090
- import React34 from "react";
9244
+ import React36 from "react";
9091
9245
 
9092
9246
  // src/catalog/prose-links.ts
9093
9247
  var LINK = /\[([^\]\n]+)\]\(([^)\s]+)\)/g;
@@ -9113,8 +9267,8 @@ function proseRuns(text2) {
9113
9267
  }
9114
9268
 
9115
9269
  // src/catalog/render-inline.tsx
9116
- import { jsx as jsx20 } from "react/jsx-runtime";
9117
- var linkRenderer = (href, key) => /* @__PURE__ */ jsx20(
9270
+ import { jsx as jsx21 } from "react/jsx-runtime";
9271
+ var linkRenderer = (href, key) => /* @__PURE__ */ jsx21(
9118
9272
  "a",
9119
9273
  {
9120
9274
  className: "fourty-inline-link",
@@ -9130,7 +9284,7 @@ function linkifyText(text2, keyPrefix) {
9130
9284
  return proseRuns(text2).flatMap((run, r) => {
9131
9285
  if (run.href === void 0) return linkifyBareUrls(run.text, `${keyPrefix}-${String(r)}`);
9132
9286
  return [
9133
- /* @__PURE__ */ jsx20("a", { className: "fourty-inline-link", href: run.href, target: "_blank", rel: "noopener noreferrer", children: run.text }, `${keyPrefix}-${String(r)}-ll`)
9287
+ /* @__PURE__ */ jsx21("a", { className: "fourty-inline-link", href: run.href, target: "_blank", rel: "noopener noreferrer", children: run.text }, `${keyPrefix}-${String(r)}-ll`)
9134
9288
  ];
9135
9289
  });
9136
9290
  }
@@ -9142,14 +9296,14 @@ function linkifyBareUrls(text2, keyPrefix) {
9142
9296
  URL_RE.lastIndex = 0;
9143
9297
  while ((match = URL_RE.exec(text2)) !== null) {
9144
9298
  if (match.index > last) {
9145
- out.push(/* @__PURE__ */ jsx20(React34.Fragment, { children: text2.slice(last, match.index) }, `${keyPrefix}-lt-${i++}`));
9299
+ out.push(/* @__PURE__ */ jsx21(React36.Fragment, { children: text2.slice(last, match.index) }, `${keyPrefix}-lt-${i++}`));
9146
9300
  }
9147
9301
  const href = match[0];
9148
9302
  out.push(linkRenderer(href, `${keyPrefix}-lk-${i++}`));
9149
9303
  last = match.index + href.length;
9150
9304
  }
9151
9305
  if (last < text2.length) {
9152
- out.push(/* @__PURE__ */ jsx20(React34.Fragment, { children: text2.slice(last) }, `${keyPrefix}-lt-${i++}`));
9306
+ out.push(/* @__PURE__ */ jsx21(React36.Fragment, { children: text2.slice(last) }, `${keyPrefix}-lt-${i++}`));
9153
9307
  }
9154
9308
  return out;
9155
9309
  }
@@ -9162,8 +9316,8 @@ function renderInline(text2, keyPrefix) {
9162
9316
  while ((match = re.exec(text2)) !== null) {
9163
9317
  if (match.index > last) out.push(...linkifyText(text2.slice(last, match.index), `${keyPrefix}-t-${i++}`));
9164
9318
  const bold = match[1];
9165
- if (bold !== void 0) out.push(/* @__PURE__ */ jsx20("strong", { children: bold }, `${keyPrefix}-b-${i++}`));
9166
- else out.push(/* @__PURE__ */ jsx20("em", { children: match[2] }, `${keyPrefix}-i-${i++}`));
9319
+ if (bold !== void 0) out.push(/* @__PURE__ */ jsx21("strong", { children: bold }, `${keyPrefix}-b-${i++}`));
9320
+ else out.push(/* @__PURE__ */ jsx21("em", { children: match[2] }, `${keyPrefix}-i-${i++}`));
9167
9321
  last = match.index + match[0].length;
9168
9322
  }
9169
9323
  if (last < text2.length) out.push(...linkifyText(text2.slice(last), `${keyPrefix}-t-${i++}`));
@@ -9171,7 +9325,7 @@ function renderInline(text2, keyPrefix) {
9171
9325
  }
9172
9326
 
9173
9327
  // src/catalog/component-library.ts
9174
- import * as React35 from "react";
9328
+ import * as React37 from "react";
9175
9329
  function displayNameOf(Inner) {
9176
9330
  if (typeof Inner === "string") return Inner;
9177
9331
  if (typeof Inner.displayName === "string" && Inner.displayName.length > 0) return Inner.displayName;
@@ -9180,7 +9334,7 @@ function displayNameOf(Inner) {
9180
9334
  }
9181
9335
  function adaptComponent(Inner) {
9182
9336
  function Adapted(props) {
9183
- return React35.createElement(Inner, props);
9337
+ return React37.createElement(Inner, props);
9184
9338
  }
9185
9339
  Adapted.displayName = displayNameOf(Inner);
9186
9340
  return Adapted;
@@ -9221,23 +9375,23 @@ function buildComponentLibrary(catalog, componentMap) {
9221
9375
  }
9222
9376
 
9223
9377
  // src/catalog/define.ts
9224
- import { z as z49 } from "zod";
9225
- var HYDRATED_ENTITY = z49.object({}).passthrough();
9378
+ import { z as z50 } from "zod";
9379
+ var HYDRATED_ENTITY = z50.object({}).passthrough();
9226
9380
  function entity(resolverKey, opts) {
9227
9381
  return resolved(HYDRATED_ENTITY, resolverKey, opts);
9228
9382
  }
9229
- var text = prose(z49.string());
9383
+ var text = prose(z50.string());
9230
9384
  function plain() {
9231
- return z49.string();
9385
+ return z50.string();
9232
9386
  }
9233
9387
  function token(values) {
9234
- return z49.enum(values);
9388
+ return z50.enum(values);
9235
9389
  }
9236
9390
  function catalogComponent(meta, render) {
9237
9391
  const { props, requires, ...rest } = meta;
9238
9392
  return {
9239
9393
  ...rest,
9240
- propsSchema: z49.object(props),
9394
+ propsSchema: z50.object(props),
9241
9395
  ...requires !== void 0 ? { requires } : {},
9242
9396
  component: adaptComponent(render)
9243
9397
  };
@@ -9577,7 +9731,7 @@ function useConsumeStandingSignal(type) {
9577
9731
  }
9578
9732
 
9579
9733
  // src/widgets/presence/use-presence-notch.ts
9580
- import * as React36 from "react";
9734
+ import * as React38 from "react";
9581
9735
  var SETTLE_DWELL_MS = 4e3;
9582
9736
  var HOVER_CLOSE_MS = 240;
9583
9737
  var HOVER_BOUNCE_WINDOW_MS = 800;
@@ -9585,21 +9739,21 @@ var BOUNCE_PX = 2;
9585
9739
  function usePresenceNotch(widgets) {
9586
9740
  const askStanding = useStandingOfType(AGENT_ASK_SIGNAL) !== null;
9587
9741
  const { isRunning } = useAgentPresence();
9588
- const [hovered, setHovered] = React36.useState(false);
9589
- const [openDrawerId, setOpenDrawerId] = React36.useState(null);
9590
- const rootRef = React36.useRef(null);
9591
- const toggleDrawer = React36.useCallback((id) => {
9742
+ const [hovered, setHovered] = React38.useState(false);
9743
+ const [openDrawerId, setOpenDrawerId] = React38.useState(null);
9744
+ const rootRef = React38.useRef(null);
9745
+ const toggleDrawer = React38.useCallback((id) => {
9592
9746
  setOpenDrawerId((current2) => current2 === id ? null : id);
9593
9747
  }, []);
9594
- const closeTimer = React36.useRef(null);
9595
- const cancelClose = React36.useCallback(() => {
9748
+ const closeTimer = React38.useRef(null);
9749
+ const cancelClose = React38.useCallback(() => {
9596
9750
  if (closeTimer.current !== null) {
9597
9751
  clearTimeout(closeTimer.current);
9598
9752
  closeTimer.current = null;
9599
9753
  }
9600
9754
  }, []);
9601
- const lastLeaveRef = React36.useRef(null);
9602
- const openHover = React36.useCallback((e) => {
9755
+ const lastLeaveRef = React38.useRef(null);
9756
+ const openHover = React38.useCallback((e) => {
9603
9757
  const last = lastLeaveRef.current;
9604
9758
  if (last !== null && Date.now() - last.t < HOVER_BOUNCE_WINDOW_MS && Math.abs(e.clientX - last.x) <= BOUNCE_PX && Math.abs(e.clientY - last.y) <= BOUNCE_PX) {
9605
9759
  return;
@@ -9607,7 +9761,7 @@ function usePresenceNotch(widgets) {
9607
9761
  cancelClose();
9608
9762
  setHovered(true);
9609
9763
  }, [cancelClose]);
9610
- const scheduleClose = React36.useCallback((e) => {
9764
+ const scheduleClose = React38.useCallback((e) => {
9611
9765
  lastLeaveRef.current = { x: e.clientX, y: e.clientY, t: Date.now() };
9612
9766
  cancelClose();
9613
9767
  closeTimer.current = setTimeout(() => {
@@ -9615,8 +9769,8 @@ function usePresenceNotch(widgets) {
9615
9769
  setHovered(false);
9616
9770
  }, HOVER_CLOSE_MS);
9617
9771
  }, [cancelClose]);
9618
- React36.useEffect(() => cancelClose, [cancelClose]);
9619
- React36.useEffect(() => {
9772
+ React38.useEffect(() => cancelClose, [cancelClose]);
9773
+ React38.useEffect(() => {
9620
9774
  if (openDrawerId === null) return;
9621
9775
  const onKey = (e) => {
9622
9776
  if (e.key === "Escape") setOpenDrawerId(null);
@@ -9624,7 +9778,7 @@ function usePresenceNotch(widgets) {
9624
9778
  window.addEventListener("keydown", onKey);
9625
9779
  return () => window.removeEventListener("keydown", onKey);
9626
9780
  }, [openDrawerId]);
9627
- React36.useEffect(() => {
9781
+ React38.useEffect(() => {
9628
9782
  if (openDrawerId === null) return;
9629
9783
  const onDown = (e) => {
9630
9784
  const root = rootRef.current;
@@ -9636,8 +9790,8 @@ function usePresenceNotch(widgets) {
9636
9790
  document.addEventListener("pointerdown", onDown);
9637
9791
  return () => document.removeEventListener("pointerdown", onDown);
9638
9792
  }, [openDrawerId]);
9639
- const [active, setActive] = React36.useState(false);
9640
- React36.useEffect(() => {
9793
+ const [active, setActive] = React38.useState(false);
9794
+ React38.useEffect(() => {
9641
9795
  if (isRunning) {
9642
9796
  setActive(true);
9643
9797
  return;
@@ -9797,7 +9951,7 @@ function presenceFactShape(fact) {
9797
9951
  }
9798
9952
 
9799
9953
  // src/widgets/presence/use-optimistic-facts.ts
9800
- import * as React37 from "react";
9954
+ import * as React39 from "react";
9801
9955
  function readEntries(data) {
9802
9956
  if (typeof data !== "object" || data === null || !("entries" in data)) return [];
9803
9957
  const raw = data.entries;
@@ -9816,7 +9970,7 @@ function writeOptimisticFact(entries3, fact) {
9816
9970
  }
9817
9971
  function useOptimisticFactOverlay(flowId) {
9818
9972
  const entries3 = readEntries(useAgentFlow(flowId));
9819
- return React37.useMemo(
9973
+ return React39.useMemo(
9820
9974
  () => ({
9821
9975
  entries: entries3,
9822
9976
  add: (fact) => setFlowOutput(flowId, { entries: writeOptimisticFact(entries3, fact) })
@@ -9825,8 +9979,8 @@ function useOptimisticFactOverlay(flowId) {
9825
9979
  );
9826
9980
  }
9827
9981
  function useReconcileOptimisticFacts(flowId, readIdentity) {
9828
- const seenRef = React37.useRef(null);
9829
- React37.useEffect(() => {
9982
+ const seenRef = React39.useRef(null);
9983
+ React39.useEffect(() => {
9830
9984
  if (readIdentity === null) return;
9831
9985
  if (seenRef.current === null) {
9832
9986
  seenRef.current = readIdentity;
@@ -9998,16 +10152,16 @@ __export(chat_exports, {
9998
10152
  });
9999
10153
 
10000
10154
  // src/chat/chat-context.ts
10001
- import { createContext as createContext23, useContext as useContext23 } from "react";
10002
- var FourtyChatContext = createContext23(null);
10155
+ import { createContext as createContext24, useContext as useContext24 } from "react";
10156
+ var FourtyChatContext = createContext24(null);
10003
10157
  function useFourtyChat() {
10004
- const ctx = useContext23(FourtyChatContext);
10158
+ const ctx = useContext24(FourtyChatContext);
10005
10159
  if (!ctx) throw new Error("useFourtyChat must be used inside <FourtyChatProvider>");
10006
10160
  return ctx;
10007
10161
  }
10008
10162
 
10009
10163
  // src/rendering/post-hydration.ts
10010
- import { useCallback as useCallback14 } from "react";
10164
+ import { useCallback as useCallback15 } from "react";
10011
10165
  var registry = [];
10012
10166
  function registerPostHydrationTransform(transform) {
10013
10167
  const existing = registry.findIndex((t) => t.id === transform.id);
@@ -10016,7 +10170,7 @@ function registerPostHydrationTransform(transform) {
10016
10170
  }
10017
10171
  function usePostHydrationTransforms() {
10018
10172
  const fns = registry.map((t) => t.use());
10019
- return useCallback14(
10173
+ return useCallback15(
10020
10174
  (props, ctx) => {
10021
10175
  let out = props;
10022
10176
  for (const fn of fns) {
@@ -10176,7 +10330,7 @@ function ProjectionSignalBridge() {
10176
10330
  }
10177
10331
 
10178
10332
  // src/projection/use-projection.ts
10179
- import { useCallback as useCallback15, useEffect as useEffect12, useState as useState8 } from "react";
10333
+ import { useCallback as useCallback16, useEffect as useEffect12, useState as useState8 } from "react";
10180
10334
  function readResult(raw) {
10181
10335
  if (raw === null || typeof raw !== "object") return void 0;
10182
10336
  if (!("hiddenCount" in raw) || typeof raw.hiddenCount !== "number") return void 0;
@@ -10190,7 +10344,7 @@ function entityIdOf(value) {
10190
10344
  var NO_AXES = [];
10191
10345
  function useProjection(projectionProp, entity2) {
10192
10346
  const [expanded, setExpanded] = useState8(false);
10193
- const toggle = useCallback15(() => setExpanded((e) => !e), []);
10347
+ const toggle = useCallback16(() => setExpanded((e) => !e), []);
10194
10348
  const entityId = entityIdOf(entity2);
10195
10349
  useEffect12(() => {
10196
10350
  setExpanded(false);
@@ -10238,34 +10392,34 @@ __export(interaction_exports, {
10238
10392
  });
10239
10393
 
10240
10394
  // src/interaction/withInteractionTracking.tsx
10241
- import React38, { createContext as createContext24, useContext as useContext24 } from "react";
10242
- import { jsx as jsx21, jsxs } from "react/jsx-runtime";
10243
- var InteractionContext = createContext24(null);
10395
+ import React40, { createContext as createContext25, useContext as useContext25 } from "react";
10396
+ import { jsx as jsx22, jsxs } from "react/jsx-runtime";
10397
+ var InteractionContext = createContext25(null);
10244
10398
  function InteractionProvider({
10245
10399
  onInteraction,
10246
10400
  children
10247
10401
  }) {
10248
- return /* @__PURE__ */ jsx21(InteractionContext.Provider, { value: onInteraction, children });
10402
+ return /* @__PURE__ */ jsx22(InteractionContext.Provider, { value: onInteraction, children });
10249
10403
  }
10250
10404
  function useInteraction2() {
10251
- return useContext24(InteractionContext);
10405
+ return useContext25(InteractionContext);
10252
10406
  }
10253
10407
  function withInteractionTracking(WrappedComponent, meta) {
10254
10408
  function TrackedComponent(props) {
10255
- return /* @__PURE__ */ jsx21(
10409
+ return /* @__PURE__ */ jsx22(
10256
10410
  "div",
10257
10411
  {
10258
10412
  "data-tracked-component": meta.componentId,
10259
10413
  "data-tracked-component-type": meta.componentType,
10260
10414
  style: { display: "contents" },
10261
- children: /* @__PURE__ */ jsx21(ComponentErrorBoundary, { componentId: meta.componentId, children: /* @__PURE__ */ jsx21(WrappedComponent, { ...props }) })
10415
+ children: /* @__PURE__ */ jsx22(ComponentErrorBoundary, { componentId: meta.componentId, children: /* @__PURE__ */ jsx22(WrappedComponent, { ...props }) })
10262
10416
  }
10263
10417
  );
10264
10418
  }
10265
10419
  TrackedComponent.displayName = `Tracked(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
10266
10420
  return TrackedComponent;
10267
10421
  }
10268
- var ComponentErrorBoundary = class extends React38.Component {
10422
+ var ComponentErrorBoundary = class extends React40.Component {
10269
10423
  constructor() {
10270
10424
  super(...arguments);
10271
10425
  __publicField(this, "state", { error: null });
@@ -10279,7 +10433,7 @@ var ComponentErrorBoundary = class extends React38.Component {
10279
10433
  render() {
10280
10434
  if (this.state.error) {
10281
10435
  return /* @__PURE__ */ jsxs("div", { className: "fourty-component-error", role: "alert", "data-component-id": this.props.componentId, children: [
10282
- /* @__PURE__ */ jsx21("strong", { children: this.props.componentId }),
10436
+ /* @__PURE__ */ jsx22("strong", { children: this.props.componentId }),
10283
10437
  ": ",
10284
10438
  this.state.error.message
10285
10439
  ] });
@@ -10339,14 +10493,14 @@ __export(utils_exports, {
10339
10493
  import { useSyncExternalStore as useSyncExternalStore6 } from "react";
10340
10494
 
10341
10495
  // src/utils/viewport-window.tsx
10342
- import { createContext as createContext25, useContext as useContext25 } from "react";
10343
- import { jsx as jsx22 } from "react/jsx-runtime";
10344
- var ViewportWindowContext = createContext25(null);
10496
+ import { createContext as createContext26, useContext as useContext26 } from "react";
10497
+ import { jsx as jsx23 } from "react/jsx-runtime";
10498
+ var ViewportWindowContext = createContext26(null);
10345
10499
  function canAnswer(win) {
10346
10500
  return win !== null && typeof win.matchMedia === "function";
10347
10501
  }
10348
10502
  function useViewportWindow() {
10349
- const provided = useContext25(ViewportWindowContext);
10503
+ const provided = useContext26(ViewportWindowContext);
10350
10504
  if (provided !== null) return canAnswer(provided) ? provided : null;
10351
10505
  const global = globalThis;
10352
10506
  return canAnswer(global) ? global : null;
@@ -10355,7 +10509,7 @@ function ViewportWindowProvider({
10355
10509
  value,
10356
10510
  children
10357
10511
  }) {
10358
- return /* @__PURE__ */ jsx22(ViewportWindowContext.Provider, { value, children });
10512
+ return /* @__PURE__ */ jsx23(ViewportWindowContext.Provider, { value, children });
10359
10513
  }
10360
10514
 
10361
10515
  // src/utils/use-form-factor.ts
@@ -10422,13 +10576,13 @@ function useFormFactor() {
10422
10576
  }
10423
10577
 
10424
10578
  // src/utils/use-inline-completion.ts
10425
- import { useCallback as useCallback16, useMemo as useMemo13, useState as useState9 } from "react";
10579
+ import { useCallback as useCallback17, useMemo as useMemo13, useState as useState9 } from "react";
10426
10580
  function useInlineCompletion(opts) {
10427
10581
  const { value, candidates } = opts;
10428
10582
  const minChars = opts.minChars !== void 0 ? opts.minChars : 2;
10429
10583
  const enabled = opts.enabled !== void 0 ? opts.enabled : true;
10430
10584
  const [dismissedValue, setDismissedValue] = useState9(null);
10431
- const dismiss = useCallback16(() => setDismissedValue(value), [value]);
10585
+ const dismiss = useCallback17(() => setDismissedValue(value), [value]);
10432
10586
  return useMemo13(() => {
10433
10587
  if (!enabled || value.length < minChars || dismissedValue === value) {
10434
10588
  return { completion: "", ghost: "", active: false, dismiss };
@@ -10446,7 +10600,7 @@ function useInlineCompletion(opts) {
10446
10600
  }
10447
10601
 
10448
10602
  // src/utils/use-document-visible.ts
10449
- import React39 from "react";
10603
+ import React41 from "react";
10450
10604
  function subscribe4(onChange) {
10451
10605
  document.addEventListener("visibilitychange", onChange);
10452
10606
  return () => document.removeEventListener("visibilitychange", onChange);
@@ -10458,15 +10612,15 @@ function getServerSnapshot() {
10458
10612
  return true;
10459
10613
  }
10460
10614
  function useDocumentVisible() {
10461
- return React39.useSyncExternalStore(subscribe4, getSnapshot, getServerSnapshot);
10615
+ return React41.useSyncExternalStore(subscribe4, getSnapshot, getServerSnapshot);
10462
10616
  }
10463
10617
 
10464
10618
  // src/utils/use-interval.ts
10465
- import React40 from "react";
10619
+ import React42 from "react";
10466
10620
  function useInterval(callback, ms, active = true) {
10467
- const cbRef = React40.useRef(callback);
10621
+ const cbRef = React42.useRef(callback);
10468
10622
  cbRef.current = callback;
10469
- React40.useEffect(() => {
10623
+ React42.useEffect(() => {
10470
10624
  if (!active) return;
10471
10625
  const id = window.setInterval(() => cbRef.current(), ms);
10472
10626
  return () => window.clearInterval(id);
@@ -10474,7 +10628,7 @@ function useInterval(callback, ms, active = true) {
10474
10628
  }
10475
10629
 
10476
10630
  // src/utils/use-success-flash.ts
10477
- import { useCallback as useCallback17, useEffect as useEffect13, useRef as useRef9, useState as useState10 } from "react";
10631
+ import { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef9, useState as useState10 } from "react";
10478
10632
  import { useAnimationControls } from "framer-motion";
10479
10633
  function useSuccessFlash(options) {
10480
10634
  const duration = options !== void 0 && options.duration !== void 0 ? options.duration : 900;
@@ -10490,7 +10644,7 @@ function useSuccessFlash(options) {
10490
10644
  if (timerRef.current !== null) window.clearTimeout(timerRef.current);
10491
10645
  };
10492
10646
  }, []);
10493
- const trigger = useCallback17(() => {
10647
+ const trigger = useCallback18(() => {
10494
10648
  setFlashing(true);
10495
10649
  controls.start({
10496
10650
  scale: scaleRef.current,
@@ -10678,15 +10832,15 @@ function primedEntitiesFor(resolverKey) {
10678
10832
  }
10679
10833
 
10680
10834
  // src/preview/SpacefrontPreviewProvider.tsx
10681
- import * as React41 from "react";
10682
- import { jsx as jsx23 } from "react/jsx-runtime";
10835
+ import * as React43 from "react";
10836
+ import { jsx as jsx24 } from "react/jsx-runtime";
10683
10837
  var NOOP = () => {
10684
10838
  };
10685
10839
  var ASYNC_NOOP = () => Promise.resolve();
10686
10840
  var VIEW = { page: { kind: "home" }, layout: EMPTY_SPEC, shell: EMPTY_SHELL };
10687
- var PreviewContext = React41.createContext(null);
10841
+ var PreviewContext = React43.createContext(null);
10688
10842
  function usePreview() {
10689
- const value = React41.useContext(PreviewContext);
10843
+ const value = React43.useContext(PreviewContext);
10690
10844
  if (value === null) throw new Error("preview runtime used outside <SpacefrontPreviewProvider>");
10691
10845
  return value;
10692
10846
  }
@@ -10840,11 +10994,11 @@ var PRESENCE = {
10840
10994
  usePresenceLiveTurn: () => usePreview().pending?.messageId
10841
10995
  };
10842
10996
  function SpacefrontPreviewProvider({ scene, onSend, children }) {
10843
- const [sessionId] = React41.useState(() => `preview-${Math.random().toString(36).slice(2)}`);
10844
- const derived = React41.useMemo(() => derive(scene, sessionId), [scene, sessionId]);
10845
- const onSendRef = React41.useRef(onSend);
10997
+ const [sessionId] = React43.useState(() => `preview-${Math.random().toString(36).slice(2)}`);
10998
+ const derived = React43.useMemo(() => derive(scene, sessionId), [scene, sessionId]);
10999
+ const onSendRef = React43.useRef(onSend);
10846
11000
  onSendRef.current = onSend;
10847
- const draft = React41.useMemo(() => {
11001
+ const draft = React43.useMemo(() => {
10848
11002
  let text2 = "";
10849
11003
  const listeners14 = /* @__PURE__ */ new Set();
10850
11004
  return {
@@ -10860,7 +11014,7 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
10860
11014
  }
10861
11015
  };
10862
11016
  }, []);
10863
- const session = React41.useMemo(() => {
11017
+ const session = React43.useMemo(() => {
10864
11018
  const send = (text2) => {
10865
11019
  draft.set("");
10866
11020
  onSendRef.current?.(text2);
@@ -10912,15 +11066,15 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
10912
11066
  const qId = question === null ? null : question.id;
10913
11067
  const qText = question === null ? "" : question.text;
10914
11068
  const qReplies = question === null ? "" : list(question.replies).join("\0");
10915
- const raised = React41.useRef(0);
10916
- React41.useEffect(() => {
11069
+ const raised = React43.useRef(0);
11070
+ React43.useEffect(() => {
10917
11071
  if (qId === null) return;
10918
11072
  raised.current += 1;
10919
11073
  const id = `${qId}-${raised.current}`;
10920
11074
  raiseStanding(AGENT_ASK_SIGNAL, id, { ask: qText, suggestions: qReplies === "" ? [] : qReplies.split("\0") }, sessionId);
10921
11075
  return () => resolveStanding(id, sessionId);
10922
11076
  }, [qId, qText, qReplies, sessionId]);
10923
- return /* @__PURE__ */ jsx23(PreviewContext.Provider, { value: derived, children: /* @__PURE__ */ jsx23(FourtySessionContext.Provider, { value: session, children: /* @__PURE__ */ jsx23(FourtyRuntimeProvider, { value: RUNTIME, children: /* @__PURE__ */ jsx23(PresenceRuntimeProvider, { value: PRESENCE, children }) }) }) });
11077
+ return /* @__PURE__ */ jsx24(PreviewContext.Provider, { value: derived, children: /* @__PURE__ */ jsx24(FourtySessionContext.Provider, { value: session, children: /* @__PURE__ */ jsx24(FourtyRuntimeProvider, { value: RUNTIME, children: /* @__PURE__ */ jsx24(PresenceRuntimeProvider, { value: PRESENCE, children }) }) }) });
10924
11078
  }
10925
11079
 
10926
11080
  // src/verticals/commerce/index.ts
@@ -11016,9 +11170,12 @@ __export(commerce_exports, {
11016
11170
  useProductDetail: () => useProductDetail,
11017
11171
  useProductGridFilter: () => useProductGridFilter,
11018
11172
  useProductReviews: () => useProductReviews,
11173
+ useProductSearch: () => useProductSearch,
11019
11174
  useProducts: () => useProducts,
11020
11175
  useQueuedDiscountCodes: () => useQueuedDiscountCodes,
11021
11176
  useSafeCart: () => useSafeCart,
11177
+ useShopCheckout: () => useShopCheckout,
11178
+ useStoreArticles: () => useStoreArticles,
11022
11179
  useStoreCheckouts: () => useStoreCheckouts,
11023
11180
  useToggleWishlist: () => useToggleWishlist,
11024
11181
  useVariantSelections: () => useVariantSelections,
@@ -11066,7 +11223,7 @@ registerEntityPageKind("search", {
11066
11223
  });
11067
11224
 
11068
11225
  // src/verticals/commerce/commerce-context.tsx
11069
- import { createContext as createContext27, useContext as useContext27 } from "react";
11226
+ import { createContext as createContext28, useContext as useContext28 } from "react";
11070
11227
  var INERT_COMMERCE_RUNTIME = {
11071
11228
  useCart: () => {
11072
11229
  throw new Error("useCart must be used within a <CommerceProvider>");
@@ -11117,14 +11274,24 @@ var INERT_COMMERCE_RUNTIME = {
11117
11274
  available: false,
11118
11275
  ask: () => Promise.reject(new Error("useAskStore needs a <CommerceProvider>")),
11119
11276
  pending: false
11120
- })
11277
+ }),
11278
+ // No commerce, no stores whose articles to read.
11279
+ useStoreArticles: () => ({ available: false, articles: [], isLoading: false }),
11280
+ // No commerce, no bag to check out.
11281
+ useShopCheckout: () => ({
11282
+ available: false,
11283
+ create: () => Promise.reject(new Error("useShopCheckout needs a <CommerceProvider>")),
11284
+ pending: false
11285
+ }),
11286
+ // No commerce, no catalog to search.
11287
+ useProductSearch: () => ({ available: false, products: [], nextCursor: null, isLoading: false, error: null })
11121
11288
  };
11122
- var FourtyCommerceRuntimeContext = createContext27(
11289
+ var FourtyCommerceRuntimeContext = createContext28(
11123
11290
  INERT_COMMERCE_RUNTIME
11124
11291
  );
11125
11292
  var FourtyCommerceRuntimeProvider = FourtyCommerceRuntimeContext.Provider;
11126
11293
  function useCommerceRuntime() {
11127
- return useContext27(FourtyCommerceRuntimeContext);
11294
+ return useContext28(FourtyCommerceRuntimeContext);
11128
11295
  }
11129
11296
  function useCart() {
11130
11297
  return useCommerceRuntime().useCart();
@@ -11159,6 +11326,15 @@ function useStoreCheckouts() {
11159
11326
  function useAskStore() {
11160
11327
  return useCommerceRuntime().useAskStore();
11161
11328
  }
11329
+ function useStoreArticles(productIds, topic) {
11330
+ return useCommerceRuntime().useStoreArticles(productIds, topic);
11331
+ }
11332
+ function useShopCheckout() {
11333
+ return useCommerceRuntime().useShopCheckout();
11334
+ }
11335
+ function useProductSearch(query, opts) {
11336
+ return useCommerceRuntime().useProductSearch(query, opts);
11337
+ }
11162
11338
 
11163
11339
  // src/verticals/commerce/checkout/external-navigation.ts
11164
11340
  function navigateToExternalCommerceUrl(url) {
@@ -11313,18 +11489,18 @@ __export(ecommerce_exports, {
11313
11489
  });
11314
11490
 
11315
11491
  // ../spacestation/src/analytics/ecommerce/surfacing.ts
11316
- import { z as z50 } from "zod";
11492
+ import { z as z51 } from "zod";
11317
11493
  var PRODUCTS_SURFACED = defineEventKind(
11318
11494
  "commerce.products_surfaced",
11319
11495
  "client",
11320
- z50.object({
11496
+ z51.object({
11321
11497
  /** The turn whose commit this describes. Minted where the prompt signal
11322
11498
  * is built and shared with `agent_runs`, so the read layer can line a
11323
11499
  * surfacing up against the prompt that asked for it. */
11324
- turnId: z50.string().min(1).max(128),
11500
+ turnId: z51.string().min(1).max(128),
11325
11501
  /** Distinct entity refs this turn placed that were not on the canvas
11326
11502
  * before it. ZERO IS A REAL VALUE — see the header. */
11327
- productCount: z50.number().int().nonnegative()
11503
+ productCount: z51.number().int().nonnegative()
11328
11504
  }).strict()
11329
11505
  );
11330
11506
 
@@ -11346,7 +11522,7 @@ function isFunnelStep(value) {
11346
11522
  }
11347
11523
 
11348
11524
  // src/verticals/commerce/product/use-product-grid-filter.ts
11349
- import { useCallback as useCallback18, useMemo as useMemo15, useState as useState12 } from "react";
11525
+ import { useCallback as useCallback19, useMemo as useMemo15, useState as useState12 } from "react";
11350
11526
  function useProductGridFilter(chips) {
11351
11527
  const labelKey = useMemo15(() => chips.map((c) => c.label).join("|"), [chips]);
11352
11528
  const first = chips[0];
@@ -11359,17 +11535,17 @@ function useProductGridFilter(chips) {
11359
11535
  const found = chips.find((c) => c.label === activeLabel);
11360
11536
  return found !== void 0 ? found : first;
11361
11537
  }, [chips, first, activeLabel, labelKey]);
11362
- const setActive = useCallback18((next) => {
11538
+ const setActive = useCallback19((next) => {
11363
11539
  setActiveLabel(next.label);
11364
11540
  }, []);
11365
11541
  return { chips, active: activeFromKey, setActive };
11366
11542
  }
11367
11543
 
11368
11544
  // src/verticals/commerce/product/use-product-detail.ts
11369
- import { useCallback as useCallback20, useMemo as useMemo16, useRef as useRef13, useState as useState15 } from "react";
11545
+ import { useCallback as useCallback21, useMemo as useMemo16, useRef as useRef13, useState as useState15 } from "react";
11370
11546
 
11371
11547
  // src/verticals/commerce/checkout/use-buy-now.ts
11372
- import { useCallback as useCallback19, useEffect as useEffect16, useState as useState13 } from "react";
11548
+ import { useCallback as useCallback20, useEffect as useEffect16, useState as useState13 } from "react";
11373
11549
 
11374
11550
  // src/verticals/commerce/checkout/checkout-handoff-store.ts
11375
11551
  import { useSyncExternalStore as useSyncExternalStore10 } from "react";
@@ -11510,7 +11686,7 @@ function useBuyNow(addToCart) {
11510
11686
  const cartApi = useCart();
11511
11687
  const analytics = useOptionalAnalyticsSink();
11512
11688
  const [pending2, setPending] = useState13(null);
11513
- const start = useCallback19((variantId) => {
11689
+ const start = useCallback20((variantId) => {
11514
11690
  if (pending2 !== null) return;
11515
11691
  addToCart();
11516
11692
  setPending(variantId);
@@ -11673,7 +11849,7 @@ function useProductDetail(product) {
11673
11849
  () => variantGroups.find((g) => selectedVariants[g.name] === void 0),
11674
11850
  [variantGroups, selectedVariants]
11675
11851
  );
11676
- const findVariant = useCallback20(
11852
+ const findVariant = useCallback21(
11677
11853
  (opts) => matchVariant(product, opts),
11678
11854
  [product]
11679
11855
  );
@@ -11684,11 +11860,11 @@ function useProductDetail(product) {
11684
11860
  const matchIndex = product.images.findIndex((img) => img.url === activeVariantImageUrl);
11685
11861
  if (matchIndex >= 0) setSelectedImage(matchIndex);
11686
11862
  }
11687
- const isVariantUnavailable = useCallback20(
11863
+ const isVariantUnavailable = useCallback21(
11688
11864
  (group, opt) => isOptionUnavailable(product, selectedVariants, group, opt),
11689
11865
  [product, selectedVariants]
11690
11866
  );
11691
- const selectVariant = useCallback20((group, opt) => {
11867
+ const selectVariant = useCallback21((group, opt) => {
11692
11868
  markTouched();
11693
11869
  setSelectedVariants((prev) => ({ ...prev, [group]: opt }));
11694
11870
  session.dispatchSignal({
@@ -11697,7 +11873,7 @@ function useProductDetail(product) {
11697
11873
  });
11698
11874
  optimisticFacts.add({ label: group, value: opt });
11699
11875
  }, [session, product.id, markTouched, setSelectedVariants, optimisticFacts]);
11700
- const addPicked = useCallback20((acknowledgeInDrawer) => {
11876
+ const addPicked = useCallback21((acknowledgeInDrawer) => {
11701
11877
  if (!allSelected) return;
11702
11878
  const variant = findVariant(selectedVariants);
11703
11879
  if (variant === void 0) {
@@ -11721,10 +11897,10 @@ function useProductDetail(product) {
11721
11897
  }
11722
11898
  });
11723
11899
  }, [allSelected, findVariant, product.id, product.title, product.images, selectedVariants, session]);
11724
- const onAddToBag = useCallback20(() => addPicked(true), [addPicked]);
11725
- const addForBuyNow = useCallback20(() => addPicked(false), [addPicked]);
11900
+ const onAddToBag = useCallback21(() => addPicked(true), [addPicked]);
11901
+ const addForBuyNow = useCallback21(() => addPicked(false), [addPicked]);
11726
11902
  const buyNow = useBuyNow(addForBuyNow);
11727
- const onBuyNow = useCallback20(() => {
11903
+ const onBuyNow = useCallback21(() => {
11728
11904
  if (!allSelected) return;
11729
11905
  const variant = findVariant(selectedVariants);
11730
11906
  if (variant === void 0) {
@@ -11733,10 +11909,10 @@ function useProductDetail(product) {
11733
11909
  }
11734
11910
  buyNow.start(variant.id);
11735
11911
  }, [allSelected, findVariant, selectedVariants, buyNow]);
11736
- const onAskAgent = useCallback20(() => {
11912
+ const onAskAgent = useCallback21(() => {
11737
11913
  session.sendMessage(`Tell me more about the ${product.title}`);
11738
11914
  }, [session, product.title]);
11739
- const onPickSibling = useCallback20((sibling) => {
11915
+ const onPickSibling = useCallback21((sibling) => {
11740
11916
  if (sibling.current === true) return;
11741
11917
  session.dispatchSuggestionAction({
11742
11918
  id: `navigate-product-${sibling.id}`,
@@ -11751,7 +11927,7 @@ function useProductDetail(product) {
11751
11927
  payload: { page: { kind: "product", id: sibling.id, morph: true } }
11752
11928
  });
11753
11929
  }, [session]);
11754
- const toggleZoom = useCallback20(() => setZoomed((p) => !p), []);
11930
+ const toggleZoom = useCallback21(() => setZoomed((p) => !p), []);
11755
11931
  return {
11756
11932
  selectedImage,
11757
11933
  selectImage: setSelectedImage,
@@ -11778,7 +11954,7 @@ function useProductDetail(product) {
11778
11954
  }
11779
11955
 
11780
11956
  // src/verticals/commerce/comparison/use-comparison-table.ts
11781
- import { useCallback as useCallback21 } from "react";
11957
+ import { useCallback as useCallback22 } from "react";
11782
11958
  function classifyComparisonValue(v) {
11783
11959
  if (v === void 0) return { kind: "value", value: "" };
11784
11960
  if (v === true || v === "true" || v === "Yes") return { kind: "true" };
@@ -11786,7 +11962,7 @@ function classifyComparisonValue(v) {
11786
11962
  return { kind: "value", value: v };
11787
11963
  }
11788
11964
  function useComparisonHighlight(highlightedId) {
11789
- const isHighlighted = useCallback21(
11965
+ const isHighlighted = useCallback22(
11790
11966
  (id) => id === highlightedId,
11791
11967
  [highlightedId]
11792
11968
  );
@@ -11794,7 +11970,7 @@ function useComparisonHighlight(highlightedId) {
11794
11970
  }
11795
11971
 
11796
11972
  // src/verticals/commerce/cart/use-cart-drawer.ts
11797
- import { useCallback as useCallback22 } from "react";
11973
+ import { useCallback as useCallback23 } from "react";
11798
11974
 
11799
11975
  // src/verticals/commerce/cart/use-safe-cart.ts
11800
11976
  var warnedCart = false;
@@ -11885,9 +12061,9 @@ registerSessionScopedClear(() => {
11885
12061
  function useCartDrawer() {
11886
12062
  const cart = useSafeCart();
11887
12063
  const isOpen2 = useCartDrawerOpen();
11888
- const open = useCallback22(() => openCartDrawer(), []);
11889
- const close = useCallback22(() => closeCartDrawer(), []);
11890
- const toggle = useCallback22(() => toggleCartDrawer(), []);
12064
+ const open = useCallback23(() => openCartDrawer(), []);
12065
+ const close = useCallback23(() => closeCartDrawer(), []);
12066
+ const toggle = useCallback23(() => toggleCartDrawer(), []);
11891
12067
  return {
11892
12068
  isOpen: isOpen2,
11893
12069
  open,
@@ -11904,7 +12080,7 @@ function useCartDrawer() {
11904
12080
  }
11905
12081
 
11906
12082
  // src/verticals/commerce/cart/use-cart-view.ts
11907
- import React42 from "react";
12083
+ import React44 from "react";
11908
12084
 
11909
12085
  // src/verticals/commerce/cart/queued-discount-codes.ts
11910
12086
  import { useSyncExternalStore as useSyncExternalStore12 } from "react";
@@ -11963,7 +12139,7 @@ registerSessionScopedClear(() => {
11963
12139
  // src/verticals/commerce/cart/use-cart-view.ts
11964
12140
  function useCartView(cart, onCheckout) {
11965
12141
  const analytics = useOptionalAnalyticsSink();
11966
- const [exitPending, setExitPending] = React42.useState(null);
12142
+ const [exitPending, setExitPending] = React44.useState(null);
11967
12143
  const lines = cart === null ? [] : cart.lines;
11968
12144
  const count = lines.reduce((sum, l) => sum + l.quantity, 0);
11969
12145
  const totalsPending = lines.some((l) => isPendingCartLine(l));
@@ -11974,7 +12150,7 @@ function useCartView(cart, onCheckout) {
11974
12150
  const backendTotal = cart !== null && cart.total !== void 0 ? cart.total.amount : void 0;
11975
12151
  const discountAmount = backendTotal !== void 0 && backendTotal < subtotal ? subtotal - backendTotal : 0;
11976
12152
  const effectiveTotal = backendTotal !== void 0 ? backendTotal : subtotal;
11977
- const navigateToExit = React42.useCallback((url, kind) => {
12153
+ const navigateToExit = React44.useCallback((url, kind) => {
11978
12154
  const result = navigateToExternalCommerceUrl(url);
11979
12155
  if (kind === "checkout") recordVisitorCheckoutExit(analytics, result);
11980
12156
  if (result === "new-tab") {
@@ -11991,7 +12167,7 @@ function useCartView(cart, onCheckout) {
11991
12167
  setExitPending(null);
11992
12168
  }
11993
12169
  }, [analytics]);
11994
- const handleCheckout = React42.useCallback(() => {
12170
+ const handleCheckout = React44.useCallback(() => {
11995
12171
  if (lines.length === 0 || exitPending !== null) return;
11996
12172
  setExitPending("checkout");
11997
12173
  if (onCheckout) {
@@ -12011,7 +12187,7 @@ function useCartView(cart, onCheckout) {
12011
12187
  }
12012
12188
  navigateToExit(cart?.checkoutUrl, "checkout");
12013
12189
  }, [lines.length, exitPending, onCheckout, cart, navigateToExit]);
12014
- const handleGoToStore = React42.useCallback(() => {
12190
+ const handleGoToStore = React44.useCallback(() => {
12015
12191
  if (lines.length === 0 || exitPending !== null) return;
12016
12192
  setExitPending("store");
12017
12193
  navigateToExit(cart?.storeCartUrl, "store");
@@ -12099,20 +12275,20 @@ registerSessionScopedClear(() => {
12099
12275
  });
12100
12276
 
12101
12277
  // src/verticals/commerce/cart/use-cart-line-row.ts
12102
- import * as React43 from "react";
12278
+ import * as React45 from "react";
12103
12279
 
12104
12280
  // src/verticals/commerce/use-commerce-actions.ts
12105
- import { useCallback as useCallback23 } from "react";
12281
+ import { useCallback as useCallback24 } from "react";
12106
12282
  function useCommerceActions() {
12107
12283
  const canvas = useCanvasActions();
12108
- const navigateToProduct = useCallback23(
12284
+ const navigateToProduct = useCallback24(
12109
12285
  (productId, title) => {
12110
12286
  if (!canvas) return;
12111
12287
  canvas.navigate({ kind: "product", id: productId }, title);
12112
12288
  },
12113
12289
  [canvas]
12114
12290
  );
12115
- const showCollection = useCallback23(
12291
+ const showCollection = useCallback24(
12116
12292
  (collectionTitle) => {
12117
12293
  if (!canvas) return;
12118
12294
  canvas.dispatchAction({
@@ -12124,7 +12300,7 @@ function useCommerceActions() {
12124
12300
  },
12125
12301
  [canvas]
12126
12302
  );
12127
- const navigateToProductSet = useCallback23(
12303
+ const navigateToProductSet = useCallback24(
12128
12304
  (handle, title, productIds) => {
12129
12305
  if (!canvas) return;
12130
12306
  canvas.dispatchAction({
@@ -12145,19 +12321,19 @@ var SPOTLIGHT_MAX_AGE_MS = 3e4;
12145
12321
  function useCartLineRow(line, opts) {
12146
12322
  const actions = useCommerceActions();
12147
12323
  const drawerFocus = useCartDrawerFocus();
12148
- const rowRef = React43.useRef(null);
12324
+ const rowRef = React45.useRef(null);
12149
12325
  const pending2 = isPendingCartLine(line);
12150
12326
  const navigable = actions !== null && !pending2 && line.productId.length > 0;
12151
12327
  const onNavigated = opts === void 0 ? void 0 : opts.onNavigated;
12152
- const navigatedRef = React43.useRef(onNavigated);
12328
+ const navigatedRef = React45.useRef(onNavigated);
12153
12329
  navigatedRef.current = onNavigated;
12154
- const navigate = React43.useCallback(() => {
12330
+ const navigate = React45.useCallback(() => {
12155
12331
  if (actions === null) return;
12156
12332
  actions.navigateToProduct(line.productId, line.title);
12157
12333
  const done = navigatedRef.current;
12158
12334
  if (done !== void 0) done();
12159
12335
  }, [actions, line.productId, line.title]);
12160
- const interaction = React43.useMemo(() => {
12336
+ const interaction = React45.useMemo(() => {
12161
12337
  if (!navigable) return void 0;
12162
12338
  return {
12163
12339
  onClick: navigate,
@@ -12172,7 +12348,7 @@ function useCartLineRow(line, opts) {
12172
12348
  };
12173
12349
  }, [navigable, navigate]);
12174
12350
  const spotlightKey = drawerFocus !== null && !pending2 && line.productId.length > 0 && drawerFocus.productId === line.productId && Date.now() - drawerFocus.at < SPOTLIGHT_MAX_AGE_MS ? drawerFocus.at : null;
12175
- React43.useEffect(() => {
12351
+ React45.useEffect(() => {
12176
12352
  if (spotlightKey === null) return;
12177
12353
  const node = rowRef.current;
12178
12354
  if (node === null) return;
@@ -12182,7 +12358,7 @@ function useCartLineRow(line, opts) {
12182
12358
  }
12183
12359
 
12184
12360
  // src/verticals/commerce/wishlist/use-wishlist-drawer.ts
12185
- import { useCallback as useCallback25, useState as useState16 } from "react";
12361
+ import { useCallback as useCallback26, useState as useState16 } from "react";
12186
12362
  var warnedDegraded = false;
12187
12363
  function useSafeWishlist() {
12188
12364
  try {
@@ -12206,11 +12382,11 @@ function useSafeWishlist() {
12206
12382
  function useWishlistDrawer() {
12207
12383
  const wishlist = useSafeWishlist();
12208
12384
  const [isOpen2, setIsOpen] = useState16(false);
12209
- const open = useCallback25(() => setIsOpen(true), []);
12210
- const close = useCallback25(() => setIsOpen(false), []);
12211
- const toggle = useCallback25(() => setIsOpen((p) => !p), []);
12385
+ const open = useCallback26(() => setIsOpen(true), []);
12386
+ const close = useCallback26(() => setIsOpen(false), []);
12387
+ const toggle = useCallback26(() => setIsOpen((p) => !p), []);
12212
12388
  useExclusiveOverlay("wishlist", isOpen2, close);
12213
- const removeLine = useCallback25(
12389
+ const removeLine = useCallback26(
12214
12390
  (productId) => {
12215
12391
  if (wishlist === null) {
12216
12392
  console.warn("[useWishlistDrawer] removeLine called with no commerce provider");
@@ -12317,7 +12493,7 @@ function pickColorCount(product) {
12317
12493
  }
12318
12494
 
12319
12495
  // src/verticals/commerce/product/use-look-card.ts
12320
- import * as React44 from "react";
12496
+ import * as React46 from "react";
12321
12497
 
12322
12498
  // src/verticals/commerce/variant/variant-option-axes.ts
12323
12499
  function carriesValue(variant, name, value) {
@@ -12527,8 +12703,8 @@ function useLookCard({
12527
12703
  const session = useFourtySession();
12528
12704
  const addFlash = useSuccessFlash({ duration: 1200 });
12529
12705
  const locale = useSpaceLocale();
12530
- const [pending2, setPending] = React44.useState(null);
12531
- const clean = React44.useMemo(
12706
+ const [pending2, setPending] = React46.useState(null);
12707
+ const clean = React46.useMemo(
12532
12708
  () => (Array.isArray(products) ? products : []).filter(
12533
12709
  (p) => p !== null && p !== void 0 && typeof p === "object"
12534
12710
  ),
@@ -12853,17 +13029,17 @@ function resolveSwatchColor(name) {
12853
13029
  }
12854
13030
 
12855
13031
  // src/verticals/content/use-content-actions.ts
12856
- import { useCallback as useCallback26 } from "react";
13032
+ import { useCallback as useCallback27 } from "react";
12857
13033
  function useContentActions() {
12858
13034
  const canvas = useCanvasActions();
12859
- const navigateToArticle = useCallback26(
13035
+ const navigateToArticle = useCallback27(
12860
13036
  (articleId, title) => {
12861
13037
  if (!canvas) return;
12862
13038
  canvas.navigate({ kind: "article", id: articleId }, title);
12863
13039
  },
12864
13040
  [canvas]
12865
13041
  );
12866
- const subscribeNewsletter = useCallback26(
13042
+ const subscribeNewsletter = useCallback27(
12867
13043
  (email, buttonLabel) => {
12868
13044
  if (!canvas) return;
12869
13045
  canvas.dispatchAction({
@@ -12883,7 +13059,7 @@ function useContentActions() {
12883
13059
  import { useEffect as useEffect19, useState as useState19 } from "react";
12884
13060
 
12885
13061
  // package.json
12886
- var version = "0.5.18";
13062
+ var version = "0.5.19";
12887
13063
 
12888
13064
  // src/host/host-modules.ts
12889
13065
  import * as react from "react";
@@ -12944,7 +13120,7 @@ function loadEngine(apiUrl) {
12944
13120
  }
12945
13121
 
12946
13122
  // src/host/Spacefront.tsx
12947
- import { jsx as jsx24 } from "react/jsx-runtime";
13123
+ import { jsx as jsx25 } from "react/jsx-runtime";
12948
13124
  function Spacefront(props) {
12949
13125
  const [engine, setEngine] = useState19(null);
12950
13126
  const [failure, setFailure] = useState19(null);
@@ -12966,11 +13142,11 @@ function Spacefront(props) {
12966
13142
  if (failure !== null) throw failure;
12967
13143
  if (engine === null) return null;
12968
13144
  const EngineRoot = engine.EngineRoot;
12969
- return /* @__PURE__ */ jsx24(EngineRoot, { ...props });
13145
+ return /* @__PURE__ */ jsx25(EngineRoot, { ...props });
12970
13146
  }
12971
13147
 
12972
13148
  // src/npm.ts
12973
- import { z as z52 } from "zod";
13149
+ import { z as z53 } from "zod";
12974
13150
  export {
12975
13151
  ACQUISITION_KIND_LABELS,
12976
13152
  ACTIVE_PANEL_ATTR,
@@ -12987,6 +13163,7 @@ export {
12987
13163
  ARRIVAL_MAX_VALUE_CHARS,
12988
13164
  ARRIVAL_PARAMS,
12989
13165
  ATTACHMENT_ACCEPT,
13166
+ ATTENTION_NAMESPACE,
12990
13167
  AgentDirectiveSchema,
12991
13168
  AgentOutputSchema,
12992
13169
  AgentSessionSummarySchema,
@@ -12997,6 +13174,7 @@ export {
12997
13174
  AttachmentRefSchema,
12998
13175
  AttachmentRefsSchema,
12999
13176
  AttachmentUploadError,
13177
+ AttentionSchema,
13000
13178
  AttributeDefSchema,
13001
13179
  AttributeScopeBucketSchema,
13002
13180
  AttributeScopeConfigSchema,
@@ -13049,6 +13227,7 @@ export {
13049
13227
  CanvasOutletProvider,
13050
13228
  CanvasTailMount,
13051
13229
  CanvasTailProvider,
13230
+ CanvasTurnTailProvider,
13052
13231
  CartAddSignalPayloadSchema,
13053
13232
  CartDiscountCodeSchema,
13054
13233
  CartLineSchema,
@@ -13090,6 +13269,7 @@ export {
13090
13269
  EXTEND_FLOW,
13091
13270
  EXTRAS_PREFIX,
13092
13271
  ElementIdContext,
13272
+ ElementLayoutContext,
13093
13273
  EntryContextNamespaceSchema,
13094
13274
  EntryContextSchema,
13095
13275
  EntryContextValueSchema,
@@ -13141,6 +13321,7 @@ export {
13141
13321
  NullComponent,
13142
13322
  OLDEST_SUPPORTED_SDK,
13143
13323
  PAGELESS_HOST_PLACE,
13324
+ POINTING_NAMESPACE,
13144
13325
  PRESENCE_CANVAS_REFRESH_SIGNAL,
13145
13326
  PRESENCE_FACT_DISMISS_SIGNAL,
13146
13327
  PRESENCE_FLOW,
@@ -13156,6 +13337,7 @@ export {
13156
13337
  PackageReleaseSchema,
13157
13338
  PageSchema,
13158
13339
  PatchSchema,
13340
+ PointedAtSchema,
13159
13341
  PresenceRuntimeProvider,
13160
13342
  ProductReviewDataSchema,
13161
13343
  ProductReviewHighlightSchema,
@@ -13239,6 +13421,7 @@ export {
13239
13421
  THREAD_ROW_ATTR,
13240
13422
  TRAFFIC_BUCKETS,
13241
13423
  TURN_ASK_SIGNAL,
13424
+ TURN_TAIL_ATTR,
13242
13425
  ThreadHeadroom,
13243
13426
  ToolCallHintSchema,
13244
13427
  TraceRecordSchema,
@@ -13313,6 +13496,8 @@ export {
13313
13496
  clearCartActionFailures,
13314
13497
  clearCodeDiscountSources,
13315
13498
  clearProductNameLookups,
13499
+ clearShopCheckouts,
13500
+ clearStoreArticleLookups,
13316
13501
  clearStoreThemeSources,
13317
13502
  clearVariantChoice,
13318
13503
  clientStateEntries,
@@ -13474,6 +13659,8 @@ export {
13474
13659
  registerProductNameLookup,
13475
13660
  registerServiceHydrators,
13476
13661
  registerSessionScopedClear,
13662
+ registerShopCheckout,
13663
+ registerStoreArticleLookup,
13477
13664
  registerStoreThemeSource,
13478
13665
  registeredPageKinds,
13479
13666
  registeredPresenceFactForms,
@@ -13495,8 +13682,10 @@ export {
13495
13682
  resolveProductVariant,
13496
13683
  resolveScope,
13497
13684
  resolveServiceHydrators,
13685
+ resolveShopCheckout,
13498
13686
  resolveStanding,
13499
13687
  resolveStorage,
13688
+ resolveStoreArticleLookup,
13500
13689
  resolveStoreThemeSource,
13501
13690
  resolveSwatchColor,
13502
13691
  resolveType,
@@ -13548,6 +13737,7 @@ export {
13548
13737
  turnAskSegments,
13549
13738
  turnEditedBlock,
13550
13739
  turnOwnsView,
13740
+ turnTailSlots,
13551
13741
  useAction,
13552
13742
  useAddToCart,
13553
13743
  useAgentDriven,
@@ -13557,6 +13747,7 @@ export {
13557
13747
  useAgentPresenceFrame,
13558
13748
  useAgentPresenceFresh,
13559
13749
  useAnalyticsSink,
13750
+ useAskAbout,
13560
13751
  useAskStore,
13561
13752
  useBotCheckNotice,
13562
13753
  useCanvasActions,
@@ -13567,6 +13758,7 @@ export {
13567
13758
  useCanvasLeadTarget,
13568
13759
  useCanvasMotionStyle,
13569
13760
  useCanvasTail,
13761
+ useCanvasTurnTail,
13570
13762
  useCanvasViewBack,
13571
13763
  useCart,
13572
13764
  useCartActionFailures,
@@ -13605,6 +13797,7 @@ export {
13605
13797
  useDockState,
13606
13798
  useDocumentVisible,
13607
13799
  useElementId,
13800
+ useElementLayout,
13608
13801
  useExclusiveOverlay,
13609
13802
  useExplicitTurnId,
13610
13803
  useExplicitTurnSelection,
@@ -13657,6 +13850,7 @@ export {
13657
13850
  useProductDetail,
13658
13851
  useProductGridFilter,
13659
13852
  useProductReviews,
13853
+ useProductSearch,
13660
13854
  useProducts,
13661
13855
  useProjection,
13662
13856
  usePromptComposer,
@@ -13678,8 +13872,10 @@ export {
13678
13872
  useSessionState,
13679
13873
  useShellRegistry,
13680
13874
  useShellRoot,
13875
+ useShopCheckout,
13681
13876
  useSpaceLocale,
13682
13877
  useStandingOfType,
13878
+ useStoreArticles,
13683
13879
  useStoreCheckouts,
13684
13880
  useStream,
13685
13881
  useSuccessFlash,
@@ -13716,5 +13912,5 @@ export {
13716
13912
  withQueuedDiscountCodes,
13717
13913
  withSignalTurn,
13718
13914
  withoutClosingQuestion,
13719
- z52 as z
13915
+ z53 as z
13720
13916
  };