@onlyworlds/sdk 4.165.1 → 4.166.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 +1 -1
- package/CHANGELOG.md +18 -0
- package/SCHEMA.md +1 -1
- package/dist/{chunk-FSOSONE3.js → chunk-EWHZMOUF.js} +6 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.js +18 -8
- 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.1-dist.
|
|
3
|
+
**Current as of**: SDK **4.x** · schema-dist **v0.34.1-dist.128** (canonical 00.34.01).
|
|
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,24 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.166.0] - 2026-11-14
|
|
9
|
+
|
|
10
|
+
schema-dist v0.34.1-dist.128 (canonical 00.34.01 unchanged; `ONLYWORLDS_VERSION` unchanged, no schema file moved). The fixtures' new cases pass: the lens fixture's 235, the message fixture's 102 (its two `recipients` cases), the address fixture's two `prose-all` cases, the landing fixture's 33.
|
|
11
|
+
|
|
12
|
+
### Changed
|
|
13
|
+
|
|
14
|
+
- `worldGraph` reads a multi-link that names one element twice once: one edge, at its first entry, whose `index` is that entry's place in the list as served; the entries after the repeat keep their own places (in `[c1, c1, c2]` the edge to `c1` has index 0 and the edge to `c2` index 2). Schema links and the declared extension links (`x_lens_leads_to`, `x_spine_depends_on`) alike; ids compare as written, so `a` and `A` are two.
|
|
15
|
+
- `worldGraph` counts a repeat to an element that is not a node once in `edgesCut`, not once per entry.
|
|
16
|
+
- `degreeOf` and `landingOf` follow the graph without a change of their own: a list naming one element twice counts 1 at each end, so an element linked only that way is a near orphan.
|
|
17
|
+
- `recipientsOf` answers each recipient once, in its first place; ids compare as written.
|
|
18
|
+
- `recipientsOf`, `isAddressedTo`, `isToEveryone` and `hasUnseenRecipients` answer for a message only: any other Narrative, a Story or a Note, has no recipients and is addressed to nobody, whatever its `characters` holds (a Story's `characters` are the people it is about).
|
|
19
|
+
|
|
20
|
+
## [4.165.2] - 2026-11-14
|
|
21
|
+
|
|
22
|
+
### Fixed
|
|
23
|
+
|
|
24
|
+
- `findOwLinks` and `readOwLinkAt` pass over an id that follows a word that is not one of the 22 types (`ow://thing/<id>`) without the parse it would fail, so a line of such starts reads in about 4 ms where it took about 63 (200 KB). No answer changes: 100,000 random texts and 714 hand-made shapes answer the same as 4.165.1.
|
|
25
|
+
|
|
8
26
|
## [4.165.1] - 2026-11-14
|
|
9
27
|
|
|
10
28
|
### Fixed
|
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.1-dist.
|
|
3
|
+
**Source**: https://github.com/OnlyWorlds/schema-dist @ **v0.34.1-dist.128** — canonical schema **00.34.01**, published 2026-11-14.
|
|
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.
|
|
@@ -1259,6 +1259,11 @@ var ADDRESS_KEYS = ["form", "world", "type", "id", "lens", "moment", "worldIsSlu
|
|
|
1259
1259
|
var asciiLower = (s) => s.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
1260
1260
|
var isUuid = (s) => UUID.test(s);
|
|
1261
1261
|
var hyphensAt = (text, at) => text.charCodeAt(at + 8) === 45 && text.charCodeAt(at + 13) === 45 && text.charCodeAt(at + 18) === 45 && text.charCodeAt(at + 23) === 45;
|
|
1262
|
+
var worthParsing = (text, start, at) => {
|
|
1263
|
+
if (at === start || text.charCodeAt(at - 1) !== 47) return true;
|
|
1264
|
+
const slash = text.lastIndexOf("/", at - 2);
|
|
1265
|
+
return TYPES.has(text.slice(Math.max(slash + 1, start), at - 1));
|
|
1266
|
+
};
|
|
1262
1267
|
var isSlug = (s) => s.length >= 3 && s.length <= 40 && SLUG.test(s);
|
|
1263
1268
|
function checkType(word2) {
|
|
1264
1269
|
if (TYPES.has(word2)) return word2;
|
|
@@ -1431,7 +1436,7 @@ function readOwLinkAt(text, index = 0) {
|
|
|
1431
1436
|
while (run < text.length && run - start <= PATH_MAX && PATH_CHAR.test(text[run])) run++;
|
|
1432
1437
|
}
|
|
1433
1438
|
for (let p = run; p > floor; p--) {
|
|
1434
|
-
if (p - ID_LENGTH >= start && hyphensAt(text, p - ID_LENGTH) && isUuid(text.slice(p - ID_LENGTH, p)) && parses(text.slice(index, p))) {
|
|
1439
|
+
if (p - ID_LENGTH >= start && hyphensAt(text, p - ID_LENGTH) && isUuid(text.slice(p - ID_LENGTH, p)) && worthParsing(text, start, p - ID_LENGTH) && parses(text.slice(index, p))) {
|
|
1435
1440
|
end = p;
|
|
1436
1441
|
break;
|
|
1437
1442
|
}
|
package/dist/index.d.ts
CHANGED
|
@@ -2079,8 +2079,9 @@ declare function isNote(element: object | null | undefined): boolean;
|
|
|
2079
2079
|
/**
|
|
2080
2080
|
* The message's recipients: the Character ids in its `characters`, as written. An empty list
|
|
2081
2081
|
* (the field absent, null or `[]`) means the message is addressed to every member of the world;
|
|
2082
|
-
* use `isAddressedTo` for the question "is it for X". No other field addresses a message. A Note
|
|
2083
|
-
* has no recipients: `[]`, whatever its `characters` holds.
|
|
2082
|
+
* use `isAddressedTo` for the question "is it for X". No other field addresses a message. A Note,
|
|
2083
|
+
* or any Narrative that is not a message, has no recipients: `[]`, whatever its `characters` holds (since serial 128). A list that names one Character twice
|
|
2084
|
+
* answers it once, in its first place; ids compare as written, so `a` and `A` are two (since serial 128).
|
|
2084
2085
|
*/
|
|
2085
2086
|
declare function recipientsOf(message: object | null | undefined): string[];
|
|
2086
2087
|
/**
|
|
@@ -2089,7 +2090,7 @@ declare function recipientsOf(message: object | null | undefined): string[];
|
|
|
2089
2090
|
* An empty list whose `x_served_trimmed` names `characters` is to someone the reader cannot see and
|
|
2090
2091
|
* addresses no Character the reader is given. Not `narrator`, not a name or an id in the text, not
|
|
2091
2092
|
* any other link. A sender is not addressed by sending. An empty id (`""`) is no Character: nothing
|
|
2092
|
-
* is addressed to it, not even a message to everyone. A Note is addressed to nobody.
|
|
2093
|
+
* is addressed to it, not even a message to everyone. A Note, or any Narrative that is not a message, is addressed to nobody (since serial 128).
|
|
2093
2094
|
*/
|
|
2094
2095
|
declare function isAddressedTo(message: object | null | undefined, characterId: string): boolean;
|
|
2095
2096
|
/**
|
|
@@ -2106,7 +2107,7 @@ declare function isToEveryone(message: object | null | undefined, options?: OwAd
|
|
|
2106
2107
|
* `characters` trimmed (its `x_served_trimmed` list names `characters`), whatever is left in the
|
|
2107
2108
|
* list. It says that such a recipient exists, never who or how many. Null for a body read keyless
|
|
2108
2109
|
* (`{ keyless: true }`): it carries no mark, so the reader cannot say either way. False for a Note,
|
|
2109
|
-
* which has no recipients.
|
|
2110
|
+
* or any Narrative that is not a message, which has no recipients (since serial 128).
|
|
2110
2111
|
*/
|
|
2111
2112
|
declare function hasUnseenRecipients(message: object | null | undefined, options?: OwAddressingOptions): boolean | null;
|
|
2112
2113
|
/**
|
|
@@ -6199,7 +6200,7 @@ interface OwGraphNode {
|
|
|
6199
6200
|
/** True on a guest's known-of element, a stub that has no edges out; absent otherwise. */
|
|
6200
6201
|
known_of?: true;
|
|
6201
6202
|
}
|
|
6202
|
-
/** One link: one source, one field, one target, at its place in the field's list (0 for a single link). */
|
|
6203
|
+
/** One link: one source, one field, one target, at its place in the field's list as served (0 for a single link); a target the list names twice is one edge, at its first place (since serial 128). */
|
|
6203
6204
|
interface OwGraphEdge {
|
|
6204
6205
|
source: string;
|
|
6205
6206
|
field: string;
|
|
@@ -6234,7 +6235,10 @@ interface OwWorldGraph {
|
|
|
6234
6235
|
* Each schema link field, and each extension field a profile declares a link (`x_lens_leads_to`,
|
|
6235
6236
|
* `x_spine_depends_on`), gives one edge per target that is a node, with the target's place in the list as
|
|
6236
6237
|
* the reader is served it (the owner's list as stored; any other reader's leaves out what it does not see
|
|
6237
|
-
* and keeps a proposed id its rung sees); a link held on both ends is two edges. A
|
|
6238
|
+
* and keeps a proposed id its rung sees); a link held on both ends is two edges. A multi-link names each
|
|
6239
|
+
* element once: a list that names one element twice gives one edge, or one count in `edgesCut`, at its first
|
|
6240
|
+
* entry, and the entries after the repeat keep their own places (in `[c1, c1, c2]` the edge to `c1` has index 0
|
|
6241
|
+
* and the edge to `c2` index 2); ids compare as written, so `a` and `A` are two (since serial 128). A Pin's generic pair
|
|
6238
6242
|
* (`element_type`, `element_id`) is its placement, never an edge; its `map` link is. A guest's known-of
|
|
6239
6243
|
* element has no edges out. A link to an element of another type than its field's target draws no edge and
|
|
6240
6244
|
* is not counted. A link to an element that is not a node is counted in `edgesCut` by that element's reason: the
|
|
@@ -6250,7 +6254,7 @@ declare function worldGraph(world: OwLensWorld, reader: OwLensReader, options?:
|
|
|
6250
6254
|
/**
|
|
6251
6255
|
* Each node's degree in a graph `worldGraph` answered: the number of its edges, in or out, each edge counted
|
|
6252
6256
|
* once for every node it touches (a mirror pair is two edges, so each end counts 2; a link to itself counts
|
|
6253
|
-
* once). Every node is a key, 0 included, in the graph's node order. Edges join nodes only, so the count is
|
|
6257
|
+
* once). A list that names one element twice is one edge, so each end counts 1 (since serial 128). Every node is a key, 0 included, in the graph's node order. Edges join nodes only, so the count is
|
|
6254
6258
|
* the reader's: what the reading left out (hidden, room, proposed, map space, past a lens) is never counted.
|
|
6255
6259
|
* This is "most linked" for a finder: rank by it, highest first. A graph that is not one is a TypeError.
|
|
6256
6260
|
*/
|
package/dist/index.js
CHANGED
|
@@ -47,7 +47,7 @@ import {
|
|
|
47
47
|
trimWhiteSpace,
|
|
48
48
|
typeWord,
|
|
49
49
|
unknownKey
|
|
50
|
-
} from "./chunk-
|
|
50
|
+
} from "./chunk-EWHZMOUF.js";
|
|
51
51
|
|
|
52
52
|
// src/v2/keyed-id.ts
|
|
53
53
|
var KEYED_IDS = "0199b6a0-6f0e-7c2a-9d1e-3b5c7a8e4f21";
|
|
@@ -2880,24 +2880,25 @@ function isNote(element) {
|
|
|
2880
2880
|
return matchesPair(element, NOTE_PAIR);
|
|
2881
2881
|
}
|
|
2882
2882
|
function recipientsOf(message) {
|
|
2883
|
-
const list2 = isBody(message) &&
|
|
2884
|
-
|
|
2883
|
+
const list2 = isBody(message) && isMessage(message) ? message.characters : void 0;
|
|
2884
|
+
if (!Array.isArray(list2)) return [];
|
|
2885
|
+
return [...new Set(list2.filter((c) => typeof c === "string" && c !== ""))];
|
|
2885
2886
|
}
|
|
2886
2887
|
function isAddressedTo(message, characterId) {
|
|
2887
|
-
if (!isBody(message) ||
|
|
2888
|
+
if (!isBody(message) || !isMessage(message) || typeof characterId !== "string" || characterId === "") return false;
|
|
2888
2889
|
if (isToEveryone(message)) return true;
|
|
2889
2890
|
const list2 = message.characters;
|
|
2890
2891
|
return Array.isArray(list2) && list2.includes(characterId);
|
|
2891
2892
|
}
|
|
2892
2893
|
function isToEveryone(message, options) {
|
|
2893
2894
|
const keyless = keylessOf("isToEveryone", options);
|
|
2894
|
-
if (!isBody(message) ||
|
|
2895
|
+
if (!isBody(message) || !isMessage(message) || keyless || hasUnseenRecipients(message) === true) return false;
|
|
2895
2896
|
const list2 = message.characters;
|
|
2896
2897
|
return list2 === void 0 || list2 === null || Array.isArray(list2) && list2.length === 0;
|
|
2897
2898
|
}
|
|
2898
2899
|
function hasUnseenRecipients(message, options) {
|
|
2899
2900
|
const keyless = keylessOf("hasUnseenRecipients", options);
|
|
2900
|
-
if (!isBody(message) ||
|
|
2901
|
+
if (!isBody(message) || !isMessage(message)) return false;
|
|
2901
2902
|
if (keyless) return null;
|
|
2902
2903
|
const mark = message.x_served_trimmed;
|
|
2903
2904
|
return Array.isArray(mark) && mark.includes("characters");
|
|
@@ -4066,18 +4067,27 @@ function worldGraph(world, reader, options) {
|
|
|
4066
4067
|
const v = el[field];
|
|
4067
4068
|
const to = linkTarget(el, field, target);
|
|
4068
4069
|
const list2 = many ? Array.isArray(v) ? v : [] : [v];
|
|
4070
|
+
const read = /* @__PURE__ */ new Set();
|
|
4069
4071
|
let served = 0;
|
|
4070
4072
|
for (let i = 0; i < list2.length; i++) {
|
|
4071
4073
|
const t = list2[i];
|
|
4072
4074
|
const typed = typeof t === "string" && r.typeOf.get(t) === to;
|
|
4073
|
-
if (typed
|
|
4075
|
+
if (typed && !read.has(t)) {
|
|
4076
|
+
read.add(t);
|
|
4077
|
+
visit(source, field, t, seenOwner ? i : served);
|
|
4078
|
+
}
|
|
4074
4079
|
if (seenOwner || typed && r.linkable.has(t)) served++;
|
|
4075
4080
|
}
|
|
4076
4081
|
}
|
|
4077
4082
|
for (const field of DECLARED_LINKS) {
|
|
4078
4083
|
const v = el[field];
|
|
4079
4084
|
if (!Array.isArray(v)) continue;
|
|
4080
|
-
|
|
4085
|
+
const read = /* @__PURE__ */ new Set();
|
|
4086
|
+
for (let i = 0; i < v.length; i++) {
|
|
4087
|
+
if (read.has(v[i])) continue;
|
|
4088
|
+
read.add(v[i]);
|
|
4089
|
+
visit(source, field, v[i], i);
|
|
4090
|
+
}
|
|
4081
4091
|
}
|
|
4082
4092
|
}
|
|
4083
4093
|
edges.sort((a, b) => byCodePoint(a.source, b.source) || byCodePoint(a.field, b.field) || a.index - b.index);
|
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-EWHZMOUF.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";
|