From cd882b5a1781e9a8b7fff5f4b130aa49a045a6bc Mon Sep 17 00:00:00 2001 From: Waleed Latif Date: Fri, 10 Jul 2026 15:46:33 -0700 Subject: [PATCH] feat(context-dev): add Context.dev to hosted key rotation pool Wires all 22 context_dev tools into the same hosted-key mechanism as Exa: CONTEXT_DEV_API_KEY_COUNT/1..N rotation, BYOK provider registration, and hideWhenHosted on the block's API key field. Cost is read directly from each response's reported credits_consumed rather than estimated per endpoint. --- apps/sim/.env.example | 3 ++ .../settings/components/byok/byok.tsx | 9 ++++ apps/sim/blocks/blocks/context_dev.ts | 1 + apps/sim/lib/api/contracts/byok-keys.ts | 1 + apps/sim/tools/context_dev/classify_naics.ts | 3 ++ apps/sim/tools/context_dev/classify_sic.ts | 3 ++ apps/sim/tools/context_dev/crawl.ts | 3 ++ apps/sim/tools/context_dev/extract.ts | 3 ++ apps/sim/tools/context_dev/extract_product.ts | 3 ++ .../sim/tools/context_dev/extract_products.ts | 3 ++ apps/sim/tools/context_dev/get_brand.ts | 3 ++ .../tools/context_dev/get_brand_by_email.ts | 3 ++ .../tools/context_dev/get_brand_by_name.ts | 3 ++ .../tools/context_dev/get_brand_by_ticker.ts | 3 ++ .../tools/context_dev/get_brand_simplified.ts | 3 ++ apps/sim/tools/context_dev/hosting.test.ts | 54 +++++++++++++++++++ apps/sim/tools/context_dev/hosting.ts | 42 +++++++++++++++ .../tools/context_dev/identify_transaction.ts | 3 ++ apps/sim/tools/context_dev/map.ts | 3 ++ .../tools/context_dev/prefetch_by_email.ts | 3 ++ apps/sim/tools/context_dev/prefetch_domain.ts | 3 ++ apps/sim/tools/context_dev/scrape_fonts.ts | 3 ++ apps/sim/tools/context_dev/scrape_html.ts | 3 ++ apps/sim/tools/context_dev/scrape_images.ts | 3 ++ apps/sim/tools/context_dev/scrape_markdown.ts | 3 ++ .../tools/context_dev/scrape_styleguide.ts | 3 ++ apps/sim/tools/context_dev/screenshot.ts | 3 ++ apps/sim/tools/context_dev/search.ts | 3 ++ apps/sim/tools/types.ts | 1 + 29 files changed, 177 insertions(+) create mode 100644 apps/sim/tools/context_dev/hosting.test.ts create mode 100644 apps/sim/tools/context_dev/hosting.ts diff --git a/apps/sim/.env.example b/apps/sim/.env.example index 4536f8a8638..9366575fd54 100644 --- a/apps/sim/.env.example +++ b/apps/sim/.env.example @@ -77,6 +77,9 @@ API_ENCRYPTION_KEY=your_api_encryption_key # Use `openssl rand -hex 32` to gener # PEOPLEDATALABS_API_KEY_COUNT=2 # Number of People Data Labs keys for hosted PDL blocks # PEOPLEDATALABS_API_KEY_1= # People Data Labs API key #1 # PEOPLEDATALABS_API_KEY_2= # People Data Labs API key #2 +# CONTEXT_DEV_API_KEY_COUNT=2 # Number of Context.dev keys for hosted Context.dev blocks +# CONTEXT_DEV_API_KEY_1= # Context.dev API key #1 +# CONTEXT_DEV_API_KEY_2= # Context.dev API key #2 # File Storage (Optional - defaults to local disk; use S3 or Azure Blob for production) # AWS_REGION=us-east-1 # Required with S3_BUCKET_NAME to enable S3. Use "auto" for Cloudflare R2 diff --git a/apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx b/apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx index c365196abcd..41740182975 100644 --- a/apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx +++ b/apps/sim/app/workspace/[workspaceId]/settings/components/byok/byok.tsx @@ -6,6 +6,7 @@ import { AnthropicIcon, BasetenIcon, BrandfetchIcon, + ContextDevIcon, DatagmaIcon, DropcontactIcon, EnrowIcon, @@ -124,6 +125,13 @@ const PROVIDERS: (BYOKManagerProvider & { id: BYOKProviderId })[] = [ description: 'AI-powered search and research', placeholder: 'Enter your Exa API key', }, + { + id: 'context_dev', + name: 'Context.dev', + icon: ContextDevIcon, + description: 'Web scraping, crawling, search, and brand intelligence', + placeholder: 'Enter your Context.dev API key', + }, { id: 'serper', name: 'Serper', @@ -291,6 +299,7 @@ const PROVIDER_SECTIONS: BYOKProviderSection[] = [ ids: [ 'firecrawl', 'exa', + 'context_dev', 'serper', 'linkup', 'parallel_ai', diff --git a/apps/sim/blocks/blocks/context_dev.ts b/apps/sim/blocks/blocks/context_dev.ts index c96a0690d42..07e00d910f2 100644 --- a/apps/sim/blocks/blocks/context_dev.ts +++ b/apps/sim/blocks/blocks/context_dev.ts @@ -540,6 +540,7 @@ Do not include any explanations, markdown formatting, or other text outside the placeholder: 'Enter your Context.dev API key', password: true, required: true, + hideWhenHosted: true, }, ], tools: { diff --git a/apps/sim/lib/api/contracts/byok-keys.ts b/apps/sim/lib/api/contracts/byok-keys.ts index d9b8a561099..10a1d589123 100644 --- a/apps/sim/lib/api/contracts/byok-keys.ts +++ b/apps/sim/lib/api/contracts/byok-keys.ts @@ -14,6 +14,7 @@ export const byokProviderIdSchema = z.enum([ 'falai', 'firecrawl', 'exa', + 'context_dev', 'serper', 'linkup', 'perplexity', diff --git a/apps/sim/tools/context_dev/classify_naics.ts b/apps/sim/tools/context_dev/classify_naics.ts index 1386b672487..1b904f3d208 100644 --- a/apps/sim/tools/context_dev/classify_naics.ts +++ b/apps/sim/tools/context_dev/classify_naics.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevClassifyNaicsParams, ContextDevClassifyNaicsResponse, @@ -22,6 +23,8 @@ export const contextDevClassifyNaicsTool: ToolConfig< description: 'Classify a brand into NAICS industry codes from its domain or company name.', version: '1.0.0', + hosting: contextDevHosting(), + params: { input: { type: 'string', diff --git a/apps/sim/tools/context_dev/classify_sic.ts b/apps/sim/tools/context_dev/classify_sic.ts index a45b9ebb5d6..e0520eb536e 100644 --- a/apps/sim/tools/context_dev/classify_sic.ts +++ b/apps/sim/tools/context_dev/classify_sic.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevClassifySicParams, ContextDevClassifySicResponse, @@ -22,6 +23,8 @@ export const contextDevClassifySicTool: ToolConfig< description: 'Classify a brand into SIC industry codes from its domain or company name.', version: '1.0.0', + hosting: contextDevHosting(), + params: { input: { type: 'string', diff --git a/apps/sim/tools/context_dev/crawl.ts b/apps/sim/tools/context_dev/crawl.ts index 6184899363b..7e856c94324 100644 --- a/apps/sim/tools/context_dev/crawl.ts +++ b/apps/sim/tools/context_dev/crawl.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevCrawlParams, ContextDevCrawlResponse } from '@/tools/context_dev/types' import { CRAWL_RESULT_OUTPUT_PROPERTIES } from '@/tools/context_dev/types' import { @@ -15,6 +16,8 @@ export const contextDevCrawlTool: ToolConfig(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/extract.ts b/apps/sim/tools/context_dev/extract.ts index 21cefdb1e5d..b1cc03737dd 100644 --- a/apps/sim/tools/context_dev/extract.ts +++ b/apps/sim/tools/context_dev/extract.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevExtractParams, ContextDevExtractResponse } from '@/tools/context_dev/types' import { CONTEXT_DEV_BASE_URL, @@ -15,6 +16,8 @@ export const contextDevExtractTool: ToolConfig(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/extract_product.ts b/apps/sim/tools/context_dev/extract_product.ts index a70f39fa96f..bcda4f3ee0b 100644 --- a/apps/sim/tools/context_dev/extract_product.ts +++ b/apps/sim/tools/context_dev/extract_product.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevExtractProductParams, ContextDevExtractProductResponse, @@ -21,6 +22,8 @@ export const contextDevExtractProductTool: ToolConfig< description: 'Detect and extract structured product details from a single product page URL.', version: '1.0.0', + hosting: contextDevHosting(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/extract_products.ts b/apps/sim/tools/context_dev/extract_products.ts index aa22102a446..782f9b000f4 100644 --- a/apps/sim/tools/context_dev/extract_products.ts +++ b/apps/sim/tools/context_dev/extract_products.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevExtractProductsParams, ContextDevExtractProductsResponse, @@ -21,6 +22,8 @@ export const contextDevExtractProductsTool: ToolConfig< description: "Extract the product catalog from a brand's website by domain (beta).", version: '1.0.0', + hosting: contextDevHosting(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/get_brand.ts b/apps/sim/tools/context_dev/get_brand.ts index daffe65f08e..0715e0d4e01 100644 --- a/apps/sim/tools/context_dev/get_brand.ts +++ b/apps/sim/tools/context_dev/get_brand.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevBrandResponse, ContextDevGetBrandParams } from '@/tools/context_dev/types' import { BRAND_OUTPUT_PROPERTIES } from '@/tools/context_dev/types' import { @@ -18,6 +19,8 @@ export const contextDevGetBrandTool: ToolConfig(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/get_brand_by_email.ts b/apps/sim/tools/context_dev/get_brand_by_email.ts index e93fbacdfdf..e27f9faaa08 100644 --- a/apps/sim/tools/context_dev/get_brand_by_email.ts +++ b/apps/sim/tools/context_dev/get_brand_by_email.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevBrandResponse, ContextDevGetBrandByEmailParams, @@ -23,6 +24,8 @@ export const contextDevGetBrandByEmailTool: ToolConfig< 'Retrieve brand data from a work email address. Free/disposable emails are rejected (422).', version: '1.0.0', + hosting: contextDevHosting(), + params: { email: { type: 'string', diff --git a/apps/sim/tools/context_dev/get_brand_by_name.ts b/apps/sim/tools/context_dev/get_brand_by_name.ts index 78f8970e49e..e0b7c72c92a 100644 --- a/apps/sim/tools/context_dev/get_brand_by_name.ts +++ b/apps/sim/tools/context_dev/get_brand_by_name.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevBrandResponse, ContextDevGetBrandByNameParams, @@ -23,6 +24,8 @@ export const contextDevGetBrandByNameTool: ToolConfig< 'Retrieve brand data by company name: logos, colors, socials, address, and industry.', version: '1.0.0', + hosting: contextDevHosting(), + params: { name: { type: 'string', diff --git a/apps/sim/tools/context_dev/get_brand_by_ticker.ts b/apps/sim/tools/context_dev/get_brand_by_ticker.ts index ff0d92b4018..61e16fef7d1 100644 --- a/apps/sim/tools/context_dev/get_brand_by_ticker.ts +++ b/apps/sim/tools/context_dev/get_brand_by_ticker.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevBrandResponse, ContextDevGetBrandByTickerParams, @@ -22,6 +23,8 @@ export const contextDevGetBrandByTickerTool: ToolConfig< description: 'Retrieve brand data for a public company by its stock ticker symbol.', version: '1.0.0', + hosting: contextDevHosting(), + params: { ticker: { type: 'string', diff --git a/apps/sim/tools/context_dev/get_brand_simplified.ts b/apps/sim/tools/context_dev/get_brand_simplified.ts index f120104139c..1f01f0aa800 100644 --- a/apps/sim/tools/context_dev/get_brand_simplified.ts +++ b/apps/sim/tools/context_dev/get_brand_simplified.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevGetBrandSimplifiedParams, ContextDevGetBrandSimplifiedResponse, @@ -22,6 +23,8 @@ export const contextDevGetBrandSimplifiedTool: ToolConfig< description: 'Retrieve essential brand data for a domain: title, colors, logos, and backdrops.', version: '1.0.0', + hosting: contextDevHosting(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/hosting.test.ts b/apps/sim/tools/context_dev/hosting.test.ts new file mode 100644 index 00000000000..990205f5c9b --- /dev/null +++ b/apps/sim/tools/context_dev/hosting.test.ts @@ -0,0 +1,54 @@ +/** + * @vitest-environment node + */ +import { describe, expect, it } from 'vitest' +import { contextDevClassifyNaicsTool } from '@/tools/context_dev/classify_naics' +import { contextDevGetBrandTool } from '@/tools/context_dev/get_brand' +import { CONTEXT_DEV_CREDIT_USD } from '@/tools/context_dev/hosting' +import { contextDevScrapeMarkdownTool } from '@/tools/context_dev/scrape_markdown' +import { contextDevScreenshotTool } from '@/tools/context_dev/screenshot' +import type { ToolConfig } from '@/tools/types' + +function cost(tool: ToolConfig, params: any, output: Record) { + const pricing = tool.hosting?.pricing + if (!pricing || pricing.type !== 'custom') throw new Error('Expected custom pricing') + const result = pricing.getCost(params, output) + return typeof result === 'number' ? { cost: result } : result +} + +describe('Context.dev hosted key pricing', () => { + it('declares hosting with the shared env prefix and BYOK provider on every tool', () => { + for (const tool of [ + contextDevScrapeMarkdownTool, + contextDevScreenshotTool, + contextDevGetBrandTool, + contextDevClassifyNaicsTool, + ]) { + expect(tool.hosting?.envKeyPrefix).toBe('CONTEXT_DEV_API_KEY') + expect(tool.hosting?.byokProviderId).toBe('context_dev') + } + }) + + it('charges the reported credits at the per-credit rate for a 1-credit scrape', () => { + expect(cost(contextDevScrapeMarkdownTool, {}, { creditsConsumed: 1 }).cost).toBeCloseTo( + CONTEXT_DEV_CREDIT_USD + ) + }) + + it('charges the reported credits at the per-credit rate for a 5-credit screenshot', () => { + expect(cost(contextDevScreenshotTool, {}, { creditsConsumed: 5 }).cost).toBeCloseTo( + 5 * CONTEXT_DEV_CREDIT_USD + ) + }) + + it('charges the reported credits at the per-credit rate for a 10-credit brand lookup', () => { + expect(cost(contextDevGetBrandTool, {}, { creditsConsumed: 10 }).cost).toBeCloseTo( + 10 * CONTEXT_DEV_CREDIT_USD + ) + }) + + it('charges zero when the response has no credit accounting', () => { + expect(cost(contextDevClassifyNaicsTool, {}, { creditsConsumed: null }).cost).toBe(0) + expect(cost(contextDevClassifyNaicsTool, {}, {}).cost).toBe(0) + }) +}) diff --git a/apps/sim/tools/context_dev/hosting.ts b/apps/sim/tools/context_dev/hosting.ts new file mode 100644 index 00000000000..ef7d5912130 --- /dev/null +++ b/apps/sim/tools/context_dev/hosting.ts @@ -0,0 +1,42 @@ +import type { ToolHostingConfig } from '@/tools/types' + +/** + * Env var prefix for Context.dev hosted keys. Provide keys as + * `CONTEXT_DEV_API_KEY_COUNT` plus `CONTEXT_DEV_API_KEY_1..N`. + */ +export const CONTEXT_DEV_API_KEY_PREFIX = 'CONTEXT_DEV_API_KEY' + +/** + * Dollar cost of a single Context.dev credit. + * + * Estimated from the $25/month Developer plan (10,000 credits = $0.0025/credit) + * — https://www.context.dev/pricing. Endpoints cost 1, 5, or 10 credits + * depending on operation; actual usage is read from each response's + * `key_metadata.credits_consumed` rather than hardcoded per endpoint. + */ +export const CONTEXT_DEV_CREDIT_USD = 0.0025 + +/** + * Build a Context.dev `hosting` config. Every Context.dev response reports the + * exact credits consumed via `key_metadata.credits_consumed`, already surfaced + * on tool output as `creditsConsumed` by `extractCreditMetadata` — so cost is + * read directly from the response rather than estimated per endpoint. + */ +export function contextDevHosting

