@stevezhou/sisu 0.3.16 → 0.3.18

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/README.md CHANGED
@@ -6,16 +6,39 @@ One login. Cloud quota. Local runtime. Auth lives in `~/.sisu`, shared with SiSu
6
6
 
7
7
  ## Install
8
8
 
9
+ macOS / Linux / WSL:
10
+
9
11
  ```bash
10
- npm install -g @stevezhou/sisu
11
- sisu --help
12
+ curl -fsSL https://www.sisu.chat/install.sh | bash
13
+ sisu login
14
+ sisu
15
+ ```
16
+
17
+ Windows PowerShell:
18
+
19
+ ```powershell
20
+ irm https://www.sisu.chat/install.ps1 | iex
12
21
  sisu login
13
22
  sisu
14
23
  ```
15
24
 
16
- Postinstall puts `sisu` on a PATH users actually have: `~/.local/bin` on Unix, `%LOCALAPPDATA%\sisu\bin` on Windows (wrappers that call npm's `sisu.cmd`, plus a Git Bash `sisu`). It also appends that Windows directory to the user PATH. If this shell still cannot see the command, it prints `export PATH=...` (Unix) or `set PATH=` / `$env:Path` (Windows). `npm install -g` is a small JS package. It also fetches the stamped SiSu TUI pager for **this package version** into `~/.sisu/bin` when a prebuilt exists. GitHub Release tags ship `darwin-arm64`, `linux-x64`, and `linux-arm64`. `darwin-x64` is opt-in (`workflow_dispatch` with `platforms` containing `darwin-x64`) and often missing; platforms without a binary, or a missing GitHub Release asset, keep the Node TUI.
25
+ Windows CMD:
26
+
27
+ ```bat
28
+ curl -fsSL https://www.sisu.chat/install.cmd -o install.cmd && install.cmd && del install.cmd
29
+ ```
30
+
31
+ The installer does **not** apt/brew/winget a system Node. If `node` ≥ 20 is already on PATH, it uses that. Otherwise it unpacks official Node 22 into `~/.sisu/node` (user-local, no sudo) and `npm install -g --prefix ~/.sisu @stevezhou/sisu`. Unix gets `~/.sisu/bin` plus a `~/.local/bin/sisu` link; Windows adds `~/.sisu` to the user PATH.
32
+
33
+ Already have Node 20+ and prefer npm:
34
+
35
+ ```bash
36
+ npm install -g @stevezhou/sisu
37
+ ```
38
+
39
+ Postinstall also puts `sisu` on a PATH users actually have: `~/.local/bin` on Unix, `%LOCALAPPDATA%\sisu\bin` on Windows (wrappers that call npm's `sisu.cmd`, plus a Git Bash `sisu`). If this shell still cannot see the command, it prints `export PATH=...` (Unix) or `set PATH=` / `$env:Path` (Windows). `npm install -g` is a small JS package. It also fetches the stamped SiSu TUI pager for **this package version** into `~/.sisu/bin` when a prebuilt exists. GitHub Release tags ship `darwin-arm64`, `linux-x64`, and `linux-arm64`. `darwin-x64` is opt-in (`workflow_dispatch` with `platforms` containing `darwin-x64`) and often missing; platforms without a binary, or a missing GitHub Release asset, keep the Node TUI.
17
40
 
18
- Requires Node.js 20 or newer. `npx sisu` works without a global install.
41
+ `npx sisu` works without a global install.
19
42
 
20
43
  `sisu update` reinstalls that stamped pager for the installed CLI version. It is not a grok-style background auto-updater.
21
44
 
package/dist/main.js CHANGED
@@ -2,6 +2,7 @@
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
4
  exports.helpText = helpText;
5
+ exports.pagerResumeArgs = pagerResumeArgs;
5
6
  exports.runCli = runCli;
6
7
  const module_1 = require("module");
7
8
  const commands_1 = require("./commands");
@@ -41,6 +42,7 @@ Usage:
41
42
  sisu thread <conversation-id>
42
43
  sisu training --on|--off
43
44
  sisu interactive TUI (思溯 / SiSu · 思有所溯)
45
+ sisu --resume <id> reopen a local pager session
44
46
  sisu --version
45
47
  sisu help
46
48
 
@@ -57,6 +59,19 @@ function flag(args, name) {
57
59
  return undefined;
58
60
  return args[index + 1];
59
61
  }
62
+ function pagerResumeArgs(argv) {
63
+ const [command, ...args] = argv;
64
+ if (command === '--resume') {
65
+ return args[0] && !args[0].startsWith('-') ? ['--resume', args[0]] : ['--resume'];
66
+ }
67
+ if (command && command !== 'tui')
68
+ return [];
69
+ const index = args.indexOf('--resume');
70
+ if (index === -1)
71
+ return [];
72
+ const id = args[index + 1];
73
+ return id && !id.startsWith('-') ? ['--resume', id] : ['--resume'];
74
+ }
60
75
  function parseArgs(args) {
61
76
  const flags = {};
62
77
  const rest = [];
@@ -87,8 +102,8 @@ async function runCli(argv, deps = {}) {
87
102
  process.stdout.write(`sisu ${client_1.SISU_CLIENT_VERSION} — ${logo_1.SISU_BRAND.zh} ${logo_1.SISU_BRAND.en} · ${logo_1.SISU_BRAND.headline}\n`);
88
103
  return 0;
89
104
  }
90
- if (!command || command === 'tui') {
91
- return (0, tui_1.runTui)((0, tui_1.defaultTuiIo)());
105
+ if (!command || command === 'tui' || command === '--resume') {
106
+ return (0, tui_1.runTui)((0, tui_1.defaultTuiIo)(), { pagerArgs: pagerResumeArgs(argv) });
92
107
  }
93
108
  if (command === 'update') {
94
109
  const install = deps.installPager ?? defaultInstallPager;
package/dist/tui.js CHANGED
@@ -264,8 +264,10 @@ async function runTui(io, deps = {}) {
264
264
  }
265
265
  }
266
266
  if (usePager && (deps.spawnGrokPager || !deps.pager)) {
267
- const spawnOnce = deps.spawnGrokPager ??
268
- (() => {
267
+ const pagerArgs = deps.pagerArgs ?? [];
268
+ const spawnOnce = (deps.spawnGrokPager
269
+ ? () => deps.spawnGrokPager(pagerArgs)
270
+ : () => {
269
271
  const grokBin = (0, launch_1.findGrokBuildBinary)();
270
272
  if (!grokBin || !process.stdout.isTTY) {
271
273
  return Promise.resolve(null);
@@ -291,7 +293,7 @@ async function runTui(io, deps = {}) {
291
293
  return (0, transcriptEvents_1.postTranscriptEvent)(http, current.api_base || store_1.DEFAULT_API_BASE, current.token, event);
292
294
  },
293
295
  });
294
- const child = (0, child_process_1.spawn)(grokBin, [], {
296
+ const child = (0, child_process_1.spawn)(grokBin, pagerArgs, {
295
297
  stdio: 'inherit',
296
298
  env,
297
299
  cwd: process.cwd(),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stevezhou/sisu",
3
- "version": "0.3.16",
3
+ "version": "0.3.18",
4
4
  "description": "SiSu CLI — 思溯 / SiSu · 思有所溯",
5
5
  "license": "UNLICENSED",
6
6
  "homepage": "https://www.sisu.chat",