@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
@@ -0,0 +1,42 @@
1
+ import { type KitBlueprint, type KitTrustedAuthority } from './core.js';
2
+ /** Options for {@link liveopsBlueprint}. */
3
+ export interface LiveopsBlueprintOptions {
4
+ /** Prefix for the type/function names. Defaults to none. */
5
+ typePrefix?: string;
6
+ /**
7
+ * Who may open/close windows and roll seasons: `'server'` (app admins /
8
+ * studio backend; default) or `'automation'` (cron-driven flips).
9
+ */
10
+ adminAuthority?: KitTrustedAuthority;
11
+ }
12
+ /** Names derived by {@link liveopsBlueprint} for a given prefix. */
13
+ export interface LiveopsNames {
14
+ windowType: string;
15
+ seasonType: string;
16
+ openWindowFn: string;
17
+ closeWindowFn: string;
18
+ activateSeasonFn: string;
19
+ }
20
+ /** Compute the type/function names a liveops blueprint (and its runtime helper) uses. */
21
+ export declare function liveopsNames(typePrefix?: string): LiveopsNames;
22
+ /**
23
+ * Blueprint for **liveops** (matrix P4, P3): event windows, seasons, and
24
+ * battle-pass composition — MODEL-FIRST (the coexistence policy):
25
+ *
26
+ * - `EventWindow` containers carry a `window_id`, an `active` flag, optional
27
+ * `opens_at_ms`/`closes_at_ms` timestamps, and an opaque `modifiers` JSON
28
+ * blob. Admin (or cron-automation) functions flip `active`; when both
29
+ * timestamps are set, the **liveops-scheduler compute engine** flips the
30
+ * flag itself and broadcasts the modifiers on the compute bus
31
+ * (`liveops_window_opened`/`closed`) for other engines to apply — spawn
32
+ * multipliers, weather locks, double gold.
33
+ * - `SeasonDef` containers name a season (`season_id`, `active`,
34
+ * `starts_at_ms`/`ends_at_ms`) and its battle-pass composition: the
35
+ * `pass_track` is a progression-layer track name and `pass_features` a
36
+ * JSON array of feature gates unlocked per tier — a battle pass is a
37
+ * SEASON + PROGRESSION TRACK + FEATURE GATES, no new machinery.
38
+ *
39
+ * Runtime counterpart: `client.kit(appId).liveops`.
40
+ */
41
+ export declare function liveopsBlueprint(options?: LiveopsBlueprintOptions): KitBlueprint;
42
+ //# sourceMappingURL=liveops.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"liveops.d.ts","sourceRoot":"","sources":["../../../src/kit/blueprints/liveops.ts"],"names":[],"mappings":"AACA,OAAO,EAIL,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACzB,MAAM,WAAW,CAAC;AAEnB,4CAA4C;AAC5C,MAAM,WAAW,uBAAuB;IACtC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB;;;OAGG;IACH,cAAc,CAAC,EAAE,mBAAmB,CAAC;CACtC;AAED,oEAAoE;AACpE,MAAM,WAAW,YAAY;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,yFAAyF;AACzF,wBAAgB,YAAY,CAAC,UAAU,SAAK,GAAG,YAAY,CAS1D;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,GAAE,uBAA4B,GAAG,YAAY,CAqJpF"}
@@ -0,0 +1,170 @@
1
+ import { kitPolicyJson, toSnakeCase, trustedAuthorityFields, } from './core.js';
2
+ /** Compute the type/function names a liveops blueprint (and its runtime helper) uses. */
3
+ export function liveopsNames(typePrefix = '') {
4
+ const fnPrefix = typePrefix ? `${toSnakeCase(typePrefix)}_` : '';
5
+ return {
6
+ windowType: `${typePrefix}EventWindow`,
7
+ seasonType: `${typePrefix}SeasonDef`,
8
+ openWindowFn: `${fnPrefix}open_window`,
9
+ closeWindowFn: `${fnPrefix}close_window`,
10
+ activateSeasonFn: `${fnPrefix}activate_season`,
11
+ };
12
+ }
13
+ /**
14
+ * Blueprint for **liveops** (matrix P4, P3): event windows, seasons, and
15
+ * battle-pass composition — MODEL-FIRST (the coexistence policy):
16
+ *
17
+ * - `EventWindow` containers carry a `window_id`, an `active` flag, optional
18
+ * `opens_at_ms`/`closes_at_ms` timestamps, and an opaque `modifiers` JSON
19
+ * blob. Admin (or cron-automation) functions flip `active`; when both
20
+ * timestamps are set, the **liveops-scheduler compute engine** flips the
21
+ * flag itself and broadcasts the modifiers on the compute bus
22
+ * (`liveops_window_opened`/`closed`) for other engines to apply — spawn
23
+ * multipliers, weather locks, double gold.
24
+ * - `SeasonDef` containers name a season (`season_id`, `active`,
25
+ * `starts_at_ms`/`ends_at_ms`) and its battle-pass composition: the
26
+ * `pass_track` is a progression-layer track name and `pass_features` a
27
+ * JSON array of feature gates unlocked per tier — a battle pass is a
28
+ * SEASON + PROGRESSION TRACK + FEATURE GATES, no new machinery.
29
+ *
30
+ * Runtime counterpart: `client.kit(appId).liveops`.
31
+ */
32
+ export function liveopsBlueprint(options = {}) {
33
+ const { typePrefix = '', adminAuthority = 'server' } = options;
34
+ const names = liveopsNames(typePrefix);
35
+ const trusted = trustedAuthorityFields(adminAuthority);
36
+ const propertyDefinitions = [
37
+ {
38
+ containerTypeName: names.windowType,
39
+ key: 'window_id',
40
+ valueType: 'string',
41
+ defaultValueJson: '""',
42
+ description: 'Stable id other systems reference (unique per app by convention).',
43
+ },
44
+ {
45
+ containerTypeName: names.windowType,
46
+ key: 'active',
47
+ valueType: 'bool',
48
+ defaultValueJson: 'false',
49
+ description: 'Live flag. Flipped by the admin functions, cron automations, or the liveops-scheduler engine (timestamp windows).',
50
+ },
51
+ {
52
+ containerTypeName: names.windowType,
53
+ key: 'opens_at_ms',
54
+ valueType: 'int',
55
+ defaultValueJson: '0',
56
+ description: 'Optional epoch-ms open time (with closes_at_ms, the scheduler owns the flag).',
57
+ },
58
+ {
59
+ containerTypeName: names.windowType,
60
+ key: 'closes_at_ms',
61
+ valueType: 'int',
62
+ defaultValueJson: '0',
63
+ description: 'Optional epoch-ms close time.',
64
+ },
65
+ {
66
+ containerTypeName: names.windowType,
67
+ key: 'modifiers',
68
+ valueType: 'string',
69
+ defaultValueJson: '"{}"',
70
+ description: 'Opaque JSON broadcast on the compute bus when the window opens/closes (consumed by engines).',
71
+ },
72
+ {
73
+ containerTypeName: names.seasonType,
74
+ key: 'season_id',
75
+ valueType: 'string',
76
+ defaultValueJson: '""',
77
+ description: 'Stable season id (e.g. "s3").',
78
+ },
79
+ {
80
+ containerTypeName: names.seasonType,
81
+ key: 'active',
82
+ valueType: 'bool',
83
+ defaultValueJson: 'false',
84
+ description: 'The one live season (activate_season deactivates the rest by convention).',
85
+ },
86
+ {
87
+ containerTypeName: names.seasonType,
88
+ key: 'starts_at_ms',
89
+ valueType: 'int',
90
+ defaultValueJson: '0',
91
+ description: 'Season start (epoch ms; informational).',
92
+ },
93
+ {
94
+ containerTypeName: names.seasonType,
95
+ key: 'ends_at_ms',
96
+ valueType: 'int',
97
+ defaultValueJson: '0',
98
+ description: 'Season end (epoch ms; informational).',
99
+ },
100
+ {
101
+ containerTypeName: names.seasonType,
102
+ key: 'pass_track',
103
+ valueType: 'string',
104
+ defaultValueJson: '""',
105
+ description: "Battle-pass composition: the progression layer's track name whose tiers gate rewards.",
106
+ },
107
+ {
108
+ containerTypeName: names.seasonType,
109
+ key: 'pass_features',
110
+ valueType: 'string',
111
+ defaultValueJson: '"[]"',
112
+ description: 'Battle-pass composition: JSON array of feature-gate keys unlocked per pass tier.',
113
+ },
114
+ ];
115
+ const functions = [
116
+ {
117
+ name: names.openWindowFn,
118
+ containerTypeName: names.windowType,
119
+ returnType: 'bool',
120
+ mutations: [{ target: 'self', property: 'active', expression: 'true' }],
121
+ returnExpression: 'self.active',
122
+ invokePolicyJson: trusted.invokePolicyJson ?? kitPolicyJson({ type: 'is_automation' }),
123
+ ...(trusted.autonomousInvocable !== undefined
124
+ ? { autonomousInvocable: trusted.autonomousInvocable }
125
+ : {}),
126
+ description: 'Open the window (admin/automation). The liveops-scheduler engine broadcasts the modifiers on the next tick.',
127
+ },
128
+ {
129
+ name: names.closeWindowFn,
130
+ containerTypeName: names.windowType,
131
+ returnType: 'bool',
132
+ mutations: [{ target: 'self', property: 'active', expression: 'false' }],
133
+ returnExpression: 'self.active',
134
+ invokePolicyJson: trusted.invokePolicyJson ?? kitPolicyJson({ type: 'is_automation' }),
135
+ ...(trusted.autonomousInvocable !== undefined
136
+ ? { autonomousInvocable: trusted.autonomousInvocable }
137
+ : {}),
138
+ description: 'Close the window (admin/automation).',
139
+ },
140
+ {
141
+ name: names.activateSeasonFn,
142
+ containerTypeName: names.seasonType,
143
+ returnType: 'bool',
144
+ mutations: [{ target: 'self', property: 'active', expression: 'true' }],
145
+ returnExpression: 'self.active',
146
+ invokePolicyJson: trusted.invokePolicyJson ?? kitPolicyJson({ type: 'is_automation' }),
147
+ ...(trusted.autonomousInvocable !== undefined
148
+ ? { autonomousInvocable: trusted.autonomousInvocable }
149
+ : {}),
150
+ description: 'Activate this season (admin/automation). Deactivate the previous season separately (one live season by convention).',
151
+ },
152
+ ];
153
+ return {
154
+ name: 'liveops',
155
+ containerTypes: [
156
+ {
157
+ typeName: names.windowType,
158
+ displayName: 'Liveops event window',
159
+ description: 'A liveops window: active flag + optional timestamps + modifier JSON broadcast by the scheduler engine.',
160
+ },
161
+ {
162
+ typeName: names.seasonType,
163
+ displayName: 'Liveops season',
164
+ description: 'A season definition; battle passes compose a season with a progression track + feature gates.',
165
+ },
166
+ ],
167
+ propertyDefinitions,
168
+ functions,
169
+ };
170
+ }
@@ -0,0 +1,32 @@
1
+ import { type KitBlueprint } from './core.js';
2
+ /** Options for {@link moderationBlueprint}. */
3
+ export interface ModerationBlueprintOptions {
4
+ /** Prefix for the type/function names. Defaults to none. */
5
+ typePrefix?: string;
6
+ }
7
+ /** Names derived by {@link moderationBlueprint} for a given prefix. */
8
+ export interface ModerationNames {
9
+ reportType: string;
10
+ muteType: string;
11
+ fileReportFn: string;
12
+ resolveReportFn: string;
13
+ }
14
+ /** Compute the type/function names a moderation blueprint (and its runtime helper) uses. */
15
+ export declare function moderationNames(typePrefix?: string): ModerationNames;
16
+ /**
17
+ * Blueprint for **moderation** (matrix P6) — MODEL + CLIENT, no compute:
18
+ *
19
+ * - `ModReport` containers are the escalation queue: any player files one
20
+ * against a subject (`file_report` is member-instantiable through the
21
+ * runtime helper — the caller's own report row); app admins read the
22
+ * open queue and `resolve_report` with a disposition.
23
+ * - `ModMute` containers are per-player mute lists (client-enforced: the
24
+ * runtime helper filters chat client-side — mutes are personal, not
25
+ * punitive).
26
+ * - ENFORCEMENT stays on existing platform surfaces: admins revoke access
27
+ * tiers / grid permissions; nothing new to trust here.
28
+ *
29
+ * Runtime counterpart: `client.kit(appId).moderation`.
30
+ */
31
+ export declare function moderationBlueprint(options?: ModerationBlueprintOptions): KitBlueprint;
32
+ //# sourceMappingURL=moderation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"moderation.d.ts","sourceRoot":"","sources":["../../../src/kit/blueprints/moderation.ts"],"names":[],"mappings":"AACA,OAAO,EAAuC,KAAK,YAAY,EAAE,MAAM,WAAW,CAAC;AAEnF,+CAA+C;AAC/C,MAAM,WAAW,0BAA0B;IACzC,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uEAAuE;AACvE,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,4FAA4F;AAC5F,wBAAgB,eAAe,CAAC,UAAU,SAAK,GAAG,eAAe,CAQhE;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,GAAE,0BAA+B,GAAG,YAAY,CAqH1F"}
@@ -0,0 +1,140 @@
1
+ import { toSnakeCase, trustedAuthorityFields } from './core.js';
2
+ /** Compute the type/function names a moderation blueprint (and its runtime helper) uses. */
3
+ export function moderationNames(typePrefix = '') {
4
+ const fnPrefix = typePrefix ? `${toSnakeCase(typePrefix)}_` : '';
5
+ return {
6
+ reportType: `${typePrefix}ModReport`,
7
+ muteType: `${typePrefix}ModMute`,
8
+ fileReportFn: `${fnPrefix}file_report`,
9
+ resolveReportFn: `${fnPrefix}resolve_report`,
10
+ };
11
+ }
12
+ /**
13
+ * Blueprint for **moderation** (matrix P6) — MODEL + CLIENT, no compute:
14
+ *
15
+ * - `ModReport` containers are the escalation queue: any player files one
16
+ * against a subject (`file_report` is member-instantiable through the
17
+ * runtime helper — the caller's own report row); app admins read the
18
+ * open queue and `resolve_report` with a disposition.
19
+ * - `ModMute` containers are per-player mute lists (client-enforced: the
20
+ * runtime helper filters chat client-side — mutes are personal, not
21
+ * punitive).
22
+ * - ENFORCEMENT stays on existing platform surfaces: admins revoke access
23
+ * tiers / grid permissions; nothing new to trust here.
24
+ *
25
+ * Runtime counterpart: `client.kit(appId).moderation`.
26
+ */
27
+ export function moderationBlueprint(options = {}) {
28
+ const { typePrefix = '' } = options;
29
+ const names = moderationNames(typePrefix);
30
+ const propertyDefinitions = [
31
+ {
32
+ containerTypeName: names.reportType,
33
+ key: 'reporter_user_id',
34
+ valueType: 'string',
35
+ defaultValueJson: '""',
36
+ description: 'Who filed the report.',
37
+ },
38
+ {
39
+ containerTypeName: names.reportType,
40
+ key: 'subject_user_id',
41
+ valueType: 'string',
42
+ defaultValueJson: '""',
43
+ description: 'Who the report is about.',
44
+ },
45
+ {
46
+ containerTypeName: names.reportType,
47
+ key: 'reason',
48
+ valueType: 'string',
49
+ defaultValueJson: '""',
50
+ description: "App-defined category ('harassment', 'cheating', 'spam', ...).",
51
+ },
52
+ {
53
+ containerTypeName: names.reportType,
54
+ key: 'detail',
55
+ valueType: 'string',
56
+ defaultValueJson: '""',
57
+ description: 'Free-text context from the reporter (client-truncated).',
58
+ },
59
+ {
60
+ containerTypeName: names.reportType,
61
+ key: 'status',
62
+ valueType: 'string',
63
+ defaultValueJson: '"open"',
64
+ description: "Queue state: 'open' | 'actioned' | 'dismissed'.",
65
+ },
66
+ {
67
+ containerTypeName: names.reportType,
68
+ key: 'resolution',
69
+ valueType: 'string',
70
+ defaultValueJson: '""',
71
+ description: 'Admin note recorded by resolve_report.',
72
+ },
73
+ {
74
+ containerTypeName: names.reportType,
75
+ key: 'filed_at_ms',
76
+ valueType: 'int',
77
+ defaultValueJson: '0',
78
+ description: 'Client-reported epoch ms (informational; the event log holds server time).',
79
+ },
80
+ {
81
+ containerTypeName: names.muteType,
82
+ key: 'owner_user_id',
83
+ valueType: 'string',
84
+ defaultValueJson: '""',
85
+ description: 'Whose mute list this row belongs to (kit owner mirror).',
86
+ },
87
+ {
88
+ containerTypeName: names.muteType,
89
+ key: 'muted_user_id',
90
+ valueType: 'string',
91
+ defaultValueJson: '""',
92
+ description: 'The muted player (client-side chat filtering).',
93
+ },
94
+ ];
95
+ const functions = [
96
+ {
97
+ name: names.resolveReportFn,
98
+ containerTypeName: names.reportType,
99
+ returnType: 'string',
100
+ parameters: [
101
+ {
102
+ name: 'status',
103
+ valueType: 'string',
104
+ required: true,
105
+ description: "'actioned' or 'dismissed'.",
106
+ },
107
+ {
108
+ name: 'resolution',
109
+ valueType: 'string',
110
+ required: true,
111
+ description: 'Admin disposition note.',
112
+ },
113
+ ],
114
+ mutations: [
115
+ { target: 'self', property: 'status', expression: '$status' },
116
+ { target: 'self', property: 'resolution', expression: '$resolution' },
117
+ ],
118
+ returnExpression: 'self.status',
119
+ ...trustedAuthorityFields('server'),
120
+ description: 'Close a report with a disposition (app admins). Enforcement happens on platform surfaces (tier revocation, grid permissions).',
121
+ },
122
+ ];
123
+ return {
124
+ name: 'moderation',
125
+ containerTypes: [
126
+ {
127
+ typeName: names.reportType,
128
+ displayName: 'Moderation report',
129
+ description: 'One player report in the escalation queue (open/actioned/dismissed).',
130
+ },
131
+ {
132
+ typeName: names.muteType,
133
+ displayName: 'Moderation mute',
134
+ description: 'One personal mute entry (client-enforced chat filtering).',
135
+ },
136
+ ],
137
+ propertyDefinitions,
138
+ functions,
139
+ };
140
+ }
@@ -48,9 +48,10 @@ export interface KitStatusEffect {
48
48
  /**
49
49
  * Runtime helpers for the {@link combatBlueprint} conventions: spawn
50
50
  * combatants, attack (server-side damage formula + death flip), arm status
51
- * effects the tick automation applies over time, respawn, and — with
52
- * `hostSynced` persist host-simulated hp. Denials resolve with
53
- * `success: false`.
51
+ * effects the tick automation applies over time, respawn, and route
52
+ * competitive realtime attacks through a compute referee. `hostSynced`
53
+ * remains a low-stakes/legacy fallback for persisting elected-host state;
54
+ * it is not an anti-cheat boundary. Denials resolve with `success: false`.
54
55
  *
55
56
  * Obtained via `client.kit(appId).combat`.
56
57
  */
@@ -1 +1 @@
1
-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AC,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC;IA6B7D,gDAAgD;IAC1C,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IASpE,yEAAyE;IACnE,MAAM,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IASnE;;;OAGG;IACG,aAAa,CACjB,WAAW,EAAE,MAAM,EACnB,EAAE,EAAE,MAAM,GACT,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;CAQpC"}
@@ -3,9 +3,10 @@ import { kitContainerProperties, kitInvoke, } from './shared.js';
3
3
  /**
4
4
  * Runtime helpers for the {@link combatBlueprint} conventions: spawn
5
5
  * combatants, attack (server-side damage formula + death flip), arm status
6
- * effects the tick automation applies over time, respawn, and — with
7
- * `hostSynced` persist host-simulated hp. Denials resolve with
8
- * `success: false`.
6
+ * effects the tick automation applies over time, respawn, and route
7
+ * competitive realtime attacks through a compute referee. `hostSynced`
8
+ * remains a low-stakes/legacy fallback for persisting elected-host state;
9
+ * it is not an anti-cheat boundary. Denials resolve with `success: false`.
9
10
  *
10
11
  * Obtained via `client.kit(appId).combat`.
11
12
  */
@@ -1,4 +1,4 @@
1
- export { andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBlueprint, inventoryNames, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEquals, ownerEqualsCaller, ownerMirrorProperty, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toSnakeCase, trustedAuthorityFields, worldsimBlueprint, worldsimNames, type CombatBlueprintOptions, type CombatNames, type DecksBlueprintOptions, type DecksNames, type EconomyBlueprintOptions, type EconomyNames, type GuildBlueprintOptions, type GuildNames, type InventoryBlueprintOptions, type InventoryNames, type KitAutomationSpec, type KitAutomationTriggerSpec, type KitBlueprint, type KitInvokePolicy, type KitOwnerIdKind, type KitSelectorSpec, type KitTrustedAuthority, type LeaderboardsBlueprintOptions, type LeaderboardsNames, type LockAuthority, type LockBlueprintOptions, type LockNames, type LootBlueprintOptions, type LootDropSpec, type LootEntrySpec, type LootNames, type LootTableSpec, type MatchesBlueprintOptions, type MatchesNames, type MergedBlueprints, type NpcBehaviorSpec, type NpcBehaviorTrigger, type NpcBlueprintOptions, type PlotBlueprintOptions, type PlotNames, type ProgressionBlueprintOptions, type ProgressionNames, type QuestAdvanceSpec, type QuestsBlueprintOptions, type QuestsNames, type SelectorPermissionPredicate, type WorldsimBlueprintOptions, type WorldsimNames, } from './blueprints/index.js';
1
+ export { andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBarterFunctionName, inventoryBlueprint, inventoryCraftFunctionName, inventoryNames, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEquals, ownerEqualsCaller, ownerMirrorProperty, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toSnakeCase, trustedAuthorityFields, worldsimBlueprint, worldsimNames, type CombatBlueprintOptions, type CombatNames, type DecksBlueprintOptions, type DecksNames, type EconomyBlueprintOptions, type EconomyNames, type GuildBlueprintOptions, type GuildNames, type InventoryBarterSpec, type InventoryBlueprintOptions, type InventoryNames, type InventoryRecipeSpec, type KitAutomationSpec, type KitAutomationTriggerSpec, type KitBlueprint, type KitInvokePolicy, type KitOwnerIdKind, type KitSelectorSpec, type KitTrustedAuthority, type LeaderboardsBlueprintOptions, type LeaderboardsNames, type LockAuthority, type LockBlueprintOptions, type LockNames, type LootBlueprintOptions, type LootDropSpec, type LootEntrySpec, type LootNames, type LootTableSpec, type MatchesBlueprintOptions, type MatchesNames, type MergedBlueprints, type NpcBehaviorSpec, type NpcBehaviorTrigger, type NpcBlueprintOptions, type PlotBlueprintOptions, type PlotNames, type ProgressionBlueprintOptions, type ProgressionNames, type QuestAdvanceSpec, type QuestsBlueprintOptions, type QuestsNames, type SelectorPermissionPredicate, type WorldsimBlueprintOptions, type WorldsimNames, liveopsBlueprint, liveopsNames, type LiveopsBlueprintOptions, type LiveopsNames, moderationBlueprint, moderationNames, type ModerationBlueprintOptions, type ModerationNames, } from './blueprints/index.js';
2
2
  export { GameKitClient, type GameKitDomains, type GameKitOptions, type KitDeployResult, } from './kit.js';
3
3
  export { MatchesKit, type KitMatch, type KitMatchScore, type MatchesKitOptions, } from './matches.js';
4
4
  export { InventoryKit, type InventoryKitOptions, type KitItemStack } from './inventory.js';
@@ -13,11 +13,18 @@ export { NpcsKit, type KitNpc, type LiveNpcPose, type NpcsKitOptions, } from './
13
13
  export { MobsKit, type KitAttackResult, type KitMobDef, type KitMobSlot, type MobsKitOptions, } from './mobs.js';
14
14
  export { PetsKit, type KitPet, type KitPetResult, type PetsKitOptions, } from './pets.js';
15
15
  export { EngineDetector, type EngineInvokeResult } from './engine.js';
16
+ export { LiveopsKit, type KitEventWindow, type KitSeason, type LiveopsKitOptions, type ZoneChangeEvent, } from './liveops.js';
17
+ export { AbilitiesKit, type AbilitiesKitOptions, type KitAbility, } from './abilities.js';
18
+ export { MovementKit, type KitViolations, type MovementKitOptions, } from './movement.js';
19
+ export { TerritoryKit, type KitControlPoint, type TerritoryKitOptions, } from './territory.js';
20
+ export { RacingKit, type KitRaceRun, type RacingKitOptions, } from './racing.js';
21
+ export { ModerationKit, type KitModReport, type ModerationKitOptions, } from './moderation.js';
22
+ export { TelemetryKit, telemetryBlueprint, type TelemetryKitOptions, } from './telemetry.js';
16
23
  export { InstancesKit, type InstancesKitOptions, type KitInstance, } from './instances.js';
17
24
  export { DirectorKit, type DirectorKitOptions, type KitDirectorRun, type KitWaveSpec, } from './director.js';
18
25
  export { MatchmakingKit, type KitQueueStatus, type MatchmakingKitOptions, } from './matchmaking.js';
19
26
  export { MinigamesKit, type MinigamesKitOptions } from './minigames.js';
20
- export { EVENT_CONTACT_DAMAGE, EVENT_WEATHER, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseContactDamage, parseEngineEvent, parseProposalEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, poseSuffix, EVENT_PROPOSAL, EVENT_SCORE, EVENT_TURN, type ContactDamageEvent, type EnginePose, type ProposalEvent, type ScoreEvent, type TurnEvent, type WeatherEvent, } from './wire.js';
27
+ export { EVENT_CONTACT_DAMAGE, EVENT_WEATHER, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEngineEvent, parseMovementViolation, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, poseSuffix, EVENT_ABILITY, EVENT_CONTROL_POINT, EVENT_MOVEMENT_VIOLATION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_ZONE_CHANGE, type AbilityEvent, type ContactDamageEvent, type ControlPointEvent, type EnginePose, type MovementViolationEvent, type ProposalEvent, type RaceTimingEvent, type ScoreEvent, type TurnEvent, type WeatherEvent, } from './wire.js';
21
28
  export { PlotsKit, type PlotsKitOptions, type KitPlot } from './plots.js';
22
29
  export { QuestsKit, type KitQuestDef, type KitQuestProgress, type QuestsKitOptions, } from './quests.js';
23
30
  export { ProgressionKit, type KitAchievementDef, type KitAchievementUnlock, type KitProgress, type KitSkillDef, type KitSkillRank, type ProgressionKitOptions, } from './progression.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,UAAU,EACV,kBAAkB,EAClB,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,qBAAqB,EAC1B,KAAK,UAAU,EACf,KAAK,yBAAyB,EAC9B,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,wBAAwB,EAC7B,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,SAAS,EACd,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,aAAa,EAClB,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,uBAAuB,EAC5B,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,eAAe,EACpB,KAAK,kBAAkB,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B,EACrB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/kit/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,WAAW,EACX,eAAe,EACf,WAAW,EACX,iBAAiB,EACjB,cAAc,EACd,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,YAAY,EACZ,WAAW,EACX,cAAc,EACd,UAAU,EACV,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,EAC1B,cAAc,EACd,aAAa,EACb,qBAAqB,EACrB,iBAAiB,EACjB,aAAa,EACb,SAAS,EACT,aAAa,EACb,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,uBAAuB,EACvB,YAAY,EACZ,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,aAAa,EACb,SAAS,EACT,oBAAoB,EACpB,gBAAgB,EAChB,eAAe,EACf,WAAW,EACX,WAAW,EACX,sBAAsB,EACtB,iBAAiB,EACjB,aAAa,EACb,KAAK,sBAAsB,EAC3B,KAAK,WAAW,EAChB,KAAK,qBAAqB,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EACjB,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAClB,KAAK,eAAe,EACpB,KAAK,UAAU,EACf,KAAK,SAAS,EACd,KAAK,YAAY,GAClB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,QAAQ,EAAE,KAAK,eAAe,EAAE,KAAK,OAAO,EAAE,MAAM,YAAY,CAAC;AAC1E,OAAO,EACL,SAAS,EACT,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,qBAAqB,GAC3B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,SAAS,EACT,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,GACtB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,WAAW,EACX,KAAK,OAAO,EACZ,KAAK,WAAW,EAChB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,kBAAkB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EACL,SAAS,EACT,iBAAiB,EACjB,KAAK,eAAe,EACpB,KAAK,eAAe,GACrB,MAAM,aAAa,CAAC"}
package/dist/kit/index.js CHANGED
@@ -1,4 +1,4 @@
1
- export { andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBlueprint, inventoryNames, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEquals, ownerEqualsCaller, ownerMirrorProperty, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toSnakeCase, trustedAuthorityFields, worldsimBlueprint, worldsimNames, } from './blueprints/index.js';
1
+ export { andPolicies, combatBlueprint, combatNames, composeBlueprints, decksBlueprint, decksNames, economyBlueprint, economyCurrencyFn, economyNames, featureGate, guildBlueprint, guildNames, inventoryBarterFunctionName, inventoryBlueprint, inventoryCraftFunctionName, inventoryNames, kitPolicyJson, leaderboardsBlueprint, leaderboardsNames, lockBlueprint, lockNames, lootBlueprint, lootNames, lootRollFn, matchesBlueprint, matchesNames, mergeBlueprints, npcBehaviorFunctionName, npcBlueprint, ownerEquals, ownerEqualsCaller, ownerMirrorProperty, plotBlueprint, plotNames, progressionBlueprint, progressionNames, questsBlueprint, questsNames, toSnakeCase, trustedAuthorityFields, worldsimBlueprint, worldsimNames, liveopsBlueprint, liveopsNames, moderationBlueprint, moderationNames, } from './blueprints/index.js';
2
2
  export { GameKitClient, } from './kit.js';
3
3
  export { MatchesKit, } from './matches.js';
4
4
  export { InventoryKit } from './inventory.js';
@@ -13,11 +13,18 @@ export { NpcsKit, } from './npcs.js';
13
13
  export { MobsKit, } from './mobs.js';
14
14
  export { PetsKit, } from './pets.js';
15
15
  export { EngineDetector } from './engine.js';
16
+ export { LiveopsKit, } from './liveops.js';
17
+ export { AbilitiesKit, } from './abilities.js';
18
+ export { MovementKit, } from './movement.js';
19
+ export { TerritoryKit, } from './territory.js';
20
+ export { RacingKit, } from './racing.js';
21
+ export { ModerationKit, } from './moderation.js';
22
+ export { TelemetryKit, telemetryBlueprint, } from './telemetry.js';
16
23
  export { InstancesKit, } from './instances.js';
17
24
  export { DirectorKit, } from './director.js';
18
25
  export { MatchmakingKit, } from './matchmaking.js';
19
26
  export { MinigamesKit } from './minigames.js';
20
- export { EVENT_CONTACT_DAMAGE, EVENT_WEATHER, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseContactDamage, parseEngineEvent, parseProposalEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, poseSuffix, EVENT_PROPOSAL, EVENT_SCORE, EVENT_TURN, } from './wire.js';
27
+ export { EVENT_CONTACT_DAMAGE, EVENT_WEATHER, FLAG_GROUNDED, FLAG_MOB, FLAG_NPC, FLAG_RESERVED3, POSE_BYTES, decodeEnginePose, encodeEnginePose, engineLanes, enginePoseCodec, parseAbilityEvent, parseContactDamage, parseControlPointEvent, parseEngineEvent, parseMovementViolation, parseProposalEvent, parseRaceTimingEvent, parseScoreEvent, parseTurnEvent, parseWeatherEvent, poseSuffix, EVENT_ABILITY, EVENT_CONTROL_POINT, EVENT_MOVEMENT_VIOLATION, EVENT_PROPOSAL, EVENT_RACE_TIMING, EVENT_SCORE, EVENT_TURN, EVENT_ZONE_CHANGE, } from './wire.js';
21
28
  export { PlotsKit } from './plots.js';
22
29
  export { QuestsKit, } from './quests.js';
23
30
  export { ProgressionKit, } from './progression.js';
@@ -1,10 +1,13 @@
1
1
  import type { GameModelAPI } from '../domains/gameModel.js';
2
2
  import type { Scalars } from '../generated/graphql.js';
3
+ import { type KitOwnerIdKind } from './blueprints/index.js';
3
4
  import { type KitInvokeResult } from './shared.js';
4
5
  /** Options for {@link InventoryKit}. Must match the deployed blueprint's options. */
5
6
  export interface InventoryKitOptions {
6
7
  /** The `typePrefix` the inventory blueprint was deployed with. */
7
8
  typePrefix?: string;
9
+ /** Must match inventoryBlueprint.ownerIdKind. Defaults to `int`. */
10
+ ownerIdKind?: KitOwnerIdKind;
8
11
  }
9
12
  /** A parsed view of one item stack. */
10
13
  export interface KitItemStack {
@@ -27,6 +30,8 @@ export declare class InventoryKit {
27
30
  private readonly appId;
28
31
  private readonly gameModel;
29
32
  private readonly names;
33
+ private readonly typePrefix;
34
+ private readonly ownerIdKind;
30
35
  constructor(appId: Scalars['BigInt']['input'], gameModel: GameModelAPI, options?: InventoryKitOptions);
31
36
  /**
32
37
  * Find the caller's inventory container, creating it when absent. The
@@ -97,6 +102,14 @@ export declare class InventoryKit {
97
102
  * Resolves with the source stack's remaining quantity.
98
103
  */
99
104
  transfer(fromStackId: string, toStackId: string, amount: number): Promise<KitInvokeResult<number>>;
105
+ /**
106
+ * Atomically craft a recipe generated by inventoryBlueprint: every input
107
+ * decrement and the output grant commit together. A failed guard writes
108
+ * nothing. `inputStackIds` must follow the recipe input order.
109
+ */
110
+ craft(inventoryId: string, recipeId: string, inputStackIds: string[], outputStackId: string): Promise<KitInvokeResult<number>>;
111
+ /** Atomically execute a generated item-for-item barter offer. */
112
+ barter(inventoryId: string, barterId: string, payStackId: string, receiveStackId: string): Promise<KitInvokeResult<number>>;
100
113
  /**
101
114
  * Record that a stack belongs to an inventory with an
102
115
  * `inventory_contains` edge, so {@link contents} can read the whole bag in
@@ -1 +1 @@
1
- {"version":3,"file":"inventory.d.ts","sourceRoot":"","sources":["../../src/kit/inventory.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,qFAAqF;AACrF,MAAM,WAAW,mBAAmB;IAClC,kEAAkE;IAClE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,uCAAuC;AACvC,MAAM,WAAW,YAAY;IAC3B,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;;;;GAOG;AACH,qBAAa,YAAY;IAIrB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,SAAS;IAJ5B,O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AAC;IASnC;;;;OAIG;IACG,KAAK,CACT,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,aAAa,EAAE,MAAM,EAAE,EACvB,aAAa,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IAYnC,iEAAiE;IAC3D,MAAM,CACV,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,EAClB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC;IASnC;;;;OAIG;IACG,SAAS,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM;;;;;;;;IASpD,gFAAgF;IAC1E,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;CA4B7D"}
@@ -1,4 +1,4 @@
1
- import { inventoryNames } from './blueprints/index.js';
1
+ import { inventoryBarterFunctionName, inventoryCraftFunctionName, inventoryNames, } from './blueprints/index.js';
2
2
  import { kitContainerProperties, kitInvoke, } from './shared.js';
3
3
  /**
4
4
  * Runtime helpers for the {@link inventoryBlueprint} conventions: find or
@@ -12,7 +12,9 @@ export class InventoryKit {
12
12
  constructor(appId, gameModel, options = {}) {
13
13
  this.appId = appId;
14
14
  this.gameModel = gameModel;
15
- this.names = inventoryNames(options.typePrefix ?? '');
15
+ this.typePrefix = options.typePrefix ?? '';
16
+ this.ownerIdKind = options.ownerIdKind ?? 'int';
17
+ this.names = inventoryNames(this.typePrefix);
16
18
  }
17
19
  /**
18
20
  * Find the caller's inventory container, creating it when absent. The
@@ -83,8 +85,10 @@ export class InventoryKit {
83
85
  ? [
84
86
  {
85
87
  key: 'owner_user_id',
86
- valueType: 'int',
87
- valueJson: String(input.ownerUserId),
88
+ valueType: this.ownerIdKind,
89
+ valueJson: this.ownerIdKind === 'string'
90
+ ? JSON.stringify(String(input.ownerUserId))
91
+ : String(input.ownerUserId),
88
92
  },
89
93
  ]
90
94
  : []),
@@ -134,6 +138,31 @@ export class InventoryKit {
134
138
  params: { to_id: toStackId, amount },
135
139
  });
136
140
  }
141
+ /**
142
+ * Atomically craft a recipe generated by inventoryBlueprint: every input
143
+ * decrement and the output grant commit together. A failed guard writes
144
+ * nothing. `inputStackIds` must follow the recipe input order.
145
+ */
146
+ async craft(inventoryId, recipeId, inputStackIds, outputStackId) {
147
+ return kitInvoke(this.gameModel, {
148
+ appId: String(this.appId),
149
+ functionName: inventoryCraftFunctionName(recipeId, this.typePrefix),
150
+ selfContainerId: inventoryId,
151
+ params: {
152
+ ...Object.fromEntries(inputStackIds.map((id, index) => [`input_${index}_id`, id])),
153
+ output_id: outputStackId,
154
+ },
155
+ });
156
+ }
157
+ /** Atomically execute a generated item-for-item barter offer. */
158
+ async barter(inventoryId, barterId, payStackId, receiveStackId) {
159
+ return kitInvoke(this.gameModel, {
160
+ appId: String(this.appId),
161
+ functionName: inventoryBarterFunctionName(barterId, this.typePrefix),
162
+ selfContainerId: inventoryId,
163
+ params: { pay_id: payStackId, receive_id: receiveStackId },
164
+ });
165
+ }
137
166
  /**
138
167
  * Record that a stack belongs to an inventory with an
139
168
  * `inventory_contains` edge, so {@link contents} can read the whole bag in