UNPKG

@mastra/core

Version:
57 lines • 3.35 kB
import type { BackgroundTaskManager } from '../../../background-tasks/index.js'; import type { AgentBackgroundConfig } from '../../../background-tasks/types.js'; import type { AgentLoopResumeClaim, ToolCallConcurrency } from '../../../loop/types.js'; import type { MastraMemory } from '../../../memory/memory.js'; import type { MemoryConfigInternal } from '../../../memory/types.js'; import { MastraModelOutput } from '../../../stream/index.js'; import type { RequireToolApproval, ToolPayloadTransformPolicy } from '../../../tools/index.js'; import type { Workspace } from '../../../workspace/workspace.js'; import type { SaveQueueManager } from '../../save-queue/index.js'; import type { PendingSignalListener, CreatedAgentSignal } from '../../signals.js'; import type { AgentStreamPublisher } from '../../streams/publisher.js'; import type { AgentMethodType } from '../../types.js'; import type { PrepareStreamRunScope } from './run-scope.js'; import type { AgentCapabilities } from './schema.js'; interface StreamStepOptions<OUTPUT = undefined> { capabilities: AgentCapabilities; runId: string; returnScorerData?: boolean; requireToolApproval?: RequireToolApproval; toolCallConcurrency?: ToolCallConcurrency; eagerToolExecution?: boolean; streamPublisher?: AgentStreamPublisher; resumeContext?: { resumeData: any; snapshot: any; claim?: AgentLoopResumeClaim; }; /** The resume snapshot with its transcript hydrated from memory; set when resuming. */ getResumeSnapshot?: () => Promise<any>; agentId: string; agentVersionId?: string; resolvedScopes?: string[]; agentName?: string; toolCallId?: string; methodType: AgentMethodType; saveQueueManager?: SaveQueueManager; memoryConfig?: MemoryConfigInternal; memory?: MastraMemory; resourceId?: string; autoResumeSuspendedTools?: boolean; 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, scope?: 'pending' | 'pre-run') => CreatedAgentSignal[]; subscribePendingSignals?: (runId: string, listener: PendingSignalListener) => () => void; runScope: PrepareStreamRunScope<OUTPUT>; } export declare function createStreamStep<OUTPUT = undefined>({ capabilities, runId: _runId, returnScorerData, requireToolApproval, toolCallConcurrency, eagerToolExecution, streamPublisher, resumeContext, getResumeSnapshot, agentId, agentVersionId, resolvedScopes, agentName, toolCallId, methodType, saveQueueManager, memoryConfig, memory, resourceId, autoResumeSuspendedTools, workspace, backgroundTaskManager, agentBackgroundConfig, toolPayloadTransform, skipBgTaskWait, drainPendingSignals, subscribePendingSignals, runScope, }: StreamStepOptions<OUTPUT>): import("../../../workflows").Step<"stream-text-step", unknown, any, MastraModelOutput<OUTPUT>, unknown, unknown, import("../../../workflows").DefaultEngineType, unknown>; export {}; //# sourceMappingURL=stream-step.d.ts.map