@crowdedkingdoms/crowdyjs 18.39.1-dev.1 → 18.39.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/README.md CHANGED
@@ -12,23 +12,19 @@ gameplay, minted per app through `client.portal`.
12
12
 
13
13
  Start here:
14
14
 
15
- - [SDK guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/readme) — the canonical
15
+ - [SDK guide](https://docs.crowdedkingdoms.com/crowdyjs/readme) — the canonical
16
16
  walkthrough of everything in this README.
17
- - [Build a game](https://docs.dev.crowdedkingdoms.com/build-a-game/intro) — a
17
+ - [Build a game](https://docs.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.dev.crowdedkingdoms.com/overview/client-workflow)
19
+ - [Platform overview](https://docs.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@dev
25
+ npm install @crowdedkingdoms/crowdyjs
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
-
32
28
  **Server compatibility.** A release selects fields the Application API it was built against has,
33
29
  so it needs that Application API or newer; promote the Application API before the SDK on each tier.
34
30
 
@@ -235,8 +231,8 @@ Notes:
235
231
  - Use `client.auth.setToken(token)` to seed a token externally (e.g. when
236
232
  restoring auth from a non-default storage).
237
233
 
238
- Deeper reading: [Portals & app-scoped tokens](https://docs.dev.crowdedkingdoms.com/management-api/portals-and-app-tokens)
239
- and [Sign in](https://docs.dev.crowdedkingdoms.com/management-api/authentication).
234
+ Deeper reading: [Portals & app-scoped tokens](https://docs.crowdedkingdoms.com/management-api/portals-and-app-tokens)
235
+ and [Sign in](https://docs.crowdedkingdoms.com/management-api/authentication).
240
236
 
241
237
  ### Org-managed players
242
238
 
@@ -528,7 +524,7 @@ query AppForRouting($appId: BigInt!) {
528
524
  `CrowdyClient` with `httpUrl: applicationApiUrl` (and the matching `wsUrl`) holding
529
525
  that app's app-scoped token, then drive gameplay through that client. Apps
530
526
  with no `applicationApiUrl` keep working against the default `httpUrl` you
531
- configured. See [Loading an app's Application API](https://docs.dev.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
527
+ configured. See [Loading an app's Application API](https://docs.crowdedkingdoms.com/crowdyjs/shared-environment-routing).
532
528
 
533
529
  ## Realtime notifications
534
530
 
@@ -981,7 +977,7 @@ reach your bundle. Reads are synchronous snapshots and writes happen on
981
977
  WebSocket events (not `requestAnimationFrame`), so render loops read freely
982
978
  and a backgrounded tab keeps ingesting updates; pass `workerTicker()` to also
983
979
  keep timer-driven sends at full rate while hidden. See the
984
- [World Stores guide](https://docs.dev.crowdedkingdoms.com/crowdyjs/stores).
980
+ [World Stores guide](https://docs.crowdedkingdoms.com/crowdyjs/stores).
985
981
 
986
982
  ## Game Kit
987
983
 
@@ -1059,7 +1055,7 @@ The protocol is held to ck-exec's golden record of the starters
1059
1055
  (`test/unit/fixtures/kit-protocol.json`): every module call and topic in it is replayed in
1060
1056
  `test/unit/game-kit.test.mjs`. The blueprints, `kit.deploy`, the engines and the model-backed
1061
1057
  helpers went with the game model in 18.0.0; the hub modules replace them. See the
1062
- [Game Kit docs](https://docs.dev.crowdedkingdoms.com/game-kit/intro) and
1058
+ [Game Kit docs](https://docs.crowdedkingdoms.com/game-kit/intro) and
1063
1059
  [MIGRATION.md](MIGRATION.md).
1064
1060
 
1065
1061
  ## ck-exec
@@ -1123,7 +1119,7 @@ Integers above 2^53 decode as `number` and lose precision unless you pass
1123
1119
  `{ decode: { useBigInt64: true } }`. A call's whole numbers outside 32 bits (a timestamp in
1124
1120
  milliseconds, a player id) go out as 64-bit integers (18.11.0; before, as floats, which a
1125
1121
  hub's integer fields refuse). The wire format is in the
1126
- [ck-exec docs](https://docs.dev.crowdedkingdoms.com/exec/intro).
1122
+ [ck-exec docs](https://docs.crowdedkingdoms.com/exec/intro).
1127
1123
 
1128
1124
  ### A mod's CLIENT half
1129
1125
 
@@ -1194,7 +1190,7 @@ counts what was dropped); `invoke` sends at most 256 KiB each way and is refused
1194
1190
  module is not running. `NOT_FOUND` holds a CLIENT half back 15 s and `RATE_LIMITED` 60 s. The
1195
1191
  grid's owner is asked about their own CLIENT halves like anyone; answer yes in `confirm` when
1196
1192
  `prompt.authorId` is the player. See
1197
- [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves).
1193
+ [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves).
1198
1194
 
1199
1195
  ## Hosting your game
1200
1196
 
@@ -1207,7 +1203,7 @@ set response headers. Then, in Studio, open the app's
1207
1203
  origin as the app's **Launch URL**. The redirect URI is what admits the origin to CORS
1208
1204
  and to the hosted sign-in return, so `portal.signIn` works there as in the
1209
1205
  [Quick start](#quick-start).
1210
- [Host your game](https://docs.dev.crowdedkingdoms.com/build-a-game/host-your-game)
1206
+ [Host your game](https://docs.crowdedkingdoms.com/build-a-game/host-your-game)
1211
1207
  has the requirements and recipes.
1212
1208
 
1213
1209
  `client.hosting`, `uploadPublishFiles`, `publishDirectory` and `manifestForDirectory`
@@ -1303,8 +1299,8 @@ CLIENT project needs ck-api `v2.25.1` or later. A CLIENT crate still on the lega
1303
1299
  `mountCrowdyStudio` and the controller take `mods: client.exec`. Crowdy Studio runs nothing
1304
1300
  on legacy player compute since 18.0.0.
1305
1301
 
1306
- See [CLIENT halves](https://docs.dev.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.dev.crowdedkingdoms.com/exec/mods)
1307
- and [Embed Crowdy Studio in your game](https://docs.dev.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
1302
+ See [CLIENT halves](https://docs.crowdedkingdoms.com/exec/client-halves), [mods](https://docs.crowdedkingdoms.com/exec/mods)
1303
+ and [Embed Crowdy Studio in your game](https://docs.crowdedkingdoms.com/crowdyjs/crowdy-studio-embed).
1308
1304
 
1309
1305
  ### The Studio agent (DeepSeek Harness in the browser)
1310
1306
 
@@ -1560,7 +1556,7 @@ no other repositories and no network access required:
1560
1556
  `src/generated/graphql-schema.ts`, the generated schema types.
1561
1557
 
1562
1558
  Schema refresh is explicit, from the published
1563
- [SDL](https://docs.dev.crowdedkingdoms.com/schema/application-api.graphql):
1559
+ [SDL](https://docs.crowdedkingdoms.com/schema/application-api.graphql):
1564
1560
 
1565
1561
  ```bash
1566
1562
  npm run schema:sync:prod
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier dev` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier prod` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,14 +10,14 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export declare const CROWDY_DEFAULT_TIER = "dev";
16
+ export declare const CROWDY_DEFAULT_TIER = "prod";
17
17
  /** The public CK API origin for that tier. */
18
- export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.dev.crowdedkingdoms.com";
18
+ export declare const CROWDY_DEFAULT_HTTP_ORIGIN = "https://ck.prod.crowdedkingdoms.com";
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.dev.crowdedkingdoms.com";
20
+ export declare const CROWDY_DEFAULT_WS_ORIGIN = "wss://ck.prod.crowdedkingdoms.com";
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export declare const CROWDY_DEFAULT_HOST = "ck.dev.crowdedkingdoms.com";
22
+ export declare const CROWDY_DEFAULT_HOST = "ck.prod.crowdedkingdoms.com";
23
23
  //# sourceMappingURL=default-origin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,QAAQ,CAAC;AAEzC,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,uCAAuC,CAAC;AAE/E,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,+BAA+B,CAAC"}
1
+ {"version":3,"file":"default-origin.d.ts","sourceRoot":"","sources":["../src/default-origin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,uDAAuD;AACvD,eAAO,MAAM,mBAAmB,SAAS,CAAC;AAE1C,8CAA8C;AAC9C,eAAO,MAAM,0BAA0B,wCAAwC,CAAC;AAEhF,mFAAmF;AACnF,eAAO,MAAM,wBAAwB,sCAAsC,CAAC;AAE5E,4EAA4E;AAC5E,eAAO,MAAM,mBAAmB,gCAAgC,CAAC"}
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * GENERATED — do not edit. The operator tooling's
3
- * `sync-client-origins.mjs --write --tier dev` writes this file, and
3
+ * `sync-client-origins.mjs --write --tier prod` writes this file, and
4
4
  * `check-sdk-default-origin.mjs` refuses it when it names the wrong tier or a
5
5
  * host that declaration does not carry. Regenerate; never hand-edit.
6
6
  *
@@ -10,13 +10,13 @@
10
10
  * than no default at all. Every fallback this SDK ever removed named a host that
11
11
  * was already dead. A generated file plus a gate is what makes this one different.
12
12
  *
13
- * Source: the operator's per-tier public CK API origin declaration, tier 'dev'
13
+ * Source: the operator's per-tier public CK API origin declaration, tier 'prod'
14
14
  */
15
15
  /** The tier this build of the SDK is published for. */
16
- export const CROWDY_DEFAULT_TIER = 'dev';
16
+ export const CROWDY_DEFAULT_TIER = 'prod';
17
17
  /** The public CK API origin for that tier. */
18
- export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.dev.crowdedkingdoms.com';
18
+ export const CROWDY_DEFAULT_HTTP_ORIGIN = 'https://ck.prod.crowdedkingdoms.com';
19
19
  /** The same host over WebSocket. A scheme is composed; a hostname is looked up. */
20
- export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.dev.crowdedkingdoms.com';
20
+ export const CROWDY_DEFAULT_WS_ORIGIN = 'wss://ck.prod.crowdedkingdoms.com';
21
21
  /** The bare hostname, for callers that need to compare rather than dial. */
22
- export const CROWDY_DEFAULT_HOST = 'ck.dev.crowdedkingdoms.com';
22
+ export const CROWDY_DEFAULT_HOST = 'ck.prod.crowdedkingdoms.com';
@@ -966,7 +966,7 @@ export type App = {
966
966
  orgId: Scalars['BigInt']['output'];
967
967
  /** What the safety log records for this app right now, for the notice and the recording indicator a client shows players. Readable with the app's own app token (app(appId)). */
968
968
  recording: AppRecording;
969
- /** OAuth-style redirect-URI allow-list for the portal handoff. A portal authorization code’s redirect_uri must match one of these by origin; empty disallows browser portal entry to this app. */
969
+ /** OAuth-style redirect-URI allow-list for the portal handoff. A portal authorization code’s redirect_uri must match one of these by origin; empty disallows browser portal entry to this app. Empty unless the caller holds manage_apps on this app, including an anonymous appBySlug lookup. Hosted sign-in Cancel uses portalReturnAllowed instead of reading this list. */
970
970
  redirectUris: Array<Scalars['String']['output']>;
971
971
  /** Whether replay logging is on: the realtime servers record every client message they accept for this app, searchable with inputLogSessions and readable with inputLogMessages, and billed as stored input logs. False (the default) records nothing ("No replication logging"). Set with updateApp (manage_apps); turning it on needs a wallet that covers the projected cost of one retention period, or a billing-exempt org. */
972
972
  replayLoggingEnabled: Scalars['Boolean']['output'];
@@ -985,7 +985,7 @@ export type App = {
985
985
  reservedGraphqlOpsPerSec: Scalars['BigInt']['output'];
986
986
  /** Reserved realtime (UDP) capacity in bytes/s. Guarantees a minimum the platform provisions for you; it is not a limit on what you may send. Billed monthly whether or not used, IN ADDITION TO metered usage -- a reservation buys capacity, not volume, so reserving 5 MB/s does not make the first 5 MB/s free. Independent of reservedGraphqlOpsPerSec. 0 = none. */
987
987
  reservedUdpBytesPerSec: Scalars['BigInt']['output'];
988
- /** When runtimeStatus is not "active", why the runtime is gated: "insufficient_funds", "spend_cap", "subscription_lapsed", or "payment_method_required" (the free-tier card requirement applies to the organization and it has no saved card and no exemption). Null when active. Historical rows may carry "free_allowance", which the gate no longer produces -- an app over its allowance with no way to pay is denied as "insufficient_funds". */
988
+ /** When runtimeStatus is not "active", why the runtime is gated: "insufficient_funds", "spend_cap", "subscription_lapsed", or "payment_method_required" (the free-tier card requirement applies to the organization and it has no saved card and no exemption). Null when active, and null unless the caller is a member of the app's organization (a super admin counts). Historical rows may carry "free_allowance", which the gate no longer produces -- an app over its allowance with no way to pay is denied as "insufficient_funds". */
989
989
  runtimeDenialReason: Maybe<Scalars['String']['output']>;
990
990
  /** Shared-environment runtime gate, mirrored to the game DB and enforced by Application API + Buddy: "active", "grace", "denied", or "suspended". */
991
991
  runtimeStatus: Scalars['String']['output'];
@@ -993,7 +993,7 @@ export type App = {
993
993
  slug: Maybe<Scalars['String']['output']>;
994
994
  /** True when this app's runtime data lives in a dedicated per-tenant Application API database (rather than the shared Application API). Used together with applicationApiUrl to route gameplay calls. */
995
995
  splitMode: Scalars['Boolean']['output'];
996
- /** Base64-encoded binary blob of the app's persisted runtime/world state; opaque to clients and potentially large. Null when no state has been saved. */
996
+ /** Base64-encoded binary blob of the app's persisted runtime/world state; opaque to clients and potentially large. Null when no state has been saved, and null unless the caller holds manage_apps on this app. */
997
997
  state: Maybe<Scalars['String']['output']>;
998
998
  /** Lifecycle state (DRAFT/LIVE/ARCHIVED). See AppStatus. */
999
999
  status: AppStatus;
@@ -7816,7 +7816,7 @@ export type Query = {
7816
7816
  allowancePool: AllowancePoolSettings;
7817
7817
  /** Convenience for UI: returns true when the authenticated caller is the currently elected host for the given app (same election as gameHost), otherwise false (including when no host is elected). Not authoritative for server-side decisions. Requires a valid bearer game token (same auth as gameHost). */
7818
7818
  amIGameHost: Scalars['Boolean']['output'];
7819
- /** Fetch a single app by its numeric id. Requires authentication (any signed-in user); does NOT enforce org/app permissions, so it can read apps the caller does not own, of any visibility/status. Returns null if the id does not exist. Prefer appBySlug for slug-based marketplace lookups. */
7819
+ /** Fetch a single app by its numeric id. Requires authentication (any signed-in user) and does not require org membership, so it can name apps the caller does not own, of any visibility/status. Returns null if the id does not exist. redirectUris and state are empty unless the caller holds manage_apps; runtimeDenialReason is null unless the caller is a member of the app's organization. Prefer appBySlug for slug-based marketplace lookups. */
7820
7820
  app: Maybe<App>;
7821
7821
  /** Public listing of an app's access tiers (the free/paid bundles of runtime permissions), ordered by tierOrder ascending. PUBLIC: no authentication required. Powers the marketplace app detail / pricing page. Includes tiers of all statuses; inspect AppAccessTier.status to skip archived tiers. */
7822
7822
  appAccessTiers: Array<AppAccessTier>;
@@ -7824,7 +7824,7 @@ export type Query = {
7824
7824
  appBudget: Maybe<AppBudget>;
7825
7825
  /** Lists every app spend-cap budget configured under the organization. Requires the 'view_billing' org permission. */
7826
7826
  appBudgets: Array<AppBudget>;
7827
- /** Look up a single app by its org slug + app slug (the marketplace URL path). PUBLIC: no authentication required, and NOT filtered by visibility/status, so it can resolve unlisted or draft apps when the exact slugs are known. Returns null if no matching app exists. */
7827
+ /** Look up a single app by its org slug + app slug (the marketplace URL path). PUBLIC: no authentication required, and NOT filtered by visibility/status, so it can resolve unlisted or draft apps when the exact slugs are known. Returns null if no matching app exists. redirectUris and state are empty unless the caller holds manage_apps; runtimeDenialReason is null unless the caller is a member of the app's organization. launchUrl is returned to every caller. */
7828
7828
  appBySlug: Maybe<App>;
7829
7829
  /** Read an app's player-code admission mode. Requires 'view_compute_diagnostics'. IMPLICIT_ALLOW (the default) admits lawful player code without curation; ALLOW_LIST requires every running server/client artifact, including self-authored code, to match an active code, author, or org admission. */
7830
7830
  appCodeAdmissionMode: CodeAdmissionMode;
@@ -7873,7 +7873,7 @@ export type Query = {
7873
7873
  apps: AppsPage;
7874
7874
  /** Public marketplace listing of apps. PUBLIC: no authentication required. Returns ONLY apps with visibility=PUBLIC AND status=LIVE (drafts, unlisted, private, and archived apps are never returned). Results are ordered newest-first. Relay cursor connection; prefer this over the offset-based apps. */
7875
7875
  appsConnection: AppsConnection;
7876
- /** All apps belonging to an organization, identified by the org's slug, regardless of visibility or status (includes drafts and archived). Requires authentication; intended for org dashboards. Ordered newest-first. Returns an empty list for an unknown slug. */
7876
+ /** All apps belonging to an organization, identified by the org's slug, regardless of visibility or status (includes drafts and archived). Requires authentication and an active membership of that organization (super admins pass). Ordered newest-first. Returns an empty list for an unknown slug. A known organization the caller is not a member of is FORBIDDEN. */
7877
7877
  appsForOrg: Array<App>;
7878
7878
  /** The federated sign-in providers currently enabled (e.g. ['google']). Use one with socialLoginStart. */
7879
7879
  availableLoginProviders: Array<Scalars['String']['output']>;
@@ -8197,6 +8197,8 @@ export type Query = {
8197
8197
  playerWalletTransactions: Array<PlayerWalletTransaction>;
8198
8198
  /** Whether portaling the calling user into an app needs a consent prompt. Trusted apps and already-granted apps return consentRequired=false. The identity origin (Studio's hosted sign-in, or a launcher holding the session) calls this before createPortalAuthorizationCode. Requires a SESSION token. */
8199
8199
  portalConsent: PortalConsentState;
8200
+ /** Whether redirectUri is a return address this app registered: its origin matches a redirect URI or the launch URL, and on the games host the path must match too. Studio's hosted sign-in Cancel calls this so a decline can send the player back without the allow-list being readable. Any signed-in session. An unknown app or an unregistered address is false. Requires a SESSION token. */
8201
+ portalReturnAllowed: Scalars['Boolean']['output'];
8200
8202
  /** Lists the app-scoped quota rules explicitly configured for an app (excludes org-, tier-, and free-tier-default quotas). Use `effectiveQuota` to resolve the limit actually applied for a given metric. Requires the 'view_usage' app permission. */
8201
8203
  quotasForApp: Array<ServiceQuota>;
8202
8204
  /** Lists the org-scoped quota rules explicitly configured for an organization (excludes app-, tier-, and free-tier-default quotas). Use `effectiveQuota` to resolve the limit actually applied for a given metric. Requires the 'view_usage' org permission. */
@@ -8829,6 +8831,10 @@ export type QueryPlayerWalletTransactionsArgs = {
8829
8831
  export type QueryPortalConsentArgs = {
8830
8832
  appId: Scalars['BigInt']['input'];
8831
8833
  };
8834
+ export type QueryPortalReturnAllowedArgs = {
8835
+ appId: Scalars['BigInt']['input'];
8836
+ redirectUri: Scalars['String']['input'];
8837
+ };
8832
8838
  export type QueryQuotasForAppArgs = {
8833
8839
  appId: Scalars['BigInt']['input'];
8834
8840
  };