@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.
- package/dist/index.js +11918 -0
- package/dist/types/ecommerce/src/attribute-buckets.d.ts +79 -0
- package/dist/types/ecommerce/src/base-attributes.d.ts +42 -0
- package/dist/types/ecommerce/src/bucket-labels.d.ts +37 -0
- package/dist/types/ecommerce/src/cart-line-selections.d.ts +24 -0
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +1813 -0
- package/dist/types/ecommerce/src/format-variant-value.d.ts +1 -0
- package/dist/types/ecommerce/src/index.d.ts +13 -0
- package/dist/types/ecommerce/src/locale.d.ts +31 -0
- package/dist/types/ecommerce/src/optimistic-cart-line.d.ts +38 -0
- package/dist/types/ecommerce/src/pdp-companions.d.ts +21 -0
- package/dist/types/ecommerce/src/pick-product-card-action.d.ts +38 -0
- package/dist/types/ecommerce/src/product-lookup.d.ts +34 -0
- package/dist/types/ecommerce/src/projection-spec.d.ts +38 -0
- package/dist/types/ecommerce/src/review-schemas.d.ts +425 -0
- package/dist/types/sdk/src/analytics/consent.d.ts +52 -0
- package/dist/types/sdk/src/analytics/drops.d.ts +98 -0
- package/dist/types/sdk/src/analytics/emitting-scope.d.ts +2 -0
- package/dist/types/sdk/src/analytics/index.d.ts +12 -0
- package/dist/types/sdk/src/analytics/inert-scope.d.ts +2 -0
- package/dist/types/sdk/src/analytics/notify.d.ts +41 -0
- package/dist/types/sdk/src/analytics/outbox.d.ts +118 -0
- package/dist/types/sdk/src/analytics/scope-context.d.ts +24 -0
- package/dist/types/sdk/src/analytics/scope.d.ts +149 -0
- package/dist/types/sdk/src/analytics/surface.d.ts +77 -0
- package/dist/types/sdk/src/analytics/transport.d.ts +91 -0
- package/dist/types/sdk/src/animation/index.d.ts +2 -0
- package/dist/types/sdk/src/animation/useListTransition.d.ts +16 -0
- package/dist/types/sdk/src/animation/useUpdateTransition.d.ts +16 -0
- package/dist/types/sdk/src/canvas/ElementIdContext.d.ts +13 -0
- package/dist/types/sdk/src/canvas/GenerationStyleContext.d.ts +13 -0
- package/dist/types/sdk/src/canvas/ShimmerSweep.d.ts +18 -0
- package/dist/types/sdk/src/canvas/TransitionContext.d.ts +52 -0
- package/dist/types/sdk/src/canvas/canvas-arrangement.d.ts +20 -0
- package/dist/types/sdk/src/canvas/canvas-motion-style.d.ts +18 -0
- package/dist/types/sdk/src/canvas/canvas-outlet.d.ts +14 -0
- package/dist/types/sdk/src/canvas/canvas-tail.d.ts +31 -0
- package/dist/types/sdk/src/canvas/dom-targets.d.ts +140 -0
- package/dist/types/sdk/src/canvas/generation-entrance.d.ts +26 -0
- package/dist/types/sdk/src/canvas/generation-style.d.ts +62 -0
- package/dist/types/sdk/src/canvas/index.d.ts +21 -0
- package/dist/types/sdk/src/canvas/item-motion/ItemTransitionGroup.d.ts +72 -0
- package/dist/types/sdk/src/canvas/item-motion/classify-items.d.ts +24 -0
- package/dist/types/sdk/src/canvas/item-motion/index.d.ts +5 -0
- package/dist/types/sdk/src/canvas/item-motion/plugins/wipe.d.ts +11 -0
- package/dist/types/sdk/src/canvas/item-motion/profile.d.ts +77 -0
- package/dist/types/sdk/src/canvas/item-motion/wipe.d.ts +57 -0
- package/dist/types/sdk/src/canvas/nav-direction.d.ts +22 -0
- package/dist/types/sdk/src/canvas/runtime-context.d.ts +15 -0
- package/dist/types/sdk/src/canvas/runtime-hooks.d.ts +106 -0
- package/dist/types/sdk/src/canvas/runtime-types.d.ts +183 -0
- package/dist/types/sdk/src/canvas/scroll-event-target.d.ts +21 -0
- package/dist/types/sdk/src/canvas/turn-change-anchor.d.ts +34 -0
- package/dist/types/sdk/src/canvas/turn-edit.d.ts +8 -0
- package/dist/types/sdk/src/canvas/use-canvas-actions.d.ts +41 -0
- package/dist/types/sdk/src/canvas/use-fourty-layout.d.ts +19 -0
- package/dist/types/sdk/src/catalog/CatalogContext.d.ts +7 -0
- package/dist/types/sdk/src/catalog/DebugContext.d.ts +5 -0
- package/dist/types/sdk/src/catalog/HydrationStateContext.d.ts +45 -0
- package/dist/types/sdk/src/catalog/HydratorContext.d.ts +7 -0
- package/dist/types/sdk/src/catalog/component-library.d.ts +32 -0
- package/dist/types/sdk/src/catalog/define.d.ts +149 -0
- package/dist/types/sdk/src/catalog/hydrator-registry.d.ts +91 -0
- package/dist/types/sdk/src/catalog/index.d.ts +14 -0
- package/dist/types/sdk/src/catalog/interaction-contract.d.ts +78 -0
- package/dist/types/sdk/src/catalog/normalize-components.d.ts +17 -0
- package/dist/types/sdk/src/catalog/prose-value.d.ts +22 -0
- package/dist/types/sdk/src/catalog/registration/index.d.ts +4 -0
- package/dist/types/sdk/src/catalog/registration/register-component.d.ts +35 -0
- package/dist/types/sdk/src/catalog/registration/registry.d.ts +27 -0
- package/dist/types/sdk/src/catalog/registration/types.d.ts +83 -0
- package/dist/types/sdk/src/catalog/registry.d.ts +22 -0
- package/dist/types/sdk/src/catalog/render-inline.d.ts +39 -0
- package/dist/types/sdk/src/catalog/resolve-hydrators.d.ts +27 -0
- package/dist/types/sdk/src/chat/chat-context.d.ts +40 -0
- package/dist/types/sdk/src/chat/index.d.ts +1 -0
- package/dist/types/sdk/src/client-state/index.d.ts +2 -0
- package/dist/types/sdk/src/client-state/server-store.d.ts +38 -0
- package/dist/types/sdk/src/client-state/store.d.ts +20 -0
- package/dist/types/sdk/src/commerce/commerce-context.d.ts +62 -0
- package/dist/types/sdk/src/commerce/commerce-shapes.d.ts +170 -0
- package/dist/types/sdk/src/commerce/ecommerce/agentic-overlay.d.ts +27 -0
- package/dist/types/sdk/src/commerce/ecommerce/buy-now-exit.d.ts +36 -0
- package/dist/types/sdk/src/commerce/ecommerce/cart-action-failures.d.ts +54 -0
- package/dist/types/sdk/src/commerce/ecommerce/cart-drawer-store.d.ts +18 -0
- package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-reasons.d.ts +54 -0
- package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-shape.d.ts +73 -0
- package/dist/types/sdk/src/commerce/ecommerce/checkout-handoff-store.d.ts +39 -0
- package/dist/types/sdk/src/commerce/ecommerce/comparison-rows.d.ts +30 -0
- package/dist/types/sdk/src/commerce/ecommerce/index.d.ts +21 -0
- package/dist/types/sdk/src/commerce/ecommerce/normalize-collection.d.ts +17 -0
- package/dist/types/sdk/src/commerce/ecommerce/preselect-from-facts.d.ts +25 -0
- package/dist/types/sdk/src/commerce/ecommerce/product-filters.d.ts +40 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-buy-now.d.ts +33 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-cart-drawer.d.ts +35 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-cart-line-row.d.ts +30 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-comparison-table.d.ts +22 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-look-card.d.ts +80 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-product-card.d.ts +62 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-product-carousel-scroll.d.ts +13 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-product-detail.d.ts +48 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-product-grid-filter.d.ts +17 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-selected-variants-state.d.ts +8 -0
- package/dist/types/sdk/src/commerce/ecommerce/use-wishlist-drawer.d.ts +34 -0
- package/dist/types/sdk/src/commerce/ecommerce/variant-option-axes.d.ts +56 -0
- package/dist/types/sdk/src/commerce/ecommerce/variant-resolution.d.ts +83 -0
- package/dist/types/sdk/src/commerce/ecommerce/variant-selection.d.ts +22 -0
- package/dist/types/sdk/src/commerce/external-navigation.d.ts +41 -0
- package/dist/types/sdk/src/commerce/index.d.ts +9 -0
- package/dist/types/sdk/src/commerce/option-selection-store.d.ts +8 -0
- package/dist/types/sdk/src/commerce/pending-variant-choice-store.d.ts +20 -0
- package/dist/types/sdk/src/commerce/variant-selection-store.d.ts +7 -0
- package/dist/types/sdk/src/content/index.d.ts +2 -0
- package/dist/types/sdk/src/content/use-faq-accordion.d.ts +11 -0
- package/dist/types/sdk/src/content/use-newsletter-form.d.ts +16 -0
- package/dist/types/sdk/src/host/Spacefront.d.ts +11 -0
- package/dist/types/sdk/src/host/engine-loader.d.ts +14 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +5833 -0
- package/dist/types/sdk/src/host/index.d.ts +4 -0
- package/dist/types/sdk/src/host/types.d.ts +52 -0
- package/dist/types/sdk/src/index.d.ts +21 -0
- package/dist/types/sdk/src/interaction/haptics.d.ts +8 -0
- package/dist/types/sdk/src/interaction/index.d.ts +3 -0
- package/dist/types/sdk/src/interaction/normalize-signals.d.ts +8 -0
- package/dist/types/sdk/src/interaction/withInteractionTracking.d.ts +48 -0
- package/dist/types/sdk/src/npm.d.ts +3 -0
- package/dist/types/sdk/src/projection/ProjectionSignalBridge.d.ts +5 -0
- package/dist/types/sdk/src/projection/index.d.ts +1 -0
- package/dist/types/sdk/src/projection/preferences.d.ts +12 -0
- package/dist/types/sdk/src/projection/transform.d.ts +7 -0
- package/dist/types/sdk/src/provider/AgentAsk.d.ts +16 -0
- package/dist/types/sdk/src/provider/index.d.ts +4 -0
- package/dist/types/sdk/src/provider/providers/handler-registry.d.ts +11 -0
- package/dist/types/sdk/src/provider/use-clamp-toggle.d.ts +22 -0
- package/dist/types/sdk/src/provider/use-timed-flag.d.ts +16 -0
- package/dist/types/sdk/src/rendering/index.d.ts +1 -0
- package/dist/types/sdk/src/rendering/post-hydration.d.ts +37 -0
- package/dist/types/sdk/src/session/FourtySessionContext.d.ts +228 -0
- package/dist/types/sdk/src/session/clear-registry.d.ts +6 -0
- package/dist/types/sdk/src/session/index.d.ts +4 -0
- package/dist/types/sdk/src/session/use-action.d.ts +25 -0
- package/dist/types/sdk/src/session/visitor-locale.d.ts +2 -0
- package/dist/types/sdk/src/shared/index.d.ts +2 -0
- package/dist/types/sdk/src/shared/use-expandable.d.ts +9 -0
- package/dist/types/sdk/src/shared/use-image-hover.d.ts +13 -0
- package/dist/types/sdk/src/shell/ScrollContainerContext.d.ts +25 -0
- package/dist/types/sdk/src/shell/ShellRegistry.d.ts +25 -0
- package/dist/types/sdk/src/shell/ShellRootContext.d.ts +15 -0
- package/dist/types/sdk/src/shell/dock-persistence.d.ts +49 -0
- package/dist/types/sdk/src/shell/exclusive-overlay.d.ts +16 -0
- package/dist/types/sdk/src/shell/index.d.ts +12 -0
- package/dist/types/sdk/src/shell/thread-scroll/ThreadHeadroom.d.ts +11 -0
- package/dist/types/sdk/src/shell/thread-scroll/headroom.d.ts +4 -0
- package/dist/types/sdk/src/shell/thread-scroll/index.d.ts +6 -0
- package/dist/types/sdk/src/shell/thread-scroll/pin-turn-head.d.ts +12 -0
- package/dist/types/sdk/src/shell/thread-scroll/settle-thread-row.d.ts +23 -0
- package/dist/types/sdk/src/shell/thread-scroll/thread-geometry.d.ts +27 -0
- package/dist/types/sdk/src/shell/thread-scroll/thread-row-attr.d.ts +4 -0
- package/dist/types/sdk/src/shell/thread-scroll/use-pin-turn-to-top.d.ts +22 -0
- package/dist/types/sdk/src/shell/thread-scroll/use-scroll-has-more-below.d.ts +19 -0
- package/dist/types/sdk/src/shell/thread-scroll/use-thread-jump-marks.d.ts +28 -0
- package/dist/types/sdk/src/shell/thread-scroll/use-thread-landing.d.ts +1 -0
- package/dist/types/sdk/src/shell/use-composer-chip-select.d.ts +21 -0
- package/dist/types/sdk/src/shell/use-go-home.d.ts +11 -0
- package/dist/types/sdk/src/shell/use-hydrated.d.ts +19 -0
- package/dist/types/sdk/src/shell/use-menu-item-select.d.ts +13 -0
- package/dist/types/sdk/src/shell/use-overridable-toggle.d.ts +24 -0
- package/dist/types/sdk/src/shell/use-thread-rows.d.ts +41 -0
- package/dist/types/sdk/src/social/index.d.ts +2 -0
- package/dist/types/sdk/src/social/use-review-helpful.d.ts +10 -0
- package/dist/types/sdk/src/social/use-testimonials-carousel.d.ts +15 -0
- package/dist/types/sdk/src/utils/core-utils/format-distance.d.ts +6 -0
- package/dist/types/sdk/src/utils/core-utils/format-price.d.ts +7 -0
- package/dist/types/sdk/src/utils/core-utils/index.d.ts +10 -0
- package/dist/types/sdk/src/utils/core-utils/inject-google-fonts.d.ts +17 -0
- package/dist/types/sdk/src/utils/core-utils/is-on-sale.d.ts +6 -0
- package/dist/types/sdk/src/utils/core-utils/is-video-url.d.ts +6 -0
- package/dist/types/sdk/src/utils/core-utils/maps-directions-url.d.ts +5 -0
- package/dist/types/sdk/src/utils/core-utils/mint-id.d.ts +10 -0
- package/dist/types/sdk/src/utils/core-utils/resolve-swatch-color.d.ts +2 -0
- package/dist/types/sdk/src/utils/core-utils/validate-all.d.ts +13 -0
- package/dist/types/sdk/src/utils/index.d.ts +10 -0
- package/dist/types/sdk/src/utils/storage.d.ts +9 -0
- package/dist/types/sdk/src/utils/use-document-visible.d.ts +9 -0
- package/dist/types/sdk/src/utils/use-form-factor.d.ts +24 -0
- package/dist/types/sdk/src/utils/use-inline-completion.d.ts +48 -0
- package/dist/types/sdk/src/utils/use-interval.d.ts +7 -0
- package/dist/types/sdk/src/utils/use-success-flash.d.ts +35 -0
- package/dist/types/sdk/src/utils/use-wake-lock.d.ts +15 -0
- package/dist/types/sdk/src/utils/viewport-window.d.ts +39 -0
- package/dist/types/sdk/src/voice/index.d.ts +2 -0
- package/dist/types/sdk/src/voice/use-dictation.d.ts +80 -0
- package/dist/types/sdk/src/voice/use-voice-capture.d.ts +65 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/fact-form-registry.d.ts +43 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/fact-shape.d.ts +70 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/form-registry.d.ts +28 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/knowledge.d.ts +18 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/presence-restore.d.ts +13 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/presence-stream.d.ts +64 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/source-form-registry.d.ts +129 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/standing-signal-store.d.ts +19 -0
- package/dist/types/sdk/src/widgets/presence/flows/flow-store.d.ts +22 -0
- package/dist/types/sdk/src/widgets/presence/index.d.ts +17 -0
- package/dist/types/sdk/src/widgets/presence/runtime-context.d.ts +109 -0
- package/dist/types/sdk/src/widgets/presence/use-layout-entity-ids.d.ts +12 -0
- package/dist/types/sdk/src/widgets/presence/use-optimistic-facts.d.ts +43 -0
- package/dist/types/sdk/src/widgets/presence/use-optimistic-flow-set.d.ts +24 -0
- package/dist/types/sdk/src/widgets/presence/use-presence-notch.d.ts +75 -0
- package/dist/types/sdk/src/widgets/presence/use-presence.d.ts +45 -0
- package/dist/types/sdk/src/widgets/presence/use-standing-signal.d.ts +12 -0
- package/dist/types/spacestation/src/analytics/catalog.d.ts +89 -0
- package/dist/types/spacestation/src/analytics/ecommerce/events.d.ts +183 -0
- package/dist/types/spacestation/src/analytics/ecommerce/funnel.d.ts +22 -0
- package/dist/types/spacestation/src/analytics/ecommerce/index.d.ts +14 -0
- package/dist/types/spacestation/src/analytics/ecommerce/surfacing.d.ts +42 -0
- package/dist/types/spacestation/src/analytics/envelope.d.ts +222 -0
- package/dist/types/spacestation/src/analytics/index.d.ts +28 -0
- package/dist/types/spacestation/src/analytics/kind.d.ts +155 -0
- package/dist/types/spacestation/src/analytics/session.d.ts +35 -0
- package/dist/types/spacestation/src/attachment/attachment.d.ts +83 -0
- package/dist/types/spacestation/src/catalog/attribute-registry.d.ts +148 -0
- package/dist/types/spacestation/src/catalog/attribute-scope.d.ts +41 -0
- package/dist/types/spacestation/src/catalog/canvas-arrangement.d.ts +43 -0
- package/dist/types/spacestation/src/catalog/catalog-schemas.d.ts +264 -0
- package/dist/types/spacestation/src/catalog/config.d.ts +13 -0
- package/dist/types/spacestation/src/catalog/derive-props-doc.d.ts +11 -0
- package/dist/types/spacestation/src/catalog/element-filled.d.ts +77 -0
- package/dist/types/spacestation/src/catalog/entity-refs.d.ts +14 -0
- package/dist/types/spacestation/src/catalog/function-props.d.ts +23 -0
- package/dist/types/spacestation/src/catalog/hydration-paths.d.ts +19 -0
- package/dist/types/spacestation/src/catalog/prose.d.ts +60 -0
- package/dist/types/spacestation/src/catalog/ref-sites.d.ts +45 -0
- package/dist/types/spacestation/src/catalog/required-props.d.ts +31 -0
- package/dist/types/spacestation/src/catalog/resolved.d.ts +145 -0
- package/dist/types/spacestation/src/catalog/structural-baseline.d.ts +7 -0
- package/dist/types/spacestation/src/catalog/wire/catalog-wire.d.ts +191 -0
- package/dist/types/spacestation/src/catalog/wire/index.d.ts +5 -0
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +351 -0
- package/dist/types/spacestation/src/catalog/wire/schema-from-wire.d.ts +7 -0
- package/dist/types/spacestation/src/catalog/wire/schema-to-wire.d.ts +8 -0
- package/dist/types/spacestation/src/catalog/wire/wire-schema.d.ts +78 -0
- package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +125 -0
- package/dist/types/spacestation/src/commerce/cart-state.d.ts +87 -0
- package/dist/types/spacestation/src/commerce/cart-verb-signals.d.ts +80 -0
- package/dist/types/spacestation/src/commerce/page-kinds.d.ts +40 -0
- package/dist/types/spacestation/src/commerce/selection-signal.d.ts +25 -0
- package/dist/types/spacestation/src/contracts/entry-context.d.ts +35 -0
- package/dist/types/spacestation/src/contracts/knowledge/index.d.ts +12 -0
- package/dist/types/spacestation/src/contracts/knowledge/types.d.ts +238 -0
- package/dist/types/spacestation/src/contracts/retrieval/core/knowledge-source.d.ts +36 -0
- package/dist/types/spacestation/src/contracts/retrieval/core/platform-connector.d.ts +49 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/articles/source.d.ts +3 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/articles/types.d.ts +29 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/client.d.ts +238 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/collections/source.d.ts +3 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/collections/types.d.ts +23 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/connector.d.ts +11 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/domains.d.ts +27 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/faq/source.d.ts +3 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/faq/types.d.ts +21 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/option-values.d.ts +71 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/policies/source.d.ts +3 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/policies/types.d.ts +18 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/products/source.d.ts +5 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/products/types.d.ts +47 -0
- package/dist/types/spacestation/src/contracts/retrieval/index.d.ts +25 -0
- package/dist/types/spacestation/src/contracts/session-arrival-params.d.ts +32 -0
- package/dist/types/spacestation/src/contracts/session-arrival.d.ts +215 -0
- package/dist/types/spacestation/src/contracts/tools/definitions.d.ts +139 -0
- package/dist/types/spacestation/src/contracts/tools/execution-context.d.ts +135 -0
- package/dist/types/spacestation/src/contracts/tools/index.d.ts +9 -0
- package/dist/types/spacestation/src/contracts/tools/types.d.ts +163 -0
- package/dist/types/spacestation/src/focus/focus.d.ts +12 -0
- package/dist/types/spacestation/src/hydration/hydration.d.ts +46 -0
- package/dist/types/spacestation/src/index.d.ts +71 -0
- package/dist/types/spacestation/src/layout/apply-patch.d.ts +17 -0
- package/dist/types/spacestation/src/layout/conversation.d.ts +136 -0
- package/dist/types/spacestation/src/layout/layout-diff.d.ts +17 -0
- package/dist/types/spacestation/src/layout/layout.d.ts +275 -0
- package/dist/types/spacestation/src/layout/page.d.ts +244 -0
- package/dist/types/spacestation/src/layout/patch.d.ts +92 -0
- package/dist/types/spacestation/src/layout/reduce-patch.d.ts +19 -0
- package/dist/types/spacestation/src/layout/reserved-ids.d.ts +13 -0
- package/dist/types/spacestation/src/projection/projection.d.ts +249 -0
- package/dist/types/spacestation/src/shell/shell.d.ts +109 -0
- package/dist/types/spacestation/src/signal/agent-signals.d.ts +539 -0
- package/dist/types/spacestation/src/space/connector.d.ts +61 -0
- package/dist/types/spacestation/src/space/generation-job.d.ts +4 -0
- package/dist/types/spacestation/src/space/hosting.d.ts +36 -0
- package/dist/types/spacestation/src/space/manifest.d.ts +8 -0
- package/dist/types/spacestation/src/space/package-version.d.ts +18 -0
- package/dist/types/spacestation/src/space/package.d.ts +35 -0
- package/dist/types/spacestation/src/space/prompt-config.d.ts +17 -0
- package/dist/types/spacestation/src/space/session-activity.d.ts +71 -0
- package/dist/types/spacestation/src/space/session-queue.d.ts +2147 -0
- package/dist/types/spacestation/src/space/space-config.d.ts +96 -0
- package/dist/types/spacestation/src/space/space-otp.d.ts +18 -0
- package/dist/types/spacestation/src/space/space.d.ts +104 -0
- package/dist/types/spacestation/src/space/tool-manifest.d.ts +8 -0
- package/dist/types/spacestation/src/space/trace.d.ts +555 -0
- package/dist/types/spacestation/src/space/workspace-catalog.d.ts +112 -0
- package/dist/types/spacestation/src/tool-compression/compress.d.ts +88 -0
- package/dist/types/spacestation/src/tool-compression/index.d.ts +11 -0
- package/dist/types/spacestation/src/tool-compression/scoring.d.ts +38 -0
- package/dist/types/spacestation/src/tool-compression/tokenize.d.ts +29 -0
- package/dist/types/spacestation/src/trace/trace-data.d.ts +126 -0
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +224 -0
- package/dist/types/spacestation/src/trace/trace-envelopes.d.ts +144 -0
- package/dist/types/spacestation/src/trace/trace-events.d.ts +450 -0
- package/dist/types/spacestation/src/types.d.ts +253 -0
- package/dist/types/spacestation/src/view/continuation.d.ts +45 -0
- package/dist/types/spacestation/src/widgets/presence/element.d.ts +241 -0
- package/dist/types/spacestation/src/widgets/presence/frame.d.ts +56 -0
- package/dist/types/spacestation/src/widgets/presence/index.d.ts +4 -0
- package/dist/types/spacestation/src/widgets/presence/profile.d.ts +75 -0
- package/dist/types/spacestation/src/widgets/presence/scan.d.ts +45 -0
- package/package.json +43 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props every shell component receives. The shell composes the entire
|
|
4
|
+
* spacefront layout (canvas, chat, persistent chrome) using primitives
|
|
5
|
+
* exported from `@fourty/ui`. SpaceFront sets up the positioning context
|
|
6
|
+
* and provider stack; the shell decides what's inside.
|
|
7
|
+
*/
|
|
8
|
+
export interface ShellComponentProps {
|
|
9
|
+
/** Called when the user clicks "Clear" in the chat. */
|
|
10
|
+
onClear?: () => void;
|
|
11
|
+
}
|
|
12
|
+
/** A shell component renders the full inner layout of a spacefront. */
|
|
13
|
+
export type ShellComponent = React.ComponentType<ShellComponentProps>;
|
|
14
|
+
/**
|
|
15
|
+
* Map of shell-name → shell component. Brand UI packages register entries
|
|
16
|
+
* to provide alternate shells (e.g. brand-styled header w/ logo + cart, bottom
|
|
17
|
+
* nav, multi-column variant). SpaceFront resolves the active shell name from
|
|
18
|
+
* the per-space config (or `'default'` when absent) and renders.
|
|
19
|
+
*/
|
|
20
|
+
export type ShellRegistry = Record<string, ShellComponent>;
|
|
21
|
+
export declare function ShellRegistryProvider({ registry, children, }: {
|
|
22
|
+
registry: ShellRegistry;
|
|
23
|
+
children: React.ReactNode;
|
|
24
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare function useShellRegistry(): ShellRegistry;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The shell root is the positioned ancestor that absolutely-positioned
|
|
3
|
+
* overlays (cart drawer, modals, sheets) measure against. Setting it via
|
|
4
|
+
* context lets a host app embed SpaceFront in any container — admin
|
|
5
|
+
* playground preview pane, public route, isolated iframe — and have every
|
|
6
|
+
* overlay scoped to that container instead of escaping to the document.
|
|
7
|
+
*
|
|
8
|
+
* The ref points to a DOM element that has `position: relative; overflow:
|
|
9
|
+
* hidden`. SpaceFront sets this. Components that need to portal an overlay
|
|
10
|
+
* read it via `useShellRoot()` and pass `ref.current` to `createPortal`.
|
|
11
|
+
*
|
|
12
|
+
* `null` means no portal target available — render inline as a fallback.
|
|
13
|
+
*/
|
|
14
|
+
export declare const ShellRootContext: import("react").Context<import("react").RefObject<HTMLElement | null> | null>;
|
|
15
|
+
export declare function useShellRoot(): HTMLElement | null;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* The side dock's open state ACROSS RELOADS — the seam between the host that
|
|
4
|
+
* can persist it and the shell that owns it.
|
|
5
|
+
*
|
|
6
|
+
* The shell derives the dock's default from live session state (has the
|
|
7
|
+
* visitor chatted, have they navigated — `useHasLeftSeedHome`). None of that
|
|
8
|
+
* exists during the server render, and it does not exist on the first client
|
|
9
|
+
* render either: it arrives when the session runtime restores. So a returning
|
|
10
|
+
* visitor's page painted with the dock SHUT and then snapped it open a few
|
|
11
|
+
* hundred milliseconds later, shoving the canvas sideways — the page appeared
|
|
12
|
+
* to reload itself into a different layout.
|
|
13
|
+
*
|
|
14
|
+
* The fix is to let the render that paints first already know. Only the host
|
|
15
|
+
* can carry that across a reload (the platform keeps it in a cookie, which is
|
|
16
|
+
* the one store a server render can read), and only the shell knows what the
|
|
17
|
+
* state currently is — hence a seam rather than a store on either side.
|
|
18
|
+
*
|
|
19
|
+
* A host that persists nothing supplies nothing: `initialOpen` is `null` (no
|
|
20
|
+
* answer) and `onOpenChange` is a no-op, which leaves the shell on exactly its
|
|
21
|
+
* pre-existing behaviour.
|
|
22
|
+
*/
|
|
23
|
+
export interface DockPersistence {
|
|
24
|
+
/**
|
|
25
|
+
* The dock's open state as of the visitor's last visit, known at FIRST
|
|
26
|
+
* render — server included. Seeds the shell's engagement latch, so the
|
|
27
|
+
* first paint is already the final layout.
|
|
28
|
+
*
|
|
29
|
+
* `null` means the host has NO answer — it persists nothing, or this visitor
|
|
30
|
+
* has no stored state yet. That is a third state, not a synonym for closed:
|
|
31
|
+
* with an answer in hand the shell trusts it over history it replays a moment
|
|
32
|
+
* later (so a deliberate fold survives a reload); with none it falls back to
|
|
33
|
+
* deriving the dock from session state exactly as it always has.
|
|
34
|
+
*/
|
|
35
|
+
initialOpen: boolean | null;
|
|
36
|
+
/** Reports the dock's effective open state whenever it changes, so the host
|
|
37
|
+
* can persist it for the next load. Must be referentially stable. */
|
|
38
|
+
onOpenChange: (open: boolean) => void;
|
|
39
|
+
}
|
|
40
|
+
export declare function DockPersistenceProvider({ value, children, }: {
|
|
41
|
+
value: DockPersistence;
|
|
42
|
+
children: React.ReactNode;
|
|
43
|
+
}): React.ReactElement;
|
|
44
|
+
/**
|
|
45
|
+
* Read the dock-persistence seam. Never throws: a shell mounted by a host that
|
|
46
|
+
* does not persist dock state is a supported configuration (the dev lab, the
|
|
47
|
+
* eval canvas, an embed), and it gets the cold default.
|
|
48
|
+
*/
|
|
49
|
+
export declare function useDockPersistence(): DockPersistence;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Register an overlay's closer under a stable id. Returns the unregister
|
|
3
|
+
* cleanup (safe against a newer registration having replaced this one).
|
|
4
|
+
* Module-store overlays register once at module scope; component-state
|
|
5
|
+
* overlays should use `useExclusiveOverlay` instead.
|
|
6
|
+
*/
|
|
7
|
+
export declare function registerExclusiveOverlay(id: string, close: () => void): () => void;
|
|
8
|
+
/** Claim the modal layer for `id`: every OTHER registered overlay is closed.
|
|
9
|
+
* Call at the moment the overlay opens. */
|
|
10
|
+
export declare function claimExclusiveOverlay(id: string): void;
|
|
11
|
+
/**
|
|
12
|
+
* React binding for a component-state overlay: keeps the closer registered
|
|
13
|
+
* for the component's lifetime and claims the layer on each closed → open
|
|
14
|
+
* edge. The closer rides a ref so a re-render never re-registers.
|
|
15
|
+
*/
|
|
16
|
+
export declare function useExclusiveOverlay(id: string, open: boolean, close: () => void): void;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export { ScrollContainerProvider, useScrollContainerRef, type ScrollContainerRef, } from './ScrollContainerContext';
|
|
2
|
+
export { ShellRegistryProvider, useShellRegistry, type ShellComponentProps, type ShellComponent, type ShellRegistry, } from './ShellRegistry';
|
|
3
|
+
export { ShellRootContext, useShellRoot } from './ShellRootContext';
|
|
4
|
+
export { DockPersistenceProvider, useDockPersistence, type DockPersistence, } from './dock-persistence';
|
|
5
|
+
export { registerExclusiveOverlay, claimExclusiveOverlay, useExclusiveOverlay, } from './exclusive-overlay';
|
|
6
|
+
export { useComposerChipSelect } from './use-composer-chip-select';
|
|
7
|
+
export { useGoHome } from './use-go-home';
|
|
8
|
+
export { useHydrated } from './use-hydrated';
|
|
9
|
+
export { useMenuItemSelect } from './use-menu-item-select';
|
|
10
|
+
export { useOverridableToggle, type OverridableToggle } from './use-overridable-toggle';
|
|
11
|
+
export { useThreadRows, type ThreadRow, type ThreadRows } from './use-thread-rows';
|
|
12
|
+
export { ThreadHeadroom, usePinTurnToTop, useScrollHasMoreBelow, useThreadJumpMarks, useThreadLanding, THREAD_ROW_ATTR, threadRowAttrs, type PinTurnToTopOptions, type ThreadJumpMark, } from './thread-scroll';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Scroll headroom for the thread — an empty spacer `pinTurnHead` sizes
|
|
4
|
+
* imperatively so the live turn's head can always reach the top of the
|
|
5
|
+
* scrollport, even as the log's last (and shorter-than-scrollport) row.
|
|
6
|
+
*
|
|
7
|
+
* Render it as the LAST child of the thread scroller. The scroller itself must
|
|
8
|
+
* be positioned (`relative`/`absolute`); the pin measures row offsets against
|
|
9
|
+
* it as their offset parent.
|
|
10
|
+
*/
|
|
11
|
+
export declare function ThreadHeadroom(): React.ReactElement;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Marks the thread scroller's tail spacer. Rendered by `<ThreadHeadroom/>`. */
|
|
2
|
+
export declare const THREAD_HEADROOM_ATTR = "data-fourty-thread-headroom";
|
|
3
|
+
/** The thread scroller's tail spacer, or null when the surface renders none. */
|
|
4
|
+
export declare function findThreadHeadroom(scroller: HTMLElement): HTMLElement | null;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ThreadHeadroom } from './ThreadHeadroom';
|
|
2
|
+
export { usePinTurnToTop, type PinTurnToTopOptions } from './use-pin-turn-to-top';
|
|
3
|
+
export { useScrollHasMoreBelow } from './use-scroll-has-more-below';
|
|
4
|
+
export { THREAD_ROW_ATTR, threadRowAttrs } from './thread-row-attr';
|
|
5
|
+
export { useThreadJumpMarks, type ThreadJumpMark } from './use-thread-jump-marks';
|
|
6
|
+
export { useThreadLanding } from './use-thread-landing';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export type CancelPin = () => void;
|
|
2
|
+
export interface PinTurnHeadOptions {
|
|
3
|
+
/** True once the visitor scrolled since the turn armed. The pin then yields. */
|
|
4
|
+
hasVisitorTakenOver: () => boolean;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Glide `row`'s top to the scroller's anchor line (its top edge plus
|
|
8
|
+
* `scroll-padding-top`) and hold it there for the life of the turn.
|
|
9
|
+
*
|
|
10
|
+
* Returns a cancel fn — call it when the turn ends or the surface unmounts.
|
|
11
|
+
*/
|
|
12
|
+
export declare function pinTurnHead(scroller: HTMLElement, row: HTMLElement, options: PinTurnHeadOptions): CancelPin;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type CancelSettle = () => void;
|
|
2
|
+
/**
|
|
3
|
+
* Glide the row stamped `THREAD_ROW_ATTR={rowKey}` to the scroller's anchor
|
|
4
|
+
* line and hold it there through the settling of the rows above it.
|
|
5
|
+
*
|
|
6
|
+
* Returns a cancel fn — call it when the target changes or the surface
|
|
7
|
+
* unmounts. Safe to call when the row is absent: it keeps looking for
|
|
8
|
+
* `FIND_MS`, then gives up silently (a brand that has not stamped
|
|
9
|
+
* `threadRowAttrs` on its rows simply gets no thread scroll, never a jump to
|
|
10
|
+
* the wrong place).
|
|
11
|
+
*
|
|
12
|
+
* A visitor scroll (wheel / touch) ends the settle immediately — never yank a
|
|
13
|
+
* reading visitor.
|
|
14
|
+
*/
|
|
15
|
+
export declare function settleThreadRow(scroller: HTMLElement, rowKey: string,
|
|
16
|
+
/**
|
|
17
|
+
* How the row gets to the anchor line. `'smooth'` for a live pick — the
|
|
18
|
+
* visitor is travelling from somewhere and the glide is what tells them so.
|
|
19
|
+
* `'instant'` for an ARRIVAL: on a page load there is no previous position to
|
|
20
|
+
* travel from, so an animated scroll is motion from a place the visitor was
|
|
21
|
+
* never at. They asked to land on it, not to watch it being found.
|
|
22
|
+
*/
|
|
23
|
+
behavior?: ScrollBehavior): CancelSettle;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { layoutTopWithin } from '../../canvas/dom-targets';
|
|
2
|
+
export { layoutTopWithin };
|
|
3
|
+
/** A scroller's `padding-bottom` in px — part of its scrollable content height. */
|
|
4
|
+
export declare function paddingBottomOf(view: Window, scroller: HTMLElement): number;
|
|
5
|
+
/**
|
|
6
|
+
* The scroll offset that puts `row`'s top on the scroller's anchor line — its
|
|
7
|
+
* top edge plus `scroll-padding-top` (the dock header strip overlaying the
|
|
8
|
+
* thread).
|
|
9
|
+
*/
|
|
10
|
+
export declare function desiredTopFor(row: HTMLElement, scroller: HTMLElement): number;
|
|
11
|
+
/**
|
|
12
|
+
* Size the tail spacer so `desired` is a scroll offset the scroller can
|
|
13
|
+
* actually REACH.
|
|
14
|
+
*
|
|
15
|
+
* A row near the end of the log is usually shorter than the scrollport, so no
|
|
16
|
+
* scroll position brings its top to the top — the scroll clamps at max and the
|
|
17
|
+
* head lands halfway down. The spacer absorbs exactly that deficit. It is the
|
|
18
|
+
* scroller's last child, so everything above it — including its own
|
|
19
|
+
* `offsetTop` — is independent of the height written here, and resizing can
|
|
20
|
+
* never feed back.
|
|
21
|
+
*
|
|
22
|
+
* A row with plenty of content below it needs no reservation: `required`
|
|
23
|
+
* computes negative and clamps to zero.
|
|
24
|
+
*
|
|
25
|
+
* No-ops when the surface renders no `<ThreadHeadroom/>`.
|
|
26
|
+
*/
|
|
27
|
+
export declare function reserveHeadroomFor(view: Window, scroller: HTMLElement, desired: number): void;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** Marks a thread row's root DOM node, valued with that row's `ThreadRow.key`. */
|
|
2
|
+
export declare const THREAD_ROW_ATTR = "data-fourty-thread-row";
|
|
3
|
+
/** Spread onto a row component's root node: `{...threadRowAttrs(row.key)}`. */
|
|
4
|
+
export declare function threadRowAttrs(key: string): Record<string, string>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export interface PinTurnToTopOptions {
|
|
3
|
+
/** The thread scroller. Must be a positioned element (see `pinTurnHead`). */
|
|
4
|
+
scrollerRef: React.RefObject<HTMLElement | null>;
|
|
5
|
+
/** The live turn's row — the visitor's message plus the streaming response. */
|
|
6
|
+
turnRef: React.RefObject<HTMLElement | null>;
|
|
7
|
+
/** Identity of the live turn; `null` when nothing is streaming. */
|
|
8
|
+
turnId: string | null;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Land a new turn so the visitor can read their own message and the opening of
|
|
12
|
+
* the response together, and keep it there while the response streams.
|
|
13
|
+
*
|
|
14
|
+
* One smooth glide when the turn arms, then stillness: the response fills the
|
|
15
|
+
* space beneath its head instead of dragging the viewport along behind it. A
|
|
16
|
+
* visitor scroll hands the viewport back for the rest of the turn.
|
|
17
|
+
*
|
|
18
|
+
* Generic chat behaviour, so it lives here rather than in each brand surface.
|
|
19
|
+
* The brand passes its scroller, the live row, and the turn's id; the composer
|
|
20
|
+
* supplies the `<ThreadHeadroom/>` the pin sizes.
|
|
21
|
+
*/
|
|
22
|
+
export declare function usePinTurnToTop({ scrollerRef, turnRef, turnId }: PinTurnToTopOptions): void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a scroller has content extending past its bottom edge — the
|
|
3
|
+
* signal a shell uses to show an overflow affordance (bottom fade) so
|
|
4
|
+
* below-the-fold prose reads as "more to read", never as clipped text.
|
|
5
|
+
*
|
|
6
|
+
* Pairs with the pin-turn-head design: the thread deliberately lets a
|
|
7
|
+
* long response grow below the fold instead of chasing the streaming
|
|
8
|
+
* tail, so the boundary needs to look like flow, not a cut.
|
|
9
|
+
*
|
|
10
|
+
* Tracks scroll position, viewport resizes, and content growth (rows
|
|
11
|
+
* stream taller without any scroll event firing).
|
|
12
|
+
*
|
|
13
|
+
* Takes the ELEMENT (from a state-backed callback ref), not a ref
|
|
14
|
+
* object: a ref's identity never changes, so an effect keyed on it
|
|
15
|
+
* silently keeps observing a detached node when the scroller div is
|
|
16
|
+
* re-created (dock fold, conversation switch). The element in state
|
|
17
|
+
* re-runs the effect on every (re)mount.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useScrollHasMoreBelow(scroller: HTMLElement | null, thresholdPx?: number): boolean;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { ThreadRow } from '../use-thread-rows';
|
|
2
|
+
/** One jump target in the thread — a past prompt the visitor can return to. */
|
|
3
|
+
export interface ThreadJumpMark {
|
|
4
|
+
key: string;
|
|
5
|
+
/** `row.visitorText`, untruncated — the caller truncates for display. */
|
|
6
|
+
label: string;
|
|
7
|
+
isCurrent: boolean;
|
|
8
|
+
/** Selects the turn (time-travel via the row's own `onClick`), which snaps its
|
|
9
|
+
* row to the top of the thread. Degrades to select-only when the brand hasn't
|
|
10
|
+
* stamped `THREAD_ROW_ATTR` on its rows — the rail works either way. */
|
|
11
|
+
onSelect: () => void;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Jump marks for a quick-TOC over the thread (`ThreadJumpRail`): one mark
|
|
15
|
+
* per past prompt, in thread order.
|
|
16
|
+
*
|
|
17
|
+
* Takes `rows` (from `useThreadRows()`) as a parameter rather than calling
|
|
18
|
+
* the hook itself — this stays a pure derivation over caller-supplied data,
|
|
19
|
+
* testable without the `@fourty/react` runtime-context seam.
|
|
20
|
+
*
|
|
21
|
+
* Scrolling is NOT done here. `row.onClick()` time-travels the canvas, which
|
|
22
|
+
* records an explicit turn SELECTION, which `useThreadLanding` settles on —
|
|
23
|
+
* one owner of the thread scroller, whether the visitor arrived by rail tick, by
|
|
24
|
+
* history row, or by the Back arm. That owner sees re-picking the turn already
|
|
25
|
+
* displayed too (the selection carries a sequence), so the rail no longer needs
|
|
26
|
+
* its own focus call.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useThreadJumpMarks(rows: ThreadRow[]): ThreadJumpMark[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useThreadLanding(scroller: HTMLElement | null, relandKey?: number): void;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { type SuggestionAction } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a callback that dispatches a follow-up chip tapped in the
|
|
4
|
+
* composer dock.
|
|
5
|
+
*
|
|
6
|
+
* `ComposerDock` is dumb shell chrome — it shapes the chip it renders
|
|
7
|
+
* and reports the tap. This hook (the harness side) owns the dispatch:
|
|
8
|
+
* it stamps the action's payload with `followUp: true` (the provenance
|
|
9
|
+
* flag that marks the turn as a composer follow-up) and dispatches
|
|
10
|
+
* through the session signal channel.
|
|
11
|
+
*
|
|
12
|
+
* ── AND IT STAMPS THE CART ACTOR AS `visitor` ─────────────────────────────
|
|
13
|
+
*
|
|
14
|
+
* `cart.add` and `cart.add.batch` are both in `ComposerDock`'s
|
|
15
|
+
* `OPTIMISTIC_CHIP_TYPES`, so a chip authored by the chip-gen faculty can carry
|
|
16
|
+
* a cart write that no producer stamped. The decision, written down: the chip's
|
|
17
|
+
* TEXT is the agent's, the ADD is the visitor's tap, and the metric asks who
|
|
18
|
+
* CAUSED the cart write. This hook already rewrites the payload, so it is the
|
|
19
|
+
* right place — and it is the last frame where the tap is still visible.
|
|
20
|
+
*/
|
|
21
|
+
export declare function useComposerChipSelect(): (action: SuggestionAction) => void;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns a callback that navigates the canvas back to the session's
|
|
3
|
+
* seed (home) view.
|
|
4
|
+
*
|
|
5
|
+
* It dispatches the single `navigate` action with `{page:{kind:'home'}}`
|
|
6
|
+
* through the signal channel — the same path every other visitor nav
|
|
7
|
+
* uses. The commerce `PageRouter` resolves `home` to the seed view, so
|
|
8
|
+
* this returns the visitor to the welcome canvas from ANY state —
|
|
9
|
+
* mid-conversation, deep-morphed, or after a prior go-home.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useGoHome(): () => void;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* False for the render that HYDRATES, true from the first effect onward.
|
|
3
|
+
*
|
|
4
|
+
* The gate for anything whose markup depends on state only the browser has —
|
|
5
|
+
* per-tab storage, a restored session, a live media query. The server cannot
|
|
6
|
+
* see any of it, so a component that consults it while hydrating renders
|
|
7
|
+
* something the server never sent, React reports a hydration mismatch, and
|
|
8
|
+
* (its words) "this tree will be regenerated on the client": the whole
|
|
9
|
+
* spacefront is thrown away and rebuilt. That is not a flicker in one
|
|
10
|
+
* component — it is the blank canvas and the re-scrolled composer, on every
|
|
11
|
+
* load where the two disagree.
|
|
12
|
+
*
|
|
13
|
+
* So the rule is not "avoid mismatches", it is that the hydrating render must
|
|
14
|
+
* be a function of what the SERVER knew. Gate on this, take the server's value
|
|
15
|
+
* for that one render, and let the client's own answer arrive on the next —
|
|
16
|
+
* which costs a second render and no correctness, because an effect is where
|
|
17
|
+
* client-only state was always going to become legible anyway.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useHydrated(): boolean;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ShellMenuItem } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a callback that dispatches the action a shell menu-drawer item
|
|
4
|
+
* carries.
|
|
5
|
+
*
|
|
6
|
+
* `MenuButton` is dumb shell chrome — it only reports the selected item.
|
|
7
|
+
* This hook (the harness side) owns the click→action meaning: it
|
|
8
|
+
* synthesizes a stable id from the item label, defaults a missing
|
|
9
|
+
* payload to `{}`, and dispatches through the session signal channel.
|
|
10
|
+
* The SDK's built-in `message` / `navigate` / `cart.*` handlers then
|
|
11
|
+
* resolve the action — layout morph or message round-trip.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useMenuItemSelect(): (item: ShellMenuItem) => void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A boolean toggle whose value is a manual override layered over a
|
|
3
|
+
* computed default. Until the caller flips it the toggle follows
|
|
4
|
+
* `defaultValue`; the first `toggle()` pins an explicit override that
|
|
5
|
+
* no longer tracks the default.
|
|
6
|
+
*
|
|
7
|
+
* Brand shells use this for surfaces that auto-reveal on some signal
|
|
8
|
+
* but must stay manually dismissable — e.g. a side dock that auto-opens
|
|
9
|
+
* once the visitor leaves home yet still folds on a launcher tap.
|
|
10
|
+
*/
|
|
11
|
+
export interface OverridableToggle {
|
|
12
|
+
/** Effective state — the pinned override if any, else `defaultValue`. */
|
|
13
|
+
value: boolean;
|
|
14
|
+
/** Flip the effective state and pin it as an explicit override. */
|
|
15
|
+
toggle: () => void;
|
|
16
|
+
/**
|
|
17
|
+
* Pin an explicit override to `next`. Use to FORCE a state regardless of a
|
|
18
|
+
* prior manual flip — e.g. a side dock that must re-open when a new message is
|
|
19
|
+
* dispatched even after the visitor manually closed it (a manual close alone
|
|
20
|
+
* would otherwise pin `false` forever). Stable identity (safe in effect deps).
|
|
21
|
+
*/
|
|
22
|
+
set: (next: boolean) => void;
|
|
23
|
+
}
|
|
24
|
+
export declare function useOverridableToggle(defaultValue: boolean): OverridableToggle;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { AttachmentRef } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* One rendered row of a conversation thread — a committed turn or the
|
|
4
|
+
* live pending turn. A committed row and its earlier pending twin
|
|
5
|
+
* share the SAME `key` (the `messageId`), so on `done` the row UPDATES
|
|
6
|
+
* in place (streaming → false) instead of unmounting + remounting:
|
|
7
|
+
* no exit/enter animation collision, no layout jump.
|
|
8
|
+
*/
|
|
9
|
+
export interface ThreadRow {
|
|
10
|
+
key: string;
|
|
11
|
+
visitorText: string;
|
|
12
|
+
prose: string;
|
|
13
|
+
isCurrent: boolean;
|
|
14
|
+
streaming: boolean;
|
|
15
|
+
onClick?: () => void;
|
|
16
|
+
isPending: boolean;
|
|
17
|
+
/** Files the visitor attached to this turn — render on the user bubble. */
|
|
18
|
+
attachments?: AttachmentRef[];
|
|
19
|
+
}
|
|
20
|
+
export interface ThreadRows {
|
|
21
|
+
rows: ThreadRow[];
|
|
22
|
+
/**
|
|
23
|
+
* This thread is KNOWN to have nothing in it — render the cold-start intro.
|
|
24
|
+
*
|
|
25
|
+
* False while the session is still being restored, even though there are no
|
|
26
|
+
* rows yet: a returning visitor's conversation arrives a few hundred ms after
|
|
27
|
+
* first paint, and an "empty" read taken before it lands is not an empty
|
|
28
|
+
* thread, it is an unanswered question. Shells that render an intro on it
|
|
29
|
+
* used to show the cold-start welcome to someone mid-conversation and then
|
|
30
|
+
* swap it for their thread — the panel appearing empty and jumping to
|
|
31
|
+
* content. Unknown is not empty.
|
|
32
|
+
*/
|
|
33
|
+
isEmpty: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Merges committed session messages + the live pending message into a
|
|
37
|
+
* single render list for a thread-history view. Clicking a committed
|
|
38
|
+
* row time-travels the canvas (`selectMessage` restores that view).
|
|
39
|
+
* Brand shells map the rows onto their own message components.
|
|
40
|
+
*/
|
|
41
|
+
export declare function useThreadRows(): ThreadRows;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useReviewHelpful — tracks which reviews the visitor marked helpful in
|
|
3
|
+
* this session. `countWith(idx, base)` returns the displayed total
|
|
4
|
+
* (server count + this session's increment). Brands render the toggle.
|
|
5
|
+
*/
|
|
6
|
+
export declare function useReviewHelpful(): {
|
|
7
|
+
isHelpful: (idx: number) => boolean;
|
|
8
|
+
toggle: (idx: number) => void;
|
|
9
|
+
countWith: (idx: number, base: number) => number;
|
|
10
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useTestimonialsCarousel — autoplay-with-pause-on-hover state. Returns
|
|
3
|
+
* the current index, manual setter, and `pauseProps` to spread onto the
|
|
4
|
+
* tracked container so hover halts the autoplay timer. Disable autoplay
|
|
5
|
+
* by passing `autoplayMs = 0`.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useTestimonialsCarousel(count: number, autoplayMs?: number): {
|
|
8
|
+
index: number;
|
|
9
|
+
setIndex: (next: number) => void;
|
|
10
|
+
paused: boolean;
|
|
11
|
+
pauseProps: {
|
|
12
|
+
onMouseEnter: () => void;
|
|
13
|
+
onMouseLeave: () => void;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Format a price as a localized currency string. Uses Intl.NumberFormat;
|
|
3
|
+
* brand components don't need to hand-roll currency symbols, decimals, or
|
|
4
|
+
* thousand separators. Drops the decimal part when the price is a whole
|
|
5
|
+
* dollar amount ($49, not $49.00) — cents only render when they're non-zero.
|
|
6
|
+
*/
|
|
7
|
+
export declare function formatPrice(amount: number, currencyCode?: string, locale?: string): string;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { formatPrice } from './format-price';
|
|
2
|
+
export { formatVariantValue } from '../../../../ecommerce/src/index';
|
|
3
|
+
export { formatDistance } from './format-distance';
|
|
4
|
+
export { isOnSale } from './is-on-sale';
|
|
5
|
+
export { isVideoUrl } from './is-video-url';
|
|
6
|
+
export { resolveSwatchColor } from './resolve-swatch-color';
|
|
7
|
+
export { mapsDirectionsUrl } from './maps-directions-url';
|
|
8
|
+
export { mintId } from './mint-id';
|
|
9
|
+
export { injectGoogleFonts } from './inject-google-fonts';
|
|
10
|
+
export { validateAll } from './validate-all';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inject a Google Fonts stylesheet at runtime, with the required
|
|
3
|
+
* preconnect hints. Idempotent — guards by element id so repeated
|
|
4
|
+
* imports / strict-mode double-mounts don't duplicate the link.
|
|
5
|
+
*
|
|
6
|
+
* Why runtime rather than `@import` in CSS: Turbopack does not honor
|
|
7
|
+
* `@import url('https://...')` inside CSS files, so the brand stylesheet
|
|
8
|
+
* has no way to pull web fonts via pure CSS. Runtime injection works in
|
|
9
|
+
* SSR-hydrated client mounts and dev iframes alike.
|
|
10
|
+
*
|
|
11
|
+
* Call once from the brand package's entry (a side-effect import works
|
|
12
|
+
* fine — guard runs at module evaluation time on the client).
|
|
13
|
+
*/
|
|
14
|
+
export declare function injectGoogleFonts({ href, id }: {
|
|
15
|
+
href: string;
|
|
16
|
+
id: string;
|
|
17
|
+
}): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pure predicate — is this product on sale right now? Returns true only
|
|
3
|
+
* when a real compareAtPrice exists and beats the current price. Brands
|
|
4
|
+
* use this to pick sale styling consistently.
|
|
5
|
+
*/
|
|
6
|
+
export declare function isOnSale(price: number, compareAtPrice: number | undefined): boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate a random id, preferring `crypto.randomUUID()`. Falls back to a
|
|
3
|
+
* timestamp + random string when it's unavailable.
|
|
4
|
+
*
|
|
5
|
+
* `crypto.randomUUID` only exists in secure contexts (https:, or the literal
|
|
6
|
+
* hostnames localhost / 127.0.0.1) — reached over plain http via a LAN or
|
|
7
|
+
* Tailscale IP (a common way to test from a second device) is NOT one, so
|
|
8
|
+
* the API is simply undefined there, not a bug in the caller.
|
|
9
|
+
*/
|
|
10
|
+
export declare function mintId(prefix: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Run a Zod schema across an array of unknown inputs, returning only the
|
|
4
|
+
* entries that validate. Malformed entries are dropped silently (with a
|
|
5
|
+
* console warning carrying the first issue message) so a partially-bad
|
|
6
|
+
* agent emission still renders the rows that DO parse — versus letting
|
|
7
|
+
* one bad apple null the whole component.
|
|
8
|
+
*
|
|
9
|
+
* Generic enough for any array of agent-emitted entities (Article,
|
|
10
|
+
* Product, Collection, Testimonial, …). Brands and components consume
|
|
11
|
+
* this instead of inlining the same `for / safeParse / push` loop.
|
|
12
|
+
*/
|
|
13
|
+
export declare function validateAll<T extends z.ZodTypeAny>(items: ReadonlyArray<unknown>, schema: T, context?: string): z.infer<T>[];
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { useFormFactor, type FormFactor } from './use-form-factor';
|
|
2
|
+
export { ViewportWindowContext, ViewportWindowProvider, useViewportWindow, } from './viewport-window';
|
|
3
|
+
export { useInlineCompletion, type UseInlineCompletionOptions, type UseInlineCompletionApi, } from './use-inline-completion';
|
|
4
|
+
export { useDocumentVisible } from './use-document-visible';
|
|
5
|
+
export { useInterval } from './use-interval';
|
|
6
|
+
export { useSuccessFlash, type UseSuccessFlashOptions, type UseSuccessFlashApi, } from './use-success-flash';
|
|
7
|
+
export { useWakeLock } from './use-wake-lock';
|
|
8
|
+
export { type StorageAdapter, createSessionStorageAdapter, createLocalStorageAdapter, createMemoryStorageAdapter, resolveStorage, } from './storage';
|
|
9
|
+
export { applySinglePatch } from '../../../spacestation/src/index';
|
|
10
|
+
export { formatPrice, formatVariantValue, formatDistance, isOnSale, isVideoUrl, resolveSwatchColor, mapsDirectionsUrl, mintId, injectGoogleFonts, validateAll, } from './core-utils';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export interface StorageAdapter {
|
|
2
|
+
get(key: string): string | null;
|
|
3
|
+
set(key: string, value: string): void;
|
|
4
|
+
remove(key: string): void;
|
|
5
|
+
}
|
|
6
|
+
export declare function createSessionStorageAdapter(): StorageAdapter;
|
|
7
|
+
export declare function createLocalStorageAdapter(): StorageAdapter;
|
|
8
|
+
export declare function createMemoryStorageAdapter(): StorageAdapter;
|
|
9
|
+
export declare function resolveStorage(storage: 'session' | 'local' | 'memory' | StorageAdapter): StorageAdapter;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether the document is currently visible (tab in the foreground). Ambient
|
|
3
|
+
* cycles — placeholder rotators, typewriter lines, morphing skeletons — should
|
|
4
|
+
* gate on this: browsers throttle timers in hidden tabs, so a cycle that keeps
|
|
5
|
+
* ticking while hidden crawls out of step and then replays in a burst the
|
|
6
|
+
* moment the visitor refocuses. Pausing on hidden and resuming settled is the
|
|
7
|
+
* calm behavior.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useDocumentVisible(): boolean;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The visitor's form factor — the interaction signals CSS can't express.
|
|
3
|
+
* LAYOUT responsiveness is done with container queries (a component reacts to
|
|
4
|
+
* the width it's GIVEN); this hook is only for interaction concerns: touch
|
|
5
|
+
* sizing, tap-vs-hover, motion intensity, and the presence widget's morph.
|
|
6
|
+
*/
|
|
7
|
+
export interface FormFactor {
|
|
8
|
+
/** Viewport is phone-width (`max-width: 720px`). */
|
|
9
|
+
isMobile: boolean;
|
|
10
|
+
/** Primary pointer is coarse (touch) — drives ≥44px targets, tap-not-hover. */
|
|
11
|
+
isTouch: boolean;
|
|
12
|
+
/** Visitor asked for reduced motion. */
|
|
13
|
+
reducedMotion: boolean;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* `useFormFactor` — read the visitor's interaction form factor. Backed by a
|
|
17
|
+
* per-window shared `matchMedia` store via `useSyncExternalStore`: SSR-safe,
|
|
18
|
+
* one source of truth per window, no per-component listeners. Use it ONLY for
|
|
19
|
+
* interaction (touch / hover / motion); use container queries for layout.
|
|
20
|
+
*
|
|
21
|
+
* WHICH window it asks is `ViewportWindowContext`'s business — the global one
|
|
22
|
+
* unless a host says otherwise. See `viewport-window.tsx`.
|
|
23
|
+
*/
|
|
24
|
+
export declare function useFormFactor(): FormFactor;
|