import type { Mastra } from '@mastra/core/mastra'; import type { OnModuleInit } from '@nestjs/common'; import { HttpAdapterHost } from '@nestjs/core'; import type { MastraModuleOptions } from './mastra.module.js'; import { RouteHandlerService } from './services/route-handler.service.js'; import { ShutdownService } from './services/shutdown.service.js'; /** * Injectable service for accessing Mastra and managing lifecycle. * * @example * ```typescript * @Injectable() * export class MyService { * constructor(private readonly mastraService: MastraService) {} * * async runAgent() { * const mastra = this.mastraService.getMastra(); * const agent = mastra.getAgent('my-agent'); * return agent.generate({ messages: [{ role: 'user', content: 'Hello' }] }); * } * } * ``` */ export declare class MastraService implements OnModuleInit { private readonly mastra; private readonly options; private readonly shutdownService; private readonly httpAdapterHost; private readonly routeHandler; private readonly logger; private serverAdapter?; constructor(mastra: Mastra, options: MastraModuleOptions, shutdownService: ShutdownService, httpAdapterHost: HttpAdapterHost, routeHandler: RouteHandlerService); onModuleInit(): void; private initializeServerAdapter; /** * Get the Mastra instance. */ getMastra(): Mastra; /** * Get module options. */ getOptions(): MastraModuleOptions; /** * Get an agent by ID. */ getAgent(agentId: string): import("@mastra/core/agent").Agent; /** * Get a workflow by ID. */ getWorkflow(workflowId: string): import("@mastra/core/workflows").AnyWorkflow; /** * Check if the service is shutting down. */ get isShuttingDown(): boolean; } //# sourceMappingURL=mastra.service.d.ts.map