Component evidence

endpoint (websearch/tavily.ts)

opencode · packages/core/src/plugin/websearch/tavily.ts · typescript · MIT
auth

Defines a websearch plugin that queries the Tavily API and returns search results.

Source preview first 800 characters · full source over MCP
// Source: https://github.com/anomalyco/opencode | License: MIT | Copyright 2025 opencode
// Provided via justclaw.it.com; keep this notice with the code.
export * as WebSearchTavily from "./tavily.js"

import { define } from "@opencode/plugin/effect/plugin"
import { Duration, Effect, Schema, Scope } from "effect"
import { HttpClient, HttpClientRequest, HttpClientResponse } from "effect/http"
import { App } from "../../app.js"
import { WebSearchProvider } from "./provider.js"

export const endpoint = "https://api.tavily.com/search"

const SearchRequest = Schema.Struct({
  query: Schema.String,
  search_depth: Schema.Literal("basic"),
  chunks_per_source: Schema.Number,
  max_results: Schema.Number,
})

const SearchResponse = Schema.Struct({
  results: Schema.Array(
    Schema.Struct({
    

... (truncated -- full source via MCP)