@40rty/ams-sdk 0.1.0

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.
Files changed (317) hide show
  1. package/dist/index.js +11918 -0
  2. package/dist/types/ecommerce/src/attribute-buckets.d.ts +79 -0
  3. package/dist/types/ecommerce/src/base-attributes.d.ts +42 -0
  4. package/dist/types/ecommerce/src/bucket-labels.d.ts +37 -0
  5. package/dist/types/ecommerce/src/cart-line-selections.d.ts +24 -0
  6. package/dist/types/ecommerce/src/commerce-schemas.d.ts +1813 -0
  7. package/dist/types/ecommerce/src/format-variant-value.d.ts +1 -0
  8. package/dist/types/ecommerce/src/index.d.ts +13 -0
  9. package/dist/types/ecommerce/src/locale.d.ts +31 -0
  10. package/dist/types/ecommerce/src/optimistic-cart-line.d.ts +38 -0
  11. package/dist/types/ecommerce/src/pdp-companions.d.ts +21 -0
  12. package/dist/types/ecommerce/src/pick-product-card-action.d.ts +38 -0
  13. package/dist/types/ecommerce/src/product-lookup.d.ts +34 -0
  14. package/dist/types/ecommerce/src/projection-spec.d.ts +38 -0
  15. package/dist/types/ecommerce/src/review-schemas.d.ts +425 -0
  16. package/dist/types/sdk/src/analytics/consent.d.ts +52 -0
  17. package/dist/types/sdk/src/analytics/drops.d.ts +98 -0
  18. package/dist/types/sdk/src/analytics/emitting-scope.d.ts +2 -0
  19. package/dist/types/sdk/src/analytics/index.d.ts +12 -0
  20. package/dist/types/sdk/src/analytics/inert-scope.d.ts +2 -0
  21. package/dist/types/sdk/src/analytics/notify.d.ts +41 -0
  22. package/dist/types/sdk/src/analytics/outbox.d.ts +118 -0
  23. package/dist/types/sdk/src/analytics/scope-context.d.ts +24 -0
  24. package/dist/types/sdk/src/analytics/scope.d.ts +149 -0
  25. package/dist/types/sdk/src/analytics/surface.d.ts +77 -0
  26. package/dist/types/sdk/src/analytics/transport.d.ts +91 -0
  27. package/dist/types/sdk/src/animation/index.d.ts +2 -0
  28. package/dist/types/sdk/src/animation/useListTransition.d.ts +16 -0
  29. package/dist/types/sdk/src/animation/useUpdateTransition.d.ts +16 -0
  30. package/dist/types/sdk/src/canvas/ElementIdContext.d.ts +13 -0
  31. package/dist/types/sdk/src/canvas/GenerationStyleContext.d.ts +13 -0
  32. package/dist/types/sdk/src/canvas/ShimmerSweep.d.ts +18 -0
  33. package/dist/types/sdk/src/canvas/TransitionContext.d.ts +52 -0
  34. package/dist/types/sdk/src/canvas/canvas-arrangement.d.ts +20 -0
  35. package/dist/types/sdk/src/canvas/canvas-motion-style.d.ts +18 -0
  36. package/dist/types/sdk/src/canvas/canvas-outlet.d.ts +14 -0
  37. package/dist/types/sdk/src/canvas/canvas-tail.d.ts +31 -0
  38. package/dist/types/sdk/src/canvas/dom-targets.d.ts +140 -0
  39. package/dist/types/sdk/src/canvas/generation-entrance.d.ts +26 -0
  40. package/dist/types/sdk/src/canvas/generation-style.d.ts +62 -0
  41. package/dist/types/sdk/src/canvas/index.d.ts +21 -0
  42. package/dist/types/sdk/src/canvas/item-motion/ItemTransitionGroup.d.ts +72 -0
  43. package/dist/types/sdk/src/canvas/item-motion/classify-items.d.ts +24 -0
  44. package/dist/types/sdk/src/canvas/item-motion/index.d.ts +5 -0
  45. package/dist/types/sdk/src/canvas/item-motion/plugins/wipe.d.ts +11 -0
  46. package/dist/types/sdk/src/canvas/item-motion/profile.d.ts +77 -0
  47. package/dist/types/sdk/src/canvas/item-motion/wipe.d.ts +57 -0
  48. package/dist/types/sdk/src/canvas/nav-direction.d.ts +22 -0
  49. package/dist/types/sdk/src/canvas/runtime-context.d.ts +15 -0
  50. package/dist/types/sdk/src/canvas/runtime-hooks.d.ts +106 -0
  51. package/dist/types/sdk/src/canvas/runtime-types.d.ts +183 -0
  52. package/dist/types/sdk/src/canvas/scroll-event-target.d.ts +21 -0
  53. package/dist/types/sdk/src/canvas/turn-change-anchor.d.ts +34 -0
  54. package/dist/types/sdk/src/canvas/turn-edit.d.ts +8 -0
  55. package/dist/types/sdk/src/canvas/use-canvas-actions.d.ts +41 -0
  56. package/dist/types/sdk/src/canvas/use-fourty-layout.d.ts +19 -0
  57. package/dist/types/sdk/src/catalog/CatalogContext.d.ts +7 -0
  58. package/dist/types/sdk/src/catalog/DebugContext.d.ts +5 -0
  59. package/dist/types/sdk/src/catalog/HydrationStateContext.d.ts +45 -0
  60. package/dist/types/sdk/src/catalog/HydratorContext.d.ts +7 -0
  61. package/dist/types/sdk/src/catalog/component-library.d.ts +32 -0
  62. package/dist/types/sdk/src/catalog/define.d.ts +149 -0
  63. package/dist/types/sdk/src/catalog/hydrator-registry.d.ts +91 -0
  64. package/dist/types/sdk/src/catalog/index.d.ts +14 -0
  65. package/dist/types/sdk/src/catalog/interaction-contract.d.ts +78 -0
  66. package/dist/types/sdk/src/catalog/normalize-components.d.ts +17 -0
  67. package/dist/types/sdk/src/catalog/prose-value.d.ts +22 -0
  68. package/dist/types/sdk/src/catalog/registration/index.d.ts +4 -0
  69. package/dist/types/sdk/src/catalog/registration/register-component.d.ts +35 -0
  70. package/dist/types/sdk/src/catalog/registration/registry.d.ts +27 -0
  71. package/dist/types/sdk/src/catalog/registration/types.d.ts +83 -0
  72. package/dist/types/sdk/src/catalog/registry.d.ts +22 -0
  73. package/dist/types/sdk/src/catalog/render-inline.d.ts +39 -0
  74. package/dist/types/sdk/src/catalog/resolve-hydrators.d.ts +27 -0
  75. package/dist/types/sdk/src/chat/chat-context.d.ts +40 -0
  76. package/dist/types/sdk/src/chat/index.d.ts +1 -0
  77. package/dist/types/sdk/src/client-state/index.d.ts +2 -0
  78. package/dist/types/sdk/src/client-state/server-store.d.ts +38 -0
  79. package/dist/types/sdk/src/client-state/store.d.ts +20 -0
  80. package/dist/types/sdk/src/commerce/commerce-context.d.ts +62 -0
  81. package/dist/types/sdk/src/commerce/commerce-shapes.d.ts +170 -0
  82. package/dist/types/sdk/src/commerce/ecommerce/agentic-overlay.d.ts +27 -0
  83. package/dist/types/sdk/src/commerce/ecommerce/buy-now-exit.d.ts +36 -0
  84. package/dist/types/sdk/src/commerce/ecommerce/cart-action-failures.d.ts +54 -0
  85. package/dist/types/sdk/src/commerce/ecommerce/cart-drawer-store.d.ts +18 -0
  86. package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-reasons.d.ts +54 -0
  87. package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-shape.d.ts +73 -0
  88. package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-store.d.ts +39 -0
  89. package/dist/types/sdk/src/commerce/ecommerce/comparison-rows.d.ts +30 -0
  90. package/dist/types/sdk/src/commerce/ecommerce/index.d.ts +21 -0
  91. package/dist/types/sdk/src/commerce/ecommerce/normalize-collection.d.ts +17 -0
  92. package/dist/types/sdk/src/commerce/ecommerce/preselect-from-facts.d.ts +25 -0
  93. package/dist/types/sdk/src/commerce/ecommerce/product-filters.d.ts +40 -0
  94. package/dist/types/sdk/src/commerce/ecommerce/use-buy-now.d.ts +33 -0
  95. package/dist/types/sdk/src/commerce/ecommerce/use-cart-drawer.d.ts +35 -0
  96. package/dist/types/sdk/src/commerce/ecommerce/use-cart-line-row.d.ts +30 -0
  97. package/dist/types/sdk/src/commerce/ecommerce/use-comparison-table.d.ts +22 -0
  98. package/dist/types/sdk/src/commerce/ecommerce/use-look-card.d.ts +80 -0
  99. package/dist/types/sdk/src/commerce/ecommerce/use-product-card.d.ts +62 -0
  100. package/dist/types/sdk/src/commerce/ecommerce/use-product-carousel-scroll.d.ts +13 -0
  101. package/dist/types/sdk/src/commerce/ecommerce/use-product-detail.d.ts +48 -0
  102. package/dist/types/sdk/src/commerce/ecommerce/use-product-grid-filter.d.ts +17 -0
  103. package/dist/types/sdk/src/commerce/ecommerce/use-selected-variants-state.d.ts +8 -0
  104. package/dist/types/sdk/src/commerce/ecommerce/use-wishlist-drawer.d.ts +34 -0
  105. package/dist/types/sdk/src/commerce/ecommerce/variant-option-axes.d.ts +56 -0
  106. package/dist/types/sdk/src/commerce/ecommerce/variant-resolution.d.ts +83 -0
  107. package/dist/types/sdk/src/commerce/ecommerce/variant-selection.d.ts +22 -0
  108. package/dist/types/sdk/src/commerce/external-navigation.d.ts +41 -0
  109. package/dist/types/sdk/src/commerce/index.d.ts +9 -0
  110. package/dist/types/sdk/src/commerce/option-selection-store.d.ts +8 -0
  111. package/dist/types/sdk/src/commerce/pending-variant-choice-store.d.ts +20 -0
  112. package/dist/types/sdk/src/commerce/variant-selection-store.d.ts +7 -0
  113. package/dist/types/sdk/src/content/index.d.ts +2 -0
  114. package/dist/types/sdk/src/content/use-faq-accordion.d.ts +11 -0
  115. package/dist/types/sdk/src/content/use-newsletter-form.d.ts +16 -0
  116. package/dist/types/sdk/src/host/Spacefront.d.ts +11 -0
  117. package/dist/types/sdk/src/host/engine-loader.d.ts +14 -0
  118. package/dist/types/sdk/src/host/host-modules.d.ts +5833 -0
  119. package/dist/types/sdk/src/host/index.d.ts +4 -0
  120. package/dist/types/sdk/src/host/types.d.ts +52 -0
  121. package/dist/types/sdk/src/index.d.ts +21 -0
  122. package/dist/types/sdk/src/interaction/haptics.d.ts +8 -0
  123. package/dist/types/sdk/src/interaction/index.d.ts +3 -0
  124. package/dist/types/sdk/src/interaction/normalize-signals.d.ts +8 -0
  125. package/dist/types/sdk/src/interaction/withInteractionTracking.d.ts +48 -0
  126. package/dist/types/sdk/src/npm.d.ts +3 -0
  127. package/dist/types/sdk/src/projection/ProjectionSignalBridge.d.ts +5 -0
  128. package/dist/types/sdk/src/projection/index.d.ts +1 -0
  129. package/dist/types/sdk/src/projection/preferences.d.ts +12 -0
  130. package/dist/types/sdk/src/projection/transform.d.ts +7 -0
  131. package/dist/types/sdk/src/provider/AgentAsk.d.ts +16 -0
  132. package/dist/types/sdk/src/provider/index.d.ts +4 -0
  133. package/dist/types/sdk/src/provider/providers/handler-registry.d.ts +11 -0
  134. package/dist/types/sdk/src/provider/use-clamp-toggle.d.ts +22 -0
  135. package/dist/types/sdk/src/provider/use-timed-flag.d.ts +16 -0
  136. package/dist/types/sdk/src/rendering/index.d.ts +1 -0
  137. package/dist/types/sdk/src/rendering/post-hydration.d.ts +37 -0
  138. package/dist/types/sdk/src/session/FourtySessionContext.d.ts +228 -0
  139. package/dist/types/sdk/src/session/clear-registry.d.ts +6 -0
  140. package/dist/types/sdk/src/session/index.d.ts +4 -0
  141. package/dist/types/sdk/src/session/use-action.d.ts +25 -0
  142. package/dist/types/sdk/src/session/visitor-locale.d.ts +2 -0
  143. package/dist/types/sdk/src/shared/index.d.ts +2 -0
  144. package/dist/types/sdk/src/shared/use-expandable.d.ts +9 -0
  145. package/dist/types/sdk/src/shared/use-image-hover.d.ts +13 -0
  146. package/dist/types/sdk/src/shell/ScrollContainerContext.d.ts +25 -0
  147. package/dist/types/sdk/src/shell/ShellRegistry.d.ts +25 -0
  148. package/dist/types/sdk/src/shell/ShellRootContext.d.ts +15 -0
  149. package/dist/types/sdk/src/shell/dock-persistence.d.ts +49 -0
  150. package/dist/types/sdk/src/shell/exclusive-overlay.d.ts +16 -0
  151. package/dist/types/sdk/src/shell/index.d.ts +12 -0
  152. package/dist/types/sdk/src/shell/thread-scroll/ThreadHeadroom.d.ts +11 -0
  153. package/dist/types/sdk/src/shell/thread-scroll/headroom.d.ts +4 -0
  154. package/dist/types/sdk/src/shell/thread-scroll/index.d.ts +6 -0
  155. package/dist/types/sdk/src/shell/thread-scroll/pin-turn-head.d.ts +12 -0
  156. package/dist/types/sdk/src/shell/thread-scroll/settle-thread-row.d.ts +23 -0
  157. package/dist/types/sdk/src/shell/thread-scroll/thread-geometry.d.ts +27 -0
  158. package/dist/types/sdk/src/shell/thread-scroll/thread-row-attr.d.ts +4 -0
  159. package/dist/types/sdk/src/shell/thread-scroll/use-pin-turn-to-top.d.ts +22 -0
  160. package/dist/types/sdk/src/shell/thread-scroll/use-scroll-has-more-below.d.ts +19 -0
  161. package/dist/types/sdk/src/shell/thread-scroll/use-thread-jump-marks.d.ts +28 -0
  162. package/dist/types/sdk/src/shell/thread-scroll/use-thread-landing.d.ts +1 -0
  163. package/dist/types/sdk/src/shell/use-composer-chip-select.d.ts +21 -0
  164. package/dist/types/sdk/src/shell/use-go-home.d.ts +11 -0
  165. package/dist/types/sdk/src/shell/use-hydrated.d.ts +19 -0
  166. package/dist/types/sdk/src/shell/use-menu-item-select.d.ts +13 -0
  167. package/dist/types/sdk/src/shell/use-overridable-toggle.d.ts +24 -0
  168. package/dist/types/sdk/src/shell/use-thread-rows.d.ts +41 -0
  169. package/dist/types/sdk/src/social/index.d.ts +2 -0
  170. package/dist/types/sdk/src/social/use-review-helpful.d.ts +10 -0
  171. package/dist/types/sdk/src/social/use-testimonials-carousel.d.ts +15 -0
  172. package/dist/types/sdk/src/utils/core-utils/format-distance.d.ts +6 -0
  173. package/dist/types/sdk/src/utils/core-utils/format-price.d.ts +7 -0
  174. package/dist/types/sdk/src/utils/core-utils/index.d.ts +10 -0
  175. package/dist/types/sdk/src/utils/core-utils/inject-google-fonts.d.ts +17 -0
  176. package/dist/types/sdk/src/utils/core-utils/is-on-sale.d.ts +6 -0
  177. package/dist/types/sdk/src/utils/core-utils/is-video-url.d.ts +6 -0
  178. package/dist/types/sdk/src/utils/core-utils/maps-directions-url.d.ts +5 -0
  179. package/dist/types/sdk/src/utils/core-utils/mint-id.d.ts +10 -0
  180. package/dist/types/sdk/src/utils/core-utils/resolve-swatch-color.d.ts +2 -0
  181. package/dist/types/sdk/src/utils/core-utils/validate-all.d.ts +13 -0
  182. package/dist/types/sdk/src/utils/index.d.ts +10 -0
  183. package/dist/types/sdk/src/utils/storage.d.ts +9 -0
  184. package/dist/types/sdk/src/utils/use-document-visible.d.ts +9 -0
  185. package/dist/types/sdk/src/utils/use-form-factor.d.ts +24 -0
  186. package/dist/types/sdk/src/utils/use-inline-completion.d.ts +48 -0
  187. package/dist/types/sdk/src/utils/use-interval.d.ts +7 -0
  188. package/dist/types/sdk/src/utils/use-success-flash.d.ts +35 -0
  189. package/dist/types/sdk/src/utils/use-wake-lock.d.ts +15 -0
  190. package/dist/types/sdk/src/utils/viewport-window.d.ts +39 -0
  191. package/dist/types/sdk/src/voice/index.d.ts +2 -0
  192. package/dist/types/sdk/src/voice/use-dictation.d.ts +80 -0
  193. package/dist/types/sdk/src/voice/use-voice-capture.d.ts +65 -0
  194. package/dist/types/sdk/src/widgets/presence/core-presence/fact-form-registry.d.ts +43 -0
  195. package/dist/types/sdk/src/widgets/presence/core-presence/fact-shape.d.ts +70 -0
  196. package/dist/types/sdk/src/widgets/presence/core-presence/form-registry.d.ts +28 -0
  197. package/dist/types/sdk/src/widgets/presence/core-presence/knowledge.d.ts +18 -0
  198. package/dist/types/sdk/src/widgets/presence/core-presence/presence-restore.d.ts +13 -0
  199. package/dist/types/sdk/src/widgets/presence/core-presence/presence-stream.d.ts +64 -0
  200. package/dist/types/sdk/src/widgets/presence/core-presence/source-form-registry.d.ts +129 -0
  201. package/dist/types/sdk/src/widgets/presence/core-presence/standing-signal-store.d.ts +19 -0
  202. package/dist/types/sdk/src/widgets/presence/flows/flow-store.d.ts +22 -0
  203. package/dist/types/sdk/src/widgets/presence/index.d.ts +17 -0
  204. package/dist/types/sdk/src/widgets/presence/runtime-context.d.ts +109 -0
  205. package/dist/types/sdk/src/widgets/presence/use-layout-entity-ids.d.ts +12 -0
  206. package/dist/types/sdk/src/widgets/presence/use-optimistic-facts.d.ts +43 -0
  207. package/dist/types/sdk/src/widgets/presence/use-optimistic-flow-set.d.ts +24 -0
  208. package/dist/types/sdk/src/widgets/presence/use-presence-notch.d.ts +75 -0
  209. package/dist/types/sdk/src/widgets/presence/use-presence.d.ts +45 -0
  210. package/dist/types/sdk/src/widgets/presence/use-standing-signal.d.ts +12 -0
  211. package/dist/types/spacestation/src/analytics/catalog.d.ts +89 -0
  212. package/dist/types/spacestation/src/analytics/ecommerce/events.d.ts +183 -0
  213. package/dist/types/spacestation/src/analytics/ecommerce/funnel.d.ts +22 -0
  214. package/dist/types/spacestation/src/analytics/ecommerce/index.d.ts +14 -0
  215. package/dist/types/spacestation/src/analytics/ecommerce/surfacing.d.ts +42 -0
  216. package/dist/types/spacestation/src/analytics/envelope.d.ts +222 -0
  217. package/dist/types/spacestation/src/analytics/index.d.ts +28 -0
  218. package/dist/types/spacestation/src/analytics/kind.d.ts +155 -0
  219. package/dist/types/spacestation/src/analytics/session.d.ts +35 -0
  220. package/dist/types/spacestation/src/attachment/attachment.d.ts +83 -0
  221. package/dist/types/spacestation/src/catalog/attribute-registry.d.ts +148 -0
  222. package/dist/types/spacestation/src/catalog/attribute-scope.d.ts +41 -0
  223. package/dist/types/spacestation/src/catalog/canvas-arrangement.d.ts +43 -0
  224. package/dist/types/spacestation/src/catalog/catalog-schemas.d.ts +264 -0
  225. package/dist/types/spacestation/src/catalog/config.d.ts +13 -0
  226. package/dist/types/spacestation/src/catalog/derive-props-doc.d.ts +11 -0
  227. package/dist/types/spacestation/src/catalog/element-filled.d.ts +77 -0
  228. package/dist/types/spacestation/src/catalog/entity-refs.d.ts +14 -0
  229. package/dist/types/spacestation/src/catalog/function-props.d.ts +23 -0
  230. package/dist/types/spacestation/src/catalog/hydration-paths.d.ts +19 -0
  231. package/dist/types/spacestation/src/catalog/prose.d.ts +60 -0
  232. package/dist/types/spacestation/src/catalog/ref-sites.d.ts +45 -0
  233. package/dist/types/spacestation/src/catalog/required-props.d.ts +31 -0
  234. package/dist/types/spacestation/src/catalog/resolved.d.ts +145 -0
  235. package/dist/types/spacestation/src/catalog/structural-baseline.d.ts +7 -0
  236. package/dist/types/spacestation/src/catalog/wire/catalog-wire.d.ts +191 -0
  237. package/dist/types/spacestation/src/catalog/wire/index.d.ts +5 -0
  238. package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +351 -0
  239. package/dist/types/spacestation/src/catalog/wire/schema-from-wire.d.ts +7 -0
  240. package/dist/types/spacestation/src/catalog/wire/schema-to-wire.d.ts +8 -0
  241. package/dist/types/spacestation/src/catalog/wire/wire-schema.d.ts +78 -0
  242. package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +125 -0
  243. package/dist/types/spacestation/src/commerce/cart-state.d.ts +87 -0
  244. package/dist/types/spacestation/src/commerce/cart-verb-signals.d.ts +80 -0
  245. package/dist/types/spacestation/src/commerce/page-kinds.d.ts +40 -0
  246. package/dist/types/spacestation/src/commerce/selection-signal.d.ts +25 -0
  247. package/dist/types/spacestation/src/contracts/entry-context.d.ts +35 -0
  248. package/dist/types/spacestation/src/contracts/knowledge/index.d.ts +12 -0
  249. package/dist/types/spacestation/src/contracts/knowledge/types.d.ts +238 -0
  250. package/dist/types/spacestation/src/contracts/retrieval/core/knowledge-source.d.ts +36 -0
  251. package/dist/types/spacestation/src/contracts/retrieval/core/platform-connector.d.ts +49 -0
  252. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/articles/source.d.ts +3 -0
  253. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/articles/types.d.ts +29 -0
  254. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/client.d.ts +238 -0
  255. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/collections/source.d.ts +3 -0
  256. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/collections/types.d.ts +23 -0
  257. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/connector.d.ts +11 -0
  258. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/domains.d.ts +27 -0
  259. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/faq/source.d.ts +3 -0
  260. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/faq/types.d.ts +21 -0
  261. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/option-values.d.ts +71 -0
  262. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/policies/source.d.ts +3 -0
  263. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/policies/types.d.ts +18 -0
  264. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/products/source.d.ts +5 -0
  265. package/dist/types/spacestation/src/contracts/retrieval/ecommerce/products/types.d.ts +47 -0
  266. package/dist/types/spacestation/src/contracts/retrieval/index.d.ts +25 -0
  267. package/dist/types/spacestation/src/contracts/session-arrival-params.d.ts +32 -0
  268. package/dist/types/spacestation/src/contracts/session-arrival.d.ts +215 -0
  269. package/dist/types/spacestation/src/contracts/tools/definitions.d.ts +139 -0
  270. package/dist/types/spacestation/src/contracts/tools/execution-context.d.ts +135 -0
  271. package/dist/types/spacestation/src/contracts/tools/index.d.ts +9 -0
  272. package/dist/types/spacestation/src/contracts/tools/types.d.ts +163 -0
  273. package/dist/types/spacestation/src/focus/focus.d.ts +12 -0
  274. package/dist/types/spacestation/src/hydration/hydration.d.ts +46 -0
  275. package/dist/types/spacestation/src/index.d.ts +71 -0
  276. package/dist/types/spacestation/src/layout/apply-patch.d.ts +17 -0
  277. package/dist/types/spacestation/src/layout/conversation.d.ts +136 -0
  278. package/dist/types/spacestation/src/layout/layout-diff.d.ts +17 -0
  279. package/dist/types/spacestation/src/layout/layout.d.ts +275 -0
  280. package/dist/types/spacestation/src/layout/page.d.ts +244 -0
  281. package/dist/types/spacestation/src/layout/patch.d.ts +92 -0
  282. package/dist/types/spacestation/src/layout/reduce-patch.d.ts +19 -0
  283. package/dist/types/spacestation/src/layout/reserved-ids.d.ts +13 -0
  284. package/dist/types/spacestation/src/projection/projection.d.ts +249 -0
  285. package/dist/types/spacestation/src/shell/shell.d.ts +109 -0
  286. package/dist/types/spacestation/src/signal/agent-signals.d.ts +539 -0
  287. package/dist/types/spacestation/src/space/connector.d.ts +61 -0
  288. package/dist/types/spacestation/src/space/generation-job.d.ts +4 -0
  289. package/dist/types/spacestation/src/space/hosting.d.ts +36 -0
  290. package/dist/types/spacestation/src/space/manifest.d.ts +8 -0
  291. package/dist/types/spacestation/src/space/package-version.d.ts +18 -0
  292. package/dist/types/spacestation/src/space/package.d.ts +35 -0
  293. package/dist/types/spacestation/src/space/prompt-config.d.ts +17 -0
  294. package/dist/types/spacestation/src/space/session-activity.d.ts +71 -0
  295. package/dist/types/spacestation/src/space/session-queue.d.ts +2147 -0
  296. package/dist/types/spacestation/src/space/space-config.d.ts +96 -0
  297. package/dist/types/spacestation/src/space/space-otp.d.ts +18 -0
  298. package/dist/types/spacestation/src/space/space.d.ts +104 -0
  299. package/dist/types/spacestation/src/space/tool-manifest.d.ts +8 -0
  300. package/dist/types/spacestation/src/space/trace.d.ts +555 -0
  301. package/dist/types/spacestation/src/space/workspace-catalog.d.ts +112 -0
  302. package/dist/types/spacestation/src/tool-compression/compress.d.ts +88 -0
  303. package/dist/types/spacestation/src/tool-compression/index.d.ts +11 -0
  304. package/dist/types/spacestation/src/tool-compression/scoring.d.ts +38 -0
  305. package/dist/types/spacestation/src/tool-compression/tokenize.d.ts +29 -0
  306. package/dist/types/spacestation/src/trace/trace-data.d.ts +126 -0
  307. package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +224 -0
  308. package/dist/types/spacestation/src/trace/trace-envelopes.d.ts +144 -0
  309. package/dist/types/spacestation/src/trace/trace-events.d.ts +450 -0
  310. package/dist/types/spacestation/src/types.d.ts +253 -0
  311. package/dist/types/spacestation/src/view/continuation.d.ts +45 -0
  312. package/dist/types/spacestation/src/widgets/presence/element.d.ts +241 -0
  313. package/dist/types/spacestation/src/widgets/presence/frame.d.ts +56 -0
  314. package/dist/types/spacestation/src/widgets/presence/index.d.ts +4 -0
  315. package/dist/types/spacestation/src/widgets/presence/profile.d.ts +75 -0
  316. package/dist/types/spacestation/src/widgets/presence/scan.d.ts +45 -0
  317. package/package.json +43 -0
