import type { OntologySnapshot } from "../lockfile/types.js"; /** * Response from the register endpoint */ export interface RegisterResponse { success: boolean; hash: string; versionId?: string; limitReached?: boolean; message?: string; } /** * Chat message format */ export interface ChatMessage { role: "user" | "assistant"; content: string; } /** * Parameters for chat endpoint */ export interface ChatParams { uuid: string; messages: ChatMessage[]; /** Optional context about current state */ context?: Record; } /** * Response from chat endpoint */ export interface ChatResponse { success: boolean; message?: string; toolCalls?: Array<{ name: string; arguments: Record; result?: unknown; }>; limitReached?: boolean; } /** * Version history entry */ export interface VersionEntry { id: string; hash: string; createdAt: string; verified: boolean; status: "pending" | "approved" | "rejected"; } /** * Response from versions endpoint */ export interface VersionsResponse { success: boolean; versions: VersionEntry[]; } /** * Review action parameters */ export interface ReviewParams { uuid: string; versionId: string; action: "approve" | "reject"; comment?: string; } /** * Response from review endpoint */ export interface ReviewResponse { success: boolean; message?: string; } /** * Options for CloudClient */ export interface CloudClientOptions { /** Override the hosted URL (for testing) */ baseUrl?: string; /** API key for verified access */ apiKey?: string; } /** * Client for communicating with ont-run.com hosted services. * * Handles: * - Registering ontology with the cloud * - AI chat with tool execution * - Version history retrieval * - Version approval/rejection * * @example * ```ts * const client = new CloudClient(); * * // Register ontology * const result = await client.register({ * uuid: config.uuid, * ontology, * hash, * }); * * // Chat with AI agent * const chatResult = await client.chat({ * uuid: config.uuid, * messages: [{ role: 'user', content: 'Hello' }], * }); * ``` */ export declare class CloudClient { private baseUrl; private apiKey?; constructor(options?: CloudClientOptions); /** * Get headers for requests, including API key if available */ private getHeaders; /** * Register ontology with the cloud service. * This is called on server startup to sync the ontology. */ register(params: { uuid: string; ontology: OntologySnapshot; hash: string; }): Promise; /** * Send a chat message to the AI agent. */ chat(params: ChatParams): Promise; /** * Get version history for a UUID. */ versions(uuid: string): Promise; /** * Approve or reject a version. */ review(params: ReviewParams): Promise; /** * Check if the client has an API key configured. */ hasApiKey(): boolean; /** * Get the base URL for the cloud service. */ getBaseUrl(): string; }