@crowdedkingdoms/crowdyjs 8.8.0 → 8.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (56) hide show
  1. package/MIGRATION.md +43 -0
  2. package/README.md +1 -1
  3. package/dist/domains/compute.d.ts +12 -1
  4. package/dist/domains/compute.d.ts.map +1 -1
  5. package/dist/domains/compute.js +18 -1
  6. package/dist/generated/graphql.d.ts +60 -0
  7. package/dist/generated/graphql.d.ts.map +1 -1
  8. package/dist/generated/graphql.js +2 -0
  9. package/dist/index.d.ts +2 -2
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +2 -2
  12. package/dist/kit/abilities.d.ts +66 -0
  13. package/dist/kit/abilities.d.ts.map +1 -0
  14. package/dist/kit/abilities.js +71 -0
  15. package/dist/kit/blueprints/index.d.ts +2 -0
  16. package/dist/kit/blueprints/index.d.ts.map +1 -1
  17. package/dist/kit/blueprints/index.js +2 -0
  18. package/dist/kit/blueprints/liveops.d.ts +42 -0
  19. package/dist/kit/blueprints/liveops.d.ts.map +1 -0
  20. package/dist/kit/blueprints/liveops.js +170 -0
  21. package/dist/kit/blueprints/moderation.d.ts +32 -0
  22. package/dist/kit/blueprints/moderation.d.ts.map +1 -0
  23. package/dist/kit/blueprints/moderation.js +140 -0
  24. package/dist/kit/index.d.ts +9 -2
  25. package/dist/kit/index.d.ts.map +1 -1
  26. package/dist/kit/index.js +9 -2
  27. package/dist/kit/kit.d.ts +44 -0
  28. package/dist/kit/kit.d.ts.map +1 -1
  29. package/dist/kit/kit.js +35 -1
  30. package/dist/kit/liveops.d.ts +112 -0
  31. package/dist/kit/liveops.d.ts.map +1 -0
  32. package/dist/kit/liveops.js +183 -0
  33. package/dist/kit/loot.d.ts +22 -1
  34. package/dist/kit/loot.d.ts.map +1 -1
  35. package/dist/kit/loot.js +41 -1
  36. package/dist/kit/moderation.d.ts +73 -0
  37. package/dist/kit/moderation.d.ts.map +1 -0
  38. package/dist/kit/moderation.js +103 -0
  39. package/dist/kit/movement.d.ts +78 -0
  40. package/dist/kit/movement.d.ts.map +1 -0
  41. package/dist/kit/movement.js +103 -0
  42. package/dist/kit/npcs.d.ts.map +1 -1
  43. package/dist/kit/racing.d.ts +85 -0
  44. package/dist/kit/racing.d.ts.map +1 -0
  45. package/dist/kit/racing.js +99 -0
  46. package/dist/kit/social.d.ts.map +1 -1
  47. package/dist/kit/telemetry.d.ts +66 -0
  48. package/dist/kit/telemetry.d.ts.map +1 -0
  49. package/dist/kit/telemetry.js +133 -0
  50. package/dist/kit/territory.d.ts +97 -0
  51. package/dist/kit/territory.d.ts.map +1 -0
  52. package/dist/kit/territory.js +114 -0
  53. package/dist/kit/wire.d.ts +51 -0
  54. package/dist/kit/wire.d.ts.map +1 -1
  55. package/dist/kit/wire.js +60 -0
  56. package/package.json +1 -1
