context-dev-ai-tools 0.1.0
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/LICENSE +21 -0
- package/README.md +304 -0
- package/dist/index.cjs +289 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +5176 -0
- package/dist/index.d.ts +5176 -0
- package/dist/index.js +253 -0
- package/dist/index.js.map +1 -0
- package/package.json +64 -0
package/dist/index.js
ADDED
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
// src/tools/search.ts
|
|
2
|
+
import { tool } from "ai";
|
|
3
|
+
import { z } from "zod";
|
|
4
|
+
|
|
5
|
+
// src/client.ts
|
|
6
|
+
import { ContextDev, AuthenticationError, RateLimitError } from "context.dev";
|
|
7
|
+
function createClient(config = {}) {
|
|
8
|
+
return new ContextDev({
|
|
9
|
+
apiKey: config.apiKey,
|
|
10
|
+
baseURL: config.baseURL
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async function callContext(fn) {
|
|
14
|
+
try {
|
|
15
|
+
return await fn();
|
|
16
|
+
} catch (err) {
|
|
17
|
+
if (err instanceof RateLimitError) {
|
|
18
|
+
throw new Error(
|
|
19
|
+
"context.dev rate limit reached. Wait before retrying, reduce request frequency, or upgrade your plan."
|
|
20
|
+
);
|
|
21
|
+
}
|
|
22
|
+
if (err instanceof AuthenticationError) {
|
|
23
|
+
throw new Error(
|
|
24
|
+
"context.dev authentication failed. Check that CONTEXT_DEV_API_KEY is set to a valid key."
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
throw err;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/tools/search.ts
|
|
32
|
+
var inputSchema = z.object({
|
|
33
|
+
query: z.string().describe(
|
|
34
|
+
"Search query. Accepts natural language as well as Google-style operators such as site:, -site:, inurl:, intitle:, quoted phrases, and OR."
|
|
35
|
+
),
|
|
36
|
+
numResults: z.number().int().min(10).max(100).optional().describe("Number of results to request (10-100). Defaults to 10."),
|
|
37
|
+
freshness: z.enum(["last_24_hours", "last_week", "last_month", "last_year"]).optional().describe("Restrict results to content published within this window."),
|
|
38
|
+
includeDomains: z.array(z.string()).optional().describe('Allowlist domains, e.g. ["arxiv.org", "github.com"].'),
|
|
39
|
+
excludeDomains: z.array(z.string()).optional().describe('Blocklist domains, e.g. ["pinterest.com"].'),
|
|
40
|
+
country: z.string().length(2).optional().describe("Two-letter ISO 3166-1 alpha-2 country code to localize results, e.g. 'us', 'gb', 'de'.")
|
|
41
|
+
});
|
|
42
|
+
var contextSearch = (config = {}) => {
|
|
43
|
+
const client = createClient(config);
|
|
44
|
+
return tool({
|
|
45
|
+
description: "Search the live web and get back structured results (title, url, snippet) using context.dev's real-time search index.",
|
|
46
|
+
inputSchema,
|
|
47
|
+
execute: async ({ country, ...rest }) => callContext(
|
|
48
|
+
() => client.web.search({ ...rest, country })
|
|
49
|
+
)
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
// src/tools/scrape.ts
|
|
54
|
+
import { tool as tool2 } from "ai";
|
|
55
|
+
import { z as z2 } from "zod";
|
|
56
|
+
var inputSchema2 = z2.object({
|
|
57
|
+
url: z2.string().url().describe("Full URL to scrape into LLM-usable Markdown (must include http:// or https://)."),
|
|
58
|
+
includeImages: z2.boolean().optional().describe("Include image references in the Markdown output."),
|
|
59
|
+
includeLinks: z2.boolean().optional().describe("Preserve hyperlinks in the Markdown output."),
|
|
60
|
+
useMainContentOnly: z2.boolean().optional().default(true).describe("Strip navigation, ads, and boilerplate, keeping only the main article/content region.")
|
|
61
|
+
});
|
|
62
|
+
var contextScrape = (config = {}) => {
|
|
63
|
+
const client = createClient(config);
|
|
64
|
+
return tool2({
|
|
65
|
+
description: "Scrape a single URL and return clean Markdown with navigation and ads stripped, ready for LLM context.",
|
|
66
|
+
inputSchema: inputSchema2,
|
|
67
|
+
execute: async (input) => callContext(() => client.web.webScrapeMd(input))
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/tools/crawl.ts
|
|
72
|
+
import { tool as tool3 } from "ai";
|
|
73
|
+
import { z as z3 } from "zod";
|
|
74
|
+
var inputSchema3 = z3.object({
|
|
75
|
+
url: z3.string().url().describe("The starting URL for the crawl (must include http:// or https://)."),
|
|
76
|
+
maxPages: z3.number().int().min(1).max(500).optional().default(10).describe(
|
|
77
|
+
"Maximum number of pages to crawl. Defaults to 10 and is capped here well below the API's own ceiling \u2014 crawling is credit-metered per page, so an agent should not be able to trigger a large crawl without the caller raising this explicitly."
|
|
78
|
+
),
|
|
79
|
+
maxDepth: z3.number().int().min(0).max(10).optional().describe("Maximum link depth from the starting URL (0 = only the starting page). No limit if omitted."),
|
|
80
|
+
urlRegex: z3.string().optional().describe("Only crawl URLs matching this regular expression."),
|
|
81
|
+
followSubdomains: z3.boolean().optional().describe("When true, also follow links on subdomains of the starting URL's domain.")
|
|
82
|
+
});
|
|
83
|
+
var contextCrawl = (config = {}) => {
|
|
84
|
+
const client = createClient(config);
|
|
85
|
+
return tool3({
|
|
86
|
+
description: "Crawl a website starting from a URL and return clean Markdown for every reachable page, up to the given limits.",
|
|
87
|
+
inputSchema: inputSchema3,
|
|
88
|
+
execute: async (input) => callContext(() => client.web.webCrawlMd(input))
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
// src/tools/sitemap.ts
|
|
93
|
+
import { tool as tool4 } from "ai";
|
|
94
|
+
import { z as z4 } from "zod";
|
|
95
|
+
var inputSchema4 = z4.object({
|
|
96
|
+
domain: z4.string().describe("Domain to build/discover a sitemap for, e.g. 'example.com'."),
|
|
97
|
+
search: z4.string().optional().describe("Optional search phrase; the sitemap is filtered to pages whose URLs are about that phrase, most relevant first."),
|
|
98
|
+
urlRegex: z4.string().optional().describe("Only return URLs matching this regular expression."),
|
|
99
|
+
maxLinks: z4.number().int().min(1).max(1e5).optional().describe("Maximum number of links to return. Defaults to 10,000.")
|
|
100
|
+
});
|
|
101
|
+
var contextSitemap = (config = {}) => {
|
|
102
|
+
const client = createClient(config);
|
|
103
|
+
return tool4({
|
|
104
|
+
description: "Discover a website's URLs via its sitemap, optionally filtered by a search phrase or regex. Useful for planning a crawl before running contextCrawl.",
|
|
105
|
+
inputSchema: inputSchema4,
|
|
106
|
+
execute: async (input) => callContext(() => client.web.webScrapeSitemap(input))
|
|
107
|
+
});
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// src/tools/extract.ts
|
|
111
|
+
import { tool as tool5 } from "ai";
|
|
112
|
+
import { z as z5 } from "zod";
|
|
113
|
+
var inputSchema5 = z5.object({
|
|
114
|
+
url: z5.string().url().describe("The starting website URL to crawl and extract structured data from (must include http:// or https://)."),
|
|
115
|
+
schema: z5.record(z5.string(), z5.unknown()).describe(
|
|
116
|
+
"A JSON Schema object (not a Zod schema) describing the shape of data to extract, e.g. { type: 'object', properties: { price: { type: 'number' } } }."
|
|
117
|
+
),
|
|
118
|
+
instructions: z5.string().optional().describe("Optional natural-language instructions to guide the extraction."),
|
|
119
|
+
factCheck: z5.boolean().optional().describe("When true, every returned value must be grounded in facts stated on the page; ungrounded fields come back null/empty.")
|
|
120
|
+
});
|
|
121
|
+
var contextExtract = (config = {}) => {
|
|
122
|
+
const client = createClient(config);
|
|
123
|
+
return tool5({
|
|
124
|
+
description: "Extract structured data from a URL according to a JSON Schema you provide.",
|
|
125
|
+
inputSchema: inputSchema5,
|
|
126
|
+
execute: async (input) => callContext(() => client.web.extract(input))
|
|
127
|
+
});
|
|
128
|
+
};
|
|
129
|
+
|
|
130
|
+
// src/tools/screenshot.ts
|
|
131
|
+
import { tool as tool6 } from "ai";
|
|
132
|
+
import { z as z6 } from "zod";
|
|
133
|
+
var inputSchema6 = z6.object({
|
|
134
|
+
domain: z6.string().optional().describe("Domain to screenshot, e.g. 'example.com'. Provide exactly one of domain or directUrl."),
|
|
135
|
+
directUrl: z6.string().url().optional().describe("A specific URL to screenshot directly. Provide exactly one of domain or directUrl."),
|
|
136
|
+
fullScreenshot: z6.boolean().optional().describe("Capture the full scrollable page instead of just the viewport."),
|
|
137
|
+
colorScheme: z6.enum(["light", "dark"]).optional().describe("Force the site's light or dark visual theme before capture."),
|
|
138
|
+
clearPopups: z6.boolean().optional().describe("Dismiss detected cookie/consent banners and other obstructive overlays before capture.")
|
|
139
|
+
}).refine((v) => v.domain ? !v.directUrl : !!v.directUrl, {
|
|
140
|
+
message: "Provide exactly one of `domain` or `directUrl`."
|
|
141
|
+
});
|
|
142
|
+
var contextScreenshot = (config = {}) => {
|
|
143
|
+
const client = createClient(config);
|
|
144
|
+
return tool6({
|
|
145
|
+
description: "Capture a screenshot of a webpage (full page or viewport) and return an image URL.",
|
|
146
|
+
inputSchema: inputSchema6,
|
|
147
|
+
execute: async ({ domain, directUrl, fullScreenshot, ...rest }) => callContext(
|
|
148
|
+
() => client.web.screenshot({
|
|
149
|
+
...rest,
|
|
150
|
+
...domain ? { domain } : { directUrl },
|
|
151
|
+
...fullScreenshot !== void 0 && {
|
|
152
|
+
fullScreenshot: fullScreenshot ? "true" : "false"
|
|
153
|
+
}
|
|
154
|
+
})
|
|
155
|
+
)
|
|
156
|
+
});
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
// src/tools/brand.ts
|
|
160
|
+
import { tool as tool7 } from "ai";
|
|
161
|
+
import { z as z7 } from "zod";
|
|
162
|
+
var inputSchema7 = z7.object({
|
|
163
|
+
domain: z7.string().describe("Domain to retrieve brand data for, e.g. 'stripe.com'."),
|
|
164
|
+
maxSpeed: z7.boolean().optional().describe("When true, skip time-consuming operations for a faster response at the cost of less comprehensive data.")
|
|
165
|
+
});
|
|
166
|
+
var contextBrand = (config = {}) => {
|
|
167
|
+
const client = createClient(config);
|
|
168
|
+
return tool7({
|
|
169
|
+
description: "Look up a company's brand profile by domain \u2014 logo, colors, description, social profiles, and industry classification. Only the domain lookup variant is exposed; the underlying API also supports lookup by name/email/ticker.",
|
|
170
|
+
inputSchema: inputSchema7,
|
|
171
|
+
execute: async ({ domain, maxSpeed }) => callContext(() => client.brand.retrieve({ domain, type: "by_domain", maxSpeed }))
|
|
172
|
+
});
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
// src/tools/news.ts
|
|
176
|
+
import { tool as tool8 } from "ai";
|
|
177
|
+
import { z as z8 } from "zod";
|
|
178
|
+
var inputSchema8 = z8.object({
|
|
179
|
+
entity: z8.string().describe("The company to search news for \u2014 a name, domain, or stock ticker, matching `entityType`."),
|
|
180
|
+
entityType: z8.enum(["name", "domain", "ticker"]).optional().default("name").describe("How to interpret `entity`. Defaults to 'name'."),
|
|
181
|
+
limit: z8.number().int().min(1).max(50).optional().describe("Maximum articles to return. Defaults to 10."),
|
|
182
|
+
sortBy: z8.enum(["relevance", "newest"]).optional().describe("Result ordering. Defaults to 'newest'.")
|
|
183
|
+
});
|
|
184
|
+
var contextNews = (config = {}) => {
|
|
185
|
+
const client = createClient(config);
|
|
186
|
+
return tool8({
|
|
187
|
+
description: "Search recent news articles about a company, identified by name, domain, or stock ticker.",
|
|
188
|
+
inputSchema: inputSchema8,
|
|
189
|
+
execute: async ({ entity, entityType, limit, sortBy }) => callContext(
|
|
190
|
+
() => client.news.search({
|
|
191
|
+
searchBy: {
|
|
192
|
+
type: "entity",
|
|
193
|
+
entity: entityType === "domain" ? { type: "domain", domain: entity } : entityType === "ticker" ? { type: "ticker", ticker: entity } : { type: "name", name: entity }
|
|
194
|
+
},
|
|
195
|
+
limit,
|
|
196
|
+
sortBy: sortBy ? { type: sortBy } : void 0
|
|
197
|
+
})
|
|
198
|
+
)
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// src/tools/parse.ts
|
|
203
|
+
import { tool as tool9 } from "ai";
|
|
204
|
+
import { toFile } from "context.dev";
|
|
205
|
+
import { z as z9 } from "zod";
|
|
206
|
+
var inputSchema9 = z9.object({
|
|
207
|
+
fileBase64: z9.string().describe("The document's raw bytes, base64-encoded."),
|
|
208
|
+
extension: z9.string().optional().describe("File extension hint, e.g. 'pdf', 'docx', 'xlsx', 'pptx', 'html', 'csv'. Helps the parser pick the right strategy."),
|
|
209
|
+
includeImages: z9.boolean().optional().describe("Include image references in the Markdown output."),
|
|
210
|
+
includeLinks: z9.boolean().optional().describe("Preserve hyperlinks in the Markdown output."),
|
|
211
|
+
ocr: z9.boolean().optional().describe("For PDFs, OCR pages that have no usable text layer (scans) instead of skipping them.")
|
|
212
|
+
});
|
|
213
|
+
var contextParse = (config = {}) => {
|
|
214
|
+
const client = createClient(config);
|
|
215
|
+
return tool9({
|
|
216
|
+
description: "Parse an uploaded document (PDF, DOCX, PPTX, XLSX, HTML, CSV, and more) into clean Markdown.",
|
|
217
|
+
inputSchema: inputSchema9,
|
|
218
|
+
execute: async ({ fileBase64, extension, ...rest }) => callContext(
|
|
219
|
+
async () => client.parse.handle(await toFile(Buffer.from(fileBase64, "base64")), {
|
|
220
|
+
...rest,
|
|
221
|
+
extension
|
|
222
|
+
})
|
|
223
|
+
)
|
|
224
|
+
});
|
|
225
|
+
};
|
|
226
|
+
|
|
227
|
+
// src/index.ts
|
|
228
|
+
function contextTools(config = {}) {
|
|
229
|
+
return {
|
|
230
|
+
contextSearch: contextSearch(config),
|
|
231
|
+
contextScrape: contextScrape(config),
|
|
232
|
+
contextCrawl: contextCrawl(config),
|
|
233
|
+
contextSitemap: contextSitemap(config),
|
|
234
|
+
contextExtract: contextExtract(config),
|
|
235
|
+
contextScreenshot: contextScreenshot(config),
|
|
236
|
+
contextBrand: contextBrand(config),
|
|
237
|
+
contextNews: contextNews(config),
|
|
238
|
+
contextParse: contextParse(config)
|
|
239
|
+
};
|
|
240
|
+
}
|
|
241
|
+
export {
|
|
242
|
+
contextBrand,
|
|
243
|
+
contextCrawl,
|
|
244
|
+
contextExtract,
|
|
245
|
+
contextNews,
|
|
246
|
+
contextParse,
|
|
247
|
+
contextScrape,
|
|
248
|
+
contextScreenshot,
|
|
249
|
+
contextSearch,
|
|
250
|
+
contextSitemap,
|
|
251
|
+
contextTools
|
|
252
|
+
};
|
|
253
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/tools/search.ts","../src/client.ts","../src/tools/scrape.ts","../src/tools/crawl.ts","../src/tools/sitemap.ts","../src/tools/extract.ts","../src/tools/screenshot.ts","../src/tools/brand.ts","../src/tools/news.ts","../src/tools/parse.ts","../src/index.ts"],"sourcesContent":["import { tool } from \"ai\";\nimport type { WebSearchParams } from \"context.dev/resources/web\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n query: z\n .string()\n .describe(\n \"Search query. Accepts natural language as well as Google-style operators such as site:, -site:, inurl:, intitle:, quoted phrases, and OR.\",\n ),\n numResults: z.number().int().min(10).max(100).optional().describe(\"Number of results to request (10-100). Defaults to 10.\"),\n freshness: z\n .enum([\"last_24_hours\", \"last_week\", \"last_month\", \"last_year\"])\n .optional()\n .describe(\"Restrict results to content published within this window.\"),\n includeDomains: z.array(z.string()).optional().describe('Allowlist domains, e.g. [\"arxiv.org\", \"github.com\"].'),\n excludeDomains: z.array(z.string()).optional().describe('Blocklist domains, e.g. [\"pinterest.com\"].'),\n country: z\n .string()\n .length(2)\n .optional()\n .describe(\"Two-letter ISO 3166-1 alpha-2 country code to localize results, e.g. 'us', 'gb', 'de'.\"),\n});\n\nexport const contextSearch = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Search the live web and get back structured results (title, url, snippet) using context.dev's real-time search index.\",\n inputSchema,\n execute: async ({ country, ...rest }) =>\n callContext(() =>\n client.web.search({ ...rest, country: country as WebSearchParams[\"country\"] }),\n ),\n });\n};\n","import { ContextDev, AuthenticationError, RateLimitError } from \"context.dev\";\nimport type { ContextToolConfig } from \"./types.js\";\n\nexport function createClient(config: ContextToolConfig = {}): ContextDev {\n return new ContextDev({\n apiKey: config.apiKey,\n baseURL: config.baseURL,\n });\n}\n\n/**\n * Runs a context.dev SDK call and rewraps the two error types an agent can\n * plausibly self-correct from mid-run with an actionable message. Every other\n * error is left to throw as-is: the AI SDK catches thrown errors from `execute`\n * automatically and surfaces them to the model as a tool-error step, so no\n * broad try/catch belongs here.\n */\nexport async function callContext<T>(fn: () => Promise<T>): Promise<T> {\n try {\n return await fn();\n } catch (err) {\n if (err instanceof RateLimitError) {\n throw new Error(\n \"context.dev rate limit reached. Wait before retrying, reduce request frequency, or upgrade your plan.\",\n );\n }\n if (err instanceof AuthenticationError) {\n throw new Error(\n \"context.dev authentication failed. Check that CONTEXT_DEV_API_KEY is set to a valid key.\",\n );\n }\n throw err;\n }\n}\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n url: z.string().url().describe(\"Full URL to scrape into LLM-usable Markdown (must include http:// or https://).\"),\n includeImages: z.boolean().optional().describe(\"Include image references in the Markdown output.\"),\n includeLinks: z.boolean().optional().describe(\"Preserve hyperlinks in the Markdown output.\"),\n useMainContentOnly: z\n .boolean()\n .optional()\n .default(true)\n .describe(\"Strip navigation, ads, and boilerplate, keeping only the main article/content region.\"),\n});\n\nexport const contextScrape = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Scrape a single URL and return clean Markdown with navigation and ads stripped, ready for LLM context.\",\n inputSchema,\n execute: async (input) => callContext(() => client.web.webScrapeMd(input)),\n });\n};\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n url: z.string().url().describe(\"The starting URL for the crawl (must include http:// or https://).\"),\n maxPages: z\n .number()\n .int()\n .min(1)\n .max(500)\n .optional()\n .default(10)\n .describe(\n \"Maximum number of pages to crawl. Defaults to 10 and is capped here well below the API's own ceiling — crawling is credit-metered per page, so an agent should not be able to trigger a large crawl without the caller raising this explicitly.\",\n ),\n maxDepth: z\n .number()\n .int()\n .min(0)\n .max(10)\n .optional()\n .describe(\"Maximum link depth from the starting URL (0 = only the starting page). No limit if omitted.\"),\n urlRegex: z.string().optional().describe(\"Only crawl URLs matching this regular expression.\"),\n followSubdomains: z\n .boolean()\n .optional()\n .describe(\"When true, also follow links on subdomains of the starting URL's domain.\"),\n});\n\nexport const contextCrawl = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Crawl a website starting from a URL and return clean Markdown for every reachable page, up to the given limits.\",\n inputSchema,\n execute: async (input) => callContext(() => client.web.webCrawlMd(input)),\n });\n};\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n domain: z.string().describe(\"Domain to build/discover a sitemap for, e.g. 'example.com'.\"),\n search: z\n .string()\n .optional()\n .describe(\"Optional search phrase; the sitemap is filtered to pages whose URLs are about that phrase, most relevant first.\"),\n urlRegex: z.string().optional().describe(\"Only return URLs matching this regular expression.\"),\n maxLinks: z\n .number()\n .int()\n .min(1)\n .max(100_000)\n .optional()\n .describe(\"Maximum number of links to return. Defaults to 10,000.\"),\n});\n\nexport const contextSitemap = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Discover a website's URLs via its sitemap, optionally filtered by a search phrase or regex. Useful for planning a crawl before running contextCrawl.\",\n inputSchema,\n execute: async (input) => callContext(() => client.web.webScrapeSitemap(input)),\n });\n};\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n url: z.string().url().describe(\"The starting website URL to crawl and extract structured data from (must include http:// or https://).\"),\n schema: z\n .record(z.string(), z.unknown())\n .describe(\n \"A JSON Schema object (not a Zod schema) describing the shape of data to extract, e.g. { type: 'object', properties: { price: { type: 'number' } } }.\",\n ),\n instructions: z.string().optional().describe(\"Optional natural-language instructions to guide the extraction.\"),\n factCheck: z\n .boolean()\n .optional()\n .describe(\"When true, every returned value must be grounded in facts stated on the page; ungrounded fields come back null/empty.\"),\n});\n\nexport const contextExtract = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Extract structured data from a URL according to a JSON Schema you provide.\",\n inputSchema,\n execute: async (input) => callContext(() => client.web.extract(input)),\n });\n};\n","import { tool } from \"ai\";\nimport type { WebScreenshotParams } from \"context.dev/resources/web\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z\n .object({\n domain: z.string().optional().describe(\"Domain to screenshot, e.g. 'example.com'. Provide exactly one of domain or directUrl.\"),\n directUrl: z.string().url().optional().describe(\"A specific URL to screenshot directly. Provide exactly one of domain or directUrl.\"),\n fullScreenshot: z.boolean().optional().describe(\"Capture the full scrollable page instead of just the viewport.\"),\n colorScheme: z.enum([\"light\", \"dark\"]).optional().describe(\"Force the site's light or dark visual theme before capture.\"),\n clearPopups: z.boolean().optional().describe(\"Dismiss detected cookie/consent banners and other obstructive overlays before capture.\"),\n })\n .refine((v) => (v.domain ? !v.directUrl : !!v.directUrl), {\n message: \"Provide exactly one of `domain` or `directUrl`.\",\n });\n\nexport const contextScreenshot = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Capture a screenshot of a webpage (full page or viewport) and return an image URL.\",\n inputSchema,\n execute: async ({ domain, directUrl, fullScreenshot, ...rest }) =>\n callContext(() =>\n client.web.screenshot({\n ...rest,\n ...(domain ? { domain } : { directUrl }),\n ...(fullScreenshot !== undefined && {\n fullScreenshot: (fullScreenshot ? \"true\" : \"false\") satisfies WebScreenshotParams[\"fullScreenshot\"],\n }),\n }),\n ),\n });\n};\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n domain: z.string().describe(\"Domain to retrieve brand data for, e.g. 'stripe.com'.\"),\n maxSpeed: z\n .boolean()\n .optional()\n .describe(\"When true, skip time-consuming operations for a faster response at the cost of less comprehensive data.\"),\n});\n\nexport const contextBrand = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description:\n \"Look up a company's brand profile by domain — logo, colors, description, social profiles, and industry classification. Only the domain lookup variant is exposed; the underlying API also supports lookup by name/email/ticker.\",\n inputSchema,\n execute: async ({ domain, maxSpeed }) =>\n callContext(() => client.brand.retrieve({ domain, type: \"by_domain\", maxSpeed })),\n });\n};\n","import { tool } from \"ai\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n entity: z.string().describe(\"The company to search news for — a name, domain, or stock ticker, matching `entityType`.\"),\n entityType: z\n .enum([\"name\", \"domain\", \"ticker\"])\n .optional()\n .default(\"name\")\n .describe(\"How to interpret `entity`. Defaults to 'name'.\"),\n limit: z.number().int().min(1).max(50).optional().describe(\"Maximum articles to return. Defaults to 10.\"),\n sortBy: z.enum([\"relevance\", \"newest\"]).optional().describe(\"Result ordering. Defaults to 'newest'.\"),\n});\n\nexport const contextNews = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Search recent news articles about a company, identified by name, domain, or stock ticker.\",\n inputSchema,\n execute: async ({ entity, entityType, limit, sortBy }) =>\n callContext(() =>\n client.news.search({\n searchBy: {\n type: \"entity\",\n entity:\n entityType === \"domain\"\n ? { type: \"domain\", domain: entity }\n : entityType === \"ticker\"\n ? { type: \"ticker\", ticker: entity }\n : { type: \"name\", name: entity },\n },\n limit,\n sortBy: sortBy ? { type: sortBy } : undefined,\n }),\n ),\n });\n};\n","import { tool } from \"ai\";\nimport { toFile } from \"context.dev\";\nimport type { ParseHandleParams } from \"context.dev/resources/parse\";\nimport { z } from \"zod\";\nimport { createClient, callContext } from \"../client.js\";\nimport type { ContextToolConfig } from \"../types.js\";\n\nconst inputSchema = z.object({\n fileBase64: z.string().describe(\"The document's raw bytes, base64-encoded.\"),\n extension: z\n .string()\n .optional()\n .describe(\"File extension hint, e.g. 'pdf', 'docx', 'xlsx', 'pptx', 'html', 'csv'. Helps the parser pick the right strategy.\"),\n includeImages: z.boolean().optional().describe(\"Include image references in the Markdown output.\"),\n includeLinks: z.boolean().optional().describe(\"Preserve hyperlinks in the Markdown output.\"),\n ocr: z\n .boolean()\n .optional()\n .describe(\"For PDFs, OCR pages that have no usable text layer (scans) instead of skipping them.\"),\n});\n\nexport const contextParse = (config: ContextToolConfig = {}) => {\n const client = createClient(config);\n return tool({\n description: \"Parse an uploaded document (PDF, DOCX, PPTX, XLSX, HTML, CSV, and more) into clean Markdown.\",\n inputSchema,\n execute: async ({ fileBase64, extension, ...rest }) =>\n callContext(async () =>\n client.parse.handle(await toFile(Buffer.from(fileBase64, \"base64\")), {\n ...rest,\n extension: extension as ParseHandleParams[\"extension\"],\n }),\n ),\n });\n};\n","import { contextSearch } from \"./tools/search.js\";\nimport { contextScrape } from \"./tools/scrape.js\";\nimport { contextCrawl } from \"./tools/crawl.js\";\nimport { contextSitemap } from \"./tools/sitemap.js\";\nimport { contextExtract } from \"./tools/extract.js\";\nimport { contextScreenshot } from \"./tools/screenshot.js\";\nimport { contextBrand } from \"./tools/brand.js\";\nimport { contextNews } from \"./tools/news.js\";\nimport { contextParse } from \"./tools/parse.js\";\nimport type { ContextToolConfig } from \"./types.js\";\n\nexport { contextSearch } from \"./tools/search.js\";\nexport { contextScrape } from \"./tools/scrape.js\";\nexport { contextCrawl } from \"./tools/crawl.js\";\nexport { contextSitemap } from \"./tools/sitemap.js\";\nexport { contextExtract } from \"./tools/extract.js\";\nexport { contextScreenshot } from \"./tools/screenshot.js\";\nexport { contextBrand } from \"./tools/brand.js\";\nexport { contextNews } from \"./tools/news.js\";\nexport { contextParse } from \"./tools/parse.js\";\nexport type { ContextToolConfig } from \"./types.js\";\n\n/**\n * Convenience bundle of every tool in this package, ready to spread into an\n * AI SDK `tools` object: `tools: { ...contextTools() }`.\n */\nexport function contextTools(config: ContextToolConfig = {}) {\n return {\n contextSearch: contextSearch(config),\n contextScrape: contextScrape(config),\n contextCrawl: contextCrawl(config),\n contextSitemap: contextSitemap(config),\n contextExtract: contextExtract(config),\n contextScreenshot: contextScreenshot(config),\n contextBrand: contextBrand(config),\n contextNews: contextNews(config),\n contextParse: contextParse(config),\n };\n}\n"],"mappings":";AAAA,SAAS,YAAY;AAErB,SAAS,SAAS;;;ACFlB,SAAS,YAAY,qBAAqB,sBAAsB;AAGzD,SAAS,aAAa,SAA4B,CAAC,GAAe;AACvE,SAAO,IAAI,WAAW;AAAA,IACpB,QAAQ,OAAO;AAAA,IACf,SAAS,OAAO;AAAA,EAClB,CAAC;AACH;AASA,eAAsB,YAAe,IAAkC;AACrE,MAAI;AACF,WAAO,MAAM,GAAG;AAAA,EAClB,SAAS,KAAK;AACZ,QAAI,eAAe,gBAAgB;AACjC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,QAAI,eAAe,qBAAqB;AACtC,YAAM,IAAI;AAAA,QACR;AAAA,MACF;AAAA,IACF;AACA,UAAM;AAAA,EACR;AACF;;;AD3BA,IAAM,cAAc,EAAE,OAAO;AAAA,EAC3B,OAAO,EACJ,OAAO,EACP;AAAA,IACC;AAAA,EACF;AAAA,EACF,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE,IAAI,GAAG,EAAE,SAAS,EAAE,SAAS,wDAAwD;AAAA,EAC1H,WAAW,EACR,KAAK,CAAC,iBAAiB,aAAa,cAAc,WAAW,CAAC,EAC9D,SAAS,EACT,SAAS,2DAA2D;AAAA,EACvE,gBAAgB,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,SAAS,EAAE,SAAS,sDAAsD;AAAA,EAC9G,gBAAgB,EA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AK,YAAY,QAAQ,CAAC,GAAG;AAAA,QACnE,GAAG;AAAA,QACH;AAAA,MACF,CAAC;AAAA,IACH;AAAA,EACJ,CAAC;AACH;;;ACRO,SAAS,aAAa,SAA4B,CAAC,GAAG;AAC3D,SAAO;AAAA,IACL,eAAe,cAAc,MAAM;AAAA,IACnC,eAAe,cAAc,MAAM;AAAA,IACnC,cAAc,aAAa,MAAM;AAAA,IACjC,gBAAgB,eAAe,MAAM;AAAA,IACrC,gBAAgB,eAAe,MAAM;AAAA,IACrC,mBAAmB,kBAAkB,MAAM;AAAA,IAC3C,cAAc,aAAa,MAAM;AAAA,IACjC,aAAa,YAAY,MAAM;AAAA,IAC/B,cAAc,aAAa,MAAM;AAAA,EACnC;AACF;","names":["tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool","tool","z","inputSchema","z","tool"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "context-dev-ai-tools",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Community-built Vercel AI SDK tools for the context.dev web data API (unofficial).",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"main": "./dist/index.cjs",
|
|
8
|
+
"module": "./dist/index.js",
|
|
9
|
+
"types": "./dist/index.d.ts",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"import": {
|
|
13
|
+
"types": "./dist/index.d.ts",
|
|
14
|
+
"default": "./dist/index.js"
|
|
15
|
+
},
|
|
16
|
+
"require": {
|
|
17
|
+
"types": "./dist/index.d.cts",
|
|
18
|
+
"default": "./dist/index.cjs"
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"files": [
|
|
23
|
+
"dist"
|
|
24
|
+
],
|
|
25
|
+
"sideEffects": false,
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "tsup",
|
|
31
|
+
"typecheck": "tsc --noEmit",
|
|
32
|
+
"test": "vitest run",
|
|
33
|
+
"test:watch": "vitest",
|
|
34
|
+
"example:smoke": "tsx examples/smoke.ts",
|
|
35
|
+
"prepublishOnly": "npm run build"
|
|
36
|
+
},
|
|
37
|
+
"keywords": [
|
|
38
|
+
"ai",
|
|
39
|
+
"ai-sdk",
|
|
40
|
+
"vercel-ai-sdk",
|
|
41
|
+
"context.dev",
|
|
42
|
+
"web-scraping",
|
|
43
|
+
"agent-tools",
|
|
44
|
+
"llm-tools"
|
|
45
|
+
],
|
|
46
|
+
"dependencies": {
|
|
47
|
+
"context.dev": "^2.14.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"ai": "^5.0.0 || ^6.0.0 || ^7.0.0",
|
|
51
|
+
"zod": "^3.25.76 || ^4.1.8"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@ai-sdk/anthropic": "^4.0.46",
|
|
55
|
+
"@types/node": "^22.10.0",
|
|
56
|
+
"ai": "^7.0.85",
|
|
57
|
+
"dotenv": "^16.4.7",
|
|
58
|
+
"tsup": "^8.3.5",
|
|
59
|
+
"tsx": "^4.19.2",
|
|
60
|
+
"typescript": "^5.7.2",
|
|
61
|
+
"vitest": "^4.1.11",
|
|
62
|
+
"zod": "^4.5.4"
|
|
63
|
+
}
|
|
64
|
+
}
|