@40rty/ams-sdk 0.5.1 → 0.5.3
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 +639 -479
- package/dist/types/ecommerce/src/attribute-buckets.d.ts +2 -2
- package/dist/types/ecommerce/src/base-attributes.d.ts +3 -3
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +1 -1
- 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 +6 -0
- package/dist/types/sdk/src/analytics/scope.d.ts +7 -0
- package/dist/types/sdk/src/host/host-modules.d.ts +238 -36
- package/dist/types/sdk/src/session/turn-attributed-session.d.ts +4 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +3 -0
- package/dist/types/sdk/src/widgets/presence/core-presence/fact-shape.d.ts +1 -1
- package/dist/types/sdk/src/widgets/presence/core-presence/standing-signal-store.d.ts +1 -1
- package/dist/types/spacestation/src/analytics/envelope.d.ts +24 -0
- package/dist/types/spacestation/src/catalog/catalog-schemas.d.ts +1 -1
- package/dist/types/spacestation/src/catalog/element-filled.d.ts +2 -2
- package/dist/types/spacestation/src/catalog/wire/package-release.d.ts +10 -0
- package/dist/types/spacestation/src/commerce/cart-add-signal.d.ts +10 -0
- package/dist/types/spacestation/src/contracts/retrieval/ecommerce/option-values.d.ts +1 -1
- package/dist/types/spacestation/src/index.d.ts +2 -0
- package/dist/types/spacestation/src/layout/layout.d.ts +3 -3
- 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/space-config.d.ts +1 -1
- package/dist/types/spacestation/src/space/trace.d.ts +12 -12
- package/dist/types/spacestation/src/space/workspace-catalog.d.ts +4 -4
- package/dist/types/spacestation/src/trace/trace-diagnostics.d.ts +8 -0
- package/dist/types/spacestation/src/trace/trace-envelopes.d.ts +1 -1
- package/dist/types/spacestation/src/trace/trace-events.d.ts +1 -1
- 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,6 +152,7 @@ __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,
|
|
152
158
|
MIN_WIRE_PROTOCOL_VERSION: () => MIN_WIRE_PROTOCOL_VERSION,
|
|
@@ -190,6 +196,7 @@ __export(src_exports3, {
|
|
|
190
196
|
RecordVerdictInputSchema: () => RecordVerdictInputSchema,
|
|
191
197
|
RecordableVerdictSchema: () => RecordableVerdictSchema,
|
|
192
198
|
RegistryProvider: () => RegistryProvider,
|
|
199
|
+
ReorderAgentDirectivesInputSchema: () => ReorderAgentDirectivesInputSchema,
|
|
193
200
|
ReviewAggregateSchema: () => ReviewAggregateSchema,
|
|
194
201
|
ReviewSchema: () => ReviewSchema,
|
|
195
202
|
SCANNING_FORM: () => SCANNING_FORM,
|
|
@@ -228,6 +235,8 @@ __export(src_exports3, {
|
|
|
228
235
|
ShellRootContext: () => ShellRootContext,
|
|
229
236
|
ShimmerSweep: () => ShimmerSweep,
|
|
230
237
|
SiblingProductSchema: () => SiblingProductSchema,
|
|
238
|
+
SpaceAgentDirectiveListItemSchema: () => SpaceAgentDirectiveListItemSchema,
|
|
239
|
+
SpaceAgentDirectiveSchema: () => SpaceAgentDirectiveSchema,
|
|
231
240
|
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
232
241
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
233
242
|
SpacefrontCanvas: () => SpacefrontCanvas,
|
|
@@ -249,8 +258,10 @@ __export(src_exports3, {
|
|
|
249
258
|
TransitionProvider: () => TransitionProvider,
|
|
250
259
|
TurnAskPlacementProvider: () => TurnAskPlacementProvider,
|
|
251
260
|
TurnAskSchema: () => TurnAskSchema,
|
|
261
|
+
TurnScopeProvider: () => TurnScopeProvider,
|
|
252
262
|
UIElementSchema: () => UIElementSchema,
|
|
253
263
|
UnsupportedSchemaError: () => UnsupportedSchemaError,
|
|
264
|
+
UpdateAgentDirectiveInputSchema: () => UpdateAgentDirectiveInputSchema,
|
|
254
265
|
UpdateCommentInputSchema: () => UpdateCommentInputSchema,
|
|
255
266
|
VARIANT_SELECTED_OBSERVATION: () => VARIANT_SELECTED_OBSERVATION,
|
|
256
267
|
VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -651,6 +662,7 @@ __export(src_exports3, {
|
|
|
651
662
|
useTurnAsk: () => useTurnAsk,
|
|
652
663
|
useTurnAskPlacement: () => useTurnAskPlacement,
|
|
653
664
|
useTurnAskReply: () => useTurnAskReply,
|
|
665
|
+
useTurnScope: () => useTurnScope,
|
|
654
666
|
useUndismissedFacts: () => useUndismissedFacts,
|
|
655
667
|
useVariantSelections: () => useVariantSelections,
|
|
656
668
|
useViewportWindow: () => useViewportWindow,
|
|
@@ -680,6 +692,7 @@ __export(analytics_exports2, {
|
|
|
680
692
|
CONSENT_DISPOSITION: () => CONSENT_DISPOSITION,
|
|
681
693
|
DROP_REASONS: () => DROP_REASONS,
|
|
682
694
|
SURFACE_DISPOSITION: () => SURFACE_DISPOSITION,
|
|
695
|
+
TurnScopeProvider: () => TurnScopeProvider,
|
|
683
696
|
consentDisposition: () => consentDisposition,
|
|
684
697
|
createAnalyticsScope: () => createAnalyticsScope,
|
|
685
698
|
defineEventKind: () => defineEventKind,
|
|
@@ -687,7 +700,8 @@ __export(analytics_exports2, {
|
|
|
687
700
|
surfaceEmits: () => surfaceEmits,
|
|
688
701
|
surfaceSuppressionReason: () => surfaceSuppressionReason,
|
|
689
702
|
useAnalyticsSink: () => useAnalyticsSink,
|
|
690
|
-
useOptionalAnalyticsSink: () => useOptionalAnalyticsSink
|
|
703
|
+
useOptionalAnalyticsSink: () => useOptionalAnalyticsSink,
|
|
704
|
+
useTurnScope: () => useTurnScope
|
|
691
705
|
});
|
|
692
706
|
|
|
693
707
|
// ../spacestation/src/analytics/index.ts
|
|
@@ -822,7 +836,16 @@ var AnalyticsWireEventSchema = z3.object({
|
|
|
822
836
|
*/
|
|
823
837
|
sessionId: z3.string().min(1).max(128),
|
|
824
838
|
kind: z3.string().min(1).max(128),
|
|
825
|
-
payload: z3.record(z3.unknown())
|
|
839
|
+
payload: z3.record(z3.unknown()),
|
|
840
|
+
/**
|
|
841
|
+
* The agent turn whose canvas the event came from — stamped by the scope
|
|
842
|
+
* from the element the emit ran inside, never by the emit site; `null` when
|
|
843
|
+
* it ran outside any turn (the cart drawer, a root bridge). OPTIONAL because
|
|
844
|
+
* a bundle older than this field omits it, and the envelope's strip posture
|
|
845
|
+
* (header) is what keeps that bundle's batch alive. Lands in the typed
|
|
846
|
+
* `client_events.turn_id` column — the join to `agent_runs.turn_id`.
|
|
847
|
+
*/
|
|
848
|
+
turnId: z3.string().min(1).max(128).nullable().optional()
|
|
826
849
|
});
|
|
827
850
|
var AnalyticsBatchSchema = z3.object({
|
|
828
851
|
/** One mount's whole life. Lets the server see a mount's batches as one
|
|
@@ -961,7 +984,8 @@ var Outbox = class {
|
|
|
961
984
|
occurredAt: event.occurredAt,
|
|
962
985
|
kind: event.kind,
|
|
963
986
|
payload: event.payload,
|
|
964
|
-
sessionId: event.sessionId
|
|
987
|
+
sessionId: event.sessionId,
|
|
988
|
+
turnId: event.turnId === void 0 ? null : event.turnId
|
|
965
989
|
}));
|
|
966
990
|
this.rows.unshift(...restored);
|
|
967
991
|
if (this.rows.length <= this.maxQueued) return;
|
|
@@ -989,7 +1013,8 @@ var Outbox = class {
|
|
|
989
1013
|
occurredAt: row.occurredAt,
|
|
990
1014
|
kind: row.kind,
|
|
991
1015
|
payload: row.payload,
|
|
992
|
-
sessionId
|
|
1016
|
+
sessionId,
|
|
1017
|
+
turnId: row.turnId
|
|
993
1018
|
};
|
|
994
1019
|
stamped += 1;
|
|
995
1020
|
}
|
|
@@ -1010,7 +1035,8 @@ var Outbox = class {
|
|
|
1010
1035
|
occurredAt: row.occurredAt,
|
|
1011
1036
|
sessionId: row.sessionId,
|
|
1012
1037
|
kind: row.kind,
|
|
1013
|
-
payload: row.payload
|
|
1038
|
+
payload: row.payload,
|
|
1039
|
+
turnId: row.turnId
|
|
1014
1040
|
});
|
|
1015
1041
|
}
|
|
1016
1042
|
this.rows.length = 0;
|
|
@@ -1077,40 +1103,54 @@ function createEmittingScope(foundation) {
|
|
|
1077
1103
|
events
|
|
1078
1104
|
};
|
|
1079
1105
|
}
|
|
1106
|
+
function record2(turnId, kindName, payload) {
|
|
1107
|
+
try {
|
|
1108
|
+
if (closed) {
|
|
1109
|
+
ledger.record("scope-closed", 1, "an event arrived while the scope was closed");
|
|
1110
|
+
return;
|
|
1111
|
+
}
|
|
1112
|
+
const disposition = consentDisposition(consent);
|
|
1113
|
+
if (disposition.mode === "refuse") {
|
|
1114
|
+
ledger.record("consent-withheld", 1, disposition.because);
|
|
1115
|
+
return;
|
|
1116
|
+
}
|
|
1117
|
+
if (!isWirePayload(payload)) {
|
|
1118
|
+
throw new Error(`payload for "${kindName}" is not an object`);
|
|
1119
|
+
}
|
|
1120
|
+
const row = {
|
|
1121
|
+
eventId: config.newEventId(),
|
|
1122
|
+
// Stamped at EMIT, never at flush: this row may sit here for the
|
|
1123
|
+
// session boot's whole ~94s retry budget.
|
|
1124
|
+
occurredAt: config.now(),
|
|
1125
|
+
kind: kindName,
|
|
1126
|
+
payload,
|
|
1127
|
+
sessionId,
|
|
1128
|
+
turnId
|
|
1129
|
+
};
|
|
1130
|
+
if (disposition.mode === "hold") consentHold.append(row);
|
|
1131
|
+
else outbox.append(row);
|
|
1132
|
+
} catch (err) {
|
|
1133
|
+
ledger.record("emit-threw", 1, err instanceof Error ? err.message : String(err));
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
function sinkForTurn(turnId) {
|
|
1137
|
+
return {
|
|
1138
|
+
emit(kind, payload, ...guard) {
|
|
1139
|
+
void guard;
|
|
1140
|
+
record2(turnId, kind.name, payload);
|
|
1141
|
+
},
|
|
1142
|
+
forTurn: sinkForTurn
|
|
1143
|
+
};
|
|
1144
|
+
}
|
|
1080
1145
|
return {
|
|
1081
1146
|
scopeId,
|
|
1082
1147
|
surface: config.surface,
|
|
1083
1148
|
spaceSlug: config.spaceSlug,
|
|
1084
1149
|
emit(kind, payload, ...guard) {
|
|
1085
1150
|
void guard;
|
|
1086
|
-
|
|
1087
|
-
if (closed) {
|
|
1088
|
-
ledger.record("scope-closed", 1, "an event arrived while the scope was closed");
|
|
1089
|
-
return;
|
|
1090
|
-
}
|
|
1091
|
-
const disposition = consentDisposition(consent);
|
|
1092
|
-
if (disposition.mode === "refuse") {
|
|
1093
|
-
ledger.record("consent-withheld", 1, disposition.because);
|
|
1094
|
-
return;
|
|
1095
|
-
}
|
|
1096
|
-
if (!isWirePayload(payload)) {
|
|
1097
|
-
throw new Error(`payload for "${kind.name}" is not an object`);
|
|
1098
|
-
}
|
|
1099
|
-
const row = {
|
|
1100
|
-
eventId: config.newEventId(),
|
|
1101
|
-
// Stamped at EMIT, never at flush: this row may sit here for the
|
|
1102
|
-
// session boot's whole ~94s retry budget.
|
|
1103
|
-
occurredAt: config.now(),
|
|
1104
|
-
kind: kind.name,
|
|
1105
|
-
payload,
|
|
1106
|
-
sessionId
|
|
1107
|
-
};
|
|
1108
|
-
if (disposition.mode === "hold") consentHold.append(row);
|
|
1109
|
-
else outbox.append(row);
|
|
1110
|
-
} catch (err) {
|
|
1111
|
-
ledger.record("emit-threw", 1, err instanceof Error ? err.message : String(err));
|
|
1112
|
-
}
|
|
1151
|
+
record2(null, kind.name, payload);
|
|
1113
1152
|
},
|
|
1153
|
+
forTurn: sinkForTurn,
|
|
1114
1154
|
bindSession(nextSessionId) {
|
|
1115
1155
|
if (nextSessionId.length === 0) {
|
|
1116
1156
|
throw new Error("[fourty/analytics] bindSession requires a non-empty session id");
|
|
@@ -1227,6 +1267,11 @@ function createInertScope(foundation, because) {
|
|
|
1227
1267
|
void guard;
|
|
1228
1268
|
ledger.record("surface-suppressed", 1, because);
|
|
1229
1269
|
},
|
|
1270
|
+
/** Suppressed either way — a turn changes nothing about a surface that
|
|
1271
|
+
* records nothing. */
|
|
1272
|
+
forTurn() {
|
|
1273
|
+
return this;
|
|
1274
|
+
},
|
|
1230
1275
|
/** Nothing is held, so there is nothing to attribute. The mount calls this
|
|
1231
1276
|
* on every surface; making it a no-op here is what keeps the mount free of
|
|
1232
1277
|
* a surface branch. */
|
|
@@ -1344,11 +1389,20 @@ function createAnalyticsScope(config) {
|
|
|
1344
1389
|
}
|
|
1345
1390
|
|
|
1346
1391
|
// src/analytics/scope-context.tsx
|
|
1347
|
-
import { createContext, useContext } from "react";
|
|
1392
|
+
import { createContext, useContext, useMemo } from "react";
|
|
1348
1393
|
var AnalyticsSinkContext = createContext(null);
|
|
1349
1394
|
var AnalyticsSinkProvider = AnalyticsSinkContext.Provider;
|
|
1395
|
+
var TurnScopeContext = createContext(null);
|
|
1396
|
+
var TurnScopeProvider = TurnScopeContext.Provider;
|
|
1397
|
+
function useTurnScope() {
|
|
1398
|
+
return useContext(TurnScopeContext);
|
|
1399
|
+
}
|
|
1400
|
+
function useTurnAttributed(sink) {
|
|
1401
|
+
const turnId = useContext(TurnScopeContext);
|
|
1402
|
+
return useMemo(() => sink === null || turnId === null ? sink : sink.forTurn(turnId), [sink, turnId]);
|
|
1403
|
+
}
|
|
1350
1404
|
function useAnalyticsSink() {
|
|
1351
|
-
const sink = useContext(AnalyticsSinkContext);
|
|
1405
|
+
const sink = useTurnAttributed(useContext(AnalyticsSinkContext));
|
|
1352
1406
|
if (sink === null) {
|
|
1353
1407
|
throw new Error(
|
|
1354
1408
|
"useAnalyticsSink must be used within <AnalyticsScopeMount> (inside <FourtyProvider>)"
|
|
@@ -1358,7 +1412,7 @@ function useAnalyticsSink() {
|
|
|
1358
1412
|
}
|
|
1359
1413
|
var warnedMissingSink = false;
|
|
1360
1414
|
function useOptionalAnalyticsSink() {
|
|
1361
|
-
const sink = useContext(AnalyticsSinkContext);
|
|
1415
|
+
const sink = useTurnAttributed(useContext(AnalyticsSinkContext));
|
|
1362
1416
|
if (sink === null && !warnedMissingSink && typeof window !== "undefined") {
|
|
1363
1417
|
warnedMissingSink = true;
|
|
1364
1418
|
console.warn(
|
|
@@ -1383,34 +1437,21 @@ __export(session_exports, {
|
|
|
1383
1437
|
|
|
1384
1438
|
// src/session/FourtySessionContext.tsx
|
|
1385
1439
|
import { createContext as createContext2, useContext as useContext2, useSyncExternalStore } from "react";
|
|
1386
|
-
var FourtySessionContext = createContext2(null);
|
|
1387
|
-
function useFourtySession() {
|
|
1388
|
-
const ctx = useContext2(FourtySessionContext);
|
|
1389
|
-
if (!ctx) throw new Error("useFourtySession must be used within a <FourtyProvider>");
|
|
1390
|
-
return ctx;
|
|
1391
|
-
}
|
|
1392
|
-
function useOptionalFourtySession() {
|
|
1393
|
-
return useContext2(FourtySessionContext);
|
|
1394
|
-
}
|
|
1395
|
-
function useComposerDraft() {
|
|
1396
|
-
const { composerDraftStore, setComposerDraft } = useFourtySession();
|
|
1397
|
-
const value = useSyncExternalStore(
|
|
1398
|
-
composerDraftStore.subscribe,
|
|
1399
|
-
composerDraftStore.get,
|
|
1400
|
-
composerDraftStore.get
|
|
1401
|
-
);
|
|
1402
|
-
return [value, setComposerDraft];
|
|
1403
|
-
}
|
|
1404
1440
|
|
|
1405
|
-
// src/session/
|
|
1406
|
-
import {
|
|
1441
|
+
// src/session/turn-attributed-session.ts
|
|
1442
|
+
import { useMemo as useMemo2 } from "react";
|
|
1407
1443
|
|
|
1408
1444
|
// ../spacestation/src/index.ts
|
|
1409
1445
|
var src_exports = {};
|
|
1410
1446
|
__export(src_exports, {
|
|
1447
|
+
AGENT_DIRECTIVE_KINDS: () => AGENT_DIRECTIVE_KINDS,
|
|
1448
|
+
AGENT_DIRECTIVE_SEVERITIES: () => AGENT_DIRECTIVE_SEVERITIES,
|
|
1449
|
+
AGENT_DIRECTIVE_SOURCES: () => AGENT_DIRECTIVE_SOURCES,
|
|
1450
|
+
AGENT_DIRECTIVE_STATUSES: () => AGENT_DIRECTIVE_STATUSES,
|
|
1411
1451
|
ALLOWED_ATTACHMENT_TYPES: () => ALLOWED_ATTACHMENT_TYPES,
|
|
1412
1452
|
ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
|
|
1413
1453
|
ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
|
|
1454
|
+
AgentDirectiveSchema: () => AgentDirectiveSchema,
|
|
1414
1455
|
AgentOutputSchema: () => AgentOutputSchema,
|
|
1415
1456
|
AgentSessionSummarySchema: () => AgentSessionSummarySchema,
|
|
1416
1457
|
AgentSignalSchema: () => AgentSignalSchema,
|
|
@@ -1476,6 +1517,7 @@ __export(src_exports, {
|
|
|
1476
1517
|
LlmSessionsDailySchema: () => LlmSessionsDailySchema,
|
|
1477
1518
|
LlmUsageBySessionSchema: () => LlmUsageBySessionSchema,
|
|
1478
1519
|
LlmUsageDailySchema: () => LlmUsageDailySchema,
|
|
1520
|
+
MAX_ACTIVE_AGENT_DIRECTIVES: () => MAX_ACTIVE_AGENT_DIRECTIVES,
|
|
1479
1521
|
MAX_ATTACHMENT_BYTES: () => MAX_ATTACHMENT_BYTES,
|
|
1480
1522
|
MAX_VISITOR_PROMPT_CHARS: () => MAX_VISITOR_PROMPT_CHARS,
|
|
1481
1523
|
MIN_WIRE_PROTOCOL_VERSION: () => MIN_WIRE_PROTOCOL_VERSION,
|
|
@@ -1501,6 +1543,7 @@ __export(src_exports, {
|
|
|
1501
1543
|
RESERVED_ID_SET: () => RESERVED_ID_SET,
|
|
1502
1544
|
RecordVerdictInputSchema: () => RecordVerdictInputSchema,
|
|
1503
1545
|
RecordableVerdictSchema: () => RecordableVerdictSchema,
|
|
1546
|
+
ReorderAgentDirectivesInputSchema: () => ReorderAgentDirectivesInputSchema,
|
|
1504
1547
|
SDK_SHIMS: () => SDK_SHIMS,
|
|
1505
1548
|
SDK_VERSION_PATTERN: () => SDK_VERSION_PATTERN,
|
|
1506
1549
|
SELECTION_ORIGIN_VISITOR: () => SELECTION_ORIGIN_VISITOR,
|
|
@@ -1529,6 +1572,8 @@ __export(src_exports, {
|
|
|
1529
1572
|
SessionVerdictSchema: () => SessionVerdictSchema,
|
|
1530
1573
|
ShellConfigSchema: () => ShellConfigSchema,
|
|
1531
1574
|
ShellMenuItemSchema: () => ShellMenuItemSchema,
|
|
1575
|
+
SpaceAgentDirectiveListItemSchema: () => SpaceAgentDirectiveListItemSchema,
|
|
1576
|
+
SpaceAgentDirectiveSchema: () => SpaceAgentDirectiveSchema,
|
|
1532
1577
|
SpaceBrandMarkSchema: () => SpaceBrandMarkSchema,
|
|
1533
1578
|
SpaceBugSchema: () => SpaceBugSchema,
|
|
1534
1579
|
SpecSchema: () => SpecSchema,
|
|
@@ -1546,6 +1591,7 @@ __export(src_exports, {
|
|
|
1546
1591
|
TurnAskSchema: () => TurnAskSchema,
|
|
1547
1592
|
UIElementSchema: () => UIElementSchema,
|
|
1548
1593
|
UnsupportedSchemaError: () => UnsupportedSchemaError,
|
|
1594
|
+
UpdateAgentDirectiveInputSchema: () => UpdateAgentDirectiveInputSchema,
|
|
1549
1595
|
UpdateCommentInputSchema: () => UpdateCommentInputSchema,
|
|
1550
1596
|
VARIANT_SELECTED_OBSERVATION: () => VARIANT_SELECTED_OBSERVATION,
|
|
1551
1597
|
VIEW_EXHAUSTED_SIGNAL: () => VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -2156,6 +2202,14 @@ var CartAddSignalPayloadSchema = z13.object({
|
|
|
2156
2202
|
quantity: z13.number().optional(),
|
|
2157
2203
|
selections: z13.record(z13.string()).optional(),
|
|
2158
2204
|
optimisticLine: z13.unknown().optional(),
|
|
2205
|
+
/**
|
|
2206
|
+
* The agent turn whose canvas element the add came from — stamped by the sdk
|
|
2207
|
+
* session hooks for a producer inside a turn (`turn-attributed-session.ts`),
|
|
2208
|
+
* absent for one outside any (the agent's own add, the header cart, WebMCP).
|
|
2209
|
+
* Carried for the same reason as `origin`: the handler that emits the outcome
|
|
2210
|
+
* sees only this payload.
|
|
2211
|
+
*/
|
|
2212
|
+
turnId: z13.string().min(1).optional(),
|
|
2159
2213
|
/**
|
|
2160
2214
|
* Whether a LANDED add announces itself by opening the cart drawer on the
|
|
2161
2215
|
* changed line. Absent means yes, which is every existing producer's
|
|
@@ -2798,6 +2852,8 @@ function isElementUnfilled(element, catalog, aliases, options) {
|
|
|
2798
2852
|
const props = element.props;
|
|
2799
2853
|
for (const { path, meta } of getResolvedPaths(entry.propsSchema)) {
|
|
2800
2854
|
if (options?.requireMaterialized !== true && derivedSourceFilled(meta, props)) continue;
|
|
2855
|
+
const top = path[0];
|
|
2856
|
+
if (typeof top === "string" && isOptionalTopLevelProp(entry.propsSchema, top)) continue;
|
|
2801
2857
|
const expansions = Array.from(expandPath(props, path));
|
|
2802
2858
|
if (expansions.length === 0) return true;
|
|
2803
2859
|
for (const { value } of expansions) {
|
|
@@ -3461,6 +3517,14 @@ var PackageReleaseSchema = z27.object({
|
|
|
3461
3517
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
3462
3518
|
*/
|
|
3463
3519
|
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(),
|
|
3520
|
+
/**
|
|
3521
|
+
* The brand's SPACE prompt — its `prompts/space.md`, verbatim: sections split
|
|
3522
|
+
* by `<!-- section:<id> -->` markers, the same format as the platform's
|
|
3523
|
+
* `prompts/spaces/<slug>.md`, which it replaces for any space bound to this
|
|
3524
|
+
* package. How the brand speaks, what it sells and what it never claims ship
|
|
3525
|
+
* with the brand, and a release changes them with no platform deploy.
|
|
3526
|
+
*/
|
|
3527
|
+
spacePrompt: z27.string().min(1).max(2e5).optional(),
|
|
3464
3528
|
/**
|
|
3465
3529
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
3466
3530
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
@@ -3817,6 +3881,51 @@ function scopeOfAttributeKey(config, key) {
|
|
|
3817
3881
|
return match;
|
|
3818
3882
|
}
|
|
3819
3883
|
|
|
3884
|
+
// ../spacestation/src/space/agent-directive.ts
|
|
3885
|
+
import { z as z36 } from "zod";
|
|
3886
|
+
var MAX_ACTIVE_AGENT_DIRECTIVES = 12;
|
|
3887
|
+
var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
|
|
3888
|
+
var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
|
|
3889
|
+
var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
|
|
3890
|
+
var AGENT_DIRECTIVE_STATUSES = ["proposed", "active", "rejected", "retired"];
|
|
3891
|
+
var AgentDirectiveSchema = z36.object({
|
|
3892
|
+
name: z36.string().trim().min(1).max(80),
|
|
3893
|
+
kind: z36.enum(AGENT_DIRECTIVE_KINDS),
|
|
3894
|
+
severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
3895
|
+
/** No bare URL: a URL is a hallucination surface, and a handle is not a
|
|
3896
|
+
* product name. */
|
|
3897
|
+
text: z36.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
|
|
3898
|
+
}).strict();
|
|
3899
|
+
var SpaceAgentDirectiveSchema = z36.object({
|
|
3900
|
+
id: z36.string(),
|
|
3901
|
+
position: z36.number().int(),
|
|
3902
|
+
name: z36.string(),
|
|
3903
|
+
kind: z36.enum(AGENT_DIRECTIVE_KINDS),
|
|
3904
|
+
severity: z36.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
3905
|
+
text: z36.string(),
|
|
3906
|
+
source: z36.enum(AGENT_DIRECTIVE_SOURCES),
|
|
3907
|
+
status: z36.enum(AGENT_DIRECTIVE_STATUSES),
|
|
3908
|
+
/** Who wrote it; null for a lesson the system proposed. */
|
|
3909
|
+
createdBy: z36.string().nullable(),
|
|
3910
|
+
/** Why a mined lesson was proposed; null for a directive a person wrote. */
|
|
3911
|
+
evidence: z36.record(z36.unknown()).nullable(),
|
|
3912
|
+
decidedBy: z36.string().nullable(),
|
|
3913
|
+
decidedAt: z36.string().nullable(),
|
|
3914
|
+
createdAt: z36.string()
|
|
3915
|
+
});
|
|
3916
|
+
var OutcomeTallySchema = z36.object({ turns: z36.number().int(), acted: z36.number().int() });
|
|
3917
|
+
var SpaceAgentDirectiveListItemSchema = SpaceAgentDirectiveSchema.extend({
|
|
3918
|
+
impact: z36.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
|
|
3919
|
+
});
|
|
3920
|
+
var UpdateAgentDirectiveInputSchema = z36.object({
|
|
3921
|
+
name: AgentDirectiveSchema.shape.name.optional(),
|
|
3922
|
+
kind: AgentDirectiveSchema.shape.kind.optional(),
|
|
3923
|
+
severity: AgentDirectiveSchema.shape.severity.optional(),
|
|
3924
|
+
text: AgentDirectiveSchema.shape.text.optional(),
|
|
3925
|
+
status: z36.enum(AGENT_DIRECTIVE_STATUSES).optional()
|
|
3926
|
+
}).strict();
|
|
3927
|
+
var ReorderAgentDirectivesInputSchema = z36.object({ ids: z36.array(z36.string()).min(1) }).strict();
|
|
3928
|
+
|
|
3820
3929
|
// ../spacestation/src/space/workspace-catalog.ts
|
|
3821
3930
|
var COMPONENT_SOURCE = {
|
|
3822
3931
|
ui: "@fourty/ui"
|
|
@@ -3879,30 +3988,30 @@ function hostingAllows(hosting, surface) {
|
|
|
3879
3988
|
}
|
|
3880
3989
|
|
|
3881
3990
|
// ../spacestation/src/space/trace.ts
|
|
3882
|
-
import { z as
|
|
3883
|
-
var RunTokenUsageSchema =
|
|
3884
|
-
input_tokens:
|
|
3885
|
-
output_tokens:
|
|
3886
|
-
cache_read_tokens:
|
|
3991
|
+
import { z as z37 } from "zod";
|
|
3992
|
+
var RunTokenUsageSchema = z37.object({
|
|
3993
|
+
input_tokens: z37.number().optional(),
|
|
3994
|
+
output_tokens: z37.number().optional(),
|
|
3995
|
+
cache_read_tokens: z37.number().optional()
|
|
3887
3996
|
});
|
|
3888
|
-
var TraceRecordSchema =
|
|
3889
|
-
id:
|
|
3890
|
-
spaceId:
|
|
3891
|
-
sessionId:
|
|
3997
|
+
var TraceRecordSchema = z37.object({
|
|
3998
|
+
id: z37.string().uuid(),
|
|
3999
|
+
spaceId: z37.string().uuid().nullable(),
|
|
4000
|
+
sessionId: z37.string(),
|
|
3892
4001
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
3893
4002
|
* for an unlocked space / anonymous unlock. */
|
|
3894
|
-
visitorEmail:
|
|
3895
|
-
userPrompt:
|
|
3896
|
-
branch:
|
|
3897
|
-
responseText:
|
|
3898
|
-
layout:
|
|
3899
|
-
phaseTimings:
|
|
3900
|
-
tokensByModel:
|
|
3901
|
-
toolCalls:
|
|
3902
|
-
diagnostics:
|
|
3903
|
-
latencyFirstText:
|
|
3904
|
-
latencyFirstPatch:
|
|
3905
|
-
latencyTotal:
|
|
4003
|
+
visitorEmail: z37.string().nullable(),
|
|
4004
|
+
userPrompt: z37.string(),
|
|
4005
|
+
branch: z37.string().nullable(),
|
|
4006
|
+
responseText: z37.string().nullable(),
|
|
4007
|
+
layout: z37.unknown().nullable(),
|
|
4008
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4009
|
+
tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
|
|
4010
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4011
|
+
diagnostics: z37.array(z37.unknown()).nullable(),
|
|
4012
|
+
latencyFirstText: z37.number().int().nullable(),
|
|
4013
|
+
latencyFirstPatch: z37.number().int().nullable(),
|
|
4014
|
+
latencyTotal: z37.number().int().nullable(),
|
|
3906
4015
|
/**
|
|
3907
4016
|
* The CLIENT's turn id for this run, or `null`.
|
|
3908
4017
|
*
|
|
@@ -3918,29 +4027,29 @@ var TraceRecordSchema = z36.object({
|
|
|
3918
4027
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3919
4028
|
* visitor asked something and got nothing.
|
|
3920
4029
|
*/
|
|
3921
|
-
turnId:
|
|
4030
|
+
turnId: z37.string().nullable(),
|
|
3922
4031
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
3923
4032
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
3924
|
-
trackerState:
|
|
3925
|
-
createdAt:
|
|
4033
|
+
trackerState: z37.unknown().nullable(),
|
|
4034
|
+
createdAt: z37.string()
|
|
3926
4035
|
});
|
|
3927
|
-
var MillisecondsSchema =
|
|
3928
|
-
var CreateTraceInputSchema =
|
|
3929
|
-
spaceId:
|
|
3930
|
-
sessionId:
|
|
3931
|
-
visitorEmail:
|
|
3932
|
-
userPrompt:
|
|
3933
|
-
branch:
|
|
3934
|
-
responseText:
|
|
3935
|
-
layout:
|
|
3936
|
-
phaseTimings:
|
|
3937
|
-
tokensByModel:
|
|
3938
|
-
toolCalls:
|
|
3939
|
-
diagnostics:
|
|
4036
|
+
var MillisecondsSchema = z37.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
4037
|
+
var CreateTraceInputSchema = z37.object({
|
|
4038
|
+
spaceId: z37.string().uuid().nullable(),
|
|
4039
|
+
sessionId: z37.string(),
|
|
4040
|
+
visitorEmail: z37.string().nullable(),
|
|
4041
|
+
userPrompt: z37.string(),
|
|
4042
|
+
branch: z37.string().nullable(),
|
|
4043
|
+
responseText: z37.string().nullable(),
|
|
4044
|
+
layout: z37.unknown().nullable(),
|
|
4045
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4046
|
+
tokensByModel: z37.record(RunTokenUsageSchema).nullable(),
|
|
4047
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4048
|
+
diagnostics: z37.array(z37.unknown()).nullable(),
|
|
3940
4049
|
latencyFirstText: MillisecondsSchema,
|
|
3941
4050
|
latencyFirstPatch: MillisecondsSchema,
|
|
3942
4051
|
latencyTotal: MillisecondsSchema,
|
|
3943
|
-
trackerState:
|
|
4052
|
+
trackerState: z37.unknown().nullable(),
|
|
3944
4053
|
/**
|
|
3945
4054
|
* The CLIENT's turn id for this run, or `null`.
|
|
3946
4055
|
*
|
|
@@ -3956,37 +4065,37 @@ var CreateTraceInputSchema = z36.object({
|
|
|
3956
4065
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
3957
4066
|
* visitor asked something and got nothing.
|
|
3958
4067
|
*/
|
|
3959
|
-
turnId:
|
|
4068
|
+
turnId: z37.string().nullable()
|
|
3960
4069
|
});
|
|
3961
|
-
var AgentSessionSummarySchema =
|
|
3962
|
-
sessionId:
|
|
4070
|
+
var AgentSessionSummarySchema = z37.object({
|
|
4071
|
+
sessionId: z37.string(),
|
|
3963
4072
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
3964
|
-
turnCount:
|
|
4073
|
+
turnCount: z37.number().int(),
|
|
3965
4074
|
/** The session's opening prompt — titles the row in the UI. */
|
|
3966
|
-
firstPrompt:
|
|
3967
|
-
startedAt:
|
|
3968
|
-
lastRunAt:
|
|
4075
|
+
firstPrompt: z37.string(),
|
|
4076
|
+
startedAt: z37.string(),
|
|
4077
|
+
lastRunAt: z37.string(),
|
|
3969
4078
|
/** Summed `latency_total` across the session's turns. */
|
|
3970
|
-
totalLatencyMs:
|
|
4079
|
+
totalLatencyMs: z37.number().int()
|
|
3971
4080
|
});
|
|
3972
|
-
var SessionTurnSchema =
|
|
3973
|
-
id:
|
|
3974
|
-
userPrompt:
|
|
3975
|
-
responseText:
|
|
4081
|
+
var SessionTurnSchema = z37.object({
|
|
4082
|
+
id: z37.string().uuid(),
|
|
4083
|
+
userPrompt: z37.string(),
|
|
4084
|
+
responseText: z37.string().nullable(),
|
|
3976
4085
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
3977
|
-
layout:
|
|
3978
|
-
createdAt:
|
|
3979
|
-
latencyTotal:
|
|
3980
|
-
phaseTimings:
|
|
3981
|
-
tokensByModel:
|
|
3982
|
-
input_tokens:
|
|
3983
|
-
output_tokens:
|
|
4086
|
+
layout: z37.unknown().nullable(),
|
|
4087
|
+
createdAt: z37.string(),
|
|
4088
|
+
latencyTotal: z37.number().int().nullable(),
|
|
4089
|
+
phaseTimings: z37.record(z37.number()).nullable(),
|
|
4090
|
+
tokensByModel: z37.record(z37.object({
|
|
4091
|
+
input_tokens: z37.number().optional(),
|
|
4092
|
+
output_tokens: z37.number().optional()
|
|
3984
4093
|
})).nullable(),
|
|
3985
|
-
toolCalls:
|
|
3986
|
-
diagnostics:
|
|
4094
|
+
toolCalls: z37.array(z37.unknown()).nullable(),
|
|
4095
|
+
diagnostics: z37.array(z37.unknown()).nullable()
|
|
3987
4096
|
});
|
|
3988
|
-
var SessionReplaySchema =
|
|
3989
|
-
turns:
|
|
4097
|
+
var SessionReplaySchema = z37.object({
|
|
4098
|
+
turns: z37.array(SessionTurnSchema),
|
|
3990
4099
|
/**
|
|
3991
4100
|
* The session's own last-committed layout, read straight off the durable
|
|
3992
4101
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -3997,20 +4106,20 @@ var SessionReplaySchema = z36.object({
|
|
|
3997
4106
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
3998
4107
|
* when the durable session row itself could not be read.
|
|
3999
4108
|
*/
|
|
4000
|
-
sessionLayout:
|
|
4109
|
+
sessionLayout: z37.record(z37.string(), z37.unknown()).nullable()
|
|
4001
4110
|
});
|
|
4002
|
-
var SessionTraceSchema =
|
|
4003
|
-
trackerState:
|
|
4111
|
+
var SessionTraceSchema = z37.object({
|
|
4112
|
+
trackerState: z37.string().nullable()
|
|
4004
4113
|
});
|
|
4005
|
-
var LlmUsageDailySchema =
|
|
4006
|
-
day:
|
|
4114
|
+
var LlmUsageDailySchema = z37.object({
|
|
4115
|
+
day: z37.string(),
|
|
4007
4116
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
4008
|
-
environment:
|
|
4009
|
-
feature:
|
|
4010
|
-
model:
|
|
4011
|
-
provider:
|
|
4117
|
+
environment: z37.string(),
|
|
4118
|
+
feature: z37.string(),
|
|
4119
|
+
model: z37.string(),
|
|
4120
|
+
provider: z37.string(),
|
|
4012
4121
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
4013
|
-
keyFingerprint:
|
|
4122
|
+
keyFingerprint: z37.string().nullable(),
|
|
4014
4123
|
/**
|
|
4015
4124
|
* The space the call served, or null when it served none.
|
|
4016
4125
|
*
|
|
@@ -4019,91 +4128,91 @@ var LlmUsageDailySchema = z36.object({
|
|
|
4019
4128
|
* report that share rather than dropping it, or a per-space total reads as
|
|
4020
4129
|
* the platform total.
|
|
4021
4130
|
*/
|
|
4022
|
-
spaceId:
|
|
4131
|
+
spaceId: z37.string().nullable(),
|
|
4023
4132
|
/**
|
|
4024
4133
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
4025
4134
|
* when it served no session or the session predates surface recording.
|
|
4026
4135
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
4027
4136
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
4028
4137
|
*/
|
|
4029
|
-
surface:
|
|
4030
|
-
inputTokens:
|
|
4031
|
-
outputTokens:
|
|
4138
|
+
surface: z37.string().nullable(),
|
|
4139
|
+
inputTokens: z37.number(),
|
|
4140
|
+
outputTokens: z37.number(),
|
|
4032
4141
|
/** Subset of inputTokens, never additional to it. */
|
|
4033
|
-
cachedInputTokens:
|
|
4034
|
-
reasoningTokens:
|
|
4035
|
-
callCount:
|
|
4036
|
-
errorCount:
|
|
4037
|
-
estimatedCostUsd:
|
|
4142
|
+
cachedInputTokens: z37.number(),
|
|
4143
|
+
reasoningTokens: z37.number(),
|
|
4144
|
+
callCount: z37.number(),
|
|
4145
|
+
errorCount: z37.number(),
|
|
4146
|
+
estimatedCostUsd: z37.number().nullable()
|
|
4038
4147
|
});
|
|
4039
|
-
var LlmUsageBySessionSchema =
|
|
4040
|
-
sessionId:
|
|
4041
|
-
environment:
|
|
4042
|
-
model:
|
|
4148
|
+
var LlmUsageBySessionSchema = z37.object({
|
|
4149
|
+
sessionId: z37.string(),
|
|
4150
|
+
environment: z37.string(),
|
|
4151
|
+
model: z37.string(),
|
|
4043
4152
|
/** The space this session belongs to, or null for a session with no space. */
|
|
4044
|
-
spaceId:
|
|
4153
|
+
spaceId: z37.string().nullable(),
|
|
4045
4154
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
4046
|
-
surface:
|
|
4155
|
+
surface: z37.string().nullable(),
|
|
4047
4156
|
/** Label only — the first feature seen in the session. */
|
|
4048
|
-
firstFeature:
|
|
4049
|
-
startedAt:
|
|
4050
|
-
endedAt:
|
|
4051
|
-
inputTokens:
|
|
4052
|
-
outputTokens:
|
|
4053
|
-
cachedInputTokens:
|
|
4054
|
-
reasoningTokens:
|
|
4055
|
-
callCount:
|
|
4056
|
-
errorCount:
|
|
4157
|
+
firstFeature: z37.string(),
|
|
4158
|
+
startedAt: z37.string(),
|
|
4159
|
+
endedAt: z37.string(),
|
|
4160
|
+
inputTokens: z37.number(),
|
|
4161
|
+
outputTokens: z37.number(),
|
|
4162
|
+
cachedInputTokens: z37.number(),
|
|
4163
|
+
reasoningTokens: z37.number(),
|
|
4164
|
+
callCount: z37.number(),
|
|
4165
|
+
errorCount: z37.number(),
|
|
4057
4166
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
4058
4167
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
4059
4168
|
* the model is unpriced; never 0, which would read as free. */
|
|
4060
|
-
estimatedCostUsd:
|
|
4169
|
+
estimatedCostUsd: z37.number().nullable()
|
|
4061
4170
|
});
|
|
4062
|
-
var LlmSessionsDailySchema =
|
|
4063
|
-
day:
|
|
4064
|
-
environment:
|
|
4065
|
-
sessionCount:
|
|
4171
|
+
var LlmSessionsDailySchema = z37.object({
|
|
4172
|
+
day: z37.string(),
|
|
4173
|
+
environment: z37.string(),
|
|
4174
|
+
sessionCount: z37.number()
|
|
4066
4175
|
});
|
|
4067
4176
|
|
|
4068
4177
|
// ../spacestation/src/space/session-queue.ts
|
|
4069
|
-
import { z as
|
|
4178
|
+
import { z as z39 } from "zod";
|
|
4070
4179
|
|
|
4071
4180
|
// ../spacestation/src/space/session-activity.ts
|
|
4072
|
-
import { z as
|
|
4073
|
-
var SessionActivityEventSchema =
|
|
4074
|
-
id:
|
|
4075
|
-
kind:
|
|
4076
|
-
occurredAt:
|
|
4077
|
-
source:
|
|
4078
|
-
surface:
|
|
4079
|
-
payload:
|
|
4181
|
+
import { z as z38 } from "zod";
|
|
4182
|
+
var SessionActivityEventSchema = z38.object({
|
|
4183
|
+
id: z38.string(),
|
|
4184
|
+
kind: z38.string(),
|
|
4185
|
+
occurredAt: z38.string(),
|
|
4186
|
+
source: z38.string(),
|
|
4187
|
+
surface: z38.string(),
|
|
4188
|
+
payload: z38.record(z38.unknown())
|
|
4080
4189
|
});
|
|
4081
|
-
var SessionActivitySchema =
|
|
4082
|
-
events:
|
|
4083
|
-
hasMore:
|
|
4190
|
+
var SessionActivitySchema = z38.object({
|
|
4191
|
+
events: z38.array(SessionActivityEventSchema),
|
|
4192
|
+
hasMore: z38.boolean()
|
|
4084
4193
|
});
|
|
4085
4194
|
|
|
4086
4195
|
// ../spacestation/src/space/session-queue.ts
|
|
4087
|
-
var SessionVerdictSchema =
|
|
4088
|
-
var RecordableVerdictSchema =
|
|
4089
|
-
var SessionReviewEventSchema =
|
|
4090
|
-
id:
|
|
4196
|
+
var SessionVerdictSchema = z39.enum(["unreviewed", "viewed", "bug"]);
|
|
4197
|
+
var RecordableVerdictSchema = z39.enum(["viewed", "bug"]);
|
|
4198
|
+
var SessionReviewEventSchema = z39.object({
|
|
4199
|
+
id: z39.string().uuid(),
|
|
4091
4200
|
verdict: RecordableVerdictSchema,
|
|
4092
4201
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
4093
4202
|
* log is append-only rather than a mutable current-state row. */
|
|
4094
|
-
reviewer:
|
|
4095
|
-
note:
|
|
4096
|
-
createdAt:
|
|
4203
|
+
reviewer: z39.string(),
|
|
4204
|
+
note: z39.string().nullable(),
|
|
4205
|
+
createdAt: z39.string()
|
|
4097
4206
|
});
|
|
4098
|
-
var BugSeveritySchema =
|
|
4099
|
-
var BugLocationSchema =
|
|
4100
|
-
elementId:
|
|
4207
|
+
var BugSeveritySchema = z39.enum(["high", "medium", "low"]);
|
|
4208
|
+
var BugLocationSchema = z39.object({
|
|
4209
|
+
elementId: z39.string().nullable(),
|
|
4101
4210
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
4102
4211
|
* alongside a null `elementId`. */
|
|
4103
|
-
elementType:
|
|
4212
|
+
elementType: z39.string().nullable(),
|
|
4104
4213
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
4105
|
-
offsetXPct:
|
|
4106
|
-
offsetYPct:
|
|
4214
|
+
offsetXPct: z39.number().min(0).max(100).nullable(),
|
|
4215
|
+
offsetYPct: z39.number().min(0).max(100).nullable(),
|
|
4107
4216
|
/**
|
|
4108
4217
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
4109
4218
|
* element anchor.
|
|
@@ -4114,8 +4223,8 @@ var BugLocationSchema = z38.object({
|
|
|
4114
4223
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
4115
4224
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
4116
4225
|
*/
|
|
4117
|
-
pageX:
|
|
4118
|
-
pageY:
|
|
4226
|
+
pageX: z39.number().nullable(),
|
|
4227
|
+
pageY: z39.number().nullable()
|
|
4119
4228
|
}).refine(
|
|
4120
4229
|
(loc) => {
|
|
4121
4230
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -4129,24 +4238,24 @@ var BugLocationSchema = z38.object({
|
|
|
4129
4238
|
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)"
|
|
4130
4239
|
}
|
|
4131
4240
|
);
|
|
4132
|
-
var SessionBugSchema =
|
|
4133
|
-
id:
|
|
4241
|
+
var SessionBugSchema = z39.object({
|
|
4242
|
+
id: z39.string().uuid(),
|
|
4134
4243
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
4135
|
-
turnIndex:
|
|
4244
|
+
turnIndex: z39.number().int().nullable(),
|
|
4136
4245
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
4137
4246
|
* without pinning a spot. */
|
|
4138
4247
|
location: BugLocationSchema.nullable(),
|
|
4139
|
-
provider:
|
|
4140
|
-
issueKey:
|
|
4141
|
-
issueUrl:
|
|
4248
|
+
provider: z39.string(),
|
|
4249
|
+
issueKey: z39.string().nullable(),
|
|
4250
|
+
issueUrl: z39.string().nullable(),
|
|
4142
4251
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
4143
4252
|
* open text. Null until first synced. */
|
|
4144
|
-
issueState:
|
|
4145
|
-
title:
|
|
4146
|
-
body:
|
|
4253
|
+
issueState: z39.string().nullable(),
|
|
4254
|
+
title: z39.string(),
|
|
4255
|
+
body: z39.string(),
|
|
4147
4256
|
severity: BugSeveritySchema,
|
|
4148
|
-
createdBy:
|
|
4149
|
-
createdAt:
|
|
4257
|
+
createdBy: z39.string(),
|
|
4258
|
+
createdAt: z39.string(),
|
|
4150
4259
|
/**
|
|
4151
4260
|
* When this bug was resolved from the console; null means still OPEN.
|
|
4152
4261
|
*
|
|
@@ -4155,60 +4264,60 @@ var SessionBugSchema = z38.object({
|
|
|
4155
4264
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
4156
4265
|
* no boolean can contradict it.
|
|
4157
4266
|
*/
|
|
4158
|
-
resolvedAt:
|
|
4159
|
-
resolvedBy:
|
|
4267
|
+
resolvedAt: z39.string().nullable(),
|
|
4268
|
+
resolvedBy: z39.string().nullable()
|
|
4160
4269
|
});
|
|
4161
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
4162
|
-
var SessionCommentSchema =
|
|
4163
|
-
id:
|
|
4270
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z39.string() });
|
|
4271
|
+
var SessionCommentSchema = z39.object({
|
|
4272
|
+
id: z39.string().uuid(),
|
|
4164
4273
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
4165
|
-
bugId:
|
|
4274
|
+
bugId: z39.string().uuid().nullable(),
|
|
4166
4275
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
4167
4276
|
* parent bug's turn). */
|
|
4168
|
-
turnIndex:
|
|
4277
|
+
turnIndex: z39.number().int().nullable(),
|
|
4169
4278
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
4170
4279
|
location: BugLocationSchema.nullable(),
|
|
4171
|
-
body:
|
|
4172
|
-
createdBy:
|
|
4173
|
-
createdAt:
|
|
4280
|
+
body: z39.string(),
|
|
4281
|
+
createdBy: z39.string(),
|
|
4282
|
+
createdAt: z39.string()
|
|
4174
4283
|
});
|
|
4175
|
-
var CreateCommentInputSchema =
|
|
4176
|
-
bugId:
|
|
4177
|
-
turnIndex:
|
|
4284
|
+
var CreateCommentInputSchema = z39.object({
|
|
4285
|
+
bugId: z39.string().uuid().nullable(),
|
|
4286
|
+
turnIndex: z39.number().int().positive().nullable(),
|
|
4178
4287
|
location: BugLocationSchema.nullable(),
|
|
4179
4288
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
4180
4289
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
4181
|
-
body:
|
|
4290
|
+
body: z39.string().trim().min(1)
|
|
4182
4291
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
4183
4292
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
4184
4293
|
});
|
|
4185
|
-
var UpdateCommentInputSchema =
|
|
4186
|
-
body:
|
|
4187
|
-
bugId:
|
|
4294
|
+
var UpdateCommentInputSchema = z39.object({
|
|
4295
|
+
body: z39.string().trim().min(1).optional(),
|
|
4296
|
+
bugId: z39.string().uuid().nullable().optional(),
|
|
4188
4297
|
location: BugLocationSchema.nullable().optional()
|
|
4189
4298
|
});
|
|
4190
4299
|
var MOBILE_VIEWPORT_MAX = 720;
|
|
4191
|
-
var SessionFormFactorSchema =
|
|
4300
|
+
var SessionFormFactorSchema = z39.enum(["mobile", "desktop"]).nullable();
|
|
4192
4301
|
function formFactorFromViewport(width) {
|
|
4193
4302
|
if (width === null) return null;
|
|
4194
4303
|
return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
|
|
4195
4304
|
}
|
|
4196
|
-
var SessionSummarySchema =
|
|
4197
|
-
sessionId:
|
|
4305
|
+
var SessionSummarySchema = z39.object({
|
|
4306
|
+
sessionId: z39.string(),
|
|
4198
4307
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
4199
4308
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
4200
|
-
visitorId:
|
|
4309
|
+
visitorId: z39.string().nullable(),
|
|
4201
4310
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
4202
4311
|
* identified themselves. Both null together means "not identified yet". */
|
|
4203
|
-
identityProvider:
|
|
4204
|
-
identityKey:
|
|
4312
|
+
identityProvider: z39.string().nullable(),
|
|
4313
|
+
identityKey: z39.string().nullable(),
|
|
4205
4314
|
/** Team/test traffic. The queue hides these by default. */
|
|
4206
|
-
isInternal:
|
|
4315
|
+
isInternal: z39.boolean(),
|
|
4207
4316
|
/** Build that served the session. Null = not captured; a version filter must
|
|
4208
4317
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
4209
|
-
clientVersion:
|
|
4318
|
+
clientVersion: z39.string().nullable(),
|
|
4210
4319
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
4211
|
-
signalCounts:
|
|
4320
|
+
signalCounts: z39.record(z39.number()),
|
|
4212
4321
|
/**
|
|
4213
4322
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
4214
4323
|
*
|
|
@@ -4225,7 +4334,7 @@ var SessionSummarySchema = z38.object({
|
|
|
4225
4334
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
4226
4335
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
4227
4336
|
*/
|
|
4228
|
-
conversionAttempts:
|
|
4337
|
+
conversionAttempts: z39.number().int().nullable(),
|
|
4229
4338
|
/**
|
|
4230
4339
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
4231
4340
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -4241,7 +4350,7 @@ var SessionSummarySchema = z38.object({
|
|
|
4241
4350
|
* kinds together, and one attempt id appearing under both would be counted
|
|
4242
4351
|
* once there and twice here.
|
|
4243
4352
|
*/
|
|
4244
|
-
conversionKinds:
|
|
4353
|
+
conversionKinds: z39.record(z39.number()),
|
|
4245
4354
|
/**
|
|
4246
4355
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
4247
4356
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -4249,20 +4358,20 @@ var SessionSummarySchema = z38.object({
|
|
|
4249
4358
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
4250
4359
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
4251
4360
|
*/
|
|
4252
|
-
funnelSteps:
|
|
4361
|
+
funnelSteps: z39.array(z39.string()),
|
|
4253
4362
|
/**
|
|
4254
4363
|
* The connector's opaque handle for what this session produced in its back
|
|
4255
4364
|
* office — present only once a checkout actually reached the platform. The
|
|
4256
4365
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
4257
4366
|
*/
|
|
4258
|
-
backOfficeRef:
|
|
4367
|
+
backOfficeRef: z39.string().nullable(),
|
|
4259
4368
|
/**
|
|
4260
4369
|
* The order this session produced, when the connector's back office reported
|
|
4261
4370
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
4262
4371
|
* Both null when no order is known — the cart handle above is then the door.
|
|
4263
4372
|
*/
|
|
4264
|
-
orderRef:
|
|
4265
|
-
orderLabel:
|
|
4373
|
+
orderRef: z39.string().nullable(),
|
|
4374
|
+
orderLabel: z39.string().nullable(),
|
|
4266
4375
|
/**
|
|
4267
4376
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
4268
4377
|
* needs.
|
|
@@ -4275,12 +4384,12 @@ var SessionSummarySchema = z38.object({
|
|
|
4275
4384
|
* on a desktop are not the same session.
|
|
4276
4385
|
*/
|
|
4277
4386
|
formFactor: SessionFormFactorSchema,
|
|
4278
|
-
turnCount:
|
|
4387
|
+
turnCount: z39.number().int(),
|
|
4279
4388
|
/** The visitor's opening message — the single most informative field for
|
|
4280
4389
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
4281
|
-
firstPrompt:
|
|
4282
|
-
startedAt:
|
|
4283
|
-
lastRunAt:
|
|
4390
|
+
firstPrompt: z39.string(),
|
|
4391
|
+
startedAt: z39.string(),
|
|
4392
|
+
lastRunAt: z39.string(),
|
|
4284
4393
|
/**
|
|
4285
4394
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
4286
4395
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -4308,7 +4417,7 @@ var SessionSummarySchema = z38.object({
|
|
|
4308
4417
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
4309
4418
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
4310
4419
|
*/
|
|
4311
|
-
visitorTimeZone:
|
|
4420
|
+
visitorTimeZone: z39.string().nullable(),
|
|
4312
4421
|
/**
|
|
4313
4422
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
4314
4423
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -4316,31 +4425,31 @@ var SessionSummarySchema = z38.object({
|
|
|
4316
4425
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
4317
4426
|
* already reading. Null when no turn in the session recorded a patch.
|
|
4318
4427
|
*/
|
|
4319
|
-
avgTtftMs:
|
|
4428
|
+
avgTtftMs: z39.number().int().nullable(),
|
|
4320
4429
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
4321
4430
|
* a budget: null on sessions older than the mark's recording. */
|
|
4322
|
-
avgMainDoneMs:
|
|
4431
|
+
avgMainDoneMs: z39.number().int().nullable(),
|
|
4323
4432
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
4324
4433
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
4325
|
-
avgChipGenMs:
|
|
4326
|
-
totalLatencyMs:
|
|
4327
|
-
durationMs:
|
|
4434
|
+
avgChipGenMs: z39.number().int().nullable(),
|
|
4435
|
+
totalLatencyMs: z39.number().int(),
|
|
4436
|
+
durationMs: z39.number().int(),
|
|
4328
4437
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
4329
4438
|
* live session streams and cannot be given a verdict until it ends. */
|
|
4330
|
-
isLive:
|
|
4439
|
+
isLive: z39.boolean(),
|
|
4331
4440
|
verdict: SessionVerdictSchema,
|
|
4332
|
-
reviewedBy:
|
|
4333
|
-
reviewedAt:
|
|
4441
|
+
reviewedBy: z39.string().nullable(),
|
|
4442
|
+
reviewedAt: z39.string().nullable(),
|
|
4334
4443
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
4335
4444
|
* state without a second request. */
|
|
4336
|
-
bugIssueKey:
|
|
4337
|
-
bugIssueUrl:
|
|
4338
|
-
bugIssueState:
|
|
4445
|
+
bugIssueKey: z39.string().nullable(),
|
|
4446
|
+
bugIssueUrl: z39.string().nullable(),
|
|
4447
|
+
bugIssueState: z39.string().nullable()
|
|
4339
4448
|
});
|
|
4340
|
-
var SessionQueuePageSchema =
|
|
4341
|
-
sessions:
|
|
4342
|
-
totalCount:
|
|
4343
|
-
hiddenInternalCount:
|
|
4449
|
+
var SessionQueuePageSchema = z39.object({
|
|
4450
|
+
sessions: z39.array(SessionSummarySchema),
|
|
4451
|
+
totalCount: z39.number().int(),
|
|
4452
|
+
hiddenInternalCount: z39.number().int(),
|
|
4344
4453
|
/**
|
|
4345
4454
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
4346
4455
|
*
|
|
@@ -4350,61 +4459,61 @@ var SessionQueuePageSchema = z38.object({
|
|
|
4350
4459
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
4351
4460
|
* analytics dashboard's bounce over the same window.
|
|
4352
4461
|
*/
|
|
4353
|
-
hiddenBouncedCount:
|
|
4462
|
+
hiddenBouncedCount: z39.number().int()
|
|
4354
4463
|
});
|
|
4355
|
-
var SessionQueueFacetsSchema =
|
|
4356
|
-
review:
|
|
4357
|
-
version:
|
|
4358
|
-
turns:
|
|
4359
|
-
durationS:
|
|
4464
|
+
var SessionQueueFacetsSchema = z39.object({
|
|
4465
|
+
review: z39.record(z39.number()),
|
|
4466
|
+
version: z39.record(z39.number()),
|
|
4467
|
+
turns: z39.record(z39.number()),
|
|
4468
|
+
durationS: z39.record(z39.number()),
|
|
4360
4469
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
4361
|
-
funnel:
|
|
4470
|
+
funnel: z39.record(z39.number())
|
|
4362
4471
|
});
|
|
4363
|
-
var SessionCaptureSchema =
|
|
4364
|
-
viewportWidth:
|
|
4365
|
-
viewportHeight:
|
|
4366
|
-
userAgent:
|
|
4367
|
-
locale:
|
|
4472
|
+
var SessionCaptureSchema = z39.object({
|
|
4473
|
+
viewportWidth: z39.number().int().nullable(),
|
|
4474
|
+
viewportHeight: z39.number().int().nullable(),
|
|
4475
|
+
userAgent: z39.string().nullable(),
|
|
4476
|
+
locale: z39.string().nullable(),
|
|
4368
4477
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
4369
|
-
referrer:
|
|
4478
|
+
referrer: z39.string().nullable()
|
|
4370
4479
|
});
|
|
4371
|
-
var SessionCaptureInputSchema =
|
|
4372
|
-
viewportWidth:
|
|
4373
|
-
viewportHeight:
|
|
4374
|
-
userAgent:
|
|
4375
|
-
locale:
|
|
4480
|
+
var SessionCaptureInputSchema = z39.object({
|
|
4481
|
+
viewportWidth: z39.number().int().positive().max(2e4).optional(),
|
|
4482
|
+
viewportHeight: z39.number().int().positive().max(2e4).optional(),
|
|
4483
|
+
userAgent: z39.string().max(1e3).optional(),
|
|
4484
|
+
locale: z39.string().max(35).optional(),
|
|
4376
4485
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
4377
4486
|
* the zone database grows, and refusing a name this build has not heard of
|
|
4378
4487
|
* would drop a real session's capture over a table that is out of date. */
|
|
4379
|
-
timeZone:
|
|
4380
|
-
referrer:
|
|
4381
|
-
clientVersion:
|
|
4382
|
-
isInternal:
|
|
4488
|
+
timeZone: z39.string().max(64).optional(),
|
|
4489
|
+
referrer: z39.string().max(2048).optional(),
|
|
4490
|
+
clientVersion: z39.string().max(100).optional(),
|
|
4491
|
+
isInternal: z39.boolean().optional()
|
|
4383
4492
|
});
|
|
4384
|
-
var SessionDetailSchema =
|
|
4493
|
+
var SessionDetailSchema = z39.object({
|
|
4385
4494
|
session: SessionSummarySchema,
|
|
4386
4495
|
capture: SessionCaptureSchema,
|
|
4387
4496
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
4388
4497
|
* re-judged after a fix is the evidence the fix worked. */
|
|
4389
|
-
reviews:
|
|
4390
|
-
bugs:
|
|
4391
|
-
comments:
|
|
4498
|
+
reviews: z39.array(SessionReviewEventSchema),
|
|
4499
|
+
bugs: z39.array(SessionBugSchema),
|
|
4500
|
+
comments: z39.array(SessionCommentSchema),
|
|
4392
4501
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
4393
4502
|
* not evidence of zero visitor activity. */
|
|
4394
4503
|
activity: SessionActivitySchema.optional()
|
|
4395
4504
|
});
|
|
4396
|
-
var RecordVerdictInputSchema =
|
|
4505
|
+
var RecordVerdictInputSchema = z39.object({
|
|
4397
4506
|
verdict: RecordableVerdictSchema,
|
|
4398
|
-
note:
|
|
4507
|
+
note: z39.string().max(2e3).optional()
|
|
4399
4508
|
});
|
|
4400
|
-
var FileBugInputSchema =
|
|
4401
|
-
turnIndex:
|
|
4509
|
+
var FileBugInputSchema = z39.object({
|
|
4510
|
+
turnIndex: z39.number().int().positive().nullable(),
|
|
4402
4511
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
4403
4512
|
location: BugLocationSchema.nullable().optional(),
|
|
4404
|
-
title:
|
|
4405
|
-
body:
|
|
4513
|
+
title: z39.string().min(1).max(300),
|
|
4514
|
+
body: z39.string().min(1),
|
|
4406
4515
|
severity: BugSeveritySchema,
|
|
4407
|
-
payload:
|
|
4516
|
+
payload: z39.record(z39.unknown())
|
|
4408
4517
|
});
|
|
4409
4518
|
|
|
4410
4519
|
// ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
|
|
@@ -4587,7 +4696,46 @@ function stringifyForScoring(v) {
|
|
|
4587
4696
|
}
|
|
4588
4697
|
}
|
|
4589
4698
|
|
|
4699
|
+
// src/session/turn-attributed-session.ts
|
|
4700
|
+
var TURN_ATTRIBUTED_SIGNALS = /* @__PURE__ */ new Set([CART_ADD_SIGNAL]);
|
|
4701
|
+
function withTurn(signal, turnId) {
|
|
4702
|
+
if (!TURN_ATTRIBUTED_SIGNALS.has(signal.type) || "turnId" in signal.payload) return signal;
|
|
4703
|
+
return { ...signal, payload: { ...signal.payload, turnId } };
|
|
4704
|
+
}
|
|
4705
|
+
function useTurnAttributedSession(session) {
|
|
4706
|
+
const turnId = useTurnScope();
|
|
4707
|
+
return useMemo2(() => {
|
|
4708
|
+
if (session === null || turnId === null) return session;
|
|
4709
|
+
return {
|
|
4710
|
+
...session,
|
|
4711
|
+
dispatchSignal: (signal) => session.dispatchSignal(withTurn(signal, turnId)),
|
|
4712
|
+
dispatchSuggestionAction: (action) => session.dispatchSuggestionAction(withTurn(action, turnId))
|
|
4713
|
+
};
|
|
4714
|
+
}, [session, turnId]);
|
|
4715
|
+
}
|
|
4716
|
+
|
|
4717
|
+
// src/session/FourtySessionContext.tsx
|
|
4718
|
+
var FourtySessionContext = createContext2(null);
|
|
4719
|
+
function useFourtySession() {
|
|
4720
|
+
const ctx = useTurnAttributedSession(useContext2(FourtySessionContext));
|
|
4721
|
+
if (!ctx) throw new Error("useFourtySession must be used within a <FourtyProvider>");
|
|
4722
|
+
return ctx;
|
|
4723
|
+
}
|
|
4724
|
+
function useOptionalFourtySession() {
|
|
4725
|
+
return useTurnAttributedSession(useContext2(FourtySessionContext));
|
|
4726
|
+
}
|
|
4727
|
+
function useComposerDraft() {
|
|
4728
|
+
const { composerDraftStore, setComposerDraft } = useFourtySession();
|
|
4729
|
+
const value = useSyncExternalStore(
|
|
4730
|
+
composerDraftStore.subscribe,
|
|
4731
|
+
composerDraftStore.get,
|
|
4732
|
+
composerDraftStore.get
|
|
4733
|
+
);
|
|
4734
|
+
return [value, setComposerDraft];
|
|
4735
|
+
}
|
|
4736
|
+
|
|
4590
4737
|
// src/session/use-action.ts
|
|
4738
|
+
import { useCallback } from "react";
|
|
4591
4739
|
function useAction(label, action) {
|
|
4592
4740
|
const session = useOptionalFourtySession();
|
|
4593
4741
|
return useCallback(() => {
|
|
@@ -4684,60 +4832,60 @@ __export(src_exports2, {
|
|
|
4684
4832
|
});
|
|
4685
4833
|
|
|
4686
4834
|
// ../ecommerce/src/commerce-schemas.ts
|
|
4687
|
-
import { z as
|
|
4688
|
-
var MoneySchema =
|
|
4689
|
-
amount:
|
|
4690
|
-
currencyCode:
|
|
4835
|
+
import { z as z40 } from "zod";
|
|
4836
|
+
var MoneySchema = z40.object({
|
|
4837
|
+
amount: z40.number(),
|
|
4838
|
+
currencyCode: z40.string()
|
|
4691
4839
|
});
|
|
4692
|
-
var ImageSchema =
|
|
4693
|
-
url:
|
|
4694
|
-
altText:
|
|
4695
|
-
width:
|
|
4696
|
-
height:
|
|
4840
|
+
var ImageSchema = z40.object({
|
|
4841
|
+
url: z40.string(),
|
|
4842
|
+
altText: z40.string(),
|
|
4843
|
+
width: z40.number().optional(),
|
|
4844
|
+
height: z40.number().optional(),
|
|
4697
4845
|
/** Responsive candidate set, resolved at the commerce-adapter boundary —
|
|
4698
4846
|
* never computed in a component. Renderers use it as `<img srcSet>` paired
|
|
4699
4847
|
* with a layout `sizes`. Absent for non-CDN / unsizable images. */
|
|
4700
|
-
srcSet:
|
|
4848
|
+
srcSet: z40.string().optional()
|
|
4701
4849
|
});
|
|
4702
|
-
var AssetSchema =
|
|
4850
|
+
var AssetSchema = z40.object({
|
|
4703
4851
|
/** Opaque asset id — the `resolved()` ref the agent emitted. */
|
|
4704
|
-
id:
|
|
4705
|
-
url:
|
|
4706
|
-
altText:
|
|
4707
|
-
srcSet:
|
|
4852
|
+
id: z40.string(),
|
|
4853
|
+
url: z40.string(),
|
|
4854
|
+
altText: z40.string(),
|
|
4855
|
+
srcSet: z40.string().optional()
|
|
4708
4856
|
});
|
|
4709
|
-
var SelectedOptionSchema =
|
|
4710
|
-
name:
|
|
4711
|
-
value:
|
|
4857
|
+
var SelectedOptionSchema = z40.object({
|
|
4858
|
+
name: z40.string(),
|
|
4859
|
+
value: z40.string()
|
|
4712
4860
|
});
|
|
4713
|
-
var VideoSourceSchema =
|
|
4714
|
-
url:
|
|
4715
|
-
mimeType:
|
|
4716
|
-
width:
|
|
4717
|
-
height:
|
|
4861
|
+
var VideoSourceSchema = z40.object({
|
|
4862
|
+
url: z40.string(),
|
|
4863
|
+
mimeType: z40.string(),
|
|
4864
|
+
width: z40.number().optional(),
|
|
4865
|
+
height: z40.number().optional()
|
|
4718
4866
|
});
|
|
4719
|
-
var ProductVideoSchema =
|
|
4720
|
-
kind:
|
|
4867
|
+
var ProductVideoSchema = z40.object({
|
|
4868
|
+
kind: z40.enum(["hosted", "external"]),
|
|
4721
4869
|
previewImage: ImageSchema.optional(),
|
|
4722
|
-
altText:
|
|
4870
|
+
altText: z40.string().default(""),
|
|
4723
4871
|
/** `kind: 'hosted'` only — empty for external embeds. */
|
|
4724
|
-
sources:
|
|
4872
|
+
sources: z40.array(VideoSourceSchema).default([]),
|
|
4725
4873
|
/** `kind: 'external'` only — iframe embed URL. */
|
|
4726
|
-
embedUrl:
|
|
4874
|
+
embedUrl: z40.string().optional(),
|
|
4727
4875
|
/** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
|
|
4728
|
-
host:
|
|
4876
|
+
host: z40.string().optional()
|
|
4729
4877
|
});
|
|
4730
|
-
var AvailabilityStatusSchema =
|
|
4878
|
+
var AvailabilityStatusSchema = z40.enum([
|
|
4731
4879
|
"in_stock",
|
|
4732
4880
|
"backorder",
|
|
4733
4881
|
"preorder",
|
|
4734
4882
|
"out_of_stock",
|
|
4735
4883
|
"discontinued"
|
|
4736
4884
|
]);
|
|
4737
|
-
var ProductVariantSchema =
|
|
4738
|
-
id:
|
|
4739
|
-
title:
|
|
4740
|
-
available:
|
|
4885
|
+
var ProductVariantSchema = z40.object({
|
|
4886
|
+
id: z40.string(),
|
|
4887
|
+
title: z40.string(),
|
|
4888
|
+
available: z40.boolean(),
|
|
4741
4889
|
/**
|
|
4742
4890
|
* Qualifies `available` with the fulfillment state behind it. Absent means
|
|
4743
4891
|
* the backend did not say — which is NOT the same as in stock, and must not
|
|
@@ -4752,7 +4900,7 @@ var ProductVariantSchema = z39.object({
|
|
|
4752
4900
|
availabilityStatus: AvailabilityStatusSchema.optional(),
|
|
4753
4901
|
price: MoneySchema,
|
|
4754
4902
|
compareAtPrice: MoneySchema.optional(),
|
|
4755
|
-
selectedOptions:
|
|
4903
|
+
selectedOptions: z40.array(SelectedOptionSchema).optional(),
|
|
4756
4904
|
image: ImageSchema.optional()
|
|
4757
4905
|
});
|
|
4758
4906
|
var MP4_MIME = "video/mp4";
|
|
@@ -4763,34 +4911,34 @@ function orderedVideoSources(video) {
|
|
|
4763
4911
|
const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
|
|
4764
4912
|
return [...mp4, ...hls];
|
|
4765
4913
|
}
|
|
4766
|
-
var SiblingProductSchema =
|
|
4767
|
-
id:
|
|
4768
|
-
handle:
|
|
4769
|
-
title:
|
|
4914
|
+
var SiblingProductSchema = z40.object({
|
|
4915
|
+
id: z40.string(),
|
|
4916
|
+
handle: z40.string(),
|
|
4917
|
+
title: z40.string(),
|
|
4770
4918
|
/** The differentiating value across siblings — typically the color
|
|
4771
4919
|
* label ("OLIVE", "STONE"). Rendered next to the swatch row. */
|
|
4772
|
-
color:
|
|
4920
|
+
color: z40.string(),
|
|
4773
4921
|
/** Swatch artwork. Hydrators populate from the sibling product's
|
|
4774
4922
|
* first image; renderers crop / fit to the swatch tile. */
|
|
4775
4923
|
swatchImage: ImageSchema.optional(),
|
|
4776
|
-
available:
|
|
4924
|
+
available: z40.boolean().default(true),
|
|
4777
4925
|
/** Marks the sibling that IS the currently-rendered product. The
|
|
4778
4926
|
* picker uses this to highlight the active swatch without an
|
|
4779
4927
|
* external id comparison. */
|
|
4780
|
-
current:
|
|
4928
|
+
current: z40.boolean().default(false)
|
|
4781
4929
|
});
|
|
4782
|
-
var ProductSchema =
|
|
4783
|
-
id:
|
|
4784
|
-
handle:
|
|
4785
|
-
title:
|
|
4786
|
-
description:
|
|
4787
|
-
descriptionHtml:
|
|
4788
|
-
vendor:
|
|
4789
|
-
productType:
|
|
4790
|
-
tags:
|
|
4930
|
+
var ProductSchema = z40.object({
|
|
4931
|
+
id: z40.string(),
|
|
4932
|
+
handle: z40.string().default(""),
|
|
4933
|
+
title: z40.string(),
|
|
4934
|
+
description: z40.string().default(""),
|
|
4935
|
+
descriptionHtml: z40.string().optional(),
|
|
4936
|
+
vendor: z40.string().default(""),
|
|
4937
|
+
productType: z40.string().optional(),
|
|
4938
|
+
tags: z40.array(z40.string()).default([]),
|
|
4791
4939
|
price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
|
|
4792
4940
|
compareAtPrice: MoneySchema.optional(),
|
|
4793
|
-
images:
|
|
4941
|
+
images: z40.array(ImageSchema).default([]),
|
|
4794
4942
|
/**
|
|
4795
4943
|
* Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
|
|
4796
4944
|
* catalog drops video media — it only surfaces through the Storefront
|
|
@@ -4798,21 +4946,21 @@ var ProductSchema = z39.object({
|
|
|
4798
4946
|
* boundary. Default `[]` so renderers gate on `length > 0` without a
|
|
4799
4947
|
* presence guard.
|
|
4800
4948
|
*/
|
|
4801
|
-
videos:
|
|
4802
|
-
variants:
|
|
4803
|
-
availableForSale:
|
|
4804
|
-
options:
|
|
4805
|
-
name:
|
|
4806
|
-
values:
|
|
4949
|
+
videos: z40.array(ProductVideoSchema).default([]),
|
|
4950
|
+
variants: z40.array(ProductVariantSchema).default([]),
|
|
4951
|
+
availableForSale: z40.boolean().default(true),
|
|
4952
|
+
options: z40.array(z40.object({
|
|
4953
|
+
name: z40.string(),
|
|
4954
|
+
values: z40.array(z40.string())
|
|
4807
4955
|
})).optional(),
|
|
4808
|
-
collections:
|
|
4956
|
+
collections: z40.array(z40.string()).optional(),
|
|
4809
4957
|
/** See `SiblingProductSchema`. Default `[]` so renderers can check
|
|
4810
4958
|
* `length > 1` to decide whether to draw the swatch row without a
|
|
4811
4959
|
* presence guard. */
|
|
4812
|
-
colorVariants:
|
|
4813
|
-
rating:
|
|
4814
|
-
value:
|
|
4815
|
-
count:
|
|
4960
|
+
colorVariants: z40.array(SiblingProductSchema).default([]),
|
|
4961
|
+
rating: z40.object({
|
|
4962
|
+
value: z40.number(),
|
|
4963
|
+
count: z40.number()
|
|
4816
4964
|
}).optional(),
|
|
4817
4965
|
/**
|
|
4818
4966
|
* Product reviews surfaced from the brand's review store. SDK
|
|
@@ -4821,12 +4969,12 @@ var ProductSchema = z39.object({
|
|
|
4821
4969
|
* review bodies. Renderers (`Reviews` component, `ProductDetail`,
|
|
4822
4970
|
* etc.) consume directly.
|
|
4823
4971
|
*/
|
|
4824
|
-
reviews:
|
|
4825
|
-
author:
|
|
4826
|
-
rating:
|
|
4827
|
-
content:
|
|
4828
|
-
date:
|
|
4829
|
-
verified:
|
|
4972
|
+
reviews: z40.array(z40.object({
|
|
4973
|
+
author: z40.string(),
|
|
4974
|
+
rating: z40.number(),
|
|
4975
|
+
content: z40.string(),
|
|
4976
|
+
date: z40.string(),
|
|
4977
|
+
verified: z40.boolean().optional()
|
|
4830
4978
|
})).optional(),
|
|
4831
4979
|
/**
|
|
4832
4980
|
* Ghost-entity flag — `true` when the Storefront API could not hydrate
|
|
@@ -4838,7 +4986,7 @@ var ProductSchema = z39.object({
|
|
|
4838
4986
|
* Set exclusively by `createUnavailableProduct()` — never by the
|
|
4839
4987
|
* Storefront mapper.
|
|
4840
4988
|
*/
|
|
4841
|
-
unavailable:
|
|
4989
|
+
unavailable: z40.boolean().default(false)
|
|
4842
4990
|
});
|
|
4843
4991
|
function createUnavailableProduct(gid) {
|
|
4844
4992
|
return {
|
|
@@ -4860,68 +5008,68 @@ function createUnavailableProduct(gid) {
|
|
|
4860
5008
|
function isGhostEntity(value) {
|
|
4861
5009
|
return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
|
|
4862
5010
|
}
|
|
4863
|
-
var ReviewSchema =
|
|
4864
|
-
id:
|
|
4865
|
-
productId:
|
|
4866
|
-
author:
|
|
4867
|
-
rating:
|
|
4868
|
-
text:
|
|
4869
|
-
date:
|
|
4870
|
-
verified:
|
|
5011
|
+
var ReviewSchema = z40.object({
|
|
5012
|
+
id: z40.string(),
|
|
5013
|
+
productId: z40.string(),
|
|
5014
|
+
author: z40.string(),
|
|
5015
|
+
rating: z40.number(),
|
|
5016
|
+
text: z40.string(),
|
|
5017
|
+
date: z40.string(),
|
|
5018
|
+
verified: z40.boolean()
|
|
4871
5019
|
});
|
|
4872
|
-
var ArticleSchema =
|
|
4873
|
-
id:
|
|
4874
|
-
handle:
|
|
4875
|
-
title:
|
|
4876
|
-
excerpt:
|
|
4877
|
-
content:
|
|
4878
|
-
contentHtml:
|
|
4879
|
-
author:
|
|
4880
|
-
publishedAt:
|
|
5020
|
+
var ArticleSchema = z40.object({
|
|
5021
|
+
id: z40.string(),
|
|
5022
|
+
handle: z40.string().default(""),
|
|
5023
|
+
title: z40.string(),
|
|
5024
|
+
excerpt: z40.string().default(""),
|
|
5025
|
+
content: z40.string().default(""),
|
|
5026
|
+
contentHtml: z40.string().optional(),
|
|
5027
|
+
author: z40.string().default(""),
|
|
5028
|
+
publishedAt: z40.string().default(""),
|
|
4881
5029
|
image: ImageSchema.optional(),
|
|
4882
|
-
blogHandle:
|
|
4883
|
-
tags:
|
|
5030
|
+
blogHandle: z40.string().default(""),
|
|
5031
|
+
tags: z40.array(z40.string()).default([])
|
|
4884
5032
|
});
|
|
4885
|
-
var CmsPageSchema =
|
|
4886
|
-
id:
|
|
4887
|
-
handle:
|
|
4888
|
-
title:
|
|
4889
|
-
body:
|
|
4890
|
-
bodyHtml:
|
|
4891
|
-
bodySummary:
|
|
4892
|
-
updatedAt:
|
|
4893
|
-
seoTitle:
|
|
4894
|
-
seoDescription:
|
|
5033
|
+
var CmsPageSchema = z40.object({
|
|
5034
|
+
id: z40.string(),
|
|
5035
|
+
handle: z40.string().default(""),
|
|
5036
|
+
title: z40.string(),
|
|
5037
|
+
body: z40.string().default(""),
|
|
5038
|
+
bodyHtml: z40.string().optional(),
|
|
5039
|
+
bodySummary: z40.string().default(""),
|
|
5040
|
+
updatedAt: z40.string().default(""),
|
|
5041
|
+
seoTitle: z40.string().optional(),
|
|
5042
|
+
seoDescription: z40.string().optional()
|
|
4895
5043
|
});
|
|
4896
|
-
var CmsPolicySchema =
|
|
4897
|
-
id:
|
|
5044
|
+
var CmsPolicySchema = z40.object({
|
|
5045
|
+
id: z40.string(),
|
|
4898
5046
|
/** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
|
|
4899
5047
|
* 'shipping' | 'subscription' | 'warranty' | custom string. Open so
|
|
4900
5048
|
* platforms with custom policy types can extend. */
|
|
4901
|
-
kind:
|
|
5049
|
+
kind: z40.string(),
|
|
4902
5050
|
/** Slug-shaped handle the platform exposes for storefront URLs
|
|
4903
5051
|
* (e.g. `refund-policy`). Empty string when the backend doesn't
|
|
4904
5052
|
* surface one. */
|
|
4905
|
-
handle:
|
|
4906
|
-
title:
|
|
4907
|
-
body:
|
|
4908
|
-
bodyHtml:
|
|
4909
|
-
url:
|
|
5053
|
+
handle: z40.string().default(""),
|
|
5054
|
+
title: z40.string(),
|
|
5055
|
+
body: z40.string().default(""),
|
|
5056
|
+
bodyHtml: z40.string().optional(),
|
|
5057
|
+
url: z40.string().default("")
|
|
4910
5058
|
});
|
|
4911
|
-
var CollectionSchema =
|
|
4912
|
-
id:
|
|
4913
|
-
handle:
|
|
4914
|
-
title:
|
|
4915
|
-
description:
|
|
5059
|
+
var CollectionSchema = z40.object({
|
|
5060
|
+
id: z40.string(),
|
|
5061
|
+
handle: z40.string().default(""),
|
|
5062
|
+
title: z40.string(),
|
|
5063
|
+
description: z40.string().default(""),
|
|
4916
5064
|
image: ImageSchema.optional(),
|
|
4917
|
-
productCount:
|
|
5065
|
+
productCount: z40.number().int().nonnegative().optional()
|
|
4918
5066
|
});
|
|
4919
|
-
var CartLineSchema =
|
|
4920
|
-
id:
|
|
4921
|
-
merchandiseId:
|
|
4922
|
-
productId:
|
|
4923
|
-
title:
|
|
4924
|
-
variantTitle:
|
|
5067
|
+
var CartLineSchema = z40.object({
|
|
5068
|
+
id: z40.string(),
|
|
5069
|
+
merchandiseId: z40.string(),
|
|
5070
|
+
productId: z40.string(),
|
|
5071
|
+
title: z40.string(),
|
|
5072
|
+
variantTitle: z40.string().optional(),
|
|
4925
5073
|
/**
|
|
4926
5074
|
* The variant's option axes as structured pairs (e.g.
|
|
4927
5075
|
* `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
|
|
@@ -4930,10 +5078,10 @@ var CartLineSchema = z39.object({
|
|
|
4930
5078
|
* single-variant products (the degenerate `Title: Default Title` axis
|
|
4931
5079
|
* is normalized away at the adapter boundary).
|
|
4932
5080
|
*/
|
|
4933
|
-
selectedOptions:
|
|
4934
|
-
vendor:
|
|
4935
|
-
sku:
|
|
4936
|
-
quantity:
|
|
5081
|
+
selectedOptions: z40.array(SelectedOptionSchema).optional(),
|
|
5082
|
+
vendor: z40.string().optional(),
|
|
5083
|
+
sku: z40.string().optional(),
|
|
5084
|
+
quantity: z40.number().int().positive(),
|
|
4937
5085
|
unitPrice: MoneySchema,
|
|
4938
5086
|
totalPrice: MoneySchema,
|
|
4939
5087
|
image: ImageSchema.optional(),
|
|
@@ -4953,26 +5101,26 @@ var CartLineSchema = z39.object({
|
|
|
4953
5101
|
* client-minted id the backend rejects, line-tap navigation is
|
|
4954
5102
|
* suppressed, and the money never folds into a settled-looking total.
|
|
4955
5103
|
*/
|
|
4956
|
-
pending:
|
|
5104
|
+
pending: z40.boolean().optional()
|
|
4957
5105
|
});
|
|
4958
5106
|
function isPendingCartLine(line) {
|
|
4959
5107
|
return line.pending === true;
|
|
4960
5108
|
}
|
|
4961
|
-
var CartDiscountCodeSchema =
|
|
4962
|
-
code:
|
|
4963
|
-
applicable:
|
|
5109
|
+
var CartDiscountCodeSchema = z40.object({
|
|
5110
|
+
code: z40.string(),
|
|
5111
|
+
applicable: z40.boolean()
|
|
4964
5112
|
});
|
|
4965
|
-
var CartMessageSchema =
|
|
4966
|
-
kind:
|
|
5113
|
+
var CartMessageSchema = z40.object({
|
|
5114
|
+
kind: z40.enum(["error", "warning", "info"]),
|
|
4967
5115
|
/** Machine code for branching; opaque and backend-defined. */
|
|
4968
|
-
code:
|
|
5116
|
+
code: z40.string(),
|
|
4969
5117
|
/** Human-readable text, meant to be shown as-is. */
|
|
4970
|
-
content:
|
|
5118
|
+
content: z40.string()
|
|
4971
5119
|
});
|
|
4972
|
-
var CartSchema =
|
|
4973
|
-
id:
|
|
4974
|
-
lines:
|
|
4975
|
-
totalQuantity:
|
|
5120
|
+
var CartSchema = z40.object({
|
|
5121
|
+
id: z40.string(),
|
|
5122
|
+
lines: z40.array(CartLineSchema),
|
|
5123
|
+
totalQuantity: z40.number().int().nonnegative(),
|
|
4976
5124
|
subtotal: MoneySchema,
|
|
4977
5125
|
/**
|
|
4978
5126
|
* Cart total after discounts (pre-shipping/tax). Absent when the
|
|
@@ -4982,11 +5130,11 @@ var CartSchema = z39.object({
|
|
|
4982
5130
|
*/
|
|
4983
5131
|
total: MoneySchema.optional(),
|
|
4984
5132
|
/** Discount codes currently attached to the cart. */
|
|
4985
|
-
discountCodes:
|
|
5133
|
+
discountCodes: z40.array(CartDiscountCodeSchema).default([]),
|
|
4986
5134
|
/** Notices the backend attached to this cart — see `CartMessageSchema`.
|
|
4987
5135
|
* Empty when the backend said nothing or does not report them. */
|
|
4988
|
-
messages:
|
|
4989
|
-
checkoutUrl:
|
|
5136
|
+
messages: z40.array(CartMessageSchema).default([]),
|
|
5137
|
+
checkoutUrl: z40.string().optional(),
|
|
4990
5138
|
/**
|
|
4991
5139
|
* Opaque handle this cart is known by in the connector's BACK OFFICE — the
|
|
4992
5140
|
* value a space owner searches there to find the order this cart became.
|
|
@@ -4999,14 +5147,14 @@ var CartSchema = z39.object({
|
|
|
4999
5147
|
* Absent when the platform has no such handle, or while the cart is still the
|
|
5000
5148
|
* client's optimistic paint and its id is client-minted.
|
|
5001
5149
|
*/
|
|
5002
|
-
backOfficeRef:
|
|
5150
|
+
backOfficeRef: z40.string().optional(),
|
|
5003
5151
|
/**
|
|
5004
5152
|
* URL that recreates this cart on the merchant's own store website
|
|
5005
5153
|
* (replace semantics — overwrites any cart the visitor already has
|
|
5006
5154
|
* there). Populated by platform adapters that support it; absent when
|
|
5007
5155
|
* the cart is empty or the URL cannot be built.
|
|
5008
5156
|
*/
|
|
5009
|
-
storeCartUrl:
|
|
5157
|
+
storeCartUrl: z40.string().optional(),
|
|
5010
5158
|
/**
|
|
5011
5159
|
* True while this cart exists only in the client's optimistic paint —
|
|
5012
5160
|
* no backend cart has been created yet, so its `id` is client-minted and
|
|
@@ -5014,7 +5162,7 @@ var CartSchema = z39.object({
|
|
|
5014
5162
|
* `CartLineSchema.pending`: the adapter never sets it, and callers that
|
|
5015
5163
|
* need a real cart id read THIS rather than sniffing the id's shape.
|
|
5016
5164
|
*/
|
|
5017
|
-
pending:
|
|
5165
|
+
pending: z40.boolean().optional()
|
|
5018
5166
|
});
|
|
5019
5167
|
function settledCart(cart) {
|
|
5020
5168
|
if (cart === null || cart === void 0) return null;
|
|
@@ -5022,27 +5170,27 @@ function settledCart(cart) {
|
|
|
5022
5170
|
}
|
|
5023
5171
|
|
|
5024
5172
|
// ../ecommerce/src/review-schemas.ts
|
|
5025
|
-
import { z as
|
|
5173
|
+
import { z as z41 } from "zod";
|
|
5026
5174
|
var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
|
|
5027
|
-
var ProductReviewItemSchema =
|
|
5028
|
-
author:
|
|
5029
|
-
rating:
|
|
5175
|
+
var ProductReviewItemSchema = z41.object({
|
|
5176
|
+
author: z41.string(),
|
|
5177
|
+
rating: z41.number(),
|
|
5030
5178
|
/** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
|
|
5031
|
-
title:
|
|
5032
|
-
content:
|
|
5033
|
-
date:
|
|
5034
|
-
verified:
|
|
5179
|
+
title: z41.string().optional(),
|
|
5180
|
+
content: z41.string(),
|
|
5181
|
+
date: z41.string(),
|
|
5182
|
+
verified: z41.boolean().optional(),
|
|
5035
5183
|
/**
|
|
5036
5184
|
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
5037
5185
|
* than this one (brands pool reviews across a product line). A surface can
|
|
5038
5186
|
* attribute it; empty / absent ⇒ the product's own review.
|
|
5039
5187
|
*/
|
|
5040
|
-
writtenFor:
|
|
5188
|
+
writtenFor: z41.string().optional()
|
|
5041
5189
|
});
|
|
5042
5190
|
var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
5043
5191
|
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
5044
5192
|
* scored, NOT necessarily text that occurs in `content`. */
|
|
5045
|
-
highlight:
|
|
5193
|
+
highlight: z41.string().optional(),
|
|
5046
5194
|
/**
|
|
5047
5195
|
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
5048
5196
|
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
@@ -5057,29 +5205,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
|
5057
5205
|
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
5058
5206
|
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
5059
5207
|
*/
|
|
5060
|
-
mark:
|
|
5208
|
+
mark: z41.string().optional()
|
|
5061
5209
|
});
|
|
5062
|
-
var ReviewAggregateSchema =
|
|
5063
|
-
value:
|
|
5064
|
-
count:
|
|
5210
|
+
var ReviewAggregateSchema = z41.object({
|
|
5211
|
+
value: z41.number(),
|
|
5212
|
+
count: z41.number()
|
|
5065
5213
|
});
|
|
5066
|
-
var ProductReviewDataSchema =
|
|
5067
|
-
id:
|
|
5214
|
+
var ProductReviewDataSchema = z41.object({
|
|
5215
|
+
id: z41.string(),
|
|
5068
5216
|
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
5069
|
-
reviews:
|
|
5217
|
+
reviews: z41.array(ProductReviewItemSchema).default([]),
|
|
5070
5218
|
aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
|
|
5071
5219
|
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
5072
|
-
distribution:
|
|
5220
|
+
distribution: z41.array(z41.number()).default([]),
|
|
5073
5221
|
/**
|
|
5074
5222
|
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
5075
5223
|
* intent was asked for — never a silent copy of `reviews`.
|
|
5076
5224
|
*/
|
|
5077
|
-
highlights:
|
|
5225
|
+
highlights: z41.array(ProductReviewHighlightSchema).default([]),
|
|
5078
5226
|
/**
|
|
5079
5227
|
* True when the review provider could not be read and nothing is indexed —
|
|
5080
5228
|
* the empty lists mean "not loaded", NOT "this product has no reviews".
|
|
5081
5229
|
*/
|
|
5082
|
-
unavailable:
|
|
5230
|
+
unavailable: z41.boolean().optional()
|
|
5083
5231
|
});
|
|
5084
5232
|
var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
|
|
5085
5233
|
|
|
@@ -5373,9 +5521,9 @@ function readPdpCompanions(config) {
|
|
|
5373
5521
|
}
|
|
5374
5522
|
|
|
5375
5523
|
// ../ecommerce/src/base-attributes.ts
|
|
5376
|
-
import { z as
|
|
5524
|
+
import { z as z42 } from "zod";
|
|
5377
5525
|
var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
|
|
5378
|
-
var BaseAttributesRecordSchema =
|
|
5526
|
+
var BaseAttributesRecordSchema = z42.record(z42.string(), AttributeDefSchema);
|
|
5379
5527
|
function buildBaseAttributesConfig(attributes) {
|
|
5380
5528
|
return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
|
|
5381
5529
|
}
|
|
@@ -5386,9 +5534,9 @@ function readBaseAttributesConfig(config) {
|
|
|
5386
5534
|
}
|
|
5387
5535
|
|
|
5388
5536
|
// ../ecommerce/src/bucket-labels.ts
|
|
5389
|
-
import { z as
|
|
5537
|
+
import { z as z43 } from "zod";
|
|
5390
5538
|
var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
|
|
5391
|
-
var BucketLabelsRecordSchema =
|
|
5539
|
+
var BucketLabelsRecordSchema = z43.record(z43.string(), z43.string());
|
|
5392
5540
|
function buildBucketLabelsConfig(labels) {
|
|
5393
5541
|
return { [BUCKET_LABELS_CONFIG_KEY]: labels };
|
|
5394
5542
|
}
|
|
@@ -6562,8 +6710,8 @@ var PRESENCE_LIFECYCLE = {
|
|
|
6562
6710
|
};
|
|
6563
6711
|
|
|
6564
6712
|
// ../spacestation/src/widgets/presence/profile.ts
|
|
6565
|
-
import { z as
|
|
6566
|
-
var PresenceProfileSchema =
|
|
6713
|
+
import { z as z44 } from "zod";
|
|
6714
|
+
var PresenceProfileSchema = z44.object({
|
|
6567
6715
|
/**
|
|
6568
6716
|
* How much the agent SPEAKS in presence.
|
|
6569
6717
|
* - 'off' the faculty generates no prose at all. Zero tokens, and
|
|
@@ -6573,14 +6721,14 @@ var PresenceProfileSchema = z43.object({
|
|
|
6573
6721
|
* - 'terse' one lead line per turn. The default — see below.
|
|
6574
6722
|
* - 'full' a lead line plus asides beside individual elements.
|
|
6575
6723
|
*/
|
|
6576
|
-
voice:
|
|
6724
|
+
voice: z44.enum(["off", "terse", "full"]),
|
|
6577
6725
|
/**
|
|
6578
6726
|
* Which source kinds this space surfaces. 'all' = every tool that declares a
|
|
6579
6727
|
* `sourceKind`. An explicit list lets a space stay quiet about lookups its
|
|
6580
6728
|
* visitors would find uninteresting (policy checks on a fashion space)
|
|
6581
6729
|
* without the tool having to lie about what it is.
|
|
6582
6730
|
*/
|
|
6583
|
-
sources:
|
|
6731
|
+
sources: z44.union([z44.array(z44.string()), z44.literal("all")]),
|
|
6584
6732
|
/**
|
|
6585
6733
|
* Which facts render.
|
|
6586
6734
|
* - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
|
|
@@ -6589,7 +6737,7 @@ var PresenceProfileSchema = z43.object({
|
|
|
6589
6737
|
* - 'all' shows stated facts too — for spaces where confirming the brief
|
|
6590
6738
|
* back is itself the product (intake, configuration).
|
|
6591
6739
|
*/
|
|
6592
|
-
facts:
|
|
6740
|
+
facts: z44.enum(["inferred-only", "all"])
|
|
6593
6741
|
});
|
|
6594
6742
|
var DEFAULT_PRESENCE_PROFILE = {
|
|
6595
6743
|
voice: "terse",
|
|
@@ -6773,7 +6921,7 @@ function useAgentPresenceFresh(flowId = PRESENCE_FLOW) {
|
|
|
6773
6921
|
}
|
|
6774
6922
|
|
|
6775
6923
|
// src/widgets/presence/use-layout-entity-ids.ts
|
|
6776
|
-
import { useMemo as
|
|
6924
|
+
import { useMemo as useMemo5 } from "react";
|
|
6777
6925
|
|
|
6778
6926
|
// src/catalog/CatalogContext.tsx
|
|
6779
6927
|
import { createContext as createContext8, useContext as useContext8 } from "react";
|
|
@@ -6803,7 +6951,7 @@ function collectLayoutGids(layout, catalog) {
|
|
|
6803
6951
|
function useLayoutEntityIds() {
|
|
6804
6952
|
const layout = useLayout();
|
|
6805
6953
|
const catalog = useComponentCatalog();
|
|
6806
|
-
return
|
|
6954
|
+
return useMemo5(() => [...collectLayoutGids(layout, catalog)], [layout, catalog]);
|
|
6807
6955
|
}
|
|
6808
6956
|
|
|
6809
6957
|
// src/widgets/presence/use-presence.ts
|
|
@@ -8519,22 +8667,22 @@ function buildComponentLibrary(catalog, componentMap) {
|
|
|
8519
8667
|
}
|
|
8520
8668
|
|
|
8521
8669
|
// src/catalog/define.ts
|
|
8522
|
-
import { z as
|
|
8670
|
+
import { z as z45 } from "zod";
|
|
8523
8671
|
function entity(resolverKey, opts) {
|
|
8524
|
-
return resolved(
|
|
8672
|
+
return resolved(z45.string(), resolverKey, opts);
|
|
8525
8673
|
}
|
|
8526
|
-
var text = prose(
|
|
8674
|
+
var text = prose(z45.string());
|
|
8527
8675
|
function plain() {
|
|
8528
|
-
return
|
|
8676
|
+
return z45.string();
|
|
8529
8677
|
}
|
|
8530
8678
|
function token(values) {
|
|
8531
|
-
return
|
|
8679
|
+
return z45.enum(values);
|
|
8532
8680
|
}
|
|
8533
8681
|
function catalogComponent(meta, render) {
|
|
8534
8682
|
const { props, requires, ...rest } = meta;
|
|
8535
8683
|
return {
|
|
8536
8684
|
...rest,
|
|
8537
|
-
propsSchema:
|
|
8685
|
+
propsSchema: z45.object(props),
|
|
8538
8686
|
...requires !== void 0 ? { requires } : {},
|
|
8539
8687
|
component: adaptComponent(render)
|
|
8540
8688
|
};
|
|
@@ -8760,7 +8908,7 @@ __export(presence_exports2, {
|
|
|
8760
8908
|
});
|
|
8761
8909
|
|
|
8762
8910
|
// src/widgets/presence/use-standing-signal.ts
|
|
8763
|
-
import { useMemo as
|
|
8911
|
+
import { useMemo as useMemo9 } from "react";
|
|
8764
8912
|
|
|
8765
8913
|
// src/widgets/presence/core-presence/standing-signal-store.ts
|
|
8766
8914
|
import { useSyncExternalStore as useSyncExternalStore3 } from "react";
|
|
@@ -8844,7 +8992,7 @@ function useConsumeStandingSignal(type) {
|
|
|
8844
8992
|
const session = useFourtySession();
|
|
8845
8993
|
const scope2 = session.sessionId === null ? void 0 : session.sessionId;
|
|
8846
8994
|
useRegisterSignalHandlers(
|
|
8847
|
-
|
|
8995
|
+
useMemo9(
|
|
8848
8996
|
() => ({
|
|
8849
8997
|
[type]: (payload) => {
|
|
8850
8998
|
const id = typeof payload.id === "string" && payload.id.length > 0 ? payload.id : type;
|
|
@@ -8855,7 +9003,7 @@ function useConsumeStandingSignal(type) {
|
|
|
8855
9003
|
)
|
|
8856
9004
|
);
|
|
8857
9005
|
const standing = useStandingOfType(type);
|
|
8858
|
-
return
|
|
9006
|
+
return useMemo9(() => {
|
|
8859
9007
|
if (standing === null) return null;
|
|
8860
9008
|
const id = standing.id;
|
|
8861
9009
|
return {
|
|
@@ -9329,7 +9477,7 @@ function usePostHydrationTransforms() {
|
|
|
9329
9477
|
}
|
|
9330
9478
|
|
|
9331
9479
|
// src/projection/transform.ts
|
|
9332
|
-
import { useMemo as
|
|
9480
|
+
import { useMemo as useMemo11 } from "react";
|
|
9333
9481
|
|
|
9334
9482
|
// src/projection/preferences.ts
|
|
9335
9483
|
import { useSyncExternalStore as useSyncExternalStore4 } from "react";
|
|
@@ -9457,7 +9605,7 @@ var projectionTransform = {
|
|
|
9457
9605
|
use: () => {
|
|
9458
9606
|
const preferences2 = useProjectionPreferences();
|
|
9459
9607
|
const facts = useFacts();
|
|
9460
|
-
return
|
|
9608
|
+
return useMemo11(() => {
|
|
9461
9609
|
if (Object.keys(preferences2).length === 0) return null;
|
|
9462
9610
|
return buildTransform(preferences2, facts);
|
|
9463
9611
|
}, [preferences2, facts]);
|
|
@@ -9719,14 +9867,14 @@ function useFormFactor() {
|
|
|
9719
9867
|
}
|
|
9720
9868
|
|
|
9721
9869
|
// src/utils/use-inline-completion.ts
|
|
9722
|
-
import { useCallback as useCallback15, useMemo as
|
|
9870
|
+
import { useCallback as useCallback15, useMemo as useMemo12, useState as useState8 } from "react";
|
|
9723
9871
|
function useInlineCompletion(opts) {
|
|
9724
9872
|
const { value, candidates } = opts;
|
|
9725
9873
|
const minChars = opts.minChars !== void 0 ? opts.minChars : 2;
|
|
9726
9874
|
const enabled = opts.enabled !== void 0 ? opts.enabled : true;
|
|
9727
9875
|
const [dismissedValue, setDismissedValue] = useState8(null);
|
|
9728
9876
|
const dismiss = useCallback15(() => setDismissedValue(value), [value]);
|
|
9729
|
-
return
|
|
9877
|
+
return useMemo12(() => {
|
|
9730
9878
|
if (!enabled || value.length < minChars || dismissedValue === value) {
|
|
9731
9879
|
return { completion: "", ghost: "", active: false, dismiss };
|
|
9732
9880
|
}
|
|
@@ -10570,18 +10718,18 @@ __export(ecommerce_exports, {
|
|
|
10570
10718
|
});
|
|
10571
10719
|
|
|
10572
10720
|
// ../spacestation/src/analytics/ecommerce/surfacing.ts
|
|
10573
|
-
import { z as
|
|
10721
|
+
import { z as z46 } from "zod";
|
|
10574
10722
|
var PRODUCTS_SURFACED = defineEventKind(
|
|
10575
10723
|
"commerce.products_surfaced",
|
|
10576
10724
|
"client",
|
|
10577
|
-
|
|
10725
|
+
z46.object({
|
|
10578
10726
|
/** The turn whose commit this describes. Minted where the prompt signal
|
|
10579
10727
|
* is built and shared with `agent_runs`, so the read layer can line a
|
|
10580
10728
|
* surfacing up against the prompt that asked for it. */
|
|
10581
|
-
turnId:
|
|
10729
|
+
turnId: z46.string().min(1).max(128),
|
|
10582
10730
|
/** Distinct entity refs this turn placed that were not on the canvas
|
|
10583
10731
|
* before it. ZERO IS A REAL VALUE — see the header. */
|
|
10584
|
-
productCount:
|
|
10732
|
+
productCount: z46.number().int().nonnegative()
|
|
10585
10733
|
}).strict()
|
|
10586
10734
|
);
|
|
10587
10735
|
|
|
@@ -10603,14 +10751,14 @@ function isFunnelStep(value) {
|
|
|
10603
10751
|
}
|
|
10604
10752
|
|
|
10605
10753
|
// src/verticals/commerce/product/use-product-grid-filter.ts
|
|
10606
|
-
import { useCallback as useCallback17, useMemo as
|
|
10754
|
+
import { useCallback as useCallback17, useMemo as useMemo14, useState as useState11 } from "react";
|
|
10607
10755
|
function useProductGridFilter(chips) {
|
|
10608
|
-
const labelKey =
|
|
10756
|
+
const labelKey = useMemo14(() => chips.map((c) => c.label).join("|"), [chips]);
|
|
10609
10757
|
const first = chips[0];
|
|
10610
10758
|
const [activeLabel, setActiveLabel] = useState11(
|
|
10611
10759
|
first !== void 0 ? first.label : null
|
|
10612
10760
|
);
|
|
10613
|
-
const activeFromKey =
|
|
10761
|
+
const activeFromKey = useMemo14(() => {
|
|
10614
10762
|
void labelKey;
|
|
10615
10763
|
if (first === void 0) return null;
|
|
10616
10764
|
const found = chips.find((c) => c.label === activeLabel);
|
|
@@ -10623,7 +10771,7 @@ function useProductGridFilter(chips) {
|
|
|
10623
10771
|
}
|
|
10624
10772
|
|
|
10625
10773
|
// src/verticals/commerce/product/use-product-detail.ts
|
|
10626
|
-
import { useCallback as useCallback19, useMemo as
|
|
10774
|
+
import { useCallback as useCallback19, useMemo as useMemo15, useRef as useRef13, useState as useState14 } from "react";
|
|
10627
10775
|
|
|
10628
10776
|
// src/verticals/commerce/checkout/use-buy-now.ts
|
|
10629
10777
|
import { useCallback as useCallback18, useEffect as useEffect16, useState as useState12 } from "react";
|
|
@@ -10918,15 +11066,15 @@ function useProductDetail(product) {
|
|
|
10918
11066
|
}
|
|
10919
11067
|
const { selectedVariants, setSelectedVariants, markTouched } = useSelectedVariantsState(product, facts);
|
|
10920
11068
|
const desc = useExpandable(false);
|
|
10921
|
-
const variantGroups =
|
|
11069
|
+
const variantGroups = useMemo15(
|
|
10922
11070
|
() => deriveVariantGroups(product),
|
|
10923
11071
|
[product]
|
|
10924
11072
|
);
|
|
10925
|
-
const allSelected =
|
|
11073
|
+
const allSelected = useMemo15(
|
|
10926
11074
|
() => variantGroups.every((g) => selectedVariants[g.name] !== void 0),
|
|
10927
11075
|
[variantGroups, selectedVariants]
|
|
10928
11076
|
);
|
|
10929
|
-
const missingGroup =
|
|
11077
|
+
const missingGroup = useMemo15(
|
|
10930
11078
|
() => variantGroups.find((g) => selectedVariants[g.name] === void 0),
|
|
10931
11079
|
[variantGroups, selectedVariants]
|
|
10932
11080
|
);
|
|
@@ -11235,7 +11383,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11235
11383
|
}
|
|
11236
11384
|
|
|
11237
11385
|
// src/verticals/commerce/cart/cart-action-failures.ts
|
|
11238
|
-
import { useMemo as
|
|
11386
|
+
import { useMemo as useMemo16, useSyncExternalStore as useSyncExternalStore11 } from "react";
|
|
11239
11387
|
var FAILURE_TTL_MS = 2 * 6e4;
|
|
11240
11388
|
var FAILURE_CAP = 5;
|
|
11241
11389
|
var failures = [];
|
|
@@ -11287,7 +11435,7 @@ function useCartActionFailures() {
|
|
|
11287
11435
|
function useCartActionFailuresFor(productIdsInCart) {
|
|
11288
11436
|
const all = useCartActionFailures();
|
|
11289
11437
|
const key = productIdsInCart.join("\0");
|
|
11290
|
-
return
|
|
11438
|
+
return useMemo16(() => {
|
|
11291
11439
|
const present = new Set(key.length === 0 ? [] : key.split("\0"));
|
|
11292
11440
|
return all.filter((f) => f.productId !== void 0 && !present.has(f.productId));
|
|
11293
11441
|
}, [all, key]);
|
|
@@ -12081,7 +12229,7 @@ function useContentActions() {
|
|
|
12081
12229
|
import { useEffect as useEffect19, useState as useState18 } from "react";
|
|
12082
12230
|
|
|
12083
12231
|
// package.json
|
|
12084
|
-
var version = "0.5.
|
|
12232
|
+
var version = "0.5.3";
|
|
12085
12233
|
|
|
12086
12234
|
// src/host/host-modules.ts
|
|
12087
12235
|
import * as react from "react";
|
|
@@ -12168,12 +12316,16 @@ function Spacefront(props) {
|
|
|
12168
12316
|
}
|
|
12169
12317
|
|
|
12170
12318
|
// src/npm.ts
|
|
12171
|
-
import { z as
|
|
12319
|
+
import { z as z48 } from "zod";
|
|
12172
12320
|
export {
|
|
12173
12321
|
ACQUISITION_KIND_LABELS,
|
|
12174
12322
|
ACTIVE_PANEL_ATTR,
|
|
12175
12323
|
ACTIVE_PANEL_SELECTOR,
|
|
12176
12324
|
AGENT_ASK_SIGNAL,
|
|
12325
|
+
AGENT_DIRECTIVE_KINDS,
|
|
12326
|
+
AGENT_DIRECTIVE_SEVERITIES,
|
|
12327
|
+
AGENT_DIRECTIVE_SOURCES,
|
|
12328
|
+
AGENT_DIRECTIVE_STATUSES,
|
|
12177
12329
|
ALLOWED_ATTACHMENT_TYPES,
|
|
12178
12330
|
ANALYTICS_CONSENTS,
|
|
12179
12331
|
ANALYTICS_MAX_QUEUED,
|
|
@@ -12181,6 +12333,7 @@ export {
|
|
|
12181
12333
|
ARRIVAL_MAX_VALUE_CHARS,
|
|
12182
12334
|
ARRIVAL_PARAMS,
|
|
12183
12335
|
ATTACHMENT_ACCEPT,
|
|
12336
|
+
AgentDirectiveSchema,
|
|
12184
12337
|
AgentOutputSchema,
|
|
12185
12338
|
AgentSessionSummarySchema,
|
|
12186
12339
|
AgentSignalSchema,
|
|
@@ -12309,6 +12462,7 @@ export {
|
|
|
12309
12462
|
LlmSessionsDailySchema,
|
|
12310
12463
|
LlmUsageBySessionSchema,
|
|
12311
12464
|
LlmUsageDailySchema,
|
|
12465
|
+
MAX_ACTIVE_AGENT_DIRECTIVES,
|
|
12312
12466
|
MAX_ATTACHMENT_BYTES,
|
|
12313
12467
|
MAX_VISITOR_PROMPT_CHARS,
|
|
12314
12468
|
MIN_WIRE_PROTOCOL_VERSION,
|
|
@@ -12352,6 +12506,7 @@ export {
|
|
|
12352
12506
|
RecordVerdictInputSchema,
|
|
12353
12507
|
RecordableVerdictSchema,
|
|
12354
12508
|
RegistryProvider,
|
|
12509
|
+
ReorderAgentDirectivesInputSchema,
|
|
12355
12510
|
ReviewAggregateSchema,
|
|
12356
12511
|
ReviewSchema,
|
|
12357
12512
|
SCANNING_FORM,
|
|
@@ -12390,6 +12545,8 @@ export {
|
|
|
12390
12545
|
ShellRootContext,
|
|
12391
12546
|
ShimmerSweep,
|
|
12392
12547
|
SiblingProductSchema,
|
|
12548
|
+
SpaceAgentDirectiveListItemSchema,
|
|
12549
|
+
SpaceAgentDirectiveSchema,
|
|
12393
12550
|
SpaceBrandMarkSchema,
|
|
12394
12551
|
SpaceBugSchema,
|
|
12395
12552
|
Spacefront,
|
|
@@ -12412,8 +12569,10 @@ export {
|
|
|
12412
12569
|
TransitionProvider,
|
|
12413
12570
|
TurnAskPlacementProvider,
|
|
12414
12571
|
TurnAskSchema,
|
|
12572
|
+
TurnScopeProvider,
|
|
12415
12573
|
UIElementSchema,
|
|
12416
12574
|
UnsupportedSchemaError,
|
|
12575
|
+
UpdateAgentDirectiveInputSchema,
|
|
12417
12576
|
UpdateCommentInputSchema,
|
|
12418
12577
|
VARIANT_SELECTED_OBSERVATION,
|
|
12419
12578
|
VIEW_EXHAUSTED_SIGNAL,
|
|
@@ -12815,6 +12974,7 @@ export {
|
|
|
12815
12974
|
useTurnAsk,
|
|
12816
12975
|
useTurnAskPlacement,
|
|
12817
12976
|
useTurnAskReply,
|
|
12977
|
+
useTurnScope,
|
|
12818
12978
|
useUndismissedFacts,
|
|
12819
12979
|
useVariantSelections,
|
|
12820
12980
|
useViewportWindow,
|
|
@@ -12832,5 +12992,5 @@ export {
|
|
|
12832
12992
|
wipeProfile,
|
|
12833
12993
|
withCartActorOrigin,
|
|
12834
12994
|
withInteractionTracking,
|
|
12835
|
-
|
|
12995
|
+
z48 as z
|
|
12836
12996
|
};
|