@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.
Files changed (110) hide show
  1. package/README.md +44 -11
  2. package/dist/browser.js +171 -15
  3. package/dist/browser.js.map +3 -3
  4. package/dist/index.d.ts +6 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2309 -1233
  7. package/dist/index.js.map +4 -4
  8. package/dist/lib/agent.d.ts +6 -0
  9. package/dist/lib/agent.d.ts.map +1 -1
  10. package/dist/lib/chain-summary.d.ts +18 -0
  11. package/dist/lib/chain-summary.d.ts.map +1 -0
  12. package/dist/lib/engine.d.ts +25 -6
  13. package/dist/lib/engine.d.ts.map +1 -1
  14. package/dist/lib/fragments/message/user.d.ts +21 -2
  15. package/dist/lib/fragments/message/user.d.ts.map +1 -1
  16. package/dist/lib/fragments.d.ts +8 -3
  17. package/dist/lib/fragments.d.ts.map +1 -1
  18. package/dist/lib/resolvers/async-resolver.d.ts +8 -0
  19. package/dist/lib/resolvers/async-resolver.d.ts.map +1 -0
  20. package/dist/lib/resolvers/function-resolver.d.ts +8 -0
  21. package/dist/lib/resolvers/function-resolver.d.ts.map +1 -0
  22. package/dist/lib/resolvers/generator-resolver.d.ts +13 -0
  23. package/dist/lib/resolvers/generator-resolver.d.ts.map +1 -0
  24. package/dist/lib/resolvers/index.d.ts +10 -0
  25. package/dist/lib/resolvers/index.d.ts.map +1 -0
  26. package/dist/lib/resolvers/iterable-resolver.d.ts +12 -0
  27. package/dist/lib/resolvers/iterable-resolver.d.ts.map +1 -0
  28. package/dist/lib/resolvers/loader-resolver.d.ts +13 -0
  29. package/dist/lib/resolvers/loader-resolver.d.ts.map +1 -0
  30. package/dist/lib/resolvers/promise-resolver.d.ts +7 -0
  31. package/dist/lib/resolvers/promise-resolver.d.ts.map +1 -0
  32. package/dist/lib/resolvers/types.d.ts +45 -0
  33. package/dist/lib/resolvers/types.d.ts.map +1 -0
  34. package/dist/lib/sandbox/ast-utils.d.ts +5 -2
  35. package/dist/lib/sandbox/ast-utils.d.ts.map +1 -1
  36. package/dist/lib/sandbox/bash-tool.d.ts.map +1 -1
  37. package/dist/lib/sandbox/container-tool.d.ts +32 -8
  38. package/dist/lib/sandbox/container-tool.d.ts.map +1 -1
  39. package/dist/lib/sandbox/docker-sandbox-errors.d.ts +58 -0
  40. package/dist/lib/sandbox/docker-sandbox-errors.d.ts.map +1 -0
  41. package/dist/lib/sandbox/docker-sandbox.d.ts +69 -357
  42. package/dist/lib/sandbox/docker-sandbox.d.ts.map +1 -1
  43. package/dist/lib/sandbox/index.d.ts +2 -7
  44. package/dist/lib/sandbox/index.d.ts.map +1 -1
  45. package/dist/lib/sandbox/installers/github-release.d.ts +46 -0
  46. package/dist/lib/sandbox/installers/github-release.d.ts.map +1 -0
  47. package/dist/lib/sandbox/installers/index.d.ts +7 -0
  48. package/dist/lib/sandbox/installers/index.d.ts.map +1 -0
  49. package/dist/lib/sandbox/installers/installer.d.ts +44 -0
  50. package/dist/lib/sandbox/installers/installer.d.ts.map +1 -0
  51. package/dist/lib/sandbox/installers/npm.d.ts +32 -0
  52. package/dist/lib/sandbox/installers/npm.d.ts.map +1 -0
  53. package/dist/lib/sandbox/installers/package-manager.d.ts +19 -0
  54. package/dist/lib/sandbox/installers/package-manager.d.ts.map +1 -0
  55. package/dist/lib/sandbox/installers/pip.d.ts +37 -0
  56. package/dist/lib/sandbox/installers/pip.d.ts.map +1 -0
  57. package/dist/lib/sandbox/installers/url-binary.d.ts +41 -0
  58. package/dist/lib/sandbox/installers/url-binary.d.ts.map +1 -0
  59. package/dist/lib/sandbox/subcommand.d.ts +11 -11
  60. package/dist/lib/sandbox/subcommand.d.ts.map +1 -1
  61. package/dist/lib/sandbox/upload-skills.d.ts +6 -0
  62. package/dist/lib/sandbox/upload-skills.d.ts.map +1 -1
  63. package/dist/lib/sandbox/virtual-sandbox.d.ts +10 -0
  64. package/dist/lib/sandbox/virtual-sandbox.d.ts.map +1 -0
  65. package/dist/lib/save/reminder-target-handler.d.ts +36 -0
  66. package/dist/lib/save/reminder-target-handler.d.ts.map +1 -0
  67. package/dist/lib/save/save-pipeline.d.ts +28 -0
  68. package/dist/lib/save/save-pipeline.d.ts.map +1 -0
  69. package/dist/lib/save/tool-output-target-handler.d.ts +7 -0
  70. package/dist/lib/save/tool-output-target-handler.d.ts.map +1 -0
  71. package/dist/lib/save/user-target-handler.d.ts +7 -0
  72. package/dist/lib/save/user-target-handler.d.ts.map +1 -0
  73. package/dist/lib/stream/change-source.d.ts +11 -0
  74. package/dist/lib/stream/change-source.d.ts.map +1 -0
  75. package/dist/lib/stream/ddl.stream.postgres-notify.d.ts +3 -0
  76. package/dist/lib/stream/ddl.stream.postgres-notify.d.ts.map +1 -0
  77. package/dist/lib/stream/ddl.stream.postgres.d.ts +2 -0
  78. package/dist/lib/stream/ddl.stream.postgres.d.ts.map +1 -0
  79. package/dist/lib/stream/polling-change-source.d.ts +27 -0
  80. package/dist/lib/stream/polling-change-source.d.ts.map +1 -0
  81. package/dist/lib/stream/polling-policy.d.ts +0 -1
  82. package/dist/lib/stream/polling-policy.d.ts.map +1 -1
  83. package/dist/lib/stream/postgres-notify-change-source.d.ts +15 -0
  84. package/dist/lib/stream/postgres-notify-change-source.d.ts.map +1 -0
  85. package/dist/lib/stream/postgres.stream-store.d.ts +29 -0
  86. package/dist/lib/stream/postgres.stream-store.d.ts.map +1 -0
  87. package/dist/lib/stream/stream-manager.d.ts +8 -27
  88. package/dist/lib/stream/stream-manager.d.ts.map +1 -1
  89. package/dist/lib/ui-message-guards.d.ts +10 -0
  90. package/dist/lib/ui-message-guards.d.ts.map +1 -0
  91. package/package.json +2 -7
  92. package/dist/lib/sandbox/extension.d.ts +0 -39
  93. package/dist/lib/sandbox/extension.d.ts.map +0 -1
  94. package/dist/lib/sandbox/openapi/demo.d.ts +0 -2
  95. package/dist/lib/sandbox/openapi/demo.d.ts.map +0 -1
  96. package/dist/lib/sandbox/openapi/extension.d.ts +0 -19
  97. package/dist/lib/sandbox/openapi/extension.d.ts.map +0 -1
  98. package/dist/lib/sandbox/openapi/format.d.ts +0 -11
  99. package/dist/lib/sandbox/openapi/format.d.ts.map +0 -1
  100. package/dist/lib/sandbox/openapi/schema.d.ts +0 -9
  101. package/dist/lib/sandbox/openapi/schema.d.ts.map +0 -1
  102. package/dist/lib/sandbox/openapi/skill/index.d.ts +0 -6
  103. package/dist/lib/sandbox/openapi/skill/index.d.ts.map +0 -1
  104. package/dist/lib/sandbox/openapi/skill/index.js +0 -14
  105. package/dist/lib/sandbox/openapi/skill/index.js.map +0 -7
  106. package/dist/lib/sandbox/openapi/skill/openapi-cli/SKILL.md +0 -109
  107. package/dist/lib/sandbox/openapi/validate.d.ts +0 -7
  108. package/dist/lib/sandbox/openapi/validate.d.ts.map +0 -1
  109. package/dist/lib/sandbox/routing-sandbox.d.ts +0 -28
  110. 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,KAA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nB,QAAQ,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM;CAQpD;AAED,qBAAa,oBAAqB,SAAQ,kBAAkB;IAC1D,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;gBAEZ,MAAM,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,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
