diff --git a/contract/shapes.json b/contract/shapes.json index 319005b5..aedc9241 100644 --- a/contract/shapes.json +++ b/contract/shapes.json @@ -18,8 +18,8 @@ "GET /api/v2/character/{id}/files": {"props":{"data":{"items":{"props":{"id":{},"name":{},"kind":{},"size":{},"label":{},"added_by":{"props":{"name":{},"membership":{},"agent":{},"owner":{}},"required":["name","membership","agent","owner"]},"added_at":{}},"required":["id","name","kind","size","label","added_by","added_at"]}}},"required":["data"]}, "GET /api/v2/collective query": {"props":{"limit":{},"cursor":{},"expand":{},"fields":{},"name":{},"name__icontains":{},"supertype":{},"subtype":{},"characters":{},"operator":{},"ids":{},"created_by":{},"as":{},"world":{}},"required":[]}, "GET /api/v2/marker/{id} 410": {"props":{"error":{"props":{"type":{},"code":{},"message":{},"param":{},"doc_url":{},"refusals":{"items":{"props":{"word":{},"stop_reason":{},"output_tokens":{}},"required":["word","stop_reason","output_tokens"]}},"unknown_fields":{"items":{}},"types_with_field":{"props":{},"required":[],"open":true},"allowed_fields":{"items":{}},"limit":{},"reason":{}},"required":["type","code","message","param","doc_url"]},"change_seq":{},"deleted_at":{}},"required":["error","change_seq","deleted_at"]}, - "GET /api/v2/me": {"props":{"world":{"props":{"id":{},"name":{}},"required":["id","name"]},"scope":{},"kind":{},"role":{},"membership":{},"character":{},"lenses":{"items":{}},"lenses_from":{},"x_served_trimmed":{"items":{"const":"lenses"}},"name":{},"front_door":{"props":{"sponsor":{"props":{"id":{},"kind":{},"name":{}},"required":["id","kind","name"]},"sponsor_character":{},"my_character":{},"my_seats":{"items":{"props":{"id":{},"kind":{},"name":{},"character":{}},"required":["id","kind","name","character"]}},"charter":{},"charter_skill":{"items":{}},"charter_element":{"props":{"type":{"const":"law"},"id":{}},"required":["type","id"]},"charter_skill_elements":{"items":{"props":{"type":{"const":"object"},"id":{}},"required":["type","id"]}},"charter_text":{},"charter_text_more":{}},"required":["sponsor","sponsor_character","my_character","my_seats","charter","charter_skill","charter_element","charter_skill_elements","charter_text","charter_text_more"]},"reading_aids":{"props":{"charter":{"props":{"id":{},"type":{"const":"law"},"name":{},"rules":{"items":{}},"skill":{"items":{}}},"required":["id","type","name","rules","skill"]},"guide":{"props":{"id":{},"type":{"const":"construct"},"name":{}},"required":["id","type","name"]},"domains":{"items":{"props":{"id":{},"type":{"const":"construct"},"name":{},"sentence":{},"hubs":{"items":{"props":{"type":{},"id":{}},"required":["type","id"]}}},"required":["id","type","name","sentence","hubs"]}},"strand":{"props":{"narrative":{"props":{"id":{},"type":{"const":"narrative"},"name":{}},"required":["id","type","name"]},"event":{"props":{"id":{},"type":{"const":"event"},"name":{}},"required":["id","type","name"]},"location":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"character":{"props":{"id":{},"type":{"const":"character"},"name":{}},"required":["id","type","name"]},"now":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"same":{}},"required":["narrative","event","location","character","now","same"]}},"required":["charter","guide","domains","strand"]}},"required":["world","scope","kind","role","membership","character","lenses","lenses_from","front_door","reading_aids"]}, - "GET /api/v2/members": {"props":{"data":{"items":{"props":{"id":{},"kind":{},"role":{},"character":{},"status":{},"name":{},"lenses":{"items":{}},"lenses_from":{},"sponsor_member":{},"x_served_trimmed":{"items":{"const":"lenses"}}},"required":["id","kind","role","character","status","lenses","lenses_from"]}}},"required":["data"]}, + "GET /api/v2/me": {"props":{"world":{"props":{"id":{},"name":{}},"required":["id","name"]},"scope":{},"kind":{},"role":{},"membership":{},"character":{},"lenses":{"items":{}},"lenses_from":{},"x_served_trimmed":{"items":{"const":"lenses"}},"name":{},"ends_at":{},"front_door":{"props":{"sponsor":{"props":{"id":{},"kind":{},"name":{}},"required":["id","kind","name"]},"sponsor_character":{},"my_character":{},"my_seats":{"items":{"props":{"id":{},"kind":{},"name":{},"character":{}},"required":["id","kind","name","character"]}},"charter":{},"charter_skill":{"items":{}},"charter_element":{"props":{"type":{"const":"law"},"id":{}},"required":["type","id"]},"charter_skill_elements":{"items":{"props":{"type":{"const":"object"},"id":{}},"required":["type","id"]}},"charter_text":{},"charter_text_more":{}},"required":["sponsor","sponsor_character","my_character","my_seats","charter","charter_skill","charter_element","charter_skill_elements","charter_text","charter_text_more"]},"reading_aids":{"props":{"charter":{"props":{"id":{},"type":{"const":"law"},"name":{},"rules":{"items":{}},"skill":{"items":{}}},"required":["id","type","name","rules","skill"]},"guide":{"props":{"id":{},"type":{"const":"construct"},"name":{}},"required":["id","type","name"]},"domains":{"items":{"props":{"id":{},"type":{"const":"construct"},"name":{},"sentence":{},"hubs":{"items":{"props":{"type":{},"id":{}},"required":["type","id"]}}},"required":["id","type","name","sentence","hubs"]}},"strand":{"props":{"narrative":{"props":{"id":{},"type":{"const":"narrative"},"name":{}},"required":["id","type","name"]},"event":{"props":{"id":{},"type":{"const":"event"},"name":{}},"required":["id","type","name"]},"location":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"character":{"props":{"id":{},"type":{"const":"character"},"name":{}},"required":["id","type","name"]},"now":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"same":{}},"required":["narrative","event","location","character","now","same"]}},"required":["charter","guide","domains","strand"]}},"required":["world","scope","kind","role","membership","character","lenses","lenses_from","front_door","reading_aids"]}, + "GET /api/v2/members": {"props":{"data":{"items":{"props":{"id":{},"kind":{},"role":{},"character":{},"status":{},"name":{},"lenses":{"items":{}},"lenses_from":{},"sponsor_member":{},"ends_at":{},"x_served_trimmed":{"items":{"const":"lenses"}}},"required":["id","kind","role","character","status","lenses","lenses_from"]}}},"required":["data"]}, "GET /api/v2/pin query": {"props":{"limit":{},"cursor":{},"expand":{},"fields":{},"name":{},"name__icontains":{},"supertype":{},"subtype":{},"map":{},"element":{},"ids":{},"created_by":{},"as":{},"world":{}},"required":[]}, "GET /api/v2/public/counts": {"props":{"worlds":{},"public_worlds":{},"elements":{},"kinds":{},"public":{"items":{"props":{"name":{},"address":{},"elements":{}},"required":["name","address","elements"]}},"counted_at":{}},"required":["worlds","public_worlds","elements","kinds","public","counted_at"]}, "GET /api/v2/search": {"$":"SearchResults"}, @@ -37,8 +37,8 @@ "POST /api/v2/bulk request": {"props":{"items":{"items":{"props":{"type":{},"element":{"unsaid":true}},"required":["type","element"]}},"atomic":{},"create_only":{}},"required":["items"]}, "POST /api/v2/character/{id}/files": {"props":{"ticket":{},"upload_url":{},"prefix":{},"key":{},"max_bytes":{},"exp":{},"uses":{"const":1},"issued_to":{"props":{"account":{},"membership":{}},"required":["account","membership"]},"kind":{"const":"file"},"file_id":{}},"required":["ticket","upload_url","prefix","key","max_bytes","exp","uses","issued_to","kind","file_id"]}, "POST /api/v2/character/{id}/files request": {"props":{"name":{},"kind":{},"size":{},"label":{}},"required":["name","kind","size"]}, - "POST /api/v2/join": {"oneOf":[{"title":"AgentJoined","props":{"kind":{"const":"agent"},"world":{"props":{"id":{},"name":{},"description":{}},"required":["id","name","description"]},"seat":{"props":{"id":{},"agent_name":{},"role":{}},"required":["id","role","agent_name"]},"with_character":{},"character":{"props":{"id":{},"name":{}},"required":["id","name"]},"key":{},"pin":{},"base_url":{},"env":{},"next":{"items":{}},"members":{"items":{"props":{"id":{},"kind":{},"role":{},"character":{},"status":{},"name":{},"lenses":{"items":{}},"lenses_from":{},"sponsor_member":{},"x_served_trimmed":{"items":{"const":"lenses"}}},"required":["id","kind","role","character","status","lenses","lenses_from"]}},"front_door":{"props":{"sponsor":{"props":{"id":{},"kind":{},"name":{}},"required":["id","kind","name"]},"sponsor_character":{},"my_character":{},"my_seats":{"items":{"props":{"id":{},"kind":{},"name":{},"character":{}},"required":["id","kind","name","character"]}},"charter":{},"charter_skill":{"items":{}},"charter_element":{"props":{"type":{"const":"law"},"id":{}},"required":["type","id"]},"charter_skill_elements":{"items":{"props":{"type":{"const":"object"},"id":{}},"required":["type","id"]}},"charter_text":{},"charter_text_more":{}},"required":["sponsor","sponsor_character","my_character","my_seats","charter","charter_skill","charter_element","charter_skill_elements","charter_text","charter_text_more"]},"reading_aids":{"props":{"charter":{"props":{"id":{},"type":{"const":"law"},"name":{},"rules":{"items":{}},"skill":{"items":{}}},"required":["id","type","name","rules","skill"]},"guide":{"props":{"id":{},"type":{"const":"construct"},"name":{}},"required":["id","type","name"]},"domains":{"items":{"props":{"id":{},"type":{"const":"construct"},"name":{},"sentence":{},"hubs":{"items":{"props":{"type":{},"id":{}},"required":["type","id"]}}},"required":["id","type","name","sentence","hubs"]}},"strand":{"props":{"narrative":{"props":{"id":{},"type":{"const":"narrative"},"name":{}},"required":["id","type","name"]},"event":{"props":{"id":{},"type":{"const":"event"},"name":{}},"required":["id","type","name"]},"location":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"character":{"props":{"id":{},"type":{"const":"character"},"name":{}},"required":["id","type","name"]},"now":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"same":{}},"required":["narrative","event","location","character","now","same"]}},"required":["charter","guide","domains","strand"]}},"required":["kind","world","seat","with_character","character","key","pin","base_url","env","next","members","front_door","reading_aids"]},{"title":"PlayerJoined","props":{"kind":{"const":"player"},"key":{},"world":{"props":{"id":{},"name":{},"description":{}},"required":["id","name","description"]},"character":{"props":{"id":{},"name":{}},"required":["id","name"]},"role":{"const":"guest"}},"required":["kind","key","world","character","role"]}]}, - "POST /api/v2/join/preview": {"props":{"reader":{},"world":{"props":{"name":{},"description":{}},"required":["name","description"]},"invited_by":{},"note":{},"owner_character":{},"character_name":{},"role":{},"with_character":{},"expires_at":{},"max_uses":{},"uses_left":{},"name_required":{},"characters":{"items":{"props":{"id":{},"name":{},"image_url":{},"taken":{}},"required":["id","name","image_url","taken"]}},"glimpse":{"props":{"picked_by":{},"things":{"items":{"props":{"name":{},"type":{}},"required":["name","type"]}},"links":{"items":{"props":{"from":{},"to":{},"field":{},"label":{}},"required":["from","to","field","label"]}}},"required":["picked_by","things","links"]}},"required":["reader","world","invited_by","note","owner_character","role","with_character","expires_at","glimpse"]}, + "POST /api/v2/join": {"oneOf":[{"title":"AgentJoined","props":{"kind":{"const":"agent"},"world":{"props":{"id":{},"name":{},"description":{}},"required":["id","name","description"]},"seat":{"props":{"id":{},"agent_name":{},"role":{},"ends_at":{}},"required":["id","role","agent_name","ends_at"]},"with_character":{},"character":{"props":{"id":{},"name":{}},"required":["id","name"]},"key":{},"pin":{},"base_url":{},"env":{},"next":{"items":{}},"members":{"items":{"props":{"id":{},"kind":{},"role":{},"character":{},"status":{},"name":{},"lenses":{"items":{}},"lenses_from":{},"sponsor_member":{},"ends_at":{},"x_served_trimmed":{"items":{"const":"lenses"}}},"required":["id","kind","role","character","status","lenses","lenses_from"]}},"front_door":{"props":{"sponsor":{"props":{"id":{},"kind":{},"name":{}},"required":["id","kind","name"]},"sponsor_character":{},"my_character":{},"my_seats":{"items":{"props":{"id":{},"kind":{},"name":{},"character":{}},"required":["id","kind","name","character"]}},"charter":{},"charter_skill":{"items":{}},"charter_element":{"props":{"type":{"const":"law"},"id":{}},"required":["type","id"]},"charter_skill_elements":{"items":{"props":{"type":{"const":"object"},"id":{}},"required":["type","id"]}},"charter_text":{},"charter_text_more":{}},"required":["sponsor","sponsor_character","my_character","my_seats","charter","charter_skill","charter_element","charter_skill_elements","charter_text","charter_text_more"]},"reading_aids":{"props":{"charter":{"props":{"id":{},"type":{"const":"law"},"name":{},"rules":{"items":{}},"skill":{"items":{}}},"required":["id","type","name","rules","skill"]},"guide":{"props":{"id":{},"type":{"const":"construct"},"name":{}},"required":["id","type","name"]},"domains":{"items":{"props":{"id":{},"type":{"const":"construct"},"name":{},"sentence":{},"hubs":{"items":{"props":{"type":{},"id":{}},"required":["type","id"]}}},"required":["id","type","name","sentence","hubs"]}},"strand":{"props":{"narrative":{"props":{"id":{},"type":{"const":"narrative"},"name":{}},"required":["id","type","name"]},"event":{"props":{"id":{},"type":{"const":"event"},"name":{}},"required":["id","type","name"]},"location":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"character":{"props":{"id":{},"type":{"const":"character"},"name":{}},"required":["id","type","name"]},"now":{"props":{"id":{},"type":{"const":"location"},"name":{}},"required":["id","type","name"]},"same":{}},"required":["narrative","event","location","character","now","same"]}},"required":["charter","guide","domains","strand"]}},"required":["kind","world","seat","with_character","character","key","pin","base_url","env","next","members","front_door","reading_aids"]},{"title":"PlayerJoined","props":{"kind":{"const":"player"},"key":{},"world":{"props":{"id":{},"name":{},"description":{}},"required":["id","name","description"]},"character":{"props":{"id":{},"name":{}},"required":["id","name"]},"role":{"const":"guest"}},"required":["kind","key","world","character","role"]}]}, + "POST /api/v2/join/preview": {"props":{"reader":{},"world":{"props":{"name":{},"description":{}},"required":["name","description"]},"invited_by":{},"note":{},"owner_character":{},"character_name":{},"role":{},"with_character":{},"expires_at":{},"visit_days":{},"max_uses":{},"uses_left":{},"name_required":{},"characters":{"items":{"props":{"id":{},"name":{},"image_url":{},"taken":{}},"required":["id","name","image_url","taken"]}},"glimpse":{"props":{"picked_by":{},"things":{"items":{"props":{"name":{},"type":{}},"required":["name","type"]}},"links":{"items":{"props":{"from":{},"to":{},"field":{},"label":{}},"required":["from","to","field","label"]}}},"required":["picked_by","things","links"]}},"required":["reader","world","invited_by","note","owner_character","role","with_character","expires_at","visit_days","glimpse"]}, "POST /api/v2/media/ticket": {"props":{"ticket":{},"upload_url":{},"prefix":{},"max_bytes":{},"exp":{},"uses":{"const":1},"issued_to":{"props":{"account":{},"membership":{}},"required":["account","membership"]}},"required":["ticket","upload_url","prefix","max_bytes","exp","uses","issued_to"]} }, "defs": { diff --git a/package-lock.json b/package-lock.json index fa136592..bb23af3f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,7 +14,7 @@ "starlight-page-actions": "0.7.1" }, "devDependencies": { - "@onlyworlds/sdk": "4.229.0", + "@onlyworlds/sdk": "4.230.0", "typescript": "5.9.3" } }, @@ -1685,9 +1685,9 @@ } }, "node_modules/@onlyworlds/sdk": { - "version": "4.229.0", - "resolved": "https://registry.npmjs.org/@onlyworlds/sdk/-/sdk-4.229.0.tgz", - "integrity": "sha512-Eg1qVUxG4haHRUjPsGogYbM4EvmIIYpZs1rttPhOo/Lg0O4NPxq1vN+v+iQSSxik9kqhwFNcBjho22TFHq0zsA==", + "version": "4.230.0", + "resolved": "https://registry.npmjs.org/@onlyworlds/sdk/-/sdk-4.230.0.tgz", + "integrity": "sha512-zqT8tdgTxFL+IaziWs9nf2bHUxM039R1zBpovkOnF3EtMReorTf0+uLy93JEmLZXjMFg9IK/XofEhVbdEq5bUw==", "dev": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 11985e6c..a331a55b 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "starlight-page-actions": "0.7.1" }, "devDependencies": { - "@onlyworlds/sdk": "4.229.0", + "@onlyworlds/sdk": "4.230.0", "typescript": "5.9.3" }, "overrides": { diff --git a/src/content/docs/api/errors/index.mdx b/src/content/docs/api/errors/index.mdx index 6a0b766c..ef58ba00 100644 --- a/src/content/docs/api/errors/index.mdx +++ b/src/content/docs/api/errors/index.mdx @@ -429,7 +429,7 @@ A player opened a player link, a [table](/docs/development/api/members#a-table-o The API key or PIN is missing, unknown or wrong. -- **Common cause:** no `API-Key` header, a mistyped key, or a missing or wrong `API-Pin` on a write. Only a legacy 10-digit key also needs the PIN to read a private world; prefixed keys (`ow_w_`, `ow_r_`) read without it. A deleted world's keys are deleted with it, so they also answer `invalid_credentials`. +- **Common cause:** no `API-Key` header, a mistyped key, or a missing or wrong `API-Pin` on a write. Only a legacy 10-digit key also needs the PIN to read a private world; prefixed keys (`ow_w_`, `ow_r_`) read without it. A deleted world's keys are deleted with it, so they also answer `invalid_credentials`. So does the key of an AI seat whose [visit](/docs/development/api/members#the-roster) has ended (since 2026-12-01), in words of its own: "Your visit to this world has ended, so this key no longer works. Ask the person who invited you for a new link." - **How to fix:** check the `API-Key` and `API-Pin` headers (exact names) and that the key belongs to the world you mean. `param` tells the two apart: `API-Pin` on every PIN refusal, `null` for the key. The one other PIN refusal is a `pin` sent in the body of [`POST /api/v2/account/worlds`](/docs/getting-started/keys#account-tokens) or the hand-over by an account that has one (since 2026-11-07): `param` `pin`, message `Incorrect PIN.`, nothing made. The message then says which: `A PIN is required: send it as API-Pin.` when none was sent, `Incorrect PIN.` when it was wrong, `No valid API-Key.` for the key. A key that reads with `200` but writes with `401` has a wrong PIN: a read checks the PIN only when one is sent, so send it with a read (`GET /api/v2/me`) to test it. For a member's key, `GET /api/v2/me` checks the PIN (or a seat's secret) whenever one is sent; the member's other reads skip it. Keys are minted in the [account portal](https://www.onlyworlds.com/account/). The PIN is a 4-digit number (1000 to 9999) set on your account in [account settings](https://www.onlyworlds.com/account/settings), and it guards writes to every world you own; a member writes with their own account PIN, and an AI seat sends its seat secret (`ow_s_…`) as `API-Pin`. See [Keys and PINs](/docs/getting-started/keys#checking-the-pin). ### key_revoked diff --git a/src/content/docs/docs/changelog.md b/src/content/docs/docs/changelog.md index b9f3115b..20951609 100644 --- a/src/content/docs/docs/changelog.md +++ b/src/content/docs/docs/changelog.md @@ -9,6 +9,7 @@ What changed on onlyworlds.com for everyone is on its own [Changelog](https://ww ## 2026-12-01 +- **[An AI link can be a visit of seven days](/docs/development/api/members#invite-links).** `visit: true` on an AI link makes a seat that ends by itself seven days after the AI joins; every link's row carries `visit`, the [preview](/docs/development/agents#the-join-link) says `visit_days`, and `ends_at` is on the join answer's `seat`, on `GET /api/v2/me` and the MCP server's `get_me` for an AI seat, and on an AI's [roster](/docs/development/api/members#the-roster) row. An ended visit's key answers [`invalid_credentials`](/api/errors/#invalid_credentials) in its own words, and its row reads `active` until the nightly run removes it. [TypeScript](/docs/development/typescript) [4.230.0](https://www.npmjs.com/package/@onlyworlds/sdk) types every key, and `createWorldLink` takes `visit`. - **[The front door](/docs/development/api/members#the-front-door) carries the Charter's own text.** `front_door` on `GET /api/v2/me`, its two `PUT`s and an AI's join answer gains `charter_text`, the Charter's description as reading it serves it to you, whole up to 20,000 characters, and `charter_text_more`, `true` when it was cut; both `null` where `charter` is. The [MCP server](/docs/development/mcp)'s `get_me` carries them too, and its session-start text now says `get_me` first instead of ordering the Charter read. - **[The change feed with a sign-in](/docs/development/api/changes#walking-the-feed).** `GET /api/v2/changes` takes an account token with `?world=` and serves that world's feed as the person's own access there; a game's sign-in reads it too. - **[TypeScript](/docs/development/typescript) [4.229.0](https://www.npmjs.com/package/@onlyworlds/sdk) and [Python](/docs/development/python) [0.160.2](https://pypi.org/project/onlyworlds/): the Charter's text.** `OwFrontDoor` declares `charter_text` and `charter_text_more`, and the SDK's local MCP door on a folder fills them by the same cut. `changes()` and `changesHead()` read the feed on an account token with `world` set. Python's `me()` names the two keys. diff --git a/src/content/docs/docs/development/agents.md b/src/content/docs/docs/development/agents.md index 33ce958a..bd58452d 100644 --- a/src/content/docs/docs/development/agents.md +++ b/src/content/docs/docs/development/agents.md @@ -101,6 +101,7 @@ curl -s -X POST "https://www.onlyworlds.com/api/v2/join/preview" \ "owner_character": "…", "role": "contributor", "with_character": true, + "visit_days": null, "expires_at": "…", "note": null, "glimpse": { @@ -160,7 +161,7 @@ with urllib.request.urlopen(req) as r: | `pin` | The seat's own secret (`ow_s_…`). Send it as `API-Pin` on writes. It is never the world's PIN. | | `character` | `{id, name}`: the agent's own Character in the world, with supertype `Agent`; `null` when the link was made without one. | | `with_character` | `true` when the seat got a Character, `false` when not. | -| `seat` | `{id, role, agent_name}`. | +| `seat` | `{id, role, agent_name, ends_at}`: `ends_at` is when a visit's seat ends (since 2026-12-01; from then its key and PIN stop working, and a new link from the person who invited it is the way back), `null` for a seat that stays until it is removed. | | `world` | `{id, name, description}`. | | `members` | The roster, the new seat included (the rows of [`GET /members`](/docs/development/api/members), as the new seat reads them). | | `front_door` | Who answers for the seat, its Character, and the world's Charter with up to five skill Objects: the same object as on [`GET /me`](/docs/development/api/members#the-front-door). Read the Charter first. | diff --git a/src/content/docs/docs/development/api/members.mdx b/src/content/docs/docs/development/api/members.mdx index e1eb3eca..61fc63e1 100644 --- a/src/content/docs/docs/development/api/members.mdx +++ b/src/content/docs/docs/development/api/members.mdx @@ -61,6 +61,7 @@ curl -s "https://www.onlyworlds.com/api/v2/members" -H "API-Key: {key}" | `lenses` | The [lenses](/docs/development/api/lenses) the row starts with, lens ids in order: the ones it chose, or, when it chose none, the lenses whose `titles` name a Title its Character holds and the row may see (a hidden Title brings a guest or player seat no lens, since 2026-11-13; the owner row: always the owner's own choice); `[]` for none. A lens the calling key cannot see is left out | | `lenses_from` | Where `lenses` comes from: `chosen` (the row's own list, an empty one included), `titles` (it never chose, and its Character's Titles bring these) or `none` (it never chose and nothing brings it a lens: no Character, or Titles that name none; `lenses` is empty). The owner's row and a removed row are always `chosen` | | `sponsor_member` | Agent rows only, to every reader: who answers for this AI, as the sponsor's row `id` on this list, `owner` when the world's owner does, or `null` for a sponsor with no live membership here. Person and player rows carry no `sponsor_member` | +| `ends_at` | AI rows only (since 2026-12-01): when a visiting AI's seat ends, or `null` for a seat that stays until it is removed. A time already past means the visit has ended: its key no longer works, though the row reads `active` until the nightly run removes the seat | | `x_served_trimmed` | Present only when `lenses` was served with a lens left out: then it names `lenses` ([A list trimmed for its reader](/docs/schema/folders#a-list-trimmed-for-its-reader)) | The owner row comes first, then active members in the order they joined, then removed members. Removed members keep their row so every `created_by` and `changed_by` resolves: a member who was removed, who left, or whose account was deleted. A removed row whose account was deleted carries nothing that names the person. The roster never carries email addresses, and a username only to the owner's keys and co-builders: to everyone else a Character is the public face. @@ -300,7 +301,7 @@ Invites and memberships are managed in the [account portal](https://www.onlyworl | GET | `/api/v2/account/worlds/{world_id}/members` | Members and pending invites | | PATCH | `/api/v2/account/worlds/{world_id}/members/{member_id}` | Change a member's `role`, the `character` an agent or player plays, or who answers for an AI seat, `sponsor` (a person who is a member, or `owner`) (owner only; a [hidden](/docs/development/api/hidden#playing-a-hidden-character) Character is `422` [`character_hidden`](/api/errors/#character_hidden); a `character` for an AI seat that follows its member is `422` [`seat_follows_sponsor`](/api/errors/#seat_follows_sponsor); a `role` for an AI seat above the person who answers for it is `422` [`seat_above_sponsor`](/api/errors/#seat_above_sponsor); a `sponsor` sent with a `role` is set first). On an AI seat, `may_change_character` (since 2026-11-16) says whether it may change the Character it plays: `false` gives the Character without that right, `true` or left out gives the right; with `character` it applies to that Character, alone to the one it plays now, and sending the same `character` alone keeps the right as it stands. `true` on a hidden Character is `422` [`character_hidden`](/api/errors/#character_hidden), either value on a seat that follows its member `422` [`seat_follows_sponsor`](/api/errors/#seat_follows_sponsor), and it with `character` `null`, alone on a seat that plays nothing or whose Character is no longer a Character in this world, on a player seat or a person's row, or not a boolean is `422` [`invalid_request`](/api/errors/#invalid_request) (param `may_change_character`). `lenses` sent alone sets a row's lenses, the one change a member makes here on its own row or a seat it answers for | | DELETE | `/api/v2/account/worlds/{world_id}/members/{member_id}` | Remove a member; their keys for the world are deleted (they then answer `401` [`invalid_credentials`](/api/errors/#invalid_credentials), as an unknown key does), and the AI seats they made there are removed with them | -| POST | `/api/v2/account/worlds/{world_id}/links` | Make an [invite link](#invite-links) (owner only): `reader` (`person`, `agent` or `player`, required), `role`, `days`, `inviter_name`, `note` (a person's link only: a note for whoever opens it, at most 500 characters and 8 line breaks, served by the [preview](#invite-links) and never on the link's row; on an AI or player link it is not kept; the note and `inviter_name` refuse control characters, a tab included, and the characters that override or isolate text direction, `422` with `param` the field), `with_character`, `character` on a person's link for one contributor or co-builder (since 2026-11-27: the id of the Character they will play once they join, one that is not hidden, not the world owner's and played by no one; left out, they pick one later; if by then it has been deleted, hidden or taken, they join as if the link named none; refused on a guest's link, a link for more than one person and an AI's link; the link's row carries it as `character` `{id, name}` while it names one, and once used, the one its join set), and for a player `character` (`new` or a Character's id) or, for a [table](#a-table-of-players), `max_uses` (2 to 50) and `characters` (a table takes no `character`), `max_uses` on a person's link (1 to 50; an AI link works once, and `max_uses` on it is `422`, `param` `max_uses`), `preview` (person and player links, off when left out; `true` on an AI link is `422`, `param` `preview`), and `lands_on` on a person's link (where it opens: `site`, the default, is this site's /join page; `dashboard` is the Dashboard's, for someone you invite to work there; either page takes the same code, and `dashboard` on an agent or player link is refused). Every link the routes answer carries `lands_on`, `site` on an agent or player link; `201` with the code, the link and a line to send, shown only in this answer. A world holds at most 50 pending email invites and person and player links that can still be used: a new person or player link counts them together, a new email invite counts the email invites alone (`422`); AI links count with the seats instead {/* limit: link_max_uses pending_invites */} | +| POST | `/api/v2/account/worlds/{world_id}/links` | Make an [invite link](#invite-links) (owner only): `reader` (`person`, `agent` or `player`, required), `role`, `days`, `inviter_name`, `note` (a person's link only: a note for whoever opens it, at most 500 characters and 8 line breaks, served by the [preview](#invite-links) and never on the link's row; on an AI or player link it is not kept; the note and `inviter_name` refuse control characters, a tab included, and the characters that override or isolate text direction, `422` with `param` the field), `visit` (an AI link only, since 2026-12-01: `true` makes it a visit, a seat that ends by itself 7 days after the AI joins; a visit is a guest or a contributor, so with `role` `co_builder` it is refused; every link's row carries `visit`), `with_character`, `character` on a person's link for one contributor or co-builder (since 2026-11-27: the id of the Character they will play once they join, one that is not hidden, not the world owner's and played by no one; left out, they pick one later; if by then it has been deleted, hidden or taken, they join as if the link named none; refused on a guest's link, a link for more than one person and an AI's link; the link's row carries it as `character` `{id, name}` while it names one, and once used, the one its join set), and for a player `character` (`new` or a Character's id) or, for a [table](#a-table-of-players), `max_uses` (2 to 50) and `characters` (a table takes no `character`), `max_uses` on a person's link (1 to 50; an AI link works once, and `max_uses` on it is `422`, `param` `max_uses`), `preview` (person and player links, off when left out; `true` on an AI link is `422`, `param` `preview`), and `lands_on` on a person's link (where it opens: `site`, the default, is this site's /join page; `dashboard` is the Dashboard's, for someone you invite to work there; either page takes the same code, and `dashboard` on an agent or player link is refused). Every link the routes answer carries `lands_on`, `site` on an agent or player link; `201` with the code, the link and a line to send, shown only in this answer. A world holds at most 50 pending email invites and person and player links that can still be used: a new person or player link counts them together, a new email invite counts the email invites alone (`422`); AI links count with the seats instead {/* limit: link_max_uses pending_invites */} | | GET | `/api/v2/account/worlds/{world_id}/links` | The world's links, newest first, never a code, each with `uses` and `status` (`pending`, `used`, `revoked`, `expired`); a table's row adds `max_uses` and `characters` (`[{id, name, taken}]`, `name` `null` if deleted), its `uses` counts the seats it made, removed ones included, and it reads `used` once full | | DELETE | `/api/v2/account/worlds/{world_id}/links/{link_id}` | Revoke a link: `204` | | POST | `/api/v2/account/worlds/{world_id}/seats` | Make a seat for your own AI ([Making a seat](/docs/development/agents#making-a-seat)): `201` with its key and secret, shown once | diff --git a/src/content/docs/docs/development/mcp.md b/src/content/docs/docs/development/mcp.md index 997ca7df..c9ea53ca 100644 --- a/src/content/docs/docs/development/mcp.md +++ b/src/content/docs/docs/development/mcp.md @@ -100,7 +100,7 @@ Every read tool takes an optional `world`. With a key, `world` reads and refuses | Tool | Arguments | Returns | |:--|:--|:--| | `list_worlds` | none | `{data}`: the worlds you can read, the whole list, your own worlds first, then your memberships, each by name (case ignored), then by id; each `{id, slug, name, role, change_seq}`, `role` being `owner` or your membership's role, `slug` the world's public page address or null, and `change_seq` the world's write counter, the number `get_changes` counts from (its `head`). With a key, the key's one world; signed in, every world your account owns or is a member of. | -| `get_me` | `world` | What [`GET /api/v2/me`](/docs/development/api/members#who-am-i) answers for the same credential, built by the same function: `world`, `scope`, `kind`, `role`, `membership`, `character`, `lenses`, `lenses_from`, `front_door` and `reading_aids`, and `name` for an AI or a player seat. Signed in, `scope` is `write` while that sign-in may write in that world, else `read`; what your `role` may change is still the role's. `front_door.charter` is the id of the world's Charter, read with `get_element` type `law`; `front_door.charter_skill` lists the Objects it names. A PIN sent with the key is treated as `GET /me` treats it. | +| `get_me` | `world` | What [`GET /api/v2/me`](/docs/development/api/members#who-am-i) answers for the same credential, built by the same function: `world`, `scope`, `kind`, `role`, `membership`, `character`, `lenses`, `lenses_from`, `front_door` and `reading_aids`, and `name` for an AI or a player seat, and `ends_at` for an AI seat (when its visit ends, `null` for a seat that stays). Signed in, `scope` is `write` while that sign-in may write in that world, else `read`; what your `role` may change is still the role's. `front_door.charter` is the id of the world's Charter, read with `get_element` type `law`; `front_door.charter_skill` lists the Objects it names. A PIN sent with the key is treated as `GET /me` treats it. | | `list_elements` | **`type`**, `name_contains` (case-insensitive substring), `supertype` (the whole word, trimmed and without regard to case, as [the list routes](/docs/development/api/reads#filters) read it; an empty string lists the elements with none), `subtype` (read the same way), `ids` (a list of 1 to 200 element ids: only those), `created_by` (a membership id as `GET /api/v2/members` lists it, or `"owner"`: what that member created), `link` (one object, each key a single-link field of the type, each value an element id or `""` for the elements you are served with none, as [the list routes](/docs/development/api/reads#filters) read it: `link={"map": ""}` on `pin` lists the pins on one map; a key with no member behind it, the owner's own sign-in, a co-builder's, and a contributor's while no element of the world is hidden match the stored link, whatever it names, and for any other key a link to an element it cannot see matches nothing; a Pin's `element` is not one of these, and only the REST Pin list filters by it), `limit` (100, up to 1000), `offset` (0), `include_room` (false), `include_proposed` (false), `fields` (a list of field names, since 2026-11-27: each row then holds only those, with `id`, `type`, `supertype`, `subtype` and the marks `x_review_proposed`, `x_record`, `x_room_of` and `x_charter_of` kept where it has them; a name the type does not have is the API's own refusal, with `allowed_fields`; an extension name passes; an empty list is every field), `world` | `{data, limit, offset, has_more, total, proposed_left_out}`, newest created first; each element in the full `/api/v2/` shape. `total` is how many elements the whole list holds with these arguments, every page together. A [room element](/docs/schema/profiles#room) (`x_room_of`) is left out unless `include_room` is true (the REST list carries it), and so are the world's reading aids, its Charter, Guide and Domains (marked `x_charter_of`). An element an AI seat proposed and no keeper has settled (`x_review_proposed` with a value that is neither `null` nor empty) is left out unless `include_proposed` is true, and `proposed_left_out` counts the ones left out. A row carries [`date_labels`](#dates-in-the-worlds-words) where it has one. | | `count_elements` | `type` (one element type; all if omitted), `name_contains`, `supertype`, `subtype`, `ids`, `created_by`, `link` (only with a `type`), `include_room` (false), `include_proposed` (false), `world` | `{counts, total, proposed_left_out, room_left_out}`: how many elements `list_elements` serves you with the same arguments, every page together; its filters read as there. With no `type`, `counts` names each of the 22 types, 0 included; with a `type`, that type alone. `total` is the sum of `counts`. `room_left_out` is how many room elements and reading aids `include_room` would add, and `proposed_left_out` how many proposed elements `include_proposed` would add, each with the other flag as set; a proposed room element or reading aid is in neither, so everything you may read is `total` with both flags true. An edit held for review is not an element and is in no number. A key counts only what it may read, and a stub counts as one. This is where to ask the size of a world: the descriptions of `get_me`, `list_elements` and `get_changes` send it here, never to a count of the change feed. | | `get_element` | **`type`**, **`id`**, `world` | One element, the body `GET /api/v2/{type}/{id}` serves, with [`date_labels`](#dates-in-the-worlds-words) as its last key where it has one. | diff --git a/src/content/docs/docs/development/typescript.md b/src/content/docs/docs/development/typescript.md index 05d4dcaf..22de3ea8 100644 --- a/src/content/docs/docs/development/typescript.md +++ b/src/content/docs/docs/development/typescript.md @@ -480,7 +480,7 @@ The package also ships `SCHEMA.md` (every field and its meaning, generated) and ## Reference -Generated from the types of `@onlyworlds/sdk` 4.229.0, the version these docs pin. The full declarations ship in the package (`dist/index.d.ts`), with `SCHEMA.md` and `AGENTS.md` beside them. +Generated from the types of `@onlyworlds/sdk` 4.230.0, the version these docs pin. The full declarations ship in the package (`dist/index.d.ts`), with `SCHEMA.md` and `AGENTS.md` beside them. ### Client options @@ -576,7 +576,7 @@ Generated from the types of `@onlyworlds/sdk` 4.229.0, the version these docs pi ### Deprecated names -Every name the package's declarations mark `@deprecated`, read from the same files as the tables above: 22 in 4.229.0. Each row is the mark's own comment, to the sentence that names the version the name leaves in. How much notice a change to the API itself gets: [Stability and deprecation](/docs/development/api/stability). +Every name the package's declarations mark `@deprecated`, read from the same files as the tables above: 22 in 4.230.0. Each row is the mark's own comment, to the sentence that names the version the name leaves in. How much notice a change to the API itself gets: [Stability and deprecation](/docs/development/api/stability). | Name | Deprecated since | Leaves in | What its comment says | |---|---|---|---|