import { z } from 'zod/v4';
import { normalizeCoderUrl } from "./util.js";
export const DiscoverCoderUrlDataSchema = z
    .object({
    url: z.string().describe('Discovered base URL for the organization Coder URL'),
})
    .describe('Response payload for coder URL discovery');
/**
 * Discovers the org-specific Coder URL.
 *
 * Calls `GET /coder` on the Catalyst API. The org is resolved server-side
 * from the API key's auth context (not via query parameters).
 */
export async function discoverUrl(client) {
    const resp = await client.get('/coder', DiscoverCoderUrlDataSchema);
    return normalizeCoderUrl(resp.url);
}
//# sourceMappingURL=discover.js.map