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 Revert from "./revert"
import { Schema } from "effect"
import { optional } from "./schema"
import { NonNegativeInt, RelativePath } from "./schema"
import { SessionMessage } from "./session-message"
@ -11,13 +12,13 @@ export const FileDiff = Schema.Struct({
deletions: NonNegativeInt,
patch: Schema.String,
}).annotate({ identifier: "File.Diff" })
export type FileDiff = typeof FileDiff.Type
export interface FileDiff extends Schema.Schema.Type<typeof FileDiff> {}
export const State = Schema.Struct({
messageID: SessionMessage.ID,
partID: Schema.String.pipe(Schema.optional),
snapshot: Schema.String.pipe(Schema.optional),
diff: Schema.String.pipe(Schema.optional),
files: Schema.Array(FileDiff).pipe(Schema.optional),
})
export type State = typeof State.Type
partID: Schema.String.pipe(optional),
snapshot: Schema.String.pipe(optional),
diff: Schema.String.pipe(optional),
files: Schema.Array(FileDiff).pipe(optional),
}).annotate({ identifier: "Revert.State" })
export interface State extends Schema.Schema.Type<typeof State> {}