@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,264 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { CanvasBlockSize } from './canvas-arrangement';
|
|
3
|
+
/**
|
|
4
|
+
* Structural shape of a catalog entry as authored in TypeScript. Carries
|
|
5
|
+
* only what's intrinsic to the component implementation — the Zod
|
|
6
|
+
* schema, slot contracts, layout claim, default chips, bindings.
|
|
7
|
+
*
|
|
8
|
+
* Description and props doc are FILLED IN at runtime — `description`
|
|
9
|
+
* comes from the per-component manifest markdown
|
|
10
|
+
* (`catalogs/<domain>/<component>.md`) merged via `loadComponentCatalogManifests`,
|
|
11
|
+
* `props` from `derivePropsDoc(propsSchema)`. Authors edit the .md
|
|
12
|
+
* manifest, never the TS file, to change description / whenToUse /
|
|
13
|
+
* dontUseWhen.
|
|
14
|
+
*
|
|
15
|
+
* The runtime entry shape is `CatalogEntry` (below) which makes both
|
|
16
|
+
* fields required — by the time consumers read the catalog, the merge
|
|
17
|
+
* has run and they always exist.
|
|
18
|
+
*/
|
|
19
|
+
export interface CatalogEntryStructural {
|
|
20
|
+
type: string;
|
|
21
|
+
/** Zod schema defining all component props — present for built-in packages, absent for published bundles. */
|
|
22
|
+
propsSchema?: z.ZodObject<z.ZodRawShape>;
|
|
23
|
+
/** Example prop combinations for LLM context and previews. */
|
|
24
|
+
examples?: Record<string, unknown>[];
|
|
25
|
+
/** Source package id that contributed (and last won) this component — e.g.
|
|
26
|
+
* '@fourty/ui' (baseline) or '@fourty/stevemadden' (brand). Stamped during
|
|
27
|
+
* catalog composition for provenance. Observability only — never affects
|
|
28
|
+
* generation; absent for entries composed before this field existed. */
|
|
29
|
+
source?: string;
|
|
30
|
+
/** Render provenance: the package id whose React component actually renders
|
|
31
|
+
* this type — a layer id, exactly like `source`. May differ from `source`
|
|
32
|
+
* (the layer that DECLARED the catalog entry) when a layer reuses another's
|
|
33
|
+
* component or overrides it. Brand-declared; observability only. */
|
|
34
|
+
renderedBy?: string;
|
|
35
|
+
/** If true, always included in catalog prompt even when not in component hints (layout primitives). */
|
|
36
|
+
alwaysInclude?: boolean;
|
|
37
|
+
/** When the LLM should select this component. */
|
|
38
|
+
whenToUse?: string;
|
|
39
|
+
/** When NOT to use this component. */
|
|
40
|
+
dontUseWhen?: string;
|
|
41
|
+
/** Named variants and when to pick each. */
|
|
42
|
+
variants?: string;
|
|
43
|
+
/** Rules and conditions that must be met. */
|
|
44
|
+
dependencies?: string;
|
|
45
|
+
/**
|
|
46
|
+
* How this component composes when stacked with others on a page.
|
|
47
|
+
*
|
|
48
|
+
* **TEMPORARY:** this field is a stopgap until a proper composition layer
|
|
49
|
+
* (Stack/Section primitives driving page layout) is in place. Today there
|
|
50
|
+
* is no layout primitive between the component and its preview, so
|
|
51
|
+
* components generated in isolation have no shared horizontal rhythm and
|
|
52
|
+
* drift into inconsistent widths / paddings. This field lets the preview
|
|
53
|
+
* wrap each component in a consistent section so a stack of them reads as
|
|
54
|
+
* one coherent page.
|
|
55
|
+
*
|
|
56
|
+
* **When the composition layer lands:** delete this field, delete the
|
|
57
|
+
* wrapper in SandboxedComponentPreview, and let the layout primitives own
|
|
58
|
+
* framing. Grep for `.layout` on a CatalogEntry and
|
|
59
|
+
* `PAGE_LAYOUT_WRAPPER` to audit removals.
|
|
60
|
+
*
|
|
61
|
+
* - 'section' (default, omit = this) — Content is wrapped in
|
|
62
|
+
* `max-w-7xl mx-auto px-6 sm:px-8` with vertical padding so the
|
|
63
|
+
* component reads at a comfortable width. Use for every content block
|
|
64
|
+
* (blogPosts, productGrid, reviews, …).
|
|
65
|
+
* - 'fullbleed' — Content extends edge-to-edge; used for hero images and
|
|
66
|
+
* announcement bars that need to span the viewport.
|
|
67
|
+
*/
|
|
68
|
+
layout?: 'section' | 'fullbleed';
|
|
69
|
+
/**
|
|
70
|
+
* How much of a row this component takes when the canvas ARRANGES its
|
|
71
|
+
* top-level blocks into a grid (a brand opting into `arrangement: 'bento'`).
|
|
72
|
+
* The engine packs the agent's flat block list into rows from these sizes —
|
|
73
|
+
* the agent never sees or emits placement, and a stacked canvas ignores it.
|
|
74
|
+
*
|
|
75
|
+
* - 'full' (default, omit = this) — the whole row.
|
|
76
|
+
* - 'wide' — two-thirds; pairs with a 'narrow'.
|
|
77
|
+
* - 'half' — half; pairs with another 'half'.
|
|
78
|
+
* - 'narrow' — one-third; pairs with a 'wide' or two more 'narrow's.
|
|
79
|
+
*/
|
|
80
|
+
size?: CanvasBlockSize;
|
|
81
|
+
/**
|
|
82
|
+
* This block ADDS to the page it lands on (an explanation, a fact panel, an
|
|
83
|
+
* aside) rather than answering a new question. On a canvas that keeps one
|
|
84
|
+
* page per turn (`CanvasArrangementProvider turnPages`), a turn whose blocks
|
|
85
|
+
* all extend keeps the page it answered on; any other turn starts a fresh
|
|
86
|
+
* page, showing only its own blocks. Ignored everywhere else.
|
|
87
|
+
*/
|
|
88
|
+
extendsPage?: boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Default routing rules attached to the component. Each binding routes a
|
|
91
|
+
* source (agent signal `signal:<type>` or session-state field
|
|
92
|
+
* `session.<path>`) onto one of this component's props at runtime.
|
|
93
|
+
*
|
|
94
|
+
* Lives with the component definition because the routing is semantic to
|
|
95
|
+
* the component itself — `agentText.text ← signal:text.delta` is what
|
|
96
|
+
* `agentText` IS, not a brand decision. Brand manifests can override
|
|
97
|
+
* specific bindings; brand handlers (`<FourtyProvider handlers>`) override
|
|
98
|
+
* everything per signal type.
|
|
99
|
+
*
|
|
100
|
+
* `componentType` is implicit — the type of this catalog entry.
|
|
101
|
+
*/
|
|
102
|
+
bindings?: Array<{
|
|
103
|
+
source: string;
|
|
104
|
+
prop: string;
|
|
105
|
+
accumulate?: 'replace' | 'append' | 'concat-text';
|
|
106
|
+
mountAt?: string;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Default vertical claim when this component is a top-level child
|
|
110
|
+
* of a fit-locked container (page). Mirrors CSS flex-grow semantics:
|
|
111
|
+
* 0 → shrink to natural height (announcement, hero, infoCards)
|
|
112
|
+
* 1 → fill remaining space; multiple `1`s split equally
|
|
113
|
+
* (productGrid, productDetail, comparisonTable, faq, reviews)
|
|
114
|
+
* N → proportional weight relative to other fillers
|
|
115
|
+
*
|
|
116
|
+
* Agent can override per-instance by emitting `layoutWeight` in
|
|
117
|
+
* the element's `props`. Default applies when prop is absent.
|
|
118
|
+
*/
|
|
119
|
+
defaultLayoutWeight?: number;
|
|
120
|
+
/**
|
|
121
|
+
* Optional cap on natural height when the component shrinks
|
|
122
|
+
* (defaultLayoutWeight = 0 and no per-instance layoutWeight). Maps
|
|
123
|
+
* to small/medium/large/full svh fractions; renderer translates.
|
|
124
|
+
*
|
|
125
|
+
* Agent can override per-instance with `maxHeight` prop.
|
|
126
|
+
*/
|
|
127
|
+
defaultMaxHeight?: 'sm' | 'md' | 'lg' | 'full';
|
|
128
|
+
/**
|
|
129
|
+
* Open vertical-category slug this entry belongs to. Used by the
|
|
130
|
+
* prompt scoping layer so an ecommerce space doesn't see saas-only
|
|
131
|
+
* components. Untagged entries (`undefined`) are universal — used
|
|
132
|
+
* for layout primitives (stack/grid/section/page) and per-turn
|
|
133
|
+
* response wrappers (turn, agentText) that apply across verticals.
|
|
134
|
+
*
|
|
135
|
+
* Today's brand conventions include `'ecommerce'`, `'saas'`,
|
|
136
|
+
* `'editorial'`, `'portfolio'` — but the wire doesn't enforce a
|
|
137
|
+
* closed set. New verticals (recipes, fitness, real-estate) tag
|
|
138
|
+
* with whatever slug their recipe declares.
|
|
139
|
+
*/
|
|
140
|
+
category?: string;
|
|
141
|
+
/**
|
|
142
|
+
* Short progress label shown in the trace's `phase_progress` step when
|
|
143
|
+
* this component is first added to the page (e.g. "Laying out the picks"
|
|
144
|
+
* for a productGrid). Renders as a one-liner the visitor never sees —
|
|
145
|
+
* it's for the admin trace tab only. Falls back to a humanised type
|
|
146
|
+
* name ("Placing the product grid") when omitted.
|
|
147
|
+
*
|
|
148
|
+
* Why on the catalog: the runner is vertical-agnostic and shouldn't
|
|
149
|
+
* carry a map of catalog-type → friendly-label. The catalog declares
|
|
150
|
+
* the component; the catalog declares the label too.
|
|
151
|
+
*/
|
|
152
|
+
progressLabel?: string;
|
|
153
|
+
/**
|
|
154
|
+
* Marks the entry as a top-level **Experience** — a curated
|
|
155
|
+
* multi-viewport page-level layout the agent picks for an intent.
|
|
156
|
+
* Distinct from primitives (productCard, hero) and content blocks
|
|
157
|
+
* (productGrid, reviews) that compose inside experiences or as
|
|
158
|
+
* legacy granular siblings.
|
|
159
|
+
*/
|
|
160
|
+
isExperience?: boolean;
|
|
161
|
+
/**
|
|
162
|
+
* Capabilities this component NEEDS to function — the structural-harness
|
|
163
|
+
* contract (see `@fourty/agent` capabilities). e.g. `['resolve:product']`
|
|
164
|
+
* for a component that renders product entities by id, plus
|
|
165
|
+
* `['action:cart.add']` if it has an add-to-cart affordance. A space that
|
|
166
|
+
* includes this component but provides none of these fails to compose,
|
|
167
|
+
* naming the component. The component's presence auto-provides
|
|
168
|
+
* `render:<type>`, so `provides` is rarely needed (a component that ALSO
|
|
169
|
+
* exposes a capability others depend on can declare it here).
|
|
170
|
+
*/
|
|
171
|
+
requires?: string[];
|
|
172
|
+
/** Capabilities this component provides BEYOND the implicit `render:<type>`. */
|
|
173
|
+
provides?: string[];
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Runtime catalog entry — the post-processed shape fed to the LLM and
|
|
177
|
+
* read by every consumer (prompt builder, render-validity sanitizer,
|
|
178
|
+
* admin UI). `description` comes from the per-component manifest .md
|
|
179
|
+
* (`catalogs/.../<type>.md`); `props` is derived from `propsSchema` via
|
|
180
|
+
* `derivePropsDoc()`. Both required: by the time anyone reads a
|
|
181
|
+
* `CatalogEntry`, the merge has run and these fields always exist.
|
|
182
|
+
*
|
|
183
|
+
* Code that AUTHORS a TS catalog (`catalog-entries.ts` in `@fourty/ui`)
|
|
184
|
+
* emits `CatalogEntryStructural` — `description` + `props` are
|
|
185
|
+
* intentionally absent there. The runtime upgrade happens in the API
|
|
186
|
+
* loader (`apps/api/src/lib/load-component-catalog-manifests.ts`) which merges
|
|
187
|
+
* manifest descriptions and runs `derivePropsDoc` over `propsSchema`,
|
|
188
|
+
* producing this fully-populated shape.
|
|
189
|
+
*/
|
|
190
|
+
export interface CatalogEntry extends CatalogEntryStructural {
|
|
191
|
+
/** LLM-readable description sourced from the per-component manifest. */
|
|
192
|
+
description: string;
|
|
193
|
+
/** Pre-derived props doc (prop name → type/description). */
|
|
194
|
+
props: Record<string, string>;
|
|
195
|
+
}
|
|
196
|
+
/** A component catalog maps type strings to their metadata (runtime). */
|
|
197
|
+
export type ComponentCatalog = Record<string, CatalogEntry>;
|
|
198
|
+
/** Structural catalog (TS source side, pre-merge). */
|
|
199
|
+
export type ComponentCatalogStructural = Record<string, CatalogEntryStructural>;
|
|
200
|
+
/**
|
|
201
|
+
* Catalog-declared rule routing a `source` (an agent signal OR a piece of
|
|
202
|
+
* session state) into one of a component's props at runtime.
|
|
203
|
+
*
|
|
204
|
+
* Bindings are how a catalog opts into the generic agent / session data
|
|
205
|
+
* channels without the brand wiring each one by hand. The catalog IS the
|
|
206
|
+
* experience: a catalog that binds `signal:text.delta → agentText.text`
|
|
207
|
+
* renders streamed prose as a layout element; a catalog that binds
|
|
208
|
+
* `session.lastUserMessage → turn.prompt` injects the user's prompt into
|
|
209
|
+
* each new turn wrapper. No global mode flag — routing is implied by what
|
|
210
|
+
* the catalog publishes.
|
|
211
|
+
*
|
|
212
|
+
* Source forms:
|
|
213
|
+
* - `signal:<type>` — agent-emitted signal (text.delta, chip.show,
|
|
214
|
+
* theme.set, …). The handler reads
|
|
215
|
+
* `signal.payload` and writes to the prop per
|
|
216
|
+
* `accumulate`.
|
|
217
|
+
* - `session.<path>` — host session state (lastUserMessage,
|
|
218
|
+
* cartItemCount, user.name, turnCount, …).
|
|
219
|
+
* SDK auto-fills the prop on element mount and
|
|
220
|
+
* re-fills when the field changes.
|
|
221
|
+
*
|
|
222
|
+
* Brand-side handlers in `<FourtyProvider handlers>` ALWAYS win over a
|
|
223
|
+
* catalog binding for the same signal type.
|
|
224
|
+
*/
|
|
225
|
+
export interface Binding {
|
|
226
|
+
/**
|
|
227
|
+
* Routing source — agent signal or session-state field.
|
|
228
|
+
* Examples: `'signal:text.delta'`, `'signal:chip.show'`,
|
|
229
|
+
* `'session.lastUserMessage'`, `'session.cartItemCount'`.
|
|
230
|
+
*/
|
|
231
|
+
source: string;
|
|
232
|
+
/**
|
|
233
|
+
* Catalog component type whose prop receives the payload. Must exist
|
|
234
|
+
* in the same `ComponentCatalog`.
|
|
235
|
+
*/
|
|
236
|
+
componentType: string;
|
|
237
|
+
/**
|
|
238
|
+
* Component prop the payload is written to (e.g. `text` for
|
|
239
|
+
* `agentText`, `prompt` for `turn`).
|
|
240
|
+
*/
|
|
241
|
+
prop: string;
|
|
242
|
+
/**
|
|
243
|
+
* How successive values compose:
|
|
244
|
+
* - `replace` (default) — overwrite the prop on each value
|
|
245
|
+
* - `append` — push onto an array prop
|
|
246
|
+
* - `concat-text` — for streaming text; concatenate
|
|
247
|
+
* `payload.text` (or `payload.delta`) onto
|
|
248
|
+
* the existing prop value
|
|
249
|
+
*/
|
|
250
|
+
accumulate?: 'replace' | 'append' | 'concat-text';
|
|
251
|
+
/**
|
|
252
|
+
* Optional anchor — a key path inside the spec where the SDK should
|
|
253
|
+
* mount the rendered element when no element of `componentType`
|
|
254
|
+
* already exists in the spec. When omitted, the SDK only writes to
|
|
255
|
+
* existing elements and never auto-creates one.
|
|
256
|
+
*/
|
|
257
|
+
mountAt?: string;
|
|
258
|
+
}
|
|
259
|
+
/**
|
|
260
|
+
* Catalog-level routing manifest. Keyed by source string ('signal:text.delta',
|
|
261
|
+
* 'session.lastUserMessage', …). One source can fan out to multiple bindings
|
|
262
|
+
* (mirror text into both an agentText AND a caption strip).
|
|
263
|
+
*/
|
|
264
|
+
export type Bindings = Record<string, Binding | Binding[]>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Container types — SDK rendering primitives. These describe wrapper surfaces the
|
|
3
|
+
* runtime itself knows how to render (stack, modal, drawer, overlay, toast), so
|
|
4
|
+
* they stay in the SDK.
|
|
5
|
+
*
|
|
6
|
+
* Component types are NOT listed here. Components come from the recipe's
|
|
7
|
+
* catalog manifests (`@fourty/catalog` / recipe repo). A fixed SDK list
|
|
8
|
+
* would duplicate — badly — what the catalog already declares.
|
|
9
|
+
*/
|
|
10
|
+
export declare const CONTAINER_TYPES: readonly ["stack", "modal", "drawer", "overlay", "toast"];
|
|
11
|
+
export type ContainerType = (typeof CONTAINER_TYPES)[number];
|
|
12
|
+
/** Component type is any string. Validity is determined by the catalog at runtime. */
|
|
13
|
+
export type ComponentType = string;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { z } from 'zod';
|
|
2
|
+
import type { CatalogEntry } from './catalog-schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Introspects a Zod object schema and produces human-readable prop documentation
|
|
5
|
+
* for LLM prompt injection. Resolved entities are EXPANDED to their full shape —
|
|
6
|
+
* the LLM must see the hydrated-object contract, not a string placeholder.
|
|
7
|
+
*
|
|
8
|
+
* Accepts either a raw `z.ZodObject` schema (legacy callers) or a full
|
|
9
|
+
* `CatalogEntry` (used to hide runtime-bound props from the prompt).
|
|
10
|
+
*/
|
|
11
|
+
export declare function derivePropsDoc(schemaOrEntry: z.ZodObject<z.ZodRawShape> | CatalogEntry | undefined): Record<string, string>;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import type { UIElement } from '../layout/layout';
|
|
2
|
+
import type { ComponentCatalogStructural } from './catalog-schemas';
|
|
3
|
+
/**
|
|
4
|
+
* Options for {@link isElementUnfilled}.
|
|
5
|
+
*/
|
|
6
|
+
export interface ElementFilledOptions {
|
|
7
|
+
/**
|
|
8
|
+
* Refuse the `derivedFrom` self-fetch escape hatch — treat a resolved field
|
|
9
|
+
* that is empty-but-carries-a-`derivedFrom`-sibling (a `productGrid` with a
|
|
10
|
+
* `collectionSlug` but no `products`) as UNFILLED rather than "the SDK will
|
|
11
|
+
* hydrate it from a collection."
|
|
12
|
+
*
|
|
13
|
+
* The escape hatch is correct on a FOREGROUND compose (the self-fetch rail
|
|
14
|
+
* renders beside real content, the fetch reliably lands, the page isn't a
|
|
15
|
+
* self-chaining loop). It is NOT safe on the infinite-scroll EXTEND tail: a
|
|
16
|
+
* rail whose products depend on an async client fetch that may return nothing
|
|
17
|
+
* adds ~no scroll height yet would still count as "appended," which keeps the
|
|
18
|
+
* continuation chain firing forever. On the tail, a surface only counts as real
|
|
19
|
+
* content once its refs are MATERIALIZED. Set this true there so the extend's
|
|
20
|
+
* READ-ONLY append check (`runContinuationCall`) declines to persist the hollow
|
|
21
|
+
* rail and reports the view exhausted — the loop terminates by construction.
|
|
22
|
+
* (The RENDER side needs no prune: `HydratedComponent` collapses an empty
|
|
23
|
+
* resolved slot to nothing, so a hollow rail never strands a skeleton.) Default
|
|
24
|
+
* false.
|
|
25
|
+
*/
|
|
26
|
+
requireMaterialized?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* True when `element` carries a catalog type but a REQUIRED prop has nothing
|
|
30
|
+
* to render — it is an unfilled shell, not a renderable element. The element
|
|
31
|
+
* may be mid-stream (the SDK paints a type-fitting skeleton) or end-of-stream
|
|
32
|
+
* (the agent transform prunes it so the visitor never sees a blank box).
|
|
33
|
+
*
|
|
34
|
+
* Both ways a required prop can be empty are read from the catalog schema —
|
|
35
|
+
* NEVER from a component-name or prop-name hardcode (IV.1: the catalog is the
|
|
36
|
+
* single source of truth):
|
|
37
|
+
*
|
|
38
|
+
* - a `resolved()` entity-ref path is absent / holds no refs (a productGrid
|
|
39
|
+
* with no products), or
|
|
40
|
+
* - a required (non-optional) non-entity prop is absent / empty (an
|
|
41
|
+
* editorialText with no `paragraphs`, a `pullQuote` with no `quote`).
|
|
42
|
+
*
|
|
43
|
+
* A resolved field with a `derivedFrom` sibling (self-fetch rail) is filled-by-
|
|
44
|
+
* design when the sibling is set — UNLESS `options.requireMaterialized` refuses
|
|
45
|
+
* that escape (the extend tail; see {@link ElementFilledOptions}).
|
|
46
|
+
*
|
|
47
|
+
* False when the element's type isn't in the catalog, when it has no required
|
|
48
|
+
* props at all (a propless divider renders the moment its type lands), or when
|
|
49
|
+
* every required prop — entity and otherwise — is filled.
|
|
50
|
+
*/
|
|
51
|
+
export declare function isElementUnfilled(element: UIElement, catalog: ComponentCatalogStructural, aliases: Record<string, string> | undefined, options?: ElementFilledOptions): boolean;
|
|
52
|
+
/**
|
|
53
|
+
* True when `spec` would paint an EMPTY canvas — nothing the visitor can see.
|
|
54
|
+
*
|
|
55
|
+
* `isDegenerateLayout` answers the structural question ("are there any
|
|
56
|
+
* elements?") and is deliberately catalog-free, so it cannot see the case that
|
|
57
|
+
* actually reaches visitors: a layout whose elements all exist but render
|
|
58
|
+
* nothing. A `productGrid` with `products: []` is a real key in `elements{}`
|
|
59
|
+
* and a real child of the root, so `isDegenerateLayout` calls it healthy —
|
|
60
|
+
* while `HydratedComponent`'s empty-slot rule renders it as literally nothing.
|
|
61
|
+
* Observed live (40R-233): a turn whose sole element was exactly that shipped
|
|
62
|
+
* a blank page.
|
|
63
|
+
*
|
|
64
|
+
* This is the RENDERABILITY question, and answering it needs the catalog — so
|
|
65
|
+
* it lives here beside {@link isElementUnfilled}, which does the per-element
|
|
66
|
+
* work. Walks from the root (an element nothing references cannot render, and
|
|
67
|
+
* a child id with no entry in `elements{}` is a dangling reference that paints
|
|
68
|
+
* nothing either).
|
|
69
|
+
*
|
|
70
|
+
* Returns false — "something renders" — when the catalog is unavailable or a
|
|
71
|
+
* child's type isn't in it, matching `isElementUnfilled`'s own bias: an
|
|
72
|
+
* unknown type is assumed renderable rather than silently discarded.
|
|
73
|
+
*/
|
|
74
|
+
export declare function rendersNothing(spec: {
|
|
75
|
+
root: string;
|
|
76
|
+
elements: Record<string, UIElement>;
|
|
77
|
+
}, catalog: ComponentCatalogStructural, aliases: Record<string, string> | undefined): boolean;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ComponentCatalogStructural } from './catalog-schemas';
|
|
2
|
+
/**
|
|
3
|
+
* The entity refs a SINGLE element places, at EVERY `resolved()` site its
|
|
4
|
+
* catalog entry declares — nested markers (`items.*.product`) included.
|
|
5
|
+
* Returns an empty set when the element is malformed, its type is unknown to
|
|
6
|
+
* the catalog, or it declares no resolved sites — an element that places
|
|
7
|
+
* nothing is not an error.
|
|
8
|
+
*
|
|
9
|
+
* Reads SITES, not top-level prop names: this is the "what does the layout
|
|
10
|
+
* place" definition, and a nested ref is placed just as much as a top-level
|
|
11
|
+
* one. Answering from `resolvedTopLevelProps` under-reported both consumers —
|
|
12
|
+
* the overlay's placed-id set and presence's just-materialized set.
|
|
13
|
+
*/
|
|
14
|
+
export declare function collectElementEntityRefs(element: unknown, catalog: ComponentCatalogStructural): Set<string>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Callback-prop discovery — the interaction-contract sibling of
|
|
4
|
+
* `requiredTopLevelProps` / `getResolvedPaths`.
|
|
5
|
+
*
|
|
6
|
+
* A catalog component's props are DATA the agent emits as JSON. The agent
|
|
7
|
+
* never emits a function, so a `ZodFunction` anywhere in a component's
|
|
8
|
+
* `propsSchema` is a structurally dead prop: it is always `undefined` at
|
|
9
|
+
* render, and any control wired to it is a dead no-op (the "dead button"
|
|
10
|
+
* class of bug the interaction contract exists to make impossible — see
|
|
11
|
+
* `docs/create-space.md` §Contracts and
|
|
12
|
+
* architecture-invariants §IV.5).
|
|
13
|
+
*
|
|
14
|
+
* This walks the same single source of truth — the catalog `propsSchema` —
|
|
15
|
+
* and returns the dotted path of every `ZodFunction` it finds, so
|
|
16
|
+
* `buildComponentLibrary` can fail loud at registration (module load)
|
|
17
|
+
* instead of shipping a control that silently does nothing.
|
|
18
|
+
*
|
|
19
|
+
* It deliberately does NOT special-case any component name (IV.1): a
|
|
20
|
+
* function prop is a function prop wherever it sits — top level, inside an
|
|
21
|
+
* array element, a union branch, a record value.
|
|
22
|
+
*/
|
|
23
|
+
export declare function findFunctionPropPaths(schema: z.ZodType | undefined): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ResolvedFieldMeta, ResolvedPathSegment } from './resolved';
|
|
2
|
+
export interface ExpandedPath {
|
|
3
|
+
realPath: (string | number)[];
|
|
4
|
+
/** The leaf value at `realPath` — typically a string ref or string[] of refs. */
|
|
5
|
+
value: unknown;
|
|
6
|
+
}
|
|
7
|
+
export declare function expandPath(node: unknown, remaining: ResolvedPathSegment[]): Generator<ExpandedPath>;
|
|
8
|
+
export declare function normalizeRefs(value: unknown): string[];
|
|
9
|
+
/**
|
|
10
|
+
* True when the sibling prop a `derivedFrom` field names carries something to
|
|
11
|
+
* derive FROM — so this field shipping empty is BY DESIGN, not a hole.
|
|
12
|
+
*
|
|
13
|
+
* Both sibling shapes count, and the catalog decides which one it declared:
|
|
14
|
+
* a QUERY string for a connector to run (`collectionSlug`), or the REF itself
|
|
15
|
+
* under another resolver key (`product`, for that product's reviews). Reading
|
|
16
|
+
* only the string form made the ref form look unpaired — and an unpaired
|
|
17
|
+
* derived field is treated as an unfilled shell and pruned.
|
|
18
|
+
*/
|
|
19
|
+
export declare function derivedSourceFilled(meta: ResolvedFieldMeta, props: Record<string, unknown>): boolean;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { ResolvedPathSegment } from './resolved';
|
|
3
|
+
/**
|
|
4
|
+
* A discriminated-union branch guard. When a prose field lives inside one
|
|
5
|
+
* branch of a `z.discriminatedUnion`, its path is shared with every sibling
|
|
6
|
+
* branch — `blocks[].text` is prose on a `paragraph` block but deliberately
|
|
7
|
+
* plain on a `heading` block. Rendering the path unconditionally would bold
|
|
8
|
+
* a heading the catalog author explicitly left alone. `depth` is the index
|
|
9
|
+
* in the prose path at which the union's object sits, so the discriminator's
|
|
10
|
+
* own value is read from `path.slice(0, depth) + [key]` at render time.
|
|
11
|
+
*/
|
|
12
|
+
export interface ProseDiscriminant {
|
|
13
|
+
depth: number;
|
|
14
|
+
key: string;
|
|
15
|
+
value: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* A path segment sequence from the props root to a prose-marked field. Same
|
|
19
|
+
* segment vocabulary as `ResolvedPath` (string keys, `'*'` for "every array
|
|
20
|
+
* element") — reuses `expandPath`/`setAtPath` from the resolved-path
|
|
21
|
+
* contract, since walking/writing a leaf value is identical regardless of
|
|
22
|
+
* which marker put it there.
|
|
23
|
+
*
|
|
24
|
+
* `when` is non-empty only for fields reached through a discriminated union;
|
|
25
|
+
* every guard must hold for the path to be rendered.
|
|
26
|
+
*/
|
|
27
|
+
export interface ProsePath {
|
|
28
|
+
path: ResolvedPathSegment[];
|
|
29
|
+
when: ProseDiscriminant[];
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Marks a `z.string()` field as PROSE/COPY — free text that may carry
|
|
33
|
+
* markdown (`**bold**`) authored by the agent or a brand. The hydration
|
|
34
|
+
* boundary (`@fourty/react`'s `HydratedComponent`) renders every `prose()`
|
|
35
|
+
* field through the shared inline-markdown renderer BEFORE it reaches the
|
|
36
|
+
* component, so a brand's `<p>{copy}</p>` never shows literal asterisks —
|
|
37
|
+
* no per-component import, no per-callsite render call.
|
|
38
|
+
*
|
|
39
|
+
* Mark card copy, body text, descriptions, answers, quotes, subheads,
|
|
40
|
+
* notes. Do NOT mark structured non-prose strings — a heading/title, a
|
|
41
|
+
* price string, a spec key, an enum-like value — components frequently
|
|
42
|
+
* compare or measure those (`===`, `.length`, `.toUpperCase()`) and a
|
|
43
|
+
* pre-rendered node array would break that.
|
|
44
|
+
*
|
|
45
|
+
* Same `_def`-marker + clone-before-tag discipline as `resolved()` — see
|
|
46
|
+
* that file's docstring for why the marker lives in `_def` and why tagging
|
|
47
|
+
* happens on a clone, never the caller's shared schema instance.
|
|
48
|
+
*/
|
|
49
|
+
export declare function prose<T extends z.ZodString>(schema: T): T;
|
|
50
|
+
/**
|
|
51
|
+
* Walk a Zod props schema and return every prose-marked field's path.
|
|
52
|
+
* Mirrors `getResolvedPaths`'s walk (objects, arrays, unions, the
|
|
53
|
+
* optional/default/nullable unwrap), but stops — without recursing — the
|
|
54
|
+
* moment it crosses a `resolved()` marker: hydrated entities are opaque
|
|
55
|
+
* here, never walked for prose (an entity's own fields are the hydrator's
|
|
56
|
+
* contract, not the catalog's).
|
|
57
|
+
*/
|
|
58
|
+
export declare function getProsePaths(schema: z.ZodType | undefined): ProsePath[];
|
|
59
|
+
export declare function writeProseMeta(schema: z.ZodType): void;
|
|
60
|
+
export declare function readProseMeta(schema: z.ZodType): boolean;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ComponentCatalogStructural } from './catalog-schemas';
|
|
2
|
+
import { type ResolvedFieldMeta, type ResolvedPathSegment } from './resolved';
|
|
3
|
+
import type { z } from 'zod';
|
|
4
|
+
/** One `resolved()` marker a schema declares, addressed by path. */
|
|
5
|
+
export interface EntityRefSite {
|
|
6
|
+
/** Path from the props root. A `'*'` segment fans every array element. */
|
|
7
|
+
path: readonly ResolvedPathSegment[];
|
|
8
|
+
meta: ResolvedFieldMeta;
|
|
9
|
+
/** Dotted path for diagnostics — `products`, `items.*.product`. */
|
|
10
|
+
label: string;
|
|
11
|
+
}
|
|
12
|
+
/** EVERY entity-ref site a schema declares, nested included. */
|
|
13
|
+
export declare function entityRefSites(schema: z.ZodType | undefined): EntityRefSite[];
|
|
14
|
+
/** A ref an element actually placed, with the means to take it back out. */
|
|
15
|
+
export interface PlacedEntityRef {
|
|
16
|
+
site: EntityRefSite;
|
|
17
|
+
ref: string;
|
|
18
|
+
/**
|
|
19
|
+
* Remove this ref from the props tree.
|
|
20
|
+
*
|
|
21
|
+
* - a member of a ref ARRAY → spliced out of that array;
|
|
22
|
+
* - a scalar ref whose owner object is itself an array element AND whose
|
|
23
|
+
* declaration requires it (`min >= 1`) → the OWNER is spliced out. A kit
|
|
24
|
+
* line-item that names an invented product is not a line-item; leaving the
|
|
25
|
+
* husk behind is what renders the eternal shimmer;
|
|
26
|
+
* - any other scalar ref → the key is deleted, leaving the element to the
|
|
27
|
+
* ordinary min/max catalog pass.
|
|
28
|
+
*/
|
|
29
|
+
remove(): void;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* The refs an element's props place at each declared site. Strings only — a
|
|
33
|
+
* non-string at a ref slot is not a reference and is left for schema
|
|
34
|
+
* validation to reject.
|
|
35
|
+
*/
|
|
36
|
+
export declare function collectPlacedEntityRefs(props: Record<string, unknown>, sites: readonly EntityRefSite[]): PlacedEntityRef[];
|
|
37
|
+
/** Strip a package qualifier (`brand:productGrid` → `productGrid`). */
|
|
38
|
+
export declare function bareComponentType(type: string): string;
|
|
39
|
+
/**
|
|
40
|
+
* The refs a SINGLE element places, across every declared site. Returns an
|
|
41
|
+
* empty array when the element is malformed, its type is unknown to the
|
|
42
|
+
* catalog, or it declares no resolved sites — an element that places nothing
|
|
43
|
+
* is not an error.
|
|
44
|
+
*/
|
|
45
|
+
export declare function placedEntityRefsOf(element: unknown, catalog: ComponentCatalogStructural): PlacedEntityRef[];
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Required-prop discovery — the non-entity sibling of `getResolvedPaths`.
|
|
4
|
+
*
|
|
5
|
+
* `resolved()` already declares which props an element NEEDS as entity refs
|
|
6
|
+
* (and `min` makes "needs ≥1" explicit). But a component can be just as
|
|
7
|
+
* empty for a NON-entity reason: an `editorialText` with no `paragraphs`, a
|
|
8
|
+
* `pullQuote` with no `quote`, a `guidedPick` with no `why` — all
|
|
9
|
+
* render as a blank slab. Those props are already declared REQUIRED in the
|
|
10
|
+
* catalog Zod schema (not `.optional()`, not `.default()`); nothing was ever
|
|
11
|
+
* reading that contract.
|
|
12
|
+
*
|
|
13
|
+
* This walks the same single source of truth — the catalog `propsSchema` —
|
|
14
|
+
* and returns the top-level props that MUST be present and non-empty for the
|
|
15
|
+
* element to render anything. It deliberately does NOT special-case "text"
|
|
16
|
+
* or any component name (IV.1): a required prop is a required prop, whether it
|
|
17
|
+
* holds copy, an array of rows, or a scalar. Entity-ref props are excluded
|
|
18
|
+
* here because their emptiness is governed by `resolved()` `min` on the
|
|
19
|
+
* resolved path, checked by the ref-aware caller.
|
|
20
|
+
*/
|
|
21
|
+
export declare function requiredTopLevelProps(schema: z.ZodType | undefined): string[];
|
|
22
|
+
/**
|
|
23
|
+
* True when a prop VALUE counts as "not rendered" — the element declared the
|
|
24
|
+
* prop but gave it nothing to show. Falsy-but-valid scalars (`0`, `false`)
|
|
25
|
+
* are NOT empty; only absence, null, blank string, and the empty array are.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isEmptyPropValue(value: unknown): boolean;
|
|
28
|
+
/** Is a top-level prop OPTIONAL in the component's own schema (absence legal)?
|
|
29
|
+
* A field the author made optional is one the component renders without — so
|
|
30
|
+
* a bad value there is dropped from the element, never the element itself. */
|
|
31
|
+
export declare function isOptionalTopLevelProp(schema: z.ZodType | undefined, prop: string): boolean;
|