mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 08:02:28 +00:00
* fix(onboarding): stop wrong-host folder fallback (#6367) * test(repos): isolate runtime fallback proofs * test(repos): cover runtime status RPC failures * test(repos): drop obsolete max-lines suppression * Prevent runtime path probes from leaking project groups * fix(onboarding): gate runtime folder fallback status Co-authored-by: Orca <help@stably.ai> --------- Co-authored-by: Jinwoo-H <jinwoo0825@gmail.com> Co-authored-by: Orca <help@stably.ai>
36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
export type FolderWorkspacePathStatusReason =
|
|
| 'missing'
|
|
| 'not-directory'
|
|
| 'unavailable'
|
|
| 'ambiguous-connection'
|
|
|
|
export const FOLDER_WORKSPACE_PATH_STATUS_TTL_MS = 10_000
|
|
|
|
export type FolderWorkspacePathStatusRequest =
|
|
| { scope: 'folder-workspace'; folderWorkspaceId: string }
|
|
| { scope: 'project-group'; projectGroupId: string }
|
|
| { scope: 'path'; path: string; connectionId?: string | null }
|
|
|
|
export type FolderWorkspacePathStatus = {
|
|
path: string
|
|
exists: boolean
|
|
reason?: FolderWorkspacePathStatusReason
|
|
}
|
|
|
|
export function isConfirmedStaleFolderPathStatus(
|
|
status: FolderWorkspacePathStatus | null | undefined
|
|
): boolean {
|
|
return (
|
|
status?.exists === false && (status.reason === 'missing' || status.reason === 'not-directory')
|
|
)
|
|
}
|
|
|
|
export function blocksFolderWorkspaceActivation(
|
|
status: FolderWorkspacePathStatus | null | undefined
|
|
): boolean {
|
|
return (
|
|
isConfirmedStaleFolderPathStatus(status) ||
|
|
(status?.exists === false && status.reason === 'ambiguous-connection')
|
|
)
|
|
}
|