@nodetool-ai/sandbox-compiler 0.8.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/README.md +80 -0
- package/dist/.nodetool-build-stamp +1 -0
- package/dist/bundle.d.ts +70 -0
- package/dist/bundle.d.ts.map +1 -0
- package/dist/bundle.js +252 -0
- package/dist/bundle.js.map +1 -0
- package/dist/cache.d.ts +115 -0
- package/dist/cache.d.ts.map +1 -0
- package/dist/cache.js +290 -0
- package/dist/cache.js.map +1 -0
- package/dist/catalog.d.ts +41 -0
- package/dist/catalog.d.ts.map +1 -0
- package/dist/catalog.js +0 -0
- package/dist/catalog.js.map +1 -0
- package/dist/compile.d.ts +29 -0
- package/dist/compile.d.ts.map +1 -0
- package/dist/compile.js +128 -0
- package/dist/compile.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +22 -0
- package/dist/index.js.map +1 -0
- package/dist/options.d.ts +62 -0
- package/dist/options.d.ts.map +1 -0
- package/dist/options.js +62 -0
- package/dist/options.js.map +1 -0
- package/dist/probe.d.ts +23 -0
- package/dist/probe.d.ts.map +1 -0
- package/dist/probe.js +118 -0
- package/dist/probe.js.map +1 -0
- package/dist/scan.d.ts +34 -0
- package/dist/scan.d.ts.map +1 -0
- package/dist/scan.js +378 -0
- package/dist/scan.js.map +1 -0
- package/package.json +84 -0
package/dist/options.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The compiler's pinned build options.
|
|
3
|
+
*
|
|
4
|
+
* Every constant here is part of the cache key and of an npm module's content
|
|
5
|
+
* digest, so changing one invalidates every cached artifact — which is the
|
|
6
|
+
* point: a different resolver condition can select a different file of the same
|
|
7
|
+
* package version, and the old bundle must not survive the change.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Export conditions, in priority order.
|
|
11
|
+
*
|
|
12
|
+
* `platform: "neutral"` alone leaves the condition set empty, so a package with
|
|
13
|
+
* `exports` maps resolves through `default` only — or fails. These are pinned
|
|
14
|
+
* instead: the guest is neither Node nor a browser, so `node` and `browser` are
|
|
15
|
+
* deliberately absent and a package's most portable build wins.
|
|
16
|
+
*/
|
|
17
|
+
export const NPM_BUNDLE_CONDITIONS = ["import", "module", "default"];
|
|
18
|
+
/** `package.json` fields consulted for packages that predate `exports`. */
|
|
19
|
+
export const NPM_BUNDLE_MAIN_FIELDS = ["module", "main"];
|
|
20
|
+
/** Syntax level the bundle is lowered to. QuickJS-ng covers ES2022. */
|
|
21
|
+
export const NPM_BUNDLE_TARGET = "es2022";
|
|
22
|
+
/**
|
|
23
|
+
* Maximum bundled source, in bytes.
|
|
24
|
+
*
|
|
25
|
+
* Measured against the real bridge candidates in
|
|
26
|
+
* `docs/m3-implementation-plan.md`; the number is evidence, not a guess. It
|
|
27
|
+
* matches `SANDBOX_PACKAGE_LIMITS.npmBundledJsBytes` in node-sdk, which
|
|
28
|
+
* re-checks the artifact discovery actually loads.
|
|
29
|
+
*/
|
|
30
|
+
export const NPM_BUNDLE_MAX_BYTES = 1024 * 1024;
|
|
31
|
+
/** Wall clock the admission probe gets to import the bundle. */
|
|
32
|
+
export const NPM_PROBE_TIMEOUT_MS = 5_000;
|
|
33
|
+
/** Guest heap the admission probe gets. */
|
|
34
|
+
export const NPM_PROBE_MEMORY_BYTES = 64 * 1024 * 1024;
|
|
35
|
+
/** Guest stack the admission probe gets. */
|
|
36
|
+
export const NPM_PROBE_STACK_BYTES = 1024 * 1024;
|
|
37
|
+
/** Console lines the probe keeps; a chatty module cannot flood the host. */
|
|
38
|
+
export const NPM_PROBE_MAX_LOG_LINES = 20;
|
|
39
|
+
/** Characters kept per captured probe log line. */
|
|
40
|
+
export const NPM_PROBE_MAX_LOG_CHARS = 500;
|
|
41
|
+
/**
|
|
42
|
+
* The compiler's own contract version.
|
|
43
|
+
*
|
|
44
|
+
* Bump it whenever the bundle shim, the scan rules, or the probe change what
|
|
45
|
+
* "admitted" means. It is part of the cache key, so a bump re-compiles and
|
|
46
|
+
* re-probes everything rather than trusting a verdict an older compiler made.
|
|
47
|
+
*/
|
|
48
|
+
export const SANDBOX_COMPILER_VERSION = "2";
|
|
49
|
+
/** The one option set the compiler builds with. */
|
|
50
|
+
export function normalizedCompileOptions() {
|
|
51
|
+
return {
|
|
52
|
+
conditions: [...NPM_BUNDLE_CONDITIONS],
|
|
53
|
+
mainFields: [...NPM_BUNDLE_MAIN_FIELDS],
|
|
54
|
+
target: NPM_BUNDLE_TARGET,
|
|
55
|
+
format: "esm",
|
|
56
|
+
platform: "neutral",
|
|
57
|
+
bundle: true,
|
|
58
|
+
minify: false,
|
|
59
|
+
maxBytes: NPM_BUNDLE_MAX_BYTES
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../src/options.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAsB,CAAC,QAAQ,EAAE,QAAQ,EAAE,SAAS,CAAC,CAAC;AAExF,2EAA2E;AAC3E,MAAM,CAAC,MAAM,sBAAsB,GAAsB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;AAE5E,uEAAuE;AACvE,MAAM,CAAC,MAAM,iBAAiB,GAAG,QAAQ,CAAC;AAE1C;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,GAAG,IAAI,CAAC;AAEhD,gEAAgE;AAChE,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAE1C,2CAA2C;AAC3C,MAAM,CAAC,MAAM,sBAAsB,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AAEvD,4CAA4C;AAC5C,MAAM,CAAC,MAAM,qBAAqB,GAAG,IAAI,GAAG,IAAI,CAAC;AAEjD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,uBAAuB,GAAG,EAAE,CAAC;AAE1C,mDAAmD;AACnD,MAAM,CAAC,MAAM,uBAAuB,GAAG,GAAG,CAAC;AAE3C;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,wBAAwB,GAAG,GAAG,CAAC;AAc5C,mDAAmD;AACnD,MAAM,UAAU,wBAAwB;IACtC,OAAO;QACL,UAAU,EAAE,CAAC,GAAG,qBAAqB,CAAC;QACtC,UAAU,EAAE,CAAC,GAAG,sBAAsB,CAAC;QACvC,MAAM,EAAE,iBAAiB;QACzB,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,SAAS;QACnB,MAAM,EAAE,IAAI;QACZ,MAAM,EAAE,KAAK;QACb,QAAQ,EAAE,oBAAoB;KAC/B,CAAC;AACJ,CAAC"}
|
package/dist/probe.d.ts
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-free QuickJS admission probe.
|
|
3
|
+
*
|
|
4
|
+
* Bundling proves resolution, not compatibility, so admission ends by importing
|
|
5
|
+
* the bundle in the engine that will run it. Importing executes top-level code,
|
|
6
|
+
* which is why the probe context has nothing in it: no `fetch`, no filesystem,
|
|
7
|
+
* no workspace or secret bridges, no tools, no env. Discovery must never hand a
|
|
8
|
+
* package capabilities before a workflow imports it.
|
|
9
|
+
*
|
|
10
|
+
* What the probe proves is exactly one thing: the module initializes and its
|
|
11
|
+
* exports object materializes. It cannot prove that every export works —
|
|
12
|
+
* runtime loading stays authoritative after admission.
|
|
13
|
+
*/
|
|
14
|
+
export interface ProbeVerdict {
|
|
15
|
+
readonly ok: boolean;
|
|
16
|
+
/** Export names the module produced, sorted. Empty when the probe failed. */
|
|
17
|
+
readonly exports: readonly string[];
|
|
18
|
+
readonly error?: string;
|
|
19
|
+
readonly logs: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/** Import `source` in a bare QuickJS context and report whether it initialized. */
|
|
22
|
+
export declare function probeBundle(source: string): Promise<ProbeVerdict>;
|
|
23
|
+
//# sourceMappingURL=probe.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.d.ts","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAkCH,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,OAAO,CAAC;IACrB,6EAA6E;IAC7E,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CAClC;AASD,mFAAmF;AACnF,wBAAsB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,CAAC,CAoFvE"}
|
package/dist/probe.js
ADDED
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Capability-free QuickJS admission probe.
|
|
3
|
+
*
|
|
4
|
+
* Bundling proves resolution, not compatibility, so admission ends by importing
|
|
5
|
+
* the bundle in the engine that will run it. Importing executes top-level code,
|
|
6
|
+
* which is why the probe context has nothing in it: no `fetch`, no filesystem,
|
|
7
|
+
* no workspace or secret bridges, no tools, no env. Discovery must never hand a
|
|
8
|
+
* package capabilities before a workflow imports it.
|
|
9
|
+
*
|
|
10
|
+
* What the probe proves is exactly one thing: the module initializes and its
|
|
11
|
+
* exports object materializes. It cannot prove that every export works —
|
|
12
|
+
* runtime loading stays authoritative after admission.
|
|
13
|
+
*/
|
|
14
|
+
import { getModuleLoader as createDefaultModuleLoader, loadQuickJs, modulePathNormalizer as defaultModulePathNormalizer } from "@sebastianwessel/quickjs";
|
|
15
|
+
import * as quickJsVariantModule from "@jitl/quickjs-ng-wasmfile-release-sync";
|
|
16
|
+
/**
|
|
17
|
+
* The variant package is CJS with a `default` export, so `ns.default` is the
|
|
18
|
+
* variant at runtime.
|
|
19
|
+
*/
|
|
20
|
+
// SAFETY: TypeScript's CJS interop synthesizes `default` as the whole module
|
|
21
|
+
// object, contradicting the package's own `.d.ts`, which declares it as the
|
|
22
|
+
// `QuickJSSyncVariant` this reads.
|
|
23
|
+
const quickJsVariant = quickJsVariantModule.default;
|
|
24
|
+
import { NPM_PROBE_MAX_LOG_CHARS, NPM_PROBE_MAX_LOG_LINES, NPM_PROBE_MEMORY_BYTES, NPM_PROBE_STACK_BYTES, NPM_PROBE_TIMEOUT_MS } from "./options.js";
|
|
25
|
+
/** The id the probe serves the bundle under. */
|
|
26
|
+
const PROBE_MODULE_ID = "nodetool-probe-module";
|
|
27
|
+
const DENIED_MODULE_ID = "nodetool-probe-denied";
|
|
28
|
+
let enginePromise = null;
|
|
29
|
+
function getEngine() {
|
|
30
|
+
enginePromise ??= loadQuickJs(quickJsVariant);
|
|
31
|
+
return enginePromise;
|
|
32
|
+
}
|
|
33
|
+
/** Import `source` in a bare QuickJS context and report whether it initialized. */
|
|
34
|
+
export async function probeBundle(source) {
|
|
35
|
+
const logs = [];
|
|
36
|
+
const record = (message) => {
|
|
37
|
+
if (logs.length >= NPM_PROBE_MAX_LOG_LINES)
|
|
38
|
+
return;
|
|
39
|
+
logs.push(String(message).slice(0, NPM_PROBE_MAX_LOG_CHARS));
|
|
40
|
+
};
|
|
41
|
+
const console = {
|
|
42
|
+
log: record,
|
|
43
|
+
error: record,
|
|
44
|
+
warn: record,
|
|
45
|
+
info: record,
|
|
46
|
+
debug: record,
|
|
47
|
+
trace: record
|
|
48
|
+
};
|
|
49
|
+
let phase = "bootstrap";
|
|
50
|
+
let denial = "";
|
|
51
|
+
try {
|
|
52
|
+
const { runSandboxed } = await getEngine();
|
|
53
|
+
return await runSandboxed(async ({ ctx, evalCode }) => {
|
|
54
|
+
phase = "guest";
|
|
55
|
+
const deadline = Date.now() + NPM_PROBE_TIMEOUT_MS;
|
|
56
|
+
ctx.runtime.setInterruptHandler(() => Date.now() > deadline);
|
|
57
|
+
const result = await evalCode(`import * as probed from ${JSON.stringify(PROBE_MODULE_ID)};\n` +
|
|
58
|
+
"export default Object.keys(probed).sort();\n");
|
|
59
|
+
if (result.ok) {
|
|
60
|
+
const names = Array.isArray(result.data) ? result.data.map((name) => String(name)) : [];
|
|
61
|
+
return { ok: true, exports: names, logs };
|
|
62
|
+
}
|
|
63
|
+
const failure = result.error;
|
|
64
|
+
return {
|
|
65
|
+
ok: false,
|
|
66
|
+
exports: [],
|
|
67
|
+
error: `${failure.name}: ${failure.message}`,
|
|
68
|
+
logs
|
|
69
|
+
};
|
|
70
|
+
}, {
|
|
71
|
+
allowFetch: false,
|
|
72
|
+
allowFs: false,
|
|
73
|
+
enableTestUtils: false,
|
|
74
|
+
env: {},
|
|
75
|
+
// Milliseconds, despite the library typing it as seconds: it feeds the
|
|
76
|
+
// value straight into `Date.now() + executionTimeout`.
|
|
77
|
+
executionTimeout: NPM_PROBE_TIMEOUT_MS,
|
|
78
|
+
memoryLimit: NPM_PROBE_MEMORY_BYTES,
|
|
79
|
+
maxStackSize: NPM_PROBE_STACK_BYTES,
|
|
80
|
+
maxTimeoutCount: 0,
|
|
81
|
+
maxIntervalCount: 0,
|
|
82
|
+
console,
|
|
83
|
+
// The wrapper warms its own Node-compat modules before our function is
|
|
84
|
+
// called, so only *guest*-phase resolution is restricted. After that the
|
|
85
|
+
// bundle is the one and only module that resolves.
|
|
86
|
+
modulePathNormalizer: (baseName, requestedName, context) => {
|
|
87
|
+
if (phase === "bootstrap") {
|
|
88
|
+
return defaultModulePathNormalizer(baseName, requestedName, context);
|
|
89
|
+
}
|
|
90
|
+
if (requestedName === PROBE_MODULE_ID)
|
|
91
|
+
return PROBE_MODULE_ID;
|
|
92
|
+
denial = `probe module requested "${requestedName}", which admission does not serve`;
|
|
93
|
+
return DENIED_MODULE_ID;
|
|
94
|
+
},
|
|
95
|
+
getModuleLoader: (fs, runtimeOptions) => {
|
|
96
|
+
const fallback = createDefaultModuleLoader(fs, runtimeOptions);
|
|
97
|
+
return (moduleName, context) => {
|
|
98
|
+
if (moduleName === DENIED_MODULE_ID)
|
|
99
|
+
return { error: new Error(denial) };
|
|
100
|
+
if (moduleName === PROBE_MODULE_ID)
|
|
101
|
+
return { value: source };
|
|
102
|
+
if (phase === "bootstrap")
|
|
103
|
+
return fallback(moduleName, context);
|
|
104
|
+
return { error: new Error(`Module "${moduleName}" is not available`) };
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
return {
|
|
111
|
+
ok: false,
|
|
112
|
+
exports: [],
|
|
113
|
+
error: error instanceof Error ? error.message : String(error),
|
|
114
|
+
logs
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
//# sourceMappingURL=probe.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"probe.js","sourceRoot":"","sources":["../src/probe.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EACL,eAAe,IAAI,yBAAyB,EAC5C,WAAW,EACX,oBAAoB,IAAI,2BAA2B,EACpD,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,oBAAoB,MAAM,wCAAwC,CAAC;AAC/E;;;GAGG;AACH,6EAA6E;AAC7E,4EAA4E;AAC5E,mCAAmC;AACnC,MAAM,cAAc,GAClB,oBAGD,CAAC,OAAO,CAAC;AAEV,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,sBAAsB,EACtB,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,cAAc,CAAC;AAGtB,gDAAgD;AAChD,MAAM,eAAe,GAAG,uBAAuB,CAAC;AAChD,MAAM,gBAAgB,GAAG,uBAAuB,CAAC;AAUjD,IAAI,aAAa,GAA0C,IAAI,CAAC;AAEhE,SAAS,SAAS;IAChB,aAAa,KAAK,WAAW,CAAC,cAAc,CAAC,CAAC;IAC9C,OAAO,aAAa,CAAC;AACvB,CA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C,UAAU,EAAE,OAAO,EAAE,EAAE;oBAC7B,IAAI,UAAU,KAAK,gBAAgB;wBAAE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC;oBACzE,IAAI,UAAU,KAAK,eAAe;wBAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;oBAC7D,IAAI,KAAK,KAAK,WAAW;wBAAE,OAAO,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;oBAChE,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK,CAAC,WAAW,UAAU,oBAAoB,CAAC,EAAE,CAAC;gBACzE,CAAC,CAAC;YACJ,CAAC;SACF,CACF,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO;YACL,EAAE,EAAE,KAAK;YACT,OAAO,EAAE,EAAE;YACX,KAAK,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;YAC7D,IAAI;SACL,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/dist/scan.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope-aware forbidden-global scan.
|
|
3
|
+
*
|
|
4
|
+
* A regex over the bundle would flag `const process = …` and miss
|
|
5
|
+
* `globalThis["pro" + "cess"]` alike. This walks the acorn AST instead: it
|
|
6
|
+
* builds the real scope chain, resolves every identifier reference against it,
|
|
7
|
+
* and reports only *free* references — the ones that would reach the guest's
|
|
8
|
+
* global object and find nothing there.
|
|
9
|
+
*
|
|
10
|
+
* Two verdicts. A hard reference is an error: the module would throw the moment
|
|
11
|
+
* that line runs. A feature-detected reference — the argument of a `typeof`, or
|
|
12
|
+
* a reference guarded by one on the same name — is a warning, because the module
|
|
13
|
+
* has a fallback path. The warning is a heads-up and nothing more: only the
|
|
14
|
+
* QuickJS probe establishes that initialization works.
|
|
15
|
+
*/
|
|
16
|
+
/** Globals the guest does not have. A free reference to one cannot work. */
|
|
17
|
+
export declare const FORBIDDEN_GLOBALS: ReadonlySet<string>;
|
|
18
|
+
/** One free reference to a forbidden global. */
|
|
19
|
+
export interface ScanFinding {
|
|
20
|
+
readonly name: string;
|
|
21
|
+
readonly line: number;
|
|
22
|
+
readonly column: number;
|
|
23
|
+
/** `hard` fails admission; `feature-detected` warns. */
|
|
24
|
+
readonly kind: "hard" | "feature-detected";
|
|
25
|
+
}
|
|
26
|
+
export interface ScanReport {
|
|
27
|
+
readonly errors: readonly ScanFinding[];
|
|
28
|
+
readonly warnings: readonly ScanFinding[];
|
|
29
|
+
/** A syntax-level rejection: unparseable source, or a dynamic import. */
|
|
30
|
+
readonly rejection?: string;
|
|
31
|
+
}
|
|
32
|
+
/** Scan one bundled ESM module for free references to forbidden globals. */
|
|
33
|
+
export declare function scanBundle(source: string): ScanReport;
|
|
34
|
+
//# sourceMappingURL=scan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scan.d.ts","sourceRoot":"","sources":["../src/scan.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAIH,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,EAAE,WAAW,CAAC,MAAM,CAkChD,CAAC;AAEH,gDAAgD;AAChD,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,wDAAwD;IACxD,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,kBAAkB,CAAC;CAC5C;AAED,MAAM,WAAW,UAAU;IACzB,QAAQ,CAAC,MAAM,EAAE,SAAS,WAAW,EAAE,CAAC;IACxC,QAAQ,CAAC,QAAQ,EAAE,SAAS,WAAW,EAAE,CAAC;IAC1C,yEAAyE;IACzE,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAUD,4EAA4E;AAC5E,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,UAAU,CA0BrD"}
|
package/dist/scan.js
ADDED
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Scope-aware forbidden-global scan.
|
|
3
|
+
*
|
|
4
|
+
* A regex over the bundle would flag `const process = …` and miss
|
|
5
|
+
* `globalThis["pro" + "cess"]` alike. This walks the acorn AST instead: it
|
|
6
|
+
* builds the real scope chain, resolves every identifier reference against it,
|
|
7
|
+
* and reports only *free* references — the ones that would reach the guest's
|
|
8
|
+
* global object and find nothing there.
|
|
9
|
+
*
|
|
10
|
+
* Two verdicts. A hard reference is an error: the module would throw the moment
|
|
11
|
+
* that line runs. A feature-detected reference — the argument of a `typeof`, or
|
|
12
|
+
* a reference guarded by one on the same name — is a warning, because the module
|
|
13
|
+
* has a fallback path. The warning is a heads-up and nothing more: only the
|
|
14
|
+
* QuickJS probe establishes that initialization works.
|
|
15
|
+
*/
|
|
16
|
+
import { parse } from "acorn";
|
|
17
|
+
/** Globals the guest does not have. A free reference to one cannot work. */
|
|
18
|
+
export const FORBIDDEN_GLOBALS = new Set([
|
|
19
|
+
"process",
|
|
20
|
+
"Buffer",
|
|
21
|
+
"require",
|
|
22
|
+
"module",
|
|
23
|
+
"exports",
|
|
24
|
+
"__dirname",
|
|
25
|
+
"__filename",
|
|
26
|
+
"eval",
|
|
27
|
+
"Function",
|
|
28
|
+
"setTimeout",
|
|
29
|
+
"setInterval",
|
|
30
|
+
"setImmediate",
|
|
31
|
+
"clearTimeout",
|
|
32
|
+
"clearInterval",
|
|
33
|
+
"clearImmediate",
|
|
34
|
+
"queueMicrotask",
|
|
35
|
+
"WebAssembly",
|
|
36
|
+
"window",
|
|
37
|
+
"document",
|
|
38
|
+
"navigator",
|
|
39
|
+
"location",
|
|
40
|
+
"self",
|
|
41
|
+
"top",
|
|
42
|
+
"parent",
|
|
43
|
+
"frames",
|
|
44
|
+
"alert",
|
|
45
|
+
"XMLHttpRequest",
|
|
46
|
+
"HTMLElement",
|
|
47
|
+
"customElements",
|
|
48
|
+
"localStorage",
|
|
49
|
+
"sessionStorage",
|
|
50
|
+
"indexedDB",
|
|
51
|
+
"importScripts"
|
|
52
|
+
]);
|
|
53
|
+
/** Scan one bundled ESM module for free references to forbidden globals. */
|
|
54
|
+
export function scanBundle(source) {
|
|
55
|
+
let program;
|
|
56
|
+
try {
|
|
57
|
+
program = parse(source, { ecmaVersion: "latest", sourceType: "module", locations: true });
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
return {
|
|
61
|
+
errors: [],
|
|
62
|
+
warnings: [],
|
|
63
|
+
rejection: `bundle is not valid JavaScript: ${error instanceof Error ? error.message : String(error)}`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
const dynamicImport = findDynamicImport(program);
|
|
67
|
+
if (dynamicImport !== undefined) {
|
|
68
|
+
return { errors: [], warnings: [], rejection: dynamicImport };
|
|
69
|
+
}
|
|
70
|
+
const findings = [];
|
|
71
|
+
const moduleScope = { parent: undefined, kind: "module", names: new Set() };
|
|
72
|
+
collectHoisted(program, moduleScope);
|
|
73
|
+
for (const statement of bodyOf(program))
|
|
74
|
+
collectVarsDeep(statement, moduleScope);
|
|
75
|
+
walk(program, moduleScope, [], findings);
|
|
76
|
+
const errors = findings.filter((finding) => finding.kind === "hard");
|
|
77
|
+
const warnings = findings.filter((finding) => finding.kind === "feature-detected");
|
|
78
|
+
return { errors, warnings };
|
|
79
|
+
}
|
|
80
|
+
function findDynamicImport(root) {
|
|
81
|
+
let found;
|
|
82
|
+
forEachNode(root, (node) => {
|
|
83
|
+
if (found !== undefined)
|
|
84
|
+
return;
|
|
85
|
+
if (node.type === "ImportExpression") {
|
|
86
|
+
found = "bundle uses dynamic import(), which the guest loader denies";
|
|
87
|
+
}
|
|
88
|
+
if (node.type === "ImportDeclaration" || node.type === "ExportAllDeclaration") {
|
|
89
|
+
const source = node["source"];
|
|
90
|
+
if (typeof source?.value === "string") {
|
|
91
|
+
found = `bundle still imports ${source.value}, so it is not self-contained`;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
});
|
|
95
|
+
return found;
|
|
96
|
+
}
|
|
97
|
+
// ---------------------------------------------------------------------------
|
|
98
|
+
// Scope construction
|
|
99
|
+
// ---------------------------------------------------------------------------
|
|
100
|
+
function declare(scope, node) {
|
|
101
|
+
for (const name of patternNames(node))
|
|
102
|
+
scope.names.add(name);
|
|
103
|
+
}
|
|
104
|
+
function patternNames(node) {
|
|
105
|
+
const target = node;
|
|
106
|
+
if (target === null || target === undefined || typeof target.type !== "string")
|
|
107
|
+
return [];
|
|
108
|
+
switch (target.type) {
|
|
109
|
+
case "Identifier":
|
|
110
|
+
return [String(target["name"])];
|
|
111
|
+
case "ObjectPattern":
|
|
112
|
+
return target["properties"].flatMap((property) => {
|
|
113
|
+
const record = property;
|
|
114
|
+
return patternNames(record.type === "RestElement" ? record["argument"] : record["value"]);
|
|
115
|
+
});
|
|
116
|
+
case "ArrayPattern":
|
|
117
|
+
return target["elements"].flatMap((element) => patternNames(element));
|
|
118
|
+
case "AssignmentPattern":
|
|
119
|
+
return patternNames(target["left"]);
|
|
120
|
+
case "RestElement":
|
|
121
|
+
return patternNames(target["argument"]);
|
|
122
|
+
default:
|
|
123
|
+
return [];
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Hoist the bindings a scope owns before walking its body.
|
|
128
|
+
*
|
|
129
|
+
* `var` and function declarations belong to the nearest function scope; `let`,
|
|
130
|
+
* `const`, `class`, and imports belong to the block they appear in. Hoisting
|
|
131
|
+
* first is what makes a reference above its own declaration resolve, so the
|
|
132
|
+
* scan does not report a use-before-declare as a missing global.
|
|
133
|
+
*/
|
|
134
|
+
function collectHoisted(node, scope) {
|
|
135
|
+
for (const statement of bodyOf(node))
|
|
136
|
+
collectStatementBindings(statement, scope);
|
|
137
|
+
}
|
|
138
|
+
function collectStatementBindings(node, scope) {
|
|
139
|
+
switch (node.type) {
|
|
140
|
+
case "VariableDeclaration":
|
|
141
|
+
for (const declarator of node["declarations"])
|
|
142
|
+
declare(scope, declarator["id"]);
|
|
143
|
+
return;
|
|
144
|
+
case "FunctionDeclaration":
|
|
145
|
+
case "ClassDeclaration":
|
|
146
|
+
if (node["id"] !== null && node["id"] !== undefined)
|
|
147
|
+
declare(scope, node["id"]);
|
|
148
|
+
return;
|
|
149
|
+
case "ImportDeclaration":
|
|
150
|
+
for (const specifier of node["specifiers"])
|
|
151
|
+
declare(scope, specifier["local"]);
|
|
152
|
+
return;
|
|
153
|
+
case "ExportNamedDeclaration":
|
|
154
|
+
case "ExportDefaultDeclaration": {
|
|
155
|
+
const declaration = node["declaration"];
|
|
156
|
+
if (declaration !== null && declaration !== undefined) {
|
|
157
|
+
collectStatementBindings(declaration, scope);
|
|
158
|
+
}
|
|
159
|
+
return;
|
|
160
|
+
}
|
|
161
|
+
default:
|
|
162
|
+
return;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
/** Hoist `var` declarations out of nested blocks into the function scope. */
|
|
166
|
+
function collectVarsDeep(node, scope) {
|
|
167
|
+
const target = node;
|
|
168
|
+
if (target === null || target === undefined || typeof target.type !== "string")
|
|
169
|
+
return;
|
|
170
|
+
if (isFunctionNode(target))
|
|
171
|
+
return;
|
|
172
|
+
if (target.type === "VariableDeclaration" && target["kind"] === "var") {
|
|
173
|
+
for (const declarator of target["declarations"])
|
|
174
|
+
declare(scope, declarator["id"]);
|
|
175
|
+
}
|
|
176
|
+
if (target.type === "FunctionDeclaration" && target["id"] !== null) {
|
|
177
|
+
declare(scope, target["id"]);
|
|
178
|
+
}
|
|
179
|
+
for (const child of childNodes(target))
|
|
180
|
+
collectVarsDeep(child, scope);
|
|
181
|
+
}
|
|
182
|
+
function bodyOf(node) {
|
|
183
|
+
const body = node["body"];
|
|
184
|
+
if (Array.isArray(body))
|
|
185
|
+
return body;
|
|
186
|
+
return [];
|
|
187
|
+
}
|
|
188
|
+
function isFunctionNode(node) {
|
|
189
|
+
return (node.type === "FunctionDeclaration" ||
|
|
190
|
+
node.type === "FunctionExpression" ||
|
|
191
|
+
node.type === "ArrowFunctionExpression");
|
|
192
|
+
}
|
|
193
|
+
// ---------------------------------------------------------------------------
|
|
194
|
+
// Reference resolution
|
|
195
|
+
// ---------------------------------------------------------------------------
|
|
196
|
+
function resolves(scope, name) {
|
|
197
|
+
for (let current = scope; current !== undefined; current = current.parent) {
|
|
198
|
+
if (current.names.has(name))
|
|
199
|
+
return true;
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
function walk(node, scope, guards, findings) {
|
|
204
|
+
if (isFunctionNode(node)) {
|
|
205
|
+
const inner = { parent: scope, kind: "function", names: new Set() };
|
|
206
|
+
if (node.type !== "ArrowFunctionExpression")
|
|
207
|
+
inner.names.add("arguments");
|
|
208
|
+
if (node.type === "FunctionExpression" && node["id"] !== null && node["id"] !== undefined) {
|
|
209
|
+
declare(inner, node["id"]);
|
|
210
|
+
}
|
|
211
|
+
for (const parameter of node["params"])
|
|
212
|
+
declare(inner, parameter);
|
|
213
|
+
const body = node["body"];
|
|
214
|
+
if (body.type === "BlockStatement") {
|
|
215
|
+
collectHoisted(body, inner);
|
|
216
|
+
for (const statement of bodyOf(body))
|
|
217
|
+
collectVarsDeep(statement, inner);
|
|
218
|
+
for (const statement of bodyOf(body))
|
|
219
|
+
walk(statement, inner, guards, findings);
|
|
220
|
+
}
|
|
221
|
+
else {
|
|
222
|
+
walk(body, inner, guards, findings);
|
|
223
|
+
}
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
switch (node.type) {
|
|
227
|
+
case "BlockStatement": {
|
|
228
|
+
const inner = { parent: scope, kind: "block", names: new Set() };
|
|
229
|
+
collectHoisted(node, inner);
|
|
230
|
+
for (const statement of bodyOf(node))
|
|
231
|
+
walk(statement, inner, guards, findings);
|
|
232
|
+
return;
|
|
233
|
+
}
|
|
234
|
+
case "CatchClause": {
|
|
235
|
+
const inner = { parent: scope, kind: "block", names: new Set() };
|
|
236
|
+
if (node["param"] !== null && node["param"] !== undefined)
|
|
237
|
+
declare(inner, node["param"]);
|
|
238
|
+
walk(node["body"], inner, guards, findings);
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
case "ForStatement":
|
|
242
|
+
case "ForInStatement":
|
|
243
|
+
case "ForOfStatement": {
|
|
244
|
+
const inner = { parent: scope, kind: "block", names: new Set() };
|
|
245
|
+
for (const key of ["init", "left"]) {
|
|
246
|
+
const part = node[key];
|
|
247
|
+
if (part !== null && part !== undefined && part.type === "VariableDeclaration") {
|
|
248
|
+
for (const declarator of part["declarations"])
|
|
249
|
+
declare(inner, declarator["id"]);
|
|
250
|
+
}
|
|
251
|
+
}
|
|
252
|
+
for (const child of childNodes(node))
|
|
253
|
+
walk(child, inner, guards, findings);
|
|
254
|
+
return;
|
|
255
|
+
}
|
|
256
|
+
case "ClassDeclaration":
|
|
257
|
+
case "ClassExpression": {
|
|
258
|
+
const inner = { parent: scope, kind: "block", names: new Set() };
|
|
259
|
+
if (node["id"] !== null && node["id"] !== undefined)
|
|
260
|
+
declare(inner, node["id"]);
|
|
261
|
+
for (const child of childNodes(node))
|
|
262
|
+
walk(child, inner, guards, findings);
|
|
263
|
+
return;
|
|
264
|
+
}
|
|
265
|
+
case "MemberExpression": {
|
|
266
|
+
walk(node["object"], scope, guards, findings);
|
|
267
|
+
if (node["computed"] === true)
|
|
268
|
+
walk(node["property"], scope, guards, findings);
|
|
269
|
+
return;
|
|
270
|
+
}
|
|
271
|
+
case "Property": {
|
|
272
|
+
if (node["computed"] === true)
|
|
273
|
+
walk(node["key"], scope, guards, findings);
|
|
274
|
+
walk(node["value"], scope, guards, findings);
|
|
275
|
+
return;
|
|
276
|
+
}
|
|
277
|
+
case "MethodDefinition":
|
|
278
|
+
case "PropertyDefinition": {
|
|
279
|
+
if (node["computed"] === true)
|
|
280
|
+
walk(node["key"], scope, guards, findings);
|
|
281
|
+
const value = node["value"];
|
|
282
|
+
if (value !== null && value !== undefined)
|
|
283
|
+
walk(value, scope, guards, findings);
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
case "UnaryExpression": {
|
|
287
|
+
const argument = node["argument"];
|
|
288
|
+
if (node["operator"] === "typeof" && argument.type === "Identifier") {
|
|
289
|
+
const name = String(argument["name"]);
|
|
290
|
+
if (!resolves(scope, name) && FORBIDDEN_GLOBALS.has(name)) {
|
|
291
|
+
findings.push(finding(name, argument, "feature-detected"));
|
|
292
|
+
}
|
|
293
|
+
return;
|
|
294
|
+
}
|
|
295
|
+
walk(argument, scope, guards, findings);
|
|
296
|
+
return;
|
|
297
|
+
}
|
|
298
|
+
case "LogicalExpression": {
|
|
299
|
+
const left = node["left"];
|
|
300
|
+
walk(left, scope, guards, findings);
|
|
301
|
+
walk(node["right"], scope, [...guards, ...typeofNames(left)], findings);
|
|
302
|
+
return;
|
|
303
|
+
}
|
|
304
|
+
case "ConditionalExpression":
|
|
305
|
+
case "IfStatement": {
|
|
306
|
+
const test = node["test"];
|
|
307
|
+
walk(test, scope, guards, findings);
|
|
308
|
+
const guarded = [...guards, ...typeofNames(test)];
|
|
309
|
+
for (const key of ["consequent", "alternate"]) {
|
|
310
|
+
const branch = node[key];
|
|
311
|
+
if (branch !== null && branch !== undefined)
|
|
312
|
+
walk(branch, scope, guarded, findings);
|
|
313
|
+
}
|
|
314
|
+
return;
|
|
315
|
+
}
|
|
316
|
+
case "Identifier": {
|
|
317
|
+
const name = String(node["name"]);
|
|
318
|
+
if (resolves(scope, name) || !FORBIDDEN_GLOBALS.has(name))
|
|
319
|
+
return;
|
|
320
|
+
findings.push(finding(name, node, guards.includes(name) ? "feature-detected" : "hard"));
|
|
321
|
+
return;
|
|
322
|
+
}
|
|
323
|
+
default: {
|
|
324
|
+
for (const child of childNodes(node))
|
|
325
|
+
walk(child, scope, guards, findings);
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
/** Names a test expression proves are safe to touch in the guarded branch. */
|
|
330
|
+
function typeofNames(test) {
|
|
331
|
+
const names = [];
|
|
332
|
+
forEachNode(test, (node) => {
|
|
333
|
+
if (node.type !== "UnaryExpression" || node["operator"] !== "typeof")
|
|
334
|
+
return;
|
|
335
|
+
const argument = node["argument"];
|
|
336
|
+
if (argument.type === "Identifier")
|
|
337
|
+
names.push(String(argument["name"]));
|
|
338
|
+
});
|
|
339
|
+
return names;
|
|
340
|
+
}
|
|
341
|
+
function finding(name, node, kind) {
|
|
342
|
+
const loc = node["loc"];
|
|
343
|
+
return {
|
|
344
|
+
name,
|
|
345
|
+
line: loc?.start?.line ?? 0,
|
|
346
|
+
column: loc?.start?.column ?? 0,
|
|
347
|
+
kind
|
|
348
|
+
};
|
|
349
|
+
}
|
|
350
|
+
function childNodes(node) {
|
|
351
|
+
const children = [];
|
|
352
|
+
for (const [key, value] of Object.entries(node)) {
|
|
353
|
+
if (key === "loc" || key === "range" || key === "type")
|
|
354
|
+
continue;
|
|
355
|
+
if (Array.isArray(value)) {
|
|
356
|
+
for (const item of value) {
|
|
357
|
+
if (isAstNode(item))
|
|
358
|
+
children.push(item);
|
|
359
|
+
}
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (isAstNode(value))
|
|
363
|
+
children.push(value);
|
|
364
|
+
}
|
|
365
|
+
return children;
|
|
366
|
+
}
|
|
367
|
+
function isAstNode(value) {
|
|
368
|
+
return (typeof value === "object" &&
|
|
369
|
+
value !== null &&
|
|
370
|
+
!Array.isArray(value) &&
|
|
371
|
+
typeof value.type === "string");
|
|
372
|
+
}
|
|
373
|
+
function forEachNode(node, visit) {
|
|
374
|
+
visit(node);
|
|
375
|
+
for (const child of childNodes(node))
|
|
376
|
+
forEachNode(child, visit);
|
|
377
|
+
}
|
|
378
|
+
//# sourceMappingURL=scan.js.map
|
package/dist/scan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