@stevezhou/sisu 0.3.13 → 0.3.14
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/tui.js +18 -12
- package/package.json +1 -1
package/dist/tui.js
CHANGED
|
@@ -305,7 +305,9 @@ async function runTui(io, deps = {}) {
|
|
|
305
305
|
});
|
|
306
306
|
});
|
|
307
307
|
if (deps.spawnGrokPager || ((0, launch_1.findGrokBuildBinary)() && process.stdout.isTTY)) {
|
|
308
|
-
// Login handoff: pager exits 10 → host web login at most once → respawn
|
|
308
|
+
// Login handoff: pager exits 10 → host web login at most once → respawn
|
|
309
|
+
// grok-pager. Never fall through to the Node TUI while the grok binary ran.
|
|
310
|
+
let retriedWithSession = false;
|
|
309
311
|
while (true) {
|
|
310
312
|
const code = await spawnOnce();
|
|
311
313
|
if (code === null)
|
|
@@ -313,19 +315,23 @@ async function runTui(io, deps = {}) {
|
|
|
313
315
|
if (code !== exports.SISU_LOGIN_EXIT_CODE)
|
|
314
316
|
return code;
|
|
315
317
|
restoreInteractiveTerminal(io);
|
|
316
|
-
if (auth()
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
318
|
+
if (!auth() && !openedBrowserLogin) {
|
|
319
|
+
try {
|
|
320
|
+
const email = await startWebLogin((line) => io.write(`${line}\n`));
|
|
321
|
+
io.write(`logged in as ${email}\n`);
|
|
322
|
+
}
|
|
323
|
+
catch (error) {
|
|
324
|
+
io.write(`${error instanceof Error ? error.message : String(error)}\n`);
|
|
325
|
+
io.write('login failed — run `sisu login`\n');
|
|
326
|
+
return 1;
|
|
327
|
+
}
|
|
328
|
+
continue;
|
|
323
329
|
}
|
|
324
|
-
|
|
325
|
-
io.write(
|
|
326
|
-
|
|
327
|
-
return 1;
|
|
330
|
+
if (retriedWithSession) {
|
|
331
|
+
io.write('sisu: grok pager still requesting login after a saved session.\n');
|
|
332
|
+
return exports.SISU_LOGIN_EXIT_CODE;
|
|
328
333
|
}
|
|
334
|
+
retriedWithSession = true;
|
|
329
335
|
}
|
|
330
336
|
}
|
|
331
337
|
}
|