@crowdedkingdoms/crowdyjs 17.13.0-dev.1 → 18.0.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/MIGRATION.md +163 -1
- package/README.md +142 -146
- package/dist/crowdy-client.d.ts +12 -31
- package/dist/crowdy-client.d.ts.map +1 -1
- package/dist/crowdy-client.js +15 -37
- package/dist/crowdy-dsh/bridge.d.ts.map +1 -1
- package/dist/crowdy-dsh/bridge.js +3 -6
- package/dist/crowdy-studio/controller.d.ts +59 -57
- package/dist/crowdy-studio/controller.d.ts.map +1 -1
- package/dist/crowdy-studio/controller.js +268 -206
- package/dist/crowdy-studio/diagnostics.d.ts +3 -12
- package/dist/crowdy-studio/diagnostics.d.ts.map +1 -1
- package/dist/crowdy-studio/dom-shell.d.ts +2 -4
- package/dist/crowdy-studio/dom-shell.d.ts.map +1 -1
- package/dist/crowdy-studio/dom-shell.js +16 -47
- package/dist/crowdy-studio/embed/hud-layer.d.ts +1 -1
- package/dist/crowdy-studio/embed/panel.d.ts +3 -12
- package/dist/crowdy-studio/embed/panel.d.ts.map +1 -1
- package/dist/crowdy-studio/embed/panel.js +3 -6
- package/dist/crowdy-studio/index.d.ts +1 -3
- package/dist/crowdy-studio/index.d.ts.map +1 -1
- package/dist/crowdy-studio/index.js +0 -2
- package/dist/crowdy-studio/models.d.ts +3 -4
- package/dist/crowdy-studio/models.d.ts.map +1 -1
- package/dist/crowdy-studio/starter-projects.d.ts +8 -4
- package/dist/crowdy-studio/starter-projects.d.ts.map +1 -1
- package/dist/crowdy-studio/starter-projects.js +83 -100
- package/dist/domains/appAccess.d.ts +14 -1
- package/dist/domains/appAccess.d.ts.map +1 -1
- package/dist/domains/appAccess.js +37 -1
- package/dist/domains/exec.d.ts +162 -15
- package/dist/domains/exec.d.ts.map +1 -1
- package/dist/domains/exec.js +180 -18
- package/dist/domains/host.d.ts +3 -3
- package/dist/domains/host.js +3 -3
- package/dist/domains/marketplace.d.ts +9 -58
- package/dist/domains/marketplace.d.ts.map +1 -1
- package/dist/domains/marketplace.js +9 -106
- package/dist/domains/playerWallet.d.ts +6 -12
- package/dist/domains/playerWallet.d.ts.map +1 -1
- package/dist/domains/playerWallet.js +6 -21
- package/dist/errors.d.ts +7 -13
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +6 -10
- package/dist/generated/graphql.d.ts +1384 -7977
- package/dist/generated/graphql.d.ts.map +1 -1
- package/dist/generated/graphql.js +22 -321
- package/dist/grid-mods/exec-client-halves.d.ts +156 -0
- package/dist/grid-mods/exec-client-halves.d.ts.map +1 -0
- package/dist/grid-mods/exec-client-halves.js +356 -0
- package/dist/grid-mods/grid-host-calls.d.ts +29 -15
- package/dist/grid-mods/grid-host-calls.d.ts.map +1 -1
- package/dist/grid-mods/grid-host-calls.js +40 -44
- package/dist/grid-mods/index.d.ts +1 -0
- package/dist/grid-mods/index.d.ts.map +1 -1
- package/dist/grid-mods/index.js +1 -0
- package/dist/grid-mods/mod-runtime.d.ts +21 -6
- package/dist/grid-mods/mod-runtime.d.ts.map +1 -1
- package/dist/grid-mods/mod-runtime.js +6 -2
- package/dist/grid-scope.d.ts +0 -188
- package/dist/grid-scope.d.ts.map +1 -1
- package/dist/grid-scope.js +0 -69
- package/dist/index.d.ts +12 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -16
- package/dist/kit/actions.d.ts +5 -9
- package/dist/kit/actions.d.ts.map +1 -1
- package/dist/kit/actions.js +5 -9
- package/dist/kit/index.d.ts +2 -33
- package/dist/kit/index.d.ts.map +1 -1
- package/dist/kit/index.js +1 -32
- package/dist/kit/kit.d.ts +8 -208
- package/dist/kit/kit.d.ts.map +1 -1
- package/dist/kit/kit.js +5 -163
- package/dist/kit/social.d.ts +1 -3
- package/dist/kit/social.d.ts.map +1 -1
- package/dist/kit/social.js +1 -3
- package/dist/kit/wire.d.ts +16 -5
- package/dist/kit/wire.d.ts.map +1 -1
- package/dist/kit/wire.js +19 -5
- package/dist/live-coding/assets/browser-authoring-index.json +1 -1
- package/dist/live-coding/assets/manifest.json +1 -1
- package/dist/live-coding/browser-authoring-index.generated.d.ts.map +1 -1
- package/dist/live-coding/browser-authoring-index.generated.js +1496 -4386
- package/dist/live-coding/rust-analysis.d.ts.map +1 -1
- package/dist/live-coding/rust-analysis.js +31 -23
- package/dist/player-runtime/client-host-calls.d.ts +8 -0
- package/dist/player-runtime/client-host-calls.d.ts.map +1 -0
- package/dist/player-runtime/client-host-calls.js +28 -0
- package/dist/player-runtime/glue-runtime.d.ts +27 -10
- package/dist/player-runtime/glue-runtime.d.ts.map +1 -1
- package/dist/player-runtime/glue-runtime.js +40 -45
- package/dist/player-runtime/glue-sab.d.ts +2 -2
- package/dist/player-runtime/glue-sab.js +2 -2
- package/dist/player-runtime/player-code-broker.d.ts +80 -24
- package/dist/player-runtime/player-code-broker.d.ts.map +1 -1
- package/dist/player-runtime/player-code-broker.js +169 -41
- package/dist/player-runtime/player-glue-worker.d.ts +8 -8
- package/dist/player-runtime/player-glue-worker.d.ts.map +1 -1
- package/dist/player-runtime/player-glue-worker.js +26 -9
- package/dist/stores/actors.d.ts +12 -2
- package/dist/stores/actors.d.ts.map +1 -1
- package/dist/stores/actors.js +43 -18
- package/dist/stores/chunks.d.ts +12 -0
- package/dist/stores/chunks.d.ts.map +1 -1
- package/dist/stores/chunks.js +112 -39
- package/dist/stores/durable.d.ts.map +1 -1
- package/dist/stores/durable.js +2 -1
- package/dist/stores/inbox.d.ts +1 -1
- package/dist/stores/inbox.d.ts.map +1 -1
- package/dist/stores/index.d.ts +0 -11
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +0 -4
- package/dist/stores/session.d.ts +0 -2
- package/dist/stores/session.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/crowdy-studio/model-lint-log.d.ts +0 -76
- package/dist/crowdy-studio/model-lint-log.d.ts.map +0 -1
- package/dist/crowdy-studio/model-lint-log.js +0 -93
- package/dist/crowdy-studio/model-lint.d.ts +0 -61
- package/dist/crowdy-studio/model-lint.d.ts.map +0 -1
- package/dist/crowdy-studio/model-lint.js +0 -45
- package/dist/domains/compute.d.ts +0 -208
- package/dist/domains/compute.d.ts.map +0 -1
- package/dist/domains/compute.js +0 -274
- package/dist/domains/controlPlane.d.ts +0 -38
- package/dist/domains/controlPlane.d.ts.map +0 -1
- package/dist/domains/controlPlane.js +0 -43
- package/dist/domains/gameModel.d.ts +0 -1174
- package/dist/domains/gameModel.d.ts.map +0 -1
- package/dist/domains/gameModel.js +0 -1333
- package/dist/domains/playerCompute.d.ts +0 -91
- package/dist/domains/playerCompute.d.ts.map +0 -1
- package/dist/domains/playerCompute.js +0 -136
- package/dist/domains/playerModel.d.ts +0 -20
- package/dist/domains/playerModel.d.ts.map +0 -1
- package/dist/domains/playerModel.js +0 -54
- package/dist/kit/abilities.d.ts +0 -66
- package/dist/kit/abilities.d.ts.map +0 -1
- package/dist/kit/abilities.js +0 -71
- package/dist/kit/blueprints/combat.d.ts +0 -81
- package/dist/kit/blueprints/combat.d.ts.map +0 -1
- package/dist/kit/blueprints/combat.js +0 -357
- package/dist/kit/blueprints/core.d.ts +0 -222
- package/dist/kit/blueprints/core.d.ts.map +0 -1
- package/dist/kit/blueprints/core.js +0 -185
- package/dist/kit/blueprints/decks.d.ts +0 -50
- package/dist/kit/blueprints/decks.d.ts.map +0 -1
- package/dist/kit/blueprints/decks.js +0 -163
- package/dist/kit/blueprints/economy.d.ts +0 -88
- package/dist/kit/blueprints/economy.d.ts.map +0 -1
- package/dist/kit/blueprints/economy.js +0 -533
- package/dist/kit/blueprints/guild.d.ts +0 -51
- package/dist/kit/blueprints/guild.d.ts.map +0 -1
- package/dist/kit/blueprints/guild.js +0 -50
- package/dist/kit/blueprints/index.d.ts +0 -23
- package/dist/kit/blueprints/index.d.ts.map +0 -1
- package/dist/kit/blueprints/index.js +0 -22
- package/dist/kit/blueprints/inventory.d.ts +0 -84
- package/dist/kit/blueprints/inventory.d.ts.map +0 -1
- package/dist/kit/blueprints/inventory.js +0 -257
- package/dist/kit/blueprints/leaderboards.d.ts +0 -49
- package/dist/kit/blueprints/leaderboards.d.ts.map +0 -1
- package/dist/kit/blueprints/leaderboards.js +0 -126
- package/dist/kit/blueprints/liveops.d.ts +0 -42
- package/dist/kit/blueprints/liveops.d.ts.map +0 -1
- package/dist/kit/blueprints/liveops.js +0 -170
- package/dist/kit/blueprints/locks.d.ts +0 -82
- package/dist/kit/blueprints/locks.d.ts.map +0 -1
- package/dist/kit/blueprints/locks.js +0 -155
- package/dist/kit/blueprints/loot.d.ts +0 -90
- package/dist/kit/blueprints/loot.d.ts.map +0 -1
- package/dist/kit/blueprints/loot.js +0 -229
- package/dist/kit/blueprints/matches.d.ts +0 -84
- package/dist/kit/blueprints/matches.d.ts.map +0 -1
- package/dist/kit/blueprints/matches.js +0 -349
- package/dist/kit/blueprints/moderation.d.ts +0 -32
- package/dist/kit/blueprints/moderation.d.ts.map +0 -1
- package/dist/kit/blueprints/moderation.js +0 -140
- package/dist/kit/blueprints/npcs.d.ts +0 -78
- package/dist/kit/blueprints/npcs.d.ts.map +0 -1
- package/dist/kit/blueprints/npcs.js +0 -125
- package/dist/kit/blueprints/plots.d.ts +0 -63
- package/dist/kit/blueprints/plots.d.ts.map +0 -1
- package/dist/kit/blueprints/plots.js +0 -151
- package/dist/kit/blueprints/progression.d.ts +0 -68
- package/dist/kit/blueprints/progression.d.ts.map +0 -1
- package/dist/kit/blueprints/progression.js +0 -324
- package/dist/kit/blueprints/quests.d.ts +0 -72
- package/dist/kit/blueprints/quests.d.ts.map +0 -1
- package/dist/kit/blueprints/quests.js +0 -285
- package/dist/kit/blueprints/worldsim.d.ts +0 -91
- package/dist/kit/blueprints/worldsim.d.ts.map +0 -1
- package/dist/kit/blueprints/worldsim.js +0 -468
- package/dist/kit/combat.d.ts +0 -141
- package/dist/kit/combat.d.ts.map +0 -1
- package/dist/kit/combat.js +0 -196
- package/dist/kit/decks.d.ts +0 -157
- package/dist/kit/decks.d.ts.map +0 -1
- package/dist/kit/decks.js +0 -186
- package/dist/kit/director.d.ts +0 -88
- package/dist/kit/director.d.ts.map +0 -1
- package/dist/kit/director.js +0 -86
- package/dist/kit/economy.d.ts +0 -289
- package/dist/kit/economy.d.ts.map +0 -1
- package/dist/kit/economy.js +0 -427
- package/dist/kit/engine.d.ts +0 -48
- package/dist/kit/engine.d.ts.map +0 -1
- package/dist/kit/engine.js +0 -113
- package/dist/kit/features.d.ts +0 -60
- package/dist/kit/features.d.ts.map +0 -1
- package/dist/kit/features.js +0 -65
- package/dist/kit/instances.d.ts +0 -52
- package/dist/kit/instances.d.ts.map +0 -1
- package/dist/kit/instances.js +0 -60
- package/dist/kit/inventory.d.ts +0 -129
- package/dist/kit/inventory.d.ts.map +0 -1
- package/dist/kit/inventory.js +0 -200
- package/dist/kit/leaderboards.d.ts +0 -86
- package/dist/kit/leaderboards.d.ts.map +0 -1
- package/dist/kit/leaderboards.js +0 -133
- package/dist/kit/liveops.d.ts +0 -112
- package/dist/kit/liveops.d.ts.map +0 -1
- package/dist/kit/liveops.js +0 -183
- package/dist/kit/loot.d.ts +0 -128
- package/dist/kit/loot.d.ts.map +0 -1
- package/dist/kit/loot.js +0 -160
- package/dist/kit/matches.d.ts +0 -301
- package/dist/kit/matches.d.ts.map +0 -1
- package/dist/kit/matches.js +0 -458
- package/dist/kit/matchmaking.d.ts +0 -57
- package/dist/kit/matchmaking.d.ts.map +0 -1
- package/dist/kit/matchmaking.js +0 -59
- package/dist/kit/minigames.d.ts +0 -30
- package/dist/kit/minigames.d.ts.map +0 -1
- package/dist/kit/minigames.js +0 -38
- package/dist/kit/mobs.d.ts +0 -90
- package/dist/kit/mobs.d.ts.map +0 -1
- package/dist/kit/mobs.js +0 -98
- package/dist/kit/moderation.d.ts +0 -73
- package/dist/kit/moderation.d.ts.map +0 -1
- package/dist/kit/moderation.js +0 -103
- package/dist/kit/movement.d.ts +0 -78
- package/dist/kit/movement.d.ts.map +0 -1
- package/dist/kit/movement.js +0 -103
- package/dist/kit/notifications.d.ts +0 -45
- package/dist/kit/notifications.d.ts.map +0 -1
- package/dist/kit/notifications.js +0 -67
- package/dist/kit/npcs.d.ts +0 -226
- package/dist/kit/npcs.d.ts.map +0 -1
- package/dist/kit/npcs.js +0 -141
- package/dist/kit/objects.d.ts +0 -116
- package/dist/kit/objects.d.ts.map +0 -1
- package/dist/kit/objects.js +0 -119
- package/dist/kit/pets.d.ts +0 -85
- package/dist/kit/pets.d.ts.map +0 -1
- package/dist/kit/pets.js +0 -96
- package/dist/kit/plots.d.ts +0 -85
- package/dist/kit/plots.d.ts.map +0 -1
- package/dist/kit/plots.js +0 -113
- package/dist/kit/progression.d.ts +0 -181
- package/dist/kit/progression.d.ts.map +0 -1
- package/dist/kit/progression.js +0 -265
- package/dist/kit/quests.d.ts +0 -171
- package/dist/kit/quests.d.ts.map +0 -1
- package/dist/kit/quests.js +0 -237
- package/dist/kit/racing.d.ts +0 -85
- package/dist/kit/racing.d.ts.map +0 -1
- package/dist/kit/racing.js +0 -99
- package/dist/kit/shared.d.ts +0 -73
- package/dist/kit/shared.d.ts.map +0 -1
- package/dist/kit/shared.js +0 -101
- package/dist/kit/telemetry.d.ts +0 -66
- package/dist/kit/telemetry.d.ts.map +0 -1
- package/dist/kit/telemetry.js +0 -133
- package/dist/kit/territory.d.ts +0 -97
- package/dist/kit/territory.d.ts.map +0 -1
- package/dist/kit/territory.js +0 -114
- package/dist/kit/worldsim.d.ts +0 -263
- package/dist/kit/worldsim.d.ts.map +0 -1
- package/dist/kit/worldsim.js +0 -268
- package/dist/stores/model.d.ts +0 -81
- package/dist/stores/model.d.ts.map +0 -1
- package/dist/stores/model.js +0 -163
package/dist/kit/kit.js
CHANGED
|
@@ -1,170 +1,12 @@
|
|
|
1
|
-
import { mergeBlueprints } from './blueprints/index.js';
|
|
2
|
-
import { CombatKit } from './combat.js';
|
|
3
|
-
import { DirectorKit } from './director.js';
|
|
4
|
-
import { DecksKit } from './decks.js';
|
|
5
|
-
import { EconomyKit } from './economy.js';
|
|
6
|
-
import { EngineDetector } from './engine.js';
|
|
7
|
-
import { FeaturesKit } from './features.js';
|
|
8
|
-
import { InstancesKit } from './instances.js';
|
|
9
|
-
import { InventoryKit } from './inventory.js';
|
|
10
|
-
import { LeaderboardsKit } from './leaderboards.js';
|
|
11
|
-
import { LootKit } from './loot.js';
|
|
12
|
-
import { MatchmakingKit } from './matchmaking.js';
|
|
13
|
-
import { MinigamesKit } from './minigames.js';
|
|
14
|
-
import { MobsKit } from './mobs.js';
|
|
15
|
-
import { NpcsKit } from './npcs.js';
|
|
16
|
-
import { ObjectsKit } from './objects.js';
|
|
17
|
-
import { PetsKit } from './pets.js';
|
|
18
|
-
import { PlotsKit } from './plots.js';
|
|
19
|
-
import { MatchesKit } from './matches.js';
|
|
20
|
-
import { ProgressionKit } from './progression.js';
|
|
21
|
-
import { QuestsKit } from './quests.js';
|
|
22
1
|
import { SocialKit } from './social.js';
|
|
23
|
-
import { AbilitiesKit } from './abilities.js';
|
|
24
|
-
import { LiveopsKit } from './liveops.js';
|
|
25
|
-
import { MovementKit } from './movement.js';
|
|
26
|
-
import { RacingKit } from './racing.js';
|
|
27
|
-
import { TerritoryKit } from './territory.js';
|
|
28
|
-
import { ModerationKit } from './moderation.js';
|
|
29
|
-
import { TelemetryKit } from './telemetry.js';
|
|
30
|
-
import { WorldsimKit } from './worldsim.js';
|
|
31
2
|
/**
|
|
32
|
-
* App-scoped **Game Kit**
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
* Two phases, matching the platform's model:
|
|
38
|
-
*
|
|
39
|
-
* 1. **Studio (admin) loads the rules** — {@link deploy} takes declarative
|
|
40
|
-
* {@link KitBlueprint}s (built with `inventoryBlueprint`, `lockBlueprint`,
|
|
41
|
-
* `npcBlueprint`, or by hand) and seeds the container types, property
|
|
42
|
-
* schemas, policy-gated functions, and automations into the app in one
|
|
43
|
-
* idempotent pass. Requires the app-admin `manage_apps` permission — run
|
|
44
|
-
* it from a trusted admin context, never the shipped game client.
|
|
45
|
-
* 2. **The game client plays** — {@link inventory}, {@link objects}, and
|
|
46
|
-
* {@link npcs} wrap the runtime calls (create/read containers, invoke the
|
|
47
|
-
* gated functions) assuming the blueprint conventions. Authorization is
|
|
48
|
-
* enforced server-side on every call.
|
|
49
|
-
*
|
|
50
|
-
* See the docs guides "Game API → Modeling game concepts" and
|
|
51
|
-
* "CrowdyJS → Game Kit".
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* ```ts
|
|
55
|
-
* // Studio setup (admin token):
|
|
56
|
-
* const kit = admin.kit(appId);
|
|
57
|
-
* await kit.deploy([
|
|
58
|
-
* inventoryBlueprint(),
|
|
59
|
-
* lockBlueprint({ objectTypeName: 'Door', authority: { kind: 'key' } }),
|
|
60
|
-
* ]);
|
|
61
|
-
*
|
|
62
|
-
* // Game client (player token):
|
|
63
|
-
* const kit = game.kit(appId);
|
|
64
|
-
* const bag = await kit.inventory.ensure(me.userId);
|
|
65
|
-
* const result = await kit.objects.open(doorId, { keyId });
|
|
66
|
-
* if (!result.success) showLockedMessage(result.errorMessage);
|
|
67
|
-
* ```
|
|
3
|
+
* App-scoped **Game Kit** returned by `client.kit(appId)`: parties, guilds and chat rooms
|
|
4
|
+
* over teams and channels ({@link social}). Game rules and state live in ck-exec hubs
|
|
5
|
+
* (`client.exec`); the kit's wire codecs (`encodeEnginePose`, `parseEngineEvent`, ...) and
|
|
6
|
+
* `runOptimisticAction` are standalone exports.
|
|
68
7
|
*/
|
|
69
8
|
export class GameKitClient {
|
|
70
|
-
constructor(appId,
|
|
71
|
-
this.appId = appId;
|
|
72
|
-
this.gameModel = gameModel;
|
|
73
|
-
this.compute = domains.compute;
|
|
74
|
-
this.engines = new EngineDetector(String(appId), domains.compute);
|
|
75
|
-
this.inventory = new InventoryKit(appId, gameModel, options.inventory);
|
|
76
|
-
this.objects = new ObjectsKit(appId, gameModel, options.objects);
|
|
77
|
-
this.npcs = new NpcsKit(appId, gameModel, options.npcs, this.engines);
|
|
78
|
-
this.plots = new PlotsKit(appId, gameModel, gameApps, options.plots);
|
|
79
|
-
this.economy = new EconomyKit(appId, gameModel, options.economy, this.engines);
|
|
80
|
-
this.progression = new ProgressionKit(appId, gameModel, options.progression);
|
|
81
|
-
this.loot = new LootKit(appId, gameModel, options.loot, this.engines);
|
|
82
|
-
this.quests = new QuestsKit(appId, gameModel, options.quests);
|
|
83
|
-
this.combat = new CombatKit(appId, gameModel, options.combat, this.engines);
|
|
84
|
-
this.matches = new MatchesKit(appId, gameModel, domains.channels, domains.udp, options.matches, this.engines);
|
|
85
|
-
this.decks = new DecksKit(appId, gameModel, options.decks, this.engines);
|
|
86
|
-
this.worldsim = new WorldsimKit(appId, gameModel, options.worldsim, this.engines);
|
|
87
|
-
this.liveops = new LiveopsKit(appId, gameModel, options.liveops, this.engines);
|
|
88
|
-
this.moderation = new ModerationKit(appId, gameModel, options.moderation);
|
|
89
|
-
this.telemetry = new TelemetryKit(appId, gameModel, options.telemetry);
|
|
90
|
-
this.abilities = new AbilitiesKit(appId, gameModel, this.engines, options.abilities);
|
|
91
|
-
this.movement = new MovementKit(appId, gameModel, this.engines, options.movement);
|
|
92
|
-
this.territory = new TerritoryKit(appId, gameModel, this.engines, options.territory);
|
|
93
|
-
this.racing = new RacingKit(appId, gameModel, this.engines, options.racing);
|
|
94
|
-
this.mobs = new MobsKit(appId, gameModel, this.engines, options.mobs);
|
|
95
|
-
this.pets = new PetsKit(appId, gameModel, this.engines, options.pets);
|
|
96
|
-
this.instances = new InstancesKit(appId, this.engines, options.instances);
|
|
97
|
-
this.director = new DirectorKit(appId, gameModel, this.engines, options.director);
|
|
98
|
-
this.matchmaking = new MatchmakingKit(appId, this.engines, options.matchmaking);
|
|
99
|
-
this.minigames = new MinigamesKit(appId, this.engines, options.minigames);
|
|
9
|
+
constructor(appId, gameApps, options = {}, domains = {}) {
|
|
100
10
|
this.social = new SocialKit(appId, domains.teams, domains.channels, domains.udp, gameApps, options.social);
|
|
101
|
-
this.leaderboards = new LeaderboardsKit(appId, gameModel, options.leaderboards, this.engines);
|
|
102
|
-
this.features = new FeaturesKit(appId, gameModel);
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Helpers for an additional lockable object type deployed under a different
|
|
106
|
-
* type name (e.g. both `Door` and `Chest` lock blueprints in one app).
|
|
107
|
-
*/
|
|
108
|
-
objectsFor(objectTypeName, keyTypeName) {
|
|
109
|
-
return new ObjectsKit(this.appId, this.gameModel, {
|
|
110
|
-
objectTypeName,
|
|
111
|
-
keyTypeName,
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* **Studio (admin)** — load blueprints into the app: one transactional
|
|
116
|
-
* `gameModelSeed` for the definitions (and any seed containers/edges),
|
|
117
|
-
* followed by an `upsertAutomation` per automation and an
|
|
118
|
-
* `upsertAutomationTrigger` per event trigger. Idempotent: definitions
|
|
119
|
-
* upsert on their names, automations key on the automation name.
|
|
120
|
-
*
|
|
121
|
-
* Requires the app-admin `manage_apps` permission.
|
|
122
|
-
*
|
|
123
|
-
* @param blueprints - The blueprints to deploy. Duplicate type/function/
|
|
124
|
-
* automation names across blueprints throw before anything is sent.
|
|
125
|
-
* @param options - `sessionId` scopes any seed containers to a session.
|
|
126
|
-
* @returns A {@link KitDeployResult} with the seed counts, the upserted
|
|
127
|
-
* automations/triggers, and any non-fatal seed `warnings`.
|
|
128
|
-
* @throws {CrowdyGraphQLError} `FORBIDDEN` (`requiredPermission ===
|
|
129
|
-
* 'manage_apps'`) without app-admin, or `BAD_USER_INPUT` for definitions
|
|
130
|
-
* that fail to compile.
|
|
131
|
-
*/
|
|
132
|
-
async deploy(blueprints, options = {}) {
|
|
133
|
-
const list = Array.isArray(blueprints) ? blueprints : [blueprints];
|
|
134
|
-
const merged = mergeBlueprints(this.appId, list, options);
|
|
135
|
-
const seed = await this.gameModel.seed(merged.seedInput);
|
|
136
|
-
const automations = [];
|
|
137
|
-
for (const automation of merged.automations) {
|
|
138
|
-
automations.push(await this.gameModel.upsertAutomation(automation));
|
|
139
|
-
}
|
|
140
|
-
const automationTriggers = [];
|
|
141
|
-
for (const trigger of merged.automationTriggers) {
|
|
142
|
-
automationTriggers.push(await this.gameModel.upsertAutomationTrigger(trigger));
|
|
143
|
-
}
|
|
144
|
-
const engines = [];
|
|
145
|
-
for (const entry of options.engines ?? []) {
|
|
146
|
-
if (!this.compute) {
|
|
147
|
-
throw new Error('kit.deploy engines requires the compute domain (createCrowdyClient default)');
|
|
148
|
-
}
|
|
149
|
-
const [templateName, moduleOverride] = entry.split(':');
|
|
150
|
-
const module = await this.compute.deployTemplate({
|
|
151
|
-
appId: this.appId,
|
|
152
|
-
templateName,
|
|
153
|
-
...(moduleOverride ? { moduleName: moduleOverride } : {}),
|
|
154
|
-
});
|
|
155
|
-
let compileStatus = 'pending';
|
|
156
|
-
if (options.waitForEngines !== false) {
|
|
157
|
-
const compiled = await this.compute.waitForCompile(this.appId, module.name);
|
|
158
|
-
compileStatus = compiled.compileStatus;
|
|
159
|
-
}
|
|
160
|
-
engines.push({ templateName, moduleName: module.name, compileStatus });
|
|
161
|
-
}
|
|
162
|
-
return {
|
|
163
|
-
seed,
|
|
164
|
-
automations,
|
|
165
|
-
automationTriggers,
|
|
166
|
-
engines,
|
|
167
|
-
warnings: [...(seed.warnings ?? [])],
|
|
168
|
-
};
|
|
169
11
|
}
|
|
170
12
|
}
|
package/dist/kit/social.d.ts
CHANGED
|
@@ -36,9 +36,7 @@ export interface KitChatMessage {
|
|
|
36
36
|
* Runtime **social** helpers — parties, guilds, and chat rooms in familiar
|
|
37
37
|
* words, wrapped over the platform's teams (membership + roles) and
|
|
38
38
|
* channels (location-independent messaging) with realtime delivery via the
|
|
39
|
-
* UDP notification subscription.
|
|
40
|
-
* deployable is the optional {@link guildBlueprint} composite (guild hall +
|
|
41
|
-
* bank).
|
|
39
|
+
* UDP notification subscription. Nothing is deployed.
|
|
42
40
|
*
|
|
43
41
|
* Conventions: a party is a team named `party:<name>` paired with an
|
|
44
42
|
* equally-named channel; a guild is `guild:<name>` likewise. Guild
|
package/dist/kit/social.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/kit/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGvD,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,oEAAoE;IACpE,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,+DAA+D;AAC/D,MAAM,WAAW,mBAAmB;IAClC,wDAAwD;IACxD,MAAM,EAAE,MAAM,CAAC;IACf,wEAAwE;IACxE,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,mDAAmD;AACnD,MAAM,WAAW,cAAc;IAC7B,SAAS,EAAE,MAAM,CAAC;IAClB,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/kit/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,K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MAAM,CAAA;SAAE;;;;;;;;;;QAUpE;;;WAGG;yBAEM,mBAAmB,UAClB,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,WACzB,MAAM,EAAE;;;;;;;;0BA8FiwlpB,CAAC;;;;;;;;QArFrxlpB;;;;;WAKG;gCAEM,mBAAmB,UAClB,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,YACzB;YAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;YAAC,WAAW,CAAC,EAAE,MAAM,CAAA;SAAE;;;;;;;;;MAY9D;IAEF,8DAA8D;IAC9D,QAAQ,CAAC,IAAI;QACX,4DAA4D;qBACzC,MAAM;;;;;;;;;;;;;QAOzB,wBAAwB;0BACA,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC;;;;;;;;0BAmDyzzjB,CAAC;;;;;;;;QA/C52zjB;;;;WAIG;0BAEU,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,QAC/B,MAAM,KACX,OAAO,CAAC,OAAO,CAAC;QAQnB;;;WAGG;+BAEU,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,YAC3B,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,KAC1C,CAAC,MAAM,IAAI,CAAC;MAsBf;CACH"}
|
package/dist/kit/social.js
CHANGED
|
@@ -3,9 +3,7 @@ import { decodeBase64, encodeBase64, generateCrowdyUuid } from '../utils.js';
|
|
|
3
3
|
* Runtime **social** helpers — parties, guilds, and chat rooms in familiar
|
|
4
4
|
* words, wrapped over the platform's teams (membership + roles) and
|
|
5
5
|
* channels (location-independent messaging) with realtime delivery via the
|
|
6
|
-
* UDP notification subscription.
|
|
7
|
-
* deployable is the optional {@link guildBlueprint} composite (guild hall +
|
|
8
|
-
* bank).
|
|
6
|
+
* UDP notification subscription. Nothing is deployed.
|
|
9
7
|
*
|
|
10
8
|
* Conventions: a party is a team named `party:<name>` paired with an
|
|
11
9
|
* equally-named channel; a guild is `guild:<name>` likewise. Guild
|
package/dist/kit/wire.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Engine wire registry — the client mirror of
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Engine wire registry — the client mirror of `crowdy-game-kit-core::wire`
|
|
3
|
+
* (the actor pose layout and flag-bit registry the game engines emit, and
|
|
4
|
+
* hubs that keep a game's client parsers still send). Parity with the Rust
|
|
5
|
+
* crate is checked by the kit wire unit suite: any change here must land in
|
|
6
|
+
* kit-core first.
|
|
7
7
|
*
|
|
8
8
|
* 48-byte little-endian pose: pos f32 x3 (0..11), yaw/pitch f32 (12..19),
|
|
9
9
|
* velocity f32 x3 (20..31), flags u8 (32), held u8 (33), 34-35 reserved,
|
|
@@ -172,4 +172,15 @@ export interface RaceTimingEvent {
|
|
|
172
172
|
}
|
|
173
173
|
/** Parse a race-timing event; null when the payload is another type. */
|
|
174
174
|
export declare function parseRaceTimingEvent(bytes: Uint8Array): RaceTimingEvent | null;
|
|
175
|
+
/** A parsed type-98 zone-change event (a shrinking or moving play zone). */
|
|
176
|
+
export interface ZoneChangeEvent {
|
|
177
|
+
kind: string;
|
|
178
|
+
phase: number | null;
|
|
179
|
+
radiusNow: number;
|
|
180
|
+
centerX: number;
|
|
181
|
+
centerZ: number;
|
|
182
|
+
body: Record<string, unknown>;
|
|
183
|
+
}
|
|
184
|
+
/** Parse a zone-change event; null when the payload is another type. */
|
|
185
|
+
export declare function parseZoneChangeEvent(bytes: Uint8Array): ZoneChangeEvent | null;
|
|
175
186
|
//# sourceMappingURL=wire.d.ts.map
|
package/dist/kit/wire.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/kit/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAGH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM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
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Engine wire registry — the client mirror of `crowdy-game-kit-core::wire`
|
|
3
|
+
* (the actor pose layout and flag-bit registry the game engines emit, and
|
|
4
|
+
* hubs that keep a game's client parsers still send). Parity with the Rust
|
|
5
|
+
* crate is checked by the kit wire unit suite: any change here must land in
|
|
6
|
+
* kit-core first.
|
|
7
7
|
*
|
|
8
8
|
* 48-byte little-endian pose: pos f32 x3 (0..11), yaw/pitch f32 (12..19),
|
|
9
9
|
* velocity f32 x3 (20..31), flags u8 (32), held u8 (33), 34-35 reserved,
|
|
@@ -264,3 +264,17 @@ export function parseRaceTimingEvent(bytes) {
|
|
|
264
264
|
body: parsed.body,
|
|
265
265
|
};
|
|
266
266
|
}
|
|
267
|
+
/** Parse a zone-change event; null when the payload is another type. */
|
|
268
|
+
export function parseZoneChangeEvent(bytes) {
|
|
269
|
+
const parsed = parseEngineEvent(bytes);
|
|
270
|
+
if (!parsed || parsed.eventType !== EVENT_ZONE_CHANGE)
|
|
271
|
+
return null;
|
|
272
|
+
return {
|
|
273
|
+
kind: String(parsed.body.kind ?? ''),
|
|
274
|
+
phase: parsed.body.phase != null ? Number(parsed.body.phase) : null,
|
|
275
|
+
radiusNow: Number(parsed.body.radiusNow ?? 0),
|
|
276
|
+
centerX: Number(parsed.body.centerX ?? 0),
|
|
277
|
+
centerZ: Number(parsed.body.centerZ ?? 0),
|
|
278
|
+
body: parsed.body,
|
|
279
|
+
};
|
|
280
|
+
}
|