@40rty/ams-sdk 0.3.1 → 0.4.2
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 +6655 -5934
- package/dist/types/ecommerce/src/review-schemas.d.ts +32 -0
- package/dist/types/sdk/src/analytics/scope-context.d.ts +2 -2
- package/dist/types/sdk/src/canvas/active-chips.d.ts +8 -0
- package/dist/types/sdk/src/canvas/chip-relevance.d.ts +41 -0
- package/dist/types/sdk/src/canvas/index.d.ts +6 -1
- package/dist/types/sdk/src/canvas/item-motion/index.d.ts +1 -1
- package/dist/types/sdk/src/canvas/item-motion/profile.d.ts +0 -3
- package/dist/types/sdk/src/canvas/layout-entity-refs.d.ts +12 -0
- package/dist/types/sdk/src/canvas/runtime-hooks.d.ts +2 -0
- package/dist/types/sdk/src/canvas/runtime-types.d.ts +2 -0
- package/dist/types/sdk/src/canvas/use-canvas-actions.d.ts +14 -24
- package/dist/types/sdk/src/canvas/use-is-seed-home.d.ts +17 -0
- package/dist/types/sdk/src/canvas/use-safe-facts.d.ts +9 -0
- package/dist/types/sdk/src/catalog/define.d.ts +1 -1
- package/dist/types/sdk/src/catalog/index.d.ts +1 -1
- package/dist/types/sdk/src/catalog/interaction-contract.d.ts +3 -3
- package/dist/types/sdk/src/catalog/registration/types.d.ts +7 -0
- package/dist/types/sdk/src/catalog/render-inline.d.ts +0 -37
- package/dist/types/sdk/src/host/host-modules.d.ts +217 -121
- package/dist/types/sdk/src/host/types.d.ts +3 -1
- package/dist/types/sdk/src/index.d.ts +3 -5
- package/dist/types/sdk/src/preview/SpacefrontPreviewProvider.d.ts +65 -0
- package/dist/types/sdk/src/preview/index.d.ts +1 -0
- package/dist/types/sdk/src/projection/index.d.ts +1 -0
- package/dist/types/sdk/src/projection/transform.d.ts +12 -0
- package/dist/types/sdk/src/projection/use-projection.d.ts +24 -0
- package/dist/types/sdk/src/provider/agent-ask-signal.d.ts +4 -0
- package/dist/types/sdk/src/provider/index.d.ts +1 -1
- package/dist/types/sdk/src/session/FourtySessionContext.d.ts +1 -1
- package/dist/types/sdk/src/shell/composer-attachments/heic-convert.d.ts +6 -0
- package/dist/types/sdk/src/shell/composer-attachments/use-composer-attachments.d.ts +37 -0
- package/dist/types/sdk/src/shell/conversation/answer-text.d.ts +15 -0
- package/dist/types/sdk/src/shell/conversation/index.d.ts +4 -0
- package/dist/types/sdk/src/shell/conversation/turn-pages.d.ts +16 -0
- package/dist/types/sdk/src/shell/conversation/use-conversation-page.d.ts +65 -0
- package/dist/types/sdk/src/shell/conversation/use-conversation-presence.d.ts +31 -0
- package/dist/types/sdk/src/shell/index.d.ts +6 -0
- package/dist/types/sdk/src/shell/turn-ask-placement.d.ts +17 -0
- package/dist/types/sdk/src/shell/use-dock-state.d.ts +58 -0
- package/dist/types/sdk/src/shell/use-prompt-composer.d.ts +51 -0
- package/dist/types/sdk/src/shell/use-thread-rows.d.ts +3 -1
- package/dist/types/sdk/src/shell/use-turn-ask-reply.d.ts +5 -0
- package/dist/types/sdk/src/utils/core-utils/index.d.ts +0 -6
- package/dist/types/sdk/src/utils/index.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/cart}/use-cart-drawer.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/cart}/use-cart-line-row.d.ts +1 -1
- package/dist/types/sdk/src/verticals/commerce/cart/use-cart-view.d.ts +51 -0
- package/dist/types/sdk/src/verticals/commerce/cart/use-safe-cart.d.ts +16 -0
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/checkout}/buy-now-exit.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/checkout}/checkout-handoff-reasons.d.ts +2 -2
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/checkout}/checkout-handoff-shape.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/checkout}/checkout-handoff-store.d.ts +3 -3
- package/dist/types/sdk/src/verticals/commerce/chip-relevance.d.ts +1 -0
- package/dist/types/sdk/src/{commerce → verticals/commerce}/commerce-context.d.ts +1 -1
- package/dist/types/sdk/src/{commerce → verticals/commerce}/commerce-shapes.d.ts +2 -2
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/comparison}/comparison-rows.d.ts +1 -1
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +35 -0
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/normalize-collection.d.ts +2 -2
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/product-filters.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-look-card.d.ts +4 -4
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-product-card.d.ts +2 -2
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-product-detail.d.ts +3 -3
- package/dist/types/sdk/src/verticals/commerce/use-commerce-actions.d.ts +18 -0
- package/dist/types/sdk/src/{commerce → verticals/commerce/variant}/pending-variant-choice-store.d.ts +2 -2
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/preselect-from-facts.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/use-selected-variants-state.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/variant-option-axes.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/variant-resolution.d.ts +1 -1
- package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/variant-selection.d.ts +1 -1
- package/dist/types/sdk/src/verticals/content/index.d.ts +1 -0
- package/dist/types/sdk/src/verticals/content/use-content-actions.d.ts +12 -0
- package/dist/types/sdk/src/widgets/presence/index.d.ts +1 -0
- package/dist/types/sdk/src/widgets/presence/runtime-context.d.ts +1 -1
- package/dist/types/sdk/src/widgets/presence/use-forget-fact.d.ts +35 -0
- package/dist/types/spacestation/src/analytics/ecommerce/events.d.ts +1 -1
- package/dist/types/spacestation/src/catalog/shape-tokens.d.ts +2 -0
- package/dist/types/spacestation/src/catalog/wire/index.d.ts +1 -1
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +24 -1
- package/dist/types/spacestation/src/index.d.ts +3 -1
- package/dist/types/spacestation/src/layout/conversation.d.ts +5 -0
- package/dist/types/spacestation/src/signal/turn-ask.d.ts +94 -0
- package/dist/types/spacestation/src/widgets/presence/profile.d.ts +2 -2
- package/package.json +2 -1
- package/dist/types/sdk/src/animation/index.d.ts +0 -2
- package/dist/types/sdk/src/animation/useListTransition.d.ts +0 -16
- package/dist/types/sdk/src/animation/useUpdateTransition.d.ts +0 -16
- package/dist/types/sdk/src/commerce/ecommerce/agentic-overlay.d.ts +0 -27
- package/dist/types/sdk/src/commerce/ecommerce/index.d.ts +0 -21
- package/dist/types/sdk/src/commerce/ecommerce/use-product-carousel-scroll.d.ts +0 -13
- package/dist/types/sdk/src/commerce/index.d.ts +0 -9
- package/dist/types/sdk/src/content/index.d.ts +0 -2
- package/dist/types/sdk/src/content/use-faq-accordion.d.ts +0 -11
- package/dist/types/sdk/src/content/use-newsletter-form.d.ts +0 -16
- package/dist/types/sdk/src/provider/AgentAsk.d.ts +0 -16
- package/dist/types/sdk/src/shared/index.d.ts +0 -2
- package/dist/types/sdk/src/social/index.d.ts +0 -2
- package/dist/types/sdk/src/social/use-review-helpful.d.ts +0 -10
- package/dist/types/sdk/src/social/use-testimonials-carousel.d.ts +0 -15
- package/dist/types/sdk/src/utils/core-utils/format-distance.d.ts +0 -6
- package/dist/types/sdk/src/utils/core-utils/maps-directions-url.d.ts +0 -5
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/cart}/cart-action-failures.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/cart}/cart-drawer-store.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce → verticals/commerce/checkout}/external-navigation.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/checkout}/use-buy-now.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/comparison}/use-comparison-table.d.ts +0 -0
- /package/dist/types/sdk/src/{utils/core-utils → verticals/commerce/price}/format-price.d.ts +0 -0
- /package/dist/types/sdk/src/{utils/core-utils → verticals/commerce/price}/is-on-sale.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-product-grid-filter.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce → verticals/commerce/variant}/option-selection-store.d.ts +0 -0
- /package/dist/types/sdk/src/{utils/core-utils → verticals/commerce/variant}/resolve-swatch-color.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce → verticals/commerce/variant}/variant-selection-store.d.ts +0 -0
- /package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/wishlist}/use-wishlist-drawer.d.ts +0 -0
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
* Every name here is re-exported from `./checkout-handoff-store`, which is the
|
|
13
13
|
* path the rest of the repo already imports.
|
|
14
14
|
*/
|
|
15
|
-
import type { CheckoutOrigin, CheckoutOutcome, CheckoutRefusal } from '
|
|
15
|
+
import type { CheckoutOrigin, CheckoutOutcome, CheckoutRefusal } from '../../../../../spacestation/src/analytics/ecommerce/index';
|
|
16
16
|
/**
|
|
17
17
|
* Where the checkout handoff stands. `armed` is the only non-terminal value;
|
|
18
18
|
* the rest are the settled verdict of one attempt.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { type CheckoutRefusal } from '
|
|
1
|
+
import { type CheckoutRefusal } from '../../../../../spacestation/src/analytics/ecommerce/index';
|
|
2
2
|
export type { CheckoutHandoffOrigin, CheckoutHandoffOutcome, CheckoutHandoffState, } from './checkout-handoff-shape';
|
|
3
3
|
import type { CheckoutHandoffState } from './checkout-handoff-shape';
|
|
4
|
-
import type { AnalyticsSink } from '
|
|
5
|
-
import type { ExternalNavigationResult } from '
|
|
4
|
+
import type { AnalyticsSink } from '../../../analytics';
|
|
5
|
+
import type { ExternalNavigationResult } from './external-navigation';
|
|
6
6
|
/** AGENT: commit the exit. Fires when the turn's response lands, not now. */
|
|
7
7
|
export declare function armCheckoutHandoff(analytics: AnalyticsSink | null, url: string): void;
|
|
8
8
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product } from '
|
|
1
|
+
import type { Product } from '../../../../ecommerce/src/index';
|
|
2
2
|
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
|
|
3
3
|
import type { AddToCartApi, CartAddHints, CartApi, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi } from './commerce-shapes';
|
|
4
4
|
/**
|
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
* Every name here is re-exported from `@fourty/sdk/commerce`; nothing imports
|
|
11
11
|
* this path directly from outside the SDK.
|
|
12
12
|
*/
|
|
13
|
-
import type { CartOrigin } from '
|
|
14
|
-
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight } from '
|
|
13
|
+
import type { CartOrigin } from '../../../../spacestation/src/analytics/ecommerce/index';
|
|
14
|
+
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight } from '../../../../ecommerce/src/index';
|
|
15
15
|
/**
|
|
16
16
|
* One review / one intent-matched review. Both are `z.infer` of the review
|
|
17
17
|
* schemas in `@fourty/ecommerce` — the single source of truth for the shape,
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import './chip-relevance';
|
|
2
|
+
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
3
|
+
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
4
|
+
export { navigateToExternalCommerceUrl } from './checkout/external-navigation';
|
|
5
|
+
export type { ExternalNavigationResult } from './checkout/external-navigation';
|
|
6
|
+
export { recordVariantSelection, getVariantSelection, useVariantSelections, } from './variant/variant-selection-store';
|
|
7
|
+
export { requestVariantChoice, clearVariantChoice, usePendingVariantChoice, type PendingVariantChoice, } from './variant/pending-variant-choice-store';
|
|
8
|
+
export { recordOptionSelections, getOptionSelections, useOptionSelections, } from './variant/option-selection-store';
|
|
9
|
+
export * from '../../../../spacestation/src/analytics/ecommerce/index';
|
|
10
|
+
export { useProductGridFilter } from './product/use-product-grid-filter';
|
|
11
|
+
export { pickProductCardAction, pickCartAddAction } from '../../../../ecommerce/src/index';
|
|
12
|
+
export { isPendingCartLine, settledCart } from '../../../../ecommerce/src/index';
|
|
13
|
+
export { useProductDetail, type ProductDetailVariantGroup, } from './product/use-product-detail';
|
|
14
|
+
export { classifyComparisonValue, useComparisonHighlight, type ComparisonCellRender, } from './comparison/use-comparison-table';
|
|
15
|
+
export { useCartDrawer } from './cart/use-cart-drawer';
|
|
16
|
+
export { useCartView, type CartViewModel, type ExitPending } from './cart/use-cart-view';
|
|
17
|
+
export { useSafeCart, type SafeCart } from './cart/use-safe-cart';
|
|
18
|
+
export { recordCartActionFailure, readCartActionFailures, clearCartActionFailures, useCartActionFailures, useCartActionFailuresFor, type CartActionFailure, type CartActionSubject, } from './cart/cart-action-failures';
|
|
19
|
+
export { useCartLineRow, type CartLineRowState, type CartLineInteraction, } from './cart/use-cart-line-row';
|
|
20
|
+
export { openCartDrawer, openCartDrawerFocusedOn, closeCartDrawer, toggleCartDrawer, useCartDrawerOpen, useCartDrawerFocus, type CartDrawerFocus, } from './cart/cart-drawer-store';
|
|
21
|
+
export { armCheckoutHandoff, refuseCheckoutHandoff, consumeArmedCheckoutHandoff, disarmCheckoutHandoff, settleArmedCheckoutHandoff, recordVisitorCheckoutExit, readCheckoutHandoff, useCheckoutHandoff, checkoutHandoffReasonFor, CHECKOUT_BLOCKED_REASON, CHECKOUT_NO_URL_REASON, CHECKOUT_EMPTY_CART_REASON, CHECKOUT_NO_LINK_REASON, type CheckoutHandoffOutcome, type CheckoutHandoffOrigin, type CheckoutHandoffState, } from './checkout/checkout-handoff-store';
|
|
22
|
+
export { useWishlistDrawer } from './wishlist/use-wishlist-drawer';
|
|
23
|
+
export { useProductCard, type ProductCardData, type ProductCardBadge, } from './product/use-product-card';
|
|
24
|
+
export { useLookCard, type LookCardData, type LookCardTile } from './product/use-look-card';
|
|
25
|
+
export { resolveProductVariant, variantForSelections, type VariantResolution, type VariantGap, type UnavailableSelection, type VariantOptionChoice, type VariantOptionValue, } from './variant/variant-resolution';
|
|
26
|
+
export { canonicalOptionValue } from '../../../../spacestation/src/index';
|
|
27
|
+
export { preselectFromFacts } from './variant/preselect-from-facts';
|
|
28
|
+
export { matchesProductFilter, pruneFilterChips, type ProductFilterChip, type ProductFilterPredicate, } from './product/product-filters';
|
|
29
|
+
export { normalizeCollectionLegacy, pickCollectionAction } from './product/normalize-collection';
|
|
30
|
+
export { useCommerceActions, type CommerceActions } from './use-commerce-actions';
|
|
31
|
+
export { buildComparisonRows, formatProductPrice, type ComparisonAttributeRow, } from './comparison/comparison-rows';
|
|
32
|
+
export { formatPrice } from './price/format-price';
|
|
33
|
+
export { isOnSale } from './price/is-on-sale';
|
|
34
|
+
export { resolveSwatchColor } from './variant/resolve-swatch-color';
|
|
35
|
+
export { formatVariantValue } from '../../../../ecommerce/src/index';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Collection } from '
|
|
2
|
-
import { type SuggestionActionInput } from '
|
|
1
|
+
import type { Collection } from '../../../../../ecommerce/src/index';
|
|
2
|
+
import { type SuggestionActionInput } from '../../../../../spacestation/src/index';
|
|
3
3
|
/**
|
|
4
4
|
* Adapt either the canonical {handle, title, …} Collection shape OR the
|
|
5
5
|
* legacy {slug, name, imageSrc, productCount} shape to a Collection.
|
package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/product-filters.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product } from '
|
|
1
|
+
import type { Product } from '../../../../../ecommerce/src/index';
|
|
2
2
|
/**
|
|
3
3
|
* Agent-supplied filter chip. Wire shape mirrors the canonical
|
|
4
4
|
* `productGridProps.filters` schema in `@fourty/ui/catalog-data`. The
|
package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-look-card.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { type Product } from '
|
|
2
|
-
import { type SuggestionAction } from '
|
|
3
|
-
import { useSuccessFlash } from '
|
|
4
|
-
import { type VariantGap } from '
|
|
1
|
+
import { type Product } from '../../../../../ecommerce/src/index';
|
|
2
|
+
import { type SuggestionAction } from '../../../../../spacestation/src/index';
|
|
3
|
+
import { useSuccessFlash } from '../../../utils/use-success-flash';
|
|
4
|
+
import { type VariantGap } from '../variant/variant-resolution';
|
|
5
5
|
interface Options {
|
|
6
6
|
/** Raw product list as emitted by the agent. Validated; malformed entries dropped. */
|
|
7
7
|
products: Product[];
|
package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-product-card.d.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
import { type Product } from '
|
|
2
|
+
import { type Product } from '../../../../../ecommerce/src/index';
|
|
3
3
|
type ProductImageData = Product['images'][number];
|
|
4
|
-
import { useImageHover } from '
|
|
4
|
+
import { useImageHover } from '../../../shared/use-image-hover';
|
|
5
5
|
export type ProductCardBadge = 'NEW' | 'SALE' | 'BEST SELLER';
|
|
6
6
|
export interface ProductCardData {
|
|
7
7
|
/** The product to render. Always present — the hydration boundary
|
package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/product}/use-product-detail.d.ts
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { Product, SiblingProduct } from '
|
|
2
|
-
import { preselectFromFacts } from '
|
|
3
|
-
import { type ProductVariant } from '
|
|
1
|
+
import type { Product, SiblingProduct } from '../../../../../ecommerce/src/index';
|
|
2
|
+
import { preselectFromFacts } from '../variant/preselect-from-facts';
|
|
3
|
+
import { type ProductVariant } from '../variant/variant-selection';
|
|
4
4
|
export { preselectFromFacts };
|
|
5
5
|
export interface ProductDetailVariantGroup {
|
|
6
6
|
name: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The commerce vertical's click→action verbs, built on the platform's
|
|
3
|
+
* `useCanvasActions()`. Same contract: a catalog component consumes these
|
|
4
|
+
* handlers and never encodes the action itself. `null` outside a
|
|
5
|
+
* `<FourtyProvider>`.
|
|
6
|
+
*/
|
|
7
|
+
export interface CommerceActions {
|
|
8
|
+
/** Navigate to a product's detail view (`{page:{kind:'product'}}`). */
|
|
9
|
+
navigateToProduct: (productId: string, title: string) => void;
|
|
10
|
+
/** Show a collection. A storefront `Collection` tile doesn't carry
|
|
11
|
+
* productIds, so this round-trips through the agent as a `message` — the
|
|
12
|
+
* agent resolves the collection and composes its grid. */
|
|
13
|
+
showCollection: (collectionTitle: string) => void;
|
|
14
|
+
/** Navigate to a synthetic collection of explicit product ids — the
|
|
15
|
+
* "view all hearted" wishlist affordance. */
|
|
16
|
+
navigateToProductSet: (handle: string, title: string, productIds: string[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export declare function useCommerceActions(): CommerceActions | null;
|
package/dist/types/sdk/src/{commerce → verticals/commerce/variant}/pending-variant-choice-store.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type Product } from '
|
|
2
|
-
import { type VariantGap } from './
|
|
1
|
+
import { type Product } from '../../../../../ecommerce/src/index';
|
|
2
|
+
import { type VariantGap } from './variant-resolution';
|
|
3
3
|
export interface PendingVariantChoice {
|
|
4
4
|
/** The full product — needed to resolve a variant id once the visitor
|
|
5
5
|
* has picked every open axis (`variantForSelections`/`resolveProductVariant`
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product } from '
|
|
1
|
+
import type { Product } from '../../../../../ecommerce/src/index';
|
|
2
2
|
export declare function useSelectedVariantsState(product: Product, facts: Readonly<Record<string, unknown>>): {
|
|
3
3
|
selectedVariants: Record<string, string>;
|
|
4
4
|
setSelectedVariants: React.Dispatch<React.SetStateAction<Record<string, string>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product, ProductVariant } from '
|
|
1
|
+
import type { Product, ProductVariant } from '../../../../../ecommerce/src/index';
|
|
2
2
|
/** One selectable value on an option axis, with its purchasability. */
|
|
3
3
|
export interface VariantOptionValue {
|
|
4
4
|
value: string;
|
package/dist/types/sdk/src/{commerce/ecommerce → verticals/commerce/variant}/variant-resolution.d.ts
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AvailabilityStatus, type Product, type ProductVariant } from '
|
|
1
|
+
import { type AvailabilityStatus, type Product, type ProductVariant } from '../../../../../ecommerce/src/index';
|
|
2
2
|
import { type VariantOptionChoice } from './variant-option-axes';
|
|
3
3
|
export type { VariantOptionChoice, VariantOptionValue } from './variant-option-axes';
|
|
4
4
|
/** A product whose variant can't be resolved without the visitor choosing. */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useContentActions, type ContentActions } from './use-content-actions';
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The content vertical's click→action verbs (editorial articles, newsletter
|
|
3
|
+
* sign-up), built on the platform's `useCanvasActions()`. `null` outside a
|
|
4
|
+
* `<FourtyProvider>`.
|
|
5
|
+
*/
|
|
6
|
+
export interface ContentActions {
|
|
7
|
+
/** Navigate to an article's detail view (`{page:{kind:'article'}}`). */
|
|
8
|
+
navigateToArticle: (articleId: string, title: string) => void;
|
|
9
|
+
/** Submit a `newsletter.subscribe` sign-up. */
|
|
10
|
+
subscribeNewsletter: (email: string, buttonLabel: string) => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function useContentActions(): ContentActions | null;
|
|
@@ -10,6 +10,7 @@ export { registerPresenceFactForm, resolvePresenceFactForm, registeredPresenceFa
|
|
|
10
10
|
export { presenceFactShape, colorHexOf, factFigureParts, FACT_SHAPE, type FactFigureParts, } from './core-presence/fact-shape';
|
|
11
11
|
export { useAgentFlow, useAgentFlowFresh, setFlowOutput, getFlowOutput, subscribeFlowOutputs, } from './flows/flow-store';
|
|
12
12
|
export { useOptimisticFlowSet, useReconcileFlowSet, type OptimisticFlowSet, } from './use-optimistic-flow-set';
|
|
13
|
+
export { useForgetFact, useVisibleFactList, useUndismissedFacts, useReconcileDismissed, useDismissedLabels, type ForgetFactApi, } from './use-forget-fact';
|
|
13
14
|
export { useOptimisticFactOverlay, useReconcileOptimisticFacts, type OptimisticFact, type OptimisticFactOverlay, } from './use-optimistic-facts';
|
|
14
15
|
export { useLayoutEntityIds } from './use-layout-entity-ids';
|
|
15
16
|
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';
|
|
@@ -21,7 +21,7 @@ export interface ScanningState {
|
|
|
21
21
|
* `FourtyProvider` provides this object through the context below, and the
|
|
22
22
|
* thin `useScanning` hook reads it. Same dependency-inversion pattern as
|
|
23
23
|
* `FourtyRuntime` (see `canvas/runtime-context.tsx`) and `FourtyCommerceRuntime`
|
|
24
|
-
* (see `commerce/commerce-context.tsx`).
|
|
24
|
+
* (see `verticals/commerce/commerce-context.tsx`).
|
|
25
25
|
*/
|
|
26
26
|
export interface PresenceRuntime {
|
|
27
27
|
useScanning: () => ScanningState | null;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { PresenceFactRender } from './core-presence/fact-form-registry';
|
|
2
|
+
/**
|
|
3
|
+
* The facts to render: the agent's list, minus what the visitor dismissed. ONE
|
|
4
|
+
* rule, ONE list, every surface — `@fourty/ui`'s frame path (`useVisibleFacts`)
|
|
5
|
+
* and the ELEMENT-stream path both go through it, so a dismissed chip can never
|
|
6
|
+
* vanish from one surface and linger on another.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useVisibleFactList<T extends Pick<PresenceFactRender, 'label'>>(facts: T[]): T[];
|
|
9
|
+
/** The brief's set — identical to the band's, now that neither carries a bridge.
|
|
10
|
+
* Kept as its own name because the two surfaces ASK different questions ("what
|
|
11
|
+
* may I draw" vs "what will the drawer show") and the `+N` is derived from the
|
|
12
|
+
* difference; collapsing the names would hide that the count has a source. */
|
|
13
|
+
export declare const useUndismissedFacts: typeof useVisibleFactList;
|
|
14
|
+
export interface ForgetFactApi {
|
|
15
|
+
forget: (f: Pick<PresenceFactRender, 'label' | 'value'>) => void;
|
|
16
|
+
}
|
|
17
|
+
export declare function useForgetFact(): ForgetFactApi;
|
|
18
|
+
/**
|
|
19
|
+
* Retire optimistic dismissals once the agent's held read no longer shows them.
|
|
20
|
+
* Pass the read's CURRENT (unfiltered) fact labels, or `null` while there's no
|
|
21
|
+
* held read so the optimism survives the gap. Call once where the frame is known.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useReconcileDismissed(presentLabels: string[] | null): void;
|
|
24
|
+
/**
|
|
25
|
+
* What the visitor has forgotten, by label.
|
|
26
|
+
*
|
|
27
|
+
* The slot registry needs this explicitly (`fact-slots.ts`): it retains a chip
|
|
28
|
+
* through the projection's silences, so "gone from the list" no longer means
|
|
29
|
+
* "gone". A dismissal is the one departure the visitor authors, and it has to be
|
|
30
|
+
* able to say so rather than be inferred from an absence that now means
|
|
31
|
+
* something else.
|
|
32
|
+
*/
|
|
33
|
+
export declare function useDismissedLabels(): {
|
|
34
|
+
has: (label: string) => boolean;
|
|
35
|
+
};
|
|
@@ -26,7 +26,7 @@ export declare const CHECKOUT_ORIGINS: readonly ["visitor", "agent"];
|
|
|
26
26
|
export type CheckoutOrigin = (typeof CHECKOUT_ORIGINS)[number];
|
|
27
27
|
/**
|
|
28
28
|
* What the exit did. Mirrors `CheckoutHandoffOutcome` in
|
|
29
|
-
* `packages/sdk/src/commerce/
|
|
29
|
+
* `packages/sdk/src/verticals/commerce/checkout/checkout-handoff-store.ts:49`
|
|
30
30
|
* (`'armed' | 'unavailable' | ExternalNavigationResult`). Listed here rather
|
|
31
31
|
* than imported because `apps/api` cannot reach `@fourty/sdk`; the SDK's own
|
|
32
32
|
* type is expected to derive FROM this one when the emit sites are threaded, so
|
|
@@ -2,4 +2,4 @@ export { WireSchemaSchema, type WireSchema, type WireResolved } from './wire-sch
|
|
|
2
2
|
export { schemaToWire, UnsupportedSchemaError } from './schema-to-wire';
|
|
3
3
|
export { schemaFromWire } from './schema-from-wire';
|
|
4
4
|
export { WireCatalogSchema, WireCatalogEntrySchema, catalogToWire, catalogFromWire, type WireCatalog, type WireCatalogEntry, } from './catalog-wire';
|
|
5
|
-
export { PackageReleaseSchema, draftSourceId, isDraftSource, type PackageRelease } from './package-release';
|
|
5
|
+
export { PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, type PackageRelease } from './package-release';
|
|
@@ -15,6 +15,8 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
15
15
|
label: z.ZodString;
|
|
16
16
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
17
17
|
version: z.ZodString;
|
|
18
|
+
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
19
|
+
description: z.ZodOptional<z.ZodString>;
|
|
18
20
|
catalog: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
19
21
|
type: z.ZodString;
|
|
20
22
|
propsSchema: z.ZodOptional<z.ZodType<import("./wire-schema").WireSchema, z.ZodTypeDef, import("./wire-schema").WireSchema>>;
|
|
@@ -110,17 +112,22 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
110
112
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
111
113
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
112
114
|
* ES module (exporting `renderers`, and optionally `shells`) and its
|
|
113
|
-
* stylesheet
|
|
115
|
+
* stylesheet, plus the files that stylesheet points at (`assets`: fonts,
|
|
116
|
+
* images — base64, keyed by the path the stylesheet's `url()` names, beside
|
|
117
|
+
* it). It is served to browsers; the platform's servers never run it.
|
|
114
118
|
*/
|
|
115
119
|
bundle: z.ZodOptional<z.ZodObject<{
|
|
116
120
|
js: z.ZodString;
|
|
117
121
|
css: z.ZodString;
|
|
122
|
+
assets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
118
123
|
}, "strict", z.ZodTypeAny, {
|
|
119
124
|
js: string;
|
|
120
125
|
css: string;
|
|
126
|
+
assets?: Record<string, string> | undefined;
|
|
121
127
|
}, {
|
|
122
128
|
js: string;
|
|
123
129
|
css: string;
|
|
130
|
+
assets?: Record<string, string> | undefined;
|
|
124
131
|
}>>;
|
|
125
132
|
/**
|
|
126
133
|
* The class the spacefront root carries while this package is the space's.
|
|
@@ -253,9 +260,11 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
253
260
|
}>;
|
|
254
261
|
manifests: Record<string, string>;
|
|
255
262
|
config?: Record<string, unknown> | undefined;
|
|
263
|
+
description?: string | undefined;
|
|
256
264
|
bundle?: {
|
|
257
265
|
js: string;
|
|
258
266
|
css: string;
|
|
267
|
+
assets?: Record<string, string> | undefined;
|
|
259
268
|
} | undefined;
|
|
260
269
|
theme?: {
|
|
261
270
|
themeClass: string;
|
|
@@ -315,9 +324,11 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
315
324
|
}>;
|
|
316
325
|
manifests: Record<string, string>;
|
|
317
326
|
config?: Record<string, unknown> | undefined;
|
|
327
|
+
description?: string | undefined;
|
|
318
328
|
bundle?: {
|
|
319
329
|
js: string;
|
|
320
330
|
css: string;
|
|
331
|
+
assets?: Record<string, string> | undefined;
|
|
321
332
|
} | undefined;
|
|
322
333
|
theme?: {
|
|
323
334
|
themeClass: string;
|
|
@@ -349,3 +360,15 @@ export type PackageRelease = z.infer<typeof PackageReleaseSchema>;
|
|
|
349
360
|
export declare function draftSourceId(sourceId: string, spaceSlug: string, developer: string): string;
|
|
350
361
|
/** A package may not be published under a name that reads as a draft's. */
|
|
351
362
|
export declare function isDraftSource(sourceId: string): boolean;
|
|
363
|
+
/**
|
|
364
|
+
* ONE STORED RELEASE of a package, looked at without making it live — the
|
|
365
|
+
* console's Preview on an older version. Not a draft: nothing is written. The
|
|
366
|
+
* preview credential names this id, and the api registers the release under it
|
|
367
|
+
* in memory when a session asks for it (`ensureReleasePreview`).
|
|
368
|
+
*/
|
|
369
|
+
export declare function releasePreviewSourceId(sourceId: string, release: number): string;
|
|
370
|
+
/** The package and release a preview id names — `undefined` for anything else, a draft included. */
|
|
371
|
+
export declare function parseReleasePreview(id: string): {
|
|
372
|
+
sourceId: string;
|
|
373
|
+
release: number;
|
|
374
|
+
} | undefined;
|
|
@@ -13,6 +13,7 @@ export { type ChatMessage, type ConversationSummary, type StreamRecord, type Rea
|
|
|
13
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
14
|
export { type TraceDiagnostic, type DiagnosticKind, type TraceStage, } from './trace/trace-diagnostics';
|
|
15
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 { TURN_ASK_SIGNAL, TurnAskSchema, turnAskFromSignal, turnAskSegments, turnAskAnswers, turnAskPlainText, type TurnAsk, type TurnAskSegment } from './signal/turn-ask';
|
|
16
17
|
export { type TraceSpanData, type TraceData, type Trace, type TraceLatency, type TraceEventLogEntry, type LayoutChangeEntry, } from './trace/trace-data';
|
|
17
18
|
export { type TraceSnapshotEnvelope, type SystemPromptSnapshotEnvelope, type LayoutSnapshotEnvelope, type SuggestionsSnapshotEnvelope, type TurnSnapshotEnvelope, type AssemblyInputsEnvelope, type AssemblyInputComponent, type AssemblyInputTool, type AssemblyInputPrompt, } from './trace/trace-envelopes';
|
|
18
19
|
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';
|
|
@@ -27,9 +28,10 @@ export { requiredTopLevelProps, isEmptyPropValue, isOptionalTopLevelProp } from
|
|
|
27
28
|
export { findFunctionPropPaths } from './catalog/function-props';
|
|
28
29
|
export { expandPath, normalizeRefs, derivedSourceFilled, type ExpandedPath } from './catalog/hydration-paths';
|
|
29
30
|
export { isElementUnfilled, rendersNothing } from './catalog/element-filled';
|
|
31
|
+
export { carriesShapeToken } from './catalog/shape-tokens';
|
|
30
32
|
export { applySinglePatch } from './layout/apply-patch';
|
|
31
33
|
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';
|
|
34
|
+
export { WireSchemaSchema, WireCatalogSchema, WireCatalogEntrySchema, schemaToWire, schemaFromWire, catalogToWire, catalogFromWire, UnsupportedSchemaError, PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, type PackageRelease, type WireSchema, type WireCatalog, type WireCatalogEntry, } from './catalog/wire';
|
|
33
35
|
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
36
|
export { VIEW_FOCUS_ELEMENT_SIGNAL, FocusElementPayloadSchema, type FocusElementPayload, } from './focus/focus';
|
|
35
37
|
export { VIEW_EXTEND_SIGNAL, VIEW_EXHAUSTED_SIGNAL, ViewExtendPayloadSchema, CONTINUATION_ENABLED, type ViewExtendPayload, } from './view/continuation';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { AgentSignal } from '../signal/agent-signals';
|
|
2
|
+
import type { TurnAsk } from '../signal/turn-ask';
|
|
2
3
|
import type { View } from './page';
|
|
3
4
|
import type { AttachmentRef } from '../attachment/attachment';
|
|
4
5
|
/**
|
|
@@ -30,6 +31,8 @@ export interface ChatMessage {
|
|
|
30
31
|
* persisted before turn ids shipped.
|
|
31
32
|
*/
|
|
32
33
|
id?: string;
|
|
34
|
+
/** The question an assistant row closed on (`TurnAsk`). Absent when the turn asked nothing. */
|
|
35
|
+
ask?: TurnAsk;
|
|
33
36
|
}
|
|
34
37
|
/**
|
|
35
38
|
* ConversationSummary — one entry in the visitor's between-conversation
|
|
@@ -51,6 +54,8 @@ export interface StreamRecord {
|
|
|
51
54
|
prose: string;
|
|
52
55
|
actions: AgentSignal[];
|
|
53
56
|
signals: AgentSignal[];
|
|
57
|
+
/** The question the turn closed on — set apart from `prose`, never inside it. */
|
|
58
|
+
ask?: TurnAsk;
|
|
54
59
|
}
|
|
55
60
|
/**
|
|
56
61
|
* A single visitor-facing reasoning beat. Generic by design — `id` +
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import type { AgentSignal } from './agent-signals';
|
|
3
|
+
/**
|
|
4
|
+
* The question a turn closes on, as data — never as the last line of the prose.
|
|
5
|
+
*
|
|
6
|
+
* The model writes it as one fence line, `/signals/turn.ask`, in typed parts:
|
|
7
|
+
*
|
|
8
|
+
* {"kind":"choice","parts":["Are you getting ",{"answer":"arch cramping"}," or ",{"answer":"heel lift"},"?"]}
|
|
9
|
+
* {"kind":"open","parts":["What climate do you ride in?"]}
|
|
10
|
+
*
|
|
11
|
+
* `kind` comes first so the model decides either/or vs open before it writes a
|
|
12
|
+
* word. A `choice` carries 2-4 `{answer}` parts, an `open` none; a choice
|
|
13
|
+
* that came out without them reads as open (`ModelTurnAskSchema`). Each `{answer}` is a reply the visitor
|
|
14
|
+
* sends with one tap, in place in the sentence — so a shell renders the
|
|
15
|
+
* clickable words without matching anything back into text. Read it through
|
|
16
|
+
* `turnAskSegments` (render), `turnAskAnswers` (the replies) and
|
|
17
|
+
* `turnAskPlainText` (anything that shows or feeds it as text: the prose fold,
|
|
18
|
+
* the model's own history).
|
|
19
|
+
*
|
|
20
|
+
* It is persisted on the assistant row, so a restored turn shows it too.
|
|
21
|
+
*/
|
|
22
|
+
export declare const TURN_ASK_SIGNAL = "turn.ask";
|
|
23
|
+
declare const PartSchema: z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
24
|
+
answer: z.ZodString;
|
|
25
|
+
}, "strip", z.ZodTypeAny, {
|
|
26
|
+
answer: string;
|
|
27
|
+
}, {
|
|
28
|
+
answer: string;
|
|
29
|
+
}>]>;
|
|
30
|
+
export type TurnAskPart = z.infer<typeof PartSchema>;
|
|
31
|
+
/** The question in canonical form: a `choice` always carries 2-4 answers, an `open` none. */
|
|
32
|
+
export interface TurnAsk {
|
|
33
|
+
kind: 'choice' | 'open';
|
|
34
|
+
parts: TurnAskPart[];
|
|
35
|
+
}
|
|
36
|
+
export declare const TurnAskSchema: z.ZodUnion<[z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
37
|
+
kind: z.ZodEnum<["choice", "open"]>;
|
|
38
|
+
parts: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
39
|
+
answer: z.ZodString;
|
|
40
|
+
}, "strip", z.ZodTypeAny, {
|
|
41
|
+
answer: string;
|
|
42
|
+
}, {
|
|
43
|
+
answer: string;
|
|
44
|
+
}>]>, "many">;
|
|
45
|
+
}, "strip", z.ZodTypeAny, {
|
|
46
|
+
kind: "choice" | "open";
|
|
47
|
+
parts: (string | {
|
|
48
|
+
answer: string;
|
|
49
|
+
})[];
|
|
50
|
+
}, {
|
|
51
|
+
kind: "choice" | "open";
|
|
52
|
+
parts: (string | {
|
|
53
|
+
answer: string;
|
|
54
|
+
})[];
|
|
55
|
+
}>, {
|
|
56
|
+
kind: "choice" | "open";
|
|
57
|
+
parts: (string | {
|
|
58
|
+
answer: string;
|
|
59
|
+
})[];
|
|
60
|
+
}, {
|
|
61
|
+
kind: "choice" | "open";
|
|
62
|
+
parts: (string | {
|
|
63
|
+
answer: string;
|
|
64
|
+
})[];
|
|
65
|
+
}>, TurnAsk, {
|
|
66
|
+
kind: "choice" | "open";
|
|
67
|
+
parts: (string | {
|
|
68
|
+
answer: string;
|
|
69
|
+
})[];
|
|
70
|
+
}>, z.ZodEffects<z.ZodObject<{
|
|
71
|
+
question: z.ZodString;
|
|
72
|
+
}, "strip", z.ZodTypeAny, {
|
|
73
|
+
question: string;
|
|
74
|
+
}, {
|
|
75
|
+
question: string;
|
|
76
|
+
}>, TurnAsk, {
|
|
77
|
+
question: string;
|
|
78
|
+
}>]>;
|
|
79
|
+
export type TurnAskSegment = {
|
|
80
|
+
kind: 'text';
|
|
81
|
+
text: string;
|
|
82
|
+
} | {
|
|
83
|
+
kind: 'answer';
|
|
84
|
+
text: string;
|
|
85
|
+
};
|
|
86
|
+
/** The question as plain runs and tappable answers, in reading order. */
|
|
87
|
+
export declare function turnAskSegments(ask: TurnAsk): TurnAskSegment[];
|
|
88
|
+
/** The replies the visitor can tap, in order. `[]` for an open question. */
|
|
89
|
+
export declare function turnAskAnswers(ask: TurnAsk): string[];
|
|
90
|
+
/** The question as it reads aloud. */
|
|
91
|
+
export declare function turnAskPlainText(ask: TurnAsk): string;
|
|
92
|
+
/** The ask a `turn.ask` signal carries; `null` for any other signal or a malformed payload. */
|
|
93
|
+
export declare function turnAskFromSignal(signal: AgentSignal): TurnAsk | null;
|
|
94
|
+
export {};
|
|
@@ -42,12 +42,12 @@ export declare const PresenceProfileSchema: z.ZodObject<{
|
|
|
42
42
|
facts: z.ZodEnum<["inferred-only", "all"]>;
|
|
43
43
|
}, "strip", z.ZodTypeAny, {
|
|
44
44
|
sources: string[] | "all";
|
|
45
|
-
facts: "all" | "inferred-only";
|
|
46
45
|
voice: "full" | "off" | "terse";
|
|
46
|
+
facts: "all" | "inferred-only";
|
|
47
47
|
}, {
|
|
48
48
|
sources: string[] | "all";
|
|
49
|
-
facts: "all" | "inferred-only";
|
|
50
49
|
voice: "full" | "off" | "terse";
|
|
50
|
+
facts: "all" | "inferred-only";
|
|
51
51
|
}>;
|
|
52
52
|
export type PresenceProfile = z.infer<typeof PresenceProfileSchema>;
|
|
53
53
|
/**
|
package/package.json
CHANGED
|
@@ -19,13 +19,14 @@
|
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
21
|
"framer-motion": "^12.34.5",
|
|
22
|
+
"heic2any": "^0.0.4",
|
|
22
23
|
"zod": "^3.25.0"
|
|
23
24
|
},
|
|
24
25
|
"peerDependencies": {
|
|
25
26
|
"react": "^18.3.0 || ^19.0.0",
|
|
26
27
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
27
28
|
},
|
|
28
|
-
"version": "0.
|
|
29
|
+
"version": "0.4.2",
|
|
29
30
|
"homepage": "https://docs.40rty.ai",
|
|
30
31
|
"license": "UNLICENSED",
|
|
31
32
|
"engines": {
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface ListTransitionResult<T> {
|
|
2
|
-
/** Keys of items that are newly entering */
|
|
3
|
-
enteringKeys: Set<string>;
|
|
4
|
-
/** Items that have been removed but should still render for exit animation */
|
|
5
|
-
exitingItems: T[];
|
|
6
|
-
/** All items to render (current + exiting) */
|
|
7
|
-
renderItems: T[];
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Tracks list item enter/exit for animated list components.
|
|
11
|
-
* Returns entering/exiting sets so the component can apply AnimatePresence on individual items.
|
|
12
|
-
*
|
|
13
|
-
* Exiting items stay in the render list for `exitDuration` ms, then are cleaned up.
|
|
14
|
-
*/
|
|
15
|
-
export declare function useListTransition<T>(items: T[], keyFn: (item: T) => string, exitDuration?: number): ListTransitionResult<T>;
|
|
16
|
-
export {};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
interface UpdateTransitionResult<T> {
|
|
2
|
-
displayValue: T;
|
|
3
|
-
isTransitioning: boolean;
|
|
4
|
-
transitionStyle: {
|
|
5
|
-
opacity: number;
|
|
6
|
-
transition: string;
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* Smoothly transitions between old and new values with a crossfade effect.
|
|
11
|
-
* Uses CSS transitions (not Framer Motion) to stay lightweight.
|
|
12
|
-
*
|
|
13
|
-
* When `value` changes: fade out (1→0) → swap displayValue → fade in (0→1)
|
|
14
|
-
*/
|
|
15
|
-
export declare function useUpdateTransition<T>(value: T, duration?: number): UpdateTransitionResult<T>;
|
|
16
|
-
export {};
|