@mastra/core
Version:
Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.
26 lines • 1.05 kB
TypeScript
import { BackgroundTaskManager } from '../../background-tasks/manager.js';
import { MastraWorker } from '../worker.js';
import type { WorkerDeps } from '../worker.js';
export interface BackgroundTaskWorkerConfig {
globalConcurrency?: number;
perAgentConcurrency?: number;
backpressure?: 'queue' | 'reject' | 'fallback-sync';
defaultTimeoutMs?: number;
}
/**
* Manages background tool execution for agents. Handles task queuing,
* concurrency limits, and lifecycle. Subscribes to PubSub internally
* via BackgroundTaskManager's own subscription mechanism.
*/
export declare class BackgroundTaskWorker extends MastraWorker {
#private;
readonly name = "backgroundTasks";
constructor(config?: BackgroundTaskWorkerConfig);
init(deps: WorkerDeps): Promise<void>;
start(): Promise<void>;
stop(): Promise<void>;
get isRunning(): boolean;
/** Expose the underlying manager for direct API access. */
get manager(): BackgroundTaskManager | undefined;
}
//# sourceMappingURL=background-task-worker.d.ts.map