WebService — provided by @deepseek-ai/dsh-web.
The web access service. Registered as ctx.web (one instance per context).
Selection semantics (resolved at execution time, never order-dependent):
available() → that provider.WEB_PROVIDER_CONFIGURED_MISSING.WEB_PROVIDER_CONFIGURED_UNAVAILABLE.WEB_PROVIDER_AMBIGUOUS.WEB_PROVIDER_UNAVAILABLE.registerSearchProvider(provider: WebSearchProvider): () => void
Register a search provider. Throws WebError WEB_DUPLICATE_PROVIDER if its id is already registered for search. Returns a disposer; disposed with the calling fiber.
provider — the provider; its id is the registry key.Returns the disposer that unregisters the provider.
registerFetchProvider(provider: WebFetchProvider): () => void
Register a fetch provider. Throws WebError WEB_DUPLICATE_PROVIDER if its id is already registered for fetch. Returns a disposer; disposed with the calling fiber.
provider — the provider; its id is the registry key.Returns the disposer that unregisters the provider.
async search(request: WebSearchRequest, signal?: AbortSignal): Promise<WebSearchResult>
Run one search through the selected provider. Resolves the provider at call time with the selection rules above; throws WebError when the capability cannot run. The seam enforces request.maxResults on the result: if the provider over-returns, sources[] is truncated and truncated set.
request — the query plus result-shaping options.signal — optional cancellation signal forwarded to the provider.Returns the provider's results, capped to request.maxResults.
async fetch(request: WebFetchRequest, signal?: AbortSignal): Promise<WebFetchResult>
Retrieve one URL through the selected provider. Resolves the provider at call time with the selection rules above; throws WebError when the capability cannot run. A non-2xx response is a result, not a throw.
request — the URL plus retrieval options.signal — optional cancellation signal forwarded to the provider.Returns the retrieval outcome; non-2xx responses resolve descriptively.