@onlyworlds/sdk 4.150.0 → 4.152.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
@@ -1,6 +1,6 @@
1
1
  # For AI agents using @onlyworlds/sdk
2
2
 
3
- **Current as of**: SDK **4.x** · schema-dist **v0.34.0-dist.113** (canonical 00.34.00).
3
+ **Current as of**: SDK **4.x** · schema-dist **v0.34.0-dist.114** (canonical 00.34.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,26 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.152.0] - 2026-11-11
9
+
10
+ ### Added
11
+
12
+ - **`OwApiError.isReviewByAnother`**: true for 403 `review_by_another`. A write from a key below co-builder (a contributor's or a guest's, a person's or an AI seat's) that sets an `x_review_proposed` or `x_review_checked` mark is refused when the mark's `by` is not the writer's own membership id and the mark is not exactly the one the element holds; `param` names the mark, and nothing is written. Send your own membership id as `by`, or the mark as the element holds it. A Character's id is refused too.
13
+
14
+ ## [4.151.0] - 2026-11-10
15
+
16
+ ### Added
17
+
18
+ - **`viewOf` returns `order`: the fields an element's page draws, in the order drawn** (`views.json` version 2): the row's `lead`, then the rest of the type's section fields in the schema's own order, then each `fold`; each field once, and only a field that holds something (not absent, null, a string with nothing after trimming, an empty list or an empty object), so an empty lead field is skipped and an empty fold draws no fold. The base fields are the page's head and appear only where a row names one. With no row, the type's section fields.
19
+
20
+ ### Changed
21
+
22
+ - **The `x_served_trimmed` banner shows only when the list names a field**: at least one string with something left after trimming. A list of blanks, or of anything but strings, shows none (4.147.0 showed it for any non-empty list).
23
+ - **`VIEWS.version` is `2`**, the version of `views.json` baked at this release; codegen reads version 2 only.
24
+ - Where two rows match on one rung, the first in the table wins and the page is drawn, as before; the file now says so, and the fixture holds the case.
25
+ - **A lens's short rows carry `supertype` and `subtype`**: a `name` or `first_line` row from `resolveLens` now holds each where the element as served holds it as a string with something left after trimming White_Space, as stored (never trimmed); absent, null, empty, White_Space alone or a value that is not a string adds no key. A known-of stub's row carries them too, since a stub is served both. Rows under `full` are unchanged.
26
+ - **Schema repinned to schema-dist v0.34.0-dist.114** (from dist.113; same canonical 00.34.00, no schema file moved): `views.json` version 2 and its 41 cases; the lens fixture at 210 cases (nine for the short rows), all replayed; the review profile's rule 5 (an object with at least one key is a mark, whatever its keys: `proposedMarkOf` already read it so, and its tests now name the rule's two examples); the report profile's rule 8 (no reader here reads a report's `consequences`).
27
+
8
28
  ## [4.150.0] - 2026-11-10
9
29
 
10
30
  ### 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.34.0-dist.113** — canonical schema **00.34.00**, published 2026-11-10.
3
+ **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.0-dist.114** — canonical schema **00.34.00**, published 2026-11-10.
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.
@@ -337,7 +337,7 @@ var CHARTER_PAIRS = [
337
337
  { type: "construct", supertype: "Domain", aid: "domain" }
338
338
  ];
339
339
  var VIEWS_TABLE = {
340
- "version": 1,
340
+ "version": 2,
341
341
  "banners": [
342
342
  {
343
343
  "mark": "known_of",
@@ -361,8 +361,8 @@ var VIEWS_TABLE = {
361
361
  }
362
362
  ],
363
363
  "layouts": {
364
- "document": "the fields in the row's order: lead open, then the rest in the standard's sections, then fold; a kind with no row is a document",
365
- "conversation": "the element within its chain by the named link, oldest first by created_at, stopping at an id already visited"
364
+ "document": "the fields in the row's order, each drawn once: lead open, then the rest, then fold; a field the row names in both lead and fold is drawn in the lead. The rest are the type's section fields in the schema's own order (schema/<type>.yaml: its sections as listed, and each section's fields as listed) that the row puts in neither lead nor fold. A field that holds nothing (absent, null, a string with nothing left after trimming, a list with no items, an object with no keys; a list of blank strings holds something here, whatever a banner reads of one) is not drawn: an empty lead field is skipped, and a fold whose field holds nothing draws no fold. A tool that draws empty fields to be filled draws them at their own place in this order; it never moves a field. The base fields outside every section (name, description, supertype, subtype, image_url) are the page's head, unless the row names one in lead or fold, where it is drawn, and only there. A row names only the type's base and section fields, never an extension key, and extension keys and a world's own fields are not in the order. A kind with no row is a document.",
365
+ "conversation": "the element within its chain by the named link, oldest first by created_at, stopping at an id already visited; each line's own fields drawn as a document draws them"
366
366
  },
367
367
  "rows": [
368
368
  {
package/dist/index.d.ts CHANGED
@@ -162,7 +162,7 @@ interface OwViewRow {
162
162
  }
163
163
  /** views.json without its `_meta`: the banners every page shows, the layouts, the rows. */
164
164
  interface OwViewsTable {
165
- readonly version: 1;
165
+ readonly version: 2;
166
166
  readonly banners: readonly {
167
167
  readonly mark: string;
168
168
  readonly defined_by: string;
@@ -2221,7 +2221,10 @@ interface OwLensReading {
2221
2221
  * The kept elements as `show` makes them, in the same order; an anchor's row carries its `note`, and only an anchor
2222
2222
  * the reader can see: a note on one it cannot see (an id of another type than its field's too) goes with the
2223
2223
  * anchor, though another path keeps the element. Under `full` a row is the body as served to this reader, so the
2224
- * owner's row of a hidden element carries `hidden: true`; a `name` or `first_line` row never carries it.
2224
+ * owner's row of a hidden element carries `hidden: true`; a `name` or `first_line` row never carries it. A `name`
2225
+ * row is `id`, `type`, `name`, and `supertype` and `subtype` each where the served body holds it as a string with
2226
+ * something left after trimming White_Space, as stored; a `first_line` row adds `description` up to its first line
2227
+ * break.
2225
2228
  */
2226
2229
  rows: Record<string, unknown>[];
2227
2230
  /** The cut, counted by reason; a reason with no count is absent, and a reader that is not the owner never carries the owner's two. */
@@ -4411,6 +4414,13 @@ declare class OwApiError extends Error {
4411
4414
  * nothing to settle. Someone settled it already, or it was never written as proposed.
4412
4415
  */
4413
4416
  get isNotProposed(): boolean;
4417
+ /**
4418
+ * A write from a key below co-builder (a contributor's or a guest's, a person's or an AI seat's) set an
4419
+ * `x_review_proposed` or `x_review_checked` mark whose `by` is not the writer's own membership id
4420
+ * (403 `review_by_another`, `param` the mark; nothing written). Send your own membership id as `by`, or
4421
+ * the mark exactly as the element holds it. A Character's id is refused too. Retrying will not help.
4422
+ */
4423
+ get isReviewByAnother(): boolean;
4414
4424
  }
4415
4425
  /**
4416
4426
  * 412 `precondition_failed`: the element changed since the `change_seq` sent as
@@ -6660,23 +6670,34 @@ interface OwView {
6660
6670
  sentence: string | null;
6661
6671
  /** The marks to show at the head of its page, in order: the table's banners the element carries, then the row's own. */
6662
6672
  banners: string[];
6673
+ /**
6674
+ * The fields its page draws, in the order drawn (the file's document layout): the row's `lead`, then the
6675
+ * rest of the type's section fields in the standard's section order, then each `fold`; each field once,
6676
+ * and only a field that holds something (not absent, null, a string with nothing after trimming, or an
6677
+ * empty list), so an empty lead field is skipped and an empty fold draws no fold. The base fields (name,
6678
+ * description, supertype, subtype, image_url) are the page's head and appear here only where the row
6679
+ * names one in `lead` or `fold`. With no row, the type's section fields. A conversation draws each line's
6680
+ * own fields this way.
6681
+ */
6682
+ order: string[];
6663
6683
  }
6664
6684
  /** views.json as baked at this release, without its `_meta`, frozen throughout. Read one element's view with viewOf. */
6665
6685
  declare const VIEWS: OwViewsTable;
6666
6686
  /**
6667
6687
  * How an element is shown, by the views table baked at this release (`views.json`): the row that matches
6668
- * it, its one sentence, and the marks to show at the head of its page.
6688
+ * it, its one sentence, the marks to show at the head of its page, and the fields its page draws in order.
6669
6689
  *
6670
6690
  * A row matches by its kind: a profile's pair only with that profile's mark, by the profile's own reader;
6671
6691
  * a type with a supertype; a type alone; types and supertypes trimmed and folded as the room profile
6672
- * defines. The most specific row wins. The sentence is the first field the row names in `sentence` that
6692
+ * defines. The most specific row wins, and where two match on one rung the first in the table does: a
6693
+ * page is never refused over the table. The sentence is the first field the row names in `sentence` that
6673
6694
  * holds text after trimming, cut at its first line break and trimmed. Pass the element as the reader is
6674
6695
  * served it: the banners read what was served (a known-of stub, the hidden mark, a trimmed list).
6675
6696
  *
6676
6697
  * ```ts
6677
6698
  * viewOf({ type: 'narrative', supertype: 'Message', story: 'See you at the gate.\nBring the map.' });
6678
- * // { row: <the message row>, sentence: 'See you at the gate.', banners: [] }
6679
- * viewOf({ type: 'character', name: 'Ilse' }); // { row: null, sentence: null, banners: [] }
6699
+ * // { row: <the message row>, sentence: 'See you at the gate.', banners: [], order: ['story'] }
6700
+ * viewOf({ type: 'character', name: 'Ilse' }); // { row: null, sentence: null, banners: [], order: [] }
6680
6701
  * ```
6681
6702
  */
6682
6703
  declare function viewOf(element: unknown): OwView;
package/dist/index.js CHANGED
@@ -44,7 +44,7 @@ import {
44
44
  trimWhiteSpace,
45
45
  typeWord,
46
46
  unknownKey
47
- } from "./chunk-GWJ3SOZQ.js";
47
+ } from "./chunk-TFS5P63Z.js";
48
48
 
49
49
  // src/v2/keyed-id.ts
50
50
  var KEYED_IDS = "0199b6a0-6f0e-7c2a-9d1e-3b5c7a8e4f21";
@@ -459,6 +459,15 @@ var OwApiError = class extends Error {
459
459
  get isNotProposed() {
460
460
  return this.status === 422 && this.code === "not_proposed";
461
461
  }
462
+ /**
463
+ * A write from a key below co-builder (a contributor's or a guest's, a person's or an AI seat's) set an
464
+ * `x_review_proposed` or `x_review_checked` mark whose `by` is not the writer's own membership id
465
+ * (403 `review_by_another`, `param` the mark; nothing written). Send your own membership id as `by`, or
466
+ * the mark exactly as the element holds it. A Character's id is refused too. Retrying will not help.
467
+ */
468
+ get isReviewByAnother() {
469
+ return this.status === 403 && this.code === "review_by_another";
470
+ }
462
471
  };
463
472
  var OwPreconditionFailedError = class extends OwApiError {
464
473
  constructor(status, code, message, docUrl, detail, type = null, param = null, retryAfter = null) {
@@ -3451,6 +3460,10 @@ var Reading = class {
3451
3460
  if (show === "full") row = copy(b);
3452
3461
  else {
3453
3462
  row = { id: b.id, type: b.type, name: b.name ?? null };
3463
+ for (const k of ["supertype", "subtype"]) {
3464
+ const v = b[k];
3465
+ if (typeof v === "string" && trimWhiteSpace(v) !== "") row[k] = v;
3466
+ }
3454
3467
  if (show === "first_line" && typeof b.description === "string") {
3455
3468
  const cut2 = b.description.search(/[\r\n]/);
3456
3469
  row.description = cut2 < 0 ? b.description : b.description.slice(0, cut2);
@@ -4505,26 +4518,51 @@ function score(row, el) {
4505
4518
  function carries2(el, mark) {
4506
4519
  const v = own2(el, mark);
4507
4520
  if (mark === "hidden" || mark === "known_of") return v === true;
4508
- if (mark === "x_served_trimmed") return Array.isArray(v) && v.length > 0;
4521
+ if (mark === "x_served_trimmed") return Array.isArray(v) && v.some((x) => typeof x === "string" && trimWhiteSpace(x) !== "");
4509
4522
  if (mark === "x_review_proposed" || mark === "x_review_checked") {
4510
4523
  return v !== null && typeof v === "object" && !Array.isArray(v) && Object.keys(v).length > 0;
4511
4524
  }
4512
4525
  return hasMark(el, mark);
4513
4526
  }
4527
+ function holds(v) {
4528
+ if (v === void 0 || v === null) return false;
4529
+ if (typeof v === "string") return trimWhiteSpace(v) !== "";
4530
+ if (Array.isArray(v)) return v.length > 0;
4531
+ if (typeof v === "object") return Object.keys(v).length > 0;
4532
+ return true;
4533
+ }
4534
+ function drawOrder(row, el) {
4535
+ const type = own2(el, "type");
4536
+ const slug = typeof type === "string" ? fold(type) : "";
4537
+ const sections = Object.prototype.hasOwnProperty.call(ELEMENT_SECTIONS, slug) ? [...ELEMENT_SECTIONS[slug]].sort((a, b) => a.order - b.order).flatMap((s) => s.fields) : [];
4538
+ const lead = row?.lead ?? [];
4539
+ const folds = (row?.fold ?? []).map((f) => f.field);
4540
+ const drawn = [];
4541
+ const draw = (f) => {
4542
+ if (!drawn.includes(f) && holds(own2(el, f))) drawn.push(f);
4543
+ };
4544
+ lead.forEach(draw);
4545
+ sections.filter((f) => !lead.includes(f) && !folds.includes(f)).forEach(draw);
4546
+ folds.forEach(draw);
4547
+ return drawn;
4548
+ }
4514
4549
  function viewOf(element) {
4515
- if (element === null || typeof element !== "object" || Array.isArray(element)) return { row: null, sentence: null, banners: [] };
4550
+ return viewIn(VIEWS, element);
4551
+ }
4552
+ function viewIn(table, element) {
4553
+ if (element === null || typeof element !== "object" || Array.isArray(element)) return { row: null, sentence: null, banners: [], order: [] };
4516
4554
  const el = element;
4517
4555
  let row = null;
4518
4556
  let best = 0;
4519
- for (const r of VIEWS.rows) {
4557
+ for (const r of table.rows) {
4520
4558
  const s = score(r, el);
4521
4559
  if (s > best) {
4522
4560
  best = s;
4523
4561
  row = r;
4524
4562
  }
4525
4563
  }
4526
- const banners = VIEWS.banners.map((b) => b.mark).filter((m) => carries2(el, m));
4527
- if (!row) return { row: null, sentence: null, banners };
4564
+ const banners = table.banners.map((b) => b.mark).filter((m) => carries2(el, m));
4565
+ if (!row) return { row: null, sentence: null, banners, order: drawOrder(null, el) };
4528
4566
  for (const m of row.banner ?? []) if (carries2(el, m)) banners.push(m);
4529
4567
  let sentence = null;
4530
4568
  for (const f of row.sentence ?? []) {
@@ -4536,7 +4574,7 @@ function viewOf(element) {
4536
4574
  sentence = trimWhiteSpace(cut2 < 0 ? text2 : text2.slice(0, cut2));
4537
4575
  break;
4538
4576
  }
4539
- return { row, sentence, banners };
4577
+ return { row, sentence, banners, order: drawOrder(row, el) };
4540
4578
  }
4541
4579
 
4542
4580
  // src/world-file.ts
package/dist/waymark.js CHANGED
@@ -6,7 +6,7 @@ import {
6
6
  openersFor,
7
7
  refuseUnknownOptions,
8
8
  typeWord
9
- } from "./chunk-GWJ3SOZQ.js";
9
+ } from "./chunk-TFS5P63Z.js";
10
10
 
11
11
  // src/waymark/glyphs.ts
12
12
  var MARK_PATH = "M48.8 0.0 43.8 0.4 39.0 1.2 36.0 2.0 33.2 2.9 29.3 4.5 24.8 6.8 20.6 9.5 17.0 12.4 13.6 15.7 10.4 19.4 7.8 23.1 5.8 26.6 4.5 29.3 3.3 32.1 1.8 36.8 0.8 41.2 0.1 46.3 0.0 51.1 0.4 56.2 1.2 61.0 2.0 63.9 2.9 66.8 4.5 70.7 6.8 75.2 9.5 79.4 12.4 82.9 15.7 86.3 19.4 89.5 23.1 92.1 26.6 94.2 29.3 95.5 32.1 96.7 36.8 98.2 41.2 99.2 46.3 99.8 51.1 100.0 56.2 99.6 61.0 98.8 63.9 98.0 66.8 97.1 70.7 95.5 75.2 93.2 79.4 90.4 82.9 87.6 86.3 84.3 89.5 80.5 92.1 76.9 94.2 73.4 95.5 70.7 96.7 67.9 98.2 63.2 99.2 58.7 99.8 53.7 100.0 48.8 99.6 43.8 98.6 38.4 97.1 33.2 95.5 29.3 93.2 24.8 90.4 20.6 87.6 17.0 84.3 13.6 80.5 10.4 76.9 7.8 73.4 5.8 70.7 4.5 67.9 3.3 63.2 1.8 58.7 0.8 53.7 0.1ZM77.5 80.7 74.1 83.4 70.7 85.7 67.0 87.5 64.5 88.6 64.1 88.7 65.7 86.3 67.1 83.9 68.7 80.7 69.9 77.6 72.7 78.5 73.0 78.4ZM22.5 80.7 25.6 79.0 27.3 78.3 30.0 77.6 31.3 80.7 32.8 83.9 34.2 86.3 35.9 88.7 32.9 87.5 29.3 85.7 25.8 83.4ZM51.2 74.5 55.1 74.7 59.9 75.2 64.2 76.0 67.5 76.9 66.0 80.5 64.2 84.0 62.0 87.4 59.6 90.1 55.1 90.9 52.2 91.2 51.2 91.1ZM48.7 74.5 48.8 91.1 47.7 91.2 44.9 90.9 40.3 90.1 38.2 87.8 36.3 85.0 34.2 81.2 32.5 77.0 35.8 76.0 40.5 75.2 44.5 74.7ZM91.1 51.2 91.1 52.9 90.8 56.3 90.1 59.7 89.3 62.5 88.5 64.8 87.2 67.7 85.7 70.7 83.9 73.4 82.0 75.9 79.4 78.9 76.3 77.2 73.8 76.1 76.2 68.8 77.8 62.7 78.7 56.8 79.0 51.2ZM55.8 51.2 67.7 51.2 67.6 55.1 67.2 59.0 66.7 61.5 65.7 65.0 61.0 64.2 55.7 63.6ZM32.5 51.2 44.5 51.2 44.4 63.6 39.7 64.1 34.5 65.0 33.5 61.3 32.9 58.1 32.5 54.2ZM8.8 51.2 21.0 51.2 21.0 53.3 21.4 56.6 22.7 64.0 23.8 68.4 25.0 72.1 26.6 75.9 23.7 77.2 20.6 78.9 18.5 76.7 16.5 74.1 14.8 71.5 13.4 69.1 12.1 66.3 11.0 63.6 10.1 60.5 9.4 57.3 8.9 53.5 8.8 51.3ZM36.2 27.0 39.5 27.5 44.5 28.2 44.4 48.8 32.4 48.7 32.8 44.5 33.6 39.1 35.0 32.0ZM63.9 26.9 65.2 32.1 66.6 39.2 67.4 44.8 67.7 48.7 55.8 48.8 55.7 28.1 60.5 27.5ZM74.8 23.4 76.9 22.5 79.4 21.1 82.0 24.0 84.8 27.8 86.2 30.3 87.5 32.9 88.6 35.4 89.5 38.1 90.3 41.2 90.8 44.0 91.1 47.0 91.1 48.8 79.0 48.7 78.7 44.6 78.0 39.3 76.5 31.2 74.7 23.5ZM25.5 23.5 25.5 23.7 24.5 26.8 23.7 30.2 22.4 36.6 21.5 42.5 21.1 48.7 8.8 48.8 8.8 47.0 9.2 43.7 9.8 40.8 10.5 38.1 11.5 35.2 12.4 32.9 13.8 30.2 15.2 27.8 17.9 24.0 20.6 21.1 23.1 22.5ZM64.1 11.3 67.0 12.4 70.7 14.3 74.1 16.5 77.5 19.3 75.6 20.3 73.2 21.5 70.0 22.6 68.7 19.2 67.1 16.1 65.7 13.6ZM35.9 11.3 34.2 13.6 32.8 16.1 31.3 19.2 30.0 22.5 27.9 21.9 26.4 21.3 22.5 19.3 25.8 16.5 29.3 14.3 32.9 12.4 35.4 11.4ZM51.2 8.8 52.2 8.8 55.1 9.0 59.6 9.9 61.7 12.2 64.2 16.0 66.0 19.5 67.6 23.3 64.3 24.3 59.4 25.2 56.2 25.6 51.2 25.5ZM48.8 8.8 48.7 25.5 44.2 25.6 40.6 25.2 36.4 24.5 32.4 23.2 33.9 19.5 35.7 16.0 38.2 12.2 40.3 9.9 44.9 9.0 47.7 8.8Z";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.150.0",
3
+ "version": "4.152.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {