(client: OpenCodeClient, readyFile: string, readyLabel: string, loggedUrls: Set<string>)
| 229 | } |
| 230 | |
| 231 | function logReadyFile(client: OpenCodeClient, readyFile: string, readyLabel: string, loggedUrls: Set<string>): void { |
| 232 | if (!existsSync(readyFile)) return; |
| 233 | |
| 234 | const contents = readFileSync(readyFile, "utf-8"); |
| 235 | for (const line of contents.split(/\r?\n/)) { |
| 236 | if (!line.trim()) continue; |
| 237 | try { |
| 238 | const metadata = JSON.parse(line) as { url?: string }; |
| 239 | if (!metadata.url || loggedUrls.has(metadata.url)) continue; |
| 240 | loggedUrls.add(metadata.url); |
| 241 | log(client, "info", `[Plannotator] Open ${readyLabel}: ${metadata.url}`); |
| 242 | } catch { |
| 243 | // Ignore partial lines while the child process is writing. |
| 244 | } |
| 245 | } |
| 246 | } |
| 247 | |
| 248 | async function runPlannotatorCli(options: RunCliOptions): Promise<RunCliResult> { |
| 249 | const readyFile = path.join( |
no test coverage detected