package/MIGRATION.md CHANGED
@@ -1,3 +1,46 @@
1
+ # CrowdyJS v8.9 Notes
2
+
3
+ ## Added
4
+
5
+ **Realtime + live-ops surfaces** — the Wave 3 close-out of the game-kit
6
+ catalog. Additive; capability-detected; model-only deployments unchanged.
7
+
8
+ - **`kit.abilities`** (new) — `defineAbility` (admin), `cast(abilityId,
9
+ targetX, targetZ)` (your position is your live pose — unspoofable),
10
+ `loadout`, `book` (resource + cooldowns), type-94 cast/impact parsing.
11
+ - **`kit.movement`** (new) — the movement-warden (observe/flag):
12
+ `violations`, `config`, `defineConfig` (admin), type-95 parsing. The
13
+ warden never corrects; client prediction stays yours.
14
+ - **`kit.territory`** (new) — `points` (live capture state), `factions`,
15
+ admin map CRUD (`defineFaction`/`enroll`/`definePoint`), type-96 parsing.
16
+ - **`kit.racing`** (new) — `defineCourse` (admin), `enter`, `raceStatus`,
17
+ `best`, `ghostPlay` (record replay on the actor lane), type-97 parsing;
18
+ plus the possession ball: `joinMatch`/`claim`/`pass`/`shoot`/`matchState`.
19
+ - **`kit.liveops`** (new) + `liveopsBlueprint` — event windows (scheduler-
20
+ aware `activeWindows`), seasons with battle-pass composition
21
+ (`pass_track` + `pass_features`), type-98 zone-change parsing.
22
+ - **`kit.moderation`** (new) + `moderationBlueprint` — reports, the admin
23
+ escalation queue, resolve dispositions, personal mutes.
24
+ - **`kit.telemetry`** (new) + `telemetryBlueprint` — `track(name, props)`
25
+ fire-and-forget over sampled counters.
26
+ - **`kit.loot` engine path** — `engineAvailable`/`enginePull`/`enginePity`/
27
+ `engineAudit` route big-table pity rolls through a loot module; the
28
+ blueprint's weighted model rolls stay for small tables.
29
+ - **`client.compute.templates()` / `deployTemplate()`** — the platform's
30
+ server-side engine-template registry (`computeDeployTemplate`): deploy a
31
+ canonical engine by name, no client-held Rust.
32
+ - **`kit.deploy({ engines: [...] })`** — blueprints + engine templates in
33
+ one call (`'template'` or `'template:moduleName'` entries).
34
+ - **`kit/wire`** — reserved event types 94 (ability), 95 (movement
35
+ violation), 96 (control point), 97 (race timing), 98 (zone change) with
36
+ parsers.
37
+
38
+ ## Server compatibility
39
+
40
+ The new surfaces need a `cks-game-api` from the Wave 3 dev line (engine
41
+ event types 94–98, `computeDeployTemplate`). Without the engines deployed,
42
+ `engineAvailable()` is false everywhere and 8.8 behavior is unchanged.
43
+
1
44
  # CrowdyJS v8.8 Notes
2
45
 
3
46
  ## Added
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:** 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.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:** 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
  ## Standalone builds and schema refresh
18
18
 
@@ -1,5 +1,5 @@
1
1
  import type { GraphQLClient } from '../client.js';
