export type VsCodeTunnelStatus = "stopped" | "starting" | "authorization_pending" | "connected" | "disconnected" | "error"; export interface VsCodeTunnelStartResult { status: VsCodeTunnelStatus; tunnelName: string; } export interface VsCodeTunnelEvent { status: VsCodeTunnelStatus; deviceCode?: string; verificationUri?: string; tunnelName?: string; tunnelUrl?: string; error?: string; details?: string; } export interface VsCodeTunnelManager { start(): Promise; stop(): Promise; unregister(): Promise; getStatus(): VsCodeTunnelStatus; shutdown(): Promise; } export interface VsCodeTunnelManagerOptions { binPath: string; tunnelName: string; forceKillTimeoutMs?: number; deviceCodeTimeoutMs?: number; authTimeoutMs?: number; } export declare const DEFAULT_VSCODE_CLI_BIN = "/usr/local/bin/code"; export declare const DEFAULT_DEVICE_CODE_TIMEOUT_MS = 30000; export declare const DEFAULT_DEVICE_CODE_AUTH_TIMEOUT_MS = 300000; export declare const DEFAULT_FORCE_KILL_TIMEOUT_MS = 5000; /** * Derive a VS Code tunnel name from a cluster UUID. * * Microsoft's tunnel service requires names to satisfy * `/^[a-z][a-z0-9-]{0,19}$/` (≤20 chars, lowercase, letter-initial, * `[a-z0-9-]`). UUIDs are 36 chars and hyphens are stripped before slicing. * * Per-cluster derivation is required for multi-cluster support (#744 FR-001). * Using the stable project id (the #618 fix) collided whenever a single * project had more than one cluster; cloud-side per-cluster persistence * (generacy-cloud#792, merge:true #563) makes the cluster UUID the right key. */ export declare function deriveTunnelName(clusterId: string): string; export declare function loadOptionsFromEnv(env?: NodeJS.ProcessEnv): VsCodeTunnelManagerOptions; export declare class VsCodeTunnelProcessManager implements VsCodeTunnelManager { private readonly opts; private child; private status; private exitWaiters; private deviceCodeTimer; private authTimer; private stdoutBuffer; private deviceCode; private verificationUri; private tunnelUrl; private actualTunnelName; private stopping; private timedOut; constructor(opts: VsCodeTunnelManagerOptions); /** Extract the registered tunnel name from a `https://vscode.dev/tunnel//…` URL. */ private tunnelNameFromUrl; getStatus(): VsCodeTunnelStatus; start(): Promise; stop(): Promise; shutdown(): Promise; /** * Release the cluster's tunnel name from Microsoft's tunnel service so the * name can be reused after `generacy destroy`. Best-effort: spawns * `code tunnel unregister --name ` with a 10s timeout. On * timeout or non-zero exit, emits a warning event and resolves; never throws. */ unregister(): Promise; private handleStdoutLine; private clearDeviceCodeTimer; private armAuthTimer; private clearAuthTimer; } export declare function getVsCodeTunnelManager(): VsCodeTunnelManager; export declare function setVsCodeTunnelManager(next: VsCodeTunnelManager | null): void; //# sourceMappingURL=vscode-tunnel-manager.d.ts.map