- /** Whether the mount is read-only (default: true) */
8
+ /** Default: `true`. */
75
9
  readOnly?: boolean;
76
10
  }
77
- /**
78
- * Resource limits for the container.
79
- */
80
11
  export interface DockerResources {
81
- /** Memory limit (e.g., '1g', '512m') */
12
+ /** e.g. `'1g'`, `'512m'`. */
82
13
  memory?: string;
83
- /** CPU limit (number of CPUs) */
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
- /** Packages to install in the container via package manager (apk/apt) */
125
- packages?: string[];
126
- /** Binaries to install from URLs (for tools not in package managers) */
127
- binaries?: BinaryInstall[];
128
- /** Directories to mount from host */
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 (if contains newlines) or path to Dockerfile */
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
- * Abstract base class for Docker sandbox creation strategies.
192
- *
193
- * Uses the Template Method pattern to define the skeleton of the sandbox
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(mounts?: DockerMount[], resources?: DockerResources, env?: Record<string, string>);
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
- * Strategy that uses an existing Docker image and installs packages/binaries
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
- * ```typescript
273
- * const strategy = new RuntimeStrategy(
274
- * 'alpine:latest',
275
- * ['curl', 'jq'],
276
- * [{ name: 'presenterm', url: {...} }],
277
- * );
278
- * const sandbox = await strategy.create();
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 packages;
284
- private binaries;
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
- * Installs packages using the appropriate package manager (apk/apt-get).
290
- */
291
- private installPackages;
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
- * Strategy that builds a custom Docker image from a Dockerfile.
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(dockerfile: string, dockerContext?: string, mounts?: DockerMount[], resources?: DockerResources, env?: Record<string, string>);
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
- * Strategy that manages multi-container environments using Docker Compose.
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(composeFile: string, service: string, resources?: DockerResources);
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
- * Creates a Docker-based sandbox for executing commands in an isolated container.
148
+ * Create a Docker-backed sandbox.
415
149
  *
416
- * Supports three strategies:
417
- * - **RuntimeStrategy**: Uses existing image, installs packages/binaries at runtime
418
- * - **DockerfileStrategy**: Builds custom image from Dockerfile (with caching)
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
- * packages: ['curl', 'jq'],
426
- * binaries: [{ name: 'presenterm', url: {...} }],
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 DockerfileStrategy
433
- * ```typescript
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 ComposeStrategy
446
- * ```typescript
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
- * Execute a function with a Docker sandbox that auto-disposes on completion.
461
- * Ensures cleanup even if the function throws.
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;AAM7D,YAAY,EAAE,aAAa,IAAI,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAMtE;;GAEG;AACH,qBAAa,kBAAmB,SAAQ,KAAK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cAsBxD,SAAS,IAAI,OAAO,CAAC,IAAI,CAAC;cAIjB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,aAAa,CAAC;cA8B7C,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 './routing-sandbox.ts';
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,gBAAgB,CAAC;AAC/B,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,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,sBAAsB,CAAC;AACrC,cAAc,wBAAwB,CAAC;AACvC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,uBAAuB,CAAC;AACtC,cAAc,iBAAiB,CAAC;AAChC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,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