MCPcopy
hub / github.com/claude-code-best/claude-code / getViewedTeammateTask

Function getViewedTeammateTask

src/state/selectors.ts:18–40  ·  view source on GitHub ↗
(
  appState: Pick<AppState, 'viewingAgentTaskId' | 'tasks'>,
)

Source from the content-addressed store, hash-verified

16 * - The task is not an in-process teammate task
17 */
18export function getViewedTeammateTask(
19 appState: Pick<AppState, 'viewingAgentTaskId' | 'tasks'>,
20): InProcessTeammateTaskState | undefined {
21 const { viewingAgentTaskId, tasks } = appState
22
23 // Not viewing any teammate
24 if (!viewingAgentTaskId) {
25 return undefined
26 }
27
28 // Look up the task
29 const task = tasks[viewingAgentTaskId]
30 if (!task) {
31 return undefined
32 }
33
34 // Verify it's an in-process teammate task
35 if (!isInProcessTeammateTask(task)) {
36 return undefined
37 }
38
39 return task
40}
41
42/**
43 * Return type for getActiveAgentForInput selector.

Callers 6

TeammateViewHeaderFunction · 0.85
SpinnerWithVerbInnerFunction · 0.85
useSwarmBannerFunction · 0.85
PromptInputFunction · 0.85
getActiveAgentForInputFunction · 0.85

Calls 1

isInProcessTeammateTaskFunction · 0.85

Tested by

no test coverage detected