@40rty/ams-sdk 0.4.4 → 0.5.1
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 +689 -497
- package/dist/types/ecommerce/src/review-schemas.d.ts +24 -10
- package/dist/types/sdk/src/host/host-modules.d.ts +342 -10
- package/dist/types/spacestation/src/attachment/attachment.d.ts +8 -5
- package/dist/types/spacestation/src/catalog/wire/brand-mark.d.ts +230 -0
- package/dist/types/spacestation/src/catalog/wire/index.d.ts +3 -0
- package/dist/types/spacestation/src/catalog/wire/package-bundle-ref.d.ts +30 -0
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +147 -0
- package/dist/types/spacestation/src/catalog/wire/sdk-compat.d.ts +43 -0
- package/dist/types/spacestation/src/contracts/socket-ticket-param.d.ts +9 -0
- package/dist/types/spacestation/src/contracts/wire-protocol.d.ts +25 -0
- package/dist/types/spacestation/src/index.d.ts +3 -1
- package/dist/types/spacestation/src/space/workspace-catalog.d.ts +9 -0
- package/dist/types/spacestation/src/trace/trace-events.d.ts +1 -0
- package/dist/types/spacestation/src/widgets/presence/index.d.ts +1 -1
- package/dist/types/spacestation/src/widgets/presence/scan.d.ts +21 -0
- package/package.json +1 -1
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* A brand's MARK — the image that names it wherever the platform names the
|
|
4
|
+
* space: the console's space switcher, the locked gate, the browser tab.
|
|
5
|
+
*
|
|
6
|
+
* The brand package declares it and it travels with the package's release, so
|
|
7
|
+
* a published brand needs nothing in the platform's repository. Two slots:
|
|
8
|
+
*
|
|
9
|
+
* - `square` — drawn to be legible at 16–20px (a favicon). The switcher and the
|
|
10
|
+
* tab take it first.
|
|
11
|
+
* - `wordmark` — the wide logo. The gate takes it first.
|
|
12
|
+
*
|
|
13
|
+
* Either may be absent; a slot falls back to the other, and a brand with no
|
|
14
|
+
* mark at all shows the space's initial.
|
|
15
|
+
*/
|
|
16
|
+
export declare const BRAND_MARK_TYPES: readonly ["svg", "png"];
|
|
17
|
+
export type BrandMarkType = (typeof BRAND_MARK_TYPES)[number];
|
|
18
|
+
/** The largest mark file accepted, decoded. A mark is an icon, not a hero image. */
|
|
19
|
+
export declare const BRAND_MARK_MAX_BYTES: number;
|
|
20
|
+
/** A mark file as a publisher SENDS it: the file itself, base64. */
|
|
21
|
+
declare const BrandMarkUploadSchema: z.ZodObject<{
|
|
22
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
23
|
+
data: z.ZodString;
|
|
24
|
+
}, "strict", z.ZodTypeAny, {
|
|
25
|
+
type: "svg" | "png";
|
|
26
|
+
data: string;
|
|
27
|
+
}, {
|
|
28
|
+
type: "svg" | "png";
|
|
29
|
+
data: string;
|
|
30
|
+
}>;
|
|
31
|
+
/**
|
|
32
|
+
* A mark file as the platform STORES it: the address of the uploaded object,
|
|
33
|
+
* named for the hash of its content. Set at ingest, never by a publisher — the
|
|
34
|
+
* bytes leave the release for object storage, as a bundle's do.
|
|
35
|
+
*/
|
|
36
|
+
declare const BrandMarkStoredSchema: z.ZodObject<{
|
|
37
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
38
|
+
sha256: z.ZodString;
|
|
39
|
+
}, "strict", z.ZodTypeAny, {
|
|
40
|
+
type: "svg" | "png";
|
|
41
|
+
sha256: string;
|
|
42
|
+
}, {
|
|
43
|
+
type: "svg" | "png";
|
|
44
|
+
sha256: string;
|
|
45
|
+
}>;
|
|
46
|
+
declare const BrandMarkFileSchema: z.ZodUnion<[z.ZodObject<{
|
|
47
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
48
|
+
data: z.ZodString;
|
|
49
|
+
}, "strict", z.ZodTypeAny, {
|
|
50
|
+
type: "svg" | "png";
|
|
51
|
+
data: string;
|
|
52
|
+
}, {
|
|
53
|
+
type: "svg" | "png";
|
|
54
|
+
data: string;
|
|
55
|
+
}>, z.ZodObject<{
|
|
56
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
57
|
+
sha256: z.ZodString;
|
|
58
|
+
}, "strict", z.ZodTypeAny, {
|
|
59
|
+
type: "svg" | "png";
|
|
60
|
+
sha256: string;
|
|
61
|
+
}, {
|
|
62
|
+
type: "svg" | "png";
|
|
63
|
+
sha256: string;
|
|
64
|
+
}>]>;
|
|
65
|
+
export type BrandMarkFile = z.infer<typeof BrandMarkFileSchema>;
|
|
66
|
+
export type BrandMarkUpload = z.infer<typeof BrandMarkUploadSchema>;
|
|
67
|
+
export type BrandMarkStored = z.infer<typeof BrandMarkStoredSchema>;
|
|
68
|
+
export declare const BRAND_MARK_SLOTS: readonly ["square", "wordmark"];
|
|
69
|
+
export type BrandMarkSlot = (typeof BRAND_MARK_SLOTS)[number];
|
|
70
|
+
/** `PackageRelease.mark`. */
|
|
71
|
+
export declare const BrandMarkSchema: z.ZodEffects<z.ZodObject<{
|
|
72
|
+
square: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
73
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
74
|
+
data: z.ZodString;
|
|
75
|
+
}, "strict", z.ZodTypeAny, {
|
|
76
|
+
type: "svg" | "png";
|
|
77
|
+
data: string;
|
|
78
|
+
}, {
|
|
79
|
+
type: "svg" | "png";
|
|
80
|
+
data: string;
|
|
81
|
+
}>, z.ZodObject<{
|
|
82
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
83
|
+
sha256: z.ZodString;
|
|
84
|
+
}, "strict", z.ZodTypeAny, {
|
|
85
|
+
type: "svg" | "png";
|
|
86
|
+
sha256: string;
|
|
87
|
+
}, {
|
|
88
|
+
type: "svg" | "png";
|
|
89
|
+
sha256: string;
|
|
90
|
+
}>]>>;
|
|
91
|
+
wordmark: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
92
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
93
|
+
data: z.ZodString;
|
|
94
|
+
}, "strict", z.ZodTypeAny, {
|
|
95
|
+
type: "svg" | "png";
|
|
96
|
+
data: string;
|
|
97
|
+
}, {
|
|
98
|
+
type: "svg" | "png";
|
|
99
|
+
data: string;
|
|
100
|
+
}>, z.ZodObject<{
|
|
101
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
102
|
+
sha256: z.ZodString;
|
|
103
|
+
}, "strict", z.ZodTypeAny, {
|
|
104
|
+
type: "svg" | "png";
|
|
105
|
+
sha256: string;
|
|
106
|
+
}, {
|
|
107
|
+
type: "svg" | "png";
|
|
108
|
+
sha256: string;
|
|
109
|
+
}>]>>;
|
|
110
|
+
}, "strict", z.ZodTypeAny, {
|
|
111
|
+
square?: {
|
|
112
|
+
type: "svg" | "png";
|
|
113
|
+
data: string;
|
|
114
|
+
} | {
|
|
115
|
+
type: "svg" | "png";
|
|
116
|
+
sha256: string;
|
|
117
|
+
} | undefined;
|
|
118
|
+
wordmark?: {
|
|
119
|
+
type: "svg" | "png";
|
|
120
|
+
data: string;
|
|
121
|
+
} | {
|
|
122
|
+
type: "svg" | "png";
|
|
123
|
+
sha256: string;
|
|
124
|
+
} | undefined;
|
|
125
|
+
}, {
|
|
126
|
+
square?: {
|
|
127
|
+
type: "svg" | "png";
|
|
128
|
+
data: string;
|
|
129
|
+
} | {
|
|
130
|
+
type: "svg" | "png";
|
|
131
|
+
sha256: string;
|
|
132
|
+
} | undefined;
|
|
133
|
+
wordmark?: {
|
|
134
|
+
type: "svg" | "png";
|
|
135
|
+
data: string;
|
|
136
|
+
} | {
|
|
137
|
+
type: "svg" | "png";
|
|
138
|
+
sha256: string;
|
|
139
|
+
} | undefined;
|
|
140
|
+
}>, {
|
|
141
|
+
square?: {
|
|
142
|
+
type: "svg" | "png";
|
|
143
|
+
data: string;
|
|
144
|
+
} | {
|
|
145
|
+
type: "svg" | "png";
|
|
146
|
+
sha256: string;
|
|
147
|
+
} | undefined;
|
|
148
|
+
wordmark?: {
|
|
149
|
+
type: "svg" | "png";
|
|
150
|
+
data: string;
|
|
151
|
+
} | {
|
|
152
|
+
type: "svg" | "png";
|
|
153
|
+
sha256: string;
|
|
154
|
+
} | undefined;
|
|
155
|
+
}, {
|
|
156
|
+
square?: {
|
|
157
|
+
type: "svg" | "png";
|
|
158
|
+
data: string;
|
|
159
|
+
} | {
|
|
160
|
+
type: "svg" | "png";
|
|
161
|
+
sha256: string;
|
|
162
|
+
} | undefined;
|
|
163
|
+
wordmark?: {
|
|
164
|
+
type: "svg" | "png";
|
|
165
|
+
data: string;
|
|
166
|
+
} | {
|
|
167
|
+
type: "svg" | "png";
|
|
168
|
+
sha256: string;
|
|
169
|
+
} | undefined;
|
|
170
|
+
}>;
|
|
171
|
+
export type BrandMark = z.infer<typeof BrandMarkSchema>;
|
|
172
|
+
/** One mark image, where it is served from. */
|
|
173
|
+
export declare const BrandMarkImageSchema: z.ZodObject<{
|
|
174
|
+
src: z.ZodString;
|
|
175
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
176
|
+
}, "strict", z.ZodTypeAny, {
|
|
177
|
+
type: "svg" | "png";
|
|
178
|
+
src: string;
|
|
179
|
+
}, {
|
|
180
|
+
type: "svg" | "png";
|
|
181
|
+
src: string;
|
|
182
|
+
}>;
|
|
183
|
+
export type BrandMarkImage = z.infer<typeof BrandMarkImageSchema>;
|
|
184
|
+
/**
|
|
185
|
+
* A SPACE's mark as the api answers it — the winning component source's (the
|
|
186
|
+
* last one in `componentSources` that declares any), both slots from that one
|
|
187
|
+
* brand. `null` slots are what the brand did not ship.
|
|
188
|
+
*/
|
|
189
|
+
export declare const SpaceBrandMarkSchema: z.ZodObject<{
|
|
190
|
+
square: z.ZodNullable<z.ZodObject<{
|
|
191
|
+
src: z.ZodString;
|
|
192
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
193
|
+
}, "strict", z.ZodTypeAny, {
|
|
194
|
+
type: "svg" | "png";
|
|
195
|
+
src: string;
|
|
196
|
+
}, {
|
|
197
|
+
type: "svg" | "png";
|
|
198
|
+
src: string;
|
|
199
|
+
}>>;
|
|
200
|
+
wordmark: z.ZodNullable<z.ZodObject<{
|
|
201
|
+
src: z.ZodString;
|
|
202
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
203
|
+
}, "strict", z.ZodTypeAny, {
|
|
204
|
+
type: "svg" | "png";
|
|
205
|
+
src: string;
|
|
206
|
+
}, {
|
|
207
|
+
type: "svg" | "png";
|
|
208
|
+
src: string;
|
|
209
|
+
}>>;
|
|
210
|
+
}, "strict", z.ZodTypeAny, {
|
|
211
|
+
square: {
|
|
212
|
+
type: "svg" | "png";
|
|
213
|
+
src: string;
|
|
214
|
+
} | null;
|
|
215
|
+
wordmark: {
|
|
216
|
+
type: "svg" | "png";
|
|
217
|
+
src: string;
|
|
218
|
+
} | null;
|
|
219
|
+
}, {
|
|
220
|
+
square: {
|
|
221
|
+
type: "svg" | "png";
|
|
222
|
+
src: string;
|
|
223
|
+
} | null;
|
|
224
|
+
wordmark: {
|
|
225
|
+
type: "svg" | "png";
|
|
226
|
+
src: string;
|
|
227
|
+
} | null;
|
|
228
|
+
}>;
|
|
229
|
+
export type SpaceBrandMark = z.infer<typeof SpaceBrandMarkSchema>;
|
|
230
|
+
export {};
|
|
@@ -3,3 +3,6 @@ export { schemaToWire, UnsupportedSchemaError } from './schema-to-wire';
|
|
|
3
3
|
export { schemaFromWire } from './schema-from-wire';
|
|
4
4
|
export { WireCatalogSchema, WireCatalogEntrySchema, catalogToWire, catalogFromWire, type WireCatalog, type WireCatalogEntry, } from './catalog-wire';
|
|
5
5
|
export { PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, type PackageRelease } from './package-release';
|
|
6
|
+
export { SDK_VERSION_PATTERN, SdkVersionSchema, OLDEST_SUPPORTED_SDK, SDK_SHIMS, compareSdkVersions, sdkShimsFor, sdkWindowProblem, type SdkShim, } from './sdk-compat';
|
|
7
|
+
export { PackageBundleRefSchema, type PackageBundleRef } from './package-bundle-ref';
|
|
8
|
+
export { 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, } from './brand-mark';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Where one published source's components are served from — immutable URLs in
|
|
4
|
+
* object storage — as the api hands it to a page and the page to the renderer.
|
|
5
|
+
*/
|
|
6
|
+
export declare const PackageBundleRefSchema: z.ZodObject<{
|
|
7
|
+
sourceId: z.ZodString;
|
|
8
|
+
js: z.ZodString;
|
|
9
|
+
css: z.ZodString;
|
|
10
|
+
/** The brand's name for itself, and its package's version. */
|
|
11
|
+
label: z.ZodString;
|
|
12
|
+
version: z.ZodString;
|
|
13
|
+
/** The sdk the bundle was built against (`PackageRelease.builtWithSdk`) — absent for a legacy release. Picks its compat shims. */
|
|
14
|
+
builtWithSdk: z.ZodOptional<z.ZodString>;
|
|
15
|
+
}, "strip", z.ZodTypeAny, {
|
|
16
|
+
label: string;
|
|
17
|
+
sourceId: string;
|
|
18
|
+
version: string;
|
|
19
|
+
js: string;
|
|
20
|
+
css: string;
|
|
21
|
+
builtWithSdk?: string | undefined;
|
|
22
|
+
}, {
|
|
23
|
+
label: string;
|
|
24
|
+
sourceId: string;
|
|
25
|
+
version: string;
|
|
26
|
+
js: string;
|
|
27
|
+
css: string;
|
|
28
|
+
builtWithSdk?: string | undefined;
|
|
29
|
+
}>;
|
|
30
|
+
export type PackageBundleRef = z.infer<typeof PackageBundleRefSchema>;
|
|
@@ -17,6 +17,14 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
17
17
|
version: z.ZodString;
|
|
18
18
|
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
19
19
|
description: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/**
|
|
21
|
+
* The `@40rty/ams-sdk` version the brand project resolved when `forty
|
|
22
|
+
* publish` built this release. A bundle takes the sdk from the page at
|
|
23
|
+
* runtime, so this is what tells the platform which compat shims it needs
|
|
24
|
+
* and whether it can host it at all (`sdk-compat.ts`). Absent on releases
|
|
25
|
+
* published before the stamp existed — those are legacy.
|
|
26
|
+
*/
|
|
27
|
+
builtWithSdk: z.ZodOptional<z.ZodString>;
|
|
20
28
|
catalog: z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
21
29
|
type: z.ZodString;
|
|
22
30
|
propsSchema: z.ZodOptional<z.ZodType<import("./wire-schema").WireSchema, z.ZodTypeDef, import("./wire-schema").WireSchema>>;
|
|
@@ -141,6 +149,111 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
141
149
|
}, {
|
|
142
150
|
themeClass: string;
|
|
143
151
|
}>>;
|
|
152
|
+
/**
|
|
153
|
+
* The brand's mark (`brand-mark.ts`). Sent as the files themselves; the
|
|
154
|
+
* platform stores them content-addressed at ingest and keeps only their
|
|
155
|
+
* addresses here.
|
|
156
|
+
*/
|
|
157
|
+
mark: z.ZodOptional<z.ZodEffects<z.ZodObject<{
|
|
158
|
+
square: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
159
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
160
|
+
data: z.ZodString;
|
|
161
|
+
}, "strict", z.ZodTypeAny, {
|
|
162
|
+
type: "svg" | "png";
|
|
163
|
+
data: string;
|
|
164
|
+
}, {
|
|
165
|
+
type: "svg" | "png";
|
|
166
|
+
data: string;
|
|
167
|
+
}>, z.ZodObject<{
|
|
168
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
169
|
+
sha256: z.ZodString;
|
|
170
|
+
}, "strict", z.ZodTypeAny, {
|
|
171
|
+
type: "svg" | "png";
|
|
172
|
+
sha256: string;
|
|
173
|
+
}, {
|
|
174
|
+
type: "svg" | "png";
|
|
175
|
+
sha256: string;
|
|
176
|
+
}>]>>;
|
|
177
|
+
wordmark: z.ZodOptional<z.ZodUnion<[z.ZodObject<{
|
|
178
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
179
|
+
data: z.ZodString;
|
|
180
|
+
}, "strict", z.ZodTypeAny, {
|
|
181
|
+
type: "svg" | "png";
|
|
182
|
+
data: string;
|
|
183
|
+
}, {
|
|
184
|
+
type: "svg" | "png";
|
|
185
|
+
data: string;
|
|
186
|
+
}>, z.ZodObject<{
|
|
187
|
+
type: z.ZodEnum<["svg", "png"]>;
|
|
188
|
+
sha256: z.ZodString;
|
|
189
|
+
}, "strict", z.ZodTypeAny, {
|
|
190
|
+
type: "svg" | "png";
|
|
191
|
+
sha256: string;
|
|
192
|
+
}, {
|
|
193
|
+
type: "svg" | "png";
|
|
194
|
+
sha256: string;
|
|
195
|
+
}>]>>;
|
|
196
|
+
}, "strict", z.ZodTypeAny, {
|
|
197
|
+
square?: {
|
|
198
|
+
type: "svg" | "png";
|
|
199
|
+
data: string;
|
|
200
|
+
} | {
|
|
201
|
+
type: "svg" | "png";
|
|
202
|
+
sha256: string;
|
|
203
|
+
} | undefined;
|
|
204
|
+
wordmark?: {
|
|
205
|
+
type: "svg" | "png";
|
|
206
|
+
data: string;
|
|
207
|
+
} | {
|
|
208
|
+
type: "svg" | "png";
|
|
209
|
+
sha256: string;
|
|
210
|
+
} | undefined;
|
|
211
|
+
}, {
|
|
212
|
+
square?: {
|
|
213
|
+
type: "svg" | "png";
|
|
214
|
+
data: string;
|
|
215
|
+
} | {
|
|
216
|
+
type: "svg" | "png";
|
|
217
|
+
sha256: string;
|
|
218
|
+
} | undefined;
|
|
219
|
+
wordmark?: {
|
|
220
|
+
type: "svg" | "png";
|
|
221
|
+
data: string;
|
|
222
|
+
} | {
|
|
223
|
+
type: "svg" | "png";
|
|
224
|
+
sha256: string;
|
|
225
|
+
} | undefined;
|
|
226
|
+
}>, {
|
|
227
|
+
square?: {
|
|
228
|
+
type: "svg" | "png";
|
|
229
|
+
data: string;
|
|
230
|
+
} | {
|
|
231
|
+
type: "svg" | "png";
|
|
232
|
+
sha256: string;
|
|
233
|
+
} | undefined;
|
|
234
|
+
wordmark?: {
|
|
235
|
+
type: "svg" | "png";
|
|
236
|
+
data: string;
|
|
237
|
+
} | {
|
|
238
|
+
type: "svg" | "png";
|
|
239
|
+
sha256: string;
|
|
240
|
+
} | undefined;
|
|
241
|
+
}, {
|
|
242
|
+
square?: {
|
|
243
|
+
type: "svg" | "png";
|
|
244
|
+
data: string;
|
|
245
|
+
} | {
|
|
246
|
+
type: "svg" | "png";
|
|
247
|
+
sha256: string;
|
|
248
|
+
} | undefined;
|
|
249
|
+
wordmark?: {
|
|
250
|
+
type: "svg" | "png";
|
|
251
|
+
data: string;
|
|
252
|
+
} | {
|
|
253
|
+
type: "svg" | "png";
|
|
254
|
+
sha256: string;
|
|
255
|
+
} | undefined;
|
|
256
|
+
}>>;
|
|
144
257
|
/** The canvas a fresh session opens on, before the visitor has asked anything. */
|
|
145
258
|
seedLayout: z.ZodOptional<z.ZodObject<{
|
|
146
259
|
root: z.ZodString;
|
|
@@ -261,6 +374,7 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
261
374
|
manifests: Record<string, string>;
|
|
262
375
|
config?: Record<string, unknown> | undefined;
|
|
263
376
|
description?: string | undefined;
|
|
377
|
+
builtWithSdk?: string | undefined;
|
|
264
378
|
bundle?: {
|
|
265
379
|
js: string;
|
|
266
380
|
css: string;
|
|
@@ -269,6 +383,22 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
269
383
|
theme?: {
|
|
270
384
|
themeClass: string;
|
|
271
385
|
} | undefined;
|
|
386
|
+
mark?: {
|
|
387
|
+
square?: {
|
|
388
|
+
type: "svg" | "png";
|
|
389
|
+
data: string;
|
|
390
|
+
} | {
|
|
391
|
+
type: "svg" | "png";
|
|
392
|
+
sha256: string;
|
|
393
|
+
} | undefined;
|
|
394
|
+
wordmark?: {
|
|
395
|
+
type: "svg" | "png";
|
|
396
|
+
data: string;
|
|
397
|
+
} | {
|
|
398
|
+
type: "svg" | "png";
|
|
399
|
+
sha256: string;
|
|
400
|
+
} | undefined;
|
|
401
|
+
} | undefined;
|
|
272
402
|
seedLayout?: {
|
|
273
403
|
root: string;
|
|
274
404
|
elements: Record<string, {
|
|
@@ -325,6 +455,7 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
325
455
|
manifests: Record<string, string>;
|
|
326
456
|
config?: Record<string, unknown> | undefined;
|
|
327
457
|
description?: string | undefined;
|
|
458
|
+
builtWithSdk?: string | undefined;
|
|
328
459
|
bundle?: {
|
|
329
460
|
js: string;
|
|
330
461
|
css: string;
|
|
@@ -333,6 +464,22 @@ export declare const PackageReleaseSchema: z.ZodObject<{
|
|
|
333
464
|
theme?: {
|
|
334
465
|
themeClass: string;
|
|
335
466
|
} | undefined;
|
|
467
|
+
mark?: {
|
|
468
|
+
square?: {
|
|
469
|
+
type: "svg" | "png";
|
|
470
|
+
data: string;
|
|
471
|
+
} | {
|
|
472
|
+
type: "svg" | "png";
|
|
473
|
+
sha256: string;
|
|
474
|
+
} | undefined;
|
|
475
|
+
wordmark?: {
|
|
476
|
+
type: "svg" | "png";
|
|
477
|
+
data: string;
|
|
478
|
+
} | {
|
|
479
|
+
type: "svg" | "png";
|
|
480
|
+
sha256: string;
|
|
481
|
+
} | undefined;
|
|
482
|
+
} | undefined;
|
|
336
483
|
seedLayout?: {
|
|
337
484
|
root: string;
|
|
338
485
|
elements: Record<string, {
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* The version contract between a PUBLISHED bundle and the platform that hosts
|
|
4
|
+
* it. A bundle takes `@40rty/ams-sdk` from the page at runtime (the host module
|
|
5
|
+
* map), so it runs against whatever sdk the platform serves today — not the one
|
|
6
|
+
* it was built with. `forty publish` stamps the release with the sdk version the
|
|
7
|
+
* brand project resolved (`builtWithSdk`); this module is the ONE place that
|
|
8
|
+
* says which stamps the platform can host and which compat shims each needs.
|
|
9
|
+
*
|
|
10
|
+
* A release with no stamp predates the stamp: it is LEGACY, treated as the
|
|
11
|
+
* oldest supported sdk — admitted, and given every shim.
|
|
12
|
+
*/
|
|
13
|
+
/** A published sdk version: `1.2.3` or `1.2.3-next.4`. */
|
|
14
|
+
export declare const SDK_VERSION_PATTERN: RegExp;
|
|
15
|
+
export declare const SdkVersionSchema: z.ZodString;
|
|
16
|
+
/**
|
|
17
|
+
* The oldest sdk a release may be built against and still be bound to a space.
|
|
18
|
+
* The upper bound is the platform's own sdk version — a bundle built against a
|
|
19
|
+
* newer sdk calls exports this platform does not have.
|
|
20
|
+
*/
|
|
21
|
+
export declare const OLDEST_SUPPORTED_SDK = "0.3.0";
|
|
22
|
+
/**
|
|
23
|
+
* Every compat shim the host map applies, and the sdk version it stops being
|
|
24
|
+
* needed at. A shim is deleted once no live release is below its `below`
|
|
25
|
+
* (`GET /admin/package-sdk` answers that).
|
|
26
|
+
*/
|
|
27
|
+
export declare const SDK_SHIMS: {
|
|
28
|
+
/** sdk ≤ 0.3 called the vertical verbs on `useCanvasActions()` — `legacy-canvas-actions.ts`. */
|
|
29
|
+
readonly legacyCanvasActions: {
|
|
30
|
+
readonly below: "0.4.0";
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
export type SdkShim = keyof typeof SDK_SHIMS;
|
|
34
|
+
/** Semver order of two sdk versions (prerelease below its release). Negative when `a` is older. */
|
|
35
|
+
export declare function compareSdkVersions(a: string, b: string): number;
|
|
36
|
+
/** The shims a bundle built against `builtWithSdk` needs. Unstamped = legacy = every shim. */
|
|
37
|
+
export declare function sdkShimsFor(builtWithSdk: string | undefined): SdkShim[];
|
|
38
|
+
/**
|
|
39
|
+
* Why a release built against `builtWithSdk` cannot be bound to a space on a
|
|
40
|
+
* platform serving `platformSdk` — `null` when it can. Unstamped releases are
|
|
41
|
+
* admitted: they are legacy, and legacy keeps working until a deliberate cutoff.
|
|
42
|
+
*/
|
|
43
|
+
export declare function sdkWindowProblem(builtWithSdk: string | undefined, platformSdk: string): string | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The query parameter a visitor socket upgrade carries its socket ticket on.
|
|
3
|
+
*
|
|
4
|
+
* A wire contract between every dialer (the engine, the pre-hydration boot dial,
|
|
5
|
+
* the CLI) and the api's upgrade gate, so it lives here once. A browser
|
|
6
|
+
* WebSocket cannot set headers, which is why it rides the URL; the ticket is
|
|
7
|
+
* single-purpose and expires in seconds (`@fourty/platform/socket-ticket`).
|
|
8
|
+
*/
|
|
9
|
+
export declare const SOCKET_TICKET_PARAM = "ticket";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The visitor/trace socket's protocol version — the contract between every
|
|
3
|
+
* engine ever published (`/embed/engine/:version`, served forever) and the api
|
|
4
|
+
* it talks to today. ONE number for the whole socket: the frames the engine
|
|
5
|
+
* sends and the `TraceEvent` union it reads.
|
|
6
|
+
*
|
|
7
|
+
* Bump `WIRE_PROTOCOL_VERSION` when a change would make an older engine
|
|
8
|
+
* mis-render (a variant renamed or reshaped, a frame it must send). Raise
|
|
9
|
+
* `MIN_WIRE_PROTOCOL_VERSION` only as the deliberate cutoff, once the older
|
|
10
|
+
* engines are gone: the api then closes their sockets with
|
|
11
|
+
* `WIRE_PROTOCOL_UNSUPPORTED_CLOSE` instead of letting them mis-render.
|
|
12
|
+
*
|
|
13
|
+
* An upgrade that carries NO version is an engine built before this contract.
|
|
14
|
+
* It is admitted (and logged) until the cutoff — see `docs/adr/0006`.
|
|
15
|
+
*/
|
|
16
|
+
export declare const WIRE_PROTOCOL_VERSION = 1;
|
|
17
|
+
export declare const MIN_WIRE_PROTOCOL_VERSION = 1;
|
|
18
|
+
/** The query parameter the upgrade carries the version on, beside the socket ticket. */
|
|
19
|
+
export declare const WIRE_PROTOCOL_PARAM = "protocol";
|
|
20
|
+
/**
|
|
21
|
+
* The close code a refused engine receives, right after the upgrade — a refusal
|
|
22
|
+
* BEFORE the upgrade is an HTTP status a browser WebSocket never shows its page.
|
|
23
|
+
* The close reason says which versions the api accepts.
|
|
24
|
+
*/
|
|
25
|
+
export declare const WIRE_PROTOCOL_UNSUPPORTED_CLOSE = 4426;
|
|
@@ -31,7 +31,7 @@ export { isElementUnfilled, rendersNothing } from './catalog/element-filled';
|
|
|
31
31
|
export { carriesShapeToken } from './catalog/shape-tokens';
|
|
32
32
|
export { applySinglePatch } from './layout/apply-patch';
|
|
33
33
|
export { derivePropsDoc } from './catalog/derive-props-doc';
|
|
34
|
-
export { WireSchemaSchema, WireCatalogSchema, WireCatalogEntrySchema, schemaToWire, schemaFromWire, catalogToWire, catalogFromWire, UnsupportedSchemaError, PackageReleaseSchema, draftSourceId, isDraftSource, releasePreviewSourceId, parseReleasePreview, type PackageRelease, type WireSchema, type WireCatalog, type WireCatalogEntry, } from './catalog/wire';
|
|
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
36
|
export { VIEW_FOCUS_ELEMENT_SIGNAL, FocusElementPayloadSchema, type FocusElementPayload, } from './focus/focus';
|
|
37
37
|
export { VIEW_EXTEND_SIGNAL, VIEW_EXHAUSTED_SIGNAL, ViewExtendPayloadSchema, CONTINUATION_ENABLED, type ViewExtendPayload, } from './view/continuation';
|
|
@@ -41,6 +41,8 @@ export { ALLOWED_ATTACHMENT_TYPES, MAX_ATTACHMENT_BYTES, isAllowedAttachmentType
|
|
|
41
41
|
export { ENTRY_CONTEXT_MAX_VALUE_CHARS, ENTRY_CONTEXT_MAX_KEYS, ENTRY_CONTEXT_MAX_NAMESPACES, ENTRY_CONTEXT_MAX_NAME_CHARS, EntryContextValueSchema, EntryContextNamespaceSchema, EntryContextSchema, type EntryContext, } from './contracts/entry-context';
|
|
42
42
|
export { ARRIVAL_MAX_VALUE_CHARS, SURFACES, SurfaceSchema, type Surface, CLICK_ID_KINDS, ClickIdKindSchema, type ClickIdKind, VISITOR_ID_DURABILITIES, VisitorIdDurabilitySchema, type VisitorIdDurability, TRAFFIC_BUCKETS, TrafficBucketSchema, type TrafficBucket, SessionArrivalSchema, type SessionArrival, type RecordedSessionArrival, } from './contracts/session-arrival';
|
|
43
43
|
export { ARRIVAL_PARAMS, REFERRER_HOST_PARAM, arrivalFromParams, arrivalToParams, type ArrivalEvidence, } from './contracts/session-arrival-params';
|
|
44
|
+
export { SOCKET_TICKET_PARAM } from './contracts/socket-ticket-param';
|
|
45
|
+
export { WIRE_PROTOCOL_VERSION, MIN_WIRE_PROTOCOL_VERSION, WIRE_PROTOCOL_PARAM, WIRE_PROTOCOL_UNSUPPORTED_CLOSE, } from './contracts/wire-protocol';
|
|
44
46
|
export { type AttributeDef, type AttributeRegistry, type AttributeScopeBucket, type AttributeScopeConfig, AttributeDefSchema, AttributeScopeBucketSchema, AttributeScopeConfigSchema, EXTRAS_PREFIX, } from './catalog/attribute-registry';
|
|
45
47
|
export { resolveScope, normalizeAttributeField, scopedAttributeKey, scopeOfAttributeKey, } from './catalog/attribute-scope';
|
|
46
48
|
export type { Space, SpaceName, CreateSpaceInput, UpdateSpaceInput, SpaceConnector, UpsertSpaceConnectorInput } from './space/space';
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
*/
|
|
19
19
|
import type { ActionDefinition, AskDefinition, FlowSpec } from '../signal/agent-signals';
|
|
20
20
|
import type { Spec } from '../layout/layout';
|
|
21
|
+
import type { BrandMarkImage } from '../catalog/wire/brand-mark';
|
|
21
22
|
/**
|
|
22
23
|
* A workspace-bundled brand's composition identity. Exported BY the brand
|
|
23
24
|
* package (the brand owns its definition); this is only the shared shape so
|
|
@@ -76,6 +77,14 @@ export interface BrandDefinition {
|
|
|
76
77
|
* prose teaches, so the section can never outlive them (the capability gate
|
|
77
78
|
* fails the space, naming the section). Absent when the brand teaches none. */
|
|
78
79
|
promptSections?: BrandPromptSection[];
|
|
80
|
+
/** The brand's mark (`catalog/wire/brand-mark.ts`) — for a brand compiled
|
|
81
|
+
* into the platform, files the platform serves (`/brand/<slug>/…`). A
|
|
82
|
+
* published brand ships the files in its release instead. Absent = the
|
|
83
|
+
* space's initial stands in. */
|
|
84
|
+
mark?: {
|
|
85
|
+
square?: BrandMarkImage;
|
|
86
|
+
wordmark?: BrandMarkImage;
|
|
87
|
+
};
|
|
79
88
|
/** Opaque per-vertical extension blob (§VIII.1) — this universal shape
|
|
80
89
|
* stays vertical-agnostic; a vertical's own code (e.g. the commerce
|
|
81
90
|
* engine) reads its own keys out of this bag and owns their meaning.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { type AgentPresenceFrame, type PresenceFact, SCANNING_FORM, } from './frame';
|
|
2
|
-
export { deriveSourceElement, pendingSourceElement, type SourceElementInput, type SourceLookupInput, } from './scan';
|
|
2
|
+
export { deriveSourceElement, pendingSourceElement, projectSourceOutput, type ProjectedSourceOutput, type SourceElementInput, type SourceLookupInput, } from './scan';
|
|
3
3
|
export { type PresenceElementKind, type PresenceElement, type PresenceSourceRef, type PresenceSourceElement, type PresenceFactArtifact, type PresenceFactElement, type PresenceVoiceElement, type PresenceConcessionElement, type PresenceAskElement, type PresenceRetireOn, type PresenceLifecycle, type PresenceStreamArtifact, isPresenceStreamArtifact, PRESENCE_LIFECYCLE, } from './element';
|
|
4
4
|
export { type PresenceProfile, PresenceProfileSchema, DEFAULT_PRESENCE_PROFILE } from './profile';
|
|
@@ -43,3 +43,24 @@ export declare function pendingSourceElement(input: SourceLookupInput): Presence
|
|
|
43
43
|
* rendering gap and an empty shelf are different facts.
|
|
44
44
|
*/
|
|
45
45
|
export declare function deriveSourceElement(input: SourceElementInput): PresenceSourceElement | undefined;
|
|
46
|
+
/** What `projectSourceOutput` keeps of a tool result: the drawable records under
|
|
47
|
+
* one recognized key, and the tool's own `total` when it reports one. */
|
|
48
|
+
export interface ProjectedSourceOutput {
|
|
49
|
+
results: Record<string, string | number | boolean>[];
|
|
50
|
+
total?: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* The part of a tool result that may leave the server for a VISITOR.
|
|
54
|
+
*
|
|
55
|
+
* `deriveSourceElement` reads a record's `id`, its image, and its short scalar
|
|
56
|
+
* facets — nothing else. The raw result carries much more (nested objects,
|
|
57
|
+
* documents, audit keys, connector diagnostics), and the visitor wire is
|
|
58
|
+
* public. This keeps exactly what the derivation reads, in a shape it parses
|
|
59
|
+
* to the SAME element, so the trim is invisible to every card while the rest of
|
|
60
|
+
* the result stays on the trace channel.
|
|
61
|
+
*
|
|
62
|
+
* `undefined` when the result carries no recognizable record array — the same
|
|
63
|
+
* line `deriveSourceElement` draws, so a dropped output and an underivable one
|
|
64
|
+
* are the same outcome on the client.
|
|
65
|
+
*/
|
|
66
|
+
export declare function projectSourceOutput(output: unknown): ProjectedSourceOutput | undefined;
|