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.

642 B
Raw Blame
import { jiraCommentListSchema } from './jira-reply-schema'

export type JiraDetailComment = {
  id: string
  author?: string
  authorAvatarUrl?: string
  body: string
  createdAt?: string
}

// Optional comments must not hide a readable issue.
export function toJiraDetailComments(result: unknown): JiraDetailComment[] {
  const decoded = jiraCommentListSchema.safeParse(result)
  if (!decoded.success) {
    return []
  }
  return decoded.data.map((comment) => ({
    id: comment.id,
    author: comment.user?.displayName,
    authorAvatarUrl: comment.user?.avatarUrl,
    body: comment.body ?? '',
    createdAt: comment.createdAt
  }))
}