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.

754 B
Raw Blame
import type { NativeChatMessage } from './native-chat-types'
import { deriveNativeChatRowContent } from './native-chat-row-content'
import { nativeChatBlocksInOwnWords } from './native-chat/native-chat-stopped-before-start'
import { withoutNativeChatVisualDirectiveLines } from './native-chat/native-chat-visual-directive'

/** What a message's Copy action copies: its words, less any agent visual lines. */
export function nativeChatMessageCopyText(
  message: Pick<NativeChatMessage, 'role' | 'blocks'>,
  stoppedLabel?: string
): string {
  const { markdown } = deriveNativeChatRowContent(
    nativeChatBlocksInOwnWords(message.blocks, stoppedLabel)
  )
  return message.role === 'user' ? markdown : withoutNativeChatVisualDirectiveLines(markdown)
}