2
- import { type ComputeUpsertModuleMutation, type ComputeUpsertModuleMutationVariables, type ComputeDeployVersionMutation, type ComputeSetModuleEnabledMutation, type ComputeSetModuleEnabledMutationVariables, type ComputeDeleteModuleMutation, type ComputeDeleteModuleMutationVariables, type ComputeUpsertTriggerMutation, type ComputeUpsertTriggerMutationVariables, type ComputeDeleteTriggerMutation, type ComputeDeleteTriggerMutationVariables, type ComputeSetPolicyMutation, type ComputeSetPolicyMutationVariables, type ComputeInvokeMutation, type ComputeInvokeMutationVariables, type ComputeModulesQuery, type ComputeModulesQueryVariables, type ComputeModuleQuery, type ComputeModuleQueryVariables, type ComputeModuleVersionsQuery, type ComputeModuleVersionsQueryVariables, type ComputeModuleTriggersQuery, type ComputeModuleTriggersQueryVariables, type ComputeModulePolicyQuery, type ComputeModulePolicyQueryVariables, type ComputeModuleRunsQuery, type ComputeModuleRunsQueryVariables, type ComputeModuleStatsQuery, type ComputeModuleStatsQueryVariables, type ComputeModuleLogsQuery, type ComputeModuleLogsQueryVariables, type ComputeAppDiagnosticsQuery, type ComputeAppDiagnosticsQueryVariables } from '../generated/graphql.js';
2
+ import { type ComputeUpsertModuleMutation, type ComputeUpsertModuleMutationVariables, type ComputeDeployVersionMutation, type ComputeSetModuleEnabledMutation, type ComputeSetModuleEnabledMutationVariables, type ComputeDeleteModuleMutation, type ComputeDeleteModuleMutationVariables, type ComputeUpsertTriggerMutation, type ComputeUpsertTriggerMutationVariables, type ComputeDeleteTriggerMutation, type ComputeDeleteTriggerMutationVariables, type ComputeSetPolicyMutation, type ComputeSetPolicyMutationVariables, type ComputeInvokeMutation, type ComputeInvokeMutationVariables, type ComputeModulesQuery, type ComputeModulesQueryVariables, type ComputeModuleQuery, type ComputeModuleQueryVariables, type ComputeModuleVersionsQuery, type ComputeModuleVersionsQueryVariables, type ComputeModuleTriggersQuery, type ComputeModuleTriggersQueryVariables, type ComputeModulePolicyQuery, type ComputeModulePolicyQueryVariables, type ComputeModuleRunsQuery, type ComputeModuleRunsQueryVariables, type ComputeModuleStatsQuery, type ComputeModuleStatsQueryVariables, type ComputeModuleLogsQuery, type ComputeModuleLogsQueryVariables, type ComputeDeployTemplateMutation, type ComputeDeployTemplateMutationVariables, type ComputeTemplatesQuery, type ComputeTemplatesQueryVariables, type ComputeAppDiagnosticsQuery, type ComputeAppDiagnosticsQueryVariables } from '../generated/graphql.js';
3
3
  /** The crowdy-compute-sdk version the platform toolchain currently pins. */
4
4
  export declare const COMPUTE_SDK_VERSION = "0.1.0";
5
5
  /** The guest ABI version the platform currently supports. */
