feat(sdk): expose web search
This commit is contained in:
parent
56f44dbcaa
commit
66220071b5
17 changed files with 416 additions and 0 deletions
|
|
@ -887,6 +887,23 @@ export interface DebugApi<E = never> {
|
|||
readonly location: DebugLocationOperation<E>
|
||||
}
|
||||
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.search"]["search.query"]>[0]
|
||||
export type Endpoint26_0Input = {
|
||||
readonly location?: Endpoint26_0Request["query"]["location"]
|
||||
readonly query: Endpoint26_0Request["payload"]["query"]
|
||||
readonly providerID?: Endpoint26_0Request["payload"]["providerID"]
|
||||
readonly numResults?: Endpoint26_0Request["payload"]["numResults"]
|
||||
readonly livecrawl?: Endpoint26_0Request["payload"]["livecrawl"]
|
||||
readonly type?: Endpoint26_0Request["payload"]["type"]
|
||||
readonly contextMaxCharacters?: Endpoint26_0Request["payload"]["contextMaxCharacters"]
|
||||
}
|
||||
export type Endpoint26_0Output = EffectValue<ReturnType<RawClient["server.search"]["search.query"]>>
|
||||
export type SearchQueryOperation<E = never> = (input: Endpoint26_0Input) => Effect.Effect<Endpoint26_0Output, E>
|
||||
|
||||
export interface SearchApi<E = never> {
|
||||
readonly query: SearchQueryOperation<E>
|
||||
}
|
||||
|
||||
export interface AppApi<E = never> {
|
||||
readonly health: HealthApi<E>
|
||||
readonly location: LocationApi<E>
|
||||
|
|
@ -914,4 +931,5 @@ export interface AppApi<E = never> {
|
|||
readonly projectCopy: ProjectCopyApi<E>
|
||||
readonly vcs: VcsApi<E>
|
||||
readonly debug: DebugApi<E>
|
||||
readonly search: SearchApi<E>
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1066,6 +1066,31 @@ const Endpoint25_0 = (raw: RawClient["server.debug"]) => () =>
|
|||
|
||||
const adaptGroup25 = (raw: RawClient["server.debug"]) => ({ location: Endpoint25_0(raw) })
|
||||
|
||||
type Endpoint26_0Request = Parameters<RawClient["server.search"]["search.query"]>[0]
|
||||
type Endpoint26_0Input = {
|
||||
readonly location?: Endpoint26_0Request["query"]["location"]
|
||||
readonly query: Endpoint26_0Request["payload"]["query"]
|
||||
readonly providerID?: Endpoint26_0Request["payload"]["providerID"]
|
||||
readonly numResults?: Endpoint26_0Request["payload"]["numResults"]
|
||||
readonly livecrawl?: Endpoint26_0Request["payload"]["livecrawl"]
|
||||
readonly type?: Endpoint26_0Request["payload"]["type"]
|
||||
readonly contextMaxCharacters?: Endpoint26_0Request["payload"]["contextMaxCharacters"]
|
||||
}
|
||||
const Endpoint26_0 = (raw: RawClient["server.search"]) => (input: Endpoint26_0Input) =>
|
||||
raw["search.query"]({
|
||||
query: { location: input["location"] },
|
||||
payload: {
|
||||
query: input["query"],
|
||||
providerID: input["providerID"],
|
||||
numResults: input["numResults"],
|
||||
livecrawl: input["livecrawl"],
|
||||
type: input["type"],
|
||||
contextMaxCharacters: input["contextMaxCharacters"],
|
||||
},
|
||||
}).pipe(Effect.mapError(mapClientError))
|
||||
|
||||
const adaptGroup26 = (raw: RawClient["server.search"]) => ({ query: Endpoint26_0(raw) })
|
||||
|
||||
const adaptClient = (raw: RawClient) => ({
|
||||
health: adaptGroup0(raw["server.health"]),
|
||||
location: adaptGroup1(raw["server.location"]),
|
||||
|
|
@ -1093,6 +1118,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"]),
|
||||
})
|
||||
|
||||
export const make = (options?: { readonly baseUrl?: URL | string }) =>
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ export type {
|
|||
PluginApi,
|
||||
ProviderApi,
|
||||
ReferenceApi,
|
||||
SearchApi,
|
||||
SessionApi,
|
||||
SkillApi,
|
||||
} from "./api.js"
|
||||
|
|
@ -36,6 +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 { 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