import { useState } from 'react';
import { ClientSharedApiLinkService } from '../api/links.js';
import { trpcReact } from '../api/trpc-react.js';
/**
 * React hook for creating the stable tRPC client instance used by providers.
 *
 * Keep React lifecycle/state ownership in hook form; non-React API construction
 * stays in service classes under this shared client boundary.
 */
export function useControlPlaneTrpcClient(options = {}) {
    const [client] = useState(() => trpcReact.createClient({
        links: ClientSharedApiLinkService.create({
            url: options.url ?? '/trpc',
        }),
    }));
    return client;
}
//# sourceMappingURL=useControlPlaneTrpcClient.js.map