/** * Resolve the current Databricks workspace's URL, numeric id, and client from * the active execution context (AppKit, when initialized), a default * {@link WorkspaceClient}, or the environment. Server-only. * * @module */ import { type WorkspaceClient as AppKitWorkspaceClient } from "@databricks/appkit"; import { net } from "@dbx-tools/shared-core"; /** Legacy SDK client exposed by AppKit for APIs not yet on its facade. */ export type WorkspaceClient = ReturnType; /** Resolve AppKit's facade or an existing legacy client to the legacy SDK surface. */ export declare function toLegacyWorkspaceClient(client: AppKitWorkspaceClient | WorkspaceClient): WorkspaceClient; /** * The AppKit execution-context workspace client when available, otherwise * `undefined`. Never constructs a fallback client and never throws for a * missing AppKit scope. */ export declare function tryGetWorkspaceClient(): WorkspaceClient | undefined; /** * Resolve a {@link WorkspaceClient}: {@link tryGetWorkspaceClient} first, else * a memoized default client from env / profile auth. */ export declare function getWorkspaceClient(): Promise; /** * Current Databricks username for workspace home paths * (`/Workspace/Users/`). * * Prefers `userName` on the AppKit execution context when set, otherwise * calls `currentUser.me()` on {@link client} (or {@link getWorkspaceClient}). */ export declare function getCurrentUserName(client?: WorkspaceClient): Promise; /** * Resolve the current workspace host as a `net.UrlBuilder`: the workspace * `Config` host first, then the `DATABRICKS_HOST` env var, else `undefined`. */ export declare function getWorkspaceUrl(): Promise; /** * Resolve the numeric workspace id: the workspace `Config`'s `workspaceId` * first, else the 10-20 digit run of `workspaceHost` (defaulting to * {@link getWorkspaceUrl}'s host). `undefined` when neither yields an id. */ export declare function getWorkspaceId(workspaceHost?: string): Promise;