@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,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-element hydration state. SDK computes once at the hydration
|
|
3
|
+
* boundary (`HydratedComponent`, also in this package); leaves opt in via
|
|
4
|
+
* `useHydrationState()`.
|
|
5
|
+
*
|
|
6
|
+
* Industry-standard pattern — context + hook (`useNavigation`,
|
|
7
|
+
* `useFormContext`, `useQueryClient`). NOT a `__loading` prop on every
|
|
8
|
+
* leaf: prop injection forces every leaf to declare an `__loading?: boolean`,
|
|
9
|
+
* leaks SDK concerns into the public component API, and bloats the
|
|
10
|
+
* catalog schema the LLM sees with knobs it has no business touching.
|
|
11
|
+
*
|
|
12
|
+
* - `hasResolvedFields`: this element declares any `resolved()` fields.
|
|
13
|
+
* - `hydrating`: a hydrator is currently running for this element.
|
|
14
|
+
* - `settled`: a hydration pass has run to completion for the CURRENT
|
|
15
|
+
* props. False from the moment new resolved refs arrive until the
|
|
16
|
+
* resolve finishes — the gap the `hydrating` flag itself misses,
|
|
17
|
+
* because `hydrating` is set inside a post-paint effect.
|
|
18
|
+
* - `awaitingRefs`: at least one resolved field has zero refs (the agent
|
|
19
|
+
* has placed the element in the layout but hasn't filled in the IDs yet).
|
|
20
|
+
* Useful for distinguishing "still streaming" from "intentionally empty".
|
|
21
|
+
* - `loading`: the SKELETON-VS-CONTENT decision. Derived from the raw
|
|
22
|
+
* fields above once at the boundary; leaves read this directly instead
|
|
23
|
+
* of re-deriving. False for elements with no resolved fields.
|
|
24
|
+
* - `pendingCount`: how many entity refs are present while the hydration pass
|
|
25
|
+
* has not settled (including after the first entities land) at
|
|
26
|
+
* the element's primary resolved path. This is the RESERVE-AND-REVEAL
|
|
27
|
+
* count: a list component renders exactly this many of its OWN cards in a
|
|
28
|
+
* reserved state (so the "skeleton" IS the real component chrome — exact
|
|
29
|
+
* parity, no drift), then reveals each as its entity lands. 0 when the
|
|
30
|
+
* count isn't known yet (pure type-stub, before any ref) — the leaf then
|
|
31
|
+
* falls back to its own default reserve count.
|
|
32
|
+
* - `errors`: human-readable hydration failures captured during the most
|
|
33
|
+
* recent run (empty refs, missing hydrator, hydrator threw, etc.).
|
|
34
|
+
*/
|
|
35
|
+
export interface HydrationState {
|
|
36
|
+
hasResolvedFields: boolean;
|
|
37
|
+
hydrating: boolean;
|
|
38
|
+
settled: boolean;
|
|
39
|
+
awaitingRefs: boolean;
|
|
40
|
+
loading: boolean;
|
|
41
|
+
pendingCount: number;
|
|
42
|
+
errors: string[];
|
|
43
|
+
}
|
|
44
|
+
export declare const HydrationStateContext: import("react").Context<HydrationState>;
|
|
45
|
+
export declare function useHydrationState(): HydrationState;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HydratorMap } from './normalize-components';
|
|
3
|
+
export declare function HydratorProvider({ hydrators, children, }: {
|
|
4
|
+
hydrators: HydratorMap;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function useHydrators(): HydratorMap;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import { type CatalogEntryStructural, type ComponentCatalogStructural } from '../../../spacestation/src/index';
|
|
3
|
+
/**
|
|
4
|
+
* A component as the platform's componentMap holds it — props are an open
|
|
5
|
+
* `Record<string, unknown>`. The catalog Zod schema validates the LLM's
|
|
6
|
+
* output upstream, so the runtime shape is trusted at this boundary.
|
|
7
|
+
*/
|
|
8
|
+
export type BrandComponent = React.ComponentType<Record<string, unknown>>;
|
|
9
|
+
/**
|
|
10
|
+
* Adapt a typed React component to the open `BrandComponent` shape the
|
|
11
|
+
* platform's componentMap requires. The wrapper forwards props verbatim —
|
|
12
|
+
* React typing handles the runtime shape; the catalog schema validates at
|
|
13
|
+
* the boundary. Every UI package needs exactly this adapter, so it lives
|
|
14
|
+
* here once instead of being re-declared per package.
|
|
15
|
+
*/
|
|
16
|
+
export declare function adaptComponent(Inner: React.ElementType): BrandComponent;
|
|
17
|
+
/**
|
|
18
|
+
* Render-suppressed component for catalog types whose data is consumed by a
|
|
19
|
+
* stream rather than rendered in the layout — e.g. `agentText`, whose prose
|
|
20
|
+
* streams via TLS `T:` lines instead of a layout element. Registered so a
|
|
21
|
+
* stale element from an old session renders nothing rather than crashing.
|
|
22
|
+
*/
|
|
23
|
+
export declare const NullComponent: BrandComponent;
|
|
24
|
+
/**
|
|
25
|
+
* Zip a `ComponentCatalog` with a component map into the
|
|
26
|
+
* `Array<{ component } & CatalogEntryStructural>` shape the platform's
|
|
27
|
+
* package loader expects. Replaces the hand-rolled `Object.entries(...).map`
|
|
28
|
+
* each UI package otherwise re-implements.
|
|
29
|
+
*/
|
|
30
|
+
export declare function buildComponentLibrary(catalog: ComponentCatalogStructural, componentMap: Record<string, BrandComponent>): Array<{
|
|
31
|
+
component: BrandComponent;
|
|
32
|
+
} & CatalogEntryStructural>;
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The user-authoring vocabulary — how a brand package declares a catalog
|
|
3
|
+
* component.
|
|
4
|
+
*
|
|
5
|
+
* A brand used to author FOUR things per component: a catalog entry (type +
|
|
6
|
+
* propsSchema + examples + layout metadata), a `componentMap` renderer entry, a
|
|
7
|
+
* `.md` manifest filed under a `catalogs/<bucket>/` tree, and — for brands on
|
|
8
|
+
* the old `composeBrandCatalog({ base: 'all' })` path — a base selection to
|
|
9
|
+
* inherit and subtract from. Those could drift from each other, and did: a type
|
|
10
|
+
* added to `@fourty/ui`'s base catalog flowed into every `base: 'all'` brand
|
|
11
|
+
* automatically, but renderers are hand-authored, so the brand broke at IMPORT
|
|
12
|
+
* time on a catalog↔renderer parity throw.
|
|
13
|
+
*
|
|
14
|
+
* Here a component declares itself ONCE, beside its own render function, and
|
|
15
|
+
* integration is a single `registerLibrary(components)` call. Catalog entry and
|
|
16
|
+
* renderer are the same declaration, so they cannot diverge.
|
|
17
|
+
*
|
|
18
|
+
* ── Compiles down to today's contract ──────────────────────────────────────
|
|
19
|
+
* This is a typed layer over Zod, not a replacement for it. `entity()` emits
|
|
20
|
+
* exactly what `resolved()` emits; `text` emits a `prose()`-marked string.
|
|
21
|
+
* Every downstream consumer — `getResolvedPaths`/`getProsePaths` in
|
|
22
|
+
* `HydratedComponent`, `resolvedTopLevelProps` in the agentic overlay,
|
|
23
|
+
* `findFunctionPropPaths` in the interaction contract, and the agent's catalog
|
|
24
|
+
* prompt generation — keeps working unchanged, because it still receives an
|
|
25
|
+
* ordinary tagged Zod schema. That also makes adoption incremental: a brand can
|
|
26
|
+
* convert one component at a time and leave the rest on the old shape.
|
|
27
|
+
*/
|
|
28
|
+
import * as React from 'react';
|
|
29
|
+
import { z } from 'zod';
|
|
30
|
+
import { type CatalogEntryStructural } from '../../../spacestation/src/index';
|
|
31
|
+
import { type BrandComponent } from './component-library';
|
|
32
|
+
/**
|
|
33
|
+
* A hydrated ENTITY REFERENCE prop.
|
|
34
|
+
*
|
|
35
|
+
* The agent emits ids (`gid://shopify/Product/123`), never entity bodies — that
|
|
36
|
+
* is the ~80% prompt-token saving — and the client hydrates them at the render
|
|
37
|
+
* boundary.
|
|
38
|
+
*
|
|
39
|
+
* `resolverKey` is looked up in the platform HYDRATOR REGISTRY
|
|
40
|
+
* (`registerPlatformHydrators`), so this deliberately does NOT take an entity
|
|
41
|
+
* schema. A brand naming `'product'` should not also have to import
|
|
42
|
+
* `ProductSchema` from `@fourty/ecommerce`: the agent never emits a Product, and
|
|
43
|
+
* the hydrated shape the component receives is decided by the hydrator, not the
|
|
44
|
+
* brand. Keeping the key opaque here is also what keeps `@fourty/sdk` free of
|
|
45
|
+
* any one platform's vocabulary — Shopify registers `product`/`collection`/
|
|
46
|
+
* `article`/`page`/`policy`, another platform registers its own, and both get
|
|
47
|
+
* this vocabulary for free.
|
|
48
|
+
*
|
|
49
|
+
* `max: 1` yields a single ref; anything else yields an array, matching
|
|
50
|
+
* `resolved()`'s own behaviour.
|
|
51
|
+
*/
|
|
52
|
+
export declare function entity(resolverKey: string, opts?: {
|
|
53
|
+
min?: number;
|
|
54
|
+
max?: number;
|
|
55
|
+
renderFloor?: number;
|
|
56
|
+
}): z.ZodTypeAny;
|
|
57
|
+
/**
|
|
58
|
+
* A COPY string — rendered as inline markdown before it reaches the component.
|
|
59
|
+
*
|
|
60
|
+
* Markdown is OPT-IN, not the default. Making it the default was tried and
|
|
61
|
+
* rejected on the first real conversion: `ComparisonTable` reads `eyebrow.length`
|
|
62
|
+
* and `title.length`, and prose rendering replaces the string with a React node
|
|
63
|
+
* array — so md-by-default silently stopped its header rendering. None of that
|
|
64
|
+
* component's five string props were prose. Opting IN is the honest default:
|
|
65
|
+
* a missed `text` shows literal `**asterisks**` (visible, trivially fixed),
|
|
66
|
+
* while a wrongly-applied one breaks `===` / `.length` / `.toUpperCase()`
|
|
67
|
+
* (silent, and far from the marker).
|
|
68
|
+
*
|
|
69
|
+
* Use for body, description, answer, quote, subhead — copy the visitor reads.
|
|
70
|
+
*/
|
|
71
|
+
export declare const text: z.ZodString;
|
|
72
|
+
/**
|
|
73
|
+
* A STRUCTURAL string — the default. NOT markdown-rendered.
|
|
74
|
+
*
|
|
75
|
+
* Emits a bare `z.string()`, so it is exactly what today's hand-authored
|
|
76
|
+
* schemas already declare; existing props migrate with no behaviour change.
|
|
77
|
+
* Use for anything the component compares (`=== 'M'`), measures (`.length`), or
|
|
78
|
+
* transforms (`.toUpperCase()`) — and for any string you are unsure about.
|
|
79
|
+
*/
|
|
80
|
+
export declare function plain(): z.ZodString;
|
|
81
|
+
/**
|
|
82
|
+
* A TOKEN prop — a bounded, brand-defined vocabulary.
|
|
83
|
+
*
|
|
84
|
+
* Prefer this to an open string wherever the value drives a visual decision:
|
|
85
|
+
* the agent picks from a closed set it can see in the prompt, instead of
|
|
86
|
+
* inventing a value the component then has to defend against.
|
|
87
|
+
*/
|
|
88
|
+
export declare function token<U extends string, T extends Readonly<[U, ...U[]]>>(values: T): z.ZodEnum<z.Writeable<T>>;
|
|
89
|
+
/** Layout metadata — the non-prop half of a catalog entry. */
|
|
90
|
+
export interface CatalogComponentMeta {
|
|
91
|
+
/** Catalog type key. Must match the key the agent emits and the `.md` basename. */
|
|
92
|
+
type: string;
|
|
93
|
+
/** Prop contract. Function props are unrepresentable — the dead-button class (§IV.5). */
|
|
94
|
+
props: z.ZodRawShape;
|
|
95
|
+
/** Example prop objects for the agent's prompt + previews. */
|
|
96
|
+
examples?: Record<string, unknown>[];
|
|
97
|
+
layout?: CatalogEntryStructural['layout'];
|
|
98
|
+
/** Share of a row when the brand arranges the canvas as a bento (see `packRows`). */
|
|
99
|
+
size?: CatalogEntryStructural['size'];
|
|
100
|
+
/** Adds to the current page instead of starting one (see `extendsPage`). */
|
|
101
|
+
extendsPage?: boolean;
|
|
102
|
+
defaultLayoutWeight?: number;
|
|
103
|
+
defaultMaxHeight?: CatalogEntryStructural['defaultMaxHeight'];
|
|
104
|
+
progressLabel?: string;
|
|
105
|
+
alwaysInclude?: boolean;
|
|
106
|
+
/** Capability tokens (`action:<verb>`) this component needs wired to work. */
|
|
107
|
+
requires?: string[];
|
|
108
|
+
}
|
|
109
|
+
/** A self-describing catalog component: its entry and its renderer, together. */
|
|
110
|
+
export type CatalogComponent = CatalogEntryStructural & {
|
|
111
|
+
component: BrandComponent;
|
|
112
|
+
};
|
|
113
|
+
/**
|
|
114
|
+
* Declare a catalog component.
|
|
115
|
+
*
|
|
116
|
+
* Descriptions / whenToUse / dontUseWhen are NOT declared here — they live in a
|
|
117
|
+
* `.md` file beside the component, matched by `type`, so prose stays editable
|
|
118
|
+
* without a code change (and out of code, per the prompt-template rule).
|
|
119
|
+
*/
|
|
120
|
+
export declare function catalogComponent(meta: CatalogComponentMeta, render: React.ElementType): CatalogComponent;
|
|
121
|
+
/**
|
|
122
|
+
* Declare a catalog component whose CONTRACT is cited from another layer's entry.
|
|
123
|
+
*
|
|
124
|
+
* The brand still declares the type — one line, in the same list as everything
|
|
125
|
+
* else it renders — it just doesn't restate a schema that already exists:
|
|
126
|
+
*
|
|
127
|
+
* export const productGrid = catalogComponentFrom(contract.productGrid, ProductGrid);
|
|
128
|
+
* export const comparisonTable = catalogComponentFrom(contract.comparisonTable, UiComparisonTable);
|
|
129
|
+
*
|
|
130
|
+
* The first reuses only the base PROP SHAPE and renders the brand's own grid; the
|
|
131
|
+
* second reuses the base component too. Both read the same way, and both are just
|
|
132
|
+
* declarations — which is the point.
|
|
133
|
+
*
|
|
134
|
+
* This exists so there is exactly ONE mechanism. The alternatives that grew here
|
|
135
|
+
* first were both worse: a per-brand `REUSED_BASE_TYPES` allowlist (a
|
|
136
|
+
* hand-maintained list, the very thing this seam removed — and it only understood
|
|
137
|
+
* `@fourty/ui`), and a `RENDERED_BY` + `REUSE_LAYERS` indirection that derived the
|
|
138
|
+
* render map from a provenance table (more capable, but it put a type's contract
|
|
139
|
+
* and its renderer in two different files again, which is what drifts).
|
|
140
|
+
*
|
|
141
|
+
* `renderedBy` records which layer's COMPONENT actually renders — observability
|
|
142
|
+
* only, never generation. Pass it when reusing another layer's component so the
|
|
143
|
+
* provenance the indirection used to compute is not lost.
|
|
144
|
+
*/
|
|
145
|
+
export declare function catalogComponentFrom(entry: CatalogEntryStructural, render: React.ElementType, opts?: {
|
|
146
|
+
renderedBy?: string;
|
|
147
|
+
examples?: Record<string, unknown>[];
|
|
148
|
+
size?: CatalogEntryStructural['size'];
|
|
149
|
+
}): CatalogComponent;
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydrator registry — maps `platform` to a factory that builds a
|
|
3
|
+
* HydratorMap from the per-space `platformConfig` blob.
|
|
4
|
+
*
|
|
5
|
+
* SDK runtime stays vertical-agnostic: `resolve-hydrators.ts` looks up
|
|
6
|
+
* a platform in this registry and invokes the factory. Adding a new
|
|
7
|
+
* platform = ship a side-effect file that calls
|
|
8
|
+
* `registerPlatformHydrators(name, factory)` and import it once at app
|
|
9
|
+
* start (mirror of the agent's `connectors/built-in.ts` pattern).
|
|
10
|
+
*
|
|
11
|
+
* The SDK ships `./shopify-hydrators` as a built-in side-effect file
|
|
12
|
+
* for back-compat. New verticals (Square, Woo, in-house) register
|
|
13
|
+
* without editing this module.
|
|
14
|
+
*
|
|
15
|
+
* ## Why the registry lives on `globalThis`
|
|
16
|
+
*
|
|
17
|
+
* Next.js / Turbopack can evaluate this module MORE THAN ONCE per
|
|
18
|
+
* process — the route-split client bundles + SSR/RSC boundary each
|
|
19
|
+
* get their own ESM module instance. A module-scope `new Map()` is
|
|
20
|
+
* per-instance, so the Shopify side-effect file's
|
|
21
|
+
* `registerPlatformHydrators('shopify', factory)` lands in ONE map
|
|
22
|
+
* while the SDK's `getPlatformHydratorFactory('shopify')` lookup
|
|
23
|
+
* (in a different module instance) reads from an EMPTY one — the
|
|
24
|
+
* factory comes back `undefined`, `resolveHydrators` returns `{}`,
|
|
25
|
+
* and productGrids stay in skeleton mode forever because no
|
|
26
|
+
* Product objects ever flow in.
|
|
27
|
+
*
|
|
28
|
+
* Pinning the Map to `globalThis.__fourtyHydratorRegistry` makes
|
|
29
|
+
* every module copy share the same state. First registration wins;
|
|
30
|
+
* subsequent calls for the same platform are silent no-ops (no
|
|
31
|
+
* warning, because two evals of the same source file producing
|
|
32
|
+
* factories with different identity is the EXPECTED outcome in a
|
|
33
|
+
* bundled app, not a real conflict). The same pattern Prisma /
|
|
34
|
+
* react-query / Redux store use in Next.js for "library singleton in
|
|
35
|
+
* a code-split world".
|
|
36
|
+
*/
|
|
37
|
+
import type { HydratorMap } from '../../../spacestation/src/index';
|
|
38
|
+
import type { CommerceLocale } from '../../../ecommerce/src/index';
|
|
39
|
+
/**
|
|
40
|
+
* Per-visitor context threaded into hydrator construction. Optional on
|
|
41
|
+
* the factory signature so existing registrations keep working; new
|
|
42
|
+
* factories should honor `locale` so hydrated entity prices match the
|
|
43
|
+
* visitor's market.
|
|
44
|
+
*/
|
|
45
|
+
export interface PlatformHydratorContext {
|
|
46
|
+
locale?: CommerceLocale;
|
|
47
|
+
}
|
|
48
|
+
export type PlatformHydratorFactory = (config: Record<string, unknown>, context?: PlatformHydratorContext) => HydratorMap;
|
|
49
|
+
/**
|
|
50
|
+
* Register a platform's hydrator factory. First registration wins;
|
|
51
|
+
* subsequent calls for the same platform name are silent no-ops
|
|
52
|
+
* regardless of factory identity. Two re-evaluations of the same
|
|
53
|
+
* source file (caused by Next.js code-splitting across routes) is the
|
|
54
|
+
* expected case, not a misconfiguration.
|
|
55
|
+
*
|
|
56
|
+
* If you genuinely need to REPLACE a registered factory at runtime,
|
|
57
|
+
* unregister first via `globalThis.__fourtyHydratorRegistry.delete(...)`
|
|
58
|
+
* and then call this — surfacing the bypass at the call site rather
|
|
59
|
+
* than silently overwriting.
|
|
60
|
+
*/
|
|
61
|
+
export declare function registerPlatformHydrators(platform: string, factory: PlatformHydratorFactory): void;
|
|
62
|
+
/**
|
|
63
|
+
* Look up a registered platform's hydrator factory. Returns undefined
|
|
64
|
+
* when the platform isn't registered — caller decides whether that's
|
|
65
|
+
* an error (missing registration → blank canvas) or a no-op (the
|
|
66
|
+
* special platform values `''` / `'none'`).
|
|
67
|
+
*/
|
|
68
|
+
export declare function getPlatformHydratorFactory(platform: string): PlatformHydratorFactory | undefined;
|
|
69
|
+
/** Diagnostic — for log messages and admin surfaces. */
|
|
70
|
+
export declare function listRegisteredPlatforms(): string[];
|
|
71
|
+
/**
|
|
72
|
+
* What a space-service hydrator needs to reach its backend: the API base and
|
|
73
|
+
* the SLUG the service routes are addressed by. `id`-addressed contexts
|
|
74
|
+
* (admin / preview) have no slug, so no service hydrators are built for them.
|
|
75
|
+
*/
|
|
76
|
+
export interface ServiceHydratorContext {
|
|
77
|
+
apiUrl: string;
|
|
78
|
+
spaceSlug: string;
|
|
79
|
+
locale?: CommerceLocale;
|
|
80
|
+
}
|
|
81
|
+
export type ServiceHydratorFactory = (context: ServiceHydratorContext) => HydratorMap;
|
|
82
|
+
/** Register a space-service hydrator factory. First registration wins — same
|
|
83
|
+
* re-evaluation semantics as `registerPlatformHydrators`. */
|
|
84
|
+
export declare function registerServiceHydrators(name: string, factory: ServiceHydratorFactory): void;
|
|
85
|
+
/** Build every registered service hydrator into one map. Later registrations
|
|
86
|
+
* never overwrite earlier ones for the same resolver key — a duplicate key is
|
|
87
|
+
* a registration bug, and silently swapping which one answers would make it
|
|
88
|
+
* invisible. */
|
|
89
|
+
export declare function resolveServiceHydrators(context: ServiceHydratorContext): HydratorMap;
|
|
90
|
+
/** Diagnostic — for log messages and admin surfaces. */
|
|
91
|
+
export declare function listRegisteredServices(): string[];
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { CatalogProvider, useComponentCatalog } from './CatalogContext';
|
|
2
|
+
export { DebugProvider, useDebug } from './DebugContext';
|
|
3
|
+
export { HydrationStateContext, useHydrationState, type HydrationState, } from './HydrationStateContext';
|
|
4
|
+
export { HydratorProvider, useHydrators } from './HydratorContext';
|
|
5
|
+
export type { ComponentMapping, ComponentsMap, Hydrator, HydratorMap, HydrationContext, } from './normalize-components';
|
|
6
|
+
export { RegistryProvider, useRegistry, PackageLookupProvider, usePackageLookup, createAliasedRegistry, type ComponentRegistry, type PackageLookupFn, } from './registry';
|
|
7
|
+
export { renderInline, setInlineLinkRenderer, type InlineLinkRenderer } from './render-inline';
|
|
8
|
+
export { adaptComponent, NullComponent, buildComponentLibrary, type BrandComponent } from './component-library';
|
|
9
|
+
export { catalogComponent, catalogComponentFrom, entity, text, plain, token, type CatalogComponent, type CatalogComponentMeta, } from './define';
|
|
10
|
+
export { adaptCatalogComponent, type CatalogComponentProps, type ValidCatalogComponent, type InteractionContractViolation, } from './interaction-contract';
|
|
11
|
+
export { registerPlatformHydrators, getPlatformHydratorFactory, listRegisteredPlatforms, registerServiceHydrators, resolveServiceHydrators, listRegisteredServices, type PlatformHydratorContext, type PlatformHydratorFactory, type ServiceHydratorContext, type ServiceHydratorFactory, } from './hydrator-registry';
|
|
12
|
+
export { hasProse } from './prose-value';
|
|
13
|
+
export { resolveHydrators, type HydratorResolutionContext } from './resolve-hydrators';
|
|
14
|
+
export { registerComponent, registerLibrary, type RegisterComponentOptions, createRegistry, getGlobalRegistry, type ComponentRegistryInstance, type RegisteredComponent, type FourtyComponentDef, type FourtyPackageManifest, type FourtyPackage, } from './registration';
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { z } from 'zod';
|
|
3
|
+
import { type BrandComponent } from './component-library';
|
|
4
|
+
/**
|
|
5
|
+
* The interaction contract — the compile-time half of "dead buttons are
|
|
6
|
+
* impossible by construction" (see docs/create-space.md §Contracts and
|
|
7
|
+
* architecture-invariants §IV.6).
|
|
8
|
+
*
|
|
9
|
+
* A catalog component is rendered from the agent's JSON: every prop it receives
|
|
10
|
+
* is DATA the agent emitted. The agent never emits a function. So a component
|
|
11
|
+
* that reads behaviour from a callback prop (`onAddToBag`, `onSelect`, …) is
|
|
12
|
+
* wired to a value that is ALWAYS `undefined` at render — a dead no-op. The fix
|
|
13
|
+
* is structural: a catalog component's props must be EXACTLY the data its
|
|
14
|
+
* `propsSchema` declares (plus React's own framework plumbing). Actions come
|
|
15
|
+
* only from platform hooks (`useAddToCart`, `useToggleWishlist`,
|
|
16
|
+
* `useCanvasActions`, …), which read from context — never from a prop.
|
|
17
|
+
*
|
|
18
|
+
* `adaptCatalogComponent(schema, Component)` binds a component's props type to
|
|
19
|
+
* `z.infer<schema>`. Because a Zod data schema cannot infer a function, and any
|
|
20
|
+
* prop the component declares beyond the schema is rejected, a callback prop
|
|
21
|
+
* (bespoke `onAddToBag`, or DOM passthrough from `extends HTMLAttributes`)
|
|
22
|
+
* becomes a COMPILE error. `buildComponentLibrary` is the runtime backstop for
|
|
23
|
+
* components still registered through the untyped `adaptComponent`.
|
|
24
|
+
*/
|
|
25
|
+
/**
|
|
26
|
+
* The props type a catalog component is allowed to declare: the data inferred
|
|
27
|
+
* from its `propsSchema`, plus optional `children`. React's `ref`/`key` are
|
|
28
|
+
* permitted separately (see `FrameworkProps`) since they are framework
|
|
29
|
+
* plumbing, never agent-supplied data.
|
|
30
|
+
*/
|
|
31
|
+
export type CatalogComponentProps<S extends z.ZodTypeAny> = z.infer<S> & {
|
|
32
|
+
children?: React.ReactNode;
|
|
33
|
+
};
|
|
34
|
+
/**
|
|
35
|
+
* Framework-reserved prop names a catalog component may accept beyond its
|
|
36
|
+
* schema data — React plumbing (`ref` arrives on any `forwardRef` component,
|
|
37
|
+
* `key`/`children` on any element), never agent-emitted data.
|
|
38
|
+
*/
|
|
39
|
+
type FrameworkPropName = 'children' | 'ref' | 'key';
|
|
40
|
+
/**
|
|
41
|
+
* The keys a component declares that its `propsSchema` does NOT — a bespoke
|
|
42
|
+
* callback (`onAddToBag`), DOM passthrough (`onClick` from `HTMLAttributes`),
|
|
43
|
+
* or any stray data prop that isn't the schema's single source of truth.
|
|
44
|
+
*/
|
|
45
|
+
type UndeclaredPropKeys<P, S extends z.ZodTypeAny> = Exclude<keyof P, keyof z.infer<S> | FrameworkPropName>;
|
|
46
|
+
/**
|
|
47
|
+
* The compile-time message surfaced when a catalog component declares a prop
|
|
48
|
+
* outside its schema. It intersects the component argument, so the argument
|
|
49
|
+
* (a component, not a string) fails to type-check — pointing the author here.
|
|
50
|
+
*/
|
|
51
|
+
export type InteractionContractViolation = 'Interaction contract: this catalog component declares prop(s) not in its propsSchema. Catalog components take ONLY the data their schema declares; actions come from platform hooks (useAddToCart, useToggleWishlist, useCanvasActions), never a callback prop the agent cannot emit. See docs/architecture-invariants.md §IV.5.';
|
|
52
|
+
/**
|
|
53
|
+
* `unknown` (an identity for intersection) when the component's props are
|
|
54
|
+
* exactly the schema's data plus framework plumbing; the violation string
|
|
55
|
+
* otherwise — which poisons the intersection at the `adaptCatalogComponent`
|
|
56
|
+
* call site so the offending component fails to compile.
|
|
57
|
+
*/
|
|
58
|
+
export type ValidCatalogComponent<P, S extends z.ZodTypeAny> = [
|
|
59
|
+
UndeclaredPropKeys<P, S>
|
|
60
|
+
] extends [never] ? unknown : InteractionContractViolation;
|
|
61
|
+
/**
|
|
62
|
+
* Adapt a schema-typed catalog component to the open `BrandComponent` shape the
|
|
63
|
+
* platform's `componentMap` requires — the type-locked sibling of
|
|
64
|
+
* `adaptComponent`. The component's props are bound to `z.infer<schema>` (+
|
|
65
|
+
* optional `children`/`ref`); a callback or any undeclared prop is a COMPILE
|
|
66
|
+
* error, so the dead-button class is unrepresentable.
|
|
67
|
+
*
|
|
68
|
+
* Runtime behaviour is identical to `adaptComponent(Component)` — the schema is
|
|
69
|
+
* used purely to bind the props type. Adopt it in a `componentMap`:
|
|
70
|
+
*
|
|
71
|
+
* ```ts
|
|
72
|
+
* const componentMap = {
|
|
73
|
+
* comparisonTable: adaptCatalogComponent(comparisonTableProps, ComparisonTable),
|
|
74
|
+
* };
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare function adaptCatalogComponent<S extends z.ZodObject<z.ZodRawShape>, C extends React.ElementType>(schema: S, Component: C & ValidCatalogComponent<React.ComponentProps<C>, S>): BrandComponent;
|
|
78
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { Hydrator, HydratorMap, HydrationContext } from '../../../spacestation/src/index';
|
|
3
|
+
/** A simple component mapping: just the React component */
|
|
4
|
+
type SimpleMapping = React.ComponentType<Record<string, unknown>>;
|
|
5
|
+
/** A component mapping with a prop adapter */
|
|
6
|
+
interface AdaptedMapping {
|
|
7
|
+
component: React.ComponentType<Record<string, unknown>>;
|
|
8
|
+
adapter: (props: Record<string, unknown>) => Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** What brands pass — simple component OR component + adapter */
|
|
11
|
+
export type ComponentMapping = SimpleMapping | AdaptedMapping;
|
|
12
|
+
/** Map of component type → ComponentMapping */
|
|
13
|
+
export type ComponentsMap = Record<string, ComponentMapping>;
|
|
14
|
+
/** Hydrator + HydratorMap + the site context a hydrator may read — the pure
|
|
15
|
+
* hydration contract now lives in `@fourty/spacestation`. Re-exported here so
|
|
16
|
+
* existing `./normalize-components` importers keep resolving unchanged. */
|
|
17
|
+
export type { Hydrator, HydratorMap, HydrationContext };
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Is a `prose()`-marked field present and non-empty?
|
|
4
|
+
*
|
|
5
|
+
* A prose field arrives at a component in exactly one of three states, because
|
|
6
|
+
* the hydration boundary (`renderProseFields`, also in this package) skips empty
|
|
7
|
+
* strings rather than rendering them:
|
|
8
|
+
*
|
|
9
|
+
* - `undefined` — the agent omitted the prop
|
|
10
|
+
* - `''` — emitted empty; left untouched by the boundary
|
|
11
|
+
* - `ReactNode[]` — emitted with content; rendered to inline-markdown nodes
|
|
12
|
+
*
|
|
13
|
+
* Components must therefore ask "is there copy here?", never "is this a
|
|
14
|
+
* string?". `typeof value === 'string'` is the trap: it reads as a presence
|
|
15
|
+
* check but silently answers *false* for every field the boundary actually
|
|
16
|
+
* rendered, so the copy vanishes the moment its schema gains a `prose()`
|
|
17
|
+
* marker. This helper is the one place that question is answered.
|
|
18
|
+
*
|
|
19
|
+
* Pair it with a `ReactNode`-typed prop — see `prose()`'s docstring in
|
|
20
|
+
* `@fourty/spacestation` for which fields may be marked.
|
|
21
|
+
*/
|
|
22
|
+
export declare function hasProse(value: ReactNode): boolean;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { registerComponent, registerLibrary, type RegisterComponentOptions } from './register-component';
|
|
2
|
+
export { createRegistry, getGlobalRegistry, type ComponentRegistryInstance, type RegisteredComponent, } from './registry';
|
|
3
|
+
export { adaptComponent, NullComponent, buildComponentLibrary, type BrandComponent, } from '../component-library';
|
|
4
|
+
export type { FourtyComponentDef, FourtyPackageManifest, FourtyPackage } from './types';
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CatalogEntryStructural } from '../../../../spacestation/src/index';
|
|
3
|
+
/**
|
|
4
|
+
* Component registration options. Accepts the **structural** catalog
|
|
5
|
+
* shape only — propsSchema, slots, bindings, layout. Descriptions and
|
|
6
|
+
* the LLM-readable props doc never live on the client registry: the
|
|
7
|
+
* API merges them from per-component manifest .md files into the
|
|
8
|
+
* runtime catalog and ships them down separately. One deterministic
|
|
9
|
+
* source of truth per concern, no synthesized fallbacks.
|
|
10
|
+
*/
|
|
11
|
+
export interface RegisterComponentOptions extends CatalogEntryStructural {
|
|
12
|
+
/** Optional adapter that transforms layout props before passing to the component */
|
|
13
|
+
adapter?: (props: Record<string, unknown>) => Record<string, unknown>;
|
|
14
|
+
/** Optional preview renderer for Studio UI */
|
|
15
|
+
preview?: () => React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare function registerComponent(component: React.ComponentType<Record<string, unknown>>, options: RegisterComponentOptions): void;
|
|
18
|
+
/**
|
|
19
|
+
* Register an entire component library at once.
|
|
20
|
+
*
|
|
21
|
+
* Component libraries (e.g. @fourty/ui) export a `components` array.
|
|
22
|
+
* The spacefront developer calls `registerLibrary(components)` once
|
|
23
|
+
* to register all components into the global registry.
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```ts
|
|
27
|
+
* import { components } from '@fourty/ui';
|
|
28
|
+
* import { registerLibrary } from '@fourty/react';
|
|
29
|
+
*
|
|
30
|
+
* registerLibrary(components);
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function registerLibrary(components: Array<{
|
|
34
|
+
component: React.ComponentType<Record<string, unknown>>;
|
|
35
|
+
} & CatalogEntryStructural>): void;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
import type { CatalogEntryStructural, Binding } from '../../../../spacestation/src/index';
|
|
3
|
+
export interface RegisteredComponent {
|
|
4
|
+
component: React.ComponentType<Record<string, unknown>>;
|
|
5
|
+
metadata: CatalogEntryStructural;
|
|
6
|
+
adapter?: (props: Record<string, unknown>) => Record<string, unknown>;
|
|
7
|
+
preview?: () => React.ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export interface ComponentRegistryInstance {
|
|
10
|
+
register(component: React.ComponentType<Record<string, unknown>>, metadata: CatalogEntryStructural, options?: {
|
|
11
|
+
adapter?: RegisteredComponent['adapter'];
|
|
12
|
+
preview?: RegisteredComponent['preview'];
|
|
13
|
+
}): void;
|
|
14
|
+
get(type: string): RegisteredComponent | undefined;
|
|
15
|
+
getAll(): Map<string, RegisteredComponent>;
|
|
16
|
+
getTypes(): string[];
|
|
17
|
+
has(type: string): boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Aggregated bindings keyed by source string. Derived from each
|
|
20
|
+
* registered component's `metadata.bindings` (default routing rules
|
|
21
|
+
* shipped with the component definition). Brand handlers in
|
|
22
|
+
* `<FourtyProvider handlers>` always trump catalog bindings.
|
|
23
|
+
*/
|
|
24
|
+
getBindings(): Map<string, Array<Binding>>;
|
|
25
|
+
}
|
|
26
|
+
export declare function getGlobalRegistry(): ComponentRegistryInstance;
|
|
27
|
+
export declare function createRegistry(): ComponentRegistryInstance;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import type { CatalogEntryStructural } from '../../../../spacestation/src/index';
|
|
2
|
+
import type { ShellComponent } from '../../shell/ShellRegistry';
|
|
3
|
+
/**
|
|
4
|
+
* A single component definition within a FourtyPackage.
|
|
5
|
+
* Combines structural catalog metadata (propsSchema + slots + bindings)
|
|
6
|
+
* with the React implementation. Descriptions and the LLM-readable
|
|
7
|
+
* props doc live in the per-component manifest .md and are merged onto
|
|
8
|
+
* the runtime catalog at request time — they never flow through a
|
|
9
|
+
* `FourtyComponentDef`. One source of truth per concern.
|
|
10
|
+
*/
|
|
11
|
+
export interface FourtyComponentDef {
|
|
12
|
+
/** Structural catalog metadata: type + propsSchema + slots + bindings + layout. */
|
|
13
|
+
catalog: CatalogEntryStructural;
|
|
14
|
+
/** The React component that renders this type */
|
|
15
|
+
component: React.ComponentType<Record<string, unknown>>;
|
|
16
|
+
/** Optional adapter that transforms layout props before passing to the component */
|
|
17
|
+
adapter?: (props: Record<string, unknown>) => Record<string, unknown>;
|
|
18
|
+
/** Optional preview renderer for Studio UI */
|
|
19
|
+
preview?: () => React.ReactNode;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Package manifest — metadata about who ships this component library.
|
|
23
|
+
*/
|
|
24
|
+
export interface FourtyPackageManifest {
|
|
25
|
+
/** npm package name (e.g. "@fourty/ui") */
|
|
26
|
+
name: string;
|
|
27
|
+
/** Semver version string */
|
|
28
|
+
version: string;
|
|
29
|
+
/** Human-readable display name */
|
|
30
|
+
displayName: string;
|
|
31
|
+
/** Short description of the package */
|
|
32
|
+
description: string;
|
|
33
|
+
/** Package author or organization */
|
|
34
|
+
author: string;
|
|
35
|
+
/** Supported themes */
|
|
36
|
+
themes: ('light' | 'dark')[];
|
|
37
|
+
/** @fourty/sdk version this package targets */
|
|
38
|
+
fourtySchemaVersion: string;
|
|
39
|
+
/** Optional icon URL or data URI */
|
|
40
|
+
icon?: string;
|
|
41
|
+
/** Optional package homepage URL */
|
|
42
|
+
url?: string;
|
|
43
|
+
/**
|
|
44
|
+
* Per-component enable map owned by the brand. Default = enabled
|
|
45
|
+
* (omitted key OR `true` ⇒ exposed to the agent). Set a type to `false`
|
|
46
|
+
* to hide it from the LLM's catalog without touching the base package.
|
|
47
|
+
* This is the only place enable/disable belongs — base manifests no
|
|
48
|
+
* longer carry the flag.
|
|
49
|
+
*/
|
|
50
|
+
enabled?: Record<string, boolean>;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* A FourtyPackage is the unit of component distribution.
|
|
54
|
+
* Third parties implement this interface to ship component libraries.
|
|
55
|
+
*/
|
|
56
|
+
export interface FourtyPackage {
|
|
57
|
+
/** Package metadata */
|
|
58
|
+
manifest: FourtyPackageManifest;
|
|
59
|
+
/** Component definitions keyed by component type string */
|
|
60
|
+
components: Record<string, FourtyComponentDef>;
|
|
61
|
+
/** Brand fonts to load via @font-face when rendering this package */
|
|
62
|
+
fonts?: Array<{
|
|
63
|
+
family: string;
|
|
64
|
+
weight?: number;
|
|
65
|
+
style?: string;
|
|
66
|
+
url: string;
|
|
67
|
+
format: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* URL of the package's own page stylesheet — set for a package whose CSS is
|
|
71
|
+
* PUBLISHED with it rather than compiled into the page that renders it. A
|
|
72
|
+
* surface that is not the package's own page (the console's previews) loads
|
|
73
|
+
* it into an isolated frame instead of its own document.
|
|
74
|
+
*/
|
|
75
|
+
stylesheet?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Optional shells keyed by shell-name. Brand packages register their own
|
|
78
|
+
* top-level shell (typically as `default`) to replace `<DefaultShell>`.
|
|
79
|
+
* SpaceFront merges these on top of the SDK's DEFAULT_SHELL_REGISTRY,
|
|
80
|
+
* so the brand-side `default` wins.
|
|
81
|
+
*/
|
|
82
|
+
shells?: Record<string, ShellComponent>;
|
|
83
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/** A registry maps component type strings to React components */
|
|
3
|
+
export type ComponentRegistry = Record<string, React.ComponentType<Record<string, unknown>>>;
|
|
4
|
+
/**
|
|
5
|
+
* Wrap your spacefront in RegistryProvider to use a custom component library.
|
|
6
|
+
*/
|
|
7
|
+
export declare function RegistryProvider({ registry, children, }: {
|
|
8
|
+
registry: ComponentRegistry;
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function useRegistry(): ComponentRegistry;
|
|
12
|
+
export type PackageLookupFn = (packageName: string, componentType: string) => React.ComponentType<Record<string, unknown>> | undefined;
|
|
13
|
+
export declare function PackageLookupProvider({ lookup, children, }: {
|
|
14
|
+
lookup: PackageLookupFn;
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export declare function usePackageLookup(): PackageLookupFn | null;
|
|
18
|
+
/**
|
|
19
|
+
* Create a registry proxy that resolves qualified types (e.g. "k:hero")
|
|
20
|
+
* using the spec's aliases map and a package-level component lookup.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createAliasedRegistry(baseRegistry: ComponentRegistry, aliases: Record<string, string> | undefined, getPackageComponent: PackageLookupFn): ComponentRegistry;
|