Introduce web access as a first-class capability seam so the model-facing web tools stay stable while backends change. dsh-web owns ctx.web as a provider registry with registration-order-independent selection and the WebError taxonomy; dsh-web-search-exa, dsh-web-search-perplexity, and dsh-web-fetch-local register capabilities into it; dsh-tool-web is the sole owner of the model-facing web_search/web_fetch schemas, prompt sections, and HTML-to-markdown presentation. Search and fetch are deliberately one seam. Providers ship as namespace plugins that register into ctx.web (like an LlmAdapter into ctx.llm), not key-owning services, since multiple search providers cannot each own the key. Tool registration follows product enablement, not backend availability, so load order/credentials never enter the model contract; the seam resolves the provider at execution time and surfaces a structured WebError otherwise. Moves the RFC to implemented/ amended to match what shipped. Example/app configs are intentionally not wired yet (RFC migration step 6).
20 lines
935 B
TypeScript
20 lines
935 B
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { ExaSearchProvider, EXA_DEFAULT_BASE_URL } from '@deepseek-ai/dsh-web-search-exa'
|
|
|
|
/**
|
|
* Real-API smoke for the Exa search provider. Self-skips without `$EXA_API_KEY`
|
|
* (CI has no secrets), per the with-key e2e policy in AGENTS.md § Secrets.
|
|
*/
|
|
const apiKey = process.env.EXA_API_KEY
|
|
const maybe = apiKey !== undefined && apiKey.length > 0 ? describe : describe.skip
|
|
|
|
maybe('ExaSearchProvider real API', () => {
|
|
it('returns sources for a live query', async () => {
|
|
const provider = new ExaSearchProvider({ apiKey: apiKey!, baseURL: process.env.EXA_BASE_URL ?? EXA_DEFAULT_BASE_URL })
|
|
const result = await provider.search({ query: 'DeepSeek coding agent', maxResults: 5 })
|
|
expect(result.providerId).toBe('exa')
|
|
expect(result.sources.length).toBeGreaterThan(0)
|
|
for (const source of result.sources) expect(source.url).toMatch(/^https?:\/\//)
|
|
}, 30_000)
|
|
})
|