@isol8/core 0.13.0-alpha.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 +39 -0
- package/dist/client/remote.d.ts +64 -0
- package/dist/client/remote.d.ts.map +1 -0
- package/dist/config.d.ts +36 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/docker/Dockerfile +42 -0
- package/dist/docker/proxy-handler.sh +180 -0
- package/dist/docker/proxy.sh +57 -0
- package/dist/docker/seccomp-profile.json +67 -0
- package/dist/engine/audit.d.ts +31 -0
- package/dist/engine/audit.d.ts.map +1 -0
- package/dist/engine/code-fetcher.d.ts +21 -0
- package/dist/engine/code-fetcher.d.ts.map +1 -0
- package/dist/engine/concurrency.d.ts +46 -0
- package/dist/engine/concurrency.d.ts.map +1 -0
- package/dist/engine/default-seccomp-profile.d.ts +8 -0
- package/dist/engine/default-seccomp-profile.d.ts.map +1 -0
- package/dist/engine/docker.d.ts +167 -0
- package/dist/engine/docker.d.ts.map +1 -0
- package/dist/engine/image-builder.d.ts +71 -0
- package/dist/engine/image-builder.d.ts.map +1 -0
- package/dist/engine/pool.d.ts +94 -0
- package/dist/engine/pool.d.ts.map +1 -0
- package/dist/engine/stats.d.ts +35 -0
- package/dist/engine/stats.d.ts.map +1 -0
- package/dist/engine/utils.d.ts +71 -0
- package/dist/engine/utils.d.ts.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2777 -0
- package/dist/index.js.map +30 -0
- package/dist/runtime/adapter.d.ts +63 -0
- package/dist/runtime/adapter.d.ts.map +1 -0
- package/dist/runtime/adapters/bash.d.ts +3 -0
- package/dist/runtime/adapters/bash.d.ts.map +1 -0
- package/dist/runtime/adapters/bun.d.ts +4 -0
- package/dist/runtime/adapters/bun.d.ts.map +1 -0
- package/dist/runtime/adapters/deno.d.ts +10 -0
- package/dist/runtime/adapters/deno.d.ts.map +1 -0
- package/dist/runtime/adapters/node.d.ts +4 -0
- package/dist/runtime/adapters/node.d.ts.map +1 -0
- package/dist/runtime/adapters/python.d.ts +4 -0
- package/dist/runtime/adapters/python.d.ts.map +1 -0
- package/dist/runtime/index.d.ts +15 -0
- package/dist/runtime/index.d.ts.map +1 -0
- package/dist/types.d.ts +532 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +32 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/version.d.ts +15 -0
- package/dist/version.d.ts.map +1 -0
- package/docker/Dockerfile +42 -0
- package/docker/proxy-handler.sh +180 -0
- package/docker/proxy.sh +57 -0
- package/docker/seccomp-profile.json +67 -0
- package/package.json +48 -0
- package/schema/isol8.config.schema.json +315 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bun.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/bun.ts"],"names":[],"mappings":"AAAA,4FAA4F;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,UAAU,EAAE,cAcxB,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deno runtime adapter — uses `deno` from the `isol8:deno` image.
|
|
3
|
+
*
|
|
4
|
+
* Uses `.mts` extension to avoid collision with Bun's `.ts`.
|
|
5
|
+
* Permissions are scoped: read/write to /sandbox, env access, and
|
|
6
|
+
* optionally net access (controlled by the engine's network mode).
|
|
7
|
+
*/
|
|
8
|
+
import type { RuntimeAdapter } from "../adapter";
|
|
9
|
+
export declare const DenoAdapter: RuntimeAdapter;
|
|
10
|
+
//# sourceMappingURL=deno.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deno.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/deno.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,cAsBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/node.ts"],"names":[],"mappings":"AAAA,yEAAyE;AACzE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,cAczB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"python.d.ts","sourceRoot":"","sources":["../../../src/runtime/adapters/python.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,eAAO,MAAM,aAAa,EAAE,cAc3B,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module runtime
|
|
3
|
+
*
|
|
4
|
+
* Barrel module that registers all built-in runtime adapters and re-exports
|
|
5
|
+
* the public API. Importing this module has the side effect of populating
|
|
6
|
+
* the {@link RuntimeRegistry} with Python, Node, Bun, and Deno adapters.
|
|
7
|
+
*/
|
|
8
|
+
export type { RuntimeAdapter } from "./adapter";
|
|
9
|
+
export { RuntimeRegistry } from "./adapter";
|
|
10
|
+
export { bashAdapter } from "./adapters/bash";
|
|
11
|
+
export { BunAdapter } from "./adapters/bun";
|
|
12
|
+
export { DenoAdapter } from "./adapters/deno";
|
|
13
|
+
export { NodeAdapter } from "./adapters/node";
|
|
14
|
+
export { PythonAdapter } from "./adapters/python";
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/runtime/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAgBH,YAAY,EAAE,cAAc,EAAE,MAAM,WAAW,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,532 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module types
|
|
3
|
+
*
|
|
4
|
+
* Core type definitions for isol8. All public interfaces used by
|
|
5
|
+
* the library, CLI, server, and client are defined here.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Supported code execution runtimes.
|
|
9
|
+
*
|
|
10
|
+
* - `"python"` — CPython 3.x
|
|
11
|
+
* - `"node"` — Node.js LTS
|
|
12
|
+
* - `"bun"` — Bun runtime
|
|
13
|
+
* - `"deno"` — Deno runtime
|
|
14
|
+
* - `"bash"` — Bash shell
|
|
15
|
+
*/
|
|
16
|
+
export type Runtime = "python" | "node" | "bun" | "deno" | "bash";
|
|
17
|
+
/**
|
|
18
|
+
* Network access mode for isol8 containers.
|
|
19
|
+
*
|
|
20
|
+
* - `"none"` — All network access blocked (default, most secure).
|
|
21
|
+
* - `"host"` — Full host network access (use with caution).
|
|
22
|
+
* - `"filtered"` — HTTP/HTTPS traffic routed through a proxy that enforces
|
|
23
|
+
* whitelist/blacklist regex rules on hostnames.
|
|
24
|
+
*/
|
|
25
|
+
export type NetworkMode = "none" | "host" | "filtered";
|
|
26
|
+
/**
|
|
27
|
+
* A request to execute code inside isol8.
|
|
28
|
+
*/
|
|
29
|
+
export interface ExecutionRequest {
|
|
30
|
+
/**
|
|
31
|
+
* Source code to execute.
|
|
32
|
+
* Mutually exclusive with {@link codeUrl}.
|
|
33
|
+
*/
|
|
34
|
+
code?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Remote URL to fetch source code from before execution.
|
|
37
|
+
* Mutually exclusive with {@link code}.
|
|
38
|
+
*/
|
|
39
|
+
codeUrl?: string;
|
|
40
|
+
/** Expected SHA-256 hash (hex) of the fetched source code. */
|
|
41
|
+
codeHash?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Allow `http://` code URLs for this request.
|
|
44
|
+
* By default, only `https://` is allowed.
|
|
45
|
+
*/
|
|
46
|
+
allowInsecureCodeUrl?: boolean;
|
|
47
|
+
/** Target runtime. Must match a registered {@link RuntimeAdapter}. */
|
|
48
|
+
runtime: Runtime;
|
|
49
|
+
/**
|
|
50
|
+
* Execution timeout in milliseconds. Overrides the default.
|
|
51
|
+
* The container is killed if this limit is exceeded.
|
|
52
|
+
*/
|
|
53
|
+
timeoutMs?: number;
|
|
54
|
+
/**
|
|
55
|
+
* Additional environment variables injected into the container.
|
|
56
|
+
* Keys matching secret names will be masked in output.
|
|
57
|
+
*/
|
|
58
|
+
env?: Record<string, string>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional file extension to use for the script file (e.g. ".cjs", ".mjs").
|
|
61
|
+
* If not provided, defaults to the runtime adapter's default extension.
|
|
62
|
+
*/
|
|
63
|
+
fileExtension?: string;
|
|
64
|
+
/**
|
|
65
|
+
* Data to pipe to the process via stdin.
|
|
66
|
+
* Written to a temporary file and piped into the command.
|
|
67
|
+
*/
|
|
68
|
+
stdin?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Files to inject into the container before execution.
|
|
71
|
+
* Keys are absolute paths inside the container, values are file contents.
|
|
72
|
+
*/
|
|
73
|
+
files?: Record<string, string | Buffer>;
|
|
74
|
+
/**
|
|
75
|
+
* Absolute paths of files to retrieve from the container after execution.
|
|
76
|
+
* Retrieved files are included in {@link ExecutionResult.files} as base64 strings.
|
|
77
|
+
*/
|
|
78
|
+
outputPaths?: string[];
|
|
79
|
+
/**
|
|
80
|
+
* Packages to install before execution via the runtime's package manager.
|
|
81
|
+
* e.g. `["numpy", "pandas"]` for Python or `["lodash"]` for Node.
|
|
82
|
+
*/
|
|
83
|
+
installPackages?: string[];
|
|
84
|
+
/**
|
|
85
|
+
* Additional metadata to include in audit logs (userId, tenantId, etc.).
|
|
86
|
+
* Passed through to audit logs when audit logging is enabled.
|
|
87
|
+
*/
|
|
88
|
+
metadata?: Record<string, string>;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* The result of a code execution.
|
|
92
|
+
*/
|
|
93
|
+
export interface ExecutionResult {
|
|
94
|
+
/** Captured standard output (may be truncated). */
|
|
95
|
+
stdout: string;
|
|
96
|
+
/** Captured standard error. */
|
|
97
|
+
stderr: string;
|
|
98
|
+
/** Process exit code. `0` indicates success. */
|
|
99
|
+
exitCode: number;
|
|
100
|
+
/** Wall-clock execution time in milliseconds. */
|
|
101
|
+
durationMs: number;
|
|
102
|
+
/** `true` if stdout was truncated due to exceeding {@link Isol8Options.maxOutputSize}. */
|
|
103
|
+
truncated: boolean;
|
|
104
|
+
/** Unique identifier for this execution. */
|
|
105
|
+
executionId: string;
|
|
106
|
+
/** Runtime used for this execution. */
|
|
107
|
+
runtime: Runtime;
|
|
108
|
+
/** ISO 8601 timestamp of when execution started. */
|
|
109
|
+
timestamp: string;
|
|
110
|
+
/** Docker container ID (if available). */
|
|
111
|
+
containerId?: string;
|
|
112
|
+
/**
|
|
113
|
+
* Files retrieved from the container after execution.
|
|
114
|
+
* Keys are paths, values are base64-encoded file contents.
|
|
115
|
+
* Only populated when {@link ExecutionRequest.outputPaths} is specified.
|
|
116
|
+
*/
|
|
117
|
+
files?: Record<string, string>;
|
|
118
|
+
/**
|
|
119
|
+
* Resource usage metrics collected during execution.
|
|
120
|
+
* Only populated when audit logging with trackResources is enabled.
|
|
121
|
+
*/
|
|
122
|
+
resourceUsage?: {
|
|
123
|
+
/** CPU usage as percentage (0-100 * num_cores) */
|
|
124
|
+
cpuPercent: number;
|
|
125
|
+
/** Current memory usage in megabytes */
|
|
126
|
+
memoryMB: number;
|
|
127
|
+
/** Peak memory usage in megabytes (if tracked) */
|
|
128
|
+
peakMemoryMB?: number;
|
|
129
|
+
/** Bytes received during execution */
|
|
130
|
+
networkBytesIn: number;
|
|
131
|
+
/** Bytes sent during execution */
|
|
132
|
+
networkBytesOut: number;
|
|
133
|
+
};
|
|
134
|
+
/**
|
|
135
|
+
* Network request logs collected during execution.
|
|
136
|
+
* Only populated when `logNetwork` is enabled and network mode is "filtered".
|
|
137
|
+
*/
|
|
138
|
+
networkLogs?: NetworkLogEntry[];
|
|
139
|
+
} /**
|
|
140
|
+
* A chunk of streaming output from an execution.
|
|
141
|
+
*
|
|
142
|
+
* Yielded by {@link Isol8Engine.executeStream} as output arrives in real-time.
|
|
143
|
+
*/
|
|
144
|
+
export interface StreamEvent {
|
|
145
|
+
/** Event type: output chunk, process exit, or error. */
|
|
146
|
+
type: "stdout" | "stderr" | "exit" | "error";
|
|
147
|
+
/** Text content for stdout/stderr, exit code string for exit, error message for error. */
|
|
148
|
+
data: string;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Security events raised during execution (policy violations, alerts).
|
|
152
|
+
*/
|
|
153
|
+
export interface SecurityEvent {
|
|
154
|
+
type: string;
|
|
155
|
+
message: string;
|
|
156
|
+
details?: Record<string, unknown>;
|
|
157
|
+
timestamp: string;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* A network request logged by the proxy in filtered network mode.
|
|
161
|
+
*/
|
|
162
|
+
export interface NetworkLogEntry {
|
|
163
|
+
/** ISO 8601 timestamp of when the request was made. */
|
|
164
|
+
timestamp: string;
|
|
165
|
+
/** HTTP method (GET, POST, CONNECT, etc.). */
|
|
166
|
+
method: string;
|
|
167
|
+
/** Target hostname. */
|
|
168
|
+
host: string;
|
|
169
|
+
/** Request path for HTTP requests, null for HTTPS CONNECT tunnels. */
|
|
170
|
+
path: string | null;
|
|
171
|
+
/** Whether the request was allowed through or blocked by the filter. */
|
|
172
|
+
action: "ALLOW" | "BLOCK";
|
|
173
|
+
/** Time taken to handle the request in milliseconds. */
|
|
174
|
+
durationMs: number;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Audit record for an execution. Stored in immutable append-only logs.
|
|
178
|
+
*/
|
|
179
|
+
export interface ExecutionAudit {
|
|
180
|
+
executionId: string;
|
|
181
|
+
userId: string;
|
|
182
|
+
timestamp: string;
|
|
183
|
+
runtime: Runtime;
|
|
184
|
+
codeHash: string;
|
|
185
|
+
containerId: string;
|
|
186
|
+
exitCode: number;
|
|
187
|
+
durationMs: number;
|
|
188
|
+
resourceUsage?: {
|
|
189
|
+
/** CPU usage as percentage (0-100 * num_cores) */
|
|
190
|
+
cpuPercent: number;
|
|
191
|
+
/** Current memory usage in megabytes */
|
|
192
|
+
memoryMB: number;
|
|
193
|
+
/** Peak memory usage in megabytes (if tracked) */
|
|
194
|
+
peakMemoryMB?: number;
|
|
195
|
+
/** Bytes received during execution */
|
|
196
|
+
networkBytesIn: number;
|
|
197
|
+
/** Bytes sent during execution */
|
|
198
|
+
networkBytesOut: number;
|
|
199
|
+
};
|
|
200
|
+
securityEvents?: SecurityEvent[];
|
|
201
|
+
networkLogs?: NetworkLogEntry[];
|
|
202
|
+
code?: string;
|
|
203
|
+
stdout?: string;
|
|
204
|
+
stderr?: string;
|
|
205
|
+
metadata?: Record<string, string>;
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* Isol8 lifecycle mode.
|
|
209
|
+
*
|
|
210
|
+
* - `"ephemeral"` — A new container is created and destroyed for each `execute()` call.
|
|
211
|
+
* - `"persistent"` — A single long-lived container is reused across `execute()` calls,
|
|
212
|
+
* preserving filesystem state between runs.
|
|
213
|
+
*/
|
|
214
|
+
export type Isol8Mode = "ephemeral" | "persistent";
|
|
215
|
+
/**
|
|
216
|
+
* Options for configuring an isol8 instance.
|
|
217
|
+
*/
|
|
218
|
+
export interface Isol8Options {
|
|
219
|
+
/** Lifecycle mode. @default "ephemeral" */
|
|
220
|
+
mode?: Isol8Mode;
|
|
221
|
+
/** Network access mode. @default "none" */
|
|
222
|
+
network?: NetworkMode;
|
|
223
|
+
/** Hostname-based network filtering rules (only used when `network` is `"filtered"`). */
|
|
224
|
+
networkFilter?: NetworkFilterConfig;
|
|
225
|
+
/** CPU limit as a fraction of one core (e.g. `0.5` = half a core). @default 1.0 */
|
|
226
|
+
cpuLimit?: number;
|
|
227
|
+
/** Memory limit string (e.g. `"512m"`, `"1g"`). @default "512m" */
|
|
228
|
+
memoryLimit?: string;
|
|
229
|
+
/** Maximum number of processes allowed inside the container. @default 64 */
|
|
230
|
+
pidsLimit?: number;
|
|
231
|
+
/** Mount the root filesystem as read-only. @default true */
|
|
232
|
+
readonlyRootFs?: boolean;
|
|
233
|
+
/** Maximum output size in bytes before truncation. @default 1048576 (1MB) */
|
|
234
|
+
maxOutputSize?: number;
|
|
235
|
+
/**
|
|
236
|
+
* Secret values to pass as environment variables. Their values are automatically
|
|
237
|
+
* masked (replaced with `***`) in stdout/stderr output.
|
|
238
|
+
*/
|
|
239
|
+
secrets?: Record<string, string>;
|
|
240
|
+
/** Default execution timeout in milliseconds. @default 30000 */
|
|
241
|
+
timeoutMs?: number;
|
|
242
|
+
/** Override the Docker image (ignores runtime adapter image). */
|
|
243
|
+
image?: string;
|
|
244
|
+
/** Size of the `/sandbox` tmpfs mount (e.g. `"64m"`, `"256m"`). Packages installed with `--install` are stored here. @default "512m" */
|
|
245
|
+
sandboxSize?: string;
|
|
246
|
+
/** Size of the `/tmp` tmpfs mount (e.g. `"64m"`, `"128m"`). @default "256m" */
|
|
247
|
+
tmpSize?: string;
|
|
248
|
+
/** Enable debug logging. @default false */
|
|
249
|
+
debug?: boolean;
|
|
250
|
+
/**
|
|
251
|
+
* Keep the container running after execution for inspection/debugging.
|
|
252
|
+
* When true, the container is not cleaned up or returned to the pool.
|
|
253
|
+
* @default false
|
|
254
|
+
*/
|
|
255
|
+
persist?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* Enable network request logging. Only works when network mode is "filtered".
|
|
258
|
+
* Logs are collected from the proxy and included in ExecutionResult.
|
|
259
|
+
* @default false
|
|
260
|
+
*/
|
|
261
|
+
logNetwork?: boolean;
|
|
262
|
+
/** Security settings. */
|
|
263
|
+
security?: SecurityConfig;
|
|
264
|
+
/** Audit logging configuration. */
|
|
265
|
+
audit?: AuditConfig;
|
|
266
|
+
/** Remote code fetching policy. */
|
|
267
|
+
remoteCode?: RemoteCodePolicy;
|
|
268
|
+
/**
|
|
269
|
+
* Pool strategy for container reuse.
|
|
270
|
+
* - "secure": Clean container before returning (slower but ensures clean state)
|
|
271
|
+
* - "fast": Use dual-pool system - instant acquire, background cleanup (faster)
|
|
272
|
+
* @default "fast"
|
|
273
|
+
*/
|
|
274
|
+
poolStrategy?: "secure" | "fast";
|
|
275
|
+
/**
|
|
276
|
+
* Pool size configuration.
|
|
277
|
+
* For "secure" mode: number of containers to keep warm
|
|
278
|
+
* For "fast" mode: { clean: number of ready containers, dirty: number being cleaned }
|
|
279
|
+
* @default 1 (for fast mode: { clean: 1, dirty: 1 })
|
|
280
|
+
*/
|
|
281
|
+
poolSize?: number | {
|
|
282
|
+
clean: number;
|
|
283
|
+
dirty: number;
|
|
284
|
+
};
|
|
285
|
+
/**
|
|
286
|
+
* Runtime-specific dependencies used to resolve hashed custom image tags.
|
|
287
|
+
* When provided, isol8 will prefer `isol8:<runtime>-custom-<hash>` images
|
|
288
|
+
* derived from these dependency sets.
|
|
289
|
+
*/
|
|
290
|
+
dependencies?: Isol8Dependencies;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Startup options for {@link Isol8Engine.start}.
|
|
294
|
+
*/
|
|
295
|
+
export interface StartOptions {
|
|
296
|
+
/**
|
|
297
|
+
* Pre-warm ephemeral container pools on startup.
|
|
298
|
+
*
|
|
299
|
+
* - `false` or omitted: no pre-warm (lazy behavior)
|
|
300
|
+
* - `true`: pre-warm all built-in runtimes
|
|
301
|
+
* - `{ runtimes: [...] }`: pre-warm only selected runtimes
|
|
302
|
+
*/
|
|
303
|
+
prewarm?: boolean | {
|
|
304
|
+
runtimes?: Runtime[];
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
/**
|
|
308
|
+
* The core isol8 engine abstraction. Both {@link DockerIsol8} and {@link RemoteIsol8}
|
|
309
|
+
* implement this interface.
|
|
310
|
+
*/
|
|
311
|
+
export interface Isol8Engine {
|
|
312
|
+
/** Initialize the engine. Must be called before `execute()`. */
|
|
313
|
+
start(options?: StartOptions): Promise<void>;
|
|
314
|
+
/** Tear down the engine, stopping and removing any containers. */
|
|
315
|
+
stop(): Promise<void>;
|
|
316
|
+
/** Execute code and return the result. */
|
|
317
|
+
execute(req: ExecutionRequest): Promise<ExecutionResult>;
|
|
318
|
+
/**
|
|
319
|
+
* Upload a file into the container.
|
|
320
|
+
* Only available in persistent mode after at least one `execute()` call.
|
|
321
|
+
*
|
|
322
|
+
* @param path - Absolute path inside the container (e.g. `/sandbox/data.csv`).
|
|
323
|
+
* @param content - File contents as a string or Buffer.
|
|
324
|
+
*/
|
|
325
|
+
putFile(path: string, content: Buffer | string): Promise<void>;
|
|
326
|
+
/**
|
|
327
|
+
* Download a file from the container.
|
|
328
|
+
* Only available in persistent mode.
|
|
329
|
+
*
|
|
330
|
+
* @param path - Absolute path inside the container.
|
|
331
|
+
* @returns File contents as a Buffer.
|
|
332
|
+
*/
|
|
333
|
+
getFile(path: string): Promise<Buffer>;
|
|
334
|
+
/**
|
|
335
|
+
* Execute code and stream output chunks as they arrive.
|
|
336
|
+
*
|
|
337
|
+
* @param req - Execution request.
|
|
338
|
+
* @returns An async iterable of {@link StreamEvent} objects.
|
|
339
|
+
*/
|
|
340
|
+
executeStream(req: ExecutionRequest): AsyncIterable<StreamEvent>;
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Hostname-based network filter configuration for `"filtered"` network mode.
|
|
344
|
+
*
|
|
345
|
+
* Patterns are ECMAScript regular expressions matched against the hostname
|
|
346
|
+
* of outgoing HTTP/HTTPS requests.
|
|
347
|
+
*
|
|
348
|
+
* Evaluation order: blacklist is checked first — matching hosts are always denied.
|
|
349
|
+
* If a whitelist is provided, only matching hosts are permitted.
|
|
350
|
+
*/
|
|
351
|
+
export interface NetworkFilterConfig {
|
|
352
|
+
/** Regex patterns for allowed hostnames. If non-empty, only matching hosts are allowed. */
|
|
353
|
+
whitelist: string[];
|
|
354
|
+
/** Regex patterns for blocked hostnames. Matching hosts are always denied, even if whitelisted. */
|
|
355
|
+
blacklist: string[];
|
|
356
|
+
}
|
|
357
|
+
/** Policy for fetching remote source code. */
|
|
358
|
+
export interface RemoteCodePolicy {
|
|
359
|
+
/** Enable URL-based source fetching. @default false */
|
|
360
|
+
enabled: boolean;
|
|
361
|
+
/** Allowed URL schemes. @default ["https"] */
|
|
362
|
+
allowedSchemes: string[];
|
|
363
|
+
/** Allowed hostname regex patterns. Empty means allow all (subject to blocklist). */
|
|
364
|
+
allowedHosts: string[];
|
|
365
|
+
/** Blocked hostname regex patterns. */
|
|
366
|
+
blockedHosts: string[];
|
|
367
|
+
/** Max fetched source size in bytes. @default 10485760 (10MB) */
|
|
368
|
+
maxCodeSize: number;
|
|
369
|
+
/** Fetch timeout in milliseconds. @default 30000 */
|
|
370
|
+
fetchTimeoutMs: number;
|
|
371
|
+
/** Require `ExecutionRequest.codeHash` for URL-based execution. @default false */
|
|
372
|
+
requireHash: boolean;
|
|
373
|
+
/** Cache support toggle for future use. @default true */
|
|
374
|
+
enableCache: boolean;
|
|
375
|
+
/** Cache TTL in seconds for future use. @default 3600 */
|
|
376
|
+
cacheTtl: number;
|
|
377
|
+
}
|
|
378
|
+
/** Configuration for default execution settings. */
|
|
379
|
+
export interface Isol8Defaults {
|
|
380
|
+
/** Default timeout in milliseconds. @default 30000 */
|
|
381
|
+
timeoutMs: number;
|
|
382
|
+
/** Default memory limit. @default "512m" */
|
|
383
|
+
memoryLimit: string;
|
|
384
|
+
/** Default CPU limit (1.0 = one full core). @default 1.0 */
|
|
385
|
+
cpuLimit: number;
|
|
386
|
+
/** Default network mode. @default "none" */
|
|
387
|
+
network: NetworkMode;
|
|
388
|
+
/** Default size of the `/sandbox` tmpfs mount. @default "512m" */
|
|
389
|
+
sandboxSize: string;
|
|
390
|
+
/** Default size of the `/tmp` tmpfs mount. @default "256m" */
|
|
391
|
+
tmpSize: string;
|
|
392
|
+
/** Whether the root filesystem should be read-only. @default true */
|
|
393
|
+
readonlyRootFs: boolean;
|
|
394
|
+
}
|
|
395
|
+
/** Configuration for container cleanup and lifecycle. */
|
|
396
|
+
export interface Isol8Cleanup {
|
|
397
|
+
/** Automatically prune idle persistent containers. @default true */
|
|
398
|
+
autoPrune: boolean;
|
|
399
|
+
/** Maximum idle time (ms) before pruning. One hour = 3600000. @default 3600000 */
|
|
400
|
+
maxContainerAgeMs: number;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Runtime-specific packages to bake into custom Docker images.
|
|
404
|
+
* Populated via `isol8.config.json` or CLI flags on `isol8 setup`.
|
|
405
|
+
*/
|
|
406
|
+
export interface Isol8Dependencies {
|
|
407
|
+
/** Python packages to install via pip. */
|
|
408
|
+
python?: string[];
|
|
409
|
+
/** Node.js packages to install globally via npm. */
|
|
410
|
+
node?: string[];
|
|
411
|
+
/** Bun packages to install globally. */
|
|
412
|
+
bun?: string[];
|
|
413
|
+
/** Deno module URLs to pre-cache. */
|
|
414
|
+
deno?: string[];
|
|
415
|
+
/** Bash packages to install via apk (Alpine). */
|
|
416
|
+
bash?: string[];
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* Security configuration for the execution environment.
|
|
420
|
+
*/
|
|
421
|
+
export interface SecurityConfig {
|
|
422
|
+
/**
|
|
423
|
+
* Seccomp profile mode.
|
|
424
|
+
* - "strict": Use the default strict profile (default).
|
|
425
|
+
* - "unconfined": Do not apply any seccomp profile.
|
|
426
|
+
* - "custom": Use the profile at `customProfilePath`.
|
|
427
|
+
*/
|
|
428
|
+
seccomp?: "strict" | "unconfined" | "custom";
|
|
429
|
+
/** Path to a custom seccomp profile JSON file. Required if seccomp is "custom". */
|
|
430
|
+
customProfilePath?: string;
|
|
431
|
+
}
|
|
432
|
+
/** Configuration for audit logging. */
|
|
433
|
+
export interface AuditConfig {
|
|
434
|
+
/** Enable audit logging. @default false */
|
|
435
|
+
enabled: boolean;
|
|
436
|
+
/** Destination for audit logs (filesystem, stdout) @default "filesystem" */
|
|
437
|
+
destination: "filesystem" | "stdout" | string;
|
|
438
|
+
/** Custom directory for audit log files @default undefined (uses ./.isol8_audit) */
|
|
439
|
+
logDir?: string;
|
|
440
|
+
/** Script to run after each log entry (receives file path as argument) @default undefined */
|
|
441
|
+
postLogScript?: string;
|
|
442
|
+
/** Track resource usage (CPU, memory, network) @default true */
|
|
443
|
+
trackResources: boolean;
|
|
444
|
+
/** Retention period for audit logs in days @default 90 */
|
|
445
|
+
retentionDays: number;
|
|
446
|
+
/** Whether to include the source code in audit logs @default false */
|
|
447
|
+
includeCode: boolean;
|
|
448
|
+
/** Whether to include output (stdout/stderr) in audit logs @default false */
|
|
449
|
+
includeOutput: boolean;
|
|
450
|
+
}
|
|
451
|
+
/**
|
|
452
|
+
* Top-level configuration schema for isol8.
|
|
453
|
+
*
|
|
454
|
+
* Loaded from `isol8.config.json` in the working directory or `~/.isol8/config.json`.
|
|
455
|
+
* Partial configs are deep-merged with built-in defaults.
|
|
456
|
+
*
|
|
457
|
+
* @see {@link loadConfig} for the loading/merge logic.
|
|
458
|
+
* @see `schema/isol8.config.schema.json` for the JSON Schema.
|
|
459
|
+
*/
|
|
460
|
+
export interface Isol8Config {
|
|
461
|
+
/** Maximum number of containers that can run concurrently. @default 10 */
|
|
462
|
+
maxConcurrent: number;
|
|
463
|
+
/** Default execution settings applied to all runs. */
|
|
464
|
+
defaults: Isol8Defaults;
|
|
465
|
+
/** Global network filtering rules for `"filtered"` mode. */
|
|
466
|
+
network: NetworkFilterConfig;
|
|
467
|
+
/** Container cleanup and lifecycle settings. */
|
|
468
|
+
cleanup: Isol8Cleanup;
|
|
469
|
+
/**
|
|
470
|
+
* Default ephemeral pool strategy used by `isol8 serve`.
|
|
471
|
+
* @default "fast"
|
|
472
|
+
*/
|
|
473
|
+
poolStrategy: "secure" | "fast";
|
|
474
|
+
/**
|
|
475
|
+
* Default ephemeral pool size used by `isol8 serve`.
|
|
476
|
+
* @default { clean: 1, dirty: 1 }
|
|
477
|
+
*/
|
|
478
|
+
poolSize: number | {
|
|
479
|
+
clean: number;
|
|
480
|
+
dirty: number;
|
|
481
|
+
};
|
|
482
|
+
/** Runtime-specific packages to bake into custom Docker images. */
|
|
483
|
+
dependencies: Isol8Dependencies;
|
|
484
|
+
/** Security settings. */
|
|
485
|
+
security: SecurityConfig;
|
|
486
|
+
/** Remote code fetching policy. */
|
|
487
|
+
remoteCode: RemoteCodePolicy;
|
|
488
|
+
/** Audit logging configuration. */
|
|
489
|
+
audit: AuditConfig;
|
|
490
|
+
/** Enable debug logging. @default false */
|
|
491
|
+
debug: boolean;
|
|
492
|
+
}
|
|
493
|
+
/**
|
|
494
|
+
* User configuration file schema (partial/optional version of Isol8Config).
|
|
495
|
+
* Used for generating the JSON Schema.
|
|
496
|
+
*/
|
|
497
|
+
export interface Isol8UserConfig {
|
|
498
|
+
/** JSON Schema URI for editor validation/completion. */
|
|
499
|
+
$schema?: string;
|
|
500
|
+
/** Enable debug logging. @default false */
|
|
501
|
+
debug?: boolean;
|
|
502
|
+
/** Maximum number of containers that can run concurrently. @default 10 */
|
|
503
|
+
maxConcurrent?: number;
|
|
504
|
+
/** Default execution settings applied to all runs. (Partial override allowed). */
|
|
505
|
+
defaults?: Partial<Isol8Defaults>;
|
|
506
|
+
/** Global network filtering rules for `"filtered"` mode. */
|
|
507
|
+
network?: Partial<NetworkFilterConfig>;
|
|
508
|
+
/** Container cleanup and lifecycle settings. (Partial override allowed). */
|
|
509
|
+
cleanup?: Partial<Isol8Cleanup>;
|
|
510
|
+
/**
|
|
511
|
+
* Default ephemeral pool strategy used by `isol8 serve`.
|
|
512
|
+
* @default "fast"
|
|
513
|
+
*/
|
|
514
|
+
poolStrategy?: "secure" | "fast";
|
|
515
|
+
/**
|
|
516
|
+
* Default ephemeral pool size used by `isol8 serve`.
|
|
517
|
+
* @default { clean: 1, dirty: 1 }
|
|
518
|
+
*/
|
|
519
|
+
poolSize?: number | {
|
|
520
|
+
clean: number;
|
|
521
|
+
dirty: number;
|
|
522
|
+
};
|
|
523
|
+
/** Runtime-specific packages to bake into custom Docker images. */
|
|
524
|
+
dependencies?: Isol8Dependencies;
|
|
525
|
+
/** Security settings. */
|
|
526
|
+
security?: SecurityConfig;
|
|
527
|
+
/** Remote code fetching policy. (Partial override allowed). */
|
|
528
|
+
remoteCode?: Partial<RemoteCodePolicy>;
|
|
529
|
+
/** Audit logging configuration. */
|
|
530
|
+
audit?: Partial<AuditConfig>;
|
|
531
|
+
}
|
|
532
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,UAAU,CAAC;AAEvD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAE/B,sEAAsE;IACtE,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,GA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|
+
* Centralized logging utility for isol8.
|
|
5
|
+
* Supports debug mode toggling and standardized log formatting.
|
|
6
|
+
*/
|
|
7
|
+
declare class Logger {
|
|
8
|
+
private debugMode;
|
|
9
|
+
/**
|
|
10
|
+
* Enable or disable debug logging.
|
|
11
|
+
*/
|
|
12
|
+
setDebug(enabled: boolean): void;
|
|
13
|
+
/**
|
|
14
|
+
* Log a debug message. Only prints if debug mode is enabled.
|
|
15
|
+
*/
|
|
16
|
+
debug(...args: unknown[]): void;
|
|
17
|
+
/**
|
|
18
|
+
* Log an info message. Always prints.
|
|
19
|
+
*/
|
|
20
|
+
info(...args: unknown[]): void;
|
|
21
|
+
/**
|
|
22
|
+
* Log a warning message. Always prints.
|
|
23
|
+
*/
|
|
24
|
+
warn(...args: unknown[]): void;
|
|
25
|
+
/**
|
|
26
|
+
* Log an error message. Always prints.
|
|
27
|
+
*/
|
|
28
|
+
error(...args: unknown[]): void;
|
|
29
|
+
}
|
|
30
|
+
export declare const logger: Logger;
|
|
31
|
+
export {};
|
|
32
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,cAAM,MAAM;IACV,OAAO,CAAC,SAAS,CAAS;IAE1B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,OAAO;IAIzB;;OAEG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAMxB;;OAEG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIvB;;OAEG;IACH,IAAI,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;IAIvB;;OAEG;IACH,KAAK,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE;CAGzB;AAED,eAAO,MAAM,MAAM,QAAe,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module version
|
|
3
|
+
*
|
|
4
|
+
* Exports the current version of isol8.
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Current version of isol8.
|
|
8
|
+
* @example
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import { VERSION } from "isol8";
|
|
11
|
+
* console.log(`Using isol8 v${VERSION}`);
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const VERSION: string;
|
|
15
|
+
//# sourceMappingURL=version.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../src/version.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH;;;;;;;GAOG;AACH,eAAO,MAAM,OAAO,QAAsB,CAAC"}
|