@40rty/ams-sdk 0.5.17 → 0.5.19

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.
@@ -1817,6 +1817,55 @@ export declare const CartSchema: z.ZodObject<{
1817
1817
  storeCartUrl?: string | undefined;
1818
1818
  }>;
1819
1819
  export type Cart = z.infer<typeof CartSchema>;
1820
+ /**
1821
+ * One store's checkout for its share of a cart that spans several stores —
1822
+ * what `CommerceAdapter.createStoreCheckouts` answers, one entry per seller.
1823
+ *
1824
+ * A single-store cart exits through `Cart.checkoutUrl`; a marketplace cart
1825
+ * (lines from many sellers, as on the cross-merchant catalog) has no one place
1826
+ * to be paid, so each seller's lines get their own checkout. `ready` carries
1827
+ * the page where the visitor reviews and pays for that store's lines; `failed`
1828
+ * says why that store gave none, so a surface names it instead of dropping it.
1829
+ */
1830
+ export type StoreCheckout = {
1831
+ status: 'ready';
1832
+ seller: string;
1833
+ lineIds: string[];
1834
+ checkoutUrl: string;
1835
+ } | {
1836
+ status: 'failed';
1837
+ seller: string;
1838
+ lineIds: string[];
1839
+ reason: string;
1840
+ };
1841
+ /**
1842
+ * A store's own answer to a visitor's question about one of its products —
1843
+ * what `CommerceAdapter.askStore` returns. It is the STORE's statement (its
1844
+ * policies, its listing), never a fact the platform checked, so a surface
1845
+ * credits it to `seller`.
1846
+ */
1847
+ export interface StoreAnswer {
1848
+ seller: string;
1849
+ answer: string;
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
+ };
1820
1869
  /** The backend-accepted cart, or null when all we hold is an optimistic
1821
1870
  * paint. The single predicate for "is there a cart id the backend knows?" —
1822
1871
  * every cart mutation needs it before it can talk to the backend. */
@@ -11,6 +11,8 @@ 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 { registerShopCheckout, resolveShopCheckout, clearShopCheckouts, type ShopCheckoutLine, type ShopCheckoutMaker, type ShopCheckoutFactory, } from './shop-checkout';
14
16
  export { registerCodeDiscountSource, resolveCodeDiscountSource, clearCodeDiscountSources, type CodeDiscountSource, type CodeDiscountSourceFactory, type CodeDiscountTerms, type StoreCodeDiscount, } from './code-discounts';
15
17
  export { registerStoreThemeSource, resolveStoreThemeSource, clearStoreThemeSources, StoreThemeAccessError, type StoreThemeSource, type StoreThemeSourceFactory, type StoreThemeFile, type StoreThemeFilesPage, type StoreThemeProduct, } from './store-theme';
16
18
  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); the engine
