@40rty/ams-sdk 0.5.3 → 0.5.5

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