@genex-ai/embed-sdk 0.28.0 → 0.29.0

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/README.md CHANGED
@@ -8,10 +8,17 @@ for identity and storage.
8
8
 
9
9
  ## Generate during play
10
10
 
11
- Runtime generation requires a signed-in player in a production game and an
11
+ Runtime generation requires a signed-in player in a published game and an
12
12
  enabled Genex runtime service. Each player approves their own payment on Genex.
13
13
  The game never handles an OpenRouter key or confirms a charge itself.
14
14
 
15
+ **Test builds.** On the build `genex preview` ships, the game's OWNER can use
16
+ every call below before any player sees it: the same approval sheet (marked
17
+ "test build"), the same terms, billed to the owner's own credits or plan. Anyone
18
+ else signed in on a test build, and every guest on any build, is refused with
19
+ `player_wallet_required`; `waitForPlayer().guest` tells the two apart, and from
20
+ SDK 0.29.0 `generationErrorMessage('player_wallet_required')` names both.
21
+
15
22
  ```ts
16
23
  import { generate, getGenerationModels } from '@genex-ai/embed-sdk';
17
24
 
@@ -196,8 +203,9 @@ The successful result carries `grantId` and the full server `grant` view.
196
203
 
197
204
  `generate({ grantId })` runs one call under that budget. It opens **no window,
198
205
  posts no parent message and needs no user gesture**, so it works from a game
199
- loop or a timer. Every other guard is unchanged: production play, a signed-in
200
- player, a trusted parent origin, and no native or local-test surface. The
206
+ loop or a timer. Every other guard is unchanged: the published game (or its
207
+ owner on a test build), a signed-in player, a trusted parent origin, and no
208
+ native or local-test surface. The
201
209
  funding door was chosen once in the sheet, so `allowExternal` is ignored on a
202
210
  budget call. Every call is **billed as used on the budget**: its real model
203
211
  cost plus the Genex fee accrues there, and the player's credits move one whole
@@ -804,8 +804,11 @@ function generationErrorMessage(code) {
804
804
  case "no_player_session":
805
805
  case "unauthorized":
806
806
  case "guest_no_wallet":
807
- case "player_wallet_required":
808
807
  return "Sign in to Genex to use this.";
808
+ // ONE code for a guest anywhere and for anybody but the owner on a TEST
809
+ // build (`genex preview`), so the sentence has to be true for both.
810
+ case "player_wallet_required":
811
+ return "Sign in to Genex to use this. Only the game\u2019s owner can use this on a test build.";
809
812
  case "session_revoked":
810
813
  return "Your Genex session ended. Sign in again to continue.";
811
814
  case "untrusted_parent":
@@ -818,7 +821,7 @@ function generationErrorMessage(code) {
818
821
  case "local_test_unsupported":
819
822
  return "In-game generation doesn\u2019t run in local test mode.";
820
823
  case "staging_no_generation":
821
- return "Generation only works in the published game, not in a preview build.";
824
+ return "Only the game\u2019s owner can use this on a test build.";
822
825
  // --- quotes and terms ---------------------------------------------------
823
826
  case "quote_expired":
824
827
  case "generation_expired":
@@ -914,7 +917,7 @@ var RETRY_FLAG = "genex:embed:retry";
914
917
  var POPOVER_DISMISSED_FLAG = "genex:guest:popover-dismissed";
915
918
  var LOCAL_AUTH_FLAG = "genex:embed:local-auth";
916
919
  var PLAYER_ID_KEY = "genex:player";
917
- var SDK_VERSION = "0.28.0";
920
+ var SDK_VERSION = "0.29.0";
918
921
  var config2 = null;
919
922
  var state = "pending";
920
923
  var user = null;
package/dist/index.js CHANGED
@@ -34,7 +34,7 @@ import {
34
34
  waitForAuth,
35
35
  waitForGeneration,
36
36
  waitForPlayer
37
- } from "./chunk-WSJ5XPEF.js";
37
+ } from "./chunk-SJLIF32C.js";
38
38
  import "./chunk-MJPLBT3T.js";
39
39
  export {
40
40
  __resetForTests,
package/dist/sentry.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  _stashTicketFromUrl,
3
3
  getUser,
4
4
  on
5
- } from "./chunk-WSJ5XPEF.js";
5
+ } from "./chunk-SJLIF32C.js";
6
6
  import "./chunk-MJPLBT3T.js";
7
7
 
8
8
  // src/sentry.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@genex-ai/embed-sdk",
3
- "version": "0.28.0",
3
+ "version": "0.29.0",
4
4
  "description": "Player identity + durable game state for genex games \u2014 signed-in or guest play, per-player save slots, shared world state, and soft-trust leaderboards.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",