pi-supernova 0.7.0 → 0.7.1
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/docs/CHANGELOG.md +10 -0
- package/package.json +1 -1
- package/src/runtime/guest-worker.js +10 -3
package/docs/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## [0.7.1] - 2026-09-17
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Guest worker links on hosts without `module.registerHooks` (Bun, Node <22.15):
|
|
10
|
+
`node:module` is now a namespace import with runtime feature detection, so the
|
|
11
|
+
`register` fallback — and hosts with neither hook mechanism — no longer fail at
|
|
12
|
+
module-eval time. Previously every program failed before its first command with
|
|
13
|
+
"Export named 'registerHooks' not found", e.g. under OMP/Bun.
|
|
14
|
+
|
|
5
15
|
## [0.7.0] - 2026-09-17
|
|
6
16
|
|
|
7
17
|
### Internals
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parentPort } from "node:worker_threads";
|
|
2
2
|
import { AsyncLocalStorage } from "node:async_hooks";
|
|
3
|
-
import
|
|
3
|
+
import * as nodeModule from "node:module";
|
|
4
4
|
import { isString, isObject, isFunction, toPlain, looksLikePath } from "../shared/decode.js";
|
|
5
5
|
import { truncateChars } from "../output/format.js";
|
|
6
6
|
import { gatherReadArgs, normalizeRead, decodeReadValue, assertReadPaths } from "../contract/read.js";
|
|
@@ -8,6 +8,8 @@ import { classifyEdit } from "../contract/edit.js";
|
|
|
8
8
|
import { normalizeBash } from "../contract/bash.js";
|
|
9
9
|
import { guestImportMessage, isDeniedGuestImport } from "./guest-deny-imports.js";
|
|
10
10
|
|
|
11
|
+
const { register, registerHooks } = nodeModule;
|
|
12
|
+
|
|
11
13
|
if (isFunction(registerHooks)) {
|
|
12
14
|
registerHooks({
|
|
13
15
|
resolve(specifier, context, nextResolve) {
|
|
@@ -20,8 +22,13 @@ if (isFunction(registerHooks)) {
|
|
|
20
22
|
return nextResolve(specifier, context);
|
|
21
23
|
},
|
|
22
24
|
});
|
|
23
|
-
} else {
|
|
24
|
-
|
|
25
|
+
} else if (isFunction(register)) {
|
|
26
|
+
try {
|
|
27
|
+
register("./guest-deny-imports.js", import.meta.url);
|
|
28
|
+
} catch {
|
|
29
|
+
// Hosts whose module.register cannot run loader hooks lose the deny list;
|
|
30
|
+
// the guest remains trusted code, not a sandbox boundary.
|
|
31
|
+
}
|
|
25
32
|
}
|
|
26
33
|
|
|
27
34
|
// Guest programs run here, off the host thread. The host can terminate() this
|