@onlyworlds/sdk 4.96.1 → 4.97.1

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,22 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.97.1] - 2026-10-28
9
+
10
+ ### Fixed
11
+
12
+ - **A lens's mail part no longer reads a known-of stub as a message to everyone.** A stub never serves `characters`, and the message profile reads a Message with no recipients as addressed to everyone, so a guest's mail part listed every Message it knew only as a stub, unread. The mail part now reads whole bodies only, as the API reads it. A shared edge case holds it, the same file as the Python package's.
13
+
14
+ ## [4.97.0] - 2026-10-28
15
+
16
+ ### Added
17
+
18
+ - **Where a seat's lenses come from.** `OwMe` and `OwMember` carry `lenses_from`, `chosen` (the row's own list, empty for none) or `titles` (it chose none, and its Character's Titles bring these); `lenses` is then the lenses whose `titles` name a Title the Character holds. The owner's list is always its own choice. On `OwWorldLens`, `from_titles` says the caller starts with the lens through a Title (never with `chosen`), and the owner gets `title_seats`: each seat that starts with it through a Title, with those Titles, in the members' order. The API serves all three since 2026-10-28.
19
+
20
+ ### Fixed
21
+
22
+ - **An umbrella lens no longer enters a child lens the reader knows only as a stub.** Since 4.93.1 a lens named by id reads as nothing when the reader is served it only as a known-of stub; as an umbrella's child, the same stub was still entered and its stored anchors read, so a guest's reading kept elements reached through links it was never served. Such a child is now an anchor the reader cannot see (`anchor_not_visible`, counted for the owner only), as the API reads it. Two shared edge cases hold it, the same file as the Python package's.
23
+
8
24
  ## [4.96.1] - 2026-10-27
9
25
 
10
26
  ### Fixed
package/dist/index.d.ts CHANGED
@@ -2569,10 +2569,14 @@ interface OwMe {
2569
2569
  /** The member's Character, or null (null too when it is hidden from this key). */
2570
2570
  character: string | null;
2571
2571
  /**
2572
- * The lenses you chose (setMyLenses), lens ids in your order; empty for none, which is a choice.
2573
- * The draught reads them when you name no lens and no policy.
2572
+ * The lenses you start with, lens ids in order: the ones you chose (setMyLenses), or, when you
2573
+ * chose none, the lenses whose `titles` name a Title your Character holds (`lenses_from` says
2574
+ * which; the owner's are always its own choice). The draught reads them when you name no lens
2575
+ * and no policy.
2574
2576
  */
2575
2577
  lenses: string[];
2578
+ /** Where `lenses` comes from: `chosen` (your own list, empty for none) or `titles` (you chose none, and your Character's Titles bring these). Saving a list makes it your choice. */
2579
+ lenses_from: 'chosen' | 'titles';
2576
2580
  /** Agent seats only: the agent's name. */
2577
2581
  name?: string;
2578
2582
  /** Who you are here, who answers for you, and the house rules. */
@@ -2635,10 +2639,14 @@ interface OwMember {
2635
2639
  /** Agent rows only: the agent's name. */
2636
2640
  name?: string;
2637
2641
  /**
2638
- * The lenses this row chose, lens ids in its order (the owner row: the owner's own); empty for
2639
- * none, which is a choice. A lens this key cannot see is left out of what it is shown.
2642
+ * The lenses this row starts with, lens ids in order: the ones it chose, or, for a live seat that
2643
+ * chose none, the lenses whose `titles` name a Title its Character holds (`lenses_from` says
2644
+ * which). The owner row: the owner's own choice, never a Title's. A lens this key cannot see is
2645
+ * left out of what it is shown.
2640
2646
  */
2641
2647
  lenses: string[];
2648
+ /** Where `lenses` comes from: `chosen` (the row's own list, empty for none) or `titles` (it chose none, and its Character's Titles bring these). */
2649
+ lenses_from: 'chosen' | 'titles';
2642
2650
  [k: string]: unknown;
2643
2651
  }
2644
2652
  /** GET /account/allowance: the account's token rating and what is left of it today (keel 872431f, 2026-10-14). */
@@ -2991,10 +2999,17 @@ interface OwWorldLens {
2991
2999
  unreadable?: string;
2992
3000
  /** The Titles it is the default for: everyone holding one starts with it. */
2993
3001
  titles: string[];
2994
- /** This caller chose it (OwMe's `lenses`). */
3002
+ /** This caller chose it (OwMe's `lenses`, with `lenses_from` `chosen`). */
2995
3003
  chosen: boolean;
3004
+ /** This caller chose no lenses and starts with this one through a Title its Character holds (OwMe's `lenses`, with `lenses_from` `titles`). Never with `chosen`. */
3005
+ from_titles: boolean;
2996
3006
  /** The owner only: the memberships that chose it (null for the owner). */
2997
3007
  chosen_by?: Array<string | null>;
3008
+ /** The owner only: the seats that start with it through a Title, apart from `chosen_by`: each live membership that chose no lenses and whose Character holds a Title it names, with those Titles, in the members' order. */
3009
+ title_seats?: Array<{
3010
+ member: string;
3011
+ titles: string[];
3012
+ }>;
2998
3013
  /** The owner only: `empty` (it resolves to nothing for the owner), `over_budget` (the owner's reading cuts by budget), `retired_assigned` (retired and still chosen by a seat). */
2999
3014
  health?: {
3000
3015
  empty: boolean;
package/dist/index.js CHANGED
@@ -4428,6 +4428,7 @@ var Reading = class {
4428
4428
  function anchorsOf(lens, r) {
4429
4429
  const anchors = [];
4430
4430
  const children = [];
4431
+ const unseen = /* @__PURE__ */ new Set();
4431
4432
  const seen = /* @__PURE__ */ new Set();
4432
4433
  for (const field of ANCHOR_FIELDS) {
4433
4434
  const v = valueOf(lens, field);
@@ -4435,27 +4436,33 @@ function anchorsOf(lens, r) {
4435
4436
  for (const id of v) {
4436
4437
  if (typeof id !== "string" || id === "" || seen.has(id)) continue;
4437
4438
  seen.add(id);
4438
- if (field === "constructs" && r.view.has(id) && isLens(r.byId.get(id))) children.push(id);
4439
- else anchors.push(id);
4439
+ if (field === "constructs" && r.view.has(id) && isLens(r.byId.get(id))) {
4440
+ if (!r.stubs.has(id)) {
4441
+ children.push(id);
4442
+ continue;
4443
+ }
4444
+ unseen.add(id);
4445
+ }
4446
+ anchors.push(id);
4440
4447
  }
4441
4448
  }
4442
4449
  const mark = lens.x_served_trimmed;
4443
4450
  const trimmed = Array.isArray(mark) && mark.some((f) => typeof f === "string" && ANCHOR_FIELDS.includes(f));
4444
- return { anchors, children, anchored: seen.size > 0 || trimmed };
4451
+ return { anchors, children, unseen, anchored: seen.size > 0 || trimmed };
4445
4452
  }
4446
4453
  function resolveOne(lens, recipe, r, visited) {
4447
4454
  const cut2 = /* @__PURE__ */ new Map();
4448
4455
  const addCut = (id, why) => {
4449
4456
  if (!cut2.has(id)) cut2.set(id, why);
4450
4457
  };
4451
- const { anchors, children, anchored } = anchorsOf(lens, r);
4458
+ const { anchors, children, unseen, anchored } = anchorsOf(lens, r);
4452
4459
  const anchorSet = new Set(anchors);
4453
4460
  const childSet = new Set(children);
4454
4461
  const list = [];
4455
4462
  const frontier = [];
4456
4463
  for (const id of anchors) {
4457
4464
  if (visited.has(id) || !r.byId.has(id)) continue;
4458
- if (!r.view.has(id)) {
4465
+ if (!r.view.has(id) || unseen.has(id)) {
4459
4466
  addCut(id, "anchor_not_visible");
4460
4467
  continue;
4461
4468
  }
@@ -4498,7 +4505,7 @@ function mailPart(r, mode, budget, clock) {
4498
4505
  const empty = { unread: [], read: [], rows: [], cut: {}, totals: { unread: 0, read: 0 } };
4499
4506
  if (r.character === null) return empty;
4500
4507
  const inView = r.order.filter((id) => r.view.has(id));
4501
- const messages = inView.map((id) => r.body(id)).filter((b) => isMessage(b));
4508
+ const messages = inView.filter((id) => !r.stubs.has(id)).map((id) => r.body(id)).filter((b) => isMessage(b));
4502
4509
  const relations = inView.filter((id) => r.typeOf.get(id) === "relation").map((id) => r.body(id));
4503
4510
  const mark = readMarkOf(relations, r.character, r.members);
4504
4511
  const mine = unreadFor(messages, r.character, null, r.members);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.96.1",
3
+ "version": "4.97.1",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {