@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,244 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Spec } from './layout';
|
|
3
|
+
import { type ShellConfig } from '../shell/shell';
|
|
4
|
+
/**
|
|
5
|
+
* Page — the domain entity describing WHERE the visitor is on the
|
|
6
|
+
* canvas. Identity. Independent of rendered output (that's `View`) and
|
|
7
|
+
* independent of how the visitor got there (chat message vs direct
|
|
8
|
+
* navigation).
|
|
9
|
+
*
|
|
10
|
+
* Every page kind is a destination the `PageRouter` resolves to a
|
|
11
|
+
* `View`. There is NO content-as-identity kind — a Page never embeds a
|
|
12
|
+
* `Spec`. The single `navigate` action carries a `Page` and the Router
|
|
13
|
+
* is the one place a `Page` becomes a `View`.
|
|
14
|
+
*
|
|
15
|
+
* Brand-extensible — adding a new page kind is a Router case, never a
|
|
16
|
+
* Conversation-class change.
|
|
17
|
+
*
|
|
18
|
+
* The kinds are an OPEN set — see `PageKindRegistry` below. This file declares
|
|
19
|
+
* only the canvas-mechanic kinds every vertical shares; a vertical contributes
|
|
20
|
+
* its own from a vertical-named subdir (§VIII.1).
|
|
21
|
+
*
|
|
22
|
+
* `message` / `answer` carry two addresses: `messageIndex` is the
|
|
23
|
+
* client-internal position (resolves the frozen View locally), and
|
|
24
|
+
* `messageId` is the stable turn id — the cross-system key the server
|
|
25
|
+
* uses to anchor conversation context when the visitor prompts from a
|
|
26
|
+
* time-traveled position. Optional only for turns restored from
|
|
27
|
+
* sessions persisted before turn ids shipped.
|
|
28
|
+
*/
|
|
29
|
+
/**
|
|
30
|
+
* PageKindRegistry — the OPEN set of page kinds, keyed by kind name, valued by
|
|
31
|
+
* that kind's payload fields. Only kinds that are canvas mechanics (universal
|
|
32
|
+
* to every vertical) are declared here. A vertical adds its own by augmenting
|
|
33
|
+
* this interface from a vertical-named subdir, e.g.
|
|
34
|
+
* `commerce/page-kinds.ts`:
|
|
35
|
+
*
|
|
36
|
+
* declare module '../layout/page' {
|
|
37
|
+
* interface PageKindRegistry { product: { id: string; morph?: boolean } }
|
|
38
|
+
* }
|
|
39
|
+
* registerPageKindSchema('product', z.object({ … }));
|
|
40
|
+
*
|
|
41
|
+
* Declaration merging is what lets `Page` stay a real discriminated union —
|
|
42
|
+
* `Extract<Page, { kind: 'product' }>` keeps resolving — while this file names
|
|
43
|
+
* no vertical's vocabulary (§VIII.1). A plain `kind: string` would have been
|
|
44
|
+
* open too, but it would have collapsed `Extract` and stripped the typed
|
|
45
|
+
* payload access every page-block formatter depends on.
|
|
46
|
+
*/
|
|
47
|
+
/** A kind carrying nothing beyond its discriminant. `Record<string, never>`
|
|
48
|
+
* cannot be used here — intersecting it would narrow `kind` itself to never. */
|
|
49
|
+
type NoPayload = {
|
|
50
|
+
[K in never]: never;
|
|
51
|
+
};
|
|
52
|
+
/**
|
|
53
|
+
* Only CANVAS MECHANICS live here — kinds that describe where the visitor is
|
|
54
|
+
* in the canvas/conversation itself, not what is on it. Anything naming a
|
|
55
|
+
* subject matter (an article, a product, a listing, a recipe) is a vertical's
|
|
56
|
+
* kind and belongs in that vertical's subdir, however generic the word sounds.
|
|
57
|
+
*/
|
|
58
|
+
export interface PageKindRegistry {
|
|
59
|
+
/** Landing / welcome — resolves to the session seed view. */
|
|
60
|
+
home: NoPayload;
|
|
61
|
+
/** Time-travel: the View frozen at message[index]. */
|
|
62
|
+
message: {
|
|
63
|
+
messageIndex: number;
|
|
64
|
+
messageId?: string;
|
|
65
|
+
};
|
|
66
|
+
/** Time-travel to an agent-built custom turn (comparison, kit, stylist rec). */
|
|
67
|
+
answer: {
|
|
68
|
+
messageIndex: number;
|
|
69
|
+
messageId?: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export type Page = {
|
|
73
|
+
[K in keyof PageKindRegistry]: {
|
|
74
|
+
kind: K;
|
|
75
|
+
} & PageKindRegistry[K];
|
|
76
|
+
}[keyof PageKindRegistry];
|
|
77
|
+
export declare function registerPageKindSchema(kind: string, schema: z.ZodTypeAny): void;
|
|
78
|
+
/** Kinds currently parseable — diagnostics for a failed navigate. */
|
|
79
|
+
export declare function registeredPageKinds(): string[];
|
|
80
|
+
/**
|
|
81
|
+
* Validates a Page against the registered schema for its `kind`, and returns
|
|
82
|
+
* THAT schema's output — so unknown keys are stripped exactly as the previous
|
|
83
|
+
* `z.discriminatedUnion` of `z.object`s stripped them. Page identity is
|
|
84
|
+
* computed downstream by omitting a known key set
|
|
85
|
+
* (`react/…/canvas/nav-entry.ts`), so letting a stray field ride through would
|
|
86
|
+
* silently split one page into two history entries.
|
|
87
|
+
*/
|
|
88
|
+
export declare const PageSchema: z.ZodType<Page>;
|
|
89
|
+
/**
|
|
90
|
+
* `navigate` payload — a typed canvas destination. The single `navigate`
|
|
91
|
+
* action carries one of these; the `PageRouter` resolves the `page` to a
|
|
92
|
+
* `View`. Defined here, beside `PageSchema`, so the signal layer can
|
|
93
|
+
* reference it without `signal → layout` closing an import cycle
|
|
94
|
+
* (`page → shell → agent-signals → page`).
|
|
95
|
+
*/
|
|
96
|
+
export declare const NavigatePayloadSchema: z.ZodObject<{
|
|
97
|
+
page: z.ZodType<Page, z.ZodTypeDef, Page>;
|
|
98
|
+
}, "strip", z.ZodTypeAny, {
|
|
99
|
+
page: Page;
|
|
100
|
+
}, {
|
|
101
|
+
page: Page;
|
|
102
|
+
}>;
|
|
103
|
+
export type NavigatePayload = z.infer<typeof NavigatePayloadSchema>;
|
|
104
|
+
/**
|
|
105
|
+
* ViewportFocus — which top-level layout elements are actually ON SCREEN
|
|
106
|
+
* for the visitor right now (their scroll slice), a refinement of `Page`.
|
|
107
|
+
* The canvas may be tall and carry many elements; this says which subset
|
|
108
|
+
* the visitor SEES, so the agent grounds deictic references ("this", "the
|
|
109
|
+
* one at the top", "above/below") against the visible region instead of
|
|
110
|
+
* assuming the whole canvas is in view.
|
|
111
|
+
*
|
|
112
|
+
* Element ids are generic layout ids (vertical-neutral) — the agent
|
|
113
|
+
* cross-references them against the CURRENT LAYOUT STATE / LAYOUT ENTITIES
|
|
114
|
+
* blocks it already has. Carried by the `view.viewport` interaction signal.
|
|
115
|
+
*/
|
|
116
|
+
export interface ViewportFocus {
|
|
117
|
+
/** Top-level element ids intersecting the viewport, in visual order. */
|
|
118
|
+
visibleElementIds: string[];
|
|
119
|
+
/** The element at the top of the viewport — the visitor's primary focus. */
|
|
120
|
+
topElementId?: string;
|
|
121
|
+
/**
|
|
122
|
+
* True when the visitor has scrolled within the continuation PREFETCH MARGIN
|
|
123
|
+
* (~one viewport) of the content bottom. This is the ANTICIPATORY trigger for
|
|
124
|
+
* view continuation — a pixel-geometry read of "approaching the end", measured
|
|
125
|
+
* client-side, distinct from `visibleElementIds` (which is deictic grounding:
|
|
126
|
+
* what is literally on screen). It lets the agent compose the next batch one
|
|
127
|
+
* screen EARLY instead of only once the last surface is on screen and the
|
|
128
|
+
* visitor is parked at the footer. Absent on a pre-margin client → the agent
|
|
129
|
+
* treats it as not-near (no extend), preserving legacy behavior.
|
|
130
|
+
*/
|
|
131
|
+
nearBottom?: boolean;
|
|
132
|
+
}
|
|
133
|
+
export declare const ViewportFocusSchema: z.ZodObject<{
|
|
134
|
+
visibleElementIds: z.ZodArray<z.ZodString, "many">;
|
|
135
|
+
topElementId: z.ZodOptional<z.ZodString>;
|
|
136
|
+
nearBottom: z.ZodOptional<z.ZodBoolean>;
|
|
137
|
+
}, "strip", z.ZodTypeAny, {
|
|
138
|
+
visibleElementIds: string[];
|
|
139
|
+
topElementId?: string | undefined;
|
|
140
|
+
nearBottom?: boolean | undefined;
|
|
141
|
+
}, {
|
|
142
|
+
visibleElementIds: string[];
|
|
143
|
+
topElementId?: string | undefined;
|
|
144
|
+
nearBottom?: boolean | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
/**
|
|
147
|
+
* View — the rendered canvas state for a Page. Pure output: what the
|
|
148
|
+
* renderer walks. Always tied to a Page (so the visitor / agent can
|
|
149
|
+
* answer "where am I?" from any View).
|
|
150
|
+
*/
|
|
151
|
+
export interface View {
|
|
152
|
+
page: Page;
|
|
153
|
+
layout: Spec;
|
|
154
|
+
shell: ShellConfig;
|
|
155
|
+
}
|
|
156
|
+
export declare const ViewSchema: z.ZodObject<{
|
|
157
|
+
page: z.ZodType<Page, z.ZodTypeDef, Page>;
|
|
158
|
+
layout: z.ZodObject<{
|
|
159
|
+
root: z.ZodString;
|
|
160
|
+
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
161
|
+
elements: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
162
|
+
type: z.ZodString;
|
|
163
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
164
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
165
|
+
experience: z.ZodOptional<z.ZodString>;
|
|
166
|
+
__turnId: z.ZodOptional<z.ZodString>;
|
|
167
|
+
}, "strip", z.ZodTypeAny, {
|
|
168
|
+
type: string;
|
|
169
|
+
props: Record<string, unknown>;
|
|
170
|
+
children?: string[] | undefined;
|
|
171
|
+
experience?: string | undefined;
|
|
172
|
+
__turnId?: string | undefined;
|
|
173
|
+
}, {
|
|
174
|
+
type: string;
|
|
175
|
+
props?: Record<string, unknown> | undefined;
|
|
176
|
+
children?: string[] | undefined;
|
|
177
|
+
experience?: string | undefined;
|
|
178
|
+
__turnId?: string | undefined;
|
|
179
|
+
}>>;
|
|
180
|
+
state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
181
|
+
}, "strip", z.ZodTypeAny, {
|
|
182
|
+
root: string;
|
|
183
|
+
elements: Record<string, {
|
|
184
|
+
type: string;
|
|
185
|
+
props: Record<string, unknown>;
|
|
186
|
+
children?: string[] | undefined;
|
|
187
|
+
experience?: string | undefined;
|
|
188
|
+
__turnId?: string | undefined;
|
|
189
|
+
}>;
|
|
190
|
+
aliases?: Record<string, string> | undefined;
|
|
191
|
+
state?: Record<string, unknown> | undefined;
|
|
192
|
+
}, {
|
|
193
|
+
root: string;
|
|
194
|
+
elements: Record<string, {
|
|
195
|
+
type: string;
|
|
196
|
+
props?: Record<string, unknown> | undefined;
|
|
197
|
+
children?: string[] | undefined;
|
|
198
|
+
experience?: string | undefined;
|
|
199
|
+
__turnId?: string | undefined;
|
|
200
|
+
}>;
|
|
201
|
+
aliases?: Record<string, string> | undefined;
|
|
202
|
+
state?: Record<string, unknown> | undefined;
|
|
203
|
+
}>;
|
|
204
|
+
shell: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
205
|
+
}, "strip", z.ZodTypeAny, {
|
|
206
|
+
page: Page;
|
|
207
|
+
layout: {
|
|
208
|
+
root: string;
|
|
209
|
+
elements: Record<string, {
|
|
210
|
+
type: string;
|
|
211
|
+
props: Record<string, unknown>;
|
|
212
|
+
children?: string[] | undefined;
|
|
213
|
+
experience?: string | undefined;
|
|
214
|
+
__turnId?: string | undefined;
|
|
215
|
+
}>;
|
|
216
|
+
aliases?: Record<string, string> | undefined;
|
|
217
|
+
state?: Record<string, unknown> | undefined;
|
|
218
|
+
};
|
|
219
|
+
shell: Record<string, unknown>;
|
|
220
|
+
}, {
|
|
221
|
+
page: Page;
|
|
222
|
+
layout: {
|
|
223
|
+
root: string;
|
|
224
|
+
elements: Record<string, {
|
|
225
|
+
type: string;
|
|
226
|
+
props?: Record<string, unknown> | undefined;
|
|
227
|
+
children?: string[] | undefined;
|
|
228
|
+
experience?: string | undefined;
|
|
229
|
+
__turnId?: string | undefined;
|
|
230
|
+
}>;
|
|
231
|
+
aliases?: Record<string, string> | undefined;
|
|
232
|
+
state?: Record<string, unknown> | undefined;
|
|
233
|
+
};
|
|
234
|
+
shell: Record<string, unknown>;
|
|
235
|
+
}>;
|
|
236
|
+
/**
|
|
237
|
+
* PageRouter — pure function from Page → View. Brand-provided. Each
|
|
238
|
+
* brand registers a router that knows how to fetch / build the layout
|
|
239
|
+
* for the page kinds it cares about. Async for I/O-bound kinds
|
|
240
|
+
* (product hydration, search results); sync is fine for purely
|
|
241
|
+
* computed ones (home, message time-travel).
|
|
242
|
+
*/
|
|
243
|
+
export type PageRouter = (page: Page) => View | Promise<View>;
|
|
244
|
+
export {};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type UIElement } from './layout';
|
|
3
|
+
/**
|
|
4
|
+
* Universal patch — the single op vocabulary the wire emits and the
|
|
5
|
+
* Thread consumes. Three shapes. Addressed by `id`; routing to slice
|
|
6
|
+
* (prose / actions / layout) happens at the Thread boundary by id.
|
|
7
|
+
*
|
|
8
|
+
* set — wholesale replace of the element bound to `id`
|
|
9
|
+
* append — concat onto one field (string field => string concat,
|
|
10
|
+
* array field => array concat)
|
|
11
|
+
* remove — drop the element bound to `id`
|
|
12
|
+
*/
|
|
13
|
+
export type Patch = {
|
|
14
|
+
id: string;
|
|
15
|
+
op: 'set';
|
|
16
|
+
element: UIElement;
|
|
17
|
+
} | {
|
|
18
|
+
id: string;
|
|
19
|
+
op: 'append';
|
|
20
|
+
field: string;
|
|
21
|
+
value: string | unknown[];
|
|
22
|
+
} | {
|
|
23
|
+
id: string;
|
|
24
|
+
op: 'remove';
|
|
25
|
+
};
|
|
26
|
+
export declare const PatchSchema: z.ZodUnion<[z.ZodObject<{
|
|
27
|
+
id: z.ZodString;
|
|
28
|
+
op: z.ZodLiteral<"set">;
|
|
29
|
+
element: z.ZodObject<{
|
|
30
|
+
type: z.ZodString;
|
|
31
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
32
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
33
|
+
experience: z.ZodOptional<z.ZodString>;
|
|
34
|
+
__turnId: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
type: string;
|
|
37
|
+
props: Record<string, unknown>;
|
|
38
|
+
children?: string[] | undefined;
|
|
39
|
+
experience?: string | undefined;
|
|
40
|
+
__turnId?: string | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
type: string;
|
|
43
|
+
props?: Record<string, unknown> | undefined;
|
|
44
|
+
children?: string[] | undefined;
|
|
45
|
+
experience?: string | undefined;
|
|
46
|
+
__turnId?: string | undefined;
|
|
47
|
+
}>;
|
|
48
|
+
}, "strip", z.ZodTypeAny, {
|
|
49
|
+
op: "set";
|
|
50
|
+
id: string;
|
|
51
|
+
element: {
|
|
52
|
+
type: string;
|
|
53
|
+
props: Record<string, unknown>;
|
|
54
|
+
children?: string[] | undefined;
|
|
55
|
+
experience?: string | undefined;
|
|
56
|
+
__turnId?: string | undefined;
|
|
57
|
+
};
|
|
58
|
+
}, {
|
|
59
|
+
op: "set";
|
|
60
|
+
id: string;
|
|
61
|
+
element: {
|
|
62
|
+
type: string;
|
|
63
|
+
props?: Record<string, unknown> | undefined;
|
|
64
|
+
children?: string[] | undefined;
|
|
65
|
+
experience?: string | undefined;
|
|
66
|
+
__turnId?: string | undefined;
|
|
67
|
+
};
|
|
68
|
+
}>, z.ZodObject<{
|
|
69
|
+
id: z.ZodString;
|
|
70
|
+
op: z.ZodLiteral<"append">;
|
|
71
|
+
field: z.ZodString;
|
|
72
|
+
value: z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodUnknown, "many">]>;
|
|
73
|
+
}, "strip", z.ZodTypeAny, {
|
|
74
|
+
value: string | unknown[];
|
|
75
|
+
op: "append";
|
|
76
|
+
id: string;
|
|
77
|
+
field: string;
|
|
78
|
+
}, {
|
|
79
|
+
value: string | unknown[];
|
|
80
|
+
op: "append";
|
|
81
|
+
id: string;
|
|
82
|
+
field: string;
|
|
83
|
+
}>, z.ZodObject<{
|
|
84
|
+
id: z.ZodString;
|
|
85
|
+
op: z.ZodLiteral<"remove">;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
op: "remove";
|
|
88
|
+
id: string;
|
|
89
|
+
}, {
|
|
90
|
+
op: "remove";
|
|
91
|
+
id: string;
|
|
92
|
+
}>]>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Spec } from './layout';
|
|
2
|
+
import type { Patch } from './patch';
|
|
3
|
+
/**
|
|
4
|
+
* Apply a Patch to a Spec's flat element map. Pure, immutable. Touches
|
|
5
|
+
* exactly the bound element id — siblings keep their references so React
|
|
6
|
+
* reconciliation drops the work to the one branch that changed.
|
|
7
|
+
*
|
|
8
|
+
* Intended for the layout slice only. Patches addressed to reserved ids
|
|
9
|
+
* (prose / followups) are routed elsewhere by the Thread and never reach
|
|
10
|
+
* this reducer.
|
|
11
|
+
*
|
|
12
|
+
* Diagnostics returned alongside the next spec rather than thrown so the
|
|
13
|
+
* caller can route them to a trace channel.
|
|
14
|
+
*/
|
|
15
|
+
export interface ReducePatchResult {
|
|
16
|
+
spec: Spec;
|
|
17
|
+
diagnostic?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function reducePatch(spec: Spec, patch: Patch): ReducePatchResult;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reserved element ids — Thread routes patches addressed to these ids
|
|
3
|
+
* into non-layout slices (streams.prose, streams.actions) instead of
|
|
4
|
+
* spec.elements. Parser strips them from any page.children list so they
|
|
5
|
+
* cannot leak into the canvas tree.
|
|
6
|
+
*/
|
|
7
|
+
export declare const RESERVED_IDS: {
|
|
8
|
+
readonly prose: "prose";
|
|
9
|
+
readonly followups: "followups";
|
|
10
|
+
};
|
|
11
|
+
export type ReservedId = (typeof RESERVED_IDS)[keyof typeof RESERVED_IDS];
|
|
12
|
+
export declare const RESERVED_ID_SET: ReadonlySet<string>;
|
|
13
|
+
export declare function isReservedId(id: string): id is ReservedId;
|
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A directive value the agent emits for an isolate axis. Either a literal,
|
|
4
|
+
* or the late-bound marker `{ fact: true }` meaning "resolve from the
|
|
5
|
+
* visitor's stored fact for this axis at render time" — so the agent can
|
|
6
|
+
* isolate to the visitor's size without knowing the literal, and the
|
|
7
|
+
* projection keeps tracking that fact if the visitor changes it.
|
|
8
|
+
*/
|
|
9
|
+
export declare const LateBoundValueSchema: z.ZodObject<{
|
|
10
|
+
fact: z.ZodLiteral<true>;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
fact: true;
|
|
13
|
+
}, {
|
|
14
|
+
fact: true;
|
|
15
|
+
}>;
|
|
16
|
+
export type LateBoundValue = z.infer<typeof LateBoundValueSchema>;
|
|
17
|
+
export declare const DirectiveValueSchema: z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
18
|
+
fact: z.ZodLiteral<true>;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
fact: true;
|
|
21
|
+
}, {
|
|
22
|
+
fact: true;
|
|
23
|
+
}>]>;
|
|
24
|
+
export type DirectiveValue = z.infer<typeof DirectiveValueSchema>;
|
|
25
|
+
/** Type guard — narrows a directive value to the late-bound marker. */
|
|
26
|
+
export declare function isLateBound(v: DirectiveValue): v is LateBoundValue;
|
|
27
|
+
/**
|
|
28
|
+
* One projection directive — applies to a single scope (e.g. a product's
|
|
29
|
+
* variants). Every field is optional; an empty directive `{}` is a no-op.
|
|
30
|
+
*/
|
|
31
|
+
export declare const ProjectionDirectiveSchema: z.ZodObject<{
|
|
32
|
+
/** Keep only items whose axis values all match. Keyed by axis name
|
|
33
|
+
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
34
|
+
isolateTo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
35
|
+
fact: z.ZodLiteral<true>;
|
|
36
|
+
}, "strip", z.ZodTypeAny, {
|
|
37
|
+
fact: true;
|
|
38
|
+
}, {
|
|
39
|
+
fact: true;
|
|
40
|
+
}>]>>>;
|
|
41
|
+
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
42
|
+
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
43
|
+
* entity binding expands it against the entity's own axes + facts. */
|
|
44
|
+
isolateToFacts: z.ZodOptional<z.ZodBoolean>;
|
|
45
|
+
/** Keep only items the entity binding reports as available. */
|
|
46
|
+
availableOnly: z.ZodOptional<z.ZodBoolean>;
|
|
47
|
+
/** Cap the rendered count after filtering. */
|
|
48
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
49
|
+
}, "strip", z.ZodTypeAny, {
|
|
50
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
51
|
+
fact: true;
|
|
52
|
+
}> | undefined;
|
|
53
|
+
isolateToFacts?: boolean | undefined;
|
|
54
|
+
availableOnly?: boolean | undefined;
|
|
55
|
+
limit?: number | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
58
|
+
fact: true;
|
|
59
|
+
}> | undefined;
|
|
60
|
+
isolateToFacts?: boolean | undefined;
|
|
61
|
+
availableOnly?: boolean | undefined;
|
|
62
|
+
limit?: number | undefined;
|
|
63
|
+
}>;
|
|
64
|
+
export type ProjectionDirective = z.infer<typeof ProjectionDirectiveSchema>;
|
|
65
|
+
/**
|
|
66
|
+
* Standing projection preferences — `scope → directive`, or `scope → null`
|
|
67
|
+
* to clear that scope. This is both the payload shape of the
|
|
68
|
+
* `projection.set` signal and the shape of the client-side
|
|
69
|
+
* ProjectionPreferences store. A scope is an opaque string the ecommerce
|
|
70
|
+
* binding interprets (e.g. `product.variants`) — the universal layer never
|
|
71
|
+
* parses it.
|
|
72
|
+
*/
|
|
73
|
+
export declare const ProjectionPreferencesSchema: z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
74
|
+
/** Keep only items whose axis values all match. Keyed by axis name
|
|
75
|
+
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
76
|
+
isolateTo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
77
|
+
fact: z.ZodLiteral<true>;
|
|
78
|
+
}, "strip", z.ZodTypeAny, {
|
|
79
|
+
fact: true;
|
|
80
|
+
}, {
|
|
81
|
+
fact: true;
|
|
82
|
+
}>]>>>;
|
|
83
|
+
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
84
|
+
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
85
|
+
* entity binding expands it against the entity's own axes + facts. */
|
|
86
|
+
isolateToFacts: z.ZodOptional<z.ZodBoolean>;
|
|
87
|
+
/** Keep only items the entity binding reports as available. */
|
|
88
|
+
availableOnly: z.ZodOptional<z.ZodBoolean>;
|
|
89
|
+
/** Cap the rendered count after filtering. */
|
|
90
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
91
|
+
}, "strip", z.ZodTypeAny, {
|
|
92
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
93
|
+
fact: true;
|
|
94
|
+
}> | undefined;
|
|
95
|
+
isolateToFacts?: boolean | undefined;
|
|
96
|
+
availableOnly?: boolean | undefined;
|
|
97
|
+
limit?: number | undefined;
|
|
98
|
+
}, {
|
|
99
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
100
|
+
fact: true;
|
|
101
|
+
}> | undefined;
|
|
102
|
+
isolateToFacts?: boolean | undefined;
|
|
103
|
+
availableOnly?: boolean | undefined;
|
|
104
|
+
limit?: number | undefined;
|
|
105
|
+
}>, z.ZodNull]>>;
|
|
106
|
+
export type ProjectionPreferences = z.infer<typeof ProjectionPreferencesSchema>;
|
|
107
|
+
/** Signal type the agent emits to set/clear standing projection state. */
|
|
108
|
+
export declare const PROJECTION_SET_SIGNAL = "projection.set";
|
|
109
|
+
/**
|
|
110
|
+
* Payload schema for the `projection.set` signal. Two forms, both patches:
|
|
111
|
+
* - `setAll` — scope-less. The agent emits this (vertical-agnostic — it
|
|
112
|
+
* cannot name scopes); the client expands it across every projectable
|
|
113
|
+
* scope it knows. `null` clears them all.
|
|
114
|
+
* - `set` — explicit scope-keyed updates, for callers that DO know
|
|
115
|
+
* scopes. A `null` value clears that scope.
|
|
116
|
+
*/
|
|
117
|
+
export declare const ProjectionSetPayloadSchema: z.ZodObject<{
|
|
118
|
+
setAll: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
119
|
+
/** Keep only items whose axis values all match. Keyed by axis name
|
|
120
|
+
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
121
|
+
isolateTo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
122
|
+
fact: z.ZodLiteral<true>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
fact: true;
|
|
125
|
+
}, {
|
|
126
|
+
fact: true;
|
|
127
|
+
}>]>>>;
|
|
128
|
+
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
129
|
+
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
130
|
+
* entity binding expands it against the entity's own axes + facts. */
|
|
131
|
+
isolateToFacts: z.ZodOptional<z.ZodBoolean>;
|
|
132
|
+
/** Keep only items the entity binding reports as available. */
|
|
133
|
+
availableOnly: z.ZodOptional<z.ZodBoolean>;
|
|
134
|
+
/** Cap the rendered count after filtering. */
|
|
135
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
136
|
+
}, "strip", z.ZodTypeAny, {
|
|
137
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
138
|
+
fact: true;
|
|
139
|
+
}> | undefined;
|
|
140
|
+
isolateToFacts?: boolean | undefined;
|
|
141
|
+
availableOnly?: boolean | undefined;
|
|
142
|
+
limit?: number | undefined;
|
|
143
|
+
}, {
|
|
144
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
145
|
+
fact: true;
|
|
146
|
+
}> | undefined;
|
|
147
|
+
isolateToFacts?: boolean | undefined;
|
|
148
|
+
availableOnly?: boolean | undefined;
|
|
149
|
+
limit?: number | undefined;
|
|
150
|
+
}>, z.ZodNull]>>;
|
|
151
|
+
set: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodObject<{
|
|
152
|
+
/** Keep only items whose axis values all match. Keyed by axis name
|
|
153
|
+
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
154
|
+
isolateTo: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodString, z.ZodNumber, z.ZodBoolean, z.ZodObject<{
|
|
155
|
+
fact: z.ZodLiteral<true>;
|
|
156
|
+
}, "strip", z.ZodTypeAny, {
|
|
157
|
+
fact: true;
|
|
158
|
+
}, {
|
|
159
|
+
fact: true;
|
|
160
|
+
}>]>>>;
|
|
161
|
+
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
162
|
+
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
163
|
+
* entity binding expands it against the entity's own axes + facts. */
|
|
164
|
+
isolateToFacts: z.ZodOptional<z.ZodBoolean>;
|
|
165
|
+
/** Keep only items the entity binding reports as available. */
|
|
166
|
+
availableOnly: z.ZodOptional<z.ZodBoolean>;
|
|
167
|
+
/** Cap the rendered count after filtering. */
|
|
168
|
+
limit: z.ZodOptional<z.ZodNumber>;
|
|
169
|
+
}, "strip", z.ZodTypeAny, {
|
|
170
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
171
|
+
fact: true;
|
|
172
|
+
}> | undefined;
|
|
173
|
+
isolateToFacts?: boolean | undefined;
|
|
174
|
+
availableOnly?: boolean | undefined;
|
|
175
|
+
limit?: number | undefined;
|
|
176
|
+
}, {
|
|
177
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
178
|
+
fact: true;
|
|
179
|
+
}> | undefined;
|
|
180
|
+
isolateToFacts?: boolean | undefined;
|
|
181
|
+
availableOnly?: boolean | undefined;
|
|
182
|
+
limit?: number | undefined;
|
|
183
|
+
}>, z.ZodNull]>>>;
|
|
184
|
+
}, "strip", z.ZodTypeAny, {
|
|
185
|
+
set?: Record<string, {
|
|
186
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
187
|
+
fact: true;
|
|
188
|
+
}> | undefined;
|
|
189
|
+
isolateToFacts?: boolean | undefined;
|
|
190
|
+
availableOnly?: boolean | undefined;
|
|
191
|
+
limit?: number | undefined;
|
|
192
|
+
} | null> | undefined;
|
|
193
|
+
setAll?: {
|
|
194
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
195
|
+
fact: true;
|
|
196
|
+
}> | undefined;
|
|
197
|
+
isolateToFacts?: boolean | undefined;
|
|
198
|
+
availableOnly?: boolean | undefined;
|
|
199
|
+
limit?: number | undefined;
|
|
200
|
+
} | null | undefined;
|
|
201
|
+
}, {
|
|
202
|
+
set?: Record<string, {
|
|
203
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
204
|
+
fact: true;
|
|
205
|
+
}> | undefined;
|
|
206
|
+
isolateToFacts?: boolean | undefined;
|
|
207
|
+
availableOnly?: boolean | undefined;
|
|
208
|
+
limit?: number | undefined;
|
|
209
|
+
} | null> | undefined;
|
|
210
|
+
setAll?: {
|
|
211
|
+
isolateTo?: Record<string, string | number | boolean | {
|
|
212
|
+
fact: true;
|
|
213
|
+
}> | undefined;
|
|
214
|
+
isolateToFacts?: boolean | undefined;
|
|
215
|
+
availableOnly?: boolean | undefined;
|
|
216
|
+
limit?: number | undefined;
|
|
217
|
+
} | null | undefined;
|
|
218
|
+
}>;
|
|
219
|
+
export type ProjectionSetPayload = z.infer<typeof ProjectionSetPayloadSchema>;
|
|
220
|
+
/**
|
|
221
|
+
* Accessors the entity binding supplies so the generic engine can read
|
|
222
|
+
* opaque items. The engine never knows what an item IS — only how to ask
|
|
223
|
+
* it for an axis value and whether it is available.
|
|
224
|
+
*/
|
|
225
|
+
export interface ProjectionAccessors<T> {
|
|
226
|
+
/** Read an item's value for a named axis; undefined if it lacks it. */
|
|
227
|
+
axisValueOf: (item: T, axis: string) => string | undefined;
|
|
228
|
+
/** Whether an item counts as available (for `availableOnly`). */
|
|
229
|
+
isAvailable: (item: T) => boolean;
|
|
230
|
+
/** Resolve a late-bound `{fact:true}` value for an axis — typically the
|
|
231
|
+
* visitor's stored fact. Returns undefined when no fact is known. */
|
|
232
|
+
resolveFact: (axis: string) => string | undefined;
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Pure collection projection. Filters `items` by the directive using the
|
|
236
|
+
* caller-supplied accessors. Returns the projected slice and how many
|
|
237
|
+
* items were hidden.
|
|
238
|
+
*
|
|
239
|
+
* A late-bound isolate axis whose fact is unknown is SKIPPED, not applied —
|
|
240
|
+
* isolating to an unknown value would empty the UI, which reads as a broken
|
|
241
|
+
* render rather than a personalized one.
|
|
242
|
+
*/
|
|
243
|
+
export declare function projectCollection<T>(items: readonly T[], directive: ProjectionDirective, acc: ProjectionAccessors<T>): {
|
|
244
|
+
projected: T[];
|
|
245
|
+
hiddenCount: number;
|
|
246
|
+
};
|
|
247
|
+
/** True when a directive would actually change a collection — used to skip
|
|
248
|
+
* publishing a no-op projection (keeps `ProjectionContext` quiet). */
|
|
249
|
+
export declare function isActiveDirective(directive: ProjectionDirective | null | undefined): boolean;
|