@air-jam/sdk 0.9.2 → 0.9.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +25 -45
- package/dist/{agent-tooling-BSMGBix9.d.cts → agent-contract-CD2QnbBJ.d.cts} +1 -1
- package/dist/{agent-tooling-BSMGBix9.d.ts → agent-contract-CD2QnbBJ.d.ts} +1 -1
- package/dist/agent-tooling.cjs +139 -0
- package/dist/agent-tooling.cjs.map +1 -1
- package/dist/agent-tooling.d.cts +25 -1
- package/dist/agent-tooling.d.ts +25 -1
- package/dist/agent-tooling.js +138 -0
- package/dist/agent-tooling.js.map +1 -1
- package/dist/air-jam-context-BlLPvCup.d.cts +175 -0
- package/dist/air-jam-context-DTsxF-tP.d.ts +175 -0
- package/dist/arcade/bridge/controller.cjs +214 -194
- package/dist/arcade/bridge/controller.cjs.map +1 -1
- package/dist/arcade/bridge/controller.d.cts +2 -2
- package/dist/arcade/bridge/controller.d.ts +2 -2
- package/dist/arcade/bridge/controller.js +6 -4
- package/dist/arcade/bridge/host.cjs +1 -1
- package/dist/arcade/bridge/host.cjs.map +1 -1
- package/dist/arcade/bridge/host.d.cts +3 -3
- package/dist/arcade/bridge/host.d.ts +3 -3
- package/dist/arcade/bridge/host.js +4 -3
- package/dist/arcade/bridge/iframe.cjs +1 -1
- package/dist/arcade/bridge/iframe.cjs.map +1 -1
- package/dist/arcade/bridge/iframe.d.cts +2 -2
- package/dist/arcade/bridge/iframe.d.ts +2 -2
- package/dist/arcade/bridge/iframe.js +4 -4
- package/dist/arcade/bridge.cjs +251 -231
- package/dist/arcade/bridge.cjs.map +1 -1
- package/dist/arcade/bridge.d.cts +4 -4
- package/dist/arcade/bridge.d.ts +4 -4
- package/dist/arcade/bridge.js +9 -7
- package/dist/arcade/host.cjs +145 -122
- package/dist/arcade/host.cjs.map +1 -1
- package/dist/arcade/host.d.cts +5 -4
- package/dist/arcade/host.d.ts +5 -4
- package/dist/arcade/host.js +6 -5
- package/dist/arcade/runtime.cjs +6499 -0
- package/dist/arcade/runtime.cjs.map +1 -0
- package/dist/arcade/runtime.d.cts +22 -0
- package/dist/arcade/runtime.d.ts +22 -0
- package/dist/arcade/runtime.js +32 -0
- package/dist/arcade/runtime.js.map +1 -0
- package/dist/arcade/surface.cjs +9 -0
- package/dist/arcade/surface.cjs.map +1 -1
- package/dist/arcade/surface.d.cts +6 -1
- package/dist/arcade/surface.d.ts +6 -1
- package/dist/arcade/surface.js +6 -2
- package/dist/arcade/url.d.cts +4 -4
- package/dist/arcade/url.d.ts +4 -4
- package/dist/arcade/url.js +5 -5
- package/dist/arcade.cjs +322 -292
- package/dist/arcade.cjs.map +1 -1
- package/dist/arcade.d.cts +6 -6
- package/dist/arcade.d.ts +6 -6
- package/dist/arcade.js +35 -29
- package/dist/{chunk-Q4UALQO4.js → chunk-2SZ2YYGJ.js} +8 -16
- package/dist/chunk-2SZ2YYGJ.js.map +1 -0
- package/dist/{chunk-KOB73SPD.js → chunk-32RSSFSF.js} +10 -12
- package/dist/chunk-32RSSFSF.js.map +1 -0
- package/dist/chunk-3YMUAKPU.js +10 -0
- package/dist/chunk-3YMUAKPU.js.map +1 -0
- package/dist/chunk-56DM2KEW.js +14 -0
- package/dist/chunk-56DM2KEW.js.map +1 -0
- package/dist/chunk-CM53YLT5.js +59 -0
- package/dist/chunk-CM53YLT5.js.map +1 -0
- package/dist/{chunk-DY67S3LR.js → chunk-CV3PBXPT.js} +3 -3
- package/dist/chunk-D4VDEVTZ.js +80 -0
- package/dist/chunk-D4VDEVTZ.js.map +1 -0
- package/dist/{chunk-E5PVHEAX.js → chunk-FUA6EMSJ.js} +24 -60
- package/dist/chunk-FUA6EMSJ.js.map +1 -0
- package/dist/chunk-GMLU7RI5.js +70 -0
- package/dist/chunk-GMLU7RI5.js.map +1 -0
- package/dist/{chunk-NCL6WJCL.js → chunk-IG6GZZSS.js} +32 -1
- package/dist/chunk-IG6GZZSS.js.map +1 -0
- package/dist/{chunk-EDRQIOCV.js → chunk-ITMQSBTH.js} +3 -2
- package/dist/chunk-ITMQSBTH.js.map +1 -0
- package/dist/{chunk-32NYL7XI.js → chunk-J5MCII33.js} +189 -108
- package/dist/chunk-J5MCII33.js.map +1 -0
- package/dist/{chunk-ZLPL2R3R.js → chunk-K4OZ54UD.js} +7 -34
- package/dist/chunk-K4OZ54UD.js.map +1 -0
- package/dist/{chunk-6CMB356F.js → chunk-LIHEEAVE.js} +9 -11
- package/dist/chunk-LIHEEAVE.js.map +1 -0
- package/dist/{chunk-7OTQTT6H.js → chunk-MIMPMB7O.js} +2 -2
- package/dist/{chunk-NUJBMV3O.js → chunk-O6X7FJ6N.js} +29 -32
- package/dist/chunk-O6X7FJ6N.js.map +1 -0
- package/dist/chunk-PSUYTD2L.js +16 -0
- package/dist/chunk-PSUYTD2L.js.map +1 -0
- package/dist/{chunk-M4DKOI42.js → chunk-QO4KFUEI.js} +2 -2
- package/dist/chunk-QTLYZADF.js +125 -0
- package/dist/chunk-QTLYZADF.js.map +1 -0
- package/dist/chunk-TTQDHKXL.js +3017 -0
- package/dist/chunk-TTQDHKXL.js.map +1 -0
- package/dist/chunk-UCPY7UJC.js +8 -0
- package/dist/chunk-UCPY7UJC.js.map +1 -0
- package/dist/{chunk-JO2HR5PV.js → chunk-UPV6YWT5.js} +4 -4
- package/dist/chunk-X35LLCWV.js +65 -0
- package/dist/chunk-X35LLCWV.js.map +1 -0
- package/dist/{controller-DxVchfiA.d.ts → controller-PZEM_1cH.d.ts} +6 -2
- package/dist/{controller-Bod8YYr1.d.cts → controller-vj82tKm4.d.cts} +6 -2
- package/dist/{dev-log-events-CVAM29hx.d.cts → dev-log-events-BCJKmygo.d.cts} +0 -3
- package/dist/{dev-log-events-CVAM29hx.d.ts → dev-log-events-BCJKmygo.d.ts} +0 -3
- package/dist/{host-8hmq_Sgc.d.cts → host-B9pRy0Aa.d.cts} +20 -7
- package/dist/{host-Cw-N6e-5.d.ts → host-DylGsX7p.d.ts} +20 -7
- package/dist/index.cjs +4260 -3870
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -649
- package/dist/index.d.ts +40 -649
- package/dist/index.js +1030 -3727
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs.map +1 -1
- package/dist/metadata.d.cts +2 -3
- package/dist/metadata.d.ts +2 -3
- package/dist/metadata.js.map +1 -1
- package/dist/{notices-CnGaaS8B.d.ts → notices-C4bao3oi.d.ts} +1 -1
- package/dist/{notices-NyDM5Mtz.d.cts → notices-DNdOjwtj.d.cts} +1 -1
- package/dist/platform-machine.cjs +115 -15
- package/dist/platform-machine.cjs.map +1 -1
- package/dist/platform-machine.d.cts +1338 -65
- package/dist/platform-machine.d.ts +1338 -65
- package/dist/platform-machine.js +88 -15
- package/dist/platform-machine.js.map +1 -1
- package/dist/{platform-settings-cuor3i11.d.cts → platform-settings-DUWs4JTy.d.cts} +1 -1
- package/dist/{platform-settings-cuor3i11.d.ts → platform-settings-DUWs4JTy.d.ts} +1 -1
- package/dist/preview.cjs +301 -253
- package/dist/preview.cjs.map +1 -1
- package/dist/preview.d.cts +6 -4
- package/dist/preview.d.ts +6 -4
- package/dist/preview.js +31 -21
- package/dist/preview.js.map +1 -1
- package/dist/protocol.cjs +282 -167
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +74 -21
- package/dist/protocol.d.ts +74 -21
- package/dist/protocol.js +28 -10
- package/dist/release.cjs +37 -0
- package/dist/release.cjs.map +1 -1
- package/dist/release.d.cts +27 -1
- package/dist/release.d.ts +27 -1
- package/dist/release.js +13 -1
- package/dist/runtime-control.cjs +46 -0
- package/dist/runtime-control.cjs.map +1 -0
- package/dist/runtime-control.d.cts +17 -0
- package/dist/runtime-control.d.ts +17 -0
- package/dist/runtime-control.js +8 -0
- package/dist/runtime-control.js.map +1 -0
- package/dist/runtime-inspection.cjs +655 -0
- package/dist/runtime-inspection.cjs.map +1 -0
- package/dist/runtime-inspection.d.cts +47 -0
- package/dist/runtime-inspection.d.ts +47 -0
- package/dist/runtime-inspection.js +30 -0
- package/dist/runtime-inspection.js.map +1 -0
- package/dist/runtime-reporting-pe-eryVz.d.cts +27 -0
- package/dist/runtime-reporting-pe-eryVz.d.ts +27 -0
- package/dist/signals-ZHftIKuc.d.cts +33 -0
- package/dist/signals-ZHftIKuc.d.ts +33 -0
- package/dist/{standard-match-phase-BucA5dYo.d.ts → standard-match-phase-BzSgBYFg.d.ts} +2 -2
- package/dist/{standard-match-phase-U2ra8J-0.d.cts → standard-match-phase-CvJUW8Oe.d.cts} +2 -2
- package/dist/{sync-B6QsNrXz.d.cts → sync-xtPfWhif.d.cts} +1 -45
- package/dist/{sync-B6QsNrXz.d.ts → sync-xtPfWhif.d.ts} +1 -45
- package/dist/ui.cjs +593 -610
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +3 -3
- package/dist/ui.d.ts +3 -3
- package/dist/ui.js +16 -11
- package/dist/ui.js.map +1 -1
- package/dist/use-air-jam-host-COLy8t4s.d.ts +403 -0
- package/dist/use-air-jam-host-DM-ybB3C.d.cts +403 -0
- package/package.json +55 -21
- package/src/agent/agent-contract-conformance.ts +201 -0
- package/src/agent-tooling.ts +5 -0
- package/src/arcade/runtime.ts +6 -0
- package/src/arcade/surface.ts +1 -0
- package/src/context/air-jam-context.tsx +8 -8
- package/src/context/socket-manager.ts +0 -7
- package/src/dev/browser-log-sink.ts +12 -15
- package/src/events.ts +0 -5
- package/src/hooks/internal/use-controller-runtime-api.ts +110 -21
- package/src/hooks/internal/use-host-runtime-api.ts +306 -49
- package/src/hooks/use-air-jam-controller.ts +9 -9
- package/src/hooks/use-air-jam-host.ts +7 -7
- package/src/hooks/use-get-input.ts +1 -1
- package/src/hooks/use-host-arcade-restore.ts +6 -1
- package/src/index.ts +6 -25
- package/src/metadata/manifest.ts +2 -3
- package/src/platform-machine.ts +109 -12
- package/src/preview/workspace.tsx +48 -29
- package/src/protocol/arcade-platform-actions.ts +19 -1
- package/src/protocol/controller.ts +8 -2
- package/src/protocol/dev-log-events.ts +0 -3
- package/src/protocol/host-grant.ts +58 -140
- package/src/protocol/host.ts +21 -9
- package/src/protocol/runtime-reporting.ts +32 -0
- package/src/protocol/signed-envelope.ts +176 -0
- package/src/protocol/socket-events.ts +8 -10
- package/src/protocol/sync.ts +0 -16
- package/src/protocol.ts +2 -0
- package/src/release.ts +32 -0
- package/src/runtime/admission-retry.ts +62 -0
- package/src/runtime/air-jam-config.ts +6 -16
- package/src/runtime/air-jam-error-boundary.tsx +46 -2
- package/src/runtime/bridge-envelope-args.ts +21 -0
- package/src/runtime/connected-runtime-error-boundary.tsx +31 -0
- package/src/runtime/contracts/control.ts +107 -59
- package/src/runtime/controller-bridge.ts +12 -24
- package/src/runtime/controller-identity.ts +55 -27
- package/src/runtime/controller-realtime-client.ts +8 -47
- package/src/runtime/create-air-jam-app.tsx +21 -13
- package/src/runtime/host-bridge.ts +16 -24
- package/src/runtime/local-reference-game-identity.ts +13 -0
- package/src/runtime/runtime-session-params.ts +4 -64
- package/src/runtime-control.ts +3 -8
- package/src/settings/platform-settings-runtime.tsx +1 -6
- package/src/settings/platform-settings.ts +7 -38
- package/src/state/connection-store.ts +13 -6
- package/src/store/create-air-jam-store.ts +59 -7
- package/src/utils/ids.ts +32 -5
- package/dist/capabilities.cjs +0 -39
- package/dist/capabilities.cjs.map +0 -1
- package/dist/capabilities.d.cts +0 -31
- package/dist/capabilities.d.ts +0 -31
- package/dist/capabilities.js +0 -12
- package/dist/capabilities.js.map +0 -1
- package/dist/chunk-32NYL7XI.js.map +0 -1
- package/dist/chunk-6CMB356F.js.map +0 -1
- package/dist/chunk-CVYR5RJT.js +0 -184
- package/dist/chunk-CVYR5RJT.js.map +0 -1
- package/dist/chunk-E5PVHEAX.js.map +0 -1
- package/dist/chunk-EDRQIOCV.js.map +0 -1
- package/dist/chunk-KOB73SPD.js.map +0 -1
- package/dist/chunk-NCL6WJCL.js.map +0 -1
- package/dist/chunk-NUJBMV3O.js.map +0 -1
- package/dist/chunk-Q4UALQO4.js.map +0 -1
- package/dist/chunk-ZLPL2R3R.js.map +0 -1
- package/dist/chunk-ZTQ5SP4H.js +0 -9
- package/dist/chunk-ZTQ5SP4H.js.map +0 -1
- package/src/capabilities/manifest.ts +0 -71
- package/src/capabilities.ts +0 -12
- package/src/hooks/internal/use-runtime-control-contract.ts +0 -15
- package/src/hooks/internal/use-runtime-observability-contract.ts +0 -24
- package/src/runtime/contracts/observability.ts +0 -94
- package/src/runtime-observability.ts +0 -9
- /package/dist/{chunk-DY67S3LR.js.map → chunk-CV3PBXPT.js.map} +0 -0
- /package/dist/{chunk-7OTQTT6H.js.map → chunk-MIMPMB7O.js.map} +0 -0
- /package/dist/{chunk-M4DKOI42.js.map → chunk-QO4KFUEI.js.map} +0 -0
- /package/dist/{chunk-JO2HR5PV.js.map → chunk-UPV6YWT5.js.map} +0 -0
|
@@ -2,11 +2,15 @@ import { useStore } from "zustand";
|
|
|
2
2
|
import { useShallow } from "zustand/react/shallow";
|
|
3
3
|
import { useAirJamContext } from "../context/air-jam-context";
|
|
4
4
|
import { useAssertSessionScope } from "../context/session-scope";
|
|
5
|
-
import type {
|
|
5
|
+
import type {
|
|
6
|
+
HostArcadeSessionSnapshot,
|
|
7
|
+
HostArcadeSurfaceCheckpoint,
|
|
8
|
+
} from "../protocol";
|
|
6
9
|
|
|
7
10
|
export interface HostArcadeRestoreStateView {
|
|
8
11
|
phase: "idle" | "awaiting_ack" | "pending_restore";
|
|
9
12
|
session: HostArcadeSessionSnapshot | null;
|
|
13
|
+
surfaceCheckpoint: HostArcadeSurfaceCheckpoint | null;
|
|
10
14
|
clear: () => void;
|
|
11
15
|
}
|
|
12
16
|
|
|
@@ -24,6 +28,7 @@ export const useHostArcadeRestore = (): HostArcadeRestoreStateView => {
|
|
|
24
28
|
useShallow((s) => ({
|
|
25
29
|
phase: s.hostArcadeRestore.phase,
|
|
26
30
|
session: s.hostArcadeRestore.session,
|
|
31
|
+
surfaceCheckpoint: s.hostArcadeRestore.surfaceCheckpoint,
|
|
27
32
|
clear: s.clearHostArcadeRestore,
|
|
28
33
|
})),
|
|
29
34
|
);
|
package/src/index.ts
CHANGED
|
@@ -22,18 +22,18 @@ export {
|
|
|
22
22
|
type MusicPlaylistProps,
|
|
23
23
|
} from "./audio/music";
|
|
24
24
|
export {
|
|
25
|
-
DEFAULT_ROOM_PLATFORM_SETTINGS,
|
|
26
25
|
DEFAULT_PLATFORM_SETTINGS,
|
|
26
|
+
DEFAULT_ROOM_PLATFORM_SETTINGS,
|
|
27
27
|
getEffectiveAudioVolume,
|
|
28
28
|
mergeRoomPlatformSettingsSnapshot,
|
|
29
29
|
toRoomPlatformSettingsSnapshot,
|
|
30
30
|
} from "./settings/platform-settings";
|
|
31
31
|
export type {
|
|
32
|
+
PartialRoomPlatformSettingsPatch,
|
|
32
33
|
PlatformAccessibilitySettings,
|
|
33
34
|
PlatformAudioSettings,
|
|
34
35
|
PlatformFeedbackSettings,
|
|
35
36
|
PlatformPreviewControllerSettings,
|
|
36
|
-
PartialRoomPlatformSettingsPatch,
|
|
37
37
|
PlatformSettings,
|
|
38
38
|
PlatformSettingsPersistence,
|
|
39
39
|
PlatformSettingsSnapshot,
|
|
@@ -84,39 +84,20 @@ export {
|
|
|
84
84
|
type UseControllerToastsOptions,
|
|
85
85
|
} from "./hooks/use-controller-toasts";
|
|
86
86
|
export { useGetInput } from "./hooks/use-get-input";
|
|
87
|
+
export {
|
|
88
|
+
useHostAudioMutePreference,
|
|
89
|
+
type HostAudioMutePreference,
|
|
90
|
+
} from "./hooks/use-host-audio-mute-preference";
|
|
87
91
|
export {
|
|
88
92
|
useHostTick,
|
|
89
93
|
type HostFrameInfo,
|
|
90
94
|
type HostTickInfo,
|
|
91
95
|
type HostTickOptions,
|
|
92
96
|
} from "./hooks/use-host-tick";
|
|
93
|
-
export {
|
|
94
|
-
useHostAudioMutePreference,
|
|
95
|
-
type HostAudioMutePreference,
|
|
96
|
-
} from "./hooks/use-host-audio-mute-preference";
|
|
97
97
|
export { useInputWriter } from "./hooks/use-input-writer";
|
|
98
98
|
export { usePlayers } from "./hooks/use-players";
|
|
99
99
|
export { useRoom, type RoomState } from "./hooks/use-room";
|
|
100
100
|
export { useSendSignal, type SendSignalFn } from "./hooks/use-send-signal";
|
|
101
|
-
export {
|
|
102
|
-
AIR_JAM_RUNTIME_INSPECTION_KEY,
|
|
103
|
-
createControllerRuntimeInspectionContract,
|
|
104
|
-
createHostRuntimeInspectionContract,
|
|
105
|
-
publishRuntimeInspectionContract,
|
|
106
|
-
readRuntimeInspectionContract,
|
|
107
|
-
useControllerRuntimeInspectionContract,
|
|
108
|
-
useHostRuntimeInspectionContract,
|
|
109
|
-
type ControllerRuntimeInspectionContract,
|
|
110
|
-
type HostRuntimeInspectionContract,
|
|
111
|
-
type RuntimeInspectionContract,
|
|
112
|
-
} from "./runtime-inspection";
|
|
113
|
-
export {
|
|
114
|
-
AirJamControllerRuntime,
|
|
115
|
-
AirJamHostRuntime,
|
|
116
|
-
type AirJamControllerRuntimeProps,
|
|
117
|
-
type AirJamHostRuntimeProps,
|
|
118
|
-
} from "./runtime/session-runtimes";
|
|
119
|
-
|
|
120
101
|
export {
|
|
121
102
|
isActiveMatchPhase,
|
|
122
103
|
isEndedMatchPhase,
|
package/src/metadata/manifest.ts
CHANGED
|
@@ -11,9 +11,8 @@ import { z } from "zod";
|
|
|
11
11
|
* consumers can keep assuming the shape is stable. External creators should be
|
|
12
12
|
* able to target this contract before the first third-party catalog submission.
|
|
13
13
|
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
* metadata describes what the catalog needs to present the game.
|
|
14
|
+
* Runtime behavior belongs to the semantic agent contract; metadata describes
|
|
15
|
+
* only what the catalog needs to present the game.
|
|
17
16
|
*/
|
|
18
17
|
|
|
19
18
|
/** Broad taxonomy for catalog filtering and landing-page grouping. */
|
package/src/platform-machine.ts
CHANGED
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
gameReleaseStatusSchema,
|
|
5
5
|
releaseCheckKindSchema,
|
|
6
6
|
releaseCheckStatusSchema,
|
|
7
|
+
releaseGenerationStatusSchema,
|
|
8
|
+
releaseJobKindSchema,
|
|
9
|
+
releaseJobStatusSchema,
|
|
7
10
|
releaseReportSourceSchema,
|
|
8
11
|
releaseReportStatusSchema,
|
|
9
12
|
} from "./release";
|
|
@@ -33,6 +36,8 @@ export type PlatformMachineErrorCode = z.infer<
|
|
|
33
36
|
export const platformMachineApiErrorSchema = z.object({
|
|
34
37
|
error: platformMachineErrorCodeSchema,
|
|
35
38
|
message: z.string().min(1),
|
|
39
|
+
retryAfterSeconds: z.number().int().positive().nullable().optional(),
|
|
40
|
+
details: z.record(z.string(), z.unknown()).optional(),
|
|
36
41
|
});
|
|
37
42
|
|
|
38
43
|
export type PlatformMachineApiError = z.infer<
|
|
@@ -225,30 +230,65 @@ export type PlatformMachineRequestOwnedGameMediaUploadTargetInput = z.infer<
|
|
|
225
230
|
typeof platformMachineRequestOwnedGameMediaUploadTargetInputSchema
|
|
226
231
|
>;
|
|
227
232
|
|
|
228
|
-
export const
|
|
233
|
+
export const platformMachineReleaseStorageRetentionStateValues = [
|
|
234
|
+
"active",
|
|
235
|
+
"warned",
|
|
236
|
+
"reclaimable",
|
|
237
|
+
"deleting",
|
|
238
|
+
"tombstoned",
|
|
239
|
+
] as const;
|
|
240
|
+
|
|
241
|
+
export const platformMachineReleaseStorageRetentionStateSchema = z.enum(
|
|
242
|
+
platformMachineReleaseStorageRetentionStateValues,
|
|
243
|
+
);
|
|
244
|
+
|
|
245
|
+
export type PlatformMachineReleaseStorageRetentionState = z.infer<
|
|
246
|
+
typeof platformMachineReleaseStorageRetentionStateSchema
|
|
247
|
+
>;
|
|
248
|
+
|
|
249
|
+
export const platformMachineReleaseGenerationSchema = z.object({
|
|
229
250
|
id: z.string().min(1),
|
|
230
251
|
releaseId: z.string().min(1),
|
|
252
|
+
sequence: z.number().int().positive(),
|
|
253
|
+
status: releaseGenerationStatusSchema,
|
|
231
254
|
originalFilename: z.string().min(1),
|
|
232
255
|
contentType: z.string().min(1),
|
|
233
|
-
|
|
256
|
+
declaredSizeBytes: z.number().int().positive(),
|
|
257
|
+
observedSizeBytes: z.number().int().positive().nullable(),
|
|
258
|
+
observedContentType: z.string().min(1).nullable(),
|
|
259
|
+
observedEtag: z.string().min(1).nullable(),
|
|
260
|
+
observedLastModifiedAt: z.string().min(1).nullable(),
|
|
234
261
|
extractedSizeBytes: z.number().int().nonnegative().nullable(),
|
|
235
|
-
fileCount: z.number().int().
|
|
236
|
-
entryPath: z.string().min(1),
|
|
262
|
+
fileCount: z.number().int().positive().nullable(),
|
|
263
|
+
entryPath: z.string().min(1).nullable(),
|
|
237
264
|
contentHash: z.string().min(1).nullable(),
|
|
238
265
|
createdAt: z.string().min(1),
|
|
266
|
+
uploadObservedAt: z.string().min(1).nullable(),
|
|
267
|
+
processingStartedAt: z.string().min(1).nullable(),
|
|
268
|
+
readyAt: z.string().min(1).nullable(),
|
|
269
|
+
failedAt: z.string().min(1).nullable(),
|
|
270
|
+
abandonedAt: z.string().min(1).nullable(),
|
|
271
|
+
storageRetention: z.object({
|
|
272
|
+
state: platformMachineReleaseStorageRetentionStateSchema,
|
|
273
|
+
inactiveAt: z.string().min(1).nullable(),
|
|
274
|
+
warnedAt: z.string().min(1).nullable(),
|
|
275
|
+
eligibleAt: z.string().min(1).nullable(),
|
|
276
|
+
cleanupStartedAt: z.string().min(1).nullable(),
|
|
277
|
+
deletedAt: z.string().min(1).nullable(),
|
|
278
|
+
}),
|
|
239
279
|
});
|
|
240
280
|
|
|
241
|
-
export type
|
|
242
|
-
typeof
|
|
281
|
+
export type PlatformMachineReleaseGeneration = z.infer<
|
|
282
|
+
typeof platformMachineReleaseGenerationSchema
|
|
243
283
|
>;
|
|
244
284
|
|
|
245
285
|
export const platformMachineReleaseCheckSchema = z.object({
|
|
246
286
|
id: z.string().min(1),
|
|
247
287
|
releaseId: z.string().min(1),
|
|
288
|
+
generationId: z.string().min(1),
|
|
248
289
|
kind: releaseCheckKindSchema,
|
|
249
290
|
status: releaseCheckStatusSchema,
|
|
250
291
|
summary: z.string().nullable(),
|
|
251
|
-
payload: z.record(z.string(), z.unknown()),
|
|
252
292
|
createdAt: z.string().min(1),
|
|
253
293
|
});
|
|
254
294
|
|
|
@@ -256,14 +296,37 @@ export type PlatformMachineReleaseCheck = z.infer<
|
|
|
256
296
|
typeof platformMachineReleaseCheckSchema
|
|
257
297
|
>;
|
|
258
298
|
|
|
299
|
+
export const platformMachineReleaseJobSchema = z.object({
|
|
300
|
+
id: z.string().min(1),
|
|
301
|
+
kind: releaseJobKindSchema,
|
|
302
|
+
status: releaseJobStatusSchema,
|
|
303
|
+
releaseId: z.string().min(1),
|
|
304
|
+
generationId: z.string().min(1),
|
|
305
|
+
correlationId: z.string().min(1),
|
|
306
|
+
attemptCount: z.number().int().nonnegative(),
|
|
307
|
+
maxAttempts: z.number().int().positive(),
|
|
308
|
+
progressStage: z.string().min(1).nullable(),
|
|
309
|
+
progressMessage: z.string().min(1).nullable(),
|
|
310
|
+
lastErrorCode: z.string().min(1).nullable(),
|
|
311
|
+
lastErrorRetryable: z.boolean().nullable(),
|
|
312
|
+
availableAt: z.string().min(1),
|
|
313
|
+
deadlineAt: z.string().min(1),
|
|
314
|
+
createdAt: z.string().min(1),
|
|
315
|
+
startedAt: z.string().min(1).nullable(),
|
|
316
|
+
finishedAt: z.string().min(1).nullable(),
|
|
317
|
+
updatedAt: z.string().min(1),
|
|
318
|
+
});
|
|
319
|
+
|
|
320
|
+
export type PlatformMachineReleaseJob = z.infer<
|
|
321
|
+
typeof platformMachineReleaseJobSchema
|
|
322
|
+
>;
|
|
323
|
+
|
|
324
|
+
// Creator-visible status only. Report text and contact stay ops-confidential.
|
|
259
325
|
export const platformMachineReleaseReportSchema = z.object({
|
|
260
326
|
id: z.string().min(1),
|
|
261
327
|
releaseId: z.string().min(1),
|
|
262
328
|
status: releaseReportStatusSchema,
|
|
263
329
|
source: releaseReportSourceSchema,
|
|
264
|
-
reason: z.string().min(1),
|
|
265
|
-
details: z.string().nullable(),
|
|
266
|
-
reporterEmail: z.string().nullable(),
|
|
267
330
|
createdAt: z.string().min(1),
|
|
268
331
|
reviewedAt: z.string().nullable(),
|
|
269
332
|
});
|
|
@@ -277,6 +340,8 @@ export const platformMachineReleaseSummarySchema = z.object({
|
|
|
277
340
|
gameId: z.string().min(1),
|
|
278
341
|
sourceKind: gameReleaseSourceKindSchema,
|
|
279
342
|
status: gameReleaseStatusSchema,
|
|
343
|
+
candidateGenerationId: z.string().min(1).nullable(),
|
|
344
|
+
promotedGenerationId: z.string().min(1).nullable(),
|
|
280
345
|
versionLabel: z.string().nullable(),
|
|
281
346
|
createdAt: z.string().min(1),
|
|
282
347
|
uploadedAt: z.string().nullable(),
|
|
@@ -285,8 +350,11 @@ export const platformMachineReleaseSummarySchema = z.object({
|
|
|
285
350
|
quarantinedAt: z.string().nullable(),
|
|
286
351
|
archivedAt: z.string().nullable(),
|
|
287
352
|
game: platformMachineOwnedGameSummarySchema,
|
|
288
|
-
|
|
353
|
+
candidateGeneration: platformMachineReleaseGenerationSchema.nullable(),
|
|
354
|
+
promotedGeneration: platformMachineReleaseGenerationSchema.nullable(),
|
|
355
|
+
generations: z.array(platformMachineReleaseGenerationSchema),
|
|
289
356
|
checks: z.array(platformMachineReleaseCheckSchema),
|
|
357
|
+
jobs: z.array(platformMachineReleaseJobSchema),
|
|
290
358
|
reports: z.array(platformMachineReleaseReportSchema),
|
|
291
359
|
hostUrl: z.string().url().nullable(),
|
|
292
360
|
controllerUrl: z.string().url().nullable(),
|
|
@@ -417,7 +485,6 @@ export type PlatformMachineRequestReleaseUploadTargetInput = z.infer<
|
|
|
417
485
|
>;
|
|
418
486
|
|
|
419
487
|
export const platformMachineReleaseUploadTargetSchema = z.object({
|
|
420
|
-
key: z.string().min(1),
|
|
421
488
|
method: z.literal("PUT"),
|
|
422
489
|
url: z.string().url(),
|
|
423
490
|
headers: z.record(z.string(), z.string()),
|
|
@@ -428,8 +495,36 @@ export type PlatformMachineReleaseUploadTarget = z.infer<
|
|
|
428
495
|
typeof platformMachineReleaseUploadTargetSchema
|
|
429
496
|
>;
|
|
430
497
|
|
|
498
|
+
export const platformMachineReleaseDownloadTargetSchema = z.object({
|
|
499
|
+
method: z.literal("GET"),
|
|
500
|
+
url: z.string().url(),
|
|
501
|
+
filename: z
|
|
502
|
+
.string()
|
|
503
|
+
.trim()
|
|
504
|
+
.min(1)
|
|
505
|
+
.max(255)
|
|
506
|
+
.regex(/^[^/\\\r\n]+$/u)
|
|
507
|
+
.refine((value) => value !== "." && value !== ".."),
|
|
508
|
+
expiresAt: z.string().min(1),
|
|
509
|
+
});
|
|
510
|
+
|
|
511
|
+
export type PlatformMachineReleaseDownloadTarget = z.infer<
|
|
512
|
+
typeof platformMachineReleaseDownloadTargetSchema
|
|
513
|
+
>;
|
|
514
|
+
|
|
515
|
+
export const platformMachineRequestReleaseGenerationExportResultSchema =
|
|
516
|
+
z.object({
|
|
517
|
+
generation: platformMachineReleaseGenerationSchema,
|
|
518
|
+
download: platformMachineReleaseDownloadTargetSchema,
|
|
519
|
+
});
|
|
520
|
+
|
|
521
|
+
export type PlatformMachineRequestReleaseGenerationExportResult = z.infer<
|
|
522
|
+
typeof platformMachineRequestReleaseGenerationExportResultSchema
|
|
523
|
+
>;
|
|
524
|
+
|
|
431
525
|
export const platformMachineRequestReleaseUploadTargetResultSchema = z.object({
|
|
432
526
|
release: platformMachineReleaseSummarySchema,
|
|
527
|
+
generation: platformMachineReleaseGenerationSchema,
|
|
433
528
|
upload: platformMachineReleaseUploadTargetSchema,
|
|
434
529
|
});
|
|
435
530
|
|
|
@@ -460,6 +555,8 @@ export type PlatformMachineMutateOwnedGameMediaAssetResult = z.infer<
|
|
|
460
555
|
|
|
461
556
|
export const platformMachineFinalizeReleaseUploadResultSchema = z.object({
|
|
462
557
|
release: platformMachineReleaseSummarySchema,
|
|
558
|
+
generation: platformMachineReleaseGenerationSchema,
|
|
559
|
+
job: platformMachineReleaseJobSchema,
|
|
463
560
|
});
|
|
464
561
|
|
|
465
562
|
export type PlatformMachineFinalizeReleaseUploadResult = z.infer<
|
|
@@ -46,6 +46,8 @@ export interface PreviewControllerWorkspaceProps {
|
|
|
46
46
|
dockAccessory?: ReactNode;
|
|
47
47
|
maxControllers?: number;
|
|
48
48
|
launcherLabel?: string;
|
|
49
|
+
launcherVariant?: "full" | "compact";
|
|
50
|
+
showLauncherWhenIdle?: boolean;
|
|
49
51
|
waitingLabel?: string;
|
|
50
52
|
}
|
|
51
53
|
|
|
@@ -110,6 +112,8 @@ export const PreviewControllerWorkspace = ({
|
|
|
110
112
|
dockAccessory,
|
|
111
113
|
maxControllers = 2,
|
|
112
114
|
launcherLabel = "Controllers",
|
|
115
|
+
launcherVariant = "full",
|
|
116
|
+
showLauncherWhenIdle = true,
|
|
113
117
|
waitingLabel = "Waiting for room",
|
|
114
118
|
}: PreviewControllerWorkspaceProps) => {
|
|
115
119
|
const [mounted, setMounted] = useState(false);
|
|
@@ -199,6 +203,8 @@ export const PreviewControllerWorkspace = ({
|
|
|
199
203
|
() => sessions.filter((session) => !session.minimized),
|
|
200
204
|
[sessions],
|
|
201
205
|
);
|
|
206
|
+
const launcherVisible =
|
|
207
|
+
showLauncherWhenIdle || launcherOpen || sessions.length > 0;
|
|
202
208
|
const sortedControllers = useMemo(
|
|
203
209
|
() =>
|
|
204
210
|
[...controllers].sort((left, right) =>
|
|
@@ -417,35 +423,48 @@ export const PreviewControllerWorkspace = ({
|
|
|
417
423
|
style={{ pointerEvents: "auto" }}
|
|
418
424
|
>
|
|
419
425
|
{dockAccessory}
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
launcherOpen
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
426
|
+
{launcherVisible ? (
|
|
427
|
+
<Button
|
|
428
|
+
type="button"
|
|
429
|
+
variant="ghost"
|
|
430
|
+
size={launcherVariant === "compact" ? "icon-sm" : "sm"}
|
|
431
|
+
className={cn(
|
|
432
|
+
"relative rounded-full border border-white/25 bg-black/35 text-white backdrop-blur-sm hover:bg-black/55 disabled:border-white/10 disabled:bg-black/25 disabled:text-white/40",
|
|
433
|
+
launcherVariant === "compact" ? "h-9 w-9 p-0" : "gap-2 px-3",
|
|
434
|
+
)}
|
|
435
|
+
aria-expanded={launcherOpen}
|
|
436
|
+
aria-label={
|
|
437
|
+
launcherOpen
|
|
438
|
+
? `Hide ${launcherLabel.toLowerCase()}`
|
|
439
|
+
: `Show ${launcherLabel.toLowerCase()}`
|
|
440
|
+
}
|
|
441
|
+
title={!joinUrl ? waitingLabel : launcherLabel}
|
|
442
|
+
onClick={() => setLauncherOpen((current) => !current)}
|
|
443
|
+
>
|
|
444
|
+
<MonitorSmartphone className="h-4 w-4" />
|
|
445
|
+
{launcherVariant === "full" ? (
|
|
446
|
+
<>
|
|
447
|
+
<span className="text-[11px] font-semibold tracking-[0.16em] uppercase">
|
|
448
|
+
{launcherLabel}
|
|
449
|
+
</span>
|
|
450
|
+
{sessions.length > 0 ? (
|
|
451
|
+
<span className="rounded-full border border-white/12 bg-white/6 px-1.5 py-0.5 text-[10px] leading-none font-semibold text-white/88">
|
|
452
|
+
{sessions.length}
|
|
453
|
+
</span>
|
|
454
|
+
) : null}
|
|
455
|
+
{launcherOpen ? (
|
|
456
|
+
<ChevronUp className="h-4 w-4 text-white/60" />
|
|
457
|
+
) : (
|
|
458
|
+
<ChevronDown className="h-4 w-4 text-white/60" />
|
|
459
|
+
)}
|
|
460
|
+
</>
|
|
461
|
+
) : sessions.length > 0 ? (
|
|
462
|
+
<span className="absolute -top-1 -right-1 flex h-4 min-w-4 items-center justify-center rounded-full border border-white/25 bg-slate-950 px-1 text-[9px] leading-none font-semibold text-white">
|
|
463
|
+
{sessions.length}
|
|
464
|
+
</span>
|
|
465
|
+
) : null}
|
|
466
|
+
</Button>
|
|
467
|
+
) : null}
|
|
449
468
|
</div>
|
|
450
469
|
|
|
451
470
|
{launcherOpen ? (
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* Platform (Arcade shell) commands sent as `controller:action_rpc` / `airjam:action_rpc` with
|
|
3
5
|
* `storeDomain: arcade.surface`. The server routes these to the **master** host socket so they
|
|
@@ -7,8 +9,10 @@
|
|
|
7
9
|
*/
|
|
8
10
|
export const AIRJAM_ARCADE_PLATFORM_ACTION_PREFIX = "airjam.arcade." as const;
|
|
9
11
|
|
|
10
|
-
/** Canonical
|
|
12
|
+
/** Canonical commands owned by the Arcade shell, never an embedded game. */
|
|
11
13
|
export const airJamArcadePlatformActions = {
|
|
14
|
+
navigate: "airjam.arcade.navigate",
|
|
15
|
+
confirm: "airjam.arcade.confirm",
|
|
12
16
|
ping: "airjam.arcade.ping",
|
|
13
17
|
toggleQr: "airjam.arcade.toggle_qr",
|
|
14
18
|
showQr: "airjam.arcade.show_qr",
|
|
@@ -17,6 +21,20 @@ export const airJamArcadePlatformActions = {
|
|
|
17
21
|
updateRoomSettings: "airjam.arcade.update_room_settings",
|
|
18
22
|
} as const;
|
|
19
23
|
|
|
24
|
+
/** Menu commands refer to the exact browser surface on which the gesture began. */
|
|
25
|
+
export const arcadeBrowserConfirmPayloadSchema = z
|
|
26
|
+
.object({ epoch: z.number().int().positive().safe() })
|
|
27
|
+
.strict();
|
|
28
|
+
|
|
29
|
+
export const arcadeBrowserNavigatePayloadSchema =
|
|
30
|
+
arcadeBrowserConfirmPayloadSchema.extend({
|
|
31
|
+
direction: z.enum(["up", "down", "left", "right"]),
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
export type ArcadeBrowserDirection = z.infer<
|
|
35
|
+
typeof arcadeBrowserNavigatePayloadSchema
|
|
36
|
+
>["direction"];
|
|
37
|
+
|
|
20
38
|
export type AirJamArcadePlatformActionName =
|
|
21
39
|
(typeof airJamArcadePlatformActions)[keyof typeof airJamArcadePlatformActions];
|
|
22
40
|
|
|
@@ -3,6 +3,8 @@ import type { RoomPlatformSettingsSnapshot } from "../settings/platform-settings
|
|
|
3
3
|
import { roomCodeSchema, type RoomCode } from "./core";
|
|
4
4
|
import type { ErrorCode } from "./errors";
|
|
5
5
|
|
|
6
|
+
export { DEFAULT_ROOM_PLATFORM_SETTINGS } from "../settings/platform-settings";
|
|
7
|
+
|
|
6
8
|
export const controllerInputSchema = z.object({
|
|
7
9
|
roomId: roomCodeSchema,
|
|
8
10
|
controllerId: z.string().min(3),
|
|
@@ -77,14 +79,15 @@ export const controllerJoinSchema = z.object({
|
|
|
77
79
|
roomId: roomCodeSchema,
|
|
78
80
|
controllerId: z.string().min(3),
|
|
79
81
|
/**
|
|
80
|
-
*
|
|
81
|
-
* Older clients may omit this and fall back to controllerId-only behavior.
|
|
82
|
+
* Local device/source hint, never authority to resume a controller slot.
|
|
82
83
|
*/
|
|
83
84
|
deviceId: z.string().min(8).max(128).optional(),
|
|
84
85
|
nickname: z.string().trim().min(1).max(24).optional(),
|
|
85
86
|
/** Preset avatar key (platform-defined); optional at join. */
|
|
86
87
|
avatarId: z.string().trim().min(1).max(48).optional(),
|
|
87
88
|
capabilityToken: z.string().min(1).optional(),
|
|
89
|
+
/** Private server-issued proof required to resume an existing controller. */
|
|
90
|
+
resumeCapabilityToken: z.string().min(1).max(128).optional(),
|
|
88
91
|
});
|
|
89
92
|
|
|
90
93
|
export type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;
|
|
@@ -154,8 +157,11 @@ export interface ControllerJoinAck {
|
|
|
154
157
|
controllerId?: string;
|
|
155
158
|
roomId?: RoomCode;
|
|
156
159
|
resumed?: boolean;
|
|
160
|
+
/** Private to the joining client; never publish in presence or bridge state. */
|
|
161
|
+
resumeCapabilityToken?: string;
|
|
157
162
|
message?: string;
|
|
158
163
|
code?: ErrorCode | string;
|
|
164
|
+
retryAfterSeconds?: number;
|
|
159
165
|
}
|
|
160
166
|
|
|
161
167
|
export const controllerPrivilegedGrantSchema = z.enum([
|
|
@@ -100,7 +100,6 @@ export const AIRJAM_DEV_LOG_EVENTS = {
|
|
|
100
100
|
modeMasterKey: "auth.mode.master_key",
|
|
101
101
|
modeDatabaseAndHostGrant: "auth.mode.database_and_host_grant",
|
|
102
102
|
modeDatabase: "auth.mode.database",
|
|
103
|
-
modeHostGrantOnly: "auth.mode.host_grant_only",
|
|
104
103
|
backendMissing: "auth.backend.missing",
|
|
105
104
|
appIdLastUsedAtUpdateFailed: "auth.app_id_last_used_at_update.failed",
|
|
106
105
|
appIdVerificationDatabaseError: "auth.app_id_verification.database_error",
|
|
@@ -144,8 +143,6 @@ export const AIRJAM_DEV_LOG_EVENTS = {
|
|
|
144
143
|
bootstrapRejected: "host.bootstrap.rejected",
|
|
145
144
|
disconnectPendingRoomClose: "host.disconnect.pending_room_close",
|
|
146
145
|
disconnectRoomClosed: "host.disconnect.room_closed",
|
|
147
|
-
registerSystemAccepted: "host.register_system.accepted",
|
|
148
|
-
registerSystemRejected: "host.register_system.rejected",
|
|
149
146
|
createRoomAccepted: "host.create_room.accepted",
|
|
150
147
|
createRoomRejected: "host.create_room.rejected",
|
|
151
148
|
reconnectAccepted: "host.reconnect.accepted",
|