@@ -129,6 +129,17 @@ export declare class ComputeAPI {
129
129
  * status/log. Requires **`view_compute_diagnostics`**.
130
130
  */
131
131
  moduleVersions(variables: ComputeModuleVersionsQueryVariables): Promise<ComputeModuleVersionsQuery['computeModuleVersions']>;
132
+ /**
133
+ * The platform's engine-template registry: ready-made engines deployable
134
+ * by name with {@link deployTemplate}.
135
+ */
136
+ templates(variables: ComputeTemplatesQueryVariables): Promise<ComputeTemplatesQuery['computeTemplates']>;
137
+ /**
138
+ * Deploy a named engine template from the platform registry — one call
139
+ * instead of the upsert/deploy/trigger/enable sequence. Compilation runs
140
+ * asynchronously; follow with {@link waitForCompile}.
141
+ */
142
+ deployTemplate(variables: ComputeDeployTemplateMutationVariables): Promise<ComputeDeployTemplateMutation['computeDeployTemplate']>;
132
143
  /**
133
144
  * Poll {@link moduleVersions} until the newest version's compile settles
134
145
  * (`succeeded` or `failed`). Resolves with the settled version; **rejects**
@@ -1 +1 @@
1
- {"version":3,"file":"compute.d.ts","sourceRoot":"","sources":["../../src/domains/compute.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAElD,OAAO,EAEL,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EAEjC,KAAK,+BAA+B,EACpC,KAAK,wCAAwC,EAE7C,KAAK,2BAA2B,EAChC,KAAK,oCAAoC,EAEzC,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,4BAA4B,EACjC,KAAK,qCAAqC,EAE1C,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,qBAAqB,EAC1B,KAAK,8BAA8B,EAEnC,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EAEjC,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EAExC,KAAK,0BAA0B,EAC/B,KAAK,mCAAmC,EAExC,KAAK,wBAAwB,EAC7B,KAAK,iCAAiC,EAEtC,KAAK,sBAAsB,EAC3B,KAAK,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C,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;IAuBvE;;;OAGG;IACG,cAAc,CAClB,SAAS,EAAE,mCAAmC,GAC7C,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;IAK/D;;;OAGG;IACG,YAAY,CAChB,SAAS,EAAE,iCAAiC,GAC3C,OAAO,CAAC,wBAAwB,CAAC,qBAAqB,CAAC,CAAC;IAK3D;;;;;OAKG;IACG,UAAU,CACd,SAAS,EAAE,+BAA+B,GACzC,OAAO,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IAKvD;;;;OAIG;IACG,WAAW,CACf,SAAS,EAAE,gCAAgC,GAC1C,OAAO,CAAC,uBAAuB,CAAC,oBAAoB,CAAC,CAAC;IAKzD;;;OAGG;IACG,UAAU,CACd,SAAS,EAAE,+BAA+B,GACzC,OAAO,CAAC,sBAAsB,CAAC,mBAAmB,CAAC,CAAC;IAKvD;;;;OAIG;IACG,cAAc,CAClB,SAAS,EAAE,mCAAmC,GAC7C,OAAO,CAAC,0BAA0B,CAAC,uBAAuB,CAAC,CAAC;CAIhE"}
@@ -1,4 +1,4 @@
1
- import { ComputeUpsertModuleDocument, ComputeDeployVersionDocument, ComputeSetModuleEnabledDocument, ComputeDeleteModuleDocument, ComputeUpsertTriggerDocument, ComputeDeleteTriggerDocument, ComputeSetPolicyDocument, ComputeInvokeDocument, ComputeModulesDocument, ComputeModuleDocument, ComputeModuleVersionsDocument, ComputeModuleTriggersDocument, ComputeModulePolicyDocument, ComputeModuleRunsDocument, ComputeModuleStatsDocument, ComputeModuleLogsDocument, ComputeAppDiagnosticsDocument, } from '../generated/graphql.js';
1
+ import { ComputeUpsertModuleDocument, ComputeDeployVersionDocument, ComputeSetModuleEnabledDocument, ComputeDeleteModuleDocument, ComputeUpsertTriggerDocument, ComputeDeleteTriggerDocument, ComputeSetPolicyDocument, ComputeInvokeDocument, ComputeModulesDocument, ComputeModuleDocument, ComputeModuleVersionsDocument, ComputeModuleTriggersDocument, ComputeModulePolicyDocument, ComputeModuleRunsDocument, ComputeModuleStatsDocument, ComputeModuleLogsDocument, ComputeAppDiagnosticsDocument, ComputeDeployTemplateDocument, ComputeTemplatesDocument, } from '../generated/graphql.js';
2
2
  /** The crowdy-compute-sdk version the platform toolchain currently pins. */
3
3
  export const COMPUTE_SDK_VERSION = '0.1.0';
4
4
  /** The guest ABI version the platform currently supports. */
@@ -151,6 +151,23 @@ export class ComputeAPI {
151
151
  const data = await this.gql.request(ComputeModuleVersionsDocument, variables);
152
152
  return data.computeModuleVersions;
153
153
  }
154
+ /**
155
+ * The platform's engine-template registry: ready-made engines deployable
156
+ * by name with {@link deployTemplate}.
157
+ */
158
+ async templates(variables) {
159
+ const data = await this.gql.request(ComputeTemplatesDocument, variables);
160
+ return data.computeTemplates;
161
+ }
162
+ /**
163
+ * Deploy a named engine template from the platform registry — one call
164
+ * instead of the upsert/deploy/trigger/enable sequence. Compilation runs
165
+ * asynchronously; follow with {@link waitForCompile}.
166
+ */
167
+ async deployTemplate(variables) {
168
+ const data = await this.gql.request(ComputeDeployTemplateDocument, variables);
169
+ return data.computeDeployTemplate;
170
+ }
154
171
  /**
155
172
  * Poll {@link moduleVersions} until the newest version's compile settles
156
173
  * (`succeeded` or `failed`). Resolves with the settled version; **rejects**
@@ -1356,6 +1356,16 @@ export type ComputeInvokeResult = {
1356
1356
  /** The response decoded as JSON text when it parses as JSON; null otherwise. */
1357
1357
  resultJson: Maybe<Scalars['String']['output']>;
1358
1358
  };
