Skip to content

Commit f8513f8

Browse files
committed
Document ClineSay and ClineAsk
1 parent f1efeca commit f8513f8

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

src/exports/roo-code.d.ts

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,43 +96,98 @@ export interface RooCodeAPI extends EventEmitter<RooCodeEvents> {
9696
}
9797

9898
export type ClineAsk =
99+
/** LLM asks a question that user should respond to */
99100
| "followup"
101+
/** LLM asks for permisson to run terminal command */
100102
| "command"
103+
/** LLM asks for permission to read the terminal command output */
101104
| "command_output"
105+
/**
106+
* After LLM say "completion_result", we need to show "Start New Task" button and wait for the user to click it
107+
* — the "completion_result" ask will wait for that click
108+
*/
102109
| "completion_result"
110+
/** LLM asks for permission to use a tool (e.g. read file or apply a diff) */
103111
| "tool"
112+
/** Roo-Code failed to make an API request and asks whether to retry or give up (start a new task) */
104113
| "api_req_failed"
114+
/**
115+
* The user triggered task resume, it became visible in the sidebar, and now the user is asked to confirm
116+
* the resume
117+
*/
105118
| "resume_task"
119+
/**
120+
* Similar to "resume_task", but for tasks that are already in completed state (there is only "start new task"
121+
* button and no "resume task" button)
122+
*/
106123
| "resume_completed_task"
124+
/**
125+
* It is a mistake when LLM in its answer did not used a tool or attempted completion. It is also a mistake
126+
* when a tool is invoked without required arguments. Three mistakes will trigger this ask. User can give now
127+
* more information to help LLM.
128+
*/
107129
| "mistake_limit_reached"
130+
/** LLM asks whether it can open an URL in the browser */
108131
| "browser_action_launch"
132+
/** LLM asks whether it can use MCP server to make an MCP API request */
109133
| "use_mcp_server"
134+
/**
135+
* This is probably a bug. "finishTask" is a tool that signals that the subtask is completed. User is asked
136+
* to confirm the completion, and then the "control flow" returns to the parent task.
137+
*/
110138
| "finishTask"
111139

112140
export type ClineSay =
141+
/** Probably a bug. Cannot find any place where "task" is used in "say" */
113142
| "task"
143+
/** Roo-Code informs LLM about some mistake (e.g. missing tool arguments) */
114144
| "error"
145+
/** Roo-Code starts making an API request and provides basic information about the environment */
115146
| "api_req_started"
147+
/**
148+
* Roo-Code finished performing an API request. Data from this "say" are moved to "api_req_started" "say"
149+
* and the "api_req_started" "say" is deleted. However cannot find any place where it is said.
150+
*/
116151
| "api_req_finished"
152+
/** Roo-Code failed to make an API request, asked the user whether to retry, and now signals the retry */
117153
| "api_req_retried"
154+
/** Like "api_req_retried", but we hit the rate limit and have to wait for some time before retrying */
118155
| "api_req_retry_delayed"
156+
/** Roo-Code says: "aggregated api_req metrics from deleted messages" */
119157
| "api_req_deleted"
158+
/** Generic text message said by the user, Roo-Code or LLM */
120159
| "text"
160+
/** As I understand, some LLMs can talk to themselves and verbose their thougths as "reasoning" */
121161
| "reasoning"
162+
/** Marks that the task is completed (green checkmark and some text) */
122163
| "completion_result"
164+
/** The user response for e.g. "followup" ask */
123165
| "user_feedback"
166+
/** LLM generated some file, but the user added some changes to it. This "say" informs about the changes done */
124167
| "user_feedback_diff"
168+
/** An output from a terminal command, so LLM knows the command output */
125169
| "command_output"
170+
/** This is probably a bug. Cannot find any place where "tool" is used in "say" */
126171
| "tool"
172+
/** Informs the user that the shell integration is unavailable */
127173
| "shell_integration_warning"
174+
/** LLM says what actions should be taken in the browser (scroll down, click, etc.) */
128175
| "browser_action"
176+
/** Roo-Code started launching the browser, this say triggers the loading spinner */
129177
| "browser_action_result"
178+
/** Probably a bug. Cannot find any place where "command" is used in "say" */
130179
| "command"
180+
/** Roo-Code started making an MCP server request, this say triggers the loading spinner */
131181
| "mcp_server_request_started"
182+
/** The response from the MCP server */
132183
| "mcp_server_response"
184+
/** Probably a bug. Cannot find any usage of "new_task_started" in the code */
133185
| "new_task_started"
186+
/** Probably a bug. This is a tool, not a "say" */
134187
| "new_task"
188+
/** Roo-Code saved a checkpoint */
135189
| "checkpoint_saved"
190+
/** Informs the LLM that it does not have access to a file, because it is listed in ".rooignore" */
136191
| "rooignore_error"
137192

138193
export interface ClineMessage {

0 commit comments

Comments
 (0)