agent-neckbeard 1.1.24 → 1.1.25

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 CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.1.25 - 2026-11-03
6
+
7
+ - Accept `autoStopInterval` and `autoDeleteInterval` in an `Agent`'s Daytona sandbox config and pass them to sandbox creation, as `SandboxClient.create()` already did. `new Agent()` rejects values that are not whole minutes. Omitting `autoDeleteInterval` still never auto-deletes the sandbox.
8
+ - Deprecate the durable-session supervisor (`agent-neckbeard/supervisor`) and mark its launch and lifecycle functions `@deprecated`. It is no longer maintained and will be removed in a future major release.
9
+
5
10
  ## 1.1.24 - 2026-10-22
6
11
 
7
12
  - Make an attached turn's iterator complete only after the runtime's `done` event. A stream that ends without it now throws `ExecutionError`, and a turn cancelled by the session signal, `stop()`, or `close()` rejects with the cancellation reason instead of ending as if the turn had finished.
package/README.md CHANGED
@@ -21,7 +21,7 @@ The four primary usage patterns:
21
21
  - Structured tasks: an agent runs once per background task and returns one validated output (Structured Tasks below).
22
22
  - Attached sessions: a caller-owned session emits typed progress frames while work runs (Attached Sessions below).
23
23
  - Direct sandbox access: `SandboxClient` wraps E2B, Daytona, and Modal behind one filesystem/command API, no agent required (Direct Sandbox Access below).
24
- - Durable sessions: an opt-in generated supervisor owns Pi inside Daytona and reconnects outward to a long-lived gateway (Durable Sessions below).
24
+ - Durable sessions (deprecated): an opt-in generated supervisor owns Pi inside Daytona and reconnects outward to a long-lived gateway (Durable Sessions below).
25
25
 
26
26
  `Agent.kind` reports `"task"` or `"session"`. The older `mode: "run" | "stream"` property remains as a deprecated compatibility surface.
27
27
 
