agent-neckbeard 1.1.12 → 1.1.14

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 CHANGED
@@ -71,13 +71,13 @@ const nextConfig = withNeckbeardNextConfig({
71
71
  // your existing Next config
72
72
  }, {
73
73
  routeGlob: '/api/my-agent',
74
- sourceFiles: ['./packages/my-agent/src/**/*'],
74
+ sourceFiles: ['./packages/my-agent/src/agent.ts'],
75
75
  });
76
76
 
77
77
  export default nextConfig;
78
78
  ```
79
79
 
80
- For Next 13 configs that still use `experimental.serverComponentsExternalPackages`, the helper automatically uses the matching experimental tracing fields when it sees that shape. Set `outputFileTracingRoot` when the agent source is outside the app root.
80
+ The helper traces files imported by those source entries by default, including package entry metadata that `deploy()` needs when it rebundles the agent at runtime. For Next 13 configs that still use `experimental.serverComponentsExternalPackages`, the helper automatically uses the matching experimental tracing fields when it sees that shape. Set `outputFileTracingRoot` when the agent source is outside the app root.
81
81
 
82
82
  This repo tests that shape locally with `npm run test:compat:next`, which builds and runs a Dockerized Next App Router fixture without pushing to Vercel. The fixture also checks the runtime env contract, Node major, and traced standalone files so source-level tests do not mask deployment artifact problems.
83
83
 
@@ -174,6 +174,35 @@ const result = await agent.run({ topic: 'hello' }, { sandboxId: savedSandboxId }
174
174
 
175
175
  Neckbeard rehydrates the sandbox endpoint and provider traffic token from the sandbox ID using the configured provider SDK. E2B traffic tokens are sent as the `e2b-traffic-access-token` header. Daytona preview tokens are sent as the `DAYTONA_SANDBOX_AUTH_KEY` query parameter. Consumers only need to store the sandbox ID and configure the same provider/API key in the process that reconnects.
176
176
 
177
+ ### Environment Changes with Reused Sandboxes
178
+
179
+ `envs` are applied when Neckbeard creates the sandbox and starts the sandbox server. If the host app was missing a required value such as `ANTHROPIC_API_KEY` when the sandbox was created, the sandbox can remain healthy but unauthenticated even after you fix the host environment and redeploy the app.
180
+
181
+ Updating Vercel, Render, or 1Password environment variables does not mutate already-running sandboxes. Kill the old sandbox or deploy a fresh one and replace the persisted sandbox ID. Consumers that keep long-lived sandbox IDs should treat authentication failures such as `Not logged in` or `Please run /login` as a signal to discard the sandbox after verifying the host environment is now correct.
182
+
183
+ ## Direct Sandbox Access
184
+
185
+ Use `SandboxClient` when host code needs provider-neutral filesystem or command access without running an agent invocation:
186
+
187
+ ```typescript
188
+ import { SandboxClient } from 'agent-neckbeard';
189
+
190
+ const sandbox = await SandboxClient.connect({
191
+ provider: 'e2b',
192
+ sandboxId,
193
+ timeoutMs: 30 * 60 * 1000,
194
+ });
195
+
196
+ await sandbox.makeDir('/home/user/documents');
197
+ await sandbox.writeFile('/home/user/documents/input.txt', 'hello');
198
+ const result = await sandbox.runCommand('ls documents', {
199
+ cwd: '/home/user',
200
+ timeoutMs: 60_000,
201
+ });
202
+ ```
203
+
204
+ `SandboxClient.create()` and `SandboxClient.connect()` support E2B and Daytona. E2B supports `setTimeout()` for sandbox lifetime extension; providers without that lifecycle primitive throw a `ConfigurationError`.
205
+
177
206
  ## Configuration
178
207
 
179
208
  ```typescript