@crowdedkingdoms/crowdyjs 8.7.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 (83) hide show
  1. package/MIGRATION.md +85 -0
  2. package/README.md +2 -2
  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/decks.d.ts +33 -1
  25. package/dist/kit/decks.d.ts.map +1 -1
  26. package/dist/kit/decks.js +49 -1
  27. package/dist/kit/director.d.ts +88 -0
  28. package/dist/kit/director.d.ts.map +1 -0
  29. package/dist/kit/director.js +86 -0
  30. package/dist/kit/economy.d.ts +46 -1
  31. package/dist/kit/economy.d.ts.map +1 -1
  32. package/dist/kit/economy.js +63 -1
  33. package/dist/kit/index.d.ts +14 -3
  34. package/dist/kit/index.d.ts.map +1 -1
  35. package/dist/kit/index.js +14 -3
  36. package/dist/kit/instances.d.ts +52 -0
  37. package/dist/kit/instances.d.ts.map +1 -0
  38. package/dist/kit/instances.js +60 -0
  39. package/dist/kit/kit.d.ts +60 -0
  40. package/dist/kit/kit.d.ts.map +1 -1
  41. package/dist/kit/kit.js +47 -5
  42. package/dist/kit/leaderboards.d.ts +21 -1
  43. package/dist/kit/leaderboards.d.ts.map +1 -1
  44. package/dist/kit/leaderboards.js +40 -1
  45. package/dist/kit/liveops.d.ts +112 -0
  46. package/dist/kit/liveops.d.ts.map +1 -0
  47. package/dist/kit/liveops.js +183 -0
  48. package/dist/kit/loot.d.ts +22 -1
  49. package/dist/kit/loot.d.ts.map +1 -1
  50. package/dist/kit/loot.js +41 -1
  51. package/dist/kit/matches.d.ts +33 -1
  52. package/dist/kit/matches.d.ts.map +1 -1
  53. package/dist/kit/matches.js +56 -1
  54. package/dist/kit/matchmaking.d.ts +57 -0
  55. package/dist/kit/matchmaking.d.ts.map +1 -0
  56. package/dist/kit/matchmaking.js +59 -0
  57. package/dist/kit/minigames.d.ts +30 -0
  58. package/dist/kit/minigames.d.ts.map +1 -0
  59. package/dist/kit/minigames.js +38 -0
  60. package/dist/kit/moderation.d.ts +73 -0
  61. package/dist/kit/moderation.d.ts.map +1 -0
  62. package/dist/kit/moderation.js +103 -0
  63. package/dist/kit/movement.d.ts +78 -0
  64. package/dist/kit/movement.d.ts.map +1 -0
  65. package/dist/kit/movement.js +103 -0
  66. package/dist/kit/npcs.d.ts.map +1 -1
  67. package/dist/kit/quests.d.ts +57 -0
  68. package/dist/kit/quests.d.ts.map +1 -1
  69. package/dist/kit/quests.js +72 -0
  70. package/dist/kit/racing.d.ts +85 -0
  71. package/dist/kit/racing.d.ts.map +1 -0
  72. package/dist/kit/racing.js +99 -0
  73. package/dist/kit/social.d.ts.map +1 -1
  74. package/dist/kit/telemetry.d.ts +66 -0
  75. package/dist/kit/telemetry.d.ts.map +1 -0
  76. package/dist/kit/telemetry.js +133 -0
  77. package/dist/kit/territory.d.ts +97 -0
  78. package/dist/kit/territory.d.ts.map +1 -0
  79. package/dist/kit/territory.js +114 -0
  80. package/dist/kit/wire.d.ts +88 -0
  81. package/dist/kit/wire.d.ts.map +1 -1
  82. package/dist/kit/wire.js +110 -0
  83. package/package.json +1 -1
