Skip to content

Commit f4c1717

Browse files
committed
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
1 parent de6db59 commit f4c1717

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

packages/types/src/events.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,18 @@ export const rooCodeEventsSchema = z.object({
7777

7878
[RooCodeEventName.TaskToolFailed]: z.tuple([z.string(), toolNamesSchema, z.string()]),
7979
[RooCodeEventName.TaskTokenUsageUpdated]: z.tuple([z.string(), tokenUsageSchema]),
80+
81+
// Command Execution
82+
taskCommandExecuted: z.tuple([
83+
z.string(),
84+
z.object({
85+
command: z.string(),
86+
exitCode: z.number().optional(),
87+
output: z.string(),
88+
succeeded: z.boolean(),
89+
failureReason: z.string().optional(),
90+
}),
91+
]),
8092
})
8193

8294
export type RooCodeEvents = z.infer<typeof rooCodeEventsSchema>

packages/types/src/task.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,4 +96,16 @@ export type TaskEvents = {
9696
// Task Analytics
9797
[RooCodeEventName.TaskToolFailed]: [taskId: string, tool: ToolName, error: string]
9898
[RooCodeEventName.TaskTokenUsageUpdated]: [taskId: string, tokenUsage: TokenUsage]
99+
100+
// Command Execution
101+
taskCommandExecuted: [
102+
taskId: string,
103+
details: {
104+
command: string
105+
exitCode: number | undefined
106+
output: string
107+
succeeded: boolean
108+
failureReason?: string
109+
},
110+
]
99111
}

0 commit comments

Comments
 (0)