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.

1.0 KB
Raw Blame
import type { AgentJournalRenderItem, AgentJournalSubmission } from './agent-session-journal-types'
import { activeStructuredAgentSessionTurnId } from './structured-agent-session-live-turn'
import {
  isStructuredAgentSessionMainAgentWorking,
  type StructuredAgentSessionWorkScope
} from './structured-agent-session-main-agent-working'
import { agentSessionCurrentContextRows } from './agent-session-context-clear'

/** Journal main-agent rule: running turn or unanswered send, including work hidden beneath an attention prompt. */
export function owesStructuredAgentSessionWork(
  items: readonly AgentJournalRenderItem[],
  submissions: readonly AgentJournalSubmission[],
  currentFence?: number | null,
  scope?: StructuredAgentSessionWorkScope
): boolean {
  const current = agentSessionCurrentContextRows(items, submissions)
  return isStructuredAgentSessionMainAgentWorking(
    activeStructuredAgentSessionTurnId(
      current.items,
      scope && ((item) => scope.isCurrentItem(item.itemId))
    ),
    current.submissions,
    currentFence,
    scope
  )
}