@onlyworlds/sdk 4.171.0 → 4.172.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +17 -0
- package/dist/index.d.ts +17 -2
- package/dist/index.js +11 -3
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,23 @@ earlier history lives in git log only.
|
|
|
5
5
|
|
|
6
6
|
## [Unreleased]
|
|
7
7
|
|
|
8
|
+
## [4.172.0] - 2026-11-16
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- **A seat row says whether the seat may change its Character.** `listSeats()` rows (`OwSeat`) carry three fields the API serves on every row since 2026-11-16: `may_change_character` (true when the seat may change, never delete, the Character it plays), `may_change_character_note` (a sentence saying why it may not, else null) and `follows_sponsor` (true for a seat its member made to play their own Character). Where a Character is kept from you the row reads `character` null, `may_change_character` false and no note. The rows already came back whole; this release types them.
|
|
13
|
+
|
|
14
|
+
## [4.171.1] - 2026-11-16
|
|
15
|
+
|
|
16
|
+
### Fixed
|
|
17
|
+
|
|
18
|
+
- **`layoutByLinks3d` no longer throws on a Map whose width or height is under 0.** A Map's `width` and `height` are any whole number in the standard. One under 0 made the call throw from inside the method ("the square root of a negative area") when that Map held the most pinned elements, and with both under 0 the Map became a plate with every place mirrored. A width or height that is not over 0 is now no size: such a Map is no plate, no other Map is tried in its stead, and the world is laid out by its links alone; a Map over a place with such a size is no small plate. The method's fixture gains four cases for it (64).
|
|
19
|
+
- **Held points cost what they move.** The force steps worked out the push between every two fixed elements, 300 times, though neither can move and the push was never read. They no longer do; no number of any answer changes. Laying out a made world of 9,000 elements with every point handed back took 1,147 ms and takes 269 ms, the same answer to the bit, so a layout that keeps a picture still now costs less than one from nothing.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **The `held` list's words say what false means.** A pinned element stands at its Pin and is never answered as held, so `held: false` does not mean new. What is new is every id that was not handed in.
|
|
24
|
+
|
|
8
25
|
## [4.171.0] - 2026-11-16
|
|
9
26
|
|
|
10
27
|
### Added
|
package/dist/index.d.ts
CHANGED
|
@@ -3885,6 +3885,17 @@ interface OwSeat {
|
|
|
3885
3885
|
joined_at: string | null;
|
|
3886
3886
|
/** The latest use of the seat's key, or null. */
|
|
3887
3887
|
last_active: string | null;
|
|
3888
|
+
/**
|
|
3889
|
+
* True when the seat may change, never delete, the Character it plays: the owner gave it that Character, or its
|
|
3890
|
+
* sponsor could change it. False says only that no such right is held: a co-builder seat changes everything and a
|
|
3891
|
+
* seat changes what it made. On a seat a member answers for it holds only while that member could change the
|
|
3892
|
+
* Character. False when the seat has no Character, and when its Character is kept from you (`character` null).
|
|
3893
|
+
*/
|
|
3894
|
+
may_change_character: boolean;
|
|
3895
|
+
/** Why the seat may not change the Character it plays, as a sentence; null when it may, and when its Character is kept from you. */
|
|
3896
|
+
may_change_character_note: string | null;
|
|
3897
|
+
/** True when its member made it for their own AI to play their own Character: it plays what its sponsor plays, and its `may_change_character` is its sponsor's, until it is handed to someone else. */
|
|
3898
|
+
follows_sponsor: boolean;
|
|
3888
3899
|
[k: string]: unknown;
|
|
3889
3900
|
}
|
|
3890
3901
|
/**
|
|
@@ -6848,7 +6859,10 @@ interface OwLayoutByLinks3d {
|
|
|
6848
6859
|
part: Array<OwLayout3dPart | null>;
|
|
6849
6860
|
/** The centres' ids, in rank order. */
|
|
6850
6861
|
centres: string[];
|
|
6851
|
-
/**
|
|
6862
|
+
/**
|
|
6863
|
+
* True where the point answered is the element's held point; false everywhere when nothing is held. A pinned element
|
|
6864
|
+
* stands at its Pin and is never held, so false does not mean new: what is new is every id that was not handed in.
|
|
6865
|
+
*/
|
|
6852
6866
|
held: boolean[];
|
|
6853
6867
|
}
|
|
6854
6868
|
/**
|
|
@@ -6861,7 +6875,8 @@ interface OwLayoutByLinks3d {
|
|
|
6861
6875
|
* main piece stands on a shelf under the picture. When the world has a Map that holds three or more elements of the
|
|
6862
6876
|
* graph by a Pin, the Map that holds the most (a tie to the greater id) is a flat plate, each of its pinned elements
|
|
6863
6877
|
* at its Pin, the groups whose centre is pinned standing over it; a Map over a place on that plate is a small plate
|
|
6864
|
-
* a little above it. A
|
|
6878
|
+
* a little above it. A Map whose width or height is not over 0 is no plate, and when it is the Map that holds the
|
|
6879
|
+
* most, the world is laid out by its links alone. A Pin's z is not read: the plate is flat. A layout map (a Map whose `x_layout` names a method,
|
|
6865
6880
|
* the map-space profile's mark) is never the plate: a saved layout never stands in for the world's own space.
|
|
6866
6881
|
*
|
|
6867
6882
|
* `graph` is `worldGraph`'s answer, or any graph of the same shape; `elements` the world's elements as served (only
|
package/dist/index.js
CHANGED
|
@@ -5770,6 +5770,7 @@ function truthy(v) {
|
|
|
5770
5770
|
if (typeof v === "object") return Object.keys(v).length > 0;
|
|
5771
5771
|
return true;
|
|
5772
5772
|
}
|
|
5773
|
+
var sized = (v) => truthy(v) && !(typeof v === "number" && !(v > 0));
|
|
5773
5774
|
function isLayoutMap(row) {
|
|
5774
5775
|
const v = row.x_layout;
|
|
5775
5776
|
return v !== null && typeof v === "object" && !Array.isArray(v) && typeof v.method === "string" && v.method.length > 0;
|
|
@@ -5821,7 +5822,7 @@ function plate(rows2, nodes, opts = {}) {
|
|
|
5821
5822
|
const W = map.width, H = map.height;
|
|
5822
5823
|
const mine0 = at.get(m);
|
|
5823
5824
|
const count2 = mine0.size;
|
|
5824
|
-
if (count2 < 3 || !
|
|
5825
|
+
if (count2 < 3 || !sized(W) || !sized(H)) return null;
|
|
5825
5826
|
const own4 = SPREAD * REST / root(W, H, count2, "the first map");
|
|
5826
5827
|
const scale = opts.scale === void 0 ? own4 : opts.scale;
|
|
5827
5828
|
const out = /* @__PURE__ */ new Map(), onFirst = /* @__PURE__ */ new Map();
|
|
@@ -5843,7 +5844,7 @@ function plate(rows2, nodes, opts = {}) {
|
|
|
5843
5844
|
const mine = at.get(c);
|
|
5844
5845
|
const fresh = [];
|
|
5845
5846
|
for (const [el, xy] of mine) if (!out.has(el)) fresh.push([el, xy]);
|
|
5846
|
-
if (out.has(key(loc, "a map's location")) &&
|
|
5847
|
+
if (out.has(key(loc, "a map's location")) && sized(cw) && sized(ch) && mine.size >= 3 && fresh.length) {
|
|
5847
5848
|
const sc = TILE * REST / root(cw, ch, mine.size, `the map ${c}`);
|
|
5848
5849
|
const [lx, ly, lz] = out.get(loc);
|
|
5849
5850
|
const rise = REST * (mine.size >= 20 ? 4 : 2);
|
|
@@ -6311,6 +6312,8 @@ function relax(feed, opts = {}) {
|
|
|
6311
6312
|
}
|
|
6312
6313
|
const fixed = new Uint8Array(n);
|
|
6313
6314
|
if (feed.fixed) for (let i = 0; i < n; i++) fixed[i] = feed.fixed[i] ? 1 : 0;
|
|
6315
|
+
let free = 0;
|
|
6316
|
+
for (let i = 0; i < n; i++) if (!fixed[i]) free++;
|
|
6314
6317
|
const ea = new Int32Array(m), eb = new Int32Array(m);
|
|
6315
6318
|
const ew = new Float64Array(m);
|
|
6316
6319
|
const scale = new Float64Array(n);
|
|
@@ -6327,7 +6330,8 @@ function relax(feed, opts = {}) {
|
|
|
6327
6330
|
const cellOf = new Int32Array(n);
|
|
6328
6331
|
const order = new Int32Array(n);
|
|
6329
6332
|
const cut2 = CUT * CUT;
|
|
6330
|
-
|
|
6333
|
+
const RUN = free === 0 ? Math.min(STEPS3, 1) : STEPS3;
|
|
6334
|
+
for (let step = 0; step < RUN; step++) {
|
|
6331
6335
|
let x0 = Infinity, y0 = Infinity, z0 = Infinity, x1 = -Infinity, y1 = -Infinity, z1 = -Infinity;
|
|
6332
6336
|
for (let i = 0; i < n; i++) {
|
|
6333
6337
|
if (px[i] < x0) x0 = px[i];
|
|
@@ -6348,6 +6352,8 @@ function relax(feed, opts = {}) {
|
|
|
6348
6352
|
for (let c = 0; c < cells; c++) startOf2[c + 1] += startOf2[c];
|
|
6349
6353
|
const fill = startOf2.slice(0, cells);
|
|
6350
6354
|
for (let i = 0; i < n; i++) order[fill[cellOf[i]]++] = i;
|
|
6355
|
+
const freeIn = new Int32Array(cells);
|
|
6356
|
+
for (let i = 0; i < n; i++) if (!fixed[i]) freeIn[cellOf[i]]++;
|
|
6351
6357
|
dx.fill(0);
|
|
6352
6358
|
dy.fill(0);
|
|
6353
6359
|
dz.fill(0);
|
|
@@ -6362,11 +6368,13 @@ function relax(feed, opts = {}) {
|
|
|
6362
6368
|
const same = q === c;
|
|
6363
6369
|
const t0 = startOf2[q], t1 = startOf2[q + 1];
|
|
6364
6370
|
if (t0 === t1) continue;
|
|
6371
|
+
if (freeIn[c] === 0 && freeIn[q] === 0) continue;
|
|
6365
6372
|
for (let u = s0; u < s1; u++) {
|
|
6366
6373
|
const i = order[u];
|
|
6367
6374
|
const xi = px[i], yi = py[i], zi = pz[i];
|
|
6368
6375
|
for (let v = same ? u + 1 : t0; v < t1; v++) {
|
|
6369
6376
|
const j = order[v];
|
|
6377
|
+
if (fixed[i] && fixed[j]) continue;
|
|
6370
6378
|
const ux = xi - px[j], uy = yi - py[j], uz = zi - pz[j];
|
|
6371
6379
|
const d2 = ux * ux + uy * uy + uz * uz;
|
|
6372
6380
|
if (d2 > cut2) continue;
|