mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-06 08:18:39 +00:00
Add type for RooCodeEventName.TaskSpawned (#7465)
This commit is contained in:
parent
29f6e0a035
commit
7a9c55b0e4
3 changed files with 6 additions and 2 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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]
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -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"))
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue