refactor(websearch): rename search domain
This commit is contained in:
parent
97aa6713b5
commit
c86f4e9b9b
51 changed files with 478 additions and 462 deletions
|
|
@ -10,7 +10,7 @@ import type {
|
|||
IntegrationRef,
|
||||
} from "@opencode-ai/sdk/v2/types"
|
||||
import type { IntegrationApi } from "@opencode-ai/client/effect/api"
|
||||
import type { Search } from "@opencode-ai/schema/search"
|
||||
import type { WebSearch } from "@opencode-ai/schema/websearch"
|
||||
import type { Effect, Scope } from "effect"
|
||||
import type { Registration, Transform } from "./registration.js"
|
||||
|
||||
|
|
@ -53,19 +53,19 @@ export type IntegrationOAuthMethodDefinition = IntegrationOAuthMethod & {
|
|||
|
||||
export type IntegrationMethodDefinition = IntegrationOAuthMethodDefinition | IntegrationKeyMethod | IntegrationEnvMethod
|
||||
|
||||
export interface IntegrationSearchDefinition {
|
||||
export interface IntegrationWebSearchDefinition {
|
||||
readonly connection: "optional" | "required"
|
||||
readonly execute: (
|
||||
input: Search.Input,
|
||||
input: WebSearch.Input,
|
||||
context: { readonly credential?: CredentialValue; readonly sessionID?: string },
|
||||
) => Effect.Effect<Search.ProviderOutput, unknown>
|
||||
) => Effect.Effect<WebSearch.ProviderOutput, unknown>
|
||||
}
|
||||
|
||||
export interface IntegrationDefinition {
|
||||
readonly id: string
|
||||
readonly name: string
|
||||
readonly methods?: readonly IntegrationMethodDefinition[]
|
||||
readonly search?: IntegrationSearchDefinition
|
||||
readonly websearch?: IntegrationWebSearchDefinition
|
||||
}
|
||||
|
||||
export interface IntegrationDraft {
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ import type {
|
|||
IntegrationKeyMethod,
|
||||
IntegrationOAuthMethod,
|
||||
} from "@opencode-ai/sdk/v2/types"
|
||||
import type { Search } from "@opencode-ai/schema/search"
|
||||
import type { WebSearch } from "@opencode-ai/schema/websearch"
|
||||
import type { Registration, Transform } from "./registration.js"
|
||||
|
||||
export type { IntegrationDraft, IntegrationMethodRegistration }
|
||||
|
|
@ -35,19 +35,19 @@ export type IntegrationOAuthMethodDefinition = IntegrationOAuthMethod & {
|
|||
|
||||
export type IntegrationMethodDefinition = IntegrationOAuthMethodDefinition | IntegrationKeyMethod | IntegrationEnvMethod
|
||||
|
||||
export interface IntegrationSearchDefinition {
|
||||
export interface IntegrationWebSearchDefinition {
|
||||
readonly connection: "optional" | "required"
|
||||
readonly execute: (
|
||||
input: Search.Input,
|
||||
input: WebSearch.Input,
|
||||
context: { readonly credential?: CredentialValue; readonly sessionID?: string; readonly signal: AbortSignal },
|
||||
) => Promise<Search.ProviderOutput>
|
||||
) => Promise<WebSearch.ProviderOutput>
|
||||
}
|
||||
|
||||
export interface IntegrationDefinition {
|
||||
readonly id: string
|
||||
readonly name: string
|
||||
readonly methods?: readonly IntegrationMethodDefinition[]
|
||||
readonly search?: IntegrationSearchDefinition
|
||||
readonly websearch?: IntegrationWebSearchDefinition
|
||||
}
|
||||
|
||||
export interface IntegrationDomain extends IntegrationApi {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue