@genex-ai/cli-demo 1.6.0-dev.408 → 1.6.1-dev.409
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/dist/index.js
CHANGED
|
@@ -5116,7 +5116,7 @@ async function runDomain(opts) {
|
|
|
5116
5116
|
}
|
|
5117
5117
|
|
|
5118
5118
|
// src/commands/shop.ts
|
|
5119
|
-
var SUBS = ["list", "add", "set", "remove"];
|
|
5119
|
+
var SUBS = ["list", "add", "set", "remove", "test"];
|
|
5120
5120
|
function money(cents) {
|
|
5121
5121
|
return cents === void 0 ? "" : ` ($${(cents / 100).toFixed(2)})`;
|
|
5122
5122
|
}
|
|
@@ -5243,6 +5243,17 @@ async function runShop(opts) {
|
|
|
5243
5243
|
return;
|
|
5244
5244
|
}
|
|
5245
5245
|
const skuUrl = `${apiUrl}/api/coin/skus/${encodeURIComponent(skuId)}`;
|
|
5246
|
+
if (sub === "test") {
|
|
5247
|
+
const res2 = await call(`${skuUrl}/test-grant`, { method: "POST" });
|
|
5248
|
+
if (!res2.ok) return fail3(res2, "grant yourself a test copy");
|
|
5249
|
+
const got = await res2.json();
|
|
5250
|
+
log.success(`You now own ${c.cyan(got.name)} in this game.`);
|
|
5251
|
+
log.dim(" It cost nothing and no sale was recorded \u2014 it is a test copy.");
|
|
5252
|
+
log.dim(
|
|
5253
|
+
got.skuType === "durable" ? " Reload the game: it should appear in your inventory." : " Reload the game: it should be delivered and consumed once."
|
|
5254
|
+
);
|
|
5255
|
+
return;
|
|
5256
|
+
}
|
|
5246
5257
|
if (sub === "set") {
|
|
5247
5258
|
const patch = {};
|
|
5248
5259
|
if (opts.rename) patch.name = opts.rename;
|
|
@@ -19720,11 +19731,14 @@ ${c.bold("Usage")}
|
|
|
19720
19731
|
add | list | verify | remove. "add" opens a
|
|
19721
19732
|
one-click approval at your DNS host \u2014 no
|
|
19722
19733
|
records to copy or paste.
|
|
19723
|
-
genex shop <sub> [name|id] What this game sells: list | add | set | remove
|
|
19724
|
-
"add" prints the item id your game passes
|
|
19725
|
-
buy({ skuId }) \u2014 the platform owns the
|
|
19726
|
-
so this is the only way one exists.
|
|
19727
|
-
off a fixed grid, printed on any
|
|
19734
|
+
genex shop <sub> [name|id] What this game sells: list | add | set | remove |
|
|
19735
|
+
test. "add" prints the item id your game passes
|
|
19736
|
+
to buy({ skuId }) \u2014 the platform owns the
|
|
19737
|
+
catalog, so this is the only way one exists.
|
|
19738
|
+
Prices come off a fixed grid, printed on any
|
|
19739
|
+
refusal. "test <id>" gives you a free copy of
|
|
19740
|
+
your own item: you can't buy from your own game,
|
|
19741
|
+
so this is how you check the shop works.
|
|
19728
19742
|
genex model "<prompt>" [options] Generate a 3D model (GLB); prints a public asset URL.
|
|
19729
19743
|
genex sfx "<prompt>" [options] Generate a sound effect (mp3); prints a public asset URL.
|
|
19730
19744
|
genex music "<prompt>" [options] Generate an instrumental music track (mp3); prints a
|
|
@@ -19977,6 +19991,7 @@ ${c.bold("Examples")}
|
|
|
19977
19991
|
genex shop list
|
|
19978
19992
|
genex shop add "Iron Key" --price 100 --type durable
|
|
19979
19993
|
genex shop set sku_123 --price 200
|
|
19994
|
+
genex shop test sku_123
|
|
19980
19995
|
genex shop remove sku_123
|
|
19981
19996
|
genex publish --no-push --title "My Game"
|
|
19982
19997
|
genex model "weathered wooden barrel with iron bands"
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.1-dev.409",
|
|
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": {
|
|
@@ -225,9 +225,25 @@ no local save to drift out of sync. Only consume a durable when it grants
|
|
|
225
225
|
something once and non-idempotently (a permanent +100 gold), and then record it
|
|
226
226
|
in the player's save, because re-applying that on every boot would be a bug.
|
|
227
227
|
|
|
228
|
+
### Testing the shop you just built
|
|
229
|
+
|
|
230
|
+
You cannot buy from your own game — the server refuses it as self-dealing, which
|
|
231
|
+
is the rule that stops someone laundering their own coin into earnings. So do
|
|
232
|
+
not try to verify a shop by buying from it while signed in as its owner; you
|
|
233
|
+
will get a refusal and it is not a bug.
|
|
234
|
+
|
|
235
|
+
```bash
|
|
236
|
+
npx genex shop test <sku-id> # a free copy, for the owner only
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
That grants the entitlement without a sale — no coin moves — so the delivery
|
|
240
|
+
path, the inventory and the effect all run exactly as they would after a real
|
|
241
|
+
purchase. Reload the game and it should be there.
|
|
242
|
+
|
|
228
243
|
## Checklist
|
|
229
244
|
|
|
230
245
|
- [ ] Items exist (`npx genex shop list`) before the shop UI is written
|
|
246
|
+
- [ ] Delivery was verified with `npx genex shop test`, not by trying to buy your own item
|
|
231
247
|
- [ ] The game has a loop and a progression before it has a shop
|
|
232
248
|
- [ ] Every item price is on the 50/100/200/500/1000 grid
|
|
233
249
|
- [ ] Every price renders `priceDisplayUsdCents` beside the coin figure
|