@crowdedkingdoms/crowdyjs 8.8.0 → 8.10.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/MIGRATION.md +59 -0
- package/README.md +5 -1
- package/dist/domains/compute.d.ts +13 -2
- package/dist/domains/compute.d.ts.map +1 -1
- package/dist/domains/compute.js +19 -2
- package/dist/generated/graphql.d.ts +60 -0
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +2 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/kit/abilities.d.ts +66 -0
- package/dist/kit/abilities.d.ts.map +1 -0
- package/dist/kit/abilities.js +71 -0
- package/dist/kit/blueprints/index.d.ts +3 -1
- package/dist/kit/blueprints/index.d.ts.map +1 -1
- package/dist/kit/blueprints/index.js +3 -1
- package/dist/kit/blueprints/inventory.d.ts +47 -1
- package/dist/kit/blueprints/inventory.d.ts.map +1 -1
- package/dist/kit/blueprints/inventory.js +112 -12
- package/dist/kit/blueprints/liveops.d.ts +42 -0
- package/dist/kit/blueprints/liveops.d.ts.map +1 -0
- package/dist/kit/blueprints/liveops.js +170 -0
- package/dist/kit/blueprints/moderation.d.ts +32 -0
- package/dist/kit/blueprints/moderation.d.ts.map +1 -0
- package/dist/kit/blueprints/moderation.js +140 -0
- package/dist/kit/combat.d.ts +4 -3
- package/dist/kit/combat.d.ts.map +1 -1
- package/dist/kit/combat.js +4 -3
- package/dist/kit/index.d.ts +9 -2
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +9 -2
- package/dist/kit/inventory.d.ts +13 -0
- package/dist/kit/inventory.d.ts.map +1 -1
- package/dist/kit/inventory.js +33 -4
- package/dist/kit/kit.d.ts +44 -0
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +35 -1
- package/dist/kit/liveops.d.ts +112 -0
- package/dist/kit/liveops.d.ts.map +1 -0
- package/dist/kit/liveops.js +183 -0
- package/dist/kit/loot.d.ts +22 -1
- package/dist/kit/loot.d.ts.map +1 -1
- package/dist/kit/loot.js +41 -1
- package/dist/kit/moderation.d.ts +73 -0
- package/dist/kit/moderation.d.ts.map +1 -0
- package/dist/kit/moderation.js +103 -0
- package/dist/kit/movement.d.ts +78 -0
- package/dist/kit/movement.d.ts.map +1 -0
- package/dist/kit/movement.js +103 -0
- package/dist/kit/npcs.d.ts.map +1 -1
- package/dist/kit/quests.d.ts +4 -0
- package/dist/kit/quests.d.ts.map +1 -1
- package/dist/kit/quests.js +9 -2
- package/dist/kit/racing.d.ts +85 -0
- package/dist/kit/racing.d.ts.map +1 -0
- package/dist/kit/racing.js +99 -0
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/kit/telemetry.d.ts +66 -0
- package/dist/kit/telemetry.d.ts.map +1 -0
- package/dist/kit/telemetry.js +133 -0
- package/dist/kit/territory.d.ts +97 -0
- package/dist/kit/territory.d.ts.map +1 -0
- package/dist/kit/territory.js +114 -0
- package/dist/kit/wire.d.ts +51 -0
- package/dist/kit/wire.d.ts.map +1 -1
- package/dist/kit/wire.js +60 -0
- package/package.json +1 -1
package/MIGRATION.md
CHANGED
|
@@ -1,3 +1,62 @@
|
|
|
1
|
+
# CrowdyJS v8.10 Notes
|
|
2
|
+
|
|
3
|
+
## Added
|
|
4
|
+
|
|
5
|
+
- `inventoryBlueprint({ recipes, barters })` generates atomic Model
|
|
6
|
+
transactions; `kit.inventory.craft(...)` and `.barter(...)` invoke them.
|
|
7
|
+
- Competitive inventory posture:
|
|
8
|
+
`stackInstantiableBy: 'admin'`, `grantAuthority: 'server'`, plus matching
|
|
9
|
+
runtime `ownerIdKind` for legacy string-owner worlds.
|
|
10
|
+
- Compute SDK default `0.1.3`, including transactional `model_invoke` and
|
|
11
|
+
explicitly owned module-created containers.
|
|
12
|
+
|
|
13
|
+
This release is additive. The default inventory posture remains
|
|
14
|
+
member-created/owner-grant for compatibility; competitive games should opt
|
|
15
|
+
into the hardened posture and provide a trusted stack bootstrap.
|
|
16
|
+
|
|
17
|
+
# CrowdyJS v8.9 Notes
|
|
18
|
+
|
|
19
|
+
## Added
|
|
20
|
+
|
|
21
|
+
**Realtime + live-ops surfaces** — the Wave 3 close-out of the game-kit
|
|
22
|
+
catalog. Additive; capability-detected; model-only deployments unchanged.
|
|
23
|
+
|
|
24
|
+
- **`kit.abilities`** (new) — `defineAbility` (admin), `cast(abilityId,
|
|
25
|
+
targetX, targetZ)` (your position is your live pose — unspoofable),
|
|
26
|
+
`loadout`, `book` (resource + cooldowns), type-94 cast/impact parsing.
|
|
27
|
+
- **`kit.movement`** (new) — the movement-warden (observe/flag):
|
|
28
|
+
`violations`, `config`, `defineConfig` (admin), type-95 parsing. The
|
|
29
|
+
warden never corrects; client prediction stays yours.
|
|
30
|
+
- **`kit.territory`** (new) — `points` (live capture state), `factions`,
|
|
31
|
+
admin map CRUD (`defineFaction`/`enroll`/`definePoint`), type-96 parsing.
|
|
32
|
+
- **`kit.racing`** (new) — `defineCourse` (admin), `enter`, `raceStatus`,
|
|
33
|
+
`best`, `ghostPlay` (record replay on the actor lane), type-97 parsing;
|
|
34
|
+
plus the possession ball: `joinMatch`/`claim`/`pass`/`shoot`/`matchState`.
|
|
35
|
+
- **`kit.liveops`** (new) + `liveopsBlueprint` — event windows (scheduler-
|
|
36
|
+
aware `activeWindows`), seasons with battle-pass composition
|
|
37
|
+
(`pass_track` + `pass_features`), type-98 zone-change parsing.
|
|
38
|
+
- **`kit.moderation`** (new) + `moderationBlueprint` — reports, the admin
|
|
39
|
+
escalation queue, resolve dispositions, personal mutes.
|
|
40
|
+
- **`kit.telemetry`** (new) + `telemetryBlueprint` — `track(name, props)`
|
|
41
|
+
fire-and-forget over sampled counters.
|
|
42
|
+
- **`kit.loot` engine path** — `engineAvailable`/`enginePull`/`enginePity`/
|
|
43
|
+
`engineAudit` route big-table pity rolls through a loot module; the
|
|
44
|
+
blueprint's weighted model rolls stay for small tables.
|
|
45
|
+
- **`client.compute.templates()` / `deployTemplate()`** — the platform's
|
|
46
|
+
server-side engine-template registry (`computeDeployTemplate`): deploy a
|
|
47
|
+
canonical engine by name, no client-held Rust.
|
|
48
|
+
- **`kit.deploy({ engines: [...] })`** — blueprints + engine templates in
|
|
49
|
+
one call (`'template'` or `'template:moduleName'` entries).
|
|
50
|
+
- **`kit/wire`** — reserved event types 94 (ability), 95 (movement
|
|
51
|
+
violation), 96 (control point), 97 (race timing), 98 (zone change) with
|
|
52
|
+
parsers.
|
|
53
|
+
|
|
54
|
+
## Server compatibility
|
|
55
|
+
|
|
56
|
+
The new surfaces need a `cks-game-api` from the Wave 3 dev line (engine
|
|
57
|
+
event types 94–98, `computeDeployTemplate`). Without the engines deployed,
|
|
58
|
+
`engineAvailable()` is false everywhere and 8.8 behavior is unchanged.
|
|
59
|
+
|
|
1
60
|
# CrowdyJS v8.8 Notes
|
|
2
61
|
|
|
3
62
|
## Added
|
package/README.md
CHANGED
|
@@ -12,7 +12,11 @@ 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
|
+
|
|
17
|
+
> **v8.10 inventory authority:** generated craft/barter transactions work on
|
|
18
|
+
> existing Model servers. Compute-refereed durable commits require Compute SDK
|
|
19
|
+
> `0.1.3` / the `model_invoke` host call.
|
|
16
20
|
|
|
17
21
|
## Standalone builds and schema refresh
|
|
18
22
|
|
|
@@ -1,7 +1,7 @@
|
|
|
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
|
-
export declare const COMPUTE_SDK_VERSION = "0.1.
|
|
4
|
+
export declare const COMPUTE_SDK_VERSION = "0.1.3";
|
|
5
5
|
/** The guest ABI version the platform currently supports. */
|
|
6
6
|
export declare const COMPUTE_ABI_VERSION = 0;
|
|
7
7
|
/** Options for {@link ComputeAPI.deployVersion}. */
|
|
@@ -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,KA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ACG,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"}
|
package/dist/domains/compute.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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
|
-
export const COMPUTE_SDK_VERSION = '0.1.
|
|
3
|
+
export const COMPUTE_SDK_VERSION = '0.1.3';
|
|
4
4
|
/** The guest ABI version the platform currently supports. */
|
|
5
5
|
export const COMPUTE_ABI_VERSION = 0;
|
|
6
6
|
/**
|
|
@@ -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>;
|