MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getActiveAgentForInput

Function getActiveAgentForInput

source code/state/selectors.ts:61–78  ·  view source on GitHub ↗
(
  appState: AppState,
)

Source from the content-addressed store, hash-verified

59 * Used by input routing logic to direct user messages to the correct agent.
60 */
61export function getActiveAgentForInput(
62 appState: AppState,
63): ActiveAgentForInput {
64 const viewedTask = getViewedTeammateTask(appState)
65 if (viewedTask) {
66 return { type: 'viewed', task: viewedTask }
67 }
68
69 const { viewingAgentTaskId, tasks } = appState
70 if (viewingAgentTaskId) {
71 const task = tasks[viewingAgentTaskId]
72 if (task?.type === 'local_agent') {
73 return { type: 'named_agent', task }
74 }
75 }
76
77 return { type: 'leader' }
78}

Callers 2

useSwarmBannerFunction · 0.85
PromptInputFunction · 0.85

Calls 1

getViewedTeammateTaskFunction · 0.85

Tested by

no test coverage detected