@40rty/ams-sdk 0.5.18 → 0.5.20
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 +1171 -950
- package/dist/types/ecommerce/src/catalog-search.d.ts +32 -0
- package/dist/types/ecommerce/src/commerce-schemas.d.ts +18 -0
- package/dist/types/ecommerce/src/index.d.ts +3 -0
- package/dist/types/ecommerce/src/shop-checkout.d.ts +21 -0
- package/dist/types/ecommerce/src/store-articles.d.ts +34 -0
- package/dist/types/sdk/src/canvas/ElementIdContext.d.ts +8 -0
- package/dist/types/sdk/src/canvas/canvas-arrangement.d.ts +10 -3
- package/dist/types/sdk/src/canvas/canvas-turn-tail.d.ts +44 -0
- package/dist/types/sdk/src/canvas/index.d.ts +2 -1
- package/dist/types/sdk/src/host/host-modules.d.ts +102 -6
- package/dist/types/sdk/src/shell/index.d.ts +1 -0
- package/dist/types/sdk/src/shell/use-ask-about.d.ts +10 -0
- package/dist/types/sdk/src/verticals/commerce/commerce-context.d.ts +21 -2
- package/dist/types/sdk/src/verticals/commerce/commerce-shapes.d.ts +41 -1
- package/dist/types/sdk/src/verticals/commerce/index.d.ts +2 -2
- package/dist/types/spacestation/src/index.d.ts +1 -0
- package/dist/types/spacestation/src/signal/visitor-view.d.ts +101 -0
- package/dist/types/spacestation/src/space/connector.d.ts +8 -1
- package/dist/types/spacestation/src/space/session-queue.d.ts +6 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -25,6 +25,7 @@ __export(src_exports3, {
|
|
|
25
25
|
ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
|
|
26
26
|
ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
|
|
27
27
|
ATTACHMENT_ACCEPT: () => ATTACHMENT_ACCEPT,
|
|
28
|
+
ATTENTION_NAMESPACE: () => ATTENTION_NAMESPACE,
|
|
28
29
|
AgentDirectiveSchema: () => AgentDirectiveSchema,
|
|
29
30
|
AgentOutputSchema: () => AgentOutputSchema,
|
|
30
31
|
AgentSessionSummarySchema: () => AgentSessionSummarySchema,
|
|
@@ -35,6 +36,7 @@ __export(src_exports3, {
|
|
|
35
36
|
AttachmentRefSchema: () => AttachmentRefSchema,
|
|
36
37
|
AttachmentRefsSchema: () => AttachmentRefsSchema,
|
|
37
38
|
AttachmentUploadError: () => AttachmentUploadError,
|
|
39
|
+
AttentionSchema: () => AttentionSchema,
|
|
38
40
|
AttributeDefSchema: () => AttributeDefSchema,
|
|
39
41
|
AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
|
|
40
42
|
AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
|
|
@@ -87,6 +89,7 @@ __export(src_exports3, {
|
|
|
87
89
|
CanvasOutletProvider: () => CanvasOutletProvider,
|
|
88
90
|
CanvasTailMount: () => CanvasTailMount,
|
|
89
91
|
CanvasTailProvider: () => CanvasTailProvider,
|
|
92
|
+
CanvasTurnTailProvider: () => CanvasTurnTailProvider,
|
|
90
93
|
CartAddSignalPayloadSchema: () => CartAddSignalPayloadSchema,
|
|
91
94
|
CartDiscountCodeSchema: () => CartDiscountCodeSchema,
|
|
92
95
|
CartLineSchema: () => CartLineSchema,
|
|
@@ -128,6 +131,7 @@ __export(src_exports3, {
|
|
|
128
131
|
EXTEND_FLOW: () => EXTEND_FLOW,
|
|
129
132
|
EXTRAS_PREFIX: () => EXTRAS_PREFIX,
|
|
130
133
|
ElementIdContext: () => ElementIdContext,
|
|
134
|
+
ElementLayoutContext: () => ElementLayoutContext,
|
|
131
135
|
EntryContextNamespaceSchema: () => EntryContextNamespaceSchema,
|
|
132
136
|
EntryContextSchema: () => EntryContextSchema,
|
|
133
137
|
EntryContextValueSchema: () => EntryContextValueSchema,
|
|
@@ -177,6 +181,7 @@ __export(src_exports3, {
|
|
|
177
181
|
NullComponent: () => NullComponent,
|
|
178
182
|
OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
|
|
179
183
|
PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
|
|
184
|
+
POINTING_NAMESPACE: () => POINTING_NAMESPACE,
|
|
180
185
|
PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
181
186
|
PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
|
|
182
187
|
PRESENCE_FLOW: () => PRESENCE_FLOW,
|
|
@@ -192,6 +197,7 @@ __export(src_exports3, {
|
|
|
192
197
|
PackageReleaseSchema: () => PackageReleaseSchema,
|
|
193
198
|
PageSchema: () => PageSchema,
|
|
194
199
|
PatchSchema: () => PatchSchema,
|
|
200
|
+
PointedAtSchema: () => PointedAtSchema,
|
|
195
201
|
PresenceRuntimeProvider: () => PresenceRuntimeProvider,
|
|
196
202
|
ProductReviewDataSchema: () => ProductReviewDataSchema,
|
|
197
203
|
ProductReviewHighlightSchema: () => ProductReviewHighlightSchema,
|
|
@@ -274,6 +280,7 @@ __export(src_exports3, {
|
|
|
274
280
|
THREAD_ROW_ATTR: () => THREAD_ROW_ATTR,
|
|
275
281
|
TRAFFIC_BUCKETS: () => TRAFFIC_BUCKETS,
|
|
276
282
|
TURN_ASK_SIGNAL: () => TURN_ASK_SIGNAL,
|
|
283
|
+
TURN_TAIL_ATTR: () => TURN_TAIL_ATTR,
|
|
277
284
|
ThreadHeadroom: () => ThreadHeadroom,
|
|
278
285
|
ToolCallHintSchema: () => ToolCallHintSchema,
|
|
279
286
|
TraceRecordSchema: () => TraceRecordSchema,
|
|
@@ -346,8 +353,11 @@ __export(src_exports3, {
|
|
|
346
353
|
classifyItemChange: () => classifyItemChange,
|
|
347
354
|
clearAgentPresence: () => clearAgentPresence,
|
|
348
355
|
clearCartActionFailures: () => clearCartActionFailures,
|
|
356
|
+
clearCatalogSearches: () => clearCatalogSearches,
|
|
349
357
|
clearCodeDiscountSources: () => clearCodeDiscountSources,
|
|
350
358
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
359
|
+
clearShopCheckouts: () => clearShopCheckouts,
|
|
360
|
+
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
351
361
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
352
362
|
clearVariantChoice: () => clearVariantChoice,
|
|
353
363
|
clientStateEntries: () => clientStateEntries,
|
|
@@ -493,6 +503,7 @@ __export(src_exports3, {
|
|
|
493
503
|
recordVisitorCheckoutExit: () => recordVisitorCheckoutExit,
|
|
494
504
|
reducePatch: () => reducePatch,
|
|
495
505
|
refuseCheckoutHandoff: () => refuseCheckoutHandoff,
|
|
506
|
+
registerCatalogSearch: () => registerCatalogSearch,
|
|
496
507
|
registerChipRelevanceRule: () => registerChipRelevanceRule,
|
|
497
508
|
registerCodeDiscountSource: () => registerCodeDiscountSource,
|
|
498
509
|
registerComponent: () => registerComponent,
|
|
@@ -508,6 +519,8 @@ __export(src_exports3, {
|
|
|
508
519
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
509
520
|
registerServiceHydrators: () => registerServiceHydrators,
|
|
510
521
|
registerSessionScopedClear: () => registerSessionScopedClear,
|
|
522
|
+
registerShopCheckout: () => registerShopCheckout,
|
|
523
|
+
registerStoreArticleLookup: () => registerStoreArticleLookup,
|
|
511
524
|
registerStoreThemeSource: () => registerStoreThemeSource,
|
|
512
525
|
registeredPageKinds: () => registeredPageKinds,
|
|
513
526
|
registeredPresenceFactForms: () => registeredPresenceFactForms,
|
|
@@ -520,6 +533,7 @@ __export(src_exports3, {
|
|
|
520
533
|
requestVariantChoice: () => requestVariantChoice,
|
|
521
534
|
requiredTopLevelProps: () => requiredTopLevelProps,
|
|
522
535
|
resetServerState: () => resetServerState,
|
|
536
|
+
resolveCatalogSearch: () => resolveCatalogSearch,
|
|
523
537
|
resolveCodeDiscountSource: () => resolveCodeDiscountSource,
|
|
524
538
|
resolveHydrators: () => resolveHydrators,
|
|
525
539
|
resolvePresenceFactForm: () => resolvePresenceFactForm,
|
|
@@ -529,8 +543,10 @@ __export(src_exports3, {
|
|
|
529
543
|
resolveProductVariant: () => resolveProductVariant,
|
|
530
544
|
resolveScope: () => resolveScope,
|
|
531
545
|
resolveServiceHydrators: () => resolveServiceHydrators,
|
|
546
|
+
resolveShopCheckout: () => resolveShopCheckout,
|
|
532
547
|
resolveStanding: () => resolveStanding,
|
|
533
548
|
resolveStorage: () => resolveStorage,
|
|
549
|
+
resolveStoreArticleLookup: () => resolveStoreArticleLookup,
|
|
534
550
|
resolveStoreThemeSource: () => resolveStoreThemeSource,
|
|
535
551
|
resolveSwatchColor: () => resolveSwatchColor,
|
|
536
552
|
resolveType: () => resolveType,
|
|
@@ -582,6 +598,7 @@ __export(src_exports3, {
|
|
|
582
598
|
turnAskSegments: () => turnAskSegments,
|
|
583
599
|
turnEditedBlock: () => turnEditedBlock,
|
|
584
600
|
turnOwnsView: () => turnOwnsView,
|
|
601
|
+
turnTailSlots: () => turnTailSlots,
|
|
585
602
|
useAction: () => useAction,
|
|
586
603
|
useAddToCart: () => useAddToCart,
|
|
587
604
|
useAgentDriven: () => useAgentDriven,
|
|
@@ -591,6 +608,7 @@ __export(src_exports3, {
|
|
|
591
608
|
useAgentPresenceFrame: () => useAgentPresenceFrame,
|
|
592
609
|
useAgentPresenceFresh: () => useAgentPresenceFresh,
|
|
593
610
|
useAnalyticsSink: () => useAnalyticsSink,
|
|
611
|
+
useAskAbout: () => useAskAbout,
|
|
594
612
|
useAskStore: () => useAskStore,
|
|
595
613
|
useBotCheckNotice: () => useBotCheckNotice,
|
|
596
614
|
useCanvasActions: () => useCanvasActions,
|
|
@@ -601,6 +619,7 @@ __export(src_exports3, {
|
|
|
601
619
|
useCanvasLeadTarget: () => useCanvasLeadTarget,
|
|
602
620
|
useCanvasMotionStyle: () => useCanvasMotionStyle,
|
|
603
621
|
useCanvasTail: () => useCanvasTail,
|
|
622
|
+
useCanvasTurnTail: () => useCanvasTurnTail,
|
|
604
623
|
useCanvasViewBack: () => useCanvasViewBack,
|
|
605
624
|
useCart: () => useCart,
|
|
606
625
|
useCartActionFailures: () => useCartActionFailures,
|
|
@@ -639,6 +658,7 @@ __export(src_exports3, {
|
|
|
639
658
|
useDockState: () => useDockState,
|
|
640
659
|
useDocumentVisible: () => useDocumentVisible,
|
|
641
660
|
useElementId: () => useElementId,
|
|
661
|
+
useElementLayout: () => useElementLayout,
|
|
642
662
|
useExclusiveOverlay: () => useExclusiveOverlay,
|
|
643
663
|
useExplicitTurnId: () => useExplicitTurnId,
|
|
644
664
|
useExplicitTurnSelection: () => useExplicitTurnSelection,
|
|
@@ -691,6 +711,7 @@ __export(src_exports3, {
|
|
|
691
711
|
useProductDetail: () => useProductDetail,
|
|
692
712
|
useProductGridFilter: () => useProductGridFilter,
|
|
693
713
|
useProductReviews: () => useProductReviews,
|
|
714
|
+
useProductSearch: () => useProductSearch,
|
|
694
715
|
useProducts: () => useProducts,
|
|
695
716
|
useProjection: () => useProjection,
|
|
696
717
|
usePromptComposer: () => usePromptComposer,
|
|
@@ -712,8 +733,10 @@ __export(src_exports3, {
|
|
|
712
733
|
useSessionState: () => useSessionState,
|
|
713
734
|
useShellRegistry: () => useShellRegistry,
|
|
714
735
|
useShellRoot: () => useShellRoot,
|
|
736
|
+
useShopCheckout: () => useShopCheckout,
|
|
715
737
|
useSpaceLocale: () => useSpaceLocale,
|
|
716
738
|
useStandingOfType: () => useStandingOfType,
|
|
739
|
+
useStoreArticles: () => useStoreArticles,
|
|
717
740
|
useStoreCheckouts: () => useStoreCheckouts,
|
|
718
741
|
useStream: () => useStream,
|
|
719
742
|
useSuccessFlash: () => useSuccessFlash,
|
|
@@ -1526,6 +1549,7 @@ __export(src_exports, {
|
|
|
1526
1549
|
ALLOWED_ATTACHMENT_TYPES: () => ALLOWED_ATTACHMENT_TYPES,
|
|
1527
1550
|
ARRIVAL_MAX_VALUE_CHARS: () => ARRIVAL_MAX_VALUE_CHARS,
|
|
1528
1551
|
ARRIVAL_PARAMS: () => ARRIVAL_PARAMS,
|
|
1552
|
+
ATTENTION_NAMESPACE: () => ATTENTION_NAMESPACE,
|
|
1529
1553
|
AgentDirectiveSchema: () => AgentDirectiveSchema,
|
|
1530
1554
|
AgentOutputSchema: () => AgentOutputSchema,
|
|
1531
1555
|
AgentSessionSummarySchema: () => AgentSessionSummarySchema,
|
|
@@ -1533,6 +1557,7 @@ __export(src_exports, {
|
|
|
1533
1557
|
AttachmentRefSchema: () => AttachmentRefSchema,
|
|
1534
1558
|
AttachmentRefsSchema: () => AttachmentRefsSchema,
|
|
1535
1559
|
AttachmentUploadError: () => AttachmentUploadError,
|
|
1560
|
+
AttentionSchema: () => AttentionSchema,
|
|
1536
1561
|
AttributeDefSchema: () => AttributeDefSchema,
|
|
1537
1562
|
AttributeScopeBucketSchema: () => AttributeScopeBucketSchema,
|
|
1538
1563
|
AttributeScopeConfigSchema: () => AttributeScopeConfigSchema,
|
|
@@ -1612,6 +1637,7 @@ __export(src_exports, {
|
|
|
1612
1637
|
NavigatePayloadSchema: () => NavigatePayloadSchema,
|
|
1613
1638
|
OLDEST_SUPPORTED_SDK: () => OLDEST_SUPPORTED_SDK,
|
|
1614
1639
|
PAGELESS_HOST_PLACE: () => PAGELESS_HOST_PLACE,
|
|
1640
|
+
POINTING_NAMESPACE: () => POINTING_NAMESPACE,
|
|
1615
1641
|
PRESENCE_CANVAS_REFRESH_SIGNAL: () => PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
1616
1642
|
PRESENCE_FACT_DISMISS_SIGNAL: () => PRESENCE_FACT_DISMISS_SIGNAL,
|
|
1617
1643
|
PRESENCE_FLOW: () => PRESENCE_FLOW,
|
|
@@ -1622,6 +1648,7 @@ __export(src_exports, {
|
|
|
1622
1648
|
PackageReleaseSchema: () => PackageReleaseSchema,
|
|
1623
1649
|
PageSchema: () => PageSchema,
|
|
1624
1650
|
PatchSchema: () => PatchSchema,
|
|
1651
|
+
PointedAtSchema: () => PointedAtSchema,
|
|
1625
1652
|
ProjectionDirectiveSchema: () => ProjectionDirectiveSchema,
|
|
1626
1653
|
ProjectionPreferencesSchema: () => ProjectionPreferencesSchema,
|
|
1627
1654
|
ProjectionSetPayloadSchema: () => ProjectionSetPayloadSchema,
|
|
@@ -2380,27 +2407,58 @@ function chipsFromShowSignal(signal) {
|
|
|
2380
2407
|
return parsed.data.actions;
|
|
2381
2408
|
}
|
|
2382
2409
|
|
|
2383
|
-
// ../spacestation/src/signal/
|
|
2410
|
+
// ../spacestation/src/signal/visitor-view.ts
|
|
2384
2411
|
import { z as z14 } from "zod";
|
|
2412
|
+
var ATTENTION_NAMESPACE = "attention";
|
|
2413
|
+
var POINTING_NAMESPACE = "pointing";
|
|
2414
|
+
var Ref = z14.string().trim().min(1).max(200);
|
|
2415
|
+
var Label = z14.string().trim().min(1).max(160);
|
|
2416
|
+
var SeenSchema = z14.object({
|
|
2417
|
+
/** The entity's id as the agent knows it (a product id), when the thing is an entity. */
|
|
2418
|
+
ref: Ref.optional(),
|
|
2419
|
+
label: Label,
|
|
2420
|
+
/** One short fact the visitor can see on it ("$48", "sold out"). */
|
|
2421
|
+
note: z14.string().trim().max(80).optional()
|
|
2422
|
+
});
|
|
2423
|
+
var AttentionSchema = z14.object({
|
|
2424
|
+
/** On the visitor's screen now, in reading order. */
|
|
2425
|
+
onScreen: z14.array(SeenSchema).max(24),
|
|
2426
|
+
/** Where the visitor rested longest, most first. */
|
|
2427
|
+
lingered: z14.array(SeenSchema.extend({ seconds: z14.number().nonnegative() })).max(6),
|
|
2428
|
+
/** Sections the visitor has scrolled through, in order (titles the page showed). */
|
|
2429
|
+
passed: z14.array(Label).max(12)
|
|
2430
|
+
});
|
|
2431
|
+
var PointedAtSchema = z14.object({
|
|
2432
|
+
ref: Ref.optional(),
|
|
2433
|
+
/** What the element is ("Faherty linen shirt", "the page headline"). */
|
|
2434
|
+
label: Label,
|
|
2435
|
+
/** Which of its facets the visitor tapped ("price", "colour", "style", "section"). */
|
|
2436
|
+
field: z14.string().trim().min(1).max(40),
|
|
2437
|
+
/** That facet's value as shown ("$128", "Navy"). */
|
|
2438
|
+
value: z14.string().trim().max(160).optional()
|
|
2439
|
+
});
|
|
2440
|
+
|
|
2441
|
+
// ../spacestation/src/signal/turn-ask.ts
|
|
2442
|
+
import { z as z15 } from "zod";
|
|
2385
2443
|
var TURN_ASK_SIGNAL = "turn.ask";
|
|
2386
2444
|
var MIN_CHOICE_ANSWERS = 2;
|
|
2387
2445
|
var MAX_CHOICE_ANSWERS = 4;
|
|
2388
|
-
var AnswerPartSchema =
|
|
2389
|
-
var PartSchema =
|
|
2446
|
+
var AnswerPartSchema = z15.object({ answer: z15.string().trim().min(1) });
|
|
2447
|
+
var PartSchema = z15.union([z15.string(), AnswerPartSchema]);
|
|
2390
2448
|
function partsText(parts2) {
|
|
2391
2449
|
return parts2.map((p) => typeof p === "string" ? p : p.answer).join("");
|
|
2392
2450
|
}
|
|
2393
|
-
var ModelTurnAskSchema =
|
|
2394
|
-
kind:
|
|
2395
|
-
parts:
|
|
2451
|
+
var ModelTurnAskSchema = z15.object({
|
|
2452
|
+
kind: z15.enum(["choice", "open"]),
|
|
2453
|
+
parts: z15.array(PartSchema).min(1)
|
|
2396
2454
|
}).refine((ask) => partsText(ask.parts).trim().length > 0, { message: "the question reads as nothing" }).refine((ask) => /\?["'”’*)\s]*$/.test(partsText(ask.parts)), { message: "an ask is a question" }).transform((ask) => {
|
|
2397
2455
|
const answers = ask.parts.filter((p) => typeof p !== "string").length;
|
|
2398
2456
|
if (ask.kind === "choice" && answers >= MIN_CHOICE_ANSWERS && answers <= MAX_CHOICE_ANSWERS) return ask;
|
|
2399
2457
|
if (ask.kind === "open" && answers === 0) return ask;
|
|
2400
2458
|
return { kind: "open", parts: [partsText(ask.parts)] };
|
|
2401
2459
|
});
|
|
2402
|
-
var PersistedQuestionSchema =
|
|
2403
|
-
var TurnAskSchema =
|
|
2460
|
+
var PersistedQuestionSchema = z15.object({ question: z15.string().trim().min(1) }).transform((row) => ({ kind: "open", parts: [row.question.replace(/[[\]]/g, "")] }));
|
|
2461
|
+
var TurnAskSchema = z15.union([ModelTurnAskSchema, PersistedQuestionSchema]);
|
|
2404
2462
|
function turnAskSegments(ask) {
|
|
2405
2463
|
return ask.parts.map((p) => typeof p === "string" ? { kind: "text", text: p } : { kind: "answer", text: p.answer });
|
|
2406
2464
|
}
|
|
@@ -2417,15 +2475,15 @@ function turnAskFromSignal(signal) {
|
|
|
2417
2475
|
}
|
|
2418
2476
|
|
|
2419
2477
|
// ../spacestation/src/types.ts
|
|
2420
|
-
import { z as
|
|
2478
|
+
import { z as z16 } from "zod";
|
|
2421
2479
|
var PRESENCE_FACT_DISMISS_SIGNAL = "presence.fact_dismissed";
|
|
2422
2480
|
var VISITOR_NAME_SIGNAL = "visitor.name_stated";
|
|
2423
2481
|
var VISITOR_CONTEXT_SIGNAL = "visitor.context_stated";
|
|
2424
2482
|
var PRESENCE_CANVAS_REFRESH_SIGNAL = "presence.canvas_refresh";
|
|
2425
2483
|
var CLIENT_STATE_HELLO_SIGNAL = "state.hello";
|
|
2426
|
-
var StateSnapshotFrameSchema =
|
|
2427
|
-
rev:
|
|
2428
|
-
state:
|
|
2484
|
+
var StateSnapshotFrameSchema = z16.object({
|
|
2485
|
+
rev: z16.number(),
|
|
2486
|
+
state: z16.record(z16.unknown())
|
|
2429
2487
|
});
|
|
2430
2488
|
function stateSnapshotSignal(namespace) {
|
|
2431
2489
|
return `${namespace}.snapshot`;
|
|
@@ -2489,36 +2547,36 @@ function settledBlocks(sizes) {
|
|
|
2489
2547
|
}
|
|
2490
2548
|
|
|
2491
2549
|
// ../spacestation/src/catalog/structural-baseline.ts
|
|
2492
|
-
import { z as
|
|
2493
|
-
var agentTextProps =
|
|
2494
|
-
text:
|
|
2495
|
-
parts:
|
|
2496
|
-
type:
|
|
2497
|
-
value:
|
|
2550
|
+
import { z as z17 } from "zod";
|
|
2551
|
+
var agentTextProps = z17.object({
|
|
2552
|
+
text: z17.string().optional().describe("Plain prose. Used by the streaming text.delta slot binding so the agent can flow words in without choosing emphasis spans up front."),
|
|
2553
|
+
parts: z17.array(z17.object({
|
|
2554
|
+
type: z17.enum(["text", "em"]).describe("text = sans body; em = italic emphasis."),
|
|
2555
|
+
value: z17.string()
|
|
2498
2556
|
})).optional().describe("Pre-segmented prose with mixed sans + italic spans. When present, takes precedence over `text`. Use sparingly \u2014 italic carries weight, save it for the human moment in the answer."),
|
|
2499
|
-
size:
|
|
2557
|
+
size: z17.enum(["sm", "md", "lg"]).optional().describe("Visual scale. lg for hero prose at the top of a turn; md (default) for body; sm for trailing footnote prose.")
|
|
2500
2558
|
});
|
|
2501
|
-
var turnProps =
|
|
2502
|
-
prompt:
|
|
2503
|
-
index:
|
|
2504
|
-
timestamp:
|
|
2505
|
-
thinking:
|
|
2559
|
+
var turnProps = z17.object({
|
|
2560
|
+
prompt: z17.string().describe("The user's prompt for this turn, rendered as a quoted lede above the agent's response. Required so the conversation reads."),
|
|
2561
|
+
index: z17.number().optional().describe("Turn index (0-based). When omitted the runtime infers from sibling turns."),
|
|
2562
|
+
timestamp: z17.string().optional().describe("ISO timestamp for the small turn header. Omit to skip the header."),
|
|
2563
|
+
thinking: z17.string().optional().describe("Short status line shown while the response streams in. Hidden once the first block lands.")
|
|
2506
2564
|
});
|
|
2507
|
-
var backdropProps =
|
|
2508
|
-
variant:
|
|
2565
|
+
var backdropProps = z17.object({
|
|
2566
|
+
variant: z17.enum(["ridges", "sky", "video", "none"]).optional().describe(
|
|
2509
2567
|
"Background variant. `ridges` = parallax silhouettes + sky gradient. `sky` = gradient + grain + vignette only. `video` = full-bleed autoplay-loop-muted video sourced from `videoUrl`. `none` = nothing rendered."
|
|
2510
2568
|
),
|
|
2511
|
-
ridgeColor:
|
|
2512
|
-
videoUrl:
|
|
2569
|
+
ridgeColor: z17.string().optional().describe("Hex color of the ridge silhouettes. Defaults to surface fg1."),
|
|
2570
|
+
videoUrl: z17.string().optional().describe(
|
|
2513
2571
|
'Direct mp4/webm URL for the `video` variant. Loaded with preload="metadata", muted, looped, playsInline.'
|
|
2514
2572
|
),
|
|
2515
|
-
posterUrl:
|
|
2573
|
+
posterUrl: z17.string().optional().describe("Optional poster frame shown while video buffers.")
|
|
2516
2574
|
});
|
|
2517
2575
|
var STRUCTURAL_BASELINE_CATALOG = {
|
|
2518
2576
|
page: {
|
|
2519
2577
|
type: "page",
|
|
2520
2578
|
alwaysInclude: true,
|
|
2521
|
-
propsSchema:
|
|
2579
|
+
propsSchema: z17.object({}),
|
|
2522
2580
|
layout: "fullbleed",
|
|
2523
2581
|
progressLabel: "Composing the page"
|
|
2524
2582
|
},
|
|
@@ -2571,7 +2629,7 @@ var STRUCTURAL_BASELINE_CATALOG = {
|
|
|
2571
2629
|
var STRUCTURAL_BASELINE_TYPES = Object.keys(STRUCTURAL_BASELINE_CATALOG);
|
|
2572
2630
|
|
|
2573
2631
|
// ../spacestation/src/catalog/resolved.ts
|
|
2574
|
-
import { z as
|
|
2632
|
+
import { z as z18 } from "zod";
|
|
2575
2633
|
function resolved(schema, resolverKey, opts) {
|
|
2576
2634
|
const meta = { resolverKey, ...opts };
|
|
2577
2635
|
if (opts && opts.max === 1) {
|
|
@@ -2579,7 +2637,7 @@ function resolved(schema, resolverKey, opts) {
|
|
|
2579
2637
|
writeResolvedMeta(tagged, meta);
|
|
2580
2638
|
return tagged;
|
|
2581
2639
|
}
|
|
2582
|
-
const arraySchema =
|
|
2640
|
+
const arraySchema = z18.array(schema);
|
|
2583
2641
|
writeResolvedMeta(arraySchema, meta);
|
|
2584
2642
|
return arraySchema;
|
|
2585
2643
|
}
|
|
@@ -2628,7 +2686,7 @@ function walk(schema, path, out, visited) {
|
|
|
2628
2686
|
if (visited.has(schema)) return;
|
|
2629
2687
|
const meta = readResolvedMeta(schema);
|
|
2630
2688
|
if (meta !== void 0) {
|
|
2631
|
-
const entitySchema = schema instanceof
|
|
2689
|
+
const entitySchema = schema instanceof z18.ZodArray ? schema.element : schema;
|
|
2632
2690
|
out.push({ path, meta, schema: entitySchema });
|
|
2633
2691
|
return;
|
|
2634
2692
|
}
|
|
@@ -2640,18 +2698,18 @@ function walk(schema, path, out, visited) {
|
|
|
2640
2698
|
return;
|
|
2641
2699
|
}
|
|
2642
2700
|
}
|
|
2643
|
-
if (schema instanceof
|
|
2701
|
+
if (schema instanceof z18.ZodObject) {
|
|
2644
2702
|
for (const [key, child] of Object.entries(schema.shape)) {
|
|
2645
2703
|
walk(child, [...path, key], out, visited);
|
|
2646
2704
|
}
|
|
2647
2705
|
return;
|
|
2648
2706
|
}
|
|
2649
|
-
if (schema instanceof
|
|
2707
|
+
if (schema instanceof z18.ZodArray) {
|
|
2650
2708
|
const element = schema.element;
|
|
2651
2709
|
walk(element, [...path, "*"], out, visited);
|
|
2652
2710
|
return;
|
|
2653
2711
|
}
|
|
2654
|
-
if (schema instanceof
|
|
2712
|
+
if (schema instanceof z18.ZodUnion || schema instanceof z18.ZodDiscriminatedUnion) {
|
|
2655
2713
|
for (const opt of schema.options) {
|
|
2656
2714
|
walk(opt, path, out, visited);
|
|
2657
2715
|
}
|
|
@@ -2759,7 +2817,7 @@ function collectElementEntityRefs(element, catalog) {
|
|
|
2759
2817
|
}
|
|
2760
2818
|
|
|
2761
2819
|
// ../spacestation/src/catalog/prose.ts
|
|
2762
|
-
import { z as
|
|
2820
|
+
import { z as z19 } from "zod";
|
|
2763
2821
|
function prose(schema) {
|
|
2764
2822
|
const tagged = cloneSchema2(schema);
|
|
2765
2823
|
writeProseMeta(tagged);
|
|
@@ -2800,17 +2858,17 @@ function walk2(schema, path, when, out, visited) {
|
|
|
2800
2858
|
walk2(def.innerType, path, when, out, visited);
|
|
2801
2859
|
return;
|
|
2802
2860
|
}
|
|
2803
|
-
if (schema instanceof
|
|
2861
|
+
if (schema instanceof z19.ZodObject) {
|
|
2804
2862
|
for (const [key, child] of Object.entries(schema.shape)) {
|
|
2805
2863
|
walk2(child, [...path, key], when, out, visited);
|
|
2806
2864
|
}
|
|
2807
2865
|
return;
|
|
2808
2866
|
}
|
|
2809
|
-
if (schema instanceof
|
|
2867
|
+
if (schema instanceof z19.ZodArray) {
|
|
2810
2868
|
walk2(schema.element, [...path, "*"], when, out, visited);
|
|
2811
2869
|
return;
|
|
2812
2870
|
}
|
|
2813
|
-
if (schema instanceof
|
|
2871
|
+
if (schema instanceof z19.ZodDiscriminatedUnion) {
|
|
2814
2872
|
const key = schema.discriminator;
|
|
2815
2873
|
for (const opt of schema.options) {
|
|
2816
2874
|
const value = discriminatorValue(opt, key);
|
|
@@ -2819,7 +2877,7 @@ function walk2(schema, path, when, out, visited) {
|
|
|
2819
2877
|
}
|
|
2820
2878
|
return;
|
|
2821
2879
|
}
|
|
2822
|
-
if (schema instanceof
|
|
2880
|
+
if (schema instanceof z19.ZodUnion) {
|
|
2823
2881
|
for (const opt of schema.options) {
|
|
2824
2882
|
walk2(opt, path, when, out, visited);
|
|
2825
2883
|
}
|
|
@@ -2827,15 +2885,15 @@ function walk2(schema, path, when, out, visited) {
|
|
|
2827
2885
|
}
|
|
2828
2886
|
}
|
|
2829
2887
|
function discriminatorValue(option, key) {
|
|
2830
|
-
if (!(option instanceof
|
|
2888
|
+
if (!(option instanceof z19.ZodObject)) return void 0;
|
|
2831
2889
|
const field = option.shape[key];
|
|
2832
|
-
if (!(field instanceof
|
|
2890
|
+
if (!(field instanceof z19.ZodLiteral)) return void 0;
|
|
2833
2891
|
const value = field.value;
|
|
2834
2892
|
return typeof value === "string" ? value : void 0;
|
|
2835
2893
|
}
|
|
2836
2894
|
|
|
2837
2895
|
// ../spacestation/src/catalog/required-props.ts
|
|
2838
|
-
import { z as
|
|
2896
|
+
import { z as z20 } from "zod";
|
|
2839
2897
|
function requiredTopLevelProps(schema) {
|
|
2840
2898
|
const obj = unwrapToObject(schema);
|
|
2841
2899
|
if (obj === void 0) return [];
|
|
@@ -2855,7 +2913,7 @@ function isEmptyPropValue(value) {
|
|
|
2855
2913
|
return false;
|
|
2856
2914
|
}
|
|
2857
2915
|
function isOptionalSchema(schema) {
|
|
2858
|
-
return schema instanceof
|
|
2916
|
+
return schema instanceof z20.ZodOptional || schema instanceof z20.ZodDefault || schema instanceof z20.ZodNullable;
|
|
2859
2917
|
}
|
|
2860
2918
|
function isOptionalTopLevelProp(schema, prop) {
|
|
2861
2919
|
const obj = unwrapToObject(schema);
|
|
@@ -2864,12 +2922,12 @@ function isOptionalTopLevelProp(schema, prop) {
|
|
|
2864
2922
|
return child !== void 0 && isOptionalSchema(child);
|
|
2865
2923
|
}
|
|
2866
2924
|
function unwrapToObject(schema) {
|
|
2867
|
-
if (schema instanceof
|
|
2925
|
+
if (schema instanceof z20.ZodObject) return schema;
|
|
2868
2926
|
return void 0;
|
|
2869
2927
|
}
|
|
2870
2928
|
|
|
2871
2929
|
// ../spacestation/src/catalog/function-props.ts
|
|
2872
|
-
import { z as
|
|
2930
|
+
import { z as z21 } from "zod";
|
|
2873
2931
|
function findFunctionPropPaths(schema) {
|
|
2874
2932
|
if (schema === void 0) return [];
|
|
2875
2933
|
const found = [];
|
|
@@ -2879,74 +2937,74 @@ function findFunctionPropPaths(schema) {
|
|
|
2879
2937
|
function walk3(schema, path, found, visited) {
|
|
2880
2938
|
if (visited.has(schema)) return;
|
|
2881
2939
|
visited.add(schema);
|
|
2882
|
-
if (schema instanceof
|
|
2940
|
+
if (schema instanceof z21.ZodFunction) {
|
|
2883
2941
|
found.push(path === "" ? "(root)" : path);
|
|
2884
2942
|
return;
|
|
2885
2943
|
}
|
|
2886
|
-
if (schema instanceof
|
|
2944
|
+
if (schema instanceof z21.ZodObject) {
|
|
2887
2945
|
for (const [key, child] of Object.entries(schema.shape)) {
|
|
2888
|
-
if (child instanceof
|
|
2946
|
+
if (child instanceof z21.ZodType) {
|
|
2889
2947
|
walk3(child, path === "" ? key : `${path}.${key}`, found, visited);
|
|
2890
2948
|
}
|
|
2891
2949
|
}
|
|
2892
2950
|
return;
|
|
2893
2951
|
}
|
|
2894
|
-
if (schema instanceof
|
|
2952
|
+
if (schema instanceof z21.ZodArray) {
|
|
2895
2953
|
walk3(schema.element, `${path}[]`, found, visited);
|
|
2896
2954
|
return;
|
|
2897
2955
|
}
|
|
2898
|
-
if (schema instanceof
|
|
2956
|
+
if (schema instanceof z21.ZodTuple) {
|
|
2899
2957
|
for (const [i, item] of schema.items.entries()) {
|
|
2900
|
-
if (item instanceof
|
|
2958
|
+
if (item instanceof z21.ZodType) walk3(item, `${path}[${i}]`, found, visited);
|
|
2901
2959
|
}
|
|
2902
2960
|
const rest = schema._def.rest;
|
|
2903
|
-
if (rest instanceof
|
|
2961
|
+
if (rest instanceof z21.ZodType) walk3(rest, `${path}[]`, found, visited);
|
|
2904
2962
|
return;
|
|
2905
2963
|
}
|
|
2906
|
-
if (schema instanceof
|
|
2964
|
+
if (schema instanceof z21.ZodUnion || schema instanceof z21.ZodDiscriminatedUnion) {
|
|
2907
2965
|
for (const option of schema.options) {
|
|
2908
|
-
if (option instanceof
|
|
2966
|
+
if (option instanceof z21.ZodType) walk3(option, path, found, visited);
|
|
2909
2967
|
}
|
|
2910
2968
|
return;
|
|
2911
2969
|
}
|
|
2912
|
-
if (schema instanceof
|
|
2970
|
+
if (schema instanceof z21.ZodIntersection) {
|
|
2913
2971
|
walk3(schema._def.left, path, found, visited);
|
|
2914
2972
|
walk3(schema._def.right, path, found, visited);
|
|
2915
2973
|
return;
|
|
2916
2974
|
}
|
|
2917
|
-
if (schema instanceof
|
|
2975
|
+
if (schema instanceof z21.ZodRecord) {
|
|
2918
2976
|
walk3(schema.valueSchema, `${path}{}`, found, visited);
|
|
2919
2977
|
return;
|
|
2920
2978
|
}
|
|
2921
|
-
if (schema instanceof
|
|
2979
|
+
if (schema instanceof z21.ZodMap) {
|
|
2922
2980
|
walk3(schema.valueSchema, `${path}{}`, found, visited);
|
|
2923
2981
|
return;
|
|
2924
2982
|
}
|
|
2925
|
-
if (schema instanceof
|
|
2983
|
+
if (schema instanceof z21.ZodSet) {
|
|
2926
2984
|
walk3(schema._def.valueType, `${path}[]`, found, visited);
|
|
2927
2985
|
return;
|
|
2928
2986
|
}
|
|
2929
|
-
if (schema instanceof
|
|
2987
|
+
if (schema instanceof z21.ZodOptional || schema instanceof z21.ZodNullable || schema instanceof z21.ZodBranded || schema instanceof z21.ZodReadonly || schema instanceof z21.ZodPromise) {
|
|
2930
2988
|
walk3(schema.unwrap(), path, found, visited);
|
|
2931
2989
|
return;
|
|
2932
2990
|
}
|
|
2933
|
-
if (schema instanceof
|
|
2991
|
+
if (schema instanceof z21.ZodDefault) {
|
|
2934
2992
|
walk3(schema.removeDefault(), path, found, visited);
|
|
2935
2993
|
return;
|
|
2936
2994
|
}
|
|
2937
|
-
if (schema instanceof
|
|
2995
|
+
if (schema instanceof z21.ZodCatch) {
|
|
2938
2996
|
walk3(schema.removeCatch(), path, found, visited);
|
|
2939
2997
|
return;
|
|
2940
2998
|
}
|
|
2941
|
-
if (schema instanceof
|
|
2999
|
+
if (schema instanceof z21.ZodEffects) {
|
|
2942
3000
|
walk3(schema.innerType(), path, found, visited);
|
|
2943
3001
|
return;
|
|
2944
3002
|
}
|
|
2945
|
-
if (schema instanceof
|
|
3003
|
+
if (schema instanceof z21.ZodLazy) {
|
|
2946
3004
|
walk3(schema.schema, path, found, visited);
|
|
2947
3005
|
return;
|
|
2948
3006
|
}
|
|
2949
|
-
if (schema instanceof
|
|
3007
|
+
if (schema instanceof z21.ZodPipeline) {
|
|
2950
3008
|
walk3(schema._def.in, path, found, visited);
|
|
2951
3009
|
walk3(schema._def.out, path, found, visited);
|
|
2952
3010
|
return;
|
|
@@ -3265,47 +3323,47 @@ function getDescription(schema) {
|
|
|
3265
3323
|
}
|
|
3266
3324
|
|
|
3267
3325
|
// ../spacestation/src/catalog/wire/wire-schema.ts
|
|
3268
|
-
import { z as
|
|
3326
|
+
import { z as z22 } from "zod";
|
|
3269
3327
|
var common = {
|
|
3270
|
-
description:
|
|
3271
|
-
resolved:
|
|
3272
|
-
resolverKey:
|
|
3273
|
-
min:
|
|
3274
|
-
max:
|
|
3275
|
-
renderFloor:
|
|
3276
|
-
derivedFrom:
|
|
3328
|
+
description: z22.string().optional(),
|
|
3329
|
+
resolved: z22.object({
|
|
3330
|
+
resolverKey: z22.string(),
|
|
3331
|
+
min: z22.number().optional(),
|
|
3332
|
+
max: z22.number().optional(),
|
|
3333
|
+
renderFloor: z22.number().optional(),
|
|
3334
|
+
derivedFrom: z22.string().optional()
|
|
3277
3335
|
}).strict().optional(),
|
|
3278
|
-
prose:
|
|
3336
|
+
prose: z22.literal(true).optional()
|
|
3279
3337
|
};
|
|
3280
|
-
var WireSchemaSchema =
|
|
3281
|
-
() =>
|
|
3282
|
-
|
|
3283
|
-
|
|
3338
|
+
var WireSchemaSchema = z22.lazy(
|
|
3339
|
+
() => z22.discriminatedUnion("t", [
|
|
3340
|
+
z22.object({ ...common, t: z22.literal("string"), min: z22.number().optional(), max: z22.number().optional() }).strict(),
|
|
3341
|
+
z22.object({
|
|
3284
3342
|
...common,
|
|
3285
|
-
t:
|
|
3286
|
-
int:
|
|
3287
|
-
min:
|
|
3288
|
-
minExclusive:
|
|
3289
|
-
max:
|
|
3290
|
-
maxExclusive:
|
|
3343
|
+
t: z22.literal("number"),
|
|
3344
|
+
int: z22.literal(true).optional(),
|
|
3345
|
+
min: z22.number().optional(),
|
|
3346
|
+
minExclusive: z22.literal(true).optional(),
|
|
3347
|
+
max: z22.number().optional(),
|
|
3348
|
+
maxExclusive: z22.literal(true).optional()
|
|
3291
3349
|
}).strict(),
|
|
3292
|
-
|
|
3293
|
-
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3301
|
-
|
|
3302
|
-
|
|
3303
|
-
|
|
3350
|
+
z22.object({ ...common, t: z22.literal("boolean") }).strict(),
|
|
3351
|
+
z22.object({ ...common, t: z22.literal("unknown") }).strict(),
|
|
3352
|
+
z22.object({ ...common, t: z22.literal("literal"), value: z22.union([z22.string(), z22.number(), z22.boolean()]) }).strict(),
|
|
3353
|
+
z22.object({ ...common, t: z22.literal("enum"), values: z22.array(z22.string()).min(1) }).strict(),
|
|
3354
|
+
z22.object({ ...common, t: z22.literal("array"), element: WireSchemaSchema, min: z22.number().optional(), max: z22.number().optional() }).strict(),
|
|
3355
|
+
z22.object({ ...common, t: z22.literal("object"), shape: z22.record(WireSchemaSchema), unknownKeys: z22.enum(["strip", "passthrough", "strict"]) }).strict(),
|
|
3356
|
+
z22.object({ ...common, t: z22.literal("union"), options: z22.array(WireSchemaSchema).min(2) }).strict(),
|
|
3357
|
+
z22.object({ ...common, t: z22.literal("discriminatedUnion"), discriminator: z22.string(), options: z22.array(WireSchemaSchema).min(2) }).strict(),
|
|
3358
|
+
z22.object({ ...common, t: z22.literal("record"), value: WireSchemaSchema }).strict(),
|
|
3359
|
+
z22.object({ ...common, t: z22.literal("optional"), inner: WireSchemaSchema }).strict(),
|
|
3360
|
+
z22.object({ ...common, t: z22.literal("nullable"), inner: WireSchemaSchema }).strict(),
|
|
3361
|
+
z22.object({ ...common, t: z22.literal("default"), inner: WireSchemaSchema, value: z22.unknown() }).strict()
|
|
3304
3362
|
])
|
|
3305
3363
|
);
|
|
3306
3364
|
|
|
3307
3365
|
// ../spacestation/src/catalog/wire/schema-to-wire.ts
|
|
3308
|
-
import { z as
|
|
3366
|
+
import { z as z23 } from "zod";
|
|
3309
3367
|
var UnsupportedSchemaError = class extends Error {
|
|
3310
3368
|
constructor(path, what) {
|
|
3311
3369
|
super(`Cannot publish the schema at ${path === "" ? "<root>" : path}: ${what}.`);
|
|
@@ -3343,7 +3401,7 @@ function arrayNode(schema, path) {
|
|
|
3343
3401
|
return node;
|
|
3344
3402
|
}
|
|
3345
3403
|
function objectNode(schema, path) {
|
|
3346
|
-
if (!(schema._def.catchall instanceof
|
|
3404
|
+
if (!(schema._def.catchall instanceof z23.ZodNever)) throw new UnsupportedSchemaError(path, "object .catchall() is not supported");
|
|
3347
3405
|
const shape = {};
|
|
3348
3406
|
for (const [key, child] of Object.entries(schema.shape)) shape[key] = toNode(child, path === "" ? key : `${path}.${key}`);
|
|
3349
3407
|
return { t: "object", shape, unknownKeys: schema._def.unknownKeys };
|
|
@@ -3354,19 +3412,19 @@ function literalNode(schema, path) {
|
|
|
3354
3412
|
throw new UnsupportedSchemaError(path, "only string, number and boolean literals are supported");
|
|
3355
3413
|
}
|
|
3356
3414
|
function bare(schema, path) {
|
|
3357
|
-
if (schema instanceof
|
|
3358
|
-
if (schema instanceof
|
|
3359
|
-
if (schema instanceof
|
|
3360
|
-
if (schema instanceof
|
|
3361
|
-
if (schema instanceof
|
|
3362
|
-
if (schema instanceof
|
|
3363
|
-
if (schema instanceof
|
|
3364
|
-
if (schema instanceof
|
|
3365
|
-
if (schema instanceof
|
|
3415
|
+
if (schema instanceof z23.ZodString) return stringNode(schema, path);
|
|
3416
|
+
if (schema instanceof z23.ZodNumber) return numberNode(schema, path);
|
|
3417
|
+
if (schema instanceof z23.ZodBoolean) return { t: "boolean" };
|
|
3418
|
+
if (schema instanceof z23.ZodUnknown || schema instanceof z23.ZodAny) return { t: "unknown" };
|
|
3419
|
+
if (schema instanceof z23.ZodLiteral) return literalNode(schema, path);
|
|
3420
|
+
if (schema instanceof z23.ZodEnum) return { t: "enum", values: [...schema.options] };
|
|
3421
|
+
if (schema instanceof z23.ZodArray) return arrayNode(schema, path);
|
|
3422
|
+
if (schema instanceof z23.ZodObject) return objectNode(schema, path);
|
|
3423
|
+
if (schema instanceof z23.ZodUnion) {
|
|
3366
3424
|
const options = schema.options;
|
|
3367
3425
|
return { t: "union", options: options.map((option, i) => toNode(option, `${path}|${i}`)) };
|
|
3368
3426
|
}
|
|
3369
|
-
if (schema instanceof
|
|
3427
|
+
if (schema instanceof z23.ZodDiscriminatedUnion) {
|
|
3370
3428
|
const options = schema.options;
|
|
3371
3429
|
return {
|
|
3372
3430
|
t: "discriminatedUnion",
|
|
@@ -3374,13 +3432,13 @@ function bare(schema, path) {
|
|
|
3374
3432
|
options: options.map((option, i) => toNode(option, `${path}|${i}`))
|
|
3375
3433
|
};
|
|
3376
3434
|
}
|
|
3377
|
-
if (schema instanceof
|
|
3378
|
-
if (!(schema.keySchema instanceof
|
|
3435
|
+
if (schema instanceof z23.ZodRecord) {
|
|
3436
|
+
if (!(schema.keySchema instanceof z23.ZodString)) throw new UnsupportedSchemaError(path, "only string-keyed records are supported");
|
|
3379
3437
|
return { t: "record", value: toNode(schema.valueSchema, `${path}{}`) };
|
|
3380
3438
|
}
|
|
3381
|
-
if (schema instanceof
|
|
3382
|
-
if (schema instanceof
|
|
3383
|
-
if (schema instanceof
|
|
3439
|
+
if (schema instanceof z23.ZodOptional) return { t: "optional", inner: toNode(schema.unwrap(), path) };
|
|
3440
|
+
if (schema instanceof z23.ZodNullable) return { t: "nullable", inner: toNode(schema.unwrap(), path) };
|
|
3441
|
+
if (schema instanceof z23.ZodDefault) {
|
|
3384
3442
|
return { t: "default", inner: toNode(schema._def.innerType, path), value: schema._def.defaultValue() };
|
|
3385
3443
|
}
|
|
3386
3444
|
throw new UnsupportedSchemaError(path, `${schema.constructor.name} is not supported`);
|
|
@@ -3398,35 +3456,35 @@ function schemaToWire(schema) {
|
|
|
3398
3456
|
}
|
|
3399
3457
|
|
|
3400
3458
|
// ../spacestation/src/catalog/wire/schema-from-wire.ts
|
|
3401
|
-
import { z as
|
|
3459
|
+
import { z as z24 } from "zod";
|
|
3402
3460
|
function bare2(node) {
|
|
3403
3461
|
switch (node.t) {
|
|
3404
3462
|
case "string": {
|
|
3405
|
-
let schema =
|
|
3463
|
+
let schema = z24.string();
|
|
3406
3464
|
if (node.min !== void 0) schema = schema.min(node.min);
|
|
3407
3465
|
if (node.max !== void 0) schema = schema.max(node.max);
|
|
3408
3466
|
return schema;
|
|
3409
3467
|
}
|
|
3410
3468
|
case "number": {
|
|
3411
|
-
let schema =
|
|
3469
|
+
let schema = z24.number();
|
|
3412
3470
|
if (node.int === true) schema = schema.int();
|
|
3413
3471
|
if (node.min !== void 0) schema = node.minExclusive === true ? schema.gt(node.min) : schema.gte(node.min);
|
|
3414
3472
|
if (node.max !== void 0) schema = node.maxExclusive === true ? schema.lt(node.max) : schema.lte(node.max);
|
|
3415
3473
|
return schema;
|
|
3416
3474
|
}
|
|
3417
3475
|
case "boolean":
|
|
3418
|
-
return
|
|
3476
|
+
return z24.boolean();
|
|
3419
3477
|
case "unknown":
|
|
3420
|
-
return
|
|
3478
|
+
return z24.unknown();
|
|
3421
3479
|
case "literal":
|
|
3422
|
-
return
|
|
3480
|
+
return z24.literal(node.value);
|
|
3423
3481
|
case "enum": {
|
|
3424
3482
|
const [first, ...rest] = node.values;
|
|
3425
3483
|
if (first === void 0) throw new Error("A wire enum needs at least one value.");
|
|
3426
|
-
return
|
|
3484
|
+
return z24.enum([first, ...rest]);
|
|
3427
3485
|
}
|
|
3428
3486
|
case "array": {
|
|
3429
|
-
let schema =
|
|
3487
|
+
let schema = z24.array(schemaFromWire(node.element));
|
|
3430
3488
|
if (node.min !== void 0) schema = schema.min(node.min);
|
|
3431
3489
|
if (node.max !== void 0) schema = schema.max(node.max);
|
|
3432
3490
|
return schema;
|
|
@@ -3434,7 +3492,7 @@ function bare2(node) {
|
|
|
3434
3492
|
case "object": {
|
|
3435
3493
|
const shape = {};
|
|
3436
3494
|
for (const [key, child] of Object.entries(node.shape)) shape[key] = schemaFromWire(child);
|
|
3437
|
-
const schema =
|
|
3495
|
+
const schema = z24.object(shape);
|
|
3438
3496
|
if (node.unknownKeys === "passthrough") return schema.passthrough();
|
|
3439
3497
|
if (node.unknownKeys === "strict") return schema.strict();
|
|
3440
3498
|
return schema;
|
|
@@ -3442,30 +3500,30 @@ function bare2(node) {
|
|
|
3442
3500
|
case "union": {
|
|
3443
3501
|
const [first, second, ...rest] = node.options.map(schemaFromWire);
|
|
3444
3502
|
if (first === void 0 || second === void 0) throw new Error("A wire union needs at least two options.");
|
|
3445
|
-
return
|
|
3503
|
+
return z24.union([first, second, ...rest]);
|
|
3446
3504
|
}
|
|
3447
3505
|
case "discriminatedUnion": {
|
|
3448
3506
|
const options = node.options.map(schemaFromWire);
|
|
3449
3507
|
const objects = [];
|
|
3450
3508
|
for (const option of options) {
|
|
3451
|
-
if (!(option instanceof
|
|
3509
|
+
if (!(option instanceof z24.ZodObject)) throw new Error("Every option of a wire discriminated union must be an object.");
|
|
3452
3510
|
objects.push(option);
|
|
3453
3511
|
}
|
|
3454
3512
|
const [first, second, ...rest] = objects;
|
|
3455
3513
|
if (first === void 0 || second === void 0) throw new Error("A wire discriminated union needs at least two options.");
|
|
3456
|
-
return
|
|
3514
|
+
return z24.discriminatedUnion(node.discriminator, [first, second, ...rest]);
|
|
3457
3515
|
}
|
|
3458
3516
|
case "record":
|
|
3459
|
-
return
|
|
3517
|
+
return z24.record(schemaFromWire(node.value));
|
|
3460
3518
|
// The static constructors, not the fluent `.optional()` / `.default()`:
|
|
3461
3519
|
// those copy the inner schema's description onto the wrapper, which would
|
|
3462
3520
|
// invent a description the original wrapper did not carry.
|
|
3463
3521
|
case "optional":
|
|
3464
|
-
return
|
|
3522
|
+
return z24.optional(schemaFromWire(node.inner));
|
|
3465
3523
|
case "nullable":
|
|
3466
|
-
return
|
|
3524
|
+
return z24.nullable(schemaFromWire(node.inner));
|
|
3467
3525
|
case "default":
|
|
3468
|
-
return
|
|
3526
|
+
return z24.ZodDefault.create(schemaFromWire(node.inner), { default: node.value });
|
|
3469
3527
|
}
|
|
3470
3528
|
}
|
|
3471
3529
|
function schemaFromWire(node) {
|
|
@@ -3476,38 +3534,38 @@ function schemaFromWire(node) {
|
|
|
3476
3534
|
}
|
|
3477
3535
|
|
|
3478
3536
|
// ../spacestation/src/catalog/wire/catalog-wire.ts
|
|
3479
|
-
import { z as
|
|
3480
|
-
var WireCatalogEntrySchema =
|
|
3481
|
-
type:
|
|
3537
|
+
import { z as z25 } from "zod";
|
|
3538
|
+
var WireCatalogEntrySchema = z25.object({
|
|
3539
|
+
type: z25.string().min(1),
|
|
3482
3540
|
propsSchema: WireSchemaSchema.optional(),
|
|
3483
|
-
examples:
|
|
3484
|
-
renderedBy:
|
|
3485
|
-
alwaysInclude:
|
|
3486
|
-
asks:
|
|
3487
|
-
whenToUse:
|
|
3488
|
-
dontUseWhen:
|
|
3489
|
-
variants:
|
|
3490
|
-
dependencies:
|
|
3491
|
-
layout:
|
|
3492
|
-
size:
|
|
3493
|
-
extendsPage:
|
|
3494
|
-
bindings:
|
|
3495
|
-
|
|
3496
|
-
source:
|
|
3497
|
-
prop:
|
|
3498
|
-
accumulate:
|
|
3499
|
-
mountAt:
|
|
3541
|
+
examples: z25.array(z25.record(z25.unknown())).optional(),
|
|
3542
|
+
renderedBy: z25.string().optional(),
|
|
3543
|
+
alwaysInclude: z25.boolean().optional(),
|
|
3544
|
+
asks: z25.boolean().optional(),
|
|
3545
|
+
whenToUse: z25.string().optional(),
|
|
3546
|
+
dontUseWhen: z25.string().optional(),
|
|
3547
|
+
variants: z25.string().optional(),
|
|
3548
|
+
dependencies: z25.string().optional(),
|
|
3549
|
+
layout: z25.enum(["section", "fullbleed"]).optional(),
|
|
3550
|
+
size: z25.enum(CANVAS_BLOCK_SIZES).optional(),
|
|
3551
|
+
extendsPage: z25.boolean().optional(),
|
|
3552
|
+
bindings: z25.array(
|
|
3553
|
+
z25.object({
|
|
3554
|
+
source: z25.string(),
|
|
3555
|
+
prop: z25.string(),
|
|
3556
|
+
accumulate: z25.enum(["replace", "append", "concat-text"]).optional(),
|
|
3557
|
+
mountAt: z25.string().optional()
|
|
3500
3558
|
})
|
|
3501
3559
|
).optional(),
|
|
3502
|
-
defaultLayoutWeight:
|
|
3503
|
-
defaultMaxHeight:
|
|
3504
|
-
category:
|
|
3505
|
-
progressLabel:
|
|
3506
|
-
isExperience:
|
|
3507
|
-
requires:
|
|
3508
|
-
provides:
|
|
3560
|
+
defaultLayoutWeight: z25.number().optional(),
|
|
3561
|
+
defaultMaxHeight: z25.enum(["sm", "md", "lg", "full"]).optional(),
|
|
3562
|
+
category: z25.string().optional(),
|
|
3563
|
+
progressLabel: z25.string().optional(),
|
|
3564
|
+
isExperience: z25.boolean().optional(),
|
|
3565
|
+
requires: z25.array(z25.string()).optional(),
|
|
3566
|
+
provides: z25.array(z25.string()).optional()
|
|
3509
3567
|
}).strict();
|
|
3510
|
-
var WireCatalogSchema =
|
|
3568
|
+
var WireCatalogSchema = z25.record(WireCatalogEntrySchema);
|
|
3511
3569
|
function propsToWire(type, schema) {
|
|
3512
3570
|
try {
|
|
3513
3571
|
return schemaToWire(schema);
|
|
@@ -3532,7 +3590,7 @@ function catalogFromWire(wire) {
|
|
|
3532
3590
|
continue;
|
|
3533
3591
|
}
|
|
3534
3592
|
const rebuilt = schemaFromWire(propsSchema);
|
|
3535
|
-
if (!(rebuilt instanceof
|
|
3593
|
+
if (!(rebuilt instanceof z25.ZodObject)) throw new Error(`Catalog type "${type}": propsSchema must be an object schema.`);
|
|
3536
3594
|
const built = { ...data, propsSchema: rebuilt };
|
|
3537
3595
|
out[type] = built;
|
|
3538
3596
|
}
|
|
@@ -3540,31 +3598,31 @@ function catalogFromWire(wire) {
|
|
|
3540
3598
|
}
|
|
3541
3599
|
|
|
3542
3600
|
// ../spacestation/src/catalog/wire/package-release.ts
|
|
3543
|
-
import { z as
|
|
3601
|
+
import { z as z29 } from "zod";
|
|
3544
3602
|
|
|
3545
3603
|
// ../spacestation/src/catalog/wire/brand-mark.ts
|
|
3546
|
-
import { z as
|
|
3604
|
+
import { z as z26 } from "zod";
|
|
3547
3605
|
var BRAND_MARK_TYPES = ["svg", "png"];
|
|
3548
3606
|
var BRAND_MARK_MAX_BYTES = 256 * 1024;
|
|
3549
3607
|
var MAX_BASE64_LENGTH = Math.ceil(BRAND_MARK_MAX_BYTES / 3) * 4;
|
|
3550
|
-
var BrandMarkUploadSchema =
|
|
3551
|
-
type:
|
|
3552
|
-
data:
|
|
3608
|
+
var BrandMarkUploadSchema = z26.object({
|
|
3609
|
+
type: z26.enum(BRAND_MARK_TYPES),
|
|
3610
|
+
data: z26.string().base64().min(1).max(MAX_BASE64_LENGTH, `a mark file is at most ${BRAND_MARK_MAX_BYTES / 1024} KB`)
|
|
3553
3611
|
}).strict();
|
|
3554
|
-
var BrandMarkStoredSchema =
|
|
3555
|
-
type:
|
|
3556
|
-
sha256:
|
|
3612
|
+
var BrandMarkStoredSchema = z26.object({
|
|
3613
|
+
type: z26.enum(BRAND_MARK_TYPES),
|
|
3614
|
+
sha256: z26.string().regex(/^[0-9a-f]{64}$/, "a stored mark is named by its sha256")
|
|
3557
3615
|
}).strict();
|
|
3558
|
-
var BrandMarkFileSchema =
|
|
3616
|
+
var BrandMarkFileSchema = z26.union([BrandMarkUploadSchema, BrandMarkStoredSchema]);
|
|
3559
3617
|
var BRAND_MARK_SLOTS = ["square", "wordmark"];
|
|
3560
|
-
var BrandMarkSchema =
|
|
3561
|
-
var BrandMarkImageSchema =
|
|
3562
|
-
var SpaceBrandMarkSchema =
|
|
3618
|
+
var BrandMarkSchema = z26.object({ square: BrandMarkFileSchema.optional(), wordmark: BrandMarkFileSchema.optional() }).strict().refine((mark) => mark.square !== void 0 || mark.wordmark !== void 0, "a mark names a square, a wordmark, or both");
|
|
3619
|
+
var BrandMarkImageSchema = z26.object({ src: z26.string().min(1), type: z26.enum(BRAND_MARK_TYPES) }).strict();
|
|
3620
|
+
var SpaceBrandMarkSchema = z26.object({ square: BrandMarkImageSchema.nullable(), wordmark: BrandMarkImageSchema.nullable() }).strict();
|
|
3563
3621
|
|
|
3564
3622
|
// ../spacestation/src/catalog/wire/sdk-compat.ts
|
|
3565
|
-
import { z as
|
|
3623
|
+
import { z as z27 } from "zod";
|
|
3566
3624
|
var SDK_VERSION_PATTERN = /^\d{1,4}\.\d{1,4}\.\d{1,4}(-[0-9A-Za-z.]{1,32})?$/;
|
|
3567
|
-
var SdkVersionSchema =
|
|
3625
|
+
var SdkVersionSchema = z27.string().regex(SDK_VERSION_PATTERN, "an sdk version is major.minor.patch");
|
|
3568
3626
|
var OLDEST_SUPPORTED_SDK = "0.3.0";
|
|
3569
3627
|
var SDK_SHIMS = {
|
|
3570
3628
|
/** sdk ≤ 0.3 called the vertical verbs on `useCanvasActions()` — `legacy-canvas-actions.ts`. */
|
|
@@ -3610,10 +3668,10 @@ function sdkWindowProblem(builtWithSdk, platformSdk) {
|
|
|
3610
3668
|
}
|
|
3611
3669
|
|
|
3612
3670
|
// ../spacestation/src/catalog/wire/host-imports.ts
|
|
3613
|
-
import { z as
|
|
3614
|
-
var SpecifierSchema =
|
|
3615
|
-
var HostImportsSchema =
|
|
3616
|
-
var HostExportsSchema =
|
|
3671
|
+
import { z as z28 } from "zod";
|
|
3672
|
+
var SpecifierSchema = z28.string().min(1).max(200);
|
|
3673
|
+
var HostImportsSchema = z28.record(SpecifierSchema, z28.array(z28.string().min(1).max(200)).max(5e3));
|
|
3674
|
+
var HostExportsSchema = z28.record(SpecifierSchema, z28.array(z28.string()));
|
|
3617
3675
|
function hostImportProblems(imports, provided) {
|
|
3618
3676
|
const problems = [];
|
|
3619
3677
|
for (const [specifier, names] of Object.entries(imports)) {
|
|
@@ -3636,15 +3694,15 @@ function hostImportsRefusal(commit) {
|
|
|
3636
3694
|
var RESERVED_SCOPES = ["@fourty/", "@40rty/"];
|
|
3637
3695
|
var BUNDLE_ASSET_PATH = /^assets\/[A-Za-z0-9_-]+\.(woff2?|ttf|otf|png|jpe?g|svg|gif|webp)$/;
|
|
3638
3696
|
var RELEASE_MESSAGE_MAX = 140;
|
|
3639
|
-
var ReleaseMessageSchema =
|
|
3640
|
-
var PackageReleaseSchema =
|
|
3697
|
+
var ReleaseMessageSchema = z29.string().trim().min(1, "say what this release changes").max(RELEASE_MESSAGE_MAX, `keep the message to one line of ${RELEASE_MESSAGE_MAX} characters or fewer`);
|
|
3698
|
+
var PackageReleaseSchema = z29.object({
|
|
3641
3699
|
/** The id spaces name in `componentSources` — an npm-style package name. */
|
|
3642
|
-
sourceId:
|
|
3643
|
-
label:
|
|
3700
|
+
sourceId: z29.string().regex(/^(@[a-z0-9][a-z0-9-]*\/)?[a-z0-9][a-z0-9-]*$/, "sourceId must be an npm-style package name").refine((id) => !RESERVED_SCOPES.some((scope2) => id.startsWith(scope2)), `the ${RESERVED_SCOPES.join(" and ")} scopes are reserved`),
|
|
3701
|
+
label: z29.string().min(1).max(120),
|
|
3644
3702
|
/** The package's own version, as its repository states it — shown in the console. */
|
|
3645
|
-
version:
|
|
3703
|
+
version: z29.string().min(1).max(40),
|
|
3646
3704
|
/** What this release changed, in the publisher's words (`forty publish --message`) — shown in the console's version list. */
|
|
3647
|
-
description:
|
|
3705
|
+
description: z29.string().min(1).max(500).optional(),
|
|
3648
3706
|
/**
|
|
3649
3707
|
* The `@40rty/ams-sdk` version the brand project resolved when `forty
|
|
3650
3708
|
* publish` built this release. A bundle takes the sdk from the page at
|
|
@@ -3664,7 +3722,7 @@ var PackageReleaseSchema = z28.object({
|
|
|
3664
3722
|
hostImports: HostImportsSchema.optional(),
|
|
3665
3723
|
catalog: WireCatalogSchema,
|
|
3666
3724
|
/** Component manifests by path under `catalogs/`, e.g. `catalogs/product/productGrid.md`. */
|
|
3667
|
-
manifests:
|
|
3725
|
+
manifests: z29.record(z29.string().regex(/^catalogs\/.+\.md$/, "a manifest path is catalogs/<\u2026>.md"), z29.string()),
|
|
3668
3726
|
/**
|
|
3669
3727
|
* The brand's components, built — present when the PLATFORM hosts this
|
|
3670
3728
|
* brand's spacefront, absent when the brand hosts it in its own app. One
|
|
@@ -3673,17 +3731,17 @@ var PackageReleaseSchema = z28.object({
|
|
|
3673
3731
|
* images — base64, keyed by the path the stylesheet's `url()` names, beside
|
|
3674
3732
|
* it). It is served to browsers; the platform's servers never run it.
|
|
3675
3733
|
*/
|
|
3676
|
-
bundle:
|
|
3677
|
-
js:
|
|
3678
|
-
css:
|
|
3679
|
-
assets:
|
|
3734
|
+
bundle: z29.object({
|
|
3735
|
+
js: z29.string().min(1),
|
|
3736
|
+
css: z29.string(),
|
|
3737
|
+
assets: z29.record(z29.string().regex(BUNDLE_ASSET_PATH, "an asset is assets/<name>.<font or image extension>"), z29.string().base64()).optional()
|
|
3680
3738
|
}).strict().optional(),
|
|
3681
3739
|
/**
|
|
3682
3740
|
* The class the spacefront root carries while this package is the space's.
|
|
3683
3741
|
* The package's own stylesheet styles under it. Absent = the platform's
|
|
3684
3742
|
* default theme class.
|
|
3685
3743
|
*/
|
|
3686
|
-
theme:
|
|
3744
|
+
theme: z29.object({ themeClass: z29.string().regex(/^[a-z][a-z0-9-]*$/, "a theme class is lowercase letters, digits and hyphens") }).strict().optional(),
|
|
3687
3745
|
/**
|
|
3688
3746
|
* The brand's mark (`brand-mark.ts`). Sent as the files themselves; the
|
|
3689
3747
|
* platform stores them content-addressed at ingest and keeps only their
|
|
@@ -3696,7 +3754,7 @@ var PackageReleaseSchema = z28.object({
|
|
|
3696
3754
|
* The package's own composition guidance for its own components — prompt
|
|
3697
3755
|
* markdown the agent reads, gated on the capabilities it names (`requires`).
|
|
3698
3756
|
*/
|
|
3699
|
-
promptSections:
|
|
3757
|
+
promptSections: z29.array(z29.object({ id: z29.string().regex(/^[a-z0-9-]+$/), order: z29.number().int(), content: z29.string().min(1).max(2e4), requires: z29.array(z29.string()) }).strict()).max(10).optional(),
|
|
3700
3758
|
/**
|
|
3701
3759
|
* The brand's SPACE prompt — its `prompts/space.md`, verbatim: sections split
|
|
3702
3760
|
* by `<!-- section:<id> -->` markers, the same format as the platform's
|
|
@@ -3704,17 +3762,17 @@ var PackageReleaseSchema = z28.object({
|
|
|
3704
3762
|
* package. How the brand speaks, what it sells and what it never claims ship
|
|
3705
3763
|
* with the brand, and a release changes them with no platform deploy.
|
|
3706
3764
|
*/
|
|
3707
|
-
spacePrompt:
|
|
3765
|
+
spacePrompt: z29.string().min(1).max(2e5).optional(),
|
|
3708
3766
|
/**
|
|
3709
3767
|
* Opaque per-vertical extension data (`BrandDefinition.config`): the
|
|
3710
3768
|
* platform stays vertical-agnostic and the vertical's own code reads its keys.
|
|
3711
3769
|
*/
|
|
3712
|
-
config:
|
|
3770
|
+
config: z29.record(z29.string(), z29.unknown()).optional(),
|
|
3713
3771
|
/**
|
|
3714
3772
|
* Set by the platform, never by a publisher: this release is a DRAFT of the
|
|
3715
3773
|
* package `of`, previewed on the space `space`. See `draftSourceId`.
|
|
3716
3774
|
*/
|
|
3717
|
-
draft:
|
|
3775
|
+
draft: z29.object({ of: z29.string().min(1), space: z29.string().min(1) }).strict().optional()
|
|
3718
3776
|
}).strict();
|
|
3719
3777
|
var DRAFT_SEPARATOR = "--";
|
|
3720
3778
|
function draftSourceId(sourceId, spaceSlug, developer) {
|
|
@@ -3733,49 +3791,49 @@ function parseReleasePreview(id) {
|
|
|
3733
3791
|
}
|
|
3734
3792
|
|
|
3735
3793
|
// ../spacestation/src/catalog/wire/package-bundle-ref.ts
|
|
3736
|
-
import { z as
|
|
3737
|
-
var PackageBundleRefSchema =
|
|
3738
|
-
sourceId:
|
|
3739
|
-
js:
|
|
3740
|
-
css:
|
|
3794
|
+
import { z as z30 } from "zod";
|
|
3795
|
+
var PackageBundleRefSchema = z30.object({
|
|
3796
|
+
sourceId: z30.string(),
|
|
3797
|
+
js: z30.string(),
|
|
3798
|
+
css: z30.string(),
|
|
3741
3799
|
/** The brand's name for itself, and its package's version. */
|
|
3742
|
-
label:
|
|
3743
|
-
version:
|
|
3800
|
+
label: z30.string(),
|
|
3801
|
+
version: z30.string(),
|
|
3744
3802
|
/** The sdk the bundle was built against (`PackageRelease.builtWithSdk`) — absent for a legacy release. Picks its compat shims. */
|
|
3745
3803
|
builtWithSdk: SdkVersionSchema.optional()
|
|
3746
3804
|
});
|
|
3747
3805
|
|
|
3748
3806
|
// ../spacestation/src/projection/projection.ts
|
|
3749
|
-
import { z as
|
|
3750
|
-
var LateBoundValueSchema =
|
|
3751
|
-
var DirectiveValueSchema =
|
|
3752
|
-
|
|
3753
|
-
|
|
3754
|
-
|
|
3807
|
+
import { z as z31 } from "zod";
|
|
3808
|
+
var LateBoundValueSchema = z31.object({ fact: z31.literal(true) });
|
|
3809
|
+
var DirectiveValueSchema = z31.union([
|
|
3810
|
+
z31.string(),
|
|
3811
|
+
z31.number(),
|
|
3812
|
+
z31.boolean(),
|
|
3755
3813
|
LateBoundValueSchema
|
|
3756
3814
|
]);
|
|
3757
3815
|
function isLateBound(v) {
|
|
3758
3816
|
return typeof v === "object" && v !== null && "fact" in v;
|
|
3759
3817
|
}
|
|
3760
|
-
var ProjectionDirectiveSchema =
|
|
3818
|
+
var ProjectionDirectiveSchema = z31.object({
|
|
3761
3819
|
/** Keep only items whose axis values all match. Keyed by axis name
|
|
3762
3820
|
* (e.g. `Size`); value is a literal or the `{fact:true}` marker. */
|
|
3763
|
-
isolateTo:
|
|
3821
|
+
isolateTo: z31.record(DirectiveValueSchema).optional(),
|
|
3764
3822
|
/** Isolate to EVERY axis the visitor has a stored fact for. The agent
|
|
3765
3823
|
* emits this (it is vertical-agnostic — it cannot name axes); the
|
|
3766
3824
|
* entity binding expands it against the entity's own axes + facts. */
|
|
3767
|
-
isolateToFacts:
|
|
3825
|
+
isolateToFacts: z31.boolean().optional(),
|
|
3768
3826
|
/** Keep only items the entity binding reports as available. */
|
|
3769
|
-
availableOnly:
|
|
3827
|
+
availableOnly: z31.boolean().optional(),
|
|
3770
3828
|
/** Cap the rendered count after filtering. */
|
|
3771
|
-
limit:
|
|
3829
|
+
limit: z31.number().int().positive().optional()
|
|
3772
3830
|
});
|
|
3773
|
-
var ProjectionPreferencesSchema =
|
|
3774
|
-
|
|
3831
|
+
var ProjectionPreferencesSchema = z31.record(
|
|
3832
|
+
z31.union([ProjectionDirectiveSchema, z31.null()])
|
|
3775
3833
|
);
|
|
3776
3834
|
var PROJECTION_SET_SIGNAL = "projection.set";
|
|
3777
|
-
var ProjectionSetPayloadSchema =
|
|
3778
|
-
setAll:
|
|
3835
|
+
var ProjectionSetPayloadSchema = z31.object({
|
|
3836
|
+
setAll: z31.union([ProjectionDirectiveSchema, z31.null()]).optional(),
|
|
3779
3837
|
set: ProjectionPreferencesSchema.optional()
|
|
3780
3838
|
});
|
|
3781
3839
|
function norm(v) {
|
|
@@ -3809,14 +3867,14 @@ function isActiveDirective(directive) {
|
|
|
3809
3867
|
}
|
|
3810
3868
|
|
|
3811
3869
|
// ../spacestation/src/host/host-page.ts
|
|
3812
|
-
import { z as
|
|
3870
|
+
import { z as z32 } from "zod";
|
|
3813
3871
|
var VIEW_HOST_SIGNAL = "view.host";
|
|
3814
|
-
var HostPayloadSchema =
|
|
3872
|
+
var HostPayloadSchema = z32.object({
|
|
3815
3873
|
page: PageSchema.nullable(),
|
|
3816
|
-
maxSections:
|
|
3817
|
-
surface:
|
|
3874
|
+
maxSections: z32.number().int().positive().nullable(),
|
|
3875
|
+
surface: z32.enum(["page", "slot"])
|
|
3818
3876
|
});
|
|
3819
|
-
var HostClearedSchema =
|
|
3877
|
+
var HostClearedSchema = z32.object({ cleared: z32.literal(true) });
|
|
3820
3878
|
var HOST_CLEARED = { cleared: true };
|
|
3821
3879
|
function hostFillsPage(host) {
|
|
3822
3880
|
return host.surface === "page";
|
|
@@ -3830,23 +3888,23 @@ function pagePlace(page) {
|
|
|
3830
3888
|
}
|
|
3831
3889
|
|
|
3832
3890
|
// ../spacestation/src/focus/focus.ts
|
|
3833
|
-
import { z as
|
|
3891
|
+
import { z as z33 } from "zod";
|
|
3834
3892
|
var VIEW_FOCUS_ELEMENT_SIGNAL = "view.focus.element";
|
|
3835
|
-
var FocusElementPayloadSchema =
|
|
3836
|
-
elementId:
|
|
3893
|
+
var FocusElementPayloadSchema = z33.object({
|
|
3894
|
+
elementId: z33.string().min(1)
|
|
3837
3895
|
});
|
|
3838
3896
|
|
|
3839
3897
|
// ../spacestation/src/view/continuation.ts
|
|
3840
|
-
import { z as
|
|
3898
|
+
import { z as z34 } from "zod";
|
|
3841
3899
|
var VIEW_EXTEND_SIGNAL = "view.extend";
|
|
3842
|
-
var ViewExtendPayloadSchema =
|
|
3843
|
-
reason:
|
|
3900
|
+
var ViewExtendPayloadSchema = z34.object({
|
|
3901
|
+
reason: z34.enum(["scroll_near_bottom"])
|
|
3844
3902
|
});
|
|
3845
3903
|
var VIEW_EXHAUSTED_SIGNAL = "view.exhausted";
|
|
3846
3904
|
var CONTINUATION_ENABLED = false;
|
|
3847
3905
|
|
|
3848
3906
|
// ../spacestation/src/attachment/attachment.ts
|
|
3849
|
-
import { z as
|
|
3907
|
+
import { z as z35 } from "zod";
|
|
3850
3908
|
var ALLOWED_ATTACHMENT_TYPES = [
|
|
3851
3909
|
"image/jpeg",
|
|
3852
3910
|
"image/png",
|
|
@@ -3861,18 +3919,18 @@ function isAllowedAttachmentType(mime) {
|
|
|
3861
3919
|
function isImageAttachment(mime) {
|
|
3862
3920
|
return mime.startsWith("image/");
|
|
3863
3921
|
}
|
|
3864
|
-
var AttachmentRefSchema =
|
|
3922
|
+
var AttachmentRefSchema = z35.object({
|
|
3865
3923
|
// A UUID, as `storeAttachment` mints it: the id becomes a storage path segment,
|
|
3866
3924
|
// so nothing else — no `/`, no `..` — may reach that lookup.
|
|
3867
|
-
id:
|
|
3868
|
-
mimeType:
|
|
3925
|
+
id: z35.string().uuid(),
|
|
3926
|
+
mimeType: z35.string().refine(isAllowedAttachmentType, {
|
|
3869
3927
|
message: "mimeType not on the attachment allow-list"
|
|
3870
3928
|
}),
|
|
3871
|
-
name:
|
|
3872
|
-
size:
|
|
3873
|
-
url:
|
|
3929
|
+
name: z35.string().min(1),
|
|
3930
|
+
size: z35.number().int().positive().max(MAX_ATTACHMENT_BYTES),
|
|
3931
|
+
url: z35.string().min(1)
|
|
3874
3932
|
});
|
|
3875
|
-
var AttachmentRefsSchema =
|
|
3933
|
+
var AttachmentRefsSchema = z35.array(AttachmentRefSchema);
|
|
3876
3934
|
|
|
3877
3935
|
// ../spacestation/src/attachment/attachment-failure.ts
|
|
3878
3936
|
var MAX_ATTACHMENT_MB = Math.round(MAX_ATTACHMENT_BYTES / (1024 * 1024));
|
|
@@ -3891,22 +3949,22 @@ function attachmentFailureOfStatus(status, mimeType) {
|
|
|
3891
3949
|
}
|
|
3892
3950
|
|
|
3893
3951
|
// ../spacestation/src/contracts/entry-context.ts
|
|
3894
|
-
import { z as
|
|
3952
|
+
import { z as z36 } from "zod";
|
|
3895
3953
|
var ENTRY_CONTEXT_MAX_VALUE_CHARS = 200;
|
|
3896
3954
|
var ENTRY_CONTEXT_MAX_KEYS = 12;
|
|
3897
3955
|
var ENTRY_CONTEXT_MAX_NAMESPACES = 8;
|
|
3898
3956
|
var ENTRY_CONTEXT_MAX_NAME_CHARS = 64;
|
|
3899
|
-
var EntryContextValueSchema =
|
|
3900
|
-
var EntryContextNameSchema =
|
|
3901
|
-
var EntryContextNamespaceSchema =
|
|
3957
|
+
var EntryContextValueSchema = z36.string().trim().min(1).max(ENTRY_CONTEXT_MAX_VALUE_CHARS);
|
|
3958
|
+
var EntryContextNameSchema = z36.string().trim().min(1).max(ENTRY_CONTEXT_MAX_NAME_CHARS);
|
|
3959
|
+
var EntryContextNamespaceSchema = z36.record(EntryContextNameSchema, EntryContextValueSchema).refine((entries3) => Object.keys(entries3).length <= ENTRY_CONTEXT_MAX_KEYS, {
|
|
3902
3960
|
message: `at most ${ENTRY_CONTEXT_MAX_KEYS} entries per namespace`
|
|
3903
3961
|
});
|
|
3904
|
-
var EntryContextSchema =
|
|
3962
|
+
var EntryContextSchema = z36.record(EntryContextNameSchema, EntryContextNamespaceSchema).refine((namespaces) => Object.keys(namespaces).length <= ENTRY_CONTEXT_MAX_NAMESPACES, {
|
|
3905
3963
|
message: `at most ${ENTRY_CONTEXT_MAX_NAMESPACES} entry-context namespaces`
|
|
3906
3964
|
});
|
|
3907
3965
|
|
|
3908
3966
|
// ../spacestation/src/contracts/session-arrival.ts
|
|
3909
|
-
import { z as
|
|
3967
|
+
import { z as z37 } from "zod";
|
|
3910
3968
|
var SURFACES = [
|
|
3911
3969
|
"spacefront",
|
|
3912
3970
|
"embed",
|
|
@@ -3916,11 +3974,11 @@ var SURFACES = [
|
|
|
3916
3974
|
"playground",
|
|
3917
3975
|
"automation"
|
|
3918
3976
|
];
|
|
3919
|
-
var SurfaceSchema =
|
|
3977
|
+
var SurfaceSchema = z37.enum(SURFACES);
|
|
3920
3978
|
var CLICK_ID_KINDS = ["gclid", "fbclid", "msclkid", "wbraid", "gbraid"];
|
|
3921
|
-
var ClickIdKindSchema =
|
|
3979
|
+
var ClickIdKindSchema = z37.enum(CLICK_ID_KINDS);
|
|
3922
3980
|
var VISITOR_ID_DURABILITIES = ["persisted", "ephemeral", "host_supplied"];
|
|
3923
|
-
var VisitorIdDurabilitySchema =
|
|
3981
|
+
var VisitorIdDurabilitySchema = z37.enum(VISITOR_ID_DURABILITIES);
|
|
3924
3982
|
var TRAFFIC_BUCKETS = [
|
|
3925
3983
|
"paid_google",
|
|
3926
3984
|
"paid_meta",
|
|
@@ -3932,10 +3990,10 @@ var TRAFFIC_BUCKETS = [
|
|
|
3932
3990
|
"direct",
|
|
3933
3991
|
"unknown"
|
|
3934
3992
|
];
|
|
3935
|
-
var TrafficBucketSchema =
|
|
3993
|
+
var TrafficBucketSchema = z37.enum(TRAFFIC_BUCKETS);
|
|
3936
3994
|
var ARRIVAL_MAX_VALUE_CHARS = 200;
|
|
3937
|
-
var ArrivalValueSchema =
|
|
3938
|
-
var SessionArrivalSchema =
|
|
3995
|
+
var ArrivalValueSchema = z37.string().trim().min(1).max(ARRIVAL_MAX_VALUE_CHARS);
|
|
3996
|
+
var SessionArrivalSchema = z37.object({
|
|
3939
3997
|
utmSource: ArrivalValueSchema.optional(),
|
|
3940
3998
|
utmMedium: ArrivalValueSchema.optional(),
|
|
3941
3999
|
utmCampaign: ArrivalValueSchema.optional(),
|
|
@@ -4050,36 +4108,36 @@ var WIRE_PROTOCOL_PARAM = "protocol";
|
|
|
4050
4108
|
var WIRE_PROTOCOL_UNSUPPORTED_CLOSE = 4426;
|
|
4051
4109
|
|
|
4052
4110
|
// ../spacestation/src/catalog/attribute-registry.ts
|
|
4053
|
-
import { z as
|
|
4054
|
-
var AttributeScopeBucketSchema =
|
|
4055
|
-
scope:
|
|
4056
|
-
needles:
|
|
4057
|
-
label:
|
|
4111
|
+
import { z as z38 } from "zod";
|
|
4112
|
+
var AttributeScopeBucketSchema = z38.object({
|
|
4113
|
+
scope: z38.string(),
|
|
4114
|
+
needles: z38.array(z38.string()).readonly(),
|
|
4115
|
+
label: z38.string().optional()
|
|
4058
4116
|
});
|
|
4059
|
-
var AttributeScopeConfigSchema =
|
|
4060
|
-
facet:
|
|
4061
|
-
buckets:
|
|
4062
|
-
emptyScope:
|
|
4063
|
-
noMatchScope:
|
|
4064
|
-
ignoreValues:
|
|
4065
|
-
emptyScopeLabel:
|
|
4066
|
-
noMatchScopeLabel:
|
|
4117
|
+
var AttributeScopeConfigSchema = z38.object({
|
|
4118
|
+
facet: z38.string(),
|
|
4119
|
+
buckets: z38.array(AttributeScopeBucketSchema).readonly(),
|
|
4120
|
+
emptyScope: z38.string(),
|
|
4121
|
+
noMatchScope: z38.string(),
|
|
4122
|
+
ignoreValues: z38.array(z38.string()).readonly(),
|
|
4123
|
+
emptyScopeLabel: z38.string().optional(),
|
|
4124
|
+
noMatchScopeLabel: z38.string().optional()
|
|
4067
4125
|
});
|
|
4068
|
-
var AttributeDefBaseSchema =
|
|
4069
|
-
description:
|
|
4070
|
-
durable:
|
|
4071
|
-
label:
|
|
4126
|
+
var AttributeDefBaseSchema = z38.object({
|
|
4127
|
+
description: z38.string().optional(),
|
|
4128
|
+
durable: z38.boolean().optional(),
|
|
4129
|
+
label: z38.string().optional()
|
|
4072
4130
|
});
|
|
4073
|
-
var AttributeDefSchema =
|
|
4074
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
4075
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
4076
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
4077
|
-
AttributeDefBaseSchema.extend({ kind:
|
|
4131
|
+
var AttributeDefSchema = z38.discriminatedUnion("kind", [
|
|
4132
|
+
AttributeDefBaseSchema.extend({ kind: z38.literal("enum"), values: z38.array(z38.string()) }),
|
|
4133
|
+
AttributeDefBaseSchema.extend({ kind: z38.literal("free_text") }),
|
|
4134
|
+
AttributeDefBaseSchema.extend({ kind: z38.literal("date_or_season") }),
|
|
4135
|
+
AttributeDefBaseSchema.extend({ kind: z38.literal("money_or_band") }),
|
|
4078
4136
|
AttributeDefBaseSchema.extend({
|
|
4079
|
-
kind:
|
|
4080
|
-
min:
|
|
4081
|
-
max:
|
|
4082
|
-
unit:
|
|
4137
|
+
kind: z38.literal("number"),
|
|
4138
|
+
min: z38.number().optional(),
|
|
4139
|
+
max: z38.number().optional(),
|
|
4140
|
+
unit: z38.string().optional()
|
|
4083
4141
|
})
|
|
4084
4142
|
]);
|
|
4085
4143
|
var EXTRAS_PREFIX = "extras.";
|
|
@@ -4118,59 +4176,59 @@ function scopeOfAttributeKey(config, key) {
|
|
|
4118
4176
|
}
|
|
4119
4177
|
|
|
4120
4178
|
// ../spacestation/src/space/agent-directive.ts
|
|
4121
|
-
import { z as
|
|
4179
|
+
import { z as z39 } from "zod";
|
|
4122
4180
|
var MAX_ACTIVE_AGENT_DIRECTIVES = 20;
|
|
4123
4181
|
var AGENT_DIRECTIVE_KINDS = ["preference", "pairing", "order of things", "promise", "threshold"];
|
|
4124
4182
|
var AGENT_DIRECTIVE_SEVERITIES = ["a missed opportunity", "a problem", "unacceptable"];
|
|
4125
4183
|
var AGENT_DIRECTIVE_SOURCES = ["owner", "operator", "session-lesson"];
|
|
4126
4184
|
var AGENT_DIRECTIVE_STATUSES = ["proposed", "active", "rejected", "retired"];
|
|
4127
|
-
var AgentDirectiveSchema =
|
|
4128
|
-
name:
|
|
4129
|
-
kind:
|
|
4130
|
-
severity:
|
|
4185
|
+
var AgentDirectiveSchema = z39.object({
|
|
4186
|
+
name: z39.string().trim().min(1).max(80),
|
|
4187
|
+
kind: z39.enum(AGENT_DIRECTIVE_KINDS),
|
|
4188
|
+
severity: z39.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
4131
4189
|
/** No bare URL: a URL is a hallucination surface, and a handle is not a
|
|
4132
4190
|
* product name. */
|
|
4133
|
-
text:
|
|
4191
|
+
text: z39.string().trim().min(1).max(1e3).refine((t) => !/https?:\/\//.test(t), "a directive names things by name, never by URL")
|
|
4134
4192
|
}).strict();
|
|
4135
|
-
var SpaceAgentDirectiveSchema =
|
|
4136
|
-
id:
|
|
4137
|
-
position:
|
|
4138
|
-
name:
|
|
4139
|
-
kind:
|
|
4140
|
-
severity:
|
|
4141
|
-
text:
|
|
4142
|
-
source:
|
|
4143
|
-
status:
|
|
4193
|
+
var SpaceAgentDirectiveSchema = z39.object({
|
|
4194
|
+
id: z39.string(),
|
|
4195
|
+
position: z39.number().int(),
|
|
4196
|
+
name: z39.string(),
|
|
4197
|
+
kind: z39.enum(AGENT_DIRECTIVE_KINDS),
|
|
4198
|
+
severity: z39.enum(AGENT_DIRECTIVE_SEVERITIES),
|
|
4199
|
+
text: z39.string(),
|
|
4200
|
+
source: z39.enum(AGENT_DIRECTIVE_SOURCES),
|
|
4201
|
+
status: z39.enum(AGENT_DIRECTIVE_STATUSES),
|
|
4144
4202
|
/** Who wrote it; null for a lesson the system proposed. */
|
|
4145
|
-
createdBy:
|
|
4203
|
+
createdBy: z39.string().nullable(),
|
|
4146
4204
|
/** Why a mined lesson was proposed; null for a directive a person wrote. */
|
|
4147
|
-
evidence:
|
|
4148
|
-
decidedBy:
|
|
4149
|
-
decidedAt:
|
|
4150
|
-
createdAt:
|
|
4205
|
+
evidence: z39.record(z39.unknown()).nullable(),
|
|
4206
|
+
decidedBy: z39.string().nullable(),
|
|
4207
|
+
decidedAt: z39.string().nullable(),
|
|
4208
|
+
createdAt: z39.string()
|
|
4151
4209
|
});
|
|
4152
|
-
var OutcomeTallySchema =
|
|
4210
|
+
var OutcomeTallySchema = z39.object({ turns: z39.number().int(), acted: z39.number().int() });
|
|
4153
4211
|
var SpaceAgentDirectiveListItemSchema = SpaceAgentDirectiveSchema.extend({
|
|
4154
|
-
impact:
|
|
4212
|
+
impact: z39.object({ before: OutcomeTallySchema, after: OutcomeTallySchema }).nullable()
|
|
4155
4213
|
});
|
|
4156
|
-
var UpdateAgentDirectiveInputSchema =
|
|
4214
|
+
var UpdateAgentDirectiveInputSchema = z39.object({
|
|
4157
4215
|
name: AgentDirectiveSchema.shape.name.optional(),
|
|
4158
4216
|
kind: AgentDirectiveSchema.shape.kind.optional(),
|
|
4159
4217
|
severity: AgentDirectiveSchema.shape.severity.optional(),
|
|
4160
4218
|
text: AgentDirectiveSchema.shape.text.optional(),
|
|
4161
|
-
status:
|
|
4219
|
+
status: z39.enum(AGENT_DIRECTIVE_STATUSES).optional()
|
|
4162
4220
|
}).strict();
|
|
4163
|
-
var ReorderAgentDirectivesInputSchema =
|
|
4221
|
+
var ReorderAgentDirectivesInputSchema = z39.object({ ids: z39.array(z39.string()).min(1) }).strict();
|
|
4164
4222
|
|
|
4165
4223
|
// ../spacestation/src/shell/bot-check-notice.ts
|
|
4166
|
-
import { z as
|
|
4167
|
-
var BotCheckNoticeSchema =
|
|
4224
|
+
import { z as z40 } from "zod";
|
|
4225
|
+
var BotCheckNoticeSchema = z40.object({
|
|
4168
4226
|
/** Read in order: plain text, and links the notice must keep linked. */
|
|
4169
|
-
segments:
|
|
4227
|
+
segments: z40.array(z40.union([z40.string(), z40.object({ text: z40.string(), href: z40.string().url() })])).min(1)
|
|
4170
4228
|
});
|
|
4171
4229
|
|
|
4172
4230
|
// ../spacestation/src/space/space-locale.ts
|
|
4173
|
-
import { z as
|
|
4231
|
+
import { z as z41 } from "zod";
|
|
4174
4232
|
var DEFAULT_SPACE_LOCALE = "en-US";
|
|
4175
4233
|
function isBcp47(tag) {
|
|
4176
4234
|
try {
|
|
@@ -4180,7 +4238,7 @@ function isBcp47(tag) {
|
|
|
4180
4238
|
throw err;
|
|
4181
4239
|
}
|
|
4182
4240
|
}
|
|
4183
|
-
var SpaceLocaleSchema =
|
|
4241
|
+
var SpaceLocaleSchema = z41.string().refine(isBcp47, { message: "locale must be a BCP 47 language tag, e.g. he-IL" });
|
|
4184
4242
|
var RTL_SCRIPTS = /* @__PURE__ */ new Set(["Arab", "Hebr", "Thaa", "Syrc", "Nkoo", "Adlm", "Rohg", "Mand", "Samr"]);
|
|
4185
4243
|
var RTL_LANGUAGES = /* @__PURE__ */ new Set(["ar", "he", "iw", "fa", "ur", "ps", "sd", "ug", "yi", "dv", "ckb", "syr"]);
|
|
4186
4244
|
function textDirectionOf(locale) {
|
|
@@ -4270,30 +4328,30 @@ function hostingAllows(hosting, surface) {
|
|
|
4270
4328
|
}
|
|
4271
4329
|
|
|
4272
4330
|
// ../spacestation/src/space/trace.ts
|
|
4273
|
-
import { z as
|
|
4274
|
-
var RunTokenUsageSchema =
|
|
4275
|
-
input_tokens:
|
|
4276
|
-
output_tokens:
|
|
4277
|
-
cache_read_tokens:
|
|
4331
|
+
import { z as z42 } from "zod";
|
|
4332
|
+
var RunTokenUsageSchema = z42.object({
|
|
4333
|
+
input_tokens: z42.number().optional(),
|
|
4334
|
+
output_tokens: z42.number().optional(),
|
|
4335
|
+
cache_read_tokens: z42.number().optional()
|
|
4278
4336
|
});
|
|
4279
|
-
var TraceRecordSchema =
|
|
4280
|
-
id:
|
|
4281
|
-
spaceId:
|
|
4282
|
-
sessionId:
|
|
4337
|
+
var TraceRecordSchema = z42.object({
|
|
4338
|
+
id: z42.string().uuid(),
|
|
4339
|
+
spaceId: z42.string().uuid().nullable(),
|
|
4340
|
+
sessionId: z42.string(),
|
|
4283
4341
|
/** OTP-verified visitor email the session was unlocked with, or `null`
|
|
4284
4342
|
* for an unlocked space / anonymous unlock. */
|
|
4285
|
-
visitorEmail:
|
|
4286
|
-
userPrompt:
|
|
4287
|
-
branch:
|
|
4288
|
-
responseText:
|
|
4289
|
-
layout:
|
|
4290
|
-
phaseTimings:
|
|
4291
|
-
tokensByModel:
|
|
4292
|
-
toolCalls:
|
|
4293
|
-
diagnostics:
|
|
4294
|
-
latencyFirstText:
|
|
4295
|
-
latencyFirstPatch:
|
|
4296
|
-
latencyTotal:
|
|
4343
|
+
visitorEmail: z42.string().nullable(),
|
|
4344
|
+
userPrompt: z42.string(),
|
|
4345
|
+
branch: z42.string().nullable(),
|
|
4346
|
+
responseText: z42.string().nullable(),
|
|
4347
|
+
layout: z42.unknown().nullable(),
|
|
4348
|
+
phaseTimings: z42.record(z42.number()).nullable(),
|
|
4349
|
+
tokensByModel: z42.record(RunTokenUsageSchema).nullable(),
|
|
4350
|
+
toolCalls: z42.array(z42.unknown()).nullable(),
|
|
4351
|
+
diagnostics: z42.array(z42.unknown()).nullable(),
|
|
4352
|
+
latencyFirstText: z42.number().int().nullable(),
|
|
4353
|
+
latencyFirstPatch: z42.number().int().nullable(),
|
|
4354
|
+
latencyTotal: z42.number().int().nullable(),
|
|
4297
4355
|
/**
|
|
4298
4356
|
* The CLIENT's turn id for this run, or `null`.
|
|
4299
4357
|
*
|
|
@@ -4309,29 +4367,29 @@ var TraceRecordSchema = z41.object({
|
|
|
4309
4367
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
4310
4368
|
* visitor asked something and got nothing.
|
|
4311
4369
|
*/
|
|
4312
|
-
turnId:
|
|
4370
|
+
turnId: z42.string().nullable(),
|
|
4313
4371
|
/** Serialized `TraceTracker.exportState()` payload (parsed object) —
|
|
4314
4372
|
* lets the inspector rehydrate this run verbatim after a reload. */
|
|
4315
|
-
trackerState:
|
|
4316
|
-
createdAt:
|
|
4373
|
+
trackerState: z42.unknown().nullable(),
|
|
4374
|
+
createdAt: z42.string()
|
|
4317
4375
|
});
|
|
4318
|
-
var MillisecondsSchema =
|
|
4319
|
-
var CreateTraceInputSchema =
|
|
4320
|
-
spaceId:
|
|
4321
|
-
sessionId:
|
|
4322
|
-
visitorEmail:
|
|
4323
|
-
userPrompt:
|
|
4324
|
-
branch:
|
|
4325
|
-
responseText:
|
|
4326
|
-
layout:
|
|
4327
|
-
phaseTimings:
|
|
4328
|
-
tokensByModel:
|
|
4329
|
-
toolCalls:
|
|
4330
|
-
diagnostics:
|
|
4376
|
+
var MillisecondsSchema = z42.number().nullable().transform((v) => v === null ? null : Math.round(v));
|
|
4377
|
+
var CreateTraceInputSchema = z42.object({
|
|
4378
|
+
spaceId: z42.string().uuid().nullable(),
|
|
4379
|
+
sessionId: z42.string(),
|
|
4380
|
+
visitorEmail: z42.string().nullable(),
|
|
4381
|
+
userPrompt: z42.string(),
|
|
4382
|
+
branch: z42.string().nullable(),
|
|
4383
|
+
responseText: z42.string().nullable(),
|
|
4384
|
+
layout: z42.unknown().nullable(),
|
|
4385
|
+
phaseTimings: z42.record(z42.number()).nullable(),
|
|
4386
|
+
tokensByModel: z42.record(RunTokenUsageSchema).nullable(),
|
|
4387
|
+
toolCalls: z42.array(z42.unknown()).nullable(),
|
|
4388
|
+
diagnostics: z42.array(z42.unknown()).nullable(),
|
|
4331
4389
|
latencyFirstText: MillisecondsSchema,
|
|
4332
4390
|
latencyFirstPatch: MillisecondsSchema,
|
|
4333
4391
|
latencyTotal: MillisecondsSchema,
|
|
4334
|
-
trackerState:
|
|
4392
|
+
trackerState: z42.unknown().nullable(),
|
|
4335
4393
|
/**
|
|
4336
4394
|
* The CLIENT's turn id for this run, or `null`.
|
|
4337
4395
|
*
|
|
@@ -4347,37 +4405,37 @@ var CreateTraceInputSchema = z41.object({
|
|
|
4347
4405
|
* a turn whose ack the client never saw — none of which is evidence that a
|
|
4348
4406
|
* visitor asked something and got nothing.
|
|
4349
4407
|
*/
|
|
4350
|
-
turnId:
|
|
4408
|
+
turnId: z42.string().nullable()
|
|
4351
4409
|
});
|
|
4352
|
-
var AgentSessionSummarySchema =
|
|
4353
|
-
sessionId:
|
|
4410
|
+
var AgentSessionSummarySchema = z42.object({
|
|
4411
|
+
sessionId: z42.string(),
|
|
4354
4412
|
/** Turn rows only; background/secondary runs are excluded by the aggregate. */
|
|
4355
|
-
turnCount:
|
|
4413
|
+
turnCount: z42.number().int(),
|
|
4356
4414
|
/** The session's opening prompt — titles the row in the UI. */
|
|
4357
|
-
firstPrompt:
|
|
4358
|
-
startedAt:
|
|
4359
|
-
lastRunAt:
|
|
4415
|
+
firstPrompt: z42.string(),
|
|
4416
|
+
startedAt: z42.string(),
|
|
4417
|
+
lastRunAt: z42.string(),
|
|
4360
4418
|
/** Summed `latency_total` across the session's turns. */
|
|
4361
|
-
totalLatencyMs:
|
|
4419
|
+
totalLatencyMs: z42.number().int()
|
|
4362
4420
|
});
|
|
4363
|
-
var SessionTurnSchema =
|
|
4364
|
-
id:
|
|
4365
|
-
userPrompt:
|
|
4366
|
-
responseText:
|
|
4421
|
+
var SessionTurnSchema = z42.object({
|
|
4422
|
+
id: z42.string().uuid(),
|
|
4423
|
+
userPrompt: z42.string(),
|
|
4424
|
+
responseText: z42.string().nullable(),
|
|
4367
4425
|
/** Full cumulative Spec committed by this turn — never a patch delta. */
|
|
4368
|
-
layout:
|
|
4369
|
-
createdAt:
|
|
4370
|
-
latencyTotal:
|
|
4371
|
-
phaseTimings:
|
|
4372
|
-
tokensByModel:
|
|
4373
|
-
input_tokens:
|
|
4374
|
-
output_tokens:
|
|
4426
|
+
layout: z42.unknown().nullable(),
|
|
4427
|
+
createdAt: z42.string(),
|
|
4428
|
+
latencyTotal: z42.number().int().nullable(),
|
|
4429
|
+
phaseTimings: z42.record(z42.number()).nullable(),
|
|
4430
|
+
tokensByModel: z42.record(z42.object({
|
|
4431
|
+
input_tokens: z42.number().optional(),
|
|
4432
|
+
output_tokens: z42.number().optional()
|
|
4375
4433
|
})).nullable(),
|
|
4376
|
-
toolCalls:
|
|
4377
|
-
diagnostics:
|
|
4434
|
+
toolCalls: z42.array(z42.unknown()).nullable(),
|
|
4435
|
+
diagnostics: z42.array(z42.unknown()).nullable()
|
|
4378
4436
|
});
|
|
4379
|
-
var SessionReplaySchema =
|
|
4380
|
-
turns:
|
|
4437
|
+
var SessionReplaySchema = z42.object({
|
|
4438
|
+
turns: z42.array(SessionTurnSchema),
|
|
4381
4439
|
/**
|
|
4382
4440
|
* The session's own last-committed layout, read straight off the durable
|
|
4383
4441
|
* session record (`sessions.blob.layout`) rather than derived from `turns`.
|
|
@@ -4388,20 +4446,20 @@ var SessionReplaySchema = z41.object({
|
|
|
4388
4446
|
* a perfectly real layout; only this field can show it. Null exclusively
|
|
4389
4447
|
* when the durable session row itself could not be read.
|
|
4390
4448
|
*/
|
|
4391
|
-
sessionLayout:
|
|
4449
|
+
sessionLayout: z42.record(z42.string(), z42.unknown()).nullable()
|
|
4392
4450
|
});
|
|
4393
|
-
var SessionTraceSchema =
|
|
4394
|
-
trackerState:
|
|
4451
|
+
var SessionTraceSchema = z42.object({
|
|
4452
|
+
trackerState: z42.string().nullable()
|
|
4395
4453
|
});
|
|
4396
|
-
var LlmUsageDailySchema =
|
|
4397
|
-
day:
|
|
4454
|
+
var LlmUsageDailySchema = z42.object({
|
|
4455
|
+
day: z42.string(),
|
|
4398
4456
|
/** Deployment that made the call — 'production', 'staging', 'pr-123', 'development'. */
|
|
4399
|
-
environment:
|
|
4400
|
-
feature:
|
|
4401
|
-
model:
|
|
4402
|
-
provider:
|
|
4457
|
+
environment: z42.string(),
|
|
4458
|
+
feature: z42.string(),
|
|
4459
|
+
model: z42.string(),
|
|
4460
|
+
provider: z42.string(),
|
|
4403
4461
|
/** Masked tail of the key actually billed, or null when unknown/non-Google. */
|
|
4404
|
-
keyFingerprint:
|
|
4462
|
+
keyFingerprint: z42.string().nullable(),
|
|
4405
4463
|
/**
|
|
4406
4464
|
* The space the call served, or null when it served none.
|
|
4407
4465
|
*
|
|
@@ -4410,91 +4468,91 @@ var LlmUsageDailySchema = z41.object({
|
|
|
4410
4468
|
* report that share rather than dropping it, or a per-space total reads as
|
|
4411
4469
|
* the platform total.
|
|
4412
4470
|
*/
|
|
4413
|
-
spaceId:
|
|
4471
|
+
spaceId: z42.string().nullable(),
|
|
4414
4472
|
/**
|
|
4415
4473
|
* The surface of the session the call served (`sessions.surface`), or null
|
|
4416
4474
|
* when it served no session or the session predates surface recording.
|
|
4417
4475
|
* `automation` is the eval harness — the signal that files an ordinary
|
|
4418
4476
|
* `agent-turn` as testing spend rather than as a visitor's.
|
|
4419
4477
|
*/
|
|
4420
|
-
surface:
|
|
4421
|
-
inputTokens:
|
|
4422
|
-
outputTokens:
|
|
4478
|
+
surface: z42.string().nullable(),
|
|
4479
|
+
inputTokens: z42.number(),
|
|
4480
|
+
outputTokens: z42.number(),
|
|
4423
4481
|
/** Subset of inputTokens, never additional to it. */
|
|
4424
|
-
cachedInputTokens:
|
|
4425
|
-
reasoningTokens:
|
|
4426
|
-
callCount:
|
|
4427
|
-
errorCount:
|
|
4428
|
-
estimatedCostUsd:
|
|
4482
|
+
cachedInputTokens: z42.number(),
|
|
4483
|
+
reasoningTokens: z42.number(),
|
|
4484
|
+
callCount: z42.number(),
|
|
4485
|
+
errorCount: z42.number(),
|
|
4486
|
+
estimatedCostUsd: z42.number().nullable()
|
|
4429
4487
|
});
|
|
4430
|
-
var LlmUsageBySessionSchema =
|
|
4431
|
-
sessionId:
|
|
4432
|
-
environment:
|
|
4433
|
-
model:
|
|
4488
|
+
var LlmUsageBySessionSchema = z42.object({
|
|
4489
|
+
sessionId: z42.string(),
|
|
4490
|
+
environment: z42.string(),
|
|
4491
|
+
model: z42.string(),
|
|
4434
4492
|
/** The space this session belongs to, or null for a session with no space. */
|
|
4435
|
-
spaceId:
|
|
4493
|
+
spaceId: z42.string().nullable(),
|
|
4436
4494
|
/** The session's surface — see `LlmUsageDailySchema.surface`. */
|
|
4437
|
-
surface:
|
|
4495
|
+
surface: z42.string().nullable(),
|
|
4438
4496
|
/** Label only — the first feature seen in the session. */
|
|
4439
|
-
firstFeature:
|
|
4440
|
-
startedAt:
|
|
4441
|
-
endedAt:
|
|
4442
|
-
inputTokens:
|
|
4443
|
-
outputTokens:
|
|
4444
|
-
cachedInputTokens:
|
|
4445
|
-
reasoningTokens:
|
|
4446
|
-
callCount:
|
|
4447
|
-
errorCount:
|
|
4497
|
+
firstFeature: z42.string(),
|
|
4498
|
+
startedAt: z42.string(),
|
|
4499
|
+
endedAt: z42.string(),
|
|
4500
|
+
inputTokens: z42.number(),
|
|
4501
|
+
outputTokens: z42.number(),
|
|
4502
|
+
cachedInputTokens: z42.number(),
|
|
4503
|
+
reasoningTokens: z42.number(),
|
|
4504
|
+
callCount: z42.number(),
|
|
4505
|
+
errorCount: z42.number(),
|
|
4448
4506
|
/** Priced server-side, like the daily rollup — the browser never carries a
|
|
4449
4507
|
* rate table, so there is exactly one place a price can be wrong. Null when
|
|
4450
4508
|
* the model is unpriced; never 0, which would read as free. */
|
|
4451
|
-
estimatedCostUsd:
|
|
4509
|
+
estimatedCostUsd: z42.number().nullable()
|
|
4452
4510
|
});
|
|
4453
|
-
var LlmSessionsDailySchema =
|
|
4454
|
-
day:
|
|
4455
|
-
environment:
|
|
4456
|
-
sessionCount:
|
|
4511
|
+
var LlmSessionsDailySchema = z42.object({
|
|
4512
|
+
day: z42.string(),
|
|
4513
|
+
environment: z42.string(),
|
|
4514
|
+
sessionCount: z42.number()
|
|
4457
4515
|
});
|
|
4458
4516
|
|
|
4459
4517
|
// ../spacestation/src/space/session-queue.ts
|
|
4460
|
-
import { z as
|
|
4518
|
+
import { z as z44 } from "zod";
|
|
4461
4519
|
|
|
4462
4520
|
// ../spacestation/src/space/session-activity.ts
|
|
4463
|
-
import { z as
|
|
4464
|
-
var SessionActivityEventSchema =
|
|
4465
|
-
id:
|
|
4466
|
-
kind:
|
|
4467
|
-
occurredAt:
|
|
4468
|
-
source:
|
|
4469
|
-
surface:
|
|
4470
|
-
payload:
|
|
4521
|
+
import { z as z43 } from "zod";
|
|
4522
|
+
var SessionActivityEventSchema = z43.object({
|
|
4523
|
+
id: z43.string(),
|
|
4524
|
+
kind: z43.string(),
|
|
4525
|
+
occurredAt: z43.string(),
|
|
4526
|
+
source: z43.string(),
|
|
4527
|
+
surface: z43.string(),
|
|
4528
|
+
payload: z43.record(z43.unknown())
|
|
4471
4529
|
});
|
|
4472
|
-
var SessionActivitySchema =
|
|
4473
|
-
events:
|
|
4474
|
-
hasMore:
|
|
4530
|
+
var SessionActivitySchema = z43.object({
|
|
4531
|
+
events: z43.array(SessionActivityEventSchema),
|
|
4532
|
+
hasMore: z43.boolean()
|
|
4475
4533
|
});
|
|
4476
4534
|
|
|
4477
4535
|
// ../spacestation/src/space/session-queue.ts
|
|
4478
|
-
var SessionVerdictSchema =
|
|
4479
|
-
var RecordableVerdictSchema =
|
|
4480
|
-
var SessionReviewEventSchema =
|
|
4481
|
-
id:
|
|
4536
|
+
var SessionVerdictSchema = z44.enum(["unreviewed", "viewed", "bug"]);
|
|
4537
|
+
var RecordableVerdictSchema = z44.enum(["viewed", "bug"]);
|
|
4538
|
+
var SessionReviewEventSchema = z44.object({
|
|
4539
|
+
id: z44.string().uuid(),
|
|
4482
4540
|
verdict: RecordableVerdictSchema,
|
|
4483
4541
|
/** Account email of the operator who judged it. Attribution is the reason the
|
|
4484
4542
|
* log is append-only rather than a mutable current-state row. */
|
|
4485
|
-
reviewer:
|
|
4486
|
-
note:
|
|
4487
|
-
createdAt:
|
|
4543
|
+
reviewer: z44.string(),
|
|
4544
|
+
note: z44.string().nullable(),
|
|
4545
|
+
createdAt: z44.string()
|
|
4488
4546
|
});
|
|
4489
|
-
var BugSeveritySchema =
|
|
4490
|
-
var BugLocationSchema =
|
|
4491
|
-
elementId:
|
|
4547
|
+
var BugSeveritySchema = z44.enum(["high", "medium", "low"]);
|
|
4548
|
+
var BugLocationSchema = z44.object({
|
|
4549
|
+
elementId: z44.string().nullable(),
|
|
4492
4550
|
/** Display only — the catalog component type, e.g. "productGrid". Null
|
|
4493
4551
|
* alongside a null `elementId`. */
|
|
4494
|
-
elementType:
|
|
4552
|
+
elementType: z44.string().nullable(),
|
|
4495
4553
|
/** Fraction of the ELEMENT's own box. Null for a page anchor. */
|
|
4496
|
-
offsetXPct:
|
|
4497
|
-
offsetYPct:
|
|
4554
|
+
offsetXPct: z44.number().min(0).max(100).nullable(),
|
|
4555
|
+
offsetYPct: z44.number().min(0).max(100).nullable(),
|
|
4498
4556
|
/**
|
|
4499
4557
|
* ABSOLUTE document pixels, for a pin with no element under it. Null for an
|
|
4500
4558
|
* element anchor.
|
|
@@ -4505,8 +4563,8 @@ var BugLocationSchema = z43.object({
|
|
|
4505
4563
|
* on the page with it. Measured before this was fixed: growing the page 9%
|
|
4506
4564
|
* slid a pin 32px, so a pin ran away from the cursor reaching for it.
|
|
4507
4565
|
*/
|
|
4508
|
-
pageX:
|
|
4509
|
-
pageY:
|
|
4566
|
+
pageX: z44.number().nullable(),
|
|
4567
|
+
pageY: z44.number().nullable()
|
|
4510
4568
|
}).refine(
|
|
4511
4569
|
(loc) => {
|
|
4512
4570
|
const hasOffsets = loc.offsetXPct !== null && loc.offsetYPct !== null;
|
|
@@ -4520,24 +4578,24 @@ var BugLocationSchema = z43.object({
|
|
|
4520
4578
|
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)"
|
|
4521
4579
|
}
|
|
4522
4580
|
);
|
|
4523
|
-
var SessionBugSchema =
|
|
4524
|
-
id:
|
|
4581
|
+
var SessionBugSchema = z44.object({
|
|
4582
|
+
id: z44.string().uuid(),
|
|
4525
4583
|
/** 1-based turn the fault was observed on; null when the fault is session-wide. */
|
|
4526
|
-
turnIndex:
|
|
4584
|
+
turnIndex: z44.number().int().nullable(),
|
|
4527
4585
|
/** Where on that turn's canvas the pin was dropped; null for a bug filed
|
|
4528
4586
|
* without pinning a spot. */
|
|
4529
4587
|
location: BugLocationSchema.nullable(),
|
|
4530
|
-
provider:
|
|
4531
|
-
issueKey:
|
|
4532
|
-
issueUrl:
|
|
4588
|
+
provider: z44.string(),
|
|
4589
|
+
issueKey: z44.string().nullable(),
|
|
4590
|
+
issueUrl: z44.string().nullable(),
|
|
4533
4591
|
/** The tracker's own state word ('Todo', 'Done', …) — their vocabulary, so
|
|
4534
4592
|
* open text. Null until first synced. */
|
|
4535
|
-
issueState:
|
|
4536
|
-
title:
|
|
4537
|
-
body:
|
|
4593
|
+
issueState: z44.string().nullable(),
|
|
4594
|
+
title: z44.string(),
|
|
4595
|
+
body: z44.string(),
|
|
4538
4596
|
severity: BugSeveritySchema,
|
|
4539
|
-
createdBy:
|
|
4540
|
-
createdAt:
|
|
4597
|
+
createdBy: z44.string(),
|
|
4598
|
+
createdAt: z44.string(),
|
|
4541
4599
|
/**
|
|
4542
4600
|
* When this bug was resolved from the console; null means still OPEN.
|
|
4543
4601
|
*
|
|
@@ -4546,60 +4604,60 @@ var SessionBugSchema = z43.object({
|
|
|
4546
4604
|
* whether a particular fault is still live. The timestamp IS the state, so
|
|
4547
4605
|
* no boolean can contradict it.
|
|
4548
4606
|
*/
|
|
4549
|
-
resolvedAt:
|
|
4550
|
-
resolvedBy:
|
|
4607
|
+
resolvedAt: z44.string().nullable(),
|
|
4608
|
+
resolvedBy: z44.string().nullable()
|
|
4551
4609
|
});
|
|
4552
|
-
var SpaceBugSchema = SessionBugSchema.extend({ sessionId:
|
|
4553
|
-
var SessionCommentSchema =
|
|
4554
|
-
id:
|
|
4610
|
+
var SpaceBugSchema = SessionBugSchema.extend({ sessionId: z44.string() });
|
|
4611
|
+
var SessionCommentSchema = z44.object({
|
|
4612
|
+
id: z44.string().uuid(),
|
|
4555
4613
|
/** Set = a reply in that bug's thread. Null = a standalone comment pin. */
|
|
4556
|
-
bugId:
|
|
4614
|
+
bugId: z44.string().uuid().nullable(),
|
|
4557
4615
|
/** 1-based turn the comment was left on; null for a reply (it reads its
|
|
4558
4616
|
* parent bug's turn). */
|
|
4559
|
-
turnIndex:
|
|
4617
|
+
turnIndex: z44.number().int().nullable(),
|
|
4560
4618
|
/** The canvas anchor for a STANDALONE comment's own pin; null for a reply. */
|
|
4561
4619
|
location: BugLocationSchema.nullable(),
|
|
4562
|
-
body:
|
|
4563
|
-
createdBy:
|
|
4564
|
-
createdAt:
|
|
4620
|
+
body: z44.string(),
|
|
4621
|
+
createdBy: z44.string(),
|
|
4622
|
+
createdAt: z44.string()
|
|
4565
4623
|
});
|
|
4566
|
-
var CreateCommentInputSchema =
|
|
4567
|
-
bugId:
|
|
4568
|
-
turnIndex:
|
|
4624
|
+
var CreateCommentInputSchema = z44.object({
|
|
4625
|
+
bugId: z44.string().uuid().nullable(),
|
|
4626
|
+
turnIndex: z44.number().int().positive().nullable(),
|
|
4569
4627
|
location: BugLocationSchema.nullable(),
|
|
4570
4628
|
// Trimmed, so whitespace is not content: `.min(1)` alone accepted a comment
|
|
4571
4629
|
// of three spaces, which renders as an empty bubble nobody can interpret.
|
|
4572
|
-
body:
|
|
4630
|
+
body: z44.string().trim().min(1)
|
|
4573
4631
|
}).refine((input) => input.bugId === null !== (input.location === null), {
|
|
4574
4632
|
message: "a comment is either a reply (bugId, no location) or a standalone pin (location, no bugId)"
|
|
4575
4633
|
});
|
|
4576
|
-
var UpdateCommentInputSchema =
|
|
4577
|
-
body:
|
|
4578
|
-
bugId:
|
|
4634
|
+
var UpdateCommentInputSchema = z44.object({
|
|
4635
|
+
body: z44.string().trim().min(1).optional(),
|
|
4636
|
+
bugId: z44.string().uuid().nullable().optional(),
|
|
4579
4637
|
location: BugLocationSchema.nullable().optional()
|
|
4580
4638
|
});
|
|
4581
4639
|
var MOBILE_VIEWPORT_MAX = 720;
|
|
4582
|
-
var SessionFormFactorSchema =
|
|
4640
|
+
var SessionFormFactorSchema = z44.enum(["mobile", "desktop"]).nullable();
|
|
4583
4641
|
function formFactorFromViewport(width) {
|
|
4584
4642
|
if (width === null) return null;
|
|
4585
4643
|
return width <= MOBILE_VIEWPORT_MAX ? "mobile" : "desktop";
|
|
4586
4644
|
}
|
|
4587
|
-
var SessionSummarySchema =
|
|
4588
|
-
sessionId:
|
|
4645
|
+
var SessionSummarySchema = z44.object({
|
|
4646
|
+
sessionId: z44.string(),
|
|
4589
4647
|
/** Stable per-browser id — the join key across a visitor's sessions. Null when
|
|
4590
4648
|
* the session row is gone (pruned) or predates the `sessions` table. */
|
|
4591
|
-
visitorId:
|
|
4649
|
+
visitorId: z44.string().nullable(),
|
|
4592
4650
|
/** Provider-qualified identity anchor, present only once the visitor
|
|
4593
4651
|
* identified themselves. Both null together means "not identified yet". */
|
|
4594
|
-
identityProvider:
|
|
4595
|
-
identityKey:
|
|
4652
|
+
identityProvider: z44.string().nullable(),
|
|
4653
|
+
identityKey: z44.string().nullable(),
|
|
4596
4654
|
/** Team/test traffic. The queue hides these by default. */
|
|
4597
|
-
isInternal:
|
|
4655
|
+
isInternal: z44.boolean(),
|
|
4598
4656
|
/** Build that served the session. Null = not captured; a version filter must
|
|
4599
4657
|
* therefore EXCLUDE it rather than let it match an arbitrary bucket. */
|
|
4600
|
-
clientVersion:
|
|
4658
|
+
clientVersion: z44.string().nullable(),
|
|
4601
4659
|
/** Commit-shaped interaction signals, counted, keyed by open `SignalType`. */
|
|
4602
|
-
signalCounts:
|
|
4660
|
+
signalCounts: z44.record(z44.number()),
|
|
4603
4661
|
/**
|
|
4604
4662
|
* Did this conversation ACQUIRE anything, and how many times?
|
|
4605
4663
|
*
|
|
@@ -4616,7 +4674,7 @@ var SessionSummarySchema = z43.object({
|
|
|
4616
4674
|
* predates the column — and renders as no mark at all. It never means zero:
|
|
4617
4675
|
* zero is a real, recorded answer and the rail reports it as one.
|
|
4618
4676
|
*/
|
|
4619
|
-
conversionAttempts:
|
|
4677
|
+
conversionAttempts: z44.number().int().nullable(),
|
|
4620
4678
|
/**
|
|
4621
4679
|
* The same attempts split by EVENT KIND, keyed by the kind's own name
|
|
4622
4680
|
* (`commerce.cart_line_added`, `commerce.registry_clicked`), counted distinct
|
|
@@ -4632,7 +4690,7 @@ var SessionSummarySchema = z43.object({
|
|
|
4632
4690
|
* kinds together, and one attempt id appearing under both would be counted
|
|
4633
4691
|
* once there and twice here.
|
|
4634
4692
|
*/
|
|
4635
|
-
conversionKinds:
|
|
4693
|
+
conversionKinds: z44.record(z44.number()),
|
|
4636
4694
|
/**
|
|
4637
4695
|
* Every analytics funnel step this session reached, in funnel order — the
|
|
4638
4696
|
* dashboard's own step ids, read by the same per-step predicates, so a queue
|
|
@@ -4640,20 +4698,20 @@ var SessionSummarySchema = z43.object({
|
|
|
4640
4698
|
* set of strings for the reason `conversionKinds` is: the contract does not
|
|
4641
4699
|
* learn what a step means. Empty only when read from a pre-column database.
|
|
4642
4700
|
*/
|
|
4643
|
-
funnelSteps:
|
|
4701
|
+
funnelSteps: z44.array(z44.string()),
|
|
4644
4702
|
/**
|
|
4645
4703
|
* The connector's opaque handle for what this session produced in its back
|
|
4646
4704
|
* office — present only once a checkout actually reached the platform. The
|
|
4647
4705
|
* console hands it to the back-office link registry; nothing else reads it.
|
|
4648
4706
|
*/
|
|
4649
|
-
backOfficeRef:
|
|
4707
|
+
backOfficeRef: z44.string().nullable(),
|
|
4650
4708
|
/**
|
|
4651
4709
|
* The order this session produced, when the connector's back office reported
|
|
4652
4710
|
* it (`session_orders`): its opaque id and the back office's own name for it.
|
|
4653
4711
|
* Both null when no order is known — the cart handle above is then the door.
|
|
4654
4712
|
*/
|
|
4655
|
-
orderRef:
|
|
4656
|
-
orderLabel:
|
|
4713
|
+
orderRef: z44.string().nullable(),
|
|
4714
|
+
orderLabel: z44.string().nullable(),
|
|
4657
4715
|
/**
|
|
4658
4716
|
* Which shell this session rendered — the one thing about the CAPTURE a list
|
|
4659
4717
|
* needs.
|
|
@@ -4666,12 +4724,12 @@ var SessionSummarySchema = z43.object({
|
|
|
4666
4724
|
* on a desktop are not the same session.
|
|
4667
4725
|
*/
|
|
4668
4726
|
formFactor: SessionFormFactorSchema,
|
|
4669
|
-
turnCount:
|
|
4727
|
+
turnCount: z44.number().int(),
|
|
4670
4728
|
/** The visitor's opening message — the single most informative field for
|
|
4671
4729
|
* deciding whether a session is worth opening, hence the widest column. */
|
|
4672
|
-
firstPrompt:
|
|
4673
|
-
startedAt:
|
|
4674
|
-
lastRunAt:
|
|
4730
|
+
firstPrompt: z44.string(),
|
|
4731
|
+
startedAt: z44.string(),
|
|
4732
|
+
lastRunAt: z44.string(),
|
|
4675
4733
|
/**
|
|
4676
4734
|
* The VISITOR's own IANA zone (`America/New_York`), read from their browser
|
|
4677
4735
|
* at session create — what the two timestamps above should be read in.
|
|
@@ -4699,7 +4757,7 @@ var SessionSummarySchema = z43.object({
|
|
|
4699
4757
|
* Client-asserted and never validated against a zone table, so every consumer
|
|
4700
4758
|
* must tolerate an unknown name: `Intl` throws a RangeError on one.
|
|
4701
4759
|
*/
|
|
4702
|
-
visitorTimeZone:
|
|
4760
|
+
visitorTimeZone: z44.string().nullable(),
|
|
4703
4761
|
/**
|
|
4704
4762
|
* Mean TIME TO FIRST PATCH, over the turns that recorded one — the first
|
|
4705
4763
|
* layout op reaching the visitor, and THE latency the project is managed on.
|
|
@@ -4707,31 +4765,31 @@ var SessionSummarySchema = z43.object({
|
|
|
4707
4765
|
* `totalLatencyMs` carries the chip-gen tail that runs after the visitor is
|
|
4708
4766
|
* already reading. Null when no turn in the session recorded a patch.
|
|
4709
4767
|
*/
|
|
4710
|
-
avgTtftMs:
|
|
4768
|
+
avgTtftMs: z44.number().int().nullable(),
|
|
4711
4769
|
/** Mean `main_done_ms` — layout + prose complete. Context for the TTFT, not
|
|
4712
4770
|
* a budget: null on sessions older than the mark's recording. */
|
|
4713
|
-
avgMainDoneMs:
|
|
4771
|
+
avgMainDoneMs: z44.number().int().nullable(),
|
|
4714
4772
|
/** Mean `chip_gen_ms` — the pass that runs AFTER mainDone and is out of the
|
|
4715
4773
|
* budget. On the row only to explain the gap to `totalLatencyMs`. */
|
|
4716
|
-
avgChipGenMs:
|
|
4717
|
-
totalLatencyMs:
|
|
4718
|
-
durationMs:
|
|
4774
|
+
avgChipGenMs: z44.number().int().nullable(),
|
|
4775
|
+
totalLatencyMs: z44.number().int(),
|
|
4776
|
+
durationMs: z44.number().int(),
|
|
4719
4777
|
/** Inferred from recent activity — nothing writes a session-end marker. A
|
|
4720
4778
|
* live session streams and cannot be given a verdict until it ends. */
|
|
4721
|
-
isLive:
|
|
4779
|
+
isLive: z44.boolean(),
|
|
4722
4780
|
verdict: SessionVerdictSchema,
|
|
4723
|
-
reviewedBy:
|
|
4724
|
-
reviewedAt:
|
|
4781
|
+
reviewedBy: z44.string().nullable(),
|
|
4782
|
+
reviewedAt: z44.string().nullable(),
|
|
4725
4783
|
/** Latest filed bug, flattened onto the row so the queue can show its live
|
|
4726
4784
|
* state without a second request. */
|
|
4727
|
-
bugIssueKey:
|
|
4728
|
-
bugIssueUrl:
|
|
4729
|
-
bugIssueState:
|
|
4785
|
+
bugIssueKey: z44.string().nullable(),
|
|
4786
|
+
bugIssueUrl: z44.string().nullable(),
|
|
4787
|
+
bugIssueState: z44.string().nullable()
|
|
4730
4788
|
});
|
|
4731
|
-
var SessionQueuePageSchema =
|
|
4732
|
-
sessions:
|
|
4733
|
-
totalCount:
|
|
4734
|
-
hiddenInternalCount:
|
|
4789
|
+
var SessionQueuePageSchema = z44.object({
|
|
4790
|
+
sessions: z44.array(SessionSummarySchema),
|
|
4791
|
+
totalCount: z44.number().int(),
|
|
4792
|
+
hiddenInternalCount: z44.number().int(),
|
|
4735
4793
|
/**
|
|
4736
4794
|
* Bounced sessions the queue left out — no turn and no add, the default.
|
|
4737
4795
|
*
|
|
@@ -4741,61 +4799,61 @@ var SessionQueuePageSchema = z43.object({
|
|
|
4741
4799
|
* `totalCount + hiddenBouncedCount` is that population, and this count is the
|
|
4742
4800
|
* analytics dashboard's bounce over the same window.
|
|
4743
4801
|
*/
|
|
4744
|
-
hiddenBouncedCount:
|
|
4802
|
+
hiddenBouncedCount: z44.number().int()
|
|
4745
4803
|
});
|
|
4746
|
-
var SessionQueueFacetsSchema =
|
|
4747
|
-
review:
|
|
4748
|
-
version:
|
|
4749
|
-
turns:
|
|
4750
|
-
durationS:
|
|
4804
|
+
var SessionQueueFacetsSchema = z44.object({
|
|
4805
|
+
review: z44.record(z44.number()),
|
|
4806
|
+
version: z44.record(z44.number()),
|
|
4807
|
+
turns: z44.record(z44.number()),
|
|
4808
|
+
durationS: z44.record(z44.number()),
|
|
4751
4809
|
/** Sessions per funnel step reached — a session counts under every step it reached. */
|
|
4752
|
-
funnel:
|
|
4810
|
+
funnel: z44.record(z44.number())
|
|
4753
4811
|
});
|
|
4754
|
-
var SessionCaptureSchema =
|
|
4755
|
-
viewportWidth:
|
|
4756
|
-
viewportHeight:
|
|
4757
|
-
userAgent:
|
|
4758
|
-
locale:
|
|
4812
|
+
var SessionCaptureSchema = z44.object({
|
|
4813
|
+
viewportWidth: z44.number().int().nullable(),
|
|
4814
|
+
viewportHeight: z44.number().int().nullable(),
|
|
4815
|
+
userAgent: z44.string().nullable(),
|
|
4816
|
+
locale: z44.string().nullable(),
|
|
4759
4817
|
/** Referrer at session create — separates agentic traffic from organic. */
|
|
4760
|
-
referrer:
|
|
4818
|
+
referrer: z44.string().nullable()
|
|
4761
4819
|
});
|
|
4762
|
-
var SessionCaptureInputSchema =
|
|
4763
|
-
viewportWidth:
|
|
4764
|
-
viewportHeight:
|
|
4765
|
-
userAgent:
|
|
4766
|
-
locale:
|
|
4820
|
+
var SessionCaptureInputSchema = z44.object({
|
|
4821
|
+
viewportWidth: z44.number().int().positive().max(2e4).optional(),
|
|
4822
|
+
viewportHeight: z44.number().int().positive().max(2e4).optional(),
|
|
4823
|
+
userAgent: z44.string().max(1e3).optional(),
|
|
4824
|
+
locale: z44.string().max(35).optional(),
|
|
4767
4825
|
/** IANA zone name from the visitor's browser. Bounded rather than validated:
|
|
4768
4826
|
* the zone database grows, and refusing a name this build has not heard of
|
|
4769
4827
|
* would drop a real session's capture over a table that is out of date. */
|
|
4770
|
-
timeZone:
|
|
4771
|
-
referrer:
|
|
4772
|
-
clientVersion:
|
|
4773
|
-
isInternal:
|
|
4828
|
+
timeZone: z44.string().max(64).optional(),
|
|
4829
|
+
referrer: z44.string().max(2048).optional(),
|
|
4830
|
+
clientVersion: z44.string().max(100).optional(),
|
|
4831
|
+
isInternal: z44.boolean().optional()
|
|
4774
4832
|
});
|
|
4775
|
-
var SessionDetailSchema =
|
|
4833
|
+
var SessionDetailSchema = z44.object({
|
|
4776
4834
|
session: SessionSummarySchema,
|
|
4777
4835
|
capture: SessionCaptureSchema,
|
|
4778
4836
|
/** Full verdict history, newest first. Verdicts are revisable, and a session
|
|
4779
4837
|
* re-judged after a fix is the evidence the fix worked. */
|
|
4780
|
-
reviews:
|
|
4781
|
-
bugs:
|
|
4782
|
-
comments:
|
|
4838
|
+
reviews: z44.array(SessionReviewEventSchema),
|
|
4839
|
+
bugs: z44.array(SessionBugSchema),
|
|
4840
|
+
comments: z44.array(SessionCommentSchema),
|
|
4783
4841
|
/** Optional during API/console rolling deployment. Absent is unavailable,
|
|
4784
4842
|
* not evidence of zero visitor activity. */
|
|
4785
4843
|
activity: SessionActivitySchema.optional()
|
|
4786
4844
|
});
|
|
4787
|
-
var RecordVerdictInputSchema =
|
|
4845
|
+
var RecordVerdictInputSchema = z44.object({
|
|
4788
4846
|
verdict: RecordableVerdictSchema,
|
|
4789
|
-
note:
|
|
4847
|
+
note: z44.string().max(2e3).optional()
|
|
4790
4848
|
});
|
|
4791
|
-
var FileBugInputSchema =
|
|
4792
|
-
turnIndex:
|
|
4849
|
+
var FileBugInputSchema = z44.object({
|
|
4850
|
+
turnIndex: z44.number().int().positive().nullable(),
|
|
4793
4851
|
/** Optional — a bug filed without dropping a pin has no location. */
|
|
4794
4852
|
location: BugLocationSchema.nullable().optional(),
|
|
4795
|
-
title:
|
|
4796
|
-
body:
|
|
4853
|
+
title: z44.string().min(1).max(300),
|
|
4854
|
+
body: z44.string().min(1),
|
|
4797
4855
|
severity: BugSeveritySchema,
|
|
4798
|
-
payload:
|
|
4856
|
+
payload: z44.record(z44.unknown())
|
|
4799
4857
|
});
|
|
4800
4858
|
|
|
4801
4859
|
// ../spacestation/src/contracts/retrieval/ecommerce/option-values.ts
|
|
@@ -5090,8 +5148,11 @@ __export(src_exports2, {
|
|
|
5090
5148
|
buildPdpCompanionsConfig: () => buildPdpCompanionsConfig,
|
|
5091
5149
|
cartLineMatchesSelections: () => cartLineMatchesSelections,
|
|
5092
5150
|
cartLinesForProduct: () => cartLinesForProduct,
|
|
5151
|
+
clearCatalogSearches: () => clearCatalogSearches,
|
|
5093
5152
|
clearCodeDiscountSources: () => clearCodeDiscountSources,
|
|
5094
5153
|
clearProductNameLookups: () => clearProductNameLookups,
|
|
5154
|
+
clearShopCheckouts: () => clearShopCheckouts,
|
|
5155
|
+
clearStoreArticleLookups: () => clearStoreArticleLookups,
|
|
5095
5156
|
clearStoreThemeSources: () => clearStoreThemeSources,
|
|
5096
5157
|
createUnavailableProduct: () => createUnavailableProduct,
|
|
5097
5158
|
entityProjections: () => entityProjections,
|
|
@@ -5111,11 +5172,17 @@ __export(src_exports2, {
|
|
|
5111
5172
|
readBaseAttributesConfig: () => readBaseAttributesConfig,
|
|
5112
5173
|
readBucketLabelsConfig: () => readBucketLabelsConfig,
|
|
5113
5174
|
readPdpCompanions: () => readPdpCompanions,
|
|
5175
|
+
registerCatalogSearch: () => registerCatalogSearch,
|
|
5114
5176
|
registerCodeDiscountSource: () => registerCodeDiscountSource,
|
|
5115
5177
|
registerProductNameLookup: () => registerProductNameLookup,
|
|
5178
|
+
registerShopCheckout: () => registerShopCheckout,
|
|
5179
|
+
registerStoreArticleLookup: () => registerStoreArticleLookup,
|
|
5116
5180
|
registerStoreThemeSource: () => registerStoreThemeSource,
|
|
5181
|
+
resolveCatalogSearch: () => resolveCatalogSearch,
|
|
5117
5182
|
resolveCodeDiscountSource: () => resolveCodeDiscountSource,
|
|
5118
5183
|
resolveProductNameLookup: () => resolveProductNameLookup,
|
|
5184
|
+
resolveShopCheckout: () => resolveShopCheckout,
|
|
5185
|
+
resolveStoreArticleLookup: () => resolveStoreArticleLookup,
|
|
5119
5186
|
resolveStoreThemeSource: () => resolveStoreThemeSource,
|
|
5120
5187
|
scopedAttributeKey: () => scopedAttributeKey,
|
|
5121
5188
|
selectedOptionsToRecord: () => selectedOptionsToRecord,
|
|
@@ -5123,60 +5190,60 @@ __export(src_exports2, {
|
|
|
5123
5190
|
});
|
|
5124
5191
|
|
|
5125
5192
|
// ../ecommerce/src/commerce-schemas.ts
|
|
5126
|
-
import { z as
|
|
5127
|
-
var MoneySchema =
|
|
5128
|
-
amount:
|
|
5129
|
-
currencyCode:
|
|
5193
|
+
import { z as z45 } from "zod";
|
|
5194
|
+
var MoneySchema = z45.object({
|
|
5195
|
+
amount: z45.number(),
|
|
5196
|
+
currencyCode: z45.string()
|
|
5130
5197
|
});
|
|
5131
|
-
var ImageSchema =
|
|
5132
|
-
url:
|
|
5133
|
-
altText:
|
|
5134
|
-
width:
|
|
5135
|
-
height:
|
|
5198
|
+
var ImageSchema = z45.object({
|
|
5199
|
+
url: z45.string(),
|
|
5200
|
+
altText: z45.string(),
|
|
5201
|
+
width: z45.number().optional(),
|
|
5202
|
+
height: z45.number().optional(),
|
|
5136
5203
|
/** Responsive candidate set, resolved at the commerce-adapter boundary —
|
|
5137
5204
|
* never computed in a component. Renderers use it as `<img srcSet>` paired
|
|
5138
5205
|
* with a layout `sizes`. Absent for non-CDN / unsizable images. */
|
|
5139
|
-
srcSet:
|
|
5206
|
+
srcSet: z45.string().optional()
|
|
5140
5207
|
});
|
|
5141
|
-
var AssetSchema =
|
|
5208
|
+
var AssetSchema = z45.object({
|
|
5142
5209
|
/** Opaque asset id — the `resolved()` ref the agent emitted. */
|
|
5143
|
-
id:
|
|
5144
|
-
url:
|
|
5145
|
-
altText:
|
|
5146
|
-
srcSet:
|
|
5210
|
+
id: z45.string(),
|
|
5211
|
+
url: z45.string(),
|
|
5212
|
+
altText: z45.string(),
|
|
5213
|
+
srcSet: z45.string().optional()
|
|
5147
5214
|
});
|
|
5148
|
-
var SelectedOptionSchema =
|
|
5149
|
-
name:
|
|
5150
|
-
value:
|
|
5215
|
+
var SelectedOptionSchema = z45.object({
|
|
5216
|
+
name: z45.string(),
|
|
5217
|
+
value: z45.string()
|
|
5151
5218
|
});
|
|
5152
|
-
var VideoSourceSchema =
|
|
5153
|
-
url:
|
|
5154
|
-
mimeType:
|
|
5155
|
-
width:
|
|
5156
|
-
height:
|
|
5219
|
+
var VideoSourceSchema = z45.object({
|
|
5220
|
+
url: z45.string(),
|
|
5221
|
+
mimeType: z45.string(),
|
|
5222
|
+
width: z45.number().optional(),
|
|
5223
|
+
height: z45.number().optional()
|
|
5157
5224
|
});
|
|
5158
|
-
var ProductVideoSchema =
|
|
5159
|
-
kind:
|
|
5225
|
+
var ProductVideoSchema = z45.object({
|
|
5226
|
+
kind: z45.enum(["hosted", "external"]),
|
|
5160
5227
|
previewImage: ImageSchema.optional(),
|
|
5161
|
-
altText:
|
|
5228
|
+
altText: z45.string().default(""),
|
|
5162
5229
|
/** `kind: 'hosted'` only — empty for external embeds. */
|
|
5163
|
-
sources:
|
|
5230
|
+
sources: z45.array(VideoSourceSchema).default([]),
|
|
5164
5231
|
/** `kind: 'external'` only — iframe embed URL. */
|
|
5165
|
-
embedUrl:
|
|
5232
|
+
embedUrl: z45.string().optional(),
|
|
5166
5233
|
/** `kind: 'external'` only — e.g. `YOUTUBE` | `VIMEO`. */
|
|
5167
|
-
host:
|
|
5234
|
+
host: z45.string().optional()
|
|
5168
5235
|
});
|
|
5169
|
-
var AvailabilityStatusSchema =
|
|
5236
|
+
var AvailabilityStatusSchema = z45.enum([
|
|
5170
5237
|
"in_stock",
|
|
5171
5238
|
"backorder",
|
|
5172
5239
|
"preorder",
|
|
5173
5240
|
"out_of_stock",
|
|
5174
5241
|
"discontinued"
|
|
5175
5242
|
]);
|
|
5176
|
-
var ProductVariantSchema =
|
|
5177
|
-
id:
|
|
5178
|
-
title:
|
|
5179
|
-
available:
|
|
5243
|
+
var ProductVariantSchema = z45.object({
|
|
5244
|
+
id: z45.string(),
|
|
5245
|
+
title: z45.string(),
|
|
5246
|
+
available: z45.boolean(),
|
|
5180
5247
|
/**
|
|
5181
5248
|
* Qualifies `available` with the fulfillment state behind it. Absent means
|
|
5182
5249
|
* the backend did not say — which is NOT the same as in stock, and must not
|
|
@@ -5191,10 +5258,10 @@ var ProductVariantSchema = z44.object({
|
|
|
5191
5258
|
availabilityStatus: AvailabilityStatusSchema.optional(),
|
|
5192
5259
|
price: MoneySchema,
|
|
5193
5260
|
compareAtPrice: MoneySchema.optional(),
|
|
5194
|
-
selectedOptions:
|
|
5261
|
+
selectedOptions: z45.array(SelectedOptionSchema).optional(),
|
|
5195
5262
|
image: ImageSchema.optional(),
|
|
5196
5263
|
/** The merchant's stock-keeping code. Absent when the backend has none. */
|
|
5197
|
-
sku:
|
|
5264
|
+
sku: z45.string().optional()
|
|
5198
5265
|
});
|
|
5199
5266
|
var MP4_MIME = "video/mp4";
|
|
5200
5267
|
var HLS_MIME = "application/x-mpegURL";
|
|
@@ -5204,34 +5271,34 @@ function orderedVideoSources(video) {
|
|
|
5204
5271
|
const hls = video.sources.filter((s) => s.mimeType === HLS_MIME);
|
|
5205
5272
|
return [...mp4, ...hls];
|
|
5206
5273
|
}
|
|
5207
|
-
var SiblingProductSchema =
|
|
5208
|
-
id:
|
|
5209
|
-
handle:
|
|
5210
|
-
title:
|
|
5274
|
+
var SiblingProductSchema = z45.object({
|
|
5275
|
+
id: z45.string(),
|
|
5276
|
+
handle: z45.string(),
|
|
5277
|
+
title: z45.string(),
|
|
5211
5278
|
/** The differentiating value across siblings — typically the color
|
|
5212
5279
|
* label ("OLIVE", "STONE"). Rendered next to the swatch row. */
|
|
5213
|
-
color:
|
|
5280
|
+
color: z45.string(),
|
|
5214
5281
|
/** Swatch artwork. Hydrators populate from the sibling product's
|
|
5215
5282
|
* first image; renderers crop / fit to the swatch tile. */
|
|
5216
5283
|
swatchImage: ImageSchema.optional(),
|
|
5217
|
-
available:
|
|
5284
|
+
available: z45.boolean().default(true),
|
|
5218
5285
|
/** Marks the sibling that IS the currently-rendered product. The
|
|
5219
5286
|
* picker uses this to highlight the active swatch without an
|
|
5220
5287
|
* external id comparison. */
|
|
5221
|
-
current:
|
|
5288
|
+
current: z45.boolean().default(false)
|
|
5222
5289
|
});
|
|
5223
|
-
var ProductSchema =
|
|
5224
|
-
id:
|
|
5225
|
-
handle:
|
|
5226
|
-
title:
|
|
5227
|
-
description:
|
|
5228
|
-
descriptionHtml:
|
|
5229
|
-
vendor:
|
|
5230
|
-
productType:
|
|
5231
|
-
tags:
|
|
5290
|
+
var ProductSchema = z45.object({
|
|
5291
|
+
id: z45.string(),
|
|
5292
|
+
handle: z45.string().default(""),
|
|
5293
|
+
title: z45.string(),
|
|
5294
|
+
description: z45.string().default(""),
|
|
5295
|
+
descriptionHtml: z45.string().optional(),
|
|
5296
|
+
vendor: z45.string().default(""),
|
|
5297
|
+
productType: z45.string().optional(),
|
|
5298
|
+
tags: z45.array(z45.string()).default([]),
|
|
5232
5299
|
price: MoneySchema.default({ amount: 0, currencyCode: "USD" }),
|
|
5233
5300
|
compareAtPrice: MoneySchema.optional(),
|
|
5234
|
-
images:
|
|
5301
|
+
images: z45.array(ImageSchema).default([]),
|
|
5235
5302
|
/**
|
|
5236
5303
|
* Product videos (`Video` + `ExternalVideo` media). Shopify's MCP
|
|
5237
5304
|
* catalog drops video media — it only surfaces through the Storefront
|
|
@@ -5239,21 +5306,21 @@ var ProductSchema = z44.object({
|
|
|
5239
5306
|
* boundary. Default `[]` so renderers gate on `length > 0` without a
|
|
5240
5307
|
* presence guard.
|
|
5241
5308
|
*/
|
|
5242
|
-
videos:
|
|
5243
|
-
variants:
|
|
5244
|
-
availableForSale:
|
|
5245
|
-
options:
|
|
5246
|
-
name:
|
|
5247
|
-
values:
|
|
5309
|
+
videos: z45.array(ProductVideoSchema).default([]),
|
|
5310
|
+
variants: z45.array(ProductVariantSchema).default([]),
|
|
5311
|
+
availableForSale: z45.boolean().default(true),
|
|
5312
|
+
options: z45.array(z45.object({
|
|
5313
|
+
name: z45.string(),
|
|
5314
|
+
values: z45.array(z45.string())
|
|
5248
5315
|
})).optional(),
|
|
5249
|
-
collections:
|
|
5316
|
+
collections: z45.array(z45.string()).optional(),
|
|
5250
5317
|
/** See `SiblingProductSchema`. Default `[]` so renderers can check
|
|
5251
5318
|
* `length > 1` to decide whether to draw the swatch row without a
|
|
5252
5319
|
* presence guard. */
|
|
5253
|
-
colorVariants:
|
|
5254
|
-
rating:
|
|
5255
|
-
value:
|
|
5256
|
-
count:
|
|
5320
|
+
colorVariants: z45.array(SiblingProductSchema).default([]),
|
|
5321
|
+
rating: z45.object({
|
|
5322
|
+
value: z45.number(),
|
|
5323
|
+
count: z45.number()
|
|
5257
5324
|
}).optional(),
|
|
5258
5325
|
/**
|
|
5259
5326
|
* Product reviews surfaced from the brand's review store. SDK
|
|
@@ -5262,12 +5329,12 @@ var ProductSchema = z44.object({
|
|
|
5262
5329
|
* review bodies. Renderers (`Reviews` component, `ProductDetail`,
|
|
5263
5330
|
* etc.) consume directly.
|
|
5264
5331
|
*/
|
|
5265
|
-
reviews:
|
|
5266
|
-
author:
|
|
5267
|
-
rating:
|
|
5268
|
-
content:
|
|
5269
|
-
date:
|
|
5270
|
-
verified:
|
|
5332
|
+
reviews: z45.array(z45.object({
|
|
5333
|
+
author: z45.string(),
|
|
5334
|
+
rating: z45.number(),
|
|
5335
|
+
content: z45.string(),
|
|
5336
|
+
date: z45.string(),
|
|
5337
|
+
verified: z45.boolean().optional()
|
|
5271
5338
|
})).optional(),
|
|
5272
5339
|
/**
|
|
5273
5340
|
* Ghost-entity flag — `true` when the Storefront API could not hydrate
|
|
@@ -5279,7 +5346,7 @@ var ProductSchema = z44.object({
|
|
|
5279
5346
|
* Set exclusively by `createUnavailableProduct()` — never by the
|
|
5280
5347
|
* Storefront mapper.
|
|
5281
5348
|
*/
|
|
5282
|
-
unavailable:
|
|
5349
|
+
unavailable: z45.boolean().default(false)
|
|
5283
5350
|
});
|
|
5284
5351
|
function createUnavailableProduct(gid) {
|
|
5285
5352
|
return {
|
|
@@ -5301,68 +5368,68 @@ function createUnavailableProduct(gid) {
|
|
|
5301
5368
|
function isGhostEntity(value) {
|
|
5302
5369
|
return typeof value === "object" && value !== null && "unavailable" in value && value.unavailable === true;
|
|
5303
5370
|
}
|
|
5304
|
-
var ReviewSchema =
|
|
5305
|
-
id:
|
|
5306
|
-
productId:
|
|
5307
|
-
author:
|
|
5308
|
-
rating:
|
|
5309
|
-
text:
|
|
5310
|
-
date:
|
|
5311
|
-
verified:
|
|
5371
|
+
var ReviewSchema = z45.object({
|
|
5372
|
+
id: z45.string(),
|
|
5373
|
+
productId: z45.string(),
|
|
5374
|
+
author: z45.string(),
|
|
5375
|
+
rating: z45.number(),
|
|
5376
|
+
text: z45.string(),
|
|
5377
|
+
date: z45.string(),
|
|
5378
|
+
verified: z45.boolean()
|
|
5312
5379
|
});
|
|
5313
|
-
var ArticleSchema =
|
|
5314
|
-
id:
|
|
5315
|
-
handle:
|
|
5316
|
-
title:
|
|
5317
|
-
excerpt:
|
|
5318
|
-
content:
|
|
5319
|
-
contentHtml:
|
|
5320
|
-
author:
|
|
5321
|
-
publishedAt:
|
|
5380
|
+
var ArticleSchema = z45.object({
|
|
5381
|
+
id: z45.string(),
|
|
5382
|
+
handle: z45.string().default(""),
|
|
5383
|
+
title: z45.string(),
|
|
5384
|
+
excerpt: z45.string().default(""),
|
|
5385
|
+
content: z45.string().default(""),
|
|
5386
|
+
contentHtml: z45.string().optional(),
|
|
5387
|
+
author: z45.string().default(""),
|
|
5388
|
+
publishedAt: z45.string().default(""),
|
|
5322
5389
|
image: ImageSchema.optional(),
|
|
5323
|
-
blogHandle:
|
|
5324
|
-
tags:
|
|
5390
|
+
blogHandle: z45.string().default(""),
|
|
5391
|
+
tags: z45.array(z45.string()).default([])
|
|
5325
5392
|
});
|
|
5326
|
-
var CmsPageSchema =
|
|
5327
|
-
id:
|
|
5328
|
-
handle:
|
|
5329
|
-
title:
|
|
5330
|
-
body:
|
|
5331
|
-
bodyHtml:
|
|
5332
|
-
bodySummary:
|
|
5333
|
-
updatedAt:
|
|
5334
|
-
seoTitle:
|
|
5335
|
-
seoDescription:
|
|
5393
|
+
var CmsPageSchema = z45.object({
|
|
5394
|
+
id: z45.string(),
|
|
5395
|
+
handle: z45.string().default(""),
|
|
5396
|
+
title: z45.string(),
|
|
5397
|
+
body: z45.string().default(""),
|
|
5398
|
+
bodyHtml: z45.string().optional(),
|
|
5399
|
+
bodySummary: z45.string().default(""),
|
|
5400
|
+
updatedAt: z45.string().default(""),
|
|
5401
|
+
seoTitle: z45.string().optional(),
|
|
5402
|
+
seoDescription: z45.string().optional()
|
|
5336
5403
|
});
|
|
5337
|
-
var CmsPolicySchema =
|
|
5338
|
-
id:
|
|
5404
|
+
var CmsPolicySchema = z45.object({
|
|
5405
|
+
id: z45.string(),
|
|
5339
5406
|
/** Stable policy slot identifier: 'refund' | 'privacy' | 'terms' |
|
|
5340
5407
|
* 'shipping' | 'subscription' | 'warranty' | custom string. Open so
|
|
5341
5408
|
* platforms with custom policy types can extend. */
|
|
5342
|
-
kind:
|
|
5409
|
+
kind: z45.string(),
|
|
5343
5410
|
/** Slug-shaped handle the platform exposes for storefront URLs
|
|
5344
5411
|
* (e.g. `refund-policy`). Empty string when the backend doesn't
|
|
5345
5412
|
* surface one. */
|
|
5346
|
-
handle:
|
|
5347
|
-
title:
|
|
5348
|
-
body:
|
|
5349
|
-
bodyHtml:
|
|
5350
|
-
url:
|
|
5413
|
+
handle: z45.string().default(""),
|
|
5414
|
+
title: z45.string(),
|
|
5415
|
+
body: z45.string().default(""),
|
|
5416
|
+
bodyHtml: z45.string().optional(),
|
|
5417
|
+
url: z45.string().default("")
|
|
5351
5418
|
});
|
|
5352
|
-
var CollectionSchema =
|
|
5353
|
-
id:
|
|
5354
|
-
handle:
|
|
5355
|
-
title:
|
|
5356
|
-
description:
|
|
5419
|
+
var CollectionSchema = z45.object({
|
|
5420
|
+
id: z45.string(),
|
|
5421
|
+
handle: z45.string().default(""),
|
|
5422
|
+
title: z45.string(),
|
|
5423
|
+
description: z45.string().default(""),
|
|
5357
5424
|
image: ImageSchema.optional(),
|
|
5358
|
-
productCount:
|
|
5425
|
+
productCount: z45.number().int().nonnegative().optional()
|
|
5359
5426
|
});
|
|
5360
|
-
var CartLineSchema =
|
|
5361
|
-
id:
|
|
5362
|
-
merchandiseId:
|
|
5363
|
-
productId:
|
|
5364
|
-
title:
|
|
5365
|
-
variantTitle:
|
|
5427
|
+
var CartLineSchema = z45.object({
|
|
5428
|
+
id: z45.string(),
|
|
5429
|
+
merchandiseId: z45.string(),
|
|
5430
|
+
productId: z45.string(),
|
|
5431
|
+
title: z45.string(),
|
|
5432
|
+
variantTitle: z45.string().optional(),
|
|
5366
5433
|
/**
|
|
5367
5434
|
* The variant's option axes as structured pairs (e.g.
|
|
5368
5435
|
* `[{name:'Size', value:'7'}]`). The machine-readable counterpart of
|
|
@@ -5371,10 +5438,10 @@ var CartLineSchema = z44.object({
|
|
|
5371
5438
|
* single-variant products (the degenerate `Title: Default Title` axis
|
|
5372
5439
|
* is normalized away at the adapter boundary).
|
|
5373
5440
|
*/
|
|
5374
|
-
selectedOptions:
|
|
5375
|
-
vendor:
|
|
5376
|
-
sku:
|
|
5377
|
-
quantity:
|
|
5441
|
+
selectedOptions: z45.array(SelectedOptionSchema).optional(),
|
|
5442
|
+
vendor: z45.string().optional(),
|
|
5443
|
+
sku: z45.string().optional(),
|
|
5444
|
+
quantity: z45.number().int().positive(),
|
|
5378
5445
|
unitPrice: MoneySchema,
|
|
5379
5446
|
totalPrice: MoneySchema,
|
|
5380
5447
|
image: ImageSchema.optional(),
|
|
@@ -5394,26 +5461,26 @@ var CartLineSchema = z44.object({
|
|
|
5394
5461
|
* client-minted id the backend rejects, line-tap navigation is
|
|
5395
5462
|
* suppressed, and the money never folds into a settled-looking total.
|
|
5396
5463
|
*/
|
|
5397
|
-
pending:
|
|
5464
|
+
pending: z45.boolean().optional()
|
|
5398
5465
|
});
|
|
5399
5466
|
function isPendingCartLine(line) {
|
|
5400
5467
|
return line.pending === true;
|
|
5401
5468
|
}
|
|
5402
|
-
var CartDiscountCodeSchema =
|
|
5403
|
-
code:
|
|
5404
|
-
applicable:
|
|
5469
|
+
var CartDiscountCodeSchema = z45.object({
|
|
5470
|
+
code: z45.string(),
|
|
5471
|
+
applicable: z45.boolean()
|
|
5405
5472
|
});
|
|
5406
|
-
var CartMessageSchema =
|
|
5407
|
-
kind:
|
|
5473
|
+
var CartMessageSchema = z45.object({
|
|
5474
|
+
kind: z45.enum(["error", "warning", "info"]),
|
|
5408
5475
|
/** Machine code for branching; opaque and backend-defined. */
|
|
5409
|
-
code:
|
|
5476
|
+
code: z45.string(),
|
|
5410
5477
|
/** Human-readable text, meant to be shown as-is. */
|
|
5411
|
-
content:
|
|
5478
|
+
content: z45.string()
|
|
5412
5479
|
});
|
|
5413
|
-
var CartSchema =
|
|
5414
|
-
id:
|
|
5415
|
-
lines:
|
|
5416
|
-
totalQuantity:
|
|
5480
|
+
var CartSchema = z45.object({
|
|
5481
|
+
id: z45.string(),
|
|
5482
|
+
lines: z45.array(CartLineSchema),
|
|
5483
|
+
totalQuantity: z45.number().int().nonnegative(),
|
|
5417
5484
|
subtotal: MoneySchema,
|
|
5418
5485
|
/**
|
|
5419
5486
|
* Cart total after discounts (pre-shipping/tax). Absent when the
|
|
@@ -5423,11 +5490,11 @@ var CartSchema = z44.object({
|
|
|
5423
5490
|
*/
|
|
5424
5491
|
total: MoneySchema.optional(),
|
|
5425
5492
|
/** Discount codes currently attached to the cart. */
|
|
5426
|
-
discountCodes:
|
|
5493
|
+
discountCodes: z45.array(CartDiscountCodeSchema).default([]),
|
|
5427
5494
|
/** Notices the backend attached to this cart — see `CartMessageSchema`.
|
|
5428
5495
|
* Empty when the backend said nothing or does not report them. */
|
|
5429
|
-
messages:
|
|
5430
|
-
checkoutUrl:
|
|
5496
|
+
messages: z45.array(CartMessageSchema).default([]),
|
|
5497
|
+
checkoutUrl: z45.string().optional(),
|
|
5431
5498
|
/**
|
|
5432
5499
|
* Opaque handle this cart is known by in the connector's BACK OFFICE — the
|
|
5433
5500
|
* value a space owner searches there to find the order this cart became.
|
|
@@ -5440,14 +5507,14 @@ var CartSchema = z44.object({
|
|
|
5440
5507
|
* Absent when the platform has no such handle, or while the cart is still the
|
|
5441
5508
|
* client's optimistic paint and its id is client-minted.
|
|
5442
5509
|
*/
|
|
5443
|
-
backOfficeRef:
|
|
5510
|
+
backOfficeRef: z45.string().optional(),
|
|
5444
5511
|
/**
|
|
5445
5512
|
* URL that recreates this cart on the merchant's own store website
|
|
5446
5513
|
* (replace semantics — overwrites any cart the visitor already has
|
|
5447
5514
|
* there). Populated by platform adapters that support it; absent when
|
|
5448
5515
|
* the cart is empty or the URL cannot be built.
|
|
5449
5516
|
*/
|
|
5450
|
-
storeCartUrl:
|
|
5517
|
+
storeCartUrl: z45.string().optional(),
|
|
5451
5518
|
/**
|
|
5452
5519
|
* True while this cart exists only in the client's optimistic paint —
|
|
5453
5520
|
* no backend cart has been created yet, so its `id` is client-minted and
|
|
@@ -5455,7 +5522,7 @@ var CartSchema = z44.object({
|
|
|
5455
5522
|
* `CartLineSchema.pending`: the adapter never sets it, and callers that
|
|
5456
5523
|
* need a real cart id read THIS rather than sniffing the id's shape.
|
|
5457
5524
|
*/
|
|
5458
|
-
pending:
|
|
5525
|
+
pending: z45.boolean().optional()
|
|
5459
5526
|
});
|
|
5460
5527
|
function settledCart(cart) {
|
|
5461
5528
|
if (cart === null || cart === void 0) return null;
|
|
@@ -5463,27 +5530,27 @@ function settledCart(cart) {
|
|
|
5463
5530
|
}
|
|
5464
5531
|
|
|
5465
5532
|
// ../ecommerce/src/review-schemas.ts
|
|
5466
|
-
import { z as
|
|
5533
|
+
import { z as z46 } from "zod";
|
|
5467
5534
|
var PRODUCT_REVIEWS_RESOLVER_KEY = "productReviews";
|
|
5468
|
-
var ProductReviewItemSchema =
|
|
5469
|
-
author:
|
|
5470
|
-
rating:
|
|
5535
|
+
var ProductReviewItemSchema = z46.object({
|
|
5536
|
+
author: z46.string(),
|
|
5537
|
+
rating: z46.number(),
|
|
5471
5538
|
/** The reviewer's own headline ("love"), when they wrote one — the site shows it above `content`. */
|
|
5472
|
-
title:
|
|
5473
|
-
content:
|
|
5474
|
-
date:
|
|
5475
|
-
verified:
|
|
5539
|
+
title: z46.string().optional(),
|
|
5540
|
+
content: z46.string(),
|
|
5541
|
+
date: z46.string(),
|
|
5542
|
+
verified: z46.boolean().optional(),
|
|
5476
5543
|
/**
|
|
5477
5544
|
* Non-empty when the review was written for a grouped SIBLING product rather
|
|
5478
5545
|
* than this one (brands pool reviews across a product line). A surface can
|
|
5479
5546
|
* attribute it; empty / absent ⇒ the product's own review.
|
|
5480
5547
|
*/
|
|
5481
|
-
writtenFor:
|
|
5548
|
+
writtenFor: z46.string().optional()
|
|
5482
5549
|
});
|
|
5483
5550
|
var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
5484
5551
|
/** The sentence(s) the ranking fired on. Descriptive — it is what the matcher
|
|
5485
5552
|
* scored, NOT necessarily text that occurs in `content`. */
|
|
5486
|
-
highlight:
|
|
5553
|
+
highlight: z46.string().optional(),
|
|
5487
5554
|
/**
|
|
5488
5555
|
* `highlight` resolved back into `content` as a VERBATIM substring, so a
|
|
5489
5556
|
* surface can mark it with a plain `indexOf` and no matcher of its own.
|
|
@@ -5498,29 +5565,29 @@ var ProductReviewHighlightSchema = ProductReviewItemSchema.extend({
|
|
|
5498
5565
|
* Absent when the passage genuinely has no home in the body (one cut from the
|
|
5499
5566
|
* title). A surface then marks NOTHING rather than guessing at a span.
|
|
5500
5567
|
*/
|
|
5501
|
-
mark:
|
|
5568
|
+
mark: z46.string().optional()
|
|
5502
5569
|
});
|
|
5503
|
-
var ReviewAggregateSchema =
|
|
5504
|
-
value:
|
|
5505
|
-
count:
|
|
5570
|
+
var ReviewAggregateSchema = z46.object({
|
|
5571
|
+
value: z46.number(),
|
|
5572
|
+
count: z46.number()
|
|
5506
5573
|
});
|
|
5507
|
-
var ProductReviewDataSchema =
|
|
5508
|
-
id:
|
|
5574
|
+
var ProductReviewDataSchema = z46.object({
|
|
5575
|
+
id: z46.string(),
|
|
5509
5576
|
/** The product's FULL retrieved set — what a filterable list renders. */
|
|
5510
|
-
reviews:
|
|
5577
|
+
reviews: z46.array(ProductReviewItemSchema).default([]),
|
|
5511
5578
|
aggregate: ReviewAggregateSchema.default({ value: 0, count: 0 }),
|
|
5512
5579
|
/** 5★→1★ star COUNTS over the full set (index 0 = 5-star). */
|
|
5513
|
-
distribution:
|
|
5580
|
+
distribution: z46.array(z46.number()).default([]),
|
|
5514
5581
|
/**
|
|
5515
5582
|
* The reviews that ANSWER the surface's intent, best first. Empty when no
|
|
5516
5583
|
* intent was asked for — never a silent copy of `reviews`.
|
|
5517
5584
|
*/
|
|
5518
|
-
highlights:
|
|
5585
|
+
highlights: z46.array(ProductReviewHighlightSchema).default([]),
|
|
5519
5586
|
/**
|
|
5520
5587
|
* True when the review provider could not be read and nothing is indexed —
|
|
5521
5588
|
* the empty lists mean "not loaded", NOT "this product has no reviews".
|
|
5522
5589
|
*/
|
|
5523
|
-
unavailable:
|
|
5590
|
+
unavailable: z46.boolean().optional()
|
|
5524
5591
|
});
|
|
5525
5592
|
var ProductReviewPayloadSchema = ProductReviewDataSchema.omit({ id: true });
|
|
5526
5593
|
|
|
@@ -5814,9 +5881,9 @@ function readPdpCompanions(config) {
|
|
|
5814
5881
|
}
|
|
5815
5882
|
|
|
5816
5883
|
// ../ecommerce/src/base-attributes.ts
|
|
5817
|
-
import { z as
|
|
5884
|
+
import { z as z47 } from "zod";
|
|
5818
5885
|
var BASE_ATTRIBUTES_CONFIG_KEY = "baseAttributes";
|
|
5819
|
-
var BaseAttributesRecordSchema =
|
|
5886
|
+
var BaseAttributesRecordSchema = z47.record(z47.string(), AttributeDefSchema);
|
|
5820
5887
|
function buildBaseAttributesConfig(attributes) {
|
|
5821
5888
|
return { [BASE_ATTRIBUTES_CONFIG_KEY]: attributes };
|
|
5822
5889
|
}
|
|
@@ -5827,9 +5894,9 @@ function readBaseAttributesConfig(config) {
|
|
|
5827
5894
|
}
|
|
5828
5895
|
|
|
5829
5896
|
// ../ecommerce/src/bucket-labels.ts
|
|
5830
|
-
import { z as
|
|
5897
|
+
import { z as z48 } from "zod";
|
|
5831
5898
|
var BUCKET_LABELS_CONFIG_KEY = "bucketLabels";
|
|
5832
|
-
var BucketLabelsRecordSchema =
|
|
5899
|
+
var BucketLabelsRecordSchema = z48.record(z48.string(), z48.string());
|
|
5833
5900
|
function buildBucketLabelsConfig(labels) {
|
|
5834
5901
|
return { [BUCKET_LABELS_CONFIG_KEY]: labels };
|
|
5835
5902
|
}
|
|
@@ -5855,20 +5922,68 @@ function clearProductNameLookups() {
|
|
|
5855
5922
|
factories.length = 0;
|
|
5856
5923
|
}
|
|
5857
5924
|
|
|
5858
|
-
// ../ecommerce/src/
|
|
5925
|
+
// ../ecommerce/src/store-articles.ts
|
|
5859
5926
|
var factories2 = [];
|
|
5860
|
-
function
|
|
5927
|
+
function registerStoreArticleLookup(factory) {
|
|
5861
5928
|
factories2.push(factory);
|
|
5862
5929
|
}
|
|
5863
|
-
function
|
|
5930
|
+
function resolveStoreArticleLookup(platformConfig) {
|
|
5864
5931
|
for (const factory of factories2) {
|
|
5932
|
+
const lookup = factory(platformConfig);
|
|
5933
|
+
if (lookup !== void 0) return lookup;
|
|
5934
|
+
}
|
|
5935
|
+
return void 0;
|
|
5936
|
+
}
|
|
5937
|
+
function clearStoreArticleLookups() {
|
|
5938
|
+
factories2.length = 0;
|
|
5939
|
+
}
|
|
5940
|
+
|
|
5941
|
+
// ../ecommerce/src/catalog-search.ts
|
|
5942
|
+
var factories3 = [];
|
|
5943
|
+
function registerCatalogSearch(factory) {
|
|
5944
|
+
factories3.push(factory);
|
|
5945
|
+
}
|
|
5946
|
+
function resolveCatalogSearch(platformConfig) {
|
|
5947
|
+
for (const factory of factories3) {
|
|
5948
|
+
const search = factory(platformConfig);
|
|
5949
|
+
if (search !== void 0) return search;
|
|
5950
|
+
}
|
|
5951
|
+
return void 0;
|
|
5952
|
+
}
|
|
5953
|
+
function clearCatalogSearches() {
|
|
5954
|
+
factories3.length = 0;
|
|
5955
|
+
}
|
|
5956
|
+
|
|
5957
|
+
// ../ecommerce/src/shop-checkout.ts
|
|
5958
|
+
var factories4 = [];
|
|
5959
|
+
function registerShopCheckout(factory) {
|
|
5960
|
+
factories4.push(factory);
|
|
5961
|
+
}
|
|
5962
|
+
function resolveShopCheckout(platformConfig) {
|
|
5963
|
+
for (const factory of factories4) {
|
|
5964
|
+
const maker = factory(platformConfig);
|
|
5965
|
+
if (maker !== void 0) return maker;
|
|
5966
|
+
}
|
|
5967
|
+
return void 0;
|
|
5968
|
+
}
|
|
5969
|
+
function clearShopCheckouts() {
|
|
5970
|
+
factories4.length = 0;
|
|
5971
|
+
}
|
|
5972
|
+
|
|
5973
|
+
// ../ecommerce/src/code-discounts.ts
|
|
5974
|
+
var factories5 = [];
|
|
5975
|
+
function registerCodeDiscountSource(factory) {
|
|
5976
|
+
factories5.push(factory);
|
|
5977
|
+
}
|
|
5978
|
+
function resolveCodeDiscountSource(options) {
|
|
5979
|
+
for (const factory of factories5) {
|
|
5865
5980
|
const source = factory(options);
|
|
5866
5981
|
if (source !== void 0) return source;
|
|
5867
5982
|
}
|
|
5868
5983
|
return void 0;
|
|
5869
5984
|
}
|
|
5870
5985
|
function clearCodeDiscountSources() {
|
|
5871
|
-
|
|
5986
|
+
factories5.length = 0;
|
|
5872
5987
|
}
|
|
5873
5988
|
|
|
5874
5989
|
// ../ecommerce/src/store-theme.ts
|
|
@@ -5878,19 +5993,19 @@ var StoreThemeAccessError = class extends Error {
|
|
|
5878
5993
|
this.name = "StoreThemeAccessError";
|
|
5879
5994
|
}
|
|
5880
5995
|
};
|
|
5881
|
-
var
|
|
5996
|
+
var factories6 = [];
|
|
5882
5997
|
function registerStoreThemeSource(factory) {
|
|
5883
|
-
|
|
5998
|
+
factories6.push(factory);
|
|
5884
5999
|
}
|
|
5885
6000
|
function resolveStoreThemeSource(options) {
|
|
5886
|
-
for (const factory of
|
|
6001
|
+
for (const factory of factories6) {
|
|
5887
6002
|
const source = factory(options);
|
|
5888
6003
|
if (source !== void 0) return source;
|
|
5889
6004
|
}
|
|
5890
6005
|
return void 0;
|
|
5891
6006
|
}
|
|
5892
6007
|
function clearStoreThemeSources() {
|
|
5893
|
-
|
|
6008
|
+
factories6.length = 0;
|
|
5894
6009
|
}
|
|
5895
6010
|
|
|
5896
6011
|
// ../ecommerce/src/installment-offer.ts
|
|
@@ -5992,6 +6107,7 @@ __export(shell_exports, {
|
|
|
5992
6107
|
splitAnswer: () => splitAnswer,
|
|
5993
6108
|
takeSubmitOrigin: () => takeSubmitOrigin,
|
|
5994
6109
|
threadRowAttrs: () => threadRowAttrs,
|
|
6110
|
+
useAskAbout: () => useAskAbout,
|
|
5995
6111
|
useBotCheckNotice: () => useBotCheckNotice,
|
|
5996
6112
|
useComposerAttachments: () => useComposerAttachments,
|
|
5997
6113
|
useComposerChipSelect: () => useComposerChipSelect,
|
|
@@ -6836,11 +6952,28 @@ function useComposerChipSelect() {
|
|
|
6836
6952
|
);
|
|
6837
6953
|
}
|
|
6838
6954
|
|
|
6839
|
-
// src/shell/use-
|
|
6955
|
+
// src/shell/use-ask-about.ts
|
|
6840
6956
|
import * as React13 from "react";
|
|
6841
|
-
function
|
|
6957
|
+
function useAskAbout() {
|
|
6842
6958
|
const session = useFourtySession();
|
|
6843
6959
|
return React13.useCallback(
|
|
6960
|
+
(text2, about) => {
|
|
6961
|
+
session.dispatchSuggestionAction({
|
|
6962
|
+
id: `about-${about.field}-${text2}`,
|
|
6963
|
+
label: text2,
|
|
6964
|
+
type: "message",
|
|
6965
|
+
payload: { text: text2, about, followUp: true }
|
|
6966
|
+
});
|
|
6967
|
+
},
|
|
6968
|
+
[session]
|
|
6969
|
+
);
|
|
6970
|
+
}
|
|
6971
|
+
|
|
6972
|
+
// src/shell/use-turn-ask-reply.ts
|
|
6973
|
+
import * as React14 from "react";
|
|
6974
|
+
function useTurnAskReply() {
|
|
6975
|
+
const session = useFourtySession();
|
|
6976
|
+
return React14.useCallback(
|
|
6844
6977
|
(answer) => {
|
|
6845
6978
|
session.dispatchSuggestionAction({ id: `ask-${answer}`, label: answer, type: "message", payload: { text: answer, followUp: true } });
|
|
6846
6979
|
},
|
|
@@ -6849,14 +6982,14 @@ function useTurnAskReply() {
|
|
|
6849
6982
|
}
|
|
6850
6983
|
|
|
6851
6984
|
// src/shell/turn-ask-placement.tsx
|
|
6852
|
-
import * as
|
|
6985
|
+
import * as React15 from "react";
|
|
6853
6986
|
import { jsx as jsx6 } from "react/jsx-runtime";
|
|
6854
|
-
var TurnAskPlacementContext =
|
|
6987
|
+
var TurnAskPlacementContext = React15.createContext("prose");
|
|
6855
6988
|
function TurnAskPlacementProvider({ placement, children }) {
|
|
6856
6989
|
return /* @__PURE__ */ jsx6(TurnAskPlacementContext.Provider, { value: placement, children });
|
|
6857
6990
|
}
|
|
6858
6991
|
function useTurnAskPlacement() {
|
|
6859
|
-
return
|
|
6992
|
+
return React15.useContext(TurnAskPlacementContext);
|
|
6860
6993
|
}
|
|
6861
6994
|
|
|
6862
6995
|
// src/shell/use-go-home.ts
|
|
@@ -6873,10 +7006,10 @@ function useGoHome() {
|
|
|
6873
7006
|
}
|
|
6874
7007
|
|
|
6875
7008
|
// src/shell/use-menu-item-select.ts
|
|
6876
|
-
import * as
|
|
7009
|
+
import * as React16 from "react";
|
|
6877
7010
|
function useMenuItemSelect() {
|
|
6878
7011
|
const session = useFourtySession();
|
|
6879
|
-
return
|
|
7012
|
+
return React16.useCallback(
|
|
6880
7013
|
(item) => {
|
|
6881
7014
|
const payload = item.action.payload === void 0 ? {} : item.action.payload;
|
|
6882
7015
|
session.dispatchSuggestionAction({
|
|
@@ -6929,15 +7062,15 @@ function useThreadRows() {
|
|
|
6929
7062
|
}
|
|
6930
7063
|
|
|
6931
7064
|
// src/shell/conversation/use-conversation-page.ts
|
|
6932
|
-
import * as
|
|
7065
|
+
import * as React20 from "react";
|
|
6933
7066
|
|
|
6934
7067
|
// src/canvas/use-is-seed-home.ts
|
|
6935
|
-
import * as
|
|
7068
|
+
import * as React17 from "react";
|
|
6936
7069
|
function useIsSeedHome() {
|
|
6937
7070
|
const layout = useDisplayedLayout();
|
|
6938
7071
|
const turn = useTurn();
|
|
6939
7072
|
const sessionState = useSessionState();
|
|
6940
|
-
return
|
|
7073
|
+
return React17.useMemo(() => {
|
|
6941
7074
|
if (sessionState.seedLayout === null) return false;
|
|
6942
7075
|
if (turn.index !== 0) return false;
|
|
6943
7076
|
if (turn.userMessage !== "") return false;
|
|
@@ -7180,8 +7313,8 @@ var PRESENCE_LIFECYCLE = {
|
|
|
7180
7313
|
};
|
|
7181
7314
|
|
|
7182
7315
|
// ../spacestation/src/widgets/presence/profile.ts
|
|
7183
|
-
import { z as
|
|
7184
|
-
var PresenceProfileSchema =
|
|
7316
|
+
import { z as z49 } from "zod";
|
|
7317
|
+
var PresenceProfileSchema = z49.object({
|
|
7185
7318
|
/**
|
|
7186
7319
|
* How much the agent SPEAKS in presence.
|
|
7187
7320
|
* - 'off' the faculty generates no prose at all. Zero tokens, and
|
|
@@ -7191,14 +7324,14 @@ var PresenceProfileSchema = z48.object({
|
|
|
7191
7324
|
* - 'terse' one lead line per turn. The default — see below.
|
|
7192
7325
|
* - 'full' a lead line plus asides beside individual elements.
|
|
7193
7326
|
*/
|
|
7194
|
-
voice:
|
|
7327
|
+
voice: z49.enum(["off", "terse", "full"]),
|
|
7195
7328
|
/**
|
|
7196
7329
|
* Which source kinds this space surfaces. 'all' = every tool that declares a
|
|
7197
7330
|
* `sourceKind`. An explicit list lets a space stay quiet about lookups its
|
|
7198
7331
|
* visitors would find uninteresting (policy checks on a fashion space)
|
|
7199
7332
|
* without the tool having to lie about what it is.
|
|
7200
7333
|
*/
|
|
7201
|
-
sources:
|
|
7334
|
+
sources: z49.union([z49.array(z49.string()), z49.literal("all")]),
|
|
7202
7335
|
/**
|
|
7203
7336
|
* Which facts render.
|
|
7204
7337
|
* - 'inferred-only' hides `provenance: 'stated'` facts. The default and the
|
|
@@ -7207,7 +7340,7 @@ var PresenceProfileSchema = z48.object({
|
|
|
7207
7340
|
* - 'all' shows stated facts too — for spaces where confirming the brief
|
|
7208
7341
|
* back is itself the product (intake, configuration).
|
|
7209
7342
|
*/
|
|
7210
|
-
facts:
|
|
7343
|
+
facts: z49.enum(["inferred-only", "all"])
|
|
7211
7344
|
});
|
|
7212
7345
|
var DEFAULT_PRESENCE_PROFILE = {
|
|
7213
7346
|
voice: "terse",
|
|
@@ -7474,10 +7607,10 @@ function useAgentPresence(flowId = PRESENCE_FLOW) {
|
|
|
7474
7607
|
}
|
|
7475
7608
|
|
|
7476
7609
|
// src/widgets/presence/use-forget-fact.ts
|
|
7477
|
-
import * as
|
|
7610
|
+
import * as React19 from "react";
|
|
7478
7611
|
|
|
7479
7612
|
// src/widgets/presence/use-optimistic-flow-set.ts
|
|
7480
|
-
import * as
|
|
7613
|
+
import * as React18 from "react";
|
|
7481
7614
|
function readKeys(data) {
|
|
7482
7615
|
if (typeof data !== "object" || data === null || !("keys" in data)) return [];
|
|
7483
7616
|
const raw = data.keys;
|
|
@@ -7486,8 +7619,8 @@ function readKeys(data) {
|
|
|
7486
7619
|
function useOptimisticFlowSet(flowId) {
|
|
7487
7620
|
const keys = readKeys(useAgentFlow(flowId));
|
|
7488
7621
|
const joined = keys.join("\0");
|
|
7489
|
-
const set =
|
|
7490
|
-
return
|
|
7622
|
+
const set = React18.useMemo(() => new Set(keys), [joined]);
|
|
7623
|
+
return React18.useMemo(
|
|
7491
7624
|
() => ({
|
|
7492
7625
|
has: (key) => set.has(key),
|
|
7493
7626
|
add: (key) => {
|
|
@@ -7503,7 +7636,7 @@ function useOptimisticFlowSet(flowId) {
|
|
|
7503
7636
|
function useReconcileFlowSet(flowId, presentKeys) {
|
|
7504
7637
|
const data = useAgentFlow(flowId);
|
|
7505
7638
|
const presentJoined = presentKeys === null ? null : [...presentKeys].join("\0");
|
|
7506
|
-
|
|
7639
|
+
React18.useEffect(() => {
|
|
7507
7640
|
if (presentKeys === null) return;
|
|
7508
7641
|
const keys = readKeys(data);
|
|
7509
7642
|
if (keys.length === 0) return;
|
|
@@ -7525,7 +7658,7 @@ var useUndismissedFacts = useVisibleFactList;
|
|
|
7525
7658
|
function useForgetFact() {
|
|
7526
7659
|
const { sendImmediateSignal } = useFourtySession();
|
|
7527
7660
|
const dismissed = useOptimisticFlowSet(DISMISSED_FLOW);
|
|
7528
|
-
const forget =
|
|
7661
|
+
const forget = React19.useCallback(
|
|
7529
7662
|
(f) => {
|
|
7530
7663
|
dismissed.add(f.label);
|
|
7531
7664
|
sendImmediateSignal({ type: PRESENCE_FACT_DISMISS_SIGNAL, payload: { label: f.label, value: f.value } });
|
|
@@ -7576,7 +7709,7 @@ function useConversationPage() {
|
|
|
7576
7709
|
const presence = useConversationPresence();
|
|
7577
7710
|
const suggestions = useSuggestionsWithDefaults();
|
|
7578
7711
|
const followUp = useComposerChipSelect();
|
|
7579
|
-
const onWelcomePage =
|
|
7712
|
+
const onWelcomePage = React20.useMemo(
|
|
7580
7713
|
() => seedLayout !== null && JSON.stringify(layout) === JSON.stringify(seedLayout),
|
|
7581
7714
|
[layout, seedLayout]
|
|
7582
7715
|
);
|
|
@@ -7652,7 +7785,7 @@ function ThreadHeadroom() {
|
|
|
7652
7785
|
}
|
|
7653
7786
|
|
|
7654
7787
|
// src/shell/thread-scroll/use-pin-turn-to-top.ts
|
|
7655
|
-
import * as
|
|
7788
|
+
import * as React21 from "react";
|
|
7656
7789
|
|
|
7657
7790
|
// src/canvas/dom-targets.ts
|
|
7658
7791
|
var ACTIVE_PANEL_ATTR = "data-fourty-panel-active";
|
|
@@ -7676,14 +7809,21 @@ function firstMatch(scroller, selector) {
|
|
|
7676
7809
|
}
|
|
7677
7810
|
return null;
|
|
7678
7811
|
}
|
|
7812
|
+
function elementWrapper(scroller, elementId) {
|
|
7813
|
+
const matches = Array.from(scroller.querySelectorAll(`${ACTIVE_PANEL_SELECTOR} [data-fourty-element="${CSS.escape(elementId)}"]`));
|
|
7814
|
+
for (let i = matches.length - 1; i >= 0; i--) {
|
|
7815
|
+
const match = matches[i];
|
|
7816
|
+
if (match instanceof HTMLElement) return match;
|
|
7817
|
+
}
|
|
7818
|
+
return null;
|
|
7819
|
+
}
|
|
7679
7820
|
function findElementScrollTarget(scroller, elementId) {
|
|
7680
|
-
const
|
|
7681
|
-
const wrapper = firstMatch(scroller, selector);
|
|
7821
|
+
const wrapper = elementWrapper(scroller, elementId);
|
|
7682
7822
|
if (wrapper === null) return null;
|
|
7683
7823
|
return findScrollTarget(wrapper);
|
|
7684
7824
|
}
|
|
7685
7825
|
function findChangeAnchorTarget(scroller, anchor) {
|
|
7686
|
-
const wrapper =
|
|
7826
|
+
const wrapper = elementWrapper(scroller, anchor.elementId);
|
|
7687
7827
|
if (wrapper === null) return null;
|
|
7688
7828
|
const item = findChangeAnchorItem(scroller, anchor);
|
|
7689
7829
|
if (item !== null) return item;
|
|
@@ -7691,7 +7831,7 @@ function findChangeAnchorTarget(scroller, anchor) {
|
|
|
7691
7831
|
}
|
|
7692
7832
|
function findChangeAnchorItem(scroller, anchor) {
|
|
7693
7833
|
if (anchor.refId === void 0) return null;
|
|
7694
|
-
const wrapper =
|
|
7834
|
+
const wrapper = elementWrapper(scroller, anchor.elementId);
|
|
7695
7835
|
if (wrapper === null) return null;
|
|
7696
7836
|
return firstMatch(wrapper, `[data-flip-id="${CSS.escape(anchor.refId)}"]`);
|
|
7697
7837
|
}
|
|
@@ -7829,7 +7969,7 @@ function pinTurnHead(scroller, row, options) {
|
|
|
7829
7969
|
|
|
7830
7970
|
// src/shell/thread-scroll/use-pin-turn-to-top.ts
|
|
7831
7971
|
function usePinTurnToTop({ scrollerRef, turnRef, turnId }) {
|
|
7832
|
-
|
|
7972
|
+
React21.useEffect(() => {
|
|
7833
7973
|
if (turnId === null) return;
|
|
7834
7974
|
const scroller = scrollerRef.current;
|
|
7835
7975
|
const row = turnRef.current;
|
|
@@ -7850,10 +7990,10 @@ function usePinTurnToTop({ scrollerRef, turnRef, turnId }) {
|
|
|
7850
7990
|
}
|
|
7851
7991
|
|
|
7852
7992
|
// src/shell/thread-scroll/use-scroll-has-more-below.ts
|
|
7853
|
-
import * as
|
|
7993
|
+
import * as React22 from "react";
|
|
7854
7994
|
function useScrollHasMoreBelow(scroller, thresholdPx = 16) {
|
|
7855
|
-
const [hasMore, setHasMore] =
|
|
7856
|
-
|
|
7995
|
+
const [hasMore, setHasMore] = React22.useState(false);
|
|
7996
|
+
React22.useEffect(() => {
|
|
7857
7997
|
if (scroller === null) return;
|
|
7858
7998
|
const view = scroller.ownerDocument.defaultView;
|
|
7859
7999
|
if (view === null) return;
|
|
@@ -7893,9 +8033,9 @@ function threadRowAttrs(key) {
|
|
|
7893
8033
|
}
|
|
7894
8034
|
|
|
7895
8035
|
// src/shell/thread-scroll/use-thread-jump-marks.ts
|
|
7896
|
-
import * as
|
|
8036
|
+
import * as React23 from "react";
|
|
7897
8037
|
function useThreadJumpMarks(rows) {
|
|
7898
|
-
return
|
|
8038
|
+
return React23.useMemo(
|
|
7899
8039
|
() => rows.filter((row) => row.visitorText.length > 0).map((row) => ({
|
|
7900
8040
|
key: row.key,
|
|
7901
8041
|
label: row.visitorText,
|
|
@@ -7909,7 +8049,7 @@ function useThreadJumpMarks(rows) {
|
|
|
7909
8049
|
}
|
|
7910
8050
|
|
|
7911
8051
|
// src/shell/thread-scroll/use-thread-landing.ts
|
|
7912
|
-
import * as
|
|
8052
|
+
import * as React24 from "react";
|
|
7913
8053
|
|
|
7914
8054
|
// src/shell/thread-scroll/settle-thread-row.ts
|
|
7915
8055
|
var SETTLE_MS = 1200;
|
|
@@ -7973,11 +8113,11 @@ function settleThreadRow(scroller, rowKey, behavior = "smooth") {
|
|
|
7973
8113
|
}
|
|
7974
8114
|
|
|
7975
8115
|
// src/shell/thread-scroll/use-thread-landing.ts
|
|
7976
|
-
var useIsomorphicLayoutEffect = typeof window === "undefined" ?
|
|
8116
|
+
var useIsomorphicLayoutEffect = typeof window === "undefined" ? React24.useEffect : React24.useLayoutEffect;
|
|
7977
8117
|
function useThreadLanding(scroller, relandKey = 0) {
|
|
7978
8118
|
const { turnId, seq } = useExplicitTurnSelection();
|
|
7979
|
-
const openedWith =
|
|
7980
|
-
const landedRef =
|
|
8119
|
+
const openedWith = React24.useRef({ turnId, seq });
|
|
8120
|
+
const landedRef = React24.useRef(null);
|
|
7981
8121
|
useIsomorphicLayoutEffect(() => {
|
|
7982
8122
|
if (scroller === null) return;
|
|
7983
8123
|
if (turnId !== null) {
|
|
@@ -8032,22 +8172,22 @@ function useRegisterSignalHandlers(handlers) {
|
|
|
8032
8172
|
var AGENT_ASK_SIGNAL = "agent_ask";
|
|
8033
8173
|
|
|
8034
8174
|
// src/provider/use-clamp-toggle.ts
|
|
8035
|
-
import
|
|
8175
|
+
import React25 from "react";
|
|
8036
8176
|
|
|
8037
8177
|
// src/shared/use-expandable.ts
|
|
8038
|
-
import { useCallback as
|
|
8178
|
+
import { useCallback as useCallback11, useState as useState5 } from "react";
|
|
8039
8179
|
function useExpandable(initial = false) {
|
|
8040
8180
|
const [expanded, setExpanded] = useState5(initial);
|
|
8041
|
-
const toggle =
|
|
8181
|
+
const toggle = useCallback11(() => setExpanded((p) => !p), []);
|
|
8042
8182
|
return { expanded, toggle, setExpanded };
|
|
8043
8183
|
}
|
|
8044
8184
|
|
|
8045
8185
|
// src/provider/use-clamp-toggle.ts
|
|
8046
8186
|
function useClampToggle(contentKey) {
|
|
8047
8187
|
const { expanded, toggle } = useExpandable(false);
|
|
8048
|
-
const [overflowing, setOverflowing] =
|
|
8049
|
-
const ref =
|
|
8050
|
-
|
|
8188
|
+
const [overflowing, setOverflowing] = React25.useState(false);
|
|
8189
|
+
const ref = React25.useRef(null);
|
|
8190
|
+
React25.useEffect(() => {
|
|
8051
8191
|
const el = ref.current;
|
|
8052
8192
|
if (el === null) return;
|
|
8053
8193
|
if (expanded) return;
|
|
@@ -8063,16 +8203,16 @@ function useClampToggle(contentKey) {
|
|
|
8063
8203
|
}
|
|
8064
8204
|
|
|
8065
8205
|
// src/provider/use-timed-flag.ts
|
|
8066
|
-
import
|
|
8206
|
+
import React26 from "react";
|
|
8067
8207
|
function useTimedFlag(durationMs) {
|
|
8068
|
-
const [flag, setFlag] =
|
|
8069
|
-
const timerRef =
|
|
8070
|
-
|
|
8208
|
+
const [flag, setFlag] = React26.useState(false);
|
|
8209
|
+
const timerRef = React26.useRef(null);
|
|
8210
|
+
React26.useEffect(() => {
|
|
8071
8211
|
return () => {
|
|
8072
8212
|
if (timerRef.current !== null) window.clearTimeout(timerRef.current);
|
|
8073
8213
|
};
|
|
8074
8214
|
}, []);
|
|
8075
|
-
const trigger =
|
|
8215
|
+
const trigger = React26.useCallback(() => {
|
|
8076
8216
|
if (timerRef.current !== null) window.clearTimeout(timerRef.current);
|
|
8077
8217
|
setFlag(true);
|
|
8078
8218
|
timerRef.current = window.setTimeout(() => {
|
|
@@ -8095,9 +8235,11 @@ __export(canvas_exports, {
|
|
|
8095
8235
|
CanvasOutletProvider: () => CanvasOutletProvider,
|
|
8096
8236
|
CanvasTailMount: () => CanvasTailMount,
|
|
8097
8237
|
CanvasTailProvider: () => CanvasTailProvider,
|
|
8238
|
+
CanvasTurnTailProvider: () => CanvasTurnTailProvider,
|
|
8098
8239
|
DEFAULT_GENERATION_STYLE: () => DEFAULT_GENERATION_STYLE,
|
|
8099
8240
|
DEFAULT_GENERATION_TIMINGS: () => DEFAULT_GENERATION_TIMINGS,
|
|
8100
8241
|
ElementIdContext: () => ElementIdContext,
|
|
8242
|
+
ElementLayoutContext: () => ElementLayoutContext,
|
|
8101
8243
|
FadeTransition: () => FadeTransition,
|
|
8102
8244
|
FourtyRuntimeProvider: () => FourtyRuntimeProvider,
|
|
8103
8245
|
GENERATION_EASE: () => GENERATION_EASE,
|
|
@@ -8108,6 +8250,7 @@ __export(canvas_exports, {
|
|
|
8108
8250
|
ItemTransitionGroup: () => ItemTransitionGroup,
|
|
8109
8251
|
ShimmerSweep: () => ShimmerSweep,
|
|
8110
8252
|
SpacefrontCanvas: () => SpacefrontCanvas,
|
|
8253
|
+
TURN_TAIL_ATTR: () => TURN_TAIL_ATTR,
|
|
8111
8254
|
TransitionProvider: () => TransitionProvider,
|
|
8112
8255
|
anchorLineOf: () => anchorLineOf,
|
|
8113
8256
|
arraysEqual: () => arraysEqual,
|
|
@@ -8136,6 +8279,7 @@ __export(canvas_exports, {
|
|
|
8136
8279
|
setNavScrollActive: () => setNavScrollActive,
|
|
8137
8280
|
turnEditedBlock: () => turnEditedBlock,
|
|
8138
8281
|
turnOwnsView: () => turnOwnsView,
|
|
8282
|
+
turnTailSlots: () => turnTailSlots,
|
|
8139
8283
|
useAgentDriven: () => useAgentDriven,
|
|
8140
8284
|
useCanvasActions: () => useCanvasActions,
|
|
8141
8285
|
useCanvasArrangement: () => useCanvasArrangement,
|
|
@@ -8145,6 +8289,7 @@ __export(canvas_exports, {
|
|
|
8145
8289
|
useCanvasLeadTarget: () => useCanvasLeadTarget,
|
|
8146
8290
|
useCanvasMotionStyle: () => useCanvasMotionStyle,
|
|
8147
8291
|
useCanvasTail: () => useCanvasTail,
|
|
8292
|
+
useCanvasTurnTail: () => useCanvasTurnTail,
|
|
8148
8293
|
useCanvasViewBack: () => useCanvasViewBack,
|
|
8149
8294
|
useComposerPlaceholder: () => useComposerPlaceholder,
|
|
8150
8295
|
useComposerPlaceholderRotation: () => useComposerPlaceholderRotation,
|
|
@@ -8154,6 +8299,7 @@ __export(canvas_exports, {
|
|
|
8154
8299
|
useCurrentMessageIndex: () => useCurrentMessageIndex,
|
|
8155
8300
|
useDisplayedLayout: () => useDisplayedLayout,
|
|
8156
8301
|
useElementId: () => useElementId,
|
|
8302
|
+
useElementLayout: () => useElementLayout,
|
|
8157
8303
|
useExplicitTurnId: () => useExplicitTurnId,
|
|
8158
8304
|
useExplicitTurnSelection: () => useExplicitTurnSelection,
|
|
8159
8305
|
useFacts: () => useFacts,
|
|
@@ -8187,9 +8333,9 @@ __export(canvas_exports, {
|
|
|
8187
8333
|
});
|
|
8188
8334
|
|
|
8189
8335
|
// src/canvas/canvas-tail.tsx
|
|
8190
|
-
import * as
|
|
8336
|
+
import * as React27 from "react";
|
|
8191
8337
|
import { jsx as jsx9 } from "react/jsx-runtime";
|
|
8192
|
-
var CanvasTailContext =
|
|
8338
|
+
var CanvasTailContext = React27.createContext(null);
|
|
8193
8339
|
function CanvasTailProvider({
|
|
8194
8340
|
tail,
|
|
8195
8341
|
children
|
|
@@ -8197,7 +8343,7 @@ function CanvasTailProvider({
|
|
|
8197
8343
|
return /* @__PURE__ */ jsx9(CanvasTailContext.Provider, { value: tail, children });
|
|
8198
8344
|
}
|
|
8199
8345
|
function useCanvasTail() {
|
|
8200
|
-
return
|
|
8346
|
+
return React27.useContext(CanvasTailContext);
|
|
8201
8347
|
}
|
|
8202
8348
|
function CanvasTailMount({
|
|
8203
8349
|
isActive
|
|
@@ -8264,13 +8410,13 @@ function ShimmerSweep({ durationS }) {
|
|
|
8264
8410
|
}
|
|
8265
8411
|
|
|
8266
8412
|
// src/canvas/TransitionContext.tsx
|
|
8267
|
-
import
|
|
8413
|
+
import React28, { createContext as createContext13, useContext as useContext13 } from "react";
|
|
8268
8414
|
import { AnimatePresence, motion as motion2 } from "framer-motion";
|
|
8269
8415
|
import { jsx as jsx11 } from "react/jsx-runtime";
|
|
8270
8416
|
function FadeGroup({ children }) {
|
|
8271
8417
|
return /* @__PURE__ */ jsx11(AnimatePresence, { mode: "popLayout", initial: false, children });
|
|
8272
8418
|
}
|
|
8273
|
-
var FadeItem =
|
|
8419
|
+
var FadeItem = React28.forwardRef(function FadeItem2({ id, children, style, className }, ref) {
|
|
8274
8420
|
return /* @__PURE__ */ jsx11(
|
|
8275
8421
|
motion2.div,
|
|
8276
8422
|
{
|
|
@@ -8298,15 +8444,16 @@ function useLayoutTransition() {
|
|
|
8298
8444
|
}
|
|
8299
8445
|
|
|
8300
8446
|
// src/canvas/canvas-arrangement.tsx
|
|
8301
|
-
import
|
|
8447
|
+
import React29, { createContext as createContext14, useContext as useContext14 } from "react";
|
|
8302
8448
|
import { jsx as jsx12 } from "react/jsx-runtime";
|
|
8303
|
-
var CanvasArrangementContext = createContext14({ arrangement: "stack", turnPages: false });
|
|
8449
|
+
var CanvasArrangementContext = createContext14({ arrangement: "stack", turnPages: false, stackedTurns: false });
|
|
8304
8450
|
function CanvasArrangementProvider({
|
|
8305
8451
|
arrangement,
|
|
8306
8452
|
turnPages = false,
|
|
8453
|
+
stackedTurns = false,
|
|
8307
8454
|
children
|
|
8308
8455
|
}) {
|
|
8309
|
-
const value =
|
|
8456
|
+
const value = React29.useMemo(() => ({ arrangement, turnPages, stackedTurns }), [arrangement, turnPages, stackedTurns]);
|
|
8310
8457
|
return /* @__PURE__ */ jsx12(CanvasArrangementContext.Provider, { value, children });
|
|
8311
8458
|
}
|
|
8312
8459
|
function useCanvasArrangement() {
|
|
@@ -8314,56 +8461,85 @@ function useCanvasArrangement() {
|
|
|
8314
8461
|
}
|
|
8315
8462
|
|
|
8316
8463
|
// src/canvas/canvas-lead.tsx
|
|
8317
|
-
import * as
|
|
8464
|
+
import * as React30 from "react";
|
|
8318
8465
|
import { jsx as jsx13 } from "react/jsx-runtime";
|
|
8319
8466
|
var NO_LEAD = () => false;
|
|
8320
|
-
var CanvasLeadContext =
|
|
8467
|
+
var CanvasLeadContext = React30.createContext(null);
|
|
8321
8468
|
function CanvasLeadProvider(props) {
|
|
8322
|
-
const [target, setTarget] =
|
|
8323
|
-
const [leadId, setLeadId] =
|
|
8469
|
+
const [target, setTarget] = React30.useState(null);
|
|
8470
|
+
const [leadId, setLeadId] = React30.useState(null);
|
|
8324
8471
|
const listed = "types" in props ? props.types : props.except;
|
|
8325
8472
|
const only = "types" in props;
|
|
8326
|
-
const canLead =
|
|
8327
|
-
const value =
|
|
8473
|
+
const canLead = React30.useCallback((type) => listed.includes(type) === only, [listed, only]);
|
|
8474
|
+
const value = React30.useMemo(() => ({ canLead, target, setTarget, leadId, setLeadId }), [canLead, target, leadId]);
|
|
8328
8475
|
return /* @__PURE__ */ jsx13(CanvasLeadContext.Provider, { value, children: props.children });
|
|
8329
8476
|
}
|
|
8330
8477
|
function CanvasLeadSlot({ className }) {
|
|
8331
|
-
const lead =
|
|
8478
|
+
const lead = React30.useContext(CanvasLeadContext);
|
|
8332
8479
|
if (lead === null) throw new Error("<CanvasLeadSlot> must be rendered inside <CanvasLeadProvider>.");
|
|
8333
8480
|
const { setTarget } = lead;
|
|
8334
|
-
const ref =
|
|
8481
|
+
const ref = React30.useCallback((el) => setTarget(el), [setTarget]);
|
|
8335
8482
|
return /* @__PURE__ */ jsx13("div", { ref, className, "data-fourty-canvas-lead": "" });
|
|
8336
8483
|
}
|
|
8337
8484
|
function useCanvasLead() {
|
|
8338
|
-
const lead =
|
|
8485
|
+
const lead = React30.useContext(CanvasLeadContext);
|
|
8339
8486
|
return { present: lead !== null && lead.target !== null && lead.leadId !== null };
|
|
8340
8487
|
}
|
|
8341
8488
|
function useCanvasLeadTarget() {
|
|
8342
|
-
const lead =
|
|
8489
|
+
const lead = React30.useContext(CanvasLeadContext);
|
|
8343
8490
|
const setLeadId = lead === null ? null : lead.setLeadId;
|
|
8344
|
-
const report =
|
|
8491
|
+
const report = React30.useCallback((id) => {
|
|
8345
8492
|
if (setLeadId !== null) setLeadId(id);
|
|
8346
8493
|
}, [setLeadId]);
|
|
8347
8494
|
if (lead === null) return { canLead: NO_LEAD, target: null, report };
|
|
8348
8495
|
return { canLead: lead.canLead, target: lead.target, report };
|
|
8349
8496
|
}
|
|
8350
8497
|
|
|
8351
|
-
// src/canvas/canvas-
|
|
8352
|
-
import
|
|
8498
|
+
// src/canvas/canvas-turn-tail.tsx
|
|
8499
|
+
import * as React31 from "react";
|
|
8353
8500
|
import { jsx as jsx14 } from "react/jsx-runtime";
|
|
8354
|
-
var
|
|
8501
|
+
var TURN_TAIL_ATTR = "data-fourty-turn-tail";
|
|
8502
|
+
var CanvasTurnTailContext = React31.createContext(null);
|
|
8503
|
+
function CanvasTurnTailProvider({
|
|
8504
|
+
tail,
|
|
8505
|
+
children
|
|
8506
|
+
}) {
|
|
8507
|
+
return /* @__PURE__ */ jsx14(CanvasTurnTailContext.Provider, { value: tail, children });
|
|
8508
|
+
}
|
|
8509
|
+
function useCanvasTurnTail() {
|
|
8510
|
+
return React31.useContext(CanvasTurnTailContext);
|
|
8511
|
+
}
|
|
8512
|
+
function turnTailSlots(keys, turnOf, newest) {
|
|
8513
|
+
const last = /* @__PURE__ */ new Map();
|
|
8514
|
+
keys.forEach((key, index) => {
|
|
8515
|
+
const turn = turnOf(key);
|
|
8516
|
+
if (turn !== void 0) last.set(turn, index);
|
|
8517
|
+
});
|
|
8518
|
+
const after = /* @__PURE__ */ new Map();
|
|
8519
|
+
for (const [turn, index] of last) after.set(index, turn);
|
|
8520
|
+
return { after, end: newest !== null && !last.has(newest) ? newest : null };
|
|
8521
|
+
}
|
|
8522
|
+
|
|
8523
|
+
// src/canvas/canvas-motion-style.tsx
|
|
8524
|
+
import { createContext as createContext17, useContext as useContext17 } from "react";
|
|
8525
|
+
import { jsx as jsx15 } from "react/jsx-runtime";
|
|
8526
|
+
var CanvasMotionStyleContext = createContext17(null);
|
|
8355
8527
|
function CanvasMotionStyleProvider({ style, children }) {
|
|
8356
|
-
return /* @__PURE__ */
|
|
8528
|
+
return /* @__PURE__ */ jsx15(CanvasMotionStyleContext.Provider, { value: style, children });
|
|
8357
8529
|
}
|
|
8358
8530
|
function useCanvasMotionStyle() {
|
|
8359
|
-
return
|
|
8531
|
+
return useContext17(CanvasMotionStyleContext);
|
|
8360
8532
|
}
|
|
8361
8533
|
|
|
8362
8534
|
// src/canvas/ElementIdContext.ts
|
|
8363
|
-
import { createContext as
|
|
8364
|
-
var ElementIdContext =
|
|
8535
|
+
import { createContext as createContext18, useContext as useContext18 } from "react";
|
|
8536
|
+
var ElementIdContext = createContext18(null);
|
|
8365
8537
|
function useElementId() {
|
|
8366
|
-
return
|
|
8538
|
+
return useContext18(ElementIdContext);
|
|
8539
|
+
}
|
|
8540
|
+
var ElementLayoutContext = createContext18(null);
|
|
8541
|
+
function useElementLayout() {
|
|
8542
|
+
return useContext18(ElementLayoutContext);
|
|
8367
8543
|
}
|
|
8368
8544
|
|
|
8369
8545
|
// src/canvas/generation-entrance.ts
|
|
@@ -8437,27 +8613,27 @@ var INITIAL_NAV_PRESENTATION = {
|
|
|
8437
8613
|
};
|
|
8438
8614
|
|
|
8439
8615
|
// src/canvas/use-canvas-actions.ts
|
|
8440
|
-
import { useCallback as
|
|
8616
|
+
import { useCallback as useCallback13 } from "react";
|
|
8441
8617
|
function navigateActionId(page) {
|
|
8442
8618
|
const id = Reflect.get(page, "id");
|
|
8443
8619
|
return typeof id === "string" ? `navigate-${page.kind}-${id}` : `navigate-${page.kind}`;
|
|
8444
8620
|
}
|
|
8445
8621
|
function useCanvasActions() {
|
|
8446
8622
|
const session = useOptionalFourtySession();
|
|
8447
|
-
const dispatchAction =
|
|
8623
|
+
const dispatchAction = useCallback13(
|
|
8448
8624
|
(action) => {
|
|
8449
8625
|
if (!session) return;
|
|
8450
8626
|
session.dispatchSuggestionAction(action);
|
|
8451
8627
|
},
|
|
8452
8628
|
[session]
|
|
8453
8629
|
);
|
|
8454
|
-
const navigate =
|
|
8630
|
+
const navigate = useCallback13(
|
|
8455
8631
|
(page, label) => {
|
|
8456
8632
|
dispatchAction({ id: navigateActionId(page), label, type: NAVIGATE_SIGNAL, payload: { page } });
|
|
8457
8633
|
},
|
|
8458
8634
|
[dispatchAction]
|
|
8459
8635
|
);
|
|
8460
|
-
const ask =
|
|
8636
|
+
const ask = useCallback13(
|
|
8461
8637
|
(text2, label) => {
|
|
8462
8638
|
dispatchAction({ id: `ask-${label}`, label, type: "message", payload: { text: text2 } });
|
|
8463
8639
|
},
|
|
@@ -8623,22 +8799,22 @@ function deriveTurnChangeAnchor(prev, next) {
|
|
|
8623
8799
|
}
|
|
8624
8800
|
|
|
8625
8801
|
// src/canvas/canvas-outlet.tsx
|
|
8626
|
-
import { createContext as
|
|
8627
|
-
import { jsx as
|
|
8628
|
-
var CanvasOutletContext =
|
|
8802
|
+
import { createContext as createContext19, useContext as useContext19 } from "react";
|
|
8803
|
+
import { jsx as jsx16 } from "react/jsx-runtime";
|
|
8804
|
+
var CanvasOutletContext = createContext19(null);
|
|
8629
8805
|
function CanvasOutletProvider({ canvas, children }) {
|
|
8630
|
-
return /* @__PURE__ */
|
|
8806
|
+
return /* @__PURE__ */ jsx16(CanvasOutletContext.Provider, { value: canvas, children });
|
|
8631
8807
|
}
|
|
8632
8808
|
function SpacefrontCanvas() {
|
|
8633
|
-
const Canvas =
|
|
8809
|
+
const Canvas = useContext19(CanvasOutletContext);
|
|
8634
8810
|
if (Canvas === null) {
|
|
8635
8811
|
throw new Error("<SpacefrontCanvas> must be rendered inside <Spacefront> \u2014 no engine has provided a canvas.");
|
|
8636
8812
|
}
|
|
8637
|
-
return /* @__PURE__ */
|
|
8813
|
+
return /* @__PURE__ */ jsx16(Canvas, {});
|
|
8638
8814
|
}
|
|
8639
8815
|
|
|
8640
8816
|
// src/canvas/item-motion/ItemTransitionGroup.tsx
|
|
8641
|
-
import
|
|
8817
|
+
import React33 from "react";
|
|
8642
8818
|
import { AnimatePresence as AnimatePresence2, motion as motion3, useReducedMotion as useReducedMotion2 } from "framer-motion";
|
|
8643
8819
|
|
|
8644
8820
|
// src/canvas/item-motion/classify-items.ts
|
|
@@ -8857,7 +9033,7 @@ function getActiveProfile() {
|
|
|
8857
9033
|
}
|
|
8858
9034
|
|
|
8859
9035
|
// src/canvas/item-motion/ItemTransitionGroup.tsx
|
|
8860
|
-
import { jsx as
|
|
9036
|
+
import { jsx as jsx17 } from "react/jsx-runtime";
|
|
8861
9037
|
var ITEM_IDENTITY_ATTR = "data-flip-id";
|
|
8862
9038
|
function ItemTransitionGroup({
|
|
8863
9039
|
items,
|
|
@@ -8872,14 +9048,14 @@ function ItemTransitionGroup({
|
|
|
8872
9048
|
const profile = getActiveProfile();
|
|
8873
9049
|
const animated = reduce !== true;
|
|
8874
9050
|
const ids = items.map(getId);
|
|
8875
|
-
const prevIdsRef =
|
|
8876
|
-
const lastChangeRef =
|
|
9051
|
+
const prevIdsRef = React33.useRef(null);
|
|
9052
|
+
const lastChangeRef = React33.useRef(null);
|
|
8877
9053
|
const prevIds = prevIdsRef.current;
|
|
8878
9054
|
const freshChange = prevIds === null ? null : classifyItemChange(prevIds, ids);
|
|
8879
9055
|
if (freshChange !== null) {
|
|
8880
9056
|
lastChangeRef.current = freshChange;
|
|
8881
9057
|
}
|
|
8882
|
-
|
|
9058
|
+
React33.useEffect(() => {
|
|
8883
9059
|
prevIdsRef.current = ids;
|
|
8884
9060
|
});
|
|
8885
9061
|
const activeChange = lastChangeRef.current;
|
|
@@ -8892,7 +9068,7 @@ function ItemTransitionGroup({
|
|
|
8892
9068
|
const isGrid = itemClassName === void 0;
|
|
8893
9069
|
const outerClassName = isGrid ? "h-full" : itemClassName;
|
|
8894
9070
|
const innerClassName = isGrid ? "h-full" : void 0;
|
|
8895
|
-
return /* @__PURE__ */
|
|
9071
|
+
return /* @__PURE__ */ jsx17("div", { className, style, children: /* @__PURE__ */ jsx17(AnimatePresence2, { mode: "popLayout", initial: false, children: items.map((item) => {
|
|
8896
9072
|
const id = getId(item);
|
|
8897
9073
|
const identityAttr = { [ITEM_IDENTITY_ATTR]: id };
|
|
8898
9074
|
const isEntering = activeChange !== null && activeChange.entered.includes(id);
|
|
@@ -8902,7 +9078,7 @@ function ItemTransitionGroup({
|
|
|
8902
9078
|
// `itemClassName`/`itemStyle` size the wrapper for flex/snap
|
|
8903
9079
|
// layouts (carousel); grid layouts leave them unset and get
|
|
8904
9080
|
// `h-full` so the cell height reaches the card.
|
|
8905
|
-
/* @__PURE__ */
|
|
9081
|
+
/* @__PURE__ */ jsx17(
|
|
8906
9082
|
motion3.div,
|
|
8907
9083
|
{
|
|
8908
9084
|
...identityAttr,
|
|
@@ -8911,7 +9087,7 @@ function ItemTransitionGroup({
|
|
|
8911
9087
|
layout: animated ? "position" : void 0,
|
|
8912
9088
|
layoutDependency,
|
|
8913
9089
|
transition: animated ? layoutTransition : void 0,
|
|
8914
|
-
children: /* @__PURE__ */
|
|
9090
|
+
children: /* @__PURE__ */ jsx17(
|
|
8915
9091
|
motion3.div,
|
|
8916
9092
|
{
|
|
8917
9093
|
className: innerClassName,
|
|
@@ -8992,21 +9168,21 @@ __export(catalog_exports, {
|
|
|
8992
9168
|
});
|
|
8993
9169
|
|
|
8994
9170
|
// src/catalog/DebugContext.tsx
|
|
8995
|
-
import { createContext as
|
|
8996
|
-
import { jsx as
|
|
8997
|
-
var DebugContext =
|
|
9171
|
+
import { createContext as createContext20, useContext as useContext20 } from "react";
|
|
9172
|
+
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
9173
|
+
var DebugContext = createContext20(false);
|
|
8998
9174
|
function DebugProvider({
|
|
8999
9175
|
debug,
|
|
9000
9176
|
children
|
|
9001
9177
|
}) {
|
|
9002
|
-
return /* @__PURE__ */
|
|
9178
|
+
return /* @__PURE__ */ jsx18(DebugContext.Provider, { value: debug, children });
|
|
9003
9179
|
}
|
|
9004
9180
|
function useDebug() {
|
|
9005
|
-
return
|
|
9181
|
+
return useContext20(DebugContext);
|
|
9006
9182
|
}
|
|
9007
9183
|
|
|
9008
9184
|
// src/catalog/HydrationStateContext.tsx
|
|
9009
|
-
import { createContext as
|
|
9185
|
+
import { createContext as createContext21, useContext as useContext21 } from "react";
|
|
9010
9186
|
var DEFAULT_STATE = {
|
|
9011
9187
|
hasResolvedFields: false,
|
|
9012
9188
|
hydrating: false,
|
|
@@ -9016,47 +9192,47 @@ var DEFAULT_STATE = {
|
|
|
9016
9192
|
pendingCount: 0,
|
|
9017
9193
|
errors: []
|
|
9018
9194
|
};
|
|
9019
|
-
var HydrationStateContext =
|
|
9195
|
+
var HydrationStateContext = createContext21(DEFAULT_STATE);
|
|
9020
9196
|
function useHydrationState() {
|
|
9021
|
-
return
|
|
9197
|
+
return useContext21(HydrationStateContext);
|
|
9022
9198
|
}
|
|
9023
9199
|
|
|
9024
9200
|
// src/catalog/HydratorContext.tsx
|
|
9025
|
-
import { createContext as
|
|
9026
|
-
import { jsx as
|
|
9027
|
-
var HydratorContext =
|
|
9201
|
+
import { createContext as createContext22, useContext as useContext22 } from "react";
|
|
9202
|
+
import { jsx as jsx19 } from "react/jsx-runtime";
|
|
9203
|
+
var HydratorContext = createContext22({});
|
|
9028
9204
|
function HydratorProvider({
|
|
9029
9205
|
hydrators,
|
|
9030
9206
|
children
|
|
9031
9207
|
}) {
|
|
9032
|
-
return /* @__PURE__ */
|
|
9208
|
+
return /* @__PURE__ */ jsx19(HydratorContext.Provider, { value: hydrators, children });
|
|
9033
9209
|
}
|
|
9034
9210
|
function useHydrators() {
|
|
9035
|
-
return
|
|
9211
|
+
return useContext22(HydratorContext);
|
|
9036
9212
|
}
|
|
9037
9213
|
|
|
9038
9214
|
// src/catalog/registry.tsx
|
|
9039
|
-
import { createContext as
|
|
9040
|
-
import { jsx as
|
|
9041
|
-
var RegistryContext =
|
|
9215
|
+
import { createContext as createContext23, useContext as useContext23 } from "react";
|
|
9216
|
+
import { jsx as jsx20 } from "react/jsx-runtime";
|
|
9217
|
+
var RegistryContext = createContext23({});
|
|
9042
9218
|
function RegistryProvider({
|
|
9043
9219
|
registry: registry2,
|
|
9044
9220
|
children
|
|
9045
9221
|
}) {
|
|
9046
|
-
return /* @__PURE__ */
|
|
9222
|
+
return /* @__PURE__ */ jsx20(RegistryContext.Provider, { value: registry2, children });
|
|
9047
9223
|
}
|
|
9048
9224
|
function useRegistry() {
|
|
9049
|
-
return
|
|
9225
|
+
return useContext23(RegistryContext);
|
|
9050
9226
|
}
|
|
9051
|
-
var PackageLookupContext =
|
|
9227
|
+
var PackageLookupContext = createContext23(null);
|
|
9052
9228
|
function PackageLookupProvider({
|
|
9053
9229
|
lookup,
|
|
9054
9230
|
children
|
|
9055
9231
|
}) {
|
|
9056
|
-
return /* @__PURE__ */
|
|
9232
|
+
return /* @__PURE__ */ jsx20(PackageLookupContext.Provider, { value: lookup, children });
|
|
9057
9233
|
}
|
|
9058
9234
|
function usePackageLookup() {
|
|
9059
|
-
return
|
|
9235
|
+
return useContext23(PackageLookupContext);
|
|
9060
9236
|
}
|
|
9061
9237
|
function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
|
|
9062
9238
|
return new Proxy(baseRegistry, {
|
|
@@ -9087,7 +9263,7 @@ function createAliasedRegistry(baseRegistry, aliases, getPackageComponent) {
|
|
|
9087
9263
|
}
|
|
9088
9264
|
|
|
9089
9265
|
// src/catalog/render-inline.tsx
|
|
9090
|
-
import
|
|
9266
|
+
import React36 from "react";
|
|
9091
9267
|
|
|
9092
9268
|
// src/catalog/prose-links.ts
|
|
9093
9269
|
var LINK = /\[([^\]\n]+)\]\(([^)\s]+)\)/g;
|
|
@@ -9113,8 +9289,8 @@ function proseRuns(text2) {
|
|
|
9113
9289
|
}
|
|
9114
9290
|
|
|
9115
9291
|
// src/catalog/render-inline.tsx
|
|
9116
|
-
import { jsx as
|
|
9117
|
-
var linkRenderer = (href, key) => /* @__PURE__ */
|
|
9292
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
9293
|
+
var linkRenderer = (href, key) => /* @__PURE__ */ jsx21(
|
|
9118
9294
|
"a",
|
|
9119
9295
|
{
|
|
9120
9296
|
className: "fourty-inline-link",
|
|
@@ -9130,7 +9306,7 @@ function linkifyText(text2, keyPrefix) {
|
|
|
9130
9306
|
return proseRuns(text2).flatMap((run, r) => {
|
|
9131
9307
|
if (run.href === void 0) return linkifyBareUrls(run.text, `${keyPrefix}-${String(r)}`);
|
|
9132
9308
|
return [
|
|
9133
|
-
/* @__PURE__ */
|
|
9309
|
+
/* @__PURE__ */ jsx21("a", { className: "fourty-inline-link", href: run.href, target: "_blank", rel: "noopener noreferrer", children: run.text }, `${keyPrefix}-${String(r)}-ll`)
|
|
9134
9310
|
];
|
|
9135
9311
|
});
|
|
9136
9312
|
}
|
|
@@ -9142,14 +9318,14 @@ function linkifyBareUrls(text2, keyPrefix) {
|
|
|
9142
9318
|
URL_RE.lastIndex = 0;
|
|
9143
9319
|
while ((match = URL_RE.exec(text2)) !== null) {
|
|
9144
9320
|
if (match.index > last) {
|
|
9145
|
-
out.push(/* @__PURE__ */
|
|
9321
|
+
out.push(/* @__PURE__ */ jsx21(React36.Fragment, { children: text2.slice(last, match.index) }, `${keyPrefix}-lt-${i++}`));
|
|
9146
9322
|
}
|
|
9147
9323
|
const href = match[0];
|
|
9148
9324
|
out.push(linkRenderer(href, `${keyPrefix}-lk-${i++}`));
|
|
9149
9325
|
last = match.index + href.length;
|
|
9150
9326
|
}
|
|
9151
9327
|
if (last < text2.length) {
|
|
9152
|
-
out.push(/* @__PURE__ */
|
|
9328
|
+
out.push(/* @__PURE__ */ jsx21(React36.Fragment, { children: text2.slice(last) }, `${keyPrefix}-lt-${i++}`));
|
|
9153
9329
|
}
|
|
9154
9330
|
return out;
|
|
9155
9331
|
}
|
|
@@ -9162,8 +9338,8 @@ function renderInline(text2, keyPrefix) {
|
|
|
9162
9338
|
while ((match = re.exec(text2)) !== null) {
|
|
9163
9339
|
if (match.index > last) out.push(...linkifyText(text2.slice(last, match.index), `${keyPrefix}-t-${i++}`));
|
|
9164
9340
|
const bold = match[1];
|
|
9165
|
-
if (bold !== void 0) out.push(/* @__PURE__ */
|
|
9166
|
-
else out.push(/* @__PURE__ */
|
|
9341
|
+
if (bold !== void 0) out.push(/* @__PURE__ */ jsx21("strong", { children: bold }, `${keyPrefix}-b-${i++}`));
|
|
9342
|
+
else out.push(/* @__PURE__ */ jsx21("em", { children: match[2] }, `${keyPrefix}-i-${i++}`));
|
|
9167
9343
|
last = match.index + match[0].length;
|
|
9168
9344
|
}
|
|
9169
9345
|
if (last < text2.length) out.push(...linkifyText(text2.slice(last), `${keyPrefix}-t-${i++}`));
|
|
@@ -9171,7 +9347,7 @@ function renderInline(text2, keyPrefix) {
|
|
|
9171
9347
|
}
|
|
9172
9348
|
|
|
9173
9349
|
// src/catalog/component-library.ts
|
|
9174
|
-
import * as
|
|
9350
|
+
import * as React37 from "react";
|
|
9175
9351
|
function displayNameOf(Inner) {
|
|
9176
9352
|
if (typeof Inner === "string") return Inner;
|
|
9177
9353
|
if (typeof Inner.displayName === "string" && Inner.displayName.length > 0) return Inner.displayName;
|
|
@@ -9180,7 +9356,7 @@ function displayNameOf(Inner) {
|
|
|
9180
9356
|
}
|
|
9181
9357
|
function adaptComponent(Inner) {
|
|
9182
9358
|
function Adapted(props) {
|
|
9183
|
-
return
|
|
9359
|
+
return React37.createElement(Inner, props);
|
|
9184
9360
|
}
|
|
9185
9361
|
Adapted.displayName = displayNameOf(Inner);
|
|
9186
9362
|
return Adapted;
|
|
@@ -9221,23 +9397,23 @@ function buildComponentLibrary(catalog, componentMap) {
|
|
|
9221
9397
|
}
|
|
9222
9398
|
|
|
9223
9399
|
// src/catalog/define.ts
|
|
9224
|
-
import { z as
|
|
9225
|
-
var HYDRATED_ENTITY =
|
|
9400
|
+
import { z as z50 } from "zod";
|
|
9401
|
+
var HYDRATED_ENTITY = z50.object({}).passthrough();
|
|
9226
9402
|
function entity(resolverKey, opts) {
|
|
9227
9403
|
return resolved(HYDRATED_ENTITY, resolverKey, opts);
|
|
9228
9404
|
}
|
|
9229
|
-
var text = prose(
|
|
9405
|
+
var text = prose(z50.string());
|
|
9230
9406
|
function plain() {
|
|
9231
|
-
return
|
|
9407
|
+
return z50.string();
|
|
9232
9408
|
}
|
|
9233
9409
|
function token(values) {
|
|
9234
|
-
return
|
|
9410
|
+
return z50.enum(values);
|
|
9235
9411
|
}
|
|
9236
9412
|
function catalogComponent(meta, render) {
|
|
9237
9413
|
const { props, requires, ...rest } = meta;
|
|
9238
9414
|
return {
|
|
9239
9415
|
...rest,
|
|
9240
|
-
propsSchema:
|
|
9416
|
+
propsSchema: z50.object(props),
|
|
9241
9417
|
...requires !== void 0 ? { requires } : {},
|
|
9242
9418
|
component: adaptComponent(render)
|
|
9243
9419
|
};
|
|
@@ -9577,7 +9753,7 @@ function useConsumeStandingSignal(type) {
|
|
|
9577
9753
|
}
|
|
9578
9754
|
|
|
9579
9755
|
// src/widgets/presence/use-presence-notch.ts
|
|
9580
|
-
import * as
|
|
9756
|
+
import * as React38 from "react";
|
|
9581
9757
|
var SETTLE_DWELL_MS = 4e3;
|
|
9582
9758
|
var HOVER_CLOSE_MS = 240;
|
|
9583
9759
|
var HOVER_BOUNCE_WINDOW_MS = 800;
|
|
@@ -9585,21 +9761,21 @@ var BOUNCE_PX = 2;
|
|
|
9585
9761
|
function usePresenceNotch(widgets) {
|
|
9586
9762
|
const askStanding = useStandingOfType(AGENT_ASK_SIGNAL) !== null;
|
|
9587
9763
|
const { isRunning } = useAgentPresence();
|
|
9588
|
-
const [hovered, setHovered] =
|
|
9589
|
-
const [openDrawerId, setOpenDrawerId] =
|
|
9590
|
-
const rootRef =
|
|
9591
|
-
const toggleDrawer =
|
|
9764
|
+
const [hovered, setHovered] = React38.useState(false);
|
|
9765
|
+
const [openDrawerId, setOpenDrawerId] = React38.useState(null);
|
|
9766
|
+
const rootRef = React38.useRef(null);
|
|
9767
|
+
const toggleDrawer = React38.useCallback((id) => {
|
|
9592
9768
|
setOpenDrawerId((current2) => current2 === id ? null : id);
|
|
9593
9769
|
}, []);
|
|
9594
|
-
const closeTimer =
|
|
9595
|
-
const cancelClose =
|
|
9770
|
+
const closeTimer = React38.useRef(null);
|
|
9771
|
+
const cancelClose = React38.useCallback(() => {
|
|
9596
9772
|
if (closeTimer.current !== null) {
|
|
9597
9773
|
clearTimeout(closeTimer.current);
|
|
9598
9774
|
closeTimer.current = null;
|
|
9599
9775
|
}
|
|
9600
9776
|
}, []);
|
|
9601
|
-
const lastLeaveRef =
|
|
9602
|
-
const openHover =
|
|
9777
|
+
const lastLeaveRef = React38.useRef(null);
|
|
9778
|
+
const openHover = React38.useCallback((e) => {
|
|
9603
9779
|
const last = lastLeaveRef.current;
|
|
9604
9780
|
if (last !== null && Date.now() - last.t < HOVER_BOUNCE_WINDOW_MS && Math.abs(e.clientX - last.x) <= BOUNCE_PX && Math.abs(e.clientY - last.y) <= BOUNCE_PX) {
|
|
9605
9781
|
return;
|
|
@@ -9607,7 +9783,7 @@ function usePresenceNotch(widgets) {
|
|
|
9607
9783
|
cancelClose();
|
|
9608
9784
|
setHovered(true);
|
|
9609
9785
|
}, [cancelClose]);
|
|
9610
|
-
const scheduleClose =
|
|
9786
|
+
const scheduleClose = React38.useCallback((e) => {
|
|
9611
9787
|
lastLeaveRef.current = { x: e.clientX, y: e.clientY, t: Date.now() };
|
|
9612
9788
|
cancelClose();
|
|
9613
9789
|
closeTimer.current = setTimeout(() => {
|
|
@@ -9615,8 +9791,8 @@ function usePresenceNotch(widgets) {
|
|
|
9615
9791
|
setHovered(false);
|
|
9616
9792
|
}, HOVER_CLOSE_MS);
|
|
9617
9793
|
}, [cancelClose]);
|
|
9618
|
-
|
|
9619
|
-
|
|
9794
|
+
React38.useEffect(() => cancelClose, [cancelClose]);
|
|
9795
|
+
React38.useEffect(() => {
|
|
9620
9796
|
if (openDrawerId === null) return;
|
|
9621
9797
|
const onKey = (e) => {
|
|
9622
9798
|
if (e.key === "Escape") setOpenDrawerId(null);
|
|
@@ -9624,7 +9800,7 @@ function usePresenceNotch(widgets) {
|
|
|
9624
9800
|
window.addEventListener("keydown", onKey);
|
|
9625
9801
|
return () => window.removeEventListener("keydown", onKey);
|
|
9626
9802
|
}, [openDrawerId]);
|
|
9627
|
-
|
|
9803
|
+
React38.useEffect(() => {
|
|
9628
9804
|
if (openDrawerId === null) return;
|
|
9629
9805
|
const onDown = (e) => {
|
|
9630
9806
|
const root = rootRef.current;
|
|
@@ -9636,8 +9812,8 @@ function usePresenceNotch(widgets) {
|
|
|
9636
9812
|
document.addEventListener("pointerdown", onDown);
|
|
9637
9813
|
return () => document.removeEventListener("pointerdown", onDown);
|
|
9638
9814
|
}, [openDrawerId]);
|
|
9639
|
-
const [active, setActive] =
|
|
9640
|
-
|
|
9815
|
+
const [active, setActive] = React38.useState(false);
|
|
9816
|
+
React38.useEffect(() => {
|
|
9641
9817
|
if (isRunning) {
|
|
9642
9818
|
setActive(true);
|
|
9643
9819
|
return;
|
|
@@ -9797,7 +9973,7 @@ function presenceFactShape(fact) {
|
|
|
9797
9973
|
}
|
|
9798
9974
|
|
|
9799
9975
|
// src/widgets/presence/use-optimistic-facts.ts
|
|
9800
|
-
import * as
|
|
9976
|
+
import * as React39 from "react";
|
|
9801
9977
|
function readEntries(data) {
|
|
9802
9978
|
if (typeof data !== "object" || data === null || !("entries" in data)) return [];
|
|
9803
9979
|
const raw = data.entries;
|
|
@@ -9816,7 +9992,7 @@ function writeOptimisticFact(entries3, fact) {
|
|
|
9816
9992
|
}
|
|
9817
9993
|
function useOptimisticFactOverlay(flowId) {
|
|
9818
9994
|
const entries3 = readEntries(useAgentFlow(flowId));
|
|
9819
|
-
return
|
|
9995
|
+
return React39.useMemo(
|
|
9820
9996
|
() => ({
|
|
9821
9997
|
entries: entries3,
|
|
9822
9998
|
add: (fact) => setFlowOutput(flowId, { entries: writeOptimisticFact(entries3, fact) })
|
|
@@ -9825,8 +10001,8 @@ function useOptimisticFactOverlay(flowId) {
|
|
|
9825
10001
|
);
|
|
9826
10002
|
}
|
|
9827
10003
|
function useReconcileOptimisticFacts(flowId, readIdentity) {
|
|
9828
|
-
const seenRef =
|
|
9829
|
-
|
|
10004
|
+
const seenRef = React39.useRef(null);
|
|
10005
|
+
React39.useEffect(() => {
|
|
9830
10006
|
if (readIdentity === null) return;
|
|
9831
10007
|
if (seenRef.current === null) {
|
|
9832
10008
|
seenRef.current = readIdentity;
|
|
@@ -9998,16 +10174,16 @@ __export(chat_exports, {
|
|
|
9998
10174
|
});
|
|
9999
10175
|
|
|
10000
10176
|
// src/chat/chat-context.ts
|
|
10001
|
-
import { createContext as
|
|
10002
|
-
var FourtyChatContext =
|
|
10177
|
+
import { createContext as createContext24, useContext as useContext24 } from "react";
|
|
10178
|
+
var FourtyChatContext = createContext24(null);
|
|
10003
10179
|
function useFourtyChat() {
|
|
10004
|
-
const ctx =
|
|
10180
|
+
const ctx = useContext24(FourtyChatContext);
|
|
10005
10181
|
if (!ctx) throw new Error("useFourtyChat must be used inside <FourtyChatProvider>");
|
|
10006
10182
|
return ctx;
|
|
10007
10183
|
}
|
|
10008
10184
|
|
|
10009
10185
|
// src/rendering/post-hydration.ts
|
|
10010
|
-
import { useCallback as
|
|
10186
|
+
import { useCallback as useCallback15 } from "react";
|
|
10011
10187
|
var registry = [];
|
|
10012
10188
|
function registerPostHydrationTransform(transform) {
|
|
10013
10189
|
const existing = registry.findIndex((t) => t.id === transform.id);
|
|
@@ -10016,7 +10192,7 @@ function registerPostHydrationTransform(transform) {
|
|
|
10016
10192
|
}
|
|
10017
10193
|
function usePostHydrationTransforms() {
|
|
10018
10194
|
const fns = registry.map((t) => t.use());
|
|
10019
|
-
return
|
|
10195
|
+
return useCallback15(
|
|
10020
10196
|
(props, ctx) => {
|
|
10021
10197
|
let out = props;
|
|
10022
10198
|
for (const fn of fns) {
|
|
@@ -10176,7 +10352,7 @@ function ProjectionSignalBridge() {
|
|
|
10176
10352
|
}
|
|
10177
10353
|
|
|
10178
10354
|
// src/projection/use-projection.ts
|
|
10179
|
-
import { useCallback as
|
|
10355
|
+
import { useCallback as useCallback16, useEffect as useEffect12, useState as useState8 } from "react";
|
|
10180
10356
|
function readResult(raw) {
|
|
10181
10357
|
if (raw === null || typeof raw !== "object") return void 0;
|
|
10182
10358
|
if (!("hiddenCount" in raw) || typeof raw.hiddenCount !== "number") return void 0;
|
|
@@ -10190,7 +10366,7 @@ function entityIdOf(value) {
|
|
|
10190
10366
|
var NO_AXES = [];
|
|
10191
10367
|
function useProjection(projectionProp, entity2) {
|
|
10192
10368
|
const [expanded, setExpanded] = useState8(false);
|
|
10193
|
-
const toggle =
|
|
10369
|
+
const toggle = useCallback16(() => setExpanded((e) => !e), []);
|
|
10194
10370
|
const entityId = entityIdOf(entity2);
|
|
10195
10371
|
useEffect12(() => {
|
|
10196
10372
|
setExpanded(false);
|
|
@@ -10238,34 +10414,34 @@ __export(interaction_exports, {
|
|
|
10238
10414
|
});
|
|
10239
10415
|
|
|
10240
10416
|
// src/interaction/withInteractionTracking.tsx
|
|
10241
|
-
import
|
|
10242
|
-
import { jsx as
|
|
10243
|
-
var InteractionContext =
|
|
10417
|
+
import React40, { createContext as createContext25, useContext as useContext25 } from "react";
|
|
10418
|
+
import { jsx as jsx22, jsxs } from "react/jsx-runtime";
|
|
10419
|
+
var InteractionContext = createContext25(null);
|
|
10244
10420
|
function InteractionProvider({
|
|
10245
10421
|
onInteraction,
|
|
10246
10422
|
children
|
|
10247
10423
|
}) {
|
|
10248
|
-
return /* @__PURE__ */
|
|
10424
|
+
return /* @__PURE__ */ jsx22(InteractionContext.Provider, { value: onInteraction, children });
|
|
10249
10425
|
}
|
|
10250
10426
|
function useInteraction2() {
|
|
10251
|
-
return
|
|
10427
|
+
return useContext25(InteractionContext);
|
|
10252
10428
|
}
|
|
10253
10429
|
function withInteractionTracking(WrappedComponent, meta) {
|
|
10254
10430
|
function TrackedComponent(props) {
|
|
10255
|
-
return /* @__PURE__ */
|
|
10431
|
+
return /* @__PURE__ */ jsx22(
|
|
10256
10432
|
"div",
|
|
10257
10433
|
{
|
|
10258
10434
|
"data-tracked-component": meta.componentId,
|
|
10259
10435
|
"data-tracked-component-type": meta.componentType,
|
|
10260
10436
|
style: { display: "contents" },
|
|
10261
|
-
children: /* @__PURE__ */
|
|
10437
|
+
children: /* @__PURE__ */ jsx22(ComponentErrorBoundary, { componentId: meta.componentId, children: /* @__PURE__ */ jsx22(WrappedComponent, { ...props }) })
|
|
10262
10438
|
}
|
|
10263
10439
|
);
|
|
10264
10440
|
}
|
|
10265
10441
|
TrackedComponent.displayName = `Tracked(${WrappedComponent.displayName || WrappedComponent.name || "Component"})`;
|
|
10266
10442
|
return TrackedComponent;
|
|
10267
10443
|
}
|
|
10268
|
-
var ComponentErrorBoundary = class extends
|
|
10444
|
+
var ComponentErrorBoundary = class extends React40.Component {
|
|
10269
10445
|
constructor() {
|
|
10270
10446
|
super(...arguments);
|
|
10271
10447
|
__publicField(this, "state", { error: null });
|
|
@@ -10279,7 +10455,7 @@ var ComponentErrorBoundary = class extends React38.Component {
|
|
|
10279
10455
|
render() {
|
|
10280
10456
|
if (this.state.error) {
|
|
10281
10457
|
return /* @__PURE__ */ jsxs("div", { className: "fourty-component-error", role: "alert", "data-component-id": this.props.componentId, children: [
|
|
10282
|
-
/* @__PURE__ */
|
|
10458
|
+
/* @__PURE__ */ jsx22("strong", { children: this.props.componentId }),
|
|
10283
10459
|
": ",
|
|
10284
10460
|
this.state.error.message
|
|
10285
10461
|
] });
|
|
@@ -10339,14 +10515,14 @@ __export(utils_exports, {
|
|
|
10339
10515
|
import { useSyncExternalStore as useSyncExternalStore6 } from "react";
|
|
10340
10516
|
|
|
10341
10517
|
// src/utils/viewport-window.tsx
|
|
10342
|
-
import { createContext as
|
|
10343
|
-
import { jsx as
|
|
10344
|
-
var ViewportWindowContext =
|
|
10518
|
+
import { createContext as createContext26, useContext as useContext26 } from "react";
|
|
10519
|
+
import { jsx as jsx23 } from "react/jsx-runtime";
|
|
10520
|
+
var ViewportWindowContext = createContext26(null);
|
|
10345
10521
|
function canAnswer(win) {
|
|
10346
10522
|
return win !== null && typeof win.matchMedia === "function";
|
|
10347
10523
|
}
|
|
10348
10524
|
function useViewportWindow() {
|
|
10349
|
-
const provided =
|
|
10525
|
+
const provided = useContext26(ViewportWindowContext);
|
|
10350
10526
|
if (provided !== null) return canAnswer(provided) ? provided : null;
|
|
10351
10527
|
const global = globalThis;
|
|
10352
10528
|
return canAnswer(global) ? global : null;
|
|
@@ -10355,7 +10531,7 @@ function ViewportWindowProvider({
|
|
|
10355
10531
|
value,
|
|
10356
10532
|
children
|
|
10357
10533
|
}) {
|
|
10358
|
-
return /* @__PURE__ */
|
|
10534
|
+
return /* @__PURE__ */ jsx23(ViewportWindowContext.Provider, { value, children });
|
|
10359
10535
|
}
|
|
10360
10536
|
|
|
10361
10537
|
// src/utils/use-form-factor.ts
|
|
@@ -10422,13 +10598,13 @@ function useFormFactor() {
|
|
|
10422
10598
|
}
|
|
10423
10599
|
|
|
10424
10600
|
// src/utils/use-inline-completion.ts
|
|
10425
|
-
import { useCallback as
|
|
10601
|
+
import { useCallback as useCallback17, useMemo as useMemo13, useState as useState9 } from "react";
|
|
10426
10602
|
function useInlineCompletion(opts) {
|
|
10427
10603
|
const { value, candidates } = opts;
|
|
10428
10604
|
const minChars = opts.minChars !== void 0 ? opts.minChars : 2;
|
|
10429
10605
|
const enabled = opts.enabled !== void 0 ? opts.enabled : true;
|
|
10430
10606
|
const [dismissedValue, setDismissedValue] = useState9(null);
|
|
10431
|
-
const dismiss =
|
|
10607
|
+
const dismiss = useCallback17(() => setDismissedValue(value), [value]);
|
|
10432
10608
|
return useMemo13(() => {
|
|
10433
10609
|
if (!enabled || value.length < minChars || dismissedValue === value) {
|
|
10434
10610
|
return { completion: "", ghost: "", active: false, dismiss };
|
|
@@ -10446,7 +10622,7 @@ function useInlineCompletion(opts) {
|
|
|
10446
10622
|
}
|
|
10447
10623
|
|
|
10448
10624
|
// src/utils/use-document-visible.ts
|
|
10449
|
-
import
|
|
10625
|
+
import React41 from "react";
|
|
10450
10626
|
function subscribe4(onChange) {
|
|
10451
10627
|
document.addEventListener("visibilitychange", onChange);
|
|
10452
10628
|
return () => document.removeEventListener("visibilitychange", onChange);
|
|
@@ -10458,15 +10634,15 @@ function getServerSnapshot() {
|
|
|
10458
10634
|
return true;
|
|
10459
10635
|
}
|
|
10460
10636
|
function useDocumentVisible() {
|
|
10461
|
-
return
|
|
10637
|
+
return React41.useSyncExternalStore(subscribe4, getSnapshot, getServerSnapshot);
|
|
10462
10638
|
}
|
|
10463
10639
|
|
|
10464
10640
|
// src/utils/use-interval.ts
|
|
10465
|
-
import
|
|
10641
|
+
import React42 from "react";
|
|
10466
10642
|
function useInterval(callback, ms, active = true) {
|
|
10467
|
-
const cbRef =
|
|
10643
|
+
const cbRef = React42.useRef(callback);
|
|
10468
10644
|
cbRef.current = callback;
|
|
10469
|
-
|
|
10645
|
+
React42.useEffect(() => {
|
|
10470
10646
|
if (!active) return;
|
|
10471
10647
|
const id = window.setInterval(() => cbRef.current(), ms);
|
|
10472
10648
|
return () => window.clearInterval(id);
|
|
@@ -10474,7 +10650,7 @@ function useInterval(callback, ms, active = true) {
|
|
|
10474
10650
|
}
|
|
10475
10651
|
|
|
10476
10652
|
// src/utils/use-success-flash.ts
|
|
10477
|
-
import { useCallback as
|
|
10653
|
+
import { useCallback as useCallback18, useEffect as useEffect13, useRef as useRef9, useState as useState10 } from "react";
|
|
10478
10654
|
import { useAnimationControls } from "framer-motion";
|
|
10479
10655
|
function useSuccessFlash(options) {
|
|
10480
10656
|
const duration = options !== void 0 && options.duration !== void 0 ? options.duration : 900;
|
|
@@ -10490,7 +10666,7 @@ function useSuccessFlash(options) {
|
|
|
10490
10666
|
if (timerRef.current !== null) window.clearTimeout(timerRef.current);
|
|
10491
10667
|
};
|
|
10492
10668
|
}, []);
|
|
10493
|
-
const trigger =
|
|
10669
|
+
const trigger = useCallback18(() => {
|
|
10494
10670
|
setFlashing(true);
|
|
10495
10671
|
controls.start({
|
|
10496
10672
|
scale: scaleRef.current,
|
|
@@ -10678,15 +10854,15 @@ function primedEntitiesFor(resolverKey) {
|
|
|
10678
10854
|
}
|
|
10679
10855
|
|
|
10680
10856
|
// src/preview/SpacefrontPreviewProvider.tsx
|
|
10681
|
-
import * as
|
|
10682
|
-
import { jsx as
|
|
10857
|
+
import * as React43 from "react";
|
|
10858
|
+
import { jsx as jsx24 } from "react/jsx-runtime";
|
|
10683
10859
|
var NOOP = () => {
|
|
10684
10860
|
};
|
|
10685
10861
|
var ASYNC_NOOP = () => Promise.resolve();
|
|
10686
10862
|
var VIEW = { page: { kind: "home" }, layout: EMPTY_SPEC, shell: EMPTY_SHELL };
|
|
10687
|
-
var PreviewContext =
|
|
10863
|
+
var PreviewContext = React43.createContext(null);
|
|
10688
10864
|
function usePreview() {
|
|
10689
|
-
const value =
|
|
10865
|
+
const value = React43.useContext(PreviewContext);
|
|
10690
10866
|
if (value === null) throw new Error("preview runtime used outside <SpacefrontPreviewProvider>");
|
|
10691
10867
|
return value;
|
|
10692
10868
|
}
|
|
@@ -10840,11 +11016,11 @@ var PRESENCE = {
|
|
|
10840
11016
|
usePresenceLiveTurn: () => usePreview().pending?.messageId
|
|
10841
11017
|
};
|
|
10842
11018
|
function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
10843
|
-
const [sessionId] =
|
|
10844
|
-
const derived =
|
|
10845
|
-
const onSendRef =
|
|
11019
|
+
const [sessionId] = React43.useState(() => `preview-${Math.random().toString(36).slice(2)}`);
|
|
11020
|
+
const derived = React43.useMemo(() => derive(scene, sessionId), [scene, sessionId]);
|
|
11021
|
+
const onSendRef = React43.useRef(onSend);
|
|
10846
11022
|
onSendRef.current = onSend;
|
|
10847
|
-
const draft =
|
|
11023
|
+
const draft = React43.useMemo(() => {
|
|
10848
11024
|
let text2 = "";
|
|
10849
11025
|
const listeners14 = /* @__PURE__ */ new Set();
|
|
10850
11026
|
return {
|
|
@@ -10860,7 +11036,7 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
|
10860
11036
|
}
|
|
10861
11037
|
};
|
|
10862
11038
|
}, []);
|
|
10863
|
-
const session =
|
|
11039
|
+
const session = React43.useMemo(() => {
|
|
10864
11040
|
const send = (text2) => {
|
|
10865
11041
|
draft.set("");
|
|
10866
11042
|
onSendRef.current?.(text2);
|
|
@@ -10912,15 +11088,15 @@ function SpacefrontPreviewProvider({ scene, onSend, children }) {
|
|
|
10912
11088
|
const qId = question === null ? null : question.id;
|
|
10913
11089
|
const qText = question === null ? "" : question.text;
|
|
10914
11090
|
const qReplies = question === null ? "" : list(question.replies).join("\0");
|
|
10915
|
-
const raised =
|
|
10916
|
-
|
|
11091
|
+
const raised = React43.useRef(0);
|
|
11092
|
+
React43.useEffect(() => {
|
|
10917
11093
|
if (qId === null) return;
|
|
10918
11094
|
raised.current += 1;
|
|
10919
11095
|
const id = `${qId}-${raised.current}`;
|
|
10920
11096
|
raiseStanding(AGENT_ASK_SIGNAL, id, { ask: qText, suggestions: qReplies === "" ? [] : qReplies.split("\0") }, sessionId);
|
|
10921
11097
|
return () => resolveStanding(id, sessionId);
|
|
10922
11098
|
}, [qId, qText, qReplies, sessionId]);
|
|
10923
|
-
return /* @__PURE__ */
|
|
11099
|
+
return /* @__PURE__ */ jsx24(PreviewContext.Provider, { value: derived, children: /* @__PURE__ */ jsx24(FourtySessionContext.Provider, { value: session, children: /* @__PURE__ */ jsx24(FourtyRuntimeProvider, { value: RUNTIME, children: /* @__PURE__ */ jsx24(PresenceRuntimeProvider, { value: PRESENCE, children }) }) }) });
|
|
10924
11100
|
}
|
|
10925
11101
|
|
|
10926
11102
|
// src/verticals/commerce/index.ts
|
|
@@ -11016,9 +11192,12 @@ __export(commerce_exports, {
|
|
|
11016
11192
|
useProductDetail: () => useProductDetail,
|
|
11017
11193
|
useProductGridFilter: () => useProductGridFilter,
|
|
11018
11194
|
useProductReviews: () => useProductReviews,
|
|
11195
|
+
useProductSearch: () => useProductSearch,
|
|
11019
11196
|
useProducts: () => useProducts,
|
|
11020
11197
|
useQueuedDiscountCodes: () => useQueuedDiscountCodes,
|
|
11021
11198
|
useSafeCart: () => useSafeCart,
|
|
11199
|
+
useShopCheckout: () => useShopCheckout,
|
|
11200
|
+
useStoreArticles: () => useStoreArticles,
|
|
11022
11201
|
useStoreCheckouts: () => useStoreCheckouts,
|
|
11023
11202
|
useToggleWishlist: () => useToggleWishlist,
|
|
11024
11203
|
useVariantSelections: () => useVariantSelections,
|
|
@@ -11066,7 +11245,7 @@ registerEntityPageKind("search", {
|
|
|
11066
11245
|
});
|
|
11067
11246
|
|
|
11068
11247
|
// src/verticals/commerce/commerce-context.tsx
|
|
11069
|
-
import { createContext as
|
|
11248
|
+
import { createContext as createContext28, useContext as useContext28 } from "react";
|
|
11070
11249
|
var INERT_COMMERCE_RUNTIME = {
|
|
11071
11250
|
useCart: () => {
|
|
11072
11251
|
throw new Error("useCart must be used within a <CommerceProvider>");
|
|
@@ -11117,14 +11296,24 @@ var INERT_COMMERCE_RUNTIME = {
|
|
|
11117
11296
|
available: false,
|
|
11118
11297
|
ask: () => Promise.reject(new Error("useAskStore needs a <CommerceProvider>")),
|
|
11119
11298
|
pending: false
|
|
11120
|
-
})
|
|
11299
|
+
}),
|
|
11300
|
+
// No commerce, no stores whose articles to read.
|
|
11301
|
+
useStoreArticles: () => ({ available: false, articles: [], isLoading: false }),
|
|
11302
|
+
// No commerce, no bag to check out.
|
|
11303
|
+
useShopCheckout: () => ({
|
|
11304
|
+
available: false,
|
|
11305
|
+
create: () => Promise.reject(new Error("useShopCheckout needs a <CommerceProvider>")),
|
|
11306
|
+
pending: false
|
|
11307
|
+
}),
|
|
11308
|
+
// No commerce, no catalog to search.
|
|
11309
|
+
useProductSearch: () => ({ available: false, products: [], nextCursor: null, isLoading: false, error: null })
|
|
11121
11310
|
};
|
|
11122
|
-
var FourtyCommerceRuntimeContext =
|
|
11311
|
+
var FourtyCommerceRuntimeContext = createContext28(
|
|
11123
11312
|
INERT_COMMERCE_RUNTIME
|
|
11124
11313
|
);
|
|
11125
11314
|
var FourtyCommerceRuntimeProvider = FourtyCommerceRuntimeContext.Provider;
|
|
11126
11315
|
function useCommerceRuntime() {
|
|
11127
|
-
return
|
|
11316
|
+
return useContext28(FourtyCommerceRuntimeContext);
|
|
11128
11317
|
}
|
|
11129
11318
|
function useCart() {
|
|
11130
11319
|
return useCommerceRuntime().useCart();
|
|
@@ -11159,6 +11348,15 @@ function useStoreCheckouts() {
|
|
|
11159
11348
|
function useAskStore() {
|
|
11160
11349
|
return useCommerceRuntime().useAskStore();
|
|
11161
11350
|
}
|
|
11351
|
+
function useStoreArticles(productIds, topic) {
|
|
11352
|
+
return useCommerceRuntime().useStoreArticles(productIds, topic);
|
|
11353
|
+
}
|
|
11354
|
+
function useShopCheckout() {
|
|
11355
|
+
return useCommerceRuntime().useShopCheckout();
|
|
11356
|
+
}
|
|
11357
|
+
function useProductSearch(query, opts) {
|
|
11358
|
+
return useCommerceRuntime().useProductSearch(query, opts);
|
|
11359
|
+
}
|
|
11162
11360
|
|
|
11163
11361
|
// src/verticals/commerce/checkout/external-navigation.ts
|
|
11164
11362
|
function navigateToExternalCommerceUrl(url) {
|
|
@@ -11313,18 +11511,18 @@ __export(ecommerce_exports, {
|
|
|
11313
11511
|
});
|
|
11314
11512
|
|
|
11315
11513
|
// ../spacestation/src/analytics/ecommerce/surfacing.ts
|
|
11316
|
-
import { z as
|
|
11514
|
+
import { z as z51 } from "zod";
|
|
11317
11515
|
var PRODUCTS_SURFACED = defineEventKind(
|
|
11318
11516
|
"commerce.products_surfaced",
|
|
11319
11517
|
"client",
|
|
11320
|
-
|
|
11518
|
+
z51.object({
|
|
11321
11519
|
/** The turn whose commit this describes. Minted where the prompt signal
|
|
11322
11520
|
* is built and shared with `agent_runs`, so the read layer can line a
|
|
11323
11521
|
* surfacing up against the prompt that asked for it. */
|
|
11324
|
-
turnId:
|
|
11522
|
+
turnId: z51.string().min(1).max(128),
|
|
11325
11523
|
/** Distinct entity refs this turn placed that were not on the canvas
|
|
11326
11524
|
* before it. ZERO IS A REAL VALUE — see the header. */
|
|
11327
|
-
productCount:
|
|
11525
|
+
productCount: z51.number().int().nonnegative()
|
|
11328
11526
|
}).strict()
|
|
11329
11527
|
);
|
|
11330
11528
|
|
|
@@ -11346,7 +11544,7 @@ function isFunnelStep(value) {
|
|
|
11346
11544
|
}
|
|
11347
11545
|
|
|
11348
11546
|
// src/verticals/commerce/product/use-product-grid-filter.ts
|
|
11349
|
-
import { useCallback as
|
|
11547
|
+
import { useCallback as useCallback19, useMemo as useMemo15, useState as useState12 } from "react";
|
|
11350
11548
|
function useProductGridFilter(chips) {
|
|
11351
11549
|
const labelKey = useMemo15(() => chips.map((c) => c.label).join("|"), [chips]);
|
|
11352
11550
|
const first = chips[0];
|
|
@@ -11359,17 +11557,17 @@ function useProductGridFilter(chips) {
|
|
|
11359
11557
|
const found = chips.find((c) => c.label === activeLabel);
|
|
11360
11558
|
return found !== void 0 ? found : first;
|
|
11361
11559
|
}, [chips, first, activeLabel, labelKey]);
|
|
11362
|
-
const setActive =
|
|
11560
|
+
const setActive = useCallback19((next) => {
|
|
11363
11561
|
setActiveLabel(next.label);
|
|
11364
11562
|
}, []);
|
|
11365
11563
|
return { chips, active: activeFromKey, setActive };
|
|
11366
11564
|
}
|
|
11367
11565
|
|
|
11368
11566
|
// src/verticals/commerce/product/use-product-detail.ts
|
|
11369
|
-
import { useCallback as
|
|
11567
|
+
import { useCallback as useCallback21, useMemo as useMemo16, useRef as useRef13, useState as useState15 } from "react";
|
|
11370
11568
|
|
|
11371
11569
|
// src/verticals/commerce/checkout/use-buy-now.ts
|
|
11372
|
-
import { useCallback as
|
|
11570
|
+
import { useCallback as useCallback20, useEffect as useEffect16, useState as useState13 } from "react";
|
|
11373
11571
|
|
|
11374
11572
|
// src/verticals/commerce/checkout/checkout-handoff-store.ts
|
|
11375
11573
|
import { useSyncExternalStore as useSyncExternalStore10 } from "react";
|
|
@@ -11510,7 +11708,7 @@ function useBuyNow(addToCart) {
|
|
|
11510
11708
|
const cartApi = useCart();
|
|
11511
11709
|
const analytics = useOptionalAnalyticsSink();
|
|
11512
11710
|
const [pending2, setPending] = useState13(null);
|
|
11513
|
-
const start =
|
|
11711
|
+
const start = useCallback20((variantId) => {
|
|
11514
11712
|
if (pending2 !== null) return;
|
|
11515
11713
|
addToCart();
|
|
11516
11714
|
setPending(variantId);
|
|
@@ -11673,7 +11871,7 @@ function useProductDetail(product) {
|
|
|
11673
11871
|
() => variantGroups.find((g) => selectedVariants[g.name] === void 0),
|
|
11674
11872
|
[variantGroups, selectedVariants]
|
|
11675
11873
|
);
|
|
11676
|
-
const findVariant =
|
|
11874
|
+
const findVariant = useCallback21(
|
|
11677
11875
|
(opts) => matchVariant(product, opts),
|
|
11678
11876
|
[product]
|
|
11679
11877
|
);
|
|
@@ -11684,11 +11882,11 @@ function useProductDetail(product) {
|
|
|
11684
11882
|
const matchIndex = product.images.findIndex((img) => img.url === activeVariantImageUrl);
|
|
11685
11883
|
if (matchIndex >= 0) setSelectedImage(matchIndex);
|
|
11686
11884
|
}
|
|
11687
|
-
const isVariantUnavailable =
|
|
11885
|
+
const isVariantUnavailable = useCallback21(
|
|
11688
11886
|
(group, opt) => isOptionUnavailable(product, selectedVariants, group, opt),
|
|
11689
11887
|
[product, selectedVariants]
|
|
11690
11888
|
);
|
|
11691
|
-
const selectVariant =
|
|
11889
|
+
const selectVariant = useCallback21((group, opt) => {
|
|
11692
11890
|
markTouched();
|
|
11693
11891
|
setSelectedVariants((prev) => ({ ...prev, [group]: opt }));
|
|
11694
11892
|
session.dispatchSignal({
|
|
@@ -11697,7 +11895,7 @@ function useProductDetail(product) {
|
|
|
11697
11895
|
});
|
|
11698
11896
|
optimisticFacts.add({ label: group, value: opt });
|
|
11699
11897
|
}, [session, product.id, markTouched, setSelectedVariants, optimisticFacts]);
|
|
11700
|
-
const addPicked =
|
|
11898
|
+
const addPicked = useCallback21((acknowledgeInDrawer) => {
|
|
11701
11899
|
if (!allSelected) return;
|
|
11702
11900
|
const variant = findVariant(selectedVariants);
|
|
11703
11901
|
if (variant === void 0) {
|
|
@@ -11721,10 +11919,10 @@ function useProductDetail(product) {
|
|
|
11721
11919
|
}
|
|
11722
11920
|
});
|
|
11723
11921
|
}, [allSelected, findVariant, product.id, product.title, product.images, selectedVariants, session]);
|
|
11724
|
-
const onAddToBag =
|
|
11725
|
-
const addForBuyNow =
|
|
11922
|
+
const onAddToBag = useCallback21(() => addPicked(true), [addPicked]);
|
|
11923
|
+
const addForBuyNow = useCallback21(() => addPicked(false), [addPicked]);
|
|
11726
11924
|
const buyNow = useBuyNow(addForBuyNow);
|
|
11727
|
-
const onBuyNow =
|
|
11925
|
+
const onBuyNow = useCallback21(() => {
|
|
11728
11926
|
if (!allSelected) return;
|
|
11729
11927
|
const variant = findVariant(selectedVariants);
|
|
11730
11928
|
if (variant === void 0) {
|
|
@@ -11733,10 +11931,10 @@ function useProductDetail(product) {
|
|
|
11733
11931
|
}
|
|
11734
11932
|
buyNow.start(variant.id);
|
|
11735
11933
|
}, [allSelected, findVariant, selectedVariants, buyNow]);
|
|
11736
|
-
const onAskAgent =
|
|
11934
|
+
const onAskAgent = useCallback21(() => {
|
|
11737
11935
|
session.sendMessage(`Tell me more about the ${product.title}`);
|
|
11738
11936
|
}, [session, product.title]);
|
|
11739
|
-
const onPickSibling =
|
|
11937
|
+
const onPickSibling = useCallback21((sibling) => {
|
|
11740
11938
|
if (sibling.current === true) return;
|
|
11741
11939
|
session.dispatchSuggestionAction({
|
|
11742
11940
|
id: `navigate-product-${sibling.id}`,
|
|
@@ -11751,7 +11949,7 @@ function useProductDetail(product) {
|
|
|
11751
11949
|
payload: { page: { kind: "product", id: sibling.id, morph: true } }
|
|
11752
11950
|
});
|
|
11753
11951
|
}, [session]);
|
|
11754
|
-
const toggleZoom =
|
|
11952
|
+
const toggleZoom = useCallback21(() => setZoomed((p) => !p), []);
|
|
11755
11953
|
return {
|
|
11756
11954
|
selectedImage,
|
|
11757
11955
|
selectImage: setSelectedImage,
|
|
@@ -11778,7 +11976,7 @@ function useProductDetail(product) {
|
|
|
11778
11976
|
}
|
|
11779
11977
|
|
|
11780
11978
|
// src/verticals/commerce/comparison/use-comparison-table.ts
|
|
11781
|
-
import { useCallback as
|
|
11979
|
+
import { useCallback as useCallback22 } from "react";
|
|
11782
11980
|
function classifyComparisonValue(v) {
|
|
11783
11981
|
if (v === void 0) return { kind: "value", value: "" };
|
|
11784
11982
|
if (v === true || v === "true" || v === "Yes") return { kind: "true" };
|
|
@@ -11786,7 +11984,7 @@ function classifyComparisonValue(v) {
|
|
|
11786
11984
|
return { kind: "value", value: v };
|
|
11787
11985
|
}
|
|
11788
11986
|
function useComparisonHighlight(highlightedId) {
|
|
11789
|
-
const isHighlighted =
|
|
11987
|
+
const isHighlighted = useCallback22(
|
|
11790
11988
|
(id) => id === highlightedId,
|
|
11791
11989
|
[highlightedId]
|
|
11792
11990
|
);
|
|
@@ -11794,7 +11992,7 @@ function useComparisonHighlight(highlightedId) {
|
|
|
11794
11992
|
}
|
|
11795
11993
|
|
|
11796
11994
|
// src/verticals/commerce/cart/use-cart-drawer.ts
|
|
11797
|
-
import { useCallback as
|
|
11995
|
+
import { useCallback as useCallback23 } from "react";
|
|
11798
11996
|
|
|
11799
11997
|
// src/verticals/commerce/cart/use-safe-cart.ts
|
|
11800
11998
|
var warnedCart = false;
|
|
@@ -11885,9 +12083,9 @@ registerSessionScopedClear(() => {
|
|
|
11885
12083
|
function useCartDrawer() {
|
|
11886
12084
|
const cart = useSafeCart();
|
|
11887
12085
|
const isOpen2 = useCartDrawerOpen();
|
|
11888
|
-
const open =
|
|
11889
|
-
const close =
|
|
11890
|
-
const toggle =
|
|
12086
|
+
const open = useCallback23(() => openCartDrawer(), []);
|
|
12087
|
+
const close = useCallback23(() => closeCartDrawer(), []);
|
|
12088
|
+
const toggle = useCallback23(() => toggleCartDrawer(), []);
|
|
11891
12089
|
return {
|
|
11892
12090
|
isOpen: isOpen2,
|
|
11893
12091
|
open,
|
|
@@ -11904,7 +12102,7 @@ function useCartDrawer() {
|
|
|
11904
12102
|
}
|
|
11905
12103
|
|
|
11906
12104
|
// src/verticals/commerce/cart/use-cart-view.ts
|
|
11907
|
-
import
|
|
12105
|
+
import React44 from "react";
|
|
11908
12106
|
|
|
11909
12107
|
// src/verticals/commerce/cart/queued-discount-codes.ts
|
|
11910
12108
|
import { useSyncExternalStore as useSyncExternalStore12 } from "react";
|
|
@@ -11963,7 +12161,7 @@ registerSessionScopedClear(() => {
|
|
|
11963
12161
|
// src/verticals/commerce/cart/use-cart-view.ts
|
|
11964
12162
|
function useCartView(cart, onCheckout) {
|
|
11965
12163
|
const analytics = useOptionalAnalyticsSink();
|
|
11966
|
-
const [exitPending, setExitPending] =
|
|
12164
|
+
const [exitPending, setExitPending] = React44.useState(null);
|
|
11967
12165
|
const lines = cart === null ? [] : cart.lines;
|
|
11968
12166
|
const count = lines.reduce((sum, l) => sum + l.quantity, 0);
|
|
11969
12167
|
const totalsPending = lines.some((l) => isPendingCartLine(l));
|
|
@@ -11974,7 +12172,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11974
12172
|
const backendTotal = cart !== null && cart.total !== void 0 ? cart.total.amount : void 0;
|
|
11975
12173
|
const discountAmount = backendTotal !== void 0 && backendTotal < subtotal ? subtotal - backendTotal : 0;
|
|
11976
12174
|
const effectiveTotal = backendTotal !== void 0 ? backendTotal : subtotal;
|
|
11977
|
-
const navigateToExit =
|
|
12175
|
+
const navigateToExit = React44.useCallback((url, kind) => {
|
|
11978
12176
|
const result = navigateToExternalCommerceUrl(url);
|
|
11979
12177
|
if (kind === "checkout") recordVisitorCheckoutExit(analytics, result);
|
|
11980
12178
|
if (result === "new-tab") {
|
|
@@ -11991,7 +12189,7 @@ function useCartView(cart, onCheckout) {
|
|
|
11991
12189
|
setExitPending(null);
|
|
11992
12190
|
}
|
|
11993
12191
|
}, [analytics]);
|
|
11994
|
-
const handleCheckout =
|
|
12192
|
+
const handleCheckout = React44.useCallback(() => {
|
|
11995
12193
|
if (lines.length === 0 || exitPending !== null) return;
|
|
11996
12194
|
setExitPending("checkout");
|
|
11997
12195
|
if (onCheckout) {
|
|
@@ -12011,7 +12209,7 @@ function useCartView(cart, onCheckout) {
|
|
|
12011
12209
|
}
|
|
12012
12210
|
navigateToExit(cart?.checkoutUrl, "checkout");
|
|
12013
12211
|
}, [lines.length, exitPending, onCheckout, cart, navigateToExit]);
|
|
12014
|
-
const handleGoToStore =
|
|
12212
|
+
const handleGoToStore = React44.useCallback(() => {
|
|
12015
12213
|
if (lines.length === 0 || exitPending !== null) return;
|
|
12016
12214
|
setExitPending("store");
|
|
12017
12215
|
navigateToExit(cart?.storeCartUrl, "store");
|
|
@@ -12099,20 +12297,20 @@ registerSessionScopedClear(() => {
|
|
|
12099
12297
|
});
|
|
12100
12298
|
|
|
12101
12299
|
// src/verticals/commerce/cart/use-cart-line-row.ts
|
|
12102
|
-
import * as
|
|
12300
|
+
import * as React45 from "react";
|
|
12103
12301
|
|
|
12104
12302
|
// src/verticals/commerce/use-commerce-actions.ts
|
|
12105
|
-
import { useCallback as
|
|
12303
|
+
import { useCallback as useCallback24 } from "react";
|
|
12106
12304
|
function useCommerceActions() {
|
|
12107
12305
|
const canvas = useCanvasActions();
|
|
12108
|
-
const navigateToProduct =
|
|
12306
|
+
const navigateToProduct = useCallback24(
|
|
12109
12307
|
(productId, title) => {
|
|
12110
12308
|
if (!canvas) return;
|
|
12111
12309
|
canvas.navigate({ kind: "product", id: productId }, title);
|
|
12112
12310
|
},
|
|
12113
12311
|
[canvas]
|
|
12114
12312
|
);
|
|
12115
|
-
const showCollection =
|
|
12313
|
+
const showCollection = useCallback24(
|
|
12116
12314
|
(collectionTitle) => {
|
|
12117
12315
|
if (!canvas) return;
|
|
12118
12316
|
canvas.dispatchAction({
|
|
@@ -12124,7 +12322,7 @@ function useCommerceActions() {
|
|
|
12124
12322
|
},
|
|
12125
12323
|
[canvas]
|
|
12126
12324
|
);
|
|
12127
|
-
const navigateToProductSet =
|
|
12325
|
+
const navigateToProductSet = useCallback24(
|
|
12128
12326
|
(handle, title, productIds) => {
|
|
12129
12327
|
if (!canvas) return;
|
|
12130
12328
|
canvas.dispatchAction({
|
|
@@ -12145,19 +12343,19 @@ var SPOTLIGHT_MAX_AGE_MS = 3e4;
|
|
|
12145
12343
|
function useCartLineRow(line, opts) {
|
|
12146
12344
|
const actions = useCommerceActions();
|
|
12147
12345
|
const drawerFocus = useCartDrawerFocus();
|
|
12148
|
-
const rowRef =
|
|
12346
|
+
const rowRef = React45.useRef(null);
|
|
12149
12347
|
const pending2 = isPendingCartLine(line);
|
|
12150
12348
|
const navigable = actions !== null && !pending2 && line.productId.length > 0;
|
|
12151
12349
|
const onNavigated = opts === void 0 ? void 0 : opts.onNavigated;
|
|
12152
|
-
const navigatedRef =
|
|
12350
|
+
const navigatedRef = React45.useRef(onNavigated);
|
|
12153
12351
|
navigatedRef.current = onNavigated;
|
|
12154
|
-
const navigate =
|
|
12352
|
+
const navigate = React45.useCallback(() => {
|
|
12155
12353
|
if (actions === null) return;
|
|
12156
12354
|
actions.navigateToProduct(line.productId, line.title);
|
|
12157
12355
|
const done = navigatedRef.current;
|
|
12158
12356
|
if (done !== void 0) done();
|
|
12159
12357
|
}, [actions, line.productId, line.title]);
|
|
12160
|
-
const interaction =
|
|
12358
|
+
const interaction = React45.useMemo(() => {
|
|
12161
12359
|
if (!navigable) return void 0;
|
|
12162
12360
|
return {
|
|
12163
12361
|
onClick: navigate,
|
|
@@ -12172,7 +12370,7 @@ function useCartLineRow(line, opts) {
|
|
|
12172
12370
|
};
|
|
12173
12371
|
}, [navigable, navigate]);
|
|
12174
12372
|
const spotlightKey = drawerFocus !== null && !pending2 && line.productId.length > 0 && drawerFocus.productId === line.productId && Date.now() - drawerFocus.at < SPOTLIGHT_MAX_AGE_MS ? drawerFocus.at : null;
|
|
12175
|
-
|
|
12373
|
+
React45.useEffect(() => {
|
|
12176
12374
|
if (spotlightKey === null) return;
|
|
12177
12375
|
const node = rowRef.current;
|
|
12178
12376
|
if (node === null) return;
|
|
@@ -12182,7 +12380,7 @@ function useCartLineRow(line, opts) {
|
|
|
12182
12380
|
}
|
|
12183
12381
|
|
|
12184
12382
|
// src/verticals/commerce/wishlist/use-wishlist-drawer.ts
|
|
12185
|
-
import { useCallback as
|
|
12383
|
+
import { useCallback as useCallback26, useState as useState16 } from "react";
|
|
12186
12384
|
var warnedDegraded = false;
|
|
12187
12385
|
function useSafeWishlist() {
|
|
12188
12386
|
try {
|
|
@@ -12206,11 +12404,11 @@ function useSafeWishlist() {
|
|
|
12206
12404
|
function useWishlistDrawer() {
|
|
12207
12405
|
const wishlist = useSafeWishlist();
|
|
12208
12406
|
const [isOpen2, setIsOpen] = useState16(false);
|
|
12209
|
-
const open =
|
|
12210
|
-
const close =
|
|
12211
|
-
const toggle =
|
|
12407
|
+
const open = useCallback26(() => setIsOpen(true), []);
|
|
12408
|
+
const close = useCallback26(() => setIsOpen(false), []);
|
|
12409
|
+
const toggle = useCallback26(() => setIsOpen((p) => !p), []);
|
|
12212
12410
|
useExclusiveOverlay("wishlist", isOpen2, close);
|
|
12213
|
-
const removeLine =
|
|
12411
|
+
const removeLine = useCallback26(
|
|
12214
12412
|
(productId) => {
|
|
12215
12413
|
if (wishlist === null) {
|
|
12216
12414
|
console.warn("[useWishlistDrawer] removeLine called with no commerce provider");
|
|
@@ -12317,7 +12515,7 @@ function pickColorCount(product) {
|
|
|
12317
12515
|
}
|
|
12318
12516
|
|
|
12319
12517
|
// src/verticals/commerce/product/use-look-card.ts
|
|
12320
|
-
import * as
|
|
12518
|
+
import * as React46 from "react";
|
|
12321
12519
|
|
|
12322
12520
|
// src/verticals/commerce/variant/variant-option-axes.ts
|
|
12323
12521
|
function carriesValue(variant, name, value) {
|
|
@@ -12527,8 +12725,8 @@ function useLookCard({
|
|
|
12527
12725
|
const session = useFourtySession();
|
|
12528
12726
|
const addFlash = useSuccessFlash({ duration: 1200 });
|
|
12529
12727
|
const locale = useSpaceLocale();
|
|
12530
|
-
const [pending2, setPending] =
|
|
12531
|
-
const clean =
|
|
12728
|
+
const [pending2, setPending] = React46.useState(null);
|
|
12729
|
+
const clean = React46.useMemo(
|
|
12532
12730
|
() => (Array.isArray(products) ? products : []).filter(
|
|
12533
12731
|
(p) => p !== null && p !== void 0 && typeof p === "object"
|
|
12534
12732
|
),
|
|
@@ -12853,17 +13051,17 @@ function resolveSwatchColor(name) {
|
|
|
12853
13051
|
}
|
|
12854
13052
|
|
|
12855
13053
|
// src/verticals/content/use-content-actions.ts
|
|
12856
|
-
import { useCallback as
|
|
13054
|
+
import { useCallback as useCallback27 } from "react";
|
|
12857
13055
|
function useContentActions() {
|
|
12858
13056
|
const canvas = useCanvasActions();
|
|
12859
|
-
const navigateToArticle =
|
|
13057
|
+
const navigateToArticle = useCallback27(
|
|
12860
13058
|
(articleId, title) => {
|
|
12861
13059
|
if (!canvas) return;
|
|
12862
13060
|
canvas.navigate({ kind: "article", id: articleId }, title);
|
|
12863
13061
|
},
|
|
12864
13062
|
[canvas]
|
|
12865
13063
|
);
|
|
12866
|
-
const subscribeNewsletter =
|
|
13064
|
+
const subscribeNewsletter = useCallback27(
|
|
12867
13065
|
(email, buttonLabel) => {
|
|
12868
13066
|
if (!canvas) return;
|
|
12869
13067
|
canvas.dispatchAction({
|
|
@@ -12883,7 +13081,7 @@ function useContentActions() {
|
|
|
12883
13081
|
import { useEffect as useEffect19, useState as useState19 } from "react";
|
|
12884
13082
|
|
|
12885
13083
|
// package.json
|
|
12886
|
-
var version = "0.5.
|
|
13084
|
+
var version = "0.5.20";
|
|
12887
13085
|
|
|
12888
13086
|
// src/host/host-modules.ts
|
|
12889
13087
|
import * as react from "react";
|
|
@@ -12944,7 +13142,7 @@ function loadEngine(apiUrl) {
|
|
|
12944
13142
|
}
|
|
12945
13143
|
|
|
12946
13144
|
// src/host/Spacefront.tsx
|
|
12947
|
-
import { jsx as
|
|
13145
|
+
import { jsx as jsx25 } from "react/jsx-runtime";
|
|
12948
13146
|
function Spacefront(props) {
|
|
12949
13147
|
const [engine, setEngine] = useState19(null);
|
|
12950
13148
|
const [failure, setFailure] = useState19(null);
|
|
@@ -12966,11 +13164,11 @@ function Spacefront(props) {
|
|
|
12966
13164
|
if (failure !== null) throw failure;
|
|
12967
13165
|
if (engine === null) return null;
|
|
12968
13166
|
const EngineRoot = engine.EngineRoot;
|
|
12969
|
-
return /* @__PURE__ */
|
|
13167
|
+
return /* @__PURE__ */ jsx25(EngineRoot, { ...props });
|
|
12970
13168
|
}
|
|
12971
13169
|
|
|
12972
13170
|
// src/npm.ts
|
|
12973
|
-
import { z as
|
|
13171
|
+
import { z as z53 } from "zod";
|
|
12974
13172
|
export {
|
|
12975
13173
|
ACQUISITION_KIND_LABELS,
|
|
12976
13174
|
ACTIVE_PANEL_ATTR,
|
|
@@ -12987,6 +13185,7 @@ export {
|
|
|
12987
13185
|
ARRIVAL_MAX_VALUE_CHARS,
|
|
12988
13186
|
ARRIVAL_PARAMS,
|
|
12989
13187
|
ATTACHMENT_ACCEPT,
|
|
13188
|
+
ATTENTION_NAMESPACE,
|
|
12990
13189
|
AgentDirectiveSchema,
|
|
12991
13190
|
AgentOutputSchema,
|
|
12992
13191
|
AgentSessionSummarySchema,
|
|
@@ -12997,6 +13196,7 @@ export {
|
|
|
12997
13196
|
AttachmentRefSchema,
|
|
12998
13197
|
AttachmentRefsSchema,
|
|
12999
13198
|
AttachmentUploadError,
|
|
13199
|
+
AttentionSchema,
|
|
13000
13200
|
AttributeDefSchema,
|
|
13001
13201
|
AttributeScopeBucketSchema,
|
|
13002
13202
|
AttributeScopeConfigSchema,
|
|
@@ -13049,6 +13249,7 @@ export {
|
|
|
13049
13249
|
CanvasOutletProvider,
|
|
13050
13250
|
CanvasTailMount,
|
|
13051
13251
|
CanvasTailProvider,
|
|
13252
|
+
CanvasTurnTailProvider,
|
|
13052
13253
|
CartAddSignalPayloadSchema,
|
|
13053
13254
|
CartDiscountCodeSchema,
|
|
13054
13255
|
CartLineSchema,
|
|
@@ -13090,6 +13291,7 @@ export {
|
|
|
13090
13291
|
EXTEND_FLOW,
|
|
13091
13292
|
EXTRAS_PREFIX,
|
|
13092
13293
|
ElementIdContext,
|
|
13294
|
+
ElementLayoutContext,
|
|
13093
13295
|
EntryContextNamespaceSchema,
|
|
13094
13296
|
EntryContextSchema,
|
|
13095
13297
|
EntryContextValueSchema,
|
|
@@ -13141,6 +13343,7 @@ export {
|
|
|
13141
13343
|
NullComponent,
|
|
13142
13344
|
OLDEST_SUPPORTED_SDK,
|
|
13143
13345
|
PAGELESS_HOST_PLACE,
|
|
13346
|
+
POINTING_NAMESPACE,
|
|
13144
13347
|
PRESENCE_CANVAS_REFRESH_SIGNAL,
|
|
13145
13348
|
PRESENCE_FACT_DISMISS_SIGNAL,
|
|
13146
13349
|
PRESENCE_FLOW,
|
|
@@ -13156,6 +13359,7 @@ export {
|
|
|
13156
13359
|
PackageReleaseSchema,
|
|
13157
13360
|
PageSchema,
|
|
13158
13361
|
PatchSchema,
|
|
13362
|
+
PointedAtSchema,
|
|
13159
13363
|
PresenceRuntimeProvider,
|
|
13160
13364
|
ProductReviewDataSchema,
|
|
13161
13365
|
ProductReviewHighlightSchema,
|
|
@@ -13239,6 +13443,7 @@ export {
|
|
|
13239
13443
|
THREAD_ROW_ATTR,
|
|
13240
13444
|
TRAFFIC_BUCKETS,
|
|
13241
13445
|
TURN_ASK_SIGNAL,
|
|
13446
|
+
TURN_TAIL_ATTR,
|
|
13242
13447
|
ThreadHeadroom,
|
|
13243
13448
|
ToolCallHintSchema,
|
|
13244
13449
|
TraceRecordSchema,
|
|
@@ -13311,8 +13516,11 @@ export {
|
|
|
13311
13516
|
classifyItemChange,
|
|
13312
13517
|
clearAgentPresence,
|
|
13313
13518
|
clearCartActionFailures,
|
|
13519
|
+
clearCatalogSearches,
|
|
13314
13520
|
clearCodeDiscountSources,
|
|
13315
13521
|
clearProductNameLookups,
|
|
13522
|
+
clearShopCheckouts,
|
|
13523
|
+
clearStoreArticleLookups,
|
|
13316
13524
|
clearStoreThemeSources,
|
|
13317
13525
|
clearVariantChoice,
|
|
13318
13526
|
clientStateEntries,
|
|
@@ -13459,6 +13667,7 @@ export {
|
|
|
13459
13667
|
recordVisitorCheckoutExit,
|
|
13460
13668
|
reducePatch,
|
|
13461
13669
|
refuseCheckoutHandoff,
|
|
13670
|
+
registerCatalogSearch,
|
|
13462
13671
|
registerChipRelevanceRule,
|
|
13463
13672
|
registerCodeDiscountSource,
|
|
13464
13673
|
registerComponent,
|
|
@@ -13474,6 +13683,8 @@ export {
|
|
|
13474
13683
|
registerProductNameLookup,
|
|
13475
13684
|
registerServiceHydrators,
|
|
13476
13685
|
registerSessionScopedClear,
|
|
13686
|
+
registerShopCheckout,
|
|
13687
|
+
registerStoreArticleLookup,
|
|
13477
13688
|
registerStoreThemeSource,
|
|
13478
13689
|
registeredPageKinds,
|
|
13479
13690
|
registeredPresenceFactForms,
|
|
@@ -13486,6 +13697,7 @@ export {
|
|
|
13486
13697
|
requestVariantChoice,
|
|
13487
13698
|
requiredTopLevelProps,
|
|
13488
13699
|
resetServerState,
|
|
13700
|
+
resolveCatalogSearch,
|
|
13489
13701
|
resolveCodeDiscountSource,
|
|
13490
13702
|
resolveHydrators,
|
|
13491
13703
|
resolvePresenceFactForm,
|
|
@@ -13495,8 +13707,10 @@ export {
|
|
|
13495
13707
|
resolveProductVariant,
|
|
13496
13708
|
resolveScope,
|
|
13497
13709
|
resolveServiceHydrators,
|
|
13710
|
+
resolveShopCheckout,
|
|
13498
13711
|
resolveStanding,
|
|
13499
13712
|
resolveStorage,
|
|
13713
|
+
resolveStoreArticleLookup,
|
|
13500
13714
|
resolveStoreThemeSource,
|
|
13501
13715
|
resolveSwatchColor,
|
|
13502
13716
|
resolveType,
|
|
@@ -13548,6 +13762,7 @@ export {
|
|
|
13548
13762
|
turnAskSegments,
|
|
13549
13763
|
turnEditedBlock,
|
|
13550
13764
|
turnOwnsView,
|
|
13765
|
+
turnTailSlots,
|
|
13551
13766
|
useAction,
|
|
13552
13767
|
useAddToCart,
|
|
13553
13768
|
useAgentDriven,
|
|
@@ -13557,6 +13772,7 @@ export {
|
|
|
13557
13772
|
useAgentPresenceFrame,
|
|
13558
13773
|
useAgentPresenceFresh,
|
|
13559
13774
|
useAnalyticsSink,
|
|
13775
|
+
useAskAbout,
|
|
13560
13776
|
useAskStore,
|
|
13561
13777
|
useBotCheckNotice,
|
|
13562
13778
|
useCanvasActions,
|
|
@@ -13567,6 +13783,7 @@ export {
|
|
|
13567
13783
|
useCanvasLeadTarget,
|
|
13568
13784
|
useCanvasMotionStyle,
|
|
13569
13785
|
useCanvasTail,
|
|
13786
|
+
useCanvasTurnTail,
|
|
13570
13787
|
useCanvasViewBack,
|
|
13571
13788
|
useCart,
|
|
13572
13789
|
useCartActionFailures,
|
|
@@ -13605,6 +13822,7 @@ export {
|
|
|
13605
13822
|
useDockState,
|
|
13606
13823
|
useDocumentVisible,
|
|
13607
13824
|
useElementId,
|
|
13825
|
+
useElementLayout,
|
|
13608
13826
|
useExclusiveOverlay,
|
|
13609
13827
|
useExplicitTurnId,
|
|
13610
13828
|
useExplicitTurnSelection,
|
|
@@ -13657,6 +13875,7 @@ export {
|
|
|
13657
13875
|
useProductDetail,
|
|
13658
13876
|
useProductGridFilter,
|
|
13659
13877
|
useProductReviews,
|
|
13878
|
+
useProductSearch,
|
|
13660
13879
|
useProducts,
|
|
13661
13880
|
useProjection,
|
|
13662
13881
|
usePromptComposer,
|
|
@@ -13678,8 +13897,10 @@ export {
|
|
|
13678
13897
|
useSessionState,
|
|
13679
13898
|
useShellRegistry,
|
|
13680
13899
|
useShellRoot,
|
|
13900
|
+
useShopCheckout,
|
|
13681
13901
|
useSpaceLocale,
|
|
13682
13902
|
useStandingOfType,
|
|
13903
|
+
useStoreArticles,
|
|
13683
13904
|
useStoreCheckouts,
|
|
13684
13905
|
useStream,
|
|
13685
13906
|
useSuccessFlash,
|
|
@@ -13716,5 +13937,5 @@ export {
|
|
|
13716
13937
|
withQueuedDiscountCodes,
|
|
13717
13938
|
withSignalTurn,
|
|
13718
13939
|
withoutClosingQuestion,
|
|
13719
|
-
|
|
13940
|
+
z53 as z
|
|
13720
13941
|
};
|