kern-sandbox 0.2.5 → 0.2.6
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 +5 -2
- package/index.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -28,8 +28,11 @@ const r = await kern.runCode("print(sum(range(100)))");
|
|
|
28
28
|
console.log(r.stdout, r.success); // "4950\n" true
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
TypeScript types ship in the package. `Buffer` is in the public surface, so a TypeScript consumer
|
|
32
|
-
|
|
31
|
+
TypeScript types ship in the package. `Buffer` is in the public surface, so a TypeScript consumer needs
|
|
32
|
+
`@types/node` **and** a `tsconfig.json` that includes it. MEASURED with `tsc` 7.0.2: without the types,
|
|
33
|
+
8 errors saying `Cannot find name 'Buffer'`; with the types installed but no `tsconfig.json`, the same 8;
|
|
34
|
+
with `{ "compilerOptions": { "types": ["node"] } }`, zero. Installing the package `tsc` names is half the
|
|
35
|
+
remedy, which is worth stating because the error message only hints at the other half.
|
|
33
36
|
|
|
34
37
|
```ts
|
|
35
38
|
import { runCode, withSandbox, Sandbox } from "kern-sandbox";
|
package/index.js
CHANGED
|
@@ -36,7 +36,7 @@ const crypto = require("crypto");
|
|
|
36
36
|
const zlib = require("zlib");
|
|
37
37
|
const { spawn, spawnSync } = require("child_process");
|
|
38
38
|
|
|
39
|
-
const VERSION = "0.2.
|
|
39
|
+
const VERSION = "0.2.6";
|
|
40
40
|
|
|
41
41
|
const DEFAULT_IMAGE = "python:3.12-slim";
|
|
42
42
|
const WORKSPACE = "/workspace"; // where the persistent workspace is mounted inside every box
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kern-sandbox",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.6",
|
|
4
4
|
"description": "kern is a fast, rootless sandbox and virtual resource runtime for any workload, including untrusted and AI-generated code; kern-sandbox is its Node/TypeScript binding. Run untrusted or agent-generated code (Python/JS/Bash) in a real, kernel-enforced box in single-digit milliseconds, with no cloud, no account and no VM.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"sandbox",
|