import type { OrgXClient } from "../../api.js"; import type { upsertAgentRun as upsertAgentRunType } from "../../agent-run-store.js"; type AutopilotSliceArtifact = { name: string; artifact_type?: string | null; confidence_score?: number | null; description?: string | null; url?: string | null; verification_steps?: string[] | null; milestone_id?: string | null; task_ids?: string[] | null; }; type CreateAutopilotOperationsDeps = { client: OrgXClient; randomUUID: () => string; safeErrorMessage: (err: unknown) => string; idempotencyKey: (parts: Array) => string; resolveDispatchExecutionPolicy: (input: { initiativeId: string | null; initiativeTitle?: string | null; workstreamId?: string | null; workstreamTitle?: string | null; taskId?: string | null; taskTitle?: string | null; message?: string | null; }) => Promise<{ executionPolicy: { domain: string; requiredSkills: string[]; }; taskTitle: string | null; workstreamTitle: string | null; }>; enforceSpawnGuardForDispatch: (input: { sourceEventPrefix: string; initiativeId: string | null; correlationId: string; runId?: string | null; executionPolicy: { domain: string; requiredSkills: string[]; }; agentId?: string | null; taskId?: string | null; taskTitle?: string | null; workstreamId?: string | null; workstreamTitle?: string | null; milestoneId?: string | null; }) => Promise<{ allowed: boolean; retryable: boolean; blockedReason: string | null; spawnGuardResult: unknown | null; }>; buildPolicyEnforcedMessage: (input: { baseMessage: string; executionPolicy: { domain: string; requiredSkills: string[]; }; spawnGuardResult?: unknown | null; }) => string; syncParentRollupsForTask: (input: { initiativeId: string | null; taskId: string | null; workstreamId?: string | null; milestoneId?: string | null; correlationId?: string | null; }) => Promise; emitActivitySafe: (input: { initiativeId: string | null; runId?: string | null; correlationId?: string | null; phase: "intent" | "execution" | "blocked" | "review" | "handoff" | "completed"; message: string; level?: "info" | "warn" | "error"; progressPct?: number; nextStep?: string; metadata?: Record; }) => Promise; extractSpawnGuardModelTier: (result: unknown) => string | null; upsertAgentContext: (input: { agentId: string; initiativeId: string | null; initiativeTitle?: string | null; workstreamId?: string | null; taskId?: string | null; }) => unknown; upsertRunContext: (input: { runId: string; agentId: string; initiativeId: string | null; initiativeTitle?: string | null; workstreamId?: string | null; taskId?: string | null; }) => unknown; spawnAgentTurn: (input: { agentId: string; sessionId: string; message: string; }) => { pid: number | null; }; upsertAgentRun: typeof upsertAgentRunType; }; export declare function createAutopilotOperations(deps: CreateAutopilotOperationsDeps): { registerArtifactSafe: (input: { initiativeId: string; runId: string; agentId: string; agentName?: string | null; workstreamId: string; fallbackMilestoneId?: string | null; fallbackTaskIds?: string[] | null; artifact: AutopilotSliceArtifact; isMockWorker?: boolean; }) => Promise<{ ok: boolean; id: string | null; }>; applyAgentStatusUpdatesSafe: (input: { initiativeId: string; runId: string; correlationId: string; agentId?: string | null; agentName?: string | null; outputPath?: string | null; logPath?: string | null; taskUpdates: Array<{ task_id: string; status: string; reason?: string | null; }>; milestoneUpdates: Array<{ milestone_id: string; status: string; reason?: string | null; }>; isMockWorker?: boolean; }) => Promise<{ applied: number; buffered: boolean; taskUpdates: Array<{ taskId: string; status: string; reason: string | null; }>; milestoneUpdates: Array<{ milestoneId: string; status: string; reason: string | null; }>; }>; resolveAgentDisplayName: (agentId: string, fallbackName?: string | null) => Promise; dispatchFallbackWorkstreamTurn: (input: { initiativeId: string; initiativeTitle: string; workstreamId: string; workstreamTitle: string; agentId: string; agentName?: string | null; taskId?: string | null; taskTitle?: string | null; }) => Promise<{ sessionId: string | null; pid: number | null; blockedReason: string | null; retryable: boolean; executionPolicy: { domain: string; requiredSkills: string[]; }; spawnGuardResult: unknown | null; }>; }; export {};