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.

823 B
Raw Blame
import { LOCAL_EXECUTION_HOST_ID, type ExecutionHostId } from '../execution-host'
import { isEphemeralSetupTerminalWorktreeId } from '../ephemeral-setup-terminal-worktree-id'
import { isFloatingWorkspaceId } from '../floating-workspace-worktree'

/** Rows without repo/folder ownership stay machine-local, never another host’s state (#31498). */
export function isLocalOnlyWorktreeMetaId(worktreeId: string): boolean {
  return isFloatingWorkspaceId(worktreeId) || isEphemeralSetupTerminalWorktreeId(worktreeId)
}

/** The host a metadata row for `worktreeId` belongs to when a caller names `executionHostId`. */
export function worktreeMetaHostFor(
  worktreeId: string,
  executionHostId: ExecutionHostId
): ExecutionHostId {
  return isLocalOnlyWorktreeMetaId(worktreeId) ? LOCAL_EXECUTION_HOST_ID : executionHostId
}