nervur 0.7.2 → 0.7.5
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/being.mjs +13 -5
- package/ground.mjs +10 -7
- package/package.json +1 -1
package/being.mjs
CHANGED
|
@@ -56,13 +56,13 @@ const rootFor = ({ memory, voice, address }) => {
|
|
|
56
56
|
return opened === undefined ? undefined : Buffer.from(opened, 'base64');
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
const Port = ({ voice, mine,
|
|
59
|
+
const Port = ({ voice, mine, deliver, rights }) => {
|
|
60
60
|
const stamp = Stamp();
|
|
61
61
|
const lanes = new Map();
|
|
62
62
|
const send = async (to, op) => {
|
|
63
63
|
const turn = (lanes.get(to) ?? Promise.resolve()).then(() => {
|
|
64
64
|
const handle = mine.read(`handles/${to}`);
|
|
65
|
-
return
|
|
65
|
+
return deliver(
|
|
66
66
|
Tools.envelope(handle === undefined ? voice : Voice.revive(handle.face), to, op, stamp()),
|
|
67
67
|
);
|
|
68
68
|
});
|
|
@@ -112,7 +112,7 @@ const rotates = ({ mine }, from, nextPkHash) => {
|
|
|
112
112
|
return from;
|
|
113
113
|
};
|
|
114
114
|
|
|
115
|
-
const Being = ({ voice, address, modules, registry, vouched, watch }) => {
|
|
115
|
+
const Being = ({ voice, address, deliver, modules, registry, vouched, watch }) => {
|
|
116
116
|
const memory = modules.memory;
|
|
117
117
|
const root = rootFor({ memory, voice, address });
|
|
118
118
|
const source = memory.read(address, 'program')?.value;
|
|
@@ -214,7 +214,7 @@ const Being = ({ voice, address, modules, registry, vouched, watch }) => {
|
|
|
214
214
|
const asked = await program.ask({
|
|
215
215
|
context: {
|
|
216
216
|
modules: Object.freeze({ ...modules, memory: scoped(mine, program) }),
|
|
217
|
-
port: Port({ voice, mine,
|
|
217
|
+
port: Port({ voice, mine, deliver, rights }),
|
|
218
218
|
registry,
|
|
219
219
|
rights,
|
|
220
220
|
},
|
|
@@ -258,6 +258,7 @@ const Registry = ({
|
|
|
258
258
|
memory,
|
|
259
259
|
adminMine,
|
|
260
260
|
address,
|
|
261
|
+
deliver,
|
|
261
262
|
modules,
|
|
262
263
|
modulesFor,
|
|
263
264
|
announce,
|
|
@@ -276,7 +277,14 @@ const Registry = ({
|
|
|
276
277
|
if (voice === undefined) {
|
|
277
278
|
return undefined;
|
|
278
279
|
}
|
|
279
|
-
const door = Being({
|
|
280
|
+
const door = Being({
|
|
281
|
+
address: at,
|
|
282
|
+
deliver,
|
|
283
|
+
modules: modulesFor(voice),
|
|
284
|
+
vouched,
|
|
285
|
+
voice,
|
|
286
|
+
watch,
|
|
287
|
+
});
|
|
280
288
|
live.set(at, door);
|
|
281
289
|
return door;
|
|
282
290
|
};
|
package/ground.mjs
CHANGED
|
@@ -94,10 +94,7 @@ const Ground = (modules = {}) => {
|
|
|
94
94
|
{
|
|
95
95
|
...extra,
|
|
96
96
|
...boundFor(voice),
|
|
97
|
-
deliver: (envelope) => deliver(envelope),
|
|
98
97
|
memory,
|
|
99
|
-
paths,
|
|
100
|
-
wire,
|
|
101
98
|
},
|
|
102
99
|
Tools.address(voice.pk),
|
|
103
100
|
),
|
|
@@ -148,6 +145,7 @@ const Ground = (modules = {}) => {
|
|
|
148
145
|
memory,
|
|
149
146
|
adminMine,
|
|
150
147
|
address,
|
|
148
|
+
deliver: (envelope) => deliver(envelope),
|
|
151
149
|
modules: adminModules,
|
|
152
150
|
modulesFor,
|
|
153
151
|
announce,
|
|
@@ -157,10 +155,15 @@ const Ground = (modules = {}) => {
|
|
|
157
155
|
watch,
|
|
158
156
|
});
|
|
159
157
|
const admin = (envelope, token) =>
|
|
160
|
-
Being({
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
158
|
+
Being({
|
|
159
|
+
address,
|
|
160
|
+
deliver: (envelope) => deliver(envelope),
|
|
161
|
+
modules: adminModules,
|
|
162
|
+
registry,
|
|
163
|
+
vouched,
|
|
164
|
+
voice: adminVoice,
|
|
165
|
+
watch,
|
|
166
|
+
})(envelope, token);
|
|
164
167
|
|
|
165
168
|
announce(address);
|
|
166
169
|
for (const key of adminMine.list('identity/custody/')) {
|