@40rty/ams-sdk 0.5.18 → 0.5.20
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 +1171 -950
- package/dist/types/ecommerce/src/catalog-search.d.ts +32 -0
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +18 -0
- package/dist/types/ecommerce/src/index.d.ts +3 -0
- package/dist/types/ecommerce/src/shop-checkout.d.ts +21 -0
- package/dist/types/ecommerce/src/store-articles.d.ts +34 -0
- package/dist/types/sdk/src/canvas/ElementIdContext.d.ts +8 -0
- package/dist/types/sdk/src/canvas/canvas-arrangement.d.ts +10 -3
- package/dist/types/sdk/src/canvas/canvas-turn-tail.d.ts +44 -0
- package/dist/types/sdk/src/canvas/index.d.ts +2 -1
- package/dist/types/sdk/src/host/host-modules.d.ts +102 -6
- package/dist/types/sdk/src/shell/index.d.ts +1 -0
- package/dist/types/sdk/src/shell/use-ask-about.d.ts +10 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +21 -2
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +41 -1
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +2 -2
- package/dist/types/spacestation/src/index.d.ts +1 -0
- package/dist/types/spacestation/src/signal/visitor-view.d.ts +101 -0
- package/dist/types/spacestation/src/space/connector.d.ts +8 -1
- package/dist/types/spacestation/src/space/session-queue.d.ts +6 -6
- package/package.json +1 -1
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A space's own product search, served by its API, for a platform whose
|
|
3
|
+
* search cannot run in the browser (it needs a credential the page must not
|
|
4
|
+
* hold, like a saved catalog read with our bearer).
|
|
5
|
+
*
|
|
6
|
+
* The search is INJECTED (§IX), like the store-article lookup: the platform
|
|
7
|
+
* binding registers a factory, and the route that serves it never names a
|
|
8
|
+
* platform. A space whose options no factory claims has no served search.
|
|
9
|
+
*/
|
|
10
|
+
import type { Product } from './commerce-schemas';
|
|
11
|
+
export interface CatalogSearchInput {
|
|
12
|
+
query: string;
|
|
13
|
+
limit: number;
|
|
14
|
+
/** The previous page's `nextCursor`; absent = the first page. */
|
|
15
|
+
cursor?: string;
|
|
16
|
+
/** Major units of the space's currency. */
|
|
17
|
+
minPrice?: number;
|
|
18
|
+
maxPrice?: number;
|
|
19
|
+
}
|
|
20
|
+
export interface CatalogSearchPage {
|
|
21
|
+
items: Product[];
|
|
22
|
+
/** Absent on the last page. */
|
|
23
|
+
nextCursor?: string;
|
|
24
|
+
}
|
|
25
|
+
export type CatalogSearch = (input: CatalogSearchInput) => Promise<CatalogSearchPage>;
|
|
26
|
+
/** A search for a space's platform config, or `undefined` when the platform is not this factory's. */
|
|
27
|
+
export type CatalogSearchFactory = (platformConfig: unknown) => CatalogSearch | undefined;
|
|
28
|
+
export declare function registerCatalogSearch(factory: CatalogSearchFactory): void;
|
|
29
|
+
/** First registered factory that claims this platform config. */
|
|
30
|
+
export declare function resolveCatalogSearch(platformConfig: unknown): CatalogSearch | undefined;
|
|
31
|
+
/** Test seam: drops every registration. */
|
|
32
|
+
export declare function clearCatalogSearches(): void;
|
|
@@ -1848,6 +1848,24 @@ export interface StoreAnswer {
|
|
|
1848
1848
|
seller: string;
|
|
1849
1849
|
answer: string;
|
|
1850
1850
|
}
|
|
1851
|
+
/**
|
|
1852
|
+
* A whole bag paid in ONE checkout through Shop, what a marketplace space's
|
|
1853
|
+
* unified checkout answers (`useShopCheckout`). `combined`: every store's lines
|
|
1854
|
+
* are in one Shop Pay checkout at `continueUrl` (Shopify Universal Checkout).
|
|
1855
|
+
* `separate`: one checkout was not possible (`reason`), so each store's lines
|
|
1856
|
+
* are paid at that store's own Shop checkout, in `stores`. `stores` always
|
|
1857
|
+
* names every store's share, so a surface can show who sells what either way.
|
|
1858
|
+
* `continueUrl` and each `checkoutUrl` open a live checkout session: never log them.
|
|
1859
|
+
*/
|
|
1860
|
+
export type ShopCheckoutResult = {
|
|
1861
|
+
status: 'combined';
|
|
1862
|
+
continueUrl: string;
|
|
1863
|
+
stores: StoreCheckout[];
|
|
1864
|
+
} | {
|
|
1865
|
+
status: 'separate';
|
|
1866
|
+
reason: string;
|
|
1867
|
+
stores: StoreCheckout[];
|
|
1868
|
+
};
|
|
1851
1869
|
/** The backend-accepted cart, or null when all we hold is an optimistic
|
|
1852
1870
|
* paint. The single predicate for "is there a cart id the backend knows?" —
|
|
1853
1871
|
* every cart mutation needs it before it can talk to the backend. */
|
|
@@ -11,6 +11,9 @@ export { buildPdpCompanionsConfig, readPdpCompanions } from './pdp-companions';
|
|
|
11
11
|
export { buildBaseAttributesConfig, readBaseAttributesConfig } from './base-attributes';
|
|
12
12
|
export { buildBucketLabelsConfig, readBucketLabelsConfig } from './bucket-labels';
|
|
13
13
|
export { registerProductNameLookup, resolveProductNameLookup, clearProductNameLookups, type ProductNameLookup, type ProductNameLookupFactory, type ProductNameMatch, } from './product-lookup';
|
|
14
|
+
export { registerStoreArticleLookup, resolveStoreArticleLookup, clearStoreArticleLookups, type StoreArticle, type StoreArticleLookup, type StoreArticleLookupFactory, } from './store-articles';
|
|
15
|
+
export { registerCatalogSearch, resolveCatalogSearch, clearCatalogSearches, type CatalogSearch, type CatalogSearchFactory, type CatalogSearchInput, type CatalogSearchPage, } from './catalog-search';
|
|
16
|
+
export { registerShopCheckout, resolveShopCheckout, clearShopCheckouts, type ShopCheckoutLine, type ShopCheckoutMaker, type ShopCheckoutFactory, } from './shop-checkout';
|
|
14
17
|
export { registerCodeDiscountSource, resolveCodeDiscountSource, clearCodeDiscountSources, type CodeDiscountSource, type CodeDiscountSourceFactory, type CodeDiscountTerms, type StoreCodeDiscount, } from './code-discounts';
|
|
15
18
|
export { registerStoreThemeSource, resolveStoreThemeSource, clearStoreThemeSources, StoreThemeAccessError, type StoreThemeSource, type StoreThemeSourceFactory, type StoreThemeFile, type StoreThemeFilesPage, type StoreThemeProduct, } from './store-theme';
|
|
16
19
|
export { installmentOffer, installmentPayment, type InstallmentTerm, type InstallmentPlan, type InstallmentPlans, type InstallmentQuote, type InstallmentOffer, } from './installment-offer';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One checkout for a bag that spans several stores. A marketplace platform
|
|
3
|
+
* registers how it makes one (the shopify-catalog platform: a Shop cart per
|
|
4
|
+
* store joined by Shopify Universal Checkout); the space route resolves it by
|
|
5
|
+
* the space's platform config and never names a vendor (architecture §IX).
|
|
6
|
+
*/
|
|
7
|
+
import type { ShopCheckoutResult } from './commerce-schemas';
|
|
8
|
+
/** One line of the bag: the cart line it came from, the variant, how many. */
|
|
9
|
+
export interface ShopCheckoutLine {
|
|
10
|
+
lineId: string;
|
|
11
|
+
variantId: string;
|
|
12
|
+
quantity: number;
|
|
13
|
+
}
|
|
14
|
+
export type ShopCheckoutMaker = (lines: ReadonlyArray<ShopCheckoutLine>) => Promise<ShopCheckoutResult>;
|
|
15
|
+
/** A maker for a space's platform config, or `undefined` when the platform is not this factory's. */
|
|
16
|
+
export type ShopCheckoutFactory = (platformConfig: unknown) => ShopCheckoutMaker | undefined;
|
|
17
|
+
export declare function registerShopCheckout(factory: ShopCheckoutFactory): void;
|
|
18
|
+
/** First registered factory that claims this platform config. */
|
|
19
|
+
export declare function resolveShopCheckout(platformConfig: unknown): ShopCheckoutMaker | undefined;
|
|
20
|
+
/** Test seam: drops every registration. */
|
|
21
|
+
export declare function clearShopCheckouts(): void;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Articles the selling stores published themselves (their own blogs), for a
|
|
3
|
+
* space whose products come from many stores: "what to wear to a beach
|
|
4
|
+
* wedding" from the store that sells the shirt, linen care from the store that
|
|
5
|
+
* sells the trousers.
|
|
6
|
+
*
|
|
7
|
+
* The lookup is INJECTED (§IX), like the product-name lookup: the platform
|
|
8
|
+
* binding that knows where a product's store lives registers one, and the
|
|
9
|
+
* route that serves it never names a platform. A space whose options no
|
|
10
|
+
* factory claims has no store articles.
|
|
11
|
+
*/
|
|
12
|
+
/** One article as the store published it. Nothing here is written by us. */
|
|
13
|
+
export interface StoreArticle {
|
|
14
|
+
/** The store's name. */
|
|
15
|
+
seller: string;
|
|
16
|
+
/** The article on the store's own site. */
|
|
17
|
+
url: string;
|
|
18
|
+
title: string;
|
|
19
|
+
/** The store's share image for the article; empty when it set none. */
|
|
20
|
+
image: string;
|
|
21
|
+
/** The store's own summary, else the article's opening text. */
|
|
22
|
+
excerpt: string;
|
|
23
|
+
/** The article's sentences that mention the topic, best first (may be empty). */
|
|
24
|
+
passages: string[];
|
|
25
|
+
}
|
|
26
|
+
/** The articles relevant to `topic` from the stores selling `productIds`, best first. */
|
|
27
|
+
export type StoreArticleLookup = (productIds: ReadonlyArray<string>, topic: string) => Promise<StoreArticle[]>;
|
|
28
|
+
/** A lookup for a space's platform config, or `undefined` when the platform is not this factory's. */
|
|
29
|
+
export type StoreArticleLookupFactory = (platformConfig: unknown) => StoreArticleLookup | undefined;
|
|
30
|
+
export declare function registerStoreArticleLookup(factory: StoreArticleLookupFactory): void;
|
|
31
|
+
/** First registered factory that claims this platform config. */
|
|
32
|
+
export declare function resolveStoreArticleLookup(platformConfig: unknown): StoreArticleLookup | undefined;
|
|
33
|
+
/** Test seam: drops every registration. */
|
|
34
|
+
export declare function clearStoreArticleLookups(): void;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Spec } from '../../../spacestation/src/index';
|
|
1
2
|
/**
|
|
2
3
|
* Per-element SDK identity context. Provided by HydratedComponent for every
|
|
3
4
|
* rendered layout element. Components that need the element ID for SDK signals
|
|
@@ -11,3 +12,10 @@ export declare const ElementIdContext: import("react").Context<string | null>;
|
|
|
11
12
|
* rendered outside a HydratedComponent (e.g. Storybook, tests).
|
|
12
13
|
*/
|
|
13
14
|
export declare function useElementId(): string | null;
|
|
15
|
+
/**
|
|
16
|
+
* The layout the current element was rendered from. On a stacked canvas (`stackedTurns`) an earlier turn's blocks
|
|
17
|
+
* render from that turn's own layout, not the live one, so a block that reads its own stamp or its page's other
|
|
18
|
+
* blocks reads them here. `null` outside a HydratedComponent.
|
|
19
|
+
*/
|
|
20
|
+
export declare const ElementLayoutContext: import("react").Context<Spec | null>;
|
|
21
|
+
export declare function useElementLayout(): Spec | null;
|
|
@@ -5,16 +5,23 @@ export interface CanvasArrangementValue {
|
|
|
5
5
|
/** One page per turn: a turn that answers something new shows only its own
|
|
6
6
|
* blocks; one that only adds (`extendsPage` blocks) keeps the page. */
|
|
7
7
|
turnPages: boolean;
|
|
8
|
+
/** Every turn's page stacked on one continuous page, oldest first, each held at
|
|
9
|
+
* the layout its turn ended on: a turn that composes a new page appends below
|
|
10
|
+
* the earlier ones instead of replacing them. */
|
|
11
|
+
stackedTurns: boolean;
|
|
8
12
|
}
|
|
9
13
|
/**
|
|
10
14
|
* How the canvas arranges the agent's top-level blocks. A brand shell mounts
|
|
11
15
|
* this around its canvas (`'bento'` → a 12-column grid packed from each
|
|
12
|
-
* block's catalog `size`; `turnPages` → each turn its own page
|
|
13
|
-
*
|
|
16
|
+
* block's catalog `size`; `turnPages` → each turn its own page; `stackedTurns` →
|
|
17
|
+
* every turn's page kept, stacked in order, the newest appended at the end); the
|
|
18
|
+
* engine reads it. `stackedTurns` is for the stack arrangement and excludes
|
|
19
|
+
* `turnPages`. The agent is unaware of it.
|
|
14
20
|
*/
|
|
15
|
-
export declare function CanvasArrangementProvider({ arrangement, turnPages, children, }: {
|
|
21
|
+
export declare function CanvasArrangementProvider({ arrangement, turnPages, stackedTurns, children, }: {
|
|
16
22
|
arrangement: CanvasArrangement;
|
|
17
23
|
turnPages?: boolean;
|
|
24
|
+
stackedTurns?: boolean;
|
|
18
25
|
children: React.ReactNode;
|
|
19
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
20
27
|
export declare function useCanvasArrangement(): CanvasArrangementValue;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
/** What a turn tail is told about the turn it closes. */
|
|
3
|
+
export interface CanvasTurnTailProps {
|
|
4
|
+
/** The turn's message id: the `__turnId` every block it placed carries. */
|
|
5
|
+
turnKey: string;
|
|
6
|
+
/** The conversation's newest turn: the one streaming, else the last committed one. */
|
|
7
|
+
isNewest: boolean;
|
|
8
|
+
/** The turn is streaming right now. */
|
|
9
|
+
live: boolean;
|
|
10
|
+
/** The turn has placed blocks on its page (read from the turn's own page, so it holds for an earlier turn whose
|
|
11
|
+
* blocks a later turn's page no longer carries). */
|
|
12
|
+
placed: boolean;
|
|
13
|
+
}
|
|
14
|
+
export type CanvasTurnTailComponent = React.ComponentType<CanvasTurnTailProps>;
|
|
15
|
+
/** The DOM attribute on each rendered turn tail, carrying its turn key. */
|
|
16
|
+
export declare const TURN_TAIL_ATTR = "data-fourty-turn-tail";
|
|
17
|
+
/**
|
|
18
|
+
* A brand's content AFTER each turn's blocks, inside the canvas flow: the
|
|
19
|
+
* engine renders `tail` right after a turn's last top-level block (and, for the
|
|
20
|
+
* newest turn while it has no block yet, at the end of the page), so what a
|
|
21
|
+
* brand keeps under an answer (an endless feed, the turn's thinking state)
|
|
22
|
+
* stays in place when a later turn appends below it. `placed` says whether the
|
|
23
|
+
* turn has blocks on its own page. Mount around
|
|
24
|
+
* `<SpacefrontCanvas />`. Stack arrangement only (a bento grid places blocks
|
|
25
|
+
* by size and has no slot for it). No provider, no tails: the canvas renders as
|
|
26
|
+
* before. On a new turn the engine glides the new turn's tail into view, only
|
|
27
|
+
* ever downwards.
|
|
28
|
+
*/
|
|
29
|
+
export declare function CanvasTurnTailProvider({ tail, children, }: {
|
|
30
|
+
tail: CanvasTurnTailComponent;
|
|
31
|
+
children: React.ReactNode;
|
|
32
|
+
}): React.ReactElement;
|
|
33
|
+
export declare function useCanvasTurnTail(): CanvasTurnTailComponent | null;
|
|
34
|
+
/**
|
|
35
|
+
* Where turn tails go in a root block list: after the last block of each turn,
|
|
36
|
+
* and for the newest turn with no block of its own, at the end. `turnOf` names
|
|
37
|
+
* a block's turn (undefined for a block no turn placed, e.g. a welcome section).
|
|
38
|
+
* Returns, per position in `keys`, the turn whose tail follows it, plus the
|
|
39
|
+
* turn whose tail closes the list.
|
|
40
|
+
*/
|
|
41
|
+
export declare function turnTailSlots(keys: readonly string[], turnOf: (key: string) => string | undefined, newest: string | null): {
|
|
42
|
+
after: ReadonlyMap<number, string>;
|
|
43
|
+
end: string | null;
|
|
44
|
+
};
|
|
@@ -7,8 +7,9 @@ export { ShimmerSweep, type ShimmerSweepProps } from './ShimmerSweep';
|
|
|
7
7
|
export { FadeTransition, TransitionProvider, useLayoutTransition, type LayoutTransitionItemProps, type LayoutTransitionGroupProps, type LayoutTransition, } from './TransitionContext';
|
|
8
8
|
export { CanvasArrangementProvider, useCanvasArrangement, type CanvasArrangementValue } from './canvas-arrangement';
|
|
9
9
|
export { CanvasLeadProvider, CanvasLeadSlot, useCanvasLead, useCanvasLeadTarget, type CanvasLeadRule } from './canvas-lead';
|
|
10
|
+
export { CanvasTurnTailProvider, useCanvasTurnTail, turnTailSlots, TURN_TAIL_ATTR, type CanvasTurnTailComponent, type CanvasTurnTailProps } from './canvas-turn-tail';
|
|
10
11
|
export { CanvasMotionStyleProvider, useCanvasMotionStyle, type CanvasMotionStyle } from './canvas-motion-style';
|
|
11
|
-
export { ElementIdContext, useElementId } from './ElementIdContext';
|
|
12
|
+
export { ElementIdContext, ElementLayoutContext, useElementId, useElementLayout } from './ElementIdContext';
|
|
12
13
|
export { buildEntranceProps, type EntranceMotionProps } from './generation-entrance';
|
|
13
14
|
export { INITIAL_NAV_PRESENTATION, type NavDirection, type NavPace, type NavPresentation, } from './nav-direction';
|
|
14
15
|
export { DEFAULT_GENERATION_TIMINGS, DEFAULT_GENERATION_STYLE, GENERATION_EASE, type SkeletonTreatment, type ActiveBlockTreatment, type EntranceTreatment, type TextTreatment, type ImageTreatment, type GenerationTimings, type GenerationStyle, } from './generation-style';
|
|
@@ -104,6 +104,7 @@ export declare const HOST_MODULES: {
|
|
|
104
104
|
ATTACHMENT_ACCEPT: string;
|
|
105
105
|
usePromptComposer: typeof sdk.usePromptComposer;
|
|
106
106
|
useComposerChipSelect: typeof sdk.useComposerChipSelect;
|
|
107
|
+
useAskAbout: typeof sdk.useAskAbout;
|
|
107
108
|
useTurnAskReply: typeof sdk.useTurnAskReply;
|
|
108
109
|
TurnAskPlacementProvider: typeof sdk.TurnAskPlacementProvider;
|
|
109
110
|
useTurnAskPlacement: typeof sdk.useTurnAskPlacement;
|
|
@@ -180,10 +181,16 @@ export declare const HOST_MODULES: {
|
|
|
180
181
|
CanvasLeadSlot: typeof sdk.CanvasLeadSlot;
|
|
181
182
|
useCanvasLead: typeof sdk.useCanvasLead;
|
|
182
183
|
useCanvasLeadTarget: typeof sdk.useCanvasLeadTarget;
|
|
184
|
+
CanvasTurnTailProvider: typeof sdk.CanvasTurnTailProvider;
|
|
185
|
+
useCanvasTurnTail: typeof sdk.useCanvasTurnTail;
|
|
186
|
+
turnTailSlots: typeof sdk.turnTailSlots;
|
|
187
|
+
TURN_TAIL_ATTR: "data-fourty-turn-tail";
|
|
183
188
|
CanvasMotionStyleProvider: typeof sdk.CanvasMotionStyleProvider;
|
|
184
189
|
useCanvasMotionStyle: typeof sdk.useCanvasMotionStyle;
|
|
185
190
|
ElementIdContext: react.Context<string | null>;
|
|
191
|
+
ElementLayoutContext: react.Context<spacestation.Spec | null>;
|
|
186
192
|
useElementId: typeof sdk.useElementId;
|
|
193
|
+
useElementLayout: typeof sdk.useElementLayout;
|
|
187
194
|
buildEntranceProps: typeof sdk.buildEntranceProps;
|
|
188
195
|
INITIAL_NAV_PRESENTATION: sdk.NavPresentation;
|
|
189
196
|
DEFAULT_GENERATION_TIMINGS: sdk.GenerationTimings;
|
|
@@ -383,6 +390,9 @@ export declare const HOST_MODULES: {
|
|
|
383
390
|
useInstallmentOffer: typeof sdk.useInstallmentOffer;
|
|
384
391
|
useStoreCheckouts: typeof sdk.useStoreCheckouts;
|
|
385
392
|
useAskStore: typeof sdk.useAskStore;
|
|
393
|
+
useStoreArticles: typeof sdk.useStoreArticles;
|
|
394
|
+
useShopCheckout: typeof sdk.useShopCheckout;
|
|
395
|
+
useProductSearch: typeof sdk.useProductSearch;
|
|
386
396
|
useCommerceRuntime: typeof sdk.useCommerceRuntime;
|
|
387
397
|
FourtyCommerceRuntimeProvider: react.Provider<sdk.FourtyCommerceRuntime>;
|
|
388
398
|
navigateToExternalCommerceUrl: typeof sdk.navigateToExternalCommerceUrl;
|
|
@@ -1166,6 +1176,83 @@ export declare const HOST_MODULES: {
|
|
|
1166
1176
|
EPHEMERAL_FACT_FLOWS: readonly string[];
|
|
1167
1177
|
CHIP_SHOW_SIGNAL: "chip.show";
|
|
1168
1178
|
chipsFromShowSignal: typeof spacestation.chipsFromShowSignal;
|
|
1179
|
+
ATTENTION_NAMESPACE: "attention";
|
|
1180
|
+
POINTING_NAMESPACE: "pointing";
|
|
1181
|
+
AttentionSchema: zod.ZodObject<{
|
|
1182
|
+
onScreen: zod.ZodArray<zod.ZodObject<{
|
|
1183
|
+
ref: zod.ZodOptional<zod.ZodString>;
|
|
1184
|
+
label: zod.ZodString;
|
|
1185
|
+
note: zod.ZodOptional<zod.ZodString>;
|
|
1186
|
+
}, "strip", zod.ZodTypeAny, {
|
|
1187
|
+
label: string;
|
|
1188
|
+
ref?: string | undefined;
|
|
1189
|
+
note?: string | undefined;
|
|
1190
|
+
}, {
|
|
1191
|
+
label: string;
|
|
1192
|
+
ref?: string | undefined;
|
|
1193
|
+
note?: string | undefined;
|
|
1194
|
+
}>, "many">;
|
|
1195
|
+
lingered: zod.ZodArray<zod.ZodObject<{
|
|
1196
|
+
ref: zod.ZodOptional<zod.ZodString>;
|
|
1197
|
+
label: zod.ZodString;
|
|
1198
|
+
note: zod.ZodOptional<zod.ZodString>;
|
|
1199
|
+
} & {
|
|
1200
|
+
seconds: zod.ZodNumber;
|
|
1201
|
+
}, "strip", zod.ZodTypeAny, {
|
|
1202
|
+
label: string;
|
|
1203
|
+
seconds: number;
|
|
1204
|
+
ref?: string | undefined;
|
|
1205
|
+
note?: string | undefined;
|
|
1206
|
+
}, {
|
|
1207
|
+
label: string;
|
|
1208
|
+
seconds: number;
|
|
1209
|
+
ref?: string | undefined;
|
|
1210
|
+
note?: string | undefined;
|
|
1211
|
+
}>, "many">;
|
|
1212
|
+
passed: zod.ZodArray<zod.ZodString, "many">;
|
|
1213
|
+
}, "strip", zod.ZodTypeAny, {
|
|
1214
|
+
onScreen: {
|
|
1215
|
+
label: string;
|
|
1216
|
+
ref?: string | undefined;
|
|
1217
|
+
note?: string | undefined;
|
|
1218
|
+
}[];
|
|
1219
|
+
lingered: {
|
|
1220
|
+
label: string;
|
|
1221
|
+
seconds: number;
|
|
1222
|
+
ref?: string | undefined;
|
|
1223
|
+
note?: string | undefined;
|
|
1224
|
+
}[];
|
|
1225
|
+
passed: string[];
|
|
1226
|
+
}, {
|
|
1227
|
+
onScreen: {
|
|
1228
|
+
label: string;
|
|
1229
|
+
ref?: string | undefined;
|
|
1230
|
+
note?: string | undefined;
|
|
1231
|
+
}[];
|
|
1232
|
+
lingered: {
|
|
1233
|
+
label: string;
|
|
1234
|
+
seconds: number;
|
|
1235
|
+
ref?: string | undefined;
|
|
1236
|
+
note?: string | undefined;
|
|
1237
|
+
}[];
|
|
1238
|
+
passed: string[];
|
|
1239
|
+
}>;
|
|
1240
|
+
PointedAtSchema: zod.ZodObject<{
|
|
1241
|
+
ref: zod.ZodOptional<zod.ZodString>;
|
|
1242
|
+
label: zod.ZodString;
|
|
1243
|
+
field: zod.ZodString;
|
|
1244
|
+
value: zod.ZodOptional<zod.ZodString>;
|
|
1245
|
+
}, "strip", zod.ZodTypeAny, {
|
|
1246
|
+
field: string;
|
|
1247
|
+
label: string;
|
|
1248
|
+
value?: string | undefined;
|
|
1249
|
+
ref?: string | undefined;
|
|
1250
|
+
}, {
|
|
1251
|
+
field: string;
|
|
1252
|
+
label: string;
|
|
1253
|
+
value?: string | undefined;
|
|
1254
|
+
ref?: string | undefined;
|
|
1255
|
+
}>;
|
|
1169
1256
|
TURN_ASK_SIGNAL: "turn.ask";
|
|
1170
1257
|
TurnAskSchema: zod.ZodUnion<[zod.ZodEffects<zod.ZodEffects<zod.ZodEffects<zod.ZodObject<{
|
|
1171
1258
|
kind: zod.ZodEnum<["choice", "open"]>;
|
|
@@ -3249,16 +3336,16 @@ export declare const HOST_MODULES: {
|
|
|
3249
3336
|
createdAt: zod.ZodString;
|
|
3250
3337
|
}, "strip", zod.ZodTypeAny, {
|
|
3251
3338
|
id: string;
|
|
3339
|
+
note: string | null;
|
|
3252
3340
|
createdAt: string;
|
|
3253
3341
|
verdict: "viewed" | "bug";
|
|
3254
3342
|
reviewer: string;
|
|
3255
|
-
note: string | null;
|
|
3256
3343
|
}, {
|
|
3257
3344
|
id: string;
|
|
3345
|
+
note: string | null;
|
|
3258
3346
|
createdAt: string;
|
|
3259
3347
|
verdict: "viewed" | "bug";
|
|
3260
3348
|
reviewer: string;
|
|
3261
|
-
note: string | null;
|
|
3262
3349
|
}>;
|
|
3263
3350
|
BugSeveritySchema: zod.ZodEnum<["high", "medium", "low"]>;
|
|
3264
3351
|
BugLocationSchema: zod.ZodEffects<zod.ZodObject<{
|
|
@@ -4183,16 +4270,16 @@ export declare const HOST_MODULES: {
|
|
|
4183
4270
|
createdAt: zod.ZodString;
|
|
4184
4271
|
}, "strip", zod.ZodTypeAny, {
|
|
4185
4272
|
id: string;
|
|
4273
|
+
note: string | null;
|
|
4186
4274
|
createdAt: string;
|
|
4187
4275
|
verdict: "viewed" | "bug";
|
|
4188
4276
|
reviewer: string;
|
|
4189
|
-
note: string | null;
|
|
4190
4277
|
}, {
|
|
4191
4278
|
id: string;
|
|
4279
|
+
note: string | null;
|
|
4192
4280
|
createdAt: string;
|
|
4193
4281
|
verdict: "viewed" | "bug";
|
|
4194
4282
|
reviewer: string;
|
|
4195
|
-
note: string | null;
|
|
4196
4283
|
}>, "many">;
|
|
4197
4284
|
bugs: zod.ZodArray<zod.ZodObject<{
|
|
4198
4285
|
id: zod.ZodString;
|
|
@@ -4451,10 +4538,10 @@ export declare const HOST_MODULES: {
|
|
|
4451
4538
|
};
|
|
4452
4539
|
reviews: {
|
|
4453
4540
|
id: string;
|
|
4541
|
+
note: string | null;
|
|
4454
4542
|
createdAt: string;
|
|
4455
4543
|
verdict: "viewed" | "bug";
|
|
4456
4544
|
reviewer: string;
|
|
4457
|
-
note: string | null;
|
|
4458
4545
|
}[];
|
|
4459
4546
|
bugs: {
|
|
4460
4547
|
id: string;
|
|
@@ -4549,10 +4636,10 @@ export declare const HOST_MODULES: {
|
|
|
4549
4636
|
};
|
|
4550
4637
|
reviews: {
|
|
4551
4638
|
id: string;
|
|
4639
|
+
note: string | null;
|
|
4552
4640
|
createdAt: string;
|
|
4553
4641
|
verdict: "viewed" | "bug";
|
|
4554
4642
|
reviewer: string;
|
|
4555
|
-
note: string | null;
|
|
4556
4643
|
}[];
|
|
4557
4644
|
bugs: {
|
|
4558
4645
|
id: string;
|
|
@@ -4793,6 +4880,15 @@ export declare const HOST_MODULES: {
|
|
|
4793
4880
|
registerProductNameLookup: typeof ecommerce.registerProductNameLookup;
|
|
4794
4881
|
resolveProductNameLookup: typeof ecommerce.resolveProductNameLookup;
|
|
4795
4882
|
clearProductNameLookups: typeof ecommerce.clearProductNameLookups;
|
|
4883
|
+
registerStoreArticleLookup: typeof ecommerce.registerStoreArticleLookup;
|
|
4884
|
+
resolveStoreArticleLookup: typeof ecommerce.resolveStoreArticleLookup;
|
|
4885
|
+
clearStoreArticleLookups: typeof ecommerce.clearStoreArticleLookups;
|
|
4886
|
+
registerCatalogSearch: typeof ecommerce.registerCatalogSearch;
|
|
4887
|
+
resolveCatalogSearch: typeof ecommerce.resolveCatalogSearch;
|
|
4888
|
+
clearCatalogSearches: typeof ecommerce.clearCatalogSearches;
|
|
4889
|
+
registerShopCheckout: typeof ecommerce.registerShopCheckout;
|
|
4890
|
+
resolveShopCheckout: typeof ecommerce.resolveShopCheckout;
|
|
4891
|
+
clearShopCheckouts: typeof ecommerce.clearShopCheckouts;
|
|
4796
4892
|
registerCodeDiscountSource: typeof ecommerce.registerCodeDiscountSource;
|
|
4797
4893
|
resolveCodeDiscountSource: typeof ecommerce.resolveCodeDiscountSource;
|
|
4798
4894
|
clearCodeDiscountSources: typeof ecommerce.clearCodeDiscountSources;
|
|
@@ -8,6 +8,7 @@ export { registerExclusiveOverlay, claimExclusiveOverlay, useExclusiveOverlay, }
|
|
|
8
8
|
export { useComposerAttachments, ATTACHMENT_ACCEPT, type AttachmentStatus, type ComposerAttachmentsApi, type ComposerAttachment, } from './composer-attachments/use-composer-attachments';
|
|
9
9
|
export { usePromptComposer, type UsePromptComposerApi, type UsePromptComposerOptions, } from './use-prompt-composer';
|
|
10
10
|
export { useComposerChipSelect } from './use-composer-chip-select';
|
|
11
|
+
export { useAskAbout } from './use-ask-about';
|
|
11
12
|
export { useTurnAskReply } from './use-turn-ask-reply';
|
|
12
13
|
export { TurnAskPlacementProvider, useTurnAskPlacement, type TurnAskPlacement } from './turn-ask-placement';
|
|
13
14
|
export { useGoHome } from './use-go-home';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { PointedAt } from '../../../spacestation/src/index';
|
|
2
|
+
/**
|
|
3
|
+
* Returns a callback that sends a message about one element on the page — a tapped price,
|
|
4
|
+
* colour, product or section — so the agent answers about exactly that element: the turn
|
|
5
|
+
* carries `about` (`PointedAt`: the entity, the facet tapped, the value shown) beside the text.
|
|
6
|
+
*
|
|
7
|
+
* const askAbout = useAskAbout();
|
|
8
|
+
* askAbout('Cheaper', { ref: product.id, label: product.title, field: 'price', value: '$128' });
|
|
9
|
+
*/
|
|
10
|
+
export declare function useAskAbout(): (text: string, about: PointedAt) => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { InstallmentOffer, Money, Product } from '../../../../ecommerce/src/index';
|
|
2
|
-
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
|
|
3
|
-
import type { AddToCartApi, CartAddHints, CartApi, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi } from './commerce-shapes';
|
|
2
|
+
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
|
|
3
|
+
import type { AddToCartApi, CartAddHints, CartApi, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi } from './commerce-shapes';
|
|
4
4
|
/**
|
|
5
5
|
* FourtyCommerceRuntime — the commerce-hook surface the catalog
|
|
6
6
|
* consumes. Same dependency-inversion pattern as `FourtyRuntime`: these
|
|
@@ -35,6 +35,12 @@ export interface FourtyCommerceRuntime {
|
|
|
35
35
|
useStoreCheckouts: () => StoreCheckoutsApi;
|
|
36
36
|
/** A question put to the store that sells a product. */
|
|
37
37
|
useAskStore: () => AskStoreApi;
|
|
38
|
+
/** The selling stores' own articles for an ask. */
|
|
39
|
+
useStoreArticles: (productIds: ReadonlyArray<string>, topic: string) => StoreArticlesApi;
|
|
40
|
+
/** The whole bag in ONE checkout through Shop, across its stores. */
|
|
41
|
+
useShopCheckout: () => ShopCheckoutApi;
|
|
42
|
+
/** One page of the space's catalog search. */
|
|
43
|
+
useProductSearch: (query: string, opts?: ProductSearchOptions) => ProductSearchApi;
|
|
38
44
|
}
|
|
39
45
|
/**
|
|
40
46
|
* Provider for the commerce-hook surface. Mounted by the SDK's
|
|
@@ -84,3 +90,16 @@ export declare function useStoreCheckouts(): StoreCheckoutsApi;
|
|
|
84
90
|
* store's own statement. Not available (and `ask` rejects) where the space is
|
|
85
91
|
* the only store, or without a `<CommerceProvider>`. */
|
|
86
92
|
export declare function useAskStore(): AskStoreApi;
|
|
93
|
+
/** The articles the stores selling `productIds` published themselves, relevant
|
|
94
|
+
* to `topic`. Not available (empty) on a single store's space or without a
|
|
95
|
+
* `<CommerceProvider>`. */
|
|
96
|
+
export declare function useStoreArticles(productIds: ReadonlyArray<string>, topic: string): StoreArticlesApi;
|
|
97
|
+
/** The whole bag in ONE checkout through Shop, even across several stores
|
|
98
|
+
* (`combined`), or each store separately with the reason (`separate`). Not
|
|
99
|
+
* available (and `create` rejects) on a single-store backend, without a bag,
|
|
100
|
+
* or without a `<CommerceProvider>`. */
|
|
101
|
+
export declare function useShopCheckout(): ShopCheckoutApi;
|
|
102
|
+
/** One page of the space's catalog search for `query`, in the catalog's order, with the
|
|
103
|
+
* cursor for the next page (pass it back as `opts.cursor`). Not available without a
|
|
104
|
+
* `<CommerceProvider>`. */
|
|
105
|
+
export declare function useProductSearch(query: string, opts?: ProductSearchOptions): ProductSearchApi;
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* this path directly from outside the SDK.
|
|
12
12
|
*/
|
|
13
13
|
import type { CartOrigin } from '../../../../spacestation/src/analytics/ecommerce/index';
|
|
14
|
-
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight, StoreAnswer, StoreCheckout } from '../../../../ecommerce/src/index';
|
|
14
|
+
import type { Cart, OptimisticCartLine, Product, ProductReviewItem, ProductReviewHighlight, StoreAnswer, StoreArticle, StoreCheckout, ShopCheckoutResult } 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,
|
|
@@ -210,3 +210,43 @@ export interface AskStoreApi {
|
|
|
210
210
|
/** True while `ask` is in flight. */
|
|
211
211
|
pending: boolean;
|
|
212
212
|
}
|
|
213
|
+
/** Return shape of `useStoreArticles`: the articles the selling stores published
|
|
214
|
+
* themselves that speak to an ask (their own blogs), best first. */
|
|
215
|
+
export interface StoreArticlesApi {
|
|
216
|
+
/** False where the space has no store articles to read (a single store's space). */
|
|
217
|
+
available: boolean;
|
|
218
|
+
articles: StoreArticle[];
|
|
219
|
+
isLoading: boolean;
|
|
220
|
+
}
|
|
221
|
+
/** What `useProductSearch` asks for: one page of a catalog search. Prices are major units. */
|
|
222
|
+
export interface ProductSearchOptions {
|
|
223
|
+
limit?: number;
|
|
224
|
+
/** The previous page's `nextCursor`; absent = the first page. */
|
|
225
|
+
cursor?: string;
|
|
226
|
+
minPrice?: number;
|
|
227
|
+
maxPrice?: number;
|
|
228
|
+
}
|
|
229
|
+
/** Return shape of `useProductSearch`: ONE page of the space's catalog search, in the
|
|
230
|
+
* catalog's order, and the cursor for the next page. Pages are never merged or deduplicated here. */
|
|
231
|
+
export interface ProductSearchApi {
|
|
232
|
+
/** False without a commerce backend to search. */
|
|
233
|
+
available: boolean;
|
|
234
|
+
products: Product[];
|
|
235
|
+
/** Pass back as `cursor` for the next page; null on the last page. */
|
|
236
|
+
nextCursor: string | null;
|
|
237
|
+
isLoading: boolean;
|
|
238
|
+
error: Error | null;
|
|
239
|
+
}
|
|
240
|
+
/** Return shape of `useShopCheckout`: the whole bag paid in ONE checkout
|
|
241
|
+
* through Shop, even when its lines come from several stores. */
|
|
242
|
+
export interface ShopCheckoutApi {
|
|
243
|
+
/** False where the bag belongs to one store and exits through
|
|
244
|
+
* `cart.checkoutUrl` (`useCartView().handleCheckout`) instead, or there is no bag yet. */
|
|
245
|
+
available: boolean;
|
|
246
|
+
/** Make the checkout. `combined`: one Shop Pay checkout at `continueUrl` for every
|
|
247
|
+
* store. `separate` (with the reason): each store's own Shop checkout, in `stores`.
|
|
248
|
+
* Places no order. The URLs open live sessions: never log them. */
|
|
249
|
+
create: () => Promise<ShopCheckoutResult>;
|
|
250
|
+
/** True while `create` is in flight. */
|
|
251
|
+
pending: boolean;
|
|
252
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './chip-relevance';
|
|
2
|
-
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useInstallmentOffer, useStoreCheckouts, useAskStore, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
3
|
-
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
2
|
+
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useInstallmentOffer, useStoreCheckouts, useAskStore, useStoreArticles, useShopCheckout, useProductSearch, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
3
|
+
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, StoreCheckoutsApi, AskStoreApi, StoreArticlesApi, ShopCheckoutApi, ProductSearchApi, ProductSearchOptions, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
4
4
|
export { navigateToExternalCommerceUrl } from './checkout/external-navigation';
|
|
5
5
|
export type { ExternalNavigationResult } from './checkout/external-navigation';
|
|
6
6
|
export { recordVariantSelection, getVariantSelection, useVariantSelections, } from './variant/variant-selection-store';
|
|
@@ -14,6 +14,7 @@ export { type StepName, type TraceEvent, type EmitFn, type TraceStartInfo, type
|
|
|
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 ActionPrepareContext, type ActionNamedEntity, type ActionPrepared, 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
16
|
export { CHIP_SHOW_SIGNAL, chipsFromShowSignal } from './signal/chip-show';
|
|
17
|
+
export { ATTENTION_NAMESPACE, POINTING_NAMESPACE, AttentionSchema, PointedAtSchema, type Attention, type PointedAt } from './signal/visitor-view';
|
|
17
18
|
export { TURN_ASK_SIGNAL, TurnAskSchema, turnAskFromSignal, turnAskSegments, turnAskAnswers, turnAskPlainText, type TurnAsk, type TurnAskSegment } from './signal/turn-ask';
|
|
18
19
|
export { type TraceSpanData, type TraceData, type Trace, type TraceLatency, type TraceEventLogEntry, type LayoutChangeEntry, } from './trace/trace-data';
|
|
19
20
|
export { type TraceSnapshotEnvelope, type SystemPromptSnapshotEnvelope, type LayoutSnapshotEnvelope, type SuggestionsSnapshotEnvelope, type TurnSnapshotEnvelope, type AssemblyInputsEnvelope, type AssemblyInputComponent, type AssemblyInputTool, type AssemblyInputPrompt, } from './trace/trace-envelopes';
|