(
overrides?: Partial<{
sendMessage: ReturnType<typeof mock>;
resumeStream: ReturnType<typeof mock>;
clearQueue: ReturnType<typeof mock>;
hasQueuedWorkspaceTurn: ReturnType<typeof mock>;
hasQueuedMessages: ReturnType<typeof mock>;
isBusyForMessage: ReturnType<typeof mock>;
hasPendingQueuedOrPreparingTurn: ReturnType<typeof mock>;
waitForIdleAndNoQueuedMessages: ReturnType<typeof mock>;
waitForIdle: ReturnType<typeof mock>;
waitForPendingStreamErrorRecoveryDecision: ReturnType<typeof mock>;
archive: ReturnType<typeof mock>;
deleteWorktree: ReturnType<typeof mock>;
remove: ReturnType<typeof mock>;
emit: ReturnType<typeof mock>;
getInfo: ReturnType<typeof mock>;
replaceHistory: ReturnType<typeof mock>;
updateAgentStatus: ReturnType<typeof mock>;
isExperimentEnabled: ReturnType<typeof mock>;
emitChatEvent: ReturnType<typeof mock>;
isWorkflowInvocationCurrent: ReturnType<typeof mock>;
create: ReturnType<typeof mock>;
}>
)
| 362 | } |
| 363 | |
| 364 | function createWorkspaceServiceMocks( |
| 365 | overrides?: Partial<{ |
| 366 | sendMessage: ReturnType<typeof mock>; |
| 367 | resumeStream: ReturnType<typeof mock>; |
| 368 | clearQueue: ReturnType<typeof mock>; |
| 369 | hasQueuedWorkspaceTurn: ReturnType<typeof mock>; |
| 370 | hasQueuedMessages: ReturnType<typeof mock>; |
| 371 | isBusyForMessage: ReturnType<typeof mock>; |
| 372 | hasPendingQueuedOrPreparingTurn: ReturnType<typeof mock>; |
| 373 | waitForIdleAndNoQueuedMessages: ReturnType<typeof mock>; |
| 374 | waitForIdle: ReturnType<typeof mock>; |
| 375 | waitForPendingStreamErrorRecoveryDecision: ReturnType<typeof mock>; |
| 376 | archive: ReturnType<typeof mock>; |
| 377 | deleteWorktree: ReturnType<typeof mock>; |
| 378 | remove: ReturnType<typeof mock>; |
| 379 | emit: ReturnType<typeof mock>; |
| 380 | getInfo: ReturnType<typeof mock>; |
| 381 | replaceHistory: ReturnType<typeof mock>; |
| 382 | updateAgentStatus: ReturnType<typeof mock>; |
| 383 | isExperimentEnabled: ReturnType<typeof mock>; |
| 384 | emitChatEvent: ReturnType<typeof mock>; |
| 385 | isWorkflowInvocationCurrent: ReturnType<typeof mock>; |
| 386 | create: ReturnType<typeof mock>; |
| 387 | }> |
| 388 | ): { |
| 389 | workspaceService: WorkspaceService; |
| 390 | sendMessage: ReturnType<typeof mock>; |
| 391 | resumeStream: ReturnType<typeof mock>; |
| 392 | clearQueue: ReturnType<typeof mock>; |
| 393 | hasQueuedWorkspaceTurn: ReturnType<typeof mock>; |
| 394 | hasQueuedMessages: ReturnType<typeof mock>; |
| 395 | isBusyForMessage: ReturnType<typeof mock>; |
| 396 | waitForIdleAndNoQueuedMessages: ReturnType<typeof mock>; |
| 397 | waitForIdle: ReturnType<typeof mock>; |
| 398 | hasPendingQueuedOrPreparingTurn: ReturnType<typeof mock>; |
| 399 | waitForPendingStreamErrorRecoveryDecision: ReturnType<typeof mock>; |
| 400 | archive: ReturnType<typeof mock>; |
| 401 | deleteWorktree: ReturnType<typeof mock>; |
| 402 | remove: ReturnType<typeof mock>; |
| 403 | emit: ReturnType<typeof mock>; |
| 404 | getInfo: ReturnType<typeof mock>; |
| 405 | replaceHistory: ReturnType<typeof mock>; |
| 406 | updateAgentStatus: ReturnType<typeof mock>; |
| 407 | isExperimentEnabled: ReturnType<typeof mock>; |
| 408 | emitChatEvent: ReturnType<typeof mock>; |
| 409 | isWorkflowInvocationCurrent: ReturnType<typeof mock>; |
| 410 | create: ReturnType<typeof mock>; |
| 411 | } { |
| 412 | const sendMessage = |
| 413 | overrides?.sendMessage ?? mock((): Promise<Result<void>> => Promise.resolve(Ok(undefined))); |
| 414 | const resumeStream = |
| 415 | overrides?.resumeStream ?? |
| 416 | mock((): Promise<Result<{ started: boolean }>> => Promise.resolve(Ok({ started: true }))); |
| 417 | const clearQueue = overrides?.clearQueue ?? mock((): Result<void> => Ok(undefined)); |
| 418 | const hasQueuedWorkspaceTurn = overrides?.hasQueuedWorkspaceTurn ?? mock(() => false); |
| 419 | const hasQueuedMessages = overrides?.hasQueuedMessages ?? mock(() => false); |
| 420 | const isBusyForMessage = overrides?.isBusyForMessage ?? mock(() => false); |
| 421 | const hasPendingQueuedOrPreparingTurn = |
no test coverage detected