import { APIPath } from "./config"; import { Link, LinkOptions } from "./link"; import { Conversation, ConversationOptions } from "./modules/conversation"; import { UsagePolicyDataOptions } from "./modules/usage"; import { type CancelJobOptions, type GetJobJournalOptions, type GetJobOptions, type SetPhaseModelOptions, type ListJobsOptions, type ResumeJobOptions, type UpdateJobOptions, type UpdateJobSettingsOptions } from "./modules/jobs"; import { type AnswerDeliveryOptions, type ListDeliveriesOptions } from "./modules/outreach"; type OptionalApiKey = Omit & { /** Optional API key, defaults to API key specified in client */ apiKey?: string; }; export type ButlerBotClientOptions = { /** The server endpoint, API calls are sent here */ serverUrl?: string; /** * Where links connect. Defaults to the hosted link service. * * Links are no longer carried by the core server, so this is a second address rather than * a path on the first. A `serverUrl` pointing at your own stack is used for links too, * unless this names somewhere else. */ linkUrl?: string; /** The API key to use with ButlerBot */ apiKey: string; /** Whether to enable debug logs */ debug?: boolean; }; export declare class ButlerBotClient { private apiKey; private serverUrl; private linkUrl; private debug; constructor(config: ButlerBotClientOptions); /** Checks the health of the server returning true if server is alive */ healthCheck(healthCheckPath?: string): Promise; /** Spawns a new Conversation, inherits api key and server URL */ createConversation(config?: OptionalApiKey>): Conversation; /** * Creates a Link: a live connection that can register tools and hooks, and carry * conversations. Inherits the client's API key and link URL. * * The link URL, not the server URL: links are served by their own service. Pass * `serverUrl` here, or `linkUrl` to the client, to point somewhere else. */ createLink(config: OptionalApiKey): Link; /** Get current usage policy data */ getUsagePolicyData(config: OptionalApiKey): Promise; /** A page of this user's jobs, with what their jobs may spend today */ listJobs(config?: OptionalApiKey): Promise; /** One job, with its plan, its journal and the questions waiting on the user */ getJob(config: OptionalApiKey): Promise; /** A page of one job's journal, newest page first */ getJobJournal(config: OptionalApiKey): Promise; /** Stops a job. Throws a `ButlerBotAPIError` with `isConflict` when it had already finished */ cancelJob(config: OptionalApiKey): Promise; /** Continues a job parked waiting for budget. Throws a `ButlerBotAPIError` with `isConflict` when it is in any other status */ resumeJob(config: OptionalApiKey): 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 */ updateJob(config: OptionalApiKey): Promise; /** Changes the model one phase of a job's plan runs on; only a phase that has not started */ setPhaseModel(config: OptionalApiKey): Promise; /** Changes this user's job settings: their daily allowance and what new jobs start with */ updateJobSettings(config?: OptionalApiKey): Promise; /** A page of the inbox: what Alfred has told or asked this user outside a chat */ listDeliveries(config?: OptionalApiKey): Promise; /** Answers a delivery. Throws a `ButlerBotAPIError` with `isConflict` when it was already answered */ answerDelivery(config: OptionalApiKey): Promise; /** The client's own server and key underneath whatever the call named itself. */ private forRequest; } export * from "./types/type_registry"; export * from "./link"; export { Conversation }; export type { ConversationOptions }; export type { APIPath }; export type { ConversationStream, ConversationTransport, TransportTurnRequest, TransportHandlers, } from "./modules/transport"; export { ButlerBotAPIError } from "./util/api_error"; export { listJobs, getJob, cancelJob, resumeJob, updateJob, updateJobSettings } from "./modules/jobs"; export type { JobsRequestOptions, ListJobsOptions, GetJobOptions, CancelJobOptions, ResumeJobOptions, UpdateJobOptions, UpdateJobSettingsOptions, } from "./modules/jobs"; export { listDeliveries, answerDelivery } from "./modules/outreach"; export type { OutreachRequestOptions, ListDeliveriesOptions, AnswerDeliveryOptions, } from "./modules/outreach"; export { LinkConversationTransport } from "./modules/transport_link"; export { SSEConversationTransport } from "./modules/transport_sse"; export type { SteerResult, TurnStopMode, TurnStopped } from "./modules/transport";