@40rty/ams-sdk 0.5.11 → 0.5.13
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 +1065 -847
- package/dist/types/ecommerce/src/index.d.ts +1 -0
- package/dist/types/ecommerce/src/installment-offer.d.ts +42 -0
- package/dist/types/sdk/src/canvas/canvas-lead.d.ts +23 -0
- package/dist/types/sdk/src/canvas/index.d.ts +1 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +36 -0
- package/dist/types/sdk/src/shell/bot-check-notice.d.ts +9 -0
- package/dist/types/sdk/src/shell/conversation/answer-text.d.ts +7 -0
- package/dist/types/sdk/src/shell/conversation/index.d.ts +1 -1
- package/dist/types/sdk/src/shell/index.d.ts +2 -0
- package/dist/types/sdk/src/shell/submit-origin.d.ts +40 -0
- package/dist/types/sdk/src/shell/use-prompt-composer.d.ts +6 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +9 -1
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +3 -2
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +1 -1
- package/dist/types/spacestation/src/index.d.ts +2 -0
- package/dist/types/spacestation/src/shell/bot-check-notice.d.ts +34 -0
- package/dist/types/spacestation/src/signal/chip-show.d.ts +10 -0
- package/dist/types/spacestation/src/space/space-config.d.ts +4 -0
- package/package.json +1 -1
|
@@ -13,3 +13,4 @@ export { buildBucketLabelsConfig, readBucketLabelsConfig } from './bucket-labels
|
|
|
13
13
|
export { registerProductNameLookup, resolveProductNameLookup, clearProductNameLookups, type ProductNameLookup, type ProductNameLookupFactory, type ProductNameMatch, } from './product-lookup';
|
|
14
14
|
export { registerCodeDiscountSource, resolveCodeDiscountSource, clearCodeDiscountSources, type CodeDiscountSource, type CodeDiscountSourceFactory, type CodeDiscountTerms, type StoreCodeDiscount, } from './code-discounts';
|
|
15
15
|
export { registerStoreThemeSource, resolveStoreThemeSource, clearStoreThemeSources, StoreThemeAccessError, type StoreThemeSource, type StoreThemeSourceFactory, type StoreThemeFile, type StoreThemeFilesPage, type StoreThemeProduct, } from './store-theme';
|
|
16
|
+
export { installmentOffer, installmentPayment, type InstallmentTerm, type InstallmentPlan, type InstallmentPlans, type InstallmentQuote, type InstallmentOffer, } from './installment-offer';
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { Money } from './commerce-schemas';
|
|
2
|
+
/**
|
|
3
|
+
* A store's pay-over-time plans, as its commerce platform publishes them: the
|
|
4
|
+
* price window financing covers, and per price band the terms on offer.
|
|
5
|
+
* `split` = pay in N interest-free; `zeroPercent` = a 0% loan; `interest` = a
|
|
6
|
+
* loan at `apr` percent. Read once per session by the commerce adapter.
|
|
7
|
+
*/
|
|
8
|
+
export interface InstallmentTerm {
|
|
9
|
+
kind: 'split' | 'zeroPercent' | 'interest';
|
|
10
|
+
/** Annual percentage rate, in percent (15 = 15%). */
|
|
11
|
+
apr: number;
|
|
12
|
+
frequency: 'weekly' | 'monthly';
|
|
13
|
+
count: number;
|
|
14
|
+
}
|
|
15
|
+
export interface InstallmentPlan {
|
|
16
|
+
minPrice: Money;
|
|
17
|
+
maxPrice: Money;
|
|
18
|
+
terms: InstallmentTerm[];
|
|
19
|
+
}
|
|
20
|
+
export interface InstallmentPlans {
|
|
21
|
+
minPrice: Money;
|
|
22
|
+
maxPrice: Money;
|
|
23
|
+
plans: InstallmentPlan[];
|
|
24
|
+
}
|
|
25
|
+
/** One term priced for a given amount — `payment` is each installment, to the cent. */
|
|
26
|
+
export interface InstallmentQuote extends InstallmentTerm {
|
|
27
|
+
payment: number;
|
|
28
|
+
}
|
|
29
|
+
/** What a price qualifies for: every term priced, plus the two figures a
|
|
30
|
+
* price line shows — the longest interest-free split and the lowest monthly
|
|
31
|
+
* payment ("from $X/mo"). */
|
|
32
|
+
export interface InstallmentOffer {
|
|
33
|
+
plans: InstallmentQuote[];
|
|
34
|
+
split: InstallmentQuote | undefined;
|
|
35
|
+
lowestMonthly: InstallmentQuote | undefined;
|
|
36
|
+
}
|
|
37
|
+
/** Each installment of `term` on `amount`: an even split at 0%, else the
|
|
38
|
+
* fixed payment of a loan amortized at the term's APR. Rounded to the cent. */
|
|
39
|
+
export declare function installmentPayment(amount: number, term: InstallmentTerm): number;
|
|
40
|
+
/** The offer on `price`, or undefined when it is outside every plan's band
|
|
41
|
+
* (or priced in a currency the plans are not). */
|
|
42
|
+
export declare function installmentOffer(plans: InstallmentPlans, price: Money): InstallmentOffer | undefined;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export declare function CanvasLeadProvider({ types, children }: {
|
|
3
|
+
types: readonly string[];
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}): React.ReactElement;
|
|
6
|
+
/** Where the lead block renders. Mount it once, inside `CanvasLeadProvider`. */
|
|
7
|
+
export declare function CanvasLeadSlot({ className }: {
|
|
8
|
+
className?: string;
|
|
9
|
+
}): React.ReactElement;
|
|
10
|
+
/** For the brand shell: whether the page on canvas has a lead block in its slot. */
|
|
11
|
+
export declare function useCanvasLead(): {
|
|
12
|
+
present: boolean;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* For the engine: the lead types and slot, and a way to say which block leads.
|
|
16
|
+
* Outside a `CanvasLeadProvider` there are no lead types — every block stays in
|
|
17
|
+
* the flow.
|
|
18
|
+
*/
|
|
19
|
+
export declare function useCanvasLeadTarget(): {
|
|
20
|
+
types: readonly string[];
|
|
21
|
+
target: HTMLElement | null;
|
|
22
|
+
report: (id: string | null) => void;
|
|
23
|
+
};
|
|
@@ -7,6 +7,7 @@ export { GenerationStyleContext, GenerationStyleProvider, useGenerationStyle, }
|
|
|
7
7
|
export { ShimmerSweep, type ShimmerSweepProps } from './ShimmerSweep';
|
|
8
8
|
export { FadeTransition, TransitionProvider, useLayoutTransition, type LayoutTransitionItemProps, type LayoutTransitionGroupProps, type LayoutTransition, } from './TransitionContext';
|
|
9
9
|
export { CanvasArrangementProvider, useCanvasArrangement, type CanvasArrangementValue } from './canvas-arrangement';
|
|
10
|
+
export { CanvasLeadProvider, CanvasLeadSlot, useCanvasLead, useCanvasLeadTarget } from './canvas-lead';
|
|
10
11
|
export { CanvasMotionStyleProvider, useCanvasMotionStyle, type CanvasMotionStyle } from './canvas-motion-style';
|
|
11
12
|
export { ElementIdContext, useElementId } from './ElementIdContext';
|
|
12
13
|
export { buildEntranceProps, type EntranceMotionProps } from './generation-entrance';
|
|
@@ -72,6 +72,30 @@ export declare const HOST_MODULES: {
|
|
|
72
72
|
useShellRoot: typeof sdk.useShellRoot;
|
|
73
73
|
DockPersistenceProvider: typeof sdk.DockPersistenceProvider;
|
|
74
74
|
useDockPersistence: typeof sdk.useDockPersistence;
|
|
75
|
+
BotCheckNoticeProvider: typeof sdk.BotCheckNoticeProvider;
|
|
76
|
+
BotCheckNoticeSchema: zod.ZodObject<{
|
|
77
|
+
segments: zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodObject<{
|
|
78
|
+
text: zod.ZodString;
|
|
79
|
+
href: zod.ZodString;
|
|
80
|
+
}, "strip", zod.ZodTypeAny, {
|
|
81
|
+
text: string;
|
|
82
|
+
href: string;
|
|
83
|
+
}, {
|
|
84
|
+
text: string;
|
|
85
|
+
href: string;
|
|
86
|
+
}>]>, "many">;
|
|
87
|
+
}, "strip", zod.ZodTypeAny, {
|
|
88
|
+
segments: (string | {
|
|
89
|
+
text: string;
|
|
90
|
+
href: string;
|
|
91
|
+
})[];
|
|
92
|
+
}, {
|
|
93
|
+
segments: (string | {
|
|
94
|
+
text: string;
|
|
95
|
+
href: string;
|
|
96
|
+
})[];
|
|
97
|
+
}>;
|
|
98
|
+
useBotCheckNotice: typeof sdk.useBotCheckNotice;
|
|
75
99
|
useDockState: typeof sdk.useDockState;
|
|
76
100
|
registerExclusiveOverlay: typeof sdk.registerExclusiveOverlay;
|
|
77
101
|
claimExclusiveOverlay: typeof sdk.claimExclusiveOverlay;
|
|
@@ -95,9 +119,12 @@ export declare const HOST_MODULES: {
|
|
|
95
119
|
useThreadLanding: typeof sdk.useThreadLanding;
|
|
96
120
|
THREAD_ROW_ATTR: "data-fourty-thread-row";
|
|
97
121
|
threadRowAttrs: typeof sdk.threadRowAttrs;
|
|
122
|
+
takeSubmitOrigin: typeof sdk.takeSubmitOrigin;
|
|
123
|
+
useWaitingSubmitOrigin: typeof sdk.useWaitingSubmitOrigin;
|
|
98
124
|
useConversationPage: typeof sdk.useConversationPage;
|
|
99
125
|
useConversationPresence: typeof sdk.useConversationPresence;
|
|
100
126
|
splitAnswer: typeof sdk.splitAnswer;
|
|
127
|
+
withoutClosingQuestion: typeof sdk.withoutClosingQuestion;
|
|
101
128
|
useRegisterSignalHandlers: typeof sdk.useRegisterSignalHandlers;
|
|
102
129
|
HandlerRegistryContext: react.Context<sdk.HandlerRegistryValue | null>;
|
|
103
130
|
AGENT_ASK_SIGNAL: "agent_ask";
|
|
@@ -151,6 +178,10 @@ export declare const HOST_MODULES: {
|
|
|
151
178
|
useLayoutTransition: typeof sdk.useLayoutTransition;
|
|
152
179
|
CanvasArrangementProvider: typeof sdk.CanvasArrangementProvider;
|
|
153
180
|
useCanvasArrangement: typeof sdk.useCanvasArrangement;
|
|
181
|
+
CanvasLeadProvider: typeof sdk.CanvasLeadProvider;
|
|
182
|
+
CanvasLeadSlot: typeof sdk.CanvasLeadSlot;
|
|
183
|
+
useCanvasLead: typeof sdk.useCanvasLead;
|
|
184
|
+
useCanvasLeadTarget: typeof sdk.useCanvasLeadTarget;
|
|
154
185
|
CanvasMotionStyleProvider: typeof sdk.CanvasMotionStyleProvider;
|
|
155
186
|
useCanvasMotionStyle: typeof sdk.useCanvasMotionStyle;
|
|
156
187
|
ElementIdContext: react.Context<string | null>;
|
|
@@ -350,6 +381,7 @@ export declare const HOST_MODULES: {
|
|
|
350
381
|
useCollectionByHandle: typeof sdk.useCollectionByHandle;
|
|
351
382
|
useProductReviews: typeof sdk.useProductReviews;
|
|
352
383
|
useCustomerAccount: typeof sdk.useCustomerAccount;
|
|
384
|
+
useInstallmentOffer: typeof sdk.useInstallmentOffer;
|
|
353
385
|
useCommerceRuntime: typeof sdk.useCommerceRuntime;
|
|
354
386
|
FourtyCommerceRuntimeProvider: react.Provider<sdk.FourtyCommerceRuntime>;
|
|
355
387
|
navigateToExternalCommerceUrl: typeof sdk.navigateToExternalCommerceUrl;
|
|
@@ -1131,6 +1163,8 @@ export declare const HOST_MODULES: {
|
|
|
1131
1163
|
EXTEND_FLOW: "extend.status";
|
|
1132
1164
|
DIRECTION_FLOW: "direction.standing";
|
|
1133
1165
|
EPHEMERAL_FACT_FLOWS: readonly string[];
|
|
1166
|
+
CHIP_SHOW_SIGNAL: "chip.show";
|
|
1167
|
+
chipsFromShowSignal: typeof spacestation.chipsFromShowSignal;
|
|
1134
1168
|
TURN_ASK_SIGNAL: "turn.ask";
|
|
1135
1169
|
TurnAskSchema: zod.ZodUnion<[zod.ZodEffects<zod.ZodEffects<zod.ZodObject<{
|
|
1136
1170
|
kind: zod.ZodEnum<["choice", "open"]>;
|
|
@@ -4744,6 +4778,8 @@ export declare const HOST_MODULES: {
|
|
|
4744
4778
|
resolveStoreThemeSource: typeof ecommerce.resolveStoreThemeSource;
|
|
4745
4779
|
clearStoreThemeSources: typeof ecommerce.clearStoreThemeSources;
|
|
4746
4780
|
StoreThemeAccessError: typeof ecommerce.StoreThemeAccessError;
|
|
4781
|
+
installmentOffer: typeof ecommerce.installmentOffer;
|
|
4782
|
+
installmentPayment: typeof ecommerce.installmentPayment;
|
|
4747
4783
|
orderedVideoSources(video: ecommerce.ProductVideo): ecommerce.VideoSource[];
|
|
4748
4784
|
createUnavailableProduct(gid: string): ecommerce.Product;
|
|
4749
4785
|
isGhostEntity(value: unknown): boolean;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { BotCheckNoticeSchema, type BotCheckNotice } from '../../../spacestation/src/index';
|
|
3
|
+
export { BotCheckNoticeSchema, type BotCheckNotice };
|
|
4
|
+
export declare function BotCheckNoticeProvider({ value, children, }: {
|
|
5
|
+
value: BotCheckNotice | null;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}): React.ReactElement;
|
|
8
|
+
/** The notice a brand footer renders, or `null` when this page runs no bot check. */
|
|
9
|
+
export declare function useBotCheckNotice(): BotCheckNotice | null;
|
|
@@ -13,3 +13,10 @@ export interface AnswerText {
|
|
|
13
13
|
* headline line (or sentence) closes it is all headline.
|
|
14
14
|
*/
|
|
15
15
|
export declare function splitAnswer(prose: string): AnswerText;
|
|
16
|
+
/**
|
|
17
|
+
* The body without a closing question — for a turn whose question is already
|
|
18
|
+
* its own line (`turn.ask`): the prose is told never to end on one, and when it
|
|
19
|
+
* does anyway the page would ask the same thing twice. Only a question that is
|
|
20
|
+
* the body's LAST sentence goes; one mid-body is part of the answer.
|
|
21
|
+
*/
|
|
22
|
+
export declare function withoutClosingQuestion(body: string): string;
|
|
@@ -2,4 +2,4 @@ export { useConversationPage } from './use-conversation-page';
|
|
|
2
2
|
export type { ConversationPage, ConversationCrumb, ConversationPhase, ConversationPlace, ConversationTurn } from './use-conversation-page';
|
|
3
3
|
export { useConversationPresence } from './use-conversation-presence';
|
|
4
4
|
export type { ConversationActivity, ConversationFact, ConversationPresence } from './use-conversation-presence';
|
|
5
|
-
export { splitAnswer, type AnswerText } from './answer-text';
|
|
5
|
+
export { splitAnswer, withoutClosingQuestion, type AnswerText } from './answer-text';
|
|
@@ -2,6 +2,7 @@ export { ScrollContainerProvider, useScrollContainerRef, type ScrollContainerRef
|
|
|
2
2
|
export { ShellRegistryProvider, useShellRegistry, type ShellComponentProps, type ShellComponent, type ShellRegistry, } from './ShellRegistry';
|
|
3
3
|
export { ShellRootContext, useShellRoot } from './ShellRootContext';
|
|
4
4
|
export { DockPersistenceProvider, useDockPersistence, type DockPersistence, } from './dock-persistence';
|
|
5
|
+
export { BotCheckNoticeProvider, BotCheckNoticeSchema, useBotCheckNotice, type BotCheckNotice, } from './bot-check-notice';
|
|
5
6
|
export { useDockState, type ShellDockState } from './use-dock-state';
|
|
6
7
|
export { registerExclusiveOverlay, claimExclusiveOverlay, useExclusiveOverlay, } from './exclusive-overlay';
|
|
7
8
|
export { useComposerAttachments, ATTACHMENT_ACCEPT, type AttachmentStatus, type ComposerAttachmentsApi, type ComposerAttachment, } from './composer-attachments/use-composer-attachments';
|
|
@@ -16,3 +17,4 @@ export { useOverridableToggle, type OverridableToggle } from './use-overridable-
|
|
|
16
17
|
export { useThreadRows, type ThreadRow, type ThreadRows } from './use-thread-rows';
|
|
17
18
|
export * from './conversation';
|
|
18
19
|
export { ThreadHeadroom, usePinTurnToTop, useScrollHasMoreBelow, useThreadJumpMarks, useThreadLanding, THREAD_ROW_ATTR, threadRowAttrs, type PinTurnToTopOptions, type ThreadJumpMark, } from './thread-scroll';
|
|
20
|
+
export { takeSubmitOrigin, useWaitingSubmitOrigin, type SubmitOrigin } from './submit-origin';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where the visitor's words WERE when they sent them — so the answer can take
|
|
3
|
+
* them from the composer into its own place instead of the sentence appearing
|
|
4
|
+
* twice, once in the box and once on the page (a shared-element move).
|
|
5
|
+
*
|
|
6
|
+
* The composer notes it at send (`usePromptComposer({ origin })`); the shell
|
|
7
|
+
* that shows the turn takes it once, for the question it is about to show.
|
|
8
|
+
* Only a send seconds ago counts, and only for the same words, so a restored
|
|
9
|
+
* or later turn never flies in from a composer that has moved on.
|
|
10
|
+
*
|
|
11
|
+
* Between the send and the take, a composer keeps the words on screen where
|
|
12
|
+
* they were (`useWaitingSubmitOrigin`), so they never blink out while the
|
|
13
|
+
* answer mounts.
|
|
14
|
+
*/
|
|
15
|
+
export interface SubmitOrigin {
|
|
16
|
+
text: string;
|
|
17
|
+
/** The TEXT's box in the viewport at send (the field less its padding), in CSS px. */
|
|
18
|
+
rect: {
|
|
19
|
+
left: number;
|
|
20
|
+
top: number;
|
|
21
|
+
width: number;
|
|
22
|
+
height: number;
|
|
23
|
+
};
|
|
24
|
+
/** The words' computed font size at send, in CSS px. */
|
|
25
|
+
fontSizePx: number;
|
|
26
|
+
/** Their computed line height, in CSS px. */
|
|
27
|
+
lineHeightPx: number;
|
|
28
|
+
/** Their computed font family and colour, so a copy of them reads as them. */
|
|
29
|
+
fontFamily: string;
|
|
30
|
+
color: string;
|
|
31
|
+
}
|
|
32
|
+
export declare function noteSubmitOrigin(text: string, el: HTMLElement): void;
|
|
33
|
+
/** The origin of `text`'s send, once — null when it was not just sent from a composer. */
|
|
34
|
+
export declare function takeSubmitOrigin(text: string): SubmitOrigin | null;
|
|
35
|
+
/**
|
|
36
|
+
* The words just sent, while no shell has taken them yet — a composer draws
|
|
37
|
+
* them where they were, so the sentence holds still until the answer lifts it.
|
|
38
|
+
* Null once taken, and once the send is too old to be.
|
|
39
|
+
*/
|
|
40
|
+
export declare function useWaitingSubmitOrigin(): SubmitOrigin | null;
|
|
@@ -10,6 +10,12 @@ export interface UsePromptComposerOptions {
|
|
|
10
10
|
* harmless) since hooks can't be conditional.
|
|
11
11
|
*/
|
|
12
12
|
attachments?: ComposerAttachmentsApi;
|
|
13
|
+
/**
|
|
14
|
+
* The element showing the draft — noted at send (`submit-origin.ts`) so the
|
|
15
|
+
* turn can move the visitor's words from here into its own place. Omit and
|
|
16
|
+
* the turn shows them in place, without the move.
|
|
17
|
+
*/
|
|
18
|
+
origin?: React.RefObject<HTMLElement | null>;
|
|
13
19
|
}
|
|
14
20
|
export interface UsePromptComposerApi {
|
|
15
21
|
/** Current draft text. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Product } from '../../../../ecommerce/src/index';
|
|
1
|
+
import type { InstallmentOffer, Money, Product } from '../../../../ecommerce/src/index';
|
|
2
2
|
export type { AddToCartApi, CartAddHints, CartAddOptions, CartApi, CustomerAccountApi, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
|
|
3
3
|
import type { AddToCartApi, CartAddHints, CartApi, CustomerAccountApi, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi } from './commerce-shapes';
|
|
4
4
|
/**
|
|
@@ -29,6 +29,8 @@ export interface FourtyCommerceRuntime {
|
|
|
29
29
|
* description, so the hook needs that context, not just the id. */
|
|
30
30
|
useProductReviews: (product: Product | undefined, intent?: string) => ProductReviewsResult;
|
|
31
31
|
useCustomerAccount: () => CustomerAccountApi;
|
|
32
|
+
/** What `price` qualifies for under the store's pay-over-time plans. */
|
|
33
|
+
useInstallmentOffer: (price: Money) => InstallmentOffer | undefined;
|
|
32
34
|
}
|
|
33
35
|
/**
|
|
34
36
|
* Provider for the commerce-hook surface. Mounted by the SDK's
|
|
@@ -64,3 +66,9 @@ export declare function useProductReviews(product: Product | undefined, intent?:
|
|
|
64
66
|
/** The visitor's sign-in to the store's customer accounts. Inert (not
|
|
65
67
|
* available) without a `<CommerceProvider>`. */
|
|
66
68
|
export declare function useCustomerAccount(): CustomerAccountApi;
|
|
69
|
+
/** What `price` qualifies for under the store's pay-over-time plans —
|
|
70
|
+
* `{ plans, split, lowestMonthly }`, each term priced to the cent. Undefined
|
|
71
|
+
* while the plans load, when the store offers none (or has not granted the
|
|
72
|
+
* read), when `price` is outside every plan's band, and without a
|
|
73
|
+
* `<CommerceProvider>`. */
|
|
74
|
+
export declare function useInstallmentOffer(price: Money): InstallmentOffer | undefined;
|
|
@@ -183,7 +183,8 @@ export interface CustomerAccountApi {
|
|
|
183
183
|
signIn: () => void;
|
|
184
184
|
/** Drop this session's sign-in. */
|
|
185
185
|
signOut: () => Promise<void>;
|
|
186
|
-
/** False where the page has no customer sign-in to offer
|
|
187
|
-
*
|
|
186
|
+
/** False where the page has no customer sign-in to offer: the space has not
|
|
187
|
+
* attached Customer Accounts (so its agent could not read the account), no
|
|
188
|
+
* session yet, or a space addressed by id, as in a console preview. */
|
|
188
189
|
available: boolean;
|
|
189
190
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import './chip-relevance';
|
|
2
|
-
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
2
|
+
export { useCart, useAddToCart, useWishlist, useToggleWishlist, useProducts, useCollectionByHandle, useProductReviews, useCustomerAccount, useInstallmentOffer, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
|
|
3
3
|
export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, CartAddOptions, CartAddHints, WishlistState, } from './commerce-context';
|
|
4
4
|
export { navigateToExternalCommerceUrl } from './checkout/external-navigation';
|
|
5
5
|
export type { ExternalNavigationResult } from './checkout/external-navigation';
|
|
@@ -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 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
|
+
export { CHIP_SHOW_SIGNAL, chipsFromShowSignal } from './signal/chip-show';
|
|
16
17
|
export { TURN_ASK_SIGNAL, TurnAskSchema, turnAskFromSignal, turnAskSegments, turnAskAnswers, turnAskPlainText, type TurnAsk, type TurnAskSegment } from './signal/turn-ask';
|
|
17
18
|
export { type TraceSpanData, type TraceData, type Trace, type TraceLatency, type TraceEventLogEntry, type LayoutChangeEntry, } from './trace/trace-data';
|
|
18
19
|
export { type TraceSnapshotEnvelope, type SystemPromptSnapshotEnvelope, type LayoutSnapshotEnvelope, type SuggestionsSnapshotEnvelope, type TurnSnapshotEnvelope, type AssemblyInputsEnvelope, type AssemblyInputComponent, type AssemblyInputTool, type AssemblyInputPrompt, } from './trace/trace-envelopes';
|
|
@@ -53,6 +54,7 @@ export type { HostedApp, SpaceConfig, SpaceWithConfig, VisitorAccess } from './s
|
|
|
53
54
|
export type { ConnectorDescriptor, ConnectorFieldDescriptor } from './space/connector';
|
|
54
55
|
export { AgentDirectiveSchema, SpaceAgentDirectiveSchema, SpaceAgentDirectiveListItemSchema, UpdateAgentDirectiveInputSchema, ReorderAgentDirectivesInputSchema, AGENT_DIRECTIVE_KINDS, AGENT_DIRECTIVE_SEVERITIES, AGENT_DIRECTIVE_SOURCES, AGENT_DIRECTIVE_STATUSES, MAX_ACTIVE_AGENT_DIRECTIVES, } from './space/agent-directive';
|
|
55
56
|
export type { AgentDirective, SpaceAgentDirective, SpaceAgentDirectiveListItem, UpdateAgentDirectiveInput, } from './space/agent-directive';
|
|
57
|
+
export { BotCheckNoticeSchema, type BotCheckNotice } from './shell/bot-check-notice';
|
|
56
58
|
export { DEFAULT_SPACE_LOCALE, SpaceLocaleSchema, textDirectionOf, languageOf, languageNameOf, spaceLocaleOf, declaredSpaceLocaleOf, SUPPORTED_SPACE_LOCALES, } from './space/space-locale';
|
|
57
59
|
export type { TextDirection } from './space/space-locale';
|
|
58
60
|
export { DEFAULT_SPACE_CONFIG, DEFAULT_VISITOR_ACCESS, VISITOR_ACCESS, visitorAccessOf, } from './space/space-config';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The bot check's disclosure a spacefront shows — words and links the host
|
|
4
|
+
* supplies and a brand's footer renders (`useBotCheckNotice` in the sdk).
|
|
5
|
+
*
|
|
6
|
+
* The platform checks every spacefront visitor with an invisible bot check
|
|
7
|
+
* (reCAPTCHA Enterprise today). Its provider floats a badge over the page
|
|
8
|
+
* unless the page carries the provider's notice itself, and a brand's own
|
|
9
|
+
* chrome is the only place on the page that can carry it.
|
|
10
|
+
*/
|
|
11
|
+
export declare const BotCheckNoticeSchema: z.ZodObject<{
|
|
12
|
+
/** Read in order: plain text, and links the notice must keep linked. */
|
|
13
|
+
segments: z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodObject<{
|
|
14
|
+
text: z.ZodString;
|
|
15
|
+
href: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
text: string;
|
|
18
|
+
href: string;
|
|
19
|
+
}, {
|
|
20
|
+
text: string;
|
|
21
|
+
href: string;
|
|
22
|
+
}>]>, "many">;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
segments: (string | {
|
|
25
|
+
text: string;
|
|
26
|
+
href: string;
|
|
27
|
+
})[];
|
|
28
|
+
}, {
|
|
29
|
+
segments: (string | {
|
|
30
|
+
text: string;
|
|
31
|
+
href: string;
|
|
32
|
+
})[];
|
|
33
|
+
}>;
|
|
34
|
+
export type BotCheckNotice = z.infer<typeof BotCheckNoticeSchema>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type AgentSignal, type SuggestionAction } from './agent-signals';
|
|
2
|
+
/** The follow-up rail a turn closes with — one `/signals/chip.show` fence line. */
|
|
3
|
+
export declare const CHIP_SHOW_SIGNAL = "chip.show";
|
|
4
|
+
/**
|
|
5
|
+
* Validate a `chip.show` signal payload and return the chip array.
|
|
6
|
+
* Returns null when the signal isn't `chip.show` or the payload doesn't
|
|
7
|
+
* match the strict chip shape (id+label+type+payload required). One reader for
|
|
8
|
+
* both ends: the client shows the rail, the agent persists it for a restore.
|
|
9
|
+
*/
|
|
10
|
+
export declare function chipsFromShowSignal(signal: AgentSignal): SuggestionAction[] | null;
|
|
@@ -57,6 +57,10 @@ export interface SpaceConfig {
|
|
|
57
57
|
* every page it measures, so it is the other config key besides
|
|
58
58
|
* `componentSources` the public projection may carry. */
|
|
59
59
|
facebookPixelId?: string;
|
|
60
|
+
/** The brand's OWN Google Tag Manager container id (`GTM-XXXXXXX`), loaded on
|
|
61
|
+
* their spacefront. Absent = no container on this spacefront. Same
|
|
62
|
+
* publication rule as `googleAnalyticsId`. */
|
|
63
|
+
googleTagManagerId?: string;
|
|
60
64
|
/** The language this space speaks (BCP 47, e.g. `he-IL`) — agent output, UI
|
|
61
65
|
* chrome, direction and formatting all follow it. Absent ⇒ `en-US`. Public
|
|
62
66
|
* by design: the page renders in it. See `space-locale.ts`. */
|