@genex-ai/cli-demo 1.34.5-dev.709 → 1.34.6

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.
@@ -7,10 +7,10 @@ import {
7
7
  isRenderMode,
8
8
  sceneSummary,
9
9
  sheetOf
10
- } from "./chunk-MRV3Q3WU.js";
10
+ } from "./chunk-X5JRCQMK.js";
11
11
  import {
12
12
  getCliVersion
13
- } from "./chunk-AQW7HUPV.js";
13
+ } from "./chunk-44SHBPOT.js";
14
14
 
15
15
  // src/commands/blender-mcp.ts
16
16
  import fs from "fs/promises";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  c,
3
3
  getTemplatesDir
4
- } from "./chunk-AQW7HUPV.js";
4
+ } from "./chunk-44SHBPOT.js";
5
5
 
6
6
  // src/lib/blender-serve.ts
7
7
  import { spawn } from "child_process";
@@ -38,7 +38,7 @@ import fs from "fs";
38
38
  import os from "os";
39
39
  import path from "path";
40
40
  import { fileURLToPath } from "url";
41
- var RAW_CHANNEL = "dev";
41
+ var RAW_CHANNEL = "latest";
42
42
  var CLI_CHANNEL = RAW_CHANNEL === "dev" ? "dev" : "latest";
43
43
  var STANDS = {
44
44
  prod: { api: "https://api.genex.games", dashboard: "https://genex.games" },
@@ -10,7 +10,7 @@ import {
10
10
  getGenexEnvPath,
11
11
  normalizeApiOrigin,
12
12
  originKey
13
- } from "./chunk-AQW7HUPV.js";
13
+ } from "./chunk-44SHBPOT.js";
14
14
 
15
15
  // src/lib/terms.ts
16
16
  import readline from "readline";
package/dist/index.js CHANGED
@@ -42,7 +42,7 @@ import {
42
42
  writeSecretFile,
43
43
  writeUserToken,
44
44
  writeWorkspace
45
- } from "./chunk-MRV3Q3WU.js";
45
+ } from "./chunk-X5JRCQMK.js";
46
46
  import {
47
47
  CLI_CHANNEL,
48
48
  DEFAULT_API_URL,
@@ -63,7 +63,7 @@ import {
63
63
  normalizeApiOrigin,
64
64
  originKey,
65
65
  resolveAgentTargets
66
- } from "./chunk-AQW7HUPV.js";
66
+ } from "./chunk-44SHBPOT.js";
67
67
 
68
68
  // src/instrument.ts
69
69
  import * as Sentry from "@sentry/node";
@@ -22666,7 +22666,7 @@ async function runBlender(opts) {
22666
22666
  return 1;
22667
22667
  }
