@ai-ecoverse/slicc-kernel 1.167.1 → 1.167.2
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 +61 -3
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.cjs +34 -12
- package/dist/node-process-worker.cjs.map +3 -3
- package/dist/node-process-worker.js +34 -12
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +61 -3
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +34 -12
- package/dist/process-worker.js.map +3 -3
- package/dist/types/fs/ranged.d.ts +1 -0
- package/dist/types/kernel/vfs-file.d.ts +6 -0
- package/dist/types/launcher.d.ts +1 -0
- package/dist/types/process/wasi/wasi-files.d.ts +3 -0
- package/dist/types/realm/sync-fs-wire.d.ts +1 -0
- package/package.json +3 -3
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.167.
|
|
3687
|
+
var KERNEL_VERSION = true ? "1.167.2" : "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
|
|
@@ -11064,7 +11064,7 @@ async function heldOpen(entry, path, real, req, fid) {
|
|
|
11064
11064
|
const handle = entry.hold?.(path, true, true, real, void 0, req.ino, fid);
|
|
11065
11065
|
if (handle === void 0) return null;
|
|
11066
11066
|
await entry.announceHold?.(real ?? path, fid, ((req.mode ?? 0) & HOLD_CREATED) !== 0);
|
|
11067
|
-
return handle;
|
|
11067
|
+
return real !== void 0 && real !== path ? { handle, real } : handle;
|
|
11068
11068
|
}
|
|
11069
11069
|
async function idOf(entry, path) {
|
|
11070
11070
|
return await entry.fileId?.(path)?.catch(() => void 0) ?? void 0;
|
|
@@ -12025,6 +12025,10 @@ var AsyncRangedFile = class {
|
|
|
12025
12025
|
truncate(size) {
|
|
12026
12026
|
this.pages.truncate(size);
|
|
12027
12027
|
}
|
|
12028
|
+
wrote(at, length2) {
|
|
12029
|
+
this.pages.landed(at, length2);
|
|
12030
|
+
this.version = void 0;
|
|
12031
|
+
}
|
|
12028
12032
|
async flush() {
|
|
12029
12033
|
if (this.pinned || !this.pages.changed) return;
|
|
12030
12034
|
const plan = this.pages.plan();
|
|
@@ -20150,6 +20154,7 @@ var VfsNode = class {
|
|
|
20150
20154
|
ino;
|
|
20151
20155
|
onDirty;
|
|
20152
20156
|
onDirtyState;
|
|
20157
|
+
crowded;
|
|
20153
20158
|
counted = false;
|
|
20154
20159
|
recount() {
|
|
20155
20160
|
if (!this.onDirtyState) return;
|
|
@@ -20267,9 +20272,48 @@ var VfsNode = class {
|
|
|
20267
20272
|
if (!this.dirty) this.data = void 0;
|
|
20268
20273
|
}
|
|
20269
20274
|
async size() {
|
|
20275
|
+
if (this.peerHeld()) {
|
|
20276
|
+
const known = await this.exact();
|
|
20277
|
+
if (known !== void 0) return known;
|
|
20278
|
+
}
|
|
20270
20279
|
const ranged2 = await this.prepare();
|
|
20271
20280
|
return ranged2 ? ranged2.size() : this.length;
|
|
20272
20281
|
}
|
|
20282
|
+
peered = false;
|
|
20283
|
+
peerHeld() {
|
|
20284
|
+
if (this.orphaned || this.revoked || this.pin) return false;
|
|
20285
|
+
if (this.crowded?.(this.path) === true) this.peered = true;
|
|
20286
|
+
return this.peered;
|
|
20287
|
+
}
|
|
20288
|
+
async exact() {
|
|
20289
|
+
await this.flush();
|
|
20290
|
+
const { stat } = this.fs;
|
|
20291
|
+
const io = rangedOps(this.fs);
|
|
20292
|
+
if (!stat || !io) return void 0;
|
|
20293
|
+
const st = await this.followed(() => stat.call(this.fs, this.path));
|
|
20294
|
+
this.peered = this.crowded?.(this.path) === true;
|
|
20295
|
+
const size = st.size ?? 0;
|
|
20296
|
+
if (this.ranged) {
|
|
20297
|
+
if (size !== this.ranged.size()) {
|
|
20298
|
+
this.ranged = new AsyncRangedFile(io, this.path, size, st.version);
|
|
20299
|
+
}
|
|
20300
|
+
return void 0;
|
|
20301
|
+
}
|
|
20302
|
+
if (this.data && size !== this.length) this.data = void 0;
|
|
20303
|
+
return this.data ? void 0 : size;
|
|
20304
|
+
}
|
|
20305
|
+
landed(at, bytes) {
|
|
20306
|
+
if (this.ranged) {
|
|
20307
|
+
this.ranged.wrote(at, bytes.length);
|
|
20308
|
+
return;
|
|
20309
|
+
}
|
|
20310
|
+
if (!this.data) return;
|
|
20311
|
+
const end = at + bytes.length;
|
|
20312
|
+
const buf = this.ensure(end);
|
|
20313
|
+
if (at > this.length) buf.fill(0, this.length, at);
|
|
20314
|
+
buf.set(bytes, at);
|
|
20315
|
+
this.length = Math.max(this.length, end);
|
|
20316
|
+
}
|
|
20273
20317
|
async pread(max, at) {
|
|
20274
20318
|
const ranged2 = await this.prepare();
|
|
20275
20319
|
if (ranged2) return this.followed(() => ranged2.read(at, max));
|
|
@@ -20341,6 +20385,13 @@ var VfsNode = class {
|
|
|
20341
20385
|
if (bytes.length === 0) return 0;
|
|
20342
20386
|
await this.settled();
|
|
20343
20387
|
await this.fits(at + bytes.length);
|
|
20388
|
+
const io = this.peerHeld() ? rangedOps(this.fs) : void 0;
|
|
20389
|
+
if (io && at + bytes.length > await this.size()) {
|
|
20390
|
+
const copy = bytes.slice();
|
|
20391
|
+
await this.followed(() => io.pwrite(this.path, at, copy, true));
|
|
20392
|
+
this.landed(at, bytes);
|
|
20393
|
+
return bytes.length;
|
|
20394
|
+
}
|
|
20344
20395
|
const ranged2 = await this.prepare();
|
|
20345
20396
|
if (ranged2) {
|
|
20346
20397
|
await this.followed(() => ranged2.write(at, bytes));
|
|
@@ -20437,6 +20488,7 @@ var VfsNodes = class {
|
|
|
20437
20488
|
movedAway;
|
|
20438
20489
|
opened;
|
|
20439
20490
|
dirtied;
|
|
20491
|
+
crowded;
|
|
20440
20492
|
fs;
|
|
20441
20493
|
entries;
|
|
20442
20494
|
onClosed;
|
|
@@ -20582,6 +20634,7 @@ var VfsNodes = class {
|
|
|
20582
20634
|
this.reshaped();
|
|
20583
20635
|
node.onDirty = () => this.changed?.(node.path);
|
|
20584
20636
|
node.onDirtyState = (on) => this.dirtied?.(on ? 1 : -1);
|
|
20637
|
+
node.crowded = (at) => this.crowded?.(at) === true;
|
|
20585
20638
|
node.recount();
|
|
20586
20639
|
this.byPath.set(path, node);
|
|
20587
20640
|
if (id2 !== void 0) this.know(node, id2);
|
|
@@ -30595,6 +30648,7 @@ var Launcher = class {
|
|
|
30595
30648
|
hostname;
|
|
30596
30649
|
watchers = new FsWatchers();
|
|
30597
30650
|
changes = new FileChanges();
|
|
30651
|
+
peerHeldPaths = /* @__PURE__ */ new Set();
|
|
30598
30652
|
renameLog = new RenameLog(this.changes);
|
|
30599
30653
|
cwds = new CwdTable(async (path) => {
|
|
30600
30654
|
const { dev, ino } = await this.base.stat(path);
|
|
@@ -32867,6 +32921,7 @@ var Launcher = class {
|
|
|
32867
32921
|
openNodes(fs, entries) {
|
|
32868
32922
|
const nodes = new VfsNodes(fs, (path) => this.released(path), entries);
|
|
32869
32923
|
nodes.opened = (node) => this.nodeOpened(node);
|
|
32924
|
+
nodes.crowded = (path) => this.peerHeldPaths.has(path);
|
|
32870
32925
|
return nodes;
|
|
32871
32926
|
}
|
|
32872
32927
|
nodeOpened(node) {
|
|
@@ -32888,7 +32943,10 @@ var Launcher = class {
|
|
|
32888
32943
|
return this.mounts.locate(path) === void 0 ? this.rootFs.bindId?.(path) : void 0;
|
|
32889
32944
|
}
|
|
32890
32945
|
flushingPeers(fs) {
|
|
32891
|
-
fs.peerHolds?.((paths) =>
|
|
32946
|
+
fs.peerHolds?.((paths) => {
|
|
32947
|
+
this.peerHeldPaths = new Set(paths);
|
|
32948
|
+
this.changes.peerHeld(paths);
|
|
32949
|
+
});
|
|
32892
32950
|
const peers = fs.peers?.();
|
|
32893
32951
|
if (!peers) return void 0;
|
|
32894
32952
|
peers.watch((crowded) => {
|