mirror of
https://github.com/stablyai/orca.git
synced 2026-11-03 02:27:43 +00:00
- Install store domain contexts with one generic symbol copy - Share one import-source classifier and one copy-name deconflicter across local, SSH and runtime-upload imports - Collapse kill.ts synthetic-exit and stop-failure repetition into helpers - Use Promise.allSettled in SSH transport teardown - Use the shared errorMessage() instead of inline copies - Fold isLiveSshPtyLease into ssh-types and drop the duplicate predicate Co-authored-by: m4air <m4air@Mac.localdomain>
25 lines
906 B
TypeScript
25 lines
906 B
TypeScript
export function isMissingError(error: unknown): boolean {
|
|
return (
|
|
error instanceof Error && 'code' in error && (error as NodeJS.ErrnoException).code === 'ENOENT'
|
|
)
|
|
}
|
|
|
|
// Why: localized permission errors keep these .NET/ACL markers even when the PowerShell text is mojibake.
|
|
export function isWindowsUserPathPermissionError(error: unknown): boolean {
|
|
if (!(error instanceof Error)) {
|
|
return false
|
|
}
|
|
const stderr =
|
|
'stderr' in error && typeof (error as { stderr?: unknown }).stderr === 'string'
|
|
? (error as { stderr: string }).stderr
|
|
: ''
|
|
const haystack = `${error.message}\n${stderr}`
|
|
return (
|
|
haystack.includes('UnauthorizedAccessException') ||
|
|
haystack.includes('SecurityException') ||
|
|
haystack.includes('Requested registry access is not allowed') ||
|
|
haystack.includes('Access is denied') ||
|
|
haystack.includes('Access to the registry key')
|
|
)
|
|
}
|