@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,12 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** Signal type — the agent emits this with the element to focus. */
|
|
3
|
+
export declare const VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
|
|
4
|
+
/** Payload: the layout element id to bring into view. */
|
|
5
|
+
export declare const FocusElementPayloadSchema: z.ZodObject<{
|
|
6
|
+
elementId: z.ZodString;
|
|
7
|
+
}, "strip", z.ZodTypeAny, {
|
|
8
|
+
elementId: string;
|
|
9
|
+
}, {
|
|
10
|
+
elementId: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type FocusElementPayload = z.infer<typeof FocusElementPayloadSchema>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hydration contract — the pure (React-free) type surface for resolving
|
|
3
|
+
* entity refs into full entities on the client.
|
|
4
|
+
*
|
|
5
|
+
* A `Hydrator` takes an array of ref ids (or `['*']` for "all") and
|
|
6
|
+
* returns the resolved entities. A `HydratorMap` keys hydrators by
|
|
7
|
+
* resolver name (the key declared via `resolved()` in a component's
|
|
8
|
+
* propsSchema). Both are plain types — no React, no runtime — so they
|
|
9
|
+
* live in `@fourty/spacestation` and are consumed by `@fourty/sdk` and
|
|
10
|
+
* `@fourty/shopify` alike.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* What the hydration boundary knows about WHERE a batch of refs came from.
|
|
14
|
+
*
|
|
15
|
+
* Hydration runs per ELEMENT — the boundary is called once per element and
|
|
16
|
+
* then batches that element's refs by resolver key — so "the element's props"
|
|
17
|
+
* is one unambiguous object: exactly the props the component is about to
|
|
18
|
+
* render with, refs still in ref shape, before anything is written back.
|
|
19
|
+
*
|
|
20
|
+
* It exists because a ref is not always the whole request. A review surface's
|
|
21
|
+
* refs say WHICH product; the sibling `intent` prop says which reviews answer
|
|
22
|
+
* the visitor's question, and only the site knows that. Without the site,
|
|
23
|
+
* every no-turn render (a reload, a restored layout, a cold landing) silently
|
|
24
|
+
* degrades to whatever the refs alone can express.
|
|
25
|
+
*
|
|
26
|
+
* A hydrator reads the props ITS OWN backend needs, under the names its own
|
|
27
|
+
* catalog entry declares. The boundary passes the whole object and knows
|
|
28
|
+
* nothing about any prop in it — a list of "context prop names" living in
|
|
29
|
+
* infra is precisely what §IV.1 exists to prevent.
|
|
30
|
+
*/
|
|
31
|
+
export interface HydrationContext {
|
|
32
|
+
/** The hydrated element's props. Read-only — a hydrator describes a
|
|
33
|
+
* request from them, it never writes back through them. */
|
|
34
|
+
readonly elementProps: Readonly<Record<string, unknown>>;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Hydrator function: takes an array of refs and returns resolved data.
|
|
38
|
+
*
|
|
39
|
+
* The site context is an OPTIONAL second parameter. The boundary always
|
|
40
|
+
* passes it; declaring it is opt-in, so a hydrator that needs nothing but the
|
|
41
|
+
* refs keeps its one-parameter shape, its registration, and its callers
|
|
42
|
+
* unchanged.
|
|
43
|
+
*/
|
|
44
|
+
export type Hydrator = (refs: string[], context?: HydrationContext) => Promise<unknown[]>;
|
|
45
|
+
/** Map of resolver key → hydrator function. */
|
|
46
|
+
export type HydratorMap = Record<string, Hydrator>;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
export { UIElementSchema, SpecSchema, JsonPatchOpSchema, AgentOutputSchema, JSON_PATCH_OPS, type Spec, type UIElement, type JsonPatchOp, type AgentOutput, resolveType, EMPTY_SPEC, isDegenerateLayout, } from './layout/layout';
|
|
2
|
+
export { type ElementChange, type LayoutDiff, diffLayouts, } from './layout/layout-diff';
|
|
3
|
+
export { type Patch, PatchSchema, } from './layout/patch';
|
|
4
|
+
export { RESERVED_IDS, RESERVED_ID_SET, type ReservedId, isReservedId, } from './layout/reserved-ids';
|
|
5
|
+
export { type ReducePatchResult, reducePatch, } from './layout/reduce-patch';
|
|
6
|
+
export { type Page, type PageKindRegistry, registerPageKindSchema, registeredPageKinds, PageSchema, NavigatePayloadSchema, type NavigatePayload, type ViewportFocus, ViewportFocusSchema, type View, ViewSchema, type PageRouter, } from './layout/page';
|
|
7
|
+
import './commerce/page-kinds';
|
|
8
|
+
export { type CartSnapshot, type CartSnapshotLine, CartSnapshotSchema, CartSnapshotLineSchema, type WishlistSnapshot, WishlistSnapshotSchema, } from './commerce/cart-state';
|
|
9
|
+
export { PRODUCT_SELECT_OPTION_SIGNAL, SELECTION_ORIGIN_VISITOR, VARIANT_SELECTED_OBSERVATION, type SelectionOrigin, } from './commerce/selection-signal';
|
|
10
|
+
export { CART_ADD_SIGNAL, CART_ADD_MALFORMED_REASON, CartAddSignalPayloadSchema, withCartActorOrigin, type CartAddSignalPayload, } from './commerce/cart-add-signal';
|
|
11
|
+
export { CART_REMOVE_SIGNAL, CART_SET_QUANTITY_SIGNAL, CHECKOUT_BEGIN_SIGNAL, CART_REMOVE_MALFORMED_REASON, CartRemoveSignalPayloadSchema, type CartRemoveSignalPayload, } from './commerce/cart-verb-signals';
|
|
12
|
+
export { type ChatMessage, type ConversationSummary, type StreamRecord, type ReasoningBeat, type Message, type PendingMessage, } from './layout/conversation';
|
|
13
|
+
export { type StepName, type TraceEvent, type EmitFn, type TraceStartInfo, type StepConfig, type SystemPromptSnapshot, type VisitorIdentity, type PhaseProgress, type PhaseProgressPreview, } from './trace/trace-events';
|
|
14
|
+
export { type TraceDiagnostic, type DiagnosticKind, type TraceStage, } from './trace/trace-diagnostics';
|
|
15
|
+
export { type SuggestionAction, type SuggestionActions, type SuggestionRendererProps, SuggestionActionSchema, SuggestionActionsSchema, SIGNAL_PATCH_PREFIX, type SuggestionActionInput, type AgentSignal, type AgentSignalInput, AgentSignalSchema, InteractionSignalSchema, MAX_VISITOR_PROMPT_CHARS, type ToolCallHint, ToolCallHintSchema, type ActionDefinition, type ActionConfirmation, type ActionGuardEntities, type ActionManifest, type AskDefinition, type AskManifest, NAVIGATE_SIGNAL, FLOW_OUTPUT_SIGNAL, PRESENCE_FLOW, PRESENCE_OPTIMISTIC_FACTS_FLOW, EXTEND_FLOW, DIRECTION_FLOW, EPHEMERAL_FACT_FLOWS, type FlowSpec, type FacultyFlowSpec, } from './signal/agent-signals';
|
|
16
|
+
export { type TraceSpanData, type TraceData, type Trace, type TraceLatency, type TraceEventLogEntry, type LayoutChangeEntry, } from './trace/trace-data';
|
|
17
|
+
export { type TraceSnapshotEnvelope, type SystemPromptSnapshotEnvelope, type LayoutSnapshotEnvelope, type SuggestionsSnapshotEnvelope, type TurnSnapshotEnvelope, type AssemblyInputsEnvelope, type AssemblyInputComponent, type AssemblyInputTool, type AssemblyInputPrompt, } from './trace/trace-envelopes';
|
|
18
|
+
export { type TimingInfo, type UsageInfo, type ToolCall, type SignalType, type InteractionSignal, PRESENCE_FACT_DISMISS_SIGNAL, PRESENCE_CANVAS_REFRESH_SIGNAL, VISITOR_NAME_SIGNAL, VISITOR_CONTEXT_SIGNAL, CLIENT_STATE_HELLO_SIGNAL, stateSnapshotSignal, namespaceFromSnapshotSignal, ENTITY_PRIME_NAMESPACE, StateSnapshotFrameSchema, type StateNamespacePolicy, type StateSnapshotFrame, type EntityPrimePayload, type EntityKind, type EntityRegistryEntry, type VisitorLocation, } from './types';
|
|
19
|
+
export { CONTAINER_TYPES, type ComponentType, type ContainerType, } from './catalog/config';
|
|
20
|
+
export { type CatalogEntry, type CatalogEntryStructural, type ComponentCatalog, type ComponentCatalogStructural, type Binding, type Bindings, } from './catalog/catalog-schemas';
|
|
21
|
+
export { CANVAS_BLOCK_SIZES, CANVAS_ARRANGEMENTS, CANVAS_GRID_COLUMNS, packRows, placeBlocks, settledBlocks, type BlockPlacement, type CanvasBlockSize, type CanvasArrangement, } from './catalog/canvas-arrangement';
|
|
22
|
+
export { STRUCTURAL_BASELINE_CATALOG, STRUCTURAL_BASELINE_TYPES } from './catalog/structural-baseline';
|
|
23
|
+
export { resolved, getResolvedPaths, resolvedTopLevelProps, type ResolvedTopLevelProp, type ResolvedFieldMeta, type ResolvedMeta, type ResolvedSchema, type ResolvedPath, type ResolvedPathSegment, } from './catalog/resolved';
|
|
24
|
+
export { collectElementEntityRefs } from './catalog/entity-refs';
|
|
25
|
+
export { prose, getProsePaths, type ProsePath, type ProseDiscriminant } from './catalog/prose';
|
|
26
|
+
export { requiredTopLevelProps, isEmptyPropValue, isOptionalTopLevelProp } from './catalog/required-props';
|
|
27
|
+
export { findFunctionPropPaths } from './catalog/function-props';
|
|
28
|
+
export { expandPath, normalizeRefs, derivedSourceFilled, type ExpandedPath } from './catalog/hydration-paths';
|
|
29
|
+
export { isElementUnfilled, rendersNothing } from './catalog/element-filled';
|
|
30
|
+
export { applySinglePatch } from './layout/apply-patch';
|
|
31
|
+
export { derivePropsDoc } from './catalog/derive-props-doc';
|
|
32
|
+
export { WireSchemaSchema, WireCatalogSchema, WireCatalogEntrySchema, schemaToWire, schemaFromWire, catalogToWire, catalogFromWire, UnsupportedSchemaError, PackageReleaseSchema, draftSourceId, isDraftSource, type PackageRelease, type WireSchema, type WireCatalog, type WireCatalogEntry, } from './catalog/wire';
|
|
33
|
+
export { LateBoundValueSchema, DirectiveValueSchema, ProjectionDirectiveSchema, ProjectionPreferencesSchema, ProjectionSetPayloadSchema, PROJECTION_SET_SIGNAL, isLateBound, isActiveDirective, projectCollection, type LateBoundValue, type DirectiveValue, type ProjectionDirective, type ProjectionPreferences, type ProjectionSetPayload, type ProjectionAccessors, } from './projection/projection';
|
|
34
|
+
export { VIEW_FOCUS_ELEMENT_SIGNAL, FocusElementPayloadSchema, type FocusElementPayload, } from './focus/focus';
|
|
35
|
+
export { VIEW_EXTEND_SIGNAL, VIEW_EXHAUSTED_SIGNAL, ViewExtendPayloadSchema, CONTINUATION_ENABLED, type ViewExtendPayload, } from './view/continuation';
|
|
36
|
+
export type { Hydrator, HydratorMap, HydrationContext } from './hydration/hydration';
|
|
37
|
+
export { ShellConfigSchema, type ShellConfig, ShellMenuItemSchema, type ShellMenuItem, EMPTY_SHELL, } from './shell/shell';
|
|
38
|
+
export { ALLOWED_ATTACHMENT_TYPES, MAX_ATTACHMENT_BYTES, isAllowedAttachmentType, isImageAttachment, AttachmentRefSchema, AttachmentRefsSchema, type AllowedAttachmentType, type AttachmentRef, } from './attachment/attachment';
|
|
39
|
+
export { ENTRY_CONTEXT_MAX_VALUE_CHARS, ENTRY_CONTEXT_MAX_KEYS, ENTRY_CONTEXT_MAX_NAMESPACES, ENTRY_CONTEXT_MAX_NAME_CHARS, EntryContextValueSchema, EntryContextNamespaceSchema, EntryContextSchema, type EntryContext, } from './contracts/entry-context';
|
|
40
|
+
export { ARRIVAL_MAX_VALUE_CHARS, SURFACES, SurfaceSchema, type Surface, CLICK_ID_KINDS, ClickIdKindSchema, type ClickIdKind, VISITOR_ID_DURABILITIES, VisitorIdDurabilitySchema, type VisitorIdDurability, TRAFFIC_BUCKETS, TrafficBucketSchema, type TrafficBucket, SessionArrivalSchema, type SessionArrival, type RecordedSessionArrival, } from './contracts/session-arrival';
|
|
41
|
+
export { ARRIVAL_PARAMS, REFERRER_HOST_PARAM, arrivalFromParams, arrivalToParams, type ArrivalEvidence, } from './contracts/session-arrival-params';
|
|
42
|
+
export { type AttributeDef, type AttributeRegistry, type AttributeScopeBucket, type AttributeScopeConfig, AttributeDefSchema, AttributeScopeBucketSchema, AttributeScopeConfigSchema, EXTRAS_PREFIX, } from './catalog/attribute-registry';
|
|
43
|
+
export { resolveScope, normalizeAttributeField, scopedAttributeKey, scopeOfAttributeKey, } from './catalog/attribute-scope';
|
|
44
|
+
export type { Space, SpaceName, CreateSpaceInput, UpdateSpaceInput, SpaceConnector, UpsertSpaceConnectorInput } from './space/space';
|
|
45
|
+
export type { SpaceConfig, SpaceWithConfig, VisitorAccess } from './space/space-config';
|
|
46
|
+
export type { ConnectorDescriptor, ConnectorFieldDescriptor } from './space/connector';
|
|
47
|
+
export { DEFAULT_SPACE_CONFIG, DEFAULT_VISITOR_ACCESS, VISITOR_ACCESS, visitorAccessOf, } from './space/space-config';
|
|
48
|
+
export type { ThemePackageOption, BrandDefinition, BrandPromptSection } from './space/workspace-catalog';
|
|
49
|
+
export { COMPONENT_SOURCE, THEME_PACKAGE, THEME_CLASS, COMPONENT_SOURCE_DEFAULT_THEME, WORKSPACE_THEME_PACKAGES, } from './space/workspace-catalog';
|
|
50
|
+
export type { SpaceHosting } from './space/hosting';
|
|
51
|
+
export { DEFAULT_HOSTING, readHosting, hostingAllows } from './space/hosting';
|
|
52
|
+
export type { PromptConfig, PromptConfigVersion } from './space/prompt-config';
|
|
53
|
+
export type { ManifestVersion } from './space/manifest';
|
|
54
|
+
export type { ToolManifestVersion } from './space/tool-manifest';
|
|
55
|
+
export type { GenerationJobState } from './space/generation-job';
|
|
56
|
+
export type { TraceRecord, CreateTraceInput, AgentSessionSummary, SessionTurn, SessionReplay, SessionTrace, LlmUsageDaily, LlmSessionsDaily, LlmUsageBySession, } from './space/trace';
|
|
57
|
+
export { TraceRecordSchema, CreateTraceInputSchema, AgentSessionSummarySchema, SessionTurnSchema, SessionReplaySchema, SessionTraceSchema, LlmUsageDailySchema, LlmSessionsDailySchema, LlmUsageBySessionSchema, } from './space/trace';
|
|
58
|
+
export { entityRefSites, collectPlacedEntityRefs, placedEntityRefsOf, bareComponentType, type EntityRefSite, type PlacedEntityRef, } from './catalog/ref-sites';
|
|
59
|
+
export { SessionVerdictSchema, RecordableVerdictSchema, SessionReviewEventSchema, BugSeveritySchema, BugLocationSchema, SessionBugSchema, SpaceBugSchema, SessionCommentSchema, CreateCommentInputSchema, UpdateCommentInputSchema, SessionSummarySchema, SessionQueuePageSchema, SessionQueueFacetsSchema, SessionCaptureSchema, SessionCaptureInputSchema, SessionFormFactorSchema, MOBILE_VIEWPORT_MAX, formFactorFromViewport, SessionDetailSchema, RecordVerdictInputSchema, FileBugInputSchema, type SessionVerdict, type RecordableVerdict, type SessionReviewEvent, type BugSeverity, type BugLocation, type SessionBug, type SpaceBug, type SessionComment, type CreateCommentInput, type UpdateCommentInput, type SessionSummary, type SessionQueuePage, type SessionQueueFacets, type SessionCapture, type SessionCaptureInput, type SessionFormFactor, type SessionDetail, type RecordVerdictInput, type FileBugInput, } from './space/session-queue';
|
|
60
|
+
export { SessionActivityEventSchema, SessionActivitySchema, type SessionActivityEvent, type SessionActivity, } from './space/session-activity';
|
|
61
|
+
export type { ComponentPackage, CreatePackageInput, UpdatePackageInput } from './space/package';
|
|
62
|
+
export type { PackageVersion, CreatePackageVersionInput } from './space/package-version';
|
|
63
|
+
export type { SpaceOtp, CreateSpaceOtpInput } from './space/space-otp';
|
|
64
|
+
export type * from './contracts/retrieval';
|
|
65
|
+
export type * from './contracts/tools';
|
|
66
|
+
export type * from './contracts/knowledge';
|
|
67
|
+
export type * from './contracts/retrieval/ecommerce/client';
|
|
68
|
+
export { canonicalOptionValue, statedValueVerdict, reportedAxisValues, readOptionAxes, } from './contracts/retrieval/ecommerce/option-values';
|
|
69
|
+
export type { StatedValueVerdict } from './contracts/retrieval/ecommerce/option-values';
|
|
70
|
+
export { tokenize, splitSentences, createTokenOverlapScorer, compressString, compressArray, } from './tool-compression';
|
|
71
|
+
export type { Scorer, ScorerFactoryContext, CompressStringOpts, CompressStringResult, CompressArrayOpts, CompressArrayResult, } from './tool-compression';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { JsonPatchOp } from './layout';
|
|
2
|
+
/**
|
|
3
|
+
* Apply a single RFC 6902 op to a JSON document. Generic in the document
|
|
4
|
+
* type so the same routine drives both `layout` (Spec) and `shell`
|
|
5
|
+
* (ShellConfig) patch streams. Immutable — returns a new object with
|
|
6
|
+
* structural sharing along the path.
|
|
7
|
+
*
|
|
8
|
+
* ARRAY containers get real RFC 6902 semantics at the terminal segment
|
|
9
|
+
* (`-` append, numeric insert/replace/remove-by-splice). The generic
|
|
10
|
+
* object branch used to swallow these: `add /elements/page/children/-`
|
|
11
|
+
* set a literal `'-'` PROPERTY on the children array — length unchanged,
|
|
12
|
+
* invisible to React, silently dropped by JSON.stringify — which made
|
|
13
|
+
* every scroll-extend continuation's appended surface apply its element
|
|
14
|
+
* data yet never enter `page.children`. The canvas never grew, and the
|
|
15
|
+
* client's next layout write persisted the elements as orphans.
|
|
16
|
+
*/
|
|
17
|
+
export declare function applySinglePatch<T extends object>(doc: T, patch: JsonPatchOp): T;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type { AgentSignal } from '../signal/agent-signals';
|
|
2
|
+
import type { View } from './page';
|
|
3
|
+
import type { AttachmentRef } from '../attachment/attachment';
|
|
4
|
+
/**
|
|
5
|
+
* Conversation-log + agent-stream data shapes.
|
|
6
|
+
*
|
|
7
|
+
* These are PLAIN data types — no runtime behavior. The SDK's
|
|
8
|
+
* `Conversation` runtime class produces and mutates them; brand UI
|
|
9
|
+
* (catalog components, shells) reads them. They live in
|
|
10
|
+
* `@fourty/spacestation` so the UI layer can reference the shapes without a
|
|
11
|
+
* dependency on the SDK runtime.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* ChatMessage — one committed turn in the conversation log as the
|
|
15
|
+
* SessionRuntime exposes it. `view` carries the frozen page+layout+shell
|
|
16
|
+
* at commit time so the client can time-travel back to the exact canvas
|
|
17
|
+
* state the agent painted. Older sessions persisted before per-message
|
|
18
|
+
* views may omit it; the client falls back to the latest layout.
|
|
19
|
+
*/
|
|
20
|
+
export interface ChatMessage {
|
|
21
|
+
role: 'user' | 'assistant';
|
|
22
|
+
text: string;
|
|
23
|
+
view?: View;
|
|
24
|
+
/**
|
|
25
|
+
* Stable id of the conversation turn this row belongs to — the same
|
|
26
|
+
* client-minted `Message.messageId` (both the user row and its paired
|
|
27
|
+
* assistant row carry the turn's id). The cross-system join key for
|
|
28
|
+
* time-travel anchoring: the client references a turn by this id, the
|
|
29
|
+
* server resolves it against its persisted rows. Absent only on rows
|
|
30
|
+
* persisted before turn ids shipped.
|
|
31
|
+
*/
|
|
32
|
+
id?: string;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* ConversationSummary — one entry in the visitor's between-conversation
|
|
36
|
+
* index: a past or current conversation they can jump back to. A client-local
|
|
37
|
+
* view model (the SDK persists it in browser storage), kept here so both the
|
|
38
|
+
* SDK runtime and the UI shell reference one shape. Distinct from
|
|
39
|
+
* `ChatMessage` (a turn WITHIN a conversation).
|
|
40
|
+
*/
|
|
41
|
+
export interface ConversationSummary {
|
|
42
|
+
/** Server session id — the key the restore path re-initializes against. */
|
|
43
|
+
sessionId: string;
|
|
44
|
+
/** Visitor-facing label, derived from the conversation's first prompt. */
|
|
45
|
+
title: string;
|
|
46
|
+
/** Last-activity epoch ms — drives most-recent-first ordering. */
|
|
47
|
+
updatedAt: number;
|
|
48
|
+
}
|
|
49
|
+
/** Per-turn agent stream channels. */
|
|
50
|
+
export interface StreamRecord {
|
|
51
|
+
prose: string;
|
|
52
|
+
actions: AgentSignal[];
|
|
53
|
+
signals: AgentSignal[];
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* A single visitor-facing reasoning beat. Generic by design — `id` +
|
|
57
|
+
* `text` are guaranteed; `data` is a free-form bag the brand UI
|
|
58
|
+
* inspects for thumbnails / context chips / anything it understands.
|
|
59
|
+
* SDK has no opinion on `data`'s shape.
|
|
60
|
+
*/
|
|
61
|
+
export interface ReasoningBeat {
|
|
62
|
+
id: string;
|
|
63
|
+
text: string;
|
|
64
|
+
data?: Record<string, unknown>;
|
|
65
|
+
}
|
|
66
|
+
/** A committed turn in the `Conversation` runtime's message log. */
|
|
67
|
+
export interface Message {
|
|
68
|
+
index: number;
|
|
69
|
+
visitorText: string;
|
|
70
|
+
/**
|
|
71
|
+
* Stable id for this turn. Minted client-side at sendMessage time;
|
|
72
|
+
* stamped onto every layout element this turn patches as `__turnId`
|
|
73
|
+
* so the DOM can be queried with `[data-turn-id=<id>]` to locate
|
|
74
|
+
* everything this response produced.
|
|
75
|
+
*/
|
|
76
|
+
messageId: string;
|
|
77
|
+
/** Frozen View at the moment the message committed. */
|
|
78
|
+
view: View;
|
|
79
|
+
/**
|
|
80
|
+
* The element this turn was ABOUT — the agent's own focus directive,
|
|
81
|
+
* recorded as it streamed (`layout_patch_op.focus`, else the post-stream
|
|
82
|
+
* `view.focus.element`).
|
|
83
|
+
*
|
|
84
|
+
* Time-travel needs to land on what a turn CHANGED, not the top of the
|
|
85
|
+
* page — when every turn patches the same page, a rewind that always lands
|
|
86
|
+
* at the top is unreadable, because each turn looks like the same page seen
|
|
87
|
+
* from the top. The agent already computes this at compose time
|
|
88
|
+
* (`deriveComposeFocusId` — the topmost changed root child, derived from
|
|
89
|
+
* the real patch ops); it used to be consumed for live scroll and thrown
|
|
90
|
+
* away, forcing the client to RE-DERIVE it at rewind time by diffing
|
|
91
|
+
* adjacent frozen views. That reconstruction can only see the net
|
|
92
|
+
* difference between two snapshots, and it has no answer at all for the
|
|
93
|
+
* first turn, which has no predecessor to diff against.
|
|
94
|
+
*
|
|
95
|
+
* Absent-able by design: turns committed before this shipped, and restored
|
|
96
|
+
* sessions, carry no focus. The rewind resolver falls back to `__turnId`
|
|
97
|
+
* stamps and then to the layout diff.
|
|
98
|
+
*/
|
|
99
|
+
focusElementId?: string;
|
|
100
|
+
streams: StreamRecord;
|
|
101
|
+
committedAt: string;
|
|
102
|
+
/** Files the visitor attached to this turn (image/file refs). Shown on the
|
|
103
|
+
* user bubble in the thread. Client-side only — one-shot, not persisted to
|
|
104
|
+
* server conversation rows, so absent after a session restore. */
|
|
105
|
+
attachments?: AttachmentRef[];
|
|
106
|
+
/**
|
|
107
|
+
* Why this turn produced no answer — the terminal `error` event's message,
|
|
108
|
+
* or `'no_response'` for a clean-but-empty finish. Present ONLY on a failed
|
|
109
|
+
* turn, so `error !== undefined` is the test for one.
|
|
110
|
+
*
|
|
111
|
+
* A failed turn commits like any other rather than being discarded: the
|
|
112
|
+
* visitor's own words vanishing from the thread reads as the product losing
|
|
113
|
+
* their message, which is worse than an answered-nothing row. The session
|
|
114
|
+
* ErrorBanner explains the failure while it is live; this field is what
|
|
115
|
+
* keeps the row honest afterwards, once the banner has cleared.
|
|
116
|
+
*/
|
|
117
|
+
error?: string;
|
|
118
|
+
}
|
|
119
|
+
/** The in-flight turn the `Conversation` runtime is streaming into. */
|
|
120
|
+
export interface PendingMessage {
|
|
121
|
+
index: number;
|
|
122
|
+
messageId: string;
|
|
123
|
+
visitorText: string;
|
|
124
|
+
status: 'streaming' | 'aborted' | 'error';
|
|
125
|
+
/** Files the visitor attached to this turn — shown on the user bubble. */
|
|
126
|
+
attachments?: AttachmentRef[];
|
|
127
|
+
streams: StreamRecord;
|
|
128
|
+
/**
|
|
129
|
+
* Live reasoning beats — short customer-facing notes the agent emits
|
|
130
|
+
* as it works ("Reading the ask", "Hunting through the catalog",
|
|
131
|
+
* "Found 12 satin styles"). Ephemeral: only lives on the active
|
|
132
|
+
* pending message; never committed into the per-turn snapshot.
|
|
133
|
+
* Wire shape: `reasoning_update` TraceEvent → routed here.
|
|
134
|
+
*/
|
|
135
|
+
reasoning: ReasoningBeat[];
|
|
136
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Spec, UIElement } from './layout';
|
|
2
|
+
export interface ElementChange {
|
|
3
|
+
type: 'added' | 'removed' | 'modified';
|
|
4
|
+
id: string;
|
|
5
|
+
element: UIElement;
|
|
6
|
+
previous?: UIElement;
|
|
7
|
+
}
|
|
8
|
+
export interface LayoutDiff {
|
|
9
|
+
changes: ElementChange[];
|
|
10
|
+
summary: {
|
|
11
|
+
added: number;
|
|
12
|
+
removed: number;
|
|
13
|
+
modified: number;
|
|
14
|
+
unchanged: number;
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
export declare function diffLayouts(before: Spec | null, after: Spec): LayoutDiff;
|
|
@@ -0,0 +1,275 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/** A single UI element in the flat element map. */
|
|
3
|
+
export interface UIElement<T extends string = string, P = Record<string, unknown>> {
|
|
4
|
+
/** Component type from the catalog */
|
|
5
|
+
type: T;
|
|
6
|
+
/** Component props */
|
|
7
|
+
props: P;
|
|
8
|
+
/** Child element keys (flat structure) */
|
|
9
|
+
children?: string[];
|
|
10
|
+
/**
|
|
11
|
+
* Named-experience selector. Picks an alternate visual implementation
|
|
12
|
+
* registered under the same component `type` via ExperienceRegistry
|
|
13
|
+
* (e.g. `'editorial'`, `'minimal'`, `'spec-heavy'`). Falls back to the
|
|
14
|
+
* default registered component when the name isn't found.
|
|
15
|
+
*/
|
|
16
|
+
experience?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Provenance — the agent turn that produced (or last mutated) this
|
|
19
|
+
* element. Stamped client-side by the Thread when applying patches,
|
|
20
|
+
* NOT emitted by the agent. Used to power bidirectional highlight
|
|
21
|
+
* wiring (hover a component → highlight its message in the composer,
|
|
22
|
+
* and vice versa). Underscored name marks it as a non-prompt-facing
|
|
23
|
+
* runtime field that downstream serializers may filter out.
|
|
24
|
+
*/
|
|
25
|
+
__turnId?: string;
|
|
26
|
+
}
|
|
27
|
+
/** Flat UI tree structure — root key + flat map of elements. */
|
|
28
|
+
export interface Spec {
|
|
29
|
+
/** Root element key */
|
|
30
|
+
root: string;
|
|
31
|
+
/** Package alias map — short keys to full package names (e.g. { k: "@generated/knix" }) */
|
|
32
|
+
aliases?: Record<string, string>;
|
|
33
|
+
/** Flat map of elements by key */
|
|
34
|
+
elements: Record<string, UIElement>;
|
|
35
|
+
/** Optional initial state */
|
|
36
|
+
state?: Record<string, unknown>;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The RFC 6902 operations this wire actually IMPLEMENTS — the single source
|
|
40
|
+
* for both the TS union and the Zod enum below, which drifted apart as two
|
|
41
|
+
* hand-maintained lists.
|
|
42
|
+
*
|
|
43
|
+
* `copy` and `test` are deliberately absent. RFC 6902 defines them, and the
|
|
44
|
+
* schema used to admit them, but nothing on either side executes one: the
|
|
45
|
+
* client applier (`apply-patch.ts`) and the agent-side applier
|
|
46
|
+
* (`agent/src/layout/patches.ts`) both fall through to their default branch,
|
|
47
|
+
* while `@json-render/core` — which rebuilds the server's `finalLayout` —
|
|
48
|
+
* implements both AND throws on a failed `test` inside an unguarded reduce.
|
|
49
|
+
* So an admitted `copy` landed server-side and silently not client-side, and
|
|
50
|
+
* an admitted `test` could kill the server's reconstruction while the client
|
|
51
|
+
* shrugged. Rejecting them at the schema boundary is the only place that
|
|
52
|
+
* asymmetry stops being silent.
|
|
53
|
+
*
|
|
54
|
+
* `move` IS kept: unlike copy/test it is fully implemented by both appliers
|
|
55
|
+
* (`apply-patch.ts`'s `move` branch, `patches.ts`'s `case 'move'`). Nothing
|
|
56
|
+
* emits one today, but narrowing it away would reject an op the system
|
|
57
|
+
* handles correctly.
|
|
58
|
+
*/
|
|
59
|
+
export declare const JSON_PATCH_OPS: readonly ["add", "remove", "replace", "move"];
|
|
60
|
+
/** RFC 6902 JSON Patch operation — restricted to {@link JSON_PATCH_OPS}. */
|
|
61
|
+
export interface JsonPatchOp {
|
|
62
|
+
op: (typeof JSON_PATCH_OPS)[number];
|
|
63
|
+
path: string;
|
|
64
|
+
value?: unknown;
|
|
65
|
+
from?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Empty layout — the default before any patches arrive. Used by
|
|
69
|
+
* CanvasController as the initial view's layout, by Thread as the
|
|
70
|
+
* filler for seed turns, and by patch-application code as the base
|
|
71
|
+
* when an op lands before a layout was set. Mirrors `EMPTY_SHELL` for
|
|
72
|
+
* the shell axis.
|
|
73
|
+
*/
|
|
74
|
+
export declare const EMPTY_SPEC: Spec;
|
|
75
|
+
/**
|
|
76
|
+
* True when a layout would render a BLANK canvas — no elements, or only the
|
|
77
|
+
* root with no children. Used to guard the canvas: a turn that ends degenerate
|
|
78
|
+
* must never replace a good prior view (a blank page is never an answer).
|
|
79
|
+
*/
|
|
80
|
+
export declare function isDegenerateLayout(spec: Spec | null | undefined): boolean;
|
|
81
|
+
export declare const UIElementSchema: z.ZodObject<{
|
|
82
|
+
type: z.ZodString;
|
|
83
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
84
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
85
|
+
experience: z.ZodOptional<z.ZodString>;
|
|
86
|
+
__turnId: z.ZodOptional<z.ZodString>;
|
|
87
|
+
}, "strip", z.ZodTypeAny, {
|
|
88
|
+
type: string;
|
|
89
|
+
props: Record<string, unknown>;
|
|
90
|
+
children?: string[] | undefined;
|
|
91
|
+
experience?: string | undefined;
|
|
92
|
+
__turnId?: string | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
type: string;
|
|
95
|
+
props?: Record<string, unknown> | undefined;
|
|
96
|
+
children?: string[] | undefined;
|
|
97
|
+
experience?: string | undefined;
|
|
98
|
+
__turnId?: string | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
export declare const SpecSchema: z.ZodObject<{
|
|
101
|
+
root: z.ZodString;
|
|
102
|
+
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
103
|
+
elements: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
104
|
+
type: z.ZodString;
|
|
105
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
107
|
+
experience: z.ZodOptional<z.ZodString>;
|
|
108
|
+
__turnId: z.ZodOptional<z.ZodString>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
type: string;
|
|
111
|
+
props: Record<string, unknown>;
|
|
112
|
+
children?: string[] | undefined;
|
|
113
|
+
experience?: string | undefined;
|
|
114
|
+
__turnId?: string | undefined;
|
|
115
|
+
}, {
|
|
116
|
+
type: string;
|
|
117
|
+
props?: Record<string, unknown> | undefined;
|
|
118
|
+
children?: string[] | undefined;
|
|
119
|
+
experience?: string | undefined;
|
|
120
|
+
__turnId?: string | undefined;
|
|
121
|
+
}>>;
|
|
122
|
+
state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
123
|
+
}, "strip", z.ZodTypeAny, {
|
|
124
|
+
root: string;
|
|
125
|
+
elements: Record<string, {
|
|
126
|
+
type: string;
|
|
127
|
+
props: Record<string, unknown>;
|
|
128
|
+
children?: string[] | undefined;
|
|
129
|
+
experience?: string | undefined;
|
|
130
|
+
__turnId?: string | undefined;
|
|
131
|
+
}>;
|
|
132
|
+
aliases?: Record<string, string> | undefined;
|
|
133
|
+
state?: Record<string, unknown> | undefined;
|
|
134
|
+
}, {
|
|
135
|
+
root: string;
|
|
136
|
+
elements: Record<string, {
|
|
137
|
+
type: string;
|
|
138
|
+
props?: Record<string, unknown> | undefined;
|
|
139
|
+
children?: string[] | undefined;
|
|
140
|
+
experience?: string | undefined;
|
|
141
|
+
__turnId?: string | undefined;
|
|
142
|
+
}>;
|
|
143
|
+
aliases?: Record<string, string> | undefined;
|
|
144
|
+
state?: Record<string, unknown> | undefined;
|
|
145
|
+
}>;
|
|
146
|
+
export declare const JsonPatchOpSchema: z.ZodObject<{
|
|
147
|
+
op: z.ZodEnum<["add", "remove", "replace", "move"]>;
|
|
148
|
+
path: z.ZodString;
|
|
149
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
150
|
+
from: z.ZodOptional<z.ZodString>;
|
|
151
|
+
}, "strip", z.ZodTypeAny, {
|
|
152
|
+
path: string;
|
|
153
|
+
op: "replace" | "add" | "remove" | "move";
|
|
154
|
+
value?: unknown;
|
|
155
|
+
from?: string | undefined;
|
|
156
|
+
}, {
|
|
157
|
+
path: string;
|
|
158
|
+
op: "replace" | "add" | "remove" | "move";
|
|
159
|
+
value?: unknown;
|
|
160
|
+
from?: string | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
export declare const AgentOutputSchema: z.ZodObject<{
|
|
163
|
+
layout: z.ZodOptional<z.ZodObject<{
|
|
164
|
+
root: z.ZodString;
|
|
165
|
+
aliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
166
|
+
elements: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
167
|
+
type: z.ZodString;
|
|
168
|
+
props: z.ZodDefault<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
169
|
+
children: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
170
|
+
experience: z.ZodOptional<z.ZodString>;
|
|
171
|
+
__turnId: z.ZodOptional<z.ZodString>;
|
|
172
|
+
}, "strip", z.ZodTypeAny, {
|
|
173
|
+
type: string;
|
|
174
|
+
props: Record<string, unknown>;
|
|
175
|
+
children?: string[] | undefined;
|
|
176
|
+
experience?: string | undefined;
|
|
177
|
+
__turnId?: string | undefined;
|
|
178
|
+
}, {
|
|
179
|
+
type: string;
|
|
180
|
+
props?: Record<string, unknown> | undefined;
|
|
181
|
+
children?: string[] | undefined;
|
|
182
|
+
experience?: string | undefined;
|
|
183
|
+
__turnId?: string | undefined;
|
|
184
|
+
}>>;
|
|
185
|
+
state: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
186
|
+
}, "strip", z.ZodTypeAny, {
|
|
187
|
+
root: string;
|
|
188
|
+
elements: Record<string, {
|
|
189
|
+
type: string;
|
|
190
|
+
props: Record<string, unknown>;
|
|
191
|
+
children?: string[] | undefined;
|
|
192
|
+
experience?: string | undefined;
|
|
193
|
+
__turnId?: string | undefined;
|
|
194
|
+
}>;
|
|
195
|
+
aliases?: Record<string, string> | undefined;
|
|
196
|
+
state?: Record<string, unknown> | undefined;
|
|
197
|
+
}, {
|
|
198
|
+
root: string;
|
|
199
|
+
elements: Record<string, {
|
|
200
|
+
type: string;
|
|
201
|
+
props?: Record<string, unknown> | undefined;
|
|
202
|
+
children?: string[] | undefined;
|
|
203
|
+
experience?: string | undefined;
|
|
204
|
+
__turnId?: string | undefined;
|
|
205
|
+
}>;
|
|
206
|
+
aliases?: Record<string, string> | undefined;
|
|
207
|
+
state?: Record<string, unknown> | undefined;
|
|
208
|
+
}>>;
|
|
209
|
+
patches: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
210
|
+
op: z.ZodEnum<["add", "remove", "replace", "move"]>;
|
|
211
|
+
path: z.ZodString;
|
|
212
|
+
value: z.ZodOptional<z.ZodUnknown>;
|
|
213
|
+
from: z.ZodOptional<z.ZodString>;
|
|
214
|
+
}, "strip", z.ZodTypeAny, {
|
|
215
|
+
path: string;
|
|
216
|
+
op: "replace" | "add" | "remove" | "move";
|
|
217
|
+
value?: unknown;
|
|
218
|
+
from?: string | undefined;
|
|
219
|
+
}, {
|
|
220
|
+
path: string;
|
|
221
|
+
op: "replace" | "add" | "remove" | "move";
|
|
222
|
+
value?: unknown;
|
|
223
|
+
from?: string | undefined;
|
|
224
|
+
}>, "many">>;
|
|
225
|
+
}, "strip", z.ZodTypeAny, {
|
|
226
|
+
layout?: {
|
|
227
|
+
root: string;
|
|
228
|
+
elements: Record<string, {
|
|
229
|
+
type: string;
|
|
230
|
+
props: Record<string, unknown>;
|
|
231
|
+
children?: string[] | undefined;
|
|
232
|
+
experience?: string | undefined;
|
|
233
|
+
__turnId?: string | undefined;
|
|
234
|
+
}>;
|
|
235
|
+
aliases?: Record<string, string> | undefined;
|
|
236
|
+
state?: Record<string, unknown> | undefined;
|
|
237
|
+
} | undefined;
|
|
238
|
+
patches?: {
|
|
239
|
+
path: string;
|
|
240
|
+
op: "replace" | "add" | "remove" | "move";
|
|
241
|
+
value?: unknown;
|
|
242
|
+
from?: string | undefined;
|
|
243
|
+
}[] | undefined;
|
|
244
|
+
}, {
|
|
245
|
+
layout?: {
|
|
246
|
+
root: string;
|
|
247
|
+
elements: Record<string, {
|
|
248
|
+
type: string;
|
|
249
|
+
props?: Record<string, unknown> | undefined;
|
|
250
|
+
children?: string[] | undefined;
|
|
251
|
+
experience?: string | undefined;
|
|
252
|
+
__turnId?: string | undefined;
|
|
253
|
+
}>;
|
|
254
|
+
aliases?: Record<string, string> | undefined;
|
|
255
|
+
state?: Record<string, unknown> | undefined;
|
|
256
|
+
} | undefined;
|
|
257
|
+
patches?: {
|
|
258
|
+
path: string;
|
|
259
|
+
op: "replace" | "add" | "remove" | "move";
|
|
260
|
+
value?: unknown;
|
|
261
|
+
from?: string | undefined;
|
|
262
|
+
}[] | undefined;
|
|
263
|
+
}>;
|
|
264
|
+
export type AgentOutput = z.infer<typeof AgentOutputSchema>;
|
|
265
|
+
/**
|
|
266
|
+
* Resolve a potentially qualified component type.
|
|
267
|
+
*
|
|
268
|
+
* - "hero" (bare) → { packageName: "@fourty/ui", componentType: "hero" }
|
|
269
|
+
* - "@generated/knix:hero" (full path) → { packageName: "@generated/knix", componentType: "hero" }
|
|
270
|
+
* - "g:hero" (alias) → looks up "g" in aliases → { packageName: "@generated/knix", componentType: "hero" }
|
|
271
|
+
*/
|
|
272
|
+
export declare function resolveType(type: string, aliases: Record<string, string> | undefined): {
|
|
273
|
+
packageName: string;
|
|
274
|
+
componentType: string;
|
|
275
|
+
};
|