@genex-ai/cli-demo 1.6.0-dev.405 → 1.6.0-dev.406
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.6.0-dev.
|
|
3
|
+
"version": "1.6.0-dev.406",
|
|
4
4
|
"description": "Set up your project's agent workspace (.claude/.codex/.cursor in the game folder), authorize, create a game project, generate AI assets, and publish (genex CLI).",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -191,6 +191,12 @@ played before.
|
|
|
191
191
|
```ts
|
|
192
192
|
async function deliverPending() {
|
|
193
193
|
for (const e of await getEntitlements({ excludeConsumed: true })) {
|
|
194
|
+
// Branch on skuType (consumable | durable), NEVER on type — `type` is how
|
|
195
|
+
// it was acquired (purchase/gift/test/free) and can't answer this.
|
|
196
|
+
if (e.skuType === 'durable') {
|
|
197
|
+
wear(e.name); // ownership, re-applied on every boot. Do not consume.
|
|
198
|
+
continue;
|
|
199
|
+
}
|
|
194
200
|
const { alreadyConsumed } = await consumeEntitlement(e.id);
|
|
195
201
|
if (alreadyConsumed) continue; // someone got there first
|
|
196
202
|
applyItem(e.skuId); // AFTER the consume
|
|
@@ -206,8 +212,18 @@ the player loses one item — a support ticket. If you apply first and die befor
|
|
|
206
212
|
consuming, every boot re-delivers it forever — an exploit. Re-listing on boot is
|
|
207
213
|
what makes a purchase survive a crash, a refresh, or a closed tab.
|
|
208
214
|
|
|
209
|
-
`
|
|
210
|
-
|
|
215
|
+
**`e.skuType` is the field that decides this, not `e.type`.** `type` says how the
|
|
216
|
+
player got it (`purchase`/`gift`/`test`/`free`); `skuType` says what it is
|
|
217
|
+
(`consumable`/`durable`).
|
|
218
|
+
|
|
219
|
+
A **consumable** is spent: consume it, then apply the effect once.
|
|
220
|
+
|
|
221
|
+
A **durable** is owned forever, and you have two honest ways to handle it. If the
|
|
222
|
+
effect is ownership — a cosmetic, a skin, an unlock — do **not** consume it: the
|
|
223
|
+
row's presence in the list IS the ownership, it survives reinstalls, and there is
|
|
224
|
+
no local save to drift out of sync. Only consume a durable when it grants
|
|
225
|
+
something once and non-idempotently (a permanent +100 gold), and then record it
|
|
226
|
+
in the player's save, because re-applying that on every boot would be a bug.
|
|
211
227
|
|
|
212
228
|
## Checklist
|
|
213
229
|
|