Files
orca/src/preload/api/preflight-api.ts
T
Neil c10881fa8c refactor(shared): organize execution and automation defining owners (#39776)
* refactor: import journal queue state from defining owners

* refactor(shared): organize execution and automation owners

* fix: retain type imports used by surviving test cases

* refactor: finish work item owners and refresh validation metadata

* test: infer reconnect status fixture type

* test(claude): resolve source files beside same-named directories

* test(runtime): group repository creation mock registrations
2026-11-08 06:46:09 -08:00

70 lines
2.5 KiB
TypeScript

import type { ZCodeInteractiveCapability } from '../../shared/zcode-missing-tui'
import type { ProjectExecutionRuntimeResolution } from '../../shared/execution-host/project-execution-runtime'
import type {
PathSource,
ShellHydrationFailureReason
} from '../../shared/shell/launch/shell-path-hydration-types'
export type PreflightStatus = {
git: { installed: boolean }
gh: { installed: boolean; authenticated: boolean }
/** Absent on payloads predating GitLab support. */
glab?: { installed: boolean; authenticated: boolean }
bitbucket?: { configured: boolean; authenticated: boolean; account: string | null }
azureDevOps?: {
configured: boolean
authenticated: boolean
account: string | null
baseUrl: string | null
tokenConfigured: boolean
}
gitea?: {
configured: boolean
authenticated: boolean
account: string | null
baseUrl: string | null
tokenConfigured: boolean
}
}
export type RefreshAgentsResult = {
agents: string[]
addedPathSegments: string[]
shellHydrationOk: boolean
/** shell_hydrate uses the full shell PATH; sync_seed_only uses the packaged PATH seed. */
pathSource: PathSource
pathFailureReason: ShellHydrationFailureReason
}
export type PreflightRuntimeContext = {
wslDistro?: string | null
wslDefault?: boolean
projectRuntime?: ProjectExecutionRuntimeResolution
}
export type PreflightApi = {
check: (
args?: PreflightRuntimeContext & { force?: boolean; wakeWslDistro?: boolean }
) => Promise<PreflightStatus>
/** Complete by default; background callers opt into host-owned enabled preferences. */
detectAgents: (
args?: PreflightRuntimeContext & { enabledOnly?: boolean; wakeWslDistro?: boolean }
) => Promise<string[]>
/** A WSL distro a background check was refused for is running now; re-ask. Desktop only. */
onWslDistroRunning?: (callback: (distro: string) => void) => () => void
/** Cached in main for the process lifetime. */
zcodeInteractiveCapability: () => Promise<ZCodeInteractiveCapability>
/** `wakeWslDistro`: a user act that may start a stopped WSL distro; background refreshes omit it. */
refreshAgents: (
args?: PreflightRuntimeContext & { enabledOnly?: boolean; wakeWslDistro?: boolean }
) => Promise<RefreshAgentsResult>
detectRemoteAgents: (args: { connectionId: string }) => Promise<string[]>
detectRemoteWindowsTerminalCapabilities: (args: { connectionId: string }) => Promise<{
wslAvailable: boolean
wslDistros: string[]
pwshAvailable: boolean
gitBashAvailable: boolean
hostPlatform: NodeJS.Platform | null
}>
}