@mastra/editor 0.17.1-alpha.5 → 0.17.1-alpha.7
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/dist/docs/SKILL.md +1 -1
- package/dist/docs/assets/SOURCE_MAP.json +1 -1
- package/dist/docs/references/reference-editor-mastra-editor.md +1 -1
- package/dist/index.cjs +9 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -9
- package/dist/index.js.map +1 -1
- package/package.json +9 -8
package/dist/docs/SKILL.md
CHANGED
|
@@ -38,7 +38,7 @@ export const mastra = new Mastra({
|
|
|
38
38
|
|
|
39
39
|
**builder** (`AgentBuilderOptions`): Agent Builder configuration. See the AgentBuilderOptions reference. Omit or set enabled: false to disable the Builder.
|
|
40
40
|
|
|
41
|
-
**source** (`'code' | 'db'`): Where agent overrides are stored. With 'db', overrides live in the configured storage backend and Studio shows the save and publish flow. With 'code', overrides live as per-agent JSON files
|
|
41
|
+
**source** (`'code' | 'db'`): Where agent overrides are stored. With 'db', overrides live in the configured storage backend and Studio shows the save and publish flow. With 'code', overrides live as per-agent JSON files at codePath (routed through a local FilesystemStore) and Studio shows filesystem actions. When source is 'code' and a source-control provider is configured, agent overrides are persisted through source-control operations instead of the local filesystem, and the provider controls the repository path. A provider passed as sourceControlProvider uses its own pathPrefix; the provider created from environment variables uses MASTRA_SOURCE_STORAGE_PATH_PREFIX when it is set, and codePath otherwise. The environment provider is created only when MASTRA_SOURCE_PROVIDER is github, an endpoint is set (MASTRA_SOURCE_PROVIDER_ENDPOINT, MASTRA_SHARED_API_URL, or MASTRA_CLOUD_API_ENDPOINT), and a token is set (MASTRA_PLATFORM_ACCESS_TOKEN or MASTRA_CLOUD_ACCESS_TOKEN). Each list is checked in order and the first defined variable wins, so an empty higher-priority variable disables the provider instead of falling back. The endpoint is a Mastra platform API that brokers the GitHub operations, so the provider never calls the GitHub API directly. Without a provider, overrides stay in the local files at codePath. See Editor storage options for the difference. (Default: `'db'`)
|
|
42
42
|
|
|
43
43
|
**codePath** (`string`): Directory used by the 'code' source for per-agent JSON files. Ignored when source is not 'code'. (Default: `'./mastra/editor'`)
|
|
44
44
|
|
package/dist/index.cjs
CHANGED
|
@@ -1317,9 +1317,12 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1317
1317
|
...skillsFormat && { skillsFormat },
|
|
1318
1318
|
...durable !== void 0 && { durable }
|
|
1319
1319
|
});
|
|
1320
|
-
if (!this.getCodeDefinedAgent(storedAgent.id)
|
|
1321
|
-
|
|
1322
|
-
this.
|
|
1320
|
+
if (!this.getCodeDefinedAgent(storedAgent.id)) {
|
|
1321
|
+
agent.source = "stored";
|
|
1322
|
+
if (this.mastra?.listAgents()[storedAgent.id]?.source !== "stored") {
|
|
1323
|
+
this.mastra?.addAgent(agent, storedAgent.id, { source: "stored" });
|
|
1324
|
+
this._registeredStoredAgentIds.add(storedAgent.id);
|
|
1325
|
+
}
|
|
1323
1326
|
}
|
|
1324
1327
|
this.logger?.debug(`[createAgentFromStoredConfig] Successfully created agent "${storedAgent.id}"`);
|
|
1325
1328
|
return agent;
|
|
@@ -1370,14 +1373,11 @@ var EditorAgentNamespace = class extends CrudEditorNamespace {
|
|
|
1370
1373
|
return async (args) => wrap(envelope, await stored(args));
|
|
1371
1374
|
}
|
|
1372
1375
|
const getOriginal = agent.getInstructions.bind(agent);
|
|
1373
|
-
return async (
|
|
1374
|
-
const text = typeof stored === "string" ? stored : await stored(
|
|
1375
|
-
requestContext,
|
|
1376
|
-
mastra
|
|
1377
|
-
});
|
|
1376
|
+
return async (args) => {
|
|
1377
|
+
const text = typeof stored === "string" ? stored : await stored(args);
|
|
1378
1378
|
let original;
|
|
1379
1379
|
try {
|
|
1380
|
-
original = await getOriginal({ requestContext });
|
|
1380
|
+
original = await getOriginal({ requestContext: args.requestContext });
|
|
1381
1381
|
} catch {
|
|
1382
1382
|
return text;
|
|
1383
1383
|
}
|