@crowdedkingdoms/crowdyjs 8.11.0 → 8.12.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/README.md CHANGED
@@ -12,7 +12,7 @@ npm install @crowdedkingdoms/crowdyjs
12
12
 
13
13
  CrowdyJS v4 targets browsers by default and uses native `fetch`, `WebSocket`, `crypto`, `btoa`, and `atob`. Node tools can still use the SDK, but must provide browser-compatible globals when opening realtime connections.
14
14
 
15
- > **Server compatibility:** v8.11's **container query predicates** (`where`/`limit`/`offset` on `gameModel.containers`) and **automation compute actions** (`actionKind: 'compute_invoke'` with `computeModuleName`/`computeExport` on `gameModel.upsertAutomation`; `property_changed` events additionally carry `oldValue`/`newValue` to compute modules) require the 2026-07 `cks-game-api` dev line with the `2026-07-19-automation-compute-action` migration; older servers reject the new arguments/fields (omit them and everything else keeps working). v5.2+ targets environments on release **v0.1.19 or later** (`cks-game-api >= v0.10.3`, `cks-management-api >= v0.1.70`). The destructive mutations send an `idempotencyKey` argument that older servers don't define. v6.1's `client.gameApps.deleteGrid` additionally requires release **v0.1.33+** (`cks-game-api >= v0.12.3`). The game-model **permission effects** fields (`permissionEffects` on `gameModel.upsertFunction`/`seed`, `permissionEffectsAppliedJson` on events) require a `cks-game-api` build with the `2026-07-17-model-permission-effects` migration (v0.13.11+); older servers reject queries/mutations that include them (omit the fields and everything else keeps working). The **permission-read** surface (the `has_grid_permission`/`grid_at`/`has_chunk_permission` expression builtins the kit's `chunkPermission` locks compile to, and selector `*PermissionWhere` predicates) additionally requires `cks-game-api` **v0.13.12+**. Older `cks-game-api` builds report game-model **invoke policy denials** as `FORBIDDEN` GraphQL errors instead of resolving with `success: false`; as of this version the kit's invoke helpers map that error onto the documented `{ success: false, errorMessage }` result, so kit callers behave identically against both server generations. v8.6's **`client.compute`** (Compute Modules — server-side Rust/WASM logic) requires a `cks-game-api` build with the compute surface (the `compute*` root fields, v0.13.13+ dev line); older servers reject these operations with a GraphQL validation error, and everything else keeps working. v8.9's **realtime + live-ops surfaces** (`kit.abilities`/`movement`/`territory`/`racing`/`liveops`/`moderation`/`telemetry`, the loot engine path, `client.compute.deployTemplate` + `kit.deploy({engines})`, and the type-94..98 event parsers) complete the 30-abstraction catalog; v8.8's **session-genre engine surfaces** (`kit.instances`/`director`/`matchmaking`/`minigames`, the engine paths on matches/decks/leaderboards, `economy.orderBook`, and the type-91/92/93 event parsers) talk to the Wave 2 engine templates; capability detection keeps model-only deployments on today's behavior. v8.7's **engine kit surfaces** (`kit.mobs`, `kit.pets`, `kit.combat.attackRouted`, `kit.worldsim.forecast`, and the `kit/wire` pose/lane registry) talk to compute-module game engines built on the Wave 0/1 `cks-game-api` dev line (`crowdy-game-kit` crates); capability detection makes them degrade gracefully — model-only deployments keep today's behavior.
15
+ > **Server compatibility:** v8.12's **container query predicates** (`where`/`limit`/`offset` on `gameModel.containers`), **automation compute actions** (`actionKind: 'compute_invoke'` with `computeModuleName`/`computeExport` on `gameModel.upsertAutomation`; `property_changed` events additionally carry `oldValue`/`newValue` to compute modules), **container-change push** (`gameModel.containerChanged` — metadata-only pull-on-push over graphql-transport-ws; on Node ≤ 21 pass `webSocketImpl`), and **invoke-trigger contracts** (`contractJson` on `compute.upsertTrigger`/`moduleTriggers`, validated server-side pre-sandbox) require the 2026-07 `cks-game-api` dev line with the `2026-07-19-automation-compute-action` migration; older servers reject the new arguments/fields (omit them and everything else keeps working). (npm 8.11.0 is a partial cut of this surface — prefer 8.12.0.) v8.12 also adds the `runOptimisticAction` kit helper (client-only: the packaged optimistic apply → referee invoke → confirm/rollback loop with actionId receipts). v5.2+ targets environments on release **v0.1.19 or later** (`cks-game-api >= v0.10.3`, `cks-management-api >= v0.1.70`). The destructive mutations send an `idempotencyKey` argument that older servers don't define. v6.1's `client.gameApps.deleteGrid` additionally requires release **v0.1.33+** (`cks-game-api >= v0.12.3`). The game-model **permission effects** fields (`permissionEffects` on `gameModel.upsertFunction`/`seed`, `permissionEffectsAppliedJson` on events) require a `cks-game-api` build with the `2026-07-17-model-permission-effects` migration (v0.13.11+); older servers reject queries/mutations that include them (omit the fields and everything else keeps working). The **permission-read** surface (the `has_grid_permission`/`grid_at`/`has_chunk_permission` expression builtins the kit's `chunkPermission` locks compile to, and selector `*PermissionWhere` predicates) additionally requires `cks-game-api` **v0.13.12+**. Older `cks-game-api` builds report game-model **invoke policy denials** as `FORBIDDEN` GraphQL errors instead of resolving with `success: false`; as of this version the kit's invoke helpers map that error onto the documented `{ success: false, errorMessage }` result, so kit callers behave identically against both server generations. v8.6's **`client.compute`** (Compute Modules — server-side Rust/WASM logic) requires a `cks-game-api` build with the compute surface (the `compute*` root fields, v0.13.13+ dev line); older servers reject these operations with a GraphQL validation error, and everything else keeps working. v8.9's **realtime + live-ops surfaces** (`kit.abilities`/`movement`/`territory`/`racing`/`liveops`/`moderation`/`telemetry`, the loot engine path, `client.compute.deployTemplate` + `kit.deploy({engines})`, and the type-94..98 event parsers) complete the 30-abstraction catalog; v8.8's **session-genre engine surfaces** (`kit.instances`/`director`/`matchmaking`/`minigames`, the engine paths on matches/decks/leaderboards, `economy.orderBook`, and the type-91/92/93 event parsers) talk to the Wave 2 engine templates; capability detection keeps model-only deployments on today's behavior. v8.7's **engine kit surfaces** (`kit.mobs`, `kit.pets`, `kit.combat.attackRouted`, `kit.worldsim.forecast`, and the `kit/wire` pose/lane registry) talk to compute-module game engines built on the Wave 0/1 `cks-game-api` dev line (`crowdy-game-kit` crates); capability detection makes them degrade gracefully — model-only deployments keep today's behavior.
16
16
 
