@ai-ecoverse/slicc-kernel 1.143.1 → 1.143.3
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 +3 -3
- package/dist/kernel-worker.js +57 -8
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-process-worker.js +4 -2
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +57 -8
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +4 -2
- package/dist/process-worker.js.map +2 -2
- package/dist/types/fs/watch.d.ts +13 -0
- package/package.json +4 -4
package/dist/node.js
CHANGED
|
@@ -7982,7 +7982,7 @@ function satisfies(version, range2) {
|
|
|
7982
7982
|
}
|
|
7983
7983
|
|
|
7984
7984
|
// src/version.ts
|
|
7985
|
-
var KERNEL_VERSION = true ? "1.143.
|
|
7985
|
+
var KERNEL_VERSION = true ? "1.143.3" : "0.0.0-dev";
|
|
7986
7986
|
var OS_RELEASE = "6.0.0-slicc";
|
|
7987
7987
|
function procVersion() {
|
|
7988
7988
|
return `Linux version ${OS_RELEASE} (slicc-kernel ${KERNEL_VERSION}) #1 SMP PREEMPT_DYNAMIC
|
|
@@ -10515,7 +10515,7 @@ function route(watch, type, path) {
|
|
|
10515
10515
|
}
|
|
10516
10516
|
function routed(watch, root, type, path) {
|
|
10517
10517
|
if (path === root || type === "rename" && root !== "/" && under3(root, path)) {
|
|
10518
|
-
noted(watch, { type, filename: baseOf3(root) });
|
|
10518
|
+
noted(watch, { type, filename: watch.names.get(root) ?? baseOf3(root) });
|
|
10519
10519
|
if (type === "rename") noted(watch, { ended: true });
|
|
10520
10520
|
return true;
|
|
10521
10521
|
}
|
|
@@ -10525,6 +10525,11 @@ function routed(watch, root, type, path) {
|
|
|
10525
10525
|
} else return false;
|
|
10526
10526
|
return true;
|
|
10527
10527
|
}
|
|
10528
|
+
function remapped(root, from, to) {
|
|
10529
|
+
if (root === from) return to;
|
|
10530
|
+
if (from !== "/" && root.startsWith(`${from}/`)) return to + root.slice(from.length);
|
|
10531
|
+
return void 0;
|
|
10532
|
+
}
|
|
10528
10533
|
var FsWatchers = class {
|
|
10529
10534
|
watchers = /* @__PURE__ */ new Set();
|
|
10530
10535
|
typed = /* @__PURE__ */ new Set();
|
|
@@ -10559,6 +10564,7 @@ var FsWatchers = class {
|
|
|
10559
10564
|
const other = alias === void 0 ? main : normalizePath(alias);
|
|
10560
10565
|
const watch = {
|
|
10561
10566
|
roots: other === main ? [main] : [main, other],
|
|
10567
|
+
names: /* @__PURE__ */ new Map(),
|
|
10562
10568
|
recursive,
|
|
10563
10569
|
notes: [],
|
|
10564
10570
|
overflowed: false,
|
|
@@ -10608,6 +10614,35 @@ var FsWatchers = class {
|
|
|
10608
10614
|
for (const watch of [...this.typed]) route(watch, type, at);
|
|
10609
10615
|
}
|
|
10610
10616
|
}
|
|
10617
|
+
moved(from, to) {
|
|
10618
|
+
const source = normalizePath(from);
|
|
10619
|
+
const target = normalizePath(to);
|
|
10620
|
+
const followed2 = /* @__PURE__ */ new Set();
|
|
10621
|
+
for (const watch of this.typed) {
|
|
10622
|
+
const [main] = watch.roots;
|
|
10623
|
+
const roots = watch.roots.map((root) => remapped(root, source, target) ?? root);
|
|
10624
|
+
if (roots.every((root, i) => root === watch.roots[i])) continue;
|
|
10625
|
+
followed2.add(watch);
|
|
10626
|
+
const names2 = /* @__PURE__ */ new Map();
|
|
10627
|
+
watch.roots.forEach((root, i) => {
|
|
10628
|
+
names2.set(roots[i], watch.names.get(root) ?? baseOf3(root));
|
|
10629
|
+
});
|
|
10630
|
+
watch.names = names2;
|
|
10631
|
+
watch.roots = [...new Set(roots)];
|
|
10632
|
+
if (main === source) {
|
|
10633
|
+
noted(watch, { type: "rename", filename: names2.get(target), moved: true });
|
|
10634
|
+
}
|
|
10635
|
+
}
|
|
10636
|
+
return followed2;
|
|
10637
|
+
}
|
|
10638
|
+
renamed(from, to) {
|
|
10639
|
+
const followed2 = this.moved(from, to);
|
|
10640
|
+
if (this.typed.size === 0) return;
|
|
10641
|
+
for (const path of [from, to]) {
|
|
10642
|
+
const at = normalizePath(path);
|
|
10643
|
+
for (const watch of [...this.typed]) if (!followed2.has(watch)) route(watch, "rename", at);
|
|
10644
|
+
}
|
|
10645
|
+
}
|
|
10611
10646
|
changed(...paths) {
|
|
10612
10647
|
this.report(paths);
|
|
10613
10648
|
this.emit("change", paths);
|
|
@@ -10711,7 +10746,16 @@ var FsWatchers = class {
|
|
|
10711
10746
|
}
|
|
10712
10747
|
},
|
|
10713
10748
|
rm: reshaping(after(fs.rm.bind(fs), (path) => [path], "rename")),
|
|
10714
|
-
rename: reshaping(
|
|
10749
|
+
rename: reshaping(async (from, to) => {
|
|
10750
|
+
let done4 = false;
|
|
10751
|
+
try {
|
|
10752
|
+
await fs.rename(from, to);
|
|
10753
|
+
done4 = true;
|
|
10754
|
+
} finally {
|
|
10755
|
+
this.report([from, to]);
|
|
10756
|
+
if (done4) this.renamed(from, to);
|
|
10757
|
+
}
|
|
10758
|
+
}),
|
|
10715
10759
|
link: reshaping(
|
|
10716
10760
|
after(
|
|
10717
10761
|
(from, to, follow2) => fs.link(from, to, follow2),
|
|
@@ -17227,7 +17271,8 @@ var Resolver = class {
|
|
|
17227
17271
|
const abort = new AbortController();
|
|
17228
17272
|
lookup4 = { work: this.lookup(key, asked, id2, abort.signal), abort, waiters: 0 };
|
|
17229
17273
|
this.pending.set(id2, lookup4);
|
|
17230
|
-
|
|
17274
|
+
const done4 = () => this.pending.delete(id2);
|
|
17275
|
+
void lookup4.work.then(done4, done4);
|
|
17231
17276
|
}
|
|
17232
17277
|
return waitFor(lookup4, signal);
|
|
17233
17278
|
}
|
|
@@ -17245,7 +17290,7 @@ var Resolver = class {
|
|
|
17245
17290
|
])
|
|
17246
17291
|
);
|
|
17247
17292
|
} catch {
|
|
17248
|
-
|
|
17293
|
+
throw new KernelError("ETIMEDOUT", `resolve ${name2}: the uplink gave no answer`);
|
|
17249
17294
|
}
|
|
17250
17295
|
const addresses = answer2.addresses.filter((a) => this.usable(name2, a, family));
|
|
17251
17296
|
if (addresses.length > 0) this.remember(id2, addresses, answer2.ttl);
|
|
@@ -17278,12 +17323,16 @@ function waitFor(lookup4, signal) {
|
|
|
17278
17323
|
reject(new KernelError("EINTR"));
|
|
17279
17324
|
};
|
|
17280
17325
|
signal?.addEventListener("abort", abort, { once: true });
|
|
17281
|
-
|
|
17326
|
+
const settle = (finish) => {
|
|
17282
17327
|
if (signal?.aborted) return;
|
|
17283
17328
|
lookup4.waiters--;
|
|
17284
17329
|
signal?.removeEventListener("abort", abort);
|
|
17285
|
-
|
|
17286
|
-
}
|
|
17330
|
+
finish();
|
|
17331
|
+
};
|
|
17332
|
+
void lookup4.work.then(
|
|
17333
|
+
(value2) => settle(() => resolve2(value2)),
|
|
17334
|
+
(err) => settle(() => reject(err))
|
|
17335
|
+
);
|
|
17287
17336
|
});
|
|
17288
17337
|
}
|
|
17289
17338
|
|