@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,4 @@
|
|
|
1
|
+
export { Spacefront } from './Spacefront';
|
|
2
|
+
export { loadEngine } from './engine-loader';
|
|
3
|
+
export { HOST_MODULES, HOST_MODULE_SPECIFIERS, type HostModules } from './host-modules';
|
|
4
|
+
export type { SpacefrontProps, HostComponents, PackageBundleModule, FortyEngine } from './types';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import type { AnalyticsConsent } from '../../../spacestation/src/analytics/index';
|
|
3
|
+
import type { ComponentCatalogStructural } from '../../../spacestation/src/index';
|
|
4
|
+
import type { ComponentRegistry } from '../catalog';
|
|
5
|
+
import type { ShellRegistry } from '../shell';
|
|
6
|
+
/**
|
|
7
|
+
* The host app's components — the whole visual vocabulary of its spacefront.
|
|
8
|
+
*
|
|
9
|
+
* A host is a self-contained brand: nothing of ours renders. `catalog` declares
|
|
10
|
+
* every type the agent may compose (the same entries the host publishes to the
|
|
11
|
+
* platform, so agent and client agree on their props) and `renderers` draws
|
|
12
|
+
* each one. Two platform types have no entry to declare but must be drawn,
|
|
13
|
+
* because they are how the agent speaks: `agentText` and `turn`.
|
|
14
|
+
*/
|
|
15
|
+
export interface HostComponents {
|
|
16
|
+
renderers: ComponentRegistry;
|
|
17
|
+
catalog: ComponentCatalogStructural;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* What a brand's PUBLISHED bundle exports — the entry `forty publish` builds
|
|
21
|
+
* when the platform hosts the brand's spacefront. The same components and
|
|
22
|
+
* catalog a self-hosting brand passes to `<Spacefront>`, plus its shell.
|
|
23
|
+
*/
|
|
24
|
+
export interface PackageBundleModule extends HostComponents {
|
|
25
|
+
/** The brand's shell, keyed by name — `default` replaces the platform's. */
|
|
26
|
+
shells?: ShellRegistry;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* What a host app passes to `<Spacefront>`, and what the remote engine's root
|
|
30
|
+
* component receives unchanged. Defined here because it is the contract
|
|
31
|
+
* between the two: the host compiles against it, the engine implements it.
|
|
32
|
+
*/
|
|
33
|
+
export interface SpacefrontProps {
|
|
34
|
+
/** Slug of the space to boot — addresses the public `/s/:slug` API surface. */
|
|
35
|
+
spaceSlug: string;
|
|
36
|
+
/** AMS API origin. The engine bundle is loaded from this same origin. */
|
|
37
|
+
apiUrl: string;
|
|
38
|
+
/** The visitor's analytics consent, as the host's own consent tool reports it. */
|
|
39
|
+
consent: AnalyticsConsent;
|
|
40
|
+
/**
|
|
41
|
+
* The visitor credential for a LOCKED space. A development space is locked;
|
|
42
|
+
* its developers get this from `forty dev-token`. Omit for an open space.
|
|
43
|
+
*/
|
|
44
|
+
token?: string;
|
|
45
|
+
components: HostComponents;
|
|
46
|
+
/** The host's shell: its composer and thread, with `<SpacefrontCanvas />` where the canvas sits. */
|
|
47
|
+
children: ReactNode;
|
|
48
|
+
}
|
|
49
|
+
/** The module shape `engine.mjs` exports. */
|
|
50
|
+
export interface FortyEngine {
|
|
51
|
+
EngineRoot: ComponentType<SpacefrontProps>;
|
|
52
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './analytics';
|
|
2
|
+
export * from './session';
|
|
3
|
+
export * from './shell';
|
|
4
|
+
export * from './provider';
|
|
5
|
+
export * from './canvas';
|
|
6
|
+
export * from './catalog';
|
|
7
|
+
export * from './commerce';
|
|
8
|
+
export * from './widgets/presence';
|
|
9
|
+
export * from './chat';
|
|
10
|
+
export * from './projection';
|
|
11
|
+
export * from './content';
|
|
12
|
+
export * from './social';
|
|
13
|
+
export * from './shared';
|
|
14
|
+
export * from './animation';
|
|
15
|
+
export * from './rendering';
|
|
16
|
+
export * from './interaction';
|
|
17
|
+
export * from './voice';
|
|
18
|
+
export * from './utils';
|
|
19
|
+
export * from './client-state';
|
|
20
|
+
export * from '../../spacestation/src/index';
|
|
21
|
+
export * from '../../ecommerce/src/index';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export type HapticCue =
|
|
2
|
+
/** First agent output of a turn landed — the "it's alive" tick. */
|
|
3
|
+
'arrive';
|
|
4
|
+
/**
|
|
5
|
+
* Play a haptic cue. No-op wherever the platform has no vibration API
|
|
6
|
+
* (iOS Safari, desktop, SSR) or the user has vibration disabled.
|
|
7
|
+
*/
|
|
8
|
+
export declare function hapticCue(cue: HapticCue): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InteractionSignal } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Normalize a batch of queued signals before sending. With the
|
|
4
|
+
* signal vocabulary trimmed to `prompt`/`mount`/`layout_update`, only
|
|
5
|
+
* `layout_update` repeats — keep the latest of each since intermediate
|
|
6
|
+
* canvas states are redundant once a newer one arrives.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeSignals(queued: InteractionSignal[], prompt: InteractionSignal): InteractionSignal[];
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InteractionSignal } from '../../../spacestation/src/index';
|
|
3
|
+
type InteractionCallback = (signal: Omit<InteractionSignal, 'timestamp'>) => void;
|
|
4
|
+
export declare function InteractionProvider({ onInteraction, children, }: {
|
|
5
|
+
onInteraction: InteractionCallback;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
/** Hook for components to emit explicit semantic signals (e.g., add_to_cart). */
|
|
9
|
+
export declare function useInteraction(): InteractionCallback | null;
|
|
10
|
+
interface TrackedComponentProps {
|
|
11
|
+
componentId: string;
|
|
12
|
+
componentType: string;
|
|
13
|
+
/** Human-readable title — kept for future use (e.g. highlight-wire labels). */
|
|
14
|
+
title?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Wraps a component with a per-instance `data-tracked-component`
|
|
18
|
+
* attribute + error boundary. Auto-tracking signal emission (clicks,
|
|
19
|
+
* scroll, hover) was removed when the signal vocabulary collapsed
|
|
20
|
+
* to `prompt`/`mount`/`layout_update`. Components that want to
|
|
21
|
+
* dispatch a signal (e.g. send a prompt, push a layout_update after
|
|
22
|
+
* an inline morph) use `useInteraction()` directly.
|
|
23
|
+
*/
|
|
24
|
+
export declare function withInteractionTracking(WrappedComponent: React.ComponentType<Record<string, unknown>>, meta: TrackedComponentProps): React.ComponentType<Record<string, unknown>>;
|
|
25
|
+
/**
|
|
26
|
+
* Exported so the canvas engine can wrap each element's hydration boundary
|
|
27
|
+
* with the SAME boundary the leaf gets, rather than growing a second
|
|
28
|
+
* implementation. It must be applied from OUTSIDE the component it protects:
|
|
29
|
+
* a boundary rendered inside a component cannot catch that component's own
|
|
30
|
+
* render error, which is exactly the class (a rules-of-hooks throw) that took
|
|
31
|
+
* the whole canvas down (40R-242).
|
|
32
|
+
*/
|
|
33
|
+
export declare class ComponentErrorBoundary extends React.Component<{
|
|
34
|
+
componentId: string;
|
|
35
|
+
children: React.ReactNode;
|
|
36
|
+
}, {
|
|
37
|
+
error: Error | null;
|
|
38
|
+
}> {
|
|
39
|
+
state: {
|
|
40
|
+
error: Error | null;
|
|
41
|
+
};
|
|
42
|
+
static getDerivedStateFromError(error: Error): {
|
|
43
|
+
error: Error;
|
|
44
|
+
};
|
|
45
|
+
componentDidCatch(error: Error, info: React.ErrorInfo): void;
|
|
46
|
+
render(): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("react/jsx-runtime").JSX.Element | null | undefined;
|
|
47
|
+
}
|
|
48
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ProjectionSignalBridge } from './ProjectionSignalBridge';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ProjectionPreferences, type ProjectionDirective } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Apply a `projection.set` payload. Patch semantics: a scope is updated,
|
|
4
|
+
* a `null` clears it, scopes absent are left untouched. `setAll` is the
|
|
5
|
+
* agent's vertical-agnostic path — it expands across every projectable
|
|
6
|
+
* scope the client knows; `set` is the explicit scope-keyed form.
|
|
7
|
+
*/
|
|
8
|
+
export declare function applyProjectionSet(payload: unknown): void;
|
|
9
|
+
/** React hook — re-renders on preference change. */
|
|
10
|
+
export declare function useProjectionPreferences(): ProjectionPreferences;
|
|
11
|
+
/** Resolve the active directive for a scope, or undefined when unset/cleared. */
|
|
12
|
+
export declare function getDirectiveForScope(preferences: ProjectionPreferences, scope: string): ProjectionDirective | undefined;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { PostHydrationTransform } from '../rendering/post-hydration';
|
|
2
|
+
/**
|
|
3
|
+
* The projection transform. `use()` returns `null` when no standing
|
|
4
|
+
* preferences exist — so the no-projection case costs nothing per render.
|
|
5
|
+
* Registered into the post-hydration registry by `index.ts` at module load.
|
|
6
|
+
*/
|
|
7
|
+
export declare const projectionTransform: PostHydrationTransform;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** The platform's GENERIC deciding-question signal. There is nothing
|
|
3
|
+
* ask-special about it — a widget consumes this signal type like any other. */
|
|
4
|
+
export declare const AGENT_ASK_SIGNAL = "agent_ask";
|
|
5
|
+
/**
|
|
6
|
+
* AgentAsk — the default widget that CONSUMES the `agent_ask` signal (a generic
|
|
7
|
+
* deciding question + optional quick replies). It is a plain signal consumer:
|
|
8
|
+
* `useConsumeStandingSignal('agent_ask')`, read `ask` / `suggestions` straight
|
|
9
|
+
* off the payload, render. No ask store, no ask hook — `agent_ask` is just a
|
|
10
|
+
* signal, and this is just the widget that happens to render it.
|
|
11
|
+
*
|
|
12
|
+
* UI-infra only — emits `fourty-ask*` class-hooked markup with ZERO skin; the
|
|
13
|
+
* THEME stylesheet owns the look. Brand-specific prompts are their own signals
|
|
14
|
+
* consumed by their own widgets (e.g. the wardrobe's keep-offer).
|
|
15
|
+
*/
|
|
16
|
+
export declare function AgentAsk(): React.ReactElement | null;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useRegisterSignalHandlers, HandlerRegistryContext, type SignalHandler, type HandlerRegistryValue, } from './providers/handler-registry';
|
|
2
|
+
export { AgentAsk, AGENT_ASK_SIGNAL } from './AgentAsk';
|
|
3
|
+
export { useClampToggle, type ClampToggle } from './use-clamp-toggle';
|
|
4
|
+
export { useTimedFlag } from './use-timed-flag';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type SignalHandler = (payload: Record<string, unknown>) => void | Promise<void>;
|
|
2
|
+
export interface HandlerRegistryValue {
|
|
3
|
+
/** Register a batch of handlers; returns an unregister callback. */
|
|
4
|
+
register: (handlers: Record<string, SignalHandler>) => () => void;
|
|
5
|
+
}
|
|
6
|
+
export declare const HandlerRegistryContext: import("react").Context<HandlerRegistryValue | null>;
|
|
7
|
+
/**
|
|
8
|
+
* Imperative registration for descendant providers. Call inside an effect
|
|
9
|
+
* (or once at module mount); the returned cleanup unregisters.
|
|
10
|
+
*/
|
|
11
|
+
export declare function useRegisterSignalHandlers(handlers: Record<string, SignalHandler>): void;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Read-more toggle for line-clamped content. Tracks expand state AND
|
|
4
|
+
* measures (via ResizeObserver) whether the clamped element actually
|
|
5
|
+
* overflows — so the caller renders the toggle only when content is
|
|
6
|
+
* genuinely clipped, never as an empty band of dead space.
|
|
7
|
+
*
|
|
8
|
+
* Measurement is suspended while expanded: an unclamped element has
|
|
9
|
+
* `scrollHeight === clientHeight` by definition, so leaving it on would
|
|
10
|
+
* flip `overflowing` back to false the moment the visitor opens it.
|
|
11
|
+
*
|
|
12
|
+
* Attach `ref` to the clamped element; pass `contentKey` (e.g. the
|
|
13
|
+
* text) so a content change re-measures.
|
|
14
|
+
*/
|
|
15
|
+
export interface ClampToggle<T extends HTMLElement> {
|
|
16
|
+
expanded: boolean;
|
|
17
|
+
toggle: () => void;
|
|
18
|
+
/** True when the clamped element is currently clipping content. */
|
|
19
|
+
overflowing: boolean;
|
|
20
|
+
ref: React.RefObject<T | null>;
|
|
21
|
+
}
|
|
22
|
+
export declare function useClampToggle<T extends HTMLElement>(contentKey: unknown): ClampToggle<T>;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Result {
|
|
2
|
+
/** Current flag state. */
|
|
3
|
+
flag: boolean;
|
|
4
|
+
/** Flip flag → true, auto-revert to false after `durationMs`. */
|
|
5
|
+
trigger: () => void;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Transient boolean — `trigger()` sets it true and schedules an
|
|
9
|
+
* automatic revert. Cancels any pending revert before scheduling a new
|
|
10
|
+
* one so rapid re-triggers extend the visible window instead of racing.
|
|
11
|
+
*
|
|
12
|
+
* Generic UI feedback primitive — "Added", "Copied", "Saved" style
|
|
13
|
+
* confirmations; toast auto-dismiss; one-shot flashes.
|
|
14
|
+
*/
|
|
15
|
+
export declare function useTimedFlag(durationMs: number): Result;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { registerPostHydrationTransform, usePostHydrationTransforms, type HydratedPropsTransform, type PostHydrationTransform, } from './post-hydration';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { ResolvedPath } from '../../../spacestation/src/index';
|
|
2
|
+
/** Identifies the element a transform is acting on. */
|
|
3
|
+
interface PostHydrationContext {
|
|
4
|
+
/** The element's stable id (UIElement key). */
|
|
5
|
+
elementId: string;
|
|
6
|
+
/** Resolved-field paths declared by the component's catalog entry. */
|
|
7
|
+
resolvedPaths: readonly ResolvedPath[];
|
|
8
|
+
/** Optional render-local collector for entities removed because they could
|
|
9
|
+
* not be loaded. Omit when the consumer does not display failure feedback.
|
|
10
|
+
* Must only accumulate into the current call, never update external state. */
|
|
11
|
+
reportUnavailable?: (count: number) => void;
|
|
12
|
+
}
|
|
13
|
+
/** A pure props transform applied after hydration, before render. */
|
|
14
|
+
export type HydratedPropsTransform = (props: Record<string, unknown>, ctx: PostHydrationContext) => Record<string, unknown>;
|
|
15
|
+
/**
|
|
16
|
+
* A registered post-hydration transform. `use()` is a hook (runs once per
|
|
17
|
+
* `HydratedComponent` render) that wires the transform's reactive inputs
|
|
18
|
+
* (stores, facts) and returns the pure transform — or `null` when the
|
|
19
|
+
* transform is inert this render.
|
|
20
|
+
*/
|
|
21
|
+
export interface PostHydrationTransform {
|
|
22
|
+
/** Stable id — re-registering the same id replaces (HMR-safe). */
|
|
23
|
+
id: string;
|
|
24
|
+
use: () => HydratedPropsTransform | null;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Register a post-hydration transform. Call at module-load time only.
|
|
28
|
+
* Idempotent by `id`.
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerPostHydrationTransform(transform: PostHydrationTransform): void;
|
|
31
|
+
/**
|
|
32
|
+
* Compose all registered transforms into one `apply` function, called once
|
|
33
|
+
* per `HydratedComponent` render. Returns identity when nothing is
|
|
34
|
+
* registered — the render path stays free when no feature is installed.
|
|
35
|
+
*/
|
|
36
|
+
export declare function usePostHydrationTransforms(): HydratedPropsTransform;
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
import type { InteractionSignal, SuggestionAction, SuggestionActions, AgentSignal, PhaseProgress, ChatMessage, ConversationSummary, AttachmentRef } from '../../../spacestation/src/index';
|
|
2
|
+
export interface FourtySessionContextValue {
|
|
3
|
+
sessionId: string | null;
|
|
4
|
+
/**
|
|
5
|
+
* Per-space client-storage namespace this session's `FourtyClient` is
|
|
6
|
+
* keyed on (the SpaceRef value — id or slug). Callers outside the SDK
|
|
7
|
+
* that need to read the client's own storage directly (e.g. an admin
|
|
8
|
+
* inspector reading `loadVisitorMemory`) key off this rather than
|
|
9
|
+
* re-deriving it from a slug/route param, which can silently drift from
|
|
10
|
+
* what the client actually used.
|
|
11
|
+
*/
|
|
12
|
+
spaceKey: string;
|
|
13
|
+
isRunning: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* Optimistic "turn submitted, awaiting the server's first ack" flag — true
|
|
16
|
+
* the instant the visitor sends, before `isRunning` (which only flips on the
|
|
17
|
+
* server's `agent_ack`). Read `isSubmitting || isRunning` for an immediate
|
|
18
|
+
* "agent is working" signal that covers the send→ack network gap.
|
|
19
|
+
*/
|
|
20
|
+
isSubmitting: boolean;
|
|
21
|
+
error: string | null;
|
|
22
|
+
/** True while the runtime is auto-retrying a dropped mid-turn connection
|
|
23
|
+
* before falling back to `error` — see `SessionRuntime.handleTransportClose`.
|
|
24
|
+
* Brand shells should show a calm "reconnecting" state, not the error UI,
|
|
25
|
+
* while this is true. */
|
|
26
|
+
reconnecting: boolean;
|
|
27
|
+
/** 1-indexed attempt currently in flight; 0 when not reconnecting. */
|
|
28
|
+
reconnectAttempt: number;
|
|
29
|
+
/** Total attempts the runtime will make before giving up. */
|
|
30
|
+
reconnectMaxAttempts: number;
|
|
31
|
+
responseText: string;
|
|
32
|
+
/**
|
|
33
|
+
* Live reasoning/thinking text streamed from `reasoning_delta` events
|
|
34
|
+
* during the model's thinking phase (Gemini thinking, Anthropic
|
|
35
|
+
* extended-thinking). Accumulates while the turn is running and is
|
|
36
|
+
* cleared on `done`. Empty string between turns. Brand shells can
|
|
37
|
+
* surface this in a "thinking" whisper while waiting for prose tokens.
|
|
38
|
+
*/
|
|
39
|
+
reasoningText: string;
|
|
40
|
+
messages: ChatMessage[];
|
|
41
|
+
suggestions: SuggestionActions | null;
|
|
42
|
+
webmcpConfig: Record<string, {
|
|
43
|
+
description?: string;
|
|
44
|
+
enabled?: boolean;
|
|
45
|
+
}>;
|
|
46
|
+
pendingSignals: InteractionSignal[];
|
|
47
|
+
/**
|
|
48
|
+
* Latest agent `phase_progress` signal — what the agent is doing
|
|
49
|
+
* right now (label, optional sub-step counts, optional preview
|
|
50
|
+
* thumbnails). `null` between turns and while the agent is in a
|
|
51
|
+
* step that hasn't emitted progress yet. Cleared on `done` / `error`.
|
|
52
|
+
* Brand shells render this however they want; the SDK only owns
|
|
53
|
+
* the state. See `defaultPhaseLabel()` for visitor-friendly defaults.
|
|
54
|
+
*/
|
|
55
|
+
currentProgress: PhaseProgress | null;
|
|
56
|
+
/**
|
|
57
|
+
* The prompt this ARRIVAL carried, auto-submitted on this page load — the
|
|
58
|
+
* `?intent=` on the entry URL, which the host reads and strips before
|
|
59
|
+
* anything renders (`useSpacefrontEntry`). `null` on a visit that carried
|
|
60
|
+
* none, which is most of them.
|
|
61
|
+
*
|
|
62
|
+
* Kept as a fact about the visit rather than a flag about a turn, because
|
|
63
|
+
* the entry param is gone from the address bar by the time any canvas
|
|
64
|
+
* surface mounts, and re-reading `location.search` would be both racy and a
|
|
65
|
+
* `window` read inside React. A surface that must know "is the agent working
|
|
66
|
+
* on the ask this visitor arrived with" compares it to the streaming turn's
|
|
67
|
+
* `userMessage` — see `CanvasBootLoader`.
|
|
68
|
+
*/
|
|
69
|
+
openingPrompt: string | null;
|
|
70
|
+
/**
|
|
71
|
+
* The visitor's in-progress composer text — the ONE draft, shared by every
|
|
72
|
+
* prompt surface. Lives on session state so it survives an input surface
|
|
73
|
+
* unmounting: the mobile morph island preserves a half-typed message as it
|
|
74
|
+
* morphs open/closed, folds to the scroll FAB, or drops into voice and back,
|
|
75
|
+
* and the resting island bar ⇄ conversation-sheet composer edit the same
|
|
76
|
+
* text. Read it with `useComposerDraft()` — see below.
|
|
77
|
+
*
|
|
78
|
+
* Exposed as a subscribable STORE rather than a plain field on purpose. The
|
|
79
|
+
* draft changes on every keystroke, and this context value is one memoized
|
|
80
|
+
* object: a field here gives it a new identity per character, re-rendering
|
|
81
|
+
* every `useFourtySession()` consumer in the tree. That is what made typing
|
|
82
|
+
* re-render the presence notch — the notch only reads `isRunning`/
|
|
83
|
+
* `isSubmitting` (via `useAgentPresence`) but paid for the draft. Behind its
|
|
84
|
+
* own store, only the composer re-renders as the visitor types.
|
|
85
|
+
*/
|
|
86
|
+
composerDraftStore: {
|
|
87
|
+
subscribe: (onChange: () => void) => () => void;
|
|
88
|
+
get: () => string;
|
|
89
|
+
};
|
|
90
|
+
/** Set the shared composer draft (see `composerDraftStore`). Local-only; the
|
|
91
|
+
* send path clears it. */
|
|
92
|
+
setComposerDraft: (text: string) => void;
|
|
93
|
+
/**
|
|
94
|
+
* Send the visitor's turn. `options.attachments` carries files the visitor
|
|
95
|
+
* attached this turn (already uploaded via `uploadAttachment`); the agent
|
|
96
|
+
* receives them as multimodal message parts.
|
|
97
|
+
*/
|
|
98
|
+
sendMessage: (text: string, options?: {
|
|
99
|
+
attachments?: AttachmentRef[];
|
|
100
|
+
}) => void;
|
|
101
|
+
sendSignal: (signal: Omit<InteractionSignal, 'timestamp'>) => void;
|
|
102
|
+
/**
|
|
103
|
+
* Fire a signal over the WS immediately — bypasses the interact()
|
|
104
|
+
* batch. Use for commit-shaped client observations the agent should
|
|
105
|
+
* see between turns (variant click, sort change, filter toggle).
|
|
106
|
+
* The agent's slot extractor judges what (if anything) to persist
|
|
107
|
+
* as a fact.
|
|
108
|
+
*/
|
|
109
|
+
sendImmediateSignal: (signal: Omit<InteractionSignal, 'timestamp'>) => void;
|
|
110
|
+
stopGeneration: () => void;
|
|
111
|
+
/**
|
|
112
|
+
* Visitor-initiated cancel of the in-flight turn — fires the server's
|
|
113
|
+
* abort signal AND closes the client subscriber. Surface this on Stop
|
|
114
|
+
* buttons + ESC key handlers so the server stops spending tokens on an
|
|
115
|
+
* answer the visitor is no longer waiting for. Safe no-op when nothing
|
|
116
|
+
* is in flight (`isStreaming === false`).
|
|
117
|
+
*/
|
|
118
|
+
abortGeneration: () => void;
|
|
119
|
+
clearSignals: () => void;
|
|
120
|
+
clearSession: () => void;
|
|
121
|
+
/**
|
|
122
|
+
* Forget the visitor entirely — drops the durable visitor identity + cached
|
|
123
|
+
* visitor-memory (attributes/notes) on top of a `clearSession`. The next
|
|
124
|
+
* session is a genuine first-time visitor with no KNOWN-VISITOR seed.
|
|
125
|
+
* Contrast `clearSession`, which KEEPS the identity + memory so anonymous
|
|
126
|
+
* cross-session personalization survives a new session.
|
|
127
|
+
*
|
|
128
|
+
* Resolves once the full reset (server deletes + local clears + re-init)
|
|
129
|
+
* has completed — hosts that must sequence work after the reset (e.g. the
|
|
130
|
+
* playground reminting its pinned visitor id) await it. Never rejects:
|
|
131
|
+
* failures are logged and the reset proceeds best-effort.
|
|
132
|
+
*/
|
|
133
|
+
forgetVisitor: () => Promise<void>;
|
|
134
|
+
/**
|
|
135
|
+
* Mint a read-only share link for the current canvas, resolving to the full
|
|
136
|
+
* URL — or `null` when this space/session cannot be shared (surface that,
|
|
137
|
+
* never a broken link).
|
|
138
|
+
*
|
|
139
|
+
* Deliberately NOT "copy the current URL": on the public slug surface the
|
|
140
|
+
* session id is a write-and-delete credential, so the shareable thing has to
|
|
141
|
+
* be a separate, weaker token minted server-side.
|
|
142
|
+
*/
|
|
143
|
+
shareCanvas: () => Promise<string | null>;
|
|
144
|
+
/**
|
|
145
|
+
* The visitor's recent conversations (most-recent-first), LOCAL to this
|
|
146
|
+
* browser. Includes the current one once it has a message. Drives the
|
|
147
|
+
* "switch back to an older conversation" affordance. Empty when the visitor
|
|
148
|
+
* has only ever had the one (or none).
|
|
149
|
+
*/
|
|
150
|
+
recentConversations: ConversationSummary[];
|
|
151
|
+
/**
|
|
152
|
+
* Start a fresh conversation while ARCHIVING the current one — the prior
|
|
153
|
+
* conversation stays in `recentConversations` and is restorable via
|
|
154
|
+
* `switchConversation`. Contrast `clearSession`, which hard-deletes.
|
|
155
|
+
*/
|
|
156
|
+
newConversation: () => void;
|
|
157
|
+
/** Switch to an existing conversation by session id, restoring it from the server. */
|
|
158
|
+
switchConversation: (sessionId: string) => void;
|
|
159
|
+
clearSuggestions: () => void;
|
|
160
|
+
/** Clear the current error (e.g. after dismissing the error banner). */
|
|
161
|
+
clearError: () => void;
|
|
162
|
+
/**
|
|
163
|
+
* Upload a file the visitor attached to the composer. Resolves to the
|
|
164
|
+
* `AttachmentRef` to pass back on `sendMessage(text, { attachments })`.
|
|
165
|
+
* Rejects with a visitor-safe message on a disallowed type / oversize /
|
|
166
|
+
* upload failure.
|
|
167
|
+
*/
|
|
168
|
+
uploadAttachment: (file: File) => Promise<AttachmentRef>;
|
|
169
|
+
/**
|
|
170
|
+
* Strict dispatch — used for agent-emitted signals (auto-routed from the
|
|
171
|
+
* agent's signal stream) and component-side state broadcasts (variant
|
|
172
|
+
* picks, scroll position, filter changes). Looks up `signal.type` in:
|
|
173
|
+
* 1. registered `handlers` / `signalHandlers`
|
|
174
|
+
* 2. SDK built-ins (`message`, `navigate`)
|
|
175
|
+
* 3. catalog slot bindings (auto-routes to the bound component prop)
|
|
176
|
+
*
|
|
177
|
+
* Unknown types warn and return — the signal is dropped. NEVER falls
|
|
178
|
+
* back to synthesizing a `message`. Use this for any dispatch that is
|
|
179
|
+
* NOT a visitor clicking on a chip.
|
|
180
|
+
*/
|
|
181
|
+
dispatchSignal: (signal: AgentSignal) => void;
|
|
182
|
+
/**
|
|
183
|
+
* Subscribe to the RAW agent-signal stream — every signal the agent
|
|
184
|
+
* emits, before handler dispatch. Use for hooks that need to react to
|
|
185
|
+
* specific signal types without going through the handler registry
|
|
186
|
+
* (e.g. the composer placeholder rotation, live chip-rail mirror).
|
|
187
|
+
* Returns an unsubscribe fn — caller MUST invoke it on unmount.
|
|
188
|
+
*/
|
|
189
|
+
subscribeSignals: (listener: (signal: AgentSignal) => void) => () => void;
|
|
190
|
+
/**
|
|
191
|
+
* Chip-click dispatch — same resolution order as `dispatchSignal`, but
|
|
192
|
+
* falls back to `message(signal.label)` when no handler is registered.
|
|
193
|
+
* Designed for visitor-initiated chip taps: chip-gen occasionally emits
|
|
194
|
+
* unsanctioned types and the fallback keeps the click from dead-ending.
|
|
195
|
+
* Use ONLY for actual onClick handlers in chip components.
|
|
196
|
+
*/
|
|
197
|
+
dispatchSuggestionAction: (action: SuggestionAction) => void;
|
|
198
|
+
}
|
|
199
|
+
export declare const FourtySessionContext: import("react").Context<FourtySessionContextValue | null>;
|
|
200
|
+
export declare function useFourtySession(): FourtySessionContextValue;
|
|
201
|
+
/**
|
|
202
|
+
* Non-throwing variant — `null` when no `<FourtyProvider>` is mounted.
|
|
203
|
+
*
|
|
204
|
+
* A hook that THROWS cannot be made optional by wrapping the call in
|
|
205
|
+
* `try/catch`: the throw skips every hook after it, so the same component
|
|
206
|
+
* renders a different number of hooks depending on whether a provider happens
|
|
207
|
+
* to be mounted, and React tears the tree down (error #310). Catalog hooks that
|
|
208
|
+
* must survive a bare render — preview harnesses, unit tests, a brand component
|
|
209
|
+
* mounted outside the engine — read the context through this and branch on the
|
|
210
|
+
* `null`, with their own hooks called unconditionally either way.
|
|
211
|
+
*
|
|
212
|
+
* Mirrors `useOptionalCommerceClient()`, which exists for the same reason.
|
|
213
|
+
*/
|
|
214
|
+
export declare function useOptionalFourtySession(): FourtySessionContextValue | null;
|
|
215
|
+
/**
|
|
216
|
+
* The shared composer draft — `[value, setValue]`, subscribed narrowly.
|
|
217
|
+
*
|
|
218
|
+
* Subscribes to the draft store directly instead of reading a field off the
|
|
219
|
+
* session context, so a keystroke re-renders ONLY the components that display
|
|
220
|
+
* the draft. Reading it through `useFourtySession()` re-rendered every consumer
|
|
221
|
+
* in the tree on every character — including the presence notch, which just
|
|
222
|
+
* wants `isRunning`.
|
|
223
|
+
*
|
|
224
|
+
* Brands should not normally call this: wire a composer through
|
|
225
|
+
* `usePromptComposer()` (`@fourty/ui/shell`), which handles draft, attachments,
|
|
226
|
+
* dictation and submit together. This is the primitive underneath it.
|
|
227
|
+
*/
|
|
228
|
+
export declare function useComposerDraft(): [string, (text: string) => void];
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type SessionScopedClearHandler = () => void;
|
|
2
|
+
/** Register a session-scoped clear handler. Returns an unsubscribe function. */
|
|
3
|
+
export declare function registerSessionScopedClear(handler: SessionScopedClearHandler): () => void;
|
|
4
|
+
/** Fire every registered clear handler, isolating failures per handler. */
|
|
5
|
+
export declare function runSessionScopedClearHandlers(): void;
|
|
6
|
+
export {};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { useFourtySession, useOptionalFourtySession, useComposerDraft, FourtySessionContext, type FourtySessionContextValue, } from './FourtySessionContext';
|
|
2
|
+
export { useAction } from './use-action';
|
|
3
|
+
export { getVisitorLocale } from './visitor-locale';
|
|
4
|
+
export { registerSessionScopedClear, runSessionScopedClearHandlers } from './clear-registry';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { SuggestionActionInput } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* The click handler for anything a visitor can act on — a banner button, a
|
|
4
|
+
* nav link, a tile — dispatching one platform action (`navigate`, `message`,
|
|
5
|
+
* a cart or agent action). The component stays a dumb element; this hook owns
|
|
6
|
+
* the action-dispatch policy.
|
|
7
|
+
*
|
|
8
|
+
* Resolution rules:
|
|
9
|
+
* - `action` provided AND dispatchable → dispatch as-is. id is synthesized
|
|
10
|
+
* from label+type when missing; payload defaults to `{}`.
|
|
11
|
+
* - `action` provided but UNDISPATCHABLE (a `navigate` whose payload is not
|
|
12
|
+
* a valid `Page` — the agent writes `{productId}` instead of
|
|
13
|
+
* `{page:{kind:'product',id}}`) → same message fallback. The handler
|
|
14
|
+
* would reject that payload and return, leaving a button that looks
|
|
15
|
+
* live and does nothing; this boundary is where an action prop becomes
|
|
16
|
+
* a signal, so it is where a dead control has to be made impossible.
|
|
17
|
+
* - `action` omitted → synthesize `{type: 'message', payload: {text: label}}`
|
|
18
|
+
* so a minimal `{label: "Shop Now"}` control still goes through the agent
|
|
19
|
+
* rather than triggering a hard URL change.
|
|
20
|
+
*
|
|
21
|
+
* Returns null when no `<FourtyProvider>` is mounted upstream — e.g. inside
|
|
22
|
+
* a Storybook sandbox. Components should fall back to a non-interactive
|
|
23
|
+
* render in that case (the click does nothing rather than crashing).
|
|
24
|
+
*/
|
|
25
|
+
export declare function useAction(label: string, action?: SuggestionActionInput): (() => void) | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useExpandable — boolean toggle for "read more / read less" affordances.
|
|
3
|
+
* Brands compose with their own clamp / max-height styling.
|
|
4
|
+
*/
|
|
5
|
+
export declare function useExpandable(initial?: boolean): {
|
|
6
|
+
expanded: boolean;
|
|
7
|
+
toggle: () => void;
|
|
8
|
+
setExpanded: (next: boolean) => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* useImageHover — boolean hover state plus the two handlers brands wire
|
|
3
|
+
* onto a card root. Returns a `hoverProps` object that spreads onto the
|
|
4
|
+
* tracked element. Used by ProductCard, BlogCard, CollectionTile —
|
|
5
|
+
* anywhere the visual switches on hover.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useImageHover(): {
|
|
8
|
+
hover: boolean;
|
|
9
|
+
hoverProps: {
|
|
10
|
+
onMouseEnter: () => void;
|
|
11
|
+
onMouseLeave: () => void;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scroll-container registry. Brand shells own the actual scroller
|
|
3
|
+
* (overflow:auto container that wraps the canvas). SDK code — navigation
|
|
4
|
+
* scroll-reset, session restore scroll-to-bottom, composer
|
|
5
|
+
* scroll-into-view — needs to address that element without knowing the
|
|
6
|
+
* shell's DOM or classnames.
|
|
7
|
+
*
|
|
8
|
+
* FourtyProvider creates a `RefObject<HTMLElement | null>` and supplies
|
|
9
|
+
* it via `ScrollContainerProvider`. Brand shells attach the ref to their
|
|
10
|
+
* scrollable element (`<main ref={ref}>`). Consumers read `ref.current`
|
|
11
|
+
* imperatively (inside effects / event handlers).
|
|
12
|
+
*/
|
|
13
|
+
import React from 'react';
|
|
14
|
+
export type ScrollContainerRef = React.MutableRefObject<HTMLElement | null>;
|
|
15
|
+
export declare function ScrollContainerProvider({ value, children, }: {
|
|
16
|
+
value: ScrollContainerRef;
|
|
17
|
+
children: React.ReactNode;
|
|
18
|
+
}): React.ReactElement;
|
|
19
|
+
/**
|
|
20
|
+
* Returns the shared scroll-container ref. Throws when used outside
|
|
21
|
+
* `<ScrollContainerProvider>` — every spacefront mount goes through
|
|
22
|
+
* FourtyProvider which installs the provider, so a missing context is a
|
|
23
|
+
* real wiring bug.
|
|
24
|
+
*/
|
|
25
|
+
export declare function useScrollContainerRef(): ScrollContainerRef;
|