( sessionId: string, cycle: number, sessionIndex: number, options: CliOptions, )
| 269 | } |
| 270 | |
| 271 | function makeRegistration( |
| 272 | sessionId: string, |
| 273 | cycle: number, |
| 274 | sessionIndex: number, |
| 275 | options: CliOptions, |
| 276 | ) { |
| 277 | const cwd = `/tmp/hunk-daemon-memory/${cycle}/${sessionIndex}`; |
| 278 | const files = Array.from({ length: options.filesPerSession }, (_, fileIndex) => |
| 279 | makeReviewFile(sessionId, fileIndex, options), |
| 280 | ); |
| 281 | |
| 282 | return { |
| 283 | registrationVersion: SESSION_BROKER_REGISTRATION_VERSION, |
| 284 | sessionId, |
| 285 | pid: process.pid, |
| 286 | cwd, |
| 287 | repoRoot: cwd, |
| 288 | launchedAt: new Date().toISOString(), |
| 289 | info: { |
| 290 | inputKind: "vcs", |
| 291 | title: `memory test ${sessionId}`, |
| 292 | sourceLabel: cwd, |
| 293 | files, |
| 294 | }, |
| 295 | }; |
| 296 | } |
| 297 | |
| 298 | function makeSnapshot(sessionId: string, updateIndex = 0, options: CliOptions = defaultOptions) { |
| 299 | const fileIndex = updateIndex % Math.max(1, options.filesPerSession); |
no test coverage detected