@ai-ecoverse/slicc-kernel 1.165.2 → 1.166.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/README.md +1 -1
- package/dist/kernel-worker.js +63 -9
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-driver-worker.js +16 -1
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +17 -2
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +63 -9
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +1 -1
- package/dist/types/kernel/vfs-file.d.ts +6 -0
- package/dist/types/launcher.d.ts +2 -0
- package/package.json +2 -2
package/dist/node.js
CHANGED
|
@@ -3684,7 +3684,7 @@ function satisfies(version, range2) {
|
|
|
3684
3684
|
}
|
|
3685
3685
|
|
|
3686
3686
|
// src/version.ts
|
|
3687
|
-
var KERNEL_VERSION = true ? "1.
|
|
3687
|
+
var KERNEL_VERSION = true ? "1.166.0" : "0.0.0-dev";
|
|
3688
3688
|
var OS_RELEASE = "6.0.0-slicc";
|
|
3689
3689
|
function procVersion() {
|
|
3690
3690
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -20000,6 +20000,7 @@ function within7(path, root) {
|
|
|
20000
20000
|
return path === root || path.startsWith(root.endsWith("/") ? root : `${root}/`);
|
|
20001
20001
|
}
|
|
20002
20002
|
var VfsNode = class {
|
|
20003
|
+
fid;
|
|
20003
20004
|
data;
|
|
20004
20005
|
ranged;
|
|
20005
20006
|
pin;
|
|
@@ -20307,6 +20308,7 @@ var VfsNodes = class {
|
|
|
20307
20308
|
keepsOnDisk = false;
|
|
20308
20309
|
changed;
|
|
20309
20310
|
movedAway;
|
|
20311
|
+
opened;
|
|
20310
20312
|
dirtied;
|
|
20311
20313
|
fs;
|
|
20312
20314
|
entries;
|
|
@@ -20466,6 +20468,7 @@ var VfsNodes = class {
|
|
|
20466
20468
|
node.ino ??= ino;
|
|
20467
20469
|
node.opens++;
|
|
20468
20470
|
if (writable2) node.writers++;
|
|
20471
|
+
if (node.opens === 1) this.opened?.(node);
|
|
20469
20472
|
return node;
|
|
20470
20473
|
}
|
|
20471
20474
|
adopt(path, contents2, dirty, writable2 = false, id2) {
|
|
@@ -20477,6 +20480,7 @@ var VfsNodes = class {
|
|
|
20477
20480
|
}
|
|
20478
20481
|
node.opens++;
|
|
20479
20482
|
if (writable2) node.writers++;
|
|
20483
|
+
if (node.opens === 1) this.opened?.(node);
|
|
20480
20484
|
return node;
|
|
20481
20485
|
}
|
|
20482
20486
|
holds(prefix) {
|
|
@@ -20503,6 +20507,32 @@ var VfsNodes = class {
|
|
|
20503
20507
|
held() {
|
|
20504
20508
|
return this.byPath.keys();
|
|
20505
20509
|
}
|
|
20510
|
+
heldIds() {
|
|
20511
|
+
const out = [];
|
|
20512
|
+
for (const [path, node] of this.byPath) if (!this.kept.has(node)) out.push([path, node.fid]);
|
|
20513
|
+
return out;
|
|
20514
|
+
}
|
|
20515
|
+
holdsAt(path) {
|
|
20516
|
+
return this.byPath.has(path);
|
|
20517
|
+
}
|
|
20518
|
+
async bindIds(id2) {
|
|
20519
|
+
for (const [path, node] of [...this.byPath]) {
|
|
20520
|
+
if (node.fid !== void 0 || this.kept.has(node)) continue;
|
|
20521
|
+
node.fid = await id2(path)?.catch(() => void 0);
|
|
20522
|
+
}
|
|
20523
|
+
}
|
|
20524
|
+
keepBound(paths, fid, file) {
|
|
20525
|
+
for (const at of paths) {
|
|
20526
|
+
const node = this.byPath.get(at);
|
|
20527
|
+
if (!node || this.kept.has(node) || node.fid !== fid) continue;
|
|
20528
|
+
this.byPath.delete(at);
|
|
20529
|
+
node.renamedTo(file.hidden);
|
|
20530
|
+
this.byPath.set(file.hidden, node);
|
|
20531
|
+
this.kept.set(node, file);
|
|
20532
|
+
return true;
|
|
20533
|
+
}
|
|
20534
|
+
return false;
|
|
20535
|
+
}
|
|
20506
20536
|
owns() {
|
|
20507
20537
|
return false;
|
|
20508
20538
|
}
|
|
@@ -30566,7 +30596,7 @@ var Launcher = class {
|
|
|
30566
30596
|
enableCdp(this.net, this.cdp);
|
|
30567
30597
|
this.facades.enable(this.net);
|
|
30568
30598
|
const fs = this.commandFs(this.base);
|
|
30569
|
-
this.nodes =
|
|
30599
|
+
this.nodes = this.openNodes(fs);
|
|
30570
30600
|
this.nodes.keepsOnDisk = true;
|
|
30571
30601
|
this.openFiles.add(this.nodes);
|
|
30572
30602
|
options.fs.onPeer?.(() => this.flushOpen());
|
|
@@ -32127,8 +32157,8 @@ var Launcher = class {
|
|
|
32127
32157
|
const at = normalizePath(path);
|
|
32128
32158
|
this.unlinked.closed(at);
|
|
32129
32159
|
this.writers?.unlinked.closed(at);
|
|
32130
|
-
|
|
32131
|
-
|
|
32160
|
+
const holding = [...this.held].some((holds2) => holds2.holding(at)) || [...this.openFiles].some((open2) => open2.holdsAt(at));
|
|
32161
|
+
if (!holding) void this.rootFs.announceHolds?.([], [at], false);
|
|
32132
32162
|
const open = [...this.openFiles].some((nodes) => nodes.writes(at)) || heldUnder(this.held, at);
|
|
32133
32163
|
if (!open) void this.mounts.commit(at).catch(() => void 0);
|
|
32134
32164
|
}
|
|
@@ -32654,13 +32684,34 @@ var Launcher = class {
|
|
|
32654
32684
|
(holds2) => [holds2, [...holds2.boundAt(path, fid), ...holds2.boundAt(hidden, fid)]]
|
|
32655
32685
|
);
|
|
32656
32686
|
const keeping = bound3.filter(([, ids]) => ids.length > 0);
|
|
32657
|
-
const
|
|
32658
|
-
|
|
32687
|
+
const nodes = [...this.openFiles].filter(
|
|
32688
|
+
(open) => [path, hidden].some((at) => open.holdsAt(at))
|
|
32689
|
+
);
|
|
32690
|
+
const file = this.unlinked.adopt(hidden, Math.max(keeping.length + nodes.length, 1));
|
|
32691
|
+
const kept = nodes.filter((open) => open.keepBound([hidden, path], fid, file)).length;
|
|
32692
|
+
for (let i = kept; i < nodes.length; i++) file.release();
|
|
32693
|
+
if (keeping.length === 0 && nodes.length === 0) file.release();
|
|
32659
32694
|
for (const [holds2, ids] of keeping) holds2.keepBound(ids, path, file);
|
|
32660
32695
|
void this.rootFs.announceHolds?.([], [path, hidden], false);
|
|
32661
32696
|
}
|
|
32697
|
+
openNodes(fs, entries) {
|
|
32698
|
+
const nodes = new VfsNodes(fs, (path) => this.released(path), entries);
|
|
32699
|
+
nodes.opened = (node) => this.nodeOpened(node);
|
|
32700
|
+
return nodes;
|
|
32701
|
+
}
|
|
32702
|
+
nodeOpened(node) {
|
|
32703
|
+
const path = node.path;
|
|
32704
|
+
if (this.locks.shared?.() !== true || this.mounts.locate(path) !== void 0) return;
|
|
32705
|
+
void (async () => {
|
|
32706
|
+
node.fid ??= await this.rootFileId(path)?.catch(() => void 0);
|
|
32707
|
+
if (node.opens > 0) await this.rootFs.announceHolds?.([[node.path, node.fid]], [], false);
|
|
32708
|
+
})();
|
|
32709
|
+
}
|
|
32662
32710
|
announceHeld() {
|
|
32663
|
-
const
|
|
32711
|
+
const nodes = [...this.openFiles].flatMap((open) => open.heldIds());
|
|
32712
|
+
const held = [...this.held.heldIds(), ...nodes].filter(
|
|
32713
|
+
([path]) => this.mounts.locate(path) === void 0 && !path.startsWith(`/${UNLINKED_DIR}/`)
|
|
32714
|
+
);
|
|
32664
32715
|
return held.length === 0 ? void 0 : this.rootFs.announceHolds?.(held, [], false);
|
|
32665
32716
|
}
|
|
32666
32717
|
rootFileId(path) {
|
|
@@ -32674,7 +32725,9 @@ var Launcher = class {
|
|
|
32674
32725
|
this.changes.flush();
|
|
32675
32726
|
this.changes.foreign(crowded);
|
|
32676
32727
|
if (crowded) {
|
|
32677
|
-
void this.held
|
|
32728
|
+
void this.held.bindIds((path) => this.rootFileId(path)).then(
|
|
32729
|
+
() => Promise.all([...this.openFiles].map((open) => open.bindIds((p) => this.rootFileId(p))))
|
|
32730
|
+
).then(() => this.announceHeld());
|
|
32678
32731
|
for (const nodes of this.openFiles) nodes.shared();
|
|
32679
32732
|
}
|
|
32680
32733
|
});
|
|
@@ -32699,7 +32752,7 @@ var Launcher = class {
|
|
|
32699
32752
|
writerStack() {
|
|
32700
32753
|
const mounted = this.mounts.wrap(this.unguardedRoot);
|
|
32701
32754
|
const fs = this.commandFs(this.rooted(mounted));
|
|
32702
|
-
const nodes =
|
|
32755
|
+
const nodes = this.openNodes(fs, this.nodes.entries);
|
|
32703
32756
|
nodes.keepsOnDisk = true;
|
|
32704
32757
|
this.openFiles.add(nodes);
|
|
32705
32758
|
const unlinked = new UnlinkedKeeper(
|
|
@@ -32764,6 +32817,7 @@ var Launcher = class {
|
|
|
32764
32817
|
moved(from, to, source) {
|
|
32765
32818
|
this.renameLog.add(from, to);
|
|
32766
32819
|
for (const holds2 of this.held) holds2.renamed(from, to);
|
|
32820
|
+
if (this.mounts.locate(to) === void 0) this.rootFs.rehold?.(from, to);
|
|
32767
32821
|
if (source) return;
|
|
32768
32822
|
for (const nodes of this.openFiles) nodes.renamed(from, to);
|
|
32769
32823
|
this.watchers.moved(from, to);
|