@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.
Files changed (68) hide show
  1. package/MIGRATION.md +59 -0
  2. package/README.md +5 -1
  3. package/dist/domains/compute.d.ts +13 -2
  4. package/dist/domains/compute.d.ts.map +1 -1
  5. package/dist/domains/compute.js +19 -2
  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 +3 -1
  16. package/dist/kit/blueprints/index.d.ts.map +1 -1
  17. package/dist/kit/blueprints/index.js +3 -1
  18. package/dist/kit/blueprints/inventory.d.ts +47 -1
  19. package/dist/kit/blueprints/inventory.d.ts.map +1 -1
  20. package/dist/kit/blueprints/inventory.js +112 -12
  21. package/dist/kit/blueprints/liveops.d.ts +42 -0
  22. package/dist/kit/blueprints/liveops.d.ts.map +1 -0
  23. package/dist/kit/blueprints/liveops.js +170 -0
  24. package/dist/kit/blueprints/moderation.d.ts +32 -0
  25. package/dist/kit/blueprints/moderation.d.ts.map +1 -0
  26. package/dist/kit/blueprints/moderation.js +140 -0
  27. package/dist/kit/combat.d.ts +4 -3
  28. package/dist/kit/combat.d.ts.map +1 -1
  29. package/dist/kit/combat.js +4 -3
  30. package/dist/kit/index.d.ts +9 -2
  31. package/dist/kit/index.d.ts.map +1 -1
  32. package/dist/kit/index.js +9 -2
  33. package/dist/kit/inventory.d.ts +13 -0
  34. package/dist/kit/inventory.d.ts.map +1 -1
  35. package/dist/kit/inventory.js +33 -4
  36. package/dist/kit/kit.d.ts +44 -0
  37. package/dist/kit/kit.d.ts.map +1 -1
  38. package/dist/kit/kit.js +35 -1
  39. package/dist/kit/liveops.d.ts +112 -0
  40. package/dist/kit/liveops.d.ts.map +1 -0
  41. package/dist/kit/liveops.js +183 -0
  42. package/dist/kit/loot.d.ts +22 -1
  43. package/dist/kit/loot.d.ts.map +1 -1
  44. package/dist/kit/loot.js +41 -1
  45. package/dist/kit/moderation.d.ts +73 -0
  46. package/dist/kit/moderation.d.ts.map +1 -0
  47. package/dist/kit/moderation.js +103 -0
  48. package/dist/kit/movement.d.ts +78 -0
  49. package/dist/kit/movement.d.ts.map +1 -0
  50. package/dist/kit/movement.js +103 -0
  51. package/dist/kit/npcs.d.ts.map +1 -1
  52. package/dist/kit/quests.d.ts +4 -0
  53. package/dist/kit/quests.d.ts.map +1 -1
  54. package/dist/kit/quests.js +9 -2
  55. package/dist/kit/racing.d.ts +85 -0
  56. package/dist/kit/racing.d.ts.map +1 -0
  57. package/dist/kit/racing.js +99 -0
  58. package/dist/kit/social.d.ts.map +1 -1
  59. package/dist/kit/telemetry.d.ts +66 -0
  60. package/dist/kit/telemetry.d.ts.map +1 -0
  61. package/dist/kit/telemetry.js +133 -0
  62. package/dist/kit/territory.d.ts +97 -0
  63. package/dist/kit/territory.d.ts.map +1 -0
  64. package/dist/kit/territory.js +114 -0
  65. package/dist/kit/wire.d.ts +51 -0
  66. package/dist/kit/wire.d.ts.map +1 -1
  67. package/dist/kit/wire.js +60 -0
  68. package/package.json +1 -1
package/dist/kit/kit.d.ts CHANGED
@@ -27,6 +27,13 @@ import { MatchesKit, type MatchesKitOptions } from './matches.js';
27
27
  import { ProgressionKit, type ProgressionKitOptions } from './progression.js';
28
28
  import { QuestsKit, type QuestsKitOptions } from './quests.js';
29
29
  import { SocialKit, type SocialKitOptions } from './social.js';
30
+ import { AbilitiesKit, type AbilitiesKitOptions } from './abilities.js';
31
+ import { LiveopsKit, type LiveopsKitOptions } from './liveops.js';
32
+ import { MovementKit, type MovementKitOptions } from './movement.js';
33
+ import { RacingKit, type RacingKitOptions } from './racing.js';
34
+ import { TerritoryKit, type TerritoryKitOptions } from './territory.js';
35
+ import { ModerationKit, type ModerationKitOptions } from './moderation.js';
36
+ import { TelemetryKit, type TelemetryKitOptions } from './telemetry.js';
30
37
  import { WorldsimKit, type WorldsimKitOptions } from './worldsim.js';
