Mastra.getEditor()
.getEditor() メソッドは、Mastra インスタンスに設定されている Editor インスタンスを取得します。Editor は、保存済みの Agent、プロンプトブロック、MCP クライアント、Scorer、Skill、Workspace をプログラムから管理するための CRUD 名前空間を公開します。
使用例使用例への直接リンク
import { Mastra } from '@mastra/core'
import { MastraEditor } from '@mastra/editor'
const mastra = new Mastra({
editor: new MastraEditor(),
})
const editor = mastra.getEditor()
const agent = await editor?.agent.create({
id: 'support-agent',
name: 'Support Agent',
instructions: 'Help customers with their questions.',
})
パラメーターパラメーターへの直接リンク
このメソッドはパラメーターを受け取りません。
戻り値戻り値への直接リンク
editor:
MastraEditor | undefined
設定済みの Editor インスタンス。Editor が設定されていない場合は undefined。