@@ -60107,12 +60107,11 @@ function cursorDown(n) {
6010760107 return n > 0 ? import_ansi_escapes.default.cursorDown(n) : "";
6010860108}
6010960109var ScreenManager = class {
60110- rl;
6011160110 height = 0;
6011260111 extraLinesUnderPrompt = 0;
6011360112 cursorPos;
60113+ rl;
6011460114 constructor(rl) {
60115- this.rl = rl;
6011660115 this.rl = rl;
6011760116 this.cursorPos = rl.getCursorPos();
6011860117 }
@@ -60179,23 +60178,22 @@ var PromisePolyfill = class extends Promise {
6017960178//
6018060179function getCallSites() {
6018160180 const _prepareStackTrace = Error.prepareStackTrace;
60181+ let result = [];
6018260182 try {
60183- let result = [];
6018460183 Error.prepareStackTrace = (_, callSites) => {
6018560184 const callSitesWithoutCurrent = callSites.slice(1);
6018660185 result = callSitesWithoutCurrent;
6018760186 return callSitesWithoutCurrent;
6018860187 };
6018960188 new Error().stack;
60189+ } catch {
6019060190 return result;
60191- } finally {
60192- Error.prepareStackTrace = _prepareStackTrace;
6019360191 }
60192+ Error.prepareStackTrace = _prepareStackTrace;
60193+ return result;
6019460194}
6019560195function createPrompt(view) {
60196- var _a, _b;
6019760196 const callSites = getCallSites();
60198- const callerFilename = (_b = (_a = callSites[1]) == null ? void 0 : _a.getFileName) == null ? void 0 : _b.call(_a);
6019960197 const prompt = (config, context2 = {}) => {
6020060198 const { input = process.stdin, signal } = context2;
6020160199 const cleanups = /* @__PURE__ */ new Set();
@@ -60229,11 +60227,13 @@ function createPrompt(view) {
6022960227 rl.on("close", hooksCleanup);
6023060228 cleanups.add(() => rl.removeListener("close", hooksCleanup));
6023160229 cycle(() => {
60230+ var _a, _b;
6023260231 try {
6023360232 const nextView = view(config, (value) => {
6023460233 setImmediate(() => resolve(value));
6023560234 });
6023660235 if (nextView === void 0) {
60236+ const callerFilename = (_b = (_a = callSites[1]) == null ? void 0 : _a.getFileName) == null ? void 0 : _b.call(_a);
6023760237 throw new Error(`Prompt functions must return a string.
6023860238 at ${callerFilename}`);
6023960239 }
0 commit comments