import { Mastra } from "@mastra/core/mastra"; import { Workflow } from "@mastra/core/workflows"; import { testWorkflow } from "./workflows/test-workflow"; import { businessStrategyWorkflow } from "./workflows/business-strategy"; import { createStorage } from "./storage"; import { frameworkAgent } from "./agents/frameworkAgent"; import { createVibeflowMCP } from "./mcp"; export async function createMastraInstance(options: { workflows: Record}) { return new Mastra({ agents: { frameworkAgent }, workflows: { testWorkflow, businessStrategyWorkflow, ...options.workflows }, bundler: { transpilePackages: [ "@vibeflow/ingestion", "@vibeflow/agent-sdk", "@vibeflow/core" ], sourcemap: true, }, mcpServers: { vibeflow: await createVibeflowMCP(), }, server: { port: 4111, host: "localhost", build: { openAPIDocs: true, }, }, storage: createStorage() }); }