Open History to see the last commit
1import { Schema } from "effect";
2import { PositiveInt, TrimmedNonEmptyString } from "./baseSchemas";
3
4export const PROJECT_SEARCH_ENTRIES_MAX_LIMIT = 200;
5
6export const ProjectSearchEntriesInput = Schema.Struct({
7 cwd: TrimmedNonEmptyString,
8 query: TrimmedNonEmptyString.check(Schema.isMaxLength(256)),
9 limit: PositiveInt.check(Schema.isLessThanOrEqualTo(PROJECT_SEARCH_ENTRIES_MAX_LIMIT)),
10});
11export type ProjectSearchEntriesInput = typeof ProjectSearchEntriesInput.Type;
12
13export const ProjectEntryKind = Schema.Literals(["file", "directory"]);
14
15export const ProjectEntry = Schema.Struct({
16 path: TrimmedNonEmptyString,
17 kind: ProjectEntryKind,
18 parentPath: Schema.optional(TrimmedNonEmptyString),
19});
20export type ProjectEntry = typeof ProjectEntry.Type;
21
22export const ProjectSearchEntriesResult = Schema.Struct({
23 entries: Schema.Array(ProjectEntry),
24 truncated: Schema.Boolean,
25});
26export type ProjectSearchEntriesResult = typeof ProjectSearchEntriesResult.Type;