17
17
  > **v8.10 inventory authority:** generated craft/barter transactions work on
18
18
  > existing Model servers. Compute-refereed durable commits require Compute SDK
@@ -1 +1 @@
1
- {"version":3,"file":"crowdy-client.d.ts","sourceRoot":"","sources":["../src/crowdy-client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;GAqBG;AAEH,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,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AW,CAAC;IAC/B,2EAA2E;IAC3E,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC;IACzB,gFAAgF;IAChF,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,wEAAwE;IACxE,QAAQ,CAAC,SAAS,EAAE,YAAY,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,kEAAkE;IAClE,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,qDAAqD;IACrD,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAC;gBAEnB,MAAM,GAAE,kBAAuB;IA8F3C,4EAA4E;IAC5E,QAAQ,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI;IAIpC,0DAA0D;IAC1D,QAAQ,IAAI,MAAM,GAAG,IAAI;IAIzB;;;;;;;OAOG;IACH,KAAK,CAAC,KAAK,EAAE,MAAM,GAAG,WAAW;IAIjC;;;;;;;;;;;;OAYG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,aAAa;IAS3D,gEAAgE;IAChE,KAAK,IAAI,IAAI;CAId;AAED,wBAAgB,kBAAkB,CAChC,MAAM,GAAE,kBAAuB,GAC9B,YAAY,CAEd"}
@@ -109,7 +109,10 @@ export class CrowdyClient {
109
109
  this.channels = new ChannelsAPI(this.graphql);
110
110
  this.teams = new TeamsAPI(this.graphql);
111
111
  this.udp = new UdpAPI(this.graphql, this.realtime, this.metrics);
112
- this.gameModel = new GameModelAPI(this.graphql);
112
+ this.gameModel = new GameModelAPI(this.graphql, {
113
+ wsUrl: config.wsEndpoint ?? toGraphqlEndpoint(config.wsUrl, 'graphql'),
114
+ getToken: () => this.session.getToken(),
115
+ });
113
116
  this.compute = new ComputeAPI(this.graphql);
114
117
  this.avatars = new AvatarsAPI(this.graphql);
115
118
  this.host = new HostAPI(this.graphql);
@@ -1,5 +1,5 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutationVariables, type GameModelJoinSessionMutation, type GameModelJoinSessionMutationVariables, type GameModelSetSessionTurnMutation, type GameModelSetSessionTurnMutationVariables, type GameModelCreateContainerMutation, type GameModelCreateContainerMutationVariables, type GameModelDeleteContainerMutation, type GameModelDeleteContainerMutationVariables, type GameModelSetPropertyMutation, type GameModelSetPropertyMutationVariables, type GameModelAddEdgeMutation, type GameModelAddEdgeMutationVariables, type GameModelDeleteEdgeMutation, type GameModelDeleteEdgeMutationVariables, type GameModelInvokeMutation, type GameModelInvokeMutationVariables, type GameModelContainerQuery, type GameModelContainerQueryVariables, type GameModelContainersQuery, type GameModelContainersQueryVariables, type GameModelContainerStateQuery, type GameModelContainerStateQueryVariables, type GameModelTraverseQuery, type GameModelTraverseQueryVariables, type GameModelSessionQuery, type GameModelSessionQueryVariables, type GameModelSessionsQuery, type GameModelSessionsQueryVariables, type GameModelEventsQuery, type GameModelEventsQueryVariables, type GameModelSeedMutation, type GameModelSeedMutationVariables, type GameModelUpsertContainerTypeMutation, type GameModelUpsertContainerTypeMutationVariables, type GameModelUpsertPropertyDefMutation, type GameModelUpsertPropertyDefMutationVariables, type GameModelDeletePropertyDefMutation, type GameModelDeletePropertyDefMutationVariables, type GameModelDeleteContainerTypeMutation, type GameModelDeleteContainerTypeMutationVariables, type GameModelUpsertFunctionMutation, type GameModelUpsertFunctionMutationVariables, type GameModelDeleteFunctionMutation, type GameModelDeleteFunctionMutationVariables, type GameModelDefineFeatureMutation, type GameModelDefineFeatureMutationVariables, type GameModelGrantTierFeatureMutation, type GameModelGrantTierFeatureMutationVariables, type GameModelSetPolicyMutation, type GameModelSetPolicyMutationVariables, type GameModelTypeSchemaQuery, type GameModelTypeSchemaQueryVariables, type GameModelContainerTypesQuery, type GameModelContainerTypesQueryVariables, type GameModelPropertyDefsQuery, type GameModelPropertyDefsQueryVariables, type GameModelFunctionQuery, type GameModelFunctionQueryVariables, type GameModelFunctionsQuery, type GameModelFunctionsQueryVariables, type GameModelFeaturesQuery, type GameModelFeaturesQueryVariables, type GameModelTierFeaturesQuery, type GameModelTierFeaturesQueryVariables, type GameModelPolicyQuery, type GameModelPolicyQueryVariables, type GameModelRevokeTierFeatureMutation, type GameModelRevokeTierFeatureMutationVariables, type GameModelEventsConnectionQuery, type GameModelEventsConnectionQueryVariables, type GameModelUpsertAutomationMutation, type GameModelUpsertAutomationMutationVariables, type GameModelDeleteAutomationMutation, type GameModelDeleteAutomationMutationVariables, type GameModelSetAutomationEnabledMutation, type GameModelSetAutomationEnabledMutationVariables, type GameModelUpsertAutomationTriggerMutation, type GameModelUpsertAutomationTriggerMutationVariables, type GameModelDeleteAutomationTriggerMutation, type GameModelDeleteAutomationTriggerMutationVariables, type GameModelSetAutomationPolicyMutation, type GameModelSetAutomationPolicyMutationVariables, type GameModelRunAutomationMutation, type GameModelRunAutomationMutationVariables, type GameModelAutomationsQuery, type GameModelAutomationsQueryVariables, type GameModelAutomationQuery, type GameModelAutomationQueryVariables, type GameModelAutomationTriggersQuery, type GameModelAutomationTriggersQueryVariables, type GameModelAutomationPolicyQuery, type GameModelAutomationPolicyQueryVariables, type GameModelAutomationRunsQuery, type GameModelAutomationRunsQueryVariables, type GameModelAutomationStatsQuery, type GameModelAutomationStatsQueryVariables, type GameModelAppDiagnosticsQuery, type GameModelAppDiagnosticsQueryVariables } from '../generated/graphql.js';
2
+ import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutationVariables, type GameModelJoinSessionMutation, type GameModelJoinSessionMutationVariables, type GameModelSetSessionTurnMutation, type GameModelSetSessionTurnMutationVariables, type GameModelCreateContainerMutation, type GameModelCreateContainerMutationVariables, type GameModelDeleteContainerMutation, type GameModelDeleteContainerMutationVariables, type GameModelSetPropertyMutation, type GameModelSetPropertyMutationVariables, type GameModelAddEdgeMutation, type GameModelAddEdgeMutationVariables, type GameModelDeleteEdgeMutation, type GameModelDeleteEdgeMutationVariables, type GameModelInvokeMutation, type GameModelInvokeMutationVariables, type GameModelContainerQuery, type GameModelContainerQueryVariables, GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables, type GameModelContainersQuery, type GameModelContainersQueryVariables, type GameModelContainerStateQuery, type GameModelContainerStateQueryVariables, type GameModelTraverseQuery, type GameModelTraverseQueryVariables, type GameModelSessionQuery, type GameModelSessionQueryVariables, type GameModelSessionsQuery, type GameModelSessionsQueryVariables, type GameModelEventsQuery, type GameModelEventsQueryVariables, type GameModelSeedMutation, type GameModelSeedMutationVariables, type GameModelUpsertContainerTypeMutation, type GameModelUpsertContainerTypeMutationVariables, type GameModelUpsertPropertyDefMutation, type GameModelUpsertPropertyDefMutationVariables, type GameModelDeletePropertyDefMutation, type GameModelDeletePropertyDefMutationVariables, type GameModelDeleteContainerTypeMutation, type GameModelDeleteContainerTypeMutationVariables, type GameModelUpsertFunctionMutation, type GameModelUpsertFunctionMutationVariables, type GameModelDeleteFunctionMutation, type GameModelDeleteFunctionMutationVariables, type GameModelDefineFeatureMutation, type GameModelDefineFeatureMutationVariables, type GameModelGrantTierFeatureMutation, type GameModelGrantTierFeatureMutationVariables, type GameModelSetPolicyMutation, type GameModelSetPolicyMutationVariables, type GameModelTypeSchemaQuery, type GameModelTypeSchemaQueryVariables, type GameModelContainerTypesQuery, type GameModelContainerTypesQueryVariables, type GameModelPropertyDefsQuery, type GameModelPropertyDefsQueryVariables, type GameModelFunctionQuery, type GameModelFunctionQueryVariables, type GameModelFunctionsQuery, type GameModelFunctionsQueryVariables, type GameModelFeaturesQuery, type GameModelFeaturesQueryVariables, type GameModelTierFeaturesQuery, type GameModelTierFeaturesQueryVariables, type GameModelPolicyQuery, type GameModelPolicyQueryVariables, type GameModelRevokeTierFeatureMutation, type GameModelRevokeTierFeatureMutationVariables, type GameModelEventsConnectionQuery, type GameModelEventsConnectionQueryVariables, type GameModelUpsertAutomationMutation, type GameModelUpsertAutomationMutationVariables, type GameModelDeleteAutomationMutation, type GameModelDeleteAutomationMutationVariables, type GameModelSetAutomationEnabledMutation, type GameModelSetAutomationEnabledMutationVariables, type GameModelUpsertAutomationTriggerMutation, type GameModelUpsertAutomationTriggerMutationVariables, type GameModelDeleteAutomationTriggerMutation, type GameModelDeleteAutomationTriggerMutationVariables, type GameModelSetAutomationPolicyMutation, type GameModelSetAutomationPolicyMutationVariables, type GameModelRunAutomationMutation, type GameModelRunAutomationMutationVariables, type GameModelAutomationsQuery, type GameModelAutomationsQueryVariables, type GameModelAutomationQuery, type GameModelAutomationQueryVariables, type GameModelAutomationTriggersQuery, type GameModelAutomationTriggersQueryVariables, type GameModelAutomationPolicyQuery, type GameModelAutomationPolicyQueryVariables, type GameModelAutomationRunsQuery, type GameModelAutomationRunsQueryVariables, type GameModelAutomationStatsQuery, type GameModelAutomationStatsQueryVariables, type GameModelAppDiagnosticsQuery, type GameModelAppDiagnosticsQueryVariables } from '../generated/graphql.js';
3
3
  /**
4
4
  * Abstract **game-model** sub-client on the **game-api** — a schema-driven,
5
5
  * server-authoritative layer for modelling game/world logic on top of the
@@ -76,9 +76,45 @@ import { type GameModelCreateSessionMutation, type GameModelCreateSessionMutatio
76
76
  * if (!result.success) console.warn(result.errorMessage); // authority/eval failures don't throw
77
77
  * ```
78
78
  */
