import type { TerminalId, TerminalLayoutState, TerminalSummary } from './types.js';
export interface PasswordRequest {
    password: string;
    rememberNetwork?: boolean;
}
export interface LoginRequest {
    password: string;
    otp?: string;
    rememberNetwork?: boolean;
}
export interface ReauthRequest {
    otp?: string;
    rememberNetwork?: boolean;
}
export type ClientDiagnosticValue = string | number | boolean | null;
export interface ClientDiagnosticEvent {
    at: string;
    event: string;
    data?: Record<string, ClientDiagnosticValue>;
}
export interface ClientDiagnosticsRequest {
    reason: string;
    events: ClientDiagnosticEvent[];
}
export interface ClientDiagnosticsResponse {
    ok: true;
    accepted: number;
}
export interface TrustedDeviceSummary {
    id: string;
    label: string;
    createdAt: string;
    lastSeenAt: string;
    current: boolean;
}
export interface IpRuleSummary {
    id: string;
    value: string;
    label: string;
    createdAt: string;
}
export interface TrustedDeviceListResponse {
    devices: TrustedDeviceSummary[];
}
export interface IpRuleListResponse {
    networks: IpRuleSummary[];
}
export interface AddIpRuleRequest {
    value: string;
    label?: string;
}
export interface TotpSetupResponse {
    secret: string;
    qrDataUrl: string;
}
export interface TotpActivateRequest {
    secret: string;
    otp: string;
}
export interface AgentSummary {
    id: string;
    name: string;
    url: string;
}
export interface AgentListResponse {
    agents: AgentSummary[];
}
export interface AddAgentRequest {
    name: string;
    url: string;
    token: string;
}
export interface ReorderAgentsRequest {
    agentIds: string[];
}
export interface AgentPingResponse {
    ok: boolean;
    latencyMs: number;
}
export interface AgentUninstallResponse {
    ok: boolean;
    message: string;
    disconnecting: boolean;
    disconnected?: boolean;
}
export interface SystemStatsResponse {
    cpuPercent: number | null;
    memoryPercent: number;
    memoryUsedBytes: number;
    memoryTotalBytes: number;
    diskPercent?: number | null;
    diskUsedBytes?: number | null;
    diskTotalBytes?: number | null;
    swapPercent?: number | null;
    swapUsedBytes?: number | null;
    swapTotalBytes?: number | null;
    cores: number;
}
export interface ManualUpdateInfo {
    reason: 'permission';
    message: string;
    command: string;
    detectedAt: string;
}
export interface VersionInfo {
    version: string;
    runningVersion: string;
    manualUpdate?: ManualUpdateInfo | null;
}
export interface UpdateCheckResponse {
    currentVersion?: string;
    latestVersion?: string | null;
    updateAvailable?: boolean | null;
    error?: string;
}
export interface UpdateResponse {
    ok: boolean;
    changed: boolean;
    message: string;
    restarting: boolean;
    manualUpdate?: ManualUpdateInfo | null;
}
export interface CreateTerminalRequest {
    parentTerminalId?: TerminalId;
    cwd?: string;
    cols?: number;
    rows?: number;
}
export interface TerminalListResponse {
    terminals: TerminalSummary[];
}
export interface TerminalResponse {
    terminal: TerminalSummary;
}
export interface TerminalHistoryCursor {
    startLine: number;
    endLine: number;
    hasMore: boolean;
}
export interface TerminalHistoryResponse extends TerminalHistoryCursor {
    terminalId: TerminalId;
    output: string[];
}
export type TerminalTranscriptProvider = 'codex' | 'claude';
export interface TerminalTranscriptSource {
    provider: TerminalTranscriptProvider;
    sessionId: string;
}
export interface TerminalTranscriptSourceResponse {
    terminalId: TerminalId;
    source: TerminalTranscriptSource | null;
}
export interface TerminalTranscriptHistoryResponse {
    terminalId: TerminalId;
    source: TerminalTranscriptSource | null;
    cursor: string | null;
    hasMore: boolean;
    output: string[];
}
export interface TerminalTranscriptHistoryRequest {
    cursor?: string;
    limit?: number;
    maxLines?: number;
    includeTools?: boolean;
}
export interface TerminalLayoutResponse {
    layout: TerminalLayoutState | null;
    revision: number;
    updatedAt: string | null;
}
export interface UpdateTerminalLayoutRequest {
    layout: TerminalLayoutState;
    baseRevision?: number;
}
export interface UploadManifestEntry {
    fieldName: string;
    relativePath: string;
    size: number;
}
export interface UploadManifest {
    terminalId: TerminalId;
    entries: UploadManifestEntry[];
}
export interface UploadResultEntry {
    relativePath: string;
    savedRelativePath?: string;
    status: 'uploaded' | 'failed';
    size?: number;
    error?: string;
}
export interface UploadResponse {
    destinationCwd: string;
    uploaded: number;
    failed: number;
    results: UploadResultEntry[];
}
export interface NotificationAssetSummary {
    id: string;
    filename: string;
    source: 'built-in' | 'uploaded';
    enabled: boolean;
    contentType: 'video/mp4' | 'video/webm';
    size: number;
    createdAt: string;
    url: string;
}
export interface NotificationAssetListResponse {
    assets: NotificationAssetSummary[];
    maxFileBytes: number;
}
export interface NotificationAssetResponse {
    asset: NotificationAssetSummary;
}
export interface UpdateNotificationAssetSelectionRequest {
    enabledAssetIds: string[];
}
export interface FileRootRequest {
    terminalId: TerminalId;
}
export interface FileRootResponse {
    rootToken: string;
    terminalId: TerminalId;
    rootPath: string;
    issuedAt: string;
}
export interface FilePathRequest {
    rootToken: string;
    path: string;
}
export type FileEntryKind = 'file' | 'directory' | 'symlink' | 'other';
export type FilePreviewKind = 'image' | 'pdf' | 'none';
export interface FileEntry {
    name: string;
    path: string;
    kind: FileEntryKind;
    size: number | null;
    mtime: string | null;
    editable: boolean;
    previewKind: FilePreviewKind;
}
export interface FileListRequest extends FilePathRequest {
}
export interface FileListResponse {
    rootPath: string;
    path: string;
    entries: FileEntry[];
}
export interface FileVersion {
    size: number;
    mtimeMs: number;
    ino?: number;
}
export interface FileReadRequest extends FilePathRequest {
}
export interface FileReadResponse {
    path: string;
    content: string;
    language: 'text' | 'markdown';
    version: FileVersion;
}
export interface FileWriteRequest extends FilePathRequest {
    content: string;
    expectedVersion: FileVersion;
}
export interface FileWriteResponse {
    path: string;
    version: FileVersion;
}
export interface FileOpenResponse {
    opened: true;
}
export interface FileOpenRequest extends FilePathRequest {
    terminalId?: TerminalId;
}
export interface FileCreateRequest extends FilePathRequest {
    kind: 'file' | 'directory';
}
export interface FileCreateResponse {
    entry: FileEntry;
}
export interface FileMoveRequest {
    rootToken: string;
    sourcePath: string;
    destinationPath: string;
}
export interface FileMoveResponse {
    entry: FileEntry;
}
export interface FileDeletePreviewRequest extends FilePathRequest {
}
export interface FileDeletePreviewResponse {
    path: string;
    kind: FileEntryKind;
    descendantCount: number;
    previewToken: string;
}
export interface FileDeleteRequest extends FilePathRequest {
    previewToken: string;
}
export interface FileDeleteResponse {
    path: string;
    deleted: true;
}
export type ClientTerminalMessage = {
    type: 'input';
    terminalId: TerminalId;
    data: string;
} | {
    type: 'refresh_cwd';
    terminalId: TerminalId;
} | {
    type: 'resize';
    terminalId: TerminalId;
    cols: number;
    rows: number;
} | {
    type: 'ping';
    nonce: string;
};
export type ServerTerminalMessage = {
    type: 'snapshot';
    terminal: TerminalSummary;
    output: string[];
    history?: TerminalHistoryCursor | null;
} | {
    type: 'output';
    terminalId: TerminalId;
    data: string;
} | {
    type: 'terminal_updated';
    terminal: TerminalSummary;
} | {
    type: 'exit';
    terminalId: TerminalId;
    exitCode: number | null;
} | {
    type: 'error';
    message: string;
} | {
    type: 'pong';
    nonce: string;
};
export declare function parseClientTerminalMessage(raw: string): ClientTerminalMessage | null;
