@mastra/core 1.24.0-alpha.1 → 1.24.1-alpha.0
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 +81 -0
- package/dist/agent/index.cjs +8 -8
- package/dist/agent/index.js +1 -1
- package/dist/browser/index.cjs +2 -2
- package/dist/browser/index.js +1 -1
- package/dist/channels/index.cjs +4 -4
- package/dist/channels/index.js +1 -1
- package/dist/{chunk-BFOZOAU2.cjs → chunk-4636ENMP.cjs} +56 -108
- package/dist/chunk-4636ENMP.cjs.map +1 -0
- package/dist/{chunk-MK5IF24D.js → chunk-5CPRW7GV.js} +3 -3
- package/dist/{chunk-MK5IF24D.js.map → chunk-5CPRW7GV.js.map} +1 -1
- package/dist/{chunk-EJ62D3QH.js → chunk-6TQZIQ23.js} +6 -6
- package/dist/{chunk-EJ62D3QH.js.map → chunk-6TQZIQ23.js.map} +1 -1
- package/dist/{chunk-L73KZFX6.cjs → chunk-AX3PKXOT.cjs} +6 -6
- package/dist/{chunk-L73KZFX6.cjs.map → chunk-AX3PKXOT.cjs.map} +1 -1
- package/dist/{chunk-365PDOQ4.cjs → chunk-CNCOPROQ.cjs} +9 -9
- package/dist/{chunk-365PDOQ4.cjs.map → chunk-CNCOPROQ.cjs.map} +1 -1
- package/dist/{chunk-CY4AMNDV.cjs → chunk-H2SFI3RZ.cjs} +7 -7
- package/dist/{chunk-CY4AMNDV.cjs.map → chunk-H2SFI3RZ.cjs.map} +1 -1
- package/dist/{chunk-D64ZY3NT.cjs → chunk-HAF2U4ON.cjs} +17 -17
- package/dist/{chunk-D64ZY3NT.cjs.map → chunk-HAF2U4ON.cjs.map} +1 -1
- package/dist/{chunk-GAW7WFCY.js → chunk-IWMYLZQ6.js} +3 -3
- package/dist/{chunk-GAW7WFCY.js.map → chunk-IWMYLZQ6.js.map} +1 -1
- package/dist/{chunk-PCHML5XO.js → chunk-JG7M2F2C.js} +4 -4
- package/dist/{chunk-PCHML5XO.js.map → chunk-JG7M2F2C.js.map} +1 -1
- package/dist/{chunk-JBFAGOAG.js → chunk-JRTGAEET.js} +9 -9
- package/dist/{chunk-JBFAGOAG.js.map → chunk-JRTGAEET.js.map} +1 -1
- package/dist/{chunk-SYH64AGV.cjs → chunk-K2NJIVZ5.cjs} +14 -14
- package/dist/{chunk-SYH64AGV.cjs.map → chunk-K2NJIVZ5.cjs.map} +1 -1
- package/dist/{chunk-IKUMKFM4.js → chunk-KQABOPAK.js} +4 -4
- package/dist/{chunk-IKUMKFM4.js.map → chunk-KQABOPAK.js.map} +1 -1
- package/dist/{chunk-3RI7ILBW.js → chunk-MYYPIBLR.js} +3 -3
- package/dist/{chunk-3RI7ILBW.js.map → chunk-MYYPIBLR.js.map} +1 -1
- package/dist/{chunk-SUEVJYTA.cjs → chunk-NC3NDZWM.cjs} +185 -185
- package/dist/{chunk-SUEVJYTA.cjs.map → chunk-NC3NDZWM.cjs.map} +1 -1
- package/dist/{chunk-EAQQP6OK.cjs → chunk-NWGH6OSA.cjs} +48 -48
- package/dist/{chunk-EAQQP6OK.cjs.map → chunk-NWGH6OSA.cjs.map} +1 -1
- package/dist/{chunk-V657RNGK.js → chunk-Q55SOMNM.js} +44 -96
- package/dist/chunk-Q55SOMNM.js.map +1 -0
- package/dist/{chunk-LUEXY2QV.js → chunk-QBUDLHGF.js} +3 -3
- package/dist/{chunk-LUEXY2QV.js.map → chunk-QBUDLHGF.js.map} +1 -1
- package/dist/{chunk-CN6AFOVV.js → chunk-RKBY3V7R.js} +4 -4
- package/dist/{chunk-CN6AFOVV.js.map → chunk-RKBY3V7R.js.map} +1 -1
- package/dist/{chunk-XEDVYHBK.cjs → chunk-W7JPJ5VP.cjs} +3 -3
- package/dist/{chunk-XEDVYHBK.cjs.map → chunk-W7JPJ5VP.cjs.map} +1 -1
- package/dist/{chunk-B2FQ6L2I.cjs → chunk-XCFSSKCI.cjs} +5 -5
- package/dist/{chunk-B2FQ6L2I.cjs.map → chunk-XCFSSKCI.cjs.map} +1 -1
- package/dist/{chunk-PQKSETS5.js → chunk-XOJF3SNB.js} +3 -3
- package/dist/{chunk-PQKSETS5.js.map → chunk-XOJF3SNB.js.map} +1 -1
- package/dist/{chunk-FCW225T4.cjs → chunk-Y6I7BKY3.cjs} +77 -77
- package/dist/{chunk-FCW225T4.cjs.map → chunk-Y6I7BKY3.cjs.map} +1 -1
- package/dist/datasets/index.cjs +11 -11
- package/dist/datasets/index.js +1 -1
- package/dist/docs/SKILL.md +6 -1
- package/dist/docs/assets/SOURCE_MAP.json +133 -133
- package/dist/docs/references/docs-editor-overview.md +221 -0
- package/dist/docs/references/docs-editor-prompts.md +134 -0
- package/dist/docs/references/docs-editor-tools.md +152 -0
- package/dist/docs/references/docs-studio-overview.md +2 -0
- package/dist/docs/references/reference-client-js-agents.md +136 -0
- package/dist/docs/references/reference-core-getEditor.md +35 -0
- package/dist/docs/references/reference-editor-mastra-editor.md +168 -0
- package/dist/docs/references/reference.md +3 -0
- package/dist/evals/index.cjs +5 -5
- package/dist/evals/index.js +2 -2
- package/dist/evals/scoreTraces/index.cjs +3 -3
- package/dist/evals/scoreTraces/index.js +1 -1
- package/dist/harness/index.cjs +7 -7
- package/dist/harness/index.js +5 -5
- package/dist/index.cjs +2 -2
- package/dist/index.js +1 -1
- package/dist/llm/index.cjs +20 -20
- package/dist/llm/index.js +5 -5
- package/dist/llm/model/provider-types.generated.d.ts +15 -40
- package/dist/loop/index.cjs +14 -14
- package/dist/loop/index.js +1 -1
- package/dist/mastra/index.cjs +2 -2
- package/dist/mastra/index.js +1 -1
- package/dist/mastra-KYZOJWVP.cjs +12 -0
- package/dist/{mastra-7CFH7DGM.cjs.map → mastra-KYZOJWVP.cjs.map} +1 -1
- package/dist/mastra-THXHB2YW.js +3 -0
- package/dist/{mastra-5YHFXAJO.js.map → mastra-THXHB2YW.js.map} +1 -1
- package/dist/memory/index.cjs +19 -19
- package/dist/memory/index.js +1 -1
- package/dist/models-dev-JNR72RHW.cjs +12 -0
- package/dist/{models-dev-X2MWNPAU.cjs.map → models-dev-JNR72RHW.cjs.map} +1 -1
- package/dist/models-dev-Y4N5GCLA.js +3 -0
- package/dist/{models-dev-ZXC3IYLG.js.map → models-dev-Y4N5GCLA.js.map} +1 -1
- package/dist/netlify-C25NVF5O.cjs +12 -0
- package/dist/{netlify-GOILLTQO.cjs.map → netlify-C25NVF5O.cjs.map} +1 -1
- package/dist/netlify-IGYUFSZG.js +3 -0
- package/dist/{netlify-HJL7EXHY.js.map → netlify-IGYUFSZG.js.map} +1 -1
- package/dist/processor-provider/index.cjs +10 -10
- package/dist/processor-provider/index.js +1 -1
- package/dist/processors/index.cjs +44 -44
- package/dist/processors/index.js +1 -1
- package/dist/provider-registry-3HZNLU3V.js +3 -0
- package/dist/{provider-registry-UWTCPEFF.js.map → provider-registry-3HZNLU3V.js.map} +1 -1
- package/dist/provider-registry-PKUEVZXH.cjs +44 -0
- package/dist/{provider-registry-25ELOB67.cjs.map → provider-registry-PKUEVZXH.cjs.map} +1 -1
- package/dist/provider-registry.json +36 -88
- package/dist/relevance/index.cjs +3 -3
- package/dist/relevance/index.js +1 -1
- package/dist/stream/index.cjs +8 -8
- package/dist/stream/index.js +1 -1
- package/dist/tool-loop-agent/index.cjs +4 -4
- package/dist/tool-loop-agent/index.js +1 -1
- package/dist/workflows/evented/index.cjs +10 -10
- package/dist/workflows/evented/index.js +1 -1
- package/dist/workflows/index.cjs +24 -24
- package/dist/workflows/index.js +1 -1
- package/package.json +9 -9
- package/src/llm/model/provider-types.generated.d.ts +15 -40
- package/dist/chunk-BFOZOAU2.cjs.map +0 -1
- package/dist/chunk-V657RNGK.js.map +0 -1
- package/dist/mastra-5YHFXAJO.js +0 -3
- package/dist/mastra-7CFH7DGM.cjs +0 -12
- package/dist/models-dev-X2MWNPAU.cjs +0 -12
- package/dist/models-dev-ZXC3IYLG.js +0 -3
- package/dist/netlify-GOILLTQO.cjs +0 -12
- package/dist/netlify-HJL7EXHY.js +0 -3
- package/dist/provider-registry-25ELOB67.cjs +0 -44
- package/dist/provider-registry-UWTCPEFF.js +0 -3
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# Mastra.getEditor()
|
|
2
|
+
|
|
3
|
+
The `.getEditor()` method is used to retrieve the editor instance that has been configured on the Mastra instance. The editor exposes CRUD namespaces for managing stored agents, prompt blocks, MCP clients, scorers, skills, and workspaces programmatically.
|
|
4
|
+
|
|
5
|
+
## Usage example
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { Mastra } from '@mastra/core'
|
|
9
|
+
import { MastraEditor } from '@mastra/editor'
|
|
10
|
+
|
|
11
|
+
const mastra = new Mastra({
|
|
12
|
+
editor: new MastraEditor(),
|
|
13
|
+
})
|
|
14
|
+
|
|
15
|
+
const editor = mastra.getEditor()
|
|
16
|
+
|
|
17
|
+
const agent = await editor?.agent.create({
|
|
18
|
+
id: 'support-agent',
|
|
19
|
+
name: 'Support Agent',
|
|
20
|
+
instructions: 'Help customers with their questions.',
|
|
21
|
+
})
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Parameters
|
|
25
|
+
|
|
26
|
+
This method doesn't accept any parameters.
|
|
27
|
+
|
|
28
|
+
## Returns
|
|
29
|
+
|
|
30
|
+
**editor** (`MastraEditor | undefined`): The configured editor instance, or undefined if no editor has been configured.
|
|
31
|
+
|
|
32
|
+
## Related
|
|
33
|
+
|
|
34
|
+
- [Editor overview](https://mastra.ai/docs/editor/overview)
|
|
35
|
+
- [MastraEditor reference](https://mastra.ai/reference/editor/mastra-editor)
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
# MastraEditor class
|
|
2
|
+
|
|
3
|
+
The `MastraEditor` class sets up the editor system. Pass it to the `Mastra` constructor to turn on editor features like prompt blocks, agent code override, versioning, and tool providers.
|
|
4
|
+
|
|
5
|
+
See the [Editor overview](https://mastra.ai/docs/editor/overview) for an introduction to what the editor does.
|
|
6
|
+
|
|
7
|
+
## Usage example
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { Mastra } from '@mastra/core'
|
|
11
|
+
import { MastraEditor } from '@mastra/editor'
|
|
12
|
+
import { ComposioToolProvider } from '@mastra/editor/providers/composio'
|
|
13
|
+
|
|
14
|
+
export const mastra = new Mastra({
|
|
15
|
+
agents: {
|
|
16
|
+
/* your agents */
|
|
17
|
+
},
|
|
18
|
+
editor: new MastraEditor({
|
|
19
|
+
toolProviders: {
|
|
20
|
+
composio: new ComposioToolProvider({
|
|
21
|
+
apiKey: process.env.COMPOSIO_API_KEY!,
|
|
22
|
+
}),
|
|
23
|
+
},
|
|
24
|
+
}),
|
|
25
|
+
})
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Constructor parameters
|
|
29
|
+
|
|
30
|
+
**logger** (`Logger`): Logger instance. Falls back to the Mastra instance logger if not set.
|
|
31
|
+
|
|
32
|
+
**toolProviders** (`Record<string, ToolProvider>`): Integration tool providers keyed by ID (for example, Composio or Arcade). Lets agents use third-party tools added through the editor. (Default: `{}`)
|
|
33
|
+
|
|
34
|
+
**processorProviders** (`Record<string, ProcessorProvider>`): Processor providers for configurable input/output processing (for example, moderation or token limiting). Built-in providers are always included. (Default: `{}`)
|
|
35
|
+
|
|
36
|
+
**filesystems** (`Record<string, FilesystemProvider>`): Filesystem providers for file access (for example, S3 or GCS). A local filesystem provider is always included. (Default: `{}`)
|
|
37
|
+
|
|
38
|
+
**sandboxes** (`Record<string, SandboxProvider>`): Sandbox providers for code execution (for example, E2B). A local sandbox provider is always included. (Default: `{}`)
|
|
39
|
+
|
|
40
|
+
**blobStores** (`Record<string, BlobStoreProvider>`): Blob storage providers for binary data (for example, S3). Falls back to the Mastra storage blob store if no provider is specified. (Default: `{}`)
|
|
41
|
+
|
|
42
|
+
## Namespaces
|
|
43
|
+
|
|
44
|
+
The editor exposes namespaces for managing different entity types. Access them from any Mastra instance with `mastra.getEditor()` and call the CRUD methods directly in application code, or rely on the Mastra server routes that use them under the hood.
|
|
45
|
+
|
|
46
|
+
All namespaces extend a shared CRUD base class, so they expose the same `create`, `getById`, `update`, `delete`, `list`, `listResolved`, and `clearCache` methods. The namespace-specific property tables below also document any additional methods.
|
|
47
|
+
|
|
48
|
+
**agent** (`EditorAgentNamespace`): CRUD operations and version management for stored agents. Handles applying stored overrides to code-defined agents.
|
|
49
|
+
|
|
50
|
+
**agent.create** (`(input: StorageCreateAgentInput) => Promise<Agent>`): Create a new stored agent and return a hydrated Agent instance. Accepts an id, authorId, metadata, and the initial snapshot (name, description, instructions, model, tools, memory, and so on).
|
|
51
|
+
|
|
52
|
+
**agent.getById** (`(id: string, options?: GetByIdOptions) => Promise<Agent | null>`): Return a hydrated Agent instance for a stored agent. Pass options with versionId, versionNumber, or status ("draft" | "published" | "archived") to target a specific version. Default version requests are cached.
|
|
53
|
+
|
|
54
|
+
**agent.update** (`(input: StorageUpdateAgentInput) => Promise<Agent>`): Partially update a stored agent. Creates a new draft version with the provided snapshot fields (instructions, tools, memory, and so on) and invalidates the cache. Set memory to null to disable memory.
|
|
55
|
+
|
|
56
|
+
**agent.delete** (`(id: string) => Promise<void>`): Delete a stored agent and remove it from the Mastra runtime registry.
|
|
57
|
+
|
|
58
|
+
**agent.list** (`(args?: StorageListAgentsInput) => Promise<StorageListAgentsOutput>`): List stored agents with optional pagination, orderBy, authorId, and metadata filters. Returns raw stored snapshots.
|
|
59
|
+
|
|
60
|
+
**agent.listResolved** (`(args?: StorageListAgentsInput) => Promise<StorageListAgentsResolvedOutput>`): Same as list, but returns fully resolved configurations with references dereferenced.
|
|
61
|
+
|
|
62
|
+
**agent.applyStoredOverrides** (`(agent: Agent, options?: { versionId?: string; status?: "draft" | "published" }) => Promise<Agent>`): Mutate a code-defined agent in place to apply any stored overrides (instructions, tools, variables). Called internally by mastra.getAgent() — you rarely call it directly.
|
|
63
|
+
|
|
64
|
+
**agent.clone** (`(agent: Agent, options: { newId: string; newName?: string; metadata?: Record<string, unknown>; authorId?: string; requestContext?: RequestContext; }) => Promise<Agent>`): Create a new stored agent by cloning an existing agent.
|
|
65
|
+
|
|
66
|
+
**agent.clearCache** (`(agentId?: string) => void`): Clear the in-memory cache for one agent or all agents. Called automatically after mutations.
|
|
67
|
+
|
|
68
|
+
**prompt** (`EditorPromptNamespace`): CRUD operations for prompt blocks. Includes a preview method for resolving instruction blocks with draft content.
|
|
69
|
+
|
|
70
|
+
**prompt.create** (`(input: StorageCreatePromptBlockInput) => Promise<StorageResolvedPromptBlockType>`): Create a new stored prompt block. Accepts an id, authorId, metadata, and the initial snapshot (name, description, content, rules, requestContextSchema).
|
|
71
|
+
|
|
72
|
+
**prompt.getById** (`(id: string, options?: GetByIdOptions) => Promise<StorageResolvedPromptBlockType | null>`): Return a resolved prompt block. Pass options to target a specific version or status.
|
|
73
|
+
|
|
74
|
+
**prompt.update** (`(input: StorageUpdatePromptBlockInput) => Promise<StorageResolvedPromptBlockType>`): Partially update a stored prompt block. Creates a new draft version with the provided snapshot fields.
|
|
75
|
+
|
|
76
|
+
**prompt.delete** (`(id: string) => Promise<void>`): Delete a stored prompt block and remove it from the Mastra runtime registry.
|
|
77
|
+
|
|
78
|
+
**prompt.list** (`(args?: StorageListPromptBlocksInput) => Promise<StorageListPromptBlocksOutput>`): List stored prompt blocks with optional pagination, orderBy, authorId, metadata, and status filters.
|
|
79
|
+
|
|
80
|
+
**prompt.listResolved** (`(args?: StorageListPromptBlocksInput) => Promise<StorageListPromptBlocksResolvedOutput>`): Same as list, but returns fully resolved prompt block content.
|
|
81
|
+
|
|
82
|
+
**prompt.preview** (`(blocks: AgentInstructionBlock[], context: Record<string, unknown>) => Promise<string>`): Resolve an array of instruction blocks against a context, rendering template variables and evaluating display conditions. Includes draft content for referenced prompt blocks.
|
|
83
|
+
|
|
84
|
+
**prompt.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one prompt block or all prompt blocks.
|
|
85
|
+
|
|
86
|
+
**mcp** (`EditorMCPNamespace`): CRUD operations for stored MCP client configurations.
|
|
87
|
+
|
|
88
|
+
**mcp.create** (`(input: StorageCreateMCPClientInput) => Promise<MCPClient>`): Create a new stored MCP client. Accepts an id, authorId, metadata, and the initial snapshot (servers, tool filtering).
|
|
89
|
+
|
|
90
|
+
**mcp.getById** (`(id: string, options?: GetByIdOptions) => Promise<MCPClient | null>`): Return a hydrated MCPClient instance for a stored MCP client.
|
|
91
|
+
|
|
92
|
+
**mcp.update** (`(input: StorageUpdateMCPClientInput) => Promise<MCPClient>`): Partially update a stored MCP client and invalidate the cache.
|
|
93
|
+
|
|
94
|
+
**mcp.delete** (`(id: string) => Promise<void>`): Delete a stored MCP client and remove it from the Mastra runtime registry.
|
|
95
|
+
|
|
96
|
+
**mcp.list** (`(args?: StorageListMCPClientsInput) => Promise<StorageListMCPClientsOutput>`): List stored MCP clients with optional pagination and filters.
|
|
97
|
+
|
|
98
|
+
**mcp.listResolved** (`(args?: StorageListMCPClientsInput) => Promise<StorageListMCPClientsResolvedOutput>`): Same as list, but returns fully resolved MCP client configurations.
|
|
99
|
+
|
|
100
|
+
**mcp.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one MCP client or all MCP clients.
|
|
101
|
+
|
|
102
|
+
**mcpServer** (`EditorMCPServerNamespace`): CRUD operations for MCP server configurations.
|
|
103
|
+
|
|
104
|
+
**mcpServer.create** (`(input: StorageCreateMCPServerInput) => Promise<MCPServerBase>`): Create a new stored MCP server configuration and return a hydrated server instance.
|
|
105
|
+
|
|
106
|
+
**mcpServer.getById** (`(id: string, options?: GetByIdOptions) => Promise<MCPServerBase | null>`): Return a hydrated MCP server for a given id.
|
|
107
|
+
|
|
108
|
+
**mcpServer.update** (`(input: StorageUpdateMCPServerInput) => Promise<MCPServerBase>`): Partially update a stored MCP server configuration.
|
|
109
|
+
|
|
110
|
+
**mcpServer.delete** (`(id: string) => Promise<void>`): Delete a stored MCP server configuration.
|
|
111
|
+
|
|
112
|
+
**mcpServer.list** (`(args?: StorageListMCPServersInput) => Promise<StorageListMCPServersOutput>`): List stored MCP server configurations.
|
|
113
|
+
|
|
114
|
+
**mcpServer.listResolved** (`(args?: StorageListMCPServersInput) => Promise<StorageListMCPServersResolvedOutput>`): Same as list, but returns fully resolved server configurations.
|
|
115
|
+
|
|
116
|
+
**mcpServer.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one MCP server or all MCP servers.
|
|
117
|
+
|
|
118
|
+
**scorer** (`EditorScorerNamespace`): CRUD operations for scorer configurations.
|
|
119
|
+
|
|
120
|
+
**scorer.create** (`(input: StorageCreateScorerInput) => Promise<MastraScorer>`): Create a new stored scorer and return a hydrated MastraScorer instance.
|
|
121
|
+
|
|
122
|
+
**scorer.getById** (`(id: string, options?: GetByIdOptions) => Promise<MastraScorer | null>`): Return a hydrated scorer for a given id.
|
|
123
|
+
|
|
124
|
+
**scorer.update** (`(input: StorageUpdateScorerInput) => Promise<MastraScorer>`): Partially update a stored scorer.
|
|
125
|
+
|
|
126
|
+
**scorer.delete** (`(id: string) => Promise<void>`): Delete a stored scorer and remove it from the Mastra runtime registry.
|
|
127
|
+
|
|
128
|
+
**scorer.list** (`(args?: StorageListScorersInput) => Promise<StorageListScorersOutput>`): List stored scorers with optional pagination and filters.
|
|
129
|
+
|
|
130
|
+
**scorer.listResolved** (`(args?: StorageListScorersInput) => Promise<StorageListScorersResolvedOutput>`): Same as list, but returns fully resolved scorer configurations.
|
|
131
|
+
|
|
132
|
+
**scorer.clearCache** (`(id?: string) => void`): Clear the in-memory cache for one scorer or all scorers.
|
|
133
|
+
|
|
134
|
+
## Methods
|
|
135
|
+
|
|
136
|
+
### Provider access
|
|
137
|
+
|
|
138
|
+
#### `getToolProvider(id)`
|
|
139
|
+
|
|
140
|
+
Returns a registered tool provider by its ID.
|
|
141
|
+
|
|
142
|
+
```typescript
|
|
143
|
+
const composio = mastra.getEditor()?.getToolProvider('composio')
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
#### `getToolProviders()`
|
|
147
|
+
|
|
148
|
+
Returns all registered tool providers as a `Record<string, ToolProvider>`.
|
|
149
|
+
|
|
150
|
+
#### `getProcessorProvider(id)`
|
|
151
|
+
|
|
152
|
+
Returns a registered processor provider by its ID.
|
|
153
|
+
|
|
154
|
+
#### `getProcessorProviders()`
|
|
155
|
+
|
|
156
|
+
Returns all registered processor providers.
|
|
157
|
+
|
|
158
|
+
#### `getFilesystemProviders()`
|
|
159
|
+
|
|
160
|
+
Returns all registered filesystem providers.
|
|
161
|
+
|
|
162
|
+
#### `getSandboxProviders()`
|
|
163
|
+
|
|
164
|
+
Returns all registered sandbox providers.
|
|
165
|
+
|
|
166
|
+
#### `getBlobStoreProviders()`
|
|
167
|
+
|
|
168
|
+
Returns all registered blob store providers.
|
|
@@ -63,6 +63,7 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
63
63
|
- [.getAgent()](https://mastra.ai/reference/core/getAgent)
|
|
64
64
|
- [.getAgentById()](https://mastra.ai/reference/core/getAgentById)
|
|
65
65
|
- [.getDeployer()](https://mastra.ai/reference/core/getDeployer)
|
|
66
|
+
- [.getEditor()](https://mastra.ai/reference/core/getEditor)
|
|
66
67
|
- [.getGateway()](https://mastra.ai/reference/core/getGateway)
|
|
67
68
|
- [.getGatewayById()](https://mastra.ai/reference/core/getGatewayById)
|
|
68
69
|
- [.getLogger()](https://mastra.ai/reference/core/getLogger)
|
|
@@ -91,6 +92,8 @@ The Reference section provides documentation of Mastra's API, including paramete
|
|
|
91
92
|
- [Deployer](https://mastra.ai/reference/deployer)
|
|
92
93
|
- [Netlify](https://mastra.ai/reference/deployer/netlify)
|
|
93
94
|
- [Vercel](https://mastra.ai/reference/deployer/vercel)
|
|
95
|
+
- [MastraEditor Class](https://mastra.ai/reference/editor/mastra-editor)
|
|
96
|
+
- [ToolProvider](https://mastra.ai/reference/editor/tool-provider)
|
|
94
97
|
- [createScorer()](https://mastra.ai/reference/evals/create-scorer)
|
|
95
98
|
- [MastraScorer](https://mastra.ai/reference/evals/mastra-scorer)
|
|
96
99
|
- [runEvals()](https://mastra.ai/reference/evals/run-evals)
|
package/dist/evals/index.cjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkXCFSSKCI_cjs = require('../chunk-XCFSSKCI.cjs');
|
|
4
|
+
var chunkK2NJIVZ5_cjs = require('../chunk-K2NJIVZ5.cjs');
|
|
5
5
|
var chunkP5C4HEAB_cjs = require('../chunk-P5C4HEAB.cjs');
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
Object.defineProperty(exports, "runEvals", {
|
|
10
10
|
enumerable: true,
|
|
11
|
-
get: function () { return
|
|
11
|
+
get: function () { return chunkXCFSSKCI_cjs.runEvals; }
|
|
12
12
|
});
|
|
13
13
|
Object.defineProperty(exports, "MastraScorer", {
|
|
14
14
|
enumerable: true,
|
|
15
|
-
get: function () { return
|
|
15
|
+
get: function () { return chunkK2NJIVZ5_cjs.MastraScorer; }
|
|
16
16
|
});
|
|
17
17
|
Object.defineProperty(exports, "createScorer", {
|
|
18
18
|
enumerable: true,
|
|
19
|
-
get: function () { return
|
|
19
|
+
get: function () { return chunkK2NJIVZ5_cjs.createScorer; }
|
|
20
20
|
});
|
|
21
21
|
Object.defineProperty(exports, "extractTrajectory", {
|
|
22
22
|
enumerable: true,
|
package/dist/evals/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { runEvals } from '../chunk-
|
|
2
|
-
export { MastraScorer, createScorer } from '../chunk-
|
|
1
|
+
export { runEvals } from '../chunk-IWMYLZQ6.js';
|
|
2
|
+
export { MastraScorer, createScorer } from '../chunk-JG7M2F2C.js';
|
|
3
3
|
export { extractTrajectory, extractTrajectoryFromTrace, extractWorkflowTrajectory, listScoresResponseSchema, saveScorePayloadSchema, scoreResultSchema, scoreRowDataSchema, scoringEntityTypeSchema, scoringExtractStepResultSchema, scoringHookInputSchema, scoringInputSchema, scoringInputWithExtractStepResultAndAnalyzeStepResultSchema, scoringInputWithExtractStepResultAndScoreAndReasonSchema, scoringInputWithExtractStepResultSchema, scoringPromptsSchema, scoringSourceSchema, scoringValueSchema } from '../chunk-Y4SL4WJQ.js';
|
|
4
4
|
//# sourceMappingURL=index.js.map
|
|
5
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkNWGH6OSA_cjs = require('../../chunk-NWGH6OSA.cjs');
|
|
4
4
|
var chunkP5C4HEAB_cjs = require('../../chunk-P5C4HEAB.cjs');
|
|
5
5
|
var chunkQFGYBEP3_cjs = require('../../chunk-QFGYBEP3.cjs');
|
|
6
6
|
var chunk4U7ZLI36_cjs = require('../../chunk-4U7ZLI36.cjs');
|
|
@@ -234,7 +234,7 @@ function transformTraceToScorerInputAndOutput(trace) {
|
|
|
234
234
|
}
|
|
235
235
|
|
|
236
236
|
// src/evals/scoreTraces/scoreTracesWorkflow.ts
|
|
237
|
-
var getTraceStep =
|
|
237
|
+
var getTraceStep = chunkNWGH6OSA_cjs.createStep({
|
|
238
238
|
id: "__process-trace-scoring",
|
|
239
239
|
inputSchema: v4.z.object({
|
|
240
240
|
targets: v4.z.array(
|
|
@@ -429,7 +429,7 @@ async function attachScoreToSpan({
|
|
|
429
429
|
} catch {
|
|
430
430
|
}
|
|
431
431
|
}
|
|
432
|
-
var scoreTracesWorkflow =
|
|
432
|
+
var scoreTracesWorkflow = chunkNWGH6OSA_cjs.createWorkflow({
|
|
433
433
|
id: "__batch-scoring-traces",
|
|
434
434
|
inputSchema: v4.z.object({
|
|
435
435
|
targets: v4.z.array(
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createStep, createWorkflow } from '../../chunk-
|
|
1
|
+
import { createStep, createWorkflow } from '../../chunk-5CPRW7GV.js';
|
|
2
2
|
import { saveScorePayloadSchema } from '../../chunk-Y4SL4WJQ.js';
|
|
3
3
|
import { getEntityTypeForSpan } from '../../chunk-E7PBOS66.js';
|
|
4
4
|
import { MastraError } from '../../chunk-FJEVLHJT.js';
|
package/dist/harness/index.cjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
3
|
+
var chunkHAF2U4ON_cjs = require('../chunk-HAF2U4ON.cjs');
|
|
4
|
+
var chunkK2NJIVZ5_cjs = require('../chunk-K2NJIVZ5.cjs');
|
|
5
5
|
var chunkRNJ2FXGD_cjs = require('../chunk-RNJ2FXGD.cjs');
|
|
6
6
|
var chunkXS3FHQ34_cjs = require('../chunk-XS3FHQ34.cjs');
|
|
7
7
|
var chunkLDLHW3QN_cjs = require('../chunk-LDLHW3QN.cjs');
|
|
@@ -313,7 +313,7 @@ Use this tool when:
|
|
|
313
313
|
};
|
|
314
314
|
}
|
|
315
315
|
const workspace = context?.workspace;
|
|
316
|
-
const subagent = new
|
|
316
|
+
const subagent = new chunkK2NJIVZ5_cjs.Agent({
|
|
317
317
|
id: `subagent-${definition.id}`,
|
|
318
318
|
name: `${definition.name} Subagent`,
|
|
319
319
|
instructions: definition.instructions,
|
|
@@ -576,7 +576,7 @@ var Harness = class {
|
|
|
576
576
|
*/
|
|
577
577
|
async init() {
|
|
578
578
|
if (this.config.storage) {
|
|
579
|
-
this.#internalMastra = new
|
|
579
|
+
this.#internalMastra = new chunkHAF2U4ON_cjs.Mastra({ logger: false, storage: this.config.storage });
|
|
580
580
|
await this.#internalMastra.getStorage().init();
|
|
581
581
|
}
|
|
582
582
|
if (this.config.workspace && !this.workspaceInitialized && !this.workspaceFn) {
|
|
@@ -832,7 +832,7 @@ var Harness = class {
|
|
|
832
832
|
}
|
|
833
833
|
}
|
|
834
834
|
try {
|
|
835
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
835
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-PKUEVZXH.cjs');
|
|
836
836
|
const registry = PROVIDER_REGISTRY;
|
|
837
837
|
const providerConfig = registry[provider];
|
|
838
838
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -852,7 +852,7 @@ var Harness = class {
|
|
|
852
852
|
*/
|
|
853
853
|
async listAvailableModels() {
|
|
854
854
|
try {
|
|
855
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
855
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-PKUEVZXH.cjs');
|
|
856
856
|
if (!PROVIDER_REGISTRY) return [];
|
|
857
857
|
const registry = PROVIDER_REGISTRY;
|
|
858
858
|
const providers = Object.keys(registry);
|
|
@@ -911,7 +911,7 @@ var Harness = class {
|
|
|
911
911
|
}
|
|
912
912
|
async getProviderApiKeyEnvVar(provider) {
|
|
913
913
|
try {
|
|
914
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
914
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-PKUEVZXH.cjs');
|
|
915
915
|
const registry = PROVIDER_REGISTRY;
|
|
916
916
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
917
917
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/harness/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Mastra } from '../chunk-
|
|
2
|
-
import { Agent } from '../chunk-
|
|
1
|
+
import { Mastra } from '../chunk-JRTGAEET.js';
|
|
2
|
+
import { Agent } from '../chunk-JG7M2F2C.js';
|
|
3
3
|
import { Workspace, createWorkspaceTools } from '../chunk-TD7IL7ZC.js';
|
|
4
4
|
import { safeStringify } from '../chunk-234T424F.js';
|
|
5
5
|
import { createTool } from '../chunk-JTIQYXE2.js';
|
|
@@ -830,7 +830,7 @@ var Harness = class {
|
|
|
830
830
|
}
|
|
831
831
|
}
|
|
832
832
|
try {
|
|
833
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
833
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-3HZNLU3V.js');
|
|
834
834
|
const registry = PROVIDER_REGISTRY;
|
|
835
835
|
const providerConfig = registry[provider];
|
|
836
836
|
const envVars = providerConfig?.apiKeyEnvVar;
|
|
@@ -850,7 +850,7 @@ var Harness = class {
|
|
|
850
850
|
*/
|
|
851
851
|
async listAvailableModels() {
|
|
852
852
|
try {
|
|
853
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
853
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-3HZNLU3V.js');
|
|
854
854
|
if (!PROVIDER_REGISTRY) return [];
|
|
855
855
|
const registry = PROVIDER_REGISTRY;
|
|
856
856
|
const providers = Object.keys(registry);
|
|
@@ -909,7 +909,7 @@ var Harness = class {
|
|
|
909
909
|
}
|
|
910
910
|
async getProviderApiKeyEnvVar(provider) {
|
|
911
911
|
try {
|
|
912
|
-
const { PROVIDER_REGISTRY } = await import('../provider-registry-
|
|
912
|
+
const { PROVIDER_REGISTRY } = await import('../provider-registry-3HZNLU3V.js');
|
|
913
913
|
const registry = PROVIDER_REGISTRY;
|
|
914
914
|
const envVars = registry[provider]?.apiKeyEnvVar;
|
|
915
915
|
return Array.isArray(envVars) ? envVars[0] : envVars;
|
package/dist/index.cjs
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkHAF2U4ON_cjs = require('./chunk-HAF2U4ON.cjs');
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
Object.defineProperty(exports, "Mastra", {
|
|
8
8
|
enumerable: true,
|
|
9
|
-
get: function () { return
|
|
9
|
+
get: function () { return chunkHAF2U4ON_cjs.Mastra; }
|
|
10
10
|
});
|
|
11
11
|
//# sourceMappingURL=index.cjs.map
|
|
12
12
|
//# sourceMappingURL=index.cjs.map
|
package/dist/index.js
CHANGED
package/dist/llm/index.cjs
CHANGED
|
@@ -1,72 +1,72 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
3
|
+
var chunkY6I7BKY3_cjs = require('../chunk-Y6I7BKY3.cjs');
|
|
4
|
+
var chunk4636ENMP_cjs = require('../chunk-4636ENMP.cjs');
|
|
5
|
+
var chunkNC3NDZWM_cjs = require('../chunk-NC3NDZWM.cjs');
|
|
6
|
+
var chunkCNCOPROQ_cjs = require('../chunk-CNCOPROQ.cjs');
|
|
7
|
+
var chunkW7JPJ5VP_cjs = require('../chunk-W7JPJ5VP.cjs');
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
Object.defineProperty(exports, "AzureOpenAIGateway", {
|
|
12
12
|
enumerable: true,
|
|
13
|
-
get: function () { return
|
|
13
|
+
get: function () { return chunkY6I7BKY3_cjs.AzureOpenAIGateway; }
|
|
14
14
|
});
|
|
15
15
|
Object.defineProperty(exports, "EMBEDDING_MODELS", {
|
|
16
16
|
enumerable: true,
|
|
17
|
-
get: function () { return
|
|
17
|
+
get: function () { return chunkY6I7BKY3_cjs.EMBEDDING_MODELS; }
|
|
18
18
|
});
|
|
19
19
|
Object.defineProperty(exports, "ModelRouterEmbeddingModel", {
|
|
20
20
|
enumerable: true,
|
|
21
|
-
get: function () { return
|
|
21
|
+
get: function () { return chunkY6I7BKY3_cjs.ModelRouterEmbeddingModel; }
|
|
22
22
|
});
|
|
23
23
|
Object.defineProperty(exports, "ModelRouterLanguageModel", {
|
|
24
24
|
enumerable: true,
|
|
25
|
-
get: function () { return
|
|
25
|
+
get: function () { return chunkY6I7BKY3_cjs.ModelRouterLanguageModel; }
|
|
26
26
|
});
|
|
27
27
|
Object.defineProperty(exports, "defaultGateways", {
|
|
28
28
|
enumerable: true,
|
|
29
|
-
get: function () { return
|
|
29
|
+
get: function () { return chunkY6I7BKY3_cjs.defaultGateways; }
|
|
30
30
|
});
|
|
31
31
|
Object.defineProperty(exports, "resolveModelConfig", {
|
|
32
32
|
enumerable: true,
|
|
33
|
-
get: function () { return
|
|
33
|
+
get: function () { return chunkY6I7BKY3_cjs.resolveModelConfig; }
|
|
34
34
|
});
|
|
35
35
|
Object.defineProperty(exports, "GatewayRegistry", {
|
|
36
36
|
enumerable: true,
|
|
37
|
-
get: function () { return
|
|
37
|
+
get: function () { return chunk4636ENMP_cjs.GatewayRegistry; }
|
|
38
38
|
});
|
|
39
39
|
Object.defineProperty(exports, "MastraGateway", {
|
|
40
40
|
enumerable: true,
|
|
41
|
-
get: function () { return
|
|
41
|
+
get: function () { return chunk4636ENMP_cjs.MastraGateway; }
|
|
42
42
|
});
|
|
43
43
|
Object.defineProperty(exports, "PROVIDER_REGISTRY", {
|
|
44
44
|
enumerable: true,
|
|
45
|
-
get: function () { return
|
|
45
|
+
get: function () { return chunk4636ENMP_cjs.PROVIDER_REGISTRY; }
|
|
46
46
|
});
|
|
47
47
|
Object.defineProperty(exports, "getProviderConfig", {
|
|
48
48
|
enumerable: true,
|
|
49
|
-
get: function () { return
|
|
49
|
+
get: function () { return chunk4636ENMP_cjs.getProviderConfig; }
|
|
50
50
|
});
|
|
51
51
|
Object.defineProperty(exports, "parseModelString", {
|
|
52
52
|
enumerable: true,
|
|
53
|
-
get: function () { return
|
|
53
|
+
get: function () { return chunk4636ENMP_cjs.parseModelString; }
|
|
54
54
|
});
|
|
55
55
|
Object.defineProperty(exports, "ModelsDevGateway", {
|
|
56
56
|
enumerable: true,
|
|
57
|
-
get: function () { return
|
|
57
|
+
get: function () { return chunkNC3NDZWM_cjs.ModelsDevGateway; }
|
|
58
58
|
});
|
|
59
59
|
Object.defineProperty(exports, "NetlifyGateway", {
|
|
60
60
|
enumerable: true,
|
|
61
|
-
get: function () { return
|
|
61
|
+
get: function () { return chunkCNCOPROQ_cjs.NetlifyGateway; }
|
|
62
62
|
});
|
|
63
63
|
Object.defineProperty(exports, "GATEWAY_AUTH_HEADER", {
|
|
64
64
|
enumerable: true,
|
|
65
|
-
get: function () { return
|
|
65
|
+
get: function () { return chunkW7JPJ5VP_cjs.GATEWAY_AUTH_HEADER; }
|
|
66
66
|
});
|
|
67
67
|
Object.defineProperty(exports, "MastraModelGateway", {
|
|
68
68
|
enumerable: true,
|
|
69
|
-
get: function () { return
|
|
69
|
+
get: function () { return chunkW7JPJ5VP_cjs.MastraModelGateway; }
|
|
70
70
|
});
|
|
71
71
|
//# sourceMappingURL=index.cjs.map
|
|
72
72
|
//# sourceMappingURL=index.cjs.map
|
package/dist/llm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, defaultGateways, resolveModelConfig } from '../chunk-
|
|
2
|
-
export { GatewayRegistry, MastraGateway, PROVIDER_REGISTRY, getProviderConfig, parseModelString } from '../chunk-
|
|
3
|
-
export { ModelsDevGateway } from '../chunk-
|
|
4
|
-
export { NetlifyGateway } from '../chunk-
|
|
5
|
-
export { GATEWAY_AUTH_HEADER, MastraModelGateway } from '../chunk-
|
|
1
|
+
export { AzureOpenAIGateway, EMBEDDING_MODELS, ModelRouterEmbeddingModel, ModelRouterLanguageModel, defaultGateways, resolveModelConfig } from '../chunk-6TQZIQ23.js';
|
|
2
|
+
export { GatewayRegistry, MastraGateway, PROVIDER_REGISTRY, getProviderConfig, parseModelString } from '../chunk-Q55SOMNM.js';
|
|
3
|
+
export { ModelsDevGateway } from '../chunk-MYYPIBLR.js';
|
|
4
|
+
export { NetlifyGateway } from '../chunk-XOJF3SNB.js';
|
|
5
|
+
export { GATEWAY_AUTH_HEADER, MastraModelGateway } from '../chunk-QBUDLHGF.js';
|
|
6
6
|
//# sourceMappingURL=index.js.map
|
|
7
7
|
//# sourceMappingURL=index.js.map
|