@onlyworlds/sdk 4.96.0 → 4.97.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/CHANGELOG.md CHANGED
@@ -5,6 +5,22 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.97.0] - 2026-10-28
9
+
10
+ ### Added
11
+
12
+ - **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.
13
+
14
+ ### Fixed
15
+
16
+ - **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.
17
+
18
+ ## [4.96.1] - 2026-10-27
19
+
20
+ ### Fixed
21
+
22
+ - **The lens and graph readers read the world's now as the API serves it.** `GET /world` names the world's now `time_range_current`, and a world folder names it `time_current`; `resolveLens` and `worldGraph` read only `now` and `time_current`, so a World body passed straight from the API had no now: no fence, and a `window` that cut nothing. They now read `now`, else `time_current`, else `time_range_current`, and `OwLensWorld` types the third. A shared edge case holds it in both packages; the Python package's `resolve_lens` and `world_graph` read the same.
23
+
8
24
  ## [4.96.0] - 2026-10-27
9
25
 
10
26
  ### Added
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;
@@ -5052,12 +5067,14 @@ interface OwLensWorld {
5052
5067
  members?: readonly OwMessageMember[] | null;
5053
5068
  /** The world's now, in its own time unit: the default `as_of`. */
5054
5069
  now?: number | null;
5055
- /** The World's own now (its `time_current`), read when `now` is not given. */
5070
+ /** The World's own now as a world folder spells it (`time_current`), read when `now` is not given. */
5056
5071
  time_current?: number | null;
5072
+ /** The World's own now as the API serves it (`GET /world`'s `time_range_current`), read when neither `now` nor `time_current` is given. */
5073
+ time_range_current?: number | null;
5057
5074
  }
5058
5075
  /** `resolveLens`'s options. */
5059
5076
  interface OwLensOptions {
5060
- /** The reading's date, a whole number in the world's time unit; absent: the world's now (`now`, else `time_current`); none at all: no fence, and the window cuts nothing. */
5077
+ /** The reading's date, a whole number in the world's time unit; absent: the world's now (`now`, else `time_current`, else `time_range_current`); none at all: no fence, and the window cuts nothing. */
5061
5078
  asOf?: number | null;
5062
5079
  /** The reading's wall-clock time for the mail rule's thirty days, a date-time; absent: the machine's time. Never the world's now. */
5063
5080
  clock?: string | null;
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
  }
@@ -4546,7 +4553,7 @@ function readingDate(fn, world, opts) {
4546
4553
  if (asOfV !== null && whole(asOfV) === null) throw new TypeError(`${fn}: asOf is a whole number; got ${JSON.stringify(asOfV)}.`);
4547
4554
  const clockV = valueOf(opts, "clock");
4548
4555
  if (clockV !== null && timeKey(clockV) === null) throw new TypeError(`${fn}: clock is a date-time; got ${JSON.stringify(clockV)}.`);
4549
- const asOf = asOfV !== null ? asOfV : whole(world.now) ?? whole(world.time_current);
4556
+ const asOf = asOfV !== null ? asOfV : whole(world.now) ?? whole(world.time_current) ?? whole(world.time_range_current);
4550
4557
  return { asOf, clock: clockV };
4551
4558
  }
4552
4559
  function lensReading(r, lens, clockV) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlyworlds/sdk",
3
- "version": "4.96.0",
3
+ "version": "4.97.0",
4
4
  "description": "TypeScript SDK for the OnlyWorlds API - build world-building applications with type safety",
5
5
  "type": "module",
6
6
  "exports": {