import type { Api } from "@cargo-ai/api"; /** What a research call came back with. */ export type Research = { kind: "prose"; text: string; } | { kind: "sources"; items: readonly ResearchSource[]; }; export type ResearchSource = { title: string; url: string; snippet: string | undefined; }; type ResearchAction = { integrationSlug: string; actionSlug: string; kind: Research["kind"]; creatableWithoutKey: boolean; /** The request body. Instruct providers take `prompt`; search does not. */ data: (domain: string, prompt: string) => unknown; }; export type ResearchMatch = ResearchAction & { /** Credits one run costs, when the catalog says. */ cost: number | undefined; /** False when the workspace has no connector for it yet. */ connected: boolean; }; /** * Research `domain` with whatever the workspace can run. Undefined whenever * that is nothing, the user declines the connector, the run fails, or it * returns something this cannot read — every one of which is a reason to write * the answers plainly rather than to fail an `init`. */ export declare function researchCompany(api: Api, domain: string): Promise; /** * The best research action this workspace can actually run: a connected one if * there is one, otherwise the first that Cargo can run on its own key. * * Exported for tests; `researchCompany` is the only production caller. */ export declare function pickResearchAction(matches: readonly { action?: unknown; connectors?: readonly unknown[]; credits?: readonly unknown[]; }[]): ResearchMatch | undefined; /** * The pages the search action returned. Reads `results` off the last node's * output — the same object Exa puts in `runContext.action`. * * Exported for tests; `researchCompany` is the only production caller. */ export declare function extractSources(result: unknown): ResearchSource[]; /** * The brief the instruct action wrote. Reads `answer` off the last node's * output — Anthropic and OpenAI both put the model text there. Everything else * on the execute payload (`contextS3Filename`, `recordTitle`, the prompt in * `runComputedConfigs`) is run metadata, not the answer. * * Exported for tests; `researchCompany` is the only production caller. */ export declare function extractText(result: unknown): string | undefined; export {}; //# sourceMappingURL=companyResearch.d.ts.map