mirror of
https://github.com/stablyai/orca.git
synced 2026-10-31 00:57:45 +00:00
* refactor(providers): delete the SSH git and filesystem providers and relay-only wiring * refactor(ssh): drop relay-protocol exports only the deleted stream readers used --------- Co-authored-by: m4air <m4air@Mac.localdomain>
25 lines
797 B
TypeScript
25 lines
797 B
TypeScript
import type { LocalGitExecOptions } from './github-repository-identity'
|
|
|
|
export function githubApiRepositoryProbeCacheKey(
|
|
repoPath: string,
|
|
remoteName: string,
|
|
connectionId: string | null | undefined,
|
|
localGitOptions: LocalGitExecOptions,
|
|
requireVerifiedSshProbe: boolean
|
|
): string {
|
|
const runtimeKey = connectionId
|
|
? `ssh:${connectionId}`
|
|
: `local:${localGitOptions.wslDistro ?? 'host'}`
|
|
return `${runtimeKey}\0${repoPath}\0${remoteName}\0${requireVerifiedSshProbe ? 'verified' : 'tolerant'}`
|
|
}
|
|
|
|
export function resolveGitHubApiRepositoryProbe<T>(
|
|
value: T | undefined,
|
|
requireVerifiedSshProbe: boolean
|
|
): T | null {
|
|
if (value === undefined && requireVerifiedSshProbe) {
|
|
throw new Error('GitHub repository identity is unverifiable.')
|
|
}
|
|
return value ?? null
|
|
}
|