@@ -136,6 +136,8 @@ new Agent({
136
136
 
137
137
  Set `networkBlockAll: true` only when you want to block all outbound network access. Daytona rejects `networkBlockAll: true` combined with non-empty allow lists.
138
138
 
139
+ `autoStopInterval` and `autoDeleteInterval` set the sandbox's Daytona lifecycle, in whole minutes, when the sandbox is created; reconnecting to an existing sandbox does not change them. Daytona stops a sandbox after `autoStopInterval` minutes without activity (`0` disables auto-stop; omitting it keeps Daytona's default, 15 minutes for standard sandbox classes) and deletes it `autoDeleteInterval` minutes after it stops (`0` deletes it immediately; `-1`, the default, never auto-deletes it).
140
+
139
141
  ## Structured Tasks
140
142
 
141
143
  Use `run` when each invocation should produce one validated output:
@@ -297,6 +299,8 @@ An application that reuses a sandbox can bound retained lifecycle state and diag
297
299
 
298
300
  ## Durable Sessions
299
301
 
302
+ > **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.
303
+
300
304
  Use `agent-neckbeard/supervisor` when a persistent sandbox process should own Pi while a separate gateway and lifecycle worker may restart independently:
301
305
 
302
306
  ```typescript
@@ -375,6 +379,8 @@ new Agent({
375
379
  networkBlockAll?: boolean,
376
380
  networkAllowList?: string,
377
381
  domainAllowList?: string,
382
+ autoStopInterval?: number,
383
+ autoDeleteInterval?: number,
378
384
  },
379
385
  inputSchema: ZodSchema,
380
386
  maxDuration?: number,
package/dist/index.cjs CHANGED
@@ -4468,6 +4468,15 @@ function validateAgentConfig(config) {
4468
4468
  } else if (typeof config.sandbox.template !== "string" || config.sandbox.template.trim() === "") {
4469
4469
  throw new ConfigurationError("sandbox.template must be a non-empty string.");
4470
4470
  }
4471
+ if (config.sandbox.provider === "daytona") {
4472
+ const { autoStopInterval, autoDeleteInterval } = config.sandbox;
4473
+ if (autoStopInterval !== void 0 && (!Number.isInteger(autoStopInterval) || autoStopInterval < 0)) {
4474
+ throw new ConfigurationError("sandbox.autoStopInterval must be a non-negative integer number of minutes.");
4475
+ }
4476
+ if (autoDeleteInterval !== void 0 && !Number.isInteger(autoDeleteInterval)) {
4477
+ throw new ConfigurationError("sandbox.autoDeleteInterval must be an integer number of minutes.");
4478
+ }
4479
+ }
4471
4480
  requireSchemaLike("inputSchema", config.inputSchema);
4472
4481
  if (config.maxDuration !== void 0 && (!Number.isFinite(config.maxDuration) || config.maxDuration <= 0)) {
4473
4482
  throw new ConfigurationError("maxDuration must be a positive finite number of seconds.");
@@ -5295,7 +5304,9 @@ var Agent = class {
5295
5304
  envs: this.sandboxEnv,
5296
5305
  networkBlockAll: sandbox.networkBlockAll,
5297
5306
  networkAllowList: sandbox.networkAllowList,
5298
- domainAllowList: sandbox.domainAllowList
5307
+ domainAllowList: sandbox.domainAllowList,
5308
+ autoStopInterval: sandbox.autoStopInterval,
5309
+ autoDeleteInterval: sandbox.autoDeleteInterval
5299
5310
  });
5300
5311
  }
5301
5312
  async connectSandboxHandle(sandboxId) {
@@ -5834,7 +5845,7 @@ var require = __neckbeard_createRequire(import.meta.url);
5834
5845
  }
5835
5846
  if (durability !== void 0 && durability !== "attached") {
5836
5847
  throw new ConfigurationError(
5837
- "Agent.createSession() creates caller-owned attached sessions. Use agent-neckbeard/supervisor durable-session APIs for gateway-owned sessions."
5848
+ "Agent.createSession() creates caller-owned attached sessions. Gateway-owned durable sessions use the deprecated agent-neckbeard/supervisor APIs."
5838
5849
  );
5839
5850
  }
5840
5851
  if (requestedSandboxId !== void 0 && (typeof requestedSandboxId !== "string" || requestedSandboxId.trim() === "")) {
package/dist/index.d.cts CHANGED
@@ -18,8 +18,8 @@ interface CreateAttachedSessionOptions {
18
18
  /**
19
19
  * Attached sessions are owned by this client process and stop when their
20
20
  * active request is cancelled. Durable sessions are launched through the
21
- * `agent-neckbeard/supervisor` entrypoint because their control plane must
22
- * outlive this object.
21
+ * deprecated `agent-neckbeard/supervisor` entrypoint because their control
22
+ * plane must outlive this object.
23
23
  */
24
24
  durability?: 'attached';
25
25
  /** Existing sandbox runtime to reconnect to. Defaults to the deployed sandbox. */
@@ -417,6 +417,18 @@ interface DaytonaSandboxConfig {
417
417
  * Example: '*.example.com,api.openai.com'
418
418
  */
419
419
  domainAllowList?: string;
420
+ /**
421
+ * Minutes without activity before Daytona stops the sandbox. `0` disables
422
+ * auto-stop. Omit it to keep Daytona's default (15 minutes for standard
423
+ * sandbox classes). Applied only when the sandbox is created.
424
+ */
425
+ autoStopInterval?: number;
426
+ /**
427
+ * Minutes after the sandbox stops before Daytona deletes it. `0` deletes it
428
+ * as soon as it stops; `-1`, the default, never auto-deletes it. Applied
429
+ * only when the sandbox is created.
430
+ */
431
+ autoDeleteInterval?: number;
420
432
  }
421
433
  type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig | ModalSandboxConfig | DockerSandboxConfig;
422
434
  /**
@@ -545,7 +557,7 @@ declare class SandboxClient {
545
557
  /** @deprecated Use `AgentKind` for user-facing task/session terminology. */
546
558
  type AgentMode = 'run' | 'stream';
547
559
  type AgentKind = 'task' | 'session';
548
- /** @deprecated Durable sessions use the separate supervisor deployment API. */
560
+ /** @deprecated Durable sessions use the separate, deprecated supervisor deployment API. */
549
561
  type SessionDurability = 'attached' | 'durable';
550
562
  declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
551
563
  readonly sandbox: SandboxConfig;
package/dist/index.d.ts CHANGED
@@ -18,8 +18,8 @@ interface CreateAttachedSessionOptions {
18
18
  /**
19
19
  * Attached sessions are owned by this client process and stop when their
20
20
  * active request is cancelled. Durable sessions are launched through the
21
- * `agent-neckbeard/supervisor` entrypoint because their control plane must
22
- * outlive this object.
21
+ * deprecated `agent-neckbeard/supervisor` entrypoint because their control
22
+ * plane must outlive this object.
23
23
  */
24
24
  durability?: 'attached';
25
25
  /** Existing sandbox runtime to reconnect to. Defaults to the deployed sandbox. */
@@ -417,6 +417,18 @@ interface DaytonaSandboxConfig {
417
417
  * Example: '*.example.com,api.openai.com'
418
418
  */
419
419
  domainAllowList?: string;
420
+ /**
421
+ * Minutes without activity before Daytona stops the sandbox. `0` disables
422
+ * auto-stop. Omit it to keep Daytona's default (15 minutes for standard
423
+ * sandbox classes). Applied only when the sandbox is created.
424
+ */
425
+ autoStopInterval?: number;
426
+ /**
427
+ * Minutes after the sandbox stops before Daytona deletes it. `0` deletes it
428
+ * as soon as it stops; `-1`, the default, never auto-deletes it. Applied
429
+ * only when the sandbox is created.
430
+ */
431
+ autoDeleteInterval?: number;
420
432
  }
421
433
  type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig | ModalSandboxConfig | DockerSandboxConfig;
422
434
  /**
@@ -545,7 +557,7 @@ declare class SandboxClient {
545
557
  /** @deprecated Use `AgentKind` for user-facing task/session terminology. */
546
558
  type AgentMode = 'run' | 'stream';
547
559
  type AgentKind = 'task' | 'session';
548
- /** @deprecated Durable sessions use the separate supervisor deployment API. */
560
+ /** @deprecated Durable sessions use the separate, deprecated supervisor deployment API. */
549
561
  type SessionDurability = 'attached' | 'durable';
550
562
  declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
551
563
  readonly sandbox: SandboxConfig;
package/dist/index.js CHANGED
@@ -1759,6 +1759,15 @@ function validateAgentConfig(config) {
1759
1759
  } else if (typeof config.sandbox.template !== "string" || config.sandbox.template.trim() === "") {
1760
1760
  throw new ConfigurationError("sandbox.template must be a non-empty string.");
1761
1761
  }
1762
+ if (config.sandbox.provider === "daytona") {
1763
+ const { autoStopInterval, autoDeleteInterval } = config.sandbox;
1764
+ if (autoStopInterval !== void 0 && (!Number.isInteger(autoStopInterval) || autoStopInterval < 0)) {
1765
+ throw new ConfigurationError("sandbox.autoStopInterval must be a non-negative integer number of minutes.");
1766
+ }
1767
+ if (autoDeleteInterval !== void 0 && !Number.isInteger(autoDeleteInterval)) {
1768
+ throw new ConfigurationError("sandbox.autoDeleteInterval must be an integer number of minutes.");
1769
+ }
1770
+ }
1762
1771
  requireSchemaLike("inputSchema", config.inputSchema);
1763
1772
  if (config.maxDuration !== void 0 && (!Number.isFinite(config.maxDuration) || config.maxDuration <= 0)) {
1764
1773
  throw new ConfigurationError("maxDuration must be a positive finite number of seconds.");
@@ -2586,7 +2595,9 @@ var Agent = class {
2586
2595
  envs: this.sandboxEnv,
2587
2596
  networkBlockAll: sandbox.networkBlockAll,
2588
2597
  networkAllowList: sandbox.networkAllowList,
2589
- domainAllowList: sandbox.domainAllowList
2598
+ domainAllowList: sandbox.domainAllowList,
2599
+ autoStopInterval: sandbox.autoStopInterval,
2600
+ autoDeleteInterval: sandbox.autoDeleteInterval
2590
2601
  });
2591
2602
  }
2592
2603
  async connectSandboxHandle(sandboxId) {
@@ -3125,7 +3136,7 @@ var require = __neckbeard_createRequire(import.meta.url);
3125
3136
  }
3126
3137
  if (durability !== void 0 && durability !== "attached") {
3127
3138
  throw new ConfigurationError(
3128
- "Agent.createSession() creates caller-owned attached sessions. Use agent-neckbeard/supervisor durable-session APIs for gateway-owned sessions."
3139
+ "Agent.createSession() creates caller-owned attached sessions. Gateway-owned durable sessions use the deprecated agent-neckbeard/supervisor APIs."
3129
3140
  );
3130
3141
  }
3131
3142
  if (requestedSandboxId !== void 0 && (typeof requestedSandboxId !== "string" || requestedSandboxId.trim() === "")) {
@@ -345,20 +345,26 @@ interface DurableSessionArtifact {
345
345
  interface SupervisorSandboxTarget extends SupervisorSandboxCapabilities {
346
346
  readonly provider: "daytona";
347
347
  }
348
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
348
349
  declare function createDurableSessionArtifact(options: CreateDurableSessionArtifactOptions): DurableSessionArtifact;
350
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
349
351
  declare function deployDurableSessionArtifact(sandbox: SupervisorSandboxTarget, artifact: DurableSessionArtifact, options: {
350
352
  envs: Record<string, string | undefined>;
351
353
  beforeRelease?: (command: SandboxDetachedCommand) => void | Promise<void>;
352
354
  }): Promise<SandboxDetachedCommand>;
353
- /** Validates every launch secret before any sandbox I/O occurs. */
355
+ /**
356
+ * Validates every launch secret before any sandbox I/O occurs.
357
+ *
358
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
359
+ */
354
360
  declare function validateDurableSessionDeploymentEnvironment(artifact: DurableSessionArtifact, source: Record<string, string | undefined>): Record<string, string>;
355
- /** @deprecated Use `CreateDurableSessionArtifactOptions`. */
361
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
356
362
  type CreatePiSupervisorArtifactOptions = CreateDurableSessionArtifactOptions;
357
- /** @deprecated Use `DurableSessionArtifact`. */
363
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
358
364
  type PiSupervisorArtifact = DurableSessionArtifact;
359
- /** @deprecated Use `createDurableSessionArtifact()`. */
365
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
360
366
  declare const createPiSupervisorArtifact: typeof createDurableSessionArtifact;
361
- /** @deprecated Use `deployDurableSessionArtifact()`. */
367
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
362
368
  declare const deploySupervisorArtifact: typeof deployDurableSessionArtifact;
363
369
 
364
370
  interface DaytonaCommandResult {
@@ -398,18 +404,24 @@ interface DaytonaSupervisorSandboxTargetOptions {
398
404
  * Stops the exact managed Daytona supervisor process and resolves only after
399
405
  * the detached controller confirms exit. This does not remove lifecycle state
400
406
  * or captured diagnostics.
407
+ *
408
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
401
409
  */
402
410
  declare function stopDaytonaSupervisorSession(sandbox: DaytonaCommandTransport, command: SandboxDetachedCommand, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<void>;
403
411
  /**
404
412
  * Irreversibly removes lifecycle state and diagnostics for an exactly stopped
405
413
  * managed Daytona supervisor process. Call `stopDaytonaSupervisorSession()`
406
414
  * first; this operation is cleanup, not process-liveness proof.
415
+ *
416
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
407
417
  */
408
418
  declare function disposeDaytonaSupervisorSessionArtifacts(sandbox: DaytonaCommandTransport, command: SandboxDetachedCommand, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<void>;
409
419
  /**
410
420
  * Adapts an already-connected Daytona sandbox to the narrow deployment target
411
421
  * used by `deployDurableSessionArtifact()`. The returned target owns no client
412
422
  * connection and does not create, start, stop, or delete the sandbox.
423
+ *
424
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
413
425
  */
414
426
  declare function createDaytonaSupervisorSandboxTarget(sandbox: DaytonaSupervisorSandbox, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<SupervisorSandboxTarget>;
415
427
 
@@ -345,20 +345,26 @@ interface DurableSessionArtifact {
345
345
  interface SupervisorSandboxTarget extends SupervisorSandboxCapabilities {
346
346
  readonly provider: "daytona";
347
347
  }
348
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
348
349
  declare function createDurableSessionArtifact(options: CreateDurableSessionArtifactOptions): DurableSessionArtifact;
350
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
349
351
  declare function deployDurableSessionArtifact(sandbox: SupervisorSandboxTarget, artifact: DurableSessionArtifact, options: {
350
352
  envs: Record<string, string | undefined>;
351
353
  beforeRelease?: (command: SandboxDetachedCommand) => void | Promise<void>;
352
354
  }): Promise<SandboxDetachedCommand>;
353
- /** Validates every launch secret before any sandbox I/O occurs. */
355
+ /**
356
+ * Validates every launch secret before any sandbox I/O occurs.
357
+ *
358
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
359
+ */
354
360
  declare function validateDurableSessionDeploymentEnvironment(artifact: DurableSessionArtifact, source: Record<string, string | undefined>): Record<string, string>;
355
- /** @deprecated Use `CreateDurableSessionArtifactOptions`. */
361
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
356
362
  type CreatePiSupervisorArtifactOptions = CreateDurableSessionArtifactOptions;
357
- /** @deprecated Use `DurableSessionArtifact`. */
363
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
358
364
  type PiSupervisorArtifact = DurableSessionArtifact;
359
- /** @deprecated Use `createDurableSessionArtifact()`. */
365
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
360
366
  declare const createPiSupervisorArtifact: typeof createDurableSessionArtifact;
361
- /** @deprecated Use `deployDurableSessionArtifact()`. */
367
+ /** @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release. */
362
368
  declare const deploySupervisorArtifact: typeof deployDurableSessionArtifact;
363
369
 
364
370
  interface DaytonaCommandResult {
@@ -398,18 +404,24 @@ interface DaytonaSupervisorSandboxTargetOptions {
398
404
  * Stops the exact managed Daytona supervisor process and resolves only after
399
405
  * the detached controller confirms exit. This does not remove lifecycle state
400
406
  * or captured diagnostics.
407
+ *
408
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
401
409
  */
402
410
  declare function stopDaytonaSupervisorSession(sandbox: DaytonaCommandTransport, command: SandboxDetachedCommand, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<void>;
403
411
  /**
404
412
  * Irreversibly removes lifecycle state and diagnostics for an exactly stopped
405
413
  * managed Daytona supervisor process. Call `stopDaytonaSupervisorSession()`
406
414
  * first; this operation is cleanup, not process-liveness proof.
415
+ *
416
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
407
417
  */
408
418
  declare function disposeDaytonaSupervisorSessionArtifacts(sandbox: DaytonaCommandTransport, command: SandboxDetachedCommand, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<void>;
409
419
  /**
410
420
  * Adapts an already-connected Daytona sandbox to the narrow deployment target
411
421
  * used by `deployDurableSessionArtifact()`. The returned target owns no client
412
422
  * connection and does not create, start, stop, or delete the sandbox.
423
+ *
424
+ * @deprecated The durable-session supervisor is no longer maintained and will be removed in a future major release.
413
425
  */
414
426
  declare function createDaytonaSupervisorSandboxTarget(sandbox: DaytonaSupervisorSandbox, targetOptions?: DaytonaSupervisorSandboxTargetOptions): Promise<SupervisorSandboxTarget>;
415
427
 
@@ -1,5 +1,7 @@
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.
4
+
3
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()`.
4
6
 
5
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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agent-neckbeard",
3
- "version": "1.1.24",
3
+ "version": "1.1.25",
4
4
  "description": "Deploy AI agents to E2B, Daytona, and Modal sandboxes, or local Docker containers",
5
5
  "type": "module",
6
6
  "exports": {