agent-neckbeard 1.1.21 → 1.1.22
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 +5 -0
- package/README.md +8 -2
- 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 +10 -4
- package/dist/supervisor.js +1 -1
- package/docs/DOCKER.md +94 -0
- package/docs/MODAL.md +163 -0
- package/package.json +10 -4
package/dist/index.d.cts
CHANGED
|
@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
|
|
|
2
2
|
import { S as SandboxFileContent$1, a as SandboxCommandOptions, b as SandboxCommandResult, c as SandboxDetachedCommandOptions, d as SandboxDetachedCommand } from './sandbox-capabilities-CFjnZ_kB.cjs';
|
|
3
3
|
|
|
4
4
|
/** Sandbox providers supported by the public and in-sandbox runtimes. */
|
|
5
|
-
type SandboxProvider = 'e2b' | 'daytona';
|
|
5
|
+
type SandboxProvider = 'e2b' | 'daytona' | 'modal' | 'docker';
|
|
6
6
|
/** Paths shared by host, runtime, and provider sandbox contexts. */
|
|
7
7
|
interface SandboxContext {
|
|
8
8
|
provider: SandboxProvider;
|
|
@@ -42,6 +42,53 @@ interface AttachedAgentSession<TInput, TFrame> {
|
|
|
42
42
|
close(): Promise<void>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
interface ModalSandboxConfig {
|
|
46
|
+
provider: 'modal';
|
|
47
|
+
/** Public Debian-compatible registry image; defaults to node:22-bookworm. */
|
|
48
|
+
template?: string;
|
|
49
|
+
/** Modal App name; created if missing. Defaults to agent-neckbeard. */
|
|
50
|
+
appName?: string;
|
|
51
|
+
environment?: string;
|
|
52
|
+
/** Fixed lifetime, whole-second milliseconds from 1000 to 86400000; defaults to one hour. */
|
|
53
|
+
timeoutMs?: number;
|
|
54
|
+
cpu?: number;
|
|
55
|
+
memoryMiB?: number;
|
|
56
|
+
}
|
|
57
|
+
interface ModalClientCredentials {
|
|
58
|
+
tokenId?: string;
|
|
59
|
+
tokenSecret?: string;
|
|
60
|
+
environment?: string;
|
|
61
|
+
}
|
|
62
|
+
type ModalSandboxCreateOptions = ModalSandboxConfig & ModalClientCredentials & {
|
|
63
|
+
envs?: Record<string, string | undefined>;
|
|
64
|
+
};
|
|
65
|
+
type ModalSandboxConnectOptions = ModalClientCredentials & {
|
|
66
|
+
provider: 'modal';
|
|
67
|
+
sandboxId: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
interface DockerSandboxConfig {
|
|
71
|
+
provider: 'docker';
|
|
72
|
+
/** Debian-compatible image with Node.js/npm for `Agent`; defaults to node:22-bookworm. */
|
|
73
|
+
template?: string;
|
|
74
|
+
/** Existing Docker network to join, e.g. a compose project network. */
|
|
75
|
+
network?: string;
|
|
76
|
+
/** Image platform such as linux/amd64; defaults to the daemon's native platform. */
|
|
77
|
+
platform?: string;
|
|
78
|
+
/** Fixed lifetime, whole-second milliseconds up to 24 hours; the container removes itself afterwards. Defaults to one hour. */
|
|
79
|
+
timeoutMs?: number;
|
|
80
|
+
cpu?: number;
|
|
81
|
+
memoryMiB?: number;
|
|
82
|
+
}
|
|
83
|
+
type DockerSandboxCreateOptions = DockerSandboxConfig & {
|
|
84
|
+
envs?: Record<string, string | undefined>;
|
|
85
|
+
};
|
|
86
|
+
interface DockerSandboxConnectOptions {
|
|
87
|
+
provider: 'docker';
|
|
88
|
+
/** Container ID or name, used verbatim as the handle ID. Containers not created by this provider are never removed by it. */
|
|
89
|
+
sandboxId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
45
92
|
/**
|
|
46
93
|
* agent-neckbeard - Deploy AI agents to sandboxes
|
|
47
94
|
*/
|
|
@@ -369,7 +416,7 @@ interface DaytonaSandboxConfig {
|
|
|
369
416
|
*/
|
|
370
417
|
domainAllowList?: string;
|
|
371
418
|
}
|
|
372
|
-
type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
|
|
419
|
+
type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig | ModalSandboxConfig | DockerSandboxConfig;
|
|
373
420
|
/**
|
|
374
421
|
* Agent config accepted by `new Agent(config)`. Can be either a structured task
|
|
375
422
|
* (`run`) or an attached-session handler (`session.handler`). Both run behind
|
|
@@ -377,7 +424,7 @@ type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
|
|
|
377
424
|
* The deprecated `server.handler` spelling remains accepted.
|
|
378
425
|
*/
|
|
379
426
|
type AgentConfig<TInput, TOutput, TFrame = unknown> = RunAgentConfig<TInput, TOutput> | SessionAgentConfig<TInput, TFrame> | ServerAgentConfig<TInput, TFrame>;
|
|
380
|
-
type SandboxClientCreateOptions = {
|
|
427
|
+
type SandboxClientCreateOptions = ModalSandboxCreateOptions | DockerSandboxCreateOptions | {
|
|
381
428
|
provider: 'e2b';
|
|
382
429
|
template?: string;
|
|
383
430
|
apiKey?: string;
|
|
@@ -397,7 +444,7 @@ type SandboxClientCreateOptions = {
|
|
|
397
444
|
networkAllowList?: string;
|
|
398
445
|
domainAllowList?: string;
|
|
399
446
|
};
|
|
400
|
-
type SandboxClientConnectOptions = {
|
|
447
|
+
type SandboxClientConnectOptions = ModalSandboxConnectOptions | DockerSandboxConnectOptions | {
|
|
401
448
|
provider: 'e2b';
|
|
402
449
|
sandboxId: string;
|
|
403
450
|
apiKey?: string;
|
|
@@ -412,6 +459,16 @@ type SandboxClientConnectOptions = {
|
|
|
412
459
|
declare class SandboxClient {
|
|
413
460
|
private readonly handle;
|
|
414
461
|
private constructor();
|
|
462
|
+
static create(options: Extract<SandboxClientCreateOptions, {
|
|
463
|
+
provider: 'modal';
|
|
464
|
+
}>): Promise<SandboxClient & {
|
|
465
|
+
readonly provider: 'modal';
|
|
466
|
+
}>;
|
|
467
|
+
static create(options: Extract<SandboxClientCreateOptions, {
|
|
468
|
+
provider: 'docker';
|
|
469
|
+
}>): Promise<SandboxClient & {
|
|
470
|
+
readonly provider: 'docker';
|
|
471
|
+
}>;
|
|
415
472
|
static create(options: Extract<SandboxClientCreateOptions, {
|
|
416
473
|
provider: 'daytona';
|
|
417
474
|
}>): Promise<SandboxClient & {
|
|
@@ -423,6 +480,16 @@ declare class SandboxClient {
|
|
|
423
480
|
readonly provider: 'e2b';
|
|
424
481
|
}>;
|
|
425
482
|
static create(options: SandboxClientCreateOptions): Promise<SandboxClient>;
|
|
483
|
+
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
484
|
+
provider: 'modal';
|
|
485
|
+
}>): Promise<SandboxClient & {
|
|
486
|
+
readonly provider: 'modal';
|
|
487
|
+
}>;
|
|
488
|
+
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
489
|
+
provider: 'docker';
|
|
490
|
+
}>): Promise<SandboxClient & {
|
|
491
|
+
readonly provider: 'docker';
|
|
492
|
+
}>;
|
|
426
493
|
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
427
494
|
provider: 'daytona';
|
|
428
495
|
}>): Promise<SandboxClient & {
|
|
@@ -604,4 +671,4 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
|
|
|
604
671
|
}): AsyncGenerator<TFrame>;
|
|
605
672
|
}
|
|
606
673
|
|
|
607
|
-
export { Agent, type AgentConfig, type AgentKind, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, type LocalDirectoryUpload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
|
|
674
|
+
export { Agent, type AgentConfig, type AgentKind, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, ExecutionError, type FileDownload, type LocalDirectoryUpload, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Buffer } from 'node:buffer';
|
|
|
2
2
|
import { S as SandboxFileContent$1, a as SandboxCommandOptions, b as SandboxCommandResult, c as SandboxDetachedCommandOptions, d as SandboxDetachedCommand } from './sandbox-capabilities-CFjnZ_kB.js';
|
|
3
3
|
|
|
4
4
|
/** Sandbox providers supported by the public and in-sandbox runtimes. */
|
|
5
|
-
type SandboxProvider = 'e2b' | 'daytona';
|
|
5
|
+
type SandboxProvider = 'e2b' | 'daytona' | 'modal' | 'docker';
|
|
6
6
|
/** Paths shared by host, runtime, and provider sandbox contexts. */
|
|
7
7
|
interface SandboxContext {
|
|
8
8
|
provider: SandboxProvider;
|
|
@@ -42,6 +42,53 @@ interface AttachedAgentSession<TInput, TFrame> {
|
|
|
42
42
|
close(): Promise<void>;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
+
interface ModalSandboxConfig {
|
|
46
|
+
provider: 'modal';
|
|
47
|
+
/** Public Debian-compatible registry image; defaults to node:22-bookworm. */
|
|
48
|
+
template?: string;
|
|
49
|
+
/** Modal App name; created if missing. Defaults to agent-neckbeard. */
|
|
50
|
+
appName?: string;
|
|
51
|
+
environment?: string;
|
|
52
|
+
/** Fixed lifetime, whole-second milliseconds from 1000 to 86400000; defaults to one hour. */
|
|
53
|
+
timeoutMs?: number;
|
|
54
|
+
cpu?: number;
|
|
55
|
+
memoryMiB?: number;
|
|
56
|
+
}
|
|
57
|
+
interface ModalClientCredentials {
|
|
58
|
+
tokenId?: string;
|
|
59
|
+
tokenSecret?: string;
|
|
60
|
+
environment?: string;
|
|
61
|
+
}
|
|
62
|
+
type ModalSandboxCreateOptions = ModalSandboxConfig & ModalClientCredentials & {
|
|
63
|
+
envs?: Record<string, string | undefined>;
|
|
64
|
+
};
|
|
65
|
+
type ModalSandboxConnectOptions = ModalClientCredentials & {
|
|
66
|
+
provider: 'modal';
|
|
67
|
+
sandboxId: string;
|
|
68
|
+
};
|
|
69
|
+
|
|
70
|
+
interface DockerSandboxConfig {
|
|
71
|
+
provider: 'docker';
|
|
72
|
+
/** Debian-compatible image with Node.js/npm for `Agent`; defaults to node:22-bookworm. */
|
|
73
|
+
template?: string;
|
|
74
|
+
/** Existing Docker network to join, e.g. a compose project network. */
|
|
75
|
+
network?: string;
|
|
76
|
+
/** Image platform such as linux/amd64; defaults to the daemon's native platform. */
|
|
77
|
+
platform?: string;
|
|
78
|
+
/** Fixed lifetime, whole-second milliseconds up to 24 hours; the container removes itself afterwards. Defaults to one hour. */
|
|
79
|
+
timeoutMs?: number;
|
|
80
|
+
cpu?: number;
|
|
81
|
+
memoryMiB?: number;
|
|
82
|
+
}
|
|
83
|
+
type DockerSandboxCreateOptions = DockerSandboxConfig & {
|
|
84
|
+
envs?: Record<string, string | undefined>;
|
|
85
|
+
};
|
|
86
|
+
interface DockerSandboxConnectOptions {
|
|
87
|
+
provider: 'docker';
|
|
88
|
+
/** Container ID or name, used verbatim as the handle ID. Containers not created by this provider are never removed by it. */
|
|
89
|
+
sandboxId: string;
|
|
90
|
+
}
|
|
91
|
+
|
|
45
92
|
/**
|
|
46
93
|
* agent-neckbeard - Deploy AI agents to sandboxes
|
|
47
94
|
*/
|
|
@@ -369,7 +416,7 @@ interface DaytonaSandboxConfig {
|
|
|
369
416
|
*/
|
|
370
417
|
domainAllowList?: string;
|
|
371
418
|
}
|
|
372
|
-
type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
|
|
419
|
+
type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig | ModalSandboxConfig | DockerSandboxConfig;
|
|
373
420
|
/**
|
|
374
421
|
* Agent config accepted by `new Agent(config)`. Can be either a structured task
|
|
375
422
|
* (`run`) or an attached-session handler (`session.handler`). Both run behind
|
|
@@ -377,7 +424,7 @@ type SandboxConfig = E2BSandboxConfig | DaytonaSandboxConfig;
|
|
|
377
424
|
* The deprecated `server.handler` spelling remains accepted.
|
|
378
425
|
*/
|
|
379
426
|
type AgentConfig<TInput, TOutput, TFrame = unknown> = RunAgentConfig<TInput, TOutput> | SessionAgentConfig<TInput, TFrame> | ServerAgentConfig<TInput, TFrame>;
|
|
380
|
-
type SandboxClientCreateOptions = {
|
|
427
|
+
type SandboxClientCreateOptions = ModalSandboxCreateOptions | DockerSandboxCreateOptions | {
|
|
381
428
|
provider: 'e2b';
|
|
382
429
|
template?: string;
|
|
383
430
|
apiKey?: string;
|
|
@@ -397,7 +444,7 @@ type SandboxClientCreateOptions = {
|
|
|
397
444
|
networkAllowList?: string;
|
|
398
445
|
domainAllowList?: string;
|
|
399
446
|
};
|
|
400
|
-
type SandboxClientConnectOptions = {
|
|
447
|
+
type SandboxClientConnectOptions = ModalSandboxConnectOptions | DockerSandboxConnectOptions | {
|
|
401
448
|
provider: 'e2b';
|
|
402
449
|
sandboxId: string;
|
|
403
450
|
apiKey?: string;
|
|
@@ -412,6 +459,16 @@ type SandboxClientConnectOptions = {
|
|
|
412
459
|
declare class SandboxClient {
|
|
413
460
|
private readonly handle;
|
|
414
461
|
private constructor();
|
|
462
|
+
static create(options: Extract<SandboxClientCreateOptions, {
|
|
463
|
+
provider: 'modal';
|
|
464
|
+
}>): Promise<SandboxClient & {
|
|
465
|
+
readonly provider: 'modal';
|
|
466
|
+
}>;
|
|
467
|
+
static create(options: Extract<SandboxClientCreateOptions, {
|
|
468
|
+
provider: 'docker';
|
|
469
|
+
}>): Promise<SandboxClient & {
|
|
470
|
+
readonly provider: 'docker';
|
|
471
|
+
}>;
|
|
415
472
|
static create(options: Extract<SandboxClientCreateOptions, {
|
|
416
473
|
provider: 'daytona';
|
|
417
474
|
}>): Promise<SandboxClient & {
|
|
@@ -423,6 +480,16 @@ declare class SandboxClient {
|
|
|
423
480
|
readonly provider: 'e2b';
|
|
424
481
|
}>;
|
|
425
482
|
static create(options: SandboxClientCreateOptions): Promise<SandboxClient>;
|
|
483
|
+
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
484
|
+
provider: 'modal';
|
|
485
|
+
}>): Promise<SandboxClient & {
|
|
486
|
+
readonly provider: 'modal';
|
|
487
|
+
}>;
|
|
488
|
+
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
489
|
+
provider: 'docker';
|
|
490
|
+
}>): Promise<SandboxClient & {
|
|
491
|
+
readonly provider: 'docker';
|
|
492
|
+
}>;
|
|
426
493
|
static connect(options: Extract<SandboxClientConnectOptions, {
|
|
427
494
|
provider: 'daytona';
|
|
428
495
|
}>): Promise<SandboxClient & {
|
|
@@ -604,4 +671,4 @@ declare class Agent<TInput, TOutput = unknown, TFrame = unknown> {
|
|
|
604
671
|
}): AsyncGenerator<TFrame>;
|
|
605
672
|
}
|
|
606
673
|
|
|
607
|
-
export { Agent, type AgentConfig, type AgentKind, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type E2BSandboxConfig, ExecutionError, type FileDownload, type LocalDirectoryUpload, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
|
|
674
|
+
export { Agent, type AgentConfig, type AgentKind, type AgentMode, type AgentRunContext, type AgentRunResult, type AgentSandboxContext, type AgentSessionHandler, type AttachedAgentSession, type BuildOptions, ConfigurationError, type CreateAttachedSessionOptions, DEFAULT_DEPENDENCIES, type DaytonaSandboxConfig, DeploymentError, type DockerSandboxConfig, type E2BSandboxConfig, ExecutionError, type FileDownload, type LocalDirectoryUpload, type ModalSandboxConfig, NeckbeardError, type NeckbeardNextConfigOptions, type OsDependencies, type ResolveAgentSourceFileOptions, type RunAgentConfig, SandboxClient, type SandboxClientConnectOptions, type SandboxClientCreateOptions, SandboxCommandOptions, SandboxCommandResult, type SandboxConfig, SandboxDetachedCommand, SandboxDetachedCommandOptions, type SandboxFileContent, type SandboxProvider, type ServerAgentConfig, type SessionAgentConfig, type SessionDurability, ValidationError, resolveAgentSourceFile, withNeckbeardNextConfig };
|