@genex-ai/cli-demo 1.35.1-dev.748 → 1.35.3-dev.750
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/{blender-mcp-HKT7N5BQ.js → blender-mcp-ATHMMRDU.js} +1 -1
- package/dist/{chunk-FYHYZYBC.js → chunk-2SCXGPZY.js} +1 -1
- package/dist/index.js +444 -213
- package/package.json +1 -1
- package/templates/skills/genex-game-director/SKILL.md +1 -1
- package/templates/skills/genex-llm-in-games/SKILL.md +163 -65
- package/templates/skills/genex-llm-in-games/references/pricing.md +126 -85
- package/templates/skills/genex-tool-llm/SKILL.md +11 -9
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/cli-demo",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.3-dev.750",
|
|
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": {
|
|
@@ -156,7 +156,7 @@ vendored code from memory of another engine.
|
|
|
156
156
|
| sound effect, one looping music bed, or a short spoken line | `$genex-ai-sfx`, `$genex-ai-music`, or `$genex-ai-voice` |
|
|
157
157
|
| requested UI/HUD/menu/interface work, a visible UI problem, or an interface you decided this game wants built with generated art | `$genex-threejs-game-ui` |
|
|
158
158
|
| selling anything for platform coin: a shop, an item catalog, boosts, cosmetics, "make it earn"; also any request for a loot box, gacha, wager, casino mechanic or donation prompt, which that skill refuses and replaces | `$genex-monetization` |
|
|
159
|
-
| the game calls a language model AT RUNTIME on the player's
|
|
159
|
+
| the game calls a language model AT RUNTIME on the player's credits, billed as used under a per-call ceiling the game benchmarks with `npx genex llm bench`: NPCs that answer in their own words, dialogue or quests written per save, a judge reading what the player typed — one-time calls, or a standing budget the player approves once. Check the lane with `npx genex llm models` before designing it in | `$genex-llm-in-games` |
|
|
160
160
|
| cinematic menu/title/pause/victory/defeat/lobby/credits video treatment | `$genex-ai-menu` |
|
|
161
161
|
| drawn HUD chrome the game's style wants—one element or a matched set of frames, masks, and icons | `$genex-ai-hud` |
|
|
162
162
|
| the game works but feels flat, floaty, or unresponsive: input response, camera, impacts, cooldowns, difficulty, fail/retry | `$genex-threejs-game-feel` |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: genex-llm-in-games
|
|
3
|
-
description: Call a language model from inside a running game — an NPC that answers in its own words, a quest written for this save, a judge that reads what the player typed. The PLAYER pays and approves, on a Genex surface the game cannot forge. Covers the two modes (a popup per call, or one standing budget then many silent calls), benchmarking the
|
|
3
|
+
description: Call a language model from inside a running game — an NPC that answers in its own words, a quest written for this save, a judge that reads what the player typed. The PLAYER pays and approves, on a Genex surface the game cannot forge. Covers the two modes (a popup per call, or one standing budget then many silent calls), benchmarking the per-call ceiling before declaring it, the receiver pattern, and honest handling of every refusal.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Genex LLM in Games
|
|
@@ -8,10 +8,11 @@ description: Call a language model from inside a running game — an NPC that an
|
|
|
8
8
|
A Genex game can call a language model **while the player is playing** and get
|
|
9
9
|
back text or JSON. Nothing else: no images, no code execution, no tools.
|
|
10
10
|
|
|
11
|
-
**The player pays, and the player approves.** Funding is
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
11
|
+
**The player pays, and the player approves.** Funding is their Genex credits —
|
|
12
|
+
billed as used, never past the per-call ceiling your game declares — or their
|
|
13
|
+
own Claude / ChatGPT plan, chosen on a Genex-drawn surface your game cannot
|
|
14
|
+
render, skin or bypass. The game holds no provider key, sees no credential, and
|
|
15
|
+
never talks to a model vendor.
|
|
15
16
|
|
|
16
17
|
Two modes. Picking the wrong one is the most expensive mistake on this lane:
|
|
17
18
|
|
|
@@ -31,11 +32,17 @@ the scene on a scale — and not to produce words, ask the grant's classifier wi
|
|
|
31
32
|
`judge()` instead of asking `generate()` for a label. It answers typed questions
|
|
32
33
|
(`choice`, `score`, `noul`) with calibrated probabilities in about a third of a
|
|
33
34
|
second, writes no prose and cannot drift out of your options. It is grant-only
|
|
34
|
-
and billed as used: each call is a small fraction of a
|
|
35
|
+
and billed as used: each call is a small fraction of a credit and accrues on the
|
|
35
36
|
budget, so a check every turn is affordable where a generate every turn is not.
|
|
36
37
|
`generate()` for words, `judge()` for decisions; a feature often wants both —
|
|
37
38
|
the judge picks the branch, generate writes the line.
|
|
38
39
|
|
|
40
|
+
**Words the player watches appear? Stream them.** Dialogue, narration, an NPC's
|
|
41
|
+
reply in a speech bubble: under a grant, `generateStream()` is the same call as
|
|
42
|
+
`generate({ grantId })`, but the text arrives while the model writes it instead
|
|
43
|
+
of all at once after it. Keep `generate()` for answers the game only uses whole
|
|
44
|
+
(a quest object, a list of decisions) — nobody watches those being written.
|
|
45
|
+
|
|
39
46
|
## Step 0 — is the lane live on this stand?
|
|
40
47
|
|
|
41
48
|
```bash
|
|
@@ -72,16 +79,19 @@ identity must be resolved first — `$genex-threejs-embed-auth`.
|
|
|
72
79
|
rest only if the player asks. Each row carries `label`, `vendor`,
|
|
73
80
|
`contextLength`, `personalPlan` and `structuredOutputs`; render `label`
|
|
74
81
|
verbatim, so the name on screen is the model that gets billed.
|
|
75
|
-
- `generate({ modelId, prompt, outputFormat, schema?,
|
|
82
|
+
- `generate({ modelId, prompt, outputFormat, schema?, maxCredits,
|
|
76
83
|
allowExternal?, idempotencyKey?, grantId?, timeoutMs? })` →
|
|
77
84
|
`{ status, generationId, output, source, error }` plus billing fields
|
|
78
|
-
(`billingStatus`, `
|
|
79
|
-
- `
|
|
80
|
-
|
|
85
|
+
(`billingStatus`, `maxCredits`, `reservedCredits`, `chargedCredits`, their
|
|
86
|
+
display-USD twins). `maxCredits` is the call's CEILING, never a price.
|
|
87
|
+
- `requestSpendGrant({ models, perCallMaxCredits, perCallEstimateCredits?,
|
|
88
|
+
disclosure: { periodLabel, estimatedCallsPerPeriod, estimatedCreditsPerPeriod },
|
|
81
89
|
maxConcurrent?, maxCallsPerMinute?, allowExternal?, judge?: { enabled,
|
|
82
90
|
estimatedCallsPerPeriod }, idempotencyKey? })` →
|
|
83
91
|
`{ status, grantId, … the limits the player approved }`; status is `active` |
|
|
84
|
-
`canceled` | `expired` | `failed` | `pending`.
|
|
92
|
+
`canceled` | `expired` | `failed` | `pending`. `perCallEstimateCredits` is the
|
|
93
|
+
honest per-call figure the disclosure is built on; left out, it is the
|
|
94
|
+
ceiling.
|
|
85
95
|
- `judge({ grantId, state, questions, idempotencyKey?, timeoutMs? })` →
|
|
86
96
|
`{ status, generationId, answers, error, billing }` — the grant's classifier,
|
|
87
97
|
answered in the same response. `questions` is 1–64 named `choice`
|
|
@@ -89,6 +99,13 @@ identity must be resolved first — `$genex-threejs-embed-auth`.
|
|
|
89
99
|
(`{ instructions, criteria: [levels, lowest first] }`) or `noul`
|
|
90
100
|
(`{ instructions }`); each answer has its question's type, and `noul` is a
|
|
91
101
|
probability — pick your own threshold. Needs a budget requested with `judge`.
|
|
102
|
+
- `generateStream({ …the generate() options, grantId, onDelta?(text, soFar),
|
|
103
|
+
onPartialField?(name, partialText), signal? })` → the same result as
|
|
104
|
+
`generate()`. Grant-only. `onDelta` hands over each piece and all the text so
|
|
105
|
+
far; for `outputFormat: 'json'`, `onPartialField` reports the schema's FIRST
|
|
106
|
+
top-level string property as far as it is written — put the spoken line first
|
|
107
|
+
in the schema. `signal` stops the reading, never the call (it still finishes
|
|
108
|
+
and is charged).
|
|
92
109
|
- `getSpendGrant(grantId)` — live state and counters; the ONE source for an
|
|
93
110
|
in-game budget readout.
|
|
94
111
|
- `stopSpendGrant(grantId)` — the game's own stop door. Prospective: no further
|
|
@@ -96,13 +113,22 @@ identity must be resolved first — `$genex-threejs-embed-auth`.
|
|
|
96
113
|
- `waitForGeneration(id)` / `getGeneration(id)` — re-attach to a call already
|
|
97
114
|
started, including after a reload.
|
|
98
115
|
- `generationErrorMessage(code)` — one player-facing sentence for an error code.
|
|
116
|
+
- `requestWorkflow(…)` — a registered workflow's own door, unchanged: keep
|
|
117
|
+
sending what that workflow's offerings ask for.
|
|
118
|
+
|
|
119
|
+
The credit names arrived in `@genex-ai/embed-sdk` 0.27.0. On `generate()`,
|
|
120
|
+
`generateStream()` and `requestSpendGrant()` the coin spellings —
|
|
121
|
+
`estimateCoins`, `perCallMaxCoins`, `perCallEstimateCoins` and
|
|
122
|
+
`disclosure.estimatedCoinsPerPeriod` — are deprecated: still accepted, and read
|
|
123
|
+
as the same numbers in credits. Write the credit names in anything new, and
|
|
124
|
+
rename them when you touch old code.
|
|
99
125
|
|
|
100
126
|
```ts
|
|
101
127
|
askButton.addEventListener('click', async () => { // a real click
|
|
102
128
|
const res = await generate({ // FIRST statement, no await before it
|
|
103
129
|
modelId, outputFormat: 'json', schema: ANSWER_SCHEMA,
|
|
104
130
|
prompt: askPrompt(npc, playerLine),
|
|
105
|
-
|
|
131
|
+
maxCredits: NPC_CALL_MAX, // benchmarked — see below
|
|
106
132
|
idempotencyKey: `npc:${npc.id}:${turnId}`,
|
|
107
133
|
});
|
|
108
134
|
applyGeneration(res); // the one writer — see below
|
|
@@ -114,40 +140,55 @@ handler, before any `await`.** The approval popup is reserved synchronously off
|
|
|
114
140
|
the gesture; an `await` in front of it loses the gesture and nothing opens.
|
|
115
141
|
`generate({ grantId })` needs no gesture at all — that is what a grant buys.
|
|
116
142
|
|
|
117
|
-
## `
|
|
143
|
+
## `maxCredits` is a ceiling, not a price
|
|
144
|
+
|
|
145
|
+
The player is billed **as used**: the call's real provider cost plus the
|
|
146
|
+
platform fee, in credits. A one-time call is captured rounded UP to a whole
|
|
147
|
+
credit when it settles; a call under a budget adds its exact fraction to the
|
|
148
|
+
budget, and the player's credits move one whole credit at a time. A failed or
|
|
149
|
+
canceled attempt is billed the work the model did; one with no model work at
|
|
150
|
+
all costs nothing.
|
|
118
151
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
152
|
+
So the game declares no price. It declares a per-call **ceiling** — `maxCredits`
|
|
153
|
+
on `generate()`, `perCallMaxCredits` on a budget — and no call is ever billed
|
|
154
|
+
past it. The ceiling has a second job: **it also decides how long the answer
|
|
155
|
+
may be**, because each call's room to answer is funded from it. A number picked
|
|
156
|
+
by feel either cuts answers off or asks the player to approve far more than a
|
|
157
|
+
call ever costs.
|
|
123
158
|
|
|
124
159
|
**Benchmark, then declare:**
|
|
125
160
|
|
|
126
161
|
```bash
|
|
127
162
|
npx genex llm bench "<the real prompt, with a real example filled in>" \
|
|
128
|
-
--schema ./answer.schema.json --samples 3 --max-
|
|
163
|
+
--schema ./answer.schema.json --samples 3 --max-credits <n> --user-approved
|
|
129
164
|
```
|
|
130
165
|
|
|
131
|
-
It runs on **your own
|
|
132
|
-
sample
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
166
|
+
It runs on **your own credits**, on the development lane, and prints what each
|
|
167
|
+
sample really cost and was charged, then the numbers to declare:
|
|
168
|
+
|
|
169
|
+
- `Declare maxCredits` — the p95 real cost with the platform fee and the
|
|
170
|
+
server's own recommended headroom applied, never below the room the answer's
|
|
171
|
+
length needs. That is `maxCredits` on every call of this prompt.
|
|
172
|
+
- `Grant perCallMaxCredits` — the same over the worst sample. That is a
|
|
173
|
+
budget's `perCallMaxCredits`; declare it verbatim rather than deriving a
|
|
174
|
+
ceiling from the charged `max`, which carries neither the headroom nor the
|
|
175
|
+
answer's length and gets the budget's calls refused.
|
|
176
|
+
- `Per-call estimate: about … credits per call` and
|
|
177
|
+
`Grant perCallEstimateCredits` — the measured average, fee included, and that
|
|
178
|
+
average rounded up to a whole credit: the honest figures a budget's disclosure
|
|
179
|
+
is built on.
|
|
180
|
+
|
|
181
|
+
Declare the printed numbers. Never guess them, never work them out from a
|
|
182
|
+
vendor's price list, never add a margin of your own. Full procedure — reading
|
|
183
|
+
p50/p95, turning the loop into disclosure numbers, re-benchmarking after a
|
|
184
|
+
prompt change — is in [references/pricing.md](references/pricing.md).
|
|
185
|
+
|
|
186
|
+
A sample cut off at your `--max-credits` is not a sample: re-run with a higher
|
|
187
|
+
one. When the bench says the answer is longer than one call on this stand may
|
|
188
|
+
produce, ask for a shorter answer. `--max-coins` is the old name of
|
|
189
|
+
`--max-credits` and still works, with a line saying so.
|
|
190
|
+
|
|
191
|
+
Only samples that **succeeded and settled** are measured. A sample the
|
|
151
192
|
provider refused at its door (`provider_http_<status>`) ran no inference and
|
|
152
193
|
cost nothing; the bench prints the code, the provider's own message and, for a
|
|
153
194
|
401 or 403, that this is the stand's provider configuration refusing the model
|
|
@@ -187,12 +228,12 @@ same object — a schema that passed the bench passes the game.
|
|
|
187
228
|
```ts
|
|
188
229
|
const grant = await requestSpendGrant({ // inside the click handler
|
|
189
230
|
models: [modelId],
|
|
190
|
-
|
|
191
|
-
|
|
231
|
+
perCallMaxCredits: NPC_GRANT_MAX, // the bench's "Grant perCallMaxCredits"
|
|
232
|
+
perCallEstimateCredits: NPC_CALL_ESTIMATE, // its "Grant perCallEstimateCredits"
|
|
192
233
|
disclosure: {
|
|
193
234
|
periodLabel: 'minute',
|
|
194
235
|
estimatedCallsPerPeriod: 10, // 5 NPCs, one decision each per 30s
|
|
195
|
-
|
|
236
|
+
estimatedCreditsPerPeriod: Math.ceil(10 * NPC_CALL_AVERAGE), // calls × the measured average
|
|
196
237
|
},
|
|
197
238
|
maxConcurrent: 2,
|
|
198
239
|
maxCallsPerMinute: 30,
|
|
@@ -204,18 +245,46 @@ await savePlayerState({ ...state, grantId: grant.grantId });
|
|
|
204
245
|
**The disclosure is computed from this game's own loop, never wished for.** Five
|
|
205
246
|
NPCs deciding once every thirty seconds is ten calls a minute — write that
|
|
206
247
|
arithmetic into `DESIGN.md` beside the feature. The player sees your estimate
|
|
207
|
-
attributed to the game, beside the platform's own worst case
|
|
208
|
-
is transparently low is a grant that dies
|
|
248
|
+
attributed to the game, beside the platform's own worst case built from
|
|
249
|
+
`perCallMaxCredits`; an estimate that is transparently low is a grant that dies
|
|
250
|
+
mid-session. Each call under the budget still declares its own `maxCredits`,
|
|
251
|
+
and it may not be above the budget's `perCallMaxCredits`:
|
|
252
|
+
|
|
253
|
+
```
|
|
254
|
+
perCallEstimateCredits ≤ perCallMaxCredits ≤ the limit the player approves
|
|
255
|
+
maxCredits on each call ≤ perCallMaxCredits
|
|
256
|
+
```
|
|
209
257
|
|
|
210
258
|
**Using the judge too?** Add `judge: { enabled: true, estimatedCallsPerPeriod }`
|
|
211
259
|
to the same request — the checks you really expect per `periodLabel`, from the
|
|
212
260
|
same loop arithmetic. The sheet tells the player the game also uses a fast
|
|
213
261
|
classifier billed as used, with the platform's own worst case beside your count.
|
|
214
|
-
A judge-only feature passes `models: []`. A budget with the judge is
|
|
215
|
-
only, and judge calls share the budget's `maxConcurrent` and
|
|
262
|
+
A judge-only feature passes `models: []`. A budget with the judge is paid from
|
|
263
|
+
the player's credits only, and judge calls share the budget's `maxConcurrent` and
|
|
216
264
|
`maxCallsPerMinute`: batch questions into one call (up to 64) rather than one
|
|
217
265
|
call per question.
|
|
218
266
|
|
|
267
|
+
**Streaming a reply under the budget:**
|
|
268
|
+
|
|
269
|
+
```ts
|
|
270
|
+
const res = await generateStream({
|
|
271
|
+
grantId, modelId, outputFormat: 'json', schema: LINE_SCHEMA, // `line` is its first property
|
|
272
|
+
prompt: npcPrompt(npc, playerLine), maxCredits: NPC_CALL_MAX,
|
|
273
|
+
idempotencyKey: `npc:${npc.id}:${turnId}`,
|
|
274
|
+
onPartialField: (_name, soFar) => npc.bubble.show(soFar), // provisional
|
|
275
|
+
});
|
|
276
|
+
applyGeneration(res); // the answer is THIS
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
The pieces are provisional: a call can still fail after text has shown (the
|
|
280
|
+
model broke off, the JSON missed the schema), so the bubble shows them and
|
|
281
|
+
`applyGeneration` decides what the game keeps — the same one writer as always.
|
|
282
|
+
Ceiling, benchmark and receipt are `generate()`'s: a started stream is billed the
|
|
283
|
+
work it did even when the player walks away mid-sentence. A stream holds one
|
|
284
|
+
of the budget's `maxConcurrent` slots until it has settled. Sometimes the reply
|
|
285
|
+
arrives whole — a busy stand, a retried call, a budget on the player's own plan —
|
|
286
|
+
and `onDelta` then gets the whole text once; the game needs no second path.
|
|
287
|
+
|
|
219
288
|
**Then keep the burn low, because you wrote the loop:** batch those five NPCs
|
|
220
289
|
into ONE call returning five decisions, cache a decision until the situation
|
|
221
290
|
that caused it changes, pick the cheapest model that passes your own check, and
|
|
@@ -229,10 +298,10 @@ Grant endings are ordinary game states with in-fiction copy, never an error toas
|
|
|
229
298
|
| `grant_stopped` | the player pressed Stop | accept silently, keep playing |
|
|
230
299
|
| `grant_expired` | 24h passed, or the session ended | as stopped; re-request on the next deliberate click |
|
|
231
300
|
| `waiting_for_plan` | their own plan is rate-limited | wait out the stated time — not a failure, and there is no paid fallback |
|
|
232
|
-
| `grant_insufficient_funds` | the
|
|
301
|
+
| `grant_insufficient_funds` | the player's credits ran out before the next call | pause the thinking NPCs, say it once, stay playable |
|
|
233
302
|
|
|
234
|
-
Draw the readout from `getSpendGrant(grantId)` — calls made,
|
|
235
|
-
remains — never from a counter the game keeps itself. A finished grant may be
|
|
303
|
+
Draw the readout from `getSpendGrant(grantId)` — calls made, credits settled,
|
|
304
|
+
what remains — never from a counter the game keeps itself. A finished grant may be
|
|
236
305
|
re-requested, but only from a **fresh deliberate click**: a silent auto-renew is
|
|
237
306
|
the exact shape a standing approval exists to prevent.
|
|
238
307
|
|
|
@@ -260,18 +329,18 @@ function applyGeneration(res) { // THE only place output becomes game state
|
|
|
260
329
|
`modelProvenance: 'unverified'` because it is user-supplied — check it exactly
|
|
261
330
|
as you would check typed player input.
|
|
262
331
|
|
|
263
|
-
## Errors land on the player's
|
|
332
|
+
## Errors land on the player's credits
|
|
264
333
|
|
|
265
334
|
There is no compensation lane, so this is all work you do before the call:
|
|
266
335
|
|
|
267
|
-
- **Validate inputs first** — a malformed prompt is still
|
|
336
|
+
- **Validate inputs first** — a malformed prompt is still billed.
|
|
268
337
|
- **Always set `schema` for `outputFormat: 'json'`** — unschema'd JSON is the
|
|
269
338
|
commonest way a call is charged and the result is unusable. Write it in the
|
|
270
339
|
accepted dialect above; a refused schema is `invalid_schema` and costs
|
|
271
340
|
nothing, but it is a feature that never runs.
|
|
272
|
-
- **Keep prompts short.** Long context is the
|
|
341
|
+
- **Keep prompts short.** Long context is most of the bill.
|
|
273
342
|
- **Never loop `generate()` without a grant**, and never retry in a loop — each
|
|
274
|
-
attempt is a separate charge.
|
|
343
|
+
attempt is a separate charge, and a one-time call is at least one whole credit.
|
|
275
344
|
- **Map every code through `generationErrorMessage(code)`** into in-fiction
|
|
276
345
|
copy. A player should never read a raw error code inside your game.
|
|
277
346
|
- **`status: 'unknown'` is not a failure.** It means the charge is not known
|
|
@@ -280,12 +349,12 @@ There is no compensation lane, so this is all work you do before the call:
|
|
|
280
349
|
|
|
281
350
|
## What the Genex side already does — do not rebuild it
|
|
282
351
|
|
|
283
|
-
The approval sheet shows the model, the prompt, the
|
|
352
|
+
The approval sheet shows the model, the prompt, the ceiling and the terms; the
|
|
284
353
|
game renders no price sheet. **Subscription funding is chosen only there** —
|
|
285
354
|
never add a "Your plan" row to the game's model picker, because a game cannot
|
|
286
355
|
offer a funding source. When the player's own watcher is online the personal-plan
|
|
287
356
|
answer arrives by itself and the game just waits, exactly as it waits for a
|
|
288
|
-
|
|
357
|
+
credit-funded call. The Genex dashboard header shows progress, active grants with
|
|
289
358
|
their spend, and a Stop; a Stop pressed there reaches the game as `grant_stopped`.
|
|
290
359
|
|
|
291
360
|
## Never
|
|
@@ -296,7 +365,8 @@ their spend, and a Stop; a Stop pressed there reaches the game as `grant_stopped
|
|
|
296
365
|
on your machine, never something a shipped build does.
|
|
297
366
|
- **Never hand-roll fetch to the runtime API** — the SDK owns the approval
|
|
298
367
|
handshake, and a hand-rolled call cannot obtain one.
|
|
299
|
-
- **Never hardcode a
|
|
368
|
+
- **Never hardcode a ceiling the bench did not print, a model id, a stand URL,
|
|
369
|
+
or a margin.**
|
|
300
370
|
- **Never let the model be an authority over money, items or rewards**
|
|
301
371
|
(`$genex-monetization` owns what may move a wallet).
|
|
302
372
|
|
|
@@ -308,13 +378,15 @@ These are source contracts, not a claim that every stand runs this lane —
|
|
|
308
378
|
- [ ] `npx genex llm models` was run and its verdict is in the handoff
|
|
309
379
|
- [ ] Model ids come from `getGenerationModels()`, never from source
|
|
310
380
|
- [ ] The picker offers the featured set, labelled with the server's own `label`
|
|
311
|
-
- [ ] `
|
|
381
|
+
- [ ] `maxCredits` — and a budget's `perCallMaxCredits` / `perCallEstimateCredits` — are the figures `npx genex llm bench` printed, verbatim — never a charged number
|
|
382
|
+
- [ ] No coin spelling (`estimateCoins`, `perCallMaxCoins`, `estimatedCoinsPerPeriod`) in new code
|
|
312
383
|
- [ ] The schema uses only the accepted dialect (no `$ref`, `pattern`, `format`, `anyOf`, `default`)
|
|
313
384
|
- [ ] A bench refused as `generation_limit` was answered with `npx genex llm status`, never a retry
|
|
314
385
|
- [ ] `generate()` / `requestSpendGrant()` is the first statement of a click handler
|
|
315
386
|
- [ ] A repeated-call feature uses a grant; a one-off uses `generate()`
|
|
316
387
|
- [ ] A decision (a label, a yes/no, a level) is a `judge()` question under the grant, not a `generate()` asked for a word
|
|
317
|
-
- [ ]
|
|
388
|
+
- [ ] Dialogue the player watches appear uses `generateStream()` under the grant; the resolved result, not the pieces, goes to `applyGeneration()`
|
|
389
|
+
- [ ] Disclosure numbers derive from the real loop and the bench's measured average, and are written in `DESIGN.md`
|
|
318
390
|
- [ ] Calls are batched and cached; nothing fires on an invisible timer
|
|
319
391
|
- [ ] Every grant-ending code has in-fiction copy and a playable fallback
|
|
320
392
|
- [ ] The in-game readout comes from `getSpendGrant()`
|
|
@@ -334,7 +406,7 @@ and the gesture was lost. Move the call to the first line of the handler.
|
|
|
334
406
|
|
|
335
407
|
**`player_wallet_required`** — ONE code for the two early dead ends: the lane
|
|
336
408
|
refuses a guest and a PREVIEW build on the same line. `waitForPlayer()` tells
|
|
337
|
-
them apart. `guest: true` — guests play but
|
|
409
|
+
them apart. `guest: true` — guests play but have no credits to spend, so show the feature
|
|
338
410
|
as sign-in-to-use rather than hiding it (`$genex-threejs-embed-auth`). Signed
|
|
339
411
|
in and still refused — this is a `genex preview` draft, which never spends:
|
|
340
412
|
check the layout there, and the call itself only after `genex promote`. The
|
|
@@ -342,18 +414,40 @@ SDK's stock sentence for this code is "Sign in to Genex to use this", which is
|
|
|
342
414
|
right for the guest and wrong on a draft, so write the in-fiction line per
|
|
343
415
|
cause rather than showing it for both.
|
|
344
416
|
|
|
345
|
-
**`grant_price_unreasonable`** —
|
|
346
|
-
|
|
417
|
+
**`grant_price_unreasonable`** — a call under the budget declared a `maxCredits`
|
|
418
|
+
above the budget's `perCallMaxCredits` (or a judge call's worst case is above
|
|
419
|
+
it). Declare the bench's `Declare maxCredits` on each call and its
|
|
420
|
+
`Grant perCallMaxCredits` on the budget — the second is never below the first.
|
|
421
|
+
|
|
422
|
+
**`insufficient_credits`** — the player's credits cannot cover this one-time
|
|
423
|
+
call's ceiling. Say it once in-fiction, keep the authored fallback, and never
|
|
424
|
+
retry in a loop; the Genex sheet already offers them a top-up. From
|
|
425
|
+
`npx genex llm bench` it is YOUR balance: the bench prints what it can spend.
|
|
426
|
+
|
|
427
|
+
**`credits_unverified`** — the player's Genex email is not verified, and credits
|
|
428
|
+
pay only for a verified account. Show the feature as verify-to-use rather than
|
|
429
|
+
hiding it; nothing was charged.
|
|
430
|
+
|
|
431
|
+
**`generation_paused`** — the platform has paused paid generation for now. Not
|
|
432
|
+
the game's fault and not the player's: keep the authored fallback, try again
|
|
433
|
+
on a later deliberate click, never in a loop.
|
|
347
434
|
|
|
348
435
|
**`judge_not_enabled`** — the budget was approved without the judge. Request a
|
|
349
436
|
new one with `judge` from the next deliberate click; never auto-renew.
|
|
350
437
|
**`judge_requires_grant`** — the judge's model was sent to `generate()` with no
|
|
351
438
|
budget; the judge is grant-only and is called with `judge()`.
|
|
439
|
+
**`judge_requires_credits`** — a judge call under a budget that is not paid
|
|
440
|
+
from the player's credits (their own plan cannot pay the judge). Request the
|
|
441
|
+
budget with `judge` and let it be credit-funded; keep the authored branch.
|
|
352
442
|
**`judge_period_limit`** — the checks reached the ceiling the player approved for
|
|
353
443
|
the period (your own `estimatedCallsPerPeriod` at the largest size): wait, and
|
|
354
444
|
if it keeps happening your declared rate is too low — fix the loop or the
|
|
355
445
|
estimate, never retry in a tight loop.
|
|
356
446
|
|
|
447
|
+
**`stream_requires_grant`** — `generateStream()` was called without a
|
|
448
|
+
`grantId`. Streaming is grant-only: a one-time call waits on the player's
|
|
449
|
+
approval popup, so use `generate()` for it.
|
|
450
|
+
|
|
357
451
|
**`generation_limit`** — three ad-hoc calls are already in flight for this
|
|
358
452
|
account, or recently stopped with their bill still pending; a pending call
|
|
359
453
|
stops counting ten minutes after it was dispatched. From the bench: run
|
|
@@ -369,9 +463,9 @@ stand's provider configuration refusing the model — tell the operator, and
|
|
|
369
463
|
build nothing around it in the game.
|
|
370
464
|
|
|
371
465
|
**`provider_token_limit`** — the answer was cut off: the model ran out of room
|
|
372
|
-
before it finished, and the attempt is still
|
|
373
|
-
low for the answer's length — re-benchmark and declare what the bench
|
|
374
|
-
never
|
|
466
|
+
before it finished, and the attempt is still billed. The declared `maxCredits`
|
|
467
|
+
is too low for the answer's length — re-benchmark and declare what the bench
|
|
468
|
+
prints, never a charged number — or the answer is longer than one call on this
|
|
375
469
|
stand may produce, and the fix is a shorter answer (fewer fields, shorter
|
|
376
470
|
strings, a length the prompt states).
|
|
377
471
|
|
|
@@ -383,13 +477,17 @@ the subset above; `description` and `title` are allowed.
|
|
|
383
477
|
**`grant_concurrency` / `grant_rate_limited`** — the game calls faster than the
|
|
384
478
|
grant's own limits. Batch and cache; do not raise the limits to hide it.
|
|
385
479
|
|
|
480
|
+
**`payer_busy`** — the player's account was busy on Genex for a moment and
|
|
481
|
+
nothing was charged or started. Retry once after a short pause, from the same
|
|
482
|
+
action; it is not a refusal.
|
|
483
|
+
|
|
386
484
|
**`grant_not_active`** — the saved `grantId` is finished. Clear the stored id
|
|
387
485
|
and re-request from a fresh click.
|
|
388
486
|
|
|
389
487
|
**`external_request_active`** — that player already has one personal-plan
|
|
390
|
-
request running. Wait for it; never fall back to charging
|
|
488
|
+
request running. Wait for it; never fall back to charging credits instead.
|
|
391
489
|
|
|
392
|
-
**The call is
|
|
490
|
+
**The call is billed but the result is unusable** — `outputFormat: 'json'`
|
|
393
491
|
without a `schema`. Add one; the charge already happened.
|
|
394
492
|
|
|
395
493
|
**A reload lost the answer** — `generationId` was not saved before the await, or
|