( client: DaemonClient, workspaceRoot: string, workspaceKey: string, )
| 119 | } |
| 120 | |
| 121 | async function handleStatus( |
| 122 | client: DaemonClient, |
| 123 | workspaceRoot: string, |
| 124 | workspaceKey: string, |
| 125 | ): Promise<void> { |
| 126 | try { |
| 127 | const status = await client.status(); |
| 128 | writeLine('Daemon Status: Running'); |
| 129 | writeLine(` PID: ${status.pid}`); |
| 130 | writeLine(` Workspace: ${status.workspaceRoot ?? workspaceRoot}`); |
| 131 | writeLine(` Socket: ${status.socketPath}`); |
| 132 | if (status.logPath) { |
| 133 | writeLine(` Logs: ${status.logPath}`); |
| 134 | } |
| 135 | writeLine(` Started: ${status.startedAt}`); |
| 136 | writeLine(` Tools: ${status.toolCount}`); |
| 137 | writeLine(` Workflows: ${status.enabledWorkflows.join(', ') || '(default)'}`); |
| 138 | } catch (err) { |
| 139 | if (err instanceof Error && err.message.includes('not running')) { |
| 140 | writeLine('Daemon Status: Not running'); |
| 141 | writeLine(` Workspace: ${workspaceRoot}`); |
| 142 | const entry = readDaemonRegistryEntry(workspaceKey); |
| 143 | if (entry?.logPath) { |
| 144 | writeLine(` Logs: ${entry.logPath}`); |
| 145 | } |
| 146 | } else { |
| 147 | console.error('Error:', err instanceof Error ? err.message : String(err)); |
| 148 | process.exitCode = 1; |
| 149 | } |
| 150 | } |
| 151 | } |
| 152 | |
| 153 | async function handleStop(client: DaemonClient): Promise<void> { |
| 154 | try { |
no test coverage detected