@40rty/ams-cli 0.3.1 → 0.4.2
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/bin/commands/deploy.mjs +62 -17
- package/bin/commands/dev.mjs +10 -11
- package/bin/commands/doctor.mjs +18 -21
- package/bin/commands/domain.mjs +42 -0
- package/bin/commands/hosting.mjs +1 -1
- package/bin/commands/init.mjs +1 -1
- package/bin/commands/publish.mjs +19 -1
- package/bin/forty.mjs +4 -1
- package/bin/lib/agentic.mjs +48 -0
- package/bin/lib/build-copy.mjs +105 -0
- package/bin/lib/build.mjs +47 -19
- package/bin/lib/hosted-build.mjs +74 -19
- package/dist/wire.js +444 -404
- package/package.json +1 -1
- package/templates/package/src/blocks.tsx +3 -3
- package/bin/lib/base-path-build.mjs +0 -149
package/dist/wire.js
CHANGED
|
@@ -406,47 +406,68 @@ var CartAddSignalPayloadSchema = z10.object({
|
|
|
406
406
|
acknowledgeInDrawer: z10.boolean().optional()
|
|
407
407
|
});
|
|
408
408
|
|
|
409
|
-
// ../spacestation/src/
|
|
409
|
+
// ../spacestation/src/signal/turn-ask.ts
|
|
410
410
|
import { z as z11 } from "zod";
|
|
411
|
-
var
|
|
412
|
-
|
|
413
|
-
|
|
411
|
+
var MIN_CHOICE_ANSWERS = 2;
|
|
412
|
+
var MAX_CHOICE_ANSWERS = 4;
|
|
413
|
+
var AnswerPartSchema = z11.object({ answer: z11.string().trim().min(1) });
|
|
414
|
+
var PartSchema = z11.union([z11.string(), AnswerPartSchema]);
|
|
415
|
+
function partsText(parts) {
|
|
416
|
+
return parts.map((p) => typeof p === "string" ? p : p.answer).join("");
|
|
417
|
+
}
|
|
418
|
+
var ModelTurnAskSchema = z11.object({
|
|
419
|
+
kind: z11.enum(["choice", "open"]),
|
|
420
|
+
parts: z11.array(PartSchema).min(1)
|
|
421
|
+
}).refine((ask) => partsText(ask.parts).trim().length > 0, { message: "the question reads as nothing" }).transform((ask) => {
|
|
422
|
+
const answers = ask.parts.filter((p) => typeof p !== "string").length;
|
|
423
|
+
if (ask.kind === "choice" && answers >= MIN_CHOICE_ANSWERS && answers <= MAX_CHOICE_ANSWERS) return ask;
|
|
424
|
+
if (ask.kind === "open" && answers === 0) return ask;
|
|
425
|
+
return { kind: "open", parts: [partsText(ask.parts)] };
|
|
426
|
+
});
|
|
427
|
+
var PersistedQuestionSchema = z11.object({ question: z11.string().trim().min(1) }).transform((row) => ({ kind: "open", parts: [row.question.replace(/[[\]]/g, "")] }));
|
|
428
|
+
var TurnAskSchema = z11.union([ModelTurnAskSchema, PersistedQuestionSchema]);
|
|
429
|
+
|
|
430
|
+
// ../spacestation/src/types.ts
|
|
431
|
+
import { z as z12 } from "zod";
|
|
432
|
+
var StateSnapshotFrameSchema = z12.object({
|
|
433
|
+
rev: z12.number(),
|
|
434
|
+
state: z12.record(z12.unknown())
|
|
414
435
|
});
|
|
415
436
|
|
|
416
437
|
// ../spacestation/src/catalog/canvas-arrangement.ts
|
|
417
438
|
var CANVAS_BLOCK_SIZES = ["full", "wide", "half", "narrow"];
|
|
418
439
|
|
|
419
440
|
// ../spacestation/src/catalog/structural-baseline.ts
|
|
420
|
-
import { z as
|
|
421
|
-
var agentTextProps =
|
|
422
|
-
text:
|
|
423
|
-
parts:
|
|
424
|
-
type:
|
|
425
|
-
value:
|
|
441
|
+
import { z as z13 } from "zod";
|
|
442
|
+
var agentTextProps = z13.object({
|
|
443
|
+
text: z13.string().optional().describe("Plain prose. Used by the streaming text.delta slot binding so the agent can flow words in without choosing emphasis spans up front."),
|
|
444
|
+
parts: z13.array(z13.object({
|
|
445
|
+
type: z13.enum(["text", "em"]).describe("text = sans body; em = italic emphasis."),
|
|
446
|
+
value: z13.string()
|
|
426
447
|
})).optional().describe("Pre-segmented prose with mixed sans + italic spans. When present, takes precedence over `text`. Use sparingly \u2014 italic carries weight, save it for the human moment in the answer."),
|
|
427
|
-
size:
|
|
448
|
+
size: z13.enum(["sm", "md", "lg"]).optional().describe("Visual scale. lg for hero prose at the top of a turn; md (default) for body; sm for trailing footnote prose.")
|
|
428
449
|
});
|
|
429
|
-
var turnProps =
|
|
430
|
-
prompt:
|
|
431
|
-
index:
|
|
432
|
-
timestamp:
|
|
433
|
-
thinking:
|
|
450
|
+
var turnProps = z13.object({
|
|
451
|
+
prompt: z13.string().describe("The user's prompt for this turn, rendered as a quoted lede above the agent's response. Required so the conversation reads."),
|
|
452
|
+
index: z13.number().optional().describe("Turn index (0-based). When omitted the runtime infers from sibling turns."),
|
|
453
|
+
timestamp: z13.string().optional().describe("ISO timestamp for the small turn header. Omit to skip the header."),
|
|
454
|
+
thinking: z13.string().optional().describe("Short status line shown while the response streams in. Hidden once the first block lands.")
|
|
434
455
|
});
|
|
435
|
-
var backdropProps =
|
|
436
|
-
variant:
|
|
456
|
+
var backdropProps = z13.object({
|
|
457
|
+
variant: z13.enum(["ridges", "sky", "video", "none"]).optional().describe(
|
|
437
458
|
"Background variant. `ridges` = parallax silhouettes + sky gradient. `sky` = gradient + grain + vignette only. `video` = full-bleed autoplay-loop-muted video sourced from `videoUrl`. `none` = nothing rendered."
|
|
438
459
|
),
|
|
439
|
-
ridgeColor:
|
|
440
|
-
videoUrl:
|
|
460
|
+
ridgeColor: z13.string().optional().describe("Hex color of the ridge silhouettes. Defaults to surface fg1."),
|
|
461
|
+
videoUrl: z13.string().optional().describe(
|
|
441
462
|
'Direct mp4/webm URL for the `video` variant. Loaded with preload="metadata", muted, looped, playsInline.'
|
|
442
463
|
),
|
|
443
|
-
posterUrl:
|
|
464
|
+
posterUrl: z13.string().optional().describe("Optional poster frame shown while video buffers.")
|
|
444
465
|
});
|
|
445
466
|
var STRUCTURAL_BASELINE_CATALOG = {
|
|
446
467
|
page: {
|
|
447
468
|
type: "page",
|
|
448
469
|
alwaysInclude: true,
|
|
449
|
-
propsSchema:
|
|
470
|
+
propsSchema: z13.object({}),
|
|
450
471
|
layout: "fullbleed",
|
|
451
472
|
progressLabel: "Composing the page"
|
|
452
473
|
},
|
|
@@ -499,7 +520,7 @@ var STRUCTURAL_BASELINE_CATALOG = {
|
|
|
499
520
|
var STRUCTURAL_BASELINE_TYPES = Object.keys(STRUCTURAL_BASELINE_CATALOG);
|
|
500
521
|
|
|
501
522
|
// ../spacestation/src/catalog/resolved.ts
|
|
502
|
-
import { z as
|
|
523
|
+
import { z as z14 } from "zod";
|
|
503
524
|
function readResolvedMeta(schema) {
|
|
504
525
|
const def = schema._def;
|
|
505
526
|
if (!("_resolved" in def)) return void 0;
|
|
@@ -515,17 +536,26 @@ function readResolvedMeta(schema) {
|
|
|
515
536
|
}
|
|
516
537
|
|
|
517
538
|
// ../spacestation/src/catalog/prose.ts
|
|
518
|
-
import { z as
|
|
539
|
+
import { z as z15 } from "zod";
|
|
519
540
|
function readProseMeta(schema) {
|
|
520
541
|
const def = schema._def;
|
|
521
542
|
return "_prose" in def && def._prose === true;
|
|
522
543
|
}
|
|
523
544
|
|
|
524
545
|
// ../spacestation/src/catalog/required-props.ts
|
|
525
|
-
import { z as
|
|
546
|
+
import { z as z16 } from "zod";
|
|
526
547
|
|
|
527
548
|
// ../spacestation/src/catalog/function-props.ts
|
|
528
|
-
import { z as
|
|
549
|
+
import { z as z17 } from "zod";
|
|
550
|
+
|
|
551
|
+
// ../spacestation/src/catalog/shape-tokens.ts
|
|
552
|
+
var SHAPE_TOKEN = /<(?![/!])[^<>=]*\s[^<>=]*(?<!\/)>/;
|
|
553
|
+
function carriesShapeToken(value) {
|
|
554
|
+
if (typeof value === "string") return SHAPE_TOKEN.test(value);
|
|
555
|
+
if (Array.isArray(value)) return value.some(carriesShapeToken);
|
|
556
|
+
if (typeof value === "object" && value !== null) return Object.values(value).some(carriesShapeToken);
|
|
557
|
+
return false;
|
|
558
|
+
}
|
|
529
559
|
|
|
530
560
|
// ../spacestation/src/layout/apply-patch.ts
|
|
531
561
|
function arrayAdd(arr, key, value) {
|
|
@@ -626,47 +656,47 @@ function readAtPath(doc, path) {
|
|
|
626
656
|
}
|
|
627
657
|
|
|
628
658
|
// ../spacestation/src/catalog/wire/wire-schema.ts
|
|
629
|
-
import { z as
|
|
659
|
+
import { z as z18 } from "zod";
|
|
630
660
|
var common = {
|
|
631
|
-
description:
|
|
632
|
-
resolved:
|
|
633
|
-
resolverKey:
|
|
634
|
-
min:
|
|
635
|
-
max:
|
|
636
|
-
renderFloor:
|
|
637
|
-
derivedFrom:
|
|
661
|
+
description: z18.string().optional(),
|
|
662
|
+
resolved: z18.object({
|
|
663
|
+
resolverKey: z18.string(),
|
|
664
|
+
min: z18.number().optional(),
|
|
665
|
+
max: z18.number().optional(),
|
|
666
|
+
renderFloor: z18.number().optional(),
|
|
667
|
+
derivedFrom: z18.string().optional()
|
|
638
668
|
}).strict().optional(),
|
|
639
|
-
prose:
|
|
669
|
+
prose: z18.literal(true).optional()
|
|
640
670
|
};
|
|
641
|
-
var WireSchemaSchema =
|
|
642
|
-
() =>
|
|
643
|
-
|
|
644
|
-
|
|
671
|
+
var WireSchemaSchema = z18.lazy(
|
|
672
|
+
() => z18.discriminatedUnion("t", [
|
|
673
|
+
z18.object({ ...common, t: z18.literal("string"), min: z18.number().optional(), max: z18.number().optional() }).strict(),
|
|
674
|
+
z18.object({
|
|
645
675
|
...common,
|
|
646
|
-
t:
|
|
647
|
-
int:
|
|
648
|
-
min:
|
|
649
|
-
minExclusive:
|
|
650
|
-
max:
|
|
651
|
-
maxExclusive:
|
|
676
|
+
t: z18.literal("number"),
|
|
677
|
+
int: z18.literal(true).optional(),
|
|
678
|
+
min: z18.number().optional(),
|
|
679
|
+
minExclusive: z18.literal(true).optional(),
|
|
680
|
+
max: z18.number().optional(),
|
|
681
|
+
maxExclusive: z18.literal(true).optional()
|
|
652
682
|
}).strict(),
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
683
|
+
z18.object({ ...common, t: z18.literal("boolean") }).strict(),
|
|
684
|
+
z18.object({ ...common, t: z18.literal("unknown") }).strict(),
|
|
685
|
+
z18.object({ ...common, t: z18.literal("literal"), value: z18.union([z18.string(), z18.number(), z18.boolean()]) }).strict(),
|
|
686
|
+
z18.object({ ...common, t: z18.literal("enum"), values: z18.array(z18.string()).min(1) }).strict(),
|
|
687
|
+
z18.object({ ...common, t: z18.literal("array"), element: WireSchemaSchema, min: z18.number().optional(), max: z18.number().optional() }).strict(),
|
|
688
|
+
z18.object({ ...common, t: z18.literal("object"), shape: z18.record(WireSchemaSchema), unknownKeys: z18.enum(["strip", "passthrough", "strict"]) }).strict(),
|
|
689
|
+
z18.object({ ...common, t: z18.literal("union"), options: z18.array(WireSchemaSchema).min(2) }).strict(),
|
|
690
|
+
z18.object({ ...common, t: z18.literal("discriminatedUnion"), discriminator: z18.string(), options: z18.array(WireSchemaSchema).min(2) }).strict(),
|
|
691
|
+
z18.object({ ...common, t: z18.literal("record"), value: WireSchemaSchema }).strict(),
|
|
692
|
+
z18.object({ ...common, t: z18.literal("optional"), inner: WireSchemaSchema }).strict(),
|
|
693
|
+
z18.object({ ...common, t: z18.literal("nullable"), inner: WireSchemaSchema }).strict(),
|
|
694
|
+
z18.object({ ...common, t: z18.literal("default"), inner: WireSchemaSchema, value: z18.unknown() }).strict()
|
|
665
695
|
])
|
|
666
696
|
);
|
|
667
697
|
|
|
668
698
|
// ../spacestation/src/catalog/wire/schema-to-wire.ts
|
|
669
|
-
import { z as
|
|
699
|
+
import { z as z19 } from "zod";
|
|
670
700
|
var UnsupportedSchemaError = class extends Error {
|
|
671
701
|
constructor(path, what) {
|
|
672
702
|
super(`Cannot publish the schema at ${path === "" ? "<root>" : path}: ${what}.`);
|
|
@@ -704,7 +734,7 @@ function arrayNode(schema, path) {
|
|
|
704
734
|
return node;
|
|
705
735
|
}
|
|
706
736
|
function objectNode(schema, path) {
|
|
707
|
-
if (!(schema._def.catchall instanceof
|
|
737
|
+
if (!(schema._def.catchall instanceof z19.ZodNever)) throw new UnsupportedSchemaError(path, "object .catchall() is not supported");
|
|
708
738
|
const shape = {};
|
|
709
739
|
for (const [key, child] of Object.entries(schema.shape)) shape[key] = toNode(child, path === "" ? key : `${path}.${key}`);
|
|
710
740
|
return { t: "object", shape, unknownKeys: schema._def.unknownKeys };
|
|
@@ -715,19 +745,19 @@ function literalNode(schema, path) {
|
|
|
715
745
|
throw new UnsupportedSchemaError(path, "only string, number and boolean literals are supported");
|
|
716
746
|
}
|
|
717
747
|
function bare(schema, path) {
|
|
718
|
-
if (schema instanceof
|
|
719
|
-
if (schema instanceof
|
|
720
|
-
if (schema instanceof
|
|
721
|
-
if (schema instanceof
|
|
722
|
-
if (schema instanceof
|
|
723
|
-
if (schema instanceof
|
|
724
|
-
if (schema instanceof
|
|
725
|
-
if (schema instanceof
|
|
726
|
-
if (schema instanceof
|
|
748
|
+
if (schema instanceof z19.ZodString) return stringNode(schema, path);
|
|
749
|
+
if (schema instanceof z19.ZodNumber) return numberNode(schema, path);
|
|
750
|
+
if (schema instanceof z19.ZodBoolean) return { t: "boolean" };
|
|
751
|
+
if (schema instanceof z19.ZodUnknown || schema instanceof z19.ZodAny) return { t: "unknown" };
|
|
752
|
+
if (schema instanceof z19.ZodLiteral) return literalNode(schema, path);
|
|
753
|
+
if (schema instanceof z19.ZodEnum) return { t: "enum", values: [...schema.options] };
|
|
754
|
+
if (schema instanceof z19.ZodArray) return arrayNode(schema, path);
|
|
755
|
+
if (schema instanceof z19.ZodObject) return objectNode(schema, path);
|
|
756
|
+
if (schema instanceof z19.ZodUnion) {
|
|
727
757
|
const options = schema.options;
|
|
728
758
|
return { t: "union", options: options.map((option, i) => toNode(option, `${path}|${i}`)) };
|
|
729
759
|
}
|
|
730
|
-
if (schema instanceof
|
|
760
|
+
if (schema instanceof z19.ZodDiscriminatedUnion) {
|
|
731
761
|
const options = schema.options;
|
|
732
762
|
return {
|
|
733
763
|
t: "discriminatedUnion",
|
|
@@ -735,13 +765,13 @@ function bare(schema, path) {
|
|
|
735
765
|
options: options.map((option, i) => toNode(option, `${path}|${i}`))
|
|
736
766
|
};
|
|
737
767
|
}
|
|
738
|
-
if (schema instanceof
|
|
739
|
-
if (!(schema.keySchema instanceof
|
|
768
|
+
if (schema instanceof z19.ZodRecord) {
|
|
769
|
+
if (!(schema.keySchema instanceof z19.ZodString)) throw new UnsupportedSchemaError(path, "only string-keyed records are supported");
|
|
740
770
|
return { t: "record", value: toNode(schema.valueSchema, `${path}{}`) };
|
|
741
771
|
}
|
|
742
|
-
if (schema instanceof
|
|
743
|
-
if (schema instanceof
|
|
744
|
-
if (schema instanceof
|
|
772
|
+
if (schema instanceof z19.ZodOptional) return { t: "optional", inner: toNode(schema.unwrap(), path) };
|
|
773
|
+
if (schema instanceof z19.ZodNullable) return { t: "nullable", inner: toNode(schema.unwrap(), path) };
|
|
774
|
+
if (schema instanceof z19.ZodDefault) {
|
|
745
775
|
return { t: "default", inner: toNode(schema._def.innerType, path), value: schema._def.defaultValue() };
|
|
746
776
|
}
|
|
747
777
|
throw new UnsupportedSchemaError(path, `${schema.constructor.name} is not supported`);
|
|
@@ -759,40 +789,40 @@ function schemaToWire(schema) {
|
|
|
759
789
|
}
|
|
760
790
|
|
|
761
791
|
// ../spacestation/src/catalog/wire/schema-from-wire.ts
|
|
762
|
-
import { z as
|
|
792
|
+
import { z as z20 } from "zod";
|
|
763
793
|
|
|
764
794
|
// ../spacestation/src/catalog/wire/catalog-wire.ts
|
|
765
|
-
import { z as
|
|
766
|
-
var WireCatalogEntrySchema =
|
|
767
|
-
type:
|
|
795
|
+
import { z as z21 } from "zod";
|
|
796
|
+
var WireCatalogEntrySchema = z21.object({
|
|
797
|
+
type: z21.string().min(1),
|
|
768
798
|
propsSchema: WireSchemaSchema.optional(),
|
|
769
|
-
examples:
|
|
770
|
-
renderedBy:
|
|
771
|
-
alwaysInclude:
|
|
772
|
-
whenToUse:
|
|
773
|
-
dontUseWhen:
|
|
774
|
-
variants:
|
|
775
|
-
dependencies:
|
|
776
|
-
layout:
|
|
777
|
-
size:
|
|
778
|
-
extendsPage:
|
|
779
|
-
bindings:
|
|
780
|
-
|
|
781
|
-
source:
|
|
782
|
-
prop:
|
|
783
|
-
accumulate:
|
|
784
|
-
mountAt:
|
|
799
|
+
examples: z21.array(z21.record(z21.unknown())).optional(),
|
|
800
|
+
renderedBy: z21.string().optional(),
|
|
801
|
+
alwaysInclude: z21.boolean().optional(),
|
|
802
|
+
whenToUse: z21.string().optional(),
|
|
803
|
+
dontUseWhen: z21.string().optional(),
|
|
804
|
+
variants: z21.string().optional(),
|
|
805
|
+
dependencies: z21.string().optional(),
|
|
806
|
+
layout: z21.enum(["section", "fullbleed"]).optional(),
|
|
807
|
+
size: z21.enum(CANVAS_BLOCK_SIZES).optional(),
|
|
808
|
+
extendsPage: z21.boolean().optional(),
|
|
809
|
+
bindings: z21.array(
|
|
810
|
+
z21.object({
|
|
811
|
+
source: z21.string(),
|
|
812
|
+
prop: z21.string(),
|
|
813
|
+
accumulate: z21.enum(["replace", "append", "concat-text"]).optional(),
|
|
814
|
+
mountAt: z21.string().optional()
|
|
785
815
|
})
|
|
786
816
|
).optional(),
|
|
787
|
-
defaultLayoutWeight:
|
|
788
|
-
defaultMaxHeight:
|
|
789
|
-
category:
|
|
790
|
-
progressLabel:
|
|
791
|
-
isExperience:
|
|
792
|
-
requires:
|
|
793
|
-
provides:
|
|
817
|
+
defaultLayoutWeight: z21.number().optional(),
|
|
818
|
+
defaultMaxHeight: z21.enum(["sm", "md", "lg", "full"]).optional(),
|
|
819
|
+
category: z21.string().optional(),
|
|
820
|
+
progressLabel: z21.string().optional(),
|
|
821
|
+
isExperience: z21.boolean().optional(),
|
|
822
|
+
requires: z21.array(z21.string()).optional(),
|
|
823
|
+
provides: z21.array(z21.string()).optional()
|
|
794
824
|
}).strict();
|
|
795
|
-
var WireCatalogSchema =
|
|
825
|
+
var WireCatalogSchema = z21.record(WireCatalogEntrySchema);
|
|
796
826
|
function propsToWire(type, schema) {
|
|
797
827
|
try {
|
|
798
828
|
return schemaToWire(schema);
|
|
@@ -810,93 +840,102 @@ function catalogToWire(catalog) {
|
|
|
810
840
|
}
|
|
811
841
|
|
|
812
842
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
813
|
-
import { z as
|
|
843
|
+
import { z as z22 } from "zod";
|
|
814
844
|
var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
|
|
815
|
-
var
|
|
845
|
+
var BUNDLE_ASSET_PATH = /^assets\/[A-Za-z0-9_-]+\.(woff2?|ttf|otf|png|jpe?g|svg|gif|webp)$/;
|
|
846
|
+
var PackageReleaseSchema = z22.object({
|
|
816
847
|
/** The id spaces name in `componentSources` — an npm-style package name. */
|
|
817
|
-
sourceId:
|
|
818
|
-
label:
|
|
848
|
+
sourceId: z22.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((scope) => id.startsWith(scope)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
|
|
849
|
+
label: z22.string().min(1).max(120),
|
|
819
850
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
820
|
-
version:
|
|
851
|
+
version: z22.string().min(1).max(40),
|
|
852
|
+
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
853
|
+
description: z22.string().min(1).max(500).optional(),
|
|
821
854
|
catalog: WireCatalogSchema,
|
|
822
855
|
/** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
|
|
823
|
-
manifests:
|
|
856
|
+
manifests: z22.record(z22.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z22.string()),
|
|
824
857
|
/**
|
|
825
858
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
826
859
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
827
860
|
* ES module (exporting `renderers`, and optionally `shells`) and its
|
|
828
|
-
* stylesheet
|
|
861
|
+
* stylesheet, plus the files that stylesheet points at (`assets`: fonts,
|
|
862
|
+
* images — base64, keyed by the path the stylesheet's `url()` names, beside
|
|
863
|
+
* it). It is served to browsers; the platform's servers never run it.
|
|
829
864
|
*/
|
|
830
|
-
bundle:
|
|
865
|
+
bundle: z22.object({
|
|
866
|
+
js: z22.string().min(1),
|
|
867
|
+
css: z22.string(),
|
|
868
|
+
assets: z22.record(z22.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z22.string().base64()).optional()
|
|
869
|
+
}).strict().optional(),
|
|
831
870
|
/**
|
|
832
871
|
* The class the spacefront root carries while this package is the space's.
|
|
833
872
|
* The package's own stylesheet styles under it. Absent = the platform's
|
|
834
873
|
* default theme class.
|
|
835
874
|
*/
|
|
836
|
-
theme:
|
|
875
|
+
theme: z22.object({ themeClass: z22.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
|
|
837
876
|
/** The canvas a fresh session opens on, before the visitor has asked anything. */
|
|
838
877
|
seedLayout: SpecSchema.optional(),
|
|
839
878
|
/**
|
|
840
879
|
* The package's own composition guidance for its own components — prompt
|
|
841
880
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
842
881
|
*/
|
|
843
|
-
promptSections:
|
|
882
|
+
promptSections: z22.array(z22.object({ id: z22.string().regex(/^[a-z0-9-]+$/), order: z22.number().int(), content: z22.string().min(1).max(2e4), requires: z22.array(z22.string()) }).strict()).max(10).optional(),
|
|
844
883
|
/**
|
|
845
884
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
846
885
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
847
886
|
*/
|
|
848
|
-
config:
|
|
887
|
+
config: z22.record(z22.string(), z22.unknown()).optional(),
|
|
849
888
|
/**
|
|
850
889
|
* Set by the platform, never by a publisher: this release is a DRAFT of the
|
|
851
890
|
* package `of`, previewed on the space `space`. See `draftSourceId`.
|
|
852
891
|
*/
|
|
853
|
-
draft:
|
|
892
|
+
draft: z22.object({ of: z22.string().min(1), space: z22.string().min(1) }).strict().optional()
|
|
854
893
|
}).strict();
|
|
855
894
|
|
|
856
895
|
// ../spacestation/src/projection/projection.ts
|
|
857
|
-
import { z as
|
|
858
|
-
var LateBoundValueSchema =
|
|
859
|
-
var DirectiveValueSchema =
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
896
|
+
import { z as z23 } from "zod";
|
|
897
|
+
var LateBoundValueSchema = z23.object({ fact: z23.literal(true) });
|
|
898
|
+
var DirectiveValueSchema = z23.union([
|
|
899
|
+
z23.string(),
|
|
900
|
+
z23.number(),
|
|
901
|
+
z23.boolean(),
|
|
863
902
|
LateBoundValueSchema
|
|
864
903
|
]);
|
|
865
|
-
var ProjectionDirectiveSchema =
|
|
904
|
+
var ProjectionDirectiveSchema = z23.object({
|
|
866
905
|
/** Keep only items whose axis values all match. Keyed by axis name
|
|
867
906
|
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
868
|
-
isolateTo:
|
|
907
|
+
isolateTo: z23.record(DirectiveValueSchema).optional(),
|
|
869
908
|
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
870
909
|
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
871
910
|
* entity binding expands it against the entity's own axes + facts. */
|
|
872
|
-
isolateToFacts:
|
|
911
|
+
isolateToFacts: z23.boolean().optional(),
|
|
873
912
|
/** Keep only items the entity binding reports as available. */
|
|
874
|
-
availableOnly:
|
|
913
|
+
availableOnly: z23.boolean().optional(),
|
|
875
914
|
/** Cap the rendered count after filtering. */
|
|
876
|
-
limit:
|
|
915
|
+
limit: z23.number().int().positive().optional()
|
|
877
916
|
});
|
|
878
|
-
var ProjectionPreferencesSchema =
|
|
879
|
-
|
|
917
|
+
var ProjectionPreferencesSchema = z23.record(
|
|
918
|
+
z23.union([ProjectionDirectiveSchema, z23.null()])
|
|
880
919
|
);
|
|
881
|
-
var ProjectionSetPayloadSchema =
|
|
882
|
-
setAll:
|
|
920
|
+
var ProjectionSetPayloadSchema = z23.object({
|
|
921
|
+
setAll: z23.union([ProjectionDirectiveSchema, z23.null()]).optional(),
|
|
883
922
|
set: ProjectionPreferencesSchema.optional()
|
|
884
923
|
});
|
|
885
924
|
|
|
886
925
|
// ../spacestation/src/focus/focus.ts
|
|
887
|
-
import { z as
|
|
888
|
-
var FocusElementPayloadSchema =
|
|
889
|
-
elementId:
|
|
926
|
+
import { z as z24 } from "zod";
|
|
927
|
+
var FocusElementPayloadSchema = z24.object({
|
|
928
|
+
elementId: z24.string().min(1)
|
|
890
929
|
});
|
|
891
930
|
|
|
892
931
|
// ../spacestation/src/view/continuation.ts
|
|
893
|
-
import { z as
|
|
894
|
-
var ViewExtendPayloadSchema =
|
|
895
|
-
reason:
|
|
932
|
+
import { z as z25 } from "zod";
|
|
933
|
+
var ViewExtendPayloadSchema = z25.object({
|
|
934
|
+
reason: z25.enum(["scroll_near_bottom"])
|
|
896
935
|
});
|
|
897
936
|
|
|
898
937
|
// ../spacestation/src/attachment/attachment.ts
|
|
899
|
-
import { z as
|
|
938
|
+
import { z as z26 } from "zod";
|
|
900
939
|
var ALLOWED_ATTACHMENT_TYPES = [
|
|
901
940
|
"image/jpeg",
|
|
902
941
|
"image/png",
|
|
@@ -908,34 +947,34 @@ var MAX_ATTACHMENT_BYTES = 10 * 1024 * 1024;
|
|
|
908
947
|
function isAllowedAttachmentType(mime) {
|
|
909
948
|
return ALLOWED_ATTACHMENT_TYPES.includes(mime);
|
|
910
949
|
}
|
|
911
|
-
var AttachmentRefSchema =
|
|
912
|
-
id:
|
|
913
|
-
mimeType:
|
|
950
|
+
var AttachmentRefSchema = z26.object({
|
|
951
|
+
id: z26.string().min(1),
|
|
952
|
+
mimeType: z26.string().refine(isAllowedAttachmentType, {
|
|
914
953
|
message: "mimeType not on the attachment allow-list"
|
|
915
954
|
}),
|
|
916
|
-
name:
|
|
917
|
-
size:
|
|
918
|
-
url:
|
|
955
|
+
name: z26.string().min(1),
|
|
956
|
+
size: z26.number().int().positive().max(MAX_ATTACHMENT_BYTES),
|
|
957
|
+
url: z26.string().min(1)
|
|
919
958
|
});
|
|
920
|
-
var AttachmentRefsSchema =
|
|
959
|
+
var AttachmentRefsSchema = z26.array(AttachmentRefSchema);
|
|
921
960
|
|
|
922
961
|
// ../spacestation/src/contracts/entry-context.ts
|
|
923
|
-
import { z as
|
|
962
|
+
import { z as z27 } from "zod";
|
|
924
963
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
925
964
|
var ENTRY_CONTEXT_MAX_KEYS = 12;
|
|
926
965
|
var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
|
|
927
966
|
var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
|
|
928
|
-
var EntryContextValueSchema =
|
|
929
|
-
var EntryContextNameSchema =
|
|
930
|
-
var EntryContextNamespaceSchema =
|
|
967
|
+
var EntryContextValueSchema = z27.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
|
|
968
|
+
var EntryContextNameSchema = z27.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
|
|
969
|
+
var EntryContextNamespaceSchema = z27.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries) => Object.keys(entries).length <= ENTRY_CONTEXT_MAX_KEYS, {
|
|
931
970
|
message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
|
|
932
971
|
});
|
|
933
|
-
var EntryContextSchema =
|
|
972
|
+
var EntryContextSchema = z27.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
|
|
934
973
|
message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
|
|
935
974
|
});
|
|
936
975
|
|
|
937
976
|
// ../spacestation/src/contracts/session-arrival.ts
|
|
938
|
-
import { z as
|
|
977
|
+
import { z as z28 } from "zod";
|
|
939
978
|
var SURFACES = [
|
|
940
979
|
"spacefront",
|
|
941
980
|
"embed",
|
|
@@ -945,11 +984,11 @@ var SURFACES = [
|
|
|
945
984
|
"playground",
|
|
946
985
|
"automation"
|
|
947
986
|
];
|
|
948
|
-
var SurfaceSchema =
|
|
987
|
+
var SurfaceSchema = z28.enum(SURFACES);
|
|
949
988
|
var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
|
|
950
|
-
var ClickIdKindSchema =
|
|
989
|
+
var ClickIdKindSchema = z28.enum(CLICK_ID_KINDS);
|
|
951
990
|
var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
|
|
952
|
-
var VisitorIdDurabilitySchema =
|
|
991
|
+
var VisitorIdDurabilitySchema = z28.enum(VISITOR_ID_DURABILITIES);
|
|
953
992
|
var TRAFFIC_BUCKETS = [
|
|
954
993
|
"paid_google",
|
|
955
994
|
"paid_meta",
|
|
@@ -961,10 +1000,10 @@ var TRAFFIC_BUCKETS = [
|
|
|
961
1000
|
"direct",
|
|
962
1001
|
"unknown"
|
|
963
1002
|
];
|
|
964
|
-
var TrafficBucketSchema =
|
|
1003
|
+
var TrafficBucketSchema = z28.enum(TRAFFIC_BUCKETS);
|
|
965
1004
|
var ARRIVAL_MAX_VALUE_CHARS = 200;
|
|
966
|
-
var ArrivalValueSchema =
|
|
967
|
-
var SessionArrivalSchema =
|
|
1005
|
+
var ArrivalValueSchema = z28.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
|
|
1006
|
+
var SessionArrivalSchema = z28.object({
|
|
968
1007
|
utmSource: ArrivalValueSchema.optional(),
|
|
969
1008
|
utmMedium: ArrivalValueSchema.optional(),
|
|
970
1009
|
utmCampaign: ArrivalValueSchema.optional(),
|
|
@@ -998,36 +1037,36 @@ var ARRIVAL_PARAMS = [
|
|
|
998
1037
|
];
|
|
999
1038
|
|
|
1000
1039
|
// ../spacestation/src/catalog/attribute-registry.ts
|
|
1001
|
-
import { z as
|
|
1002
|
-
var AttributeScopeBucketSchema =
|
|
1003
|
-
scope:
|
|
1004
|
-
needles:
|
|
1005
|
-
label:
|
|
1040
|
+
import { z as z29 } from "zod";
|
|
1041
|
+
var AttributeScopeBucketSchema = z29.object({
|
|
1042
|
+
scope: z29.string(),
|
|
1043
|
+
needles: z29.array(z29.string()).readonly(),
|
|
1044
|
+
label: z29.string().optional()
|
|
1006
1045
|
});
|
|
1007
|
-
var AttributeScopeConfigSchema =
|
|
1008
|
-
facet:
|
|
1009
|
-
buckets:
|
|
1010
|
-
emptyScope:
|
|
1011
|
-
noMatchScope:
|
|
1012
|
-
ignoreValues:
|
|
1013
|
-
emptyScopeLabel:
|
|
1014
|
-
noMatchScopeLabel:
|
|
1046
|
+
var AttributeScopeConfigSchema = z29.object({
|
|
1047
|
+
facet: z29.string(),
|
|
1048
|
+
buckets: z29.array(AttributeScopeBucketSchema).readonly(),
|
|
1049
|
+
emptyScope: z29.string(),
|
|
1050
|
+
noMatchScope: z29.string(),
|
|
1051
|
+
ignoreValues: z29.array(z29.string()).readonly(),
|
|
1052
|
+
emptyScopeLabel: z29.string().optional(),
|
|
1053
|
+
noMatchScopeLabel: z29.string().optional()
|
|
1015
1054
|
});
|
|
1016
|
-
var AttributeDefBaseSchema =
|
|
1017
|
-
description:
|
|
1018
|
-
durable:
|
|
1019
|
-
label:
|
|
1055
|
+
var AttributeDefBaseSchema = z29.object({
|
|
1056
|
+
description: z29.string().optional(),
|
|
1057
|
+
durable: z29.boolean().optional(),
|
|
1058
|
+
label: z29.string().optional()
|
|
1020
1059
|
});
|
|
1021
|
-
var AttributeDefSchema =
|
|
1022
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1023
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1024
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1025
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1060
|
+
var AttributeDefSchema = z29.discriminatedUnion("kind", [
|
|
1061
|
+
AttributeDefBaseSchema.extend({ kind: z29.literal("enum"), values: z29.array(z29.string()) }),
|
|
1062
|
+
AttributeDefBaseSchema.extend({ kind: z29.literal("free_text") }),
|
|
1063
|
+
AttributeDefBaseSchema.extend({ kind: z29.literal("date_or_season") }),
|
|
1064
|
+
AttributeDefBaseSchema.extend({ kind: z29.literal("money_or_band") }),
|
|
1026
1065
|
AttributeDefBaseSchema.extend({
|
|
1027
|
-
kind:
|
|
1028
|
-
min:
|
|
1029
|
-
max:
|
|
1030
|
-
unit:
|
|
1066
|
+
kind: z29.literal("number"),
|
|
1067
|
+
min: z29.number().optional(),
|
|
1068
|
+
max: z29.number().optional(),
|
|
1069
|
+
unit: z29.string().optional()
|
|
1031
1070
|
})
|
|
1032
1071
|
]);
|
|
1033
1072
|
|
|
@@ -1059,30 +1098,30 @@ var DEFAULT_SPACE_CONFIG = {
|
|
|
1059
1098
|
};
|
|
1060
1099
|
|
|
1061
1100
|
// ../spacestation/src/space/trace.ts
|
|
1062
|
-
import { z as
|
|
1063
|
-
var RunTokenUsageSchema =
|
|
1064
|
-
input_tokens:
|
|
1065
|
-
output_tokens:
|
|
1066
|
-
cache_read_tokens:
|
|
1101
|
+
import { z as z30 } from "zod";
|
|
1102
|
+
var RunTokenUsageSchema = z30.object({
|
|
1103
|
+
input_tokens: z30.number().optional(),
|
|
1104
|
+
output_tokens: z30.number().optional(),
|
|
1105
|
+
cache_read_tokens: z30.number().optional()
|
|
1067
1106
|
});
|
|
1068
|
-
var TraceRecordSchema =
|
|
1069
|
-
id:
|
|
1070
|
-
spaceId:
|
|
1071
|
-
sessionId:
|
|
1107
|
+
var TraceRecordSchema = z30.object({
|
|
1108
|
+
id: z30.string().uuid(),
|
|
1109
|
+
spaceId: z30.string().uuid().nullable(),
|
|
1110
|
+
sessionId: z30.string(),
|
|
1072
1111
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
1073
1112
|
* for an unlocked space / anonymous unlock. */
|
|
1074
|
-
visitorEmail:
|
|
1075
|
-
userPrompt:
|
|
1076
|
-
branch:
|
|
1077
|
-
responseText:
|
|
1078
|
-
layout:
|
|
1079
|
-
phaseTimings:
|
|
1080
|
-
tokensByModel:
|
|
1081
|
-
toolCalls:
|
|
1082
|
-
diagnostics:
|
|
1083
|
-
latencyFirstText:
|
|
1084
|
-
latencyFirstPatch:
|
|
1085
|
-
latencyTotal:
|
|
1113
|
+
visitorEmail: z30.string().nullable(),
|
|
1114
|
+
userPrompt: z30.string(),
|
|
1115
|
+
branch: z30.string().nullable(),
|
|
1116
|
+
responseText: z30.string().nullable(),
|
|
1117
|
+
layout: z30.unknown().nullable(),
|
|
1118
|
+
phaseTimings: z30.record(z30.number()).nullable(),
|
|
1119
|
+
tokensByModel: z30.record(RunTokenUsageSchema).nullable(),
|
|
1120
|
+
toolCalls: z30.array(z30.unknown()).nullable(),
|
|
1121
|
+
diagnostics: z30.array(z30.unknown()).nullable(),
|
|
1122
|
+
latencyFirstText: z30.number().int().nullable(),
|
|
1123
|
+
latencyFirstPatch: z30.number().int().nullable(),
|
|
1124
|
+
latencyTotal: z30.number().int().nullable(),
|
|
1086
1125
|
/**
|
|
1087
1126
|
* The CLIENT's turn id for this run, or `null`.
|
|
1088
1127
|
*
|
|
@@ -1098,29 +1137,29 @@ var TraceRecordSchema = z29.object({
|
|
|
1098
1137
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1099
1138
|
* visitor asked something and got nothing.
|
|
1100
1139
|
*/
|
|
1101
|
-
turnId:
|
|
1140
|
+
turnId: z30.string().nullable(),
|
|
1102
1141
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
1103
1142
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
1104
|
-
trackerState:
|
|
1105
|
-
createdAt:
|
|
1143
|
+
trackerState: z30.unknown().nullable(),
|
|
1144
|
+
createdAt: z30.string()
|
|
1106
1145
|
});
|
|
1107
|
-
var MillisecondsSchema =
|
|
1108
|
-
var CreateTraceInputSchema =
|
|
1109
|
-
spaceId:
|
|
1110
|
-
sessionId:
|
|
1111
|
-
visitorEmail:
|
|
1112
|
-
userPrompt:
|
|
1113
|
-
branch:
|
|
1114
|
-
responseText:
|
|
1115
|
-
layout:
|
|
1116
|
-
phaseTimings:
|
|
1117
|
-
tokensByModel:
|
|
1118
|
-
toolCalls:
|
|
1119
|
-
diagnostics:
|
|
1146
|
+
var MillisecondsSchema = z30.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
1147
|
+
var CreateTraceInputSchema = z30.object({
|
|
1148
|
+
spaceId: z30.string().uuid().nullable(),
|
|
1149
|
+
sessionId: z30.string(),
|
|
1150
|
+
visitorEmail: z30.string().nullable(),
|
|
1151
|
+
userPrompt: z30.string(),
|
|
1152
|
+
branch: z30.string().nullable(),
|
|
1153
|
+
responseText: z30.string().nullable(),
|
|
1154
|
+
layout: z30.unknown().nullable(),
|
|
1155
|
+
phaseTimings: z30.record(z30.number()).nullable(),
|
|
1156
|
+
tokensByModel: z30.record(RunTokenUsageSchema).nullable(),
|
|
1157
|
+
toolCalls: z30.array(z30.unknown()).nullable(),
|
|
1158
|
+
diagnostics: z30.array(z30.unknown()).nullable(),
|
|
1120
1159
|
latencyFirstText: MillisecondsSchema,
|
|
1121
1160
|
latencyFirstPatch: MillisecondsSchema,
|
|
1122
1161
|
latencyTotal: MillisecondsSchema,
|
|
1123
|
-
trackerState:
|
|
1162
|
+
trackerState: z30.unknown().nullable(),
|
|
1124
1163
|
/**
|
|
1125
1164
|
* The CLIENT's turn id for this run, or `null`.
|
|
1126
1165
|
*
|
|
@@ -1136,37 +1175,37 @@ var CreateTraceInputSchema = z29.object({
|
|
|
1136
1175
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1137
1176
|
* visitor asked something and got nothing.
|
|
1138
1177
|
*/
|
|
1139
|
-
turnId:
|
|
1178
|
+
turnId: z30.string().nullable()
|
|
1140
1179
|
});
|
|
1141
|
-
var AgentSessionSummarySchema =
|
|
1142
|
-
sessionId:
|
|
1180
|
+
var AgentSessionSummarySchema = z30.object({
|
|
1181
|
+
sessionId: z30.string(),
|
|
1143
1182
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
1144
|
-
turnCount:
|
|
1183
|
+
turnCount: z30.number().int(),
|
|
1145
1184
|
/** The session's opening prompt — titles the row in the UI. */
|
|
1146
|
-
firstPrompt:
|
|
1147
|
-
startedAt:
|
|
1148
|
-
lastRunAt:
|
|
1185
|
+
firstPrompt: z30.string(),
|
|
1186
|
+
startedAt: z30.string(),
|
|
1187
|
+
lastRunAt: z30.string(),
|
|
1149
1188
|
/** Summed `latency_total` across the session's turns. */
|
|
1150
|
-
totalLatencyMs:
|
|
1189
|
+
totalLatencyMs: z30.number().int()
|
|
1151
1190
|
});
|
|
1152
|
-
var SessionTurnSchema =
|
|
1153
|
-
id:
|
|
1154
|
-
userPrompt:
|
|
1155
|
-
responseText:
|
|
1191
|
+
var SessionTurnSchema = z30.object({
|
|
1192
|
+
id: z30.string().uuid(),
|
|
1193
|
+
userPrompt: z30.string(),
|
|
1194
|
+
responseText: z30.string().nullable(),
|
|
1156
1195
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
1157
|
-
layout:
|
|
1158
|
-
createdAt:
|
|
1159
|
-
latencyTotal:
|
|
1160
|
-
phaseTimings:
|
|
1161
|
-
tokensByModel:
|
|
1162
|
-
input_tokens:
|
|
1163
|
-
output_tokens:
|
|
1196
|
+
layout: z30.unknown().nullable(),
|
|
1197
|
+
createdAt: z30.string(),
|
|
1198
|
+
latencyTotal: z30.number().int().nullable(),
|
|
1199
|
+
phaseTimings: z30.record(z30.number()).nullable(),
|
|
1200
|
+
tokensByModel: z30.record(z30.object({
|
|
1201
|
+
input_tokens: z30.number().optional(),
|
|
1202
|
+
output_tokens: z30.number().optional()
|
|
1164
1203
|
})).nullable(),
|
|
1165
|
-
toolCalls:
|
|
1166
|
-
diagnostics:
|
|
1204
|
+
toolCalls: z30.array(z30.unknown()).nullable(),
|
|
1205
|
+
diagnostics: z30.array(z30.unknown()).nullable()
|
|
1167
1206
|
});
|
|
1168
|
-
var SessionReplaySchema =
|
|
1169
|
-
turns:
|
|
1207
|
+
var SessionReplaySchema = z30.object({
|
|
1208
|
+
turns: z30.array(SessionTurnSchema),
|
|
1170
1209
|
/**
|
|
1171
1210
|
* The session's own last-committed layout, read straight off the durable
|
|
1172
1211
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -1177,20 +1216,20 @@ var SessionReplaySchema = z29.object({
|
|
|
1177
1216
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
1178
1217
|
* when the durable session row itself could not be read.
|
|
1179
1218
|
*/
|
|
1180
|
-
sessionLayout:
|
|
1219
|
+
sessionLayout: z30.record(z30.string(), z30.unknown()).nullable()
|
|
1181
1220
|
});
|
|
1182
|
-
var SessionTraceSchema =
|
|
1183
|
-
trackerState:
|
|
1221
|
+
var SessionTraceSchema = z30.object({
|
|
1222
|
+
trackerState: z30.string().nullable()
|
|
1184
1223
|
});
|
|
1185
|
-
var LlmUsageDailySchema =
|
|
1186
|
-
day:
|
|
1224
|
+
var LlmUsageDailySchema = z30.object({
|
|
1225
|
+
day: z30.string(),
|
|
1187
1226
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
1188
|
-
environment:
|
|
1189
|
-
feature:
|
|
1190
|
-
model:
|
|
1191
|
-
provider:
|
|
1227
|
+
environment: z30.string(),
|
|
1228
|
+
feature: z30.string(),
|
|
1229
|
+
model: z30.string(),
|
|
1230
|
+
provider: z30.string(),
|
|
1192
1231
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
1193
|
-
keyFingerprint:
|
|
1232
|
+
keyFingerprint: z30.string().nullable(),
|
|
1194
1233
|
/**
|
|
1195
1234
|
* The space the call served, or null when it served none.
|
|
1196
1235
|
*
|
|
@@ -1199,91 +1238,91 @@ var LlmUsageDailySchema = z29.object({
|
|
|
1199
1238
|
* report that share rather than dropping it, or a per-space total reads as
|
|
1200
1239
|
* the platform total.
|
|
1201
1240
|
*/
|
|
1202
|
-
spaceId:
|
|
1241
|
+
spaceId: z30.string().nullable(),
|
|
1203
1242
|
/**
|
|
1204
1243
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
1205
1244
|
* when it served no session or the session predates surface recording.
|
|
1206
1245
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
1207
1246
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
1208
1247
|
*/
|
|
1209
|
-
surface:
|
|
1210
|
-
inputTokens:
|
|
1211
|
-
outputTokens:
|
|
1248
|
+
surface: z30.string().nullable(),
|
|
1249
|
+
inputTokens: z30.number(),
|
|
1250
|
+
outputTokens: z30.number(),
|
|
1212
1251
|
/** Subset of inputTokens, never additional to it. */
|
|
1213
|
-
cachedInputTokens:
|
|
1214
|
-
reasoningTokens:
|
|
1215
|
-
callCount:
|
|
1216
|
-
errorCount:
|
|
1217
|
-
estimatedCostUsd:
|
|
1252
|
+
cachedInputTokens: z30.number(),
|
|
1253
|
+
reasoningTokens: z30.number(),
|
|
1254
|
+
callCount: z30.number(),
|
|
1255
|
+
errorCount: z30.number(),
|
|
1256
|
+
estimatedCostUsd: z30.number().nullable()
|
|
1218
1257
|
});
|
|
1219
|
-
var LlmUsageBySessionSchema =
|
|
1220
|
-
sessionId:
|
|
1221
|
-
environment:
|
|
1222
|
-
model:
|
|
1258
|
+
var LlmUsageBySessionSchema = z30.object({
|
|
1259
|
+
sessionId: z30.string(),
|
|
1260
|
+
environment: z30.string(),
|
|
1261
|
+
model: z30.string(),
|
|
1223
1262
|
/** The space this session belongs to, or null for a session with no space. */
|
|
1224
|
-
spaceId:
|
|
1263
|
+
spaceId: z30.string().nullable(),
|
|
1225
1264
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
1226
|
-
surface:
|
|
1265
|
+
surface: z30.string().nullable(),
|
|
1227
1266
|
/** Label only — the first feature seen in the session. */
|
|
1228
|
-
firstFeature:
|
|
1229
|
-
startedAt:
|
|
1230
|
-
endedAt:
|
|
1231
|
-
inputTokens:
|
|
1232
|
-
outputTokens:
|
|
1233
|
-
cachedInputTokens:
|
|
1234
|
-
reasoningTokens:
|
|
1235
|
-
callCount:
|
|
1236
|
-
errorCount:
|
|
1267
|
+
firstFeature: z30.string(),
|
|
1268
|
+
startedAt: z30.string(),
|
|
1269
|
+
endedAt: z30.string(),
|
|
1270
|
+
inputTokens: z30.number(),
|
|
1271
|
+
outputTokens: z30.number(),
|
|
1272
|
+
cachedInputTokens: z30.number(),
|
|
1273
|
+
reasoningTokens: z30.number(),
|
|
1274
|
+
callCount: z30.number(),
|
|
1275
|
+
errorCount: z30.number(),
|
|
1237
1276
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
1238
1277
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
1239
1278
|
* the model is unpriced; never 0, which would read as free. */
|
|
1240
|
-
estimatedCostUsd:
|
|
1279
|
+
estimatedCostUsd: z30.number().nullable()
|
|
1241
1280
|
});
|
|
1242
|
-
var LlmSessionsDailySchema =
|
|
1243
|
-
day:
|
|
1244
|
-
environment:
|
|
1245
|
-
sessionCount:
|
|
1281
|
+
var LlmSessionsDailySchema = z30.object({
|
|
1282
|
+
day: z30.string(),
|
|
1283
|
+
environment: z30.string(),
|
|
1284
|
+
sessionCount: z30.number()
|
|
1246
1285
|
});
|
|
1247
1286
|
|
|
1248
1287
|
// ../spacestation/src/space/session-queue.ts
|
|
1249
|
-
import { z as
|
|
1288
|
+
import { z as z32 } from "zod";
|
|
1250
1289
|
|
|
1251
1290
|
// ../spacestation/src/space/session-activity.ts
|
|
1252
|
-
import { z as
|
|
1253
|
-
var SessionActivityEventSchema =
|
|
1254
|
-
id:
|
|
1255
|
-
kind:
|
|
1256
|
-
occurredAt:
|
|
1257
|
-
source:
|
|
1258
|
-
surface:
|
|
1259
|
-
payload:
|
|
1291
|
+
import { z as z31 } from "zod";
|
|
1292
|
+
var SessionActivityEventSchema = z31.object({
|
|
1293
|
+
id: z31.string(),
|
|
1294
|
+
kind: z31.string(),
|
|
1295
|
+
occurredAt: z31.string(),
|
|
1296
|
+
source: z31.string(),
|
|
1297
|
+
surface: z31.string(),
|
|
1298
|
+
payload: z31.record(z31.unknown())
|
|
1260
1299
|
});
|
|
1261
|
-
var SessionActivitySchema =
|
|
1262
|
-
events:
|
|
1263
|
-
hasMore:
|
|
1300
|
+
var SessionActivitySchema = z31.object({
|
|
1301
|
+
events: z31.array(SessionActivityEventSchema),
|
|
1302
|
+
hasMore: z31.boolean()
|
|
1264
1303
|
});
|
|
1265
1304
|
|
|
1266
1305
|
// ../spacestation/src/space/session-queue.ts
|
|
1267
|
-
var SessionVerdictSchema =
|
|
1268
|
-
var RecordableVerdictSchema =
|
|
1269
|
-
var SessionReviewEventSchema =
|
|
1270
|
-
id:
|
|
1306
|
+
var SessionVerdictSchema = z32.enum(["unreviewed", "viewed", "bug"]);
|
|
1307
|
+
var RecordableVerdictSchema = z32.enum(["viewed", "bug"]);
|
|
1308
|
+
var SessionReviewEventSchema = z32.object({
|
|
1309
|
+
id: z32.string().uuid(),
|
|
1271
1310
|
verdict: RecordableVerdictSchema,
|
|
1272
1311
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
1273
1312
|
* log is append-only rather than a mutable current-state row. */
|
|
1274
|
-
reviewer:
|
|
1275
|
-
note:
|
|
1276
|
-
createdAt:
|
|
1313
|
+
reviewer: z32.string(),
|
|
1314
|
+
note: z32.string().nullable(),
|
|
1315
|
+
createdAt: z32.string()
|
|
1277
1316
|
});
|
|
1278
|
-
var BugSeveritySchema =
|
|
1279
|
-
var BugLocationSchema =
|
|
1280
|
-
elementId:
|
|
1317
|
+
var BugSeveritySchema = z32.enum(["high", "medium", "low"]);
|
|
1318
|
+
var BugLocationSchema = z32.object({
|
|
1319
|
+
elementId: z32.string().nullable(),
|
|
1281
1320
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
1282
1321
|
* alongside a null `elementId`. */
|
|
1283
|
-
elementType:
|
|
1322
|
+
elementType: z32.string().nullable(),
|
|
1284
1323
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
1285
|
-
offsetXPct:
|
|
1286
|
-
offsetYPct:
|
|
1324
|
+
offsetXPct: z32.number().min(0).max(100).nullable(),
|
|
1325
|
+
offsetYPct: z32.number().min(0).max(100).nullable(),
|
|
1287
1326
|
/**
|
|
1288
1327
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
1289
1328
|
* element anchor.
|
|
@@ -1294,8 +1333,8 @@ var BugLocationSchema = z31.object({
|
|
|
1294
1333
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
1295
1334
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
1296
1335
|
*/
|
|
1297
|
-
pageX:
|
|
1298
|
-
pageY:
|
|
1336
|
+
pageX: z32.number().nullable(),
|
|
1337
|
+
pageY: z32.number().nullable()
|
|
1299
1338
|
}).refine(
|
|
1300
1339
|
(loc) => {
|
|
1301
1340
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -1309,24 +1348,24 @@ var BugLocationSchema = z31.object({
|
|
|
1309
1348
|
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)"
|
|
1310
1349
|
}
|
|
1311
1350
|
);
|
|
1312
|
-
var SessionBugSchema =
|
|
1313
|
-
id:
|
|
1351
|
+
var SessionBugSchema = z32.object({
|
|
1352
|
+
id: z32.string().uuid(),
|
|
1314
1353
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
1315
|
-
turnIndex:
|
|
1354
|
+
turnIndex: z32.number().int().nullable(),
|
|
1316
1355
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
1317
1356
|
* without pinning a spot. */
|
|
1318
1357
|
location: BugLocationSchema.nullable(),
|
|
1319
|
-
provider:
|
|
1320
|
-
issueKey:
|
|
1321
|
-
issueUrl:
|
|
1358
|
+
provider: z32.string(),
|
|
1359
|
+
issueKey: z32.string().nullable(),
|
|
1360
|
+
issueUrl: z32.string().nullable(),
|
|
1322
1361
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
1323
1362
|
* open text. Null until first synced. */
|
|
1324
|
-
issueState:
|
|
1325
|
-
title:
|
|
1326
|
-
body:
|
|
1363
|
+
issueState: z32.string().nullable(),
|
|
1364
|
+
title: z32.string(),
|
|
1365
|
+
body: z32.string(),
|
|
1327
1366
|
severity: BugSeveritySchema,
|
|
1328
|
-
createdBy:
|
|
1329
|
-
createdAt:
|
|
1367
|
+
createdBy: z32.string(),
|
|
1368
|
+
createdAt: z32.string(),
|
|
1330
1369
|
/**
|
|
1331
1370
|
* When this bug was resolved from the console; null means still OPEN.
|
|
1332
1371
|
*
|
|
@@ -1335,55 +1374,55 @@ var SessionBugSchema = z31.object({
|
|
|
1335
1374
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
1336
1375
|
* no boolean can contradict it.
|
|
1337
1376
|
*/
|
|
1338
|
-
resolvedAt:
|
|
1339
|
-
resolvedBy:
|
|
1377
|
+
resolvedAt: z32.string().nullable(),
|
|
1378
|
+
resolvedBy: z32.string().nullable()
|
|
1340
1379
|
});
|
|
1341
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
1342
|
-
var SessionCommentSchema =
|
|
1343
|
-
id:
|
|
1380
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z32.string() });
|
|
1381
|
+
var SessionCommentSchema = z32.object({
|
|
1382
|
+
id: z32.string().uuid(),
|
|
1344
1383
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
1345
|
-
bugId:
|
|
1384
|
+
bugId: z32.string().uuid().nullable(),
|
|
1346
1385
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
1347
1386
|
* parent bug's turn). */
|
|
1348
|
-
turnIndex:
|
|
1387
|
+
turnIndex: z32.number().int().nullable(),
|
|
1349
1388
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
1350
1389
|
location: BugLocationSchema.nullable(),
|
|
1351
|
-
body:
|
|
1352
|
-
createdBy:
|
|
1353
|
-
createdAt:
|
|
1390
|
+
body: z32.string(),
|
|
1391
|
+
createdBy: z32.string(),
|
|
1392
|
+
createdAt: z32.string()
|
|
1354
1393
|
});
|
|
1355
|
-
var CreateCommentInputSchema =
|
|
1356
|
-
bugId:
|
|
1357
|
-
turnIndex:
|
|
1394
|
+
var CreateCommentInputSchema = z32.object({
|
|
1395
|
+
bugId: z32.string().uuid().nullable(),
|
|
1396
|
+
turnIndex: z32.number().int().positive().nullable(),
|
|
1358
1397
|
location: BugLocationSchema.nullable(),
|
|
1359
1398
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
1360
1399
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
1361
|
-
body:
|
|
1400
|
+
body: z32.string().trim().min(1)
|
|
1362
1401
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
1363
1402
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
1364
1403
|
});
|
|
1365
|
-
var UpdateCommentInputSchema =
|
|
1366
|
-
body:
|
|
1367
|
-
bugId:
|
|
1404
|
+
var UpdateCommentInputSchema = z32.object({
|
|
1405
|
+
body: z32.string().trim().min(1).optional(),
|
|
1406
|
+
bugId: z32.string().uuid().nullable().optional(),
|
|
1368
1407
|
location: BugLocationSchema.nullable().optional()
|
|
1369
1408
|
});
|
|
1370
|
-
var SessionFormFactorSchema =
|
|
1371
|
-
var SessionSummarySchema =
|
|
1372
|
-
sessionId:
|
|
1409
|
+
var SessionFormFactorSchema = z32.enum(["mobile", "desktop"]).nullable();
|
|
1410
|
+
var SessionSummarySchema = z32.object({
|
|
1411
|
+
sessionId: z32.string(),
|
|
1373
1412
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
1374
1413
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
1375
|
-
visitorId:
|
|
1414
|
+
visitorId: z32.string().nullable(),
|
|
1376
1415
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
1377
1416
|
* identified themselves. Both null together means "not identified yet". */
|
|
1378
|
-
identityProvider:
|
|
1379
|
-
identityKey:
|
|
1417
|
+
identityProvider: z32.string().nullable(),
|
|
1418
|
+
identityKey: z32.string().nullable(),
|
|
1380
1419
|
/** Team/test traffic. The queue hides these by default. */
|
|
1381
|
-
isInternal:
|
|
1420
|
+
isInternal: z32.boolean(),
|
|
1382
1421
|
/** Build that served the session. Null = not captured; a version filter must
|
|
1383
1422
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
1384
|
-
clientVersion:
|
|
1423
|
+
clientVersion: z32.string().nullable(),
|
|
1385
1424
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
1386
|
-
signalCounts:
|
|
1425
|
+
signalCounts: z32.record(z32.number()),
|
|
1387
1426
|
/**
|
|
1388
1427
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
1389
1428
|
*
|
|
@@ -1400,7 +1439,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1400
1439
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
1401
1440
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
1402
1441
|
*/
|
|
1403
|
-
conversionAttempts:
|
|
1442
|
+
conversionAttempts: z32.number().int().nullable(),
|
|
1404
1443
|
/**
|
|
1405
1444
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
1406
1445
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -1416,7 +1455,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1416
1455
|
* kinds together, and one attempt id appearing under both would be counted
|
|
1417
1456
|
* once there and twice here.
|
|
1418
1457
|
*/
|
|
1419
|
-
conversionKinds:
|
|
1458
|
+
conversionKinds: z32.record(z32.number()),
|
|
1420
1459
|
/**
|
|
1421
1460
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
1422
1461
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -1424,20 +1463,20 @@ var SessionSummarySchema = z31.object({
|
|
|
1424
1463
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
1425
1464
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
1426
1465
|
*/
|
|
1427
|
-
funnelSteps:
|
|
1466
|
+
funnelSteps: z32.array(z32.string()),
|
|
1428
1467
|
/**
|
|
1429
1468
|
* The connector's opaque handle for what this session produced in its back
|
|
1430
1469
|
* office — present only once a checkout actually reached the platform. The
|
|
1431
1470
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
1432
1471
|
*/
|
|
1433
|
-
backOfficeRef:
|
|
1472
|
+
backOfficeRef: z32.string().nullable(),
|
|
1434
1473
|
/**
|
|
1435
1474
|
* The order this session produced, when the connector's back office reported
|
|
1436
1475
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
1437
1476
|
* Both null when no order is known — the cart handle above is then the door.
|
|
1438
1477
|
*/
|
|
1439
|
-
orderRef:
|
|
1440
|
-
orderLabel:
|
|
1478
|
+
orderRef: z32.string().nullable(),
|
|
1479
|
+
orderLabel: z32.string().nullable(),
|
|
1441
1480
|
/**
|
|
1442
1481
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
1443
1482
|
* needs.
|
|
@@ -1450,12 +1489,12 @@ var SessionSummarySchema = z31.object({
|
|
|
1450
1489
|
* on a desktop are not the same session.
|
|
1451
1490
|
*/
|
|
1452
1491
|
formFactor: SessionFormFactorSchema,
|
|
1453
|
-
turnCount:
|
|
1492
|
+
turnCount: z32.number().int(),
|
|
1454
1493
|
/** The visitor's opening message — the single most informative field for
|
|
1455
1494
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
1456
|
-
firstPrompt:
|
|
1457
|
-
startedAt:
|
|
1458
|
-
lastRunAt:
|
|
1495
|
+
firstPrompt: z32.string(),
|
|
1496
|
+
startedAt: z32.string(),
|
|
1497
|
+
lastRunAt: z32.string(),
|
|
1459
1498
|
/**
|
|
1460
1499
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
1461
1500
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -1483,7 +1522,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1483
1522
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
1484
1523
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
1485
1524
|
*/
|
|
1486
|
-
visitorTimeZone:
|
|
1525
|
+
visitorTimeZone: z32.string().nullable(),
|
|
1487
1526
|
/**
|
|
1488
1527
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
1489
1528
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -1491,31 +1530,31 @@ var SessionSummarySchema = z31.object({
|
|
|
1491
1530
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
1492
1531
|
* already reading. Null when no turn in the session recorded a patch.
|
|
1493
1532
|
*/
|
|
1494
|
-
avgTtftMs:
|
|
1533
|
+
avgTtftMs: z32.number().int().nullable(),
|
|
1495
1534
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
1496
1535
|
* a budget: null on sessions older than the mark's recording. */
|
|
1497
|
-
avgMainDoneMs:
|
|
1536
|
+
avgMainDoneMs: z32.number().int().nullable(),
|
|
1498
1537
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
1499
1538
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
1500
|
-
avgChipGenMs:
|
|
1501
|
-
totalLatencyMs:
|
|
1502
|
-
durationMs:
|
|
1539
|
+
avgChipGenMs: z32.number().int().nullable(),
|
|
1540
|
+
totalLatencyMs: z32.number().int(),
|
|
1541
|
+
durationMs: z32.number().int(),
|
|
1503
1542
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
1504
1543
|
* live session streams and cannot be given a verdict until it ends. */
|
|
1505
|
-
isLive:
|
|
1544
|
+
isLive: z32.boolean(),
|
|
1506
1545
|
verdict: SessionVerdictSchema,
|
|
1507
|
-
reviewedBy:
|
|
1508
|
-
reviewedAt:
|
|
1546
|
+
reviewedBy: z32.string().nullable(),
|
|
1547
|
+
reviewedAt: z32.string().nullable(),
|
|
1509
1548
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
1510
1549
|
* state without a second request. */
|
|
1511
|
-
bugIssueKey:
|
|
1512
|
-
bugIssueUrl:
|
|
1513
|
-
bugIssueState:
|
|
1550
|
+
bugIssueKey: z32.string().nullable(),
|
|
1551
|
+
bugIssueUrl: z32.string().nullable(),
|
|
1552
|
+
bugIssueState: z32.string().nullable()
|
|
1514
1553
|
});
|
|
1515
|
-
var SessionQueuePageSchema =
|
|
1516
|
-
sessions:
|
|
1517
|
-
totalCount:
|
|
1518
|
-
hiddenInternalCount:
|
|
1554
|
+
var SessionQueuePageSchema = z32.object({
|
|
1555
|
+
sessions: z32.array(SessionSummarySchema),
|
|
1556
|
+
totalCount: z32.number().int(),
|
|
1557
|
+
hiddenInternalCount: z32.number().int(),
|
|
1519
1558
|
/**
|
|
1520
1559
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
1521
1560
|
*
|
|
@@ -1525,65 +1564,66 @@ var SessionQueuePageSchema = z31.object({
|
|
|
1525
1564
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
1526
1565
|
* analytics dashboard's bounce over the same window.
|
|
1527
1566
|
*/
|
|
1528
|
-
hiddenBouncedCount:
|
|
1567
|
+
hiddenBouncedCount: z32.number().int()
|
|
1529
1568
|
});
|
|
1530
|
-
var SessionQueueFacetsSchema =
|
|
1531
|
-
review:
|
|
1532
|
-
version:
|
|
1533
|
-
turns:
|
|
1534
|
-
durationS:
|
|
1569
|
+
var SessionQueueFacetsSchema = z32.object({
|
|
1570
|
+
review: z32.record(z32.number()),
|
|
1571
|
+
version: z32.record(z32.number()),
|
|
1572
|
+
turns: z32.record(z32.number()),
|
|
1573
|
+
durationS: z32.record(z32.number()),
|
|
1535
1574
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
1536
|
-
funnel:
|
|
1575
|
+
funnel: z32.record(z32.number())
|
|
1537
1576
|
});
|
|
1538
|
-
var SessionCaptureSchema =
|
|
1539
|
-
viewportWidth:
|
|
1540
|
-
viewportHeight:
|
|
1541
|
-
userAgent:
|
|
1542
|
-
locale:
|
|
1577
|
+
var SessionCaptureSchema = z32.object({
|
|
1578
|
+
viewportWidth: z32.number().int().nullable(),
|
|
1579
|
+
viewportHeight: z32.number().int().nullable(),
|
|
1580
|
+
userAgent: z32.string().nullable(),
|
|
1581
|
+
locale: z32.string().nullable(),
|
|
1543
1582
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
1544
|
-
referrer:
|
|
1583
|
+
referrer: z32.string().nullable()
|
|
1545
1584
|
});
|
|
1546
|
-
var SessionCaptureInputSchema =
|
|
1547
|
-
viewportWidth:
|
|
1548
|
-
viewportHeight:
|
|
1549
|
-
userAgent:
|
|
1550
|
-
locale:
|
|
1585
|
+
var SessionCaptureInputSchema = z32.object({
|
|
1586
|
+
viewportWidth: z32.number().int().positive().max(2e4).optional(),
|
|
1587
|
+
viewportHeight: z32.number().int().positive().max(2e4).optional(),
|
|
1588
|
+
userAgent: z32.string().max(1e3).optional(),
|
|
1589
|
+
locale: z32.string().max(35).optional(),
|
|
1551
1590
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
1552
1591
|
* the zone database grows, and refusing a name this build has not heard of
|
|
1553
1592
|
* would drop a real session's capture over a table that is out of date. */
|
|
1554
|
-
timeZone:
|
|
1555
|
-
referrer:
|
|
1556
|
-
clientVersion:
|
|
1557
|
-
isInternal:
|
|
1593
|
+
timeZone: z32.string().max(64).optional(),
|
|
1594
|
+
referrer: z32.string().max(2048).optional(),
|
|
1595
|
+
clientVersion: z32.string().max(100).optional(),
|
|
1596
|
+
isInternal: z32.boolean().optional()
|
|
1558
1597
|
});
|
|
1559
|
-
var SessionDetailSchema =
|
|
1598
|
+
var SessionDetailSchema = z32.object({
|
|
1560
1599
|
session: SessionSummarySchema,
|
|
1561
1600
|
capture: SessionCaptureSchema,
|
|
1562
1601
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
1563
1602
|
* re-judged after a fix is the evidence the fix worked. */
|
|
1564
|
-
reviews:
|
|
1565
|
-
bugs:
|
|
1566
|
-
comments:
|
|
1603
|
+
reviews: z32.array(SessionReviewEventSchema),
|
|
1604
|
+
bugs: z32.array(SessionBugSchema),
|
|
1605
|
+
comments: z32.array(SessionCommentSchema),
|
|
1567
1606
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
1568
1607
|
* not evidence of zero visitor activity. */
|
|
1569
1608
|
activity: SessionActivitySchema.optional()
|
|
1570
1609
|
});
|
|
1571
|
-
var RecordVerdictInputSchema =
|
|
1610
|
+
var RecordVerdictInputSchema = z32.object({
|
|
1572
1611
|
verdict: RecordableVerdictSchema,
|
|
1573
|
-
note:
|
|
1612
|
+
note: z32.string().max(2e3).optional()
|
|
1574
1613
|
});
|
|
1575
|
-
var FileBugInputSchema =
|
|
1576
|
-
turnIndex:
|
|
1614
|
+
var FileBugInputSchema = z32.object({
|
|
1615
|
+
turnIndex: z32.number().int().positive().nullable(),
|
|
1577
1616
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
1578
1617
|
location: BugLocationSchema.nullable().optional(),
|
|
1579
|
-
title:
|
|
1580
|
-
body:
|
|
1618
|
+
title: z32.string().min(1).max(300),
|
|
1619
|
+
body: z32.string().min(1),
|
|
1581
1620
|
severity: BugSeveritySchema,
|
|
1582
|
-
payload:
|
|
1621
|
+
payload: z32.record(z32.unknown())
|
|
1583
1622
|
});
|
|
1584
1623
|
export {
|
|
1585
1624
|
EMPTY_SPEC,
|
|
1586
1625
|
PackageReleaseSchema,
|
|
1587
1626
|
applySinglePatch,
|
|
1627
|
+
carriesShapeToken,
|
|
1588
1628
|
catalogToWire
|
|
1589
1629
|
};
|