@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,351 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A brand's component source, published as DATA from the brand's own
4
+ * repository: its catalog (props schemas in wire form) and the markdown
5
+ * manifests that describe each type to the agent.
6
+ *
7
+ * The catalog and manifests are never executed: the platform rebuilds the
8
+ * catalog from them and registers the source exactly as it registers a
9
+ * workspace brand. A release MAY also carry the brand's built components
10
+ * (`bundle`) — browser code, for a spacefront the platform hosts.
11
+ */
12
+ export declare const PackageReleaseSchema: z.ZodObject<{
13
+ /** The id spaces name in `componentSources` — an npm-style package name. */
14
+ sourceId: z.ZodEffects<z.ZodString, string, string>;
15
+ label: z.ZodString;
16
+ /** The package's own version, as its repository states it — shown in the console. */
17
+ version: z.ZodString;
18
+ catalog: z.ZodRecord<z.ZodString, z.ZodObject<{
19
+ type: z.ZodString;
20
+ propsSchema: z.ZodOptional<z.ZodType<import("./wire-schema").WireSchema, z.ZodTypeDef, import("./wire-schema").WireSchema>>;
21
+ examples: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>;
22
+ renderedBy: z.ZodOptional<z.ZodString>;
23
+ alwaysInclude: z.ZodOptional<z.ZodBoolean>;
24
+ whenToUse: z.ZodOptional<z.ZodString>;
25
+ dontUseWhen: z.ZodOptional<z.ZodString>;
26
+ variants: z.ZodOptional<z.ZodString>;
27
+ dependencies: z.ZodOptional<z.ZodString>;
28
+ layout: z.ZodOptional<z.ZodEnum<["section", "fullbleed"]>>;
29
+ size: z.ZodOptional<z.ZodEnum<["full", "wide", "half", "narrow"]>>;
30
+ extendsPage: z.ZodOptional<z.ZodBoolean>;
31
+ bindings: z.ZodOptional<z.ZodArray<z.ZodObject<{
32
+ source: z.ZodString;
33
+ prop: z.ZodString;
34
+ accumulate: z.ZodOptional<z.ZodEnum<["replace", "append", "concat-text"]>>;
35
+ mountAt: z.ZodOptional<z.ZodString>;
36
+ }, "strip", z.ZodTypeAny, {
37
+ source: string;
38
+ prop: string;
39
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
40
+ mountAt?: string | undefined;
41
+ }, {
42
+ source: string;
43
+ prop: string;
44
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
45
+ mountAt?: string | undefined;
46
+ }>, "many">>;
47
+ defaultLayoutWeight: z.ZodOptional<z.ZodNumber>;
48
+ defaultMaxHeight: z.ZodOptional<z.ZodEnum<["sm", "md", "lg", "full"]>>;
49
+ category: z.ZodOptional<z.ZodString>;
50
+ progressLabel: z.ZodOptional<z.ZodString>;
51
+ isExperience: z.ZodOptional<z.ZodBoolean>;
52
+ requires: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
53
+ provides: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
54
+ }, "strict", z.ZodTypeAny, {
55
+ type: string;
56
+ layout?: "section" | "fullbleed" | undefined;
57
+ size?: "full" | "wide" | "half" | "narrow" | undefined;
58
+ propsSchema?: import("./wire-schema").WireSchema | undefined;
59
+ bindings?: {
60
+ source: string;
61
+ prop: string;
62
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
63
+ mountAt?: string | undefined;
64
+ }[] | undefined;
65
+ examples?: Record<string, unknown>[] | undefined;
66
+ renderedBy?: string | undefined;
67
+ alwaysInclude?: boolean | undefined;
68
+ whenToUse?: string | undefined;
69
+ dontUseWhen?: string | undefined;
70
+ variants?: string | undefined;
71
+ dependencies?: string | undefined;
72
+ extendsPage?: boolean | undefined;
73
+ defaultLayoutWeight?: number | undefined;
74
+ defaultMaxHeight?: "full" | "sm" | "md" | "lg" | undefined;
75
+ category?: string | undefined;
76
+ progressLabel?: string | undefined;
77
+ isExperience?: boolean | undefined;
78
+ requires?: string[] | undefined;
79
+ provides?: string[] | undefined;
80
+ }, {
81
+ type: string;
82
+ layout?: "section" | "fullbleed" | undefined;
83
+ size?: "full" | "wide" | "half" | "narrow" | undefined;
84
+ propsSchema?: import("./wire-schema").WireSchema | undefined;
85
+ bindings?: {
86
+ source: string;
87
+ prop: string;
88
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
89
+ mountAt?: string | undefined;
90
+ }[] | undefined;
91
+ examples?: Record<string, unknown>[] | undefined;
92
+ renderedBy?: string | undefined;
93
+ alwaysInclude?: boolean | undefined;
94
+ whenToUse?: string | undefined;
95
+ dontUseWhen?: string | undefined;
96
+ variants?: string | undefined;
97
+ dependencies?: string | undefined;
98
+ extendsPage?: boolean | undefined;
99
+ defaultLayoutWeight?: number | undefined;
100
+ defaultMaxHeight?: "full" | "sm" | "md" | "lg" | undefined;
101
+ category?: string | undefined;
102
+ progressLabel?: string | undefined;
103
+ isExperience?: boolean | undefined;
104
+ requires?: string[] | undefined;
105
+ provides?: string[] | undefined;
106
+ }>>;
107
+ /** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
108
+ manifests: z.ZodRecord<z.ZodString, z.ZodString>;
109
+ /**
110
+ * The brand's components, built — present when the PLATFORM hosts this
111
+ * brand's spacefront, absent when the brand hosts it in its own app. One
112
+ * ES module (exporting `renderers`, and optionally `shells`) and its
113
+ * stylesheet. It is served to browsers; the platform's servers never run it.
114
+ */
115
+ bundle: z.ZodOptional<z.ZodObject<{
116
+ js: z.ZodString;
117
+ css: z.ZodString;
118
+ }, "strict", z.ZodTypeAny, {
119
+ js: string;
120
+ css: string;
121
+ }, {
122
+ js: string;
123
+ css: string;
124
+ }>>;
125
+ /**
126
+ * The class the spacefront root carries while this package is the space's.
127
+ * The package's own stylesheet styles under it. Absent = the platform's
128
+ * default theme class.
129
+ */
130
+ theme: z.ZodOptional<z.ZodObject<{
131
+ themeClass: z.ZodString;
132
+ }, "strict", z.ZodTypeAny, {
133
+ themeClass: string;
134
+ }, {
135
+ themeClass: string;
136
+ }>>;
137
+ /** The canvas a fresh session opens on, before the visitor has asked anything. */
138
+ seedLayout: z.ZodOptional<z.ZodObject<{
139
+ root: z.ZodString;
140
+ aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
141
+ elements: z.ZodRecord<z.ZodString, z.ZodObject<{
142
+ type: z.ZodString;
143
+ props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
144
+ children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
145
+ experience: z.ZodOptional<z.ZodString>;
146
+ __turnId: z.ZodOptional<z.ZodString>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ type: string;
149
+ props: Record<string, unknown>;
150
+ children?: string[] | undefined;
151
+ experience?: string | undefined;
152
+ __turnId?: string | undefined;
153
+ }, {
154
+ type: string;
155
+ props?: Record<string, unknown> | undefined;
156
+ children?: string[] | undefined;
157
+ experience?: string | undefined;
158
+ __turnId?: string | undefined;
159
+ }>>;
160
+ state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
161
+ }, "strip", z.ZodTypeAny, {
162
+ root: string;
163
+ elements: Record<string, {
164
+ type: string;
165
+ props: Record<string, unknown>;
166
+ children?: string[] | undefined;
167
+ experience?: string | undefined;
168
+ __turnId?: string | undefined;
169
+ }>;
170
+ aliases?: Record<string, string> | undefined;
171
+ state?: Record<string, unknown> | undefined;
172
+ }, {
173
+ root: string;
174
+ elements: Record<string, {
175
+ type: string;
176
+ props?: Record<string, unknown> | undefined;
177
+ children?: string[] | undefined;
178
+ experience?: string | undefined;
179
+ __turnId?: string | undefined;
180
+ }>;
181
+ aliases?: Record<string, string> | undefined;
182
+ state?: Record<string, unknown> | undefined;
183
+ }>>;
184
+ /**
185
+ * The package's own composition guidance for its own components — prompt
186
+ * markdown the agent reads, gated on the capabilities it names (`requires`).
187
+ */
188
+ promptSections: z.ZodOptional<z.ZodArray<z.ZodObject<{
189
+ id: z.ZodString;
190
+ order: z.ZodNumber;
191
+ content: z.ZodString;
192
+ requires: z.ZodArray<z.ZodString, "many">;
193
+ }, "strict", z.ZodTypeAny, {
194
+ id: string;
195
+ requires: string[];
196
+ order: number;
197
+ content: string;
198
+ }, {
199
+ id: string;
200
+ requires: string[];
201
+ order: number;
202
+ content: string;
203
+ }>, "many">>;
204
+ /**
205
+ * Opaque per-vertical extension data (`BrandDefinition.config`): the
206
+ * platform stays vertical-agnostic and the vertical's own code reads its keys.
207
+ */
208
+ config: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
209
+ /**
210
+ * Set by the platform, never by a publisher: this release is a DRAFT of the
211
+ * package `of`, previewed on the space `space`. See `draftSourceId`.
212
+ */
213
+ draft: z.ZodOptional<z.ZodObject<{
214
+ of: z.ZodString;
215
+ space: z.ZodString;
216
+ }, "strict", z.ZodTypeAny, {
217
+ of: string;
218
+ space: string;
219
+ }, {
220
+ of: string;
221
+ space: string;
222
+ }>>;
223
+ }, "strict", z.ZodTypeAny, {
224
+ label: string;
225
+ sourceId: string;
226
+ version: string;
227
+ catalog: Record<string, {
228
+ type: string;
229
+ layout?: "section" | "fullbleed" | undefined;
230
+ size?: "full" | "wide" | "half" | "narrow" | undefined;
231
+ propsSchema?: import("./wire-schema").WireSchema | undefined;
232
+ bindings?: {
233
+ source: string;
234
+ prop: string;
235
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
236
+ mountAt?: string | undefined;
237
+ }[] | undefined;
238
+ examples?: Record<string, unknown>[] | undefined;
239
+ renderedBy?: string | undefined;
240
+ alwaysInclude?: boolean | undefined;
241
+ whenToUse?: string | undefined;
242
+ dontUseWhen?: string | undefined;
243
+ variants?: string | undefined;
244
+ dependencies?: string | undefined;
245
+ extendsPage?: boolean | undefined;
246
+ defaultLayoutWeight?: number | undefined;
247
+ defaultMaxHeight?: "full" | "sm" | "md" | "lg" | undefined;
248
+ category?: string | undefined;
249
+ progressLabel?: string | undefined;
250
+ isExperience?: boolean | undefined;
251
+ requires?: string[] | undefined;
252
+ provides?: string[] | undefined;
253
+ }>;
254
+ manifests: Record<string, string>;
255
+ config?: Record<string, unknown> | undefined;
256
+ bundle?: {
257
+ js: string;
258
+ css: string;
259
+ } | undefined;
260
+ theme?: {
261
+ themeClass: string;
262
+ } | undefined;
263
+ seedLayout?: {
264
+ root: string;
265
+ elements: Record<string, {
266
+ type: string;
267
+ props: Record<string, unknown>;
268
+ children?: string[] | undefined;
269
+ experience?: string | undefined;
270
+ __turnId?: string | undefined;
271
+ }>;
272
+ aliases?: Record<string, string> | undefined;
273
+ state?: Record<string, unknown> | undefined;
274
+ } | undefined;
275
+ promptSections?: {
276
+ id: string;
277
+ requires: string[];
278
+ order: number;
279
+ content: string;
280
+ }[] | undefined;
281
+ draft?: {
282
+ of: string;
283
+ space: string;
284
+ } | undefined;
285
+ }, {
286
+ label: string;
287
+ sourceId: string;
288
+ version: string;
289
+ catalog: Record<string, {
290
+ type: string;
291
+ layout?: "section" | "fullbleed" | undefined;
292
+ size?: "full" | "wide" | "half" | "narrow" | undefined;
293
+ propsSchema?: import("./wire-schema").WireSchema | undefined;
294
+ bindings?: {
295
+ source: string;
296
+ prop: string;
297
+ accumulate?: "replace" | "append" | "concat-text" | undefined;
298
+ mountAt?: string | undefined;
299
+ }[] | undefined;
300
+ examples?: Record<string, unknown>[] | undefined;
301
+ renderedBy?: string | undefined;
302
+ alwaysInclude?: boolean | undefined;
303
+ whenToUse?: string | undefined;
304
+ dontUseWhen?: string | undefined;
305
+ variants?: string | undefined;
306
+ dependencies?: string | undefined;
307
+ extendsPage?: boolean | undefined;
308
+ defaultLayoutWeight?: number | undefined;
309
+ defaultMaxHeight?: "full" | "sm" | "md" | "lg" | undefined;
310
+ category?: string | undefined;
311
+ progressLabel?: string | undefined;
312
+ isExperience?: boolean | undefined;
313
+ requires?: string[] | undefined;
314
+ provides?: string[] | undefined;
315
+ }>;
316
+ manifests: Record<string, string>;
317
+ config?: Record<string, unknown> | undefined;
318
+ bundle?: {
319
+ js: string;
320
+ css: string;
321
+ } | undefined;
322
+ theme?: {
323
+ themeClass: string;
324
+ } | undefined;
325
+ seedLayout?: {
326
+ root: string;
327
+ elements: Record<string, {
328
+ type: string;
329
+ props?: Record<string, unknown> | undefined;
330
+ children?: string[] | undefined;
331
+ experience?: string | undefined;
332
+ __turnId?: string | undefined;
333
+ }>;
334
+ aliases?: Record<string, string> | undefined;
335
+ state?: Record<string, unknown> | undefined;
336
+ } | undefined;
337
+ promptSections?: {
338
+ id: string;
339
+ requires: string[];
340
+ order: number;
341
+ content: string;
342
+ }[] | undefined;
343
+ draft?: {
344
+ of: string;
345
+ space: string;
346
+ } | undefined;
347
+ }>;
348
+ export type PackageRelease = z.infer<typeof PackageReleaseSchema>;
349
+ export declare function draftSourceId(sourceId: string, spaceSlug: string, developer: string): string;
350
+ /** A package may not be published under a name that reads as a draft's. */
351
+ export declare function isDraftSource(sourceId: string): boolean;
@@ -0,0 +1,7 @@
1
+ import { z } from 'zod';
2
+ import type { WireSchema } from './wire-schema';
3
+ /**
4
+ * Rebuild a real Zod schema from its wire form — built with THIS module's zod,
5
+ * so every `instanceof z.Zod…` walker in the platform accepts it.
6
+ */
7
+ export declare function schemaFromWire(node: WireSchema): z.ZodTypeAny;
@@ -0,0 +1,8 @@
1
+ import { z } from 'zod';
2
+ import type { WireSchema } from './wire-schema';
3
+ /** Raised when a schema uses a construct the wire format cannot reproduce. */
4
+ export declare class UnsupportedSchemaError extends Error {
5
+ constructor(path: string, what: string);
6
+ }
7
+ /** Serialize a Zod schema to its wire form. Throws `UnsupportedSchemaError`. */
8
+ export declare function schemaToWire(schema: z.ZodTypeAny): WireSchema;
@@ -0,0 +1,78 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A props schema as DATA.
4
+ *
5
+ * A catalog authored outside this monorepo reaches the platform as JSON, never
6
+ * as code, so its Zod schemas travel in this shape and are rebuilt into real
7
+ * Zod on arrival (`schemaFromWire`). It covers exactly the constructs catalogs
8
+ * use; `schemaToWire` throws on anything else rather than approximating it, so
9
+ * a schema the platform cannot reproduce is refused at publish time.
10
+ *
11
+ * The `resolved` / `prose` markers ride on the node that carries them.
12
+ */
13
+ export interface WireResolved {
14
+ resolverKey: string;
15
+ min?: number;
16
+ max?: number;
17
+ renderFloor?: number;
18
+ derivedFrom?: string;
19
+ }
20
+ interface WireCommon {
21
+ description?: string;
22
+ resolved?: WireResolved;
23
+ prose?: true;
24
+ }
25
+ export type WireSchema = WireCommon & ({
26
+ t: 'string';
27
+ min?: number;
28
+ max?: number;
29
+ } | {
30
+ t: 'number';
31
+ int?: true;
32
+ min?: number;
33
+ minExclusive?: true;
34
+ max?: number;
35
+ maxExclusive?: true;
36
+ } | {
37
+ t: 'boolean';
38
+ } | {
39
+ t: 'unknown';
40
+ } | {
41
+ t: 'literal';
42
+ value: string | number | boolean;
43
+ } | {
44
+ t: 'enum';
45
+ values: string[];
46
+ } | {
47
+ t: 'array';
48
+ element: WireSchema;
49
+ min?: number;
50
+ max?: number;
51
+ } | {
52
+ t: 'object';
53
+ shape: Record<string, WireSchema>;
54
+ unknownKeys: 'strip' | 'passthrough' | 'strict';
55
+ } | {
56
+ t: 'union';
57
+ options: WireSchema[];
58
+ } | {
59
+ t: 'discriminatedUnion';
60
+ discriminator: string;
61
+ options: WireSchema[];
62
+ } | {
63
+ t: 'record';
64
+ value: WireSchema;
65
+ } | {
66
+ t: 'optional';
67
+ inner: WireSchema;
68
+ } | {
69
+ t: 'nullable';
70
+ inner: WireSchema;
71
+ } | {
72
+ t: 'default';
73
+ inner: WireSchema;
74
+ value?: unknown;
75
+ });
76
+ /** Validates a wire schema arriving from outside (the publish boundary). */
77
+ export declare const WireSchemaSchema: z.ZodType<WireSchema>;
78
+ export {};
@@ -0,0 +1,125 @@
1
+ /**
2
+ * The `cart.add` SIGNAL payload — and the one field that makes "who added
3
+ * this?" answerable at all.
4
+ *
5
+ * ── THE ACTOR IS STRUCTURALLY DESTROYED ONE FRAME ABOVE EVERY CART WRITE ───
6
+ *
7
+ * `packages/react/src/provider/providers/use-signal-dispatch.ts` collapses
8
+ * `dispatchSignal` and `dispatchSuggestionAction` into one `dispatchCore`, and
9
+ * `dispatchCore` calls the handler with the PAYLOAD ONLY. Its boolean parameter
10
+ * is not an actor flag — its own doc block says it distinguishes
11
+ * strict/observation from chip-click — and BOTH visitors and the agent reach
12
+ * cart writes through it (`VariantPickerModal` dispatches a `cart.add` through
13
+ * `dispatchSignal`; so does the agent's own signal stream). So the commerce
14
+ * handler that performs the write cannot satisfy a required `origin` from
15
+ * anything it can see.
16
+ *
17
+ * The fix is a required field on the signal itself, stamped by each PRODUCER,
18
+ * which is the only place the actor is still known.
19
+ *
20
+ * ── WHY THIS FILE SITS BESIDE `selection-signal.ts` ────────────────────────
21
+ *
22
+ * That file established the pattern: "the one signal any surface emits… `origin`
23
+ * is the single piece of provenance the boundary needs". This copies its
24
+ * PLACEMENT and deliberately fixes its TYPE — `SelectionOrigin` is a one-member
25
+ * union where ABSENCE means agent, which is exactly the shape that answers a
26
+ * provenance question with a silent default. `CartOrigin` is three-valued and
27
+ * required, and there is no `??` anywhere in the chain that could invent one.
28
+ *
29
+ * ── WHY IT IS NOT `.strict()` ──────────────────────────────────────────────
30
+ *
31
+ * A signal payload legitimately carries extras the handler ignores: `followUp`
32
+ * from `use-composer-chip-select.ts`, `expectedTool` folded in by
33
+ * `use-signal-dispatch.ts`, `label`/`image` from the WebMCP tool. Zod's default
34
+ * STRIP is right here. The `.strict()` rule governs ANALYTICS payloads, which
35
+ * are a different contract with a different failure mode (an unreviewed key
36
+ * landing in a `jsonb` column on a public endpoint).
37
+ */
38
+ import { z } from 'zod';
39
+ import { type CartOrigin } from '../analytics/ecommerce/events';
40
+ /** The signal type every add-to-cart producer dispatches. */
41
+ export declare const CART_ADD_SIGNAL = "cart.add";
42
+ /**
43
+ * The payload contract the commerce handler `.parse()`s.
44
+ *
45
+ * Everything except `origin` is optional because it always was: the agent emits
46
+ * `productId` and never a variant id, a PDP add emits both, and a batch CTA can
47
+ * emit a variant with no product. `origin` is the one field with no honest
48
+ * absence — a defaulted actor does not mean "we are not sure", it silently
49
+ * answers the question the event exists to answer.
50
+ */
51
+ export declare const CartAddSignalPayloadSchema: z.ZodObject<{
52
+ origin: z.ZodEnum<["visitor", "agent", "webmcp"]>;
53
+ productId: z.ZodOptional<z.ZodString>;
54
+ variantId: z.ZodOptional<z.ZodString>;
55
+ quantity: z.ZodOptional<z.ZodNumber>;
56
+ selections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
57
+ optimisticLine: z.ZodOptional<z.ZodUnknown>;
58
+ /**
59
+ * Whether a LANDED add announces itself by opening the cart drawer on the
60
+ * changed line. Absent means yes, which is every existing producer's
61
+ * behaviour and the right default: for an agent-driven write the visitor
62
+ * never clicked, the drawer is the only visible confirmation there is.
63
+ *
64
+ * `false` is for an add whose acknowledgement is something else entirely —
65
+ * buy-now, which adds and then navigates to checkout. Opening a drawer there
66
+ * covers the page for a beat and then throws it away as the tab leaves, which
67
+ * is worse than no feedback: it reads as "your cart" at the exact moment the
68
+ * visitor asked NOT to look at their cart.
69
+ *
70
+ * A field on the signal rather than a flag on a store, because this is a
71
+ * property of the INTENT — the producer is the only frame that knows why the
72
+ * add is happening — and the handler is several frames away from it.
73
+ */
74
+ acknowledgeInDrawer: z.ZodOptional<z.ZodBoolean>;
75
+ }, "strip", z.ZodTypeAny, {
76
+ origin: "visitor" | "agent" | "webmcp";
77
+ productId?: string | undefined;
78
+ quantity?: number | undefined;
79
+ variantId?: string | undefined;
80
+ selections?: Record<string, string> | undefined;
81
+ optimisticLine?: unknown;
82
+ acknowledgeInDrawer?: boolean | undefined;
83
+ }, {
84
+ origin: "visitor" | "agent" | "webmcp";
85
+ productId?: string | undefined;
86
+ quantity?: number | undefined;
87
+ variantId?: string | undefined;
88
+ selections?: Record<string, string> | undefined;
89
+ optimisticLine?: unknown;
90
+ acknowledgeInDrawer?: boolean | undefined;
91
+ }>;
92
+ export type CartAddSignalPayload = z.infer<typeof CartAddSignalPayloadSchema>;
93
+ /**
94
+ * What the visitor is told when a `cart.add` arrives without a usable `origin`.
95
+ *
96
+ * Rendered VERBATIM to the visitor by `commerce-state-report-bridge.tsx`, which
97
+ * is why it is a sentence and not a Zod dump. The machine detail goes to a
98
+ * `console.warn` beside it — see `cart-line-handlers.ts`.
99
+ */
100
+ export declare const CART_ADD_MALFORMED_REASON = "that request was missing something \u2014 nothing was added";
101
+ /**
102
+ * Stamp the actor onto an origin-bearing cart payload as it passes a
103
+ * RE-DISPATCH point, and leave every other signal exactly as it was.
104
+ *
105
+ * Two places re-dispatch a payload somebody else authored, and both are the
106
+ * last frame where the actor is still known:
107
+ *
108
+ * - `use-composer-chip-select.ts` — a follow-up chip. Its TEXT is the
109
+ * agent's; the ADD is the visitor's tap, and the metric asks who caused the
110
+ * cart write. `'visitor'`.
111
+ * - `FourtyProvider`'s `subscribeSignals` — "Auto-dispatch agent-emitted
112
+ * signals", the one boundary where a signal is genuinely the agent's own.
113
+ * `'agent'`.
114
+ *
115
+ * ── WHY IT IS GATED ON THE TYPE RATHER THAN STAMPING EVERYTHING ────────────
116
+ *
117
+ * `origin` is a field of THIS contract, not of every signal. And the agent
118
+ * boundary carries `text.delta` — one signal per streamed token — so an
119
+ * unconditional spread there would allocate an object per token on the
120
+ * latency-critical streaming path, to add a key nothing reads.
121
+ *
122
+ * The set below is the gate, so adding a verb that records an actor is one edit
123
+ * here rather than a new branch at every re-dispatch point.
124
+ */
125
+ export declare function withCartActorOrigin(signalType: string, payload: Record<string, unknown>, origin: CartOrigin): Record<string, unknown>;
@@ -0,0 +1,87 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * A live, client-reported snapshot of the visitor's cart / wishlist —
4
+ * mirrors `ViewportFocus` (`layout/page.ts`): a small, out-of-band
5
+ * `InteractionSignal` payload the client sends whenever the real state
6
+ * changes, so the agent's next turn grounds any add/remove claim against
7
+ * what's actually there instead of its own prior narration.
8
+ *
9
+ * Deliberately compact — not the full commerce `Cart`/`Wishlist` shape
10
+ * (no raw money objects, no full line metadata). Just enough for the
11
+ * agent to (a) know what's really in the cart and (b) name it correctly
12
+ * in prose. Carried by the `cart.snapshot` / `wishlist.snapshot`
13
+ * interaction signals.
14
+ */
15
+ export interface CartSnapshotLine {
16
+ /** The product gid — the same id shape the agent's own tool results
17
+ * and mutation-tool arguments use, so a claim can be cross-checked. */
18
+ productId: string;
19
+ /** Human-readable title, for the agent to name the item correctly. */
20
+ title: string;
21
+ /** Selected option summary when the product has variants (e.g. "Size 7, Black Satin") — omitted for a single-variant product. */
22
+ selection?: string;
23
+ quantity: number;
24
+ }
25
+ export interface CartSnapshot {
26
+ lines: CartSnapshotLine[];
27
+ }
28
+ export declare const CartSnapshotLineSchema: z.ZodObject<{
29
+ productId: z.ZodString;
30
+ title: z.ZodString;
31
+ selection: z.ZodOptional<z.ZodString>;
32
+ quantity: z.ZodNumber;
33
+ }, "strip", z.ZodTypeAny, {
34
+ title: string;
35
+ productId: string;
36
+ quantity: number;
37
+ selection?: string | undefined;
38
+ }, {
39
+ title: string;
40
+ productId: string;
41
+ quantity: number;
42
+ selection?: string | undefined;
43
+ }>;
44
+ export declare const CartSnapshotSchema: z.ZodObject<{
45
+ lines: z.ZodArray<z.ZodObject<{
46
+ productId: z.ZodString;
47
+ title: z.ZodString;
48
+ selection: z.ZodOptional<z.ZodString>;
49
+ quantity: z.ZodNumber;
50
+ }, "strip", z.ZodTypeAny, {
51
+ title: string;
52
+ productId: string;
53
+ quantity: number;
54
+ selection?: string | undefined;
55
+ }, {
56
+ title: string;
57
+ productId: string;
58
+ quantity: number;
59
+ selection?: string | undefined;
60
+ }>, "many">;
61
+ }, "strip", z.ZodTypeAny, {
62
+ lines: {
63
+ title: string;
64
+ productId: string;
65
+ quantity: number;
66
+ selection?: string | undefined;
67
+ }[];
68
+ }, {
69
+ lines: {
70
+ title: string;
71
+ productId: string;
72
+ quantity: number;
73
+ selection?: string | undefined;
74
+ }[];
75
+ }>;
76
+ /** Wishlist is ids-only client-side today (see `useWishlist()`) — titles
77
+ * are resolved separately by the agent's own catalog lookups when named. */
78
+ export interface WishlistSnapshot {
79
+ productIds: string[];
80
+ }
81
+ export declare const WishlistSnapshotSchema: z.ZodObject<{
82
+ productIds: z.ZodArray<z.ZodString, "many">;
83
+ }, "strip", z.ZodTypeAny, {
84
+ productIds: string[];
85
+ }, {
86
+ productIds: string[];
87
+ }>;