@deepagents/context 4.0.0 → 4.2.0
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 +25 -16
- package/dist/browser.js +18 -8
- package/dist/browser.js.map +2 -2
- package/dist/index.js +2551 -1596
- package/dist/index.js.map +4 -4
- package/dist/lib/agent.d.ts.map +1 -1
- package/dist/lib/engine.d.ts +11 -4
- package/dist/lib/engine.d.ts.map +1 -1
- package/dist/lib/fragments/message/user.d.ts +28 -14
- package/dist/lib/fragments/message/user.d.ts.map +1 -1
- package/dist/lib/sandbox/agent-os-sandbox.d.ts +2 -2
- package/dist/lib/sandbox/agent-os-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/apple-container-sandbox-errors.d.ts +44 -0
- package/dist/lib/sandbox/apple-container-sandbox-errors.d.ts.map +1 -0
- package/dist/lib/sandbox/apple-container-sandbox.d.ts +130 -0
- package/dist/lib/sandbox/apple-container-sandbox.d.ts.map +1 -0
- package/dist/lib/sandbox/bash-meta.d.ts +0 -3
- package/dist/lib/sandbox/bash-meta.d.ts.map +1 -1
- package/dist/lib/sandbox/bash-tool.d.ts +3 -3
- package/dist/lib/sandbox/bash-tool.d.ts.map +1 -1
- package/dist/lib/sandbox/cli-process.d.ts +24 -0
- package/dist/lib/sandbox/cli-process.d.ts.map +1 -0
- package/dist/lib/sandbox/container-engine.d.ts +150 -0
- package/dist/lib/sandbox/container-engine.d.ts.map +1 -0
- package/dist/lib/sandbox/container-sandbox-errors.d.ts +10 -0
- package/dist/lib/sandbox/container-sandbox-errors.d.ts.map +1 -0
- package/dist/lib/sandbox/container-sandbox.d.ts +90 -0
- package/dist/lib/sandbox/container-sandbox.d.ts.map +1 -0
- package/dist/lib/sandbox/daytona-sandbox.d.ts +2 -2
- package/dist/lib/sandbox/daytona-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/docker-sandbox-errors.d.ts +2 -2
- package/dist/lib/sandbox/docker-sandbox-errors.d.ts.map +1 -1
- package/dist/lib/sandbox/docker-sandbox.d.ts +122 -218
- package/dist/lib/sandbox/docker-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/index.d.ts +5 -0
- package/dist/lib/sandbox/index.d.ts.map +1 -1
- package/dist/lib/sandbox/microsandbox-sandbox.d.ts +93 -0
- package/dist/lib/sandbox/microsandbox-sandbox.d.ts.map +1 -0
- package/dist/lib/sandbox/shell-quote.d.ts +2 -2
- package/dist/lib/sandbox/strace/index.d.ts +6 -21
- package/dist/lib/sandbox/strace/index.d.ts.map +1 -1
- package/dist/lib/sandbox/strace/index.js +18 -7
- package/dist/lib/sandbox/strace/index.js.map +2 -2
- package/dist/lib/sandbox/types.d.ts +22 -3
- package/dist/lib/sandbox/types.d.ts.map +1 -1
- package/dist/lib/sandbox/virtual-sandbox.d.ts +2 -2
- package/dist/lib/sandbox/virtual-sandbox.d.ts.map +1 -1
- package/package.json +14 -8
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { type CommandResult } from 'bash-tool';
|
|
2
|
+
import type { CommonSandboxOptions, ContainerEngine, SandboxVolume } from './container-engine.ts';
|
|
3
|
+
import { type Installer } from './installers/installer.ts';
|
|
4
|
+
import type { DisposableSandbox, ExecuteCommandOptions, SandboxProcess, SpawnOptions } from './types.ts';
|
|
5
|
+
interface StrategyContext {
|
|
6
|
+
containerId: string;
|
|
7
|
+
image: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Template Method base for sandbox creation strategies, shared across engines.
|
|
11
|
+
* Subclasses choose the image and define post-start configuration; the base owns
|
|
12
|
+
* container lifecycle, exec, and file I/O, delegating every CLI dialect to the
|
|
13
|
+
* injected {@link ContainerEngine}. Typed to {@link CommonSandboxOptions} so the
|
|
14
|
+
* skeleton can never read an engine-only knob.
|
|
15
|
+
*/
|
|
16
|
+
export declare abstract class ContainerSandboxStrategy<TOpts extends CommonSandboxOptions = CommonSandboxOptions> {
|
|
17
|
+
protected context: StrategyContext;
|
|
18
|
+
protected engine: ContainerEngine<TOpts>;
|
|
19
|
+
protected opts: TOpts;
|
|
20
|
+
protected volumes: SandboxVolume[];
|
|
21
|
+
protected name?: string;
|
|
22
|
+
protected workdir: string;
|
|
23
|
+
private createdVolumes;
|
|
24
|
+
constructor(opts: TOpts, engine: ContainerEngine<TOpts>);
|
|
25
|
+
create(): Promise<DisposableSandbox>;
|
|
26
|
+
private namedContainerId;
|
|
27
|
+
protected defaultContainerId(): string;
|
|
28
|
+
protected acquireContainer(image: string): Promise<{
|
|
29
|
+
containerId: string;
|
|
30
|
+
attached: boolean;
|
|
31
|
+
}>;
|
|
32
|
+
private startStoppedContainer;
|
|
33
|
+
protected inspectContainer(containerId: string): Promise<'running' | 'stopped' | 'absent'>;
|
|
34
|
+
protected prepareVolumes(): Promise<void>;
|
|
35
|
+
protected validateVolumes(): void;
|
|
36
|
+
private validateMountValue;
|
|
37
|
+
protected buildRunArgs(image: string, containerId: string): string[];
|
|
38
|
+
private inspectVolume;
|
|
39
|
+
private volumeExists;
|
|
40
|
+
private createVolume;
|
|
41
|
+
private cleanupCreatedVolumes;
|
|
42
|
+
private cleanupCreatedVolumesAfterFailure;
|
|
43
|
+
private engineErrorMessage;
|
|
44
|
+
private isServiceDown;
|
|
45
|
+
protected startContainer(image: string, containerId: string): Promise<void>;
|
|
46
|
+
protected stopContainer(containerId: string): Promise<void>;
|
|
47
|
+
protected exec(command: string, options?: ExecuteCommandOptions): Promise<CommandResult>;
|
|
48
|
+
protected spawnProcess(command: string, options?: SpawnOptions): SandboxProcess;
|
|
49
|
+
protected createSandboxMethods(): DisposableSandbox;
|
|
50
|
+
protected abstract getImage(): Promise<string>;
|
|
51
|
+
protected abstract configure(): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Starts a vanilla image and runs the supplied installers in order. Shared by
|
|
55
|
+
* both engines — the post-start installer context comes from
|
|
56
|
+
* `engine.createInstallerContext`, so the same class drives `docker exec` and
|
|
57
|
+
* `container exec`.
|
|
58
|
+
*/
|
|
59
|
+
export declare class RuntimeStrategy<TOpts extends CommonSandboxOptions = CommonSandboxOptions> extends ContainerSandboxStrategy<TOpts> {
|
|
60
|
+
private image;
|
|
61
|
+
private installers;
|
|
62
|
+
constructor(opts: TOpts, engine: ContainerEngine<TOpts>, mode: {
|
|
63
|
+
image: string;
|
|
64
|
+
installers: Installer[];
|
|
65
|
+
});
|
|
66
|
+
protected getImage(): Promise<string>;
|
|
67
|
+
protected configure(): Promise<void>;
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Builds a custom image from a Dockerfile (content-hash caching), delegating the
|
|
71
|
+
* build invocation to `engine.buildImage`. Shared by both engines — the tag
|
|
72
|
+
* computation and existence check are common; only the build dialect differs.
|
|
73
|
+
* Runs no post-start configuration — the Dockerfile defines the image.
|
|
74
|
+
*/
|
|
75
|
+
export declare class ContainerfileStrategy<TOpts extends CommonSandboxOptions = CommonSandboxOptions> extends ContainerSandboxStrategy<TOpts> {
|
|
76
|
+
private dockerfile;
|
|
77
|
+
private dockerContext;
|
|
78
|
+
private showBuildLogs;
|
|
79
|
+
private identity?;
|
|
80
|
+
constructor(opts: TOpts, engine: ContainerEngine<TOpts>, mode: {
|
|
81
|
+
dockerfile: string;
|
|
82
|
+
context: string;
|
|
83
|
+
showBuildLogs: boolean;
|
|
84
|
+
identity?: string;
|
|
85
|
+
});
|
|
86
|
+
protected getImage(): Promise<string>;
|
|
87
|
+
protected configure(): Promise<void>;
|
|
88
|
+
}
|
|
89
|
+
export {};
|
|
90
|
+
//# sourceMappingURL=container-sandbox.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"container-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/container-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAW/C,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAEf,aAAa,EACd,MAAM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B,CAAC,KAAK,CAAC;IACvC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,aAAa,CAAU;IAC/B,OAAO,CAAC,QAAQ,CAAC,CAAS;gBAGxB,IAAI,EAAE,KAAK,EACX,MAAM,EAAE,eAAe,CAAC,KAAK,CAAC,EAC9B,IAAI,EAAE;QACJ,UAAU,EAAE,MAAM,CAAC;QACnB,OAAO,EAAE,MAAM,CAAC;QAChB,aAAa,EAAE,OAAO,CAAC;QACvB,QAAQ,CAAC,EAAE,MAAM,CAAC;KACnB;cASa,QAAQ,IAAI,OAAO,CAAC,MAAM,CAAC;cAuB3B,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;CAC3C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Daytona } from '@daytona/sdk';
|
|
2
|
-
import type { DisposableSandbox } from './types.ts';
|
|
2
|
+
import type { DisposableSandbox, SandboxReadinessOptions } from './types.ts';
|
|
3
3
|
export declare const DAYTONA_DEFAULT_DESTINATION = "/home/daytona";
|
|
4
4
|
export interface DaytonaResources {
|
|
5
5
|
cpu?: number;
|
|
@@ -12,7 +12,7 @@ export interface DaytonaVolumeMount {
|
|
|
12
12
|
mountPath: string;
|
|
13
13
|
[key: string]: unknown;
|
|
14
14
|
}
|
|
15
|
-
export interface DaytonaSandboxOptions {
|
|
15
|
+
export interface DaytonaSandboxOptions extends SandboxReadinessOptions {
|
|
16
16
|
/**
|
|
17
17
|
* Existing Daytona sandbox id or name to attach to.
|
|
18
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"daytona-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/daytona-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAGV,OAAO,EAER,MAAM,cAAc,CAAC;AAKtB,OAAO,KAAK,EACV,iBAAiB,
|
|
1
|
+
{"version":3,"file":"daytona-sandbox.d.ts","sourceRoot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IAC7B,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,oBAAoB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD;AAED,qBAAa,mBAAoB,SAAQ,KAAK;gBAChC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAK3C;AAED,qBAAa,oBAAqB,SAAQ,mBAAmB;gBAC/C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED,qBAAa,mBAAoB,SAAQ,mBAAmB;gBAC9C,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAI3C;AAED,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,qBAA0B,GAClC,OAAO,CAAC,iBAAiB,CAAC,CAsC5B"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { ContainerSandboxError } from './container-sandbox-errors.ts';
|
|
2
|
+
export declare class DockerSandboxError extends ContainerSandboxError {
|
|
3
3
|
constructor(message: string, containerId?: string);
|
|
4
4
|
}
|
|
5
5
|
export declare class DockerNotAvailableError extends DockerSandboxError {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-sandbox-errors.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/docker-sandbox-errors.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"docker-sandbox-errors.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/docker-sandbox-errors.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AAEt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AAM,EAAE,MAAM;CAK3B;AAED,qBAAa,iBAAkB,SAAQ,kBAAkB;IACvD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAMhD"}
|
|
@@ -1,95 +1,140 @@
|
|
|
1
1
|
import { type CommandResult } from 'bash-tool';
|
|
2
|
+
import type { CommonSandboxOptions, ContainerEngine, SandboxResources, SandboxVolume } from './container-engine.ts';
|
|
3
|
+
import { ContainerSandboxStrategy } from './container-sandbox.ts';
|
|
2
4
|
import { type Installer } from './installers/installer.ts';
|
|
3
5
|
import type { DisposableSandbox, ExecuteCommandOptions, SandboxProcess, SpawnOptions } from './types.ts';
|
|
4
6
|
export type { CommandResult as ExecResult, Sandbox } from 'bash-tool';
|
|
7
|
+
export type { SandboxBindVolume as DockerBindVolume, SandboxNamedVolume as DockerNamedVolume, SandboxVolume as DockerSandboxVolume, } from './container-engine.ts';
|
|
5
8
|
export { ComposeStartError, ContainerCreationError, DockerNotAvailableError, DockerSandboxError, DockerfileBuildError, type InstallErrorOptions, type InstallKind, InstallError, MissingRuntimeError, PackageInstallError, VolumeCreateError, VolumeInspectError, VolumePathError, VolumeRemoveError, } from './docker-sandbox-errors.ts';
|
|
6
|
-
export interface
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
export interface DockerResources extends SandboxResources {
|
|
10
|
+
/**
|
|
11
|
+
* `--memory-swap` — total memory + swap (e.g. `'1g'`). Without it Docker
|
|
12
|
+
* allows swap up to 2× `memory`; set it equal to `memory` to forbid swap
|
|
13
|
+
* entirely. Must be ≥ `memory`.
|
|
14
|
+
*/
|
|
15
|
+
memorySwap?: string;
|
|
16
|
+
/** `--shm-size` — size of `/dev/shm` (e.g. `'64m'`). Raise for Chromium/ML workloads. */
|
|
17
|
+
shmSize?: string;
|
|
18
|
+
/** `--pids-limit` — cap the container's process count (fork-bomb protection). */
|
|
19
|
+
pidsLimit?: number;
|
|
20
|
+
/** `--ulimit` per entry — e.g. `['nofile=1024:2048']`. */
|
|
21
|
+
ulimits?: string[];
|
|
22
|
+
/** `--cpuset-cpus` — CPUs the container may run on, e.g. `'0-1'`. */
|
|
23
|
+
cpusetCpus?: string;
|
|
24
|
+
/** `--cpu-shares` — relative CPU weight under contention. */
|
|
25
|
+
cpuShares?: number;
|
|
12
26
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Container hardening for `docker run`. All optional — omit for the daemon's
|
|
29
|
+
* defaults (shared kernel, root user, writable root filesystem).
|
|
30
|
+
*/
|
|
31
|
+
export interface DockerSecurity {
|
|
32
|
+
/**
|
|
33
|
+
* `--cap-drop` per entry. `['ALL']` drops every Linux capability — the
|
|
34
|
+
* baseline for running untrusted code; re-grant via {@link capAdd}.
|
|
35
|
+
*/
|
|
36
|
+
capDrop?: string[];
|
|
37
|
+
/** `--cap-add` per entry. Re-grant only what's needed after dropping `ALL`. */
|
|
38
|
+
capAdd?: string[];
|
|
39
|
+
/**
|
|
40
|
+
* `--read-only` — mount the container root filesystem read-only. Writes then
|
|
41
|
+
* only land in `tmpfs`/volume mounts; pair with a writable `/workspace`
|
|
42
|
+
* (a {@link tmpfs} entry or volume) or the sandbox's `writeFiles` and the
|
|
43
|
+
* installer phase will fail.
|
|
44
|
+
*/
|
|
18
45
|
readOnly?: boolean;
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
46
|
+
/**
|
|
47
|
+
* `--user` (`uid[:gid]`) — run as a non-root user. The installer phase
|
|
48
|
+
* (`apk`/`apt`/`npm -g`/`pip`) needs root, so non-root suits a pre-baked
|
|
49
|
+
* Dockerfile image rather than the runtime-image + installers path.
|
|
50
|
+
*/
|
|
51
|
+
user?: string;
|
|
52
|
+
/**
|
|
53
|
+
* `--tmpfs` per entry (e.g. `'/tmp'`, `'/workspace:size=64m'`) — ephemeral,
|
|
54
|
+
* in-memory writable directories. The companion to {@link readOnly}.
|
|
55
|
+
*/
|
|
56
|
+
tmpfs?: string[];
|
|
57
|
+
/**
|
|
58
|
+
* `--security-opt` per entry — e.g. `['seccomp=/path/profile.json']` to apply
|
|
59
|
+
* a custom seccomp profile, or `['no-new-privileges']`.
|
|
60
|
+
*/
|
|
61
|
+
securityOpt?: string[];
|
|
29
62
|
}
|
|
30
|
-
|
|
31
|
-
export interface
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
63
|
+
/** Networking for `docker run`. */
|
|
64
|
+
export interface DockerNetwork {
|
|
65
|
+
/**
|
|
66
|
+
* `--network` — e.g. `'none'` (no network at all; strong isolation for
|
|
67
|
+
* untrusted code, but breaks network installers), a custom network name, or
|
|
68
|
+
* `'host'` (shares the host network stack — defeats isolation).
|
|
69
|
+
*/
|
|
70
|
+
mode?: string;
|
|
71
|
+
/** `--publish` per entry — e.g. `['8080:80']` to expose a container port. */
|
|
72
|
+
publish?: string[];
|
|
73
|
+
/** `--dns` per entry — custom DNS servers. */
|
|
74
|
+
dns?: string[];
|
|
75
|
+
/** `--add-host` per entry — e.g. `['db:10.0.0.5']` host-to-IP mappings. */
|
|
76
|
+
addHost?: string[];
|
|
77
|
+
/** `--hostname` — the container hostname. */
|
|
78
|
+
hostname?: string;
|
|
36
79
|
}
|
|
37
80
|
/**
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
* host, the sandbox attaches to it: installers, volume preparation, and
|
|
42
|
-
* env are skipped (the pre-existing container is assumed already
|
|
43
|
-
* configured). If it exists but is stopped, it is started first.
|
|
44
|
-
* Otherwise the container is created fresh and installers run as usual.
|
|
45
|
-
*
|
|
46
|
-
* Must match `/^[A-Za-z0-9_.-]+$/`. The full Docker container name
|
|
47
|
-
* (`sandbox-<name>`) is always legal because the prefix begins with an
|
|
48
|
-
* alphanumeric character.
|
|
49
|
-
*
|
|
50
|
-
* Warning: `dispose()` stops (and `--rm` removes) the container regardless
|
|
51
|
-
* of whether it was created or attached to. If two callers in the same
|
|
52
|
-
* process share a name, the first `dispose()` destroys the container the
|
|
53
|
-
* other one is still using.
|
|
81
|
+
* Run-configuration for the Docker engine. Extends the common options the shared
|
|
82
|
+
* skeleton reads with Docker-only `docker run` knobs that only `dockerEngine`
|
|
83
|
+
* sees.
|
|
54
84
|
*/
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
image?: string;
|
|
85
|
+
export interface DockerCommonOptions extends CommonSandboxOptions {
|
|
86
|
+
volumes?: SandboxVolume[];
|
|
87
|
+
resources?: DockerResources;
|
|
59
88
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
89
|
+
* `--platform` (e.g. `'linux/amd64'`) — emulated when it differs from the host
|
|
90
|
+
* arch. For the Dockerfile strategy it also applies to `docker build` and is
|
|
91
|
+
* folded into the image-build cache key.
|
|
63
92
|
*/
|
|
64
|
-
|
|
65
|
-
volumes?: DockerSandboxVolume[];
|
|
66
|
-
resources?: DockerResources;
|
|
67
|
-
env?: Record<string, string>;
|
|
68
|
-
name?: StableContainerName;
|
|
93
|
+
platform?: string;
|
|
69
94
|
/**
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
-
*
|
|
74
|
-
*
|
|
75
|
-
*
|
|
76
|
-
*
|
|
77
|
-
* - A non-empty array: appended verbatim, overriding the image `CMD`.
|
|
95
|
+
* `--runtime` for `docker run` — selects the OCI runtime that backs the
|
|
96
|
+
* container (default: the daemon's default, usually `runc`). Set to a
|
|
97
|
+
* registered runtime such as `'kata-runtime'` (or `'io.containerd.kata.v2'`)
|
|
98
|
+
* to run the container inside a lightweight VM with its own guest kernel
|
|
99
|
+
* instead of sharing the host kernel. The runtime must already be installed on
|
|
100
|
+
* the host and registered in the Docker daemon — and the host must have
|
|
101
|
+
* hardware virtualization (`/dev/kvm`); it is not provisioned here.
|
|
78
102
|
*/
|
|
79
|
-
|
|
103
|
+
runtime?: string;
|
|
104
|
+
/** Container hardening: capabilities, read-only rootfs, user, tmpfs, security-opt. */
|
|
105
|
+
security?: DockerSecurity;
|
|
106
|
+
/** Networking: network mode, published ports, DNS, host mappings, hostname. */
|
|
107
|
+
network?: DockerNetwork;
|
|
80
108
|
/**
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
* custom seccomp profile (denying a syscall), or `['no-new-privileges']`.
|
|
109
|
+
* `--gpus` — e.g. `'all'`. Requires the nvidia container runtime on the host
|
|
110
|
+
* and is incompatible with a `runtime` such as `'kata-runtime'`.
|
|
84
111
|
*/
|
|
85
|
-
|
|
112
|
+
gpus?: string;
|
|
86
113
|
/**
|
|
87
|
-
* `--
|
|
88
|
-
*
|
|
114
|
+
* `--device` per entry — expose a host device, e.g. `['/dev/fuse']`. Passed
|
|
115
|
+
* through verbatim; the library never injects a device implicitly.
|
|
89
116
|
*/
|
|
90
|
-
|
|
117
|
+
devices?: string[];
|
|
118
|
+
/** `--init` — run an init process as PID 1 that reaps zombie subprocesses. */
|
|
119
|
+
init?: boolean;
|
|
120
|
+
/** `--label` — container metadata, emitted as `key=value` per entry. */
|
|
121
|
+
labels?: Record<string, string>;
|
|
122
|
+
/** `--sysctl` — kernel parameters, emitted as `key=value` per entry. */
|
|
123
|
+
sysctls?: Record<string, string>;
|
|
124
|
+
/** `--entrypoint` — override the image `ENTRYPOINT`. */
|
|
125
|
+
entrypoint?: string;
|
|
126
|
+
}
|
|
127
|
+
export interface RuntimeSandboxOptions extends DockerCommonOptions {
|
|
128
|
+
/** Docker image to use (default: `'alpine:latest'`). */
|
|
129
|
+
image?: string;
|
|
130
|
+
/**
|
|
131
|
+
* Ordered list of installers run after the container starts. Use
|
|
132
|
+
* `pkg([...])`, `urlBinary({...})`, `npm(...)`, `pip(...)`,
|
|
133
|
+
* `githubRelease({...})`, or any custom `Installer` subclass.
|
|
134
|
+
*/
|
|
135
|
+
installers?: Installer[];
|
|
91
136
|
}
|
|
92
|
-
export interface DockerfileSandboxOptions {
|
|
137
|
+
export interface DockerfileSandboxOptions extends DockerCommonOptions {
|
|
93
138
|
/** Inline Dockerfile content (contains `\n`) or a path. */
|
|
94
139
|
dockerfile: string;
|
|
95
140
|
/** Build context directory (default: `'.'`). */
|
|
@@ -100,31 +145,6 @@ export interface DockerfileSandboxOptions {
|
|
|
100
145
|
* otherwise runs silently. Default `false`.
|
|
101
146
|
*/
|
|
102
147
|
showBuildLogs?: boolean;
|
|
103
|
-
volumes?: DockerSandboxVolume[];
|
|
104
|
-
resources?: DockerResources;
|
|
105
|
-
env?: Record<string, string>;
|
|
106
|
-
name?: StableContainerName;
|
|
107
|
-
/**
|
|
108
|
-
* Args appended after the image at `docker run` time.
|
|
109
|
-
* - `undefined` (default): `['tail', '-f', '/dev/null']` — keep-alive.
|
|
110
|
-
* - `[]` or `null`: nothing is appended; the Dockerfile's `CMD`/`ENTRYPOINT`
|
|
111
|
-
* runs as declared. Use this when your Dockerfile already declares a
|
|
112
|
-
* long-running process (e.g. `CMD ["node", "server.js"]`).
|
|
113
|
-
* - A non-empty array: appended verbatim, overriding the image `CMD`.
|
|
114
|
-
*/
|
|
115
|
-
command?: readonly string[] | null;
|
|
116
|
-
/**
|
|
117
|
-
* Extra `--security-opt` values for `docker run`. Each entry becomes one
|
|
118
|
-
* `--security-opt <value>` — e.g. `['seccomp=/path/profile.json']` to apply a
|
|
119
|
-
* custom seccomp profile (denying a syscall), or `['no-new-privileges']`.
|
|
120
|
-
*/
|
|
121
|
-
securityOpt?: string[];
|
|
122
|
-
/**
|
|
123
|
-
* `--platform` for `docker build` and `docker run` (e.g. `'linux/amd64'`).
|
|
124
|
-
* Builds and runs under that platform — emulated when it differs from the
|
|
125
|
-
* host arch. Folded into the image-build cache key.
|
|
126
|
-
*/
|
|
127
|
-
platform?: string;
|
|
128
148
|
}
|
|
129
149
|
export interface ComposeSandboxOptions {
|
|
130
150
|
compose: string;
|
|
@@ -134,134 +154,18 @@ export interface ComposeSandboxOptions {
|
|
|
134
154
|
export type DockerSandboxOptions = RuntimeSandboxOptions | DockerfileSandboxOptions | ComposeSandboxOptions;
|
|
135
155
|
export declare function isDockerfileOptions(opts: DockerSandboxOptions): opts is DockerfileSandboxOptions;
|
|
136
156
|
export declare function isComposeOptions(opts: DockerSandboxOptions): opts is ComposeSandboxOptions;
|
|
137
|
-
|
|
138
|
-
containerId: string;
|
|
139
|
-
image: string;
|
|
140
|
-
}
|
|
141
|
-
export interface DockerSandboxStrategyArgs {
|
|
142
|
-
volumes?: DockerSandboxVolume[];
|
|
143
|
-
resources?: DockerResources;
|
|
144
|
-
env?: Record<string, string>;
|
|
145
|
-
name?: StableContainerName;
|
|
146
|
-
/** See {@link RuntimeSandboxOptions.command}. */
|
|
147
|
-
command?: readonly string[] | null;
|
|
148
|
-
/** See {@link RuntimeSandboxOptions.securityOpt}. */
|
|
149
|
-
securityOpt?: string[];
|
|
150
|
-
/** See {@link RuntimeSandboxOptions.platform}. */
|
|
151
|
-
platform?: string;
|
|
152
|
-
}
|
|
153
|
-
/**
|
|
154
|
-
* Template Method base for sandbox creation strategies. Subclasses choose
|
|
155
|
-
* the image and define post-start configuration; the base owns container
|
|
156
|
-
* lifecycle, exec, and file I/O.
|
|
157
|
-
*/
|
|
158
|
-
export declare abstract class DockerSandboxStrategy {
|
|
159
|
-
protected context: StrategyContext;
|
|
160
|
-
protected volumes: DockerSandboxVolume[];
|
|
161
|
-
protected resources: DockerResources;
|
|
162
|
-
protected env: Record<string, string>;
|
|
163
|
-
protected name?: StableContainerName;
|
|
164
|
-
protected command?: readonly string[] | null;
|
|
165
|
-
protected securityOpt: string[];
|
|
166
|
-
protected platform?: string;
|
|
167
|
-
private createdVolumes;
|
|
168
|
-
constructor(args?: DockerSandboxStrategyArgs);
|
|
169
|
-
create(): Promise<DisposableSandbox>;
|
|
170
|
-
private namedContainerId;
|
|
171
|
-
protected defaultContainerId(): string;
|
|
172
|
-
protected acquireContainer(image: string): Promise<{
|
|
173
|
-
containerId: string;
|
|
174
|
-
attached: boolean;
|
|
175
|
-
}>;
|
|
176
|
-
private startStoppedContainer;
|
|
177
|
-
protected inspectContainer(containerId: string): Promise<'running' | 'stopped' | 'absent'>;
|
|
178
|
-
private isMissingContainerError;
|
|
179
|
-
private isNameConflictError;
|
|
180
|
-
protected prepareVolumes(): Promise<void>;
|
|
181
|
-
protected validateVolumes(): void;
|
|
182
|
-
private validateMountValue;
|
|
183
|
-
protected buildDockerArgs(image: string, containerId: string): string[];
|
|
184
|
-
protected buildVolumeMountArg(volume: DockerSandboxVolume): string;
|
|
185
|
-
private inspectVolume;
|
|
186
|
-
private volumeExists;
|
|
187
|
-
private createVolume;
|
|
188
|
-
private cleanupCreatedVolumes;
|
|
189
|
-
private cleanupCreatedVolumesAfterFailure;
|
|
190
|
-
private getDockerErrorMessage;
|
|
191
|
-
private isDockerUnavailableError;
|
|
192
|
-
private isMissingVolumeInspectError;
|
|
193
|
-
protected startContainer(image: string, containerId: string): Promise<void>;
|
|
194
|
-
protected stopContainer(containerId: string): Promise<void>;
|
|
195
|
-
protected exec(command: string, options?: ExecuteCommandOptions): Promise<CommandResult>;
|
|
196
|
-
protected spawnProcess(command: string, options?: SpawnOptions): SandboxProcess;
|
|
197
|
-
protected createSandboxMethods(): DisposableSandbox;
|
|
198
|
-
protected abstract getImage(): Promise<string>;
|
|
199
|
-
protected abstract configure(): Promise<void>;
|
|
200
|
-
}
|
|
201
|
-
export interface RuntimeStrategyArgs extends DockerSandboxStrategyArgs {
|
|
202
|
-
image?: string;
|
|
203
|
-
installers?: Installer[];
|
|
204
|
-
}
|
|
205
|
-
/**
|
|
206
|
-
* Starts a vanilla image and runs the supplied installers in order.
|
|
207
|
-
*
|
|
208
|
-
* @example
|
|
209
|
-
* ```ts
|
|
210
|
-
* new RuntimeStrategy({
|
|
211
|
-
* image: 'alpine:latest',
|
|
212
|
-
* installers: [
|
|
213
|
-
* pkg(['curl', 'jq']),
|
|
214
|
-
* urlBinary({ name: 'presenterm', url: {...} }),
|
|
215
|
-
* npm('prettier', { ensureRuntime: true }),
|
|
216
|
-
* ],
|
|
217
|
-
* });
|
|
218
|
-
* ```
|
|
219
|
-
*/
|
|
220
|
-
export declare class RuntimeStrategy extends DockerSandboxStrategy {
|
|
221
|
-
private image;
|
|
222
|
-
private installers;
|
|
223
|
-
constructor(args?: RuntimeStrategyArgs);
|
|
224
|
-
protected getImage(): Promise<string>;
|
|
225
|
-
protected configure(): Promise<void>;
|
|
226
|
-
}
|
|
227
|
-
export interface DockerfileStrategyArgs extends DockerSandboxStrategyArgs {
|
|
228
|
-
dockerfile: string;
|
|
229
|
-
context?: string;
|
|
230
|
-
showBuildLogs?: boolean;
|
|
231
|
-
}
|
|
232
|
-
/**
|
|
233
|
-
* Builds a custom image from a Dockerfile (with content-hash caching).
|
|
234
|
-
* Runs no post-start configuration — the Dockerfile defines the image.
|
|
235
|
-
*/
|
|
236
|
-
export declare class DockerfileStrategy extends DockerSandboxStrategy {
|
|
237
|
-
private imageTag;
|
|
238
|
-
private dockerfile;
|
|
239
|
-
private dockerContext;
|
|
240
|
-
private showBuildLogs;
|
|
241
|
-
constructor(args: DockerfileStrategyArgs);
|
|
242
|
-
private computeImageTag;
|
|
243
|
-
private isInlineDockerfile;
|
|
244
|
-
protected getImage(): Promise<string>;
|
|
245
|
-
protected configure(): Promise<void>;
|
|
246
|
-
private imageExists;
|
|
247
|
-
private buildImage;
|
|
248
|
-
/**
|
|
249
|
-
* Run a build command with stdio inherited so its output streams live to the
|
|
250
|
-
* parent terminal. On failure the build error is already on screen; the
|
|
251
|
-
* rejection just carries the exit code.
|
|
252
|
-
*/
|
|
253
|
-
private runStreamed;
|
|
254
|
-
}
|
|
157
|
+
export declare const dockerEngine: ContainerEngine<DockerCommonOptions>;
|
|
255
158
|
export interface ComposeStrategyArgs {
|
|
256
159
|
compose: string;
|
|
257
160
|
service: string;
|
|
258
161
|
resources?: DockerResources;
|
|
259
162
|
}
|
|
260
163
|
/**
|
|
261
|
-
* Manages multi-container environments via `docker compose`.
|
|
262
|
-
* Commands run inside the named service; `dispose()`
|
|
164
|
+
* Manages multi-container environments via `docker compose`. Docker-only — not
|
|
165
|
+
* part of the engine bridge. Commands run inside the named service; `dispose()`
|
|
166
|
+
* brings the whole stack down.
|
|
263
167
|
*/
|
|
264
|
-
export declare class ComposeStrategy extends
|
|
168
|
+
export declare class ComposeStrategy extends ContainerSandboxStrategy {
|
|
265
169
|
private projectName;
|
|
266
170
|
private composeFile;
|
|
267
171
|
private service;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docker-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/docker-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"docker-sandbox.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/docker-sandbox.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,WAAW,CAAC;AAO/C,OAAO,KAAK,EACV,oBAAoB,EACpB,eAAe,EAGf,gBAAgB,EAChB,aAAa,EACd,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,wBAAwB,EAGzB,MAAM,wBAAwB,CAAC;AAYhC,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,iBAAiB,EACjB,qBAAqB,EACrB,cAAc,EACd,YAAY,EACb,MAAM,YAAY,CAAC;AAEpB,YAAY,EAAE,aAAa,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,YAAY,EACV,iBAAiB,IAAI,gBAAgB,EACrC,kBAAkB,IAAI,iB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G;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,iBAAiB,CAAC,CAoB5B;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,GAC7C,OAAO,CAAC,CAAC,CAAC,CAOZ"}
|
|
@@ -1,14 +1,19 @@
|
|
|
1
1
|
export * from './abort.ts';
|
|
2
2
|
export * from './agent-os-sandbox.ts';
|
|
3
|
+
export * from './apple-container-sandbox.ts';
|
|
3
4
|
export * from './bash-exception.ts';
|
|
4
5
|
export * from './bash-meta.ts';
|
|
5
6
|
export * from './bash-tool.ts';
|
|
6
7
|
export * from './binary-bridges.ts';
|
|
8
|
+
export * from './container-engine.ts';
|
|
9
|
+
export * from './container-sandbox.ts';
|
|
10
|
+
export * from './container-sandbox-errors.ts';
|
|
7
11
|
export * from './daytona-sandbox.ts';
|
|
8
12
|
export * from './docker-sandbox.ts';
|
|
9
13
|
export * from './strace/file-changes.ts';
|
|
10
14
|
export * from './gcs.ts';
|
|
11
15
|
export * from './installers/index.ts';
|
|
16
|
+
export * from './microsandbox-sandbox.ts';
|
|
12
17
|
export * from './shell-quote.ts';
|
|
13
18
|
export * from './subcommand.ts';
|
|
14
19
|
export * from './types.ts';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,YAAY,CAAC;AAC3B,cAAc,uBAAuB,CAAC;AACtC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC;AACvC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,kBAAkB,CAAC;AACjC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|