MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / firstLine

Function firstLine

src/workspaces/adapters/codex.ts:367–377  ·  view source on GitHub ↗

First line only — codex rollout line-1 (session_meta) can be many KB * (it embeds the full base instructions), so stream rather than readFile.

(fp: string)

Source from the content-addressed store, hash-verified

365/** First line only — codex rollout line-1 (session_meta) can be many KB
366 * (it embeds the full base instructions), so stream rather than readFile. */
367async function firstLine(fp: string): Promise<string> {
368 const input = createReadStream(fp, { encoding: 'utf8' });
369 const rl = createInterface({ input, crlfDelay: Infinity });
370 try {
371 for await (const line of rl) return line;
372 return '';
373 } finally {
374 rl.close();
375 input.destroy();
376 }
377}
378
379/**
380 * Add (or no-op if present) a `[projects."<abs>"] trust_level = "trusted"`

Callers 1

listOnDiskFunction · 0.85

Calls 1

closeMethod · 0.65

Tested by

no test coverage detected