MCPcopy Create free account
hub / github.com/backnotprop/plannotator / logReadyFile

Function logReadyFile

apps/opencode-plugin/cli-bridge.ts:231–246  ·  view source on GitHub ↗
(client: OpenCodeClient, readyFile: string, readyLabel: string, loggedUrls: Set<string>)

Source from the content-addressed store, hash-verified

229}
230
231function 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
248async function runPlannotatorCli(options: RunCliOptions): Promise<RunCliResult> {
249 const readyFile = path.join(

Callers 1

runPlannotatorCliFunction · 0.85

Calls 4

parseMethod · 0.80
hasMethod · 0.80
addMethod · 0.80
logFunction · 0.70

Tested by

no test coverage detected