@@ -106,6 +106,78 @@ export class QuestsKit {
106
106
  const mine = containers.filter((c) => c.ownerUserId != null && String(c.ownerUserId) === String(ownerUserId));
107
107
  return Promise.all(mine.map((c) => this.state(c.containerId)));
108
108
  }
109
+ // -- FTUE / tutorial step sequencing (Wave 2) -----------------------------
110
+ /**
111
+ * STUDIO (admin) — define an ordered tutorial chain as quest defs. Steps
112
+ * are plain quests whose `questId` encodes the chain + index
113
+ * (`"<chain>:<i>"`), so no new server surface is involved: the sequencing
114
+ * is a read-side convention enforced by {@link tutorial} /
115
+ * {@link acceptNextTutorialStep} (a step is `locked` until every earlier
116
+ * step completes).
117
+ */
118
+ async defineTutorial(input) {
119
+ const chain = input.chain ?? 'ftue';
120
+ const created = [];
121
+ for (const [index, step] of input.steps.entries()) {
122
+ created.push(await this.defineQuest({
123
+ questId: `${chain}:${index}`,
124
+ displayName: step.displayName,
125
+ targetCount: step.targetCount ?? 1,
126
+ rewardItemId: step.rewardItemId,
127
+ rewardQty: step.rewardQty,
128
+ rewardGold: step.rewardGold,
129
+ }));
130
+ }
131
+ return created;
132
+ }
133
+ /** One tutorial step joined with the player's progress. */
134
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars -- documented shape
135
+ /**
136
+ * A player's view of a tutorial chain: steps in order, each `locked`
137
+ * (an earlier step is incomplete), `active` (the first incomplete step),
138
+ * or `complete`. The client shows/drives only the `active` step; the
139
+ * trusted advance authority is unchanged (players still cannot complete
140
+ * their own quests).
141
+ */
142
+ async tutorial(ownerUserId, chain = 'ftue') {
143
+ const prefix = `${chain}:`;
144
+ const defs = (await this.catalog())
145
+ .filter((def) => def.questId.startsWith(prefix))
146
+ .map((def) => ({ def, stepIndex: Number(def.questId.slice(prefix.length)) }))
147
+ .filter(({ stepIndex }) => Number.isFinite(stepIndex))
148
+ .sort((a, b) => a.stepIndex - b.stepIndex);
149
+ const progressRows = await this.mine(ownerUserId);
150
+ let blocked = false;
151
+ return defs.map(({ def, stepIndex }) => {
152
+ const progress = progressRows.find((p) => p.questId === def.questId) ?? null;
153
+ const complete = progress?.completed === true;
154
+ const status = complete
155
+ ? 'complete'
156
+ : blocked
157
+ ? 'locked'
158
+ : 'active';
159
+ if (!complete)
160
+ blocked = true;
161
+ return { stepIndex, def, progress, status };
162
+ });
163
+ }
164
+ /**
165
+ * Ensure the player's ACTIVE tutorial step has a progress row (accepting
166
+ * it when missing) and return the step. Returns null when the chain is
167
+ * complete. Calling this for a locked step is impossible by construction —
168
+ * it always targets the first incomplete step.
169
+ */
170
+ async acceptNextTutorialStep(ownerUserId, chain = 'ftue', options = {}) {
171
+ const steps = await this.tutorial(ownerUserId, chain);
172
+ const active = steps.find((step) => step.status === 'active');
173
+ if (!active)
174
+ return null;
175
+ if (active.progress)
176
+ return active;
177
+ await this.accept(ownerUserId, active.def.containerId, options);
178
+ const refreshed = await this.tutorial(ownerUserId, chain);
179
+ return refreshed.find((step) => step.stepIndex === active.stepIndex) ?? null;
180
+ }
109
181
  /** Read one progress row. */
