@40rty/ams-cli 0.3.2 → 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 +9 -10
- package/bin/commands/dev.mjs +10 -11
- package/bin/commands/doctor.mjs +4 -5
- package/bin/commands/hosting.mjs +1 -1
- package/bin/lib/agentic.mjs +1 -1
- package/bin/lib/build-copy.mjs +6 -81
- package/bin/lib/build.mjs +47 -19
- package/bin/lib/hosted-build.mjs +7 -9
- package/dist/wire.js +433 -405
- package/package.json +1 -1
- package/templates/package/src/blocks.tsx +3 -3
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,17 @@ 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";
|
|
529
550
|
|
|
530
551
|
// ../spacestation/src/catalog/shape-tokens.ts
|
|
531
552
|
var SHAPE_TOKEN = /<(?![/!])[^<>=]*\s[^<>=]*(?<!\/)>/;
|
|
@@ -635,47 +656,47 @@ function readAtPath(doc, path) {
|
|
|
635
656
|
}
|
|
636
657
|
|
|
637
658
|
// ../spacestation/src/catalog/wire/wire-schema.ts
|
|
638
|
-
import { z as
|
|
659
|
+
import { z as z18 } from "zod";
|
|
639
660
|
var common = {
|
|
640
|
-
description:
|
|
641
|
-
resolved:
|
|
642
|
-
resolverKey:
|
|
643
|
-
min:
|
|
644
|
-
max:
|
|
645
|
-
renderFloor:
|
|
646
|
-
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()
|
|
647
668
|
}).strict().optional(),
|
|
648
|
-
prose:
|
|
669
|
+
prose: z18.literal(true).optional()
|
|
649
670
|
};
|
|
650
|
-
var WireSchemaSchema =
|
|
651
|
-
() =>
|
|
652
|
-
|
|
653
|
-
|
|
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({
|
|
654
675
|
...common,
|
|
655
|
-
t:
|
|
656
|
-
int:
|
|
657
|
-
min:
|
|
658
|
-
minExclusive:
|
|
659
|
-
max:
|
|
660
|
-
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()
|
|
661
682
|
}).strict(),
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
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()
|
|
674
695
|
])
|
|
675
696
|
);
|
|
676
697
|
|
|
677
698
|
// ../spacestation/src/catalog/wire/schema-to-wire.ts
|
|
678
|
-
import { z as
|
|
699
|
+
import { z as z19 } from "zod";
|
|
679
700
|
var UnsupportedSchemaError = class extends Error {
|
|
680
701
|
constructor(path, what) {
|
|
681
702
|
super(`Cannot publish the schema at ${path === "" ? "<root>" : path}: ${what}.`);
|
|
@@ -713,7 +734,7 @@ function arrayNode(schema, path) {
|
|
|
713
734
|
return node;
|
|
714
735
|
}
|
|
715
736
|
function objectNode(schema, path) {
|
|
716
|
-
if (!(schema._def.catchall instanceof
|
|
737
|
+
if (!(schema._def.catchall instanceof z19.ZodNever)) throw new UnsupportedSchemaError(path, "object .catchall() is not supported");
|
|
717
738
|
const shape = {};
|
|
718
739
|
for (const [key, child] of Object.entries(schema.shape)) shape[key] = toNode(child, path === "" ? key : `${path}.${key}`);
|
|
719
740
|
return { t: "object", shape, unknownKeys: schema._def.unknownKeys };
|
|
@@ -724,19 +745,19 @@ function literalNode(schema, path) {
|
|
|
724
745
|
throw new UnsupportedSchemaError(path, "only string, number and boolean literals are supported");
|
|
725
746
|
}
|
|
726
747
|
function bare(schema, path) {
|
|
727
|
-
if (schema instanceof
|
|
728
|
-
if (schema instanceof
|
|
729
|
-
if (schema instanceof
|
|
730
|
-
if (schema instanceof
|
|
731
|
-
if (schema instanceof
|
|
732
|
-
if (schema instanceof
|
|
733
|
-
if (schema instanceof
|
|
734
|
-
if (schema instanceof
|
|
735
|
-
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) {
|
|
736
757
|
const options = schema.options;
|
|
737
758
|
return { t: "union", options: options.map((option, i) => toNode(option, `${path}|${i}`)) };
|
|
738
759
|
}
|
|
739
|
-
if (schema instanceof
|
|
760
|
+
if (schema instanceof z19.ZodDiscriminatedUnion) {
|
|
740
761
|
const options = schema.options;
|
|
741
762
|
return {
|
|
742
763
|
t: "discriminatedUnion",
|
|
@@ -744,13 +765,13 @@ function bare(schema, path) {
|
|
|
744
765
|
options: options.map((option, i) => toNode(option, `${path}|${i}`))
|
|
745
766
|
};
|
|
746
767
|
}
|
|
747
|
-
if (schema instanceof
|
|
748
|
-
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");
|
|
749
770
|
return { t: "record", value: toNode(schema.valueSchema, `${path}{}`) };
|
|
750
771
|
}
|
|
751
|
-
if (schema instanceof
|
|
752
|
-
if (schema instanceof
|
|
753
|
-
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) {
|
|
754
775
|
return { t: "default", inner: toNode(schema._def.innerType, path), value: schema._def.defaultValue() };
|
|
755
776
|
}
|
|
756
777
|
throw new UnsupportedSchemaError(path, `${schema.constructor.name} is not supported`);
|
|
@@ -768,40 +789,40 @@ function schemaToWire(schema) {
|
|
|
768
789
|
}
|
|
769
790
|
|
|
770
791
|
// ../spacestation/src/catalog/wire/schema-from-wire.ts
|
|
771
|
-
import { z as
|
|
792
|
+
import { z as z20 } from "zod";
|
|
772
793
|
|
|
773
794
|
// ../spacestation/src/catalog/wire/catalog-wire.ts
|
|
774
|
-
import { z as
|
|
775
|
-
var WireCatalogEntrySchema =
|
|
776
|
-
type:
|
|
795
|
+
import { z as z21 } from "zod";
|
|
796
|
+
var WireCatalogEntrySchema = z21.object({
|
|
797
|
+
type: z21.string().min(1),
|
|
777
798
|
propsSchema: WireSchemaSchema.optional(),
|
|
778
|
-
examples:
|
|
779
|
-
renderedBy:
|
|
780
|
-
alwaysInclude:
|
|
781
|
-
whenToUse:
|
|
782
|
-
dontUseWhen:
|
|
783
|
-
variants:
|
|
784
|
-
dependencies:
|
|
785
|
-
layout:
|
|
786
|
-
size:
|
|
787
|
-
extendsPage:
|
|
788
|
-
bindings:
|
|
789
|
-
|
|
790
|
-
source:
|
|
791
|
-
prop:
|
|
792
|
-
accumulate:
|
|
793
|
-
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()
|
|
794
815
|
})
|
|
795
816
|
).optional(),
|
|
796
|
-
defaultLayoutWeight:
|
|
797
|
-
defaultMaxHeight:
|
|
798
|
-
category:
|
|
799
|
-
progressLabel:
|
|
800
|
-
isExperience:
|
|
801
|
-
requires:
|
|
802
|
-
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()
|
|
803
824
|
}).strict();
|
|
804
|
-
var WireCatalogSchema =
|
|
825
|
+
var WireCatalogSchema = z21.record(WireCatalogEntrySchema);
|
|
805
826
|
function propsToWire(type, schema) {
|
|
806
827
|
try {
|
|
807
828
|
return schemaToWire(schema);
|
|
@@ -819,95 +840,102 @@ function catalogToWire(catalog) {
|
|
|
819
840
|
}
|
|
820
841
|
|
|
821
842
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
822
|
-
import { z as
|
|
843
|
+
import { z as z22 } from "zod";
|
|
823
844
|
var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
|
|
824
|
-
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({
|
|
825
847
|
/** The id spaces name in `componentSources` — an npm-style package name. */
|
|
826
|
-
sourceId:
|
|
827
|
-
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),
|
|
828
850
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
829
|
-
version:
|
|
851
|
+
version: z22.string().min(1).max(40),
|
|
830
852
|
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
831
|
-
description:
|
|
853
|
+
description: z22.string().min(1).max(500).optional(),
|
|
832
854
|
catalog: WireCatalogSchema,
|
|
833
855
|
/** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
|
|
834
|
-
manifests:
|
|
856
|
+
manifests: z22.record(z22.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z22.string()),
|
|
835
857
|
/**
|
|
836
858
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
837
859
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
838
860
|
* ES module (exporting `renderers`, and optionally `shells`) and its
|
|
839
|
-
* 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.
|
|
840
864
|
*/
|
|
841
|
-
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(),
|
|
842
870
|
/**
|
|
843
871
|
* The class the spacefront root carries while this package is the space's.
|
|
844
872
|
* The package's own stylesheet styles under it. Absent = the platform's
|
|
845
873
|
* default theme class.
|
|
846
874
|
*/
|
|
847
|
-
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(),
|
|
848
876
|
/** The canvas a fresh session opens on, before the visitor has asked anything. */
|
|
849
877
|
seedLayout: SpecSchema.optional(),
|
|
850
878
|
/**
|
|
851
879
|
* The package's own composition guidance for its own components — prompt
|
|
852
880
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
853
881
|
*/
|
|
854
|
-
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(),
|
|
855
883
|
/**
|
|
856
884
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
857
885
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
858
886
|
*/
|
|
859
|
-
config:
|
|
887
|
+
config: z22.record(z22.string(), z22.unknown()).optional(),
|
|
860
888
|
/**
|
|
861
889
|
* Set by the platform, never by a publisher: this release is a DRAFT of the
|
|
862
890
|
* package `of`, previewed on the space `space`. See `draftSourceId`.
|
|
863
891
|
*/
|
|
864
|
-
draft:
|
|
892
|
+
draft: z22.object({ of: z22.string().min(1), space: z22.string().min(1) }).strict().optional()
|
|
865
893
|
}).strict();
|
|
866
894
|
|
|
867
895
|
// ../spacestation/src/projection/projection.ts
|
|
868
|
-
import { z as
|
|
869
|
-
var LateBoundValueSchema =
|
|
870
|
-
var DirectiveValueSchema =
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
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(),
|
|
874
902
|
LateBoundValueSchema
|
|
875
903
|
]);
|
|
876
|
-
var ProjectionDirectiveSchema =
|
|
904
|
+
var ProjectionDirectiveSchema = z23.object({
|
|
877
905
|
/** Keep only items whose axis values all match. Keyed by axis name
|
|
878
906
|
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
879
|
-
isolateTo:
|
|
907
|
+
isolateTo: z23.record(DirectiveValueSchema).optional(),
|
|
880
908
|
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
881
909
|
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
882
910
|
* entity binding expands it against the entity's own axes + facts. */
|
|
883
|
-
isolateToFacts:
|
|
911
|
+
isolateToFacts: z23.boolean().optional(),
|
|
884
912
|
/** Keep only items the entity binding reports as available. */
|
|
885
|
-
availableOnly:
|
|
913
|
+
availableOnly: z23.boolean().optional(),
|
|
886
914
|
/** Cap the rendered count after filtering. */
|
|
887
|
-
limit:
|
|
915
|
+
limit: z23.number().int().positive().optional()
|
|
888
916
|
});
|
|
889
|
-
var ProjectionPreferencesSchema =
|
|
890
|
-
|
|
917
|
+
var ProjectionPreferencesSchema = z23.record(
|
|
918
|
+
z23.union([ProjectionDirectiveSchema, z23.null()])
|
|
891
919
|
);
|
|
892
|
-
var ProjectionSetPayloadSchema =
|
|
893
|
-
setAll:
|
|
920
|
+
var ProjectionSetPayloadSchema = z23.object({
|
|
921
|
+
setAll: z23.union([ProjectionDirectiveSchema, z23.null()]).optional(),
|
|
894
922
|
set: ProjectionPreferencesSchema.optional()
|
|
895
923
|
});
|
|
896
924
|
|
|
897
925
|
// ../spacestation/src/focus/focus.ts
|
|
898
|
-
import { z as
|
|
899
|
-
var FocusElementPayloadSchema =
|
|
900
|
-
elementId:
|
|
926
|
+
import { z as z24 } from "zod";
|
|
927
|
+
var FocusElementPayloadSchema = z24.object({
|
|
928
|
+
elementId: z24.string().min(1)
|
|
901
929
|
});
|
|
902
930
|
|
|
903
931
|
// ../spacestation/src/view/continuation.ts
|
|
904
|
-
import { z as
|
|
905
|
-
var ViewExtendPayloadSchema =
|
|
906
|
-
reason:
|
|
932
|
+
import { z as z25 } from "zod";
|
|
933
|
+
var ViewExtendPayloadSchema = z25.object({
|
|
934
|
+
reason: z25.enum(["scroll_near_bottom"])
|
|
907
935
|
});
|
|
908
936
|
|
|
909
937
|
// ../spacestation/src/attachment/attachment.ts
|
|
910
|
-
import { z as
|
|
938
|
+
import { z as z26 } from "zod";
|
|
911
939
|
var ALLOWED_ATTACHMENT_TYPES = [
|
|
912
940
|
"image/jpeg",
|
|
913
941
|
"image/png",
|
|
@@ -919,34 +947,34 @@ var MAX_ATTACHMENT_BYTES = 10 * 1024 * 1024;
|
|
|
919
947
|
function isAllowedAttachmentType(mime) {
|
|
920
948
|
return ALLOWED_ATTACHMENT_TYPES.includes(mime);
|
|
921
949
|
}
|
|
922
|
-
var AttachmentRefSchema =
|
|
923
|
-
id:
|
|
924
|
-
mimeType:
|
|
950
|
+
var AttachmentRefSchema = z26.object({
|
|
951
|
+
id: z26.string().min(1),
|
|
952
|
+
mimeType: z26.string().refine(isAllowedAttachmentType, {
|
|
925
953
|
message: "mimeType not on the attachment allow-list"
|
|
926
954
|
}),
|
|
927
|
-
name:
|
|
928
|
-
size:
|
|
929
|
-
url:
|
|
955
|
+
name: z26.string().min(1),
|
|
956
|
+
size: z26.number().int().positive().max(MAX_ATTACHMENT_BYTES),
|
|
957
|
+
url: z26.string().min(1)
|
|
930
958
|
});
|
|
931
|
-
var AttachmentRefsSchema =
|
|
959
|
+
var AttachmentRefsSchema = z26.array(AttachmentRefSchema);
|
|
932
960
|
|
|
933
961
|
// ../spacestation/src/contracts/entry-context.ts
|
|
934
|
-
import { z as
|
|
962
|
+
import { z as z27 } from "zod";
|
|
935
963
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
936
964
|
var ENTRY_CONTEXT_MAX_KEYS = 12;
|
|
937
965
|
var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
|
|
938
966
|
var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
|
|
939
|
-
var EntryContextValueSchema =
|
|
940
|
-
var EntryContextNameSchema =
|
|
941
|
-
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, {
|
|
942
970
|
message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
|
|
943
971
|
});
|
|
944
|
-
var EntryContextSchema =
|
|
972
|
+
var EntryContextSchema = z27.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
|
|
945
973
|
message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
|
|
946
974
|
});
|
|
947
975
|
|
|
948
976
|
// ../spacestation/src/contracts/session-arrival.ts
|
|
949
|
-
import { z as
|
|
977
|
+
import { z as z28 } from "zod";
|
|
950
978
|
var SURFACES = [
|
|
951
979
|
"spacefront",
|
|
952
980
|
"embed",
|
|
@@ -956,11 +984,11 @@ var SURFACES = [
|
|
|
956
984
|
"playground",
|
|
957
985
|
"automation"
|
|
958
986
|
];
|
|
959
|
-
var SurfaceSchema =
|
|
987
|
+
var SurfaceSchema = z28.enum(SURFACES);
|
|
960
988
|
var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
|
|
961
|
-
var ClickIdKindSchema =
|
|
989
|
+
var ClickIdKindSchema = z28.enum(CLICK_ID_KINDS);
|
|
962
990
|
var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
|
|
963
|
-
var VisitorIdDurabilitySchema =
|
|
991
|
+
var VisitorIdDurabilitySchema = z28.enum(VISITOR_ID_DURABILITIES);
|
|
964
992
|
var TRAFFIC_BUCKETS = [
|
|
965
993
|
"paid_google",
|
|
966
994
|
"paid_meta",
|
|
@@ -972,10 +1000,10 @@ var TRAFFIC_BUCKETS = [
|
|
|
972
1000
|
"direct",
|
|
973
1001
|
"unknown"
|
|
974
1002
|
];
|
|
975
|
-
var TrafficBucketSchema =
|
|
1003
|
+
var TrafficBucketSchema = z28.enum(TRAFFIC_BUCKETS);
|
|
976
1004
|
var ARRIVAL_MAX_VALUE_CHARS = 200;
|
|
977
|
-
var ArrivalValueSchema =
|
|
978
|
-
var SessionArrivalSchema =
|
|
1005
|
+
var ArrivalValueSchema = z28.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
|
|
1006
|
+
var SessionArrivalSchema = z28.object({
|
|
979
1007
|
utmSource: ArrivalValueSchema.optional(),
|
|
980
1008
|
utmMedium: ArrivalValueSchema.optional(),
|
|
981
1009
|
utmCampaign: ArrivalValueSchema.optional(),
|
|
@@ -1009,36 +1037,36 @@ var ARRIVAL_PARAMS = [
|
|
|
1009
1037
|
];
|
|
1010
1038
|
|
|
1011
1039
|
// ../spacestation/src/catalog/attribute-registry.ts
|
|
1012
|
-
import { z as
|
|
1013
|
-
var AttributeScopeBucketSchema =
|
|
1014
|
-
scope:
|
|
1015
|
-
needles:
|
|
1016
|
-
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()
|
|
1017
1045
|
});
|
|
1018
|
-
var AttributeScopeConfigSchema =
|
|
1019
|
-
facet:
|
|
1020
|
-
buckets:
|
|
1021
|
-
emptyScope:
|
|
1022
|
-
noMatchScope:
|
|
1023
|
-
ignoreValues:
|
|
1024
|
-
emptyScopeLabel:
|
|
1025
|
-
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()
|
|
1026
1054
|
});
|
|
1027
|
-
var AttributeDefBaseSchema =
|
|
1028
|
-
description:
|
|
1029
|
-
durable:
|
|
1030
|
-
label:
|
|
1055
|
+
var AttributeDefBaseSchema = z29.object({
|
|
1056
|
+
description: z29.string().optional(),
|
|
1057
|
+
durable: z29.boolean().optional(),
|
|
1058
|
+
label: z29.string().optional()
|
|
1031
1059
|
});
|
|
1032
|
-
var AttributeDefSchema =
|
|
1033
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1034
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1035
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
1036
|
-
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") }),
|
|
1037
1065
|
AttributeDefBaseSchema.extend({
|
|
1038
|
-
kind:
|
|
1039
|
-
min:
|
|
1040
|
-
max:
|
|
1041
|
-
unit:
|
|
1066
|
+
kind: z29.literal("number"),
|
|
1067
|
+
min: z29.number().optional(),
|
|
1068
|
+
max: z29.number().optional(),
|
|
1069
|
+
unit: z29.string().optional()
|
|
1042
1070
|
})
|
|
1043
1071
|
]);
|
|
1044
1072
|
|
|
@@ -1070,30 +1098,30 @@ var DEFAULT_SPACE_CONFIG = {
|
|
|
1070
1098
|
};
|
|
1071
1099
|
|
|
1072
1100
|
// ../spacestation/src/space/trace.ts
|
|
1073
|
-
import { z as
|
|
1074
|
-
var RunTokenUsageSchema =
|
|
1075
|
-
input_tokens:
|
|
1076
|
-
output_tokens:
|
|
1077
|
-
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()
|
|
1078
1106
|
});
|
|
1079
|
-
var TraceRecordSchema =
|
|
1080
|
-
id:
|
|
1081
|
-
spaceId:
|
|
1082
|
-
sessionId:
|
|
1107
|
+
var TraceRecordSchema = z30.object({
|
|
1108
|
+
id: z30.string().uuid(),
|
|
1109
|
+
spaceId: z30.string().uuid().nullable(),
|
|
1110
|
+
sessionId: z30.string(),
|
|
1083
1111
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
1084
1112
|
* for an unlocked space / anonymous unlock. */
|
|
1085
|
-
visitorEmail:
|
|
1086
|
-
userPrompt:
|
|
1087
|
-
branch:
|
|
1088
|
-
responseText:
|
|
1089
|
-
layout:
|
|
1090
|
-
phaseTimings:
|
|
1091
|
-
tokensByModel:
|
|
1092
|
-
toolCalls:
|
|
1093
|
-
diagnostics:
|
|
1094
|
-
latencyFirstText:
|
|
1095
|
-
latencyFirstPatch:
|
|
1096
|
-
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(),
|
|
1097
1125
|
/**
|
|
1098
1126
|
* The CLIENT's turn id for this run, or `null`.
|
|
1099
1127
|
*
|
|
@@ -1109,29 +1137,29 @@ var TraceRecordSchema = z29.object({
|
|
|
1109
1137
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1110
1138
|
* visitor asked something and got nothing.
|
|
1111
1139
|
*/
|
|
1112
|
-
turnId:
|
|
1140
|
+
turnId: z30.string().nullable(),
|
|
1113
1141
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
1114
1142
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
1115
|
-
trackerState:
|
|
1116
|
-
createdAt:
|
|
1143
|
+
trackerState: z30.unknown().nullable(),
|
|
1144
|
+
createdAt: z30.string()
|
|
1117
1145
|
});
|
|
1118
|
-
var MillisecondsSchema =
|
|
1119
|
-
var CreateTraceInputSchema =
|
|
1120
|
-
spaceId:
|
|
1121
|
-
sessionId:
|
|
1122
|
-
visitorEmail:
|
|
1123
|
-
userPrompt:
|
|
1124
|
-
branch:
|
|
1125
|
-
responseText:
|
|
1126
|
-
layout:
|
|
1127
|
-
phaseTimings:
|
|
1128
|
-
tokensByModel:
|
|
1129
|
-
toolCalls:
|
|
1130
|
-
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(),
|
|
1131
1159
|
latencyFirstText: MillisecondsSchema,
|
|
1132
1160
|
latencyFirstPatch: MillisecondsSchema,
|
|
1133
1161
|
latencyTotal: MillisecondsSchema,
|
|
1134
|
-
trackerState:
|
|
1162
|
+
trackerState: z30.unknown().nullable(),
|
|
1135
1163
|
/**
|
|
1136
1164
|
* The CLIENT's turn id for this run, or `null`.
|
|
1137
1165
|
*
|
|
@@ -1147,37 +1175,37 @@ var CreateTraceInputSchema = z29.object({
|
|
|
1147
1175
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1148
1176
|
* visitor asked something and got nothing.
|
|
1149
1177
|
*/
|
|
1150
|
-
turnId:
|
|
1178
|
+
turnId: z30.string().nullable()
|
|
1151
1179
|
});
|
|
1152
|
-
var AgentSessionSummarySchema =
|
|
1153
|
-
sessionId:
|
|
1180
|
+
var AgentSessionSummarySchema = z30.object({
|
|
1181
|
+
sessionId: z30.string(),
|
|
1154
1182
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
1155
|
-
turnCount:
|
|
1183
|
+
turnCount: z30.number().int(),
|
|
1156
1184
|
/** The session's opening prompt — titles the row in the UI. */
|
|
1157
|
-
firstPrompt:
|
|
1158
|
-
startedAt:
|
|
1159
|
-
lastRunAt:
|
|
1185
|
+
firstPrompt: z30.string(),
|
|
1186
|
+
startedAt: z30.string(),
|
|
1187
|
+
lastRunAt: z30.string(),
|
|
1160
1188
|
/** Summed `latency_total` across the session's turns. */
|
|
1161
|
-
totalLatencyMs:
|
|
1189
|
+
totalLatencyMs: z30.number().int()
|
|
1162
1190
|
});
|
|
1163
|
-
var SessionTurnSchema =
|
|
1164
|
-
id:
|
|
1165
|
-
userPrompt:
|
|
1166
|
-
responseText:
|
|
1191
|
+
var SessionTurnSchema = z30.object({
|
|
1192
|
+
id: z30.string().uuid(),
|
|
1193
|
+
userPrompt: z30.string(),
|
|
1194
|
+
responseText: z30.string().nullable(),
|
|
1167
1195
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
1168
|
-
layout:
|
|
1169
|
-
createdAt:
|
|
1170
|
-
latencyTotal:
|
|
1171
|
-
phaseTimings:
|
|
1172
|
-
tokensByModel:
|
|
1173
|
-
input_tokens:
|
|
1174
|
-
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()
|
|
1175
1203
|
})).nullable(),
|
|
1176
|
-
toolCalls:
|
|
1177
|
-
diagnostics:
|
|
1204
|
+
toolCalls: z30.array(z30.unknown()).nullable(),
|
|
1205
|
+
diagnostics: z30.array(z30.unknown()).nullable()
|
|
1178
1206
|
});
|
|
1179
|
-
var SessionReplaySchema =
|
|
1180
|
-
turns:
|
|
1207
|
+
var SessionReplaySchema = z30.object({
|
|
1208
|
+
turns: z30.array(SessionTurnSchema),
|
|
1181
1209
|
/**
|
|
1182
1210
|
* The session's own last-committed layout, read straight off the durable
|
|
1183
1211
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -1188,20 +1216,20 @@ var SessionReplaySchema = z29.object({
|
|
|
1188
1216
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
1189
1217
|
* when the durable session row itself could not be read.
|
|
1190
1218
|
*/
|
|
1191
|
-
sessionLayout:
|
|
1219
|
+
sessionLayout: z30.record(z30.string(), z30.unknown()).nullable()
|
|
1192
1220
|
});
|
|
1193
|
-
var SessionTraceSchema =
|
|
1194
|
-
trackerState:
|
|
1221
|
+
var SessionTraceSchema = z30.object({
|
|
1222
|
+
trackerState: z30.string().nullable()
|
|
1195
1223
|
});
|
|
1196
|
-
var LlmUsageDailySchema =
|
|
1197
|
-
day:
|
|
1224
|
+
var LlmUsageDailySchema = z30.object({
|
|
1225
|
+
day: z30.string(),
|
|
1198
1226
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
1199
|
-
environment:
|
|
1200
|
-
feature:
|
|
1201
|
-
model:
|
|
1202
|
-
provider:
|
|
1227
|
+
environment: z30.string(),
|
|
1228
|
+
feature: z30.string(),
|
|
1229
|
+
model: z30.string(),
|
|
1230
|
+
provider: z30.string(),
|
|
1203
1231
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
1204
|
-
keyFingerprint:
|
|
1232
|
+
keyFingerprint: z30.string().nullable(),
|
|
1205
1233
|
/**
|
|
1206
1234
|
* The space the call served, or null when it served none.
|
|
1207
1235
|
*
|
|
@@ -1210,91 +1238,91 @@ var LlmUsageDailySchema = z29.object({
|
|
|
1210
1238
|
* report that share rather than dropping it, or a per-space total reads as
|
|
1211
1239
|
* the platform total.
|
|
1212
1240
|
*/
|
|
1213
|
-
spaceId:
|
|
1241
|
+
spaceId: z30.string().nullable(),
|
|
1214
1242
|
/**
|
|
1215
1243
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
1216
1244
|
* when it served no session or the session predates surface recording.
|
|
1217
1245
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
1218
1246
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
1219
1247
|
*/
|
|
1220
|
-
surface:
|
|
1221
|
-
inputTokens:
|
|
1222
|
-
outputTokens:
|
|
1248
|
+
surface: z30.string().nullable(),
|
|
1249
|
+
inputTokens: z30.number(),
|
|
1250
|
+
outputTokens: z30.number(),
|
|
1223
1251
|
/** Subset of inputTokens, never additional to it. */
|
|
1224
|
-
cachedInputTokens:
|
|
1225
|
-
reasoningTokens:
|
|
1226
|
-
callCount:
|
|
1227
|
-
errorCount:
|
|
1228
|
-
estimatedCostUsd:
|
|
1252
|
+
cachedInputTokens: z30.number(),
|
|
1253
|
+
reasoningTokens: z30.number(),
|
|
1254
|
+
callCount: z30.number(),
|
|
1255
|
+
errorCount: z30.number(),
|
|
1256
|
+
estimatedCostUsd: z30.number().nullable()
|
|
1229
1257
|
});
|
|
1230
|
-
var LlmUsageBySessionSchema =
|
|
1231
|
-
sessionId:
|
|
1232
|
-
environment:
|
|
1233
|
-
model:
|
|
1258
|
+
var LlmUsageBySessionSchema = z30.object({
|
|
1259
|
+
sessionId: z30.string(),
|
|
1260
|
+
environment: z30.string(),
|
|
1261
|
+
model: z30.string(),
|
|
1234
1262
|
/** The space this session belongs to, or null for a session with no space. */
|
|
1235
|
-
spaceId:
|
|
1263
|
+
spaceId: z30.string().nullable(),
|
|
1236
1264
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
1237
|
-
surface:
|
|
1265
|
+
surface: z30.string().nullable(),
|
|
1238
1266
|
/** Label only — the first feature seen in the session. */
|
|
1239
|
-
firstFeature:
|
|
1240
|
-
startedAt:
|
|
1241
|
-
endedAt:
|
|
1242
|
-
inputTokens:
|
|
1243
|
-
outputTokens:
|
|
1244
|
-
cachedInputTokens:
|
|
1245
|
-
reasoningTokens:
|
|
1246
|
-
callCount:
|
|
1247
|
-
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(),
|
|
1248
1276
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
1249
1277
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
1250
1278
|
* the model is unpriced; never 0, which would read as free. */
|
|
1251
|
-
estimatedCostUsd:
|
|
1279
|
+
estimatedCostUsd: z30.number().nullable()
|
|
1252
1280
|
});
|
|
1253
|
-
var LlmSessionsDailySchema =
|
|
1254
|
-
day:
|
|
1255
|
-
environment:
|
|
1256
|
-
sessionCount:
|
|
1281
|
+
var LlmSessionsDailySchema = z30.object({
|
|
1282
|
+
day: z30.string(),
|
|
1283
|
+
environment: z30.string(),
|
|
1284
|
+
sessionCount: z30.number()
|
|
1257
1285
|
});
|
|
1258
1286
|
|
|
1259
1287
|
// ../spacestation/src/space/session-queue.ts
|
|
1260
|
-
import { z as
|
|
1288
|
+
import { z as z32 } from "zod";
|
|
1261
1289
|
|
|
1262
1290
|
// ../spacestation/src/space/session-activity.ts
|
|
1263
|
-
import { z as
|
|
1264
|
-
var SessionActivityEventSchema =
|
|
1265
|
-
id:
|
|
1266
|
-
kind:
|
|
1267
|
-
occurredAt:
|
|
1268
|
-
source:
|
|
1269
|
-
surface:
|
|
1270
|
-
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())
|
|
1271
1299
|
});
|
|
1272
|
-
var SessionActivitySchema =
|
|
1273
|
-
events:
|
|
1274
|
-
hasMore:
|
|
1300
|
+
var SessionActivitySchema = z31.object({
|
|
1301
|
+
events: z31.array(SessionActivityEventSchema),
|
|
1302
|
+
hasMore: z31.boolean()
|
|
1275
1303
|
});
|
|
1276
1304
|
|
|
1277
1305
|
// ../spacestation/src/space/session-queue.ts
|
|
1278
|
-
var SessionVerdictSchema =
|
|
1279
|
-
var RecordableVerdictSchema =
|
|
1280
|
-
var SessionReviewEventSchema =
|
|
1281
|
-
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(),
|
|
1282
1310
|
verdict: RecordableVerdictSchema,
|
|
1283
1311
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
1284
1312
|
* log is append-only rather than a mutable current-state row. */
|
|
1285
|
-
reviewer:
|
|
1286
|
-
note:
|
|
1287
|
-
createdAt:
|
|
1313
|
+
reviewer: z32.string(),
|
|
1314
|
+
note: z32.string().nullable(),
|
|
1315
|
+
createdAt: z32.string()
|
|
1288
1316
|
});
|
|
1289
|
-
var BugSeveritySchema =
|
|
1290
|
-
var BugLocationSchema =
|
|
1291
|
-
elementId:
|
|
1317
|
+
var BugSeveritySchema = z32.enum(["high", "medium", "low"]);
|
|
1318
|
+
var BugLocationSchema = z32.object({
|
|
1319
|
+
elementId: z32.string().nullable(),
|
|
1292
1320
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
1293
1321
|
* alongside a null `elementId`. */
|
|
1294
|
-
elementType:
|
|
1322
|
+
elementType: z32.string().nullable(),
|
|
1295
1323
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
1296
|
-
offsetXPct:
|
|
1297
|
-
offsetYPct:
|
|
1324
|
+
offsetXPct: z32.number().min(0).max(100).nullable(),
|
|
1325
|
+
offsetYPct: z32.number().min(0).max(100).nullable(),
|
|
1298
1326
|
/**
|
|
1299
1327
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
1300
1328
|
* element anchor.
|
|
@@ -1305,8 +1333,8 @@ var BugLocationSchema = z31.object({
|
|
|
1305
1333
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
1306
1334
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
1307
1335
|
*/
|
|
1308
|
-
pageX:
|
|
1309
|
-
pageY:
|
|
1336
|
+
pageX: z32.number().nullable(),
|
|
1337
|
+
pageY: z32.number().nullable()
|
|
1310
1338
|
}).refine(
|
|
1311
1339
|
(loc) => {
|
|
1312
1340
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -1320,24 +1348,24 @@ var BugLocationSchema = z31.object({
|
|
|
1320
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)"
|
|
1321
1349
|
}
|
|
1322
1350
|
);
|
|
1323
|
-
var SessionBugSchema =
|
|
1324
|
-
id:
|
|
1351
|
+
var SessionBugSchema = z32.object({
|
|
1352
|
+
id: z32.string().uuid(),
|
|
1325
1353
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
1326
|
-
turnIndex:
|
|
1354
|
+
turnIndex: z32.number().int().nullable(),
|
|
1327
1355
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
1328
1356
|
* without pinning a spot. */
|
|
1329
1357
|
location: BugLocationSchema.nullable(),
|
|
1330
|
-
provider:
|
|
1331
|
-
issueKey:
|
|
1332
|
-
issueUrl:
|
|
1358
|
+
provider: z32.string(),
|
|
1359
|
+
issueKey: z32.string().nullable(),
|
|
1360
|
+
issueUrl: z32.string().nullable(),
|
|
1333
1361
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
1334
1362
|
* open text. Null until first synced. */
|
|
1335
|
-
issueState:
|
|
1336
|
-
title:
|
|
1337
|
-
body:
|
|
1363
|
+
issueState: z32.string().nullable(),
|
|
1364
|
+
title: z32.string(),
|
|
1365
|
+
body: z32.string(),
|
|
1338
1366
|
severity: BugSeveritySchema,
|
|
1339
|
-
createdBy:
|
|
1340
|
-
createdAt:
|
|
1367
|
+
createdBy: z32.string(),
|
|
1368
|
+
createdAt: z32.string(),
|
|
1341
1369
|
/**
|
|
1342
1370
|
* When this bug was resolved from the console; null means still OPEN.
|
|
1343
1371
|
*
|
|
@@ -1346,55 +1374,55 @@ var SessionBugSchema = z31.object({
|
|
|
1346
1374
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
1347
1375
|
* no boolean can contradict it.
|
|
1348
1376
|
*/
|
|
1349
|
-
resolvedAt:
|
|
1350
|
-
resolvedBy:
|
|
1377
|
+
resolvedAt: z32.string().nullable(),
|
|
1378
|
+
resolvedBy: z32.string().nullable()
|
|
1351
1379
|
});
|
|
1352
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
1353
|
-
var SessionCommentSchema =
|
|
1354
|
-
id:
|
|
1380
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z32.string() });
|
|
1381
|
+
var SessionCommentSchema = z32.object({
|
|
1382
|
+
id: z32.string().uuid(),
|
|
1355
1383
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
1356
|
-
bugId:
|
|
1384
|
+
bugId: z32.string().uuid().nullable(),
|
|
1357
1385
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
1358
1386
|
* parent bug's turn). */
|
|
1359
|
-
turnIndex:
|
|
1387
|
+
turnIndex: z32.number().int().nullable(),
|
|
1360
1388
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
1361
1389
|
location: BugLocationSchema.nullable(),
|
|
1362
|
-
body:
|
|
1363
|
-
createdBy:
|
|
1364
|
-
createdAt:
|
|
1390
|
+
body: z32.string(),
|
|
1391
|
+
createdBy: z32.string(),
|
|
1392
|
+
createdAt: z32.string()
|
|
1365
1393
|
});
|
|
1366
|
-
var CreateCommentInputSchema =
|
|
1367
|
-
bugId:
|
|
1368
|
-
turnIndex:
|
|
1394
|
+
var CreateCommentInputSchema = z32.object({
|
|
1395
|
+
bugId: z32.string().uuid().nullable(),
|
|
1396
|
+
turnIndex: z32.number().int().positive().nullable(),
|
|
1369
1397
|
location: BugLocationSchema.nullable(),
|
|
1370
1398
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
1371
1399
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
1372
|
-
body:
|
|
1400
|
+
body: z32.string().trim().min(1)
|
|
1373
1401
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
1374
1402
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
1375
1403
|
});
|
|
1376
|
-
var UpdateCommentInputSchema =
|
|
1377
|
-
body:
|
|
1378
|
-
bugId:
|
|
1404
|
+
var UpdateCommentInputSchema = z32.object({
|
|
1405
|
+
body: z32.string().trim().min(1).optional(),
|
|
1406
|
+
bugId: z32.string().uuid().nullable().optional(),
|
|
1379
1407
|
location: BugLocationSchema.nullable().optional()
|
|
1380
1408
|
});
|
|
1381
|
-
var SessionFormFactorSchema =
|
|
1382
|
-
var SessionSummarySchema =
|
|
1383
|
-
sessionId:
|
|
1409
|
+
var SessionFormFactorSchema = z32.enum(["mobile", "desktop"]).nullable();
|
|
1410
|
+
var SessionSummarySchema = z32.object({
|
|
1411
|
+
sessionId: z32.string(),
|
|
1384
1412
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
1385
1413
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
1386
|
-
visitorId:
|
|
1414
|
+
visitorId: z32.string().nullable(),
|
|
1387
1415
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
1388
1416
|
* identified themselves. Both null together means "not identified yet". */
|
|
1389
|
-
identityProvider:
|
|
1390
|
-
identityKey:
|
|
1417
|
+
identityProvider: z32.string().nullable(),
|
|
1418
|
+
identityKey: z32.string().nullable(),
|
|
1391
1419
|
/** Team/test traffic. The queue hides these by default. */
|
|
1392
|
-
isInternal:
|
|
1420
|
+
isInternal: z32.boolean(),
|
|
1393
1421
|
/** Build that served the session. Null = not captured; a version filter must
|
|
1394
1422
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
1395
|
-
clientVersion:
|
|
1423
|
+
clientVersion: z32.string().nullable(),
|
|
1396
1424
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
1397
|
-
signalCounts:
|
|
1425
|
+
signalCounts: z32.record(z32.number()),
|
|
1398
1426
|
/**
|
|
1399
1427
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
1400
1428
|
*
|
|
@@ -1411,7 +1439,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1411
1439
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
1412
1440
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
1413
1441
|
*/
|
|
1414
|
-
conversionAttempts:
|
|
1442
|
+
conversionAttempts: z32.number().int().nullable(),
|
|
1415
1443
|
/**
|
|
1416
1444
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
1417
1445
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -1427,7 +1455,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1427
1455
|
* kinds together, and one attempt id appearing under both would be counted
|
|
1428
1456
|
* once there and twice here.
|
|
1429
1457
|
*/
|
|
1430
|
-
conversionKinds:
|
|
1458
|
+
conversionKinds: z32.record(z32.number()),
|
|
1431
1459
|
/**
|
|
1432
1460
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
1433
1461
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -1435,20 +1463,20 @@ var SessionSummarySchema = z31.object({
|
|
|
1435
1463
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
1436
1464
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
1437
1465
|
*/
|
|
1438
|
-
funnelSteps:
|
|
1466
|
+
funnelSteps: z32.array(z32.string()),
|
|
1439
1467
|
/**
|
|
1440
1468
|
* The connector's opaque handle for what this session produced in its back
|
|
1441
1469
|
* office — present only once a checkout actually reached the platform. The
|
|
1442
1470
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
1443
1471
|
*/
|
|
1444
|
-
backOfficeRef:
|
|
1472
|
+
backOfficeRef: z32.string().nullable(),
|
|
1445
1473
|
/**
|
|
1446
1474
|
* The order this session produced, when the connector's back office reported
|
|
1447
1475
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
1448
1476
|
* Both null when no order is known — the cart handle above is then the door.
|
|
1449
1477
|
*/
|
|
1450
|
-
orderRef:
|
|
1451
|
-
orderLabel:
|
|
1478
|
+
orderRef: z32.string().nullable(),
|
|
1479
|
+
orderLabel: z32.string().nullable(),
|
|
1452
1480
|
/**
|
|
1453
1481
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
1454
1482
|
* needs.
|
|
@@ -1461,12 +1489,12 @@ var SessionSummarySchema = z31.object({
|
|
|
1461
1489
|
* on a desktop are not the same session.
|
|
1462
1490
|
*/
|
|
1463
1491
|
formFactor: SessionFormFactorSchema,
|
|
1464
|
-
turnCount:
|
|
1492
|
+
turnCount: z32.number().int(),
|
|
1465
1493
|
/** The visitor's opening message — the single most informative field for
|
|
1466
1494
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
1467
|
-
firstPrompt:
|
|
1468
|
-
startedAt:
|
|
1469
|
-
lastRunAt:
|
|
1495
|
+
firstPrompt: z32.string(),
|
|
1496
|
+
startedAt: z32.string(),
|
|
1497
|
+
lastRunAt: z32.string(),
|
|
1470
1498
|
/**
|
|
1471
1499
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
1472
1500
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -1494,7 +1522,7 @@ var SessionSummarySchema = z31.object({
|
|
|
1494
1522
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
1495
1523
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
1496
1524
|
*/
|
|
1497
|
-
visitorTimeZone:
|
|
1525
|
+
visitorTimeZone: z32.string().nullable(),
|
|
1498
1526
|
/**
|
|
1499
1527
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
1500
1528
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -1502,31 +1530,31 @@ var SessionSummarySchema = z31.object({
|
|
|
1502
1530
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
1503
1531
|
* already reading. Null when no turn in the session recorded a patch.
|
|
1504
1532
|
*/
|
|
1505
|
-
avgTtftMs:
|
|
1533
|
+
avgTtftMs: z32.number().int().nullable(),
|
|
1506
1534
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
1507
1535
|
* a budget: null on sessions older than the mark's recording. */
|
|
1508
|
-
avgMainDoneMs:
|
|
1536
|
+
avgMainDoneMs: z32.number().int().nullable(),
|
|
1509
1537
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
1510
1538
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
1511
|
-
avgChipGenMs:
|
|
1512
|
-
totalLatencyMs:
|
|
1513
|
-
durationMs:
|
|
1539
|
+
avgChipGenMs: z32.number().int().nullable(),
|
|
1540
|
+
totalLatencyMs: z32.number().int(),
|
|
1541
|
+
durationMs: z32.number().int(),
|
|
1514
1542
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
1515
1543
|
* live session streams and cannot be given a verdict until it ends. */
|
|
1516
|
-
isLive:
|
|
1544
|
+
isLive: z32.boolean(),
|
|
1517
1545
|
verdict: SessionVerdictSchema,
|
|
1518
|
-
reviewedBy:
|
|
1519
|
-
reviewedAt:
|
|
1546
|
+
reviewedBy: z32.string().nullable(),
|
|
1547
|
+
reviewedAt: z32.string().nullable(),
|
|
1520
1548
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
1521
1549
|
* state without a second request. */
|
|
1522
|
-
bugIssueKey:
|
|
1523
|
-
bugIssueUrl:
|
|
1524
|
-
bugIssueState:
|
|
1550
|
+
bugIssueKey: z32.string().nullable(),
|
|
1551
|
+
bugIssueUrl: z32.string().nullable(),
|
|
1552
|
+
bugIssueState: z32.string().nullable()
|
|
1525
1553
|
});
|
|
1526
|
-
var SessionQueuePageSchema =
|
|
1527
|
-
sessions:
|
|
1528
|
-
totalCount:
|
|
1529
|
-
hiddenInternalCount:
|
|
1554
|
+
var SessionQueuePageSchema = z32.object({
|
|
1555
|
+
sessions: z32.array(SessionSummarySchema),
|
|
1556
|
+
totalCount: z32.number().int(),
|
|
1557
|
+
hiddenInternalCount: z32.number().int(),
|
|
1530
1558
|
/**
|
|
1531
1559
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
1532
1560
|
*
|
|
@@ -1536,61 +1564,61 @@ var SessionQueuePageSchema = z31.object({
|
|
|
1536
1564
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
1537
1565
|
* analytics dashboard's bounce over the same window.
|
|
1538
1566
|
*/
|
|
1539
|
-
hiddenBouncedCount:
|
|
1567
|
+
hiddenBouncedCount: z32.number().int()
|
|
1540
1568
|
});
|
|
1541
|
-
var SessionQueueFacetsSchema =
|
|
1542
|
-
review:
|
|
1543
|
-
version:
|
|
1544
|
-
turns:
|
|
1545
|
-
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()),
|
|
1546
1574
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
1547
|
-
funnel:
|
|
1575
|
+
funnel: z32.record(z32.number())
|
|
1548
1576
|
});
|
|
1549
|
-
var SessionCaptureSchema =
|
|
1550
|
-
viewportWidth:
|
|
1551
|
-
viewportHeight:
|
|
1552
|
-
userAgent:
|
|
1553
|
-
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(),
|
|
1554
1582
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
1555
|
-
referrer:
|
|
1583
|
+
referrer: z32.string().nullable()
|
|
1556
1584
|
});
|
|
1557
|
-
var SessionCaptureInputSchema =
|
|
1558
|
-
viewportWidth:
|
|
1559
|
-
viewportHeight:
|
|
1560
|
-
userAgent:
|
|
1561
|
-
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(),
|
|
1562
1590
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
1563
1591
|
* the zone database grows, and refusing a name this build has not heard of
|
|
1564
1592
|
* would drop a real session's capture over a table that is out of date. */
|
|
1565
|
-
timeZone:
|
|
1566
|
-
referrer:
|
|
1567
|
-
clientVersion:
|
|
1568
|
-
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()
|
|
1569
1597
|
});
|
|
1570
|
-
var SessionDetailSchema =
|
|
1598
|
+
var SessionDetailSchema = z32.object({
|
|
1571
1599
|
session: SessionSummarySchema,
|
|
1572
1600
|
capture: SessionCaptureSchema,
|
|
1573
1601
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
1574
1602
|
* re-judged after a fix is the evidence the fix worked. */
|
|
1575
|
-
reviews:
|
|
1576
|
-
bugs:
|
|
1577
|
-
comments:
|
|
1603
|
+
reviews: z32.array(SessionReviewEventSchema),
|
|
1604
|
+
bugs: z32.array(SessionBugSchema),
|
|
1605
|
+
comments: z32.array(SessionCommentSchema),
|
|
1578
1606
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
1579
1607
|
* not evidence of zero visitor activity. */
|
|
1580
1608
|
activity: SessionActivitySchema.optional()
|
|
1581
1609
|
});
|
|
1582
|
-
var RecordVerdictInputSchema =
|
|
1610
|
+
var RecordVerdictInputSchema = z32.object({
|
|
1583
1611
|
verdict: RecordableVerdictSchema,
|
|
1584
|
-
note:
|
|
1612
|
+
note: z32.string().max(2e3).optional()
|
|
1585
1613
|
});
|
|
1586
|
-
var FileBugInputSchema =
|
|
1587
|
-
turnIndex:
|
|
1614
|
+
var FileBugInputSchema = z32.object({
|
|
1615
|
+
turnIndex: z32.number().int().positive().nullable(),
|
|
1588
1616
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
1589
1617
|
location: BugLocationSchema.nullable().optional(),
|
|
1590
|
-
title:
|
|
1591
|
-
body:
|
|
1618
|
+
title: z32.string().min(1).max(300),
|
|
1619
|
+
body: z32.string().min(1),
|
|
1592
1620
|
severity: BugSeveritySchema,
|
|
1593
|
-
payload:
|
|
1621
|
+
payload: z32.record(z32.unknown())
|
|
1594
1622
|
});
|
|
1595
1623
|
export {
|
|
1596
1624
|
EMPTY_SPEC,
|