@air-jam/sdk 1.0.0-beta.1 → 1.0.0-beta.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 +1 -1
- package/dist/{agent-contract-DfLm4Mf-.d.ts → agent-contract-BMvCMvhE.d.ts} +1 -1
- package/dist/{agent-contract-TINzp-5Y.d.cts → agent-contract-DtYf3ici.d.cts} +1 -1
- package/dist/agent-tooling.d.cts +2 -2
- package/dist/agent-tooling.d.ts +2 -2
- package/dist/{air-jam-context-BCVCWiaT.d.ts → air-jam-context-B1fQvyYY.d.ts} +5 -5
- package/dist/{air-jam-context-DavligpM.d.cts → air-jam-context-BKg_ujpd.d.cts} +5 -5
- package/dist/arcade/bridge/controller.d.cts +3 -3
- package/dist/arcade/bridge/controller.d.ts +3 -3
- package/dist/arcade/bridge/controller.js +2 -2
- package/dist/arcade/bridge/host.d.cts +3 -3
- package/dist/arcade/bridge/host.d.ts +3 -3
- package/dist/arcade/bridge/host.js +2 -2
- package/dist/arcade/bridge/iframe.cjs +1 -1
- package/dist/arcade/bridge/iframe.js +2 -2
- package/dist/arcade/runtime.cjs +33 -12
- package/dist/arcade/runtime.cjs.map +1 -1
- package/dist/arcade/runtime.d.cts +8 -8
- package/dist/arcade/runtime.d.ts +8 -8
- package/dist/arcade/runtime.js +11 -11
- package/dist/{chunk-EG25EXSA.js → chunk-4RJPTP5X.js} +2 -2
- package/dist/{chunk-TFW4NJW2.js → chunk-5K6FSVAL.js} +4 -4
- package/dist/{chunk-UBBP2UY3.js → chunk-A6POOENG.js} +2 -2
- package/dist/{chunk-6Y3F6Y2K.js → chunk-AXG6FA2H.js} +36 -13
- package/dist/chunk-AXG6FA2H.js.map +1 -0
- package/dist/chunk-DBLA5CB4.js +7 -0
- package/dist/{chunk-VGX2274F.js → chunk-FLIESELO.js} +3 -3
- package/dist/{chunk-VGX2274F.js.map → chunk-FLIESELO.js.map} +1 -1
- package/dist/{chunk-DHFKL3DI.js → chunk-JQKOMZGO.js} +10 -10
- package/dist/{chunk-URVBMQCK.js → chunk-LI2FTF2X.js} +2 -2
- package/dist/{chunk-S3TN7Y7L.js → chunk-NXK6BKXE.js} +2 -2
- package/dist/{chunk-SMKD4JY3.js → chunk-QXSKXQ56.js} +2 -2
- package/dist/{chunk-2QZADUGA.js → chunk-VN2PX2I3.js} +2 -2
- package/dist/{chunk-I6TSHJF7.js → chunk-VQL2ZDMW.js} +2 -2
- package/dist/{connection-store-D6QqzXU1.d.cts → connection-store-CqW-E7ma.d.cts} +1 -1
- package/dist/{connection-store-BYpQ50W2.d.ts → connection-store-ffHWMrMe.d.ts} +1 -1
- package/dist/{controller-0CVO1t_3.d.cts → controller-ClW0R8mZ.d.cts} +1 -1
- package/dist/{controller-h9M2Nngd.d.ts → controller-DRKCa7uQ.d.ts} +1 -1
- package/dist/controller-bridge.d.cts +3 -3
- package/dist/controller-bridge.d.ts +3 -3
- package/dist/controller-bridge.js +2 -2
- package/dist/core.cjs +36 -11
- package/dist/core.cjs.map +1 -1
- package/dist/core.d.cts +35 -17
- package/dist/core.d.ts +35 -17
- package/dist/core.js +7 -3
- package/dist/core.js.map +1 -1
- package/dist/{game-Db58JNk3.d.cts → game-5n-dh5np.d.cts} +5 -5
- package/dist/{game-bySEy-QO.d.ts → game-RYb97BN8.d.ts} +5 -5
- package/dist/{host-runtime-_06jpW5v.d.cts → host-runtime-BRtUidEJ.d.cts} +6 -6
- package/dist/{host-runtime-BuLhGQx5.d.ts → host-runtime-RrO4pCXI.d.ts} +6 -6
- package/dist/index.cjs +33 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +12 -12
- package/dist/{input-Xvs80gqG.d.cts → input-D7FNeehb.d.cts} +1 -1
- package/dist/{input-Xvs80gqG.d.ts → input-D7FNeehb.d.ts} +1 -1
- package/dist/{input-bindings-BgsJRLPm.d.ts → input-bindings-686sTen7.d.ts} +1 -1
- package/dist/{input-bindings-BaEFrgRb.d.cts → input-bindings-BRac-P0e.d.cts} +1 -1
- package/dist/{phone-room-session-DkPR-K6e.d.cts → phone-room-session-Byomkt92.d.cts} +1 -1
- package/dist/{phone-room-session-Ca6rlxJr.d.ts → phone-room-session-D9C8cSxS.d.ts} +1 -1
- package/dist/preview.cjs +13 -28
- package/dist/preview.cjs.map +1 -1
- package/dist/preview.d.cts +1 -1
- package/dist/preview.d.ts +1 -1
- package/dist/preview.js +6 -6
- package/dist/protocol.d.cts +1 -1
- package/dist/protocol.d.ts +1 -1
- package/dist/{replay-input-log-BvX4As2f.d.ts → replay-input-log-D0NpnA3P.d.ts} +1 -1
- package/dist/{replay-input-log-Vcl0VDIy.d.cts → replay-input-log-bg0g-PCz.d.cts} +1 -1
- package/dist/room-protocol.d.cts +1 -1
- package/dist/room-protocol.d.ts +1 -1
- package/dist/room-session.cjs +1 -1
- package/dist/room-session.d.cts +4 -4
- package/dist/room-session.d.ts +4 -4
- package/dist/room-session.js +2 -2
- package/dist/runtime-control.cjs +31 -10
- package/dist/runtime-control.cjs.map +1 -1
- package/dist/runtime-control.d.cts +9 -9
- package/dist/runtime-control.d.ts +9 -9
- package/dist/runtime-control.js +2 -2
- package/dist/runtime-inspection.d.cts +2 -2
- package/dist/runtime-inspection.d.ts +2 -2
- package/dist/{scoped-connector-D7252pn0.d.cts → scoped-connector-DEOZvCCG.d.cts} +1 -1
- package/dist/{scoped-connector-CiiWu06D.d.ts → scoped-connector-nTHACYTl.d.ts} +1 -1
- package/dist/{simulation-BfRnC4rg.d.ts → simulation-DL9j-ghn.d.ts} +3 -3
- package/dist/{simulation-BwZx2pgt.d.cts → simulation-HmgsvF5H.d.cts} +3 -3
- package/dist/ui.cjs +13 -28
- package/dist/ui.cjs.map +1 -1
- package/dist/ui.d.cts +2 -2
- package/dist/ui.d.ts +2 -2
- package/dist/ui.js +6 -6
- package/package.json +1 -1
- package/src/core/config.ts +5 -5
- package/src/core/host-runtime.ts +5 -1
- package/src/core/hosted-rooms.ts +51 -12
- package/src/core.ts +5 -0
- package/dist/chunk-5TVVPBQI.js +0 -7
- package/dist/chunk-6Y3F6Y2K.js.map +0 -1
- /package/dist/{chunk-EG25EXSA.js.map → chunk-4RJPTP5X.js.map} +0 -0
- /package/dist/{chunk-TFW4NJW2.js.map → chunk-5K6FSVAL.js.map} +0 -0
- /package/dist/{chunk-UBBP2UY3.js.map → chunk-A6POOENG.js.map} +0 -0
- /package/dist/{chunk-5TVVPBQI.js.map → chunk-DBLA5CB4.js.map} +0 -0
- /package/dist/{chunk-DHFKL3DI.js.map → chunk-JQKOMZGO.js.map} +0 -0
- /package/dist/{chunk-URVBMQCK.js.map → chunk-LI2FTF2X.js.map} +0 -0
- /package/dist/{chunk-S3TN7Y7L.js.map → chunk-NXK6BKXE.js.map} +0 -0
- /package/dist/{chunk-SMKD4JY3.js.map → chunk-QXSKXQ56.js.map} +0 -0
- /package/dist/{chunk-2QZADUGA.js.map → chunk-VN2PX2I3.js.map} +0 -0
- /package/dist/{chunk-I6TSHJF7.js.map → chunk-VQL2ZDMW.js.map} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
controllerRuntimeContext,
|
|
3
3
|
useAirJamContext,
|
|
4
4
|
useAssertSessionScope
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5K6FSVAL.js";
|
|
6
6
|
import {
|
|
7
7
|
createAirJamDiagnosticError
|
|
8
8
|
} from "./chunk-DBF7NJ3S.js";
|
|
@@ -60,4 +60,4 @@ function useAirJamController(selector) {
|
|
|
60
60
|
export {
|
|
61
61
|
useAirJamController
|
|
62
62
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
63
|
+
//# sourceMappingURL=chunk-VQL2ZDMW.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand/vanilla';
|
|
2
|
-
import { A as AirJamPlayer } from './controller-
|
|
2
|
+
import { A as AirJamPlayer } from './controller-ClW0R8mZ.cjs';
|
|
3
3
|
import { C as ConnectionRole, a as ConnectionStatus, R as RunMode } from './core-BAO0pHrJ.cjs';
|
|
4
4
|
import { R as RuntimeState, C as ControllerOrientation } from './sdk-channels-S6j6AH8v.cjs';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { StoreApi } from 'zustand/vanilla';
|
|
2
|
-
import { A as AirJamPlayer } from './controller-
|
|
2
|
+
import { A as AirJamPlayer } from './controller-DRKCa7uQ.js';
|
|
3
3
|
import { C as ConnectionRole, a as ConnectionStatus, R as RunMode } from './core-BAO0pHrJ.js';
|
|
4
4
|
import { R as RuntimeState, C as ControllerOrientation } from './sdk-channels-S6j6AH8v.js';
|
|
5
5
|
|
|
@@ -23,4 +23,4 @@ declare const playerProfilePatchSchema: z.ZodObject<{
|
|
|
23
23
|
type PlayerProfilePatch = z.infer<typeof playerProfilePatchSchema>;
|
|
24
24
|
type ControllerRoomSettingsState = RoomPlatformSettingsSnapshot;
|
|
25
25
|
|
|
26
|
-
export { type AirJamPlayer as A, type ControllerInputPayload as C, type
|
|
26
|
+
export { type AirJamPlayer as A, type ControllerInputPayload as C, type PlayerProfile as P, playerProfilePatchSchema as a, type PlayerProfilePatch as b, type ControllerRoomSettingsState as c, playerProfileSchema as p };
|
|
@@ -23,4 +23,4 @@ declare const playerProfilePatchSchema: z.ZodObject<{
|
|
|
23
23
|
type PlayerProfilePatch = z.infer<typeof playerProfilePatchSchema>;
|
|
24
24
|
type ControllerRoomSettingsState = RoomPlatformSettingsSnapshot;
|
|
25
25
|
|
|
26
|
-
export { type AirJamPlayer as A, type ControllerInputPayload as C, type
|
|
26
|
+
export { type AirJamPlayer as A, type ControllerInputPayload as C, type PlayerProfile as P, playerProfilePatchSchema as a, type PlayerProfilePatch as b, type ControllerRoomSettingsState as c, playerProfileSchema as p };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { c as createScopedPhoneConnector, s as serveRoomPort } from './scoped-connector-
|
|
1
|
+
export { c as createScopedPhoneConnector, s as serveRoomPort } from './scoped-connector-DEOZvCCG.cjs';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import './transport-CWF29jU6.cjs';
|
|
4
|
-
import './phone-room-session-
|
|
5
|
-
import './input-
|
|
4
|
+
import './phone-room-session-Byomkt92.cjs';
|
|
5
|
+
import './input-D7FNeehb.cjs';
|
|
6
6
|
import './frames-D-xKuODS.cjs';
|
|
7
7
|
|
|
8
8
|
declare const roomBridgeRequestSchema: z.ZodObject<{
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { c as createScopedPhoneConnector, s as serveRoomPort } from './scoped-connector-
|
|
1
|
+
export { c as createScopedPhoneConnector, s as serveRoomPort } from './scoped-connector-nTHACYTl.js';
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import './transport-CWF29jU6.js';
|
|
4
|
-
import './phone-room-session-
|
|
5
|
-
import './input-
|
|
4
|
+
import './phone-room-session-D9C8cSxS.js';
|
|
5
|
+
import './input-D7FNeehb.js';
|
|
6
6
|
import './frames-D-xKuODS.js';
|
|
7
7
|
|
|
8
8
|
declare const roomBridgeRequestSchema: z.ZodObject<{
|
|
@@ -4,14 +4,14 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
readRoomBridgeRequest,
|
|
6
6
|
refuseRoomBridge
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-A6POOENG.js";
|
|
8
8
|
import {
|
|
9
9
|
serveRoomPort
|
|
10
10
|
} from "./chunk-3LDQCQL2.js";
|
|
11
11
|
import "./chunk-FJ4J2BEC.js";
|
|
12
12
|
import "./chunk-MD25536W.js";
|
|
13
13
|
import "./chunk-C5GS2GMK.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-DBLA5CB4.js";
|
|
15
15
|
import "./chunk-5CRZFIN6.js";
|
|
16
16
|
import "./chunk-24NZZOIO.js";
|
|
17
17
|
export {
|
package/dist/core.cjs
CHANGED
|
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
20
20
|
// src/core.ts
|
|
21
21
|
var core_exports = {};
|
|
22
22
|
__export(core_exports, {
|
|
23
|
+
AIR_JAM_HOSTED_ENVIRONMENTS: () => AIR_JAM_HOSTED_ENVIRONMENTS,
|
|
23
24
|
AIR_JAM_INPUT_LOG_MAX_ENTRY_BYTES: () => AIR_JAM_INPUT_LOG_MAX_ENTRY_BYTES,
|
|
24
25
|
AIR_JAM_INPUT_LOG_MAX_GAME_MS: () => AIR_JAM_INPUT_LOG_MAX_GAME_MS,
|
|
25
26
|
ControllerInput: () => ControllerInput,
|
|
@@ -56,6 +57,7 @@ __export(core_exports, {
|
|
|
56
57
|
defineAirJamSimulation: () => defineAirJamSimulation,
|
|
57
58
|
defineAirJamTheme: () => defineAirJamTheme,
|
|
58
59
|
describeAirJamGame: () => describeAirJamGame,
|
|
60
|
+
findHostedEnvironment: () => findHostedEnvironment,
|
|
59
61
|
getReconnectingPlayerIds: () => getReconnectingPlayerIds,
|
|
60
62
|
isAirJamGame: () => isAirJamGame,
|
|
61
63
|
keyAxis: () => keyAxis,
|
|
@@ -460,13 +462,34 @@ var createRuntimeErrorReporter = ({
|
|
|
460
462
|
};
|
|
461
463
|
|
|
462
464
|
// src/core/hosted-rooms.ts
|
|
463
|
-
var
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
465
|
+
var AIR_JAM_HOSTED_ENVIRONMENTS = [
|
|
466
|
+
{
|
|
467
|
+
name: "production",
|
|
468
|
+
roomsOrigin: "https://rooms.airjam.io",
|
|
469
|
+
platformOrigin: "https://airjam.io"
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
name: "beta",
|
|
473
|
+
roomsOrigin: "https://rooms.beta.airjam.io",
|
|
474
|
+
platformOrigin: "https://beta.airjam.io"
|
|
475
|
+
}
|
|
476
|
+
];
|
|
477
|
+
var AIR_JAM_HOSTED_ROOMS_ORIGIN = AIR_JAM_HOSTED_ENVIRONMENTS[0].roomsOrigin;
|
|
478
|
+
var findHostedEnvironment = (roomsOrigin) => AIR_JAM_HOSTED_ENVIRONMENTS.find(
|
|
479
|
+
(environment) => environment.roomsOrigin === roomsOrigin
|
|
480
|
+
);
|
|
481
|
+
var hostedHostGrantEndpoint = (environment) => `${environment.platformOrigin}/api/airjam/host-grant`;
|
|
482
|
+
var reporters = /* @__PURE__ */ new Map();
|
|
483
|
+
var hostedRuntimeErrorReporter = (environment) => {
|
|
484
|
+
const existing = reporters.get(environment.name);
|
|
485
|
+
if (existing) return existing;
|
|
486
|
+
const reporter = createRuntimeErrorReporter({
|
|
487
|
+
endpoint: `${environment.platformOrigin}/api/airjam/runtime-errors`,
|
|
488
|
+
credentials: "omit"
|
|
489
|
+
});
|
|
490
|
+
reporters.set(environment.name, reporter);
|
|
491
|
+
return reporter;
|
|
492
|
+
};
|
|
470
493
|
|
|
471
494
|
// src/core/config.ts
|
|
472
495
|
var createAirJamConfig = ({
|
|
@@ -477,13 +500,13 @@ var createAirJamConfig = ({
|
|
|
477
500
|
reportError,
|
|
478
501
|
presentationChannel = AIRJAM_PRESENTATION_CHANNEL
|
|
479
502
|
}) => {
|
|
480
|
-
const hosted = topology.socketOrigin
|
|
503
|
+
const hosted = findHostedEnvironment(topology.socketOrigin);
|
|
481
504
|
return {
|
|
482
505
|
topology,
|
|
483
506
|
appId,
|
|
484
|
-
hostGrantEndpoint: hostGrantEndpoint ?? (hosted ?
|
|
507
|
+
hostGrantEndpoint: hostGrantEndpoint ?? (hosted ? hostedHostGrantEndpoint(hosted) : void 0),
|
|
485
508
|
maxPlayers,
|
|
486
|
-
reportError: reportError ?? (hosted ? hostedRuntimeErrorReporter : void 0),
|
|
509
|
+
reportError: reportError ?? (hosted ? hostedRuntimeErrorReporter(hosted) : void 0),
|
|
487
510
|
presentationChannel,
|
|
488
511
|
backendOrigin: topology.backendOrigin,
|
|
489
512
|
socketOrigin: topology.socketOrigin,
|
|
@@ -4083,7 +4106,7 @@ var HostRuntime = class {
|
|
|
4083
4106
|
}
|
|
4084
4107
|
/** Opens a session to a new room, or to the one `resume` names. */
|
|
4085
4108
|
openRoom(resume) {
|
|
4086
|
-
const endpoint = this.config.hostGrantEndpoint;
|
|
4109
|
+
const endpoint = this.environment.embedded ? void 0 : this.config.hostGrantEndpoint;
|
|
4087
4110
|
const key = resume?.key ?? this.environment.createKey();
|
|
4088
4111
|
const room = this.environment.openRoom({
|
|
4089
4112
|
key,
|
|
@@ -5880,6 +5903,7 @@ function describeAirJamGame(game) {
|
|
|
5880
5903
|
}
|
|
5881
5904
|
// Annotate the CommonJS export names for ESM import in node:
|
|
5882
5905
|
0 && (module.exports = {
|
|
5906
|
+
AIR_JAM_HOSTED_ENVIRONMENTS,
|
|
5883
5907
|
AIR_JAM_INPUT_LOG_MAX_ENTRY_BYTES,
|
|
5884
5908
|
AIR_JAM_INPUT_LOG_MAX_GAME_MS,
|
|
5885
5909
|
ControllerInput,
|
|
@@ -5916,6 +5940,7 @@ function describeAirJamGame(game) {
|
|
|
5916
5940
|
defineAirJamSimulation,
|
|
5917
5941
|
defineAirJamTheme,
|
|
5918
5942
|
describeAirJamGame,
|
|
5943
|
+
findHostedEnvironment,
|
|
5919
5944
|
getReconnectingPlayerIds,
|
|
5920
5945
|
isAirJamGame,
|
|
5921
5946
|
keyAxis,
|