export type GetApiTinyfishAgentV1RunsIdArgs = {id: string, screenshots?: string | undefined, html?: string | undefined}; export type GetApiTinyfishAgentV1RunsIdOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get detailed information about a specific automation run including status, result, steps, and video URL. Use to poll for async run completion. * * GET /tinyfish-agent/v1/runs/{id} */ export const getApiTinyfishAgentV1RunsId = async (args: GetApiTinyfishAgentV1RunsIdArgs, options?: GetApiTinyfishAgentV1RunsIdOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.screenshots != null) query.append("screenshots", String(args.screenshots)) if (args.html != null) query.append("html", String(args.html)) const url = `${baseUrl.replace(/\/+$/, '')}/tinyfish-agent/v1/runs/${encodeURIComponent(String(args.id))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };