@onlyworlds/sdk 4.22.0 → 4.23.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/CHANGELOG.md CHANGED
@@ -5,6 +5,21 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.23.0] — 2026-10-14
9
+
10
+ ### Deprecated
11
+ - **`TokenResource.consume()`, `getAccessKey()`, `revokeSession()`, `revokeAllSessions()`**: keel
12
+ serves none of these routes (each answers 404 `not_found` on production; `accounts/token_api.py`
13
+ mounts only `status/` and `encryption-info/`). Spending is server-side, in the route that does the
14
+ work (the Council's acts through keel's council proxy, keel #274, Skeld's ruling h37 #4632), and
15
+ `OwV2Client.allowance()` reads the token rating. They stay callable and leave in 5.0. A 404 from
16
+ any token route now says what keel serves instead of "an older server". Found by Assembly's wire
17
+ gate, which until now never drove this class (its routes are not in keel's document).
18
+
19
+ ### Changed
20
+ - README and docs: "token rating" is the one word for the account's daily budget (the Captain,
21
+ h37 #4642, OW Infra #273). Names in the API (`allowance()`, `/account/allowance`) are unchanged.
22
+
8
23
  ## [4.22.0] — 2026-10-14
9
24
 
10
25
  ### Added
package/README.md CHANGED
@@ -191,7 +191,7 @@ const { rows, not_proposed } = await account.sort({ worldId, notes: ['Mira moved
191
191
  // rows: make (a new element), add_to (text for a field), link (one element to another), ask (which one?)
192
192
  ```
193
193
 
194
- Asking and sorting spend tokens from the account's daily AI allowance, the same meter the Council uses. Each answer carries `tokens_remaining` and `token_rating`; `allowance()` reads the meter without spending anything (since 4.21.0):
194
+ Asking and sorting spend tokens from the account's token rating, its daily budget, the same meter the Council uses. Each answer carries `tokens_remaining` and `token_rating`; `allowance()` reads the meter without spending anything (since 4.21.0):
195
195
 
196
196
  ```typescript
197
197
  const { token_rating, tokens_remaining, resets_at } = await account.allowance(); // resets_at: the next midnight UTC
@@ -254,7 +254,7 @@ The four colour families (agents, world, abstract, temporal) are checked for col
254
254
 
255
255
  ## Tokens
256
256
 
257
- The account's token allowance and ratings, which some OnlyWorlds tools use.
257
+ The account's token rating, which some OnlyWorlds tools use. `getStatus()` and `getEncryptionInfo()` are what keel still serves under `/tokens/`; `consume()`, `getAccessKey()` and the two session revokes are deprecated (keel answers 404) and leave in 5.0. To read the token rating, prefer `account.allowance()` above.
258
258
 
259
259
  ```typescript
260
260
  import { TokenResource } from '@onlyworlds/sdk';
package/dist/index.d.ts CHANGED
@@ -3438,6 +3438,12 @@ declare enum GameTier {
3438
3438
  * `OwV2Client` (its `request()` is public since 4.0): `new TokenResource(client)`.
3439
3439
  * Wire ruling (2026-07-23): keel keeps the /tokens/* economy long-term
3440
3440
  * (Tangle ratings write it, Council voting reads it) — port, don't delete.
3441
+ * Since then keel mounts only `status/` and `encryption-info/` under /tokens/
3442
+ * (`accounts/token_api.py`; consume, access-key and both revokes answer 404 on
3443
+ * production, 2026-10-14), and spending moved server-side: the Council spends
3444
+ * through keel's council proxy (keel #274, Skeld's ruling h37 #4632), and
3445
+ * `OwV2Client.allowance()` reads the token rating. The four dead methods are
3446
+ * deprecated in 4.23.0 and leave in 5.0.
3441
3447
  */
3442
3448
  interface TokenTransport {
3443
3449
  request<T>(method: string, path: string, opts?: {
@@ -3474,9 +3480,9 @@ declare class TokenResource {
3474
3480
  private client;
3475
3481
  constructor(client: TokenTransport);
3476
3482
  /**
3477
- * All token routes go through here: a 404 on /tokens/* almost always means
3478
- * the SERVER predates the v2 token mount (keel >= 2026-07-23, e181689) —
3479
- * not "user has no tokens". Annotate so the failure reads correctly.
3483
+ * All token routes go through here: a 404 on /tokens/* means keel does not
3484
+ * serve that route, not "user has no tokens". Annotate so the failure reads
3485
+ * correctly.
3480
3486
  */
3481
3487
  private req;
3482
3488
  /**
@@ -3498,6 +3504,10 @@ declare class TokenResource {
3498
3504
  /**
3499
3505
  * Consume tokens for service usage
3500
3506
  *
3507
+ * @deprecated keel serves no consume route (404 on production since 2026-10;
3508
+ * no client decides what its act costs, Skeld's ruling, keel #274): spending
3509
+ * happens server-side in the route that does the work. Removed in 5.0.
3510
+ *
3501
3511
  * Reports token consumption to track daily usage. Allows consumption even if
3502
3512
  * exceeds available tokens (tracks as debt), but warns via error field.
3503
3513
  * Matches base-tool's reportUsage() pattern.
@@ -3527,6 +3537,10 @@ declare class TokenResource {
3527
3537
  /**
3528
3538
  * Get encrypted OpenAI API key (advanced use case)
3529
3539
  *
3540
+ * @deprecated keel serves no access-key route (404 on production since
3541
+ * 2026-10). AI answers come from keel's own proxy: `OwV2Client.ask()` and
3542
+ * `sort()`. Removed in 5.0.
3543
+ *
3530
3544
  * Requires minimum 100 tokens available. Creates a 1-hour session for tracking.
3531
3545
  * Returns encrypted key that must be decrypted client-side using Fernet.
3532
3546
  *
@@ -3554,6 +3568,9 @@ declare class TokenResource {
3554
3568
  /**
3555
3569
  * Revoke a specific token session
3556
3570
  *
3571
+ * @deprecated keel serves no revoke-session route (404 on production since
3572
+ * 2026-10); sessions came from getAccessKey(), which is gone too. Removed in 5.0.
3573
+ *
3557
3574
  * Invalidates the session ID obtained from getAccessKey().
3558
3575
  * Use when cleaning up or on logout.
3559
3576
  *
@@ -3568,6 +3585,9 @@ declare class TokenResource {
3568
3585
  /**
3569
3586
  * Revoke all active sessions (emergency use)
3570
3587
  *
3588
+ * @deprecated keel serves no revoke-all-sessions route (404 on production
3589
+ * since 2026-10). Removed in 5.0.
3590
+ *
3571
3591
  * Invalidates all token sessions for the authenticated user.
3572
3592
  * Use for security cleanup or when sessions are stuck.
3573
3593
  *
package/dist/index.js CHANGED
@@ -2627,16 +2627,16 @@ var TokenResource = class {
2627
2627
  this.client = client;
2628
2628
  }
2629
2629
  /**
2630
- * All token routes go through here: a 404 on /tokens/* almost always means
2631
- * the SERVER predates the v2 token mount (keel >= 2026-07-23, e181689) —
2632
- * not "user has no tokens". Annotate so the failure reads correctly.
2630
+ * All token routes go through here: a 404 on /tokens/* means keel does not
2631
+ * serve that route, not "user has no tokens". Annotate so the failure reads
2632
+ * correctly.
2633
2633
  */
2634
2634
  async req(method, path, opts) {
2635
2635
  try {
2636
2636
  return await this.client.request(method, path, opts);
2637
2637
  } catch (err) {
2638
2638
  if (err && typeof err === "object" && err.status === 404) {
2639
- err.message += " [token routes require keel >= 2026-07-23 (e181689) on /api/v2 \u2014 a 404 here usually means an older server, not zero tokens]";
2639
+ err.message += " [keel serves only /tokens/status/ and /tokens/encryption-info/; this method is deprecated (4.23.0). The token rating: OwV2Client.allowance()]";
2640
2640
  }
2641
2641
  throw err;
2642
2642
  }
@@ -2662,6 +2662,10 @@ var TokenResource = class {
2662
2662
  /**
2663
2663
  * Consume tokens for service usage
2664
2664
  *
2665
+ * @deprecated keel serves no consume route (404 on production since 2026-10;
2666
+ * no client decides what its act costs, Skeld's ruling, keel #274): spending
2667
+ * happens server-side in the route that does the work. Removed in 5.0.
2668
+ *
2665
2669
  * Reports token consumption to track daily usage. Allows consumption even if
2666
2670
  * exceeds available tokens (tracks as debt), but warns via error field.
2667
2671
  * Matches base-tool's reportUsage() pattern.
@@ -2700,6 +2704,10 @@ var TokenResource = class {
2700
2704
  /**
2701
2705
  * Get encrypted OpenAI API key (advanced use case)
2702
2706
  *
2707
+ * @deprecated keel serves no access-key route (404 on production since
2708
+ * 2026-10). AI answers come from keel's own proxy: `OwV2Client.ask()` and
2709
+ * `sort()`. Removed in 5.0.
2710
+ *
2703
2711
  * Requires minimum 100 tokens available. Creates a 1-hour session for tracking.
2704
2712
  * Returns encrypted key that must be decrypted client-side using Fernet.
2705
2713
  *
@@ -2729,6 +2737,9 @@ var TokenResource = class {
2729
2737
  /**
2730
2738
  * Revoke a specific token session
2731
2739
  *
2740
+ * @deprecated keel serves no revoke-session route (404 on production since
2741
+ * 2026-10); sessions came from getAccessKey(), which is gone too. Removed in 5.0.
2742
+ *
2732
2743
  * Invalidates the session ID obtained from getAccessKey().
2733
2744
  * Use when cleaning up or on logout.
2734
2745
  *
@@ -2748,6 +2759,9 @@ var TokenResource = class {
2748
2759
  /**
2749
2760
  * Revoke all active sessions (emergency use)
2750
2761
  *
2762
+ * @deprecated keel serves no revoke-all-sessions route (404 on production
2763
+ * since 2026-10). Removed in 5.0.
2764
+ *
2751
2765
  * Invalidates all token sessions for the authenticated user.
2752
2766
  * Use for security cleanup or when sessions are stuck.
2753
2767
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.22.0",
3
+ "version": "4.23.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {