agent-neckbeard 1.1.27 → 1.1.28

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/docs/MODAL.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Modal Provider
2
2
 
3
- Modal is supported by both `Agent` and `SandboxClient`. It requires **Node.js 22 or later on the host** and uses the `modal` JavaScript SDK, pinned to the 0.10 release line. E2B and Daytona retain the package's existing host Node.js support.
3
+ Modal is supported by both `LegacyBundledAgent` and `SandboxClient`. It requires **Node.js 22 or later on the host** and uses the `modal` JavaScript SDK, pinned to the 0.10 release line. E2B and Daytona retain the package's existing host Node.js support.
4
4
 
5
5
  ## Configuration
6
6
 
@@ -43,19 +43,21 @@ All settings except `provider` are optional:
43
43
  | `networkBlockAll` | `false` | Block all outbound traffic; cannot be combined with non-empty allow lists |
44
44
  | `networkAllowList` | unset | Comma-separated CIDR ranges the sandbox may reach, any protocol |
45
45
  | `domainAllowList` | unset | Comma-separated domains the sandbox may reach over HTTPS; `*.` wildcards match the domain and its subdomains |
46
+ | `command` | unset | `SandboxClient.create()` only: runs as the sandbox's main process and uses `template` as-is, without the setup layer below. `Agent` uses it for prebuilt images |
47
+ | `registrySecret` | unset | `SandboxClient.create()` only: name of a Modal Secret with `REGISTRY_USERNAME` and `REGISTRY_PASSWORD`, to pull a private `template` |
46
48
 
47
- The adapter extends the registry image with `USER root`, Bash, Python 3, util-linux (`flock`/`setsid`), coreutils, sudo, curl, and CA certificates. **It forces root for both setup and payload execution, even if your custom image declares a non-root user.** There is currently no user override. Custom images must support `apt-get` and provide a compatible Node.js/npm installation for `Agent`. The runtime starts with a fixed `PATH`, so when the image's `node`, `npm`, or `npx` resolve elsewhere, such as an nvm install, the adapter links them into `/usr/local/bin`. Home and work directories are `/root`; runtime files live in `/root/agent`. The first image build can add latency; Modal caches image layers.
49
+ The adapter extends the registry image with `USER root`, Bash, Python 3, util-linux (`flock`/`setsid`), coreutils, sudo, curl, and CA certificates. **It forces root for both setup and payload execution, even if your custom image declares a non-root user.** There is currently no user override. Custom images must support `apt-get` and provide a compatible Node.js/npm installation for `LegacyBundledAgent`. The runtime starts with a fixed `PATH`, so when the image's `node`, `npm`, or `npx` resolve elsewhere, such as an nvm install, the adapter links them into `/usr/local/bin`. Home and work directories are `/root`; runtime files live in `/root/agent`. The first image build can add latency; Modal caches image layers.
48
50
 
49
- Use the same sandbox settings in an Agent:
51
+ Use the same sandbox settings in a `LegacyBundledAgent`:
50
52
 
51
53
  ```typescript
52
- const agent = new Agent({
54
+ const agent = new LegacyBundledAgent({
53
55
  sandbox: { provider: 'modal', appName: 'my-agents', timeoutMs: 3_600_000 },
54
56
  // sourceFile, inputSchema, outputSchema, run, etc.
55
57
  });
56
58
  ```
57
59
 
58
- `SandboxClient.create()` additionally accepts `envs` and an explicit `tokenId` / `tokenSecret` pair. Both credentials must be supplied together. `Agent` deliberately uses host SDK credentials rather than storing them in agent config.
60
+ `SandboxClient.create()` additionally accepts `envs` and an explicit `tokenId` / `tokenSecret` pair. Both credentials must be supplied together. `LegacyBundledAgent` deliberately uses host SDK credentials rather than storing them in agent config.
59
61
 
60
62
  Reconnect from a different host using only the persisted sandbox ID and credentials for the same workspace:
61
63
 
@@ -67,19 +69,19 @@ const sandbox = await SandboxClient.connect({
67
69
  });
68
70
  ```
69
71
 
70
- Reconnect does not create a replacement sandbox, restart a terminated sandbox, or extend its lifetime. Creation-only options are rejected on connect. `Agent.run(..., { sandboxId })` and attached sessions reconnect and recover the HTTP runtime using the existing shared lifecycle.
72
+ Reconnect does not create a replacement sandbox, restart a terminated sandbox, or extend its lifetime. Creation-only options are rejected on connect. `LegacyBundledAgent.run(..., { sandboxId })` and attached sessions reconnect and recover the HTTP runtime using the existing shared lifecycle.
71
73
 
72
74
  ## Claude Permissions Under Root
73
75
 
74
- For a consumer using Claude Agent SDK with `permissionMode: 'bypassPermissions'` in this root-based Modal image, explicitly set **`Agent.envs: { IS_SANDBOX: '1' }`** in addition to the SDK's permission options. Otherwise Claude's root-user check can reject `--dangerously-skip-permissions`. Consumer direct-agent acceptance succeeded after this explicit workaround; it is not something the provider enables automatically.
76
+ For a consumer using Claude Agent SDK with `permissionMode: 'bypassPermissions'` in this root-based Modal image, explicitly set **`LegacyBundledAgent.envs: { IS_SANDBOX: '1' }`** in addition to the SDK's permission options. Otherwise Claude's root-user check can reject `--dangerously-skip-permissions`. Consumer direct-agent acceptance succeeded after this explicit workaround; it is not something the provider enables automatically.
75
77
 
76
78
  ```typescript
77
79
  import { fileURLToPath } from 'node:url';
78
- import { Agent } from 'agent-neckbeard';
80
+ import { LegacyBundledAgent } from 'agent-neckbeard';
79
81
  import { query } from '@anthropic-ai/claude-agent-sdk';
80
82
  import { z } from 'zod';
81
83
 
