-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
Copy pathschemas.ts
81 lines (79 loc) · 2.22 KB
/
schemas.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import { z } from 'zod';
/**
* Schema for searching code in Azure DevOps repositories
*/
export const SearchCodeSchema = z.object({
searchText: z.string().describe('The text to search for'),
projectId: z.string().describe('The ID or name of the project to search in'),
filters: z
.object({
Repository: z
.array(z.string())
.optional()
.describe('Filter by repository names'),
Path: z.array(z.string()).optional().describe('Filter by file paths'),
Branch: z.array(z.string()).optional().describe('Filter by branch names'),
CodeElement: z
.array(z.string())
.optional()
.describe('Filter by code element types (function, class, etc.)'),
})
.optional()
.describe('Optional filters to narrow search results'),
top: z
.number()
.int()
.min(1)
.max(1000)
.default(100)
.describe('Number of results to return (default: 100, max: 1000)'),
skip: z
.number()
.int()
.min(0)
.default(0)
.describe('Number of results to skip for pagination (default: 0)'),
includeSnippet: z
.boolean()
.default(true)
.describe('Whether to include code snippets in results (default: true)'),
includeContent: z
.boolean()
.default(true)
.describe(
'Whether to include full file content in results (default: true)',
),
});
/**
* Schema for searching wiki pages in Azure DevOps projects
*/
export const SearchWikiSchema = z.object({
searchText: z.string().describe('The text to search for in wikis'),
projectId: z.string().describe('The ID or name of the project to search in'),
filters: z
.object({
Project: z
.array(z.string())
.optional()
.describe('Filter by project names'),
})
.optional()
.describe('Optional filters to narrow search results'),
top: z
.number()
.int()
.min(1)
.max(1000)
.default(100)
.describe('Number of results to return (default: 100, max: 1000)'),
skip: z
.number()
.int()
.min(0)
.default(0)
.describe('Number of results to skip for pagination (default: 0)'),
includeFacets: z
.boolean()
.default(true)
.describe('Whether to include faceting in results (default: true)'),
});