Skip to content

Commit 309f7c9

Browse files
DanielSLewMastra Code (anthropic/claude-opus-4-7)
andauthored
feat(server): code-mode override export and ownership enforcement (#17228)
Co-authored-by: Mastra Code (anthropic/claude-opus-4-7) <noreply@mastra.ai>
1 parent 3298da3 commit 309f7c9

13 files changed

Lines changed: 5001 additions & 193 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@mastra/server': minor
3+
'@mastra/client-js': minor
4+
---
5+
6+
Added an agent override export API and server-side ownership enforcement.
7+
8+
The server and client now expose an agent override export endpoint so Studio can download an agent's overrides as JSON for review or commit workflows. Saves are enforced server-side against each agent's `editor` config, so only owned fields (instructions, tools, or tool descriptions) are persisted and fields locked by the `editor` config are stripped.
9+
10+
The system packages response also reports the active editor `source` so clients can render the correct editing experience.

client-sdks/client-js/src/resources/stored-agent.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@ import type {
1313
CompareVersionsResponse,
1414
DeleteAgentVersionResponse,
1515
FavoriteToggleResponse,
16+
ExportStoredAgentParams,
17+
ExportStoredAgentResponse,
1618
} from '../types';
1719
import { requestContextQueryString } from '../utils';
1820

@@ -64,6 +66,16 @@ export class StoredAgent extends BaseResource {
6466
);
6567
}
6668

69+
/**
70+
* Exports deterministic JSON for this agent without mutating storage.
71+
*/
72+
export(params: ExportStoredAgentParams): Promise<ExportStoredAgentResponse> {
73+
return this.request(`/stored/agents/${encodeURIComponent(this.storedAgentId)}/export`, {
74+
method: 'POST',
75+
body: params,
76+
});
77+
}
78+
6779
/**
6880
* Deletes the stored agent
6981
* @param requestContext - Optional request context to pass as query parameter

0 commit comments

Comments
 (0)