@40rty/ams-sdk 0.4.3 → 0.5.0
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 +547 -493
- package/dist/types/ecommerce/src/review-schemas.d.ts +24 -10
- package/dist/types/sdk/src/host/host-modules.d.ts +301 -10
- package/dist/types/sdk/src/shell/conversation/use-conversation-page.d.ts +9 -1
- package/dist/types/spacestation/src/catalog/wire/brand-mark.d.ts +230 -0
- package/dist/types/spacestation/src/catalog/wire/index.d.ts +1 -0
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +137 -0
- package/dist/types/spacestation/src/index.d.ts +1 -1
- package/dist/types/spacestation/src/space/workspace-catalog.d.ts +9 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -33,6 +33,11 @@ __export(src_exports3, {
|
|
|
33
33
|
AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
|
|
34
34
|
AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
|
|
35
35
|
AvailabilityStatusSchema: () => AvailabilityStatusSchema,
|
|
36
|
+
BRAND_MARK_MAX_BYTES: () => BRAND_MARK_MAX_BYTES,
|
|
37
|
+
BRAND_MARK_SLOTS: () => BRAND_MARK_SLOTS,
|
|
38
|
+
BRAND_MARK_TYPES: () => BRAND_MARK_TYPES,
|
|
39
|
+
BrandMarkImageSchema: () => BrandMarkImageSchema,
|
|
40
|
+
BrandMarkSchema: () => BrandMarkSchema,
|
|
36
41
|
BugLocationSchema: () => BugLocationSchema,
|
|
37
42
|
BugSeveritySchema: () => BugSeveritySchema,
|
|
38
43
|
CANVAS_ARRANGEMENTS: () => CANVAS_ARRANGEMENTS,
|
|
@@ -216,6 +221,7 @@ __export(src_exports3, {
|
|
|
216
221
|
ShellRootContext: () => ShellRootContext,
|
|
217
222
|
ShimmerSweep: () => ShimmerSweep,
|
|
218
223
|
SiblingProductSchema: () => SiblingProductSchema,
|
|
224
|
+
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
219
225
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
220
226
|
SpacefrontCanvas: () => SpacefrontCanvas,
|
|
221
227
|
SpacefrontPreviewProvider: () => SpacefrontPreviewProvider,
|
|
@@ -1400,6 +1406,11 @@ __export(src_exports, {
|
|
|
1400
1406
|
AttributeDefSchema: () => AttributeDefSchema,
|
|
1401
1407
|
AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
|
|
1402
1408
|
AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
|
|
1409
|
+
BRAND_MARK_MAX_BYTES: () => BRAND_MARK_MAX_BYTES,
|
|
1410
|
+
BRAND_MARK_SLOTS: () => BRAND_MARK_SLOTS,
|
|
1411
|
+
BRAND_MARK_TYPES: () => BRAND_MARK_TYPES,
|
|
1412
|
+
BrandMarkImageSchema: () => BrandMarkImageSchema,
|
|
1413
|
+
BrandMarkSchema: () => BrandMarkSchema,
|
|
1403
1414
|
BugLocationSchema: () => BugLocationSchema,
|
|
1404
1415
|
BugSeveritySchema: () => BugSeveritySchema,
|
|
1405
1416
|
CANVAS_ARRANGEMENTS: () => CANVAS_ARRANGEMENTS,
|
|
@@ -1498,6 +1509,7 @@ __export(src_exports, {
|
|
|
1498
1509
|
SessionVerdictSchema: () => SessionVerdictSchema,
|
|
1499
1510
|
ShellConfigSchema: () => ShellConfigSchema,
|
|
1500
1511
|
ShellMenuItemSchema: () => ShellMenuItemSchema,
|
|
1512
|
+
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
1501
1513
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
1502
1514
|
SpecSchema: () => SpecSchema,
|
|
1503
1515
|
StateSnapshotFrameSchema: () => StateSnapshotFrameSchema,
|
|
@@ -3300,20 +3312,41 @@ function catalogFromWire(wire) {
|
|
|
3300
3312
|
}
|
|
3301
3313
|
|
|
3302
3314
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
3315
|
+
import { z as z26 } from "zod";
|
|
3316
|
+
|
|
3317
|
+
// ../spacestation/src/catalog/wire/brand-mark.ts
|
|
3303
3318
|
import { z as z25 } from "zod";
|
|
3319
|
+
var BRAND_MARK_TYPES = ["svg", "png"];
|
|
3320
|
+
var BRAND_MARK_MAX_BYTES = 256 * 1024;
|
|
3321
|
+
var MAX_BASE64_LENGTH = Math.ceil(BRAND_MARK_MAX_BYTES / 3) * 4;
|
|
3322
|
+
var BrandMarkUploadSchema = z25.object({
|
|
3323
|
+
type: z25.enum(BRAND_MARK_TYPES),
|
|
3324
|
+
data: z25.string().base64().min(1).max(MAX_BASE64_LENGTH, `a mark file is at most ${BRAND_MARK_MAX_BYTES / 1024} KB`)
|
|
3325
|
+
}).strict();
|
|
3326
|
+
var BrandMarkStoredSchema = z25.object({
|
|
3327
|
+
type: z25.enum(BRAND_MARK_TYPES),
|
|
3328
|
+
sha256: z25.string().regex(/^[0-9a-f]{64}$/, "a stored mark is named by its sha256")
|
|
3329
|
+
}).strict();
|
|
3330
|
+
var BrandMarkFileSchema = z25.union([BrandMarkUploadSchema, BrandMarkStoredSchema]);
|
|
3331
|
+
var BRAND_MARK_SLOTS = ["square", "wordmark"];
|
|
3332
|
+
var BrandMarkSchema = z25.object({ square: BrandMarkFileSchema.optional(), wordmark: BrandMarkFileSchema.optional() }).strict().refine((mark) => mark.square !== void 0 || mark.wordmark !== void 0, "a mark names a square, a wordmark, or both");
|
|
3333
|
+
var BrandMarkImageSchema = z25.object({ src: z25.string().min(1), type: z25.enum(BRAND_MARK_TYPES) }).strict();
|
|
3334
|
+
var SpaceBrandMarkSchema = z25.object({ square: BrandMarkImageSchema.nullable(), wordmark: BrandMarkImageSchema.nullable() }).strict();
|
|
3335
|
+
|
|
3336
|
+
// ../spacestation/src/catalog/wire/package-release.ts
|
|
3304
3337
|
var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
|
|
3305
3338
|
var BUNDLE_ASSET_PATH = /^assets\/[A-Za-z0-9_-]+\.(woff2?|ttf|otf|png|jpe?g|svg|gif|webp)$/;
|
|
3306
|
-
var PackageReleaseSchema =
|
|
3339
|
+
var PackageReleaseSchema = z26.object({
|
|
3307
3340
|
/** The id spaces name in `componentSources` — an npm-style package name. */
|
|
3308
|
-
sourceId:
|
|
3309
|
-
label:
|
|
3341
|
+
sourceId: z26.string().regex(/^(@[a-z0-9][a-z0-9-]*\/)?[a-z0-9][a-z0-9-]*$/, "sourceId must be an npm-style package name").refine((id) => !RESERVED_SCOPES.some((scope2) => id.startsWith(scope2)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
|
|
3342
|
+
label: z26.string().min(1).max(120),
|
|
3310
3343
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
3311
|
-
version:
|
|
3344
|
+
version: z26.string().min(1).max(40),
|
|
3312
3345
|
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
3313
|
-
description:
|
|
3346
|
+
description: z26.string().min(1).max(500).optional(),
|
|
3314
3347
|
catalog: WireCatalogSchema,
|
|
3315
3348
|
/** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
|
|
3316
|
-
manifests:
|
|
3349
|
+
manifests: z26.record(z26.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z26.string()),
|
|
3317
3350
|
/**
|
|
3318
3351
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
3319
3352
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
@@ -3322,34 +3355,40 @@ var PackageReleaseSchema = z25.object({
|
|
|
3322
3355
|
* images — base64, keyed by the path the stylesheet's `url()` names, beside
|
|
3323
3356
|
* it). It is served to browsers; the platform's servers never run it.
|
|
3324
3357
|
*/
|
|
3325
|
-
bundle:
|
|
3326
|
-
js:
|
|
3327
|
-
css:
|
|
3328
|
-
assets:
|
|
3358
|
+
bundle: z26.object({
|
|
3359
|
+
js: z26.string().min(1),
|
|
3360
|
+
css: z26.string(),
|
|
3361
|
+
assets: z26.record(z26.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z26.string().base64()).optional()
|
|
3329
3362
|
}).strict().optional(),
|
|
3330
3363
|
/**
|
|
3331
3364
|
* The class the spacefront root carries while this package is the space's.
|
|
3332
3365
|
* The package's own stylesheet styles under it. Absent = the platform's
|
|
3333
3366
|
* default theme class.
|
|
3334
3367
|
*/
|
|
3335
|
-
theme:
|
|
3368
|
+
theme: z26.object({ themeClass: z26.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
|
|
3369
|
+
/**
|
|
3370
|
+
* The brand's mark (`brand-mark.ts`). Sent as the files themselves; the
|
|
3371
|
+
* platform stores them content-addressed at ingest and keeps only their
|
|
3372
|
+
* addresses here.
|
|
3373
|
+
*/
|
|
3374
|
+
mark: BrandMarkSchema.optional(),
|
|
3336
3375
|
/** The canvas a fresh session opens on, before the visitor has asked anything. */
|
|
3337
3376
|
seedLayout: SpecSchema.optional(),
|
|
3338
3377
|
/**
|
|
3339
3378
|
* The package's own composition guidance for its own components — prompt
|
|
3340
3379
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
3341
3380
|
*/
|
|
3342
|
-
promptSections:
|
|
3381
|
+
promptSections: z26.array(z26.object({ id: z26.string().regex(/^[a-z0-9-]+$/), order: z26.number().int(), content: z26.string().min(1).max(2e4), requires: z26.array(z26.string()) }).strict()).max(10).optional(),
|
|
3343
3382
|
/**
|
|
3344
3383
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
3345
3384
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
3346
3385
|
*/
|
|
3347
|
-
config:
|
|
3386
|
+
config: z26.record(z26.string(), z26.unknown()).optional(),
|
|
3348
3387
|
/**
|
|
3349
3388
|
* Set by the platform, never by a publisher: this release is a DRAFT of the
|
|
3350
3389
|
* package `of`, previewed on the space `space`. See `draftSourceId`.
|
|
3351
3390
|
*/
|
|
3352
|
-
draft:
|
|
3391
|
+
draft: z26.object({ of: z26.string().min(1), space: z26.string().min(1) }).strict().optional()
|
|
3353
3392
|
}).strict();
|
|
3354
3393
|
var DRAFT_SEPARATOR = "--";
|
|
3355
3394
|
function draftSourceId(sourceId, spaceSlug, developer) {
|
|
@@ -3368,36 +3407,36 @@ function parseReleasePreview(id) {
|
|
|
3368
3407
|
}
|
|
3369
3408
|
|
|
3370
3409
|
// ../spacestation/src/projection/projection.ts
|
|
3371
|
-
import { z as
|
|
3372
|
-
var LateBoundValueSchema =
|
|
3373
|
-
var DirectiveValueSchema =
|
|
3374
|
-
|
|
3375
|
-
|
|
3376
|
-
|
|
3410
|
+
import { z as z27 } from "zod";
|
|
3411
|
+
var LateBoundValueSchema = z27.object({ fact: z27.literal(true) });
|
|
3412
|
+
var DirectiveValueSchema = z27.union([
|
|
3413
|
+
z27.string(),
|
|
3414
|
+
z27.number(),
|
|
3415
|
+
z27.boolean(),
|
|
3377
3416
|
LateBoundValueSchema
|
|
3378
3417
|
]);
|
|
3379
3418
|
function isLateBound(v) {
|
|
3380
3419
|
return typeof v === "object" && v !== null && "fact" in v;
|
|
3381
3420
|
}
|
|
3382
|
-
var ProjectionDirectiveSchema =
|
|
3421
|
+
var ProjectionDirectiveSchema = z27.object({
|
|
3383
3422
|
/** Keep only items whose axis values all match. Keyed by axis name
|
|
3384
3423
|
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
3385
|
-
isolateTo:
|
|
3424
|
+
isolateTo: z27.record(DirectiveValueSchema).optional(),
|
|
3386
3425
|
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
3387
3426
|
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
3388
3427
|
* entity binding expands it against the entity's own axes + facts. */
|
|
3389
|
-
isolateToFacts:
|
|
3428
|
+
isolateToFacts: z27.boolean().optional(),
|
|
3390
3429
|
/** Keep only items the entity binding reports as available. */
|
|
3391
|
-
availableOnly:
|
|
3430
|
+
availableOnly: z27.boolean().optional(),
|
|
3392
3431
|
/** Cap the rendered count after filtering. */
|
|
3393
|
-
limit:
|
|
3432
|
+
limit: z27.number().int().positive().optional()
|
|
3394
3433
|
});
|
|
3395
|
-
var ProjectionPreferencesSchema =
|
|
3396
|
-
|
|
3434
|
+
var ProjectionPreferencesSchema = z27.record(
|
|
3435
|
+
z27.union([ProjectionDirectiveSchema, z27.null()])
|
|
3397
3436
|
);
|
|
3398
3437
|
var PROJECTION_SET_SIGNAL = "projection.set";
|
|
3399
|
-
var ProjectionSetPayloadSchema =
|
|
3400
|
-
setAll:
|
|
3438
|
+
var ProjectionSetPayloadSchema = z27.object({
|
|
3439
|
+
setAll: z27.union([ProjectionDirectiveSchema, z27.null()]).optional(),
|
|
3401
3440
|
set: ProjectionPreferencesSchema.optional()
|
|
3402
3441
|
});
|
|
3403
3442
|
function norm(v) {
|
|
@@ -3431,23 +3470,23 @@ function isActiveDirective(directive) {
|
|
|
3431
3470
|
}
|
|
3432
3471
|
|
|
3433
3472
|
// ../spacestation/src/focus/focus.ts
|
|
3434
|
-
import { z as
|
|
3473
|
+
import { z as z28 } from "zod";
|
|
3435
3474
|
var VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
|
|
3436
|
-
var FocusElementPayloadSchema =
|
|
3437
|
-
elementId:
|
|
3475
|
+
var FocusElementPayloadSchema = z28.object({
|
|
3476
|
+
elementId: z28.string().min(1)
|
|
3438
3477
|
});
|
|
3439
3478
|
|
|
3440
3479
|
// ../spacestation/src/view/continuation.ts
|
|
3441
|
-
import { z as
|
|
3480
|
+
import { z as z29 } from "zod";
|
|
3442
3481
|
var VIEW_EXTEND_SIGNAL = "view.extend";
|
|
3443
|
-
var ViewExtendPayloadSchema =
|
|
3444
|
-
reason:
|
|
3482
|
+
var ViewExtendPayloadSchema = z29.object({
|
|
3483
|
+
reason: z29.enum(["scroll_near_bottom"])
|
|
3445
3484
|
});
|
|
3446
3485
|
var VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
|
|
3447
3486
|
var CONTINUATION_ENABLED = false;
|
|
3448
3487
|
|
|
3449
3488
|
// ../spacestation/src/attachment/attachment.ts
|
|
3450
|
-
import { z as
|
|
3489
|
+
import { z as z30 } from "zod";
|
|
3451
3490
|
var ALLOWED_ATTACHMENT_TYPES = [
|
|
3452
3491
|
"image/jpeg",
|
|
3453
3492
|
"image/png",
|
|
@@ -3462,34 +3501,34 @@ function isAllowedAttachmentType(mime) {
|
|
|
3462
3501
|
function isImageAttachment(mime) {
|
|
3463
3502
|
return mime.startsWith("image/");
|
|
3464
3503
|
}
|
|
3465
|
-
var AttachmentRefSchema =
|
|
3466
|
-
id:
|
|
3467
|
-
mimeType:
|
|
3504
|
+
var AttachmentRefSchema = z30.object({
|
|
3505
|
+
id: z30.string().min(1),
|
|
3506
|
+
mimeType: z30.string().refine(isAllowedAttachmentType, {
|
|
3468
3507
|
message: "mimeType not on the attachment allow-list"
|
|
3469
3508
|
}),
|
|
3470
|
-
name:
|
|
3471
|
-
size:
|
|
3472
|
-
url:
|
|
3509
|
+
name: z30.string().min(1),
|
|
3510
|
+
size: z30.number().int().positive().max(MAX_ATTACHMENT_BYTES),
|
|
3511
|
+
url: z30.string().min(1)
|
|
3473
3512
|
});
|
|
3474
|
-
var AttachmentRefsSchema =
|
|
3513
|
+
var AttachmentRefsSchema = z30.array(AttachmentRefSchema);
|
|
3475
3514
|
|
|
3476
3515
|
// ../spacestation/src/contracts/entry-context.ts
|
|
3477
|
-
import { z as
|
|
3516
|
+
import { z as z31 } from "zod";
|
|
3478
3517
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
3479
3518
|
var ENTRY_CONTEXT_MAX_KEYS = 12;
|
|
3480
3519
|
var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
|
|
3481
3520
|
var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
|
|
3482
|
-
var EntryContextValueSchema =
|
|
3483
|
-
var EntryContextNameSchema =
|
|
3484
|
-
var EntryContextNamespaceSchema =
|
|
3521
|
+
var EntryContextValueSchema = z31.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
|
|
3522
|
+
var EntryContextNameSchema = z31.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
|
|
3523
|
+
var EntryContextNamespaceSchema = z31.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
|
|
3485
3524
|
message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
|
|
3486
3525
|
});
|
|
3487
|
-
var EntryContextSchema =
|
|
3526
|
+
var EntryContextSchema = z31.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
|
|
3488
3527
|
message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
|
|
3489
3528
|
});
|
|
3490
3529
|
|
|
3491
3530
|
// ../spacestation/src/contracts/session-arrival.ts
|
|
3492
|
-
import { z as
|
|
3531
|
+
import { z as z32 } from "zod";
|
|
3493
3532
|
var SURFACES = [
|
|
3494
3533
|
"spacefront",
|
|
3495
3534
|
"embed",
|
|
@@ -3499,11 +3538,11 @@ var SURFACES = [
|
|
|
3499
3538
|
"playground",
|
|
3500
3539
|
"automation"
|
|
3501
3540
|
];
|
|
3502
|
-
var SurfaceSchema =
|
|
3541
|
+
var SurfaceSchema = z32.enum(SURFACES);
|
|
3503
3542
|
var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
|
|
3504
|
-
var ClickIdKindSchema =
|
|
3543
|
+
var ClickIdKindSchema = z32.enum(CLICK_ID_KINDS);
|
|
3505
3544
|
var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
|
|
3506
|
-
var VisitorIdDurabilitySchema =
|
|
3545
|
+
var VisitorIdDurabilitySchema = z32.enum(VISITOR_ID_DURABILITIES);
|
|
3507
3546
|
var TRAFFIC_BUCKETS = [
|
|
3508
3547
|
"paid_google",
|
|
3509
3548
|
"paid_meta",
|
|
@@ -3515,10 +3554,10 @@ var TRAFFIC_BUCKETS = [
|
|
|
3515
3554
|
"direct",
|
|
3516
3555
|
"unknown"
|
|
3517
3556
|
];
|
|
3518
|
-
var TrafficBucketSchema =
|
|
3557
|
+
var TrafficBucketSchema = z32.enum(TRAFFIC_BUCKETS);
|
|
3519
3558
|
var ARRIVAL_MAX_VALUE_CHARS = 200;
|
|
3520
|
-
var ArrivalValueSchema =
|
|
3521
|
-
var SessionArrivalSchema =
|
|
3559
|
+
var ArrivalValueSchema = z32.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
|
|
3560
|
+
var SessionArrivalSchema = z32.object({
|
|
3522
3561
|
utmSource: ArrivalValueSchema.optional(),
|
|
3523
3562
|
utmMedium: ArrivalValueSchema.optional(),
|
|
3524
3563
|
utmCampaign: ArrivalValueSchema.optional(),
|
|
@@ -3605,36 +3644,36 @@ function arrivalToParams(arrival, into) {
|
|
|
3605
3644
|
}
|
|
3606
3645
|
|
|
3607
3646
|
// ../spacestation/src/catalog/attribute-registry.ts
|
|
3608
|
-
import { z as
|
|
3609
|
-
var AttributeScopeBucketSchema =
|
|
3610
|
-
scope:
|
|
3611
|
-
needles:
|
|
3612
|
-
label:
|
|
3647
|
+
import { z as z33 } from "zod";
|
|
3648
|
+
var AttributeScopeBucketSchema = z33.object({
|
|
3649
|
+
scope: z33.string(),
|
|
3650
|
+
needles: z33.array(z33.string()).readonly(),
|
|
3651
|
+
label: z33.string().optional()
|
|
3613
3652
|
});
|
|
3614
|
-
var AttributeScopeConfigSchema =
|
|
3615
|
-
facet:
|
|
3616
|
-
buckets:
|
|
3617
|
-
emptyScope:
|
|
3618
|
-
noMatchScope:
|
|
3619
|
-
ignoreValues:
|
|
3620
|
-
emptyScopeLabel:
|
|
3621
|
-
noMatchScopeLabel:
|
|
3653
|
+
var AttributeScopeConfigSchema = z33.object({
|
|
3654
|
+
facet: z33.string(),
|
|
3655
|
+
buckets: z33.array(AttributeScopeBucketSchema).readonly(),
|
|
3656
|
+
emptyScope: z33.string(),
|
|
3657
|
+
noMatchScope: z33.string(),
|
|
3658
|
+
ignoreValues: z33.array(z33.string()).readonly(),
|
|
3659
|
+
emptyScopeLabel: z33.string().optional(),
|
|
3660
|
+
noMatchScopeLabel: z33.string().optional()
|
|
3622
3661
|
});
|
|
3623
|
-
var AttributeDefBaseSchema =
|
|
3624
|
-
description:
|
|
3625
|
-
durable:
|
|
3626
|
-
label:
|
|
3662
|
+
var AttributeDefBaseSchema = z33.object({
|
|
3663
|
+
description: z33.string().optional(),
|
|
3664
|
+
durable: z33.boolean().optional(),
|
|
3665
|
+
label: z33.string().optional()
|
|
3627
3666
|
});
|
|
3628
|
-
var AttributeDefSchema =
|
|
3629
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3630
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3631
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3632
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3667
|
+
var AttributeDefSchema = z33.discriminatedUnion("kind", [
|
|
3668
|
+
AttributeDefBaseSchema.extend({ kind: z33.literal("enum"), values: z33.array(z33.string()) }),
|
|
3669
|
+
AttributeDefBaseSchema.extend({ kind: z33.literal("free_text") }),
|
|
3670
|
+
AttributeDefBaseSchema.extend({ kind: z33.literal("date_or_season") }),
|
|
3671
|
+
AttributeDefBaseSchema.extend({ kind: z33.literal("money_or_band") }),
|
|
3633
3672
|
AttributeDefBaseSchema.extend({
|
|
3634
|
-
kind:
|
|
3635
|
-
min:
|
|
3636
|
-
max:
|
|
3637
|
-
unit:
|
|
3673
|
+
kind: z33.literal("number"),
|
|
3674
|
+
min: z33.number().optional(),
|
|
3675
|
+
max: z33.number().optional(),
|
|
3676
|
+
unit: z33.string().optional()
|
|
3638
3677
|
})
|
|
3639
3678
|
]);
|
|
3640
3679
|
var EXTRAS_PREFIX = "extras.";
|
|
@@ -3734,30 +3773,30 @@ function hostingAllows(hosting, surface) {
|
|
|
3734
3773
|
}
|
|
3735
3774
|
|
|
3736
3775
|
// ../spacestation/src/space/trace.ts
|
|
3737
|
-
import { z as
|
|
3738
|
-
var RunTokenUsageSchema =
|
|
3739
|
-
input_tokens:
|
|
3740
|
-
output_tokens:
|
|
3741
|
-
cache_read_tokens:
|
|
3776
|
+
import { z as z34 } from "zod";
|
|
3777
|
+
var RunTokenUsageSchema = z34.object({
|
|
3778
|
+
input_tokens: z34.number().optional(),
|
|
3779
|
+
output_tokens: z34.number().optional(),
|
|
3780
|
+
cache_read_tokens: z34.number().optional()
|
|
3742
3781
|
});
|
|
3743
|
-
var TraceRecordSchema =
|
|
3744
|
-
id:
|
|
3745
|
-
spaceId:
|
|
3746
|
-
sessionId:
|
|
3782
|
+
var TraceRecordSchema = z34.object({
|
|
3783
|
+
id: z34.string().uuid(),
|
|
3784
|
+
spaceId: z34.string().uuid().nullable(),
|
|
3785
|
+
sessionId: z34.string(),
|
|
3747
3786
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
3748
3787
|
* for an unlocked space / anonymous unlock. */
|
|
3749
|
-
visitorEmail:
|
|
3750
|
-
userPrompt:
|
|
3751
|
-
branch:
|
|
3752
|
-
responseText:
|
|
3753
|
-
layout:
|
|
3754
|
-
phaseTimings:
|
|
3755
|
-
tokensByModel:
|
|
3756
|
-
toolCalls:
|
|
3757
|
-
diagnostics:
|
|
3758
|
-
latencyFirstText:
|
|
3759
|
-
latencyFirstPatch:
|
|
3760
|
-
latencyTotal:
|
|
3788
|
+
visitorEmail: z34.string().nullable(),
|
|
3789
|
+
userPrompt: z34.string(),
|
|
3790
|
+
branch: z34.string().nullable(),
|
|
3791
|
+
responseText: z34.string().nullable(),
|
|
3792
|
+
layout: z34.unknown().nullable(),
|
|
3793
|
+
phaseTimings: z34.record(z34.number()).nullable(),
|
|
3794
|
+
tokensByModel: z34.record(RunTokenUsageSchema).nullable(),
|
|
3795
|
+
toolCalls: z34.array(z34.unknown()).nullable(),
|
|
3796
|
+
diagnostics: z34.array(z34.unknown()).nullable(),
|
|
3797
|
+
latencyFirstText: z34.number().int().nullable(),
|
|
3798
|
+
latencyFirstPatch: z34.number().int().nullable(),
|
|
3799
|
+
latencyTotal: z34.number().int().nullable(),
|
|
3761
3800
|
/**
|
|
3762
3801
|
* The CLIENT's turn id for this run, or `null`.
|
|
3763
3802
|
*
|
|
@@ -3773,29 +3812,29 @@ var TraceRecordSchema = z33.object({
|
|
|
3773
3812
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3774
3813
|
* visitor asked something and got nothing.
|
|
3775
3814
|
*/
|
|
3776
|
-
turnId:
|
|
3815
|
+
turnId: z34.string().nullable(),
|
|
3777
3816
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
3778
3817
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
3779
|
-
trackerState:
|
|
3780
|
-
createdAt:
|
|
3818
|
+
trackerState: z34.unknown().nullable(),
|
|
3819
|
+
createdAt: z34.string()
|
|
3781
3820
|
});
|
|
3782
|
-
var MillisecondsSchema =
|
|
3783
|
-
var CreateTraceInputSchema =
|
|
3784
|
-
spaceId:
|
|
3785
|
-
sessionId:
|
|
3786
|
-
visitorEmail:
|
|
3787
|
-
userPrompt:
|
|
3788
|
-
branch:
|
|
3789
|
-
responseText:
|
|
3790
|
-
layout:
|
|
3791
|
-
phaseTimings:
|
|
3792
|
-
tokensByModel:
|
|
3793
|
-
toolCalls:
|
|
3794
|
-
diagnostics:
|
|
3821
|
+
var MillisecondsSchema = z34.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
3822
|
+
var CreateTraceInputSchema = z34.object({
|
|
3823
|
+
spaceId: z34.string().uuid().nullable(),
|
|
3824
|
+
sessionId: z34.string(),
|
|
3825
|
+
visitorEmail: z34.string().nullable(),
|
|
3826
|
+
userPrompt: z34.string(),
|
|
3827
|
+
branch: z34.string().nullable(),
|
|
3828
|
+
responseText: z34.string().nullable(),
|
|
3829
|
+
layout: z34.unknown().nullable(),
|
|
3830
|
+
phaseTimings: z34.record(z34.number()).nullable(),
|
|
3831
|
+
tokensByModel: z34.record(RunTokenUsageSchema).nullable(),
|
|
3832
|
+
toolCalls: z34.array(z34.unknown()).nullable(),
|
|
3833
|
+
diagnostics: z34.array(z34.unknown()).nullable(),
|
|
3795
3834
|
latencyFirstText: MillisecondsSchema,
|
|
3796
3835
|
latencyFirstPatch: MillisecondsSchema,
|
|
3797
3836
|
latencyTotal: MillisecondsSchema,
|
|
3798
|
-
trackerState:
|
|
3837
|
+
trackerState: z34.unknown().nullable(),
|
|
3799
3838
|
/**
|
|
3800
3839
|
* The CLIENT's turn id for this run, or `null`.
|
|
3801
3840
|
*
|
|
@@ -3811,37 +3850,37 @@ var CreateTraceInputSchema = z33.object({
|
|
|
3811
3850
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3812
3851
|
* visitor asked something and got nothing.
|
|
3813
3852
|
*/
|
|
3814
|
-
turnId:
|
|
3853
|
+
turnId: z34.string().nullable()
|
|
3815
3854
|
});
|
|
3816
|
-
var AgentSessionSummarySchema =
|
|
3817
|
-
sessionId:
|
|
3855
|
+
var AgentSessionSummarySchema = z34.object({
|
|
3856
|
+
sessionId: z34.string(),
|
|
3818
3857
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
3819
|
-
turnCount:
|
|
3858
|
+
turnCount: z34.number().int(),
|
|
3820
3859
|
/** The session's opening prompt — titles the row in the UI. */
|
|
3821
|
-
firstPrompt:
|
|
3822
|
-
startedAt:
|
|
3823
|
-
lastRunAt:
|
|
3860
|
+
firstPrompt: z34.string(),
|
|
3861
|
+
startedAt: z34.string(),
|
|
3862
|
+
lastRunAt: z34.string(),
|
|
3824
3863
|
/** Summed `latency_total` across the session's turns. */
|
|
3825
|
-
totalLatencyMs:
|
|
3864
|
+
totalLatencyMs: z34.number().int()
|
|
3826
3865
|
});
|
|
3827
|
-
var SessionTurnSchema =
|
|
3828
|
-
id:
|
|
3829
|
-
userPrompt:
|
|
3830
|
-
responseText:
|
|
3866
|
+
var SessionTurnSchema = z34.object({
|
|
3867
|
+
id: z34.string().uuid(),
|
|
3868
|
+
userPrompt: z34.string(),
|
|
3869
|
+
responseText: z34.string().nullable(),
|
|
3831
3870
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
3832
|
-
layout:
|
|
3833
|
-
createdAt:
|
|
3834
|
-
latencyTotal:
|
|
3835
|
-
phaseTimings:
|
|
3836
|
-
tokensByModel:
|
|
3837
|
-
input_tokens:
|
|
3838
|
-
output_tokens:
|
|
3871
|
+
layout: z34.unknown().nullable(),
|
|
3872
|
+
createdAt: z34.string(),
|
|
3873
|
+
latencyTotal: z34.number().int().nullable(),
|
|
3874
|
+
phaseTimings: z34.record(z34.number()).nullable(),
|
|
3875
|
+
tokensByModel: z34.record(z34.object({
|
|
3876
|
+
input_tokens: z34.number().optional(),
|
|
3877
|
+
output_tokens: z34.number().optional()
|
|
3839
3878
|
})).nullable(),
|
|
3840
|
-
toolCalls:
|
|
3841
|
-
diagnostics:
|
|
3879
|
+
toolCalls: z34.array(z34.unknown()).nullable(),
|
|
3880
|
+
diagnostics: z34.array(z34.unknown()).nullable()
|
|
3842
3881
|
});
|
|
3843
|
-
var SessionReplaySchema =
|
|
3844
|
-
turns:
|
|
3882
|
+
var SessionReplaySchema = z34.object({
|
|
3883
|
+
turns: z34.array(SessionTurnSchema),
|
|
3845
3884
|
/**
|
|
3846
3885
|
* The session's own last-committed layout, read straight off the durable
|
|
3847
3886
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -3852,20 +3891,20 @@ var SessionReplaySchema = z33.object({
|
|
|
3852
3891
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
3853
3892
|
* when the durable session row itself could not be read.
|
|
3854
3893
|
*/
|
|
3855
|
-
sessionLayout:
|
|
3894
|
+
sessionLayout: z34.record(z34.string(), z34.unknown()).nullable()
|
|
3856
3895
|
});
|
|
3857
|
-
var SessionTraceSchema =
|
|
3858
|
-
trackerState:
|
|
3896
|
+
var SessionTraceSchema = z34.object({
|
|
3897
|
+
trackerState: z34.string().nullable()
|
|
3859
3898
|
});
|
|
3860
|
-
var LlmUsageDailySchema =
|
|
3861
|
-
day:
|
|
3899
|
+
var LlmUsageDailySchema = z34.object({
|
|
3900
|
+
day: z34.string(),
|
|
3862
3901
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
3863
|
-
environment:
|
|
3864
|
-
feature:
|
|
3865
|
-
model:
|
|
3866
|
-
provider:
|
|
3902
|
+
environment: z34.string(),
|
|
3903
|
+
feature: z34.string(),
|
|
3904
|
+
model: z34.string(),
|
|
3905
|
+
provider: z34.string(),
|
|
3867
3906
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
3868
|
-
keyFingerprint:
|
|
3907
|
+
keyFingerprint: z34.string().nullable(),
|
|
3869
3908
|
/**
|
|
3870
3909
|
* The space the call served, or null when it served none.
|
|
3871
3910
|
*
|
|
@@ -3874,91 +3913,91 @@ var LlmUsageDailySchema = z33.object({
|
|
|
3874
3913
|
* report that share rather than dropping it, or a per-space total reads as
|
|
3875
3914
|
* the platform total.
|
|
3876
3915
|
*/
|
|
3877
|
-
spaceId:
|
|
3916
|
+
spaceId: z34.string().nullable(),
|
|
3878
3917
|
/**
|
|
3879
3918
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
3880
3919
|
* when it served no session or the session predates surface recording.
|
|
3881
3920
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
3882
3921
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
3883
3922
|
*/
|
|
3884
|
-
surface:
|
|
3885
|
-
inputTokens:
|
|
3886
|
-
outputTokens:
|
|
3923
|
+
surface: z34.string().nullable(),
|
|
3924
|
+
inputTokens: z34.number(),
|
|
3925
|
+
outputTokens: z34.number(),
|
|
3887
3926
|
/** Subset of inputTokens, never additional to it. */
|
|
3888
|
-
cachedInputTokens:
|
|
3889
|
-
reasoningTokens:
|
|
3890
|
-
callCount:
|
|
3891
|
-
errorCount:
|
|
3892
|
-
estimatedCostUsd:
|
|
3927
|
+
cachedInputTokens: z34.number(),
|
|
3928
|
+
reasoningTokens: z34.number(),
|
|
3929
|
+
callCount: z34.number(),
|
|
3930
|
+
errorCount: z34.number(),
|
|
3931
|
+
estimatedCostUsd: z34.number().nullable()
|
|
3893
3932
|
});
|
|
3894
|
-
var LlmUsageBySessionSchema =
|
|
3895
|
-
sessionId:
|
|
3896
|
-
environment:
|
|
3897
|
-
model:
|
|
3933
|
+
var LlmUsageBySessionSchema = z34.object({
|
|
3934
|
+
sessionId: z34.string(),
|
|
3935
|
+
environment: z34.string(),
|
|
3936
|
+
model: z34.string(),
|
|
3898
3937
|
/** The space this session belongs to, or null for a session with no space. */
|
|
3899
|
-
spaceId:
|
|
3938
|
+
spaceId: z34.string().nullable(),
|
|
3900
3939
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
3901
|
-
surface:
|
|
3940
|
+
surface: z34.string().nullable(),
|
|
3902
3941
|
/** Label only — the first feature seen in the session. */
|
|
3903
|
-
firstFeature:
|
|
3904
|
-
startedAt:
|
|
3905
|
-
endedAt:
|
|
3906
|
-
inputTokens:
|
|
3907
|
-
outputTokens:
|
|
3908
|
-
cachedInputTokens:
|
|
3909
|
-
reasoningTokens:
|
|
3910
|
-
callCount:
|
|
3911
|
-
errorCount:
|
|
3942
|
+
firstFeature: z34.string(),
|
|
3943
|
+
startedAt: z34.string(),
|
|
3944
|
+
endedAt: z34.string(),
|
|
3945
|
+
inputTokens: z34.number(),
|
|
3946
|
+
outputTokens: z34.number(),
|
|
3947
|
+
cachedInputTokens: z34.number(),
|
|
3948
|
+
reasoningTokens: z34.number(),
|
|
3949
|
+
callCount: z34.number(),
|
|
3950
|
+
errorCount: z34.number(),
|
|
3912
3951
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
3913
3952
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
3914
3953
|
* the model is unpriced; never 0, which would read as free. */
|
|
3915
|
-
estimatedCostUsd:
|
|
3954
|
+
estimatedCostUsd: z34.number().nullable()
|
|
3916
3955
|
});
|
|
3917
|
-
var LlmSessionsDailySchema =
|
|
3918
|
-
day:
|
|
3919
|
-
environment:
|
|
3920
|
-
sessionCount:
|
|
3956
|
+
var LlmSessionsDailySchema = z34.object({
|
|
3957
|
+
day: z34.string(),
|
|
3958
|
+
environment: z34.string(),
|
|
3959
|
+
sessionCount: z34.number()
|
|
3921
3960
|
});
|
|
3922
3961
|
|
|
3923
3962
|
// ../spacestation/src/space/session-queue.ts
|
|
3924
|
-
import { z as
|
|
3963
|
+
import { z as z36 } from "zod";
|
|
3925
3964
|
|
|
3926
3965
|
// ../spacestation/src/space/session-activity.ts
|
|
3927
|
-
import { z as
|
|
3928
|
-
var SessionActivityEventSchema =
|
|
3929
|
-
id:
|
|
3930
|
-
kind:
|
|
3931
|
-
occurredAt:
|
|
3932
|
-
source:
|
|
3933
|
-
surface:
|
|
3934
|
-
payload:
|
|
3966
|
+
import { z as z35 } from "zod";
|
|
3967
|
+
var SessionActivityEventSchema = z35.object({
|
|
3968
|
+
id: z35.string(),
|
|
3969
|
+
kind: z35.string(),
|
|
3970
|
+
occurredAt: z35.string(),
|
|
3971
|
+
source: z35.string(),
|
|
3972
|
+
surface: z35.string(),
|
|
3973
|
+
payload: z35.record(z35.unknown())
|
|
3935
3974
|
});
|
|
3936
|
-
var SessionActivitySchema =
|
|
3937
|
-
events:
|
|
3938
|
-
hasMore:
|
|
3975
|
+
var SessionActivitySchema = z35.object({
|
|
3976
|
+
events: z35.array(SessionActivityEventSchema),
|
|
3977
|
+
hasMore: z35.boolean()
|
|
3939
3978
|
});
|
|
3940
3979
|
|
|
3941
3980
|
// ../spacestation/src/space/session-queue.ts
|
|
3942
|
-
var SessionVerdictSchema =
|
|
3943
|
-
var RecordableVerdictSchema =
|
|
3944
|
-
var SessionReviewEventSchema =
|
|
3945
|
-
id:
|
|
3981
|
+
var SessionVerdictSchema = z36.enum(["unreviewed", "viewed", "bug"]);
|
|
3982
|
+
var RecordableVerdictSchema = z36.enum(["viewed", "bug"]);
|
|
3983
|
+
var SessionReviewEventSchema = z36.object({
|
|
3984
|
+
id: z36.string().uuid(),
|
|
3946
3985
|
verdict: RecordableVerdictSchema,
|
|
3947
3986
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
3948
3987
|
* log is append-only rather than a mutable current-state row. */
|
|
3949
|
-
reviewer:
|
|
3950
|
-
note:
|
|
3951
|
-
createdAt:
|
|
3988
|
+
reviewer: z36.string(),
|
|
3989
|
+
note: z36.string().nullable(),
|
|
3990
|
+
createdAt: z36.string()
|
|
3952
3991
|
});
|
|
3953
|
-
var BugSeveritySchema =
|
|
3954
|
-
var BugLocationSchema =
|
|
3955
|
-
elementId:
|
|
3992
|
+
var BugSeveritySchema = z36.enum(["high", "medium", "low"]);
|
|
3993
|
+
var BugLocationSchema = z36.object({
|
|
3994
|
+
elementId: z36.string().nullable(),
|
|
3956
3995
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
3957
3996
|
* alongside a null `elementId`. */
|
|
3958
|
-
elementType:
|
|
3997
|
+
elementType: z36.string().nullable(),
|
|
3959
3998
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
3960
|
-
offsetXPct:
|
|
3961
|
-
offsetYPct:
|
|
3999
|
+
offsetXPct: z36.number().min(0).max(100).nullable(),
|
|
4000
|
+
offsetYPct: z36.number().min(0).max(100).nullable(),
|
|
3962
4001
|
/**
|
|
3963
4002
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
3964
4003
|
* element anchor.
|
|
@@ -3969,8 +4008,8 @@ var BugLocationSchema = z35.object({
|
|
|
3969
4008
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
3970
4009
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
3971
4010
|
*/
|
|
3972
|
-
pageX:
|
|
3973
|
-
pageY:
|
|
4011
|
+
pageX: z36.number().nullable(),
|
|
4012
|
+
pageY: z36.number().nullable()
|
|
3974
4013
|
}).refine(
|
|
3975
4014
|
(loc) => {
|
|
3976
4015
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -3984,24 +4023,24 @@ var BugLocationSchema = z35.object({
|
|
|
3984
4023
|
message: "location must be one complete anchor: an element (elementId + elementType + both offsets), a page position (pageX + pageY), or a legacy page fraction (both offsets)"
|
|
3985
4024
|
}
|
|
3986
4025
|
);
|
|
3987
|
-
var SessionBugSchema =
|
|
3988
|
-
id:
|
|
4026
|
+
var SessionBugSchema = z36.object({
|
|
4027
|
+
id: z36.string().uuid(),
|
|
3989
4028
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
3990
|
-
turnIndex:
|
|
4029
|
+
turnIndex: z36.number().int().nullable(),
|
|
3991
4030
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
3992
4031
|
* without pinning a spot. */
|
|
3993
4032
|
location: BugLocationSchema.nullable(),
|
|
3994
|
-
provider:
|
|
3995
|
-
issueKey:
|
|
3996
|
-
issueUrl:
|
|
4033
|
+
provider: z36.string(),
|
|
4034
|
+
issueKey: z36.string().nullable(),
|
|
4035
|
+
issueUrl: z36.string().nullable(),
|
|
3997
4036
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
3998
4037
|
* open text. Null until first synced. */
|
|
3999
|
-
issueState:
|
|
4000
|
-
title:
|
|
4001
|
-
body:
|
|
4038
|
+
issueState: z36.string().nullable(),
|
|
4039
|
+
title: z36.string(),
|
|
4040
|
+
body: z36.string(),
|
|
4002
4041
|
severity: BugSeveritySchema,
|
|
4003
|
-
createdBy:
|
|
4004
|
-
createdAt:
|
|
4042
|
+
createdBy: z36.string(),
|
|
4043
|
+
createdAt: z36.string(),
|
|
4005
4044
|
/**
|
|
4006
4045
|
* When this bug was resolved from the console; null means still OPEN.
|
|
4007
4046
|
*
|
|
@@ -4010,60 +4049,60 @@ var SessionBugSchema = z35.object({
|
|
|
4010
4049
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
4011
4050
|
* no boolean can contradict it.
|
|
4012
4051
|
*/
|
|
4013
|
-
resolvedAt:
|
|
4014
|
-
resolvedBy:
|
|
4052
|
+
resolvedAt: z36.string().nullable(),
|
|
4053
|
+
resolvedBy: z36.string().nullable()
|
|
4015
4054
|
});
|
|
4016
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
4017
|
-
var SessionCommentSchema =
|
|
4018
|
-
id:
|
|
4055
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z36.string() });
|
|
4056
|
+
var SessionCommentSchema = z36.object({
|
|
4057
|
+
id: z36.string().uuid(),
|
|
4019
4058
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
4020
|
-
bugId:
|
|
4059
|
+
bugId: z36.string().uuid().nullable(),
|
|
4021
4060
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
4022
4061
|
* parent bug's turn). */
|
|
4023
|
-
turnIndex:
|
|
4062
|
+
turnIndex: z36.number().int().nullable(),
|
|
4024
4063
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
4025
4064
|
location: BugLocationSchema.nullable(),
|
|
4026
|
-
body:
|
|
4027
|
-
createdBy:
|
|
4028
|
-
createdAt:
|
|
4065
|
+
body: z36.string(),
|
|
4066
|
+
createdBy: z36.string(),
|
|
4067
|
+
createdAt: z36.string()
|
|
4029
4068
|
});
|
|
4030
|
-
var CreateCommentInputSchema =
|
|
4031
|
-
bugId:
|
|
4032
|
-
turnIndex:
|
|
4069
|
+
var CreateCommentInputSchema = z36.object({
|
|
4070
|
+
bugId: z36.string().uuid().nullable(),
|
|
4071
|
+
turnIndex: z36.number().int().positive().nullable(),
|
|
4033
4072
|
location: BugLocationSchema.nullable(),
|
|
4034
4073
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
4035
4074
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
4036
|
-
body:
|
|
4075
|
+
body: z36.string().trim().min(1)
|
|
4037
4076
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
4038
4077
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
4039
4078
|
});
|
|
4040
|
-
var UpdateCommentInputSchema =
|
|
4041
|
-
body:
|
|
4042
|
-
bugId:
|
|
4079
|
+
var UpdateCommentInputSchema = z36.object({
|
|
4080
|
+
body: z36.string().trim().min(1).optional(),
|
|
4081
|
+
bugId: z36.string().uuid().nullable().optional(),
|
|
4043
4082
|
location: BugLocationSchema.nullable().optional()
|
|
4044
4083
|
});
|
|
4045
4084
|
var MOBILE_VIEWPORT_MAX = 720;
|
|
4046
|
-
var SessionFormFactorSchema =
|
|
4085
|
+
var SessionFormFactorSchema = z36.enum(["mobile", "desktop"]).nullable();
|
|
4047
4086
|
function formFactorFromViewport(width) {
|
|
4048
4087
|
if (width === null) return null;
|
|
4049
4088
|
return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
|
|
4050
4089
|
}
|
|
4051
|
-
var SessionSummarySchema =
|
|
4052
|
-
sessionId:
|
|
4090
|
+
var SessionSummarySchema = z36.object({
|
|
4091
|
+
sessionId: z36.string(),
|
|
4053
4092
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
4054
4093
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
4055
|
-
visitorId:
|
|
4094
|
+
visitorId: z36.string().nullable(),
|
|
4056
4095
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
4057
4096
|
* identified themselves. Both null together means "not identified yet". */
|
|
4058
|
-
identityProvider:
|
|
4059
|
-
identityKey:
|
|
4097
|
+
identityProvider: z36.string().nullable(),
|
|
4098
|
+
identityKey: z36.string().nullable(),
|
|
4060
4099
|
/** Team/test traffic. The queue hides these by default. */
|
|
4061
|
-
isInternal:
|
|
4100
|
+
isInternal: z36.boolean(),
|
|
4062
4101
|
/** Build that served the session. Null = not captured; a version filter must
|
|
4063
4102
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
4064
|
-
clientVersion:
|
|
4103
|
+
clientVersion: z36.string().nullable(),
|
|
4065
4104
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
4066
|
-
signalCounts:
|
|
4105
|
+
signalCounts: z36.record(z36.number()),
|
|
4067
4106
|
/**
|
|
4068
4107
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
4069
4108
|
*
|
|
@@ -4080,7 +4119,7 @@ var SessionSummarySchema = z35.object({
|
|
|
4080
4119
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
4081
4120
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
4082
4121
|
*/
|
|
4083
|
-
conversionAttempts:
|
|
4122
|
+
conversionAttempts: z36.number().int().nullable(),
|
|
4084
4123
|
/**
|
|
4085
4124
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
4086
4125
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -4096,7 +4135,7 @@ var SessionSummarySchema = z35.object({
|
|
|
4096
4135
|
* kinds together, and one attempt id appearing under both would be counted
|
|
4097
4136
|
* once there and twice here.
|
|
4098
4137
|
*/
|
|
4099
|
-
conversionKinds:
|
|
4138
|
+
conversionKinds: z36.record(z36.number()),
|
|
4100
4139
|
/**
|
|
4101
4140
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
4102
4141
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -4104,20 +4143,20 @@ var SessionSummarySchema = z35.object({
|
|
|
4104
4143
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
4105
4144
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
4106
4145
|
*/
|
|
4107
|
-
funnelSteps:
|
|
4146
|
+
funnelSteps: z36.array(z36.string()),
|
|
4108
4147
|
/**
|
|
4109
4148
|
* The connector's opaque handle for what this session produced in its back
|
|
4110
4149
|
* office — present only once a checkout actually reached the platform. The
|
|
4111
4150
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
4112
4151
|
*/
|
|
4113
|
-
backOfficeRef:
|
|
4152
|
+
backOfficeRef: z36.string().nullable(),
|
|
4114
4153
|
/**
|
|
4115
4154
|
* The order this session produced, when the connector's back office reported
|
|
4116
4155
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
4117
4156
|
* Both null when no order is known — the cart handle above is then the door.
|
|
4118
4157
|
*/
|
|
4119
|
-
orderRef:
|
|
4120
|
-
orderLabel:
|
|
4158
|
+
orderRef: z36.string().nullable(),
|
|
4159
|
+
orderLabel: z36.string().nullable(),
|
|
4121
4160
|
/**
|
|
4122
4161
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
4123
4162
|
* needs.
|
|
@@ -4130,12 +4169,12 @@ var SessionSummarySchema = z35.object({
|
|
|
4130
4169
|
* on a desktop are not the same session.
|
|
4131
4170
|
*/
|
|
4132
4171
|
formFactor: SessionFormFactorSchema,
|
|
4133
|
-
turnCount:
|
|
4172
|
+
turnCount: z36.number().int(),
|
|
4134
4173
|
/** The visitor's opening message — the single most informative field for
|
|
4135
4174
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
4136
|
-
firstPrompt:
|
|
4137
|
-
startedAt:
|
|
4138
|
-
lastRunAt:
|
|
4175
|
+
firstPrompt: z36.string(),
|
|
4176
|
+
startedAt: z36.string(),
|
|
4177
|
+
lastRunAt: z36.string(),
|
|
4139
4178
|
/**
|
|
4140
4179
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
4141
4180
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -4163,7 +4202,7 @@ var SessionSummarySchema = z35.object({
|
|
|
4163
4202
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
4164
4203
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
4165
4204
|
*/
|
|
4166
|
-
visitorTimeZone:
|
|
4205
|
+
visitorTimeZone: z36.string().nullable(),
|
|
4167
4206
|
/**
|
|
4168
4207
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
4169
4208
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -4171,31 +4210,31 @@ var SessionSummarySchema = z35.object({
|
|
|
4171
4210
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
4172
4211
|
* already reading. Null when no turn in the session recorded a patch.
|
|
4173
4212
|
*/
|
|
4174
|
-
avgTtftMs:
|
|
4213
|
+
avgTtftMs: z36.number().int().nullable(),
|
|
4175
4214
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
4176
4215
|
* a budget: null on sessions older than the mark's recording. */
|
|
4177
|
-
avgMainDoneMs:
|
|
4216
|
+
avgMainDoneMs: z36.number().int().nullable(),
|
|
4178
4217
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
4179
4218
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
4180
|
-
avgChipGenMs:
|
|
4181
|
-
totalLatencyMs:
|
|
4182
|
-
durationMs:
|
|
4219
|
+
avgChipGenMs: z36.number().int().nullable(),
|
|
4220
|
+
totalLatencyMs: z36.number().int(),
|
|
4221
|
+
durationMs: z36.number().int(),
|
|
4183
4222
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
4184
4223
|
* live session streams and cannot be given a verdict until it ends. */
|
|
4185
|
-
isLive:
|
|
4224
|
+
isLive: z36.boolean(),
|
|
4186
4225
|
verdict: SessionVerdictSchema,
|
|
4187
|
-
reviewedBy:
|
|
4188
|
-
reviewedAt:
|
|
4226
|
+
reviewedBy: z36.string().nullable(),
|
|
4227
|
+
reviewedAt: z36.string().nullable(),
|
|
4189
4228
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
4190
4229
|
* state without a second request. */
|
|
4191
|
-
bugIssueKey:
|
|
4192
|
-
bugIssueUrl:
|
|
4193
|
-
bugIssueState:
|
|
4230
|
+
bugIssueKey: z36.string().nullable(),
|
|
4231
|
+
bugIssueUrl: z36.string().nullable(),
|
|
4232
|
+
bugIssueState: z36.string().nullable()
|
|
4194
4233
|
});
|
|
4195
|
-
var SessionQueuePageSchema =
|
|
4196
|
-
sessions:
|
|
4197
|
-
totalCount:
|
|
4198
|
-
hiddenInternalCount:
|
|
4234
|
+
var SessionQueuePageSchema = z36.object({
|
|
4235
|
+
sessions: z36.array(SessionSummarySchema),
|
|
4236
|
+
totalCount: z36.number().int(),
|
|
4237
|
+
hiddenInternalCount: z36.number().int(),
|
|
4199
4238
|
/**
|
|
4200
4239
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
4201
4240
|
*
|
|
@@ -4205,61 +4244,61 @@ var SessionQueuePageSchema = z35.object({
|
|
|
4205
4244
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
4206
4245
|
* analytics dashboard's bounce over the same window.
|
|
4207
4246
|
*/
|
|
4208
|
-
hiddenBouncedCount:
|
|
4247
|
+
hiddenBouncedCount: z36.number().int()
|
|
4209
4248
|
});
|
|
4210
|
-
var SessionQueueFacetsSchema =
|
|
4211
|
-
review:
|
|
4212
|
-
version:
|
|
4213
|
-
turns:
|
|
4214
|
-
durationS:
|
|
4249
|
+
var SessionQueueFacetsSchema = z36.object({
|
|
4250
|
+
review: z36.record(z36.number()),
|
|
4251
|
+
version: z36.record(z36.number()),
|
|
4252
|
+
turns: z36.record(z36.number()),
|
|
4253
|
+
durationS: z36.record(z36.number()),
|
|
4215
4254
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
4216
|
-
funnel:
|
|
4255
|
+
funnel: z36.record(z36.number())
|
|
4217
4256
|
});
|
|
4218
|
-
var SessionCaptureSchema =
|
|
4219
|
-
viewportWidth:
|
|
4220
|
-
viewportHeight:
|
|
4221
|
-
userAgent:
|
|
4222
|
-
locale:
|
|
4257
|
+
var SessionCaptureSchema = z36.object({
|
|
4258
|
+
viewportWidth: z36.number().int().nullable(),
|
|
4259
|
+
viewportHeight: z36.number().int().nullable(),
|
|
4260
|
+
userAgent: z36.string().nullable(),
|
|
4261
|
+
locale: z36.string().nullable(),
|
|
4223
4262
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
4224
|
-
referrer:
|
|
4263
|
+
referrer: z36.string().nullable()
|
|
4225
4264
|
});
|
|
4226
|
-
var SessionCaptureInputSchema =
|
|
4227
|
-
viewportWidth:
|
|
4228
|
-
viewportHeight:
|
|
4229
|
-
userAgent:
|
|
4230
|
-
locale:
|
|
4265
|
+
var SessionCaptureInputSchema = z36.object({
|
|
4266
|
+
viewportWidth: z36.number().int().positive().max(2e4).optional(),
|
|
4267
|
+
viewportHeight: z36.number().int().positive().max(2e4).optional(),
|
|
4268
|
+
userAgent: z36.string().max(1e3).optional(),
|
|
4269
|
+
locale: z36.string().max(35).optional(),
|
|
4231
4270
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
4232
4271
|
* the zone database grows, and refusing a name this build has not heard of
|
|
4233
4272
|
* would drop a real session's capture over a table that is out of date. */
|
|
4234
|
-
timeZone:
|
|
4235
|
-
referrer:
|
|
4236
|
-
clientVersion:
|
|
4237
|
-
isInternal:
|
|
4273
|
+
timeZone: z36.string().max(64).optional(),
|
|
4274
|
+
referrer: z36.string().max(2048).optional(),
|
|
4275
|
+
clientVersion: z36.string().max(100).optional(),
|
|
4276
|
+
isInternal: z36.boolean().optional()
|
|
4238
4277
|
});
|
|
4239
|
-
var SessionDetailSchema =
|
|
4278
|
+
var SessionDetailSchema = z36.object({
|
|
4240
4279
|
session: SessionSummarySchema,
|
|
4241
4280
|
capture: SessionCaptureSchema,
|
|
4242
4281
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
4243
4282
|
* re-judged after a fix is the evidence the fix worked. */
|
|
4244
|
-
reviews:
|
|
4245
|
-
bugs:
|
|
4246
|
-
comments:
|
|
4283
|
+
reviews: z36.array(SessionReviewEventSchema),
|
|
4284
|
+
bugs: z36.array(SessionBugSchema),
|
|
4285
|
+
comments: z36.array(SessionCommentSchema),
|
|
4247
4286
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
4248
4287
|
* not evidence of zero visitor activity. */
|
|
4249
4288
|
activity: SessionActivitySchema.optional()
|
|
4250
4289
|
});
|
|
4251
|
-
var RecordVerdictInputSchema =
|
|
4290
|
+
var RecordVerdictInputSchema = z36.object({
|
|
4252
4291
|
verdict: RecordableVerdictSchema,
|
|
4253
|
-
note:
|
|
4292
|
+
note: z36.string().max(2e3).optional()
|
|
4254
4293
|
});
|
|
4255
|
-
var FileBugInputSchema =
|
|
4256
|
-
turnIndex:
|
|
4294
|
+
var FileBugInputSchema = z36.object({
|
|
4295
|
+
turnIndex: z36.number().int().positive().nullable(),
|
|
4257
4296
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
4258
4297
|
location: BugLocationSchema.nullable().optional(),
|
|
4259
|
-
title:
|
|
4260
|
-
body:
|
|
4298
|
+
title: z36.string().min(1).max(300),
|
|
4299
|
+
body: z36.string().min(1),
|
|
4261
4300
|
severity: BugSeveritySchema,
|
|
4262
|
-
payload:
|
|
4301
|
+
payload: z36.record(z36.unknown())
|
|
4263
4302
|
});
|
|
4264
4303
|
|
|
4265
4304
|
// ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
|
|
@@ -4539,60 +4578,60 @@ __export(src_exports2, {
|
|
|
4539
4578
|
});
|
|
4540
4579
|
|
|
4541
4580
|
// ../ecommerce/src/commerce-schemas.ts
|
|
4542
|
-
import { z as
|
|
4543
|
-
var MoneySchema =
|
|
4544
|
-
amount:
|
|
4545
|
-
currencyCode:
|
|
4581
|
+
import { z as z37 } from "zod";
|
|
4582
|
+
var MoneySchema = z37.object({
|
|
4583
|
+
amount: z37.number(),
|
|
4584
|
+
currencyCode: z37.string()
|
|
4546
4585
|
});
|
|
4547
|
-
var ImageSchema =
|
|
4548
|
-
url:
|
|
4549
|
-
altText:
|
|
4550
|
-
width:
|
|
4551
|
-
height:
|
|
4586
|
+
var ImageSchema = z37.object({
|
|
4587
|
+
url: z37.string(),
|
|
4588
|
+
altText: z37.string(),
|
|
4589
|
+
width: z37.number().optional(),
|
|
4590
|
+
height: z37.number().optional(),
|
|
4552
4591
|
/** Responsive candidate set, resolved at the commerce-adapter boundary —
|
|
4553
4592
|
* never computed in a component. Renderers use it as `<img srcSet>` paired
|
|
4554
4593
|
* with a layout `sizes`. Absent for non-CDN / unsizable images. */
|
|
4555
|
-
srcSet:
|
|
4594
|
+
srcSet: z37.string().optional()
|
|
4556
4595
|
});
|
|
4557
|
-
var AssetSchema =
|
|
4596
|
+
var AssetSchema = z37.object({
|
|
4558
4597
|
/** Opaque asset id — the `resolved()` ref the agent emitted. */
|
|
4559
|
-
id:
|
|
4560
|
-
url:
|
|
4561
|
-
altText:
|
|
4562
|
-
srcSet:
|
|
4598
|
+
id: z37.string(),
|
|
4599
|
+
url: z37.string(),
|
|
4600
|
+
altText: z37.string(),
|
|
4601
|
+
srcSet: z37.string().optional()
|
|
4563
4602
|
});
|
|
4564
|
-
var SelectedOptionSchema =
|
|
4565
|
-
name:
|
|
4566
|
-
value:
|
|
4603
|
+
var SelectedOptionSchema = z37.object({
|
|
4604
|
+
name: z37.string(),
|
|
4605
|
+
value: z37.string()
|
|
4567
4606
|
});
|
|
4568
|
-
var VideoSourceSchema =
|
|
4569
|
-
url:
|
|
4570
|
-
mimeType:
|
|
4571
|
-
width:
|
|
4572
|
-
height:
|
|
4607
|
+
var VideoSourceSchema = z37.object({
|
|
4608
|
+
url: z37.string(),
|
|
4609
|
+
mimeType: z37.string(),
|
|
4610
|
+
width: z37.number().optional(),
|
|
4611
|
+
height: z37.number().optional()
|
|
4573
4612
|
});
|
|
4574
|
-
var ProductVideoSchema =
|
|
4575
|
-
kind:
|
|
4613
|
+
var ProductVideoSchema = z37.object({
|
|
4614
|
+
kind: z37.enum(["hosted", "external"]),
|
|
4576
4615
|
previewImage: ImageSchema.optional(),
|
|
4577
|
-
altText:
|
|
4616
|
+
altText: z37.string().default(""),
|
|
4578
4617
|
/** `kind: 'hosted'` only — empty for external embeds. */
|
|
4579
|
-
sources:
|
|
4618
|
+
sources: z37.array(VideoSourceSchema).default([]),
|
|
4580
4619
|
/** `kind: 'external'` only — iframe embed URL. */
|
|
4581
|
-
embedUrl:
|
|
4620
|
+
embedUrl: z37.string().optional(),
|
|
4582
4621
|
/** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
|
|
4583
|
-
host:
|
|
4622
|
+
host: z37.string().optional()
|
|
4584
4623
|
});
|
|
4585
|
-
var AvailabilityStatusSchema =
|
|
4624
|
+
var AvailabilityStatusSchema = z37.enum([
|
|
4586
4625
|
"in_stock",
|
|
4587
4626
|
"backorder",
|
|
4588
4627
|
"preorder",
|
|
4589
4628
|
"out_of_stock",
|
|
4590
4629
|
"discontinued"
|
|
4591
4630
|
]);
|
|
4592
|
-
var ProductVariantSchema =
|
|
4593
|
-
id:
|
|
4594
|
-
title:
|
|
4595
|
-
available:
|
|
4631
|
+
var ProductVariantSchema = z37.object({
|
|
4632
|
+
id: z37.string(),
|
|
4633
|
+
title: z37.string(),
|
|
4634
|
+
available: z37.boolean(),
|
|
4596
4635
|
/**
|
|
4597
4636
|
* Qualifies `available` with the fulfillment state behind it. Absent means
|
|
4598
4637
|
* the backend did not say — which is NOT the same as in stock, and must not
|
|
@@ -4607,7 +4646,7 @@ var ProductVariantSchema = z36.object({
|
|
|
4607
4646
|
availabilityStatus: AvailabilityStatusSchema.optional(),
|
|
4608
4647
|
price: MoneySchema,
|
|
4609
4648
|
compareAtPrice: MoneySchema.optional(),
|
|
4610
|
-
selectedOptions:
|
|
4649
|
+
selectedOptions: z37.array(SelectedOptionSchema).optional(),
|
|
4611
4650
|
image: ImageSchema.optional()
|
|
4612
4651
|
});
|
|
4613
4652
|
var MP4_MIME = "video/mp4";
|
|
@@ -4618,34 +4657,34 @@ function orderedVideoSources(video) {
|
|
|
4618
4657
|
const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
|
|
4619
4658
|
return [...mp4, ...hls];
|
|
4620
4659
|
}
|
|
4621
|
-
var SiblingProductSchema =
|
|
4622
|
-
id:
|
|
4623
|
-
handle:
|
|
4624
|
-
title:
|
|
4660
|
+
var SiblingProductSchema = z37.object({
|
|
4661
|
+
id: z37.string(),
|
|
4662
|
+
handle: z37.string(),
|
|
4663
|
+
title: z37.string(),
|
|
4625
4664
|
/** The differentiating value across siblings — typically the color
|
|
4626
4665
|
* label ("OLIVE", "STONE"). Rendered next to the swatch row. */
|
|
4627
|
-
color:
|
|
4666
|
+
color: z37.string(),
|
|
4628
4667
|
/** Swatch artwork. Hydrators populate from the sibling product's
|
|
4629
4668
|
* first image; renderers crop / fit to the swatch tile. */
|
|
4630
4669
|
swatchImage: ImageSchema.optional(),
|
|
4631
|
-
available:
|
|
4670
|
+
available: z37.boolean().default(true),
|
|
4632
4671
|
/** Marks the sibling that IS the currently-rendered product. The
|
|
4633
4672
|
* picker uses this to highlight the active swatch without an
|
|
4634
4673
|
* external id comparison. */
|
|
4635
|
-
current:
|
|
4674
|
+
current: z37.boolean().default(false)
|
|
4636
4675
|
});
|
|
4637
|
-
var ProductSchema =
|
|
4638
|
-
id:
|
|
4639
|
-
handle:
|
|
4640
|
-
title:
|
|
4641
|
-
description:
|
|
4642
|
-
descriptionHtml:
|
|
4643
|
-
vendor:
|
|
4644
|
-
productType:
|
|
4645
|
-
tags:
|
|
4676
|
+
var ProductSchema = z37.object({
|
|
4677
|
+
id: z37.string(),
|
|
4678
|
+
handle: z37.string().default(""),
|
|
4679
|
+
title: z37.string(),
|
|
4680
|
+
description: z37.string().default(""),
|
|
4681
|
+
descriptionHtml: z37.string().optional(),
|
|
4682
|
+
vendor: z37.string().default(""),
|
|
4683
|
+
productType: z37.string().optional(),
|
|
4684
|
+
tags: z37.array(z37.string()).default([]),
|
|
4646
4685
|
price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
|
|
4647
4686
|
compareAtPrice: MoneySchema.optional(),
|
|
4648
|
-
images:
|
|
4687
|
+
images: z37.array(ImageSchema).default([]),
|
|
4649
4688
|
/**
|
|
4650
4689
|
* Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
|
|
4651
4690
|
* catalog drops video media — it only surfaces through the Storefront
|
|
@@ -4653,21 +4692,21 @@ var ProductSchema = z36.object({
|
|
|
4653
4692
|
* boundary. Default `[]` so renderers gate on `length > 0` without a
|
|
4654
4693
|
* presence guard.
|
|
4655
4694
|
*/
|
|
4656
|
-
videos:
|
|
4657
|
-
variants:
|
|
4658
|
-
availableForSale:
|
|
4659
|
-
options:
|
|
4660
|
-
name:
|
|
4661
|
-
values:
|
|
4695
|
+
videos: z37.array(ProductVideoSchema).default([]),
|
|
4696
|
+
variants: z37.array(ProductVariantSchema).default([]),
|
|
4697
|
+
availableForSale: z37.boolean().default(true),
|
|
4698
|
+
options: z37.array(z37.object({
|
|
4699
|
+
name: z37.string(),
|
|
4700
|
+
values: z37.array(z37.string())
|
|
4662
4701
|
})).optional(),
|
|
4663
|
-
collections:
|
|
4702
|
+
collections: z37.array(z37.string()).optional(),
|
|
4664
4703
|
/** See `SiblingProductSchema`. Default `[]` so renderers can check
|
|
4665
4704
|
* `length > 1` to decide whether to draw the swatch row without a
|
|
4666
4705
|
* presence guard. */
|
|
4667
|
-
colorVariants:
|
|
4668
|
-
rating:
|
|
4669
|
-
value:
|
|
4670
|
-
count:
|
|
4706
|
+
colorVariants: z37.array(SiblingProductSchema).default([]),
|
|
4707
|
+
rating: z37.object({
|
|
4708
|
+
value: z37.number(),
|
|
4709
|
+
count: z37.number()
|
|
4671
4710
|
}).optional(),
|
|
4672
4711
|
/**
|
|
4673
4712
|
* Product reviews surfaced from the brand's review store. SDK
|
|
@@ -4676,12 +4715,12 @@ var ProductSchema = z36.object({
|
|
|
4676
4715
|
* review bodies. Renderers (`Reviews` component, `ProductDetail`,
|
|
4677
4716
|
* etc.) consume directly.
|
|
4678
4717
|
*/
|
|
4679
|
-
reviews:
|
|
4680
|
-
author:
|
|
4681
|
-
rating:
|
|
4682
|
-
content:
|
|
4683
|
-
date:
|
|
4684
|
-
verified:
|
|
4718
|
+
reviews: z37.array(z37.object({
|
|
4719
|
+
author: z37.string(),
|
|
4720
|
+
rating: z37.number(),
|
|
4721
|
+
content: z37.string(),
|
|
4722
|
+
date: z37.string(),
|
|
4723
|
+
verified: z37.boolean().optional()
|
|
4685
4724
|
})).optional(),
|
|
4686
4725
|
/**
|
|
4687
4726
|
* Ghost-entity flag — `true` when the Storefront API could not hydrate
|
|
@@ -4693,7 +4732,7 @@ var ProductSchema = z36.object({
|
|
|
4693
4732
|
* Set exclusively by `createUnavailableProduct()` — never by the
|
|
4694
4733
|
* Storefront mapper.
|
|
4695
4734
|
*/
|
|
4696
|
-
unavailable:
|
|
4735
|
+
unavailable: z37.boolean().default(false)
|
|
4697
4736
|
});
|
|
4698
4737
|
function createUnavailableProduct(gid) {
|
|
4699
4738
|
return {
|
|
@@ -4715,68 +4754,68 @@ function createUnavailableProduct(gid) {
|
|
|
4715
4754
|
function isGhostEntity(value) {
|
|
4716
4755
|
return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
|
|
4717
4756
|
}
|
|
4718
|
-
var ReviewSchema =
|
|
4719
|
-
id:
|
|
4720
|
-
productId:
|
|
4721
|
-
author:
|
|
4722
|
-
rating:
|
|
4723
|
-
text:
|
|
4724
|
-
date:
|
|
4725
|
-
verified:
|
|
4757
|
+
var ReviewSchema = z37.object({
|
|
4758
|
+
id: z37.string(),
|
|
4759
|
+
productId: z37.string(),
|
|
4760
|
+
author: z37.string(),
|
|
4761
|
+
rating: z37.number(),
|
|
4762
|
+
text: z37.string(),
|
|
4763
|
+
date: z37.string(),
|
|
4764
|
+
verified: z37.boolean()
|
|
4726
4765
|
});
|
|
4727
|
-
var ArticleSchema =
|
|
4728
|
-
id:
|
|
4729
|
-
handle:
|
|
4730
|
-
title:
|
|
4731
|
-
excerpt:
|
|
4732
|
-
content:
|
|
4733
|
-
contentHtml:
|
|
4734
|
-
author:
|
|
4735
|
-
publishedAt:
|
|
4766
|
+
var ArticleSchema = z37.object({
|
|
4767
|
+
id: z37.string(),
|
|
4768
|
+
handle: z37.string().default(""),
|
|
4769
|
+
title: z37.string(),
|
|
4770
|
+
excerpt: z37.string().default(""),
|
|
4771
|
+
content: z37.string().default(""),
|
|
4772
|
+
contentHtml: z37.string().optional(),
|
|
4773
|
+
author: z37.string().default(""),
|
|
4774
|
+
publishedAt: z37.string().default(""),
|
|
4736
4775
|
image: ImageSchema.optional(),
|
|
4737
|
-
blogHandle:
|
|
4738
|
-
tags:
|
|
4776
|
+
blogHandle: z37.string().default(""),
|
|
4777
|
+
tags: z37.array(z37.string()).default([])
|
|
4739
4778
|
});
|
|
4740
|
-
var CmsPageSchema =
|
|
4741
|
-
id:
|
|
4742
|
-
handle:
|
|
4743
|
-
title:
|
|
4744
|
-
body:
|
|
4745
|
-
bodyHtml:
|
|
4746
|
-
bodySummary:
|
|
4747
|
-
updatedAt:
|
|
4748
|
-
seoTitle:
|
|
4749
|
-
seoDescription:
|
|
4779
|
+
var CmsPageSchema = z37.object({
|
|
4780
|
+
id: z37.string(),
|
|
4781
|
+
handle: z37.string().default(""),
|
|
4782
|
+
title: z37.string(),
|
|
4783
|
+
body: z37.string().default(""),
|
|
4784
|
+
bodyHtml: z37.string().optional(),
|
|
4785
|
+
bodySummary: z37.string().default(""),
|
|
4786
|
+
updatedAt: z37.string().default(""),
|
|
4787
|
+
seoTitle: z37.string().optional(),
|
|
4788
|
+
seoDescription: z37.string().optional()
|
|
4750
4789
|
});
|
|
4751
|
-
var CmsPolicySchema =
|
|
4752
|
-
id:
|
|
4790
|
+
var CmsPolicySchema = z37.object({
|
|
4791
|
+
id: z37.string(),
|
|
4753
4792
|
/** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
|
|
4754
4793
|
* 'shipping' | 'subscription' | 'warranty' | custom string. Open so
|
|
4755
4794
|
* platforms with custom policy types can extend. */
|
|
4756
|
-
kind:
|
|
4795
|
+
kind: z37.string(),
|
|
4757
4796
|
/** Slug-shaped handle the platform exposes for storefront URLs
|
|
4758
4797
|
* (e.g. `refund-policy`). Empty string when the backend doesn't
|
|
4759
4798
|
* surface one. */
|
|
4760
|
-
handle:
|
|
4761
|
-
title:
|
|
4762
|
-
body:
|
|
4763
|
-
bodyHtml:
|
|
4764
|
-
url:
|
|
4799
|
+
handle: z37.string().default(""),
|
|
4800
|
+
title: z37.string(),
|
|
4801
|
+
body: z37.string().default(""),
|
|
4802
|
+
bodyHtml: z37.string().optional(),
|
|
4803
|
+
url: z37.string().default("")
|
|
4765
4804
|
});
|
|
4766
|
-
var CollectionSchema =
|
|
4767
|
-
id:
|
|
4768
|
-
handle:
|
|
4769
|
-
title:
|
|
4770
|
-
description:
|
|
4805
|
+
var CollectionSchema = z37.object({
|
|
4806
|
+
id: z37.string(),
|
|
4807
|
+
handle: z37.string().default(""),
|
|
4808
|
+
title: z37.string(),
|
|
4809
|
+
description: z37.string().default(""),
|
|
4771
4810
|
image: ImageSchema.optional(),
|
|
4772
|
-
productCount:
|
|
4811
|
+
productCount: z37.number().int().nonnegative().optional()
|
|
4773
4812
|
});
|
|
4774
|
-
var CartLineSchema =
|
|
4775
|
-
id:
|
|
4776
|
-
merchandiseId:
|
|
4777
|
-
productId:
|
|
4778
|
-
title:
|
|
4779
|
-
variantTitle:
|
|
4813
|
+
var CartLineSchema = z37.object({
|
|
4814
|
+
id: z37.string(),
|
|
4815
|
+
merchandiseId: z37.string(),
|
|
4816
|
+
productId: z37.string(),
|
|
4817
|
+
title: z37.string(),
|
|
4818
|
+
variantTitle: z37.string().optional(),
|
|
4780
4819
|
/**
|
|
4781
4820
|
* The variant's option axes as structured pairs (e.g.
|
|
4782
4821
|
* `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
|
|
@@ -4785,10 +4824,10 @@ var CartLineSchema = z36.object({
|
|
|
4785
4824
|
* single-variant products (the degenerate `Title: Default Title` axis
|
|
4786
4825
|
* is normalized away at the adapter boundary).
|
|
4787
4826
|
*/
|
|
4788
|
-
selectedOptions:
|
|
4789
|
-
vendor:
|
|
4790
|
-
sku:
|
|
4791
|
-
quantity:
|
|
4827
|
+
selectedOptions: z37.array(SelectedOptionSchema).optional(),
|
|
4828
|
+
vendor: z37.string().optional(),
|
|
4829
|
+
sku: z37.string().optional(),
|
|
4830
|
+
quantity: z37.number().int().positive(),
|
|
4792
4831
|
unitPrice: MoneySchema,
|
|
4793
4832
|
totalPrice: MoneySchema,
|
|
4794
4833
|
image: ImageSchema.optional(),
|
|
@@ -4808,26 +4847,26 @@ var CartLineSchema = z36.object({
|
|
|
4808
4847
|
* client-minted id the backend rejects, line-tap navigation is
|
|
4809
4848
|
* suppressed, and the money never folds into a settled-looking total.
|
|
4810
4849
|
*/
|
|
4811
|
-
pending:
|
|
4850
|
+
pending: z37.boolean().optional()
|
|
4812
4851
|
});
|
|
4813
4852
|
function isPendingCartLine(line) {
|
|
4814
4853
|
return line.pending === true;
|
|
4815
4854
|
}
|
|
4816
|
-
var CartDiscountCodeSchema =
|
|
4817
|
-
code:
|
|
4818
|
-
applicable:
|
|
4855
|
+
var CartDiscountCodeSchema = z37.object({
|
|
4856
|
+
code: z37.string(),
|
|
4857
|
+
applicable: z37.boolean()
|
|
4819
4858
|
});
|
|
4820
|
-
var CartMessageSchema =
|
|
4821
|
-
kind:
|
|
4859
|
+
var CartMessageSchema = z37.object({
|
|
4860
|
+
kind: z37.enum(["error", "warning", "info"]),
|
|
4822
4861
|
/** Machine code for branching; opaque and backend-defined. */
|
|
4823
|
-
code:
|
|
4862
|
+
code: z37.string(),
|
|
4824
4863
|
/** Human-readable text, meant to be shown as-is. */
|
|
4825
|
-
content:
|
|
4864
|
+
content: z37.string()
|
|
4826
4865
|
});
|
|
4827
|
-
var CartSchema =
|
|
4828
|
-
id:
|
|
4829
|
-
lines:
|
|
4830
|
-
totalQuantity:
|
|
4866
|
+
var CartSchema = z37.object({
|
|
4867
|
+
id: z37.string(),
|
|
4868
|
+
lines: z37.array(CartLineSchema),
|
|
4869
|
+
totalQuantity: z37.number().int().nonnegative(),
|
|
4831
4870
|
subtotal: MoneySchema,
|
|
4832
4871
|
/**
|
|
4833
4872
|
* Cart total after discounts (pre-shipping/tax). Absent when the
|
|
@@ -4837,11 +4876,11 @@ var CartSchema = z36.object({
|
|
|
4837
4876
|
*/
|
|
4838
4877
|
total: MoneySchema.optional(),
|
|
4839
4878
|
/** Discount codes currently attached to the cart. */
|
|
4840
|
-
discountCodes:
|
|
4879
|
+
discountCodes: z37.array(CartDiscountCodeSchema).default([]),
|
|
4841
4880
|
/** Notices the backend attached to this cart — see `CartMessageSchema`.
|
|
4842
4881
|
* Empty when the backend said nothing or does not report them. */
|
|
4843
|
-
messages:
|
|
4844
|
-
checkoutUrl:
|
|
4882
|
+
messages: z37.array(CartMessageSchema).default([]),
|
|
4883
|
+
checkoutUrl: z37.string().optional(),
|
|
4845
4884
|
/**
|
|
4846
4885
|
* Opaque handle this cart is known by in the connector's BACK OFFICE — the
|
|
4847
4886
|
* value a space owner searches there to find the order this cart became.
|
|
@@ -4854,14 +4893,14 @@ var CartSchema = z36.object({
|
|
|
4854
4893
|
* Absent when the platform has no such handle, or while the cart is still the
|
|
4855
4894
|
* client's optimistic paint and its id is client-minted.
|
|
4856
4895
|
*/
|
|
4857
|
-
backOfficeRef:
|
|
4896
|
+
backOfficeRef: z37.string().optional(),
|
|
4858
4897
|
/**
|
|
4859
4898
|
* URL that recreates this cart on the merchant's own store website
|
|
4860
4899
|
* (replace semantics — overwrites any cart the visitor already has
|
|
4861
4900
|
* there). Populated by platform adapters that support it; absent when
|
|
4862
4901
|
* the cart is empty or the URL cannot be built.
|
|
4863
4902
|
*/
|
|
4864
|
-
storeCartUrl:
|
|
4903
|
+
storeCartUrl: z37.string().optional(),
|
|
4865
4904
|
/**
|
|
4866
4905
|
* True while this cart exists only in the client's optimistic paint —
|
|
4867
4906
|
* no backend cart has been created yet, so its `id` is client-minted and
|
|
@@ -4869,7 +4908,7 @@ var CartSchema = z36.object({
|
|
|
4869
4908
|
* `CartLineSchema.pending`: the adapter never sets it, and callers that
|
|
4870
4909
|
* need a real cart id read THIS rather than sniffing the id's shape.
|
|
4871
4910
|
*/
|
|
4872
|
-
pending:
|
|
4911
|
+
pending: z37.boolean().optional()
|
|
4873
4912
|
});
|
|
4874
4913
|
function settledCart(cart) {
|
|
4875
4914
|
if (cart === null || cart === void 0) return null;
|
|
@@ -4877,27 +4916,27 @@ function settledCart(cart) {
|
|
|
4877
4916
|
}
|
|
4878
4917
|
|
|
4879
4918
|
// ../ecommerce/src/review-schemas.ts
|
|
4880
|
-
import { z as
|
|
4919
|
+
import { z as z38 } from "zod";
|
|
4881
4920
|
var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
|
|
4882
|
-
var ProductReviewItemSchema =
|
|
4883
|
-
author:
|
|
4884
|
-
rating:
|
|
4921
|
+
var ProductReviewItemSchema = z38.object({
|
|
4922
|
+
author: z38.string(),
|
|
4923
|
+
rating: z38.number(),
|
|
4885
4924
|
/** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
|
|
4886
|
-
title:
|
|
4887
|
-
content:
|
|
4888
|
-
date:
|
|
4889
|
-
verified:
|
|
4925
|
+
title: z38.string().optional(),
|
|
4926
|
+
content: z38.string(),
|
|
4927
|
+
date: z38.string(),
|
|
4928
|
+
verified: z38.boolean().optional(),
|
|
4890
4929
|
/**
|
|
4891
4930
|
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
4892
4931
|
* than this one (brands pool reviews across a product line). A surface can
|
|
4893
4932
|
* attribute it; empty / absent ⇒ the product's own review.
|
|
4894
4933
|
*/
|
|
4895
|
-
writtenFor:
|
|
4934
|
+
writtenFor: z38.string().optional()
|
|
4896
4935
|
});
|
|
4897
4936
|
var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
4898
4937
|
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
4899
4938
|
* scored, NOT necessarily text that occurs in `content`. */
|
|
4900
|
-
highlight:
|
|
4939
|
+
highlight: z38.string().optional(),
|
|
4901
4940
|
/**
|
|
4902
4941
|
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
4903
4942
|
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
@@ -4912,24 +4951,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
|
4912
4951
|
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
4913
4952
|
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
4914
4953
|
*/
|
|
4915
|
-
mark:
|
|
4954
|
+
mark: z38.string().optional()
|
|
4916
4955
|
});
|
|
4917
|
-
var ReviewAggregateSchema =
|
|
4918
|
-
value:
|
|
4919
|
-
count:
|
|
4956
|
+
var ReviewAggregateSchema = z38.object({
|
|
4957
|
+
value: z38.number(),
|
|
4958
|
+
count: z38.number()
|
|
4920
4959
|
});
|
|
4921
|
-
var ProductReviewDataSchema =
|
|
4922
|
-
id:
|
|
4960
|
+
var ProductReviewDataSchema = z38.object({
|
|
4961
|
+
id: z38.string(),
|
|
4923
4962
|
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
4924
|
-
reviews:
|
|
4963
|
+
reviews: z38.array(ProductReviewItemSchema).default([]),
|
|
4925
4964
|
aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
|
|
4926
4965
|
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
4927
|
-
distribution:
|
|
4966
|
+
distribution: z38.array(z38.number()).default([]),
|
|
4928
4967
|
/**
|
|
4929
4968
|
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
4930
4969
|
* intent was asked for — never a silent copy of `reviews`.
|
|
4931
4970
|
*/
|
|
4932
|
-
highlights:
|
|
4971
|
+
highlights: z38.array(ProductReviewHighlightSchema).default([]),
|
|
4972
|
+
/**
|
|
4973
|
+
* True when the review provider could not be read and nothing is indexed —
|
|
4974
|
+
* the empty lists mean "not loaded", NOT "this product has no reviews".
|
|
4975
|
+
*/
|
|
4976
|
+
unavailable: z38.boolean().optional()
|
|
4933
4977
|
});
|
|
4934
4978
|
var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
|
|
4935
4979
|
|
|
@@ -5223,9 +5267,9 @@ function readPdpCompanions(config) {
|
|
|
5223
5267
|
}
|
|
5224
5268
|
|
|
5225
5269
|
// ../ecommerce/src/base-attributes.ts
|
|
5226
|
-
import { z as
|
|
5270
|
+
import { z as z39 } from "zod";
|
|
5227
5271
|
var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
|
|
5228
|
-
var BaseAttributesRecordSchema =
|
|
5272
|
+
var BaseAttributesRecordSchema = z39.record(z39.string(), AttributeDefSchema);
|
|
5229
5273
|
function buildBaseAttributesConfig(attributes) {
|
|
5230
5274
|
return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
|
|
5231
5275
|
}
|
|
@@ -5236,9 +5280,9 @@ function readBaseAttributesConfig(config) {
|
|
|
5236
5280
|
}
|
|
5237
5281
|
|
|
5238
5282
|
// ../ecommerce/src/bucket-labels.ts
|
|
5239
|
-
import { z as
|
|
5283
|
+
import { z as z40 } from "zod";
|
|
5240
5284
|
var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
|
|
5241
|
-
var BucketLabelsRecordSchema =
|
|
5285
|
+
var BucketLabelsRecordSchema = z40.record(z40.string(), z40.string());
|
|
5242
5286
|
function buildBucketLabelsConfig(labels) {
|
|
5243
5287
|
return { [BUCKET_LABELS_CONFIG_KEY]: labels };
|
|
5244
5288
|
}
|
|
@@ -6388,8 +6432,8 @@ var PRESENCE_LIFECYCLE = {
|
|
|
6388
6432
|
};
|
|
6389
6433
|
|
|
6390
6434
|
// ../spacestation/src/widgets/presence/profile.ts
|
|
6391
|
-
import { z as
|
|
6392
|
-
var PresenceProfileSchema =
|
|
6435
|
+
import { z as z41 } from "zod";
|
|
6436
|
+
var PresenceProfileSchema = z41.object({
|
|
6393
6437
|
/**
|
|
6394
6438
|
* How much the agent SPEAKS in presence.
|
|
6395
6439
|
* - 'off' the faculty generates no prose at all. Zero tokens, and
|
|
@@ -6399,14 +6443,14 @@ var PresenceProfileSchema = z40.object({
|
|
|
6399
6443
|
* - 'terse' one lead line per turn. The default — see below.
|
|
6400
6444
|
* - 'full' a lead line plus asides beside individual elements.
|
|
6401
6445
|
*/
|
|
6402
|
-
voice:
|
|
6446
|
+
voice: z41.enum(["off", "terse", "full"]),
|
|
6403
6447
|
/**
|
|
6404
6448
|
* Which source kinds this space surfaces. 'all' = every tool that declares a
|
|
6405
6449
|
* `sourceKind`. An explicit list lets a space stay quiet about lookups its
|
|
6406
6450
|
* visitors would find uninteresting (policy checks on a fashion space)
|
|
6407
6451
|
* without the tool having to lie about what it is.
|
|
6408
6452
|
*/
|
|
6409
|
-
sources:
|
|
6453
|
+
sources: z41.union([z41.array(z41.string()), z41.literal("all")]),
|
|
6410
6454
|
/**
|
|
6411
6455
|
* Which facts render.
|
|
6412
6456
|
* - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
|
|
@@ -6415,7 +6459,7 @@ var PresenceProfileSchema = z40.object({
|
|
|
6415
6459
|
* - 'all' shows stated facts too — for spaces where confirming the brief
|
|
6416
6460
|
* back is itself the product (intake, configuration).
|
|
6417
6461
|
*/
|
|
6418
|
-
facts:
|
|
6462
|
+
facts: z41.enum(["inferred-only", "all"])
|
|
6419
6463
|
});
|
|
6420
6464
|
var DEFAULT_PRESENCE_PROFILE = {
|
|
6421
6465
|
voice: "terse",
|
|
@@ -6772,6 +6816,8 @@ function useConversationPage() {
|
|
|
6772
6816
|
const session = useFourtySession();
|
|
6773
6817
|
const reply = useTurnAskReply();
|
|
6774
6818
|
const presence = useConversationPresence();
|
|
6819
|
+
const suggestions = useSuggestionsWithDefaults();
|
|
6820
|
+
const followUp = useComposerChipSelect();
|
|
6775
6821
|
const onWelcomePage = React16.useMemo(
|
|
6776
6822
|
() => seedLayout !== null && JSON.stringify(layout) === JSON.stringify(seedLayout),
|
|
6777
6823
|
[layout, seedLayout]
|
|
@@ -6785,12 +6831,15 @@ function useConversationPage() {
|
|
|
6785
6831
|
if (live !== null) phase = liveTurnTouched(layout, live, messages) ? "composing" : "thinking";
|
|
6786
6832
|
const inConversation = messages.length > 0 || pending2 !== null;
|
|
6787
6833
|
const canvasHidden = inConversation && onWelcomePage && !away;
|
|
6788
|
-
const
|
|
6834
|
+
const noFollowUps = [];
|
|
6835
|
+
const base = { phase, hasPage, canvasHidden, presence, reply, followUp, followUps: noFollowUps, goHome, startOver: session.newConversation, visitedHome: onWelcomePage && away };
|
|
6789
6836
|
if (shown === void 0 || onSeedHome && live === null && !away) {
|
|
6790
6837
|
return { ...base, place: "welcome", turn: null, crumbs: [] };
|
|
6791
6838
|
}
|
|
6792
6839
|
const newest = messages.length === 0 ? void 0 : messages[messages.length - 1];
|
|
6793
6840
|
const answer = splitAnswer(shown.streams.prose);
|
|
6841
|
+
const settledNewest = live === null && newest !== void 0 && newest.messageId === shown.messageId;
|
|
6842
|
+
const followUps = settledNewest && suggestions !== null ? suggestions.actions.filter((a) => typeof a.label === "string" && a.label.trim().length > 0) : [];
|
|
6794
6843
|
const turn = {
|
|
6795
6844
|
key: shown.messageId,
|
|
6796
6845
|
index: shown.index,
|
|
@@ -6798,7 +6847,7 @@ function useConversationPage() {
|
|
|
6798
6847
|
headline: answer.headline,
|
|
6799
6848
|
body: answer.body,
|
|
6800
6849
|
ask: shown.streams.ask,
|
|
6801
|
-
answerable:
|
|
6850
|
+
answerable: settledNewest,
|
|
6802
6851
|
live: live !== null,
|
|
6803
6852
|
failed: "error" in shown && shown.error !== void 0
|
|
6804
6853
|
};
|
|
@@ -6811,7 +6860,7 @@ function useConversationPage() {
|
|
|
6811
6860
|
{ key: shown.messageId, kind: "turn", label: shown.visitorText, open: () => selectMessage(shown.index) },
|
|
6812
6861
|
...visited ? [] : [here]
|
|
6813
6862
|
];
|
|
6814
|
-
return { ...base, place: "away", turn, crumbs: crumbs2 };
|
|
6863
|
+
return { ...base, place: "away", turn, crumbs: crumbs2, followUps };
|
|
6815
6864
|
}
|
|
6816
6865
|
const pages = pageTurns(messages, shown.index);
|
|
6817
6866
|
const liveOpensPage = live !== null && phase === "composing" && !messages.some((m) => m.index === live.index);
|
|
@@ -6826,7 +6875,7 @@ function useConversationPage() {
|
|
|
6826
6875
|
}))
|
|
6827
6876
|
];
|
|
6828
6877
|
if (liveOpensPage) crumbs.push({ key: live.messageId, kind: "turn", label: live.visitorText, open: null });
|
|
6829
|
-
return { ...base, place: "turn", turn, crumbs };
|
|
6878
|
+
return { ...base, place: "turn", turn, crumbs, followUps };
|
|
6830
6879
|
}
|
|
6831
6880
|
|
|
6832
6881
|
// src/shell/thread-scroll/headroom.ts
|
|
@@ -8340,22 +8389,22 @@ function buildComponentLibrary(catalog, componentMap) {
|
|
|
8340
8389
|
}
|
|
8341
8390
|
|
|
8342
8391
|
// src/catalog/define.ts
|
|
8343
|
-
import { z as
|
|
8392
|
+
import { z as z42 } from "zod";
|
|
8344
8393
|
function entity(resolverKey, opts) {
|
|
8345
|
-
return resolved(
|
|
8394
|
+
return resolved(z42.string(), resolverKey, opts);
|
|
8346
8395
|
}
|
|
8347
|
-
var text = prose(
|
|
8396
|
+
var text = prose(z42.string());
|
|
8348
8397
|
function plain() {
|
|
8349
|
-
return
|
|
8398
|
+
return z42.string();
|
|
8350
8399
|
}
|
|
8351
8400
|
function token(values) {
|
|
8352
|
-
return
|
|
8401
|
+
return z42.enum(values);
|
|
8353
8402
|
}
|
|
8354
8403
|
function catalogComponent(meta, render) {
|
|
8355
8404
|
const { props, requires, ...rest } = meta;
|
|
8356
8405
|
return {
|
|
8357
8406
|
...rest,
|
|
8358
|
-
propsSchema:
|
|
8407
|
+
propsSchema: z42.object(props),
|
|
8359
8408
|
...requires !== void 0 ? { requires } : {},
|
|
8360
8409
|
component: adaptComponent(render)
|
|
8361
8410
|
};
|
|
@@ -8443,10 +8492,9 @@ function resolveHydrators(platform, platformConfig, context) {
|
|
|
8443
8492
|
if (platform === "" || platform === "none") return services;
|
|
8444
8493
|
const factory = getPlatformHydratorFactory(platform);
|
|
8445
8494
|
if (!factory) {
|
|
8446
|
-
|
|
8447
|
-
`[resolveHydrators] no hydrators registered for platform "${platform}"
|
|
8495
|
+
throw new Error(
|
|
8496
|
+
`[resolveHydrators] no hydrators registered for platform "${platform}". Registered: [${listRegisteredPlatforms().join(", ")}]. The runtime must import its connector bindings at its entry point.`
|
|
8448
8497
|
);
|
|
8449
|
-
return services;
|
|
8450
8498
|
}
|
|
8451
8499
|
const platformContext = context === void 0 ? void 0 : { locale: context.locale };
|
|
8452
8500
|
return { ...services, ...factory(platformConfig, platformContext) };
|
|
@@ -10392,18 +10440,18 @@ __export(ecommerce_exports, {
|
|
|
10392
10440
|
});
|
|
10393
10441
|
|
|
10394
10442
|
// ../spacestation/src/analytics/ecommerce/surfacing.ts
|
|
10395
|
-
import { z as
|
|
10443
|
+
import { z as z43 } from "zod";
|
|
10396
10444
|
var PRODUCTS_SURFACED = defineEventKind(
|
|
10397
10445
|
"commerce.products_surfaced",
|
|
10398
10446
|
"client",
|
|
10399
|
-
|
|
10447
|
+
z43.object({
|
|
10400
10448
|
/** The turn whose commit this describes. Minted where the prompt signal
|
|
10401
10449
|
* is built and shared with `agent_runs`, so the read layer can line a
|
|
10402
10450
|
* surfacing up against the prompt that asked for it. */
|
|
10403
|
-
turnId:
|
|
10451
|
+
turnId: z43.string().min(1).max(128),
|
|
10404
10452
|
/** Distinct entity refs this turn placed that were not on the canvas
|
|
10405
10453
|
* before it. ZERO IS A REAL VALUE — see the header. */
|
|
10406
|
-
productCount:
|
|
10454
|
+
productCount: z43.number().int().nonnegative()
|
|
10407
10455
|
}).strict()
|
|
10408
10456
|
);
|
|
10409
10457
|
|
|
@@ -11903,7 +11951,7 @@ function useContentActions() {
|
|
|
11903
11951
|
import { useEffect as useEffect19, useState as useState18 } from "react";
|
|
11904
11952
|
|
|
11905
11953
|
// package.json
|
|
11906
|
-
var version = "0.
|
|
11954
|
+
var version = "0.5.0";
|
|
11907
11955
|
|
|
11908
11956
|
// src/host/host-modules.ts
|
|
11909
11957
|
import * as react from "react";
|
|
@@ -11990,7 +12038,7 @@ function Spacefront(props) {
|
|
|
11990
12038
|
}
|
|
11991
12039
|
|
|
11992
12040
|
// src/npm.ts
|
|
11993
|
-
import { z as
|
|
12041
|
+
import { z as z45 } from "zod";
|
|
11994
12042
|
export {
|
|
11995
12043
|
ACQUISITION_KIND_LABELS,
|
|
11996
12044
|
ACTIVE_PANEL_ATTR,
|
|
@@ -12015,6 +12063,11 @@ export {
|
|
|
12015
12063
|
AttributeScopeBucketSchema,
|
|
12016
12064
|
AttributeScopeConfigSchema,
|
|
12017
12065
|
AvailabilityStatusSchema,
|
|
12066
|
+
BRAND_MARK_MAX_BYTES,
|
|
12067
|
+
BRAND_MARK_SLOTS,
|
|
12068
|
+
BRAND_MARK_TYPES,
|
|
12069
|
+
BrandMarkImageSchema,
|
|
12070
|
+
BrandMarkSchema,
|
|
12018
12071
|
BugLocationSchema,
|
|
12019
12072
|
BugSeveritySchema,
|
|
12020
12073
|
CANVAS_ARRANGEMENTS,
|
|
@@ -12200,6 +12253,7 @@ export {
|
|
|
12200
12253
|
ShellRootContext,
|
|
12201
12254
|
ShimmerSweep,
|
|
12202
12255
|
SiblingProductSchema,
|
|
12256
|
+
SpaceBrandMarkSchema,
|
|
12203
12257
|
SpaceBugSchema,
|
|
12204
12258
|
Spacefront,
|
|
12205
12259
|
SpacefrontCanvas,
|
|
@@ -12635,5 +12689,5 @@ export {
|
|
|
12635
12689
|
wipeProfile,
|
|
12636
12690
|
withCartActorOrigin,
|
|
12637
12691
|
withInteractionTracking,
|
|
12638
|
-
|
|
12692
|
+
z45 as z
|
|
12639
12693
|
};
|