@air-jam/sdk 0.9.1 → 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-CEJ5RFSG.js → chunk-2SZ2YYGJ.js} +8 -16
- package/dist/chunk-2SZ2YYGJ.js.map +1 -0
- package/dist/{chunk-VKBMZHMQ.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-JEHV5C2X.js → chunk-CV3PBXPT.js} +3 -3
- package/dist/chunk-D4VDEVTZ.js +80 -0
- package/dist/chunk-D4VDEVTZ.js.map +1 -0
- package/dist/{chunk-W3YA5BWR.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-KXAFI5OP.js → chunk-LIHEEAVE.js} +9 -11
- package/dist/chunk-LIHEEAVE.js.map +1 -0
- package/dist/{chunk-FAT2KJ3K.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-7UXSWCZZ.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 +4275 -3813
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +40 -642
- package/dist/index.d.ts +40 -642
- package/dist/index.js +1032 -3658
- 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 +689 -629
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +14 -4
- package/dist/ui.d.ts +14 -4
- package/dist/ui.js +117 -35
- 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/components/join-qr-overlay.tsx +115 -31
- 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/hooks/use-host-audio-mute-preference.ts +99 -0
- package/src/index.ts +6 -21
- 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-CABEUV65.js +0 -184
- package/dist/chunk-CABEUV65.js.map +0 -1
- package/dist/chunk-CEJ5RFSG.js.map +0 -1
- package/dist/chunk-EDRQIOCV.js.map +0 -1
- package/dist/chunk-KXAFI5OP.js.map +0 -1
- package/dist/chunk-NCL6WJCL.js.map +0 -1
- package/dist/chunk-NUJBMV3O.js.map +0 -1
- package/dist/chunk-VKBMZHMQ.js.map +0 -1
- package/dist/chunk-W3YA5BWR.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-JEHV5C2X.js.map → chunk-CV3PBXPT.js.map} +0 -0
- /package/dist/{chunk-FAT2KJ3K.js.map → chunk-MIMPMB7O.js.map} +0 -0
- /package/dist/{chunk-7UXSWCZZ.js.map → chunk-QO4KFUEI.js.map} +0 -0
- /package/dist/{chunk-JO2HR5PV.js.map → chunk-UPV6YWT5.js.map} +0 -0
|
@@ -1,104 +1,40 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
import { hostSessionKindSchema } from "./host";
|
|
3
|
+
import {
|
|
4
|
+
createSignedEnvelope,
|
|
5
|
+
verifySignedEnvelope,
|
|
6
|
+
type SignedEnvelopeContract,
|
|
7
|
+
} from "./signed-envelope";
|
|
8
|
+
|
|
9
|
+
export const hostGrantAudienceSchema = z.literal("airjam:realtime");
|
|
10
|
+
|
|
11
|
+
export const hostGrantClaimsSchema = z
|
|
12
|
+
.object({
|
|
13
|
+
typ: z.literal("airjam.host_grant.v3"),
|
|
14
|
+
jti: z.string().uuid(),
|
|
15
|
+
aud: hostGrantAudienceSchema,
|
|
16
|
+
appId: z.string().min(1),
|
|
17
|
+
gameId: z.string().min(1),
|
|
18
|
+
creatorId: z.string().min(1),
|
|
19
|
+
iat: z.number().int().positive(),
|
|
20
|
+
exp: z.number().int().positive(),
|
|
21
|
+
origins: z.array(z.string().url()).min(1),
|
|
22
|
+
sessionKind: hostSessionKindSchema,
|
|
23
|
+
})
|
|
24
|
+
.strict();
|
|
13
25
|
|
|
14
26
|
export type HostGrantClaims = z.infer<typeof hostGrantClaimsSchema>;
|
|
15
27
|
|
|
16
|
-
const
|
|
17
|
-
const decoder = new TextDecoder();
|
|
18
|
-
|
|
19
|
-
const getSubtleCrypto = (): SubtleCrypto => {
|
|
20
|
-
const subtle = globalThis.crypto?.subtle;
|
|
21
|
-
if (!subtle) {
|
|
22
|
-
throw new Error("SubtleCrypto unavailable");
|
|
23
|
-
}
|
|
24
|
-
return subtle;
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
const getBtoa = (): ((value: string) => string) => {
|
|
28
|
-
if (typeof globalThis.btoa === "function") {
|
|
29
|
-
return globalThis.btoa.bind(globalThis);
|
|
30
|
-
}
|
|
31
|
-
throw new Error("Base64 encoding unavailable");
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
const getAtob = (): ((value: string) => string) => {
|
|
35
|
-
if (typeof globalThis.atob === "function") {
|
|
36
|
-
return globalThis.atob.bind(globalThis);
|
|
37
|
-
}
|
|
38
|
-
throw new Error("Base64 decoding unavailable");
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
const toBase64Url = (bytes: Uint8Array): string => {
|
|
42
|
-
let binary = "";
|
|
43
|
-
bytes.forEach((byte) => {
|
|
44
|
-
binary += String.fromCharCode(byte);
|
|
45
|
-
});
|
|
46
|
-
return getBtoa()(binary)
|
|
47
|
-
.replace(/\+/g, "-")
|
|
48
|
-
.replace(/\//g, "_")
|
|
49
|
-
.replace(/=+$/g, "");
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
const fromBase64Url = (value: string): Uint8Array => {
|
|
53
|
-
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
54
|
-
const padded = normalized.padEnd(
|
|
55
|
-
normalized.length + ((4 - (normalized.length % 4)) % 4),
|
|
56
|
-
"=",
|
|
57
|
-
);
|
|
58
|
-
|
|
59
|
-
const binary = getAtob()(padded);
|
|
60
|
-
return Uint8Array.from(binary, (char) => char.charCodeAt(0));
|
|
61
|
-
};
|
|
62
|
-
|
|
63
|
-
const encodeJson = (value: unknown): string =>
|
|
64
|
-
toBase64Url(encoder.encode(JSON.stringify(value)));
|
|
65
|
-
|
|
66
|
-
const decodeJson = <T>(value: string): T =>
|
|
67
|
-
JSON.parse(decoder.decode(fromBase64Url(value))) as T;
|
|
68
|
-
|
|
69
|
-
const signHmacSha256 = async (
|
|
70
|
-
secret: string,
|
|
71
|
-
data: string,
|
|
72
|
-
): Promise<Uint8Array> => {
|
|
73
|
-
const subtle = getSubtleCrypto();
|
|
74
|
-
const key = await subtle.importKey(
|
|
75
|
-
"raw",
|
|
76
|
-
encoder.encode(secret),
|
|
77
|
-
{ name: "HMAC", hash: "SHA-256" },
|
|
78
|
-
false,
|
|
79
|
-
["sign"],
|
|
80
|
-
);
|
|
81
|
-
|
|
82
|
-
const signature = await subtle.sign("HMAC", key, encoder.encode(data));
|
|
83
|
-
return new Uint8Array(signature);
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
const timingSafeEqual = (a: Uint8Array, b: Uint8Array): boolean => {
|
|
87
|
-
if (a.length !== b.length) {
|
|
88
|
-
return false;
|
|
89
|
-
}
|
|
28
|
+
export const HOST_GRANT_SIGNING_DOMAIN = "airjam:host-grant:v3";
|
|
90
29
|
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
}
|
|
95
|
-
return result === 0;
|
|
30
|
+
const hostGrantEnvelopeContract: SignedEnvelopeContract<HostGrantClaims> = {
|
|
31
|
+
signingDomain: HOST_GRANT_SIGNING_DOMAIN,
|
|
32
|
+
claimsSchema: hostGrantClaimsSchema,
|
|
96
33
|
};
|
|
97
34
|
|
|
98
35
|
export interface CreateHostGrantInput {
|
|
99
36
|
secret: string;
|
|
100
|
-
claims:
|
|
101
|
-
Partial<Pick<HostGrantClaims, "typ" | "iat" | "scopes" | "origins">>;
|
|
37
|
+
claims: Omit<HostGrantClaims, "typ"> & Partial<Pick<HostGrantClaims, "typ">>;
|
|
102
38
|
}
|
|
103
39
|
|
|
104
40
|
export const createHostGrant = async ({
|
|
@@ -106,20 +42,16 @@ export const createHostGrant = async ({
|
|
|
106
42
|
claims,
|
|
107
43
|
}: CreateHostGrantInput): Promise<string> => {
|
|
108
44
|
const normalizedClaims = hostGrantClaimsSchema.parse({
|
|
109
|
-
typ: "airjam.host_grant.
|
|
45
|
+
typ: "airjam.host_grant.v3",
|
|
110
46
|
...claims,
|
|
111
47
|
});
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
await signHmacSha256(secret, `${header}.${payload}`),
|
|
120
|
-
);
|
|
121
|
-
|
|
122
|
-
return `${header}.${payload}.${signature}`;
|
|
48
|
+
return (
|
|
49
|
+
await createSignedEnvelope({
|
|
50
|
+
secret,
|
|
51
|
+
claims: normalizedClaims,
|
|
52
|
+
contract: hostGrantEnvelopeContract,
|
|
53
|
+
})
|
|
54
|
+
).token;
|
|
123
55
|
};
|
|
124
56
|
|
|
125
57
|
export interface VerifyHostGrantInput {
|
|
@@ -139,47 +71,33 @@ export const verifyHostGrant = async ({
|
|
|
139
71
|
token,
|
|
140
72
|
now = Math.floor(Date.now() / 1000),
|
|
141
73
|
}: VerifyHostGrantInput): Promise<VerifyHostGrantResult> => {
|
|
142
|
-
const
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
try {
|
|
150
|
-
const parsedHeader = decodeJson<{ alg?: string; typ?: string }>(header!);
|
|
151
|
-
if (parsedHeader.alg !== "HS256") {
|
|
152
|
-
return { ok: false, error: "Unsupported host grant algorithm" };
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
const expectedSignature = await signHmacSha256(
|
|
156
|
-
secret,
|
|
157
|
-
`${header}.${payload}`,
|
|
158
|
-
);
|
|
159
|
-
if (!timingSafeEqual(expectedSignature, fromBase64Url(signature!))) {
|
|
74
|
+
const verified = await verifySignedEnvelope({
|
|
75
|
+
secret,
|
|
76
|
+
token,
|
|
77
|
+
contract: hostGrantEnvelopeContract,
|
|
78
|
+
});
|
|
79
|
+
if (!verified.ok) {
|
|
80
|
+
if (verified.error === "invalid_signature") {
|
|
160
81
|
return { ok: false, error: "Invalid host grant signature" };
|
|
161
82
|
}
|
|
162
|
-
|
|
163
|
-
const parsedClaims = hostGrantClaimsSchema.safeParse(
|
|
164
|
-
decodeJson<unknown>(payload!),
|
|
165
|
-
);
|
|
166
|
-
if (!parsedClaims.success) {
|
|
83
|
+
if (verified.error === "invalid_payload") {
|
|
167
84
|
return { ok: false, error: "Invalid host grant payload" };
|
|
168
85
|
}
|
|
86
|
+
return { ok: false, error: "Malformed host grant" };
|
|
87
|
+
}
|
|
169
88
|
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
if (!parsedClaims.data.scopes.includes("host:bootstrap")) {
|
|
175
|
-
return { ok: false, error: "Host grant missing bootstrap scope" };
|
|
176
|
-
}
|
|
89
|
+
const claims = verified.claims;
|
|
90
|
+
if (claims.exp <= now) {
|
|
91
|
+
return { ok: false, error: "Host grant expired" };
|
|
92
|
+
}
|
|
177
93
|
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
return { ok: false, error: "
|
|
94
|
+
if (
|
|
95
|
+
claims.iat > now + 30 ||
|
|
96
|
+
claims.exp <= claims.iat ||
|
|
97
|
+
claims.exp - claims.iat > 120
|
|
98
|
+
) {
|
|
99
|
+
return { ok: false, error: "Invalid host grant lifetime" };
|
|
184
100
|
}
|
|
101
|
+
|
|
102
|
+
return { ok: true, claims };
|
|
185
103
|
};
|
package/src/protocol/host.ts
CHANGED
|
@@ -17,6 +17,19 @@ export const childHostCapabilitySchema = z.object({
|
|
|
17
17
|
|
|
18
18
|
export type ChildHostCapability = z.infer<typeof childHostCapabilitySchema>;
|
|
19
19
|
|
|
20
|
+
export const hostResumeCapabilitySchema = z.object({
|
|
21
|
+
token: z.string().min(1),
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export type HostResumeCapability = z.infer<typeof hostResumeCapabilitySchema>;
|
|
25
|
+
|
|
26
|
+
export interface HostArcadeSurfaceCheckpoint {
|
|
27
|
+
/** Last Arcade surface epoch accepted by the room before this reconnect. */
|
|
28
|
+
epoch: number;
|
|
29
|
+
/** Last replicated Arcade surface revision accepted by the room. */
|
|
30
|
+
revision: number;
|
|
31
|
+
}
|
|
32
|
+
|
|
20
33
|
/**
|
|
21
34
|
* Active arcade game session as seen by the server (launch capability + catalog id).
|
|
22
35
|
* Returned on host reconnect so the platform can restore iframe + replicated surface after refresh.
|
|
@@ -31,14 +44,19 @@ export interface HostRegistrationAck {
|
|
|
31
44
|
roomId?: RoomCode;
|
|
32
45
|
message?: string;
|
|
33
46
|
code?: ErrorCode | string;
|
|
47
|
+
retryAfterSeconds?: number;
|
|
34
48
|
/** When reconnecting, present if the room still has a launched game (launch pending or active). */
|
|
35
49
|
arcadeSession?: HostArcadeSessionSnapshot;
|
|
50
|
+
/** Last observed Arcade counters, used to keep a reconnect monotonic. */
|
|
51
|
+
arcadeSurfaceCheckpoint?: HostArcadeSurfaceCheckpoint;
|
|
36
52
|
/** Authoritative controller roster snapshot for the connected room. */
|
|
37
53
|
players?: PlayerProfile[];
|
|
38
54
|
/** Authoritative controller-session roster for the connected room. */
|
|
39
55
|
controllers?: ControllerPresenceNotice[];
|
|
40
56
|
/** Official Air Jam controller capability bundle for privileged controller channels. */
|
|
41
57
|
controllerCapability?: ControllerPrivilegedCapability;
|
|
58
|
+
/** Bearer capability required to reclaim this room after the master socket disconnects. */
|
|
59
|
+
hostResumeCapability?: HostResumeCapability;
|
|
42
60
|
}
|
|
43
61
|
|
|
44
62
|
export interface HostBootstrapAck {
|
|
@@ -51,6 +69,7 @@ export interface HostBootstrapAck {
|
|
|
51
69
|
export interface HostSocketAuthority {
|
|
52
70
|
appId?: string;
|
|
53
71
|
gameId?: string;
|
|
72
|
+
creatorId?: string;
|
|
54
73
|
traceId: string;
|
|
55
74
|
verifiedAt: number;
|
|
56
75
|
verifiedVia?: "appId" | "hostGrant";
|
|
@@ -61,19 +80,11 @@ export interface HostSocketAuthority {
|
|
|
61
80
|
export const hostBootstrapSchema = z.object({
|
|
62
81
|
appId: z.string().optional(),
|
|
63
82
|
hostGrant: z.string().min(1).optional(),
|
|
64
|
-
hostSessionKind: hostSessionKindSchema.default("
|
|
83
|
+
hostSessionKind: hostSessionKindSchema.default("game"),
|
|
65
84
|
});
|
|
66
85
|
|
|
67
86
|
export type HostBootstrapPayload = z.infer<typeof hostBootstrapSchema>;
|
|
68
87
|
|
|
69
|
-
export const hostRegisterSystemSchema = z.object({
|
|
70
|
-
roomId: roomCodeSchema,
|
|
71
|
-
});
|
|
72
|
-
|
|
73
|
-
export type HostRegisterSystemPayload = z.infer<
|
|
74
|
-
typeof hostRegisterSystemSchema
|
|
75
|
-
>;
|
|
76
|
-
|
|
77
88
|
export const systemLaunchGameSchema = z.object({
|
|
78
89
|
roomId: roomCodeSchema,
|
|
79
90
|
gameId: z.string(),
|
|
@@ -105,6 +116,7 @@ export type HostCreateRoomPayload = z.infer<typeof hostCreateRoomSchema>;
|
|
|
105
116
|
|
|
106
117
|
export const hostReconnectSchema = z.object({
|
|
107
118
|
roomId: roomCodeSchema,
|
|
119
|
+
resumeCapabilityToken: z.string().min(1),
|
|
108
120
|
});
|
|
109
121
|
|
|
110
122
|
export type HostReconnectPayload = z.infer<typeof hostReconnectSchema>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { roomCodeSchema } from "./core";
|
|
3
|
+
|
|
4
|
+
export const AIRJAM_RUNTIME_ERROR_REPORT_CONTRACT_VERSION = 1 as const;
|
|
5
|
+
|
|
6
|
+
export const runtimeErrorReportSchema = z
|
|
7
|
+
.object({
|
|
8
|
+
contractVersion: z.literal(AIRJAM_RUNTIME_ERROR_REPORT_CONTRACT_VERSION),
|
|
9
|
+
reportId: z.string().uuid(),
|
|
10
|
+
roomId: roomCodeSchema,
|
|
11
|
+
role: z.enum(["host", "controller"]),
|
|
12
|
+
code: z.literal("AJ_RUNTIME_RENDER_CRASH"),
|
|
13
|
+
errorName: z
|
|
14
|
+
.string()
|
|
15
|
+
.trim()
|
|
16
|
+
.min(1)
|
|
17
|
+
.max(80)
|
|
18
|
+
.regex(/^[A-Za-z][A-Za-z0-9._-]*$/u),
|
|
19
|
+
digest: z.string().regex(/^[a-f0-9]{8}$/u),
|
|
20
|
+
occurredAt: z.string().datetime(),
|
|
21
|
+
})
|
|
22
|
+
.strict();
|
|
23
|
+
|
|
24
|
+
export type RuntimeErrorReport = z.infer<typeof runtimeErrorReportSchema>;
|
|
25
|
+
|
|
26
|
+
export type RuntimeErrorReportAck =
|
|
27
|
+
| { ok: true; reportId: string }
|
|
28
|
+
| {
|
|
29
|
+
ok: false;
|
|
30
|
+
reportId?: string;
|
|
31
|
+
code: "invalid_payload" | "unauthorized" | "rate_limited" | "unavailable";
|
|
32
|
+
};
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import type { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const encoder = new TextEncoder();
|
|
4
|
+
const decoder = new TextDecoder();
|
|
5
|
+
|
|
6
|
+
export type SignedEnvelopeVerificationError =
|
|
7
|
+
| "missing_secret"
|
|
8
|
+
| "malformed"
|
|
9
|
+
| "invalid_signature"
|
|
10
|
+
| "invalid_payload";
|
|
11
|
+
|
|
12
|
+
export type SignedEnvelopeVerificationResult<TClaims> =
|
|
13
|
+
| { ok: true; claims: TClaims }
|
|
14
|
+
| { ok: false; error: SignedEnvelopeVerificationError };
|
|
15
|
+
|
|
16
|
+
export interface SignedEnvelopeContract<TClaims> {
|
|
17
|
+
signingDomain: string;
|
|
18
|
+
claimsSchema: z.ZodType<TClaims>;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
const getSubtleCrypto = (): SubtleCrypto => {
|
|
22
|
+
const subtle = globalThis.crypto?.subtle;
|
|
23
|
+
if (!subtle) {
|
|
24
|
+
throw new Error("SubtleCrypto unavailable");
|
|
25
|
+
}
|
|
26
|
+
return subtle;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const getBtoa = (): ((value: string) => string) => {
|
|
30
|
+
if (typeof globalThis.btoa !== "function") {
|
|
31
|
+
throw new Error("Base64 encoding unavailable");
|
|
32
|
+
}
|
|
33
|
+
return globalThis.btoa.bind(globalThis);
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const getAtob = (): ((value: string) => string) => {
|
|
37
|
+
if (typeof globalThis.atob !== "function") {
|
|
38
|
+
throw new Error("Base64 decoding unavailable");
|
|
39
|
+
}
|
|
40
|
+
return globalThis.atob.bind(globalThis);
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
const toBase64Url = (bytes: Uint8Array): string => {
|
|
44
|
+
let binary = "";
|
|
45
|
+
bytes.forEach((byte) => {
|
|
46
|
+
binary += String.fromCharCode(byte);
|
|
47
|
+
});
|
|
48
|
+
return getBtoa()(binary)
|
|
49
|
+
.replace(/\+/g, "-")
|
|
50
|
+
.replace(/\//g, "_")
|
|
51
|
+
.replace(/=+$/g, "");
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
const fromBase64Url = (value: string): Uint8Array => {
|
|
55
|
+
if (!/^[A-Za-z0-9_-]+$/u.test(value)) {
|
|
56
|
+
throw new Error("Invalid base64url value");
|
|
57
|
+
}
|
|
58
|
+
const normalized = value.replace(/-/g, "+").replace(/_/g, "/");
|
|
59
|
+
const padded = normalized.padEnd(
|
|
60
|
+
normalized.length + ((4 - (normalized.length % 4)) % 4),
|
|
61
|
+
"=",
|
|
62
|
+
);
|
|
63
|
+
const binary = getAtob()(padded);
|
|
64
|
+
return Uint8Array.from(binary, (character) => character.charCodeAt(0));
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const deriveSigningKey = async (
|
|
68
|
+
secret: string,
|
|
69
|
+
signingDomain: string,
|
|
70
|
+
usages: KeyUsage[],
|
|
71
|
+
): Promise<CryptoKey> => {
|
|
72
|
+
const subtle = getSubtleCrypto();
|
|
73
|
+
const rootKey = await subtle.importKey(
|
|
74
|
+
"raw",
|
|
75
|
+
encoder.encode(secret),
|
|
76
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
77
|
+
false,
|
|
78
|
+
["sign"],
|
|
79
|
+
);
|
|
80
|
+
const derivedKey = await subtle.sign(
|
|
81
|
+
"HMAC",
|
|
82
|
+
rootKey,
|
|
83
|
+
encoder.encode(signingDomain),
|
|
84
|
+
);
|
|
85
|
+
return subtle.importKey(
|
|
86
|
+
"raw",
|
|
87
|
+
derivedKey,
|
|
88
|
+
{ name: "HMAC", hash: "SHA-256" },
|
|
89
|
+
false,
|
|
90
|
+
usages,
|
|
91
|
+
);
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const toArrayBuffer = (bytes: Uint8Array): ArrayBuffer => {
|
|
95
|
+
const copy = new Uint8Array(bytes.byteLength);
|
|
96
|
+
copy.set(bytes);
|
|
97
|
+
return copy.buffer;
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
export const createSignedEnvelope = async <TClaims>({
|
|
101
|
+
secret,
|
|
102
|
+
claims,
|
|
103
|
+
contract,
|
|
104
|
+
}: {
|
|
105
|
+
secret: string;
|
|
106
|
+
claims: TClaims;
|
|
107
|
+
contract: SignedEnvelopeContract<TClaims>;
|
|
108
|
+
}): Promise<{ token: string; claims: TClaims }> => {
|
|
109
|
+
if (!secret.trim()) {
|
|
110
|
+
throw new Error("Signed-envelope secret is required");
|
|
111
|
+
}
|
|
112
|
+
if (!contract.signingDomain.trim()) {
|
|
113
|
+
throw new Error("Signed-envelope domain is required");
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
const normalizedClaims = contract.claimsSchema.parse(claims);
|
|
117
|
+
const payload = toBase64Url(encoder.encode(JSON.stringify(normalizedClaims)));
|
|
118
|
+
const signingKey = await deriveSigningKey(secret, contract.signingDomain, [
|
|
119
|
+
"sign",
|
|
120
|
+
]);
|
|
121
|
+
const signature = await getSubtleCrypto().sign(
|
|
122
|
+
"HMAC",
|
|
123
|
+
signingKey,
|
|
124
|
+
encoder.encode(payload),
|
|
125
|
+
);
|
|
126
|
+
|
|
127
|
+
return {
|
|
128
|
+
token: `${payload}.${toBase64Url(new Uint8Array(signature))}`,
|
|
129
|
+
claims: normalizedClaims,
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
export const verifySignedEnvelope = async <TClaims>({
|
|
134
|
+
secret,
|
|
135
|
+
token,
|
|
136
|
+
contract,
|
|
137
|
+
}: {
|
|
138
|
+
secret: string;
|
|
139
|
+
token: string;
|
|
140
|
+
contract: SignedEnvelopeContract<TClaims>;
|
|
141
|
+
}): Promise<SignedEnvelopeVerificationResult<TClaims>> => {
|
|
142
|
+
if (!secret.trim()) {
|
|
143
|
+
return { ok: false, error: "missing_secret" };
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
const parts = token.split(".");
|
|
147
|
+
if (parts.length !== 2) {
|
|
148
|
+
return { ok: false, error: "malformed" };
|
|
149
|
+
}
|
|
150
|
+
const [payload, encodedSignature] = parts;
|
|
151
|
+
|
|
152
|
+
try {
|
|
153
|
+
const signingKey = await deriveSigningKey(secret, contract.signingDomain, [
|
|
154
|
+
"verify",
|
|
155
|
+
]);
|
|
156
|
+
const signatureValid = await getSubtleCrypto().verify(
|
|
157
|
+
"HMAC",
|
|
158
|
+
signingKey,
|
|
159
|
+
toArrayBuffer(fromBase64Url(encodedSignature!)),
|
|
160
|
+
encoder.encode(payload!),
|
|
161
|
+
);
|
|
162
|
+
if (!signatureValid) {
|
|
163
|
+
return { ok: false, error: "invalid_signature" };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const claims = contract.claimsSchema.safeParse(
|
|
167
|
+
JSON.parse(decoder.decode(fromBase64Url(payload!))) as unknown,
|
|
168
|
+
);
|
|
169
|
+
if (!claims.success) {
|
|
170
|
+
return { ok: false, error: "invalid_payload" };
|
|
171
|
+
}
|
|
172
|
+
return { ok: true, claims: claims.data };
|
|
173
|
+
} catch {
|
|
174
|
+
return { ok: false, error: "malformed" };
|
|
175
|
+
}
|
|
176
|
+
};
|
|
@@ -19,7 +19,6 @@ import type {
|
|
|
19
19
|
HostCreateRoomPayload,
|
|
20
20
|
HostJoinAsChildPayload,
|
|
21
21
|
HostReconnectPayload,
|
|
22
|
-
HostRegisterSystemPayload,
|
|
23
22
|
HostRegistrationAck,
|
|
24
23
|
HostRemoveControllerPayload,
|
|
25
24
|
HostResetRoomPayload,
|
|
@@ -35,6 +34,10 @@ import type {
|
|
|
35
34
|
PlayerUpdatedNotice,
|
|
36
35
|
RoomReadyNotice,
|
|
37
36
|
} from "./notices";
|
|
37
|
+
import type {
|
|
38
|
+
RuntimeErrorReport,
|
|
39
|
+
RuntimeErrorReportAck,
|
|
40
|
+
} from "./runtime-reporting";
|
|
38
41
|
import type {
|
|
39
42
|
PlaySoundEventPayload,
|
|
40
43
|
PlaySoundPayload,
|
|
@@ -47,19 +50,18 @@ import type {
|
|
|
47
50
|
AirJamStateSyncRequestPayload,
|
|
48
51
|
ControllerActionRpcPayload,
|
|
49
52
|
ControllerStateSyncRequestPayload,
|
|
50
|
-
HostActionRpcPayload,
|
|
51
53
|
HostStateSyncPayload,
|
|
52
54
|
} from "./sync";
|
|
53
55
|
|
|
54
56
|
export interface ClientToServerEvents {
|
|
57
|
+
"runtime:error_report": (
|
|
58
|
+
payload: RuntimeErrorReport,
|
|
59
|
+
callback: (ack: RuntimeErrorReportAck) => void,
|
|
60
|
+
) => void;
|
|
55
61
|
"host:bootstrap": (
|
|
56
62
|
payload: HostBootstrapPayload,
|
|
57
63
|
callback: (ack: HostBootstrapAck) => void,
|
|
58
64
|
) => void;
|
|
59
|
-
"host:registerSystem": (
|
|
60
|
-
payload: HostRegisterSystemPayload,
|
|
61
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
62
|
-
) => void;
|
|
63
65
|
"host:createRoom": (
|
|
64
66
|
payload: HostCreateRoomPayload,
|
|
65
67
|
callback: (ack: HostRegistrationAck) => void,
|
|
@@ -113,10 +115,6 @@ export interface ClientToServerEvents {
|
|
|
113
115
|
payload: ControllerActionRpcPayload,
|
|
114
116
|
callback?: (ack: AirJamActionInvocationResult) => void,
|
|
115
117
|
) => void;
|
|
116
|
-
"controller:host_action_rpc": (
|
|
117
|
-
payload: HostActionRpcPayload,
|
|
118
|
-
callback?: (ack: AirJamActionInvocationResult) => void,
|
|
119
|
-
) => void;
|
|
120
118
|
"controller:state_sync_request": (
|
|
121
119
|
payload: ControllerStateSyncRequestPayload,
|
|
122
120
|
) => void;
|
package/src/protocol/sync.ts
CHANGED
|
@@ -56,13 +56,6 @@ export interface ControllerActionRpcPayload {
|
|
|
56
56
|
storeDomain: string;
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
export interface HostActionRpcPayload {
|
|
60
|
-
roomId: string;
|
|
61
|
-
actionName: string;
|
|
62
|
-
payload: AirJamActionPayload | undefined;
|
|
63
|
-
storeDomain: string;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
59
|
export interface AirJamStateSyncPayload {
|
|
67
60
|
roomId: string;
|
|
68
61
|
data: Record<string, unknown>;
|
|
@@ -93,15 +86,6 @@ export const controllerActionRpcSchema = z
|
|
|
93
86
|
})
|
|
94
87
|
.strict();
|
|
95
88
|
|
|
96
|
-
export const hostActionRpcSchema = z
|
|
97
|
-
.object({
|
|
98
|
-
roomId: roomCodeSchema,
|
|
99
|
-
actionName: z.string().trim().min(1),
|
|
100
|
-
payload: z.union([airJamActionPayloadSchema, z.undefined()]).optional(),
|
|
101
|
-
storeDomain: z.string().trim().min(1).max(128),
|
|
102
|
-
})
|
|
103
|
-
.strict();
|
|
104
|
-
|
|
105
89
|
export const hostStateSyncSchema = z
|
|
106
90
|
.object({
|
|
107
91
|
roomId: roomCodeSchema,
|
package/src/protocol.ts
CHANGED
|
@@ -6,7 +6,9 @@ export * from "./protocol/errors";
|
|
|
6
6
|
export * from "./protocol/host";
|
|
7
7
|
export * from "./protocol/host-grant";
|
|
8
8
|
export * from "./protocol/notices";
|
|
9
|
+
export * from "./protocol/runtime-reporting";
|
|
9
10
|
export * from "./protocol/signals";
|
|
11
|
+
export * from "./protocol/signed-envelope";
|
|
10
12
|
export * from "./protocol/socket-events";
|
|
11
13
|
export * from "./protocol/sync";
|
|
12
14
|
export * from "./protocol/url-policy";
|
package/src/release.ts
CHANGED
|
@@ -19,6 +19,38 @@ export const gameReleaseStatusValues = [
|
|
|
19
19
|
export type GameReleaseStatus = (typeof gameReleaseStatusValues)[number];
|
|
20
20
|
export const gameReleaseStatusSchema = z.enum(gameReleaseStatusValues);
|
|
21
21
|
|
|
22
|
+
export const releaseGenerationStatusValues = [
|
|
23
|
+
"awaiting_upload",
|
|
24
|
+
"processing",
|
|
25
|
+
"ready",
|
|
26
|
+
"failed",
|
|
27
|
+
"abandoned",
|
|
28
|
+
] as const;
|
|
29
|
+
export type ReleaseGenerationStatus =
|
|
30
|
+
(typeof releaseGenerationStatusValues)[number];
|
|
31
|
+
export const releaseGenerationStatusSchema = z.enum(
|
|
32
|
+
releaseGenerationStatusValues,
|
|
33
|
+
);
|
|
34
|
+
|
|
35
|
+
export const releaseJobKindValues = [
|
|
36
|
+
"release_artifact_processing",
|
|
37
|
+
"release_browser_validation",
|
|
38
|
+
"release_image_moderation",
|
|
39
|
+
] as const;
|
|
40
|
+
export type ReleaseJobKind = (typeof releaseJobKindValues)[number];
|
|
41
|
+
export const releaseJobKindSchema = z.enum(releaseJobKindValues);
|
|
42
|
+
|
|
43
|
+
export const releaseJobStatusValues = [
|
|
44
|
+
"queued",
|
|
45
|
+
"running",
|
|
46
|
+
"cancel_requested",
|
|
47
|
+
"succeeded",
|
|
48
|
+
"failed",
|
|
49
|
+
"canceled",
|
|
50
|
+
] as const;
|
|
51
|
+
export type ReleaseJobStatus = (typeof releaseJobStatusValues)[number];
|
|
52
|
+
export const releaseJobStatusSchema = z.enum(releaseJobStatusValues);
|
|
53
|
+
|
|
22
54
|
export const releaseCheckKindValues = [
|
|
23
55
|
"artifact_validation",
|
|
24
56
|
"screenshot_capture",
|