export type CreateApiResearchApiAgentsRecoveryArgs = {body: {agent_id: string}}; export type CreateApiResearchApiAgentsRecoveryOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Request a replacement key for operator-approved recovery; keep your existing agent ID * * POST /research-api/agents/recovery */ export const createApiResearchApiAgentsRecovery = async (args: CreateApiResearchApiAgentsRecoveryArgs, options?: CreateApiResearchApiAgentsRecoveryOptions) => { const {baseUrl = "https://pickedbyagents.com", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/research-api/agents/recovery${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };