dreamboard 0.1.21 → 0.1.22
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/{chunk-EYYWGWTO.js → chunk-2RCUHMGL.js} +343 -1911
- package/dist/chunk-2RCUHMGL.js.map +1 -0
- package/dist/{chunk-MOVHYB6E.js → chunk-AQ5UUNJS.js} +1018 -692
- package/dist/chunk-AQ5UUNJS.js.map +1 -0
- package/dist/{chunk-BMYC6772.js → chunk-H3O43F5P.js} +9765 -3068
- package/dist/chunk-H3O43F5P.js.map +1 -0
- package/dist/dev-host/dev-api-proxy-plugin.ts +330 -0
- package/dist/dev-host/dev-diagnostics.ts +62 -0
- package/dist/dev-host/dev-fallback-stylesheet.ts +50 -0
- package/dist/dev-host/dev-host-controller.ts +686 -0
- package/dist/dev-host/dev-host-player-query.ts +17 -0
- package/dist/dev-host/dev-host-session-transport.ts +52 -0
- package/dist/dev-host/dev-host-storage.ts +56 -0
- package/dist/dev-host/dev-log-relay-plugin.ts +469 -0
- package/dist/dev-host/dev-runtime-config.ts +14 -0
- package/dist/dev-host/dev-runtime-platform.ts +419 -0
- package/dist/dev-host/dev-virtual-modules-plugin.ts +63 -0
- package/dist/dev-host/host-main.css +182 -0
- package/dist/dev-host/host-main.tsx +754 -0
- package/dist/dev-host/index.html +56 -0
- package/dist/dev-host/plugin-main.ts +55 -0
- package/dist/dev-host/plugin.html +24 -0
- package/dist/dev-host/start-dev-server.ts +138 -0
- package/dist/dev-host/virtual-modules.d.ts +27 -0
- package/dist/dist-FEPN3BDN.js +16543 -0
- package/dist/dist-FEPN3BDN.js.map +1 -0
- package/dist/{dist-WJRJNFLI.js → dist-FRURQI7Q.js} +4 -2
- package/dist/index.js +3 -3
- package/dist/internal.js +159 -124
- package/dist/internal.js.map +1 -1
- package/dist/runtime-packages/tailwind-config/shared-styles.css +146 -0
- package/dist/runtime-packages/ui/src/components/.gitkeep +0 -0
- package/dist/runtime-packages/ui/src/components/accordion.tsx +66 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/actions.tsx +65 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/artifact.tsx +147 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/branch.tsx +215 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/canvas.tsx +22 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/chain-of-thought.tsx +228 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/code-block.tsx +179 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/confirmation.tsx +158 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/connection.tsx +28 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/context.tsx +408 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/controls.tsx +18 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/conversation.tsx +97 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/edge.tsx +140 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/image.tsx +24 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/inline-citation.tsx +287 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/loader.tsx +96 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/message.tsx +463 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/node.tsx +71 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/open-in-chat.tsx +365 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/panel.tsx +15 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/plan.tsx +142 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/prompt-input.tsx +1380 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/queue.tsx +274 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/reasoning.tsx +182 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/response.tsx +22 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/shimmer.tsx +64 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/sources.tsx +77 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/suggestion.tsx +53 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/task.tsx +87 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/tool.tsx +165 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/toolbar.tsx +16 -0
- package/dist/runtime-packages/ui/src/components/ai-elements/web-preview.tsx +263 -0
- package/dist/runtime-packages/ui/src/components/alert-dialog.tsx +157 -0
- package/dist/runtime-packages/ui/src/components/alert.tsx +66 -0
- package/dist/runtime-packages/ui/src/components/avatar.tsx +53 -0
- package/dist/runtime-packages/ui/src/components/badge.tsx +46 -0
- package/dist/runtime-packages/ui/src/components/button-group.tsx +83 -0
- package/dist/runtime-packages/ui/src/components/button.tsx +65 -0
- package/dist/runtime-packages/ui/src/components/card.tsx +92 -0
- package/dist/runtime-packages/ui/src/components/carousel.tsx +241 -0
- package/dist/runtime-packages/ui/src/components/collapsible.tsx +33 -0
- package/dist/runtime-packages/ui/src/components/command.tsx +184 -0
- package/dist/runtime-packages/ui/src/components/context-menu.tsx +252 -0
- package/dist/runtime-packages/ui/src/components/counter.tsx +11 -0
- package/dist/runtime-packages/ui/src/components/dialog.tsx +146 -0
- package/dist/runtime-packages/ui/src/components/drawer.tsx +132 -0
- package/dist/runtime-packages/ui/src/components/dropdown-menu.tsx +257 -0
- package/dist/runtime-packages/ui/src/components/form.tsx +168 -0
- package/dist/runtime-packages/ui/src/components/header.tsx +13 -0
- package/dist/runtime-packages/ui/src/components/hover-card.tsx +44 -0
- package/dist/runtime-packages/ui/src/components/input-group.tsx +178 -0
- package/dist/runtime-packages/ui/src/components/input.tsx +21 -0
- package/dist/runtime-packages/ui/src/components/item.tsx +193 -0
- package/dist/runtime-packages/ui/src/components/label.tsx +24 -0
- package/dist/runtime-packages/ui/src/components/navigation-menu.tsx +168 -0
- package/dist/runtime-packages/ui/src/components/popover.tsx +55 -0
- package/dist/runtime-packages/ui/src/components/progress.tsx +31 -0
- package/dist/runtime-packages/ui/src/components/radio-group.tsx +45 -0
- package/dist/runtime-packages/ui/src/components/resizable.tsx +56 -0
- package/dist/runtime-packages/ui/src/components/scroll-area.tsx +58 -0
- package/dist/runtime-packages/ui/src/components/select.tsx +187 -0
- package/dist/runtime-packages/ui/src/components/separator.tsx +28 -0
- package/dist/runtime-packages/ui/src/components/skeleton.tsx +13 -0
- package/dist/runtime-packages/ui/src/components/sonner.tsx +25 -0
- package/dist/runtime-packages/ui/src/components/spinner.tsx +16 -0
- package/dist/runtime-packages/ui/src/components/switch.tsx +31 -0
- package/dist/runtime-packages/ui/src/components/table.tsx +137 -0
- package/dist/runtime-packages/ui/src/components/tabs.tsx +74 -0
- package/dist/runtime-packages/ui/src/components/textarea.tsx +23 -0
- package/dist/runtime-packages/ui/src/components/theme-provider.tsx +73 -0
- package/dist/runtime-packages/ui/src/components/tooltip.tsx +61 -0
- package/dist/runtime-packages/ui/src/components/ui/file-upload.tsx +195 -0
- package/dist/runtime-packages/ui/src/hooks/.gitkeep +0 -0
- package/dist/runtime-packages/ui/src/index.ts +68 -0
- package/dist/runtime-packages/ui/src/lib/utils.ts +6 -0
- package/dist/runtime-packages/ui-host-runtime/src/actor-principal.ts +68 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/host-controls.tsx +359 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback-toaster.tsx +274 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/host-feedback.tsx +214 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/host-session-metadata.tsx +135 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/index.ts +5 -0
- package/dist/runtime-packages/ui-host-runtime/src/components/perf-overlay.tsx +194 -0
- package/dist/runtime-packages/ui-host-runtime/src/host-controls.tsx +1 -0
- package/dist/runtime-packages/ui-host-runtime/src/host-feedback.tsx +1 -0
- package/dist/runtime-packages/ui-host-runtime/src/host-session-transport.ts +162 -0
- package/dist/runtime-packages/ui-host-runtime/src/index.ts +2 -0
- package/dist/runtime-packages/ui-host-runtime/src/logger.ts +11 -0
- package/dist/runtime-packages/ui-host-runtime/src/perf.ts +253 -0
- package/dist/runtime-packages/ui-host-runtime/src/plugin-bridge.ts +195 -0
- package/dist/runtime-packages/ui-host-runtime/src/plugin-health-check.ts +138 -0
- package/dist/runtime-packages/ui-host-runtime/src/plugin-messages.ts +159 -0
- package/dist/runtime-packages/ui-host-runtime/src/plugin-session-gateway.ts +524 -0
- package/dist/runtime-packages/ui-host-runtime/src/runtime/index.ts +12 -0
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/projection-to-snapshot.ts +122 -0
- package/dist/runtime-packages/ui-host-runtime/src/screenshot/static-store-api.ts +26 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress-controller.ts +477 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-ingress.ts +209 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-live-runtime.ts +112 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-model.ts +318 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-projection.ts +211 -0
- package/dist/runtime-packages/ui-host-runtime/src/session-state-reducer.ts +814 -0
- package/dist/runtime-packages/ui-host-runtime/src/sse-manager.ts +334 -0
- package/dist/runtime-packages/ui-host-runtime/src/unified-session-store.ts +180 -0
- package/dist/scaffold/assets/static/app/tsconfig.framework.json +3 -1
- package/dist/scaffold/assets/static/ui/tsconfig.framework.json +7 -19
- package/package.json +52 -17
- package/skills/dreamboard/SKILL.md +41 -75
- package/LICENSE +0 -89
- package/NOTICE +0 -1
- package/dist/chunk-BMYC6772.js.map +0 -1
- package/dist/chunk-EYYWGWTO.js.map +0 -1
- package/dist/chunk-MOVHYB6E.js.map +0 -1
- package/dist/scaffold/assets/static/ui/App.tsx +0 -22
- package/dist/src-CUL7EGGG.js +0 -634
- package/dist/src-CUL7EGGG.js.map +0 -1
- package/skills/dreamboard/references/authoring-lifecycle.md +0 -102
- package/skills/dreamboard/references/board-surfaces.md +0 -36
- package/skills/dreamboard/references/board-topology.md +0 -443
- package/skills/dreamboard/references/boards-and-topology.md +0 -100
- package/skills/dreamboard/references/card-actions.md +0 -107
- package/skills/dreamboard/references/cli.md +0 -120
- package/skills/dreamboard/references/core-concepts.md +0 -514
- package/skills/dreamboard/references/custom-renderers.md +0 -26
- package/skills/dreamboard/references/derived-values.md +0 -55
- package/skills/dreamboard/references/effects.md +0 -111
- package/skills/dreamboard/references/game-contract.md +0 -89
- package/skills/dreamboard/references/game-definition.md +0 -89
- package/skills/dreamboard/references/game-shell.md +0 -80
- package/skills/dreamboard/references/hand-surfaces.md +0 -33
- package/skills/dreamboard/references/index.md +0 -112
- package/skills/dreamboard/references/inputs-and-targets.md +0 -160
- package/skills/dreamboard/references/interactions.md +0 -158
- package/skills/dreamboard/references/manifest-fields.md +0 -137
- package/skills/dreamboard/references/manifest.md +0 -81
- package/skills/dreamboard/references/package-surfaces.md +0 -69
- package/skills/dreamboard/references/phases.md +0 -145
- package/skills/dreamboard/references/prompts-and-choices.md +0 -55
- package/skills/dreamboard/references/quickstart.md +0 -71
- package/skills/dreamboard/references/rule-authoring.md +0 -144
- package/skills/dreamboard/references/setup-bootstrap.md +0 -78
- package/skills/dreamboard/references/stages-and-zones.md +0 -59
- package/skills/dreamboard/references/static-views.md +0 -67
- package/skills/dreamboard/references/table-queries-and-ops.md +0 -103
- package/skills/dreamboard/references/testing-bases.md +0 -147
- package/skills/dreamboard/references/testing-generated-contracts.md +0 -142
- package/skills/dreamboard/references/testing-runtime-assertions.md +0 -124
- package/skills/dreamboard/references/testing-scenarios.md +0 -148
- package/skills/dreamboard/references/testing-ui-tests.md +0 -174
- package/skills/dreamboard/references/testing.md +0 -161
- package/skills/dreamboard/references/ui-architecture.md +0 -137
- package/skills/dreamboard/references/ui-components.md +0 -34
- package/skills/dreamboard/references/views.md +0 -72
- package/skills/dreamboard/references/workspace-layout.md +0 -136
- /package/dist/{dist-WJRJNFLI.js.map → dist-FRURQI7Q.js.map} +0 -0
|
@@ -901,6 +901,15 @@ var queueCompiledResultJob = (options) => (options.client ?? client).post({
|
|
|
901
901
|
...options.headers
|
|
902
902
|
}
|
|
903
903
|
});
|
|
904
|
+
var uploadInitialProjection = (options) => (options.client ?? client).put({
|
|
905
|
+
security: [{ scheme: "bearer", type: "http" }],
|
|
906
|
+
url: "/api/games/{gameId}/preview/initial-projection",
|
|
907
|
+
...options,
|
|
908
|
+
headers: {
|
|
909
|
+
"Content-Type": "application/json",
|
|
910
|
+
...options.headers
|
|
911
|
+
}
|
|
912
|
+
});
|
|
904
913
|
var ensureDevCompile = (options) => (options.client ?? client).post({
|
|
905
914
|
security: [{ scheme: "bearer", type: "http" }],
|
|
906
915
|
url: "/api/games/{gameId}/dev-compiles/ensure",
|
|
@@ -15577,53 +15586,11 @@ var zApiVersionResponse = external_exports.object({
|
|
|
15577
15586
|
uiSdkVersion: external_exports.string()
|
|
15578
15587
|
});
|
|
15579
15588
|
var zGameMetadata = external_exports.object({
|
|
15580
|
-
|
|
15581
|
-
|
|
15582
|
-
|
|
15583
|
-
|
|
15584
|
-
|
|
15585
|
-
"2-3 hours",
|
|
15586
|
-
"3+ hours"
|
|
15587
|
-
])),
|
|
15588
|
-
ageRange: external_exports.optional(external_exports.enum([
|
|
15589
|
-
"3+",
|
|
15590
|
-
"6+",
|
|
15591
|
-
"8+",
|
|
15592
|
-
"10+",
|
|
15593
|
-
"12+",
|
|
15594
|
-
"14+",
|
|
15595
|
-
"16+",
|
|
15596
|
-
"18+"
|
|
15597
|
-
])),
|
|
15598
|
-
gameCategory: external_exports.optional(external_exports.enum([
|
|
15599
|
-
"Abstract",
|
|
15600
|
-
"Strategy",
|
|
15601
|
-
"Eurogame",
|
|
15602
|
-
"Ameritrash",
|
|
15603
|
-
"Card Game",
|
|
15604
|
-
"Dice Game",
|
|
15605
|
-
"Party Game",
|
|
15606
|
-
"Cooperative",
|
|
15607
|
-
"Competitive",
|
|
15608
|
-
"Solo",
|
|
15609
|
-
"Family Game",
|
|
15610
|
-
"Wargame",
|
|
15611
|
-
"Tile-Placement",
|
|
15612
|
-
"Worker Placement",
|
|
15613
|
-
"Deck Builder"
|
|
15614
|
-
])),
|
|
15615
|
-
keyMechanics: external_exports.optional(external_exports.enum([
|
|
15616
|
-
"Area Control",
|
|
15617
|
-
"Set Collection",
|
|
15618
|
-
"Hand Management",
|
|
15619
|
-
"Dice Rolling",
|
|
15620
|
-
"Route Building",
|
|
15621
|
-
"Pick-up and Deliver",
|
|
15622
|
-
"Auction/Bidding",
|
|
15623
|
-
"Hidden Roles",
|
|
15624
|
-
"Bluffing",
|
|
15625
|
-
"Push Your Luck"
|
|
15626
|
-
]))
|
|
15589
|
+
minPlayers: external_exports.optional(external_exports.int().gte(1).lte(20)),
|
|
15590
|
+
maxPlayers: external_exports.optional(external_exports.int().gte(1).lte(20)),
|
|
15591
|
+
playTimeMinMinutes: external_exports.optional(external_exports.int().gte(1)),
|
|
15592
|
+
playTimeMaxMinutes: external_exports.optional(external_exports.int().gte(1)),
|
|
15593
|
+
difficulty: external_exports.optional(external_exports.int().gte(1).lte(5))
|
|
15627
15594
|
});
|
|
15628
15595
|
var zCompletedSteps = external_exports.object({
|
|
15629
15596
|
ruleSaved: external_exports.optional(external_exports.boolean()).default(false),
|
|
@@ -15652,6 +15619,8 @@ var zGame = external_exports.object({
|
|
|
15652
15619
|
createdAt: external_exports.iso.datetime(),
|
|
15653
15620
|
updatedAt: external_exports.iso.datetime(),
|
|
15654
15621
|
scriptId: external_exports.optional(external_exports.string()),
|
|
15622
|
+
previewStorageKey: external_exports.optional(external_exports.string()),
|
|
15623
|
+
initialProjectionKey: external_exports.optional(external_exports.string()),
|
|
15655
15624
|
metadata: external_exports.optional(zGameMetadata),
|
|
15656
15625
|
completedSteps: zCompletedSteps,
|
|
15657
15626
|
completionLights: zGameCompletionLights,
|
|
@@ -15714,10 +15683,15 @@ var zGameSpecComponent = external_exports.enum([
|
|
|
15714
15683
|
"token",
|
|
15715
15684
|
"tracker"
|
|
15716
15685
|
]);
|
|
15686
|
+
var zGameSpecComponentItem = external_exports.object({
|
|
15687
|
+
name: external_exports.string().min(1).max(100),
|
|
15688
|
+
notes: external_exports.optional(external_exports.string().max(500))
|
|
15689
|
+
});
|
|
15717
15690
|
var zGameSpecComponentSpec = external_exports.object({
|
|
15718
15691
|
kind: zGameSpecComponent,
|
|
15719
15692
|
name: external_exports.string().min(1).max(100),
|
|
15720
|
-
notes: external_exports.optional(external_exports.string().max(500))
|
|
15693
|
+
notes: external_exports.optional(external_exports.string().max(500)),
|
|
15694
|
+
items: external_exports.optional(external_exports.array(zGameSpecComponentItem).max(100))
|
|
15721
15695
|
});
|
|
15722
15696
|
var zGameSpecForm = external_exports.object({
|
|
15723
15697
|
name: external_exports.string().min(1).max(200),
|
|
@@ -16323,6 +16297,12 @@ var zQueueCompiledResultJobRequest = external_exports.object({
|
|
|
16323
16297
|
var zQueueCompiledResultJobResponse = external_exports.object({
|
|
16324
16298
|
jobId: external_exports.uuid()
|
|
16325
16299
|
});
|
|
16300
|
+
var zUploadInitialProjectionRequest = external_exports.object({
|
|
16301
|
+
projectionJson: external_exports.string()
|
|
16302
|
+
});
|
|
16303
|
+
var zPreviewScreenshotJobResponse = external_exports.object({
|
|
16304
|
+
jobId: external_exports.uuid()
|
|
16305
|
+
});
|
|
16326
16306
|
var zSourceChangeMode = external_exports.enum(["incremental", "replace"]);
|
|
16327
16307
|
var zSourceFileUpsert = external_exports.object({
|
|
16328
16308
|
kind: external_exports.enum(["upsert"]),
|
|
@@ -16426,7 +16406,11 @@ var zGameScriptsResponse = external_exports.object({
|
|
|
16426
16406
|
appScripts: external_exports.array(zCompiledResult),
|
|
16427
16407
|
uiScripts: external_exports.array(zCompiledResult)
|
|
16428
16408
|
});
|
|
16429
|
-
var zJobKind = external_exports.enum([
|
|
16409
|
+
var zJobKind = external_exports.enum([
|
|
16410
|
+
"GAME_BUILD",
|
|
16411
|
+
"COMPILE",
|
|
16412
|
+
"PREVIEW_SCREENSHOT"
|
|
16413
|
+
]);
|
|
16430
16414
|
var zJobStatus = external_exports.enum([
|
|
16431
16415
|
"PENDING",
|
|
16432
16416
|
"RUNNING",
|
|
@@ -16485,6 +16469,8 @@ var zJobDetailResponse = external_exports.object({
|
|
|
16485
16469
|
message: external_exports.optional(external_exports.string()),
|
|
16486
16470
|
timings: external_exports.optional(zJobNumericMetrics),
|
|
16487
16471
|
memory: external_exports.optional(zJobNumericMetrics),
|
|
16472
|
+
buildPhase: external_exports.optional(external_exports.string()),
|
|
16473
|
+
agentRunId: external_exports.optional(external_exports.string()),
|
|
16488
16474
|
tasks: external_exports.array(zJobTaskSummary),
|
|
16489
16475
|
createdRuleId: external_exports.optional(external_exports.uuid()),
|
|
16490
16476
|
createdManifestId: external_exports.optional(external_exports.uuid()),
|
|
@@ -16494,7 +16480,8 @@ var zJobDetailResponse = external_exports.object({
|
|
|
16494
16480
|
var zCreateGameRunRequest = external_exports.object({
|
|
16495
16481
|
gameSpec: zGameSpecForm,
|
|
16496
16482
|
ruleText: external_exports.optional(external_exports.string().max(5e4)),
|
|
16497
|
-
parentJobId: external_exports.optional(external_exports.uuid())
|
|
16483
|
+
parentJobId: external_exports.optional(external_exports.uuid()),
|
|
16484
|
+
retryOfJobId: external_exports.optional(external_exports.uuid())
|
|
16498
16485
|
});
|
|
16499
16486
|
var zCreateGameRunResponse = external_exports.object({
|
|
16500
16487
|
jobId: external_exports.uuid(),
|
|
@@ -16622,7 +16609,7 @@ var zSeatAssignment = external_exports.object({
|
|
|
16622
16609
|
playerId: external_exports.string(),
|
|
16623
16610
|
controllerActor: external_exports.optional(zSessionActor),
|
|
16624
16611
|
displayName: external_exports.string(),
|
|
16625
|
-
playerColor: external_exports.optional(external_exports.string()),
|
|
16612
|
+
playerColor: external_exports.optional(external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/)),
|
|
16626
16613
|
isHost: external_exports.optional(external_exports.boolean()).default(false)
|
|
16627
16614
|
});
|
|
16628
16615
|
var zHostLobbyView = external_exports.object({
|
|
@@ -16668,32 +16655,6 @@ var zInputSelection = external_exports.object({
|
|
|
16668
16655
|
max: external_exports.optional(external_exports.int()),
|
|
16669
16656
|
distinct: external_exports.optional(external_exports.boolean())
|
|
16670
16657
|
});
|
|
16671
|
-
var zInputDomain = external_exports.object({
|
|
16672
|
-
type: external_exports.enum([
|
|
16673
|
-
"target",
|
|
16674
|
-
"resourceMap",
|
|
16675
|
-
"boundedNumber",
|
|
16676
|
-
"choice",
|
|
16677
|
-
"choiceList"
|
|
16678
|
-
]),
|
|
16679
|
-
targetKind: external_exports.optional(external_exports.string()),
|
|
16680
|
-
boardId: external_exports.optional(external_exports.string()),
|
|
16681
|
-
zoneId: external_exports.optional(external_exports.string()),
|
|
16682
|
-
zoneIds: external_exports.optional(external_exports.array(external_exports.string())),
|
|
16683
|
-
eligibleTargets: external_exports.optional(external_exports.array(external_exports.string())),
|
|
16684
|
-
resources: external_exports.optional(external_exports.array(zResourceMapDomainEntry)),
|
|
16685
|
-
min: external_exports.optional(external_exports.number()),
|
|
16686
|
-
max: external_exports.optional(external_exports.number()),
|
|
16687
|
-
step: external_exports.optional(external_exports.number()),
|
|
16688
|
-
choices: external_exports.optional(external_exports.array(zChoiceDomainOption)),
|
|
16689
|
-
selection: external_exports.optional(zInputSelection)
|
|
16690
|
-
});
|
|
16691
|
-
var zInteractionInputDescriptor = external_exports.object({
|
|
16692
|
-
key: external_exports.string(),
|
|
16693
|
-
kind: external_exports.string(),
|
|
16694
|
-
domain: zInputDomain,
|
|
16695
|
-
defaultValue: external_exports.optional(zJsonValue)
|
|
16696
|
-
});
|
|
16697
16658
|
var zInteractionContextOption = external_exports.object({
|
|
16698
16659
|
id: external_exports.string(),
|
|
16699
16660
|
label: external_exports.string()
|
|
@@ -16704,74 +16665,17 @@ var zInteractionContext = external_exports.object({
|
|
|
16704
16665
|
payload: external_exports.optional(external_exports.record(external_exports.string(), zJsonValue)),
|
|
16705
16666
|
options: external_exports.optional(external_exports.array(zInteractionContextOption))
|
|
16706
16667
|
});
|
|
16707
|
-
var zInteractionDescriptor = external_exports.object({
|
|
16708
|
-
phaseName: external_exports.string(),
|
|
16709
|
-
interactionKey: external_exports.string(),
|
|
16710
|
-
interactionId: external_exports.string(),
|
|
16711
|
-
kind: external_exports.enum(["action", "prompt"]),
|
|
16712
|
-
zoneId: external_exports.optional(external_exports.string()),
|
|
16713
|
-
commit: zInteractionCommitPolicy,
|
|
16714
|
-
inputs: external_exports.array(zInteractionInputDescriptor),
|
|
16715
|
-
cost: external_exports.optional(external_exports.record(external_exports.string(), zJsonValue)),
|
|
16716
|
-
currentResources: external_exports.optional(external_exports.record(external_exports.string(), zJsonValue)),
|
|
16717
|
-
missingResources: external_exports.optional(external_exports.record(external_exports.string(), external_exports.int())),
|
|
16718
|
-
available: external_exports.boolean(),
|
|
16719
|
-
unavailableReason: external_exports.optional(external_exports.string()),
|
|
16720
|
-
context: external_exports.optional(zInteractionContext)
|
|
16721
|
-
});
|
|
16722
|
-
var zZoneHandles = external_exports.object({
|
|
16723
|
-
cardIds: external_exports.array(external_exports.string()),
|
|
16724
|
-
cardsById: external_exports.record(external_exports.string(), external_exports.string()),
|
|
16725
|
-
playableByCardId: external_exports.record(external_exports.string(), external_exports.array(zInteractionDescriptor))
|
|
16726
|
-
});
|
|
16727
|
-
var zHostPlayerGameplayView = external_exports.object({
|
|
16728
|
-
version: external_exports.int(),
|
|
16729
|
-
actionSetVersion: external_exports.string(),
|
|
16730
|
-
playerId: external_exports.string(),
|
|
16731
|
-
activePlayers: external_exports.array(external_exports.string()),
|
|
16732
|
-
currentPhase: external_exports.string(),
|
|
16733
|
-
currentStage: external_exports.string(),
|
|
16734
|
-
stageSeats: external_exports.array(external_exports.string()),
|
|
16735
|
-
simultaneousPhase: external_exports.optional(zSimultaneousPhaseSnapshot),
|
|
16736
|
-
view: external_exports.string(),
|
|
16737
|
-
availableInteractions: external_exports.array(zInteractionDescriptor),
|
|
16738
|
-
zones: external_exports.record(external_exports.string(), zZoneHandles),
|
|
16739
|
-
boardStatic: external_exports.optional(external_exports.string()),
|
|
16740
|
-
boardStaticHash: external_exports.optional(external_exports.string())
|
|
16741
|
-
});
|
|
16742
|
-
var zHostGameplaySessionSnapshot = external_exports.object({
|
|
16743
|
-
type: external_exports.enum(["gameplay"]),
|
|
16744
|
-
context: zHostSessionContext,
|
|
16745
|
-
lobby: zHostLobbyView,
|
|
16746
|
-
gameplay: zHostPlayerGameplayView
|
|
16747
|
-
});
|
|
16748
16668
|
var zHostEndedSessionSnapshot = external_exports.object({
|
|
16749
16669
|
type: external_exports.enum(["ended"]),
|
|
16750
16670
|
context: zHostSessionContext,
|
|
16751
16671
|
lobby: zHostLobbyView
|
|
16752
16672
|
});
|
|
16753
|
-
var zHostSessionSnapshot = external_exports.union([
|
|
16754
|
-
external_exports.object({
|
|
16755
|
-
type: external_exports.literal("lobby")
|
|
16756
|
-
}).and(zHostLobbySessionSnapshot),
|
|
16757
|
-
external_exports.object({
|
|
16758
|
-
type: external_exports.literal("gameplay")
|
|
16759
|
-
}).and(zHostGameplaySessionSnapshot),
|
|
16760
|
-
external_exports.object({
|
|
16761
|
-
type: external_exports.literal("ended")
|
|
16762
|
-
}).and(zHostEndedSessionSnapshot)
|
|
16763
|
-
]);
|
|
16764
16673
|
var zHostSessionSnapshotReason = external_exports.enum([
|
|
16765
16674
|
"load",
|
|
16766
16675
|
"start",
|
|
16767
16676
|
"switch-player",
|
|
16768
16677
|
"resync"
|
|
16769
16678
|
]);
|
|
16770
|
-
var zHostSessionSnapshotEvent = external_exports.object({
|
|
16771
|
-
type: external_exports.enum(["session.snapshot"]),
|
|
16772
|
-
reason: zHostSessionSnapshotReason,
|
|
16773
|
-
snapshot: zHostSessionSnapshot
|
|
16774
|
-
});
|
|
16775
16679
|
var zHostSessionLobbyUpdatedEvent = external_exports.object({
|
|
16776
16680
|
type: external_exports.enum(["session.lobbyUpdated"]),
|
|
16777
16681
|
context: zHostSessionContext,
|
|
@@ -16780,12 +16684,6 @@ var zHostSessionLobbyUpdatedEvent = external_exports.object({
|
|
|
16780
16684
|
var zHostSessionEventCausation = external_exports.object({
|
|
16781
16685
|
clientActionId: external_exports.optional(external_exports.string())
|
|
16782
16686
|
});
|
|
16783
|
-
var zHostSessionGameplayUpdatedEvent = external_exports.object({
|
|
16784
|
-
type: external_exports.enum(["session.gameplayUpdated"]),
|
|
16785
|
-
context: zHostSessionContext,
|
|
16786
|
-
gameplay: zHostPlayerGameplayView,
|
|
16787
|
-
causation: external_exports.optional(zHostSessionEventCausation)
|
|
16788
|
-
});
|
|
16789
16687
|
var zHostSessionHistoryUpdatedEvent = external_exports.object({
|
|
16790
16688
|
type: external_exports.enum(["session.historyUpdated"]),
|
|
16791
16689
|
context: zHostSessionContext
|
|
@@ -16802,50 +16700,12 @@ var zHostSessionErrorEvent = external_exports.object({
|
|
|
16802
16700
|
message: external_exports.string(),
|
|
16803
16701
|
recoverable: external_exports.boolean()
|
|
16804
16702
|
});
|
|
16805
|
-
var zHostSessionEvent = external_exports.union([
|
|
16806
|
-
external_exports.object({
|
|
16807
|
-
type: external_exports.literal("session.snapshot")
|
|
16808
|
-
}).and(zHostSessionSnapshotEvent),
|
|
16809
|
-
external_exports.object({
|
|
16810
|
-
type: external_exports.literal("session.lobbyUpdated")
|
|
16811
|
-
}).and(zHostSessionLobbyUpdatedEvent),
|
|
16812
|
-
external_exports.object({
|
|
16813
|
-
type: external_exports.literal("session.gameplayUpdated")
|
|
16814
|
-
}).and(zHostSessionGameplayUpdatedEvent),
|
|
16815
|
-
external_exports.object({
|
|
16816
|
-
type: external_exports.literal("session.historyUpdated")
|
|
16817
|
-
}).and(zHostSessionHistoryUpdatedEvent),
|
|
16818
|
-
external_exports.object({
|
|
16819
|
-
type: external_exports.literal("session.ended")
|
|
16820
|
-
}).and(zHostSessionEndedEvent),
|
|
16821
|
-
external_exports.object({
|
|
16822
|
-
type: external_exports.literal("session.error")
|
|
16823
|
-
}).and(zHostSessionErrorEvent)
|
|
16824
|
-
]);
|
|
16825
16703
|
var zLogMessageDto = external_exports.object({
|
|
16826
16704
|
id: external_exports.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }),
|
|
16827
16705
|
type: external_exports.string(),
|
|
16828
16706
|
message: external_exports.string(),
|
|
16829
16707
|
timestamp: external_exports.iso.datetime()
|
|
16830
16708
|
});
|
|
16831
|
-
var zPlayerActionsResponse = external_exports.object({
|
|
16832
|
-
version: external_exports.int(),
|
|
16833
|
-
actionSetVersion: external_exports.string(),
|
|
16834
|
-
actions: external_exports.array(zInteractionDescriptor)
|
|
16835
|
-
});
|
|
16836
|
-
var zPlayerActionResponse = external_exports.object({
|
|
16837
|
-
version: external_exports.int(),
|
|
16838
|
-
actionSetVersion: external_exports.string(),
|
|
16839
|
-
action: zInteractionDescriptor
|
|
16840
|
-
});
|
|
16841
|
-
var zPlayerActionTargetsResponse = external_exports.object({
|
|
16842
|
-
version: external_exports.int(),
|
|
16843
|
-
actionSetVersion: external_exports.string(),
|
|
16844
|
-
interactionId: external_exports.string(),
|
|
16845
|
-
inputKey: external_exports.string(),
|
|
16846
|
-
domain: zInputDomain,
|
|
16847
|
-
zoneCardsById: external_exports.optional(external_exports.record(external_exports.string(), external_exports.string()))
|
|
16848
|
-
});
|
|
16849
16709
|
var zPlayerActionRequest = external_exports.object({
|
|
16850
16710
|
expectedVersion: external_exports.int(),
|
|
16851
16711
|
actionSetVersion: external_exports.string(),
|
|
@@ -16859,15 +16719,6 @@ var zPlayerActionValidateResponse = external_exports.object({
|
|
|
16859
16719
|
message: external_exports.optional(external_exports.string()),
|
|
16860
16720
|
fieldErrors: external_exports.optional(external_exports.record(external_exports.string(), external_exports.string()))
|
|
16861
16721
|
});
|
|
16862
|
-
var zHostActionSubmitResponse = external_exports.object({
|
|
16863
|
-
success: external_exports.boolean(),
|
|
16864
|
-
version: external_exports.int(),
|
|
16865
|
-
actionSetVersion: external_exports.string(),
|
|
16866
|
-
accepted: external_exports.optional(external_exports.boolean()),
|
|
16867
|
-
errorCode: external_exports.optional(external_exports.string()),
|
|
16868
|
-
message: external_exports.optional(external_exports.string()),
|
|
16869
|
-
event: external_exports.optional(zHostSessionEvent)
|
|
16870
|
-
});
|
|
16871
16722
|
var zUpdateSeatRequest = external_exports.object({
|
|
16872
16723
|
displayName: external_exports.optional(external_exports.string().min(1).max(30)),
|
|
16873
16724
|
playerColor: external_exports.optional(external_exports.string().regex(/^#[0-9A-Fa-f]{6}$/))
|
|
@@ -16975,56 +16826,200 @@ var zGameManifestResponse = external_exports.object({
|
|
|
16975
16826
|
version: external_exports.int(),
|
|
16976
16827
|
createdAt: external_exports.iso.datetime()
|
|
16977
16828
|
});
|
|
16978
|
-
var
|
|
16979
|
-
|
|
16980
|
-
|
|
16981
|
-
|
|
16982
|
-
|
|
16983
|
-
|
|
16984
|
-
|
|
16985
|
-
|
|
16829
|
+
var zInputDomain = external_exports.object({
|
|
16830
|
+
type: external_exports.enum([
|
|
16831
|
+
"target",
|
|
16832
|
+
"resourceMap",
|
|
16833
|
+
"boundedNumber",
|
|
16834
|
+
"choice",
|
|
16835
|
+
"choiceList"
|
|
16836
|
+
]),
|
|
16837
|
+
targetKind: external_exports.optional(external_exports.string()),
|
|
16838
|
+
boardId: external_exports.optional(external_exports.string()),
|
|
16839
|
+
zoneId: external_exports.optional(external_exports.string()),
|
|
16840
|
+
zoneIds: external_exports.optional(external_exports.array(external_exports.string())),
|
|
16841
|
+
eligibleTargets: external_exports.optional(external_exports.array(external_exports.string())),
|
|
16842
|
+
resources: external_exports.optional(external_exports.array(zResourceMapDomainEntry)),
|
|
16843
|
+
min: external_exports.optional(external_exports.number()),
|
|
16844
|
+
max: external_exports.optional(external_exports.number()),
|
|
16845
|
+
step: external_exports.optional(external_exports.number()),
|
|
16846
|
+
choices: external_exports.optional(external_exports.array(zChoiceDomainOption)),
|
|
16847
|
+
selection: external_exports.optional(zInputSelection),
|
|
16848
|
+
dependsOn: external_exports.optional(external_exports.array(external_exports.string())),
|
|
16849
|
+
get dependentCases() {
|
|
16850
|
+
return external_exports.optional(external_exports.array(external_exports.lazy(() => zInputDomainDependencyCase)));
|
|
16851
|
+
}
|
|
16986
16852
|
});
|
|
16987
|
-
var
|
|
16988
|
-
|
|
16989
|
-
|
|
16990
|
-
path: external_exports.optional(external_exports.never()),
|
|
16991
|
-
query: external_exports.optional(external_exports.never())
|
|
16853
|
+
var zInputDomainDependencyCase = external_exports.object({
|
|
16854
|
+
when: external_exports.record(external_exports.string(), external_exports.string()),
|
|
16855
|
+
domain: zInputDomain
|
|
16992
16856
|
});
|
|
16993
|
-
var
|
|
16994
|
-
|
|
16995
|
-
|
|
16996
|
-
|
|
16997
|
-
|
|
16998
|
-
}))
|
|
16857
|
+
var zInteractionInputDescriptor = external_exports.object({
|
|
16858
|
+
key: external_exports.string(),
|
|
16859
|
+
kind: external_exports.string(),
|
|
16860
|
+
domain: zInputDomain,
|
|
16861
|
+
defaultValue: external_exports.optional(zJsonValue)
|
|
16999
16862
|
});
|
|
17000
|
-
var
|
|
17001
|
-
|
|
17002
|
-
|
|
17003
|
-
|
|
17004
|
-
|
|
16863
|
+
var zInteractionDescriptor = external_exports.object({
|
|
16864
|
+
phaseName: external_exports.string(),
|
|
16865
|
+
interactionKey: external_exports.string(),
|
|
16866
|
+
interactionId: external_exports.string(),
|
|
16867
|
+
kind: external_exports.enum(["action", "prompt"]),
|
|
16868
|
+
zoneId: external_exports.optional(external_exports.string()),
|
|
16869
|
+
commit: zInteractionCommitPolicy,
|
|
16870
|
+
inputs: external_exports.array(zInteractionInputDescriptor),
|
|
16871
|
+
cost: external_exports.optional(external_exports.record(external_exports.string(), zJsonValue)),
|
|
16872
|
+
currentResources: external_exports.optional(external_exports.record(external_exports.string(), zJsonValue)),
|
|
16873
|
+
missingResources: external_exports.optional(external_exports.record(external_exports.string(), external_exports.int())),
|
|
16874
|
+
available: external_exports.boolean(),
|
|
16875
|
+
unavailableReason: external_exports.optional(external_exports.string()),
|
|
16876
|
+
context: external_exports.optional(zInteractionContext)
|
|
17005
16877
|
});
|
|
17006
|
-
var
|
|
17007
|
-
|
|
17008
|
-
|
|
17009
|
-
|
|
16878
|
+
var zZoneHandles = external_exports.object({
|
|
16879
|
+
cardIds: external_exports.array(external_exports.string()),
|
|
16880
|
+
cardsById: external_exports.record(external_exports.string(), external_exports.string()),
|
|
16881
|
+
playableByCardId: external_exports.record(external_exports.string(), external_exports.array(zInteractionDescriptor))
|
|
17010
16882
|
});
|
|
17011
|
-
var
|
|
17012
|
-
|
|
17013
|
-
|
|
17014
|
-
|
|
17015
|
-
|
|
17016
|
-
|
|
16883
|
+
var zHostPlayerGameplayView = external_exports.object({
|
|
16884
|
+
version: external_exports.int(),
|
|
16885
|
+
actionSetVersion: external_exports.string(),
|
|
16886
|
+
playerId: external_exports.string(),
|
|
16887
|
+
activePlayers: external_exports.array(external_exports.string()),
|
|
16888
|
+
currentPhase: external_exports.string(),
|
|
16889
|
+
currentStage: external_exports.string(),
|
|
16890
|
+
stageSeats: external_exports.array(external_exports.string()),
|
|
16891
|
+
simultaneousPhase: external_exports.optional(zSimultaneousPhaseSnapshot),
|
|
16892
|
+
view: external_exports.string(),
|
|
16893
|
+
availableInteractions: external_exports.array(zInteractionDescriptor),
|
|
16894
|
+
zones: external_exports.record(external_exports.string(), zZoneHandles),
|
|
16895
|
+
boardStatic: external_exports.optional(external_exports.string()),
|
|
16896
|
+
boardStaticHash: external_exports.optional(external_exports.string())
|
|
17017
16897
|
});
|
|
17018
|
-
var
|
|
17019
|
-
|
|
17020
|
-
|
|
17021
|
-
|
|
17022
|
-
|
|
17023
|
-
query: external_exports.optional(external_exports.never())
|
|
16898
|
+
var zHostGameplaySessionSnapshot = external_exports.object({
|
|
16899
|
+
type: external_exports.enum(["gameplay"]),
|
|
16900
|
+
context: zHostSessionContext,
|
|
16901
|
+
lobby: zHostLobbyView,
|
|
16902
|
+
gameplay: zHostPlayerGameplayView
|
|
17024
16903
|
});
|
|
17025
|
-
var
|
|
17026
|
-
|
|
17027
|
-
|
|
16904
|
+
var zHostSessionSnapshot = external_exports.union([
|
|
16905
|
+
external_exports.object({
|
|
16906
|
+
type: external_exports.literal("lobby")
|
|
16907
|
+
}).and(zHostLobbySessionSnapshot),
|
|
16908
|
+
external_exports.object({
|
|
16909
|
+
type: external_exports.literal("gameplay")
|
|
16910
|
+
}).and(zHostGameplaySessionSnapshot),
|
|
16911
|
+
external_exports.object({
|
|
16912
|
+
type: external_exports.literal("ended")
|
|
16913
|
+
}).and(zHostEndedSessionSnapshot)
|
|
16914
|
+
]);
|
|
16915
|
+
var zHostSessionSnapshotEvent = external_exports.object({
|
|
16916
|
+
type: external_exports.enum(["session.snapshot"]),
|
|
16917
|
+
reason: zHostSessionSnapshotReason,
|
|
16918
|
+
snapshot: zHostSessionSnapshot
|
|
16919
|
+
});
|
|
16920
|
+
var zHostSessionGameplayUpdatedEvent = external_exports.object({
|
|
16921
|
+
type: external_exports.enum(["session.gameplayUpdated"]),
|
|
16922
|
+
context: zHostSessionContext,
|
|
16923
|
+
gameplay: zHostPlayerGameplayView,
|
|
16924
|
+
causation: external_exports.optional(zHostSessionEventCausation)
|
|
16925
|
+
});
|
|
16926
|
+
var zHostSessionEvent = external_exports.union([
|
|
16927
|
+
external_exports.object({
|
|
16928
|
+
type: external_exports.literal("session.snapshot")
|
|
16929
|
+
}).and(zHostSessionSnapshotEvent),
|
|
16930
|
+
external_exports.object({
|
|
16931
|
+
type: external_exports.literal("session.lobbyUpdated")
|
|
16932
|
+
}).and(zHostSessionLobbyUpdatedEvent),
|
|
16933
|
+
external_exports.object({
|
|
16934
|
+
type: external_exports.literal("session.gameplayUpdated")
|
|
16935
|
+
}).and(zHostSessionGameplayUpdatedEvent),
|
|
16936
|
+
external_exports.object({
|
|
16937
|
+
type: external_exports.literal("session.historyUpdated")
|
|
16938
|
+
}).and(zHostSessionHistoryUpdatedEvent),
|
|
16939
|
+
external_exports.object({
|
|
16940
|
+
type: external_exports.literal("session.ended")
|
|
16941
|
+
}).and(zHostSessionEndedEvent),
|
|
16942
|
+
external_exports.object({
|
|
16943
|
+
type: external_exports.literal("session.error")
|
|
16944
|
+
}).and(zHostSessionErrorEvent)
|
|
16945
|
+
]);
|
|
16946
|
+
var zPlayerActionsResponse = external_exports.object({
|
|
16947
|
+
version: external_exports.int(),
|
|
16948
|
+
actionSetVersion: external_exports.string(),
|
|
16949
|
+
actions: external_exports.array(zInteractionDescriptor)
|
|
16950
|
+
});
|
|
16951
|
+
var zPlayerActionResponse = external_exports.object({
|
|
16952
|
+
version: external_exports.int(),
|
|
16953
|
+
actionSetVersion: external_exports.string(),
|
|
16954
|
+
action: zInteractionDescriptor
|
|
16955
|
+
});
|
|
16956
|
+
var zPlayerActionTargetsResponse = external_exports.object({
|
|
16957
|
+
version: external_exports.int(),
|
|
16958
|
+
actionSetVersion: external_exports.string(),
|
|
16959
|
+
interactionId: external_exports.string(),
|
|
16960
|
+
inputKey: external_exports.string(),
|
|
16961
|
+
domain: zInputDomain,
|
|
16962
|
+
zoneCardsById: external_exports.optional(external_exports.record(external_exports.string(), external_exports.string()))
|
|
16963
|
+
});
|
|
16964
|
+
var zHostActionSubmitResponse = external_exports.object({
|
|
16965
|
+
success: external_exports.boolean(),
|
|
16966
|
+
version: external_exports.int(),
|
|
16967
|
+
actionSetVersion: external_exports.string(),
|
|
16968
|
+
accepted: external_exports.optional(external_exports.boolean()),
|
|
16969
|
+
errorCode: external_exports.optional(external_exports.string()),
|
|
16970
|
+
message: external_exports.optional(external_exports.string()),
|
|
16971
|
+
event: external_exports.optional(zHostSessionEvent)
|
|
16972
|
+
});
|
|
16973
|
+
var zGameId = external_exports.uuid();
|
|
16974
|
+
var zGameSlug = external_exports.string();
|
|
16975
|
+
var zSessionId = external_exports.uuid();
|
|
16976
|
+
var zPlayerId = external_exports.string();
|
|
16977
|
+
var zHealthCheckData = external_exports.object({
|
|
16978
|
+
body: external_exports.optional(external_exports.never()),
|
|
16979
|
+
path: external_exports.optional(external_exports.never()),
|
|
16980
|
+
query: external_exports.optional(external_exports.never())
|
|
16981
|
+
});
|
|
16982
|
+
var zHealthCheckResponse = external_exports.string();
|
|
16983
|
+
var zGetApiVersionData = external_exports.object({
|
|
16984
|
+
body: external_exports.optional(external_exports.never()),
|
|
16985
|
+
path: external_exports.optional(external_exports.never()),
|
|
16986
|
+
query: external_exports.optional(external_exports.never())
|
|
16987
|
+
});
|
|
16988
|
+
var zListGamesData = external_exports.object({
|
|
16989
|
+
body: external_exports.optional(external_exports.never()),
|
|
16990
|
+
path: external_exports.optional(external_exports.never()),
|
|
16991
|
+
query: external_exports.optional(external_exports.object({
|
|
16992
|
+
includeNotInitialized: external_exports.optional(external_exports.boolean()).default(false)
|
|
16993
|
+
}))
|
|
16994
|
+
});
|
|
16995
|
+
var zListGamesResponse = external_exports.array(zGame);
|
|
16996
|
+
var zCreateGameData = external_exports.object({
|
|
16997
|
+
body: zCreateGameRequest,
|
|
16998
|
+
path: external_exports.optional(external_exports.never()),
|
|
16999
|
+
query: external_exports.optional(external_exports.never())
|
|
17000
|
+
});
|
|
17001
|
+
var zExtractGameSpecData = external_exports.object({
|
|
17002
|
+
body: zExtractGameSpecRequest,
|
|
17003
|
+
path: external_exports.optional(external_exports.never()),
|
|
17004
|
+
query: external_exports.optional(external_exports.never())
|
|
17005
|
+
});
|
|
17006
|
+
var zDeleteGameData = external_exports.object({
|
|
17007
|
+
body: external_exports.optional(external_exports.never()),
|
|
17008
|
+
path: external_exports.object({
|
|
17009
|
+
gameId: external_exports.uuid()
|
|
17010
|
+
}),
|
|
17011
|
+
query: external_exports.optional(external_exports.never())
|
|
17012
|
+
});
|
|
17013
|
+
var zGetGameData = external_exports.object({
|
|
17014
|
+
body: external_exports.optional(external_exports.never()),
|
|
17015
|
+
path: external_exports.object({
|
|
17016
|
+
gameId: external_exports.uuid()
|
|
17017
|
+
}),
|
|
17018
|
+
query: external_exports.optional(external_exports.never())
|
|
17019
|
+
});
|
|
17020
|
+
var zUpdateGameData = external_exports.object({
|
|
17021
|
+
body: zUpdateGameRequest,
|
|
17022
|
+
path: external_exports.object({
|
|
17028
17023
|
gameId: external_exports.uuid()
|
|
17029
17024
|
}),
|
|
17030
17025
|
query: external_exports.optional(external_exports.never())
|
|
@@ -17096,6 +17091,21 @@ var zQueueCompiledResultJobData = external_exports.object({
|
|
|
17096
17091
|
}),
|
|
17097
17092
|
query: external_exports.optional(external_exports.never())
|
|
17098
17093
|
});
|
|
17094
|
+
var zUploadInitialProjectionData = external_exports.object({
|
|
17095
|
+
body: zUploadInitialProjectionRequest,
|
|
17096
|
+
path: external_exports.object({
|
|
17097
|
+
gameId: external_exports.uuid()
|
|
17098
|
+
}),
|
|
17099
|
+
query: external_exports.optional(external_exports.never())
|
|
17100
|
+
});
|
|
17101
|
+
var zUploadInitialProjectionResponse = external_exports.void();
|
|
17102
|
+
var zQueuePreviewScreenshotData = external_exports.object({
|
|
17103
|
+
body: external_exports.optional(external_exports.never()),
|
|
17104
|
+
path: external_exports.object({
|
|
17105
|
+
gameId: external_exports.uuid()
|
|
17106
|
+
}),
|
|
17107
|
+
query: external_exports.optional(external_exports.never())
|
|
17108
|
+
});
|
|
17099
17109
|
var zEnsureDevCompileData = external_exports.object({
|
|
17100
17110
|
body: zEnsureDevCompileRequest,
|
|
17101
17111
|
path: external_exports.object({
|
|
@@ -17235,43 +17245,6 @@ var zCreateSessionData = external_exports.object({
|
|
|
17235
17245
|
}),
|
|
17236
17246
|
query: external_exports.optional(external_exports.never())
|
|
17237
17247
|
});
|
|
17238
|
-
var zCreateSessionFromReducerSnapshotData = external_exports.object({
|
|
17239
|
-
body: zCreateSessionFromReducerSnapshotRequest,
|
|
17240
|
-
path: external_exports.object({
|
|
17241
|
-
gameId: external_exports.uuid()
|
|
17242
|
-
}),
|
|
17243
|
-
query: external_exports.optional(external_exports.never())
|
|
17244
|
-
});
|
|
17245
|
-
var zGetSessionByShortCodeData = external_exports.object({
|
|
17246
|
-
body: external_exports.optional(external_exports.never()),
|
|
17247
|
-
path: external_exports.object({
|
|
17248
|
-
shortCode: external_exports.string()
|
|
17249
|
-
}),
|
|
17250
|
-
query: external_exports.optional(external_exports.object({
|
|
17251
|
-
playerId: external_exports.optional(external_exports.string())
|
|
17252
|
-
}))
|
|
17253
|
-
});
|
|
17254
|
-
var zGetSessionSnapshotData = external_exports.object({
|
|
17255
|
-
body: external_exports.optional(external_exports.never()),
|
|
17256
|
-
path: external_exports.object({
|
|
17257
|
-
sessionId: external_exports.uuid()
|
|
17258
|
-
}),
|
|
17259
|
-
query: external_exports.optional(external_exports.object({
|
|
17260
|
-
playerId: external_exports.optional(external_exports.string())
|
|
17261
|
-
}))
|
|
17262
|
-
});
|
|
17263
|
-
var zSubscribeToSessionEventsData = external_exports.object({
|
|
17264
|
-
body: external_exports.optional(external_exports.never()),
|
|
17265
|
-
path: external_exports.object({
|
|
17266
|
-
sessionId: external_exports.uuid()
|
|
17267
|
-
}),
|
|
17268
|
-
query: external_exports.object({
|
|
17269
|
-
clientId: external_exports.string(),
|
|
17270
|
-
connectionAttemptId: external_exports.string(),
|
|
17271
|
-
clientSource: external_exports.optional(external_exports.string()),
|
|
17272
|
-
playerId: external_exports.optional(external_exports.string())
|
|
17273
|
-
})
|
|
17274
|
-
});
|
|
17275
17248
|
var zDisconnectSessionEventsData = external_exports.object({
|
|
17276
17249
|
body: external_exports.optional(external_exports.never()),
|
|
17277
17250
|
path: external_exports.object({
|
|
@@ -17292,40 +17265,6 @@ var zSubscribeToGameLogsData = external_exports.object({
|
|
|
17292
17265
|
lastLogId: external_exports.optional(external_exports.coerce.bigint().min(BigInt("-9223372036854775808"), { error: "Invalid value: Expected int64 to be >= -9223372036854775808" }).max(BigInt("9223372036854775807"), { error: "Invalid value: Expected int64 to be <= 9223372036854775807" }))
|
|
17293
17266
|
}))
|
|
17294
17267
|
});
|
|
17295
|
-
var zStartGameData = external_exports.object({
|
|
17296
|
-
body: external_exports.optional(external_exports.never()),
|
|
17297
|
-
path: external_exports.object({
|
|
17298
|
-
sessionId: external_exports.uuid()
|
|
17299
|
-
}),
|
|
17300
|
-
query: external_exports.optional(external_exports.never())
|
|
17301
|
-
});
|
|
17302
|
-
var zListPlayerActionsData = external_exports.object({
|
|
17303
|
-
body: external_exports.optional(external_exports.never()),
|
|
17304
|
-
path: external_exports.object({
|
|
17305
|
-
sessionId: external_exports.uuid(),
|
|
17306
|
-
playerId: external_exports.string()
|
|
17307
|
-
}),
|
|
17308
|
-
query: external_exports.optional(external_exports.never())
|
|
17309
|
-
});
|
|
17310
|
-
var zDescribePlayerActionData = external_exports.object({
|
|
17311
|
-
body: external_exports.optional(external_exports.never()),
|
|
17312
|
-
path: external_exports.object({
|
|
17313
|
-
sessionId: external_exports.uuid(),
|
|
17314
|
-
playerId: external_exports.string(),
|
|
17315
|
-
interactionId: external_exports.string()
|
|
17316
|
-
}),
|
|
17317
|
-
query: external_exports.optional(external_exports.never())
|
|
17318
|
-
});
|
|
17319
|
-
var zGetPlayerActionTargetsData = external_exports.object({
|
|
17320
|
-
body: external_exports.optional(external_exports.never()),
|
|
17321
|
-
path: external_exports.object({
|
|
17322
|
-
sessionId: external_exports.uuid(),
|
|
17323
|
-
playerId: external_exports.string(),
|
|
17324
|
-
interactionId: external_exports.string(),
|
|
17325
|
-
inputKey: external_exports.string()
|
|
17326
|
-
}),
|
|
17327
|
-
query: external_exports.optional(external_exports.never())
|
|
17328
|
-
});
|
|
17329
17268
|
var zValidatePlayerActionData = external_exports.object({
|
|
17330
17269
|
body: zPlayerActionRequest,
|
|
17331
17270
|
path: external_exports.object({
|
|
@@ -17335,15 +17274,6 @@ var zValidatePlayerActionData = external_exports.object({
|
|
|
17335
17274
|
}),
|
|
17336
17275
|
query: external_exports.optional(external_exports.never())
|
|
17337
17276
|
});
|
|
17338
|
-
var zSubmitPlayerActionData = external_exports.object({
|
|
17339
|
-
body: zPlayerActionRequest,
|
|
17340
|
-
path: external_exports.object({
|
|
17341
|
-
sessionId: external_exports.uuid(),
|
|
17342
|
-
playerId: external_exports.string(),
|
|
17343
|
-
interactionId: external_exports.string()
|
|
17344
|
-
}),
|
|
17345
|
-
query: external_exports.optional(external_exports.never())
|
|
17346
|
-
});
|
|
17347
17277
|
var zAddSeatData = external_exports.object({
|
|
17348
17278
|
body: external_exports.optional(external_exports.never()),
|
|
17349
17279
|
path: external_exports.object({
|
|
@@ -17430,1608 +17360,109 @@ var zCreateDemoGameSessionData = external_exports.object({
|
|
|
17430
17360
|
}),
|
|
17431
17361
|
query: external_exports.optional(external_exports.never())
|
|
17432
17362
|
});
|
|
17433
|
-
|
|
17434
|
-
|
|
17435
|
-
|
|
17436
|
-
|
|
17437
|
-
|
|
17438
|
-
|
|
17439
|
-
AUTHORING_STATE_DRIFT: "urn:dreamboard:problem:authoring-state-drift",
|
|
17440
|
-
FORBIDDEN: "urn:dreamboard:problem:forbidden",
|
|
17441
|
-
GAME_SLUG_CONFLICT: "urn:dreamboard:problem:game-slug-conflict",
|
|
17442
|
-
INTERNAL_ERROR: "urn:dreamboard:problem:internal-error",
|
|
17443
|
-
RESOURCE_NOT_FOUND: "urn:dreamboard:problem:resource-not-found",
|
|
17444
|
-
SOURCE_REVISION_BASE_MISSING: "urn:dreamboard:problem:source-revision-base-missing",
|
|
17445
|
-
SOURCE_REVISION_DRIFT: "urn:dreamboard:problem:source-revision-drift",
|
|
17446
|
-
SOURCE_REVISION_NOT_FOUND: "urn:dreamboard:problem:source-revision-not-found",
|
|
17447
|
-
STATE_CONFLICT: "urn:dreamboard:problem:state-conflict",
|
|
17448
|
-
TOO_MANY_REQUESTS: "urn:dreamboard:problem:too-many-requests",
|
|
17449
|
-
UNAUTHORIZED: "urn:dreamboard:problem:unauthorized",
|
|
17450
|
-
VALIDATION_FAILED: "urn:dreamboard:problem:validation-failed"
|
|
17451
|
-
};
|
|
17452
|
-
var CLIENT_PROBLEM_TYPES = {
|
|
17453
|
-
TRANSPORT_ERROR: "urn:dreamboard:problem:transport-error",
|
|
17454
|
-
UNKNOWN_API_ERROR: "urn:dreamboard:problem:unknown-api-error"
|
|
17455
|
-
};
|
|
17456
|
-
|
|
17457
|
-
// ../../packages/ui-host-runtime/src/unified-session-store.ts
|
|
17458
|
-
import { createStore } from "zustand/vanilla";
|
|
17459
|
-
import { subscribeWithSelector } from "zustand/middleware";
|
|
17460
|
-
|
|
17461
|
-
// ../../packages/ui-host-runtime/src/logger.ts
|
|
17462
|
-
var consoleLogger = {
|
|
17463
|
-
log: (...args) => console.log(...args),
|
|
17464
|
-
warn: (...args) => console.warn(...args),
|
|
17465
|
-
error: (...args) => console.error(...args)
|
|
17466
|
-
};
|
|
17467
|
-
|
|
17468
|
-
// ../../packages/ui-host-runtime/src/host-session-transport.ts
|
|
17469
|
-
var CLIENT_ACTION_ID_HEADER = "X-Dreamboard-Client-Action-Id";
|
|
17470
|
-
function asInputs(params) {
|
|
17471
|
-
return params && typeof params === "object" && !Array.isArray(params) ? params : {};
|
|
17472
|
-
}
|
|
17473
|
-
async function requireData(result, message) {
|
|
17474
|
-
if (result.error || !result.data) {
|
|
17475
|
-
throw result.error ?? new Error(message);
|
|
17476
|
-
}
|
|
17477
|
-
return result.data;
|
|
17478
|
-
}
|
|
17479
|
-
var defaultHostSessionTransport = {
|
|
17480
|
-
async loadSessionByShortCode(input) {
|
|
17481
|
-
return requireData(
|
|
17482
|
-
await getSessionByShortCode({
|
|
17483
|
-
path: { shortCode: input.shortCode },
|
|
17484
|
-
query: input.requestedPlayerId ? { playerId: input.requestedPlayerId } : void 0
|
|
17485
|
-
}),
|
|
17486
|
-
"Failed to load session by short code"
|
|
17487
|
-
);
|
|
17488
|
-
},
|
|
17489
|
-
async loadSessionSnapshot(input) {
|
|
17490
|
-
return requireData(
|
|
17491
|
-
await getSessionSnapshot({
|
|
17492
|
-
path: { sessionId: input.sessionId },
|
|
17493
|
-
query: input.requestedPlayerId ? { playerId: input.requestedPlayerId } : void 0
|
|
17494
|
-
}),
|
|
17495
|
-
"Failed to load session snapshot"
|
|
17496
|
-
);
|
|
17497
|
-
},
|
|
17498
|
-
async startSession(input) {
|
|
17499
|
-
return requireData(
|
|
17500
|
-
await startGame({ path: { sessionId: input.sessionId } }),
|
|
17501
|
-
"Failed to start session"
|
|
17502
|
-
);
|
|
17503
|
-
},
|
|
17504
|
-
async submitInteraction(input) {
|
|
17505
|
-
const headers = input.clientActionId ? { [CLIENT_ACTION_ID_HEADER]: input.clientActionId } : void 0;
|
|
17506
|
-
return requireData(
|
|
17507
|
-
await submitPlayerAction({
|
|
17508
|
-
path: {
|
|
17509
|
-
sessionId: input.sessionId,
|
|
17510
|
-
playerId: input.playerId,
|
|
17511
|
-
interactionId: input.interactionId
|
|
17512
|
-
},
|
|
17513
|
-
body: {
|
|
17514
|
-
expectedVersion: input.expectedVersion,
|
|
17515
|
-
actionSetVersion: input.actionSetVersion,
|
|
17516
|
-
inputs: asInputs(input.params)
|
|
17517
|
-
},
|
|
17518
|
-
...headers ? { headers } : {}
|
|
17519
|
-
}),
|
|
17520
|
-
"Failed to submit interaction"
|
|
17521
|
-
);
|
|
17522
|
-
},
|
|
17523
|
-
async restoreHistory(input) {
|
|
17524
|
-
const { error: error51 } = await restoreHistory({
|
|
17525
|
-
path: { sessionId: input.sessionId },
|
|
17526
|
-
body: { entryId: input.entryId }
|
|
17527
|
-
});
|
|
17528
|
-
if (error51) {
|
|
17529
|
-
throw error51;
|
|
17530
|
-
}
|
|
17531
|
-
},
|
|
17532
|
-
async subscribeToSessionEvents(input) {
|
|
17533
|
-
const result = await subscribeToSessionEvents({
|
|
17534
|
-
path: { sessionId: input.sessionId },
|
|
17535
|
-
query: {
|
|
17536
|
-
clientId: input.clientId,
|
|
17537
|
-
connectionAttemptId: input.connectionAttemptId,
|
|
17538
|
-
clientSource: input.clientSource,
|
|
17539
|
-
playerId: input.playerId
|
|
17540
|
-
},
|
|
17541
|
-
sseMaxRetryAttempts: 0,
|
|
17542
|
-
signal: input.signal,
|
|
17543
|
-
onSseError: input.onSseError
|
|
17544
|
-
});
|
|
17545
|
-
return { stream: result.stream };
|
|
17546
|
-
},
|
|
17547
|
-
async disconnectSessionEvents(input) {
|
|
17548
|
-
await disconnectSessionEvents({
|
|
17549
|
-
path: { sessionId: input.sessionId },
|
|
17550
|
-
query: {
|
|
17551
|
-
clientId: input.clientId,
|
|
17552
|
-
connectionAttemptId: input.connectionAttemptId,
|
|
17553
|
-
playerId: input.playerId
|
|
17554
|
-
}
|
|
17555
|
-
});
|
|
17556
|
-
}
|
|
17557
|
-
};
|
|
17558
|
-
|
|
17559
|
-
// ../../packages/ui-host-runtime/src/actor-principal.ts
|
|
17560
|
-
function principalKey(actor) {
|
|
17561
|
-
if (actor.kind === "AUTH_USER") {
|
|
17562
|
-
return actor.id;
|
|
17563
|
-
}
|
|
17564
|
-
return actor.demoActorSessionId;
|
|
17565
|
-
}
|
|
17566
|
-
function principalMatchesActor(principalId, actor) {
|
|
17567
|
-
if (!principalId) {
|
|
17568
|
-
return false;
|
|
17569
|
-
}
|
|
17570
|
-
return principalKey(actor) === principalId;
|
|
17571
|
-
}
|
|
17572
|
-
function seatControlledByPrincipal(seat, principalId) {
|
|
17573
|
-
if (!principalId || !seat.controllerActor) {
|
|
17574
|
-
return false;
|
|
17575
|
-
}
|
|
17576
|
-
return principalMatchesActor(principalId, seat.controllerActor);
|
|
17577
|
-
}
|
|
17578
|
-
function gameIdFromGameSource(source) {
|
|
17579
|
-
if (source.kind === "USER_COMPILED") {
|
|
17580
|
-
return source.gameId;
|
|
17581
|
-
}
|
|
17582
|
-
return `demo:${source.slug}:${source.revisionId}`;
|
|
17583
|
-
}
|
|
17584
|
-
function seatsForPluginSnapshot(seats) {
|
|
17585
|
-
return seats.map((seat) => ({
|
|
17586
|
-
playerId: seat.playerId,
|
|
17587
|
-
controllerUserId: seat.controllerActor ? principalKey(seat.controllerActor) : void 0,
|
|
17588
|
-
displayName: seat.displayName,
|
|
17589
|
-
playerColor: seat.playerColor ?? void 0,
|
|
17590
|
-
isHost: seat.isHost
|
|
17591
|
-
}));
|
|
17592
|
-
}
|
|
17593
|
-
|
|
17594
|
-
// ../../packages/ui-host-runtime/src/session-model.ts
|
|
17595
|
-
function toHistoryState(history) {
|
|
17596
|
-
return history ? {
|
|
17597
|
-
entries: history.entries,
|
|
17598
|
-
currentIndex: history.currentIndex,
|
|
17599
|
-
canGoBack: history.canGoBack,
|
|
17600
|
-
canGoForward: history.canGoForward
|
|
17601
|
-
} : null;
|
|
17602
|
-
}
|
|
17603
|
-
function identityFromHostContext(context) {
|
|
17604
|
-
return {
|
|
17605
|
-
sessionId: context.sessionId,
|
|
17606
|
-
shortCode: context.shortCode,
|
|
17607
|
-
gameId: gameIdFromGameSource(context.gameSource)
|
|
17608
|
-
};
|
|
17609
|
-
}
|
|
17610
|
-
function deriveControlledPlayerIdsFromSeats(seats, userId, fallbackToAllSeatsWhenUserIdMissing = false) {
|
|
17611
|
-
if (!userId) {
|
|
17612
|
-
return fallbackToAllSeatsWhenUserIdMissing ? seats.map((seat) => seat.playerId) : [];
|
|
17613
|
-
}
|
|
17614
|
-
return seats.filter((seat) => seatControlledByPrincipal(seat, userId)).map((seat) => seat.playerId);
|
|
17615
|
-
}
|
|
17616
|
-
function resolveControllablePlayerIds(preferredPlayerIds, seats, userId, fallbackToAllSeatsWhenUserIdMissing = false) {
|
|
17617
|
-
return preferredPlayerIds && preferredPlayerIds.length > 0 ? preferredPlayerIds : deriveControlledPlayerIdsFromSeats(
|
|
17618
|
-
seats,
|
|
17619
|
-
userId,
|
|
17620
|
-
fallbackToAllSeatsWhenUserIdMissing
|
|
17621
|
-
);
|
|
17622
|
-
}
|
|
17623
|
-
function contextFromHostParts(wireContext, lobby, userId) {
|
|
17624
|
-
return {
|
|
17625
|
-
identity: identityFromHostContext(wireContext),
|
|
17626
|
-
userId,
|
|
17627
|
-
seats: lobby.seats,
|
|
17628
|
-
canStart: lobby.canStart,
|
|
17629
|
-
hostActor: wireContext.hostActor,
|
|
17630
|
-
switchablePlayerIds: wireContext.switchablePlayerIds,
|
|
17631
|
-
history: toHistoryState(wireContext.history)
|
|
17632
|
-
};
|
|
17633
|
-
}
|
|
17634
|
-
function contextFromHostSnapshot(snapshot, userId) {
|
|
17635
|
-
return contextFromHostParts(snapshot.context, snapshot.lobby, userId);
|
|
17636
|
-
}
|
|
17637
|
-
function contextFromHostEventContext(context, wireContext, lobby) {
|
|
17638
|
-
return {
|
|
17639
|
-
...context,
|
|
17640
|
-
identity: identityFromHostContext(wireContext),
|
|
17641
|
-
seats: lobby?.seats ?? context.seats,
|
|
17642
|
-
canStart: lobby?.canStart ?? context.canStart,
|
|
17643
|
-
hostActor: wireContext.hostActor,
|
|
17644
|
-
switchablePlayerIds: wireContext.switchablePlayerIds,
|
|
17645
|
-
history: wireContext.history !== void 0 ? toHistoryState(wireContext.history) : context.history
|
|
17646
|
-
};
|
|
17647
|
-
}
|
|
17648
|
-
function safeJsonParseValue(jsonString) {
|
|
17649
|
-
try {
|
|
17650
|
-
return JSON.parse(jsonString);
|
|
17651
|
-
} catch {
|
|
17652
|
-
return null;
|
|
17653
|
-
}
|
|
17654
|
-
}
|
|
17655
|
-
function transformView(serializedView) {
|
|
17656
|
-
return serializedView ? safeJsonParseValue(serializedView) : null;
|
|
17657
|
-
}
|
|
17658
|
-
function gameplayViewportFromSnapshot(snapshot, previous) {
|
|
17659
|
-
const incomingBoardStatic = snapshot.boardStatic ? safeJsonParseValue(snapshot.boardStatic) : null;
|
|
17660
|
-
const incomingBoardStaticHash = snapshot.boardStaticHash ?? null;
|
|
17661
|
-
const hashDisagrees = previous?.boardStaticHash !== null && previous?.boardStaticHash !== void 0 && incomingBoardStaticHash !== null && incomingBoardStaticHash !== previous.boardStaticHash;
|
|
17662
|
-
return {
|
|
17663
|
-
version: snapshot.version,
|
|
17664
|
-
actionSetVersion: snapshot.actionSetVersion,
|
|
17665
|
-
activePlayers: snapshot.activePlayers,
|
|
17666
|
-
currentPhase: snapshot.currentPhase,
|
|
17667
|
-
currentStage: snapshot.currentStage ?? previous?.currentStage ?? null,
|
|
17668
|
-
stageSeats: snapshot.stageSeats ?? previous?.stageSeats ?? [],
|
|
17669
|
-
simultaneousPhase: snapshot.simultaneousPhase ?? null,
|
|
17670
|
-
view: transformView(snapshot.view),
|
|
17671
|
-
availableInteractions: snapshot.availableInteractions ?? [],
|
|
17672
|
-
zones: snapshot.zones ?? previous?.zones ?? {},
|
|
17673
|
-
boardStatic: hashDisagrees ? previous?.boardStatic ?? null : incomingBoardStatic ?? previous?.boardStatic ?? null,
|
|
17674
|
-
boardStaticHash: incomingBoardStaticHash ?? previous?.boardStaticHash ?? null,
|
|
17675
|
-
layout: previous?.layout ?? null,
|
|
17676
|
-
cardDisplayConfigs: previous?.cardDisplayConfigs ?? null
|
|
17677
|
-
};
|
|
17678
|
-
}
|
|
17679
|
-
function getSessionContext(session) {
|
|
17680
|
-
switch (session.type) {
|
|
17681
|
-
case "lobby":
|
|
17682
|
-
case "gameplayLoading":
|
|
17683
|
-
case "gameplay":
|
|
17684
|
-
case "ended":
|
|
17685
|
-
return session.context;
|
|
17686
|
-
case "error":
|
|
17687
|
-
return session.context ?? null;
|
|
17688
|
-
case "idle":
|
|
17689
|
-
case "loading":
|
|
17690
|
-
return null;
|
|
17691
|
-
}
|
|
17692
|
-
}
|
|
17693
|
-
function getGameplayViewport(session) {
|
|
17694
|
-
return session.type === "gameplay" ? session.gameplay : null;
|
|
17695
|
-
}
|
|
17696
|
-
function withContext(session, context) {
|
|
17697
|
-
switch (session.type) {
|
|
17698
|
-
case "lobby":
|
|
17699
|
-
return { ...session, context };
|
|
17700
|
-
case "gameplayLoading":
|
|
17701
|
-
return { ...session, context };
|
|
17702
|
-
case "gameplay":
|
|
17703
|
-
return { ...session, context };
|
|
17704
|
-
case "ended":
|
|
17705
|
-
return { type: "ended", context };
|
|
17706
|
-
case "error":
|
|
17707
|
-
return { type: "error", message: session.message, context };
|
|
17708
|
-
case "idle":
|
|
17709
|
-
case "loading":
|
|
17710
|
-
return { type: "lobby", context, preferredPlayerId: null };
|
|
17711
|
-
}
|
|
17712
|
-
}
|
|
17713
|
-
|
|
17714
|
-
// ../../packages/ui-host-runtime/src/perf.ts
|
|
17715
|
-
var PERF_MARK_NAMES = {
|
|
17716
|
-
T0_CLICK: "t0_click",
|
|
17717
|
-
T1_HOST_RECEIVED: "t1_host_received",
|
|
17718
|
-
T2_HTTP_SENT: "t2_http_sent",
|
|
17719
|
-
T3_HTTP_RESPONSE: "t3_http_response",
|
|
17720
|
-
/**
|
|
17721
|
-
* Fires when the store applies the submitter's gameplay snapshot
|
|
17722
|
-
* directly from the HTTP response (the Phase B2 eager-apply path).
|
|
17723
|
-
* Sits between `t3_http_response` and `t5_store_applied`; its delta
|
|
17724
|
-
* vs `t3_http_response` measures pure apply-in-store cost and its
|
|
17725
|
-
* delta vs `t4_sse_received` tells us how much SSE tail the eager
|
|
17726
|
-
* apply cuts off for the submitter.
|
|
17727
|
-
*/
|
|
17728
|
-
T3B_RESPONSE_APPLIED: "t3b_response_applied",
|
|
17729
|
-
T4_SSE_RECEIVED: "t4_sse_received",
|
|
17730
|
-
T5_STORE_APPLIED: "t5_store_applied",
|
|
17731
|
-
T6_STATE_SYNC_POSTED: "t6_state_sync_posted",
|
|
17732
|
-
T7_STATE_SYNC_RECEIVED: "t7_state_sync_received",
|
|
17733
|
-
T8_RENDER_COMMIT: "t8_render_commit"
|
|
17734
|
-
};
|
|
17735
|
-
var GLOBAL_KEY = "__dreamboardPerf__";
|
|
17736
|
-
var DUMP_KEY = "__dreamboardPerfDump__";
|
|
17737
|
-
var MAX_ENTRIES = 50;
|
|
17738
|
-
function getBuffer() {
|
|
17739
|
-
if (typeof globalThis === "undefined") {
|
|
17740
|
-
return null;
|
|
17741
|
-
}
|
|
17742
|
-
const scope = globalThis;
|
|
17743
|
-
const existing = scope[GLOBAL_KEY];
|
|
17744
|
-
if (existing) {
|
|
17745
|
-
return existing;
|
|
17746
|
-
}
|
|
17747
|
-
const buffer = {
|
|
17748
|
-
entries: [],
|
|
17749
|
-
versionIndex: /* @__PURE__ */ new Map(),
|
|
17750
|
-
syncIdIndex: /* @__PURE__ */ new Map()
|
|
17751
|
-
};
|
|
17752
|
-
scope[GLOBAL_KEY] = buffer;
|
|
17753
|
-
scope[DUMP_KEY] = () => buffer.entries.slice();
|
|
17754
|
-
return buffer;
|
|
17755
|
-
}
|
|
17756
|
-
function isPerfEnabled() {
|
|
17757
|
-
if (typeof window === "undefined") {
|
|
17758
|
-
return false;
|
|
17759
|
-
}
|
|
17760
|
-
try {
|
|
17761
|
-
const env = import.meta.env;
|
|
17762
|
-
if (env?.DEV) {
|
|
17763
|
-
return true;
|
|
17764
|
-
}
|
|
17765
|
-
} catch {
|
|
17766
|
-
}
|
|
17767
|
-
try {
|
|
17768
|
-
return window.localStorage.getItem("dreamboard.perf") === "1";
|
|
17769
|
-
} catch {
|
|
17770
|
-
return false;
|
|
17771
|
-
}
|
|
17772
|
-
}
|
|
17773
|
-
function nowMs() {
|
|
17774
|
-
return Date.now();
|
|
17775
|
-
}
|
|
17776
|
-
function findOrCreateEntry(buffer, clientActionId) {
|
|
17777
|
-
const existing = buffer.entries.find(
|
|
17778
|
-
(entry) => entry.clientActionId === clientActionId
|
|
17779
|
-
);
|
|
17780
|
-
if (existing) {
|
|
17781
|
-
return existing;
|
|
17782
|
-
}
|
|
17783
|
-
const created = {
|
|
17784
|
-
clientActionId,
|
|
17785
|
-
createdAtMs: nowMs(),
|
|
17786
|
-
marks: []
|
|
17787
|
-
};
|
|
17788
|
-
buffer.entries.push(created);
|
|
17789
|
-
while (buffer.entries.length > MAX_ENTRIES) {
|
|
17790
|
-
const evicted = buffer.entries.shift();
|
|
17791
|
-
if (!evicted) break;
|
|
17792
|
-
if (evicted.version !== void 0) {
|
|
17793
|
-
buffer.versionIndex.delete(evicted.version);
|
|
17794
|
-
}
|
|
17795
|
-
if (evicted.syncId !== void 0) {
|
|
17796
|
-
buffer.syncIdIndex.delete(evicted.syncId);
|
|
17797
|
-
}
|
|
17798
|
-
}
|
|
17799
|
-
return created;
|
|
17800
|
-
}
|
|
17801
|
-
function recordMark(clientActionId, name, options = {}) {
|
|
17802
|
-
if (!clientActionId) return;
|
|
17803
|
-
if (!isPerfEnabled()) return;
|
|
17804
|
-
const buffer = getBuffer();
|
|
17805
|
-
if (!buffer) return;
|
|
17806
|
-
const timestampMs = options.timestampMs ?? nowMs();
|
|
17807
|
-
const entry = findOrCreateEntry(buffer, clientActionId);
|
|
17808
|
-
entry.marks.push({
|
|
17809
|
-
name,
|
|
17810
|
-
timestampMs,
|
|
17811
|
-
extra: options.extra
|
|
17812
|
-
});
|
|
17813
|
-
if (typeof performance !== "undefined" && typeof performance.mark === "function") {
|
|
17814
|
-
try {
|
|
17815
|
-
performance.mark(`dreamboard.${name}.${clientActionId}`, {
|
|
17816
|
-
detail: { clientActionId, ...options.extra }
|
|
17817
|
-
});
|
|
17818
|
-
} catch {
|
|
17819
|
-
}
|
|
17820
|
-
}
|
|
17821
|
-
}
|
|
17822
|
-
function correlateVersion(clientActionId, version2) {
|
|
17823
|
-
if (!isPerfEnabled()) return;
|
|
17824
|
-
const buffer = getBuffer();
|
|
17825
|
-
if (!buffer) return;
|
|
17826
|
-
const entry = findOrCreateEntry(buffer, clientActionId);
|
|
17827
|
-
entry.version = version2;
|
|
17828
|
-
buffer.versionIndex.set(version2, clientActionId);
|
|
17829
|
-
}
|
|
17830
|
-
function correlateSyncId(clientActionId, syncId) {
|
|
17831
|
-
if (!isPerfEnabled()) return;
|
|
17832
|
-
const buffer = getBuffer();
|
|
17833
|
-
if (!buffer) return;
|
|
17834
|
-
const entry = findOrCreateEntry(buffer, clientActionId);
|
|
17835
|
-
entry.syncId = syncId;
|
|
17836
|
-
buffer.syncIdIndex.set(syncId, clientActionId);
|
|
17837
|
-
}
|
|
17838
|
-
function findActionIdByVersion(version2) {
|
|
17839
|
-
const buffer = getBuffer();
|
|
17840
|
-
return buffer?.versionIndex.get(version2);
|
|
17841
|
-
}
|
|
17842
|
-
|
|
17843
|
-
// ../../packages/ui-host-runtime/src/session-ingress.ts
|
|
17844
|
-
function normalizeSnapshot(snapshot, options) {
|
|
17845
|
-
const context = contextFromHostSnapshot(snapshot, options.userId);
|
|
17846
|
-
if (snapshot.type !== "gameplay") {
|
|
17847
|
-
return {
|
|
17848
|
-
type: snapshot.type,
|
|
17849
|
-
context,
|
|
17850
|
-
gameplay: null,
|
|
17851
|
-
preferredPlayerId: null
|
|
17852
|
-
};
|
|
17853
|
-
}
|
|
17854
|
-
return {
|
|
17855
|
-
type: "gameplay",
|
|
17856
|
-
context,
|
|
17857
|
-
perspective: { playerId: snapshot.gameplay.playerId },
|
|
17858
|
-
gameplay: gameplayViewportFromSnapshot(
|
|
17859
|
-
snapshot.gameplay,
|
|
17860
|
-
options.previousGameplay
|
|
17861
|
-
)
|
|
17862
|
-
};
|
|
17863
|
-
}
|
|
17864
|
-
function normalizeEvent(event, options) {
|
|
17865
|
-
const context = options.currentContext;
|
|
17866
|
-
switch (event.type) {
|
|
17867
|
-
case "session.snapshot": {
|
|
17868
|
-
const normalized = normalizeSnapshot(event.snapshot, {
|
|
17869
|
-
userId: options.userId,
|
|
17870
|
-
previousGameplay: options.currentGameplay
|
|
17871
|
-
});
|
|
17872
|
-
return {
|
|
17873
|
-
type: "session.snapshot",
|
|
17874
|
-
snapshot: normalized,
|
|
17875
|
-
context: normalized.context,
|
|
17876
|
-
gameplay: normalized.gameplay
|
|
17877
|
-
};
|
|
17878
|
-
}
|
|
17879
|
-
case "session.lobbyUpdated":
|
|
17880
|
-
return {
|
|
17881
|
-
type: "session.lobbyUpdated",
|
|
17882
|
-
context: context ? contextFromHostEventContext(
|
|
17883
|
-
{ ...context, userId: options.userId },
|
|
17884
|
-
event.context,
|
|
17885
|
-
event.lobby
|
|
17886
|
-
) : null,
|
|
17887
|
-
gameplay: options.currentGameplay
|
|
17888
|
-
};
|
|
17889
|
-
case "session.gameplayUpdated":
|
|
17890
|
-
return {
|
|
17891
|
-
type: "session.gameplayUpdated",
|
|
17892
|
-
context: context ? contextFromHostEventContext(
|
|
17893
|
-
{ ...context, userId: options.userId },
|
|
17894
|
-
event.context
|
|
17895
|
-
) : null,
|
|
17896
|
-
gameplay: gameplayViewportFromSnapshot(
|
|
17897
|
-
event.gameplay,
|
|
17898
|
-
options.currentGameplay
|
|
17899
|
-
),
|
|
17900
|
-
perspective: { playerId: event.gameplay.playerId }
|
|
17901
|
-
};
|
|
17902
|
-
case "session.historyUpdated":
|
|
17903
|
-
return {
|
|
17904
|
-
type: "session.historyUpdated",
|
|
17905
|
-
context: context ? contextFromHostEventContext(
|
|
17906
|
-
{ ...context, userId: options.userId },
|
|
17907
|
-
event.context
|
|
17908
|
-
) : null,
|
|
17909
|
-
gameplay: options.currentGameplay
|
|
17910
|
-
};
|
|
17911
|
-
case "session.ended":
|
|
17912
|
-
return {
|
|
17913
|
-
type: "session.ended",
|
|
17914
|
-
context: context ? contextFromHostEventContext(
|
|
17915
|
-
{ ...context, userId: options.userId },
|
|
17916
|
-
event.context,
|
|
17917
|
-
event.lobby
|
|
17918
|
-
) : null,
|
|
17919
|
-
gameplay: options.currentGameplay
|
|
17920
|
-
};
|
|
17921
|
-
case "session.error":
|
|
17922
|
-
return {
|
|
17923
|
-
type: "session.error",
|
|
17924
|
-
message: event.message,
|
|
17925
|
-
code: event.code,
|
|
17926
|
-
context,
|
|
17927
|
-
gameplay: options.currentGameplay
|
|
17928
|
-
};
|
|
17929
|
-
}
|
|
17930
|
-
}
|
|
17931
|
-
function normalizeSubmitResponse(response, options) {
|
|
17932
|
-
return response.event ? normalizeEvent(response.event, {
|
|
17933
|
-
currentContext: options.currentContext,
|
|
17934
|
-
currentGameplay: options.currentGameplay,
|
|
17935
|
-
userId: options.userId
|
|
17936
|
-
}) : null;
|
|
17937
|
-
}
|
|
17938
|
-
|
|
17939
|
-
// ../../packages/ui-host-runtime/src/session-live-runtime.ts
|
|
17940
|
-
function createSessionLiveRuntime(options) {
|
|
17941
|
-
let connectedSessionId = null;
|
|
17942
|
-
let sessionManager = null;
|
|
17943
|
-
let unsubscribeSession = null;
|
|
17944
|
-
const attachConnectionHandlers = (manager, channel) => {
|
|
17945
|
-
manager.on("connected", () => options.onConnectionChange(channel, true));
|
|
17946
|
-
manager.on(
|
|
17947
|
-
"disconnected",
|
|
17948
|
-
() => options.onConnectionChange(channel, false)
|
|
17949
|
-
);
|
|
17950
|
-
manager.on("error", (error51) => {
|
|
17951
|
-
options.onConnectionChange(channel, false);
|
|
17952
|
-
options.onConnectionError(error51);
|
|
17953
|
-
});
|
|
17954
|
-
};
|
|
17955
|
-
const closeStreams = () => {
|
|
17956
|
-
unsubscribeSession?.();
|
|
17957
|
-
unsubscribeSession = null;
|
|
17958
|
-
sessionManager?.disconnect();
|
|
17959
|
-
sessionManager = null;
|
|
17960
|
-
connectedSessionId = null;
|
|
17961
|
-
options.onConnectionChange("lobby", false);
|
|
17962
|
-
options.onConnectionChange("gameplay", false);
|
|
17963
|
-
};
|
|
17964
|
-
const openSession = (sessionId, playerId, source) => {
|
|
17965
|
-
closeStreams();
|
|
17966
|
-
connectedSessionId = sessionId;
|
|
17967
|
-
sessionManager = options.createSseManager();
|
|
17968
|
-
attachConnectionHandlers(sessionManager, playerId ? "gameplay" : "lobby");
|
|
17969
|
-
unsubscribeSession = sessionManager.onAnyMessage(options.onLiveMessage);
|
|
17970
|
-
void sessionManager.connect(sessionId, {
|
|
17971
|
-
source,
|
|
17972
|
-
playerId
|
|
17973
|
-
});
|
|
17974
|
-
};
|
|
17975
|
-
return {
|
|
17976
|
-
connectSession: (sessionId, connectOptions) => {
|
|
17977
|
-
openSession(
|
|
17978
|
-
sessionId,
|
|
17979
|
-
connectOptions.playerId,
|
|
17980
|
-
connectOptions.source ?? "connect-session"
|
|
17981
|
-
);
|
|
17982
|
-
},
|
|
17983
|
-
reconnectGameplay: (sessionId, playerId, source) => {
|
|
17984
|
-
openSession(sessionId, playerId, source);
|
|
17985
|
-
},
|
|
17986
|
-
requestGameplayResync: (sessionId, playerId, source) => {
|
|
17987
|
-
if (!sessionManager) {
|
|
17988
|
-
return;
|
|
17989
|
-
}
|
|
17990
|
-
void sessionManager.connect(sessionId, {
|
|
17991
|
-
source,
|
|
17992
|
-
playerId
|
|
17993
|
-
});
|
|
17994
|
-
},
|
|
17995
|
-
closeStreams,
|
|
17996
|
-
getConnectedSessionId: () => connectedSessionId
|
|
17997
|
-
};
|
|
17998
|
-
}
|
|
17999
|
-
|
|
18000
|
-
// ../../packages/ui-host-runtime/src/session-state-reducer.ts
|
|
18001
|
-
function createInitialUnifiedSessionState() {
|
|
18002
|
-
return {
|
|
18003
|
-
session: { type: "idle" },
|
|
18004
|
-
connection: {
|
|
18005
|
-
lobby: false,
|
|
18006
|
-
gameplay: false,
|
|
18007
|
-
error: null,
|
|
18008
|
-
isConnected: false
|
|
18009
|
-
},
|
|
18010
|
-
activity: {
|
|
18011
|
-
notifications: [],
|
|
18012
|
-
hostFeedback: [],
|
|
18013
|
-
syncId: 0,
|
|
18014
|
-
lastSyncTimestamp: null,
|
|
18015
|
-
lastAckTimestamp: null
|
|
18016
|
-
},
|
|
18017
|
-
debug: { sseEvents: [], maxEvents: 500 }
|
|
18018
|
-
};
|
|
18019
|
-
}
|
|
18020
|
-
function appendSseEvent(state, debugEvent, env) {
|
|
18021
|
-
const newEvent = {
|
|
18022
|
-
id: env.nextEventId(),
|
|
18023
|
-
eventType: debugEvent.eventType,
|
|
18024
|
-
data: debugEvent.data,
|
|
18025
|
-
timestamp: env.nowIso()
|
|
18026
|
-
};
|
|
18027
|
-
return [...state.debug.sseEvents, newEvent].slice(-state.debug.maxEvents);
|
|
18028
|
-
}
|
|
18029
|
-
function createActionRejectedArtifacts(reason, targetPlayer, env) {
|
|
18030
|
-
return {
|
|
18031
|
-
notification: {
|
|
18032
|
-
id: env.nextNotificationId(),
|
|
18033
|
-
type: "ACTION_REJECTED",
|
|
18034
|
-
payload: { type: "ACTION_REJECTED", reason, targetPlayer },
|
|
18035
|
-
timestamp: env.nowMs(),
|
|
18036
|
-
read: false
|
|
18037
|
-
},
|
|
18038
|
-
hostFeedback: {
|
|
18039
|
-
id: env.nextNotificationId(),
|
|
18040
|
-
type: "ACTION_REJECTED",
|
|
18041
|
-
payload: { type: "ACTION_REJECTED", reason, targetPlayer },
|
|
18042
|
-
timestamp: env.nowMs()
|
|
18043
|
-
}
|
|
18044
|
-
};
|
|
18045
|
-
}
|
|
18046
|
-
function createPromptOpenedArtifacts(prompt, env) {
|
|
18047
|
-
const payload = {
|
|
18048
|
-
type: "PROMPT_OPENED",
|
|
18049
|
-
promptId: prompt.interactionId,
|
|
18050
|
-
promptInstanceId: prompt.interactionId,
|
|
18051
|
-
targetPlayer: prompt.context?.to ?? "",
|
|
18052
|
-
title: prompt.context?.title ?? void 0
|
|
18053
|
-
};
|
|
18054
|
-
return {
|
|
18055
|
-
notification: {
|
|
18056
|
-
id: env.nextNotificationId(),
|
|
18057
|
-
type: "PROMPT_OPENED",
|
|
18058
|
-
payload,
|
|
18059
|
-
timestamp: env.nowMs(),
|
|
18060
|
-
read: false
|
|
18061
|
-
},
|
|
18062
|
-
hostFeedback: {
|
|
18063
|
-
id: env.nextNotificationId(),
|
|
18064
|
-
type: "PROMPT_OPENED",
|
|
18065
|
-
payload,
|
|
18066
|
-
timestamp: env.nowMs()
|
|
18067
|
-
}
|
|
18068
|
-
};
|
|
18069
|
-
}
|
|
18070
|
-
function getOpenedPrompts(previous, next) {
|
|
18071
|
-
const previousPromptIds = new Set(
|
|
18072
|
-
previous.filter((descriptor) => descriptor.kind === "prompt").map((prompt) => prompt.interactionId)
|
|
18073
|
-
);
|
|
18074
|
-
return next.filter(
|
|
18075
|
-
(descriptor) => descriptor.kind === "prompt" && !previousPromptIds.has(descriptor.interactionId)
|
|
18076
|
-
);
|
|
18077
|
-
}
|
|
18078
|
-
function hasBoardStaticHashMismatch(gameplay, incomingGameplay) {
|
|
18079
|
-
const incomingHash = incomingGameplay.boardStaticHash ?? null;
|
|
18080
|
-
const cachedHash = gameplay?.boardStaticHash ?? null;
|
|
18081
|
-
return cachedHash !== null && incomingHash !== null && incomingHash !== cachedHash;
|
|
18082
|
-
}
|
|
18083
|
-
function applyGameplaySnapshotToState(state, gameplay, context, options) {
|
|
18084
|
-
const previousGameplay = getGameplayViewport(state.session);
|
|
18085
|
-
const promptArtifacts = getOpenedPrompts(
|
|
18086
|
-
previousGameplay?.availableInteractions ?? [],
|
|
18087
|
-
gameplay.availableInteractions
|
|
18088
|
-
).map((prompt) => createPromptOpenedArtifacts(prompt, options.env));
|
|
18089
|
-
return {
|
|
18090
|
-
...state,
|
|
18091
|
-
session: {
|
|
18092
|
-
type: "gameplay",
|
|
18093
|
-
context,
|
|
18094
|
-
perspective: options.perspective,
|
|
18095
|
-
gameplay
|
|
18096
|
-
},
|
|
18097
|
-
activity: {
|
|
18098
|
-
...state.activity,
|
|
18099
|
-
notifications: [
|
|
18100
|
-
...state.activity.notifications,
|
|
18101
|
-
...promptArtifacts.map((artifact) => artifact.notification)
|
|
18102
|
-
],
|
|
18103
|
-
hostFeedback: [
|
|
18104
|
-
...state.activity.hostFeedback,
|
|
18105
|
-
...promptArtifacts.map((artifact) => artifact.hostFeedback)
|
|
18106
|
-
],
|
|
18107
|
-
syncId: options.nextSyncId,
|
|
18108
|
-
lastSyncTimestamp: options.env.nowMs()
|
|
18109
|
-
},
|
|
18110
|
-
debug: {
|
|
18111
|
-
...state.debug,
|
|
18112
|
-
sseEvents: options.debugEvent ? appendSseEvent(state, options.debugEvent, options.env) : state.debug.sseEvents
|
|
18113
|
-
}
|
|
18114
|
-
};
|
|
18115
|
-
}
|
|
18116
|
-
function assertExpectedPerspectivePlayer(snapshot, expectedPlayerId) {
|
|
18117
|
-
if (!expectedPlayerId || snapshot.type !== "gameplay") {
|
|
18118
|
-
return;
|
|
18119
|
-
}
|
|
18120
|
-
if (snapshot.perspective.playerId !== expectedPlayerId) {
|
|
18121
|
-
throw new Error(
|
|
18122
|
-
`Switch snapshot resolved ${snapshot.perspective.playerId} instead of ${expectedPlayerId}.`
|
|
18123
|
-
);
|
|
18124
|
-
}
|
|
18125
|
-
}
|
|
18126
|
-
function reduceSnapshotLoaded(state, ingress, env) {
|
|
18127
|
-
assertExpectedPerspectivePlayer(
|
|
18128
|
-
ingress.snapshot,
|
|
18129
|
-
ingress.expectedPerspectivePlayerId
|
|
18130
|
-
);
|
|
18131
|
-
const context = ingress.snapshot.context;
|
|
18132
|
-
const nextSyncId = state.activity.syncId + 1;
|
|
18133
|
-
if (ingress.snapshot.type !== "gameplay") {
|
|
18134
|
-
const session = ingress.snapshot.type === "ended" ? { type: "ended", context } : {
|
|
18135
|
-
type: "lobby",
|
|
18136
|
-
context,
|
|
18137
|
-
preferredPlayerId: ingress.snapshot.preferredPlayerId
|
|
18138
|
-
};
|
|
18139
|
-
return {
|
|
18140
|
-
...state,
|
|
18141
|
-
session,
|
|
18142
|
-
activity: {
|
|
18143
|
-
...state.activity,
|
|
18144
|
-
syncId: nextSyncId,
|
|
18145
|
-
lastSyncTimestamp: env.nowMs()
|
|
18146
|
-
},
|
|
18147
|
-
connection: { ...state.connection, error: null }
|
|
18148
|
-
};
|
|
18149
|
-
}
|
|
18150
|
-
return {
|
|
18151
|
-
...applyGameplaySnapshotToState(state, ingress.snapshot.gameplay, context, {
|
|
18152
|
-
nextSyncId,
|
|
18153
|
-
perspective: ingress.snapshot.perspective,
|
|
18154
|
-
env
|
|
18155
|
-
}),
|
|
18156
|
-
connection: { ...state.connection, error: null }
|
|
18157
|
-
};
|
|
18158
|
-
}
|
|
18159
|
-
function reduceEventReceived(state, ingress, env) {
|
|
18160
|
-
const context = getSessionContext(state.session);
|
|
18161
|
-
const currentGameplay = getGameplayViewport(state.session);
|
|
18162
|
-
const nextSyncId = state.activity.syncId + 1;
|
|
18163
|
-
const debugEvent = ingress.source === "sse" ? ingress.debugEvent : void 0;
|
|
18164
|
-
switch (ingress.event.type) {
|
|
18165
|
-
case "session.snapshot": {
|
|
18166
|
-
const snapshotState = reduceSnapshotLoaded(
|
|
18167
|
-
state,
|
|
18168
|
-
{
|
|
18169
|
-
type: "snapshot.loaded",
|
|
18170
|
-
source: "snapshot",
|
|
18171
|
-
snapshot: ingress.event.snapshot
|
|
18172
|
-
},
|
|
18173
|
-
env
|
|
18174
|
-
);
|
|
18175
|
-
return {
|
|
18176
|
-
state: debugEvent ? {
|
|
18177
|
-
...snapshotState,
|
|
18178
|
-
debug: {
|
|
18179
|
-
...snapshotState.debug,
|
|
18180
|
-
sseEvents: appendSseEvent(state, debugEvent, env)
|
|
18181
|
-
}
|
|
18182
|
-
} : snapshotState,
|
|
18183
|
-
effects: []
|
|
18184
|
-
};
|
|
18185
|
-
}
|
|
18186
|
-
case "session.lobbyUpdated": {
|
|
18187
|
-
const nextContext = ingress.event.context;
|
|
18188
|
-
if (!nextContext) return { state, effects: [] };
|
|
18189
|
-
return {
|
|
18190
|
-
state: {
|
|
18191
|
-
...state,
|
|
18192
|
-
session: withContext(state.session, nextContext),
|
|
18193
|
-
activity: {
|
|
18194
|
-
...state.activity,
|
|
18195
|
-
syncId: nextSyncId,
|
|
18196
|
-
lastSyncTimestamp: env.nowMs()
|
|
18197
|
-
},
|
|
18198
|
-
debug: {
|
|
18199
|
-
...state.debug,
|
|
18200
|
-
sseEvents: debugEvent ? appendSseEvent(state, debugEvent, env) : state.debug.sseEvents
|
|
18201
|
-
}
|
|
18202
|
-
},
|
|
18203
|
-
effects: []
|
|
18204
|
-
};
|
|
18205
|
-
}
|
|
18206
|
-
case "session.gameplayUpdated": {
|
|
18207
|
-
if (!context || !ingress.event.context) return { state, effects: [] };
|
|
18208
|
-
if (ingress.source === "sse" && (state.session.type === "gameplay" && ingress.event.perspective.playerId !== state.session.perspective.playerId || state.session.type === "gameplayLoading" && ingress.event.perspective.playerId !== state.session.requestedPlayerId)) {
|
|
18209
|
-
return { state, effects: [] };
|
|
18210
|
-
}
|
|
18211
|
-
if (currentGameplay && ingress.event.gameplay.version <= currentGameplay.version) {
|
|
18212
|
-
return { state, effects: [] };
|
|
18213
|
-
}
|
|
18214
|
-
const updatedState = applyGameplaySnapshotToState(
|
|
18215
|
-
state,
|
|
18216
|
-
ingress.event.gameplay,
|
|
18217
|
-
ingress.event.context,
|
|
18218
|
-
{
|
|
18219
|
-
nextSyncId,
|
|
18220
|
-
perspective: ingress.event.perspective,
|
|
18221
|
-
debugEvent,
|
|
18222
|
-
env
|
|
18223
|
-
}
|
|
18224
|
-
);
|
|
18225
|
-
const effects = [
|
|
18226
|
-
{
|
|
18227
|
-
type: "perf.storeApplied",
|
|
18228
|
-
gameplayVersion: ingress.event.gameplay.version,
|
|
18229
|
-
syncId: nextSyncId
|
|
18230
|
-
}
|
|
18231
|
-
];
|
|
18232
|
-
if (hasBoardStaticHashMismatch(currentGameplay, ingress.event.gameplay)) {
|
|
18233
|
-
effects.push({
|
|
18234
|
-
type: "requestGameplayResync",
|
|
18235
|
-
sessionId: context.identity.sessionId,
|
|
18236
|
-
playerId: ingress.event.perspective.playerId,
|
|
18237
|
-
reason: `boardStaticHash mismatch cached=${currentGameplay?.boardStaticHash} incoming=${ingress.event.gameplay.boardStaticHash}`
|
|
18238
|
-
});
|
|
18239
|
-
}
|
|
18240
|
-
return { state: updatedState, effects };
|
|
18241
|
-
}
|
|
18242
|
-
case "session.historyUpdated": {
|
|
18243
|
-
const nextContext = ingress.event.context;
|
|
18244
|
-
if (!nextContext) return { state, effects: [] };
|
|
18245
|
-
return {
|
|
18246
|
-
state: {
|
|
18247
|
-
...state,
|
|
18248
|
-
session: withContext(state.session, nextContext),
|
|
18249
|
-
activity: {
|
|
18250
|
-
...state.activity,
|
|
18251
|
-
syncId: nextSyncId,
|
|
18252
|
-
lastSyncTimestamp: env.nowMs()
|
|
18253
|
-
},
|
|
18254
|
-
debug: {
|
|
18255
|
-
...state.debug,
|
|
18256
|
-
sseEvents: debugEvent ? appendSseEvent(state, debugEvent, env) : state.debug.sseEvents
|
|
18257
|
-
}
|
|
18258
|
-
},
|
|
18259
|
-
effects: []
|
|
18260
|
-
};
|
|
18261
|
-
}
|
|
18262
|
-
case "session.ended": {
|
|
18263
|
-
const nextContext = ingress.event.context;
|
|
18264
|
-
if (!nextContext) return { state, effects: [] };
|
|
18265
|
-
return {
|
|
18266
|
-
state: {
|
|
18267
|
-
...state,
|
|
18268
|
-
session: { type: "ended", context: nextContext },
|
|
18269
|
-
activity: {
|
|
18270
|
-
...state.activity,
|
|
18271
|
-
syncId: nextSyncId,
|
|
18272
|
-
lastSyncTimestamp: env.nowMs()
|
|
18273
|
-
},
|
|
18274
|
-
debug: {
|
|
18275
|
-
...state.debug,
|
|
18276
|
-
sseEvents: debugEvent ? appendSseEvent(state, debugEvent, env) : state.debug.sseEvents
|
|
18277
|
-
}
|
|
18278
|
-
},
|
|
18279
|
-
effects: []
|
|
18280
|
-
};
|
|
18281
|
-
}
|
|
18282
|
-
case "session.error":
|
|
18283
|
-
return {
|
|
18284
|
-
state: {
|
|
18285
|
-
...state,
|
|
18286
|
-
session: {
|
|
18287
|
-
type: "error",
|
|
18288
|
-
message: ingress.event.message,
|
|
18289
|
-
context: context ?? void 0
|
|
18290
|
-
},
|
|
18291
|
-
activity: {
|
|
18292
|
-
...state.activity,
|
|
18293
|
-
syncId: nextSyncId,
|
|
18294
|
-
lastSyncTimestamp: env.nowMs()
|
|
18295
|
-
},
|
|
18296
|
-
debug: {
|
|
18297
|
-
...state.debug,
|
|
18298
|
-
sseEvents: debugEvent ? appendSseEvent(state, debugEvent, env) : state.debug.sseEvents
|
|
18299
|
-
}
|
|
18300
|
-
},
|
|
18301
|
-
effects: []
|
|
18302
|
-
};
|
|
18303
|
-
}
|
|
18304
|
-
}
|
|
18305
|
-
function reduceSessionState(state, ingress, env) {
|
|
18306
|
-
switch (ingress.type) {
|
|
18307
|
-
case "command.loading":
|
|
18308
|
-
return {
|
|
18309
|
-
state: {
|
|
18310
|
-
...state,
|
|
18311
|
-
session: { type: "loading", target: ingress.target },
|
|
18312
|
-
connection: { ...state.connection, error: null }
|
|
18313
|
-
},
|
|
18314
|
-
effects: []
|
|
18315
|
-
};
|
|
18316
|
-
case "command.failed":
|
|
18317
|
-
return {
|
|
18318
|
-
state: {
|
|
18319
|
-
...state,
|
|
18320
|
-
session: {
|
|
18321
|
-
type: "error",
|
|
18322
|
-
message: ingress.message,
|
|
18323
|
-
context: getSessionContext(state.session) ?? void 0
|
|
18324
|
-
}
|
|
18325
|
-
},
|
|
18326
|
-
effects: []
|
|
18327
|
-
};
|
|
18328
|
-
case "snapshot.loaded":
|
|
18329
|
-
return {
|
|
18330
|
-
state: reduceSnapshotLoaded(state, ingress, env),
|
|
18331
|
-
effects: []
|
|
18332
|
-
};
|
|
18333
|
-
case "event.received":
|
|
18334
|
-
return reduceEventReceived(state, ingress, env);
|
|
18335
|
-
case "connection.prepared": {
|
|
18336
|
-
const context = getSessionContext(state.session);
|
|
18337
|
-
if (!context) return { state, effects: [] };
|
|
18338
|
-
return {
|
|
18339
|
-
state: {
|
|
18340
|
-
...state,
|
|
18341
|
-
session: withContext(state.session, {
|
|
18342
|
-
...context,
|
|
18343
|
-
userId: ingress.userId,
|
|
18344
|
-
switchablePlayerIds: ingress.switchablePlayerIds
|
|
18345
|
-
}),
|
|
18346
|
-
connection: { ...state.connection, error: null }
|
|
18347
|
-
},
|
|
18348
|
-
effects: []
|
|
18349
|
-
};
|
|
18350
|
-
}
|
|
18351
|
-
case "connection.changed": {
|
|
18352
|
-
const connection = {
|
|
18353
|
-
...state.connection,
|
|
18354
|
-
[ingress.channel]: ingress.connected
|
|
18355
|
-
};
|
|
18356
|
-
return {
|
|
18357
|
-
state: {
|
|
18358
|
-
...state,
|
|
18359
|
-
connection: {
|
|
18360
|
-
...connection,
|
|
18361
|
-
isConnected: connection.lobby || connection.gameplay
|
|
18362
|
-
}
|
|
18363
|
-
},
|
|
18364
|
-
effects: []
|
|
18365
|
-
};
|
|
18366
|
-
}
|
|
18367
|
-
case "connection.failed":
|
|
18368
|
-
return {
|
|
18369
|
-
state: {
|
|
18370
|
-
...state,
|
|
18371
|
-
connection: { ...state.connection, error: ingress.message }
|
|
18372
|
-
},
|
|
18373
|
-
effects: []
|
|
18374
|
-
};
|
|
18375
|
-
case "connection.errorCleared":
|
|
18376
|
-
return {
|
|
18377
|
-
state: {
|
|
18378
|
-
...state,
|
|
18379
|
-
connection: { ...state.connection, error: null }
|
|
18380
|
-
},
|
|
18381
|
-
effects: []
|
|
18382
|
-
};
|
|
18383
|
-
case "feedback.actionRejected": {
|
|
18384
|
-
const { notification, hostFeedback } = createActionRejectedArtifacts(
|
|
18385
|
-
ingress.reason,
|
|
18386
|
-
ingress.targetPlayer,
|
|
18387
|
-
env
|
|
18388
|
-
);
|
|
18389
|
-
return {
|
|
18390
|
-
state: {
|
|
18391
|
-
...state,
|
|
18392
|
-
activity: {
|
|
18393
|
-
...state.activity,
|
|
18394
|
-
notifications: [...state.activity.notifications, notification],
|
|
18395
|
-
hostFeedback: [...state.activity.hostFeedback, hostFeedback]
|
|
18396
|
-
}
|
|
18397
|
-
},
|
|
18398
|
-
effects: []
|
|
18399
|
-
};
|
|
18400
|
-
}
|
|
18401
|
-
case "local.playerSelected": {
|
|
18402
|
-
const context = getSessionContext(state.session);
|
|
18403
|
-
if (!context) return { state, effects: [] };
|
|
18404
|
-
const controllablePlayerIds = resolveControllablePlayerIds(
|
|
18405
|
-
context.switchablePlayerIds,
|
|
18406
|
-
context.seats,
|
|
18407
|
-
context.userId,
|
|
18408
|
-
env.fallbackToAllSeatsWhenUserIdMissing
|
|
18409
|
-
);
|
|
18410
|
-
if (!controllablePlayerIds.includes(ingress.playerId)) {
|
|
18411
|
-
return {
|
|
18412
|
-
state,
|
|
18413
|
-
effects: [
|
|
18414
|
-
{
|
|
18415
|
-
type: "log.warn",
|
|
18416
|
-
message: `[UnifiedSession] Cannot switch to ${ingress.playerId} - not controllable`
|
|
18417
|
-
}
|
|
18418
|
-
]
|
|
18419
|
-
};
|
|
18420
|
-
}
|
|
18421
|
-
return {
|
|
18422
|
-
state: {
|
|
18423
|
-
...state,
|
|
18424
|
-
session: {
|
|
18425
|
-
type: "gameplayLoading",
|
|
18426
|
-
context,
|
|
18427
|
-
requestedPlayerId: ingress.playerId
|
|
18428
|
-
}
|
|
18429
|
-
},
|
|
18430
|
-
effects: [
|
|
18431
|
-
{
|
|
18432
|
-
type: "reconnectGameplay",
|
|
18433
|
-
sessionId: ingress.sessionId,
|
|
18434
|
-
playerId: ingress.playerId,
|
|
18435
|
-
source: "player-switch"
|
|
18436
|
-
}
|
|
18437
|
-
]
|
|
18438
|
-
};
|
|
18439
|
-
}
|
|
18440
|
-
case "activity.stateAcked":
|
|
18441
|
-
return {
|
|
18442
|
-
state: {
|
|
18443
|
-
...state,
|
|
18444
|
-
activity: { ...state.activity, lastAckTimestamp: env.nowMs() }
|
|
18445
|
-
},
|
|
18446
|
-
effects: []
|
|
18447
|
-
};
|
|
18448
|
-
case "activity.notificationRead":
|
|
18449
|
-
return {
|
|
18450
|
-
state: {
|
|
18451
|
-
...state,
|
|
18452
|
-
activity: {
|
|
18453
|
-
...state.activity,
|
|
18454
|
-
notifications: state.activity.notifications.map(
|
|
18455
|
-
(notification) => notification.id === ingress.id ? { ...notification, read: true } : notification
|
|
18456
|
-
)
|
|
18457
|
-
}
|
|
18458
|
-
},
|
|
18459
|
-
effects: []
|
|
18460
|
-
};
|
|
18461
|
-
case "activity.notificationsCleared":
|
|
18462
|
-
return {
|
|
18463
|
-
state: {
|
|
18464
|
-
...state,
|
|
18465
|
-
activity: { ...state.activity, notifications: [] }
|
|
18466
|
-
},
|
|
18467
|
-
effects: []
|
|
18468
|
-
};
|
|
18469
|
-
case "activity.hostFeedbackDismissed":
|
|
18470
|
-
return {
|
|
18471
|
-
state: {
|
|
18472
|
-
...state,
|
|
18473
|
-
activity: {
|
|
18474
|
-
...state.activity,
|
|
18475
|
-
hostFeedback: state.activity.hostFeedback.filter(
|
|
18476
|
-
(item) => item.id !== ingress.id
|
|
18477
|
-
)
|
|
18478
|
-
}
|
|
18479
|
-
},
|
|
18480
|
-
effects: []
|
|
18481
|
-
};
|
|
18482
|
-
case "activity.hostFeedbackCleared":
|
|
18483
|
-
return {
|
|
18484
|
-
state: {
|
|
18485
|
-
...state,
|
|
18486
|
-
activity: { ...state.activity, hostFeedback: [] }
|
|
18487
|
-
},
|
|
18488
|
-
effects: []
|
|
18489
|
-
};
|
|
18490
|
-
case "debug.sseEventsCleared":
|
|
18491
|
-
return {
|
|
18492
|
-
state: { ...state, debug: { ...state.debug, sseEvents: [] } },
|
|
18493
|
-
effects: []
|
|
18494
|
-
};
|
|
18495
|
-
case "streams.closed":
|
|
18496
|
-
return {
|
|
18497
|
-
state: {
|
|
18498
|
-
...state,
|
|
18499
|
-
connection: {
|
|
18500
|
-
...state.connection,
|
|
18501
|
-
lobby: false,
|
|
18502
|
-
gameplay: false,
|
|
18503
|
-
isConnected: false
|
|
18504
|
-
}
|
|
18505
|
-
},
|
|
18506
|
-
effects: []
|
|
18507
|
-
};
|
|
18508
|
-
case "session.reset":
|
|
18509
|
-
return { state: createInitialUnifiedSessionState(), effects: [] };
|
|
18510
|
-
}
|
|
18511
|
-
}
|
|
18512
|
-
|
|
18513
|
-
// ../../packages/ui-host-runtime/src/session-ingress-controller.ts
|
|
18514
|
-
function describeSseError(error51) {
|
|
18515
|
-
if (error51 instanceof Error) {
|
|
18516
|
-
if (error51.message.includes("429") || error51.message.includes("400 Bad Request")) {
|
|
18517
|
-
return "Too many live views are open for this session. Close unused tabs or devices, then refresh.";
|
|
18518
|
-
}
|
|
18519
|
-
return "Live session updates disconnected. Check your network and refresh to reconnect.";
|
|
18520
|
-
}
|
|
18521
|
-
return "Live session updates disconnected. Refresh to reconnect.";
|
|
18522
|
-
}
|
|
18523
|
-
function describeCommandFailure(error51, fallback) {
|
|
18524
|
-
if (error51 instanceof Error && error51.message.trim()) {
|
|
18525
|
-
return error51.message;
|
|
18526
|
-
}
|
|
18527
|
-
const payload = error51;
|
|
18528
|
-
if (typeof payload?.detail === "string" && payload.detail.trim()) {
|
|
18529
|
-
return payload.detail;
|
|
18530
|
-
}
|
|
18531
|
-
if (typeof payload?.message === "string" && payload.message.trim()) {
|
|
18532
|
-
return payload.message;
|
|
18533
|
-
}
|
|
18534
|
-
return fallback;
|
|
18535
|
-
}
|
|
18536
|
-
function createSubmissionError(errorCode, message) {
|
|
18537
|
-
const error51 = new Error(message ?? "Interaction rejected");
|
|
18538
|
-
error51.name = "SubmissionError";
|
|
18539
|
-
error51.errorCode = errorCode;
|
|
18540
|
-
return error51;
|
|
18541
|
-
}
|
|
18542
|
-
function createSessionIngressController(options) {
|
|
18543
|
-
const {
|
|
18544
|
-
store,
|
|
18545
|
-
transport,
|
|
18546
|
-
logger,
|
|
18547
|
-
fallbackToAllSeatsWhenUserIdMissing,
|
|
18548
|
-
reducerEnvironment
|
|
18549
|
-
} = options;
|
|
18550
|
-
const dispatchIngress = (ingress) => {
|
|
18551
|
-
const { state, effects } = reduceSessionState(
|
|
18552
|
-
store.getState(),
|
|
18553
|
-
ingress,
|
|
18554
|
-
reducerEnvironment
|
|
18555
|
-
);
|
|
18556
|
-
store.setState(state);
|
|
18557
|
-
effects.forEach(executeEffect);
|
|
18558
|
-
};
|
|
18559
|
-
const runtime = createSessionLiveRuntime({
|
|
18560
|
-
createSseManager: options.createSseManager,
|
|
18561
|
-
onConnectionChange: (channel, connected) => {
|
|
18562
|
-
dispatchIngress({ type: "connection.changed", channel, connected });
|
|
18563
|
-
},
|
|
18564
|
-
onConnectionError: (error51) => {
|
|
18565
|
-
logger.error("[UnifiedSession] SSE connection error:", error51);
|
|
18566
|
-
dispatchIngress({
|
|
18567
|
-
type: "connection.failed",
|
|
18568
|
-
message: describeSseError(error51)
|
|
18569
|
-
});
|
|
18570
|
-
},
|
|
18571
|
-
onLiveMessage: (message) => {
|
|
18572
|
-
const state = store.getState();
|
|
18573
|
-
const context = getSessionContext(state.session);
|
|
18574
|
-
const event = normalizeEvent(message, {
|
|
18575
|
-
currentContext: context,
|
|
18576
|
-
currentGameplay: getGameplayViewport(state.session),
|
|
18577
|
-
userId: context?.userId ?? null
|
|
18578
|
-
});
|
|
18579
|
-
dispatchIngress({
|
|
18580
|
-
type: "event.received",
|
|
18581
|
-
source: "sse",
|
|
18582
|
-
event,
|
|
18583
|
-
debugEvent: { eventType: message.type, data: message }
|
|
18584
|
-
});
|
|
18585
|
-
}
|
|
18586
|
-
});
|
|
18587
|
-
function executeEffect(effect) {
|
|
18588
|
-
switch (effect.type) {
|
|
18589
|
-
case "requestGameplayResync":
|
|
18590
|
-
logger.warn(
|
|
18591
|
-
`[UnifiedSession] ${effect.reason}; reconnecting to refresh gameplay.bootstrap`
|
|
18592
|
-
);
|
|
18593
|
-
runtime.requestGameplayResync(
|
|
18594
|
-
effect.sessionId,
|
|
18595
|
-
effect.playerId,
|
|
18596
|
-
"board-static-resync"
|
|
18597
|
-
);
|
|
18598
|
-
break;
|
|
18599
|
-
case "reconnectGameplay":
|
|
18600
|
-
runtime.reconnectGameplay(
|
|
18601
|
-
effect.sessionId,
|
|
18602
|
-
effect.playerId,
|
|
18603
|
-
effect.source
|
|
18604
|
-
);
|
|
18605
|
-
break;
|
|
18606
|
-
case "perf.storeApplied": {
|
|
18607
|
-
const actionId = findActionIdByVersion(effect.gameplayVersion);
|
|
18608
|
-
if (!actionId) break;
|
|
18609
|
-
recordMark(actionId, PERF_MARK_NAMES.T5_STORE_APPLIED, {
|
|
18610
|
-
extra: {
|
|
18611
|
-
version: effect.gameplayVersion,
|
|
18612
|
-
syncId: effect.syncId
|
|
18613
|
-
}
|
|
18614
|
-
});
|
|
18615
|
-
correlateSyncId(actionId, effect.syncId);
|
|
18616
|
-
break;
|
|
18617
|
-
}
|
|
18618
|
-
case "log.warn":
|
|
18619
|
-
logger.warn(effect.message);
|
|
18620
|
-
break;
|
|
18621
|
-
}
|
|
18622
|
-
}
|
|
18623
|
-
function connectLiveSession(sessionId, userId, connectOptions = {}) {
|
|
18624
|
-
const context = getSessionContext(store.getState().session);
|
|
18625
|
-
const controllablePlayerIds = context ? resolveControllablePlayerIds(
|
|
18626
|
-
context.switchablePlayerIds,
|
|
18627
|
-
context.seats,
|
|
18628
|
-
userId,
|
|
18629
|
-
fallbackToAllSeatsWhenUserIdMissing
|
|
18630
|
-
) : [];
|
|
18631
|
-
const session = store.getState().session;
|
|
18632
|
-
const playerId = connectOptions.playerId ?? (session.type === "gameplay" ? session.perspective.playerId : controllablePlayerIds[0]);
|
|
18633
|
-
dispatchIngress({
|
|
18634
|
-
type: "connection.prepared",
|
|
18635
|
-
userId,
|
|
18636
|
-
switchablePlayerIds: controllablePlayerIds
|
|
18637
|
-
});
|
|
18638
|
-
logger.log(`[UnifiedSession] Connecting to session: ${sessionId}`);
|
|
18639
|
-
runtime.connectSession(sessionId, {
|
|
18640
|
-
source: connectOptions.source,
|
|
18641
|
-
playerId
|
|
18642
|
-
});
|
|
18643
|
-
}
|
|
18644
|
-
async function runSnapshotCommand(input, failureMessage) {
|
|
18645
|
-
if (!input.preserveCurrentOnFailure) {
|
|
18646
|
-
dispatchIngress({ type: "command.loading", target: input.target });
|
|
18647
|
-
}
|
|
18648
|
-
try {
|
|
18649
|
-
const snapshot = await input.load();
|
|
18650
|
-
const normalized = normalizeSnapshot(snapshot, {
|
|
18651
|
-
userId: input.userId ?? null,
|
|
18652
|
-
previousGameplay: getGameplayViewport(store.getState().session)
|
|
18653
|
-
});
|
|
18654
|
-
dispatchIngress({
|
|
18655
|
-
type: "snapshot.loaded",
|
|
18656
|
-
source: input.sourceLabel,
|
|
18657
|
-
snapshot: normalized,
|
|
18658
|
-
expectedPerspectivePlayerId: input.expectedPerspectivePlayerId
|
|
18659
|
-
});
|
|
18660
|
-
connectLiveSession(
|
|
18661
|
-
normalized.context.identity.sessionId,
|
|
18662
|
-
input.userId ?? null,
|
|
18663
|
-
{
|
|
18664
|
-
source: input.connectSource,
|
|
18665
|
-
playerId: normalized.type === "gameplay" ? normalized.perspective.playerId : void 0
|
|
18666
|
-
}
|
|
18667
|
-
);
|
|
18668
|
-
} catch (error51) {
|
|
18669
|
-
if (!input.preserveCurrentOnFailure) {
|
|
18670
|
-
dispatchIngress({
|
|
18671
|
-
type: "command.failed",
|
|
18672
|
-
message: describeCommandFailure(error51, failureMessage)
|
|
18673
|
-
});
|
|
18674
|
-
}
|
|
18675
|
-
throw error51;
|
|
18676
|
-
}
|
|
18677
|
-
}
|
|
18678
|
-
function normalizeSubmitResponseForCurrentState(response) {
|
|
18679
|
-
const state = store.getState();
|
|
18680
|
-
const context = getSessionContext(state.session);
|
|
18681
|
-
return normalizeSubmitResponse(response, {
|
|
18682
|
-
currentContext: context,
|
|
18683
|
-
currentGameplay: getGameplayViewport(state.session),
|
|
18684
|
-
userId: context?.userId ?? null
|
|
18685
|
-
});
|
|
18686
|
-
}
|
|
18687
|
-
function dispatchSubmitResponse(event, clientActionId) {
|
|
18688
|
-
if (!event) return;
|
|
18689
|
-
if (clientActionId && event.type === "session.gameplayUpdated") {
|
|
18690
|
-
recordMark(clientActionId, PERF_MARK_NAMES.T3B_RESPONSE_APPLIED, {
|
|
18691
|
-
extra: { version: event.gameplay.version }
|
|
18692
|
-
});
|
|
18693
|
-
}
|
|
18694
|
-
dispatchIngress({
|
|
18695
|
-
type: "event.received",
|
|
18696
|
-
source: "submit-response",
|
|
18697
|
-
event,
|
|
18698
|
-
clientActionId
|
|
18699
|
-
});
|
|
18700
|
-
}
|
|
18701
|
-
return {
|
|
18702
|
-
loadSessionByShortCode: async (input) => {
|
|
18703
|
-
await runSnapshotCommand(
|
|
18704
|
-
{
|
|
18705
|
-
target: { shortCode: input.shortCode },
|
|
18706
|
-
sourceLabel: "short-code",
|
|
18707
|
-
connectSource: input.source,
|
|
18708
|
-
userId: input.userId,
|
|
18709
|
-
load: () => transport.loadSessionByShortCode({
|
|
18710
|
-
shortCode: input.shortCode,
|
|
18711
|
-
requestedPlayerId: input.requestedPlayerId
|
|
18712
|
-
})
|
|
18713
|
-
},
|
|
18714
|
-
"Failed to load session by short code."
|
|
18715
|
-
);
|
|
18716
|
-
},
|
|
18717
|
-
loadSessionSnapshot: async (input) => {
|
|
18718
|
-
await runSnapshotCommand(
|
|
18719
|
-
{
|
|
18720
|
-
target: { sessionId: input.sessionId },
|
|
18721
|
-
sourceLabel: input.source === "dev-new" ? "dev-new" : "snapshot",
|
|
18722
|
-
connectSource: input.source,
|
|
18723
|
-
userId: input.userId,
|
|
18724
|
-
expectedPerspectivePlayerId: input.expectedPerspectivePlayerId,
|
|
18725
|
-
preserveCurrentOnFailure: input.source === "player-switch",
|
|
18726
|
-
load: () => transport.loadSessionSnapshot({
|
|
18727
|
-
sessionId: input.sessionId,
|
|
18728
|
-
requestedPlayerId: input.requestedPlayerId
|
|
18729
|
-
})
|
|
18730
|
-
},
|
|
18731
|
-
"Failed to load session snapshot."
|
|
18732
|
-
);
|
|
18733
|
-
},
|
|
18734
|
-
startSession: async (input) => {
|
|
18735
|
-
await runSnapshotCommand(
|
|
18736
|
-
{
|
|
18737
|
-
target: { sessionId: input.sessionId },
|
|
18738
|
-
sourceLabel: "start",
|
|
18739
|
-
connectSource: input.source,
|
|
18740
|
-
userId: input.userId,
|
|
18741
|
-
load: () => transport.startSession({ sessionId: input.sessionId })
|
|
18742
|
-
},
|
|
18743
|
-
"Failed to start session."
|
|
18744
|
-
);
|
|
18745
|
-
},
|
|
18746
|
-
submitInteraction: async (input) => {
|
|
18747
|
-
const gameplay = getGameplayViewport(store.getState().session);
|
|
18748
|
-
if (!gameplay) {
|
|
18749
|
-
throw new Error("No renderable gameplay snapshot is available.");
|
|
18750
|
-
}
|
|
18751
|
-
if (input.clientActionId) {
|
|
18752
|
-
recordMark(input.clientActionId, PERF_MARK_NAMES.T2_HTTP_SENT, {
|
|
18753
|
-
extra: {
|
|
18754
|
-
playerId: input.playerId,
|
|
18755
|
-
interactionId: input.interactionId,
|
|
18756
|
-
expectedVersion: gameplay.version
|
|
18757
|
-
}
|
|
18758
|
-
});
|
|
18759
|
-
}
|
|
18760
|
-
const response = await transport.submitInteraction({
|
|
18761
|
-
sessionId: input.sessionId,
|
|
18762
|
-
playerId: input.playerId,
|
|
18763
|
-
interactionId: input.interactionId,
|
|
18764
|
-
expectedVersion: gameplay.version,
|
|
18765
|
-
actionSetVersion: gameplay.actionSetVersion,
|
|
18766
|
-
params: input.params,
|
|
18767
|
-
clientActionId: input.clientActionId
|
|
18768
|
-
});
|
|
18769
|
-
const normalizedResponse = normalizeSubmitResponseForCurrentState(response);
|
|
18770
|
-
if (input.clientActionId) {
|
|
18771
|
-
recordMark(input.clientActionId, PERF_MARK_NAMES.T3_HTTP_RESPONSE, {
|
|
18772
|
-
extra: {
|
|
18773
|
-
accepted: response.accepted,
|
|
18774
|
-
errorCode: response.errorCode,
|
|
18775
|
-
version: response.version,
|
|
18776
|
-
transport: "ok"
|
|
18777
|
-
}
|
|
18778
|
-
});
|
|
18779
|
-
const acceptedGameplayVersion = normalizedResponse?.type === "session.gameplayUpdated" ? normalizedResponse.gameplay.version : response.version;
|
|
18780
|
-
if (acceptedGameplayVersion !== void 0 && response.accepted !== false) {
|
|
18781
|
-
correlateVersion(input.clientActionId, acceptedGameplayVersion);
|
|
18782
|
-
}
|
|
18783
|
-
}
|
|
18784
|
-
if (response.accepted !== false) {
|
|
18785
|
-
dispatchSubmitResponse(normalizedResponse, input.clientActionId);
|
|
18786
|
-
return;
|
|
18787
|
-
}
|
|
18788
|
-
dispatchIngress({
|
|
18789
|
-
type: "feedback.actionRejected",
|
|
18790
|
-
reason: response.message ?? "Interaction rejected",
|
|
18791
|
-
targetPlayer: input.playerId
|
|
18792
|
-
});
|
|
18793
|
-
throw createSubmissionError(
|
|
18794
|
-
response.errorCode ?? void 0,
|
|
18795
|
-
response.message ?? "Interaction rejected"
|
|
18796
|
-
);
|
|
18797
|
-
},
|
|
18798
|
-
restoreHistory: async (input) => {
|
|
18799
|
-
await transport.restoreHistory(input);
|
|
18800
|
-
},
|
|
18801
|
-
selectPlayer: (playerId) => {
|
|
18802
|
-
const context = getSessionContext(store.getState().session);
|
|
18803
|
-
if (!context) return;
|
|
18804
|
-
dispatchIngress({
|
|
18805
|
-
type: "local.playerSelected",
|
|
18806
|
-
playerId,
|
|
18807
|
-
sessionId: runtime.getConnectedSessionId() ?? context.identity.sessionId
|
|
18808
|
-
});
|
|
18809
|
-
},
|
|
18810
|
-
clearConnectionError: () => dispatchIngress({ type: "connection.errorCleared" }),
|
|
18811
|
-
enqueueActionRejected: (reason, targetPlayer) => dispatchIngress({
|
|
18812
|
-
type: "feedback.actionRejected",
|
|
18813
|
-
reason,
|
|
18814
|
-
targetPlayer
|
|
18815
|
-
}),
|
|
18816
|
-
closeStreams: () => {
|
|
18817
|
-
runtime.closeStreams();
|
|
18818
|
-
dispatchIngress({ type: "streams.closed" });
|
|
18819
|
-
},
|
|
18820
|
-
onStateAck: () => dispatchIngress({ type: "activity.stateAcked" }),
|
|
18821
|
-
markNotificationRead: (id) => dispatchIngress({ type: "activity.notificationRead", id }),
|
|
18822
|
-
clearNotifications: () => dispatchIngress({ type: "activity.notificationsCleared" }),
|
|
18823
|
-
dismissHostFeedback: (id) => dispatchIngress({ type: "activity.hostFeedbackDismissed", id }),
|
|
18824
|
-
clearHostFeedback: () => dispatchIngress({ type: "activity.hostFeedbackCleared" }),
|
|
18825
|
-
clearSSEEvents: () => dispatchIngress({ type: "debug.sseEventsCleared" }),
|
|
18826
|
-
reset: () => {
|
|
18827
|
-
runtime.closeStreams();
|
|
18828
|
-
store.setState(createInitialUnifiedSessionState());
|
|
18829
|
-
}
|
|
18830
|
-
};
|
|
18831
|
-
}
|
|
18832
|
-
|
|
18833
|
-
// ../../packages/ui-host-runtime/src/session-projection.ts
|
|
18834
|
-
function selectPluginSnapshot(state, fallbackToAllSeatsWhenUserIdMissing = false) {
|
|
18835
|
-
const context = getSessionContext(state.session);
|
|
18836
|
-
const gameplay = getGameplayViewport(state.session);
|
|
18837
|
-
const perspectivePlayerId = state.session.type === "gameplay" ? state.session.perspective.playerId : null;
|
|
18838
|
-
const controllablePlayerIds = context ? resolveControllablePlayerIds(
|
|
18839
|
-
context.switchablePlayerIds,
|
|
18840
|
-
context.seats,
|
|
18841
|
-
context.userId,
|
|
18842
|
-
fallbackToAllSeatsWhenUserIdMissing
|
|
18843
|
-
) : [];
|
|
18844
|
-
const controllingPlayerId = perspectivePlayerId;
|
|
18845
|
-
const gameplayIsRenderable = gameplay !== null && perspectivePlayerId !== null;
|
|
18846
|
-
const visibleInteractions = gameplayIsRenderable ? gameplay.availableInteractions : [];
|
|
18847
|
-
const seatView = gameplayIsRenderable ? gameplay.view : null;
|
|
18848
|
-
const boardStatic = gameplay?.boardStatic ?? null;
|
|
18849
|
-
const view = boardStatic && seatView && typeof seatView === "object" ? {
|
|
18850
|
-
...seatView,
|
|
18851
|
-
board: {
|
|
18852
|
-
...seatView.board ?? {},
|
|
18853
|
-
...boardStatic
|
|
18854
|
-
}
|
|
18855
|
-
} : boardStatic && !seatView ? { board: boardStatic } : seatView;
|
|
18856
|
-
const visibleZones = gameplayIsRenderable ? gameplay.zones : {};
|
|
18857
|
-
return {
|
|
18858
|
-
view,
|
|
18859
|
-
gameplay: {
|
|
18860
|
-
currentPhase: gameplay?.currentPhase ?? null,
|
|
18861
|
-
currentStage: gameplay?.currentStage ?? null,
|
|
18862
|
-
activePlayers: gameplay?.activePlayers ?? [],
|
|
18863
|
-
simultaneousPhase: gameplay?.simultaneousPhase ?? null,
|
|
18864
|
-
availableInteractions: visibleInteractions,
|
|
18865
|
-
zones: visibleZones
|
|
18866
|
-
},
|
|
18867
|
-
lobby: {
|
|
18868
|
-
seats: seatsForPluginSnapshot(context?.seats ?? []),
|
|
18869
|
-
canStart: context?.canStart ?? false,
|
|
18870
|
-
hostUserId: context ? principalKey(context.hostActor) : ""
|
|
18871
|
-
},
|
|
18872
|
-
notifications: state.activity.notifications,
|
|
18873
|
-
session: {
|
|
18874
|
-
sessionId: context?.identity.sessionId ?? null,
|
|
18875
|
-
controllablePlayerIds,
|
|
18876
|
-
controllingPlayerId,
|
|
18877
|
-
userId: context?.userId ?? null
|
|
18878
|
-
},
|
|
18879
|
-
history: context?.history ?? null,
|
|
18880
|
-
syncId: state.activity.syncId
|
|
18881
|
-
};
|
|
18882
|
-
}
|
|
18883
|
-
|
|
18884
|
-
// ../../packages/ui-host-runtime/src/unified-session-store.ts
|
|
18885
|
-
var sseEventIdCounter = 0;
|
|
18886
|
-
var notificationIdCounter = 0;
|
|
18887
|
-
function generateNotificationId() {
|
|
18888
|
-
return `notif-${++notificationIdCounter}-${Date.now()}`;
|
|
18889
|
-
}
|
|
18890
|
-
function createUnifiedSessionStore(options) {
|
|
18891
|
-
const logger = options.logger ?? consoleLogger;
|
|
18892
|
-
const transport = options.transport ?? defaultHostSessionTransport;
|
|
18893
|
-
const fallbackToAllSeatsWhenUserIdMissing = options.fallbackToAllSeatsWhenUserIdMissing ?? false;
|
|
18894
|
-
return createStore()(
|
|
18895
|
-
subscribeWithSelector((_, get, store) => {
|
|
18896
|
-
const controller = createSessionIngressController({
|
|
18897
|
-
store,
|
|
18898
|
-
createSseManager: options.createSseManager,
|
|
18899
|
-
transport,
|
|
18900
|
-
logger,
|
|
18901
|
-
fallbackToAllSeatsWhenUserIdMissing,
|
|
18902
|
-
reducerEnvironment: {
|
|
18903
|
-
fallbackToAllSeatsWhenUserIdMissing,
|
|
18904
|
-
nextEventId: () => ++sseEventIdCounter,
|
|
18905
|
-
nextNotificationId: generateNotificationId,
|
|
18906
|
-
nowMs: () => Date.now(),
|
|
18907
|
-
nowIso: () => (/* @__PURE__ */ new Date()).toISOString()
|
|
18908
|
-
}
|
|
18909
|
-
});
|
|
18910
|
-
return {
|
|
18911
|
-
...createInitialUnifiedSessionState(),
|
|
18912
|
-
...controller,
|
|
18913
|
-
getPluginSnapshot: () => selectPluginSnapshot(get(), fallbackToAllSeatsWhenUserIdMissing),
|
|
18914
|
-
getRenderableGameplay: () => getGameplayViewport(get().session)
|
|
18915
|
-
};
|
|
18916
|
-
})
|
|
18917
|
-
);
|
|
18918
|
-
}
|
|
18919
|
-
|
|
18920
|
-
// ../../packages/ui-host-runtime/src/plugin-messages.ts
|
|
18921
|
-
var InitMessageSchema = external_exports.object({
|
|
18922
|
-
type: external_exports.literal("init"),
|
|
18923
|
-
sessionId: external_exports.string(),
|
|
18924
|
-
controllablePlayerIds: external_exports.array(external_exports.string()),
|
|
18925
|
-
controllingPlayerId: external_exports.string(),
|
|
18926
|
-
userId: external_exports.string().nullable()
|
|
18927
|
-
});
|
|
18928
|
-
var PingMessageSchema = external_exports.object({
|
|
18929
|
-
type: external_exports.literal("ping")
|
|
18930
|
-
});
|
|
18931
|
-
var StateSyncMessageSchema = external_exports.object({
|
|
18932
|
-
type: external_exports.literal("state-sync"),
|
|
18933
|
-
syncId: external_exports.number(),
|
|
18934
|
-
state: external_exports.custom((data) => {
|
|
18935
|
-
return typeof data === "object" && data !== null && "session" in data && "notifications" in data;
|
|
18936
|
-
})
|
|
17363
|
+
var zCreateSessionFromReducerSnapshotData = external_exports.object({
|
|
17364
|
+
body: zCreateSessionFromReducerSnapshotRequest,
|
|
17365
|
+
path: external_exports.object({
|
|
17366
|
+
gameId: external_exports.uuid()
|
|
17367
|
+
}),
|
|
17368
|
+
query: external_exports.optional(external_exports.never())
|
|
18937
17369
|
});
|
|
18938
|
-
var
|
|
18939
|
-
|
|
18940
|
-
|
|
18941
|
-
|
|
18942
|
-
|
|
18943
|
-
|
|
18944
|
-
|
|
18945
|
-
|
|
18946
|
-
InitMessageSchema,
|
|
18947
|
-
PingMessageSchema,
|
|
18948
|
-
StateSyncMessageSchema,
|
|
18949
|
-
SubmitResultMessageSchema
|
|
18950
|
-
]);
|
|
18951
|
-
var ReadyMessageSchema = external_exports.object({
|
|
18952
|
-
type: external_exports.literal("ready")
|
|
17370
|
+
var zGetSessionByShortCodeData = external_exports.object({
|
|
17371
|
+
body: external_exports.optional(external_exports.never()),
|
|
17372
|
+
path: external_exports.object({
|
|
17373
|
+
shortCode: external_exports.string()
|
|
17374
|
+
}),
|
|
17375
|
+
query: external_exports.optional(external_exports.object({
|
|
17376
|
+
playerId: external_exports.optional(external_exports.string())
|
|
17377
|
+
}))
|
|
18953
17378
|
});
|
|
18954
|
-
var
|
|
18955
|
-
|
|
18956
|
-
|
|
18957
|
-
|
|
18958
|
-
|
|
18959
|
-
|
|
18960
|
-
|
|
18961
|
-
|
|
18962
|
-
|
|
18963
|
-
|
|
18964
|
-
|
|
18965
|
-
|
|
18966
|
-
|
|
18967
|
-
|
|
18968
|
-
|
|
18969
|
-
|
|
18970
|
-
|
|
18971
|
-
|
|
18972
|
-
|
|
18973
|
-
type: external_exports.literal("validate-interaction"),
|
|
18974
|
-
playerId: external_exports.string(),
|
|
18975
|
-
interactionId: external_exports.string(),
|
|
18976
|
-
params: external_exports.unknown(),
|
|
18977
|
-
messageId: external_exports.string()
|
|
18978
|
-
});
|
|
18979
|
-
var ValidateInteractionResultMessageSchema = external_exports.object({
|
|
18980
|
-
type: external_exports.literal("validate-interaction-result"),
|
|
18981
|
-
messageId: external_exports.string(),
|
|
18982
|
-
result: external_exports.object({
|
|
18983
|
-
valid: external_exports.boolean(),
|
|
18984
|
-
errorCode: external_exports.string().optional(),
|
|
18985
|
-
message: external_exports.string().optional()
|
|
17379
|
+
var zGetSessionSnapshotData = external_exports.object({
|
|
17380
|
+
body: external_exports.optional(external_exports.never()),
|
|
17381
|
+
path: external_exports.object({
|
|
17382
|
+
sessionId: external_exports.uuid()
|
|
17383
|
+
}),
|
|
17384
|
+
query: external_exports.optional(external_exports.object({
|
|
17385
|
+
playerId: external_exports.optional(external_exports.string())
|
|
17386
|
+
}))
|
|
17387
|
+
});
|
|
17388
|
+
var zSubscribeToSessionEventsData = external_exports.object({
|
|
17389
|
+
body: external_exports.optional(external_exports.never()),
|
|
17390
|
+
path: external_exports.object({
|
|
17391
|
+
sessionId: external_exports.uuid()
|
|
17392
|
+
}),
|
|
17393
|
+
query: external_exports.object({
|
|
17394
|
+
clientId: external_exports.string(),
|
|
17395
|
+
connectionAttemptId: external_exports.string(),
|
|
17396
|
+
clientSource: external_exports.optional(external_exports.string()),
|
|
17397
|
+
playerId: external_exports.optional(external_exports.string())
|
|
18986
17398
|
})
|
|
18987
17399
|
});
|
|
18988
|
-
var
|
|
18989
|
-
|
|
18990
|
-
|
|
18991
|
-
|
|
18992
|
-
})
|
|
18993
|
-
|
|
18994
|
-
type: external_exports.literal("pong")
|
|
18995
|
-
});
|
|
18996
|
-
var SwitchPlayerMessageSchema = external_exports.object({
|
|
18997
|
-
type: external_exports.literal("switch-player"),
|
|
18998
|
-
playerId: external_exports.string()
|
|
18999
|
-
});
|
|
19000
|
-
var StateAckMessageSchema = external_exports.object({
|
|
19001
|
-
type: external_exports.literal("state-ack"),
|
|
19002
|
-
syncId: external_exports.number(),
|
|
19003
|
-
// Plugin-iframe `Date.now()` captured when the state-sync message
|
|
19004
|
-
// was received. Threaded so the host-side perf HUD can compute the
|
|
19005
|
-
// `t7_state_sync_received` mark without needing perf to be enabled
|
|
19006
|
-
// inside the plugin iframe itself.
|
|
19007
|
-
clientReceivedAtMs: external_exports.number().optional()
|
|
19008
|
-
});
|
|
19009
|
-
var StateRenderedMessageSchema = external_exports.object({
|
|
19010
|
-
type: external_exports.literal("state-rendered"),
|
|
19011
|
-
syncId: external_exports.number(),
|
|
19012
|
-
clientReceivedAtMs: external_exports.number(),
|
|
19013
|
-
clientRenderedAtMs: external_exports.number()
|
|
19014
|
-
});
|
|
19015
|
-
var MarkNotificationReadMessageSchema = external_exports.object({
|
|
19016
|
-
type: external_exports.literal("mark-notification-read"),
|
|
19017
|
-
notificationId: external_exports.string()
|
|
19018
|
-
});
|
|
19019
|
-
var RestoreHistoryMessageSchema = external_exports.object({
|
|
19020
|
-
type: external_exports.literal("restore-history"),
|
|
19021
|
-
entryId: external_exports.string()
|
|
17400
|
+
var zStartGameData = external_exports.object({
|
|
17401
|
+
body: external_exports.optional(external_exports.never()),
|
|
17402
|
+
path: external_exports.object({
|
|
17403
|
+
sessionId: external_exports.uuid()
|
|
17404
|
+
}),
|
|
17405
|
+
query: external_exports.optional(external_exports.never())
|
|
19022
17406
|
});
|
|
19023
|
-
var
|
|
19024
|
-
|
|
19025
|
-
|
|
19026
|
-
|
|
19027
|
-
|
|
19028
|
-
|
|
19029
|
-
|
|
19030
|
-
|
|
19031
|
-
|
|
19032
|
-
|
|
19033
|
-
|
|
19034
|
-
|
|
17407
|
+
var zListPlayerActionsData = external_exports.object({
|
|
17408
|
+
body: external_exports.optional(external_exports.never()),
|
|
17409
|
+
path: external_exports.object({
|
|
17410
|
+
sessionId: external_exports.uuid(),
|
|
17411
|
+
playerId: external_exports.string()
|
|
17412
|
+
}),
|
|
17413
|
+
query: external_exports.optional(external_exports.never())
|
|
17414
|
+
});
|
|
17415
|
+
var zDescribePlayerActionData = external_exports.object({
|
|
17416
|
+
body: external_exports.optional(external_exports.never()),
|
|
17417
|
+
path: external_exports.object({
|
|
17418
|
+
sessionId: external_exports.uuid(),
|
|
17419
|
+
playerId: external_exports.string(),
|
|
17420
|
+
interactionId: external_exports.string()
|
|
17421
|
+
}),
|
|
17422
|
+
query: external_exports.optional(external_exports.never())
|
|
17423
|
+
});
|
|
17424
|
+
var zGetPlayerActionTargetsData = external_exports.object({
|
|
17425
|
+
body: external_exports.optional(external_exports.never()),
|
|
17426
|
+
path: external_exports.object({
|
|
17427
|
+
sessionId: external_exports.uuid(),
|
|
17428
|
+
playerId: external_exports.string(),
|
|
17429
|
+
interactionId: external_exports.string(),
|
|
17430
|
+
inputKey: external_exports.string()
|
|
17431
|
+
}),
|
|
17432
|
+
query: external_exports.optional(external_exports.never())
|
|
17433
|
+
});
|
|
17434
|
+
var zSubmitPlayerActionData = external_exports.object({
|
|
17435
|
+
body: zPlayerActionRequest,
|
|
17436
|
+
path: external_exports.object({
|
|
17437
|
+
sessionId: external_exports.uuid(),
|
|
17438
|
+
playerId: external_exports.string(),
|
|
17439
|
+
interactionId: external_exports.string()
|
|
17440
|
+
}),
|
|
17441
|
+
query: external_exports.optional(external_exports.never())
|
|
17442
|
+
});
|
|
17443
|
+
|
|
17444
|
+
// ../../packages/api-client/src/generated/problem-types.gen.ts
|
|
17445
|
+
var SERVER_PROBLEM_TYPES = {
|
|
17446
|
+
ACTION_REJECTED: "urn:dreamboard:problem:action-rejected",
|
|
17447
|
+
ACTIVE_JOB_CONFLICT: "urn:dreamboard:problem:active-job-conflict",
|
|
17448
|
+
AUTHORING_STATE_BASE_MISSING: "urn:dreamboard:problem:authoring-state-base-missing",
|
|
17449
|
+
AUTHORING_STATE_DRIFT: "urn:dreamboard:problem:authoring-state-drift",
|
|
17450
|
+
FORBIDDEN: "urn:dreamboard:problem:forbidden",
|
|
17451
|
+
GAME_SLUG_CONFLICT: "urn:dreamboard:problem:game-slug-conflict",
|
|
17452
|
+
INTERNAL_ERROR: "urn:dreamboard:problem:internal-error",
|
|
17453
|
+
RESOURCE_NOT_FOUND: "urn:dreamboard:problem:resource-not-found",
|
|
17454
|
+
SOURCE_REVISION_BASE_MISSING: "urn:dreamboard:problem:source-revision-base-missing",
|
|
17455
|
+
SOURCE_REVISION_DRIFT: "urn:dreamboard:problem:source-revision-drift",
|
|
17456
|
+
SOURCE_REVISION_NOT_FOUND: "urn:dreamboard:problem:source-revision-not-found",
|
|
17457
|
+
STATE_CONFLICT: "urn:dreamboard:problem:state-conflict",
|
|
17458
|
+
TOO_MANY_REQUESTS: "urn:dreamboard:problem:too-many-requests",
|
|
17459
|
+
UNAUTHORIZED: "urn:dreamboard:problem:unauthorized",
|
|
17460
|
+
VALIDATION_FAILED: "urn:dreamboard:problem:validation-failed"
|
|
17461
|
+
};
|
|
17462
|
+
var CLIENT_PROBLEM_TYPES = {
|
|
17463
|
+
TRANSPORT_ERROR: "urn:dreamboard:problem:transport-error",
|
|
17464
|
+
UNKNOWN_API_ERROR: "urn:dreamboard:problem:unknown-api-error"
|
|
17465
|
+
};
|
|
19035
17466
|
|
|
19036
17467
|
export {
|
|
19037
17468
|
client,
|
|
@@ -19046,6 +17477,7 @@ export {
|
|
|
19046
17477
|
getManifest,
|
|
19047
17478
|
listCompiledResults,
|
|
19048
17479
|
queueCompiledResultJob,
|
|
17480
|
+
uploadInitialProjection,
|
|
19049
17481
|
ensureDevCompile,
|
|
19050
17482
|
getCompiledResult,
|
|
19051
17483
|
getGameSources,
|
|
@@ -19058,6 +17490,7 @@ export {
|
|
|
19058
17490
|
getLatestGameRule,
|
|
19059
17491
|
createSession,
|
|
19060
17492
|
createSessionFromReducerSnapshot,
|
|
17493
|
+
getSessionByShortCode,
|
|
19061
17494
|
getSessionSnapshot,
|
|
19062
17495
|
subscribeToSessionEvents,
|
|
19063
17496
|
disconnectSessionEvents,
|
|
@@ -19067,12 +17500,11 @@ export {
|
|
|
19067
17500
|
getPlayerActionTargets,
|
|
19068
17501
|
validatePlayerAction,
|
|
19069
17502
|
submitPlayerAction,
|
|
17503
|
+
restoreHistory,
|
|
19070
17504
|
external_exports,
|
|
19071
17505
|
zProblemDetails,
|
|
19072
17506
|
zGameTopologyManifest,
|
|
19073
17507
|
SERVER_PROBLEM_TYPES,
|
|
19074
|
-
CLIENT_PROBLEM_TYPES
|
|
19075
|
-
gameIdFromGameSource,
|
|
19076
|
-
createUnifiedSessionStore
|
|
17508
|
+
CLIENT_PROBLEM_TYPES
|
|
19077
17509
|
};
|
|
19078
|
-
//# sourceMappingURL=chunk-
|
|
17510
|
+
//# sourceMappingURL=chunk-2RCUHMGL.js.map
|