@40rty/ams-sdk 0.5.21 → 0.5.23
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 +909 -654
- package/dist/types/ecommerce/src/buyer-sign-in.d.ts +2 -0
- package/dist/types/ecommerce/src/index.d.ts +1 -0
- package/dist/types/ecommerce/src/product-sections.d.ts +41 -0
- package/dist/types/sdk/src/canvas/index.d.ts +1 -1
- package/dist/types/sdk/src/canvas/runtime-hooks.d.ts +4 -0
- package/dist/types/sdk/src/canvas/runtime-types.d.ts +3 -0
- package/dist/types/sdk/src/client-state/index.d.ts +1 -1
- package/dist/types/sdk/src/client-state/server-store.d.ts +3 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +466 -26
- package/dist/types/sdk/src/session/FourtySessionContext.d.ts +7 -1
- package/dist/types/sdk/src/session/index.d.ts +2 -0
- package/dist/types/sdk/src/session/use-board.d.ts +19 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +4 -9
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +6 -0
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +3 -2
- package/dist/types/sdk/src/verticals/commerce/product-data-hooks.d.ts +12 -0
- package/dist/types/spacestation/src/analytics/ecommerce/funnel.d.ts +6 -2
- package/dist/types/spacestation/src/board/board.d.ts +427 -0
- package/dist/types/spacestation/src/contracts/session-arrival-params.d.ts +6 -0
- package/dist/types/spacestation/src/contracts/session-arrival.d.ts +9 -0
- package/dist/types/spacestation/src/contracts/wire-protocol.d.ts +7 -0
- package/dist/types/spacestation/src/index.d.ts +6 -4
- package/dist/types/spacestation/src/signal/agent-signals.d.ts +3 -0
- package/dist/types/spacestation/src/space/session-queue.d.ts +33 -18
- package/dist/types/spacestation/src/space/trace.d.ts +56 -4
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +14 -0
- package/dist/types/spacestation/src/widgets/presence/profile.d.ts +2 -2
- package/package.json +1 -1
|
@@ -14,6 +14,8 @@ export interface SignedInBuyer {
|
|
|
14
14
|
accessToken: string;
|
|
15
15
|
/** The visitor's email when the provider shares it. */
|
|
16
16
|
email: string | null;
|
|
17
|
+
/** The name the visitor goes by (their given name) when the provider shares it. */
|
|
18
|
+
name: string | null;
|
|
17
19
|
}
|
|
18
20
|
export interface BuyerSignIn extends SignedInBuyer {
|
|
19
21
|
/** How long the token lives: the stored sign-in expires with it. */
|
|
@@ -12,6 +12,7 @@ export { buildBaseAttributesConfig, readBaseAttributesConfig } from './base-attr
|
|
|
12
12
|
export { buildBucketLabelsConfig, readBucketLabelsConfig } from './bucket-labels';
|
|
13
13
|
export { registerProductNameLookup, resolveProductNameLookup, clearProductNameLookups, type ProductNameLookup, type ProductNameLookupFactory, type ProductNameMatch, } from './product-lookup';
|
|
14
14
|
export { buildProductFieldsConfig, readProductFieldsConfig, isDeclaredProductField, ProductFieldIdError, registerProductFieldReader, resolveProductFieldReader, registerProductFieldSource, resolveProductFieldSource, clearProductFieldReaders, type ProductFieldRef, type ProductFieldReader, type ProductFieldReaderFactory, type ProductFieldSourceFactory, } from './product-fields';
|
|
15
|
+
export { buildProductSectionsConfig, readProductSectionsConfig, registerProductSectionReader, resolveProductSectionReader, clearProductSectionReaders, PRODUCT_SECTION_MAX_CHARS, PRODUCT_SECTION_ID_PATTERN, type ProductSectionReader, type ProductSectionReaderFactory, } from './product-sections';
|
|
15
16
|
export { registerStoreArticleLookup, resolveStoreArticleLookup, clearStoreArticleLookups, type StoreArticle, type StoreArticleLookup, type StoreArticleLookupFactory, } from './store-articles';
|
|
16
17
|
export { registerCatalogSearch, resolveCatalogSearch, clearCatalogSearches, type CatalogSearch, type CatalogSearchFactory, type CatalogSearchInput, type CatalogSearchPage, } from './catalog-search';
|
|
17
18
|
export { registerShopCheckout, resolveShopCheckout, clearShopCheckouts, type ShopCheckoutLine, type ShopCheckoutMaker, type ShopCheckoutFactory, } from './shop-checkout';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store page SECTIONS a brand reads per product — markup the store's own theme
|
|
3
|
+
* renders on its product page (e.g. a deal block whose numbers live nowhere a
|
|
4
|
+
* storefront API exposes). The browser cannot fetch the store's page
|
|
5
|
+
* cross-origin, so the platform fetches the section on the SERVER. The sibling
|
|
6
|
+
* of `product-fields.ts`: together they are the product data a brand may read
|
|
7
|
+
* beyond the storefront API, and both are declared the same way:
|
|
8
|
+
*
|
|
9
|
+
* - The brand DECLARES the section ids it reads, as data in its own package
|
|
10
|
+
* (`BrandDefinition.config`, carried by its release).
|
|
11
|
+
* `buildProductSectionsConfig` writes that declaration,
|
|
12
|
+
* `readProductSectionsConfig` reads it back — this module is the one place
|
|
13
|
+
* that knows the key (architecture-invariants.md §VIII.1). A section no
|
|
14
|
+
* source declares is refused, so the route is not an open proxy.
|
|
15
|
+
* - Only PRODUCTS are read. A reader refuses any other id with
|
|
16
|
+
* `ProductFieldIdError`.
|
|
17
|
+
*
|
|
18
|
+
* The reader is INJECTED (§IX): a platform's bindings register a factory that
|
|
19
|
+
* recognises its own store options; the route never names a platform.
|
|
20
|
+
*/
|
|
21
|
+
/** The largest section body served, in characters. A reader refuses a bigger one rather than truncate markup. */
|
|
22
|
+
export declare const PRODUCT_SECTION_MAX_CHARS: number;
|
|
23
|
+
/** What a section id may look like — a theme section's file name. */
|
|
24
|
+
export declare const PRODUCT_SECTION_ID_PATTERN: RegExp;
|
|
25
|
+
/** Build the `config` blob a brand's `BrandDefinition` carries to declare the store page sections it reads. */
|
|
26
|
+
export declare function buildProductSectionsConfig(sectionIds: readonly string[]): Record<string, unknown>;
|
|
27
|
+
/**
|
|
28
|
+
* The section ids a source declares, or `undefined` when its config declares
|
|
29
|
+
* none. A malformed entry is dropped — it declares nothing, which is the safe
|
|
30
|
+
* reading of an allowlist.
|
|
31
|
+
*/
|
|
32
|
+
export declare function readProductSectionsConfig(config: Record<string, unknown> | undefined): string[] | undefined;
|
|
33
|
+
/** The section's rendered markup, or `null` when the product (or its page, or the section) is absent. */
|
|
34
|
+
export type ProductSectionReader = (productId: string, sectionId: string) => Promise<string | null>;
|
|
35
|
+
/** A reader for a space's platform config, or `undefined` when not this factory's. */
|
|
36
|
+
export type ProductSectionReaderFactory = (platformConfig: unknown) => ProductSectionReader | undefined;
|
|
37
|
+
export declare function registerProductSectionReader(factory: ProductSectionReaderFactory): void;
|
|
38
|
+
/** First registered factory that claims this platform config. */
|
|
39
|
+
export declare function resolveProductSectionReader(platformConfig: unknown): ProductSectionReader | undefined;
|
|
40
|
+
/** Test seam: drops every registration. */
|
|
41
|
+
export declare function clearProductSectionReaders(): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { FourtyRuntimeProvider, useFourtyRuntime, useOptionalFourtyRuntime, } from './runtime-context';
|
|
2
|
-
export { useTurn, useStream, useTurnAsk, useDisplayedLayout, useFourtyShell, useAgentDriven, useReasoning, useSessionState, useSessionId, useSessionMessages, useFacts, useConversationMessages, usePendingMessage, useCurrentMessageIndex, useSelectMessage, useExplicitTurnId, useExplicitTurnSelection, useHistoryNav, useCanvasBack, useCanvasViewBack, useCanvasForward, useConversationState, useSuggestionsWithDefaults, useComposerPlaceholder, useComposerPlaceholderRotation, useLayout, useFocalEntityId, useInteraction, useConversations, useHasLeftSeedHome, useVisitorName, } from './runtime-hooks';
|
|
2
|
+
export { useTurn, useStream, useTurnAsk, useDisplayedLayout, useFourtyShell, useAgentDriven, useReasoning, useSessionState, useSessionId, useSessionMessages, useSeedLayout, useFacts, useConversationMessages, usePendingMessage, useCurrentMessageIndex, useSelectMessage, useExplicitTurnId, useExplicitTurnSelection, useHistoryNav, useCanvasBack, useCanvasViewBack, useCanvasForward, useConversationState, useSuggestionsWithDefaults, useComposerPlaceholder, useComposerPlaceholderRotation, useLayout, useFocalEntityId, useInteraction, useConversations, useHasLeftSeedHome, useVisitorName, } from './runtime-hooks';
|
|
3
3
|
export type { TurnInfo, HistoryNav, CanvasBack, CanvasForward, ConversationState, RuntimeSessionState, FourtyRuntime, InteractionActions, VisitorName, ExplicitTurnSelection, } from './runtime-types';
|
|
4
4
|
export { CanvasTailProvider, useCanvasTail, CanvasTailMount, type CanvasTailComponent, } from './canvas-tail';
|
|
5
5
|
export { GenerationStyleContext, GenerationStyleProvider, useGenerationStyle, } from './GenerationStyleContext';
|
|
@@ -29,6 +29,10 @@ export declare function useSessionState(): RuntimeSessionState;
|
|
|
29
29
|
export declare function useSessionId(): string | null;
|
|
30
30
|
/** The committed chat messages. A slice: re-renders only when the list changes. */
|
|
31
31
|
export declare function useSessionMessages(): readonly ChatMessage[];
|
|
32
|
+
/** The space's welcome layout, or `null` until it is known. A slice: a
|
|
33
|
+
* composer keystroke writes the draft to the same session store, and a
|
|
34
|
+
* whole-snapshot read (`useSessionState`) re-renders on every one of them. */
|
|
35
|
+
export declare function useSeedLayout(): Spec | null;
|
|
32
36
|
/** Visitor-slot facts map. */
|
|
33
37
|
export declare function useFacts(): Record<string, unknown>;
|
|
34
38
|
/** The name the visitor goes by (`null` when they have not given one), plus the
|
|
@@ -153,6 +153,9 @@ export interface FourtyRuntime {
|
|
|
153
153
|
* the reads for consumers that must NOT re-render on every prose chunk. */
|
|
154
154
|
useSessionId: () => string | null;
|
|
155
155
|
useSessionMessages: () => readonly ChatMessage[];
|
|
156
|
+
/** The space's welcome layout (`null` until known) — a slice, so a composer
|
|
157
|
+
* keystroke (the draft lives on the same store) does not re-render the reader. */
|
|
158
|
+
useSeedLayout: () => Spec | null;
|
|
156
159
|
useFacts: () => Record<string, unknown>;
|
|
157
160
|
useVisitorName: () => VisitorName;
|
|
158
161
|
useConversationMessages: () => readonly Message[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { publishClientState, clientStateVector, clientStateEntries, subscribeClientState, type ClientStateEntry } from './store';
|
|
2
|
-
export { applyServerState, serverState, serverStateVector, serverStateEntries, subscribeServerState, resetServerState, primedEntities, primedEntitiesFor, type ServerStateEntry, } from './server-store';
|
|
2
|
+
export { applyServerState, serverState, serverStateVector, serverStateRev, serverStateEntries, subscribeServerState, resetServerState, primedEntities, primedEntitiesFor, type ServerStateEntry, } from './server-store';
|
|
@@ -14,6 +14,9 @@ export interface ServerStateEntry {
|
|
|
14
14
|
export declare function applyServerState(namespace: string, rev: number, payload: Record<string, unknown>): boolean;
|
|
15
15
|
/** The payload currently held for a namespace, or undefined. */
|
|
16
16
|
export declare function serverState(namespace: string): Record<string, unknown> | undefined;
|
|
17
|
+
/** The rev held for one namespace (0 when none) — so a write this client learned of first (its own REST call's
|
|
18
|
+
* answer) can land just above it, below the server's next timestamped frame. */
|
|
19
|
+
export declare function serverStateRev(namespace: string): number;
|
|
17
20
|
/** `{ namespace → rev }` — this client's view of server-led state. */
|
|
18
21
|
export declare function serverStateVector(): Record<string, number>;
|
|
19
22
|
/** Reactive read for `useSyncExternalStore`. Identity changes on content change. */
|