22668
22668
  if (sub === "serve") {
22669
- const { serveLocalBlender } = await import("./blender-serve-GW3LTFOX.js");
22669
+ const { serveLocalBlender } = await import("./blender-serve-JGKITVP6.js");
22670
22670
  const port = Number(process.env.GENEX_BLENDER_PORT ?? 8088);
22671
22671
  log.step(`Starting a local Blender service on port ${port}`);
22672
22672
  log.plain(
@@ -22675,7 +22675,7 @@ async function runBlender(opts) {
22675
22675
  return serveLocalBlender({ port, log });
22676
22676
  }
22677
22677
  if (sub === "mcp") {
22678
- const { runBlenderMcp } = await import("./blender-mcp-XLEK6SLM.js");
22678
+ const { runBlenderMcp } = await import("./blender-mcp-IPP442XH.js");
22679
22679
  return runBlenderMcp();
22680
22680
  }
22681
22681
  if (sub === "seat") {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/cli-demo",
3
- "version": "1.34.5-dev.709",
3
+ "version": "1.34.6",
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": {
@@ -161,7 +161,7 @@ downloads the game too, binary assets and all:
161
161
 
162
162
  ```bash
163
163
  mkdir my-game && cd my-game
164
- npx @genex-ai/cli-demo@dev link <slug> # slug = the name in the play URL
164
+ npx @genex-ai/cli-demo@latest link <slug> # slug = the name in the play URL
165
165
  npm install
166
166
  ```
167
167
 
@@ -225,7 +225,7 @@ Safe to run any time — genex-owned skills are refreshed to the latest version,
225
225
  and your own files are never touched:
226
226
 
227
227
  ```bash
228
- npx @genex-ai/cli-demo@dev init
228
+ npx @genex-ai/cli-demo@latest init
229
229
  ```
230
230
 
231
231
  Use `--force` only if you intentionally want your own existing files overwritten
@@ -287,188 +287,6 @@ You *can* also just buy your own item, but it costs you the full price and pays
287
287
  you nothing: your share of a sale you funded goes to the platform, never into
288
288
  your own earnings. Use the test grant instead.
289
289
 
290
- ## Generate content during play
291
-
292
- Use `@genex-ai/embed-sdk` 0.21.0+ when a player should generate dialogue,
293
- creature descriptions or other text/JSON inside a game. `initEmbed()` must already
294
- have run (see `$genex-threejs-embed-auth`), and this feature requires signed-in
295
- production play. Keep ordinary gameplay available if runtime generation is off.
296
-
297
- ```ts
298
- import { generate, getGenerationModels } from '@genex-ai/embed-sdk';
299
-
300
- // Load after identity resolves, before wiring the button as available.
301
- const { models } = await getGenerationModels();
302
- const model = models[0];
303
-
304
- generateButton.addEventListener('click', async () => {
305
- if (!model) return;
306
- const result = await generate({
307
- modelId: model.id,
308
- estimateCoins: 5, // Benchmarked fixed price for a started attempt.
309
- prompt: 'Invent a friendly creature. Return a JSON name and color.',
310
- outputFormat: 'json',
311
- schema: {
312
- type: 'object',
313
- properties: { name: { type: 'string' }, color: { type: 'string' } },
314
- required: ['name', 'color'],
315
- additionalProperties: false,
316
- },
317
- allowExternal: true,
318
- });
319
- showBillingReceipt(result); // your game's receipt display, including failed/canceled outcomes
320
- if (result.status === 'succeeded') showCreature(result.output);
321
- });
322
- ```
323
-
324
- Call `generate()` before any await in the click handler. The SDK opens Genex's
325
- trusted modal or popup, showing the game, frozen request, fixed attempt price and
326
- USD equivalent. `estimateCoins` is required (integer 1..1,000,000 for API-backed selections); the player
327
- approves this fixed amount and the game cannot confirm. New `declared-v1`
328
- quotes charge the full price once model work starts, even if usage costs less,
329
- generation fails, is canceled, or reaches its budget limit before a usable result.
330
- Fixed 5 charges 5 even if actual usage would bill 2. No model work means zero; an
331
- unsuccessful attempt with verified zero model cost is also uncharged.
332
- Every Genex API model requires a positive price, including Gemini and GLM;
333
- personal funding in the Genex modal remains zero coin. Unknown
334
- provider expense keeps billing pending and its hold intact. The provider budget
335
- fits inside these coins after the frozen platform tariff. This
336
- compute price is independent of the shop's item grid and pays no developer share.
337
-
338
- Only server-listed OpenRouter models are accepted. The first adapter returns
339
- text/JSON data, not meshes or images. Validate the data before using it and never
340
- execute generated code. Creature appearance or narrative may vary; keep gameplay
341
- stats and rewards governed by game rules rather than a paid random rarity roll.
342
-
343
- `allowExternal: true` offers the configured personal plan matching the selected
344
- model beside coins: Claude for Claude models, ChatGPT for ChatGPT models, and
345
- neither for other model families. The choice belongs only in the trusted Genex approval modal;
346
- never add a "Your Plan" row to the game's model picker. Each uses the player's
347
- own account and plan limits for zero coin, with no paid fallback. Genex freezes
348
- the matching choices and gives connector
349
- instructions; never collect subscription tokens. `source: 'external'` and
350
- `modelProvenance: 'unverified'` mean user-supplied output, not proof of a model
351
- or authority for rewards. Omit `allowExternal` to disable optional personal choices.
352
-
353
- Reuse an `idempotencyKey` for retries of the same operation. If waiting returns
354
- `pending` with `wait_timeout`, persist `generationId`, then use
355
- `getGeneration(id)` or `waitForGeneration(id)` to recover it without another
356
- request. Execution status and billing are separate: results include
357
- `billingStatus: 'pending'|'final'`, `chargedCoins`, `chargedDisplayUsdCents`,
358
- `reservedCoins` and `reservedDisplayUsdCents` when available. A failed/canceled
359
- result is not evidence of a refund. `waitForGeneration()` waits for execution;
360
- read `getGeneration()` again while billing remains pending. Missing receipt
361
- fields mean unavailable, never zero. Native and local-test modes return explicit unsupported errors; mock the
362
- game's rendering separately and verify real payment on a published web game.
363
-
364
- ### Registered multi-step workflows
365
-
366
- Use SDK **0.21.0+** `requestWorkflow()` only when the game already has an
367
- operator-registered Genex workflow and its trusted backend executor. Ordinary
368
- creator API keys cannot register an executor, publish offerings or call its
369
- provider steps. Keep using `generate()` for generic text/JSON requests; do not
370
- invent a workflow ID or build a browser proxy for paid model calls.
371
-
372
- Before enabling the picker, load `getWorkflowOfferings(workflowId)`. Preserve
373
- the selected offering's `id`, `bundleId`, `modelId`, `funding`, `available`,
374
- `estimatedModelUsd`, `priceMultiplier`, `billingPolicy`, `estimatedCoins`,
375
- `estimatedDisplayUsdCents`, `maxCoins` and `maxPriceDisplayUsdCents` through every
376
- catalog projection. Offering `priceCoins`/`priceDisplayUsdCents` are ESTIMATE
377
- aliases. Choose the public fixed `estimateCoins` after server-side development
378
- benchmarks. The quote's `priceCoins` and `maxCoins` equal that fixed attempt
379
- price; `priceDisplayUsdCents` is its USD equivalent. Show both. An unavailable
380
- offering disables checkout. The server still owns the tariff, funding rules,
381
- provider budget and final settlement.
382
-
383
- ```ts
384
- import { requestWorkflow, getEmbedToken } from '@genex-ai/embed-sdk';
385
-
386
- createButton.addEventListener('click', async () => {
387
- // Saved exact input + selected authoritative offering + stable operation key.
388
- const { workflowId, offeringId, input, estimateCoins, idempotencyKey } = pendingCreation;
389
- const approval = await requestWorkflow({ workflowId, offeringId, input, estimateCoins, allowExternal: true, idempotencyKey });
390
- if (approval.generationId) saveGenerationId(approval.generationId);
391
- if (approval.status !== 'authorized' || !approval.generationId) return;
392
- // This is your existing game-backend endpoint, not an SDK helper. The server
393
- // claims the approved run with Genex, binds one durable job, then enqueues it.
394
- await enqueueApprovedWorkflow({
395
- generationId: approval.generationId, embedToken: getEmbedToken(), input,
396
- });
397
- });
398
- ```
399
-
400
- `input` is `{ operation: 'create'|'refactor', description, bundleId, creatureId?,
401
- revisionDigest? }`; refactors require creature identity and revision digest.
402
- Call `requestWorkflow()` before any await in the actual click handler. It
403
- resolves on **approval**, with `status: 'authorized'|'canceled'|'expired'|
404
- 'failed'|'pending'`, optional `generationId`, `funding`, `error` and billing receipt fields. The backend
405
- must claim and enqueue after approval. Waiting for the completed result first
406
- would deadlock. After enqueueing, existing `getGeneration(id)` and
407
- `waitForGeneration(id)` read the result; an authorized replay lets the backend
408
- recover its existing job/artifact without starting a second one.
409
-
410
- New public workflow quotes use `kind: 'fixed'` and
411
- `billingPolicy: 'declared-v1'`. The declared price charges a started attempt,
412
- including failed or canceled work; no model work is zero and unresolved expense
413
- keeps the hold pending. The frozen operator multiplier (2 or 3, default 3) derives
414
- the model budget from the fixed coin price. The budget may stop generation before
415
- a usable result is ready. Only the selected model runs; no fallback.
416
-
417
- Previously issued `consumed-v1` quotes keep their actual-usage billing and
418
- untagged quotes keep original success/refund terms. Never substitute a current
419
- catalog policy for a saved quote. `resumeWorkflow(generationId)` reopens a
420
- saved approval from a click using GET only, with no new price or operation.
421
- Already-approved zero-price API requests retain their terms. An old unconfirmed
422
- zero-price API quote needs a fresh price review before coin approval; never
423
- silently reprice it or launch paid work during recovery.
424
- The trusted UI sends the exact policy acknowledgement. Backend validation and
425
- staging remain required before delivery; the browser cannot submit costs or
426
- settle a bill.
427
-
428
- The public workflow catalog contains paid API/model rows, including
429
- `google/gemini-3.8-flash` and `z-ai/glm-5.3-flash`. Airena sponsors those models
430
- through its own direct OpenRouter path, outside the Genex runtime API.
431
- Personal Claude/ChatGPT funding in the Genex modal costs **0 coins**, but is
432
- not an in-game model option. Do not infer a free API tariff from a low price or a
433
- client flag. Personal choices use the player's own account
434
- through the provider-specific connector shown by Genex: `/player/mcp` for Claude,
435
- `/player/chatgpt/mcp` for ChatGPT. Account/plan limits apply; ChatGPT connector
436
- availability also depends on workspace policy. Genex gives the stage-by-stage
437
- instructions and keeps them open when the SDK returns approval. One external
438
- request may be active per player. Never collect subscription tokens, use the
439
- creator's subscription on a player's behalf, or silently switch to paid API
440
- work. Outputs remain user-supplied and must pass the registered backend's
441
- validation before delivery. Both APIs restrict personal funding to the selected
442
- model's provider; already-approved personal requests keep their connector for recovery.
443
-
444
- Persist the exact input, offering, idempotency key and generation ID through
445
- sign-in, cancellation and reload; never store the embed token. Recovery reads
446
- existing state and never auto-charges. A changed input or expired quote requires
447
- a new intentional request. The Genex workflow API requires signed-in production
448
- play even for personal funding. Keep Airena's separately sponsored direct guest
449
- path separate; do not weaken Genex's paid or session checks.
450
-
451
- ### Calibrate before choosing the public fixed price
452
-
453
- In a trusted Node script or server, import `developmentGenerate` from
454
- `@genex-ai/embed-sdk/development` and pass `{ apiUrl, creatorToken, projectId,
455
- maxCoins, request: { modelId, prompt, outputFormat, schema?, idempotencyKey? } }`.
456
- The full creator credential spends only your own wallet; never put it in a game,
457
- Vite environment or logs. No play token is needed. The browser export is blocked.
458
- Development bills actual usage under `consumed-v1`, including failed work,
459
- within your explicit maximum. A maximum 5 may charge 2. Every API model is
460
- developer-paid at the normal tariff in this lane; personal-only
461
- options are rejected. Inspect the authoritative charged coins/USD and `usage`
462
- cost/unknown-exposure receipt before choosing the public fixed `estimateCoins`.
463
-
464
- Registered workflows use `developmentRequestWorkflow({ apiUrl, creatorToken,
465
- projectId, workflowId, maxCoins, request: { offeringId, input, idempotencyKey? } })`.
466
- It returns the accepted workflow for the trusted executor to enqueue; then use
467
- `waitForDevelopmentGeneration(config, id)`. Read/cancel helpers retain the same
468
- owner/project scope. Timeout leaves the operation intact; pending billing is not
469
- a refund. Ordinary creator credentials cannot register an executor or bypass its
470
- validation.
471
-
472
290
  ## Checklist
473
291
 
474
292
  - [ ] Items exist (`npx genex shop list`) before the shop UI is written
@@ -478,7 +296,6 @@ validation.
478
296
  - [ ] Every price renders `priceDisplayUsdCents` beside the coin figure
479
297
  - [ ] `buy()` is called synchronously inside a click/tap handler
480
298
  - [ ] `canceled` is silent; only real failures show a message
481
- - [ ] Runtime generation shows its authoritative receipt on every outcome; pending holds never imply a refund
482
299
  - [ ] `deliverPending()` runs on every boot, before the player can act
483
300
  - [ ] `consumeEntitlement()` is awaited BEFORE the effect is applied
484
301
  - [ ] `alreadyConsumed: true` skips the effect
@@ -156,66 +156,6 @@ Server write limits (per player, per minute): **60 player-saves, 120
156
156
  world-saves, 30 score submits**. A debounced ~1/sec checkpoint never gets near
157
157
  them — only a save-per-frame loop does (it surfaces as HTTP 429).
158
158
 
159
- Runtime generation (SDK 0.21.0+, signed-in production play, default-off service):
160
-
161
- - `getGenerationModels()` returns configured models and personal providers.
162
- A 404 means this environment has not enabled generation.
163
- - `generate({ estimateCoins, modelId, prompt, outputFormat: 'text' | 'json',
164
- schema?, allowExternal?, idempotencyKey?, timeoutMs? })` returns execution,
165
- output/source on success, and charged/reserved coin plus authoritative USD.
166
- Call directly from a click before any await to reserve its trusted popup.
167
- - Required `estimateCoins` is the fixed price of a started attempt, despite its
168
- name: fixed 5 charges 5 even if usage would cost 2. New `declared-v1` quotes
169
- charge that full price on failure, cancellation or a budget limit after work
170
- starts. No model work is zero; an unsuccessful attempt with verified zero model
171
- cost is also uncharged. A usable result is not guaranteed. Every API
172
- model requires a positive price, including Gemini and GLM. Personal funding
173
- selected in the trusted Genex modal remains zero coin.
174
- - `getGeneration(id)` reads the private player/game-scoped receipt;
175
- `waitForGeneration(id)` waits for execution. A timeout does not cancel.
176
- Keep reading while billing is pending; unknown expense retains the hold and
177
- missing receipt fields never mean zero. Saved consumed/legacy policies remain.
178
-
179
- Registered workflows require an existing trusted, operator-registered executor:
180
-
181
- - `getWorkflowOfferings(workflowId)` supplies model, bundle, availability,
182
- suggested prices and frozen operator tariff. Calibrate the game's fixed price
183
- with development benchmarks, then show coin and USD beside the selected option.
184
- Its public offerings contain paid API/model rows;
185
- personal plan funding appears only in the trusted Genex approval modal.
186
- - `requestWorkflow({ workflowId, offeringId, input, estimateCoins, allowExternal?,
187
- idempotencyKey?, timeoutMs? })` returns **approval**, not completion. Call from
188
- the click, then send its generation ID, exact input and fresh `getEmbedToken()`
189
- to the game backend to claim/enqueue. Waiting for completion first deadlocks it.
190
- - Persist input, declared price, offering, operation key and generation ID across
191
- reloads. Never persist the token or auto-charge on boot. Use
192
- `resumeWorkflow(generationId)` from a click to reopen saved approval through
193
- GET only, preserving pre-0.21 quotes without a replacement price.
194
- Already-approved zero-price API requests retain their terms; an old unconfirmed
195
- zero-price API quote needs a fresh price review before coin approval.
196
- - The server derives the hard model budget from the fixed price after its tariff.
197
- Only the selected model runs. The trusted executor validates staged artifacts;
198
- the browser cannot submit costs, settle a bill or claim delivery.
199
-
200
- Both APIs with `allowExternal: true` can offer a configured personal plan beside
201
- coins: Claude for Claude models, ChatGPT for ChatGPT models, and neither for
202
- other model families. Keep this choice in the trusted Genex approval modal; never
203
- render a "Your Plan" entry in the game's model picker. Each costs zero, uses that
204
- player's own plan limits and never falls back to paid work. Approved personal
205
- requests retain their connector for recovery; historical personal-only offerings
206
- cannot become free coin execution. Submitted results are `source: 'external'` and
207
- `modelProvenance: 'unverified'`; never treat them as authority for rewards.
208
- Genex handles connector setup; games never collect subscription credentials.
209
-
210
- For calibration, server-only `@genex-ai/embed-sdk/development` uses your full
211
- creator bearer credential, owned project and explicit `maxCoins` to benchmark
212
- actual usage against your own wallet, with no production-play token. It uses
213
- `consumed-v1`, including failed work, and returns charged coins, output and
214
- actual/unknown provider cost. All API models are paid at the normal
215
- tariff here; personal-only options are refused. Never bundle a creator credential
216
- or expose it through Vite variables. Read `$genex-monetization` for generic and
217
- registered-workflow examples. Native WebViews and local-test player identity
218
- still cannot use public generation confirmation.
219
159
 
220
160
  ## Saving progress (per-player — every player has their own slot)
221
161
 
@@ -38,7 +38,7 @@ update, so update immediately.)
38
38
  Run exactly the command the nudge printed, from the game project root:
39
39
 
40
40
  ```bash
41
- npm i -D @genex-ai/cli-demo@dev # the genex CLI (a dev dependency)
41
+ npm i -D @genex-ai/cli-demo@latest # the genex CLI (a dev dependency)
42
42
  npm i @genex-ai/embed-sdk@latest # identity/saves SDK (ships inside the game)
43
43
  npm i @genex-ai/multiplayer@latest # multiplayer SDK (only if the game uses it)
44
44
  ```