import { CoolhandOptions, CoolhandCallData, CoolhandLogResponse, LLMRequestLogFeedback, LLMRequestLogFeedbackResponse, CoolhandClientFilePayload, CoolhandClientFileResponse, SearchFeedbackParams, SearchFeedbackResponse, LLMRequestLogFeedbackDetail, GetLogContentSliceOptions, LlmRequestLogContentFull, GetLogContentSearchOptions, LlmRequestLogContentSearchResult, GetLogContentOptions, LlmRequestLogContent, SearchLogsParams, SearchLogsResponse, CoolhandStats } from './types.cjs'; declare class Coolhand { private patternMatchingService; private requestMonitoringService; private loggingService; private feedbackService; private clientFileService; private silent; constructor(options: CoolhandOptions); /** * Manually submit a single captured LLM request/response to Coolhand. * * Use this for logs that did not flow through automatic monitoring — for example the * coolhand-cli `capture-sessions` tool submitting locally-saved Claude Code / Codex * session turns. * * @param rawRequest The captured request/response payload. * @param options Optional settings. `collector` identifies the submission source and * overrides the default SDK collector string. `metadata` is a free-form object; the one * convention the backend uses is `project_path` (e.g. `{ project_path: '/Users/me/my-project' }` * — see the Understanding an LLM Request Log guide's Metadata section). * @returns Promise resolving to the created log response, or null if submission failed * or if the request was sent via the HTTPS fallback (Node.js < 18, where the response * body is not parsed). */ logRequest(rawRequest: CoolhandCallData, options?: { collector?: string; metadata?: Record; }): Promise; /** * Create feedback for an LLM request log * @param feedback The feedback data * @returns Promise resolving to the created feedback response or null if failed */ createFeedback(feedback: LLMRequestLogFeedback): Promise; /** * Upload a file (slide deck, report, or document) to Coolhand. * * Requires the **private** API key — construct this `Coolhand` instance with `apiKey` set to * your private key, not the public key used for `createFeedback`/`logRequest`, which 401s here. * * Uploads always land with `status: draft` — `status` is not settable via this method. * Requires Node.js 18+ (uses global `fetch`/`FormData`; there is no fallback for pre-18 Node). * * @param payload The file to upload plus optional `file_type`, `description`, and `metadata`. * @returns Promise resolving to the created client file response, or null if the upload failed. */ uploadClientFile(payload: CoolhandClientFilePayload): Promise; /** * Search feedback records using raw Ransack predicates (`q[...]` keys) plus `page`/`per`. * * Requires the **private** API key — construct this `Coolhand` instance with `apiKey` set to * your private key, not the public key used for `createFeedback`/`logRequest`, which 401s here. * * @param params Ransack predicates (e.g. `sentiment_eq`, `explanation_cont`), `s` (sort), and * `page`/`per` (pagination). * @returns The matching feedback records (`:summary` view) plus pagination metadata. * @throws Error on network failure or a non-JSON body. A non-2xx response throws an error * whose `status` property holds the HTTP status code. */ searchFeedback(params?: SearchFeedbackParams): Promise; /** * Get a single feedback record by ID, including `original_output`/`revised_output`/ * `feedback_partials`. * * Requires the **private** API key, same as {@link searchFeedback}. * * @param id The feedback record ID. * @returns The full feedback record (`:with_partials` view). * @throws Error if `id` is blank/whitespace-only or a bare dot-segment (`.`/`..`). Error on * network failure or a non-JSON body. A non-2xx response throws an error whose `status` * property holds the HTTP status code (e.g. 404 for an unknown ID). */ getFeedback(id: string): Promise; /** * Fetch full input/output content for a single log by ID. * * Requires the **private** API key — construct this `Coolhand` instance with `apiKey` set to * your private key, not the public key used for `createFeedback`/`logRequest`, which 401s here. * * @param logId The log's hashid. * @param opts `section`/`maxChars` for large logs, or `searchQuery` for snippet search * (mutually exclusive with `section`/`maxChars` — enforced by the overloads below), plus * `includeThinking`. * @throws Error if `logId` is blank/whitespace-only or a bare dot-segment (`.`/`..`), or if * `searchQuery` is blank/whitespace-only. Error on network failure or a non-JSON body. A * non-2xx response throws an error whose `status` property holds the HTTP status code (e.g. * 404 for an unknown ID). */ getLogContent(logId: string, opts?: GetLogContentSliceOptions): Promise; getLogContent(logId: string, opts: GetLogContentSearchOptions): Promise; getLogContent(logId: string, opts: GetLogContentOptions): Promise; /** * Search logs by named filters (`templateId`, `workloadId`, `model`, etc.) — not raw Ransack * predicates, unlike {@link searchFeedback}. * * Requires the **private** API key, same as {@link getLogContent}. * * @returns `{ logs, pagination }` — the matching logs for the requested page, plus pagination * totals. See `LoggingService#searchLogs`/`docs/log-search.md` for how `pagination` is sourced. * @throws Error on network failure or a non-JSON body. A non-2xx response throws an error * whose `status` property holds the HTTP status code. */ searchLogs(params?: SearchLogsParams): Promise; /** * Get sanitized headers for debugging purposes * @param headers Headers to sanitize * @param pattern Optional API pattern for pattern-specific sanitization * @returns Sanitized headers */ sanitizeHeaders(headers: any, pattern?: any): Record; /** * Get monitoring statistics * @returns Statistics about requests and interceptions */ getStats(): CoolhandStats; get excludeApiPatterns(): string[]; set excludeApiPatterns(patterns: string[]); } export { Coolhand };