@keystrokehq/exa 0.1.0 → 0.1.1
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.
- package/README.md +35 -10
- package/dist/actions/index.cjs +1 -1
- package/dist/actions/index.mjs +1 -1
- package/dist/{actions-DnHafheX.mjs → actions-CJq1Nyt_.mjs} +14 -38
- package/dist/actions-CJq1Nyt_.mjs.map +1 -0
- package/dist/{actions-Bl-9uz6K.cjs → actions-LoQVlbiT.cjs} +18 -71
- package/dist/actions-LoQVlbiT.cjs.map +1 -0
- package/dist/app-CBLUruR0.mjs +15 -0
- package/dist/app-CBLUruR0.mjs.map +1 -0
- package/dist/app-DMujvH6I.cjs +26 -0
- package/dist/app-DMujvH6I.cjs.map +1 -0
- package/dist/client-DlwHA71b.cjs +56 -0
- package/dist/client-DlwHA71b.cjs.map +1 -0
- package/dist/client.cjs +3 -0
- package/dist/client.d.cts +16 -0
- package/dist/client.d.cts.map +1 -0
- package/dist/client.d.mts +16 -0
- package/dist/client.d.mts.map +1 -0
- package/dist/client.mjs +28 -0
- package/dist/client.mjs.map +1 -0
- package/dist/index-BwCGHs6v.d.cts.map +1 -1
- package/dist/index-BwCGHs6v.d.mts.map +1 -1
- package/dist/index.cjs +6 -4
- package/dist/index.d.cts +8 -11
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +8 -11
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +4 -3
- package/dist/mcp.cjs +3 -3
- package/dist/mcp.cjs.map +1 -1
- package/dist/mcp.mjs +3 -3
- package/dist/mcp.mjs.map +1 -1
- package/package.json +10 -8
- package/dist/actions-Bl-9uz6K.cjs.map +0 -1
- package/dist/actions-DnHafheX.mjs.map +0 -1
- package/dist/credential-BWous9Uu.cjs +0 -16
- package/dist/credential-BWous9Uu.cjs.map +0 -1
- package/dist/credential-NfXyV_Vy.mjs +0 -11
- package/dist/credential-NfXyV_Vy.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -8,23 +8,38 @@ Reference for building a **custom integration package**: credential → actions
|
|
|
8
8
|
|
|
9
9
|
```
|
|
10
10
|
src/
|
|
11
|
-
|
|
12
|
-
actions/ #
|
|
13
|
-
mcp.ts # defineMcp (uses
|
|
11
|
+
app.ts # defineApp — vault key "exa", api_key auth
|
|
12
|
+
actions/ # exa.action() exports
|
|
13
|
+
mcp.ts # defineMcp (uses exa.credential)
|
|
14
14
|
client.ts # raw HTTP client
|
|
15
15
|
index.ts # public exports
|
|
16
16
|
```
|
|
17
17
|
|
|
18
|
-
##
|
|
18
|
+
## App + credential
|
|
19
19
|
|
|
20
20
|
```ts
|
|
21
|
-
// src/
|
|
22
|
-
import {
|
|
21
|
+
// src/app.ts
|
|
22
|
+
import { defineApp } from "@keystrokehq/keystroke/app";
|
|
23
23
|
import { z } from "zod";
|
|
24
24
|
|
|
25
|
-
export const
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
export const exa = defineApp({
|
|
26
|
+
slug: "exa",
|
|
27
|
+
auth: "api_key",
|
|
28
|
+
credential: { apiKey: z.string() },
|
|
29
|
+
});
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
Actions are minted from the app — no separate credential import:
|
|
33
|
+
|
|
34
|
+
```ts
|
|
35
|
+
export const exaSearch = exa.action({
|
|
36
|
+
slug: "exa-search",
|
|
37
|
+
input: ExaSearchInput,
|
|
38
|
+
output: ExaSearchOutput,
|
|
39
|
+
async run(input, { exa: { apiKey } }) {
|
|
40
|
+
const client = createExaClient(apiKey);
|
|
41
|
+
// ...
|
|
42
|
+
},
|
|
28
43
|
});
|
|
29
44
|
```
|
|
30
45
|
|
|
@@ -75,7 +90,17 @@ tools: [exaSearchMcp, exaWebsetsMcp],
|
|
|
75
90
|
## Client
|
|
76
91
|
|
|
77
92
|
```ts
|
|
78
|
-
import {
|
|
93
|
+
import { exaCredential } from "@keystrokehq/exa";
|
|
94
|
+
import { createExaClient } from "@keystrokehq/exa/client";
|
|
95
|
+
|
|
96
|
+
// Direct API key
|
|
97
|
+
const client = createExaClient("your-api-key");
|
|
98
|
+
|
|
99
|
+
// Platform proxy or custom base URL
|
|
100
|
+
const proxied = createExaClient({
|
|
101
|
+
baseUrl: "https://platform.example/internal/projects/p1/web-search",
|
|
102
|
+
headers: { Authorization: "Bearer worker-token" },
|
|
103
|
+
});
|
|
79
104
|
```
|
|
80
105
|
|
|
81
106
|
## Dependencies
|
package/dist/actions/index.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const require_actions = require("../actions-
|
|
2
|
+
const require_actions = require("../actions-LoQVlbiT.cjs");
|
|
3
3
|
exports.ExaAnswerInput = require_actions.ExaAnswerInput;
|
|
4
4
|
exports.ExaAnswerOutput = require_actions.ExaAnswerOutput;
|
|
5
5
|
exports.ExaGetContentsInput = require_actions.ExaGetContentsInput;
|
package/dist/actions/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as ExaSearchOutput, c as ExaGetContextOutput, d as ExaGetContentsOutput, f as exaGetContents, h as exaAnswer, i as ExaSearchInput, l as exaGetContext, m as ExaAnswerOutput, n as ExaSearchStructuredOutput, o as exaSearch, p as ExaAnswerInput, r as exaSearchStructured, s as ExaGetContextInput, t as ExaSearchStructuredInput, u as ExaGetContentsInput } from "../actions-
|
|
1
|
+
import { a as ExaSearchOutput, c as ExaGetContextOutput, d as ExaGetContentsOutput, f as exaGetContents, h as exaAnswer, i as ExaSearchInput, l as exaGetContext, m as ExaAnswerOutput, n as ExaSearchStructuredOutput, o as exaSearch, p as ExaAnswerInput, r as exaSearchStructured, s as ExaGetContextInput, t as ExaSearchStructuredInput, u as ExaGetContentsInput } from "../actions-CJq1Nyt_.mjs";
|
|
2
2
|
export { ExaAnswerInput, ExaAnswerOutput, ExaGetContentsInput, ExaGetContentsOutput, ExaGetContextInput, ExaGetContextOutput, ExaSearchInput, ExaSearchOutput, ExaSearchStructuredInput, ExaSearchStructuredOutput, exaAnswer, exaGetContents, exaGetContext, exaSearch, exaSearchStructured };
|
|
@@ -1,25 +1,6 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as exa } from "./app-CBLUruR0.mjs";
|
|
2
|
+
import { createExaClient } from "./client.mjs";
|
|
2
3
|
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
4
|
//#region src/schemas.ts
|
|
24
5
|
const exaSearchTypeSchema = z.enum([
|
|
25
6
|
"instant",
|
|
@@ -112,13 +93,12 @@ const ExaAnswerOutput = z.object({
|
|
|
112
93
|
citations: z.array(exaCitationSchema),
|
|
113
94
|
costDollars: z.object({ total: z.number().optional() }).optional()
|
|
114
95
|
});
|
|
115
|
-
const exaAnswer =
|
|
116
|
-
|
|
96
|
+
const exaAnswer = exa.action({
|
|
97
|
+
slug: "exa-answer",
|
|
117
98
|
name: "Exa Answer",
|
|
118
99
|
description: "Search-backed grounded Q&A with citations.",
|
|
119
100
|
input: ExaAnswerInput,
|
|
120
101
|
output: ExaAnswerOutput,
|
|
121
|
-
credentials: [exaCredential],
|
|
122
102
|
async run(input, credentials) {
|
|
123
103
|
const client = createExaClient(credentials.exa.apiKey);
|
|
124
104
|
const body = {
|
|
@@ -149,13 +129,12 @@ const ExaGetContentsOutput = z.object({
|
|
|
149
129
|
statuses: z.array(exaContentStatusSchema),
|
|
150
130
|
costDollars: z.object({ total: z.number().optional() }).optional()
|
|
151
131
|
});
|
|
152
|
-
const exaGetContents =
|
|
153
|
-
|
|
132
|
+
const exaGetContents = exa.action({
|
|
133
|
+
slug: "exa-get-contents",
|
|
154
134
|
name: "Exa Get Contents",
|
|
155
135
|
description: "Extract webpage content from known URLs. Check statuses for per-URL errors (API returns 200 with error statuses).",
|
|
156
136
|
input: ExaGetContentsInput,
|
|
157
137
|
output: ExaGetContentsOutput,
|
|
158
|
-
credentials: [exaCredential],
|
|
159
138
|
async run(input, credentials) {
|
|
160
139
|
const client = createExaClient(credentials.exa.apiKey);
|
|
161
140
|
const body = {
|
|
@@ -190,13 +169,12 @@ const ExaGetContextOutput = z.object({
|
|
|
190
169
|
outputTokens: z.number().optional(),
|
|
191
170
|
costDollars: z.object({ total: z.number().optional() }).optional()
|
|
192
171
|
});
|
|
193
|
-
const exaGetContext =
|
|
194
|
-
|
|
172
|
+
const exaGetContext = exa.action({
|
|
173
|
+
slug: "exa-get-context",
|
|
195
174
|
name: "Exa Get Context",
|
|
196
175
|
description: "Exa Code — token-efficient documentation and code snippets for coding agents.",
|
|
197
176
|
input: ExaGetContextInput,
|
|
198
177
|
output: ExaGetContextOutput,
|
|
199
|
-
credentials: [exaCredential],
|
|
200
178
|
async run(input, credentials) {
|
|
201
179
|
const response = await createExaClient(credentials.exa.apiKey).context({
|
|
202
180
|
query: input.query,
|
|
@@ -250,13 +228,12 @@ const ExaSearchOutput = z.object({
|
|
|
250
228
|
results: z.array(exaSearchResultSchema),
|
|
251
229
|
costDollars: z.object({ total: z.number().optional() }).optional()
|
|
252
230
|
});
|
|
253
|
-
const exaSearch =
|
|
254
|
-
|
|
231
|
+
const exaSearch = exa.action({
|
|
232
|
+
slug: "exa-search",
|
|
255
233
|
name: "Exa Search",
|
|
256
234
|
description: "Search the web with Exa. Supports categories (company, people, news, research paper, etc.), filters, and content modes.",
|
|
257
235
|
input: ExaSearchInput,
|
|
258
236
|
output: ExaSearchOutput,
|
|
259
|
-
credentials: [exaCredential],
|
|
260
237
|
async run(input, credentials) {
|
|
261
238
|
const client = createExaClient(credentials.exa.apiKey);
|
|
262
239
|
const body = {
|
|
@@ -327,13 +304,12 @@ const ExaSearchStructuredOutput = z.object({
|
|
|
327
304
|
}).optional(),
|
|
328
305
|
costDollars: z.object({ total: z.number().optional() }).optional()
|
|
329
306
|
});
|
|
330
|
-
const exaSearchStructured =
|
|
331
|
-
|
|
307
|
+
const exaSearchStructured = exa.action({
|
|
308
|
+
slug: "exa-search-structured",
|
|
332
309
|
name: "Exa Structured Search",
|
|
333
310
|
description: "Exa search with outputSchema for grounded structured JSON synthesis across sources.",
|
|
334
311
|
input: ExaSearchStructuredInput,
|
|
335
312
|
output: ExaSearchStructuredOutput,
|
|
336
|
-
credentials: [exaCredential],
|
|
337
313
|
async run(input, credentials) {
|
|
338
314
|
const client = createExaClient(credentials.exa.apiKey);
|
|
339
315
|
const body = {
|
|
@@ -368,6 +344,6 @@ const exaSearchStructured = defineAction({
|
|
|
368
344
|
}
|
|
369
345
|
});
|
|
370
346
|
//#endregion
|
|
371
|
-
export { ExaSearchOutput as a, ExaGetContextOutput as c, ExaGetContentsOutput as d, exaGetContents as f,
|
|
347
|
+
export { ExaSearchOutput as a, ExaGetContextOutput as c, ExaGetContentsOutput as d, exaGetContents as f, 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
348
|
|
|
373
|
-
//# sourceMappingURL=actions-
|
|
349
|
+
//# sourceMappingURL=actions-CJq1Nyt_.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-CJq1Nyt_.mjs","names":[],"sources":["../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 { 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"exa-answer\",\n name: \"Exa Answer\",\n description: \"Search-backed grounded Q&A with citations.\",\n input: ExaAnswerInput,\n output: ExaAnswerOutput,\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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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,MAAa,sBAAsB,EAAE,KAAK;CACxC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,oBAAoB,EAAE,KAAK;CACtC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,wBAAwB,EAAE,OAAO;CAC5C,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS;CACtC,KAAK,EAAE,OAAO;CACd,IAAI,EAAE,OAAO,EAAE,SAAS;CACxB,eAAe,EAAE,OAAO,EAAE,SAAS,EAA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AC"}
|
|
@@ -1,48 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
-
key = keys[i];
|
|
11
|
-
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
-
get: ((k) => from[k]).bind(null, key),
|
|
13
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
-
});
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
-
value: mod,
|
|
20
|
-
enumerable: true
|
|
21
|
-
}) : target, mod));
|
|
22
|
-
//#endregion
|
|
23
|
-
const require_credential = require("./credential-BWous9Uu.cjs");
|
|
1
|
+
const require_client = require("./client-DlwHA71b.cjs");
|
|
2
|
+
const require_app = require("./app-DMujvH6I.cjs");
|
|
24
3
|
let zod = require("zod");
|
|
25
|
-
let ky = require("ky");
|
|
26
|
-
ky = __toESM(ky, 1);
|
|
27
|
-
let _keystrokehq_keystroke_action = require("@keystrokehq/keystroke/action");
|
|
28
|
-
//#region src/client.ts
|
|
29
|
-
const EXA_API_BASE = "https://api.exa.ai";
|
|
30
|
-
function createExaClient(apiKey) {
|
|
31
|
-
const api = ky.default.create({
|
|
32
|
-
prefix: EXA_API_BASE,
|
|
33
|
-
headers: {
|
|
34
|
-
"x-api-key": apiKey,
|
|
35
|
-
"Content-Type": "application/json"
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
return {
|
|
39
|
-
search: (body) => api.post("search", { json: body }).json(),
|
|
40
|
-
contents: (body) => api.post("contents", { json: body }).json(),
|
|
41
|
-
answer: (body) => api.post("answer", { json: body }).json(),
|
|
42
|
-
context: (body) => api.post("context", { json: body }).json()
|
|
43
|
-
};
|
|
44
|
-
}
|
|
45
|
-
//#endregion
|
|
46
4
|
//#region src/schemas.ts
|
|
47
5
|
const exaSearchTypeSchema = zod.z.enum([
|
|
48
6
|
"instant",
|
|
@@ -135,15 +93,14 @@ const ExaAnswerOutput = zod.z.object({
|
|
|
135
93
|
citations: zod.z.array(exaCitationSchema),
|
|
136
94
|
costDollars: zod.z.object({ total: zod.z.number().optional() }).optional()
|
|
137
95
|
});
|
|
138
|
-
const exaAnswer =
|
|
139
|
-
|
|
96
|
+
const exaAnswer = require_app.exa.action({
|
|
97
|
+
slug: "exa-answer",
|
|
140
98
|
name: "Exa Answer",
|
|
141
99
|
description: "Search-backed grounded Q&A with citations.",
|
|
142
100
|
input: ExaAnswerInput,
|
|
143
101
|
output: ExaAnswerOutput,
|
|
144
|
-
credentials: [require_credential.exaCredential],
|
|
145
102
|
async run(input, credentials) {
|
|
146
|
-
const client = createExaClient(credentials.exa.apiKey);
|
|
103
|
+
const client = require_client.createExaClient(credentials.exa.apiKey);
|
|
147
104
|
const body = {
|
|
148
105
|
query: input.query,
|
|
149
106
|
text: input.includeCitationText
|
|
@@ -172,15 +129,14 @@ const ExaGetContentsOutput = zod.z.object({
|
|
|
172
129
|
statuses: zod.z.array(exaContentStatusSchema),
|
|
173
130
|
costDollars: zod.z.object({ total: zod.z.number().optional() }).optional()
|
|
174
131
|
});
|
|
175
|
-
const exaGetContents =
|
|
176
|
-
|
|
132
|
+
const exaGetContents = require_app.exa.action({
|
|
133
|
+
slug: "exa-get-contents",
|
|
177
134
|
name: "Exa Get Contents",
|
|
178
135
|
description: "Extract webpage content from known URLs. Check statuses for per-URL errors (API returns 200 with error statuses).",
|
|
179
136
|
input: ExaGetContentsInput,
|
|
180
137
|
output: ExaGetContentsOutput,
|
|
181
|
-
credentials: [require_credential.exaCredential],
|
|
182
138
|
async run(input, credentials) {
|
|
183
|
-
const client = createExaClient(credentials.exa.apiKey);
|
|
139
|
+
const client = require_client.createExaClient(credentials.exa.apiKey);
|
|
184
140
|
const body = {
|
|
185
141
|
urls: input.urls,
|
|
186
142
|
...buildContentsOptions({
|
|
@@ -213,15 +169,14 @@ const ExaGetContextOutput = zod.z.object({
|
|
|
213
169
|
outputTokens: zod.z.number().optional(),
|
|
214
170
|
costDollars: zod.z.object({ total: zod.z.number().optional() }).optional()
|
|
215
171
|
});
|
|
216
|
-
const exaGetContext =
|
|
217
|
-
|
|
172
|
+
const exaGetContext = require_app.exa.action({
|
|
173
|
+
slug: "exa-get-context",
|
|
218
174
|
name: "Exa Get Context",
|
|
219
175
|
description: "Exa Code — token-efficient documentation and code snippets for coding agents.",
|
|
220
176
|
input: ExaGetContextInput,
|
|
221
177
|
output: ExaGetContextOutput,
|
|
222
|
-
credentials: [require_credential.exaCredential],
|
|
223
178
|
async run(input, credentials) {
|
|
224
|
-
const response = await createExaClient(credentials.exa.apiKey).context({
|
|
179
|
+
const response = await require_client.createExaClient(credentials.exa.apiKey).context({
|
|
225
180
|
query: input.query,
|
|
226
181
|
tokensNum: input.tokensNum
|
|
227
182
|
});
|
|
@@ -273,15 +228,14 @@ const ExaSearchOutput = zod.z.object({
|
|
|
273
228
|
results: zod.z.array(exaSearchResultSchema),
|
|
274
229
|
costDollars: zod.z.object({ total: zod.z.number().optional() }).optional()
|
|
275
230
|
});
|
|
276
|
-
const exaSearch =
|
|
277
|
-
|
|
231
|
+
const exaSearch = require_app.exa.action({
|
|
232
|
+
slug: "exa-search",
|
|
278
233
|
name: "Exa Search",
|
|
279
234
|
description: "Search the web with Exa. Supports categories (company, people, news, research paper, etc.), filters, and content modes.",
|
|
280
235
|
input: ExaSearchInput,
|
|
281
236
|
output: ExaSearchOutput,
|
|
282
|
-
credentials: [require_credential.exaCredential],
|
|
283
237
|
async run(input, credentials) {
|
|
284
|
-
const client = createExaClient(credentials.exa.apiKey);
|
|
238
|
+
const client = require_client.createExaClient(credentials.exa.apiKey);
|
|
285
239
|
const body = {
|
|
286
240
|
query: input.query,
|
|
287
241
|
type: input.type,
|
|
@@ -350,15 +304,14 @@ const ExaSearchStructuredOutput = zod.z.object({
|
|
|
350
304
|
}).optional(),
|
|
351
305
|
costDollars: zod.z.object({ total: zod.z.number().optional() }).optional()
|
|
352
306
|
});
|
|
353
|
-
const exaSearchStructured =
|
|
354
|
-
|
|
307
|
+
const exaSearchStructured = require_app.exa.action({
|
|
308
|
+
slug: "exa-search-structured",
|
|
355
309
|
name: "Exa Structured Search",
|
|
356
310
|
description: "Exa search with outputSchema for grounded structured JSON synthesis across sources.",
|
|
357
311
|
input: ExaSearchStructuredInput,
|
|
358
312
|
output: ExaSearchStructuredOutput,
|
|
359
|
-
credentials: [require_credential.exaCredential],
|
|
360
313
|
async run(input, credentials) {
|
|
361
|
-
const client = createExaClient(credentials.exa.apiKey);
|
|
314
|
+
const client = require_client.createExaClient(credentials.exa.apiKey);
|
|
362
315
|
const body = {
|
|
363
316
|
query: input.query,
|
|
364
317
|
type: input.type,
|
|
@@ -451,12 +404,6 @@ Object.defineProperty(exports, "ExaSearchStructuredOutput", {
|
|
|
451
404
|
return ExaSearchStructuredOutput;
|
|
452
405
|
}
|
|
453
406
|
});
|
|
454
|
-
Object.defineProperty(exports, "createExaClient", {
|
|
455
|
-
enumerable: true,
|
|
456
|
-
get: function() {
|
|
457
|
-
return createExaClient;
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
407
|
Object.defineProperty(exports, "exaAnswer", {
|
|
461
408
|
enumerable: true,
|
|
462
409
|
get: function() {
|
|
@@ -488,4 +435,4 @@ Object.defineProperty(exports, "exaSearchStructured", {
|
|
|
488
435
|
}
|
|
489
436
|
});
|
|
490
437
|
|
|
491
|
-
//# sourceMappingURL=actions-
|
|
438
|
+
//# sourceMappingURL=actions-LoQVlbiT.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actions-LoQVlbiT.cjs","names":["z","z","exa","createExaClient","z","exa","createExaClient","z","exa","createExaClient","z","exa","createExaClient","z","exa","createExaClient"],"sources":["../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 { 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"exa-answer\",\n name: \"Exa Answer\",\n description: \"Search-backed grounded Q&A with citations.\",\n input: ExaAnswerInput,\n output: ExaAnswerOutput,\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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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 { z } from \"zod\";\nimport { exa } from \"../app\";\nimport { createExaClient } from \"../client\";\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 = exa.action({\n slug: \"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 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,MAAa,sBAAsBA,IAAAA,EAAE,KAAK;CACxC;CACA;CACA;CACA;CACA;CACA;AACF,CAAC;AAED,MAAa,oBAAoBA,IAAAA,EAAE,KAAK;CAC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KAAA;GACJ,aAAa,SAAS;EACxB;CACF;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineApp } from "@keystrokehq/keystroke/app";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
//#region src/app.ts
|
|
4
|
+
/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */
|
|
5
|
+
const exa = defineApp({
|
|
6
|
+
slug: "exa",
|
|
7
|
+
auth: "api_key",
|
|
8
|
+
credential: { apiKey: z.string() }
|
|
9
|
+
});
|
|
10
|
+
/** @deprecated Use `exa.credential`. */
|
|
11
|
+
const exaCredential = exa.credential;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { exaCredential as n, exa as t };
|
|
14
|
+
|
|
15
|
+
//# sourceMappingURL=app-CBLUruR0.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-CBLUruR0.mjs","names":[],"sources":["../src/app.ts"],"sourcesContent":["import { defineApp } from \"@keystrokehq/keystroke/app\";\nimport { z } from \"zod\";\n\n/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */\nexport const exa = defineApp({\n slug: \"exa\",\n auth: \"api_key\",\n credential: { apiKey: z.string() },\n});\n\n/** @deprecated Use `exa.credential`. */\nexport const exaCredential = exa.credential;\n"],"mappings":";;;;AAIA,MAAa,MAAM,UAAU;CAC3B,MAAM;CACN,MAAM;CACN,YAAY,EAAE,QAAQ,EAAE,OAAO,EAAE;AACnC,CAAC;;AAGD,MAAa,gBAAgB,IAAI"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
let _keystrokehq_keystroke_app = require("@keystrokehq/keystroke/app");
|
|
2
|
+
let zod = require("zod");
|
|
3
|
+
//#region src/app.ts
|
|
4
|
+
/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */
|
|
5
|
+
const exa = (0, _keystrokehq_keystroke_app.defineApp)({
|
|
6
|
+
slug: "exa",
|
|
7
|
+
auth: "api_key",
|
|
8
|
+
credential: { apiKey: zod.z.string() }
|
|
9
|
+
});
|
|
10
|
+
/** @deprecated Use `exa.credential`. */
|
|
11
|
+
const exaCredential = exa.credential;
|
|
12
|
+
//#endregion
|
|
13
|
+
Object.defineProperty(exports, "exa", {
|
|
14
|
+
enumerable: true,
|
|
15
|
+
get: function() {
|
|
16
|
+
return exa;
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
Object.defineProperty(exports, "exaCredential", {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function() {
|
|
22
|
+
return exaCredential;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
//# sourceMappingURL=app-DMujvH6I.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"app-DMujvH6I.cjs","names":["z"],"sources":["../src/app.ts"],"sourcesContent":["import { defineApp } from \"@keystrokehq/keystroke/app\";\nimport { z } from \"zod\";\n\n/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */\nexport const exa = defineApp({\n slug: \"exa\",\n auth: \"api_key\",\n credential: { apiKey: z.string() },\n});\n\n/** @deprecated Use `exa.credential`. */\nexport const exaCredential = exa.credential;\n"],"mappings":";;;;AAIA,MAAa,OAAA,GAAA,2BAAA,WAAgB;CAC3B,MAAM;CACN,MAAM;CACN,YAAY,EAAE,QAAQA,IAAAA,EAAE,OAAO,EAAE;AACnC,CAAC;;AAGD,MAAa,gBAAgB,IAAI"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
//#region \0rolldown/runtime.js
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
//#endregion
|
|
23
|
+
let ky = require("ky");
|
|
24
|
+
ky = __toESM(ky, 1);
|
|
25
|
+
//#region src/client.ts
|
|
26
|
+
const EXA_API_BASE = "https://api.exa.ai";
|
|
27
|
+
function resolveCreateExaClientOptions(options) {
|
|
28
|
+
return typeof options === "string" ? { apiKey: options } : options;
|
|
29
|
+
}
|
|
30
|
+
function createExaClient(options) {
|
|
31
|
+
const resolved = resolveCreateExaClientOptions(options);
|
|
32
|
+
const headers = {
|
|
33
|
+
"Content-Type": "application/json",
|
|
34
|
+
...resolved.headers
|
|
35
|
+
};
|
|
36
|
+
if (resolved.apiKey) headers["x-api-key"] = resolved.apiKey;
|
|
37
|
+
const api = ky.default.create({
|
|
38
|
+
prefix: `${(resolved.baseUrl ?? EXA_API_BASE).replace(/\/+$/, "")}/`,
|
|
39
|
+
headers
|
|
40
|
+
});
|
|
41
|
+
return {
|
|
42
|
+
search: (body) => api.post("search", { json: body }).json(),
|
|
43
|
+
contents: (body) => api.post("contents", { json: body }).json(),
|
|
44
|
+
answer: (body) => api.post("answer", { json: body }).json(),
|
|
45
|
+
context: (body) => api.post("context", { json: body }).json()
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
//#endregion
|
|
49
|
+
Object.defineProperty(exports, "createExaClient", {
|
|
50
|
+
enumerable: true,
|
|
51
|
+
get: function() {
|
|
52
|
+
return createExaClient;
|
|
53
|
+
}
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
//# sourceMappingURL=client-DlwHA71b.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client-DlwHA71b.cjs","names":[],"sources":["../src/client.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 type CreateExaClientOptions = {\n /** Sent as x-api-key. Omit when using custom headers (e.g. platform proxy). */\n apiKey?: string;\n /** Defaults to https://api.exa.ai */\n baseUrl?: string;\n headers?: Record<string, string>;\n};\n\nfunction resolveCreateExaClientOptions(\n options: CreateExaClientOptions | string,\n): CreateExaClientOptions {\n return typeof options === \"string\" ? { apiKey: options } : options;\n}\n\nexport function createExaClient(options: CreateExaClientOptions | string): ExaClient {\n const resolved = resolveCreateExaClientOptions(options);\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...resolved.headers,\n };\n\n if (resolved.apiKey) {\n headers[\"x-api-key\"] = resolved.apiKey;\n }\n\n const api: KyInstance = ky.create({\n prefix: `${(resolved.baseUrl ?? EXA_API_BASE).replace(/\\/+$/, \"\")}/`,\n headers,\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAEA,MAAM,eAAe;AAiBrB,SAAS,8BACP,SACwB;CACxB,OAAO,OAAO,YAAY,WAAW,EAAE,QAAQ,QAAQ,IAAI;AAC7D;AAEA,SAAgB,gBAAgB,SAAqD;CACnF,MAAM,WAAW,8BAA8B,OAAO;CACtD,MAAM,UAAkC;EACtC,gBAAgB;EAChB,GAAG,SAAS;CACd;CAEA,IAAI,SAAS,QACX,QAAQ,eAAe,SAAS;CAGlC,MAAM,MAAkB,GAAA,QAAG,OAAO;EAChC,QAAQ,IAAI,SAAS,WAAW,cAAc,QAAQ,QAAQ,EAAE,EAAE;EAClE;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"}
|
package/dist/client.cjs
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/client.d.ts
|
|
2
|
+
type ExaClient = {
|
|
3
|
+
search: (body: Record<string, unknown>) => Promise<unknown>;
|
|
4
|
+
contents: (body: Record<string, unknown>) => Promise<unknown>;
|
|
5
|
+
answer: (body: Record<string, unknown>) => Promise<unknown>;
|
|
6
|
+
context: (body: Record<string, unknown>) => Promise<unknown>;
|
|
7
|
+
};
|
|
8
|
+
type CreateExaClientOptions = {
|
|
9
|
+
/** Sent as x-api-key. Omit when using custom headers (e.g. platform proxy). */apiKey?: string; /** Defaults to https://api.exa.ai */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
declare function createExaClient(options: CreateExaClientOptions | string): ExaClient;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CreateExaClientOptions, ExaClient, createExaClient };
|
|
16
|
+
//# sourceMappingURL=client.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.cts","names":[],"sources":["../src/client.ts"],"mappings":";KAIY,SAAA;EACV,MAAA,GAAS,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC3C,QAAA,GAAW,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC7C,MAAA,GAAS,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC3C,OAAA,GAAU,IAAA,EAAM,MAAA,sBAA4B,OAAA;AAAA;AAAA,KAGlC,sBAAA;EALmC,+EAO7C,MAAA,WAN2C;EAQ3C,OAAA;EACA,OAAA,GAAU,MAAM;AAAA;AAAA,iBASF,eAAA,CAAgB,OAAA,EAAS,sBAAA,YAAkC,SAAS"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
//#region src/client.d.ts
|
|
2
|
+
type ExaClient = {
|
|
3
|
+
search: (body: Record<string, unknown>) => Promise<unknown>;
|
|
4
|
+
contents: (body: Record<string, unknown>) => Promise<unknown>;
|
|
5
|
+
answer: (body: Record<string, unknown>) => Promise<unknown>;
|
|
6
|
+
context: (body: Record<string, unknown>) => Promise<unknown>;
|
|
7
|
+
};
|
|
8
|
+
type CreateExaClientOptions = {
|
|
9
|
+
/** Sent as x-api-key. Omit when using custom headers (e.g. platform proxy). */apiKey?: string; /** Defaults to https://api.exa.ai */
|
|
10
|
+
baseUrl?: string;
|
|
11
|
+
headers?: Record<string, string>;
|
|
12
|
+
};
|
|
13
|
+
declare function createExaClient(options: CreateExaClientOptions | string): ExaClient;
|
|
14
|
+
//#endregion
|
|
15
|
+
export { CreateExaClientOptions, ExaClient, createExaClient };
|
|
16
|
+
//# sourceMappingURL=client.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../src/client.ts"],"mappings":";KAIY,SAAA;EACV,MAAA,GAAS,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC3C,QAAA,GAAW,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC7C,MAAA,GAAS,IAAA,EAAM,MAAA,sBAA4B,OAAA;EAC3C,OAAA,GAAU,IAAA,EAAM,MAAA,sBAA4B,OAAA;AAAA;AAAA,KAGlC,sBAAA;EALmC,+EAO7C,MAAA,WAN2C;EAQ3C,OAAA;EACA,OAAA,GAAU,MAAM;AAAA;AAAA,iBASF,eAAA,CAAgB,OAAA,EAAS,sBAAA,YAAkC,SAAS"}
|
package/dist/client.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import ky from "ky";
|
|
2
|
+
//#region src/client.ts
|
|
3
|
+
const EXA_API_BASE = "https://api.exa.ai";
|
|
4
|
+
function resolveCreateExaClientOptions(options) {
|
|
5
|
+
return typeof options === "string" ? { apiKey: options } : options;
|
|
6
|
+
}
|
|
7
|
+
function createExaClient(options) {
|
|
8
|
+
const resolved = resolveCreateExaClientOptions(options);
|
|
9
|
+
const headers = {
|
|
10
|
+
"Content-Type": "application/json",
|
|
11
|
+
...resolved.headers
|
|
12
|
+
};
|
|
13
|
+
if (resolved.apiKey) headers["x-api-key"] = resolved.apiKey;
|
|
14
|
+
const api = ky.create({
|
|
15
|
+
prefix: `${(resolved.baseUrl ?? EXA_API_BASE).replace(/\/+$/, "")}/`,
|
|
16
|
+
headers
|
|
17
|
+
});
|
|
18
|
+
return {
|
|
19
|
+
search: (body) => api.post("search", { json: body }).json(),
|
|
20
|
+
contents: (body) => api.post("contents", { json: body }).json(),
|
|
21
|
+
answer: (body) => api.post("answer", { json: body }).json(),
|
|
22
|
+
context: (body) => api.post("context", { json: body }).json()
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
//#endregion
|
|
26
|
+
export { createExaClient };
|
|
27
|
+
|
|
28
|
+
//# sourceMappingURL=client.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.mjs","names":[],"sources":["../src/client.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 type CreateExaClientOptions = {\n /** Sent as x-api-key. Omit when using custom headers (e.g. platform proxy). */\n apiKey?: string;\n /** Defaults to https://api.exa.ai */\n baseUrl?: string;\n headers?: Record<string, string>;\n};\n\nfunction resolveCreateExaClientOptions(\n options: CreateExaClientOptions | string,\n): CreateExaClientOptions {\n return typeof options === \"string\" ? { apiKey: options } : options;\n}\n\nexport function createExaClient(options: CreateExaClientOptions | string): ExaClient {\n const resolved = resolveCreateExaClientOptions(options);\n const headers: Record<string, string> = {\n \"Content-Type\": \"application/json\",\n ...resolved.headers,\n };\n\n if (resolved.apiKey) {\n headers[\"x-api-key\"] = resolved.apiKey;\n }\n\n const api: KyInstance = ky.create({\n prefix: `${(resolved.baseUrl ?? EXA_API_BASE).replace(/\\/+$/, \"\")}/`,\n headers,\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"],"mappings":";;AAEA,MAAM,eAAe;AAiBrB,SAAS,8BACP,SACwB;CACxB,OAAO,OAAO,YAAY,WAAW,EAAE,QAAQ,QAAQ,IAAI;AAC7D;AAEA,SAAgB,gBAAgB,SAAqD;CACnF,MAAM,WAAW,8BAA8B,OAAO;CACtD,MAAM,UAAkC;EACtC,gBAAgB;EAChB,GAAG,SAAS;CACd;CAEA,IAAI,SAAS,QACX,QAAQ,eAAe,SAAS;CAGlC,MAAM,MAAkB,GAAG,OAAO;EAChC,QAAQ,IAAI,SAAS,WAAW,cAAc,QAAQ,QAAQ,EAAE,EAAE;EAClE;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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-BwCGHs6v.d.cts","names":[],"sources":["../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index-BwCGHs6v.d.cts","names":[],"sources":["../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"mappings":";;;cAKa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;cAYd,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAOf,SAAA,gCAAS,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;cCnBT,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;cAOnB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAOpB,cAAA,gCAAc,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCfd,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;cAYlB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;cAUnB,aAAA,gCAAa,wBAAA;;;;;;;;;;;;;;;;;;;;cCfb,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+Cd,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cAOf,SAAA,gCAAS,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCrDT,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmCxB,yBAAA,EAAyB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAazB,mBAAA,gCAAmB,wBAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-BwCGHs6v.d.mts","names":[],"sources":["../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index-BwCGHs6v.d.mts","names":[],"sources":["../src/actions/answer.ts","../src/actions/get-contents.ts","../src/actions/get-context.ts","../src/actions/search.ts","../src/actions/search-structured.ts"],"mappings":";;;cAKa,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;cAYd,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;cAOf,SAAA,gCAAS,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;cCnBT,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;cAOnB,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAOpB,cAAA,gCAAc,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCfd,kBAAA,EAAkB,CAAA,CAAA,SAAA;;;;cAYlB,mBAAA,EAAmB,CAAA,CAAA,SAAA;;;;;;;;;;;cAUnB,aAAA,gCAAa,wBAAA;;;;;;;;;;;;;;;;;;;;cCfb,cAAA,EAAc,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cA+Cd,eAAA,EAAe,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;cAOf,SAAA,gCAAS,wBAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cCrDT,wBAAA,EAAwB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAmCxB,yBAAA,EAAyB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAazB,mBAAA,gCAAmB,wBAAA"}
|
package/dist/index.cjs
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
3
|
-
const
|
|
2
|
+
const require_client = require("./client-DlwHA71b.cjs");
|
|
3
|
+
const require_app = require("./app-DMujvH6I.cjs");
|
|
4
|
+
const require_actions = require("./actions-LoQVlbiT.cjs");
|
|
4
5
|
const require_mcp = require("./mcp.cjs");
|
|
5
|
-
exports.createExaClient =
|
|
6
|
+
exports.createExaClient = require_client.createExaClient;
|
|
7
|
+
exports.exa = require_app.exa;
|
|
6
8
|
exports.exaAnswer = require_actions.exaAnswer;
|
|
7
|
-
exports.exaCredential =
|
|
9
|
+
exports.exaCredential = require_app.exaCredential;
|
|
8
10
|
exports.exaGetContents = require_actions.exaGetContents;
|
|
9
11
|
exports.exaGetContext = require_actions.exaGetContext;
|
|
10
12
|
exports.exaMcp = require_mcp.exaMcp;
|
package/dist/index.d.cts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { f as exaGetContents, h as exaAnswer, l as exaGetContext, o as exaSearch, r as exaSearchStructured } from "./index-BwCGHs6v.cjs";
|
|
2
|
+
import { CreateExaClientOptions, ExaClient, createExaClient } from "./client.cjs";
|
|
2
3
|
import { exaMcp, exaSearchMcp, exaWebsetsMcp } from "./mcp.cjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
|
|
5
|
-
//#region src/
|
|
6
|
+
//#region src/app.d.ts
|
|
7
|
+
/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */
|
|
8
|
+
declare const exa: import("@keystrokehq/app").App<import("@keystrokehq/shared").Credential<"exa", z.ZodObject<{
|
|
9
|
+
apiKey: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>>;
|
|
11
|
+
/** @deprecated Use `exa.credential`. */
|
|
6
12
|
declare const exaCredential: import("@keystrokehq/shared").Credential<"exa", z.ZodObject<{
|
|
7
13
|
apiKey: z.ZodString;
|
|
8
14
|
}, z.core.$strip>>;
|
|
9
15
|
//#endregion
|
|
10
|
-
|
|
11
|
-
type ExaClient = {
|
|
12
|
-
search: (body: Record<string, unknown>) => Promise<unknown>;
|
|
13
|
-
contents: (body: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
-
answer: (body: Record<string, unknown>) => Promise<unknown>;
|
|
15
|
-
context: (body: Record<string, unknown>) => Promise<unknown>;
|
|
16
|
-
};
|
|
17
|
-
declare function createExaClient(apiKey: string): ExaClient;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { type ExaClient, createExaClient, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
|
16
|
+
export { type CreateExaClientOptions, type ExaClient, createExaClient, exa, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
|
20
17
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/app.ts"],"mappings":";;;;;;;cAIa,GAAA,6BAAG,GAAA,+BAAA,UAAA,QAAA,CAAA,CAAA,SAAA;;;;cAOH,aAAA,gCAAa,UAAA,QAAA,CAAA,CAAA,SAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
1
|
import { f as exaGetContents, h as exaAnswer, l as exaGetContext, o as exaSearch, r as exaSearchStructured } from "./index-BwCGHs6v.mjs";
|
|
2
|
+
import { CreateExaClientOptions, ExaClient, createExaClient } from "./client.mjs";
|
|
2
3
|
import { exaMcp, exaSearchMcp, exaWebsetsMcp } from "./mcp.mjs";
|
|
3
4
|
import { z } from "zod";
|
|
4
5
|
|
|
5
|
-
//#region src/
|
|
6
|
+
//#region src/app.d.ts
|
|
7
|
+
/** Exa app — one static `apiKey` credential, actions defined via `exa.action(...)`. */
|
|
8
|
+
declare const exa: import("@keystrokehq/app").App<import("@keystrokehq/shared").Credential<"exa", z.ZodObject<{
|
|
9
|
+
apiKey: z.ZodString;
|
|
10
|
+
}, z.core.$strip>>>;
|
|
11
|
+
/** @deprecated Use `exa.credential`. */
|
|
6
12
|
declare const exaCredential: import("@keystrokehq/shared").Credential<"exa", z.ZodObject<{
|
|
7
13
|
apiKey: z.ZodString;
|
|
8
14
|
}, z.core.$strip>>;
|
|
9
15
|
//#endregion
|
|
10
|
-
|
|
11
|
-
type ExaClient = {
|
|
12
|
-
search: (body: Record<string, unknown>) => Promise<unknown>;
|
|
13
|
-
contents: (body: Record<string, unknown>) => Promise<unknown>;
|
|
14
|
-
answer: (body: Record<string, unknown>) => Promise<unknown>;
|
|
15
|
-
context: (body: Record<string, unknown>) => Promise<unknown>;
|
|
16
|
-
};
|
|
17
|
-
declare function createExaClient(apiKey: string): ExaClient;
|
|
18
|
-
//#endregion
|
|
19
|
-
export { type ExaClient, createExaClient, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
|
16
|
+
export { type CreateExaClientOptions, type ExaClient, createExaClient, exa, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
|
20
17
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/app.ts"],"mappings":";;;;;;;cAIa,GAAA,6BAAG,GAAA,+BAAA,UAAA,QAAA,CAAA,CAAA,SAAA;;;;cAOH,aAAA,gCAAa,UAAA,QAAA,CAAA,CAAA,SAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { n as exaCredential, t as exa } from "./app-CBLUruR0.mjs";
|
|
2
|
+
import { createExaClient } from "./client.mjs";
|
|
3
|
+
import { f as exaGetContents, h as exaAnswer, l as exaGetContext, o as exaSearch, r as exaSearchStructured } from "./actions-CJq1Nyt_.mjs";
|
|
3
4
|
import { exaMcp, exaSearchMcp, exaWebsetsMcp } from "./mcp.mjs";
|
|
4
|
-
export { createExaClient, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
|
5
|
+
export { createExaClient, exa, exaAnswer, exaCredential, exaGetContents, exaGetContext, exaMcp, exaSearch, exaSearchMcp, exaSearchStructured, exaWebsetsMcp };
|
package/dist/mcp.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
const
|
|
2
|
+
const require_app = require("./app-DMujvH6I.cjs");
|
|
3
3
|
let _keystrokehq_credentials = require("@keystrokehq/credentials");
|
|
4
4
|
//#region src/mcp.ts
|
|
5
5
|
const EXA_SEARCH_MCP_URL = "https://mcp.exa.ai/mcp";
|
|
@@ -16,7 +16,7 @@ const exaSearchMcp = (0, _keystrokehq_credentials.defineMcp)({
|
|
|
16
16
|
type: "http",
|
|
17
17
|
url: EXA_SEARCH_MCP_URL
|
|
18
18
|
},
|
|
19
|
-
credentials: [
|
|
19
|
+
credentials: [require_app.exa.credential],
|
|
20
20
|
auth: (credentials) => ({ headers: { "x-api-key": credentials.exa.apiKey } }),
|
|
21
21
|
declaredTools: [{
|
|
22
22
|
name: "web_search_exa",
|
|
@@ -38,7 +38,7 @@ const exaWebsetsMcp = (0, _keystrokehq_credentials.defineMcp)({
|
|
|
38
38
|
type: "http",
|
|
39
39
|
url: EXA_WEBSETS_MCP_URL
|
|
40
40
|
},
|
|
41
|
-
credentials: [
|
|
41
|
+
credentials: [require_app.exa.credential],
|
|
42
42
|
auth: (credentials) => ({ searchParams: { exaApiKey: credentials.exa.apiKey } }),
|
|
43
43
|
declaredTools: [{
|
|
44
44
|
name: "list_websets",
|
package/dist/mcp.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.cjs","names":["
|
|
1
|
+
{"version":3,"file":"mcp.cjs","names":["exa"],"sources":["../src/mcp.ts"],"sourcesContent":["import { defineMcp } from \"@keystrokehq/credentials\";\nimport { exa } from \"./app\";\n\nconst EXA_SEARCH_MCP_URL = \"https://mcp.exa.ai/mcp\";\nconst EXA_WEBSETS_MCP_URL = \"https://websetsmcp.exa.ai/mcp\";\n\nconst objectSchema = { type: \"object\", properties: {} } as const;\n\n/** [Exa Web Search MCP](https://exa.ai/docs/reference/exa-mcp) — `web_search_exa`, `web_fetch_exa`, etc. */\nexport const exaSearchMcp = defineMcp({\n key: \"exa\",\n name: \"Exa Search\",\n transport: { type: \"http\", url: EXA_SEARCH_MCP_URL },\n credentials: [exa.credential],\n auth: (credentials) => ({\n headers: { \"x-api-key\": credentials.exa.apiKey },\n }),\n declaredTools: [\n {\n name: \"web_search_exa\",\n title: \"Web Search\",\n description: \"Search the web using Exa.\",\n inputSchema: objectSchema,\n },\n {\n name: \"web_fetch_exa\",\n title: \"Web Fetch\",\n description: \"Fetch a page using Exa.\",\n inputSchema: objectSchema,\n },\n ],\n});\n\n/** [Exa Websets MCP](https://exa.ai/docs/reference/websets-mcp) — collections, enrichments, imports. */\nexport const exaWebsetsMcp = defineMcp({\n key: \"exa-websets\",\n name: \"Exa Websets\",\n transport: { type: \"http\", url: EXA_WEBSETS_MCP_URL },\n credentials: [exa.credential],\n auth: (credentials) => ({\n searchParams: { exaApiKey: credentials.exa.apiKey },\n }),\n declaredTools: [\n {\n name: \"list_websets\",\n title: \"List Websets\",\n description: \"List Exa websets.\",\n inputSchema: objectSchema,\n },\n ],\n});\n\n/** @deprecated Use {@link exaSearchMcp}. */\nexport const exaMcp = exaSearchMcp;\n"],"mappings":";;;;AAGA,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAE5B,MAAM,eAAe;CAAE,MAAM;CAAU,YAAY,CAAC;AAAE;;AAGtD,MAAa,gBAAA,GAAA,yBAAA,WAAyB;CACpC,KAAK;CACL,MAAM;CACN,WAAW;EAAE,MAAM;EAAQ,KAAK;CAAmB;CACnD,aAAa,CAACA,YAAAA,IAAI,UAAU;CAC5B,OAAO,iBAAiB,EACtB,SAAS,EAAE,aAAa,YAAY,IAAI,OAAO,EACjD;CACA,eAAe,CACb;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,GACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,CACF;AACF,CAAC;;AAGD,MAAa,iBAAA,GAAA,yBAAA,WAA0B;CACrC,KAAK;CACL,MAAM;CACN,WAAW;EAAE,MAAM;EAAQ,KAAK;CAAoB;CACpD,aAAa,CAACA,YAAAA,IAAI,UAAU;CAC5B,OAAO,iBAAiB,EACtB,cAAc,EAAE,WAAW,YAAY,IAAI,OAAO,EACpD;CACA,eAAe,CACb;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,CACF;AACF,CAAC;;AAGD,MAAa,SAAS"}
|
package/dist/mcp.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as
|
|
1
|
+
import { t as exa } from "./app-CBLUruR0.mjs";
|
|
2
2
|
import { defineMcp } from "@keystrokehq/credentials";
|
|
3
3
|
//#region src/mcp.ts
|
|
4
4
|
const EXA_SEARCH_MCP_URL = "https://mcp.exa.ai/mcp";
|
|
@@ -15,7 +15,7 @@ const exaSearchMcp = defineMcp({
|
|
|
15
15
|
type: "http",
|
|
16
16
|
url: EXA_SEARCH_MCP_URL
|
|
17
17
|
},
|
|
18
|
-
credentials: [
|
|
18
|
+
credentials: [exa.credential],
|
|
19
19
|
auth: (credentials) => ({ headers: { "x-api-key": credentials.exa.apiKey } }),
|
|
20
20
|
declaredTools: [{
|
|
21
21
|
name: "web_search_exa",
|
|
@@ -37,7 +37,7 @@ const exaWebsetsMcp = defineMcp({
|
|
|
37
37
|
type: "http",
|
|
38
38
|
url: EXA_WEBSETS_MCP_URL
|
|
39
39
|
},
|
|
40
|
-
credentials: [
|
|
40
|
+
credentials: [exa.credential],
|
|
41
41
|
auth: (credentials) => ({ searchParams: { exaApiKey: credentials.exa.apiKey } }),
|
|
42
42
|
declaredTools: [{
|
|
43
43
|
name: "list_websets",
|
package/dist/mcp.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcp.mjs","names":[],"sources":["../src/mcp.ts"],"sourcesContent":["import { defineMcp } from \"@keystrokehq/credentials\";\nimport {
|
|
1
|
+
{"version":3,"file":"mcp.mjs","names":[],"sources":["../src/mcp.ts"],"sourcesContent":["import { defineMcp } from \"@keystrokehq/credentials\";\nimport { exa } from \"./app\";\n\nconst EXA_SEARCH_MCP_URL = \"https://mcp.exa.ai/mcp\";\nconst EXA_WEBSETS_MCP_URL = \"https://websetsmcp.exa.ai/mcp\";\n\nconst objectSchema = { type: \"object\", properties: {} } as const;\n\n/** [Exa Web Search MCP](https://exa.ai/docs/reference/exa-mcp) — `web_search_exa`, `web_fetch_exa`, etc. */\nexport const exaSearchMcp = defineMcp({\n key: \"exa\",\n name: \"Exa Search\",\n transport: { type: \"http\", url: EXA_SEARCH_MCP_URL },\n credentials: [exa.credential],\n auth: (credentials) => ({\n headers: { \"x-api-key\": credentials.exa.apiKey },\n }),\n declaredTools: [\n {\n name: \"web_search_exa\",\n title: \"Web Search\",\n description: \"Search the web using Exa.\",\n inputSchema: objectSchema,\n },\n {\n name: \"web_fetch_exa\",\n title: \"Web Fetch\",\n description: \"Fetch a page using Exa.\",\n inputSchema: objectSchema,\n },\n ],\n});\n\n/** [Exa Websets MCP](https://exa.ai/docs/reference/websets-mcp) — collections, enrichments, imports. */\nexport const exaWebsetsMcp = defineMcp({\n key: \"exa-websets\",\n name: \"Exa Websets\",\n transport: { type: \"http\", url: EXA_WEBSETS_MCP_URL },\n credentials: [exa.credential],\n auth: (credentials) => ({\n searchParams: { exaApiKey: credentials.exa.apiKey },\n }),\n declaredTools: [\n {\n name: \"list_websets\",\n title: \"List Websets\",\n description: \"List Exa websets.\",\n inputSchema: objectSchema,\n },\n ],\n});\n\n/** @deprecated Use {@link exaSearchMcp}. */\nexport const exaMcp = exaSearchMcp;\n"],"mappings":";;;AAGA,MAAM,qBAAqB;AAC3B,MAAM,sBAAsB;AAE5B,MAAM,eAAe;CAAE,MAAM;CAAU,YAAY,CAAC;AAAE;;AAGtD,MAAa,eAAe,UAAU;CACpC,KAAK;CACL,MAAM;CACN,WAAW;EAAE,MAAM;EAAQ,KAAK;CAAmB;CACnD,aAAa,CAAC,IAAI,UAAU;CAC5B,OAAO,iBAAiB,EACtB,SAAS,EAAE,aAAa,YAAY,IAAI,OAAO,EACjD;CACA,eAAe,CACb;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,GACA;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,CACF;AACF,CAAC;;AAGD,MAAa,gBAAgB,UAAU;CACrC,KAAK;CACL,MAAM;CACN,WAAW;EAAE,MAAM;EAAQ,KAAK;CAAoB;CACpD,aAAa,CAAC,IAAI,UAAU;CAC5B,OAAO,iBAAiB,EACtB,cAAc,EAAE,WAAW,YAAY,IAAI,OAAO,EACpD;CACA,eAAe,CACb;EACE,MAAM;EACN,OAAO;EACP,aAAa;EACb,aAAa;CACf,CACF;AACF,CAAC;;AAGD,MAAa,SAAS"}
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@keystrokehq/exa",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
|
-
"url": "git+https://github.com/
|
|
6
|
+
"url": "git+https://github.com/keystrokehq/keystroke.git",
|
|
7
7
|
"directory": "packages/integrations/exa"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
@@ -15,19 +15,21 @@
|
|
|
15
15
|
"types": "./dist/index.d.mts",
|
|
16
16
|
"exports": {
|
|
17
17
|
".": {
|
|
18
|
-
"development": "./src/index.ts",
|
|
19
18
|
"types": "./dist/index.d.mts",
|
|
20
19
|
"import": "./dist/index.mjs",
|
|
21
20
|
"require": "./dist/index.cjs"
|
|
22
21
|
},
|
|
23
22
|
"./actions": {
|
|
24
|
-
"development": "./src/actions/index.ts",
|
|
25
23
|
"types": "./dist/actions/index.d.mts",
|
|
26
24
|
"import": "./dist/actions/index.mjs",
|
|
27
25
|
"require": "./dist/actions/index.cjs"
|
|
28
26
|
},
|
|
27
|
+
"./client": {
|
|
28
|
+
"types": "./dist/client.d.mts",
|
|
29
|
+
"import": "./dist/client.mjs",
|
|
30
|
+
"require": "./dist/client.cjs"
|
|
31
|
+
},
|
|
29
32
|
"./mcp": {
|
|
30
|
-
"development": "./src/mcp.ts",
|
|
31
33
|
"types": "./dist/mcp.d.mts",
|
|
32
34
|
"import": "./dist/mcp.mjs",
|
|
33
35
|
"require": "./dist/mcp.cjs"
|
|
@@ -40,7 +42,7 @@
|
|
|
40
42
|
"dependencies": {
|
|
41
43
|
"ky": "^2.0.2",
|
|
42
44
|
"zod": "^4.4.3",
|
|
43
|
-
"@keystrokehq/keystroke": "0.1.
|
|
45
|
+
"@keystrokehq/keystroke": "0.1.1"
|
|
44
46
|
},
|
|
45
47
|
"devDependencies": {
|
|
46
48
|
"@types/node": "^25.9.1",
|
|
@@ -48,10 +50,10 @@
|
|
|
48
50
|
"tsdown": "^0.22.0",
|
|
49
51
|
"typescript": "^6.0.3",
|
|
50
52
|
"vitest": "^4.1.7",
|
|
51
|
-
"@keystrokehq/oxlint-config": "0.0.
|
|
53
|
+
"@keystrokehq/oxlint-config": "0.0.4",
|
|
52
54
|
"@keystrokehq/tsconfig": "0.0.3",
|
|
53
55
|
"@keystrokehq/tsdown-config": "0.0.3",
|
|
54
|
-
"@keystrokehq/vitest-config": "0.0.
|
|
56
|
+
"@keystrokehq/vitest-config": "0.0.5"
|
|
55
57
|
},
|
|
56
58
|
"scripts": {
|
|
57
59
|
"build": "tsdown",
|
|
@@ -1 +0,0 @@
|
|
|
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,MA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AK,mBAAmB,MAAM;EAC1D,IAAI,MAAM,cAAc,KAAK,eAAe,MAAM;EAClD,IAAI,MAAM,mBAAmB,QAAQ,KAAK,oBAAoB,MAAM;EAEpE,MAAM,WAAW,oBAAoB;GACnC,YAAY,MAAM;GAClB,MAAM,MAAM;EACd,CAAC;EACD,IAAI,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"}
|
|
@@ -1 +0,0 @@
|
|
|
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,E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;EAC9D,IAAI,MAAM,gBAAgB,QAAQ,KAAK,iBAAiB,MAAM;EAC9D,IAAI,MAAM,oBAAoB,KAAK,qBAAqB,MAAM;EAC9D,IAAI,MAAM,kBAAkB,KAAK,mBAAmB,MAAM;EAC1D,IAAI,MAAM,cAAc,KAAK,eAAe,MAAM;EAClD,IAAI,MAAM,mBAAmB,QAAQ,KAAK,oBAAoB,MAAM;EAEpE,MAAM,WAAW,oBAAoB;GACnC,YAAY,MAAM;GAClB,MAAM,MAAM;EACd,CAAC;EACD,IAAI,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"}
|
|
@@ -1,16 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|
|
@@ -1,11 +0,0 @@
|
|
|
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
|
|
@@ -1 +0,0 @@
|
|
|
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"}
|