refactor(schema): tighten public contracts (#33771)

This commit is contained in:
Kit Langton 2026-06-25 19:10:23 +02:00 committed by GitHub
commit 9e9d405d7e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
49 changed files with 759 additions and 897 deletions

View file

@ -1,6 +1,7 @@
export * as FileSystem from "./filesystem"
import { Schema } from "effect"
import { optional } from "./schema"
import { define, inventory } from "./event"
import { NonNegativeInt, PositiveInt, RelativePath } from "./schema"
@ -21,7 +22,7 @@ export const Submatch = Schema.Struct({
text: Schema.String,
start: NonNegativeInt,
end: NonNegativeInt,
})
}).annotate({ identifier: "FileSystem.Submatch" })
export interface Match extends Schema.Schema.Type<typeof Match> {}
export const Match = Schema.Struct({
@ -34,6 +35,6 @@ export const Match = Schema.Struct({
export class FindInput extends Schema.Class<FindInput>("FileSystem.FindInput")({
query: Schema.String,
type: Schema.Literals(["file", "directory"]).pipe(Schema.optional),
limit: PositiveInt.pipe(Schema.optional),
type: Schema.Literals(["file", "directory"]).pipe(optional),
limit: PositiveInt.pipe(optional),
}) {}