@40rty/ams-cli 0.5.6 → 0.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/wire.js +238 -223
- package/package.json +1 -1
package/dist/wire.js
CHANGED
|
@@ -1046,6 +1046,9 @@ var AttachmentRefSchema = z30.object({
|
|
|
1046
1046
|
});
|
|
1047
1047
|
var AttachmentRefsSchema = z30.array(AttachmentRefSchema);
|
|
1048
1048
|
|
|
1049
|
+
// ../spacestation/src/attachment/attachment-failure.ts
|
|
1050
|
+
var MAX_ATTACHMENT_MB = Math.round(MAX_ATTACHMENT_BYTES / (1024 * 1024));
|
|
1051
|
+
|
|
1049
1052
|
// ../spacestation/src/contracts/entry-context.ts
|
|
1050
1053
|
import { z as z31 } from "zod";
|
|
1051
1054
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
@@ -1206,6 +1209,18 @@ var UpdateAgentDirectiveInputSchema = z34.object({
|
|
|
1206
1209
|
}).strict();
|
|
1207
1210
|
var ReorderAgentDirectivesInputSchema = z34.object({ ids: z34.array(z34.string()).min(1) }).strict();
|
|
1208
1211
|
|
|
1212
|
+
// ../spacestation/src/space/space-locale.ts
|
|
1213
|
+
import { z as z35 } from "zod";
|
|
1214
|
+
function isBcp47(tag) {
|
|
1215
|
+
try {
|
|
1216
|
+
return new Intl.Locale(tag).language.length > 0;
|
|
1217
|
+
} catch (err) {
|
|
1218
|
+
if (err instanceof RangeError) return false;
|
|
1219
|
+
throw err;
|
|
1220
|
+
}
|
|
1221
|
+
}
|
|
1222
|
+
var SpaceLocaleSchema = z35.string().refine(isBcp47, { message: "locale must be a BCP 47 language tag, e.g. he-IL" });
|
|
1223
|
+
|
|
1209
1224
|
// ../spacestation/src/space/workspace-catalog.ts
|
|
1210
1225
|
var COMPONENT_SOURCE = {
|
|
1211
1226
|
ui: "@fourty/ui"
|
|
@@ -1234,30 +1249,30 @@ var DEFAULT_SPACE_CONFIG = {
|
|
|
1234
1249
|
};
|
|
1235
1250
|
|
|
1236
1251
|
// ../spacestation/src/space/trace.ts
|
|
1237
|
-
import { z as
|
|
1238
|
-
var RunTokenUsageSchema =
|
|
1239
|
-
input_tokens:
|
|
1240
|
-
output_tokens:
|
|
1241
|
-
cache_read_tokens:
|
|
1252
|
+
import { z as z36 } from "zod";
|
|
1253
|
+
var RunTokenUsageSchema = z36.object({
|
|
1254
|
+
input_tokens: z36.number().optional(),
|
|
1255
|
+
output_tokens: z36.number().optional(),
|
|
1256
|
+
cache_read_tokens: z36.number().optional()
|
|
1242
1257
|
});
|
|
1243
|
-
var TraceRecordSchema =
|
|
1244
|
-
id:
|
|
1245
|
-
spaceId:
|
|
1246
|
-
sessionId:
|
|
1258
|
+
var TraceRecordSchema = z36.object({
|
|
1259
|
+
id: z36.string().uuid(),
|
|
1260
|
+
spaceId: z36.string().uuid().nullable(),
|
|
1261
|
+
sessionId: z36.string(),
|
|
1247
1262
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
1248
1263
|
* for an unlocked space / anonymous unlock. */
|
|
1249
|
-
visitorEmail:
|
|
1250
|
-
userPrompt:
|
|
1251
|
-
branch:
|
|
1252
|
-
responseText:
|
|
1253
|
-
layout:
|
|
1254
|
-
phaseTimings:
|
|
1255
|
-
tokensByModel:
|
|
1256
|
-
toolCalls:
|
|
1257
|
-
diagnostics:
|
|
1258
|
-
latencyFirstText:
|
|
1259
|
-
latencyFirstPatch:
|
|
1260
|
-
latencyTotal:
|
|
1264
|
+
visitorEmail: z36.string().nullable(),
|
|
1265
|
+
userPrompt: z36.string(),
|
|
1266
|
+
branch: z36.string().nullable(),
|
|
1267
|
+
responseText: z36.string().nullable(),
|
|
1268
|
+
layout: z36.unknown().nullable(),
|
|
1269
|
+
phaseTimings: z36.record(z36.number()).nullable(),
|
|
1270
|
+
tokensByModel: z36.record(RunTokenUsageSchema).nullable(),
|
|
1271
|
+
toolCalls: z36.array(z36.unknown()).nullable(),
|
|
1272
|
+
diagnostics: z36.array(z36.unknown()).nullable(),
|
|
1273
|
+
latencyFirstText: z36.number().int().nullable(),
|
|
1274
|
+
latencyFirstPatch: z36.number().int().nullable(),
|
|
1275
|
+
latencyTotal: z36.number().int().nullable(),
|
|
1261
1276
|
/**
|
|
1262
1277
|
* The CLIENT's turn id for this run, or `null`.
|
|
1263
1278
|
*
|
|
@@ -1273,29 +1288,29 @@ var TraceRecordSchema = z35.object({
|
|
|
1273
1288
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1274
1289
|
* visitor asked something and got nothing.
|
|
1275
1290
|
*/
|
|
1276
|
-
turnId:
|
|
1291
|
+
turnId: z36.string().nullable(),
|
|
1277
1292
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
1278
1293
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
1279
|
-
trackerState:
|
|
1280
|
-
createdAt:
|
|
1294
|
+
trackerState: z36.unknown().nullable(),
|
|
1295
|
+
createdAt: z36.string()
|
|
1281
1296
|
});
|
|
1282
|
-
var MillisecondsSchema =
|
|
1283
|
-
var CreateTraceInputSchema =
|
|
1284
|
-
spaceId:
|
|
1285
|
-
sessionId:
|
|
1286
|
-
visitorEmail:
|
|
1287
|
-
userPrompt:
|
|
1288
|
-
branch:
|
|
1289
|
-
responseText:
|
|
1290
|
-
layout:
|
|
1291
|
-
phaseTimings:
|
|
1292
|
-
tokensByModel:
|
|
1293
|
-
toolCalls:
|
|
1294
|
-
diagnostics:
|
|
1297
|
+
var MillisecondsSchema = z36.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
1298
|
+
var CreateTraceInputSchema = z36.object({
|
|
1299
|
+
spaceId: z36.string().uuid().nullable(),
|
|
1300
|
+
sessionId: z36.string(),
|
|
1301
|
+
visitorEmail: z36.string().nullable(),
|
|
1302
|
+
userPrompt: z36.string(),
|
|
1303
|
+
branch: z36.string().nullable(),
|
|
1304
|
+
responseText: z36.string().nullable(),
|
|
1305
|
+
layout: z36.unknown().nullable(),
|
|
1306
|
+
phaseTimings: z36.record(z36.number()).nullable(),
|
|
1307
|
+
tokensByModel: z36.record(RunTokenUsageSchema).nullable(),
|
|
1308
|
+
toolCalls: z36.array(z36.unknown()).nullable(),
|
|
1309
|
+
diagnostics: z36.array(z36.unknown()).nullable(),
|
|
1295
1310
|
latencyFirstText: MillisecondsSchema,
|
|
1296
1311
|
latencyFirstPatch: MillisecondsSchema,
|
|
1297
1312
|
latencyTotal: MillisecondsSchema,
|
|
1298
|
-
trackerState:
|
|
1313
|
+
trackerState: z36.unknown().nullable(),
|
|
1299
1314
|
/**
|
|
1300
1315
|
* The CLIENT's turn id for this run, or `null`.
|
|
1301
1316
|
*
|
|
@@ -1311,37 +1326,37 @@ var CreateTraceInputSchema = z35.object({
|
|
|
1311
1326
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
1312
1327
|
* visitor asked something and got nothing.
|
|
1313
1328
|
*/
|
|
1314
|
-
turnId:
|
|
1329
|
+
turnId: z36.string().nullable()
|
|
1315
1330
|
});
|
|
1316
|
-
var AgentSessionSummarySchema =
|
|
1317
|
-
sessionId:
|
|
1331
|
+
var AgentSessionSummarySchema = z36.object({
|
|
1332
|
+
sessionId: z36.string(),
|
|
1318
1333
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
1319
|
-
turnCount:
|
|
1334
|
+
turnCount: z36.number().int(),
|
|
1320
1335
|
/** The session's opening prompt — titles the row in the UI. */
|
|
1321
|
-
firstPrompt:
|
|
1322
|
-
startedAt:
|
|
1323
|
-
lastRunAt:
|
|
1336
|
+
firstPrompt: z36.string(),
|
|
1337
|
+
startedAt: z36.string(),
|
|
1338
|
+
lastRunAt: z36.string(),
|
|
1324
1339
|
/** Summed `latency_total` across the session's turns. */
|
|
1325
|
-
totalLatencyMs:
|
|
1340
|
+
totalLatencyMs: z36.number().int()
|
|
1326
1341
|
});
|
|
1327
|
-
var SessionTurnSchema =
|
|
1328
|
-
id:
|
|
1329
|
-
userPrompt:
|
|
1330
|
-
responseText:
|
|
1342
|
+
var SessionTurnSchema = z36.object({
|
|
1343
|
+
id: z36.string().uuid(),
|
|
1344
|
+
userPrompt: z36.string(),
|
|
1345
|
+
responseText: z36.string().nullable(),
|
|
1331
1346
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
1332
|
-
layout:
|
|
1333
|
-
createdAt:
|
|
1334
|
-
latencyTotal:
|
|
1335
|
-
phaseTimings:
|
|
1336
|
-
tokensByModel:
|
|
1337
|
-
input_tokens:
|
|
1338
|
-
output_tokens:
|
|
1347
|
+
layout: z36.unknown().nullable(),
|
|
1348
|
+
createdAt: z36.string(),
|
|
1349
|
+
latencyTotal: z36.number().int().nullable(),
|
|
1350
|
+
phaseTimings: z36.record(z36.number()).nullable(),
|
|
1351
|
+
tokensByModel: z36.record(z36.object({
|
|
1352
|
+
input_tokens: z36.number().optional(),
|
|
1353
|
+
output_tokens: z36.number().optional()
|
|
1339
1354
|
})).nullable(),
|
|
1340
|
-
toolCalls:
|
|
1341
|
-
diagnostics:
|
|
1355
|
+
toolCalls: z36.array(z36.unknown()).nullable(),
|
|
1356
|
+
diagnostics: z36.array(z36.unknown()).nullable()
|
|
1342
1357
|
});
|
|
1343
|
-
var SessionReplaySchema =
|
|
1344
|
-
turns:
|
|
1358
|
+
var SessionReplaySchema = z36.object({
|
|
1359
|
+
turns: z36.array(SessionTurnSchema),
|
|
1345
1360
|
/**
|
|
1346
1361
|
* The session's own last-committed layout, read straight off the durable
|
|
1347
1362
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -1352,20 +1367,20 @@ var SessionReplaySchema = z35.object({
|
|
|
1352
1367
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
1353
1368
|
* when the durable session row itself could not be read.
|
|
1354
1369
|
*/
|
|
1355
|
-
sessionLayout:
|
|
1370
|
+
sessionLayout: z36.record(z36.string(), z36.unknown()).nullable()
|
|
1356
1371
|
});
|
|
1357
|
-
var SessionTraceSchema =
|
|
1358
|
-
trackerState:
|
|
1372
|
+
var SessionTraceSchema = z36.object({
|
|
1373
|
+
trackerState: z36.string().nullable()
|
|
1359
1374
|
});
|
|
1360
|
-
var LlmUsageDailySchema =
|
|
1361
|
-
day:
|
|
1375
|
+
var LlmUsageDailySchema = z36.object({
|
|
1376
|
+
day: z36.string(),
|
|
1362
1377
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
1363
|
-
environment:
|
|
1364
|
-
feature:
|
|
1365
|
-
model:
|
|
1366
|
-
provider:
|
|
1378
|
+
environment: z36.string(),
|
|
1379
|
+
feature: z36.string(),
|
|
1380
|
+
model: z36.string(),
|
|
1381
|
+
provider: z36.string(),
|
|
1367
1382
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
1368
|
-
keyFingerprint:
|
|
1383
|
+
keyFingerprint: z36.string().nullable(),
|
|
1369
1384
|
/**
|
|
1370
1385
|
* The space the call served, or null when it served none.
|
|
1371
1386
|
*
|
|
@@ -1374,91 +1389,91 @@ var LlmUsageDailySchema = z35.object({
|
|
|
1374
1389
|
* report that share rather than dropping it, or a per-space total reads as
|
|
1375
1390
|
* the platform total.
|
|
1376
1391
|
*/
|
|
1377
|
-
spaceId:
|
|
1392
|
+
spaceId: z36.string().nullable(),
|
|
1378
1393
|
/**
|
|
1379
1394
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
1380
1395
|
* when it served no session or the session predates surface recording.
|
|
1381
1396
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
1382
1397
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
1383
1398
|
*/
|
|
1384
|
-
surface:
|
|
1385
|
-
inputTokens:
|
|
1386
|
-
outputTokens:
|
|
1399
|
+
surface: z36.string().nullable(),
|
|
1400
|
+
inputTokens: z36.number(),
|
|
1401
|
+
outputTokens: z36.number(),
|
|
1387
1402
|
/** Subset of inputTokens, never additional to it. */
|
|
1388
|
-
cachedInputTokens:
|
|
1389
|
-
reasoningTokens:
|
|
1390
|
-
callCount:
|
|
1391
|
-
errorCount:
|
|
1392
|
-
estimatedCostUsd:
|
|
1403
|
+
cachedInputTokens: z36.number(),
|
|
1404
|
+
reasoningTokens: z36.number(),
|
|
1405
|
+
callCount: z36.number(),
|
|
1406
|
+
errorCount: z36.number(),
|
|
1407
|
+
estimatedCostUsd: z36.number().nullable()
|
|
1393
1408
|
});
|
|
1394
|
-
var LlmUsageBySessionSchema =
|
|
1395
|
-
sessionId:
|
|
1396
|
-
environment:
|
|
1397
|
-
model:
|
|
1409
|
+
var LlmUsageBySessionSchema = z36.object({
|
|
1410
|
+
sessionId: z36.string(),
|
|
1411
|
+
environment: z36.string(),
|
|
1412
|
+
model: z36.string(),
|
|
1398
1413
|
/** The space this session belongs to, or null for a session with no space. */
|
|
1399
|
-
spaceId:
|
|
1414
|
+
spaceId: z36.string().nullable(),
|
|
1400
1415
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
1401
|
-
surface:
|
|
1416
|
+
surface: z36.string().nullable(),
|
|
1402
1417
|
/** Label only — the first feature seen in the session. */
|
|
1403
|
-
firstFeature:
|
|
1404
|
-
startedAt:
|
|
1405
|
-
endedAt:
|
|
1406
|
-
inputTokens:
|
|
1407
|
-
outputTokens:
|
|
1408
|
-
cachedInputTokens:
|
|
1409
|
-
reasoningTokens:
|
|
1410
|
-
callCount:
|
|
1411
|
-
errorCount:
|
|
1418
|
+
firstFeature: z36.string(),
|
|
1419
|
+
startedAt: z36.string(),
|
|
1420
|
+
endedAt: z36.string(),
|
|
1421
|
+
inputTokens: z36.number(),
|
|
1422
|
+
outputTokens: z36.number(),
|
|
1423
|
+
cachedInputTokens: z36.number(),
|
|
1424
|
+
reasoningTokens: z36.number(),
|
|
1425
|
+
callCount: z36.number(),
|
|
1426
|
+
errorCount: z36.number(),
|
|
1412
1427
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
1413
1428
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
1414
1429
|
* the model is unpriced; never 0, which would read as free. */
|
|
1415
|
-
estimatedCostUsd:
|
|
1430
|
+
estimatedCostUsd: z36.number().nullable()
|
|
1416
1431
|
});
|
|
1417
|
-
var LlmSessionsDailySchema =
|
|
1418
|
-
day:
|
|
1419
|
-
environment:
|
|
1420
|
-
sessionCount:
|
|
1432
|
+
var LlmSessionsDailySchema = z36.object({
|
|
1433
|
+
day: z36.string(),
|
|
1434
|
+
environment: z36.string(),
|
|
1435
|
+
sessionCount: z36.number()
|
|
1421
1436
|
});
|
|
1422
1437
|
|
|
1423
1438
|
// ../spacestation/src/space/session-queue.ts
|
|
1424
|
-
import { z as
|
|
1439
|
+
import { z as z38 } from "zod";
|
|
1425
1440
|
|
|
1426
1441
|
// ../spacestation/src/space/session-activity.ts
|
|
1427
|
-
import { z as
|
|
1428
|
-
var SessionActivityEventSchema =
|
|
1429
|
-
id:
|
|
1430
|
-
kind:
|
|
1431
|
-
occurredAt:
|
|
1432
|
-
source:
|
|
1433
|
-
surface:
|
|
1434
|
-
payload:
|
|
1442
|
+
import { z as z37 } from "zod";
|
|
1443
|
+
var SessionActivityEventSchema = z37.object({
|
|
1444
|
+
id: z37.string(),
|
|
1445
|
+
kind: z37.string(),
|
|
1446
|
+
occurredAt: z37.string(),
|
|
1447
|
+
source: z37.string(),
|
|
1448
|
+
surface: z37.string(),
|
|
1449
|
+
payload: z37.record(z37.unknown())
|
|
1435
1450
|
});
|
|
1436
|
-
var SessionActivitySchema =
|
|
1437
|
-
events:
|
|
1438
|
-
hasMore:
|
|
1451
|
+
var SessionActivitySchema = z37.object({
|
|
1452
|
+
events: z37.array(SessionActivityEventSchema),
|
|
1453
|
+
hasMore: z37.boolean()
|
|
1439
1454
|
});
|
|
1440
1455
|
|
|
1441
1456
|
// ../spacestation/src/space/session-queue.ts
|
|
1442
|
-
var SessionVerdictSchema =
|
|
1443
|
-
var RecordableVerdictSchema =
|
|
1444
|
-
var SessionReviewEventSchema =
|
|
1445
|
-
id:
|
|
1457
|
+
var SessionVerdictSchema = z38.enum(["unreviewed", "viewed", "bug"]);
|
|
1458
|
+
var RecordableVerdictSchema = z38.enum(["viewed", "bug"]);
|
|
1459
|
+
var SessionReviewEventSchema = z38.object({
|
|
1460
|
+
id: z38.string().uuid(),
|
|
1446
1461
|
verdict: RecordableVerdictSchema,
|
|
1447
1462
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
1448
1463
|
* log is append-only rather than a mutable current-state row. */
|
|
1449
|
-
reviewer:
|
|
1450
|
-
note:
|
|
1451
|
-
createdAt:
|
|
1464
|
+
reviewer: z38.string(),
|
|
1465
|
+
note: z38.string().nullable(),
|
|
1466
|
+
createdAt: z38.string()
|
|
1452
1467
|
});
|
|
1453
|
-
var BugSeveritySchema =
|
|
1454
|
-
var BugLocationSchema =
|
|
1455
|
-
elementId:
|
|
1468
|
+
var BugSeveritySchema = z38.enum(["high", "medium", "low"]);
|
|
1469
|
+
var BugLocationSchema = z38.object({
|
|
1470
|
+
elementId: z38.string().nullable(),
|
|
1456
1471
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
1457
1472
|
* alongside a null `elementId`. */
|
|
1458
|
-
elementType:
|
|
1473
|
+
elementType: z38.string().nullable(),
|
|
1459
1474
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
1460
|
-
offsetXPct:
|
|
1461
|
-
offsetYPct:
|
|
1475
|
+
offsetXPct: z38.number().min(0).max(100).nullable(),
|
|
1476
|
+
offsetYPct: z38.number().min(0).max(100).nullable(),
|
|
1462
1477
|
/**
|
|
1463
1478
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
1464
1479
|
* element anchor.
|
|
@@ -1469,8 +1484,8 @@ var BugLocationSchema = z37.object({
|
|
|
1469
1484
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
1470
1485
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
1471
1486
|
*/
|
|
1472
|
-
pageX:
|
|
1473
|
-
pageY:
|
|
1487
|
+
pageX: z38.number().nullable(),
|
|
1488
|
+
pageY: z38.number().nullable()
|
|
1474
1489
|
}).refine(
|
|
1475
1490
|
(loc) => {
|
|
1476
1491
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -1484,24 +1499,24 @@ var BugLocationSchema = z37.object({
|
|
|
1484
1499
|
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)"
|
|
1485
1500
|
}
|
|
1486
1501
|
);
|
|
1487
|
-
var SessionBugSchema =
|
|
1488
|
-
id:
|
|
1502
|
+
var SessionBugSchema = z38.object({
|
|
1503
|
+
id: z38.string().uuid(),
|
|
1489
1504
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
1490
|
-
turnIndex:
|
|
1505
|
+
turnIndex: z38.number().int().nullable(),
|
|
1491
1506
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
1492
1507
|
* without pinning a spot. */
|
|
1493
1508
|
location: BugLocationSchema.nullable(),
|
|
1494
|
-
provider:
|
|
1495
|
-
issueKey:
|
|
1496
|
-
issueUrl:
|
|
1509
|
+
provider: z38.string(),
|
|
1510
|
+
issueKey: z38.string().nullable(),
|
|
1511
|
+
issueUrl: z38.string().nullable(),
|
|
1497
1512
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
1498
1513
|
* open text. Null until first synced. */
|
|
1499
|
-
issueState:
|
|
1500
|
-
title:
|
|
1501
|
-
body:
|
|
1514
|
+
issueState: z38.string().nullable(),
|
|
1515
|
+
title: z38.string(),
|
|
1516
|
+
body: z38.string(),
|
|
1502
1517
|
severity: BugSeveritySchema,
|
|
1503
|
-
createdBy:
|
|
1504
|
-
createdAt:
|
|
1518
|
+
createdBy: z38.string(),
|
|
1519
|
+
createdAt: z38.string(),
|
|
1505
1520
|
/**
|
|
1506
1521
|
* When this bug was resolved from the console; null means still OPEN.
|
|
1507
1522
|
*
|
|
@@ -1510,55 +1525,55 @@ var SessionBugSchema = z37.object({
|
|
|
1510
1525
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
1511
1526
|
* no boolean can contradict it.
|
|
1512
1527
|
*/
|
|
1513
|
-
resolvedAt:
|
|
1514
|
-
resolvedBy:
|
|
1528
|
+
resolvedAt: z38.string().nullable(),
|
|
1529
|
+
resolvedBy: z38.string().nullable()
|
|
1515
1530
|
});
|
|
1516
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
1517
|
-
var SessionCommentSchema =
|
|
1518
|
-
id:
|
|
1531
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z38.string() });
|
|
1532
|
+
var SessionCommentSchema = z38.object({
|
|
1533
|
+
id: z38.string().uuid(),
|
|
1519
1534
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
1520
|
-
bugId:
|
|
1535
|
+
bugId: z38.string().uuid().nullable(),
|
|
1521
1536
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
1522
1537
|
* parent bug's turn). */
|
|
1523
|
-
turnIndex:
|
|
1538
|
+
turnIndex: z38.number().int().nullable(),
|
|
1524
1539
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
1525
1540
|
location: BugLocationSchema.nullable(),
|
|
1526
|
-
body:
|
|
1527
|
-
createdBy:
|
|
1528
|
-
createdAt:
|
|
1541
|
+
body: z38.string(),
|
|
1542
|
+
createdBy: z38.string(),
|
|
1543
|
+
createdAt: z38.string()
|
|
1529
1544
|
});
|
|
1530
|
-
var CreateCommentInputSchema =
|
|
1531
|
-
bugId:
|
|
1532
|
-
turnIndex:
|
|
1545
|
+
var CreateCommentInputSchema = z38.object({
|
|
1546
|
+
bugId: z38.string().uuid().nullable(),
|
|
1547
|
+
turnIndex: z38.number().int().positive().nullable(),
|
|
1533
1548
|
location: BugLocationSchema.nullable(),
|
|
1534
1549
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
1535
1550
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
1536
|
-
body:
|
|
1551
|
+
body: z38.string().trim().min(1)
|
|
1537
1552
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
1538
1553
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
1539
1554
|
});
|
|
1540
|
-
var UpdateCommentInputSchema =
|
|
1541
|
-
body:
|
|
1542
|
-
bugId:
|
|
1555
|
+
var UpdateCommentInputSchema = z38.object({
|
|
1556
|
+
body: z38.string().trim().min(1).optional(),
|
|
1557
|
+
bugId: z38.string().uuid().nullable().optional(),
|
|
1543
1558
|
location: BugLocationSchema.nullable().optional()
|
|
1544
1559
|
});
|
|
1545
|
-
var SessionFormFactorSchema =
|
|
1546
|
-
var SessionSummarySchema =
|
|
1547
|
-
sessionId:
|
|
1560
|
+
var SessionFormFactorSchema = z38.enum(["mobile", "desktop"]).nullable();
|
|
1561
|
+
var SessionSummarySchema = z38.object({
|
|
1562
|
+
sessionId: z38.string(),
|
|
1548
1563
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
1549
1564
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
1550
|
-
visitorId:
|
|
1565
|
+
visitorId: z38.string().nullable(),
|
|
1551
1566
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
1552
1567
|
* identified themselves. Both null together means "not identified yet". */
|
|
1553
|
-
identityProvider:
|
|
1554
|
-
identityKey:
|
|
1568
|
+
identityProvider: z38.string().nullable(),
|
|
1569
|
+
identityKey: z38.string().nullable(),
|
|
1555
1570
|
/** Team/test traffic. The queue hides these by default. */
|
|
1556
|
-
isInternal:
|
|
1571
|
+
isInternal: z38.boolean(),
|
|
1557
1572
|
/** Build that served the session. Null = not captured; a version filter must
|
|
1558
1573
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
1559
|
-
clientVersion:
|
|
1574
|
+
clientVersion: z38.string().nullable(),
|
|
1560
1575
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
1561
|
-
signalCounts:
|
|
1576
|
+
signalCounts: z38.record(z38.number()),
|
|
1562
1577
|
/**
|
|
1563
1578
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
1564
1579
|
*
|
|
@@ -1575,7 +1590,7 @@ var SessionSummarySchema = z37.object({
|
|
|
1575
1590
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
1576
1591
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
1577
1592
|
*/
|
|
1578
|
-
conversionAttempts:
|
|
1593
|
+
conversionAttempts: z38.number().int().nullable(),
|
|
1579
1594
|
/**
|
|
1580
1595
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
1581
1596
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -1591,7 +1606,7 @@ var SessionSummarySchema = z37.object({
|
|
|
1591
1606
|
* kinds together, and one attempt id appearing under both would be counted
|
|
1592
1607
|
* once there and twice here.
|
|
1593
1608
|
*/
|
|
1594
|
-
conversionKinds:
|
|
1609
|
+
conversionKinds: z38.record(z38.number()),
|
|
1595
1610
|
/**
|
|
1596
1611
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
1597
1612
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -1599,20 +1614,20 @@ var SessionSummarySchema = z37.object({
|
|
|
1599
1614
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
1600
1615
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
1601
1616
|
*/
|
|
1602
|
-
funnelSteps:
|
|
1617
|
+
funnelSteps: z38.array(z38.string()),
|
|
1603
1618
|
/**
|
|
1604
1619
|
* The connector's opaque handle for what this session produced in its back
|
|
1605
1620
|
* office — present only once a checkout actually reached the platform. The
|
|
1606
1621
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
1607
1622
|
*/
|
|
1608
|
-
backOfficeRef:
|
|
1623
|
+
backOfficeRef: z38.string().nullable(),
|
|
1609
1624
|
/**
|
|
1610
1625
|
* The order this session produced, when the connector's back office reported
|
|
1611
1626
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
1612
1627
|
* Both null when no order is known — the cart handle above is then the door.
|
|
1613
1628
|
*/
|
|
1614
|
-
orderRef:
|
|
1615
|
-
orderLabel:
|
|
1629
|
+
orderRef: z38.string().nullable(),
|
|
1630
|
+
orderLabel: z38.string().nullable(),
|
|
1616
1631
|
/**
|
|
1617
1632
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
1618
1633
|
* needs.
|
|
@@ -1625,12 +1640,12 @@ var SessionSummarySchema = z37.object({
|
|
|
1625
1640
|
* on a desktop are not the same session.
|
|
1626
1641
|
*/
|
|
1627
1642
|
formFactor: SessionFormFactorSchema,
|
|
1628
|
-
turnCount:
|
|
1643
|
+
turnCount: z38.number().int(),
|
|
1629
1644
|
/** The visitor's opening message — the single most informative field for
|
|
1630
1645
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
1631
|
-
firstPrompt:
|
|
1632
|
-
startedAt:
|
|
1633
|
-
lastRunAt:
|
|
1646
|
+
firstPrompt: z38.string(),
|
|
1647
|
+
startedAt: z38.string(),
|
|
1648
|
+
lastRunAt: z38.string(),
|
|
1634
1649
|
/**
|
|
1635
1650
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
1636
1651
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -1658,7 +1673,7 @@ var SessionSummarySchema = z37.object({
|
|
|
1658
1673
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
1659
1674
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
1660
1675
|
*/
|
|
1661
|
-
visitorTimeZone:
|
|
1676
|
+
visitorTimeZone: z38.string().nullable(),
|
|
1662
1677
|
/**
|
|
1663
1678
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
1664
1679
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -1666,31 +1681,31 @@ var SessionSummarySchema = z37.object({
|
|
|
1666
1681
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
1667
1682
|
* already reading. Null when no turn in the session recorded a patch.
|
|
1668
1683
|
*/
|
|
1669
|
-
avgTtftMs:
|
|
1684
|
+
avgTtftMs: z38.number().int().nullable(),
|
|
1670
1685
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
1671
1686
|
* a budget: null on sessions older than the mark's recording. */
|
|
1672
|
-
avgMainDoneMs:
|
|
1687
|
+
avgMainDoneMs: z38.number().int().nullable(),
|
|
1673
1688
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
1674
1689
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
1675
|
-
avgChipGenMs:
|
|
1676
|
-
totalLatencyMs:
|
|
1677
|
-
durationMs:
|
|
1690
|
+
avgChipGenMs: z38.number().int().nullable(),
|
|
1691
|
+
totalLatencyMs: z38.number().int(),
|
|
1692
|
+
durationMs: z38.number().int(),
|
|
1678
1693
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
1679
1694
|
* live session streams and cannot be given a verdict until it ends. */
|
|
1680
|
-
isLive:
|
|
1695
|
+
isLive: z38.boolean(),
|
|
1681
1696
|
verdict: SessionVerdictSchema,
|
|
1682
|
-
reviewedBy:
|
|
1683
|
-
reviewedAt:
|
|
1697
|
+
reviewedBy: z38.string().nullable(),
|
|
1698
|
+
reviewedAt: z38.string().nullable(),
|
|
1684
1699
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
1685
1700
|
* state without a second request. */
|
|
1686
|
-
bugIssueKey:
|
|
1687
|
-
bugIssueUrl:
|
|
1688
|
-
bugIssueState:
|
|
1701
|
+
bugIssueKey: z38.string().nullable(),
|
|
1702
|
+
bugIssueUrl: z38.string().nullable(),
|
|
1703
|
+
bugIssueState: z38.string().nullable()
|
|
1689
1704
|
});
|
|
1690
|
-
var SessionQueuePageSchema =
|
|
1691
|
-
sessions:
|
|
1692
|
-
totalCount:
|
|
1693
|
-
hiddenInternalCount:
|
|
1705
|
+
var SessionQueuePageSchema = z38.object({
|
|
1706
|
+
sessions: z38.array(SessionSummarySchema),
|
|
1707
|
+
totalCount: z38.number().int(),
|
|
1708
|
+
hiddenInternalCount: z38.number().int(),
|
|
1694
1709
|
/**
|
|
1695
1710
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
1696
1711
|
*
|
|
@@ -1700,61 +1715,61 @@ var SessionQueuePageSchema = z37.object({
|
|
|
1700
1715
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
1701
1716
|
* analytics dashboard's bounce over the same window.
|
|
1702
1717
|
*/
|
|
1703
|
-
hiddenBouncedCount:
|
|
1718
|
+
hiddenBouncedCount: z38.number().int()
|
|
1704
1719
|
});
|
|
1705
|
-
var SessionQueueFacetsSchema =
|
|
1706
|
-
review:
|
|
1707
|
-
version:
|
|
1708
|
-
turns:
|
|
1709
|
-
durationS:
|
|
1720
|
+
var SessionQueueFacetsSchema = z38.object({
|
|
1721
|
+
review: z38.record(z38.number()),
|
|
1722
|
+
version: z38.record(z38.number()),
|
|
1723
|
+
turns: z38.record(z38.number()),
|
|
1724
|
+
durationS: z38.record(z38.number()),
|
|
1710
1725
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
1711
|
-
funnel:
|
|
1726
|
+
funnel: z38.record(z38.number())
|
|
1712
1727
|
});
|
|
1713
|
-
var SessionCaptureSchema =
|
|
1714
|
-
viewportWidth:
|
|
1715
|
-
viewportHeight:
|
|
1716
|
-
userAgent:
|
|
1717
|
-
locale:
|
|
1728
|
+
var SessionCaptureSchema = z38.object({
|
|
1729
|
+
viewportWidth: z38.number().int().nullable(),
|
|
1730
|
+
viewportHeight: z38.number().int().nullable(),
|
|
1731
|
+
userAgent: z38.string().nullable(),
|
|
1732
|
+
locale: z38.string().nullable(),
|
|
1718
1733
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
1719
|
-
referrer:
|
|
1734
|
+
referrer: z38.string().nullable()
|
|
1720
1735
|
});
|
|
1721
|
-
var SessionCaptureInputSchema =
|
|
1722
|
-
viewportWidth:
|
|
1723
|
-
viewportHeight:
|
|
1724
|
-
userAgent:
|
|
1725
|
-
locale:
|
|
1736
|
+
var SessionCaptureInputSchema = z38.object({
|
|
1737
|
+
viewportWidth: z38.number().int().positive().max(2e4).optional(),
|
|
1738
|
+
viewportHeight: z38.number().int().positive().max(2e4).optional(),
|
|
1739
|
+
userAgent: z38.string().max(1e3).optional(),
|
|
1740
|
+
locale: z38.string().max(35).optional(),
|
|
1726
1741
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
1727
1742
|
* the zone database grows, and refusing a name this build has not heard of
|
|
1728
1743
|
* would drop a real session's capture over a table that is out of date. */
|
|
1729
|
-
timeZone:
|
|
1730
|
-
referrer:
|
|
1731
|
-
clientVersion:
|
|
1732
|
-
isInternal:
|
|
1744
|
+
timeZone: z38.string().max(64).optional(),
|
|
1745
|
+
referrer: z38.string().max(2048).optional(),
|
|
1746
|
+
clientVersion: z38.string().max(100).optional(),
|
|
1747
|
+
isInternal: z38.boolean().optional()
|
|
1733
1748
|
});
|
|
1734
|
-
var SessionDetailSchema =
|
|
1749
|
+
var SessionDetailSchema = z38.object({
|
|
1735
1750
|
session: SessionSummarySchema,
|
|
1736
1751
|
capture: SessionCaptureSchema,
|
|
1737
1752
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
1738
1753
|
* re-judged after a fix is the evidence the fix worked. */
|
|
1739
|
-
reviews:
|
|
1740
|
-
bugs:
|
|
1741
|
-
comments:
|
|
1754
|
+
reviews: z38.array(SessionReviewEventSchema),
|
|
1755
|
+
bugs: z38.array(SessionBugSchema),
|
|
1756
|
+
comments: z38.array(SessionCommentSchema),
|
|
1742
1757
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
1743
1758
|
* not evidence of zero visitor activity. */
|
|
1744
1759
|
activity: SessionActivitySchema.optional()
|
|
1745
1760
|
});
|
|
1746
|
-
var RecordVerdictInputSchema =
|
|
1761
|
+
var RecordVerdictInputSchema = z38.object({
|
|
1747
1762
|
verdict: RecordableVerdictSchema,
|
|
1748
|
-
note:
|
|
1763
|
+
note: z38.string().max(2e3).optional()
|
|
1749
1764
|
});
|
|
1750
|
-
var FileBugInputSchema =
|
|
1751
|
-
turnIndex:
|
|
1765
|
+
var FileBugInputSchema = z38.object({
|
|
1766
|
+
turnIndex: z38.number().int().positive().nullable(),
|
|
1752
1767
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
1753
1768
|
location: BugLocationSchema.nullable().optional(),
|
|
1754
|
-
title:
|
|
1755
|
-
body:
|
|
1769
|
+
title: z38.string().min(1).max(300),
|
|
1770
|
+
body: z38.string().min(1),
|
|
1756
1771
|
severity: BugSeveritySchema,
|
|
1757
|
-
payload:
|
|
1772
|
+
payload: z38.record(z38.unknown())
|
|
1758
1773
|
});
|
|
1759
1774
|
export {
|
|
1760
1775
|
EMPTY_SPEC,
|