mirror of
https://github.com/stablyai/orca.git
synced 2026-09-29 16:02:50 +00:00
* Split speech session lifecycle * Split terminal output scheduler pipeline * Split mobile browser pane modules * Prune resolved max-lines suppressions * Split pane tree equalization logic * Extract mobile troubleshoot screen styles * Split external automation manager * Split main window service attachments * Split hosted review creation checks * Split automation dispatch event handling * Split settings navigation metadata * Split daemon initialization lifecycle * Split GitLab item dialog * Split relay dispatcher layers * Split mobile host screen * Retarget mobile view settings source test * Split runtime file client layers * Split ports panel layers * Split runtime environments pane layers * Split local PTY provider responsibilities * Split CDP bridge responsibilities * Split relay Git handler responsibilities * Track moved relay Git fetch audit * Split Linear item drawer responsibilities * Split telemetry event schema responsibilities * Split resource usage status responsibilities * Split remote terminal multiplexer responsibilities * Split Git worktree responsibilities * Split Codex hook service responsibilities * Keep mirrored hook trust type private * Split web runtime session responsibilities * Split GitHub project view read path * Split Claude runtime auth responsibilities * Split runtime RPC server responsibilities * Split Settings page responsibilities * Split filesystem watcher responsibilities * Fix F3-speech for #17123 * Fix F1-cycle for #17131 * Fix F4-navtest for #17157 * Fix F2-allowlist for #17161
40 lines
1.5 KiB
TypeScript
40 lines
1.5 KiB
TypeScript
import * as path from 'node:path'
|
|
import {
|
|
isWindowsAbsolutePathLike,
|
|
normalizeRuntimePathForComparison
|
|
} from '../../shared/cross-platform-path'
|
|
|
|
// ── Path normalization ───────────────────────────────────────────────
|
|
|
|
function normalizeWatcherRootPath(rootPath: string): string {
|
|
let resolved = isWindowsAbsolutePathLike(rootPath)
|
|
? path.win32.resolve(rootPath)
|
|
: path.resolve(rootPath)
|
|
// Why: Windows watcher events may use lowercase drive letters vs stored uppercase; normalize so renderer casing stays consistent (§4.4).
|
|
if (/^[a-zA-Z]:/.test(resolved)) {
|
|
resolved = resolved.charAt(0).toUpperCase() + resolved.slice(1)
|
|
}
|
|
return resolved
|
|
}
|
|
|
|
export function getLocalWatcherRoot(rootPath: string): { key: string; path: string } {
|
|
const normalizedPath = normalizeWatcherRootPath(rootPath)
|
|
return {
|
|
// Why: Windows drive/UNC paths are case-insensitive; cleanup must match the owner even when Git returns a different spelling.
|
|
key: normalizeRuntimePathForComparison(normalizedPath),
|
|
path: normalizedPath
|
|
}
|
|
}
|
|
|
|
export function normalizeWatcherEventPath(eventPath: string): string {
|
|
let resolved = path.resolve(eventPath)
|
|
if (/^[a-zA-Z]:/.test(resolved)) {
|
|
resolved = resolved.charAt(0).toUpperCase() + resolved.slice(1)
|
|
}
|
|
return resolved
|
|
}
|
|
|
|
export function getRemoteWatcherKey(connectionId: string, worktreePath: string): string {
|
|
return JSON.stringify([connectionId, normalizeRuntimePathForComparison(worktreePath)])
|
|
}
|