(
stateDir: string,
info: { port?: number; httpPort?: number; transport: 'socket' | 'http' | 'dual' },
)
| 142 | } |
| 143 | |
| 144 | function writeCurrentDaemonInfo( |
| 145 | stateDir: string, |
| 146 | info: { port?: number; httpPort?: number; transport: 'socket' | 'http' | 'dual' }, |
| 147 | ): void { |
| 148 | const paths = resolveDaemonPaths(stateDir); |
| 149 | fs.mkdirSync(paths.baseDir, { recursive: true }); |
| 150 | fs.writeFileSync( |
| 151 | paths.infoPath, |
| 152 | `${JSON.stringify({ |
| 153 | ...info, |
| 154 | token: 'local-secret', |
| 155 | pid: process.pid, |
| 156 | version: readVersion(), |
| 157 | codeSignature: resolveCurrentDaemonCodeSignature(), |
| 158 | processStartTime: readProcessStartTime(process.pid) ?? undefined, |
| 159 | })}\n`, |
| 160 | 'utf8', |
| 161 | ); |
| 162 | } |
| 163 | |
| 164 | test('resolveDaemonStartupHint prefers stale lock guidance when lock exists without info', () => { |
| 165 | const hint = resolveDaemonStartupHint({ hasInfo: false, hasLock: true }); |
no test coverage detected