feat(coding-agent/cli): implemented ps command for daemon processes

- Added a new ps command to list, inspect, view logs, and control daemon processes.
- Implemented CLI handlers and help metadata supporting daemon process operations.
- Added helpers for managing daemon scope metadata, paths, and live broker PIDs.
This commit is contained in:
can1357
2026-08-20 04:39:24 +02:00
parent d7fbb503d8
commit e9acc575a7
11 changed files with 701 additions and 42 deletions
+12 -2
View File
@@ -854,10 +854,20 @@ export function getSecretPlaceholderKeyPath(): string {
return keyPath;
}
/** Root directory containing every per-project daemon runtime scope (~/.omp/run/daemons; XDG default: $XDG_STATE_HOME/omp/run/daemons). */
export function getDaemonRuntimeRoot(): string {
return dirs.rootSubdir(path.join("run", "daemons"), "state");
}
/** Get the daemon runtime directory for a project (~/.omp/run/daemons/<hash>; XDG default: $XDG_STATE_HOME/omp/run/daemons/<hash>). */
export function getDaemonRuntimeDir(projectDir: string): string {
const key = Bun.hash.wyhash(path.resolve(projectDir)).toString(16).padStart(16, "0");
return dirs.rootSubdir(path.join("run", "daemons", key), "state");
return path.join(getDaemonRuntimeRoot(), key);
}
/** Root directory containing every machine-global daemon service scope. */
export function getGlobalDaemonRuntimeRoot(): string {
return path.join(getBaseConfigRoot(), "run", "daemons", "global");
}
/** Get a profile-independent runtime directory for a machine-global daemon service. */
@@ -865,7 +875,7 @@ export function getGlobalDaemonRuntimeDir(service: string): string {
if (!/^[a-z0-9][a-z0-9._-]*$/i.test(service)) {
throw new Error(`Invalid global daemon service name: ${JSON.stringify(service)}`);
}
return path.join(getBaseConfigRoot(), "run", "daemons", "global", service);
return path.join(getGlobalDaemonRuntimeRoot(), service);
}
/** Get the provider in-flight root directory (~/.omp/run/provider-inflight; XDG default: $XDG_STATE_HOME/omp/run/provider-inflight). */