pisesh 0.1.5 → 0.1.7

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/README.md +28 -65
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,44 +8,44 @@
8
8
 
9
9
  **Bookmark, search, and resume [pi coding-agent](https://github.com/earendil-works/pi) sessions with a fast keyboard-driven TUI.**
10
10
 
11
- > `pi --resume` lists every session you ever started. After a week that's 50+ entries with no titles, no tags, no order just scroll and pray. **pisesh** adds the one thing that was missing: ⭐ favorites, instant search, and a `[NOW]` badge for the session you're attached to.
11
+ > `pi --resume` lists every session you ever started. After a week that's 50+ entries with no titles, no tags, and no order, so you just scroll and hope. pisesh adds what was missing: ⭐ favorites, instant search, and a `[NOW]` badge for the session you're attached to.
12
12
 
13
13
  ## Preview
14
14
 
15
15
  <p align="center">
16
- <img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/preview.png" alt="pisesh Favorites tab in a real Windows Terminal session" width="100%">
16
+ <img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/preview.png" alt="pisesh Favorites tab in a real Windows Terminal session" width="100%">
17
17
  </p>
18
18
 
19
19
  <p align="center"><sub>Real capture: ★ starred session at the top, the rest available behind the <b>Today</b>, <b>Here</b>, and <b>All</b> tabs. <code>Tab</code> cycles. <code>f</code> stars. <code>Enter</code> resumes.</sub></p>
20
20
 
21
21
  ## Terminal walkthrough
22
22
 
23
- What the TUI actually looks like, screen by screen. (Demo data not real sessions.)
23
+ What the TUI looks like, screen by screen. The data below is made up, not real sessions.
24
24
 
25
- **Main list** the highlighted row is selected, tabs cycle with `Tab`. The green `[NOW]` badge marks the pi session you launched from; the cyan `✎` marks a session you renamed yourself. CJK titles stay column-aligned:
25
+ **Main list.** The highlighted row is the current selection, and `Tab` cycles through the tabs. The green `[NOW]` badge marks the pi session you launched from, and the cyan `✎` marks a session you renamed yourself. CJK titles stay column-aligned:
26
26
 
27
- <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-list.png" alt="pisesh main list Favorites tab with Today / Here / All tabs, [NOW] badge, and a renamed session" width="100%"></p>
27
+ <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-list.png" alt="pisesh main list, Favorites tab with Today / Here / All tabs, the NOW badge, and a renamed session" width="100%"></p>
28
28
 
29
- **`e` rename a session.** First user prompt is a lousy title for a long-lived thread. Press `e` to set your own; it's stored as an override (the session jsonl is never touched) and the session gets a `✎` marker in the list:
29
+ **`e` renames a session.** The first user prompt makes a poor title for a thread you keep coming back to, so press `e` to set your own. It's saved as an override (the session jsonl is never touched) and the session gets a `✎` marker in the list:
30
30
 
31
- <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-rename.png" alt="pisesh edit-name panel setting a custom display title" width="100%"></p>
31
+ <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-rename.png" alt="pisesh edit-name panel for setting a custom display title" width="100%"></p>
32
32
 
33
- **`p` re-point the working directory** with an arrow-key directory browser. This is the cwd pi will actually `cd` into on resume, and it's what the `Here` tab filters on. `s` locks in the highlighted directory:
33
+ **`p` re-points the working directory** through an arrow-key directory browser. This is the cwd pi actually `cd`s into on resume, and it's also what the `Here` tab filters on. Press `s` to lock in the highlighted directory:
34
34
 
35
- <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-cwd.png" alt="pisesh cwd browser arrow-key directory picker for the resume / Here directory" width="100%"></p>
35
+ <p align="center"><img src="https://raw.githubusercontent.com/Blue-B/pisesh/main/assets/screen-cwd.png" alt="pisesh cwd browser, an arrow-key directory picker for the resume and Here directory" width="100%"></p>
36
36
 
37
- The **`Here` tab** shows only sessions whose effective cwd matches the directory you launched pisesh from so inside a project you see just that project's threads, no scrolling past your home-dir scratch sessions.
37
+ The **`Here` tab** shows only sessions whose effective cwd matches the directory you launched pisesh from. Inside a project you see just that project's threads, without scrolling past your home-dir scratch sessions.
38
38
 
39
39
  ## Why pisesh
40
40
 
41
- Pi accumulates sessions across many working directories your home, several project dirs, scratch tmux panes. The built-in resume picker is alphabetical-ish and forgets context. After a few weeks:
41
+ Pi accumulates sessions across many working directories: your home, several project dirs, scratch tmux panes. The built-in resume picker is roughly alphabetical and forgets context. After a few weeks:
42
42
 
43
43
  - You can't tell which session was "the one where you fixed the auth bug"
44
44
  - You can't pin the 3-4 long-running threads you keep going back to
45
45
  - You re-open the wrong session and pollute it with unrelated context
46
46
  - You waste time searching by timestamp guessing
47
47
 
48
- pisesh is a **single-file Node script** (no dependencies, ~600 LoC) that gives you everything `pi --resume` doesn't.
48
+ pisesh is a **single-file Node script** (no dependencies, ~900 LoC) that gives you everything `pi --resume` doesn't.
49
49
 
50
50
  ### Value at a glance
51
51
 
@@ -55,9 +55,9 @@ pisesh is a **single-file Node script** (no dependencies, ~600 LoC) that gives y
55
55
  | Give a thread a real name | `e` sets a custom title (marked `✎`); overrides the first-prompt label |
56
56
  | See only the current project's sessions | `Here` tab filters to sessions whose cwd matches where you launched pisesh |
57
57
  | Fix where a session resumes | `p` opens an arrow-key directory browser; sets the cwd pi `cd`s into |
58
- | Find a session by what you said | `/` searches id + project + first user prompt |
58
+ | Find a session by what you said | `/` searches id + project + first user prompt + custom title |
59
59
  | Know which session you're attached to | `[NOW]` badge on the live session (passed from pi via env var) |
60
- | Keep your terminal clean | Alt-screen buffer exit restores your terminal byte-for-byte (like vim) |
60
+ | Keep your terminal clean | Alt-screen buffer, so quitting puts your terminal back the way it was (like vim) |
61
61
  | Read Korean / Chinese / Japanese prompts | Display-width-aware truncation; columns never blow up on CJK |
62
62
  | Open from anywhere | Run as standalone `pisesh` shell command, or `/sesh` inside pi |
63
63
  | Zero install pain | No build step, no native deps, runs on Node 18+ everywhere |
@@ -101,11 +101,11 @@ Pi-extension side: drop `extensions/sesh.ts` into `~/.pi/agent/extensions/` and
101
101
  | `↑` `↓` / `j` `k` | move cursor |
102
102
  | `Tab` / `h` / `l` | switch tab (`★ Favorites` → `Today` → `Here` → `All`) |
103
103
  | `f` / `Space` | star / unstar the selected session |
104
- | `Enter` | resume spawns `pi --session <id> --session-dir <dir>` |
105
- | `e` | edit name set a custom display title (marked `✎` in list) |
106
- | `p` | edit cwd arrow-key directory browser; sets resume / `Here` dir |
104
+ | `Enter` | resume the session; runs `pi --session <id>` in its (or the overridden) cwd |
105
+ | `e` | edit name: set a custom display title, shown with `✎` in the list |
106
+ | `p` | edit cwd with an arrow-key directory browser; sets the resume / `Here` dir |
107
107
  | `d` | session details (full prompt, file, byte size, timestamps) |
108
- | `/` | search by id / project / first user prompt |
108
+ | `/` | search by id / project / first user prompt / custom title |
109
109
  | `Esc` | clear search first, then quit |
110
110
  | `q` / `Ctrl-C` | quit (terminal restored) |
111
111
  | `r` | rescan session files (after pi starts a new session) |
@@ -132,49 +132,28 @@ pisesh --help
132
132
  | ------------------- | ------------------------------------------------------------------------------------------------ |
133
133
  | Runtime | Node.js ≥ 18 (uses only built-in modules: `fs`, `path`, `os`, `child_process`, `readline`) |
134
134
  | TUI rendering | Raw ANSI escape sequences (no `blessed` / `ink` / `chalk` dependency) |
135
- | Alt screen buffer | `\x1b[?1049h` / `\x1b[?1049l` same primitive as `vim`, `less`, `htop`, droid CLI |
135
+ | Alt screen buffer | `\x1b[?1049h` / `\x1b[?1049l`, the same primitive `vim`, `less`, `htop`, and droid CLI use |
136
136
  | Input | Node's `readline.emitKeypressEvents` in raw mode |
137
137
  | Width calculation | UAX #11 East Asian Width ranges, compressed to ~10 inline range checks |
138
138
  | Pi extension | TypeScript factory using `@earendil-works/pi-coding-agent` extension API (`ui.custom`, `tui.stop`) |
139
- | Storage | Single JSON file at `~/.pi/agent/favorites.json` (`{ ids: [...], updated: "iso" }`) |
139
+ | Storage | Two JSON files: `~/.pi/agent/favorites.json` (starred ids) + `~/.pi/agent/pisesh-meta.json` (per-session title / cwd overrides) |
140
140
  | Session discovery | Direct filesystem scan of `~/.pi/agent/sessions/<projectSlug>/*.jsonl`; first 96 KB parsed |
141
141
  | Process model | Slash command pauses pi's TUI, spawns pisesh with inherited stdio, restarts pi on exit |
142
142
 
143
143
  ### What it explicitly does **not** depend on
144
144
 
145
- - No `npm install` for the bundled CLI runtime true zero-dep
145
+ - No `npm install` for the bundled CLI runtime; it's genuinely zero-dependency
146
146
  - No native binaries / GPU / ffmpeg / database
147
147
  - No network calls, no telemetry, no analytics
148
148
  - No daemon / background process
149
149
 
150
- ## How resume works
151
-
152
- ```text
153
- pi (session A) ── /sesh ──▶ ui.custom + tui.stop()
154
-
155
- └─▶ spawn pisesh (PISESH_CURRENT_SESSION=A)
156
- │ ↑↓ Tab f / Enter on session B
157
-
158
- └─▶ spawn pi --session B --session-dir <dir>
159
-
160
- │ user works in B …
161
- │ user types q / ^D
162
-
163
- ◀─── inner pi exits, pisesh exits
164
-
165
- ◀─── tui.start() + requestRender(true)
166
- pi (session A) continues exactly where it was
167
- ```
168
-
169
- The current pi session is paused, not lost. When you finish with the resumed session, you pop back to A with full state intact.
170
-
171
150
  ## Storage
172
151
 
173
152
  | What | Where |
174
153
  | ---------- | ----------------------------------------------------------- |
175
154
  | Favorites | `~/.pi/agent/favorites.json` |
176
155
  | Overrides | `~/.pi/agent/pisesh-meta.json` (per-session custom title / cwd, keyed by session id) |
177
- | Sessions | `~/.pi/agent/sessions/<projectSlug>/<timestamp>_<uuid>.jsonl` (pi's native layout pisesh never writes here) |
156
+ | Sessions | `~/.pi/agent/sessions/<projectSlug>/<timestamp>_<uuid>.jsonl` (pi's native layout; pisesh never writes here) |
178
157
 
179
158
  Favorites file shape:
180
159
 
@@ -204,29 +183,13 @@ Korean / Chinese / Japanese / fullwidth characters render **2 cells wide** in te
204
183
 
205
184
  ## Requirements
206
185
 
207
- - **Node.js ≥ 18** (uses optional chaining, `for…of` on strings no transpile needed)
208
- - A terminal with ANSI escape + alternate screen buffer support basically every modern emulator:
186
+ - **Node.js ≥ 18** (uses optional chaining and `for…of` on strings, so no transpile step)
187
+ - A terminal with ANSI escape and alternate screen buffer support, which covers basically every modern emulator:
209
188
  - Windows: **Windows Terminal**, **WezTerm**, **Alacritty** ✅
210
189
  - macOS: **iTerm2**, **Terminal.app**, **WezTerm**, **Alacritty**, **Kitty** ✅
211
190
  - Linux: **GNOME Terminal**, **Konsole**, **xterm**, **Alacritty**, **Kitty** ✅
212
191
  - [`pi`](https://www.npmjs.com/package/@earendil-works/pi-coding-agent) on `$PATH` for the `Enter`-to-resume action
213
192
 
214
- ## Roadmap
215
-
216
- | Status | Item |
217
- | ------ | ------------------------------------------------------------------------------- |
218
- | ✅ | Tabs, star/unstar, search, alt-screen, CJK width, `[NOW]` badge, pi `/sesh` |
219
- | ✅ | `Here` tab — filter to sessions matching the launch directory |
220
- | ✅ | Inline rename (`e`) — custom display title that overrides the first prompt |
221
- | ✅ | Edit cwd (`p`) — arrow-key directory browser sets the resume / `Here` dir |
222
- | 🚧 | `n` / `N` jump to next / previous search match (less-style) |
223
- | 🚧 | Highlight matched substring in yellow |
224
- | 🚧 | Filter by `today/yesterday/this-week` |
225
- | 🧠 | Optional summarize first-N user prompts via local model for richer titles |
226
- | 🧠 | Export starred sessions as a single bundle (share / archive) |
227
-
228
- PRs welcome for anything in the 🚧 lane.
229
-
230
193
  ## Contributing
231
194
 
232
195
  ```bash
@@ -236,10 +199,10 @@ npm link
236
199
  npm test # node --check + smoke test
237
200
  ```
238
201
 
239
- Branching: short-lived `feature/<scope>` or `fix/<scope>` squash-merge into `main`.
202
+ Branch from `main` with a short-lived `feature/<scope>` or `fix/<scope>`, then squash-merge back.
240
203
  Commits: [Conventional Commits](https://www.conventionalcommits.org/) style (`feat:`, `fix:`, `docs:`, `chore:`).
241
204
 
242
- Open a PR the CI matrix runs on Ubuntu / macOS / Windows × Node 18 / 20 / 22.
205
+ Open a PR. The CI matrix runs on Ubuntu, macOS, and Windows across Node 18, 20, and 22.
243
206
 
244
207
  ## Support
245
208
 
@@ -254,8 +217,8 @@ If pisesh saves you context-switching time or just makes pi nicer to live in, su
254
217
 
255
218
  ## Acknowledgments
256
219
 
257
- - [pi-coding-agent](https://github.com/earendil-works/pi) by [@mariozechner](https://github.com/mariozechner) the agent and its extension API that make `/sesh` possible.
258
- - [interactive-shell example extension](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/interactive-shell.ts) pattern reference for `ui.custom` + `tui.stop` TTY handoff.
220
+ - [pi-coding-agent](https://github.com/earendil-works/pi) by [@mariozechner](https://github.com/mariozechner), the agent and extension API that make `/sesh` possible.
221
+ - [interactive-shell example extension](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/interactive-shell.ts), the pattern reference for the `ui.custom` + `tui.stop` TTY handoff.
259
222
  - Inspiration for the favorites + tabs UX: [droid CLI](https://github.com/factory-ai/droid) and tmux's [sesh](https://github.com/joshmedeski/sesh).
260
223
 
261
224
  ## License
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pisesh",
3
- "version": "0.1.5",
3
+ "version": "0.1.7",
4
4
  "description": "Bookmark, search, and resume pi coding-agent sessions with a fast keyboard-driven TUI.",
5
5
  "keywords": [
6
6
  "pi-package",