-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Expand file tree
/
Copy pathconstants.ts
More file actions
107 lines (101 loc) · 2.19 KB
/
Copy pathconstants.ts
File metadata and controls
107 lines (101 loc) · 2.19 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
import type { ToolResultOutput } from '../types/messages/content-part'
import type { Tool } from 'ai'
export const toolNameParam = 'cb_tool_name'
export const endsAgentStepParam = 'cb_easp'
export const toolXmlName = 'codebuff_tool_call'
export const startToolTag = `<${toolXmlName}>\n`
export const endToolTag = `\n</${toolXmlName}>`
export const TOOLS_WHICH_WONT_FORCE_NEXT_STEP = [
'think_deeply',
'set_output',
'set_messages',
'add_message',
'update_subgoal',
'create_plan',
'render_ui',
'suggest_followups',
'task_completed',
]
// List of all available tools
export const toolNames = [
'apply_patch',
'add_subgoal',
'add_message',
'ask_user',
'browser_logs',
'code_search',
'create_plan',
'end_turn',
'find_files',
'glob',
'gravity_index',
'list_directory',
'lookup_agent_info',
'propose_str_replace',
'propose_write_file',
'read_docs',
'read_files',
'read_subtree',
'read_url',
'render_ui',
'run_file_change_hooks',
'run_terminal_command',
'set_messages',
'set_output',
'skill',
'spawn_agents',
'spawn_agent_inline',
'str_replace',
'suggest_followups',
'task_completed',
'think_deeply',
'update_subgoal',
'web_search',
'write_file',
'write_todos',
] as const
export const publishedTools = [
'apply_patch',
'add_message',
'ask_user',
'code_search',
'end_turn',
'find_files',
'glob',
'gravity_index',
'list_directory',
'lookup_agent_info',
'propose_str_replace',
'propose_write_file',
'read_docs',
'read_files',
'read_subtree',
'read_url',
'render_ui',
'run_file_change_hooks',
'run_terminal_command',
'set_messages',
'set_output',
'skill',
'spawn_agents',
'str_replace',
'suggest_followups',
'task_completed',
'think_deeply',
'web_search',
'write_file',
'write_todos',
// 'spawn_agent_inline',
] as const
export type ToolName = (typeof toolNames)[number]
export type PublishedToolName = (typeof publishedTools)[number]
/** Only used for validating tool definitions */
export type $ToolParams<T extends ToolName = ToolName> = Required<
Pick<
Tool<any, ToolResultOutput[]>,
'description' | 'inputSchema' | 'outputSchema'
>
> & {
toolName: T
endsAgentStep: boolean
}