@mastra/editor 0.9.0-alpha.1 → 0.9.0-alpha.3

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 CHANGED
@@ -1,5 +1,42 @@
1
1
  # @mastra/editor
2
2
 
3
+ ## 0.9.0-alpha.3
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [[`c272d50`](https://github.com/mastra-ai/mastra/commit/c272d50610a54496b6b6d92ccd4d37b333a2613a), [`d8692af`](https://github.com/mastra-ai/mastra/commit/d8692afa253028e39cdce2aafa0ac414071a762e), [`14b69c6`](https://github.com/mastra-ai/mastra/commit/14b69c6b05ce1e50c140b030a48cafb41d0746e3), [`4bd4e8e`](https://github.com/mastra-ai/mastra/commit/4bd4e8e042f6687559f49a560a7914cee9b85447), [`841a222`](https://github.com/mastra-ai/mastra/commit/841a222560d8c19238f8213713f30535cdd82284)]:
8
+ - @mastra/core@1.36.0-alpha.4
9
+ - @mastra/memory@1.19.0-alpha.1
10
+ - @mastra/mcp@1.8.0-alpha.1
11
+
12
+ ## 0.9.0-alpha.2
13
+
14
+ ### Minor Changes
15
+
16
+ - Added an `editor.favorites` namespace so direct (non-HTTP) callers can favorite, unfavorite, and query favorited stored agents/skills through the editor instance. ([#16749](https://github.com/mastra-ai/mastra/pull/16749))
17
+
18
+ ```ts
19
+ import { MastraEditor } from '@mastra/editor';
20
+
21
+ const editor = new MastraEditor({ mastra });
22
+
23
+ // Toggle
24
+ await editor.favorites.favorite({ userId, entityType: 'agent', entityId });
25
+ await editor.favorites.unfavorite({ userId, entityType: 'agent', entityId });
26
+
27
+ // Lookups
28
+ const isFav = await editor.favorites.isFavorited({ userId, entityType: 'agent', entityId });
29
+ const favSet = await editor.favorites.isFavoritedBatch({ userId, entityType: 'agent', entityIds });
30
+ const ids = await editor.favorites.listFavoritedIds({ userId, entityType: 'agent' });
31
+ ```
32
+
33
+ The namespace performs the storage mutation only — visibility and ownership enforcement still belong to the caller (the HTTP route handlers in `@mastra/server` already do this).
34
+
35
+ ### Patch Changes
36
+
37
+ - Updated dependencies [[`5556cc1`](https://github.com/mastra-ai/mastra/commit/5556cc1befec71518d84f826b3bfe3a079a9daf7), [`5499303`](https://github.com/mastra-ai/mastra/commit/54993032c1ebc09642625b78d2014e0cf84a3cae), [`e47bca7`](https://github.com/mastra-ai/mastra/commit/e47bca7b72866d3abd173b9f530ac4318113a8ff), [`0031d0f`](https://github.com/mastra-ai/mastra/commit/0031d0f13831d7843ac5d498734a7d92862e2ce3), [`3498b49`](https://github.com/mastra-ai/mastra/commit/3498b4946be94f4313cd817733589680dcda5278), [`359439b`](https://github.com/mastra-ai/mastra/commit/359439bb8c635e048176306828195f8297f50021)]:
38
+ - @mastra/core@1.36.0-alpha.3
39
+
3
40
  ## 0.9.0-alpha.1
4
41
 
5
42
  ### Minor Changes
package/dist/index.cjs CHANGED
@@ -32,6 +32,7 @@ var index_exports = {};
32
32
  __export(index_exports, {
33
33
  CrudEditorNamespace: () => CrudEditorNamespace,
34
34
  EditorAgentNamespace: () => EditorAgentNamespace,
35
+ EditorFavoritesNamespace: () => EditorFavoritesNamespace,
35
36
  EditorMCPNamespace: () => EditorMCPNamespace,
36
37
  EditorMCPServerNamespace: () => EditorMCPServerNamespace,
37
38
  EditorNamespace: () => EditorNamespace,
@@ -1958,6 +1959,59 @@ var EditorSkillNamespace = class extends CrudEditorNamespace {
1958
1959
  }
1959
1960
  };
1960
1961
 
1962
+ // src/namespaces/favorites.ts
1963
+ var EditorFavoritesNamespace = class extends EditorNamespace {
1964
+ async favorite(input) {
1965
+ this.ensureRegistered();
1966
+ const store = await this.getFavoritesStore();
1967
+ return store.favorite({
1968
+ userId: input.userId,
1969
+ entityType: input.entityType,
1970
+ entityId: input.entityId
1971
+ });
1972
+ }
1973
+ async unfavorite(input) {
1974
+ this.ensureRegistered();
1975
+ const store = await this.getFavoritesStore();
1976
+ return store.unfavorite({
1977
+ userId: input.userId,
1978
+ entityType: input.entityType,
1979
+ entityId: input.entityId
1980
+ });
1981
+ }
1982
+ async isFavorited(input) {
1983
+ this.ensureRegistered();
1984
+ const store = await this.getFavoritesStore();
1985
+ return store.isFavorited({
1986
+ userId: input.userId,
1987
+ entityType: input.entityType,
1988
+ entityId: input.entityId
1989
+ });
1990
+ }
1991
+ async isFavoritedBatch(input) {
1992
+ this.ensureRegistered();
1993
+ if (input.entityIds.length === 0) return /* @__PURE__ */ new Set();
1994
+ const store = await this.getFavoritesStore();
1995
+ return store.isFavoritedBatch({
1996
+ userId: input.userId,
1997
+ entityType: input.entityType,
1998
+ entityIds: input.entityIds
1999
+ });
2000
+ }
2001
+ async listFavoritedIds(input) {
2002
+ this.ensureRegistered();
2003
+ const store = await this.getFavoritesStore();
2004
+ return store.listFavoritedIds({ userId: input.userId, entityType: input.entityType });
2005
+ }
2006
+ async getFavoritesStore() {
2007
+ const storage = this.mastra?.getStorage();
2008
+ if (!storage) throw new Error("Storage is not configured");
2009
+ const store = await storage.getStore("favorites");
2010
+ if (!store) throw new Error("Favorites storage domain is not available");
2011
+ return store;
2012
+ }
2013
+ };
2014
+
1961
2015
  // src/providers.ts
1962
2016
  var import_workspace5 = require("@mastra/core/workspace");
1963
2017
  var import_workspace6 = require("@mastra/core/workspace");
@@ -2036,6 +2090,7 @@ var MastraEditor = class {
2036
2090
  this.scorer = new EditorScorerNamespace(this);
2037
2091
  this.workspace = new EditorWorkspaceNamespace(this);
2038
2092
  this.skill = new EditorSkillNamespace(this);
2093
+ this.favorites = new EditorFavoritesNamespace(this);
2039
2094
  }
2040
2095
  /**
2041
2096
  * Register this editor with a Mastra instance.
@@ -2108,6 +2163,7 @@ var MastraEditor = class {
2108
2163
  0 && (module.exports = {
2109
2164
  CrudEditorNamespace,
2110
2165
  EditorAgentNamespace,
2166
+ EditorFavoritesNamespace,
2111
2167
  EditorMCPNamespace,
2112
2168
  EditorMCPServerNamespace,
2113
2169
  EditorNamespace,
package/dist/index.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Mastra } from '@mastra/core';
2
- import { GetByIdOptions, FilesystemProvider, SandboxProvider, IMastraEditor, BlobStoreProvider, MastraEditorConfig } from '@mastra/core/editor';
2
+ import { GetByIdOptions, IEditorFavoritesNamespace, EditorFavoriteTargetInput, EditorFavoriteToggleResult, EditorIsFavoritedBatchInput, EditorListFavoritedIdsInput, FilesystemProvider, SandboxProvider, IMastraEditor, BlobStoreProvider, MastraEditorConfig } from '@mastra/core/editor';
3
3
  export { MastraEditorConfig } from '@mastra/core/editor';
4
4
  import { IMastraLogger } from '@mastra/core/logger';
5
5
  import { ProcessorProvider } from '@mastra/core/processor-provider';
@@ -310,6 +310,23 @@ declare class EditorSkillNamespace extends CrudEditorNamespace<StorageCreateSkil
310
310
  publish(skillId: string, source: SkillSource, skillPath: string): Promise<StorageResolvedSkillType>;
311
311
  }
312
312
 
313
+ /**
314
+ * Favorites namespace.
315
+ *
316
+ * Verifies the target entity exists and performs the storage mutation.
317
+ * Visibility / ownership enforcement (`assertReadAccess`) lives at the
318
+ * route handler in `@mastra/server`. Direct callers of this namespace must
319
+ * perform their own access check before invoking these methods.
320
+ */
321
+ declare class EditorFavoritesNamespace extends EditorNamespace implements IEditorFavoritesNamespace {
322
+ favorite(input: EditorFavoriteTargetInput): Promise<EditorFavoriteToggleResult>;
323
+ unfavorite(input: EditorFavoriteTargetInput): Promise<EditorFavoriteToggleResult>;
324
+ isFavorited(input: EditorFavoriteTargetInput): Promise<boolean>;
325
+ isFavoritedBatch(input: EditorIsFavoritedBatchInput): Promise<Set<string>>;
326
+ listFavoritedIds(input: EditorListFavoritedIdsInput): Promise<string[]>;
327
+ private getFavoritesStore;
328
+ }
329
+
313
330
  /**
314
331
  * TemplateEngine: Simple variable interpolation for prompt block content.
315
332
  *
@@ -428,6 +445,7 @@ declare class MastraEditor implements IMastraEditor {
428
445
  readonly scorer: EditorScorerNamespace;
429
446
  readonly workspace: EditorWorkspaceNamespace;
430
447
  readonly skill: EditorSkillNamespace;
448
+ readonly favorites: EditorFavoritesNamespace;
431
449
  constructor(config?: MastraEditorConfig);
432
450
  /**
433
451
  * Register this editor with a Mastra instance.
@@ -461,4 +479,4 @@ declare class MastraEditor implements IMastraEditor {
461
479
  resolveBlobStore(providerId?: string, providerConfig?: Record<string, unknown>): Promise<BlobStore>;
462
480
  }
463
481
 
464
- export { CrudEditorNamespace, EditorAgentNamespace, EditorMCPNamespace, EditorMCPServerNamespace, EditorNamespace, EditorPromptNamespace, EditorScorerNamespace, EditorSkillNamespace, EditorWorkspaceNamespace, MastraEditor, type StorageAdapter, evaluateRuleGroup, localFilesystemProvider, localSandboxProvider, renderTemplate, resolveInstructionBlocks };
482
+ export { CrudEditorNamespace, EditorAgentNamespace, EditorFavoritesNamespace, EditorMCPNamespace, EditorMCPServerNamespace, EditorNamespace, EditorPromptNamespace, EditorScorerNamespace, EditorSkillNamespace, EditorWorkspaceNamespace, MastraEditor, type StorageAdapter, evaluateRuleGroup, localFilesystemProvider, localSandboxProvider, renderTemplate, resolveInstructionBlocks };
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { Mastra } from '@mastra/core';
2
- import { GetByIdOptions, FilesystemProvider, SandboxProvider, IMastraEditor, BlobStoreProvider, MastraEditorConfig } from '@mastra/core/editor';
2
+ import { GetByIdOptions, IEditorFavoritesNamespace, EditorFavoriteTargetInput, EditorFavoriteToggleResult, EditorIsFavoritedBatchInput, EditorListFavoritedIdsInput, FilesystemProvider, SandboxProvider, IMastraEditor, BlobStoreProvider, MastraEditorConfig } from '@mastra/core/editor';
3
3
  export { MastraEditorConfig } from '@mastra/core/editor';
4
4
  import { IMastraLogger } from '@mastra/core/logger';
5
5
  import { ProcessorProvider } from '@mastra/core/processor-provider';
@@ -310,6 +310,23 @@ declare class EditorSkillNamespace extends CrudEditorNamespace<StorageCreateSkil
310
310
  publish(skillId: string, source: SkillSource, skillPath: string): Promise<StorageResolvedSkillType>;
311
311
  }
312
312
 
313
+ /**
314
+ * Favorites namespace.
315
+ *
316
+ * Verifies the target entity exists and performs the storage mutation.
317
+ * Visibility / ownership enforcement (`assertReadAccess`) lives at the
318
+ * route handler in `@mastra/server`. Direct callers of this namespace must
319
+ * perform their own access check before invoking these methods.
320
+ */
321
+ declare class EditorFavoritesNamespace extends EditorNamespace implements IEditorFavoritesNamespace {
322
+ favorite(input: EditorFavoriteTargetInput): Promise<EditorFavoriteToggleResult>;
323
+ unfavorite(input: EditorFavoriteTargetInput): Promise<EditorFavoriteToggleResult>;
324
+ isFavorited(input: EditorFavoriteTargetInput): Promise<boolean>;
325
+ isFavoritedBatch(input: EditorIsFavoritedBatchInput): Promise<Set<string>>;
326
+ listFavoritedIds(input: EditorListFavoritedIdsInput): Promise<string[]>;
327
+ private getFavoritesStore;
328
+ }
329
+
313
330
  /**
314
331
  * TemplateEngine: Simple variable interpolation for prompt block content.
315
332
  *
@@ -428,6 +445,7 @@ declare class MastraEditor implements IMastraEditor {
428
445
  readonly scorer: EditorScorerNamespace;
429
446
  readonly workspace: EditorWorkspaceNamespace;
430
447
  readonly skill: EditorSkillNamespace;
448
+ readonly favorites: EditorFavoritesNamespace;
431
449
  constructor(config?: MastraEditorConfig);
432
450
  /**
433
451
  * Register this editor with a Mastra instance.
@@ -461,4 +479,4 @@ declare class MastraEditor implements IMastraEditor {
461
479
  resolveBlobStore(providerId?: string, providerConfig?: Record<string, unknown>): Promise<BlobStore>;
462
480
  }
463
481
 
464
- export { CrudEditorNamespace, EditorAgentNamespace, EditorMCPNamespace, EditorMCPServerNamespace, EditorNamespace, EditorPromptNamespace, EditorScorerNamespace, EditorSkillNamespace, EditorWorkspaceNamespace, MastraEditor, type StorageAdapter, evaluateRuleGroup, localFilesystemProvider, localSandboxProvider, renderTemplate, resolveInstructionBlocks };
482
+ export { CrudEditorNamespace, EditorAgentNamespace, EditorFavoritesNamespace, EditorMCPNamespace, EditorMCPServerNamespace, EditorNamespace, EditorPromptNamespace, EditorScorerNamespace, EditorSkillNamespace, EditorWorkspaceNamespace, MastraEditor, type StorageAdapter, evaluateRuleGroup, localFilesystemProvider, localSandboxProvider, renderTemplate, resolveInstructionBlocks };
package/dist/index.js CHANGED
@@ -1910,6 +1910,59 @@ var EditorSkillNamespace = class extends CrudEditorNamespace {
1910
1910
  }
1911
1911
  };
1912
1912
 
1913
+ // src/namespaces/favorites.ts
1914
+ var EditorFavoritesNamespace = class extends EditorNamespace {
1915
+ async favorite(input) {
1916
+ this.ensureRegistered();
1917
+ const store = await this.getFavoritesStore();
1918
+ return store.favorite({
1919
+ userId: input.userId,
1920
+ entityType: input.entityType,
1921
+ entityId: input.entityId
1922
+ });
1923
+ }
1924
+ async unfavorite(input) {
1925
+ this.ensureRegistered();
1926
+ const store = await this.getFavoritesStore();
1927
+ return store.unfavorite({
1928
+ userId: input.userId,
1929
+ entityType: input.entityType,
1930
+ entityId: input.entityId
1931
+ });
1932
+ }
1933
+ async isFavorited(input) {
1934
+ this.ensureRegistered();
1935
+ const store = await this.getFavoritesStore();
1936
+ return store.isFavorited({
1937
+ userId: input.userId,
1938
+ entityType: input.entityType,
1939
+ entityId: input.entityId
1940
+ });
1941
+ }
1942
+ async isFavoritedBatch(input) {
1943
+ this.ensureRegistered();
1944
+ if (input.entityIds.length === 0) return /* @__PURE__ */ new Set();
1945
+ const store = await this.getFavoritesStore();
1946
+ return store.isFavoritedBatch({
1947
+ userId: input.userId,
1948
+ entityType: input.entityType,
1949
+ entityIds: input.entityIds
1950
+ });
1951
+ }
1952
+ async listFavoritedIds(input) {
1953
+ this.ensureRegistered();
1954
+ const store = await this.getFavoritesStore();
1955
+ return store.listFavoritedIds({ userId: input.userId, entityType: input.entityType });
1956
+ }
1957
+ async getFavoritesStore() {
1958
+ const storage = this.mastra?.getStorage();
1959
+ if (!storage) throw new Error("Storage is not configured");
1960
+ const store = await storage.getStore("favorites");
1961
+ if (!store) throw new Error("Favorites storage domain is not available");
1962
+ return store;
1963
+ }
1964
+ };
1965
+
1913
1966
  // src/providers.ts
1914
1967
  import { LocalFilesystem } from "@mastra/core/workspace";
1915
1968
  import { LocalSandbox } from "@mastra/core/workspace";
@@ -1988,6 +2041,7 @@ var MastraEditor = class {
1988
2041
  this.scorer = new EditorScorerNamespace(this);
1989
2042
  this.workspace = new EditorWorkspaceNamespace(this);
1990
2043
  this.skill = new EditorSkillNamespace(this);
2044
+ this.favorites = new EditorFavoritesNamespace(this);
1991
2045
  }
1992
2046
  /**
1993
2047
  * Register this editor with a Mastra instance.
@@ -2059,6 +2113,7 @@ var MastraEditor = class {
2059
2113
  export {
2060
2114
  CrudEditorNamespace,
2061
2115
  EditorAgentNamespace,
2116
+ EditorFavoritesNamespace,
2062
2117
  EditorMCPNamespace,
2063
2118
  EditorMCPServerNamespace,
2064
2119
  EditorNamespace,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mastra/editor",
3
- "version": "0.9.0-alpha.1",
3
+ "version": "0.9.0-alpha.3",
4
4
  "description": "Mastra Editor for agent management and instantiation",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.js",
@@ -65,7 +65,7 @@
65
65
  "@arcadeai/arcadejs": "^2.3.0",
66
66
  "@composio/core": "^0.6.5",
67
67
  "@composio/mastra": "^0.6.5",
68
- "@mastra/memory": "1.18.3-alpha.0",
68
+ "@mastra/memory": "1.19.0-alpha.1",
69
69
  "@mastra/schema-compat": "1.2.10"
70
70
  },
71
71
  "devDependencies": {
@@ -75,13 +75,13 @@
75
75
  "typescript": "^6.0.3",
76
76
  "vitest": "4.1.5",
77
77
  "zod": "^3.25.76",
78
- "@internal/ai-sdk-v4": "0.0.43",
79
78
  "@internal/ai-sdk-v5": "0.0.43",
80
- "@mastra/hono": "1.4.18-alpha.2",
81
- "@mastra/core": "1.36.0-alpha.2",
79
+ "@mastra/hono": "1.4.18-alpha.4",
82
80
  "@internal/ai-v6": "0.0.43",
81
+ "@mastra/mcp": "1.8.0-alpha.1",
82
+ "@mastra/core": "1.36.0-alpha.4",
83
83
  "@mastra/libsql": "1.11.0",
84
- "@mastra/mcp": "1.7.1-alpha.0"
84
+ "@internal/ai-sdk-v4": "0.0.43"
85
85
  },
86
86
  "peerDependencies": {
87
87
  "@mastra/core": ">=1.13.2-0 <2.0.0-0",