refactor(protocol): extract server contracts (#33708)

This commit is contained in:
Kit Langton 2026-06-25 04:15:31 +02:00 committed by GitHub
commit 56a37c3640
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
77 changed files with 1070 additions and 878 deletions

View file

@ -0,0 +1,29 @@
export * as ProjectCopy from "./project-copy"
import { Schema } from "effect"
import { ProjectID } from "./project-id"
import { AbsolutePath } from "./schema"
export const StrategyID = Schema.Trim.pipe(Schema.check(Schema.isNonEmpty()), Schema.brand("ProjectCopy.StrategyID"))
export type StrategyID = typeof StrategyID.Type
export const CreateInput = Schema.Struct({
projectID: ProjectID,
strategy: StrategyID,
sourceDirectory: AbsolutePath,
directory: AbsolutePath,
name: Schema.optional(Schema.String),
}).annotate({ identifier: "ProjectCopy.CreateInput" })
export type CreateInput = typeof CreateInput.Type
export const RemoveInput = Schema.Struct({
projectID: ProjectID,
directory: AbsolutePath,
force: Schema.Boolean,
}).annotate({ identifier: "ProjectCopy.RemoveInput" })
export type RemoveInput = typeof RemoveInput.Type
export const Copy = Schema.Struct({
directory: AbsolutePath,
}).annotate({ identifier: "ProjectCopy.Copy" })
export type Copy = typeof Copy.Type