MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / askQuestion

Function askQuestion

packages/cli/src/telemetry/feedback.ts:110–130  ·  view source on GitHub ↗
(prompt: string)

Source from the content-addressed store, hash-verified

108}
109
110function askQuestion(prompt: string): Promise<string> {
111 return new Promise((resolve) => {
112 const rl = readline.createInterface({
113 input: process.stdin,
114 output: process.stdout,
115 });
116 rl.question(prompt, (answer) => {
117 rl.close();
118 resolve(answer);
119 });
120 // Auto-resolve after 10 seconds so the CLI never hangs
121 const timeout = setTimeout(() => {
122 rl.close();
123 resolve("");
124 }, 10_000);
125 // Don't keep the process alive just for the timeout
126 if (typeof timeout === "object" && timeout !== null && "unref" in timeout) {
127 (timeout as { unref: () => void }).unref();
128 }
129 });
130}

Callers 1

Calls 2

resolveFunction · 0.85
closeMethod · 0.65

Tested by

no test coverage detected