| 1 | import * as Schema from "effect/Schema"; |
| 2 | |
| 3 | import { IsoDateTime, ProjectId, TrimmedNonEmptyString } from "./baseSchemas.ts"; |
| 4 | import { RepositoryIdentity, ThreadEnvMode } from "./environment.ts"; |
| 5 | import { ModelSelection } from "./modelSelection.ts"; |
| 6 | import { ProjectScript, ReceivedProjectIcon } from "./project.ts"; |
| 7 | |
| 8 | /** Project summary shared by the V2 shell and application project APIs. */ |
| 9 | export const OrchestrationProjectShell = Schema.Struct({ |
| 10 | id: ProjectId, |
| 11 | title: TrimmedNonEmptyString, |
| 12 | workspaceRoot: TrimmedNonEmptyString, |
| 13 | repositoryIdentity: Schema.optional(Schema.NullOr(RepositoryIdentity)), |
| 14 | defaultModelSelection: Schema.NullOr(ModelSelection), |
| 15 | // Per-project override for where new threads start. Null/absent means |
| 16 | // "no override": clients fall back to t3.json, then the global setting. |
| 17 | defaultThreadEnvMode: Schema.optional(Schema.NullOr(ThreadEnvMode)), |
| 18 | // Opt-in because background sync performs network I/O and may move the checkout. |
| 19 | // Optional on the wire so cached snapshots from older servers still decode. |
| 20 | autoPull: Schema.optional(Schema.Boolean), |
| 21 | // Optional on the wire so cached snapshots from older servers still decode. |
| 22 | faviconPath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)), |
| 23 | projectIcon: Schema.optional(Schema.NullOr(ReceivedProjectIcon)), |
| 24 | scripts: Schema.Array(ProjectScript), |
| 25 | createdAt: IsoDateTime, |
| 26 | updatedAt: IsoDateTime, |
| 27 | }); |
| 28 | export type OrchestrationProjectShell = typeof OrchestrationProjectShell.Type; |