@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.
Files changed (2) hide show
  1. package/dist/tui.js +18 -12
  2. 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() || openedBrowserLogin) {
317
- io.write('sisu: session already saved; not opening another login page.\n');
318
- break;
319
- }
320
- try {
321
- const email = await startWebLogin((line) => io.write(`${line}\n`));
322
- io.write(`logged in as ${email}\n`);
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
- catch (error) {
325
- io.write(`${error instanceof Error ? error.message : String(error)}\n`);
326
- io.write('login failed — run `sisu login`\n');
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stevezhou/sisu",
3
- "version": "0.3.13",
3
+ "version": "0.3.14",
4
4
  "description": "SiSu CLI — 思溯 / SiSu · 思有所溯",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://www.sisu.chat",