mirror of
https://github.com/anomalyco/opencode.git
synced 2026-11-29 11:42:17 +00:00
23 lines
758 B
TypeScript
23 lines
758 B
TypeScript
import type { WebSearch } from "@opencode/schema/websearch"
|
|
import type { WebSearchApi } from "@opencode/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<WebSearchEditor>
|
|
readonly reload: () => Effect.Effect<void>
|
|
}
|
|
|
|
export interface WebSearchEditor {
|
|
add(definition: WebSearchDefinition): void
|
|
readonly default: {
|
|
get(): string | false | undefined
|
|
set(selection: string | false): void
|
|
}
|
|
}
|