UNPKG

@mastra/core

Version:

Mastra is a framework for building AI-powered applications and agents with a modern TypeScript stack.

76 lines 4.24 kB
import type { BackgroundTaskManager } from '../../../background-tasks/index.js'; import type { AgentBackgroundConfig } from '../../../background-tasks/types.js'; import type { SystemMessage } from '../../../llm/index.js'; import type { MastraMemory } from '../../../memory/memory.js'; import type { MemoryConfigInternal, StorageThreadType } from '../../../memory/types.js'; import type { Span, SpanType } from '../../../observability/index.js'; import type { RequestContext } from '../../../request-context/index.js'; import { MastraModelOutput } from '../../../stream/index.js'; import type { ToolPayloadTransformPolicy } from '../../../tools/index.js'; import type { Workspace } from '../../../workspace/workspace.js'; import type { InnerAgentExecutionOptions } from '../../agent.types.js'; import type { SaveQueueManager } from '../../save-queue/index.js'; import type { CreatedAgentSignal } from '../../signals.js'; import type { AgentMethodType } from '../../types.js'; import type { AgentCapabilities } from './schema.js'; interface CreatePrepareStreamWorkflowOptions<OUTPUT = undefined> { capabilities: AgentCapabilities; options: InnerAgentExecutionOptions<OUTPUT>; threadFromArgs?: (Partial<StorageThreadType> & { id: string; }) | undefined; resourceId?: string; runId: string; requestContext: RequestContext; agentSpan?: Span<SpanType.AGENT_RUN>; methodType: AgentMethodType; instructions: SystemMessage; memoryConfig?: MemoryConfigInternal; memory?: MastraMemory; returnScorerData?: boolean; saveQueueManager?: SaveQueueManager; requireToolApproval?: boolean; toolCallConcurrency?: number; resumeContext?: { resumeData: any; snapshot: any; }; agentId: string; agentName?: string; toolCallId?: string; workspace?: Workspace; backgroundTaskManager?: BackgroundTaskManager; agentBackgroundConfig?: AgentBackgroundConfig; toolPayloadTransform?: ToolPayloadTransformPolicy; /** * When true, the in-loop `backgroundTaskCheckStep` skips its wait for * running tasks. Used when an outer caller (e.g. `agent.streamUntilIdle`) * drives continuation from outside the loop. */ skipBgTaskWait?: boolean; drainPendingSignals?: (runId: string) => CreatedAgentSignal[]; } export declare function createPrepareStreamWorkflow<OUTPUT = undefined>({ capabilities, options, threadFromArgs, resourceId, runId, requestContext, agentSpan, methodType, instructions, memoryConfig, memory, returnScorerData, saveQueueManager, requireToolApproval, toolCallConcurrency, resumeContext, agentId, agentName, toolCallId, workspace, backgroundTaskManager, agentBackgroundConfig, toolPayloadTransform, skipBgTaskWait, drainPendingSignals, }: CreatePrepareStreamWorkflowOptions<OUTPUT>): import("../../../workflows").Workflow<import("../../../workflows").DefaultEngineType, (import("../../../workflows").Step<"prepare-tools-step", unknown, Record<string, never>, { convertedTools: Record<string, any>; }, unknown, unknown, import("../../../workflows").DefaultEngineType, unknown> | import("../../../workflows").Step<"prepare-memory-step", unknown, Record<string, never>, { threadExists: boolean; messageList: import("../..").MessageList; processorStates: Map<string, import("../../../processors").ProcessorState<undefined>>; thread?: { id: string; resourceId: string; createdAt: Date; updatedAt: Date; title?: string | undefined; metadata?: Record<string, any> | undefined; } | undefined; tripwire?: { reason: string; retry?: boolean | undefined; metadata?: unknown; processorId?: string | undefined; } | undefined; initialSignalEchoes?: CreatedAgentSignal[] | undefined; }, unknown, unknown, import("../../../workflows").DefaultEngineType, unknown> | import("../../../workflows").Step<"stream-text-step", unknown, any, MastraModelOutput<undefined>, unknown, unknown, import("../../../workflows").DefaultEngineType, unknown>)[], "execution-workflow", unknown, Record<string, never>, MastraModelOutput<OUTPUT>, MastraModelOutput<OUTPUT>, unknown>; export {}; //# sourceMappingURL=index.d.ts.map