@onlyworlds/sdk 4.58.0 → 4.60.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/AGENTS.md CHANGED
@@ -64,8 +64,11 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
64
64
  - Allowance (since 4.21.0, account token): `account.allowance()` reads the daily AI allowance
65
65
  without spending: `{ token_rating, tokens_used_today, tokens_remaining, resets_at }`.
66
66
  - Who am I (since 4.22.0, a world key): `client.me()` is `{ world, scope, kind, role,
67
- membership, character }` (`membership` is what `created_by` holds for what you create; null
68
- for the owner); `client.members()` is the roster's rows. An account token is a TypeError.
67
+ membership, character, front_door }` (`membership` is what `created_by` holds for what you
68
+ create; null for the owner); `front_door` (since 4.60.0, keel #558) names who answers for your
69
+ seat (`sponsor`, `sponsor_character`), your Character, and the world's Charter with up to five
70
+ skill Objects: an agent reads `charter` first. `client.members()` is the roster's rows. An
71
+ account token is a TypeError.
69
72
  - Signing in (no key needed): `new OwV2Client().signInWithPassword({ email, password,
70
73
  tokenName })` (or `username`) mints an `ow_a_` account token named for the device and ends
71
74
  the sign-in session; only the token comes back. Refusals: `OwSignInError` with `reason`
@@ -148,4 +151,5 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
148
151
 
149
152
  **Auth**: prefixed keys — `ow_w_` (read+write), `ow_r_` (read-only, no PIN — the share
150
153
  primitive), `ow_a_` (account Bearer). Demo keys `0000000000`–`0000000009` are read-only
151
- test credentials against real data.
154
+ test credentials against real data. A configured `apiPin` is sent only where keel checks it:
155
+ on writes, on `me()`, and on every request of a 10-digit legacy key; other reads go without it.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,19 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.60.0] - 2026-10-22
9
+
10
+ ### Added
11
+
12
+ - **`OwFrontDoor`, and `front_door` on `OwMe` and `OwAgentJoined`** (keel #558, D152, live 2026-10-22 20:1x). `me()`, `setMyCharacter()` and an agent's `redeemJoin()` answer carry the world's front door for the key: `sponsor` (`{id, kind, name}` of the person who answers for a seat, or null), `sponsor_character`, `my_character`, `charter` (the world's Charter, every member's to read: read it first) and `charter_skill` (up to five Objects the Charter names). Every id is one the key may read; anything hidden is null or left out. Types only: the client already passed the body through. Required on both types, as keel's document declares it; a hand-built `OwMe` in a consumer's test needs the field.
13
+
14
+ ## [4.59.0] - 2026-10-22
15
+
16
+ ### Changed
17
+
18
+ - **`API-Pin` is sent only where keel checks it** (Skeld's ruling, OW Keel h29 #10663). keel verifies a PIN wherever one is sent (argon2, 64 MiB each), and on 2026-10-22 scripts reading with the PIN OOM-killed staging on a cold cache after a restart. The client used to send a configured `apiPin` on every request. It now sends it on every request whose method is not GET (every write: elements, links, bulk, adopt, hide and unhide, media and file tickets, seats, world links, proposals, `setMyCharacter`, `mintWorldKey`, `patchWorld`, and any route added later), on `GET /me` (`me()`, the connection test: keel checks a PIN there when sent, keel #314, D93), and on every request of a 10-digit legacy key (v1 parity, keel #421: such a key needs the PIN on reads of a world with a PIN). Any other read from an `ow_w_`, `ow_r_` or member key goes without it; an account token never sent it and still does not. The rule is derived in `request()` from the method and path, so a raw `request()` call follows it too. No API changed.
19
+ - Tests: `test/api-pin.test.mjs`, five, on a recorded fetch: eight reads, `me()` and ten writes across POST, PATCH, PUT and DELETE, for an `ow_w_` key with a PIN, a legacy key with a PIN, an `ow_r_` key with none and an account token with one configured; and raw `request()` GETs to other paths, `/me` and other methods. Two existing tests that expected the PIN on a GET now expect none. Mutants: the PIN on every request again fails four tests; without the `/me` clause, three; without the legacy clause, one.
20
+
8
21
  ## [4.58.0] - 2026-10-22
9
22
 
10
23
  ### Added
package/README.md CHANGED
@@ -165,7 +165,7 @@ await account.revokeWorldLink(worldId, made.id);
165
165
  Once in, a world key can ask who it is and who else is there (since 4.22.0):
166
166
 
167
167
  ```typescript
168
- const me = await client.me(); // { world, scope, kind, role, membership, character }
168
+ const me = await client.me(); // { world, scope, kind, role, membership, character, front_door }: front_door.charter is the house rules, read first
169
169
  const roster = await client.members(); // [{ id, kind, role, character, status }], the owner's id is null
