refactor(websearch): rename search domain
This commit is contained in:
parent
97aa6713b5
commit
c86f4e9b9b
51 changed files with 478 additions and 462 deletions
|
|
@ -18,7 +18,7 @@ export { Project } from "./project.js"
|
|||
export { ProjectCopy } from "./project-copy.js"
|
||||
export { Provider } from "./provider.js"
|
||||
export { Reference } from "./reference.js"
|
||||
export { Search } from "./search.js"
|
||||
export { WebSearch } from "./websearch.js"
|
||||
export { Session } from "./session.js"
|
||||
export { Vcs } from "./vcs.js"
|
||||
export { SessionInput } from "./session-input.js"
|
||||
|
|
|
|||
|
|
@ -76,10 +76,10 @@ export type Method = typeof Method.Type
|
|||
export const Inputs = Schema.Record(Schema.String, Schema.String).annotate({ identifier: "Integration.Inputs" })
|
||||
export type Inputs = typeof Inputs.Type
|
||||
|
||||
export interface Search extends Schema.Schema.Type<typeof Search> {}
|
||||
export const Search = Schema.Struct({
|
||||
export interface WebSearch extends Schema.Schema.Type<typeof WebSearch> {}
|
||||
export const WebSearch = Schema.Struct({
|
||||
connection: Schema.Literals(["optional", "required"]),
|
||||
}).annotate({ identifier: "Integration.Search" })
|
||||
}).annotate({ identifier: "Integration.WebSearch" })
|
||||
|
||||
const Updated = ephemeral({
|
||||
type: "integration.updated",
|
||||
|
|
@ -101,7 +101,7 @@ export class Info extends Schema.Class<Info>("Integration.Info")({
|
|||
id: ID,
|
||||
name: Schema.String,
|
||||
methods: Schema.Array(Method),
|
||||
search: optional(Search),
|
||||
websearch: optional(WebSearch),
|
||||
connections: Schema.Array(Connection.Info),
|
||||
}) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
export * as Search from "./search.js"
|
||||
export * as WebSearch from "./websearch.js"
|
||||
|
||||
import { Schema } from "effect"
|
||||
import { IntegrationID } from "./integration-id.js"
|
||||
|
|
@ -8,15 +8,15 @@ export interface Input extends Schema.Schema.Type<typeof Input> {}
|
|||
export const Input = Schema.Struct({
|
||||
query: Schema.String,
|
||||
providerID: IntegrationID.pipe(optional),
|
||||
}).annotate({ identifier: "Search.Input" })
|
||||
}).annotate({ identifier: "WebSearch.Input" })
|
||||
|
||||
export interface ProviderOutput extends Schema.Schema.Type<typeof ProviderOutput> {}
|
||||
export const ProviderOutput = Schema.Struct({
|
||||
text: Schema.String,
|
||||
metadata: Schema.Json.pipe(optional),
|
||||
}).annotate({ identifier: "Search.ProviderOutput" })
|
||||
}).annotate({ identifier: "WebSearch.ProviderOutput" })
|
||||
|
||||
export class Result extends Schema.Class<Result>("Search.Result")({
|
||||
export class Result extends Schema.Class<Result>("WebSearch.Result")({
|
||||
providerID: IntegrationID,
|
||||
...ProviderOutput.fields,
|
||||
}) {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue