| 855 | }; |
| 856 | } |
| 857 | |
| 858 | function readCoordination(projectRoot) { |
| 859 | try { |
| 860 | return { |
| 861 | instances: getCoordinationStatus({ projectRoot }).instances, |
| 862 | claims: getClaimStatus({ projectRoot }).claims, |
| 863 | }; |
| 864 | } catch { |
| 865 | return { instances: [], claims: [] }; |
| 866 | } |
| 867 | } |
| 868 | |
| 869 | function hasGitContext(projectRoot) { |
| 870 | let current = path.resolve(projectRoot); |
| 871 | while (true) { |
| 872 | if (fileExists(path.join(current, '.git'))) return true; |
| 873 | const parent = path.dirname(current); |
| 874 | if (parent === current) return false; |
| 875 | current = parent; |
| 876 | } |
| 877 | } |
| 878 | |
| 879 | function readWorktrees(projectRoot) { |
| 880 | if (!hasGitContext(projectRoot)) return []; |