{"version":3,"file":"get-research.mjs","names":[],"sources":["../../src/actions/get-research.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { action } from \"../action\";\n\nexport const ExaGetResearchInput: z.ZodTypeAny = z.object({\n  events: z.boolean().describe(\"Set to 'true' to include the detailed event log of all operations performed. Defaults to false.\").optional(),\n  stream: z.boolean().describe(\"Set to 'true' to receive real-time updates via Server-Sent Events (SSE). Defaults to false.\").optional(),\n  researchId: z.string().describe(\"The unique identifier of the research task to retrieve. This ID is returned when creating a research task via POST /research/v1.\"),\n}).describe(\"Parameters to retrieve a specific research task by ID.\");\nconst ExaGetResearch_ResearchEventSchema: z.ZodTypeAny = z.object({\n  data: z.record(z.string(), z.unknown()).describe(\"Additional data associated with the event.\").optional(),\n  type: z.string().describe(\"Type of the event.\").optional(),\n  message: z.string().describe(\"Event message or description.\").optional(),\n  timestamp: z.number().describe(\"Unix timestamp of when the event occurred.\").optional(),\n}).describe(\"Represents a single event in the research task execution log.\");\nconst ExaGetResearch_ResearchOutputSchema: z.ZodTypeAny = z.object({\n  text: z.string().describe(\"The research output text or summary.\").optional(),\n  markdown: z.string().describe(\"The research output in markdown format.\").optional(),\n  metadata: z.record(z.string(), z.unknown()).describe(\"Additional metadata about the research output.\").optional(),\n  citations: z.array(z.record(z.string(), z.unknown())).describe(\"Citations and sources used in the research.\").optional(),\n}).describe(\"The output/result of a completed research task.\");\nconst ExaGetResearch_CostDollarsSchema: z.ZodTypeAny = z.object({\n  llm: z.number().describe(\"Cost of LLM/AI model operations.\").optional(),\n  total: z.number().describe(\"Total dollar cost for the research task.\").optional(),\n  search: z.number().describe(\"Cost of search operations.\").optional(),\n}).describe(\"Cost breakdown for the research task.\");\nexport const ExaGetResearchOutput: z.ZodTypeAny = z.object({\n  error: z.string().describe(\"Error message describing what went wrong. Only present when status is 'failed'.\").optional(),\n  model: z.string().describe(\"The AI model used for the research task, if specified.\").optional(),\n  events: z.array(ExaGetResearch_ResearchEventSchema).describe(\"Detailed event log of all operations performed during the research task. Only included if the 'events' query parameter was set to true.\").optional(),\n  output: ExaGetResearch_ResearchOutputSchema.nullable().optional(),\n  status: z.string().describe(\"Current status of the research task. Values: 'pending', 'running', 'completed', 'failed'.\"),\n  createdAt: z.number().describe(\"Unix timestamp of when the research task was created.\"),\n  researchId: z.string().describe(\"The unique identifier of the research task.\"),\n  costDollars: ExaGetResearch_CostDollarsSchema.nullable().optional(),\n  instructions: z.string().describe(\"The original instructions or query provided for the research task.\"),\n}).describe(\"Response schema for the Exa GET /research/v1/{researchId} endpoint.\\n\\nThe response varies based on the task status:\\n- Pending/Running: includes researchId, createdAt, instructions, status, model (optional), events (optional)\\n- Completed: includes all fields plus output and costDollars\\n- Failed: includes all fields plus error message\");\n\nexport const exaGetResearch = action(\"EXA_GET_RESEARCH\", {\n  slug: \"exa-get-research\",\n  name: \"Get Research Task\",\n  description: \"Tool to retrieve the status and results of a previously created research task. Use the unique researchId returned from POST /research/v1 to poll until the task is finished.\",\n  input: ExaGetResearchInput,\n  output: ExaGetResearchOutput,\n});\n"],"mappings":";;;AAIA,MAAa,sBAAoC,EAAE,OAAO;CACxD,QAAQ,EAAE,QAAQ,EAAE,SAAS,iGAAiG,EAAE,SAAS;CACzI,QAAQ,EAAE,QAAQ,EAAE,SAAS,6FAA6F,EAAE,SAAS;CACrI,YAAY,EAAE,OAAO,EAAE,SAAS,kIAAkI;AACpK,CAAC,EAAE,SAAS,wDAAwD;AACpE,MAAM,qCAAmD,EAAE,OAAO;CAChE,MAAM,EAAE,OAAO,EAAE,OAAO,GAAG,EAAE,QAAQ,CAAC,EAAE,SAAS,4CAA4C,EAAE,SAAS;CACxG,MAAM,EAAE,OAAO,EAAE,SAAS,oBAAoB,EAAE,SAAS;CACzD,SAAS,EAAE,OAAO,EAAE,SAAS,+BAA+B,EAAE,SAAS;CACvE,WAAW,EAAE,OAAO,EAAE,SAAS,4CAA4C,EAAE,SAAS;AACxF,CAAC,EAAE,SAAS,+DAA+D;AAC3E,MAAM,sCAAo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