@nervur-org/dock 0.3.1 → 0.4.1
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/GETTING_STARTED.md +23 -13
- package/{beings/GLOSSARY.md → GLOSSARY.md} +3 -3
- package/NOTICE +1 -1
- package/README.md +20 -16
- package/{beings/WORLDS.md → WORLDS.md} +6 -4
- package/api/route.ts +3 -3
- package/beings/avatar.ts +2 -2
- package/beings/carry.ts +2 -2
- package/beings/clock.ts +2 -2
- package/beings/courier.ts +2 -2
- package/beings/desk.ts +2 -2
- package/beings/doorbell.ts +2 -2
- package/beings/envoy.ts +2 -2
- package/beings/join.ts +2 -2
- package/beings/link.ts +5 -5
- package/beings/look.ts +1 -1
- package/beings/porter.ts +2 -2
- package/beings/presence.ts +1 -1
- package/beings/setup.ts +3 -3
- package/beings/side.ts +2 -2
- package/beings/user.ts +2 -2
- package/beings/way.ts +1 -1
- package/cli/client.ts +6 -6
- package/cli/daemon.ts +7 -7
- package/cli/estate/{quo.service → nervur.service} +12 -12
- package/cli/estate/org.nervur.plist +44 -0
- package/cli/estate.ts +6 -6
- package/cli/{quo.ts → nervur.ts} +43 -37
- package/cli/pilot.ts +3 -3
- package/cli/stand.ts +3 -3
- package/dist/api/route.d.ts +2 -2
- package/dist/api/route.js +2 -2
- package/dist/beings/avatar.d.ts +1 -1
- package/dist/beings/avatar.js +1 -1
- package/dist/beings/carry.d.ts +2 -2
- package/dist/beings/carry.js +1 -1
- package/dist/beings/clock.d.ts +2 -2
- package/dist/beings/clock.js +1 -1
- package/dist/beings/courier.d.ts +2 -2
- package/dist/beings/courier.js +1 -1
- package/dist/beings/desk.d.ts +3 -3
- package/dist/beings/desk.js +1 -1
- package/dist/beings/doorbell.d.ts +3 -3
- package/dist/beings/doorbell.js +1 -1
- package/dist/beings/envoy.d.ts +2 -2
- package/dist/beings/envoy.js +1 -1
- package/dist/beings/join.d.ts +2 -2
- package/dist/beings/link.d.ts +2 -2
- package/dist/beings/link.js +3 -3
- package/dist/beings/look.d.ts +1 -1
- package/dist/beings/porter.d.ts +2 -2
- package/dist/beings/porter.js +1 -1
- package/dist/beings/presence.d.ts +1 -1
- package/dist/beings/setup.d.ts +1 -1
- package/dist/beings/side.d.ts +1 -1
- package/dist/beings/side.js +1 -1
- package/dist/beings/user.d.ts +3 -3
- package/dist/beings/user.js +1 -1
- package/dist/beings/way.d.ts +1 -1
- package/dist/cli/client.js +4 -4
- package/dist/cli/daemon.d.ts +1 -1
- package/dist/cli/daemon.js +6 -6
- package/dist/cli/estate/{quo.service → nervur.service} +12 -12
- package/dist/cli/estate/org.nervur.plist +44 -0
- package/dist/cli/estate.js +6 -6
- package/dist/cli/{quo.js → nervur.js} +43 -37
- package/dist/cli/stand.d.ts +2 -2
- package/dist/dock/agents.d.ts +1 -1
- package/dist/dock/agents.js +1 -1
- package/dist/dock/apns.js +1 -1
- package/dist/dock/console.d.ts +1 -1
- package/dist/dock/dialers.d.ts +2 -2
- package/dist/dock/dialers.js +2 -2
- package/dist/dock/faculty.d.ts +2 -2
- package/dist/dock/faculty.js +1 -1
- package/dist/dock/grants.d.ts +1 -1
- package/dist/dock/grants.js +1 -1
- package/dist/dock/http2.js +1 -1
- package/dist/dock/index.d.ts +1 -1
- package/dist/dock/index.js +1 -1
- package/dist/dock/local.d.ts +2 -2
- package/dist/dock/location.d.ts +1 -1
- package/dist/dock/notifications.d.ts +1 -1
- package/dist/dock/notifications.js +1 -1
- package/dist/dock/push.d.ts +1 -1
- package/dist/dock/push.js +3 -3
- package/dist/dock/service.js +1 -1
- package/dist/dock/timer.d.ts +1 -1
- package/dist/harbor/browser.d.ts +2 -2
- package/dist/harbor/browser.js +4 -4
- package/dist/harbor/capacitor.d.ts +1 -1
- package/dist/harbor/capacitor.js +1 -1
- package/dist/harbor/disk.d.ts +4 -4
- package/dist/harbor/disk.js +5 -5
- package/dist/harbor/edge/edge.d.ts +2 -2
- package/dist/harbor/edge/edge.js +5 -5
- package/dist/harbor/edge/exercise.js +8 -8
- package/dist/harbor/edge/given.d.ts +1 -1
- package/dist/harbor/edge/platform.d.ts +1 -1
- package/dist/harbor/edge/storage.d.ts +1 -1
- package/dist/harbor/edge/storage.js +2 -2
- package/dist/harbor/edge/worker.js +2 -2
- package/dist/harbor/files.d.ts +1 -1
- package/dist/harbor/files.js +2 -2
- package/dist/harbor/http.d.ts +2 -2
- package/dist/harbor/http.js +1 -1
- package/dist/harbor/idb.d.ts +1 -1
- package/dist/harbor/idb.js +0 -0
- package/dist/harbor/quo.js +1 -1
- package/dist/harbor/seal.js +1 -1
- package/dist/harbor/sealed.d.ts +1 -1
- package/dist/harbor/sealed.js +4 -4
- package/dist/harbor/tauri.d.ts +1 -1
- package/dist/harbor/tauri.js +1 -1
- package/dist/harbor/ward.d.ts +1 -1
- package/dist/human/app.d.ts +2 -2
- package/dist/human/door.js +4 -4
- package/dist/human/guest.js +1 -1
- package/dist/human/html.d.ts +1 -1
- package/dist/human/html.js +1 -1
- package/dist/human/local.d.ts +1 -1
- package/dist/human/mark.js +2 -2
- package/dist/human/move.d.ts +2 -2
- package/dist/human/move.js +1 -1
- package/dist/human/screen.d.ts +1 -1
- package/dist/human/screen.js +3 -3
- package/dist/human/tab.bundle.txt +32 -32
- package/dist/human/tab.js +7 -7
- package/dist/human/tree.d.ts +1 -1
- package/dist/human/wake.d.ts +2 -2
- package/dist/human/wake.js +1 -1
- package/dist/human/web.d.ts +1 -1
- package/dist/human/web.js +4 -4
- package/dist/human/worker.bundle.txt +27 -27
- package/dist/human/worker.js +4 -4
- package/dist/human/worlds.d.ts +2 -2
- package/dist/human/worlds.js +4 -4
- package/dist/mcp/agent.d.ts +1 -1
- package/dist/mcp/allow.d.ts +1 -1
- package/dist/mcp/allow.js +2 -2
- package/dist/mcp/oauth.js +1 -1
- package/dist/mcp/runner.d.ts +1 -1
- package/dist/mcp/server.d.ts +2 -2
- package/dist/mcp/server.js +2 -2
- package/dock/agents.ts +2 -2
- package/dock/apns.ts +1 -1
- package/dock/console.ts +1 -1
- package/dock/dialers.ts +3 -3
- package/dock/faculty.ts +2 -2
- package/dock/grants.ts +2 -2
- package/dock/http2.ts +1 -1
- package/dock/index.ts +3 -3
- package/dock/local.ts +1 -1
- package/dock/location.ts +1 -1
- package/dock/notifications.ts +2 -2
- package/dock/push.ts +4 -4
- package/dock/service.ts +1 -1
- package/dock/timer.ts +1 -1
- package/harbor/browser.ts +5 -5
- package/harbor/capacitor.ts +2 -2
- package/harbor/disk.ts +8 -8
- package/harbor/edge/edge.ts +7 -7
- package/harbor/edge/exercise.ts +11 -11
- package/harbor/edge/given.ts +1 -1
- package/harbor/edge/platform.d.ts +1 -1
- package/harbor/edge/storage.ts +2 -2
- package/harbor/edge/worker.ts +2 -2
- package/harbor/edge/wrangler.toml +3 -3
- package/harbor/files.ts +2 -2
- package/harbor/http.ts +2 -2
- package/harbor/idb.ts +0 -0
- package/harbor/quo.ts +1 -1
- package/harbor/resolve.ts +1 -1
- package/harbor/seal.ts +1 -1
- package/harbor/sealed.ts +5 -5
- package/harbor/tauri.ts +2 -2
- package/harbor/ward.ts +1 -1
- package/human/app.ts +2 -2
- package/human/apps.ts +1 -1
- package/human/door.ts +4 -4
- package/human/guest.ts +2 -2
- package/human/html.ts +2 -2
- package/human/local.ts +1 -1
- package/human/mark.ts +2 -2
- package/human/move.ts +3 -3
- package/human/screen.ts +5 -5
- package/human/tab.bundle.txt +32 -32
- package/human/tab.ts +10 -10
- package/human/tree.ts +1 -1
- package/human/wake.ts +3 -3
- package/human/web.ts +5 -5
- package/human/worker.bundle.txt +27 -27
- package/human/worker.ts +6 -6
- package/human/worlds.ts +5 -5
- package/mcp/agent.ts +1 -1
- package/mcp/allow.ts +5 -5
- package/mcp/oauth.ts +1 -1
- package/mcp/runner.ts +1 -1
- package/mcp/server.ts +3 -3
- package/package.json +15 -7
- package/{api/quo-api.md → quo-api.md} +1 -1
- package/{beings/quo-dock.md → quo-dock.md} +75 -72
- package/{harbor/quo-harbor.md → quo-harbor.md} +54 -30
- package/{human/quo-human.md → quo-human.md} +7 -7
- package/{mcp/quo-mcp.md → quo-mcp.md} +10 -10
- package/cli/estate/systems.quo.plist +0 -44
- package/cli/quo-dock.md +0 -1942
- package/dist/cli/estate/systems.quo.plist +0 -44
- package/dock/quo-app-bells.md +0 -280
- package/dock/quo-dock.md +0 -1942
- /package/dist/cli/{quo.d.ts → nervur.d.ts} +0 -0
- /package/{beings/quo-app-bells.md → quo-app-bells.md} +0 -0
|
@@ -4,7 +4,7 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// ../
|
|
7
|
+
// ../nervur/dist/being/being.js
|
|
8
8
|
var RESERVED = /* @__PURE__ */ new Set(["answer", "describe", "stance", "cells", "standings", "occupants", "occupant", "invite", "knock", "take", "boot", "lend", "constructor"]);
|
|
9
9
|
var wrote = (self, name) => {
|
|
10
10
|
for (let p = Object.getPrototypeOf(self); p !== null && p !== Object.prototype; p = Object.getPrototypeOf(p)) {
|
|
@@ -96,7 +96,7 @@ var Being = class {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
// ../
|
|
99
|
+
// ../nervur/dist/being/types.js
|
|
100
100
|
var OWNER = "OWNER";
|
|
101
101
|
var PUBLIC = "PUBLIC";
|
|
102
102
|
var RESERVED_IDS = [OWNER, PUBLIC];
|
|
@@ -119,7 +119,7 @@ var isBlueprint = (v) => {
|
|
|
119
119
|
};
|
|
120
120
|
var WORD_KEY = /* @__PURE__ */ Symbol.for("quo.word");
|
|
121
121
|
|
|
122
|
-
// ../
|
|
122
|
+
// ../nervur/dist/being/silence.js
|
|
123
123
|
var silence = /* @__PURE__ */ Symbol.for("quo.silence");
|
|
124
124
|
var isSilence = (x) => x === silence;
|
|
125
125
|
var DOOR_WORDS = ["removed", "absent", "unannounced", "repeated", "threw"];
|
|
@@ -136,7 +136,7 @@ var wordOf = (x) => x[WORD_KEY];
|
|
|
136
136
|
var unreached = () => word("unreached");
|
|
137
137
|
var isUnreached = (x) => isWord(x) && wordOf(x) === "unreached";
|
|
138
138
|
|
|
139
|
-
// ../
|
|
139
|
+
// ../nervur/dist/being/digest.js
|
|
140
140
|
var absent = (v) => v === void 0 || typeof v === "function" || typeof v === "symbol";
|
|
141
141
|
var canonical = (v) => {
|
|
142
142
|
if (Array.isArray(v))
|
|
@@ -498,7 +498,7 @@ var Location = class extends Faculty {
|
|
|
498
498
|
}
|
|
499
499
|
};
|
|
500
500
|
|
|
501
|
-
// ../
|
|
501
|
+
// ../nervur/dist/ward/cells.js
|
|
502
502
|
var DEPTH = 64;
|
|
503
503
|
var BREADTH = 1 << 20;
|
|
504
504
|
var WELL_FORMED = /^(?:[^\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])*$/;
|
|
@@ -636,7 +636,7 @@ var guardCells = (cells, wrote2 = () => {
|
|
|
636
636
|
}) => guard(cells, "cells", wrote2, true);
|
|
637
637
|
var unguarded = (cells) => targets.get(cells) ?? cells;
|
|
638
638
|
|
|
639
|
-
// ../
|
|
639
|
+
// ../nervur/dist/ward/partition.js
|
|
640
640
|
var VERSION = "pre-1.0.0";
|
|
641
641
|
var READS = [VERSION];
|
|
642
642
|
function upgrade(p) {
|
|
@@ -800,7 +800,7 @@ var fromRows = (rows) => {
|
|
|
800
800
|
return out;
|
|
801
801
|
};
|
|
802
802
|
|
|
803
|
-
// ../
|
|
803
|
+
// ../nervur/dist/ward/heirs.js
|
|
804
804
|
var SPAN = 64;
|
|
805
805
|
var Heirs = class {
|
|
806
806
|
#p;
|
|
@@ -909,7 +909,7 @@ var Heirs = class {
|
|
|
909
909
|
}
|
|
910
910
|
};
|
|
911
911
|
|
|
912
|
-
// ../
|
|
912
|
+
// ../nervur/dist/ward/arithmetic.js
|
|
913
913
|
var arithmetic_exports = {};
|
|
914
914
|
__export(arithmetic_exports, {
|
|
915
915
|
KEY: () => KEY,
|
|
@@ -1104,7 +1104,7 @@ async function unbox(bytes, padlockSecret) {
|
|
|
1104
1104
|
return decrypt(shared, bytes.subarray(KEY), ephemeralPk);
|
|
1105
1105
|
}
|
|
1106
1106
|
|
|
1107
|
-
// ../
|
|
1107
|
+
// ../nervur/dist/ward/seal.js
|
|
1108
1108
|
var utf8 = new TextEncoder();
|
|
1109
1109
|
var text2 = new TextDecoder();
|
|
1110
1110
|
var WARD_SIGN = new TextEncoder().encode("quo-ward-sign");
|
|
@@ -1194,7 +1194,7 @@ async function openReply(bytes, ephemeralSecret, signPk) {
|
|
|
1194
1194
|
}
|
|
1195
1195
|
}
|
|
1196
1196
|
|
|
1197
|
-
// ../
|
|
1197
|
+
// ../nervur/dist/ward/allowance.js
|
|
1198
1198
|
var DEFAULT = { time: 3e4 };
|
|
1199
1199
|
var CEILING = { time: 3e5 };
|
|
1200
1200
|
function allow(wanted, ceiling = CEILING, base = DEFAULT) {
|
|
@@ -1224,7 +1224,7 @@ async function within(ms, work, rang2) {
|
|
|
1224
1224
|
}
|
|
1225
1225
|
}
|
|
1226
1226
|
|
|
1227
|
-
// ../
|
|
1227
|
+
// ../nervur/dist/ward/door.js
|
|
1228
1228
|
var SILENCE = { silence: true };
|
|
1229
1229
|
var said = (quo) => ({ quo });
|
|
1230
1230
|
async function answered2(door2, asker, method, args, bound) {
|
|
@@ -1317,7 +1317,7 @@ function lid(bytes, random) {
|
|
|
1317
1317
|
return random(KEY);
|
|
1318
1318
|
}
|
|
1319
1319
|
|
|
1320
|
-
// ../
|
|
1320
|
+
// ../nervur/dist/ward/stance.js
|
|
1321
1321
|
var CALLS = ["knock", "take", "remove"];
|
|
1322
1322
|
function buildStance(inside, key, cells, bind) {
|
|
1323
1323
|
const named = (method) => method === void 0 || typeof method === "string";
|
|
@@ -1595,7 +1595,7 @@ function buildStance(inside, key, cells, bind) {
|
|
|
1595
1595
|
};
|
|
1596
1596
|
}
|
|
1597
1597
|
|
|
1598
|
-
// ../
|
|
1598
|
+
// ../nervur/dist/ward/owner.js
|
|
1599
1599
|
var str2 = { type: "string" };
|
|
1600
1600
|
var OWNER_ASKS = [
|
|
1601
1601
|
{ name: "boot", description: "boot a being by class name, under a key the owner chooses", input: { type: "object", properties: { key: str2, class: str2 }, required: ["key", "class"] } },
|
|
@@ -1738,7 +1738,7 @@ async function describe(w) {
|
|
|
1738
1738
|
};
|
|
1739
1739
|
}
|
|
1740
1740
|
|
|
1741
|
-
// ../
|
|
1741
|
+
// ../nervur/dist/ward/ward.js
|
|
1742
1742
|
async function Ward(ground) {
|
|
1743
1743
|
const w = await Self.boot(ground);
|
|
1744
1744
|
return { door: w.door, ask: w.ask };
|
|
@@ -2063,7 +2063,7 @@ var isToken = (v) => v !== null && typeof v === "object" && !Array.isArray(v) &&
|
|
|
2063
2063
|
var SEAL = 4096;
|
|
2064
2064
|
function banner(o) {
|
|
2065
2065
|
const text3 = (v) => typeof v === "string" && v.trim() ? v.trim() : "";
|
|
2066
|
-
const title2 = text3(o.title) || text3(o.from) || "
|
|
2066
|
+
const title2 = text3(o.title) || text3(o.from) || "Nervur";
|
|
2067
2067
|
const body = text3(o.body) || text3(o.said) || Object.entries(o).filter(([k]) => k !== "title" && k !== "from").map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
|
|
2068
2068
|
return { title: title2, body };
|
|
2069
2069
|
}
|
|
@@ -2913,7 +2913,7 @@ var MINUTE2 = 6e4;
|
|
|
2913
2913
|
var HOUR = 36e5;
|
|
2914
2914
|
var SPAN2 = 23 * HOUR + 59 * MINUTE2;
|
|
2915
2915
|
|
|
2916
|
-
// ../
|
|
2916
|
+
// ../nervur/dist/ward/ground.js
|
|
2917
2917
|
var maker = (objects, ...registries) => (className, stance) => {
|
|
2918
2918
|
const r = registries.find((reg) => reg !== void 0 && Object.hasOwn(reg, className));
|
|
2919
2919
|
const C = r?.[className];
|
|
@@ -2932,7 +2932,7 @@ async function learnPk(w) {
|
|
|
2932
2932
|
return pk;
|
|
2933
2933
|
}
|
|
2934
2934
|
|
|
2935
|
-
// ../
|
|
2935
|
+
// ../nervur/dist/harbor/reach.js
|
|
2936
2936
|
var never = () => new Promise(() => {
|
|
2937
2937
|
});
|
|
2938
2938
|
function request(url) {
|
|
@@ -3056,14 +3056,14 @@ var Socket = class {
|
|
|
3056
3056
|
}
|
|
3057
3057
|
};
|
|
3058
3058
|
|
|
3059
|
-
// ../
|
|
3059
|
+
// ../nervur/dist/harbor/store.js
|
|
3060
3060
|
var values = (p) => JSON.parse(JSON.stringify(p));
|
|
3061
3061
|
var rowsOf = (partition, rows) => rows.map((row) => {
|
|
3062
3062
|
const value = rowOf(partition, row);
|
|
3063
3063
|
return [row, value === void 0 ? void 0 : values(value)];
|
|
3064
3064
|
});
|
|
3065
3065
|
|
|
3066
|
-
// ../
|
|
3066
|
+
// ../nervur/dist/harbor/core.js
|
|
3067
3067
|
var DEFAULT_CODE = "classes/index.ts";
|
|
3068
3068
|
var PROBE = 1e4;
|
|
3069
3069
|
var ANNOUNCE = 64;
|
|
@@ -3559,7 +3559,7 @@ var Harbor = class {
|
|
|
3559
3559
|
}
|
|
3560
3560
|
};
|
|
3561
3561
|
|
|
3562
|
-
// ../
|
|
3562
|
+
// ../nervur/dist/harbor/dial.js
|
|
3563
3563
|
function dial(harbor, url) {
|
|
3564
3564
|
const d = { url, socket: null, wake: () => {
|
|
3565
3565
|
}, close: () => {
|
|
@@ -3730,10 +3730,10 @@ var BrowserHarbor = class extends Harbor {
|
|
|
3730
3730
|
// `lend` is what this box lends the beings of the wards it hosts: a name
|
|
3731
3731
|
// to an invitation on a being of its own ward. `stand` builds one; a bare
|
|
3732
3732
|
// tab hands none and every name answers null.
|
|
3733
|
-
constructor(store = "
|
|
3733
|
+
constructor(store = "nervur", classes = {}, lend) {
|
|
3734
3734
|
const s = typeof store === "string" ? new Idb(store) : store;
|
|
3735
3735
|
super(s, async () => ({ ...BUILT_IN, ...classes }), lend);
|
|
3736
|
-
this.name = typeof store === "string" ? store : "
|
|
3736
|
+
this.name = typeof store === "string" ? store : "nervur";
|
|
3737
3737
|
this.#locked = typeof store === "string";
|
|
3738
3738
|
}
|
|
3739
3739
|
// What this box lends, by name. A bare tab says nothing, stands no ward of
|
|
@@ -3776,7 +3776,7 @@ var BrowserHarbor = class extends Harbor {
|
|
|
3776
3776
|
const locks = globalThis.navigator?.locks;
|
|
3777
3777
|
if (!locks) return;
|
|
3778
3778
|
const granted = await new Promise((ok) => {
|
|
3779
|
-
void locks.request(`
|
|
3779
|
+
void locks.request(`nervur:${this.name}`, { ifAvailable: true }, (lock) => {
|
|
3780
3780
|
if (!lock) {
|
|
3781
3781
|
ok(false);
|
|
3782
3782
|
return;
|
|
@@ -3790,7 +3790,7 @@ var BrowserHarbor = class extends Harbor {
|
|
|
3790
3790
|
};
|
|
3791
3791
|
|
|
3792
3792
|
// beings/link.ts
|
|
3793
|
-
var KEY2 = "
|
|
3793
|
+
var KEY2 = "nervur";
|
|
3794
3794
|
var PROOF = "proof";
|
|
3795
3795
|
var HEX3 = (n) => `[0-9a-f]{${n}}`;
|
|
3796
3796
|
var FULL = new RegExp(`^(${HEX3(128)})\\.(${HEX3(64)})\\.(${HEX3(64)})$`);
|
|
@@ -3799,7 +3799,7 @@ function format(inv) {
|
|
|
3799
3799
|
return inv.heir && inv.secret ? `${inv.ward}.${inv.heir}.${inv.secret}` : inv.ward;
|
|
3800
3800
|
}
|
|
3801
3801
|
function parse(hash) {
|
|
3802
|
-
const m =
|
|
3802
|
+
const m = new RegExp(`(?:^#|&)${KEY2}=([^&]+)`).exec(hash.startsWith("#") ? hash : `#${hash}`);
|
|
3803
3803
|
if (!m) return null;
|
|
3804
3804
|
const v = decodeURIComponent(m[1]);
|
|
3805
3805
|
const full = FULL.exec(v);
|
|
@@ -4461,7 +4461,7 @@ function doorTree(at3) {
|
|
|
4461
4461
|
as: "hero",
|
|
4462
4462
|
of: [
|
|
4463
4463
|
{ kind: "image", src: MARK, alt: "" },
|
|
4464
|
-
{ kind: "text", text: "
|
|
4464
|
+
{ kind: "text", text: "Nervur", role: "title" },
|
|
4465
4465
|
{ kind: "text", text: at3.world ? `${at3.world} at ${at3.host}` : at3.host, role: "label" },
|
|
4466
4466
|
{ kind: "text", text: at3.world ? "This world is entered by invitation." : "The worlds here are entered by invitation.", role: "lead" },
|
|
4467
4467
|
{ kind: "text", text: "An invitation is a link someone sends you. Open it here, and you are in: no account, no password, nothing to type. What you can do inside is what the world shows you, and it is yours to keep on this device." },
|
|
@@ -4517,11 +4517,11 @@ var keep2 = (key, value) => {
|
|
|
4517
4517
|
} catch {
|
|
4518
4518
|
}
|
|
4519
4519
|
};
|
|
4520
|
-
var WORLDS = "
|
|
4520
|
+
var WORLDS = "nervur-worlds";
|
|
4521
4521
|
var worlds = () => kept(WORLDS, {});
|
|
4522
4522
|
var remember = (pk, url, name) => keep2(WORLDS, { ...worlds(), [pk]: { url, name } });
|
|
4523
|
-
var AT = (pk) => `
|
|
4524
|
-
var NAMES = (pk) => `
|
|
4523
|
+
var AT = (pk) => `nervur-at:${pk}`;
|
|
4524
|
+
var NAMES = (pk) => `nervur-names:${pk}`;
|
|
4525
4525
|
var el = (tag, text3 = "", attrs = {}) => {
|
|
4526
4526
|
const e = document.createElement(tag);
|
|
4527
4527
|
if (text3) e.textContent = text3;
|
|
@@ -4538,7 +4538,7 @@ async function start(cfg, root2 = document.body) {
|
|
|
4538
4538
|
const screen = el("div");
|
|
4539
4539
|
root2.append(nav, who, status, screen);
|
|
4540
4540
|
const say = (s) => status.textContent = s;
|
|
4541
|
-
const harbor = new BrowserHarbor("
|
|
4541
|
+
const harbor = new BrowserHarbor("nervur");
|
|
4542
4542
|
const classes = cfg.beings ? await import(`${cfg.web}/beings.js`).then((mod) => {
|
|
4543
4543
|
const out = {};
|
|
4544
4544
|
for (const [name, v] of Object.entries(mod)) if (typeof v === "function" && "prototype" in v) out[name] = v;
|
|
@@ -4556,7 +4556,7 @@ async function start(cfg, root2 = document.body) {
|
|
|
4556
4556
|
const pks = Object.values(cfg.wards).map((w) => w.pk);
|
|
4557
4557
|
let bell = cfg.bell ? await subscribe(cfg.web, cfg.bell) : null;
|
|
4558
4558
|
globalThis.navigator?.serviceWorker?.addEventListener("message", (e) => {
|
|
4559
|
-
if (e.data?.
|
|
4559
|
+
if (e.data?.nervur !== "wake") return;
|
|
4560
4560
|
const port = e.ports[0];
|
|
4561
4561
|
void (async () => {
|
|
4562
4562
|
harbor.wake();
|
|
@@ -4767,7 +4767,7 @@ async function start(cfg, root2 = document.body) {
|
|
|
4767
4767
|
}
|
|
4768
4768
|
await atDoor();
|
|
4769
4769
|
}
|
|
4770
|
-
var config = document.getElementById("
|
|
4770
|
+
var config = document.getElementById("nervur");
|
|
4771
4771
|
if (config?.textContent) void start(JSON.parse(config.textContent));
|
|
4772
4772
|
export {
|
|
4773
4773
|
USER,
|
package/dist/human/tab.js
CHANGED
|
@@ -8,7 +8,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
8
8
|
};
|
|
9
9
|
import { BrowserHarbor } from '../harbor/browser.js';
|
|
10
10
|
import { USER } from '../beings/avatar.js';
|
|
11
|
-
import { isInvitation } from '
|
|
11
|
+
import { isInvitation } from 'nervur';
|
|
12
12
|
import { parse, parseProof, strip } from '../beings/link.js';
|
|
13
13
|
import { giveWorld } from './move.js';
|
|
14
14
|
import { drained, subscribe } from './wake.js';
|
|
@@ -35,11 +35,11 @@ const keep = (key, value) => {
|
|
|
35
35
|
/* forgets */
|
|
36
36
|
}
|
|
37
37
|
};
|
|
38
|
-
const WORLDS = '
|
|
38
|
+
const WORLDS = 'nervur-worlds';
|
|
39
39
|
const worlds = () => kept(WORLDS, {});
|
|
40
40
|
const remember = (pk, url, name) => keep(WORLDS, { ...worlds(), [pk]: { url, name } });
|
|
41
|
-
const AT = (pk) => `
|
|
42
|
-
const NAMES = (pk) => `
|
|
41
|
+
const AT = (pk) => `nervur-at:${pk}`;
|
|
42
|
+
const NAMES = (pk) => `nervur-names:${pk}`;
|
|
43
43
|
const el = (tag, text = '', attrs = {}) => {
|
|
44
44
|
const e = document.createElement(tag);
|
|
45
45
|
if (text)
|
|
@@ -67,7 +67,7 @@ export async function start(cfg, root = document.body) {
|
|
|
67
67
|
// boots, since a being kept from the last visit is booted by class name.
|
|
68
68
|
// A world that serves none has no beings in the tab, and the page is the
|
|
69
69
|
// far being's alone.
|
|
70
|
-
const harbor = new BrowserHarbor('
|
|
70
|
+
const harbor = new BrowserHarbor('nervur');
|
|
71
71
|
const classes = cfg.beings
|
|
72
72
|
? await import(__rewriteRelativeImportExtension(`${cfg.web}/beings.js`)).then((mod) => {
|
|
73
73
|
const out = {};
|
|
@@ -101,7 +101,7 @@ export async function start(cfg, root = document.body) {
|
|
|
101
101
|
const pks = Object.values(cfg.wards).map((w) => w.pk);
|
|
102
102
|
let bell = cfg.bell ? await subscribe(cfg.web, cfg.bell) : null;
|
|
103
103
|
globalThis.navigator?.serviceWorker?.addEventListener('message', (e) => {
|
|
104
|
-
if (e.data?.
|
|
104
|
+
if (e.data?.nervur !== 'wake')
|
|
105
105
|
return;
|
|
106
106
|
const port = e.ports[0];
|
|
107
107
|
void (async () => {
|
|
@@ -403,7 +403,7 @@ export async function start(cfg, root = document.body) {
|
|
|
403
403
|
}
|
|
404
404
|
// The page hands the config in a JSON script, which a content security
|
|
405
405
|
// policy allows where an inline script is not.
|
|
406
|
-
const config = document.getElementById('
|
|
406
|
+
const config = document.getElementById('nervur');
|
|
407
407
|
if (config?.textContent)
|
|
408
408
|
void start(JSON.parse(config.textContent));
|
|
409
409
|
export { USER };
|
package/dist/human/tree.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Json } from '
|
|
1
|
+
import type { Json } from 'nervur';
|
|
2
2
|
export type Role = 'title' | 'lead' | 'body' | 'quiet' | 'label';
|
|
3
3
|
export type As = 'auto' | 'text' | 'table' | 'cards' | 'list' | 'people' | 'feed';
|
|
4
4
|
export type Layout = 'list' | 'grid' | 'hero' | 'feed';
|
package/dist/human/wake.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { Invitation, JsonObject } from '
|
|
2
|
-
import type { Harbor } from '
|
|
1
|
+
import type { Invitation, JsonObject } from 'nervur';
|
|
2
|
+
import type { Harbor } from 'nervur/harbor';
|
|
3
3
|
import { type Token } from '../dock/index.ts';
|
|
4
4
|
export declare const webToken: (endpoint: string, p256dh?: string, auth?: string) => {
|
|
5
5
|
kind: string;
|
package/dist/human/wake.js
CHANGED
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
// tab hands its browser endpoint instead and keeps no doorbell, because a
|
|
18
18
|
// browser endpoint is rung only by whoever holds the VAPID secret the
|
|
19
19
|
// subscription was made under, and that secret is the world's own.
|
|
20
|
-
import { isInvitation, isSilence, isWord } from '
|
|
20
|
+
import { isInvitation, isSilence, isWord } from 'nervur';
|
|
21
21
|
import { DOCK, CONSOLE, NOTIFICATIONS, facultyOf } from '../dock/index.js';
|
|
22
22
|
import { banner } from '../dock/push.js';
|
|
23
23
|
import { localName, relations } from './worlds.js';
|
package/dist/human/web.d.ts
CHANGED
package/dist/human/web.js
CHANGED
|
@@ -21,7 +21,7 @@ const RESERVED_PATHS = new Set(['allow', 'tab.js', 'beings.js', 'sw.js', 'design
|
|
|
21
21
|
const DESIGN = 'design';
|
|
22
22
|
const DESIGN_FILES = { 'tokens.css': 'text/css; charset=utf-8', 'fonts.css': 'text/css; charset=utf-8' };
|
|
23
23
|
const FONT = /^fonts\/[\w.-]+\.woff2$/;
|
|
24
|
-
// The origins
|
|
24
|
+
// The origins an app's webview speaks from: Tauri's on the desk,
|
|
25
25
|
// Capacitor's on iOS, and the plain loopback Android's webview uses. They
|
|
26
26
|
// are the only origins a world tells its config to, and the fetch is a
|
|
27
27
|
// plain GET asking for JSON, which no browser preflights.
|
|
@@ -73,7 +73,7 @@ export function webRoute(harbor, o) {
|
|
|
73
73
|
const fonts = worn.fonts ? `<link rel="stylesheet" href="${o.at.web}/${DESIGN}/fonts.css">` : '';
|
|
74
74
|
return `<style>${BARE}</style>${fonts}<link rel="stylesheet" href="${o.at.web}/${DESIGN}/tokens.css">`;
|
|
75
75
|
};
|
|
76
|
-
const shell = async (body) => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>
|
|
76
|
+
const shell = async (body) => `<!doctype html><html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>nervur</title>
|
|
77
77
|
${await design()}
|
|
78
78
|
</head><body>${body}</body></html>`;
|
|
79
79
|
const esc = (v) => v.replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c] ?? c);
|
|
@@ -91,7 +91,7 @@ ${await design()}
|
|
|
91
91
|
const wards = async () => Object.fromEntries(await Promise.all([...harbor.wards].filter(([n]) => n !== DOCK).map(async ([n, h]) => [n, { pk: h.pk, public: shown(n) && (await publicKey(h)) !== null }])));
|
|
92
92
|
const config = async (ward, being) => ({ quo: o.at.quo, web: o.at.web, wards: await wards(), beings: await folder.serving(), ...(o.bell ? { bell: o.bell } : {}), ...(ward ? { ward } : {}), ...(being ? { being } : {}) });
|
|
93
93
|
const tab = async (ward, being) => {
|
|
94
|
-
return `<script id="
|
|
94
|
+
return `<script id="nervur" type="application/json">${JSON.stringify(await config(ward, being)).replace(/</g, '\\u003c')}</script><script type="module" src="${o.at.web}/tab.js"></script>`;
|
|
95
95
|
};
|
|
96
96
|
// The same config the tab is handed in its page, for an app that is not a
|
|
97
97
|
// tab: it learns a world by this one fetch and never loads the bundle,
|
|
@@ -138,7 +138,7 @@ ${await design()}
|
|
|
138
138
|
if (rest === '/sw.js' && req.method === 'GET') {
|
|
139
139
|
if (!o.bell)
|
|
140
140
|
return undefined;
|
|
141
|
-
const said = `self.
|
|
141
|
+
const said = `self.nervur=${JSON.stringify(await config()).replace(/</g, '\\u003c')};\n${o.code.worker}`;
|
|
142
142
|
return new Response(said, { headers: { 'content-type': 'text/javascript; charset=utf-8', 'cache-control': 'no-store', 'service-worker-allowed': '/' } });
|
|
143
143
|
}
|
|
144
144
|
// the design this world wears, when the harbor folder holds one: its
|
|
@@ -4,7 +4,7 @@ var __export = (target, all) => {
|
|
|
4
4
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
5
5
|
};
|
|
6
6
|
|
|
7
|
-
// ../
|
|
7
|
+
// ../nervur/dist/being/being.js
|
|
8
8
|
var RESERVED = /* @__PURE__ */ new Set(["answer", "describe", "stance", "cells", "standings", "occupants", "occupant", "invite", "knock", "take", "boot", "lend", "constructor"]);
|
|
9
9
|
var wrote = (self, name) => {
|
|
10
10
|
for (let p = Object.getPrototypeOf(self); p !== null && p !== Object.prototype; p = Object.getPrototypeOf(p)) {
|
|
@@ -96,7 +96,7 @@ var Being = class {
|
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
|
|
99
|
-
// ../
|
|
99
|
+
// ../nervur/dist/being/types.js
|
|
100
100
|
var OWNER = "OWNER";
|
|
101
101
|
var PUBLIC = "PUBLIC";
|
|
102
102
|
var RESERVED_IDS = [OWNER, PUBLIC];
|
|
@@ -119,7 +119,7 @@ var isBlueprint = (v) => {
|
|
|
119
119
|
};
|
|
120
120
|
var WORD_KEY = /* @__PURE__ */ Symbol.for("quo.word");
|
|
121
121
|
|
|
122
|
-
// ../
|
|
122
|
+
// ../nervur/dist/being/silence.js
|
|
123
123
|
var silence = /* @__PURE__ */ Symbol.for("quo.silence");
|
|
124
124
|
var isSilence = (x) => x === silence;
|
|
125
125
|
var DOOR_WORDS = ["removed", "absent", "unannounced", "repeated", "threw"];
|
|
@@ -135,7 +135,7 @@ var isWord = (x) => x !== null && typeof x === "object" && typeof x[WORD_KEY] ==
|
|
|
135
135
|
var wordOf = (x) => x[WORD_KEY];
|
|
136
136
|
var unreached = () => word("unreached");
|
|
137
137
|
|
|
138
|
-
// ../
|
|
138
|
+
// ../nervur/dist/being/digest.js
|
|
139
139
|
var absent = (v) => v === void 0 || typeof v === "function" || typeof v === "symbol";
|
|
140
140
|
var canonical = (v) => {
|
|
141
141
|
if (Array.isArray(v))
|
|
@@ -478,7 +478,7 @@ var Location = class extends Faculty {
|
|
|
478
478
|
}
|
|
479
479
|
};
|
|
480
480
|
|
|
481
|
-
// ../
|
|
481
|
+
// ../nervur/dist/ward/cells.js
|
|
482
482
|
var DEPTH = 64;
|
|
483
483
|
var BREADTH = 1 << 20;
|
|
484
484
|
var WELL_FORMED = /^(?:[^\uD800-\uDFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF])*$/;
|
|
@@ -616,7 +616,7 @@ var guardCells = (cells, wrote2 = () => {
|
|
|
616
616
|
}) => guard(cells, "cells", wrote2, true);
|
|
617
617
|
var unguarded = (cells) => targets.get(cells) ?? cells;
|
|
618
618
|
|
|
619
|
-
// ../
|
|
619
|
+
// ../nervur/dist/ward/partition.js
|
|
620
620
|
var VERSION = "pre-1.0.0";
|
|
621
621
|
var READS = [VERSION];
|
|
622
622
|
function upgrade(p) {
|
|
@@ -780,7 +780,7 @@ var fromRows = (rows) => {
|
|
|
780
780
|
return out;
|
|
781
781
|
};
|
|
782
782
|
|
|
783
|
-
// ../
|
|
783
|
+
// ../nervur/dist/ward/heirs.js
|
|
784
784
|
var SPAN = 64;
|
|
785
785
|
var Heirs = class {
|
|
786
786
|
#p;
|
|
@@ -889,7 +889,7 @@ var Heirs = class {
|
|
|
889
889
|
}
|
|
890
890
|
};
|
|
891
891
|
|
|
892
|
-
// ../
|
|
892
|
+
// ../nervur/dist/ward/arithmetic.js
|
|
893
893
|
var arithmetic_exports = {};
|
|
894
894
|
__export(arithmetic_exports, {
|
|
895
895
|
KEY: () => KEY,
|
|
@@ -1084,7 +1084,7 @@ async function unbox(bytes, padlockSecret) {
|
|
|
1084
1084
|
return decrypt(shared, bytes.subarray(KEY), ephemeralPk);
|
|
1085
1085
|
}
|
|
1086
1086
|
|
|
1087
|
-
// ../
|
|
1087
|
+
// ../nervur/dist/ward/seal.js
|
|
1088
1088
|
var utf8 = new TextEncoder();
|
|
1089
1089
|
var text2 = new TextDecoder();
|
|
1090
1090
|
var WARD_SIGN = new TextEncoder().encode("quo-ward-sign");
|
|
@@ -1174,7 +1174,7 @@ async function openReply(bytes, ephemeralSecret, signPk) {
|
|
|
1174
1174
|
}
|
|
1175
1175
|
}
|
|
1176
1176
|
|
|
1177
|
-
// ../
|
|
1177
|
+
// ../nervur/dist/ward/allowance.js
|
|
1178
1178
|
var DEFAULT = { time: 3e4 };
|
|
1179
1179
|
var CEILING = { time: 3e5 };
|
|
1180
1180
|
function allow(wanted, ceiling = CEILING, base = DEFAULT) {
|
|
@@ -1204,7 +1204,7 @@ async function within(ms, work, rang2) {
|
|
|
1204
1204
|
}
|
|
1205
1205
|
}
|
|
1206
1206
|
|
|
1207
|
-
// ../
|
|
1207
|
+
// ../nervur/dist/ward/door.js
|
|
1208
1208
|
var SILENCE = { silence: true };
|
|
1209
1209
|
var said = (quo) => ({ quo });
|
|
1210
1210
|
async function answered2(door, asker, method, args, bound) {
|
|
@@ -1297,7 +1297,7 @@ function lid(bytes, random) {
|
|
|
1297
1297
|
return random(KEY);
|
|
1298
1298
|
}
|
|
1299
1299
|
|
|
1300
|
-
// ../
|
|
1300
|
+
// ../nervur/dist/ward/stance.js
|
|
1301
1301
|
var CALLS = ["knock", "take", "remove"];
|
|
1302
1302
|
function buildStance(inside, key, cells, bind) {
|
|
1303
1303
|
const named = (method) => method === void 0 || typeof method === "string";
|
|
@@ -1575,7 +1575,7 @@ function buildStance(inside, key, cells, bind) {
|
|
|
1575
1575
|
};
|
|
1576
1576
|
}
|
|
1577
1577
|
|
|
1578
|
-
// ../
|
|
1578
|
+
// ../nervur/dist/ward/owner.js
|
|
1579
1579
|
var str2 = { type: "string" };
|
|
1580
1580
|
var OWNER_ASKS = [
|
|
1581
1581
|
{ name: "boot", description: "boot a being by class name, under a key the owner chooses", input: { type: "object", properties: { key: str2, class: str2 }, required: ["key", "class"] } },
|
|
@@ -1718,7 +1718,7 @@ async function describe(w) {
|
|
|
1718
1718
|
};
|
|
1719
1719
|
}
|
|
1720
1720
|
|
|
1721
|
-
// ../
|
|
1721
|
+
// ../nervur/dist/ward/ward.js
|
|
1722
1722
|
async function Ward(ground) {
|
|
1723
1723
|
const w = await Self.boot(ground);
|
|
1724
1724
|
return { door: w.door, ask: w.ask };
|
|
@@ -2043,7 +2043,7 @@ var isToken = (v) => v !== null && typeof v === "object" && !Array.isArray(v) &&
|
|
|
2043
2043
|
var SEAL = 4096;
|
|
2044
2044
|
function banner(o) {
|
|
2045
2045
|
const text3 = (v) => typeof v === "string" && v.trim() ? v.trim() : "";
|
|
2046
|
-
const title = text3(o.title) || text3(o.from) || "
|
|
2046
|
+
const title = text3(o.title) || text3(o.from) || "Nervur";
|
|
2047
2047
|
const body = text3(o.body) || text3(o.said) || Object.entries(o).filter(([k]) => k !== "title" && k !== "from").map(([k, v]) => `${k}: ${typeof v === "string" ? v : JSON.stringify(v)}`).join(", ");
|
|
2048
2048
|
return { title, body };
|
|
2049
2049
|
}
|
|
@@ -2893,7 +2893,7 @@ var MINUTE2 = 6e4;
|
|
|
2893
2893
|
var HOUR = 36e5;
|
|
2894
2894
|
var SPAN2 = 23 * HOUR + 59 * MINUTE2;
|
|
2895
2895
|
|
|
2896
|
-
// ../
|
|
2896
|
+
// ../nervur/dist/ward/ground.js
|
|
2897
2897
|
var maker = (objects, ...registries) => (className, stance) => {
|
|
2898
2898
|
const r = registries.find((reg) => reg !== void 0 && Object.hasOwn(reg, className));
|
|
2899
2899
|
const C = r?.[className];
|
|
@@ -2912,7 +2912,7 @@ async function learnPk(w) {
|
|
|
2912
2912
|
return pk;
|
|
2913
2913
|
}
|
|
2914
2914
|
|
|
2915
|
-
// ../
|
|
2915
|
+
// ../nervur/dist/harbor/reach.js
|
|
2916
2916
|
var never = () => new Promise(() => {
|
|
2917
2917
|
});
|
|
2918
2918
|
function request(url) {
|
|
@@ -3036,14 +3036,14 @@ var Socket = class {
|
|
|
3036
3036
|
}
|
|
3037
3037
|
};
|
|
3038
3038
|
|
|
3039
|
-
// ../
|
|
3039
|
+
// ../nervur/dist/harbor/store.js
|
|
3040
3040
|
var values = (p) => JSON.parse(JSON.stringify(p));
|
|
3041
3041
|
var rowsOf = (partition, rows) => rows.map((row) => {
|
|
3042
3042
|
const value = rowOf(partition, row);
|
|
3043
3043
|
return [row, value === void 0 ? void 0 : values(value)];
|
|
3044
3044
|
});
|
|
3045
3045
|
|
|
3046
|
-
// ../
|
|
3046
|
+
// ../nervur/dist/harbor/core.js
|
|
3047
3047
|
var DEFAULT_CODE = "classes/index.ts";
|
|
3048
3048
|
var PROBE = 1e4;
|
|
3049
3049
|
var ANNOUNCE = 64;
|
|
@@ -3539,7 +3539,7 @@ var Harbor = class {
|
|
|
3539
3539
|
}
|
|
3540
3540
|
};
|
|
3541
3541
|
|
|
3542
|
-
// ../
|
|
3542
|
+
// ../nervur/dist/harbor/dial.js
|
|
3543
3543
|
function dial(harbor, url) {
|
|
3544
3544
|
const d = { url, socket: null, wake: () => {
|
|
3545
3545
|
}, close: () => {
|
|
@@ -3710,10 +3710,10 @@ var BrowserHarbor = class extends Harbor {
|
|
|
3710
3710
|
// `lend` is what this box lends the beings of the wards it hosts: a name
|
|
3711
3711
|
// to an invitation on a being of its own ward. `stand` builds one; a bare
|
|
3712
3712
|
// tab hands none and every name answers null.
|
|
3713
|
-
constructor(store = "
|
|
3713
|
+
constructor(store = "nervur", classes = {}, lend) {
|
|
3714
3714
|
const s = typeof store === "string" ? new Idb(store) : store;
|
|
3715
3715
|
super(s, async () => ({ ...BUILT_IN, ...classes }), lend);
|
|
3716
|
-
this.name = typeof store === "string" ? store : "
|
|
3716
|
+
this.name = typeof store === "string" ? store : "nervur";
|
|
3717
3717
|
this.#locked = typeof store === "string";
|
|
3718
3718
|
}
|
|
3719
3719
|
// What this box lends, by name. A bare tab says nothing, stands no ward of
|
|
@@ -3756,7 +3756,7 @@ var BrowserHarbor = class extends Harbor {
|
|
|
3756
3756
|
const locks = globalThis.navigator?.locks;
|
|
3757
3757
|
if (!locks) return;
|
|
3758
3758
|
const granted = await new Promise((ok) => {
|
|
3759
|
-
void locks.request(`
|
|
3759
|
+
void locks.request(`nervur:${this.name}`, { ifAvailable: true }, (lock) => {
|
|
3760
3760
|
if (!lock) {
|
|
3761
3761
|
ok(false);
|
|
3762
3762
|
return;
|
|
@@ -3829,14 +3829,14 @@ async function fromPage() {
|
|
|
3829
3829
|
const said2 = e.data ?? {};
|
|
3830
3830
|
if (Array.isArray(said2.missed)) ok(said2.missed);
|
|
3831
3831
|
};
|
|
3832
|
-
page.postMessage({
|
|
3832
|
+
page.postMessage({ nervur: "wake" }, [channel.port2]);
|
|
3833
3833
|
}
|
|
3834
3834
|
}),
|
|
3835
3835
|
null
|
|
3836
3836
|
);
|
|
3837
3837
|
}
|
|
3838
3838
|
async function here(cfg2) {
|
|
3839
|
-
const harbor = new BrowserHarbor("
|
|
3839
|
+
const harbor = new BrowserHarbor("nervur");
|
|
3840
3840
|
try {
|
|
3841
3841
|
await harbor.boot();
|
|
3842
3842
|
} catch {
|
|
@@ -3860,9 +3860,9 @@ async function woken(cfg2, said2) {
|
|
|
3860
3860
|
const objects = await fromPage() ?? await here(cfg2);
|
|
3861
3861
|
if (!said2 && objects.length === 0) return;
|
|
3862
3862
|
const { title, body } = said2 ?? notice(objects);
|
|
3863
|
-
await within2(5e3, sw.registration.showNotification(title, { body, tag: "
|
|
3863
|
+
await within2(5e3, sw.registration.showNotification(title, { body, tag: "nervur" }), void 0);
|
|
3864
3864
|
}
|
|
3865
|
-
var cfg = sw.
|
|
3865
|
+
var cfg = sw.nervur;
|
|
3866
3866
|
sw.addEventListener("install", () => void sw.skipWaiting());
|
|
3867
3867
|
sw.addEventListener("activate", (e) => e.waitUntil(sw.clients.claim()));
|
|
3868
3868
|
if (cfg) sw.addEventListener("push", (e) => e.waitUntil(woken(cfg, carried(e))));
|
package/dist/human/worker.js
CHANGED
|
@@ -35,7 +35,7 @@ async function fromPage() {
|
|
|
35
35
|
if (Array.isArray(said.missed))
|
|
36
36
|
ok(said.missed);
|
|
37
37
|
};
|
|
38
|
-
page.postMessage({
|
|
38
|
+
page.postMessage({ nervur: 'wake' }, [channel.port2]);
|
|
39
39
|
}
|
|
40
40
|
}), null);
|
|
41
41
|
}
|
|
@@ -44,7 +44,7 @@ async function fromPage() {
|
|
|
44
44
|
// answer, and this worker leaves it alone rather than opening a second
|
|
45
45
|
// harbor over one seed.
|
|
46
46
|
async function here(cfg) {
|
|
47
|
-
const harbor = new BrowserHarbor('
|
|
47
|
+
const harbor = new BrowserHarbor('nervur');
|
|
48
48
|
try {
|
|
49
49
|
await harbor.boot();
|
|
50
50
|
}
|
|
@@ -72,9 +72,9 @@ async function woken(cfg, said) {
|
|
|
72
72
|
// Bounded like every other step, because a browser build with no
|
|
73
73
|
// notification platform under it answers this call neither way, and a
|
|
74
74
|
// wake that waits on it is a worker the browser keeps alive for nothing.
|
|
75
|
-
await within(5000, sw.registration.showNotification(title, { body, tag: '
|
|
75
|
+
await within(5000, sw.registration.showNotification(title, { body, tag: 'nervur' }), undefined);
|
|
76
76
|
}
|
|
77
|
-
const cfg = sw.
|
|
77
|
+
const cfg = sw.nervur;
|
|
78
78
|
sw.addEventListener('install', () => void sw.skipWaiting());
|
|
79
79
|
sw.addEventListener('activate', (e) => e.waitUntil(sw.clients.claim()));
|
|
80
80
|
if (cfg)
|
package/dist/human/worlds.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Harbor, Hosted } from '
|
|
1
|
+
import type { Harbor, Hosted } from 'nervur/harbor';
|
|
2
2
|
import { Avatar } from '../beings/avatar.ts';
|
|
3
3
|
export type World = {
|
|
4
4
|
pk: string;
|
|
@@ -10,7 +10,7 @@ export type Joined = {
|
|
|
10
10
|
read(): World[];
|
|
11
11
|
write(worlds: World[]): void;
|
|
12
12
|
};
|
|
13
|
-
export declare const KEY = "
|
|
13
|
+
export declare const KEY = "nervur-worlds";
|
|
14
14
|
export declare function inStorage(storage: Pick<Storage, 'getItem' | 'setItem'>): Joined;
|
|
15
15
|
export declare function joined(list: World[], met: World): World[];
|
|
16
16
|
export declare function ordered(list: World[]): World[];
|