@mastra/docker 0.14.0-alpha.0 → 0.14.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.
@@ -0,0 +1,45 @@
1
+ import { Sandboxes } from '@docker/sandboxes';
2
+ import type { Sandbox } from '@docker/sandboxes';
3
+ import { MastraSandbox } from '@mastra/core/workspace';
4
+ import type { ProviderStatus, CommandOptions, ExecutionResult, MastraSandboxOptions, SandboxFileInput, SandboxInfo, WriteFilesOptions } from '@mastra/core/workspace';
5
+ export interface DockerSandboxesOptions extends MastraSandboxOptions {
6
+ /** Stable logical id. Use sandboxId to reconnect directly to a known remote VM. */
7
+ id?: string;
8
+ sandboxId?: string;
9
+ image: string;
10
+ /** Docker Cloud Sandboxes client. Supply an authenticated client for cloud access. */
11
+ client?: Sandboxes;
12
+ /** Environment variables set on a newly created cloud sandbox. */
13
+ environment?: Record<string, string>;
14
+ }
15
+ /** Docker Cloud Sandboxes (microVM), separate from the Docker container provider. */
16
+ export declare class DockerSandboxesSandbox extends MastraSandbox<Sandbox> {
17
+ readonly id: string;
18
+ readonly name = "Docker Sandboxes";
19
+ readonly provider = "docker-sandboxes";
20
+ status: ProviderStatus;
21
+ private readonly client;
22
+ private readonly ownsClient;
23
+ private readonly image;
24
+ private readonly environment?;
25
+ private readonly pinnedSandboxId;
26
+ private creationKey;
27
+ private remoteId?;
28
+ private sandbox?;
29
+ private createdAt;
30
+ constructor(options: DockerSandboxesOptions);
31
+ get sandboxId(): string | undefined;
32
+ protected find(): Promise<Sandbox | undefined>;
33
+ protected connect(sandbox: Sandbox): Promise<void>;
34
+ protected create(): Promise<void>;
35
+ stop(): Promise<void>;
36
+ destroy(): Promise<void>;
37
+ /** Run a shell command in the microVM, streaming and retaining bounded output; kill its process if canceled. */
38
+ executeCommand(command: string, args?: string[], options?: CommandOptions): Promise<ExecutionResult>;
39
+ readFile(path: string, encoding: 'utf8'): Promise<string>;
40
+ readFile(path: string): Promise<Uint8Array>;
41
+ writeFiles(files: SandboxFileInput[], options?: WriteFilesOptions): Promise<void>;
42
+ getInstructions(): string;
43
+ getInfo(): SandboxInfo;
44
+ }
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sandboxes/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAAiB,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAiD,MAAM,wBAAwB,CAAC;AACtG,OAAO,KAAK,EACV,cAAc,EACd,cAAc,EACd,eAAe,EACf,oBAAoB,EACpB,gBAAgB,EAChB,WAAW,EACX,iBAAiB,EAClB,MAAM,wBAAwB,CAAC;AAGhC,MAAM,WAAW,sBAAuB,SAAQ,oBAAoB;IAClE,mFAAmF;IACnF,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,sFAAsF;IACtF,MAAM,CAAC,EAAE,SAAS,CAAC;IACnB,kEAAkE;IAClE,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACtC;AAED,qFAAqF;AACrF,qBAAa,sBAAuB,SAAQ,aAAa,CAAC,OAAO,CAAC;IAChE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,QAAQ,sBAAsB;IACvC,MAAM,EAAE,cAAc,CAAa;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,UAAU,CAAU;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAyB;IACtD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAU;IAC1C,OAAO,CAAC,WAAW,CAAgB;IACnC,OAAO,CAAC,QAAQ,CAAC,CAAS;IAC1B,OAAO,CAAC,OAAO,CAAC,CAAU;IAC1B,OAAO,CAAC,SAAS,CAAc;IAE/B,YAAY,OAAO,EAAE,sBAAsB,EAS1C;IAED,IAAI,SAAS,IAAI,MAAM,GAAG,SAAS,CAElC;IAED,UAAgB,IAAI,IAAI,OAAO,CAAC,OAAO,GAAG,SAAS,CAAC,CAgBnD;IAED,UAAgB,OAAO,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAOvD;IAED,UAAgB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAMtC;IAEK,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC,CAE1B;IAEK,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,CAO7B;IAED,gHAAgH;IAC1G,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,GAAE,MAAM,EAAO,EAAE,OAAO,GAAE,cAAmB,GAAG,OAAO,CAAC,eAAe,CAAC,CAmHjH;IAEK,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1D,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAM5C,UAAU,CAAC,KAAK,EAAE,gBAAgB,EAAE,EAAE,OAAO,GAAE,iBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CAc1F;IAED,eAAe,IAAI,MAAM,CAExB;IAED,OAAO,IAAI,WAAW,CASrB;CACF"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/docker",
3
- "version": "0.14.0-alpha.0",
3
+ "version": "0.14.0",
4
4
  "description": "Docker container sandbox provider for Mastra workspaces",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -20,6 +20,7 @@
20
20
  },
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
+ "@docker/sandboxes": "0.53.0",
23
24
  "@grpc/grpc-js": "^1.14.5",
24
25
  "dockerode": "^4.0.12",
25
26
  "tar-stream": "^3.2.2"
@@ -32,11 +33,11 @@
32
33
  "tsdown": "0.23.1",
33
34
  "typescript": "^7.0.2",
34
35
  "vitest": "5.1.0",
35
- "@internal/lint": "0.0.148",
36
- "@internal/types-builder": "0.0.123",
37
- "@internal/workspace": "0.0.20",
38
- "@internal/workspace-test-utils": "0.0.92",
39
- "@mastra/core": "1.83.0-alpha.7"
36
+ "@internal/lint": "0.0.149",
37
+ "@internal/types-builder": "0.0.124",
38
+ "@internal/workspace": "0.0.21",
39
+ "@internal/workspace-test-utils": "0.0.93",
40
+ "@mastra/core": "1.83.0"
40
41
  },
41
42
  "peerDependencies": {
42
43
  "@mastra/core": ">=1.67.0-0 <2.0.0-0"