refactor(search): isolate provider schemas

This commit is contained in:
Shoubhit Dash 2026-07-08 17:17:26 +05:30
commit 97aa6713b5
14 changed files with 151 additions and 227 deletions

View file

@ -2,16 +2,12 @@ export * as Search from "./search.js"
import { Schema } from "effect"
import { IntegrationID } from "./integration-id.js"
import { optional, PositiveInt } from "./schema.js"
import { optional } from "./schema.js"
export interface Input extends Schema.Schema.Type<typeof Input> {}
export const Input = Schema.Struct({
query: Schema.String,
providerID: IntegrationID.pipe(optional),
numResults: PositiveInt.check(Schema.isLessThanOrEqualTo(20)).pipe(optional),
livecrawl: Schema.Literals(["fallback", "preferred"]).pipe(optional),
type: Schema.Literals(["auto", "fast", "deep"]).pipe(optional),
contextMaxCharacters: PositiveInt.check(Schema.isLessThanOrEqualTo(50_000)).pipe(optional),
}).annotate({ identifier: "Search.Input" })
export interface ProviderOutput extends Schema.Schema.Type<typeof ProviderOutput> {}