170
170
  ```
171
171
 
package/dist/index.d.ts CHANGED
@@ -2420,8 +2420,36 @@ interface OwMe {
2420
2420
  character: string | null;
2421
2421
  /** Agent seats only: the agent's name. */
2422
2422
  name?: string;
2423
+ /** Who you are here, who answers for you, and the house rules (keel #558). */
2424
+ front_door: OwFrontDoor;
2423
2425
  [k: string]: unknown;
2424
2426
  }
2427
+ /**
2428
+ * A world's front door for one key (keel #558, D152): on `GET /me`, `PUT /me/character` and an
2429
+ * agent's `POST /join` answer. Every id is one the key may read; anything hidden from it, or
2430
+ * outside what its role sees, is null or left out. Read `charter` first.
2431
+ */
2432
+ interface OwFrontDoor {
2433
+ /**
2434
+ * The person who answers for this seat (an AI or a player seat): `id` their membership id
2435
+ * (null for the world's owner), `kind`, and `name` their Character's name (null when they play
2436
+ * none this key can read). Null for the owner's keys, a person's own key, and a seat made from a
2437
+ * link for an email address (which never says whose account the address matched).
2438
+ */
2439
+ sponsor: {
2440
+ id: string | null;
2441
+ kind: 'owner' | 'person';
2442
+ name: string | null;
2443
+ } | null;
2444
+ /** The sponsor's Character, the one to address a message to, or null. */
2445
+ sponsor_character: string | null;
2446
+ /** Your own Character (the owner's: the world's `owner_character`), or null. */
2447
+ my_character: string | null;
2448
+ /** The world's Charter: the newest Law with supertype Charter made by the owner or a co-builder, or null. Every member may read it. */
2449
+ charter: string | null;
2450
+ /** The Objects the Charter's description names (by `ow://` link or id), in the order written, at most five; empty when none. */
2451
+ charter_skill: string[];
2452
+ }
2425
2453
  /** One row of GET /members, the world's roster. */
2426
2454
  interface OwMember {
2427
2455
  /** The membership id (what `created_by` holds), or null for the owner. */
@@ -2558,6 +2586,8 @@ interface OwAgentJoined {
2558
2586
  env: string;
2559
2587
  next: string[];
2560
2588
  members: Array<Record<string, unknown>>;
2589
+ /** The world's front door for the new seat: its sponsor, its Character, the Charter to read first (keel #558). */
2590
+ front_door: OwFrontDoor;
2561
2591
  [k: string]: unknown;
2562
2592
  }
2563
2593
  /** POST /join, a player's code: a read key for a friend with no account, reading as a guest (keel #353). Shown once. */
@@ -2924,8 +2954,11 @@ interface OwClientConfig {
2924
2954
  */
2925
2955
  apiKey?: string;
2926
2956
  /**
2927
- * The PIN, needed for writes when the world has one, and for legacy-key reads of private worlds.
2928
- * Prefixed keys read without a PIN. A string, not a number: '0123' !== 123.
2957
+ * The PIN (or an agent seat's `ow_s_` secret), needed for writes when the world has one, and for
2958
+ * legacy-key reads of a world with a PIN. Sent as `API-Pin` only where keel checks it: on every
2959
+ * write (any method but GET), on GET /me (me(), the connection test), and on every request of a
2960
+ * 10-digit legacy key. A prefixed key's other reads go without it, and an account token never
2961
+ * sends it. A string, not a number: '0123' !== 123.
2929
2962
  */
2930
2963
  apiPin?: string;
2931
2964
  /** The API's base URL, default https://www.onlyworlds.com/api/v2. */
@@ -5127,4 +5160,4 @@ declare class TokenResource {
5127
5160
  getEncryptionInfo(): Promise<EncryptionInfo>;
5128
5161
  }
5129
5162
 
5130
- export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWorldProposalQuery, type OwWorldPublicPage, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, isRoomElement, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, simpleCaseFold, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
5163
+ export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, ELEMENT_FAMILIES, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GameTier, type ListParams, ONLYWORLDS_VERSION, type OwAccountWorld, type OwAgentJoined, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwClientConfig, type OwCreatedWorldLink, type OwDeleteReason, type OwDraught, type OwDraughtComponent, type OwDraughtItem, type OwDraughtPolicy, type OwElement, type OwElementBase, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwHiddenRow, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMe, type OwMediaTicket, type OwMember, type OwMemberRole, type OwMintedKey, OwNetworkError, type OwPage, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwReadWorldFile, type OwReadWorldFileOptions, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwResyncReason, type OwSeat, type OwSeatCreated, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldIndex, type OwWorldLink, type OwWorldMeta, type OwWorldProposalQuery, type OwWorldPublicPage, type OwWriteDoor, PHOTO_MAX_BYTES, PHOTO_TYPES, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, type SectionInfo, type StepBreakdown, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, detectKeyKind, displayYear, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, isAgentDoor, isDemoKey, isKnownOf, isLeapYear, isParseError, isRoomElement, kindCanWrite, lookupWorld, monthStartSteps, parseDate, parseErrorEnvelope, pinExpectation, pkceChallenge, planPhoto, preparePhoto, readCalendarConfig, readCalendarValue, readWorldFile, renderElement, resolveCalendarLens, resolveEraDomains, simpleCaseFold, validateCalendarConfig, weekdayForStep, worldCalendars, writeWorldFile, yearLength, yearStartStep };
package/dist/index.js CHANGED
@@ -1725,7 +1725,9 @@ var OwV2Client = class {
1725
1725
  headers["Authorization"] = `Bearer ${this.apiKey}`;
1726
1726
  } else {
1727
1727
  headers["API-Key"] = this.apiKey;
1728
- if (this.apiPin) headers["API-Pin"] = this.apiPin;
1728
+ const read = method.toUpperCase() === "GET";
1729
+ const me = path === "/me/" || path === "/me";
1730
+ if (this.apiPin && (!read || me || this.keyKind === "legacy")) headers["API-Pin"] = this.apiPin;
1729
1731
  }
1730
1732
  }
1731
1733
  if (opts.body !== void 0) headers["Content-Type"] = "application/json";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.58.0",
3
+ "version": "4.60.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {