Skip to content

armgit / orca

Public Imported from GitHub
0

Orca is the place for working with a fleet of agents (e.g. Grok Bot, Claude Code). Run any coding agent with your own subscription. Available on desktop, mobile and remote runtime.

966 B
Raw Blame
import {
  agentSessionBackgroundTasksEqual,
  type AgentSessionBackgroundTaskState
} from './agent-session-wire'
import { agentChildWorkViewsEqual } from './agent-status-child-work-view-wire'

/** Structural equality so a republished roster never churns transcript identity. */
export function backgroundTaskStatesEqual(
  left: AgentSessionBackgroundTaskState | null | undefined,
  right: AgentSessionBackgroundTaskState | null | undefined
): boolean {
  if (left === right) {
    return true
  }
  if (
    !left ||
    !right ||
    left.state !== right.state ||
    left.supportsTaskStop !== right.supportsTaskStop ||
    left.supportsStopAll !== right.supportsStopAll ||
    left.incomplete !== right.incomplete
  ) {
    return false
  }
  return (
    agentSessionBackgroundTasksEqual(left.tasks, right.tasks) &&
    agentSessionBackgroundTasksEqual(left.settledTasks, right.settledTasks) &&
    agentChildWorkViewsEqual(left.children, right.children)
  )
}