@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,129 @@
|
|
|
1
|
+
import type { ForwardRefExoticComponent, RefAttributes } from 'react';
|
|
2
|
+
import type { PresenceSourceRef } from '../../../../../spacestation/src/widgets/presence/index';
|
|
3
|
+
/**
|
|
4
|
+
* Which host is drawing the card. Not a style token — the fan geometry is
|
|
5
|
+
* JS-coupled to it, so a smaller card is a SIZE VARIANT, not a CSS scale (which
|
|
6
|
+
* would not shrink the reserved box). Matches the scanning deck's own size
|
|
7
|
+
* vocabulary: the desktop presence band, the slim mobile island, and the
|
|
8
|
+
* canvas-section continuation foot.
|
|
9
|
+
*/
|
|
10
|
+
export type PresenceSourceCardSize = 'band' | 'compact' | 'foot';
|
|
11
|
+
/**
|
|
12
|
+
* The box one card occupies, in px. UNIFORM across kinds at a given size — see
|
|
13
|
+
* `PresenceSourceFormDef` for why a form does not get to choose it.
|
|
14
|
+
*/
|
|
15
|
+
export interface PresenceSourceCardFootprint {
|
|
16
|
+
width: number;
|
|
17
|
+
height: number;
|
|
18
|
+
}
|
|
19
|
+
export interface PresenceSourceCardProps {
|
|
20
|
+
/**
|
|
21
|
+
* The entity this card stands for. ABSENT for a `found: false` element, which
|
|
22
|
+
* has no refs by definition, and for a `pending` one, which has not returned
|
|
23
|
+
* yet — the card then draws its kind's marks with no content.
|
|
24
|
+
* A form must never require `imageUrl`: text-bearing kinds (review, policy,
|
|
25
|
+
* article) carry none and are not thereby less real.
|
|
26
|
+
*/
|
|
27
|
+
source?: PresenceSourceRef;
|
|
28
|
+
/**
|
|
29
|
+
* Every record this card stands in for — present only on a card the deck did
|
|
30
|
+
* NOT spread, which is exactly the card that represents a whole lookup.
|
|
31
|
+
*
|
|
32
|
+
* A collapsed card has always claimed to stand for a set and had no way to
|
|
33
|
+
* say anything about it. A form that draws text needs the set: the discovery
|
|
34
|
+
* inside a body of prose is what was found in it, and one record cannot show
|
|
35
|
+
* that. Absent on a spread card, where `source` IS the record.
|
|
36
|
+
*/
|
|
37
|
+
records?: readonly PresenceSourceRef[];
|
|
38
|
+
/** The kind that resolved this form. Present so one registered form can serve
|
|
39
|
+
* several kinds and branch on the exact one it was resolved for. */
|
|
40
|
+
sourceKind: string;
|
|
41
|
+
/** The host's size variant. */
|
|
42
|
+
size: PresenceSourceCardSize;
|
|
43
|
+
/**
|
|
44
|
+
* Element-level: did the lookup find anything? `false` is the honest miss and
|
|
45
|
+
* renders the hollow slot. Never inferred from a missing `source` by the card
|
|
46
|
+
* — the tool is the only honest source for this (an unrenderable record is not
|
|
47
|
+
* an empty result). Meaningless while `pending`.
|
|
48
|
+
*/
|
|
49
|
+
found: boolean;
|
|
50
|
+
/**
|
|
51
|
+
* The lookup is STILL RUNNING. A third state, distinct from both of the
|
|
52
|
+
* above: "looking right now" must not be drawn as "looked and found nothing".
|
|
53
|
+
* Cards render it as a quieter ink weight of the same silhouette — never as
|
|
54
|
+
* motion, because motion on this surface means a decision was made.
|
|
55
|
+
*/
|
|
56
|
+
pending: boolean;
|
|
57
|
+
/**
|
|
58
|
+
* The canvas PLACED this entity — this candidate became part of the answer.
|
|
59
|
+
*
|
|
60
|
+
* The one thing on this surface that is a decision, so it is the one thing
|
|
61
|
+
* that moves: a chosen card comes forward at full ink while the undecided
|
|
62
|
+
* ones stay held back. It says only "this one made it" — the client does not
|
|
63
|
+
* know WHY any candidate was taken or dropped, and a form must never draw a
|
|
64
|
+
* reason it does not have.
|
|
65
|
+
*/
|
|
66
|
+
chosen: boolean;
|
|
67
|
+
}
|
|
68
|
+
export interface PresenceSourceFormDef {
|
|
69
|
+
/**
|
|
70
|
+
* Draws one card. That is the WHOLE contract — a form owns the MARKS printed
|
|
71
|
+
* on the card and nothing about its dimensions.
|
|
72
|
+
*
|
|
73
|
+
* There was a `footprint(size)` here, and letting each kind state its own box
|
|
74
|
+
* was a mistake with a visible symptom: the sift sits in a thin band, the band
|
|
75
|
+
* sizes to the tallest kind present, so one article lookup inflated the whole
|
|
76
|
+
* notch. Kind is signalled by the INTERIOR (an image, ruled lines, a cut
|
|
77
|
+
* corner, stepped sheets, a row of pips) — never by dimensions, which are the
|
|
78
|
+
* one part of a silhouette that costs every other element on the row.
|
|
79
|
+
*
|
|
80
|
+
* The host therefore owns one box per size (`SOURCE_CARD_BOX` in
|
|
81
|
+
* `@fourty/ui`), which also means it can reserve the row before any card
|
|
82
|
+
* paints without asking a registry.
|
|
83
|
+
*
|
|
84
|
+
* MUST forward its ref to the card's root element. The sift deck draws cards
|
|
85
|
+
* inside `AnimatePresence mode="popLayout"`, which clones each child with a
|
|
86
|
+
* ref so it can measure the card and lift it out of flow while it fades. A
|
|
87
|
+
* plain function component silently drops that ref, the measurement never
|
|
88
|
+
* happens, and the exiting card holds its slot for the whole exit — so the
|
|
89
|
+
* deck shoves sideways when it finally unmounts. See
|
|
90
|
+
* `packages/ui/.../card-frame.tsx`.
|
|
91
|
+
*/
|
|
92
|
+
Component: ForwardRefExoticComponent<PresenceSourceCardProps & RefAttributes<HTMLDivElement>>;
|
|
93
|
+
/**
|
|
94
|
+
* Whether ONE record of this kind is a candidate a visitor can tell apart
|
|
95
|
+
* from the record beside it — which decides whether the deck spreads a
|
|
96
|
+
* lookup's records across itself, or draws ONE card standing for the set.
|
|
97
|
+
*
|
|
98
|
+
* The distinction is not cosmetic. A discovery surface that spreads eight
|
|
99
|
+
* indistinguishable cards is not showing eight candidates, it is printing one
|
|
100
|
+
* fact eight times; a surface that collapses eight distinguishable ones to a
|
|
101
|
+
* single card is not showing a discovery at all. Only the form knows which it
|
|
102
|
+
* is, because only the form knows what it draws: a product form has a
|
|
103
|
+
* photograph, a review form has a score, a policy form has neither and its
|
|
104
|
+
* pages are genuinely interchangeable.
|
|
105
|
+
*
|
|
106
|
+
* Absent means the baseline rule: a record with imagery spreads, a record
|
|
107
|
+
* without it does not. A form that differentiates on something else says so
|
|
108
|
+
* here and reads that facet out of `ref.meta`.
|
|
109
|
+
*/
|
|
110
|
+
spreads?: (ref: PresenceSourceRef) => boolean;
|
|
111
|
+
/**
|
|
112
|
+
* How many deck SLOTS one card of this kind occupies. Absent = one.
|
|
113
|
+
*
|
|
114
|
+
* Width only — the host still owns the height, uniform across every kind,
|
|
115
|
+
* which is the part of the one-box rule that pays for itself: the band sizes
|
|
116
|
+
* to the tallest card on the row. A kind that draws PROSE needs reading
|
|
117
|
+
* width or it draws texture; taking three of the slots the deck already
|
|
118
|
+
* reserved costs the row nothing vertically and nothing in latency.
|
|
119
|
+
*/
|
|
120
|
+
slots?: number;
|
|
121
|
+
}
|
|
122
|
+
/** Register a card form for a source kind. Last registration wins (a brand may
|
|
123
|
+
* override a baseline kind). Call at startup / module load. */
|
|
124
|
+
export declare function registerPresenceSourceForm(sourceKind: string, def: PresenceSourceFormDef): void;
|
|
125
|
+
/** The card form for a source kind, or undefined when none is registered — the
|
|
126
|
+
* host decides whether an unknown kind falls back or is simply not shown. */
|
|
127
|
+
export declare function resolvePresenceSourceForm(sourceKind: string): PresenceSourceFormDef | undefined;
|
|
128
|
+
/** Every registered source kind — for a debug/inspector surface. */
|
|
129
|
+
export declare function registeredPresenceSourceForms(): string[];
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface StandingSignal {
|
|
2
|
+
/** The signal TYPE — the routing key. A widget consumes the type it owns
|
|
3
|
+
* (`agent_ask`, `stevemadden.wardrobe.keep-offer`, …). */
|
|
4
|
+
type: string;
|
|
5
|
+
/** Stable id — dedupe + animation key. A resolved id never re-raises. */
|
|
6
|
+
id: string;
|
|
7
|
+
/** The raw signal payload, opaque here; the consuming widget reads it. */
|
|
8
|
+
payload: Record<string, unknown>;
|
|
9
|
+
}
|
|
10
|
+
/** Raise a standing signal. No-op when its id was already resolved this session,
|
|
11
|
+
* or another signal is already standing (one at a time — never interrupt). */
|
|
12
|
+
export declare function raiseStanding(type: string, id: string, payload: Record<string, unknown>, signalScope?: string): void;
|
|
13
|
+
/** Resolve (confirm OR dismiss) the standing signal: clear it + remember the id
|
|
14
|
+
* so it never re-raises. Effect/trace of the resolution is the caller's job. */
|
|
15
|
+
export declare function resolveStanding(id: string, signalScope?: string): void;
|
|
16
|
+
/** React hook — the standing signal of a given TYPE, or null. A widget reads the
|
|
17
|
+
* one type it owns; an unrelated standing signal returns null for it. The
|
|
18
|
+
* returned object is referentially stable until the signal changes. */
|
|
19
|
+
export declare function useStandingOfType(type: string): StandingSignal | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** Set a flow's latest artifact (called by the built-in `flow.output` handler).
|
|
2
|
+
* Replaces the top-level map so unrelated flow slots keep their reference —
|
|
3
|
+
* `useAgentFlow(id)` only re-renders when ITS flow updated. */
|
|
4
|
+
export declare function setFlowOutput(flowId: string, data: unknown): void;
|
|
5
|
+
/** Non-hook read of a flow's current output — for consumers outside React
|
|
6
|
+
* (the ephemeral-facts mirror in `core/ephemeral-facts-mirror.ts`). Same
|
|
7
|
+
* data `useAgentFlow` binds to; this is the plain-function sibling. */
|
|
8
|
+
export declare function getFlowOutput(flowId: string): unknown;
|
|
9
|
+
/** Non-hook subscribe to ANY flow-store change — for consumers outside
|
|
10
|
+
* React. Fires on every `setFlowOutput` call regardless of which flow id
|
|
11
|
+
* changed, mirroring the hooks' own subscription; a caller that cares
|
|
12
|
+
* about one specific flow re-reads it via `getFlowOutput` inside the
|
|
13
|
+
* listener. */
|
|
14
|
+
export declare function subscribeFlowOutputs(listener: () => void): () => void;
|
|
15
|
+
/** Bind to a flow by id — the latest artifact it emitted, or null. Opaque: the
|
|
16
|
+
* widget parses the shape it expects (the producing flow's artifact). */
|
|
17
|
+
export declare function useAgentFlow(flowId: string): unknown;
|
|
18
|
+
/** Whether a flow's current artifact was set LIVE this page-load (true) or merely
|
|
19
|
+
* restored from storage on init (false). A consumer that must not treat stale
|
|
20
|
+
* restored context as the agent's current output — the presence read — gates on
|
|
21
|
+
* this. Generic: works for any flow id. */
|
|
22
|
+
export declare function useAgentFlowFresh(flowId: string): boolean;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { useAgentPresence, type AgentPresenceKind, type AgentPresenceState } from './use-presence';
|
|
2
|
+
export { useScanning, usePresenceElements, usePresenceMaterialized, usePresenceLiveTurn, usePresenceRuntime, useOptionalPresenceRuntime, PresenceRuntimeProvider, type ScanningState, type ScanThumb, type PresenceRuntime, } from './runtime-context';
|
|
3
|
+
export { useAgentPresenceFrame, useAgentPresenceFresh, clearAgentPresence, setAgentPresenceFrame, } from './core-presence/knowledge';
|
|
4
|
+
export { useConsumeStandingSignal, type ConsumedStanding } from './use-standing-signal';
|
|
5
|
+
export { raiseStanding, resolveStanding, useStandingOfType, type StandingSignal, } from './core-presence/standing-signal-store';
|
|
6
|
+
export { usePresenceNotch, type NotchWidget, type NotchWidgetProps, type NotchDrawerApi, type PresenceNotchApi, } from './use-presence-notch';
|
|
7
|
+
export { registerPresenceForm, resolvePresenceForm, registeredPresenceForms, type PresenceFormProps, type PresenceFormDef, } from './core-presence/form-registry';
|
|
8
|
+
export { registerPresenceSourceForm, resolvePresenceSourceForm, registeredPresenceSourceForms, type PresenceSourceCardProps, type PresenceSourceCardSize, type PresenceSourceCardFootprint, type PresenceSourceFormDef, } from './core-presence/source-form-registry';
|
|
9
|
+
export { registerPresenceFactForm, resolvePresenceFactForm, registeredPresenceFactForms, type PresenceFactFormProps, type PresenceFactFormDef, type PresenceFactRender, } from './core-presence/fact-form-registry';
|
|
10
|
+
export { presenceFactShape, colorHexOf, factFigureParts, FACT_SHAPE, type FactFigureParts, } from './core-presence/fact-shape';
|
|
11
|
+
export { useAgentFlow, useAgentFlowFresh, setFlowOutput, getFlowOutput, subscribeFlowOutputs, } from './flows/flow-store';
|
|
12
|
+
export { useOptimisticFlowSet, useReconcileFlowSet, type OptimisticFlowSet, } from './use-optimistic-flow-set';
|
|
13
|
+
export { useOptimisticFactOverlay, useReconcileOptimisticFacts, type OptimisticFact, type OptimisticFactOverlay, } from './use-optimistic-facts';
|
|
14
|
+
export { useLayoutEntityIds } from './use-layout-entity-ids';
|
|
15
|
+
export { type AgentPresenceFrame, type PresenceFact, SCANNING_FORM, deriveSourceElement, type SourceElementInput, type PresenceElement, type PresenceElementKind, type PresenceSourceElement, type PresenceSourceRef, type PresenceFactArtifact, type PresenceFactElement, type PresenceVoiceElement, type PresenceConcessionElement, type PresenceAskElement, type PresenceStreamArtifact, isPresenceStreamArtifact, type PresenceProfile, DEFAULT_PRESENCE_PROFILE, PRESENCE_LIFECYCLE, } from '../../../../spacestation/src/widgets/presence/index';
|
|
16
|
+
export { presenceReducer, EMPTY_PRESENCE_STREAM, type PresenceStreamState, type PresenceStreamEvent, } from './core-presence/presence-stream';
|
|
17
|
+
export { durablePresenceElements } from './core-presence/presence-restore';
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import type { PresenceElement } from '../../../../spacestation/src/widgets/presence/index';
|
|
2
|
+
/** One thumbnail in a live scan deck. */
|
|
3
|
+
export interface ScanThumb {
|
|
4
|
+
id: string;
|
|
5
|
+
url: string;
|
|
6
|
+
}
|
|
7
|
+
/** The live scan state, or `null` when nothing is being searched. */
|
|
8
|
+
export interface ScanningState {
|
|
9
|
+
thumbnails: ScanThumb[];
|
|
10
|
+
count: number;
|
|
11
|
+
queryHint?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* PresenceRuntime — the runtime-hook surface presence widgets consume for
|
|
15
|
+
* signals derived live from the raw event stream (as opposed to the
|
|
16
|
+
* flow-store-backed hooks in this same folder, which have no engine
|
|
17
|
+
* coupling at all and need no seam).
|
|
18
|
+
*
|
|
19
|
+
* `useScanning` derives from `tool_call` events on the SDK's live session
|
|
20
|
+
* subscription — the catalog cannot import the SDK runtime, so the SDK's
|
|
21
|
+
* `FourtyProvider` provides this object through the context below, and the
|
|
22
|
+
* thin `useScanning` hook reads it. Same dependency-inversion pattern as
|
|
23
|
+
* `FourtyRuntime` (see `canvas/runtime-context.tsx`) and `FourtyCommerceRuntime`
|
|
24
|
+
* (see `commerce/commerce-context.tsx`).
|
|
25
|
+
*/
|
|
26
|
+
export interface PresenceRuntime {
|
|
27
|
+
useScanning: () => ScanningState | null;
|
|
28
|
+
/**
|
|
29
|
+
* The live presence ELEMENT STREAM for the current turn — sources being read,
|
|
30
|
+
* facts crystallizing, the agent's voice, an ask. Cumulative and additive:
|
|
31
|
+
* unlike `useScanning` (one state at a time), these COEXIST, which is the
|
|
32
|
+
* whole point — "this constraint applied to that thing" was unrepresentable
|
|
33
|
+
* while presence was a single frame with a precedence ladder.
|
|
34
|
+
*
|
|
35
|
+
* Retirement is causal (see `PRESENCE_LIFECYCLE`), so a consumer renders
|
|
36
|
+
* exactly what it is handed and schedules nothing.
|
|
37
|
+
*/
|
|
38
|
+
usePresenceElements: () => PresenceElement[];
|
|
39
|
+
/**
|
|
40
|
+
* Entity ids the canvas has placed during the live turn — the only HONEST
|
|
41
|
+
* signal the client has about which candidates the agent actually chose.
|
|
42
|
+
*
|
|
43
|
+
* It is deliberately a separate read from `usePresenceElements`. A source
|
|
44
|
+
* element says what was READ; this says what became the ANSWER, and the sift
|
|
45
|
+
* needs both at once to draw the narrowing (many candidates, the chosen ones
|
|
46
|
+
* marked, the rest falling away when the canvas is done). Folding it into the
|
|
47
|
+
* elements would mean mutating them on every patch, which is exactly the
|
|
48
|
+
* removal-on-materialize behaviour that emptied the sift of its survivors.
|
|
49
|
+
*/
|
|
50
|
+
usePresenceMaterialized: () => ReadonlySet<string>;
|
|
51
|
+
/**
|
|
52
|
+
* The turn the stream is currently open on — `undefined` before any turn has
|
|
53
|
+
* run this session.
|
|
54
|
+
*
|
|
55
|
+
* Facts retire on `never` (they are session dossier state), so the element set
|
|
56
|
+
* only ever grows and every fact in it looks equally current. This is the one
|
|
57
|
+
* signal that separates "the agent still holds this" from "the agent held this
|
|
58
|
+
* once": the faculty re-derives its facts from context on every read, so a
|
|
59
|
+
* fact stamped with the LIVE turn is one it just re-asserted. Without it the
|
|
60
|
+
* band ranks a stale opening-turn constraint level with the one the visitor
|
|
61
|
+
* set a second ago.
|
|
62
|
+
*/
|
|
63
|
+
usePresenceLiveTurn: () => string | undefined;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Provider for the presence-runtime surface. Mounted by the SDK's
|
|
67
|
+
* `FourtyProvider`, which passes the SDK's real hook implementation.
|
|
68
|
+
*/
|
|
69
|
+
export declare const PresenceRuntimeProvider: import("react").Provider<PresenceRuntime | null>;
|
|
70
|
+
/**
|
|
71
|
+
* Read the presence-runtime surface. Throws when no `<FourtyProvider>` is
|
|
72
|
+
* mounted upstream — presence widgets run inside a FourtyProvider in every
|
|
73
|
+
* real render path; a missing provider is a wiring bug, not a tolerated state.
|
|
74
|
+
*/
|
|
75
|
+
export declare function usePresenceRuntime(): PresenceRuntime;
|
|
76
|
+
/** Non-throwing variant — `null` when no `<FourtyProvider>` is mounted. */
|
|
77
|
+
export declare function useOptionalPresenceRuntime(): PresenceRuntime | null;
|
|
78
|
+
/**
|
|
79
|
+
* The live scan state, or null when nothing is being searched. Mounted by the
|
|
80
|
+
* presence band; self-resets each turn and fades out shortly after the turn
|
|
81
|
+
* settles so the result hands off to the held presence frame.
|
|
82
|
+
*/
|
|
83
|
+
export declare function useScanning(): ScanningState | null;
|
|
84
|
+
/**
|
|
85
|
+
* The live presence element stream. Empty when the turn has produced nothing
|
|
86
|
+
* non-redundant to show — which is a correct outcome, not a failure state: the
|
|
87
|
+
* canvas shows the answer and the compose prose explains it, so presence owns
|
|
88
|
+
* only the negative space (what was read, inferred, recalled, conceded).
|
|
89
|
+
*/
|
|
90
|
+
export declare function usePresenceElements(): PresenceElement[];
|
|
91
|
+
/**
|
|
92
|
+
* Entity ids the canvas has placed this turn. A candidate whose id is in this
|
|
93
|
+
* set was CHOSEN — it is on screen, in the answer. One that is not either has
|
|
94
|
+
* not been decided yet (the canvas is still streaming) or was not chosen.
|
|
95
|
+
*
|
|
96
|
+
* That distinction is the whole honesty budget of the sift: the client knows
|
|
97
|
+
* WHICH candidates survived and never why, so nothing downstream may attribute
|
|
98
|
+
* a rejection to a particular criterion.
|
|
99
|
+
*/
|
|
100
|
+
export declare function usePresenceMaterialized(): ReadonlySet<string>;
|
|
101
|
+
/**
|
|
102
|
+
* The live turn id — what a consumer compares an element's `turnId` against to
|
|
103
|
+
* ask "is this from the turn that is happening now?".
|
|
104
|
+
*
|
|
105
|
+
* It deliberately does NOT clear when the turn settles. The last turn stays the
|
|
106
|
+
* live one at rest, so the resting band still shows the constraints that turn
|
|
107
|
+
* put in play rather than reverting to an undifferentiated pile.
|
|
108
|
+
*/
|
|
109
|
+
export declare function usePresenceLiveTurn(): string | undefined;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The entity ids the CURRENT layout places — walked from the catalog's
|
|
3
|
+
* `resolved()` props (§IV.1), platform-agnostic (any string at a resolved path
|
|
4
|
+
* counts; the resolver decides what's resolvable). Re-derives when the layout
|
|
5
|
+
* changes.
|
|
6
|
+
*
|
|
7
|
+
* This is the client's hook for presentational forms IT owns over the placed
|
|
8
|
+
* set — e.g. a brand "saved set" of the products on screen — WITHOUT the
|
|
9
|
+
* vertical-agnostic agent runtime ever emitting or naming such a form (§VIII).
|
|
10
|
+
* The agent places ids; the client decides how to re-present them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useLayoutEntityIds(): string[];
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export interface OptimisticFact {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface OptimisticFactOverlay {
|
|
6
|
+
entries: OptimisticFact[];
|
|
7
|
+
/**
|
|
8
|
+
* Record what the visitor just told us, in its SLOT.
|
|
9
|
+
*
|
|
10
|
+
* A slot holds one value. Adding `{Size, 10}` after `{Size, 6}` REPLACES it,
|
|
11
|
+
* because nobody wears two sizes — this was an append-only log, so a visitor
|
|
12
|
+
* clicking through four sizes on a product page accumulated four live "facts"
|
|
13
|
+
* about themselves (and a double-fired handler produced the same one twice).
|
|
14
|
+
* The band capped that churn to three chips and mostly hid it; the uncapped
|
|
15
|
+
* brief showed it as a wall of contradictory sizes.
|
|
16
|
+
*/
|
|
17
|
+
add: (fact: OptimisticFact) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Write a fact into its slot: drop any entry with the same LABEL, then append.
|
|
21
|
+
*
|
|
22
|
+
* Label, not label+value: the point is that the newest pick for a slot is the
|
|
23
|
+
* visitor's current answer for that slot. Matching on both would keep every
|
|
24
|
+
* distinct value and reintroduce the pile.
|
|
25
|
+
*
|
|
26
|
+
* Exported for its test — the rule is small and load-bearing enough to assert
|
|
27
|
+
* directly rather than through a hook render.
|
|
28
|
+
*/
|
|
29
|
+
export declare function writeOptimisticFact(entries: readonly OptimisticFact[], fact: OptimisticFact): OptimisticFact[];
|
|
30
|
+
/**
|
|
31
|
+
* Read/write a client-owned overlay of {label,value} facts stored under
|
|
32
|
+
* `flowId`. Pair with {@link useReconcileOptimisticFacts} so the overlay
|
|
33
|
+
* retires once the agent's own read is current.
|
|
34
|
+
*/
|
|
35
|
+
export declare function useOptimisticFactOverlay(flowId: string): OptimisticFactOverlay;
|
|
36
|
+
/**
|
|
37
|
+
* Clear the overlay once the agent's held read changes — a genuinely NEW
|
|
38
|
+
* read (any change, not just one naming this fact) is current enough to
|
|
39
|
+
* supersede the bridging optimism. Pass a stable identity for "the read right
|
|
40
|
+
* now" (e.g. the frame's `readKey`), or `null` while there's no read yet so
|
|
41
|
+
* the overlay survives the gap instead of clearing before it's shown anything.
|
|
42
|
+
*/
|
|
43
|
+
export declare function useReconcileOptimisticFacts(flowId: string, readIdentity: string | null): void;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface OptimisticFlowSet {
|
|
2
|
+
has: (key: string) => boolean;
|
|
3
|
+
add: (key: string) => void;
|
|
4
|
+
remove: (key: string) => void;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Read/write a client-owned optimistic overlay-set stored under `flowId`.
|
|
8
|
+
* Survives remounts and is shared across render sites (it's store state, not
|
|
9
|
+
* component state). Pair with {@link useReconcileFlowSet} to retire keys once
|
|
10
|
+
* the agent's source-of-truth reflects them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function useOptimisticFlowSet(flowId: string): OptimisticFlowSet;
|
|
13
|
+
/**
|
|
14
|
+
* Reconcile a {@link useOptimisticFlowSet} against the agent's source-of-truth:
|
|
15
|
+
* drop any overlay key the source no longer lists (the agent has caught up, so
|
|
16
|
+
* the optimism is no longer needed — and keeping it would wrongly suppress a key
|
|
17
|
+
* the agent later re-introduces).
|
|
18
|
+
*
|
|
19
|
+
* Pass the source's currently-present keys, or `null` while there is no
|
|
20
|
+
* authoritative source yet (loading / a different view) so the optimism is held
|
|
21
|
+
* across the gap rather than cleared prematurely. Call ONCE, where the source is
|
|
22
|
+
* known (typically the widget root that reads the agent's frame).
|
|
23
|
+
*/
|
|
24
|
+
export declare function useReconcileFlowSet(flowId: string, presentKeys: readonly string[] | null): void;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* A widget's handle on its OWN drawer — the full surface that drops below the
|
|
4
|
+
* band. Handed to a widget only when it declared a `Drawer`; a widget mounted
|
|
5
|
+
* outside a drawer-capable host (the mobile island) receives `undefined` and
|
|
6
|
+
* must render its full content in place instead of pointing at a surface that
|
|
7
|
+
* does not exist.
|
|
8
|
+
*/
|
|
9
|
+
export interface NotchDrawerApi {
|
|
10
|
+
open: boolean;
|
|
11
|
+
/** Open it if closed, close it if open. Driven by a CLICK, never by hover —
|
|
12
|
+
* a panel that opens because a pointer crossed the band is noise, and one
|
|
13
|
+
* that closes when the pointer leaves cannot be read. */
|
|
14
|
+
toggle: () => void;
|
|
15
|
+
}
|
|
16
|
+
export interface NotchWidgetProps {
|
|
17
|
+
/** Notch-level fold state, owned by the band (hover / agent working / a
|
|
18
|
+
* standing question). Widgets render a compact rest form when `false` and
|
|
19
|
+
* their full form when `true`, so the WHOLE band folds and expands together —
|
|
20
|
+
* never one widget propping it open.
|
|
21
|
+
*
|
|
22
|
+
* It governs the band's VOICE, never its standing knowledge: a sentence about
|
|
23
|
+
* a finished search is stale the moment it lands, but what the agent knows is
|
|
24
|
+
* still true when the visitor looks up. Anything a widget draws to say "I
|
|
25
|
+
* know this about you" must render at `expanded: false`. */
|
|
26
|
+
expanded: boolean;
|
|
27
|
+
/** This widget's drawer handle — present only when it declared a `Drawer`. */
|
|
28
|
+
drawer?: NotchDrawerApi;
|
|
29
|
+
}
|
|
30
|
+
export interface NotchWidget {
|
|
31
|
+
/** Stable id (render key). */
|
|
32
|
+
id: string;
|
|
33
|
+
/** Placement: `lead` = the main zone (left, grows); `trail` = pinned right. */
|
|
34
|
+
zone: 'lead' | 'trail';
|
|
35
|
+
/** The widget itself — a component (so it owns its hooks/state). A widget
|
|
36
|
+
* consumes whatever agent SIGNALS it cares about itself (via
|
|
37
|
+
* `useConsumeStandingSignal` / `useAgentFlow` / `useAgentPresenceFrame`); the
|
|
38
|
+
* band neither knows nor routes signals. */
|
|
39
|
+
Component: React.ComponentType<NotchWidgetProps>;
|
|
40
|
+
/** Optional richer view shown in a DRAWER that drops below the band when this
|
|
41
|
+
* widget is hovered — for content that won't fit the thin band. The band owns
|
|
42
|
+
* the drawer region + open/close on hover; the widget supplies the content. */
|
|
43
|
+
Drawer?: React.ComponentType<NotchWidgetProps>;
|
|
44
|
+
}
|
|
45
|
+
export interface PresenceNotchApi {
|
|
46
|
+
/** Notch-level fold state — the whole band expands or rests as one. */
|
|
47
|
+
expanded: boolean;
|
|
48
|
+
/** A generic deciding-question (`agent_ask`) is standing — takes the lead
|
|
49
|
+
* zone over the widgets while it does. */
|
|
50
|
+
askStanding: boolean;
|
|
51
|
+
lead: NotchWidget[];
|
|
52
|
+
trail: NotchWidget[];
|
|
53
|
+
drawerWidgets: NotchWidget[];
|
|
54
|
+
/** Which drawer-capable widget's drawer is open, if any. */
|
|
55
|
+
openDrawerId: string | null;
|
|
56
|
+
/** Open/close a drawer-capable widget's drawer. Deliberate (a click), and
|
|
57
|
+
* deliberate to close — the band folding underneath it does not dismiss it. */
|
|
58
|
+
toggleDrawer: (id: string) => void;
|
|
59
|
+
/** Wire onto the root — one hover surface spans the band + drawer region. */
|
|
60
|
+
rootHandlers: {
|
|
61
|
+
onMouseEnter: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
62
|
+
onMouseLeave: (e: React.MouseEvent<HTMLDivElement>) => void;
|
|
63
|
+
};
|
|
64
|
+
/** Attach to the notch ROOT (band + drawer region). It is the boundary an
|
|
65
|
+
* outside press is measured against — this hook owns no markup, so it cannot
|
|
66
|
+
* ask a class name where the surface ends. */
|
|
67
|
+
rootRef: React.RefObject<HTMLDivElement | null>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Headless presence-notch state machine — the band's fold mechanics (hover,
|
|
71
|
+
* agent-working, settle-dwell, standing-question) and zone/drawer derivation.
|
|
72
|
+
* Owns zero rendering; `@fourty/ui`'s `<PresenceNotch>` supplies the JSX and
|
|
73
|
+
* the `fourty-notch*` structural class hooks the brand theme skins.
|
|
74
|
+
*/
|
|
75
|
+
export declare function usePresenceNotch(widgets: NotchWidget[]): PresenceNotchApi;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { AgentPresenceFrame } from '../../../../spacestation/src/widgets/presence/index';
|
|
2
|
+
import { type ScanningState } from './runtime-context';
|
|
3
|
+
/**
|
|
4
|
+
* Neutral resolution kinds — vertical-agnostic. A space maps each to its OWN
|
|
5
|
+
* rendered form: e.g. a fashion brand renders `held` as a "dossier"/"thought".
|
|
6
|
+
* Infra never names those (§VIII).
|
|
7
|
+
*
|
|
8
|
+
* What the notch shows is the agent's READ of the shopper — the MEDIATED frame
|
|
9
|
+
* the presence faculty emits on `flow.output{PRESENCE_FLOW}` (a clean, brand-
|
|
10
|
+
* voiced read), plus live scanning. The agent's RAW reasoning is NEVER shown
|
|
11
|
+
* here: the presence faculty translates it into the held frame (latching-flow);
|
|
12
|
+
* piping raw `reasoning_delta` to the notch leaks the model's chain-of-thought.
|
|
13
|
+
* The placed set (`layoutEntityIds`) is EXPOSED below for a space that wants to
|
|
14
|
+
* build a deliberately-curated form from it, but it is NOT a default kind.
|
|
15
|
+
*/
|
|
16
|
+
export type AgentPresenceKind = 'scanning' | 'held' | 'idle';
|
|
17
|
+
export interface AgentPresenceState {
|
|
18
|
+
/** Live: products being flipped through mid-search. null when not scanning. */
|
|
19
|
+
scanning: ScanningState | null;
|
|
20
|
+
/** The agent's held frame — the MEDIATED read; `form` opaque, the space
|
|
21
|
+
* renders it. This is the only text channel the notch shows. */
|
|
22
|
+
frame: AgentPresenceFrame | null;
|
|
23
|
+
/** Entity ids the current layout places. Exposed for a space that wants to
|
|
24
|
+
* derive a CURATED form from a subset — NOT surfaced as a default kind
|
|
25
|
+
* (the full set is "what's on screen", not a presence). */
|
|
26
|
+
layoutEntityIds: string[];
|
|
27
|
+
/** Whether the agent is working from the visitor's POV — includes the
|
|
28
|
+
* optimistic send→ack window (`isSubmitting`), not just the server-acked run. */
|
|
29
|
+
isRunning: boolean;
|
|
30
|
+
/** Default-resolved kind by the standard precedence
|
|
31
|
+
* (scanning › held › idle). A space may use this directly or ignore it and
|
|
32
|
+
* order the fields above however it wants. */
|
|
33
|
+
kind: AgentPresenceKind;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Headless presence resolver — the notch's MECHANICS as reusable infra. Reads
|
|
37
|
+
* the agent-presence signals (the mediated held frame + live scanning) and
|
|
38
|
+
* resolves what to show now. A space renders the result with its own components
|
|
39
|
+
* and may override the ordering.
|
|
40
|
+
*
|
|
41
|
+
* The agent stays the controller — it EMITS the frames (`form` opaque); this
|
|
42
|
+
* only decides which signal wins at this instant. Build a notch with:
|
|
43
|
+
* `const p = useAgentPresence(); switch (p.kind) { … render your forms … }`
|
|
44
|
+
*/
|
|
45
|
+
export declare function useAgentPresence(flowId?: string): AgentPresenceState;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export interface ConsumedStanding {
|
|
2
|
+
/** The standing signal's id (resolution + animation key). */
|
|
3
|
+
id: string;
|
|
4
|
+
/** The raw signal payload — the consuming widget reads its own fields. */
|
|
5
|
+
payload: Record<string, unknown>;
|
|
6
|
+
/** Confirm: resolve + trace `…resolved` to the agent (the visitor accepted). */
|
|
7
|
+
confirm: () => void;
|
|
8
|
+
/** Dismiss: resolve + trace `…dismissed` (the visitor declined). */
|
|
9
|
+
dismiss: () => void;
|
|
10
|
+
}
|
|
11
|
+
/** Consume the standing signal of `type`. Returns null when none stands. */
|
|
12
|
+
export declare function useConsumeStandingSignal(type: string): ConsumedStanding | null;
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The server's view of the open kind set: ONE list of tokens, from which both
|
|
3
|
+
* the validation union and the emittable-only subset are DERIVED.
|
|
4
|
+
*
|
|
5
|
+
* The derivation is the point. A browser structurally cannot assert a
|
|
6
|
+
* `server`-trust event — not because a runtime check rejects it, but because
|
|
7
|
+
* `EmittableOf` resolves a `server` kind to `never` and it vanishes from the
|
|
8
|
+
* union the emit surface accepts. One declaration, two guarantees, no way for
|
|
9
|
+
* them to drift apart.
|
|
10
|
+
*
|
|
11
|
+
* The catalog is a VALUE passed to a function, assembled explicitly at API
|
|
12
|
+
* startup the way `apps/api/src/lib/register-catalogs.ts:54-63` already
|
|
13
|
+
* assembles catalogs. It is not a module-load registry: nothing here mutates on
|
|
14
|
+
* import, so a module evaluated twice (Turbopack does) cannot produce a
|
|
15
|
+
* different answer the second time.
|
|
16
|
+
*/
|
|
17
|
+
import { z } from 'zod';
|
|
18
|
+
import type { AnyEventKind, EventKind, EventTrust } from './kind';
|
|
19
|
+
/**
|
|
20
|
+
* The full validation union — every kind in the catalog, whoever may assert it.
|
|
21
|
+
*
|
|
22
|
+
* Reads the TUPLE that `eventCatalog(...)` inferred, which is why the assembly
|
|
23
|
+
* site must spread nothing: see `_UnionIsNotDegenerate` below.
|
|
24
|
+
*/
|
|
25
|
+
export type EventOf<Kinds extends readonly AnyEventKind[]> = {
|
|
26
|
+
[Index in keyof Kinds]: Kinds[Index] extends EventKind<infer Name, infer Payload, EventTrust> ? {
|
|
27
|
+
readonly kind: Name;
|
|
28
|
+
readonly payload: Payload;
|
|
29
|
+
} : never;
|
|
30
|
+
}[number];
|
|
31
|
+
/**
|
|
32
|
+
* The same catalog restricted to what a BROWSER may assert. A `server` kind
|
|
33
|
+
* matches no branch, resolves to `never`, and is gone from the union — so the
|
|
34
|
+
* emit surface cannot name it and no ingest check has to remember to.
|
|
35
|
+
*/
|
|
36
|
+
export type EmittableOf<Kinds extends readonly AnyEventKind[]> = {
|
|
37
|
+
[Index in keyof Kinds]: Kinds[Index] extends EventKind<infer Name, infer Payload, 'client'> ? {
|
|
38
|
+
readonly kind: Name;
|
|
39
|
+
readonly payload: Payload;
|
|
40
|
+
} : never;
|
|
41
|
+
}[number];
|
|
42
|
+
export interface EventCatalog<Kinds extends readonly AnyEventKind[]> {
|
|
43
|
+
readonly kinds: Kinds;
|
|
44
|
+
/** The kind registered under `name`, or `null`. NEVER a prefix match and
|
|
45
|
+
* never a family fallback: a name is accepted because it is registered, or
|
|
46
|
+
* it is refused with the registered list. */
|
|
47
|
+
lookup(name: string): AnyEventKind | null;
|
|
48
|
+
/** Registration order, for the refusal message and the enumeration test. */
|
|
49
|
+
names(): readonly string[];
|
|
50
|
+
}
|
|
51
|
+
export type CatalogEvent<Catalog> = Catalog extends EventCatalog<infer Kinds> ? EventOf<Kinds> : never;
|
|
52
|
+
export type CatalogEmittable<Catalog> = Catalog extends EventCatalog<infer Kinds> ? EmittableOf<Kinds> : never;
|
|
53
|
+
/**
|
|
54
|
+
* Assemble a catalog from tokens.
|
|
55
|
+
*
|
|
56
|
+
* Call it with the tokens SPREAD AS ARGUMENTS, never with a pre-declared
|
|
57
|
+
* `AnyEventKind[]` variable: an array variable widens the tuple and collapses
|
|
58
|
+
* `EventOf` to `{ kind: string; payload: unknown }` with no error at the
|
|
59
|
+
* assembly site, silently disarming every exhaustive switch downstream. The
|
|
60
|
+
* assembly site is expected to carry the `_UnionIsNotDegenerate` assertion that
|
|
61
|
+
* fails the build if it ever happens.
|
|
62
|
+
*/
|
|
63
|
+
export declare function eventCatalog<Kinds extends readonly AnyEventKind[]>(...kinds: Kinds): EventCatalog<Kinds>;
|
|
64
|
+
/**
|
|
65
|
+
* A Zod schema over the catalog's full union, narrowing with `z.custom` — the
|
|
66
|
+
* idiom `layout/page.ts:123-128` established for a registry-backed open set.
|
|
67
|
+
*
|
|
68
|
+
* ── WHY THERE IS NO `.transform()` HERE, WHICH LOOKS LIKE AN OMISSION ──────
|
|
69
|
+
*
|
|
70
|
+
* `z.custom` passes its INPUT through unstripped, so for most schemas the
|
|
71
|
+
* parsed value and the input differ and only the parsed one is safe to store.
|
|
72
|
+
* Here they are provably the SAME value, and that is a property of the contract
|
|
73
|
+
* rather than luck: every payload schema is a FLAT `.strict()` object
|
|
74
|
+
* (`defineEventKind` will not compile anything else), and a strict parse
|
|
75
|
+
* REJECTS an unknown key instead of stripping it. So a payload that parses has
|
|
76
|
+
* no key to strip, at any depth, because there is no depth.
|
|
77
|
+
*
|
|
78
|
+
* That is why the flat-strict rule is enforced at the parameter type and not by
|
|
79
|
+
* review: this narrowing is only sound while it holds. Envelope-level extras
|
|
80
|
+
* (`{ kind, payload, somethingElse }`) are stripped by the ordinary `z.object`
|
|
81
|
+
* in `envelope.ts`, which is a different schema with a different job.
|
|
82
|
+
*/
|
|
83
|
+
export declare function catalogEventSchema<Kinds extends readonly AnyEventKind[]>(catalog: EventCatalog<Kinds>): z.ZodType<EventOf<Kinds>, z.ZodTypeDef, unknown>;
|
|
84
|
+
/**
|
|
85
|
+
* The same, restricted to kinds a browser may assert. This is what a public
|
|
86
|
+
* ingest route validates against; `catalogEventSchema` is for server-side
|
|
87
|
+
* producers, which are trusted to name a `server` kind.
|
|
88
|
+
*/
|
|
89
|
+
export declare function catalogEmittableSchema<Kinds extends readonly AnyEventKind[]>(catalog: EventCatalog<Kinds>): z.ZodType<EmittableOf<Kinds>, z.ZodTypeDef, unknown>;
|