import { t as DevServerManifest } from "./registry-CIoKFIDw.js";
import { ViteDevServer } from "vite";
import { CliConfig, Output } from "@sanity/cli-core";
/**
 * Minimal shape the supervisor needs back from a started app/studio dev server.
 * The not-started arm is reserved for expected early exits the server already
 * reported (e.g. a missing organization id) — a failure to *boot* still throws.
 */
type AppServerResult = {
  close: () => Promise<void>;
  server: ViteDevServer;
  started: true;
} | {
  reason: string;
  started: false;
};
interface StartWorkbenchDevOptions {
  /** Directory for the workbench Vite server's dependency cache. */
  cacheDir: string;
  /** CLI-domain `app.id`/`deployment.appId` deprecation check, run before registering. */
  checkForDeprecatedAppId: () => void;
  cliConfig: CliConfig;
  /** Extract the project manifest to inline into the registry (studio-vs-app handled by the CLI). */
  extractManifest: (params: {
    applicationId?: string;
    configPath: string;
    workDir: string;
  }) => Promise<DevServerManifest['manifest']>;
  httpHost: string | undefined;
  httpPort: number;
  isApp: boolean;
  output: Output;
  reactStrictMode: boolean;
  /** Start the app/studio dev server — the CLI owns the server, this orchestrates it. */
  startAppServer: (params: {
    announceUrl: boolean;
    cliConfig: CliConfig;
    httpPort: number;
  }) => Promise<AppServerResult>;
  workDir: string;
}
/**
 * Orchestrate the dev servers a workbench project needs: a singleton workbench
 * Vite server plus the app/studio dev server it renders, wired to the dev-server
 * registry so view/service edits re-sync live.
 *
 * A running workbench claims the configured port, so the app server binds the
 * next one. If the workbench can't start (package or port unavailable), the app
 * server falls back to the configured port and announces its own URL, exactly as
 * a plain `sanity dev` would.
 */
declare function startWorkbenchDev(options: StartWorkbenchDevOptions): Promise<{
  close: () => Promise<void>;
}>;
export { type StartWorkbenchDevOptions, startWorkbenchDev };
//# sourceMappingURL=dev.d.ts.map