@@ -0,0 +1,73 @@
1
+ /**
2
+ * WHAT a checkout handoff state IS — the two actor/outcome unions and the shape
3
+ * the store holds.
4
+ *
5
+ * Split from the store itself because they change for different reasons: the
6
+ * VOCABULARY moves when the wire contract does (both unions are derived from
7
+ * `@fourty/spacestation/analytics/ecommerce`, so the agent's store and the
8
+ * merchant's rows cannot describe the same exit differently), while the STORE
9
+ * moves when the handoff mechanics do. The 300-line ceiling is enforced for
10
+ * this package.
11
+ *
12
+ * Every name here is re-exported from `./checkout-handoff-store`, which is the
13
+ * path the rest of the repo already imports.
14
+ */
15
+ import type { CheckoutOrigin, CheckoutOutcome, CheckoutRefusal } from '../../../../spacestation/src/analytics/ecommerce/index';
16
+ /**
17
+ * Where the checkout handoff stands. `armed` is the only non-terminal value;
18
+ * the rest are the settled verdict of one attempt.
19
+ *
20
+ * - `armed` — the agent's exit is committed and fires when the turn lands.
21
+ * - `redirected` — this tab is leaving for the store's checkout page.
22
+ * - `new-tab` — checkout opened in a new tab (embedded contexts, where
23
+ * Shopify's `frame-ancestors 'none'` blanks an iframe).
24
+ * - `blocked` — the browser refused the tab; they did NOT reach checkout,
25
+ * and the open drawer's CTA is the way through.
26
+ * - `no-url` — no checkout url on the cart by the time it fired.
27
+ * - `unavailable` — refused before arming (nothing to check out).
28
+ */
29
+ export type CheckoutHandoffOutcome = CheckoutOutcome;
30
+ /** Who took (or was refused) this exit. Load-bearing for the agent's action
31
+ * confirmation: the visitor tapping Checkout is not evidence that the AGENT's
32
+ * dispatch did anything, and confirming one with the other is how a verb that
33
+ * went nowhere comes back `done`.
34
+ *
35
+ * Deliberately NOT `CartOrigin`: a WebMCP-driven arm books as `agent` here,
36
+ * because the arm is performed by the agent's own handoff path. The two unions
37
+ * do not line up, they are not made to, and the metric dictionary carries that
38
+ * as a row. */
39
+ export type CheckoutHandoffOrigin = CheckoutOrigin;
40
+ export interface CheckoutHandoffState {
41
+ /** The armed exit url — non-null only between the agent arming and the
42
+ * bridge firing. The visitor's path never arms; it navigates outright. */
43
+ url: string | null;
44
+ outcome: CheckoutHandoffOutcome | null;
45
+ origin: CheckoutHandoffOrigin | null;
46
+ /** Agent/human-readable WHY for an outcome that did not carry them through. */
47
+ reason: string | null;
48
+ /**
49
+ * WHICH refusal an `unavailable` outcome was — a MACHINE discriminator, so no
50
+ * reader ever has to exact-match one of the prose sentences below.
51
+ *
52
+ * Three different things land on `unavailable` and the third is not a checkout
53
+ * attempt at all: the visitor CANCELLED THE TURN before the armed exit fired.
54
+ * Counting that as an attempt understates the reach rate of every checkout the
55
+ * agent actually offered, and the only way to tell it apart from the two real
56
+ * refusals used to be comparing `reason` against a string constant.
57
+ *
58
+ * `null` on every non-`unavailable` outcome, explicitly — so "no refusal" is
59
+ * an assertion rather than an omission.
60
+ */
61
+ refusal: CheckoutRefusal | null;
62
+ /**
63
+ * Which checkout attempt this outcome belongs to — 1 for the first, up from
64
+ * there. Published, and load-bearing: the client-state store dedupes by
65
+ * serialized payload while an in-turn confirmation waits for a FRESH
66
+ * snapshot, so two attempts landing on the SAME outcome (asking to check out
67
+ * twice with an empty cart) would otherwise produce one snapshot and the
68
+ * second confirm would time out into `pending` instead of reporting the
69
+ * refusal. A counter, not a timestamp: nothing here needs wall-clock
70
+ * recency, and a counter is deterministic under test.
71
+ */
72
+ attempt: number;
73
+ }
@@ -0,0 +1,39 @@
1
+ import { type CheckoutRefusal } from '../../../../spacestation/src/analytics/ecommerce/index';
2
+ export type { CheckoutHandoffOrigin, CheckoutHandoffOutcome, CheckoutHandoffState, } from './checkout-handoff-shape';
3
+ import type { CheckoutHandoffState } from './checkout-handoff-shape';
4
+ import type { AnalyticsSink } from '../../analytics';
5
+ import type { ExternalNavigationResult } from '../external-navigation';
6
+ /** AGENT: commit the exit. Fires when the turn's response lands, not now. */
7
+ export declare function armCheckoutHandoff(analytics: AnalyticsSink | null, url: string): void;
8
+ /**
9
+ * AGENT: refuse the exit before arming.
10
+ *
11
+ * Takes the DISCRIMINATOR and derives the prose, rather than the other way
12
+ * round: the sentence the agent narrates and the value a query filters on must
13
+ * not be able to disagree, and a caller that passed a hand-written string could
14
+ * make them.
15
+ */
16
+ export declare function refuseCheckoutHandoff(analytics: AnalyticsSink | null, refusal: CheckoutRefusal): void;
17
+ /** Take the armed url, clearing it so the exit can only ever fire once.
18
+ * Returns null when nothing is armed. */
19
+ export declare function consumeArmedCheckoutHandoff(): string | null;
20
+ /**
21
+ * Drop an armed exit without taking it — the turn that armed it never landed.
22
+ *
23
+ * Always `cancelled-turn`, which is why it takes no discriminator: the visitor
24
+ * abandoned the turn before the exit fired, so this is not a checkout attempt
25
+ * at all and metric #9 excludes it from the attempt count entirely.
26
+ */
27
+ export declare function disarmCheckoutHandoff(analytics: AnalyticsSink | null): void;
28
+ /** AGENT: record what the armed exit actually did. Stays on the SAME attempt
29
+ * number — arming and settling are two states of one attempt, not two. */
30
+ export declare function settleArmedCheckoutHandoff(analytics: AnalyticsSink | null, outcome: ExternalNavigationResult): void;
31
+ /** VISITOR: record the exit they took themself (the drawer's Checkout CTA).
32
+ * A fresh attempt — it is their action, not the settling of the agent's. */
33
+ export declare function recordVisitorCheckoutExit(analytics: AnalyticsSink | null, outcome: ExternalNavigationResult): void;
34
+ /** The current handoff state. The plain read; `useCheckoutHandoff` is its
35
+ * React binding. */
36
+ export declare function readCheckoutHandoff(): CheckoutHandoffState;
37
+ /** React hook — the current handoff state. */
38
+ export declare function useCheckoutHandoff(): CheckoutHandoffState;
39
+ export { CHECKOUT_BLOCKED_REASON, CHECKOUT_NO_URL_REASON, CHECKOUT_EMPTY_CART_REASON, CHECKOUT_NO_LINK_REASON, CHECKOUT_CANCELLED_REASON, checkoutHandoffReasonFor, } from './checkout-handoff-reasons';
@@ -0,0 +1,30 @@
1
+ import type { Product } from '../../../../ecommerce/src/index';
2
+ export interface ComparisonAttributeRow {
3
+ /** Stable id for React keying. Use the attribute slug. */
4
+ id: string;
5
+ /** Display label rendered in the leftmost column. */
6
+ label: string;
7
+ /** Per-product values keyed by `Product.id`. */
8
+ values: Record<string, string | number | boolean>;
9
+ }
10
+ /**
11
+ * Structured comparison floor — the SAFETY NET, not the headline. It carries
12
+ * only the axes that are genuinely decision-relevant AND need no agent
13
+ * judgment: price, sale, rating. (Colorway/size COUNTS were removed — "comes
14
+ * in 9 colors vs 2" is trivia, not a decision input, and rendered as a bar it
15
+ * reads as a dumb spec sheet.) The agentic comparison lives in the agent's
16
+ * `verdict` + adjudicated `attributeRows`; this floor only guarantees the
17
+ * surface is never empty when the agent under-fills. The renderer drops any
18
+ * row identical down every column.
19
+ *
20
+ * Single source of truth: brand `<ComparisonTable>`s consume this and merge
21
+ * the agent's judgment rows on top; the per-row math lives in one place.
22
+ */
23
+ export declare function buildComparisonRows(products: ReadonlyArray<Product>): ComparisonAttributeRow[];
24
+ /**
25
+ * Defensive price formatter — returns an em-dash for half-hydrated
26
+ * products whose `.price` hasn't materialised yet. Exported so brand
27
+ * headers (e.g. the product-column header in a comparison table) can
28
+ * format the same way without re-rolling the guard.
29
+ */
30
+ export declare function formatProductPrice(p: Product): string;
@@ -0,0 +1,21 @@
1
+ export { useProductGridFilter } from './use-product-grid-filter';
2
+ export { pickProductCardAction, pickCartAddAction } from '../../../../ecommerce/src/index';
3
+ export { isPendingCartLine, settledCart } from '../../../../ecommerce/src/index';
4
+ export { useProductCarouselScroll } from './use-product-carousel-scroll';
5
+ export { useProductDetail, type ProductDetailVariantGroup, } from './use-product-detail';
6
+ export { classifyComparisonValue, useComparisonHighlight, type ComparisonCellRender, } from './use-comparison-table';
7
+ export { useCartDrawer } from './use-cart-drawer';
8
+ export { recordCartActionFailure, readCartActionFailures, clearCartActionFailures, useCartActionFailures, useCartActionFailuresFor, type CartActionFailure, type CartActionSubject, } from './cart-action-failures';
9
+ export { useCartLineRow, type CartLineRowState, type CartLineInteraction, } from './use-cart-line-row';
10
+ export { openCartDrawer, openCartDrawerFocusedOn, closeCartDrawer, toggleCartDrawer, useCartDrawerOpen, useCartDrawerFocus, type CartDrawerFocus, } from './cart-drawer-store';
11
+ export { armCheckoutHandoff, refuseCheckoutHandoff, consumeArmedCheckoutHandoff, disarmCheckoutHandoff, settleArmedCheckoutHandoff, recordVisitorCheckoutExit, readCheckoutHandoff, useCheckoutHandoff, checkoutHandoffReasonFor, CHECKOUT_BLOCKED_REASON, CHECKOUT_NO_URL_REASON, CHECKOUT_EMPTY_CART_REASON, CHECKOUT_NO_LINK_REASON, type CheckoutHandoffOutcome, type CheckoutHandoffOrigin, type CheckoutHandoffState, } from './checkout-handoff-store';
12
+ export { useWishlistDrawer } from './use-wishlist-drawer';
13
+ export { useProductCard, type ProductCardData, type ProductCardBadge, } from './use-product-card';
14
+ export { useLookCard, type LookCardData, type LookCardTile } from './use-look-card';
15
+ export { resolveProductVariant, variantForSelections, type VariantResolution, type VariantGap, type UnavailableSelection, type VariantOptionChoice, type VariantOptionValue, } from './variant-resolution';
16
+ export { canonicalOptionValue } from '../../../../spacestation/src/index';
17
+ export { preselectFromFacts } from './preselect-from-facts';
18
+ export { matchesProductFilter, pruneFilterChips, type ProductFilterChip, type ProductFilterPredicate, } from './product-filters';
19
+ export { normalizeCollectionLegacy, pickCollectionAction } from './normalize-collection';
20
+ export { computeActiveChips, collectLayoutGids } from './agentic-overlay';
21
+ export { buildComparisonRows, formatProductPrice, type ComparisonAttributeRow, } from './comparison-rows';
@@ -0,0 +1,17 @@
1
+ import type { Collection } from '../../../../ecommerce/src/index';
2
+ import { type SuggestionActionInput } from '../../../../spacestation/src/index';
3
+ /**
4
+ * Adapt either the canonical {handle, title, …} Collection shape OR the
5
+ * legacy {slug, name, imageSrc, productCount} shape to a Collection.
6
+ * Legacy shape lingered in cached sessions / restored DB rows after the
7
+ * ref-array migration; brands consumed both. Centralising the
8
+ * normalization means a single drop point when the legacy TTL expires.
9
+ */
10
+ export declare function normalizeCollectionLegacy(input: unknown): Collection | null;
11
+ /**
12
+ * Default `navigate` action for a collection tile click — a
13
+ * `{kind:'collection'}` destination keyed by the collection handle.
14
+ * Brands may pass an explicit override (e.g. promo collections that
15
+ * route via a different signal); falls back to the canonical action.
16
+ */
17
+ export declare function pickCollectionAction(collection: Collection, override: SuggestionActionInput | undefined): SuggestionActionInput;
@@ -0,0 +1,25 @@
1
+ import type { Product } from '../../../../ecommerce/src/index';
2
+ /**
3
+ * Pre-select variant axes from (a) forced single-value choices and
4
+ * (b) the visitor's known facts.
5
+ *
6
+ * Forced choices — an axis whose `values` has exactly one entry —
7
+ * are auto-selected unconditionally. They are not a real pick (the
8
+ * product simply only comes in that color / size), and the picker
9
+ * row is hidden at render. Auto-selecting keeps `allSelected` and
10
+ * `findVariant` working without the visitor staring at a redundant
11
+ * "WHITE · WHITE" chip with nothing to choose.
12
+ *
13
+ * Each remaining axis (e.g. `Size`, `Color`) is resolved via
14
+ * `lookupBucketedFact` — the canonical bucket-scoped probe shared
15
+ * with the agent writer + the UI ProductDetail reader. It walks the
16
+ * fact map in priority order (typed scoped key → extras-prefixed
17
+ * scoped key → unknown-bucket fallback → extras-prefixed unknown),
18
+ * so size carry-over works across the auto-build registry's
19
+ * pre-graduation window without leaking shoe sizes onto handbags.
20
+ *
21
+ * Axes without a matching fact (or facts whose value doesn't exist
22
+ * on this product) are omitted so the visitor still picks them
23
+ * manually.
24
+ */
25
+ export declare function preselectFromFacts(product: Product, facts: Record<string, unknown>): Record<string, string>;
@@ -0,0 +1,40 @@
1
+ import type { Product } from '../../../../ecommerce/src/index';
2
+ /**
3
+ * Agent-supplied filter chip. Wire shape mirrors the canonical
4
+ * `productGridProps.filters` schema in `@fourty/ui/catalog-data`. The
5
+ * agent decides chip semantics per turn; the SDK runs the match against
6
+ * each product.
7
+ */
8
+ export interface ProductFilterChip {
9
+ label: string;
10
+ match: ProductFilterPredicate;
11
+ }
12
+ export interface ProductFilterPredicate {
13
+ /** Substring match against any product tag, case-insensitive. */
14
+ tag?: string;
15
+ /** Substring match against product.productType, case-insensitive. */
16
+ productType?: string;
17
+ /** Exact match against product.vendor, case-insensitive. */
18
+ vendor?: string;
19
+ /** Product price ≤ this value (major currency units). */
20
+ priceMax?: number;
21
+ /** Product price ≥ this value (major currency units). */
22
+ priceMin?: number;
23
+ /** True → product has compareAtPrice > price OR a "sale" tag. */
24
+ saleOnly?: boolean;
25
+ }
26
+ /**
27
+ * Match a product against a predicate. Empty predicate (`{}`) matches
28
+ * everything — used for the "All" chip. Fields AND-combine.
29
+ */
30
+ export declare function matchesProductFilter(product: Product, match: ProductFilterPredicate): boolean;
31
+ /**
32
+ * Validate agent-supplied chips against the visible product set. Drop
33
+ * chips that match zero products or match every product — both are
34
+ * useless noise the visitor can't act on. Return the cleaned chip set
35
+ * plus a visibility flag the grid uses to gate the chip row.
36
+ */
37
+ export declare function pruneFilterChips(products: ReadonlyArray<Product>, chips: ReadonlyArray<ProductFilterChip>): {
38
+ chips: ProductFilterChip[];
39
+ visible: boolean;
40
+ };
@@ -0,0 +1,33 @@
1
+ export interface BuyNow {
2
+ /** Add the variant and arm the exit. A second call while one is in flight is
3
+ * ignored — see below. */
4
+ readonly start: (variantId: string) => void;
5
+ /** True between the tap and the exit. Surfaces are expected to DISABLE on
6
+ * this rather than keep a second copy of the in-flight state. */
7
+ readonly pending: boolean;
8
+ }
9
+ /**
10
+ * "Buy it now" — add, wait for the line to settle, then leave for checkout.
11
+ *
12
+ * ── WHY THIS IS NOT AN ADD PLUS A NAVIGATE ─────────────────────────────────
13
+ *
14
+ * The add is a SIGNAL, not an awaitable write: the caller's `addToCart` hands
15
+ * it to the commerce handlers and returns immediately. Navigating on the next
16
+ * line takes the visitor to a checkout that does not contain the thing they
17
+ * just bought — and worse, it does so ONLY for a visitor whose cart was already
18
+ * non-empty (an empty cart has no `checkoutUrl` yet, so the naive version fails
19
+ * closed for first-time buyers and silently wrong for returning ones). That
20
+ * asymmetry is why this waits for the LINE and not merely for a cart, and why
21
+ * `resolveBuyNowExit` is a tested function rather than a condition inline here.
22
+ *
23
+ * ── THE ANALYTICS FALL OUT OF USING THE REAL PATHS ─────────────────────────
24
+ *
25
+ * Nothing here emits an event of its own. The add goes through the caller's
26
+ * ordinary add path, so `commerce.cart_line_added` is emitted by the cart
27
+ * mutation exactly as it is for a plain add; the exit goes through
28
+ * `recordVisitorCheckoutExit`, the same call the cart drawer's Checkout button
29
+ * makes, so `commerce.checkout_clicked` carries `origin: 'visitor'` and the
30
+ * real `outcome`. A bespoke emit here would be a second definition of both
31
+ * events, free to drift from the two that already exist.
32
+ */
33
+ export declare function useBuyNow(addToCart: () => void): BuyNow;
@@ -0,0 +1,35 @@
1
+ import type { Cart } from '../../../../ecommerce/src/index';
2
+ /**
3
+ * The SECOND declared visitor checkout exit used to live here — `checkout()`,
4
+ * calling `recordVisitorCheckoutExit` — and it had ZERO callers: every brand
5
+ * shell wires its drawer through `@fourty/ui`'s `useCartView`, which owns the
6
+ * real exit. It is deleted rather than instrumented. Two declared exits with
7
+ * one wired is how a metric quietly halves later: the next reader instruments
8
+ * whichever they find first, and half the visitors vanish from the number with
9
+ * nothing anywhere saying so.
10
+ *
11
+ * useCartDrawer — open/close state + the live cart shape from the
12
+ * commerce provider. Returns null `cart` (and a no-op closer) when no
13
+ * commerce provider is mounted, so a brand shell can mount the drawer
14
+ * unconditionally without crashing in story sandboxes.
15
+ *
16
+ * const drawer = useCartDrawer();
17
+ * <button onClick={drawer.open}>Bag {drawer.totalQuantity}</button>
18
+ * {drawer.isOpen && <BrandDrawer cart={drawer.cart} ... />}
19
+ */
20
+ export declare function useCartDrawer(): {
21
+ isOpen: boolean;
22
+ open: () => void;
23
+ close: () => void;
24
+ toggle: () => void;
25
+ cart: Cart | null;
26
+ totalQuantity: number;
27
+ updateLine: (lineId: string, quantity: number) => Promise<unknown> | void;
28
+ removeLine: (lineId: string) => Promise<unknown> | void;
29
+ /** Apply a promo code — backend-validated; see CartApi.applyDiscountCode. */
30
+ applyDiscountCode: (code: string) => Promise<unknown> | void;
31
+ /** Remove an applied promo code. */
32
+ removeDiscountCode: (code: string) => Promise<unknown> | void;
33
+ /** True while a promo apply/remove round-trip is in flight. */
34
+ isDiscountPending: boolean;
35
+ };
@@ -0,0 +1,30 @@
1
+ import * as React from 'react';
2
+ import { type CartLine } from '../../../../ecommerce/src/index';
3
+ export interface CartLineInteraction {
4
+ onClick: () => void;
5
+ onKeyDown: (event: React.KeyboardEvent<HTMLElement>) => void;
6
+ role: 'button';
7
+ tabIndex: 0;
8
+ }
9
+ export interface CartLineRowState {
10
+ /** The backend has not accepted this line yet. Drives the pending row
11
+ * treatment and disables every quantity control. */
12
+ pending: boolean;
13
+ /** Spread onto the row container — `undefined` when the row must not be
14
+ * interactive (pending line, or no canvas seam mounted). */
15
+ interaction: CartLineInteraction | undefined;
16
+ /**
17
+ * Non-null when a cart write just targeted this line, carrying the write's
18
+ * timestamp. Use it as a React `key` so each write plays exactly one
19
+ * animation; the row stays mounted afterwards.
20
+ */
21
+ spotlightKey: number | null;
22
+ /** Attach to the row element. The hook scrolls it into view when a write
23
+ * targets it, so a spotlighted row below the fold is actually seen. */
24
+ rowRef: React.RefObject<HTMLDivElement | null>;
25
+ }
26
+ export declare function useCartLineRow(line: CartLine, opts?: {
27
+ /** Called after navigation is dispatched — drawers close here so the
28
+ * resolved productDetail view is visible. */
29
+ onNavigated?: () => void;
30
+ }): CartLineRowState;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Pure helper — categorizes a comparison-table cell value so brands can
3
+ * render a check-icon, x-icon, or raw text consistently. Returns one of
4
+ * three discriminated shapes the brand JSX matches against.
5
+ */
6
+ export type ComparisonCellRender = {
7
+ kind: 'true';
8
+ } | {
9
+ kind: 'false';
10
+ } | {
11
+ kind: 'value';
12
+ value: string | number;
13
+ };
14
+ export declare function classifyComparisonValue(v: string | number | boolean | undefined): ComparisonCellRender;
15
+ /**
16
+ * useComparisonHighlight — returns predicates a brand uses to apply
17
+ * highlight styling on the active product column. Stateless wrapper —
18
+ * the highlight id is owned by the caller (typically passed from props).
19
+ */
20
+ export declare function useComparisonHighlight(highlightedId: string | undefined): {
21
+ isHighlighted: (id: string) => boolean;
22
+ };
@@ -0,0 +1,80 @@
1
+ import { type Product } from '../../../../ecommerce/src/index';
2
+ import { type SuggestionAction } from '../../../../spacestation/src/index';
3
+ import { useSuccessFlash } from '../../utils/use-success-flash';
4
+ import { type VariantGap } from './variant-resolution';
5
+ interface Options {
6
+ /** Raw product list as emitted by the agent. Validated; malformed entries dropped. */
7
+ products: Product[];
8
+ /** Eyebrow label above the computed total ("TOTAL", "BUNDLE PRICE", …).
9
+ * Clamped to 24 chars; falls back to "Total" when invalid. */
10
+ totalLabel?: string;
11
+ /** Footer CTA — "Save look", etc. Dispatches through the session signal channel. */
12
+ saveAction?: SuggestionAction;
13
+ /** Footer CTA — "Add all to bag". When absent, falls back to a per-product
14
+ * `cart.add` loop using the default variant. */
15
+ addAllAction?: SuggestionAction;
16
+ /** How many tiles to render at most. Default 4. */
17
+ maxTiles?: number;
18
+ }
19
+ /**
20
+ * One tile in the look composition — a product paired with its
21
+ * already-resolved primary image. The brand `<LookCard>` renders
22
+ * straight from this shape and never reaches into `product.images[0]`
23
+ * itself; the SDK hook owns the "no-images" recovery so brand UI stays
24
+ * dumb (per `feedback_brand_packages_dumb`).
25
+ */
26
+ export interface LookCardTile {
27
+ product: Product;
28
+ /** Primary tile image, defensively pre-resolved. `undefined` when the
29
+ * product has no images OR `images` arrived as a non-array (the same
30
+ * schema-default-bypass shape `useProductCard` had to guard against
31
+ * — same root cause, same one-line fix at the SDK boundary). */
32
+ primaryImage: {
33
+ url: string;
34
+ altText: string;
35
+ } | undefined;
36
+ }
37
+ /**
38
+ * The "complete your look" state: pieces in the look whose variant the visitor
39
+ * must still choose before the look can be added (multi-size, none known). The
40
+ * brand sheet renders one row per `gap`; `confirmVariants` completes the whole
41
+ * look atomically. Null when every piece resolved from knowledge — the common
42
+ * case, where "add the look" adds straight away with no prompt.
43
+ */
44
+ export interface LookVerification {
45
+ /** One entry per piece needing a choice — product + the open option axes. */
46
+ gaps: VariantGap[];
47
+ }
48
+ export interface LookCardData {
49
+ /** Clean, parsed products clamped to `maxTiles`, with primary image
50
+ * pre-resolved per tile. Iteration target for brand `<LookCard>`. */
51
+ visible: LookCardTile[];
52
+ /** Pre-formatted total. Null when products use mixed currencies (can't sum). */
53
+ total: string | null;
54
+ /** Clamped eyebrow label for the total figure. */
55
+ totalEyebrow: string;
56
+ /** Tile click → dispatch canonical product-detail action. */
57
+ onTileClick: (product: Product) => void;
58
+ /** Save-look click → dispatch saveAction. No-op when saveAction undefined. */
59
+ onSave: () => void;
60
+ /** Add-all click → adds every piece at its known/resolved variant, OR opens
61
+ * `verification` when one or more pieces still need a size choice. */
62
+ onAddAll: () => void;
63
+ /** Non-null while the visitor must pick sizes before the look can be added. */
64
+ verification: LookVerification | null;
65
+ /** Complete the look: `selections` maps each gap product id → its chosen
66
+ * option values ({ Size: '8' }). Resolves, remembers, and adds all pieces. */
67
+ confirmVariants: (selections: Readonly<Record<string, Record<string, string>>>) => void;
68
+ /** Dismiss the verification sheet without adding anything. */
69
+ cancelVerification: () => void;
70
+ /** Success-flash controls for the Add button. */
71
+ addFlash: ReturnType<typeof useSuccessFlash>;
72
+ }
73
+ /**
74
+ * Headless data + interaction model for an editorial "look" composition:
75
+ * a curated bundle of 2–4 products with shared rationale, save action,
76
+ * and add-all action. Brand `<LookCard>` renders the visuals; this hook
77
+ * owns parsing, total math, label clamping, and signal dispatch.
78
+ */
79
+ export declare function useLookCard({ products, totalLabel, saveAction, addAllAction, maxTiles, }: Options): LookCardData | null;
80
+ export {};
@@ -0,0 +1,62 @@
1
+ import * as React from 'react';
2
+ import { type Product } from '../../../../ecommerce/src/index';
3
+ type ProductImageData = Product['images'][number];
4
+ import { useImageHover } from '../../shared/use-image-hover';
5
+ export type ProductCardBadge = 'NEW' | 'SALE' | 'BEST SELLER';
6
+ export interface ProductCardData {
7
+ /** The product to render. Always present — the hydration boundary
8
+ * (`FourtyCanvas`) validates every resolved entity against its catalog
9
+ * schema and drops the malformed ones, so a card never receives one. */
10
+ product: Product;
11
+ /** Image to show right now (primary by default, hover image if
12
+ * available and pointer is over the card). Convenience for cards
13
+ * that don't crossfade — render `displayImage` and let the swap
14
+ * be instant. For a hover-flip crossfade, render both
15
+ * `primaryImage` + `hoverImage` stacked and animate opacity from
16
+ * `hover`. */
17
+ displayImage: ProductImageData | undefined;
18
+ /** Primary product image (images[0]). Always present when product
19
+ * has images; undefined for image-less products. */
20
+ primaryImage: ProductImageData | undefined;
21
+ /** Secondary image used for the hover-flip crossfade (images[1]).
22
+ * Undefined when product has fewer than 2 images — in that case
23
+ * the card should skip the crossfade and just render
24
+ * `primaryImage`. */
25
+ hoverImage: ProductImageData | undefined;
26
+ /** Badge to overlay on the image (priority: explicit tag, then sale
27
+ * inference). Undefined when no badge applies. */
28
+ badge: ProductCardBadge | undefined;
29
+ /** Number of color variant values, when the product has a `color`
30
+ * option AND more than one value. Undefined otherwise. Lets the
31
+ * card decide whether to render "N colors" affordance. */
32
+ colorCount: number | undefined;
33
+ /** Whether the product is currently on sale (price < compareAtPrice). */
34
+ onSale: boolean;
35
+ /** Pre-formatted current price string ("$49.00"). */
36
+ priceLabel: string;
37
+ /** Pre-formatted strikethrough price string. Undefined when not on sale. */
38
+ compareAtPriceLabel: string | undefined;
39
+ /** Whether the visitor is currently hovering the card. */
40
+ hover: boolean;
41
+ /** Spread onto the hover-target element to track pointer enter/leave. */
42
+ hoverProps: ReturnType<typeof useImageHover>['hoverProps'];
43
+ /** Card click — dispatches the canonical `navigate` action (with a
44
+ * `{kind:'product'}` destination) through the session signal channel. */
45
+ onCardClick: () => void;
46
+ /** Quick-add click — dispatches `cart.add`. Stops propagation so the
47
+ * card click doesn't ALSO fire when the inner button is pressed. */
48
+ onQuickAdd: (e: React.MouseEvent<HTMLButtonElement>) => void;
49
+ }
50
+ /**
51
+ * Headless product-card data + interaction model. Brand cards consume
52
+ * this and render the visual chrome they want — the logic (hover image
53
+ * flip, sale derivation, badge selection, action dispatch) lives once in
54
+ * the SDK so every brand surface behaves the same.
55
+ *
56
+ * `product` is trusted: the hydration boundary (`FourtyCanvas`) parses
57
+ * every resolved entity against its catalog schema and drops the
58
+ * malformed ones, so a card never has to second-guess its input. The
59
+ * card stays a dumb renderer — it assumes what it receives renders.
60
+ */
61
+ export declare function useProductCard(product: Product): ProductCardData;
62
+ export {};
@@ -0,0 +1,13 @@
1
+ /**
2
+ * useProductCarouselScroll — exposes a ref to attach to a horizontal
3
+ * scroller plus enable/disable state for the chevron buttons. Tracks
4
+ * scrollLeft live; refreshes whenever items change. Brands render the
5
+ * buttons however they want.
6
+ */
7
+ export declare function useProductCarouselScroll(itemsKey: number, scrollDistance?: number): {
8
+ scrollerRef: React.RefObject<HTMLDivElement | null>;
9
+ canLeft: boolean;
10
+ canRight: boolean;
11
+ scrollBy: (dir: 1 | -1) => void;
12
+ onScroll: () => void;
13
+ };
@@ -0,0 +1,48 @@
1
+ import type { Product, SiblingProduct } from '../../../../ecommerce/src/index';
2
+ import { preselectFromFacts } from './preselect-from-facts';
3
+ import { type ProductVariant } from './variant-selection';
4
+ export { preselectFromFacts };
5
+ export interface ProductDetailVariantGroup {
6
+ name: string;
7
+ options: string[];
8
+ }
9
+ /**
10
+ * useProductDetail — variant selection + image gallery + description
11
+ * expand + agentic dispatch. Operates on the canonical `Product` shape
12
+ * from `@fourty/spacestation`, so the LLM-emitted hydrated product flows
13
+ * through unchanged.
14
+ *
15
+ * Returns:
16
+ * - selectedImage / selectImage / zoomed / toggleZoom
17
+ * - variantGroups derived from product.options (or empty)
18
+ * - selectedVariants / selectVariant
19
+ * - allSelected / missingGroup
20
+ * - findVariant(opts) → ProductVariant | undefined
21
+ * - isVariantUnavailable(group, opt)
22
+ * - descExpanded / toggleDesc
23
+ * - onAddToBag (dispatches cart.add only when allSelected; carries variantId)
24
+ * - onAskAgent (sends a chat message asking about this product)
25
+ * - onPickSibling (navigates to a colour-sibling product)
26
+ * - onSale predicate
27
+ */
28
+ export declare function useProductDetail(product: Product): {
29
+ selectedImage: number;
30
+ selectImage: (i: number) => void;
31
+ zoomed: boolean;
32
+ toggleZoom: () => void;
33
+ variantGroups: ProductDetailVariantGroup[];
34
+ selectedVariants: Record<string, string>;
35
+ selectVariant: (group: string, opt: string) => void;
36
+ allSelected: boolean;
37
+ missingGroup: ProductDetailVariantGroup | undefined;
38
+ findVariant: (opts: Record<string, string>) => ProductVariant | undefined;
39
+ isVariantUnavailable: (group: string, opt: string) => boolean;
40
+ descExpanded: boolean;
41
+ toggleDesc: () => void;
42
+ onAddToBag: () => void;
43
+ onBuyNow: () => void;
44
+ buyNowPending: boolean;
45
+ onAskAgent: () => void;
46
+ onPickSibling: (sibling: SiblingProduct) => void;
47
+ onSale: boolean;
48
+ };
@@ -0,0 +1,17 @@
1
+ import type { ProductFilterChip } from './product-filters';
2
+ interface Api {
3
+ chips: ProductFilterChip[];
4
+ active: ProductFilterChip | null;
5
+ setActive: (next: ProductFilterChip) => void;
6
+ }
7
+ /**
8
+ * useProductGridFilter — single-select chip filter state. Brands supply
9
+ * the pruned chip list (typically the output of `pruneFilterChips`); the
10
+ * hook holds the active chip. No filter math here — apply the active
11
+ * chip's `match` predicate via `matchesProductFilter` in the renderer.
12
+ *
13
+ * Resets to the first chip whenever the chip identity set changes so a
14
+ * previously-active chip that pruned out doesn't ghost the selection.
15
+ */
16
+ export declare function useProductGridFilter(chips: ProductFilterChip[]): Api;
17
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Product } from '../../../../ecommerce/src/index';
2
+ export declare function useSelectedVariantsState(product: Product, facts: Readonly<Record<string, unknown>>): {
3
+ selectedVariants: Record<string, string>;
4
+ setSelectedVariants: React.Dispatch<React.SetStateAction<Record<string, string>>>;
5
+ /** Latch "the picker on THIS product was deliberately touched" — stops
6
+ * facts-driven preselect from second-guessing a real pick. */
7
+ markTouched: () => void;
8
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * useWishlistDrawer — open/close state + the live wishlist from the
3
+ * commerce provider. Returns empty `productIds` (and a no-op, logging
4
+ * `removeLine`) when no commerce provider is mounted, so a brand shell
5
+ * can mount its wishlist drawer unconditionally without crashing —
6
+ * the same degradation contract as `useCartDrawer`.
7
+ *
8
+ * Brand shells must use THIS hook (never the raw `useWishlist`, which
9
+ * throws without a provider): a spacefront whose commerce config fails
10
+ * to resolve should render browse-only, not white-screen.
11
+ *
12
+ * const wishlist = useWishlistDrawer();
13
+ * <WishlistLauncher count={wishlist.totalQuantity} onClick={wishlist.open} />
14
+ * <WishlistDrawer
15
+ * open={wishlist.isOpen}
16
+ * onClose={wishlist.close}
17
+ * productIds={wishlist.productIds}
18
+ * onRemove={wishlist.removeLine}
19
+ * />
20
+ */
21
+ export declare function useWishlistDrawer(): {
22
+ isOpen: boolean;
23
+ open: () => void;
24
+ close: () => void;
25
+ toggle: () => void;
26
+ /** Hearted product ids — `[]` when commerce is unavailable. */
27
+ productIds: string[];
28
+ totalQuantity: number;
29
+ /**
30
+ * Remove a product from the wishlist. Failures are logged, never
31
+ * thrown — safe to pass directly as an event handler.
32
+ */
33
+ removeLine: (productId: string) => void;
34
+ };