@haystackeditor/cli 0.15.4 → 0.15.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/utils/prompter.js +6 -6
- package/package.json +1 -1
package/dist/utils/prompter.js
CHANGED
|
@@ -164,8 +164,8 @@ class JsonPrompter {
|
|
|
164
164
|
if (!obj || typeof obj !== 'object')
|
|
165
165
|
return;
|
|
166
166
|
// Mirror OpenCode: question replies are keyed by `requestID`, permission
|
|
167
|
-
// replies by `permissionID`.
|
|
168
|
-
const key = (obj.requestID ?? obj.permissionID
|
|
167
|
+
// replies by `permissionID`.
|
|
168
|
+
const key = (obj.requestID ?? obj.permissionID);
|
|
169
169
|
if (typeof key !== 'string')
|
|
170
170
|
return;
|
|
171
171
|
const resolve = this.pending.get(key);
|
|
@@ -199,7 +199,7 @@ class JsonPrompter {
|
|
|
199
199
|
// string "false" isn't coerced truthy.
|
|
200
200
|
if (reply.reject)
|
|
201
201
|
throw new PromptCancelledError(q.id);
|
|
202
|
-
return toBool(reply.answers
|
|
202
|
+
return toBool(reply.answers);
|
|
203
203
|
}
|
|
204
204
|
async multiselect(q) {
|
|
205
205
|
if (q.id in this.answers)
|
|
@@ -215,7 +215,7 @@ class JsonPrompter {
|
|
|
215
215
|
// than silently coercing to [] (PR001: no silent fallback).
|
|
216
216
|
if (reply.reject)
|
|
217
217
|
throw new PromptCancelledError(q.id);
|
|
218
|
-
return asArray(reply.answers
|
|
218
|
+
return asArray(reply.answers, q.id);
|
|
219
219
|
}
|
|
220
220
|
async action(q) {
|
|
221
221
|
if (this.answers[q.id] === 'skip')
|
|
@@ -232,8 +232,8 @@ class JsonPrompter {
|
|
|
232
232
|
let override = null;
|
|
233
233
|
this.ensureStdin();
|
|
234
234
|
const answerPromise = this.awaitReply(q.id).then((reply) => {
|
|
235
|
-
const r =
|
|
236
|
-
override = r === 'reject'
|
|
235
|
+
const r = reply.response;
|
|
236
|
+
override = r === 'reject' ? 'skip' : 'done';
|
|
237
237
|
});
|
|
238
238
|
try {
|
|
239
239
|
while (Date.now() - started < timeout) {
|