@onlyworlds/sdk 4.160.2 → 4.161.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 +4 -2
- package/CHANGELOG.md +21 -0
- package/SCHEMA.md +1 -1
- package/dist/{chunk-6V4WZ6EC.js → chunk-4VJ2E37X.js} +77 -2
- package/dist/index.d.ts +58 -13
- package/dist/index.js +35 -32
- package/dist/waymark.js +1 -1
- package/package.json +1 -1
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.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.34.0-dist.123** (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
|
|
|
@@ -223,7 +223,9 @@ against live data). The v1 surface (`OnlyWorldsClient`, the `ElementType` enum)
|
|
|
223
223
|
type, id, lens?, moment? })`: `ow://<type>/<id>` in a text field of the same world,
|
|
224
224
|
`ow://<world id>/<type>/<id>` for another world's, the site's address for a person. Read one
|
|
225
225
|
with `parseOwLink(text)`; a refusal throws `OwAddressError` with the profile's `reason`. An
|
|
226
|
-
address in a field is text: never fetch it to show what it names.
|
|
226
|
+
address in a field is text: never fetch it to show what it names. To find one inside prose,
|
|
227
|
+
`readOwLinkAt(text, index)` reads the address starting at `index` and answers `{ reading, end }`
|
|
228
|
+
(null when none starts there): a full stop or a query key after it stays prose.
|
|
227
229
|
- To offer a world or an element in other tools, `openersFor(TOOLS, kind, address, surface)` gives
|
|
228
230
|
the "Open with" rows in order, each `{ id, name, href, state }` with its word ("Sign in to Atlas
|
|
229
231
|
first") or null. Draw them as given; never word a row yourself. For an element, pass it as served
|
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,27 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.161.0] - 2026-11-13
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- `readOwLinkAt(text, index)`: the address that starts exactly at `index` in a text, found in prose, and where it ends: `{ reading, end }`, or null when no address starts there. After `/w/` the run is read whole, once: exactly an id's form (36 characters, hex in either case, four hyphens) is the world's id, any other run is a slug if it is a legal one, else there is no address; it is never cut back to an id or a shorter slug. A run followed by a letter of any script, a combining mark or an underscore is cut inside a word and is no address. Past its path the address continues only with `@` and a moment and `?lens=` and a lens; any other query key, a fragment or a full stop is prose. `index` and `end` count JavaScript string indexes (UTF-16 code units), so they match `text.slice` and `indexOf`. `parseOwLink` is unchanged and still reads a string whole. Holds the address fixture's 57 prose cases.
|
|
13
|
+
|
|
14
|
+
### Changed
|
|
15
|
+
|
|
16
|
+
- Schema repinned to schema-dist `v0.34.0-dist.123` (canonical 00.34.00 unchanged, no schema file moved): times that are read and not ordered, and an address found in prose. Eighty-four new fixture cases across the address, lens, message, record, strand and checks profiles, each passing here (this package has no checks reader).
|
|
17
|
+
- `readMarkOf`: a lone mark is the mark. Among several that count, the one with the newest readable `updated_at` is the mark, wherever it stands in the list; one whose time cannot be read never beats one that can. Among marks equal as instants, however each is written, or when none can be read, the higher id by code point, as written, is the mark, never the earlier one in the list.
|
|
18
|
+
- The lens readers: an element's clock is the newest readable of its `updated_at`, `server_updated_at` and `local_updated_at`, decided element by element; a value that cannot be read is ignored. The budget orders newest first by that clock, an element with no readable clock comes last of its type, and ties by id go by code point, each id as written. `changed_within` cuts by the same clock and keeps an element with no readable clock rather than cutting it `stale`. A message whose `created_at` cannot be read is cut by the mail window, counted `window`.
|
|
19
|
+
- The record readers read `played_at` by the message profile's time grammar: a lower-case `t` and `z`, an offset, no zone and the year 0000 now read; a time without its seconds does not, so a record written without seconds is no record. Records are still ordered to the millisecond.
|
|
20
|
+
- `openersFor`: an element whose own id is held in upper case is one no address can name, so its menu now has no rows instead of throwing, and a surface still draws its mark. An id that differs from the address's by more than case still throws, and the empty answer comes after every other check, so a bad tools row is still refused. The shared openers fixture's held-upper case now wants no rows.
|
|
21
|
+
- `TOOLS` is baked at the tools list's `aa00969`, which adds the OnlyWorlds mapper: its world and element rows need an account, open a public world without one, and skip map space.
|
|
22
|
+
|
|
23
|
+
## [4.160.3] - 2026-11-13
|
|
24
|
+
|
|
25
|
+
### Changed
|
|
26
|
+
|
|
27
|
+
- `list`'s parameters move into its doc comment's first sentence. The docs' reference takes only that sentence, so 4.160.2's wording never reached it.
|
|
28
|
+
|
|
8
29
|
## [4.160.2] - 2026-11-13
|
|
9
30
|
|
|
10
31
|
### Changed
|
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.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.0-dist.123** — canonical schema **00.34.00**, published 2026-11-13.
|
|
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.
|
|
@@ -1380,6 +1380,61 @@ function parseOwLink(text) {
|
|
|
1380
1380
|
const canonical = !worldIsSlug && text === write(form, world, type, id, moment, lens);
|
|
1381
1381
|
return { form, world, worldIsSlug, type, id, lens, moment, canonical };
|
|
1382
1382
|
}
|
|
1383
|
+
var PATH_CHAR = /[0-9A-Za-z\/-]/;
|
|
1384
|
+
var PATH_MAX = 36 + 1 + Math.max(...ELEMENT_TYPES.map((t) => t.length)) + 1 + 36;
|
|
1385
|
+
var ELEMENT_PATH_MAX = 1 + Math.max(...ELEMENT_TYPES.map((t) => t.length)) + 1 + 36;
|
|
1386
|
+
var WORLD_RUN_CHAR = /[0-9a-zA-F-]/;
|
|
1387
|
+
var IN_A_WORD = /^[\p{L}\p{M}_]/u;
|
|
1388
|
+
var STEP_RUN = /^-?[0-9]+/;
|
|
1389
|
+
var ID_LENGTH = 36;
|
|
1390
|
+
function parses(s) {
|
|
1391
|
+
try {
|
|
1392
|
+
parseOwLink(s);
|
|
1393
|
+
return true;
|
|
1394
|
+
} catch (err) {
|
|
1395
|
+
if (err instanceof OwAddressError) return false;
|
|
1396
|
+
throw err;
|
|
1397
|
+
}
|
|
1398
|
+
}
|
|
1399
|
+
function readOwLinkAt(text, index = 0) {
|
|
1400
|
+
if (typeof text !== "string") throw new TypeError("readOwLinkAt: text must be a string");
|
|
1401
|
+
if (typeof index !== "number" || !Number.isInteger(index) || index < 0) throw new TypeError("readOwLinkAt: index must be a whole number from 0");
|
|
1402
|
+
const human = text.startsWith(HUMAN_PREFIX, index);
|
|
1403
|
+
let start;
|
|
1404
|
+
if (human) start = index + HUMAN_PREFIX.length;
|
|
1405
|
+
else if (text.startsWith(TEXT_PREFIX, index)) start = index + TEXT_PREFIX.length;
|
|
1406
|
+
else return null;
|
|
1407
|
+
let end = -1;
|
|
1408
|
+
let floor = start;
|
|
1409
|
+
let run = start;
|
|
1410
|
+
if (human) {
|
|
1411
|
+
let w = start;
|
|
1412
|
+
while (w < text.length && WORLD_RUN_CHAR.test(text[w])) w++;
|
|
1413
|
+
if (IN_A_WORD.test(text.slice(w, w + 2))) return null;
|
|
1414
|
+
const world = text.slice(start, w);
|
|
1415
|
+
if (!isUuid(world) && !(isSlug(world) && !TYPES.has(world))) return null;
|
|
1416
|
+
end = floor = run = w;
|
|
1417
|
+
while (run < text.length && run - w <= ELEMENT_PATH_MAX && PATH_CHAR.test(text[run])) run++;
|
|
1418
|
+
} else {
|
|
1419
|
+
while (run < text.length && run - start <= PATH_MAX && PATH_CHAR.test(text[run])) run++;
|
|
1420
|
+
}
|
|
1421
|
+
for (let p = run; p > floor; p--) {
|
|
1422
|
+
if (parses(text.slice(index, p))) {
|
|
1423
|
+
end = p;
|
|
1424
|
+
break;
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
if (end === -1) return null;
|
|
1428
|
+
if (text[end] === "@") {
|
|
1429
|
+
const step = STEP_RUN.exec(text.slice(end + 1));
|
|
1430
|
+
if (step !== null && parses(text.slice(index, end + 1 + step[0].length))) end += 1 + step[0].length;
|
|
1431
|
+
}
|
|
1432
|
+
if (text.startsWith("?lens=", end)) {
|
|
1433
|
+
const lensEnd = end + 6 + ID_LENGTH;
|
|
1434
|
+
if (lensEnd <= text.length && isUuid(text.slice(end + 6, lensEnd)) && parses(text.slice(index, lensEnd))) end = lensEnd;
|
|
1435
|
+
}
|
|
1436
|
+
return { reading: parseOwLink(text.slice(index, end)), end };
|
|
1437
|
+
}
|
|
1383
1438
|
|
|
1384
1439
|
// src/marks.ts
|
|
1385
1440
|
var ELEMENT_MARKS = ["room", "hidden", "proposed", "map_space", "reading_aid"];
|
|
@@ -1445,11 +1500,13 @@ function openersFor(tools, kind, address, surface, options = {}) {
|
|
|
1445
1500
|
if (options === null || typeof options !== "object" || Array.isArray(options)) fail("the options are an object ({ element })");
|
|
1446
1501
|
refuseUnknownOptions("openersFor", options, OPTION_KEYS2);
|
|
1447
1502
|
const element = options.element ?? null;
|
|
1503
|
+
let unnamed = false;
|
|
1448
1504
|
if (element !== null) {
|
|
1449
1505
|
if (typeof element !== "object" || Array.isArray(element)) fail("options.element is the element as served, an object, or null");
|
|
1450
1506
|
if (kind !== "element") fail("options.element is for an element's menu; a world's menu takes none");
|
|
1451
1507
|
const eid = element.id;
|
|
1452
|
-
if (typeof eid !== "string" || eid !== id) fail("options.element is the element the address names: its id differs");
|
|
1508
|
+
if (typeof eid !== "string" || eid.toLowerCase() !== id) fail("options.element is the element the address names: its id differs");
|
|
1509
|
+
unnamed = eid !== id;
|
|
1453
1510
|
}
|
|
1454
1511
|
const marks = element === null ? [] : marksOf(element);
|
|
1455
1512
|
const values = { world, type, id };
|
|
@@ -1501,7 +1558,7 @@ function openersFor(tools, kind, address, surface, options = {}) {
|
|
|
1501
1558
|
else if (kind === "element" && elementDoor === null) state = "Opens the world";
|
|
1502
1559
|
rows.push({ id: r.id, name: r.name, href, state });
|
|
1503
1560
|
}
|
|
1504
|
-
return rows;
|
|
1561
|
+
return unnamed ? [] : rows;
|
|
1505
1562
|
}
|
|
1506
1563
|
|
|
1507
1564
|
// src/tools.generated.ts
|
|
@@ -1601,6 +1658,23 @@ var TOOLS = [
|
|
|
1601
1658
|
"client": null,
|
|
1602
1659
|
"rung": "listed",
|
|
1603
1660
|
"open": null
|
|
1661
|
+
},
|
|
1662
|
+
{
|
|
1663
|
+
"id": "mapper",
|
|
1664
|
+
"name": "OnlyWorlds mapper",
|
|
1665
|
+
"url": "https://maps.onlyworlds.com",
|
|
1666
|
+
"client": "mapper",
|
|
1667
|
+
"rung": "listed",
|
|
1668
|
+
"open": {
|
|
1669
|
+
"world": "https://maps.onlyworlds.com/?world={world}",
|
|
1670
|
+
"element": "https://maps.onlyworlds.com/?world={world}&type={type}&element={id}",
|
|
1671
|
+
"needs": "account",
|
|
1672
|
+
"element_skips": [
|
|
1673
|
+
"map_space"
|
|
1674
|
+
],
|
|
1675
|
+
"element_types": null,
|
|
1676
|
+
"opens_public": true
|
|
1677
|
+
}
|
|
1604
1678
|
}
|
|
1605
1679
|
];
|
|
1606
1680
|
|
|
@@ -1740,6 +1814,7 @@ export {
|
|
|
1740
1814
|
OwAddressError,
|
|
1741
1815
|
elementAddress,
|
|
1742
1816
|
parseOwLink,
|
|
1817
|
+
readOwLinkAt,
|
|
1743
1818
|
openersFor,
|
|
1744
1819
|
TOOLS,
|
|
1745
1820
|
doorsOf,
|
package/dist/index.d.ts
CHANGED
|
@@ -2151,8 +2151,12 @@ declare function editedBy(message: object | null | undefined, members: Members):
|
|
|
2151
2151
|
* mark another hand changed since it was made is ignored, the owner's hand included, and a mark
|
|
2152
2152
|
* with `changed_by` but no `created_by` is ignored too (a writer with no creator is no hand). A
|
|
2153
2153
|
* mark with neither key (a folder, an export) has no hand to check and counts. Of several that
|
|
2154
|
-
* count, the newest `updated_at` is the mark wherever it stands in
|
|
2155
|
-
*
|
|
2154
|
+
* count, the newest `updated_at` read as an instant (`instantOf`) is the mark wherever it stands in
|
|
2155
|
+
* the list, and one whose `updated_at` cannot be read (absent, a date alone, anything `instantOf`
|
|
2156
|
+
* refuses) never beats one that can, in either order. Among equal instants, however each is written
|
|
2157
|
+
* (`10:00:00Z` and `11:00:00+01:00`), or when none can be read, the higher `id` by code point as
|
|
2158
|
+
* written is the mark, never the first in the list (serial 123; an id that is not a string is the
|
|
2159
|
+
* lowest). A lone mark is the mark, its time read or not. A newer one in another's hand is ignored and the
|
|
2156
2160
|
* reader's own stands. Null for bodies read keyless (`{ keyless: true }`): the keyless public
|
|
2157
2161
|
* reader is served no `created_by` or `changed_by` on any body, so its marks carry neither because
|
|
2158
2162
|
* the hands were taken off, not because they are a folder's, and none counts.
|
|
@@ -2283,6 +2287,7 @@ declare const DATE_FIELD: Readonly<Record<string, string>>;
|
|
|
2283
2287
|
* reads null, whatever the element's own date is.
|
|
2284
2288
|
*/
|
|
2285
2289
|
declare function dateOf(element: object | null | undefined): number | null;
|
|
2290
|
+
|
|
2286
2291
|
/**
|
|
2287
2292
|
* True when the element is a lens: a Construct with supertype `Lens`, the type and the supertype each
|
|
2288
2293
|
* trimmed (Unicode White_Space at both ends) and compared without regard to case, the whole word
|
|
@@ -2320,7 +2325,9 @@ declare function lensesInUse(membership: readonly string[] | null | undefined, x
|
|
|
2320
2325
|
* compared exact against the 22 slugs); an umbrella enters each child lens once, each child keeping its own budget and mail rule, the rows made by the umbrella's `show`; a hop never crosses a room
|
|
2321
2326
|
* element; a reading aid (the charter, its guide, a domain: `isCharterElement`) a hop reaches is kept, and
|
|
2322
2327
|
* hopped on from, only when `types` names its pair, while one the lens names as an anchor is kept and
|
|
2323
|
-
* followed; anchors first in link order, then by type in the schema's order, newest first
|
|
2328
|
+
* followed; anchors first in link order, then by type in the schema's order, newest first by the clock
|
|
2329
|
+
* `changed_within` reads (the newest of its readable `updated_at`, `server_updated_at` and `local_updated_at`; none
|
|
2330
|
+
* readable, last of its type), then by id;
|
|
2324
2331
|
* an anchor the reader cannot see (an id naming no element, or one of another type than its field's, too)
|
|
2325
2332
|
* is skipped and counted for the owner (`anchor_not_visible`, before any other reason), while for any other reader
|
|
2326
2333
|
* it is not there at all, so a child lens's cut of the same element counts under the child's reason; a template
|
|
@@ -4820,10 +4827,10 @@ declare class OwV2Client {
|
|
|
4820
4827
|
*/
|
|
4821
4828
|
members(): Promise<OwMember[]>;
|
|
4822
4829
|
/**
|
|
4823
|
-
* GET /{type}/ -- one cursor page
|
|
4824
|
-
* (the wire filters), `ids`, `createdBy`, `expand`, `fields`, `viewAs` (an owner key) and `signal
|
|
4825
|
-
* refused before anything is sent. On a client with `world` set (an account token or no key), it reads that
|
|
4826
|
-
* sending `world=<id>` beside the page's own parameters.
|
|
4830
|
+
* GET /{type}/ -- one cursor page, shaped by `params`: `limit` (up to 1000), `cursor` (a page's `next_cursor`),
|
|
4831
|
+
* `filter` (the wire filters), `ids`, `createdBy`, `expand`, `fields`, `viewAs` (an owner key) and `signal`. Any other
|
|
4832
|
+
* key is refused before anything is sent. On a client with `world` set (an account token or no key), it reads that
|
|
4833
|
+
* world, sending `world=<id>` beside the page's own parameters.
|
|
4827
4834
|
*/
|
|
4828
4835
|
list(type: ElementType | string, params?: ListParams): Promise<OwPage>;
|
|
4829
4836
|
/**
|
|
@@ -5979,7 +5986,7 @@ declare const RECORD_FIELD = "x_record";
|
|
|
5979
5986
|
interface OwRecordMark {
|
|
5980
5987
|
/** The game, in the tools list's id form (`[a-z0-9-]`, 1 to 32). */
|
|
5981
5988
|
tool: string;
|
|
5982
|
-
/** When the run was played
|
|
5989
|
+
/** When the run was played, as written: real time (never world time), a time the message grammar reads (`instantOf`). */
|
|
5983
5990
|
played_at: string;
|
|
5984
5991
|
/** The engine's version; with `seed`, the replay. */
|
|
5985
5992
|
version: string | null;
|
|
@@ -6014,13 +6021,15 @@ interface OwRecord {
|
|
|
6014
6021
|
}
|
|
6015
6022
|
/**
|
|
6016
6023
|
* The record's mark on an element, read: the mark when the element is an Event whose `x_record` has the profile's
|
|
6017
|
-
* shape, else null. A broken writer never shows as a record: a missing or malformed `tool
|
|
6018
|
-
*
|
|
6024
|
+
* shape, else null. A broken writer never shows as a record: a missing or malformed `tool`, a `played_at` the
|
|
6025
|
+
* message page's grammar cannot read (`instantOf`'s, serial 123: seconds required, `T` and `Z` in either case, an
|
|
6026
|
+
* offset or no zone read), or an optional member that is anything but its kind, null or absent, is no mark.
|
|
6019
6027
|
*/
|
|
6020
6028
|
declare function recordMarkOf(element: unknown): OwRecordMark | null;
|
|
6021
6029
|
/**
|
|
6022
6030
|
* A Character's records in a world: every Event with the record mark whose `characters` names them, newest first by
|
|
6023
|
-
* `played_at`
|
|
6031
|
+
* `played_at` read as an instant to the millisecond (a fraction truncated past three digits; ties by the Event's id in
|
|
6032
|
+
* code point order), each with the stories that are theirs. An id no record
|
|
6024
6033
|
* names, or one in no element, reads an empty list. `elements` is the world as this reader is served it.
|
|
6025
6034
|
*/
|
|
6026
6035
|
declare function recordsOf(characterId: string, elements: readonly unknown[]): OwRecord[];
|
|
@@ -6572,6 +6581,40 @@ declare function elementAddress(address: OwAddress | OwAddressReading): string;
|
|
|
6572
6581
|
* canonical); the text forms take the id only. Ids are read in either case of hex and given lowercase.
|
|
6573
6582
|
*/
|
|
6574
6583
|
declare function parseOwLink(text: string): OwAddressReading;
|
|
6584
|
+
/** What `readOwLinkAt` answers: the address read, and the index just past it in the text. */
|
|
6585
|
+
interface OwAddressAt {
|
|
6586
|
+
/** What `parseOwLink` answers for `text.slice(index, end)`. */
|
|
6587
|
+
reading: OwAddressReading;
|
|
6588
|
+
/** The index just past the address: the text's first character that is not part of it, or its length. */
|
|
6589
|
+
end: number;
|
|
6590
|
+
}
|
|
6591
|
+
/**
|
|
6592
|
+
* The address that starts exactly at `index` in a text, found in prose, and where it ends; null when the text there is
|
|
6593
|
+
* not an address. Both forms, `ow://` and `https://www.onlyworlds.com/w/`, the prefix as written (lowercase). In the
|
|
6594
|
+
* site's form the run after `/w/` is read whole, once, with no order between an id and a slug: it ends at the first
|
|
6595
|
+
* character outside the slug's alphabet (lowercase letters, digits, hyphens) or the id's (hex in either case); exactly
|
|
6596
|
+
* an id's form is the id, any other run `parseOwLink` reads as a slug is the slug (not a type word, no closing hyphen,
|
|
6597
|
+
* 3 to 40 characters), else no address; a run followed by a letter (any script), a combining mark or an underscore
|
|
6598
|
+
* is cut inside a word and is no address (`/w/mopPetopia.`, `/w/hyper_ion.`). After the world, or in the text form from the prefix, the path
|
|
6599
|
+
* is the longest one `parseOwLink` reads; after it the address continues only with `@` and a moment (the parser's step
|
|
6600
|
+
* grammar, its whole run of an optional minus and digits) and then `?lens=` and a lens (an id, which ends where its 36
|
|
6601
|
+
* characters end). Any other query key or a fragment is not part of an address found in prose: the address ends
|
|
6602
|
+
* before its `?`, `&` or `#`, and a `@` or `?lens=` whose value does not read is not taken (the address ends before
|
|
6603
|
+
* it). What follows is prose, a full stop included (serial 123).
|
|
6604
|
+
*
|
|
6605
|
+
* `end` is the index just past the address and `reading` what `parseOwLink` answers for `text.slice(index, end)`,
|
|
6606
|
+
* which `parseOwLink` itself still reads whole, unchanged: `ow://object/<id>.` handed to it whole is refused.
|
|
6607
|
+
* `index` and `end` count JavaScript string indexes (UTF-16 code units), so they match `text.slice` and `indexOf`. A text that is not a string, or an index that is not a
|
|
6608
|
+
* whole number from 0, is a TypeError; an index past the end reads nothing.
|
|
6609
|
+
*
|
|
6610
|
+
* ```ts
|
|
6611
|
+
* const line = 'Built the gate: ow://object/01a1d4ef-0000-7000-8000-000000000084.';
|
|
6612
|
+
* const found = readOwLinkAt(line, 16);
|
|
6613
|
+
* found?.end; // 64: line[64] is the full stop
|
|
6614
|
+
* found?.reading.id; // '01a1d4ef-0000-7000-8000-000000000084'
|
|
6615
|
+
* ```
|
|
6616
|
+
*/
|
|
6617
|
+
declare function readOwLinkAt(text: string, index?: number): OwAddressAt | null;
|
|
6575
6618
|
|
|
6576
6619
|
/** One reason a lore view leaves an element out, as the graph section names it. */
|
|
6577
6620
|
type OwElementMark = 'room' | 'hidden' | 'proposed' | 'map_space' | 'reading_aid';
|
|
@@ -6682,7 +6725,9 @@ interface OwOpener {
|
|
|
6682
6725
|
* wrong type, an element given for a world's menu or naming another element than the address, a tools row
|
|
6683
6726
|
* that is not one (a `needs`, an `element_skips` or an `element_types` word outside the list's format, an
|
|
6684
6727
|
* empty `element_types`, `element_types` on a row with no element door, or an `opens_public` that is
|
|
6685
|
-
* not true or false, or true beside a `needs` other than `account`, included).
|
|
6728
|
+
* not true or false, or true beside a `needs` other than `account`, included). An element whose own id is held
|
|
6729
|
+
* in upper case, the address's lowercase id otherwise its own, is no refusal: no address can name it, so the
|
|
6730
|
+
* answer is no rows (serial 123's release), and a surface draws its mark with an empty menu.
|
|
6686
6731
|
*/
|
|
6687
6732
|
declare function openersFor(tools: readonly OwTool[], kind: OwOpenerKind, address: OwAddress | OwAddressReading, surface: OwOpenerSurface, options?: OwOpenersOptions): OwOpener[];
|
|
6688
6733
|
|
|
@@ -7884,4 +7929,4 @@ declare class TokenResource {
|
|
|
7884
7929
|
getEncryptionInfo(): Promise<EncryptionInfo>;
|
|
7885
7930
|
}
|
|
7886
7931
|
|
|
7887
|
-
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutOf, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwReportGroup, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwView, type OwViewRow, type OwViewsTable, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, type OwWorldLens, type OwWorldLensReading, type OwWorldLenses, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, compareInstants, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
|
7932
|
+
export { AGENT_DOORS, ASK_LIMITS, type AccessKeyResponse, CALENDAR_FIELD, CALENDAR_SUPERTYPE, CHARTER_PAIRS, type CalendarConfig, type CalendarEra, type CalendarIntercalary, type CalendarMonths, type CalendarWeek, DATE_FIELD, ELEMENT_FAMILIES, ELEMENT_GROUPS, ELEMENT_ICONS, ELEMENT_LABELS, ELEMENT_SECTIONS, ELEMENT_TYPES, type ElementFamily, type ElementGroup, type ElementType, type EncryptionInfo, type EraDomain, FAMILY_COLORS, FAMILY_ORDER, FIELD_ACRONYMS, FIELD_SCHEMA, FILE_EXTENSIONS, type FieldInfo, type FieldType, GROUP_COLORS, GROUP_ORDER, GameTier, type ListParams, MESSAGE_PAIR, NOTE_PAIR, ONLYWORLDS_VERSION, type OwAccountToken, type OwAccountWorld, type OwAddress, type OwAddressAt, OwAddressError, type OwAddressForm, type OwAddressReading, type OwAddressReason, type OwAddressingOptions, type OwAgentJoined, type OwAiAskAnswer, type OwAiAskBody, type OwAiMeter, type OwAiRefusal, type OwAiSortAnswer, type OwAiSortBody, type OwAiToken, type OwAiUse, type OwAllowance, OwApiError, type OwAskAnswer, type OwAskContext, type OwAskContextOptions, type OwAskLeftOut, type OwAuthErrorCode, type OwBulkItem, type OwBulkItemResult, type OwBulkResponse, type OwCalendarElement, type OwChange, type OwChangeDelete, type OwChangeUpsert, type OwChangesPage, type OwCharterWorld, type OwClientConfig, type OwCreateAccountWorldInput, type OwCreatedAccountWorld, type OwCreatedWorldLink, type OwDeleteReason, type OwDoor, type OwDragField, type OwDraught, type OwDraughtCompact, type OwDraughtComponent, type OwDraughtItem, type OwDraughtLens, type OwDraughtPolicy, type OwEdited, type OwElement, type OwElementBase, type OwElementMark, type OwErrorBody, type OwFileAddedBy, type OwFileDownload, type OwFileKind, type OwFileRow, type OwFileTicket, type OwFrontDoor, type OwGraphCutReason, type OwGraphEdge, type OwGraphMark, type OwGraphNode, type OwGraphOptions, type OwHiddenRow, type OwInstant, type OwJoinPreview, type OwJoined, type OwJoinedMembership, type OwKeyKind, type OwLanding, type OwLandingCluster, type OwLandingGap, type OwLandingGapKind, type OwLandingMember, type OwLandingMode, type OwLandingOptions, type OwLayoutOf, type OwLensCutReason, type OwLensMail, type OwLensOptions, type OwLensReader, type OwLensReading, type OwLensWorld, type OwLinkEdit, type OwLookupElement, type OwLookupHit, type OwLookupLink, type OwLookupOptions, type OwLookupReason, type OwMapSpace, type OwMapSpaceMap, type OwMapSpaceOutReason, type OwMapSpaceOutline, type OwMapSpacePin, type OwMapSpacePoint, type OwMe, type OwMediaTicket, type OwMember, type OwMemberLenses, type OwMemberRole, type OwMessageMember, type OwMintedAiToken, type OwMintedKey, type OwMySeat, type OwNamesMap, OwNetworkError, type OwOpener, type OwOpenerKind, type OwOpenerState, type OwOpenerSurface, type OwOpenersOptions, type OwPage, type OwPaidBy, type OwPhotoOptions, type OwPhotoPlan, type OwPlayerJoined, OwPreconditionFailedError, type OwPreparedPhoto, type OwProposal, type OwProposalAccepted, type OwProposalConflict, type OwProposalList, type OwProposalQuery, type OwProposalState, type OwProposeInput, type OwProposed, OwProposedError, type OwProposedMark, type OwProposedNewElement, type OwReadWorldFile, type OwReadWorldFileOptions, type OwReadingAids, type OwReadingAidsCharter, type OwReadingAidsDomain, type OwReadingAidsGuide, type OwReadingAidsHub, type OwRecord, type OwRecordMark, type OwRecordStory, type OwRemovalTicket, type OwRemovedImage, type OwRenderOptions, type OwReportGroup, type OwReportLint, type OwReportParentKind, type OwReportThreads, type OwResyncReason, type OwReviewInput, type OwReviewed, type OwSearchResult, type OwSearchResults, type OwSeat, type OwSeatCreated, type OwSender, type OwSenderStatus, type OwServedReadingAids, type OwSignInBegin, type OwSignInBegun, type OwSignInComplete, OwSignInError, type OwSignInReason, type OwSignInResult, type OwSignInStorage, type OwSignedIn, type OwSortAddToRow, type OwSortAnswer, type OwSortAskRow, type OwSortLinkRow, type OwSortMakeRow, type OwSortNote, type OwSortRef, type OwSortRow, OwStaleProposalError, type OwStrand, type OwStrandSlot, type OwStrandWorld, type OwTool, type OwToolNeeds, type OwToolOpen, type OwTrailGround, type OwTrailHanger, type OwTrailInput, type OwTrailLayout, type OwTrailPin, type OwTrailPlace, type OwTrailSettings, type OwTrailSpiral, type OwTrailTier, type OwUploadedFile, type OwUploadedImage, OwV2Client, type OwView, type OwViewRow, type OwViewsTable, type OwWordPair, type OwWorldFileEntry, OwWorldFileError, type OwWorldFileReason, type OwWorldFileRow, type OwWorldFiles, type OwWorldGraph, type OwWorldIndex, type OwWorldKeyMember, type OwWorldKeyRow, type OwWorldLens, type OwWorldLensReading, type OwWorldLenses, type OwWorldLink, type OwWorldMeta, type OwWorldOrigin, type OwWorldProducer, type OwWorldProposalList, type OwWorldProposalQuery, type OwWorldProposalRow, type OwWorldPublicPage, type OwWorldSource, type OwWriteDoor, type OwWriteWorldFileOptions, type OwWriteWorldFileReport, PHOTO_MAX_BYTES, PHOTO_TYPES, PROPOSED_MARK, PUBLIC_FIELDS, type ParseError, type ParseOptions, type ParseResult, RECORD_FIELD, REVIEW_PROPOSED_LABEL, ROOM_PAIRS, type RevokeAllSessionsResponse, type RevokeSessionResponse, SPATIAL_TYPES, STRAND_FIELD, type SectionInfo, type StepBreakdown, TOOLS, TRAIL_TIERS, type TokenConsumeParams, type TokenConsumeResponse, TokenResource, type TokenStatus, type TokenTransport, VIEWS, WORLD_FILE_MAX_BYTES, WORLD_FILE_MAX_ENTRIES, WORLD_FILE_MEDIA_TYPE, type WorldCalendar, absYearForEraYear, absoluteYear, approxYearLength, base64url, breakdownStep, buildAskContext, buildWorldIndex, charterOf, compareInstants, dateOf, degreeOf, detectKeyKind, displayYear, domainsOf, doorWhere, doorsOf, dragField, draughtText, editedBy, elementAddress, elementColor, eraForStep, errorFromResponse, familyOf, fieldLabel, fileKindOf, floorDiv, floorMod, formatDuration, formatMidLabel, formatStep, formatYearLabel, getElementIcon, getElementLabel, groupOf, handsOnAsProposed, hasUnseenRecipients, instantOf, intercalaryInYear, isAddressedTo, isAgentDoor, isCharterElement, isDemoKey, isKnownOf, isLeapYear, isLens, isMessage, isNote, isParseError, isRoomElement, isSentBy, isTemplate, isToEveryone, kindCanWrite, landingOf, layoutOf, lensesInUse, lookupWorld, mapSpace, monthStartSteps, nfc, noteOf, openersFor, outDegreeOf, parseDate, parseErrorEnvelope, parseOwLink, pinExpectation, pkceChallenge, planPhoto, preparePhoto, proposedMarkOf, readCalendarConfig, readCalendarValue, readMarkOf, readOwLinkAt, readWorldFile, readingAidOf, recipientsOf, recordMarkOf, recordsOf, renderElement, reportThreadsOf, resolveCalendar, resolveCalendarLens, resolveEraDomains, resolveLens, roundHalfEven, senderStatus, simpleCaseFold, strandOf, threadOf, trailByPlace, typeWord, unreadFor, validateCalendarConfig, viewOf, weekdayForStep, worldCalendars, worldGraph, writeWorldFile, yearLength, yearStartStep };
|
package/dist/index.js
CHANGED
|
@@ -38,6 +38,7 @@ import {
|
|
|
38
38
|
openersFor,
|
|
39
39
|
parseOwLink,
|
|
40
40
|
proposedMarkOf,
|
|
41
|
+
readOwLinkAt,
|
|
41
42
|
readingAidKey,
|
|
42
43
|
readingAidOf,
|
|
43
44
|
refuseUnknownOptions,
|
|
@@ -45,7 +46,7 @@ import {
|
|
|
45
46
|
trimWhiteSpace,
|
|
46
47
|
typeWord,
|
|
47
48
|
unknownKey
|
|
48
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-4VJ2E37X.js";
|
|
49
50
|
|
|
50
51
|
// src/v2/keyed-id.ts
|
|
51
52
|
var KEYED_IDS = "0199b6a0-6f0e-7c2a-9d1e-3b5c7a8e4f21";
|
|
@@ -969,10 +970,10 @@ var OwV2Client = class {
|
|
|
969
970
|
}
|
|
970
971
|
// -- Element CRUD --------------------------------------------------------
|
|
971
972
|
/**
|
|
972
|
-
* GET /{type}/ -- one cursor page
|
|
973
|
-
* (the wire filters), `ids`, `createdBy`, `expand`, `fields`, `viewAs` (an owner key) and `signal
|
|
974
|
-
* refused before anything is sent. On a client with `world` set (an account token or no key), it reads that
|
|
975
|
-
* sending `world=<id>` beside the page's own parameters.
|
|
973
|
+
* GET /{type}/ -- one cursor page, shaped by `params`: `limit` (up to 1000), `cursor` (a page's `next_cursor`),
|
|
974
|
+
* `filter` (the wire filters), `ids`, `createdBy`, `expand`, `fields`, `viewAs` (an owner key) and `signal`. Any other
|
|
975
|
+
* key is refused before anything is sent. On a client with `world` set (an account token or no key), it reads that
|
|
976
|
+
* world, sending `world=<id>` beside the page's own parameters.
|
|
976
977
|
*/
|
|
977
978
|
async list(type, params = {}) {
|
|
978
979
|
only("list", params, LIST_PARAM_KEYS, LIST_FILTER_HINT);
|
|
@@ -2842,6 +2843,16 @@ function compareInstants(a, b) {
|
|
|
2842
2843
|
return a.seconds - b.seconds || a.microseconds - b.microseconds;
|
|
2843
2844
|
}
|
|
2844
2845
|
var compareKeys = (a, b) => a[0] - b[0] || a[1] - b[1];
|
|
2846
|
+
function byCodePoint(a, b) {
|
|
2847
|
+
const x = Array.from(a);
|
|
2848
|
+
const y = Array.from(b);
|
|
2849
|
+
const n = Math.min(x.length, y.length);
|
|
2850
|
+
for (let i = 0; i < n; i++) {
|
|
2851
|
+
const d = x[i].codePointAt(0) - y[i].codePointAt(0);
|
|
2852
|
+
if (d !== 0) return d;
|
|
2853
|
+
}
|
|
2854
|
+
return x.length - y.length;
|
|
2855
|
+
}
|
|
2845
2856
|
function inCreatedOrder(items) {
|
|
2846
2857
|
return items.map((item, index) => ({ item, index, key: timeKey(item.created_at) })).sort((a, b) => {
|
|
2847
2858
|
if (a.key && b.key) return compareKeys(a.key, b.key) || a.index - b.index;
|
|
@@ -2897,6 +2908,7 @@ function editedBy(message, members) {
|
|
|
2897
2908
|
if (carries(message, "created_by") && message.changed_by === message.created_by) return { edited: false, by: null };
|
|
2898
2909
|
return { edited: true, by: characterOf(message.changed_by, members) ?? null };
|
|
2899
2910
|
}
|
|
2911
|
+
var tieId = (body) => typeof body.id === "string" ? body.id : "";
|
|
2900
2912
|
function readMarkOf(relations, characterId, members, options) {
|
|
2901
2913
|
const keyless = keylessOf("readMarkOf", options);
|
|
2902
2914
|
if (keyless || !Array.isArray(relations) || typeof characterId !== "string" || characterId === "") return null;
|
|
@@ -2908,7 +2920,8 @@ function readMarkOf(relations, characterId, members, options) {
|
|
|
2908
2920
|
if (carries(rel, "changed_by") && (!hasAuthor || rel.changed_by !== rel.created_by)) continue;
|
|
2909
2921
|
if (hasAuthor && handOf(rel, members) !== characterId) continue;
|
|
2910
2922
|
const key = timeKey(rel.updated_at);
|
|
2911
|
-
|
|
2923
|
+
const c = key !== null && markKey !== null ? compareKeys(key, markKey) : key !== null ? 1 : markKey !== null ? -1 : 0;
|
|
2924
|
+
if (mark === null || c > 0 || c === 0 && byCodePoint(tieId(rel), tieId(mark)) > 0) {
|
|
2912
2925
|
mark = rel;
|
|
2913
2926
|
markKey = key;
|
|
2914
2927
|
}
|
|
@@ -3073,20 +3086,10 @@ function dateOf(element) {
|
|
|
3073
3086
|
return whole(valueOf(element, DATE_FIELD[type]));
|
|
3074
3087
|
}
|
|
3075
3088
|
function changedAt(el) {
|
|
3076
|
-
const stamps = [timeKey(valueOf(el, "server_updated_at")), timeKey(valueOf(el, "local_updated_at"))].filter((k) => k !== null);
|
|
3077
|
-
if (stamps.length === 0) return
|
|
3089
|
+
const stamps = [timeKey(valueOf(el, "updated_at")), timeKey(valueOf(el, "server_updated_at")), timeKey(valueOf(el, "local_updated_at"))].filter((k) => k !== null);
|
|
3090
|
+
if (stamps.length === 0) return null;
|
|
3078
3091
|
return stamps.reduce((a, b) => compareKeys(a, b) >= 0 ? a : b);
|
|
3079
3092
|
}
|
|
3080
|
-
function byCodePoint(a, b) {
|
|
3081
|
-
const x = Array.from(a);
|
|
3082
|
-
const y = Array.from(b);
|
|
3083
|
-
const n = Math.min(x.length, y.length);
|
|
3084
|
-
for (let i = 0; i < n; i++) {
|
|
3085
|
-
const d = x[i].codePointAt(0) - y[i].codePointAt(0);
|
|
3086
|
-
if (d !== 0) return d;
|
|
3087
|
-
}
|
|
3088
|
-
return x.length - y.length;
|
|
3089
|
-
}
|
|
3090
3093
|
function copy(v) {
|
|
3091
3094
|
if (Array.isArray(v)) return v.map(copy);
|
|
3092
3095
|
if (isBody2(v)) {
|
|
@@ -3427,8 +3430,8 @@ var Reading = class {
|
|
|
3427
3430
|
}
|
|
3428
3431
|
/**
|
|
3429
3432
|
* `changed_within`: changed longer ago than that many days before the reading's wall clock. The time read is the
|
|
3430
|
-
* element's `
|
|
3431
|
-
*
|
|
3433
|
+
* element's clock (`changedAt`: the newest of its readable `updated_at`, `server_updated_at` and
|
|
3434
|
+
* `local_updated_at`); an element with no readable clock is kept, never cut.
|
|
3432
3435
|
*/
|
|
3433
3436
|
staleCut(id, recipe, wall) {
|
|
3434
3437
|
if (recipe.changedWithin === null) return null;
|
|
@@ -3451,9 +3454,13 @@ var Reading = class {
|
|
|
3451
3454
|
const aid = this.aid.get(id);
|
|
3452
3455
|
return aid !== void 0 && !(recipe.types !== null && recipe.types.has(aid));
|
|
3453
3456
|
}
|
|
3454
|
-
/**
|
|
3457
|
+
/**
|
|
3458
|
+
* Rule 5's order past the anchors: the schema's type order, then newest first by the element's clock, the one
|
|
3459
|
+
* `changed_within` reads (`changedAt`: the newest of its readable `updated_at`, `server_updated_at` and
|
|
3460
|
+
* `local_updated_at`; serial 123), an element with no readable clock last of its type, then by id.
|
|
3461
|
+
*/
|
|
3455
3462
|
sort(ids) {
|
|
3456
|
-
const keyed = [...ids].map((id) => ({ id, rank: TYPE_RANK.get(this.typeOf.get(id)), at:
|
|
3463
|
+
const keyed = [...ids].map((id) => ({ id, rank: TYPE_RANK.get(this.typeOf.get(id)), at: changedAt(this.byId.get(id)) }));
|
|
3457
3464
|
keyed.sort((a, b) => {
|
|
3458
3465
|
if (a.rank !== b.rank) return a.rank - b.rank;
|
|
3459
3466
|
if (a.at && b.at) {
|
|
@@ -3809,20 +3816,15 @@ function strandOf(world, reader) {
|
|
|
3809
3816
|
// src/record.ts
|
|
3810
3817
|
var RECORD_FIELD = "x_record";
|
|
3811
3818
|
var TOOL = /^[a-z0-9-]{1,32}$/;
|
|
3812
|
-
var PLAYED_AT = /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2})(?::(\d{2})(?:\.\d+)?)?Z$/;
|
|
3813
3819
|
var OUTCOME = /^[a-z]{1,24}$/;
|
|
3814
3820
|
var isObject = (v) => v !== null && typeof v === "object" && !Array.isArray(v);
|
|
3815
3821
|
var unsetOr = (v, test) => v === void 0 || v === null || test(v);
|
|
3816
3822
|
var isString = (v) => typeof v === "string";
|
|
3817
3823
|
var list = (v) => Array.isArray(v) ? v : [];
|
|
3818
3824
|
var cp = byCodePoint;
|
|
3819
|
-
function
|
|
3820
|
-
const
|
|
3821
|
-
|
|
3822
|
-
const [y, mo, d, h, mi, se] = [m[1], m[2], m[3], m[4], m[5], m[6] ?? "0"].map(Number);
|
|
3823
|
-
const leap = y % 4 === 0 && y % 100 !== 0 || y % 400 === 0;
|
|
3824
|
-
const days = [31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][mo - 1];
|
|
3825
|
-
return days !== void 0 && d >= 1 && d <= days && h <= 23 && mi <= 59 && se <= 59 && y >= 1;
|
|
3825
|
+
function playedKey(s) {
|
|
3826
|
+
const key = timeKey(s);
|
|
3827
|
+
return key === null ? null : [key[0], Math.floor(key[1] / 1e3)];
|
|
3826
3828
|
}
|
|
3827
3829
|
var proposed = (el) => proposedMarkOf(el) !== null;
|
|
3828
3830
|
function recordMarkOf(element) {
|
|
@@ -3830,7 +3832,7 @@ function recordMarkOf(element) {
|
|
|
3830
3832
|
const m = element[RECORD_FIELD];
|
|
3831
3833
|
if (!isObject(m)) return null;
|
|
3832
3834
|
if (!isString(m.tool) || !TOOL.test(m.tool)) return null;
|
|
3833
|
-
if (!isString(m.played_at) ||
|
|
3835
|
+
if (!isString(m.played_at) || playedKey(m.played_at) === null) return null;
|
|
3834
3836
|
if (!unsetOr(m.version, isString)) return null;
|
|
3835
3837
|
if (!unsetOr(m.seed, isString)) return null;
|
|
3836
3838
|
if (!unsetOr(m.outcome, (v) => isString(v) && OUTCOME.test(v))) return null;
|
|
@@ -3879,7 +3881,7 @@ function recordsOf(characterId, elements) {
|
|
|
3879
3881
|
stories
|
|
3880
3882
|
});
|
|
3881
3883
|
}
|
|
3882
|
-
out.sort((a, b) =>
|
|
3884
|
+
out.sort((a, b) => compareKeys(playedKey(b.played_at), playedKey(a.played_at)) || cp(a.event.id, b.event.id));
|
|
3883
3885
|
return out;
|
|
3884
3886
|
}
|
|
3885
3887
|
|
|
@@ -6973,6 +6975,7 @@ export {
|
|
|
6973
6975
|
readCalendarConfig,
|
|
6974
6976
|
readCalendarValue,
|
|
6975
6977
|
readMarkOf,
|
|
6978
|
+
readOwLinkAt,
|
|
6976
6979
|
readWorldFile,
|
|
6977
6980
|
readingAidOf,
|
|
6978
6981
|
recipientsOf,
|
package/dist/waymark.js
CHANGED
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
openersFor,
|
|
7
7
|
refuseUnknownOptions,
|
|
8
8
|
typeWord
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4VJ2E37X.js";
|
|
10
10
|
|
|
11
11
|
// src/waymark/glyphs.ts
|
|
12
12
|
var MARK_PATH = "M100 50C100 63.261 94.732 75.979 85.355 85.355C75.979 94.732 63.261 100 50 100C36.739 100 24.021 94.732 14.645 85.355C5.268 75.979 0 63.261 0 50C0 36.739 5.268 24.021 14.645 14.645C24.021 5.268 36.739 0 50 0C63.261 0 75.979 5.268 85.355 14.645C94.732 24.021 100 36.739 100 50ZM20.479 78.74C22.377 77.765 24.322 76.884 26.306 76.102Q25.845 75.042 25.421 73.934Q24.026 70.291 23.069 66.268Q22.121 62.281 21.637 58.063Q21.252 54.707 21.171 51.3L8.82 51.3C9.144 61.572 13.298 71.363 20.479 78.74ZM91.18 51.3L78.829 51.3Q78.748 54.707 78.363 58.063Q77.879 62.281 76.931 66.268Q75.974 70.291 74.579 73.934Q74.155 75.041 73.694 76.102C75.678 76.884 77.623 77.765 79.521 78.74C86.702 71.363 90.856 61.572 91.18 51.3ZM8.82 48.7L21.154 48.7Q21.195 44.785 21.637 40.937Q22.121 36.719 23.069 32.732Q24.026 28.709 25.421 25.066Q25.676 24.401 25.943 23.754C24.085 23.008 22.262 22.176 20.479 21.26C13.298 28.637 9.144 38.428 8.82 48.7ZM79.521 21.26C77.738 22.176 75.915 23.008 74.057 23.754Q74.324 24.401 74.579 25.066Q75.974 28.709 76.931 32.732Q77.879 36.719 78.363 40.937Q78.805 44.785 78.846 48.7L91.18 48.7C90.856 38.428 86.702 28.637 79.521 21.26ZM32.455 48.7L44.2 48.7L44.2 28.139C41.714 27.915 39.253 27.548 36.827 27.043Q36.381 28.044 35.974 29.107Q34.846 32.052 34.063 35.347Q33.27 38.678 32.863 42.226Q32.495 45.432 32.455 48.7ZM63.173 27.043C60.747 27.548 58.286 27.915 55.8 28.139L55.8 48.7L67.545 48.7Q67.505 45.432 67.137 42.226Q66.73 38.678 65.937 35.347Q65.153 32.052 64.026 29.107Q63.619 28.044 63.173 27.043ZM48.7 25.786L48.7 8.82C45.82 8.911 42.977 9.303 40.215 9.979Q39.193 11.05 38.224 12.342Q36.393 14.784 34.829 17.913Q33.574 20.422 32.533 23.289C34.326 23.815 36.144 24.261 37.982 24.624C37.99 24.626 37.998 24.627 38.006 24.629C40.048 25.032 42.115 25.332 44.2 25.528C45.692 25.668 47.193 25.755 48.7 25.786ZM51.3 8.82L51.3 25.786C52.68 25.757 54.054 25.683 55.421 25.563C55.548 25.552 55.674 25.54 55.8 25.528C57.885 25.332 59.952 25.032 61.994 24.629C63.841 24.265 65.667 23.817 67.467 23.289Q66.426 20.422 65.171 17.913Q63.607 14.784 61.776 12.342Q60.807 11.05 59.785 9.979C57.023 9.303 54.18 8.911 51.3 8.82ZM48.7 91.18L48.7 74.214C47.193 74.245 45.692 74.332 44.2 74.472C42.331 74.647 40.476 74.907 38.641 75.249C38.628 75.252 38.616 75.254 38.604 75.256C38.571 75.262 38.539 75.268 38.507 75.274C36.606 75.633 34.726 76.08 32.874 76.612C32.76 76.645 32.646 76.678 32.533 76.711Q33.574 79.578 34.829 82.087Q36.393 85.216 38.224 87.658Q39.193 88.95 40.215 90.021C42.977 90.697 45.82 91.089 48.7 91.18ZM59.785 90.021Q60.807 88.95 61.776 87.658Q63.607 85.216 65.171 82.087Q66.426 79.578 67.467 76.711C65.504 76.135 63.511 75.655 61.493 75.274C59.664 74.929 57.815 74.666 55.951 74.486C55.901 74.481 55.85 74.476 55.8 74.472C54.36 74.336 52.911 74.251 51.457 74.217C51.404 74.216 51.352 74.215 51.3 74.214L51.3 91.18C54.18 91.089 57.023 90.697 59.785 90.021ZM65.602 64.989Q65.777 64.328 65.937 63.653Q66.73 60.322 67.137 56.774Q67.449 54.059 67.525 51.3L55.8 51.3L55.8 63.531C59.11 63.795 62.384 64.284 65.602 64.989ZM44.2 51.3L32.475 51.3Q32.551 54.059 32.863 56.774Q33.27 60.322 34.063 63.653Q34.223 64.328 34.398 64.989C37.615 64.284 40.89 63.795 44.2 63.531L44.2 51.3ZM35.727 88.649Q33.994 86.232 32.503 83.25Q31.159 80.562 30.052 77.497C29.162 77.799 28.279 78.122 27.403 78.464C25.727 79.12 24.08 79.849 22.467 80.649C26.368 84.154 30.875 86.857 35.727 88.649ZM77.533 80.649C75.92 79.849 74.273 79.12 72.597 78.464C71.756 78.136 70.909 77.825 70.055 77.533C70.019 77.521 69.983 77.509 69.948 77.497Q68.841 80.562 67.497 83.25Q66.006 86.232 64.273 88.649C69.125 86.857 73.632 84.154 77.533 80.649ZM64.273 11.351Q66.006 13.768 67.497 16.75Q68.841 19.438 69.948 22.503C70.921 22.173 71.886 21.818 72.841 21.439C72.895 21.418 72.95 21.396 73.004 21.375C74.54 20.761 76.051 20.086 77.533 19.351C73.632 15.846 69.125 13.143 64.273 11.351ZM22.467 19.351C23.949 20.086 25.46 20.761 26.996 21.374C28.005 21.777 29.024 22.154 30.052 22.503Q31.159 19.438 32.503 16.75Q33.994 13.768 35.727 11.351C30.875 13.143 26.368 15.846 22.467 19.351Z";
|