kern-sandbox 0.1.41 → 0.1.43
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 -0
- package/index.js +14 -5
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -242,6 +242,11 @@ so a `runCode` claims one instead of paying for a box start plus an interpreter
|
|
|
242
242
|
`python:3.12-slim`, six calls each: **14.2 ms p50 by default against 0.8 ms with `prewarm: 4`**, and
|
|
243
243
|
30.9 ms against 0.9 for the first call.
|
|
244
244
|
|
|
245
|
+
**The pool also fills on that worker thread, so the first call is fast only once it HAS filled.**
|
|
246
|
+
Measured: constructing with `prewarm: 4` and calling immediately gives 13.7 ms five times over,
|
|
247
|
+
while half a second later the same burst reads 0.8, 0.6, 0.5, 0.6 for the first four and then
|
|
248
|
+
32.7 for the fifth, the pool empty. The table is the steady state, not the first moment.
|
|
249
|
+
|
|
245
250
|
The refill runs while your agent thinks, so it is off the caller's clock. That also says when it buys
|
|
246
251
|
nothing: if calls arrive faster than the pool refills, the pool empties and you are back to the
|
|
247
252
|
default cost. N is the burst you want covered, not a throughput knob.
|
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.1.
|
|
39
|
+
const VERSION = "0.1.43";
|
|
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
|
|
@@ -594,12 +594,21 @@ function findKern() {
|
|
|
594
594
|
throw new SandboxError(
|
|
595
595
|
"the `kern` binary was not found on PATH, and this is macOS: kern is Linux-only " +
|
|
596
596
|
"(no namespaces, no cgroups on a Mac), so there is no macOS build to find. " +
|
|
597
|
-
"Run inside a Linux VM (colima, Lima, OrbStack, UTM)
|
|
598
|
-
"
|
|
597
|
+
"Run inside a Linux VM (colima, Lima, OrbStack, UTM) and install it there with:\n" +
|
|
598
|
+
" curl -fsSL https://raw.githubusercontent.com/getkern/kern/main/install.sh | sh\n" +
|
|
599
|
+
"or set $KERN_BIN to a kern reachable from here.",
|
|
599
600
|
);
|
|
601
|
+
// THE COMMAND, NOT A LINK. `npm install kern-sandbox` does NOT bring the binary: this package is a
|
|
602
|
+
// wrapper around a process it does not ship, and the moment a user meets that fact is this error.
|
|
603
|
+
// It used to answer with a repository URL, which asks someone one paste away from working to go
|
|
604
|
+
// and read a page first. The same sentence the Python binding gives, deliberately: two wrappers
|
|
605
|
+
// around one runtime must not disagree about how to get it, and the installer line is the one the
|
|
606
|
+
// project's README leads with.
|
|
600
607
|
throw new SandboxError(
|
|
601
|
-
"the `kern` binary was not found on PATH
|
|
602
|
-
"
|
|
608
|
+
"the `kern` binary was not found on PATH. `npm install kern-sandbox` installs this wrapper, " +
|
|
609
|
+
"not the runtime it drives - install kern with:\n" +
|
|
610
|
+
" curl -fsSL https://raw.githubusercontent.com/getkern/kern/main/install.sh | sh\n" +
|
|
611
|
+
"or point $KERN_BIN at a kern you already have.",
|
|
603
612
|
);
|
|
604
613
|
}
|
|
605
614
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kern-sandbox",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.43",
|
|
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",
|