@onlyworlds/sdk 4.186.1 → 4.187.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/README.md +19 -0
- package/SCHEMA.md +1 -1
- package/dist/{chunk-EFH2PAJN.js → chunk-5XUVYQ5Q.js} +2 -650
- package/dist/chunk-EU4B5WYE.js +662 -0
- package/dist/chunk-OCPNZOFN.js +938 -0
- package/dist/convert.d.ts +200 -0
- package/dist/convert.js +2395 -0
- package/dist/index.js +110 -978
- package/dist/waymark.js +4 -2
- package/package.json +12 -5
|
@@ -1054,16 +1054,6 @@ var FIELD_SCHEMA = {
|
|
|
1054
1054
|
}
|
|
1055
1055
|
};
|
|
1056
1056
|
|
|
1057
|
-
// src/v2/types.ts
|
|
1058
|
-
var SPATIAL_TYPES = ["map", "pin", "marker", "zone"];
|
|
1059
|
-
var AGENT_DOORS = ["seat", "mcp", "declared"];
|
|
1060
|
-
function isAgentDoor(door) {
|
|
1061
|
-
return door != null && AGENT_DOORS.includes(door);
|
|
1062
|
-
}
|
|
1063
|
-
function isKnownOf(element) {
|
|
1064
|
-
return element != null && element.known_of === true;
|
|
1065
|
-
}
|
|
1066
|
-
|
|
1067
1057
|
// src/case-fold.ts
|
|
1068
1058
|
var FOLD_RUNS = "1t.q..w,51...lj,5c.n..w,60.7..w,74.o.2.1,8i.3.2.1,8p.8.2.1,96.n.2.1,ag...-3d,ah.3.2.1,an...-7g,ap...5u,aq.2.2.1,au...5q,av...1,ax.2..5p,az...1,b2...27,b3...5m,b4...5n,b5...1,b7...5p,b8...5r,ba...5v,bb...5t,bc...1,bg...5v,bh...5x,bj...5y,bk.3.2.1,bq...62,br...1,bt...62,bw...1,by...62,bz...1,c1.2..61,c3.2.2.1,c7...63,c8...1,cc...1,ck...2,cl...1,cn...2,co...1,cq...2,cr.9.2.1,da.9.2.1,dt...2,du.2.2.1,dy...-2p,dz...-1k,e0.k.2.1,f4...-3m,f6.9.2.1,fu...8bv,fv...1,fx...-4j,fy...8bs,g1...1,g3...-5f,g4...1x,g5...1z,g6.5.2.1,n9...38,og.2.2.1,om...1,ov...38,p2...12,p4.3..11,p8...1s,pa.2..1r,pd.h..w,pv.9..w,qq...1,r3...8,r4...-u,r5...-p,r9...-f,ra...-m,rc.c.2.1,s0...-1i,s1...-1c,s4...-1o,s5...-1s,s7...1,s9...-7,sa...1,sd.3..-3m,sg.g..28,sw.w..w,v4.h.2.1,wa.r.2.1,xs...f,xt.7.2.1,y8.1c.2.1,10x.12..1c,3a8.12..5ls,3bb...5ls,3bh...5ls,3y0.6..-8,5mo...-4su,5mp...-4st,5mq...-4sk,5mr.2..-4si,5mt...-4sj,5mu...-4sc,5mv...-4ro,5mw...r7n,5n4.17..-2bk,5od.3..-2bk,5xc.23.2.1,61n...-1m,61q...-5vj,61s.1c.2.1,64o.8..-8,654.6..-8,65k.8..-8,660.8..-8,66g.6..-8,66x.4.2.-8,67c.8..-8,688.8..-8,68o.8..-8,694.8..-8,69k.2..-8,69m.2..-22,69o...-9,69q...-5j9,6a0.4..-2e,6a4...-9,6ab...-5kz,6ag.2..-8,6ai.2..-2s,6ar...-5kj,6aw.2..-8,6ay.2..-34,6b0...-7,6bc.2..-3k,6be.2..-3i,6bg...-9,6jq...-5st,6ju...-6gv,6jv...-6di,6k2...s,6lc.g..g,6mb...1,792.q..q,8ow.1c..1c,8rk...1,8rm...-8af,8rn...-2xy,8ro...-89z,8rr.3.2.1,8rx...-8bg,8ry...-8al,8rz...-8bj,8s0...-8bi,8s2...1,8s5...1,8se.2..-8cf,8sg.1e.2.1,8vf.2.2.1,8vm...1,wu8.n.2.1,ww0.e.2.1,x0i.7.2.1,x0y.v.2.1,x2x.2.2.1,x31...-r9g,x32.5.2.1,x3f...1,x3h...-wmg,x3k.2.2.1,x3q.a.2.1,x4a...-wn8,x4b...-wnj,x4c...-wnf,x4d...-wn5,x4e...-wn8,x4g...-wlu,x4h...-wmi,x4i...-wlx,x4j...ps,x4k.8.2.1,x50...-1c,x51...-wn7,x52...-raw,x53.2.2.1,x5c...1,x5i.2.2.1,x6d...1,xv4.28..-tzk,1dl1...1,1ee9.q..w,1fcw.14..14,1fhs.10..14,1fn4.b..13,1fng.f..13,1fnw.7..13,1fo4.2..13,1h1c.1f..1s,1jfk.w..w,20cg.w..w,2olc.y..y";
|
|
1069
1059
|
var foldTable = null;
|
|
@@ -1221,633 +1211,11 @@ function handsOnAsProposed(element) {
|
|
|
1221
1211
|
return isPresent(element[PROPOSED_MARK]);
|
|
1222
1212
|
}
|
|
1223
1213
|
|
|
1224
|
-
// src/address.ts
|
|
1225
|
-
var MESSAGES = {
|
|
1226
|
-
not_an_address: "not an address: it starts with neither https://www.onlyworlds.com/w/ nor ow://",
|
|
1227
|
-
uppercase: "an address is written in lowercase: the prefix or the type word is in another case",
|
|
1228
|
-
segments: "the wrong number of path segments, or an empty one: a type needs an id and an id a type",
|
|
1229
|
-
bad_world: "the world is not an id (or, in the site's address only, a slug)",
|
|
1230
|
-
unknown_type: "the type word is not one of the 22",
|
|
1231
|
-
bad_id: "the element id is not a UUID in the hyphenated 8-4-4-4-12 form",
|
|
1232
|
-
bad_moment: "the moment is not a whole step in decimal within the 32-bit range",
|
|
1233
|
-
bad_lens: "the lens is not one lowercase lens key holding an id",
|
|
1234
|
-
no_world: "this address needs a world",
|
|
1235
|
-
bad_form: "the form is neither human nor text"
|
|
1236
|
-
};
|
|
1237
|
-
var OwAddressError = class extends Error {
|
|
1238
|
-
constructor(reason, message = MESSAGES[reason]) {
|
|
1239
|
-
super(message);
|
|
1240
|
-
this.name = "OwAddressError";
|
|
1241
|
-
this.reason = reason;
|
|
1242
|
-
}
|
|
1243
|
-
};
|
|
1244
|
-
var refuse = (reason) => {
|
|
1245
|
-
throw new OwAddressError(reason);
|
|
1246
|
-
};
|
|
1247
|
-
var HUMAN_PREFIX = "https://www.onlyworlds.com/w/";
|
|
1248
|
-
var TEXT_PREFIX = "ow://";
|
|
1249
|
-
var TYPES = new Set(ELEMENT_TYPES);
|
|
1250
|
-
var UUID = /^[0-9A-Fa-f]{8}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{4}-[0-9A-Fa-f]{12}$/;
|
|
1251
|
-
var SLUG = /^[a-z0-9]+(?:-[a-z0-9]+)*$/;
|
|
1252
|
-
var STEP = /^(?:0|-?[1-9][0-9]*)$/;
|
|
1253
|
-
var STEP_MIN = -2147483648;
|
|
1254
|
-
var STEP_MAX = 2147483647;
|
|
1255
|
-
function readStep(step) {
|
|
1256
|
-
if (step.length > 11 || !STEP.test(step)) return null;
|
|
1257
|
-
const m = Number(step);
|
|
1258
|
-
return m < STEP_MIN || m > STEP_MAX ? null : m;
|
|
1259
|
-
}
|
|
1260
|
-
var ADDRESS_KEYS = ["form", "world", "type", "id", "lens", "moment", "worldIsSlug", "canonical"];
|
|
1261
|
-
var asciiLower = (s) => s.replace(/[A-Z]/g, (c) => String.fromCharCode(c.charCodeAt(0) + 32));
|
|
1262
|
-
var isUuid = (s) => UUID.test(s);
|
|
1263
|
-
var hyphensAt = (text, at) => text.charCodeAt(at + 8) === 45 && text.charCodeAt(at + 13) === 45 && text.charCodeAt(at + 18) === 45 && text.charCodeAt(at + 23) === 45;
|
|
1264
|
-
var worthParsing = (text, start, at) => {
|
|
1265
|
-
if (at === start || text.charCodeAt(at - 1) !== 47) return true;
|
|
1266
|
-
const slash = text.lastIndexOf("/", at - 2);
|
|
1267
|
-
return TYPES.has(text.slice(Math.max(slash + 1, start), at - 1));
|
|
1268
|
-
};
|
|
1269
|
-
var isSlug = (s) => s.length >= 3 && s.length <= 40 && SLUG.test(s);
|
|
1270
|
-
function checkType(word2) {
|
|
1271
|
-
if (TYPES.has(word2)) return word2;
|
|
1272
|
-
return refuse(TYPES.has(asciiLower(word2)) ? "uppercase" : "unknown_type");
|
|
1273
|
-
}
|
|
1274
|
-
function write(form, world, type, id, moment, lens) {
|
|
1275
|
-
const parts = [];
|
|
1276
|
-
if (world !== null) parts.push(world);
|
|
1277
|
-
if (type !== null && id !== null) parts.push(type, id);
|
|
1278
|
-
let out = (form === "human" ? HUMAN_PREFIX : TEXT_PREFIX) + parts.join("/");
|
|
1279
|
-
if (moment !== null) out += `@${moment}`;
|
|
1280
|
-
if (lens !== null) out += `?lens=${lens}`;
|
|
1281
|
-
return out;
|
|
1282
|
-
}
|
|
1283
|
-
var given = (v) => v !== void 0 && v !== null;
|
|
1284
|
-
function elementAddress(address) {
|
|
1285
|
-
if (address === null || typeof address !== "object" || Array.isArray(address)) {
|
|
1286
|
-
throw new TypeError("elementAddress: the address is an object ({ form, world, type, id, lens, moment })");
|
|
1287
|
-
}
|
|
1288
|
-
refuseUnknownOptions("elementAddress", address, ADDRESS_KEYS);
|
|
1289
|
-
const a = address;
|
|
1290
|
-
const form = a.form;
|
|
1291
|
-
if (form !== "human" && form !== "text") return refuse("bad_form");
|
|
1292
|
-
const hasType = given(a.type);
|
|
1293
|
-
const hasId = given(a.id);
|
|
1294
|
-
if (hasType !== hasId) return refuse("segments");
|
|
1295
|
-
const hasWorld = given(a.world);
|
|
1296
|
-
if (!hasWorld && (form === "human" || !hasType)) return refuse("no_world");
|
|
1297
|
-
let world = null;
|
|
1298
|
-
if (hasWorld) {
|
|
1299
|
-
if (typeof a.world !== "string" || !isUuid(a.world)) return refuse("bad_world");
|
|
1300
|
-
world = a.world.toLowerCase();
|
|
1301
|
-
}
|
|
1302
|
-
let type = null;
|
|
1303
|
-
let id = null;
|
|
1304
|
-
if (hasType) {
|
|
1305
|
-
type = typeof a.type === "string" ? checkType(a.type) : refuse("unknown_type");
|
|
1306
|
-
if (typeof a.id !== "string" || !isUuid(a.id)) return refuse("bad_id");
|
|
1307
|
-
id = a.id.toLowerCase();
|
|
1308
|
-
}
|
|
1309
|
-
let moment = null;
|
|
1310
|
-
if (given(a.moment)) {
|
|
1311
|
-
const m = a.moment;
|
|
1312
|
-
if (typeof m !== "number" || !Number.isInteger(m) || m < STEP_MIN || m > STEP_MAX) return refuse("bad_moment");
|
|
1313
|
-
moment = m === 0 ? 0 : m;
|
|
1314
|
-
}
|
|
1315
|
-
let lens = null;
|
|
1316
|
-
if (given(a.lens)) {
|
|
1317
|
-
if (typeof a.lens !== "string" || !isUuid(a.lens)) return refuse("bad_lens");
|
|
1318
|
-
lens = a.lens.toLowerCase();
|
|
1319
|
-
}
|
|
1320
|
-
return write(form, world, type, id, moment, lens);
|
|
1321
|
-
}
|
|
1322
|
-
function readLens(query) {
|
|
1323
|
-
let lens = null;
|
|
1324
|
-
let seen = false;
|
|
1325
|
-
for (const part of query.split("&")) {
|
|
1326
|
-
const eq = part.indexOf("=");
|
|
1327
|
-
const key = eq === -1 ? part : part.slice(0, eq);
|
|
1328
|
-
if (asciiLower(key) !== "lens") continue;
|
|
1329
|
-
if (key !== "lens" || seen) return refuse("bad_lens");
|
|
1330
|
-
seen = true;
|
|
1331
|
-
const value = eq === -1 ? "" : part.slice(eq + 1);
|
|
1332
|
-
if (!isUuid(value)) return refuse("bad_lens");
|
|
1333
|
-
lens = value.toLowerCase();
|
|
1334
|
-
}
|
|
1335
|
-
return lens;
|
|
1336
|
-
}
|
|
1337
|
-
function parseOwLink(text) {
|
|
1338
|
-
if (typeof text !== "string") return refuse("not_an_address");
|
|
1339
|
-
const s = trimWhiteSpace(text);
|
|
1340
|
-
let form;
|
|
1341
|
-
let rest;
|
|
1342
|
-
if (s.startsWith(HUMAN_PREFIX)) {
|
|
1343
|
-
form = "human";
|
|
1344
|
-
rest = s.slice(HUMAN_PREFIX.length);
|
|
1345
|
-
} else if (s.startsWith(TEXT_PREFIX)) {
|
|
1346
|
-
form = "text";
|
|
1347
|
-
rest = s.slice(TEXT_PREFIX.length);
|
|
1348
|
-
} else {
|
|
1349
|
-
const lowered = asciiLower(s);
|
|
1350
|
-
return refuse(lowered.startsWith(HUMAN_PREFIX) || lowered.startsWith(TEXT_PREFIX) ? "uppercase" : "not_an_address");
|
|
1351
|
-
}
|
|
1352
|
-
const hash = rest.indexOf("#");
|
|
1353
|
-
if (hash !== -1) rest = rest.slice(0, hash);
|
|
1354
|
-
const q = rest.indexOf("?");
|
|
1355
|
-
const query = q === -1 ? null : rest.slice(q + 1);
|
|
1356
|
-
const segments = (q === -1 ? rest : rest.slice(0, q)).split("/");
|
|
1357
|
-
const last = segments[segments.length - 1];
|
|
1358
|
-
const at = last.indexOf("@");
|
|
1359
|
-
const step = at === -1 ? null : last.slice(at + 1);
|
|
1360
|
-
if (at !== -1) segments[segments.length - 1] = last.slice(0, at);
|
|
1361
|
-
const n = segments.length;
|
|
1362
|
-
if (form === "human" ? n !== 1 && n !== 3 : n < 1 || n > 3) return refuse("segments");
|
|
1363
|
-
if (segments.some((seg) => seg === "")) return refuse("segments");
|
|
1364
|
-
if (n === 1 && TYPES.has(segments[0])) return refuse("segments");
|
|
1365
|
-
let world = null;
|
|
1366
|
-
let worldIsSlug = false;
|
|
1367
|
-
if (n !== 2) {
|
|
1368
|
-
const w = segments[0];
|
|
1369
|
-
if (isUuid(w)) world = w.toLowerCase();
|
|
1370
|
-
else if (form === "human" && isSlug(w) && !TYPES.has(w)) {
|
|
1371
|
-
world = w;
|
|
1372
|
-
worldIsSlug = true;
|
|
1373
|
-
} else return refuse("bad_world");
|
|
1374
|
-
}
|
|
1375
|
-
let type = null;
|
|
1376
|
-
let id = null;
|
|
1377
|
-
if (n !== 1) {
|
|
1378
|
-
type = checkType(segments[n - 2]);
|
|
1379
|
-
if (!isUuid(segments[n - 1])) return refuse("bad_id");
|
|
1380
|
-
id = segments[n - 1].toLowerCase();
|
|
1381
|
-
}
|
|
1382
|
-
let moment = null;
|
|
1383
|
-
if (step !== null) {
|
|
1384
|
-
moment = readStep(step);
|
|
1385
|
-
if (moment === null) return refuse("bad_moment");
|
|
1386
|
-
}
|
|
1387
|
-
const lens = query === null ? null : readLens(query);
|
|
1388
|
-
const canonical = !worldIsSlug && text === write(form, world, type, id, moment, lens);
|
|
1389
|
-
return { form, world, worldIsSlug, type, id, lens, moment, canonical };
|
|
1390
|
-
}
|
|
1391
|
-
var PATH_CHAR = /[0-9A-Za-z\/-]/;
|
|
1392
|
-
var PATH_MAX = 36 + 1 + Math.max(...ELEMENT_TYPES.map((t) => t.length)) + 1 + 36;
|
|
1393
|
-
var ELEMENT_PATH_MAX = 1 + Math.max(...ELEMENT_TYPES.map((t) => t.length)) + 1 + 36;
|
|
1394
|
-
var WORLD_RUN_CHAR = /[0-9a-zA-F-]/;
|
|
1395
|
-
var IN_A_WORD = /^[\p{L}\p{M}_]/u;
|
|
1396
|
-
function codePointStart(text, i) {
|
|
1397
|
-
const c = text.charCodeAt(i);
|
|
1398
|
-
if (c >= 56320 && c <= 57343 && i > 0) {
|
|
1399
|
-
const h = text.charCodeAt(i - 1);
|
|
1400
|
-
if (h >= 55296 && h <= 56319) return i - 1;
|
|
1401
|
-
}
|
|
1402
|
-
return i;
|
|
1403
|
-
}
|
|
1404
|
-
var STEP_RUN = /-?[0-9]+/y;
|
|
1405
|
-
var ID_LENGTH = 36;
|
|
1406
|
-
function parses(s) {
|
|
1407
|
-
try {
|
|
1408
|
-
parseOwLink(s);
|
|
1409
|
-
return true;
|
|
1410
|
-
} catch (err) {
|
|
1411
|
-
if (err instanceof OwAddressError) return false;
|
|
1412
|
-
throw err;
|
|
1413
|
-
}
|
|
1414
|
-
}
|
|
1415
|
-
function readOwLinkAt(text, index = 0) {
|
|
1416
|
-
if (typeof text !== "string") throw new TypeError("readOwLinkAt: text must be a string");
|
|
1417
|
-
if (typeof index !== "number" || !Number.isInteger(index) || index < 0) throw new TypeError("readOwLinkAt: index must be a whole number from 0");
|
|
1418
|
-
if (index > 0 && index <= text.length && IN_A_WORD.test(String.fromCodePoint(text.codePointAt(codePointStart(text, index - 1))))) return null;
|
|
1419
|
-
const human = text.startsWith(HUMAN_PREFIX, index);
|
|
1420
|
-
let start;
|
|
1421
|
-
if (human) start = index + HUMAN_PREFIX.length;
|
|
1422
|
-
else if (text.startsWith(TEXT_PREFIX, index)) start = index + TEXT_PREFIX.length;
|
|
1423
|
-
else return null;
|
|
1424
|
-
let end = -1;
|
|
1425
|
-
let floor = start;
|
|
1426
|
-
let run = start;
|
|
1427
|
-
if (human) {
|
|
1428
|
-
let w = start;
|
|
1429
|
-
while (w < text.length && WORLD_RUN_CHAR.test(text[w])) w++;
|
|
1430
|
-
if (IN_A_WORD.test(text.slice(w, w + 2))) return null;
|
|
1431
|
-
const world = text.slice(start, w);
|
|
1432
|
-
if (!isUuid(world) && !(isSlug(world) && !TYPES.has(world))) return null;
|
|
1433
|
-
end = floor = run = w;
|
|
1434
|
-
while (run < text.length && run - w <= ELEMENT_PATH_MAX && PATH_CHAR.test(text[run])) run++;
|
|
1435
|
-
} else {
|
|
1436
|
-
while (run < text.length && run - start <= PATH_MAX && PATH_CHAR.test(text[run])) run++;
|
|
1437
|
-
}
|
|
1438
|
-
for (let p = run; p > floor; 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))) {
|
|
1440
|
-
end = p;
|
|
1441
|
-
break;
|
|
1442
|
-
}
|
|
1443
|
-
}
|
|
1444
|
-
if (end === -1) return null;
|
|
1445
|
-
if (text[end] === "@") {
|
|
1446
|
-
STEP_RUN.lastIndex = end + 1;
|
|
1447
|
-
const step = STEP_RUN.exec(text);
|
|
1448
|
-
if (step !== null && readStep(step[0]) !== null && parses(text.slice(index, end + 1 + step[0].length))) end += 1 + step[0].length;
|
|
1449
|
-
}
|
|
1450
|
-
if (text.startsWith("?lens=", end)) {
|
|
1451
|
-
const lensEnd = end + 6 + ID_LENGTH;
|
|
1452
|
-
if (lensEnd <= text.length && isUuid(text.slice(end + 6, lensEnd)) && parses(text.slice(index, lensEnd))) end = lensEnd;
|
|
1453
|
-
}
|
|
1454
|
-
return { reading: parseOwLink(text.slice(index, end)), end };
|
|
1455
|
-
}
|
|
1456
|
-
function findOwLinks(text) {
|
|
1457
|
-
if (typeof text !== "string") throw new TypeError("findOwLinks: text must be a string");
|
|
1458
|
-
const found = [];
|
|
1459
|
-
let nextText = text.indexOf(TEXT_PREFIX);
|
|
1460
|
-
let nextHuman = text.indexOf(HUMAN_PREFIX);
|
|
1461
|
-
let at = 0;
|
|
1462
|
-
for (; ; ) {
|
|
1463
|
-
if (nextText !== -1 && nextText < at) nextText = text.indexOf(TEXT_PREFIX, at);
|
|
1464
|
-
if (nextHuman !== -1 && nextHuman < at) nextHuman = text.indexOf(HUMAN_PREFIX, at);
|
|
1465
|
-
const start = nextText === -1 ? nextHuman : nextHuman === -1 ? nextText : Math.min(nextText, nextHuman);
|
|
1466
|
-
if (start === -1) return found;
|
|
1467
|
-
const got = readOwLinkAt(text, start);
|
|
1468
|
-
if (got === null) {
|
|
1469
|
-
at = start + 1;
|
|
1470
|
-
} else {
|
|
1471
|
-
found.push({ start, end: got.end, reading: got.reading });
|
|
1472
|
-
at = got.end;
|
|
1473
|
-
}
|
|
1474
|
-
}
|
|
1475
|
-
}
|
|
1476
|
-
|
|
1477
|
-
// src/names.ts
|
|
1478
|
-
var SLUGS = new Set(ELEMENT_TYPES);
|
|
1479
|
-
var OPTION_KEYS = ["supertype", "many"];
|
|
1480
|
-
var isObject = (v) => typeof v === "object" && v !== null && !Array.isArray(v);
|
|
1481
|
-
function word(pair, many) {
|
|
1482
|
-
if (!isObject(pair) || typeof pair.one !== "string") return null;
|
|
1483
|
-
const one = trimWhiteSpace(pair.one);
|
|
1484
|
-
if (one === "") return null;
|
|
1485
|
-
if (!many) return one;
|
|
1486
|
-
const plural = typeof pair.many === "string" ? trimWhiteSpace(pair.many) : "";
|
|
1487
|
-
return plural === "" ? one : plural;
|
|
1488
|
-
}
|
|
1489
|
-
function typeWord(world, type, opts = {}) {
|
|
1490
|
-
refuseUnknownOptions("typeWord", opts, OPTION_KEYS);
|
|
1491
|
-
const map = world?.x_names;
|
|
1492
|
-
if (!isObject(map) || map.version !== 1) return null;
|
|
1493
|
-
const { types, supertypes } = map;
|
|
1494
|
-
if (types !== void 0 && !isObject(types)) return null;
|
|
1495
|
-
if (supertypes !== void 0) {
|
|
1496
|
-
if (!isObject(supertypes)) return null;
|
|
1497
|
-
for (const inner of Object.values(supertypes)) if (!isObject(inner)) return null;
|
|
1498
|
-
}
|
|
1499
|
-
if (!SLUGS.has(type)) return null;
|
|
1500
|
-
const many = opts.many === true;
|
|
1501
|
-
const supertype = typeof opts.supertype === "string" ? fold(opts.supertype) : "";
|
|
1502
|
-
if (supertype !== "" && isObject(supertypes) && isObject(supertypes[type])) {
|
|
1503
|
-
for (const [key, pair] of Object.entries(supertypes[type])) {
|
|
1504
|
-
if (fold(key) !== supertype) continue;
|
|
1505
|
-
const w = word(pair, many);
|
|
1506
|
-
if (w !== null) return w;
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
return isObject(types) ? word(types[type], many) : null;
|
|
1510
|
-
}
|
|
1511
|
-
|
|
1512
|
-
// src/marks.ts
|
|
1513
|
-
var ELEMENT_MARKS = ["room", "hidden", "proposed", "map_space", "reading_aid"];
|
|
1514
|
-
var MAP_SPACE = /* @__PURE__ */ new Set(["map", "pin", "marker"]);
|
|
1515
|
-
function isHiddenMark(el) {
|
|
1516
|
-
return el.hidden !== void 0 && el.hidden !== null && el.hidden !== false;
|
|
1517
|
-
}
|
|
1518
|
-
function marksOf(el) {
|
|
1519
|
-
const out = [];
|
|
1520
|
-
if (isRoomElement(el)) out.push("room");
|
|
1521
|
-
if (isHiddenMark(el)) out.push("hidden");
|
|
1522
|
-
if (handsOnAsProposed(el)) out.push("proposed");
|
|
1523
|
-
if (typeof el.type === "string" && MAP_SPACE.has(fold(el.type))) out.push("map_space");
|
|
1524
|
-
if (readingAidKey(el) !== null) out.push("reading_aid");
|
|
1525
|
-
return out;
|
|
1526
|
-
}
|
|
1527
|
-
|
|
1528
|
-
// src/openers.ts
|
|
1529
|
-
var OPTION_KEYS2 = ["element"];
|
|
1530
|
-
var SURFACE_KEYS = ["tool", "audience", "signedIn", "browser", "phone", "online"];
|
|
1531
|
-
var NEEDS = ["account", "device", null];
|
|
1532
|
-
var PLACEHOLDER = /\{(world|type|id)\}/g;
|
|
1533
|
-
var WEB = /^https?:/i;
|
|
1534
|
-
var OFFLINE = "Needs a connection";
|
|
1535
|
-
var NO_ACCOUNT = "Needs an account";
|
|
1536
|
-
var fail = (what) => {
|
|
1537
|
-
throw new TypeError(`openersFor: ${what}`);
|
|
1538
|
-
};
|
|
1539
|
-
var NO_APP = ["javascript", "data", "vbscript", "file", "blob", "about"];
|
|
1540
|
-
var SCHEME = /^([A-Za-z][A-Za-z0-9+.-]*):/;
|
|
1541
|
-
function templateOf(row, key, v) {
|
|
1542
|
-
if (v === void 0 || v === null) return null;
|
|
1543
|
-
if (typeof v !== "string") fail(`tool ${row}: open.${key} is a link template or null`);
|
|
1544
|
-
const scheme = SCHEME.exec(v)?.[1].toLowerCase();
|
|
1545
|
-
if (scheme === void 0) fail(`tool ${row}: open.${key} begins with its scheme`);
|
|
1546
|
-
if (NO_APP.includes(scheme)) fail(`tool ${row}: open.${key} is a ${scheme}: link, which opens no app`);
|
|
1547
|
-
return v;
|
|
1548
|
-
}
|
|
1549
|
-
function openersFor(tools, kind, address, surface, options = {}) {
|
|
1550
|
-
if (!Array.isArray(tools)) fail("tools is the tools list's rows, an array");
|
|
1551
|
-
if (kind !== "world" && kind !== "element") fail(`kind is 'world' or 'element'; got ${JSON.stringify(kind)}`);
|
|
1552
|
-
if (address === null || typeof address !== "object" || Array.isArray(address)) {
|
|
1553
|
-
fail("the address is an object ({ form, world, type, id }), as parseOwLink reads it");
|
|
1554
|
-
}
|
|
1555
|
-
refuseUnknownOptions("openersFor", address, ADDRESS_KEYS);
|
|
1556
|
-
const a = address;
|
|
1557
|
-
elementAddress({ ...a, form: a.form ?? "human" });
|
|
1558
|
-
const page = elementAddress({ form: "human", world: a.world, type: a.type, id: a.id });
|
|
1559
|
-
const world = a.world.toLowerCase();
|
|
1560
|
-
const hasElement = a.type !== void 0 && a.type !== null;
|
|
1561
|
-
if (kind === "element" && !hasElement) fail("an element's openers need an address with its type and id");
|
|
1562
|
-
const type = hasElement ? a.type : "";
|
|
1563
|
-
const id = hasElement ? a.id.toLowerCase() : "";
|
|
1564
|
-
if (surface === null || typeof surface !== "object" || Array.isArray(surface)) fail("the surface is an object ({ audience, ... })");
|
|
1565
|
-
refuseUnknownOptions("openersFor", surface, SURFACE_KEYS);
|
|
1566
|
-
const { tool = null, audience, signedIn = null, browser = true, phone = false, online = true } = surface;
|
|
1567
|
-
if (audience !== "member" && audience !== "public") fail(`surface.audience is 'member' or 'public'; got ${JSON.stringify(audience)}`);
|
|
1568
|
-
if (tool !== null && typeof tool !== "string") fail("surface.tool is a client name or null");
|
|
1569
|
-
if (signedIn !== null && typeof signedIn !== "boolean") fail("surface.signedIn is true, false or null");
|
|
1570
|
-
if (typeof browser !== "boolean") fail("surface.browser is a boolean");
|
|
1571
|
-
if (typeof phone !== "boolean") fail("surface.phone is a boolean");
|
|
1572
|
-
if (typeof online !== "boolean") fail("surface.online is a boolean");
|
|
1573
|
-
if (options === null || typeof options !== "object" || Array.isArray(options)) fail("the options are an object ({ element })");
|
|
1574
|
-
refuseUnknownOptions("openersFor", options, OPTION_KEYS2);
|
|
1575
|
-
const element = options.element ?? null;
|
|
1576
|
-
let unnamed = false;
|
|
1577
|
-
if (element !== null) {
|
|
1578
|
-
if (typeof element !== "object" || Array.isArray(element)) fail("options.element is the element as served, an object, or null");
|
|
1579
|
-
if (kind !== "element") fail("options.element is for an element's menu; a world's menu takes none");
|
|
1580
|
-
const eid = element.id;
|
|
1581
|
-
if (typeof eid !== "string" || eid.toLowerCase() !== id) fail("options.element is the element the address names: its id differs");
|
|
1582
|
-
unnamed = eid !== id;
|
|
1583
|
-
}
|
|
1584
|
-
const marks = element === null ? [] : marksOf(element);
|
|
1585
|
-
const values = { world, type, id };
|
|
1586
|
-
const fill = (template) => template.replace(PLACEHOLDER, (_, n) => values[n]);
|
|
1587
|
-
const offline = (href) => !online && WEB.test(href);
|
|
1588
|
-
const site = kind === "element" ? page : elementAddress({ form: "human", world });
|
|
1589
|
-
const siteState = tool === "onlyworlds" ? "You are here" : offline(site) ? OFFLINE : null;
|
|
1590
|
-
const rows = [{ id: "onlyworlds", name: "onlyworlds.com", href: site, state: siteState }];
|
|
1591
|
-
for (const r of tools) {
|
|
1592
|
-
if (r === null || typeof r !== "object" || typeof r.id !== "string" || typeof r.name !== "string") {
|
|
1593
|
-
fail("each tools row is an object with an id and a name");
|
|
1594
|
-
}
|
|
1595
|
-
const open = r.open;
|
|
1596
|
-
if (open === null || open === void 0) continue;
|
|
1597
|
-
if (typeof open !== "object" || Array.isArray(open)) fail(`tool ${r.id}: open is an object or null`);
|
|
1598
|
-
const o = open;
|
|
1599
|
-
const worldDoor = templateOf(r.id, "world", o.world);
|
|
1600
|
-
const elementDoor = templateOf(r.id, "element", o.element);
|
|
1601
|
-
const needs = o.needs === void 0 ? null : o.needs;
|
|
1602
|
-
if (!NEEDS.includes(needs)) fail(`tool ${r.id}: open.needs is 'account', 'device' or null; got ${JSON.stringify(needs)}`);
|
|
1603
|
-
const opensPublic = o.opens_public === void 0 ? false : o.opens_public;
|
|
1604
|
-
if (typeof opensPublic !== "boolean") fail(`tool ${r.id}: open.opens_public is true or false; got ${JSON.stringify(o.opens_public)}`);
|
|
1605
|
-
if (opensPublic && needs !== "account") fail(`tool ${r.id}: open.opens_public is true only beside needs 'account'; got needs ${JSON.stringify(needs)}`);
|
|
1606
|
-
const skips = o.element_skips === void 0 || o.element_skips === null ? [] : o.element_skips;
|
|
1607
|
-
if (!Array.isArray(skips) || skips.some((s) => !ELEMENT_MARKS.includes(s))) {
|
|
1608
|
-
fail(`tool ${r.id}: open.element_skips is a list of ${ELEMENT_MARKS.join(", ")}; got ${JSON.stringify(o.element_skips)}`);
|
|
1609
|
-
}
|
|
1610
|
-
if (elementDoor === null && skips.length > 0) fail(`tool ${r.id}: open.element_skips names what an element door leaves out, and the row has none`);
|
|
1611
|
-
const types = o.element_types === void 0 ? null : o.element_types;
|
|
1612
|
-
if (types !== null && (!Array.isArray(types) || types.length === 0 || new Set(types).size !== types.length || types.some((t) => !ELEMENT_TYPES.includes(t)))) {
|
|
1613
|
-
fail(`tool ${r.id}: open.element_types is null or a non-empty list of distinct type words (${STANDARD_TYPE_ORDER.join(", ")}); got ${JSON.stringify(o.element_types)}`);
|
|
1614
|
-
}
|
|
1615
|
-
if (elementDoor === null && types !== null) fail(`tool ${r.id}: open.element_types names what an element door opens, and the row has none`);
|
|
1616
|
-
if (r.rung !== "listed") continue;
|
|
1617
|
-
if (audience === "public" && needs === "device") continue;
|
|
1618
|
-
const template = kind === "element" ? elementDoor ?? worldDoor : worldDoor;
|
|
1619
|
-
if (template === null) continue;
|
|
1620
|
-
if (kind === "element" && marks.some((m) => skips.includes(m))) continue;
|
|
1621
|
-
if (kind === "element" && types !== null && !types.includes(type)) continue;
|
|
1622
|
-
const href = fill(template);
|
|
1623
|
-
const need = audience === "public" && opensPublic ? null : needs;
|
|
1624
|
-
let state = null;
|
|
1625
|
-
if (tool !== null && r.client === tool) state = "You are here";
|
|
1626
|
-
else if (offline(href)) state = OFFLINE;
|
|
1627
|
-
else if (audience === "public" && need === "account") state = NO_ACCOUNT;
|
|
1628
|
-
else if (need === "account" && !browser) state = "Opens in your browser";
|
|
1629
|
-
else if (need === "account" && signedIn === false) state = `Sign in to ${r.name} first`;
|
|
1630
|
-
else if (need === "device" && phone) state = "Needs the world on this phone";
|
|
1631
|
-
else if (kind === "element" && elementDoor === null) state = "Opens the world";
|
|
1632
|
-
rows.push({ id: r.id, name: r.name, href, state });
|
|
1633
|
-
}
|
|
1634
|
-
return unnamed ? [] : rows;
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
// src/tools.generated.ts
|
|
1638
|
-
var TOOLS = [
|
|
1639
|
-
{
|
|
1640
|
-
"id": "atlas",
|
|
1641
|
-
"name": "Atlas",
|
|
1642
|
-
"url": "https://atlas.onlyworlds.com",
|
|
1643
|
-
"client": "atlas",
|
|
1644
|
-
"rung": "listed",
|
|
1645
|
-
"open": {
|
|
1646
|
-
"world": "https://atlas.onlyworlds.com/#/open/{world}",
|
|
1647
|
-
"element": "https://atlas.onlyworlds.com/#/open/{world}/element/{id}",
|
|
1648
|
-
"needs": "account",
|
|
1649
|
-
"element_skips": [],
|
|
1650
|
-
"element_types": null,
|
|
1651
|
-
"opens_public": true
|
|
1652
|
-
}
|
|
1653
|
-
},
|
|
1654
|
-
{
|
|
1655
|
-
"id": "lantern",
|
|
1656
|
-
"name": "Lantern",
|
|
1657
|
-
"url": "https://lantern.onlyworlds.com",
|
|
1658
|
-
"client": "lantern",
|
|
1659
|
-
"rung": "listed",
|
|
1660
|
-
"open": {
|
|
1661
|
-
"world": "https://lantern.onlyworlds.com/#/open/{world}",
|
|
1662
|
-
"element": "https://lantern.onlyworlds.com/#/open/{world}/element/{id}",
|
|
1663
|
-
"needs": "account",
|
|
1664
|
-
"element_skips": [],
|
|
1665
|
-
"element_types": null
|
|
1666
|
-
}
|
|
1667
|
-
},
|
|
1668
|
-
{
|
|
1669
|
-
"id": "little-lens",
|
|
1670
|
-
"name": "Little Lens",
|
|
1671
|
-
"url": "https://little-lens.onlyworlds.com",
|
|
1672
|
-
"client": "little-lens",
|
|
1673
|
-
"rung": "listed",
|
|
1674
|
-
"open": {
|
|
1675
|
-
"world": "https://little-lens.onlyworlds.com/#/open/{world}",
|
|
1676
|
-
"element": "https://little-lens.onlyworlds.com/#/open/{world}/element/{id}",
|
|
1677
|
-
"needs": null,
|
|
1678
|
-
"element_skips": [
|
|
1679
|
-
"room",
|
|
1680
|
-
"hidden",
|
|
1681
|
-
"proposed",
|
|
1682
|
-
"map_space"
|
|
1683
|
-
],
|
|
1684
|
-
"element_types": null
|
|
1685
|
-
}
|
|
1686
|
-
},
|
|
1687
|
-
{
|
|
1688
|
-
"id": "tangle",
|
|
1689
|
-
"name": "Tactical Tangle",
|
|
1690
|
-
"url": "https://tangle.onlyworlds.com",
|
|
1691
|
-
"client": "tangle",
|
|
1692
|
-
"rung": "listed",
|
|
1693
|
-
"open": {
|
|
1694
|
-
"world": "https://tangle.onlyworlds.com/#/open/{world}",
|
|
1695
|
-
"element": "https://tangle.onlyworlds.com/#/open/{world}/element/{id}",
|
|
1696
|
-
"needs": "account",
|
|
1697
|
-
"element_skips": [
|
|
1698
|
-
"room",
|
|
1699
|
-
"hidden",
|
|
1700
|
-
"proposed"
|
|
1701
|
-
],
|
|
1702
|
-
"element_types": [
|
|
1703
|
-
"character"
|
|
1704
|
-
]
|
|
1705
|
-
}
|
|
1706
|
-
},
|
|
1707
|
-
{
|
|
1708
|
-
"id": "subs",
|
|
1709
|
-
"name": "Subs",
|
|
1710
|
-
"url": "https://subs.onlyworlds.com",
|
|
1711
|
-
"client": "subs",
|
|
1712
|
-
"rung": "listed",
|
|
1713
|
-
"open": {
|
|
1714
|
-
"world": null,
|
|
1715
|
-
"element": "https://subs.onlyworlds.com/#/open/{world}/element/{id}",
|
|
1716
|
-
"needs": "account",
|
|
1717
|
-
"element_skips": [
|
|
1718
|
-
"room",
|
|
1719
|
-
"hidden",
|
|
1720
|
-
"proposed"
|
|
1721
|
-
],
|
|
1722
|
-
"element_types": [
|
|
1723
|
-
"character"
|
|
1724
|
-
]
|
|
1725
|
-
}
|
|
1726
|
-
},
|
|
1727
|
-
{
|
|
1728
|
-
"id": "windrose",
|
|
1729
|
-
"name": "Windrose",
|
|
1730
|
-
"url": "https://windrose.onlyworlds.com",
|
|
1731
|
-
"client": null,
|
|
1732
|
-
"rung": "listed",
|
|
1733
|
-
"open": null
|
|
1734
|
-
},
|
|
1735
|
-
{
|
|
1736
|
-
"id": "mapper",
|
|
1737
|
-
"name": "OnlyWorlds mapper",
|
|
1738
|
-
"url": "https://maps.onlyworlds.com",
|
|
1739
|
-
"client": "mapper",
|
|
1740
|
-
"rung": "listed",
|
|
1741
|
-
"open": {
|
|
1742
|
-
"world": "https://maps.onlyworlds.com/?world={world}",
|
|
1743
|
-
"element": "https://maps.onlyworlds.com/?world={world}&type={type}&element={id}",
|
|
1744
|
-
"needs": "account",
|
|
1745
|
-
"element_skips": [
|
|
1746
|
-
"map_space"
|
|
1747
|
-
],
|
|
1748
|
-
"element_types": null,
|
|
1749
|
-
"opens_public": true
|
|
1750
|
-
}
|
|
1751
|
-
}
|
|
1752
|
-
];
|
|
1753
|
-
|
|
1754
|
-
// src/doors.ts
|
|
1755
|
-
var TIME = /^([0-9]{4})-([0-9]{2})-([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})(?:\.([0-9]+))?(Z|([+-])([0-9]{2}):([0-9]{2}))$/;
|
|
1756
|
-
var MONTH_DAYS = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
1757
|
-
var fail2 = (what) => {
|
|
1758
|
-
throw new TypeError(`doorsOf: ${what}`);
|
|
1759
|
-
};
|
|
1760
|
-
function daysFromCivil(year, month, day) {
|
|
1761
|
-
const y = month <= 2 ? year - 1 : year;
|
|
1762
|
-
const era = Math.floor(y / 400);
|
|
1763
|
-
const yoe = y - era * 400;
|
|
1764
|
-
const doy = Math.floor((153 * (month > 2 ? month - 3 : month + 9) + 2) / 5) + day - 1;
|
|
1765
|
-
const doe = yoe * 365 + Math.floor(yoe / 4) - Math.floor(yoe / 100) + doy;
|
|
1766
|
-
return era * 146097 + doe - 719468;
|
|
1767
|
-
}
|
|
1768
|
-
function doorTimeOf(value) {
|
|
1769
|
-
if (typeof value !== "string") return null;
|
|
1770
|
-
const m = TIME.exec(value);
|
|
1771
|
-
if (m === null) return null;
|
|
1772
|
-
const [year, month, day, hour, minute, second] = m.slice(1, 7).map(Number);
|
|
1773
|
-
if (month < 1 || month > 12) return null;
|
|
1774
|
-
const leap = year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
1775
|
-
if (day < 1 || day > (month === 2 && leap ? 29 : MONTH_DAYS[month - 1])) return null;
|
|
1776
|
-
if (hour > 23 || minute > 59 || second > 59) return null;
|
|
1777
|
-
let offset = 0;
|
|
1778
|
-
if (m[8] !== "Z") {
|
|
1779
|
-
const oh = Number(m[10]);
|
|
1780
|
-
const om = Number(m[11]);
|
|
1781
|
-
if (oh > 23 || om > 59) return null;
|
|
1782
|
-
offset = (m[9] === "-" ? -1 : 1) * (oh * 3600 + om * 60);
|
|
1783
|
-
}
|
|
1784
|
-
const seconds = daysFromCivil(year, month, day) * 86400 + hour * 3600 + minute * 60 + second - offset;
|
|
1785
|
-
return { seconds, fraction: (m[7] ?? "").replace(/0+$/, "") };
|
|
1786
|
-
}
|
|
1787
|
-
function compareInstants(a, b) {
|
|
1788
|
-
if (a.seconds !== b.seconds) return a.seconds < b.seconds ? -1 : 1;
|
|
1789
|
-
const width = Math.max(a.fraction.length, b.fraction.length);
|
|
1790
|
-
const fa = a.fraction.padEnd(width, "0");
|
|
1791
|
-
const fb = b.fraction.padEnd(width, "0");
|
|
1792
|
-
return fa === fb ? 0 : fa < fb ? -1 : 1;
|
|
1793
|
-
}
|
|
1794
|
-
function compareCodePoints(a, b) {
|
|
1795
|
-
const ca = Array.from(a, (c) => c.codePointAt(0));
|
|
1796
|
-
const cb = Array.from(b, (c) => c.codePointAt(0));
|
|
1797
|
-
for (let i = 0; i < Math.min(ca.length, cb.length); i++) {
|
|
1798
|
-
if (ca[i] !== cb[i]) return ca[i] < cb[i] ? -1 : 1;
|
|
1799
|
-
}
|
|
1800
|
-
return ca.length - cb.length;
|
|
1801
|
-
}
|
|
1802
|
-
var nonEmpty = (v) => typeof v === "string" && v.length > 0;
|
|
1803
|
-
function doorsOf(element, tools = TOOLS) {
|
|
1804
|
-
if (element === null || typeof element !== "object" || Array.isArray(element)) fail2("the element is an object, as the API serves it");
|
|
1805
|
-
if (!Array.isArray(tools)) fail2("tools is the tools list's rows, an array");
|
|
1806
|
-
const e = element;
|
|
1807
|
-
const toolOf = (door) => {
|
|
1808
|
-
const row = tools.find((r) => r !== null && typeof r === "object" && r.client === door);
|
|
1809
|
-
return row === void 0 ? null : { id: row.id, name: row.name };
|
|
1810
|
-
};
|
|
1811
|
-
const found = [];
|
|
1812
|
-
const doors = e.doors;
|
|
1813
|
-
if (doors !== null && typeof doors === "object" && !Array.isArray(doors)) {
|
|
1814
|
-
for (const [door, at] of Object.entries(doors)) {
|
|
1815
|
-
const instant = doorTimeOf(at);
|
|
1816
|
-
if (door.length > 0 && instant !== null) found.push({ door, at, instant });
|
|
1817
|
-
}
|
|
1818
|
-
}
|
|
1819
|
-
const updated = doorTimeOf(e.updated_at);
|
|
1820
|
-
if (found.length === 0) {
|
|
1821
|
-
const door = nonEmpty(e.changed_client) ? e.changed_client : nonEmpty(e.changed_via) ? e.changed_via : null;
|
|
1822
|
-
if (door === null || updated === null) return [];
|
|
1823
|
-
return [{ door, at: e.updated_at, tool: toolOf(door), last: true, from: "last-write" }];
|
|
1824
|
-
}
|
|
1825
|
-
found.sort((a, b) => compareInstants(b.instant, a.instant) || compareCodePoints(a.door, b.door));
|
|
1826
|
-
let lastSeen = false;
|
|
1827
|
-
return found.map(({ door, at, instant }) => {
|
|
1828
|
-
const last = !lastSeen && updated !== null && compareInstants(instant, updated) === 0;
|
|
1829
|
-
if (last) lastSeen = true;
|
|
1830
|
-
return { door, at, tool: toolOf(door), last, from: "doors" };
|
|
1831
|
-
});
|
|
1832
|
-
}
|
|
1833
|
-
function doorWhere(door) {
|
|
1834
|
-
if (door === null || typeof door !== "object" || Array.isArray(door)) throw new TypeError("doorWhere: the door is an entry of doorsOf, an object");
|
|
1835
|
-
if (typeof door.door !== "string") throw new TypeError("doorWhere: the entry's door is a string");
|
|
1836
|
-
const tool = door.tool;
|
|
1837
|
-
if (tool != null) {
|
|
1838
|
-
if (typeof tool !== "object" || typeof tool.name !== "string") throw new TypeError("doorWhere: the entry's tool is null or { id, name }");
|
|
1839
|
-
return `in ${tool.name}`;
|
|
1840
|
-
}
|
|
1841
|
-
if (door.door === "site") return "on onlyworlds.com";
|
|
1842
|
-
if (isAgentDoor(door.door)) return "with an AI";
|
|
1843
|
-
if (door.door === "server") return "by OnlyWorlds";
|
|
1844
|
-
return "in code";
|
|
1845
|
-
}
|
|
1846
|
-
|
|
1847
1214
|
export {
|
|
1848
1215
|
unknownKey,
|
|
1849
1216
|
refuseUnknownOptions,
|
|
1850
1217
|
ELEMENT_TYPES,
|
|
1218
|
+
STANDARD_TYPE_ORDER,
|
|
1851
1219
|
ONLYWORLDS_VERSION,
|
|
1852
1220
|
ELEMENT_GROUPS,
|
|
1853
1221
|
GROUP_ORDER,
|
|
@@ -1865,10 +1233,6 @@ export {
|
|
|
1865
1233
|
MESSAGE_READ_MARK,
|
|
1866
1234
|
NOTE_PAIR,
|
|
1867
1235
|
FIELD_SCHEMA,
|
|
1868
|
-
SPATIAL_TYPES,
|
|
1869
|
-
AGENT_DOORS,
|
|
1870
|
-
isAgentDoor,
|
|
1871
|
-
isKnownOf,
|
|
1872
1236
|
simpleCaseFold,
|
|
1873
1237
|
trimWhiteSpace,
|
|
1874
1238
|
isWhiteSpaceAt,
|
|
@@ -1884,17 +1248,5 @@ export {
|
|
|
1884
1248
|
readingAidOf,
|
|
1885
1249
|
PROPOSED_MARK,
|
|
1886
1250
|
proposedMarkOf,
|
|
1887
|
-
handsOnAsProposed
|
|
1888
|
-
MAP_SPACE,
|
|
1889
|
-
isHiddenMark,
|
|
1890
|
-
OwAddressError,
|
|
1891
|
-
elementAddress,
|
|
1892
|
-
parseOwLink,
|
|
1893
|
-
readOwLinkAt,
|
|
1894
|
-
findOwLinks,
|
|
1895
|
-
typeWord,
|
|
1896
|
-
openersFor,
|
|
1897
|
-
TOOLS,
|
|
1898
|
-
doorsOf,
|
|
1899
|
-
doorWhere
|
|
1251
|
+
handsOnAsProposed
|
|
1900
1252
|
};
|