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

Function updateTaskState

source code/utils/swarm/inProcessRunner.ts:521–543  ·  view source on GitHub ↗

* Updates task state in AppState.

(
  taskId: string,
  updater: (task: InProcessTeammateTaskState) => InProcessTeammateTaskState,
  setAppState: SetAppStateFn,
)

Source from the content-addressed store, hash-verified

519 * Updates task state in AppState.
520 */
521function updateTaskState(
522 taskId: string,
523 updater: (task: InProcessTeammateTaskState) => InProcessTeammateTaskState,
524 setAppState: SetAppStateFn,
525): void {
526 setAppState(prev => {
527 const task = prev.tasks[taskId]
528 if (!task || task.type !== 'in_process_teammate') {
529 return prev
530 }
531 const updated = updater(task)
532 if (updated === task) {
533 return prev
534 }
535 return {
536 ...prev,
537 tasks: {
538 ...prev.tasks,
539 [taskId]: updated,
540 },
541 }
542 })
543}
544
545/**
546 * Sends a message to the leader's file-based mailbox.

Callers 1

runInProcessTeammateFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected