@onlyworlds/sdk 4.119.0 → 4.120.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 +1 -1
- package/CHANGELOG.md +11 -0
- package/SCHEMA.md +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +13 -9
- package/package.json +1 -1
package/AGENTS.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# For AI agents using @onlyworlds/sdk
|
|
2
2
|
|
|
3
|
-
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.99** (canonical 00.33.00).
|
|
4
4
|
This line is asserted by `codegen:check` in CI — if the pin moves and this file is not
|
|
5
5
|
re-read against it, the check fails rather than letting this document rot quietly.
|
|
6
6
|
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,17 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.120.0] - 2026-10-31
|
|
9
|
+
|
|
10
|
+
### Changed
|
|
11
|
+
|
|
12
|
+
- **A strand begins when its story is chosen** (schema-dist serial 99). `x_strand` needs only `narrative`: `event` and `location` may each be `null` or absent, read as unset, so a world whose story is chosen before its happening and place reads as a strand begun, the story, hero and now filled and the other slots empty. A place named with no event is an empty place. The value is still no mark when `narrative` is missing or not a non-empty string, or when `event` or `location` is anything but a non-empty string, `null` or absent (an empty string, a number, an object), so a broken writer never shows as a half-built strand. `strandOf` reads every case of the serial's 26-case fixture.
|
|
13
|
+
- **The schema pin moves to schema-dist serial 99** (`v0.33.0-dist.99`). No schema file moved.
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **No `X-OW-Agent` on hide, unhide, `setMyCharacter` and `mintWorldKey`.** An `agent: true` client sent the header on these four, where the API document declares none and the server reads none. It now sends it only where the document lists it: the element writes, the links route, `bulk`, `adopt` and the file ticket.
|
|
18
|
+
|
|
8
19
|
## [4.119.0] - 2026-10-30
|
|
9
20
|
|
|
10
21
|
### Added
|
package/SCHEMA.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# OnlyWorlds Schema Reference
|
|
2
2
|
|
|
3
|
-
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.99** — canonical schema **00.33.00**, published 2026-10-30.
|
|
4
4
|
|
|
5
5
|
GENERATED from the canonical schema YAML — do not hand-edit (regenerate: `python codegen/generate_types.py`).
|
|
6
6
|
Written for both humans and AI agents reading this package locally.
|
package/dist/index.d.ts
CHANGED
|
@@ -4809,7 +4809,7 @@ declare class OwV2Client {
|
|
|
4809
4809
|
allowEmpty?: boolean;
|
|
4810
4810
|
replayAware?: boolean;
|
|
4811
4811
|
/** A `change_seq` to send as `If-Match`; a whole number, else TypeError before sending. */
|
|
4812
|
-
/** A write keel's document lists X-OW-Agent on (the element writes,
|
|
4812
|
+
/** A write keel's document lists X-OW-Agent on (the element writes, the links route, bulk, adopt, the file ticket): where an agent client sends it. Hide, unhide, setMyCharacter and mintWorldKey are not, and keel reads no agent there. */
|
|
4813
4813
|
write?: boolean;
|
|
4814
4814
|
/** One of the writes keel reads X-OW-Client on (create, put, patch, delete, links, bulk, adopt, propose, accept): where the client's name goes. */
|
|
4815
4815
|
elementWrite?: boolean;
|
|
@@ -5350,7 +5350,7 @@ declare function domainsOf(world: OwCharterWorld, reader: OwLensReader): OwReadi
|
|
|
5350
5350
|
declare const STRAND_FIELD = "x_strand";
|
|
5351
5351
|
/** The world snapshot a strand is read from: the lens reader's world, the World's mark, and whether it is open to anyone. */
|
|
5352
5352
|
interface OwStrandWorld extends OwLensWorld {
|
|
5353
|
-
/** The mark, `{narrative, event, location}
|
|
5353
|
+
/** The mark, `{narrative, event, location}`: the story's id, the other two ids or unset (null or absent); any other shape is no mark. */
|
|
5354
5354
|
x_strand?: unknown;
|
|
5355
5355
|
/** True for a world open to anyone: only then does the public rung read anything of it. */
|
|
5356
5356
|
open?: boolean | null;
|
|
@@ -5386,8 +5386,10 @@ interface OwStrand {
|
|
|
5386
5386
|
* Character in the reader's view; `now` the hero's `location` when it is a Location in the reader's view, empty when
|
|
5387
5387
|
* the hero is. `same` is true when `now` and `location` are both filled with one id, false when with two, else null.
|
|
5388
5388
|
* A list's order is never read, and no slot is filled from another: not the hero from the event's `characters`, not
|
|
5389
|
-
* `location` from `now`, not `now` from `location`.
|
|
5390
|
-
*
|
|
5389
|
+
* `location` from `now`, not `now` from `location`. Only the story is required: `event` and `location` null or
|
|
5390
|
+
* absent read as unset (a strand begun, its empty slots the next thing to make), and a place with no event is an
|
|
5391
|
+
* empty place. A mark whose `narrative` is not a non-empty string, or whose `event` or `location` is anything but a
|
|
5392
|
+
* non-empty string, null or absent, is no mark, and the strand is empty.
|
|
5391
5393
|
*
|
|
5392
5394
|
* `world` holds the elements as the owner is served them (the hidden in `hidden` or each element's own `hidden`),
|
|
5393
5395
|
* the World's `x_strand`, and `open: true` for a world open to anyone; `reader` is a lens reader (`OwLensReader`):
|
package/dist/index.js
CHANGED
|
@@ -773,7 +773,7 @@ var OwV2Client = class {
|
|
|
773
773
|
if (this.keyKind === "account") {
|
|
774
774
|
throw new TypeError("setMyCharacter needs a world key: an account token is not a member of one world");
|
|
775
775
|
}
|
|
776
|
-
return this.request("PUT", "/me/character", {
|
|
776
|
+
return this.request("PUT", "/me/character", { body: { character } });
|
|
777
777
|
}
|
|
778
778
|
/**
|
|
779
779
|
* PUT /me/lenses -- choose the lenses this key's holder starts with: lens ids in order, 0 to 20,
|
|
@@ -1714,11 +1714,11 @@ var OwV2Client = class {
|
|
|
1714
1714
|
* lists, search, counts and the link arrays that name it. 204, no body. No Idempotency-Key.
|
|
1715
1715
|
*/
|
|
1716
1716
|
async hide(type, id) {
|
|
1717
|
-
await this.request("PUT", `/${type}/${id}/hidden`, {
|
|
1717
|
+
await this.request("PUT", `/${type}/${id}/hidden`, { body: {}, allowEmpty: true });
|
|
1718
1718
|
}
|
|
1719
1719
|
/** DELETE /{type}/{id}/hidden -- clear the mark; an element that is not hidden stays as it is. 204. */
|
|
1720
1720
|
async unhide(type, id) {
|
|
1721
|
-
await this.request("DELETE", `/${type}/${id}/hidden`, {
|
|
1721
|
+
await this.request("DELETE", `/${type}/${id}/hidden`, { allowEmpty: true });
|
|
1722
1722
|
}
|
|
1723
1723
|
/**
|
|
1724
1724
|
* GET /world/hidden -- every hidden element of the world, newest first: `{type, id, set_at,
|
|
@@ -1928,7 +1928,7 @@ var OwV2Client = class {
|
|
|
1928
1928
|
if (opts.scope !== void 0) body.scope = opts.scope;
|
|
1929
1929
|
if (opts.name !== void 0) body.name = opts.name;
|
|
1930
1930
|
if (opts.keep !== void 0) body.keep = opts.keep;
|
|
1931
|
-
return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, {
|
|
1931
|
+
return this.request("POST", `/account/worlds/${encodeURIComponent(worldId)}/keys`, { body });
|
|
1932
1932
|
}
|
|
1933
1933
|
/**
|
|
1934
1934
|
* DELETE /account/worlds/{worldId}/keys/{keyId} -- revoke a world key, by the `id` mintWorldKey
|
|
@@ -3437,15 +3437,19 @@ function domainsOf(world, reader) {
|
|
|
3437
3437
|
|
|
3438
3438
|
// src/strand.ts
|
|
3439
3439
|
var STRAND_FIELD = "x_strand";
|
|
3440
|
-
var SLOTS = ["narrative", "event", "location"];
|
|
3441
3440
|
var EMPTY = () => ({ narrative: null, event: null, location: null, character: null, now: null, same: null });
|
|
3441
|
+
function optionalId(value) {
|
|
3442
|
+
if (value === null || value === void 0) return null;
|
|
3443
|
+
return typeof value === "string" && value !== "" ? value : void 0;
|
|
3444
|
+
}
|
|
3442
3445
|
function markOf(value) {
|
|
3443
3446
|
if (!isBody2(value)) return null;
|
|
3444
3447
|
const v = value;
|
|
3445
|
-
|
|
3446
|
-
|
|
3447
|
-
|
|
3448
|
-
|
|
3448
|
+
if (typeof v.narrative !== "string" || v.narrative === "") return null;
|
|
3449
|
+
const event = optionalId(v.event);
|
|
3450
|
+
const location = optionalId(v.location);
|
|
3451
|
+
if (event === void 0 || location === void 0) return null;
|
|
3452
|
+
return { narrative: v.narrative, event, location };
|
|
3449
3453
|
}
|
|
3450
3454
|
function strandOf(world, reader) {
|
|
3451
3455
|
if (!isBody2(world) || !Array.isArray(world.elements)) {
|