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
export const LOCAL_COMMIT_MESSAGE_HOST_KEY = 'local'
export const UNKNOWN_COMMIT_MESSAGE_HOST_KEY = 'unknown'
export const RUNTIME_COMMIT_MESSAGE_HOST_KEY_PREFIX = 'runtime:'

export function getCommitMessageModelDiscoveryHostKeyForLocalRuntime(
  wslDistro: string | null | undefined
): string {
  const distro = wslDistro?.trim()
  return distro ? `wsl:${distro}` : LOCAL_COMMIT_MESSAGE_HOST_KEY
}

export function getCommitMessageModelDiscoveryHostKey(
  connectionId: string | null | undefined
): string {
  if (connectionId === undefined) {
    return UNKNOWN_COMMIT_MESSAGE_HOST_KEY
  }
  return connectionId ? `ssh:${connectionId}` : LOCAL_COMMIT_MESSAGE_HOST_KEY
}

export function getCommitMessageModelDiscoveryHostKeyForScope(
  scope: string | null | undefined
): string {
  if (scope === undefined) {
    return UNKNOWN_COMMIT_MESSAGE_HOST_KEY
  }
  if (!scope) {
    return LOCAL_COMMIT_MESSAGE_HOST_KEY
  }
  if (scope.startsWith(RUNTIME_COMMIT_MESSAGE_HOST_KEY_PREFIX)) {
    return scope
  }
  return getCommitMessageModelDiscoveryHostKey(scope)
}