82
- export const claudeAgent = new Agent({
84
+ export const claudeAgent = new LegacyBundledAgent({
83
85
  sourceFile: fileURLToPath(import.meta.url),
84
86
  sandbox: { provider: 'modal', timeoutMs: 600_000 },
85
87
  envs: {
@@ -106,7 +108,7 @@ export const claudeAgent = new Agent({
106
108
  });
107
109
  ```
108
110
 
109
- From your host caller, deploy/run inside `try/finally` and call `await claudeAgent.kill()` in `finally`. Install and pin your supported Claude Agent SDK and schema dependency in that consumer. Do not put Modal provider credentials in `Agent.envs`.
111
+ From your host caller, deploy/run inside `try/finally` and call `await claudeAgent.kill()` in `finally`. Install and pin your supported Claude Agent SDK and schema dependency in that consumer. Do not put Modal provider credentials in `LegacyBundledAgent.envs`.
110
112
 
111
113
  Bypassing permissions allows agent tool execution without interactive approval, as root inside this image. Opt in only when that matches your application's trust and isolation policy. `IS_SANDBOX` is a CLI compatibility hint, not an isolation mechanism: it does not drop root privileges or replace tool restrictions, network policy, or private HTTP authentication. For permission-restricted agents, configure the appropriate Claude permission mode instead; the provider does not add bypass settings or `IS_SANDBOX` by default.
112
114
 
@@ -125,7 +127,7 @@ No encrypted or unencrypted public tunnels are created. The adapter obtains a po
125
127
  - Detached commands use the existing `DetachedProcessController`, not a bare background exec/PID handle. Prepare/release fencing, `beforeRelease`, stable `launchId` adoption, clean lifecycle environment, descriptor-based payload environment handoff, process-tree stop confirmation, bounded diagnostic logs, and exact-generation artifact disposal are unchanged.
126
128
  - Persist the complete `SandboxDetachedCommand` returned by `startDetachedCommand()`. Modal handles use the `modal-process-v2:` ownership prefix and the existing on-disk V3 lifecycle protocol. Foreign, malformed, and legacy/native handles are rejected before provider I/O.
127
129
  - Stop first, optionally read final diagnostics, then dispose artifacts. Disposal is irreversible and does not replace exact stop confirmation. Do not call stop after disposal; the proof required to stop has intentionally been removed.
128
- - `destroy()` waits for Modal termination and tolerates a provider not-found response. Other provider failures still reject. Failed `Agent.deploy()` attempts retain the shared best-effort stop/destroy cleanup and preserve the original error.
130
+ - `destroy()` waits for Modal termination and tolerates a provider not-found response. Other provider failures still reject. Failed `LegacyBundledAgent.deploy()` attempts retain the shared best-effort stop/destroy cleanup and preserve the original error.
129
131
 
130
132
  ## Region Selection
131
133
 
@@ -147,7 +149,7 @@ The separate public durable Pi supervisor target remains Daytona-specific. This
147
149
 
148
150
  ## Next.js and Live Tests
149
151
 
150
- Use `withNeckbeardNextConfig(...)` and an explicit Agent `sourceFile` as usual. The helper externalizes both `agent-neckbeard` and `modal`; package builds also leave the Modal SDK external. No SDK client is created merely by importing Neckbeard. Use Node.js 22+ for Modal routes/workers.
152
+ Use `withNeckbeardNextConfig(...)` and an explicit `LegacyBundledAgent` `sourceFile` as usual. The helper externalizes both `agent-neckbeard` and `modal`; package builds also leave the Modal SDK external. No SDK client is created merely by importing Neckbeard. Use Node.js 22+ for Modal routes/workers.
151
153
 
152
154
  ```bash
153
155
  npm test -- --runInBand tests/unit/modal.test.ts tests/unit/modal-resources.test.ts tests/unit/modal-config.test.ts
@@ -1,8 +1,8 @@
1
1
  # Durable Sessions (Sandbox Supervisor)
2
2
 
3
- > **Deprecated.** The durable-session supervisor is no longer maintained and will be removed in a future major release. Attached sessions (`Agent.createSession()`) remain supported, but they are not durable: a turn stops when its caller disconnects, and nothing is replayed.
3
+ > **Deprecated.** The durable-session supervisor is no longer maintained and will be removed in a future major release. Attached sessions (`LegacyBundledAgent.createSession()`) remain supported, but they are not durable: a turn stops when its caller disconnects, and nothing is replayed.
4
4
 
5
- The sandbox supervisor is the implementation of Neckbeard's opt-in durable-session runtime. It is separate from the attached HTTP/SSE session transport: importing `agent-neckbeard/supervisor` does not change `Agent.deploy()`, `run()`, `createSession()`, the deprecated `invoke()` wrapper, or `kill()`.
5
+ The sandbox supervisor is the implementation of Neckbeard's opt-in durable-session runtime. It is separate from the attached HTTP/SSE session transport: importing `agent-neckbeard/supervisor` does not change `LegacyBundledAgent.deploy()`, `run()`, `createSession()`, the deprecated `invoke()` wrapper, or `kill()`.
6
6
 
7
7
  The v1 adapter embeds Pi through `@earendil-works/pi-coding-agent`'s structured SDK. The generated Node runtime connects outward from a Daytona sandbox to a WebSocket gateway, journals durable events before sending them, and lets an accepted Pi turn continue when the gateway or Hatchet worker disconnects.
8
8
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-neckbeard",
3
- "version": "1.1.27",
3
+ "version": "1.1.28",
4
4
  "description": "Deploy AI agents to E2B, Daytona, and Modal sandboxes, or local Docker containers",
5
5
  "type": "module",
6
6
  "exports": {
@@ -23,8 +23,31 @@
23
23
  "types": "./dist/supervisor.d.cts",
24
24
  "default": "./dist/supervisor.cjs"
25
25
  }
26
+ },
27
+ "./serve": {
28
+ "import": {
29
+ "types": "./dist/serve.d.ts",
30
+ "default": "./dist/serve.js"
31
+ },
32
+ "require": {
33
+ "types": "./dist/serve.d.cts",
34
+ "default": "./dist/serve.cjs"
35
+ }
36
+ },
37
+ "./build": {
38
+ "import": {
39
+ "types": "./dist/build.d.ts",
40
+ "default": "./dist/build.js"
41
+ },
42
+ "require": {
43
+ "types": "./dist/build.d.cts",
44
+ "default": "./dist/build.cjs"
45
+ }
26
46
  }
27
47
  },
48
+ "bin": {
49
+ "neckbeard": "./dist/cli.js"
50
+ },
28
51
  "main": "./dist/index.cjs",
29
52
  "module": "./dist/index.js",
30
53
  "types": "./dist/index.d.cts",
@@ -34,7 +57,11 @@
34
57
  "CHANGELOG.md",
35
58
  "docs/SUPERVISOR.md",
36
59
  "docs/MODAL.md",
37
- "docs/DOCKER.md"
60
+ "docs/DOCKER.md",
61
+ "docs/AGENT.md",
62
+ "docs/DAYTONA.md",
63
+ "docs/E2B.md",
64
+ "docs/LEGACY.md"
38
65
  ],
39
66
  "engines": {
40
67
  "node": ">=20.18.1 <21 || >=22"
@@ -67,18 +94,31 @@
67
94
  "esbuild": "^0.28.2",
68
95
  "modal": "^0.10.0"
69
96
  },
97
+ "optionalDependencies": {
98
+ "skills": "1.8.1"
99
+ },
70
100
  "peerDependencies": {
71
- "zod": "^3.0.0 || ^4.0.0"
101
+ "zod": "^3.0.0 || ^4.0.0",
102
+ "@earendil-works/pi-coding-agent": ">=1.3.0 <2.0.0",
103
+ "braintrust": ">=3.44.0 <4.0.0"
72
104
  },
73
105
  "peerDependenciesMeta": {
74
106
  "zod": {
75
107
  "optional": true
108
+ },
109
+ "@earendil-works/pi-coding-agent": {
110
+ "optional": true
111
+ },
112
+ "braintrust": {
113
+ "optional": true
76
114
  }
77
115
  },
78
116
  "devDependencies": {
117
+ "@earendil-works/pi-coding-agent": "1.5.2",
79
118
  "@grpc/grpc-js": "^1.14.4",
80
119
  "@types/jest": "^30.0.0",
81
120
  "@types/node": "^22.0.0",
121
+ "braintrust": "3.44.0",
82
122
  "dotenv": "^17.3.1",
83
123
  "jest": "^30.3.0",
84
124
  "ts-jest": "^29.4.6",
@@ -1,48 +0,0 @@
1
- import {
2
- isSerializedError
3
- } from "./chunk-33IXN6MM.js";
4
-
5
- // src/runtime/protocol.ts
6
- var RUNTIME_PROTOCOL_VERSION = 1;
7
- var RUNTIME_ABORT_GRACE_MS = 1e4;
8
- function isHarnessEvent(value) {
9
- if (!value || typeof value !== "object") return false;
10
- const candidate = value;
11
- if (typeof candidate.kind !== "string") return false;
12
- if (typeof candidate.invocationId !== "string") return false;
13
- if (!hasValidMetadata(candidate)) return false;
14
- switch (candidate.kind) {
15
- case "started":
16
- case "done":
17
- return true;
18
- case "frame":
19
- return Object.hasOwn(candidate, "data");
20
- case "output":
21
- return Object.hasOwn(candidate, "output");
22
- case "error":
23
- return isSerializedError(candidate.error);
24
- default:
25
- return false;
26
- }
27
- }
28
- function hasValidMetadata(candidate) {
29
- if (candidate.protocolVersion !== void 0 && candidate.protocolVersion !== RUNTIME_PROTOCOL_VERSION) {
30
- return false;
31
- }
32
- if (candidate.sequence !== void 0 && typeof candidate.sequence !== "number") {
33
- return false;
34
- }
35
- if (candidate.timestamp !== void 0 && typeof candidate.timestamp !== "string") {
36
- return false;
37
- }
38
- if (candidate.elapsedMs !== void 0 && typeof candidate.elapsedMs !== "number") {
39
- return false;
40
- }
41
- return true;
42
- }
43
-
44
- export {
45
- RUNTIME_PROTOCOL_VERSION,
46
- RUNTIME_ABORT_GRACE_MS,
47
- isHarnessEvent
48
- };