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 { AgentSessionQueuedMessage } from './agent-session-wire'
import type { AgentJournalSubmission } from './agent-session-journal-types'
import { agentSessionSendBodyFingerprint } from './structured-agent-session-send-mutation'

/** React container identity is not a new host publication. */
export function queuedEditPublicationKey(
  view: {
    messages: readonly AgentSessionQueuedMessage[] | null
    cards: readonly { messageId: string }[]
    submissions?: readonly AgentJournalSubmission[]
  },
  sessionId: string,
  messageId: string | undefined
): string {
  if (messageId === undefined) {
    return '[]'
  }
  const listed = view.messages?.find((entry) => entry.messageId === messageId)
  return JSON.stringify([
    view.messages === null,
    listed ? agentSessionSendBodyFingerprint(sessionId, listed.body) : null,
    view.cards.some((entry) => entry.messageId === messageId),
    view.submissions
      ?.filter((entry) => entry.queuedMessageId === messageId)
      .map((entry) => entry.payloadFingerprint)
  ])
}