@onlyworlds/sdk 4.112.0 → 4.114.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.93** (canonical 00.33.00).
3
+ **Current as of**: SDK **4.x** · schema-dist **v0.33.0-dist.94** (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,31 @@ earlier history lives in git log only.
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [4.114.0] - 2026-10-30
9
+
10
+ ### Changed
11
+
12
+ - **The lens readers and `charterOf` follow schema-dist serial 94** (`v0.33.0-dist.94`), whose twenty-four new cases replay in `resolveLens`, `worldGraph`, `charterOf` and `typeWord`. Five readings change for callers:
13
+ - **An anchor the reader cannot see is counted before anything else, for the owner alone.** An anchor that names no element, an element of another type than its field's, or a hidden umbrella a child lens points back at (the lens's own id included) is counted as `anchor_not_visible` the first time it is met, ahead of any reason a hop or a child lens gives the same element, and each element is counted once. Any other reader reads the lens as if that anchor were not there, so when a child lens cuts the same element by `types` or the window, the count is under the child's reason, and a graph edge to it is cut under that reason too (`outside_lens` for an element the reader sees that no path kept).
14
+ - **An empty string, or one of White_Space alone, in an anchor list is no anchor.** A lens whose anchor lists hold only such strings is a filter over the reader's view by its `types`, and nothing is counted for the strings; before, a string of White_Space alone was taken for an id that named nothing, so the lens kept nothing (an empty string was already no anchor).
15
+ - **A note goes with its anchor.** A note captions a kept row only for an anchor the reader can see. A note on one it cannot see captions no row, even when another path keeps the element, and is not counted in `notesIgnored`.
16
+ - **A `full` row is the body as served.** A row of an element under the hidden mark (the world's `hidden` list or the element's own `hidden`) carries `hidden: true`, as the API serves it: the owner's row of a hidden element, and a guest's row of a hidden element of its own. No other body carries a `hidden` key, so a stored `hidden: false` is dropped. A `name` or `first_line` row never carries it.
17
+ - **A proposed element is in no Domain's hubs.** `charterOf` and `domainsOf` leave an element written as proposed out of a Domain's `hubs` for every reader, the owner included, as they already left it out of the Charter, the Guide, the Domains and `skill`.
18
+ - The serial's other cases (a public reader's served list, a single link stored empty, an id one lens anchors under two fields met once under the first, a member reading the Charter whole from a stub, a skill id compared whatever its case, and the names map's six) replay unchanged.
19
+ - **The waymark entry no longer loads the world-file and zip code.** `@onlyworlds/sdk/waymark` reached `readWorldFile`'s module, and with it fflate, through the case fold the room and names readers use; the fold now lives in its own module, so the chunk the entry loads imports no fflate (101 KB to 58 KB). `simpleCaseFold` is exported from the package root as before.
20
+
21
+ ## [4.113.0] - 2026-10-30
22
+
23
+ ### Added
24
+
25
+ - **`@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.
26
+ - **`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.
27
+
28
+ ### Changed
29
+
30
+ - **`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.
31
+ - **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.
32
+
8
33
  ## [4.112.0] - 2026-10-30
9
34
 
10
35
  ### Changed
@@ -31,7 +56,6 @@ earlier history lives in git log only.
31
56
  ### Changed
32
57
 
33
58
  - **`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.
34
-
35
59
  ## [4.109.0] - 2026-10-29
36
60
 
37
61
  ### 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.93** — canonical schema **00.33.00**, published 2026-10-30.
3
+ **Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.33.0-dist.94** — 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.