(): ToolHostingConfig

{ + return { + envKeyPrefix: CONTEXT_DEV_API_KEY_PREFIX, + apiKeyParam: 'apiKey', + byokProviderId: 'context_dev', + pricing: { + type: 'custom', + getCost: (_params, output) => { + const credits = (output.creditsConsumed as number | null) ?? 0 + return { cost: credits * CONTEXT_DEV_CREDIT_USD, metadata: { credits } } + }, + }, + rateLimit: { + mode: 'per_request', + requestsPerMinute: 60, + }, + } +} diff --git a/apps/sim/tools/context_dev/identify_transaction.ts b/apps/sim/tools/context_dev/identify_transaction.ts index 47cba312dce..c75b2fd156c 100644 --- a/apps/sim/tools/context_dev/identify_transaction.ts +++ b/apps/sim/tools/context_dev/identify_transaction.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevBrandResponse, ContextDevIdentifyTransactionParams, @@ -23,6 +24,8 @@ export const contextDevIdentifyTransactionTool: ToolConfig< 'Identify the brand behind a raw bank/card transaction descriptor and return its brand data.', version: '1.0.0', + hosting: contextDevHosting(), + params: { transactionInfo: { type: 'string', diff --git a/apps/sim/tools/context_dev/map.ts b/apps/sim/tools/context_dev/map.ts index 823d2de501b..d5e48ca9f3c 100644 --- a/apps/sim/tools/context_dev/map.ts +++ b/apps/sim/tools/context_dev/map.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevMapParams, ContextDevMapResponse } from '@/tools/context_dev/types' import { appendParam, @@ -15,6 +16,8 @@ export const contextDevMapTool: ToolConfig(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/prefetch_by_email.ts b/apps/sim/tools/context_dev/prefetch_by_email.ts index af0ed013cd6..5a682df6966 100644 --- a/apps/sim/tools/context_dev/prefetch_by_email.ts +++ b/apps/sim/tools/context_dev/prefetch_by_email.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevPrefetchByEmailParams, ContextDevPrefetchResponse, @@ -21,6 +22,8 @@ export const contextDevPrefetchByEmailTool: ToolConfig< "Queue an email's domain for brand-data prefetching to reduce later latency (subscribers; 0 credits). Free/disposable emails are rejected.", version: '1.0.0', + hosting: contextDevHosting(), + params: { email: { type: 'string', diff --git a/apps/sim/tools/context_dev/prefetch_domain.ts b/apps/sim/tools/context_dev/prefetch_domain.ts index 77d33d08520..32420195669 100644 --- a/apps/sim/tools/context_dev/prefetch_domain.ts +++ b/apps/sim/tools/context_dev/prefetch_domain.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevPrefetchDomainParams, ContextDevPrefetchResponse, @@ -21,6 +22,8 @@ export const contextDevPrefetchDomainTool: ToolConfig< 'Queue a domain for brand-data prefetching to reduce latency on later requests (subscribers; 0 credits).', version: '1.0.0', + hosting: contextDevHosting(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/scrape_fonts.ts b/apps/sim/tools/context_dev/scrape_fonts.ts index c64c676bf9e..343d3db7b34 100644 --- a/apps/sim/tools/context_dev/scrape_fonts.ts +++ b/apps/sim/tools/context_dev/scrape_fonts.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScrapeFontsParams, ContextDevScrapeFontsResponse, @@ -22,6 +23,8 @@ export const contextDevScrapeFontsTool: ToolConfig< description: 'Extract the font families, usage stats, and font files used by a domain.', version: '1.0.0', + hosting: contextDevHosting(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/scrape_html.ts b/apps/sim/tools/context_dev/scrape_html.ts index 672119e4d47..d72a215e3f8 100644 --- a/apps/sim/tools/context_dev/scrape_html.ts +++ b/apps/sim/tools/context_dev/scrape_html.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScrapeHtmlParams, ContextDevScrapeHtmlResponse, @@ -21,6 +22,8 @@ export const contextDevScrapeHtmlTool: ToolConfig< description: 'Scrape any URL and return the raw HTML content of the page.', version: '1.0.0', + hosting: contextDevHosting(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/scrape_images.ts b/apps/sim/tools/context_dev/scrape_images.ts index d2dfade8acb..3e9e6d35f4c 100644 --- a/apps/sim/tools/context_dev/scrape_images.ts +++ b/apps/sim/tools/context_dev/scrape_images.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScrapeImagesParams, ContextDevScrapeImagesResponse, @@ -22,6 +23,8 @@ export const contextDevScrapeImagesTool: ToolConfig< description: 'Discover every image asset on a page, with optional dimension and type enrichment.', version: '1.0.0', + hosting: contextDevHosting(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/scrape_markdown.ts b/apps/sim/tools/context_dev/scrape_markdown.ts index 8faed1c8a57..f6be766802a 100644 --- a/apps/sim/tools/context_dev/scrape_markdown.ts +++ b/apps/sim/tools/context_dev/scrape_markdown.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScrapeMarkdownParams, ContextDevScrapeMarkdownResponse, @@ -21,6 +22,8 @@ export const contextDevScrapeMarkdownTool: ToolConfig< description: 'Scrape any URL and return clean, LLM-ready markdown content.', version: '1.0.0', + hosting: contextDevHosting(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/scrape_styleguide.ts b/apps/sim/tools/context_dev/scrape_styleguide.ts index 3be34c35d44..dc5426ad537 100644 --- a/apps/sim/tools/context_dev/scrape_styleguide.ts +++ b/apps/sim/tools/context_dev/scrape_styleguide.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScrapeStyleguideParams, ContextDevScrapeStyleguideResponse, @@ -22,6 +23,8 @@ export const contextDevScrapeStyleguideTool: ToolConfig< "Extract a domain's design system: colors, typography, spacing, shadows, and UI components.", version: '1.0.0', + hosting: contextDevHosting(), + params: { domain: { type: 'string', diff --git a/apps/sim/tools/context_dev/screenshot.ts b/apps/sim/tools/context_dev/screenshot.ts index 130402a8023..1b071514647 100644 --- a/apps/sim/tools/context_dev/screenshot.ts +++ b/apps/sim/tools/context_dev/screenshot.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevScreenshotParams, ContextDevScreenshotResponse, @@ -47,6 +48,8 @@ export const contextDevScreenshotTool: ToolConfig< description: 'Capture a screenshot of any web page and store it as a downloadable image file.', version: '1.0.0', + hosting: contextDevHosting(), + params: { url: { type: 'string', diff --git a/apps/sim/tools/context_dev/search.ts b/apps/sim/tools/context_dev/search.ts index debfa0b546b..62c592025b7 100644 --- a/apps/sim/tools/context_dev/search.ts +++ b/apps/sim/tools/context_dev/search.ts @@ -1,3 +1,4 @@ +import { contextDevHosting } from '@/tools/context_dev/hosting' import type { ContextDevSearchParams, ContextDevSearchResponse } from '@/tools/context_dev/types' import { SEARCH_RESULT_OUTPUT_PROPERTIES } from '@/tools/context_dev/types' import { @@ -15,6 +16,8 @@ export const contextDevSearchTool: ToolConfig(), + params: { query: { type: 'string', diff --git a/apps/sim/tools/types.ts b/apps/sim/tools/types.ts index 910e825f251..fca1e60a443 100644 --- a/apps/sim/tools/types.ts +++ b/apps/sim/tools/types.ts @@ -15,6 +15,7 @@ export type BYOKProviderId = | 'falai' | 'firecrawl' | 'exa' + | 'context_dev' | 'serper' | 'jina' | 'perplexity'