/**
 * Generated by tsnapi — public API snapshot of `@devframes/plugin-code-server/node`
 */
// #region Interfaces
export interface CodeServerProfile {
  kind: CodeServerProfileKind;
  backend: CodeServerBackend;
  defaultBin: string;
  buildArgs: (_: ProfileContext) => string[];
  buildEnv: (_: ProfileContext, _: Record<string, string>) => Record<string, string>;
  healthPath: string | null;
  matchPort?: (_: string) => number | undefined;
  matchReadyUrl?: (_: string) => string | undefined;
  matchLogin?: (_: string) => CodeServerLogin | undefined;
  connect: (_: ProfileContext & {
    readyUrl?: string;
  }) => CodeServerConnect;
  connectReused: (_: {
    port: number;
  }) => CodeServerConnect;
}
// #endregion

// #region Types
export type CodeServerProfileKind = 'code-server' | 'serve-web' | 'tunnel';
// #endregion

// #region Classes
export declare class CodeServerSupervisor {
  private readonly ctx;
  private readonly mode;
  private readonly explicitBackend?;
  private readonly explicitBin?;
  private readonly workspace;
  private readonly host;
  private readonly forcedPort?;
  private readonly extraArgs;
  private readonly extraEnv;
  private readonly cookieSuffix?;
  private readonly cookieName;
  private readonly startTimeout;
  private readonly reuseExistingServer;
  private readonly tunnelName;
  private backend;
  private bin;
  private profile;
  private state?;
  private detection;
  private server;
  private proc?;
  private launchCtx?;
  private adopted;
  private readyUrl?;
  private logBuffer;
  private exitHandler?;
  private readonly sessionId;
  private session?;
  constructor(_: DevframeNodeContext, _?: CodeServerOptions);
  init(): Promise<void>;
  detect(): Promise<CodeServerDetection>;
  status(): CodeServerStatusResult;
  start(_?: CodeServerStartRequest): Promise<CodeServerStartResult>;
  stop(): CodeServerStatusResult;
  dispose(): void;
  get resolvedBackend(): CodeServerBackend;
  private setResolved;
  private baseCtx;
  private reset;
  private awaitTunnel;
  private connectInfo;
  private terminate;
  private resolveHubTerminals;
  private reflectHub;
  private launchProcess;
  private appendLog;
  private lastLog;
  private publish;
  private waitForReady;
  private registerCleanup;
}
// #endregion

// #region Functions
export declare function detectCodeServer(_?: string, _?: number): Promise<DetectCodeServerResult>;
export declare function getCodeServerSupervisor(_: DevframeNodeContext): CodeServerSupervisor;
export declare function resolveProfile(_: CodeServerMode, _: CodeServerBackend): CodeServerProfile;
export declare function setCodeServerSupervisor(_: DevframeNodeContext, _: CodeServerSupervisor): void;
export declare function setupCodeServer(_: DevframeNodeContext, _?: CodeServerOptions): Promise<CodeServerSupervisor>;
// #endregion

// #region Variables
export declare const diagnostics: import("nostics").Diagnostics<{
  readonly DP_CODE_SERVER_0001: {
    readonly why: (p: {
      bin: string;
    }) => string;
    readonly fix: "Install Coder code-server (`curl -fsSL https://code-server.dev/install.sh | sh`) or the Microsoft `code` CLI, or set the `bin` option to its path. See https://coder.com/docs/code-server/latest/install";
  };
  readonly DP_CODE_SERVER_0002: {
    readonly why: (p: {
      port: number;
      timeout: number;
    }) => string;
    readonly fix: "Check the editor logs for startup errors, raise `startTimeout`, or free the port.";
  };
  readonly DP_CODE_SERVER_0003: {
    readonly why: (p: {
      bin: string;
      reason: string;
    }) => string;
  };
  readonly DP_CODE_SERVER_0004: {
    readonly why: "code-server supervisor is not initialised on this context";
    readonly fix: "Call setupCodeServer(ctx) (or use createCodeServerDevframe) before invoking the code-server RPCs.";
  };
  readonly DP_CODE_SERVER_0005: {
    readonly why: (p: {
      code: number;
    }) => string;
    readonly fix: "Inspect the captured output in the launcher and re-launch.";
  };
  readonly DP_CODE_SERVER_0006: {
    readonly why: (p: {
      timeout: number;
    }) => string;
    readonly fix: "Check the tunnel logs, ensure the `code` CLI is signed in, or raise `startTimeout`.";
  };
}, readonly [typeof reporter]>;
// #endregion