@ai-ecoverse/slicc-kernel 1.53.0 → 1.53.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 +2 -2
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +9 -5
- package/dist/kernel-worker.js.map +2 -2
- package/dist/node-process-worker.js +19 -3
- package/dist/node-process-worker.js.map +3 -3
- package/dist/node.js +9 -5
- package/dist/node.js.map +2 -2
- package/dist/process-worker.js +9 -3
- package/dist/process-worker.js.map +2 -2
- package/package.json +2 -1
package/dist/kernel-worker.js
CHANGED
|
@@ -11604,7 +11604,13 @@ function keepWatching(loop, signal) {
|
|
|
11604
11604
|
function invalidation(event) {
|
|
11605
11605
|
return event.paths ?? true;
|
|
11606
11606
|
}
|
|
11607
|
-
|
|
11607
|
+
function grantConnect(hook, fetch2) {
|
|
11608
|
+
return async (source, options) => {
|
|
11609
|
+
const grant = () => hook(source, options);
|
|
11610
|
+
return new HostfsClient(await grant(), grant, fetch2);
|
|
11611
|
+
};
|
|
11612
|
+
}
|
|
11613
|
+
async function openHostfs(spec, connect, timing = {}) {
|
|
11608
11614
|
const readonly2 = spec.options?.ro !== void 0;
|
|
11609
11615
|
const { port1, port2 } = new MessageChannel();
|
|
11610
11616
|
const slot = mediumSlot(
|
|
@@ -11612,7 +11618,6 @@ async function openHostfs(spec, hook, fetch2, timing = {}) {
|
|
|
11612
11618
|
() => watching.kick()
|
|
11613
11619
|
);
|
|
11614
11620
|
const stop = new AbortController();
|
|
11615
|
-
const grant = () => hook(spec.source, { readonly: readonly2 });
|
|
11616
11621
|
let active;
|
|
11617
11622
|
const handlers = hostfsHandlers(() => active);
|
|
11618
11623
|
const ranged2 = () => active?.capabilities.ranges === true ? { ranges: true } : {};
|
|
@@ -11629,7 +11634,7 @@ async function openHostfs(spec, hook, fetch2, timing = {}) {
|
|
|
11629
11634
|
);
|
|
11630
11635
|
const watching = keepWatching(
|
|
11631
11636
|
{
|
|
11632
|
-
connect:
|
|
11637
|
+
connect: () => connect(spec.source, { readonly: readonly2 }),
|
|
11633
11638
|
up(client) {
|
|
11634
11639
|
active = client;
|
|
11635
11640
|
slot.insert(client, handlers);
|
|
@@ -12648,8 +12653,7 @@ var Launcher = class {
|
|
|
12648
12653
|
throw fsError("ENODEV", "this kernel has no hostfs hook (createKernel({ hostfs }))");
|
|
12649
12654
|
return openHostfs(
|
|
12650
12655
|
spec,
|
|
12651
|
-
hostfs,
|
|
12652
|
-
hostfsFetch ?? ((url, init) => fetch(url, init)),
|
|
12656
|
+
grantConnect(hostfs, hostfsFetch ?? ((url, init) => fetch(url, init))),
|
|
12653
12657
|
hostfsTiming
|
|
12654
12658
|
);
|
|
12655
12659
|
}
|