@nervur.org/genome 0.37.6 → 0.37.8
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/cage/run/given.js +1 -1
- package/cage/run/input.js +3 -2
- package/contracts/carriers/contract.js +1 -1
- package/docs/changelog.md +5 -15
- package/genome/brain/kit.js +1 -1
- package/genome/brain/whole.d.ts +1 -1
- package/genome/brain/whole.js +15 -8
- package/genome/carry/carry.js +1 -1
- package/genome/carry/gear.js +1 -1
- package/genome/carry/held.js +1 -1
- package/genome/carry/organ.js +1 -1
- package/genome/cells/index.d.ts +1 -1
- package/genome/cells/index.js +1 -0
- package/genome/cells/rows.d.ts +2 -1
- package/genome/cells/rows.js +8 -1
- package/genome/faculties/ear/blueprint.js +1 -1
- package/genome/faculties/ear/text.js +1 -1
- package/genome/faculties/library/blueprint.js +1 -1
- package/genome/faculties/library/text.js +1 -1
- package/genome/faculties/mouth/blueprint.js +1 -1
- package/genome/faculties/mouth/text.js +1 -1
- package/genome/faculties/scheduler/blueprint.js +1 -1
- package/genome/faculties/scheduler/text.js +1 -1
- package/genome/log/open.js +1 -1
- package/genome/log/record.d.ts +6 -2
- package/genome/log/record.js +14 -15
- package/genome/organism/body.js +1 -1
- package/genome/pure/frozen.js +9 -14
- package/genome/store/store.js +1 -1
- package/kit/brain/rig.js +2 -1
- package/kit/core/chance.d.ts +1 -0
- package/kit/core/chance.js +7 -0
- package/kit/core/foundation.js +2 -2
- package/kit/core/index.d.ts +1 -1
- package/kit/core/index.js +1 -1
- package/kit/organism/peer.js +2 -2
- package/kit/organism/rig.d.ts +2 -1
- package/kit/organism/rig.js +22 -5
- package/kit/presence/home.js +2 -6
- package/kit/presence/screen-half.js +1 -1
- package/package.json +1 -1
- package/seams/carriers/carriers.js +1 -1
- package/seams/entry/configuration.js +1 -1
- package/standard/blueprint/blueprint.js +1 -1
- package/standard/version.js +1 -1
package/genome/pure/frozen.js
CHANGED
|
@@ -33,19 +33,14 @@ const listOf = (items ) => ({ type: 'array', items });
|
|
|
33
33
|
|
|
34
34
|
const FROZEN = objectOf({
|
|
35
35
|
genome: text,
|
|
36
|
-
store: {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
pairs: listOf(objectOf({ key: bytes, value: bytes })),
|
|
45
|
-
},
|
|
46
|
-
required: ['key', 'sequence', 'end', 'slot', 'pairs'],
|
|
47
|
-
additionalProperties: false,
|
|
48
|
-
},
|
|
36
|
+
store: objectOf({
|
|
37
|
+
key: bytes,
|
|
38
|
+
sequence: count,
|
|
39
|
+
end: count,
|
|
40
|
+
slot: { enum: [0, 1] },
|
|
41
|
+
sealed: count,
|
|
42
|
+
pairs: listOf(objectOf({ key: bytes, value: bytes })),
|
|
43
|
+
}),
|
|
49
44
|
alarms: listOf(objectOf({ kind: { enum: ['wake', 'booting', 'expiry'] }, at: { type: 'number', minimum: 0 } })),
|
|
50
45
|
bounds: listOf(objectOf({ far: text, bound: count })),
|
|
51
46
|
carry: objectOf({
|
|
@@ -170,7 +165,7 @@ const storeOf = (fields ) => ({
|
|
|
170
165
|
sequence: numberAt(fields, 'sequence'),
|
|
171
166
|
end: numberAt(fields, 'end'),
|
|
172
167
|
slot: numberAt(fields, 'slot') === 0 ? 0 : 1,
|
|
173
|
-
sealed:
|
|
168
|
+
sealed: numberAt(fields, 'sealed'),
|
|
174
169
|
pairs: recordsAt(fields, 'pairs').map((pair) => ({
|
|
175
170
|
key: bytesAt(pair, 'key'),
|
|
176
171
|
value: bytesAt(pair, 'value'),
|
package/genome/store/store.js
CHANGED
package/kit/brain/rig.js
CHANGED
|
@@ -13,6 +13,7 @@ import {
|
|
|
13
13
|
committingOn,
|
|
14
14
|
configurationOf,
|
|
15
15
|
must,
|
|
16
|
+
freshSeed,
|
|
16
17
|
passing,
|
|
17
18
|
seeded,
|
|
18
19
|
|
|
@@ -167,7 +168,7 @@ const linkedOver = (
|
|
|
167
168
|
const time = clockOver(clock, keptIn(cellsOf(cache, BRAIN, false)));
|
|
168
169
|
const commits = ridingTime(found.commits, () => cellsOf(cache, BRAIN, true), time);
|
|
169
170
|
const linked = wired({
|
|
170
|
-
fills: { time, chance: seeded(
|
|
171
|
+
fills: { time, chance: seeded(freshSeed()), queues: genomeQueues, codec, crypto, unlocker },
|
|
171
172
|
clock: time,
|
|
172
173
|
configuration,
|
|
173
174
|
shipped: GENOME_SHIPPED,
|
package/kit/core/chance.d.ts
CHANGED
package/kit/core/chance.js
CHANGED
package/kit/core/foundation.js
CHANGED
|
@@ -7,7 +7,7 @@ import { makeCommits, } from '../../genome/commits/
|
|
|
7
7
|
import { memoryPages, } from '../pages/index.js';
|
|
8
8
|
import { createStore, openStore, } from '../../genome/store/index.js';
|
|
9
9
|
import { } from '../../cage/index.js';
|
|
10
|
-
import { seeded } from './chance.js';
|
|
10
|
+
import { freshSeed, seeded } from './chance.js';
|
|
11
11
|
import { WALL, } from './clock.js';
|
|
12
12
|
import { WASM } from './wasm.js';
|
|
13
13
|
|
|
@@ -58,7 +58,7 @@ export const STILL_TIME = {
|
|
|
58
58
|
|
|
59
59
|
export const storeGearOf = (
|
|
60
60
|
memory = memoryPages(),
|
|
61
|
-
seed =
|
|
61
|
+
seed = freshSeed(),
|
|
62
62
|
time = STILL_TIME,
|
|
63
63
|
) => ({
|
|
64
64
|
pages: memory.pages,
|
package/kit/core/index.d.ts
CHANGED
package/kit/core/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
-
export { seeded } from './chance.js';
|
|
2
|
+
export { freshSeed, seeded } from './chance.js';
|
|
3
3
|
export { dataFrom, } from './data.js';
|
|
4
4
|
export { clockOf, WALL, } from './clock.js';
|
|
5
5
|
export { configurationOf } from './configuration.js';
|
package/kit/organism/peer.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
2
|
import { nobleCrypto, read, readInvitation, seal, standingOn, } from '#quo';
|
|
3
|
-
import { seeded } from '../core/index.js';
|
|
3
|
+
import { freshSeed, seeded } from '../core/index.js';
|
|
4
4
|
import { HOST_SCHEMES } from './carriers.js';
|
|
5
5
|
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ import { HOST_SCHEMES } from './carriers.js';
|
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
|
|
13
|
-
export const peerOf = (text , seed =
|
|
13
|
+
export const peerOf = (text , seed = freshSeed()) => {
|
|
14
14
|
const invitation = readInvitation(text, HOST_SCHEMES);
|
|
15
15
|
if (invitation === null) throw new Error('rig: the text is no invitation');
|
|
16
16
|
const chance = seeded(seed);
|
package/kit/organism/rig.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BridgeTransportSeam, CarriersSeam, Configuration, Fills, Init, Start, UnlockerSeam, VitalsSeam } from '#seams';
|
|
1
|
+
import type { BridgeTransportSeam, CarriersSeam, ChanceSeam, Configuration, Fills, Init, Start, UnlockerSeam, VitalsSeam } from '#seams';
|
|
2
2
|
import { type Answer, type Data } from '#standard';
|
|
3
3
|
import { type Clock } from '../core/index.js';
|
|
4
4
|
import { type MemoryPages } from '../pages/index.js';
|
|
@@ -26,6 +26,7 @@ export type Gear = {
|
|
|
26
26
|
readonly configuration?: Configuration;
|
|
27
27
|
readonly init?: Init;
|
|
28
28
|
readonly seed?: number;
|
|
29
|
+
readonly chance?: ChanceSeam;
|
|
29
30
|
readonly key?: Uint8Array;
|
|
30
31
|
readonly upgrade?: Start['upgrade'];
|
|
31
32
|
};
|
package/kit/organism/rig.js
CHANGED
|
@@ -3,6 +3,7 @@ import { nobleCrypto } from '#quo';
|
|
|
3
3
|
|
|
4
4
|
|
|
5
5
|
|
|
6
|
+
|
|
6
7
|
|
|
7
8
|
|
|
8
9
|
|
|
@@ -13,7 +14,16 @@ import { nobleCrypto } from '#quo';
|
|
|
13
14
|
import { admits, isFields, } from '#standard';
|
|
14
15
|
import { laidOf, withFaculties } from './laid.js';
|
|
15
16
|
import { genomeCodec } from '../../cage/codec/index.js';
|
|
16
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
BOOT_KEY,
|
|
19
|
+
clockOf,
|
|
20
|
+
configurationOf,
|
|
21
|
+
freshSeed,
|
|
22
|
+
passing,
|
|
23
|
+
seeded,
|
|
24
|
+
startedOn,
|
|
25
|
+
|
|
26
|
+
} from '../core/index.js';
|
|
17
27
|
import { memoryPages, } from '../pages/index.js';
|
|
18
28
|
import { puppetEngine, } from '../puppet/index.js';
|
|
19
29
|
import { genomeQueues } from '../../genome/queues/index.js';
|
|
@@ -106,8 +116,10 @@ const fieldOf = (data , key ) => (isFields(data) ? (data[key]
|
|
|
106
116
|
|
|
107
117
|
|
|
108
118
|
|
|
109
|
-
|
|
119
|
+
|
|
110
120
|
|
|
121
|
+
|
|
122
|
+
|
|
111
123
|
|
|
112
124
|
|
|
113
125
|
|
|
@@ -202,11 +214,14 @@ const answered = (method , answer ) => {
|
|
|
202
214
|
};
|
|
203
215
|
|
|
204
216
|
export const rigOver = async (wasm , faculties , options = {}) => {
|
|
205
|
-
const { seed =
|
|
217
|
+
const { seed = freshSeed(), memory = memoryPages(), init = { kind: 'first-install' } } = options;
|
|
206
218
|
const clock = clockOf();
|
|
207
219
|
if (options.wall !== undefined) clock.setWall(options.wall);
|
|
208
220
|
const { carriers, door, vitals, hearing } = options;
|
|
209
|
-
const fills =
|
|
221
|
+
const fills = {
|
|
222
|
+
...fillsOf(memory, clock, faculties, seed, carriers, door, vitals, hearing),
|
|
223
|
+
chance: options.chance ?? seeded(seed),
|
|
224
|
+
};
|
|
210
225
|
const { start, configured } = beginOf(options, faculties, fills, init);
|
|
211
226
|
const made = await startedOn(clock, () => memory.pending() > 0, startOn(options.form ?? 'device', start, wasm));
|
|
212
227
|
if (!('started' in made)) throw new Error(`rig: the organism is not started: ${made.why}`);
|
|
@@ -242,7 +257,9 @@ export const rigOver = async (wasm , faculties , options
|
|
|
242
257
|
},
|
|
243
258
|
restart: (gear = {}) => {
|
|
244
259
|
memory.crash();
|
|
245
|
-
|
|
260
|
+
const again = againOf(options, gear, { seed, memory, configured });
|
|
261
|
+
const handed = gear.seed !== undefined || gear.chance !== undefined;
|
|
262
|
+
return rigOver(wasm, faculties, handed ? again : { ...again, chance: fills.chance });
|
|
246
263
|
},
|
|
247
264
|
};
|
|
248
265
|
};
|
package/kit/presence/home.js
CHANGED
|
@@ -8,7 +8,7 @@ import { CONSOLE, SCREEN, } from '../../genome/presence/index
|
|
|
8
8
|
import { KIT_SKINS, } from './skins.js';
|
|
9
9
|
import { consoleHalf, } from './console-half.js';
|
|
10
10
|
import { screenHalf, } from './screen-half.js';
|
|
11
|
-
import { BOOT_KEY, clockOf, configurationOf, passing, seeded, startedOn, WASM } from '../core/index.js';
|
|
11
|
+
import { BOOT_KEY, clockOf, configurationOf, freshSeed, passing, seeded, startedOn, WASM } from '../core/index.js';
|
|
12
12
|
import { startOn, } from '../organism/forms.js';
|
|
13
13
|
import { fillsOf, heldCarriers, startOf, } from '../organism/rig.js';
|
|
14
14
|
import { memoryPages, } from '../pages/index.js';
|
|
@@ -98,15 +98,11 @@ export const DESKTOP = desktopOf(KIT_SKINS);
|
|
|
98
98
|
|
|
99
99
|
const stood = new WeakMap ();
|
|
100
100
|
|
|
101
|
-
const FIRST_SEED = 1000;
|
|
102
|
-
let homes = 0;
|
|
103
|
-
|
|
104
101
|
const chanceOn = (memory , seed ) => {
|
|
105
102
|
const held = stood.get(memory);
|
|
106
103
|
if (held !== undefined) return held;
|
|
107
104
|
const draws = [];
|
|
108
|
-
|
|
109
|
-
const drawn = seeded(seed ?? FIRST_SEED + homes);
|
|
105
|
+
const drawn = seeded(seed ?? freshSeed());
|
|
110
106
|
const chance = {
|
|
111
107
|
draw: (length) => {
|
|
112
108
|
const bytes = drawn.draw(length);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nervur.org/genome",
|
|
3
|
-
"version": "0.37.
|
|
3
|
+
"version": "0.37.8",
|
|
4
4
|
"description": "What every Nervur organism is, on every host: the brain, the lobes and their engine, the store, Quo, and the seams a host fills. 0.x, unstable.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"agents",
|
package/standard/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// SPDX-License-Identifier: FSL-1.1-ALv2
|
|
2
|
-
export const GENOME_VERSION = '0.37.
|
|
2
|
+
export const GENOME_VERSION = '0.37.8';
|