@40rty/ams-sdk 0.5.0 → 0.5.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/dist/index.js +816 -548
- package/dist/types/sdk/src/analytics/index.d.ts +1 -1
- package/dist/types/sdk/src/analytics/outbox.d.ts +2 -0
- package/dist/types/sdk/src/analytics/scope-context.d.ts +2 -0
- package/dist/types/sdk/src/analytics/scope.d.ts +7 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +275 -36
- package/dist/types/spacestation/src/analytics/envelope.d.ts +24 -0
- package/dist/types/spacestation/src/attachment/attachment.d.ts +8 -5
- package/dist/types/spacestation/src/catalog/element-filled.d.ts +2 -2
- package/dist/types/spacestation/src/catalog/wire/index.d.ts +2 -0
- package/dist/types/spacestation/src/catalog/wire/package-bundle-ref.d.ts +30 -0
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +20 -0
- package/dist/types/spacestation/src/catalog/wire/sdk-compat.d.ts +43 -0
- package/dist/types/spacestation/src/contracts/socket-ticket-param.d.ts +9 -0
- package/dist/types/spacestation/src/contracts/wire-protocol.d.ts +25 -0
- package/dist/types/spacestation/src/index.d.ts +5 -1
- package/dist/types/spacestation/src/space/agent-directive.d.ts +239 -0
- package/dist/types/spacestation/src/space/session-queue.d.ts +24 -24
- package/dist/types/spacestation/src/space/trace.d.ts +12 -12
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +8 -0
- package/dist/types/spacestation/src/trace/trace-events.d.ts +1 -0
- package/dist/types/spacestation/src/widgets/presence/index.d.ts +1 -1
- package/dist/types/spacestation/src/widgets/presence/scan.d.ts +21 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -14,6 +14,10 @@ __export(src_exports3, {
|
|
|
14
14
|
ACTIVE_PANEL_ATTR: () => ACTIVE_PANEL_ATTR,
|
|
15
15
|
ACTIVE_PANEL_SELECTOR: () => ACTIVE_PANEL_SELECTOR,
|
|
16
16
|
AGENT_ASK_SIGNAL: () => AGENT_ASK_SIGNAL,
|
|
17
|
+
AGENT_DIRECTIVE_KINDS: () => AGENT_DIRECTIVE_KINDS,
|
|
18
|
+
AGENT_DIRECTIVE_SEVERITIES: () => AGENT_DIRECTIVE_SEVERITIES,
|
|
19
|
+
AGENT_DIRECTIVE_SOURCES: () => AGENT_DIRECTIVE_SOURCES,
|
|
20
|
+
AGENT_DIRECTIVE_STATUSES: () => AGENT_DIRECTIVE_STATUSES,
|
|
17
21
|
ALLOWED_ATTACHMENT_TYPES: () => ALLOWED_ATTACHMENT_TYPES,
|
|
18
22
|
ANALYTICS_CONSENTS: () => ANALYTICS_CONSENTS,
|
|
19
23
|
ANALYTICS_MAX_QUEUED: () => ANALYTICS_MAX_QUEUED,
|
|
@@ -21,6 +25,7 @@ __export(src_exports3, {
|
|
|
21
25
|
ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
|
|
22
26
|
ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
|
|
23
27
|
ATTACHMENT_ACCEPT: () => ATTACHMENT_ACCEPT,
|
|
28
|
+
AgentDirectiveSchema: () => AgentDirectiveSchema,
|
|
24
29
|
AgentOutputSchema: () => AgentOutputSchema,
|
|
25
30
|
AgentSessionSummarySchema: () => AgentSessionSummarySchema,
|
|
26
31
|
AgentSignalSchema: () => AgentSignalSchema,
|
|
@@ -147,13 +152,16 @@ __export(src_exports3, {
|
|
|
147
152
|
LlmSessionsDailySchema: () => LlmSessionsDailySchema,
|
|
148
153
|
LlmUsageBySessionSchema: () => LlmUsageBySessionSchema,
|
|
149
154
|
LlmUsageDailySchema: () => LlmUsageDailySchema,
|
|
155
|
+
MAX_ACTIVE_AGENT_DIRECTIVES: () => MAX_ACTIVE_AGENT_DIRECTIVES,
|
|
150
156
|
MAX_ATTACHMENT_BYTES: () => MAX_ATTACHMENT_BYTES,
|
|
151
157
|
MAX_VISITOR_PROMPT_CHARS: () => MAX_VISITOR_PROMPT_CHARS,
|
|
158
|
+
MIN_WIRE_PROTOCOL_VERSION: () => MIN_WIRE_PROTOCOL_VERSION,
|
|
152
159
|
MOBILE_VIEWPORT_MAX: () => MOBILE_VIEWPORT_MAX,
|
|
153
160
|
MoneySchema: () => MoneySchema,
|
|
154
161
|
NAVIGATE_SIGNAL: () => NAVIGATE_SIGNAL,
|
|
155
162
|
NavigatePayloadSchema: () => NavigatePayloadSchema,
|
|
156
163
|
NullComponent: () => NullComponent,
|
|
164
|
+
OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
|
|
157
165
|
PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
158
166
|
PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
|
|
159
167
|
PRESENCE_FLOW: () => PRESENCE_FLOW,
|
|
@@ -164,6 +172,7 @@ __export(src_exports3, {
|
|
|
164
172
|
PRODUCT_SELECT_OPTION_SIGNAL: () => PRODUCT_SELECT_OPTION_SIGNAL,
|
|
165
173
|
PRODUCT_VARIANTS_SCOPE: () => PRODUCT_VARIANTS_SCOPE,
|
|
166
174
|
PROJECTION_SET_SIGNAL: () => PROJECTION_SET_SIGNAL,
|
|
175
|
+
PackageBundleRefSchema: () => PackageBundleRefSchema,
|
|
167
176
|
PackageLookupProvider: () => PackageLookupProvider,
|
|
168
177
|
PackageReleaseSchema: () => PackageReleaseSchema,
|
|
169
178
|
PageSchema: () => PageSchema,
|
|
@@ -187,16 +196,21 @@ __export(src_exports3, {
|
|
|
187
196
|
RecordVerdictInputSchema: () => RecordVerdictInputSchema,
|
|
188
197
|
RecordableVerdictSchema: () => RecordableVerdictSchema,
|
|
189
198
|
RegistryProvider: () => RegistryProvider,
|
|
199
|
+
ReorderAgentDirectivesInputSchema: () => ReorderAgentDirectivesInputSchema,
|
|
190
200
|
ReviewAggregateSchema: () => ReviewAggregateSchema,
|
|
191
201
|
ReviewSchema: () => ReviewSchema,
|
|
192
202
|
SCANNING_FORM: () => SCANNING_FORM,
|
|
203
|
+
SDK_SHIMS: () => SDK_SHIMS,
|
|
204
|
+
SDK_VERSION_PATTERN: () => SDK_VERSION_PATTERN,
|
|
193
205
|
SELECTION_ORIGIN_VISITOR: () => SELECTION_ORIGIN_VISITOR,
|
|
194
206
|
SIGNAL_PATCH_PREFIX: () => SIGNAL_PATCH_PREFIX,
|
|
207
|
+
SOCKET_TICKET_PARAM: () => SOCKET_TICKET_PARAM,
|
|
195
208
|
STRUCTURAL_BASELINE_CATALOG: () => STRUCTURAL_BASELINE_CATALOG,
|
|
196
209
|
STRUCTURAL_BASELINE_TYPES: () => STRUCTURAL_BASELINE_TYPES,
|
|
197
210
|
SURFACES: () => SURFACES,
|
|
198
211
|
SURFACE_DISPOSITION: () => SURFACE_DISPOSITION,
|
|
199
212
|
ScrollContainerProvider: () => ScrollContainerProvider,
|
|
213
|
+
SdkVersionSchema: () => SdkVersionSchema,
|
|
200
214
|
SelectedOptionSchema: () => SelectedOptionSchema,
|
|
201
215
|
SessionActivityEventSchema: () => SessionActivityEventSchema,
|
|
202
216
|
SessionActivitySchema: () => SessionActivitySchema,
|
|
@@ -221,6 +235,8 @@ __export(src_exports3, {
|
|
|
221
235
|
ShellRootContext: () => ShellRootContext,
|
|
222
236
|
ShimmerSweep: () => ShimmerSweep,
|
|
223
237
|
SiblingProductSchema: () => SiblingProductSchema,
|
|
238
|
+
SpaceAgentDirectiveListItemSchema: () => SpaceAgentDirectiveListItemSchema,
|
|
239
|
+
SpaceAgentDirectiveSchema: () => SpaceAgentDirectiveSchema,
|
|
224
240
|
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
225
241
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
226
242
|
SpacefrontCanvas: () => SpacefrontCanvas,
|
|
@@ -242,8 +258,10 @@ __export(src_exports3, {
|
|
|
242
258
|
TransitionProvider: () => TransitionProvider,
|
|
243
259
|
TurnAskPlacementProvider: () => TurnAskPlacementProvider,
|
|
244
260
|
TurnAskSchema: () => TurnAskSchema,
|
|
261
|
+
TurnScopeProvider: () => TurnScopeProvider,
|
|
245
262
|
UIElementSchema: () => UIElementSchema,
|
|
246
263
|
UnsupportedSchemaError: () => UnsupportedSchemaError,
|
|
264
|
+
UpdateAgentDirectiveInputSchema: () => UpdateAgentDirectiveInputSchema,
|
|
247
265
|
UpdateCommentInputSchema: () => UpdateCommentInputSchema,
|
|
248
266
|
VARIANT_SELECTED_OBSERVATION: () => VARIANT_SELECTED_OBSERVATION,
|
|
249
267
|
VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -260,6 +278,9 @@ __export(src_exports3, {
|
|
|
260
278
|
ViewportWindowContext: () => ViewportWindowContext,
|
|
261
279
|
ViewportWindowProvider: () => ViewportWindowProvider,
|
|
262
280
|
VisitorIdDurabilitySchema: () => VisitorIdDurabilitySchema,
|
|
281
|
+
WIRE_PROTOCOL_PARAM: () => WIRE_PROTOCOL_PARAM,
|
|
282
|
+
WIRE_PROTOCOL_UNSUPPORTED_CLOSE: () => WIRE_PROTOCOL_UNSUPPORTED_CLOSE,
|
|
283
|
+
WIRE_PROTOCOL_VERSION: () => WIRE_PROTOCOL_VERSION,
|
|
263
284
|
WORKSPACE_THEME_PACKAGES: () => WORKSPACE_THEME_PACKAGES,
|
|
264
285
|
WireCatalogEntrySchema: () => WireCatalogEntrySchema,
|
|
265
286
|
WireCatalogSchema: () => WireCatalogSchema,
|
|
@@ -307,6 +328,7 @@ __export(src_exports3, {
|
|
|
307
328
|
collectLayoutGids: () => collectLayoutGids,
|
|
308
329
|
collectPlacedEntityRefs: () => collectPlacedEntityRefs,
|
|
309
330
|
colorHexOf: () => colorHexOf,
|
|
331
|
+
compareSdkVersions: () => compareSdkVersions,
|
|
310
332
|
compressArray: () => compressArray,
|
|
311
333
|
compressString: () => compressString,
|
|
312
334
|
computeActiveChips: () => computeActiveChips,
|
|
@@ -471,6 +493,8 @@ __export(src_exports3, {
|
|
|
471
493
|
scopedAttributeKey: () => scopedAttributeKey,
|
|
472
494
|
scrollEventTarget: () => scrollEventTarget,
|
|
473
495
|
scrollPaddingTopOf: () => scrollPaddingTopOf,
|
|
496
|
+
sdkShimsFor: () => sdkShimsFor,
|
|
497
|
+
sdkWindowProblem: () => sdkWindowProblem,
|
|
474
498
|
selectItemVariants: () => selectItemVariants,
|
|
475
499
|
selectedOptionsToRecord: () => selectedOptionsToRecord,
|
|
476
500
|
serverState: () => serverState,
|
|
@@ -667,6 +691,7 @@ __export(analytics_exports2, {
|
|
|
667
691
|
CONSENT_DISPOSITION: () => CONSENT_DISPOSITION,
|
|
668
692
|
DROP_REASONS: () => DROP_REASONS,
|
|
669
693
|
SURFACE_DISPOSITION: () => SURFACE_DISPOSITION,
|
|
694
|
+
TurnScopeProvider: () => TurnScopeProvider,
|
|
670
695
|
consentDisposition: () => consentDisposition,
|
|
671
696
|
createAnalyticsScope: () => createAnalyticsScope,
|
|
672
697
|
defineEventKind: () => defineEventKind,
|
|
@@ -809,7 +834,16 @@ var AnalyticsWireEventSchema = z3.object({
|
|
|
809
834
|
*/
|
|
810
835
|
sessionId: z3.string().min(1).max(128),
|
|
811
836
|
kind: z3.string().min(1).max(128),
|
|
812
|
-
payload: z3.record(z3.unknown())
|
|
837
|
+
payload: z3.record(z3.unknown()),
|
|
838
|
+
/**
|
|
839
|
+
* The agent turn whose canvas the event came from — stamped by the scope
|
|
840
|
+
* from the element the emit ran inside, never by the emit site; `null` when
|
|
841
|
+
* it ran outside any turn (the cart drawer, a root bridge). OPTIONAL because
|
|
842
|
+
* a bundle older than this field omits it, and the envelope's strip posture
|
|
843
|
+
* (header) is what keeps that bundle's batch alive. Lands in the typed
|
|
844
|
+
* `client_events.turn_id` column — the join to `agent_runs.turn_id`.
|
|
845
|
+
*/
|
|
846
|
+
turnId: z3.string().min(1).max(128).nullable().optional()
|
|
813
847
|
});
|
|
814
848
|
var AnalyticsBatchSchema = z3.object({
|
|
815
849
|
/** One mount's whole life. Lets the server see a mount's batches as one
|
|
@@ -948,7 +982,8 @@ var Outbox = class {
|
|
|
948
982
|
occurredAt: event.occurredAt,
|
|
949
983
|
kind: event.kind,
|
|
950
984
|
payload: event.payload,
|
|
951
|
-
sessionId: event.sessionId
|
|
985
|
+
sessionId: event.sessionId,
|
|
986
|
+
turnId: event.turnId === void 0 ? null : event.turnId
|
|
952
987
|
}));
|
|
953
988
|
this.rows.unshift(...restored);
|
|
954
989
|
if (this.rows.length <= this.maxQueued) return;
|
|
@@ -976,7 +1011,8 @@ var Outbox = class {
|
|
|
976
1011
|
occurredAt: row.occurredAt,
|
|
977
1012
|
kind: row.kind,
|
|
978
1013
|
payload: row.payload,
|
|
979
|
-
sessionId
|
|
1014
|
+
sessionId,
|
|
1015
|
+
turnId: row.turnId
|
|
980
1016
|
};
|
|
981
1017
|
stamped += 1;
|
|
982
1018
|
}
|
|
@@ -997,7 +1033,8 @@ var Outbox = class {
|
|
|
997
1033
|
occurredAt: row.occurredAt,
|
|
998
1034
|
sessionId: row.sessionId,
|
|
999
1035
|
kind: row.kind,
|
|
1000
|
-
payload: row.payload
|
|
1036
|
+
payload: row.payload,
|
|
1037
|
+
turnId: row.turnId
|
|
1001
1038
|
});
|
|
1002
1039
|
}
|
|
1003
1040
|
this.rows.length = 0;
|
|
@@ -1064,40 +1101,54 @@ function createEmittingScope(foundation) {
|
|
|
1064
1101
|
events
|
|
1065
1102
|
};
|
|
1066
1103
|
}
|
|
1104
|
+
function record2(turnId, kindName, payload) {
|
|
1105
|
+
try {
|
|
1106
|
+
if (closed) {
|
|
1107
|
+
ledger.record("scope-closed", 1, "an event arrived while the scope was closed");
|
|
1108
|
+
return;
|
|
1109
|
+
}
|
|
1110
|
+
const disposition = consentDisposition(consent);
|
|
1111
|
+
if (disposition.mode === "refuse") {
|
|
1112
|
+
ledger.record("consent-withheld", 1, disposition.because);
|
|
1113
|
+
return;
|
|
1114
|
+
}
|
|
1115
|
+
if (!isWirePayload(payload)) {
|
|
1116
|
+
throw new Error(`payload for "${kindName}" is not an object`);
|
|
1117
|
+
}
|
|
1118
|
+
const row = {
|
|
1119
|
+
eventId: config.newEventId(),
|
|
1120
|
+
// Stamped at EMIT, never at flush: this row may sit here for the
|
|
1121
|
+
// session boot's whole ~94s retry budget.
|
|
1122
|
+
occurredAt: config.now(),
|
|
1123
|
+
kind: kindName,
|
|
1124
|
+
payload,
|
|
1125
|
+
sessionId,
|
|
1126
|
+
turnId
|
|
1127
|
+
};
|
|
1128
|
+
if (disposition.mode === "hold") consentHold.append(row);
|
|
1129
|
+
else outbox.append(row);
|
|
1130
|
+
} catch (err) {
|
|
1131
|
+
ledger.record("emit-threw", 1, err instanceof Error ? err.message : String(err));
|
|
1132
|
+
}
|
|
1133
|
+
}
|
|
1134
|
+
function sinkForTurn(turnId) {
|
|
1135
|
+
return {
|
|
1136
|
+
emit(kind, payload, ...guard) {
|
|
1137
|
+
void guard;
|
|
1138
|
+
record2(turnId, kind.name, payload);
|
|
1139
|
+
},
|
|
1140
|
+
forTurn: sinkForTurn
|
|
1141
|
+
};
|
|
1142
|
+
}
|
|
1067
1143
|
return {
|
|
1068
1144
|
scopeId,
|
|
1069
1145
|
surface: config.surface,
|
|
1070
1146
|
spaceSlug: config.spaceSlug,
|
|
1071
1147
|
emit(kind, payload, ...guard) {
|
|
1072
1148
|
void guard;
|
|
1073
|
-
|
|
1074
|
-
if (closed) {
|
|
1075
|
-
ledger.record("scope-closed", 1, "an event arrived while the scope was closed");
|
|
1076
|
-
return;
|
|
1077
|
-
}
|
|
1078
|
-
const disposition = consentDisposition(consent);
|
|
1079
|
-
if (disposition.mode === "refuse") {
|
|
1080
|
-
ledger.record("consent-withheld", 1, disposition.because);
|
|
1081
|
-
return;
|
|
1082
|
-
}
|
|
1083
|
-
if (!isWirePayload(payload)) {
|
|
1084
|
-
throw new Error(`payload for "${kind.name}" is not an object`);
|
|
1085
|
-
}
|
|
1086
|
-
const row = {
|
|
1087
|
-
eventId: config.newEventId(),
|
|
1088
|
-
// Stamped at EMIT, never at flush: this row may sit here for the
|
|
1089
|
-
// session boot's whole ~94s retry budget.
|
|
1090
|
-
occurredAt: config.now(),
|
|
1091
|
-
kind: kind.name,
|
|
1092
|
-
payload,
|
|
1093
|
-
sessionId
|
|
1094
|
-
};
|
|
1095
|
-
if (disposition.mode === "hold") consentHold.append(row);
|
|
1096
|
-
else outbox.append(row);
|
|
1097
|
-
} catch (err) {
|
|
1098
|
-
ledger.record("emit-threw", 1, err instanceof Error ? err.message : String(err));
|
|
1099
|
-
}
|
|
1149
|
+
record2(null, kind.name, payload);
|
|
1100
1150
|
},
|
|
1151
|
+
forTurn: sinkForTurn,
|
|
1101
1152
|
bindSession(nextSessionId) {
|
|
1102
1153
|
if (nextSessionId.length === 0) {
|
|
1103
1154
|
throw new Error("[fourty/analytics] bindSession requires a non-empty session id");
|
|
@@ -1214,6 +1265,11 @@ function createInertScope(foundation, because) {
|
|
|
1214
1265
|
void guard;
|
|
1215
1266
|
ledger.record("surface-suppressed", 1, because);
|
|
1216
1267
|
},
|
|
1268
|
+
/** Suppressed either way — a turn changes nothing about a surface that
|
|
1269
|
+
* records nothing. */
|
|
1270
|
+
forTurn() {
|
|
1271
|
+
return this;
|
|
1272
|
+
},
|
|
1217
1273
|
/** Nothing is held, so there is nothing to attribute. The mount calls this
|
|
1218
1274
|
* on every surface; making it a no-op here is what keeps the mount free of
|
|
1219
1275
|
* a surface branch. */
|
|
@@ -1331,11 +1387,17 @@ function createAnalyticsScope(config) {
|
|
|
1331
1387
|
}
|
|
1332
1388
|
|
|
1333
1389
|
// src/analytics/scope-context.tsx
|
|
1334
|
-
import { createContext, useContext } from "react";
|
|
1390
|
+
import { createContext, useContext, useMemo } from "react";
|
|
1335
1391
|
var AnalyticsSinkContext = createContext(null);
|
|
1336
1392
|
var AnalyticsSinkProvider = AnalyticsSinkContext.Provider;
|
|
1393
|
+
var TurnScopeContext = createContext(null);
|
|
1394
|
+
var TurnScopeProvider = TurnScopeContext.Provider;
|
|
1395
|
+
function useTurnAttributed(sink) {
|
|
1396
|
+
const turnId = useContext(TurnScopeContext);
|
|
1397
|
+
return useMemo(() => sink === null || turnId === null ? sink : sink.forTurn(turnId), [sink, turnId]);
|
|
1398
|
+
}
|
|
1337
1399
|
function useAnalyticsSink() {
|
|
1338
|
-
const sink = useContext(AnalyticsSinkContext);
|
|
1400
|
+
const sink = useTurnAttributed(useContext(AnalyticsSinkContext));
|
|
1339
1401
|
if (sink === null) {
|
|
1340
1402
|
throw new Error(
|
|
1341
1403
|
"useAnalyticsSink must be used within <AnalyticsScopeMount> (inside <FourtyProvider>)"
|
|
@@ -1345,7 +1407,7 @@ function useAnalyticsSink() {
|
|
|
1345
1407
|
}
|
|
1346
1408
|
var warnedMissingSink = false;
|
|
1347
1409
|
function useOptionalAnalyticsSink() {
|
|
1348
|
-
const sink = useContext(AnalyticsSinkContext);
|
|
1410
|
+
const sink = useTurnAttributed(useContext(AnalyticsSinkContext));
|
|
1349
1411
|
if (sink === null && !warnedMissingSink && typeof window !== "undefined") {
|
|
1350
1412
|
warnedMissingSink = true;
|
|
1351
1413
|
console.warn(
|
|
@@ -1395,9 +1457,14 @@ import { useCallback } from "react";
|
|
|
1395
1457
|
// ../spacestation/src/index.ts
|
|
1396
1458
|
var src_exports = {};
|
|
1397
1459
|
__export(src_exports, {
|
|
1460
|
+
AGENT_DIRECTIVE_KINDS: () => AGENT_DIRECTIVE_KINDS,
|
|
1461
|
+
AGENT_DIRECTIVE_SEVERITIES: () => AGENT_DIRECTIVE_SEVERITIES,
|
|
1462
|
+
AGENT_DIRECTIVE_SOURCES: () => AGENT_DIRECTIVE_SOURCES,
|
|
1463
|
+
AGENT_DIRECTIVE_STATUSES: () => AGENT_DIRECTIVE_STATUSES,
|
|
1398
1464
|
ALLOWED_ATTACHMENT_TYPES: () => ALLOWED_ATTACHMENT_TYPES,
|
|
1399
1465
|
ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
|
|
1400
1466
|
ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
|
|
1467
|
+
AgentDirectiveSchema: () => AgentDirectiveSchema,
|
|
1401
1468
|
AgentOutputSchema: () => AgentOutputSchema,
|
|
1402
1469
|
AgentSessionSummarySchema: () => AgentSessionSummarySchema,
|
|
1403
1470
|
AgentSignalSchema: () => AgentSignalSchema,
|
|
@@ -1463,17 +1530,21 @@ __export(src_exports, {
|
|
|
1463
1530
|
LlmSessionsDailySchema: () => LlmSessionsDailySchema,
|
|
1464
1531
|
LlmUsageBySessionSchema: () => LlmUsageBySessionSchema,
|
|
1465
1532
|
LlmUsageDailySchema: () => LlmUsageDailySchema,
|
|
1533
|
+
MAX_ACTIVE_AGENT_DIRECTIVES: () => MAX_ACTIVE_AGENT_DIRECTIVES,
|
|
1466
1534
|
MAX_ATTACHMENT_BYTES: () => MAX_ATTACHMENT_BYTES,
|
|
1467
1535
|
MAX_VISITOR_PROMPT_CHARS: () => MAX_VISITOR_PROMPT_CHARS,
|
|
1536
|
+
MIN_WIRE_PROTOCOL_VERSION: () => MIN_WIRE_PROTOCOL_VERSION,
|
|
1468
1537
|
MOBILE_VIEWPORT_MAX: () => MOBILE_VIEWPORT_MAX,
|
|
1469
1538
|
NAVIGATE_SIGNAL: () => NAVIGATE_SIGNAL,
|
|
1470
1539
|
NavigatePayloadSchema: () => NavigatePayloadSchema,
|
|
1540
|
+
OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
|
|
1471
1541
|
PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
1472
1542
|
PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
|
|
1473
1543
|
PRESENCE_FLOW: () => PRESENCE_FLOW,
|
|
1474
1544
|
PRESENCE_OPTIMISTIC_FACTS_FLOW: () => PRESENCE_OPTIMISTIC_FACTS_FLOW,
|
|
1475
1545
|
PRODUCT_SELECT_OPTION_SIGNAL: () => PRODUCT_SELECT_OPTION_SIGNAL,
|
|
1476
1546
|
PROJECTION_SET_SIGNAL: () => PROJECTION_SET_SIGNAL,
|
|
1547
|
+
PackageBundleRefSchema: () => PackageBundleRefSchema,
|
|
1477
1548
|
PackageReleaseSchema: () => PackageReleaseSchema,
|
|
1478
1549
|
PageSchema: () => PageSchema,
|
|
1479
1550
|
PatchSchema: () => PatchSchema,
|
|
@@ -1485,11 +1556,16 @@ __export(src_exports, {
|
|
|
1485
1556
|
RESERVED_ID_SET: () => RESERVED_ID_SET,
|
|
1486
1557
|
RecordVerdictInputSchema: () => RecordVerdictInputSchema,
|
|
1487
1558
|
RecordableVerdictSchema: () => RecordableVerdictSchema,
|
|
1559
|
+
ReorderAgentDirectivesInputSchema: () => ReorderAgentDirectivesInputSchema,
|
|
1560
|
+
SDK_SHIMS: () => SDK_SHIMS,
|
|
1561
|
+
SDK_VERSION_PATTERN: () => SDK_VERSION_PATTERN,
|
|
1488
1562
|
SELECTION_ORIGIN_VISITOR: () => SELECTION_ORIGIN_VISITOR,
|
|
1489
1563
|
SIGNAL_PATCH_PREFIX: () => SIGNAL_PATCH_PREFIX,
|
|
1564
|
+
SOCKET_TICKET_PARAM: () => SOCKET_TICKET_PARAM,
|
|
1490
1565
|
STRUCTURAL_BASELINE_CATALOG: () => STRUCTURAL_BASELINE_CATALOG,
|
|
1491
1566
|
STRUCTURAL_BASELINE_TYPES: () => STRUCTURAL_BASELINE_TYPES,
|
|
1492
1567
|
SURFACES: () => SURFACES,
|
|
1568
|
+
SdkVersionSchema: () => SdkVersionSchema,
|
|
1493
1569
|
SessionActivityEventSchema: () => SessionActivityEventSchema,
|
|
1494
1570
|
SessionActivitySchema: () => SessionActivitySchema,
|
|
1495
1571
|
SessionArrivalSchema: () => SessionArrivalSchema,
|
|
@@ -1509,6 +1585,8 @@ __export(src_exports, {
|
|
|
1509
1585
|
SessionVerdictSchema: () => SessionVerdictSchema,
|
|
1510
1586
|
ShellConfigSchema: () => ShellConfigSchema,
|
|
1511
1587
|
ShellMenuItemSchema: () => ShellMenuItemSchema,
|
|
1588
|
+
SpaceAgentDirectiveListItemSchema: () => SpaceAgentDirectiveListItemSchema,
|
|
1589
|
+
SpaceAgentDirectiveSchema: () => SpaceAgentDirectiveSchema,
|
|
1512
1590
|
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
1513
1591
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
1514
1592
|
SpecSchema: () => SpecSchema,
|
|
@@ -1526,6 +1604,7 @@ __export(src_exports, {
|
|
|
1526
1604
|
TurnAskSchema: () => TurnAskSchema,
|
|
1527
1605
|
UIElementSchema: () => UIElementSchema,
|
|
1528
1606
|
UnsupportedSchemaError: () => UnsupportedSchemaError,
|
|
1607
|
+
UpdateAgentDirectiveInputSchema: () => UpdateAgentDirectiveInputSchema,
|
|
1529
1608
|
UpdateCommentInputSchema: () => UpdateCommentInputSchema,
|
|
1530
1609
|
VARIANT_SELECTED_OBSERVATION: () => VARIANT_SELECTED_OBSERVATION,
|
|
1531
1610
|
VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -1539,6 +1618,9 @@ __export(src_exports, {
|
|
|
1539
1618
|
ViewSchema: () => ViewSchema,
|
|
1540
1619
|
ViewportFocusSchema: () => ViewportFocusSchema,
|
|
1541
1620
|
VisitorIdDurabilitySchema: () => VisitorIdDurabilitySchema,
|
|
1621
|
+
WIRE_PROTOCOL_PARAM: () => WIRE_PROTOCOL_PARAM,
|
|
1622
|
+
WIRE_PROTOCOL_UNSUPPORTED_CLOSE: () => WIRE_PROTOCOL_UNSUPPORTED_CLOSE,
|
|
1623
|
+
WIRE_PROTOCOL_VERSION: () => WIRE_PROTOCOL_VERSION,
|
|
1542
1624
|
WORKSPACE_THEME_PACKAGES: () => WORKSPACE_THEME_PACKAGES,
|
|
1543
1625
|
WireCatalogEntrySchema: () => WireCatalogEntrySchema,
|
|
1544
1626
|
WireCatalogSchema: () => WireCatalogSchema,
|
|
@@ -1554,6 +1636,7 @@ __export(src_exports, {
|
|
|
1554
1636
|
catalogToWire: () => catalogToWire,
|
|
1555
1637
|
collectElementEntityRefs: () => collectElementEntityRefs,
|
|
1556
1638
|
collectPlacedEntityRefs: () => collectPlacedEntityRefs,
|
|
1639
|
+
compareSdkVersions: () => compareSdkVersions,
|
|
1557
1640
|
compressArray: () => compressArray,
|
|
1558
1641
|
compressString: () => compressString,
|
|
1559
1642
|
createTokenOverlapScorer: () => createTokenOverlapScorer,
|
|
@@ -1604,6 +1687,8 @@ __export(src_exports, {
|
|
|
1604
1687
|
schemaToWire: () => schemaToWire,
|
|
1605
1688
|
scopeOfAttributeKey: () => scopeOfAttributeKey,
|
|
1606
1689
|
scopedAttributeKey: () => scopedAttributeKey,
|
|
1690
|
+
sdkShimsFor: () => sdkShimsFor,
|
|
1691
|
+
sdkWindowProblem: () => sdkWindowProblem,
|
|
1607
1692
|
settledBlocks: () => settledBlocks,
|
|
1608
1693
|
splitSentences: () => splitSentences,
|
|
1609
1694
|
stateSnapshotSignal: () => stateSnapshotSignal,
|
|
@@ -2162,8 +2247,8 @@ var MIN_CHOICE_ANSWERS = 2;
|
|
|
2162
2247
|
var MAX_CHOICE_ANSWERS = 4;
|
|
2163
2248
|
var AnswerPartSchema = z14.object({ answer: z14.string().trim().min(1) });
|
|
2164
2249
|
var PartSchema = z14.union([z14.string(), AnswerPartSchema]);
|
|
2165
|
-
function partsText(
|
|
2166
|
-
return
|
|
2250
|
+
function partsText(parts2) {
|
|
2251
|
+
return parts2.map((p) => typeof p === "string" ? p : p.answer).join("");
|
|
2167
2252
|
}
|
|
2168
2253
|
var ModelTurnAskSchema = z14.object({
|
|
2169
2254
|
kind: z14.enum(["choice", "open"]),
|
|
@@ -2772,6 +2857,8 @@ function isElementUnfilled(element, catalog, aliases, options) {
|
|
|
2772
2857
|
const props = element.props;
|
|
2773
2858
|
for (const { path, meta } of getResolvedPaths(entry.propsSchema)) {
|
|
2774
2859
|
if (options?.requireMaterialized !== true && derivedSourceFilled(meta, props)) continue;
|
|
2860
|
+
const top = path[0];
|
|
2861
|
+
if (typeof top === "string" && isOptionalTopLevelProp(entry.propsSchema, top)) continue;
|
|
2775
2862
|
const expansions = Array.from(expandPath(props, path));
|
|
2776
2863
|
if (expansions.length === 0) return true;
|
|
2777
2864
|
for (const { value } of expansions) {
|
|
@@ -3312,7 +3399,7 @@ function catalogFromWire(wire) {
|
|
|
3312
3399
|
}
|
|
3313
3400
|
|
|
3314
3401
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
3315
|
-
import { z as
|
|
3402
|
+
import { z as z27 } from "zod";
|
|
3316
3403
|
|
|
3317
3404
|
// ../spacestation/src/catalog/wire/brand-mark.ts
|
|
3318
3405
|
import { z as z25 } from "zod";
|
|
@@ -3333,20 +3420,76 @@ var BrandMarkSchema = z25.object({ square: BrandMarkFileSchema.optional(), wordm
|
|
|
3333
3420
|
var BrandMarkImageSchema = z25.object({ src: z25.string().min(1), type: z25.enum(BRAND_MARK_TYPES) }).strict();
|
|
3334
3421
|
var SpaceBrandMarkSchema = z25.object({ square: BrandMarkImageSchema.nullable(), wordmark: BrandMarkImageSchema.nullable() }).strict();
|
|
3335
3422
|
|
|
3423
|
+
// ../spacestation/src/catalog/wire/sdk-compat.ts
|
|
3424
|
+
import { z as z26 } from "zod";
|
|
3425
|
+
var SDK_VERSION_PATTERN = /^\d{1,4}\.\d{1,4}\.\d{1,4}(-[0-9A-Za-z.]{1,32})?$/;
|
|
3426
|
+
var SdkVersionSchema = z26.string().regex(SDK_VERSION_PATTERN, "an sdk version is major.minor.patch");
|
|
3427
|
+
var OLDEST_SUPPORTED_SDK = "0.3.0";
|
|
3428
|
+
var SDK_SHIMS = {
|
|
3429
|
+
/** sdk ≤ 0.3 called the vertical verbs on `useCanvasActions()` — `legacy-canvas-actions.ts`. */
|
|
3430
|
+
legacyCanvasActions: { below: "0.4.0" }
|
|
3431
|
+
};
|
|
3432
|
+
function parts(version2) {
|
|
3433
|
+
const dash = version2.indexOf("-");
|
|
3434
|
+
const core = (dash === -1 ? version2 : version2.slice(0, dash)).split(".").map(Number);
|
|
3435
|
+
return { core, pre: dash === -1 ? null : version2.slice(dash + 1) };
|
|
3436
|
+
}
|
|
3437
|
+
function compareSdkVersions(a, b) {
|
|
3438
|
+
const pa = parts(a);
|
|
3439
|
+
const pb = parts(b);
|
|
3440
|
+
for (let i = 0; i < 3; i++) {
|
|
3441
|
+
const diff = pa.core[i] - pb.core[i];
|
|
3442
|
+
if (diff !== 0) return diff;
|
|
3443
|
+
}
|
|
3444
|
+
if (pa.pre === pb.pre) return 0;
|
|
3445
|
+
if (pa.pre === null) return 1;
|
|
3446
|
+
if (pb.pre === null) return -1;
|
|
3447
|
+
return pa.pre.localeCompare(pb.pre, "en", { numeric: true });
|
|
3448
|
+
}
|
|
3449
|
+
function sdkShimsFor(builtWithSdk) {
|
|
3450
|
+
const out = [];
|
|
3451
|
+
for (const shim of Object.keys(SDK_SHIMS)) {
|
|
3452
|
+
if (!isSdkShim(shim)) continue;
|
|
3453
|
+
if (builtWithSdk === void 0 || compareSdkVersions(builtWithSdk, SDK_SHIMS[shim].below) < 0) out.push(shim);
|
|
3454
|
+
}
|
|
3455
|
+
return out;
|
|
3456
|
+
}
|
|
3457
|
+
function isSdkShim(key) {
|
|
3458
|
+
return key in SDK_SHIMS;
|
|
3459
|
+
}
|
|
3460
|
+
function sdkWindowProblem(builtWithSdk, platformSdk) {
|
|
3461
|
+
if (builtWithSdk === void 0) return null;
|
|
3462
|
+
if (compareSdkVersions(builtWithSdk, OLDEST_SUPPORTED_SDK) < 0) {
|
|
3463
|
+
return `built with @40rty/ams-sdk ${builtWithSdk}; this platform hosts ${OLDEST_SUPPORTED_SDK} to ${platformSdk} \u2014 upgrade @40rty/ams-sdk and publish again`;
|
|
3464
|
+
}
|
|
3465
|
+
if (compareSdkVersions(builtWithSdk, platformSdk) > 0) {
|
|
3466
|
+
return `built with @40rty/ams-sdk ${builtWithSdk}, newer than the ${platformSdk} this platform serves \u2014 build against ${platformSdk} or older`;
|
|
3467
|
+
}
|
|
3468
|
+
return null;
|
|
3469
|
+
}
|
|
3470
|
+
|
|
3336
3471
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
3337
3472
|
var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
|
|
3338
3473
|
var BUNDLE_ASSET_PATH = /^assets\/[A-Za-z0-9_-]+\.(woff2?|ttf|otf|png|jpe?g|svg|gif|webp)$/;
|
|
3339
|
-
var PackageReleaseSchema =
|
|
3474
|
+
var PackageReleaseSchema = z27.object({
|
|
3340
3475
|
/** The id spaces name in `componentSources` — an npm-style package name. */
|
|
3341
|
-
sourceId:
|
|
3342
|
-
label:
|
|
3476
|
+
sourceId: z27.string().regex(/^(@[a-z0-9][a-z0-9-]*\/)?[a-z0-9][a-z0-9-]*$/, "sourceId must be an npm-style package name").refine((id) => !RESERVED_SCOPES.some((scope2) => id.startsWith(scope2)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
|
|
3477
|
+
label: z27.string().min(1).max(120),
|
|
3343
3478
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
3344
|
-
version:
|
|
3479
|
+
version: z27.string().min(1).max(40),
|
|
3345
3480
|
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
3346
|
-
description:
|
|
3481
|
+
description: z27.string().min(1).max(500).optional(),
|
|
3482
|
+
/**
|
|
3483
|
+
* The `@40rty/ams-sdk` version the brand project resolved when `forty
|
|
3484
|
+
* publish` built this release. A bundle takes the sdk from the page at
|
|
3485
|
+
* runtime, so this is what tells the platform which compat shims it needs
|
|
3486
|
+
* and whether it can host it at all (`sdk-compat.ts`). Absent on releases
|
|
3487
|
+
* published before the stamp existed — those are legacy.
|
|
3488
|
+
*/
|
|
3489
|
+
builtWithSdk: SdkVersionSchema.optional(),
|
|
3347
3490
|
catalog: WireCatalogSchema,
|
|
3348
3491
|
/** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
|
|
3349
|
-
manifests:
|
|
3492
|
+
manifests: z27.record(z27.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z27.string()),
|
|
3350
3493
|
/**
|
|
3351
3494
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
3352
3495
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
@@ -3355,17 +3498,17 @@ var PackageReleaseSchema = z26.object({
|
|
|
3355
3498
|
* images — base64, keyed by the path the stylesheet's `url()` names, beside
|
|
3356
3499
|
* it). It is served to browsers; the platform's servers never run it.
|
|
3357
3500
|
*/
|
|
3358
|
-
bundle:
|
|
3359
|
-
js:
|
|
3360
|
-
css:
|
|
3361
|
-
assets:
|
|
3501
|
+
bundle: z27.object({
|
|
3502
|
+
js: z27.string().min(1),
|
|
3503
|
+
css: z27.string(),
|
|
3504
|
+
assets: z27.record(z27.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z27.string().base64()).optional()
|
|
3362
3505
|
}).strict().optional(),
|
|
3363
3506
|
/**
|
|
3364
3507
|
* The class the spacefront root carries while this package is the space's.
|
|
3365
3508
|
* The package's own stylesheet styles under it. Absent = the platform's
|
|
3366
3509
|
* default theme class.
|
|
3367
3510
|
*/
|
|
3368
|
-
theme:
|
|
3511
|
+
theme: z27.object({ themeClass: z27.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
|
|
3369
3512
|
/**
|
|
3370
3513
|
* The brand's mark (`brand-mark.ts`). Sent as the files themselves; the
|
|
3371
3514
|
* platform stores them content-addressed at ingest and keeps only their
|
|
@@ -3378,17 +3521,25 @@ var PackageReleaseSchema = z26.object({
|
|
|
3378
3521
|
* The package's own composition guidance for its own components — prompt
|
|
3379
3522
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
3380
3523
|
*/
|
|
3381
|
-
promptSections:
|
|
3524
|
+
promptSections: z27.array(z27.object({ id: z27.string().regex(/^[a-z0-9-]+$/), order: z27.number().int(), content: z27.string().min(1).max(2e4), requires: z27.array(z27.string()) }).strict()).max(10).optional(),
|
|
3525
|
+
/**
|
|
3526
|
+
* The brand's SPACE prompt — its `prompts/space.md`, verbatim: sections split
|
|
3527
|
+
* by `<!-- section:<id> -->` markers, the same format as the platform's
|
|
3528
|
+
* `prompts/spaces/<slug>.md`, which it replaces for any space bound to this
|
|
3529
|
+
* package. How the brand speaks, what it sells and what it never claims ship
|
|
3530
|
+
* with the brand, and a release changes them with no platform deploy.
|
|
3531
|
+
*/
|
|
3532
|
+
spacePrompt: z27.string().min(1).max(2e5).optional(),
|
|
3382
3533
|
/**
|
|
3383
3534
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
3384
3535
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
3385
3536
|
*/
|
|
3386
|
-
config:
|
|
3537
|
+
config: z27.record(z27.string(), z27.unknown()).optional(),
|
|
3387
3538
|
/**
|
|
3388
3539
|
* Set by the platform, never by a publisher: this release is a DRAFT of the
|
|
3389
3540
|
* package `of`, previewed on the space `space`. See `draftSourceId`.
|
|
3390
3541
|
*/
|
|
3391
|
-
draft:
|
|
3542
|
+
draft: z27.object({ of: z27.string().min(1), space: z27.string().min(1) }).strict().optional()
|
|
3392
3543
|
}).strict();
|
|
3393
3544
|
var DRAFT_SEPARATOR = "--";
|
|
3394
3545
|
function draftSourceId(sourceId, spaceSlug, developer) {
|
|
@@ -3406,37 +3557,50 @@ function parseReleasePreview(id) {
|
|
|
3406
3557
|
return { sourceId: match[1], release: Number(match[2]) };
|
|
3407
3558
|
}
|
|
3408
3559
|
|
|
3560
|
+
// ../spacestation/src/catalog/wire/package-bundle-ref.ts
|
|
3561
|
+
import { z as z28 } from "zod";
|
|
3562
|
+
var PackageBundleRefSchema = z28.object({
|
|
3563
|
+
sourceId: z28.string(),
|
|
3564
|
+
js: z28.string(),
|
|
3565
|
+
css: z28.string(),
|
|
3566
|
+
/** The brand's name for itself, and its package's version. */
|
|
3567
|
+
label: z28.string(),
|
|
3568
|
+
version: z28.string(),
|
|
3569
|
+
/** The sdk the bundle was built against (`PackageRelease.builtWithSdk`) — absent for a legacy release. Picks its compat shims. */
|
|
3570
|
+
builtWithSdk: SdkVersionSchema.optional()
|
|
3571
|
+
});
|
|
3572
|
+
|
|
3409
3573
|
// ../spacestation/src/projection/projection.ts
|
|
3410
|
-
import { z as
|
|
3411
|
-
var LateBoundValueSchema =
|
|
3412
|
-
var DirectiveValueSchema =
|
|
3413
|
-
|
|
3414
|
-
|
|
3415
|
-
|
|
3574
|
+
import { z as z29 } from "zod";
|
|
3575
|
+
var LateBoundValueSchema = z29.object({ fact: z29.literal(true) });
|
|
3576
|
+
var DirectiveValueSchema = z29.union([
|
|
3577
|
+
z29.string(),
|
|
3578
|
+
z29.number(),
|
|
3579
|
+
z29.boolean(),
|
|
3416
3580
|
LateBoundValueSchema
|
|
3417
3581
|
]);
|
|
3418
3582
|
function isLateBound(v) {
|
|
3419
3583
|
return typeof v === "object" && v !== null && "fact" in v;
|
|
3420
3584
|
}
|
|
3421
|
-
var ProjectionDirectiveSchema =
|
|
3585
|
+
var ProjectionDirectiveSchema = z29.object({
|
|
3422
3586
|
/** Keep only items whose axis values all match. Keyed by axis name
|
|
3423
3587
|
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
3424
|
-
isolateTo:
|
|
3588
|
+
isolateTo: z29.record(DirectiveValueSchema).optional(),
|
|
3425
3589
|
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
3426
3590
|
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
3427
3591
|
* entity binding expands it against the entity's own axes + facts. */
|
|
3428
|
-
isolateToFacts:
|
|
3592
|
+
isolateToFacts: z29.boolean().optional(),
|
|
3429
3593
|
/** Keep only items the entity binding reports as available. */
|
|
3430
|
-
availableOnly:
|
|
3594
|
+
availableOnly: z29.boolean().optional(),
|
|
3431
3595
|
/** Cap the rendered count after filtering. */
|
|
3432
|
-
limit:
|
|
3596
|
+
limit: z29.number().int().positive().optional()
|
|
3433
3597
|
});
|
|
3434
|
-
var ProjectionPreferencesSchema =
|
|
3435
|
-
|
|
3598
|
+
var ProjectionPreferencesSchema = z29.record(
|
|
3599
|
+
z29.union([ProjectionDirectiveSchema, z29.null()])
|
|
3436
3600
|
);
|
|
3437
3601
|
var PROJECTION_SET_SIGNAL = "projection.set";
|
|
3438
|
-
var ProjectionSetPayloadSchema =
|
|
3439
|
-
setAll:
|
|
3602
|
+
var ProjectionSetPayloadSchema = z29.object({
|
|
3603
|
+
setAll: z29.union([ProjectionDirectiveSchema, z29.null()]).optional(),
|
|
3440
3604
|
set: ProjectionPreferencesSchema.optional()
|
|
3441
3605
|
});
|
|
3442
3606
|
function norm(v) {
|
|
@@ -3470,23 +3634,23 @@ function isActiveDirective(directive) {
|
|
|
3470
3634
|
}
|
|
3471
3635
|
|
|
3472
3636
|
// ../spacestation/src/focus/focus.ts
|
|
3473
|
-
import { z as
|
|
3637
|
+
import { z as z30 } from "zod";
|
|
3474
3638
|
var VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
|
|
3475
|
-
var FocusElementPayloadSchema =
|
|
3476
|
-
elementId:
|
|
3639
|
+
var FocusElementPayloadSchema = z30.object({
|
|
3640
|
+
elementId: z30.string().min(1)
|
|
3477
3641
|
});
|
|
3478
3642
|
|
|
3479
3643
|
// ../spacestation/src/view/continuation.ts
|
|
3480
|
-
import { z as
|
|
3644
|
+
import { z as z31 } from "zod";
|
|
3481
3645
|
var VIEW_EXTEND_SIGNAL = "view.extend";
|
|
3482
|
-
var ViewExtendPayloadSchema =
|
|
3483
|
-
reason:
|
|
3646
|
+
var ViewExtendPayloadSchema = z31.object({
|
|
3647
|
+
reason: z31.enum(["scroll_near_bottom"])
|
|
3484
3648
|
});
|
|
3485
3649
|
var VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
|
|
3486
3650
|
var CONTINUATION_ENABLED = false;
|
|
3487
3651
|
|
|
3488
3652
|
// ../spacestation/src/attachment/attachment.ts
|
|
3489
|
-
import { z as
|
|
3653
|
+
import { z as z32 } from "zod";
|
|
3490
3654
|
var ALLOWED_ATTACHMENT_TYPES = [
|
|
3491
3655
|
"image/jpeg",
|
|
3492
3656
|
"image/png",
|
|
@@ -3501,34 +3665,36 @@ function isAllowedAttachmentType(mime) {
|
|
|
3501
3665
|
function isImageAttachment(mime) {
|
|
3502
3666
|
return mime.startsWith("image/");
|
|
3503
3667
|
}
|
|
3504
|
-
var AttachmentRefSchema =
|
|
3505
|
-
|
|
3506
|
-
|
|
3668
|
+
var AttachmentRefSchema = z32.object({
|
|
3669
|
+
// A UUID, as `storeAttachment` mints it: the id becomes a storage path segment,
|
|
3670
|
+
// so nothing else — no `/`, no `..` — may reach that lookup.
|
|
3671
|
+
id: z32.string().uuid(),
|
|
3672
|
+
mimeType: z32.string().refine(isAllowedAttachmentType, {
|
|
3507
3673
|
message: "mimeType not on the attachment allow-list"
|
|
3508
3674
|
}),
|
|
3509
|
-
name:
|
|
3510
|
-
size:
|
|
3511
|
-
url:
|
|
3675
|
+
name: z32.string().min(1),
|
|
3676
|
+
size: z32.number().int().positive().max(MAX_ATTACHMENT_BYTES),
|
|
3677
|
+
url: z32.string().min(1)
|
|
3512
3678
|
});
|
|
3513
|
-
var AttachmentRefsSchema =
|
|
3679
|
+
var AttachmentRefsSchema = z32.array(AttachmentRefSchema);
|
|
3514
3680
|
|
|
3515
3681
|
// ../spacestation/src/contracts/entry-context.ts
|
|
3516
|
-
import { z as
|
|
3682
|
+
import { z as z33 } from "zod";
|
|
3517
3683
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
3518
3684
|
var ENTRY_CONTEXT_MAX_KEYS = 12;
|
|
3519
3685
|
var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
|
|
3520
3686
|
var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
|
|
3521
|
-
var EntryContextValueSchema =
|
|
3522
|
-
var EntryContextNameSchema =
|
|
3523
|
-
var EntryContextNamespaceSchema =
|
|
3687
|
+
var EntryContextValueSchema = z33.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
|
|
3688
|
+
var EntryContextNameSchema = z33.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
|
|
3689
|
+
var EntryContextNamespaceSchema = z33.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
|
|
3524
3690
|
message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
|
|
3525
3691
|
});
|
|
3526
|
-
var EntryContextSchema =
|
|
3692
|
+
var EntryContextSchema = z33.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
|
|
3527
3693
|
message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
|
|
3528
3694
|
});
|
|
3529
3695
|
|
|
3530
3696
|
// ../spacestation/src/contracts/session-arrival.ts
|
|
3531
|
-
import { z as
|
|
3697
|
+
import { z as z34 } from "zod";
|
|
3532
3698
|
var SURFACES = [
|
|
3533
3699
|
"spacefront",
|
|
3534
3700
|
"embed",
|
|
@@ -3538,11 +3704,11 @@ var SURFACES = [
|
|
|
3538
3704
|
"playground",
|
|
3539
3705
|
"automation"
|
|
3540
3706
|
];
|
|
3541
|
-
var SurfaceSchema =
|
|
3707
|
+
var SurfaceSchema = z34.enum(SURFACES);
|
|
3542
3708
|
var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
|
|
3543
|
-
var ClickIdKindSchema =
|
|
3709
|
+
var ClickIdKindSchema = z34.enum(CLICK_ID_KINDS);
|
|
3544
3710
|
var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
|
|
3545
|
-
var VisitorIdDurabilitySchema =
|
|
3711
|
+
var VisitorIdDurabilitySchema = z34.enum(VISITOR_ID_DURABILITIES);
|
|
3546
3712
|
var TRAFFIC_BUCKETS = [
|
|
3547
3713
|
"paid_google",
|
|
3548
3714
|
"paid_meta",
|
|
@@ -3554,10 +3720,10 @@ var TRAFFIC_BUCKETS = [
|
|
|
3554
3720
|
"direct",
|
|
3555
3721
|
"unknown"
|
|
3556
3722
|
];
|
|
3557
|
-
var TrafficBucketSchema =
|
|
3723
|
+
var TrafficBucketSchema = z34.enum(TRAFFIC_BUCKETS);
|
|
3558
3724
|
var ARRIVAL_MAX_VALUE_CHARS = 200;
|
|
3559
|
-
var ArrivalValueSchema =
|
|
3560
|
-
var SessionArrivalSchema =
|
|
3725
|
+
var ArrivalValueSchema = z34.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
|
|
3726
|
+
var SessionArrivalSchema = z34.object({
|
|
3561
3727
|
utmSource: ArrivalValueSchema.optional(),
|
|
3562
3728
|
utmMedium: ArrivalValueSchema.optional(),
|
|
3563
3729
|
utmCampaign: ArrivalValueSchema.optional(),
|
|
@@ -3643,37 +3809,46 @@ function arrivalToParams(arrival, into) {
|
|
|
3643
3809
|
if (arrival.visitorIdDurability !== void 0) into.set("visitorIdDurability", arrival.visitorIdDurability);
|
|
3644
3810
|
}
|
|
3645
3811
|
|
|
3812
|
+
// ../spacestation/src/contracts/socket-ticket-param.ts
|
|
3813
|
+
var SOCKET_TICKET_PARAM = "ticket";
|
|
3814
|
+
|
|
3815
|
+
// ../spacestation/src/contracts/wire-protocol.ts
|
|
3816
|
+
var WIRE_PROTOCOL_VERSION = 1;
|
|
3817
|
+
var MIN_WIRE_PROTOCOL_VERSION = 1;
|
|
3818
|
+
var WIRE_PROTOCOL_PARAM = "protocol";
|
|
3819
|
+
var WIRE_PROTOCOL_UNSUPPORTED_CLOSE = 4426;
|
|
3820
|
+
|
|
3646
3821
|
// ../spacestation/src/catalog/attribute-registry.ts
|
|
3647
|
-
import { z as
|
|
3648
|
-
var AttributeScopeBucketSchema =
|
|
3649
|
-
scope:
|
|
3650
|
-
needles:
|
|
3651
|
-
label:
|
|
3822
|
+
import { z as z35 } from "zod";
|
|
3823
|
+
var AttributeScopeBucketSchema = z35.object({
|
|
3824
|
+
scope: z35.string(),
|
|
3825
|
+
needles: z35.array(z35.string()).readonly(),
|
|
3826
|
+
label: z35.string().optional()
|
|
3652
3827
|
});
|
|
3653
|
-
var AttributeScopeConfigSchema =
|
|
3654
|
-
facet:
|
|
3655
|
-
buckets:
|
|
3656
|
-
emptyScope:
|
|
3657
|
-
noMatchScope:
|
|
3658
|
-
ignoreValues:
|
|
3659
|
-
emptyScopeLabel:
|
|
3660
|
-
noMatchScopeLabel:
|
|
3828
|
+
var AttributeScopeConfigSchema = z35.object({
|
|
3829
|
+
facet: z35.string(),
|
|
3830
|
+
buckets: z35.array(AttributeScopeBucketSchema).readonly(),
|
|
3831
|
+
emptyScope: z35.string(),
|
|
3832
|
+
noMatchScope: z35.string(),
|
|
3833
|
+
ignoreValues: z35.array(z35.string()).readonly(),
|
|
3834
|
+
emptyScopeLabel: z35.string().optional(),
|
|
3835
|
+
noMatchScopeLabel: z35.string().optional()
|
|
3661
3836
|
});
|
|
3662
|
-
var AttributeDefBaseSchema =
|
|
3663
|
-
description:
|
|
3664
|
-
durable:
|
|
3665
|
-
label:
|
|
3837
|
+
var AttributeDefBaseSchema = z35.object({
|
|
3838
|
+
description: z35.string().optional(),
|
|
3839
|
+
durable: z35.boolean().optional(),
|
|
3840
|
+
label: z35.string().optional()
|
|
3666
3841
|
});
|
|
3667
|
-
var AttributeDefSchema =
|
|
3668
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3669
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3670
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3671
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
3842
|
+
var AttributeDefSchema = z35.discriminatedUnion("kind", [
|
|
3843
|
+
AttributeDefBaseSchema.extend({ kind: z35.literal("enum"), values: z35.array(z35.string()) }),
|
|
3844
|
+
AttributeDefBaseSchema.extend({ kind: z35.literal("free_text") }),
|
|
3845
|
+
AttributeDefBaseSchema.extend({ kind: z35.literal("date_or_season") }),
|
|
3846
|
+
AttributeDefBaseSchema.extend({ kind: z35.literal("money_or_band") }),
|
|
3672
3847
|
AttributeDefBaseSchema.extend({
|
|
3673
|
-
kind:
|
|
3674
|
-
min:
|
|
3675
|
-
max:
|
|
3676
|
-
unit:
|
|
3848
|
+
kind: z35.literal("number"),
|
|
3849
|
+
min: z35.number().optional(),
|
|
3850
|
+
max: z35.number().optional(),
|
|
3851
|
+
unit: z35.string().optional()
|
|
3677
3852
|
})
|
|
3678
3853
|
]);
|
|
3679
3854
|
var EXTRAS_PREFIX = "extras.";
|
|
@@ -3711,6 +3886,51 @@ function scopeOfAttributeKey(config, key) {
|
|
|
3711
3886
|
return match;
|
|
3712
3887
|
}
|
|
3713
3888
|
|
|
3889
|
+
// ../spacestation/src/space/agent-directive.ts
|
|
3890
|
+
import { z as z36 } from "zod";
|
|
3891
|
+
var MAX_ACTIVE_AGENT_DIRECTIVES = 12;
|
|
3892
|
+
var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
|
|
3893
|
+
var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
|
|
3894
|
+
var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
|
|
3895
|
+
var AGENT_DIRECTIVE_STATUSES = ["proposed", "active", "rejected", "retired"];
|
|
3896
|
+
var AgentDirectiveSchema = z36.object({
|
|
3897
|
+
name: z36.string().trim().min(1).max(80),
|
|
3898
|
+
kind: z36.enum(AGENT_DIRECTIVE_KINDS),
|
|
3899
|
+
severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
3900
|
+
/** No bare URL: a URL is a hallucination surface, and a handle is not a
|
|
3901
|
+
* product name. */
|
|
3902
|
+
text: z36.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
|
|
3903
|
+
}).strict();
|
|
3904
|
+
var SpaceAgentDirectiveSchema = z36.object({
|
|
3905
|
+
id: z36.string(),
|
|
3906
|
+
position: z36.number().int(),
|
|
3907
|
+
name: z36.string(),
|
|
3908
|
+
kind: z36.enum(AGENT_DIRECTIVE_KINDS),
|
|
3909
|
+
severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
3910
|
+
text: z36.string(),
|
|
3911
|
+
source: z36.enum(AGENT_DIRECTIVE_SOURCES),
|
|
3912
|
+
status: z36.enum(AGENT_DIRECTIVE_STATUSES),
|
|
3913
|
+
/** Who wrote it; null for a lesson the system proposed. */
|
|
3914
|
+
createdBy: z36.string().nullable(),
|
|
3915
|
+
/** Why a mined lesson was proposed; null for a directive a person wrote. */
|
|
3916
|
+
evidence: z36.record(z36.unknown()).nullable(),
|
|
3917
|
+
decidedBy: z36.string().nullable(),
|
|
3918
|
+
decidedAt: z36.string().nullable(),
|
|
3919
|
+
createdAt: z36.string()
|
|
3920
|
+
});
|
|
3921
|
+
var OutcomeTallySchema = z36.object({ turns: z36.number().int(), acted: z36.number().int() });
|
|
3922
|
+
var SpaceAgentDirectiveListItemSchema = SpaceAgentDirectiveSchema.extend({
|
|
3923
|
+
impact: z36.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
|
|
3924
|
+
});
|
|
3925
|
+
var UpdateAgentDirectiveInputSchema = z36.object({
|
|
3926
|
+
name: AgentDirectiveSchema.shape.name.optional(),
|
|
3927
|
+
kind: AgentDirectiveSchema.shape.kind.optional(),
|
|
3928
|
+
severity: AgentDirectiveSchema.shape.severity.optional(),
|
|
3929
|
+
text: AgentDirectiveSchema.shape.text.optional(),
|
|
3930
|
+
status: z36.enum(AGENT_DIRECTIVE_STATUSES).optional()
|
|
3931
|
+
}).strict();
|
|
3932
|
+
var ReorderAgentDirectivesInputSchema = z36.object({ ids: z36.array(z36.string()).min(1) }).strict();
|
|
3933
|
+
|
|
3714
3934
|
// ../spacestation/src/space/workspace-catalog.ts
|
|
3715
3935
|
var COMPONENT_SOURCE = {
|
|
3716
3936
|
ui: "@fourty/ui"
|
|
@@ -3773,30 +3993,30 @@ function hostingAllows(hosting, surface) {
|
|
|
3773
3993
|
}
|
|
3774
3994
|
|
|
3775
3995
|
// ../spacestation/src/space/trace.ts
|
|
3776
|
-
import { z as
|
|
3777
|
-
var RunTokenUsageSchema =
|
|
3778
|
-
input_tokens:
|
|
3779
|
-
output_tokens:
|
|
3780
|
-
cache_read_tokens:
|
|
3996
|
+
import { z as z37 } from "zod";
|
|
3997
|
+
var RunTokenUsageSchema = z37.object({
|
|
3998
|
+
input_tokens: z37.number().optional(),
|
|
3999
|
+
output_tokens: z37.number().optional(),
|
|
4000
|
+
cache_read_tokens: z37.number().optional()
|
|
3781
4001
|
});
|
|
3782
|
-
var TraceRecordSchema =
|
|
3783
|
-
id:
|
|
3784
|
-
spaceId:
|
|
3785
|
-
sessionId:
|
|
4002
|
+
var TraceRecordSchema = z37.object({
|
|
4003
|
+
id: z37.string().uuid(),
|
|
4004
|
+
spaceId: z37.string().uuid().nullable(),
|
|
4005
|
+
sessionId: z37.string(),
|
|
3786
4006
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
3787
4007
|
* for an unlocked space / anonymous unlock. */
|
|
3788
|
-
visitorEmail:
|
|
3789
|
-
userPrompt:
|
|
3790
|
-
branch:
|
|
3791
|
-
responseText:
|
|
3792
|
-
layout:
|
|
3793
|
-
phaseTimings:
|
|
3794
|
-
tokensByModel:
|
|
3795
|
-
toolCalls:
|
|
3796
|
-
diagnostics:
|
|
3797
|
-
latencyFirstText:
|
|
3798
|
-
latencyFirstPatch:
|
|
3799
|
-
latencyTotal:
|
|
4008
|
+
visitorEmail: z37.string().nullable(),
|
|
4009
|
+
userPrompt: z37.string(),
|
|
4010
|
+
branch: z37.string().nullable(),
|
|
4011
|
+
responseText: z37.string().nullable(),
|
|
4012
|
+
layout: z37.unknown().nullable(),
|
|
4013
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4014
|
+
tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
|
|
4015
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4016
|
+
diagnostics: z37.array(z37.unknown()).nullable(),
|
|
4017
|
+
latencyFirstText: z37.number().int().nullable(),
|
|
4018
|
+
latencyFirstPatch: z37.number().int().nullable(),
|
|
4019
|
+
latencyTotal: z37.number().int().nullable(),
|
|
3800
4020
|
/**
|
|
3801
4021
|
* The CLIENT's turn id for this run, or `null`.
|
|
3802
4022
|
*
|
|
@@ -3812,29 +4032,29 @@ var TraceRecordSchema = z34.object({
|
|
|
3812
4032
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3813
4033
|
* visitor asked something and got nothing.
|
|
3814
4034
|
*/
|
|
3815
|
-
turnId:
|
|
4035
|
+
turnId: z37.string().nullable(),
|
|
3816
4036
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
3817
4037
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
3818
|
-
trackerState:
|
|
3819
|
-
createdAt:
|
|
4038
|
+
trackerState: z37.unknown().nullable(),
|
|
4039
|
+
createdAt: z37.string()
|
|
3820
4040
|
});
|
|
3821
|
-
var MillisecondsSchema =
|
|
3822
|
-
var CreateTraceInputSchema =
|
|
3823
|
-
spaceId:
|
|
3824
|
-
sessionId:
|
|
3825
|
-
visitorEmail:
|
|
3826
|
-
userPrompt:
|
|
3827
|
-
branch:
|
|
3828
|
-
responseText:
|
|
3829
|
-
layout:
|
|
3830
|
-
phaseTimings:
|
|
3831
|
-
tokensByModel:
|
|
3832
|
-
toolCalls:
|
|
3833
|
-
diagnostics:
|
|
4041
|
+
var MillisecondsSchema = z37.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
4042
|
+
var CreateTraceInputSchema = z37.object({
|
|
4043
|
+
spaceId: z37.string().uuid().nullable(),
|
|
4044
|
+
sessionId: z37.string(),
|
|
4045
|
+
visitorEmail: z37.string().nullable(),
|
|
4046
|
+
userPrompt: z37.string(),
|
|
4047
|
+
branch: z37.string().nullable(),
|
|
4048
|
+
responseText: z37.string().nullable(),
|
|
4049
|
+
layout: z37.unknown().nullable(),
|
|
4050
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4051
|
+
tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
|
|
4052
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4053
|
+
diagnostics: z37.array(z37.unknown()).nullable(),
|
|
3834
4054
|
latencyFirstText: MillisecondsSchema,
|
|
3835
4055
|
latencyFirstPatch: MillisecondsSchema,
|
|
3836
4056
|
latencyTotal: MillisecondsSchema,
|
|
3837
|
-
trackerState:
|
|
4057
|
+
trackerState: z37.unknown().nullable(),
|
|
3838
4058
|
/**
|
|
3839
4059
|
* The CLIENT's turn id for this run, or `null`.
|
|
3840
4060
|
*
|
|
@@ -3850,37 +4070,37 @@ var CreateTraceInputSchema = z34.object({
|
|
|
3850
4070
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3851
4071
|
* visitor asked something and got nothing.
|
|
3852
4072
|
*/
|
|
3853
|
-
turnId:
|
|
4073
|
+
turnId: z37.string().nullable()
|
|
3854
4074
|
});
|
|
3855
|
-
var AgentSessionSummarySchema =
|
|
3856
|
-
sessionId:
|
|
4075
|
+
var AgentSessionSummarySchema = z37.object({
|
|
4076
|
+
sessionId: z37.string(),
|
|
3857
4077
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
3858
|
-
turnCount:
|
|
4078
|
+
turnCount: z37.number().int(),
|
|
3859
4079
|
/** The session's opening prompt — titles the row in the UI. */
|
|
3860
|
-
firstPrompt:
|
|
3861
|
-
startedAt:
|
|
3862
|
-
lastRunAt:
|
|
4080
|
+
firstPrompt: z37.string(),
|
|
4081
|
+
startedAt: z37.string(),
|
|
4082
|
+
lastRunAt: z37.string(),
|
|
3863
4083
|
/** Summed `latency_total` across the session's turns. */
|
|
3864
|
-
totalLatencyMs:
|
|
4084
|
+
totalLatencyMs: z37.number().int()
|
|
3865
4085
|
});
|
|
3866
|
-
var SessionTurnSchema =
|
|
3867
|
-
id:
|
|
3868
|
-
userPrompt:
|
|
3869
|
-
responseText:
|
|
4086
|
+
var SessionTurnSchema = z37.object({
|
|
4087
|
+
id: z37.string().uuid(),
|
|
4088
|
+
userPrompt: z37.string(),
|
|
4089
|
+
responseText: z37.string().nullable(),
|
|
3870
4090
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
3871
|
-
layout:
|
|
3872
|
-
createdAt:
|
|
3873
|
-
latencyTotal:
|
|
3874
|
-
phaseTimings:
|
|
3875
|
-
tokensByModel:
|
|
3876
|
-
input_tokens:
|
|
3877
|
-
output_tokens:
|
|
4091
|
+
layout: z37.unknown().nullable(),
|
|
4092
|
+
createdAt: z37.string(),
|
|
4093
|
+
latencyTotal: z37.number().int().nullable(),
|
|
4094
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4095
|
+
tokensByModel: z37.record(z37.object({
|
|
4096
|
+
input_tokens: z37.number().optional(),
|
|
4097
|
+
output_tokens: z37.number().optional()
|
|
3878
4098
|
})).nullable(),
|
|
3879
|
-
toolCalls:
|
|
3880
|
-
diagnostics:
|
|
4099
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4100
|
+
diagnostics: z37.array(z37.unknown()).nullable()
|
|
3881
4101
|
});
|
|
3882
|
-
var SessionReplaySchema =
|
|
3883
|
-
turns:
|
|
4102
|
+
var SessionReplaySchema = z37.object({
|
|
4103
|
+
turns: z37.array(SessionTurnSchema),
|
|
3884
4104
|
/**
|
|
3885
4105
|
* The session's own last-committed layout, read straight off the durable
|
|
3886
4106
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -3891,20 +4111,20 @@ var SessionReplaySchema = z34.object({
|
|
|
3891
4111
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
3892
4112
|
* when the durable session row itself could not be read.
|
|
3893
4113
|
*/
|
|
3894
|
-
sessionLayout:
|
|
4114
|
+
sessionLayout: z37.record(z37.string(), z37.unknown()).nullable()
|
|
3895
4115
|
});
|
|
3896
|
-
var SessionTraceSchema =
|
|
3897
|
-
trackerState:
|
|
4116
|
+
var SessionTraceSchema = z37.object({
|
|
4117
|
+
trackerState: z37.string().nullable()
|
|
3898
4118
|
});
|
|
3899
|
-
var LlmUsageDailySchema =
|
|
3900
|
-
day:
|
|
4119
|
+
var LlmUsageDailySchema = z37.object({
|
|
4120
|
+
day: z37.string(),
|
|
3901
4121
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
3902
|
-
environment:
|
|
3903
|
-
feature:
|
|
3904
|
-
model:
|
|
3905
|
-
provider:
|
|
4122
|
+
environment: z37.string(),
|
|
4123
|
+
feature: z37.string(),
|
|
4124
|
+
model: z37.string(),
|
|
4125
|
+
provider: z37.string(),
|
|
3906
4126
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
3907
|
-
keyFingerprint:
|
|
4127
|
+
keyFingerprint: z37.string().nullable(),
|
|
3908
4128
|
/**
|
|
3909
4129
|
* The space the call served, or null when it served none.
|
|
3910
4130
|
*
|
|
@@ -3913,91 +4133,91 @@ var LlmUsageDailySchema = z34.object({
|
|
|
3913
4133
|
* report that share rather than dropping it, or a per-space total reads as
|
|
3914
4134
|
* the platform total.
|
|
3915
4135
|
*/
|
|
3916
|
-
spaceId:
|
|
4136
|
+
spaceId: z37.string().nullable(),
|
|
3917
4137
|
/**
|
|
3918
4138
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
3919
4139
|
* when it served no session or the session predates surface recording.
|
|
3920
4140
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
3921
4141
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
3922
4142
|
*/
|
|
3923
|
-
surface:
|
|
3924
|
-
inputTokens:
|
|
3925
|
-
outputTokens:
|
|
4143
|
+
surface: z37.string().nullable(),
|
|
4144
|
+
inputTokens: z37.number(),
|
|
4145
|
+
outputTokens: z37.number(),
|
|
3926
4146
|
/** Subset of inputTokens, never additional to it. */
|
|
3927
|
-
cachedInputTokens:
|
|
3928
|
-
reasoningTokens:
|
|
3929
|
-
callCount:
|
|
3930
|
-
errorCount:
|
|
3931
|
-
estimatedCostUsd:
|
|
4147
|
+
cachedInputTokens: z37.number(),
|
|
4148
|
+
reasoningTokens: z37.number(),
|
|
4149
|
+
callCount: z37.number(),
|
|
4150
|
+
errorCount: z37.number(),
|
|
4151
|
+
estimatedCostUsd: z37.number().nullable()
|
|
3932
4152
|
});
|
|
3933
|
-
var LlmUsageBySessionSchema =
|
|
3934
|
-
sessionId:
|
|
3935
|
-
environment:
|
|
3936
|
-
model:
|
|
4153
|
+
var LlmUsageBySessionSchema = z37.object({
|
|
4154
|
+
sessionId: z37.string(),
|
|
4155
|
+
environment: z37.string(),
|
|
4156
|
+
model: z37.string(),
|
|
3937
4157
|
/** The space this session belongs to, or null for a session with no space. */
|
|
3938
|
-
spaceId:
|
|
4158
|
+
spaceId: z37.string().nullable(),
|
|
3939
4159
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
3940
|
-
surface:
|
|
4160
|
+
surface: z37.string().nullable(),
|
|
3941
4161
|
/** Label only — the first feature seen in the session. */
|
|
3942
|
-
firstFeature:
|
|
3943
|
-
startedAt:
|
|
3944
|
-
endedAt:
|
|
3945
|
-
inputTokens:
|
|
3946
|
-
outputTokens:
|
|
3947
|
-
cachedInputTokens:
|
|
3948
|
-
reasoningTokens:
|
|
3949
|
-
callCount:
|
|
3950
|
-
errorCount:
|
|
4162
|
+
firstFeature: z37.string(),
|
|
4163
|
+
startedAt: z37.string(),
|
|
4164
|
+
endedAt: z37.string(),
|
|
4165
|
+
inputTokens: z37.number(),
|
|
4166
|
+
outputTokens: z37.number(),
|
|
4167
|
+
cachedInputTokens: z37.number(),
|
|
4168
|
+
reasoningTokens: z37.number(),
|
|
4169
|
+
callCount: z37.number(),
|
|
4170
|
+
errorCount: z37.number(),
|
|
3951
4171
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
3952
4172
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
3953
4173
|
* the model is unpriced; never 0, which would read as free. */
|
|
3954
|
-
estimatedCostUsd:
|
|
4174
|
+
estimatedCostUsd: z37.number().nullable()
|
|
3955
4175
|
});
|
|
3956
|
-
var LlmSessionsDailySchema =
|
|
3957
|
-
day:
|
|
3958
|
-
environment:
|
|
3959
|
-
sessionCount:
|
|
4176
|
+
var LlmSessionsDailySchema = z37.object({
|
|
4177
|
+
day: z37.string(),
|
|
4178
|
+
environment: z37.string(),
|
|
4179
|
+
sessionCount: z37.number()
|
|
3960
4180
|
});
|
|
3961
4181
|
|
|
3962
4182
|
// ../spacestation/src/space/session-queue.ts
|
|
3963
|
-
import { z as
|
|
4183
|
+
import { z as z39 } from "zod";
|
|
3964
4184
|
|
|
3965
4185
|
// ../spacestation/src/space/session-activity.ts
|
|
3966
|
-
import { z as
|
|
3967
|
-
var SessionActivityEventSchema =
|
|
3968
|
-
id:
|
|
3969
|
-
kind:
|
|
3970
|
-
occurredAt:
|
|
3971
|
-
source:
|
|
3972
|
-
surface:
|
|
3973
|
-
payload:
|
|
4186
|
+
import { z as z38 } from "zod";
|
|
4187
|
+
var SessionActivityEventSchema = z38.object({
|
|
4188
|
+
id: z38.string(),
|
|
4189
|
+
kind: z38.string(),
|
|
4190
|
+
occurredAt: z38.string(),
|
|
4191
|
+
source: z38.string(),
|
|
4192
|
+
surface: z38.string(),
|
|
4193
|
+
payload: z38.record(z38.unknown())
|
|
3974
4194
|
});
|
|
3975
|
-
var SessionActivitySchema =
|
|
3976
|
-
events:
|
|
3977
|
-
hasMore:
|
|
4195
|
+
var SessionActivitySchema = z38.object({
|
|
4196
|
+
events: z38.array(SessionActivityEventSchema),
|
|
4197
|
+
hasMore: z38.boolean()
|
|
3978
4198
|
});
|
|
3979
4199
|
|
|
3980
4200
|
// ../spacestation/src/space/session-queue.ts
|
|
3981
|
-
var SessionVerdictSchema =
|
|
3982
|
-
var RecordableVerdictSchema =
|
|
3983
|
-
var SessionReviewEventSchema =
|
|
3984
|
-
id:
|
|
4201
|
+
var SessionVerdictSchema = z39.enum(["unreviewed", "viewed", "bug"]);
|
|
4202
|
+
var RecordableVerdictSchema = z39.enum(["viewed", "bug"]);
|
|
4203
|
+
var SessionReviewEventSchema = z39.object({
|
|
4204
|
+
id: z39.string().uuid(),
|
|
3985
4205
|
verdict: RecordableVerdictSchema,
|
|
3986
4206
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
3987
4207
|
* log is append-only rather than a mutable current-state row. */
|
|
3988
|
-
reviewer:
|
|
3989
|
-
note:
|
|
3990
|
-
createdAt:
|
|
4208
|
+
reviewer: z39.string(),
|
|
4209
|
+
note: z39.string().nullable(),
|
|
4210
|
+
createdAt: z39.string()
|
|
3991
4211
|
});
|
|
3992
|
-
var BugSeveritySchema =
|
|
3993
|
-
var BugLocationSchema =
|
|
3994
|
-
elementId:
|
|
4212
|
+
var BugSeveritySchema = z39.enum(["high", "medium", "low"]);
|
|
4213
|
+
var BugLocationSchema = z39.object({
|
|
4214
|
+
elementId: z39.string().nullable(),
|
|
3995
4215
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
3996
4216
|
* alongside a null `elementId`. */
|
|
3997
|
-
elementType:
|
|
4217
|
+
elementType: z39.string().nullable(),
|
|
3998
4218
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
3999
|
-
offsetXPct:
|
|
4000
|
-
offsetYPct:
|
|
4219
|
+
offsetXPct: z39.number().min(0).max(100).nullable(),
|
|
4220
|
+
offsetYPct: z39.number().min(0).max(100).nullable(),
|
|
4001
4221
|
/**
|
|
4002
4222
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
4003
4223
|
* element anchor.
|
|
@@ -4008,8 +4228,8 @@ var BugLocationSchema = z36.object({
|
|
|
4008
4228
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
4009
4229
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
4010
4230
|
*/
|
|
4011
|
-
pageX:
|
|
4012
|
-
pageY:
|
|
4231
|
+
pageX: z39.number().nullable(),
|
|
4232
|
+
pageY: z39.number().nullable()
|
|
4013
4233
|
}).refine(
|
|
4014
4234
|
(loc) => {
|
|
4015
4235
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -4023,24 +4243,24 @@ var BugLocationSchema = z36.object({
|
|
|
4023
4243
|
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)"
|
|
4024
4244
|
}
|
|
4025
4245
|
);
|
|
4026
|
-
var SessionBugSchema =
|
|
4027
|
-
id:
|
|
4246
|
+
var SessionBugSchema = z39.object({
|
|
4247
|
+
id: z39.string().uuid(),
|
|
4028
4248
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
4029
|
-
turnIndex:
|
|
4249
|
+
turnIndex: z39.number().int().nullable(),
|
|
4030
4250
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
4031
4251
|
* without pinning a spot. */
|
|
4032
4252
|
location: BugLocationSchema.nullable(),
|
|
4033
|
-
provider:
|
|
4034
|
-
issueKey:
|
|
4035
|
-
issueUrl:
|
|
4253
|
+
provider: z39.string(),
|
|
4254
|
+
issueKey: z39.string().nullable(),
|
|
4255
|
+
issueUrl: z39.string().nullable(),
|
|
4036
4256
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
4037
4257
|
* open text. Null until first synced. */
|
|
4038
|
-
issueState:
|
|
4039
|
-
title:
|
|
4040
|
-
body:
|
|
4258
|
+
issueState: z39.string().nullable(),
|
|
4259
|
+
title: z39.string(),
|
|
4260
|
+
body: z39.string(),
|
|
4041
4261
|
severity: BugSeveritySchema,
|
|
4042
|
-
createdBy:
|
|
4043
|
-
createdAt:
|
|
4262
|
+
createdBy: z39.string(),
|
|
4263
|
+
createdAt: z39.string(),
|
|
4044
4264
|
/**
|
|
4045
4265
|
* When this bug was resolved from the console; null means still OPEN.
|
|
4046
4266
|
*
|
|
@@ -4049,60 +4269,60 @@ var SessionBugSchema = z36.object({
|
|
|
4049
4269
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
4050
4270
|
* no boolean can contradict it.
|
|
4051
4271
|
*/
|
|
4052
|
-
resolvedAt:
|
|
4053
|
-
resolvedBy:
|
|
4272
|
+
resolvedAt: z39.string().nullable(),
|
|
4273
|
+
resolvedBy: z39.string().nullable()
|
|
4054
4274
|
});
|
|
4055
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
4056
|
-
var SessionCommentSchema =
|
|
4057
|
-
id:
|
|
4275
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z39.string() });
|
|
4276
|
+
var SessionCommentSchema = z39.object({
|
|
4277
|
+
id: z39.string().uuid(),
|
|
4058
4278
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
4059
|
-
bugId:
|
|
4279
|
+
bugId: z39.string().uuid().nullable(),
|
|
4060
4280
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
4061
4281
|
* parent bug's turn). */
|
|
4062
|
-
turnIndex:
|
|
4282
|
+
turnIndex: z39.number().int().nullable(),
|
|
4063
4283
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
4064
4284
|
location: BugLocationSchema.nullable(),
|
|
4065
|
-
body:
|
|
4066
|
-
createdBy:
|
|
4067
|
-
createdAt:
|
|
4285
|
+
body: z39.string(),
|
|
4286
|
+
createdBy: z39.string(),
|
|
4287
|
+
createdAt: z39.string()
|
|
4068
4288
|
});
|
|
4069
|
-
var CreateCommentInputSchema =
|
|
4070
|
-
bugId:
|
|
4071
|
-
turnIndex:
|
|
4289
|
+
var CreateCommentInputSchema = z39.object({
|
|
4290
|
+
bugId: z39.string().uuid().nullable(),
|
|
4291
|
+
turnIndex: z39.number().int().positive().nullable(),
|
|
4072
4292
|
location: BugLocationSchema.nullable(),
|
|
4073
4293
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
4074
4294
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
4075
|
-
body:
|
|
4295
|
+
body: z39.string().trim().min(1)
|
|
4076
4296
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
4077
4297
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
4078
4298
|
});
|
|
4079
|
-
var UpdateCommentInputSchema =
|
|
4080
|
-
body:
|
|
4081
|
-
bugId:
|
|
4299
|
+
var UpdateCommentInputSchema = z39.object({
|
|
4300
|
+
body: z39.string().trim().min(1).optional(),
|
|
4301
|
+
bugId: z39.string().uuid().nullable().optional(),
|
|
4082
4302
|
location: BugLocationSchema.nullable().optional()
|
|
4083
4303
|
});
|
|
4084
4304
|
var MOBILE_VIEWPORT_MAX = 720;
|
|
4085
|
-
var SessionFormFactorSchema =
|
|
4305
|
+
var SessionFormFactorSchema = z39.enum(["mobile", "desktop"]).nullable();
|
|
4086
4306
|
function formFactorFromViewport(width) {
|
|
4087
4307
|
if (width === null) return null;
|
|
4088
4308
|
return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
|
|
4089
4309
|
}
|
|
4090
|
-
var SessionSummarySchema =
|
|
4091
|
-
sessionId:
|
|
4310
|
+
var SessionSummarySchema = z39.object({
|
|
4311
|
+
sessionId: z39.string(),
|
|
4092
4312
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
4093
4313
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
4094
|
-
visitorId:
|
|
4314
|
+
visitorId: z39.string().nullable(),
|
|
4095
4315
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
4096
4316
|
* identified themselves. Both null together means "not identified yet". */
|
|
4097
|
-
identityProvider:
|
|
4098
|
-
identityKey:
|
|
4317
|
+
identityProvider: z39.string().nullable(),
|
|
4318
|
+
identityKey: z39.string().nullable(),
|
|
4099
4319
|
/** Team/test traffic. The queue hides these by default. */
|
|
4100
|
-
isInternal:
|
|
4320
|
+
isInternal: z39.boolean(),
|
|
4101
4321
|
/** Build that served the session. Null = not captured; a version filter must
|
|
4102
4322
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
4103
|
-
clientVersion:
|
|
4323
|
+
clientVersion: z39.string().nullable(),
|
|
4104
4324
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
4105
|
-
signalCounts:
|
|
4325
|
+
signalCounts: z39.record(z39.number()),
|
|
4106
4326
|
/**
|
|
4107
4327
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
4108
4328
|
*
|
|
@@ -4119,7 +4339,7 @@ var SessionSummarySchema = z36.object({
|
|
|
4119
4339
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
4120
4340
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
4121
4341
|
*/
|
|
4122
|
-
conversionAttempts:
|
|
4342
|
+
conversionAttempts: z39.number().int().nullable(),
|
|
4123
4343
|
/**
|
|
4124
4344
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
4125
4345
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -4135,7 +4355,7 @@ var SessionSummarySchema = z36.object({
|
|
|
4135
4355
|
* kinds together, and one attempt id appearing under both would be counted
|
|
4136
4356
|
* once there and twice here.
|
|
4137
4357
|
*/
|
|
4138
|
-
conversionKinds:
|
|
4358
|
+
conversionKinds: z39.record(z39.number()),
|
|
4139
4359
|
/**
|
|
4140
4360
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
4141
4361
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -4143,20 +4363,20 @@ var SessionSummarySchema = z36.object({
|
|
|
4143
4363
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
4144
4364
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
4145
4365
|
*/
|
|
4146
|
-
funnelSteps:
|
|
4366
|
+
funnelSteps: z39.array(z39.string()),
|
|
4147
4367
|
/**
|
|
4148
4368
|
* The connector's opaque handle for what this session produced in its back
|
|
4149
4369
|
* office — present only once a checkout actually reached the platform. The
|
|
4150
4370
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
4151
4371
|
*/
|
|
4152
|
-
backOfficeRef:
|
|
4372
|
+
backOfficeRef: z39.string().nullable(),
|
|
4153
4373
|
/**
|
|
4154
4374
|
* The order this session produced, when the connector's back office reported
|
|
4155
4375
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
4156
4376
|
* Both null when no order is known — the cart handle above is then the door.
|
|
4157
4377
|
*/
|
|
4158
|
-
orderRef:
|
|
4159
|
-
orderLabel:
|
|
4378
|
+
orderRef: z39.string().nullable(),
|
|
4379
|
+
orderLabel: z39.string().nullable(),
|
|
4160
4380
|
/**
|
|
4161
4381
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
4162
4382
|
* needs.
|
|
@@ -4169,12 +4389,12 @@ var SessionSummarySchema = z36.object({
|
|
|
4169
4389
|
* on a desktop are not the same session.
|
|
4170
4390
|
*/
|
|
4171
4391
|
formFactor: SessionFormFactorSchema,
|
|
4172
|
-
turnCount:
|
|
4392
|
+
turnCount: z39.number().int(),
|
|
4173
4393
|
/** The visitor's opening message — the single most informative field for
|
|
4174
4394
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
4175
|
-
firstPrompt:
|
|
4176
|
-
startedAt:
|
|
4177
|
-
lastRunAt:
|
|
4395
|
+
firstPrompt: z39.string(),
|
|
4396
|
+
startedAt: z39.string(),
|
|
4397
|
+
lastRunAt: z39.string(),
|
|
4178
4398
|
/**
|
|
4179
4399
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
4180
4400
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -4202,7 +4422,7 @@ var SessionSummarySchema = z36.object({
|
|
|
4202
4422
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
4203
4423
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
4204
4424
|
*/
|
|
4205
|
-
visitorTimeZone:
|
|
4425
|
+
visitorTimeZone: z39.string().nullable(),
|
|
4206
4426
|
/**
|
|
4207
4427
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
4208
4428
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -4210,31 +4430,31 @@ var SessionSummarySchema = z36.object({
|
|
|
4210
4430
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
4211
4431
|
* already reading. Null when no turn in the session recorded a patch.
|
|
4212
4432
|
*/
|
|
4213
|
-
avgTtftMs:
|
|
4433
|
+
avgTtftMs: z39.number().int().nullable(),
|
|
4214
4434
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
4215
4435
|
* a budget: null on sessions older than the mark's recording. */
|
|
4216
|
-
avgMainDoneMs:
|
|
4436
|
+
avgMainDoneMs: z39.number().int().nullable(),
|
|
4217
4437
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
4218
4438
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
4219
|
-
avgChipGenMs:
|
|
4220
|
-
totalLatencyMs:
|
|
4221
|
-
durationMs:
|
|
4439
|
+
avgChipGenMs: z39.number().int().nullable(),
|
|
4440
|
+
totalLatencyMs: z39.number().int(),
|
|
4441
|
+
durationMs: z39.number().int(),
|
|
4222
4442
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
4223
4443
|
* live session streams and cannot be given a verdict until it ends. */
|
|
4224
|
-
isLive:
|
|
4444
|
+
isLive: z39.boolean(),
|
|
4225
4445
|
verdict: SessionVerdictSchema,
|
|
4226
|
-
reviewedBy:
|
|
4227
|
-
reviewedAt:
|
|
4446
|
+
reviewedBy: z39.string().nullable(),
|
|
4447
|
+
reviewedAt: z39.string().nullable(),
|
|
4228
4448
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
4229
4449
|
* state without a second request. */
|
|
4230
|
-
bugIssueKey:
|
|
4231
|
-
bugIssueUrl:
|
|
4232
|
-
bugIssueState:
|
|
4450
|
+
bugIssueKey: z39.string().nullable(),
|
|
4451
|
+
bugIssueUrl: z39.string().nullable(),
|
|
4452
|
+
bugIssueState: z39.string().nullable()
|
|
4233
4453
|
});
|
|
4234
|
-
var SessionQueuePageSchema =
|
|
4235
|
-
sessions:
|
|
4236
|
-
totalCount:
|
|
4237
|
-
hiddenInternalCount:
|
|
4454
|
+
var SessionQueuePageSchema = z39.object({
|
|
4455
|
+
sessions: z39.array(SessionSummarySchema),
|
|
4456
|
+
totalCount: z39.number().int(),
|
|
4457
|
+
hiddenInternalCount: z39.number().int(),
|
|
4238
4458
|
/**
|
|
4239
4459
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
4240
4460
|
*
|
|
@@ -4244,61 +4464,61 @@ var SessionQueuePageSchema = z36.object({
|
|
|
4244
4464
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
4245
4465
|
* analytics dashboard's bounce over the same window.
|
|
4246
4466
|
*/
|
|
4247
|
-
hiddenBouncedCount:
|
|
4467
|
+
hiddenBouncedCount: z39.number().int()
|
|
4248
4468
|
});
|
|
4249
|
-
var SessionQueueFacetsSchema =
|
|
4250
|
-
review:
|
|
4251
|
-
version:
|
|
4252
|
-
turns:
|
|
4253
|
-
durationS:
|
|
4469
|
+
var SessionQueueFacetsSchema = z39.object({
|
|
4470
|
+
review: z39.record(z39.number()),
|
|
4471
|
+
version: z39.record(z39.number()),
|
|
4472
|
+
turns: z39.record(z39.number()),
|
|
4473
|
+
durationS: z39.record(z39.number()),
|
|
4254
4474
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
4255
|
-
funnel:
|
|
4475
|
+
funnel: z39.record(z39.number())
|
|
4256
4476
|
});
|
|
4257
|
-
var SessionCaptureSchema =
|
|
4258
|
-
viewportWidth:
|
|
4259
|
-
viewportHeight:
|
|
4260
|
-
userAgent:
|
|
4261
|
-
locale:
|
|
4477
|
+
var SessionCaptureSchema = z39.object({
|
|
4478
|
+
viewportWidth: z39.number().int().nullable(),
|
|
4479
|
+
viewportHeight: z39.number().int().nullable(),
|
|
4480
|
+
userAgent: z39.string().nullable(),
|
|
4481
|
+
locale: z39.string().nullable(),
|
|
4262
4482
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
4263
|
-
referrer:
|
|
4483
|
+
referrer: z39.string().nullable()
|
|
4264
4484
|
});
|
|
4265
|
-
var SessionCaptureInputSchema =
|
|
4266
|
-
viewportWidth:
|
|
4267
|
-
viewportHeight:
|
|
4268
|
-
userAgent:
|
|
4269
|
-
locale:
|
|
4485
|
+
var SessionCaptureInputSchema = z39.object({
|
|
4486
|
+
viewportWidth: z39.number().int().positive().max(2e4).optional(),
|
|
4487
|
+
viewportHeight: z39.number().int().positive().max(2e4).optional(),
|
|
4488
|
+
userAgent: z39.string().max(1e3).optional(),
|
|
4489
|
+
locale: z39.string().max(35).optional(),
|
|
4270
4490
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
4271
4491
|
* the zone database grows, and refusing a name this build has not heard of
|
|
4272
4492
|
* would drop a real session's capture over a table that is out of date. */
|
|
4273
|
-
timeZone:
|
|
4274
|
-
referrer:
|
|
4275
|
-
clientVersion:
|
|
4276
|
-
isInternal:
|
|
4493
|
+
timeZone: z39.string().max(64).optional(),
|
|
4494
|
+
referrer: z39.string().max(2048).optional(),
|
|
4495
|
+
clientVersion: z39.string().max(100).optional(),
|
|
4496
|
+
isInternal: z39.boolean().optional()
|
|
4277
4497
|
});
|
|
4278
|
-
var SessionDetailSchema =
|
|
4498
|
+
var SessionDetailSchema = z39.object({
|
|
4279
4499
|
session: SessionSummarySchema,
|
|
4280
4500
|
capture: SessionCaptureSchema,
|
|
4281
4501
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
4282
4502
|
* re-judged after a fix is the evidence the fix worked. */
|
|
4283
|
-
reviews:
|
|
4284
|
-
bugs:
|
|
4285
|
-
comments:
|
|
4503
|
+
reviews: z39.array(SessionReviewEventSchema),
|
|
4504
|
+
bugs: z39.array(SessionBugSchema),
|
|
4505
|
+
comments: z39.array(SessionCommentSchema),
|
|
4286
4506
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
4287
4507
|
* not evidence of zero visitor activity. */
|
|
4288
4508
|
activity: SessionActivitySchema.optional()
|
|
4289
4509
|
});
|
|
4290
|
-
var RecordVerdictInputSchema =
|
|
4510
|
+
var RecordVerdictInputSchema = z39.object({
|
|
4291
4511
|
verdict: RecordableVerdictSchema,
|
|
4292
|
-
note:
|
|
4512
|
+
note: z39.string().max(2e3).optional()
|
|
4293
4513
|
});
|
|
4294
|
-
var FileBugInputSchema =
|
|
4295
|
-
turnIndex:
|
|
4514
|
+
var FileBugInputSchema = z39.object({
|
|
4515
|
+
turnIndex: z39.number().int().positive().nullable(),
|
|
4296
4516
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
4297
4517
|
location: BugLocationSchema.nullable().optional(),
|
|
4298
|
-
title:
|
|
4299
|
-
body:
|
|
4518
|
+
title: z39.string().min(1).max(300),
|
|
4519
|
+
body: z39.string().min(1),
|
|
4300
4520
|
severity: BugSeveritySchema,
|
|
4301
|
-
payload:
|
|
4521
|
+
payload: z39.record(z39.unknown())
|
|
4302
4522
|
});
|
|
4303
4523
|
|
|
4304
4524
|
// ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
|
|
@@ -4578,60 +4798,60 @@ __export(src_exports2, {
|
|
|
4578
4798
|
});
|
|
4579
4799
|
|
|
4580
4800
|
// ../ecommerce/src/commerce-schemas.ts
|
|
4581
|
-
import { z as
|
|
4582
|
-
var MoneySchema =
|
|
4583
|
-
amount:
|
|
4584
|
-
currencyCode:
|
|
4801
|
+
import { z as z40 } from "zod";
|
|
4802
|
+
var MoneySchema = z40.object({
|
|
4803
|
+
amount: z40.number(),
|
|
4804
|
+
currencyCode: z40.string()
|
|
4585
4805
|
});
|
|
4586
|
-
var ImageSchema =
|
|
4587
|
-
url:
|
|
4588
|
-
altText:
|
|
4589
|
-
width:
|
|
4590
|
-
height:
|
|
4806
|
+
var ImageSchema = z40.object({
|
|
4807
|
+
url: z40.string(),
|
|
4808
|
+
altText: z40.string(),
|
|
4809
|
+
width: z40.number().optional(),
|
|
4810
|
+
height: z40.number().optional(),
|
|
4591
4811
|
/** Responsive candidate set, resolved at the commerce-adapter boundary —
|
|
4592
4812
|
* never computed in a component. Renderers use it as `<img srcSet>` paired
|
|
4593
4813
|
* with a layout `sizes`. Absent for non-CDN / unsizable images. */
|
|
4594
|
-
srcSet:
|
|
4814
|
+
srcSet: z40.string().optional()
|
|
4595
4815
|
});
|
|
4596
|
-
var AssetSchema =
|
|
4816
|
+
var AssetSchema = z40.object({
|
|
4597
4817
|
/** Opaque asset id — the `resolved()` ref the agent emitted. */
|
|
4598
|
-
id:
|
|
4599
|
-
url:
|
|
4600
|
-
altText:
|
|
4601
|
-
srcSet:
|
|
4818
|
+
id: z40.string(),
|
|
4819
|
+
url: z40.string(),
|
|
4820
|
+
altText: z40.string(),
|
|
4821
|
+
srcSet: z40.string().optional()
|
|
4602
4822
|
});
|
|
4603
|
-
var SelectedOptionSchema =
|
|
4604
|
-
name:
|
|
4605
|
-
value:
|
|
4823
|
+
var SelectedOptionSchema = z40.object({
|
|
4824
|
+
name: z40.string(),
|
|
4825
|
+
value: z40.string()
|
|
4606
4826
|
});
|
|
4607
|
-
var VideoSourceSchema =
|
|
4608
|
-
url:
|
|
4609
|
-
mimeType:
|
|
4610
|
-
width:
|
|
4611
|
-
height:
|
|
4827
|
+
var VideoSourceSchema = z40.object({
|
|
4828
|
+
url: z40.string(),
|
|
4829
|
+
mimeType: z40.string(),
|
|
4830
|
+
width: z40.number().optional(),
|
|
4831
|
+
height: z40.number().optional()
|
|
4612
4832
|
});
|
|
4613
|
-
var ProductVideoSchema =
|
|
4614
|
-
kind:
|
|
4833
|
+
var ProductVideoSchema = z40.object({
|
|
4834
|
+
kind: z40.enum(["hosted", "external"]),
|
|
4615
4835
|
previewImage: ImageSchema.optional(),
|
|
4616
|
-
altText:
|
|
4836
|
+
altText: z40.string().default(""),
|
|
4617
4837
|
/** `kind: 'hosted'` only — empty for external embeds. */
|
|
4618
|
-
sources:
|
|
4838
|
+
sources: z40.array(VideoSourceSchema).default([]),
|
|
4619
4839
|
/** `kind: 'external'` only — iframe embed URL. */
|
|
4620
|
-
embedUrl:
|
|
4840
|
+
embedUrl: z40.string().optional(),
|
|
4621
4841
|
/** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
|
|
4622
|
-
host:
|
|
4842
|
+
host: z40.string().optional()
|
|
4623
4843
|
});
|
|
4624
|
-
var AvailabilityStatusSchema =
|
|
4844
|
+
var AvailabilityStatusSchema = z40.enum([
|
|
4625
4845
|
"in_stock",
|
|
4626
4846
|
"backorder",
|
|
4627
4847
|
"preorder",
|
|
4628
4848
|
"out_of_stock",
|
|
4629
4849
|
"discontinued"
|
|
4630
4850
|
]);
|
|
4631
|
-
var ProductVariantSchema =
|
|
4632
|
-
id:
|
|
4633
|
-
title:
|
|
4634
|
-
available:
|
|
4851
|
+
var ProductVariantSchema = z40.object({
|
|
4852
|
+
id: z40.string(),
|
|
4853
|
+
title: z40.string(),
|
|
4854
|
+
available: z40.boolean(),
|
|
4635
4855
|
/**
|
|
4636
4856
|
* Qualifies `available` with the fulfillment state behind it. Absent means
|
|
4637
4857
|
* the backend did not say — which is NOT the same as in stock, and must not
|
|
@@ -4646,7 +4866,7 @@ var ProductVariantSchema = z37.object({
|
|
|
4646
4866
|
availabilityStatus: AvailabilityStatusSchema.optional(),
|
|
4647
4867
|
price: MoneySchema,
|
|
4648
4868
|
compareAtPrice: MoneySchema.optional(),
|
|
4649
|
-
selectedOptions:
|
|
4869
|
+
selectedOptions: z40.array(SelectedOptionSchema).optional(),
|
|
4650
4870
|
image: ImageSchema.optional()
|
|
4651
4871
|
});
|
|
4652
4872
|
var MP4_MIME = "video/mp4";
|
|
@@ -4657,34 +4877,34 @@ function orderedVideoSources(video) {
|
|
|
4657
4877
|
const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
|
|
4658
4878
|
return [...mp4, ...hls];
|
|
4659
4879
|
}
|
|
4660
|
-
var SiblingProductSchema =
|
|
4661
|
-
id:
|
|
4662
|
-
handle:
|
|
4663
|
-
title:
|
|
4880
|
+
var SiblingProductSchema = z40.object({
|
|
4881
|
+
id: z40.string(),
|
|
4882
|
+
handle: z40.string(),
|
|
4883
|
+
title: z40.string(),
|
|
4664
4884
|
/** The differentiating value across siblings — typically the color
|
|
4665
4885
|
* label ("OLIVE", "STONE"). Rendered next to the swatch row. */
|
|
4666
|
-
color:
|
|
4886
|
+
color: z40.string(),
|
|
4667
4887
|
/** Swatch artwork. Hydrators populate from the sibling product's
|
|
4668
4888
|
* first image; renderers crop / fit to the swatch tile. */
|
|
4669
4889
|
swatchImage: ImageSchema.optional(),
|
|
4670
|
-
available:
|
|
4890
|
+
available: z40.boolean().default(true),
|
|
4671
4891
|
/** Marks the sibling that IS the currently-rendered product. The
|
|
4672
4892
|
* picker uses this to highlight the active swatch without an
|
|
4673
4893
|
* external id comparison. */
|
|
4674
|
-
current:
|
|
4894
|
+
current: z40.boolean().default(false)
|
|
4675
4895
|
});
|
|
4676
|
-
var ProductSchema =
|
|
4677
|
-
id:
|
|
4678
|
-
handle:
|
|
4679
|
-
title:
|
|
4680
|
-
description:
|
|
4681
|
-
descriptionHtml:
|
|
4682
|
-
vendor:
|
|
4683
|
-
productType:
|
|
4684
|
-
tags:
|
|
4896
|
+
var ProductSchema = z40.object({
|
|
4897
|
+
id: z40.string(),
|
|
4898
|
+
handle: z40.string().default(""),
|
|
4899
|
+
title: z40.string(),
|
|
4900
|
+
description: z40.string().default(""),
|
|
4901
|
+
descriptionHtml: z40.string().optional(),
|
|
4902
|
+
vendor: z40.string().default(""),
|
|
4903
|
+
productType: z40.string().optional(),
|
|
4904
|
+
tags: z40.array(z40.string()).default([]),
|
|
4685
4905
|
price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
|
|
4686
4906
|
compareAtPrice: MoneySchema.optional(),
|
|
4687
|
-
images:
|
|
4907
|
+
images: z40.array(ImageSchema).default([]),
|
|
4688
4908
|
/**
|
|
4689
4909
|
* Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
|
|
4690
4910
|
* catalog drops video media — it only surfaces through the Storefront
|
|
@@ -4692,21 +4912,21 @@ var ProductSchema = z37.object({
|
|
|
4692
4912
|
* boundary. Default `[]` so renderers gate on `length > 0` without a
|
|
4693
4913
|
* presence guard.
|
|
4694
4914
|
*/
|
|
4695
|
-
videos:
|
|
4696
|
-
variants:
|
|
4697
|
-
availableForSale:
|
|
4698
|
-
options:
|
|
4699
|
-
name:
|
|
4700
|
-
values:
|
|
4915
|
+
videos: z40.array(ProductVideoSchema).default([]),
|
|
4916
|
+
variants: z40.array(ProductVariantSchema).default([]),
|
|
4917
|
+
availableForSale: z40.boolean().default(true),
|
|
4918
|
+
options: z40.array(z40.object({
|
|
4919
|
+
name: z40.string(),
|
|
4920
|
+
values: z40.array(z40.string())
|
|
4701
4921
|
})).optional(),
|
|
4702
|
-
collections:
|
|
4922
|
+
collections: z40.array(z40.string()).optional(),
|
|
4703
4923
|
/** See `SiblingProductSchema`. Default `[]` so renderers can check
|
|
4704
4924
|
* `length > 1` to decide whether to draw the swatch row without a
|
|
4705
4925
|
* presence guard. */
|
|
4706
|
-
colorVariants:
|
|
4707
|
-
rating:
|
|
4708
|
-
value:
|
|
4709
|
-
count:
|
|
4926
|
+
colorVariants: z40.array(SiblingProductSchema).default([]),
|
|
4927
|
+
rating: z40.object({
|
|
4928
|
+
value: z40.number(),
|
|
4929
|
+
count: z40.number()
|
|
4710
4930
|
}).optional(),
|
|
4711
4931
|
/**
|
|
4712
4932
|
* Product reviews surfaced from the brand's review store. SDK
|
|
@@ -4715,12 +4935,12 @@ var ProductSchema = z37.object({
|
|
|
4715
4935
|
* review bodies. Renderers (`Reviews` component, `ProductDetail`,
|
|
4716
4936
|
* etc.) consume directly.
|
|
4717
4937
|
*/
|
|
4718
|
-
reviews:
|
|
4719
|
-
author:
|
|
4720
|
-
rating:
|
|
4721
|
-
content:
|
|
4722
|
-
date:
|
|
4723
|
-
verified:
|
|
4938
|
+
reviews: z40.array(z40.object({
|
|
4939
|
+
author: z40.string(),
|
|
4940
|
+
rating: z40.number(),
|
|
4941
|
+
content: z40.string(),
|
|
4942
|
+
date: z40.string(),
|
|
4943
|
+
verified: z40.boolean().optional()
|
|
4724
4944
|
})).optional(),
|
|
4725
4945
|
/**
|
|
4726
4946
|
* Ghost-entity flag — `true` when the Storefront API could not hydrate
|
|
@@ -4732,7 +4952,7 @@ var ProductSchema = z37.object({
|
|
|
4732
4952
|
* Set exclusively by `createUnavailableProduct()` — never by the
|
|
4733
4953
|
* Storefront mapper.
|
|
4734
4954
|
*/
|
|
4735
|
-
unavailable:
|
|
4955
|
+
unavailable: z40.boolean().default(false)
|
|
4736
4956
|
});
|
|
4737
4957
|
function createUnavailableProduct(gid) {
|
|
4738
4958
|
return {
|
|
@@ -4754,68 +4974,68 @@ function createUnavailableProduct(gid) {
|
|
|
4754
4974
|
function isGhostEntity(value) {
|
|
4755
4975
|
return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
|
|
4756
4976
|
}
|
|
4757
|
-
var ReviewSchema =
|
|
4758
|
-
id:
|
|
4759
|
-
productId:
|
|
4760
|
-
author:
|
|
4761
|
-
rating:
|
|
4762
|
-
text:
|
|
4763
|
-
date:
|
|
4764
|
-
verified:
|
|
4977
|
+
var ReviewSchema = z40.object({
|
|
4978
|
+
id: z40.string(),
|
|
4979
|
+
productId: z40.string(),
|
|
4980
|
+
author: z40.string(),
|
|
4981
|
+
rating: z40.number(),
|
|
4982
|
+
text: z40.string(),
|
|
4983
|
+
date: z40.string(),
|
|
4984
|
+
verified: z40.boolean()
|
|
4765
4985
|
});
|
|
4766
|
-
var ArticleSchema =
|
|
4767
|
-
id:
|
|
4768
|
-
handle:
|
|
4769
|
-
title:
|
|
4770
|
-
excerpt:
|
|
4771
|
-
content:
|
|
4772
|
-
contentHtml:
|
|
4773
|
-
author:
|
|
4774
|
-
publishedAt:
|
|
4986
|
+
var ArticleSchema = z40.object({
|
|
4987
|
+
id: z40.string(),
|
|
4988
|
+
handle: z40.string().default(""),
|
|
4989
|
+
title: z40.string(),
|
|
4990
|
+
excerpt: z40.string().default(""),
|
|
4991
|
+
content: z40.string().default(""),
|
|
4992
|
+
contentHtml: z40.string().optional(),
|
|
4993
|
+
author: z40.string().default(""),
|
|
4994
|
+
publishedAt: z40.string().default(""),
|
|
4775
4995
|
image: ImageSchema.optional(),
|
|
4776
|
-
blogHandle:
|
|
4777
|
-
tags:
|
|
4996
|
+
blogHandle: z40.string().default(""),
|
|
4997
|
+
tags: z40.array(z40.string()).default([])
|
|
4778
4998
|
});
|
|
4779
|
-
var CmsPageSchema =
|
|
4780
|
-
id:
|
|
4781
|
-
handle:
|
|
4782
|
-
title:
|
|
4783
|
-
body:
|
|
4784
|
-
bodyHtml:
|
|
4785
|
-
bodySummary:
|
|
4786
|
-
updatedAt:
|
|
4787
|
-
seoTitle:
|
|
4788
|
-
seoDescription:
|
|
4999
|
+
var CmsPageSchema = z40.object({
|
|
5000
|
+
id: z40.string(),
|
|
5001
|
+
handle: z40.string().default(""),
|
|
5002
|
+
title: z40.string(),
|
|
5003
|
+
body: z40.string().default(""),
|
|
5004
|
+
bodyHtml: z40.string().optional(),
|
|
5005
|
+
bodySummary: z40.string().default(""),
|
|
5006
|
+
updatedAt: z40.string().default(""),
|
|
5007
|
+
seoTitle: z40.string().optional(),
|
|
5008
|
+
seoDescription: z40.string().optional()
|
|
4789
5009
|
});
|
|
4790
|
-
var CmsPolicySchema =
|
|
4791
|
-
id:
|
|
5010
|
+
var CmsPolicySchema = z40.object({
|
|
5011
|
+
id: z40.string(),
|
|
4792
5012
|
/** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
|
|
4793
5013
|
* 'shipping' | 'subscription' | 'warranty' | custom string. Open so
|
|
4794
5014
|
* platforms with custom policy types can extend. */
|
|
4795
|
-
kind:
|
|
5015
|
+
kind: z40.string(),
|
|
4796
5016
|
/** Slug-shaped handle the platform exposes for storefront URLs
|
|
4797
5017
|
* (e.g. `refund-policy`). Empty string when the backend doesn't
|
|
4798
5018
|
* surface one. */
|
|
4799
|
-
handle:
|
|
4800
|
-
title:
|
|
4801
|
-
body:
|
|
4802
|
-
bodyHtml:
|
|
4803
|
-
url:
|
|
5019
|
+
handle: z40.string().default(""),
|
|
5020
|
+
title: z40.string(),
|
|
5021
|
+
body: z40.string().default(""),
|
|
5022
|
+
bodyHtml: z40.string().optional(),
|
|
5023
|
+
url: z40.string().default("")
|
|
4804
5024
|
});
|
|
4805
|
-
var CollectionSchema =
|
|
4806
|
-
id:
|
|
4807
|
-
handle:
|
|
4808
|
-
title:
|
|
4809
|
-
description:
|
|
5025
|
+
var CollectionSchema = z40.object({
|
|
5026
|
+
id: z40.string(),
|
|
5027
|
+
handle: z40.string().default(""),
|
|
5028
|
+
title: z40.string(),
|
|
5029
|
+
description: z40.string().default(""),
|
|
4810
5030
|
image: ImageSchema.optional(),
|
|
4811
|
-
productCount:
|
|
5031
|
+
productCount: z40.number().int().nonnegative().optional()
|
|
4812
5032
|
});
|
|
4813
|
-
var CartLineSchema =
|
|
4814
|
-
id:
|
|
4815
|
-
merchandiseId:
|
|
4816
|
-
productId:
|
|
4817
|
-
title:
|
|
4818
|
-
variantTitle:
|
|
5033
|
+
var CartLineSchema = z40.object({
|
|
5034
|
+
id: z40.string(),
|
|
5035
|
+
merchandiseId: z40.string(),
|
|
5036
|
+
productId: z40.string(),
|
|
5037
|
+
title: z40.string(),
|
|
5038
|
+
variantTitle: z40.string().optional(),
|
|
4819
5039
|
/**
|
|
4820
5040
|
* The variant's option axes as structured pairs (e.g.
|
|
4821
5041
|
* `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
|
|
@@ -4824,10 +5044,10 @@ var CartLineSchema = z37.object({
|
|
|
4824
5044
|
* single-variant products (the degenerate `Title: Default Title` axis
|
|
4825
5045
|
* is normalized away at the adapter boundary).
|
|
4826
5046
|
*/
|
|
4827
|
-
selectedOptions:
|
|
4828
|
-
vendor:
|
|
4829
|
-
sku:
|
|
4830
|
-
quantity:
|
|
5047
|
+
selectedOptions: z40.array(SelectedOptionSchema).optional(),
|
|
5048
|
+
vendor: z40.string().optional(),
|
|
5049
|
+
sku: z40.string().optional(),
|
|
5050
|
+
quantity: z40.number().int().positive(),
|
|
4831
5051
|
unitPrice: MoneySchema,
|
|
4832
5052
|
totalPrice: MoneySchema,
|
|
4833
5053
|
image: ImageSchema.optional(),
|
|
@@ -4847,26 +5067,26 @@ var CartLineSchema = z37.object({
|
|
|
4847
5067
|
* client-minted id the backend rejects, line-tap navigation is
|
|
4848
5068
|
* suppressed, and the money never folds into a settled-looking total.
|
|
4849
5069
|
*/
|
|
4850
|
-
pending:
|
|
5070
|
+
pending: z40.boolean().optional()
|
|
4851
5071
|
});
|
|
4852
5072
|
function isPendingCartLine(line) {
|
|
4853
5073
|
return line.pending === true;
|
|
4854
5074
|
}
|
|
4855
|
-
var CartDiscountCodeSchema =
|
|
4856
|
-
code:
|
|
4857
|
-
applicable:
|
|
5075
|
+
var CartDiscountCodeSchema = z40.object({
|
|
5076
|
+
code: z40.string(),
|
|
5077
|
+
applicable: z40.boolean()
|
|
4858
5078
|
});
|
|
4859
|
-
var CartMessageSchema =
|
|
4860
|
-
kind:
|
|
5079
|
+
var CartMessageSchema = z40.object({
|
|
5080
|
+
kind: z40.enum(["error", "warning", "info"]),
|
|
4861
5081
|
/** Machine code for branching; opaque and backend-defined. */
|
|
4862
|
-
code:
|
|
5082
|
+
code: z40.string(),
|
|
4863
5083
|
/** Human-readable text, meant to be shown as-is. */
|
|
4864
|
-
content:
|
|
5084
|
+
content: z40.string()
|
|
4865
5085
|
});
|
|
4866
|
-
var CartSchema =
|
|
4867
|
-
id:
|
|
4868
|
-
lines:
|
|
4869
|
-
totalQuantity:
|
|
5086
|
+
var CartSchema = z40.object({
|
|
5087
|
+
id: z40.string(),
|
|
5088
|
+
lines: z40.array(CartLineSchema),
|
|
5089
|
+
totalQuantity: z40.number().int().nonnegative(),
|
|
4870
5090
|
subtotal: MoneySchema,
|
|
4871
5091
|
/**
|
|
4872
5092
|
* Cart total after discounts (pre-shipping/tax). Absent when the
|
|
@@ -4876,11 +5096,11 @@ var CartSchema = z37.object({
|
|
|
4876
5096
|
*/
|
|
4877
5097
|
total: MoneySchema.optional(),
|
|
4878
5098
|
/** Discount codes currently attached to the cart. */
|
|
4879
|
-
discountCodes:
|
|
5099
|
+
discountCodes: z40.array(CartDiscountCodeSchema).default([]),
|
|
4880
5100
|
/** Notices the backend attached to this cart — see `CartMessageSchema`.
|
|
4881
5101
|
* Empty when the backend said nothing or does not report them. */
|
|
4882
|
-
messages:
|
|
4883
|
-
checkoutUrl:
|
|
5102
|
+
messages: z40.array(CartMessageSchema).default([]),
|
|
5103
|
+
checkoutUrl: z40.string().optional(),
|
|
4884
5104
|
/**
|
|
4885
5105
|
* Opaque handle this cart is known by in the connector's BACK OFFICE — the
|
|
4886
5106
|
* value a space owner searches there to find the order this cart became.
|
|
@@ -4893,14 +5113,14 @@ var CartSchema = z37.object({
|
|
|
4893
5113
|
* Absent when the platform has no such handle, or while the cart is still the
|
|
4894
5114
|
* client's optimistic paint and its id is client-minted.
|
|
4895
5115
|
*/
|
|
4896
|
-
backOfficeRef:
|
|
5116
|
+
backOfficeRef: z40.string().optional(),
|
|
4897
5117
|
/**
|
|
4898
5118
|
* URL that recreates this cart on the merchant's own store website
|
|
4899
5119
|
* (replace semantics — overwrites any cart the visitor already has
|
|
4900
5120
|
* there). Populated by platform adapters that support it; absent when
|
|
4901
5121
|
* the cart is empty or the URL cannot be built.
|
|
4902
5122
|
*/
|
|
4903
|
-
storeCartUrl:
|
|
5123
|
+
storeCartUrl: z40.string().optional(),
|
|
4904
5124
|
/**
|
|
4905
5125
|
* True while this cart exists only in the client's optimistic paint —
|
|
4906
5126
|
* no backend cart has been created yet, so its `id` is client-minted and
|
|
@@ -4908,7 +5128,7 @@ var CartSchema = z37.object({
|
|
|
4908
5128
|
* `CartLineSchema.pending`: the adapter never sets it, and callers that
|
|
4909
5129
|
* need a real cart id read THIS rather than sniffing the id's shape.
|
|
4910
5130
|
*/
|
|
4911
|
-
pending:
|
|
5131
|
+
pending: z40.boolean().optional()
|
|
4912
5132
|
});
|
|
4913
5133
|
function settledCart(cart) {
|
|
4914
5134
|
if (cart === null || cart === void 0) return null;
|
|
@@ -4916,27 +5136,27 @@ function settledCart(cart) {
|
|
|
4916
5136
|
}
|
|
4917
5137
|
|
|
4918
5138
|
// ../ecommerce/src/review-schemas.ts
|
|
4919
|
-
import { z as
|
|
5139
|
+
import { z as z41 } from "zod";
|
|
4920
5140
|
var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
|
|
4921
|
-
var ProductReviewItemSchema =
|
|
4922
|
-
author:
|
|
4923
|
-
rating:
|
|
5141
|
+
var ProductReviewItemSchema = z41.object({
|
|
5142
|
+
author: z41.string(),
|
|
5143
|
+
rating: z41.number(),
|
|
4924
5144
|
/** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
|
|
4925
|
-
title:
|
|
4926
|
-
content:
|
|
4927
|
-
date:
|
|
4928
|
-
verified:
|
|
5145
|
+
title: z41.string().optional(),
|
|
5146
|
+
content: z41.string(),
|
|
5147
|
+
date: z41.string(),
|
|
5148
|
+
verified: z41.boolean().optional(),
|
|
4929
5149
|
/**
|
|
4930
5150
|
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
4931
5151
|
* than this one (brands pool reviews across a product line). A surface can
|
|
4932
5152
|
* attribute it; empty / absent ⇒ the product's own review.
|
|
4933
5153
|
*/
|
|
4934
|
-
writtenFor:
|
|
5154
|
+
writtenFor: z41.string().optional()
|
|
4935
5155
|
});
|
|
4936
5156
|
var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
4937
5157
|
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
4938
5158
|
* scored, NOT necessarily text that occurs in `content`. */
|
|
4939
|
-
highlight:
|
|
5159
|
+
highlight: z41.string().optional(),
|
|
4940
5160
|
/**
|
|
4941
5161
|
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
4942
5162
|
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
@@ -4951,29 +5171,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
|
4951
5171
|
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
4952
5172
|
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
4953
5173
|
*/
|
|
4954
|
-
mark:
|
|
5174
|
+
mark: z41.string().optional()
|
|
4955
5175
|
});
|
|
4956
|
-
var ReviewAggregateSchema =
|
|
4957
|
-
value:
|
|
4958
|
-
count:
|
|
5176
|
+
var ReviewAggregateSchema = z41.object({
|
|
5177
|
+
value: z41.number(),
|
|
5178
|
+
count: z41.number()
|
|
4959
5179
|
});
|
|
4960
|
-
var ProductReviewDataSchema =
|
|
4961
|
-
id:
|
|
5180
|
+
var ProductReviewDataSchema = z41.object({
|
|
5181
|
+
id: z41.string(),
|
|
4962
5182
|
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
4963
|
-
reviews:
|
|
5183
|
+
reviews: z41.array(ProductReviewItemSchema).default([]),
|
|
4964
5184
|
aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
|
|
4965
5185
|
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
4966
|
-
distribution:
|
|
5186
|
+
distribution: z41.array(z41.number()).default([]),
|
|
4967
5187
|
/**
|
|
4968
5188
|
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
4969
5189
|
* intent was asked for — never a silent copy of `reviews`.
|
|
4970
5190
|
*/
|
|
4971
|
-
highlights:
|
|
5191
|
+
highlights: z41.array(ProductReviewHighlightSchema).default([]),
|
|
4972
5192
|
/**
|
|
4973
5193
|
* True when the review provider could not be read and nothing is indexed —
|
|
4974
5194
|
* the empty lists mean "not loaded", NOT "this product has no reviews".
|
|
4975
5195
|
*/
|
|
4976
|
-
unavailable:
|
|
5196
|
+
unavailable: z41.boolean().optional()
|
|
4977
5197
|
});
|
|
4978
5198
|
var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
|
|
4979
5199
|
|
|
@@ -5267,9 +5487,9 @@ function readPdpCompanions(config) {
|
|
|
5267
5487
|
}
|
|
5268
5488
|
|
|
5269
5489
|
// ../ecommerce/src/base-attributes.ts
|
|
5270
|
-
import { z as
|
|
5490
|
+
import { z as z42 } from "zod";
|
|
5271
5491
|
var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
|
|
5272
|
-
var BaseAttributesRecordSchema =
|
|
5492
|
+
var BaseAttributesRecordSchema = z42.record(z42.string(), AttributeDefSchema);
|
|
5273
5493
|
function buildBaseAttributesConfig(attributes) {
|
|
5274
5494
|
return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
|
|
5275
5495
|
}
|
|
@@ -5280,9 +5500,9 @@ function readBaseAttributesConfig(config) {
|
|
|
5280
5500
|
}
|
|
5281
5501
|
|
|
5282
5502
|
// ../ecommerce/src/bucket-labels.ts
|
|
5283
|
-
import { z as
|
|
5503
|
+
import { z as z43 } from "zod";
|
|
5284
5504
|
var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
|
|
5285
|
-
var BucketLabelsRecordSchema =
|
|
5505
|
+
var BucketLabelsRecordSchema = z43.record(z43.string(), z43.string());
|
|
5286
5506
|
function buildBucketLabelsConfig(labels) {
|
|
5287
5507
|
return { [BUCKET_LABELS_CONFIG_KEY]: labels };
|
|
5288
5508
|
}
|
|
@@ -6295,7 +6515,8 @@ __export(presence_exports, {
|
|
|
6295
6515
|
SCANNING_FORM: () => SCANNING_FORM,
|
|
6296
6516
|
deriveSourceElement: () => deriveSourceElement,
|
|
6297
6517
|
isPresenceStreamArtifact: () => isPresenceStreamArtifact,
|
|
6298
|
-
pendingSourceElement: () => pendingSourceElement
|
|
6518
|
+
pendingSourceElement: () => pendingSourceElement,
|
|
6519
|
+
projectSourceOutput: () => projectSourceOutput
|
|
6299
6520
|
});
|
|
6300
6521
|
|
|
6301
6522
|
// ../spacestation/src/widgets/presence/frame.ts
|
|
@@ -6346,7 +6567,7 @@ function imageOf(record2) {
|
|
|
6346
6567
|
function metaOf(record2) {
|
|
6347
6568
|
const meta = {};
|
|
6348
6569
|
for (const [key, value] of Object.entries(record2)) {
|
|
6349
|
-
if (key === "id" || SCAN_IMAGE_KEYS.includes(key)) continue;
|
|
6570
|
+
if (key === "id" || key.startsWith("__") || SCAN_IMAGE_KEYS.includes(key)) continue;
|
|
6350
6571
|
if (typeof value === "number" || typeof value === "boolean") {
|
|
6351
6572
|
meta[key] = value;
|
|
6352
6573
|
continue;
|
|
@@ -6407,6 +6628,29 @@ function deriveSourceElement(input) {
|
|
|
6407
6628
|
}
|
|
6408
6629
|
return element;
|
|
6409
6630
|
}
|
|
6631
|
+
function projectSourceOutput(output) {
|
|
6632
|
+
const records = recordsOf(output);
|
|
6633
|
+
if (records === void 0) return void 0;
|
|
6634
|
+
const results = [];
|
|
6635
|
+
for (const record2 of records) {
|
|
6636
|
+
if (typeof record2 !== "object" || record2 === null) continue;
|
|
6637
|
+
const projected = {};
|
|
6638
|
+
const id = Reflect.get(record2, "id");
|
|
6639
|
+
if (typeof id === "string") projected.id = id;
|
|
6640
|
+
const imageUrl = imageOf(record2);
|
|
6641
|
+
if (imageUrl !== void 0) projected.imageUrl = imageUrl;
|
|
6642
|
+
const meta = metaOf(record2);
|
|
6643
|
+
if (meta !== void 0) Object.assign(projected, meta);
|
|
6644
|
+
results.push(projected);
|
|
6645
|
+
}
|
|
6646
|
+
const projection = { results };
|
|
6647
|
+
const parsed = parse(output);
|
|
6648
|
+
if (typeof parsed === "object" && parsed !== null) {
|
|
6649
|
+
const total = Reflect.get(parsed, "total");
|
|
6650
|
+
if (typeof total === "number") projection.total = total;
|
|
6651
|
+
}
|
|
6652
|
+
return projection;
|
|
6653
|
+
}
|
|
6410
6654
|
|
|
6411
6655
|
// ../spacestation/src/widgets/presence/element.ts
|
|
6412
6656
|
function isPresenceStreamArtifact(value) {
|
|
@@ -6432,8 +6676,8 @@ var PRESENCE_LIFECYCLE = {
|
|
|
6432
6676
|
};
|
|
6433
6677
|
|
|
6434
6678
|
// ../spacestation/src/widgets/presence/profile.ts
|
|
6435
|
-
import { z as
|
|
6436
|
-
var PresenceProfileSchema =
|
|
6679
|
+
import { z as z44 } from "zod";
|
|
6680
|
+
var PresenceProfileSchema = z44.object({
|
|
6437
6681
|
/**
|
|
6438
6682
|
* How much the agent SPEAKS in presence.
|
|
6439
6683
|
* - 'off' the faculty generates no prose at all. Zero tokens, and
|
|
@@ -6443,14 +6687,14 @@ var PresenceProfileSchema = z41.object({
|
|
|
6443
6687
|
* - 'terse' one lead line per turn. The default — see below.
|
|
6444
6688
|
* - 'full' a lead line plus asides beside individual elements.
|
|
6445
6689
|
*/
|
|
6446
|
-
voice:
|
|
6690
|
+
voice: z44.enum(["off", "terse", "full"]),
|
|
6447
6691
|
/**
|
|
6448
6692
|
* Which source kinds this space surfaces. 'all' = every tool that declares a
|
|
6449
6693
|
* `sourceKind`. An explicit list lets a space stay quiet about lookups its
|
|
6450
6694
|
* visitors would find uninteresting (policy checks on a fashion space)
|
|
6451
6695
|
* without the tool having to lie about what it is.
|
|
6452
6696
|
*/
|
|
6453
|
-
sources:
|
|
6697
|
+
sources: z44.union([z44.array(z44.string()), z44.literal("all")]),
|
|
6454
6698
|
/**
|
|
6455
6699
|
* Which facts render.
|
|
6456
6700
|
* - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
|
|
@@ -6459,7 +6703,7 @@ var PresenceProfileSchema = z41.object({
|
|
|
6459
6703
|
* - 'all' shows stated facts too — for spaces where confirming the brief
|
|
6460
6704
|
* back is itself the product (intake, configuration).
|
|
6461
6705
|
*/
|
|
6462
|
-
facts:
|
|
6706
|
+
facts: z44.enum(["inferred-only", "all"])
|
|
6463
6707
|
});
|
|
6464
6708
|
var DEFAULT_PRESENCE_PROFILE = {
|
|
6465
6709
|
voice: "terse",
|
|
@@ -6643,7 +6887,7 @@ function useAgentPresenceFresh(flowId = PRESENCE_FLOW) {
|
|
|
6643
6887
|
}
|
|
6644
6888
|
|
|
6645
6889
|
// src/widgets/presence/use-layout-entity-ids.ts
|
|
6646
|
-
import { useMemo as
|
|
6890
|
+
import { useMemo as useMemo4 } from "react";
|
|
6647
6891
|
|
|
6648
6892
|
// src/catalog/CatalogContext.tsx
|
|
6649
6893
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -6673,7 +6917,7 @@ function collectLayoutGids(layout, catalog) {
|
|
|
6673
6917
|
function useLayoutEntityIds() {
|
|
6674
6918
|
const layout = useLayout();
|
|
6675
6919
|
const catalog = useComponentCatalog();
|
|
6676
|
-
return
|
|
6920
|
+
return useMemo4(() => [...collectLayoutGids(layout, catalog)], [layout, catalog]);
|
|
6677
6921
|
}
|
|
6678
6922
|
|
|
6679
6923
|
// src/widgets/presence/use-presence.ts
|
|
@@ -8389,22 +8633,22 @@ function buildComponentLibrary(catalog, componentMap) {
|
|
|
8389
8633
|
}
|
|
8390
8634
|
|
|
8391
8635
|
// src/catalog/define.ts
|
|
8392
|
-
import { z as
|
|
8636
|
+
import { z as z45 } from "zod";
|
|
8393
8637
|
function entity(resolverKey, opts) {
|
|
8394
|
-
return resolved(
|
|
8638
|
+
return resolved(z45.string(), resolverKey, opts);
|
|
8395
8639
|
}
|
|
8396
|
-
var text = prose(
|
|
8640
|
+
var text = prose(z45.string());
|
|
8397
8641
|
function plain() {
|
|
8398
|
-
return
|
|
8642
|
+
return z45.string();
|
|
8399
8643
|
}
|
|
8400
8644
|
function token(values) {
|
|
8401
|
-
return
|
|
8645
|
+
return z45.enum(values);
|
|
8402
8646
|
}
|
|
8403
8647
|
function catalogComponent(meta, render) {
|
|
8404
8648
|
const { props, requires, ...rest } = meta;
|
|
8405
8649
|
return {
|
|
8406
8650
|
...rest,
|
|
8407
|
-
propsSchema:
|
|
8651
|
+
propsSchema: z45.object(props),
|
|
8408
8652
|
...requires !== void 0 ? { requires } : {},
|
|
8409
8653
|
component: adaptComponent(render)
|
|
8410
8654
|
};
|
|
@@ -8630,7 +8874,7 @@ __export(presence_exports2, {
|
|
|
8630
8874
|
});
|
|
8631
8875
|
|
|
8632
8876
|
// src/widgets/presence/use-standing-signal.ts
|
|
8633
|
-
import { useMemo as
|
|
8877
|
+
import { useMemo as useMemo8 } from "react";
|
|
8634
8878
|
|
|
8635
8879
|
// src/widgets/presence/core-presence/standing-signal-store.ts
|
|
8636
8880
|
import { useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
@@ -8714,7 +8958,7 @@ function useConsumeStandingSignal(type) {
|
|
|
8714
8958
|
const session = useFourtySession();
|
|
8715
8959
|
const scope2 = session.sessionId === null ? void 0 : session.sessionId;
|
|
8716
8960
|
useRegisterSignalHandlers(
|
|
8717
|
-
|
|
8961
|
+
useMemo8(
|
|
8718
8962
|
() => ({
|
|
8719
8963
|
[type]: (payload) => {
|
|
8720
8964
|
const id = typeof payload.id === "string" && payload.id.length > 0 ? payload.id : type;
|
|
@@ -8725,7 +8969,7 @@ function useConsumeStandingSignal(type) {
|
|
|
8725
8969
|
)
|
|
8726
8970
|
);
|
|
8727
8971
|
const standing = useStandingOfType(type);
|
|
8728
|
-
return
|
|
8972
|
+
return useMemo8(() => {
|
|
8729
8973
|
if (standing === null) return null;
|
|
8730
8974
|
const id = standing.id;
|
|
8731
8975
|
return {
|
|
@@ -8956,10 +9200,10 @@ function presenceFactShape(fact) {
|
|
|
8956
9200
|
const value = fact.value.trim();
|
|
8957
9201
|
if (value.length === 0) return FACT_SHAPE.plain;
|
|
8958
9202
|
if (colorHexOf(value) !== null) return FACT_SHAPE.color;
|
|
8959
|
-
const
|
|
8960
|
-
if (
|
|
8961
|
-
const alone =
|
|
8962
|
-
if (alone && BARE_NUMERAL.test(
|
|
9203
|
+
const parts2 = factFigureParts(fact);
|
|
9204
|
+
if (parts2 === null) return FACT_SHAPE.plain;
|
|
9205
|
+
const alone = parts2.before.length === 0 && parts2.after.length === 0;
|
|
9206
|
+
if (alone && BARE_NUMERAL.test(parts2.figure)) return FACT_SHAPE.figure;
|
|
8963
9207
|
return FACT_SHAPE.measure;
|
|
8964
9208
|
}
|
|
8965
9209
|
|
|
@@ -9199,7 +9443,7 @@ function usePostHydrationTransforms() {
|
|
|
9199
9443
|
}
|
|
9200
9444
|
|
|
9201
9445
|
// src/projection/transform.ts
|
|
9202
|
-
import { useMemo as
|
|
9446
|
+
import { useMemo as useMemo10 } from "react";
|
|
9203
9447
|
|
|
9204
9448
|
// src/projection/preferences.ts
|
|
9205
9449
|
import { useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
@@ -9327,7 +9571,7 @@ var projectionTransform = {
|
|
|
9327
9571
|
use: () => {
|
|
9328
9572
|
const preferences2 = useProjectionPreferences();
|
|
9329
9573
|
const facts = useFacts();
|
|
9330
|
-
return
|
|
9574
|
+
return useMemo10(() => {
|
|
9331
9575
|
if (Object.keys(preferences2).length === 0) return null;
|
|
9332
9576
|
return buildTransform(preferences2, facts);
|
|
9333
9577
|
}, [preferences2, facts]);
|
|
@@ -9589,14 +9833,14 @@ function useFormFactor() {
|
|
|
9589
9833
|
}
|
|
9590
9834
|
|
|
9591
9835
|
// src/utils/use-inline-completion.ts
|
|
9592
|
-
import { useCallback as useCallback15, useMemo as
|
|
9836
|
+
import { useCallback as useCallback15, useMemo as useMemo11, useState as useState8 } from "react";
|
|
9593
9837
|
function useInlineCompletion(opts) {
|
|
9594
9838
|
const { value, candidates } = opts;
|
|
9595
9839
|
const minChars = opts.minChars !== void 0 ? opts.minChars : 2;
|
|
9596
9840
|
const enabled = opts.enabled !== void 0 ? opts.enabled : true;
|
|
9597
9841
|
const [dismissedValue, setDismissedValue] = useState8(null);
|
|
9598
9842
|
const dismiss = useCallback15(() => setDismissedValue(value), [value]);
|
|
9599
|
-
return
|
|
9843
|
+
return useMemo11(() => {
|
|
9600
9844
|
if (!enabled || value.length < minChars || dismissedValue === value) {
|
|
9601
9845
|
return { completion: "", ghost: "", active: false, dismiss };
|
|
9602
9846
|
}
|
|
@@ -10440,18 +10684,18 @@ __export(ecommerce_exports, {
|
|
|
10440
10684
|
});
|
|
10441
10685
|
|
|
10442
10686
|
// ../spacestation/src/analytics/ecommerce/surfacing.ts
|
|
10443
|
-
import { z as
|
|
10687
|
+
import { z as z46 } from "zod";
|
|
10444
10688
|
var PRODUCTS_SURFACED = defineEventKind(
|
|
10445
10689
|
"commerce.products_surfaced",
|
|
10446
10690
|
"client",
|
|
10447
|
-
|
|
10691
|
+
z46.object({
|
|
10448
10692
|
/** The turn whose commit this describes. Minted where the prompt signal
|
|
10449
10693
|
* is built and shared with `agent_runs`, so the read layer can line a
|
|
10450
10694
|
* surfacing up against the prompt that asked for it. */
|
|
10451
|
-
turnId:
|
|
10695
|
+
turnId: z46.string().min(1).max(128),
|
|
10452
10696
|
/** Distinct entity refs this turn placed that were not on the canvas
|
|
10453
10697
|
* before it. ZERO IS A REAL VALUE — see the header. */
|
|
10454
|
-
productCount:
|
|
10698
|
+
productCount: z46.number().int().nonnegative()
|
|
10455
10699
|
}).strict()
|
|
10456
10700
|
);
|
|
10457
10701
|
|
|
@@ -10473,14 +10717,14 @@ function isFunnelStep(value) {
|
|
|
10473
10717
|
}
|
|
10474
10718
|
|
|
10475
10719
|
// src/verticals/commerce/product/use-product-grid-filter.ts
|
|
10476
|
-
import { useCallback as useCallback17, useMemo as
|
|
10720
|
+
import { useCallback as useCallback17, useMemo as useMemo13, useState as useState11 } from "react";
|
|
10477
10721
|
function useProductGridFilter(chips) {
|
|
10478
|
-
const labelKey =
|
|
10722
|
+
const labelKey = useMemo13(() => chips.map((c) => c.label).join("|"), [chips]);
|
|
10479
10723
|
const first = chips[0];
|
|
10480
10724
|
const [activeLabel, setActiveLabel] = useState11(
|
|
10481
10725
|
first !== void 0 ? first.label : null
|
|
10482
10726
|
);
|
|
10483
|
-
const activeFromKey =
|
|
10727
|
+
const activeFromKey = useMemo13(() => {
|
|
10484
10728
|
void labelKey;
|
|
10485
10729
|
if (first === void 0) return null;
|
|
10486
10730
|
const found = chips.find((c) => c.label === activeLabel);
|
|
@@ -10493,7 +10737,7 @@ function useProductGridFilter(chips) {
|
|
|
10493
10737
|
}
|
|
10494
10738
|
|
|
10495
10739
|
// src/verticals/commerce/product/use-product-detail.ts
|
|
10496
|
-
import { useCallback as useCallback19, useMemo as
|
|
10740
|
+
import { useCallback as useCallback19, useMemo as useMemo14, useRef as useRef13, useState as useState14 } from "react";
|
|
10497
10741
|
|
|
10498
10742
|
// src/verticals/commerce/checkout/use-buy-now.ts
|
|
10499
10743
|
import { useCallback as useCallback18, useEffect as useEffect16, useState as useState12 } from "react";
|
|
@@ -10788,15 +11032,15 @@ function useProductDetail(product) {
|
|
|
10788
11032
|
}
|
|
10789
11033
|
const { selectedVariants, setSelectedVariants, markTouched } = useSelectedVariantsState(product, facts);
|
|
10790
11034
|
const desc = useExpandable(false);
|
|
10791
|
-
const variantGroups =
|
|
11035
|
+
const variantGroups = useMemo14(
|
|
10792
11036
|
() => deriveVariantGroups(product),
|
|
10793
11037
|
[product]
|
|
10794
11038
|
);
|
|
10795
|
-
const allSelected =
|
|
11039
|
+
const allSelected = useMemo14(
|
|
10796
11040
|
() => variantGroups.every((g) => selectedVariants[g.name] !== void 0),
|
|
10797
11041
|
[variantGroups, selectedVariants]
|
|
10798
11042
|
);
|
|
10799
|
-
const missingGroup =
|
|
11043
|
+
const missingGroup = useMemo14(
|
|
10800
11044
|
() => variantGroups.find((g) => selectedVariants[g.name] === void 0),
|
|
10801
11045
|
[variantGroups, selectedVariants]
|
|
10802
11046
|
);
|
|
@@ -11105,7 +11349,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11105
11349
|
}
|
|
11106
11350
|
|
|
11107
11351
|
// src/verticals/commerce/cart/cart-action-failures.ts
|
|
11108
|
-
import { useMemo as
|
|
11352
|
+
import { useMemo as useMemo15, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
11109
11353
|
var FAILURE_TTL_MS = 2 * 6e4;
|
|
11110
11354
|
var FAILURE_CAP = 5;
|
|
11111
11355
|
var failures = [];
|
|
@@ -11157,7 +11401,7 @@ function useCartActionFailures() {
|
|
|
11157
11401
|
function useCartActionFailuresFor(productIdsInCart) {
|
|
11158
11402
|
const all = useCartActionFailures();
|
|
11159
11403
|
const key = productIdsInCart.join("\0");
|
|
11160
|
-
return
|
|
11404
|
+
return useMemo15(() => {
|
|
11161
11405
|
const present = new Set(key.length === 0 ? [] : key.split("\0"));
|
|
11162
11406
|
return all.filter((f) => f.productId !== void 0 && !present.has(f.productId));
|
|
11163
11407
|
}, [all, key]);
|
|
@@ -11951,7 +12195,7 @@ function useContentActions() {
|
|
|
11951
12195
|
import { useEffect as useEffect19, useState as useState18 } from "react";
|
|
11952
12196
|
|
|
11953
12197
|
// package.json
|
|
11954
|
-
var version = "0.5.
|
|
12198
|
+
var version = "0.5.2";
|
|
11955
12199
|
|
|
11956
12200
|
// src/host/host-modules.ts
|
|
11957
12201
|
import * as react from "react";
|
|
@@ -12038,12 +12282,16 @@ function Spacefront(props) {
|
|
|
12038
12282
|
}
|
|
12039
12283
|
|
|
12040
12284
|
// src/npm.ts
|
|
12041
|
-
import { z as
|
|
12285
|
+
import { z as z48 } from "zod";
|
|
12042
12286
|
export {
|
|
12043
12287
|
ACQUISITION_KIND_LABELS,
|
|
12044
12288
|
ACTIVE_PANEL_ATTR,
|
|
12045
12289
|
ACTIVE_PANEL_SELECTOR,
|
|
12046
12290
|
AGENT_ASK_SIGNAL,
|
|
12291
|
+
AGENT_DIRECTIVE_KINDS,
|
|
12292
|
+
AGENT_DIRECTIVE_SEVERITIES,
|
|
12293
|
+
AGENT_DIRECTIVE_SOURCES,
|
|
12294
|
+
AGENT_DIRECTIVE_STATUSES,
|
|
12047
12295
|
ALLOWED_ATTACHMENT_TYPES,
|
|
12048
12296
|
ANALYTICS_CONSENTS,
|
|
12049
12297
|
ANALYTICS_MAX_QUEUED,
|
|
@@ -12051,6 +12299,7 @@ export {
|
|
|
12051
12299
|
ARRIVAL_MAX_VALUE_CHARS,
|
|
12052
12300
|
ARRIVAL_PARAMS,
|
|
12053
12301
|
ATTACHMENT_ACCEPT,
|
|
12302
|
+
AgentDirectiveSchema,
|
|
12054
12303
|
AgentOutputSchema,
|
|
12055
12304
|
AgentSessionSummarySchema,
|
|
12056
12305
|
AgentSignalSchema,
|
|
@@ -12179,13 +12428,16 @@ export {
|
|
|
12179
12428
|
LlmSessionsDailySchema,
|
|
12180
12429
|
LlmUsageBySessionSchema,
|
|
12181
12430
|
LlmUsageDailySchema,
|
|
12431
|
+
MAX_ACTIVE_AGENT_DIRECTIVES,
|
|
12182
12432
|
MAX_ATTACHMENT_BYTES,
|
|
12183
12433
|
MAX_VISITOR_PROMPT_CHARS,
|
|
12434
|
+
MIN_WIRE_PROTOCOL_VERSION,
|
|
12184
12435
|
MOBILE_VIEWPORT_MAX,
|
|
12185
12436
|
MoneySchema,
|
|
12186
12437
|
NAVIGATE_SIGNAL,
|
|
12187
12438
|
NavigatePayloadSchema,
|
|
12188
12439
|
NullComponent,
|
|
12440
|
+
OLDEST_SUPPORTED_SDK,
|
|
12189
12441
|
PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
12190
12442
|
PRESENCE_FACT_DISMISS_SIGNAL,
|
|
12191
12443
|
PRESENCE_FLOW,
|
|
@@ -12196,6 +12448,7 @@ export {
|
|
|
12196
12448
|
PRODUCT_SELECT_OPTION_SIGNAL,
|
|
12197
12449
|
PRODUCT_VARIANTS_SCOPE,
|
|
12198
12450
|
PROJECTION_SET_SIGNAL,
|
|
12451
|
+
PackageBundleRefSchema,
|
|
12199
12452
|
PackageLookupProvider,
|
|
12200
12453
|
PackageReleaseSchema,
|
|
12201
12454
|
PageSchema,
|
|
@@ -12219,16 +12472,21 @@ export {
|
|
|
12219
12472
|
RecordVerdictInputSchema,
|
|
12220
12473
|
RecordableVerdictSchema,
|
|
12221
12474
|
RegistryProvider,
|
|
12475
|
+
ReorderAgentDirectivesInputSchema,
|
|
12222
12476
|
ReviewAggregateSchema,
|
|
12223
12477
|
ReviewSchema,
|
|
12224
12478
|
SCANNING_FORM,
|
|
12479
|
+
SDK_SHIMS,
|
|
12480
|
+
SDK_VERSION_PATTERN,
|
|
12225
12481
|
SELECTION_ORIGIN_VISITOR,
|
|
12226
12482
|
SIGNAL_PATCH_PREFIX,
|
|
12483
|
+
SOCKET_TICKET_PARAM,
|
|
12227
12484
|
STRUCTURAL_BASELINE_CATALOG,
|
|
12228
12485
|
STRUCTURAL_BASELINE_TYPES,
|
|
12229
12486
|
SURFACES,
|
|
12230
12487
|
SURFACE_DISPOSITION,
|
|
12231
12488
|
ScrollContainerProvider,
|
|
12489
|
+
SdkVersionSchema,
|
|
12232
12490
|
SelectedOptionSchema,
|
|
12233
12491
|
SessionActivityEventSchema,
|
|
12234
12492
|
SessionActivitySchema,
|
|
@@ -12253,6 +12511,8 @@ export {
|
|
|
12253
12511
|
ShellRootContext,
|
|
12254
12512
|
ShimmerSweep,
|
|
12255
12513
|
SiblingProductSchema,
|
|
12514
|
+
SpaceAgentDirectiveListItemSchema,
|
|
12515
|
+
SpaceAgentDirectiveSchema,
|
|
12256
12516
|
SpaceBrandMarkSchema,
|
|
12257
12517
|
SpaceBugSchema,
|
|
12258
12518
|
Spacefront,
|
|
@@ -12275,8 +12535,10 @@ export {
|
|
|
12275
12535
|
TransitionProvider,
|
|
12276
12536
|
TurnAskPlacementProvider,
|
|
12277
12537
|
TurnAskSchema,
|
|
12538
|
+
TurnScopeProvider,
|
|
12278
12539
|
UIElementSchema,
|
|
12279
12540
|
UnsupportedSchemaError,
|
|
12541
|
+
UpdateAgentDirectiveInputSchema,
|
|
12280
12542
|
UpdateCommentInputSchema,
|
|
12281
12543
|
VARIANT_SELECTED_OBSERVATION,
|
|
12282
12544
|
VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -12293,6 +12555,9 @@ export {
|
|
|
12293
12555
|
ViewportWindowContext,
|
|
12294
12556
|
ViewportWindowProvider,
|
|
12295
12557
|
VisitorIdDurabilitySchema,
|
|
12558
|
+
WIRE_PROTOCOL_PARAM,
|
|
12559
|
+
WIRE_PROTOCOL_UNSUPPORTED_CLOSE,
|
|
12560
|
+
WIRE_PROTOCOL_VERSION,
|
|
12296
12561
|
WORKSPACE_THEME_PACKAGES,
|
|
12297
12562
|
WireCatalogEntrySchema,
|
|
12298
12563
|
WireCatalogSchema,
|
|
@@ -12340,6 +12605,7 @@ export {
|
|
|
12340
12605
|
collectLayoutGids,
|
|
12341
12606
|
collectPlacedEntityRefs,
|
|
12342
12607
|
colorHexOf,
|
|
12608
|
+
compareSdkVersions,
|
|
12343
12609
|
compressArray,
|
|
12344
12610
|
compressString,
|
|
12345
12611
|
computeActiveChips,
|
|
@@ -12505,6 +12771,8 @@ export {
|
|
|
12505
12771
|
scopedAttributeKey,
|
|
12506
12772
|
scrollEventTarget,
|
|
12507
12773
|
scrollPaddingTopOf,
|
|
12774
|
+
sdkShimsFor,
|
|
12775
|
+
sdkWindowProblem,
|
|
12508
12776
|
selectItemVariants,
|
|
12509
12777
|
selectedOptionsToRecord,
|
|
12510
12778
|
serverState,
|
|
@@ -12689,5 +12957,5 @@ export {
|
|
|
12689
12957
|
wipeProfile,
|
|
12690
12958
|
withCartActorOrigin,
|
|
12691
12959
|
withInteractionTracking,
|
|
12692
|
-
|
|
12960
|
+
z48 as z
|
|
12693
12961
|
};
|