fix: add taskCommandExecuted event to TaskEvents and RooCodeEvents types

- Added taskCommandExecuted event definition to TaskEvents in packages/types/src/task.ts
- Added taskCommandExecuted event to rooCodeEventsSchema in packages/types/src/events.ts
- This fixes the TypeScript errors where emit() was called with an event not defined in TaskEvents
This commit is contained in:
Roo Code 2025-08-11 17:50:35 +00:00
parent de6db594b5
commit f4c17174bd
2 changed files with 24 additions and 0 deletions

View file

@ -77,6 +77,18 @@ export const rooCodeEventsSchema = z.object({
[RooCodeEventName.TaskToolFailed]: z.tuple([z.string(), toolNamesSchema, z.string()]),
[RooCodeEventName.TaskTokenUsageUpdated]: z.tuple([z.string(), tokenUsageSchema]),
// Command Execution
taskCommandExecuted: z.tuple([
z.string(),
z.object({
command: z.string(),
exitCode: z.number().optional(),
output: z.string(),
succeeded: z.boolean(),
failureReason: z.string().optional(),
}),
]),
})
export type RooCodeEvents = z.infer<typeof rooCodeEventsSchema>

View file

@ -96,4 +96,16 @@ export type TaskEvents = {
// Task Analytics
[RooCodeEventName.TaskToolFailed]: [taskId: string, tool: ToolName, error: string]
[RooCodeEventName.TaskTokenUsageUpdated]: [taskId: string, tokenUsage: TokenUsage]
// Command Execution
taskCommandExecuted: [
taskId: string,
details: {
command: string
exitCode: number | undefined
output: string
succeeded: boolean
failureReason?: string
},
]
}