MCPcopy
hub / github.com/garrytan/gstack / parseBrief

Function parseBrief

design/src/brief.ts:46–59  ·  view source on GitHub ↗
(input: string, isFile: boolean)

Source from the content-addressed store, hash-verified

44 * Parse a brief from either a plain text string or a JSON file path.
45 */
46export function parseBrief(input: string, isFile: boolean): string {
47 if (!isFile) {
48 // Plain text prompt — use directly
49 return input;
50 }
51
52 // JSON file — parse and convert to prompt
53 const raw = Bun.file(input);
54 // We'll read it synchronously via fs since Bun.file is async
55 const fs = require("fs");
56 const content = fs.readFileSync(input, "utf-8");
57 const brief: DesignBrief = JSON.parse(content);
58 return briefToPrompt(brief);
59}

Callers 2

generateFunction · 0.90
variantsFunction · 0.90

Calls 1

briefToPromptFunction · 0.85

Tested by

no test coverage detected