@genex-ai/cli-demo 1.8.0-dev.478 → 1.8.1-dev.480
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 +27 -4
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5549,6 +5549,9 @@ async function runShop(opts) {
|
|
|
5549
5549
|
if (body.error === "price_off_grid") {
|
|
5550
5550
|
log.dim(` See the full list any time: ${c.cyan("genex shop list")}`);
|
|
5551
5551
|
}
|
|
5552
|
+
if (body.error === "not_resellable_type") {
|
|
5553
|
+
log.dim(` Add it with ${c.cyan("--type durable")} \u2014 a consumable is used up, so there is nothing left to resell.`);
|
|
5554
|
+
}
|
|
5552
5555
|
}
|
|
5553
5556
|
if (sub === "list") {
|
|
5554
5557
|
const res2 = await call(projectSkus);
|
|
@@ -5567,8 +5570,9 @@ async function runShop(opts) {
|
|
|
5567
5570
|
log.plain(`${body.items.length} item${body.items.length === 1 ? "" : "s"}:`);
|
|
5568
5571
|
for (const s of body.items) {
|
|
5569
5572
|
const state = s.active ? "" : c.dim(" (retired)");
|
|
5573
|
+
const resale = s.resellable ? c.dim(" \xB7 resellable") : "";
|
|
5570
5574
|
log.plain(
|
|
5571
|
-
` ${c.cyan(s.id)} ${s.name} \u2014 ${s.priceCoins} coin${money(s.priceDisplayUsdCents)} ${c.dim(s.type)}${state}`
|
|
5575
|
+
` ${c.cyan(s.id)} ${s.name} \u2014 ${s.priceCoins} coin${money(s.priceDisplayUsdCents)} ${c.dim(s.type)}${resale}${state}`
|
|
5572
5576
|
);
|
|
5573
5577
|
}
|
|
5574
5578
|
log.dim(`Prices available: ${body.priceGrid.join(", ")} coin`);
|
|
@@ -5592,7 +5596,8 @@ async function runShop(opts) {
|
|
|
5592
5596
|
name,
|
|
5593
5597
|
priceCoins: opts.price,
|
|
5594
5598
|
type: opts.type === "durable" ? "durable" : "consumable",
|
|
5595
|
-
...opts.icon ? { iconUrl: opts.icon } : {}
|
|
5599
|
+
...opts.icon ? { iconUrl: opts.icon } : {},
|
|
5600
|
+
...opts.resellable !== void 0 ? { resellable: opts.resellable } : {}
|
|
5596
5601
|
})
|
|
5597
5602
|
});
|
|
5598
5603
|
if (!res2.ok) return fail3(res2, "add that item");
|
|
@@ -5604,6 +5609,7 @@ async function runShop(opts) {
|
|
|
5604
5609
|
log.success(`Added ${c.cyan(sku.name)} \u2014 ${sku.priceCoins} coin.`);
|
|
5605
5610
|
log.plain(` id: ${c.cyan(sku.id)}`);
|
|
5606
5611
|
log.dim(` Use it in the game: buy({ skuId: "${sku.id}" })`);
|
|
5612
|
+
if (sku.resellable) log.dim(" Players can resell this to each other on the market.");
|
|
5607
5613
|
return;
|
|
5608
5614
|
}
|
|
5609
5615
|
const skuId = opts.hostname?.trim();
|
|
@@ -5629,8 +5635,11 @@ async function runShop(opts) {
|
|
|
5629
5635
|
if (opts.rename) patch.name = opts.rename;
|
|
5630
5636
|
if (opts.price) patch.priceCoins = opts.price;
|
|
5631
5637
|
if (opts.icon) patch.iconUrl = opts.icon;
|
|
5638
|
+
if (opts.resellable !== void 0) patch.resellable = opts.resellable;
|
|
5632
5639
|
if (Object.keys(patch).length === 0) {
|
|
5633
|
-
log.error(
|
|
5640
|
+
log.error(
|
|
5641
|
+
`Nothing to change. Pass ${c.cyan("--rename")}, ${c.cyan("--price")}, ${c.cyan("--icon")} or ${c.cyan("--resellable")}.`
|
|
5642
|
+
);
|
|
5634
5643
|
process.exitCode = 1;
|
|
5635
5644
|
return;
|
|
5636
5645
|
}
|
|
@@ -5638,6 +5647,7 @@ async function runShop(opts) {
|
|
|
5638
5647
|
if (!res2.ok) return fail3(res2, "update that item");
|
|
5639
5648
|
const sku = await res2.json();
|
|
5640
5649
|
log.success(`Updated ${c.cyan(sku.name)} \u2014 ${sku.priceCoins} coin.`);
|
|
5650
|
+
if (opts.resellable === false) log.dim(" Listings already on the market stay up.");
|
|
5641
5651
|
return;
|
|
5642
5652
|
}
|
|
5643
5653
|
const res = await call(skuUrl, { method: "DELETE" });
|
|
@@ -20282,6 +20292,9 @@ ${c.bold("Usage")}
|
|
|
20282
20292
|
refusal. "test <id>" gives you a free copy of
|
|
20283
20293
|
your own item: you can't buy from your own game,
|
|
20284
20294
|
so this is how you check the shop works.
|
|
20295
|
+
--resellable lets players resell the item to each
|
|
20296
|
+
other on the market; durable items only, off by
|
|
20297
|
+
default, and --no-resellable turns it back off.
|
|
20285
20298
|
genex model "<prompt>" [options] Generate a 3D model (GLB); prints a public asset URL.
|
|
20286
20299
|
genex sfx "<prompt>" [options] Generate a sound effect (mp3); prints a public asset URL.
|
|
20287
20300
|
genex music "<prompt>" [options] Generate an instrumental music track (mp3); prints a
|
|
@@ -20532,7 +20545,7 @@ ${c.bold("Examples")}
|
|
|
20532
20545
|
genex domain add play.mygame.com
|
|
20533
20546
|
genex domain list
|
|
20534
20547
|
genex shop list
|
|
20535
|
-
genex shop add "Iron Key" --price 100 --type durable
|
|
20548
|
+
genex shop add "Iron Key" --price 100 --type durable --resellable
|
|
20536
20549
|
genex shop set sku_123 --price 200
|
|
20537
20550
|
genex shop test sku_123
|
|
20538
20551
|
genex shop remove sku_123
|
|
@@ -20737,6 +20750,16 @@ function parseArgs(argv) {
|
|
|
20737
20750
|
case "--yes":
|
|
20738
20751
|
parsed.options.yes = true;
|
|
20739
20752
|
break;
|
|
20753
|
+
// A pair rather than one flag taking a value: `--resellable false` reads
|
|
20754
|
+
// as a filename to every shell user who has ever mistyped it, and the two
|
|
20755
|
+
// states have to be distinguishable from ABSENT so `shop set` can leave
|
|
20756
|
+
// the flag alone.
|
|
20757
|
+
case "--resellable":
|
|
20758
|
+
parsed.options.resellable = true;
|
|
20759
|
+
break;
|
|
20760
|
+
case "--no-resellable":
|
|
20761
|
+
parsed.options.resellable = false;
|
|
20762
|
+
break;
|
|
20740
20763
|
case "--list":
|
|
20741
20764
|
parsed.options.list = true;
|
|
20742
20765
|
break;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.8.
|
|
3
|
+
"version": "1.8.1-dev.480",
|
|
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": {
|