feat(vcs): expose repository branch metadata

This commit is contained in:
Brendan Allan 2026-07-21 19:02:18 +08:00
commit 305466e5ef
No known key found for this signature in database
GPG key ID: 41E835AEA046A32E
8 changed files with 48 additions and 3 deletions

View file

@ -1,7 +1,7 @@
export * as Vcs from "./vcs.js"
import { Schema } from "effect"
import { NonNegativeInt } from "./schema.js"
import { NonNegativeInt, optional } from "./schema.js"
export const Mode = Schema.Literals(["working", "branch"]).annotate({ identifier: "Vcs.Mode" })
export type Mode = typeof Mode.Type
@ -13,3 +13,9 @@ export const FileStatus = Schema.Struct({
status: Schema.Literals(["added", "deleted", "modified"]),
}).annotate({ identifier: "Vcs.FileStatus" })
export interface FileStatus extends Schema.Schema.Type<typeof FileStatus> {}
export const Info = Schema.Struct({
branch: optional(Schema.String),
defaultBranch: optional(Schema.String),
}).annotate({ identifier: "Vcs.Info" })
export interface Info extends Schema.Schema.Type<typeof Info> {}