@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,253 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Best-effort coarse geolocation for the visitor's session. Resolved
4
+ * silently from the request IP (no browser permission). All fields are
5
+ * optional — IP geo accuracy varies and missing fields ("no city for
6
+ * this IP block") are normal. The prompt assembly only emits a
7
+ * VISITOR LOCATION block when at least country is known.
8
+ *
9
+ * Captured once at session bind, never re-read mid-session. Visitor
10
+ * doesn't move during a session and the IP→geo lookup is cached.
11
+ */
12
+ export interface VisitorLocation {
13
+ /** ISO 3166-1 alpha-2 country code, e.g. "US". */
14
+ country?: string;
15
+ /** Subdivision code, e.g. "NY". Source-dependent format. */
16
+ region?: string;
17
+ /** Best human-readable city name, e.g. "Brooklyn". */
18
+ city?: string;
19
+ /** Postal / ZIP code when the IP geo source carries it. */
20
+ postalCode?: string;
21
+ /** WGS84 latitude. Coarse — typically city-centroid. */
22
+ latitude?: number;
23
+ /** WGS84 longitude. */
24
+ longitude?: number;
25
+ /** IANA timezone, e.g. "America/New_York". */
26
+ timezone?: string;
27
+ }
28
+ /**
29
+ * Inbound signals — the only things visitors put into the agent's
30
+ * mailbox. Three kinds:
31
+ * - `prompt` visitor typed something (opens a turn)
32
+ * - `mount` first connect for this session (bootstrap or restore)
33
+ * - `layout_update` visitor interaction changed the canvas client-side
34
+ * (e.g. opened an inline product detail). The agent
35
+ * absorbs the new layout into its state without
36
+ * running an LLM turn — the next `prompt` will see
37
+ * it as the current canvas.
38
+ *
39
+ * Beyond those three, `type` is OPEN — any string. The dispatch is
40
+ * data-driven (signal-handler registry on server, agent-signal handler
41
+ * registry on client) so new signals don't require a wire-type bump.
42
+ * Mirrors `AgentSignal.type` (server → client), which is also open.
43
+ *
44
+ * Convention for new signals: `<namespace>.<action>` — e.g.
45
+ * `preference.set`, `preference.unset`, `cart.add`. Reserved
46
+ * lifecycle types stay as the bare lowercase identifiers above.
47
+ *
48
+ * Passive tracking signals (scroll, hover, click without commit) are
49
+ * intentionally absent — only commit-shaped actions become signals.
50
+ */
51
+ export type SignalType = string;
52
+ export interface InteractionSignal {
53
+ type: SignalType;
54
+ timestamp: number;
55
+ /** Type-specific payload. Shape varies by `type`. */
56
+ payload: Record<string, unknown>;
57
+ /** Provenance: when this signal answers/resolves an agent-emitted prompt
58
+ * (e.g. an `agent_ask {id}`), the id of that prompt. Lets the trace
59
+ * correlate the inbound resolution to the outbound ask. */
60
+ causedBy?: string;
61
+ }
62
+ /**
63
+ * Client→agent interaction signal: the visitor dismissed a dossier fact (one of
64
+ * their CONFIRMED slots) straight from the presence read. The agent drops the
65
+ * matching `visitor_attributes` entry, so the next derive no longer reflects it — the
66
+ * visitor editing their own brief, riding the same observation rail as a variant
67
+ * pick (just an inverse write). Payload: `{ label, value }`.
68
+ */
69
+ export declare const PRESENCE_FACT_DISMISS_SIGNAL = "presence.fact_dismissed";
70
+ /**
71
+ * Client→agent interaction signal: the visitor told us what to call them.
72
+ *
73
+ * The only durable thing about a visitor that the VISITOR authors rather than
74
+ * the agent infers, so it rides the observation rail like every other
75
+ * commit-shaped edit (a variant pick, a fact dismissal) instead of becoming a
76
+ * client-only preference the agent never hears about. It is also sent
77
+ * immediately: the name is useful in the very next sentence the agent writes,
78
+ * and a name that only arrives with the next session is a name the visitor
79
+ * watched the agent ignore.
80
+ *
81
+ * The client persists it locally too (`visitorMemory.displayName`), which is
82
+ * what carries it across visits; this signal is how the LIVE session learns it.
83
+ * Payload: `{ name }` — empty means the visitor cleared it.
84
+ */
85
+ export declare const VISITOR_NAME_SIGNAL = "visitor.name_stated";
86
+ /**
87
+ * Client→agent interaction signal: a standing preference or constraint the
88
+ * visitor has STATED about themselves — a size, a fit, a budget. Sibling of
89
+ * `VISITOR_NAME_SIGNAL` and it rides the same observation rail, for the same
90
+ * reason: it is a commit-shaped edit the agent should absorb between turns, not
91
+ * a prompt that recomposes the page.
92
+ *
93
+ * Payload: `{ entries: Array<{ label: string; value: string }> }` — the labels
94
+ * are the words the SURFACE used, which the deriver reconciles against the
95
+ * space's own attribute registry. It is deliberately not a bare `{key: value}`
96
+ * map: `label` is what the visitor saw the axis called, and the registry owns
97
+ * the key it lands under.
98
+ *
99
+ * STATING IS NOT STORING. Whether a stated preference becomes a fact — and
100
+ * whether that fact is durable — is the space's registry's decision
101
+ * (`AttributeDef.durable`), never the caller's. The signal carries no scope
102
+ * field for exactly that reason: an external client that could pick its own
103
+ * retention would be overruling the space owner on their own data.
104
+ */
105
+ export declare const VISITOR_CONTEXT_SIGNAL = "visitor.context_stated";
106
+ /**
107
+ * Server-synthesized signal: fires AFTER one or more `PRESENCE_FACT_DISMISS_SIGNAL`
108
+ * retractions, debounced, so the agent gets one chance to revise canvas content
109
+ * that assumed a now-removed fact (e.g. a size-scoped module). Never typed by the
110
+ * visitor — the session mints this itself and pushes it onto the mailbox with NO
111
+ * `agent_ack`, so the resulting turn stays silent in chat (see
112
+ * `AgentSession.flushFactDismissTurn`). Payload: `{ dismissed: Array<{ label: string; value: string }> }`.
113
+ */
114
+ export declare const PRESENCE_CANVAS_REFRESH_SIGNAL = "presence.canvas_refresh";
115
+ /**
116
+ * Client→agent handshake for the session STATE-AGREEMENT protocol
117
+ * (docs/session-state-agreement.md). Sent on EVERY connection open, before
118
+ * any snapshots: `payload.vector` is the client's `{ namespace → rev }`
119
+ * version vector for the client-leads state it publishes (cart, wishlist,
120
+ * …). The session stores it as the expectation of what the client holds —
121
+ * a namespace whose stored snapshot lags the vector is SYNCING (rendered
122
+ * as momentarily-unknown, never silently absent), and stragglers with a
123
+ * rev at or below the stored one are dropped at ingress. Full snapshots
124
+ * follow this signal immediately on the same socket.
125
+ */
126
+ export declare const CLIENT_STATE_HELLO_SIGNAL = "state.hello";
127
+ /**
128
+ * Open string — the wire schema doesn't enumerate kinds because new
129
+ * verticals (recipes, songs, properties, …) add their own freely.
130
+ * Today's ecommerce kinds (`product` / `article` / `collection` /
131
+ * `page` / `policy`) are conventions writers use, not a closed set
132
+ * the wire enforces.
133
+ */
134
+ export type EntityKind = string;
135
+ /**
136
+ * Compressed entity details. Vertical-agnostic: only the universal
137
+ * facets (gid, kind, title, url, description) are named fields.
138
+ * Domain-specific facets (price, vendor, author, publishedAt,
139
+ * ingredients, runtime, …) live in `meta` so the wire schema doesn't
140
+ * bake ecommerce — or any other vertical's shape — into a "generic"
141
+ * type.
142
+ *
143
+ * Writers populate `meta` with whatever facets their resolver emits.
144
+ * Readers (prompt builders, summary lines) dump `meta` as
145
+ * `key: value` pairs and let the LLM pick what's relevant — no
146
+ * formatter needs to know per-vertical field names.
147
+ */
148
+ export interface EntityRegistryEntry {
149
+ /** Platform-agnostic entity identifier — opaque string the resolver
150
+ * understands. Shopify uses `gid://shopify/...`, WooCommerce uses
151
+ * post ids, Square uses object ids — none of that is the wire's
152
+ * concern. The `id` is whatever the connector emitted. */
153
+ id: string;
154
+ kind: EntityKind;
155
+ title: string;
156
+ /** Canonical URL when known. */
157
+ url?: string;
158
+ /** Free-text description, capped by the writer. */
159
+ description?: string;
160
+ /** Vertical-specific facets. The wire doesn't constrain shape. */
161
+ meta?: Record<string, unknown>;
162
+ }
163
+ export interface TimingInfo {
164
+ total_ms: number;
165
+ session_ms: number;
166
+ validate_ms: number;
167
+ }
168
+ export interface UsageInfo {
169
+ input_tokens: number;
170
+ output_tokens: number;
171
+ /**
172
+ * Portion of `input_tokens` that was served from a provider prompt cache
173
+ * (Gemini `cachedContents` / Anthropic prompt cache).
174
+ *
175
+ * A SUBSET of `input_tokens`, never additional to it — Gemini's
176
+ * `promptTokenCount` already counts cached tokens, and
177
+ * `cachedContentTokenCount` reports how many of those were cache reads. Cost
178
+ * is therefore `(input_tokens - cache_read_tokens) * inputRate +
179
+ * cache_read_tokens * cachedRate`, where the cached rate is ~10% of input.
180
+ * Summing the two fields double-counts.
181
+ *
182
+ * Optional: absent for providers with no cache, for turns where caching was
183
+ * ineligible, and on rows written before this field existed.
184
+ */
185
+ cache_read_tokens?: number;
186
+ }
187
+ export interface ToolCall {
188
+ name: string;
189
+ input: Record<string, unknown>;
190
+ output: Record<string, unknown>;
191
+ duration_ms: number;
192
+ }
193
+ /**
194
+ * Which side owns a state namespace, per the session state-agreement
195
+ * protocol (docs/session-state-agreement.md §1).
196
+ *
197
+ * - `client-leads` device-local truth the client publishes (cart, wishlist)
198
+ * - `server-leads` derived by agent turns — the agent publishes, the
199
+ * client stores and reads
200
+ * - `server-merges` both sides hold revs; the server reconciles (layout)
201
+ */
202
+ export type StateNamespacePolicy = 'client-leads' | 'server-leads' | 'server-merges';
203
+ /**
204
+ * A rev-stamped namespace payload. ONE frame shape, both directions: the
205
+ * client sends these for `client-leads` namespaces and the agent sends them
206
+ * for `server-leads` ones. Wire type is `<namespace>.snapshot`.
207
+ *
208
+ * The rev is what makes the channel safe across reconnects: a receiver drops
209
+ * anything at or below the rev it already holds, so a straggler from a dead
210
+ * socket can never clobber fresher state.
211
+ */
212
+ export interface StateSnapshotFrame {
213
+ rev: number;
214
+ state: Record<string, unknown>;
215
+ }
216
+ /** Runtime guard for an inbound snapshot frame — the wire boundary. */
217
+ export declare const StateSnapshotFrameSchema: z.ZodObject<{
218
+ rev: z.ZodNumber;
219
+ state: z.ZodRecord<z.ZodString, z.ZodUnknown>;
220
+ }, "strip", z.ZodTypeAny, {
221
+ state: Record<string, unknown>;
222
+ rev: number;
223
+ }, {
224
+ state: Record<string, unknown>;
225
+ rev: number;
226
+ }>;
227
+ /** Wire type for a namespace snapshot — `<namespace>.snapshot`. */
228
+ export declare function stateSnapshotSignal(namespace: string): string;
229
+ /** The namespace part of a `<namespace>.snapshot` wire type, or null. */
230
+ export declare function namespaceFromSnapshotSignal(signalType: string): string | null;
231
+ /**
232
+ * The `server-leads` namespace that PRIMES ENTITY HYDRATION.
233
+ *
234
+ * A turn routinely resolves data the client is about to fetch again: the
235
+ * agent ran the retrieval, has the entities in hand, and then the surface
236
+ * renders and asks the network for the same thing. Publishing under this
237
+ * namespace hands them over instead — the hydration pass reads primed
238
+ * entities first and only fetches what is genuinely missing.
239
+ *
240
+ * It is deliberately NOT specific to any one surface or entity kind. The
241
+ * payload is keyed by the SAME `resolverKey` a component declares via
242
+ * `resolved()`, so anything the hydrator registry can resolve, the agent can
243
+ * prime. A new consumer needs no new channel, no new route, no new event.
244
+ */
245
+ export declare const ENTITY_PRIME_NAMESPACE = "entities";
246
+ /**
247
+ * `resolverKey → ref → entity`. Refs are the opaque ids the agent emits into
248
+ * `resolved()` props; entities are whatever that resolver's hydrator would
249
+ * have returned, and are schema-validated at the hydration boundary exactly
250
+ * as fetched ones are — priming is a shortcut for the FETCH, never for the
251
+ * validation.
252
+ */
253
+ export type EntityPrimePayload = Record<string, Record<string, unknown>>;
@@ -0,0 +1,45 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Inbound signal — the client requests the next batch when the scroll sentinel
4
+ * nears the viewport. Dispatched on its OWN background lane (NOT the foreground
5
+ * mailbox), so a visitor prompt never queues behind it.
6
+ */
7
+ export declare const VIEW_EXTEND_SIGNAL = "view.extend";
8
+ /** Why the continuation was requested — telemetry only; the agent composes the
9
+ * next batch from the focal context regardless. */
10
+ export declare const ViewExtendPayloadSchema: z.ZodObject<{
11
+ reason: z.ZodEnum<["scroll_near_bottom"]>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ reason: "scroll_near_bottom";
14
+ }, {
15
+ reason: "scroll_near_bottom";
16
+ }>;
17
+ export type ViewExtendPayload = z.infer<typeof ViewExtendPayloadSchema>;
18
+ /**
19
+ * Outbound signal — emitted when a continuation produced ZERO append ops: the
20
+ * agent judged there is nothing genuinely relevant left to add. The client
21
+ * correlates it to its single in-flight `view.extend` request, marks the active
22
+ * view complete, and stops triggering. Honesty over length — never padded to
23
+ * keep scrolling alive. No payload: the client owns the correlation (one extend
24
+ * in flight at a time), and re-arms when the visitor navigates views.
25
+ */
26
+ export declare const VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
27
+ /**
28
+ * PARKED (2026-08-20) — the master switch for scroll-continuation.
29
+ *
30
+ * The feature is complete and stays complete: the agent's continuation faculty,
31
+ * the per-view extend accounting, the append-merge, the loader foot and the
32
+ * exhaustion terminal are all untouched. What is unwired is the TRIGGER, in the
33
+ * two places that can start a continuation:
34
+ *
35
+ * - server: `AgentSession` does not register the `continuation` context
36
+ * reaction, so no `view.extend` is ever dispatched (`agent-session.ts`).
37
+ * - client: the canvas does not open the OPTIMISTIC extend foot on the
38
+ * near-bottom rising edge, so no loader appears (`use-viewport-focus.ts`).
39
+ *
40
+ * Both planes read THIS constant so there is one source of truth for whether a
41
+ * visitor can ever see a continuation — flip it to `true` to re-arm the feature
42
+ * whole. It lives on the wire contract because that is the module both the
43
+ * agent and the spacefront already depend on for the continuation protocol.
44
+ */
45
+ export declare const CONTINUATION_ENABLED = false;
@@ -0,0 +1,241 @@
1
+ /**
2
+ * Presence element contract — the typed, additive stream that replaces the
3
+ * single `AgentPresenceFrame`.
4
+ *
5
+ * Presence shows only what the canvas cannot: what the agent READ, what it
6
+ * INFERRED or RECALLED, what it could NOT do. The canvas shows the answer and
7
+ * the compose prose explains it, so anything presence adds beyond that negative
8
+ * space is duplication — and duplication is what reads as noise.
9
+ *
10
+ * Two properties make this a stream rather than a frame:
11
+ * - elements COEXIST (a source being read and a fact crystallizing out of it
12
+ * are simultaneously true; the old single-frame precedence ladder made that
13
+ * unrepresentable);
14
+ * - every element carries `turnId`, so a replayed or superseded element is
15
+ * dropped by IDENTITY rather than by guarding on an `isRunning` edge.
16
+ *
17
+ * Vertical-neutral (§VIII): `sourceKind` is an OPEN string declared by the tool
18
+ * that produced the records; core enumerates no kinds and names no vocabulary.
19
+ */
20
+ /** Closed kind vocabulary. Each kind carries its own typed payload — no bag. */
21
+ export type PresenceElementKind = 'source' | 'fact' | 'voice' | 'concession' | 'ask';
22
+ interface PresenceElementBase {
23
+ /** Stable identity — dedup across re-emits, and the renderer's animation key. */
24
+ id: string;
25
+ /**
26
+ * The turn that produced this element. Consumers drop elements whose turnId
27
+ * is not the live turn, which is what makes WS replay, reconnect mid-turn,
28
+ * turn adoption and HMR non-events instead of phantom-state bugs.
29
+ */
30
+ turnId: string;
31
+ kind: PresenceElementKind;
32
+ }
33
+ /** One entity inside a source element. */
34
+ export interface PresenceSourceRef {
35
+ id: string;
36
+ /**
37
+ * Absent for text-bearing kinds (reviews, policies, articles). The card form
38
+ * registered for a `sourceKind` must never REQUIRE imagery — a review has no
39
+ * thumbnail and is not thereby less real.
40
+ */
41
+ imageUrl?: string;
42
+ /**
43
+ * Per-record facets, as the §VIII.1 open bag — the universal layer carries a
44
+ * `meta: Record<string, unknown>`, never a vertical's field names.
45
+ *
46
+ * It exists because imagery is not the only thing that makes a record
47
+ * recognisable on sight. A review has no thumbnail, but it has a SCORE, and
48
+ * five cards reading 5/5/3/4/2 are five distinct candidates where five
49
+ * identical ruled pages are one fact printed five times. The registered card
50
+ * form for the kind is the only thing that knows which facet does that work
51
+ * for it, so it reads what it needs from here and core names none of it.
52
+ *
53
+ * Derived client-side from the tool result (`scan.ts`), so this costs no wire
54
+ * bytes; it is scalars only, and long strings are left out — a card is a
55
+ * silhouette, not a place to render prose.
56
+ */
57
+ meta?: Record<string, string | number | boolean>;
58
+ }
59
+ /**
60
+ * Something the agent read — one element per tool result set. This is the only
61
+ * element that is inherently transient: it exists to be superseded by the
62
+ * canvas.
63
+ */
64
+ export interface PresenceSourceElement extends PresenceElementBase {
65
+ kind: 'source';
66
+ /**
67
+ * The record kind these results represent, declared by the TOOL
68
+ * (`'product'`, `'review'`, `'collection'`, `'article'`, `'policy'`, or any
69
+ * brand-defined string). A registered card form per kind gives each source a
70
+ * distinct silhouette, so "it moved from products to reviews" is legible
71
+ * without a word of narration.
72
+ */
73
+ sourceKind: string;
74
+ refs: PresenceSourceRef[];
75
+ /**
76
+ * The ONE ref that stands for this lookup when it cannot be drawn record by
77
+ * record — a text-bearing kind (a policy, an article) whose records carry no
78
+ * imagery gets one card for the whole lookup instead of N identical ruled
79
+ * pages. Chosen when the result lands and never re-chosen.
80
+ *
81
+ * It is deliberately NOT `refs[0]` read live. `refs` is pruned to the chosen
82
+ * set once the canvas completes, so re-reading the head every render walks the
83
+ * card down whatever is left. Pinning the face makes that unrepresentable.
84
+ *
85
+ * Absent when the lookup returned records this renderer cannot draw (no id),
86
+ * and for a `pending` element, which has nothing to draw yet.
87
+ */
88
+ face?: PresenceSourceRef;
89
+ /**
90
+ * How many records this lookup accounted for — the tool's reported match
91
+ * count when it reports one, else the number of records it returned.
92
+ *
93
+ * ALWAYS set on a settled element, and never recomputed from `refs.length`,
94
+ * because `refs` is pruned to the chosen set at `canvas-complete`. A count
95
+ * derived from the live refs changes meaning halfway, from "what I read" to
96
+ * "what survived", and drops on screen while the visitor is reading it.
97
+ * Stamped once, it stays the first thing and only that.
98
+ */
99
+ total?: number;
100
+ /**
101
+ * Whether the lookup found anything. NEVER inferred from `refs.length === 0`:
102
+ * "returned nothing" and "returned records this renderer can't draw" are
103
+ * different facts, and conflating them reports a rendering gap to the visitor
104
+ * as "nothing exists". The tool is the only honest source for this.
105
+ *
106
+ * Meaningless while `pending` — a lookup still running has found nothing YET,
107
+ * which is not the same claim. See below.
108
+ */
109
+ found: boolean;
110
+ /**
111
+ * The lookup is STILL RUNNING — emitted from the tool's `running` event, with
112
+ * no refs and nothing yet known. Replaced in place (same `id`, the tool call
113
+ * id) the moment its `done` event lands.
114
+ *
115
+ * This is the difference between "the agent is looking at policies right now"
116
+ * and "the agent checked the policies and there was nothing" — the surface
117
+ * MUST NOT draw them the same way, and `found: false` alone cannot tell them
118
+ * apart. Without it a slow tool shows nothing at all while it runs, which is
119
+ * the long silence this field exists to end.
120
+ *
121
+ * Absent = settled. A settled element never carries `pending: true`.
122
+ */
123
+ pending?: boolean;
124
+ }
125
+ /**
126
+ * Something the agent understands.
127
+ *
128
+ * `tier` and `provenance` are BOTH deterministic producer-stamped metadata —
129
+ * never model-authored. A model that could stamp its own `provenance: 'recalled'`
130
+ * would be able to fabricate a memory of the visitor, which is the one lie this
131
+ * surface must structurally prevent.
132
+ */
133
+ export interface PresenceFactArtifact {
134
+ label: string;
135
+ value: string;
136
+ /** 'session' = learned this visit; 'profile' = durable, carried across visits. */
137
+ tier: 'session' | 'profile';
138
+ /**
139
+ * Where the fact came from — the keystone of the whole surface:
140
+ * - 'stated' the visitor said it THIS turn. Zero information; showing it
141
+ * back is a receipt, and receipts are the largest single source
142
+ * of "why is this here". Suppressed by the default profile.
143
+ * - 'inferred' the agent derived it. High information, and the thing a
144
+ * visitor most needs to be able to CORRECT (via the existing
145
+ * fact-dismiss signal).
146
+ * - 'recalled' known before this visit. This is "I remember you" — the trust
147
+ * reservoir, and currently indistinguishable from an echo.
148
+ */
149
+ provenance: 'stated' | 'inferred' | 'recalled';
150
+ /** Vertical-declared attribute bucket, from the same AttributeScopeConfig
151
+ * that scopes attribute keys (§VIII). Absent = universal. */
152
+ scope?: string;
153
+ }
154
+ /**
155
+ * A fact as it appears in the stream. The artifact above is what the producer
156
+ * DERIVES (and what `enrichPresenceFacts` returns); this adds only stream
157
+ * identity and the evidence edge, so the two never drift apart.
158
+ */
159
+ export interface PresenceFactElement extends PresenceElementBase, PresenceFactArtifact {
160
+ kind: 'fact';
161
+ /**
162
+ * Ids of the source elements this fact was derived from. Drives the
163
+ * crystallization edge: the visitor watches a belief precipitate out of the
164
+ * reviews that produced it. Optional — without it a fact still arrives, just
165
+ * with no visible line back to its evidence.
166
+ */
167
+ derivedFrom?: string[];
168
+ }
169
+ /**
170
+ * The agent speaking. Emitted ONLY when the space profile enables voice, so the
171
+ * silent-visual default costs zero prose tokens rather than generating text the
172
+ * renderer then discards.
173
+ */
174
+ export interface PresenceVoiceElement extends PresenceElementBase {
175
+ kind: 'voice';
176
+ text: string;
177
+ /** 'lead' = the turn's one line; 'aside' = a margin note beside an element. */
178
+ register: 'lead' | 'aside';
179
+ }
180
+ /**
181
+ * What the agent could NOT satisfy. The only element that outlives its turn,
182
+ * because the canvas structurally cannot express it: a canvas shows what IS
183
+ * there and can never show what isn't.
184
+ *
185
+ * This is also what makes the prompt's "name the trade-off, never silent-swap"
186
+ * rule enforceable rather than aspirational — a concession is a visible
187
+ * artifact, so a silent swap becomes structurally impossible to hide.
188
+ */
189
+ export interface PresenceConcessionElement extends PresenceElementBase {
190
+ kind: 'concession';
191
+ /** The constraint that gave way — matches a fact label when one exists, so
192
+ * the renderer can break the weight of that exact chip. */
193
+ label: string;
194
+ /** What was asked for. */
195
+ value: string;
196
+ /** What was substituted, when anything was. Absent = nothing was found. */
197
+ alternative?: string;
198
+ }
199
+ /** The agent needs the visitor before it can continue. */
200
+ export interface PresenceAskElement extends PresenceElementBase {
201
+ kind: 'ask';
202
+ question: string;
203
+ suggestions?: string[];
204
+ /** Signal id an answer should be dispatched on. */
205
+ signal?: string;
206
+ }
207
+ export type PresenceElement = PresenceSourceElement | PresenceFactElement | PresenceVoiceElement | PresenceConcessionElement | PresenceAskElement;
208
+ /**
209
+ * What a presence flow actually carries on `flow.output`.
210
+ *
211
+ * The CUMULATIVE element set for the live turn, re-sent whenever it grows —
212
+ * not a per-element append. The flow store has REPLACE semantics
213
+ * (`setFlowOutput` overwrites the slot), so an append protocol would lose
214
+ * elements to React batching coalescing two rapid emissions. Cumulative makes
215
+ * replace correct, reload-safe (sessionStorage holds a complete set, not a
216
+ * fragment), and idempotent under WS replay. Payloads are a handful of small
217
+ * objects, so the redundancy is free.
218
+ */
219
+ export interface PresenceStreamArtifact {
220
+ elements: PresenceElement[];
221
+ }
222
+ /** Whether a flow artifact is an element stream (vs. the legacy frame). */
223
+ export declare function isPresenceStreamArtifact(value: unknown): value is PresenceStreamArtifact;
224
+ export type PresenceRetireOn =
225
+ /** Per-ref: a layout_patch_op placed this entity — it became real. */
226
+ 'entity-materialized'
227
+ /** The turn's last patch landed. Backstop for every source element. */
228
+ | 'canvas-complete' | 'turn-settle' | 'next-turn-start' | 'answered'
229
+ /** Not retired by the turn; removed only by dismissal or session reset. */
230
+ | 'never';
231
+ export interface PresenceLifecycle {
232
+ retireOn: PresenceRetireOn;
233
+ /**
234
+ * Minimum on-screen time before an element may retire. A FLOOR that prevents
235
+ * a sub-perceptual flash — never control flow. The renderer applies it as an
236
+ * exit delay; the reducer ignores it entirely.
237
+ */
238
+ minVisibleMs?: number;
239
+ }
240
+ export declare const PRESENCE_LIFECYCLE: Record<PresenceElementKind, PresenceLifecycle>;
241
+ export {};
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Presence-widget contract — the frame + fact artifacts the presence WIDGET's
3
+ * two ends agree on across the flows framework. The producer (the presence
4
+ * faculty in `@fourty/agent`) emits frames on `flow.output{flowId}`; consumers
5
+ * (the notch/dossier renderers behind `useAgentFlow`) draw them. This is a
6
+ * WIDGET contract riding the generic flow channel — deliberately NOT part of
7
+ * the trace/event wire: infra transports it opaquely and never reads it.
8
+ */
9
+ /**
10
+ * One frame of agent presence — what the agent is doing/thinking right now,
11
+ * rendered by a registered presence FORM. Forms are open vocabulary: a brand
12
+ * can register 'dossier' (facts it holds), 'scanning' (cards it's flipping
13
+ * through), 'saved set', 'collection', 'reviews', etc. The agent emits a form
14
+ * id + opaque payload; it never knows what the form RENDERS (§VIII).
15
+ * `entityIds` resolve client-side via the same hydrators as the canvas, so
16
+ * any form can show real entities without the wire carrying vertical fields.
17
+ */
18
+ export interface AgentPresenceFrame {
19
+ /** Open form id — which registered presence renderer draws this frame. */
20
+ form: string;
21
+ /** Prose for text-bearing forms (the thought line, a caption). */
22
+ text?: string;
23
+ /** Entity ids the form renders — hydrated client-side like canvas refs. */
24
+ entityIds?: string[];
25
+ /** Form-specific structured payload the renderer understands; infra is opaque to it. */
26
+ data?: Record<string, unknown>;
27
+ }
28
+ /**
29
+ * Reserved INFRA presence form — the live "scanning" state (products being
30
+ * flipped through mid-search), carried as a frame ON the flow so it is per-flow
31
+ * like the held read: a producer emits `{ form: SCANNING_FORM, data: { thumbnails,
32
+ * count, queryHint } }` while it searches, then the held read frame. Lets any
33
+ * presence flow (the notch's `PRESENCE_FLOW`, the continuation's `EXTEND_FLOW`)
34
+ * carry its OWN scanning without a global, session-wide signal. Vertical-neutral
35
+ * (§VIII) — the fan renderer is infra, not a brand form. */
36
+ export declare const SCANNING_FORM = "scanning";
37
+ /**
38
+ * The fact artifact fact-bearing flows carry in `data.facts` — one dossier
39
+ * entry as the widget's two ends agree on it.
40
+ *
41
+ * `label` + `value` are the visitor-facing text. `tier` and `scope` are
42
+ * DETERMINISTIC producer-stamped metadata (matched against known slots,
43
+ * never model-authored) that let the renderer show memory honestly:
44
+ * - `tier`: 'session' = learned this visit (an ephemeral working note);
45
+ * 'profile' = carried/durable memory. Absent = 'session'.
46
+ * - `scope`: the vertical-declared attribute bucket the fact belongs to,
47
+ * from the SAME `AttributeScopeConfig` that scopes attribute keys
48
+ * (§VIII — config is data, core stays neutral). Absent = universal
49
+ * (budget, occasion): relevant in every context.
50
+ */
51
+ export interface PresenceFact {
52
+ label: string;
53
+ value: string;
54
+ tier?: 'session' | 'profile';
55
+ scope?: string;
56
+ }
@@ -0,0 +1,4 @@
1
+ export { type AgentPresenceFrame, type PresenceFact, SCANNING_FORM, } from './frame';
2
+ export { deriveSourceElement, pendingSourceElement, type SourceElementInput, type SourceLookupInput, } from './scan';
3
+ export { type PresenceElementKind, type PresenceElement, type PresenceSourceRef, type PresenceSourceElement, type PresenceFactArtifact, type PresenceFactElement, type PresenceVoiceElement, type PresenceConcessionElement, type PresenceAskElement, type PresenceRetireOn, type PresenceLifecycle, type PresenceStreamArtifact, isPresenceStreamArtifact, PRESENCE_LIFECYCLE, } from './element';
4
+ export { type PresenceProfile, PresenceProfileSchema, DEFAULT_PRESENCE_PROFILE } from './profile';