refactor(websearch): rename search domain
This commit is contained in:
parent
97aa6713b5
commit
c86f4e9b9b
51 changed files with 478 additions and 462 deletions
|
|
@ -1,7 +1,9 @@
|
|||
import type { ModelApi, ProviderApi } from "./api/api.js"
|
||||
import type { ModelApi, ProviderApi, WebsearchApi } from "./api/api.js"
|
||||
|
||||
export type * from "./api/api.js"
|
||||
|
||||
export type WebSearchApi<E = never> = WebsearchApi<E>
|
||||
|
||||
export interface CatalogApi<E = never> {
|
||||
readonly provider: ProviderApi<E>
|
||||
readonly model: ModelApi<E>
|
||||
|
|
|
|||
|
|
@ -923,33 +923,38 @@ export interface DebugApi<E = never> {
|
|||
readonly location: { readonly list: DebugLocationListOperation<E>; readonly evict: DebugLocationEvictOperation<E> }
|
||||
}
|
||||
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.search"]["search.provider.get"]>[0]
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.websearch"]["websearch.provider.get"]>[0]
|
||||
export type Endpoint26_0Input = { readonly location?: Endpoint26_0Request["query"]["location"] }
|
||||
export type Endpoint26_0Output = EffectValue<ReturnType<RawClient["server.search"]["search.provider.get"]>>
|
||||
export type SearchProviderGetOperation<E = never> = (input?: Endpoint26_0Input) => Effect.Effect<Endpoint26_0Output, E>
|
||||
export type Endpoint26_0Output = EffectValue<ReturnType<RawClient["server.websearch"]["websearch.provider.get"]>>
|
||||
export type WebsearchProviderGetOperation<E = never> = (
|
||||
input?: Endpoint26_0Input,
|
||||
) => Effect.Effect<Endpoint26_0Output, E>
|
||||
|
||||
type Endpoint26_1Request = Parameters<RawClient["server.search"]["search.provider.select"]>[0]
|
||||
type Endpoint26_1Request = Parameters<RawClient["server.websearch"]["websearch.provider.select"]>[0]
|
||||
export type Endpoint26_1Input = {
|
||||
readonly location?: Endpoint26_1Request["query"]["location"]
|
||||
readonly providerID: Endpoint26_1Request["payload"]["providerID"]
|
||||
}
|
||||
export type Endpoint26_1Output = EffectValue<ReturnType<RawClient["server.search"]["search.provider.select"]>>
|
||||
export type SearchProviderSelectOperation<E = never> = (
|
||||
export type Endpoint26_1Output = EffectValue<ReturnType<RawClient["server.websearch"]["websearch.provider.select"]>>
|
||||
export type WebsearchProviderSelectOperation<E = never> = (
|
||||
input: Endpoint26_1Input,
|
||||
) => Effect.Effect<Endpoint26_1Output, E>
|
||||
|
||||
type Endpoint26_2Request = Parameters<RawClient["server.search"]["search.query"]>[0]
|
||||
type Endpoint26_2Request = Parameters<RawClient["server.websearch"]["websearch.query"]>[0]
|
||||
export type Endpoint26_2Input = {
|
||||
readonly location?: Endpoint26_2Request["query"]["location"]
|
||||
readonly query: Endpoint26_2Request["payload"]["query"]
|
||||
readonly providerID?: Endpoint26_2Request["payload"]["providerID"]
|
||||
}
|
||||
export type Endpoint26_2Output = EffectValue<ReturnType<RawClient["server.search"]["search.query"]>>
|
||||
export type SearchQueryOperation<E = never> = (input: Endpoint26_2Input) => Effect.Effect<Endpoint26_2Output, E>
|
||||
export type Endpoint26_2Output = EffectValue<ReturnType<RawClient["server.websearch"]["websearch.query"]>>
|
||||
export type WebsearchQueryOperation<E = never> = (input: Endpoint26_2Input) => Effect.Effect<Endpoint26_2Output, E>
|
||||
|
||||
export interface SearchApi<E = never> {
|
||||
readonly provider: { readonly get: SearchProviderGetOperation<E>; readonly select: SearchProviderSelectOperation<E> }
|
||||
readonly query: SearchQueryOperation<E>
|
||||
export interface WebsearchApi<E = never> {
|
||||
readonly provider: {
|
||||
readonly get: WebsearchProviderGetOperation<E>
|
||||
readonly select: WebsearchProviderSelectOperation<E>
|
||||
}
|
||||
readonly query: WebsearchQueryOperation<E>
|
||||
}
|
||||
|
||||
export interface AppApi<E = never> {
|
||||
|
|
@ -979,5 +984,5 @@ export interface AppApi<E = never> {
|
|||
readonly projectCopy: ProjectCopyApi<E>
|
||||
readonly vcs: VcsApi<E>
|
||||
readonly debug: DebugApi<E>
|
||||
readonly search: SearchApi<E>
|
||||
readonly websearch: WebsearchApi<E>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1099,35 +1099,35 @@ const adaptGroup25 = (raw: RawClient["server.debug"]) => ({
|
|||
location: { list: Endpoint25_0(raw), evict: Endpoint25_1(raw) },
|
||||
})
|
||||
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.search"]["search.provider.get"]>[0]
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.websearch"]["websearch.provider.get"]>[0]
|
||||
type Endpoint26_0Input = { readonly location?: Endpoint26_0Request["query"]["location"] }
|
||||
const Endpoint26_0 = (raw: RawClient["server.search"]) => (input?: Endpoint26_0Input) =>
|
||||
raw["search.provider.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError))
|
||||
const Endpoint26_0 = (raw: RawClient["server.websearch"]) => (input?: Endpoint26_0Input) =>
|
||||
raw["websearch.provider.get"]({ query: { location: input?.["location"] } }).pipe(Effect.mapError(mapClientError))
|
||||
|
||||
type Endpoint26_1Request = Parameters<RawClient["server.search"]["search.provider.select"]>[0]
|
||||
type Endpoint26_1Request = Parameters<RawClient["server.websearch"]["websearch.provider.select"]>[0]
|
||||
type Endpoint26_1Input = {
|
||||
readonly location?: Endpoint26_1Request["query"]["location"]
|
||||
readonly providerID: Endpoint26_1Request["payload"]["providerID"]
|
||||
}
|
||||
const Endpoint26_1 = (raw: RawClient["server.search"]) => (input: Endpoint26_1Input) =>
|
||||
raw["search.provider.select"]({
|
||||
const Endpoint26_1 = (raw: RawClient["server.websearch"]) => (input: Endpoint26_1Input) =>
|
||||
raw["websearch.provider.select"]({
|
||||
query: { location: input["location"] },
|
||||
payload: { providerID: input["providerID"] },
|
||||
}).pipe(Effect.mapError(mapClientError))
|
||||
|
||||
type Endpoint26_2Request = Parameters<RawClient["server.search"]["search.query"]>[0]
|
||||
type Endpoint26_2Request = Parameters<RawClient["server.websearch"]["websearch.query"]>[0]
|
||||
type Endpoint26_2Input = {
|
||||
readonly location?: Endpoint26_2Request["query"]["location"]
|
||||
readonly query: Endpoint26_2Request["payload"]["query"]
|
||||
readonly providerID?: Endpoint26_2Request["payload"]["providerID"]
|
||||
}
|
||||
const Endpoint26_2 = (raw: RawClient["server.search"]) => (input: Endpoint26_2Input) =>
|
||||
raw["search.query"]({
|
||||
const Endpoint26_2 = (raw: RawClient["server.websearch"]) => (input: Endpoint26_2Input) =>
|
||||
raw["websearch.query"]({
|
||||
query: { location: input["location"] },
|
||||
payload: { query: input["query"], providerID: input["providerID"] },
|
||||
}).pipe(Effect.mapError(mapClientError))
|
||||
|
||||
const adaptGroup26 = (raw: RawClient["server.search"]) => ({
|
||||
const adaptGroup26 = (raw: RawClient["server.websearch"]) => ({
|
||||
provider: { get: Endpoint26_0(raw), select: Endpoint26_1(raw) },
|
||||
query: Endpoint26_2(raw),
|
||||
})
|
||||
|
|
@ -1159,7 +1159,7 @@ const adaptClient = (raw: RawClient) => ({
|
|||
projectCopy: adaptGroup23(raw["server.projectCopy"]),
|
||||
vcs: adaptGroup24(raw["server.vcs"]),
|
||||
debug: adaptGroup25(raw["server.debug"]),
|
||||
search: adaptGroup26(raw["server.search"]),
|
||||
websearch: adaptGroup26(raw["server.websearch"]),
|
||||
})
|
||||
|
||||
export const make = (options?: { readonly baseUrl?: URL | string }) =>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ export type {
|
|||
PluginApi,
|
||||
ProviderApi,
|
||||
ReferenceApi,
|
||||
SearchApi,
|
||||
WebSearchApi,
|
||||
SessionApi,
|
||||
SkillApi,
|
||||
} from "./api.js"
|
||||
|
|
@ -37,7 +37,7 @@ export { Provider } from "@opencode-ai/schema/provider"
|
|||
export { Pty } from "@opencode-ai/schema/pty"
|
||||
export { Question } from "@opencode-ai/schema/question"
|
||||
export { Reference } from "@opencode-ai/schema/reference"
|
||||
export { Search } from "@opencode-ai/schema/search"
|
||||
export { WebSearch } from "@opencode-ai/schema/websearch"
|
||||
export { AbsolutePath, RelativePath } from "@opencode-ai/schema/schema"
|
||||
export { Session } from "@opencode-ai/schema/session"
|
||||
export { SessionInput } from "@opencode-ai/schema/session-input"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue