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 { AgentType } from './agent-status-types'
import type { AgentSessionSlashCommand } from './agent-session-wire'
import {
  prepareStructuredAgentSessionComposerCommand,
  isStructuredAgentSessionGoalCommand
} from './structured-agent-session-composer'

/** Provider prompt commands remain content; host actions cannot replace a queued body. */
export function queuedMessageEditAcceptsText(
  text: string,
  agent: AgentType,
  reported?: readonly AgentSessionSlashCommand[],
  hostSetsGoals = false
): boolean {
  return prepareQueuedMessageEditText(agent, reported, hostSetsGoals)(text)
}

export function prepareQueuedMessageEditText(
  agent: AgentType,
  reported?: readonly AgentSessionSlashCommand[],
  hostSetsGoals = false
): (text: string) => boolean {
  const hostCommand = prepareStructuredAgentSessionComposerCommand(agent, reported)
  return (text) =>
    !(
      hostCommand(text) ||
      (hostSetsGoals && isStructuredAgentSessionGoalCommand(text)) ||
      /^\/resume(?:\s|$)/i.test(text)
    )
}