1import * as Schema from "effect/Schema";
2
3import { IsoDateTime, ProjectId, TrimmedNonEmptyString } from "./baseSchemas.ts";
4import { RepositoryIdentity, ThreadEnvMode } from "./environment.ts";
5import { ModelSelection } from "./modelSelection.ts";
6import { ProjectScript, ReceivedProjectIcon } from "./project.ts";
7
8/** Project summary shared by the V2 shell and application project APIs. */
9export 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});
28export type OrchestrationProjectShell = typeof OrchestrationProjectShell.Type;