import type { ChatKitStore, StoreContext } from '../chatkit/store'; import type { ThreadItem } from '../chatkit/types'; import type { RunContextRetriever, RunExecutionBackend } from '../runs/RunExecutionBackend'; import { type RunRecordData, type RunStore } from '../runs/store'; import { type TaskRecordData } from './store'; import type { AiConnectionsInvocationKeyIssuer } from '../ai-gateway/auth/AiConnectionsInvocationKeyIssuer'; export interface MaterializedTaskRun { task: TaskRecordData; run: RunRecordData; assistant?: ThreadItem; } export interface TaskMaterializerOptions { store: ChatKitStore & RunStore; executionBackend?: RunExecutionBackend; executeRuns?: boolean; contextRetriever?: RunContextRetriever; aiConnectionInvocationKeyIssuer?: Pick; requireAiConnectionsInvocationKeyIssuer?: boolean; } export declare class TaskMaterializer { private readonly store; private readonly executionBackend; private readonly executeRuns; private readonly contextRetriever?; private readonly aiConnectionInvocationKeyIssuer?; private readonly requireAiConnectionsInvocationKeyIssuer; constructor(options: TaskMaterializerOptions); materialize(input: { task: TaskRecordData; context: TContext; trigger: { kind: 'once' | 'interval' | 'cron' | 'event' | 'manual'; scheduledFor?: number; eventName?: string; payload?: Record; }; }): Promise; private withInvocationAiConnections; private executeRun; private retrieveRunContext; private ensureThread; private createRun; private markRunStarted; private finishRun; private isWaitingStatus; private stepTypeForStatus; private appendRunStep; private createUserMessage; private buildPrompt; private createAssistantMessage; private loadConversation; private buildRuntimeConfig; private parseRunner; private isRunnerType; private computeNextIntervalRunAt; private computeNextCronRunAt; private threadRefFromTask; private resolveTaskThreadParentKey; private parseThreadResource; private extractThreadId; private resolveTaskResource; private resolveRunResource; private resolvePodBaseUrl; private hasSaveTask; }