@mastra/daytona 0.0.1 → 0.1.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/CHANGELOG.md +169 -0
- package/LICENSE.md +15 -0
- package/README.md +188 -2
- package/dist/index.cjs +694 -31
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +695 -32
- package/dist/index.js.map +1 -1
- package/dist/sandbox/index.d.ts +63 -11
- package/dist/sandbox/index.d.ts.map +1 -1
- package/dist/sandbox/mounts/gcs.d.ts +20 -0
- package/dist/sandbox/mounts/gcs.d.ts.map +1 -0
- package/dist/sandbox/mounts/index.d.ts +4 -0
- package/dist/sandbox/mounts/index.d.ts.map +1 -0
- package/dist/sandbox/mounts/s3.d.ts +30 -0
- package/dist/sandbox/mounts/s3.d.ts.map +1 -0
- package/dist/sandbox/mounts/types.d.ts +59 -0
- package/dist/sandbox/mounts/types.d.ts.map +1 -0
- package/package.json +7 -5
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"s3.d.ts","sourceRoot":"","sources":["../../../src/sandbox/mounts/s3.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAIpE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C;;;;;;;GAOG;AACH,MAAM,WAAW,oBAAqB,SAAQ,qBAAqB;IACjE,IAAI,EAAE,IAAI,CAAC;IACX,qBAAqB;IACrB,MAAM,EAAE,MAAM,CAAC;IACf,iBAAiB;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,8DAA8D;IAC9D,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,6DAA6D;IAC7D,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,iEAAiE;IACjE,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,wBAAsB,OAAO,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,oBAAoB,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,IAAI,CAAC,CA4I/G"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared types for Daytona mount operations.
|
|
3
|
+
*/
|
|
4
|
+
import type { Sandbox } from '@daytonaio/sdk';
|
|
5
|
+
import type { DaytonaGCSMountConfig } from './gcs.js';
|
|
6
|
+
import type { DaytonaS3MountConfig } from './s3.js';
|
|
7
|
+
export declare const LOG_PREFIX = "[@mastra/daytona]";
|
|
8
|
+
/**
|
|
9
|
+
* Union of mount configs supported by Daytona sandbox.
|
|
10
|
+
*/
|
|
11
|
+
export type DaytonaMountConfig = DaytonaS3MountConfig | DaytonaGCSMountConfig;
|
|
12
|
+
/**
|
|
13
|
+
* Context for mount operations.
|
|
14
|
+
* Abstracts over the Daytona SDK so mount helpers stay SDK-agnostic.
|
|
15
|
+
*/
|
|
16
|
+
export interface MountContext {
|
|
17
|
+
run: (cmd: string, timeoutMs?: number) => Promise<{
|
|
18
|
+
exitCode: number;
|
|
19
|
+
stdout: string;
|
|
20
|
+
stderr: string;
|
|
21
|
+
}>;
|
|
22
|
+
writeFile: (path: string, content: string) => Promise<void>;
|
|
23
|
+
logger: {
|
|
24
|
+
debug: (message: string, ...args: unknown[]) => void;
|
|
25
|
+
info: (message: string, ...args: unknown[]) => void;
|
|
26
|
+
warn: (message: string, ...args: unknown[]) => void;
|
|
27
|
+
error: (message: string, ...args: unknown[]) => void;
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
export declare function validateBucketName(bucket: string): void;
|
|
31
|
+
/**
|
|
32
|
+
* Validate an endpoint URL before interpolating into shell commands.
|
|
33
|
+
* Only http and https schemes are allowed.
|
|
34
|
+
*/
|
|
35
|
+
export declare function validateEndpoint(endpoint: string): void;
|
|
36
|
+
/**
|
|
37
|
+
* Result of running a command in the Daytona sandbox.
|
|
38
|
+
*
|
|
39
|
+
* Note: Daytona's `executeCommand` returns a single combined string (stdout + stderr).
|
|
40
|
+
* There is no separate stderr stream. If you need stderr isolated, redirect it in the
|
|
41
|
+
* shell command itself (e.g. `2>/dev/null` or `2>&1`).
|
|
42
|
+
*/
|
|
43
|
+
export interface CommandResult {
|
|
44
|
+
exitCode: number;
|
|
45
|
+
/** Combined stdout/stderr output from the command. */
|
|
46
|
+
output: string;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Run a command in the Daytona sandbox.
|
|
50
|
+
*
|
|
51
|
+
* Thin wrapper around `sandbox.process.executeCommand` that converts timeout
|
|
52
|
+
* from milliseconds to seconds and null-coalesces the output string.
|
|
53
|
+
*
|
|
54
|
+
* Does NOT throw on non-zero exit codes — callers should check `exitCode`.
|
|
55
|
+
*/
|
|
56
|
+
export declare function runCommand(sandbox: Sandbox, command: string, options?: {
|
|
57
|
+
timeout?: number;
|
|
58
|
+
}): Promise<CommandResult>;
|
|
59
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/sandbox/mounts/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAE9C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,OAAO,CAAC;AACnD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,MAAM,CAAC;AAEjD,eAAO,MAAM,UAAU,sBAAsB,CAAC;AAE9C;;GAEG;AACH,MAAM,MAAM,kBAAkB,GAAG,oBAAoB,GAAG,qBAAqB,CAAC;AAE9E;;;GAGG;AACH,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC;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
|
"description": "Daytona cloud sandbox provider for Mastra workspaces",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -31,10 +31,12 @@
|
|
|
31
31
|
"tsup": "^8.5.1",
|
|
32
32
|
"typescript": "^5.9.3",
|
|
33
33
|
"vitest": "4.0.18",
|
|
34
|
-
"@internal/lint": "0.0.
|
|
35
|
-
"@internal/
|
|
36
|
-
"@internal/
|
|
37
|
-
"@mastra/
|
|
34
|
+
"@internal/lint": "0.0.64",
|
|
35
|
+
"@internal/types-builder": "0.0.39",
|
|
36
|
+
"@internal/workspace-test-utils": "0.0.8",
|
|
37
|
+
"@mastra/gcs": "0.1.1",
|
|
38
|
+
"@mastra/s3": "0.2.1",
|
|
39
|
+
"@mastra/core": "1.9.0"
|
|
38
40
|
},
|
|
39
41
|
"peerDependencies": {
|
|
40
42
|
"@mastra/core": ">=1.3.0-0 <2.0.0-0"
|