@onlyworlds/sdk 4.111.0 → 4.113.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.33.0-dist.92** (canonical 00.33.00).
3
+ **Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.93** (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,33 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.113.0] - 2026-10-30
9
+
10
+ ### Added
11
+
12
+ - **`@onlyworlds/sdk/waymark`**, with its stylesheet at **`@onlyworlds/sdk/waymark.css`**: `mountWaymark(target, options)` draws the OnlyWorlds mark beside a world's or an element's name and the fan-out it opens (the name line, the Open with rows, the lenses the page offers, Copy link), and returns a disposer that removes every node, listener and timer it added. Every word is the core's: the rows and their state words from `openersFor`, a member's "Last shaped in Atlas, 12 Oct" from `doorsOf` and `doorWhere`, the copied link from `elementAddress` (the site's address with the world's id; the toast says "Link copied"). The public face shows the name and type, only the rows that need nothing first, and Copy link. Options are refused by name when unknown, before anything is drawn. No node carries a `style` attribute, so it runs under `style-src 'self'`; every colour in the stylesheet is one of the Waymark's two grounds (`dark`, `paper`). The mark is a button and the fan-out a menu, keyboard first (Tab through the rows, arrows, Home, End, Escape back to the mark; focus moving out of it closes it and stays where it went, the end of the page included, while the window losing focus leaves it open); at 390 px wide and below it is a sheet from the bottom with rows at least 44 px tall, and the mark's tap area is at least 44 by 44 px at every width. `entry: 'mark' | 'menu' | 'both'` picks the way in: the mark beside the name, an "Open with" entry (`dispose.entry`) for the page's own "..." menu, or both; Escape returns focus to the one that opened it, and `returnFocus` (refused with `'mark'`) names the page's own element, its "..." button, to take focus back from a fan-out the entry opened. A failed copy (no clipboard, or the write refused) keeps the fan-out open, and the toast says "Could not copy the link." over the address in a read-only line to copy by hand, until the fan-out closes. The core (`.`) does not import it and stays free of the DOM.
13
+ - **`npm run demo`**: builds the package and serves `demo/waymark.html`, one public element on a plain page with the fan-out beside its name (`?entry=` with `mark`, `menu` or `both`, `?reader=`, `?ground=`, `?signedIn=`, `?current=` for the page's own tool). Not in the package.
14
+
15
+ ### Changed
16
+
17
+ - **`sideEffects`** in `package.json` is `["*.css"]` (was `false`), so a bundler keeps an import of `waymark.css`; every JavaScript file is still free of side effects.
18
+ - **The package has two entries.** `dist/index.js` and `dist/waymark.js` share one chunk of code, and each entry's declarations stand alone in its own `.d.ts`: `dist/index.d.ts` still holds every declaration of the core.
19
+
20
+ ## [4.112.0] - 2026-10-30
21
+
22
+ ### Changed
23
+
24
+ - **The lens readers follow schema-dist serial 93** (`v0.33.0-dist.93`), whose nineteen new cases replay in `resolveLens` and `worldGraph`. Four readings change for every caller:
25
+ - **A link reaches only an element of its field's target type.** An id naming an element of another type reaches nothing (a data fault, not a hop), draws no edge and takes no place in a reader's served list. A generic pair (a Pin's `element_type` and `element_id`) links only when its type key is exactly one of the 22 slugs as stored, nothing trimmed or folded, and in a graph it is placement, never an edge; the Pin's `map` link is the edge.
26
+ - **An anchor the reader cannot see is counted.** An anchor id that names no element of the world, or an element of another type than its field's, is now counted for the owner as `anchor_not_visible`; it was skipped silently.
27
+ - **A known-of stub keeps its base and public fields, every other field unset.** The stub is made from the body the reader is served: `change_seq` joins the base fields, a public link (a Character's `species`) is kept as trimmed for that reader, every other field of the type it holds is at its unset value (`''`, `null` or `[]`; the who and door fields `null`), and no extension key is kept.
28
+ - **A graph node's name is the stored value**, `null` when absent, and an edge's `index` is the target's place in the list as served, which keeps a proposed id the reader's rung sees.
29
+ - **`draughtText` names the public reader.** The API reads a public draught (keyless, or an account with no access in the world) as the public reader in either mode, and a public `voice` packet's text said "Read as the Character's own view." It now says "Read as the public reader." whenever the packet's `reader` is `public`; every other packet, and one without `reader`, reads by `mode` as before. The shared draughtText fixture gains the case (`public-reader`, 51 cases).
30
+
31
+ ### Added
32
+
33
+ - **`reader` on `OwDraught`**: the rung the packet was built through (`public`, `owner`, `co_builder`, `contributor`, `guest`, `seat` or `player`), which the API serves beside `mode` on every draught since 2026-10-30, kept under `compact`; `mode` stays what was asked.
34
+
8
35
  ## [4.111.0] - 2026-10-30
9
36
 
10
37
  ### Changed
@@ -16,7 +43,6 @@ earlier history lives in git log only.
16
43
  ### Changed
17
44
 
18
45
  - **`openersFor` checks the whole address.** It handed the address writer only the world, type and id, in the site's form, so a malformed `lens` or `moment`, or a `form` that is neither `human` nor `text`, still gave rows. The whole address now goes to `elementAddress` in its own form (the site's when it has none), so it refuses with the writer's own `OwAddressError`, `bad_lens`, `bad_moment` or `bad_form`, as it already did for the world, type and id; an address without a world still refuses `no_world`, the text form inside a world included. The rows are unchanged: a lens and a moment still ride on no href. The shared fixture gains four cases (45; the same bytes as the Python package's): the three refusals, and a well-formed lens and moment giving exactly the rows of the same address without them.
19
-
20
46
  ## [4.109.0] - 2026-10-29
21
47
 
22
48
  ### Changed
package/README.md CHANGED
@@ -471,6 +471,36 @@ const rows = openersFor(TOOLS, 'element', parseOwLink(link), { audience: 'member
471
471
 
472
472
  `surface` says what the page knows and nothing is guessed: `audience` (`member` or `public`; the public sees only rows that need nothing first), `signedIn` (`null` when the page cannot know, and then no row says so), `browser` (false in a desktop app), `phone`, and `tool`, the page's own client name, whose row says "You are here". Draw the rows as given; the words are decided here, so every surface says the same.
473
473
 
474
+ ### The Waymark: Open with, beside a name
475
+
476
+ A web page can draw the rows above for a person: the OnlyWorlds mark beside a world's or an element's name, which opens a small menu (the fan-out) with the name line, the Open with rows, the lenses the page offers, and Copy link. It ships at its own subpath with its own stylesheet, so the core stays free of the DOM:
477
+
478
+ ```typescript
479
+ import { mountWaymark } from '@onlyworlds/sdk/waymark';
480
+ import '@onlyworlds/sdk/waymark.css'; // or <link rel="stylesheet"> to the file
481
+
482
+ const dispose = mountWaymark(document.querySelector('h1.name'), {
483
+ world: { id: worldId, name: 'Moppetopia' },
484
+ element, // the element's body as the API serves it; leave it out for the world's own fan-out
485
+ reader: 'member', // 'member', 'guest' or 'public'
486
+ signedIn: false, tool: 'mytool', phone: false, browser: true, // what the page knows, as openersFor takes it
487
+ ground: 'dark', // or 'paper'
488
+ });
489
+ // later: dispose() removes every node, listener and timer it added
490
+ ```
491
+
492
+ What it draws is decided in the core, never in the component: the rows and their words are `openersFor`'s, a member's "Last shaped in Atlas, 12 Oct" line is `doorsOf`'s newest entry in `doorWhere`'s words with its date, and Copy link copies `elementAddress`'s site address with the world's id (never a slug) and says "Link copied". When the page has no clipboard or the copy is refused, the fan-out stays open and the toast says "Could not copy the link." over the same address in a read-only line, selected for a copy by hand; it stays until the fan-out closes or Escape. The public face (`reader: 'public'`) shows the name and type, only the rows that need nothing first, and Copy link: no last door, no lenses. A row that cannot open now says why ("Sign in to Atlas first", "Needs the world on this phone") and is grey; grey means nothing else. The page's own tool says "You are here".
493
+
494
+ Options, each refused by name when unknown, before anything is drawn: `world` (its `x_names`, when present, words the type), `element`, `reader`, `tool`, `signedIn`, `browser`, `phone`, `tools` (default `TOOLS`), `lenses` (`[{ id, name }]`, the Through row; absent, no row; a lens chosen rides on the copied link as `?lens=`), `ground`, `entry` and `returnFocus`.
495
+
496
+ **No inline style.** The component sets no `style` attribute and never touches `element.style`, so it runs under `style-src 'self'`; bundle `waymark.css` with the page. Every colour in it is one of the Waymark's two grounds, declared once at the top of the file.
497
+
498
+ **Keyboard and small screens.** The mark is a button and the fan-out a menu: Tab goes from the mark through the rows in order, the arrow keys, Home and End move between rows, Escape closes it and returns focus to what opened it. Focus moving out of it (Tab off the last row, Shift+Tab off the first, a click elsewhere) closes it too, and focus stays where it was moved; off the last row at the end of the page, where focus lands on the page itself, as well. The window losing focus (switching to another app) leaves it open. At 390 px wide and below it is a sheet from the bottom, its rows at least 44 px tall; the mark's tap area is at least 44 by 44 px at every width, without moving the glyph.
499
+
500
+ **The ways in, one setting.** `entry: 'mark'` draws the mark beside the name as the button that opens the fan-out. `entry: 'menu'` draws no mark and gives back an "Open with" entry for the page's own "..." menu, as `dispose.entry` (a button; put it in the menu, and the disposer takes it out again), which opens the same fan-out. `entry: 'both'` draws the mark and gives the entry. Escape returns focus to the one that opened the fan-out: the mark, or for the entry `returnFocus`, the page's own element to take focus back (its "..." button, which stays visible when its menu closes), else the entry itself. `returnFocus` is refused with `entry: 'mark'` and when it is not an HTMLElement. The default is `'mark'`; which way in is the default for everyone waits on a round with people who have never seen the tools, so a surface that sets `entry` explicitly is unaffected when it changes.
501
+
502
+ Not in this version: an element in a folder (no address on a server, so Copy link would copy the `ow://` text form), the moment picker (it needs a time bar), and the tools' own marks (every tool row wears one generic glyph for now). Try it locally with `npm run demo`, which builds the package and serves `demo/waymark.html` (`?current=atlas` makes the page Atlas, so its row says "You are here").
503
+
474
504
  ## Tokens
475
505
 
476
506
  The account's token rating, which some OnlyWorlds tools use. `getStatus()` and `getEncryptionInfo()` are what keel still serves under `/tokens/`; `consume()`, `getAccessKey()` and the two session revokes are deprecated (keel answers 404) and leave in 5.0. To read the token rating, prefer `account.allowance()` above.
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.92** — canonical schema **00.33.00**, published 2026-10-30.
3
+ **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.93** — 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.