UNPKG

@mastra/core

Version:
113 lines • 4.41 kB
import type { InputProcessorOrWorkflow } from '../processors/index.js'; import { SignalProvider } from './signal-provider.js'; /** * Bundles the built-in task tools and the {@link TaskStateProcessor} behind a * single agent registration. * * The task list is held in the thread-scoped `threadState` storage domain and * projected onto the agent state-signal lane by * `TaskStateProcessor`. Wiring task tracking by hand means registering all four * task tools **and** the processor, and keeping them in sync — forget the * processor and the tools work for a single turn but silently lose the list * across turns. This provider wires both together so that cannot happen. * * Task tracking requires a memory-backed thread (`threadId` + `resourceId`) and * a Mastra `storage` instance (the `threadState` domain is always wired * in-memory by default). Without memory the tools no-op and report that task * tracking requires agent memory. * * @example * ```ts * import { Agent } from '@mastra/core/agent'; * import { TaskSignalProvider } from '@mastra/core/signals'; * * const agent = new Agent({ * name: 'coder', * instructions: '...', * model, * memory, * signals: [new TaskSignalProvider()], * }); * ``` * * The Agent automatically merges the tools into its toolset and registers the * processor on its input-processor chain (which propagates the Mastra instance * so the processor can resolve the TaskStore). */ export declare class TaskSignalProvider extends SignalProvider<'task-signals'> { #private; readonly id = "task-signals"; getInputProcessors(): InputProcessorOrWorkflow[]; getTools(): { task_write: import("../tools").Tool<{ tasks: { id?: string | undefined; content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; }[]; }, { content: string; tasks: { content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; id: string; }[]; isError: boolean; }, unknown, unknown, import("../tools").ToolExecutionContext<unknown, unknown, unknown>, "task_write", unknown>; task_update: import("../tools").Tool<{ id: string; content?: string | undefined; status?: "completed" | "in_progress" | "pending" | undefined; activeForm?: string | undefined; }, { content: string; tasks: { content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; id: string; }[]; isError: boolean; }, unknown, unknown, import("../tools").ToolExecutionContext<unknown, unknown, unknown>, "task_update", unknown>; task_complete: import("../tools").Tool<{ id: string; }, { content: string; tasks: { content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; id: string; }[]; isError: boolean; }, unknown, unknown, import("../tools").ToolExecutionContext<unknown, unknown, unknown>, "task_complete", unknown>; task_check: import("../tools").Tool<Record<string, never>, { content: string; tasks: { content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; id: string; }[]; isError: boolean; summary: { total: number; completed: number; inProgress: number; pending: number; incomplete: number; hasTasks: boolean; allCompleted: boolean; }; incompleteTasks: { content: string; status: "completed" | "in_progress" | "pending"; activeForm: string; id: string; }[]; }, unknown, unknown, import("../tools").ToolExecutionContext<unknown, unknown, unknown>, "task_check", unknown>; }; } //# sourceMappingURL=task-signal-provider.d.ts.map