import type { RunResultMetadata } from "./executor-types.js"; import type { McpServerConfig, ModelListItem, ModelSelection } from "./options.js"; export type V1Image = { url: string; dimension?: { width: number; height: number; }; } | { data: string; mimeType: string; dimension?: { width: number; height: number; }; }; export interface V1Prompt { text: string; images?: V1Image[]; } export interface V1Env { type: "cloud" | "pool" | "machine"; name?: string; } export interface V1Repository { url: string; startingRef?: string; prUrl?: string; } type V1StdioMcpServerConfig = Omit, "cwd">; type V1RemoteMcpServerConfig = Extract; export type V1McpServer = (V1StdioMcpServerConfig | V1RemoteMcpServerConfig) & { name: string; }; export interface V1CustomSubagent { name: string; description: string; prompt: string; model?: string; } export interface V1CreateAgentRequest { agentId?: string; prompt: V1Prompt; model?: ModelSelection; name?: string; mcpServers?: V1McpServer[]; customSubagents?: V1CustomSubagent[]; env?: V1Env; repos?: V1Repository[]; workOnCurrentBranch?: boolean; autoCreatePR?: boolean; skipReviewerRequest?: boolean; } export interface V1CreateRunRequest { prompt: V1Prompt; } export interface V1Agent { id: string; name?: string; status: "ACTIVE" | "ARCHIVED"; env?: V1Env; repos?: Array<{ url: string; startingRef: string; prUrl?: string; }>; workOnCurrentBranch?: boolean; autoCreatePR?: boolean; skipReviewerRequest?: boolean; customSubagents?: V1CustomSubagent[]; url: string; createdAt: string; updatedAt: string; latestRunId?: string; } export interface V1Run { id: string; agentId: string; status: "CREATING" | "RUNNING" | "FINISHED" | "ERROR" | "CANCELLED" | "EXPIRED"; createdAt: string; updatedAt: string; durationMs?: number; result?: string; git?: { branches: Array<{ repoUrl: string; branch?: string; prUrl?: string; }>; }; } export interface V1Artifact { path: string; sizeBytes: number; updatedAt: string; } export interface V1MeResponse { apiKeyName: string; userEmail?: string; createdAt: string; } export interface V1GitHubRepository { owner: string; name: string; repository: string; } export interface V1ListResult { items: T[]; nextCursor?: string; } export interface V1ErrorResponse { error: { code: string; message: string; helpUrl?: string; provider?: string; }; } export interface V1RunPathParams { agentId: string; runId: string; } export declare function mapV1RunResultMetadataToSdk(run: Partial>): RunResultMetadata; export declare class CloudApiClient { private readonly baseUrl; private readonly apiKey; private readonly isLocalhost; constructor(apiKey: string, baseUrl?: string); private headers; private request; private throwApiError; createAgent(req: V1CreateAgentRequest): Promise<{ agent: V1Agent & { latestRunId: string; }; run: V1Run; }>; getAgent(agentId: string): Promise; listAgents(params?: { limit?: number; cursor?: string; prUrl?: string; includeArchived?: boolean; }): Promise>; archiveAgent(agentId: string): Promise<{ id: string; }>; unarchiveAgent(agentId: string): Promise<{ id: string; }>; deleteAgent(agentId: string): Promise<{ id: string; }>; createRun(agentId: string, req: V1CreateRunRequest): Promise<{ run: V1Run; }>; listRuns(agentId: string, params?: { limit?: number; cursor?: string; }): Promise>; getRun({ agentId, runId }: V1RunPathParams): Promise; cancelRun({ agentId, runId, }: V1RunPathParams): Promise<{ id: string; }>; streamRun({ agentId, runId, lastEventId, signal, }: V1RunPathParams & { lastEventId?: string; signal?: AbortSignal; }): Promise; listArtifacts(agentId: string): Promise<{ items: V1Artifact[]; }>; getArtifactDownloadUrl({ agentId, path, }: { agentId: string; path: string; }): Promise<{ url: string; expiresAt: string; }>; getMe(): Promise; listModels(): Promise<{ items: ModelListItem[]; }>; listRepositories(): Promise<{ items: V1GitHubRepository[]; }>; } export {}; //# sourceMappingURL=cloud-api-client.d.ts.map