@sourcebot/mcp 1.0.15 → 1.0.17

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/schemas.d.ts CHANGED
@@ -806,26 +806,35 @@ export declare const repositoryQuerySchema: z.ZodObject<{
806
806
  imageUrl: z.ZodOptional<z.ZodString>;
807
807
  indexedAt: z.ZodOptional<z.ZodDate>;
808
808
  pushedAt: z.ZodOptional<z.ZodDate>;
809
+ defaultBranch: z.ZodOptional<z.ZodString>;
810
+ isFork: z.ZodBoolean;
811
+ isArchived: z.ZodBoolean;
809
812
  }, "strip", z.ZodTypeAny, {
810
813
  codeHostType: string;
811
814
  webUrl: string;
812
815
  repoId: number;
813
816
  repoName: string;
817
+ isFork: boolean;
818
+ isArchived: boolean;
814
819
  externalWebUrl?: string | undefined;
815
820
  repoDisplayName?: string | undefined;
816
821
  imageUrl?: string | undefined;
817
822
  indexedAt?: Date | undefined;
818
823
  pushedAt?: Date | undefined;
824
+ defaultBranch?: string | undefined;
819
825
  }, {
820
826
  codeHostType: string;
821
827
  webUrl: string;
822
828
  repoId: number;
823
829
  repoName: string;
830
+ isFork: boolean;
831
+ isArchived: boolean;
824
832
  externalWebUrl?: string | undefined;
825
833
  repoDisplayName?: string | undefined;
826
834
  imageUrl?: string | undefined;
827
835
  indexedAt?: Date | undefined;
828
836
  pushedAt?: Date | undefined;
837
+ defaultBranch?: string | undefined;
829
838
  }>;
