agent-neckbeard 1.1.21 → 1.1.23
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/CHANGELOG.md +9 -0
- package/README.md +9 -3
- package/dist/{chunk-FL7Y55YM.js → chunk-6P5I7ZCH.js} +10 -4
- package/dist/index.cjs +642 -17
- package/dist/index.d.cts +72 -5
- package/dist/index.d.ts +72 -5
- package/dist/index.js +628 -14
- package/dist/{invoke-client-D5TMTOYM.js → invoke-client-HIXYE2WN.js} +4 -0
- package/dist/supervisor.cjs +578 -920
- package/dist/supervisor.d.cts +1 -1
- package/dist/supervisor.d.ts +1 -1
- package/dist/supervisor.js +569 -917
- package/docs/DOCKER.md +94 -0
- package/docs/MODAL.md +163 -0
- package/docs/SUPERVISOR.md +11 -3
- package/package.json +10 -4
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 1.1.23 - 2026-10-18
|
|
6
|
+
|
|
7
|
+
- Upgrade the default Pi supervisor SDK to `@earendil-works/pi-coding-agent` 1.3.0. Callers that pin an older Pi SDK with `pi.expectedVersion` and `pi.packageLock` keep their prompt-rejection behavior.
|
|
8
|
+
|
|
9
|
+
## 1.1.22 - 2026-09-19
|
|
10
|
+
|
|
11
|
+
- Add a `modal` sandbox provider with private Connect Token HTTP auth and the shared managed detached controller; requires host Node.js 22+. See `docs/MODAL.md`.
|
|
12
|
+
- Add a `docker` sandbox provider for local development, evals, and CI. It uses the `docker` CLI without an SDK dependency, publishes no ports (HTTP goes through a loopback `docker exec` tunnel), keeps commands and secrets off host argv and `docker inspect`, can join an existing network, self-expires containers, and only removes containers it created. It is not an isolation boundary; see `docs/DOCKER.md`.
|
|
13
|
+
|
|
5
14
|
## 1.1.21 - 2026-09-08
|
|
6
15
|
|
|
7
16
|
- Preserve sandbox proxy and CA settings when launching agents, fixing Claude API certificate verification failures on Daytona.
|
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
# neckbeard
|
|
4
4
|
|
|
5
|
-
Neckbeard deploys your agent code into an E2B or
|
|
5
|
+
Neckbeard deploys your agent code into an E2B, Daytona, or Modal sandbox and runs it behind a small persistent HTTP server inside that sandbox.
|
|
6
6
|
|
|
7
7
|
The intent is simple: your production process should not run the agent. The sandbox runs the agent, keeps its filesystem/process state, and exposes a private `/invoke` endpoint that neckbeard calls for each turn.
|
|
8
8
|
|
|
@@ -10,11 +10,17 @@ This is designed to work from short-lived request handlers and long-running work
|
|
|
10
10
|
|
|
11
11
|
The host package requires Node.js `>=20.18.1 <21 || >=22`, matching the supported range of its E2B runtime dependency. Its esbuild runtime dependency requires Linux kernel 3.2 or later or macOS 12 or later on those platforms.
|
|
12
12
|
|
|
13
|
+
The Modal provider additionally requires host Node.js 22+ and `MODAL_TOKEN_ID` / `MODAL_TOKEN_SECRET` (or SDK profile credentials). Start with `sandbox: { provider: 'modal' }`; optional settings include `appName`, registry-image `template`, `environment`, `timeoutMs`, `cpu`, and `memoryMiB`. Modal uses private Connect Token HTTP auth and the shared managed detached controller. See [Modal configuration, limits, and live tests](docs/MODAL.md).
|
|
14
|
+
|
|
15
|
+
For local development, evals, and CI there is also `sandbox: { provider: 'docker' }`, which needs only the `docker` CLI and can join a compose network via `network`. It is not an isolation boundary and is not meant for production. See [Docker provider](docs/DOCKER.md).
|
|
16
|
+
|
|
17
|
+
The Modal adapter forces root, including for custom images. Claude Agent SDK consumers opting into `bypassPermissions` must explicitly forward `IS_SANDBOX: '1'` through `Agent.envs` for Claude's root-user check; Neckbeard does not enable this or bypass permissions by default. See the [Claude-on-Modal guide and example](docs/MODAL.md#claude-permissions-under-root) for the security implications and tested workaround.
|
|
18
|
+
|
|
13
19
|
The four primary usage patterns:
|
|
14
20
|
|
|
15
21
|
- Structured tasks: an agent runs once per background task and returns one validated output (Structured Tasks below).
|
|
16
22
|
- Attached sessions: a caller-owned session emits typed progress frames while work runs (Attached Sessions below).
|
|
17
|
-
- Direct sandbox access: `SandboxClient` wraps E2B and
|
|
23
|
+
- Direct sandbox access: `SandboxClient` wraps E2B, Daytona, and Modal behind one filesystem/command API, no agent required (Direct Sandbox Access below).
|
|
18
24
|
- Durable sessions: an opt-in generated supervisor owns Pi inside Daytona and reconnects outward to a long-lived gateway (Durable Sessions below).
|
|
19
25
|
|
|
20
26
|
`Agent.kind` reports `"task"` or `"session"`. The older `mode: "run" | "stream"` property remains as a deprecated compatibility surface.
|
|
@@ -346,7 +352,7 @@ try {
|
|
|
346
352
|
|
|
347
353
|
The artifact uses `attemptId` as its stable launch identity. The attempt credential must be an opaque 256-bit CSPRNG token encoded as canonical unpadded base64url (43 characters), matching Mission Control's credential generator; arbitrary passwords are rejected. Persist the sandbox ID and prepared process identity in the idempotent `beforeRelease` callback; returning from that callback is the authorization for the process to run. Replacing an exited generation invokes the callback with a new exact identity, which must replace the prior persisted identity; stale handles remain exactly fenced for stop, while diagnostic reads use before/after identity checks and may fail empty during replacement. A revision keyed by that high-entropy credential binds every replacement generation to the canonical launch environment without placing a dictionary-checkable value hash in lifecycle state, so rotating any value requires a replacement attempt instead of silently relaunching the old attempt with new credentials or configuration. A persistence failure is reported through the fixed, credential-safe `Supervisor prepared identity persistence failed.` message unless subsequent cleanup confirms that cancellation won. A confirmed cancellation proves the prepared generation cannot run and instead throws `SupervisorLaunchCancelledError` with stable code `NECKBEARD_SUPERVISOR_LAUNCH_CANCELLED`; its enumerable `name` and `code` remain usable when serialization preserves enumerable fields. A lost cleanup response is not classified as cancelled and remains safe to retry with the same attempt. If release already won, cancellation adopts the released identity instead of reporting a cancelled outcome. Terminal reconciliation must stop that persisted process identity and either delete the sandbox explicitly, as above, or apply an explicitly configured provider stop/delete policy. The supervisor embeds the pinned `@earendil-works/pi-coding-agent` SDK in-process, uses an outbound resumable WebSocket, attempt fencing, monotonic event IDs, a fsynced disk outbox, cumulative acknowledgments, command write-ahead deduplication, verified attachment materialization, normalized turn lifecycle, turn-boundary steering, heartbeat/reconnect, and idempotent interrupted-turn recovery. Its Daytona snapshot must provide Node.js 22.19.0 or newer. The artifact uploads graph-addressed staging files, then under one sandbox `flock` verifies their hashes, atomically publishes and fsyncs the final runtime/config/dependency files, and runs `npm ci`. After npm's graph and version checks, bootstrap creates a deterministic bounded manifest of every directory, regular file, and safe relative symlink in `node_modules`; it fsyncs regular files and directories bottom-up before atomically publishing and fsyncing that manifest, then re-verifies the finals and publishes the fsynced graph marker. The bootstrap lock remains necessary because a provider timeout does not prove the remote `npm ci` stopped; a retry may overlap the same shared installation. Bootstrap runs with an empty inherited environment, neutral npm user/global configuration, and no project `.npmrc`; failures expose only a bounded exit-code summary, never raw provider or install output. A marked retry skips `npm ci` only after verifying the final files and exact dependency graph plus a descriptor-bound read and full recomputation of the installed-tree manifest. An absent, malformed, unsafe, oversized, or content-mismatched manifest enters the existing locked repair path, while another graph fails without replacing it. Custom Pi coordinates require a caller-supplied matching credential-free lock. Credentials are never embedded in generated files or install commands; the gateway credential is removed before Pi loads, and the provider credential is moved into Pi's in-memory model runtime before tools run.
|
|
348
354
|
|
|
349
|
-
Each attempt's Pi JSONL history has a hard 64 MiB ceiling. Startup rejects a larger file or a legacy session version before the SDK parses or migrates it, and new prompts or steers are refused at 56 MiB so an already accepted turn has 8 MiB of logical headroom. Admission finishes with a synchronous retained-descriptor size check immediately before the Pi side effect. The pinned Pi 0
|
|
355
|
+
Each attempt's Pi JSONL history has a hard 64 MiB ceiling. Startup rejects a larger file or a legacy session version before the SDK parses or migrates it, and new prompts or steers are refused at 56 MiB so an already accepted turn has 8 MiB of logical headroom. Admission finishes with a synchronous retained-descriptor size check immediately before the Pi side effect. The pinned Pi 1.3.0 manager must remain in the append-only state established by the explicit session-file open; the guard serializes each pending JSONL line once, refuses a line that would cross the ceiling, writes those exact bytes through the retained descriptor, and verifies the exact size delta afterward. An unexpected private full-rewrite state fails before any write instead of estimating Pi's private in-memory history. Empty-file initialization is the only supported open-time rewrite; non-empty history must already use Pi session format version 3. Any append guard or postcondition failure terminally fails the attempt because Pi advances its in-memory tree before calling the persistence hook. Terminal history is file-fsynced plus parent-fsynced only while the canonical private leaf still matches the retained descriptor before and after that durability boundary. The 8 MiB margin is budgeting headroom for an accepted turn, not filesystem preallocation or a promise that every future record will fit; terminal/restart facts use the supervisor outbox's separate recovery reserve. Replace the attempt when prompt admission reaches this boundary.
|
|
350
356
|
|
|
351
357
|
For that cancellation outcome, `JSON.parse(JSON.stringify(error))` retains the public `name` and `code`. Arbitrary error serializers are not part of the contract.
|
|
352
358
|
|
|
@@ -200,7 +200,7 @@ var RELEASED_PATTERN = new RegExp(
|
|
|
200
200
|
"u"
|
|
201
201
|
);
|
|
202
202
|
var HANDLE_PATTERN = new RegExp(
|
|
203
|
-
`^(daytona|e2b)-process-v2:(\\d+):(\\d+):(\\d+):(${HASH_PATTERN}):(${HASH_PATTERN})$`,
|
|
203
|
+
`^(daytona|e2b|modal|docker)-process-v2:(\\d+):(\\d+):(\\d+):(${HASH_PATTERN}):(${HASH_PATTERN})$`,
|
|
204
204
|
"u"
|
|
205
205
|
);
|
|
206
206
|
function boundDetachedProcessLog(value) {
|
|
@@ -429,7 +429,7 @@ function parseDetachedCommand(sessionId) {
|
|
|
429
429
|
const match = HANDLE_PATTERN.exec(sessionId);
|
|
430
430
|
if (!match) return null;
|
|
431
431
|
const [, provider, pid, startTicks, processSessionId, launchKey, descriptorKey] = match;
|
|
432
|
-
if (provider !== "daytona" && provider !== "e2b" || !pid || !startTicks || !processSessionId || !launchKey || !descriptorKey || pid !== processSessionId) {
|
|
432
|
+
if (provider !== "daytona" && provider !== "e2b" && provider !== "modal" && provider !== "docker" || !pid || !startTicks || !processSessionId || !launchKey || !descriptorKey || pid !== processSessionId) {
|
|
433
433
|
return null;
|
|
434
434
|
}
|
|
435
435
|
return {
|
|
@@ -442,10 +442,16 @@ function parseDetachedCommand(sessionId) {
|
|
|
442
442
|
};
|
|
443
443
|
}
|
|
444
444
|
function hasDetachedProcessV2Prefix(sessionId) {
|
|
445
|
-
return /^(?:daytona|e2b)-process-v2/u.test(sessionId);
|
|
445
|
+
return /^(?:daytona|e2b|modal|docker)-process-v2/u.test(sessionId);
|
|
446
446
|
}
|
|
447
|
+
var DETACHED_PROCESS_PROVIDER_NAMES = {
|
|
448
|
+
daytona: "Daytona",
|
|
449
|
+
e2b: "E2B",
|
|
450
|
+
modal: "Modal",
|
|
451
|
+
docker: "Docker"
|
|
452
|
+
};
|
|
447
453
|
function detachedProcessProviderName(provider) {
|
|
448
|
-
return provider
|
|
454
|
+
return DETACHED_PROCESS_PROVIDER_NAMES[provider];
|
|
449
455
|
}
|
|
450
456
|
function resolveDetachedCommandForProvider(sessionId, expectedProvider, failure, commandId) {
|
|
451
457
|
const identity = parseDetachedCommand(sessionId);
|