import type { JobAutonomy, JobCancelResponse, JobDetailResponse, JobJournalPage, JobListResponse, JobPhaseModelResponse, JobResumeResponse, JobSettingsResponse, JobSettingsUpdate, JobStatus, JobUpdateResponse } from "../types/jobs"; /** What every jobs call needs: where the server is, and who is asking. */ export type JobsRequestOptions = { serverURL?: string; /** The base path for jobs, when it is not the default. */ path?: string; apiKey: string; debug?: boolean; }; export type ListJobsOptions = JobsRequestOptions & { /** 1-based. The first page when it is not given. */ page?: number; /** How many jobs per page. */ limit?: number; /** Only jobs in this status. */ status?: JobStatus; }; export type GetJobOptions = JobsRequestOptions & { jobId: string; }; export type GetJobJournalOptions = JobsRequestOptions & { jobId: string; /** 1-based, newest page first. The first page when it is not given. */ page?: number; /** How many entries per page; the server caps it. */ limit?: number; }; export type CancelJobOptions = JobsRequestOptions & { jobId: string; }; export type ResumeJobOptions = JobsRequestOptions & { jobId: string; }; export type UpdateJobOptions = JobsRequestOptions & { jobId: string; /** A new short name for the job, a few words at most. */ title?: string; /** How far this job may act outward on its own. */ autonomy?: JobAutonomy; /** When that autonomy lapses back to asking. Null clears it. */ autonomyUntil?: string | number | null; /** Things this job asks about however free it otherwise is. */ alwaysAsk?: string[]; /** A ceiling on what the job may spend in all, in dollars. Null clears it. */ capUsd?: number | null; /** * The model or alias the whole job runs on, and the plan's default. * * A name sets it; null clears it, leaving the planner to pick a model per phase. One * phase's model on its own is `setPhaseModel`. */ model?: string | null; }; export type SetPhaseModelOptions = JobsRequestOptions & { jobId: string; /** The phase's id as the plan names it. */ phaseId: string; /** One of the detail's `phaseModels`. */ model: string; }; export type UpdateJobSettingsOptions = JobsRequestOptions & JobSettingsUpdate; /** A page of the caller's jobs, newest first, with what their jobs may spend today. */ export declare function listJobs(options: ListJobsOptions): Promise; /** One job with its plan, its journal and the questions of its nobody has answered. */ export declare function getJob(options: GetJobOptions): Promise; /** A page of one job's journal, newest page first, each page in the order it was written. */ export declare function getJobJournal(options: GetJobJournalOptions): Promise; /** * Stops a job. * * A job that had already finished is a 409: the call throws a `ButlerBotAPIError` whose * `isConflict` is true and whose `body` still carries the job as it stands. */ export declare function cancelJob(options: CancelJobOptions): Promise; /** * Continues a job that is parked waiting for budget, when there is room for it again. * * The answer says what happened either way: `resumed` is the job queued again, and otherwise * `reason`, `action` and `message` say why it is still parked and what would change that. A * job in any other status is a 409: the call throws a `ButlerBotAPIError` whose `isConflict` * is true and whose `body` still carries the job as it stands. */ export declare function resumeJob(options: ResumeJobOptions): Promise; /** Changes one job's name, the model it runs on, its spending cap and its autonomy: how far it may act, until when, and what it always asks about. */ export declare function updateJob(options: UpdateJobOptions): Promise; /** * Changes the model one phase of a job's plan runs on. * * Only a phase that has not started or is blocked: a running or done phase's model is what its * work ran on. A model the owner's plan cannot run is a 400 whose body names the ones it can. */ export declare function setPhaseModel(options: SetPhaseModelOptions): Promise; /** Changes the owner's job settings: their daily allowance and the autonomy new jobs start with. */ export declare function updateJobSettings(options: UpdateJobSettingsOptions): Promise;