110
182
  async state(progressId) {
111
183
  const container = await this.gameModel.container({
@@ -0,0 +1,85 @@
1
+ import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { Scalars } from '../generated/graphql.js';
3
+ import type { EngineDetector } from './engine.js';
4
+ import { type RaceTimingEvent } from './wire.js';
5
+ /** Options for {@link RacingKit}. */
6
+ export interface RacingKitOptions {
7
+ /** The racing engine module name. Defaults to `'racing'`. */
8
+ moduleName?: string;
9
+ /** The possession (ball) engine module name. Defaults to `'possession'`. */
10
+ possessionModuleName?: string;
11
+ /** The course container type. Defaults to `'Course'`. */
12
+ courseTypeName?: string;
13
+ }
14
+ /** Your live run as the engine reports it. */
15
+ export interface KitRaceRun {
16
+ courseId: string;
17
+ started: boolean;
18
+ lap: number;
19
+ nextGate: number;
20
+ splitsMs: number[];
21
+ bestLapMs: number;
22
+ finished: boolean;
23
+ totalMs: number;
24
+ }
25
+ /**
26
+ * Runtime helpers for the racing engine (Wave 3, G16) and its possession
27
+ * sub-template (G17 sports-lite): server-timed gates/laps from the pose
28
+ * stream (type-97 events), course records with ghost replays on the actor
29
+ * lane (suffix `ghost:<courseId>`, FLAG_RESERVED3), and the authoritative
30
+ * ball (claim/steal/pass/shoot; lane suffix `ball`).
31
+ *
32
+ * Obtained via `client.kit(appId).racing`.
33
+ */
34
+ export declare class RacingKit {
35
+ private readonly appId;
36
+ private readonly gameModel;
37
+ private readonly engines;
38
+ private readonly moduleName;
39
+ private readonly possessionModuleName;
40
+ private readonly courseTypeName;
41
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, engines: EngineDetector, options?: RacingKitOptions);
42
+ /** Is the racing engine deployed + enabled (cached per session)? */
43
+ engineAvailable(): Promise<boolean>;
44
+ /** Is the possession (ball) engine deployed + enabled? */
45
+ possessionAvailable(): Promise<boolean>;
46
+ /** STUDIO (admin) — create a course (`gates` = [[x, z, radius], ...]). */
47
+ defineCourse(input: {
48
+ courseId: string;
49
+ gates: Array<[number, number, number]>;
50
+ laps?: number;
51
+ displayName?: string;
52
+ }): Promise<{
53
+ __typename?: "GmContainer";
54
+ containerId: string;
55
+ appId: string;
56
+ sessionId: string | null;
57
+ typeName: string;
58
+ displayName: string;
59
+ description: string | null;
60
+ ownerUserId: string | null;
61
+ metadataJson: string;
62
+ }>;
63
+ /** Enter a course: your next pose through gate 0 starts the clock. */
64
+ enter(courseId: string): Promise<Record<string, unknown>>;
65
+ /** Your live run (splits, lap, next gate). */
66
+ raceStatus(): Promise<KitRaceRun>;
67
+ /** The course record (holder, time, ghost length). */
68
+ best(courseId: string): Promise<Record<string, unknown>>;
69
+ /** Replay the course-record ghost onto the actor lane. */
70
+ ghostPlay(courseId: string): Promise<Record<string, unknown>>;
71
+ /** Parse a type-97 race-timing server event. */
72
+ parseRaceTiming(bytes: Uint8Array): RaceTimingEvent | null;
73
+ /** Join the ball match (teams fill by join order). */
74
+ joinMatch(): Promise<Record<string, unknown>>;
75
+ /** Claim the free ball (or steal after the protection window). */
76
+ claim(): Promise<Record<string, unknown>>;
77
+ /** Pass along a direction (holder only). */
78
+ pass(dirX: number, dirZ: number): Promise<Record<string, unknown>>;
79
+ /** Shoot at the opposing goal (holder only; the server aims). */
80
+ shoot(): Promise<Record<string, unknown>>;
81
+ /** The live ball match (teams, ball, standings, summary). */
82
+ matchState(): Promise<Record<string, unknown>>;
83
+ private invoke;
84
+ }
85
+ //# sourceMappingURL=racing.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"racing.d.ts","sourceRoot":"","sources":["../../src/kit/racing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAwB,KAAK,eAAe,EAAE,MAAM,WAAW,CAAC;AAEvE,qCAAqC;AACrC,MAAM,WAAW,gBAAgB;IAC/B,6DAA6D;IAC7D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,4EAA4E;IAC5E,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAC9B,yDAAyD;IACzD,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,8CAA8C;AAC9C,MAAM,WAAW,UAAU;IACzB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED;;;;;;;;GAQG;AACH,qBAAa,SAAS;IAMlB,OAAO,CAAC,QAAQ,CAA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 +1,99 @@
1
+ import { parseRaceTimingEvent } from './wire.js';
2
+ /**
3
+ * Runtime helpers for the racing engine (Wave 3, G16) and its possession
4
+ * sub-template (G17 sports-lite): server-timed gates/laps from the pose
5
+ * stream (type-97 events), course records with ghost replays on the actor
6
+ * lane (suffix `ghost:<courseId>`, FLAG_RESERVED3), and the authoritative
7
+ * ball (claim/steal/pass/shoot; lane suffix `ball`).
8
+ *
9
+ * Obtained via `client.kit(appId).racing`.
10
+ */
11
+ export class RacingKit {
12
+ constructor(appId, gameModel, engines, options = {}) {
13
+ this.appId = appId;
14
+ this.gameModel = gameModel;
15
+ this.engines = engines;
16
+ this.moduleName = options.moduleName ?? 'racing';
17
+ this.possessionModuleName = options.possessionModuleName ?? 'possession';
18
+ this.courseTypeName = options.courseTypeName ?? 'Course';
19
+ }
20
+ /** Is the racing engine deployed + enabled (cached per session)? */
21
+ engineAvailable() {
22
+ return this.engines.has(this.moduleName);
23
+ }
24
+ /** Is the possession (ball) engine deployed + enabled? */
25
+ possessionAvailable() {
26
+ return this.engines.has(this.possessionModuleName);
27
+ }
28
+ /** STUDIO (admin) — create a course (`gates` = [[x, z, radius], ...]). */
29
+ async defineCourse(input) {
30
+ return this.gameModel.createContainer({
31
+ appId: this.appId,
32
+ typeName: this.courseTypeName,
33
+ displayName: input.displayName ?? `course-${input.courseId}`,
34
+ properties: [
35
+ { key: 'course_id', valueType: 'string', valueJson: JSON.stringify(input.courseId) },
36
+ { key: 'gates', valueType: 'string', valueJson: JSON.stringify(JSON.stringify(input.gates)) },
37
+ { key: 'laps', valueType: 'int', valueJson: String(input.laps ?? 1) },
38
+ ],
39
+ });
40
+ }
41
+ /** Enter a course: your next pose through gate 0 starts the clock. */
42
+ async enter(courseId) {
43
+ return this.invoke(this.moduleName, 'enter', { courseId });
44
+ }
45
+ /** Your live run (splits, lap, next gate). */
46
+ async raceStatus() {
47
+ const body = await this.invoke(this.moduleName, 'race_status', {});
48
+ return {
49
+ courseId: String(body.courseId ?? ''),
50
+ started: body.started === true,
51
+ lap: Number(body.lap ?? 0),
52
+ nextGate: Number(body.nextGate ?? 0),
53
+ splitsMs: Array.isArray(body.splitsMs) ? body.splitsMs.map(Number) : [],
54
+ bestLapMs: Number(body.bestLapMs ?? 0),
55
+ finished: body.finished === true,
56
+ totalMs: Number(body.totalMs ?? 0),
57
+ };
58
+ }
59
+ /** The course record (holder, time, ghost length). */
60
+ async best(courseId) {
61
+ return this.invoke(this.moduleName, 'best', { courseId });
62
+ }
63
+ /** Replay the course-record ghost onto the actor lane. */
64
+ async ghostPlay(courseId) {
65
+ return this.invoke(this.moduleName, 'ghost_play', { courseId });
66
+ }
67
+ /** Parse a type-97 race-timing server event. */
68
+ parseRaceTiming(bytes) {
69
+ return parseRaceTimingEvent(bytes);
70
+ }
71
+ // -- possession (sports-lite ball) ----------------------------------------
72
+ /** Join the ball match (teams fill by join order). */
73
+ async joinMatch() {
74
+ return this.invoke(this.possessionModuleName, 'join_match', {});
75
+ }
76
+ /** Claim the free ball (or steal after the protection window). */
77
+ async claim() {
78
+ return this.invoke(this.possessionModuleName, 'claim', {});
79
+ }
80
+ /** Pass along a direction (holder only). */
81
+ async pass(dirX, dirZ) {
82
+ return this.invoke(this.possessionModuleName, 'pass', { dirX, dirZ });
83
+ }
84
+ /** Shoot at the opposing goal (holder only; the server aims). */
85
+ async shoot() {
86
+ return this.invoke(this.possessionModuleName, 'shoot', {});
87
+ }
88
+ /** The live ball match (teams, ball, standings, summary). */
89
+ async matchState() {
90
+ return this.invoke(this.possessionModuleName, 'match_state', {});
91
+ }
92
+ async invoke(moduleName, exportName, params) {
93
+ const result = await this.engines.invoke(moduleName, exportName, params);
94
+ if (!result.success) {
95
+ throw new Error(`racing.${exportName} failed: ${result.reason ?? 'unknown'}`);
96
+ }
97
+ return result.body;
98
+ }
99
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/kit/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EA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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;;;;;;;;0BAmDqp9a,CAAC;;;;;;;;QA/Cxs9a;;;;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"}
@@ -0,0 +1,66 @@
1
+ import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { Scalars } from '../generated/graphql.js';
3
+ /** Options for {@link TelemetryKit}. */
4
+ export interface TelemetryKitOptions {
5
+ /** The counter container type name. Defaults to `'TelemetryCounter'`. */
6
+ counterTypeName?: string;
7
+ /**
8
+ * Sample rate for `track()` in [0, 1] — the client-side budget knob.
9
+ * Defaults to 1 (every event).
10
+ */
11
+ sampleRate?: number;
12
+ }
13
+ /**
14
+ * Game analytics events (matrix P7) — MODEL-THIN by design: `track()`
15
+ * writes a naming-convention row into the existing model event log via a
16
+ * fire-and-forget container property bump, and sampled counters live in
17
+ * ordinary `TelemetryCounter` containers (`event_name` + `count`). Export
18
+ * and BI are platform concerns, deliberately out of scope; the convention
19
+ * is the abstraction.
20
+ *
21
+ * Naming convention: `<area>.<action>` (e.g. `ftue.step_completed`,
22
+ * `shop.purchase`). Keep cardinality low — counters are containers.
23
+ *
24
+ * Obtained via `client.kit(appId).telemetry`.
25
+ */
26
+ export declare class TelemetryKit {
27
+ private readonly appId;
28
+ private readonly gameModel;
29
+ private readonly counterTypeName;
30
+ private readonly sampleRate;
31
+ /** event name -> counter container id (cached per session). */
32
+ private readonly counterIds;
33
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: TelemetryKitOptions);
34
+ /**
35
+ * Track one event — fire-and-forget (never throws, never blocks
36
+ * gameplay): bumps the event's sampled counter. `props` ride the
37
+ * container's last-props snapshot for spot-debugging (NOT a warehouse).
38
+ */
39
+ track(name: string, props?: Record<string, unknown>): void;
40
+ /** The awaitable form of {@link track} for tests/backfills. */
41
+ bump(name: string, props?: Record<string, unknown>): Promise<void>;
42
+ /** Read the sampled counters (dashboards, tests). */
43
+ counters(): Promise<Array<{
44
+ eventName: string;
45
+ count: number;
46
+ lastProps: string;
47
+ }>>;
48
+ private ensureCounter;
49
+ }
50
+ /** The telemetry blueprint: one counter type; the convention is the point. */
51
+ export declare function telemetryBlueprint(counterTypeName?: string): {
52
+ name: string;
53
+ containerTypes: {
54
+ typeName: string;
55
+ displayName: string;
56
+ description: string;
57
+ }[];
58
+ propertyDefinitions: {
59
+ containerTypeName: string;
60
+ key: string;
61
+ valueType: string;
62
+ defaultValueJson: string;
63
+ description: string;
64
+ }[];
65
+ };
66
+ //# sourceMappingURL=telemetry.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"telemetry.d.ts","sourceRoot":"","sources":["../../src/kit/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAGvD,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,yEAAyE;IACzE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB;;;OAGG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;;;;;;GAYG;AACH,qBAAa,YAAY;IAOrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAP5B,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAS;IACzC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAS;IACpC,+DAA+D;IAC/D,OAAO,CAAC,QAAQ,CAAC,UAAU,CAA6B;gBAGrC,KAAK,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,EACjC,SAAS,EAAE,YAAY,EACxC,OAAO,GAAE,mBAAwB;IAMnC;;;;OAIG;IACH,KAAK,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,IAAI;IAK9D,+DAA+D;IACzD,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAqB5E,qDAAqD;IAC/C,QAAQ,IAAI,OAAO,CAAC,KAAK,CAAC;QAAE,SAAS,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;YAiB3E,aAAa;CA0B5B;AAED,8EAA8E;AAC9E,wBAAgB,kBAAkB,CAAC,eAAe,SAAqB;;;;;;;;;;;;;;EAmCtE"}
@@ -0,0 +1,133 @@
1
+ import { kitContainerProperties } from './shared.js';
2
+ /**
3
+ * Game analytics events (matrix P7) — MODEL-THIN by design: `track()`
4
+ * writes a naming-convention row into the existing model event log via a
5
+ * fire-and-forget container property bump, and sampled counters live in
6
+ * ordinary `TelemetryCounter` containers (`event_name` + `count`). Export
7
+ * and BI are platform concerns, deliberately out of scope; the convention
8
+ * is the abstraction.
9
+ *
10
+ * Naming convention: `<area>.<action>` (e.g. `ftue.step_completed`,
11
+ * `shop.purchase`). Keep cardinality low — counters are containers.
12
+ *
13
+ * Obtained via `client.kit(appId).telemetry`.
14
+ */
15
+ export class TelemetryKit {
16
+ constructor(appId, gameModel, options = {}) {
17
+ this.appId = appId;
18
+ this.gameModel = gameModel;
19
+ /** event name -> counter container id (cached per session). */
20
+ this.counterIds = new Map();
21
+ this.counterTypeName = options.counterTypeName ?? 'TelemetryCounter';
22
+ this.sampleRate = options.sampleRate ?? 1;
23
+ }
24
+ /**
25
+ * Track one event — fire-and-forget (never throws, never blocks
26
+ * gameplay): bumps the event's sampled counter. `props` ride the
27
+ * container's last-props snapshot for spot-debugging (NOT a warehouse).
28
+ */
29
+ track(name, props = {}) {
30
+ if (Math.random() > this.sampleRate)
31
+ return;
32
+ void this.bump(name, props).catch(() => undefined);
33
+ }
34
+ /** The awaitable form of {@link track} for tests/backfills. */
35
+ async bump(name, props = {}) {
36
+ const containerId = await this.ensureCounter(name);
37
+ const current = await kitContainerProperties(this.gameModel, String(this.appId), containerId);
38
+ await this.gameModel.setProperty({
39
+ appId: this.appId,
40
+ containerId,
41
+ key: 'count',
42
+ valueType: 'int',
43
+ valueJson: String(Number(current.count ?? 0) + 1),
44
+ });
45
+ if (Object.keys(props).length > 0) {
46
+ await this.gameModel.setProperty({
47
+ appId: this.appId,
48
+ containerId,
49
+ key: 'last_props',
50
+ valueType: 'string',
51
+ valueJson: JSON.stringify(JSON.stringify(props).slice(0, 500)),
52
+ });
53
+ }
54
+ }
55
+ /** Read the sampled counters (dashboards, tests). */
56
+ async counters() {
57
+ const containers = await this.gameModel.containers({
58
+ appId: this.appId,
59
+ typeName: this.counterTypeName,
60
+ });
61
+ return Promise.all(containers.map(async (c) => {
62
+ const props = await kitContainerProperties(this.gameModel, String(this.appId), c.containerId);
63
+ return {
64
+ eventName: String(props.event_name ?? ''),
65
+ count: Number(props.count ?? 0),
66
+ lastProps: String(props.last_props ?? ''),
67
+ };
68
+ }));
69
+ }
70
+ async ensureCounter(name) {
71
+ const cached = this.counterIds.get(name);
72
+ if (cached)
73
+ return cached;
74
+ const containers = await this.gameModel.containers({
75
+ appId: this.appId,
76
+ typeName: this.counterTypeName,
77
+ });
78
+ for (const c of containers) {
79
+ const props = await kitContainerProperties(this.gameModel, String(this.appId), c.containerId);
80
+ if (String(props.event_name ?? '') === name) {
81
+ this.counterIds.set(name, c.containerId);
82
+ return c.containerId;
83
+ }
84
+ }
85
+ const created = await this.gameModel.createContainer({
86
+ appId: this.appId,
87
+ typeName: this.counterTypeName,
88
+ displayName: `telemetry ${name}`,
89
+ properties: [
90
+ { key: 'event_name', valueType: 'string', valueJson: JSON.stringify(name) },
91
+ { key: 'count', valueType: 'int', valueJson: '0' },
92
+ ],
93
+ });
94
+ this.counterIds.set(name, created.containerId);
95
+ return created.containerId;
96
+ }
97
+ }
98
+ /** The telemetry blueprint: one counter type; the convention is the point. */
99
+ export function telemetryBlueprint(counterTypeName = 'TelemetryCounter') {
100
+ return {
101
+ name: 'telemetry',
102
+ containerTypes: [
103
+ {
104
+ typeName: counterTypeName,
105
+ displayName: 'Telemetry counter',
106
+ description: "One sampled event counter (event_name + count + last_props). Naming convention: '<area>.<action>'.",
107
+ },
108
+ ],
109
+ propertyDefinitions: [
110
+ {
111
+ containerTypeName: counterTypeName,
112
+ key: 'event_name',
113
+ valueType: 'string',
114
+ defaultValueJson: '""',
115
+ description: "The tracked event's convention name ('<area>.<action>').",
116
+ },
117
+ {
118
+ containerTypeName: counterTypeName,
119
+ key: 'count',
120
+ valueType: 'int',
121
+ defaultValueJson: '0',
122
+ description: 'Sampled occurrence count.',
123
+ },
124
+ {
125
+ containerTypeName: counterTypeName,
126
+ key: 'last_props',
127
+ valueType: 'string',
128
+ defaultValueJson: '""',
129
+ description: 'The last tracked props JSON (spot-debugging, not a warehouse).',
130
+ },
131
+ ],
132
+ };
133
+ }
@@ -0,0 +1,97 @@
1
+ import type { GameModelAPI } from '../domains/gameModel.js';
2
+ import type { Scalars } from '../generated/graphql.js';
3
+ import type { EngineDetector } from './engine.js';
4
+ import { type ControlPointEvent } from './wire.js';
5
+ /** Options for {@link TerritoryKit}. */
6
+ export interface TerritoryKitOptions {
7
+ /** The territory engine module name. Defaults to `'territory'`. */
8
+ moduleName?: string;
9
+ }
10
+ /** A control point as the engine reports it. */
11
+ export interface KitControlPoint {
12
+ pointId: string;
13
+ x: number;
14
+ z: number;
15
+ radius: number;
16
+ owner: string;
17
+ challenger: string;
18
+ progress: number;
19
+ incomePerMin: number;
20
+ siegeOpen: boolean;
21
+ }
22
+ /**
23
+ * Runtime helpers for the territory engine (Wave 3): control-point state,
24
+ * faction standings, and the admin CRUD for the map (factions, members,
25
+ * points). Capture itself is pure presence — stand inside a point's radius
26
+ * with your faction; the engine does the rest and announces flips as
27
+ * type-96 events.
28
+ *
29
+ * Obtained via `client.kit(appId).territory`.
30
+ */
31
+ export declare class TerritoryKit {
32
+ private readonly appId;
33
+ private readonly gameModel;
34
+ private readonly engines;
35
+ private readonly moduleName;
36
+ constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, engines: EngineDetector, options?: TerritoryKitOptions);
37
+ /** Is the territory engine deployed + enabled (cached per session)? */
38
+ engineAvailable(): Promise<boolean>;
39
+ /** Every control point with live capture state. */
40
+ points(): Promise<KitControlPoint[]>;
41
+ /** Faction standings (id + treasury). */
42
+ factions(): Promise<Array<{
43
+ factionId: string;
44
+ gold: number;
45
+ }>>;
46
+ /** Engine totals (flips, income paid). */
47
+ status(): Promise<Record<string, unknown>>;
48
+ /** STUDIO (admin) — create a faction. */
49
+ defineFaction(factionId: string, displayName?: string): Promise<{
50
+ __typename?: "GmContainer";
51
+ containerId: string;
52
+ appId: string;
53
+ sessionId: string | null;
54
+ typeName: string;
55
+ displayName: string;
56
+ description: string | null;
57
+ ownerUserId: string | null;
58
+ metadataJson: string;
59
+ }>;
60
+ /** STUDIO (admin) — enroll a player in a faction. */
61
+ enroll(userId: string, factionId: string): Promise<{
62
+ __typename?: "GmContainer";
63
+ containerId: string;
64
+ appId: string;
65
+ sessionId: string | null;
66
+ typeName: string;
67
+ displayName: string;
68
+ description: string | null;
69
+ ownerUserId: string | null;
70
+ metadataJson: string;
71
+ }>;
72
+ /** STUDIO (admin) — create a control point. */
73
+ definePoint(input: {
74
+ pointId: string;
75
+ x: number;
76
+ z: number;
77
+ radius: number;
78
+ incomePerMin?: number;
79
+ siegeFromMin?: number;
80
+ siegeToMin?: number;
81
+ displayName?: string;
82
+ }): Promise<{
83
+ __typename?: "GmContainer";
84
+ containerId: string;
85
+ appId: string;
86
+ sessionId: string | null;
87
+ typeName: string;
88
+ displayName: string;
89
+ description: string | null;
90
+ ownerUserId: string | null;
91
+ metadataJson: string;
92
+ }>;
93
+ /** Parse a type-96 control-point server event (flips). */
94
+ parseControlPoint(bytes: Uint8Array): ControlPointEvent | null;
95
+ private invoke;
96
+ }
97
+ //# sourceMappingURL=territory.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"territory.d.ts","sourceRoot":"","sources":["../../src/kit/territory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AACvD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAA0B,KAAK,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAE3E,wCAAwC;AACxC,MAAM,WAAW,mBAAmB;IAClC,mEAAmE;IACnE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,gDAAgD;AAChD,MAAM,WAAW,eAAe;IAC9B,OAAO,EAAE,MAAM,CAAC;IAChB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,CAAC;IACV,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;;;GAQG;AACH,qBAAa,YAAY;IAIr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