@crowdedkingdoms/crowdyjs 18.0.4-dev.1 → 18.2.0-dev.1
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/MIGRATION.md +52 -0
- package/README.md +36 -13
- package/dist/domains/admin.d.ts +2 -2
- package/dist/domains/admin.js +2 -2
- package/dist/domains/exec.d.ts +33 -5
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +142 -11
- package/dist/domains/gameApps.d.ts +26 -1
- package/dist/domains/gameApps.d.ts.map +1 -1
- package/dist/domains/gameApps.js +37 -1
- package/dist/generated/graphql.d.ts +81 -24
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +3 -1
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/stores/chunks.d.ts +11 -4
- package/dist/stores/chunks.d.ts.map +1 -1
- package/dist/stores/chunks.js +16 -3
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -120,6 +120,58 @@ super-admin's session). There is no SDK replacement.
|
|
|
120
120
|
`dev`'s SDL after #417 merged (`npm run schema:sync:paths -- --schema <that schema.gql>`, then
|
|
121
121
|
`npm run codegen`).
|
|
122
122
|
|
|
123
|
+
## 18.2.0: `ChunkStore` keeps the voxel edits it hydrated
|
|
124
|
+
|
|
125
|
+
No API change. Every voxel write but a chunk write-back lands only in the chunk's edit log: a
|
|
126
|
+
hub's or mod's `world.set_voxels`, `updateVoxel`, and realtime voxel updates. Since ck-api
|
|
127
|
+
`dev/v2.33.0` (cks-game-api #445) `getChunk` returns each recorded edit as a `voxelStates` entry
|
|
128
|
+
with its type, over a stored `voxels` that holds none of them. `ChunkStore` applies them when it
|
|
129
|
+
hydrates a loaded chunk: set `hydrateVoxelStates: true` unless you configure a
|
|
130
|
+
`voxelStateCodec` (the-construct does since construct 0.3.6), or a reload shows none of them.
|
|
131
|
+
(OI-2026-10-02-006)
|
|
132
|
+
|
|
133
|
+
- `ensureAround` no longer applies a chunk it has already loaded when the bulk load returns it
|
|
134
|
+
again: the cube around a new center overlaps the old one, and the stored `voxels` put back
|
|
135
|
+
over the cache wiped the hydrated edits (a hub's block vanished the moment the player crossed
|
|
136
|
+
into a new chunk) and every realtime merge, and the chunk was never hydrated again. To load a
|
|
137
|
+
chunk afresh, `pruneBeyond` it first, or call `hydrate(coord)`.
|
|
138
|
+
- `hydrate` puts the entries on a chunk stored with `voxels: null` (a zero grid under them); it
|
|
139
|
+
used to drop their types. An entry without a state clears the state cached at its voxel, as a
|
|
140
|
+
realtime merge without one does.
|
|
141
|
+
|
|
142
|
+
## 18.1.0: open grids, and where a connect token may go
|
|
143
|
+
|
|
144
|
+
Additive, except that `client.exec.connect` refuses a gateway it would once have dialed (below).
|
|
145
|
+
The two grid calls need a game API with cks-game-api #436 (ck-api `dev/v2.31.0`); nothing else
|
|
146
|
+
calls them.
|
|
147
|
+
|
|
148
|
+
- `client.gameApps.setOpenPermissions({ appId, gridId, permissionKeys })` (also
|
|
149
|
+
`client.admin.grids`) opens a grid to every player with active access to the app: it replaces
|
|
150
|
+
the keys the grid grants each of them, within its limits, and players who gain access later get
|
|
151
|
+
them too. An empty `permissionKeys` closes it; `openPermissions(appId, gridId)` reads them. Both
|
|
152
|
+
need `manage_apps`. Since #436 the most specific grid covering a chunk decides who may build
|
|
153
|
+
there, so a zone nested in the world grid that everyone should build in must grant
|
|
154
|
+
`update_voxel_data` itself. `BAD_REQUEST` refuses the world grid (open already), the four
|
|
155
|
+
player-code keys, a key that is not an active grid key, and a 33rd open grid in one app.
|
|
156
|
+
(OI-2026-09-30-007)
|
|
157
|
+
- `client.exec.connect` and `connectAsDeveloper` send the connect token only to a gateway that
|
|
158
|
+
`execGatewayRefusal(gameApiUrl, gatewayUrl)` passes: `ws:` or `wss:`, `wss:` whenever the game
|
|
159
|
+
API is `https:`, no credentials in the URL, and on the estate of the game API or of this
|
|
160
|
+
release's default origin, as `BinaryRelayTransport` holds a reconnect directive to its estate.
|
|
161
|
+
A loopback game API may name a loopback gateway (ck-exec's local cluster). Any other gateway is
|
|
162
|
+
never dialed: the attempt fails `Unavailable` ("refusing the gateway …"), and a reconnect asks
|
|
163
|
+
the game API again. `ExecConnection.open(gatewayUrl, token)` still dials what it is given.
|
|
164
|
+
(OI-2026-09-30-010)
|
|
165
|
+
- A gateway's refusal of the connect token is `Denied` again under Node's `ws` package. Since
|
|
166
|
+
ck-exec 0.10.0 a gateway answers the upgrade `HTTP 401` with the reason as its body, which
|
|
167
|
+
`connect` now reads: `Denied: the gateway refused the connection (HTTP 401: <reason>)`.
|
|
168
|
+
`HTTP 429` (a player past 16 sessions to one app through a gateway, or a gateway past its
|
|
169
|
+
total) is `Unavailable` with its reason. A browser, and Node's built-in WebSocket, cannot read a
|
|
170
|
+
refused upgrade, so there both stay `Unavailable`. A gateway before 0.10.0 closed with 4401,
|
|
171
|
+
which is `Denied` everywhere, now for a call in flight when it closes as well.
|
|
172
|
+
(OI-2026-09-29-002)
|
|
173
|
+
- `schema.gql` and the generated types are cks-game-api `dev`'s after #436.
|
|
174
|
+
|
|
123
175
|
## 18.0.4: a refused chunk write-back is dropped, and the wilderness setting
|
|
124
176
|
|
|
125
177
|
The P3 W5 security review's notes for the SDKs. The game API now refuses `updateChunk` with
|
package/README.md
CHANGED
|
@@ -12,19 +12,23 @@ gameplay, minted per app through `client.portal`.
|
|
|
12
12
|
|
|
13
13
|
Start here:
|
|
14
14
|
|
|
15
|
-
- [SDK guide](https://docs.crowdedkingdoms.com/crowdyjs/readme) — the canonical
|
|
15
|
+
- [SDK guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/readme) — the canonical
|
|
16
16
|
walkthrough of everything in this README.
|
|
17
|
-
- [Build a game](https://docs.crowdedkingdoms.com/build-a-game/intro) — a
|
|
17
|
+
- [Build a game](https://docs.dev.crowdedkingdoms.com/build-a-game/intro) — a
|
|
18
18
|
hands-on tutorial from sign-in to a playable voxel game.
|
|
19
|
-
- [Platform overview](https://docs.crowdedkingdoms.com/overview/client-workflow)
|
|
19
|
+
- [Platform overview](https://docs.dev.crowdedkingdoms.com/overview/client-workflow)
|
|
20
20
|
— how a client session flows through the platform.
|
|
21
21
|
|
|
22
22
|
## Install
|
|
23
23
|
|
|
24
24
|
```bash
|
|
25
|
-
npm install @crowdedkingdoms/crowdyjs
|
|
25
|
+
npm install @crowdedkingdoms/crowdyjs@dev
|
|
26
26
|
```
|
|
27
27
|
|
|
28
|
+
This README is the `dev` branch's: it documents the release on the `dev` dist-tag
|
|
29
|
+
(`npm view @crowdedkingdoms/crowdyjs dist-tags`), and its links go to the dev docs site. A
|
|
30
|
+
plain `npm install` resolves `latest`, the production release, which has no `client.exec`.
|
|
31
|
+
|
|
28
32
|
CrowdyJS targets browsers by default and uses native `fetch`, `WebSocket`,
|
|
29
33
|
`crypto`, `btoa`, and `atob`. Node tools can still use the SDK, but must
|
|
30
34
|
provide browser-compatible globals when opening realtime connections (e.g.
|
|
@@ -171,8 +175,8 @@ Notes:
|
|
|
171
175
|
- Use `client.auth.setToken(token)` to seed a token externally (e.g. when
|
|
172
176
|
restoring auth from a non-default storage).
|
|
173
177
|
|
|
174
|
-
Deeper reading: [Portals & app-scoped tokens](https://docs.crowdedkingdoms.com/management-api/portals-and-app-tokens)
|
|
175
|
-
and [Sign in](https://docs.crowdedkingdoms.com/management-api/authentication).
|
|
178
|
+
Deeper reading: [Portals & app-scoped tokens](https://docs.dev.crowdedkingdoms.com/management-api/portals-and-app-tokens)
|
|
179
|
+
and [Sign in](https://docs.dev.crowdedkingdoms.com/management-api/authentication).
|
|
176
180
|
|
|
177
181
|
### Token refresh during gameplay
|
|
178
182
|
|
|
@@ -253,7 +257,7 @@ grouped under `client.admin` and mirrored at the top level):
|
|
|
253
257
|
| `client.quotas` | Usage quotas at the org/app scope. |
|
|
254
258
|
| `client.usage` | Replication + GraphQL usage reporting. |
|
|
255
259
|
| `client.sharedEnvironment` | Publish to shared, runtime gating, spend caps, auto-billing. |
|
|
256
|
-
| `client.gameApps` | App grids (`createGrid` / `deleteGrid`), first-class grid ownership (`ownership` / `assignOwnership` / `transferOwnership`), and grid runtime-permission administration. |
|
|
260
|
+
| `client.gameApps` | App grids (`createGrid` / `deleteGrid`), first-class grid ownership (`ownership` / `assignOwnership` / `transferOwnership`), and grid runtime-permission administration, including open grids (`setOpenPermissions` / `openPermissions`, 18.1.0): the keys a grid grants every player, which a zone everyone may build in needs, since the most specific grid over a chunk decides who builds there. |
|
|
257
261
|
|
|
258
262
|
**The SDK is for normal clients, and designed for production.** It carries what players,
|
|
259
263
|
developers and org-admins call, and nothing only a super-admin or a platform operator can
|
|
@@ -295,7 +299,7 @@ query AppForRouting($appId: BigInt!) {
|
|
|
295
299
|
`CrowdyClient` with `httpUrl: gameApiUrl` (and the matching `wsUrl`) holding
|
|
296
300
|
that app's app-scoped token, then drive gameplay through that client. Apps
|
|
297
301
|
with no `gameApiUrl` keep working against the default `httpUrl` you
|
|
298
|
-
configured. See [Loading an app's Game API](https://docs.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
|
|
302
|
+
configured. See [Loading an app's Game API](https://docs.dev.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
|
|
299
303
|
|
|
300
304
|
## Realtime notifications
|
|
301
305
|
|
|
@@ -587,6 +591,11 @@ write-back), `channelInbox` / `actorInbox` (message inboxes), `events` (typed
|
|
|
587
591
|
event router), `host` (host tracking), and `save` / `avatar` (typed durable
|
|
588
592
|
state).
|
|
589
593
|
|
|
594
|
+
A voxel edit that is not a chunk write-back (a hub's or mod's `world.set_voxels`, `updateVoxel`,
|
|
595
|
+
another player's realtime voxel update) reaches a reload only through hydration: `getChunk`
|
|
596
|
+
returns it in `voxelStates`, and the bulk load's `voxels` never hold it. The store hydrates when
|
|
597
|
+
it has a `voxelStateCodec`; without one, set `chunks: { hydrateVoxelStates: true }`.
|
|
598
|
+
|
|
590
599
|
A chunk write-back the server refuses (a visitor on someone else's plot, a safe zone, a closed
|
|
591
600
|
wilderness) is dropped, not retried; one that fails for a reason that can clear is tried five
|
|
592
601
|
times. Listen with `session.chunks.onWriteBackFailed(...)` to undo or flag the edit (18.0.4).
|
|
@@ -599,7 +608,7 @@ reach your bundle. Reads are synchronous snapshots and writes happen on
|
|
|
599
608
|
WebSocket events (not `requestAnimationFrame`), so render loops read freely
|
|
600
609
|
and a backgrounded tab keeps ingesting updates; pass `workerTicker()` to also
|
|
601
610
|
keep timer-driven sends at full rate while hidden. See the
|
|
602
|
-
[World Stores guide](https://docs.crowdedkingdoms.com/crowdyjs/stores).
|
|
611
|
+
[World Stores guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/stores).
|
|
603
612
|
|
|
604
613
|
## Game Kit
|
|
605
614
|
|
|
@@ -626,7 +635,8 @@ model in 18.0.0; see [MIGRATION.md](MIGRATION.md).
|
|
|
626
635
|
## ck-exec (dev-tier preview)
|
|
627
636
|
|
|
628
637
|
ck-exec runs an app's server code as **hubs** (stateful, one instance per key) and **spokes**
|
|
629
|
-
(stateless, replicated) on execution hosts, on the dev environment only for now
|
|
638
|
+
(stateless, replicated) on execution hosts, on the dev environment only for now, so it needs
|
|
639
|
+
the `@dev` release (`npm install @crowdedkingdoms/crowdyjs@dev`). A player
|
|
630
640
|
connects to one host and calls any node of the app through it:
|
|
631
641
|
|
|
632
642
|
```ts
|
|
@@ -643,6 +653,14 @@ exec.onReconnect((host) => console.log('moved to', host));
|
|
|
643
653
|
- `connect` asks the game API for a host (`execConnect`) and opens a WebSocket to its gateway.
|
|
644
654
|
With `nodeType` and `key`, the player lands on the host that runs that instance. On runtimes
|
|
645
655
|
without a global `WebSocket` (Node before 22), pass one: `{ WebSocket }` from the `ws` package.
|
|
656
|
+
- The connect token rides in the gateway URL, so `connect` dials only a gateway
|
|
657
|
+
`execGatewayRefusal(gameApiUrl, gatewayUrl)` passes: `wss:` when the game API is `https:`, and on
|
|
658
|
+
the game API's estate or the platform's (a loopback game API may name a loopback gateway, as
|
|
659
|
+
ck-exec's local cluster does). Any other is refused `Unavailable` without being dialed (18.1.0).
|
|
660
|
+
- A gateway that refuses the connect token answers the upgrade `HTTP 401` with its reason. Under
|
|
661
|
+
Node's `ws` package `connect` throws `Denied` with that reason; a browser cannot read a refused
|
|
662
|
+
upgrade, so there it is `Unavailable`. `HTTP 429` (more than 16 sessions to one app through
|
|
663
|
+
one gateway) is `Unavailable` with its reason under `ws` (18.1.0).
|
|
646
664
|
- A refused call throws `CrowdyExecError`: `status` is the platform's (`AppError` carries the
|
|
647
665
|
handler's own message; `Busy`, `Moved`, `Unavailable` and `RateLimited` are `retryable`).
|
|
648
666
|
The SDK does not retry `Busy`. A gateway refuses a player's calls over 120 per 10 s (per app
|
|
@@ -660,7 +678,7 @@ exec.onReconnect((host) => console.log('moved to', host));
|
|
|
660
678
|
- When the host goes away, the connection asks for a host again, reconnects and renews every
|
|
661
679
|
subscription; a call caught by it, or answered `Moved`, is tried once more.
|
|
662
680
|
- `ExecConnection.open(gatewayUrl, token)` connects with a connect token you already have
|
|
663
|
-
(tools and tests), without reconnecting.
|
|
681
|
+
(tools and tests), without reconnecting. It dials the URL it is given.
|
|
664
682
|
- `client.exec.deploy({ appId, root, types })` takes each node type's compiled module
|
|
665
683
|
(`wasm: Uint8Array`) with its manifest fields, sends each distinct module once, and makes
|
|
666
684
|
the version active.
|
|
@@ -865,7 +883,7 @@ CLIENT project needs ck-api `v2.25.1` or later. A CLIENT crate still on the lega
|
|
|
865
883
|
on legacy player compute since 18.0.0.
|
|
866
884
|
|
|
867
885
|
See [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.dev.crowdedkingdoms.com/exec/mods)
|
|
868
|
-
and [Embed Crowdy Studio in your game](https://docs.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
|
|
886
|
+
and [Embed Crowdy Studio in your game](https://docs.dev.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
|
|
869
887
|
|
|
870
888
|
### The Studio agent (DeepSeek Harness in the browser)
|
|
871
889
|
|
|
@@ -1028,6 +1046,11 @@ while `mintAppToken` under direct connect hands back one instance
|
|
|
1028
1046
|
(`ck-api-<dc>-<n>.<zone>`). They agree on the datacenter, not on the host, which
|
|
1029
1047
|
is why the mint also returns `discoveryUrl`.
|
|
1030
1048
|
|
|
1049
|
+
`test/e2e/open-grid-and-exec-gateway.test.mjs` needs no account at all: with
|
|
1050
|
+
`CROWDY_HTTP_URL` and `CROWDY_E2E_THROWAWAY_OWNER=1` it registers a throwaway org admin (its own
|
|
1051
|
+
org and app) and a player, opens and closes a grid, and checks the tier's ck-exec gateway. It
|
|
1052
|
+
leaves the org behind and archives the app, so it runs only when asked to.
|
|
1053
|
+
|
|
1031
1054
|
## Maintainers: schema artifacts and fixtures
|
|
1032
1055
|
|
|
1033
1056
|
CrowdyJS is a standalone public package: a clean clone builds with
|
|
@@ -1038,7 +1061,7 @@ no other repositories and no network access required:
|
|
|
1038
1061
|
- `src/generated/graphql.ts` — generated TypeScript operation types.
|
|
1039
1062
|
|
|
1040
1063
|
Schema refresh is explicit, from the published
|
|
1041
|
-
[SDL](https://docs.crowdedkingdoms.com/schema/game-api.graphql):
|
|
1064
|
+
[SDL](https://docs.dev.crowdedkingdoms.com/schema/game-api.graphql):
|
|
1042
1065
|
|
|
1043
1066
|
```bash
|
|
1044
1067
|
npm run schema:sync:prod
|
package/dist/domains/admin.d.ts
CHANGED
|
@@ -17,8 +17,8 @@ import type { GameAppsAPI } from './gameApps.js';
|
|
|
17
17
|
* instances also reachable at the top level (e.g. `client.billing`), grouped
|
|
18
18
|
* here for discoverability.
|
|
19
19
|
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
20
|
+
* Platform-operator operations are not in the SDK; it wraps only what a studio
|
|
21
|
+
* or a player may call.
|
|
22
22
|
*
|
|
23
23
|
* @example
|
|
24
24
|
* ```ts
|
package/dist/domains/admin.js
CHANGED
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
* instances also reachable at the top level (e.g. `client.billing`), grouped
|
|
9
9
|
* here for discoverability.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Platform-operator operations are not in the SDK; it wraps only what a studio
|
|
12
|
+
* or a player may call.
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
package/dist/domains/exec.d.ts
CHANGED
|
@@ -17,7 +17,8 @@ export { ExecModScope };
|
|
|
17
17
|
* ```
|
|
18
18
|
*
|
|
19
19
|
* `connect` asks the game API for a host (`execConnect`, with the app-scoped token
|
|
20
|
-
* of `appId` as the session token) and opens a WebSocket to its gateway
|
|
20
|
+
* of `appId` as the session token) and opens a WebSocket to its gateway, once the
|
|
21
|
+
* gateway passes {@link execGatewayRefusal}. Frames are
|
|
21
22
|
* ck-exec's client protocol (`ckx-proto/src/client.rs`); payloads are MessagePack.
|
|
22
23
|
* The connection recovers by itself: a closed socket or a `Moved` reply asks for a
|
|
23
24
|
* host again, renews every subscription, and retries the call once.
|
|
@@ -111,11 +112,28 @@ export interface ExecConnectOptions {
|
|
|
111
112
|
callTimeoutMs?: number;
|
|
112
113
|
/** Connect again when the socket closes unexpectedly. Default true. */
|
|
113
114
|
reconnect?: boolean;
|
|
114
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* A WebSocket implementation where there is no global one (older Node). With Node's `ws`
|
|
117
|
+
* package, a gateway that refuses the connect token (`HTTP 401`) is reported as `Denied`
|
|
118
|
+
* with the gateway's reason; a browser, and Node's built-in WebSocket, cannot read a refused
|
|
119
|
+
* upgrade, so there it is `Unavailable`. A gateway before ck-exec 0.10.0 closed with 4401,
|
|
120
|
+
* which is `Denied` everywhere.
|
|
121
|
+
*/
|
|
115
122
|
WebSocket?: ExecWebSocketCtor;
|
|
116
123
|
/** MessagePack decoding options, e.g. `{ useBigInt64: true }` for 64-bit integers above 2^53. */
|
|
117
124
|
decode?: DecoderOptions;
|
|
118
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Why {@link ExecAPI.connect} will not send a connect token to `gatewayUrl`, or null when it
|
|
128
|
+
* will. The game API names the gateway, and the token rides in its query string, so a gateway
|
|
129
|
+
* must be `ws:` or `wss:` (`wss:` whenever the game API is `https:`), carry no credentials,
|
|
130
|
+
* and be on the estate of the game API or of this release's default origin
|
|
131
|
+
* (`CROWDY_DEFAULT_HTTP_ORIGIN`, the tier the SDK was published for), as
|
|
132
|
+
* `BinaryRelayTransport` holds a reconnect directive to its estate. A game API on loopback
|
|
133
|
+
* (ck-exec's local cluster) may also name a loopback gateway. `gameApiUrl` may be relative to
|
|
134
|
+
* the page.
|
|
135
|
+
*/
|
|
136
|
+
export declare function execGatewayRefusal(gameApiUrl: string, gatewayUrl: string): string | null;
|
|
119
137
|
/**
|
|
120
138
|
* One player's connection to a ck-exec host. Calls go to any node of the app;
|
|
121
139
|
* the host routes them. Subscriptions survive reconnects.
|
|
@@ -138,7 +156,8 @@ export declare class ExecConnection {
|
|
|
138
156
|
constructor(dial: () => Promise<ExecEndpoint>, options?: ExecConnectOptions);
|
|
139
157
|
/**
|
|
140
158
|
* Opens a connection to a known gateway with a connect token, without the game API
|
|
141
|
-
* (tools and tests; a game uses {@link ExecAPI.connect}). It does not reconnect
|
|
159
|
+
* (tools and tests; a game uses {@link ExecAPI.connect}). It does not reconnect, and it
|
|
160
|
+
* dials the URL it is given: {@link execGatewayRefusal} judges only what the game API names.
|
|
142
161
|
*/
|
|
143
162
|
static open(gatewayUrl: string, token: string, options?: Omit<ExecConnectOptions, 'reconnect'>): Promise<ExecConnection>;
|
|
144
163
|
/** The execution host this connection is on. */
|
|
@@ -402,6 +421,8 @@ export declare function isNameList(value: unknown): value is string[];
|
|
|
402
421
|
export declare class ExecAPI {
|
|
403
422
|
private readonly graphql;
|
|
404
423
|
constructor(graphql: GraphQLClient);
|
|
424
|
+
/** `fetch`, refusing a gateway {@link execGatewayRefusal} will not send a token to. */
|
|
425
|
+
private checked;
|
|
405
426
|
/**
|
|
406
427
|
* A host and a developer connect token for `appId` (valid for about a minute). The
|
|
407
428
|
* session's calls arrive as `Caller::Developer` with your user id and may reach any
|
|
@@ -605,7 +626,11 @@ export declare class ExecAPI {
|
|
|
605
626
|
* `consentedHostCalls: capabilitySummary.hostFunctions`.
|
|
606
627
|
*/
|
|
607
628
|
modClientArtifactBytes(appId: string, modId: string): Promise<ExecModClientArtifactBytes>;
|
|
608
|
-
/**
|
|
629
|
+
/**
|
|
630
|
+
* A host for this player and its connect token (valid for about a minute). {@link connect}
|
|
631
|
+
* dials its gateway only when {@link execGatewayRefusal} passes it; dialing it any other way,
|
|
632
|
+
* apply the same check.
|
|
633
|
+
*/
|
|
609
634
|
endpoint(appId: string, options?: {
|
|
610
635
|
nodeType?: string;
|
|
611
636
|
key?: string;
|
|
@@ -615,7 +640,10 @@ export declare class ExecAPI {
|
|
|
615
640
|
/**
|
|
616
641
|
* Connects the signed-in player to ck-exec for `appId`. The session token must be
|
|
617
642
|
* that app's app-scoped token. With `nodeType` (and `key`) the player lands on the
|
|
618
|
-
* host that runs that instance.
|
|
643
|
+
* host that runs that instance. A gateway that {@link execGatewayRefusal} refuses is never
|
|
644
|
+
* dialed: the attempt fails `Unavailable`, and a reconnect asks the game API again.
|
|
645
|
+
* @throws {CrowdyExecError} `Denied` when the gateway refuses the connect token (see
|
|
646
|
+
* {@link ExecConnectOptions.WebSocket}), `Unavailable` when no host could be reached.
|
|
619
647
|
*/
|
|
620
648
|
connect(appId: string, options?: ExecConnectOptions): Promise<ExecConnection>;
|
|
621
649
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exec.d.ts","sourceRoot":"","sources":["../../src/domains/exec.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,EA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C;IASvF;;;;;OAKG;IACG,MAAM,CAAC,OAAO,EAAE,iBAAiB,GAAG,OAAO,CAAC;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;CA0BvE"}
|
package/dist/domains/exec.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { decode, encode } from '@msgpack/msgpack';
|
|
2
|
+
import { isSameEstate } from '../binary-relay.js';
|
|
3
|
+
import { CROWDY_DEFAULT_HTTP_ORIGIN } from '../default-origin.js';
|
|
2
4
|
import { CrowdyError, CrowdyProtocolError } from '../errors.js';
|
|
3
5
|
import { ExecActivateVersionDocument, ExecAppStatusDocument, ExecBuildDocument, ExecBuildStatusDocument, ExecConnectAsDeveloperDocument, ExecConnectDocument, ExecConsentClientModDocument, ExecDeployDocument, ExecEndpointStatsDocument, ExecGridClientModsDocument, ExecInstancesDocument, ExecLogsDocument, ExecAppModsDocument, ExecModBuildDocument, ExecModBuildStatusDocument, ExecModClientArtifactDocument, ExecModClientBuildDocument, ExecModClientDeleteDocument, ExecModClientDeployDocument, ExecModDeleteDocument, ExecModDeployDocument, ExecModInstallDocument, ExecModListingsDocument, ExecModLogsDocument, ExecModPublishDocument, ExecModScope, ExecModSetEnabledDocument, ExecModSetSwitchDocument, ExecModStarterDocument, ExecModSwitchesDocument, ExecModUnpublishDocument, ExecModsDocument, ExecMyModsDocument, ExecRevokeAuthorTrustDocument, ExecRevokeClientModConsentDocument, ExecSetEnabledDocument, ExecStartersDocument, ExecTrustAuthorDocument, ExecVersionsDocument, } from '../generated/graphql.js';
|
|
4
6
|
export { ExecModScope };
|
|
@@ -16,7 +18,8 @@ export { ExecModScope };
|
|
|
16
18
|
* ```
|
|
17
19
|
*
|
|
18
20
|
* `connect` asks the game API for a host (`execConnect`, with the app-scoped token
|
|
19
|
-
* of `appId` as the session token) and opens a WebSocket to its gateway
|
|
21
|
+
* of `appId` as the session token) and opens a WebSocket to its gateway, once the
|
|
22
|
+
* gateway passes {@link execGatewayRefusal}. Frames are
|
|
20
23
|
* ck-exec's client protocol (`ckx-proto/src/client.rs`); payloads are MessagePack.
|
|
21
24
|
* The connection recovers by itself: a closed socket or a `Moved` reply asks for a
|
|
22
25
|
* host again, renews every subscription, and retries the call once.
|
|
@@ -190,6 +193,112 @@ const MAX_BACKOFF_MS = 5000;
|
|
|
190
193
|
function subKey(nodeType, key, topic) {
|
|
191
194
|
return `${nodeType}\u0000${key}\u0000${topic}`;
|
|
192
195
|
}
|
|
196
|
+
// ---- where a connect token may go ----
|
|
197
|
+
function parseUrl(raw, base) {
|
|
198
|
+
try {
|
|
199
|
+
return new URL(raw, base);
|
|
200
|
+
}
|
|
201
|
+
catch {
|
|
202
|
+
return null;
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
function isIpLiteral(host) {
|
|
206
|
+
return host.startsWith('[') || /^\d{1,3}(\.\d{1,3}){3}$/.test(host);
|
|
207
|
+
}
|
|
208
|
+
function isLoopback(host) {
|
|
209
|
+
return (host === 'localhost' ||
|
|
210
|
+
host.endsWith('.localhost') ||
|
|
211
|
+
host === '[::1]' ||
|
|
212
|
+
/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host));
|
|
213
|
+
}
|
|
214
|
+
/** One host, or two DNS names that {@link isSameEstate} puts on one estate. Never two IPs. */
|
|
215
|
+
function sameEstate(a, b) {
|
|
216
|
+
if (a.hostname === b.hostname)
|
|
217
|
+
return true;
|
|
218
|
+
if (isIpLiteral(a.hostname) || isIpLiteral(b.hostname))
|
|
219
|
+
return false;
|
|
220
|
+
return isSameEstate(a.href, b.href);
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Why {@link ExecAPI.connect} will not send a connect token to `gatewayUrl`, or null when it
|
|
224
|
+
* will. The game API names the gateway, and the token rides in its query string, so a gateway
|
|
225
|
+
* must be `ws:` or `wss:` (`wss:` whenever the game API is `https:`), carry no credentials,
|
|
226
|
+
* and be on the estate of the game API or of this release's default origin
|
|
227
|
+
* (`CROWDY_DEFAULT_HTTP_ORIGIN`, the tier the SDK was published for), as
|
|
228
|
+
* `BinaryRelayTransport` holds a reconnect directive to its estate. A game API on loopback
|
|
229
|
+
* (ck-exec's local cluster) may also name a loopback gateway. `gameApiUrl` may be relative to
|
|
230
|
+
* the page.
|
|
231
|
+
*/
|
|
232
|
+
export function execGatewayRefusal(gameApiUrl, gatewayUrl) {
|
|
233
|
+
const gateway = parseUrl(gatewayUrl);
|
|
234
|
+
if (!gateway)
|
|
235
|
+
return 'it is not an absolute URL';
|
|
236
|
+
if (gateway.protocol !== 'ws:' && gateway.protocol !== 'wss:') {
|
|
237
|
+
return `${gateway.protocol} is not a WebSocket scheme`;
|
|
238
|
+
}
|
|
239
|
+
if (gateway.username || gateway.password)
|
|
240
|
+
return 'it carries credentials';
|
|
241
|
+
const page = globalThis.location?.href;
|
|
242
|
+
const api = parseUrl(gameApiUrl, page);
|
|
243
|
+
if (!api)
|
|
244
|
+
return `the game API URL ${gameApiUrl} is not absolute`;
|
|
245
|
+
if (api.protocol === 'https:' && gateway.protocol !== 'wss:') {
|
|
246
|
+
return 'a game API on https: hands out wss: gateways only';
|
|
247
|
+
}
|
|
248
|
+
if (sameEstate(api, gateway))
|
|
249
|
+
return null;
|
|
250
|
+
const tier = parseUrl(CROWDY_DEFAULT_HTTP_ORIGIN);
|
|
251
|
+
if (tier && sameEstate(tier, gateway))
|
|
252
|
+
return null;
|
|
253
|
+
if (isLoopback(api.hostname) && isLoopback(gateway.hostname))
|
|
254
|
+
return null;
|
|
255
|
+
const estates = tier && tier.hostname !== api.hostname ? `${api.hostname} and ${tier.hostname}` : api.hostname;
|
|
256
|
+
return `${gateway.hostname} is outside the estate of ${estates}`;
|
|
257
|
+
}
|
|
258
|
+
/**
|
|
259
|
+
* A gateway's close as an error. 4401 is how a gateway before ck-exec 0.10.0 refused a token:
|
|
260
|
+
* it upgraded, then closed, so a call already in flight learns of it here.
|
|
261
|
+
*/
|
|
262
|
+
function closedError(ev) {
|
|
263
|
+
return new CrowdyExecError(ev.code === 4401 ? 'Denied' : 'Unavailable', `the gateway closed the connection (${ev.code}${ev.reason ? `: ${ev.reason}` : ''})`);
|
|
264
|
+
}
|
|
265
|
+
const REFUSAL_REASON_MAX_CHARS = 500;
|
|
266
|
+
const REFUSAL_BODY_WAIT_MS = 1000;
|
|
267
|
+
/**
|
|
268
|
+
* Calls `refused` with the status and body of an upgrade the gateway answered with something
|
|
269
|
+
* other than 101. Since ck-exec 0.10.0 a gateway answers a refused connect token `401` and a
|
|
270
|
+
* player past their session cap `429`, each with the reason as its body, before any
|
|
271
|
+
* WebSocket exists. Only Node's `ws` package can read that answer; a browser's WebSocket, and
|
|
272
|
+
* Node's built-in one, see a failed connection and nothing else.
|
|
273
|
+
*/
|
|
274
|
+
function onUpgradeRefused(ws, refused) {
|
|
275
|
+
const node = ws;
|
|
276
|
+
if (typeof node.on !== 'function')
|
|
277
|
+
return;
|
|
278
|
+
node.on('unexpected-response', (_req, res) => {
|
|
279
|
+
let body = '';
|
|
280
|
+
let done = false;
|
|
281
|
+
const finish = () => {
|
|
282
|
+
if (done)
|
|
283
|
+
return;
|
|
284
|
+
done = true;
|
|
285
|
+
clearTimeout(timer);
|
|
286
|
+
refused(res.statusCode ?? 0, body.replace(/\s+/g, ' ').trim().slice(0, REFUSAL_REASON_MAX_CHARS));
|
|
287
|
+
// With a listener, `ws` leaves the handshake to it: end it, which also closes the socket.
|
|
288
|
+
node.terminate?.();
|
|
289
|
+
};
|
|
290
|
+
const timer = setTimeout(finish, REFUSAL_BODY_WAIT_MS);
|
|
291
|
+
res.setEncoding?.('utf8');
|
|
292
|
+
res.on('data', (chunk) => {
|
|
293
|
+
body += chunk;
|
|
294
|
+
if (body.length > REFUSAL_REASON_MAX_CHARS)
|
|
295
|
+
finish();
|
|
296
|
+
});
|
|
297
|
+
res.on('end', finish);
|
|
298
|
+
res.on('error', finish);
|
|
299
|
+
res.on('close', finish);
|
|
300
|
+
});
|
|
301
|
+
}
|
|
193
302
|
/**
|
|
194
303
|
* One player's connection to a ck-exec host. Calls go to any node of the app;
|
|
195
304
|
* the host routes them. Subscriptions survive reconnects.
|
|
@@ -217,7 +326,8 @@ export class ExecConnection {
|
|
|
217
326
|
}
|
|
218
327
|
/**
|
|
219
328
|
* Opens a connection to a known gateway with a connect token, without the game API
|
|
220
|
-
* (tools and tests; a game uses {@link ExecAPI.connect}). It does not reconnect
|
|
329
|
+
* (tools and tests; a game uses {@link ExecAPI.connect}). It does not reconnect, and it
|
|
330
|
+
* dials the URL it is given: {@link execGatewayRefusal} judges only what the game API names.
|
|
221
331
|
*/
|
|
222
332
|
static async open(gatewayUrl, token, options = {}) {
|
|
223
333
|
const c = new ExecConnection(async () => ({ gatewayUrl, token, host: '' }), {
|
|
@@ -261,6 +371,10 @@ export class ExecConnection {
|
|
|
261
371
|
/* already closed */
|
|
262
372
|
}
|
|
263
373
|
}, OPEN_TIMEOUT_MS);
|
|
374
|
+
onUpgradeRefused(ws, (status, reason) => {
|
|
375
|
+
clearTimeout(timer);
|
|
376
|
+
reject(new CrowdyExecError(status === 401 ? 'Denied' : 'Unavailable', `the gateway refused the connection (HTTP ${status}${reason ? `: ${reason}` : ''})`));
|
|
377
|
+
});
|
|
264
378
|
ws.onopen = () => {
|
|
265
379
|
clearTimeout(timer);
|
|
266
380
|
resolve();
|
|
@@ -271,7 +385,7 @@ export class ExecConnection {
|
|
|
271
385
|
};
|
|
272
386
|
ws.onclose = (ev) => {
|
|
273
387
|
clearTimeout(timer);
|
|
274
|
-
reject(
|
|
388
|
+
reject(closedError(ev));
|
|
275
389
|
};
|
|
276
390
|
});
|
|
277
391
|
this.ws = ws;
|
|
@@ -279,7 +393,7 @@ export class ExecConnection {
|
|
|
279
393
|
this.backoffMs = 250;
|
|
280
394
|
ws.onmessage = (ev) => this.onMessage(ev.data);
|
|
281
395
|
ws.onerror = () => { };
|
|
282
|
-
ws.onclose = () => this.onClosed(ws);
|
|
396
|
+
ws.onclose = (ev) => this.onClosed(ws, ev);
|
|
283
397
|
}
|
|
284
398
|
onMessage(data) {
|
|
285
399
|
let frame;
|
|
@@ -333,11 +447,11 @@ export class ExecConnection {
|
|
|
333
447
|
continue;
|
|
334
448
|
this.pending.delete(rid);
|
|
335
449
|
clearTimeout(p.timer);
|
|
336
|
-
p.reject(new CrowdyExecError('Unavailable', why));
|
|
450
|
+
p.reject(typeof why === 'string' ? new CrowdyExecError('Unavailable', why) : why);
|
|
337
451
|
}
|
|
338
452
|
}
|
|
339
|
-
onClosed(ws) {
|
|
340
|
-
this.rejectPending(ws, 'the connection to the execution host closed');
|
|
453
|
+
onClosed(ws, ev) {
|
|
454
|
+
this.rejectPending(ws, ev?.code === 4401 ? closedError(ev) : 'the connection to the execution host closed');
|
|
341
455
|
if (this.ws !== ws)
|
|
342
456
|
return;
|
|
343
457
|
this.ws = null;
|
|
@@ -595,6 +709,16 @@ export class ExecAPI {
|
|
|
595
709
|
constructor(graphql) {
|
|
596
710
|
this.graphql = graphql;
|
|
597
711
|
}
|
|
712
|
+
/** `fetch`, refusing a gateway {@link execGatewayRefusal} will not send a token to. */
|
|
713
|
+
checked(fetch) {
|
|
714
|
+
return async () => {
|
|
715
|
+
const endpoint = await fetch();
|
|
716
|
+
const why = execGatewayRefusal(this.graphql.endpoint ?? CROWDY_DEFAULT_HTTP_ORIGIN, endpoint.gatewayUrl);
|
|
717
|
+
if (why)
|
|
718
|
+
throw new CrowdyExecError('Unavailable', `refusing the gateway ${endpoint.gatewayUrl}: ${why}`);
|
|
719
|
+
return endpoint;
|
|
720
|
+
};
|
|
721
|
+
}
|
|
598
722
|
/**
|
|
599
723
|
* A host and a developer connect token for `appId` (valid for about a minute). The
|
|
600
724
|
* session's calls arrive as `Caller::Developer` with your user id and may reach any
|
|
@@ -615,7 +739,7 @@ export class ExecAPI {
|
|
|
615
739
|
* developer token.
|
|
616
740
|
*/
|
|
617
741
|
async connectAsDeveloper(appId, options = {}) {
|
|
618
|
-
const c = new ExecConnection(() => this.developerEndpoint(appId, { nodeType: options.nodeType, key: options.key }), options);
|
|
742
|
+
const c = new ExecConnection(this.checked(() => this.developerEndpoint(appId, { nodeType: options.nodeType, key: options.key })), options);
|
|
619
743
|
await c.connect();
|
|
620
744
|
return c;
|
|
621
745
|
}
|
|
@@ -985,7 +1109,11 @@ export class ExecAPI {
|
|
|
985
1109
|
abiVersion: a.abiVersion,
|
|
986
1110
|
};
|
|
987
1111
|
}
|
|
988
|
-
/**
|
|
1112
|
+
/**
|
|
1113
|
+
* A host for this player and its connect token (valid for about a minute). {@link connect}
|
|
1114
|
+
* dials its gateway only when {@link execGatewayRefusal} passes it; dialing it any other way,
|
|
1115
|
+
* apply the same check.
|
|
1116
|
+
*/
|
|
989
1117
|
async endpoint(appId, options = {}) {
|
|
990
1118
|
const data = await this.graphql.request(ExecConnectDocument, {
|
|
991
1119
|
appId,
|
|
@@ -997,10 +1125,13 @@ export class ExecAPI {
|
|
|
997
1125
|
/**
|
|
998
1126
|
* Connects the signed-in player to ck-exec for `appId`. The session token must be
|
|
999
1127
|
* that app's app-scoped token. With `nodeType` (and `key`) the player lands on the
|
|
1000
|
-
* host that runs that instance.
|
|
1128
|
+
* host that runs that instance. A gateway that {@link execGatewayRefusal} refuses is never
|
|
1129
|
+
* dialed: the attempt fails `Unavailable`, and a reconnect asks the game API again.
|
|
1130
|
+
* @throws {CrowdyExecError} `Denied` when the gateway refuses the connect token (see
|
|
1131
|
+
* {@link ExecConnectOptions.WebSocket}), `Unavailable` when no host could be reached.
|
|
1001
1132
|
*/
|
|
1002
1133
|
async connect(appId, options = {}) {
|
|
1003
|
-
const c = new ExecConnection(() => this.endpoint(appId, { nodeType: options.nodeType, key: options.key }), options);
|
|
1134
|
+
const c = new ExecConnection(this.checked(() => this.endpoint(appId, { nodeType: options.nodeType, key: options.key })), options);
|
|
1004
1135
|
await c.connect();
|
|
1005
1136
|
return c;
|
|
1006
1137
|
}
|