830
839
  export declare const listReposResponseSchema: z.ZodArray<z.ZodObject<{
831
840
  codeHostType: z.ZodString;
@@ -837,26 +846,35 @@ export declare const listReposResponseSchema: z.ZodArray<z.ZodObject<{
837
846
  imageUrl: z.ZodOptional<z.ZodString>;
838
847
  indexedAt: z.ZodOptional<z.ZodDate>;
839
848
  pushedAt: z.ZodOptional<z.ZodDate>;
849
+ defaultBranch: z.ZodOptional<z.ZodString>;
850
+ isFork: z.ZodBoolean;
851
+ isArchived: z.ZodBoolean;
840
852
  }, "strip", z.ZodTypeAny, {
841
853
  codeHostType: string;
842
854
  webUrl: string;
843
855
  repoId: number;
844
856
  repoName: string;
857
+ isFork: boolean;
858
+ isArchived: boolean;
845
859
  externalWebUrl?: string | undefined;
846
860
  repoDisplayName?: string | undefined;
847
861
  imageUrl?: string | undefined;
848
862
  indexedAt?: Date | undefined;
849
863
  pushedAt?: Date | undefined;
864
+ defaultBranch?: string | undefined;
850
865
  }, {
851
866
  codeHostType: string;
852
867
  webUrl: string;
853
868
  repoId: number;
854
869
  repoName: string;
870
+ isFork: boolean;
871
+ isArchived: boolean;
855
872
  externalWebUrl?: string | undefined;
856
873
  repoDisplayName?: string | undefined;
857
874
  imageUrl?: string | undefined;
858
875
  indexedAt?: Date | undefined;
859
876
  pushedAt?: Date | undefined;
877
+ defaultBranch?: string | undefined;
860
878
  }>, "many">;
861
879
  export declare const listReposQueryParamsSchema: z.ZodObject<{
862
880
  query: z.ZodOptional<z.ZodString>;
@@ -921,6 +939,132 @@ export declare const fileSourceResponseSchema: z.ZodObject<{
921
939
  repoDisplayName?: string | undefined;
922
940
  repoExternalWebUrl?: string | undefined;
923
941
  }>;
942
+ type TreeNode = {
943
+ type: string;
944
+ path: string;
945
+ name: string;
946
+ children: TreeNode[];
947
+ };
948
+ export declare const listTreeApiRequestSchema: z.ZodObject<{
949
+ repoName: z.ZodString;
950
+ revisionName: z.ZodString;
951
+ paths: z.ZodArray<z.ZodString, "many">;
952
+ }, "strip", z.ZodTypeAny, {
953
+ repoName: string;
954
+ revisionName: string;
955
+ paths: string[];
956
+ }, {
957
+ repoName: string;
958
+ revisionName: string;
959
+ paths: string[];
960
+ }>;
961
+ export declare const listTreeApiResponseSchema: z.ZodObject<{
962
+ tree: z.ZodType<TreeNode, z.ZodTypeDef, TreeNode>;
963
+ }, "strip", z.ZodTypeAny, {
964
+ tree: TreeNode;
965
+ }, {
966
+ tree: TreeNode;
967
+ }>;
968
+ export declare const DEFAULT_TREE_DEPTH = 1;
969
+ export declare const MAX_TREE_DEPTH = 10;
970
+ export declare const DEFAULT_MAX_TREE_ENTRIES = 1000;
971
+ export declare const MAX_MAX_TREE_ENTRIES = 10000;
972
+ export declare const listTreeRequestSchema: z.ZodObject<{
973
+ repo: z.ZodString;
974
+ path: z.ZodDefault<z.ZodOptional<z.ZodString>>;
975
+ ref: z.ZodDefault<z.ZodOptional<z.ZodString>>;
976
+ depth: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
977
+ includeFiles: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
978
+ includeDirectories: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
979
+ maxEntries: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
980
+ }, "strip", z.ZodTypeAny, {
981
+ path: string;
982
+ repo: string;
983
+ ref: string;
984
+ depth: number;
985
+ includeFiles: boolean;
986
+ includeDirectories: boolean;
987
+ maxEntries: number;
988
+ }, {
989
+ repo: string;
990
+ path?: string | undefined;
991
+ ref?: string | undefined;
992
+ depth?: number | undefined;
993
+ includeFiles?: boolean | undefined;
994
+ includeDirectories?: boolean | undefined;
995
+ maxEntries?: number | undefined;
996
+ }>;
997
+ export declare const listTreeEntrySchema: z.ZodObject<{
998
+ type: z.ZodEnum<["tree", "blob"]>;
999
+ path: z.ZodString;
1000
+ name: z.ZodString;
1001
+ parentPath: z.ZodString;
1002
+ depth: z.ZodNumber;
1003
+ }, "strip", z.ZodTypeAny, {
1004
+ path: string;
1005
+ type: "tree" | "blob";
1006
+ name: string;
1007
+ depth: number;
1008
+ parentPath: string;
1009
+ }, {
1010
+ path: string;
1011
+ type: "tree" | "blob";
1012
+ name: string;
1013
+ depth: number;
1014
+ parentPath: string;
1015
+ }>;
1016
+ export declare const listTreeResponseSchema: z.ZodObject<{
1017
+ repo: z.ZodString;
1018
+ ref: z.ZodString;
1019
+ path: z.ZodString;
1020
+ entries: z.ZodArray<z.ZodObject<{
1021
+ type: z.ZodEnum<["tree", "blob"]>;
1022
+ path: z.ZodString;
1023
+ name: z.ZodString;
1024
+ parentPath: z.ZodString;
1025
+ depth: z.ZodNumber;
1026
+ }, "strip", z.ZodTypeAny, {
1027
+ path: string;
1028
+ type: "tree" | "blob";
1029
+ name: string;
1030
+ depth: number;
1031
+ parentPath: string;
1032
+ }, {
1033
+ path: string;
1034
+ type: "tree" | "blob";
1035
+ name: string;
1036
+ depth: number;
1037
+ parentPath: string;
1038
+ }>, "many">;
1039
+ totalReturned: z.ZodNumber;
1040
+ truncated: z.ZodBoolean;
1041
+ }, "strip", z.ZodTypeAny, {
1042
+ path: string;
1043
+ entries: {
1044
+ path: string;
1045
+ type: "tree" | "blob";
1046
+ name: string;
1047
+ depth: number;
1048
+ parentPath: string;
1049
+ }[];
1050
+ repo: string;
1051
+ ref: string;
1052
+ totalReturned: number;
1053
+ truncated: boolean;
1054
+ }, {
1055
+ path: string;
1056
+ entries: {
1057
+ path: string;
1058
+ type: "tree" | "blob";
1059
+ name: string;
1060
+ depth: number;
1061
+ parentPath: string;
1062
+ }[];
1063
+ repo: string;
1064
+ ref: string;
1065
+ totalReturned: number;
1066
+ truncated: boolean;
1067
+ }>;
924
1068
  export declare const serviceErrorSchema: z.ZodObject<{
925
1069
  statusCode: z.ZodNumber;
926
1070
  errorCode: z.ZodString;
@@ -1027,6 +1171,7 @@ export declare const askCodebaseRequestSchema: z.ZodObject<{
1027
1171
  provider: string;
1028
1172
  model: string;
1029
1173
  }>>;
1174
+ visibility: z.ZodOptional<z.ZodEnum<["PRIVATE", "PUBLIC"]>>;
1030
1175
  }, "strip", z.ZodTypeAny, {
1031
1176
  query: string;
1032
1177
  repos?: string[] | undefined;
@@ -1034,6 +1179,7 @@ export declare const askCodebaseRequestSchema: z.ZodObject<{
1034
1179
  provider: string;
1035
1180
  model: string;
1036
1181
  } | undefined;
1182
+ visibility?: "PRIVATE" | "PUBLIC" | undefined;
1037
1183
  }, {
1038
1184
  query: string;
1039
1185
  repos?: string[] | undefined;
@@ -1041,6 +1187,7 @@ export declare const askCodebaseRequestSchema: z.ZodObject<{
1041
1187
  provider: string;
1042
1188
  model: string;
1043
1189
  } | undefined;
1190
+ visibility?: "PRIVATE" | "PUBLIC" | undefined;
1044
1191
  }>;
1045
1192
  export declare const sourceSchema: z.ZodObject<{
1046
1193
  type: z.ZodLiteral<"file">;
@@ -1100,3 +1247,4 @@ export declare const askCodebaseResponseSchema: z.ZodObject<{
1100
1247
  chatId: string;
1101
1248
  chatUrl: string;
1102
1249
  }>;
1250
+ export {};
package/dist/schemas.js CHANGED
@@ -126,6 +126,9 @@ export const repositoryQuerySchema = z.object({
126
126
  imageUrl: z.string().optional(),
127
127
  indexedAt: z.coerce.date().optional(),
128
128
  pushedAt: z.coerce.date().optional(),
129
+ defaultBranch: z.string().optional(),
130
+ isFork: z.boolean(),
131
+ isArchived: z.boolean(),
129
132
  });
130
133
  export const listReposResponseSchema = repositoryQuerySchema.array();
131
134
  export const listReposQueryParamsSchema = z.object({
@@ -182,6 +185,80 @@ export const fileSourceResponseSchema = z.object({
182
185
  webUrl: z.string(),
183
186
  externalWebUrl: z.string().optional(),
184
187
  });
188
+ const treeNodeSchema = z.lazy(() => z.object({
189
+ type: z.string(),
190
+ path: z.string(),
191
+ name: z.string(),
192
+ children: z.array(treeNodeSchema),
193
+ }));
194
+ export const listTreeApiRequestSchema = z.object({
195
+ repoName: z.string(),
196
+ revisionName: z.string(),
197
+ paths: z.array(z.string()),
198
+ });
199
+ export const listTreeApiResponseSchema = z.object({
200
+ tree: treeNodeSchema,
201
+ });
202
+ export const DEFAULT_TREE_DEPTH = 1;
203
+ export const MAX_TREE_DEPTH = 10;
204
+ export const DEFAULT_MAX_TREE_ENTRIES = 1000;
205
+ export const MAX_MAX_TREE_ENTRIES = 10000;
206
+ export const listTreeRequestSchema = z.object({
207
+ repo: z
208
+ .string()
209
+ .describe("The name of the repository to list files from."),
210
+ path: z
211
+ .string()
212
+ .describe("Directory path (relative to repo root). If omitted, the repo root is used.")
213
+ .optional()
214
+ .default(''),
215
+ ref: z
216
+ .string()
217
+ .describe("Commit SHA, branch or tag name to list files from. If not provided, uses the default branch.")
218
+ .optional()
219
+ .default('HEAD'),
220
+ depth: z
221
+ .number()
222
+ .int()
223
+ .positive()
224
+ .max(MAX_TREE_DEPTH)
225
+ .describe(`How many directory levels to traverse below \`path\` (min 1, max ${MAX_TREE_DEPTH}, default ${DEFAULT_TREE_DEPTH}).`)
226
+ .optional()
227
+ .default(DEFAULT_TREE_DEPTH),
228
+ includeFiles: z
229
+ .boolean()
230
+ .describe("Whether to include files in the output (default: true).")
231
+ .optional()
232
+ .default(true),
233
+ includeDirectories: z
234
+ .boolean()
235
+ .describe("Whether to include directories in the output (default: true).")
236
+ .optional()
237
+ .default(true),
238
+ maxEntries: z
239
+ .number()
240
+ .int()
241
+ .positive()
242
+ .max(MAX_MAX_TREE_ENTRIES)
243
+ .describe(`Maximum number of entries to return (min 1, max ${MAX_MAX_TREE_ENTRIES}, default ${DEFAULT_MAX_TREE_ENTRIES}).`)
244
+ .optional()
245
+ .default(DEFAULT_MAX_TREE_ENTRIES),
246
+ });
247
+ export const listTreeEntrySchema = z.object({
248
+ type: z.enum(['tree', 'blob']),
249
+ path: z.string(),
250
+ name: z.string(),
251
+ parentPath: z.string(),
252
+ depth: z.number().int().positive(),
253
+ });
254
+ export const listTreeResponseSchema = z.object({
255
+ repo: z.string(),
256
+ ref: z.string(),
257
+ path: z.string(),
258
+ entries: z.array(listTreeEntrySchema),
259
+ totalReturned: z.number().int().nonnegative(),
260
+ truncated: z.boolean(),
261
+ });
185
262
  export const serviceErrorSchema = z.object({
186
263
  statusCode: z.number(),
187
264
  errorCode: z.string(),
@@ -254,6 +331,10 @@ export const askCodebaseRequestSchema = z.object({
254
331
  .omit({ displayName: true })
255
332
  .optional()
256
333
  .describe("The language model to use for answering the question. If not provided, defaults to the first model in the config. Use list_language_models to see available options."),
334
+ visibility: z
335
+ .enum(['PRIVATE', 'PUBLIC'])
336
+ .optional()
337
+ .describe("The visibility of the chat session. If not provided, defaults to PRIVATE for authenticated users and PUBLIC for anonymous users. Set to PUBLIC to make the chat viewable by anyone with the link."),
257
338
  });
258
339
  export const sourceSchema = z.object({
259
340
  type: z.literal('file'),
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,6DAA6D;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,qDAAqD;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,qDAAqD;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,8DAA8D;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,cAAc;IACrB,GAAG,EAAE,cAAc;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAA+B,mCAAmC;IACrF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAe,yCAAyC;IAC3F,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAqB,4DAA4D;IAC9G,cAAc,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAY,+CAA+C;IACjG,wBAAwB,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAE,sCAA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,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC1C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACrF,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CAClE,CAAC,CAAC","sourcesContent":["// @NOTE : Please keep this file in sync with @sourcebot/web/src/features/search/types.ts\n// At some point, we should move these to a shared package...\nimport { z } from \"zod\";\n\nexport const locationSchema = z.object({\n // 0-based byte offset from the beginning of the file\n byteOffset: z.number(),\n // 1-based line number from the beginning of the file\n lineNumber: z.number(),\n // 1-based column number (in runes) from the beginning of line\n column: z.number(),\n});\n\nexport const rangeSchema = z.object({\n start: locationSchema,\n end: locationSchema,\n});\n\nexport const symbolSchema = z.object({\n symbol: z.string(),\n kind: z.string(),\n});\n\nexport const searchOptionsSchema = z.object({\n matches: z.number(), // The number of matches to return.\n contextLines: z.number().optional(), // The number of context lines to return.\n whole: z.boolean().optional(), // Whether to return the whole file as part of the response.\n isRegexEnabled: z.boolean().optional(), // Whether to enable regular expression search.\n isCaseSensitivityEnabled: z.boolean().optional(), // Whether to enable case sensitivity.\n});\n\nexport const searchRequestSchema = z.object({\n query: z.string(), // The zoekt query to execute.\n ...searchOptionsSchema.shape,\n});\n\nexport const repositoryInfoSchema = z.object({\n id: z.number(),\n codeHostType: z.string(),\n name: z.string(),\n displayName: z.string().optional(),\n webUrl: z.string().optional(),\n});\n\n// Many of these fields are defined in zoekt/api.go.\nexport const searchStatsSchema = z.object({\n // The actual number of matches returned by the search.\n // This will always be less than or equal to `totalMatchCount`.\n actualMatchCount: z.number(),\n\n // The total number of matches found during the search.\n totalMatchCount: z.number(),\n\n // The duration (in nanoseconds) of the search.\n duration: z.number(),\n\n // Number of files containing a match.\n fileCount: z.number(),\n\n // Candidate files whose contents weren't examined because we\n // gathered enough matches.\n filesSkipped: z.number(),\n\n // Amount of I/O for reading contents.\n contentBytesLoaded: z.number(),\n\n // Amount of I/O for reading from index.\n indexBytesLoaded: z.number(),\n\n // Number of search shards that had a crash.\n crashes: z.number(),\n\n // Number of files in shards that we considered.\n shardFilesConsidered: z.number(),\n\n // Files that we evaluated. Equivalent to files for which all\n // atom matches (including negations) evaluated to true.\n filesConsidered: z.number(),\n\n // Files for which we loaded file content to verify substring matches\n filesLoaded: z.number(),\n\n // Shards that we scanned to find matches.\n shardsScanned: z.number(),\n\n // Shards that we did not process because a query was canceled.\n shardsSkipped: z.number(),\n\n // Shards that we did not process because the query was rejected by the\n // ngram filter indicating it had no matches.\n shardsSkippedFilter: z.number(),\n\n // Number of candidate matches as a result of searching ngrams.\n ngramMatches: z.number(),\n\n // NgramLookups is the number of times we accessed an ngram in the index.\n ngramLookups: z.number(),\n\n // Wall clock time for queued search.\n wait: z.number(),\n\n // Aggregate wall clock time spent constructing and pruning the match tree.\n // This accounts for time such as lookups in the trigram index.\n matchTreeConstruction: z.number(),\n\n // Aggregate wall clock time spent searching the match tree. This accounts\n // for the bulk of search work done looking for matches.\n matchTreeSearch: z.number(),\n\n // Number of times regexp was called on files that we evaluated.\n regexpsConsidered: z.number(),\n\n // FlushReason explains why results were flushed.\n flushReason: z.string(),\n});\n\nexport const searchResponseSchema = z.object({\n stats: searchStatsSchema,\n files: z.array(z.object({\n fileName: z.object({\n // The name of the file\n text: z.string(),\n // Any matching ranges\n matchRanges: z.array(rangeSchema),\n }),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n repository: z.string(),\n repositoryId: z.number(),\n language: z.string(),\n chunks: z.array(z.object({\n content: z.string(),\n matchRanges: z.array(rangeSchema),\n contentStart: locationSchema,\n symbols: z.array(z.object({\n ...symbolSchema.shape,\n parent: symbolSchema.optional(),\n })).optional(),\n })),\n branches: z.array(z.string()).optional(),\n // Set if `whole` is true.\n content: z.string().optional(),\n })),\n repositoryInfo: z.array(repositoryInfoSchema),\n isSearchExhaustive: z.boolean(),\n});\n\nexport const repositoryQuerySchema = z.object({\n codeHostType: z.string(),\n repoId: z.number(),\n repoName: z.string(),\n repoDisplayName: z.string().optional(),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n imageUrl: z.string().optional(),\n indexedAt: z.coerce.date().optional(),\n pushedAt: z.coerce.date().optional(),\n});\n\nexport const listReposResponseSchema = repositoryQuerySchema.array();\n\nexport const listReposQueryParamsSchema = z.object({\n query: z\n .string()\n .describe(\"Filter repositories by name (case-insensitive)\")\n .optional(),\n page: z\n .number()\n .int()\n .positive()\n .describe(\"Page number for pagination (min 1). Default: 1\")\n .optional()\n .default(1),\n perPage: z\n .number()\n .int()\n .positive()\n .max(100)\n .describe(\"Results per page for pagination (min 1, max 100). Default: 30\")\n .optional()\n .default(30),\n sort: z\n .enum(['name', 'pushed'])\n .describe(\"Sort repositories by 'name' or 'pushed' (most recent commit). Default: 'name'\")\n .optional()\n .default('name'),\n direction: z\n .enum(['asc', 'desc'])\n .describe(\"Sort direction: 'asc' or 'desc'. Default: 'asc'\")\n .optional()\n .default('asc'),\n});\n\nexport const fileSourceRequestSchema = z.object({\n repo: z\n .string()\n .describe(\"The repository name.\"),\n path: z\n .string()\n .describe(\"The path to the file.\"),\n ref: z\n .string()\n .optional()\n .describe(\"Commit SHA, branch or tag name to fetch the source code for. If not provided, uses the default branch of the repository.\"),\n});\n\nexport const fileSourceResponseSchema = z.object({\n source: z.string(),\n language: z.string(),\n path: z.string(),\n repo: z.string(),\n repoCodeHostType: z.string(),\n repoDisplayName: z.string().optional(),\n repoExternalWebUrl: z.string().optional(),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n});\n\nexport const serviceErrorSchema = z.object({\n statusCode: z.number(),\n errorCode: z.string(),\n message: z.string(),\n});\n\nexport const listCommitsQueryParamsSchema = z.object({\n repo: z\n .string()\n .describe(\"The name of the repository to list commits for.\"),\n query: z\n .string()\n .describe(\"Search query to filter commits by message content (case-insensitive).\")\n .optional(),\n since: z\n .string()\n .describe(`Show commits more recent than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago', 'last week').`)\n .optional(),\n until: z\n .string()\n .describe(`Show commits older than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday').`)\n .optional(),\n author: z\n .string()\n .describe(`Filter commits by author name or email (case-insensitive).`)\n .optional(),\n ref: z\n .string()\n .describe(\"Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository.\")\n .optional(),\n page: z\n .number()\n .int()\n .positive()\n .describe(\"Page number for pagination (min 1). Default: 1\")\n .optional()\n .default(1),\n perPage: z\n .number()\n .int()\n .positive()\n .max(100)\n .describe(\"Results per page for pagination (min 1, max 100). Default: 50\")\n .optional()\n .default(50),\n});\n\nexport const listCommitsResponseSchema = z.array(z.object({\n hash: z.string(),\n date: z.string(),\n message: z.string(),\n refs: z.string(),\n body: z.string(),\n author_name: z.string(),\n author_email: z.string(),\n}));\n\nexport const languageModelInfoSchema = z.object({\n provider: z.string().describe(\"The model provider (e.g., 'anthropic', 'openai')\"),\n model: z.string().describe(\"The model ID\"),\n displayName: z.string().optional().describe(\"Optional display name for the model\"),\n});\n\nexport const listLanguageModelsResponseSchema = z.array(languageModelInfoSchema);\n\nexport const askCodebaseRequestSchema = z.object({\n query: z\n .string()\n .describe(\"The query to ask about the codebase.\"),\n repos: z\n .array(z.string())\n .optional()\n .describe(\"The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible.\"),\n languageModel: languageModelInfoSchema\n .omit({ displayName: true })\n .optional()\n .describe(\"The language model to use for answering the question. If not provided, defaults to the first model in the config. Use list_language_models to see available options.\"),\n});\n\nexport const sourceSchema = z.object({\n type: z.literal('file'),\n repo: z.string(),\n path: z.string(),\n name: z.string(),\n language: z.string(),\n revision: z.string(),\n});\n\nexport const askCodebaseResponseSchema = z.object({\n answer: z.string().describe(\"The agent's final answer in markdown format\"),\n chatId: z.string().describe(\"ID of the persisted chat session\"),\n chatUrl: z.string().describe(\"URL to view the chat in the web UI\"),\n languageModel: z.object({\n provider: z.string().describe(\"The model provider (e.g., 'anthropic', 'openai')\"),\n model: z.string().describe(\"The model ID\"),\n displayName: z.string().optional().describe(\"Optional display name for the model\"),\n }).describe(\"The language model used to generate the response\"),\n});\n"]}
1
+ {"version":3,"file":"schemas.js","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAAA,yFAAyF;AACzF,6DAA6D;AAC7D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;IACnC,qDAAqD;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,qDAAqD;IACrD,UAAU,EAAE,CAAC,CAAC,MAAM,EAAE;IACtB,8DAA8D;IAC9D,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;CACrB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,CAAC,MAAM,CAAC;IAChC,KAAK,EAAE,cAAc;IACrB,GAAG,EAAE,cAAc;CACtB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,CAAC;IACjC,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE;IAClB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;CACnB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,mBAAmB,GAAG,CAAC,CAAC,MAAM,CAAC;IACxC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,EAA+B,mCAAmC;IACrF,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,EAAe,yCAAyC;IAC3F,KAAK,EAAE,CAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE,EAAqB,4DAA4D;IAC9G,cAAc,E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,CAAC;IACjC,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;IACvB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;IACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE;CACvB,CAAC,CAAC;AAEH,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC,CAAC,MAAM,CAAC;IAC9C,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,6CAA6C,CAAC;IAC1E,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kCAAkC,CAAC;IAC/D,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,oCAAoC,CAAC;IAClE,aAAa,EAAE,CAAC,CAAC,MAAM,CAAC;QACpB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,kDAAkD,CAAC;QACjF,KAAK,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,CAAC,cAAc,CAAC;QAC1C,WAAW,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,qCAAqC,CAAC;KACrF,CAAC,CAAC,QAAQ,CAAC,kDAAkD,CAAC;CAClE,CAAC,CAAC","sourcesContent":["// @NOTE : Please keep this file in sync with @sourcebot/web/src/features/search/types.ts\n// At some point, we should move these to a shared package...\nimport { z } from \"zod\";\n\nexport const locationSchema = z.object({\n // 0-based byte offset from the beginning of the file\n byteOffset: z.number(),\n // 1-based line number from the beginning of the file\n lineNumber: z.number(),\n // 1-based column number (in runes) from the beginning of line\n column: z.number(),\n});\n\nexport const rangeSchema = z.object({\n start: locationSchema,\n end: locationSchema,\n});\n\nexport const symbolSchema = z.object({\n symbol: z.string(),\n kind: z.string(),\n});\n\nexport const searchOptionsSchema = z.object({\n matches: z.number(), // The number of matches to return.\n contextLines: z.number().optional(), // The number of context lines to return.\n whole: z.boolean().optional(), // Whether to return the whole file as part of the response.\n isRegexEnabled: z.boolean().optional(), // Whether to enable regular expression search.\n isCaseSensitivityEnabled: z.boolean().optional(), // Whether to enable case sensitivity.\n});\n\nexport const searchRequestSchema = z.object({\n query: z.string(), // The zoekt query to execute.\n ...searchOptionsSchema.shape,\n});\n\nexport const repositoryInfoSchema = z.object({\n id: z.number(),\n codeHostType: z.string(),\n name: z.string(),\n displayName: z.string().optional(),\n webUrl: z.string().optional(),\n});\n\n// Many of these fields are defined in zoekt/api.go.\nexport const searchStatsSchema = z.object({\n // The actual number of matches returned by the search.\n // This will always be less than or equal to `totalMatchCount`.\n actualMatchCount: z.number(),\n\n // The total number of matches found during the search.\n totalMatchCount: z.number(),\n\n // The duration (in nanoseconds) of the search.\n duration: z.number(),\n\n // Number of files containing a match.\n fileCount: z.number(),\n\n // Candidate files whose contents weren't examined because we\n // gathered enough matches.\n filesSkipped: z.number(),\n\n // Amount of I/O for reading contents.\n contentBytesLoaded: z.number(),\n\n // Amount of I/O for reading from index.\n indexBytesLoaded: z.number(),\n\n // Number of search shards that had a crash.\n crashes: z.number(),\n\n // Number of files in shards that we considered.\n shardFilesConsidered: z.number(),\n\n // Files that we evaluated. Equivalent to files for which all\n // atom matches (including negations) evaluated to true.\n filesConsidered: z.number(),\n\n // Files for which we loaded file content to verify substring matches\n filesLoaded: z.number(),\n\n // Shards that we scanned to find matches.\n shardsScanned: z.number(),\n\n // Shards that we did not process because a query was canceled.\n shardsSkipped: z.number(),\n\n // Shards that we did not process because the query was rejected by the\n // ngram filter indicating it had no matches.\n shardsSkippedFilter: z.number(),\n\n // Number of candidate matches as a result of searching ngrams.\n ngramMatches: z.number(),\n\n // NgramLookups is the number of times we accessed an ngram in the index.\n ngramLookups: z.number(),\n\n // Wall clock time for queued search.\n wait: z.number(),\n\n // Aggregate wall clock time spent constructing and pruning the match tree.\n // This accounts for time such as lookups in the trigram index.\n matchTreeConstruction: z.number(),\n\n // Aggregate wall clock time spent searching the match tree. This accounts\n // for the bulk of search work done looking for matches.\n matchTreeSearch: z.number(),\n\n // Number of times regexp was called on files that we evaluated.\n regexpsConsidered: z.number(),\n\n // FlushReason explains why results were flushed.\n flushReason: z.string(),\n});\n\nexport const searchResponseSchema = z.object({\n stats: searchStatsSchema,\n files: z.array(z.object({\n fileName: z.object({\n // The name of the file\n text: z.string(),\n // Any matching ranges\n matchRanges: z.array(rangeSchema),\n }),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n repository: z.string(),\n repositoryId: z.number(),\n language: z.string(),\n chunks: z.array(z.object({\n content: z.string(),\n matchRanges: z.array(rangeSchema),\n contentStart: locationSchema,\n symbols: z.array(z.object({\n ...symbolSchema.shape,\n parent: symbolSchema.optional(),\n })).optional(),\n })),\n branches: z.array(z.string()).optional(),\n // Set if `whole` is true.\n content: z.string().optional(),\n })),\n repositoryInfo: z.array(repositoryInfoSchema),\n isSearchExhaustive: z.boolean(),\n});\n\nexport const repositoryQuerySchema = z.object({\n codeHostType: z.string(),\n repoId: z.number(),\n repoName: z.string(),\n repoDisplayName: z.string().optional(),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n imageUrl: z.string().optional(),\n indexedAt: z.coerce.date().optional(),\n pushedAt: z.coerce.date().optional(),\n defaultBranch: z.string().optional(),\n isFork: z.boolean(),\n isArchived: z.boolean(),\n});\n\nexport const listReposResponseSchema = repositoryQuerySchema.array();\n\nexport const listReposQueryParamsSchema = z.object({\n query: z\n .string()\n .describe(\"Filter repositories by name (case-insensitive)\")\n .optional(),\n page: z\n .number()\n .int()\n .positive()\n .describe(\"Page number for pagination (min 1). Default: 1\")\n .optional()\n .default(1),\n perPage: z\n .number()\n .int()\n .positive()\n .max(100)\n .describe(\"Results per page for pagination (min 1, max 100). Default: 30\")\n .optional()\n .default(30),\n sort: z\n .enum(['name', 'pushed'])\n .describe(\"Sort repositories by 'name' or 'pushed' (most recent commit). Default: 'name'\")\n .optional()\n .default('name'),\n direction: z\n .enum(['asc', 'desc'])\n .describe(\"Sort direction: 'asc' or 'desc'. Default: 'asc'\")\n .optional()\n .default('asc'),\n});\n\nexport const fileSourceRequestSchema = z.object({\n repo: z\n .string()\n .describe(\"The repository name.\"),\n path: z\n .string()\n .describe(\"The path to the file.\"),\n ref: z\n .string()\n .optional()\n .describe(\"Commit SHA, branch or tag name to fetch the source code for. If not provided, uses the default branch of the repository.\"),\n});\n\nexport const fileSourceResponseSchema = z.object({\n source: z.string(),\n language: z.string(),\n path: z.string(),\n repo: z.string(),\n repoCodeHostType: z.string(),\n repoDisplayName: z.string().optional(),\n repoExternalWebUrl: z.string().optional(),\n webUrl: z.string(),\n externalWebUrl: z.string().optional(),\n});\n\ntype TreeNode = {\n type: string;\n path: string;\n name: string;\n children: TreeNode[];\n};\n\nconst treeNodeSchema: z.ZodType<TreeNode> = z.lazy(() => z.object({\n type: z.string(),\n path: z.string(),\n name: z.string(),\n children: z.array(treeNodeSchema),\n}));\n\nexport const listTreeApiRequestSchema = z.object({\n repoName: z.string(),\n revisionName: z.string(),\n paths: z.array(z.string()),\n});\n\nexport const listTreeApiResponseSchema = z.object({\n tree: treeNodeSchema,\n});\n\nexport const DEFAULT_TREE_DEPTH = 1;\nexport const MAX_TREE_DEPTH = 10;\nexport const DEFAULT_MAX_TREE_ENTRIES = 1000;\nexport const MAX_MAX_TREE_ENTRIES = 10000;\n\nexport const listTreeRequestSchema = z.object({\n repo: z\n .string()\n .describe(\"The name of the repository to list files from.\"),\n path: z\n .string()\n .describe(\"Directory path (relative to repo root). If omitted, the repo root is used.\")\n .optional()\n .default(''),\n ref: z\n .string()\n .describe(\"Commit SHA, branch or tag name to list files from. If not provided, uses the default branch.\")\n .optional()\n .default('HEAD'),\n depth: z\n .number()\n .int()\n .positive()\n .max(MAX_TREE_DEPTH)\n .describe(`How many directory levels to traverse below \\`path\\` (min 1, max ${MAX_TREE_DEPTH}, default ${DEFAULT_TREE_DEPTH}).`)\n .optional()\n .default(DEFAULT_TREE_DEPTH),\n includeFiles: z\n .boolean()\n .describe(\"Whether to include files in the output (default: true).\")\n .optional()\n .default(true),\n includeDirectories: z\n .boolean()\n .describe(\"Whether to include directories in the output (default: true).\")\n .optional()\n .default(true),\n maxEntries: z\n .number()\n .int()\n .positive()\n .max(MAX_MAX_TREE_ENTRIES)\n .describe(`Maximum number of entries to return (min 1, max ${MAX_MAX_TREE_ENTRIES}, default ${DEFAULT_MAX_TREE_ENTRIES}).`)\n .optional()\n .default(DEFAULT_MAX_TREE_ENTRIES),\n});\n\nexport const listTreeEntrySchema = z.object({\n type: z.enum(['tree', 'blob']),\n path: z.string(),\n name: z.string(),\n parentPath: z.string(),\n depth: z.number().int().positive(),\n});\n\nexport const listTreeResponseSchema = z.object({\n repo: z.string(),\n ref: z.string(),\n path: z.string(),\n entries: z.array(listTreeEntrySchema),\n totalReturned: z.number().int().nonnegative(),\n truncated: z.boolean(),\n});\n\nexport const serviceErrorSchema = z.object({\n statusCode: z.number(),\n errorCode: z.string(),\n message: z.string(),\n});\n\nexport const listCommitsQueryParamsSchema = z.object({\n repo: z\n .string()\n .describe(\"The name of the repository to list commits for.\"),\n query: z\n .string()\n .describe(\"Search query to filter commits by message content (case-insensitive).\")\n .optional(),\n since: z\n .string()\n .describe(`Show commits more recent than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-01-01') or relative formats (e.g., '30 days ago', 'last week').`)\n .optional(),\n until: z\n .string()\n .describe(`Show commits older than this date. Filters by actual commit time. Supports ISO 8601 (e.g., '2024-12-31') or relative formats (e.g., 'yesterday').`)\n .optional(),\n author: z\n .string()\n .describe(`Filter commits by author name or email (case-insensitive).`)\n .optional(),\n ref: z\n .string()\n .describe(\"Commit SHA, branch or tag name to list commits of. If not provided, uses the default branch of the repository.\")\n .optional(),\n page: z\n .number()\n .int()\n .positive()\n .describe(\"Page number for pagination (min 1). Default: 1\")\n .optional()\n .default(1),\n perPage: z\n .number()\n .int()\n .positive()\n .max(100)\n .describe(\"Results per page for pagination (min 1, max 100). Default: 50\")\n .optional()\n .default(50),\n});\n\nexport const listCommitsResponseSchema = z.array(z.object({\n hash: z.string(),\n date: z.string(),\n message: z.string(),\n refs: z.string(),\n body: z.string(),\n author_name: z.string(),\n author_email: z.string(),\n}));\n\nexport const languageModelInfoSchema = z.object({\n provider: z.string().describe(\"The model provider (e.g., 'anthropic', 'openai')\"),\n model: z.string().describe(\"The model ID\"),\n displayName: z.string().optional().describe(\"Optional display name for the model\"),\n});\n\nexport const listLanguageModelsResponseSchema = z.array(languageModelInfoSchema);\n\nexport const askCodebaseRequestSchema = z.object({\n query: z\n .string()\n .describe(\"The query to ask about the codebase.\"),\n repos: z\n .array(z.string())\n .optional()\n .describe(\"The repositories that are accessible to the agent during the chat. If not provided, all repositories are accessible.\"),\n languageModel: languageModelInfoSchema\n .omit({ displayName: true })\n .optional()\n .describe(\"The language model to use for answering the question. If not provided, defaults to the first model in the config. Use list_language_models to see available options.\"),\n visibility: z\n .enum(['PRIVATE', 'PUBLIC'])\n .optional()\n .describe(\"The visibility of the chat session. If not provided, defaults to PRIVATE for authenticated users and PUBLIC for anonymous users. Set to PUBLIC to make the chat viewable by anyone with the link.\"),\n});\n\nexport const sourceSchema = z.object({\n type: z.literal('file'),\n repo: z.string(),\n path: z.string(),\n name: z.string(),\n language: z.string(),\n revision: z.string(),\n});\n\nexport const askCodebaseResponseSchema = z.object({\n answer: z.string().describe(\"The agent's final answer in markdown format\"),\n chatId: z.string().describe(\"ID of the persisted chat session\"),\n chatUrl: z.string().describe(\"URL to view the chat in the web UI\"),\n languageModel: z.object({\n provider: z.string().describe(\"The model provider (e.g., 'anthropic', 'openai')\"),\n model: z.string().describe(\"The model ID\"),\n displayName: z.string().optional().describe(\"Optional display name for the model\"),\n }).describe(\"The language model used to generate the response\"),\n});\n"]}