1359
+ /** One entry in the platform's engine-template registry (deployable by name via computeDeployTemplate). */
1360
+ export type ComputeTemplateInfo = {
1361
+ __typename?: 'ComputeTemplateInfo';
1362
+ /** What the template does (from its deploy manifest). */
1363
+ description: Scalars['String']['output'];
1364
+ /** The invoke exports the template binds (its client surface). */
1365
+ exports: Array<Scalars['String']['output']>;
1366
+ /** The template name (e.g. 'mob-engine', 'matchmaking'). */
1367
+ name: Scalars['String']['output'];
1368
+ };
1359
1369
  /** Relay-style pagination metadata for a connection. */
1360
1370
  export type ConnectionPageInfo = {
1361
1371
  __typename?: 'ConnectionPageInfo';
@@ -3091,6 +3101,8 @@ export type Mutation = {
3091
3101
  computeDeleteModule: Scalars['Boolean']['output'];
3092
3102
  /** Delete a compute-module trigger by id. Returns true when a trigger was deleted. Requires the org 'manage_compute' permission. */
3093
3103
  computeDeleteTrigger: Scalars['Boolean']['output'];
3104
+ /** Deploy a named engine template from the platform registry: upserts the module, publishes the template source (deduped by hash), binds its triggers, and enables it — one call instead of the upsert/deploy/trigger/enable sequence. Compilation proceeds asynchronously; poll computeModuleVersions for compile status. Templates are data-driven (behavior comes from model containers such as MobDef/EncounterDef/Course), so most games parameterize rather than fork. Requires the org 'manage_compute' permission. */
3105
+ computeDeployTemplate: WasmModule;
3094
3106
  /** Upload a new immutable source version of a compute module and make it the deployed version. The source map is validated (Cargo.toml + src/*.rs only, size caps, platform crate allowlist, no build-time code) and parked as compile_status=pending; a game-api instance compiles it before it can run. Requires the org 'manage_compute' permission. */
3095
3107
  computeDeployVersion: WasmModuleVersion;
3096
3108
  /** Invoke a compute module's client-callable export (a trigger with triggerType=invoke). Synchronous RPC: the module runs and returns its result directly (unlike the spatial send surface's dual-success model). Authorization: the export's invoke policy (authority tree) — or holders of 'manage_compute' only when no policy is set. Requires a valid app token. */
@@ -3467,6 +3479,11 @@ export type MutationComputeDeleteTriggerArgs = {
3467
3479
  appId: Scalars['BigInt']['input'];
3468
3480
  triggerId: Scalars['String']['input'];
3469
3481
  };
3482
+ export type MutationComputeDeployTemplateArgs = {
3483
+ appId: Scalars['BigInt']['input'];
3484
+ moduleName?: InputMaybe<Scalars['String']['input']>;
3485
+ templateName: Scalars['String']['input'];
3486
+ };
3470
3487
  export type MutationComputeDeployVersionArgs = {
3471
3488
  input: DeployComputeVersionInput;
3472
3489
  };
@@ -4490,6 +4507,8 @@ export type Query = {
4490
4507
  computeModuleVersions: Array<WasmModuleVersion>;
4491
4508
  /** List the compute modules defined for an app. Requires the org 'view_compute_diagnostics' permission. */
4492
4509
  computeModules: Array<WasmModule>;
4510
+ /** The platform's engine-template registry: ready-made compute engines (mob/world/match/deck/instance/director/matchmaking/market/board/minigame/abilities/movement-warden/territory/racing/...) deployable by name with computeDeployTemplate. Requires the org 'manage_compute' permission. */
4511
+ computeTemplates: Array<ComputeTemplateInfo>;
4493
4512
  /** Operator only (is_operator). Most recent operator audit entries, newest first, optionally filtered by environment. */
4494
4513
  cpAudit: Array<CpAuditEntry>;
4495
4514
  /** Operator only (is_operator). One change order with its tasks and steps. Null when the id is not found. */
@@ -4888,6 +4907,9 @@ export type QueryComputeModuleVersionsArgs = {
4888
4907
  export type QueryComputeModulesArgs = {
4889
4908
  appId: Scalars['BigInt']['input'];
4890
4909
  };
4910
+ export type QueryComputeTemplatesArgs = {
4911
+ appId: Scalars['BigInt']['input'];
4912
+ };
4891
4913
  export type QueryCpAuditArgs = {
4892
4914
  environmentId?: InputMaybe<Scalars['String']['input']>;
4893
4915
  limit?: Scalars['Int']['input'];
@@ -8901,6 +8923,42 @@ export type ComputeAppDiagnosticsQuery = {
8901
8923
  }>;
8902
8924
  };
8903
8925
  };
8926
+ export type ComputeTemplatesQueryVariables = Exact<{
8927
+ appId: Scalars['BigInt']['input'];
8928
+ }>;
8929
+ export type ComputeTemplatesQuery = {
8930
+ __typename?: 'Query';
8931
+ computeTemplates: Array<{
8932
+ __typename?: 'ComputeTemplateInfo';
8933
+ name: string;
8934
+ description: string;
8935
+ exports: Array<string>;
8936
+ }>;
8937
+ };
8938
+ export type ComputeDeployTemplateMutationVariables = Exact<{
8939
+ appId: Scalars['BigInt']['input'];
8940
+ templateName: Scalars['String']['input'];
8941
+ moduleName?: InputMaybe<Scalars['String']['input']>;
8942
+ }>;
8943
+ export type ComputeDeployTemplateMutation = {
8944
+ __typename?: 'Mutation';
8945
+ computeDeployTemplate: {
8946
+ __typename?: 'WasmModule';
8947
+ moduleId: string;
8948
+ appId: string;
8949
+ name: string;
8950
+ description: string | null;
8951
+ enabled: boolean;
8952
+ alwaysOn: boolean;
8953
+ currentVersionId: string | null;
8954
+ circuitState: string;
8955
+ consecutiveFailures: number;
8956
+ cooldownUntil: string | null;
8957
+ lastError: string | null;
8958
+ createdAt: string;
8959
+ updatedAt: string;
8960
+ };
8961
+ };
8904
8962
  export type CpEnvironmentsQueryVariables = Exact<{
8905
8963
  page?: InputMaybe<Scalars['Int']['input']>;
8906
8964
  pageSize?: InputMaybe<Scalars['Int']['input']>;
@@ -13347,6 +13405,8 @@ export declare const ComputeModuleRunsDocument: DocumentNode<ComputeModuleRunsQu
13347
13405
  export declare const ComputeModuleStatsDocument: DocumentNode<ComputeModuleStatsQuery, ComputeModuleStatsQueryVariables>;
13348
13406
  export declare const ComputeModuleLogsDocument: DocumentNode<ComputeModuleLogsQuery, ComputeModuleLogsQueryVariables>;
13349
13407
  export declare const ComputeAppDiagnosticsDocument: DocumentNode<ComputeAppDiagnosticsQuery, ComputeAppDiagnosticsQueryVariables>;
13408
+ export declare const ComputeTemplatesDocument: DocumentNode<ComputeTemplatesQuery, ComputeTemplatesQueryVariables>;
13409
+ export declare const ComputeDeployTemplateDocument: DocumentNode<ComputeDeployTemplateMutation, ComputeDeployTemplateMutationVariables>;
13350
13410
  export declare const CpEnvironmentsDocument: DocumentNode<CpEnvironmentsQuery, CpEnvironmentsQueryVariables>;
13351
13411
  export declare const CpEnvironmentDocument: DocumentNode<CpEnvironmentQuery, CpEnvironmentQueryVariables>;
13352
13412
  export declare const CpChangeOrdersDocument: DocumentNode<CpChangeOrdersQuery, CpChangeOrdersQueryVariables>;