import { type RetryConfig } from "../platform/adapters/veryfront-api-client/retry-handler.js"; import type { ResolvedTriggerTarget } from "../trigger/target.js"; import { type CancelRunResponse, type CreateRunResponse, type Run, type RunEventList, type RunList, type ScheduleRunCreateResponse } from "./schemas.js"; /** Configuration used by the Veryfront runs client. */ export interface VeryfrontRunsClientConfig { apiUrl?: string; authToken?: string; projectReference?: string; retry?: Partial; } /** Options accepted by project-scoped run requests. */ export interface ProjectScopedOptions { projectReference?: string; } /** Runtime target for a task, workflow, or eval run. */ export type RunRuntimeTargetKind = "main_branch" | "environment" | "preview_branch"; /** Runtime target fields accepted by run creation APIs. */ export interface RunRuntimeTargetOptions { runtimeTargetKind?: RunRuntimeTargetKind; runtimeTargetEnvironmentId?: string | null; runtimeTargetBranchId?: string | null; } export interface RunCreateBaseInput { projectId: string; publicId?: string; parentRunId?: string; } export interface CreateTaskRunInput extends RunCreateBaseInput, RunRuntimeTargetOptions { name?: string; target: `task:${string}`; batchId?: string; config?: Record; timeoutSeconds?: number; backoffLimit?: number; } export interface CreateWorkflowRunInput extends RunCreateBaseInput, RunRuntimeTargetOptions { workflowId: string; target: `workflow:${string}`; input?: Record; startMode?: string; } /** Input payload for creating an eval run. */ export interface CreateEvalRunInput extends RunCreateBaseInput, RunRuntimeTargetOptions { target: `eval:${string}`; input?: Record; config?: Record; startMode?: string; } /** Input for triggering one persisted schedule by its canonical UUID. */ export interface CreateScheduleRunInput extends ProjectScopedOptions { scheduleId: string; runName?: string; idempotencyKey?: string; } /** Input for resolving and triggering one pushed source-defined schedule. */ export interface CreateScheduleRunFromSourceInput extends ProjectScopedOptions { sourceTriggerId: string; runName?: string; idempotencyKey?: string; } /** Cloud schedule metadata returned with an accepted source-triggered run. */ export interface CreateScheduleRunFromSourceResult { scheduleRun: ScheduleRunCreateResponse; timeoutSeconds: number; target: ResolvedTriggerTarget; } /** Input payload for knowledge ingest by upload IDs. */ export interface KnowledgeIngestByUploadIdsInput extends Omit { uploadIds: string[]; } /** Input payload for knowledge ingest by upload paths. */ export interface KnowledgeIngestByUploadPathsInput extends Omit { uploadPaths: string[]; } /** Input payload for knowledge ingest by upload prefix. */ export interface KnowledgeIngestByUploadPrefixInput extends Omit { uploadPrefix: string; } export interface ListRunsOptions extends ProjectScopedOptions { cursor?: string; limit?: number; } export interface ListRunEventsOptions { afterEventId?: number; limit?: number; } type NamespaceMethod = (...args: TArgs) => Promise; /** Public client for canonical durable runs. */ export declare class VeryfrontRunsClient { private readonly config; private readonly retryConfig; private requestToken?; private requestProjectReference?; readonly knowledge: { ingestByUploadIds: NamespaceMethod<[KnowledgeIngestByUploadIdsInput], CreateRunResponse>; ingestByUploadPaths: NamespaceMethod<[KnowledgeIngestByUploadPathsInput], CreateRunResponse>; ingestByUploadPrefix: NamespaceMethod<[KnowledgeIngestByUploadPrefixInput], CreateRunResponse>; }; constructor(config?: VeryfrontRunsClientConfig); setRequestToken(token: string): void; clearRequestToken(): void; setProjectReference(projectReference: string): void; clearProjectReference(): void; createTaskRun(input: CreateTaskRunInput): Promise; createWorkflowRun(input: CreateWorkflowRunInput): Promise; createEvalRun(input: CreateEvalRunInput): Promise; createScheduleRun(input: CreateScheduleRunInput): Promise; createScheduleRunFromSource(input: CreateScheduleRunFromSourceInput): Promise; list(options?: ListRunsOptions): Promise; get(runId: string): Promise; events(runId: string, options?: ListRunEventsOptions): Promise; cancel(runId: string): Promise; private ingestKnowledgeByUploadIds; private ingestKnowledgeByUploadPaths; private ingestKnowledgeByUploadPrefix; private resolveConnection; private resolveProjectReference; private requestJson; } /** Create a runs client. */ export declare function createRunsClient(config?: VeryfrontRunsClientConfig): VeryfrontRunsClient; export {}; //# sourceMappingURL=runs-client.d.ts.map