import { type Config } from "../config.js"; import { type HealthOptions } from "../health.js"; import type { Paths } from "../paths.js"; import { type IssueDiagnostics, type IssueReportRequest, type IssueReportResponse } from "./protocol.js"; /** What a person gives; `diagnostics: false` sends their words only. */ export type IssueReportInput = Omit & { diagnostics?: boolean; }; export declare class IssueReportError extends Error { constructor(message: string); } export interface DiagnosticsOptions { config?: Config; /** Options of the quick local health check when no server runs (tests turn the Tailscale and service probes off). */ health?: HealthOptions; } /** * The versions, the platform and the cloud mode; then, from the running server's cached answers (or a quick local check * when none runs), the link's state, whether each runner is ready and the health summary with the checks that fail or * warn. Scrubbed of private `.env` values, then cut to the protocol's bounds; what cannot be read is left out. */ export declare function gatherDiagnostics(paths: Paths, env: NodeJS.ProcessEnv, options?: DiagnosticsOptions): Promise; export interface BuiltIssueReport { /** The cloud it goes to. */ url: string; /** Exactly what is sent. */ request: IssueReportRequest; } /** The request, scrubbed and validated: what `reportIssue` sends and `skillhook cloud report --dry-run` prints. */ export declare function buildIssueReport(paths: Paths, env: NodeJS.ProcessEnv, input: IssueReportInput, options?: DiagnosticsOptions): Promise; export interface IssueReportResult extends BuiltIssueReport { /** The cloud's answer: the issue's id, number and URL, and whether a confirmation email went out. */ issue: IssueReportResponse; } export interface ReportOptions extends DiagnosticsOptions { fetchImpl?: typeof fetch; /** One request's timeout (default 20 s). */ timeoutMs?: number; /** The pause before the n-th retry after a network error, a timeout or a 5xx (default 1 s, then 2 s). */ backoffMs?: (retry: number) => number; } /** Sends a report from this machine: needs the pairing, refused under `SKILLHOOK_NO_CLOUD` and to a URL that is not https. */ export declare function reportIssue(paths: Paths, env: NodeJS.ProcessEnv, input: IssueReportInput, options?: ReportOptions): Promise;