secure-exec 0.1.0-rc.1 → 0.1.0-rc.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.
Files changed (43) hide show
  1. package/dist/node/driver.d.ts +1 -1
  2. package/dist/node/driver.js +1 -1
  3. package/package.json +5 -5
  4. package/dist/bridge/active-handles.d.ts +0 -21
  5. package/dist/bridge/active-handles.js +0 -60
  6. package/dist/bridge/child-process.d.ts +0 -87
  7. package/dist/bridge/child-process.js +0 -523
  8. package/dist/bridge/fs.d.ts +0 -227
  9. package/dist/bridge/fs.js +0 -1572
  10. package/dist/bridge/index.d.ts +0 -10
  11. package/dist/bridge/index.js +0 -41
  12. package/dist/bridge/module.d.ts +0 -73
  13. package/dist/bridge/module.js +0 -329
  14. package/dist/bridge/network.d.ts +0 -208
  15. package/dist/bridge/network.js +0 -1117
  16. package/dist/bridge/os.d.ts +0 -13
  17. package/dist/bridge/os.js +0 -257
  18. package/dist/bridge/polyfills.d.ts +0 -2
  19. package/dist/bridge/polyfills.js +0 -12
  20. package/dist/bridge/process.d.ts +0 -64
  21. package/dist/bridge/process.js +0 -916
  22. package/dist/bridge.js +0 -10586
  23. package/dist/browser/driver.d.ts +0 -42
  24. package/dist/browser/driver.js +0 -263
  25. package/dist/generated/isolate-runtime.d.ts +0 -19
  26. package/dist/generated/isolate-runtime.js +0 -21
  27. package/dist/generated/polyfills.d.ts +0 -82
  28. package/dist/generated/polyfills.js +0 -82
  29. package/dist/isolate-runtime/apply-custom-global-policy.js +0 -54
  30. package/dist/isolate-runtime/apply-timing-mitigation-freeze.js +0 -44
  31. package/dist/isolate-runtime/apply-timing-mitigation-off.js +0 -14
  32. package/dist/isolate-runtime/bridge-attach.js +0 -29
  33. package/dist/isolate-runtime/bridge-initial-globals.js +0 -78
  34. package/dist/isolate-runtime/eval-script-result.js +0 -8
  35. package/dist/isolate-runtime/global-exposure-helpers.js +0 -36
  36. package/dist/isolate-runtime/init-commonjs-module-globals.js +0 -28
  37. package/dist/isolate-runtime/override-process-cwd.js +0 -8
  38. package/dist/isolate-runtime/override-process-env.js +0 -8
  39. package/dist/isolate-runtime/require-setup.js +0 -606
  40. package/dist/isolate-runtime/set-commonjs-file-globals.js +0 -36
  41. package/dist/isolate-runtime/set-stdin-data.js +0 -10
  42. package/dist/isolate-runtime/setup-dynamic-import.js +0 -64
  43. package/dist/isolate-runtime/setup-fs-facade.js +0 -40
@@ -1,2 +1,2 @@
1
- export { createDefaultNetworkAdapter, createNodeDriver, createNodeRuntimeDriverFactory, NodeFileSystem, NodeExecutionDriver, filterEnv, } from "@secure-exec/node";
1
+ export { createDefaultNetworkAdapter, createNodeDriver, createNodeRuntimeDriverFactory, NodeFileSystem, NodeExecutionDriver, filterEnv, isPrivateIp, } from "@secure-exec/node";
2
2
  export type { NodeDriverOptions, NodeRuntimeDriverFactoryOptions, ModuleAccessOptions, } from "@secure-exec/node";
@@ -1,2 +1,2 @@
1
1
  // Re-exported from @secure-exec/node — canonical source is packages/secure-exec-node/src/driver.ts
2
- export { createDefaultNetworkAdapter, createNodeDriver, createNodeRuntimeDriverFactory, NodeFileSystem, NodeExecutionDriver, filterEnv, } from "@secure-exec/node";
2
+ export { createDefaultNetworkAdapter, createNodeDriver, createNodeRuntimeDriverFactory, NodeFileSystem, NodeExecutionDriver, filterEnv, isPrivateIp, } from "@secure-exec/node";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "secure-exec",
3
- "version": "0.1.0-rc.1",
3
+ "version": "0.1.0-rc.3",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "main": "./dist/index.js",
@@ -25,10 +25,10 @@
25
25
  }
