UNPKG

@mastra/core

Version:
26 lines • 1.3 kB
import type { IMastraLogger } from '../../../logger/index.js'; import type { RequestContext } from '../../../request-context/index.js'; import type { AgentExecutionOptions } from '../../agent.types.js'; import type { SerializableDurableOptions } from '../types.js'; type PersistedCompletion = NonNullable<SerializableDurableOptions['isTaskComplete']>; type CompletionPolicy = NonNullable<AgentExecutionOptions<any>['isTaskComplete']>; /** * Rebuild a run's `isTaskComplete` policy in a process that did not prepare it * (recovery after a restart, or a worker that runs the completion step). * Scorers and `onComplete` cannot be serialized, so only a policy taken from * the agent defaults can be restored, and only when the defaults still resolve * to the same scorers. Anything else logs a warning and returns undefined. */ export declare function restoreCompletionPolicy({ agent, persisted, requestContext, runId, logger, }: { agent: { getDefaultOptions(options?: { requestContext?: RequestContext; }): unknown; } | undefined; persisted: PersistedCompletion | undefined; requestContext: RequestContext; runId: string; logger?: IMastraLogger; }): Promise<CompletionPolicy | undefined>; export {}; //# sourceMappingURL=restore-completion.d.ts.map