@mastra/platform-workspace 0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716

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 ADDED
@@ -0,0 +1,86 @@
1
+ # @mastra/platform
2
+
3
+ ## 0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`8a0d145`](https://github.com/mastra-ai/mastra/commit/8a0d145aadbdf7278665aceaaec364b35dd9bd94), [`bd2f1d2`](https://github.com/mastra-ai/mastra/commit/bd2f1d274d05e60e2366f005ea0d94d5cea0d5ff), [`21a0eb8`](https://github.com/mastra-ai/mastra/commit/21a0eb86746ba0b703acea360d4f84c6a5a493f2), [`de86fd7`](https://github.com/mastra-ai/mastra/commit/de86fd7119f0438381d1a642e3d258143c0b9c29), [`2745031`](https://github.com/mastra-ai/mastra/commit/2745031d1d4a4978f037092da371428c32e2842a), [`45613c6`](https://github.com/mastra-ai/mastra/commit/45613c6507f3521909646ff1836cdde903553d8c), [`db650ce`](https://github.com/mastra-ai/mastra/commit/db650ce490348914e85b93651d83acdf8f2a4c31), [`6354eeb`](https://github.com/mastra-ai/mastra/commit/6354eeb32efa9f5f68f51dda394e90e2ee76f1fb)]:
8
+ - @mastra/core@0.0.0-fix-workflow-step-timing-and-parallel-status-20260715180716
9
+
10
+ ## 0.1.0
11
+
12
+ ### Minor Changes
13
+
14
+ - Added Mastra Platform workspace providers for connecting agents to Platform sandboxes and bucket-backed filesystems. ([#18908](https://github.com/mastra-ai/mastra/pull/18908))
15
+
16
+ `PlatformFilesystem` and `PlatformSandbox` extend `MastraFilesystem` / `MastraSandbox` from `@mastra/core/workspace` and speak the workspace-proxy wire format (`Authorization: Bearer sk_*`, project-scoped routes at `/v1/projects/:projectId/...`). Both accept config directly and fall back to env vars (`MASTRA_PLATFORM_ACCESS_TOKEN`, `MASTRA_PROJECT_ID`, `MASTRA_ENVIRONMENT_ID`, `MASTRA_PLATFORM_BUCKET_NAME`, `MASTRA_WORKSPACE_PROXY_URL`).
17
+
18
+ ```ts
19
+ import { Workspace } from '@mastra/core/workspace';
20
+ import { PlatformFilesystem, PlatformSandbox } from '@mastra/platform-workspace';
21
+
22
+ const workspace = new Workspace({
23
+ filesystem: new PlatformFilesystem({ bucketName: 'dev-bucket' }),
24
+ sandbox: new PlatformSandbox({
25
+ environmentId: 'env_123',
26
+ idleTimeoutMinutes: 30,
27
+ networkIsolation: 'ISOLATED',
28
+ }),
29
+ });
30
+ ```
31
+
32
+ Also exports `platformFilesystemProvider` and `platformSandboxProvider` descriptors for hosts that register providers dynamically through the editor's `FilesystemProvider` / `SandboxProvider` registries:
33
+
34
+ ```ts
35
+ import { platformFilesystemProvider, platformSandboxProvider } from '@mastra/platform-workspace';
36
+
37
+ registry.registerFilesystem(platformFilesystemProvider);
38
+ registry.registerSandbox(platformSandboxProvider);
39
+ ```
40
+
41
+ ### Patch Changes
42
+
43
+ - Updated dependencies [[`bd6d240`](https://github.com/mastra-ai/mastra/commit/bd6d2402db93dddaef0721667e7e8a030e7c6e16), [`0111486`](https://github.com/mastra-ai/mastra/commit/01114867612593eef5cfa2fda6a1194dfedda841), [`96a3749`](https://github.com/mastra-ai/mastra/commit/96a37492235f5b8076b3e3177d83ed5a5e44a640), [`fe1bda0`](https://github.com/mastra-ai/mastra/commit/fe1bda06f6af92a694a51712db747cda1e7185f0), [`25e7c12`](https://github.com/mastra-ai/mastra/commit/25e7c126a770069ae7fb7ecf1d2adb40e017b009), [`1ce5121`](https://github.com/mastra-ai/mastra/commit/1ce512155d122bb21f47d98383e82ffbf84b39e8), [`fb8aea3`](https://github.com/mastra-ai/mastra/commit/fb8aea384291e77311be3a64ee1717320d5c3c73), [`4adc391`](https://github.com/mastra-ai/mastra/commit/4adc3911075249c352bb4832d2471922826344de), [`a5c6337`](https://github.com/mastra-ai/mastra/commit/a5c6337d23c7686c81a32ce62f550f610543a240), [`3cfc47a`](https://github.com/mastra-ai/mastra/commit/3cfc47a6b89940aadd0f46fb01ae9624a73a865d), [`2bb7817`](https://github.com/mastra-ai/mastra/commit/2bb78176112fde628483de2830528f7eee911e56), [`51d9870`](https://github.com/mastra-ai/mastra/commit/51d987032c689c2855374d0f244f5d654da809d1), [`5cab274`](https://github.com/mastra-ai/mastra/commit/5cab2744250e22d12fefa7b32637dce224233cee), [`7fa27d3`](https://github.com/mastra-ai/mastra/commit/7fa27d3b6f5ed68cd34e454a4d3ad9c482a0cfbc), [`8b97958`](https://github.com/mastra-ai/mastra/commit/8b979589f9aa59ba67cac565949475f2ffeb4ac3), [`8410541`](https://github.com/mastra-ai/mastra/commit/84105412c60ecd3bb33a9838146f59c4b588228f), [`a58dcbb`](https://github.com/mastra-ai/mastra/commit/a58dcbb546d7e1d65ebdc1f39e55f0908fcd9391), [`aa38805`](https://github.com/mastra-ai/mastra/commit/aa38805b878b827403be785eb90688d7172f5a40), [`153bd3b`](https://github.com/mastra-ai/mastra/commit/153bd3b396bdfed6b74cf43de12db8fd2d83c04a), [`45a8e65`](https://github.com/mastra-ai/mastra/commit/45a8e65e1556d1362cb3f25187023c36de26661d), [`e955965`](https://github.com/mastra-ai/mastra/commit/e955965dce575a903e37cf054d28ea99aa48785e), [`2d22570`](https://github.com/mastra-ai/mastra/commit/2d22570c7dfdd02123d0ecc529efb05ccba2d9fc), [`07bb863`](https://github.com/mastra-ai/mastra/commit/07bb8631919c6f7cf377dccd45b096e0f17fbed0), [`c8ed116`](https://github.com/mastra-ai/mastra/commit/c8ed11699f62bcac70102ab4ec84d80d20541da6), [`01b338c`](https://github.com/mastra-ai/mastra/commit/01b338c56271f0219606710e3e8b26dee27ac6c2), [`a99eae8`](https://github.com/mastra-ai/mastra/commit/a99eae8908e500c1b2d12f9d277be616b98617a5), [`860ef7e`](https://github.com/mastra-ai/mastra/commit/860ef7e77d92b63469cbe5857aa1e626197e43e9), [`17e818c`](https://github.com/mastra-ai/mastra/commit/17e818c51a958ba90641b1a959dc38faf8c034e9), [`edce8d2`](https://github.com/mastra-ai/mastra/commit/edce8d2769f19e27a05737c627af2d765472a4f8), [`8a586ec`](https://github.com/mastra-ai/mastra/commit/8a586eca9a4914f31dff6140d0d45ac375b00669), [`4451dfe`](https://github.com/mastra-ai/mastra/commit/4451dfe857428e7abcc0261a507a2e186dae6d47), [`8b7361d`](https://github.com/mastra-ai/mastra/commit/8b7361d35de68b80d05d30a74e0c69e7218fd612), [`1d39058`](https://github.com/mastra-ai/mastra/commit/1d39058e548efd691799985d5c8af2737f1c3bd2), [`3927473`](https://github.com/mastra-ai/mastra/commit/392747323ddb10c643d12be7b9ae913159dfaeed), [`dce50dc`](https://github.com/mastra-ai/mastra/commit/dce50dc9a1c1fcd0f427bb5f6250ec74910cb04b), [`fd13f8e`](https://github.com/mastra-ai/mastra/commit/fd13f8e21990f9904c3eedba3a626bb4a929cdb8), [`634caff`](https://github.com/mastra-ai/mastra/commit/634caff29a9200ad058b67d53f96d9e5832fb8a2), [`f703f87`](https://github.com/mastra-ai/mastra/commit/f703f878de072d51fda557f9c50867d8252bef05), [`3e26c87`](https://github.com/mastra-ai/mastra/commit/3e26c87de0c5bc2583b795ce6ca5889b6b161acb), [`33f2b88`](https://github.com/mastra-ai/mastra/commit/33f2b88842c09a567f906fac4cb61cd5277ced59), [`177010f`](https://github.com/mastra-ai/mastra/commit/177010ff096d2e4b28d89803be5b1a4cad2a0d6b), [`0ad646f`](https://github.com/mastra-ai/mastra/commit/0ad646f71a530f2454664299e5e01bfd13fa12e5), [`b486abf`](https://github.com/mastra-ai/mastra/commit/b486abfa2a7528c6f527e4015c819ea9fa54aaad), [`54a51e0`](https://github.com/mastra-ai/mastra/commit/54a51e0a484fe1ebad3fb1f7ef5282a075709eb7), [`c43f3a9`](https://github.com/mastra-ai/mastra/commit/c43f3a9d1efde99b38789364ba4d0ba670f430e3), [`a5008f2`](https://github.com/mastra-ai/mastra/commit/a5008f22ae710ad9402ea9f2547d8c02f74d384b), [`e2d5f37`](https://github.com/mastra-ai/mastra/commit/e2d5f373bd289be534d5f8694d34465010533df6), [`4ce0163`](https://github.com/mastra-ai/mastra/commit/4ce0163dc86e675a86809685c8ce6c49f1aeb87e), [`4378341`](https://github.com/mastra-ai/mastra/commit/43783412df5ea3dd35f5b1f6e4851e79c346fc89)]:
44
+ - @mastra/core@1.51.0
45
+
46
+ ## 0.1.0-alpha.0
47
+
48
+ ### Minor Changes
49
+
50
+ - Added Mastra Platform workspace providers for connecting agents to Platform sandboxes and bucket-backed filesystems. ([#18908](https://github.com/mastra-ai/mastra/pull/18908))
51
+
52
+ `PlatformFilesystem` and `PlatformSandbox` extend `MastraFilesystem` / `MastraSandbox` from `@mastra/core/workspace` and speak the workspace-proxy wire format (`Authorization: Bearer sk_*`, project-scoped routes at `/v1/projects/:projectId/...`). Both accept config directly and fall back to env vars (`MASTRA_PLATFORM_ACCESS_TOKEN`, `MASTRA_PROJECT_ID`, `MASTRA_ENVIRONMENT_ID`, `MASTRA_PLATFORM_BUCKET_NAME`, `MASTRA_WORKSPACE_PROXY_URL`).
53
+
54
+ ```ts
55
+ import { Workspace } from '@mastra/core/workspace';
56
+ import { PlatformFilesystem, PlatformSandbox } from '@mastra/platform-workspace';
57
+
58
+ const workspace = new Workspace({
59
+ filesystem: new PlatformFilesystem({ bucketName: 'dev-bucket' }),
60
+ sandbox: new PlatformSandbox({
61
+ environmentId: 'env_123',
62
+ idleTimeoutMinutes: 30,
63
+ networkIsolation: 'ISOLATED',
64
+ }),
65
+ });
66
+ ```
67
+
68
+ Also exports `platformFilesystemProvider` and `platformSandboxProvider` descriptors for hosts that register providers dynamically through the editor's `FilesystemProvider` / `SandboxProvider` registries:
69
+
70
+ ```ts
71
+ import { platformFilesystemProvider, platformSandboxProvider } from '@mastra/platform-workspace';
72
+
73
+ registry.registerFilesystem(platformFilesystemProvider);
74
+ registry.registerSandbox(platformSandboxProvider);
75
+ ```
76
+
77
+ ### Patch Changes
78
+
79
+ - Updated dependencies [[`45a8e65`](https://github.com/mastra-ai/mastra/commit/45a8e65e1556d1362cb3f25187023c36de26661d), [`c8ed116`](https://github.com/mastra-ai/mastra/commit/c8ed11699f62bcac70102ab4ec84d80d20541da6), [`33f2b88`](https://github.com/mastra-ai/mastra/commit/33f2b88842c09a567f906fac4cb61cd5277ced59)]:
80
+ - @mastra/core@1.51.0-alpha.11
81
+
82
+ ## 0.0.1-alpha.0
83
+
84
+ ### Patch Changes
85
+
86
+ - Initial Platform workspace providers.
package/LICENSE.md ADDED
@@ -0,0 +1,30 @@
1
+ Portions of this software are licensed as follows:
2
+
3
+ - All content that resides under any directory named "ee/" within this
4
+ repository, including but not limited to:
5
+ - `packages/core/src/auth/ee/`
6
+ - `packages/server/src/server/auth/ee/`
7
+ is licensed under the license defined in `ee/LICENSE`.
8
+
9
+ - All third-party components incorporated into the Mastra Software are
10
+ licensed under the original license provided by the owner of the
11
+ applicable component.
12
+
13
+ - Content outside of the above-mentioned directories or restrictions is
14
+ available under the "Apache License 2.0" as defined below.
15
+
16
+ # Apache License 2.0
17
+
18
+ Copyright (c) 2025 Kepler Software, Inc.
19
+
20
+ Licensed under the Apache License, Version 2.0 (the "License");
21
+ you may not use this file except in compliance with the License.
22
+ You may obtain a copy of the License at
23
+
24
+ http://www.apache.org/licenses/LICENSE-2.0
25
+
26
+ Unless required by applicable law or agreed to in writing, software
27
+ distributed under the License is distributed on an "AS IS" BASIS,
28
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
+ See the License for the specific language governing permissions and
30
+ limitations under the License.
package/README.md ADDED
@@ -0,0 +1,106 @@
1
+ # @mastra/platform-workspace
2
+
3
+ Mastra Platform workspace provider. Gives agents environment-scoped sandbox execution and bucket-backed filesystem access through the Mastra Platform workspace proxy.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install @mastra/platform-workspace
9
+ ```
10
+
11
+ ## Configuration
12
+
13
+ All options can be passed to the constructor or read from environment variables:
14
+
15
+ | Option | Env var | Required |
16
+ | --------------- | ------------------------------ | ---------------- |
17
+ | `accessToken` | `MASTRA_PLATFORM_ACCESS_TOKEN` | Yes |
18
+ | `projectId` | `MASTRA_PROJECT_ID` | Yes |
19
+ | `environmentId` | `MASTRA_ENVIRONMENT_ID` | Yes (sandbox) |
20
+ | `bucketName` | `MASTRA_PLATFORM_BUCKET_NAME` | Yes (filesystem) |
21
+
22
+ The proxy URL defaults to `https://workspaces.mastra.ai` and can be overridden with the `MASTRA_WORKSPACE_PROXY_URL` env var (useful for staging).
23
+
24
+ Requests to the proxy are authenticated with `Authorization: Bearer <accessToken>`.
25
+
26
+ ## Usage
27
+
28
+ ```typescript
29
+ import { Agent } from '@mastra/core/agent';
30
+ import { Workspace } from '@mastra/core/workspace';
31
+ import { PlatformFilesystem, PlatformSandbox } from '@mastra/platform-workspace';
32
+
33
+ const workspace = new Workspace({
34
+ filesystem: new PlatformFilesystem({
35
+ // accessToken, projectId, bucketName all fall back to env
36
+ }),
37
+ sandbox: new PlatformSandbox({
38
+ // accessToken, projectId, environmentId all fall back to env
39
+ idleTimeoutMinutes: 30,
40
+ networkIsolation: 'ISOLATED',
41
+ }),
42
+ });
43
+
44
+ const agent = new Agent({
45
+ name: 'code-analyzer',
46
+ model: 'anthropic/claude-sonnet-4-5',
47
+ workspace,
48
+ });
49
+ ```
50
+
51
+ ## Filesystem
52
+
53
+ `PlatformFilesystem` implements the Mastra filesystem interface against a workspace bucket. Object keys are percent-encoded per segment, so filenames with `?`, `#`, `%`, `&`, `+`, or spaces are preserved end-to-end.
54
+
55
+ ```typescript
56
+ const fs = new PlatformFilesystem({ bucketName: 'reports' });
57
+
58
+ await fs.writeFile('/analyses/repo.md', markdown);
59
+ const content = await fs.readFile('/analyses/repo.md');
60
+ const entries = await fs.readdir('/analyses');
61
+ await fs.moveFile('/analyses/repo.md', '/analyses/repo-final.md');
62
+ ```
63
+
64
+ Pass `readOnly: true` to mount the bucket read-only. Mutating calls will throw `WorkspaceReadOnlyError`.
65
+
66
+ ## Sandbox
67
+
68
+ `PlatformSandbox` executes commands inside a Railway-backed sandbox tied to a Platform environment. Sessions boot from a pre-built recipe checkpoint (Python 3, Node 22, TypeScript/tsx, common build tooling).
69
+
70
+ ```typescript
71
+ const sandbox = new PlatformSandbox({ environmentId: 'env_abc' });
72
+
73
+ const result = await sandbox.executeCommand('python', ['analyze.py'], {
74
+ timeout: 30_000,
75
+ env: { INPUT: 'repo' },
76
+ });
77
+
78
+ console.log(result.stdout);
79
+ ```
80
+
81
+ Pass an existing `sandboxId` to reattach to a live sandbox instead of creating a new one.
82
+
83
+ ## Errors
84
+
85
+ Failures from the proxy raise `PlatformApiError`. Structured `{ error: { message, type } }` payloads from the proxy are parsed into `.code` (machine kind) and `.proxyMessage` (human string); the raw response body stays available on `.body`:
86
+
87
+ ```typescript
88
+ import { PlatformApiError } from '@mastra/platform-workspace';
89
+
90
+ try {
91
+ await fs.readFile('/missing.txt');
92
+ } catch (err) {
93
+ if (err instanceof PlatformApiError) {
94
+ if (err.code === 'not_found') {
95
+ // handle missing file
96
+ } else if (err.code === 'authentication_error') {
97
+ // refresh token
98
+ }
99
+ console.error(err.status, err.code, err.proxyMessage, err.body);
100
+ }
101
+ }
102
+ ```
103
+
104
+ `code` / `proxyMessage` are `undefined` when the proxy returns a non-JSON body (e.g. an HTML 502 from a load balancer).
105
+
106
+ Filesystem-specific errors (`FileNotFoundError`, `FileExistsError`, `WorkspaceReadOnlyError`) are re-exported from `@mastra/core`.
@@ -0,0 +1,44 @@
1
+ export interface PlatformClientOptions {
2
+ accessToken?: string;
3
+ projectId?: string;
4
+ fetch?: typeof fetch;
5
+ }
6
+ export interface PlatformRequestOptions extends RequestInit {
7
+ query?: Record<string, string | number | boolean | undefined>;
8
+ }
9
+ export declare function requireOption(value: string | undefined, name: string): string;
10
+ export declare function resolvePlatformOptions(options: PlatformClientOptions): {
11
+ accessToken: string;
12
+ projectId: string;
13
+ proxyUrl: string;
14
+ fetch: typeof fetch;
15
+ };
16
+ /**
17
+ * Structured error shape returned by the workspace proxy. All routes emit
18
+ * `{ error: { message, type } }` on failure — see servers/workspace-proxy in
19
+ * the Platform repo. Kept as a wire-level type so callers can switch on
20
+ * `error.code` without re-parsing `error.body`.
21
+ */
22
+ export interface PlatformProxyError {
23
+ message: string;
24
+ /** Machine-readable error kind, e.g. `not_found`, `invalid_request`, `authentication_error`. */
25
+ type: string;
26
+ }
27
+ export declare class PlatformApiError extends Error {
28
+ readonly status: number;
29
+ readonly body: string;
30
+ /** Machine-readable proxy error kind (e.g. `not_found`), when the response body matches `{ error: { message, type } }`. */
31
+ readonly code: string | undefined;
32
+ /** Human-readable proxy error message, when the response body matches `{ error: { message, type } }`. */
33
+ readonly proxyMessage: string | undefined;
34
+ constructor(status: number, body: string);
35
+ }
36
+ export declare class PlatformClient {
37
+ readonly accessToken: string;
38
+ readonly projectId: string;
39
+ readonly proxyUrl: string;
40
+ readonly fetch: typeof fetch;
41
+ constructor(options: PlatformClientOptions);
42
+ request(path: string, options?: PlatformRequestOptions): Promise<Response>;
43
+ }
44
+ //# sourceMappingURL=client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,qBAAqB;IACpC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,KAAK,CAAC;CACtB;AAED,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,KAAK,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,CAAC;CAC/D;AAWD,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,SAAS,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG7E;AAED,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,qBAAqB;;;;;EAOpE;AAED;;;;;GAKG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,gGAAgG;IAChG,IAAI,EAAE,MAAM,CAAC;CACd;AAkBD,qBAAa,gBAAiB,SAAQ,KAAK;IACzC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2HAA2H;IAC3H,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,yGAAyG;IACzG,QAAQ,CAAC,YAAY,EAAE,MAAM,GAAG,SAAS,CAAC;gBAE9B,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;CAUzC;AAED,qBAAa,cAAc;IACzB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,KAAK,EAAE,OAAO,KAAK,CAAC;gBAEjB,OAAO,EAAE,qBAAqB;IAQpC,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B,GAAG,OAAO,CAAC,QAAQ,CAAC;CAoBrF"}
@@ -0,0 +1,62 @@
1
+ import { Buffer } from 'node:buffer';
2
+ import type { RequestContext } from '@mastra/core/request-context';
3
+ import type { CopyOptions, FileContent, FileEntry, FileStat, FilesystemIcon, FilesystemInfo, InstructionsOption, ListOptions, MastraFilesystemOptions, ProviderStatus, ReadOptions, RemoveOptions, WriteOptions } from '@mastra/core/workspace';
4
+ import { MastraFilesystem } from '@mastra/core/workspace';
5
+ import type { PlatformClientOptions } from './client.js';
6
+ export interface PlatformFilesystemOptions extends PlatformClientOptions, MastraFilesystemOptions {
7
+ id?: string;
8
+ bucketName?: string;
9
+ readOnly?: boolean;
10
+ displayName?: string;
11
+ icon?: FilesystemIcon;
12
+ description?: string;
13
+ instructions?: InstructionsOption;
14
+ }
15
+ export declare class PlatformFilesystem extends MastraFilesystem {
16
+ readonly id: string;
17
+ readonly name = "PlatformFilesystem";
18
+ readonly provider = "platform";
19
+ readonly readOnly?: boolean;
20
+ readonly displayName?: string;
21
+ readonly icon: FilesystemIcon;
22
+ readonly description?: string;
23
+ status: ProviderStatus;
24
+ private readonly _client;
25
+ private readonly _bucketName;
26
+ private readonly _instructionsOverride?;
27
+ constructor(options?: PlatformFilesystemOptions);
28
+ private generateId;
29
+ readFile(path: string, options?: ReadOptions): Promise<string | Buffer>;
30
+ writeFile(path: string, content: FileContent, options?: WriteOptions): Promise<void>;
31
+ /**
32
+ * Append bytes to a file.
33
+ *
34
+ * **Not atomic.** Object storage behind the workspace proxy has no native
35
+ * append or compare-and-swap primitive, so this implementation is a
36
+ * read-modify-write: it reads the current contents, concatenates the new
37
+ * bytes, and PUTs the whole object back. Concurrent `appendFile` calls to
38
+ * the same path can overwrite each other's writes ("last write wins").
39
+ * Use `writeFile` with distinct keys for concurrent writers.
40
+ */
41
+ appendFile(path: string, content: FileContent): Promise<void>;
42
+ deleteFile(path: string, options?: RemoveOptions): Promise<void>;
43
+ copyFile(src: string, dest: string, options?: CopyOptions): Promise<void>;
44
+ moveFile(src: string, dest: string, options?: CopyOptions): Promise<void>;
45
+ mkdir(path: string, _options?: {
46
+ recursive?: boolean;
47
+ }): Promise<void>;
48
+ rmdir(path: string, options?: RemoveOptions): Promise<void>;
49
+ readdir(path: string, options?: ListOptions): Promise<FileEntry[]>;
50
+ exists(path: string): Promise<boolean>;
51
+ stat(path: string): Promise<FileStat>;
52
+ realpath(path: string): Promise<string>;
53
+ getInstructions(opts?: {
54
+ requestContext?: RequestContext;
55
+ }): string;
56
+ getInfo(): FilesystemInfo<{
57
+ bucketName: string;
58
+ displayName?: string;
59
+ description?: string;
60
+ }>;
61
+ }
62
+ //# sourceMappingURL=filesystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"filesystem.d.ts","sourceRoot":"","sources":["../src/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