import { CoolhandCallData, CoolhandMatchedPattern, CoolhandLogResponse, GetLogContentSliceOptions, LlmRequestLogContentFull, GetLogContentSearchOptions, LlmRequestLogContentSearchResult, GetLogContentOptions, LlmRequestLogContent, SearchLogsParams, SearchLogsResponse } from '../types.cjs'; import { CollectionMethod } from '../utils/collector.cjs'; import { BaseService, BaseServiceConfig } from './BaseService.cjs'; interface LoggingServiceConfig extends BaseServiceConfig { } declare class LoggingService extends BaseService { constructor(config: LoggingServiceConfig); logRequestToAPI(callData: CoolhandCallData, matchedPattern?: CoolhandMatchedPattern, collectionMethod?: CollectionMethod, collector?: string, metadata?: Record): Promise; /** * Fetch full input/output content for a single log by ID. Requires the client's **private** * API key — the public key used by {@link logRequestToAPI} will 401 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 (`.`/`..`) — either * would otherwise silently resolve away to the `index` route or beyond (returning a bare array * typed as a single log's content) rather than 404ing on `show`. Also throws if `searchQuery` * is blank/whitespace-only, which would silently fall through to the content shape server-side * while the overload above promises a search result. 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 `FeedbackService#searchFeedback` — applied on top of the endpoint's * existing Ransack-backed search/sort; `sort` reaches that directly, sent as `q[s]`. Requires * the client's **private** API key, same as {@link getLogContent}. * * @returns `{ logs, pagination }` — the matching logs for the requested page, plus pagination * totals. The backing endpoint renders `logs` as a bare array on the wire and, once * Coolhand-Labs/coolhand#1096 ships, exposes pagination via X-Total-Count/X-Page/X-Per-Page/ * X-Total-Pages response headers instead of a body envelope; this method reads those headers * when present, assembling the same `Pagination` shape `searchFeedback` embeds in its body. * Until #1096 deploys, those headers are absent and `pagination` is derived from `logs`/ * `params` instead (see {@link paginationFromHeaders}) rather than falsely reporting zero * results. Pass `params.includeTotal` to opt into exact totals at the cost of a `COUNT(*)` on * the backend — left unset, the estimate above is used. * @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; private paginationFromHeaders; private logRequestInfo; } export { LoggingService, type LoggingServiceConfig };