mirror of
https://github.com/anomalyco/opencode.git
synced 2026-08-10 00:33:22 +00:00
23 lines
747 B
TypeScript
23 lines
747 B
TypeScript
import type { WebSearch } from "@opencode-ai/schema/websearch"
|
|
import type { WebsearchApi } from "@opencode-ai/client/effect/api"
|
|
import type { Effect } from "effect"
|
|
import type { Transform } from "./registration.js"
|
|
|
|
export interface WebSearchDefinition {
|
|
readonly id: string
|
|
readonly name: string
|
|
readonly execute: (input: WebSearch.ProviderInput) => Effect.Effect<readonly WebSearch.Result[], unknown>
|
|
}
|
|
|
|
export interface WebSearchDomain extends WebsearchApi<unknown> {
|
|
readonly transform: Transform<WebSearchDraft>
|
|
readonly reload: () => Effect.Effect<void>
|
|
}
|
|
|
|
export interface WebSearchDraft {
|
|
add(definition: WebSearchDefinition): void
|
|
readonly default: {
|
|
get(): string | undefined
|
|
set(providerID: string): void
|
|
}
|
|
}
|