@mastra/platform-workspace 0.0.0-aggregate-trace-20261015182851
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/LICENSE.md +32 -0
- package/README.md +70 -0
- package/dist/address-registry.d.ts +47 -0
- package/dist/address-registry.d.ts.map +1 -0
- package/dist/client.d.ts +72 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/direct-exec.d.ts +98 -0
- package/dist/direct-exec.d.ts.map +1 -0
- package/dist/e2b-exec.d.ts +7 -0
- package/dist/e2b-exec.d.ts.map +1 -0
- package/dist/factory-sandbox.d.ts +39 -0
- package/dist/factory-sandbox.d.ts.map +1 -0
- package/dist/filesystem.d.ts +63 -0
- package/dist/filesystem.d.ts.map +1 -0
- package/dist/index.cjs +2712 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2675 -0
- package/dist/index.js.map +1 -0
- package/dist/private-net-exec.d.ts +114 -0
- package/dist/private-net-exec.d.ts.map +1 -0
- package/dist/provider.d.ts +6 -0
- package/dist/provider.d.ts.map +1 -0
- package/dist/repo-template.d.ts +148 -0
- package/dist/repo-template.d.ts.map +1 -0
- package/dist/sandbox.d.ts +597 -0
- package/dist/sandbox.d.ts.map +1 -0
- package/dist/template.d.ts +95 -0
- package/dist/template.d.ts.map +1 -0
- package/package.json +68 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { type PlatformClientOptions } from './client.js';
|
|
2
|
+
export type JsonPrimitive = null | boolean | number | string;
|
|
3
|
+
export type JsonValue = JsonPrimitive | JsonValue[] | {
|
|
4
|
+
[key: string]: JsonValue;
|
|
5
|
+
};
|
|
6
|
+
export type SandboxTemplateMethod = 'cpuCount' | 'memoryMB' | 'runCmd' | 'setWorkdir' | 'setEnvs' | 'aptInstall' | 'pipInstall' | 'npmInstall';
|
|
7
|
+
export interface SandboxTemplateOperation {
|
|
8
|
+
method: SandboxTemplateMethod;
|
|
9
|
+
args: JsonValue[];
|
|
10
|
+
}
|
|
11
|
+
export interface SerializedSandboxTemplate {
|
|
12
|
+
schemaVersion: 1;
|
|
13
|
+
operations: SandboxTemplateOperation[];
|
|
14
|
+
/**
|
|
15
|
+
* Optional caller-supplied family key that groups successive builds of
|
|
16
|
+
* the "same thing" — e.g. the same repository+workdir across commits,
|
|
17
|
+
* the same recipe across parameter tweaks. For E2B, Platform MAY boot
|
|
18
|
+
* from a prior member with matching effective CPU and memory while the
|
|
19
|
+
* exact template builds in the background. Railway doesn't use family
|
|
20
|
+
* fallback. The server strips this key from exact content identity, so
|
|
21
|
+
* definitions differing only by family share one cache slot; different
|
|
22
|
+
* operations still produce distinct exact builds. Family drives stale
|
|
23
|
+
* lookup separately. Set by builders like `createRepoTemplate`; clients
|
|
24
|
+
* rarely set it directly.
|
|
25
|
+
*/
|
|
26
|
+
family?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface AptInstallOptions {
|
|
29
|
+
noInstallRecommends?: boolean;
|
|
30
|
+
fixMissing?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface PipInstallOptions {
|
|
33
|
+
g?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface NpmInstallOptions {
|
|
36
|
+
g?: boolean;
|
|
37
|
+
dev?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export interface SetEnvsOptions {
|
|
40
|
+
/**
|
|
41
|
+
* Keep these values outside the serialized definition, content identity,
|
|
42
|
+
* and persistent template record. They are supplied only to the live
|
|
43
|
+
* provider build request.
|
|
44
|
+
*/
|
|
45
|
+
ephemeral?: boolean;
|
|
46
|
+
}
|
|
47
|
+
export interface SandboxTemplateBuildOptions extends PlatformClientOptions {
|
|
48
|
+
environmentId?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface SandboxTemplateBuildResult {
|
|
51
|
+
status: 'ready' | 'pending' | 'failed';
|
|
52
|
+
templateId: string;
|
|
53
|
+
retryAfterMs?: number;
|
|
54
|
+
error?: string;
|
|
55
|
+
}
|
|
56
|
+
export interface SandboxTemplateBuilder {
|
|
57
|
+
/**
|
|
58
|
+
* Set the E2B template's CPU count. Defaults to 2. Railway ignores this
|
|
59
|
+
* setting because its sandbox template API doesn't expose resource limits.
|
|
60
|
+
*/
|
|
61
|
+
cpuCount(count: number): SandboxTemplateBuilder;
|
|
62
|
+
/**
|
|
63
|
+
* Set the E2B template's memory in megabytes. Defaults to 1,024. Railway
|
|
64
|
+
* ignores this setting because its sandbox template API doesn't expose
|
|
65
|
+
* resource limits.
|
|
66
|
+
*/
|
|
67
|
+
memoryMB(memoryMB: number): SandboxTemplateBuilder;
|
|
68
|
+
/** Start or reuse this template's provider build without provisioning a sandbox. */
|
|
69
|
+
build(options?: SandboxTemplateBuildOptions): Promise<SandboxTemplateBuildResult>;
|
|
70
|
+
runCmd(command: string | string[]): SandboxTemplateBuilder;
|
|
71
|
+
setWorkdir(path: string): SandboxTemplateBuilder;
|
|
72
|
+
/**
|
|
73
|
+
* Set build environment values. Ephemeral values are sent outside the
|
|
74
|
+
* serialized definition, are unavailable at runtime, and override serialized
|
|
75
|
+
* values with the same key.
|
|
76
|
+
*/
|
|
77
|
+
setEnvs(envs: Record<string, string>, options?: SetEnvsOptions): SandboxTemplateBuilder;
|
|
78
|
+
aptInstall(packages: string | string[], options?: AptInstallOptions): SandboxTemplateBuilder;
|
|
79
|
+
pipInstall(packages?: string | string[], options?: PipInstallOptions): SandboxTemplateBuilder;
|
|
80
|
+
npmInstall(packages?: string | string[], options?: NpmInstallOptions): SandboxTemplateBuilder;
|
|
81
|
+
/**
|
|
82
|
+
* Attach a family key that groups successive builds of the same
|
|
83
|
+
* underlying thing (e.g. a repository+workdir across commits). For E2B,
|
|
84
|
+
* Platform can boot from a prior build with matching effective CPU and
|
|
85
|
+
* memory while the exact template builds. Railway doesn't use family
|
|
86
|
+
* fallback. Excluded from exact content identity — definitions differing
|
|
87
|
+
* only by family share one cache slot, while different operations remain
|
|
88
|
+
* distinct exact builds. Family drives stale lookup separately.
|
|
89
|
+
*/
|
|
90
|
+
withFamily(family: string): SandboxTemplateBuilder;
|
|
91
|
+
}
|
|
92
|
+
export declare function Template(): SandboxTemplateBuilder;
|
|
93
|
+
export declare function serializeSandboxTemplate(template: SandboxTemplateBuilder): SerializedSandboxTemplate;
|
|
94
|
+
export declare function getSandboxTemplateBuildEnvs(template: SandboxTemplateBuilder): Record<string, string> | undefined;
|
|
95
|
+
//# sourceMappingURL=template.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template.d.ts","sourceRoot":"","sources":["../src/template.ts"],"names":[],"mappings":"AAAA,OAAO,EAAkB,KAAK,qBAAqB,EAAE,MAAM,aAAa,CAAC;AAEzE,MAAM,MAAM,aAAa,GAAG,IAAI,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAC7D,MAAM,MAAM,SAAS,GAAG,aAAa,GAAG,SAAS,EAAE,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEnF,MAAM,MAAM,qBAAqB,GAC7B,UAAU,GACV,UAAU,GACV,QAAQ,GACR,YAAY,GACZ,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,YAAY,CAAC;AAEjB,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAE,qBAAqB,CAAC;IAC9B,IAAI,EAAE,SAAS,EAAE,CAAC;CACnB;AAED,MAAM,WAAW,yBAAyB;IACxC,aAAa,EAAE,CAAC,CAAC;IACjB,UAAU,EAAE,wBAAwB,EAAE,CAAC;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,iBAAiB;IAChC,mBAAmB,CAAC,EAAE,OAAO,CAAC;IAC9B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED,MAAM,WAAW,iBAAiB;IAChC,CAAC,CAAC,EAAE,OAAO,CAAC;CACb;AAED,MAA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,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,sBAAsB,CAAC;IAC9F;;;;;;;;OAQG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,sBAAsB,CAAC;CACpD;AAyID,wBAAgB,QAAQ,IAAI,sBAAsB,CAEjD;AAMD,wBAAgB,wBAAwB,CAAC,QAAQ,EAAE,sBAAsB,GAAG,yBAAyB,CAGpG;AAED,wBAAgB,2BAA2B,CAAC,QAAQ,EAAE,sBAAsB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,SAAS,CAGhH"}
|
package/package.json
ADDED
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@mastra/platform-workspace",
|
|
3
|
+
"version": "0.0.0-aggregate-trace-20261015182851",
|
|
4
|
+
"description": "Mastra Platform workspace sandbox and filesystem providers",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"default": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"require": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.cjs"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"./package.json": "./package.json"
|
|
20
|
+
},
|
|
21
|
+
"license": "Apache-2.0",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "22.20.1",
|
|
24
|
+
"@vitest/coverage-v8": "4.1.11",
|
|
25
|
+
"@vitest/ui": "4.1.11",
|
|
26
|
+
"eslint": "^10.4.1",
|
|
27
|
+
"tsdown": "0.22.9",
|
|
28
|
+
"typescript": "^7.0.2",
|
|
29
|
+
"vitest": "4.1.11",
|
|
30
|
+
"@internal/lint": "0.0.0-aggregate-trace-20261015182851",
|
|
31
|
+
"@internal/types-builder": "0.0.0-aggregate-trace-20261015182851",
|
|
32
|
+
"@internal/workspace": "0.0.0-aggregate-trace-20261015182851",
|
|
33
|
+
"@mastra/core": "0.0.0-aggregate-trace-20261015182851"
|
|
34
|
+
},
|
|
35
|
+
"peerDependencies": {
|
|
36
|
+
"@mastra/core": "0.0.0-aggregate-trace-20261015182851"
|
|
37
|
+
},
|
|
38
|
+
"files": [
|
|
39
|
+
"dist"
|
|
40
|
+
],
|
|
41
|
+
"homepage": "https://mastra.ai",
|
|
42
|
+
"repository": {
|
|
43
|
+
"type": "git",
|
|
44
|
+
"url": "git+https://github.com/mastra-ai/mastra.git",
|
|
45
|
+
"directory": "workspaces/platform-workspace"
|
|
46
|
+
},
|
|
47
|
+
"bugs": {
|
|
48
|
+
"url": "https://github.com/mastra-ai/mastra/issues"
|
|
49
|
+
},
|
|
50
|
+
"engines": {
|
|
51
|
+
"node": ">=22.13.0"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"e2b": "^2.38.0"
|
|
55
|
+
},
|
|
56
|
+
"scripts": {
|
|
57
|
+
"build": "tsdown --silent --config tsdown.config.ts",
|
|
58
|
+
"build:lib": "pnpm build",
|
|
59
|
+
"build:watch": "pnpm build --watch",
|
|
60
|
+
"test:unit": "vitest run --exclude '**/*.integration.test.ts'",
|
|
61
|
+
"test:types": "vitest run --typecheck src/template-compatibility.test.ts",
|
|
62
|
+
"test:cloud": "vitest run --passWithNoTests ./src/**/*.integration.test.ts",
|
|
63
|
+
"test:watch": "vitest watch",
|
|
64
|
+
"test": "pnpm test:unit",
|
|
65
|
+
"lint": "oxlint . && eslint .",
|
|
66
|
+
"lint:fix": "oxlint --fix . && eslint --fix ."
|
|
67
|
+
}
|
|
68
|
+
}
|