mirror of
https://github.com/Heretek-AI/opencode.git
synced 2026-11-22 08:59:26 -10:00
24 lines
762 B
TypeScript
24 lines
762 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 | false | undefined
|
|
set(selection: string | false): void
|
|
}
|
|
}
|