interface DevOptions {
    port?: string;
    quiet?: boolean;
    verbose?: boolean;
    logLevel?: string;
    /**
     * Acknowledge that `lobu run` is about to point at a shared/non-local
     * Postgres inherited from the shell. Required when the project's own .env
     * doesn't pin DATABASE_URL — protects against the silent footgun of running
     * "local dev" against a teammate's tailnet DB or, worse, prod.
     */
    unsafeSharedDb?: boolean;
}
/**
 * Treat any DATABASE_URL whose host isn't loopback as "shared". The check
 * is intentionally crude — anything resolvable from the network counts,
 * including tailnet (`*.ts.net`), private IPs, and prod hostnames.
 *
 * Exported for unit tests; the safety gate in `devCommand` is the consumer.
 */
export declare function isSharedDatabaseUrl(databaseUrl: string): boolean;
/**
 * `DATABASE_URL` is the single backend selector:
 *   - a `postgres://` / `postgresql://` URL → connect to an external Postgres
 *   - anything else (a filesystem path, optionally `file:`-prefixed) → boot a
 *     local embedded Postgres with its data under `<path>/.lobu/pgdata`
 *
 * `lobu run` defaults the path to the user's home dir when nothing is set, so a
 * bare `lobu run` still works (data at `~/.lobu/pgdata`). The runtime itself
 * always receives an explicit path — the default is injected here, at the CLI
 * frontend, exactly like the menubar app supplies its own path.
 */
export declare function isExternalDatabaseUrl(databaseUrl: string): boolean;
/**
 * Resolve the embedded data ROOT from a path-form DATABASE_URL: strips a
 * leading `file:` and expands a leading `~`. The Postgres cluster lives at
 * `<root>/.lobu/pgdata` (see embedded-runtime.ts).
 */
export declare function resolveEmbeddedDataRoot(databaseUrl: string): string;
/**
 * Decide whether `lobu run` must refuse to boot because the EFFECTIVE
 * DATABASE_URL points at a shared/non-local DB the project never opted into.
 *
 * `mergedEnv` gives the shell higher precedence than the project's `.env`, so
 * the project only "owns" the URL when its `.env` value is the exact one that
 * survived the merge. Gating on project-`.env` *presence* alone (the old bug)
 * let a shared/prod shell URL win silently whenever `.env` also happened to
 * define its own DATABASE_URL — re-pointing "local dev" at shared/prod data.
 *
 * Exported for unit tests; the safety gate in `devCommand` is the consumer.
 */
export declare function shouldRefuseSharedDatabaseUrl(input: {
    effectiveDatabaseUrl: string | undefined;
    projectEnvDatabaseUrl: string | undefined;
    unsafeSharedDb: boolean | undefined;
}): boolean;
/**
 * `lobu run` — start the embedded Lobu stack.
 *
 * `DATABASE_URL` selects the backend (see `isExternalDatabaseUrl`): a
 * `postgres://` URL connects to an external Postgres; a filesystem path boots a
 * local embedded Postgres rooted there. Unset defaults to an embedded DB at
 * `~/.lobu/pgdata`.
 */
export declare function devCommand(cwd: string, options?: DevOptions): Promise<void>;
/**
 * Whether `lobu run` should auto-apply the project. True only when:
 *  - the backend is embedded (never auto-mutate an external/prod DB), AND
 *  - the `local` context was registered + made active (so the apply targets the
 *    embedded server, not whatever cloud context was active before), AND
 *  - the project actually has a `lobu.config.ts` to apply.
 */
export declare function shouldAutoApplyLocalProject(opts: {
    mode: "external" | "embedded";
    localContextReady: boolean;
    hasLobuConfig: boolean;
}): boolean;
/**
 * After `lobu run` boots an embedded backend, push the project's `lobu.config.ts`
 * into the local DB so the agent the user just scaffolded is immediately usable
 * (`lobu chat -c local …`) without a separate `lobu apply`. Uses the `local`
 * context that `announceLocalSignIn` just registered.
 *
 * Best-effort: a project with nothing to apply, or a transient failure, must
 * never crash the running server. The apply graph (esbuild + connector-worker
 * + SDK, pulled in by apply-cmd) is imported lazily so it stays out of
 * `lobu run`'s module-load path — see the dynamic-import allow-list in
 * AGENTS.md.
 */
export declare function autoApplyLocalProject(cwd: string, gatewayUrl: string, localOrgSlug?: string, applyImpl?: (opts: {
    cwd: string;
    yes: boolean;
    url: string;
    org?: string;
}) => Promise<unknown>): Promise<void>;
/**
 * Walk up from `startDir` looking for the Lobu monorepo workspace root: a
 * `package.json` with a non-empty `workspaces` field AND a
 * `packages/agent-worker/src/index.ts` underneath it. Returns the absolute
 * path, or `null`. (Mirrors `@lobu/server`'s `findEnclosingMonorepoRoot` — kept
 * local so the CLI doesn't take a dep on the server package.)
 */
export declare function findEnclosingMonorepoRoot(startDir: string): string | null;
export declare function resolveBackendBundle(startDir?: string): string | null;
export declare function isPortFree(port: number): Promise<boolean>;
export {};
//# sourceMappingURL=dev.d.ts.map