refactor: implemented $PWD > cwd to prevent macOS symlink resolution

- Replaced all direct `process.cwd()` calls with `getProjectDir()` utility function across 40+ files to centralize project directory resolution logic.
- Added `getProjectDir()` and `setProjectDir()` functions to `@oh-my-pi/pi-utils/dirs` module to provide abstracted project directory management.
- Made `SessionManager.list()` method asynchronous to support asynchronous session discovery operations.
- Updated default working directory resolution throughout codebase to use `getProjectDir()` instead of `process.cwd()` for improved project directory detection.
This commit is contained in:
can1357
2026-02-13 23:40:02 +01:00
parent f8e915e14e
commit d1e16d2101
43 changed files with 161 additions and 111 deletions
@@ -2,7 +2,7 @@
* System information collection for debug reports.
*/
import * as os from "node:os";
import { VERSION } from "@oh-my-pi/pi-utils/dirs";
import { getProjectDir, VERSION } from "@oh-my-pi/pi-utils/dirs";
export interface SystemInfo {
os: string;
@@ -65,7 +65,7 @@ export async function collectSystemInfo(): Promise<SystemInfo> {
bun: Bun.version,
node: process.version,
},
cwd: process.cwd(),
cwd: getProjectDir(),
shell,
terminal,
};