Skip to content
Source
Sign inSign up

orchestrationProject.ts

29 lines1.5 KB

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​
8export const OrchestrationProjectShell = Schema.Struct({
9 id: ProjectId,
10 title: TrimmedNonEmptyString,
11 // Set once someone renames the project. A folder-default title can equal the
12 // repository name, so grouped labels need this to tell a chosen name apart.
13 hasCustomTitle: Schema.optional(Schema.Boolean),
14 workspaceRoot: TrimmedNonEmptyString,
15 repositoryIdentity: Schema.optional(Schema.NullOr(RepositoryIdentity)),
16 defaultModelSelection: Schema.NullOr(ModelSelection),
17 defaultThreadEnvMode: Schema.optional(Schema.NullOr(ThreadEnvMode)),
18 // Opt-in because background sync performs network I/O and may move the checkout.
19 autoPull: Schema.optional(Schema.Boolean),
20 faviconPath: Schema.optional(Schema.NullOr(TrimmedNonEmptyString)),
21 projectIcon: Schema.optional(Schema.NullOr(ReceivedProjectIcon)),
22 scripts: Schema.Array(ProjectScript),
23 // Pinned projects lead project pickers; archived ones leave them. Optional so older servers decode.
24 pinnedAt: Schema.optional(Schema.NullOr(IsoDateTime)),
25 archivedAt: Schema.optional(Schema.NullOr(IsoDateTime)),
26 createdAt: IsoDateTime,
27 updatedAt: IsoDateTime,
28});
29export type OrchestrationProjectShell = typeof OrchestrationProjectShell.Type;