import { type AgentActionScope, type AgentChatAttachment, type AgentChatScope } from "../agent/types.js"; import type { ReasoningEffort } from "../shared/reasoning-effort.js"; export type BackgroundAgentSessionStatus = "queued" | "running" | "completed" | "truncated" | "errored" | "aborted" | "unavailable"; export interface BackgroundAgentSessionStartOptions { message: string; operationId?: string; threadId?: string; scope?: AgentChatScope | null; actionScope?: AgentActionScope; mode?: "act" | "plan"; model?: string; engine?: string; effort?: ReasoningEffort; instructions?: string; attachments?: AgentChatAttachment[]; usageLabel?: string; } export interface BackgroundAgentSessionReceipt { operationId: string; threadId: string; turnId: string; } export interface BackgroundAgentSessionSnapshot extends BackgroundAgentSessionReceipt { status: BackgroundAgentSessionStatus; runId?: string; terminalReason?: string | null; transportError?: string; } export interface BackgroundAgentSessionHandle extends BackgroundAgentSessionReceipt { accepted: Promise; completion: Promise; status(): Promise; cancel(reason?: string): Promise; open(options?: { prefill?: string; }): void; } export declare function startBackgroundAgentSession(options: BackgroundAgentSessionStartOptions): BackgroundAgentSessionHandle; export declare function getBackgroundAgentSessionStatus(receipt: BackgroundAgentSessionReceipt): Promise; export declare function cancelBackgroundAgentSession(options: { threadId: string; turnId: string; reason?: string; }): Promise; export type AgentRunThreadProjectionRetryState = "already_projected" | "projected" | "deferred"; export declare function retryAgentRunThreadProjection(runId: string): Promise<{ state: AgentRunThreadProjectionRetryState; }>;