79
+ /** One container-change push from {@link GameModelAPI.containerChanged}. */
80
+ export type GmContainerChangeEvent = GameModelContainerChangedSubscription['gameModelContainerChanged'];
81
+ /** Handlers for {@link GameModelAPI.containerChanged}. */
82
+ export interface ContainerChangedHandlers {
83
+ /** A container changed (metadata only — pull state on receipt). */
84
+ next: (change: GmContainerChangeEvent) => void;
85
+ /** Transport/GraphQL errors (the subscription retries on socket drops). */
86
+ error?: (error: unknown) => void;
87
+ /** The server ended the stream. */
88
+ complete?: () => void;
89
+ /**
90
+ * WebSocket constructor for runtimes without a global `WebSocket` (Node
91
+ * ≤ 21): pass `(await import('ws')).default`.
92
+ */
93
+ webSocketImpl?: unknown;
94
+ }
79
95
  export declare class GameModelAPI {
80
96
  private gql;
81
- constructor(gql: GraphQLClient);
97
+ private readonly ws?;
98
+ constructor(gql: GraphQLClient, ws?: {
99
+ wsUrl?: string;
100
+ getToken: () => string | null;
101
+ } | undefined);
102
+ /**
103
+ * **Subscriptions** — stream container-change notifications for an app
104
+ * (`gameModelContainerChanged`): an invoke mutated a container, a direct
105
+ * `setProperty` wrote it, or it was created/deleted. Events are
106
+ * **metadata only** (containerId, typeName, changedKeys — no property
107
+ * values): pull the visibility-filtered state with {@link containerState}
108
+ * on receipt. Post-commit and best-effort, exactly like model-driven
109
+ * notifications — replaces interval polling with pull-on-push. Requires a
110
+ * game-api with the container-change feed (2026-07+) and a `wsUrl` in the
111
+ * client config.
112
+ *
113
+ * @param variables - `{ appId, typeName?, sessionId? }` delivery filters.
114
+ * @param handlers - `next` per change; optional `error` / `complete`.
115
+ * @returns An unsubscribe function (closes this subscription's socket).
116
+ */
117
+ containerChanged(variables: GameModelContainerChangedSubscriptionVariables, handlers: ContainerChangedHandlers): () => void;
82
118
  /**
83
119
  * **Sessions** — create a runtime session: an isolated instance scope for
84
120
  * containers (e.g. a match, room, or save). Subject to the app's
@@ -1 +1 @@
1
- {"version":3,"file":"gameModel.d.ts","sourceRoot":"","sources":["../../src/domains/gameModel.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAGL,KAAK,8BAA8B,EACnC,KAAK,uCAAuC,EAE5C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,gCAAgC,EACrC,KAAK,yCAAyC,EAE9C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,2BAA2B,EAChC,KA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;;;;;;OAQG;IACG,eAAe,CACnB,SAAS,EAAE,sCAAsC,GAChD,OAAO,CAAC,6BAA6B,CAAC,0BAA0B,CAAC,CAAC;IAKrE;;;;;;;;OAQG;IACG,cAAc,CAClB,SAAS,EAAE,qCAAqC,GAC/C,OAAO,CAAC,4BAA4B,CAAC,yBAAyB,CAAC,CAAC;CAIpE"}
@@ -1,89 +1,65 @@
1
+ import { createClient as createWsClient } from 'graphql-ws';
2
+ import { print } from 'graphql';
1
3
  import {
2
4
  // Runtime (player) ops
3
- GameModelCreateSessionDocument, GameModelJoinSessionDocument, GameModelSetSessionTurnDocument, GameModelCreateContainerDocument, GameModelDeleteContainerDocument, GameModelSetPropertyDocument, GameModelAddEdgeDocument, GameModelDeleteEdgeDocument, GameModelInvokeDocument, GameModelContainerDocument, GameModelContainersDocument, GameModelContainerStateDocument, GameModelTraverseDocument, GameModelSessionDocument, GameModelSessionsDocument, GameModelEventsDocument,
5
+ GameModelCreateSessionDocument, GameModelJoinSessionDocument, GameModelSetSessionTurnDocument, GameModelCreateContainerDocument, GameModelDeleteContainerDocument, GameModelSetPropertyDocument, GameModelAddEdgeDocument, GameModelDeleteEdgeDocument, GameModelInvokeDocument, GameModelContainerDocument, GameModelContainerChangedDocument, GameModelContainersDocument, GameModelContainerStateDocument, GameModelTraverseDocument, GameModelSessionDocument, GameModelSessionsDocument, GameModelEventsDocument,
4
6
  // Studio authoring ops
5
7
  GameModelSeedDocument, GameModelUpsertContainerTypeDocument, GameModelUpsertPropertyDefDocument, GameModelDeletePropertyDefDocument, GameModelDeleteContainerTypeDocument, GameModelUpsertFunctionDocument, GameModelDeleteFunctionDocument, GameModelDefineFeatureDocument, GameModelGrantTierFeatureDocument, GameModelSetPolicyDocument, GameModelTypeSchemaDocument, GameModelContainerTypesDocument, GameModelPropertyDefsDocument, GameModelFunctionDocument, GameModelFunctionsDocument, GameModelFeaturesDocument, GameModelTierFeaturesDocument, GameModelPolicyDocument, GameModelRevokeTierFeatureDocument, GameModelEventsConnectionDocument,
6
8
  // Automations (autonomous processes / NPCs)
7
9
  GameModelUpsertAutomationDocument, GameModelDeleteAutomationDocument, GameModelSetAutomationEnabledDocument, GameModelUpsertAutomationTriggerDocument, GameModelDeleteAutomationTriggerDocument, GameModelSetAutomationPolicyDocument, GameModelRunAutomationDocument, GameModelAutomationsDocument, GameModelAutomationDocument, GameModelAutomationTriggersDocument, GameModelAutomationPolicyDocument, GameModelAutomationRunsDocument, GameModelAutomationStatsDocument, GameModelAppDiagnosticsDocument, } from '../generated/graphql.js';
8
- /**
9
- * Abstract **game-model** sub-client on the **game-api** — a schema-driven,
10
- * server-authoritative layer for modelling game/world logic on top of the
11
- * spatial voxel world. Studios *author* the model; players *query* state and
12
- * *invoke* functions at runtime. Exposed as `client.gameModel`.
13
- *
14
- * The model is a typed graph of entities:
15
- * - **Container types** are the schemas (like classes) for a kind of entity.
16
- * **Property definitions** are their typed fields, each with a default value,
17
- * a read **visibility** (`public | owner | hidden`) and a **writability**
18
- * (`function | owner | admin`). See {@link upsertContainerType} /
19
- * {@link upsertPropertyDef} / {@link typeSchema}.
20
- * - **Containers** are the runtime instances of a type, optionally scoped to a
21
- * session and carrying property values. See {@link createContainer},
22
- * {@link container}, {@link containers}, {@link containerState}.
23
- * - **Functions** are named, sandboxed behaviours over containers: typed
24
- * parameters, declared property **mutations** (expressions compiled to an AST
25
- * server-side — never `eval`'d), an optional return expression, an
26
- * `invokeScope` (`player | server | internal`), and an **invoke policy** — an
27
- * authority rule tree of `owner_of_self`, `is_host`, `is_current_turn`,
28
- * `is_participant`, `tier_feature`, `group_permission`, `grid_permission`, and
29
- * `condition` rules. {@link invoke} is the primary, *safe* way for players to
30
- * mutate state: the server checks the policy, evaluates the expressions,
31
- * applies the mutations atomically, and logs an **event**.
32
- * - **Sessions** are isolated instance scopes (a match, room, or save) with
33
- * **participants**, a creator, and an optional current-**turn** user for
34
- * turn-based play. See {@link createSession}, {@link joinSession},
35
- * {@link setSessionTurn}, {@link session}, {@link sessions}.
36
- * - **Edges** are directed, typed relationships between containers (the model is
37
- * a graph); {@link traverse} walks them from a root up to a depth. See
38
- * {@link addEdge}.
39
- * - **Events** are an audit log of every function invocation and its outcome.
40
- * See {@link events}.
41
- * - **App features** are keys functions gate on (via `tier_feature` rules) and
42
- * that **access tiers** can be granted ({@link defineFeature},
43
- * {@link grantTierFeature}); **policy** governs who may create sessions and the
44
- * default participant role ({@link setPolicy}).
45
- * - {@link seed} bulk-creates definitions *and* instances in one transaction for
46
- * model init/import.
47
- *
48
- * **Encoding.** `BigInt` ids (`appId`, `tierId`, every `*UserId`) are sent and
49
- * received as decimal **strings**. Container, session, function, edge, and event
50
- * ids are opaque **UUID strings**. All structured values travel as JSON-encoded
51
- * strings in the `*Json` fields (`metadataJson`, `propertiesJson`, `paramsJson`,
52
- * `valueJson`, `returnValueJson`, `invokePolicyJson`, `idMapJson`, …) — callers
53
- * `JSON.parse` / `JSON.stringify` around them. (Unlike actor/state blobs, these
54
- * are JSON text, not base64.)
55
- *
56
- * **Auth.** Every call requires an authenticated session (a Bearer token set via
57
- * `client.auth.login()` or `client.setToken()`) scoped to the target app, or it
58
- * throws {@link CrowdyGraphQLError} (`UNAUTHENTICATED` / `SCOPE_MISSING`). The
59
- * **studio-authoring** methods ({@link seed}, {@link upsertContainerType},
60
- * {@link upsertPropertyDef}, {@link deletePropertyDef}, {@link upsertFunction},
61
- * {@link deleteFunction}, {@link deleteContainerType}, {@link defineFeature},
62
- * {@link grantTierFeature}, {@link setPolicy}) and the
63
- * {@link typeSchema} query additionally require the app-admin **`manage_apps`**
64
- * permission (otherwise `FORBIDDEN`, with `extensions.requiredPermission ===
65
- * 'manage_apps'`); the runtime/player methods need only a valid token plus
66
- * whatever per-operation policy applies (session-creation policy, a type's
67
- * `instantiableBy` rule, a property's `writable` rule, or a function's invoke
68
- * policy).
69
- *
70
- * @example
71
- * ```ts
72
- * // Studio authors a type, then a player creates a session and invokes a function.
73
- * await client.gameModel.upsertContainerType({ appId, typeName: 'Player', displayName: 'Player' });
74
- * const session = await client.gameModel.createSession({ appId, name: 'Match 1' });
75
- * const result = await client.gameModel.invoke({
76
- * appId,
77
- * functionName: 'takeDamage',
78
- * selfContainerId,
79
- * paramsJson: JSON.stringify({ amount: 10 }),
80
- * });
81
- * if (!result.success) console.warn(result.errorMessage); // authority/eval failures don't throw
82
- * ```
83
- */
84
10
  export class GameModelAPI {
85
- constructor(gql) {
11
+ constructor(gql, ws) {
86
12
  this.gql = gql;
13
+ this.ws = ws;
14
+ }
15
+ /**
16
+ * **Subscriptions** — stream container-change notifications for an app
17
+ * (`gameModelContainerChanged`): an invoke mutated a container, a direct
18
+ * `setProperty` wrote it, or it was created/deleted. Events are
19
+ * **metadata only** (containerId, typeName, changedKeys — no property
20
+ * values): pull the visibility-filtered state with {@link containerState}
21
+ * on receipt. Post-commit and best-effort, exactly like model-driven
22
+ * notifications — replaces interval polling with pull-on-push. Requires a
23
+ * game-api with the container-change feed (2026-07+) and a `wsUrl` in the
24
+ * client config.
25
+ *
26
+ * @param variables - `{ appId, typeName?, sessionId? }` delivery filters.
27
+ * @param handlers - `next` per change; optional `error` / `complete`.
28
+ * @returns An unsubscribe function (closes this subscription's socket).
29
+ */
30
+ containerChanged(variables, handlers) {
31
+ if (!this.ws?.wsUrl) {
32
+ throw new Error('containerChanged requires a wsUrl in the client config (graphql-transport-ws endpoint)');
33
+ }
34
+ const client = createWsClient({
35
+ url: this.ws.wsUrl,
36
+ lazy: false,
37
+ retryAttempts: 8,
38
+ ...(handlers.webSocketImpl
39
+ ? { webSocketImpl: handlers.webSocketImpl }
40
+ : {}),
41
+ connectionParams: () => {
42
+ const token = this.ws?.getToken();
43
+ return token ? { Authorization: `Bearer ${token}` } : {};
44
+ },
45
+ });
46
+ const dispose = client.subscribe({ query: print(GameModelContainerChangedDocument), variables }, {
47
+ next: (msg) => {
48
+ const data = msg.data;
49
+ if (data?.gameModelContainerChanged) {
50
+ handlers.next(data.gameModelContainerChanged);
51
+ }
52
+ else if (msg.errors) {
53
+ handlers.error?.(msg.errors);
54
+ }
55
+ },
56
+ error: (err) => handlers.error?.(err),
57
+ complete: () => handlers.complete?.(),
58
+ });
59
+ return () => {
60
+ dispose();
61
+ void client.dispose();
62
+ };
87
63
  }
88
64
  // -- Runtime (player) -------------------------------------------------------
89
65
  /**
@@ -2437,6 +2437,26 @@ export type GmContainer = {
2437
2437
  /** The container type name. */
2438
2438
  typeName: Scalars['String']['output'];
2439
2439
  };
2440
+ /** One container-change notification from gameModelContainerChanged. Metadata only (no property values): clients pull the visibility-filtered state with gameModelContainerState on receipt. Delivery is post-commit and best-effort, like model-driven notifications. */
2441
+ export type GmContainerChange = {
2442
+ __typename?: 'GmContainerChange';
2443
+ /** The app (tenant). */
2444
+ appId: Scalars['BigInt']['output'];
2445
+ /** The property keys the change touched (empty for created/deleted; clamped to 32 keys). */
2446
+ changedKeys: Array<Scalars['String']['output']>;
2447
+ /** The container that changed. */
2448
+ containerId: Scalars['String']['output'];
2449
+ /** For source='function': the function that mutated it. */
2450
+ functionName: Maybe<Scalars['String']['output']>;
2451
+ /** When the change committed. */
2452
+ occurredAt: Scalars['DateTime']['output'];
2453
+ /** The session scope of the change, when any. */
2454
+ sessionId: Maybe<Scalars['String']['output']>;
2455
+ /** What changed it: 'function' (invoke mutation), 'direct' (gameModelSetProperty), 'created', or 'deleted'. */
2456
+ source: Scalars['String']['output'];
2457
+ /** The container type (null if the type is unknown). */
2458
+ typeName: Maybe<Scalars['String']['output']>;
2459
+ };
2440
2460
  /** A container plus its property values filtered to what the requesting caller is allowed to see. */
2441
2461
  export type GmContainerState = {
2442
2462
  __typename?: 'GmContainerState';
@@ -5893,9 +5913,16 @@ export type SocialLoginStartInput = {
5893
5913
  };
5894
5914
  export type Subscription = {
5895
5915
  __typename?: 'Subscription';
5916
+ /** Push notification whenever a container in the app changes: an invoke mutated it, a direct gameModelSetProperty wrote it, or it was created/deleted. Metadata only (containerId, typeName, changedKeys — no property values); pull the visibility-filtered state with gameModelContainerState on receipt. Post-commit and best-effort (a dropped event costs one missed pull, never correctness) — durable reads remain the source of truth. Optional typeName/sessionId filters narrow delivery. Fans out across all API replicas. Requires a valid token. Replaces interval polling with pull-on-push. */
5917
+ gameModelContainerChanged: GmContainerChange;
5896
5918
  /** Realtime downlink from the game server: spatial notifications and responses, GenericErrorResponse (errors from your sends, correlated by sequenceNumber), and RealtimeConnectionEvent (lifecycle/setup failures). Requires a bearer game token AND an appId-scoped connection — the appId is read from the graphql-transport-ws connection (game tokens are app-agnostic and one UDP socket is shared across apps, so an app-agnostic subscription is rejected with a RealtimeConnectionEvent code APP_ID_REQUIRED, and a missing/invalid token with AUTH_REQUIRED). On subscribe, opens a UDP proxy session if none exists (binds to the least-loaded game server); open/transport failures are delivered as RealtimeConnectionEvent (code UDP_PROXY_CONNECTION_FAILED) and then the stream ends. Only this app’s spatial fan-out is delivered; appId-less control frames always pass. Subscribe before/while sending so async results are not missed. Unsubscribing stops delivery only — it does NOT close the UDP session; call disconnectUdpProxy (or rely on the server inactivity timeout) to release it. */
5897
5919
  udpNotifications: Maybe<UdpNotification>;
5898
5920
  };
5921
+ export type SubscriptionGameModelContainerChangedArgs = {
5922
+ appId: Scalars['BigInt']['input'];
5923
+ sessionId?: InputMaybe<Scalars['String']['input']>;
5924
+ typeName?: InputMaybe<Scalars['String']['input']>;
5925
+ };
5899
5926
  export type TeleportRequestInput = {
5900
5927
  /** App (game) to teleport within. Must be greater than 0 (a non-positive value yields errorCode INVALID_APP_ID). BigInt sent as a decimal string. */
5901
5928
  appId: Scalars['BigInt']['input'];
@@ -6276,6 +6303,8 @@ export type UpsertComputeTriggerInput = {
6276
6303
  appId: Scalars['BigInt']['input'];
6277
6304
  /** Event filter: only this container type. */
6278
6305
  containerTypeName?: InputMaybe<Scalars['String']['input']>;
6306
+ /** For invoke triggers: optional typed contract (JSON): {"params": {name: {type, required?, description?}}, "result": {...}, "description"?}. Types: int|float|string|bool|object|array. Declared params are validated on computeInvoke BEFORE the sandbox runs (required presence + type; undeclared params pass through); result is documentation/codegen only. Null = no validation. */
6307
+ contractJson?: InputMaybe<Scalars['String']['input']>;
6279
6308
  /** Debounce/coalesce window in ms for event triggers. */
6280
6309
  debounceMs?: InputMaybe<Scalars['Int']['input']>;
6281
6310
  /** Event filter: only compute events with this name (on_event=compute_event). */
@@ -6908,6 +6937,8 @@ export type WasmModuleTrigger = {
6908
6937
  appId: Scalars['BigInt']['output'];
6909
6938
  /** Event filter: only this container type. */
6910
6939
  containerTypeName: Maybe<Scalars['String']['output']>;
6940
+ /** For invoke triggers: the typed contract (JSON: params/result field maps with int|float|string|bool|object|array types). The platform validates computeInvoke params against it pre-sandbox; client codegen reads it for typed wrappers. Null = undeclared. */
6941
+ contractJson: Maybe<Scalars['String']['output']>;
6911
6942
  /** When the trigger was created. */
6912
6943
  createdAt: Scalars['DateTime']['output'];
6913
6944
  /** Debounce/coalesce window in ms. */
@@ -8558,6 +8589,7 @@ export type ComputeTriggerFieldsFragment = {
8558
8589
  debounceMs: number;
8559
8590
  exportName: string | null;
8560
8591
  invokePolicyJson: string | null;
8592
+ contractJson: string | null;
8561
8593
  createdAt: string;
8562
8594
  };
8563
8595
  export type ComputePolicyFieldsFragment = {
@@ -8690,6 +8722,7 @@ export type ComputeUpsertTriggerMutation = {
8690
8722
  debounceMs: number;
8691
8723
  exportName: string | null;
8692
8724
  invokePolicyJson: string | null;
8725
+ contractJson: string | null;
8693
8726
  createdAt: string;
8694
8727
  };
8695
8728
  };
@@ -8828,6 +8861,7 @@ export type ComputeModuleTriggersQuery = {
8828
8861
  debounceMs: number;
8829
8862
  exportName: string | null;
8830
8863
  invokePolicyJson: string | null;
8864
+ contractJson: string | null;
8831
8865
  createdAt: string;
8832
8866
  }>;
8833
8867
  };
@@ -10547,6 +10581,25 @@ export type GameModelContainersQuery = {
10547
10581
  metadataJson: string;
10548
10582
  }>;
10549
10583
  };
10584
+ export type GameModelContainerChangedSubscriptionVariables = Exact<{
10585
+ appId: Scalars['BigInt']['input'];
10586
+ typeName?: InputMaybe<Scalars['String']['input']>;
10587
+ sessionId?: InputMaybe<Scalars['String']['input']>;
10588
+ }>;
10589
+ export type GameModelContainerChangedSubscription = {
10590
+ __typename?: 'Subscription';
10591
+ gameModelContainerChanged: {
10592
+ __typename?: 'GmContainerChange';
10593
+ appId: string;
10594
+ containerId: string;
10595
+ typeName: string | null;
10596
+ sessionId: string | null;
10597
+ source: string;
10598
+ functionName: string | null;
10599
+ changedKeys: Array<string>;
10600
+ occurredAt: string;
10601
+ };
10602
+ };
10550
10603
  export type GameModelContainerStateQueryVariables = Exact<{
10551
10604
  appId: Scalars['BigInt']['input'];
10552
10605
  containerId: Scalars['String']['input'];
@@ -13520,6 +13573,7 @@ export declare const GameModelDeleteEdgeDocument: DocumentNode<GameModelDeleteEd
13520
13573
  export declare const GameModelInvokeDocument: DocumentNode<GameModelInvokeMutation, GameModelInvokeMutationVariables>;
13521
13574
  export declare const GameModelContainerDocument: DocumentNode<GameModelContainerQuery, GameModelContainerQueryVariables>;
13522
13575
  export declare const GameModelContainersDocument: DocumentNode<GameModelContainersQuery, GameModelContainersQueryVariables>;
13576
+ export declare const GameModelContainerChangedDocument: DocumentNode<GameModelContainerChangedSubscription, GameModelContainerChangedSubscriptionVariables>;
13523
13577
  export declare const GameModelContainerStateDocument: DocumentNode<GameModelContainerStateQuery, GameModelContainerStateQueryVariables>;
13524
13578
  export declare const GameModelTraverseDocument: DocumentNode<GameModelTraverseQuery, GameModelTraverseQueryVariables>;
13525
13579
  export declare const GameModelSessionDocument: DocumentNode<GameModelSessionQuery, GameModelSessionQueryVariables>;