@ai-ecoverse/slicc-kernel 1.154.2 → 1.155.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 +2 -2
- package/dist/driver-worker.js +5 -2
- package/dist/driver-worker.js.map +2 -2
- package/dist/index.js +5 -2
- package/dist/index.js.map +2 -2
- package/dist/kernel-worker.js +69 -7
- package/dist/kernel-worker.js.map +3 -3
- package/dist/node-driver-worker.js +5 -2
- package/dist/node-driver-worker.js.map +2 -2
- package/dist/node-process-worker.js +9 -2
- package/dist/node-process-worker.js.map +2 -2
- package/dist/node.js +74 -9
- package/dist/node.js.map +3 -3
- package/dist/process-worker.js +9 -2
- package/dist/process-worker.js.map +2 -2
- package/dist/types/embedder-relay.d.ts +3 -0
- package/dist/types/kernel/socket-syscalls.d.ts +3 -0
- package/dist/types/kernel/socket.d.ts +6 -0
- package/dist/types/process/js/js-net.d.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -358,7 +358,8 @@ function bodyStream(id, state, post) {
|
|
|
358
358
|
const next = state.body.shift();
|
|
359
359
|
if (next) controller.enqueue(next);
|
|
360
360
|
else controller.close();
|
|
361
|
-
}
|
|
361
|
+
},
|
|
362
|
+
cancel: () => post({ id, bodyCancel: true })
|
|
362
363
|
},
|
|
363
364
|
{ highWaterMark: 0 }
|
|
364
365
|
);
|
|
@@ -379,14 +380,16 @@ function embedderAnswerer(port, hookFor) {
|
|
|
379
380
|
throw Object.assign(new Error(`this page does not answer ${ask.kind}`), {
|
|
380
381
|
name: "NotSupportedError"
|
|
381
382
|
});
|
|
383
|
+
const body = bodyStream(ask.id, state, post);
|
|
382
384
|
const reply = await hook.handle({
|
|
383
385
|
kind: ask.kind,
|
|
384
386
|
options: ask.options,
|
|
385
|
-
body
|
|
387
|
+
body,
|
|
386
388
|
stamp: ask.stamp,
|
|
387
389
|
signal: state.abort.signal,
|
|
388
390
|
progress: (line) => post({ id: ask.id, progress: String(line) })
|
|
389
391
|
});
|
|
392
|
+
if (!(reply instanceof ReadableStream)) post({ id: ask.id, bodyCancel: true });
|
|
390
393
|
state.reader = bytesOf(reply).getReader();
|
|
391
394
|
post({ id: ask.id, ready: true });
|
|
392
395
|
} catch (err) {
|