@40rty/ams-sdk 0.5.3 → 0.5.5
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 +598 -516
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +17 -17
- package/dist/types/sdk/src/catalog/define.d.ts +0 -20
- package/dist/types/sdk/src/host/host-modules.d.ts +48 -17
- package/dist/types/sdk/src/session/index.d.ts +1 -0
- package/dist/types/sdk/src/session/turn-attributed-session.d.ts +5 -0
- package/dist/types/sdk/src/shell/conversation/index.d.ts +1 -0
- package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +2 -1
- package/dist/types/spacestation/src/commerce/page-kinds.d.ts +7 -0
- package/dist/types/spacestation/src/host/host-page.d.ts +62 -0
- package/dist/types/spacestation/src/index.d.ts +2 -1
- package/dist/types/spacestation/src/layout/page.d.ts +11 -1
- package/dist/types/spacestation/src/space/connector.d.ts +16 -1
- package/dist/types/spacestation/src/space/space.d.ts +7 -0
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +13 -0
- package/package.json +1 -1
|
@@ -146,6 +146,7 @@ export declare const ProductVideoSchema: z.ZodObject<{
|
|
|
146
146
|
width?: number | undefined;
|
|
147
147
|
height?: number | undefined;
|
|
148
148
|
}[];
|
|
149
|
+
host?: string | undefined;
|
|
149
150
|
previewImage?: {
|
|
150
151
|
url: string;
|
|
151
152
|
altText: string;
|
|
@@ -154,9 +155,9 @@ export declare const ProductVideoSchema: z.ZodObject<{
|
|
|
154
155
|
srcSet?: string | undefined;
|
|
155
156
|
} | undefined;
|
|
156
157
|
embedUrl?: string | undefined;
|
|
157
|
-
host?: string | undefined;
|
|
158
158
|
}, {
|
|
159
159
|
kind: "hosted" | "external";
|
|
160
|
+
host?: string | undefined;
|
|
160
161
|
altText?: string | undefined;
|
|
161
162
|
previewImage?: {
|
|
162
163
|
url: string;
|
|
@@ -172,7 +173,6 @@ export declare const ProductVideoSchema: z.ZodObject<{
|
|
|
172
173
|
height?: number | undefined;
|
|
173
174
|
}[] | undefined;
|
|
174
175
|
embedUrl?: string | undefined;
|
|
175
|
-
host?: string | undefined;
|
|
176
176
|
}>;
|
|
177
177
|
/**
|
|
178
178
|
* Why a variant can or cannot be bought right now — UCP's `availability.status`
|
|
@@ -377,8 +377,8 @@ export declare const SiblingProductSchema: z.ZodObject<{
|
|
|
377
377
|
current: z.ZodDefault<z.ZodBoolean>;
|
|
378
378
|
}, "strip", z.ZodTypeAny, {
|
|
379
379
|
id: string;
|
|
380
|
-
handle: string;
|
|
381
380
|
title: string;
|
|
381
|
+
handle: string;
|
|
382
382
|
available: boolean;
|
|
383
383
|
color: string;
|
|
384
384
|
current: boolean;
|
|
@@ -391,8 +391,8 @@ export declare const SiblingProductSchema: z.ZodObject<{
|
|
|
391
391
|
} | undefined;
|
|
392
392
|
}, {
|
|
393
393
|
id: string;
|
|
394
|
-
handle: string;
|
|
395
394
|
title: string;
|
|
395
|
+
handle: string;
|
|
396
396
|
color: string;
|
|
397
397
|
available?: boolean | undefined;
|
|
398
398
|
swatchImage?: {
|
|
@@ -518,6 +518,7 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
518
518
|
width?: number | undefined;
|
|
519
519
|
height?: number | undefined;
|
|
520
520
|
}[];
|
|
521
|
+
host?: string | undefined;
|
|
521
522
|
previewImage?: {
|
|
522
523
|
url: string;
|
|
523
524
|
altText: string;
|
|
@@ -526,9 +527,9 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
526
527
|
srcSet?: string | undefined;
|
|
527
528
|
} | undefined;
|
|
528
529
|
embedUrl?: string | undefined;
|
|
529
|
-
host?: string | undefined;
|
|
530
530
|
}, {
|
|
531
531
|
kind: "hosted" | "external";
|
|
532
|
+
host?: string | undefined;
|
|
532
533
|
altText?: string | undefined;
|
|
533
534
|
previewImage?: {
|
|
534
535
|
url: string;
|
|
@@ -544,7 +545,6 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
544
545
|
height?: number | undefined;
|
|
545
546
|
}[] | undefined;
|
|
546
547
|
embedUrl?: string | undefined;
|
|
547
|
-
host?: string | undefined;
|
|
548
548
|
}>, "many">>;
|
|
549
549
|
variants: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
550
550
|
id: z.ZodString;
|
|
@@ -716,8 +716,8 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
716
716
|
current: z.ZodDefault<z.ZodBoolean>;
|
|
717
717
|
}, "strip", z.ZodTypeAny, {
|
|
718
718
|
id: string;
|
|
719
|
-
handle: string;
|
|
720
719
|
title: string;
|
|
720
|
+
handle: string;
|
|
721
721
|
available: boolean;
|
|
722
722
|
color: string;
|
|
723
723
|
current: boolean;
|
|
@@ -730,8 +730,8 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
730
730
|
} | undefined;
|
|
731
731
|
}, {
|
|
732
732
|
id: string;
|
|
733
|
-
handle: string;
|
|
734
733
|
title: string;
|
|
734
|
+
handle: string;
|
|
735
735
|
color: string;
|
|
736
736
|
available?: boolean | undefined;
|
|
737
737
|
swatchImage?: {
|
|
@@ -792,8 +792,8 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
792
792
|
unavailable: z.ZodDefault<z.ZodBoolean>;
|
|
793
793
|
}, "strip", z.ZodTypeAny, {
|
|
794
794
|
id: string;
|
|
795
|
-
handle: string;
|
|
796
795
|
title: string;
|
|
796
|
+
handle: string;
|
|
797
797
|
unavailable: boolean;
|
|
798
798
|
description: string;
|
|
799
799
|
variants: {
|
|
@@ -843,6 +843,7 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
843
843
|
width?: number | undefined;
|
|
844
844
|
height?: number | undefined;
|
|
845
845
|
}[];
|
|
846
|
+
host?: string | undefined;
|
|
846
847
|
previewImage?: {
|
|
847
848
|
url: string;
|
|
848
849
|
altText: string;
|
|
@@ -851,13 +852,12 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
851
852
|
srcSet?: string | undefined;
|
|
852
853
|
} | undefined;
|
|
853
854
|
embedUrl?: string | undefined;
|
|
854
|
-
host?: string | undefined;
|
|
855
855
|
}[];
|
|
856
856
|
availableForSale: boolean;
|
|
857
857
|
colorVariants: {
|
|
858
858
|
id: string;
|
|
859
|
-
handle: string;
|
|
860
859
|
title: string;
|
|
860
|
+
handle: string;
|
|
861
861
|
available: boolean;
|
|
862
862
|
color: string;
|
|
863
863
|
current: boolean;
|
|
@@ -954,6 +954,7 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
954
954
|
}[] | undefined;
|
|
955
955
|
videos?: {
|
|
956
956
|
kind: "hosted" | "external";
|
|
957
|
+
host?: string | undefined;
|
|
957
958
|
altText?: string | undefined;
|
|
958
959
|
previewImage?: {
|
|
959
960
|
url: string;
|
|
@@ -969,14 +970,13 @@ export declare const ProductSchema: z.ZodObject<{
|
|
|
969
970
|
height?: number | undefined;
|
|
970
971
|
}[] | undefined;
|
|
971
972
|
embedUrl?: string | undefined;
|
|
972
|
-
host?: string | undefined;
|
|
973
973
|
}[] | undefined;
|
|
974
974
|
availableForSale?: boolean | undefined;
|
|
975
975
|
collections?: string[] | undefined;
|
|
976
976
|
colorVariants?: {
|
|
977
977
|
id: string;
|
|
978
|
-
handle: string;
|
|
979
978
|
title: string;
|
|
979
|
+
handle: string;
|
|
980
980
|
color: string;
|
|
981
981
|
available?: boolean | undefined;
|
|
982
982
|
swatchImage?: {
|
|
@@ -1088,8 +1088,8 @@ export declare const ArticleSchema: z.ZodObject<{
|
|
|
1088
1088
|
tags: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
1089
1089
|
}, "strip", z.ZodTypeAny, {
|
|
1090
1090
|
id: string;
|
|
1091
|
-
handle: string;
|
|
1092
1091
|
title: string;
|
|
1092
|
+
handle: string;
|
|
1093
1093
|
content: string;
|
|
1094
1094
|
tags: string[];
|
|
1095
1095
|
author: string;
|
|
@@ -1136,8 +1136,8 @@ export declare const CmsPageSchema: z.ZodObject<{
|
|
|
1136
1136
|
seoDescription: z.ZodOptional<z.ZodString>;
|
|
1137
1137
|
}, "strip", z.ZodTypeAny, {
|
|
1138
1138
|
id: string;
|
|
1139
|
-
handle: string;
|
|
1140
1139
|
title: string;
|
|
1140
|
+
handle: string;
|
|
1141
1141
|
body: string;
|
|
1142
1142
|
bodySummary: string;
|
|
1143
1143
|
updatedAt: string;
|
|
@@ -1182,8 +1182,8 @@ export declare const CmsPolicySchema: z.ZodObject<{
|
|
|
1182
1182
|
}, "strip", z.ZodTypeAny, {
|
|
1183
1183
|
kind: string;
|
|
1184
1184
|
id: string;
|
|
1185
|
-
handle: string;
|
|
1186
1185
|
title: string;
|
|
1186
|
+
handle: string;
|
|
1187
1187
|
url: string;
|
|
1188
1188
|
body: string;
|
|
1189
1189
|
bodyHtml?: string | undefined;
|
|
@@ -1236,8 +1236,8 @@ export declare const CollectionSchema: z.ZodObject<{
|
|
|
1236
1236
|
productCount: z.ZodOptional<z.ZodNumber>;
|
|
1237
1237
|
}, "strip", z.ZodTypeAny, {
|
|
1238
1238
|
id: string;
|
|
1239
|
-
handle: string;
|
|
1240
1239
|
title: string;
|
|
1240
|
+
handle: string;
|
|
1241
1241
|
description: string;
|
|
1242
1242
|
image?: {
|
|
1243
1243
|
url: string;
|
|
@@ -29,26 +29,6 @@ import * as React from 'react';
|
|
|
29
29
|
import { z } from 'zod';
|
|
30
30
|
import { type CatalogEntryStructural } from '../../../spacestation/src/index';
|
|
31
31
|
import { type BrandComponent } from './component-library';
|
|
32
|
-
/**
|
|
33
|
-
* A hydrated ENTITY REFERENCE prop.
|
|
34
|
-
*
|
|
35
|
-
* The agent emits ids (`gid://shopify/Product/123`), never entity bodies — that
|
|
36
|
-
* is the ~80% prompt-token saving — and the client hydrates them at the render
|
|
37
|
-
* boundary.
|
|
38
|
-
*
|
|
39
|
-
* `resolverKey` is looked up in the platform HYDRATOR REGISTRY
|
|
40
|
-
* (`registerPlatformHydrators`), so this deliberately does NOT take an entity
|
|
41
|
-
* schema. A brand naming `'product'` should not also have to import
|
|
42
|
-
* `ProductSchema` from `@fourty/ecommerce`: the agent never emits a Product, and
|
|
43
|
-
* the hydrated shape the component receives is decided by the hydrator, not the
|
|
44
|
-
* brand. Keeping the key opaque here is also what keeps `@fourty/sdk` free of
|
|
45
|
-
* any one platform's vocabulary — Shopify registers `product`/`collection`/
|
|
46
|
-
* `article`/`page`/`policy`, another platform registers its own, and both get
|
|
47
|
-
* this vocabulary for free.
|
|
48
|
-
*
|
|
49
|
-
* `max: 1` yields a single ref; anything else yields an array, matching
|
|
50
|
-
* `resolved()`'s own behaviour.
|
|
51
|
-
*/
|
|
52
32
|
export declare function entity(resolverKey: string, opts?: {
|
|
53
33
|
min?: number;
|
|
54
34
|
max?: number;
|
|
@@ -56,6 +56,7 @@ export declare const HOST_MODULES: {
|
|
|
56
56
|
useComposerDraft: typeof sdk.useComposerDraft;
|
|
57
57
|
FourtySessionContext: react.Context<sdk.FourtySessionContextValue | null>;
|
|
58
58
|
useAction: typeof sdk.useAction;
|
|
59
|
+
withSignalTurn: typeof sdk.withSignalTurn;
|
|
59
60
|
getVisitorLocale: typeof sdk.getVisitorLocale;
|
|
60
61
|
registerSessionScopedClear: typeof sdk.registerSessionScopedClear;
|
|
61
62
|
runSessionScopedClearHandlers: typeof sdk.runSessionScopedClearHandlers;
|
|
@@ -91,6 +92,7 @@ export declare const HOST_MODULES: {
|
|
|
91
92
|
THREAD_ROW_ATTR: "data-fourty-thread-row";
|
|
92
93
|
threadRowAttrs: typeof sdk.threadRowAttrs;
|
|
93
94
|
useConversationPage: typeof sdk.useConversationPage;
|
|
95
|
+
useConversationPresence: typeof sdk.useConversationPresence;
|
|
94
96
|
splitAnswer: typeof sdk.splitAnswer;
|
|
95
97
|
useRegisterSignalHandlers: typeof sdk.useRegisterSignalHandlers;
|
|
96
98
|
HandlerRegistryContext: react.Context<sdk.HandlerRegistryValue | null>;
|
|
@@ -820,6 +822,7 @@ export declare const HOST_MODULES: {
|
|
|
820
822
|
};
|
|
821
823
|
shell: Record<string, unknown>;
|
|
822
824
|
}>;
|
|
825
|
+
pageIdentityKey: typeof spacestation.pageIdentityKey;
|
|
823
826
|
CartSnapshotSchema: zod.ZodObject<{
|
|
824
827
|
lines: zod.ZodArray<zod.ZodObject<{
|
|
825
828
|
productId: zod.ZodString;
|
|
@@ -2193,6 +2196,34 @@ export declare const HOST_MODULES: {
|
|
|
2193
2196
|
isLateBound: typeof spacestation.isLateBound;
|
|
2194
2197
|
isActiveDirective: typeof spacestation.isActiveDirective;
|
|
2195
2198
|
projectCollection: typeof spacestation.projectCollection;
|
|
2199
|
+
VIEW_HOST_SIGNAL: "view.host";
|
|
2200
|
+
HostPayloadSchema: zod.ZodObject<{
|
|
2201
|
+
page: zod.ZodNullable<zod.ZodType<spacestation.Page, zod.ZodTypeDef, spacestation.Page>>;
|
|
2202
|
+
maxSections: zod.ZodNullable<zod.ZodNumber>;
|
|
2203
|
+
surface: zod.ZodEnum<["page", "slot"]>;
|
|
2204
|
+
}, "strip", zod.ZodTypeAny, {
|
|
2205
|
+
surface: "page" | "slot";
|
|
2206
|
+
page: spacestation.Page | null;
|
|
2207
|
+
maxSections: number | null;
|
|
2208
|
+
}, {
|
|
2209
|
+
surface: "page" | "slot";
|
|
2210
|
+
page: spacestation.Page | null;
|
|
2211
|
+
maxSections: number | null;
|
|
2212
|
+
}>;
|
|
2213
|
+
hostPlace: typeof spacestation.hostPlace;
|
|
2214
|
+
pagePlace: typeof spacestation.pagePlace;
|
|
2215
|
+
hostFillsPage: typeof spacestation.hostFillsPage;
|
|
2216
|
+
HostClearedSchema: zod.ZodObject<{
|
|
2217
|
+
cleared: zod.ZodLiteral<true>;
|
|
2218
|
+
}, "strip", zod.ZodTypeAny, {
|
|
2219
|
+
cleared: true;
|
|
2220
|
+
}, {
|
|
2221
|
+
cleared: true;
|
|
2222
|
+
}>;
|
|
2223
|
+
HOST_CLEARED: {
|
|
2224
|
+
cleared: true;
|
|
2225
|
+
};
|
|
2226
|
+
PAGELESS_HOST_PLACE: "host";
|
|
2196
2227
|
VIEW_FOCUS_ELEMENT_SIGNAL: "view.focus.element";
|
|
2197
2228
|
FocusElementPayloadSchema: zod.ZodObject<{
|
|
2198
2229
|
elementId: zod.ZodString;
|
|
@@ -4790,6 +4821,7 @@ export declare const HOST_MODULES: {
|
|
|
4790
4821
|
width?: number | undefined;
|
|
4791
4822
|
height?: number | undefined;
|
|
4792
4823
|
}[];
|
|
4824
|
+
host?: string | undefined;
|
|
4793
4825
|
previewImage?: {
|
|
4794
4826
|
url: string;
|
|
4795
4827
|
altText: string;
|
|
@@ -4798,9 +4830,9 @@ export declare const HOST_MODULES: {
|
|
|
4798
4830
|
srcSet?: string | undefined;
|
|
4799
4831
|
} | undefined;
|
|
4800
4832
|
embedUrl?: string | undefined;
|
|
4801
|
-
host?: string | undefined;
|
|
4802
4833
|
}, {
|
|
4803
4834
|
kind: "hosted" | "external";
|
|
4835
|
+
host?: string | undefined;
|
|
4804
4836
|
altText?: string | undefined;
|
|
4805
4837
|
previewImage?: {
|
|
4806
4838
|
url: string;
|
|
@@ -4816,7 +4848,6 @@ export declare const HOST_MODULES: {
|
|
|
4816
4848
|
height?: number | undefined;
|
|
4817
4849
|
}[] | undefined;
|
|
4818
4850
|
embedUrl?: string | undefined;
|
|
4819
|
-
host?: string | undefined;
|
|
4820
4851
|
}>;
|
|
4821
4852
|
AvailabilityStatusSchema: zod.ZodEnum<["in_stock", "backorder", "preorder", "out_of_stock", "discontinued"]>;
|
|
4822
4853
|
ProductVariantSchema: zod.ZodObject<{
|
|
@@ -4950,8 +4981,8 @@ export declare const HOST_MODULES: {
|
|
|
4950
4981
|
current: zod.ZodDefault<zod.ZodBoolean>;
|
|
4951
4982
|
}, "strip", zod.ZodTypeAny, {
|
|
4952
4983
|
id: string;
|
|
4953
|
-
handle: string;
|
|
4954
4984
|
title: string;
|
|
4985
|
+
handle: string;
|
|
4955
4986
|
available: boolean;
|
|
4956
4987
|
color: string;
|
|
4957
4988
|
current: boolean;
|
|
@@ -4964,8 +4995,8 @@ export declare const HOST_MODULES: {
|
|
|
4964
4995
|
} | undefined;
|
|
4965
4996
|
}, {
|
|
4966
4997
|
id: string;
|
|
4967
|
-
handle: string;
|
|
4968
4998
|
title: string;
|
|
4999
|
+
handle: string;
|
|
4969
5000
|
color: string;
|
|
4970
5001
|
available?: boolean | undefined;
|
|
4971
5002
|
swatchImage?: {
|
|
@@ -5074,6 +5105,7 @@ export declare const HOST_MODULES: {
|
|
|
5074
5105
|
width?: number | undefined;
|
|
5075
5106
|
height?: number | undefined;
|
|
5076
5107
|
}[];
|
|
5108
|
+
host?: string | undefined;
|
|
5077
5109
|
previewImage?: {
|
|
5078
5110
|
url: string;
|
|
5079
5111
|
altText: string;
|
|
@@ -5082,9 +5114,9 @@ export declare const HOST_MODULES: {
|
|
|
5082
5114
|
srcSet?: string | undefined;
|
|
5083
5115
|
} | undefined;
|
|
5084
5116
|
embedUrl?: string | undefined;
|
|
5085
|
-
host?: string | undefined;
|
|
5086
5117
|
}, {
|
|
5087
5118
|
kind: "hosted" | "external";
|
|
5119
|
+
host?: string | undefined;
|
|
5088
5120
|
altText?: string | undefined;
|
|
5089
5121
|
previewImage?: {
|
|
5090
5122
|
url: string;
|
|
@@ -5100,7 +5132,6 @@ export declare const HOST_MODULES: {
|
|
|
5100
5132
|
height?: number | undefined;
|
|
5101
5133
|
}[] | undefined;
|
|
5102
5134
|
embedUrl?: string | undefined;
|
|
5103
|
-
host?: string | undefined;
|
|
5104
5135
|
}>, "many">>;
|
|
5105
5136
|
variants: zod.ZodDefault<zod.ZodArray<zod.ZodObject<{
|
|
5106
5137
|
id: zod.ZodString;
|
|
@@ -5245,8 +5276,8 @@ export declare const HOST_MODULES: {
|
|
|
5245
5276
|
current: zod.ZodDefault<zod.ZodBoolean>;
|
|
5246
5277
|
}, "strip", zod.ZodTypeAny, {
|
|
5247
5278
|
id: string;
|
|
5248
|
-
handle: string;
|
|
5249
5279
|
title: string;
|
|
5280
|
+
handle: string;
|
|
5250
5281
|
available: boolean;
|
|
5251
5282
|
color: string;
|
|
5252
5283
|
current: boolean;
|
|
@@ -5259,8 +5290,8 @@ export declare const HOST_MODULES: {
|
|
|
5259
5290
|
} | undefined;
|
|
5260
5291
|
}, {
|
|
5261
5292
|
id: string;
|
|
5262
|
-
handle: string;
|
|
5263
5293
|
title: string;
|
|
5294
|
+
handle: string;
|
|
5264
5295
|
color: string;
|
|
5265
5296
|
available?: boolean | undefined;
|
|
5266
5297
|
swatchImage?: {
|
|
@@ -5304,8 +5335,8 @@ export declare const HOST_MODULES: {
|
|
|
5304
5335
|
unavailable: zod.ZodDefault<zod.ZodBoolean>;
|
|
5305
5336
|
}, "strip", zod.ZodTypeAny, {
|
|
5306
5337
|
id: string;
|
|
5307
|
-
handle: string;
|
|
5308
5338
|
title: string;
|
|
5339
|
+
handle: string;
|
|
5309
5340
|
unavailable: boolean;
|
|
5310
5341
|
description: string;
|
|
5311
5342
|
variants: {
|
|
@@ -5355,6 +5386,7 @@ export declare const HOST_MODULES: {
|
|
|
5355
5386
|
width?: number | undefined;
|
|
5356
5387
|
height?: number | undefined;
|
|
5357
5388
|
}[];
|
|
5389
|
+
host?: string | undefined;
|
|
5358
5390
|
previewImage?: {
|
|
5359
5391
|
url: string;
|
|
5360
5392
|
altText: string;
|
|
@@ -5363,13 +5395,12 @@ export declare const HOST_MODULES: {
|
|
|
5363
5395
|
srcSet?: string | undefined;
|
|
5364
5396
|
} | undefined;
|
|
5365
5397
|
embedUrl?: string | undefined;
|
|
5366
|
-
host?: string | undefined;
|
|
5367
5398
|
}[];
|
|
5368
5399
|
availableForSale: boolean;
|
|
5369
5400
|
colorVariants: {
|
|
5370
5401
|
id: string;
|
|
5371
|
-
handle: string;
|
|
5372
5402
|
title: string;
|
|
5403
|
+
handle: string;
|
|
5373
5404
|
available: boolean;
|
|
5374
5405
|
color: string;
|
|
5375
5406
|
current: boolean;
|
|
@@ -5466,6 +5497,7 @@ export declare const HOST_MODULES: {
|
|
|
5466
5497
|
}[] | undefined;
|
|
5467
5498
|
videos?: {
|
|
5468
5499
|
kind: "hosted" | "external";
|
|
5500
|
+
host?: string | undefined;
|
|
5469
5501
|
altText?: string | undefined;
|
|
5470
5502
|
previewImage?: {
|
|
5471
5503
|
url: string;
|
|
@@ -5481,14 +5513,13 @@ export declare const HOST_MODULES: {
|
|
|
5481
5513
|
height?: number | undefined;
|
|
5482
5514
|
}[] | undefined;
|
|
5483
5515
|
embedUrl?: string | undefined;
|
|
5484
|
-
host?: string | undefined;
|
|
5485
5516
|
}[] | undefined;
|
|
5486
5517
|
availableForSale?: boolean | undefined;
|
|
5487
5518
|
collections?: string[] | undefined;
|
|
5488
5519
|
colorVariants?: {
|
|
5489
5520
|
id: string;
|
|
5490
|
-
handle: string;
|
|
5491
5521
|
title: string;
|
|
5522
|
+
handle: string;
|
|
5492
5523
|
color: string;
|
|
5493
5524
|
available?: boolean | undefined;
|
|
5494
5525
|
swatchImage?: {
|
|
@@ -5562,8 +5593,8 @@ export declare const HOST_MODULES: {
|
|
|
5562
5593
|
tags: zod.ZodDefault<zod.ZodArray<zod.ZodString, "many">>;
|
|
5563
5594
|
}, "strip", zod.ZodTypeAny, {
|
|
5564
5595
|
id: string;
|
|
5565
|
-
handle: string;
|
|
5566
5596
|
title: string;
|
|
5597
|
+
handle: string;
|
|
5567
5598
|
content: string;
|
|
5568
5599
|
tags: string[];
|
|
5569
5600
|
author: string;
|
|
@@ -5609,8 +5640,8 @@ export declare const HOST_MODULES: {
|
|
|
5609
5640
|
seoDescription: zod.ZodOptional<zod.ZodString>;
|
|
5610
5641
|
}, "strip", zod.ZodTypeAny, {
|
|
5611
5642
|
id: string;
|
|
5612
|
-
handle: string;
|
|
5613
5643
|
title: string;
|
|
5644
|
+
handle: string;
|
|
5614
5645
|
body: string;
|
|
5615
5646
|
bodySummary: string;
|
|
5616
5647
|
updatedAt: string;
|
|
@@ -5639,8 +5670,8 @@ export declare const HOST_MODULES: {
|
|
|
5639
5670
|
}, "strip", zod.ZodTypeAny, {
|
|
5640
5671
|
kind: string;
|
|
5641
5672
|
id: string;
|
|
5642
|
-
handle: string;
|
|
5643
5673
|
title: string;
|
|
5674
|
+
handle: string;
|
|
5644
5675
|
url: string;
|
|
5645
5676
|
body: string;
|
|
5646
5677
|
bodyHtml?: string | undefined;
|
|
@@ -5680,8 +5711,8 @@ export declare const HOST_MODULES: {
|
|
|
5680
5711
|
productCount: zod.ZodOptional<zod.ZodNumber>;
|
|
5681
5712
|
}, "strip", zod.ZodTypeAny, {
|
|
5682
5713
|
id: string;
|
|
5683
|
-
handle: string;
|
|
5684
5714
|
title: string;
|
|
5715
|
+
handle: string;
|
|
5685
5716
|
description: string;
|
|
5686
5717
|
image?: {
|
|
5687
5718
|
url: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useFourtySession, useOptionalFourtySession, useComposerDraft, FourtySessionContext, type FourtySessionContextValue, } from './FourtySessionContext';
|
|
2
2
|
export { useAction } from './use-action';
|
|
3
|
+
export { withSignalTurn } from './turn-attributed-session';
|
|
3
4
|
export { getVisitorLocale } from './visitor-locale';
|
|
4
5
|
export { registerSessionScopedClear, runSessionScopedClearHandlers } from './clear-registry';
|
|
@@ -1,4 +1,9 @@
|
|
|
1
|
+
import { type AgentSignal } from '../../../spacestation/src/index';
|
|
1
2
|
import type { FourtySessionContextValue } from './FourtySessionContext';
|
|
3
|
+
/** Stamp `turnId` onto a turn-attributed signal's payload; every other signal,
|
|
4
|
+
* and one already carrying a turn, passes through unchanged. Also used at the
|
|
5
|
+
* agent's own signal boundary (`FourtyProvider`), where the turn is the live one. */
|
|
6
|
+
export declare function withSignalTurn<T extends AgentSignal>(signal: T, turnId: string): T;
|
|
2
7
|
/** The session as a component inside a canvas element sees it: its outcome
|
|
3
8
|
* signals carry that element's turn. Outside a turn, the session unchanged. */
|
|
4
9
|
export declare function useTurnAttributedSession(session: FourtySessionContextValue | null): FourtySessionContextValue | null;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { useConversationPage } from './use-conversation-page';
|
|
2
2
|
export type { ConversationPage, ConversationCrumb, ConversationPhase, ConversationPlace, ConversationTurn } from './use-conversation-page';
|
|
3
|
+
export { useConversationPresence } from './use-conversation-presence';
|
|
3
4
|
export type { ConversationActivity, ConversationFact, ConversationPresence } from './use-conversation-presence';
|
|
4
5
|
export { splitAnswer, type AnswerText } from './answer-text';
|
|
@@ -58,7 +58,8 @@ export declare const CartAddSignalPayloadSchema: z.ZodObject<{
|
|
|
58
58
|
/**
|
|
59
59
|
* The agent turn whose canvas element the add came from — stamped by the sdk
|
|
60
60
|
* session hooks for a producer inside a turn (`turn-attributed-session.ts`),
|
|
61
|
-
*
|
|
61
|
+
* stamped with the live turn for the agent's own add (`FourtyProvider`),
|
|
62
|
+
* absent for one outside any (the header cart, WebMCP).
|
|
62
63
|
* Carried for the same reason as `origin`: the handler that emits the outcome
|
|
63
64
|
* sees only this payload.
|
|
64
65
|
*/
|
|
@@ -11,6 +11,13 @@ declare module '../layout/page' {
|
|
|
11
11
|
* this unset so it navigates normally.
|
|
12
12
|
*/
|
|
13
13
|
morph?: boolean;
|
|
14
|
+
/**
|
|
15
|
+
* The product's display title, when the page's producer already holds it
|
|
16
|
+
* — a host page (`host/host-page.ts`) carries it, because the storefront
|
|
17
|
+
* rendering the product knows its name while the agent's entity registry
|
|
18
|
+
* has never seen it. Advisory: the id is the identity.
|
|
19
|
+
*/
|
|
20
|
+
title?: string;
|
|
14
21
|
};
|
|
15
22
|
collection: {
|
|
16
23
|
handle: string;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { type Page } from '../layout/page';
|
|
3
|
+
/** Signal type — the embed sends the page it is mounted on. */
|
|
4
|
+
export declare const VIEW_HOST_SIGNAL = "view.host";
|
|
5
|
+
/**
|
|
6
|
+
* Payload, both fields always present so every frame states the whole host:
|
|
7
|
+
* - `page` — the host page, as a registered `Page` kind, or `null` when the
|
|
8
|
+
* embed no longer sits on a page with a subject (the session drops the page
|
|
9
|
+
* it held; it would otherwise answer about a product the visitor left).
|
|
10
|
+
* - `maxSections` — the most top-level sections the canvas may hold, or
|
|
11
|
+
* `null` when the host sets no limit.
|
|
12
|
+
* - `surface` — what the host gives the canvas: `'page'`, the page itself
|
|
13
|
+
* (a page made for asking — the canvas opens on the space's welcome layout
|
|
14
|
+
* and draws the brand's canvas frame), or `'slot'`, a place among the
|
|
15
|
+
* host's own sections (empty until it has an answer). Declared on its own,
|
|
16
|
+
* not read off `maxSections`: how much room and what kind of room are two
|
|
17
|
+
* different questions.
|
|
18
|
+
*/
|
|
19
|
+
export declare const HostPayloadSchema: z.ZodObject<{
|
|
20
|
+
page: z.ZodNullable<z.ZodType<Page, z.ZodTypeDef, Page>>;
|
|
21
|
+
maxSections: z.ZodNullable<z.ZodNumber>;
|
|
22
|
+
surface: z.ZodEnum<["page", "slot"]>;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
surface: "page" | "slot";
|
|
25
|
+
page: Page | null;
|
|
26
|
+
maxSections: number | null;
|
|
27
|
+
}, {
|
|
28
|
+
surface: "page" | "slot";
|
|
29
|
+
page: Page | null;
|
|
30
|
+
maxSections: number | null;
|
|
31
|
+
}>;
|
|
32
|
+
export type HostPayload = z.infer<typeof HostPayloadSchema>;
|
|
33
|
+
/**
|
|
34
|
+
* The frame the embed sends ONCE when it leaves its host — the session then has
|
|
35
|
+
* no host. Its own shape, never a host with nothing declared: an island on a
|
|
36
|
+
* page that names no page and gives no slot (a store's home, search or cart) is
|
|
37
|
+
* still a host page — its canvas is the page-less place's — and a write from it
|
|
38
|
+
* must be filed there, not on whichever page the session holds live.
|
|
39
|
+
*/
|
|
40
|
+
export declare const HostClearedSchema: z.ZodObject<{
|
|
41
|
+
cleared: z.ZodLiteral<true>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
cleared: true;
|
|
44
|
+
}, {
|
|
45
|
+
cleared: true;
|
|
46
|
+
}>;
|
|
47
|
+
export type HostCleared = z.infer<typeof HostClearedSchema>;
|
|
48
|
+
export declare const HOST_CLEARED: HostCleared;
|
|
49
|
+
/** Whether the host gives the canvas the whole page (`surface: 'page'`) rather than a slot in its own. */
|
|
50
|
+
export declare function hostFillsPage(host: HostPayload): boolean;
|
|
51
|
+
/** The place of a host that names no page — one canvas shared by every such page. */
|
|
52
|
+
export declare const PAGELESS_HOST_PLACE = "host";
|
|
53
|
+
/**
|
|
54
|
+
* The PLACE a host's canvas belongs to: the host page's identity
|
|
55
|
+
* (`pageIdentityKey` — `product:id=gid://…`, `cms:handle=ask`), the same key
|
|
56
|
+
* the client canvas uses for "the same page". The client restores the canvas
|
|
57
|
+
* of this place and the server parks / restores canvases under it, so both
|
|
58
|
+
* sides must derive it here and nowhere else.
|
|
59
|
+
*/
|
|
60
|
+
export declare function hostPlace(host: HostPayload): string;
|
|
61
|
+
/** The place of a host page — `hostPlace` for a caller that holds only the page (the page-entry route). */
|
|
62
|
+
export declare function pagePlace(page: Page | null): string;
|
|
@@ -3,7 +3,7 @@ export { type ElementChange, type LayoutDiff, diffLayouts, } from './layout/layo
|
|
|
3
3
|
export { type Patch, PatchSchema, } from './layout/patch';
|
|
4
4
|
export { RESERVED_IDS, RESERVED_ID_SET, type ReservedId, isReservedId, } from './layout/reserved-ids';
|
|
5
5
|
export { type ReducePatchResult, reducePatch, } from './layout/reduce-patch';
|
|
6
|
-
export { type Page, type PageKindRegistry, registerPageKindSchema, registeredPageKinds, PageSchema, NavigatePayloadSchema, type NavigatePayload, type ViewportFocus, ViewportFocusSchema, type View, ViewSchema, type PageRouter, } from './layout/page';
|
|
6
|
+
export { type Page, type PageKindRegistry, registerPageKindSchema, registeredPageKinds, PageSchema, NavigatePayloadSchema, type NavigatePayload, type ViewportFocus, ViewportFocusSchema, type View, ViewSchema, type PageRouter, pageIdentityKey, } from './layout/page';
|
|
7
7
|
import './commerce/page-kinds';
|
|
8
8
|
export { type CartSnapshot, type CartSnapshotLine, CartSnapshotSchema, CartSnapshotLineSchema, type WishlistSnapshot, WishlistSnapshotSchema, } from './commerce/cart-state';
|
|
9
9
|
export { PRODUCT_SELECT_OPTION_SIGNAL, SELECTION_ORIGIN_VISITOR, VARIANT_SELECTED_OBSERVATION, type SelectionOrigin, } from './commerce/selection-signal';
|
|
@@ -33,6 +33,7 @@ export { applySinglePatch } from './layout/apply-patch';
|
|
|
33
33
|
export { derivePropsDoc } from './catalog/derive-props-doc';
|
|
34
34
|
export { WireSchemaSchema, WireCatalogSchema, WireCatalogEntrySchema, schemaToWire, schemaFromWire, catalogToWire, catalogFromWire, UnsupportedSchemaError, PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, SDK_VERSION_PATTERN, SdkVersionSchema, OLDEST_SUPPORTED_SDK, SDK_SHIMS, compareSdkVersions, sdkShimsFor, sdkWindowProblem, type SdkShim, PackageBundleRefSchema, type PackageBundleRef, BRAND_MARK_TYPES, BRAND_MARK_SLOTS, BRAND_MARK_MAX_BYTES, BrandMarkSchema, BrandMarkImageSchema, SpaceBrandMarkSchema, type BrandMark, type BrandMarkFile, type BrandMarkUpload, type BrandMarkStored, type BrandMarkSlot, type BrandMarkType, type BrandMarkImage, type SpaceBrandMark, type PackageRelease, type WireSchema, type WireCatalog, type WireCatalogEntry, } from './catalog/wire';
|
|
35
35
|
export { LateBoundValueSchema, DirectiveValueSchema, ProjectionDirectiveSchema, ProjectionPreferencesSchema, ProjectionSetPayloadSchema, PROJECTION_SET_SIGNAL, isLateBound, isActiveDirective, projectCollection, type LateBoundValue, type DirectiveValue, type ProjectionDirective, type ProjectionPreferences, type ProjectionSetPayload, type ProjectionAccessors, } from './projection/projection';
|
|
36
|
+
export { VIEW_HOST_SIGNAL, HostPayloadSchema, type HostPayload, hostPlace, pagePlace, hostFillsPage, HostClearedSchema, HOST_CLEARED, type HostCleared, PAGELESS_HOST_PLACE, } from './host/host-page';
|
|
36
37
|
export { VIEW_FOCUS_ELEMENT_SIGNAL, FocusElementPayloadSchema, type FocusElementPayload, } from './focus/focus';
|
|
37
38
|
export { VIEW_EXTEND_SIGNAL, VIEW_EXHAUSTED_SIGNAL, ViewExtendPayloadSchema, CONTINUATION_ENABLED, type ViewExtendPayload, } from './view/continuation';
|
|
38
39
|
export type { Hydrator, HydratorMap, HydrationContext } from './hydration/hydration';
|
|
@@ -74,7 +74,16 @@ export type Page = {
|
|
|
74
74
|
kind: K;
|
|
75
75
|
} & PageKindRegistry[K];
|
|
76
76
|
}[keyof PageKindRegistry];
|
|
77
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Register a page kind. `identityOmit` names the kind's VOLATILE props — two
|
|
79
|
+
* navigations to the same page may carry different values for them (a morph
|
|
80
|
+
* flag, the click-context product list, the turn that opened it) — so
|
|
81
|
+
* `pageIdentityKey` leaves them out. The kind declares them where it is
|
|
82
|
+
* declared; the universal identity rule names none of any vertical's.
|
|
83
|
+
*/
|
|
84
|
+
export declare function registerPageKindSchema(kind: string, schema: z.ZodTypeAny, options?: {
|
|
85
|
+
identityOmit?: readonly string[];
|
|
86
|
+
}): void;
|
|
78
87
|
/** Kinds currently parseable — diagnostics for a failed navigate. */
|
|
79
88
|
export declare function registeredPageKinds(): string[];
|
|
80
89
|
/**
|
|
@@ -233,6 +242,7 @@ export declare const ViewSchema: z.ZodObject<{
|
|
|
233
242
|
};
|
|
234
243
|
shell: Record<string, unknown>;
|
|
235
244
|
}>;
|
|
245
|
+
export declare function pageIdentityKey(page: Page): string;
|
|
236
246
|
/**
|
|
237
247
|
* PageRouter — pure function from Page → View. Brand-provided. Each
|
|
238
248
|
* brand registers a router that knows how to fetch / build the layout
|
|
@@ -23,7 +23,9 @@ export interface ConnectorFieldDescriptor {
|
|
|
23
23
|
/** Where the value comes from, in the connector's own vocabulary. */
|
|
24
24
|
hint: string;
|
|
25
25
|
placeholder: string;
|
|
26
|
-
/** A credential: rendered masked, never echoed back once stored.
|
|
26
|
+
/** A credential: rendered masked, never echoed back once stored. A secret
|
|
27
|
+
* config field must be named in `browserConfig` (publishable — designed to
|
|
28
|
+
* ship in client code) or `vaultedConfig` (server-only). */
|
|
27
29
|
secret: boolean;
|
|
28
30
|
}
|
|
29
31
|
/**
|
|
@@ -58,4 +60,17 @@ export interface ConnectorDescriptor {
|
|
|
58
60
|
/** Whether the connector can check typed values against the live service
|
|
59
61
|
* before they are saved. */
|
|
60
62
|
testable: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* The `config` keys a BROWSER may receive. The public space routes serialize
|
|
65
|
+
* the data source's config to anonymous visitors, and only these keys cross
|
|
66
|
+
* that boundary — an undeclared key is withheld, so a new credential is
|
|
67
|
+
* secret by default.
|
|
68
|
+
*/
|
|
69
|
+
browserConfig: readonly string[];
|
|
70
|
+
/**
|
|
71
|
+
* The `config` keys that are server-only credentials. Each is held in
|
|
72
|
+
* Supabase Vault (`connector_secrets`), keyed by space, platform and key.
|
|
73
|
+
* Never also in `browserConfig`.
|
|
74
|
+
*/
|
|
75
|
+
vaultedConfig: readonly string[];
|
|
61
76
|
}
|
|
@@ -116,4 +116,11 @@ export interface UpdateSpaceInput {
|
|
|
116
116
|
platform?: string;
|
|
117
117
|
platformConfig?: Record<string, unknown>;
|
|
118
118
|
locked?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* The organization that owns the space — the canonical `spaces.organization_id`
|
|
121
|
+
* column, which ownership, the org's space list and `poweredBy` all read. A
|
|
122
|
+
* caller moving a space sets it here AND mirrors it into
|
|
123
|
+
* `platformConfig.organizationId`, as the insert does. `null` unclaims it.
|
|
124
|
+
*/
|
|
125
|
+
organizationId?: string | null;
|
|
119
126
|
}
|