26
26
  },
27
27
  "dependencies": {
28
- "@secure-exec/browser": "0.1.0-rc.1",
29
- "@secure-exec/core": "0.1.0-rc.1",
30
- "@secure-exec/node": "0.1.0-rc.1",
31
- "@secure-exec/python": "0.1.0-rc.1"
28
+ "@secure-exec/node": "0.1.0-rc.3",
29
+ "@secure-exec/browser": "0.1.0-rc.3",
30
+ "@secure-exec/core": "0.1.0-rc.3",
31
+ "@secure-exec/python": "0.1.0-rc.3"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/node": "^22.10.2",
@@ -1,21 +0,0 @@
1
- /**
2
- * Register an active handle that keeps the sandbox alive.
3
- * @param id Unique identifier for the handle
4
- * @param description Human-readable description for debugging
5
- */
6
- export declare function _registerHandle(id: string, description: string): void;
7
- /**
8
- * Unregister a handle. If no handles remain, resolves all waiters.
9
- * @param id The handle identifier to unregister
10
- */
11
- export declare function _unregisterHandle(id: string): void;
12
- /**
13
- * Wait for all active handles to complete.
14
- * Returns immediately if no handles are active.
15
- */
16
- export declare function _waitForActiveHandles(): Promise<void>;
17
- /**
18
- * Get list of currently active handles (for debugging).
19
- * Returns array of [id, description] tuples.
20
- */
21
- export declare function _getActiveHandles(): Array<[string, string]>;
@@ -1,60 +0,0 @@
1
- import { exposeCustomGlobal } from "../shared/global-exposure.js";
2
- /**
3
- * Active Handles: Mechanism to keep the sandbox alive for async operations.
4
- *
5
- * isolated-vm doesn't have an event loop, so async callbacks (like child process
6
- * events) would never fire because the sandbox exits immediately after synchronous
7
- * code finishes. This module tracks active handles and provides a promise that
8
- * resolves when all handles complete.
9
- *
10
- * See: docs-internal/node/ACTIVE_HANDLES.md
11
- */
12
- // Map of active handles: id -> description (for debugging)
13
- const _activeHandles = new Map();
14
- // Resolvers waiting for all handles to complete
15
- let _waitResolvers = [];
16
- /**
17
- * Register an active handle that keeps the sandbox alive.
18
- * @param id Unique identifier for the handle
19
- * @param description Human-readable description for debugging
20
- */
21
- export function _registerHandle(id, description) {
22
- _activeHandles.set(id, description);
23
- }
24
- /**
25
- * Unregister a handle. If no handles remain, resolves all waiters.
26
- * @param id The handle identifier to unregister
27
- */
28
- export function _unregisterHandle(id) {
29
- _activeHandles.delete(id);
30
- if (_activeHandles.size === 0 && _waitResolvers.length > 0) {
31
- const resolvers = _waitResolvers;
32
- _waitResolvers = [];
33
- resolvers.forEach((r) => r());
34
- }
35
- }
36
- /**
37
- * Wait for all active handles to complete.
38
- * Returns immediately if no handles are active.
39
- */
40
- export function _waitForActiveHandles() {
41
- if (_activeHandles.size === 0) {
42
- return Promise.resolve();
43
- }
44
- return new Promise((resolve) => {
45
- _waitResolvers.push(resolve);
46
- });
47
- }
48
- /**
49
- * Get list of currently active handles (for debugging).
50
- * Returns array of [id, description] tuples.
51
- */
52
- export function _getActiveHandles() {
53
- return Array.from(_activeHandles.entries());
54
- }
55
- // Install on globalThis for use by other bridge modules and exec().
56
- // Lock bridge internals so sandbox code cannot replace lifecycle hooks.
57
- exposeCustomGlobal("_registerHandle", _registerHandle);
58
- exposeCustomGlobal("_unregisterHandle", _unregisterHandle);
59
- exposeCustomGlobal("_waitForActiveHandles", _waitForActiveHandles);
60
- exposeCustomGlobal("_getActiveHandles", _getActiveHandles);
@@ -1,87 +0,0 @@
1
- import type * as nodeChildProcess from "child_process";
2
- type EventListener = (...args: unknown[]) => void;
3
- interface StdinStream {
4
- writable: boolean;
5
- _buffer: unknown[];
6
- write(data: unknown): boolean;
7
- end(): void;
8
- on(): StdinStream;
9
- once(): StdinStream;
10
- emit(): boolean;
11
- }
12
- interface OutputStreamStub {
13
- readable: boolean;
14
- _data: string;
15
- _listeners: Record<string, EventListener[]>;
16
- _onceListeners: Record<string, EventListener[]>;
17
- on(event: string, listener: EventListener): OutputStreamStub;
18
- once(event: string, listener: EventListener): OutputStreamStub;
19
- emit(event: string, ...args: unknown[]): boolean;
20
- read(): null;
21
- setEncoding(): OutputStreamStub;
22
- pipe<T extends NodeJS.WritableStream>(dest: T): T;
23
- }
24
- declare class ChildProcess {
25
- private _listeners;
26
- private _onceListeners;
27
- pid: number;
28
- killed: boolean;
29
- exitCode: number | null;
30
- signalCode: NodeJS.Signals | null;
31
- connected: boolean;
32
- spawnfile: string;
33
- spawnargs: string[];
34
- stdin: StdinStream;
35
- stdout: OutputStreamStub;
36
- stderr: OutputStreamStub;
37
- stdio: [StdinStream, OutputStreamStub, OutputStreamStub];
38
- constructor();
39
- on(event: string, listener: EventListener): this;
40
- once(event: string, listener: EventListener): this;
41
- off(event: string, listener: EventListener): this;
42
- removeListener(event: string, listener: EventListener): this;
43
- emit(event: string, ...args: unknown[]): boolean;
44
- kill(_signal?: NodeJS.Signals | number): boolean;
45
- ref(): this;
46
- unref(): this;
47
- disconnect(): void;
48
- _complete(stdout: string, stderr: string, code: number): void;
49
- }
50
- interface ExecError extends Error {
51
- code?: number;
52
- killed?: boolean;
53
- signal?: string | null;
54
- cmd?: string;
55
- stdout?: string;
56
- stderr?: string;
57
- status?: number;
58
- output?: [null, string, string];
59
- }
60
- declare function exec(command: string, options?: nodeChildProcess.ExecOptions | ((error: ExecError | null, stdout: string, stderr: string) => void), callback?: (error: ExecError | null, stdout: string, stderr: string) => void): ChildProcess;
61
- declare function execSync(command: string, options?: nodeChildProcess.ExecSyncOptions): string | Buffer;
62
- declare function spawn(command: string, args?: readonly string[] | nodeChildProcess.SpawnOptions, options?: nodeChildProcess.SpawnOptions): ChildProcess;
63
- interface SpawnSyncResult {
64
- pid: number;
65
- output: [null, string | Buffer, string | Buffer];
66
- stdout: string | Buffer;
67
- stderr: string | Buffer;
68
- status: number | null;
69
- signal: NodeJS.Signals | null;
70
- error?: Error;
71
- }
72
- declare function spawnSync(command: string, args?: readonly string[] | nodeChildProcess.SpawnSyncOptions, options?: nodeChildProcess.SpawnSyncOptions): SpawnSyncResult;
73
- declare function execFile(file: string, args?: readonly string[] | nodeChildProcess.ExecFileOptions | ((error: ExecError | null, stdout: string, stderr: string) => void), options?: nodeChildProcess.ExecFileOptions | ((error: ExecError | null, stdout: string, stderr: string) => void), callback?: (error: ExecError | null, stdout: string, stderr: string) => void): ChildProcess;
74
- declare function execFileSync(file: string, args?: readonly string[] | nodeChildProcess.ExecFileSyncOptions, options?: nodeChildProcess.ExecFileSyncOptions): string | Buffer;
75
- declare function fork(_modulePath: string, _args?: readonly string[] | nodeChildProcess.ForkOptions, _options?: nodeChildProcess.ForkOptions): never;
76
- declare const childProcess: {
77
- ChildProcess: typeof ChildProcess;
78
- exec: typeof exec;
79
- execSync: typeof execSync;
80
- spawn: typeof spawn;
81
- spawnSync: typeof spawnSync;
82
- execFile: typeof execFile;
83
- execFileSync: typeof execFileSync;
84
- fork: typeof fork;
85
- };
86
- export { ChildProcess, exec, execSync, spawn, spawnSync, execFile, execFileSync, fork };
87
- export default childProcess;