@deepagents/context 0.39.0 → 1.0.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 +44 -11
- package/dist/browser.js +171 -15
- package/dist/browser.js.map +3 -3
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2309 -1233
- package/dist/index.js.map +4 -4
- package/dist/lib/agent.d.ts +6 -0
- package/dist/lib/agent.d.ts.map +1 -1
- package/dist/lib/chain-summary.d.ts +18 -0
- package/dist/lib/chain-summary.d.ts.map +1 -0
- package/dist/lib/engine.d.ts +25 -6
- package/dist/lib/engine.d.ts.map +1 -1
- package/dist/lib/fragments/message/user.d.ts +21 -2
- package/dist/lib/fragments/message/user.d.ts.map +1 -1
- package/dist/lib/fragments.d.ts +8 -3
- package/dist/lib/fragments.d.ts.map +1 -1
- package/dist/lib/resolvers/async-resolver.d.ts +8 -0
- package/dist/lib/resolvers/async-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/function-resolver.d.ts +8 -0
- package/dist/lib/resolvers/function-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/generator-resolver.d.ts +13 -0
- package/dist/lib/resolvers/generator-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/index.d.ts +10 -0
- package/dist/lib/resolvers/index.d.ts.map +1 -0
- package/dist/lib/resolvers/iterable-resolver.d.ts +12 -0
- package/dist/lib/resolvers/iterable-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/loader-resolver.d.ts +13 -0
- package/dist/lib/resolvers/loader-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/promise-resolver.d.ts +7 -0
- package/dist/lib/resolvers/promise-resolver.d.ts.map +1 -0
- package/dist/lib/resolvers/types.d.ts +45 -0
- package/dist/lib/resolvers/types.d.ts.map +1 -0
- package/dist/lib/sandbox/ast-utils.d.ts +5 -2
- package/dist/lib/sandbox/ast-utils.d.ts.map +1 -1
- package/dist/lib/sandbox/bash-tool.d.ts.map +1 -1
- package/dist/lib/sandbox/container-tool.d.ts +32 -8
- package/dist/lib/sandbox/container-tool.d.ts.map +1 -1
- package/dist/lib/sandbox/docker-sandbox-errors.d.ts +58 -0
- package/dist/lib/sandbox/docker-sandbox-errors.d.ts.map +1 -0
- package/dist/lib/sandbox/docker-sandbox.d.ts +69 -357
- package/dist/lib/sandbox/docker-sandbox.d.ts.map +1 -1
- package/dist/lib/sandbox/index.d.ts +2 -7
- package/dist/lib/sandbox/index.d.ts.map +1 -1
- package/dist/lib/sandbox/installers/github-release.d.ts +46 -0
- package/dist/lib/sandbox/installers/github-release.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/index.d.ts +7 -0
- package/dist/lib/sandbox/installers/index.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/installer.d.ts +44 -0
- package/dist/lib/sandbox/installers/installer.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/npm.d.ts +32 -0
- package/dist/lib/sandbox/installers/npm.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/package-manager.d.ts +19 -0
- package/dist/lib/sandbox/installers/package-manager.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/pip.d.ts +37 -0
- package/dist/lib/sandbox/installers/pip.d.ts.map +1 -0
- package/dist/lib/sandbox/installers/url-binary.d.ts +41 -0
- package/dist/lib/sandbox/installers/url-binary.d.ts.map +1 -0
- package/dist/lib/sandbox/subcommand.d.ts +11 -11
- package/dist/lib/sandbox/subcommand.d.ts.map +1 -1
- package/dist/lib/sandbox/upload-skills.d.ts +6 -0
- package/dist/lib/sandbox/upload-skills.d.ts.map +1 -1
- package/dist/lib/sandbox/virtual-sandbox.d.ts +10 -0
- package/dist/lib/sandbox/virtual-sandbox.d.ts.map +1 -0
- package/dist/lib/save/reminder-target-handler.d.ts +36 -0
- package/dist/lib/save/reminder-target-handler.d.ts.map +1 -0
- package/dist/lib/save/save-pipeline.d.ts +28 -0
- package/dist/lib/save/save-pipeline.d.ts.map +1 -0
- package/dist/lib/save/tool-output-target-handler.d.ts +7 -0
- package/dist/lib/save/tool-output-target-handler.d.ts.map +1 -0
- package/dist/lib/save/user-target-handler.d.ts +7 -0
- package/dist/lib/save/user-target-handler.d.ts.map +1 -0
- package/dist/lib/stream/change-source.d.ts +11 -0
- package/dist/lib/stream/change-source.d.ts.map +1 -0
- package/dist/lib/stream/ddl.stream.postgres-notify.d.ts +3 -0
- package/dist/lib/stream/ddl.stream.postgres-notify.d.ts.map +1 -0
- package/dist/lib/stream/ddl.stream.postgres.d.ts +2 -0
- package/dist/lib/stream/ddl.stream.postgres.d.ts.map +1 -0
- package/dist/lib/stream/polling-change-source.d.ts +27 -0
- package/dist/lib/stream/polling-change-source.d.ts.map +1 -0
- package/dist/lib/stream/polling-policy.d.ts +0 -1
- package/dist/lib/stream/polling-policy.d.ts.map +1 -1
- package/dist/lib/stream/postgres-notify-change-source.d.ts +15 -0
- package/dist/lib/stream/postgres-notify-change-source.d.ts.map +1 -0
- package/dist/lib/stream/postgres.stream-store.d.ts +29 -0
- package/dist/lib/stream/postgres.stream-store.d.ts.map +1 -0
- package/dist/lib/stream/stream-manager.d.ts +8 -27
- package/dist/lib/stream/stream-manager.d.ts.map +1 -1
- package/dist/lib/ui-message-guards.d.ts +10 -0
- package/dist/lib/ui-message-guards.d.ts.map +1 -0
- package/package.json +2 -7
- package/dist/lib/sandbox/extension.d.ts +0 -39
- package/dist/lib/sandbox/extension.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/demo.d.ts +0 -2
- package/dist/lib/sandbox/openapi/demo.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/extension.d.ts +0 -19
- package/dist/lib/sandbox/openapi/extension.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/format.d.ts +0 -11
- package/dist/lib/sandbox/openapi/format.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/schema.d.ts +0 -9
- package/dist/lib/sandbox/openapi/schema.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/skill/index.d.ts +0 -6
- package/dist/lib/sandbox/openapi/skill/index.d.ts.map +0 -1
- package/dist/lib/sandbox/openapi/skill/index.js +0 -14
- package/dist/lib/sandbox/openapi/skill/index.js.map +0 -7
- package/dist/lib/sandbox/openapi/skill/openapi-cli/SKILL.md +0 -109
- package/dist/lib/sandbox/openapi/validate.d.ts +0 -7
- package/dist/lib/sandbox/openapi/validate.d.ts.map +0 -1
- package/dist/lib/sandbox/routing-sandbox.d.ts +0 -28
- package/dist/lib/sandbox/routing-sandbox.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"docker-sandbox-errors.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/docker-sandbox-errors.ts"],"names":[],"mappings":"AAAA,qBAAa,kBAAmB,SAAQ,KAAK;IAC3C,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;gBAElB,OAAO,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,MAAM;CAKlD;AAED,qBAAa,uBAAwB,SAAQ,kBAAkB;;CAK9D;AAED,qBAAa,sBAAuB,SAAQ,kBAAkB;IAC5D,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,KAAK,CAAC;gBAEX,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,KAAK;CAM1D;AAED,qBAAa,mBAAoB,SAAQ,kBAAkB;IACzD,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,cAAc,EAAE,KAAK,GAAG,SAAS,CAAC;IAC3C,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAGtB,QAAQ,EAAE,MAAM,EAAE,EAClB,KAAK,EAAE,MAAM,EACb,cAAc,EAAE,KAAK,GAAG,SAAS,EACjC,MAAM,EAAE,MAAM,EACd,WAAW,CAAC,EAAE,MAAM;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C,MAAM,EAAE,MAAM,CAAC;gBAEZ,WAAW,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM;CAMhD"}
|
|
@@ -1,476 +1,188 @@
|
|
|
1
1
|
import { type CommandResult, type Sandbox } from 'bash-tool';
|
|
2
|
+
import { type Installer } from './installers/installer.ts';
|
|
2
3
|
export type { CommandResult as ExecResult, Sandbox } from 'bash-tool';
|
|
3
|
-
|
|
4
|
-
* Base error for all Docker sandbox operations.
|
|
5
|
-
*/
|
|
6
|
-
export declare class DockerSandboxError extends Error {
|
|
7
|
-
readonly containerId?: string;
|
|
8
|
-
constructor(message: string, containerId?: string);
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* Thrown when Docker daemon is not available.
|
|
12
|
-
*/
|
|
13
|
-
export declare class DockerNotAvailableError extends DockerSandboxError {
|
|
14
|
-
constructor();
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Thrown when container creation fails.
|
|
18
|
-
*/
|
|
19
|
-
export declare class ContainerCreationError extends DockerSandboxError {
|
|
20
|
-
readonly image: string;
|
|
21
|
-
cause?: Error;
|
|
22
|
-
constructor(message: string, image: string, cause?: Error);
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Thrown when package installation fails.
|
|
26
|
-
*/
|
|
27
|
-
export declare class PackageInstallError extends DockerSandboxError {
|
|
28
|
-
readonly packages: string[];
|
|
29
|
-
readonly image: string;
|
|
30
|
-
readonly packageManager: 'apk' | 'apt-get';
|
|
31
|
-
readonly stderr: string;
|
|
32
|
-
constructor(packages: string[], image: string, packageManager: 'apk' | 'apt-get', stderr: string, containerId?: string);
|
|
33
|
-
}
|
|
34
|
-
/**
|
|
35
|
-
* Thrown when a binary installation from URL fails.
|
|
36
|
-
*/
|
|
37
|
-
export declare class BinaryInstallError extends DockerSandboxError {
|
|
38
|
-
readonly binaryName: string;
|
|
39
|
-
readonly url: string;
|
|
40
|
-
readonly reason: string;
|
|
41
|
-
constructor(binaryName: string, url: string, reason: string, containerId?: string);
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* Thrown when a mount path doesn't exist on the host.
|
|
45
|
-
*/
|
|
46
|
-
export declare class MountPathError extends DockerSandboxError {
|
|
47
|
-
readonly hostPath: string;
|
|
48
|
-
readonly containerPath: string;
|
|
49
|
-
constructor(hostPath: string, containerPath: string);
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Thrown when Dockerfile build fails.
|
|
53
|
-
*/
|
|
54
|
-
export declare class DockerfileBuildError extends DockerSandboxError {
|
|
55
|
-
readonly stderr: string;
|
|
56
|
-
constructor(stderr: string);
|
|
57
|
-
}
|
|
58
|
-
/**
|
|
59
|
-
* Thrown when docker compose up fails.
|
|
60
|
-
*/
|
|
61
|
-
export declare class ComposeStartError extends DockerSandboxError {
|
|
62
|
-
readonly composeFile: string;
|
|
63
|
-
readonly stderr: string;
|
|
64
|
-
constructor(composeFile: string, stderr: string);
|
|
65
|
-
}
|
|
66
|
-
/**
|
|
67
|
-
* Configuration for mounting a host directory into the container.
|
|
68
|
-
*/
|
|
4
|
+
export { ComposeStartError, ContainerCreationError, DockerNotAvailableError, DockerSandboxError, DockerfileBuildError, type InstallErrorOptions, type InstallSource, InstallError, MissingRuntimeError, MountPathError, PackageInstallError, } from './docker-sandbox-errors.ts';
|
|
69
5
|
export interface DockerMount {
|
|
70
|
-
/** Absolute path on the host machine */
|
|
71
6
|
hostPath: string;
|
|
72
|
-
/** Path inside the container */
|
|
73
7
|
containerPath: string;
|
|
74
|
-
/**
|
|
8
|
+
/** Default: `true`. */
|
|
75
9
|
readOnly?: boolean;
|
|
76
10
|
}
|
|
77
|
-
/**
|
|
78
|
-
* Resource limits for the container.
|
|
79
|
-
*/
|
|
80
11
|
export interface DockerResources {
|
|
81
|
-
/**
|
|
12
|
+
/** e.g. `'1g'`, `'512m'`. */
|
|
82
13
|
memory?: string;
|
|
83
|
-
/**
|
|
14
|
+
/** Number of CPUs. */
|
|
84
15
|
cpus?: number;
|
|
85
16
|
}
|
|
86
|
-
/**
|
|
87
|
-
* Architecture-specific URL mapping for binary downloads.
|
|
88
|
-
* Maps container architecture (from `uname -m`) to download URLs.
|
|
89
|
-
*/
|
|
90
|
-
export interface ArchitectureUrls {
|
|
91
|
-
/** URL for x86_64 architecture (amd64) */
|
|
92
|
-
x86_64?: string;
|
|
93
|
-
/** URL for ARM64 architecture (aarch64) */
|
|
94
|
-
aarch64?: string;
|
|
95
|
-
/** URL for ARMv7 architecture */
|
|
96
|
-
armv7l?: string;
|
|
97
|
-
}
|
|
98
|
-
/**
|
|
99
|
-
* Configuration for installing a binary from a URL.
|
|
100
|
-
*
|
|
101
|
-
* Binaries are downloaded, extracted (if tar.gz), and installed to /usr/local/bin.
|
|
102
|
-
*/
|
|
103
|
-
export interface BinaryInstall {
|
|
104
|
-
/** Name of the binary (used for the final executable name) */
|
|
105
|
-
name: string;
|
|
106
|
-
/**
|
|
107
|
-
* URL or architecture-specific URLs.
|
|
108
|
-
* - If a string, used for all architectures
|
|
109
|
-
* - If ArchitectureUrls, selects based on container architecture
|
|
110
|
-
*/
|
|
111
|
-
url: string | ArchitectureUrls;
|
|
112
|
-
/**
|
|
113
|
-
* Optional: The binary filename inside the archive if different from `name`.
|
|
114
|
-
* Useful when the archive contains versioned binaries like "presenterm-0.15.1".
|
|
115
|
-
*/
|
|
116
|
-
binaryPath?: string;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Options for RuntimeStrategy - installs packages/binaries at container runtime.
|
|
120
|
-
*/
|
|
121
17
|
export interface RuntimeSandboxOptions {
|
|
122
|
-
/** Docker image to use (default: 'alpine:latest') */
|
|
18
|
+
/** Docker image to use (default: `'alpine:latest'`). */
|
|
123
19
|
image?: string;
|
|
124
|
-
/**
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
20
|
+
/**
|
|
21
|
+
* Ordered list of installers run after the container starts. Use
|
|
22
|
+
* `pkg([...])`, `urlBinary({...})`, `npm(...)`, `pip(...)`,
|
|
23
|
+
* `githubRelease({...})`, or any custom `Installer` subclass.
|
|
24
|
+
*/
|
|
25
|
+
installers?: Installer[];
|
|
129
26
|
mounts?: DockerMount[];
|
|
130
|
-
/** Resource limits */
|
|
131
27
|
resources?: DockerResources;
|
|
132
|
-
/** Environment variables to set in the container */
|
|
133
28
|
env?: Record<string, string>;
|
|
134
29
|
}
|
|
135
|
-
/**
|
|
136
|
-
* Options for DockerfileStrategy - builds custom image from Dockerfile.
|
|
137
|
-
*/
|
|
138
30
|
export interface DockerfileSandboxOptions {
|
|
139
|
-
/** Dockerfile content (
|
|
31
|
+
/** Inline Dockerfile content (contains `\n`) or a path. */
|
|
140
32
|
dockerfile: string;
|
|
141
|
-
/** Build context directory (default: '.') */
|
|
33
|
+
/** Build context directory (default: `'.'`). */
|
|
142
34
|
context?: string;
|
|
143
|
-
/** Directories to mount from host */
|
|
144
35
|
mounts?: DockerMount[];
|
|
145
|
-
/** Resource limits */
|
|
146
36
|
resources?: DockerResources;
|
|
147
|
-
/** Environment variables to set in the container */
|
|
148
37
|
env?: Record<string, string>;
|
|
149
38
|
}
|
|
150
|
-
/**
|
|
151
|
-
* Options for ComposeStrategy - manages multi-container environments.
|
|
152
|
-
*/
|
|
153
39
|
export interface ComposeSandboxOptions {
|
|
154
|
-
/** Path to docker-compose.yml file */
|
|
155
40
|
compose: string;
|
|
156
|
-
/** Service name to execute commands in (required) */
|
|
157
41
|
service: string;
|
|
158
|
-
/** Resource limits (applied to target service only) */
|
|
159
42
|
resources?: DockerResources;
|
|
160
43
|
}
|
|
161
|
-
/**
|
|
162
|
-
* Union type for Docker sandbox options.
|
|
163
|
-
* - RuntimeSandboxOptions: Runtime package/binary installation
|
|
164
|
-
* - DockerfileSandboxOptions: Pre-built images from Dockerfile
|
|
165
|
-
* - ComposeSandboxOptions: Multi-container environments via Docker Compose
|
|
166
|
-
*/
|
|
167
44
|
export type DockerSandboxOptions = RuntimeSandboxOptions | DockerfileSandboxOptions | ComposeSandboxOptions;
|
|
168
|
-
/**
|
|
169
|
-
* Extended sandbox interface with disposal method.
|
|
170
|
-
*/
|
|
171
45
|
export interface DockerSandbox extends Sandbox {
|
|
172
|
-
/** Stop and remove the container */
|
|
173
46
|
dispose(): Promise<void>;
|
|
174
47
|
}
|
|
175
|
-
/**
|
|
176
|
-
* Type guard to determine if options are for DockerfileStrategy.
|
|
177
|
-
*/
|
|
178
48
|
export declare function isDockerfileOptions(opts: DockerSandboxOptions): opts is DockerfileSandboxOptions;
|
|
179
|
-
/**
|
|
180
|
-
* Type guard to determine if options are for ComposeStrategy.
|
|
181
|
-
*/
|
|
182
49
|
export declare function isComposeOptions(opts: DockerSandboxOptions): opts is ComposeSandboxOptions;
|
|
183
|
-
/**
|
|
184
|
-
* Internal context shared across strategy methods.
|
|
185
|
-
*/
|
|
186
50
|
interface StrategyContext {
|
|
187
51
|
containerId: string;
|
|
188
52
|
image: string;
|
|
189
53
|
}
|
|
54
|
+
export interface DockerSandboxStrategyArgs {
|
|
55
|
+
mounts?: DockerMount[];
|
|
56
|
+
resources?: DockerResources;
|
|
57
|
+
env?: Record<string, string>;
|
|
58
|
+
}
|
|
190
59
|
/**
|
|
191
|
-
*
|
|
192
|
-
*
|
|
193
|
-
*
|
|
194
|
-
* creation algorithm, deferring specific steps to subclasses.
|
|
195
|
-
*
|
|
196
|
-
* @example Extending the strategy
|
|
197
|
-
* ```typescript
|
|
198
|
-
* class CustomStrategy extends DockerSandboxStrategy {
|
|
199
|
-
* protected async getImage(): Promise<string> {
|
|
200
|
-
* // Custom image resolution logic
|
|
201
|
-
* return 'my-custom-image:latest';
|
|
202
|
-
* }
|
|
203
|
-
*
|
|
204
|
-
* protected async configure(): Promise<void> {
|
|
205
|
-
* // Custom configuration after container starts
|
|
206
|
-
* }
|
|
207
|
-
* }
|
|
208
|
-
* ```
|
|
60
|
+
* Template Method base for sandbox creation strategies. Subclasses choose
|
|
61
|
+
* the image and define post-start configuration; the base owns container
|
|
62
|
+
* lifecycle, exec, and file I/O.
|
|
209
63
|
*/
|
|
210
64
|
export declare abstract class DockerSandboxStrategy {
|
|
211
65
|
protected context: StrategyContext;
|
|
212
66
|
protected mounts: DockerMount[];
|
|
213
67
|
protected resources: DockerResources;
|
|
214
68
|
protected env: Record<string, string>;
|
|
215
|
-
constructor(
|
|
216
|
-
/**
|
|
217
|
-
* Template method - defines the algorithm skeleton for creating a sandbox.
|
|
218
|
-
*
|
|
219
|
-
* Steps:
|
|
220
|
-
* 1. Validate mount paths exist on host
|
|
221
|
-
* 2. Get/build the Docker image (strategy-specific)
|
|
222
|
-
* 3. Start the container
|
|
223
|
-
* 4. Configure the container (strategy-specific)
|
|
224
|
-
* 5. Create and return sandbox methods
|
|
225
|
-
*/
|
|
69
|
+
constructor(args?: DockerSandboxStrategyArgs);
|
|
226
70
|
create(): Promise<DockerSandbox>;
|
|
227
|
-
/**
|
|
228
|
-
* Validates that all mount paths exist on the host filesystem.
|
|
229
|
-
*/
|
|
230
71
|
protected validateMounts(): void;
|
|
231
|
-
/**
|
|
232
|
-
* Builds the docker run command arguments.
|
|
233
|
-
*/
|
|
234
72
|
protected buildDockerArgs(image: string, containerId: string): string[];
|
|
235
|
-
/**
|
|
236
|
-
* Starts a Docker container with the given image.
|
|
237
|
-
*/
|
|
238
73
|
protected startContainer(image: string): Promise<string>;
|
|
239
|
-
/**
|
|
240
|
-
* Stops a Docker container.
|
|
241
|
-
*/
|
|
242
74
|
protected stopContainer(containerId: string): Promise<void>;
|
|
243
|
-
/**
|
|
244
|
-
* Executes a command in the container.
|
|
245
|
-
*/
|
|
246
75
|
protected exec(command: string): Promise<CommandResult>;
|
|
247
|
-
/**
|
|
248
|
-
* Creates the DockerSandbox interface with all methods.
|
|
249
|
-
*/
|
|
250
76
|
protected createSandboxMethods(): DockerSandbox;
|
|
251
|
-
/**
|
|
252
|
-
* Returns the Docker image to use for the container.
|
|
253
|
-
* For RuntimeStrategy: returns the image name directly.
|
|
254
|
-
* For DockerfileStrategy: builds the image and returns the tag.
|
|
255
|
-
*/
|
|
256
77
|
protected abstract getImage(): Promise<string>;
|
|
257
|
-
/**
|
|
258
|
-
* Configures the container after it starts.
|
|
259
|
-
* For RuntimeStrategy: installs packages and binaries.
|
|
260
|
-
* For DockerfileStrategy: no-op (Dockerfile already configured).
|
|
261
|
-
*/
|
|
262
78
|
protected abstract configure(): Promise<void>;
|
|
263
79
|
}
|
|
80
|
+
export interface RuntimeStrategyArgs extends DockerSandboxStrategyArgs {
|
|
81
|
+
image?: string;
|
|
82
|
+
installers?: Installer[];
|
|
83
|
+
}
|
|
264
84
|
/**
|
|
265
|
-
*
|
|
266
|
-
* at container runtime.
|
|
267
|
-
*
|
|
268
|
-
* This is the "configure-on-demand" approach - starts a vanilla image and
|
|
269
|
-
* customizes it by executing installation commands.
|
|
85
|
+
* Starts a vanilla image and runs the supplied installers in order.
|
|
270
86
|
*
|
|
271
87
|
* @example
|
|
272
|
-
* ```
|
|
273
|
-
*
|
|
274
|
-
* 'alpine:latest',
|
|
275
|
-
* [
|
|
276
|
-
*
|
|
277
|
-
* )
|
|
278
|
-
*
|
|
88
|
+
* ```ts
|
|
89
|
+
* new RuntimeStrategy({
|
|
90
|
+
* image: 'alpine:latest',
|
|
91
|
+
* installers: [
|
|
92
|
+
* pkg(['curl', 'jq']),
|
|
93
|
+
* urlBinary({ name: 'presenterm', url: {...} }),
|
|
94
|
+
* npm('prettier', { ensureRuntime: true }),
|
|
95
|
+
* ],
|
|
96
|
+
* });
|
|
279
97
|
* ```
|
|
280
98
|
*/
|
|
281
99
|
export declare class RuntimeStrategy extends DockerSandboxStrategy {
|
|
282
100
|
private image;
|
|
283
|
-
private
|
|
284
|
-
|
|
285
|
-
constructor(image?: string, packages?: string[], binaries?: BinaryInstall[], mounts?: DockerMount[], resources?: DockerResources, env?: Record<string, string>);
|
|
101
|
+
private installers;
|
|
102
|
+
constructor(args?: RuntimeStrategyArgs);
|
|
286
103
|
protected getImage(): Promise<string>;
|
|
287
104
|
protected configure(): Promise<void>;
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
/**
|
|
293
|
-
* Installs binaries from URLs.
|
|
294
|
-
*/
|
|
295
|
-
private installBinaries;
|
|
296
|
-
/**
|
|
297
|
-
* Ensures curl is installed in the container.
|
|
298
|
-
*/
|
|
299
|
-
private ensureCurl;
|
|
300
|
-
/**
|
|
301
|
-
* Detects the container's CPU architecture.
|
|
302
|
-
*/
|
|
303
|
-
private detectArchitecture;
|
|
304
|
-
/**
|
|
305
|
-
* Installs a single binary from URL.
|
|
306
|
-
*/
|
|
307
|
-
private installBinary;
|
|
105
|
+
}
|
|
106
|
+
export interface DockerfileStrategyArgs extends DockerSandboxStrategyArgs {
|
|
107
|
+
dockerfile: string;
|
|
108
|
+
context?: string;
|
|
308
109
|
}
|
|
309
110
|
/**
|
|
310
|
-
*
|
|
311
|
-
*
|
|
312
|
-
* This is the "build-once, run-many" approach - builds the image upfront
|
|
313
|
-
* (with caching) and runs containers from the pre-configured image.
|
|
314
|
-
*
|
|
315
|
-
* Image caching: Uses a deterministic tag based on Dockerfile content hash.
|
|
316
|
-
* If the same Dockerfile is used, the existing image is reused (cache hit).
|
|
317
|
-
*
|
|
318
|
-
* @example Inline Dockerfile
|
|
319
|
-
* ```typescript
|
|
320
|
-
* const strategy = new DockerfileStrategy(`
|
|
321
|
-
* FROM alpine:latest
|
|
322
|
-
* RUN apk add --no-cache curl jq
|
|
323
|
-
* `);
|
|
324
|
-
* const sandbox = await strategy.create();
|
|
325
|
-
* ```
|
|
326
|
-
*
|
|
327
|
-
* @example Dockerfile path
|
|
328
|
-
* ```typescript
|
|
329
|
-
* const strategy = new DockerfileStrategy(
|
|
330
|
-
* './Dockerfile.sandbox',
|
|
331
|
-
* './docker', // build context
|
|
332
|
-
* );
|
|
333
|
-
* const sandbox = await strategy.create();
|
|
334
|
-
* ```
|
|
111
|
+
* Builds a custom image from a Dockerfile (with content-hash caching).
|
|
112
|
+
* Runs no post-start configuration — the Dockerfile defines the image.
|
|
335
113
|
*/
|
|
336
114
|
export declare class DockerfileStrategy extends DockerSandboxStrategy {
|
|
337
115
|
private imageTag;
|
|
338
116
|
private dockerfile;
|
|
339
117
|
private dockerContext;
|
|
340
|
-
constructor(
|
|
341
|
-
/**
|
|
342
|
-
* Computes a deterministic image tag based on Dockerfile content.
|
|
343
|
-
* Same Dockerfile → same tag → Docker skips rebuild if image exists.
|
|
344
|
-
*/
|
|
118
|
+
constructor(args: DockerfileStrategyArgs);
|
|
345
119
|
private computeImageTag;
|
|
346
|
-
/**
|
|
347
|
-
* Checks if the dockerfile property is inline content or a file path.
|
|
348
|
-
*/
|
|
349
120
|
private isInlineDockerfile;
|
|
350
121
|
protected getImage(): Promise<string>;
|
|
351
122
|
protected configure(): Promise<void>;
|
|
352
|
-
/**
|
|
353
|
-
* Checks if the image already exists locally.
|
|
354
|
-
*/
|
|
355
123
|
private imageExists;
|
|
356
|
-
/**
|
|
357
|
-
* Builds the Docker image from the Dockerfile.
|
|
358
|
-
*/
|
|
359
124
|
private buildImage;
|
|
360
125
|
}
|
|
126
|
+
export interface ComposeStrategyArgs {
|
|
127
|
+
compose: string;
|
|
128
|
+
service: string;
|
|
129
|
+
resources?: DockerResources;
|
|
130
|
+
}
|
|
361
131
|
/**
|
|
362
|
-
*
|
|
363
|
-
*
|
|
364
|
-
* Unlike other strategies that manage a single container, ComposeStrategy
|
|
365
|
-
* orchestrates multiple services as a unit using docker compose commands.
|
|
366
|
-
*
|
|
367
|
-
* @example
|
|
368
|
-
* ```typescript
|
|
369
|
-
* const strategy = new ComposeStrategy(
|
|
370
|
-
* './docker-compose.yml',
|
|
371
|
-
* 'app', // Service to execute commands in
|
|
372
|
-
* );
|
|
373
|
-
* const sandbox = await strategy.create();
|
|
374
|
-
*
|
|
375
|
-
* // Commands run in the 'app' service
|
|
376
|
-
* await sandbox.executeCommand('node --version');
|
|
377
|
-
*
|
|
378
|
-
* // Can communicate with other services via service names
|
|
379
|
-
* await sandbox.executeCommand('curl http://api:3000/health');
|
|
380
|
-
*
|
|
381
|
-
* // Stops ALL services
|
|
382
|
-
* await sandbox.dispose();
|
|
383
|
-
* ```
|
|
132
|
+
* Manages multi-container environments via `docker compose`.
|
|
133
|
+
* Commands run inside the named service; `dispose()` brings the whole stack down.
|
|
384
134
|
*/
|
|
385
135
|
export declare class ComposeStrategy extends DockerSandboxStrategy {
|
|
386
136
|
private projectName;
|
|
387
137
|
private composeFile;
|
|
388
138
|
private service;
|
|
389
|
-
constructor(
|
|
390
|
-
/**
|
|
391
|
-
* Deterministic project name based on compose file content for caching.
|
|
392
|
-
* Same compose file → same project name → faster subsequent startups.
|
|
393
|
-
*/
|
|
139
|
+
constructor(args: ComposeStrategyArgs);
|
|
394
140
|
private computeProjectName;
|
|
395
|
-
/**
|
|
396
|
-
* Override: No image to get - compose manages its own images.
|
|
397
|
-
*/
|
|
398
141
|
protected getImage(): Promise<string>;
|
|
399
|
-
/**
|
|
400
|
-
* Override: Start all services with docker compose up.
|
|
401
|
-
*/
|
|
402
142
|
protected startContainer(_image: string): Promise<string>;
|
|
403
143
|
protected configure(): Promise<void>;
|
|
404
|
-
/**
|
|
405
|
-
* Override: Execute commands in the target service.
|
|
406
|
-
*/
|
|
407
144
|
protected exec(command: string): Promise<CommandResult>;
|
|
408
|
-
/**
|
|
409
|
-
* Override: Stop all services with docker compose down.
|
|
410
|
-
*/
|
|
411
145
|
protected stopContainer(_containerId: string): Promise<void>;
|
|
412
146
|
}
|
|
413
147
|
/**
|
|
414
|
-
*
|
|
148
|
+
* Create a Docker-backed sandbox.
|
|
415
149
|
*
|
|
416
|
-
*
|
|
417
|
-
*
|
|
418
|
-
*
|
|
419
|
-
* - **ComposeStrategy**: Multi-container environments via Docker Compose
|
|
150
|
+
* @example Runtime with installers
|
|
151
|
+
* ```ts
|
|
152
|
+
* import { createDockerSandbox, pkg, urlBinary, npm } from '@deepagents/context';
|
|
420
153
|
*
|
|
421
|
-
* @example RuntimeStrategy (default)
|
|
422
|
-
* ```typescript
|
|
423
154
|
* const sandbox = await createDockerSandbox({
|
|
424
155
|
* image: 'alpine:latest',
|
|
425
|
-
*
|
|
426
|
-
*
|
|
156
|
+
* installers: [
|
|
157
|
+
* pkg(['curl', 'jq']),
|
|
158
|
+
* urlBinary({ name: 'presenterm', url: {...} }),
|
|
159
|
+
* npm('prettier', { ensureRuntime: true }),
|
|
160
|
+
* ],
|
|
427
161
|
* });
|
|
428
|
-
* await sandbox.executeCommand('curl --version');
|
|
429
|
-
* await sandbox.dispose();
|
|
430
162
|
* ```
|
|
431
163
|
*
|
|
432
|
-
* @example
|
|
433
|
-
* ```
|
|
164
|
+
* @example Dockerfile
|
|
165
|
+
* ```ts
|
|
434
166
|
* const sandbox = await createDockerSandbox({
|
|
435
167
|
* dockerfile: `
|
|
436
168
|
* FROM alpine:latest
|
|
437
169
|
* RUN apk add --no-cache curl jq
|
|
438
170
|
* `,
|
|
439
|
-
* context: '.',
|
|
440
171
|
* });
|
|
441
|
-
* await sandbox.executeCommand('curl --version');
|
|
442
|
-
* await sandbox.dispose();
|
|
443
172
|
* ```
|
|
444
173
|
*
|
|
445
|
-
* @example
|
|
446
|
-
* ```
|
|
174
|
+
* @example Compose
|
|
175
|
+
* ```ts
|
|
447
176
|
* const sandbox = await createDockerSandbox({
|
|
448
177
|
* compose: './docker-compose.yml',
|
|
449
178
|
* service: 'app',
|
|
450
179
|
* });
|
|
451
|
-
* // Commands run in the 'app' service
|
|
452
|
-
* await sandbox.executeCommand('node --version');
|
|
453
|
-
* // Can reach other services by name
|
|
454
|
-
* await sandbox.executeCommand('curl http://db:5432');
|
|
455
|
-
* await sandbox.dispose(); // Stops ALL services
|
|
456
180
|
* ```
|
|
457
181
|
*/
|
|
458
182
|
export declare function createDockerSandbox(options?: DockerSandboxOptions): Promise<DockerSandbox>;
|
|
459
183
|
/**
|
|
460
|
-
*
|
|
461
|
-
*
|
|
462
|
-
*
|
|
463
|
-
* @example
|
|
464
|
-
* ```typescript
|
|
465
|
-
* const output = await useSandbox(
|
|
466
|
-
* { packages: ['curl', 'jq'] },
|
|
467
|
-
* async (sandbox) => {
|
|
468
|
-
* const result = await sandbox.executeCommand('curl --version');
|
|
469
|
-
* return result.stdout;
|
|
470
|
-
* },
|
|
471
|
-
* );
|
|
472
|
-
* // Container is automatically disposed - no try/finally needed
|
|
473
|
-
* ```
|
|
184
|
+
* Run a function with a Docker sandbox; the container is disposed on
|
|
185
|
+
* completion (success or thrown).
|
|
474
186
|
*/
|
|
475
187
|
export declare function useSandbox<T>(options: DockerSandboxOptions, fn: (sandbox: DockerSandbox) => Promise<T>): Promise<T>;
|
|
476
188
|
//# sourceMappingURL=docker-sandbox.d.ts.map
|
|
@@ -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,KAAK,OAAO,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,KAAK,OAAO,EAAE,MAAM,WAAW,CAAC;AAa7D,OAAO,EACL,KAAK,SAAS,EAEf,MAAM,2BAA2B,CAAC;AAEnC,YAAY,EAAE,aAAa,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACtE,OAAO,EACL,iBAAiB,EACjB,sBAAsB,EACtB,uBAAuB,EACvB,kBAAkB,EAClB,oBAAoB,EACpB,KAAK,mBAAmB,EACxB,KAAK,aAAa,EAClB,YAAY,EACZ,mBAAmB,EACnB,cAAc,EACd,mBAAmB,GACpB,MAAM,4BAA4B,CAAC;AAEpC,MAAM,WAAW,WAAW;IAC1B,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,M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B7C,aAAa,CAAC,YAAY,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAc5E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,GAAE,oBAAyB,GACjC,OAAO,CAAC,aAAa,CAAC,CA4BxB;AAED;;;GAGG;AACH,wBAAsB,UAAU,CAAC,CAAC,EAChC,OAAO,EAAE,oBAAoB,EAC7B,EAAE,EAAE,CAAC,OAAO,EAAE,aAAa,KAAK,OAAO,CAAC,CAAC,CAAC,GACzC,OAAO,CAAC,CAAC,CAAC,CAOZ"}
|
|
@@ -1,19 +1,14 @@
|
|
|
1
1
|
export * from './agent-os-sandbox.ts';
|
|
2
|
-
export * from './ast-utils.ts';
|
|
3
2
|
export * from './bash-exception.ts';
|
|
4
3
|
export * from './bash-meta.ts';
|
|
5
4
|
export * from './bash-tool.ts';
|
|
6
|
-
export * from './extension.ts';
|
|
7
5
|
export * from './file-events.ts';
|
|
8
6
|
export * from './binary-bridges.ts';
|
|
9
7
|
export * from './container-tool.ts';
|
|
10
8
|
export * from './docker-sandbox.ts';
|
|
11
|
-
export * from './
|
|
12
|
-
export * from './openapi/extension.ts';
|
|
13
|
-
export * from './openapi/format.ts';
|
|
14
|
-
export * from './openapi/schema.ts';
|
|
15
|
-
export * from './openapi/validate.ts';
|
|
9
|
+
export * from './installers/index.ts';
|
|
16
10
|
export * from './subcommand.ts';
|
|
17
11
|
export * from './types.ts';
|
|
18
12
|
export * from './upload-skills.ts';
|
|
13
|
+
export * from './virtual-sandbox.ts';
|
|
19
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lib/sandbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Installer, type InstallerContext } from './installer.ts';
|
|
2
|
+
export interface GithubReleaseOptions {
|
|
3
|
+
/** GitHub owner (user or org). */
|
|
4
|
+
owner: string;
|
|
5
|
+
/** Repository name. */
|
|
6
|
+
repo: string;
|
|
7
|
+
/** Release tag (e.g. `'v0.15.1'`). */
|
|
8
|
+
version: string;
|
|
9
|
+
/** Final executable name installed under `/usr/local/bin`. */
|
|
10
|
+
name: string;
|
|
11
|
+
/**
|
|
12
|
+
* Build the asset filename for a given container architecture
|
|
13
|
+
* (the result of `uname -m`, e.g. `'x86_64'`, `'aarch64'`).
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* asset: (arch) => `presenterm-0.15.1-${arch}-unknown-linux-musl.tar.gz`
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
asset: (arch: string) => string;
|
|
21
|
+
/** Path inside an extracted archive, when it differs from `name`. */
|
|
22
|
+
binaryPath?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class GithubReleaseInstaller extends Installer {
|
|
25
|
+
readonly kind: string;
|
|
26
|
+
readonly options: GithubReleaseOptions;
|
|
27
|
+
constructor(options: GithubReleaseOptions);
|
|
28
|
+
install(ctx: InstallerContext): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Install a binary from a GitHub release. Resolves arch-specific assets
|
|
32
|
+
* via the `asset(arch)` callback.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* githubRelease({
|
|
37
|
+
* owner: 'mfontanini',
|
|
38
|
+
* repo: 'presenterm',
|
|
39
|
+
* version: 'v0.15.1',
|
|
40
|
+
* name: 'presenterm',
|
|
41
|
+
* asset: (arch) => `presenterm-0.15.1-${arch}-unknown-linux-musl.tar.gz`,
|
|
42
|
+
* });
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function githubRelease(options: GithubReleaseOptions): GithubReleaseInstaller;
|
|
46
|
+
//# sourceMappingURL=github-release.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"github-release.d.ts","sourceRoot":"","sources":["../../../../src/lib/sandbox/installers/github-release.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAGlE,MAAM,WAAW,oBAAoB;IACnC,kCAAkC;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,uBAAuB;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,sCAAsC;IACtC,OAAO,EAAE,MAAM,CAAC;IAChB,8DAA8D;IAC9D,IAAI,EAAE,MAAM,CAAC;IACb;;;;;;;;OAQG;IACH,KAAK,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,CAAC;IAChC,qEAAqE;IACrE,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,qBAAa,sBAAuB,SAAQ,SAAS;IACnD,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,oBAAoB,CAAC;gBAE3B,OAAO,EAAE,oBAAoB;IAMnC,OAAO,CAAC,GAAG,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC;CAepD;AAED;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,aAAa,CAC3B,OAAO,EAAE,oBAAoB,GAC5B,sBAAsB,CAExB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { Installer, type InstallerContext, type PackageManager, createInstallerContext, isDebianBased, shellQuote, } from './installer.ts';
|
|
2
|
+
export { PackageInstaller, pkg } from './package-manager.ts';
|
|
3
|
+
export { type ArchitectureUrls, type UrlBinaryOptions, UrlBinaryInstaller, urlBinary, } from './url-binary.ts';
|
|
4
|
+
export { type NpmInstallerOptions, NpmInstaller, npm } from './npm.ts';
|
|
5
|
+
export { type PipInstallerOptions, PipInstaller, pip } from './pip.ts';
|
|
6
|
+
export { type GithubReleaseOptions, GithubReleaseInstaller, githubRelease, } from './github-release.ts';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|