Add type for RooCodeEventName.TaskSpawned (#7465)

This commit is contained in:
Matt Rubens 2025-08-27 17:40:06 -04:00 committed by Shawn
parent 29f6e0a035
commit 7a9c55b0e4
3 changed files with 6 additions and 2 deletions

View file

@ -1,6 +1,6 @@
{
"name": "@roo-code/types",
"version": "1.61.0",
"version": "1.62.0",
"description": "TypeScript type definitions for Roo Code.",
"publishConfig": {
"access": "public",

View file

@ -57,6 +57,9 @@ export type TaskProviderEvents = {
[RooCodeEventName.TaskInteractive]: [taskId: string]
[RooCodeEventName.TaskResumable]: [taskId: string]
[RooCodeEventName.TaskIdle]: [taskId: string]
// Subtask Lifecycle
[RooCodeEventName.TaskSpawned]: [taskId: string]
}
/**

View file

@ -84,6 +84,7 @@ const mockCline = {
consecutiveMistakeCount: 0,
isPaused: false,
pausedModeSlug: "ask",
taskId: "mock-parent-task-id",
providerRef: {
deref: vi.fn(() => ({
getState: vi.fn(() => ({ customModes: [], mode: "ask" })),
@ -157,7 +158,7 @@ describe("newTaskTool", () => {
)
// Verify side effects
expect(mockCline.emit).toHaveBeenCalledWith("taskSpawned", expect.any(String)) // Assuming initCline returns a mock task ID
expect(mockCline.emit).toHaveBeenCalledWith("taskSpawned", "mock-subtask-id")
expect(mockCline.isPaused).toBe(true)
expect(mockCline.emit).toHaveBeenCalledWith("taskPaused")
expect(mockPushToolResult).toHaveBeenCalledWith(expect.stringContaining("Successfully created new task"))