@40rty/ams-sdk 0.5.4 → 0.5.6

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
@@ -137,7 +137,10 @@ __export(src_exports3, {
137
137
  GENERATION_EASE: () => GENERATION_EASE,
138
138
  GenerationStyleContext: () => GenerationStyleContext,
139
139
  GenerationStyleProvider: () => GenerationStyleProvider,
140
+ HOST_CLEARED: () => HOST_CLEARED,
140
141
  HandlerRegistryContext: () => HandlerRegistryContext,
142
+ HostClearedSchema: () => HostClearedSchema,
143
+ HostPayloadSchema: () => HostPayloadSchema,
141
144
  HydrationStateContext: () => HydrationStateContext,
142
145
  HydratorProvider: () => HydratorProvider,
143
146
  INITIAL_NAV_PRESENTATION: () => INITIAL_NAV_PRESENTATION,
@@ -162,6 +165,7 @@ __export(src_exports3, {
162
165
  NavigatePayloadSchema: () => NavigatePayloadSchema,
163
166
  NullComponent: () => NullComponent,
164
167
  OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
168
+ PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
165
169
  PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
166
170
  PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
167
171
  PRESENCE_FLOW: () => PRESENCE_FLOW,
@@ -267,6 +271,7 @@ __export(src_exports3, {
267
271
  VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
268
272
  VIEW_EXTEND_SIGNAL: () => VIEW_EXTEND_SIGNAL,
269
273
  VIEW_FOCUS_ELEMENT_SIGNAL: () => VIEW_FOCUS_ELEMENT_SIGNAL,
274
+ VIEW_HOST_SIGNAL: () => VIEW_HOST_SIGNAL,
270
275
  VISITOR_ACCESS: () => VISITOR_ACCESS,
271
276
  VISITOR_CONTEXT_SIGNAL: () => VISITOR_CONTEXT_SIGNAL,
272
277
  VISITOR_ID_DURABILITIES: () => VISITOR_ID_DURABILITIES,
@@ -378,6 +383,8 @@ __export(src_exports3, {
378
383
  getVisitorLocale: () => getVisitorLocale,
379
384
  hapticCue: () => hapticCue,
380
385
  hasProse: () => hasProse,
386
+ hostFillsPage: () => hostFillsPage,
387
+ hostPlace: () => hostPlace,
381
388
  hostingAllows: () => hostingAllows,
382
389
  injectGoogleFonts: () => injectGoogleFonts,
383
390
  isActiveDirective: () => isActiveDirective,
@@ -414,6 +421,8 @@ __export(src_exports3, {
414
421
  openCartDrawerFocusedOn: () => openCartDrawerFocusedOn,
415
422
  orderedVideoSources: () => orderedVideoSources,
416
423
  packRows: () => packRows,
424
+ pageIdentityKey: () => pageIdentityKey,
425
+ pagePlace: () => pagePlace,
417
426
  parseBcp47Locale: () => parseBcp47Locale,
418
427
  parseReleasePreview: () => parseReleasePreview,
419
428
  pickCartAddAction: () => pickCartAddAction,
@@ -567,9 +576,11 @@ __export(src_exports3, {
567
576
  useContentActions: () => useContentActions,
568
577
  useConversationMessages: () => useConversationMessages,
569
578
  useConversationPage: () => useConversationPage,
579
+ useConversationPresence: () => useConversationPresence,
570
580
  useConversationState: () => useConversationState,
571
581
  useConversations: () => useConversations,
572
582
  useCurrentMessageIndex: () => useCurrentMessageIndex,
583
+ useCustomerAccount: () => useCustomerAccount,
573
584
  useDebug: () => useDebug,
574
585
  useDictation: () => useDictation,
575
586
  useDismissedLabels: () => useDismissedLabels,
@@ -679,7 +690,8 @@ __export(src_exports3, {
679
690
  wipePhases: () => wipePhases,
680
691
  wipeProfile: () => wipeProfile,
681
692
  withCartActorOrigin: () => withCartActorOrigin,
682
- withInteractionTracking: () => withInteractionTracking
693
+ withInteractionTracking: () => withInteractionTracking,
694
+ withSignalTurn: () => withSignalTurn
683
695
  });
684
696
 
685
697
  // src/analytics/index.ts
@@ -1432,7 +1444,8 @@ __export(session_exports, {
1432
1444
  useAction: () => useAction,
1433
1445
  useComposerDraft: () => useComposerDraft,
1434
1446
  useFourtySession: () => useFourtySession,
1435
- useOptionalFourtySession: () => useOptionalFourtySession
1447
+ useOptionalFourtySession: () => useOptionalFourtySession,
1448
+ withSignalTurn: () => withSignalTurn
1436
1449
  });
1437
1450
 
1438
1451
  // src/session/FourtySessionContext.tsx
@@ -1510,6 +1523,9 @@ __export(src_exports, {
1510
1523
  FLOW_OUTPUT_SIGNAL: () => FLOW_OUTPUT_SIGNAL,
1511
1524
  FileBugInputSchema: () => FileBugInputSchema,
1512
1525
  FocusElementPayloadSchema: () => FocusElementPayloadSchema,
1526
+ HOST_CLEARED: () => HOST_CLEARED,
1527
+ HostClearedSchema: () => HostClearedSchema,
1528
+ HostPayloadSchema: () => HostPayloadSchema,
1513
1529
  InteractionSignalSchema: () => InteractionSignalSchema,
1514
1530
  JSON_PATCH_OPS: () => JSON_PATCH_OPS,
1515
1531
  JsonPatchOpSchema: () => JsonPatchOpSchema,
@@ -1525,6 +1541,7 @@ __export(src_exports, {
1525
1541
  NAVIGATE_SIGNAL: () => NAVIGATE_SIGNAL,
1526
1542
  NavigatePayloadSchema: () => NavigatePayloadSchema,
1527
1543
  OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
1544
+ PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
1528
1545
  PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
1529
1546
  PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
1530
1547
  PRESENCE_FLOW: () => PRESENCE_FLOW,
@@ -1597,6 +1614,7 @@ __export(src_exports, {
1597
1614
  VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
1598
1615
  VIEW_EXTEND_SIGNAL: () => VIEW_EXTEND_SIGNAL,
1599
1616
  VIEW_FOCUS_ELEMENT_SIGNAL: () => VIEW_FOCUS_ELEMENT_SIGNAL,
1617
+ VIEW_HOST_SIGNAL: () => VIEW_HOST_SIGNAL,
1600
1618
  VISITOR_ACCESS: () => VISITOR_ACCESS,
1601
1619
  VISITOR_CONTEXT_SIGNAL: () => VISITOR_CONTEXT_SIGNAL,
1602
1620
  VISITOR_ID_DURABILITIES: () => VISITOR_ID_DURABILITIES,
@@ -1637,6 +1655,8 @@ __export(src_exports, {
1637
1655
  formFactorFromViewport: () => formFactorFromViewport,
1638
1656
  getProsePaths: () => getProsePaths,
1639
1657
  getResolvedPaths: () => getResolvedPaths,
1658
+ hostFillsPage: () => hostFillsPage,
1659
+ hostPlace: () => hostPlace,
1640
1660
  hostingAllows: () => hostingAllows,
1641
1661
  isActiveDirective: () => isActiveDirective,
1642
1662
  isAllowedAttachmentType: () => isAllowedAttachmentType,
@@ -1652,6 +1672,8 @@ __export(src_exports, {
1652
1672
  normalizeAttributeField: () => normalizeAttributeField,
1653
1673
  normalizeRefs: () => normalizeRefs,
1654
1674
  packRows: () => packRows,
1675
+ pageIdentityKey: () => pageIdentityKey,
1676
+ pagePlace: () => pagePlace,
1655
1677
  parseReleasePreview: () => parseReleasePreview,
1656
1678
  placeBlocks: () => placeBlocks,
1657
1679
  placedEntityRefsOf: () => placedEntityRefsOf,
@@ -1921,8 +1943,10 @@ var EMPTY_SHELL = {};
1921
1943
 
1922
1944
  // ../spacestation/src/layout/page.ts
1923
1945
  var pageKindSchemas = /* @__PURE__ */ new Map();
1924
- function registerPageKindSchema(kind, schema) {
1946
+ var pageKindIdentityOmit = /* @__PURE__ */ new Map();
1947
+ function registerPageKindSchema(kind, schema, options = {}) {
1925
1948
  pageKindSchemas.set(kind, schema);
1949
+ if (options.identityOmit !== void 0) pageKindIdentityOmit.set(kind, new Set(options.identityOmit));
1926
1950
  }
1927
1951
  function registeredPageKinds() {
1928
1952
  return [...pageKindSchemas.keys()];
@@ -1934,7 +1958,8 @@ registerPageKindSchema(
1934
1958
  kind: z8.literal("message"),
1935
1959
  messageIndex: z8.number().int().nonnegative(),
1936
1960
  messageId: z8.string().min(1).optional()
1937
- })
1961
+ }),
1962
+ { identityOmit: ["messageId"] }
1938
1963
  );
1939
1964
  registerPageKindSchema(
1940
1965
  "answer",
@@ -1942,7 +1967,8 @@ registerPageKindSchema(
1942
1967
  kind: z8.literal("answer"),
1943
1968
  messageIndex: z8.number().int().nonnegative(),
1944
1969
  messageId: z8.string().min(1).optional()
1945
- })
1970
+ }),
1971
+ { identityOmit: ["messageId"] }
1946
1972
  );
1947
1973
  function lookupPageKindSchema(val) {
1948
1974
  if (typeof val !== "object" || val === null || Array.isArray(val)) return null;
@@ -1974,6 +2000,15 @@ var ViewSchema = z8.object({
1974
2000
  layout: SpecSchema,
1975
2001
  shell: ShellConfigSchema
1976
2002
  });
2003
+ var PAGE_IDENTITY_OMIT = /* @__PURE__ */ new Set(["title"]);
2004
+ function kindOmits(kind, key) {
2005
+ const omit = pageKindIdentityOmit.get(kind);
2006
+ return omit !== void 0 && omit.has(key);
2007
+ }
2008
+ function pageIdentityKey(page) {
2009
+ const parts2 = Object.entries(page).filter(([key, value]) => key !== "kind" && value !== void 0 && !PAGE_IDENTITY_OMIT.has(key) && !kindOmits(page.kind, key)).map(([key, value]) => [key, String(value)]).sort(([a], [b]) => a < b ? -1 : a > b ? 1 : 0).map(([key, value]) => `${key}=${value}`);
2010
+ return parts2.length === 0 ? page.kind : `${page.kind}:${parts2.join(",")}`;
2011
+ }
1977
2012
 
1978
2013
  // ../spacestation/src/commerce/page-kinds.ts
1979
2014
  import { z as z9 } from "zod";
@@ -1982,8 +2017,10 @@ registerPageKindSchema(
1982
2017
  z9.object({
1983
2018
  kind: z9.literal("product"),
1984
2019
  id: z9.string().min(1),
1985
- morph: z9.boolean().optional()
1986
- })
2020
+ morph: z9.boolean().optional(),
2021
+ title: z9.string().optional()
2022
+ }),
2023
+ { identityOmit: ["morph"] }
1987
2024
  );
1988
2025
  registerPageKindSchema(
1989
2026
  "collection",
@@ -1992,7 +2029,8 @@ registerPageKindSchema(
1992
2029
  handle: z9.string().min(1),
1993
2030
  products: z9.array(z9.string()).optional(),
1994
2031
  title: z9.string().optional()
1995
- })
2032
+ }),
2033
+ { identityOmit: ["products"] }
1996
2034
  );
1997
2035
  registerPageKindSchema(
1998
2036
  "search",
@@ -2000,7 +2038,8 @@ registerPageKindSchema(
2000
2038
  kind: z9.literal("search"),
2001
2039
  query: z9.string(),
2002
2040
  products: z9.array(z9.string()).optional()
2003
- })
2041
+ }),
2042
+ { identityOmit: ["products"] }
2004
2043
  );
2005
2044
  registerPageKindSchema("article", z9.object({ kind: z9.literal("article"), id: z9.string().min(1) }));
2006
2045
  registerPageKindSchema("cms", z9.object({ kind: z9.literal("cms"), handle: z9.string().min(1) }));
@@ -2205,7 +2244,8 @@ var CartAddSignalPayloadSchema = z13.object({
2205
2244
  /**
2206
2245
  * The agent turn whose canvas element the add came from — stamped by the sdk
2207
2246
  * session hooks for a producer inside a turn (`turn-attributed-session.ts`),
2208
- * absent for one outside any (the agent's own add, the header cart, WebMCP).
2247
+ * stamped with the live turn for the agent's own add (`FourtyProvider`),
2248
+ * absent for one outside any (the header cart, WebMCP).
2209
2249
  * Carried for the same reason as `origin`: the handler that emits the outcome
2210
2250
  * sees only this payload.
2211
2251
  */
@@ -3628,24 +3668,45 @@ function isActiveDirective(directive) {
3628
3668
  return hasIsolate || directive.isolateToFacts === true || directive.availableOnly === true || directive.limit !== void 0;
3629
3669
  }
3630
3670
 
3631
- // ../spacestation/src/focus/focus.ts
3671
+ // ../spacestation/src/host/host-page.ts
3632
3672
  import { z as z30 } from "zod";
3673
+ var VIEW_HOST_SIGNAL = "view.host";
3674
+ var HostPayloadSchema = z30.object({
3675
+ page: PageSchema.nullable(),
3676
+ maxSections: z30.number().int().positive().nullable(),
3677
+ surface: z30.enum(["page", "slot"])
3678
+ });
3679
+ var HostClearedSchema = z30.object({ cleared: z30.literal(true) });
3680
+ var HOST_CLEARED = { cleared: true };
3681
+ function hostFillsPage(host) {
3682
+ return host.surface === "page";
3683
+ }
3684
+ var PAGELESS_HOST_PLACE = "host";
3685
+ function hostPlace(host) {
3686
+ return pagePlace(host.page);
3687
+ }
3688
+ function pagePlace(page) {
3689
+ return page === null ? PAGELESS_HOST_PLACE : pageIdentityKey(page);
3690
+ }
3691
+
3692
+ // ../spacestation/src/focus/focus.ts
3693
+ import { z as z31 } from "zod";
3633
3694
  var VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
3634
- var FocusElementPayloadSchema = z30.object({
3635
- elementId: z30.string().min(1)
3695
+ var FocusElementPayloadSchema = z31.object({
3696
+ elementId: z31.string().min(1)
3636
3697
  });
3637
3698
 
3638
3699
  // ../spacestation/src/view/continuation.ts
3639
- import { z as z31 } from "zod";
3700
+ import { z as z32 } from "zod";
3640
3701
  var VIEW_EXTEND_SIGNAL = "view.extend";
3641
- var ViewExtendPayloadSchema = z31.object({
3642
- reason: z31.enum(["scroll_near_bottom"])
3702
+ var ViewExtendPayloadSchema = z32.object({
3703
+ reason: z32.enum(["scroll_near_bottom"])
3643
3704
  });
3644
3705
  var VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
3645
3706
  var CONTINUATION_ENABLED = false;
3646
3707
 
3647
3708
  // ../spacestation/src/attachment/attachment.ts
3648
- import { z as z32 } from "zod";
3709
+ import { z as z33 } from "zod";
3649
3710
  var ALLOWED_ATTACHMENT_TYPES = [
3650
3711
  "image/jpeg",
3651
3712
  "image/png",
@@ -3660,36 +3721,36 @@ function isAllowedAttachmentType(mime) {
3660
3721
  function isImageAttachment(mime) {
3661
3722
  return mime.startsWith("image/");
3662
3723
  }
3663
- var AttachmentRefSchema = z32.object({
3724
+ var AttachmentRefSchema = z33.object({
3664
3725
  // A UUID, as `storeAttachment` mints it: the id becomes a storage path segment,
3665
3726
  // so nothing else — no `/`, no `..` — may reach that lookup.
3666
- id: z32.string().uuid(),
3667
- mimeType: z32.string().refine(isAllowedAttachmentType, {
3727
+ id: z33.string().uuid(),
3728
+ mimeType: z33.string().refine(isAllowedAttachmentType, {
3668
3729
  message: "mimeType not on the attachment allow-list"
3669
3730
  }),
3670
- name: z32.string().min(1),
3671
- size: z32.number().int().positive().max(MAX_ATTACHMENT_BYTES),
3672
- url: z32.string().min(1)
3731
+ name: z33.string().min(1),
3732
+ size: z33.number().int().positive().max(MAX_ATTACHMENT_BYTES),
3733
+ url: z33.string().min(1)
3673
3734
  });
3674
- var AttachmentRefsSchema = z32.array(AttachmentRefSchema);
3735
+ var AttachmentRefsSchema = z33.array(AttachmentRefSchema);
3675
3736
 
3676
3737
  // ../spacestation/src/contracts/entry-context.ts
3677
- import { z as z33 } from "zod";
3738
+ import { z as z34 } from "zod";
3678
3739
  var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
3679
3740
  var ENTRY_CONTEXT_MAX_KEYS = 12;
3680
3741
  var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
3681
3742
  var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
3682
- var EntryContextValueSchema = z33.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
3683
- var EntryContextNameSchema = z33.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
3684
- var EntryContextNamespaceSchema = z33.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
3743
+ var EntryContextValueSchema = z34.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
3744
+ var EntryContextNameSchema = z34.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
3745
+ var EntryContextNamespaceSchema = z34.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
3685
3746
  message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
3686
3747
  });
3687
- var EntryContextSchema = z33.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
3748
+ var EntryContextSchema = z34.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
3688
3749
  message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
3689
3750
  });
3690
3751
 
3691
3752
  // ../spacestation/src/contracts/session-arrival.ts
3692
- import { z as z34 } from "zod";
3753
+ import { z as z35 } from "zod";
3693
3754
  var SURFACES = [
3694
3755
  "spacefront",
3695
3756
  "embed",
@@ -3699,11 +3760,11 @@ var SURFACES = [
3699
3760
  "playground",
3700
3761
  "automation"
3701
3762
  ];
3702
- var SurfaceSchema = z34.enum(SURFACES);
3763
+ var SurfaceSchema = z35.enum(SURFACES);
3703
3764
  var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
3704
- var ClickIdKindSchema = z34.enum(CLICK_ID_KINDS);
3765
+ var ClickIdKindSchema = z35.enum(CLICK_ID_KINDS);
3705
3766
  var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
3706
- var VisitorIdDurabilitySchema = z34.enum(VISITOR_ID_DURABILITIES);
3767
+ var VisitorIdDurabilitySchema = z35.enum(VISITOR_ID_DURABILITIES);
3707
3768
  var TRAFFIC_BUCKETS = [
3708
3769
  "paid_google",
3709
3770
  "paid_meta",
@@ -3715,10 +3776,10 @@ var TRAFFIC_BUCKETS = [
3715
3776
  "direct",
3716
3777
  "unknown"
3717
3778
  ];
3718
- var TrafficBucketSchema = z34.enum(TRAFFIC_BUCKETS);
3779
+ var TrafficBucketSchema = z35.enum(TRAFFIC_BUCKETS);
3719
3780
  var ARRIVAL_MAX_VALUE_CHARS = 200;
3720
- var ArrivalValueSchema = z34.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
3721
- var SessionArrivalSchema = z34.object({
3781
+ var ArrivalValueSchema = z35.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
3782
+ var SessionArrivalSchema = z35.object({
3722
3783
  utmSource: ArrivalValueSchema.optional(),
3723
3784
  utmMedium: ArrivalValueSchema.optional(),
3724
3785
  utmCampaign: ArrivalValueSchema.optional(),
@@ -3814,36 +3875,36 @@ var WIRE_PROTOCOL_PARAM = "protocol";
3814
3875
  var WIRE_PROTOCOL_UNSUPPORTED_CLOSE = 4426;
3815
3876
 
3816
3877
  // ../spacestation/src/catalog/attribute-registry.ts
3817
- import { z as z35 } from "zod";
3818
- var AttributeScopeBucketSchema = z35.object({
3819
- scope: z35.string(),
3820
- needles: z35.array(z35.string()).readonly(),
3821
- label: z35.string().optional()
3878
+ import { z as z36 } from "zod";
3879
+ var AttributeScopeBucketSchema = z36.object({
3880
+ scope: z36.string(),
3881
+ needles: z36.array(z36.string()).readonly(),
3882
+ label: z36.string().optional()
3822
3883
  });
3823
- var AttributeScopeConfigSchema = z35.object({
3824
- facet: z35.string(),
3825
- buckets: z35.array(AttributeScopeBucketSchema).readonly(),
3826
- emptyScope: z35.string(),
3827
- noMatchScope: z35.string(),
3828
- ignoreValues: z35.array(z35.string()).readonly(),
3829
- emptyScopeLabel: z35.string().optional(),
3830
- noMatchScopeLabel: z35.string().optional()
3884
+ var AttributeScopeConfigSchema = z36.object({
3885
+ facet: z36.string(),
3886
+ buckets: z36.array(AttributeScopeBucketSchema).readonly(),
3887
+ emptyScope: z36.string(),
3888
+ noMatchScope: z36.string(),
3889
+ ignoreValues: z36.array(z36.string()).readonly(),
3890
+ emptyScopeLabel: z36.string().optional(),
3891
+ noMatchScopeLabel: z36.string().optional()
3831
3892
  });
3832
- var AttributeDefBaseSchema = z35.object({
3833
- description: z35.string().optional(),
3834
- durable: z35.boolean().optional(),
3835
- label: z35.string().optional()
3893
+ var AttributeDefBaseSchema = z36.object({
3894
+ description: z36.string().optional(),
3895
+ durable: z36.boolean().optional(),
3896
+ label: z36.string().optional()
3836
3897
  });
3837
- var AttributeDefSchema = z35.discriminatedUnion("kind", [
3838
- AttributeDefBaseSchema.extend({ kind: z35.literal("enum"), values: z35.array(z35.string()) }),
3839
- AttributeDefBaseSchema.extend({ kind: z35.literal("free_text") }),
3840
- AttributeDefBaseSchema.extend({ kind: z35.literal("date_or_season") }),
3841
- AttributeDefBaseSchema.extend({ kind: z35.literal("money_or_band") }),
3898
+ var AttributeDefSchema = z36.discriminatedUnion("kind", [
3899
+ AttributeDefBaseSchema.extend({ kind: z36.literal("enum"), values: z36.array(z36.string()) }),
3900
+ AttributeDefBaseSchema.extend({ kind: z36.literal("free_text") }),
3901
+ AttributeDefBaseSchema.extend({ kind: z36.literal("date_or_season") }),
3902
+ AttributeDefBaseSchema.extend({ kind: z36.literal("money_or_band") }),
3842
3903
  AttributeDefBaseSchema.extend({
3843
- kind: z35.literal("number"),
3844
- min: z35.number().optional(),
3845
- max: z35.number().optional(),
3846
- unit: z35.string().optional()
3904
+ kind: z36.literal("number"),
3905
+ min: z36.number().optional(),
3906
+ max: z36.number().optional(),
3907
+ unit: z36.string().optional()
3847
3908
  })
3848
3909
  ]);
3849
3910
  var EXTRAS_PREFIX = "extras.";
@@ -3882,49 +3943,49 @@ function scopeOfAttributeKey(config, key) {
3882
3943
  }
3883
3944
 
3884
3945
  // ../spacestation/src/space/agent-directive.ts
3885
- import { z as z36 } from "zod";
3946
+ import { z as z37 } from "zod";
3886
3947
  var MAX_ACTIVE_AGENT_DIRECTIVES = 12;
3887
3948
  var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
3888
3949
  var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
3889
3950
  var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
3890
3951
  var AGENT_DIRECTIVE_STATUSES = ["proposed", "active", "rejected", "retired"];
3891
- var AgentDirectiveSchema = z36.object({
3892
- name: z36.string().trim().min(1).max(80),
3893
- kind: z36.enum(AGENT_DIRECTIVE_KINDS),
3894
- severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
3952
+ var AgentDirectiveSchema = z37.object({
3953
+ name: z37.string().trim().min(1).max(80),
3954
+ kind: z37.enum(AGENT_DIRECTIVE_KINDS),
3955
+ severity: z37.enum(AGENT_DIRECTIVE_SEVERITIES),
3895
3956
  /** No bare URL: a URL is a hallucination surface, and a handle is not a
3896
3957
  * product name. */
3897
- text: z36.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
3958
+ text: z37.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
3898
3959
  }).strict();
3899
- var SpaceAgentDirectiveSchema = z36.object({
3900
- id: z36.string(),
3901
- position: z36.number().int(),
3902
- name: z36.string(),
3903
- kind: z36.enum(AGENT_DIRECTIVE_KINDS),
3904
- severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
3905
- text: z36.string(),
3906
- source: z36.enum(AGENT_DIRECTIVE_SOURCES),
3907
- status: z36.enum(AGENT_DIRECTIVE_STATUSES),
3960
+ var SpaceAgentDirectiveSchema = z37.object({
3961
+ id: z37.string(),
3962
+ position: z37.number().int(),
3963
+ name: z37.string(),
3964
+ kind: z37.enum(AGENT_DIRECTIVE_KINDS),
3965
+ severity: z37.enum(AGENT_DIRECTIVE_SEVERITIES),
3966
+ text: z37.string(),
3967
+ source: z37.enum(AGENT_DIRECTIVE_SOURCES),
3968
+ status: z37.enum(AGENT_DIRECTIVE_STATUSES),
3908
3969
  /** Who wrote it; null for a lesson the system proposed. */
3909
- createdBy: z36.string().nullable(),
3970
+ createdBy: z37.string().nullable(),
3910
3971
  /** Why a mined lesson was proposed; null for a directive a person wrote. */
3911
- evidence: z36.record(z36.unknown()).nullable(),
3912
- decidedBy: z36.string().nullable(),
3913
- decidedAt: z36.string().nullable(),
3914
- createdAt: z36.string()
3972
+ evidence: z37.record(z37.unknown()).nullable(),
3973
+ decidedBy: z37.string().nullable(),
3974
+ decidedAt: z37.string().nullable(),
3975
+ createdAt: z37.string()
3915
3976
  });
3916
- var OutcomeTallySchema = z36.object({ turns: z36.number().int(), acted: z36.number().int() });
3977
+ var OutcomeTallySchema = z37.object({ turns: z37.number().int(), acted: z37.number().int() });
3917
3978
  var SpaceAgentDirectiveListItemSchema = SpaceAgentDirectiveSchema.extend({
3918
- impact: z36.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
3979
+ impact: z37.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
3919
3980
  });
3920
- var UpdateAgentDirectiveInputSchema = z36.object({
3981
+ var UpdateAgentDirectiveInputSchema = z37.object({
3921
3982
  name: AgentDirectiveSchema.shape.name.optional(),
3922
3983
  kind: AgentDirectiveSchema.shape.kind.optional(),
3923
3984
  severity: AgentDirectiveSchema.shape.severity.optional(),
3924
3985
  text: AgentDirectiveSchema.shape.text.optional(),
3925
- status: z36.enum(AGENT_DIRECTIVE_STATUSES).optional()
3986
+ status: z37.enum(AGENT_DIRECTIVE_STATUSES).optional()
3926
3987
  }).strict();
3927
- var ReorderAgentDirectivesInputSchema = z36.object({ ids: z36.array(z36.string()).min(1) }).strict();
3988
+ var ReorderAgentDirectivesInputSchema = z37.object({ ids: z37.array(z37.string()).min(1) }).strict();
3928
3989
 
3929
3990
  // ../spacestation/src/space/workspace-catalog.ts
3930
3991
  var COMPONENT_SOURCE = {
@@ -3988,30 +4049,30 @@ function hostingAllows(hosting, surface) {
3988
4049
  }
3989
4050
 
3990
4051
  // ../spacestation/src/space/trace.ts
3991
- import { z as z37 } from "zod";
3992
- var RunTokenUsageSchema = z37.object({
3993
- input_tokens: z37.number().optional(),
3994
- output_tokens: z37.number().optional(),
3995
- cache_read_tokens: z37.number().optional()
4052
+ import { z as z38 } from "zod";
4053
+ var RunTokenUsageSchema = z38.object({
4054
+ input_tokens: z38.number().optional(),
4055
+ output_tokens: z38.number().optional(),
4056
+ cache_read_tokens: z38.number().optional()
3996
4057
  });
3997
- var TraceRecordSchema = z37.object({
3998
- id: z37.string().uuid(),
3999
- spaceId: z37.string().uuid().nullable(),
4000
- sessionId: z37.string(),
4058
+ var TraceRecordSchema = z38.object({
4059
+ id: z38.string().uuid(),
4060
+ spaceId: z38.string().uuid().nullable(),
4061
+ sessionId: z38.string(),
4001
4062
  /** OTP-verified visitor email the session was unlocked with, or `null`
4002
4063
  * for an unlocked space / anonymous unlock. */
4003
- visitorEmail: z37.string().nullable(),
4004
- userPrompt: z37.string(),
4005
- branch: z37.string().nullable(),
4006
- responseText: z37.string().nullable(),
4007
- layout: z37.unknown().nullable(),
4008
- phaseTimings: z37.record(z37.number()).nullable(),
4009
- tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
4010
- toolCalls: z37.array(z37.unknown()).nullable(),
4011
- diagnostics: z37.array(z37.unknown()).nullable(),
4012
- latencyFirstText: z37.number().int().nullable(),
4013
- latencyFirstPatch: z37.number().int().nullable(),
4014
- latencyTotal: z37.number().int().nullable(),
4064
+ visitorEmail: z38.string().nullable(),
4065
+ userPrompt: z38.string(),
4066
+ branch: z38.string().nullable(),
4067
+ responseText: z38.string().nullable(),
4068
+ layout: z38.unknown().nullable(),
4069
+ phaseTimings: z38.record(z38.number()).nullable(),
4070
+ tokensByModel: z38.record(RunTokenUsageSchema).nullable(),
4071
+ toolCalls: z38.array(z38.unknown()).nullable(),
4072
+ diagnostics: z38.array(z38.unknown()).nullable(),
4073
+ latencyFirstText: z38.number().int().nullable(),
4074
+ latencyFirstPatch: z38.number().int().nullable(),
4075
+ latencyTotal: z38.number().int().nullable(),
4015
4076
  /**
4016
4077
  * The CLIENT's turn id for this run, or `null`.
4017
4078
  *
@@ -4027,29 +4088,29 @@ var TraceRecordSchema = z37.object({
4027
4088
  * a turn whose ack the client never saw — none of which is evidence that a
4028
4089
  * visitor asked something and got nothing.
4029
4090
  */
4030
- turnId: z37.string().nullable(),
4091
+ turnId: z38.string().nullable(),
4031
4092
  /** Serialized `TraceTracker.exportState()` payload (parsed object) —
4032
4093
  * lets the inspector rehydrate this run verbatim after a reload. */
4033
- trackerState: z37.unknown().nullable(),
4034
- createdAt: z37.string()
4094
+ trackerState: z38.unknown().nullable(),
4095
+ createdAt: z38.string()
4035
4096
  });
4036
- var MillisecondsSchema = z37.number().nullable().transform((v) => v === null ? null : Math.round(v));
4037
- var CreateTraceInputSchema = z37.object({
4038
- spaceId: z37.string().uuid().nullable(),
4039
- sessionId: z37.string(),
4040
- visitorEmail: z37.string().nullable(),
4041
- userPrompt: z37.string(),
4042
- branch: z37.string().nullable(),
4043
- responseText: z37.string().nullable(),
4044
- layout: z37.unknown().nullable(),
4045
- phaseTimings: z37.record(z37.number()).nullable(),
4046
- tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
4047
- toolCalls: z37.array(z37.unknown()).nullable(),
4048
- diagnostics: z37.array(z37.unknown()).nullable(),
4097
+ var MillisecondsSchema = z38.number().nullable().transform((v) => v === null ? null : Math.round(v));
4098
+ var CreateTraceInputSchema = z38.object({
4099
+ spaceId: z38.string().uuid().nullable(),
4100
+ sessionId: z38.string(),
4101
+ visitorEmail: z38.string().nullable(),
4102
+ userPrompt: z38.string(),
4103
+ branch: z38.string().nullable(),
4104
+ responseText: z38.string().nullable(),
4105
+ layout: z38.unknown().nullable(),
4106
+ phaseTimings: z38.record(z38.number()).nullable(),
4107
+ tokensByModel: z38.record(RunTokenUsageSchema).nullable(),
4108
+ toolCalls: z38.array(z38.unknown()).nullable(),
4109
+ diagnostics: z38.array(z38.unknown()).nullable(),
4049
4110
  latencyFirstText: MillisecondsSchema,
4050
4111
  latencyFirstPatch: MillisecondsSchema,
4051
4112
  latencyTotal: MillisecondsSchema,
4052
- trackerState: z37.unknown().nullable(),
4113
+ trackerState: z38.unknown().nullable(),
4053
4114
  /**
4054
4115
  * The CLIENT's turn id for this run, or `null`.
4055
4116
  *
@@ -4065,37 +4126,37 @@ var CreateTraceInputSchema = z37.object({
4065
4126
  * a turn whose ack the client never saw — none of which is evidence that a
4066
4127
  * visitor asked something and got nothing.
4067
4128
  */
4068
- turnId: z37.string().nullable()
4129
+ turnId: z38.string().nullable()
4069
4130
  });
4070
- var AgentSessionSummarySchema = z37.object({
4071
- sessionId: z37.string(),
4131
+ var AgentSessionSummarySchema = z38.object({
4132
+ sessionId: z38.string(),
4072
4133
  /** Turn rows only; background/secondary runs are excluded by the aggregate. */
4073
- turnCount: z37.number().int(),
4134
+ turnCount: z38.number().int(),
4074
4135
  /** The session's opening prompt — titles the row in the UI. */
4075
- firstPrompt: z37.string(),
4076
- startedAt: z37.string(),
4077
- lastRunAt: z37.string(),
4136
+ firstPrompt: z38.string(),
4137
+ startedAt: z38.string(),
4138
+ lastRunAt: z38.string(),
4078
4139
  /** Summed `latency_total` across the session's turns. */
4079
- totalLatencyMs: z37.number().int()
4140
+ totalLatencyMs: z38.number().int()
4080
4141
  });
4081
- var SessionTurnSchema = z37.object({
4082
- id: z37.string().uuid(),
4083
- userPrompt: z37.string(),
4084
- responseText: z37.string().nullable(),
4142
+ var SessionTurnSchema = z38.object({
4143
+ id: z38.string().uuid(),
4144
+ userPrompt: z38.string(),
4145
+ responseText: z38.string().nullable(),
4085
4146
  /** Full cumulative Spec committed by this turn — never a patch delta. */
4086
- layout: z37.unknown().nullable(),
4087
- createdAt: z37.string(),
4088
- latencyTotal: z37.number().int().nullable(),
4089
- phaseTimings: z37.record(z37.number()).nullable(),
4090
- tokensByModel: z37.record(z37.object({
4091
- input_tokens: z37.number().optional(),
4092
- output_tokens: z37.number().optional()
4147
+ layout: z38.unknown().nullable(),
4148
+ createdAt: z38.string(),
4149
+ latencyTotal: z38.number().int().nullable(),
4150
+ phaseTimings: z38.record(z38.number()).nullable(),
4151
+ tokensByModel: z38.record(z38.object({
4152
+ input_tokens: z38.number().optional(),
4153
+ output_tokens: z38.number().optional()
4093
4154
  })).nullable(),
4094
- toolCalls: z37.array(z37.unknown()).nullable(),
4095
- diagnostics: z37.array(z37.unknown()).nullable()
4155
+ toolCalls: z38.array(z38.unknown()).nullable(),
4156
+ diagnostics: z38.array(z38.unknown()).nullable()
4096
4157
  });
4097
- var SessionReplaySchema = z37.object({
4098
- turns: z37.array(SessionTurnSchema),
4158
+ var SessionReplaySchema = z38.object({
4159
+ turns: z38.array(SessionTurnSchema),
4099
4160
  /**
4100
4161
  * The session's own last-committed layout, read straight off the durable
4101
4162
  * session record (`sessions.blob.layout`) rather than derived from `turns`.
@@ -4106,20 +4167,20 @@ var SessionReplaySchema = z37.object({
4106
4167
  * a perfectly real layout; only this field can show it. Null exclusively
4107
4168
  * when the durable session row itself could not be read.
4108
4169
  */
4109
- sessionLayout: z37.record(z37.string(), z37.unknown()).nullable()
4170
+ sessionLayout: z38.record(z38.string(), z38.unknown()).nullable()
4110
4171
  });
4111
- var SessionTraceSchema = z37.object({
4112
- trackerState: z37.string().nullable()
4172
+ var SessionTraceSchema = z38.object({
4173
+ trackerState: z38.string().nullable()
4113
4174
  });
4114
- var LlmUsageDailySchema = z37.object({
4115
- day: z37.string(),
4175
+ var LlmUsageDailySchema = z38.object({
4176
+ day: z38.string(),
4116
4177
  /** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
4117
- environment: z37.string(),
4118
- feature: z37.string(),
4119
- model: z37.string(),
4120
- provider: z37.string(),
4178
+ environment: z38.string(),
4179
+ feature: z38.string(),
4180
+ model: z38.string(),
4181
+ provider: z38.string(),
4121
4182
  /** Masked tail of the key actually billed, or null when unknown/non-Google. */
4122
- keyFingerprint: z37.string().nullable(),
4183
+ keyFingerprint: z38.string().nullable(),
4123
4184
  /**
4124
4185
  * The space the call served, or null when it served none.
4125
4186
  *
@@ -4128,91 +4189,91 @@ var LlmUsageDailySchema = z37.object({
4128
4189
  * report that share rather than dropping it, or a per-space total reads as
4129
4190
  * the platform total.
4130
4191
  */
4131
- spaceId: z37.string().nullable(),
4192
+ spaceId: z38.string().nullable(),
4132
4193
  /**
4133
4194
  * The surface of the session the call served (`sessions.surface`), or null
4134
4195
  * when it served no session or the session predates surface recording.
4135
4196
  * `automation` is the eval harness — the signal that files an ordinary
4136
4197
  * `agent-turn` as testing spend rather than as a visitor's.
4137
4198
  */
4138
- surface: z37.string().nullable(),
4139
- inputTokens: z37.number(),
4140
- outputTokens: z37.number(),
4199
+ surface: z38.string().nullable(),
4200
+ inputTokens: z38.number(),
4201
+ outputTokens: z38.number(),
4141
4202
  /** Subset of inputTokens, never additional to it. */
4142
- cachedInputTokens: z37.number(),
4143
- reasoningTokens: z37.number(),
4144
- callCount: z37.number(),
4145
- errorCount: z37.number(),
4146
- estimatedCostUsd: z37.number().nullable()
4203
+ cachedInputTokens: z38.number(),
4204
+ reasoningTokens: z38.number(),
4205
+ callCount: z38.number(),
4206
+ errorCount: z38.number(),
4207
+ estimatedCostUsd: z38.number().nullable()
4147
4208
  });
4148
- var LlmUsageBySessionSchema = z37.object({
4149
- sessionId: z37.string(),
4150
- environment: z37.string(),
4151
- model: z37.string(),
4209
+ var LlmUsageBySessionSchema = z38.object({
4210
+ sessionId: z38.string(),
4211
+ environment: z38.string(),
4212
+ model: z38.string(),
4152
4213
  /** The space this session belongs to, or null for a session with no space. */
4153
- spaceId: z37.string().nullable(),
4214
+ spaceId: z38.string().nullable(),
4154
4215
  /** The session's surface — see `LlmUsageDailySchema.surface`. */
4155
- surface: z37.string().nullable(),
4216
+ surface: z38.string().nullable(),
4156
4217
  /** Label only — the first feature seen in the session. */
4157
- firstFeature: z37.string(),
4158
- startedAt: z37.string(),
4159
- endedAt: z37.string(),
4160
- inputTokens: z37.number(),
4161
- outputTokens: z37.number(),
4162
- cachedInputTokens: z37.number(),
4163
- reasoningTokens: z37.number(),
4164
- callCount: z37.number(),
4165
- errorCount: z37.number(),
4218
+ firstFeature: z38.string(),
4219
+ startedAt: z38.string(),
4220
+ endedAt: z38.string(),
4221
+ inputTokens: z38.number(),
4222
+ outputTokens: z38.number(),
4223
+ cachedInputTokens: z38.number(),
4224
+ reasoningTokens: z38.number(),
4225
+ callCount: z38.number(),
4226
+ errorCount: z38.number(),
4166
4227
  /** Priced server-side, like the daily rollup — the browser never carries a
4167
4228
  * rate table, so there is exactly one place a price can be wrong. Null when
4168
4229
  * the model is unpriced; never 0, which would read as free. */
4169
- estimatedCostUsd: z37.number().nullable()
4230
+ estimatedCostUsd: z38.number().nullable()
4170
4231
  });
4171
- var LlmSessionsDailySchema = z37.object({
4172
- day: z37.string(),
4173
- environment: z37.string(),
4174
- sessionCount: z37.number()
4232
+ var LlmSessionsDailySchema = z38.object({
4233
+ day: z38.string(),
4234
+ environment: z38.string(),
4235
+ sessionCount: z38.number()
4175
4236
  });
4176
4237
 
4177
4238
  // ../spacestation/src/space/session-queue.ts
4178
- import { z as z39 } from "zod";
4239
+ import { z as z40 } from "zod";
4179
4240
 
4180
4241
  // ../spacestation/src/space/session-activity.ts
4181
- import { z as z38 } from "zod";
4182
- var SessionActivityEventSchema = z38.object({
4183
- id: z38.string(),
4184
- kind: z38.string(),
4185
- occurredAt: z38.string(),
4186
- source: z38.string(),
4187
- surface: z38.string(),
4188
- payload: z38.record(z38.unknown())
4242
+ import { z as z39 } from "zod";
4243
+ var SessionActivityEventSchema = z39.object({
4244
+ id: z39.string(),
4245
+ kind: z39.string(),
4246
+ occurredAt: z39.string(),
4247
+ source: z39.string(),
4248
+ surface: z39.string(),
4249
+ payload: z39.record(z39.unknown())
4189
4250
  });
4190
- var SessionActivitySchema = z38.object({
4191
- events: z38.array(SessionActivityEventSchema),
4192
- hasMore: z38.boolean()
4251
+ var SessionActivitySchema = z39.object({
4252
+ events: z39.array(SessionActivityEventSchema),
4253
+ hasMore: z39.boolean()
4193
4254
  });
4194
4255
 
4195
4256
  // ../spacestation/src/space/session-queue.ts
4196
- var SessionVerdictSchema = z39.enum(["unreviewed", "viewed", "bug"]);
4197
- var RecordableVerdictSchema = z39.enum(["viewed", "bug"]);
4198
- var SessionReviewEventSchema = z39.object({
4199
- id: z39.string().uuid(),
4257
+ var SessionVerdictSchema = z40.enum(["unreviewed", "viewed", "bug"]);
4258
+ var RecordableVerdictSchema = z40.enum(["viewed", "bug"]);
4259
+ var SessionReviewEventSchema = z40.object({
4260
+ id: z40.string().uuid(),
4200
4261
  verdict: RecordableVerdictSchema,
4201
4262
  /** Account email of the operator who judged it. Attribution is the reason the
4202
4263
  * log is append-only rather than a mutable current-state row. */
4203
- reviewer: z39.string(),
4204
- note: z39.string().nullable(),
4205
- createdAt: z39.string()
4264
+ reviewer: z40.string(),
4265
+ note: z40.string().nullable(),
4266
+ createdAt: z40.string()
4206
4267
  });
4207
- var BugSeveritySchema = z39.enum(["high", "medium", "low"]);
4208
- var BugLocationSchema = z39.object({
4209
- elementId: z39.string().nullable(),
4268
+ var BugSeveritySchema = z40.enum(["high", "medium", "low"]);
4269
+ var BugLocationSchema = z40.object({
4270
+ elementId: z40.string().nullable(),
4210
4271
  /** Display only — the catalog component type, e.g. "productGrid". Null
4211
4272
  * alongside a null `elementId`. */
4212
- elementType: z39.string().nullable(),
4273
+ elementType: z40.string().nullable(),
4213
4274
  /** Fraction of the ELEMENT's own box. Null for a page anchor. */
4214
- offsetXPct: z39.number().min(0).max(100).nullable(),
4215
- offsetYPct: z39.number().min(0).max(100).nullable(),
4275
+ offsetXPct: z40.number().min(0).max(100).nullable(),
4276
+ offsetYPct: z40.number().min(0).max(100).nullable(),
4216
4277
  /**
4217
4278
  * ABSOLUTE document pixels, for a pin with no element under it. Null for an
4218
4279
  * element anchor.
@@ -4223,8 +4284,8 @@ var BugLocationSchema = z39.object({
4223
4284
  * on the page with it. Measured before this was fixed: growing the page 9%
4224
4285
  * slid a pin 32px, so a pin ran away from the cursor reaching for it.
4225
4286
  */
4226
- pageX: z39.number().nullable(),
4227
- pageY: z39.number().nullable()
4287
+ pageX: z40.number().nullable(),
4288
+ pageY: z40.number().nullable()
4228
4289
  }).refine(
4229
4290
  (loc) => {
4230
4291
  const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
@@ -4238,24 +4299,24 @@ var BugLocationSchema = z39.object({
4238
4299
  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)"
4239
4300
  }
4240
4301
  );
4241
- var SessionBugSchema = z39.object({
4242
- id: z39.string().uuid(),
4302
+ var SessionBugSchema = z40.object({
4303
+ id: z40.string().uuid(),
4243
4304
  /** 1-based turn the fault was observed on; null when the fault is session-wide. */
4244
- turnIndex: z39.number().int().nullable(),
4305
+ turnIndex: z40.number().int().nullable(),
4245
4306
  /** Where on that turn's canvas the pin was dropped; null for a bug filed
4246
4307
  * without pinning a spot. */
4247
4308
  location: BugLocationSchema.nullable(),
4248
- provider: z39.string(),
4249
- issueKey: z39.string().nullable(),
4250
- issueUrl: z39.string().nullable(),
4309
+ provider: z40.string(),
4310
+ issueKey: z40.string().nullable(),
4311
+ issueUrl: z40.string().nullable(),
4251
4312
  /** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
4252
4313
  * open text. Null until first synced. */
4253
- issueState: z39.string().nullable(),
4254
- title: z39.string(),
4255
- body: z39.string(),
4314
+ issueState: z40.string().nullable(),
4315
+ title: z40.string(),
4316
+ body: z40.string(),
4256
4317
  severity: BugSeveritySchema,
4257
- createdBy: z39.string(),
4258
- createdAt: z39.string(),
4318
+ createdBy: z40.string(),
4319
+ createdAt: z40.string(),
4259
4320
  /**
4260
4321
  * When this bug was resolved from the console; null means still OPEN.
4261
4322
  *
@@ -4264,60 +4325,60 @@ var SessionBugSchema = z39.object({
4264
4325
  * whether a particular fault is still live. The timestamp IS the state, so
4265
4326
  * no boolean can contradict it.
4266
4327
  */
4267
- resolvedAt: z39.string().nullable(),
4268
- resolvedBy: z39.string().nullable()
4328
+ resolvedAt: z40.string().nullable(),
4329
+ resolvedBy: z40.string().nullable()
4269
4330
  });
4270
- var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z39.string() });
4271
- var SessionCommentSchema = z39.object({
4272
- id: z39.string().uuid(),
4331
+ var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z40.string() });
4332
+ var SessionCommentSchema = z40.object({
4333
+ id: z40.string().uuid(),
4273
4334
  /** Set = a reply in that bug's thread. Null = a standalone comment pin. */
4274
- bugId: z39.string().uuid().nullable(),
4335
+ bugId: z40.string().uuid().nullable(),
4275
4336
  /** 1-based turn the comment was left on; null for a reply (it reads its
4276
4337
  * parent bug's turn). */
4277
- turnIndex: z39.number().int().nullable(),
4338
+ turnIndex: z40.number().int().nullable(),
4278
4339
  /** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
4279
4340
  location: BugLocationSchema.nullable(),
4280
- body: z39.string(),
4281
- createdBy: z39.string(),
4282
- createdAt: z39.string()
4341
+ body: z40.string(),
4342
+ createdBy: z40.string(),
4343
+ createdAt: z40.string()
4283
4344
  });
4284
- var CreateCommentInputSchema = z39.object({
4285
- bugId: z39.string().uuid().nullable(),
4286
- turnIndex: z39.number().int().positive().nullable(),
4345
+ var CreateCommentInputSchema = z40.object({
4346
+ bugId: z40.string().uuid().nullable(),
4347
+ turnIndex: z40.number().int().positive().nullable(),
4287
4348
  location: BugLocationSchema.nullable(),
4288
4349
  // Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
4289
4350
  // of three spaces, which renders as an empty bubble nobody can interpret.
4290
- body: z39.string().trim().min(1)
4351
+ body: z40.string().trim().min(1)
4291
4352
  }).refine((input) => input.bugId === null !== (input.location === null), {
4292
4353
  message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
4293
4354
  });
4294
- var UpdateCommentInputSchema = z39.object({
4295
- body: z39.string().trim().min(1).optional(),
4296
- bugId: z39.string().uuid().nullable().optional(),
4355
+ var UpdateCommentInputSchema = z40.object({
4356
+ body: z40.string().trim().min(1).optional(),
4357
+ bugId: z40.string().uuid().nullable().optional(),
4297
4358
  location: BugLocationSchema.nullable().optional()
4298
4359
  });
4299
4360
  var MOBILE_VIEWPORT_MAX = 720;
4300
- var SessionFormFactorSchema = z39.enum(["mobile", "desktop"]).nullable();
4361
+ var SessionFormFactorSchema = z40.enum(["mobile", "desktop"]).nullable();
4301
4362
  function formFactorFromViewport(width) {
4302
4363
  if (width === null) return null;
4303
4364
  return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
4304
4365
  }
4305
- var SessionSummarySchema = z39.object({
4306
- sessionId: z39.string(),
4366
+ var SessionSummarySchema = z40.object({
4367
+ sessionId: z40.string(),
4307
4368
  /** Stable per-browser id — the join key across a visitor's sessions. Null when
4308
4369
  * the session row is gone (pruned) or predates the `sessions` table. */
4309
- visitorId: z39.string().nullable(),
4370
+ visitorId: z40.string().nullable(),
4310
4371
  /** Provider-qualified identity anchor, present only once the visitor
4311
4372
  * identified themselves. Both null together means "not identified yet". */
4312
- identityProvider: z39.string().nullable(),
4313
- identityKey: z39.string().nullable(),
4373
+ identityProvider: z40.string().nullable(),
4374
+ identityKey: z40.string().nullable(),
4314
4375
  /** Team/test traffic. The queue hides these by default. */
4315
- isInternal: z39.boolean(),
4376
+ isInternal: z40.boolean(),
4316
4377
  /** Build that served the session. Null = not captured; a version filter must
4317
4378
  * therefore EXCLUDE it rather than let it match an arbitrary bucket. */
4318
- clientVersion: z39.string().nullable(),
4379
+ clientVersion: z40.string().nullable(),
4319
4380
  /** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
4320
- signalCounts: z39.record(z39.number()),
4381
+ signalCounts: z40.record(z40.number()),
4321
4382
  /**
4322
4383
  * Did this conversation ACQUIRE anything, and how many times?
4323
4384
  *
@@ -4334,7 +4395,7 @@ var SessionSummarySchema = z39.object({
4334
4395
  * predates the column — and renders as no mark at all. It never means zero:
4335
4396
  * zero is a real, recorded answer and the rail reports it as one.
4336
4397
  */
4337
- conversionAttempts: z39.number().int().nullable(),
4398
+ conversionAttempts: z40.number().int().nullable(),
4338
4399
  /**
4339
4400
  * The same attempts split by EVENT KIND, keyed by the kind's own name
4340
4401
  * (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
@@ -4350,7 +4411,7 @@ var SessionSummarySchema = z39.object({
4350
4411
  * kinds together, and one attempt id appearing under both would be counted
4351
4412
  * once there and twice here.
4352
4413
  */
4353
- conversionKinds: z39.record(z39.number()),
4414
+ conversionKinds: z40.record(z40.number()),
4354
4415
  /**
4355
4416
  * Every analytics funnel step this session reached, in funnel order — the
4356
4417
  * dashboard's own step ids, read by the same per-step predicates, so a queue
@@ -4358,20 +4419,20 @@ var SessionSummarySchema = z39.object({
4358
4419
  * set of strings for the reason `conversionKinds` is: the contract does not
4359
4420
  * learn what a step means. Empty only when read from a pre-column database.
4360
4421
  */
4361
- funnelSteps: z39.array(z39.string()),
4422
+ funnelSteps: z40.array(z40.string()),
4362
4423
  /**
4363
4424
  * The connector's opaque handle for what this session produced in its back
4364
4425
  * office — present only once a checkout actually reached the platform. The
4365
4426
  * console hands it to the back-office link registry; nothing else reads it.
4366
4427
  */
4367
- backOfficeRef: z39.string().nullable(),
4428
+ backOfficeRef: z40.string().nullable(),
4368
4429
  /**
4369
4430
  * The order this session produced, when the connector's back office reported
4370
4431
  * it (`session_orders`): its opaque id and the back office's own name for it.
4371
4432
  * Both null when no order is known — the cart handle above is then the door.
4372
4433
  */
4373
- orderRef: z39.string().nullable(),
4374
- orderLabel: z39.string().nullable(),
4434
+ orderRef: z40.string().nullable(),
4435
+ orderLabel: z40.string().nullable(),
4375
4436
  /**
4376
4437
  * Which shell this session rendered — the one thing about the CAPTURE a list
4377
4438
  * needs.
@@ -4384,12 +4445,12 @@ var SessionSummarySchema = z39.object({
4384
4445
  * on a desktop are not the same session.
4385
4446
  */
4386
4447
  formFactor: SessionFormFactorSchema,
4387
- turnCount: z39.number().int(),
4448
+ turnCount: z40.number().int(),
4388
4449
  /** The visitor's opening message — the single most informative field for
4389
4450
  * deciding whether a session is worth opening, hence the widest column. */
4390
- firstPrompt: z39.string(),
4391
- startedAt: z39.string(),
4392
- lastRunAt: z39.string(),
4451
+ firstPrompt: z40.string(),
4452
+ startedAt: z40.string(),
4453
+ lastRunAt: z40.string(),
4393
4454
  /**
4394
4455
  * The VISITOR's own IANA zone (`America/New_York`), read from their browser
4395
4456
  * at session create — what the two timestamps above should be read in.
@@ -4417,7 +4478,7 @@ var SessionSummarySchema = z39.object({
4417
4478
  * Client-asserted and never validated against a zone table, so every consumer
4418
4479
  * must tolerate an unknown name: `Intl` throws a RangeError on one.
4419
4480
  */
4420
- visitorTimeZone: z39.string().nullable(),
4481
+ visitorTimeZone: z40.string().nullable(),
4421
4482
  /**
4422
4483
  * Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
4423
4484
  * layout op reaching the visitor, and THE latency the project is managed on.
@@ -4425,31 +4486,31 @@ var SessionSummarySchema = z39.object({
4425
4486
  * `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
4426
4487
  * already reading. Null when no turn in the session recorded a patch.
4427
4488
  */
4428
- avgTtftMs: z39.number().int().nullable(),
4489
+ avgTtftMs: z40.number().int().nullable(),
4429
4490
  /** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
4430
4491
  * a budget: null on sessions older than the mark's recording. */
4431
- avgMainDoneMs: z39.number().int().nullable(),
4492
+ avgMainDoneMs: z40.number().int().nullable(),
4432
4493
  /** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
4433
4494
  * budget. On the row only to explain the gap to `totalLatencyMs`. */
4434
- avgChipGenMs: z39.number().int().nullable(),
4435
- totalLatencyMs: z39.number().int(),
4436
- durationMs: z39.number().int(),
4495
+ avgChipGenMs: z40.number().int().nullable(),
4496
+ totalLatencyMs: z40.number().int(),
4497
+ durationMs: z40.number().int(),
4437
4498
  /** Inferred from recent activity — nothing writes a session-end marker. A
4438
4499
  * live session streams and cannot be given a verdict until it ends. */
4439
- isLive: z39.boolean(),
4500
+ isLive: z40.boolean(),
4440
4501
  verdict: SessionVerdictSchema,
4441
- reviewedBy: z39.string().nullable(),
4442
- reviewedAt: z39.string().nullable(),
4502
+ reviewedBy: z40.string().nullable(),
4503
+ reviewedAt: z40.string().nullable(),
4443
4504
  /** Latest filed bug, flattened onto the row so the queue can show its live
4444
4505
  * state without a second request. */
4445
- bugIssueKey: z39.string().nullable(),
4446
- bugIssueUrl: z39.string().nullable(),
4447
- bugIssueState: z39.string().nullable()
4506
+ bugIssueKey: z40.string().nullable(),
4507
+ bugIssueUrl: z40.string().nullable(),
4508
+ bugIssueState: z40.string().nullable()
4448
4509
  });
4449
- var SessionQueuePageSchema = z39.object({
4450
- sessions: z39.array(SessionSummarySchema),
4451
- totalCount: z39.number().int(),
4452
- hiddenInternalCount: z39.number().int(),
4510
+ var SessionQueuePageSchema = z40.object({
4511
+ sessions: z40.array(SessionSummarySchema),
4512
+ totalCount: z40.number().int(),
4513
+ hiddenInternalCount: z40.number().int(),
4453
4514
  /**
4454
4515
  * Bounced sessions the queue left out — no turn and no add, the default.
4455
4516
  *
@@ -4459,61 +4520,61 @@ var SessionQueuePageSchema = z39.object({
4459
4520
  * `totalCount + hiddenBouncedCount` is that population, and this count is the
4460
4521
  * analytics dashboard's bounce over the same window.
4461
4522
  */
4462
- hiddenBouncedCount: z39.number().int()
4523
+ hiddenBouncedCount: z40.number().int()
4463
4524
  });
4464
- var SessionQueueFacetsSchema = z39.object({
4465
- review: z39.record(z39.number()),
4466
- version: z39.record(z39.number()),
4467
- turns: z39.record(z39.number()),
4468
- durationS: z39.record(z39.number()),
4525
+ var SessionQueueFacetsSchema = z40.object({
4526
+ review: z40.record(z40.number()),
4527
+ version: z40.record(z40.number()),
4528
+ turns: z40.record(z40.number()),
4529
+ durationS: z40.record(z40.number()),
4469
4530
  /** Sessions per funnel step reached — a session counts under every step it reached. */
4470
- funnel: z39.record(z39.number())
4531
+ funnel: z40.record(z40.number())
4471
4532
  });
4472
- var SessionCaptureSchema = z39.object({
4473
- viewportWidth: z39.number().int().nullable(),
4474
- viewportHeight: z39.number().int().nullable(),
4475
- userAgent: z39.string().nullable(),
4476
- locale: z39.string().nullable(),
4533
+ var SessionCaptureSchema = z40.object({
4534
+ viewportWidth: z40.number().int().nullable(),
4535
+ viewportHeight: z40.number().int().nullable(),
4536
+ userAgent: z40.string().nullable(),
4537
+ locale: z40.string().nullable(),
4477
4538
  /** Referrer at session create — separates agentic traffic from organic. */
4478
- referrer: z39.string().nullable()
4539
+ referrer: z40.string().nullable()
4479
4540
  });
4480
- var SessionCaptureInputSchema = z39.object({
4481
- viewportWidth: z39.number().int().positive().max(2e4).optional(),
4482
- viewportHeight: z39.number().int().positive().max(2e4).optional(),
4483
- userAgent: z39.string().max(1e3).optional(),
4484
- locale: z39.string().max(35).optional(),
4541
+ var SessionCaptureInputSchema = z40.object({
4542
+ viewportWidth: z40.number().int().positive().max(2e4).optional(),
4543
+ viewportHeight: z40.number().int().positive().max(2e4).optional(),
4544
+ userAgent: z40.string().max(1e3).optional(),
4545
+ locale: z40.string().max(35).optional(),
4485
4546
  /** IANA zone name from the visitor's browser. Bounded rather than validated:
4486
4547
  * the zone database grows, and refusing a name this build has not heard of
4487
4548
  * would drop a real session's capture over a table that is out of date. */
4488
- timeZone: z39.string().max(64).optional(),
4489
- referrer: z39.string().max(2048).optional(),
4490
- clientVersion: z39.string().max(100).optional(),
4491
- isInternal: z39.boolean().optional()
4549
+ timeZone: z40.string().max(64).optional(),
4550
+ referrer: z40.string().max(2048).optional(),
4551
+ clientVersion: z40.string().max(100).optional(),
4552
+ isInternal: z40.boolean().optional()
4492
4553
  });
4493
- var SessionDetailSchema = z39.object({
4554
+ var SessionDetailSchema = z40.object({
4494
4555
  session: SessionSummarySchema,
4495
4556
  capture: SessionCaptureSchema,
4496
4557
  /** Full verdict history, newest first. Verdicts are revisable, and a session
4497
4558
  * re-judged after a fix is the evidence the fix worked. */
4498
- reviews: z39.array(SessionReviewEventSchema),
4499
- bugs: z39.array(SessionBugSchema),
4500
- comments: z39.array(SessionCommentSchema),
4559
+ reviews: z40.array(SessionReviewEventSchema),
4560
+ bugs: z40.array(SessionBugSchema),
4561
+ comments: z40.array(SessionCommentSchema),
4501
4562
  /** Optional during API/console rolling deployment. Absent is unavailable,
4502
4563
  * not evidence of zero visitor activity. */
4503
4564
  activity: SessionActivitySchema.optional()
4504
4565
  });
4505
- var RecordVerdictInputSchema = z39.object({
4566
+ var RecordVerdictInputSchema = z40.object({
4506
4567
  verdict: RecordableVerdictSchema,
4507
- note: z39.string().max(2e3).optional()
4568
+ note: z40.string().max(2e3).optional()
4508
4569
  });
4509
- var FileBugInputSchema = z39.object({
4510
- turnIndex: z39.number().int().positive().nullable(),
4570
+ var FileBugInputSchema = z40.object({
4571
+ turnIndex: z40.number().int().positive().nullable(),
4511
4572
  /** Optional — a bug filed without dropping a pin has no location. */
4512
4573
  location: BugLocationSchema.nullable().optional(),
4513
- title: z39.string().min(1).max(300),
4514
- body: z39.string().min(1),
4574
+ title: z40.string().min(1).max(300),
4575
+ body: z40.string().min(1),
4515
4576
  severity: BugSeveritySchema,
4516
- payload: z39.record(z39.unknown())
4577
+ payload: z40.record(z40.unknown())
4517
4578
  });
4518
4579
 
4519
4580
  // ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
@@ -4698,7 +4759,7 @@ function stringifyForScoring(v) {
4698
4759
 
4699
4760
  // src/session/turn-attributed-session.ts
4700
4761
  var TURN_ATTRIBUTED_SIGNALS = /* @__PURE__ */ new Set([CART_ADD_SIGNAL]);
4701
- function withTurn(signal, turnId) {
4762
+ function withSignalTurn(signal, turnId) {
4702
4763
  if (!TURN_ATTRIBUTED_SIGNALS.has(signal.type) || "turnId" in signal.payload) return signal;
4703
4764
  return { ...signal, payload: { ...signal.payload, turnId } };
4704
4765
  }
@@ -4708,8 +4769,8 @@ function useTurnAttributedSession(session) {
4708
4769
  if (session === null || turnId === null) return session;
4709
4770
  return {
4710
4771
  ...session,
4711
- dispatchSignal: (signal) => session.dispatchSignal(withTurn(signal, turnId)),
4712
- dispatchSuggestionAction: (action) => session.dispatchSuggestionAction(withTurn(action, turnId))
4772
+ dispatchSignal: (signal) => session.dispatchSignal(withSignalTurn(signal, turnId)),
4773
+ dispatchSuggestionAction: (action) => session.dispatchSuggestionAction(withSignalTurn(action, turnId))
4713
4774
  };
4714
4775
  }, [session, turnId]);
4715
4776
  }
@@ -4832,60 +4893,60 @@ __export(src_exports2, {
4832
4893
  });
4833
4894
 
4834
4895
  // ../ecommerce/src/commerce-schemas.ts
4835
- import { z as z40 } from "zod";
4836
- var MoneySchema = z40.object({
4837
- amount: z40.number(),
4838
- currencyCode: z40.string()
4896
+ import { z as z41 } from "zod";
4897
+ var MoneySchema = z41.object({
4898
+ amount: z41.number(),
4899
+ currencyCode: z41.string()
4839
4900
  });
4840
- var ImageSchema = z40.object({
4841
- url: z40.string(),
4842
- altText: z40.string(),
4843
- width: z40.number().optional(),
4844
- height: z40.number().optional(),
4901
+ var ImageSchema = z41.object({
4902
+ url: z41.string(),
4903
+ altText: z41.string(),
4904
+ width: z41.number().optional(),
4905
+ height: z41.number().optional(),
4845
4906
  /** Responsive candidate set, resolved at the commerce-adapter boundary —
4846
4907
  * never computed in a component. Renderers use it as `<img srcSet>` paired
4847
4908
  * with a layout `sizes`. Absent for non-CDN / unsizable images. */
4848
- srcSet: z40.string().optional()
4909
+ srcSet: z41.string().optional()
4849
4910
  });
4850
- var AssetSchema = z40.object({
4911
+ var AssetSchema = z41.object({
4851
4912
  /** Opaque asset id — the `resolved()` ref the agent emitted. */
4852
- id: z40.string(),
4853
- url: z40.string(),
4854
- altText: z40.string(),
4855
- srcSet: z40.string().optional()
4913
+ id: z41.string(),
4914
+ url: z41.string(),
4915
+ altText: z41.string(),
4916
+ srcSet: z41.string().optional()
4856
4917
  });
4857
- var SelectedOptionSchema = z40.object({
4858
- name: z40.string(),
4859
- value: z40.string()
4918
+ var SelectedOptionSchema = z41.object({
4919
+ name: z41.string(),
4920
+ value: z41.string()
4860
4921
  });
4861
- var VideoSourceSchema = z40.object({
4862
- url: z40.string(),
4863
- mimeType: z40.string(),
4864
- width: z40.number().optional(),
4865
- height: z40.number().optional()
4922
+ var VideoSourceSchema = z41.object({
4923
+ url: z41.string(),
4924
+ mimeType: z41.string(),
4925
+ width: z41.number().optional(),
4926
+ height: z41.number().optional()
4866
4927
  });
4867
- var ProductVideoSchema = z40.object({
4868
- kind: z40.enum(["hosted", "external"]),
4928
+ var ProductVideoSchema = z41.object({
4929
+ kind: z41.enum(["hosted", "external"]),
4869
4930
  previewImage: ImageSchema.optional(),
4870
- altText: z40.string().default(""),
4931
+ altText: z41.string().default(""),
4871
4932
  /** `kind: 'hosted'` only — empty for external embeds. */
4872
- sources: z40.array(VideoSourceSchema).default([]),
4933
+ sources: z41.array(VideoSourceSchema).default([]),
4873
4934
  /** `kind: 'external'` only — iframe embed URL. */
4874
- embedUrl: z40.string().optional(),
4935
+ embedUrl: z41.string().optional(),
4875
4936
  /** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
4876
- host: z40.string().optional()
4937
+ host: z41.string().optional()
4877
4938
  });
4878
- var AvailabilityStatusSchema = z40.enum([
4939
+ var AvailabilityStatusSchema = z41.enum([
4879
4940
  "in_stock",
4880
4941
  "backorder",
4881
4942
  "preorder",
4882
4943
  "out_of_stock",
4883
4944
  "discontinued"
4884
4945
  ]);
4885
- var ProductVariantSchema = z40.object({
4886
- id: z40.string(),
4887
- title: z40.string(),
4888
- available: z40.boolean(),
4946
+ var ProductVariantSchema = z41.object({
4947
+ id: z41.string(),
4948
+ title: z41.string(),
4949
+ available: z41.boolean(),
4889
4950
  /**
4890
4951
  * Qualifies `available` with the fulfillment state behind it. Absent means
4891
4952
  * the backend did not say — which is NOT the same as in stock, and must not
@@ -4900,7 +4961,7 @@ var ProductVariantSchema = z40.object({
4900
4961
  availabilityStatus: AvailabilityStatusSchema.optional(),
4901
4962
  price: MoneySchema,
4902
4963
  compareAtPrice: MoneySchema.optional(),
4903
- selectedOptions: z40.array(SelectedOptionSchema).optional(),
4964
+ selectedOptions: z41.array(SelectedOptionSchema).optional(),
4904
4965
  image: ImageSchema.optional()
4905
4966
  });
4906
4967
  var MP4_MIME = "video/mp4";
@@ -4911,34 +4972,34 @@ function orderedVideoSources(video) {
4911
4972
  const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
4912
4973
  return [...mp4, ...hls];
4913
4974
  }
4914
- var SiblingProductSchema = z40.object({
4915
- id: z40.string(),
4916
- handle: z40.string(),
4917
- title: z40.string(),
4975
+ var SiblingProductSchema = z41.object({
4976
+ id: z41.string(),
4977
+ handle: z41.string(),
4978
+ title: z41.string(),
4918
4979
  /** The differentiating value across siblings — typically the color
4919
4980
  * label ("OLIVE", "STONE"). Rendered next to the swatch row. */
4920
- color: z40.string(),
4981
+ color: z41.string(),
4921
4982
  /** Swatch artwork. Hydrators populate from the sibling product's
4922
4983
  * first image; renderers crop / fit to the swatch tile. */
4923
4984
  swatchImage: ImageSchema.optional(),
4924
- available: z40.boolean().default(true),
4985
+ available: z41.boolean().default(true),
4925
4986
  /** Marks the sibling that IS the currently-rendered product. The
4926
4987
  * picker uses this to highlight the active swatch without an
4927
4988
  * external id comparison. */
4928
- current: z40.boolean().default(false)
4989
+ current: z41.boolean().default(false)
4929
4990
  });
4930
- var ProductSchema = z40.object({
4931
- id: z40.string(),
4932
- handle: z40.string().default(""),
4933
- title: z40.string(),
4934
- description: z40.string().default(""),
4935
- descriptionHtml: z40.string().optional(),
4936
- vendor: z40.string().default(""),
4937
- productType: z40.string().optional(),
4938
- tags: z40.array(z40.string()).default([]),
4991
+ var ProductSchema = z41.object({
4992
+ id: z41.string(),
4993
+ handle: z41.string().default(""),
4994
+ title: z41.string(),
4995
+ description: z41.string().default(""),
4996
+ descriptionHtml: z41.string().optional(),
4997
+ vendor: z41.string().default(""),
4998
+ productType: z41.string().optional(),
4999
+ tags: z41.array(z41.string()).default([]),
4939
5000
  price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
4940
5001
  compareAtPrice: MoneySchema.optional(),
4941
- images: z40.array(ImageSchema).default([]),
5002
+ images: z41.array(ImageSchema).default([]),
4942
5003
  /**
4943
5004
  * Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
4944
5005
  * catalog drops video media — it only surfaces through the Storefront
@@ -4946,21 +5007,21 @@ var ProductSchema = z40.object({
4946
5007
  * boundary. Default `[]` so renderers gate on `length > 0` without a
4947
5008
  * presence guard.
4948
5009
  */
4949
- videos: z40.array(ProductVideoSchema).default([]),
4950
- variants: z40.array(ProductVariantSchema).default([]),
4951
- availableForSale: z40.boolean().default(true),
4952
- options: z40.array(z40.object({
4953
- name: z40.string(),
4954
- values: z40.array(z40.string())
5010
+ videos: z41.array(ProductVideoSchema).default([]),
5011
+ variants: z41.array(ProductVariantSchema).default([]),
5012
+ availableForSale: z41.boolean().default(true),
5013
+ options: z41.array(z41.object({
5014
+ name: z41.string(),
5015
+ values: z41.array(z41.string())
4955
5016
  })).optional(),
4956
- collections: z40.array(z40.string()).optional(),
5017
+ collections: z41.array(z41.string()).optional(),
4957
5018
  /** See `SiblingProductSchema`. Default `[]` so renderers can check
4958
5019
  * `length > 1` to decide whether to draw the swatch row without a
4959
5020
  * presence guard. */
4960
- colorVariants: z40.array(SiblingProductSchema).default([]),
4961
- rating: z40.object({
4962
- value: z40.number(),
4963
- count: z40.number()
5021
+ colorVariants: z41.array(SiblingProductSchema).default([]),
5022
+ rating: z41.object({
5023
+ value: z41.number(),
5024
+ count: z41.number()
4964
5025
  }).optional(),
4965
5026
  /**
4966
5027
  * Product reviews surfaced from the brand's review store. SDK
@@ -4969,12 +5030,12 @@ var ProductSchema = z40.object({
4969
5030
  * review bodies. Renderers (`Reviews` component, `ProductDetail`,
4970
5031
  * etc.) consume directly.
4971
5032
  */
4972
- reviews: z40.array(z40.object({
4973
- author: z40.string(),
4974
- rating: z40.number(),
4975
- content: z40.string(),
4976
- date: z40.string(),
4977
- verified: z40.boolean().optional()
5033
+ reviews: z41.array(z41.object({
5034
+ author: z41.string(),
5035
+ rating: z41.number(),
5036
+ content: z41.string(),
5037
+ date: z41.string(),
5038
+ verified: z41.boolean().optional()
4978
5039
  })).optional(),
4979
5040
  /**
4980
5041
  * Ghost-entity flag — `true` when the Storefront API could not hydrate
@@ -4986,7 +5047,7 @@ var ProductSchema = z40.object({
4986
5047
  * Set exclusively by `createUnavailableProduct()` — never by the
4987
5048
  * Storefront mapper.
4988
5049
  */
4989
- unavailable: z40.boolean().default(false)
5050
+ unavailable: z41.boolean().default(false)
4990
5051
  });
4991
5052
  function createUnavailableProduct(gid) {
4992
5053
  return {
@@ -5008,68 +5069,68 @@ function createUnavailableProduct(gid) {
5008
5069
  function isGhostEntity(value) {
5009
5070
  return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
5010
5071
  }
5011
- var ReviewSchema = z40.object({
5012
- id: z40.string(),
5013
- productId: z40.string(),
5014
- author: z40.string(),
5015
- rating: z40.number(),
5016
- text: z40.string(),
5017
- date: z40.string(),
5018
- verified: z40.boolean()
5072
+ var ReviewSchema = z41.object({
5073
+ id: z41.string(),
5074
+ productId: z41.string(),
5075
+ author: z41.string(),
5076
+ rating: z41.number(),
5077
+ text: z41.string(),
5078
+ date: z41.string(),
5079
+ verified: z41.boolean()
5019
5080
  });
5020
- var ArticleSchema = z40.object({
5021
- id: z40.string(),
5022
- handle: z40.string().default(""),
5023
- title: z40.string(),
5024
- excerpt: z40.string().default(""),
5025
- content: z40.string().default(""),
5026
- contentHtml: z40.string().optional(),
5027
- author: z40.string().default(""),
5028
- publishedAt: z40.string().default(""),
5081
+ var ArticleSchema = z41.object({
5082
+ id: z41.string(),
5083
+ handle: z41.string().default(""),
5084
+ title: z41.string(),
5085
+ excerpt: z41.string().default(""),
5086
+ content: z41.string().default(""),
5087
+ contentHtml: z41.string().optional(),
5088
+ author: z41.string().default(""),
5089
+ publishedAt: z41.string().default(""),
5029
5090
  image: ImageSchema.optional(),
5030
- blogHandle: z40.string().default(""),
5031
- tags: z40.array(z40.string()).default([])
5091
+ blogHandle: z41.string().default(""),
5092
+ tags: z41.array(z41.string()).default([])
5032
5093
  });
5033
- var CmsPageSchema = z40.object({
5034
- id: z40.string(),
5035
- handle: z40.string().default(""),
5036
- title: z40.string(),
5037
- body: z40.string().default(""),
5038
- bodyHtml: z40.string().optional(),
5039
- bodySummary: z40.string().default(""),
5040
- updatedAt: z40.string().default(""),
5041
- seoTitle: z40.string().optional(),
5042
- seoDescription: z40.string().optional()
5094
+ var CmsPageSchema = z41.object({
5095
+ id: z41.string(),
5096
+ handle: z41.string().default(""),
5097
+ title: z41.string(),
5098
+ body: z41.string().default(""),
5099
+ bodyHtml: z41.string().optional(),
5100
+ bodySummary: z41.string().default(""),
5101
+ updatedAt: z41.string().default(""),
5102
+ seoTitle: z41.string().optional(),
5103
+ seoDescription: z41.string().optional()
5043
5104
  });
5044
- var CmsPolicySchema = z40.object({
5045
- id: z40.string(),
5105
+ var CmsPolicySchema = z41.object({
5106
+ id: z41.string(),
5046
5107
  /** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
5047
5108
  * 'shipping' | 'subscription' | 'warranty' | custom string. Open so
5048
5109
  * platforms with custom policy types can extend. */
5049
- kind: z40.string(),
5110
+ kind: z41.string(),
5050
5111
  /** Slug-shaped handle the platform exposes for storefront URLs
5051
5112
  * (e.g. `refund-policy`). Empty string when the backend doesn't
5052
5113
  * surface one. */
5053
- handle: z40.string().default(""),
5054
- title: z40.string(),
5055
- body: z40.string().default(""),
5056
- bodyHtml: z40.string().optional(),
5057
- url: z40.string().default("")
5114
+ handle: z41.string().default(""),
5115
+ title: z41.string(),
5116
+ body: z41.string().default(""),
5117
+ bodyHtml: z41.string().optional(),
5118
+ url: z41.string().default("")
5058
5119
  });
5059
- var CollectionSchema = z40.object({
5060
- id: z40.string(),
5061
- handle: z40.string().default(""),
5062
- title: z40.string(),
5063
- description: z40.string().default(""),
5120
+ var CollectionSchema = z41.object({
5121
+ id: z41.string(),
5122
+ handle: z41.string().default(""),
5123
+ title: z41.string(),
5124
+ description: z41.string().default(""),
5064
5125
  image: ImageSchema.optional(),
5065
- productCount: z40.number().int().nonnegative().optional()
5126
+ productCount: z41.number().int().nonnegative().optional()
5066
5127
  });
5067
- var CartLineSchema = z40.object({
5068
- id: z40.string(),
5069
- merchandiseId: z40.string(),
5070
- productId: z40.string(),
5071
- title: z40.string(),
5072
- variantTitle: z40.string().optional(),
5128
+ var CartLineSchema = z41.object({
5129
+ id: z41.string(),
5130
+ merchandiseId: z41.string(),
5131
+ productId: z41.string(),
5132
+ title: z41.string(),
5133
+ variantTitle: z41.string().optional(),
5073
5134
  /**
5074
5135
  * The variant's option axes as structured pairs (e.g.
5075
5136
  * `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
@@ -5078,10 +5139,10 @@ var CartLineSchema = z40.object({
5078
5139
  * single-variant products (the degenerate `Title: Default Title` axis
5079
5140
  * is normalized away at the adapter boundary).
5080
5141
  */
5081
- selectedOptions: z40.array(SelectedOptionSchema).optional(),
5082
- vendor: z40.string().optional(),
5083
- sku: z40.string().optional(),
5084
- quantity: z40.number().int().positive(),
5142
+ selectedOptions: z41.array(SelectedOptionSchema).optional(),
5143
+ vendor: z41.string().optional(),
5144
+ sku: z41.string().optional(),
5145
+ quantity: z41.number().int().positive(),
5085
5146
  unitPrice: MoneySchema,
5086
5147
  totalPrice: MoneySchema,
5087
5148
  image: ImageSchema.optional(),
@@ -5101,26 +5162,26 @@ var CartLineSchema = z40.object({
5101
5162
  * client-minted id the backend rejects, line-tap navigation is
5102
5163
  * suppressed, and the money never folds into a settled-looking total.
5103
5164
  */
5104
- pending: z40.boolean().optional()
5165
+ pending: z41.boolean().optional()
5105
5166
  });
5106
5167
  function isPendingCartLine(line) {
5107
5168
  return line.pending === true;
5108
5169
  }
5109
- var CartDiscountCodeSchema = z40.object({
5110
- code: z40.string(),
5111
- applicable: z40.boolean()
5170
+ var CartDiscountCodeSchema = z41.object({
5171
+ code: z41.string(),
5172
+ applicable: z41.boolean()
5112
5173
  });
5113
- var CartMessageSchema = z40.object({
5114
- kind: z40.enum(["error", "warning", "info"]),
5174
+ var CartMessageSchema = z41.object({
5175
+ kind: z41.enum(["error", "warning", "info"]),
5115
5176
  /** Machine code for branching; opaque and backend-defined. */
5116
- code: z40.string(),
5177
+ code: z41.string(),
5117
5178
  /** Human-readable text, meant to be shown as-is. */
5118
- content: z40.string()
5179
+ content: z41.string()
5119
5180
  });
5120
- var CartSchema = z40.object({
5121
- id: z40.string(),
5122
- lines: z40.array(CartLineSchema),
5123
- totalQuantity: z40.number().int().nonnegative(),
5181
+ var CartSchema = z41.object({
5182
+ id: z41.string(),
5183
+ lines: z41.array(CartLineSchema),
5184
+ totalQuantity: z41.number().int().nonnegative(),
5124
5185
  subtotal: MoneySchema,
5125
5186
  /**
5126
5187
  * Cart total after discounts (pre-shipping/tax). Absent when the
@@ -5130,11 +5191,11 @@ var CartSchema = z40.object({
5130
5191
  */
5131
5192
  total: MoneySchema.optional(),
5132
5193
  /** Discount codes currently attached to the cart. */
5133
- discountCodes: z40.array(CartDiscountCodeSchema).default([]),
5194
+ discountCodes: z41.array(CartDiscountCodeSchema).default([]),
5134
5195
  /** Notices the backend attached to this cart — see `CartMessageSchema`.
5135
5196
  * Empty when the backend said nothing or does not report them. */
5136
- messages: z40.array(CartMessageSchema).default([]),
5137
- checkoutUrl: z40.string().optional(),
5197
+ messages: z41.array(CartMessageSchema).default([]),
5198
+ checkoutUrl: z41.string().optional(),
5138
5199
  /**
5139
5200
  * Opaque handle this cart is known by in the connector's BACK OFFICE — the
5140
5201
  * value a space owner searches there to find the order this cart became.
@@ -5147,14 +5208,14 @@ var CartSchema = z40.object({
5147
5208
  * Absent when the platform has no such handle, or while the cart is still the
5148
5209
  * client's optimistic paint and its id is client-minted.
5149
5210
  */
5150
- backOfficeRef: z40.string().optional(),
5211
+ backOfficeRef: z41.string().optional(),
5151
5212
  /**
5152
5213
  * URL that recreates this cart on the merchant's own store website
5153
5214
  * (replace semantics — overwrites any cart the visitor already has
5154
5215
  * there). Populated by platform adapters that support it; absent when
5155
5216
  * the cart is empty or the URL cannot be built.
5156
5217
  */
5157
- storeCartUrl: z40.string().optional(),
5218
+ storeCartUrl: z41.string().optional(),
5158
5219
  /**
5159
5220
  * True while this cart exists only in the client's optimistic paint —
5160
5221
  * no backend cart has been created yet, so its `id` is client-minted and
@@ -5162,7 +5223,7 @@ var CartSchema = z40.object({
5162
5223
  * `CartLineSchema.pending`: the adapter never sets it, and callers that
5163
5224
  * need a real cart id read THIS rather than sniffing the id's shape.
5164
5225
  */
5165
- pending: z40.boolean().optional()
5226
+ pending: z41.boolean().optional()
5166
5227
  });
5167
5228
  function settledCart(cart) {
5168
5229
  if (cart === null || cart === void 0) return null;
@@ -5170,27 +5231,27 @@ function settledCart(cart) {
5170
5231
  }
5171
5232
 
5172
5233
  // ../ecommerce/src/review-schemas.ts
5173
- import { z as z41 } from "zod";
5234
+ import { z as z42 } from "zod";
5174
5235
  var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
5175
- var ProductReviewItemSchema = z41.object({
5176
- author: z41.string(),
5177
- rating: z41.number(),
5236
+ var ProductReviewItemSchema = z42.object({
5237
+ author: z42.string(),
5238
+ rating: z42.number(),
5178
5239
  /** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
5179
- title: z41.string().optional(),
5180
- content: z41.string(),
5181
- date: z41.string(),
5182
- verified: z41.boolean().optional(),
5240
+ title: z42.string().optional(),
5241
+ content: z42.string(),
5242
+ date: z42.string(),
5243
+ verified: z42.boolean().optional(),
5183
5244
  /**
5184
5245
  * Non-empty when the review was written for a grouped SIBLING product rather
5185
5246
  * than this one (brands pool reviews across a product line). A surface can
5186
5247
  * attribute it; empty / absent ⇒ the product's own review.
5187
5248
  */
5188
- writtenFor: z41.string().optional()
5249
+ writtenFor: z42.string().optional()
5189
5250
  });
5190
5251
  var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
5191
5252
  /** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
5192
5253
  * scored, NOT necessarily text that occurs in `content`. */
5193
- highlight: z41.string().optional(),
5254
+ highlight: z42.string().optional(),
5194
5255
  /**
5195
5256
  * `highlight` resolved back into `content` as a VERBATIM substring, so a
5196
5257
  * surface can mark it with a plain `indexOf` and no matcher of its own.
@@ -5205,29 +5266,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
5205
5266
  * Absent when the passage genuinely has no home in the body (one cut from the
5206
5267
  * title). A surface then marks NOTHING rather than guessing at a span.
5207
5268
  */
5208
- mark: z41.string().optional()
5269
+ mark: z42.string().optional()
5209
5270
  });
5210
- var ReviewAggregateSchema = z41.object({
5211
- value: z41.number(),
5212
- count: z41.number()
5271
+ var ReviewAggregateSchema = z42.object({
5272
+ value: z42.number(),
5273
+ count: z42.number()
5213
5274
  });
5214
- var ProductReviewDataSchema = z41.object({
5215
- id: z41.string(),
5275
+ var ProductReviewDataSchema = z42.object({
5276
+ id: z42.string(),
5216
5277
  /** The product's FULL retrieved set — what a filterable list renders. */
5217
- reviews: z41.array(ProductReviewItemSchema).default([]),
5278
+ reviews: z42.array(ProductReviewItemSchema).default([]),
5218
5279
  aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
5219
5280
  /** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
5220
- distribution: z41.array(z41.number()).default([]),
5281
+ distribution: z42.array(z42.number()).default([]),
5221
5282
  /**
5222
5283
  * The reviews that ANSWER the surface's intent, best first. Empty when no
5223
5284
  * intent was asked for — never a silent copy of `reviews`.
5224
5285
  */
5225
- highlights: z41.array(ProductReviewHighlightSchema).default([]),
5286
+ highlights: z42.array(ProductReviewHighlightSchema).default([]),
5226
5287
  /**
5227
5288
  * True when the review provider could not be read and nothing is indexed —
5228
5289
  * the empty lists mean "not loaded", NOT "this product has no reviews".
5229
5290
  */
5230
- unavailable: z41.boolean().optional()
5291
+ unavailable: z42.boolean().optional()
5231
5292
  });
5232
5293
  var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
5233
5294
 
@@ -5521,9 +5582,9 @@ function readPdpCompanions(config) {
5521
5582
  }
5522
5583
 
5523
5584
  // ../ecommerce/src/base-attributes.ts
5524
- import { z as z42 } from "zod";
5585
+ import { z as z43 } from "zod";
5525
5586
  var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
5526
- var BaseAttributesRecordSchema = z42.record(z42.string(), AttributeDefSchema);
5587
+ var BaseAttributesRecordSchema = z43.record(z43.string(), AttributeDefSchema);
5527
5588
  function buildBaseAttributesConfig(attributes) {
5528
5589
  return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
5529
5590
  }
@@ -5534,9 +5595,9 @@ function readBaseAttributesConfig(config) {
5534
5595
  }
5535
5596
 
5536
5597
  // ../ecommerce/src/bucket-labels.ts
5537
- import { z as z43 } from "zod";
5598
+ import { z as z44 } from "zod";
5538
5599
  var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
5539
- var BucketLabelsRecordSchema = z43.record(z43.string(), z43.string());
5600
+ var BucketLabelsRecordSchema = z44.record(z44.string(), z44.string());
5540
5601
  function buildBucketLabelsConfig(labels) {
5541
5602
  return { [BUCKET_LABELS_CONFIG_KEY]: labels };
5542
5603
  }
@@ -5607,6 +5668,7 @@ __export(shell_exports, {
5607
5668
  useComposerAttachments: () => useComposerAttachments,
5608
5669
  useComposerChipSelect: () => useComposerChipSelect,
5609
5670
  useConversationPage: () => useConversationPage,
5671
+ useConversationPresence: () => useConversationPresence,
5610
5672
  useDockPersistence: () => useDockPersistence,
5611
5673
  useDockState: () => useDockState,
5612
5674
  useExclusiveOverlay: () => useExclusiveOverlay,
@@ -6710,8 +6772,8 @@ var PRESENCE_LIFECYCLE = {
6710
6772
  };
6711
6773
 
6712
6774
  // ../spacestation/src/widgets/presence/profile.ts
6713
- import { z as z44 } from "zod";
6714
- var PresenceProfileSchema = z44.object({
6775
+ import { z as z45 } from "zod";
6776
+ var PresenceProfileSchema = z45.object({
6715
6777
  /**
6716
6778
  * How much the agent SPEAKS in presence.
6717
6779
  * - 'off' the faculty generates no prose at all. Zero tokens, and
@@ -6721,14 +6783,14 @@ var PresenceProfileSchema = z44.object({
6721
6783
  * - 'terse' one lead line per turn. The default — see below.
6722
6784
  * - 'full' a lead line plus asides beside individual elements.
6723
6785
  */
6724
- voice: z44.enum(["off", "terse", "full"]),
6786
+ voice: z45.enum(["off", "terse", "full"]),
6725
6787
  /**
6726
6788
  * Which source kinds this space surfaces. 'all' = every tool that declares a
6727
6789
  * `sourceKind`. An explicit list lets a space stay quiet about lookups its
6728
6790
  * visitors would find uninteresting (policy checks on a fashion space)
6729
6791
  * without the tool having to lie about what it is.
6730
6792
  */
6731
- sources: z44.union([z44.array(z44.string()), z44.literal("all")]),
6793
+ sources: z45.union([z45.array(z45.string()), z45.literal("all")]),
6732
6794
  /**
6733
6795
  * Which facts render.
6734
6796
  * - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
@@ -6737,7 +6799,7 @@ var PresenceProfileSchema = z44.object({
6737
6799
  * - 'all' shows stated facts too — for spaces where confirming the brief
6738
6800
  * back is itself the product (intake, configuration).
6739
6801
  */
6740
- facts: z44.enum(["inferred-only", "all"])
6802
+ facts: z45.enum(["inferred-only", "all"])
6741
6803
  });
6742
6804
  var DEFAULT_PRESENCE_PROFILE = {
6743
6805
  voice: "terse",
@@ -6776,37 +6838,46 @@ function usePresenceLiveTurn() {
6776
6838
  import { useSyncExternalStore as useSyncExternalStore2 } from "react";
6777
6839
 
6778
6840
  // src/utils/storage.ts
6779
- function createSessionStorageAdapter() {
6841
+ var opened = /* @__PURE__ */ new Map();
6842
+ function openWebStorage(kind) {
6843
+ const existing = opened.get(kind);
6844
+ if (existing !== void 0) return existing;
6845
+ let adapter;
6846
+ try {
6847
+ const storage3 = window[kind];
6848
+ adapter = {
6849
+ get: (key) => storage3.getItem(key),
6850
+ set: (key, value) => storage3.setItem(key, value),
6851
+ remove: (key) => storage3.removeItem(key)
6852
+ };
6853
+ } catch (err) {
6854
+ console.warn(`[fourty] ${kind} is blocked by the browser; keeping it in memory for this page:`, err);
6855
+ adapter = createMemoryStorageAdapter();
6856
+ }
6857
+ opened.set(kind, adapter);
6858
+ return adapter;
6859
+ }
6860
+ function createWebStorageAdapter(kind) {
6780
6861
  return {
6781
6862
  get(key) {
6782
6863
  if (typeof window === "undefined") return null;
6783
- return sessionStorage.getItem(key);
6864
+ return openWebStorage(kind).get(key);
6784
6865
  },
6785
6866
  set(key, value) {
6786
6867
  if (typeof window === "undefined") return;
6787
- sessionStorage.setItem(key, value);
6868
+ openWebStorage(kind).set(key, value);
6788
6869
  },
6789
6870
  remove(key) {
6790
6871
  if (typeof window === "undefined") return;
6791
- sessionStorage.removeItem(key);
6872
+ openWebStorage(kind).remove(key);
6792
6873
  }
6793
6874
  };
6794
6875
  }
6876
+ function createSessionStorageAdapter() {
6877
+ return createWebStorageAdapter("sessionStorage");
6878
+ }
6795
6879
  function createLocalStorageAdapter() {
6796
- return {
6797
- get(key) {
6798
- if (typeof window === "undefined") return null;
6799
- return localStorage.getItem(key);
6800
- },
6801
- set(key, value) {
6802
- if (typeof window === "undefined") return;
6803
- localStorage.setItem(key, value);
6804
- },
6805
- remove(key) {
6806
- if (typeof window === "undefined") return;
6807
- localStorage.removeItem(key);
6808
- }
6809
- };
6880
+ return createWebStorageAdapter("localStorage");
6810
6881
  }
6811
6882
  function createMemoryStorageAdapter() {
6812
6883
  const store = /* @__PURE__ */ new Map();
@@ -8667,22 +8738,23 @@ function buildComponentLibrary(catalog, componentMap) {
8667
8738
  }
8668
8739
 
8669
8740
  // src/catalog/define.ts
8670
- import { z as z45 } from "zod";
8741
+ import { z as z46 } from "zod";
8742
+ var HYDRATED_ENTITY = z46.object({}).passthrough();
8671
8743
  function entity(resolverKey, opts) {
8672
- return resolved(z45.string(), resolverKey, opts);
8744
+ return resolved(HYDRATED_ENTITY, resolverKey, opts);
8673
8745
  }
8674
- var text = prose(z45.string());
8746
+ var text = prose(z46.string());
8675
8747
  function plain() {
8676
- return z45.string();
8748
+ return z46.string();
8677
8749
  }
8678
8750
  function token(values) {
8679
- return z45.enum(values);
8751
+ return z46.enum(values);
8680
8752
  }
8681
8753
  function catalogComponent(meta, render) {
8682
8754
  const { props, requires, ...rest } = meta;
8683
8755
  return {
8684
8756
  ...rest,
8685
- propsSchema: z45.object(props),
8757
+ propsSchema: z46.object(props),
8686
8758
  ...requires !== void 0 ? { requires } : {},
8687
8759
  component: adaptComponent(render)
8688
8760
  };
@@ -10446,6 +10518,7 @@ __export(commerce_exports, {
10446
10518
  useCommerceActions: () => useCommerceActions,
10447
10519
  useCommerceRuntime: () => useCommerceRuntime,
10448
10520
  useComparisonHighlight: () => useComparisonHighlight,
10521
+ useCustomerAccount: () => useCustomerAccount,
10449
10522
  useLookCard: () => useLookCard,
10450
10523
  useOptionSelections: () => useOptionSelections,
10451
10524
  usePendingVariantChoice: () => usePendingVariantChoice,
@@ -10534,7 +10607,10 @@ var INERT_COMMERCE_RUNTIME = {
10534
10607
  highlights: [],
10535
10608
  isLoading: false,
10536
10609
  error: null
10537
- })
10610
+ }),
10611
+ useCustomerAccount: () => ({ signedIn: false, email: null, signIn: () => {
10612
+ }, signOut: async () => {
10613
+ }, available: false })
10538
10614
  };
10539
10615
  var FourtyCommerceRuntimeContext = createContext25(
10540
10616
  INERT_COMMERCE_RUNTIME
@@ -10564,6 +10640,9 @@ function useCollectionByHandle(handle) {
10564
10640
  function useProductReviews(product, intent) {
10565
10641
  return useCommerceRuntime().useProductReviews(product, intent);
10566
10642
  }
10643
+ function useCustomerAccount() {
10644
+ return useCommerceRuntime().useCustomerAccount();
10645
+ }
10567
10646
 
10568
10647
  // src/verticals/commerce/checkout/external-navigation.ts
10569
10648
  function navigateToExternalCommerceUrl(url) {
@@ -10577,8 +10656,8 @@ function navigateToExternalCommerceUrl(url) {
10577
10656
  isFramed = true;
10578
10657
  }
10579
10658
  if (isFramed) {
10580
- const opened = window.open(url, "_blank", "noopener,noreferrer");
10581
- if (opened === null) {
10659
+ const opened2 = window.open(url, "_blank", "noopener,noreferrer");
10660
+ if (opened2 === null) {
10582
10661
  console.warn("[navigateToExternalCommerceUrl] the browser blocked the new tab \u2014 the visitor did not leave", url);
10583
10662
  return "blocked";
10584
10663
  }
@@ -10718,18 +10797,18 @@ __export(ecommerce_exports, {
10718
10797
  });
10719
10798
 
10720
10799
  // ../spacestation/src/analytics/ecommerce/surfacing.ts
10721
- import { z as z46 } from "zod";
10800
+ import { z as z47 } from "zod";
10722
10801
  var PRODUCTS_SURFACED = defineEventKind(
10723
10802
  "commerce.products_surfaced",
10724
10803
  "client",
10725
- z46.object({
10804
+ z47.object({
10726
10805
  /** The turn whose commit this describes. Minted where the prompt signal
10727
10806
  * is built and shared with `agent_runs`, so the read layer can line a
10728
10807
  * surfacing up against the prompt that asked for it. */
10729
- turnId: z46.string().min(1).max(128),
10808
+ turnId: z47.string().min(1).max(128),
10730
10809
  /** Distinct entity refs this turn placed that were not on the canvas
10731
10810
  * before it. ZERO IS A REAL VALUE — see the header. */
10732
- productCount: z46.number().int().nonnegative()
10811
+ productCount: z47.number().int().nonnegative()
10733
10812
  }).strict()
10734
10813
  );
10735
10814
 
@@ -12229,7 +12308,7 @@ function useContentActions() {
12229
12308
  import { useEffect as useEffect19, useState as useState18 } from "react";
12230
12309
 
12231
12310
  // package.json
12232
- var version = "0.5.4";
12311
+ var version = "0.5.6";
12233
12312
 
12234
12313
  // src/host/host-modules.ts
12235
12314
  import * as react from "react";
@@ -12316,7 +12395,7 @@ function Spacefront(props) {
12316
12395
  }
12317
12396
 
12318
12397
  // src/npm.ts
12319
- import { z as z48 } from "zod";
12398
+ import { z as z49 } from "zod";
12320
12399
  export {
12321
12400
  ACQUISITION_KIND_LABELS,
12322
12401
  ACTIVE_PANEL_ATTR,
@@ -12445,9 +12524,12 @@ export {
12445
12524
  GENERATION_EASE,
12446
12525
  GenerationStyleContext,
12447
12526
  GenerationStyleProvider,
12527
+ HOST_CLEARED,
12448
12528
  HOST_MODULES,
12449
12529
  HOST_MODULE_SPECIFIERS,
12450
12530
  HandlerRegistryContext,
12531
+ HostClearedSchema,
12532
+ HostPayloadSchema,
12451
12533
  HydrationStateContext,
12452
12534
  HydratorProvider,
12453
12535
  INITIAL_NAV_PRESENTATION,
@@ -12472,6 +12554,7 @@ export {
12472
12554
  NavigatePayloadSchema,
12473
12555
  NullComponent,
12474
12556
  OLDEST_SUPPORTED_SDK,
12557
+ PAGELESS_HOST_PLACE,
12475
12558
  PRESENCE_CANVAS_REFRESH_SIGNAL,
12476
12559
  PRESENCE_FACT_DISMISS_SIGNAL,
12477
12560
  PRESENCE_FLOW,
@@ -12578,6 +12661,7 @@ export {
12578
12661
  VIEW_EXHAUSTED_SIGNAL,
12579
12662
  VIEW_EXTEND_SIGNAL,
12580
12663
  VIEW_FOCUS_ELEMENT_SIGNAL,
12664
+ VIEW_HOST_SIGNAL,
12581
12665
  VISITOR_ACCESS,
12582
12666
  VISITOR_CONTEXT_SIGNAL,
12583
12667
  VISITOR_ID_DURABILITIES,
@@ -12689,6 +12773,8 @@ export {
12689
12773
  getVisitorLocale,
12690
12774
  hapticCue,
12691
12775
  hasProse,
12776
+ hostFillsPage,
12777
+ hostPlace,
12692
12778
  hostingAllows,
12693
12779
  injectGoogleFonts,
12694
12780
  isActiveDirective,
@@ -12726,6 +12812,8 @@ export {
12726
12812
  openCartDrawerFocusedOn,
12727
12813
  orderedVideoSources,
12728
12814
  packRows,
12815
+ pageIdentityKey,
12816
+ pagePlace,
12729
12817
  parseBcp47Locale,
12730
12818
  parseReleasePreview,
12731
12819
  pickCartAddAction,
@@ -12879,9 +12967,11 @@ export {
12879
12967
  useContentActions,
12880
12968
  useConversationMessages,
12881
12969
  useConversationPage,
12970
+ useConversationPresence,
12882
12971
  useConversationState,
12883
12972
  useConversations,
12884
12973
  useCurrentMessageIndex,
12974
+ useCustomerAccount,
12885
12975
  useDebug,
12886
12976
  useDictation,
12887
12977
  useDismissedLabels,
@@ -12992,5 +13082,6 @@ export {
12992
13082
  wipeProfile,
12993
13083
  withCartActorOrigin,
12994
13084
  withInteractionTracking,
12995
- z48 as z
13085
+ withSignalTurn,
13086
+ z49 as z
12996
13087
  };