13
- * reads it. The agent is unaware of it.
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;
@@ -381,6 +388,11 @@ export declare const HOST_MODULES: {
381
388
  useProductReviews: typeof sdk.useProductReviews;
382
389
  useCustomerAccount: typeof sdk.useCustomerAccount;
383
390
  useInstallmentOffer: typeof sdk.useInstallmentOffer;
391
+ useStoreCheckouts: typeof sdk.useStoreCheckouts;
392
+ useAskStore: typeof sdk.useAskStore;
393
+ useStoreArticles: typeof sdk.useStoreArticles;
394
+ useShopCheckout: typeof sdk.useShopCheckout;
395
+ useProductSearch: typeof sdk.useProductSearch;
384
396
  useCommerceRuntime: typeof sdk.useCommerceRuntime;
385
397
  FourtyCommerceRuntimeProvider: react.Provider<sdk.FourtyCommerceRuntime>;
386
398
  navigateToExternalCommerceUrl: typeof sdk.navigateToExternalCommerceUrl;
@@ -1164,6 +1176,83 @@ export declare const HOST_MODULES: {
1164
1176
  EPHEMERAL_FACT_FLOWS: readonly string[];
1165
1177
  CHIP_SHOW_SIGNAL: "chip.show";
1166
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
+ }>;
1167
1256
  TURN_ASK_SIGNAL: "turn.ask";
1168
1257
  TurnAskSchema: zod.ZodUnion<[zod.ZodEffects<zod.ZodEffects<zod.ZodEffects<zod.ZodObject<{
1169
1258
  kind: zod.ZodEnum<["choice", "open"]>;
@@ -3247,16 +3336,16 @@ export declare const HOST_MODULES: {
3247
3336
  createdAt: zod.ZodString;
3248
3337
  }, "strip", zod.ZodTypeAny, {
3249
3338
  id: string;
3339
+ note: string | null;
3250
3340
  createdAt: string;
3251
3341
  verdict: "viewed" | "bug";
3252
3342
  reviewer: string;
3253
- note: string | null;
3254
3343
  }, {
3255
3344
  id: string;
3345
+ note: string | null;
3256
3346
  createdAt: string;
3257
3347
  verdict: "viewed" | "bug";
3258
3348
  reviewer: string;
3259
- note: string | null;
3260
3349
  }>;
3261
3350
  BugSeveritySchema: zod.ZodEnum<["high", "medium", "low"]>;
3262
3351
  BugLocationSchema: zod.ZodEffects<zod.ZodObject<{
@@ -4181,16 +4270,16 @@ export declare const HOST_MODULES: {
4181
4270
  createdAt: zod.ZodString;
4182
4271
  }, "strip", zod.ZodTypeAny, {
4183
4272
  id: string;
4273
+ note: string | null;
4184
4274
  createdAt: string;
4185
4275
  verdict: "viewed" | "bug";
4186
4276
  reviewer: string;
4187
- note: string | null;
4188
4277
  }, {
4189
4278
  id: string;
4279
+ note: string | null;
4190
4280
  createdAt: string;
4191
4281
  verdict: "viewed" | "bug";
4192
4282
  reviewer: string;
4193
- note: string | null;
4194
4283
  }>, "many">;
4195
4284
  bugs: zod.ZodArray<zod.ZodObject<{
4196
4285
  id: zod.ZodString;
@@ -4449,10 +4538,10 @@ export declare const HOST_MODULES: {
4449
4538
  };
4450
4539
  reviews: {
4451
4540
  id: string;
4541
+ note: string | null;
4452
4542
  createdAt: string;
4453
4543
  verdict: "viewed" | "bug";
4454
4544
  reviewer: string;
4455
- note: string | null;
4456
4545
  }[];
4457
4546
  bugs: {
4458
4547
  id: string;
@@ -4547,10 +4636,10 @@ export declare const HOST_MODULES: {
4547
4636
  };
4548
4637
  reviews: {
4549
4638
  id: string;
4639
+ note: string | null;
4550
4640
  createdAt: string;
4551
4641
  verdict: "viewed" | "bug";
4552
4642
  reviewer: string;
4553
- note: string | null;
4554
4643
  }[];
4555
4644
  bugs: {
4556
4645
  id: string;
@@ -4791,6 +4880,12 @@ export declare const HOST_MODULES: {
4791
4880
  registerProductNameLookup: typeof ecommerce.registerProductNameLookup;
4792
4881
  resolveProductNameLookup: typeof ecommerce.resolveProductNameLookup;
4793
4882
  clearProductNameLookups: typeof ecommerce.clearProductNameLookups;
4883
+ registerStoreArticleLookup: typeof ecommerce.registerStoreArticleLookup;
4884
+ resolveStoreArticleLookup: typeof ecommerce.resolveStoreArticleLookup;
4885
+ clearStoreArticleLookups: typeof ecommerce.clearStoreArticleLookups;
4886
+ registerShopCheckout: typeof ecommerce.registerShopCheckout;
4887
+ resolveShopCheckout: typeof ecommerce.resolveShopCheckout;
4888
+ clearShopCheckouts: typeof ecommerce.clearShopCheckouts;
4794
4889
  registerCodeDiscountSource: typeof ecommerce.registerCodeDiscountSource;
4795
4890
  resolveCodeDiscountSource: typeof ecommerce.resolveCodeDiscountSource;
4796
4891
  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, ProductReviewHighlight, ProductReviewItem, ProductReviewsResult, ProductsQuery, ToggleWishlistApi, WishlistApi, WishlistState, } from './commerce-shapes';
3
- import type { AddToCartApi, CartAddHints, CartApi, CustomerAccountApi, 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
@@ -31,6 +31,16 @@ export interface FourtyCommerceRuntime {
31
31
  useCustomerAccount: () => CustomerAccountApi;
32
32
  /** What `price` qualifies for under the store's pay-over-time plans. */
33
33
  useInstallmentOffer: (price: Money) => InstallmentOffer | undefined;
34
+ /** One checkout per store, for a cart that spans several. */
35
+ useStoreCheckouts: () => StoreCheckoutsApi;
36
+ /** A question put to the store that sells a product. */
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;
34
44
  }
35
45
  /**
36
46
  * Provider for the commerce-hook surface. Mounted by the SDK's
@@ -72,3 +82,24 @@ export declare function useCustomerAccount(): CustomerAccountApi;
72
82
  * read), when `price` is outside every plan's band, and without a
73
83
  * `<CommerceProvider>`. */
74
84
  export declare function useInstallmentOffer(price: Money): InstallmentOffer | undefined;
85
+ /** A cart that spans several stores, checked out one store at a time. Not
86
+ * available (and `create` rejects) on a single-store backend or without a
87
+ * `<CommerceProvider>`. */
88
+ export declare function useStoreCheckouts(): StoreCheckoutsApi;
89
+ /** Put a question to the store that sells a product; the answer is that
90
+ * store's own statement. Not available (and `ask` rejects) where the space is
91
+ * the only store, or without a `<CommerceProvider>`. */
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 } 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,
@@ -188,3 +188,65 @@ export interface CustomerAccountApi {
188
188
  * session yet, or a space addressed by id, as in a console preview. */
189
189
  available: boolean;
190
190
  }
191
+ /** Return shape of `useStoreCheckouts` — a cart that spans several stores,
192
+ * checked out one store at a time (`CommerceAdapter.createStoreCheckouts`). */
193
+ export interface StoreCheckoutsApi {
194
+ /** False where the backend's cart belongs to one store — that cart exits
195
+ * through `cart.checkoutUrl` (`useCartView().handleCheckout`) instead. */
196
+ available: boolean;
197
+ /** Make one checkout per store in the cart. Places no order; each `ready`
198
+ * entry's `checkoutUrl` is where the visitor pays for that store's lines. */
199
+ create: () => Promise<StoreCheckout[]>;
200
+ /** True while `create` is in flight. */
201
+ pending: boolean;
202
+ }
203
+ /** Return shape of `useAskStore` — a question put to the store that sells a
204
+ * product (`CommerceAdapter.askStore`). The answer is that store's own
205
+ * statement, so a surface credits it to `seller`. */
206
+ export interface AskStoreApi {
207
+ /** False where the space is the only store — there is no one else to ask. */
208
+ available: boolean;
209
+ ask: (productId: string, question: string) => Promise<StoreAnswer>;
210
+ /** True while `ask` is in flight. */
211
+ pending: boolean;
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, useCommerceRuntime, FourtyCommerceRuntimeProvider, } from './commerce-context';
3
- export type { FourtyCommerceRuntime, CartApi, AddToCartApi, WishlistApi, ToggleWishlistApi, ProductsQuery, ProductReviewItem, ProductReviewHighlight, ProductReviewsResult, CustomerAccountApi, 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';
@@ -15,6 +15,13 @@ import type { VisitorLocation, EntityKind } from '../../types';
15
15
  * agent run (e.g. preflight cache warmup, eval harnesses) — tools
16
16
  * that need the channel must guard with `if (context.emit) ...`.
17
17
  */
18
+ /** A file the visitor attached to THIS turn, as the session's own storage
19
+ * returned it (never fetched from a visitor-supplied URL). */
20
+ export interface TurnAttachment {
21
+ id: string;
22
+ mimeType: string;
23
+ bytes: Uint8Array;
24
+ }
18
25
  export interface ToolExecutionContext {
19
26
  visitorId: string;
20
27
  sessionId: string;
@@ -93,6 +100,10 @@ export interface ToolExecutionContext {
93
100
  * an optimisation and stay correct without it.
94
101
  */
95
102
  primeEntities?: (resolverKey: string, byRef: Record<string, unknown>) => void;
103
+ /** The files the visitor attached to this turn — the same ones the model
104
+ * sees as image/file parts — for a tool whose backend takes the file itself
105
+ * (search by photo). Absent when the turn carries none. */
106
+ attachments?: ReadonlyArray<TurnAttachment>;
96
107
  /** Coarse IP-derived geolocation captured at session bind. Available
97
108
  * to location-aware tools (storeLocator, nearest-pickup, regional
98
109
  * policy). Absent when the route had no IP or geoip returned no
@@ -6,4 +6,4 @@
6
6
  * as shims; runtime-coupled tool types (`ResolvedToolSet`, `ToolManifest`,
7
7
  * `ValidationResult`) stay in `@fourty/agent`.
8
8
  */
9
- export type { McpToolDescriptor, ToolCategory, ToolTransport, FourtyToolDefDescriptor, FourtyToolDef, ToolExecutionContext, FourtyToolPackageManifest, FourtyToolPackageDescriptor, FourtyToolPackage, ToolPackageProvider, DefineToolOptions, } from './types';
9
+ export type { McpToolDescriptor, ToolCategory, ToolTransport, FourtyToolDefDescriptor, FourtyToolDef, ToolExecutionContext, TurnAttachment, FourtyToolPackageManifest, FourtyToolPackageDescriptor, FourtyToolPackage, ToolPackageProvider, DefineToolOptions, } from './types';
@@ -17,7 +17,7 @@ import type { ZodTypeAny } from 'zod';
17
17
  import type { FourtyToolDef, FourtyToolDefDescriptor, ToolCategory } from './definitions';
18
18
  import type { ToolExecutionContext } from './execution-context';
19
19
  export type { McpToolDescriptor, ToolCategory, ToolTransport, FourtyToolDefDescriptor, FourtyToolDef } from './definitions';
20
- export type { ToolExecutionContext } from './execution-context';
20
+ export type { ToolExecutionContext, TurnAttachment } from './execution-context';
21
21
  /**
22
22
  * Tool package manifest — metadata about who ships this tool collection.
23
23
  * Mirrors FourtyPackageManifest.
@@ -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';