import type { MastraCodeState } from '@mastra/code-sdk/schema'; import type { AgentController } from '@mastra/core/agent-controller'; import { RequestContext } from '@mastra/core/request-context'; import type { IntakeStorage } from '../storage/domains/intake/base.js'; import type { ModelDefaultsStorage } from '../storage/domains/model-defaults/base.js'; import type { EffectiveModelScope, FactoryProjectsStorage } from '../storage/domains/projects/base.js'; import type { SourceControlStorageHandle } from '../storage/domains/source-control/base.js'; import type { CreateWorkItemInput, WorkItemsStorage } from '../storage/domains/work-items/base.js'; import type { FactoryTransitionService } from './transition-service.js'; import type { FactoryRuleStage, FactoryTransitionResult } from './types.js'; export interface FactoryStartRequest { orgId: string; userId: string; factoryProjectId: string; sessionId: string; threadTitle: string; kickoffKey: string; /** Where the arrival path lands the card; a session opened on an existing card names none. */ destinationStage?: FactoryRuleStage; /** The run's effective scope; a hybrid Factory's runs use the Factory's model and credentials. */ modelScope: EffectiveModelScope; defaultModelId?: string; workItem: { id?: string; role: string; input: CreateWorkItemInput; }; requestContext?: RequestContext; } export declare class WorkItemRepositoryError extends Error { readonly code: 'repository_mismatch' | 'repository_ambiguous' | 'repository_unlinked'; readonly candidates: string[]; constructor(code: 'repository_mismatch' | 'repository_ambiguous' | 'repository_unlinked', message: string, candidates?: string[]); } export declare class FactoryStartTransitionError extends Error { readonly result: Extract; constructor(result: Extract); } export interface FactoryStartPreparedResult { workItemId: string; bindingId: string; threadId: string; resourceId: string; sessionId: string; branch: string; revision: number; kickoffStatus: 'pending' | 'leased' | 'retry' | 'sent' | 'failed'; replayed: boolean; } type FactoryController = AgentController; export declare class FactoryStartCoordinator { #private; constructor(controller: FactoryController, storage: WorkItemsStorage, transitionService?: Pick, sourceControl?: SourceControlStorageHandle | ((request: FactoryStartRequest) => SourceControlStorageHandle | undefined | Promise), intake?: IntakeStorage, sessionModel?: { projects: FactoryProjectsStorage; modelDefaults: ModelDefaultsStorage; }); prepare(request: FactoryStartRequest): Promise; } export {}; //# sourceMappingURL=start-coordinator.d.ts.map