@oxecli/oxe 1.0.8 → 1.0.10
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/cli.js +9 -1
- package/dist/config.js +1 -4
- package/dist/ui.js +5 -4
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -290,6 +290,9 @@ export class CLI {
|
|
|
290
290
|
break;
|
|
291
291
|
}
|
|
292
292
|
this.interruptPending = true;
|
|
293
|
+
// clearBox leaves the cursor on the leading blank row; the newline
|
|
294
|
+
// below places the message one row lower, giving one blank above it
|
|
295
|
+
// (mirrors Python's console.print()).
|
|
293
296
|
process.stdout.write("\n");
|
|
294
297
|
process.stdout.write(wasActive
|
|
295
298
|
? "\x1b[2mInterrupted. Press Ctrl+C again to exit, or type a new prompt.\x1b[0m\n"
|
|
@@ -310,6 +313,9 @@ export async function main() {
|
|
|
310
313
|
}
|
|
311
314
|
catch (err) {
|
|
312
315
|
if (err?.message === "interrupt" || err?.message === "eof") {
|
|
316
|
+
// cleanup() already moved to a fresh line; the leading newline below
|
|
317
|
+
// leaves that row as a blank, giving exactly one blank under the prompt,
|
|
318
|
+
// and the trailing newline gives one blank under the goodbye message.
|
|
313
319
|
process.stdout.write("\nClosing terminal session. Goodbye!\n");
|
|
314
320
|
return;
|
|
315
321
|
}
|
|
@@ -322,6 +328,8 @@ export async function main() {
|
|
|
322
328
|
}
|
|
323
329
|
finally {
|
|
324
330
|
await engine.cleanupStoredResponses();
|
|
325
|
-
|
|
331
|
+
const client = engine.client;
|
|
332
|
+
if (typeof client?.close === "function")
|
|
333
|
+
await client.close();
|
|
326
334
|
}
|
|
327
335
|
}
|
package/dist/config.js
CHANGED
|
@@ -169,13 +169,11 @@ export async function loadOrPrompt() {
|
|
|
169
169
|
authSpinner.stop();
|
|
170
170
|
if (validation.valid) {
|
|
171
171
|
key_data = validation.key_data || {};
|
|
172
|
-
process.stdout.write("\n");
|
|
173
172
|
process.stdout.write(markupToAnsi(`[green]✓ Oxe API Key verified[/green] [dim](${String(key_data["name"] ?? "Desktop")})[/dim]`) + "\n");
|
|
174
173
|
process.env.OXE_API_KEY = api_key;
|
|
175
174
|
break;
|
|
176
175
|
}
|
|
177
176
|
else {
|
|
178
|
-
process.stdout.write("\n");
|
|
179
177
|
process.stdout.write(`\x1b[31mAuthentication Error:\x1b[0m ${validation.error}\n`);
|
|
180
178
|
process.stdout.write("\n");
|
|
181
179
|
api_key = "";
|
|
@@ -238,9 +236,8 @@ export async function promptApiKey(prompt) {
|
|
|
238
236
|
const onData = (buf) => {
|
|
239
237
|
for (const b of buf) {
|
|
240
238
|
if (b === 3) {
|
|
241
|
-
// Ctrl+C
|
|
239
|
+
// Ctrl+C: cleanup() already writes the terminating newline.
|
|
242
240
|
cleanup();
|
|
243
|
-
process.stdout.write("\n");
|
|
244
241
|
reject(new Error("interrupt"));
|
|
245
242
|
return;
|
|
246
243
|
}
|
package/dist/ui.js
CHANGED
|
@@ -622,11 +622,12 @@ export function askBottomPrompt(label = "You", prefix = "❯", history = []) {
|
|
|
622
622
|
lastTotalRows = totalRows;
|
|
623
623
|
const frameLines = frame.split("\n");
|
|
624
624
|
if (isFirst) {
|
|
625
|
-
//
|
|
626
|
-
//
|
|
627
|
-
//
|
|
625
|
+
// The caller's content always ends with "\n", so the cursor sits at the
|
|
626
|
+
// start of a fresh (blank) line — that line is the leading blank
|
|
627
|
+
// separator (mirrors the original's Group(Text(""), panel)). Move down
|
|
628
|
+
// one line so the box starts below that blank; do NOT emit a second
|
|
629
|
+
// blank here (it caused a double gap above the box / on cancel).
|
|
628
630
|
process.stdout.write("\n");
|
|
629
|
-
process.stdout.write("\r\x1b[K\n");
|
|
630
631
|
}
|
|
631
632
|
else {
|
|
632
633
|
// Cursor currently sits at cursorRow (inside the box). Move to the top
|