@genex-ai/embed-sdk 0.34.0 → 0.35.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 +40 -18
- package/dist/{chunk-276FF56N.js → chunk-KEW6LYT2.js} +68 -5
- package/dist/development.d.ts +1 -1
- package/dist/index.d.ts +23 -7
- package/dist/index.js +5 -1
- package/dist/sentry.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -127,6 +127,24 @@ one, and a phone can also drop a backgrounded tab without telling the page:
|
|
|
127
127
|
save as the game goes. A game cannot block the close or ask the player to
|
|
128
128
|
confirm it.
|
|
129
129
|
|
|
130
|
+
## Multiplayer servers
|
|
131
|
+
|
|
132
|
+
After `await waitForPlayer()`, pass these to `@genex-ai/multiplayer`. Read the credential
|
|
133
|
+
fresh at each join (`auth: () => getColyseusAuth()`; tokens rotate) and never log it.
|
|
134
|
+
|
|
135
|
+
- `getColyseusUrls()`: the relay servers, for `connect()` and `matchmake()`.
|
|
136
|
+
- `getAuthorityUrls()` (SDK **0.35.0+**): the server-authoritative room servers, for
|
|
137
|
+
`connectAuthority()`. Empty when the stand serves none.
|
|
138
|
+
- `getAuthorityRegions()`: the same servers by region (`{ region, urls }`), for `connectAuthority()`'s
|
|
139
|
+
`regions`: the nearest region is joined, and each region is its own matchmaking pool. Empty when the
|
|
140
|
+
stand names no regions, and in local test mode.
|
|
141
|
+
|
|
142
|
+
In local test mode both lists are empty and `getColyseusAuth()` is `undefined`, except for a
|
|
143
|
+
local authority server: a loopback page opened with `?genex_authority_url=ws://127.0.0.1:<port>`
|
|
144
|
+
(a plain `ws://` url on `localhost`, `127.0.0.1` or `[::1]`, nothing after the port) gets that
|
|
145
|
+
one url from `getAuthorityUrls()`, and `getColyseusAuth()` answers a fixed local placeholder that
|
|
146
|
+
no real server accepts. Any other value is ignored.
|
|
147
|
+
|
|
130
148
|
## Platform capabilities
|
|
131
149
|
|
|
132
150
|
SDK **0.32.0+**. The browser gives a page different powers in each shell. The
|
|
@@ -254,11 +272,15 @@ and save from `onShellClosing()`. Reading the clipboard is not available: listen
|
|
|
254
272
|
for the `paste` event. Sign-in popups for other services, notifications and
|
|
255
273
|
the tab's title are not available to a framed game.
|
|
256
274
|
|
|
257
|
-
## Request a
|
|
275
|
+
## Request a Nex payment
|
|
258
276
|
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
277
|
+
Nex is Genex's own currency: players buy it with real money and spend it in the
|
|
278
|
+
Genex store (the API and the SDK's fields keep its internal name, coin:
|
|
279
|
+
`amountCoins`, `priceCoins`). SDK **0.33.0+**. Use `requestPayment()` when an
|
|
280
|
+
action needs payment of an amount decided while playing: an extra turn, access
|
|
281
|
+
to a room, a custom upgrade. A fixed-price item is a store item instead (below).
|
|
282
|
+
No product registration or shop card is required. Pass
|
|
283
|
+
the title, optional description and Nex amount; Genex freezes those terms,
|
|
262
284
|
shows its own confirmation with the real-money equivalent, and charges only
|
|
263
285
|
after the player agrees. The game never confirms a charge itself.
|
|
264
286
|
|
|
@@ -365,12 +387,12 @@ for (const item of await getShop()) {
|
|
|
365
387
|
card.onclick = async () => {
|
|
366
388
|
const result = await buy({ skuId: item.id }); // first await in the click
|
|
367
389
|
if (result.status === 'succeeded' || result.status === 'already_owned') await applyOwned();
|
|
368
|
-
if (result.status === 'insufficient_balance')
|
|
390
|
+
if (result.status === 'insufficient_balance') showNotEnoughNex(); // nothing was charged
|
|
369
391
|
};
|
|
370
392
|
}
|
|
371
393
|
```
|
|
372
394
|
|
|
373
|
-
`knowsItem`, `applyItem`, `drawCard` and `
|
|
395
|
+
`knowsItem`, `applyItem`, `drawCard` and `showNotEnoughNex` are your game
|
|
374
396
|
code. `ShopItem` gains optional `description`, `modelUrl`, `tags`, `shared`,
|
|
375
397
|
`homeGame` and `state`; `Entitlement` gains optional `shared`, `iconUrl`,
|
|
376
398
|
`description` and `tags`. An older platform sends none of them, so read each as
|
|
@@ -380,9 +402,9 @@ are `shared` too. `homeGame` is sent for every item, this game's own included:
|
|
|
380
402
|
to tell another game's item, compare `homeGame.slug` with your game's slug (the
|
|
381
403
|
one you passed to `initEmbed`). The player may have bought such an item in
|
|
382
404
|
another game, and this game decides how it looks and what it does. Tags are
|
|
383
|
-
search words, never a type. Show `priceDisplayUsdCents` beside every
|
|
405
|
+
search words, never a type. Show `priceDisplayUsdCents` beside every Nex
|
|
384
406
|
price. `buy()` resolves `already_owned` when the player already owns the item,
|
|
385
|
-
and `insufficient_balance` when they were short of
|
|
407
|
+
and `insufficient_balance` when they were short of Nex at Confirm; nothing is
|
|
386
408
|
charged either way. An SDK before 0.34.0 reports both as `failed`. A durable is
|
|
387
409
|
applied on every boot and never consumed; a consumable is consumed with
|
|
388
410
|
`consumeEntitlement(id)` before its effect is applied, once.
|
|
@@ -513,7 +535,7 @@ email is refused (`credits_unverified`), one short of credits sees
|
|
|
513
535
|
`insufficient_credits`, and Genex may pause paid generation platform-wide
|
|
514
536
|
(`generation_paused`). Personal funding chosen in the trusted approval modal
|
|
515
537
|
costs nothing on Genex. Quotes issued before 0.27's server change — `declared-v1`,
|
|
516
|
-
a fixed
|
|
538
|
+
a fixed Nex price per started attempt — keep their terms.
|
|
517
539
|
|
|
518
540
|
The provider hard budget is derived from that ceiling after the frozen platform
|
|
519
541
|
fee, then capped by operator limits. Output is clipped to remaining funding;
|
|
@@ -523,7 +545,7 @@ must acknowledge the quote's exact `billingPolicy` at confirmation; an old UI
|
|
|
523
545
|
cannot approve new terms. Previously issued `consumed-v1` quotes keep actual-
|
|
524
546
|
usage billing and quotes without a policy keep their original promise.
|
|
525
547
|
Already-approved zero-price API requests retain their saved terms. An old
|
|
526
|
-
unconfirmed zero-price API quote needs a fresh price review before
|
|
548
|
+
unconfirmed zero-price API quote needs a fresh price review before Nex approval;
|
|
527
549
|
never silently replace its price or start a paid request during recovery.
|
|
528
550
|
|
|
529
551
|
With `allowExternal: true`, Genex can offer the configured personal plan matching
|
|
@@ -535,12 +557,12 @@ New quotes freeze the matching choices; connector metadata stays server-owned.
|
|
|
535
557
|
Old unapproved quotes are narrowed to the matching provider before confirmation;
|
|
536
558
|
approved personal requests retain their connector for recovery. Once chosen,
|
|
537
559
|
funding never switches providers or falls back to paid generation. Historical
|
|
538
|
-
personal-only offerings never gain free
|
|
560
|
+
personal-only offerings never gain free Nex execution. Genex neither collects
|
|
539
561
|
nor hosts subscription credentials.
|
|
540
562
|
|
|
541
563
|
`source: 'external'` means user-supplied output, not proof that a particular model
|
|
542
564
|
generated it; `modelProvenance: 'unverified'` makes that explicit. Treat every generated output as data. Never execute returned code
|
|
543
|
-
or use a claimed model/source as authority to mint
|
|
565
|
+
or use a claimed model/source as authority to mint Nex, rewards or items.
|
|
544
566
|
|
|
545
567
|
## Standing budgets
|
|
546
568
|
|
|
@@ -683,7 +705,7 @@ whether a generated thing survives a reload:
|
|
|
683
705
|
One writer, two entry points: the difference between something that works once
|
|
684
706
|
and something that survives a reload. Validate `result.output` against the shape
|
|
685
707
|
your game expects before using it, always. It is data, never authority for
|
|
686
|
-
|
|
708
|
+
Nex, rewards or items.
|
|
687
709
|
|
|
688
710
|
## Streaming replies
|
|
689
711
|
|
|
@@ -843,7 +865,7 @@ operator-registered workflow. This requires the game's trusted server executor;
|
|
|
843
865
|
an ordinary creator API key cannot register a workflow or dispatch its steps.
|
|
844
866
|
**Which wallet a workflow bills is its executor's registration.** An executor
|
|
845
867
|
left on `funding: 'coins'` (every executor registered before credits, by
|
|
846
|
-
default) keeps the fixed-price
|
|
868
|
+
default) keeps the fixed-price Nex terms below: `requestWorkflow()` requires the
|
|
847
869
|
fixed `estimateCoins` price, and offerings and quotes are `declared-v1` with a
|
|
848
870
|
multiplier of 2 or 3. An executor switched to `funding: 'credits'` issues
|
|
849
871
|
`metered-credits-v1` offerings and quotes instead — `estimatedCredits`,
|
|
@@ -900,7 +922,7 @@ persist or log the token.
|
|
|
900
922
|
|
|
901
923
|
On a COIN executor, the catalog's `estimatedCoins` and `priceCoins` are suggested price aliases,
|
|
902
924
|
and its maximum describes operator limits. Choose the game's fixed attempt price
|
|
903
|
-
after development benchmarks, pass it as `estimateCoins`, and show
|
|
925
|
+
after development benchmarks, pass it as `estimateCoins`, and show Nex plus USD.
|
|
904
926
|
The player's final approval always uses the server quote. Preserve the selected
|
|
905
927
|
model, bundle, funding, availability and operator-owned tariff; the game cannot
|
|
906
928
|
change provider prices, dispatch costs or settlement.
|
|
@@ -926,7 +948,7 @@ All API-backed Genex offerings are paid, including `google/gemini-3.8-flash` and
|
|
|
926
948
|
`z-ai/glm-5.3-flash`. Airena's free access to those models is game-funded through
|
|
927
949
|
its own direct OpenRouter path, outside the Genex runtime API.
|
|
928
950
|
Personal Claude/ChatGPT funding choices in the Genex approval modal cost
|
|
929
|
-
**0
|
|
951
|
+
**0 Nex** and use the player's own account through Genex-owned
|
|
930
952
|
MCP connectors. Claude uses `/player/mcp`; ChatGPT uses `/player/chatgpt/mcp`.
|
|
931
953
|
ChatGPT connector availability depends on account and workspace policy. One
|
|
932
954
|
external request may be active per player across both providers. Follow the
|
|
@@ -961,7 +983,7 @@ the subpath is disabled for browser resolution and rejects browser execution.
|
|
|
961
983
|
an explicit positive maximum from your own credits. Development uses
|
|
962
984
|
`metered-credits-v1`: actual model usage plus the Genex fee, rounded up to a
|
|
963
985
|
whole credit per call, including failed usage, up to that maximum (a workflow
|
|
964
|
-
whose executor still bills
|
|
986
|
+
whose executor still bills Nex uses `consumed-v1` on your Nex wallet).
|
|
965
987
|
Gemini/GLM models are paid too. Actual zero cost is free; unknown expense
|
|
966
988
|
remains held. No personal or paid fallback occurs.
|
|
967
989
|
|
|
@@ -1014,7 +1036,7 @@ replaces it — check it before a benchmark, not after.
|
|
|
1014
1036
|
|
|
1015
1037
|
For a registered workflow, call `developmentRequestWorkflow({ apiUrl,
|
|
1016
1038
|
creatorToken, projectId, workflowId, maxCredits, request: { offeringId, input,
|
|
1017
|
-
idempotencyKey? } })` (on a coin executor the same number is its
|
|
1039
|
+
idempotencyKey? } })` (on a coin executor the same number is its Nex cap). It returns the accepted, claimed workflow immediately so
|
|
1018
1040
|
your trusted executor can enqueue it. After enqueueing, call
|
|
1019
1041
|
`waitForDevelopmentGeneration(config, id, timeoutMs?)`. Both generic and workflow
|
|
1020
1042
|
benchmarks are recoverable with `getDevelopmentGeneration(config, id)` and
|
|
@@ -1668,7 +1668,7 @@ var LOCAL_AUTH_FLAG = "genex:embed:local-auth";
|
|
|
1668
1668
|
var ENTRY_REFERRER_MEMO = "genex:embed:entry-referrer";
|
|
1669
1669
|
var ENTRY_REFERRER_NONE = "none";
|
|
1670
1670
|
var PLAYER_ID_KEY = "genex:player";
|
|
1671
|
-
var SDK_VERSION = "0.
|
|
1671
|
+
var SDK_VERSION = "0.35.0";
|
|
1672
1672
|
var config2 = null;
|
|
1673
1673
|
var state = "pending";
|
|
1674
1674
|
var user = null;
|
|
@@ -1680,6 +1680,9 @@ var heartbeatTimer;
|
|
|
1680
1680
|
var nativeBootAt = 0;
|
|
1681
1681
|
var embedToken;
|
|
1682
1682
|
var colyseusUrls;
|
|
1683
|
+
var authorityUrls;
|
|
1684
|
+
var authorityRegions;
|
|
1685
|
+
var localAuthority = false;
|
|
1683
1686
|
var parentOrigin = null;
|
|
1684
1687
|
var shellCaps = [];
|
|
1685
1688
|
var initialized = false;
|
|
@@ -1896,11 +1899,18 @@ function getEmbedToken() {
|
|
|
1896
1899
|
return embedToken;
|
|
1897
1900
|
}
|
|
1898
1901
|
function getColyseusAuth() {
|
|
1902
|
+
if (localAuthority) return { embedToken: LOCAL_AUTHORITY_TOKEN };
|
|
1899
1903
|
return embedToken ? { embedToken } : void 0;
|
|
1900
1904
|
}
|
|
1901
1905
|
function getColyseusUrls() {
|
|
1902
1906
|
return colyseusUrls ?? [];
|
|
1903
1907
|
}
|
|
1908
|
+
function getAuthorityUrls() {
|
|
1909
|
+
return urlList(authorityUrls) ?? [];
|
|
1910
|
+
}
|
|
1911
|
+
function getAuthorityRegions() {
|
|
1912
|
+
return regionList(authorityRegions);
|
|
1913
|
+
}
|
|
1904
1914
|
function waitForAuth() {
|
|
1905
1915
|
if (state === "authenticated" && user) return Promise.resolve({ user });
|
|
1906
1916
|
if (state === "blocked") return Promise.reject(new Error("genex embed auth: blocked"));
|
|
@@ -2580,7 +2590,7 @@ async function redeemTicket(ticket) {
|
|
|
2580
2590
|
if (epoch !== identityEpoch) return;
|
|
2581
2591
|
embedToken = body.embedToken;
|
|
2582
2592
|
user = body.user;
|
|
2583
|
-
|
|
2593
|
+
adoptColyseus(body.colyseus);
|
|
2584
2594
|
state = "authenticated";
|
|
2585
2595
|
if (handshakeTimer !== void 0) clearTimeout(handshakeTimer);
|
|
2586
2596
|
handshakeTimer = void 0;
|
|
@@ -2634,7 +2644,7 @@ async function requestGuestSession() {
|
|
|
2634
2644
|
if (epoch !== identityEpoch) return;
|
|
2635
2645
|
embedToken = body.embedToken;
|
|
2636
2646
|
user = body.user;
|
|
2637
|
-
|
|
2647
|
+
adoptColyseus(body.colyseus);
|
|
2638
2648
|
enterGuest();
|
|
2639
2649
|
} catch (error) {
|
|
2640
2650
|
if (epoch !== identityEpoch) return;
|
|
@@ -2670,11 +2680,47 @@ function enterGuest() {
|
|
|
2670
2680
|
function isLoopbackLocation(w) {
|
|
2671
2681
|
try {
|
|
2672
2682
|
const u = new URL(w.location.origin);
|
|
2673
|
-
return u.protocol === "http:" && (u.hostname
|
|
2683
|
+
return u.protocol === "http:" && LOOPBACK_HOSTNAMES.has(u.hostname);
|
|
2674
2684
|
} catch {
|
|
2675
2685
|
return false;
|
|
2676
2686
|
}
|
|
2677
2687
|
}
|
|
2688
|
+
var LOOPBACK_HOSTNAMES = /* @__PURE__ */ new Set(["localhost", "127.0.0.1", "[::1]"]);
|
|
2689
|
+
var AUTHORITY_URL_PARAM = "genex_authority_url";
|
|
2690
|
+
var LOCAL_AUTHORITY_TOKEN = "local:test";
|
|
2691
|
+
var MAX_AUTHORITY_URL_CHARS = 64;
|
|
2692
|
+
function loopbackAuthorityUrl(raw) {
|
|
2693
|
+
if (!raw || raw.length > MAX_AUTHORITY_URL_CHARS) return null;
|
|
2694
|
+
let u;
|
|
2695
|
+
try {
|
|
2696
|
+
u = new URL(raw);
|
|
2697
|
+
} catch {
|
|
2698
|
+
return null;
|
|
2699
|
+
}
|
|
2700
|
+
const bare = !u.username && !u.password && u.pathname === "/" && !u.search && !u.hash;
|
|
2701
|
+
if (u.protocol !== "ws:" || !LOOPBACK_HOSTNAMES.has(u.hostname) || !bare) return null;
|
|
2702
|
+
return `ws://${u.host}`;
|
|
2703
|
+
}
|
|
2704
|
+
function adoptColyseus(block) {
|
|
2705
|
+
colyseusUrls = block?.urls;
|
|
2706
|
+
authorityUrls = block?.authorityUrls;
|
|
2707
|
+
authorityRegions = block?.authorityRegions;
|
|
2708
|
+
}
|
|
2709
|
+
function urlList(value) {
|
|
2710
|
+
if (!Array.isArray(value)) return void 0;
|
|
2711
|
+
return value.filter((url) => typeof url === "string" && url.length > 0);
|
|
2712
|
+
}
|
|
2713
|
+
function regionList(value) {
|
|
2714
|
+
if (!Array.isArray(value)) return [];
|
|
2715
|
+
const out = [];
|
|
2716
|
+
for (const entry of value) {
|
|
2717
|
+
if (entry === null || typeof entry !== "object") continue;
|
|
2718
|
+
const { region, urls } = entry;
|
|
2719
|
+
const list = urlList(urls) ?? [];
|
|
2720
|
+
if (typeof region === "string" && region.length > 0 && list.length > 0) out.push({ region, urls: list });
|
|
2721
|
+
}
|
|
2722
|
+
return out;
|
|
2723
|
+
}
|
|
2678
2724
|
function wantsLocalTestMode(w, latch = true) {
|
|
2679
2725
|
if (isEmbedded()) return false;
|
|
2680
2726
|
if (detectNativeEntry(w)) return false;
|
|
@@ -2699,6 +2745,7 @@ function hasGenexFragment(w) {
|
|
|
2699
2745
|
function enterLocalTestMode(w) {
|
|
2700
2746
|
localTestMode = true;
|
|
2701
2747
|
readFragment(w);
|
|
2748
|
+
acceptLocalAuthorityUrl(w);
|
|
2702
2749
|
const localUser = { id: "local:test", name: "Local Tester" };
|
|
2703
2750
|
user = localUser;
|
|
2704
2751
|
state = "guest";
|
|
@@ -2712,6 +2759,19 @@ function enterLocalTestMode(w) {
|
|
|
2712
2759
|
for (const waiter of playerWaiters.splice(0)) waiter.resolve({ user: localUser, guest: true });
|
|
2713
2760
|
emit("guest", { user: localUser });
|
|
2714
2761
|
}
|
|
2762
|
+
function acceptLocalAuthorityUrl(w) {
|
|
2763
|
+
if (!isLoopbackLocation(w)) return;
|
|
2764
|
+
let raw = null;
|
|
2765
|
+
try {
|
|
2766
|
+
raw = new URLSearchParams(w.location.search).get(AUTHORITY_URL_PARAM);
|
|
2767
|
+
} catch {
|
|
2768
|
+
return;
|
|
2769
|
+
}
|
|
2770
|
+
const url = loopbackAuthorityUrl(raw);
|
|
2771
|
+
if (!url) return;
|
|
2772
|
+
authorityUrls = [url];
|
|
2773
|
+
localAuthority = true;
|
|
2774
|
+
}
|
|
2715
2775
|
async function handleRedeemFailure() {
|
|
2716
2776
|
const w = win2();
|
|
2717
2777
|
if (handshakeTimer !== void 0) clearTimeout(handshakeTimer);
|
|
@@ -3127,7 +3187,8 @@ function __resetForTests(overrides) {
|
|
|
3127
3187
|
user = null;
|
|
3128
3188
|
localTestMode = false;
|
|
3129
3189
|
embedToken = void 0;
|
|
3130
|
-
|
|
3190
|
+
adoptColyseus(void 0);
|
|
3191
|
+
localAuthority = false;
|
|
3131
3192
|
parentOrigin = null;
|
|
3132
3193
|
shellCaps = [];
|
|
3133
3194
|
initialized = false;
|
|
@@ -3219,6 +3280,8 @@ export {
|
|
|
3219
3280
|
getEmbedToken,
|
|
3220
3281
|
getColyseusAuth,
|
|
3221
3282
|
getColyseusUrls,
|
|
3283
|
+
getAuthorityUrls,
|
|
3284
|
+
getAuthorityRegions,
|
|
3222
3285
|
waitForAuth,
|
|
3223
3286
|
waitForPlayer,
|
|
3224
3287
|
on,
|
package/dist/development.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { R as RuntimeJudgeQuestion, a as RuntimeWorkflowInput, b as RuntimeGener
|
|
|
4
4
|
* Server-only benchmarks spend the authenticated creator's OWN CREDITS
|
|
5
5
|
* (`metered-credits-v1` since SDK 0.27: the real model cost plus the Genex fee,
|
|
6
6
|
* rounded up to a whole credit per call) — or, for a workflow whose executor
|
|
7
|
-
* still bills
|
|
7
|
+
* still bills Nex, their own Nex wallet (`consumed-v1`).
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
10
|
interface DevelopmentGenerationConfig {
|
package/dist/index.d.ts
CHANGED
|
@@ -45,7 +45,7 @@ interface ShopItem {
|
|
|
45
45
|
/**
|
|
46
46
|
* The real-money equivalent, in USD cents, from the server.
|
|
47
47
|
*
|
|
48
|
-
* Show it next to the
|
|
48
|
+
* Show it next to the Nex price (`priceCoins`). It is not decoration: a currency price
|
|
49
49
|
* without its real-world value is the practice consumer regulators single
|
|
50
50
|
* out first, and the platform sends this so a game never has to compute it —
|
|
51
51
|
* or be tempted to omit it.
|
|
@@ -116,8 +116,8 @@ type PurchaseStatus =
|
|
|
116
116
|
/** The confirmation was never completed in time. */
|
|
117
117
|
| 'expired'
|
|
118
118
|
/**
|
|
119
|
-
* The player does not have enough
|
|
120
|
-
* get
|
|
119
|
+
* The player does not have enough Nex; nothing was charged. Offer a way to
|
|
120
|
+
* get Nex. An SDK before 0.34.0 reports it from buy() as `failed`.
|
|
121
121
|
*/
|
|
122
122
|
| 'insufficient_balance'
|
|
123
123
|
/**
|
|
@@ -251,7 +251,8 @@ declare function getPayments(opts?: {
|
|
|
251
251
|
limit?: number;
|
|
252
252
|
}): Promise<PaymentPage>;
|
|
253
253
|
/**
|
|
254
|
-
* Ask the player to approve a dynamic
|
|
254
|
+
* Ask the player to approve a dynamic Nex payment, for an amount decided in
|
|
255
|
+
* play. No catalog item required.
|
|
255
256
|
* Call directly from a click or tap, before any await: standalone games reserve
|
|
256
257
|
* the platform popup synchronously. Only Genex can confirm the charge.
|
|
257
258
|
*
|
|
@@ -318,8 +319,8 @@ interface RuntimeGenerationResult extends RuntimeGenerationBilling {
|
|
|
318
319
|
}
|
|
319
320
|
interface RequestWorkflowOptions {
|
|
320
321
|
/**
|
|
321
|
-
* The operation's ceiling. A workflow whose executor bills
|
|
322
|
-
* for every executor registered before credits) reads it as its fixed
|
|
322
|
+
* The operation's ceiling. A workflow whose executor bills Nex (the default
|
|
323
|
+
* for every executor registered before credits) reads it as its fixed Nex
|
|
323
324
|
* price of a started attempt; one whose executor bills credits reads it as the
|
|
324
325
|
* credit ceiling of a request billed as used. Pass this or `maxCredits`.
|
|
325
326
|
*/
|
|
@@ -995,6 +996,21 @@ declare function getColyseusAuth(): {
|
|
|
995
996
|
/** The relay URLs for this session (server-owned; a regional list when configured). Pass to
|
|
996
997
|
* connect()/matchmake() as `urls` so the SDK joins the lowest-latency one; single-url fallback. */
|
|
997
998
|
declare function getColyseusUrls(): string[];
|
|
999
|
+
/** The server-authoritative room servers for this session (multiplayer PROTOCOL.md §17; separate from
|
|
1000
|
+
* the relay urls, server-owned). Pass to `connectAuthority()` as `urls`. Empty when the stand serves
|
|
1001
|
+
* none. In local test mode it is the loopback `genex_authority_url` the page was opened with (a
|
|
1002
|
+
* `ws://` url on `localhost`, `127.0.0.1` or `[::1]`, on a loopback page), and empty otherwise. */
|
|
1003
|
+
declare function getAuthorityUrls(): string[];
|
|
1004
|
+
/** One region of the server-authoritative cluster: its name and its servers' urls. */
|
|
1005
|
+
type AuthorityRegion = {
|
|
1006
|
+
region: string;
|
|
1007
|
+
urls: string[];
|
|
1008
|
+
};
|
|
1009
|
+
/** The server-authoritative room servers by region (multiplayer PROTOCOL.md §17.1 *Regions*, server-owned).
|
|
1010
|
+
* Pass to `connectAuthority()` as `regions` beside `urls`: the nearest region is joined, and each region
|
|
1011
|
+
* is its own matchmaking pool. Empty when the stand names no regions, and in local test mode; `urls`
|
|
1012
|
+
* alone are then used. Fresh copies: editing them changes nothing. */
|
|
1013
|
+
declare function getAuthorityRegions(): AuthorityRegion[];
|
|
998
1014
|
/**
|
|
999
1015
|
* Resolves with the signed-in ACCOUNT once authenticated; rejects if the
|
|
1000
1016
|
* session ends up blocked. THE gate for /state saves and any account-bound
|
|
@@ -1176,4 +1192,4 @@ declare function __resetForTests(overrides?: {
|
|
|
1176
1192
|
platformConfirmTimeoutMs?: number;
|
|
1177
1193
|
}): void;
|
|
1178
1194
|
|
|
1179
|
-
export { type AppendEventResult, type AuthState, type DeleteSharedResult, type EmbedConfig, type EmbedEntry, type EmbedEvent, type EmbedShell, type EmbedUser, type Entitlement, type GenerateOptions, type GenerateStreamOptions, type HapticKind, ItemState, type JudgeOptions, type JudgeResult, type Leaderboard, type LeaderboardEntry, type PaymentOptions, type PaymentPage, type PaymentReceipt, type PaymentResult, type PaymentStatus, type PlatformError, type PlatformFeature, type PlatformOutcome, type PlayerStateResult, type PurchaseResult, type PurchaseStatus, type PutSharedResult, type RequestWorkflowOptions, RuntimeGenerationBilling, RuntimeGenerationFunding, RuntimeGenerationModels, type RuntimeGenerationResult, RuntimeGenerationView, RuntimeGrantView, RuntimeJudgeAnswer, RuntimeJudgeQuestion, RuntimeJudgmentView, type RuntimeWorkflowAuthorization, RuntimeWorkflowInput, RuntimeWorkflowOfferings, type SaveStateResult, type ShareOptions, type ShareResult, type SharedEventPage, type SharedEventRecord, type SharedObject, type SharedObjectInfo, type SharedPage, type ShopItem, type SpendGrantDisclosure, type SpendGrantOptions, type SpendGrantResult, type SubmitScoreResult, type WorldStateResult, __resetForTests, _stashTicketFromUrl, appendEvent, buy, consumeEntitlement, copyText, deleteShared, generate, generateStream, generationErrorMessage, getActiveSpendGrant, getAuthState, getColyseusAuth, getColyseusUrls, getEmbedToken, getEntitlements, getEntry, getGeneration, getGenerationModels, getLeaderboard, getPayment, getPayments, getShared, getShell, getShop, getSpendGrant, getUser, getWorkflowOfferings, haptic, initEmbed, isEmbedded, judge, keepAwake, listEvents, listShared, loadPlayerState, loadWorldState, on, onShellClosing, openExternal, putShared, requestPayment, requestSpendGrant, requestWorkflow, resumeWorkflow, saveFile, savePlayerState, saveWorldState, setFullscreen, share, stopSpendGrant, submitScore, supports, waitForAuth, waitForGeneration, waitForPlayer };
|
|
1195
|
+
export { type AppendEventResult, type AuthState, type AuthorityRegion, type DeleteSharedResult, type EmbedConfig, type EmbedEntry, type EmbedEvent, type EmbedShell, type EmbedUser, type Entitlement, type GenerateOptions, type GenerateStreamOptions, type HapticKind, ItemState, type JudgeOptions, type JudgeResult, type Leaderboard, type LeaderboardEntry, type PaymentOptions, type PaymentPage, type PaymentReceipt, type PaymentResult, type PaymentStatus, type PlatformError, type PlatformFeature, type PlatformOutcome, type PlayerStateResult, type PurchaseResult, type PurchaseStatus, type PutSharedResult, type RequestWorkflowOptions, RuntimeGenerationBilling, RuntimeGenerationFunding, RuntimeGenerationModels, type RuntimeGenerationResult, RuntimeGenerationView, RuntimeGrantView, RuntimeJudgeAnswer, RuntimeJudgeQuestion, RuntimeJudgmentView, type RuntimeWorkflowAuthorization, RuntimeWorkflowInput, RuntimeWorkflowOfferings, type SaveStateResult, type ShareOptions, type ShareResult, type SharedEventPage, type SharedEventRecord, type SharedObject, type SharedObjectInfo, type SharedPage, type ShopItem, type SpendGrantDisclosure, type SpendGrantOptions, type SpendGrantResult, type SubmitScoreResult, type WorldStateResult, __resetForTests, _stashTicketFromUrl, appendEvent, buy, consumeEntitlement, copyText, deleteShared, generate, generateStream, generationErrorMessage, getActiveSpendGrant, getAuthState, getAuthorityRegions, getAuthorityUrls, getColyseusAuth, getColyseusUrls, getEmbedToken, getEntitlements, getEntry, getGeneration, getGenerationModels, getLeaderboard, getPayment, getPayments, getShared, getShell, getShop, getSpendGrant, getUser, getWorkflowOfferings, haptic, initEmbed, isEmbedded, judge, keepAwake, listEvents, listShared, loadPlayerState, loadWorldState, on, onShellClosing, openExternal, putShared, requestPayment, requestSpendGrant, requestWorkflow, resumeWorkflow, saveFile, savePlayerState, saveWorldState, setFullscreen, share, stopSpendGrant, submitScore, supports, waitForAuth, waitForGeneration, waitForPlayer };
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,8 @@ import {
|
|
|
12
12
|
generationErrorMessage,
|
|
13
13
|
getActiveSpendGrant,
|
|
14
14
|
getAuthState,
|
|
15
|
+
getAuthorityRegions,
|
|
16
|
+
getAuthorityUrls,
|
|
15
17
|
getColyseusAuth,
|
|
16
18
|
getColyseusUrls,
|
|
17
19
|
getEmbedToken,
|
|
@@ -56,7 +58,7 @@ import {
|
|
|
56
58
|
waitForAuth,
|
|
57
59
|
waitForGeneration,
|
|
58
60
|
waitForPlayer
|
|
59
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-KEW6LYT2.js";
|
|
60
62
|
import "./chunk-QBCWKMVQ.js";
|
|
61
63
|
export {
|
|
62
64
|
ItemState,
|
|
@@ -72,6 +74,8 @@ export {
|
|
|
72
74
|
generationErrorMessage,
|
|
73
75
|
getActiveSpendGrant,
|
|
74
76
|
getAuthState,
|
|
77
|
+
getAuthorityRegions,
|
|
78
|
+
getAuthorityUrls,
|
|
75
79
|
getColyseusAuth,
|
|
76
80
|
getColyseusUrls,
|
|
77
81
|
getEmbedToken,
|
package/dist/sentry.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genex-ai/embed-sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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, soft-trust leaderboards, and shared collections and event streams.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|