@air-jam/sdk 0.1.3 → 0.9.0
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/LICENSE +21 -0
- package/README.md +627 -57
- package/dist/agent-tooling-BSMGBix9.d.cts +123 -0
- package/dist/agent-tooling-BSMGBix9.d.ts +123 -0
- package/dist/agent-tooling.cjs +83 -0
- package/dist/agent-tooling.cjs.map +1 -0
- package/dist/agent-tooling.d.cts +2 -0
- package/dist/agent-tooling.d.ts +2 -0
- package/dist/agent-tooling.js +17 -0
- package/dist/agent-tooling.js.map +1 -0
- package/dist/arcade/bridge/controller.cjs +749 -0
- package/dist/arcade/bridge/controller.cjs.map +1 -0
- package/dist/arcade/bridge/controller.d.cts +85 -0
- package/dist/arcade/bridge/controller.d.ts +85 -0
- package/dist/arcade/bridge/controller.js +33 -0
- package/dist/arcade/bridge/controller.js.map +1 -0
- package/dist/arcade/bridge/host.cjs +421 -0
- package/dist/arcade/bridge/host.cjs.map +1 -0
- package/dist/arcade/bridge/host.d.cts +73 -0
- package/dist/arcade/bridge/host.d.ts +73 -0
- package/dist/arcade/bridge/host.js +25 -0
- package/dist/arcade/bridge/host.js.map +1 -0
- package/dist/arcade/bridge/iframe.cjs +453 -0
- package/dist/arcade/bridge/iframe.cjs.map +1 -0
- package/dist/arcade/bridge/iframe.d.cts +80 -0
- package/dist/arcade/bridge/iframe.d.ts +80 -0
- package/dist/arcade/bridge/iframe.js +28 -0
- package/dist/arcade/bridge/iframe.js.map +1 -0
- package/dist/arcade/bridge.cjs +1067 -0
- package/dist/arcade/bridge.cjs.map +1 -0
- package/dist/arcade/bridge.d.cts +11 -0
- package/dist/arcade/bridge.d.ts +11 -0
- package/dist/arcade/bridge.js +76 -0
- package/dist/arcade/bridge.js.map +1 -0
- package/dist/arcade/host.cjs +488 -0
- package/dist/arcade/host.cjs.map +1 -0
- package/dist/arcade/host.d.cts +19 -0
- package/dist/arcade/host.d.ts +19 -0
- package/dist/arcade/host.js +13 -0
- package/dist/arcade/host.js.map +1 -0
- package/dist/arcade/surface.cjs +113 -0
- package/dist/arcade/surface.cjs.map +1 -0
- package/dist/arcade/surface.d.cts +14 -0
- package/dist/arcade/surface.d.ts +14 -0
- package/dist/arcade/surface.js +27 -0
- package/dist/arcade/surface.js.map +1 -0
- package/dist/arcade/url.cjs +363 -0
- package/dist/arcade/url.cjs.map +1 -0
- package/dist/arcade/url.d.cts +68 -0
- package/dist/arcade/url.d.ts +68 -0
- package/dist/arcade/url.js +28 -0
- package/dist/arcade/url.js.map +1 -0
- package/dist/arcade-runtime-url-BW-MUAOY.d.cts +28 -0
- package/dist/arcade-runtime-url-l8qj01Pg.d.ts +28 -0
- package/dist/arcade-surface-identity-CQxDpn_w.d.cts +16 -0
- package/dist/arcade-surface-identity-CQxDpn_w.d.ts +16 -0
- package/dist/arcade.cjs +1565 -0
- package/dist/arcade.cjs.map +1 -0
- package/dist/arcade.d.cts +18 -0
- package/dist/arcade.d.ts +18 -0
- package/dist/arcade.js +122 -0
- package/dist/arcade.js.map +1 -0
- package/dist/capabilities.cjs +39 -0
- package/dist/capabilities.cjs.map +1 -0
- package/dist/capabilities.d.cts +31 -0
- package/dist/capabilities.d.ts +31 -0
- package/dist/capabilities.js +12 -0
- package/dist/capabilities.js.map +1 -0
- package/dist/chunk-2432OL7L.js +193 -0
- package/dist/chunk-2432OL7L.js.map +1 -0
- package/dist/chunk-2J65FXEP.js +41 -0
- package/dist/chunk-2J65FXEP.js.map +1 -0
- package/dist/chunk-32NYL7XI.js +539 -0
- package/dist/chunk-32NYL7XI.js.map +1 -0
- package/dist/chunk-3USU7GY2.js +54 -0
- package/dist/chunk-3USU7GY2.js.map +1 -0
- package/dist/chunk-BE6Z4SIT.js +65 -0
- package/dist/chunk-BE6Z4SIT.js.map +1 -0
- package/dist/chunk-CQUG24WX.js +249 -0
- package/dist/chunk-CQUG24WX.js.map +1 -0
- package/dist/chunk-D3X4MN4U.js +288 -0
- package/dist/chunk-D3X4MN4U.js.map +1 -0
- package/dist/chunk-EVZJA6RN.js +140 -0
- package/dist/chunk-EVZJA6RN.js.map +1 -0
- package/dist/chunk-HFWRZVZ3.js +1438 -0
- package/dist/chunk-HFWRZVZ3.js.map +1 -0
- package/dist/chunk-IKKDONQL.js +1 -0
- package/dist/chunk-IKKDONQL.js.map +1 -0
- package/dist/chunk-JTF47B56.js +1 -0
- package/dist/chunk-JTF47B56.js.map +1 -0
- package/dist/chunk-LIXPF4P6.js +22 -0
- package/dist/chunk-LIXPF4P6.js.map +1 -0
- package/dist/chunk-MKBASO6X.js +216 -0
- package/dist/chunk-MKBASO6X.js.map +1 -0
- package/dist/chunk-MPDMJIX5.js +1 -0
- package/dist/chunk-MPDMJIX5.js.map +1 -0
- package/dist/chunk-NCL6WJCL.js +91 -0
- package/dist/chunk-NCL6WJCL.js.map +1 -0
- package/dist/chunk-NU5W6VAV.js +126 -0
- package/dist/chunk-NU5W6VAV.js.map +1 -0
- package/dist/chunk-TGRTEWYV.js +195 -0
- package/dist/chunk-TGRTEWYV.js.map +1 -0
- package/dist/chunk-VDRNNGHX.js +184 -0
- package/dist/chunk-VDRNNGHX.js.map +1 -0
- package/dist/chunk-VN5LDWVN.js +32 -0
- package/dist/chunk-VN5LDWVN.js.map +1 -0
- package/dist/chunk-W2VK36RO.js +11 -0
- package/dist/chunk-W2VK36RO.js.map +1 -0
- package/dist/chunk-X24K52DG.js +12 -0
- package/dist/chunk-X24K52DG.js.map +1 -0
- package/dist/chunk-XLUWV45V.js +25 -0
- package/dist/chunk-XLUWV45V.js.map +1 -0
- package/dist/chunk-Y4RAPKKB.js +238 -0
- package/dist/chunk-Y4RAPKKB.js.map +1 -0
- package/dist/chunk-YXHH3MQT.js +230 -0
- package/dist/chunk-YXHH3MQT.js.map +1 -0
- package/dist/chunk-ZLPL2R3R.js +183 -0
- package/dist/chunk-ZLPL2R3R.js.map +1 -0
- package/dist/chunk-ZTQ5SP4H.js +9 -0
- package/dist/chunk-ZTQ5SP4H.js.map +1 -0
- package/dist/controller-Bod8YYr1.d.cts +172 -0
- package/dist/controller-DxVchfiA.d.ts +172 -0
- package/dist/dev-log-events-CVAM29hx.d.cts +123 -0
- package/dist/dev-log-events-CVAM29hx.d.ts +123 -0
- package/dist/handshake-CC_LrK5g.d.cts +31 -0
- package/dist/handshake-CC_LrK5g.d.ts +31 -0
- package/dist/host-8hmq_Sgc.d.cts +109 -0
- package/dist/host-Cw-N6e-5.d.ts +109 -0
- package/dist/index.cjs +8512 -3518
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +676 -1070
- package/dist/index.d.ts +676 -1070
- package/dist/index.js +4892 -3188
- package/dist/index.js.map +1 -1
- package/dist/metadata.cjs +114 -0
- package/dist/metadata.cjs.map +1 -0
- package/dist/metadata.d.cts +95 -0
- package/dist/metadata.d.ts +95 -0
- package/dist/metadata.js +83 -0
- package/dist/metadata.js.map +1 -0
- package/dist/notices-CnGaaS8B.d.ts +38 -0
- package/dist/notices-NyDM5Mtz.d.cts +38 -0
- package/dist/platform-machine.cjs +425 -0
- package/dist/platform-machine.cjs.map +1 -0
- package/dist/platform-machine.d.cts +1183 -0
- package/dist/platform-machine.d.ts +1183 -0
- package/dist/platform-machine.js +309 -0
- package/dist/platform-machine.js.map +1 -0
- package/dist/platform-settings-cuor3i11.d.cts +48 -0
- package/dist/platform-settings-cuor3i11.d.ts +48 -0
- package/dist/prefabs.cjs +36 -0
- package/dist/prefabs.cjs.map +1 -0
- package/dist/prefabs.d.cts +49 -0
- package/dist/prefabs.d.ts +49 -0
- package/dist/prefabs.js +8 -0
- package/dist/prefabs.js.map +1 -0
- package/dist/preview.cjs +2609 -0
- package/dist/preview.cjs.map +1 -0
- package/dist/preview.d.cts +155 -0
- package/dist/preview.d.ts +155 -0
- package/dist/preview.js +1671 -0
- package/dist/preview.js.map +1 -0
- package/dist/protocol.cjs +621 -54
- package/dist/protocol.cjs.map +1 -1
- package/dist/protocol.d.cts +76 -240
- package/dist/protocol.d.ts +76 -240
- package/dist/protocol.js +100 -2
- package/dist/protocol.js.map +1 -1
- package/dist/realtime-client-Cu8yVJFw.d.cts +15 -0
- package/dist/realtime-client-Cu8yVJFw.d.ts +15 -0
- package/dist/release.cjs +143 -0
- package/dist/release.cjs.map +1 -0
- package/dist/release.d.cts +64 -0
- package/dist/release.d.ts +64 -0
- package/dist/release.js +43 -0
- package/dist/release.js.map +1 -0
- package/dist/standard-match-phase-BucA5dYo.d.ts +44 -0
- package/dist/standard-match-phase-U2ra8J-0.d.cts +44 -0
- package/dist/sync-B6QsNrXz.d.cts +125 -0
- package/dist/sync-B6QsNrXz.d.ts +125 -0
- package/dist/ui.cjs +2827 -0
- package/dist/ui.cjs.map +1 -0
- package/dist/ui.d.cts +320 -0
- package/dist/ui.d.ts +320 -0
- package/dist/ui.js +1718 -0
- package/dist/ui.js.map +1 -0
- package/dist/url-policy-C89zxgw9.d.cts +9 -0
- package/dist/url-policy-C89zxgw9.d.ts +9 -0
- package/package.json +154 -13
- package/src/agent/agent-action.ts +304 -0
- package/src/agent/agent-contract.ts +180 -0
- package/src/agent-tooling.ts +20 -0
- package/src/arcade/bridge/controller.ts +15 -0
- package/src/arcade/bridge/host.ts +12 -0
- package/src/arcade/bridge/iframe.ts +61 -0
- package/src/arcade/bridge.ts +3 -0
- package/src/arcade/host.ts +1 -0
- package/src/arcade/surface.ts +4 -0
- package/src/arcade/url.ts +60 -0
- package/src/arcade.ts +4 -0
- package/src/audio/audio-manager.ts +162 -171
- package/src/audio/hooks.tsx +218 -97
- package/src/audio/index.ts +1 -1
- package/src/audio/music.tsx +139 -0
- package/src/capabilities/manifest.ts +71 -0
- package/src/capabilities.ts +12 -0
- package/src/components/connection-status-pill.tsx +55 -0
- package/src/components/controller-player-name-field.tsx +119 -0
- package/src/components/controller-primary-action.tsx +58 -0
- package/src/components/host-mute-button.tsx +49 -0
- package/src/components/join-qr-overlay.tsx +133 -0
- package/src/components/join-url-action-buttons.tsx +95 -0
- package/src/components/join-url-controls.tsx +58 -0
- package/src/components/join-url-field.tsx +52 -0
- package/src/components/lifecycle-action-group.tsx +129 -0
- package/src/components/player-avatar-strip.tsx +65 -0
- package/src/components/player-avatar.tsx +42 -14
- package/src/components/room-qr-code.tsx +125 -0
- package/src/components/runtime-shell-header.tsx +37 -0
- package/src/components/shell-classes.ts +19 -0
- package/src/components/surface-orientation-layout.ts +60 -0
- package/src/components/surface-viewport-layout.ts +268 -0
- package/src/components/surface-viewport.tsx +314 -0
- package/src/components/ui/button.tsx +4 -6
- package/src/components/ui/slider.tsx +1 -1
- package/src/components/volume-controls.tsx +65 -6
- package/src/context/air-jam-context.tsx +209 -141
- package/src/context/index.ts +2 -2
- package/src/context/session-providers.tsx +77 -0
- package/src/context/session-scope.ts +64 -0
- package/src/context/socket-manager.ts +6 -25
- package/src/contracts/v2/bridge.ts +261 -0
- package/src/contracts/v2/handshake.ts +40 -0
- package/src/contracts/v2/index.ts +2 -0
- package/src/dev/browser-log-sink.ts +912 -0
- package/src/diagnostics.ts +128 -0
- package/src/events.ts +7 -34
- package/src/hooks/internal/use-controller-runtime-api.ts +875 -0
- package/src/hooks/internal/use-host-runtime-api.ts +1051 -0
- package/src/hooks/internal/use-runtime-control-contract.ts +15 -0
- package/src/hooks/internal/use-runtime-inspection-contract.ts +16 -0
- package/src/hooks/internal/use-runtime-observability-contract.ts +24 -0
- package/src/hooks/use-air-jam-controller.ts +155 -475
- package/src/hooks/use-air-jam-host.ts +156 -485
- package/src/hooks/use-connection-status.ts +8 -0
- package/src/hooks/use-controller-lifecycle-intents.ts +27 -0
- package/src/hooks/use-controller-lifecycle-permissions.ts +36 -0
- package/src/hooks/use-controller-shell-status.ts +40 -0
- package/src/hooks/use-controller-tick.ts +65 -0
- package/src/hooks/use-controller-toasts.ts +116 -0
- package/src/hooks/use-get-input.ts +8 -5
- package/src/hooks/use-host-arcade-restore.ts +30 -0
- package/src/hooks/use-host-join-controls.ts +152 -0
- package/src/hooks/use-host-tick.ts +171 -0
- package/src/hooks/use-input-writer.ts +83 -0
- package/src/hooks/use-lifecycle-action-group-model.ts +98 -0
- package/src/hooks/use-players.ts +12 -0
- package/src/hooks/use-room.ts +22 -0
- package/src/hooks/use-send-signal.ts +6 -2
- package/src/index.ts +205 -31
- package/src/internal/input-manager.ts +195 -215
- package/src/lifecycle/index.ts +9 -0
- package/src/lifecycle/standard-match-phase.ts +32 -0
- package/src/metadata/manifest.ts +152 -0
- package/src/metadata.ts +12 -0
- package/src/platform-machine.ts +475 -0
- package/src/prefabs/types.ts +82 -0
- package/src/prefabs.ts +12 -0
- package/src/preview/host-workspace.tsx +59 -0
- package/src/preview/identity.ts +66 -0
- package/src/preview/layout.ts +223 -0
- package/src/preview/manager.ts +577 -0
- package/src/preview/messages.ts +26 -0
- package/src/preview/ownership.ts +81 -0
- package/src/preview/url.ts +117 -0
- package/src/preview/window.tsx +490 -0
- package/src/preview/workspace.tsx +678 -0
- package/src/preview.ts +42 -0
- package/src/protocol/arcade-platform-actions.ts +29 -0
- package/src/protocol/controller.ts +187 -0
- package/src/protocol/core.ts +23 -0
- package/src/protocol/dev-log-events.ts +222 -0
- package/src/protocol/errors.ts +21 -0
- package/src/protocol/host-grant.ts +185 -0
- package/src/protocol/host.ts +138 -0
- package/src/protocol/notices.ts +43 -0
- package/src/protocol/signals.ts +38 -0
- package/src/protocol/socket-events.ts +154 -0
- package/src/protocol/sync.ts +121 -0
- package/src/protocol/url-policy.ts +63 -0
- package/src/protocol.ts +12 -386
- package/src/qrcode.d.ts +16 -0
- package/src/release.ts +99 -0
- package/src/runtime/air-jam-config.ts +287 -0
- package/src/runtime/air-jam-error-boundary.tsx +672 -0
- package/src/runtime/arcade-bridge-request-surface.ts +15 -0
- package/src/runtime/arcade-runtime-url.ts +95 -0
- package/src/runtime/arcade-surface-identity.ts +16 -0
- package/src/runtime/contracts/control.ts +68 -0
- package/src/runtime/contracts/inspection.ts +165 -0
- package/src/runtime/contracts/observability.ts +94 -0
- package/src/runtime/controller-bridge.ts +451 -0
- package/src/runtime/controller-identity.ts +132 -0
- package/src/runtime/controller-presentation.ts +24 -0
- package/src/runtime/controller-realtime-client.ts +591 -0
- package/src/runtime/create-air-jam-app.tsx +260 -0
- package/src/runtime/dev-runtime-events.ts +36 -0
- package/src/runtime/embedded-runtime-adapters.ts +68 -0
- package/src/runtime/host-bridge.ts +388 -0
- package/src/runtime/host-realtime-client.ts +550 -0
- package/src/runtime/iframe-bridge.ts +135 -0
- package/src/runtime/realtime-client.ts +20 -0
- package/src/runtime/router-basename.ts +25 -0
- package/src/runtime/runtime-owner-contexts.tsx +4 -0
- package/src/runtime/runtime-session-params.ts +169 -0
- package/src/runtime/sdk-version.ts +6 -0
- package/src/runtime/session-runtimes.tsx +188 -0
- package/src/runtime/validate-arcade-bridge-attach.ts +14 -0
- package/src/runtime-control.ts +10 -0
- package/src/runtime-inspection.ts +14 -0
- package/src/runtime-observability.ts +9 -0
- package/src/settings/platform-settings-bridge.ts +336 -0
- package/src/settings/platform-settings-runtime.tsx +387 -0
- package/src/settings/platform-settings.ts +288 -0
- package/src/state/connection-store.ts +80 -12
- package/src/store/air-jam-store-domain-constants.ts +4 -0
- package/src/store/create-air-jam-store.ts +1094 -227
- package/src/styles.css +4 -38
- package/src/ui.ts +29 -0
- package/src/utils/is-rpc-serializable.ts +56 -0
- package/src/utils/player-avatar-url.ts +48 -0
- package/src/utils/url-builder.ts +7 -0
- package/dist/.tsbuildinfo +0 -1
- package/dist/chunk-B5DURUWT.js +0 -80
- package/dist/chunk-B5DURUWT.js.map +0 -1
- package/src/AirJamClient.ts +0 -224
- package/src/audio/volume-store.ts +0 -124
- package/src/components/controller-shell.tsx +0 -346
- package/src/components/host-shell.tsx +0 -521
- package/src/components/qr-scanner-dialog.tsx +0 -373
- package/src/components/ui/alert.tsx +0 -66
- package/src/components/ui/avatar.tsx +0 -46
- package/src/components/ui/badge.tsx +0 -47
- package/src/components/ui/card.tsx +0 -92
- package/src/components/ui/dialog.tsx +0 -122
- package/src/components/ui/tabs.tsx +0 -64
- package/src/hooks/use-air-jam-shell.ts +0 -379
- package/src/hooks/use-fullscreen.ts +0 -108
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
|
|
3
|
+
const ALLOWED_RUNTIME_PROTOCOLS = new Set(["http:", "https:"]);
|
|
4
|
+
|
|
5
|
+
const parseRuntimeUrl = (value: string): URL | null => {
|
|
6
|
+
try {
|
|
7
|
+
const parsed = new URL(value);
|
|
8
|
+
if (!ALLOWED_RUNTIME_PROTOCOLS.has(parsed.protocol)) {
|
|
9
|
+
return null;
|
|
10
|
+
}
|
|
11
|
+
if (parsed.username || parsed.password) {
|
|
12
|
+
return null;
|
|
13
|
+
}
|
|
14
|
+
return parsed;
|
|
15
|
+
} catch {
|
|
16
|
+
return null;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const normalizeRuntimeUrl = (value: string): string | null => {
|
|
21
|
+
const parsed = parseRuntimeUrl(value);
|
|
22
|
+
return parsed ? parsed.toString() : null;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const getRuntimeUrlOrigin = (value: string): string | null => {
|
|
26
|
+
const parsed = parseRuntimeUrl(value);
|
|
27
|
+
return parsed ? parsed.origin : null;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const runtimeUrlSchema = z
|
|
31
|
+
.string()
|
|
32
|
+
.trim()
|
|
33
|
+
.min(1)
|
|
34
|
+
.refine((value) => parseRuntimeUrl(value) !== null, {
|
|
35
|
+
message: "URL must be a valid http(s) URL without embedded credentials.",
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const appendRuntimeQueryParams = (
|
|
39
|
+
baseUrl: string,
|
|
40
|
+
params: Record<string, string | null | undefined>,
|
|
41
|
+
): string | null => {
|
|
42
|
+
const parsed = parseRuntimeUrl(baseUrl);
|
|
43
|
+
if (!parsed) {
|
|
44
|
+
return null;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
for (const [key, value] of Object.entries(params)) {
|
|
48
|
+
if (value === undefined || value === null || value === "") {
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
parsed.searchParams.set(key, value);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return parsed.toString();
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const isTrustedRuntimeMessageOrigin = (
|
|
58
|
+
runtimeUrl: string,
|
|
59
|
+
messageOrigin: string,
|
|
60
|
+
): boolean => {
|
|
61
|
+
const runtimeOrigin = getRuntimeUrlOrigin(runtimeUrl);
|
|
62
|
+
return runtimeOrigin !== null && runtimeOrigin === messageOrigin;
|
|
63
|
+
};
|
package/src/protocol.ts
CHANGED
|
@@ -1,386 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
export type RunMode = "standalone" | "platform";
|
|
15
|
-
|
|
16
|
-
export type GameState = "paused" | "playing";
|
|
17
|
-
|
|
18
|
-
export const roomCodeSchema = z
|
|
19
|
-
.string()
|
|
20
|
-
.trim()
|
|
21
|
-
.min(4)
|
|
22
|
-
.max(8)
|
|
23
|
-
.regex(/^[A-Z0-9]+$/, { message: "room code must contain only A-Z or 0-9" });
|
|
24
|
-
|
|
25
|
-
export const controllerInputSchema = z.object({
|
|
26
|
-
roomId: roomCodeSchema,
|
|
27
|
-
controllerId: z.string().min(3),
|
|
28
|
-
input: z.record(z.string(), z.unknown()), // Arbitrary JSON object - developers define their own structure
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
export type ControllerInputPayload = Record<string, unknown>;
|
|
32
|
-
|
|
33
|
-
export interface ControllerInputEvent {
|
|
34
|
-
roomId: RoomCode;
|
|
35
|
-
controllerId: string;
|
|
36
|
-
input: ControllerInputPayload;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
export const controllerStateSchema = z.object({
|
|
40
|
-
roomId: roomCodeSchema,
|
|
41
|
-
state: z.object({
|
|
42
|
-
orientation: z.enum(["portrait", "landscape"]).optional(),
|
|
43
|
-
message: z.string().optional(),
|
|
44
|
-
gameState: z.enum(["paused", "playing"]).optional(),
|
|
45
|
-
}),
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
export type ControllerStateMessage = z.infer<typeof controllerStateSchema>;
|
|
49
|
-
|
|
50
|
-
export type ControllerStatePayload = z.infer<
|
|
51
|
-
typeof controllerStateSchema
|
|
52
|
-
>["state"];
|
|
53
|
-
|
|
54
|
-
export const hostRegistrationSchema = z.object({
|
|
55
|
-
roomId: roomCodeSchema,
|
|
56
|
-
maxPlayers: z.number().int().min(1).max(16).default(8),
|
|
57
|
-
apiKey: z.string().optional(),
|
|
58
|
-
mode: z.enum(["master", "child"]).default("child"),
|
|
59
|
-
controllerUrl: z.string().url().optional(),
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
export type HostRegistrationPayload = z.infer<typeof hostRegistrationSchema>;
|
|
63
|
-
|
|
64
|
-
export const controllerJoinSchema = z.object({
|
|
65
|
-
roomId: roomCodeSchema,
|
|
66
|
-
controllerId: z.string().min(3),
|
|
67
|
-
nickname: z.string().trim().min(1).max(24).optional(),
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
export type ControllerJoinPayload = z.infer<typeof controllerJoinSchema>;
|
|
71
|
-
|
|
72
|
-
export const controllerLeaveSchema = z.object({
|
|
73
|
-
roomId: roomCodeSchema,
|
|
74
|
-
controllerId: z.string().min(3),
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
export type ControllerLeavePayload = z.infer<typeof controllerLeaveSchema>;
|
|
78
|
-
|
|
79
|
-
export interface PlayerProfile {
|
|
80
|
-
id: string;
|
|
81
|
-
label: string;
|
|
82
|
-
color?: string;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export interface HostRegistrationAck {
|
|
86
|
-
ok: boolean;
|
|
87
|
-
roomId?: RoomCode;
|
|
88
|
-
message?: string;
|
|
89
|
-
code?: ErrorCode | string;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
export interface ControllerJoinAck {
|
|
93
|
-
ok: boolean;
|
|
94
|
-
controllerId?: string;
|
|
95
|
-
roomId?: RoomCode;
|
|
96
|
-
message?: string;
|
|
97
|
-
code?: ErrorCode | string;
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
export const controllerSystemSchema = z.object({
|
|
101
|
-
roomId: roomCodeSchema,
|
|
102
|
-
command: z.enum(["exit", "ready", "toggle_pause"]),
|
|
103
|
-
});
|
|
104
|
-
|
|
105
|
-
export type ControllerSystemPayload = z.infer<typeof controllerSystemSchema>;
|
|
106
|
-
|
|
107
|
-
/**
|
|
108
|
-
* Standard error codes for Air Jam
|
|
109
|
-
*/
|
|
110
|
-
export enum ErrorCode {
|
|
111
|
-
// Room errors
|
|
112
|
-
ROOM_NOT_FOUND = "ROOM_NOT_FOUND",
|
|
113
|
-
ROOM_FULL = "ROOM_FULL",
|
|
114
|
-
|
|
115
|
-
// Auth errors
|
|
116
|
-
INVALID_API_KEY = "INVALID_API_KEY",
|
|
117
|
-
UNAUTHORIZED = "UNAUTHORIZED",
|
|
118
|
-
|
|
119
|
-
// Token errors
|
|
120
|
-
INVALID_TOKEN = "INVALID_TOKEN",
|
|
121
|
-
TOKEN_EXPIRED = "TOKEN_EXPIRED",
|
|
122
|
-
|
|
123
|
-
// Connection errors
|
|
124
|
-
CONNECTION_FAILED = "CONNECTION_FAILED",
|
|
125
|
-
ALREADY_CONNECTED = "ALREADY_CONNECTED",
|
|
126
|
-
|
|
127
|
-
// Validation errors
|
|
128
|
-
INVALID_PAYLOAD = "INVALID_PAYLOAD",
|
|
129
|
-
INVALID_ROOM_CODE = "INVALID_ROOM_CODE",
|
|
130
|
-
|
|
131
|
-
// Server errors
|
|
132
|
-
INTERNAL_SERVER_ERROR = "INTERNAL_SERVER_ERROR",
|
|
133
|
-
SERVICE_UNAVAILABLE = "SERVICE_UNAVAILABLE",
|
|
134
|
-
|
|
135
|
-
// Generic
|
|
136
|
-
UNKNOWN_ERROR = "UNKNOWN_ERROR",
|
|
137
|
-
}
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Standardized error payload
|
|
141
|
-
*/
|
|
142
|
-
export interface ServerErrorPayload {
|
|
143
|
-
code: ErrorCode | string; // Allow custom codes
|
|
144
|
-
message: string;
|
|
145
|
-
details?: unknown;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
export interface ControllerWelcomePayload {
|
|
149
|
-
controllerId: string;
|
|
150
|
-
roomId: RoomCode;
|
|
151
|
-
player?: PlayerProfile;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
export interface ControllerJoinedNotice {
|
|
155
|
-
controllerId: string;
|
|
156
|
-
nickname?: string;
|
|
157
|
-
player?: PlayerProfile;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export interface ControllerLeftNotice {
|
|
161
|
-
controllerId: string;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
export interface RoomReadyNotice {
|
|
165
|
-
roomId: RoomCode;
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export interface HostLeftNotice {
|
|
169
|
-
roomId: RoomCode;
|
|
170
|
-
reason: string;
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
export type SignalType = "HAPTIC" | "TOAST";
|
|
174
|
-
|
|
175
|
-
export interface HapticSignalPayload {
|
|
176
|
-
pattern: "light" | "medium" | "heavy" | "success" | "failure" | "custom";
|
|
177
|
-
sequence?: number | number[];
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
export interface ToastSignalPayload {
|
|
181
|
-
message: string;
|
|
182
|
-
color?: string;
|
|
183
|
-
duration?: number;
|
|
184
|
-
}
|
|
185
|
-
|
|
186
|
-
export type SignalPayload =
|
|
187
|
-
| {
|
|
188
|
-
targetId?: string;
|
|
189
|
-
type: "HAPTIC";
|
|
190
|
-
payload: HapticSignalPayload;
|
|
191
|
-
}
|
|
192
|
-
| {
|
|
193
|
-
targetId?: string;
|
|
194
|
-
type: "TOAST";
|
|
195
|
-
payload: ToastSignalPayload;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
export interface PlaySoundEventPayload {
|
|
199
|
-
roomId: string;
|
|
200
|
-
targetControllerId?: string; // If null, broadcast to all
|
|
201
|
-
soundId: string;
|
|
202
|
-
volume?: number;
|
|
203
|
-
loop?: boolean;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
export const hostRegisterSystemSchema = z.object({
|
|
207
|
-
roomId: roomCodeSchema,
|
|
208
|
-
apiKey: z.string().optional(),
|
|
209
|
-
});
|
|
210
|
-
|
|
211
|
-
export type HostRegisterSystemPayload = z.infer<
|
|
212
|
-
typeof hostRegisterSystemSchema
|
|
213
|
-
>;
|
|
214
|
-
|
|
215
|
-
export const systemLaunchGameSchema = z.object({
|
|
216
|
-
roomId: roomCodeSchema,
|
|
217
|
-
gameId: z.string(),
|
|
218
|
-
gameUrl: z.string().url(),
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
export type SystemLaunchGamePayload = z.infer<typeof systemLaunchGameSchema>;
|
|
222
|
-
|
|
223
|
-
export const hostJoinAsChildSchema = z.object({
|
|
224
|
-
roomId: roomCodeSchema,
|
|
225
|
-
joinToken: z.string(),
|
|
226
|
-
});
|
|
227
|
-
|
|
228
|
-
export type HostJoinAsChildPayload = z.infer<typeof hostJoinAsChildSchema>;
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* Schema for creating a new room (server-issued room ID)
|
|
232
|
-
*/
|
|
233
|
-
export const hostCreateRoomSchema = z.object({
|
|
234
|
-
maxPlayers: z.number().int().min(1).max(16).default(8),
|
|
235
|
-
apiKey: z.string().optional(),
|
|
236
|
-
});
|
|
237
|
-
|
|
238
|
-
export type HostCreateRoomPayload = z.infer<typeof hostCreateRoomSchema>;
|
|
239
|
-
|
|
240
|
-
/**
|
|
241
|
-
* Schema for reconnecting to an existing room
|
|
242
|
-
*/
|
|
243
|
-
export const hostReconnectSchema = z.object({
|
|
244
|
-
roomId: roomCodeSchema,
|
|
245
|
-
apiKey: z.string().optional(),
|
|
246
|
-
});
|
|
247
|
-
|
|
248
|
-
export type HostReconnectPayload = z.infer<typeof hostReconnectSchema>;
|
|
249
|
-
|
|
250
|
-
export interface SystemLaunchGameAck {
|
|
251
|
-
ok: boolean;
|
|
252
|
-
joinToken?: string;
|
|
253
|
-
message?: string;
|
|
254
|
-
code?: ErrorCode | string;
|
|
255
|
-
}
|
|
256
|
-
|
|
257
|
-
export interface ClientLoadUiPayload {
|
|
258
|
-
url: string;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
export interface HostStateSyncPayload {
|
|
262
|
-
roomId: string;
|
|
263
|
-
data: Record<string, unknown>;
|
|
264
|
-
}
|
|
265
|
-
|
|
266
|
-
export interface ControllerActionRpcPayload {
|
|
267
|
-
roomId: string;
|
|
268
|
-
actionName: string;
|
|
269
|
-
args: unknown[];
|
|
270
|
-
controllerId: string;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
export interface AirJamStateSyncPayload {
|
|
274
|
-
roomId: string;
|
|
275
|
-
data: Record<string, unknown>;
|
|
276
|
-
}
|
|
277
|
-
|
|
278
|
-
export interface AirJamActionRpcPayload {
|
|
279
|
-
actionName: string;
|
|
280
|
-
args: unknown[];
|
|
281
|
-
controllerId: string;
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export interface ClientToServerEvents {
|
|
285
|
-
"host:register": (
|
|
286
|
-
payload: z.infer<typeof hostRegistrationSchema>,
|
|
287
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
288
|
-
) => void;
|
|
289
|
-
"host:registerSystem": (
|
|
290
|
-
payload: HostRegisterSystemPayload,
|
|
291
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
292
|
-
) => void;
|
|
293
|
-
"host:createRoom": (
|
|
294
|
-
payload: HostCreateRoomPayload,
|
|
295
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
296
|
-
) => void;
|
|
297
|
-
"host:reconnect": (
|
|
298
|
-
payload: HostReconnectPayload,
|
|
299
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
300
|
-
) => void;
|
|
301
|
-
"system:launchGame": (
|
|
302
|
-
payload: SystemLaunchGamePayload,
|
|
303
|
-
callback: (ack: SystemLaunchGameAck) => void,
|
|
304
|
-
) => void;
|
|
305
|
-
"host:joinAsChild": (
|
|
306
|
-
payload: HostJoinAsChildPayload,
|
|
307
|
-
callback: (ack: HostRegistrationAck) => void,
|
|
308
|
-
) => void;
|
|
309
|
-
"system:closeGame": (payload: { roomId: string }) => void;
|
|
310
|
-
"host:state": (payload: z.infer<typeof controllerStateSchema>) => void;
|
|
311
|
-
"controller:join": (
|
|
312
|
-
payload: z.infer<typeof controllerJoinSchema>,
|
|
313
|
-
callback: (ack: ControllerJoinAck) => void,
|
|
314
|
-
) => void;
|
|
315
|
-
"controller:leave": (payload: z.infer<typeof controllerLeaveSchema>) => void;
|
|
316
|
-
"controller:input": (payload: z.infer<typeof controllerInputSchema>) => void;
|
|
317
|
-
"controller:system": (
|
|
318
|
-
payload: z.infer<typeof controllerSystemSchema>,
|
|
319
|
-
) => void;
|
|
320
|
-
"host:system": (payload: z.infer<typeof controllerSystemSchema>) => void;
|
|
321
|
-
"host:signal": (payload: SignalPayload) => void;
|
|
322
|
-
"host:play_sound": (payload: PlaySoundEventPayload) => void;
|
|
323
|
-
"controller:play_sound": (payload: PlaySoundEventPayload) => void;
|
|
324
|
-
"host:state_sync": (payload: HostStateSyncPayload) => void;
|
|
325
|
-
"controller:action_rpc": (payload: ControllerActionRpcPayload) => void;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
export interface PlaySoundPayload {
|
|
329
|
-
id: string;
|
|
330
|
-
volume?: number;
|
|
331
|
-
loop?: boolean;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export interface ServerToClientEvents {
|
|
335
|
-
"server:roomReady": (payload: RoomReadyNotice) => void;
|
|
336
|
-
"server:controllerJoined": (payload: ControllerJoinedNotice) => void;
|
|
337
|
-
"server:controllerLeft": (payload: ControllerLeftNotice) => void;
|
|
338
|
-
"server:input": (payload: ControllerInputEvent) => void;
|
|
339
|
-
"server:error": (payload: ServerErrorPayload) => void;
|
|
340
|
-
"server:state": (payload: z.infer<typeof controllerStateSchema>) => void;
|
|
341
|
-
"server:welcome": (payload: ControllerWelcomePayload) => void;
|
|
342
|
-
"server:hostLeft": (payload: HostLeftNotice) => void;
|
|
343
|
-
"server:signal": (payload: SignalPayload) => void;
|
|
344
|
-
"server:playSound": (payload: PlaySoundPayload) => void;
|
|
345
|
-
"server:redirect": (url: string) => void;
|
|
346
|
-
"server:closeChild": () => void;
|
|
347
|
-
"client:loadUi": (payload: ClientLoadUiPayload) => void;
|
|
348
|
-
"client:unloadUi": () => void;
|
|
349
|
-
"airjam:state_sync": (payload: AirJamStateSyncPayload) => void;
|
|
350
|
-
"airjam:action_rpc": (payload: AirJamActionRpcPayload) => void;
|
|
351
|
-
}
|
|
352
|
-
|
|
353
|
-
export interface InterServerEvents {
|
|
354
|
-
ping: () => void;
|
|
355
|
-
}
|
|
356
|
-
|
|
357
|
-
export type SocketData = Record<string, unknown>;
|
|
358
|
-
|
|
359
|
-
// --- Proxy Protocol (iframe <-> parent) ---
|
|
360
|
-
// Note: Proxy protocol is largely deprecated in favor of Direct Connect (airjam_force_connect=true),
|
|
361
|
-
// but might still be used for UI coordination (e.g. hiding headers).
|
|
362
|
-
|
|
363
|
-
export const AIRJAM_PROXY_PREFIX = "AIRJAM_";
|
|
364
|
-
|
|
365
|
-
export interface ProxyMessageBase {
|
|
366
|
-
type: string;
|
|
367
|
-
}
|
|
368
|
-
|
|
369
|
-
export interface ProxyReadyMessage extends ProxyMessageBase {
|
|
370
|
-
type: "AIRJAM_READY";
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
export interface ProxyInputMessage extends ProxyMessageBase {
|
|
374
|
-
type: "AIRJAM_INPUT";
|
|
375
|
-
payload: ControllerInputPayload;
|
|
376
|
-
}
|
|
377
|
-
|
|
378
|
-
export interface ProxyStateMessage extends ProxyMessageBase {
|
|
379
|
-
type: "AIRJAM_STATE";
|
|
380
|
-
payload: ControllerStatePayload;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
export type AirJamProxyMessage =
|
|
384
|
-
| ProxyReadyMessage
|
|
385
|
-
| ProxyInputMessage
|
|
386
|
-
| ProxyStateMessage;
|
|
1
|
+
export * from "./protocol/arcade-platform-actions";
|
|
2
|
+
export * from "./protocol/controller";
|
|
3
|
+
export * from "./protocol/core";
|
|
4
|
+
export * from "./protocol/dev-log-events";
|
|
5
|
+
export * from "./protocol/errors";
|
|
6
|
+
export * from "./protocol/host";
|
|
7
|
+
export * from "./protocol/host-grant";
|
|
8
|
+
export * from "./protocol/notices";
|
|
9
|
+
export * from "./protocol/signals";
|
|
10
|
+
export * from "./protocol/socket-events";
|
|
11
|
+
export * from "./protocol/sync";
|
|
12
|
+
export * from "./protocol/url-policy";
|
package/src/qrcode.d.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
declare module "qrcode" {
|
|
2
|
+
export interface QRCodeToDataURLOptions {
|
|
3
|
+
width?: number;
|
|
4
|
+
margin?: number;
|
|
5
|
+
errorCorrectionLevel?: "L" | "M" | "Q" | "H";
|
|
6
|
+
color?: {
|
|
7
|
+
dark?: string;
|
|
8
|
+
light?: string;
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function toDataURL(
|
|
13
|
+
text: string,
|
|
14
|
+
options?: QRCodeToDataURLOptions,
|
|
15
|
+
): Promise<string>;
|
|
16
|
+
}
|
package/src/release.ts
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
|
|
4
|
+
export const gameReleaseSourceKindValues = ["upload"] as const;
|
|
5
|
+
export type GameReleaseSourceKind =
|
|
6
|
+
(typeof gameReleaseSourceKindValues)[number];
|
|
7
|
+
export const gameReleaseSourceKindSchema = z.enum(gameReleaseSourceKindValues);
|
|
8
|
+
|
|
9
|
+
export const gameReleaseStatusValues = [
|
|
10
|
+
"draft",
|
|
11
|
+
"uploading",
|
|
12
|
+
"checking",
|
|
13
|
+
"ready",
|
|
14
|
+
"live",
|
|
15
|
+
"failed",
|
|
16
|
+
"quarantined",
|
|
17
|
+
"archived",
|
|
18
|
+
] as const;
|
|
19
|
+
export type GameReleaseStatus = (typeof gameReleaseStatusValues)[number];
|
|
20
|
+
export const gameReleaseStatusSchema = z.enum(gameReleaseStatusValues);
|
|
21
|
+
|
|
22
|
+
export const releaseCheckKindValues = [
|
|
23
|
+
"artifact_validation",
|
|
24
|
+
"screenshot_capture",
|
|
25
|
+
"image_moderation",
|
|
26
|
+
] as const;
|
|
27
|
+
export type ReleaseCheckKind = (typeof releaseCheckKindValues)[number];
|
|
28
|
+
export const releaseCheckKindSchema = z.enum(releaseCheckKindValues);
|
|
29
|
+
|
|
30
|
+
export const releaseCheckStatusValues = [
|
|
31
|
+
"pending",
|
|
32
|
+
"passed",
|
|
33
|
+
"failed",
|
|
34
|
+
"warning",
|
|
35
|
+
] as const;
|
|
36
|
+
export type ReleaseCheckStatus = (typeof releaseCheckStatusValues)[number];
|
|
37
|
+
export const releaseCheckStatusSchema = z.enum(releaseCheckStatusValues);
|
|
38
|
+
|
|
39
|
+
export const releaseReportStatusValues = [
|
|
40
|
+
"open",
|
|
41
|
+
"reviewed",
|
|
42
|
+
"dismissed",
|
|
43
|
+
] as const;
|
|
44
|
+
export type ReleaseReportStatus = (typeof releaseReportStatusValues)[number];
|
|
45
|
+
export const releaseReportStatusSchema = z.enum(releaseReportStatusValues);
|
|
46
|
+
|
|
47
|
+
export const releaseReportSourceValues = ["play_page", "arcade"] as const;
|
|
48
|
+
export type ReleaseReportSource = (typeof releaseReportSourceValues)[number];
|
|
49
|
+
export const releaseReportSourceSchema = z.enum(releaseReportSourceValues);
|
|
50
|
+
|
|
51
|
+
export const HOSTED_RELEASE_ENTRY_PATH = "index.html" as const;
|
|
52
|
+
export const HOSTED_RELEASE_MANIFEST_PATH =
|
|
53
|
+
".airjam/release-manifest.json" as const;
|
|
54
|
+
export const HOSTED_RELEASE_HOST_PATH = "/" as const;
|
|
55
|
+
export const HOSTED_RELEASE_CONTROLLER_PATH = "/controller" as const;
|
|
56
|
+
|
|
57
|
+
export const hostedReleaseArtifactManifestSchema = z.object({
|
|
58
|
+
schemaVersion: z.literal(1),
|
|
59
|
+
kind: z.literal("airjam-hosted-release"),
|
|
60
|
+
routes: z.object({
|
|
61
|
+
host: z.literal(HOSTED_RELEASE_HOST_PATH),
|
|
62
|
+
controller: z.literal(HOSTED_RELEASE_CONTROLLER_PATH),
|
|
63
|
+
}),
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export type HostedReleaseArtifactManifest = z.infer<
|
|
67
|
+
typeof hostedReleaseArtifactManifestSchema
|
|
68
|
+
>;
|
|
69
|
+
|
|
70
|
+
export const createHostedReleaseArtifactManifest =
|
|
71
|
+
(): HostedReleaseArtifactManifest => ({
|
|
72
|
+
schemaVersion: 1,
|
|
73
|
+
kind: "airjam-hosted-release",
|
|
74
|
+
routes: {
|
|
75
|
+
host: HOSTED_RELEASE_HOST_PATH,
|
|
76
|
+
controller: HOSTED_RELEASE_CONTROLLER_PATH,
|
|
77
|
+
},
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
const normalizeHostedReleaseRequestPath = (value: string): string =>
|
|
81
|
+
value.replaceAll("\\", "/").replace(/^\/+/, "").replace(/\/+/g, "/").trim();
|
|
82
|
+
|
|
83
|
+
export const isHostedReleaseSpaFallbackPath = (
|
|
84
|
+
relativePath: string,
|
|
85
|
+
): boolean => {
|
|
86
|
+
const normalizedPath = normalizeHostedReleaseRequestPath(relativePath);
|
|
87
|
+
if (!normalizedPath) {
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
if (path.posix.extname(normalizedPath)) {
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
normalizedPath === HOSTED_RELEASE_CONTROLLER_PATH.slice(1) ||
|
|
97
|
+
normalizedPath.startsWith(`${HOSTED_RELEASE_CONTROLLER_PATH.slice(1)}/`)
|
|
98
|
+
);
|
|
99
|
+
};
|