31
38
  /** Options for {@link GameKitClient}, configuring the runtime helpers to match your deployed blueprints. */
32
39
  export interface GameKitOptions {
@@ -42,6 +49,13 @@ export interface GameKitOptions {
42
49
  matches?: MatchesKitOptions;
43
50
  decks?: DecksKitOptions;
44
51
  worldsim?: WorldsimKitOptions;
52
+ liveops?: LiveopsKitOptions;
53
+ moderation?: ModerationKitOptions;
54
+ telemetry?: TelemetryKitOptions;
55
+ abilities?: AbilitiesKitOptions;
56
+ movement?: MovementKitOptions;
57
+ territory?: TerritoryKitOptions;
58
+ racing?: RacingKitOptions;
45
59
  social?: SocialKitOptions;
46
60
  leaderboards?: LeaderboardsKitOptions;
47
61
  mobs?: MobsKitOptions;
@@ -68,6 +82,12 @@ export interface KitDeployResult {
68
82
  seed: GameModelSeedMutation['gameModelSeed'];
69
83
  automations: GameModelUpsertAutomationMutation['gameModelUpsertAutomation'][];
70
84
  automationTriggers: GameModelUpsertAutomationTriggerMutation['gameModelUpsertAutomationTrigger'][];
85
+ /** Engine templates deployed alongside (when `engines` was passed). */
86
+ engines: Array<{
87
+ templateName: string;
88
+ moduleName: string;
89
+ compileStatus: string;
90
+ }>;
71
91
  /** Non-fatal static-analysis warnings from the seed. */
72
92
  warnings: string[];
73
93
  }
@@ -136,6 +156,20 @@ export declare class GameKitClient {
136
156
  readonly decks: DecksKit;
137
157
  /** World simulation helpers (clock/weather, nodes, crops, wave counters). */
138
158
  readonly worldsim: WorldsimKit;
159
+ /** Liveops helpers (event windows, seasons, battle-pass composition). */
160
+ readonly liveops: LiveopsKit;
161
+ /** Moderation helpers (reports, admin queue, personal mutes). */
162
+ readonly moderation: ModerationKit;
163
+ /** Telemetry helpers (track + sampled counters). */
164
+ readonly telemetry: TelemetryKit;
165
+ /** Realtime ability casts (abilities engine, type-94 events). */
166
+ readonly abilities: AbilitiesKit;
167
+ /** Movement-warden reads (observe/flag posture, type-95 events). */
168
+ readonly movement: MovementKit;
169
+ /** Control points + factions (territory engine, type-96 events). */
170
+ readonly territory: TerritoryKit;
171
+ /** Racing + possession (type-97 events, ghosts, the ball). */
172
+ readonly racing: RacingKit;
139
173
  /** Social helpers (parties, guilds, chat over teams + channels). */
140
174
  readonly social: SocialKit;
141
175
  /** Leaderboard helpers (trusted submits, client-side ranking, seasons). */
@@ -156,6 +190,7 @@ export declare class GameKitClient {
156
190
  readonly pets: PetsKit;
157
191
  /** Compute-engine capability detection shared by the engine-aware kits. */
158
192
  readonly engines: EngineDetector;
193
+ private readonly compute?;
159
194
  constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, gameApps: GameAppsAPI, options?: GameKitOptions, domains?: GameKitDomains);
160
195
  /**
161
196
  * Helpers for an additional lockable object type deployed under a different
@@ -182,6 +217,15 @@ export declare class GameKitClient {
182
217
  */
183
218
  deploy(blueprints: KitBlueprint | KitBlueprint[], options?: {
184
219
  sessionId?: string;
220
+ /**
221
+ * Engine templates to deploy from the platform registry alongside the
222
+ * blueprints (`computeDeployTemplate` — requires the compute domain +
223
+ * 'manage_compute'). Each entry is a template name, optionally
224
+ * `'template:module'` to override the module name.
225
+ */
226
+ engines?: string[];
227
+ /** Wait for engine compiles (default true). */
228
+ waitForEngines?: boolean;
185
229
  }): Promise<KitDeployResult>;
186
230
  }
187
231
  //# sourceMappingURL=kit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"kit.d.ts","sourceRoot":"","sources":["../../src/kit/kit.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,YAAY,EAAE,MAAM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AAC,OAAO,EAAE,cAAc,CAAC;IACjC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAa;gBAGnB,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EACjC,SAAS,EAAE,YAAY,EACxC,QAAQ,EAAE,WAAW,EACrB,OAAO,GAAE,cAAmB,EAC5B,OAAO,GAAE,cAAmB;IAgD9B;;;OAGG;IACH,UAAU,CAAC,cAAc,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM,GAAG,UAAU;IAOpE;;;;;;;;;;;;;;;;;OAiBG;IACG,MAAM,CACV,UAAU,EAAE,YAAY,GAAG,YAAY,EAAE,EACzC,OAAO,GAAE;QACP,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB;;;;;WAKG;QACH,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;QACnB,+CAA+C;QAC/C,cAAc,CAAC,EAAE,OAAO,CAAC;KACrB,GACL,OAAO,CAAC,eAAe,CAAC;CA0C5B"}
package/dist/kit/kit.js CHANGED
@@ -20,6 +20,13 @@ import { MatchesKit } from './matches.js';
20
20
  import { ProgressionKit } from './progression.js';
21
21
  import { QuestsKit } from './quests.js';
22
22
  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';
23
30
  import { WorldsimKit } from './worldsim.js';
24
31
  /**
25
32
  * App-scoped **Game Kit** facade returned by `client.kit(appId)` — high-level
@@ -63,6 +70,7 @@ export class GameKitClient {
63
70
  constructor(appId, gameModel, gameApps, options = {}, domains = {}) {
64
71
  this.appId = appId;
65
72
  this.gameModel = gameModel;
73
+ this.compute = domains.compute;
66
74
  this.engines = new EngineDetector(String(appId), domains.compute);
67
75
  this.inventory = new InventoryKit(appId, gameModel, options.inventory);
68
76
  this.objects = new ObjectsKit(appId, gameModel, options.objects);
@@ -70,12 +78,19 @@ export class GameKitClient {
70
78
  this.plots = new PlotsKit(appId, gameModel, gameApps, options.plots);
71
79
  this.economy = new EconomyKit(appId, gameModel, options.economy, this.engines);
72
80
  this.progression = new ProgressionKit(appId, gameModel, options.progression);
73
- this.loot = new LootKit(appId, gameModel, options.loot);
81
+ this.loot = new LootKit(appId, gameModel, options.loot, this.engines);
74
82
  this.quests = new QuestsKit(appId, gameModel, options.quests);
75
83
  this.combat = new CombatKit(appId, gameModel, options.combat, this.engines);
76
84
  this.matches = new MatchesKit(appId, gameModel, domains.channels, domains.udp, options.matches, this.engines);
77
85
  this.decks = new DecksKit(appId, gameModel, options.decks, this.engines);
78
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);
79
94
  this.mobs = new MobsKit(appId, gameModel, this.engines, options.mobs);
80
95
  this.pets = new PetsKit(appId, gameModel, this.engines, options.pets);
81
96
  this.instances = new InstancesKit(appId, this.engines, options.instances);
@@ -126,10 +141,29 @@ export class GameKitClient {
126
141
  for (const trigger of merged.automationTriggers) {
127
142
  automationTriggers.push(await this.gameModel.upsertAutomationTrigger(trigger));
128
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
+ }
129
162
  return {
130
163
  seed,
131
164
  automations,
132
165
  automationTriggers,
166
+ engines,
133
167
  warnings: [...(seed.warnings ?? [])],
134
168
  };
135
169
  }
@@ -0,0 +1,112 @@
1
+ import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { Scalars } from '../generated/graphql.js';
3
+ import type { EngineDetector } from './engine.js';
4
+ /** Options for {@link LiveopsKit}. */
5
+ export interface LiveopsKitOptions {
6
+ /** The `typePrefix` the liveops blueprint was deployed with. */
7
+ typePrefix?: string;
8
+ /** The scheduler engine module name. Defaults to `'liveops-scheduler'`. */
9
+ moduleName?: string;
10
+ }
11
+ /** A parsed event window. */
12
+ export interface KitEventWindow {
13
+ containerId: string;
14
+ windowId: string;
15
+ active: boolean;
16
+ opensAtMs: number;
17
+ closesAtMs: number;
18
+ modifiers: Record<string, unknown>;
19
+ }
20
+ /** A parsed season definition (+ its battle-pass composition). */
21
+ export interface KitSeason {
22
+ containerId: string;
23
+ seasonId: string;
24
+ active: boolean;
25
+ startsAtMs: number;
26
+ endsAtMs: number;
27
+ passTrack: string;
28
+ passFeatures: string[];
29
+ }
30
+ /** A parsed type-98 zone-change event (BR circles, event areas). */
31
+ export interface ZoneChangeEvent {
32
+ kind: string;
33
+ phase: number | null;
34
+ radiusNow: number;
35
+ centerX: number;
36
+ centerZ: number;
37
+ body: Record<string, unknown>;
38
+ }
39
+ /**
40
+ * Runtime helpers for the liveops blueprint: event windows (admin CRUD +
41
+ * active reads — engine-backed when the liveops-scheduler is deployed),
42
+ * seasons with battle-pass composition, and the type-98 zone-change parser.
43
+ *
44
+ * Obtained via `client.kit(appId).liveops`.
45
+ */
46
+ export declare class LiveopsKit {
47
+ private readonly appId;
48
+ private readonly gameModel;
49
+ private readonly engines?;
50
+ private readonly names;
51
+ private readonly moduleName;
52
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: LiveopsKitOptions, engines?: EngineDetector | undefined);
53
+ /** Is the liveops-scheduler engine deployed + enabled (cached)? */
54
+ engineAvailable(): Promise<boolean>;
55
+ /** STUDIO (admin) — create an event window. */
56
+ defineWindow(input: {
57
+ windowId: string;
58
+ displayName?: string;
59
+ opensAtMs?: number;
60
+ closesAtMs?: number;
61
+ modifiers?: Record<string, unknown>;
62
+ }): Promise<{
63
+ __typename?: "GmContainer";
64
+ containerId: string;
65
+ appId: string;
66
+ sessionId: string | null;
67
+ typeName: string;
68
+ displayName: string;
69
+ description: string | null;
70
+ ownerUserId: string | null;
71
+ metadataJson: string;
72
+ }>;
73
+ /** Every window (model read). */
74
+ windows(): Promise<KitEventWindow[]>;
75
+ /**
76
+ * The ACTIVE windows. Engine path (scheduler deployed): the module's
77
+ * authoritative view; otherwise filters the model read.
78
+ */
79
+ activeWindows(): Promise<KitEventWindow[]>;
80
+ /** STUDIO (admin/automation) — open a window through the model function. */
81
+ openWindow(windowContainerId: string, sessionId?: string): Promise<import("./shared.js").KitInvokeResult<boolean>>;
82
+ /** STUDIO (admin/automation) — close a window through the model function. */
83
+ closeWindow(windowContainerId: string, sessionId?: string): Promise<import("./shared.js").KitInvokeResult<boolean>>;
84
+ /** STUDIO (admin) — create a season (+ battle-pass composition). */
85
+ defineSeason(input: {
86
+ seasonId: string;
87
+ displayName?: string;
88
+ startsAtMs?: number;
89
+ endsAtMs?: number;
90
+ passTrack?: string;
91
+ passFeatures?: string[];
92
+ }): Promise<{
93
+ __typename?: "GmContainer";
94
+ containerId: string;
95
+ appId: string;
96
+ sessionId: string | null;
97
+ typeName: string;
98
+ displayName: string;
99
+ description: string | null;
100
+ ownerUserId: string | null;
101
+ metadataJson: string;
102
+ }>;
103
+ /** Every season (model read). */
104
+ seasons(): Promise<KitSeason[]>;
105
+ /** The active season, when one exists. */
106
+ currentSeason(): Promise<KitSeason | null>;
107
+ /** STUDIO (admin/automation) — activate a season through the model function. */
108
+ activateSeason(seasonContainerId: string, sessionId?: string): Promise<import("./shared.js").KitInvokeResult<boolean>>;
109
+ /** Parse a type-98 zone-change server event (BR circles, event areas). */
110
+ parseZoneChange(bytes: Uint8Array): ZoneChangeEvent | null;
111
+ }
112
+ //# sourceMappingURL=liveops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveops.d.ts","sourceRoot":"","sources":["../../src/kit/liveops.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAIlD,sCAAsC;AACtC,MAAM,WAAW,iBAAiB;IAChC,gEAAgE;IAChE,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,2EAA2E;IAC3E,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,6BAA6B;AAC7B,MAAM,WAAW,cAAc;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED,kEAAkE;AAClE,MAAM,WAAW,SAAS;IACxB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,OAAO,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EA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,6EAA6E;IACvE,WAAW,CAAC,iBAAiB,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IAS/D,oEAAoE;IAC9D,YAAY,CAAC,KAAK,EAAE;QACxB,QAAQ,EAAE,MAAM,CAAC;QACjB,WAAW,CAAC,EAAE,MAAM,CAAC;QACrB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,SAAS,CAAC,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;KACzB;;;;;;;;;;;IAyBD,iCAAiC;IAC3B,OAAO,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;IA2BrC,0CAA0C;IACpC,aAAa,IAAI,OAAO,CAAC,SAAS,GAAG,IAAI,CAAC;IAIhD,gFAAgF;IAC1E,cAAc,CAAC,iBAAiB,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM;IASlE,0EAA0E;IAC1E,eAAe,CAAC,KAAK,EAAE,UAAU,GAAG,eAAe,GAAG,IAAI;CAY3D"}
@@ -0,0 +1,183 @@
1
+ import { liveopsNames } from './blueprints/liveops.js';
2
+ import { kitContainerProperties, kitInvoke } from './shared.js';
3
+ import { parseEngineEvent, EVENT_ZONE_CHANGE } from './wire.js';
4
+ /**
5
+ * Runtime helpers for the liveops blueprint: event windows (admin CRUD +
6
+ * active reads — engine-backed when the liveops-scheduler is deployed),
7
+ * seasons with battle-pass composition, and the type-98 zone-change parser.
8
+ *
9
+ * Obtained via `client.kit(appId).liveops`.
10
+ */
11
+ export class LiveopsKit {
12
+ constructor(appId, gameModel, options = {}, engines) {
13
+ this.appId = appId;
14
+ this.gameModel = gameModel;
15
+ this.engines = engines;
16
+ this.names = liveopsNames(options.typePrefix ?? '');
17
+ this.moduleName = options.moduleName ?? 'liveops-scheduler';
18
+ }
19
+ /** Is the liveops-scheduler engine deployed + enabled (cached)? */
20
+ engineAvailable() {
21
+ if (!this.engines)
22
+ return Promise.resolve(false);
23
+ return this.engines.has(this.moduleName);
24
+ }
25
+ /** STUDIO (admin) — create an event window. */
26
+ async defineWindow(input) {
27
+ return this.gameModel.createContainer({
28
+ appId: this.appId,
29
+ typeName: this.names.windowType,
30
+ displayName: input.displayName ?? `Window ${input.windowId}`,
31
+ properties: [
32
+ { key: 'window_id', valueType: 'string', valueJson: JSON.stringify(input.windowId) },
33
+ ...(input.opensAtMs !== undefined
34
+ ? [{ key: 'opens_at_ms', valueType: 'int', valueJson: String(input.opensAtMs) }]
35
+ : []),
36
+ ...(input.closesAtMs !== undefined
37
+ ? [{ key: 'closes_at_ms', valueType: 'int', valueJson: String(input.closesAtMs) }]
38
+ : []),
39
+ {
40
+ key: 'modifiers',
41
+ valueType: 'string',
42
+ valueJson: JSON.stringify(JSON.stringify(input.modifiers ?? {})),
43
+ },
44
+ ],
45
+ });
46
+ }
47
+ /** Every window (model read). */
48
+ async windows() {
49
+ const containers = await this.gameModel.containers({
50
+ appId: this.appId,
51
+ typeName: this.names.windowType,
52
+ });
53
+ return Promise.all(containers.map(async (c) => {
54
+ const props = await kitContainerProperties(this.gameModel, String(this.appId), c.containerId);
55
+ let modifiers = {};
56
+ try {
57
+ modifiers = JSON.parse(String(props.modifiers ?? '{}'));
58
+ }
59
+ catch {
60
+ /* opaque */
61
+ }
62
+ return {
63
+ containerId: c.containerId,
64
+ windowId: String(props.window_id ?? ''),
65
+ active: props.active === true,
66
+ opensAtMs: Number(props.opens_at_ms ?? 0),
67
+ closesAtMs: Number(props.closes_at_ms ?? 0),
68
+ modifiers,
69
+ };
70
+ }));
71
+ }
72
+ /**
73
+ * The ACTIVE windows. Engine path (scheduler deployed): the module's
74
+ * authoritative view; otherwise filters the model read.
75
+ */
76
+ async activeWindows() {
77
+ if (this.engines && (await this.engineAvailable())) {
78
+ const result = await this.engines.invoke(this.moduleName, 'active_windows', {});
79
+ if (result.success && Array.isArray(result.body.windows)) {
80
+ const all = await this.windows();
81
+ const activeIds = new Set(result.body.windows.map((w) => String(w.windowId)));
82
+ return all.filter((w) => activeIds.has(w.windowId));
83
+ }
84
+ }
85
+ return (await this.windows()).filter((w) => w.active);
86
+ }
87
+ /** STUDIO (admin/automation) — open a window through the model function. */
88
+ async openWindow(windowContainerId, sessionId) {
89
+ return kitInvoke(this.gameModel, {
90
+ appId: String(this.appId),
91
+ functionName: this.names.openWindowFn,
92
+ selfContainerId: windowContainerId,
93
+ ...(sessionId !== undefined ? { sessionId } : {}),
94
+ });
95
+ }
96
+ /** STUDIO (admin/automation) — close a window through the model function. */
97
+ async closeWindow(windowContainerId, sessionId) {
98
+ return kitInvoke(this.gameModel, {
99
+ appId: String(this.appId),
100
+ functionName: this.names.closeWindowFn,
101
+ selfContainerId: windowContainerId,
102
+ ...(sessionId !== undefined ? { sessionId } : {}),
103
+ });
104
+ }
105
+ /** STUDIO (admin) — create a season (+ battle-pass composition). */
106
+ async defineSeason(input) {
107
+ return this.gameModel.createContainer({
108
+ appId: this.appId,
109
+ typeName: this.names.seasonType,
110
+ displayName: input.displayName ?? `Season ${input.seasonId}`,
111
+ properties: [
112
+ { key: 'season_id', valueType: 'string', valueJson: JSON.stringify(input.seasonId) },
113
+ ...(input.startsAtMs !== undefined
114
+ ? [{ key: 'starts_at_ms', valueType: 'int', valueJson: String(input.startsAtMs) }]
115
+ : []),
116
+ ...(input.endsAtMs !== undefined
117
+ ? [{ key: 'ends_at_ms', valueType: 'int', valueJson: String(input.endsAtMs) }]
118
+ : []),
119
+ ...(input.passTrack !== undefined
120
+ ? [{ key: 'pass_track', valueType: 'string', valueJson: JSON.stringify(input.passTrack) }]
121
+ : []),
122
+ {
123
+ key: 'pass_features',
124
+ valueType: 'string',
125
+ valueJson: JSON.stringify(JSON.stringify(input.passFeatures ?? [])),
126
+ },
127
+ ],
128
+ });
129
+ }
130
+ /** Every season (model read). */
131
+ async seasons() {
132
+ const containers = await this.gameModel.containers({
133
+ appId: this.appId,
134
+ typeName: this.names.seasonType,
135
+ });
136
+ return Promise.all(containers.map(async (c) => {
137
+ const props = await kitContainerProperties(this.gameModel, String(this.appId), c.containerId);
138
+ let passFeatures = [];
139
+ try {
140
+ passFeatures = JSON.parse(String(props.pass_features ?? '[]')).map(String);
141
+ }
142
+ catch {
143
+ /* opaque */
144
+ }
145
+ return {
146
+ containerId: c.containerId,
147
+ seasonId: String(props.season_id ?? ''),
148
+ active: props.active === true,
149
+ startsAtMs: Number(props.starts_at_ms ?? 0),
150
+ endsAtMs: Number(props.ends_at_ms ?? 0),
151
+ passTrack: String(props.pass_track ?? ''),
152
+ passFeatures,
153
+ };
154
+ }));
155
+ }
156
+ /** The active season, when one exists. */
157
+ async currentSeason() {
158
+ return (await this.seasons()).find((s) => s.active) ?? null;
159
+ }
160
+ /** STUDIO (admin/automation) — activate a season through the model function. */
161
+ async activateSeason(seasonContainerId, sessionId) {
162
+ return kitInvoke(this.gameModel, {
163
+ appId: String(this.appId),
164
+ functionName: this.names.activateSeasonFn,
165
+ selfContainerId: seasonContainerId,
166
+ ...(sessionId !== undefined ? { sessionId } : {}),
167
+ });
168
+ }
169
+ /** Parse a type-98 zone-change server event (BR circles, event areas). */
170
+ parseZoneChange(bytes) {
171
+ const parsed = parseEngineEvent(bytes);
172
+ if (!parsed || parsed.eventType !== EVENT_ZONE_CHANGE)
173
+ return null;
174
+ return {
175
+ kind: String(parsed.body.kind ?? ''),
176
+ phase: parsed.body.phase != null ? Number(parsed.body.phase) : null,
177
+ radiusNow: Number(parsed.body.radiusNow ?? 0),
178
+ centerX: Number(parsed.body.centerX ?? 0),
179
+ centerZ: Number(parsed.body.centerZ ?? 0),
180
+ body: parsed.body,
181
+ };
182
+ }
183
+ }
@@ -1,8 +1,14 @@
1
1
  import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { EngineDetector } from './engine.js';
2
3
  import type { Scalars } from '../generated/graphql.js';
3
4
  import { type KitInvokeResult } from './shared.js';
4
5
  /** Options for {@link LootKit}. Must match the deployed loot blueprint. */
5
6
  export interface LootKitOptions {
7
+ /**
8
+ * The big-table loot module (pity timers, audit trails). Defaults to
9
+ * `'loot-engine'`; the gacha-shrine example ships this contract.
10
+ */
11
+ engineModuleName?: string;
6
12
  /** The `typePrefix` the loot blueprint was deployed with. */
7
13
  typePrefix?: string;
8
14
  }
@@ -29,9 +35,24 @@ export interface KitLootRoll {
29
35
  export declare class LootKit {
30
36
  private readonly appId;
31
37
  private readonly gameModel;
38
+ private readonly engines?;
32
39
  private readonly names;
33
40
  private readonly typePrefix;
34
- constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: LootKitOptions);
41
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: LootKitOptions, engines?: EngineDetector | undefined);
42
+ private readonly engineModuleName;
43
+ /**
44
+ * Is a big-table loot module deployed + enabled (cached per session)?
45
+ * When true, {@link enginePull} routes rolls through server-held RNG with
46
+ * pity timers + audit trails; the blueprint's weighted model rolls stay
47
+ * for small tables (the coexistence policy — "the server picks the path").
48
+ */
49
+ engineAvailable(): Promise<boolean>;
50
+ /** Pull from the module's table (pity-timer path); count caps at 10. */
51
+ enginePull(count?: number): Promise<Record<string, unknown>>;
52
+ /** Your pity counters + roll totals from the module. */
53
+ enginePity(): Promise<Record<string, unknown>>;
54
+ /** Your rolling audit trail from the module (dispute resolution). */
55
+ engineAudit(): Promise<Record<string, unknown>>;
35
56
  /**
36
57
  * Create an unrolled `LootRoll` for a table, owned by `ownerUserId` (who
37
58
  * will claim it). Event-drop automations pick from the pool of unrolled
@@ -1 +1 @@
1
- {"version":3,"file":"loot.d.ts","sourceRoot":"","sources":["../../src/kit/loot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAEvD,OAAO,EAGL,KAAK,eAAe,EACrB,MAAM,aAAa,CAAC;AAErB,2EAA2E;AAC3E,MAAM,WAAW,cAAc;IAC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GAC1D,OAAO,CAAC,WAAW,EAAE,CAAC;IAwBzB;;;OAGG;IACG,OAAO,CACX,OAAO,GAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO;;;;;;;;;;;;;;;;;YAYtC,MAAM;CAoBrB"}
package/dist/kit/loot.js CHANGED
@@ -10,11 +10,51 @@ import { kitContainerProperties, kitInvoke, } from './shared.js';
10
10
  * Obtained via `client.kit(appId).loot`.
11
11
  */
12
12
  export class LootKit {
13
- constructor(appId, gameModel, options = {}) {
13
+ constructor(appId, gameModel, options = {}, engines) {
14
14
  this.appId = appId;
15
15
  this.gameModel = gameModel;
16
+ this.engines = engines;
16
17
  this.typePrefix = options.typePrefix ?? '';
17
18
  this.names = lootNames(this.typePrefix);
19
+ this.engineModuleName = options.engineModuleName ?? 'loot-engine';
20
+ }
21
+ /**
22
+ * Is a big-table loot module deployed + enabled (cached per session)?
23
+ * When true, {@link enginePull} routes rolls through server-held RNG with
24
+ * pity timers + audit trails; the blueprint's weighted model rolls stay
25
+ * for small tables (the coexistence policy — "the server picks the path").
26
+ */
27
+ engineAvailable() {
28
+ if (!this.engines)
29
+ return Promise.resolve(false);
30
+ return this.engines.has(this.engineModuleName);
31
+ }
32
+ /** Pull from the module's table (pity-timer path); count caps at 10. */
33
+ async enginePull(count = 1) {
34
+ if (!this.engines)
35
+ throw new Error('loot engine unavailable: compute domain not wired');
36
+ const result = await this.engines.invoke(this.engineModuleName, 'pull', { count });
37
+ if (!result.success)
38
+ throw new Error(`loot.pull failed: ${result.reason ?? 'unknown'}`);
39
+ return result.body;
40
+ }
41
+ /** Your pity counters + roll totals from the module. */
42
+ async enginePity() {
43
+ if (!this.engines)
44
+ throw new Error('loot engine unavailable: compute domain not wired');
45
+ const result = await this.engines.invoke(this.engineModuleName, 'pity', {});
46
+ if (!result.success)
47
+ throw new Error(`loot.pity failed: ${result.reason ?? 'unknown'}`);
48
+ return result.body;
49
+ }
50
+ /** Your rolling audit trail from the module (dispute resolution). */
51
+ async engineAudit() {
52
+ if (!this.engines)
53
+ throw new Error('loot engine unavailable: compute domain not wired');
54
+ const result = await this.engines.invoke(this.engineModuleName, 'audit', {});
55
+ if (!result.success)
56
+ throw new Error(`loot.audit failed: ${result.reason ?? 'unknown'}`);
57
+ return result.body;
18
58
  }
19
59
  /**
20
60
  * Create an unrolled `LootRoll` for a table, owned by `ownerUserId` (who
@@ -0,0 +1,73 @@
1
+ import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { Scalars } from '../generated/graphql.js';
3
+ /** Options for {@link ModerationKit}. */
4
+ export interface ModerationKitOptions {
5
+ /** The `typePrefix` the moderation blueprint was deployed with. */
6
+ typePrefix?: string;
7
+ }
8
+ /** A parsed report row. */
9
+ export interface KitModReport {
10
+ containerId: string;
11
+ reporterUserId: string;
12
+ subjectUserId: string;
13
+ reason: string;
14
+ detail: string;
15
+ status: string;
16
+ resolution: string;
17
+ filedAtMs: number;
18
+ }
19
+ /**
20
+ * Runtime helpers for the moderation blueprint: file reports, read the
21
+ * admin escalation queue, resolve reports, and manage the caller's personal
22
+ * mute list (client-enforced chat filtering). Enforcement stays on platform
23
+ * surfaces — tier revocation and grid permissions.
24
+ *
25
+ * Obtained via `client.kit(appId).moderation`.
26
+ */
27
+ export declare class ModerationKit {
28
+ private readonly appId;
29
+ private readonly gameModel;
30
+ private readonly names;
31
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: ModerationKitOptions);
32
+ /** File a report (creates the caller's report row in the queue). */
33
+ report(input: {
34
+ reporterUserId: string;
35
+ subjectUserId: string;
36
+ reason: string;
37
+ detail?: string;
38
+ }): Promise<{
39
+ __typename?: "GmContainer";
40
+ containerId: string;
41
+ appId: string;
42
+ sessionId: string | null;
43
+ typeName: string;
44
+ displayName: string;
45
+ description: string | null;
46
+ ownerUserId: string | null;
47
+ metadataJson: string;
48
+ }>;
49
+ /** The escalation queue (admins; filter by status, default `'open'`). */
50
+ queue(status?: string): Promise<KitModReport[]>;
51
+ /** ADMIN — resolve a report with a disposition. */
52
+ resolve(reportContainerId: string, status: 'actioned' | 'dismissed', resolution: string): Promise<import("./shared.js").KitInvokeResult<string>>;
53
+ /** Mute a player (adds to YOUR client-enforced mute list). */
54
+ mute(ownerUserId: string, mutedUserId: string): Promise<{
55
+ __typename?: "GmContainer";
56
+ containerId: string;
57
+ appId: string;
58
+ sessionId: string | null;
59
+ typeName: string;
60
+ displayName: string;
61
+ description: string | null;
62
+ ownerUserId: string | null;
63
+ metadataJson: string;
64
+ }>;
65
+ /** Unmute: delete the matching mute row. */
66
+ unmute(ownerUserId: string, mutedUserId: string): Promise<boolean>;
67
+ /** The caller's mute list (feed it to your chat renderer). */
68
+ mutes(ownerUserId: string): Promise<Array<{
69
+ containerId: string;
70
+ mutedUserId: string;
71
+ }>>;
72
+ }
73
+ //# sourceMappingURL=moderation.d.ts.map