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