@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 @@
|
|
|
1
|
+
export declare function formatVariantValue(value: string): string;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './commerce-schemas';
|
|
2
|
+
export * from './review-schemas';
|
|
3
|
+
export { formatVariantValue } from './format-variant-value';
|
|
4
|
+
export { parseBcp47Locale, type CommerceLocale } from './locale';
|
|
5
|
+
export { pickProductCardAction, pickCartAddAction } from './pick-product-card-action';
|
|
6
|
+
export { buildOptimisticCartLine, type OptimisticCartLine } from './optimistic-cart-line';
|
|
7
|
+
export { selectedOptionsToRecord, cartLineMatchesSelections, cartLinesForProduct, } from './cart-line-selections';
|
|
8
|
+
export { PRODUCT_VARIANTS_SCOPE, projectProduct, entityProjections, type EntityProjectionSpec, } from './projection-spec';
|
|
9
|
+
export { type ProductBucket, productTypeBucket, normalizeAttributeField, scopedAttributeKey, lookupBucketedFact, ECOMMERCE_ATTRIBUTE_SCOPE, } from './attribute-buckets';
|
|
10
|
+
export { buildPdpCompanionsConfig, readPdpCompanions } from './pdp-companions';
|
|
11
|
+
export { buildBaseAttributesConfig, readBaseAttributesConfig } from './base-attributes';
|
|
12
|
+
export { buildBucketLabelsConfig, readBucketLabelsConfig } from './bucket-labels';
|
|
13
|
+
export { registerProductNameLookup, resolveProductNameLookup, clearProductNameLookups, type ProductNameLookup, type ProductNameLookupFactory, type ProductNameMatch, } from './product-lookup';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Commerce locale — the {country, language} pair that contextualizes
|
|
3
|
+
* catalog pricing and content for a visitor.
|
|
4
|
+
*
|
|
5
|
+
* Shopify's Storefront API consumes it via the `@inContext(country:,
|
|
6
|
+
* language:)` directive (CountryCode / LanguageCode enums — uppercase
|
|
7
|
+
* ISO 3166-1 alpha-2 / ISO 639-1). Other backends have equivalent
|
|
8
|
+
* concepts (Magento store views, Woo currency plugins), so the shape
|
|
9
|
+
* lives here in the neutral commerce package, not in a Shopify adapter.
|
|
10
|
+
*/
|
|
11
|
+
export interface CommerceLocale {
|
|
12
|
+
/** ISO 3166-1 alpha-2, uppercase — e.g. "US", "DE". */
|
|
13
|
+
country?: string;
|
|
14
|
+
/** ISO 639-1, uppercase — e.g. "EN", "FR". */
|
|
15
|
+
language?: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Parse a BCP-47 locale tag (the `navigator.language` shape — "en-US",
|
|
19
|
+
* "fr", "de-DE", "zh-Hans-CN") into a CommerceLocale.
|
|
20
|
+
*
|
|
21
|
+
* - Language: first subtag, uppercased. Required — a tag without one
|
|
22
|
+
* returns an empty locale.
|
|
23
|
+
* - Country: the first 2-letter ALL-ALPHA region subtag after the
|
|
24
|
+
* language, uppercased. Script subtags ("Hans") and extensions are
|
|
25
|
+
* skipped. Absent region → country stays undefined (Shopify then
|
|
26
|
+
* falls back to the store default).
|
|
27
|
+
*
|
|
28
|
+
* Invalid / empty input returns `{}` — callers pass it straight through
|
|
29
|
+
* and the backend applies its defaults. Never throws.
|
|
30
|
+
*/
|
|
31
|
+
export declare function parseBcp47Locale(tag: string): CommerceLocale;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Product, ProductVariant, Money, Image } from './commerce-schemas';
|
|
2
|
+
/**
|
|
3
|
+
* Display-ready optimistic cart line — everything the cart drawer needs to
|
|
4
|
+
* paint a COMPLETE row the instant a visitor adds, before the backend
|
|
5
|
+
* round-trip returns. Built once from the domain objects the add site already
|
|
6
|
+
* holds, so there are no scattered scalar "hints": the product/variant → line
|
|
7
|
+
* mapping lives in exactly one place (`buildOptimisticCartLine`).
|
|
8
|
+
*
|
|
9
|
+
* This mirrors how Shopify's Hydrogen `useOptimisticCart` works — it derives
|
|
10
|
+
* the pending line from the submitted `selectedVariant` object rather than a
|
|
11
|
+
* pile of separate fields — without taking on any Hydrogen dependency (our
|
|
12
|
+
* optimistic paint stays in the engine's TanStack `onMutate`).
|
|
13
|
+
*/
|
|
14
|
+
export interface OptimisticCartLine {
|
|
15
|
+
/**
|
|
16
|
+
* Real variant id, present when the add site resolved it (PDP, a picked
|
|
17
|
+
* card). Lets the mutation MERGE into an existing same-variant line the way
|
|
18
|
+
* the backend does, instead of appending a duplicate that collapses on
|
|
19
|
+
* reconcile. Absent on the agent path, where the variant materializes only
|
|
20
|
+
* after hydration.
|
|
21
|
+
*/
|
|
22
|
+
merchandiseId?: string;
|
|
23
|
+
productId: string;
|
|
24
|
+
title: string;
|
|
25
|
+
variantTitle?: string;
|
|
26
|
+
unitPrice: Money;
|
|
27
|
+
image?: Image;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Build an optimistic line from a product, and the picked variant when the add
|
|
31
|
+
* site knows it. The single source for the product/variant → line-field
|
|
32
|
+
* mapping every add site (PDP, product card, quick-add chip) shares.
|
|
33
|
+
*
|
|
34
|
+
* Without a variant (the agent/quick-add path, variant unresolved) the line
|
|
35
|
+
* uses the product's representative price + primary image; the mutation's
|
|
36
|
+
* `onSuccess` reconciles to the exact variant money the moment it lands.
|
|
37
|
+
*/
|
|
38
|
+
export declare function buildOptimisticCartLine(product: Product, variant?: ProductVariant): OptimisticCartLine;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDP companion config — the ecommerce-vertical vocabulary for "which
|
|
3
|
+
* catalog component types render after the product detail on a
|
|
4
|
+
* navigation-triggered (non-agent) product page."
|
|
5
|
+
*
|
|
6
|
+
* Universal types (`BrandDefinition.config`, `ComponentSource.config`) carry
|
|
7
|
+
* this as an opaque `Record<string, unknown>` blob so they stay
|
|
8
|
+
* vertical-agnostic (architecture-invariants.md §VIII.1). This module is the
|
|
9
|
+
* ONE place that knows the key inside that bag — a brand package builds its
|
|
10
|
+
* config with `buildPdpCompanionsConfig`, the server resolver reads it back
|
|
11
|
+
* with `readPdpCompanions`. Neither side needs to agree on a raw string.
|
|
12
|
+
*/
|
|
13
|
+
/** Build the `config` blob a brand's `BrandDefinition` should carry to
|
|
14
|
+
* declare its ordered PDP companion component types. */
|
|
15
|
+
export declare function buildPdpCompanionsConfig(types: readonly string[]): Record<string, unknown>;
|
|
16
|
+
/**
|
|
17
|
+
* Read the ordered companion type list back out of an opaque config blob.
|
|
18
|
+
* Returns `undefined` when the source declares none (so a resolver can fall
|
|
19
|
+
* through to the next source), `string[]` — possibly empty — when it does.
|
|
20
|
+
*/
|
|
21
|
+
export declare function readPdpCompanions(config: Record<string, unknown> | undefined): string[] | undefined;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Product } from './commerce-schemas';
|
|
2
|
+
import { type SuggestionAction } from '../../spacestation/src/index';
|
|
3
|
+
import type { CartOrigin } from '../../spacestation/src/analytics/ecommerce/index';
|
|
4
|
+
/**
|
|
5
|
+
* pickProductCardAction — the single rule for "what does clicking a
|
|
6
|
+
* product card do." It dispatches the one `navigate` action with a
|
|
7
|
+
* `{kind:'product', id}` destination; the commerce `PageRouter` resolves
|
|
8
|
+
* it to the canonical productDetail view and the hydrator resolves the
|
|
9
|
+
* product id at render time.
|
|
10
|
+
*
|
|
11
|
+
* Brand cards consume this and dispatch the resulting action via
|
|
12
|
+
* `useFourtySession().dispatchSuggestionAction`. Behavior stays
|
|
13
|
+
* identical across brands; only the card's visual chrome differs.
|
|
14
|
+
*/
|
|
15
|
+
export declare function pickProductCardAction(product: Product): SuggestionAction;
|
|
16
|
+
/**
|
|
17
|
+
* pickCartAddAction — chip dispatch for a quick-add button on a
|
|
18
|
+
* product card. Carries the productId so the agent's cart handler can
|
|
19
|
+
* resolve a default variant if `variantId` isn't pinned by the caller.
|
|
20
|
+
*
|
|
21
|
+
* Also carries `optimisticLine` — the complete drawer-row descriptor built
|
|
22
|
+
* from the product in hand (`buildOptimisticCartLine`) — so the cart drawer's
|
|
23
|
+
* optimistic row paints complete (title, image, price) on click, without
|
|
24
|
+
* waiting for the Shopify cart refetch. Native storefronts do this same trick:
|
|
25
|
+
* the click source has the product object, the line is synthesized from it,
|
|
26
|
+
* the backend refetch reconciles in the background. No variant is known at
|
|
27
|
+
* quick-add time, so the line uses the product's representative price.
|
|
28
|
+
*
|
|
29
|
+
* ── `origin` IS A PARAMETER, NOT A LITERAL ─────────────────────────────────
|
|
30
|
+
*
|
|
31
|
+
* Every caller today is a visitor tap (a card's quick-add, a comparison row's
|
|
32
|
+
* add, a bundle's add-all), and every one of them could pass `'visitor'`
|
|
33
|
+
* itself. It is a parameter anyway because this is a BUILDER: the moment an
|
|
34
|
+
* agent-side or WebMCP caller reaches for it, a baked-in `'visitor'` would
|
|
35
|
+
* misattribute their adds silently, whereas a required parameter is a compile
|
|
36
|
+
* error that asks the question.
|
|
37
|
+
*/
|
|
38
|
+
export declare function pickCartAddAction(product: Product, origin: CartOrigin): SuggestionAction;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Product name → id, resolved by whatever the space's platform already uses
|
|
3
|
+
* for product search.
|
|
4
|
+
*
|
|
5
|
+
* A tool that takes a product NAME has to turn it into an id before it can
|
|
6
|
+
* read anything filed under that id. Doing that inside the tool's own index
|
|
7
|
+
* only finds products that index happens to hold, and matches on stored
|
|
8
|
+
* titles rather than on search — so a phrasing the title words differently
|
|
9
|
+
* resolves to nothing, and a product the index has never seen cannot resolve
|
|
10
|
+
* at all.
|
|
11
|
+
*
|
|
12
|
+
* The lookup is therefore INJECTED, not implemented here: the platform
|
|
13
|
+
* binding that owns product search registers one (§IX — registry + a
|
|
14
|
+
* side-effect bindings file in the platform package), and this package keeps
|
|
15
|
+
* no knowledge of who answers. Optional by construction: with nothing
|
|
16
|
+
* registered a caller falls back to whatever it can resolve on its own.
|
|
17
|
+
*/
|
|
18
|
+
export interface ProductNameMatch {
|
|
19
|
+
productId: string;
|
|
20
|
+
productTitle: string;
|
|
21
|
+
}
|
|
22
|
+
/** Ranked, best first. Empty means "no product answers to this name". */
|
|
23
|
+
export type ProductNameLookup = (query: string, limit: number) => Promise<readonly ProductNameMatch[]>;
|
|
24
|
+
/**
|
|
25
|
+
* Build a lookup for one turn's options blob, or `undefined` when this
|
|
26
|
+
* platform is not the one configured — the same "these options aren't mine"
|
|
27
|
+
* signal a tool-package factory gives by returning null.
|
|
28
|
+
*/
|
|
29
|
+
export type ProductNameLookupFactory = (options: unknown) => ProductNameLookup | undefined;
|
|
30
|
+
export declare function registerProductNameLookup(factory: ProductNameLookupFactory): void;
|
|
31
|
+
/** First registered factory that claims these options. */
|
|
32
|
+
export declare function resolveProductNameLookup(options: unknown): ProductNameLookup | undefined;
|
|
33
|
+
/** Test seam — drops every registration. */
|
|
34
|
+
export declare function clearProductNameLookups(): void;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import type { Product } from './commerce-schemas';
|
|
2
|
+
import { type ProjectionDirective } from '../../spacestation/src/index';
|
|
3
|
+
/** Projection scope for a product's variant ladder. The agent emits a
|
|
4
|
+
* `projection.set` against this scope; the SDK pass maps a
|
|
5
|
+
* `resolved(..., 'product')` prop to it via `entityProjections`. */
|
|
6
|
+
export declare const PRODUCT_VARIANTS_SCOPE = "product.variants";
|
|
7
|
+
/**
|
|
8
|
+
* Project a single product against the `product.variants` directive.
|
|
9
|
+
* Trims `variants`, rebuilds `options`, and reports which axes it narrowed
|
|
10
|
+
* (`trimmedAxes`) so the renderer can show the isolated axis as a label
|
|
11
|
+
* and leave natively single-value axes hidden. Returns the original object
|
|
12
|
+
* reference unchanged when nothing was hidden.
|
|
13
|
+
*/
|
|
14
|
+
export declare function projectProduct(product: Product, directive: ProjectionDirective, facts: Record<string, unknown>): {
|
|
15
|
+
projected: Product;
|
|
16
|
+
hiddenCount: number;
|
|
17
|
+
trimmedAxes: string[];
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* Per-resolverKey projection binding. The SDK projection pass walks
|
|
21
|
+
* `getResolvedPaths()`, reads `meta.resolverKey`, and looks the key up here
|
|
22
|
+
* — no hardcoded resolverKey strings in the pass (§IV.1). A resolverKey
|
|
23
|
+
* absent from this map (or a scope absent from its `scopes`) is not
|
|
24
|
+
* projectable: `colorVariants` is intentionally omitted — the colour
|
|
25
|
+
* navigator is navigational; the agent must not be able to empty it.
|
|
26
|
+
*/
|
|
27
|
+
export interface EntityProjectionSpec {
|
|
28
|
+
/** Scopes this entity exposes for projection. */
|
|
29
|
+
scopes: readonly string[];
|
|
30
|
+
/** Apply per-scope directives to a hydrated entity. Parses at the
|
|
31
|
+
* boundary — the SDK pass holds entities as `unknown`. */
|
|
32
|
+
project: (entity: unknown, directives: Record<string, ProjectionDirective>, facts: Record<string, unknown>) => {
|
|
33
|
+
projected: unknown;
|
|
34
|
+
hiddenCount: number;
|
|
35
|
+
trimmedAxes: string[];
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export declare const entityProjections: Record<string, EntityProjectionSpec>;
|
|
@@ -0,0 +1,425 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Review DATA — the entity a review surface hydrates, and the single source of
|
|
4
|
+
* truth for its shape.
|
|
5
|
+
*
|
|
6
|
+
* Distinct from `ReviewSchema` in `commerce-schemas.ts` (one review row, keyed
|
|
7
|
+
* by its own id) and from `ProductSchema.reviews` (the inline aggregate summary
|
|
8
|
+
* embedded on a hydrated product). This is the whole payload ONE review surface
|
|
9
|
+
* needs for ONE product: the full list, the true aggregate, the star histogram,
|
|
10
|
+
* and — when the visitor asked something — the reviews that ANSWER it with the
|
|
11
|
+
* passage that matched.
|
|
12
|
+
*
|
|
13
|
+
* It exists as an ENTITY (rather than as a bag of props) so a review surface can
|
|
14
|
+
* declare `resolved(ProductReviewDataSchema, PRODUCT_REVIEWS_RESOLVER_KEY, …)`
|
|
15
|
+
* and get it through the same hydration seam every other entity uses. Two
|
|
16
|
+
* consequences fall out of that, and both are the point:
|
|
17
|
+
*
|
|
18
|
+
* - a turn that already ran the reviews tool PRIMES this entity, so the
|
|
19
|
+
* surface renders with no network call of its own;
|
|
20
|
+
* - the model can never write review text, because the only prop it fills is
|
|
21
|
+
* the product reference.
|
|
22
|
+
*/
|
|
23
|
+
/** The resolver key a review surface declares and a hydrator/prime answers to. */
|
|
24
|
+
export declare const PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
|
|
25
|
+
/** One review, as a review store serves it to a surface. */
|
|
26
|
+
export declare const ProductReviewItemSchema: z.ZodObject<{
|
|
27
|
+
author: z.ZodString;
|
|
28
|
+
rating: z.ZodNumber;
|
|
29
|
+
content: z.ZodString;
|
|
30
|
+
date: z.ZodString;
|
|
31
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
32
|
+
/**
|
|
33
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
34
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
35
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
36
|
+
*/
|
|
37
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
date: string;
|
|
40
|
+
content: string;
|
|
41
|
+
rating: number;
|
|
42
|
+
author: string;
|
|
43
|
+
verified?: boolean | undefined;
|
|
44
|
+
writtenFor?: string | undefined;
|
|
45
|
+
}, {
|
|
46
|
+
date: string;
|
|
47
|
+
content: string;
|
|
48
|
+
rating: number;
|
|
49
|
+
author: string;
|
|
50
|
+
verified?: boolean | undefined;
|
|
51
|
+
writtenFor?: string | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
export type ProductReviewItem = z.infer<typeof ProductReviewItemSchema>;
|
|
54
|
+
/** A review plus the passage a retrieval matched inside it. */
|
|
55
|
+
export declare const ProductReviewHighlightSchema: z.ZodObject<{
|
|
56
|
+
author: z.ZodString;
|
|
57
|
+
rating: z.ZodNumber;
|
|
58
|
+
content: z.ZodString;
|
|
59
|
+
date: z.ZodString;
|
|
60
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
61
|
+
/**
|
|
62
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
63
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
64
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
65
|
+
*/
|
|
66
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
67
|
+
} & {
|
|
68
|
+
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
69
|
+
* scored, NOT necessarily text that occurs in `content`. */
|
|
70
|
+
highlight: z.ZodOptional<z.ZodString>;
|
|
71
|
+
/**
|
|
72
|
+
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
73
|
+
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
74
|
+
*
|
|
75
|
+
* It exists because `highlight` is not markable. A retrieval passage is built
|
|
76
|
+
* from `"<title>. <body>"` with sentences trimmed and re-joined by single
|
|
77
|
+
* spaces, so it may open with text that is nowhere in the body and its
|
|
78
|
+
* interior whitespace may differ from the original. Every surface that tried
|
|
79
|
+
* to find it with `indexOf` therefore failed — silently, degrading to plain
|
|
80
|
+
* text, which looks exactly like a review that matched nothing.
|
|
81
|
+
*
|
|
82
|
+
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
83
|
+
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
84
|
+
*/
|
|
85
|
+
mark: z.ZodOptional<z.ZodString>;
|
|
86
|
+
}, "strip", z.ZodTypeAny, {
|
|
87
|
+
date: string;
|
|
88
|
+
content: string;
|
|
89
|
+
rating: number;
|
|
90
|
+
author: string;
|
|
91
|
+
verified?: boolean | undefined;
|
|
92
|
+
writtenFor?: string | undefined;
|
|
93
|
+
highlight?: string | undefined;
|
|
94
|
+
mark?: string | undefined;
|
|
95
|
+
}, {
|
|
96
|
+
date: string;
|
|
97
|
+
content: string;
|
|
98
|
+
rating: number;
|
|
99
|
+
author: string;
|
|
100
|
+
verified?: boolean | undefined;
|
|
101
|
+
writtenFor?: string | undefined;
|
|
102
|
+
highlight?: string | undefined;
|
|
103
|
+
mark?: string | undefined;
|
|
104
|
+
}>;
|
|
105
|
+
export type ProductReviewHighlight = z.infer<typeof ProductReviewHighlightSchema>;
|
|
106
|
+
/** Average + total, always over a product's FULL review set. */
|
|
107
|
+
export declare const ReviewAggregateSchema: z.ZodObject<{
|
|
108
|
+
value: z.ZodNumber;
|
|
109
|
+
count: z.ZodNumber;
|
|
110
|
+
}, "strip", z.ZodTypeAny, {
|
|
111
|
+
value: number;
|
|
112
|
+
count: number;
|
|
113
|
+
}, {
|
|
114
|
+
value: number;
|
|
115
|
+
count: number;
|
|
116
|
+
}>;
|
|
117
|
+
export type ReviewAggregate = z.infer<typeof ReviewAggregateSchema>;
|
|
118
|
+
/**
|
|
119
|
+
* Everything one review surface needs for one product.
|
|
120
|
+
*
|
|
121
|
+
* `id` is the PRODUCT reference these reviews belong to — this entity's identity
|
|
122
|
+
* is "the reviews of that product", which is also the ref the hydration boundary
|
|
123
|
+
* indexes it under (`entityLookupKeys`). Without it a resolved ref could never
|
|
124
|
+
* find its entity.
|
|
125
|
+
*/
|
|
126
|
+
export declare const ProductReviewDataSchema: z.ZodObject<{
|
|
127
|
+
id: z.ZodString;
|
|
128
|
+
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
129
|
+
reviews: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
130
|
+
author: z.ZodString;
|
|
131
|
+
rating: z.ZodNumber;
|
|
132
|
+
content: z.ZodString;
|
|
133
|
+
date: z.ZodString;
|
|
134
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
/**
|
|
136
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
137
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
138
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
139
|
+
*/
|
|
140
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
141
|
+
}, "strip", z.ZodTypeAny, {
|
|
142
|
+
date: string;
|
|
143
|
+
content: string;
|
|
144
|
+
rating: number;
|
|
145
|
+
author: string;
|
|
146
|
+
verified?: boolean | undefined;
|
|
147
|
+
writtenFor?: string | undefined;
|
|
148
|
+
}, {
|
|
149
|
+
date: string;
|
|
150
|
+
content: string;
|
|
151
|
+
rating: number;
|
|
152
|
+
author: string;
|
|
153
|
+
verified?: boolean | undefined;
|
|
154
|
+
writtenFor?: string | undefined;
|
|
155
|
+
}>, "many">>;
|
|
156
|
+
aggregate: z.ZodDefault<z.ZodObject<{
|
|
157
|
+
value: z.ZodNumber;
|
|
158
|
+
count: z.ZodNumber;
|
|
159
|
+
}, "strip", z.ZodTypeAny, {
|
|
160
|
+
value: number;
|
|
161
|
+
count: number;
|
|
162
|
+
}, {
|
|
163
|
+
value: number;
|
|
164
|
+
count: number;
|
|
165
|
+
}>>;
|
|
166
|
+
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
167
|
+
distribution: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
168
|
+
/**
|
|
169
|
+
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
170
|
+
* intent was asked for — never a silent copy of `reviews`.
|
|
171
|
+
*/
|
|
172
|
+
highlights: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
173
|
+
author: z.ZodString;
|
|
174
|
+
rating: z.ZodNumber;
|
|
175
|
+
content: z.ZodString;
|
|
176
|
+
date: z.ZodString;
|
|
177
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
178
|
+
/**
|
|
179
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
180
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
181
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
182
|
+
*/
|
|
183
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
184
|
+
} & {
|
|
185
|
+
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
186
|
+
* scored, NOT necessarily text that occurs in `content`. */
|
|
187
|
+
highlight: z.ZodOptional<z.ZodString>;
|
|
188
|
+
/**
|
|
189
|
+
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
190
|
+
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
191
|
+
*
|
|
192
|
+
* It exists because `highlight` is not markable. A retrieval passage is built
|
|
193
|
+
* from `"<title>. <body>"` with sentences trimmed and re-joined by single
|
|
194
|
+
* spaces, so it may open with text that is nowhere in the body and its
|
|
195
|
+
* interior whitespace may differ from the original. Every surface that tried
|
|
196
|
+
* to find it with `indexOf` therefore failed — silently, degrading to plain
|
|
197
|
+
* text, which looks exactly like a review that matched nothing.
|
|
198
|
+
*
|
|
199
|
+
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
200
|
+
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
201
|
+
*/
|
|
202
|
+
mark: z.ZodOptional<z.ZodString>;
|
|
203
|
+
}, "strip", z.ZodTypeAny, {
|
|
204
|
+
date: string;
|
|
205
|
+
content: string;
|
|
206
|
+
rating: number;
|
|
207
|
+
author: string;
|
|
208
|
+
verified?: boolean | undefined;
|
|
209
|
+
writtenFor?: string | undefined;
|
|
210
|
+
highlight?: string | undefined;
|
|
211
|
+
mark?: string | undefined;
|
|
212
|
+
}, {
|
|
213
|
+
date: string;
|
|
214
|
+
content: string;
|
|
215
|
+
rating: number;
|
|
216
|
+
author: string;
|
|
217
|
+
verified?: boolean | undefined;
|
|
218
|
+
writtenFor?: string | undefined;
|
|
219
|
+
highlight?: string | undefined;
|
|
220
|
+
mark?: string | undefined;
|
|
221
|
+
}>, "many">>;
|
|
222
|
+
}, "strip", z.ZodTypeAny, {
|
|
223
|
+
id: string;
|
|
224
|
+
reviews: {
|
|
225
|
+
date: string;
|
|
226
|
+
content: string;
|
|
227
|
+
rating: number;
|
|
228
|
+
author: string;
|
|
229
|
+
verified?: boolean | undefined;
|
|
230
|
+
writtenFor?: string | undefined;
|
|
231
|
+
}[];
|
|
232
|
+
aggregate: {
|
|
233
|
+
value: number;
|
|
234
|
+
count: number;
|
|
235
|
+
};
|
|
236
|
+
distribution: number[];
|
|
237
|
+
highlights: {
|
|
238
|
+
date: string;
|
|
239
|
+
content: string;
|
|
240
|
+
rating: number;
|
|
241
|
+
author: string;
|
|
242
|
+
verified?: boolean | undefined;
|
|
243
|
+
writtenFor?: string | undefined;
|
|
244
|
+
highlight?: string | undefined;
|
|
245
|
+
mark?: string | undefined;
|
|
246
|
+
}[];
|
|
247
|
+
}, {
|
|
248
|
+
id: string;
|
|
249
|
+
reviews?: {
|
|
250
|
+
date: string;
|
|
251
|
+
content: string;
|
|
252
|
+
rating: number;
|
|
253
|
+
author: string;
|
|
254
|
+
verified?: boolean | undefined;
|
|
255
|
+
writtenFor?: string | undefined;
|
|
256
|
+
}[] | undefined;
|
|
257
|
+
aggregate?: {
|
|
258
|
+
value: number;
|
|
259
|
+
count: number;
|
|
260
|
+
} | undefined;
|
|
261
|
+
distribution?: number[] | undefined;
|
|
262
|
+
highlights?: {
|
|
263
|
+
date: string;
|
|
264
|
+
content: string;
|
|
265
|
+
rating: number;
|
|
266
|
+
author: string;
|
|
267
|
+
verified?: boolean | undefined;
|
|
268
|
+
writtenFor?: string | undefined;
|
|
269
|
+
highlight?: string | undefined;
|
|
270
|
+
mark?: string | undefined;
|
|
271
|
+
}[] | undefined;
|
|
272
|
+
}>;
|
|
273
|
+
export type ProductReviewData = z.infer<typeof ProductReviewDataSchema>;
|
|
274
|
+
/**
|
|
275
|
+
* The same payload WITHOUT the product reference — what a per-product review
|
|
276
|
+
* service answers with, since the ref is the key it was asked under rather than
|
|
277
|
+
* a field it repeats. Derived from the entity schema so the two can never
|
|
278
|
+
* drift; a caller pairs it back with its ref to make the entity.
|
|
279
|
+
*/
|
|
280
|
+
export declare const ProductReviewPayloadSchema: z.ZodObject<Omit<{
|
|
281
|
+
id: z.ZodString;
|
|
282
|
+
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
283
|
+
reviews: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
284
|
+
author: z.ZodString;
|
|
285
|
+
rating: z.ZodNumber;
|
|
286
|
+
content: z.ZodString;
|
|
287
|
+
date: z.ZodString;
|
|
288
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
289
|
+
/**
|
|
290
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
291
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
292
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
293
|
+
*/
|
|
294
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
295
|
+
}, "strip", z.ZodTypeAny, {
|
|
296
|
+
date: string;
|
|
297
|
+
content: string;
|
|
298
|
+
rating: number;
|
|
299
|
+
author: string;
|
|
300
|
+
verified?: boolean | undefined;
|
|
301
|
+
writtenFor?: string | undefined;
|
|
302
|
+
}, {
|
|
303
|
+
date: string;
|
|
304
|
+
content: string;
|
|
305
|
+
rating: number;
|
|
306
|
+
author: string;
|
|
307
|
+
verified?: boolean | undefined;
|
|
308
|
+
writtenFor?: string | undefined;
|
|
309
|
+
}>, "many">>;
|
|
310
|
+
aggregate: z.ZodDefault<z.ZodObject<{
|
|
311
|
+
value: z.ZodNumber;
|
|
312
|
+
count: z.ZodNumber;
|
|
313
|
+
}, "strip", z.ZodTypeAny, {
|
|
314
|
+
value: number;
|
|
315
|
+
count: number;
|
|
316
|
+
}, {
|
|
317
|
+
value: number;
|
|
318
|
+
count: number;
|
|
319
|
+
}>>;
|
|
320
|
+
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
321
|
+
distribution: z.ZodDefault<z.ZodArray<z.ZodNumber, "many">>;
|
|
322
|
+
/**
|
|
323
|
+
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
324
|
+
* intent was asked for — never a silent copy of `reviews`.
|
|
325
|
+
*/
|
|
326
|
+
highlights: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
327
|
+
author: z.ZodString;
|
|
328
|
+
rating: z.ZodNumber;
|
|
329
|
+
content: z.ZodString;
|
|
330
|
+
date: z.ZodString;
|
|
331
|
+
verified: z.ZodOptional<z.ZodBoolean>;
|
|
332
|
+
/**
|
|
333
|
+
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
334
|
+
* than this one (brands pool reviews across a product line). A surface can
|
|
335
|
+
* attribute it; empty / absent ⇒ the product's own review.
|
|
336
|
+
*/
|
|
337
|
+
writtenFor: z.ZodOptional<z.ZodString>;
|
|
338
|
+
} & {
|
|
339
|
+
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
340
|
+
* scored, NOT necessarily text that occurs in `content`. */
|
|
341
|
+
highlight: z.ZodOptional<z.ZodString>;
|
|
342
|
+
/**
|
|
343
|
+
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
344
|
+
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
345
|
+
*
|
|
346
|
+
* It exists because `highlight` is not markable. A retrieval passage is built
|
|
347
|
+
* from `"<title>. <body>"` with sentences trimmed and re-joined by single
|
|
348
|
+
* spaces, so it may open with text that is nowhere in the body and its
|
|
349
|
+
* interior whitespace may differ from the original. Every surface that tried
|
|
350
|
+
* to find it with `indexOf` therefore failed — silently, degrading to plain
|
|
351
|
+
* text, which looks exactly like a review that matched nothing.
|
|
352
|
+
*
|
|
353
|
+
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
354
|
+
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
355
|
+
*/
|
|
356
|
+
mark: z.ZodOptional<z.ZodString>;
|
|
357
|
+
}, "strip", z.ZodTypeAny, {
|
|
358
|
+
date: string;
|
|
359
|
+
content: string;
|
|
360
|
+
rating: number;
|
|
361
|
+
author: string;
|
|
362
|
+
verified?: boolean | undefined;
|
|
363
|
+
writtenFor?: string | undefined;
|
|
364
|
+
highlight?: string | undefined;
|
|
365
|
+
mark?: string | undefined;
|
|
366
|
+
}, {
|
|
367
|
+
date: string;
|
|
368
|
+
content: string;
|
|
369
|
+
rating: number;
|
|
370
|
+
author: string;
|
|
371
|
+
verified?: boolean | undefined;
|
|
372
|
+
writtenFor?: string | undefined;
|
|
373
|
+
highlight?: string | undefined;
|
|
374
|
+
mark?: string | undefined;
|
|
375
|
+
}>, "many">>;
|
|
376
|
+
}, "id">, "strip", z.ZodTypeAny, {
|
|
377
|
+
reviews: {
|
|
378
|
+
date: string;
|
|
379
|
+
content: string;
|
|
380
|
+
rating: number;
|
|
381
|
+
author: string;
|
|
382
|
+
verified?: boolean | undefined;
|
|
383
|
+
writtenFor?: string | undefined;
|
|
384
|
+
}[];
|
|
385
|
+
aggregate: {
|
|
386
|
+
value: number;
|
|
387
|
+
count: number;
|
|
388
|
+
};
|
|
389
|
+
distribution: number[];
|
|
390
|
+
highlights: {
|
|
391
|
+
date: string;
|
|
392
|
+
content: string;
|
|
393
|
+
rating: number;
|
|
394
|
+
author: string;
|
|
395
|
+
verified?: boolean | undefined;
|
|
396
|
+
writtenFor?: string | undefined;
|
|
397
|
+
highlight?: string | undefined;
|
|
398
|
+
mark?: string | undefined;
|
|
399
|
+
}[];
|
|
400
|
+
}, {
|
|
401
|
+
reviews?: {
|
|
402
|
+
date: string;
|
|
403
|
+
content: string;
|
|
404
|
+
rating: number;
|
|
405
|
+
author: string;
|
|
406
|
+
verified?: boolean | undefined;
|
|
407
|
+
writtenFor?: string | undefined;
|
|
408
|
+
}[] | undefined;
|
|
409
|
+
aggregate?: {
|
|
410
|
+
value: number;
|
|
411
|
+
count: number;
|
|
412
|
+
} | undefined;
|
|
413
|
+
distribution?: number[] | undefined;
|
|
414
|
+
highlights?: {
|
|
415
|
+
date: string;
|
|
416
|
+
content: string;
|
|
417
|
+
rating: number;
|
|
418
|
+
author: string;
|
|
419
|
+
verified?: boolean | undefined;
|
|
420
|
+
writtenFor?: string | undefined;
|
|
421
|
+
highlight?: string | undefined;
|
|
422
|
+
mark?: string | undefined;
|
|
423
|
+
}[] | undefined;
|
|
424
|
+
}>;
|
|
425
|
+
export type ProductReviewPayload = z.infer<typeof ProductReviewPayloadSchema>;
|