-
Notifications
You must be signed in to change notification settings - Fork 264
Expand file tree
/
Copy pathconstants.ts
More file actions
31 lines (27 loc) · 896 Bytes
/
constants.ts
File metadata and controls
31 lines (27 loc) · 896 Bytes
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
import { SBChatMessagePart } from "./types";
export const FILE_REFERENCE_PREFIX = '@file:';
export const FILE_REFERENCE_REGEX = new RegExp(
// @file:{repoName::fileName:startLine-endLine}
`${FILE_REFERENCE_PREFIX}\\{([^:}]+)::([^:}]+)(?::(\\d+)(?:-(\\d+))?)?\\}`,
'g'
);
export const ANSWER_TAG = '<!--answer-->';
export const toolNames = {
searchCode: 'searchCode',
readFiles: 'readFiles',
findSymbolReferences: 'findSymbolReferences',
findSymbolDefinitions: 'findSymbolDefinitions',
listRepos: 'listRepos',
listCommits: 'listCommits',
} as const;
// These part types are visible in the UI.
export const uiVisiblePartTypes: SBChatMessagePart['type'][] = [
'reasoning',
'text',
'tool-searchCode',
'tool-readFiles',
'tool-findSymbolDefinitions',
'tool-findSymbolReferences',
'tool-listRepos',
'tool-listCommits',
] as const;