@keystrokehq/exa 0.0.16-integration-id-canonicalization.1 → 0.0.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (45) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +90 -2
  3. package/dist/actions/index.cjs +17 -0
  4. package/dist/actions/index.d.cts +2 -0
  5. package/dist/actions/index.d.mts +2 -0
  6. package/dist/actions/index.mjs +2 -0
  7. package/dist/actions-Bl-9uz6K.cjs +491 -0
  8. package/dist/actions-Bl-9uz6K.cjs.map +1 -0
  9. package/dist/actions-DnHafheX.mjs +373 -0
  10. package/dist/actions-DnHafheX.mjs.map +1 -0
  11. package/dist/credential-BWous9Uu.cjs +16 -0
  12. package/dist/credential-BWous9Uu.cjs.map +1 -0
  13. package/dist/credential-NfXyV_Vy.mjs +11 -0
  14. package/dist/credential-NfXyV_Vy.mjs.map +1 -0
  15. package/dist/index-BwCGHs6v.d.cts +357 -0
  16. package/dist/index-BwCGHs6v.d.cts.map +1 -0
  17. package/dist/index-BwCGHs6v.d.mts +357 -0
  18. package/dist/index-BwCGHs6v.d.mts.map +1 -0
  19. package/dist/index.cjs +14 -0
  20. package/dist/index.d.cts +20 -0
  21. package/dist/index.d.cts.map +1 -0
  22. package/dist/index.d.mts +20 -4
  23. package/dist/index.d.mts.map +1 -0
  24. package/dist/index.mjs +4 -5
  25. package/dist/mcp.cjs +57 -0
  26. package/dist/mcp.cjs.map +1 -0
  27. package/dist/mcp.d.cts +16 -0
  28. package/dist/mcp.d.cts.map +1 -0
  29. package/dist/mcp.d.mts +16 -0
  30. package/dist/mcp.d.mts.map +1 -0
  31. package/dist/mcp.mjs +54 -0
  32. package/dist/mcp.mjs.map +1 -0
  33. package/package.json +49 -54
  34. package/dist/contents.schema-BNgTB2DN.mjs +0 -133
  35. package/dist/credential-sets/index.d.mts +0 -2
  36. package/dist/credential-sets/index.mjs +0 -3
  37. package/dist/exa.credential-set-BGLENRlR.d.mts +0 -14
  38. package/dist/exa.credential-set-Ba-RsxL2.mjs +0 -15
  39. package/dist/operations/index.d.mts +0 -2
  40. package/dist/operations/index.mjs +0 -3
  41. package/dist/schemas/index.d.mts +0 -2
  42. package/dist/schemas/index.mjs +0 -3
  43. package/dist/search.schema-Cw-d91N6.d.mts +0 -204
  44. package/dist/update-monitor.operation-D-vWJFP3.mjs +0 -478
  45. package/dist/update-monitor.operation-Dm50YoS7.d.mts +0 -570
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions-Bl-9uz6K.cjs","names":["z","z","exaCredential","z","exaCredential","z","exaCredential","z","exaCredential","z","exaCredential"],"sources":["../src/client.ts","../src/schemas.ts","../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"sourcesContent":["import ky, { type KyInstance } from \"ky\";\n\nconst EXA_API_BASE = \"https://api.exa.ai\";\n\nexport type ExaClient = {\n search: (body: Record<string, unknown>) => Promise<unknown>;\n contents: (body: Record<string, unknown>) => Promise<unknown>;\n answer: (body: Record<string, unknown>) => Promise<unknown>;\n context: (body: Record<string, unknown>) => Promise<unknown>;\n};\n\nexport function createExaClient(apiKey: string): ExaClient {\n const api: KyInstance = ky.create({\n prefix: EXA_API_BASE,\n headers: {\n \"x-api-key\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n });\n\n return {\n search: (body) => api.post(\"search\", { json: body }).json(),\n contents: (body) => api.post(\"contents\", { json: body }).json(),\n answer: (body) => api.post(\"answer\", { json: body }).json(),\n context: (body) => api.post(\"context\", { json: body }).json(),\n };\n}\n","import { z } from \"zod\";\n\nexport const exaSearchTypeSchema = z.enum([\n \"instant\",\n \"fast\",\n \"auto\",\n \"deep-lite\",\n \"deep\",\n \"deep-reasoning\",\n]);\n\nexport const exaCategorySchema = z.enum([\n \"company\",\n \"people\",\n \"research paper\",\n \"news\",\n \"personal site\",\n \"financial report\",\n]);\n\nexport const exaSearchResultSchema = z.object({\n title: z.string().nullable().optional(),\n url: z.string(),\n id: z.string().optional(),\n publishedDate: z.string().nullable().optional(),\n author: z.string().nullable().optional(),\n text: z.string().nullable().optional(),\n highlights: z.array(z.string()).optional(),\n summary: z.string().nullable().optional(),\n entities: z.unknown().optional(),\n});\n\nexport const exaGroundingCitationSchema = z.object({\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const exaGroundingSchema = z.object({\n field: z.string(),\n citations: z.array(exaGroundingCitationSchema),\n confidence: z.enum([\"low\", \"medium\", \"high\"]).optional(),\n});\n\nexport const exaContentStatusSchema = z.object({\n id: z.string(),\n status: z.enum([\"success\", \"error\"]),\n source: z.enum([\"cached\", \"crawled\"]).optional(),\n error: z\n .object({\n tag: z.string().optional(),\n httpStatusCode: z.number().optional(),\n })\n .optional(),\n});\n\nexport const exaCitationSchema = z.object({\n title: z.string().nullable().optional(),\n url: z.string(),\n id: z.string().optional(),\n publishedDate: z.string().nullable().optional(),\n author: z.string().nullable().optional(),\n text: z.string().nullable().optional(),\n});\n\nconst restrictedCategory = new Set([\"company\", \"people\"]);\n\nexport function assertCategoryFilters(\n category: z.infer<typeof exaCategorySchema> | undefined,\n filters: {\n excludeDomains?: string[] | undefined;\n startPublishedDate?: string | undefined;\n endPublishedDate?: string | undefined;\n },\n): void {\n if (!category || !restrictedCategory.has(category)) {\n return;\n }\n if (filters.excludeDomains?.length) {\n throw new Error(\"excludeDomains is not supported for company or people category searches\");\n }\n if (filters.startPublishedDate || filters.endPublishedDate) {\n throw new Error(\n \"published date filters are not supported for company or people category searches\",\n );\n }\n}\n\nexport function buildSearchContents(input: {\n highlights?: boolean;\n text?: boolean;\n summary?: boolean;\n}): Record<string, unknown> | undefined {\n const contents: Record<string, unknown> = {};\n if (input.highlights !== false) {\n contents.highlights = input.highlights === true ? true : { maxCharacters: 4000 };\n }\n if (input.text) {\n contents.text = true;\n }\n if (input.summary) {\n contents.summary = true;\n }\n return Object.keys(contents).length > 0 ? contents : undefined;\n}\n\nexport function buildContentsOptions(input: {\n highlights?: boolean;\n text?: boolean;\n summary?: boolean;\n}): Record<string, unknown> {\n const body: Record<string, unknown> = {};\n if (input.highlights) {\n body.highlights = typeof input.highlights === \"boolean\" ? true : input.highlights;\n }\n if (input.text) {\n body.text = true;\n }\n if (input.summary) {\n body.summary = true;\n }\n if (!Object.keys(body).length) {\n body.highlights = { maxCharacters: 4000 };\n }\n return body;\n}\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport { exaCitationSchema } from \"../schemas\";\n\nexport const ExaAnswerInput = z.object({\n query: z.string().describe(\"Natural-language question.\"),\n includeCitationText: z\n .boolean()\n .default(false)\n .describe(\"Include full text bodies on citations.\"),\n outputSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"JSON Schema for structured answer output.\"),\n});\n\nexport const ExaAnswerOutput = z.object({\n requestId: z.string().optional(),\n answer: z.unknown(),\n citations: z.array(exaCitationSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaAnswer = defineAction({\n key: \"exa-answer\",\n name: \"Exa Answer\",\n description: \"Search-backed grounded Q&A with citations.\",\n input: ExaAnswerInput,\n output: ExaAnswerOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n text: input.includeCitationText,\n };\n if (input.outputSchema) body.outputSchema = input.outputSchema;\n\n const response = (await client.answer(body)) as {\n requestId?: string;\n answer?: unknown;\n citations?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n answer: response.answer ?? null,\n citations: (response.citations ?? []).map((row) => exaCitationSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport { buildContentsOptions, exaContentStatusSchema, exaSearchResultSchema } from \"../schemas\";\n\nexport const ExaGetContentsInput = z.object({\n urls: z.array(z.string().url()).min(1).max(100).describe(\"URLs to extract content from.\"),\n highlights: z.boolean().optional().describe(\"Return token-efficient excerpts.\"),\n text: z.boolean().optional().describe(\"Return full page markdown.\"),\n summary: z.boolean().optional().describe(\"Return LLM summary per URL.\"),\n});\n\nexport const ExaGetContentsOutput = z.object({\n requestId: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n statuses: z.array(exaContentStatusSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaGetContents = defineAction({\n key: \"exa-get-contents\",\n name: \"Exa Get Contents\",\n description:\n \"Extract webpage content from known URLs. Check statuses for per-URL errors (API returns 200 with error statuses).\",\n input: ExaGetContentsInput,\n output: ExaGetContentsOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n urls: input.urls,\n ...buildContentsOptions({\n highlights: input.highlights,\n text: input.text,\n summary: input.summary,\n }),\n };\n\n const response = (await client.contents(body)) as {\n requestId?: string;\n results?: unknown[];\n statuses?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n statuses: (response.statuses ?? []).map((row) => exaContentStatusSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\n\nexport const ExaGetContextInput = z.object({\n query: z\n .string()\n .min(1)\n .max(2000)\n .describe(\"Code, API, or how-to question for Exa Code context.\"),\n tokensNum: z\n .union([z.number().int().min(50).max(100_000), z.literal(\"dynamic\")])\n .default(\"dynamic\")\n .describe(\"Max output tokens or dynamic sizing.\"),\n});\n\nexport const ExaGetContextOutput = z.object({\n requestId: z.string().optional(),\n query: z.string().optional(),\n response: z.string(),\n resultsCount: z.number().optional(),\n searchTime: z.number().optional(),\n outputTokens: z.number().optional(),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaGetContext = defineAction({\n key: \"exa-get-context\",\n name: \"Exa Get Context\",\n description: \"Exa Code — token-efficient documentation and code snippets for coding agents.\",\n input: ExaGetContextInput,\n output: ExaGetContextOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const response = (await client.context({\n query: input.query,\n tokensNum: input.tokensNum,\n })) as {\n requestId?: string;\n query?: string;\n response?: string;\n resultsCount?: number;\n searchTime?: number;\n outputTokens?: number;\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n query: response.query,\n response: response.response ?? \"\",\n resultsCount: response.resultsCount,\n searchTime: response.searchTime,\n outputTokens: response.outputTokens,\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport {\n assertCategoryFilters,\n buildSearchContents,\n exaCategorySchema,\n exaSearchResultSchema,\n exaSearchTypeSchema,\n} from \"../schemas\";\n\nexport const ExaSearchInput = z\n .object({\n query: z.string().describe(\"Natural-language search query.\"),\n type: exaSearchTypeSchema.default(\"auto\").describe(\"Search latency/depth profile.\"),\n category: exaCategorySchema\n .optional()\n .describe(\n \"Vertical index: company, people, research paper, news, personal site, financial report.\",\n ),\n numResults: z.number().int().min(1).max(100).default(10),\n includeDomains: z.array(z.string()).max(1200).optional(),\n excludeDomains: z.array(z.string()).max(1200).optional(),\n startPublishedDate: z.string().optional().describe(\"ISO8601 published-after filter.\"),\n endPublishedDate: z.string().optional().describe(\"ISO8601 published-before filter.\"),\n userLocation: z\n .string()\n .length(2)\n .optional()\n .describe(\"Two-letter ISO country code for localized results.\"),\n additionalQueries: z\n .array(z.string())\n .max(10)\n .optional()\n .describe(\"Extra queries for deep search types only.\"),\n systemPrompt: z.string().optional().describe(\"Guides deep search planning.\"),\n highlights: z\n .boolean()\n .default(true)\n .describe(\"Return token-efficient page excerpts (recommended).\"),\n text: z.boolean().optional().describe(\"Include full page markdown text.\"),\n summary: z.boolean().optional().describe(\"Include LLM summary per result.\"),\n })\n .superRefine((input, ctx) => {\n try {\n assertCategoryFilters(input.category, {\n excludeDomains: input.excludeDomains,\n startPublishedDate: input.startPublishedDate,\n endPublishedDate: input.endPublishedDate,\n });\n } catch (error) {\n ctx.addIssue({\n code: \"custom\",\n message: error instanceof Error ? error.message : \"Invalid category filters\",\n });\n }\n });\n\nexport const ExaSearchOutput = z.object({\n requestId: z.string().optional(),\n searchType: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaSearch = defineAction({\n key: \"exa-search\",\n name: \"Exa Search\",\n description:\n \"Search the web with Exa. Supports categories (company, people, news, research paper, etc.), filters, and content modes.\",\n input: ExaSearchInput,\n output: ExaSearchOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n type: input.type,\n numResults: input.numResults,\n };\n\n if (input.category) body.category = input.category;\n if (input.includeDomains?.length) body.includeDomains = input.includeDomains;\n if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;\n if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;\n if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;\n if (input.userLocation) body.userLocation = input.userLocation;\n if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;\n if (input.systemPrompt) body.systemPrompt = input.systemPrompt;\n\n const contents = buildSearchContents({\n highlights: input.highlights,\n text: input.text,\n summary: input.summary,\n });\n if (contents) body.contents = contents;\n\n const response = (await client.search(body)) as {\n requestId?: string;\n searchType?: string;\n results?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n searchType: response.searchType,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport {\n assertCategoryFilters,\n buildSearchContents,\n exaCategorySchema,\n exaGroundingSchema,\n exaSearchResultSchema,\n exaSearchTypeSchema,\n} from \"../schemas\";\n\nexport const ExaSearchStructuredInput = z\n .object({\n query: z.string().describe(\"Natural-language search query.\"),\n outputSchema: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Schema object for structured synthesis output.\"),\n type: exaSearchTypeSchema\n .default(\"deep\")\n .describe(\"Prefer deep or deep-reasoning for synthesis.\"),\n category: exaCategorySchema.optional(),\n numResults: z.number().int().min(1).max(100).default(10),\n includeDomains: z.array(z.string()).max(1200).optional(),\n excludeDomains: z.array(z.string()).max(1200).optional(),\n startPublishedDate: z.string().optional(),\n endPublishedDate: z.string().optional(),\n systemPrompt: z.string().optional(),\n additionalQueries: z.array(z.string()).max(10).optional(),\n highlights: z.boolean().default(true),\n text: z.boolean().optional(),\n })\n .superRefine((input, ctx) => {\n try {\n assertCategoryFilters(input.category, {\n excludeDomains: input.excludeDomains,\n startPublishedDate: input.startPublishedDate,\n endPublishedDate: input.endPublishedDate,\n });\n } catch (error) {\n ctx.addIssue({\n code: \"custom\",\n message: error instanceof Error ? error.message : \"Invalid category filters\",\n });\n }\n });\n\nexport const ExaSearchStructuredOutput = z.object({\n requestId: z.string().optional(),\n searchType: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n output: z\n .object({\n content: z.unknown(),\n grounding: z.array(exaGroundingSchema).optional(),\n })\n .optional(),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaSearchStructured = defineAction({\n key: \"exa-search-structured\",\n name: \"Exa Structured Search\",\n description:\n \"Exa search with outputSchema for grounded structured JSON synthesis across sources.\",\n input: ExaSearchStructuredInput,\n output: ExaSearchStructuredOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n type: input.type,\n numResults: input.numResults,\n outputSchema: input.outputSchema,\n };\n\n if (input.category) body.category = input.category;\n if (input.includeDomains?.length) body.includeDomains = input.includeDomains;\n if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;\n if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;\n if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;\n if (input.systemPrompt) body.systemPrompt = input.systemPrompt;\n if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;\n\n const contents = buildSearchContents({\n highlights: input.highlights,\n text: input.text,\n });\n if (contents) body.contents = contents;\n\n const response = (await client.search(body)) as {\n requestId?: string;\n searchType?: string;\n results?: unknown[];\n output?: { content?: unknown; grounding?: unknown[] };\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n searchType: response.searchType,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n output: response.output\n ? {\n content: response.output.content,\n grounding: response.output.grounding?.map((g) => exaGroundingSchema.parse(g)),\n }\n : undefined,\n costDollars: response.costDollars,\n };\n },\n});\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,eAAe;AASrB,SAAgB,gBAAgB,QAA2B;CACzD,MAAM,MAAkB,GAAA,QAAG,OAAO;EAChC,QAAQ;EACR,SAAS;GACP,aAAa;GACb,gBAAgB;EAClB;CACF,CAAC;CAED,OAAO;EACL,SAAS,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC1D,WAAW,SAAS,IAAI,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC9D,SAAS,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC1D,UAAU,SAAS,IAAI,K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UAAU,KAAK,WAAW;EAE9B,MAAM,WAAY,MAAM,OAAO,OAAO,IAAI;EAQ1C,OAAO;GACL,WAAW,SAAS;GACpB,YAAY,SAAS;GACrB,UAAU,SAAS,WAAW,CAAC,GAAG,KAAK,QAAQ,sBAAsB,MAAM,GAAG,CAAC;GAC/E,QAAQ,SAAS,SACb;IACE,SAAS,SAAS,OAAO;IACzB,WAAW,SAAS,OAAO,WAAW,KAAK,MAAM,mBAAmB,MAAM,CAAC,CAAC;GAC9E,IACA,KAAA;GACJ,aAAa,SAAS;EACxB;CACF;AACF,CAAC"}
@@ -0,0 +1,373 @@
1
+ import { t as exaCredential } from "./credential-NfXyV_Vy.mjs";
2
+ import { z } from "zod";
3
+ import ky from "ky";
4
+ import { defineAction } from "@keystrokehq/keystroke/action";
5
+ //#region src/client.ts
6
+ const EXA_API_BASE = "https://api.exa.ai";
7
+ function createExaClient(apiKey) {
8
+ const api = ky.create({
9
+ prefix: EXA_API_BASE,
10
+ headers: {
11
+ "x-api-key": apiKey,
12
+ "Content-Type": "application/json"
13
+ }
14
+ });
15
+ return {
16
+ search: (body) => api.post("search", { json: body }).json(),
17
+ contents: (body) => api.post("contents", { json: body }).json(),
18
+ answer: (body) => api.post("answer", { json: body }).json(),
19
+ context: (body) => api.post("context", { json: body }).json()
20
+ };
21
+ }
22
+ //#endregion
23
+ //#region src/schemas.ts
24
+ const exaSearchTypeSchema = z.enum([
25
+ "instant",
26
+ "fast",
27
+ "auto",
28
+ "deep-lite",
29
+ "deep",
30
+ "deep-reasoning"
31
+ ]);
32
+ const exaCategorySchema = z.enum([
33
+ "company",
34
+ "people",
35
+ "research paper",
36
+ "news",
37
+ "personal site",
38
+ "financial report"
39
+ ]);
40
+ const exaSearchResultSchema = z.object({
41
+ title: z.string().nullable().optional(),
42
+ url: z.string(),
43
+ id: z.string().optional(),
44
+ publishedDate: z.string().nullable().optional(),
45
+ author: z.string().nullable().optional(),
46
+ text: z.string().nullable().optional(),
47
+ highlights: z.array(z.string()).optional(),
48
+ summary: z.string().nullable().optional(),
49
+ entities: z.unknown().optional()
50
+ });
51
+ const exaGroundingCitationSchema = z.object({
52
+ url: z.string(),
53
+ title: z.string().optional()
54
+ });
55
+ const exaGroundingSchema = z.object({
56
+ field: z.string(),
57
+ citations: z.array(exaGroundingCitationSchema),
58
+ confidence: z.enum([
59
+ "low",
60
+ "medium",
61
+ "high"
62
+ ]).optional()
63
+ });
64
+ const exaContentStatusSchema = z.object({
65
+ id: z.string(),
66
+ status: z.enum(["success", "error"]),
67
+ source: z.enum(["cached", "crawled"]).optional(),
68
+ error: z.object({
69
+ tag: z.string().optional(),
70
+ httpStatusCode: z.number().optional()
71
+ }).optional()
72
+ });
73
+ const exaCitationSchema = z.object({
74
+ title: z.string().nullable().optional(),
75
+ url: z.string(),
76
+ id: z.string().optional(),
77
+ publishedDate: z.string().nullable().optional(),
78
+ author: z.string().nullable().optional(),
79
+ text: z.string().nullable().optional()
80
+ });
81
+ const restrictedCategory = new Set(["company", "people"]);
82
+ function assertCategoryFilters(category, filters) {
83
+ if (!category || !restrictedCategory.has(category)) return;
84
+ if (filters.excludeDomains?.length) throw new Error("excludeDomains is not supported for company or people category searches");
85
+ if (filters.startPublishedDate || filters.endPublishedDate) throw new Error("published date filters are not supported for company or people category searches");
86
+ }
87
+ function buildSearchContents(input) {
88
+ const contents = {};
89
+ if (input.highlights !== false) contents.highlights = input.highlights === true ? true : { maxCharacters: 4e3 };
90
+ if (input.text) contents.text = true;
91
+ if (input.summary) contents.summary = true;
92
+ return Object.keys(contents).length > 0 ? contents : void 0;
93
+ }
94
+ function buildContentsOptions(input) {
95
+ const body = {};
96
+ if (input.highlights) body.highlights = typeof input.highlights === "boolean" ? true : input.highlights;
97
+ if (input.text) body.text = true;
98
+ if (input.summary) body.summary = true;
99
+ if (!Object.keys(body).length) body.highlights = { maxCharacters: 4e3 };
100
+ return body;
101
+ }
102
+ //#endregion
103
+ //#region src/actions/answer.ts
104
+ const ExaAnswerInput = z.object({
105
+ query: z.string().describe("Natural-language question."),
106
+ includeCitationText: z.boolean().default(false).describe("Include full text bodies on citations."),
107
+ outputSchema: z.record(z.string(), z.unknown()).optional().describe("JSON Schema for structured answer output.")
108
+ });
109
+ const ExaAnswerOutput = z.object({
110
+ requestId: z.string().optional(),
111
+ answer: z.unknown(),
112
+ citations: z.array(exaCitationSchema),
113
+ costDollars: z.object({ total: z.number().optional() }).optional()
114
+ });
115
+ const exaAnswer = defineAction({
116
+ key: "exa-answer",
117
+ name: "Exa Answer",
118
+ description: "Search-backed grounded Q&A with citations.",
119
+ input: ExaAnswerInput,
120
+ output: ExaAnswerOutput,
121
+ credentials: [exaCredential],
122
+ async run(input, credentials) {
123
+ const client = createExaClient(credentials.exa.apiKey);
124
+ const body = {
125
+ query: input.query,
126
+ text: input.includeCitationText
127
+ };
128
+ if (input.outputSchema) body.outputSchema = input.outputSchema;
129
+ const response = await client.answer(body);
130
+ return {
131
+ requestId: response.requestId,
132
+ answer: response.answer ?? null,
133
+ citations: (response.citations ?? []).map((row) => exaCitationSchema.parse(row)),
134
+ costDollars: response.costDollars
135
+ };
136
+ }
137
+ });
138
+ //#endregion
139
+ //#region src/actions/get-contents.ts
140
+ const ExaGetContentsInput = z.object({
141
+ urls: z.array(z.string().url()).min(1).max(100).describe("URLs to extract content from."),
142
+ highlights: z.boolean().optional().describe("Return token-efficient excerpts."),
143
+ text: z.boolean().optional().describe("Return full page markdown."),
144
+ summary: z.boolean().optional().describe("Return LLM summary per URL.")
145
+ });
146
+ const ExaGetContentsOutput = z.object({
147
+ requestId: z.string().optional(),
148
+ results: z.array(exaSearchResultSchema),
149
+ statuses: z.array(exaContentStatusSchema),
150
+ costDollars: z.object({ total: z.number().optional() }).optional()
151
+ });
152
+ const exaGetContents = defineAction({
153
+ key: "exa-get-contents",
154
+ name: "Exa Get Contents",
155
+ description: "Extract webpage content from known URLs. Check statuses for per-URL errors (API returns 200 with error statuses).",
156
+ input: ExaGetContentsInput,
157
+ output: ExaGetContentsOutput,
158
+ credentials: [exaCredential],
159
+ async run(input, credentials) {
160
+ const client = createExaClient(credentials.exa.apiKey);
161
+ const body = {
162
+ urls: input.urls,
163
+ ...buildContentsOptions({
164
+ highlights: input.highlights,
165
+ text: input.text,
166
+ summary: input.summary
167
+ })
168
+ };
169
+ const response = await client.contents(body);
170
+ return {
171
+ requestId: response.requestId,
172
+ results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),
173
+ statuses: (response.statuses ?? []).map((row) => exaContentStatusSchema.parse(row)),
174
+ costDollars: response.costDollars
175
+ };
176
+ }
177
+ });
178
+ //#endregion
179
+ //#region src/actions/get-context.ts
180
+ const ExaGetContextInput = z.object({
181
+ query: z.string().min(1).max(2e3).describe("Code, API, or how-to question for Exa Code context."),
182
+ tokensNum: z.union([z.number().int().min(50).max(1e5), z.literal("dynamic")]).default("dynamic").describe("Max output tokens or dynamic sizing.")
183
+ });
184
+ const ExaGetContextOutput = z.object({
185
+ requestId: z.string().optional(),
186
+ query: z.string().optional(),
187
+ response: z.string(),
188
+ resultsCount: z.number().optional(),
189
+ searchTime: z.number().optional(),
190
+ outputTokens: z.number().optional(),
191
+ costDollars: z.object({ total: z.number().optional() }).optional()
192
+ });
193
+ const exaGetContext = defineAction({
194
+ key: "exa-get-context",
195
+ name: "Exa Get Context",
196
+ description: "Exa Code — token-efficient documentation and code snippets for coding agents.",
197
+ input: ExaGetContextInput,
198
+ output: ExaGetContextOutput,
199
+ credentials: [exaCredential],
200
+ async run(input, credentials) {
201
+ const response = await createExaClient(credentials.exa.apiKey).context({
202
+ query: input.query,
203
+ tokensNum: input.tokensNum
204
+ });
205
+ return {
206
+ requestId: response.requestId,
207
+ query: response.query,
208
+ response: response.response ?? "",
209
+ resultsCount: response.resultsCount,
210
+ searchTime: response.searchTime,
211
+ outputTokens: response.outputTokens,
212
+ costDollars: response.costDollars
213
+ };
214
+ }
215
+ });
216
+ //#endregion
217
+ //#region src/actions/search.ts
218
+ const ExaSearchInput = z.object({
219
+ query: z.string().describe("Natural-language search query."),
220
+ type: exaSearchTypeSchema.default("auto").describe("Search latency/depth profile."),
221
+ category: exaCategorySchema.optional().describe("Vertical index: company, people, research paper, news, personal site, financial report."),
222
+ numResults: z.number().int().min(1).max(100).default(10),
223
+ includeDomains: z.array(z.string()).max(1200).optional(),
224
+ excludeDomains: z.array(z.string()).max(1200).optional(),
225
+ startPublishedDate: z.string().optional().describe("ISO8601 published-after filter."),
226
+ endPublishedDate: z.string().optional().describe("ISO8601 published-before filter."),
227
+ userLocation: z.string().length(2).optional().describe("Two-letter ISO country code for localized results."),
228
+ additionalQueries: z.array(z.string()).max(10).optional().describe("Extra queries for deep search types only."),
229
+ systemPrompt: z.string().optional().describe("Guides deep search planning."),
230
+ highlights: z.boolean().default(true).describe("Return token-efficient page excerpts (recommended)."),
231
+ text: z.boolean().optional().describe("Include full page markdown text."),
232
+ summary: z.boolean().optional().describe("Include LLM summary per result.")
233
+ }).superRefine((input, ctx) => {
234
+ try {
235
+ assertCategoryFilters(input.category, {
236
+ excludeDomains: input.excludeDomains,
237
+ startPublishedDate: input.startPublishedDate,
238
+ endPublishedDate: input.endPublishedDate
239
+ });
240
+ } catch (error) {
241
+ ctx.addIssue({
242
+ code: "custom",
243
+ message: error instanceof Error ? error.message : "Invalid category filters"
244
+ });
245
+ }
246
+ });
247
+ const ExaSearchOutput = z.object({
248
+ requestId: z.string().optional(),
249
+ searchType: z.string().optional(),
250
+ results: z.array(exaSearchResultSchema),
251
+ costDollars: z.object({ total: z.number().optional() }).optional()
252
+ });
253
+ const exaSearch = defineAction({
254
+ key: "exa-search",
255
+ name: "Exa Search",
256
+ description: "Search the web with Exa. Supports categories (company, people, news, research paper, etc.), filters, and content modes.",
257
+ input: ExaSearchInput,
258
+ output: ExaSearchOutput,
259
+ credentials: [exaCredential],
260
+ async run(input, credentials) {
261
+ const client = createExaClient(credentials.exa.apiKey);
262
+ const body = {
263
+ query: input.query,
264
+ type: input.type,
265
+ numResults: input.numResults
266
+ };
267
+ if (input.category) body.category = input.category;
268
+ if (input.includeDomains?.length) body.includeDomains = input.includeDomains;
269
+ if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;
270
+ if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;
271
+ if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;
272
+ if (input.userLocation) body.userLocation = input.userLocation;
273
+ if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;
274
+ if (input.systemPrompt) body.systemPrompt = input.systemPrompt;
275
+ const contents = buildSearchContents({
276
+ highlights: input.highlights,
277
+ text: input.text,
278
+ summary: input.summary
279
+ });
280
+ if (contents) body.contents = contents;
281
+ const response = await client.search(body);
282
+ return {
283
+ requestId: response.requestId,
284
+ searchType: response.searchType,
285
+ results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),
286
+ costDollars: response.costDollars
287
+ };
288
+ }
289
+ });
290
+ //#endregion
291
+ //#region src/actions/search-structured.ts
292
+ const ExaSearchStructuredInput = z.object({
293
+ query: z.string().describe("Natural-language search query."),
294
+ outputSchema: z.record(z.string(), z.unknown()).describe("JSON Schema object for structured synthesis output."),
295
+ type: exaSearchTypeSchema.default("deep").describe("Prefer deep or deep-reasoning for synthesis."),
296
+ category: exaCategorySchema.optional(),
297
+ numResults: z.number().int().min(1).max(100).default(10),
298
+ includeDomains: z.array(z.string()).max(1200).optional(),
299
+ excludeDomains: z.array(z.string()).max(1200).optional(),
300
+ startPublishedDate: z.string().optional(),
301
+ endPublishedDate: z.string().optional(),
302
+ systemPrompt: z.string().optional(),
303
+ additionalQueries: z.array(z.string()).max(10).optional(),
304
+ highlights: z.boolean().default(true),
305
+ text: z.boolean().optional()
306
+ }).superRefine((input, ctx) => {
307
+ try {
308
+ assertCategoryFilters(input.category, {
309
+ excludeDomains: input.excludeDomains,
310
+ startPublishedDate: input.startPublishedDate,
311
+ endPublishedDate: input.endPublishedDate
312
+ });
313
+ } catch (error) {
314
+ ctx.addIssue({
315
+ code: "custom",
316
+ message: error instanceof Error ? error.message : "Invalid category filters"
317
+ });
318
+ }
319
+ });
320
+ const ExaSearchStructuredOutput = z.object({
321
+ requestId: z.string().optional(),
322
+ searchType: z.string().optional(),
323
+ results: z.array(exaSearchResultSchema),
324
+ output: z.object({
325
+ content: z.unknown(),
326
+ grounding: z.array(exaGroundingSchema).optional()
327
+ }).optional(),
328
+ costDollars: z.object({ total: z.number().optional() }).optional()
329
+ });
330
+ const exaSearchStructured = defineAction({
331
+ key: "exa-search-structured",
332
+ name: "Exa Structured Search",
333
+ description: "Exa search with outputSchema for grounded structured JSON synthesis across sources.",
334
+ input: ExaSearchStructuredInput,
335
+ output: ExaSearchStructuredOutput,
336
+ credentials: [exaCredential],
337
+ async run(input, credentials) {
338
+ const client = createExaClient(credentials.exa.apiKey);
339
+ const body = {
340
+ query: input.query,
341
+ type: input.type,
342
+ numResults: input.numResults,
343
+ outputSchema: input.outputSchema
344
+ };
345
+ if (input.category) body.category = input.category;
346
+ if (input.includeDomains?.length) body.includeDomains = input.includeDomains;
347
+ if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;
348
+ if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;
349
+ if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;
350
+ if (input.systemPrompt) body.systemPrompt = input.systemPrompt;
351
+ if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;
352
+ const contents = buildSearchContents({
353
+ highlights: input.highlights,
354
+ text: input.text
355
+ });
356
+ if (contents) body.contents = contents;
357
+ const response = await client.search(body);
358
+ return {
359
+ requestId: response.requestId,
360
+ searchType: response.searchType,
361
+ results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),
362
+ output: response.output ? {
363
+ content: response.output.content,
364
+ grounding: response.output.grounding?.map((g) => exaGroundingSchema.parse(g))
365
+ } : void 0,
366
+ costDollars: response.costDollars
367
+ };
368
+ }
369
+ });
370
+ //#endregion
371
+ export { ExaSearchOutput as a, ExaGetContextOutput as c, ExaGetContentsOutput as d, exaGetContents as f, createExaClient as g, exaAnswer as h, ExaSearchInput as i, exaGetContext as l, ExaAnswerOutput as m, ExaSearchStructuredOutput as n, exaSearch as o, ExaAnswerInput as p, exaSearchStructured as r, ExaGetContextInput as s, ExaSearchStructuredInput as t, ExaGetContentsInput as u };
372
+
373
+ //# sourceMappingURL=actions-DnHafheX.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"actions-DnHafheX.mjs","names":[],"sources":["../src/client.ts","../src/schemas.ts","../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"sourcesContent":["import ky, { type KyInstance } from \"ky\";\n\nconst EXA_API_BASE = \"https://api.exa.ai\";\n\nexport type ExaClient = {\n search: (body: Record<string, unknown>) => Promise<unknown>;\n contents: (body: Record<string, unknown>) => Promise<unknown>;\n answer: (body: Record<string, unknown>) => Promise<unknown>;\n context: (body: Record<string, unknown>) => Promise<unknown>;\n};\n\nexport function createExaClient(apiKey: string): ExaClient {\n const api: KyInstance = ky.create({\n prefix: EXA_API_BASE,\n headers: {\n \"x-api-key\": apiKey,\n \"Content-Type\": \"application/json\",\n },\n });\n\n return {\n search: (body) => api.post(\"search\", { json: body }).json(),\n contents: (body) => api.post(\"contents\", { json: body }).json(),\n answer: (body) => api.post(\"answer\", { json: body }).json(),\n context: (body) => api.post(\"context\", { json: body }).json(),\n };\n}\n","import { z } from \"zod\";\n\nexport const exaSearchTypeSchema = z.enum([\n \"instant\",\n \"fast\",\n \"auto\",\n \"deep-lite\",\n \"deep\",\n \"deep-reasoning\",\n]);\n\nexport const exaCategorySchema = z.enum([\n \"company\",\n \"people\",\n \"research paper\",\n \"news\",\n \"personal site\",\n \"financial report\",\n]);\n\nexport const exaSearchResultSchema = z.object({\n title: z.string().nullable().optional(),\n url: z.string(),\n id: z.string().optional(),\n publishedDate: z.string().nullable().optional(),\n author: z.string().nullable().optional(),\n text: z.string().nullable().optional(),\n highlights: z.array(z.string()).optional(),\n summary: z.string().nullable().optional(),\n entities: z.unknown().optional(),\n});\n\nexport const exaGroundingCitationSchema = z.object({\n url: z.string(),\n title: z.string().optional(),\n});\n\nexport const exaGroundingSchema = z.object({\n field: z.string(),\n citations: z.array(exaGroundingCitationSchema),\n confidence: z.enum([\"low\", \"medium\", \"high\"]).optional(),\n});\n\nexport const exaContentStatusSchema = z.object({\n id: z.string(),\n status: z.enum([\"success\", \"error\"]),\n source: z.enum([\"cached\", \"crawled\"]).optional(),\n error: z\n .object({\n tag: z.string().optional(),\n httpStatusCode: z.number().optional(),\n })\n .optional(),\n});\n\nexport const exaCitationSchema = z.object({\n title: z.string().nullable().optional(),\n url: z.string(),\n id: z.string().optional(),\n publishedDate: z.string().nullable().optional(),\n author: z.string().nullable().optional(),\n text: z.string().nullable().optional(),\n});\n\nconst restrictedCategory = new Set([\"company\", \"people\"]);\n\nexport function assertCategoryFilters(\n category: z.infer<typeof exaCategorySchema> | undefined,\n filters: {\n excludeDomains?: string[] | undefined;\n startPublishedDate?: string | undefined;\n endPublishedDate?: string | undefined;\n },\n): void {\n if (!category || !restrictedCategory.has(category)) {\n return;\n }\n if (filters.excludeDomains?.length) {\n throw new Error(\"excludeDomains is not supported for company or people category searches\");\n }\n if (filters.startPublishedDate || filters.endPublishedDate) {\n throw new Error(\n \"published date filters are not supported for company or people category searches\",\n );\n }\n}\n\nexport function buildSearchContents(input: {\n highlights?: boolean;\n text?: boolean;\n summary?: boolean;\n}): Record<string, unknown> | undefined {\n const contents: Record<string, unknown> = {};\n if (input.highlights !== false) {\n contents.highlights = input.highlights === true ? true : { maxCharacters: 4000 };\n }\n if (input.text) {\n contents.text = true;\n }\n if (input.summary) {\n contents.summary = true;\n }\n return Object.keys(contents).length > 0 ? contents : undefined;\n}\n\nexport function buildContentsOptions(input: {\n highlights?: boolean;\n text?: boolean;\n summary?: boolean;\n}): Record<string, unknown> {\n const body: Record<string, unknown> = {};\n if (input.highlights) {\n body.highlights = typeof input.highlights === \"boolean\" ? true : input.highlights;\n }\n if (input.text) {\n body.text = true;\n }\n if (input.summary) {\n body.summary = true;\n }\n if (!Object.keys(body).length) {\n body.highlights = { maxCharacters: 4000 };\n }\n return body;\n}\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport { exaCitationSchema } from \"../schemas\";\n\nexport const ExaAnswerInput = z.object({\n query: z.string().describe(\"Natural-language question.\"),\n includeCitationText: z\n .boolean()\n .default(false)\n .describe(\"Include full text bodies on citations.\"),\n outputSchema: z\n .record(z.string(), z.unknown())\n .optional()\n .describe(\"JSON Schema for structured answer output.\"),\n});\n\nexport const ExaAnswerOutput = z.object({\n requestId: z.string().optional(),\n answer: z.unknown(),\n citations: z.array(exaCitationSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaAnswer = defineAction({\n key: \"exa-answer\",\n name: \"Exa Answer\",\n description: \"Search-backed grounded Q&A with citations.\",\n input: ExaAnswerInput,\n output: ExaAnswerOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n text: input.includeCitationText,\n };\n if (input.outputSchema) body.outputSchema = input.outputSchema;\n\n const response = (await client.answer(body)) as {\n requestId?: string;\n answer?: unknown;\n citations?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n answer: response.answer ?? null,\n citations: (response.citations ?? []).map((row) => exaCitationSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport { buildContentsOptions, exaContentStatusSchema, exaSearchResultSchema } from \"../schemas\";\n\nexport const ExaGetContentsInput = z.object({\n urls: z.array(z.string().url()).min(1).max(100).describe(\"URLs to extract content from.\"),\n highlights: z.boolean().optional().describe(\"Return token-efficient excerpts.\"),\n text: z.boolean().optional().describe(\"Return full page markdown.\"),\n summary: z.boolean().optional().describe(\"Return LLM summary per URL.\"),\n});\n\nexport const ExaGetContentsOutput = z.object({\n requestId: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n statuses: z.array(exaContentStatusSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaGetContents = defineAction({\n key: \"exa-get-contents\",\n name: \"Exa Get Contents\",\n description:\n \"Extract webpage content from known URLs. Check statuses for per-URL errors (API returns 200 with error statuses).\",\n input: ExaGetContentsInput,\n output: ExaGetContentsOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n urls: input.urls,\n ...buildContentsOptions({\n highlights: input.highlights,\n text: input.text,\n summary: input.summary,\n }),\n };\n\n const response = (await client.contents(body)) as {\n requestId?: string;\n results?: unknown[];\n statuses?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n statuses: (response.statuses ?? []).map((row) => exaContentStatusSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\n\nexport const ExaGetContextInput = z.object({\n query: z\n .string()\n .min(1)\n .max(2000)\n .describe(\"Code, API, or how-to question for Exa Code context.\"),\n tokensNum: z\n .union([z.number().int().min(50).max(100_000), z.literal(\"dynamic\")])\n .default(\"dynamic\")\n .describe(\"Max output tokens or dynamic sizing.\"),\n});\n\nexport const ExaGetContextOutput = z.object({\n requestId: z.string().optional(),\n query: z.string().optional(),\n response: z.string(),\n resultsCount: z.number().optional(),\n searchTime: z.number().optional(),\n outputTokens: z.number().optional(),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaGetContext = defineAction({\n key: \"exa-get-context\",\n name: \"Exa Get Context\",\n description: \"Exa Code — token-efficient documentation and code snippets for coding agents.\",\n input: ExaGetContextInput,\n output: ExaGetContextOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const response = (await client.context({\n query: input.query,\n tokensNum: input.tokensNum,\n })) as {\n requestId?: string;\n query?: string;\n response?: string;\n resultsCount?: number;\n searchTime?: number;\n outputTokens?: number;\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n query: response.query,\n response: response.response ?? \"\",\n resultsCount: response.resultsCount,\n searchTime: response.searchTime,\n outputTokens: response.outputTokens,\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport {\n assertCategoryFilters,\n buildSearchContents,\n exaCategorySchema,\n exaSearchResultSchema,\n exaSearchTypeSchema,\n} from \"../schemas\";\n\nexport const ExaSearchInput = z\n .object({\n query: z.string().describe(\"Natural-language search query.\"),\n type: exaSearchTypeSchema.default(\"auto\").describe(\"Search latency/depth profile.\"),\n category: exaCategorySchema\n .optional()\n .describe(\n \"Vertical index: company, people, research paper, news, personal site, financial report.\",\n ),\n numResults: z.number().int().min(1).max(100).default(10),\n includeDomains: z.array(z.string()).max(1200).optional(),\n excludeDomains: z.array(z.string()).max(1200).optional(),\n startPublishedDate: z.string().optional().describe(\"ISO8601 published-after filter.\"),\n endPublishedDate: z.string().optional().describe(\"ISO8601 published-before filter.\"),\n userLocation: z\n .string()\n .length(2)\n .optional()\n .describe(\"Two-letter ISO country code for localized results.\"),\n additionalQueries: z\n .array(z.string())\n .max(10)\n .optional()\n .describe(\"Extra queries for deep search types only.\"),\n systemPrompt: z.string().optional().describe(\"Guides deep search planning.\"),\n highlights: z\n .boolean()\n .default(true)\n .describe(\"Return token-efficient page excerpts (recommended).\"),\n text: z.boolean().optional().describe(\"Include full page markdown text.\"),\n summary: z.boolean().optional().describe(\"Include LLM summary per result.\"),\n })\n .superRefine((input, ctx) => {\n try {\n assertCategoryFilters(input.category, {\n excludeDomains: input.excludeDomains,\n startPublishedDate: input.startPublishedDate,\n endPublishedDate: input.endPublishedDate,\n });\n } catch (error) {\n ctx.addIssue({\n code: \"custom\",\n message: error instanceof Error ? error.message : \"Invalid category filters\",\n });\n }\n });\n\nexport const ExaSearchOutput = z.object({\n requestId: z.string().optional(),\n searchType: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaSearch = defineAction({\n key: \"exa-search\",\n name: \"Exa Search\",\n description:\n \"Search the web with Exa. Supports categories (company, people, news, research paper, etc.), filters, and content modes.\",\n input: ExaSearchInput,\n output: ExaSearchOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n type: input.type,\n numResults: input.numResults,\n };\n\n if (input.category) body.category = input.category;\n if (input.includeDomains?.length) body.includeDomains = input.includeDomains;\n if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;\n if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;\n if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;\n if (input.userLocation) body.userLocation = input.userLocation;\n if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;\n if (input.systemPrompt) body.systemPrompt = input.systemPrompt;\n\n const contents = buildSearchContents({\n highlights: input.highlights,\n text: input.text,\n summary: input.summary,\n });\n if (contents) body.contents = contents;\n\n const response = (await client.search(body)) as {\n requestId?: string;\n searchType?: string;\n results?: unknown[];\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n searchType: response.searchType,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n costDollars: response.costDollars,\n };\n },\n});\n","import { defineAction } from \"@keystrokehq/keystroke/action\";\nimport { z } from \"zod\";\nimport { createExaClient } from \"../client\";\nimport { exaCredential } from \"../credential\";\nimport {\n assertCategoryFilters,\n buildSearchContents,\n exaCategorySchema,\n exaGroundingSchema,\n exaSearchResultSchema,\n exaSearchTypeSchema,\n} from \"../schemas\";\n\nexport const ExaSearchStructuredInput = z\n .object({\n query: z.string().describe(\"Natural-language search query.\"),\n outputSchema: z\n .record(z.string(), z.unknown())\n .describe(\"JSON Schema object for structured synthesis output.\"),\n type: exaSearchTypeSchema\n .default(\"deep\")\n .describe(\"Prefer deep or deep-reasoning for synthesis.\"),\n category: exaCategorySchema.optional(),\n numResults: z.number().int().min(1).max(100).default(10),\n includeDomains: z.array(z.string()).max(1200).optional(),\n excludeDomains: z.array(z.string()).max(1200).optional(),\n startPublishedDate: z.string().optional(),\n endPublishedDate: z.string().optional(),\n systemPrompt: z.string().optional(),\n additionalQueries: z.array(z.string()).max(10).optional(),\n highlights: z.boolean().default(true),\n text: z.boolean().optional(),\n })\n .superRefine((input, ctx) => {\n try {\n assertCategoryFilters(input.category, {\n excludeDomains: input.excludeDomains,\n startPublishedDate: input.startPublishedDate,\n endPublishedDate: input.endPublishedDate,\n });\n } catch (error) {\n ctx.addIssue({\n code: \"custom\",\n message: error instanceof Error ? error.message : \"Invalid category filters\",\n });\n }\n });\n\nexport const ExaSearchStructuredOutput = z.object({\n requestId: z.string().optional(),\n searchType: z.string().optional(),\n results: z.array(exaSearchResultSchema),\n output: z\n .object({\n content: z.unknown(),\n grounding: z.array(exaGroundingSchema).optional(),\n })\n .optional(),\n costDollars: z.object({ total: z.number().optional() }).optional(),\n});\n\nexport const exaSearchStructured = defineAction({\n key: \"exa-search-structured\",\n name: \"Exa Structured Search\",\n description:\n \"Exa search with outputSchema for grounded structured JSON synthesis across sources.\",\n input: ExaSearchStructuredInput,\n output: ExaSearchStructuredOutput,\n credentials: [exaCredential] as const,\n async run(input, credentials) {\n const client = createExaClient(credentials.exa.apiKey);\n\n const body: Record<string, unknown> = {\n query: input.query,\n type: input.type,\n numResults: input.numResults,\n outputSchema: input.outputSchema,\n };\n\n if (input.category) body.category = input.category;\n if (input.includeDomains?.length) body.includeDomains = input.includeDomains;\n if (input.excludeDomains?.length) body.excludeDomains = input.excludeDomains;\n if (input.startPublishedDate) body.startPublishedDate = input.startPublishedDate;\n if (input.endPublishedDate) body.endPublishedDate = input.endPublishedDate;\n if (input.systemPrompt) body.systemPrompt = input.systemPrompt;\n if (input.additionalQueries?.length) body.additionalQueries = input.additionalQueries;\n\n const contents = buildSearchContents({\n highlights: input.highlights,\n text: input.text,\n });\n if (contents) body.contents = contents;\n\n const response = (await client.search(body)) as {\n requestId?: string;\n searchType?: string;\n results?: unknown[];\n output?: { content?: unknown; grounding?: unknown[] };\n costDollars?: { total?: number };\n };\n\n return {\n requestId: response.requestId,\n searchType: response.searchType,\n results: (response.results ?? []).map((row) => exaSearchResultSchema.parse(row)),\n output: response.output\n ? {\n content: response.output.content,\n grounding: response.output.grounding?.map((g) => exaGroundingSchema.parse(g)),\n }\n : undefined,\n costDollars: response.costDollars,\n };\n },\n});\n"],"mappings":";;;;;AAEA,MAAM,eAAe;AASrB,SAAgB,gBAAgB,QAA2B;CACzD,MAAM,MAAkB,GAAG,OAAO;EAChC,QAAQ;EACR,SAAS;GACP,aAAa;GACb,gBAAgB;EAClB;CACF,CAAC;CAED,OAAO;EACL,SAAS,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC1D,WAAW,SAAS,IAAI,KAAK,YAAY,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC9D,SAAS,SAAS,IAAI,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;EAC1D,UAAU,SAAS,IAAI,KAAK,WAAW,EAAE,MAAM,KAAK,CAAC,EAAE,KAAK;CAC9D;AACF;;;ACxBA,MAAa,sBAAsB,EAAE,KAAK;CACxC;CACA;CACA;CACA;CACA;CACA;AACF,CAA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KAAK,WAAW;EAE9B,MAAM,WAAY,MAAM,OAAO,OAAO,IAAI;EAQ1C,OAAO;GACL,WAAW,SAAS;GACpB,YAAY,SAAS;GACrB,UAAU,SAAS,WAAW,CAAC,GAAG,KAAK,QAAQ,sBAAsB,MAAM,GAAG,CAAC;GAC/E,QAAQ,SAAS,SACb;IACE,SAAS,SAAS,OAAO;IACzB,WAAW,SAAS,OAAO,WAAW,KAAK,MAAM,mBAAmB,MAAM,CAAC,CAAC;GAC9E,IACA,KAAA;GACJ,aAAa,SAAS;EACxB;CACF;AACF,CAAC"}
@@ -0,0 +1,16 @@
1
+ let _keystrokehq_keystroke_credentials = require("@keystrokehq/keystroke/credentials");
2
+ let zod = require("zod");
3
+ //#region src/credential.ts
4
+ const exaCredential = (0, _keystrokehq_keystroke_credentials.defineCredential)({
5
+ key: "exa",
6
+ fields: { apiKey: zod.z.string() }
7
+ });
8
+ //#endregion
9
+ Object.defineProperty(exports, "exaCredential", {
10
+ enumerable: true,
11
+ get: function() {
12
+ return exaCredential;
13
+ }
14
+ });
15
+
16
+ //# sourceMappingURL=credential-BWous9Uu.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-BWous9Uu.cjs","names":["z"],"sources":["../src/credential.ts"],"sourcesContent":["import { defineCredential } from \"@keystrokehq/keystroke/credentials\";\nimport { z } from \"zod\";\n\nexport const exaCredential = defineCredential({\n key: \"exa\",\n fields: { apiKey: z.string() },\n});\n"],"mappings":";;;AAGA,MAAa,iBAAA,GAAA,mCAAA,kBAAiC;CAC5C,KAAK;CACL,QAAQ,EAAE,QAAQA,IAAAA,EAAE,OAAO,EAAE;AAC/B,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { defineCredential } from "@keystrokehq/keystroke/credentials";
2
+ import { z } from "zod";
3
+ //#region src/credential.ts
4
+ const exaCredential = defineCredential({
5
+ key: "exa",
6
+ fields: { apiKey: z.string() }
7
+ });
8
+ //#endregion
9
+ export { exaCredential as t };
10
+
11
+ //# sourceMappingURL=credential-NfXyV_Vy.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"credential-NfXyV_Vy.mjs","names":[],"sources":["../src/credential.ts"],"sourcesContent":["import { defineCredential } from \"@keystrokehq/keystroke/credentials\";\nimport { z } from \"zod\";\n\nexport const exaCredential = defineCredential({\n key: \"exa\",\n fields: { apiKey: z.string() },\n});\n"],"mappings":";;;AAGA,MAAa,gBAAgB,iBAAiB;CAC5C,KAAK;CACL,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE;AAC/B,CAAC"}