@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,24 @@
|
|
|
1
|
+
import type { ItemScenario } from './profile';
|
|
2
|
+
export interface ItemChange {
|
|
3
|
+
scenario: ItemScenario;
|
|
4
|
+
/** Identities present in next but not prev — they play the enter wipe. */
|
|
5
|
+
entered: string[];
|
|
6
|
+
/** Identities present in prev but not next — they play the exit wipe. */
|
|
7
|
+
exited: string[];
|
|
8
|
+
/** Identities present in both — they FLIP to their new positions. */
|
|
9
|
+
survivors: string[];
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Classify the change between two identity lists. Returns `null` when the
|
|
13
|
+
* lists are identical (same ids, same order) — nothing to animate.
|
|
14
|
+
*
|
|
15
|
+
* Scenario mapping (the playground's vocabulary):
|
|
16
|
+
* - enters + exits in one commit → `swap`
|
|
17
|
+
* - only enters, exactly 1, not at tail → `insert`
|
|
18
|
+
* - only enters, otherwise → `add`
|
|
19
|
+
* - only exits, exactly 1 → `remove`
|
|
20
|
+
* - only exits, several → `update` (count decrease)
|
|
21
|
+
* - same set, different order → `swap` (pure reposition — FLIP
|
|
22
|
+
* only; no enters/exits to play)
|
|
23
|
+
*/
|
|
24
|
+
export declare function classifyItemChange(prevIds: string[], nextIds: string[]): ItemChange | null;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { ItemTransitionGroup, ITEM_IDENTITY_ATTR, type ItemTransitionGroupProps } from './ItemTransitionGroup';
|
|
2
|
+
export { getActiveProfile, registerCanvasProfile, setCanvasProfile, type CanvasScenario, type CanvasMotionProfile, type ScenarioMotion, type RevealScroll, type WipeBehavior, type WipeDirection, type MotionEase, type ItemScenario, } from './profile';
|
|
3
|
+
export { wipeProfile } from './plugins/wipe';
|
|
4
|
+
export { classifyItemChange, type ItemChange } from './classify-items';
|
|
5
|
+
export { wipePhases, buildWipeVariants, selectItemVariants } from './wipe';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CanvasMotionProfile } from '../profile';
|
|
2
|
+
/**
|
|
3
|
+
* The wipe profile:
|
|
4
|
+
* - engine scenarios → scroll choreography only (whole-page replace pins
|
|
5
|
+
* to top; section updates + focus glide into view).
|
|
6
|
+
* - item scenarios → the playground wipes, played by `ItemTransitionGroup`
|
|
7
|
+
* in adopting components. The ONLY place the wipe vocabulary plays.
|
|
8
|
+
* - generation → the streaming feel (skeletons / entrances / images /
|
|
9
|
+
* settle), designed in /dev/motion.
|
|
10
|
+
*/
|
|
11
|
+
export declare const wipeProfile: CanvasMotionProfile;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { GenerationStyle } from '../generation-style';
|
|
2
|
+
/** The canvas-level change a turn makes (classified by the engine). */
|
|
3
|
+
export type CanvasScenario = 'replace' | 'update' | 'focus';
|
|
4
|
+
/** Where new content arrives from. The exiting content leaves the opposite
|
|
5
|
+
* way (`up` = new from the top, old exits down). */
|
|
6
|
+
export type WipeDirection = 'up' | 'down' | 'left' | 'right';
|
|
7
|
+
/** The easing forms framer-motion accepts. */
|
|
8
|
+
export type MotionEase = [number, number, number, number] | 'linear' | 'easeIn' | 'easeOut' | 'easeInOut';
|
|
9
|
+
/**
|
|
10
|
+
* The visual behavior of one transition — direction, timing, sequencing.
|
|
11
|
+
* This is the unit a playground export translates into.
|
|
12
|
+
*/
|
|
13
|
+
export interface WipeBehavior {
|
|
14
|
+
direction: WipeDirection;
|
|
15
|
+
/** Total duration in seconds. Sequenced transitions split this in half. */
|
|
16
|
+
duration: number;
|
|
17
|
+
ease: MotionEase;
|
|
18
|
+
/**
|
|
19
|
+
* Two-phase choreography. With exits: Phase 1 = exits, Phase 2 = survivors
|
|
20
|
+
* reposition + enters. Without exits: enters play immediately. When false,
|
|
21
|
+
* everything animates in parallel for the full duration.
|
|
22
|
+
*/
|
|
23
|
+
sequenced: boolean;
|
|
24
|
+
/** Extra translation (px) layered onto the clip reveal. 0 = pure wipe. */
|
|
25
|
+
slideOffset: number;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Item scenarios — mutations of a component's item list, played by
|
|
29
|
+
* `ItemTransitionGroup` (self-classified from the item diff):
|
|
30
|
+
* - `add` — count increase (one or more appended)
|
|
31
|
+
* - `update` — count decrease (one or more removed)
|
|
32
|
+
* - `insert` — exactly one item added at a non-tail index
|
|
33
|
+
* - `remove` — exactly one item removed
|
|
34
|
+
* - `swap` — items replaced in place (enters + exits in one commit)
|
|
35
|
+
*/
|
|
36
|
+
export type ItemScenario = 'add' | 'update' | 'insert' | 'remove' | 'swap';
|
|
37
|
+
/**
|
|
38
|
+
* How the viewport moves for a scenario.
|
|
39
|
+
* - `top` — instant snap to the canvas top (page replaces)
|
|
40
|
+
* - `into-view` — ANIMATED glide to the target (see scroll.ts)
|
|
41
|
+
* - `into-view-instant` — the viewport jumps to the target in one frame,
|
|
42
|
+
* behind the scenes; the content's own entrance animation is what the
|
|
43
|
+
* visitor perceives as the arrival. The calm choice for appended content.
|
|
44
|
+
* - `none` — the viewport stays put
|
|
45
|
+
*/
|
|
46
|
+
export type RevealScroll = 'top' | 'into-view' | 'into-view-instant' | 'none';
|
|
47
|
+
/**
|
|
48
|
+
* Engine-scenario motion: how the viewport follows the change. Engine
|
|
49
|
+
* scenarios carry NO visual behavior — streaming content renders with the
|
|
50
|
+
* platform's fixed calm entrance (see `stages.tsx`); wipes are reserved for
|
|
51
|
+
* item-scoped changes where both states are real content.
|
|
52
|
+
*/
|
|
53
|
+
export interface ScenarioMotion {
|
|
54
|
+
scroll: RevealScroll;
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A motion profile (code plugin):
|
|
58
|
+
* - `scenarios` — per engine scenario, the coordinated scroll.
|
|
59
|
+
* - `items` — item-scenario wipe behaviors, played by
|
|
60
|
+
* `ItemTransitionGroup` inside components that adopt it. The only place
|
|
61
|
+
* transition choreography (the playground's wipe vocabulary) plays.
|
|
62
|
+
* - `generation` — the streaming feel: skeletons, entrances, image
|
|
63
|
+
* resolution, completion settle. Designed visually in /dev/motion;
|
|
64
|
+
* the playground's exported JSON maps 1:1 onto this block.
|
|
65
|
+
*/
|
|
66
|
+
export interface CanvasMotionProfile {
|
|
67
|
+
scenarios: Record<CanvasScenario, ScenarioMotion>;
|
|
68
|
+
items: Record<ItemScenario, WipeBehavior>;
|
|
69
|
+
generation: GenerationStyle;
|
|
70
|
+
}
|
|
71
|
+
/** Register a named profile (or override one). Extension point — translate a
|
|
72
|
+
* new playground export into a plugin file and register it here. */
|
|
73
|
+
export declare function registerCanvasProfile(name: string, profile: CanvasMotionProfile): void;
|
|
74
|
+
/** Select the active profile by name. No-op if unknown (keeps the current one). */
|
|
75
|
+
export declare function setCanvasProfile(name: string): void;
|
|
76
|
+
/** The active profile — what the engine plays. */
|
|
77
|
+
export declare function getActiveProfile(): CanvasMotionProfile;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { Variants, Transition } from 'framer-motion';
|
|
2
|
+
import type { WipeBehavior } from './profile';
|
|
3
|
+
/**
|
|
4
|
+
* Phase timing for a behavior, in seconds. Sequenced = the duration splits in
|
|
5
|
+
* half: exits play in phase 1, survivors/enters in phase 2. Parallel =
|
|
6
|
+
* everything runs the full duration at once.
|
|
7
|
+
*/
|
|
8
|
+
export interface WipePhases {
|
|
9
|
+
/** Duration of each animating piece. */
|
|
10
|
+
pieceDuration: number;
|
|
11
|
+
/** Delay before entering pieces start. */
|
|
12
|
+
enterDelay: number;
|
|
13
|
+
/** Delay before survivor repositioning starts. */
|
|
14
|
+
repositionDelay: number;
|
|
15
|
+
}
|
|
16
|
+
export declare function wipePhases(behavior: WipeBehavior, hasExits: boolean): WipePhases;
|
|
17
|
+
/**
|
|
18
|
+
* Build the enter/exit variants for one item of a wipe. Used by
|
|
19
|
+
* `ItemTransitionGroup` — item-scoped changes are the only place the wipe
|
|
20
|
+
* vocabulary plays (both states are real, finished content there).
|
|
21
|
+
*
|
|
22
|
+
* Every animated clipPath is an EXPLICIT keyframe pair `[from, to]`, never a
|
|
23
|
+
* single target value. Framer would otherwise read the "from" out of the
|
|
24
|
+
* DOM — where the browser has normalized `inset(0% 0% 0% 0%)` to the
|
|
25
|
+
* shorthand `inset(0%)` — and its string interpolator can't mix a 1-value
|
|
26
|
+
* inset with a 4-value inset, so it silently falls back to a hold-then-jump
|
|
27
|
+
* (the wipe never visually plays). Authoring both keyframes with the same
|
|
28
|
+
* 4-value format keeps the interpolation on the happy path.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildWipeVariants(behavior: WipeBehavior, phases: WipePhases): Variants;
|
|
31
|
+
/**
|
|
32
|
+
* Per-item override for the ONE `variants` object `ItemTransitionGroup`
|
|
33
|
+
* shares across every rendered item. Framer diffs a mounted element's
|
|
34
|
+
* `animate` target by VALUE across renders, not by `variants`-object
|
|
35
|
+
* identity — so whenever the active item scenario's direction changes
|
|
36
|
+
* (e.g. the grid's initial `add` fill, direction up, followed by a `swap`,
|
|
37
|
+
* direction left), every currently-mounted item's `animate` target
|
|
38
|
+
* genuinely differs from its previous render, and framer replays the full
|
|
39
|
+
* clip-path wipe for ALL of them — survivors included, not just the item(s)
|
|
40
|
+
* that actually entered/exited. The whole grid clips to hidden and
|
|
41
|
+
* re-reveals instead of only the changed items.
|
|
42
|
+
*
|
|
43
|
+
* Freezing `animate` to the identical `VISIBLE_CLIP` target for survivors
|
|
44
|
+
* keeps framer's diff seeing "no change" regardless of which scenario is
|
|
45
|
+
* active, so only genuinely entering items play the wipe; survivors
|
|
46
|
+
* reposition purely via the outer wrapper's `layout` FLIP. `initial`/`exit`
|
|
47
|
+
* stay scenario-current — `initial` never plays for an already-mounted
|
|
48
|
+
* survivor, and `exit` is what plays if THIS item exits on a later render.
|
|
49
|
+
*/
|
|
50
|
+
export declare function selectItemVariants(variants: Variants, isEntering: boolean): Variants;
|
|
51
|
+
/** The transition survivors use when repositioning (FLIP layout animation). */
|
|
52
|
+
export declare function survivorLayoutTransition(behavior: WipeBehavior, phases: WipePhases): Transition;
|
|
53
|
+
/**
|
|
54
|
+
* Reduced-motion fallback — the wipe collapses to an instant opacity cut.
|
|
55
|
+
* Same variant names so consumers swap sets without branching.
|
|
56
|
+
*/
|
|
57
|
+
export declare const REDUCED_MOTION_VARIANTS: Variants;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Which way the visitor moved to reach the view now landing. */
|
|
2
|
+
export type NavDirection = 'forward' | 'backward';
|
|
3
|
+
/**
|
|
4
|
+
* Whether the landing replays its entrance at all.
|
|
5
|
+
*
|
|
6
|
+
* A visitor holding Back navigates faster than one replay can finish. Playing
|
|
7
|
+
* a full entrance per step stacks half-resolved blurs, and an interrupted
|
|
8
|
+
* replay can strand a section at `opacity: 0` — so steps that arrive inside
|
|
9
|
+
* the scrub window swap instantly. Deliberate single presses replay; holding
|
|
10
|
+
* the arrow scrubs.
|
|
11
|
+
*/
|
|
12
|
+
export type NavPace = 'replay' | 'instant';
|
|
13
|
+
/** How the canvas should present the view a navigation just landed. */
|
|
14
|
+
export interface NavPresentation {
|
|
15
|
+
direction: NavDirection;
|
|
16
|
+
pace: NavPace;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* First paint. Nothing was navigated, so nothing replays — the panel-reveal
|
|
20
|
+
* nonce starts at 0 and the seed render stays instant regardless.
|
|
21
|
+
*/
|
|
22
|
+
export declare const INITIAL_NAV_PRESENTATION: NavPresentation;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { FourtyRuntime } from './runtime-types';
|
|
2
|
+
/**
|
|
3
|
+
* Provider for the runtime-hook surface. Mounted by the SDK's
|
|
4
|
+
* `FourtyProvider`, which passes the SDK's real hook implementations.
|
|
5
|
+
*/
|
|
6
|
+
export declare const FourtyRuntimeProvider: import("react").Provider<FourtyRuntime | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Read the runtime-hook surface. Throws when no `<FourtyProvider>` is
|
|
9
|
+
* mounted upstream — catalog components run inside a FourtyProvider in
|
|
10
|
+
* every real render path; a missing provider is a wiring bug, not a
|
|
11
|
+
* tolerated state.
|
|
12
|
+
*/
|
|
13
|
+
export declare function useFourtyRuntime(): FourtyRuntime;
|
|
14
|
+
/** Non-throwing variant — `null` when no `<FourtyProvider>` is mounted. */
|
|
15
|
+
export declare function useOptionalFourtyRuntime(): FourtyRuntime | null;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import type { ChatMessage, Spec, ShellConfig, ReasoningBeat, Message, PendingMessage, SuggestionActions, ConversationSummary } from '../../../spacestation/src/index';
|
|
2
|
+
import type { TurnInfo, HistoryNav, CanvasBack, CanvasForward, ConversationState, RuntimeSessionState, InteractionActions, VisitorName, ExplicitTurnSelection } from './runtime-types';
|
|
3
|
+
/** Metadata for the turn currently on canvas. */
|
|
4
|
+
export declare function useTurn(): TurnInfo;
|
|
5
|
+
/** Per-turn stream channel for the turn currently on canvas. */
|
|
6
|
+
export declare function useStream<T extends 'prose' | 'actions' | 'signals'>(name: T): T extends 'prose' ? string : import('../../../spacestation/src/index').AgentSignal[];
|
|
7
|
+
/** The layout doc currently on canvas. */
|
|
8
|
+
export declare function useDisplayedLayout(): Spec;
|
|
9
|
+
/** Brand chrome for the view currently on canvas. */
|
|
10
|
+
export declare function useFourtyShell(): ShellConfig;
|
|
11
|
+
/**
|
|
12
|
+
* True once an external WebMCP agent has driven this page — i.e. it called one
|
|
13
|
+
* of the tools the spacefront registers on `document.modelContext`.
|
|
14
|
+
*
|
|
15
|
+
* Shell chrome reads this to stand down. When an agent is driving, the human is
|
|
16
|
+
* reading their agent's client, not ours: our composer would be a second input
|
|
17
|
+
* for a conversation happening elsewhere. `false` for every ordinary human
|
|
18
|
+
* visit, and for SSR.
|
|
19
|
+
*/
|
|
20
|
+
export declare function useAgentDriven(): boolean;
|
|
21
|
+
/** Live reasoning beats for the in-flight turn. */
|
|
22
|
+
export declare function useReasoning(): readonly ReasoningBeat[];
|
|
23
|
+
/** Session state slice (status, error, prose, facts). */
|
|
24
|
+
export declare function useSessionState(): RuntimeSessionState;
|
|
25
|
+
/** The session id, or `null` before the session resolves. A slice: does not
|
|
26
|
+
* re-render on other session writes. */
|
|
27
|
+
export declare function useSessionId(): string | null;
|
|
28
|
+
/** The committed chat messages. A slice: re-renders only when the list changes. */
|
|
29
|
+
export declare function useSessionMessages(): readonly ChatMessage[];
|
|
30
|
+
/** Visitor-slot facts map. */
|
|
31
|
+
export declare function useFacts(): Record<string, unknown>;
|
|
32
|
+
/** The name the visitor goes by (`null` when they have not given one), plus the
|
|
33
|
+
* setter that records it. Visitor identity, not a visitor fact — see
|
|
34
|
+
* `VisitorName`. */
|
|
35
|
+
export declare function useVisitorName(): VisitorName;
|
|
36
|
+
/** Committed conversation turns. */
|
|
37
|
+
export declare function useConversationMessages(): readonly Message[];
|
|
38
|
+
/** The in-flight pending message, or `null` between turns. */
|
|
39
|
+
export declare function usePendingMessage(): PendingMessage | null;
|
|
40
|
+
/** Index of the turn currently shown on canvas, or `null` pre-first-turn. */
|
|
41
|
+
export declare function useCurrentMessageIndex(): number | null;
|
|
42
|
+
/** Time-travel the canvas to a committed turn by index. */
|
|
43
|
+
export declare function useSelectMessage(): (index: number) => void;
|
|
44
|
+
/** messageId of the most recent explicit thread-history jump, or null before one happens. */
|
|
45
|
+
export declare function useExplicitTurnSelection(): ExplicitTurnSelection;
|
|
46
|
+
/** Just the selected turn's id — for consumers that want the state, not the event. */
|
|
47
|
+
export declare function useExplicitTurnId(): string | null;
|
|
48
|
+
/** Step through the conversation's committed turns. */
|
|
49
|
+
export declare function useHistoryNav(): HistoryNav;
|
|
50
|
+
/**
|
|
51
|
+
* Unified Back — pops a pushed page view first, falls back to stepping
|
|
52
|
+
* the conversation turn. The single hook the shell Back button reads.
|
|
53
|
+
*/
|
|
54
|
+
export declare function useCanvasBack(): CanvasBack;
|
|
55
|
+
/**
|
|
56
|
+
* Back along the VIEW axis only — pops a pushed page (product, collection,
|
|
57
|
+
* custom layout) and knows nothing about conversation turns.
|
|
58
|
+
*
|
|
59
|
+
* Distinct from `useCanvasBack` on purpose. The unified hook is right for a
|
|
60
|
+
* persistent chrome button, which should undo whatever the visitor last did on
|
|
61
|
+
* either axis. It is wrong for an affordance that must APPEAR only when there
|
|
62
|
+
* is a page to leave: folding turn-history in makes it stand permanently from
|
|
63
|
+
* the second turn onward, and a control that is always there is one the eye
|
|
64
|
+
* stops reading as an exit. This is the seam for "you are on a page you
|
|
65
|
+
* navigated into" — exactly the state a visitor needs a way out of.
|
|
66
|
+
*/
|
|
67
|
+
export declare function useCanvasViewBack(): CanvasBack;
|
|
68
|
+
/**
|
|
69
|
+
* Unified Forward — replays the most recent Back, whichever axis it
|
|
70
|
+
* stepped. The single hook the shell Forward button reads.
|
|
71
|
+
*/
|
|
72
|
+
export declare function useCanvasForward(): CanvasForward;
|
|
73
|
+
/** Conversation-state primitives — committed/streaming/turn-count signals. */
|
|
74
|
+
export declare function useConversationState(): ConversationState;
|
|
75
|
+
/** Active follow-up chips for the current agentic state. */
|
|
76
|
+
export declare function useSuggestionsWithDefaults(): SuggestionActions | null;
|
|
77
|
+
/**
|
|
78
|
+
* Animated composer placeholder, or `null` when there is nothing to show.
|
|
79
|
+
*
|
|
80
|
+
* `opts.seed` is a brand's own example prompts, cycled until the agent emits
|
|
81
|
+
* turn-fresh ones of its own — which then win outright. Without a seed the
|
|
82
|
+
* rotation is empty (and this returns `null`) until the first turn ends.
|
|
83
|
+
*/
|
|
84
|
+
export declare function useComposerPlaceholder(opts?: {
|
|
85
|
+
intervalMs?: number;
|
|
86
|
+
seed?: readonly string[];
|
|
87
|
+
}): string | null;
|
|
88
|
+
/**
|
|
89
|
+
* The live rotation itself, for a surface that animates the change rather than
|
|
90
|
+
* swapping it — see `useComposerPlaceholderRotation` in `@fourty/react`.
|
|
91
|
+
*/
|
|
92
|
+
export declare function useComposerPlaceholderRotation(opts?: {
|
|
93
|
+
seed?: readonly string[];
|
|
94
|
+
}): readonly string[];
|
|
95
|
+
/** Current layout — re-renders when layout changes. `null` until WS open. */
|
|
96
|
+
export declare function useLayout(): Spec | null;
|
|
97
|
+
/** The FOCAL entity id — the single product the current view is anchored on
|
|
98
|
+
* (a product page), or `null` on any other page. Distinct from
|
|
99
|
+
* `useLayoutEntityIds` (EVERY id the layout places — a whole grid). */
|
|
100
|
+
export declare function useFocalEntityId(): string | null;
|
|
101
|
+
/** Interaction actions — stable refs, never causes re-render. */
|
|
102
|
+
export declare function useInteraction(): InteractionActions;
|
|
103
|
+
/** Recent-conversation index — re-renders when the visitor's conversation list changes. */
|
|
104
|
+
export declare function useConversations(): readonly ConversationSummary[];
|
|
105
|
+
/** True once the visitor is no longer on the seed home view. */
|
|
106
|
+
export declare function useHasLeftSeedHome(): boolean;
|
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import type { Spec, ShellConfig, ReasoningBeat, Message, PendingMessage, ChatMessage, SuggestionActions, ConversationSummary, InteractionSignal, AttachmentRef } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Per-turn state the catalog needs to render. Returned by `useTurn()`.
|
|
4
|
+
*/
|
|
5
|
+
export interface TurnInfo {
|
|
6
|
+
index: number;
|
|
7
|
+
turnId: string | undefined;
|
|
8
|
+
status: 'streaming' | 'done';
|
|
9
|
+
userMessage: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Conversation history navigation — step through committed turns.
|
|
13
|
+
* Returned by `useHistoryNav()`.
|
|
14
|
+
*/
|
|
15
|
+
export interface HistoryNav {
|
|
16
|
+
canGoBack: boolean;
|
|
17
|
+
canGoForward: boolean;
|
|
18
|
+
goBack: () => void;
|
|
19
|
+
goForward: () => void;
|
|
20
|
+
totalTurns: number;
|
|
21
|
+
currentIndex: number | null;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Unified Back affordance — folds the canvas's view-nav stack (page
|
|
25
|
+
* navigations like product / collection) and the conversation-turn
|
|
26
|
+
* history into one Back action. Returned by `useCanvasBack()`. The
|
|
27
|
+
* shell Back button consumes this so it undoes whichever axis the
|
|
28
|
+
* visitor last moved on, instead of being blind to page navigation.
|
|
29
|
+
*/
|
|
30
|
+
export interface CanvasBack {
|
|
31
|
+
canGoBack: boolean;
|
|
32
|
+
goBack: () => void;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Unified Forward affordance — the inverse of `CanvasBack` over the same
|
|
36
|
+
* two axes. Returned by `useCanvasForward()`. Its precedence MIRRORS
|
|
37
|
+
* Back's rather than copying it (turn-forward before view-forward); see
|
|
38
|
+
* `@fourty/react`'s `use-canvas-forward.ts` for the derivation.
|
|
39
|
+
*/
|
|
40
|
+
export interface CanvasForward {
|
|
41
|
+
canGoForward: boolean;
|
|
42
|
+
goForward: () => void;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Conversation-state primitives — raw signals brand shells compose into
|
|
46
|
+
* their own chrome logic. Returned by `useConversationState()`.
|
|
47
|
+
*/
|
|
48
|
+
export interface ConversationState {
|
|
49
|
+
hasCommittedTurns: boolean;
|
|
50
|
+
isStreaming: boolean;
|
|
51
|
+
userMessageCount: number;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Session state slice the catalog reads. Mirrors the SDK's
|
|
55
|
+
* `CoreSessionState` — the fields catalog components actually consume.
|
|
56
|
+
* The SDK's `useSessionState` returns the full state (a superset); this
|
|
57
|
+
* is the narrower view the catalog is typed against.
|
|
58
|
+
*/
|
|
59
|
+
export interface RuntimeSessionState {
|
|
60
|
+
sessionId: string | null;
|
|
61
|
+
isRunning: boolean;
|
|
62
|
+
error: string | null;
|
|
63
|
+
/** True while the runtime is auto-retrying a dropped mid-turn connection
|
|
64
|
+
* before falling back to `error`. See `SessionRuntime.handleTransportClose`. */
|
|
65
|
+
reconnecting: boolean;
|
|
66
|
+
reconnectAttempt: number;
|
|
67
|
+
reconnectMaxAttempts: number;
|
|
68
|
+
responseText: string;
|
|
69
|
+
reasoningText: string;
|
|
70
|
+
facts: Record<string, unknown>;
|
|
71
|
+
messages: ChatMessage[];
|
|
72
|
+
/** Welcome / "home" layout for this space — `null` until WS open. */
|
|
73
|
+
seedLayout: Spec | null;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The name the visitor goes by, and the way they set it. Returned by
|
|
77
|
+
* `useVisitorName()`.
|
|
78
|
+
*
|
|
79
|
+
* Visitor IDENTITY, not a visitor FACT: the fact map is what the agent worked
|
|
80
|
+
* out about them, this is what they told us to call them. It is durable (it
|
|
81
|
+
* carries across visits in local visitor memory and rides up to the agent as
|
|
82
|
+
* `visitorMemory.displayName`) and it is theirs to change or withdraw.
|
|
83
|
+
*/
|
|
84
|
+
export interface VisitorName {
|
|
85
|
+
/** The name, or `null` when the visitor has never given one — which is most
|
|
86
|
+
* of them. Null is a state to render, never a gap to fill with a stand-in. */
|
|
87
|
+
name: string | null;
|
|
88
|
+
/** Record the name; `''` withdraws it. Persists locally AND tells the live
|
|
89
|
+
* session, so the agent can use it in the very next sentence it writes. */
|
|
90
|
+
setName: (name: string) => void;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Interaction actions — stable refs, never causes re-render. Returned by
|
|
94
|
+
* `useInteraction()`.
|
|
95
|
+
*/
|
|
96
|
+
export interface InteractionActions {
|
|
97
|
+
sendMessage: (text: string, extras?: Record<string, unknown>) => void;
|
|
98
|
+
sendSignal: (signal: Omit<InteractionSignal, 'timestamp'>) => void;
|
|
99
|
+
uploadAttachment: (file: File) => Promise<AttachmentRef>;
|
|
100
|
+
stopGeneration: () => void;
|
|
101
|
+
abortGeneration: () => void;
|
|
102
|
+
clearSignals: () => void;
|
|
103
|
+
clearSession: () => Promise<void>;
|
|
104
|
+
forgetVisitor: () => Promise<void>;
|
|
105
|
+
newConversation: () => Promise<void>;
|
|
106
|
+
switchConversation: (sessionId: string) => Promise<void>;
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* FourtyRuntime — the runtime-hook surface the catalog consumes.
|
|
110
|
+
*
|
|
111
|
+
* These hooks derive over the SDK's internal stores (`CanvasController`,
|
|
112
|
+
* `Conversation`, `FourtyClient`). The catalog cannot import the SDK
|
|
113
|
+
* runtime — so the SDK's `FourtyProvider` provides this object through
|
|
114
|
+
* the context below, and `@fourty/ui`'s thin hooks (`useTurn`,
|
|
115
|
+
* `useStream`, …) read it. This is dependency inversion: the catalog
|
|
116
|
+
* OWNS the contract; the SDK FILLS it.
|
|
117
|
+
*
|
|
118
|
+
* Every entry is a React hook — components call `useTurn()` etc.
|
|
119
|
+
* unconditionally at the top level, so the rules of hooks hold.
|
|
120
|
+
*/
|
|
121
|
+
/**
|
|
122
|
+
* An explicit thread-history selection: the visitor deliberately went to a turn
|
|
123
|
+
* (a history row, a jump-rail tick, a Back / Forward arm).
|
|
124
|
+
*
|
|
125
|
+
* An EVENT, not just an id. Re-picking the turn already displayed is a real
|
|
126
|
+
* request — "bring its row back into view", after the thread has been scrolled
|
|
127
|
+
* away from it — and an identity-only signal cannot express that: the id does not
|
|
128
|
+
* change, so nothing downstream re-fires. `seq` increments once per selection, so
|
|
129
|
+
* consumers can react to every one. Distinct from `useCurrentMessageIndex()`,
|
|
130
|
+
* which also moves for reasons that are not navigation (a new turn committing).
|
|
131
|
+
*/
|
|
132
|
+
export interface ExplicitTurnSelection {
|
|
133
|
+
/** The selected turn's `messageId`, or null before the first selection. */
|
|
134
|
+
turnId: string | null;
|
|
135
|
+
/** Monotonic per selection — changes even when `turnId` does not. */
|
|
136
|
+
seq: number;
|
|
137
|
+
}
|
|
138
|
+
export interface FourtyRuntime {
|
|
139
|
+
useTurn: () => TurnInfo;
|
|
140
|
+
useStream: <T extends 'prose' | 'actions' | 'signals'>(name: T) => T extends 'prose' ? string : import('../../../spacestation/src/index').AgentSignal[];
|
|
141
|
+
useDisplayedLayout: () => Spec;
|
|
142
|
+
useFourtyShell: () => ShellConfig;
|
|
143
|
+
/** True once an external WebMCP agent has invoked one of this page's tools —
|
|
144
|
+
* the conversation has moved off the page, so shell chrome that competes
|
|
145
|
+
* for it (the composer) retracts. See `agent-driven-store.ts` in the engine
|
|
146
|
+
* for why this keys off a tool CALL and not the presence of a host. */
|
|
147
|
+
useAgentDriven: () => boolean;
|
|
148
|
+
useReasoning: () => readonly ReasoningBeat[];
|
|
149
|
+
useSessionState: () => RuntimeSessionState;
|
|
150
|
+
/** Slices of session state with stable identity across unrelated writes —
|
|
151
|
+
* the reads for consumers that must NOT re-render on every prose chunk. */
|
|
152
|
+
useSessionId: () => string | null;
|
|
153
|
+
useSessionMessages: () => readonly ChatMessage[];
|
|
154
|
+
useFacts: () => Record<string, unknown>;
|
|
155
|
+
useVisitorName: () => VisitorName;
|
|
156
|
+
useConversationMessages: () => readonly Message[];
|
|
157
|
+
usePendingMessage: () => PendingMessage | null;
|
|
158
|
+
useCurrentMessageIndex: () => number | null;
|
|
159
|
+
useSelectMessage: () => (index: number) => void;
|
|
160
|
+
/** The most recent explicit thread-history selection — see `ExplicitTurnSelection`. */
|
|
161
|
+
useExplicitTurnSelection: () => ExplicitTurnSelection;
|
|
162
|
+
useHistoryNav: () => HistoryNav;
|
|
163
|
+
useCanvasBack: () => CanvasBack;
|
|
164
|
+
useCanvasViewBack: () => CanvasBack;
|
|
165
|
+
useCanvasForward: () => CanvasForward;
|
|
166
|
+
useConversationState: () => ConversationState;
|
|
167
|
+
useSuggestionsWithDefaults: () => SuggestionActions | null;
|
|
168
|
+
useComposerPlaceholder: (opts?: {
|
|
169
|
+
intervalMs?: number;
|
|
170
|
+
seed?: readonly string[];
|
|
171
|
+
}) => string | null;
|
|
172
|
+
useComposerPlaceholderRotation: (opts?: {
|
|
173
|
+
seed?: readonly string[];
|
|
174
|
+
}) => readonly string[];
|
|
175
|
+
useLayout: () => Spec | null;
|
|
176
|
+
useFocalEntityId: () => string | null;
|
|
177
|
+
useInteraction: () => InteractionActions;
|
|
178
|
+
useConversations: () => readonly ConversationSummary[];
|
|
179
|
+
/** True once the visitor is no longer on the seed home view — either they
|
|
180
|
+
* sent a message or navigated the canvas at all. Brand shells use this as
|
|
181
|
+
* the auto-reveal signal for chat/dock surfaces. */
|
|
182
|
+
useHasLeftSeedHome: () => boolean;
|
|
183
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The node that actually EMITS `scroll` events for a given scroll container.
|
|
3
|
+
*
|
|
4
|
+
* A canvas scroller resolves to two different kinds of node:
|
|
5
|
+
* - a real inner `overflow-y: auto` element (the desktop shell) — scroll
|
|
6
|
+
* events fire on the element itself;
|
|
7
|
+
* - `document.scrollingElement` (the mobile shell's genuine document-scroll
|
|
8
|
+
* model) — the DOCUMENT scrolls, and the UA fires those events on the
|
|
9
|
+
* `Document` object, never on the `<html>` element that
|
|
10
|
+
* `scrollingElement` points at. A listener attached to the element is
|
|
11
|
+
* silently dead (this was exactly the fold-on-scroll regression).
|
|
12
|
+
*
|
|
13
|
+
* Applies to `scrollend` for the same reason. `wheel`/`touchmove` do NOT need
|
|
14
|
+
* it — those bubble, so an `<html>`-level listener still sees them.
|
|
15
|
+
*
|
|
16
|
+
* Reading scroll POSITION (`scrollTop`) works on the element in both models —
|
|
17
|
+
* only the event target differs, so listeners must attach here while reads
|
|
18
|
+
* stay on the element. Scoped via `ownerDocument` (never the global
|
|
19
|
+
* `document`/`window`).
|
|
20
|
+
*/
|
|
21
|
+
export declare function scrollEventTarget(el: HTMLElement): HTMLElement | Document;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { Spec } from '../../../spacestation/src/index';
|
|
2
|
+
export interface TurnChangeAnchor {
|
|
3
|
+
/** The element the viewport should land on — its DOM `data-fourty-element`. */
|
|
4
|
+
elementId: string;
|
|
5
|
+
/**
|
|
6
|
+
* When the change is within a resolved item list, the id (DOM `data-flip-id`)
|
|
7
|
+
* of the first item the turn touched — lets the scroll land on the change
|
|
8
|
+
* inside a long component instead of its top. Absent → component-level.
|
|
9
|
+
*/
|
|
10
|
+
refId?: string;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* The finest anchor WITHIN one named element — the same diff classification as
|
|
14
|
+
* `deriveTurnChangeAnchor`, scoped to an element someone else already chose.
|
|
15
|
+
*
|
|
16
|
+
* The live agent-focus path needs exactly this. The agent names the element the
|
|
17
|
+
* turn is about (the focal patch as it streams, or `view.focus.element` after
|
|
18
|
+
* it), and that answer is element-granular — so the viewport lands on the
|
|
19
|
+
* element's TOP, which for a tall component is its title with the actual change
|
|
20
|
+
* far below the fold. `deriveTurnChangeAnchor` can't be reused directly there
|
|
21
|
+
* because it picks the TOPMOST changed element, which is a different question
|
|
22
|
+
* from "where inside THIS one did the change happen".
|
|
23
|
+
*
|
|
24
|
+
* Returns null when the element's subtree did not change in an anchorable way.
|
|
25
|
+
*/
|
|
26
|
+
export declare function changeAnchorWithin(prev: Spec | null, next: Spec, elementId: string): TurnChangeAnchor | null;
|
|
27
|
+
/**
|
|
28
|
+
* Derive the topmost change anchor for the turn that took the canvas from
|
|
29
|
+
* `prev` to `next`. Walks `next` in document (pre-order) order so the first
|
|
30
|
+
* anchorable change found is the topmost on screen. Returns null when there is
|
|
31
|
+
* nothing to anchor (seed render, pure reorder/removal at the root, or no
|
|
32
|
+
* change) — the caller falls back to the view top.
|
|
33
|
+
*/
|
|
34
|
+
export declare function deriveTurnChangeAnchor(prev: Spec | null, next: Spec): TurnChangeAnchor | null;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Spec } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* True when the block `key` differs from the one `prior` held under the same
|
|
4
|
+
* key — `prior` being the layout the turn began on (the previous turn's frozen
|
|
5
|
+
* view). A block `prior` never held was not edited: it was placed, or it
|
|
6
|
+
* belongs to a page the turn did not start from.
|
|
7
|
+
*/
|
|
8
|
+
export declare function turnEditedBlock(key: string, spec: Spec, prior: Spec | null): boolean;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { type SuggestionAction } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Composition hook for canvas-rendered catalog components.
|
|
4
|
+
*
|
|
5
|
+
* Catalog components (`ProductCard`, `CollectionCard`, `ComparisonTable`,
|
|
6
|
+
* `BlogPosts`, `Newsletter`, `CartDrawer`, `CartLineItem`,
|
|
7
|
+
* `WishlistDrawer`, `ProductDetail`) are rendered by the
|
|
8
|
+
* canvas renderer — they have no parent to pass them callback props. So
|
|
9
|
+
* the "click → action meaning" they need lives HERE, in the runtime seam
|
|
10
|
+
* the harness owns, not inside the dumb presentational component.
|
|
11
|
+
*
|
|
12
|
+
* A `@fourty/ui` catalog component must NOT call
|
|
13
|
+
* `useFourtySession().dispatchSuggestionAction(...)` itself — it must not
|
|
14
|
+
* encode click→action meaning. It consumes the ready-made handlers this
|
|
15
|
+
* hook returns and stays a pure renderer; the harness assigns the meaning.
|
|
16
|
+
*
|
|
17
|
+
* Returns `null` when no `<FourtyProvider>` is mounted upstream (Storybook
|
|
18
|
+
* / preview sandboxes). Components fall back to a non-interactive render
|
|
19
|
+
* in that case — the click does nothing rather than crashing.
|
|
20
|
+
*/
|
|
21
|
+
export interface CanvasActions {
|
|
22
|
+
/** Navigate to a product's detail view (`{page:{kind:'product'}}`). */
|
|
23
|
+
navigateToProduct: (productId: string, title: string) => void;
|
|
24
|
+
/** Navigate to an article's detail view (`{page:{kind:'article'}}`). */
|
|
25
|
+
navigateToArticle: (articleId: string, title: string) => void;
|
|
26
|
+
/** Navigate to a collection. Storefront `Collection` doesn't carry
|
|
27
|
+
* productIds at the tile surface, so this round-trips through the
|
|
28
|
+
* agent as a `message` — the agent resolves the collection gid and
|
|
29
|
+
* emits a productGrid layout. */
|
|
30
|
+
showCollection: (collectionTitle: string) => void;
|
|
31
|
+
/** Navigate to a synthetic collection of explicit product ids — the
|
|
32
|
+
* "view all hearted" wishlist affordance. */
|
|
33
|
+
navigateToProductSet: (handle: string, title: string, productIds: string[]) => void;
|
|
34
|
+
/** Dispatch an arbitrary agent-emitted action verbatim — used by
|
|
35
|
+
* in-canvas components like `ComparisonTable` whose cells carry a
|
|
36
|
+
* full `SuggestionAction` the agent authored. */
|
|
37
|
+
dispatchAction: (action: SuggestionAction) => void;
|
|
38
|
+
/** Subscribe a `newsletter.subscribe` submission. */
|
|
39
|
+
subscribeNewsletter: (email: string, buttonLabel: string) => void;
|
|
40
|
+
}
|
|
41
|
+
export declare function useCanvasActions(): CanvasActions | null;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convenience hook for reading layout + interaction state.
|
|
3
|
+
*
|
|
4
|
+
* Layout is sourced from the CanvasController view (the single owner of
|
|
5
|
+
* what's on canvas). The session context still owns `isRunning` /
|
|
6
|
+
* `error` / `responseText` / `sendMessage` / `sendSignal`; those can move
|
|
7
|
+
* to dedicated hooks (`useTurn` for status, `useStream('prose')` for
|
|
8
|
+
* responseText, etc.) as consumers migrate.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useFourtyLayout(): {
|
|
11
|
+
layout: import("../../../spacestation/src/index").Spec;
|
|
12
|
+
isRunning: boolean;
|
|
13
|
+
error: string | null;
|
|
14
|
+
responseText: string;
|
|
15
|
+
sendMessage: (text: string, options?: {
|
|
16
|
+
attachments?: import("../../../spacestation/src/index").AttachmentRef[];
|
|
17
|
+
}) => void;
|
|
18
|
+
sendSignal: (signal: Omit<import("../../../spacestation/src/index").InteractionSignal, "timestamp">) => void;
|
|
19
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ComponentCatalogStructural } from '../../../spacestation/src/index';
|
|
3
|
+
export declare function CatalogProvider({ catalog, children, }: {
|
|
4
|
+
catalog: ComponentCatalogStructural;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function useComponentCatalog(): ComponentCatalogStructural;
|