import { z } from 'zod'; import { AuthMode, Registered } from './harness/harness-detect.js'; /** * `TINYFISH_NO_TELEMETRY` suppresses ALL CLI-emitted network analytics * (setup_completed, connect-event, update check). Any value except `0`/`false` * opts out — a privacy switch must not fail closed on `true`. */ export declare function telemetryDisabled(): boolean; /** * The one POST to `/api/cli/connect-event`, and the only place its security-relevant * properties live: trusted-origin key gating, `redirect: "error"`, the 2s cap, notice * capture. Never throws. `endpoint` is the caller's — connect and setup target the `--url` * being installed against, upgrade has none and uses BASE_URL. */ export declare function postConnectEvent(options: { endpoint: string; body: string; /** 2 where a lost event costs a headline metric — stale keep-alive sockets eat post-install POSTs. */ attempts: number; label: string; apiKey?: string; }): Promise; declare const harnessResultSchema: z.ZodObject<{ harness: z.ZodEnum<{ openclaw: "openclaw"; omp: "omp"; grok: "grok"; cursor: "cursor"; codex: "codex"; hermes: "hermes"; "command-code": "command-code"; kilo: "kilo"; opencode: "opencode"; pi: "pi"; cline: "cline"; "claude-code": "claude-code"; }>; detected: z.ZodBoolean; installed: z.ZodBoolean; verify_depth: z.ZodNullable>; verify_ok: z.ZodNullable; }, z.core.$strip>; /** First act of a `--all` run; everything upstream of it stays invisible. */ export declare function sendSetupStarted(mcpUrl: string, attemptId?: string, apiKey?: string): Promise; export type SetupBlockReason = 'key_rejected' | 'key_malformed' | 'key_unreadable'; export type SetupBlockedMode = 'all' | 'pick' | 'single'; export interface SetupBlockedDetail { blockReason: SetupBlockReason; keySource: 'env' | 'config' | 'explicit'; /** Only a server answer has one; a malformed key never reaches the API. */ status?: number; mode: SetupBlockedMode; attemptId?: string; } /** Terminal state for a run the key gate stopped; fires instead of setup_started. */ export declare function sendSetupBlocked(mcpUrl: string, detail: SetupBlockedDetail, apiKey?: string): Promise; export declare const setupCompletedPayloadSchema: z.ZodObject<{ harnesses: z.ZodArray; detected: z.ZodBoolean; installed: z.ZodBoolean; verify_depth: z.ZodNullable>; verify_ok: z.ZodNullable; }, z.core.$strip>>; cli_version: z.ZodString; mode: z.ZodOptional>; connect_attempt_id: z.ZodOptional; }, z.core.$strip>; type SetupCompletedPayload = z.infer; export type HarnessResult = z.infer; export type SetupMode = NonNullable; export type UpgradeOutcome = 'updated' | 'failed' | 'interrupted'; /** Step selection; "updated" means every selected step ran. */ export type UpgradeScope = 'both' | 'cli' | 'skill'; /** `toVersion` is null when the run was interrupted or the installed version could not be read. */ export declare function sendUpgradeCompleted(fromVersion: string, toVersion: string | null, outcome: UpgradeOutcome, scope: UpgradeScope, apiKey?: string): Promise; export declare function sendSetupCompleted(mcpUrl: string, harnesses: HarnessResult[], apiKey?: string, mode?: SetupMode, attemptId?: string): Promise; export declare const DOCTOR_ERROR_CLASSES: readonly ["command_not_found", "timeout", "spawn_error", "nonzero_exit", "unexpected_error"]; export type DoctorErrorClass = (typeof DOCTOR_ERROR_CLASSES)[number]; /** Derived, not read: the catch is generic, so only the code is trustworthy. */ export declare function doctorErrorClass(error: unknown): DoctorErrorClass; declare const doctorCompletedPayloadSchema: z.ZodObject<{ outcome: z.ZodLiteral<"completed">; schema_version: z.ZodInt; cli_version: z.ZodString; ok_harnesses: z.ZodBoolean; ok_cli: z.ZodBoolean; checks_pass: z.ZodInt; checks_fail: z.ZodInt; checks_warn: z.ZodInt; checks_skip: z.ZodInt; repairs_offered: z.ZodInt; repair_actions: z.ZodArray>; repairs_attempted: z.ZodInt; repairs_succeeded: z.ZodInt; fix_mode: z.ZodEnum<{ none: "none"; fix: "fix"; fix_yes: "fix_yes"; }>; harness_scope: z.ZodEnum<{ openclaw: "openclaw"; omp: "omp"; grok: "grok"; cursor: "cursor"; codex: "codex"; hermes: "hermes"; "command-code": "command-code"; kilo: "kilo"; opencode: "opencode"; pi: "pi"; cline: "cline"; "claude-code": "claude-code"; all: "all"; }>; is_human_initiated: z.ZodBoolean; failed_check_ids: z.ZodArray; failed_harnesses: z.ZodArray>; harnesses: z.ZodArray; detected: z.ZodBoolean; registered: z.ZodEnum; auth_mode: z.ZodEnum; recorded_auth_mode: z.ZodOptional>; proves_harness_reach: z.ZodBoolean; }, z.core.$strip>>; duration_ms: z.ZodInt; hermes_plugin_version: z.ZodOptional; }, z.core.$strip>; declare const doctorCouldNotRunPayloadSchema: z.ZodObject<{ outcome: z.ZodLiteral<"could_not_run">; error_class: z.ZodEnum<{ timeout: "timeout"; command_not_found: "command_not_found"; spawn_error: "spawn_error"; nonzero_exit: "nonzero_exit"; unexpected_error: "unexpected_error"; }>; schema_version: z.ZodInt; cli_version: z.ZodString; fix_mode: z.ZodEnum<{ none: "none"; fix: "fix"; fix_yes: "fix_yes"; }>; harness_scope: z.ZodEnum<{ openclaw: "openclaw"; omp: "omp"; grok: "grok"; cursor: "cursor"; codex: "codex"; hermes: "hermes"; "command-code": "command-code"; kilo: "kilo"; opencode: "opencode"; pi: "pi"; cline: "cline"; "claude-code": "claude-code"; all: "all"; }>; is_human_initiated: z.ZodBoolean; duration_ms: z.ZodInt; }, z.core.$strip>; declare const doctorPayloadSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{ outcome: z.ZodLiteral<"completed">; schema_version: z.ZodInt; cli_version: z.ZodString; ok_harnesses: z.ZodBoolean; ok_cli: z.ZodBoolean; checks_pass: z.ZodInt; checks_fail: z.ZodInt; checks_warn: z.ZodInt; checks_skip: z.ZodInt; repairs_offered: z.ZodInt; repair_actions: z.ZodArray>; repairs_attempted: z.ZodInt; repairs_succeeded: z.ZodInt; fix_mode: z.ZodEnum<{ none: "none"; fix: "fix"; fix_yes: "fix_yes"; }>; harness_scope: z.ZodEnum<{ openclaw: "openclaw"; omp: "omp"; grok: "grok"; cursor: "cursor"; codex: "codex"; hermes: "hermes"; "command-code": "command-code"; kilo: "kilo"; opencode: "opencode"; pi: "pi"; cline: "cline"; "claude-code": "claude-code"; all: "all"; }>; is_human_initiated: z.ZodBoolean; failed_check_ids: z.ZodArray; failed_harnesses: z.ZodArray>; harnesses: z.ZodArray; detected: z.ZodBoolean; registered: z.ZodEnum; auth_mode: z.ZodEnum; recorded_auth_mode: z.ZodOptional>; proves_harness_reach: z.ZodBoolean; }, z.core.$strip>>; duration_ms: z.ZodInt; hermes_plugin_version: z.ZodOptional; }, z.core.$strip>, z.ZodObject<{ outcome: z.ZodLiteral<"could_not_run">; error_class: z.ZodEnum<{ timeout: "timeout"; command_not_found: "command_not_found"; spawn_error: "spawn_error"; nonzero_exit: "nonzero_exit"; unexpected_error: "unexpected_error"; }>; schema_version: z.ZodInt; cli_version: z.ZodString; fix_mode: z.ZodEnum<{ none: "none"; fix: "fix"; fix_yes: "fix_yes"; }>; harness_scope: z.ZodEnum<{ openclaw: "openclaw"; omp: "omp"; grok: "grok"; cursor: "cursor"; codex: "codex"; hermes: "hermes"; "command-code": "command-code"; kilo: "kilo"; opencode: "opencode"; pi: "pi"; cline: "cline"; "claude-code": "claude-code"; all: "all"; }>; is_human_initiated: z.ZodBoolean; duration_ms: z.ZodInt; }, z.core.$strip>], "outcome">; export type DoctorCompletedPayload = z.infer; export type DoctorCouldNotRunPayload = z.infer; export type DoctorPayload = z.infer; export declare function sendDoctorCompleted(mcpUrl: string, payload: DoctorPayload, apiKey?: string): Promise; export {};