export type CreateApiFiberV1GithubLookupPollArgs = {body: {githubAgentRunId: string}}; export type CreateApiFiberV1GithubLookupPollOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Polls the status of a GitHub lookup agent run. * * POST /fiber/v1/github-lookup/poll */ export const createApiFiberV1GithubLookupPoll = async (args: CreateApiFiberV1GithubLookupPollArgs, options?: CreateApiFiberV1GithubLookupPollOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/fiber/v1/github-lookup/poll${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 };