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.

4.1 KB
Raw Blame
export type ManagedDataAccountProvider = 'opencode' | 'devin'

export type ManagedDataAccountSummary = {
  id: string
  label: string
  integrations: string[]
  createdAt: number
}

export type ManagedDataAccountsState = {
  accounts: ManagedDataAccountSummary[]
  activeAccountId: string | null
}

export type CodexManagedAccount = {
  id: string
  email: string
  managedHomePath: string
  managedHomeRuntime?: 'host' | 'wsl'
  wslDistro?: string | null
  wslLinuxHomePath?: string | null
  providerAccountId?: string | null
  workspaceLabel?: string | null
  workspaceAccountId?: string | null
  createdAt: number
  updatedAt: number
  lastAuthenticatedAt: number
}

export type CodexManagedAccountSummary = {
  id: string
  email: string
  managedHomeRuntime?: 'host' | 'wsl'
  wslDistro?: string | null
  providerAccountId?: string | null
  workspaceLabel?: string | null
  workspaceAccountId?: string | null
  createdAt: number
  updatedAt: number
  lastAuthenticatedAt: number
}

/** Read-only identity of real ~/.codex for system-default (activeAccountId:null) display/attribution; this path never writes it. */
export type CodexSystemDefaultIdentity = {
  /** True when ~/.codex/auth.json exists (signed in via a token file). */
  hasAuth: boolean
  /** 'oauth' = ChatGPT sign-in with an id token (has ChatGPT usage);
   *  'api-key' = env-key/custom provider (no ChatGPT usage);
   *  'none' = signed out or identity could not be resolved. */
  authKind: 'oauth' | 'api-key' | 'none'
  email: string | null
  providerAccountId: string | null
  workspaceLabel: string | null
}

export type CodexRateLimitAccountsState = {
  accounts: CodexManagedAccountSummary[]
  activeAccountId: string | null
  activeAccountIdsByRuntime?: CodexManagedAccountRuntimeSelection
  /** Host’s real ~/.codex identity; omitted where unresolved, such as per-distro WSL. */
  systemDefault?: CodexSystemDefaultIdentity
}

export type CodexManagedAccountRuntimeSelection = {
  host: string | null
  wsl: Record<string, string | null>
}

export type ClaudeManagedAccount = {
  id: string
  email: string
  managedAuthPath: string
  managedAuthRuntime?: 'host' | 'wsl'
  wslDistro?: string | null
  wslLinuxAuthPath?: string | null
  authMethod: 'subscription-oauth' | 'unknown'
  organizationUuid?: string | null
  organizationName?: string | null
  createdAt: number
  updatedAt: number
  lastAuthenticatedAt: number
}

export type ClaudeManagedAccountSummary = {
  id: string
  email: string
  managedAuthRuntime?: 'host' | 'wsl'
  wslDistro?: string | null
  authMethod: 'subscription-oauth' | 'unknown'
  organizationUuid?: string | null
  organizationName?: string | null
  createdAt: number
  updatedAt: number
  lastAuthenticatedAt: number
  /** Its folder holds no login yet, e.g. an account saved by an older Orca; it needs a sign-in. */
  needsSignIn?: true
  /** Its folder holds no login, so its launches run on System default, signed in to it. */
  runsOnSystemDefault?: true
  /** The host folder its launches use; a legacy account's saved path may name an older one. */
  home?: string
}

/** A sign-in to a new account folder, or to a saved account's own when `accountId` is given. */
export type ClaudeSignInRequest = {
  accountId?: string
  runtime?: 'host' | 'wsl'
  wslDistro?: string | null
}

/** A sign-in in progress: `configDir` is the CLAUDE_CONFIG_DIR `claude auth login` runs against. */
export type ClaudeAccountSignIn = {
  accountId: string
  configDir: string
  runtime?: 'host' | 'wsl'
  wslDistro?: string | null
}

export type ClaudeRateLimitAccountsState = {
  accounts: ClaudeManagedAccountSummary[]
  activeAccountId: string | null
  activeAccountIdsByRuntime?: ClaudeManagedAccountRuntimeSelection
  /** The login System default holds, when the host can read it and accounts exist. */
  systemDefaultEmail?: string
  systemDefaultOrganizationUuid?: string
  /** The host folder System default launches use, when accounts exist. */
  systemDefaultHome?: string
  /** An older Orca's copy-based switching once wrote an account's login into System default. */
  systemDefaultMayBeCopied?: boolean
}

export type ClaudeManagedAccountRuntimeSelection = {
  host: string | null
  wsl: Record<string, string | null>
}